sfgboxapi

<back to all web services

RolesAutoQueryAdd

import 'package:servicestack/servicestack.dart';

class Roles implements IConvertible
{
    // @DataMember(Order=1)
    // @required()
    int? id;

    // @DataMember(Order=2)
    // @required()
    // @References(typeof(Tenants))
    int? tenantsId;

    // @DataMember(Order=3)
    // @required()
    String? name;

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

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

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

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

class RolesAutoQueryAdd implements ICreateDb<Roles>, IConvertible
{
    // @DataMember(Order=2)
    int? tenantsId;

    // @DataMember(Order=3)
    String? roles;

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

    RolesAutoQueryAdd({this.tenantsId,this.roles,this.responseStatus});
    RolesAutoQueryAdd.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

TypeContext _ctx = TypeContext(library: 'api_stage.smartfarmertech.com', types: <String, TypeInfo> {
    'Roles': TypeInfo(TypeOf.Class, create:() => Roles()),
    'RolesAutoQueryAdd': TypeInfo(TypeOf.Class, create:() => RolesAutoQueryAdd()),
});

Dart RolesAutoQueryAdd 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.

POST /json/reply/RolesAutoQueryAdd HTTP/1.1 
Host: api-stage.smartfarmertech.com 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"tenantsId":0,"roles":"String","responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"id":0,"tenantsId":0,"name":"String"}