Trendsic Platform Service

<back to all web services

RoutePlanCrewsRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/routeplan/crews
<?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 RoutePlanCrew implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $CrewID=0,
        /** @var string|null */
        public ?string $CrewName=null,
        /** @var string|null */
        public ?string $CrewColor=null,
        /** @var string|null */
        public ?string $HomeZip=null,
        /** @var float|null */
        public ?float $YardLat=null,
        /** @var float|null */
        public ?float $YardLng=null,
        /** @var int */
        public int $DailyCapacityMin=0,
        /** @var int */
        public int $WeeklyCapacityMin=0,
        /** @var bool|null */
        public ?bool $Specialist=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['CrewID'])) $this->CrewID = $o['CrewID'];
        if (isset($o['CrewName'])) $this->CrewName = $o['CrewName'];
        if (isset($o['CrewColor'])) $this->CrewColor = $o['CrewColor'];
        if (isset($o['HomeZip'])) $this->HomeZip = $o['HomeZip'];
        if (isset($o['YardLat'])) $this->YardLat = $o['YardLat'];
        if (isset($o['YardLng'])) $this->YardLng = $o['YardLng'];
        if (isset($o['DailyCapacityMin'])) $this->DailyCapacityMin = $o['DailyCapacityMin'];
        if (isset($o['WeeklyCapacityMin'])) $this->WeeklyCapacityMin = $o['WeeklyCapacityMin'];
        if (isset($o['Specialist'])) $this->Specialist = $o['Specialist'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->CrewID)) $o['CrewID'] = $this->CrewID;
        if (isset($this->CrewName)) $o['CrewName'] = $this->CrewName;
        if (isset($this->CrewColor)) $o['CrewColor'] = $this->CrewColor;
        if (isset($this->HomeZip)) $o['HomeZip'] = $this->HomeZip;
        if (isset($this->YardLat)) $o['YardLat'] = $this->YardLat;
        if (isset($this->YardLng)) $o['YardLng'] = $this->YardLng;
        if (isset($this->DailyCapacityMin)) $o['DailyCapacityMin'] = $this->DailyCapacityMin;
        if (isset($this->WeeklyCapacityMin)) $o['WeeklyCapacityMin'] = $this->WeeklyCapacityMin;
        if (isset($this->Specialist)) $o['Specialist'] = $this->Specialist;
        return empty($o) ? new class(){} : $o;
    }
}

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

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

class RoutePlanCrewsRequest implements JsonSerializable
{
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        return empty($o) ? new class(){} : $o;
    }
}

PHP RoutePlanCrewsRequest 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/routeplan/crews HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Crews: 
	[
		{
			CrewID: 0,
			CrewName: String,
			CrewColor: String,
			HomeZip: String,
			YardLat: 0,
			YardLng: 0,
			DailyCapacityMin: 0,
			WeeklyCapacityMin: 0,
			Specialist: False
		}
	],
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}