Requires any of the roles: | Admin, TeamAdmin, MobileApp | Required permission: | Tickets.Add |
POST | /Location |
---|
import 'package:servicestack/servicestack.dart';
class Location implements IConvertible
{
int? id;
String? name;
double? latitude;
double? longitude;
String? addressName;
String? addressLine;
String? zip;
String? city;
String? county;
String? stateCode;
String? stateName;
String? countryCode;
String? countryName;
String? timeZone;
Location({this.id,this.name,this.latitude,this.longitude,this.addressName,this.addressLine,this.zip,this.city,this.county,this.stateCode,this.stateName,this.countryCode,this.countryName,this.timeZone});
Location.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
latitude = JsonConverters.toDouble(json['latitude']);
longitude = JsonConverters.toDouble(json['longitude']);
addressName = json['addressName'];
addressLine = json['addressLine'];
zip = json['zip'];
city = json['city'];
county = json['county'];
stateCode = json['stateCode'];
stateName = json['stateName'];
countryCode = json['countryCode'];
countryName = json['countryName'];
timeZone = json['timeZone'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'name': name,
'latitude': latitude,
'longitude': longitude,
'addressName': addressName,
'addressLine': addressLine,
'zip': zip,
'city': city,
'county': county,
'stateCode': stateCode,
'stateName': stateName,
'countryCode': countryCode,
'countryName': countryName,
'timeZone': timeZone
};
getTypeName() => "Location";
TypeContext? context = _ctx;
}
class LocationResult implements IConvertible
{
Location? item;
int? statusCode;
String? message;
LocationResult({this.item,this.statusCode,this.message});
LocationResult.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
item = JsonConverters.fromJson(json['item'],'Location',context!);
statusCode = json['statusCode'];
message = json['message'];
return this;
}
Map<String, dynamic> toJson() => {
'item': JsonConverters.toJson(item,'Location',context!),
'statusCode': statusCode,
'message': message
};
getTypeName() => "LocationResult";
TypeContext? context = _ctx;
}
class LocationCreateRequest implements IConvertible
{
Location? item;
LocationCreateRequest({this.item});
LocationCreateRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
item = JsonConverters.fromJson(json['item'],'Location',context!);
return this;
}
Map<String, dynamic> toJson() => {
'item': JsonConverters.toJson(item,'Location',context!)
};
getTypeName() => "LocationCreateRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'stubbur_autoupdates_live.smartnewapis.com', types: <String, TypeInfo> {
'Location': TypeInfo(TypeOf.Class, create:() => Location()),
'LocationResult': TypeInfo(TypeOf.Class, create:() => LocationResult()),
'LocationCreateRequest': TypeInfo(TypeOf.Class, create:() => LocationCreateRequest()),
});
Dart LocationCreateRequest 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 /Location HTTP/1.1
Host: stubbur-autoupdates-live.smartnewapis.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<LocationCreateRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel">
<Item xmlns:d2p1="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel.Types">
<d2p1:AddressLine>String</d2p1:AddressLine>
<d2p1:AddressName>String</d2p1:AddressName>
<d2p1:City>String</d2p1:City>
<d2p1:CountryCode>String</d2p1:CountryCode>
<d2p1:CountryName>String</d2p1:CountryName>
<d2p1:County>String</d2p1:County>
<d2p1:ID>0</d2p1:ID>
<d2p1:Latitude>0</d2p1:Latitude>
<d2p1:Longitude>0</d2p1:Longitude>
<d2p1:Name>String</d2p1:Name>
<d2p1:StateCode>String</d2p1:StateCode>
<d2p1:StateName>String</d2p1:StateName>
<d2p1:TimeZone>String</d2p1:TimeZone>
<d2p1:Zip>String</d2p1:Zip>
</Item>
</LocationCreateRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <LocationResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel"> <Item xmlns:d2p1="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel.Types"> <d2p1:AddressLine>String</d2p1:AddressLine> <d2p1:AddressName>String</d2p1:AddressName> <d2p1:City>String</d2p1:City> <d2p1:CountryCode>String</d2p1:CountryCode> <d2p1:CountryName>String</d2p1:CountryName> <d2p1:County>String</d2p1:County> <d2p1:ID>0</d2p1:ID> <d2p1:Latitude>0</d2p1:Latitude> <d2p1:Longitude>0</d2p1:Longitude> <d2p1:Name>String</d2p1:Name> <d2p1:StateCode>String</d2p1:StateCode> <d2p1:StateName>String</d2p1:StateName> <d2p1:TimeZone>String</d2p1:TimeZone> <d2p1:Zip>String</d2p1:Zip> </Item> <Message>String</Message> <StatusCode>0</StatusCode> </LocationResult>