| GET | /{Workspace}/ReverseGeocode |
|---|
import 'package:servicestack/servicestack.dart';
class Location implements IConvertible
{
double? y;
double? x;
Location({this.y,this.x});
Location.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
y = JsonConverters.toDouble(json['y']);
x = JsonConverters.toDouble(json['x']);
return this;
}
Map<String, dynamic> toJson() => {
'y': y,
'x': x
};
getTypeName() => "Location";
TypeContext? context = _ctx;
}
class Address implements IConvertible
{
String? Street;
String? Unit;
String? City;
String? State;
String? Zip;
String? ContactTitle;
String? ContactName;
String? ContactPhone;
String? ContactEmail;
Location? Location;
String? SiteName;
bool? GeocodeFailed;
String? Country;
Address({this.Street,this.Unit,this.City,this.State,this.Zip,this.ContactTitle,this.ContactName,this.ContactPhone,this.ContactEmail,this.Location,this.SiteName,this.GeocodeFailed,this.Country});
Address.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Street = json['Street'];
Unit = json['Unit'];
City = json['City'];
State = json['State'];
Zip = json['Zip'];
ContactTitle = json['ContactTitle'];
ContactName = json['ContactName'];
ContactPhone = json['ContactPhone'];
ContactEmail = json['ContactEmail'];
Location = JsonConverters.fromJson(json['Location'],'Location',context!);
SiteName = json['SiteName'];
GeocodeFailed = json['GeocodeFailed'];
Country = json['Country'];
return this;
}
Map<String, dynamic> toJson() => {
'Street': Street,
'Unit': Unit,
'City': City,
'State': State,
'Zip': Zip,
'ContactTitle': ContactTitle,
'ContactName': ContactName,
'ContactPhone': ContactPhone,
'ContactEmail': ContactEmail,
'Location': JsonConverters.toJson(Location,'Location',context!),
'SiteName': SiteName,
'GeocodeFailed': GeocodeFailed,
'Country': Country
};
getTypeName() => "Address";
TypeContext? context = _ctx;
}
/**
* Reprsents a DTO for a reverse geocode request/resonse. Usage is /ReverseGeocode?latitude=1.0&longitude=1.0
*/
class ReverseGeocode implements IConvertible
{
String? Workspace;
Address? Address;
ReverseGeocode({this.Workspace,this.Address});
ReverseGeocode.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Workspace = json['Workspace'];
Address = JsonConverters.fromJson(json['Address'],'Address',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Workspace': Workspace,
'Address': JsonConverters.toJson(Address,'Address',context!)
};
getTypeName() => "ReverseGeocode";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'dev.fieldsquared.com', types: <String, TypeInfo> {
'Location': TypeInfo(TypeOf.Class, create:() => Location()),
'Address': TypeInfo(TypeOf.Class, create:() => Address()),
'ReverseGeocode': TypeInfo(TypeOf.Class, create:() => ReverseGeocode()),
});
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.
GET /{Workspace}/ReverseGeocode HTTP/1.1
Host: dev.fieldsquared.com
Accept: text/csv