| Requires any of the roles: | Agent, Administrator, Agent, Administrator, Agent, Administrator, Agent, Administrator |
| GET,POST,PUT,DELETE,OPTIONS | /v1/NotificationRecipient/{NotificationRecipientId} | ||
|---|---|---|---|
| GET,POST,PUT,DELETE,OPTIONS | /v1/NotificationRecipient |
<?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 NotificationRecipient implements JsonSerializable
{
public function __construct(
/** @var int */
public int $NotificationRecipientId=0,
/** @var int */
public int $NotificationMessageId=0,
/** @var int */
public int $RecipientId=0,
/** @var string|null */
public ?string $Folder=null,
/** @var bool|null */
public ?bool $IsStarred=null,
/** @var bool|null */
public ?bool $IsImportant=null,
/** @var bool|null */
public ?bool $IsRead=null,
/** @var bool|null */
public ?bool $IsDeleted=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['NotificationRecipientId'])) $this->NotificationRecipientId = $o['NotificationRecipientId'];
if (isset($o['NotificationMessageId'])) $this->NotificationMessageId = $o['NotificationMessageId'];
if (isset($o['RecipientId'])) $this->RecipientId = $o['RecipientId'];
if (isset($o['Folder'])) $this->Folder = $o['Folder'];
if (isset($o['IsStarred'])) $this->IsStarred = $o['IsStarred'];
if (isset($o['IsImportant'])) $this->IsImportant = $o['IsImportant'];
if (isset($o['IsRead'])) $this->IsRead = $o['IsRead'];
if (isset($o['IsDeleted'])) $this->IsDeleted = $o['IsDeleted'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->NotificationRecipientId)) $o['NotificationRecipientId'] = $this->NotificationRecipientId;
if (isset($this->NotificationMessageId)) $o['NotificationMessageId'] = $this->NotificationMessageId;
if (isset($this->RecipientId)) $o['RecipientId'] = $this->RecipientId;
if (isset($this->Folder)) $o['Folder'] = $this->Folder;
if (isset($this->IsStarred)) $o['IsStarred'] = $this->IsStarred;
if (isset($this->IsImportant)) $o['IsImportant'] = $this->IsImportant;
if (isset($this->IsRead)) $o['IsRead'] = $this->IsRead;
if (isset($this->IsDeleted)) $o['IsDeleted'] = $this->IsDeleted;
return empty($o) ? new class(){} : $o;
}
}
class NotificationRecipientExtended extends NotificationRecipient implements JsonSerializable
{
/**
* @param int $NotificationRecipientId
* @param int $NotificationMessageId
* @param int $RecipientId
* @param string|null $Folder
* @param bool|null $IsStarred
* @param bool|null $IsImportant
* @param bool|null $IsRead
* @param bool|null $IsDeleted
*/
public function __construct(
int $NotificationRecipientId=0,
int $NotificationMessageId=0,
int $RecipientId=0,
?string $Folder=null,
?bool $IsStarred=null,
?bool $IsImportant=null,
?bool $IsRead=null,
?bool $IsDeleted=null,
/** @var string|null */
public ?string $RecipientName=null
) {
parent::__construct($NotificationRecipientId,$NotificationMessageId,$RecipientId,$Folder,$IsStarred,$IsImportant,$IsRead,$IsDeleted);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['RecipientName'])) $this->RecipientName = $o['RecipientName'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->RecipientName)) $o['RecipientName'] = $this->RecipientName;
return empty($o) ? new class(){} : $o;
}
}
class NotificationRecipientResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var array<NotificationRecipientExtended>|null */
public ?array $NotificationRecipient=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['NotificationRecipient'])) $this->NotificationRecipient = JsonConverters::fromArray('NotificationRecipientExtended', $o['NotificationRecipient']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->NotificationRecipient)) $o['NotificationRecipient'] = JsonConverters::toArray('NotificationRecipientExtended', $this->NotificationRecipient);
return empty($o) ? new class(){} : $o;
}
}
class NotificationRecipientRequest implements JsonSerializable
{
public function __construct(
/** @var array<NotificationRecipientExtended>|null */
public ?array $NotificationRecipient=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['NotificationRecipient'])) $this->NotificationRecipient = JsonConverters::fromArray('NotificationRecipientExtended', $o['NotificationRecipient']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->NotificationRecipient)) $o['NotificationRecipient'] = JsonConverters::toArray('NotificationRecipientExtended', $this->NotificationRecipient);
return empty($o) ? new class(){} : $o;
}
}
PHP NotificationRecipientRequest 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/NotificationRecipient/{NotificationRecipientId} HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<NotificationRecipientRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<NotificationRecipient>
<NotificationRecipientExtended>
<Folder>String</Folder>
<IsDeleted>false</IsDeleted>
<IsImportant>false</IsImportant>
<IsRead>false</IsRead>
<IsStarred>false</IsStarred>
<NotificationMessageId>0</NotificationMessageId>
<NotificationRecipientId>0</NotificationRecipientId>
<RecipientId>0</RecipientId>
<RecipientName>String</RecipientName>
</NotificationRecipientExtended>
</NotificationRecipient>
</NotificationRecipientRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<NotificationRecipientResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<NotificationRecipient>
<NotificationRecipientExtended>
<Folder>String</Folder>
<IsDeleted>false</IsDeleted>
<IsImportant>false</IsImportant>
<IsRead>false</IsRead>
<IsStarred>false</IsStarred>
<NotificationMessageId>0</NotificationMessageId>
<NotificationRecipientId>0</NotificationRecipientId>
<RecipientId>0</RecipientId>
<RecipientName>String</RecipientName>
</NotificationRecipientExtended>
</NotificationRecipient>
<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>
</NotificationRecipientResponse>