| Requires any of the roles: | Agent, Administrator |
| GET,OPTIONS | /v1/invoice/workchanges/{ProjectUID} |
|---|
<?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 InvoiceWorkChange implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $SourceType=null,
/** @var int */
public int $SourceID=0,
/** @var int|null */
public ?int $JobID=null,
/** @var DateTime|null */
public ?DateTime $WorkDate=null,
/** @var string|null */
public ?string $WorkDay=null,
/** @var string|null */
public ?string $DisplayDay=null,
/** @var string|null */
public ?string $Label=null,
/** @var string|null */
public ?string $JobName=null,
/** @var DateTime|null */
public ?DateTime $DisplayDate=null,
/** @var string|null */
public ?string $Unit=null,
/** @var float */
public float $Billed=0.0,
/** @var float */
public float $NowQuantity=0.0,
/** @var float */
public float $OverBilled=0.0,
/** @var float */
public float $UnitFactor=0.0,
/** @var float */
public float $Price=0.0,
/** @var float */
public float $Amount=0.0,
/** @var string|null */
public ?string $LineType=null,
/** @var bool|null */
public ?bool $IsTaxable=null,
/** @var int */
public int $InvoiceID=0,
/** @var string */
public string $InvoiceUID='',
/** @var string|null */
public ?string $InvoiceNumber=null,
/** @var float */
public float $InvoiceTotal=0.0,
/** @var bool|null */
public ?bool $InvoiceIsLocked=null,
/** @var bool|null */
public ?bool $InvoiceIsPaid=null,
/** @var string|null */
public ?string $State=null,
/** @var string|null */
public ?string $Remembered=null,
/** @var string|null */
public ?string $DecidedByName=null,
/** @var DateTime|null */
public ?DateTime $DecidedAt=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['SourceType'])) $this->SourceType = $o['SourceType'];
if (isset($o['SourceID'])) $this->SourceID = $o['SourceID'];
if (isset($o['JobID'])) $this->JobID = $o['JobID'];
if (isset($o['WorkDate'])) $this->WorkDate = JsonConverters::from('DateTime', $o['WorkDate']);
if (isset($o['WorkDay'])) $this->WorkDay = $o['WorkDay'];
if (isset($o['DisplayDay'])) $this->DisplayDay = $o['DisplayDay'];
if (isset($o['Label'])) $this->Label = $o['Label'];
if (isset($o['JobName'])) $this->JobName = $o['JobName'];
if (isset($o['DisplayDate'])) $this->DisplayDate = JsonConverters::from('DateTime', $o['DisplayDate']);
if (isset($o['Unit'])) $this->Unit = $o['Unit'];
if (isset($o['Billed'])) $this->Billed = $o['Billed'];
if (isset($o['NowQuantity'])) $this->NowQuantity = $o['NowQuantity'];
if (isset($o['OverBilled'])) $this->OverBilled = $o['OverBilled'];
if (isset($o['UnitFactor'])) $this->UnitFactor = $o['UnitFactor'];
if (isset($o['Price'])) $this->Price = $o['Price'];
if (isset($o['Amount'])) $this->Amount = $o['Amount'];
if (isset($o['LineType'])) $this->LineType = $o['LineType'];
if (isset($o['IsTaxable'])) $this->IsTaxable = $o['IsTaxable'];
if (isset($o['InvoiceID'])) $this->InvoiceID = $o['InvoiceID'];
if (isset($o['InvoiceUID'])) $this->InvoiceUID = $o['InvoiceUID'];
if (isset($o['InvoiceNumber'])) $this->InvoiceNumber = $o['InvoiceNumber'];
if (isset($o['InvoiceTotal'])) $this->InvoiceTotal = $o['InvoiceTotal'];
if (isset($o['InvoiceIsLocked'])) $this->InvoiceIsLocked = $o['InvoiceIsLocked'];
if (isset($o['InvoiceIsPaid'])) $this->InvoiceIsPaid = $o['InvoiceIsPaid'];
if (isset($o['State'])) $this->State = $o['State'];
if (isset($o['Remembered'])) $this->Remembered = $o['Remembered'];
if (isset($o['DecidedByName'])) $this->DecidedByName = $o['DecidedByName'];
if (isset($o['DecidedAt'])) $this->DecidedAt = JsonConverters::from('DateTime', $o['DecidedAt']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->SourceType)) $o['SourceType'] = $this->SourceType;
if (isset($this->SourceID)) $o['SourceID'] = $this->SourceID;
if (isset($this->JobID)) $o['JobID'] = $this->JobID;
if (isset($this->WorkDate)) $o['WorkDate'] = JsonConverters::to('DateTime', $this->WorkDate);
if (isset($this->WorkDay)) $o['WorkDay'] = $this->WorkDay;
if (isset($this->DisplayDay)) $o['DisplayDay'] = $this->DisplayDay;
if (isset($this->Label)) $o['Label'] = $this->Label;
if (isset($this->JobName)) $o['JobName'] = $this->JobName;
if (isset($this->DisplayDate)) $o['DisplayDate'] = JsonConverters::to('DateTime', $this->DisplayDate);
if (isset($this->Unit)) $o['Unit'] = $this->Unit;
if (isset($this->Billed)) $o['Billed'] = $this->Billed;
if (isset($this->NowQuantity)) $o['NowQuantity'] = $this->NowQuantity;
if (isset($this->OverBilled)) $o['OverBilled'] = $this->OverBilled;
if (isset($this->UnitFactor)) $o['UnitFactor'] = $this->UnitFactor;
if (isset($this->Price)) $o['Price'] = $this->Price;
if (isset($this->Amount)) $o['Amount'] = $this->Amount;
if (isset($this->LineType)) $o['LineType'] = $this->LineType;
if (isset($this->IsTaxable)) $o['IsTaxable'] = $this->IsTaxable;
if (isset($this->InvoiceID)) $o['InvoiceID'] = $this->InvoiceID;
if (isset($this->InvoiceUID)) $o['InvoiceUID'] = $this->InvoiceUID;
if (isset($this->InvoiceNumber)) $o['InvoiceNumber'] = $this->InvoiceNumber;
if (isset($this->InvoiceTotal)) $o['InvoiceTotal'] = $this->InvoiceTotal;
if (isset($this->InvoiceIsLocked)) $o['InvoiceIsLocked'] = $this->InvoiceIsLocked;
if (isset($this->InvoiceIsPaid)) $o['InvoiceIsPaid'] = $this->InvoiceIsPaid;
if (isset($this->State)) $o['State'] = $this->State;
if (isset($this->Remembered)) $o['Remembered'] = $this->Remembered;
if (isset($this->DecidedByName)) $o['DecidedByName'] = $this->DecidedByName;
if (isset($this->DecidedAt)) $o['DecidedAt'] = JsonConverters::to('DateTime', $this->DecidedAt);
return empty($o) ? new class(){} : $o;
}
}
class InvoiceWorkChangesResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var bool|null */
public ?bool $Success=null,
/** @var array<InvoiceWorkChange>|null */
public ?array $Changes=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['Success'])) $this->Success = $o['Success'];
if (isset($o['Changes'])) $this->Changes = JsonConverters::fromArray('InvoiceWorkChange', $o['Changes']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->Success)) $o['Success'] = $this->Success;
if (isset($this->Changes)) $o['Changes'] = JsonConverters::toArray('InvoiceWorkChange', $this->Changes);
return empty($o) ? new class(){} : $o;
}
}
class InvoiceWorkChangesRequest implements JsonSerializable
{
public function __construct(
/** @var string */
public string $ProjectUID='',
/** @var int|null */
public ?int $InvoiceID=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ProjectUID'])) $this->ProjectUID = $o['ProjectUID'];
if (isset($o['InvoiceID'])) $this->InvoiceID = $o['InvoiceID'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ProjectUID)) $o['ProjectUID'] = $this->ProjectUID;
if (isset($this->InvoiceID)) $o['InvoiceID'] = $this->InvoiceID;
return empty($o) ? new class(){} : $o;
}
}
PHP InvoiceWorkChangesRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /v1/invoice/workchanges/{ProjectUID} HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<InvoiceWorkChangesResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Changes>
<InvoiceWorkChange>
<Amount>0</Amount>
<Billed>0</Billed>
<DecidedAt>0001-01-01T00:00:00</DecidedAt>
<DecidedByName>String</DecidedByName>
<DisplayDate>0001-01-01T00:00:00</DisplayDate>
<DisplayDay>String</DisplayDay>
<InvoiceID>0</InvoiceID>
<InvoiceIsLocked>false</InvoiceIsLocked>
<InvoiceIsPaid>false</InvoiceIsPaid>
<InvoiceNumber>String</InvoiceNumber>
<InvoiceTotal>0</InvoiceTotal>
<InvoiceUID>00000000-0000-0000-0000-000000000000</InvoiceUID>
<IsTaxable>false</IsTaxable>
<JobID>0</JobID>
<JobName>String</JobName>
<Label>String</Label>
<LineType>String</LineType>
<NowQuantity>0</NowQuantity>
<OverBilled>0</OverBilled>
<Price>0</Price>
<Remembered>String</Remembered>
<SourceID>0</SourceID>
<SourceType>String</SourceType>
<State>String</State>
<Unit>String</Unit>
<UnitFactor>0</UnitFactor>
<WorkDate>0001-01-01T00:00:00</WorkDate>
<WorkDay>String</WorkDay>
</InvoiceWorkChange>
</Changes>
<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>
<Success>false</Success>
</InvoiceWorkChangesResponse>