| GET,OPTIONS | /v1/rates |
|---|
import 'package:servicestack/servicestack.dart';
class ResourceRateComponentDto implements IConvertible
{
String? Label;
double? Amount;
ResourceRateComponentDto({this.Label,this.Amount});
ResourceRateComponentDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Label = json['Label'];
Amount = JsonConverters.toDouble(json['Amount']);
return this;
}
Map<String, dynamic> toJson() => {
'Label': Label,
'Amount': Amount
};
getTypeName() => "ResourceRateComponentDto";
TypeContext? context = _ctx;
}
class ResourceRateHistoryRow implements IConvertible
{
String? From;
double? Cost;
double? Bill;
ResourceRateHistoryRow({this.From,this.Cost,this.Bill});
ResourceRateHistoryRow.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
From = json['From'];
Cost = JsonConverters.toDouble(json['Cost']);
Bill = JsonConverters.toDouble(json['Bill']);
return this;
}
Map<String, dynamic> toJson() => {
'From': From,
'Cost': Cost,
'Bill': Bill
};
getTypeName() => "ResourceRateHistoryRow";
TypeContext? context = _ctx;
}
class ResourceRateResource implements IConvertible
{
String? Id;
String? Name;
String? Meta;
String? Unit;
double? CostRate;
double? BillRate;
String? EffectiveFrom;
bool? HasCard;
List<ResourceRateComponentDto>? Composition = [];
double? PrevailingFloor;
List<ResourceRateHistoryRow>? History = [];
ResourceRateResource({this.Id,this.Name,this.Meta,this.Unit,this.CostRate,this.BillRate,this.EffectiveFrom,this.HasCard,this.Composition,this.PrevailingFloor,this.History});
ResourceRateResource.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
Name = json['Name'];
Meta = json['Meta'];
Unit = json['Unit'];
CostRate = JsonConverters.toDouble(json['CostRate']);
BillRate = JsonConverters.toDouble(json['BillRate']);
EffectiveFrom = json['EffectiveFrom'];
HasCard = json['HasCard'];
Composition = JsonConverters.fromJson(json['Composition'],'List<ResourceRateComponentDto>',context!);
PrevailingFloor = JsonConverters.toDouble(json['PrevailingFloor']);
History = JsonConverters.fromJson(json['History'],'List<ResourceRateHistoryRow>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'Name': Name,
'Meta': Meta,
'Unit': Unit,
'CostRate': CostRate,
'BillRate': BillRate,
'EffectiveFrom': EffectiveFrom,
'HasCard': HasCard,
'Composition': JsonConverters.toJson(Composition,'List<ResourceRateComponentDto>',context!),
'PrevailingFloor': PrevailingFloor,
'History': JsonConverters.toJson(History,'List<ResourceRateHistoryRow>',context!)
};
getTypeName() => "ResourceRateResource";
TypeContext? context = _ctx;
}
class ResourceRatesResponse implements IConvertible
{
ResponseStatus? ResponseStatus;
String? Type;
String? AsOf;
List<ResourceRateResource>? Resources = [];
ResourceRatesResponse({this.ResponseStatus,this.Type,this.AsOf,this.Resources});
ResourceRatesResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
Type = json['Type'];
AsOf = json['AsOf'];
Resources = JsonConverters.fromJson(json['Resources'],'List<ResourceRateResource>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
'Type': Type,
'AsOf': AsOf,
'Resources': JsonConverters.toJson(Resources,'List<ResourceRateResource>',context!)
};
getTypeName() => "ResourceRatesResponse";
TypeContext? context = _ctx;
}
class ResourceRatesRequest implements IConvertible
{
String? Type;
String? AsOf;
ResourceRatesRequest({this.Type,this.AsOf});
ResourceRatesRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Type = json['Type'];
AsOf = json['AsOf'];
return this;
}
Map<String, dynamic> toJson() => {
'Type': Type,
'AsOf': AsOf
};
getTypeName() => "ResourceRatesRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'ResourceRateComponentDto': TypeInfo(TypeOf.Class, create:() => ResourceRateComponentDto()),
'ResourceRateHistoryRow': TypeInfo(TypeOf.Class, create:() => ResourceRateHistoryRow()),
'ResourceRateResource': TypeInfo(TypeOf.Class, create:() => ResourceRateResource()),
'List<ResourceRateComponentDto>': TypeInfo(TypeOf.Class, create:() => <ResourceRateComponentDto>[]),
'List<ResourceRateHistoryRow>': TypeInfo(TypeOf.Class, create:() => <ResourceRateHistoryRow>[]),
'ResourceRatesResponse': TypeInfo(TypeOf.Class, create:() => ResourceRatesResponse()),
'List<ResourceRateResource>': TypeInfo(TypeOf.Class, create:() => <ResourceRateResource>[]),
'ResourceRatesRequest': TypeInfo(TypeOf.Class, create:() => ResourceRatesRequest()),
});
Dart ResourceRatesRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /v1/rates HTTP/1.1 Host: api.dev.dynamics.trendsic.com Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
},
Type: String,
AsOf: String,
Resources:
[
{
Id: 00000000000000000000000000000000,
Name: String,
Meta: String,
Unit: String,
CostRate: 0,
BillRate: 0,
EffectiveFrom: String,
HasCard: False,
Composition:
[
{
Label: String,
Amount: 0
}
],
PrevailingFloor: 0,
History:
[
{
From: String,
Cost: 0,
Bill: 0
}
]
}
]
}