Trendsic Platform Service

<back to all web services

ResourceRatesRequest

Requires Authentication
The following routes are available for this service:
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 .xml suffix or ?format=xml

HTTP + XML

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: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ResourceRatesResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <AsOf>String</AsOf>
  <Resources>
    <ResourceRateResource>
      <BillRate>0</BillRate>
      <Composition>
        <ResourceRateComponentDto>
          <Amount>0</Amount>
          <Label>String</Label>
        </ResourceRateComponentDto>
      </Composition>
      <CostRate>0</CostRate>
      <EffectiveFrom>String</EffectiveFrom>
      <HasCard>false</HasCard>
      <History>
        <ResourceRateHistoryRow>
          <Bill>0</Bill>
          <Cost>0</Cost>
          <From>String</From>
        </ResourceRateHistoryRow>
      </History>
      <Id>00000000-0000-0000-0000-000000000000</Id>
      <Meta>String</Meta>
      <Name>String</Name>
      <PrevailingFloor>0</PrevailingFloor>
      <Unit>String</Unit>
    </ResourceRateResource>
  </Resources>
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
        <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </d2p1:Meta>
      </d2p1:ResponseError>
    </d2p1:Errors>
    <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </d2p1:Meta>
  </ResponseStatus>
  <Type>String</Type>
</ResourceRatesResponse>