Trendsic Platform Service

<back to all web services

AdditionalServiceDetailRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/additionalservice/{Id}
<?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 AdditionalServiceRequestPhoto implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $AdditionalServiceRequestPhotoID=0,
        /** @var string|null */
        public ?string $Url=null,
        /** @var string|null */
        public ?string $MimeType=null,
        /** @var DateTime|null */
        public ?DateTime $CreatedAt=null
    ) {
    }

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

class AdditionalServiceRequest implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $AdditionalServiceRequestID=0,
        /** @var string */
        public string $AdditionalServiceRequestUID='',
        /** @var string */
        public string $TenantId='',
        /** @var string|null */
        public ?string $BranchId=null,
        /** @var string|null */
        public ?string $BranchName=null,
        /** @var int */
        public int $ProjectID=0,
        /** @var string|null */
        public ?string $ProjectName=null,
        /** @var string|null */
        public ?string $ProjectUID=null,
        /** @var int|null */
        public ?int $JobID=null,
        /** @var int|null */
        public ?int $AgreementJobID=null,
        /** @var int|null */
        public ?int $RequestedByContactID=null,
        /** @var string|null */
        public ?string $RequestedByName=null,
        /** @var int|null */
        public ?int $CustomerContactID=null,
        /** @var string|null */
        public ?string $CustomerName=null,
        /** @var string|null */
        public ?string $CustomerEmail=null,
        /** @var string|null */
        public ?string $CustomerPhone=null,
        /** @var bool|null */
        public ?bool $CustomerSmsOptIn=null,
        /** @var string|null */
        public ?string $Description=null,
        /** @var string|null */
        public ?string $Status=null,
        /** @var int|null */
        public ?int $QuoteID=null,
        /** @var string|null */
        public ?string $QuoteUID=null,
        /** @var string|null */
        public ?string $QuoteStatus=null,
        /** @var float|null */
        public ?float $QuoteTotal=null,
        /** @var bool|null */
        public ?bool $FinalPriceAfterCompletion=null,
        /** @var string|null */
        public ?string $QuoteApprovedByName=null,
        /** @var DateTime|null */
        public ?DateTime $QuoteApprovedAt=null,
        /** @var int|null */
        public ?int $ConvertedJobID=null,
        /** @var int */
        public int $PhotoCount=0,
        /** @var string|null */
        public ?string $CreatedBy=null,
        /** @var DateTime|null */
        public ?DateTime $CreatedAt=null,
        /** @var string|null */
        public ?string $UpdatedBy=null,
        /** @var DateTime|null */
        public ?DateTime $UpdatedAt=null,
        /** @var array<AdditionalServiceRequestPhoto>|null */
        public ?array $Photos=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['AdditionalServiceRequestID'])) $this->AdditionalServiceRequestID = $o['AdditionalServiceRequestID'];
        if (isset($o['AdditionalServiceRequestUID'])) $this->AdditionalServiceRequestUID = $o['AdditionalServiceRequestUID'];
        if (isset($o['TenantId'])) $this->TenantId = $o['TenantId'];
        if (isset($o['BranchId'])) $this->BranchId = $o['BranchId'];
        if (isset($o['BranchName'])) $this->BranchName = $o['BranchName'];
        if (isset($o['ProjectID'])) $this->ProjectID = $o['ProjectID'];
        if (isset($o['ProjectName'])) $this->ProjectName = $o['ProjectName'];
        if (isset($o['ProjectUID'])) $this->ProjectUID = $o['ProjectUID'];
        if (isset($o['JobID'])) $this->JobID = $o['JobID'];
        if (isset($o['AgreementJobID'])) $this->AgreementJobID = $o['AgreementJobID'];
        if (isset($o['RequestedByContactID'])) $this->RequestedByContactID = $o['RequestedByContactID'];
        if (isset($o['RequestedByName'])) $this->RequestedByName = $o['RequestedByName'];
        if (isset($o['CustomerContactID'])) $this->CustomerContactID = $o['CustomerContactID'];
        if (isset($o['CustomerName'])) $this->CustomerName = $o['CustomerName'];
        if (isset($o['CustomerEmail'])) $this->CustomerEmail = $o['CustomerEmail'];
        if (isset($o['CustomerPhone'])) $this->CustomerPhone = $o['CustomerPhone'];
        if (isset($o['CustomerSmsOptIn'])) $this->CustomerSmsOptIn = $o['CustomerSmsOptIn'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['Status'])) $this->Status = $o['Status'];
        if (isset($o['QuoteID'])) $this->QuoteID = $o['QuoteID'];
        if (isset($o['QuoteUID'])) $this->QuoteUID = $o['QuoteUID'];
        if (isset($o['QuoteStatus'])) $this->QuoteStatus = $o['QuoteStatus'];
        if (isset($o['QuoteTotal'])) $this->QuoteTotal = $o['QuoteTotal'];
        if (isset($o['FinalPriceAfterCompletion'])) $this->FinalPriceAfterCompletion = $o['FinalPriceAfterCompletion'];
        if (isset($o['QuoteApprovedByName'])) $this->QuoteApprovedByName = $o['QuoteApprovedByName'];
        if (isset($o['QuoteApprovedAt'])) $this->QuoteApprovedAt = JsonConverters::from('DateTime', $o['QuoteApprovedAt']);
        if (isset($o['ConvertedJobID'])) $this->ConvertedJobID = $o['ConvertedJobID'];
        if (isset($o['PhotoCount'])) $this->PhotoCount = $o['PhotoCount'];
        if (isset($o['CreatedBy'])) $this->CreatedBy = $o['CreatedBy'];
        if (isset($o['CreatedAt'])) $this->CreatedAt = JsonConverters::from('DateTime', $o['CreatedAt']);
        if (isset($o['UpdatedBy'])) $this->UpdatedBy = $o['UpdatedBy'];
        if (isset($o['UpdatedAt'])) $this->UpdatedAt = JsonConverters::from('DateTime', $o['UpdatedAt']);
        if (isset($o['Photos'])) $this->Photos = JsonConverters::fromArray('AdditionalServiceRequestPhoto', $o['Photos']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->AdditionalServiceRequestID)) $o['AdditionalServiceRequestID'] = $this->AdditionalServiceRequestID;
        if (isset($this->AdditionalServiceRequestUID)) $o['AdditionalServiceRequestUID'] = $this->AdditionalServiceRequestUID;
        if (isset($this->TenantId)) $o['TenantId'] = $this->TenantId;
        if (isset($this->BranchId)) $o['BranchId'] = $this->BranchId;
        if (isset($this->BranchName)) $o['BranchName'] = $this->BranchName;
        if (isset($this->ProjectID)) $o['ProjectID'] = $this->ProjectID;
        if (isset($this->ProjectName)) $o['ProjectName'] = $this->ProjectName;
        if (isset($this->ProjectUID)) $o['ProjectUID'] = $this->ProjectUID;
        if (isset($this->JobID)) $o['JobID'] = $this->JobID;
        if (isset($this->AgreementJobID)) $o['AgreementJobID'] = $this->AgreementJobID;
        if (isset($this->RequestedByContactID)) $o['RequestedByContactID'] = $this->RequestedByContactID;
        if (isset($this->RequestedByName)) $o['RequestedByName'] = $this->RequestedByName;
        if (isset($this->CustomerContactID)) $o['CustomerContactID'] = $this->CustomerContactID;
        if (isset($this->CustomerName)) $o['CustomerName'] = $this->CustomerName;
        if (isset($this->CustomerEmail)) $o['CustomerEmail'] = $this->CustomerEmail;
        if (isset($this->CustomerPhone)) $o['CustomerPhone'] = $this->CustomerPhone;
        if (isset($this->CustomerSmsOptIn)) $o['CustomerSmsOptIn'] = $this->CustomerSmsOptIn;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->Status)) $o['Status'] = $this->Status;
        if (isset($this->QuoteID)) $o['QuoteID'] = $this->QuoteID;
        if (isset($this->QuoteUID)) $o['QuoteUID'] = $this->QuoteUID;
        if (isset($this->QuoteStatus)) $o['QuoteStatus'] = $this->QuoteStatus;
        if (isset($this->QuoteTotal)) $o['QuoteTotal'] = $this->QuoteTotal;
        if (isset($this->FinalPriceAfterCompletion)) $o['FinalPriceAfterCompletion'] = $this->FinalPriceAfterCompletion;
        if (isset($this->QuoteApprovedByName)) $o['QuoteApprovedByName'] = $this->QuoteApprovedByName;
        if (isset($this->QuoteApprovedAt)) $o['QuoteApprovedAt'] = JsonConverters::to('DateTime', $this->QuoteApprovedAt);
        if (isset($this->ConvertedJobID)) $o['ConvertedJobID'] = $this->ConvertedJobID;
        if (isset($this->PhotoCount)) $o['PhotoCount'] = $this->PhotoCount;
        if (isset($this->CreatedBy)) $o['CreatedBy'] = $this->CreatedBy;
        if (isset($this->CreatedAt)) $o['CreatedAt'] = JsonConverters::to('DateTime', $this->CreatedAt);
        if (isset($this->UpdatedBy)) $o['UpdatedBy'] = $this->UpdatedBy;
        if (isset($this->UpdatedAt)) $o['UpdatedAt'] = JsonConverters::to('DateTime', $this->UpdatedAt);
        if (isset($this->Photos)) $o['Photos'] = JsonConverters::toArray('AdditionalServiceRequestPhoto', $this->Photos);
        return empty($o) ? new class(){} : $o;
    }
}

class AdditionalServiceDetailResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var AdditionalServiceRequest|null */
        public ?AdditionalServiceRequest $Request=null
    ) {
    }

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

class AdditionalServiceDetailRequest implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Id=0
    ) {
    }

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

PHP AdditionalServiceDetailRequest 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/additionalservice/{Id} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"Request":{"AdditionalServiceRequestID":0,"AdditionalServiceRequestUID":"00000000000000000000000000000000","TenantId":"00000000000000000000000000000000","BranchId":"00000000000000000000000000000000","BranchName":"String","ProjectID":0,"ProjectName":"String","ProjectUID":"00000000000000000000000000000000","JobID":0,"AgreementJobID":0,"RequestedByContactID":0,"RequestedByName":"String","CustomerContactID":0,"CustomerName":"String","CustomerEmail":"String","CustomerPhone":"String","CustomerSmsOptIn":false,"Description":"String","Status":"String","QuoteID":0,"QuoteUID":"00000000000000000000000000000000","QuoteStatus":"String","QuoteTotal":0,"FinalPriceAfterCompletion":false,"QuoteApprovedByName":"String","QuoteApprovedAt":"0001-01-01T00:00:00.0000000","ConvertedJobID":0,"PhotoCount":0,"CreatedBy":"String","CreatedAt":"0001-01-01T00:00:00.0000000","UpdatedBy":"String","UpdatedAt":"0001-01-01T00:00:00.0000000","Photos":[{"AdditionalServiceRequestPhotoID":0,"Url":"String","MimeType":"String","CreatedAt":"0001-01-01T00:00:00.0000000"}]}}