Trendsic Platform Service

<back to all web services

FormFillWithdrawRequest

The following routes are available for this service:
POST/v1/formfill/status/{Token}/withdraw
<?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 FormFillStage implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Id=null,
        /** @var string|null */
        public ?string $Label=null,
        /** @var string|null */
        public ?string $Tone=null,
        /** @var string|null */
        public ?string $Kind=null
    ) {
    }

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

class FormFillStageSeen implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Id=null,
        /** @var DateTime */
        public DateTime $At=new DateTime()
    ) {
    }

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

class FormFillReceiptLine implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Channel=null,
        /** @var string|null */
        public ?string $To=null,
        /** @var string|null */
        public ?string $Outcome=null
    ) {
    }

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

class FormFillStatusResponse implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Number=null,
        /** @var string|null */
        public ?string $FormName=null,
        /** @var string|null */
        public ?string $Noun=null,
        /** @var string|null */
        public ?string $TenantName=null,
        /** @var string|null */
        public ?string $Stage=null,
        /** @var string|null */
        public ?string $StageKind=null,
        /** @var array<FormFillStage>|null */
        public ?array $Stages=null,
        /** @var array<FormFillStageSeen>|null */
        public ?array $Seen=null,
        /** @var DateTime|null */
        public ?DateTime $SubmittedAt=null,
        /** @var array<FormFillReceiptLine>|null */
        public ?array $Receipt=null,
        /** @var bool|null */
        public ?bool $CanWithdraw=null,
        /** @var string|null */
        public ?string $Lang=null,
        /** @var string|null */
        public ?string $NounEs=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Number'])) $this->Number = $o['Number'];
        if (isset($o['FormName'])) $this->FormName = $o['FormName'];
        if (isset($o['Noun'])) $this->Noun = $o['Noun'];
        if (isset($o['TenantName'])) $this->TenantName = $o['TenantName'];
        if (isset($o['Stage'])) $this->Stage = $o['Stage'];
        if (isset($o['StageKind'])) $this->StageKind = $o['StageKind'];
        if (isset($o['Stages'])) $this->Stages = JsonConverters::fromArray('FormFillStage', $o['Stages']);
        if (isset($o['Seen'])) $this->Seen = JsonConverters::fromArray('FormFillStageSeen', $o['Seen']);
        if (isset($o['SubmittedAt'])) $this->SubmittedAt = JsonConverters::from('DateTime', $o['SubmittedAt']);
        if (isset($o['Receipt'])) $this->Receipt = JsonConverters::fromArray('FormFillReceiptLine', $o['Receipt']);
        if (isset($o['CanWithdraw'])) $this->CanWithdraw = $o['CanWithdraw'];
        if (isset($o['Lang'])) $this->Lang = $o['Lang'];
        if (isset($o['NounEs'])) $this->NounEs = $o['NounEs'];
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Number)) $o['Number'] = $this->Number;
        if (isset($this->FormName)) $o['FormName'] = $this->FormName;
        if (isset($this->Noun)) $o['Noun'] = $this->Noun;
        if (isset($this->TenantName)) $o['TenantName'] = $this->TenantName;
        if (isset($this->Stage)) $o['Stage'] = $this->Stage;
        if (isset($this->StageKind)) $o['StageKind'] = $this->StageKind;
        if (isset($this->Stages)) $o['Stages'] = JsonConverters::toArray('FormFillStage', $this->Stages);
        if (isset($this->Seen)) $o['Seen'] = JsonConverters::toArray('FormFillStageSeen', $this->Seen);
        if (isset($this->SubmittedAt)) $o['SubmittedAt'] = JsonConverters::to('DateTime', $this->SubmittedAt);
        if (isset($this->Receipt)) $o['Receipt'] = JsonConverters::toArray('FormFillReceiptLine', $this->Receipt);
        if (isset($this->CanWithdraw)) $o['CanWithdraw'] = $this->CanWithdraw;
        if (isset($this->Lang)) $o['Lang'] = $this->Lang;
        if (isset($this->NounEs)) $o['NounEs'] = $this->NounEs;
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

class FormFillWithdrawRequest implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Token=null
    ) {
    }

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

PHP FormFillWithdrawRequest DTOs

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

HTTP + JSV

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

POST /v1/formfill/status/{Token}/withdraw HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Token: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Number: String,
	FormName: String,
	Noun: String,
	TenantName: String,
	Stage: String,
	StageKind: String,
	Stages: 
	[
		{
			Id: String,
			Label: String,
			Tone: String,
			Kind: String
		}
	],
	Seen: 
	[
		{
			Id: String,
			At: 0001-01-01
		}
	],
	SubmittedAt: 0001-01-01,
	Receipt: 
	[
		{
			Channel: String,
			To: String,
			Outcome: String
		}
	],
	CanWithdraw: False,
	Lang: String,
	NounEs: String,
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}