sfgboxapi

<back to all web services

ZonesAutoQueryAdd

import 'package:servicestack/servicestack.dart';

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

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

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

    // @DataMember(Order=4)
    // @required()
    bool? isMain;

    // @DataMember(Order=5)
    // @required()
    bool? isDefault;

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

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

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

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

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

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

    // @DataMember(Order=4)
    bool? isMain;

    // @DataMember(Order=5)
    bool? isDefault;

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

    ZonesAutoQueryAdd({this.tenantsId,this.name,this.isMain,this.isDefault,this.responseStatus});
    ZonesAutoQueryAdd.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

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

Dart ZonesAutoQueryAdd DTOs

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

HTTP + JSV

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

POST /jsv/reply/ZonesAutoQueryAdd HTTP/1.1 
Host: api-stage.smartfarmertech.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	tenantsId: 0,
	name: String,
	isMain: False,
	isDefault: False,
	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: text/jsv
Content-Length: length

{
	id: 0,
	tenantsId: 0,
	name: String,
	isMain: False,
	isDefault: False
}