| POST | /principal/check |
|---|
import 'package:servicestack/servicestack.dart';
class ApiServiceRequest implements IServiceRequest, IHasApiKey, IHasDeviceInfo, IConvertible
{
/**
* The API Key required for authentication
*/
// @ApiMember(DataType="string", Description="The API Key required for authentication", IsRequired=true)
String? ApiKey;
/**
* Latitude of the user making this request
*/
// @ApiMember(DataType="double", Description="Latitude of the user making this request")
double? Latitude;
/**
* Longitude of the user making this request
*/
// @ApiMember(DataType="double", Description="Longitude of the user making this request")
double? Longitude;
ApiServiceRequest({this.ApiKey,this.Latitude,this.Longitude});
ApiServiceRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ApiKey = json['ApiKey'];
Latitude = JsonConverters.toDouble(json['Latitude']);
Longitude = JsonConverters.toDouble(json['Longitude']);
return this;
}
Map<String, dynamic> toJson() => {
'ApiKey': ApiKey,
'Latitude': Latitude,
'Longitude': Longitude
};
getTypeName() => "ApiServiceRequest";
TypeContext? context = _ctx;
}
class ApiServiceResponse implements IServiceResponse, IConvertible
{
/**
* Information about the response.
*/
// @ApiMember(Description="Information about the response.", IsRequired=true)
String? Description;
/**
* Heading or summary of the response.
*/
// @ApiMember(Description="Heading or summary of the response.", IsRequired=true)
String? Heading;
/**
* Did the intended operation for this response complete successfully?
*/
// @ApiMember(DataType="boolean", Description="Did the intended operation for this response complete successfully?", IsRequired=true)
bool? WasSuccessful;
ResponseStatus? ResponseStatus;
ApiServiceResponse({this.Description,this.Heading,this.WasSuccessful,this.ResponseStatus});
ApiServiceResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Description = json['Description'];
Heading = json['Heading'];
WasSuccessful = json['WasSuccessful'];
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Description': Description,
'Heading': Heading,
'WasSuccessful': WasSuccessful,
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
};
getTypeName() => "ApiServiceResponse";
TypeContext? context = _ctx;
}
class PrincipalAppSync implements IConvertible
{
int? PrincipalId;
String? LastUpdated;
PrincipalAppSync({this.PrincipalId,this.LastUpdated});
PrincipalAppSync.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
PrincipalId = json['PrincipalId'];
LastUpdated = json['LastUpdated'];
return this;
}
Map<String, dynamic> toJson() => {
'PrincipalId': PrincipalId,
'LastUpdated': LastUpdated
};
getTypeName() => "PrincipalAppSync";
TypeContext? context = _ctx;
}
class UnitOfMeasureData implements IConvertible
{
int? Id;
String? Name;
UnitOfMeasureData({this.Id,this.Name});
UnitOfMeasureData.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
Name = json['Name'];
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'Name': Name
};
getTypeName() => "UnitOfMeasureData";
TypeContext? context = _ctx;
}
class AuthRuleData implements IConvertible
{
double? FromValue;
double? ToValue;
bool? Allow;
bool? AuthRequired;
String? Region;
String? Channel;
UnitOfMeasureData? UnitOfMeasure;
AuthRuleData({this.FromValue,this.ToValue,this.Allow,this.AuthRequired,this.Region,this.Channel,this.UnitOfMeasure});
AuthRuleData.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
FromValue = JsonConverters.toDouble(json['FromValue']);
ToValue = JsonConverters.toDouble(json['ToValue']);
Allow = json['Allow'];
AuthRequired = json['AuthRequired'];
Region = json['Region'];
Channel = json['Channel'];
UnitOfMeasure = JsonConverters.fromJson(json['UnitOfMeasure'],'UnitOfMeasureData',context!);
return this;
}
Map<String, dynamic> toJson() => {
'FromValue': FromValue,
'ToValue': ToValue,
'Allow': Allow,
'AuthRequired': AuthRequired,
'Region': Region,
'Channel': Channel,
'UnitOfMeasure': JsonConverters.toJson(UnitOfMeasure,'UnitOfMeasureData',context!)
};
getTypeName() => "AuthRuleData";
TypeContext? context = _ctx;
}
class PrincipalAuthRuleData implements IConvertible
{
int? PrincipalId;
List<AuthRuleData>? ValueAuthRules;
List<AuthRuleData>? UnitAuthRules;
PrincipalAuthRuleData({this.PrincipalId,this.ValueAuthRules,this.UnitAuthRules});
PrincipalAuthRuleData.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
PrincipalId = json['PrincipalId'];
ValueAuthRules = JsonConverters.fromJson(json['ValueAuthRules'],'List<AuthRuleData>',context!);
UnitAuthRules = JsonConverters.fromJson(json['UnitAuthRules'],'List<AuthRuleData>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'PrincipalId': PrincipalId,
'ValueAuthRules': JsonConverters.toJson(ValueAuthRules,'List<AuthRuleData>',context!),
'UnitAuthRules': JsonConverters.toJson(UnitAuthRules,'List<AuthRuleData>',context!)
};
getTypeName() => "PrincipalAuthRuleData";
TypeContext? context = _ctx;
}
class CheckPrincipalsResponse extends ApiServiceResponse implements IConvertible
{
List<int>? PrincipalsToUpdate;
List<PrincipalAppSync>? PrincipalAppSyncData;
List<PrincipalAuthRuleData>? AuthRules;
CheckPrincipalsResponse({this.PrincipalsToUpdate,this.PrincipalAppSyncData,this.AuthRules});
CheckPrincipalsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
PrincipalsToUpdate = JsonConverters.fromJson(json['PrincipalsToUpdate'],'List<int>',context!);
PrincipalAppSyncData = JsonConverters.fromJson(json['PrincipalAppSyncData'],'List<PrincipalAppSync>',context!);
AuthRules = JsonConverters.fromJson(json['AuthRules'],'List<PrincipalAuthRuleData>',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'PrincipalsToUpdate': JsonConverters.toJson(PrincipalsToUpdate,'List<int>',context!),
'PrincipalAppSyncData': JsonConverters.toJson(PrincipalAppSyncData,'List<PrincipalAppSync>',context!),
'AuthRules': JsonConverters.toJson(AuthRules,'List<PrincipalAuthRuleData>',context!)
});
getTypeName() => "CheckPrincipalsResponse";
TypeContext? context = _ctx;
}
class CheckPrincipals extends ApiServiceRequest implements IConvertible
{
List<PrincipalAppSync>? Principals;
CheckPrincipals({this.Principals});
CheckPrincipals.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
Principals = JsonConverters.fromJson(json['Principals'],'List<PrincipalAppSync>',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'Principals': JsonConverters.toJson(Principals,'List<PrincipalAppSync>',context!)
});
getTypeName() => "CheckPrincipals";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'returnit_api_dev.happen.zone', types: <String, TypeInfo> {
'ApiServiceRequest': TypeInfo(TypeOf.Class, create:() => ApiServiceRequest()),
'ApiServiceResponse': TypeInfo(TypeOf.Class, create:() => ApiServiceResponse()),
'PrincipalAppSync': TypeInfo(TypeOf.Class, create:() => PrincipalAppSync()),
'UnitOfMeasureData': TypeInfo(TypeOf.Class, create:() => UnitOfMeasureData()),
'AuthRuleData': TypeInfo(TypeOf.Class, create:() => AuthRuleData()),
'PrincipalAuthRuleData': TypeInfo(TypeOf.Class, create:() => PrincipalAuthRuleData()),
'List<AuthRuleData>': TypeInfo(TypeOf.Class, create:() => <AuthRuleData>[]),
'CheckPrincipalsResponse': TypeInfo(TypeOf.Class, create:() => CheckPrincipalsResponse()),
'List<PrincipalAppSync>': TypeInfo(TypeOf.Class, create:() => <PrincipalAppSync>[]),
'List<PrincipalAuthRuleData>': TypeInfo(TypeOf.Class, create:() => <PrincipalAuthRuleData>[]),
'CheckPrincipals': TypeInfo(TypeOf.Class, create:() => CheckPrincipals()),
});
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
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /principal/check HTTP/1.1
Host: returnit-api-dev.happen.zone
Accept: application/json
Content-Type: application/json
Content-Length: length
{"Principals":[{"PrincipalId":0,"LastUpdated":"String"}],"ApiKey":"String","Latitude":0,"Longitude":0}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"PrincipalsToUpdate":[0],"PrincipalAppSyncData":[{"PrincipalId":0,"LastUpdated":"String"}],"AuthRules":[{"PrincipalId":0,"ValueAuthRules":[{}],"UnitAuthRules":[{}]}],"Description":"String","Heading":"String","WasSuccessful":false,"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}