efun.id.api

<back to all web services

LogTransferRequest

Requires Authentication
The following routes are available for this service:
GET/api/v1/logs/transfer
<?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 PagingRequest implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $page=0,
        /** @var int */
        public int $limit=0,
        /** @var int */
        public int $offSet=0
    ) {
    }

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

class LogTransferRequest extends PagingRequest implements JsonSerializable
{
    /**
     * @param int $page
     * @param int $limit
     * @param int $offSet
     */
    public function __construct(
        int $page=0,
        int $limit=0,
        int $offSet=0,
        /** @var int */
        public int $gameId=0,
        /** @var DateTime */
        public DateTime $fromDate=new DateTime(),
        /** @var DateTime */
        public DateTime $toDate=new DateTime()
    ) {
        parent::__construct($page,$limit,$offSet);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['gameId'])) $this->gameId = $o['gameId'];
        if (isset($o['fromDate'])) $this->fromDate = JsonConverters::from('DateTime', $o['fromDate']);
        if (isset($o['toDate'])) $this->toDate = JsonConverters::from('DateTime', $o['toDate']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->gameId)) $o['gameId'] = $this->gameId;
        if (isset($this->fromDate)) $o['fromDate'] = JsonConverters::to('DateTime', $this->fromDate);
        if (isset($this->toDate)) $o['toDate'] = JsonConverters::to('DateTime', $this->toDate);
        return empty($o) ? new class(){} : $o;
    }
}

class Pagination implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $total=0,
        /** @var int */
        public int $pages=0,
        /** @var int */
        public int $offset=0,
        /** @var int */
        public int $limit=0,
        /** @var int */
        public int $currentPage=0
    ) {
    }

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

/**
 * @template T
 */
class PageResponse implements IResponseRequest, JsonSerializable
{
    public array $genericArgs = [];
    public static function create(array $genericArgs=[]): PageResponse {
        $to = new PageResponse();
        $to->genericArgs = $genericArgs;
        return $to;
    }

    public function __construct(
        /** @var int */
        public mixed $code=0,
        /** @var string */
        public mixed $message='',
        /** @var array<Object>|null */
        public mixed $data=null,
        /** @var Pagination|null */
        public mixed $pagination=null
    ) {
    }

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

PHP LogTransferRequest 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 /api/v1/logs/transfer HTTP/1.1 
Host: efun-id-api-sandbox.efun.vn 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	code: 0,
	message: String,
	data: 
	[
		{
			
		}
	]
}