Trendsic Platform Service

<back to all web services

ResourceRateAppendRequest

Requires Authentication
The following routes are available for this service:
POST,OPTIONS/v1/rates/{Uid}
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

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 ResourceRateAppendResponse implements IConvertible
{
    ResponseStatus? ResponseStatus;
    ResourceRateResource? Resource;

    ResourceRateAppendResponse({this.ResponseStatus,this.Resource});
    ResourceRateAppendResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        Resource = JsonConverters.fromJson(json['Resource'],'ResourceRateResource',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
        'Resource': JsonConverters.toJson(Resource,'ResourceRateResource',context!)
    };

    getTypeName() => "ResourceRateAppendResponse";
    TypeContext? context = _ctx;
}

class ResourceRateAppendRequest implements IConvertible
{
    String? Uid;
    double? CostRate;
    double? BillRate;
    String? EffectiveFrom;

    ResourceRateAppendRequest({this.Uid,this.CostRate,this.BillRate,this.EffectiveFrom});
    ResourceRateAppendRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Uid = json['Uid'];
        CostRate = JsonConverters.toDouble(json['CostRate']);
        BillRate = JsonConverters.toDouble(json['BillRate']);
        EffectiveFrom = json['EffectiveFrom'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Uid': Uid,
        'CostRate': CostRate,
        'BillRate': BillRate,
        'EffectiveFrom': EffectiveFrom
    };

    getTypeName() => "ResourceRateAppendRequest";
    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>[]),
    'ResourceRateAppendResponse': TypeInfo(TypeOf.Class, create:() => ResourceRateAppendResponse()),
    'ResourceRateAppendRequest': TypeInfo(TypeOf.Class, create:() => ResourceRateAppendRequest()),
});

Dart ResourceRateAppendRequest 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.

POST /v1/rates/{Uid} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<ResourceRateAppendRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <BillRate>0</BillRate>
  <CostRate>0</CostRate>
  <EffectiveFrom>String</EffectiveFrom>
  <Uid>00000000-0000-0000-0000-000000000000</Uid>
</ResourceRateAppendRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ResourceRateAppendResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Resource>
    <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>
  </Resource>
  <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>
</ResourceRateAppendResponse>