| POST,OPTIONS | /v1/CrewAssignments/Export/CSV/{SelectedDate} |
|---|
<?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 CrewAssignmentsExportCsvResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var string|null */
public ?string $file=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['file'])) $this->file = $o['file'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->file)) $o['file'] = $this->file;
return empty($o) ? new class(){} : $o;
}
}
class CrewAssignmentCrewMember implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $Status=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Status'])) $this->Status = $o['Status'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Status)) $o['Status'] = $this->Status;
return empty($o) ? new class(){} : $o;
}
}
class CrewAssignmentEquipment implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $Status=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Status'])) $this->Status = $o['Status'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Status)) $o['Status'] = $this->Status;
return empty($o) ? new class(){} : $o;
}
}
class CrewAssignmentJob implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $JobName=null,
/** @var array<CrewAssignmentCrewMember>|null */
public ?array $CrewMembers=null,
/** @var array<CrewAssignmentEquipment>|null */
public ?array $Equipment=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['JobName'])) $this->JobName = $o['JobName'];
if (isset($o['CrewMembers'])) $this->CrewMembers = JsonConverters::fromArray('CrewAssignmentCrewMember', $o['CrewMembers']);
if (isset($o['Equipment'])) $this->Equipment = JsonConverters::fromArray('CrewAssignmentEquipment', $o['Equipment']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->JobName)) $o['JobName'] = $this->JobName;
if (isset($this->CrewMembers)) $o['CrewMembers'] = JsonConverters::toArray('CrewAssignmentCrewMember', $this->CrewMembers);
if (isset($this->Equipment)) $o['Equipment'] = JsonConverters::toArray('CrewAssignmentEquipment', $this->Equipment);
return empty($o) ? new class(){} : $o;
}
}
class CrewAssignmentProject implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $ProjectName=null,
/** @var array<CrewAssignmentJob>|null */
public ?array $Jobs=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ProjectName'])) $this->ProjectName = $o['ProjectName'];
if (isset($o['Jobs'])) $this->Jobs = JsonConverters::fromArray('CrewAssignmentJob', $o['Jobs']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ProjectName)) $o['ProjectName'] = $this->ProjectName;
if (isset($this->Jobs)) $o['Jobs'] = JsonConverters::toArray('CrewAssignmentJob', $this->Jobs);
return empty($o) ? new class(){} : $o;
}
}
class CrewAssignmentsExportCsvRequest implements JsonSerializable
{
public function __construct(
/** @var DateTime */
public DateTime $SelectedDate=new DateTime(),
/** @var array<CrewAssignmentProject>|null */
public ?array $projects=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['SelectedDate'])) $this->SelectedDate = JsonConverters::from('DateTime', $o['SelectedDate']);
if (isset($o['projects'])) $this->projects = JsonConverters::fromArray('CrewAssignmentProject', $o['projects']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->SelectedDate)) $o['SelectedDate'] = JsonConverters::to('DateTime', $this->SelectedDate);
if (isset($this->projects)) $o['projects'] = JsonConverters::toArray('CrewAssignmentProject', $this->projects);
return empty($o) ? new class(){} : $o;
}
}
PHP CrewAssignmentsExportCsvRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/CrewAssignments/Export/CSV/{SelectedDate} HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<CrewAssignmentsExportCsvRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<SelectedDate>0001-01-01T00:00:00</SelectedDate>
<crewAssignment>
<Projects>
<CrewAssignmentProject>
<Jobs>
<CrewAssignmentJob>
<CrewMembers>
<CrewAssignmentCrewMember>
<Name>String</Name>
<Status>String</Status>
</CrewAssignmentCrewMember>
</CrewMembers>
<Equipment>
<CrewAssignmentEquipment>
<Name>String</Name>
<Status>String</Status>
</CrewAssignmentEquipment>
</Equipment>
<JobName>String</JobName>
</CrewAssignmentJob>
</Jobs>
<ProjectName>String</ProjectName>
</CrewAssignmentProject>
</Projects>
</crewAssignment>
<projects>
<CrewAssignmentProject>
<Jobs>
<CrewAssignmentJob>
<CrewMembers>
<CrewAssignmentCrewMember>
<Name>String</Name>
<Status>String</Status>
</CrewAssignmentCrewMember>
</CrewMembers>
<Equipment>
<CrewAssignmentEquipment>
<Name>String</Name>
<Status>String</Status>
</CrewAssignmentEquipment>
</Equipment>
<JobName>String</JobName>
</CrewAssignmentJob>
</Jobs>
<ProjectName>String</ProjectName>
</CrewAssignmentProject>
</projects>
</CrewAssignmentsExportCsvRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<CrewAssignmentsExportCsvResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:Message>String</d2p1:Message>
<d2p1:StackTrace>String</d2p1:StackTrace>
<d2p1:Errors>
<d2p1:ResponseError>
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:FieldName>String</d2p1:FieldName>
<d2p1:Message>String</d2p1:Message>
<d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:KeyValueOfstringstring>
<d5p1:Key>String</d5p1:Key>
<d5p1:Value>String</d5p1:Value>
</d5p1:KeyValueOfstringstring>
</d2p1:Meta>
</d2p1:ResponseError>
</d2p1:Errors>
<d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:KeyValueOfstringstring>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value>String</d3p1:Value>
</d3p1:KeyValueOfstringstring>
</d2p1:Meta>
</ResponseStatus>
<file>String</file>
</CrewAssignmentsExportCsvResponse>