Trendsic Platform Service

<back to all web services

BurdenRateSaveRequest

Requires Authentication
The following routes are available for this service:
POST/v1/workforce/burden
<?php namespace dtos;

use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};


class BurdenRate implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $BurdenRateID=0,
        /** @var string|null */
        public ?string $BranchId=null,
        /** @var string|null */
        public ?string $ClassCode=null,
        /** @var float */
        public float $Fica=0.0,
        /** @var float */
        public float $FutaSuta=0.0,
        /** @var float */
        public float $Wc=0.0,
        /** @var float */
        public float $Gl=0.0,
        /** @var DateTime|null */
        public ?DateTime $EffectiveFrom=null,
        /** @var float */
        public float $BurdenPct=0.0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['BurdenRateID'])) $this->BurdenRateID = $o['BurdenRateID'];
        if (isset($o['BranchId'])) $this->BranchId = $o['BranchId'];
        if (isset($o['ClassCode'])) $this->ClassCode = $o['ClassCode'];
        if (isset($o['Fica'])) $this->Fica = $o['Fica'];
        if (isset($o['FutaSuta'])) $this->FutaSuta = $o['FutaSuta'];
        if (isset($o['Wc'])) $this->Wc = $o['Wc'];
        if (isset($o['Gl'])) $this->Gl = $o['Gl'];
        if (isset($o['EffectiveFrom'])) $this->EffectiveFrom = JsonConverters::from('DateTime', $o['EffectiveFrom']);
        if (isset($o['BurdenPct'])) $this->BurdenPct = $o['BurdenPct'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->BurdenRateID)) $o['BurdenRateID'] = $this->BurdenRateID;
        if (isset($this->BranchId)) $o['BranchId'] = $this->BranchId;
        if (isset($this->ClassCode)) $o['ClassCode'] = $this->ClassCode;
        if (isset($this->Fica)) $o['Fica'] = $this->Fica;
        if (isset($this->FutaSuta)) $o['FutaSuta'] = $this->FutaSuta;
        if (isset($this->Wc)) $o['Wc'] = $this->Wc;
        if (isset($this->Gl)) $o['Gl'] = $this->Gl;
        if (isset($this->EffectiveFrom)) $o['EffectiveFrom'] = JsonConverters::to('DateTime', $this->EffectiveFrom);
        if (isset($this->BurdenPct)) $o['BurdenPct'] = $this->BurdenPct;
        return empty($o) ? new class(){} : $o;
    }
}

class BurdenRatesResponse implements JsonSerializable
{
    public function __construct(
        /** @var array<BurdenRate>|null */
        public ?array $Burden=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Burden'])) $this->Burden = JsonConverters::fromArray('BurdenRate', $o['Burden']);
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Burden)) $o['Burden'] = JsonConverters::toArray('BurdenRate', $this->Burden);
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

class BurdenRateSaveRequest implements JsonSerializable
{
    public function __construct(
        /** @var BurdenRate|null */
        public ?BurdenRate $Burden=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Burden'])) $this->Burden = JsonConverters::from('BurdenRate', $o['Burden']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Burden)) $o['Burden'] = JsonConverters::to('BurdenRate', $this->Burden);
        return empty($o) ? new class(){} : $o;
    }
}

PHP BurdenRateSaveRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /v1/workforce/burden HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Burden: 
	{
		BurdenRateID: 0,
		BranchId: 00000000000000000000000000000000,
		ClassCode: String,
		Fica: 0,
		FutaSuta: 0,
		Wc: 0,
		Gl: 0,
		EffectiveFrom: 0001-01-01,
		BurdenPct: 0
	}
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Burden: 
	[
		{
			BurdenRateID: 0,
			BranchId: 00000000000000000000000000000000,
			ClassCode: String,
			Fica: 0,
			FutaSuta: 0,
			Wc: 0,
			Gl: 0,
			EffectiveFrom: 0001-01-01,
			BurdenPct: 0
		}
	],
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}