Trendsic Platform Service

<back to all web services

ImportHistoryRequest

Requires Authentication
The following routes are available for this service:
GET/v1/import/history
<?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 ImportBatchLog implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ImportBatchId=0,
        /** @var string */
        public string $BatchUID='',
        /** @var string|null */
        public ?string $ImportType=null,
        /** @var string|null */
        public ?string $FileName=null,
        /** @var string|null */
        public ?string $Status=null,
        /** @var int */
        public int $TotalRows=0,
        /** @var int */
        public int $InsertedRows=0,
        /** @var int */
        public int $UpdatedRows=0,
        /** @var int */
        public int $SkippedRows=0,
        /** @var int */
        public int $ErrorRows=0,
        /** @var string|null */
        public ?string $CreatedBy=null,
        /** @var DateTime */
        public DateTime $CreatedAt=new DateTime()
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ImportBatchId'])) $this->ImportBatchId = $o['ImportBatchId'];
        if (isset($o['BatchUID'])) $this->BatchUID = $o['BatchUID'];
        if (isset($o['ImportType'])) $this->ImportType = $o['ImportType'];
        if (isset($o['FileName'])) $this->FileName = $o['FileName'];
        if (isset($o['Status'])) $this->Status = $o['Status'];
        if (isset($o['TotalRows'])) $this->TotalRows = $o['TotalRows'];
        if (isset($o['InsertedRows'])) $this->InsertedRows = $o['InsertedRows'];
        if (isset($o['UpdatedRows'])) $this->UpdatedRows = $o['UpdatedRows'];
        if (isset($o['SkippedRows'])) $this->SkippedRows = $o['SkippedRows'];
        if (isset($o['ErrorRows'])) $this->ErrorRows = $o['ErrorRows'];
        if (isset($o['CreatedBy'])) $this->CreatedBy = $o['CreatedBy'];
        if (isset($o['CreatedAt'])) $this->CreatedAt = JsonConverters::from('DateTime', $o['CreatedAt']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ImportBatchId)) $o['ImportBatchId'] = $this->ImportBatchId;
        if (isset($this->BatchUID)) $o['BatchUID'] = $this->BatchUID;
        if (isset($this->ImportType)) $o['ImportType'] = $this->ImportType;
        if (isset($this->FileName)) $o['FileName'] = $this->FileName;
        if (isset($this->Status)) $o['Status'] = $this->Status;
        if (isset($this->TotalRows)) $o['TotalRows'] = $this->TotalRows;
        if (isset($this->InsertedRows)) $o['InsertedRows'] = $this->InsertedRows;
        if (isset($this->UpdatedRows)) $o['UpdatedRows'] = $this->UpdatedRows;
        if (isset($this->SkippedRows)) $o['SkippedRows'] = $this->SkippedRows;
        if (isset($this->ErrorRows)) $o['ErrorRows'] = $this->ErrorRows;
        if (isset($this->CreatedBy)) $o['CreatedBy'] = $this->CreatedBy;
        if (isset($this->CreatedAt)) $o['CreatedAt'] = JsonConverters::to('DateTime', $this->CreatedAt);
        return empty($o) ? new class(){} : $o;
    }
}

class ImportHistoryResponse implements JsonSerializable
{
    public function __construct(
        /** @var array<ImportBatchLog>|null */
        public ?array $Batches=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Batches'])) $this->Batches = JsonConverters::fromArray('ImportBatchLog', $o['Batches']);
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Batches)) $o['Batches'] = JsonConverters::toArray('ImportBatchLog', $this->Batches);
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

class ImportHistoryRequest implements JsonSerializable
{
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        return empty($o) ? new class(){} : $o;
    }
}

PHP ImportHistoryRequest DTOs

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

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /v1/import/history HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ImportHistoryResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Batches>
    <ImportBatchLog>
      <BatchUID>00000000-0000-0000-0000-000000000000</BatchUID>
      <CreatedAt>0001-01-01T00:00:00</CreatedAt>
      <CreatedBy>String</CreatedBy>
      <ErrorRows>0</ErrorRows>
      <FileName>String</FileName>
      <ImportBatchId>0</ImportBatchId>
      <ImportType>String</ImportType>
      <InsertedRows>0</InsertedRows>
      <SkippedRows>0</SkippedRows>
      <Status>String</Status>
      <TotalRows>0</TotalRows>
      <UpdatedRows>0</UpdatedRows>
    </ImportBatchLog>
  </Batches>
  <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>
</ImportHistoryResponse>