Platform Subscription API

<back to all web services

SaveIntegration

Requires Authentication
The following routes are available for this service:
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;
    }
}

PHP SaveIntegration DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

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: text/csv
Content-Type: text/csv
Content-Length: length

{"Title":"String","Version":{"Major":0,"Minor":0,"Build":0,"Revision":0},"User":"String","LocalComputer":"String","WinVersion":{"Name":"String","Version":"String","Build":0,"ServicePack":"String"},"Completed":false,"Status":"String","StartTime":"0001-01-01T00:00:00.0000000","EndTime":"0001-01-01T00:00:00.0000000","SettingsFile":{"index":0,"Name":"String","Content":"String","ContentType":"String","FileSizeKB":0,"BlobUri":"String","CreatedDate":"0001-01-01T00:00:00.0000000","Notes":"String"},"ResultsFile":{"index":0,"Name":"String","Content":"String","ContentType":"String","FileSizeKB":0,"BlobUri":"String","CreatedDate":"0001-01-01T00:00:00.0000000","Notes":"String"},"IssuesFile":{"index":0,"Name":"String","Content":"String","ContentType":"String","FileSizeKB":0,"BlobUri":"String","CreatedDate":"0001-01-01T00:00:00.0000000","Notes":"String"}}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}