| POST,OPTIONS | /v1/coverage/self/swap |
|---|
<?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 CoverageSelfEligibility implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Tone=null,
/** @var string|null */
public ?string $Text=null,
/** @var bool|null */
public ?bool $CanClaim=null,
/** @var string|null */
public ?string $ClaimLabel=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Tone'])) $this->Tone = $o['Tone'];
if (isset($o['Text'])) $this->Text = $o['Text'];
if (isset($o['CanClaim'])) $this->CanClaim = $o['CanClaim'];
if (isset($o['ClaimLabel'])) $this->ClaimLabel = $o['ClaimLabel'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Tone)) $o['Tone'] = $this->Tone;
if (isset($this->Text)) $o['Text'] = $this->Text;
if (isset($this->CanClaim)) $o['CanClaim'] = $this->CanClaim;
if (isset($this->ClaimLabel)) $o['ClaimLabel'] = $this->ClaimLabel;
return empty($o) ? new class(){} : $o;
}
}
class CoverageSelfMatrixRow implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $Note=null,
/** @var string|null */
public ?string $Tone=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Note'])) $this->Note = $o['Note'];
if (isset($o['Tone'])) $this->Tone = $o['Tone'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Note)) $o['Note'] = $this->Note;
if (isset($this->Tone)) $o['Tone'] = $this->Tone;
return empty($o) ? new class(){} : $o;
}
}
class CoverageSelfCard implements JsonSerializable
{
public function __construct(
/** @var int */
public int $CoverageGapId=0,
/** @var string|null */
public ?string $Kind=null,
/** @var string|null */
public ?string $Status=null,
/** @var string|null */
public ?string $ShiftDay=null,
/** @var string|null */
public ?string $ShiftWindow=null,
/** @var DateTime|null */
public ?DateTime $ShiftStartUtc=null,
/** @var string|null */
public ?string $Site=null,
/** @var string|null */
public ?string $RoleNeeded=null,
/** @var string|null */
public ?string $ExpiryLabel=null,
/** @var string|null */
public ?string $PosterName=null,
/** @var int */
public int $EligibleCount=0,
/** @var int */
public int $IneligibleCount=0,
/** @var CoverageSelfEligibility|null */
public ?CoverageSelfEligibility $MyEligibility=null,
/** @var array<CoverageSelfMatrixRow>|null */
public ?array $Matrix=null,
/** @var string|null */
public ?string $SwapState=null,
/** @var string|null */
public ?string $SwapFromName=null,
/** @var string|null */
public ?string $SwapTargetName=null,
/** @var string|null */
public ?string $OfferShift=null,
/** @var string|null */
public ?string $WantShift=null,
/** @var bool|null */
public ?bool $ConflictOk=null,
/** @var string|null */
public ?string $ConflictLabel=null,
/** @var bool|null */
public ?bool $CanRespond=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['CoverageGapId'])) $this->CoverageGapId = $o['CoverageGapId'];
if (isset($o['Kind'])) $this->Kind = $o['Kind'];
if (isset($o['Status'])) $this->Status = $o['Status'];
if (isset($o['ShiftDay'])) $this->ShiftDay = $o['ShiftDay'];
if (isset($o['ShiftWindow'])) $this->ShiftWindow = $o['ShiftWindow'];
if (isset($o['ShiftStartUtc'])) $this->ShiftStartUtc = JsonConverters::from('DateTime', $o['ShiftStartUtc']);
if (isset($o['Site'])) $this->Site = $o['Site'];
if (isset($o['RoleNeeded'])) $this->RoleNeeded = $o['RoleNeeded'];
if (isset($o['ExpiryLabel'])) $this->ExpiryLabel = $o['ExpiryLabel'];
if (isset($o['PosterName'])) $this->PosterName = $o['PosterName'];
if (isset($o['EligibleCount'])) $this->EligibleCount = $o['EligibleCount'];
if (isset($o['IneligibleCount'])) $this->IneligibleCount = $o['IneligibleCount'];
if (isset($o['MyEligibility'])) $this->MyEligibility = JsonConverters::from('CoverageSelfEligibility', $o['MyEligibility']);
if (isset($o['Matrix'])) $this->Matrix = JsonConverters::fromArray('CoverageSelfMatrixRow', $o['Matrix']);
if (isset($o['SwapState'])) $this->SwapState = $o['SwapState'];
if (isset($o['SwapFromName'])) $this->SwapFromName = $o['SwapFromName'];
if (isset($o['SwapTargetName'])) $this->SwapTargetName = $o['SwapTargetName'];
if (isset($o['OfferShift'])) $this->OfferShift = $o['OfferShift'];
if (isset($o['WantShift'])) $this->WantShift = $o['WantShift'];
if (isset($o['ConflictOk'])) $this->ConflictOk = $o['ConflictOk'];
if (isset($o['ConflictLabel'])) $this->ConflictLabel = $o['ConflictLabel'];
if (isset($o['CanRespond'])) $this->CanRespond = $o['CanRespond'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->CoverageGapId)) $o['CoverageGapId'] = $this->CoverageGapId;
if (isset($this->Kind)) $o['Kind'] = $this->Kind;
if (isset($this->Status)) $o['Status'] = $this->Status;
if (isset($this->ShiftDay)) $o['ShiftDay'] = $this->ShiftDay;
if (isset($this->ShiftWindow)) $o['ShiftWindow'] = $this->ShiftWindow;
if (isset($this->ShiftStartUtc)) $o['ShiftStartUtc'] = JsonConverters::to('DateTime', $this->ShiftStartUtc);
if (isset($this->Site)) $o['Site'] = $this->Site;
if (isset($this->RoleNeeded)) $o['RoleNeeded'] = $this->RoleNeeded;
if (isset($this->ExpiryLabel)) $o['ExpiryLabel'] = $this->ExpiryLabel;
if (isset($this->PosterName)) $o['PosterName'] = $this->PosterName;
if (isset($this->EligibleCount)) $o['EligibleCount'] = $this->EligibleCount;
if (isset($this->IneligibleCount)) $o['IneligibleCount'] = $this->IneligibleCount;
if (isset($this->MyEligibility)) $o['MyEligibility'] = JsonConverters::to('CoverageSelfEligibility', $this->MyEligibility);
if (isset($this->Matrix)) $o['Matrix'] = JsonConverters::toArray('CoverageSelfMatrixRow', $this->Matrix);
if (isset($this->SwapState)) $o['SwapState'] = $this->SwapState;
if (isset($this->SwapFromName)) $o['SwapFromName'] = $this->SwapFromName;
if (isset($this->SwapTargetName)) $o['SwapTargetName'] = $this->SwapTargetName;
if (isset($this->OfferShift)) $o['OfferShift'] = $this->OfferShift;
if (isset($this->WantShift)) $o['WantShift'] = $this->WantShift;
if (isset($this->ConflictOk)) $o['ConflictOk'] = $this->ConflictOk;
if (isset($this->ConflictLabel)) $o['ConflictLabel'] = $this->ConflictLabel;
if (isset($this->CanRespond)) $o['CanRespond'] = $this->CanRespond;
return empty($o) ? new class(){} : $o;
}
}
class CoverageSelfCardResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var CoverageSelfCard|null */
public ?CoverageSelfCard $Card=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['Card'])) $this->Card = JsonConverters::from('CoverageSelfCard', $o['Card']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->Card)) $o['Card'] = JsonConverters::to('CoverageSelfCard', $this->Card);
return empty($o) ? new class(){} : $o;
}
}
class CoverageSelfSwapRequest implements JsonSerializable
{
public function __construct(
/** @var int */
public int $AItemId=0,
/** @var int */
public int $BItemId=0,
/** @var int */
public int $TargetContactID=0,
/** @var bool|null */
public ?bool $Broadcast=null,
/** @var int */
public int $TeamChannelId=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['AItemId'])) $this->AItemId = $o['AItemId'];
if (isset($o['BItemId'])) $this->BItemId = $o['BItemId'];
if (isset($o['TargetContactID'])) $this->TargetContactID = $o['TargetContactID'];
if (isset($o['Broadcast'])) $this->Broadcast = $o['Broadcast'];
if (isset($o['TeamChannelId'])) $this->TeamChannelId = $o['TeamChannelId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->AItemId)) $o['AItemId'] = $this->AItemId;
if (isset($this->BItemId)) $o['BItemId'] = $this->BItemId;
if (isset($this->TargetContactID)) $o['TargetContactID'] = $this->TargetContactID;
if (isset($this->Broadcast)) $o['Broadcast'] = $this->Broadcast;
if (isset($this->TeamChannelId)) $o['TeamChannelId'] = $this->TeamChannelId;
return empty($o) ? new class(){} : $o;
}
}
PHP CoverageSelfSwapRequest 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.
POST /v1/coverage/self/swap HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<CoverageSelfSwapRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<AItemId>0</AItemId>
<BItemId>0</BItemId>
<Broadcast>false</Broadcast>
<TargetContactID>0</TargetContactID>
<TeamChannelId>0</TeamChannelId>
</CoverageSelfSwapRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<CoverageSelfCardResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Card>
<CanRespond>false</CanRespond>
<ConflictLabel>String</ConflictLabel>
<ConflictOk>false</ConflictOk>
<CoverageGapId>0</CoverageGapId>
<EligibleCount>0</EligibleCount>
<ExpiryLabel>String</ExpiryLabel>
<IneligibleCount>0</IneligibleCount>
<Kind>String</Kind>
<Matrix>
<CoverageSelfMatrixRow>
<Name>String</Name>
<Note>String</Note>
<Tone>String</Tone>
</CoverageSelfMatrixRow>
</Matrix>
<MyEligibility>
<CanClaim>false</CanClaim>
<ClaimLabel>String</ClaimLabel>
<Text>String</Text>
<Tone>String</Tone>
</MyEligibility>
<OfferShift>String</OfferShift>
<PosterName>String</PosterName>
<RoleNeeded>String</RoleNeeded>
<ShiftDay>String</ShiftDay>
<ShiftStartUtc>0001-01-01T00:00:00</ShiftStartUtc>
<ShiftWindow>String</ShiftWindow>
<Site>String</Site>
<Status>String</Status>
<SwapFromName>String</SwapFromName>
<SwapState>String</SwapState>
<SwapTargetName>String</SwapTargetName>
<WantShift>String</WantShift>
</Card>
<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>
</CoverageSelfCardResponse>