<back to all web services

GetRecycleBinItem

The following routes are available for this service:
GET/RestApi/recycle-bin/items/{id}
<?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 RecycelBinItemRequestBase implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $Id=''
    ) {
    }

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

class RecycleBinItemProxy implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $Id='',
        /** @var string|null */
        public ?string $ProviderName=null,
        /** @var string|null */
        public ?string $ItemTypeName=null,
        /** @var string|null */
        public ?string $DisplayTypeName=null,
        /** @var string */
        public string $DataItemId='',
        /** @var string|null */
        public ?string $ItemTitle=null,
        /** @var string|null */
        public ?string $Status=null,
        /** @var string|null */
        public ?string $StatusText=null,
        /** @var string|null */
        public ?string $ItemLanguage=null,
        /** @var string|null */
        public ?string $OwnerName=null,
        /** @var DateTime */
        public DateTime $DateCreated=new DateTime(),
        /** @var string|null */
        public ?string $ParentTypeName=null,
        /** @var string|null */
        public ?string $ParentTitlesPath=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['ProviderName'])) $this->ProviderName = $o['ProviderName'];
        if (isset($o['ItemTypeName'])) $this->ItemTypeName = $o['ItemTypeName'];
        if (isset($o['DisplayTypeName'])) $this->DisplayTypeName = $o['DisplayTypeName'];
        if (isset($o['DataItemId'])) $this->DataItemId = $o['DataItemId'];
        if (isset($o['ItemTitle'])) $this->ItemTitle = $o['ItemTitle'];
        if (isset($o['Status'])) $this->Status = $o['Status'];
        if (isset($o['StatusText'])) $this->StatusText = $o['StatusText'];
        if (isset($o['ItemLanguage'])) $this->ItemLanguage = $o['ItemLanguage'];
        if (isset($o['OwnerName'])) $this->OwnerName = $o['OwnerName'];
        if (isset($o['DateCreated'])) $this->DateCreated = JsonConverters::from('DateTime', $o['DateCreated']);
        if (isset($o['ParentTypeName'])) $this->ParentTypeName = $o['ParentTypeName'];
        if (isset($o['ParentTitlesPath'])) $this->ParentTitlesPath = $o['ParentTitlesPath'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->ProviderName)) $o['ProviderName'] = $this->ProviderName;
        if (isset($this->ItemTypeName)) $o['ItemTypeName'] = $this->ItemTypeName;
        if (isset($this->DisplayTypeName)) $o['DisplayTypeName'] = $this->DisplayTypeName;
        if (isset($this->DataItemId)) $o['DataItemId'] = $this->DataItemId;
        if (isset($this->ItemTitle)) $o['ItemTitle'] = $this->ItemTitle;
        if (isset($this->Status)) $o['Status'] = $this->Status;
        if (isset($this->StatusText)) $o['StatusText'] = $this->StatusText;
        if (isset($this->ItemLanguage)) $o['ItemLanguage'] = $this->ItemLanguage;
        if (isset($this->OwnerName)) $o['OwnerName'] = $this->OwnerName;
        if (isset($this->DateCreated)) $o['DateCreated'] = JsonConverters::to('DateTime', $this->DateCreated);
        if (isset($this->ParentTypeName)) $o['ParentTypeName'] = $this->ParentTypeName;
        if (isset($this->ParentTitlesPath)) $o['ParentTitlesPath'] = $this->ParentTitlesPath;
        return empty($o) ? new class(){} : $o;
    }
}

class GetRecycleBinItem extends RecycelBinItemRequestBase implements JsonSerializable
{
    /**
     * @param string $Id
     */
    public function __construct(
        string $Id=''
    ) {
        parent::__construct($Id);
    }

    /** @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;
    }
}

PHP GetRecycleBinItem 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.

GET /RestApi/recycle-bin/items/{id} HTTP/1.1 
Host: www.asg.com.au 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"providerName":"String","itemTypeName":"String","displayTypeName":"String","itemTitle":"String","status":"String","statusText":"String","itemLanguage":"String","ownerName":"String","dateCreated":"\/Date(-62135596800000-0000)\/","parentTypeName":"String","parentTitlesPath":"String"}