sfgboxapi

<back to all web services

CropsAdd

Requires Authentication
The following routes are available for this service:
POST/crops
import 'package:servicestack/servicestack.dart';

class CropsAddResponse implements IConvertible
{
    // @DataMember(Order=2)
    int? tenantsId;

    // @DataMember(Order=3)
    int? zonesId;

    // @DataMember(Order=4)
    String? name;

    // @DataMember(Order=5)
    String? latinName;

    // @DataMember(Order=6)
    String? soldDescription;

    // @DataMember(Order=8)
    ResponseStatus? responseStatus;

    CropsAddResponse({this.tenantsId,this.zonesId,this.name,this.latinName,this.soldDescription,this.responseStatus});
    CropsAddResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        tenantsId = json['tenantsId'];
        zonesId = json['zonesId'];
        name = json['name'];
        latinName = json['latinName'];
        soldDescription = json['soldDescription'];
        responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'tenantsId': tenantsId,
        'zonesId': zonesId,
        'name': name,
        'latinName': latinName,
        'soldDescription': soldDescription,
        'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!)
    };

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

// @DataContract
class CropsAdd implements IConvertible
{
    // @DataMember(Order=2)
    // @Validate(Validator="NotNull")
    int? tenantsId;

    // @DataMember(Order=3)
    // @Validate(Validator="NotNull")
    int? zonesId;

    // @DataMember(Order=4)
    // @Validate(Validator="NotNull")
    String? name;

    // @DataMember(Order=5)
    // @Validate(Validator="NotNull")
    String? latinName;

    // @DataMember(Order=6)
    // @Validate(Validator="NotNull")
    String? soldDescription;

    CropsAdd({this.tenantsId,this.zonesId,this.name,this.latinName,this.soldDescription});
    CropsAdd.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        tenantsId = json['tenantsId'];
        zonesId = json['zonesId'];
        name = json['name'];
        latinName = json['latinName'];
        soldDescription = json['soldDescription'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'tenantsId': tenantsId,
        'zonesId': zonesId,
        'name': name,
        'latinName': latinName,
        'soldDescription': soldDescription
    };

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

TypeContext _ctx = TypeContext(library: 'sfgboxapi.dev.scadsoftware.com', types: <String, TypeInfo> {
    'CropsAddResponse': TypeInfo(TypeOf.Class, create:() => CropsAddResponse()),
    'CropsAdd': TypeInfo(TypeOf.Class, create:() => CropsAdd()),
});

Dart CropsAdd DTOs

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

HTTP + OTHER

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

POST /crops HTTP/1.1 
Host: sfgboxapi.dev.scadsoftware.com 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"tenantsId":0,"zonesId":0,"name":"String","latinName":"String","soldDescription":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"tenantsId":0,"zonesId":0,"name":"String","latinName":"String","soldDescription":"String","responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}