Trendsic Platform Service

<back to all web services

FormOfficeOfferedRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/forms/office
<?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 FormOfficeApp implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $FormUID=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Noun=null,
        /** @var string|null */
        public ?string $DefaultBranchId=null
    ) {
    }

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

class FormInboxCount implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $V=null,
        /** @var string|null */
        public ?string $L=null,
        /** @var int */
        public int $N=0
    ) {
    }

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

class FormOfficeDraftRow implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SubmissionUID=null,
        /** @var string|null */
        public ?string $FormUID=null,
        /** @var string|null */
        public ?string $FormName=null,
        /** @var string|null */
        public ?string $ForName=null,
        /** @var string|null */
        public ?string $BranchName=null,
        /** @var int|null */
        public ?int $ContactId=null,
        /** @var int */
        public int $Page=0,
        /** @var int */
        public int $Pages=0,
        /** @var string|null */
        public ?string $SavedBy=null,
        /** @var string|null */
        public ?string $SavedAt=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['SubmissionUID'])) $this->SubmissionUID = $o['SubmissionUID'];
        if (isset($o['FormUID'])) $this->FormUID = $o['FormUID'];
        if (isset($o['FormName'])) $this->FormName = $o['FormName'];
        if (isset($o['ForName'])) $this->ForName = $o['ForName'];
        if (isset($o['BranchName'])) $this->BranchName = $o['BranchName'];
        if (isset($o['ContactId'])) $this->ContactId = $o['ContactId'];
        if (isset($o['Page'])) $this->Page = $o['Page'];
        if (isset($o['Pages'])) $this->Pages = $o['Pages'];
        if (isset($o['SavedBy'])) $this->SavedBy = $o['SavedBy'];
        if (isset($o['SavedAt'])) $this->SavedAt = $o['SavedAt'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->SubmissionUID)) $o['SubmissionUID'] = $this->SubmissionUID;
        if (isset($this->FormUID)) $o['FormUID'] = $this->FormUID;
        if (isset($this->FormName)) $o['FormName'] = $this->FormName;
        if (isset($this->ForName)) $o['ForName'] = $this->ForName;
        if (isset($this->BranchName)) $o['BranchName'] = $this->BranchName;
        if (isset($this->ContactId)) $o['ContactId'] = $this->ContactId;
        if (isset($this->Page)) $o['Page'] = $this->Page;
        if (isset($this->Pages)) $o['Pages'] = $this->Pages;
        if (isset($this->SavedBy)) $o['SavedBy'] = $this->SavedBy;
        if (isset($this->SavedAt)) $o['SavedAt'] = $this->SavedAt;
        return empty($o) ? new class(){} : $o;
    }
}

class FormOfficeOfferedResponse implements JsonSerializable
{
    public function __construct(
        /** @var array<FormOfficeApp>|null */
        public ?array $Apps=null,
        /** @var array<FormInboxCount>|null */
        public ?array $Branches=null,
        /** @var array<FormOfficeDraftRow>|null */
        public ?array $Drafts=null,
        /** @var bool|null */
        public ?bool $CanSearchContacts=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Apps'])) $this->Apps = JsonConverters::fromArray('FormOfficeApp', $o['Apps']);
        if (isset($o['Branches'])) $this->Branches = JsonConverters::fromArray('FormInboxCount', $o['Branches']);
        if (isset($o['Drafts'])) $this->Drafts = JsonConverters::fromArray('FormOfficeDraftRow', $o['Drafts']);
        if (isset($o['CanSearchContacts'])) $this->CanSearchContacts = $o['CanSearchContacts'];
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Apps)) $o['Apps'] = JsonConverters::toArray('FormOfficeApp', $this->Apps);
        if (isset($this->Branches)) $o['Branches'] = JsonConverters::toArray('FormInboxCount', $this->Branches);
        if (isset($this->Drafts)) $o['Drafts'] = JsonConverters::toArray('FormOfficeDraftRow', $this->Drafts);
        if (isset($this->CanSearchContacts)) $o['CanSearchContacts'] = $this->CanSearchContacts;
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

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

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

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

GET /v1/forms/office HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"Apps":[{"FormUID":"String","Name":"String","Noun":"String","DefaultBranchId":"String"}],"Branches":[{"V":"String","L":"String","N":0}],"Drafts":[{"SubmissionUID":"String","FormUID":"String","FormName":"String","ForName":"String","BranchName":"String","ContactId":0,"Page":0,"Pages":0,"SavedBy":"String","SavedAt":"String"}],"CanSearchContacts":false,"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}