Requires any of the roles: | Admin, TeamAdmin, MobileApp | Required permission: | Tickets.Add |
POST | /Locations |
---|
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 LocationsResult implements IConvertible
{
List<Location>? items;
int? statusCode;
String? message;
LocationsResult({this.items,this.statusCode,this.message});
LocationsResult.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
items = JsonConverters.fromJson(json['items'],'List<Location>',context!);
statusCode = json['statusCode'];
message = json['message'];
return this;
}
Map<String, dynamic> toJson() => {
'items': JsonConverters.toJson(items,'List<Location>',context!),
'statusCode': statusCode,
'message': message
};
getTypeName() => "LocationsResult";
TypeContext? context = _ctx;
}
class LocationsSearchRequest implements IConvertible
{
String? name;
String? countryCode;
LocationsSearchRequest({this.name,this.countryCode});
LocationsSearchRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
name = json['name'];
countryCode = json['countryCode'];
return this;
}
Map<String, dynamic> toJson() => {
'name': name,
'countryCode': countryCode
};
getTypeName() => "LocationsSearchRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'stubbur_autoupdates_live.smartnewapis.com', types: <String, TypeInfo> {
'Location': TypeInfo(TypeOf.Class, create:() => Location()),
'LocationsResult': TypeInfo(TypeOf.Class, create:() => LocationsResult()),
'List<Location>': TypeInfo(TypeOf.Class, create:() => <Location>[]),
'LocationsSearchRequest': TypeInfo(TypeOf.Class, create:() => LocationsSearchRequest()),
});
Dart LocationsSearchRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /Locations HTTP/1.1
Host: stubbur-autoupdates-live.smartnewapis.com
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"name":"String","countryCode":"String"}
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"items":[{"id":0,"name":"String","latitude":0,"longitude":0,"addressName":"String","addressLine":"String","zip":"String","city":"String","county":"String","stateCode":"String","stateName":"String","countryCode":"String","countryName":"String","timeZone":"String"}],"statusCode":0,"message":"String"}