| GET | /v1/coverage/restriction/byworker/{WorkerContactID} |
|---|
<?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 ClientWorkerRestriction implements JsonSerializable
{
public function __construct(
/** @var int */
public int $ClientWorkerRestrictionID=0,
/** @var string|null */
public ?string $BranchId=null,
/** @var int */
public int $ClientContactID=0,
/** @var int */
public int $WorkerContactID=0,
/** @var string|null */
public ?string $RestrictionLevel=null,
/** @var string|null */
public ?string $Reason=null,
/** @var int|null */
public ?int $SourceRatingID=null,
/** @var string|null */
public ?string $CreatedBy=null,
/** @var DateTime */
public DateTime $CreatedAt=new DateTime(),
/** @var DateTime|null */
public ?DateTime $UpdatedAt=null,
/** @var string|null */
public ?string $ClientName=null,
/** @var string|null */
public ?string $WorkerName=null,
/** @var string|null */
public ?string $LevelLabel=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ClientWorkerRestrictionID'])) $this->ClientWorkerRestrictionID = $o['ClientWorkerRestrictionID'];
if (isset($o['BranchId'])) $this->BranchId = $o['BranchId'];
if (isset($o['ClientContactID'])) $this->ClientContactID = $o['ClientContactID'];
if (isset($o['WorkerContactID'])) $this->WorkerContactID = $o['WorkerContactID'];
if (isset($o['RestrictionLevel'])) $this->RestrictionLevel = $o['RestrictionLevel'];
if (isset($o['Reason'])) $this->Reason = $o['Reason'];
if (isset($o['SourceRatingID'])) $this->SourceRatingID = $o['SourceRatingID'];
if (isset($o['CreatedBy'])) $this->CreatedBy = $o['CreatedBy'];
if (isset($o['CreatedAt'])) $this->CreatedAt = JsonConverters::from('DateTime', $o['CreatedAt']);
if (isset($o['UpdatedAt'])) $this->UpdatedAt = JsonConverters::from('DateTime', $o['UpdatedAt']);
if (isset($o['ClientName'])) $this->ClientName = $o['ClientName'];
if (isset($o['WorkerName'])) $this->WorkerName = $o['WorkerName'];
if (isset($o['LevelLabel'])) $this->LevelLabel = $o['LevelLabel'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ClientWorkerRestrictionID)) $o['ClientWorkerRestrictionID'] = $this->ClientWorkerRestrictionID;
if (isset($this->BranchId)) $o['BranchId'] = $this->BranchId;
if (isset($this->ClientContactID)) $o['ClientContactID'] = $this->ClientContactID;
if (isset($this->WorkerContactID)) $o['WorkerContactID'] = $this->WorkerContactID;
if (isset($this->RestrictionLevel)) $o['RestrictionLevel'] = $this->RestrictionLevel;
if (isset($this->Reason)) $o['Reason'] = $this->Reason;
if (isset($this->SourceRatingID)) $o['SourceRatingID'] = $this->SourceRatingID;
if (isset($this->CreatedBy)) $o['CreatedBy'] = $this->CreatedBy;
if (isset($this->CreatedAt)) $o['CreatedAt'] = JsonConverters::to('DateTime', $this->CreatedAt);
if (isset($this->UpdatedAt)) $o['UpdatedAt'] = JsonConverters::to('DateTime', $this->UpdatedAt);
if (isset($this->ClientName)) $o['ClientName'] = $this->ClientName;
if (isset($this->WorkerName)) $o['WorkerName'] = $this->WorkerName;
if (isset($this->LevelLabel)) $o['LevelLabel'] = $this->LevelLabel;
return empty($o) ? new class(){} : $o;
}
}
class RestrictionParty implements JsonSerializable
{
public function __construct(
/** @var int */
public int $ContactId=0,
/** @var string|null */
public ?string $Name=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ContactId'])) $this->ContactId = $o['ContactId'];
if (isset($o['Name'])) $this->Name = $o['Name'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ContactId)) $o['ContactId'] = $this->ContactId;
if (isset($this->Name)) $o['Name'] = $this->Name;
return empty($o) ? new class(){} : $o;
}
}
class ClientWorkerRestrictionsResponse implements JsonSerializable
{
public function __construct(
/** @var array<ClientWorkerRestriction>|null */
public ?array $Restrictions=null,
/** @var array<RestrictionParty>|null */
public ?array $Clients=null,
/** @var array<RestrictionParty>|null */
public ?array $Workers=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Restrictions'])) $this->Restrictions = JsonConverters::fromArray('ClientWorkerRestriction', $o['Restrictions']);
if (isset($o['Clients'])) $this->Clients = JsonConverters::fromArray('RestrictionParty', $o['Clients']);
if (isset($o['Workers'])) $this->Workers = JsonConverters::fromArray('RestrictionParty', $o['Workers']);
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Restrictions)) $o['Restrictions'] = JsonConverters::toArray('ClientWorkerRestriction', $this->Restrictions);
if (isset($this->Clients)) $o['Clients'] = JsonConverters::toArray('RestrictionParty', $this->Clients);
if (isset($this->Workers)) $o['Workers'] = JsonConverters::toArray('RestrictionParty', $this->Workers);
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
return empty($o) ? new class(){} : $o;
}
}
class ClientWorkerRestrictionByWorkerRequest implements JsonSerializable
{
public function __construct(
/** @var int */
public int $WorkerContactID=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['WorkerContactID'])) $this->WorkerContactID = $o['WorkerContactID'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->WorkerContactID)) $o['WorkerContactID'] = $this->WorkerContactID;
return empty($o) ? new class(){} : $o;
}
}
PHP ClientWorkerRestrictionByWorkerRequest 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/restriction/byworker/{WorkerContactID} HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<ClientWorkerRestrictionsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Clients>
<RestrictionParty>
<ContactId>0</ContactId>
<Name>String</Name>
</RestrictionParty>
</Clients>
<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>
<Restrictions>
<ClientWorkerRestriction>
<BranchId>00000000-0000-0000-0000-000000000000</BranchId>
<ClientContactID>0</ClientContactID>
<ClientName>String</ClientName>
<ClientWorkerRestrictionID>0</ClientWorkerRestrictionID>
<CreatedAt>0001-01-01T00:00:00</CreatedAt>
<CreatedBy>String</CreatedBy>
<LevelLabel>String</LevelLabel>
<Reason>String</Reason>
<RestrictionLevel>String</RestrictionLevel>
<SourceRatingID>0</SourceRatingID>
<UpdatedAt>0001-01-01T00:00:00</UpdatedAt>
<WorkerContactID>0</WorkerContactID>
<WorkerName>String</WorkerName>
</ClientWorkerRestriction>
</Restrictions>
<Workers>
<RestrictionParty>
<ContactId>0</ContactId>
<Name>String</Name>
</RestrictionParty>
</Workers>
</ClientWorkerRestrictionsResponse>