POST | /support/request |
---|
<?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 BettingApp implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $name=null,
/** @var string|null */
public ?string $version=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['name'])) $this->name = $o['name'];
if (isset($o['version'])) $this->version = $o['version'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->name)) $o['name'] = $this->name;
if (isset($this->version)) $o['version'] = $this->version;
return empty($o) ? new class(){} : $o;
}
}
class Ref implements JsonSerializable
{
public function __construct(
/** @var string */
public string $id='',
/** @var string */
public string $val=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['val'])) $this->val = $o['val'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->val)) $o['val'] = $this->val;
return empty($o) ? new class(){} : $o;
}
}
class Origin implements JsonSerializable
{
public function __construct(
/** @var BettingApp|null */
public ?BettingApp $application=null,
/** @var string|null */
public ?string $ip=null,
/** @var Ref|null */
public ?Ref $organization=null,
/** @var Ref|null */
public ?Ref $region=null,
/** @var Ref|null */
public ?Ref $locationGroup=null,
/** @var Ref|null */
public ?Ref $location=null,
/** @var Ref|null */
public ?Ref $device=null,
/** @var Ref|null */
public ?Ref $clerk=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['application'])) $this->application = JsonConverters::from('BettingApp', $o['application']);
if (isset($o['ip'])) $this->ip = $o['ip'];
if (isset($o['organization'])) $this->organization = JsonConverters::from('Ref', $o['organization']);
if (isset($o['region'])) $this->region = JsonConverters::from('Ref', $o['region']);
if (isset($o['locationGroup'])) $this->locationGroup = JsonConverters::from('Ref', $o['locationGroup']);
if (isset($o['location'])) $this->location = JsonConverters::from('Ref', $o['location']);
if (isset($o['device'])) $this->device = JsonConverters::from('Ref', $o['device']);
if (isset($o['clerk'])) $this->clerk = JsonConverters::from('Ref', $o['clerk']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->application)) $o['application'] = JsonConverters::to('BettingApp', $this->application);
if (isset($this->ip)) $o['ip'] = $this->ip;
if (isset($this->organization)) $o['organization'] = JsonConverters::to('Ref', $this->organization);
if (isset($this->region)) $o['region'] = JsonConverters::to('Ref', $this->region);
if (isset($this->locationGroup)) $o['locationGroup'] = JsonConverters::to('Ref', $this->locationGroup);
if (isset($this->location)) $o['location'] = JsonConverters::to('Ref', $this->location);
if (isset($this->device)) $o['device'] = JsonConverters::to('Ref', $this->device);
if (isset($this->clerk)) $o['clerk'] = JsonConverters::to('Ref', $this->clerk);
return empty($o) ? new class(){} : $o;
}
}
class RequestSupport implements JsonSerializable
{
public function __construct(
/** @var Origin|null */
public ?Origin $origin=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['origin'])) $this->origin = JsonConverters::from('Origin', $o['origin']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->origin)) $o['origin'] = JsonConverters::to('Origin', $this->origin);
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 /support/request HTTP/1.1
Host: support.bettor-dual-stage.webhop.biz
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<RequestSupport xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Support.WebApi.ServiceModel">
<Origin xmlns:d2p1="http://schemas.datacontract.org/2004/07/Betting.Common">
<d2p1:Application>
<d2p1:Name>String</d2p1:Name>
<d2p1:Version>String</d2p1:Version>
</d2p1:Application>
<d2p1:Clerk xmlns:d3p1="http://schemas.datacontract.org/2004/07/Starnet.Common">
<d3p1:Id>String</d3p1:Id>
<d3p1:Val>String</d3p1:Val>
</d2p1:Clerk>
<d2p1:Device xmlns:d3p1="http://schemas.datacontract.org/2004/07/Starnet.Common">
<d3p1:Id>String</d3p1:Id>
<d3p1:Val>String</d3p1:Val>
</d2p1:Device>
<d2p1:IP>String</d2p1:IP>
<d2p1:Location xmlns:d3p1="http://schemas.datacontract.org/2004/07/Starnet.Common">
<d3p1:Id>String</d3p1:Id>
<d3p1:Val>String</d3p1:Val>
</d2p1:Location>
<d2p1:LocationGroup xmlns:d3p1="http://schemas.datacontract.org/2004/07/Starnet.Common">
<d3p1:Id>String</d3p1:Id>
<d3p1:Val>String</d3p1:Val>
</d2p1:LocationGroup>
<d2p1:Organization xmlns:d3p1="http://schemas.datacontract.org/2004/07/Starnet.Common">
<d3p1:Id>String</d3p1:Id>
<d3p1:Val>String</d3p1:Val>
</d2p1:Organization>
<d2p1:Region xmlns:d3p1="http://schemas.datacontract.org/2004/07/Starnet.Common">
<d3p1:Id>String</d3p1:Id>
<d3p1:Val>String</d3p1:Val>
</d2p1:Region>
</Origin>
</RequestSupport>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <ResponseStatus xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types"> <ErrorCode>String</ErrorCode> <Message>String</Message> <StackTrace>String</StackTrace> <Errors> <ResponseError> <ErrorCode>String</ErrorCode> <FieldName>String</FieldName> <Message>String</Message> <Meta xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d4p1:KeyValueOfstringstring> <d4p1:Key>String</d4p1:Key> <d4p1:Value>String</d4p1:Value> </d4p1:KeyValueOfstringstring> </Meta> </ResponseError> </Errors> <Meta xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d2p1:KeyValueOfstringstring> <d2p1:Key>String</d2p1:Key> <d2p1:Value>String</d2p1:Value> </d2p1:KeyValueOfstringstring> </Meta> </ResponseStatus>