digitaluapi

<back to all web services

SetCampaignActionForm

Requires Authentication
Requires any of the roles:Client, Admin, Partner
The following routes are available for this service:
PUT/campaign/actionformSet Campaign Action Form
<?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 SetCampaignActionFormResponse implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $Status=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

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

class FormFieldOption implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Value=null,
        /** @var string|null */
        public ?string $Label=null
    ) {
    }

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

class FormField implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Id=0,
        /** @var string|null */
        public ?string $ControlType=null,
        /** @var string|null */
        public ?string $Label=null,
        /** @var string|null */
        public ?string $Placeholder=null,
        /** @var string|null */
        public ?string $Help=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var int */
        public int $SortOrder=0,
        /** @var array<FormFieldOption>|null */
        public ?array $Options=null,
        /** @var array<string>|null */
        public ?array $Validation=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['ControlType'])) $this->ControlType = $o['ControlType'];
        if (isset($o['Label'])) $this->Label = $o['Label'];
        if (isset($o['Placeholder'])) $this->Placeholder = $o['Placeholder'];
        if (isset($o['Help'])) $this->Help = $o['Help'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['SortOrder'])) $this->SortOrder = $o['SortOrder'];
        if (isset($o['Options'])) $this->Options = JsonConverters::fromArray('FormFieldOption', $o['Options']);
        if (isset($o['Validation'])) $this->Validation = JsonConverters::fromArray('string', $o['Validation']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->ControlType)) $o['ControlType'] = $this->ControlType;
        if (isset($this->Label)) $o['Label'] = $this->Label;
        if (isset($this->Placeholder)) $o['Placeholder'] = $this->Placeholder;
        if (isset($this->Help)) $o['Help'] = $this->Help;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->SortOrder)) $o['SortOrder'] = $this->SortOrder;
        if (isset($this->Options)) $o['Options'] = JsonConverters::toArray('FormFieldOption', $this->Options);
        if (isset($this->Validation)) $o['Validation'] = JsonConverters::toArray('string', $this->Validation);
        return empty($o) ? new class(){} : $o;
    }
}

class SetCampaignActionForm implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=1)
        // @Validate(Validator="NotNull")
        /** @var int */
        public int $CampaignsId=0,

        /** @var int */
        public int $CampaignActionsId=0,
        /** @var array<FormField>|null */
        public ?array $FormMeta=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['CampaignsId'])) $this->CampaignsId = $o['CampaignsId'];
        if (isset($o['CampaignActionsId'])) $this->CampaignActionsId = $o['CampaignActionsId'];
        if (isset($o['FormMeta'])) $this->FormMeta = JsonConverters::fromArray('FormField', $o['FormMeta']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->CampaignsId)) $o['CampaignsId'] = $this->CampaignsId;
        if (isset($this->CampaignActionsId)) $o['CampaignActionsId'] = $this->CampaignActionsId;
        if (isset($this->FormMeta)) $o['FormMeta'] = JsonConverters::toArray('FormField', $this->FormMeta);
        return empty($o) ? new class(){} : $o;
    }
}

PHP SetCampaignActionForm 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.

PUT /campaign/actionform HTTP/1.1 
Host: duengageapi.uat.scadsoftware.com 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"CampaignsId":0,"CampaignActionsId":0,"FormMeta":[{"Id":0,"ControlType":"String","Label":"String","Placeholder":"String","Help":"String","Name":"String","SortOrder":0,"Options":[{"Value":"String","Label":"String"}],"Validation":["String"]}]}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

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