| GET | /api/v1/utils/countries |
|---|
import 'package:servicestack/servicestack.dart';
class Status implements IConvertible
{
String? message;
int? statusCode;
Status({this.message,this.statusCode});
Status.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
message = json['message'];
statusCode = json['statusCode'];
return this;
}
Map<String, dynamic> toJson() => {
'message': message,
'statusCode': statusCode
};
getTypeName() => "Status";
TypeContext? context = _ctx;
}
class BaseResponse implements IConvertible
{
Status? status;
BaseResponse({this.status});
BaseResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
status = JsonConverters.fromJson(json['status'],'Status',context!);
return this;
}
Map<String, dynamic> toJson() => {
'status': JsonConverters.toJson(status,'Status',context!)
};
getTypeName() => "BaseResponse";
TypeContext? context = _ctx;
}
class Country implements IConvertible
{
int? id;
// @required()
// @StringLength(2)
String? code;
// @required()
// @StringLength(3)
String? phoneCode;
// @required()
// @StringLength(200)
String? name;
// @required()
// @StringLength(5)
String? currencySymbol;
// @required()
// @StringLength(200)
String? currencyName;
// @required()
int? order;
Country({this.id,this.code,this.phoneCode,this.name,this.currencySymbol,this.currencyName,this.order});
Country.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
code = json['code'];
phoneCode = json['phoneCode'];
name = json['name'];
currencySymbol = json['currencySymbol'];
currencyName = json['currencyName'];
order = json['order'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'code': code,
'phoneCode': phoneCode,
'name': name,
'currencySymbol': currencySymbol,
'currencyName': currencyName,
'order': order
};
getTypeName() => "Country";
TypeContext? context = _ctx;
}
class GetCountriesResponse extends BaseResponse implements IConvertible
{
List<Country>? countries;
GetCountriesResponse({this.countries});
GetCountriesResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
countries = JsonConverters.fromJson(json['countries'],'List<Country>',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'countries': JsonConverters.toJson(countries,'List<Country>',context!)
});
getTypeName() => "GetCountriesResponse";
TypeContext? context = _ctx;
}
class GetCountries implements IGet, 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: 'pecuario_backend.develsystems.com', types: <String, TypeInfo> {
'Status': TypeInfo(TypeOf.Class, create:() => Status()),
'BaseResponse': TypeInfo(TypeOf.Class, create:() => BaseResponse()),
'Country': TypeInfo(TypeOf.Class, create:() => Country()),
'GetCountriesResponse': TypeInfo(TypeOf.Class, create:() => GetCountriesResponse()),
'List<Country>': TypeInfo(TypeOf.Class, create:() => <Country>[]),
'GetCountries': TypeInfo(TypeOf.Class, create:() => GetCountries()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /api/v1/utils/countries HTTP/1.1 Host: pecuario-backend.develsystems.com Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"countries":[{"id":0,"code":"String","phoneCode":"String","name":"String","currencySymbol":"String","currencyName":"String","order":0}]}