All Verbs | /api/integration |
---|
<?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};
// @ApiResponse(Description="Track integration result")
class SaveIntegrationResponse implements JsonSerializable
{
public function __construct(
/** @var string */
public string $IntegrationId='',
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['IntegrationId'])) $this->IntegrationId = $o['IntegrationId'];
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->IntegrationId)) $o['IntegrationId'] = $this->IntegrationId;
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
return empty($o) ? new class(){} : $o;
}
}
class IntegrationVersion implements JsonSerializable
{
public function __construct(
/** @var int */
public int $Major=0,
/** @var int */
public int $Minor=0,
/** @var int */
public int $Build=0,
/** @var int */
public int $Revision=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Major'])) $this->Major = $o['Major'];
if (isset($o['Minor'])) $this->Minor = $o['Minor'];
if (isset($o['Build'])) $this->Build = $o['Build'];
if (isset($o['Revision'])) $this->Revision = $o['Revision'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Major)) $o['Major'] = $this->Major;
if (isset($this->Minor)) $o['Minor'] = $this->Minor;
if (isset($this->Build)) $o['Build'] = $this->Build;
if (isset($this->Revision)) $o['Revision'] = $this->Revision;
return empty($o) ? new class(){} : $o;
}
}
class IntegrationWinVersion implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $Version=null,
/** @var int */
public int $Build=0,
/** @var string|null */
public ?string $ServicePack=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Version'])) $this->Version = $o['Version'];
if (isset($o['Build'])) $this->Build = $o['Build'];
if (isset($o['ServicePack'])) $this->ServicePack = $o['ServicePack'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Version)) $o['Version'] = $this->Version;
if (isset($this->Build)) $o['Build'] = $this->Build;
if (isset($this->ServicePack)) $o['ServicePack'] = $this->ServicePack;
return empty($o) ? new class(){} : $o;
}
}
class IntegrationFileModel implements JsonSerializable
{
public function __construct(
/** @var int */
public int $index=0,
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $Content=null,
/** @var string|null */
public ?string $ContentType=null,
/** @var int */
public int $FileSizeKB=0,
/** @var string|null */
public ?string $BlobUri=null,
/** @var DateTime */
public DateTime $CreatedDate=new DateTime(),
/** @var string|null */
public ?string $Notes=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['index'])) $this->index = $o['index'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Content'])) $this->Content = $o['Content'];
if (isset($o['ContentType'])) $this->ContentType = $o['ContentType'];
if (isset($o['FileSizeKB'])) $this->FileSizeKB = $o['FileSizeKB'];
if (isset($o['BlobUri'])) $this->BlobUri = $o['BlobUri'];
if (isset($o['CreatedDate'])) $this->CreatedDate = JsonConverters::from('DateTime', $o['CreatedDate']);
if (isset($o['Notes'])) $this->Notes = $o['Notes'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->index)) $o['index'] = $this->index;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Content)) $o['Content'] = $this->Content;
if (isset($this->ContentType)) $o['ContentType'] = $this->ContentType;
if (isset($this->FileSizeKB)) $o['FileSizeKB'] = $this->FileSizeKB;
if (isset($this->BlobUri)) $o['BlobUri'] = $this->BlobUri;
if (isset($this->CreatedDate)) $o['CreatedDate'] = JsonConverters::to('DateTime', $this->CreatedDate);
if (isset($this->Notes)) $o['Notes'] = $this->Notes;
return empty($o) ? new class(){} : $o;
}
}
class SaveIntegration implements JsonSerializable
{
public function __construct(
/** @description The integration reference ID which is the gateway packet id. If the value passed is empty, new packet record will be created. */
// @ApiMember(DataType="Guid?", Description="The integration reference ID which is the gateway packet id. If the value passed is empty, new packet record will be created.", Name="IntegrationId")
/** @var string */
public string $IntegrationId='',
/** @description Name or title of the integration */
// @ApiMember(DataType="string", Description="Name or title of the integration", Name="Title")
/** @var string|null */
public ?string $Title=null,
/** @description Version information of the integration module. */
// @ApiMember(DataType="IntegrationVersion", Description="Version information of the integration module.", Name="Version")
/** @var IntegrationVersion|null */
public ?IntegrationVersion $Version=null,
/** @description User who requested the integration */
// @ApiMember(DataType="string", Description="User who requested the integration", Name="User")
/** @var string|null */
public ?string $User=null,
/** @description Local computer where the integration is performed on */
// @ApiMember(DataType="string", Description="Local computer where the integration is performed on", Name="LocalComputer")
/** @var string|null */
public ?string $LocalComputer=null,
/** @description Windows version information */
// @ApiMember(DataType="IntegrationWinVersion", Description="Windows version information", Name="WinVersion")
/** @var IntegrationWinVersion|null */
public ?IntegrationWinVersion $WinVersion=null,
/** @description Completed status of the integration */
// @ApiMember(DataType="bool", Description="Completed status of the integration", Name="Completed")
/** @var bool|null */
public ?bool $Completed=null,
/** @description Status of the integration. */
// @ApiMember(DataType="string", Description="Status of the integration.", Name="Status")
/** @var string|null */
public ?string $Status=null,
/** @description Start date and time of the integration. */
// @ApiMember(DataType="DateTime", Description="Start date and time of the integration.", Name="StartTime")
/** @var DateTime */
public DateTime $StartTime=new DateTime(),
/** @description End date and time of the integration. */
// @ApiMember(DataType="DateTime", Description="End date and time of the integration.", Name="EndTime")
/** @var DateTime */
public DateTime $EndTime=new DateTime(),
/** @description Settings XML being used in the integration. */
// @ApiMember(DataType="IntegrationFileModel", Description="Settings XML being used in the integration.", Name="SettingsFile")
/** @var IntegrationFileModel|null */
public ?IntegrationFileModel $SettingsFile=null,
/** @description File (xml) containing the results of the integration */
// @ApiMember(DataType="IntegrationFileModel", Description="File (xml) containing the results of the integration", Name="ResultsFile")
/** @var IntegrationFileModel|null */
public ?IntegrationFileModel $ResultsFile=null,
/** @description File (xml) containing the issues that were identified during integration */
// @ApiMember(DataType="IntegrationFileModel", Description="File (xml) containing the issues that were identified during integration", Name="IssuesFile")
/** @var IntegrationFileModel|null */
public ?IntegrationFileModel $IssuesFile=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['IntegrationId'])) $this->IntegrationId = $o['IntegrationId'];
if (isset($o['Title'])) $this->Title = $o['Title'];
if (isset($o['Version'])) $this->Version = JsonConverters::from('IntegrationVersion', $o['Version']);
if (isset($o['User'])) $this->User = $o['User'];
if (isset($o['LocalComputer'])) $this->LocalComputer = $o['LocalComputer'];
if (isset($o['WinVersion'])) $this->WinVersion = JsonConverters::from('IntegrationWinVersion', $o['WinVersion']);
if (isset($o['Completed'])) $this->Completed = $o['Completed'];
if (isset($o['Status'])) $this->Status = $o['Status'];
if (isset($o['StartTime'])) $this->StartTime = JsonConverters::from('DateTime', $o['StartTime']);
if (isset($o['EndTime'])) $this->EndTime = JsonConverters::from('DateTime', $o['EndTime']);
if (isset($o['SettingsFile'])) $this->SettingsFile = JsonConverters::from('IntegrationFileModel', $o['SettingsFile']);
if (isset($o['ResultsFile'])) $this->ResultsFile = JsonConverters::from('IntegrationFileModel', $o['ResultsFile']);
if (isset($o['IssuesFile'])) $this->IssuesFile = JsonConverters::from('IntegrationFileModel', $o['IssuesFile']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->IntegrationId)) $o['IntegrationId'] = $this->IntegrationId;
if (isset($this->Title)) $o['Title'] = $this->Title;
if (isset($this->Version)) $o['Version'] = JsonConverters::to('IntegrationVersion', $this->Version);
if (isset($this->User)) $o['User'] = $this->User;
if (isset($this->LocalComputer)) $o['LocalComputer'] = $this->LocalComputer;
if (isset($this->WinVersion)) $o['WinVersion'] = JsonConverters::to('IntegrationWinVersion', $this->WinVersion);
if (isset($this->Completed)) $o['Completed'] = $this->Completed;
if (isset($this->Status)) $o['Status'] = $this->Status;
if (isset($this->StartTime)) $o['StartTime'] = JsonConverters::to('DateTime', $this->StartTime);
if (isset($this->EndTime)) $o['EndTime'] = JsonConverters::to('DateTime', $this->EndTime);
if (isset($this->SettingsFile)) $o['SettingsFile'] = JsonConverters::to('IntegrationFileModel', $this->SettingsFile);
if (isset($this->ResultsFile)) $o['ResultsFile'] = JsonConverters::to('IntegrationFileModel', $this->ResultsFile);
if (isset($this->IssuesFile)) $o['IssuesFile'] = JsonConverters::to('IntegrationFileModel', $this->IssuesFile);
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 /api/integration HTTP/1.1
Host: production-eros-platform-apisubscription.azurewebsites.net
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<SaveIntegration xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eros.Subtle.Canvara.WebAPIModel.ServiceModel">
<Completed>false</Completed>
<EndTime>0001-01-01T00:00:00</EndTime>
<IntegrationId>00000000-0000-0000-0000-000000000000</IntegrationId>
<IssuesFile xmlns:d2p1="http://schemas.datacontract.org/2004/07/Eros.Causal.Common.Entity">
<d2p1:BlobUri>String</d2p1:BlobUri>
<d2p1:Content>String</d2p1:Content>
<d2p1:ContentType>String</d2p1:ContentType>
<d2p1:CreatedDate>0001-01-01T00:00:00</d2p1:CreatedDate>
<d2p1:FileSizeKB>0</d2p1:FileSizeKB>
<d2p1:Name>String</d2p1:Name>
<d2p1:Notes>String</d2p1:Notes>
<d2p1:index>0</d2p1:index>
</IssuesFile>
<LocalComputer>String</LocalComputer>
<ResultsFile xmlns:d2p1="http://schemas.datacontract.org/2004/07/Eros.Causal.Common.Entity">
<d2p1:BlobUri>String</d2p1:BlobUri>
<d2p1:Content>String</d2p1:Content>
<d2p1:ContentType>String</d2p1:ContentType>
<d2p1:CreatedDate>0001-01-01T00:00:00</d2p1:CreatedDate>
<d2p1:FileSizeKB>0</d2p1:FileSizeKB>
<d2p1:Name>String</d2p1:Name>
<d2p1:Notes>String</d2p1:Notes>
<d2p1:index>0</d2p1:index>
</ResultsFile>
<SettingsFile xmlns:d2p1="http://schemas.datacontract.org/2004/07/Eros.Causal.Common.Entity">
<d2p1:BlobUri>String</d2p1:BlobUri>
<d2p1:Content>String</d2p1:Content>
<d2p1:ContentType>String</d2p1:ContentType>
<d2p1:CreatedDate>0001-01-01T00:00:00</d2p1:CreatedDate>
<d2p1:FileSizeKB>0</d2p1:FileSizeKB>
<d2p1:Name>String</d2p1:Name>
<d2p1:Notes>String</d2p1:Notes>
<d2p1:index>0</d2p1:index>
</SettingsFile>
<StartTime>0001-01-01T00:00:00</StartTime>
<Status>String</Status>
<Title>String</Title>
<User>String</User>
<Version xmlns:d2p1="http://schemas.datacontract.org/2004/07/Eros.Causal.Common.Entity">
<d2p1:Build>0</d2p1:Build>
<d2p1:Major>0</d2p1:Major>
<d2p1:Minor>0</d2p1:Minor>
<d2p1:Revision>0</d2p1:Revision>
</Version>
<WinVersion xmlns:d2p1="http://schemas.datacontract.org/2004/07/Eros.Causal.Common.Entity">
<d2p1:Build>0</d2p1:Build>
<d2p1:Name>String</d2p1:Name>
<d2p1:ServicePack>String</d2p1:ServicePack>
<d2p1:Version>String</d2p1:Version>
</WinVersion>
</SaveIntegration>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <SaveIntegrationResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eros.Subtle.Canvara.WebAPIModel.ServiceModel"> <IntegrationId>00000000-0000-0000-0000-000000000000</IntegrationId> <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> </SaveIntegrationResponse>