| Required roles: | Administrator, Administrator | Requires any of the roles: | Agent, Administrator, Agent, Administrator, Agent, Administrator |
| PUT,DELETE,OPTIONS | /v1/SlotDistrict/{ID} | ||
|---|---|---|---|
| POST,OPTIONS | /v1/SlotDistrict |
<?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 SchoolAgent implements JsonSerializable
{
public function __construct(
/** @var int */
public int $AgentId=0,
/** @var string|null */
public ?string $AgentName=null,
/** @var int */
public int $SlotDistrictApprovalID=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['AgentId'])) $this->AgentId = $o['AgentId'];
if (isset($o['AgentName'])) $this->AgentName = $o['AgentName'];
if (isset($o['SlotDistrictApprovalID'])) $this->SlotDistrictApprovalID = $o['SlotDistrictApprovalID'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->AgentId)) $o['AgentId'] = $this->AgentId;
if (isset($this->AgentName)) $o['AgentName'] = $this->AgentName;
if (isset($this->SlotDistrictApprovalID)) $o['SlotDistrictApprovalID'] = $this->SlotDistrictApprovalID;
return empty($o) ? new class(){} : $o;
}
}
class SlotDistrictSchool implements JsonSerializable
{
public function __construct(
/** @var int */
public int $SchoolId=0,
/** @var string|null */
public ?string $SchoolName=null,
/** @var array<SchoolAgent>|null */
public ?array $AgentList=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['SchoolId'])) $this->SchoolId = $o['SchoolId'];
if (isset($o['SchoolName'])) $this->SchoolName = $o['SchoolName'];
if (isset($o['AgentList'])) $this->AgentList = JsonConverters::fromArray('SchoolAgent', $o['AgentList']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->SchoolId)) $o['SchoolId'] = $this->SchoolId;
if (isset($this->SchoolName)) $o['SchoolName'] = $this->SchoolName;
if (isset($this->AgentList)) $o['AgentList'] = JsonConverters::toArray('SchoolAgent', $this->AgentList);
return empty($o) ? new class(){} : $o;
}
}
class SlotDistrict implements JsonSerializable
{
public function __construct(
/** @var int */
public int $ID=0,
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $County=null,
/** @var int */
public int $DistrictId=0,
/** @var string|null */
public ?string $DistrictName=null,
/** @var string|null */
public ?string $Address_Physical=null,
/** @var string|null */
public ?string $Address_Mailing=null,
/** @var string|null */
public ?string $City=null,
/** @var string|null */
public ?string $Zip=null,
/** @var string|null */
public ?string $Zip_4=null,
/** @var int */
public int $StateId=0,
/** @var string|null */
public ?string $State=null,
/** @var string|null */
public ?string $Phone=null,
/** @var float|null */
public ?float $NumEmployees=null,
/** @var int|null */
public ?int $NumSchools=null,
/** @var string|null */
public ?string $Type=null,
/** @var bool|null */
public ?bool $Status_NLG=null,
/** @var bool|null */
public ?bool $Status_Midland=null,
/** @var bool|null */
public ?bool $Status_Great_American=null,
/** @var bool|null */
public ?bool $Status_VOYA=null,
/** @var int|null */
public ?int $MVP=null,
/** @var int|null */
public ?int $RVP=null,
/** @var array<SlotDistrictSchool>|null */
public ?array $Schools=null,
/** @var float|null */
public ?float $MilesAway=null,
/** @var bool|null */
public ?bool $HasComments=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ID'])) $this->ID = $o['ID'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['County'])) $this->County = $o['County'];
if (isset($o['DistrictId'])) $this->DistrictId = $o['DistrictId'];
if (isset($o['DistrictName'])) $this->DistrictName = $o['DistrictName'];
if (isset($o['Address_Physical'])) $this->Address_Physical = $o['Address_Physical'];
if (isset($o['Address_Mailing'])) $this->Address_Mailing = $o['Address_Mailing'];
if (isset($o['City'])) $this->City = $o['City'];
if (isset($o['Zip'])) $this->Zip = $o['Zip'];
if (isset($o['Zip_4'])) $this->Zip_4 = $o['Zip_4'];
if (isset($o['StateId'])) $this->StateId = $o['StateId'];
if (isset($o['State'])) $this->State = $o['State'];
if (isset($o['Phone'])) $this->Phone = $o['Phone'];
if (isset($o['NumEmployees'])) $this->NumEmployees = $o['NumEmployees'];
if (isset($o['NumSchools'])) $this->NumSchools = $o['NumSchools'];
if (isset($o['Type'])) $this->Type = $o['Type'];
if (isset($o['Status_NLG'])) $this->Status_NLG = $o['Status_NLG'];
if (isset($o['Status_Midland'])) $this->Status_Midland = $o['Status_Midland'];
if (isset($o['Status_Great_American'])) $this->Status_Great_American = $o['Status_Great_American'];
if (isset($o['Status_VOYA'])) $this->Status_VOYA = $o['Status_VOYA'];
if (isset($o['MVP'])) $this->MVP = $o['MVP'];
if (isset($o['RVP'])) $this->RVP = $o['RVP'];
if (isset($o['Schools'])) $this->Schools = JsonConverters::fromArray('SlotDistrictSchool', $o['Schools']);
if (isset($o['MilesAway'])) $this->MilesAway = $o['MilesAway'];
if (isset($o['HasComments'])) $this->HasComments = $o['HasComments'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ID)) $o['ID'] = $this->ID;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->County)) $o['County'] = $this->County;
if (isset($this->DistrictId)) $o['DistrictId'] = $this->DistrictId;
if (isset($this->DistrictName)) $o['DistrictName'] = $this->DistrictName;
if (isset($this->Address_Physical)) $o['Address_Physical'] = $this->Address_Physical;
if (isset($this->Address_Mailing)) $o['Address_Mailing'] = $this->Address_Mailing;
if (isset($this->City)) $o['City'] = $this->City;
if (isset($this->Zip)) $o['Zip'] = $this->Zip;
if (isset($this->Zip_4)) $o['Zip_4'] = $this->Zip_4;
if (isset($this->StateId)) $o['StateId'] = $this->StateId;
if (isset($this->State)) $o['State'] = $this->State;
if (isset($this->Phone)) $o['Phone'] = $this->Phone;
if (isset($this->NumEmployees)) $o['NumEmployees'] = $this->NumEmployees;
if (isset($this->NumSchools)) $o['NumSchools'] = $this->NumSchools;
if (isset($this->Type)) $o['Type'] = $this->Type;
if (isset($this->Status_NLG)) $o['Status_NLG'] = $this->Status_NLG;
if (isset($this->Status_Midland)) $o['Status_Midland'] = $this->Status_Midland;
if (isset($this->Status_Great_American)) $o['Status_Great_American'] = $this->Status_Great_American;
if (isset($this->Status_VOYA)) $o['Status_VOYA'] = $this->Status_VOYA;
if (isset($this->MVP)) $o['MVP'] = $this->MVP;
if (isset($this->RVP)) $o['RVP'] = $this->RVP;
if (isset($this->Schools)) $o['Schools'] = JsonConverters::toArray('SlotDistrictSchool', $this->Schools);
if (isset($this->MilesAway)) $o['MilesAway'] = $this->MilesAway;
if (isset($this->HasComments)) $o['HasComments'] = $this->HasComments;
return empty($o) ? new class(){} : $o;
}
}
class SlotDistrictResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var array<SlotDistrict>|null */
public ?array $SlotDistrict=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['SlotDistrict'])) $this->SlotDistrict = JsonConverters::fromArray('SlotDistrict', $o['SlotDistrict']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->SlotDistrict)) $o['SlotDistrict'] = JsonConverters::toArray('SlotDistrict', $this->SlotDistrict);
return empty($o) ? new class(){} : $o;
}
}
class SlotDistrictRequest implements JsonSerializable
{
public function __construct(
/** @var SlotDistrict|null */
public ?SlotDistrict $SlotDistrict=null,
/** @var int */
public int $ID=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['SlotDistrict'])) $this->SlotDistrict = JsonConverters::from('SlotDistrict', $o['SlotDistrict']);
if (isset($o['ID'])) $this->ID = $o['ID'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->SlotDistrict)) $o['SlotDistrict'] = JsonConverters::to('SlotDistrict', $this->SlotDistrict);
if (isset($this->ID)) $o['ID'] = $this->ID;
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/SlotDistrict HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<SlotDistrictRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<ID>0</ID>
<SlotDistrict>
<Address_Mailing>String</Address_Mailing>
<Address_Physical>String</Address_Physical>
<City>String</City>
<County>String</County>
<DistrictId>0</DistrictId>
<DistrictName>String</DistrictName>
<HasComments>false</HasComments>
<ID>0</ID>
<MVP>0</MVP>
<MilesAway>0</MilesAway>
<Name>String</Name>
<NumEmployees>0</NumEmployees>
<NumSchools>0</NumSchools>
<Phone>String</Phone>
<RVP>0</RVP>
<Schools>
<SlotDistrictSchool>
<AgentList>
<SchoolAgent>
<AgentId>0</AgentId>
<AgentName>String</AgentName>
<SlotDistrictApprovalID>0</SlotDistrictApprovalID>
</SchoolAgent>
</AgentList>
<SchoolId>0</SchoolId>
<SchoolName>String</SchoolName>
</SlotDistrictSchool>
</Schools>
<State>String</State>
<StateId>0</StateId>
<Status_Great_American>false</Status_Great_American>
<Status_Midland>false</Status_Midland>
<Status_NLG>false</Status_NLG>
<Status_VOYA>false</Status_VOYA>
<Type>String</Type>
<Zip>String</Zip>
<Zip_4>String</Zip_4>
</SlotDistrict>
</SlotDistrictRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<SlotDistrictResponse 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>
<SlotDistrict>
<SlotDistrict>
<Address_Mailing>String</Address_Mailing>
<Address_Physical>String</Address_Physical>
<City>String</City>
<County>String</County>
<DistrictId>0</DistrictId>
<DistrictName>String</DistrictName>
<HasComments>false</HasComments>
<ID>0</ID>
<MVP>0</MVP>
<MilesAway>0</MilesAway>
<Name>String</Name>
<NumEmployees>0</NumEmployees>
<NumSchools>0</NumSchools>
<Phone>String</Phone>
<RVP>0</RVP>
<Schools>
<SlotDistrictSchool>
<AgentList>
<SchoolAgent>
<AgentId>0</AgentId>
<AgentName>String</AgentName>
<SlotDistrictApprovalID>0</SlotDistrictApprovalID>
</SchoolAgent>
</AgentList>
<SchoolId>0</SchoolId>
<SchoolName>String</SchoolName>
</SlotDistrictSchool>
</Schools>
<State>String</State>
<StateId>0</StateId>
<Status_Great_American>false</Status_Great_American>
<Status_Midland>false</Status_Midland>
<Status_NLG>false</Status_NLG>
<Status_VOYA>false</Status_VOYA>
<Type>String</Type>
<Zip>String</Zip>
<Zip_4>String</Zip_4>
</SlotDistrict>
</SlotDistrict>
</SlotDistrictResponse>