| GET,OPTIONS | /v1/projects/{ProjectID}/pay-apps/{PeriodNumber}/g702 |
|---|
<?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 DocField implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Label=null,
/** @var string|null */
public ?string $Value=null,
/** @var string|null */
public ?string $Ref=null,
/** @var bool|null */
public ?bool $Emphasis=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Label'])) $this->Label = $o['Label'];
if (isset($o['Value'])) $this->Value = $o['Value'];
if (isset($o['Ref'])) $this->Ref = $o['Ref'];
if (isset($o['Emphasis'])) $this->Emphasis = $o['Emphasis'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Label)) $o['Label'] = $this->Label;
if (isset($this->Value)) $o['Value'] = $this->Value;
if (isset($this->Ref)) $o['Ref'] = $this->Ref;
if (isset($this->Emphasis)) $o['Emphasis'] = $this->Emphasis;
return empty($o) ? new class(){} : $o;
}
}
class DocColumn implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Key=null,
/** @var string|null */
public ?string $Label=null,
/** @var string|null */
public ?string $Align=null,
/** @var int */
public int $Width=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Key'])) $this->Key = $o['Key'];
if (isset($o['Label'])) $this->Label = $o['Label'];
if (isset($o['Align'])) $this->Align = $o['Align'];
if (isset($o['Width'])) $this->Width = $o['Width'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Key)) $o['Key'] = $this->Key;
if (isset($this->Label)) $o['Label'] = $this->Label;
if (isset($this->Align)) $o['Align'] = $this->Align;
if (isset($this->Width)) $o['Width'] = $this->Width;
return empty($o) ? new class(){} : $o;
}
}
class DocTable implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Caption=null,
/** @var array<DocColumn>|null */
public ?array $Columns=null,
/** @var array<string[]>|null */
public ?array $Rows=null,
/** @var array<string[]>|null */
public ?array $Footer=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Caption'])) $this->Caption = $o['Caption'];
if (isset($o['Columns'])) $this->Columns = JsonConverters::fromArray('DocColumn', $o['Columns']);
if (isset($o['Rows'])) $this->Rows = JsonConverters::fromArray('List<String>', $o['Rows']);
if (isset($o['Footer'])) $this->Footer = JsonConverters::fromArray('List<String>', $o['Footer']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Caption)) $o['Caption'] = $this->Caption;
if (isset($this->Columns)) $o['Columns'] = JsonConverters::toArray('DocColumn', $this->Columns);
if (isset($this->Rows)) $o['Rows'] = JsonConverters::toArray('List<String>', $this->Rows);
if (isset($this->Footer)) $o['Footer'] = JsonConverters::toArray('List<String>', $this->Footer);
return empty($o) ? new class(){} : $o;
}
}
class DocBlock implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Type=null,
/** @var string|null */
public ?string $Text=null,
/** @var int */
public int $Level=0,
/** @var array<DocField>|null */
public ?array $Fields=null,
/** @var int */
public int $Columns=0,
/** @var DocTable|null */
public ?DocTable $Table=null,
/** @var array<string>|null */
public ?array $Signatures=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Type'])) $this->Type = $o['Type'];
if (isset($o['Text'])) $this->Text = $o['Text'];
if (isset($o['Level'])) $this->Level = $o['Level'];
if (isset($o['Fields'])) $this->Fields = JsonConverters::fromArray('DocField', $o['Fields']);
if (isset($o['Columns'])) $this->Columns = $o['Columns'];
if (isset($o['Table'])) $this->Table = JsonConverters::from('DocTable', $o['Table']);
if (isset($o['Signatures'])) $this->Signatures = JsonConverters::fromArray('string', $o['Signatures']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Type)) $o['Type'] = $this->Type;
if (isset($this->Text)) $o['Text'] = $this->Text;
if (isset($this->Level)) $o['Level'] = $this->Level;
if (isset($this->Fields)) $o['Fields'] = JsonConverters::toArray('DocField', $this->Fields);
if (isset($this->Columns)) $o['Columns'] = $this->Columns;
if (isset($this->Table)) $o['Table'] = JsonConverters::to('DocTable', $this->Table);
if (isset($this->Signatures)) $o['Signatures'] = JsonConverters::toArray('string', $this->Signatures);
return empty($o) ? new class(){} : $o;
}
}
class DocIssue implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Severity=null,
/** @var string|null */
public ?string $Code=null,
/** @var string|null */
public ?string $Message=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Severity'])) $this->Severity = $o['Severity'];
if (isset($o['Code'])) $this->Code = $o['Code'];
if (isset($o['Message'])) $this->Message = $o['Message'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Severity)) $o['Severity'] = $this->Severity;
if (isset($this->Code)) $o['Code'] = $this->Code;
if (isset($this->Message)) $o['Message'] = $this->Message;
return empty($o) ? new class(){} : $o;
}
}
class PrintDocument implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Kind=null,
/** @var string|null */
public ?string $Title=null,
/** @var string|null */
public ?string $Subtitle=null,
/** @var string|null */
public ?string $FileName=null,
/** @var bool|null */
public ?bool $Landscape=null,
/** @var DateTime */
public DateTime $GeneratedAtUtc=new DateTime(),
/** @var string|null */
public ?string $GeneratedBy=null,
/** @var array<DocField>|null */
public ?array $Meta=null,
/** @var array<DocBlock>|null */
public ?array $Blocks=null,
/** @var array<DocIssue>|null */
public ?array $Issues=null,
/** @var bool|null */
public ?bool $CanPrint=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Kind'])) $this->Kind = $o['Kind'];
if (isset($o['Title'])) $this->Title = $o['Title'];
if (isset($o['Subtitle'])) $this->Subtitle = $o['Subtitle'];
if (isset($o['FileName'])) $this->FileName = $o['FileName'];
if (isset($o['Landscape'])) $this->Landscape = $o['Landscape'];
if (isset($o['GeneratedAtUtc'])) $this->GeneratedAtUtc = JsonConverters::from('DateTime', $o['GeneratedAtUtc']);
if (isset($o['GeneratedBy'])) $this->GeneratedBy = $o['GeneratedBy'];
if (isset($o['Meta'])) $this->Meta = JsonConverters::fromArray('DocField', $o['Meta']);
if (isset($o['Blocks'])) $this->Blocks = JsonConverters::fromArray('DocBlock', $o['Blocks']);
if (isset($o['Issues'])) $this->Issues = JsonConverters::fromArray('DocIssue', $o['Issues']);
if (isset($o['CanPrint'])) $this->CanPrint = $o['CanPrint'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Kind)) $o['Kind'] = $this->Kind;
if (isset($this->Title)) $o['Title'] = $this->Title;
if (isset($this->Subtitle)) $o['Subtitle'] = $this->Subtitle;
if (isset($this->FileName)) $o['FileName'] = $this->FileName;
if (isset($this->Landscape)) $o['Landscape'] = $this->Landscape;
if (isset($this->GeneratedAtUtc)) $o['GeneratedAtUtc'] = JsonConverters::to('DateTime', $this->GeneratedAtUtc);
if (isset($this->GeneratedBy)) $o['GeneratedBy'] = $this->GeneratedBy;
if (isset($this->Meta)) $o['Meta'] = JsonConverters::toArray('DocField', $this->Meta);
if (isset($this->Blocks)) $o['Blocks'] = JsonConverters::toArray('DocBlock', $this->Blocks);
if (isset($this->Issues)) $o['Issues'] = JsonConverters::toArray('DocIssue', $this->Issues);
if (isset($this->CanPrint)) $o['CanPrint'] = $this->CanPrint;
return empty($o) ? new class(){} : $o;
}
}
class PrintableResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var PrintDocument|null */
public ?PrintDocument $Document=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['Document'])) $this->Document = JsonConverters::from('PrintDocument', $o['Document']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->Document)) $o['Document'] = JsonConverters::to('PrintDocument', $this->Document);
return empty($o) ? new class(){} : $o;
}
}
class PayAppG702Request implements JsonSerializable
{
public function __construct(
/** @var int */
public int $ProjectID=0,
/** @var int */
public int $PeriodNumber=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ProjectID'])) $this->ProjectID = $o['ProjectID'];
if (isset($o['PeriodNumber'])) $this->PeriodNumber = $o['PeriodNumber'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ProjectID)) $o['ProjectID'] = $this->ProjectID;
if (isset($this->PeriodNumber)) $o['PeriodNumber'] = $this->PeriodNumber;
return empty($o) ? new class(){} : $o;
}
}
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/projects/{ProjectID}/pay-apps/{PeriodNumber}/g702 HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<PrintableResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Document>
<Blocks>
<DocBlock>
<Columns>0</Columns>
<Fields>
<DocField>
<Emphasis>false</Emphasis>
<Label>String</Label>
<Ref>String</Ref>
<Value>String</Value>
</DocField>
</Fields>
<Level>0</Level>
<Signatures xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:string>String</d5p1:string>
</Signatures>
<Table>
<Caption>String</Caption>
<Columns>
<DocColumn>
<Align>String</Align>
<Key>String</Key>
<Label>String</Label>
<Width>0</Width>
</DocColumn>
</Columns>
<Footer xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d6p1:ArrayOfstring>
<d6p1:string>String</d6p1:string>
</d6p1:ArrayOfstring>
</Footer>
<Rows xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d6p1:ArrayOfstring>
<d6p1:string>String</d6p1:string>
</d6p1:ArrayOfstring>
</Rows>
</Table>
<Text>String</Text>
<Type>String</Type>
</DocBlock>
</Blocks>
<FileName>String</FileName>
<GeneratedAtUtc>0001-01-01T00:00:00</GeneratedAtUtc>
<GeneratedBy>String</GeneratedBy>
<Issues>
<DocIssue>
<Code>String</Code>
<Message>String</Message>
<Severity>String</Severity>
</DocIssue>
</Issues>
<Kind>String</Kind>
<Landscape>false</Landscape>
<Meta>
<DocField>
<Emphasis>false</Emphasis>
<Label>String</Label>
<Ref>String</Ref>
<Value>String</Value>
</DocField>
</Meta>
<Subtitle>String</Subtitle>
<Title>String</Title>
</Document>
<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>
</PrintableResponse>