| GET | /countries | Get Countries API |
|---|
import 'package:servicestack/servicestack.dart';
class Country implements IConvertible
{
/**
* Country id
*/
// @ApiMember(Description="Country id", IsRequired=true)
String? countryId;
/**
* Country description
*/
// @ApiMember(Description="Country description", IsRequired=true)
String? countryDs;
/**
* Trasnlation of country description based on user language settings
*/
// @ApiMember(Description="Trasnlation of country description based on user language settings")
String? translation;
/**
* Telephone prefix
*/
// @ApiMember(Description="Telephone prefix", IsRequired=true)
String? telephonePrefix;
Country({this.countryId,this.countryDs,this.translation,this.telephonePrefix});
Country.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
countryId = json['countryId'];
countryDs = json['countryDs'];
translation = json['translation'];
telephonePrefix = json['telephonePrefix'];
return this;
}
Map<String, dynamic> toJson() => {
'countryId': countryId,
'countryDs': countryDs,
'translation': translation,
'telephonePrefix': telephonePrefix
};
getTypeName() => "Country";
TypeContext? context = _ctx;
}
class GetCountriesResponse extends ListBase<Country> implements IConvertible
{
final List<Country> l = [];
set length(int newLength) { l.length = newLength; }
int get length => l.length;
Country operator [](int index) => l[index];
void operator []=(int index, Country value) { l[index] = value; }
GetCountriesResponse();
GetCountriesResponse.fromJson(Map<String, dynamic> json) : super();
fromMap(Map<String, dynamic> json) {
return this;
}
Map<String, dynamic> toJson() => {};
getTypeName() => "GetCountriesResponse";
TypeContext? context = _ctx;
}
class GetCountries implements IConvertible
{
GetCountries();
GetCountries.fromJson(Map<String, dynamic> json) : super();
fromMap(Map<String, dynamic> json) {
return this;
}
Map<String, dynamic> toJson() => {};
getTypeName() => "GetCountries";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'dev_api_booster.richemont.com', types: <String, TypeInfo> {
'Country': TypeInfo(TypeOf.Class, create:() => Country()),
'GetCountriesResponse': TypeInfo(TypeOf.Class, create:() => GetCountriesResponse()),
'GetCountries': TypeInfo(TypeOf.Class, create:() => GetCountries()),
});
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.
GET /countries HTTP/1.1 Host: dev-api-booster.richemont.com Accept: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <ArrayOfCountry xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Richemont.Booster2.PublicApi.CRM.ServiceModel" />