| All Verbs | /api/contact/{ContactId}/notifications |
|---|
<?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 InputSwitch implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Id=null,
/** @var string|null */
public ?string $Name=null,
/** @var bool|null */
public ?bool $IsDisabled=null,
/** @var bool|null */
public ?bool $IsChecked=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['IsDisabled'])) $this->IsDisabled = $o['IsDisabled'];
if (isset($o['IsChecked'])) $this->IsChecked = $o['IsChecked'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->IsDisabled)) $o['IsDisabled'] = $this->IsDisabled;
if (isset($this->IsChecked)) $o['IsChecked'] = $this->IsChecked;
return empty($o) ? new class(){} : $o;
}
}
class NotificationDetails implements JsonSerializable
{
public function __construct(
/** @var string */
public string $NotificationId='',
/** @var string|null */
public ?string $NotificationGroupName=null,
/** @var string */
public string $NotificationValueId='',
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $Description=null,
/** @var bool|null */
public ?bool $IsMandatory=null,
/** @var bool|null */
public ?bool $IsCardinality=null,
/** @var bool|null */
public ?bool $IsSystem=null,
/** @var bool|null */
public ?bool $IsVisibleToRecipients=null,
/** @var int */
public int $Index=0,
/** @var InputSwitch|null */
public ?InputSwitch $Email=null,
/** @var InputSwitch|null */
public ?InputSwitch $SMS=null,
/** @var InputSwitch|null */
public ?InputSwitch $UpdateNotification=null,
/** @var InputSwitch|null */
public ?InputSwitch $Push=null,
/** @var InputSwitch|null */
public ?InputSwitch $Phone=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['NotificationId'])) $this->NotificationId = $o['NotificationId'];
if (isset($o['NotificationGroupName'])) $this->NotificationGroupName = $o['NotificationGroupName'];
if (isset($o['NotificationValueId'])) $this->NotificationValueId = $o['NotificationValueId'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Description'])) $this->Description = $o['Description'];
if (isset($o['IsMandatory'])) $this->IsMandatory = $o['IsMandatory'];
if (isset($o['IsCardinality'])) $this->IsCardinality = $o['IsCardinality'];
if (isset($o['IsSystem'])) $this->IsSystem = $o['IsSystem'];
if (isset($o['IsVisibleToRecipients'])) $this->IsVisibleToRecipients = $o['IsVisibleToRecipients'];
if (isset($o['Index'])) $this->Index = $o['Index'];
if (isset($o['Email'])) $this->Email = JsonConverters::from('InputSwitch', $o['Email']);
if (isset($o['SMS'])) $this->SMS = JsonConverters::from('InputSwitch', $o['SMS']);
if (isset($o['UpdateNotification'])) $this->UpdateNotification = JsonConverters::from('InputSwitch', $o['UpdateNotification']);
if (isset($o['Push'])) $this->Push = JsonConverters::from('InputSwitch', $o['Push']);
if (isset($o['Phone'])) $this->Phone = JsonConverters::from('InputSwitch', $o['Phone']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->NotificationId)) $o['NotificationId'] = $this->NotificationId;
if (isset($this->NotificationGroupName)) $o['NotificationGroupName'] = $this->NotificationGroupName;
if (isset($this->NotificationValueId)) $o['NotificationValueId'] = $this->NotificationValueId;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Description)) $o['Description'] = $this->Description;
if (isset($this->IsMandatory)) $o['IsMandatory'] = $this->IsMandatory;
if (isset($this->IsCardinality)) $o['IsCardinality'] = $this->IsCardinality;
if (isset($this->IsSystem)) $o['IsSystem'] = $this->IsSystem;
if (isset($this->IsVisibleToRecipients)) $o['IsVisibleToRecipients'] = $this->IsVisibleToRecipients;
if (isset($this->Index)) $o['Index'] = $this->Index;
if (isset($this->Email)) $o['Email'] = JsonConverters::to('InputSwitch', $this->Email);
if (isset($this->SMS)) $o['SMS'] = JsonConverters::to('InputSwitch', $this->SMS);
if (isset($this->UpdateNotification)) $o['UpdateNotification'] = JsonConverters::to('InputSwitch', $this->UpdateNotification);
if (isset($this->Push)) $o['Push'] = JsonConverters::to('InputSwitch', $this->Push);
if (isset($this->Phone)) $o['Phone'] = JsonConverters::to('InputSwitch', $this->Phone);
return empty($o) ? new class(){} : $o;
}
}
class NotificationGroup implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $GroupName=null,
/** @var array<NotificationDetails>|null */
public ?array $Notifications=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['GroupName'])) $this->GroupName = $o['GroupName'];
if (isset($o['Notifications'])) $this->Notifications = JsonConverters::fromArray('NotificationDetails', $o['Notifications']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->GroupName)) $o['GroupName'] = $this->GroupName;
if (isset($this->Notifications)) $o['Notifications'] = JsonConverters::toArray('NotificationDetails', $this->Notifications);
return empty($o) ? new class(){} : $o;
}
}
// @ApiResponse(Description="List of contact notifications")
class GetContactNotificationsResponse implements JsonSerializable
{
public function __construct(
/** @var array<NotificationGroup>|null */
public ?array $Notifications=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Notifications'])) $this->Notifications = JsonConverters::fromArray('NotificationGroup', $o['Notifications']);
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Notifications)) $o['Notifications'] = JsonConverters::toArray('NotificationGroup', $this->Notifications);
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
return empty($o) ? new class(){} : $o;
}
}
/** @description Get notifications for the specified contact */
// @Api(Description="Get notifications for the specified contact")
class GetContactNotifications implements JsonSerializable
{
public function __construct(
/** @description Id of contact to get notifications for */
// @ApiMember(Description="Id of contact to get notifications for", IsRequired=true, Name="ContactId")
/** @var string */
public string $ContactId='',
/** @description Id of licensee to get notifications for */
// @ApiMember(Description="Id of licensee to get notifications for", IsRequired=true, Name="LicenseeId")
/** @var string */
public string $LicenseeId='',
/** @description Id of suite to get notifications for */
// @ApiMember(Description="Id of suite to get notifications for", IsRequired=true, Name="Suite")
/** @var string */
public string $SuiteId=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ContactId'])) $this->ContactId = $o['ContactId'];
if (isset($o['LicenseeId'])) $this->LicenseeId = $o['LicenseeId'];
if (isset($o['SuiteId'])) $this->SuiteId = $o['SuiteId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ContactId)) $o['ContactId'] = $this->ContactId;
if (isset($this->LicenseeId)) $o['LicenseeId'] = $this->LicenseeId;
if (isset($this->SuiteId)) $o['SuiteId'] = $this->SuiteId;
return empty($o) ? new class(){} : $o;
}
}
PHP GetContactNotifications 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 /api/contact/{ContactId}/notifications HTTP/1.1
Host: pfapi.pstpf.com.au
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<GetContactNotifications xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eros.Subtle.Canvara.WebAPIModel.ServiceModel">
<ContactId>00000000-0000-0000-0000-000000000000</ContactId>
<LicenseeId>00000000-0000-0000-0000-000000000000</LicenseeId>
<SuiteId>00000000-0000-0000-0000-000000000000</SuiteId>
</GetContactNotifications>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<GetContactNotificationsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eros.Subtle.Canvara.WebAPIModel.ServiceModel">
<Notifications xmlns:d2p1="http://schemas.datacontract.org/2004/07/Eros.Causal.Common.Entity">
<d2p1:NotificationGroup>
<d2p1:GroupName>String</d2p1:GroupName>
<d2p1:Notifications>
<d2p1:NotificationDetails>
<d2p1:Description>String</d2p1:Description>
<d2p1:Email>
<d2p1:Id>String</d2p1:Id>
<d2p1:IsChecked>false</d2p1:IsChecked>
<d2p1:IsDisabled>false</d2p1:IsDisabled>
<d2p1:Name>String</d2p1:Name>
</d2p1:Email>
<d2p1:Index>0</d2p1:Index>
<d2p1:IsCardinality>false</d2p1:IsCardinality>
<d2p1:IsMandatory>false</d2p1:IsMandatory>
<d2p1:IsSystem>false</d2p1:IsSystem>
<d2p1:IsVisibleToRecipients>false</d2p1:IsVisibleToRecipients>
<d2p1:Name>String</d2p1:Name>
<d2p1:NotificationGroupName>String</d2p1:NotificationGroupName>
<d2p1:NotificationId>00000000-0000-0000-0000-000000000000</d2p1:NotificationId>
<d2p1:NotificationValueId>00000000-0000-0000-0000-000000000000</d2p1:NotificationValueId>
<d2p1:Phone>
<d2p1:Id>String</d2p1:Id>
<d2p1:IsChecked>false</d2p1:IsChecked>
<d2p1:IsDisabled>false</d2p1:IsDisabled>
<d2p1:Name>String</d2p1:Name>
</d2p1:Phone>
<d2p1:Push>
<d2p1:Id>String</d2p1:Id>
<d2p1:IsChecked>false</d2p1:IsChecked>
<d2p1:IsDisabled>false</d2p1:IsDisabled>
<d2p1:Name>String</d2p1:Name>
</d2p1:Push>
<d2p1:SMS>
<d2p1:Id>String</d2p1:Id>
<d2p1:IsChecked>false</d2p1:IsChecked>
<d2p1:IsDisabled>false</d2p1:IsDisabled>
<d2p1:Name>String</d2p1:Name>
</d2p1:SMS>
<d2p1:UpdateNotification>
<d2p1:Id>String</d2p1:Id>
<d2p1:IsChecked>false</d2p1:IsChecked>
<d2p1:IsDisabled>false</d2p1:IsDisabled>
<d2p1:Name>String</d2p1:Name>
</d2p1:UpdateNotification>
</d2p1:NotificationDetails>
</d2p1:Notifications>
</d2p1:NotificationGroup>
</Notifications>
<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>
</GetContactNotificationsResponse>