Pecuario.Backend

<back to all web services

GetLandDetails

The following routes are available for this service:
GET/api/v1/lands/{LandId}
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 DetailRow implements IConvertible
{
    int? order;
    String? textType;
    String? text;

    DetailRow({this.order,this.textType,this.text});
    DetailRow.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        order = json['order'];
        textType = json['textType'];
        text = json['text'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'order': order,
        'textType': textType,
        'text': text
    };

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

class LandDetails implements IConvertible
{
    String? id;
    String? date;
    List<String>? images;
    List<DetailRow>? detailRows;
    bool? contactEnabled;
    String? contactLink;
    String? priceType;
    String? price;

    LandDetails({this.id,this.date,this.images,this.detailRows,this.contactEnabled,this.contactLink,this.priceType,this.price});
    LandDetails.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        date = json['date'];
        images = JsonConverters.fromJson(json['images'],'List<String>',context!);
        detailRows = JsonConverters.fromJson(json['detailRows'],'List<DetailRow>',context!);
        contactEnabled = json['contactEnabled'];
        contactLink = json['contactLink'];
        priceType = json['priceType'];
        price = json['price'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'date': date,
        'images': JsonConverters.toJson(images,'List<String>',context!),
        'detailRows': JsonConverters.toJson(detailRows,'List<DetailRow>',context!),
        'contactEnabled': contactEnabled,
        'contactLink': contactLink,
        'priceType': priceType,
        'price': price
    };

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

class GetLandDetailsResponse extends BaseResponse implements IConvertible
{
    LandDetails? details;

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

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

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'details': JsonConverters.toJson(details,'LandDetails',context!)
    });

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

class GetLandDetails implements IGet, IConvertible
{
    String? landId;

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

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

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

    getTypeName() => "GetLandDetails";
    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()),
    'DetailRow': TypeInfo(TypeOf.Class, create:() => DetailRow()),
    'LandDetails': TypeInfo(TypeOf.Class, create:() => LandDetails()),
    'List<DetailRow>': TypeInfo(TypeOf.Class, create:() => <DetailRow>[]),
    'GetLandDetailsResponse': TypeInfo(TypeOf.Class, create:() => GetLandDetailsResponse()),
    'GetLandDetails': TypeInfo(TypeOf.Class, create:() => GetLandDetails()),
});

Dart GetLandDetails DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

GET /api/v1/lands/{LandId} HTTP/1.1 
Host: pecuario-backend.develsystems.com 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"details":{"id":"String","date":"String","images":["String"],"detailRows":[{}],"contactEnabled":false,"contactLink":"String","priceType":"String","price":"String"}}