| GET | /v1/coverage/policies |
|---|
<?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 CoveragePolicy implements JsonSerializable
{
public function __construct(
/** @var int */
public int $CoveragePolicyId=0,
/** @var string */
public string $CoveragePolicyUID='',
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $ScopeLevel=null,
/** @var string|null */
public ?string $BranchId=null,
/** @var string|null */
public ?string $BranchName=null,
/** @var string|null */
public ?string $WorkTypeKey=null,
/** @var int|null */
public ?int $JobID=null,
/** @var string|null */
public ?string $JobName=null,
/** @var int */
public int $CurrentVersion=0,
/** @var bool|null */
public ?bool $IsActive=null,
/** @var DateTime */
public DateTime $CreatedAt=new DateTime(),
/** @var DateTime|null */
public ?DateTime $UpdatedAt=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['CoveragePolicyId'])) $this->CoveragePolicyId = $o['CoveragePolicyId'];
if (isset($o['CoveragePolicyUID'])) $this->CoveragePolicyUID = $o['CoveragePolicyUID'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['ScopeLevel'])) $this->ScopeLevel = $o['ScopeLevel'];
if (isset($o['BranchId'])) $this->BranchId = $o['BranchId'];
if (isset($o['BranchName'])) $this->BranchName = $o['BranchName'];
if (isset($o['WorkTypeKey'])) $this->WorkTypeKey = $o['WorkTypeKey'];
if (isset($o['JobID'])) $this->JobID = $o['JobID'];
if (isset($o['JobName'])) $this->JobName = $o['JobName'];
if (isset($o['CurrentVersion'])) $this->CurrentVersion = $o['CurrentVersion'];
if (isset($o['IsActive'])) $this->IsActive = $o['IsActive'];
if (isset($o['CreatedAt'])) $this->CreatedAt = JsonConverters::from('DateTime', $o['CreatedAt']);
if (isset($o['UpdatedAt'])) $this->UpdatedAt = JsonConverters::from('DateTime', $o['UpdatedAt']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->CoveragePolicyId)) $o['CoveragePolicyId'] = $this->CoveragePolicyId;
if (isset($this->CoveragePolicyUID)) $o['CoveragePolicyUID'] = $this->CoveragePolicyUID;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->ScopeLevel)) $o['ScopeLevel'] = $this->ScopeLevel;
if (isset($this->BranchId)) $o['BranchId'] = $this->BranchId;
if (isset($this->BranchName)) $o['BranchName'] = $this->BranchName;
if (isset($this->WorkTypeKey)) $o['WorkTypeKey'] = $this->WorkTypeKey;
if (isset($this->JobID)) $o['JobID'] = $this->JobID;
if (isset($this->JobName)) $o['JobName'] = $this->JobName;
if (isset($this->CurrentVersion)) $o['CurrentVersion'] = $this->CurrentVersion;
if (isset($this->IsActive)) $o['IsActive'] = $this->IsActive;
if (isset($this->CreatedAt)) $o['CreatedAt'] = JsonConverters::to('DateTime', $this->CreatedAt);
if (isset($this->UpdatedAt)) $o['UpdatedAt'] = JsonConverters::to('DateTime', $this->UpdatedAt);
return empty($o) ? new class(){} : $o;
}
}
class CoveragePoliciesResponse implements JsonSerializable
{
public function __construct(
/** @var array<CoveragePolicy>|null */
public ?array $Policies=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Policies'])) $this->Policies = JsonConverters::fromArray('CoveragePolicy', $o['Policies']);
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Policies)) $o['Policies'] = JsonConverters::toArray('CoveragePolicy', $this->Policies);
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
return empty($o) ? new class(){} : $o;
}
}
class CoveragePoliciesRequest implements JsonSerializable
{
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
return empty($o) ? new class(){} : $o;
}
}
PHP CoveragePoliciesRequest 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/coverage/policies HTTP/1.1 Host: api.dev.dynamics.trendsic.com Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<CoveragePoliciesResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Policies>
<CoveragePolicy>
<BranchId>00000000-0000-0000-0000-000000000000</BranchId>
<BranchName>String</BranchName>
<CoveragePolicyId>0</CoveragePolicyId>
<CoveragePolicyUID>00000000-0000-0000-0000-000000000000</CoveragePolicyUID>
<CreatedAt>0001-01-01T00:00:00</CreatedAt>
<CurrentVersion>0</CurrentVersion>
<IsActive>false</IsActive>
<JobID>0</JobID>
<JobName>String</JobName>
<Name>String</Name>
<ScopeLevel>String</ScopeLevel>
<UpdatedAt>0001-01-01T00:00:00</UpdatedAt>
<WorkTypeKey>String</WorkTypeKey>
</CoveragePolicy>
</Policies>
<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>
</CoveragePoliciesResponse>