Client_Initiations

<back to all web services

ExtendSasRequest

Requires Authentication
The following routes are available for this service:
POST/documents/extendSas
<?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 DocumentRequestBase implements JsonSerializable
{
    public function __construct(
        /** @description ExternalID */
        // @ApiMember(Description="ExternalID", ExcludeInSchema=true, IsRequired=true, ParameterType="path")
        /** @var string */
        public string $ExternalId=''
    ) {
    }

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

class ExtendSasRequest extends DocumentRequestBase implements JsonSerializable
{
    /**
     * @param string $ExternalId
     */
    public function __construct(
        string $ExternalId='',
        /** @var string|null */
        public ?string $FileName=null,
        /** @description Month */
        // @ApiMember(Description="Month", ExcludeInSchema=true, IsRequired=true, ParameterType="path")
        /** @var int */
        public int $Month=0,

        /** @description Day */
        // @ApiMember(Description="Day", ExcludeInSchema=true, IsRequired=true, ParameterType="path")
        /** @var int */
        public int $Day=0
    ) {
        parent::__construct($ExternalId);
    }

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

class ResponseBase implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Message=null,
        /** @var bool|null */
        public ?bool $IsSuccess=null
    ) {
    }

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

class ExtendSasResponse extends ResponseBase implements JsonSerializable
{
    /**
     * @param string|null $Message
     * @param bool|null $IsSuccess
     */
    public function __construct(
        ?string $Message=null,
        ?bool $IsSuccess=null,
        /** @var string|null */
        public ?string $Link=null
    ) {
        parent::__construct($Message,$IsSuccess);
    }

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

PHP ExtendSasRequest 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 /documents/extendSas HTTP/1.1 
Host: initiation-test.sirva.com 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"FileName":"String","Month":0,"Day":0,"ExternalId":"String"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"Link":"String","Message":"String","IsSuccess":false}