| GET,POST,PUT,DELETE,OPTIONS | /v1/CrewContact/{CrewContactID} | ||
|---|---|---|---|
| GET,POST,PUT,DELETE,OPTIONS | /v1/CrewContact |
<?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 CrewContact implements JsonSerializable
{
public function __construct(
/** @var int */
public int $CrewContactID=0,
/** @var int */
public int $CrewID=0,
/** @var string|null */
public ?string $CrewName=null,
/** @var int */
public int $ContactID=0,
/** @var string|null */
public ?string $ContactName=null,
/** @var bool|null */
public ?bool $Active=null,
/** @var bool|null */
public ?bool $Deleted=null,
/** @var DateTime */
public DateTime $DeletedDate=new DateTime(),
/** @var DateTime */
public DateTime $RecordCreatedDate=new DateTime(),
/** @var string */
public string $CreatedByUID='',
/** @var string|null */
public ?string $ContactImage=null,
/** @var string|null */
public ?string $FirstName=null,
/** @var string|null */
public ?string $LastName=null,
/** @var string|null */
public ?string $Initials=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['CrewContactID'])) $this->CrewContactID = $o['CrewContactID'];
if (isset($o['CrewID'])) $this->CrewID = $o['CrewID'];
if (isset($o['CrewName'])) $this->CrewName = $o['CrewName'];
if (isset($o['ContactID'])) $this->ContactID = $o['ContactID'];
if (isset($o['ContactName'])) $this->ContactName = $o['ContactName'];
if (isset($o['Active'])) $this->Active = $o['Active'];
if (isset($o['Deleted'])) $this->Deleted = $o['Deleted'];
if (isset($o['DeletedDate'])) $this->DeletedDate = JsonConverters::from('DateTime', $o['DeletedDate']);
if (isset($o['RecordCreatedDate'])) $this->RecordCreatedDate = JsonConverters::from('DateTime', $o['RecordCreatedDate']);
if (isset($o['CreatedByUID'])) $this->CreatedByUID = $o['CreatedByUID'];
if (isset($o['ContactImage'])) $this->ContactImage = $o['ContactImage'];
if (isset($o['FirstName'])) $this->FirstName = $o['FirstName'];
if (isset($o['LastName'])) $this->LastName = $o['LastName'];
if (isset($o['Initials'])) $this->Initials = $o['Initials'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->CrewContactID)) $o['CrewContactID'] = $this->CrewContactID;
if (isset($this->CrewID)) $o['CrewID'] = $this->CrewID;
if (isset($this->CrewName)) $o['CrewName'] = $this->CrewName;
if (isset($this->ContactID)) $o['ContactID'] = $this->ContactID;
if (isset($this->ContactName)) $o['ContactName'] = $this->ContactName;
if (isset($this->Active)) $o['Active'] = $this->Active;
if (isset($this->Deleted)) $o['Deleted'] = $this->Deleted;
if (isset($this->DeletedDate)) $o['DeletedDate'] = JsonConverters::to('DateTime', $this->DeletedDate);
if (isset($this->RecordCreatedDate)) $o['RecordCreatedDate'] = JsonConverters::to('DateTime', $this->RecordCreatedDate);
if (isset($this->CreatedByUID)) $o['CreatedByUID'] = $this->CreatedByUID;
if (isset($this->ContactImage)) $o['ContactImage'] = $this->ContactImage;
if (isset($this->FirstName)) $o['FirstName'] = $this->FirstName;
if (isset($this->LastName)) $o['LastName'] = $this->LastName;
if (isset($this->Initials)) $o['Initials'] = $this->Initials;
return empty($o) ? new class(){} : $o;
}
}
class CrewContactResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var array<CrewContact>|null */
public ?array $CrewContact=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['CrewContact'])) $this->CrewContact = JsonConverters::fromArray('CrewContact', $o['CrewContact']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->CrewContact)) $o['CrewContact'] = JsonConverters::toArray('CrewContact', $this->CrewContact);
return empty($o) ? new class(){} : $o;
}
}
class CrewContactRequest implements JsonSerializable
{
public function __construct(
/** @var int */
public int $CrewContactID=0,
/** @var array<CrewContact>|null */
public ?array $CrewContact=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['CrewContactID'])) $this->CrewContactID = $o['CrewContactID'];
if (isset($o['CrewContact'])) $this->CrewContact = JsonConverters::fromArray('CrewContact', $o['CrewContact']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->CrewContactID)) $o['CrewContactID'] = $this->CrewContactID;
if (isset($this->CrewContact)) $o['CrewContact'] = JsonConverters::toArray('CrewContact', $this->CrewContact);
return empty($o) ? new class(){} : $o;
}
}
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/CrewContact/{CrewContactID} HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<CrewContactRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<CrewContact>
<CrewContact>
<Active>false</Active>
<ContactID>0</ContactID>
<ContactImage>String</ContactImage>
<ContactName>String</ContactName>
<CreatedByUID>00000000-0000-0000-0000-000000000000</CreatedByUID>
<CrewContactID>0</CrewContactID>
<CrewID>0</CrewID>
<CrewName>String</CrewName>
<Deleted>false</Deleted>
<DeletedDate>0001-01-01T00:00:00</DeletedDate>
<FirstName>String</FirstName>
<Initials>String</Initials>
<LastName>String</LastName>
<RecordCreatedDate>0001-01-01T00:00:00</RecordCreatedDate>
</CrewContact>
</CrewContact>
<CrewContactID>0</CrewContactID>
</CrewContactRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<CrewContactResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<CrewContact>
<CrewContact>
<Active>false</Active>
<ContactID>0</ContactID>
<ContactImage>String</ContactImage>
<ContactName>String</ContactName>
<CreatedByUID>00000000-0000-0000-0000-000000000000</CreatedByUID>
<CrewContactID>0</CrewContactID>
<CrewID>0</CrewID>
<CrewName>String</CrewName>
<Deleted>false</Deleted>
<DeletedDate>0001-01-01T00:00:00</DeletedDate>
<FirstName>String</FirstName>
<Initials>String</Initials>
<LastName>String</LastName>
<RecordCreatedDate>0001-01-01T00:00:00</RecordCreatedDate>
</CrewContact>
</CrewContact>
<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>
</CrewContactResponse>