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 .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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/json
Content-Type: application/json
Content-Length: length

{"Uid":"00000000000000000000000000000000","CostRate":0,"BillRate":0,"EffectiveFrom":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"Resource":{"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}]}}