| POST | /consumerinitiation |
|---|
<?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 ConsumerInitiation implements IPost, JsonSerializable
{
public function __construct(
/** @description First name of the consumer */
// @ApiMember(Description="First name of the consumer", IsRequired=true)
/** @var string */
public string $FirstName='',
/** @description Last name of the consumer */
// @ApiMember(Description="Last name of the consumer", IsRequired=true)
/** @var string */
public string $LastName='',
/** @description Program name */
// @ApiMember(Description="Program name", IsRequired=true)
/** @var string */
public string $Program='',
/** @description Company name */
// @ApiMember(Description="Company name", IsRequired=true)
/** @var string */
public string $CompanyName='',
/** @description Mobile phone number */
// @ApiMember(Description="Mobile phone number")
/** @var string|null */
public ?string $MobileNumber=null,
/** @description Preferred email address */
// @ApiMember(Description="Preferred email address", IsRequired=true)
/** @var string */
public string $PreferredEmail='',
/** @description Current work location state */
// @ApiMember(Description="Current work location state")
/** @var string|null */
public ?string $CurrentWorkState=null,
/** @description Current work location country */
// @ApiMember(Description="Current work location country")
/** @var string|null */
public ?string $CurrentWorkCountry=null,
/** @description Destination work location state */
// @ApiMember(Description="Destination work location state")
/** @var string|null */
public ?string $DestinationWorkState=null,
/** @description Destination work location country */
// @ApiMember(Description="Destination work location country")
/** @var string|null */
public ?string $DestinationWorkCountry=null,
/** @description Preferred work location state */
// @ApiMember(Description="Preferred work location state")
/** @var string|null */
public ?string $PreferredWorkState=null,
/** @description Preferred work location country */
// @ApiMember(Description="Preferred work location country")
/** @var string|null */
public ?string $PreferredWorkCountry=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['FirstName'])) $this->FirstName = $o['FirstName'];
if (isset($o['LastName'])) $this->LastName = $o['LastName'];
if (isset($o['Program'])) $this->Program = $o['Program'];
if (isset($o['CompanyName'])) $this->CompanyName = $o['CompanyName'];
if (isset($o['MobileNumber'])) $this->MobileNumber = $o['MobileNumber'];
if (isset($o['PreferredEmail'])) $this->PreferredEmail = $o['PreferredEmail'];
if (isset($o['CurrentWorkState'])) $this->CurrentWorkState = $o['CurrentWorkState'];
if (isset($o['CurrentWorkCountry'])) $this->CurrentWorkCountry = $o['CurrentWorkCountry'];
if (isset($o['DestinationWorkState'])) $this->DestinationWorkState = $o['DestinationWorkState'];
if (isset($o['DestinationWorkCountry'])) $this->DestinationWorkCountry = $o['DestinationWorkCountry'];
if (isset($o['PreferredWorkState'])) $this->PreferredWorkState = $o['PreferredWorkState'];
if (isset($o['PreferredWorkCountry'])) $this->PreferredWorkCountry = $o['PreferredWorkCountry'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->FirstName)) $o['FirstName'] = $this->FirstName;
if (isset($this->LastName)) $o['LastName'] = $this->LastName;
if (isset($this->Program)) $o['Program'] = $this->Program;
if (isset($this->CompanyName)) $o['CompanyName'] = $this->CompanyName;
if (isset($this->MobileNumber)) $o['MobileNumber'] = $this->MobileNumber;
if (isset($this->PreferredEmail)) $o['PreferredEmail'] = $this->PreferredEmail;
if (isset($this->CurrentWorkState)) $o['CurrentWorkState'] = $this->CurrentWorkState;
if (isset($this->CurrentWorkCountry)) $o['CurrentWorkCountry'] = $this->CurrentWorkCountry;
if (isset($this->DestinationWorkState)) $o['DestinationWorkState'] = $this->DestinationWorkState;
if (isset($this->DestinationWorkCountry)) $o['DestinationWorkCountry'] = $this->DestinationWorkCountry;
if (isset($this->PreferredWorkState)) $o['PreferredWorkState'] = $this->PreferredWorkState;
if (isset($this->PreferredWorkCountry)) $o['PreferredWorkCountry'] = $this->PreferredWorkCountry;
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /consumerinitiation HTTP/1.1
Host: initiation-test.sirva.com
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"FirstName":"String","LastName":"String","Program":"String","CompanyName":"String","MobileNumber":"String","PreferredEmail":"String","CurrentWorkState":"String","CurrentWorkCountry":"String","DestinationWorkState":"String","DestinationWorkCountry":"String","PreferredWorkState":"String","PreferredWorkCountry":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{}