Trendsic Platform Service

<back to all web services

NotificationRecipientRequest

Requires Authentication
Requires any of the roles:Agent, Administrator, Agent, Administrator, Agent, Administrator, Agent, Administrator
The following routes are available for this service:
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 .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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/json
Content-Type: application/json
Content-Length: length

{"NotificationRecipient":[{"RecipientName":"String","NotificationRecipientId":0,"NotificationMessageId":0,"RecipientId":0,"Folder":"String","IsStarred":false,"IsImportant":false,"IsRead":false,"IsDeleted":false}]}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"NotificationRecipient":[{"RecipientName":"String","NotificationRecipientId":0,"NotificationMessageId":0,"RecipientId":0,"Folder":"String","IsStarred":false,"IsImportant":false,"IsRead":false,"IsDeleted":false}]}