Trendsic Platform Service

<back to all web services

FormSubmissionDecidePreviewRequest

Requires Authentication
The following routes are available for this service:
POST/v1/forms/submissions/{SubmissionUID}/decide/preview
<?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 FormDecisionChoice implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Id=null,
        /** @var string|null */
        public ?string $Label=null
    ) {
    }

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

class FormDecisionEffect implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Kind=null,
        /** @var string|null */
        public ?string $Text=null,
        /** @var string|null */
        public ?string $Tone=null
    ) {
    }

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

class FormDecisionPlan implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Who=null,
        /** @var string|null */
        public ?string $Stage=null,
        /** @var array<FormDecisionChoice>|null */
        public ?array $Choices=null,
        /** @var string|null */
        public ?string $Outcome=null,
        /** @var array<string>|null */
        public ?array $Reasons=null,
        /** @var string|null */
        public ?string $Reason=null,
        /** @var bool|null */
        public ?bool $NeedSig=null,
        /** @var string|null */
        public ?string $SignerName=null,
        /** @var string|null */
        public ?string $SignerRefusal=null,
        /** @var array<FormDecisionEffect>|null */
        public ?array $Effects=null,
        /** @var string|null */
        public ?string $Block=null,
        /** @var string|null */
        public ?string $GoLabel=null,
        /** @var string|null */
        public ?string $GoCls=null,
        /** @var bool|null */
        public ?bool $CanDecide=null,
        /** @var string|null */
        public ?string $Refusal=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Who'])) $this->Who = $o['Who'];
        if (isset($o['Stage'])) $this->Stage = $o['Stage'];
        if (isset($o['Choices'])) $this->Choices = JsonConverters::fromArray('FormDecisionChoice', $o['Choices']);
        if (isset($o['Outcome'])) $this->Outcome = $o['Outcome'];
        if (isset($o['Reasons'])) $this->Reasons = JsonConverters::fromArray('string', $o['Reasons']);
        if (isset($o['Reason'])) $this->Reason = $o['Reason'];
        if (isset($o['NeedSig'])) $this->NeedSig = $o['NeedSig'];
        if (isset($o['SignerName'])) $this->SignerName = $o['SignerName'];
        if (isset($o['SignerRefusal'])) $this->SignerRefusal = $o['SignerRefusal'];
        if (isset($o['Effects'])) $this->Effects = JsonConverters::fromArray('FormDecisionEffect', $o['Effects']);
        if (isset($o['Block'])) $this->Block = $o['Block'];
        if (isset($o['GoLabel'])) $this->GoLabel = $o['GoLabel'];
        if (isset($o['GoCls'])) $this->GoCls = $o['GoCls'];
        if (isset($o['CanDecide'])) $this->CanDecide = $o['CanDecide'];
        if (isset($o['Refusal'])) $this->Refusal = $o['Refusal'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Who)) $o['Who'] = $this->Who;
        if (isset($this->Stage)) $o['Stage'] = $this->Stage;
        if (isset($this->Choices)) $o['Choices'] = JsonConverters::toArray('FormDecisionChoice', $this->Choices);
        if (isset($this->Outcome)) $o['Outcome'] = $this->Outcome;
        if (isset($this->Reasons)) $o['Reasons'] = JsonConverters::toArray('string', $this->Reasons);
        if (isset($this->Reason)) $o['Reason'] = $this->Reason;
        if (isset($this->NeedSig)) $o['NeedSig'] = $this->NeedSig;
        if (isset($this->SignerName)) $o['SignerName'] = $this->SignerName;
        if (isset($this->SignerRefusal)) $o['SignerRefusal'] = $this->SignerRefusal;
        if (isset($this->Effects)) $o['Effects'] = JsonConverters::toArray('FormDecisionEffect', $this->Effects);
        if (isset($this->Block)) $o['Block'] = $this->Block;
        if (isset($this->GoLabel)) $o['GoLabel'] = $this->GoLabel;
        if (isset($this->GoCls)) $o['GoCls'] = $this->GoCls;
        if (isset($this->CanDecide)) $o['CanDecide'] = $this->CanDecide;
        if (isset($this->Refusal)) $o['Refusal'] = $this->Refusal;
        return empty($o) ? new class(){} : $o;
    }
}

class FormSubmissionDecidePreviewResponse implements JsonSerializable
{
    public function __construct(
        /** @var FormDecisionPlan|null */
        public ?FormDecisionPlan $Plan=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

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

class FormSubmissionDecidePreviewRequest implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $SubmissionUID='',
        /** @var string|null */
        public ?string $Outcome=null,
        /** @var string|null */
        public ?string $Reason=null,
        /** @var string|null */
        public ?string $Note=null
    ) {
    }

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

PHP FormSubmissionDecidePreviewRequest DTOs

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

HTTP + XML

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

POST /v1/forms/submissions/{SubmissionUID}/decide/preview HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<FormSubmissionDecidePreviewRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Note>String</Note>
  <Outcome>String</Outcome>
  <Reason>String</Reason>
  <SubmissionUID>00000000-0000-0000-0000-000000000000</SubmissionUID>
</FormSubmissionDecidePreviewRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<FormSubmissionDecidePreviewResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Plan>
    <Block>String</Block>
    <CanDecide>false</CanDecide>
    <Choices>
      <FormDecisionChoice>
        <Id>String</Id>
        <Label>String</Label>
      </FormDecisionChoice>
    </Choices>
    <Effects>
      <FormDecisionEffect>
        <Kind>String</Kind>
        <Text>String</Text>
        <Tone>String</Tone>
      </FormDecisionEffect>
    </Effects>
    <GoCls>String</GoCls>
    <GoLabel>String</GoLabel>
    <NeedSig>false</NeedSig>
    <Outcome>String</Outcome>
    <Reason>String</Reason>
    <Reasons xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>String</d3p1:string>
    </Reasons>
    <Refusal>String</Refusal>
    <SignerName>String</SignerName>
    <SignerRefusal>String</SignerRefusal>
    <Stage>String</Stage>
    <Who>String</Who>
  </Plan>
  <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>
</FormSubmissionDecidePreviewResponse>