| POST | /auto/segments |
|---|
import 'package:servicestack/servicestack.dart';
import 'dart:collection';
// @DataContract
class IdResponse implements IConvertible
{
// @DataMember(Order=1)
String? Id;
// @DataMember(Order=2)
ResponseStatus? ResponseStatus;
IdResponse({this.Id,this.ResponseStatus});
IdResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
};
getTypeName() => "IdResponse";
TypeContext? context = _ctx;
}
class SegmentsAutoQueryAdd implements ICreateDb<Segments>, IConvertible
{
// @DataMember(Order=2)
int? TenantsId;
// @DataMember(Order=3)
String? Name;
// @DataMember(Order=4)
bool? IsCustom;
SegmentsAutoQueryAdd({this.TenantsId,this.Name,this.IsCustom});
SegmentsAutoQueryAdd.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
TenantsId = json['TenantsId'];
Name = json['Name'];
IsCustom = json['IsCustom'];
return this;
}
Map<String, dynamic> toJson() => {
'TenantsId': TenantsId,
'Name': Name,
'IsCustom': IsCustom
};
getTypeName() => "SegmentsAutoQueryAdd";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'duengageapi.uat.scadsoftware.com', types: <String, TypeInfo> {
'SegmentsAutoQueryAdd': TypeInfo(TypeOf.Class, create:() => SegmentsAutoQueryAdd()),
});
Dart SegmentsAutoQueryAdd DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /auto/segments HTTP/1.1
Host: duengageapi.uat.scadsoftware.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
TenantsId: 0,
Name: String,
IsCustom: False
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
Id: String,
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
}
}