Pecuario.Backend

<back to all web services

RequestCredit

The following routes are available for this service:
POST/api/v1/credit/request
import 'package:servicestack/servicestack.dart';

class Status implements IConvertible
{
    String? message;
    int? statusCode;

    Status({this.message,this.statusCode});
    Status.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        message = json['message'];
        statusCode = json['statusCode'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'message': message,
        'statusCode': statusCode
    };

    getTypeName() => "Status";
    TypeContext? context = _ctx;
}

class BaseResponse implements IConvertible
{
    Status? status;

    BaseResponse({this.status});
    BaseResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        status = JsonConverters.fromJson(json['status'],'Status',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'status': JsonConverters.toJson(status,'Status',context!)
    };

    getTypeName() => "BaseResponse";
    TypeContext? context = _ctx;
}

class RequestCreditResponse extends BaseResponse implements IConvertible
{
    String? id;

    RequestCreditResponse({this.id});
    RequestCreditResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        id = json['id'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'id': id
    });

    getTypeName() => "RequestCreditResponse";
    TypeContext? context = _ctx;
}

class RequestCredit implements IPost, IConvertible
{
    String? nombre;
    String? dpi;
    String? fechaDeNacimiento;
    String? telefono;
    double? montoAFinanciar;
    int? regionId;
    int? cityId;

    RequestCredit({this.nombre,this.dpi,this.fechaDeNacimiento,this.telefono,this.montoAFinanciar,this.regionId,this.cityId});
    RequestCredit.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        nombre = json['nombre'];
        dpi = json['dpi'];
        fechaDeNacimiento = json['fechaDeNacimiento'];
        telefono = json['telefono'];
        montoAFinanciar = JsonConverters.toDouble(json['montoAFinanciar']);
        regionId = json['regionId'];
        cityId = json['cityId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'nombre': nombre,
        'dpi': dpi,
        'fechaDeNacimiento': fechaDeNacimiento,
        'telefono': telefono,
        'montoAFinanciar': montoAFinanciar,
        'regionId': regionId,
        'cityId': cityId
    };

    getTypeName() => "RequestCredit";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'pecuario_backend.develsystems.com', types: <String, TypeInfo> {
    'Status': TypeInfo(TypeOf.Class, create:() => Status()),
    'BaseResponse': TypeInfo(TypeOf.Class, create:() => BaseResponse()),
    'RequestCreditResponse': TypeInfo(TypeOf.Class, create:() => RequestCreditResponse()),
    'RequestCredit': TypeInfo(TypeOf.Class, create:() => RequestCredit()),
});

Dart RequestCredit DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /api/v1/credit/request HTTP/1.1 
Host: pecuario-backend.develsystems.com 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"nombre":"String","dpi":"String","fechaDeNacimiento":"String","telefono":"String","montoAFinanciar":0,"regionId":0,"cityId":0}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"id":"String"}