| POST | /v4/autopilot-options | ||
|---|---|---|---|
| POST | /v3.5/autopilot-options |
import 'package:servicestack/servicestack.dart';
// @DataContract
class PostAutopilotOptionsResponse implements IConvertible
{
// @DataMember(Name="responseStatus")
ResponseStatus? responseStatus;
// @DataMember(Name="success")
bool? success;
PostAutopilotOptionsResponse({this.responseStatus,this.success});
PostAutopilotOptionsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
success = json['success'];
return this;
}
Map<String, dynamic> toJson() => {
'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!),
'success': success
};
getTypeName() => "PostAutopilotOptionsResponse";
TypeContext? context = _ctx;
}
enum AutopilotFrequency
{
Daily,
Hourly,
Once,
}
enum AutopilotLevel
{
ShortLink,
Group,
Account,
}
// @DataContract
class PostAutopilotOptionsRequest implements IConvertible
{
// @DataMember(Name="frequency")
AutopilotFrequency? frequency;
// @DataMember(Name="level")
AutopilotLevel? level;
// @DataMember(Name="enabled")
bool? enabled;
// @DataMember(Name="identifier")
String? identifier;
// @DataMember(Name="choicePageOptions")
Map<String,String?>? choicePageOptions;
PostAutopilotOptionsRequest({this.frequency,this.level,this.enabled,this.identifier,this.choicePageOptions});
PostAutopilotOptionsRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
frequency = JsonConverters.fromJson(json['frequency'],'AutopilotFrequency',context!);
level = JsonConverters.fromJson(json['level'],'AutopilotLevel',context!);
enabled = json['enabled'];
identifier = json['identifier'];
choicePageOptions = JsonConverters.toStringMap(json['choicePageOptions']);
return this;
}
Map<String, dynamic> toJson() => {
'frequency': JsonConverters.toJson(frequency,'AutopilotFrequency',context!),
'level': JsonConverters.toJson(level,'AutopilotLevel',context!),
'enabled': enabled,
'identifier': identifier,
'choicePageOptions': choicePageOptions
};
getTypeName() => "PostAutopilotOptionsRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'geniuslink_api_zane.dev.platform.georiot.com', types: <String, TypeInfo> {
'PostAutopilotOptionsResponse': TypeInfo(TypeOf.Class, create:() => PostAutopilotOptionsResponse()),
'AutopilotFrequency': TypeInfo(TypeOf.Enum, enumValues:AutopilotFrequency.values),
'AutopilotLevel': TypeInfo(TypeOf.Enum, enumValues:AutopilotLevel.values),
'PostAutopilotOptionsRequest': TypeInfo(TypeOf.Class, create:() => PostAutopilotOptionsRequest()),
});
Dart PostAutopilotOptionsRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v4/autopilot-options HTTP/1.1
Host: geniuslink-api-zane.dev.platform.georiot.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<PostAutopilotOptionsRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/GeniuslinkAPI.ServiceModel.V4.Autopilot.Requests">
<choicePageOptions xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:KeyValueOfstringstring>
<d2p1:Key>String</d2p1:Key>
<d2p1:Value>String</d2p1:Value>
</d2p1:KeyValueOfstringstring>
</choicePageOptions>
<enabled>false</enabled>
<frequency>Daily</frequency>
<identifier>String</identifier>
<level>ShortLink</level>
</PostAutopilotOptionsRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<PostAutopilotOptionsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/GeniuslinkAPI.ServiceModel.V4.Autopilot.Responses">
<responseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:Message>String</d2p1:Message>
<d2p1:StackTrace>String</d2p1:StackTrace>
<d2p1:Errors>
<d2p1:ResponseError>
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:FieldName>String</d2p1:FieldName>
<d2p1:Message>String</d2p1:Message>
<d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:KeyValueOfstringstring>
<d5p1:Key>String</d5p1:Key>
<d5p1:Value>String</d5p1:Value>
</d5p1:KeyValueOfstringstring>
</d2p1:Meta>
</d2p1:ResponseError>
</d2p1:Errors>
<d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:KeyValueOfstringstring>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value>String</d3p1:Value>
</d3p1:KeyValueOfstringstring>
</d2p1:Meta>
</responseStatus>
<success>false</success>
</PostAutopilotOptionsResponse>