Richemont.Booster2.PublicApi

<back to all web services

GetTaskDetail

Requires Authentication
The following routes are available for this service:
GET/tasks/{asyncTaskId}Get task detail of authorized user
<?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 Task implements JsonSerializable
{
    public function __construct(
        /** @description Async task ID */
        // @ApiMember(Description="Async task ID", IsRequired=true)
        /** @var string */
        public string $asyncTaskId='',

        /** @description Type of requested async task, e.g 'stock', 'sellout', 'crm' */
        // @ApiMember(Description="Type of requested async task, e.g 'stock', 'sellout', 'crm'", IsRequired=true)
        /** @var string */
        public string $type='',

        /** @description Async task creation date */
        // @ApiMember(Description="Async task creation date", IsRequired=true)
        /** @var string */
        public string $requestDate='',

        /** @description Status of requested async task, e.g 'REQ', 'INP', 'COM', 'ERR' */
        // @ApiMember(Description="Status of requested async task, e.g 'REQ', 'INP', 'COM', 'ERR'", IsRequired=true)
        /** @var string */
        public string $status='',

        /** @description Percentage of completion */
        // @ApiMember(Description="Percentage of completion", IsRequired=true)
        /** @var int */
        public int $percentage=0,

        /** @description Brand Trigram */
        // @ApiMember(Description="Brand Trigram", IsRequired=true)
        /** @var string */
        public string $brand='',

        /** @description Download url of created files */
        // @ApiMember(Description="Download url of created files")
        /** @var string|null */
        public ?string $downloadUrl=null,

        /** @description Presigned expiring download url */
        // @ApiMember(Description="Presigned expiring download url")
        /** @var string|null */
        public ?string $signedDownloadUrl=null,

        /** @description Total count of operations */
        // @ApiMember(Description="Total count of operations")
        /** @var int|null */
        public ?int $totalResults=null,

        /** @description Count of successful operations */
        // @ApiMember(Description="Count of successful operations")
        /** @var int|null */
        public ?int $totalSucceeded=null,

        /** @description Count of failed operations */
        // @ApiMember(Description="Count of failed operations")
        /** @var int|null */
        public ?int $totalFailed=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['asyncTaskId'])) $this->asyncTaskId = $o['asyncTaskId'];
        if (isset($o['type'])) $this->type = $o['type'];
        if (isset($o['requestDate'])) $this->requestDate = $o['requestDate'];
        if (isset($o['status'])) $this->status = $o['status'];
        if (isset($o['percentage'])) $this->percentage = $o['percentage'];
        if (isset($o['brand'])) $this->brand = $o['brand'];
        if (isset($o['downloadUrl'])) $this->downloadUrl = $o['downloadUrl'];
        if (isset($o['signedDownloadUrl'])) $this->signedDownloadUrl = $o['signedDownloadUrl'];
        if (isset($o['totalResults'])) $this->totalResults = $o['totalResults'];
        if (isset($o['totalSucceeded'])) $this->totalSucceeded = $o['totalSucceeded'];
        if (isset($o['totalFailed'])) $this->totalFailed = $o['totalFailed'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->asyncTaskId)) $o['asyncTaskId'] = $this->asyncTaskId;
        if (isset($this->type)) $o['type'] = $this->type;
        if (isset($this->requestDate)) $o['requestDate'] = $this->requestDate;
        if (isset($this->status)) $o['status'] = $this->status;
        if (isset($this->percentage)) $o['percentage'] = $this->percentage;
        if (isset($this->brand)) $o['brand'] = $this->brand;
        if (isset($this->downloadUrl)) $o['downloadUrl'] = $this->downloadUrl;
        if (isset($this->signedDownloadUrl)) $o['signedDownloadUrl'] = $this->signedDownloadUrl;
        if (isset($this->totalResults)) $o['totalResults'] = $this->totalResults;
        if (isset($this->totalSucceeded)) $o['totalSucceeded'] = $this->totalSucceeded;
        if (isset($this->totalFailed)) $o['totalFailed'] = $this->totalFailed;
        return empty($o) ? new class(){} : $o;
    }
}

class GetTaskDetailResponse extends Task implements JsonSerializable
{
    /**
     * @param string $asyncTaskId
     * @param string $type
     * @param string $requestDate
     * @param string $status
     * @param int $percentage
     * @param string $brand
     * @param string|null $downloadUrl
     * @param string|null $signedDownloadUrl
     * @param int|null $totalResults
     * @param int|null $totalSucceeded
     * @param int|null $totalFailed
     */
    public function __construct(
        string $asyncTaskId='',
        string $type='',
        string $requestDate='',
        string $status='',
        int $percentage=0,
        string $brand='',
        ?string $downloadUrl=null,
        ?string $signedDownloadUrl=null,
        ?int $totalResults=null,
        ?int $totalSucceeded=null,
        ?int $totalFailed=null
    ) {
        parent::__construct($asyncTaskId,$type,$requestDate,$status,$percentage,$brand,$downloadUrl,$signedDownloadUrl,$totalResults,$totalSucceeded,$totalFailed);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        return empty($o) ? new class(){} : $o;
    }
}

class GetTaskDetail implements JsonSerializable
{
    public function __construct(
        /** @description Async task ID */
        // @ApiMember(Description="Async task ID", IsRequired=true)
        /** @var string */
        public string $asyncTaskId=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['asyncTaskId'])) $this->asyncTaskId = $o['asyncTaskId'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->asyncTaskId)) $o['asyncTaskId'] = $this->asyncTaskId;
        return empty($o) ? new class(){} : $o;
    }
}

PHP GetTaskDetail DTOs

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

HTTP + JSV

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

GET /tasks/{asyncTaskId} HTTP/1.1 
Host: dev-api-booster.richemont.com 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	asyncTaskId: 00000000000000000000000000000000,
	type: String,
	requestDate: String,
	status: String,
	percentage: 0,
	brand: String,
	downloadUrl: String,
	signedDownloadUrl: String,
	totalResults: 0,
	totalSucceeded: 0,
	totalFailed: 0
}