Platform API

<back to all web services

UpdateNotification

Updates an existing notification

Requires Authentication
The following routes are available for this service:
POST/api/notification/update
<?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 NotificationRole implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $RoleId='',
        /** @var string|null */
        public ?string $RoleName=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['RoleId'])) $this->RoleId = $o['RoleId'];
        if (isset($o['RoleName'])) $this->RoleName = $o['RoleName'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->RoleId)) $o['RoleId'] = $this->RoleId;
        if (isset($this->RoleName)) $o['RoleName'] = $this->RoleName;
        return empty($o) ? new class(){} : $o;
    }
}

class Notification implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $NotificationId='',
        /** @var string */
        public string $NotificationGroupId='',
        /** @var string|null */
        public ?string $NotificationGroupName=null,
        /** @var string */
        public string $SuiteId='',
        /** @var string|null */
        public ?string $SuiteName=null,
        /** @var string */
        public string $NotificationValueId='',
        /** @var array<NotificationRole>|null */
        public ?array $Roles=null,
        /** @var string|null */
        public ?string $RolesToDisplay=null,
        /** @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 $IsAudit=null,
        /** @var bool|null */
        public ?bool $IsVisibleToRecipients=null,
        /** @var bool|null */
        public ?bool $IsSingleUse=null,
        /** @var bool|null */
        public ?bool $Email=null,
        /** @var bool|null */
        public ?bool $EmailDefault=null,
        /** @var string */
        public string $EmailTemplateId='',
        /** @var string|null */
        public ?string $EmailTemplateBody=null,
        /** @var string|null */
        public ?string $EmailSubject=null,
        /** @var bool|null */
        public ?bool $SMS=null,
        /** @var bool|null */
        public ?bool $SMSDefault=null,
        /** @var string */
        public string $SMSTemplateId='',
        /** @var string|null */
        public ?string $SMSTemplateBody=null,
        /** @var bool|null */
        public ?bool $UpdateNotification=null,
        /** @var bool|null */
        public ?bool $UpdateNotificationDefault=null,
        /** @var string */
        public string $UpdateTemplateId='',
        /** @var string|null */
        public ?string $UpdateTemplateBody=null,
        /** @var string|null */
        public ?string $UpdateSubject=null,
        /** @var bool|null */
        public ?bool $Push=null,
        /** @var bool|null */
        public ?bool $PushDefault=null,
        /** @var bool|null */
        public ?bool $Phone=null,
        /** @var bool|null */
        public ?bool $PhoneDefault=null,
        /** @var string */
        public string $ContactIdOwner='',
        /** @var string|null */
        public ?string $RecordStatus=null,
        /** @var string */
        public string $EmailTemplateDefinitionId='',
        /** @var string */
        public string $SMSTemplateDefinitionId='',
        /** @var string */
        public string $UpdateTemplateDefinitionId='',
        /** @var int */
        public int $Index=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['NotificationId'])) $this->NotificationId = $o['NotificationId'];
        if (isset($o['NotificationGroupId'])) $this->NotificationGroupId = $o['NotificationGroupId'];
        if (isset($o['NotificationGroupName'])) $this->NotificationGroupName = $o['NotificationGroupName'];
        if (isset($o['SuiteId'])) $this->SuiteId = $o['SuiteId'];
        if (isset($o['SuiteName'])) $this->SuiteName = $o['SuiteName'];
        if (isset($o['NotificationValueId'])) $this->NotificationValueId = $o['NotificationValueId'];
        if (isset($o['Roles'])) $this->Roles = JsonConverters::fromArray('NotificationRole', $o['Roles']);
        if (isset($o['RolesToDisplay'])) $this->RolesToDisplay = $o['RolesToDisplay'];
        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['IsAudit'])) $this->IsAudit = $o['IsAudit'];
        if (isset($o['IsVisibleToRecipients'])) $this->IsVisibleToRecipients = $o['IsVisibleToRecipients'];
        if (isset($o['IsSingleUse'])) $this->IsSingleUse = $o['IsSingleUse'];
        if (isset($o['Email'])) $this->Email = $o['Email'];
        if (isset($o['EmailDefault'])) $this->EmailDefault = $o['EmailDefault'];
        if (isset($o['EmailTemplateId'])) $this->EmailTemplateId = $o['EmailTemplateId'];
        if (isset($o['EmailTemplateBody'])) $this->EmailTemplateBody = $o['EmailTemplateBody'];
        if (isset($o['EmailSubject'])) $this->EmailSubject = $o['EmailSubject'];
        if (isset($o['SMS'])) $this->SMS = $o['SMS'];
        if (isset($o['SMSDefault'])) $this->SMSDefault = $o['SMSDefault'];
        if (isset($o['SMSTemplateId'])) $this->SMSTemplateId = $o['SMSTemplateId'];
        if (isset($o['SMSTemplateBody'])) $this->SMSTemplateBody = $o['SMSTemplateBody'];
        if (isset($o['UpdateNotification'])) $this->UpdateNotification = $o['UpdateNotification'];
        if (isset($o['UpdateNotificationDefault'])) $this->UpdateNotificationDefault = $o['UpdateNotificationDefault'];
        if (isset($o['UpdateTemplateId'])) $this->UpdateTemplateId = $o['UpdateTemplateId'];
        if (isset($o['UpdateTemplateBody'])) $this->UpdateTemplateBody = $o['UpdateTemplateBody'];
        if (isset($o['UpdateSubject'])) $this->UpdateSubject = $o['UpdateSubject'];
        if (isset($o['Push'])) $this->Push = $o['Push'];
        if (isset($o['PushDefault'])) $this->PushDefault = $o['PushDefault'];
        if (isset($o['Phone'])) $this->Phone = $o['Phone'];
        if (isset($o['PhoneDefault'])) $this->PhoneDefault = $o['PhoneDefault'];
        if (isset($o['ContactIdOwner'])) $this->ContactIdOwner = $o['ContactIdOwner'];
        if (isset($o['RecordStatus'])) $this->RecordStatus = $o['RecordStatus'];
        if (isset($o['EmailTemplateDefinitionId'])) $this->EmailTemplateDefinitionId = $o['EmailTemplateDefinitionId'];
        if (isset($o['SMSTemplateDefinitionId'])) $this->SMSTemplateDefinitionId = $o['SMSTemplateDefinitionId'];
        if (isset($o['UpdateTemplateDefinitionId'])) $this->UpdateTemplateDefinitionId = $o['UpdateTemplateDefinitionId'];
        if (isset($o['Index'])) $this->Index = $o['Index'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->NotificationId)) $o['NotificationId'] = $this->NotificationId;
        if (isset($this->NotificationGroupId)) $o['NotificationGroupId'] = $this->NotificationGroupId;
        if (isset($this->NotificationGroupName)) $o['NotificationGroupName'] = $this->NotificationGroupName;
        if (isset($this->SuiteId)) $o['SuiteId'] = $this->SuiteId;
        if (isset($this->SuiteName)) $o['SuiteName'] = $this->SuiteName;
        if (isset($this->NotificationValueId)) $o['NotificationValueId'] = $this->NotificationValueId;
        if (isset($this->Roles)) $o['Roles'] = JsonConverters::toArray('NotificationRole', $this->Roles);
        if (isset($this->RolesToDisplay)) $o['RolesToDisplay'] = $this->RolesToDisplay;
        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->IsAudit)) $o['IsAudit'] = $this->IsAudit;
        if (isset($this->IsVisibleToRecipients)) $o['IsVisibleToRecipients'] = $this->IsVisibleToRecipients;
        if (isset($this->IsSingleUse)) $o['IsSingleUse'] = $this->IsSingleUse;
        if (isset($this->Email)) $o['Email'] = $this->Email;
        if (isset($this->EmailDefault)) $o['EmailDefault'] = $this->EmailDefault;
        if (isset($this->EmailTemplateId)) $o['EmailTemplateId'] = $this->EmailTemplateId;
        if (isset($this->EmailTemplateBody)) $o['EmailTemplateBody'] = $this->EmailTemplateBody;
        if (isset($this->EmailSubject)) $o['EmailSubject'] = $this->EmailSubject;
        if (isset($this->SMS)) $o['SMS'] = $this->SMS;
        if (isset($this->SMSDefault)) $o['SMSDefault'] = $this->SMSDefault;
        if (isset($this->SMSTemplateId)) $o['SMSTemplateId'] = $this->SMSTemplateId;
        if (isset($this->SMSTemplateBody)) $o['SMSTemplateBody'] = $this->SMSTemplateBody;
        if (isset($this->UpdateNotification)) $o['UpdateNotification'] = $this->UpdateNotification;
        if (isset($this->UpdateNotificationDefault)) $o['UpdateNotificationDefault'] = $this->UpdateNotificationDefault;
        if (isset($this->UpdateTemplateId)) $o['UpdateTemplateId'] = $this->UpdateTemplateId;
        if (isset($this->UpdateTemplateBody)) $o['UpdateTemplateBody'] = $this->UpdateTemplateBody;
        if (isset($this->UpdateSubject)) $o['UpdateSubject'] = $this->UpdateSubject;
        if (isset($this->Push)) $o['Push'] = $this->Push;
        if (isset($this->PushDefault)) $o['PushDefault'] = $this->PushDefault;
        if (isset($this->Phone)) $o['Phone'] = $this->Phone;
        if (isset($this->PhoneDefault)) $o['PhoneDefault'] = $this->PhoneDefault;
        if (isset($this->ContactIdOwner)) $o['ContactIdOwner'] = $this->ContactIdOwner;
        if (isset($this->RecordStatus)) $o['RecordStatus'] = $this->RecordStatus;
        if (isset($this->EmailTemplateDefinitionId)) $o['EmailTemplateDefinitionId'] = $this->EmailTemplateDefinitionId;
        if (isset($this->SMSTemplateDefinitionId)) $o['SMSTemplateDefinitionId'] = $this->SMSTemplateDefinitionId;
        if (isset($this->UpdateTemplateDefinitionId)) $o['UpdateTemplateDefinitionId'] = $this->UpdateTemplateDefinitionId;
        if (isset($this->Index)) $o['Index'] = $this->Index;
        return empty($o) ? new class(){} : $o;
    }
}

/** @description Updates an existing notification */
// @Api(Description="Updates an existing notification")
class UpdateNotification implements JsonSerializable
{
    public function __construct(
        /** @var Notification|null */
        public ?Notification $Notification=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Notification'])) $this->Notification = JsonConverters::from('Notification', $o['Notification']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Notification)) $o['Notification'] = JsonConverters::to('Notification', $this->Notification);
        return empty($o) ? new class(){} : $o;
    }
}

PHP UpdateNotification DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other

HTTP + OTHER

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /api/notification/update HTTP/1.1 
Host: pfapi.pstpf.com.au 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"Notification":{"NotificationId":"00000000-0000-0000-0000-000000000000","NotificationGroupId":"00000000-0000-0000-0000-000000000000","NotificationGroupName":"String","SuiteId":"00000000-0000-0000-0000-000000000000","SuiteName":"String","NotificationValueId":"00000000-0000-0000-0000-000000000000","Roles":[{"RoleId":"00000000-0000-0000-0000-000000000000","RoleName":"String"}],"RolesToDisplay":"String","Name":"String","Description":"String","IsMandatory":false,"IsCardinality":false,"IsSystem":false,"IsAudit":false,"IsVisibleToRecipients":false,"IsSingleUse":false,"Email":false,"EmailDefault":false,"EmailTemplateId":"00000000-0000-0000-0000-000000000000","EmailTemplateBody":"String","EmailSubject":"String","SMS":false,"SMSDefault":false,"SMSTemplateId":"00000000-0000-0000-0000-000000000000","SMSTemplateBody":"String","UpdateNotification":false,"UpdateNotificationDefault":false,"UpdateTemplateId":"00000000-0000-0000-0000-000000000000","UpdateTemplateBody":"String","UpdateSubject":"String","Push":false,"PushDefault":false,"Phone":false,"PhoneDefault":false,"ContactIdOwner":"00000000-0000-0000-0000-000000000000","RecordStatus":"String","EmailTemplateDefinitionId":"00000000-0000-0000-0000-000000000000","SMSTemplateDefinitionId":"00000000-0000-0000-0000-000000000000","UpdateTemplateDefinitionId":"00000000-0000-0000-0000-000000000000","Index":0}}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}