Trendsic Platform Service

<back to all web services

BusinessCardAdminRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/BusinessCardAdmin
<?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 Address implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ID=0,
        /** @var int */
        public int $AddressTypeID=0,
        /** @var string|null */
        public ?string $AddressContact=null,
        /** @var string|null */
        public ?string $AttentionTo=null,
        /** @var string|null */
        public ?string $AddressLine1=null,
        /** @var string|null */
        public ?string $AddressLine2=null,
        /** @var string|null */
        public ?string $AddressLine3=null,
        /** @var string|null */
        public ?string $AddressCity=null,
        /** @var string|null */
        public ?string $AddressState=null,
        /** @var string|null */
        public ?string $AddressZip=null,
        /** @var string|null */
        public ?string $AddressCountry=null,
        /** @var string|null */
        public ?string $PhoneNumber=null,
        /** @var string|null */
        public ?string $FaxNumber=null,
        /** @var string */
        public string $UID='',
        /** @var string|null */
        public ?string $Name=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ID'])) $this->ID = $o['ID'];
        if (isset($o['AddressTypeID'])) $this->AddressTypeID = $o['AddressTypeID'];
        if (isset($o['AddressContact'])) $this->AddressContact = $o['AddressContact'];
        if (isset($o['AttentionTo'])) $this->AttentionTo = $o['AttentionTo'];
        if (isset($o['AddressLine1'])) $this->AddressLine1 = $o['AddressLine1'];
        if (isset($o['AddressLine2'])) $this->AddressLine2 = $o['AddressLine2'];
        if (isset($o['AddressLine3'])) $this->AddressLine3 = $o['AddressLine3'];
        if (isset($o['AddressCity'])) $this->AddressCity = $o['AddressCity'];
        if (isset($o['AddressState'])) $this->AddressState = $o['AddressState'];
        if (isset($o['AddressZip'])) $this->AddressZip = $o['AddressZip'];
        if (isset($o['AddressCountry'])) $this->AddressCountry = $o['AddressCountry'];
        if (isset($o['PhoneNumber'])) $this->PhoneNumber = $o['PhoneNumber'];
        if (isset($o['FaxNumber'])) $this->FaxNumber = $o['FaxNumber'];
        if (isset($o['UID'])) $this->UID = $o['UID'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ID)) $o['ID'] = $this->ID;
        if (isset($this->AddressTypeID)) $o['AddressTypeID'] = $this->AddressTypeID;
        if (isset($this->AddressContact)) $o['AddressContact'] = $this->AddressContact;
        if (isset($this->AttentionTo)) $o['AttentionTo'] = $this->AttentionTo;
        if (isset($this->AddressLine1)) $o['AddressLine1'] = $this->AddressLine1;
        if (isset($this->AddressLine2)) $o['AddressLine2'] = $this->AddressLine2;
        if (isset($this->AddressLine3)) $o['AddressLine3'] = $this->AddressLine3;
        if (isset($this->AddressCity)) $o['AddressCity'] = $this->AddressCity;
        if (isset($this->AddressState)) $o['AddressState'] = $this->AddressState;
        if (isset($this->AddressZip)) $o['AddressZip'] = $this->AddressZip;
        if (isset($this->AddressCountry)) $o['AddressCountry'] = $this->AddressCountry;
        if (isset($this->PhoneNumber)) $o['PhoneNumber'] = $this->PhoneNumber;
        if (isset($this->FaxNumber)) $o['FaxNumber'] = $this->FaxNumber;
        if (isset($this->UID)) $o['UID'] = $this->UID;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        return empty($o) ? new class(){} : $o;
    }
}

class BusinessCard implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $CardId=0,
        /** @var int */
        public int $AgentId=0,
        /** @var int */
        public int $NumRows=0,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Title=null,
        /** @var string|null */
        public ?string $Phone=null,
        /** @var string|null */
        public ?string $Fax=null,
        /** @var string|null */
        public ?string $Cell=null,
        /** @var string|null */
        public ?string $Email=null,
        /** @var string|null */
        public ?string $Address=null,
        /** @var string|null */
        public ?string $License=null,
        /** @var DateTime|null */
        public ?DateTime $SubmittedDate=null,
        /** @var DateTime|null */
        public ?DateTime $OrderedDate=null,
        /** @var DateTime|null */
        public ?DateTime $ProofApprovedDate=null,
        /** @var string|null */
        public ?string $AdminApproved=null,
        /** @var DateTime|null */
        public ?DateTime $AdminApprovedDate=null,
        /** @var int */
        public int $Quantity=0,
        /** @var string|null */
        public ?string $Notes=null,
        /** @var int */
        public int $ShippingAddressId=0,
        /** @var int */
        public int $BusinessCardFrontTypeId=0,
        /** @var int */
        public int $BusinessCardBackTypeId=0,
        /** @var string|null */
        public ?string $ArtURL=null,
        /** @var string|null */
        public ?string $OrderedURL=null,
        /** @var Address|null */
        public ?Address $OrderedAddress=null,
        /** @var string|null */
        public ?string $OrderedUser=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['CardId'])) $this->CardId = $o['CardId'];
        if (isset($o['AgentId'])) $this->AgentId = $o['AgentId'];
        if (isset($o['NumRows'])) $this->NumRows = $o['NumRows'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Title'])) $this->Title = $o['Title'];
        if (isset($o['Phone'])) $this->Phone = $o['Phone'];
        if (isset($o['Fax'])) $this->Fax = $o['Fax'];
        if (isset($o['Cell'])) $this->Cell = $o['Cell'];
        if (isset($o['Email'])) $this->Email = $o['Email'];
        if (isset($o['Address'])) $this->Address = $o['Address'];
        if (isset($o['License'])) $this->License = $o['License'];
        if (isset($o['SubmittedDate'])) $this->SubmittedDate = JsonConverters::from('DateTime', $o['SubmittedDate']);
        if (isset($o['OrderedDate'])) $this->OrderedDate = JsonConverters::from('DateTime', $o['OrderedDate']);
        if (isset($o['ProofApprovedDate'])) $this->ProofApprovedDate = JsonConverters::from('DateTime', $o['ProofApprovedDate']);
        if (isset($o['AdminApproved'])) $this->AdminApproved = $o['AdminApproved'];
        if (isset($o['AdminApprovedDate'])) $this->AdminApprovedDate = JsonConverters::from('DateTime', $o['AdminApprovedDate']);
        if (isset($o['Quantity'])) $this->Quantity = $o['Quantity'];
        if (isset($o['Notes'])) $this->Notes = $o['Notes'];
        if (isset($o['ShippingAddressId'])) $this->ShippingAddressId = $o['ShippingAddressId'];
        if (isset($o['BusinessCardFrontTypeId'])) $this->BusinessCardFrontTypeId = $o['BusinessCardFrontTypeId'];
        if (isset($o['BusinessCardBackTypeId'])) $this->BusinessCardBackTypeId = $o['BusinessCardBackTypeId'];
        if (isset($o['ArtURL'])) $this->ArtURL = $o['ArtURL'];
        if (isset($o['OrderedURL'])) $this->OrderedURL = $o['OrderedURL'];
        if (isset($o['OrderedAddress'])) $this->OrderedAddress = JsonConverters::from('Address', $o['OrderedAddress']);
        if (isset($o['OrderedUser'])) $this->OrderedUser = $o['OrderedUser'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->CardId)) $o['CardId'] = $this->CardId;
        if (isset($this->AgentId)) $o['AgentId'] = $this->AgentId;
        if (isset($this->NumRows)) $o['NumRows'] = $this->NumRows;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Title)) $o['Title'] = $this->Title;
        if (isset($this->Phone)) $o['Phone'] = $this->Phone;
        if (isset($this->Fax)) $o['Fax'] = $this->Fax;
        if (isset($this->Cell)) $o['Cell'] = $this->Cell;
        if (isset($this->Email)) $o['Email'] = $this->Email;
        if (isset($this->Address)) $o['Address'] = $this->Address;
        if (isset($this->License)) $o['License'] = $this->License;
        if (isset($this->SubmittedDate)) $o['SubmittedDate'] = JsonConverters::to('DateTime', $this->SubmittedDate);
        if (isset($this->OrderedDate)) $o['OrderedDate'] = JsonConverters::to('DateTime', $this->OrderedDate);
        if (isset($this->ProofApprovedDate)) $o['ProofApprovedDate'] = JsonConverters::to('DateTime', $this->ProofApprovedDate);
        if (isset($this->AdminApproved)) $o['AdminApproved'] = $this->AdminApproved;
        if (isset($this->AdminApprovedDate)) $o['AdminApprovedDate'] = JsonConverters::to('DateTime', $this->AdminApprovedDate);
        if (isset($this->Quantity)) $o['Quantity'] = $this->Quantity;
        if (isset($this->Notes)) $o['Notes'] = $this->Notes;
        if (isset($this->ShippingAddressId)) $o['ShippingAddressId'] = $this->ShippingAddressId;
        if (isset($this->BusinessCardFrontTypeId)) $o['BusinessCardFrontTypeId'] = $this->BusinessCardFrontTypeId;
        if (isset($this->BusinessCardBackTypeId)) $o['BusinessCardBackTypeId'] = $this->BusinessCardBackTypeId;
        if (isset($this->ArtURL)) $o['ArtURL'] = $this->ArtURL;
        if (isset($this->OrderedURL)) $o['OrderedURL'] = $this->OrderedURL;
        if (isset($this->OrderedAddress)) $o['OrderedAddress'] = JsonConverters::to('Address', $this->OrderedAddress);
        if (isset($this->OrderedUser)) $o['OrderedUser'] = $this->OrderedUser;
        return empty($o) ? new class(){} : $o;
    }
}

class BusinessCardResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var array<BusinessCard>|null */
        public ?array $BusinessCard=null
    ) {
    }

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

class BusinessCardAdminRequest implements JsonSerializable
{
    public function __construct(
        /** @var array<BusinessCard>|null */
        public ?array $BusinessCard=null
    ) {
    }

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

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

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

{
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	},
	BusinessCard: 
	[
		{
			CardId: 0,
			AgentId: 0,
			NumRows: 0,
			Name: String,
			Title: String,
			Phone: String,
			Fax: String,
			Cell: String,
			Email: String,
			Address: String,
			License: String,
			SubmittedDate: 0001-01-01,
			OrderedDate: 0001-01-01,
			ProofApprovedDate: 0001-01-01,
			AdminApproved: String,
			AdminApprovedDate: 0001-01-01,
			Quantity: 0,
			Notes: String,
			ShippingAddressId: 0,
			BusinessCardFrontTypeId: 0,
			BusinessCardBackTypeId: 0,
			ArtURL: String,
			OrderedURL: String,
			OrderedAddress: 
			{
				ID: 0,
				AddressTypeID: 0,
				AddressContact: String,
				AttentionTo: String,
				AddressLine1: String,
				AddressLine2: String,
				AddressLine3: String,
				AddressCity: String,
				AddressState: String,
				AddressZip: String,
				AddressCountry: String,
				PhoneNumber: String,
				FaxNumber: String,
				UID: 00000000000000000000000000000000,
				Name: String
			},
			OrderedUser: String
		}
	]
}