sfgboxapi

<back to all web services

LicensesTransactionsEdit

Requires Authentication
The following routes are available for this service:
PUT/licenses_transactions/{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 LicensesTransactionsEditResponse implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=1)
        /** @var int */
        public int $id=0,

        // @DataMember(Order=2)
        /** @var int */
        public int $appUserId=0,

        // @DataMember(Order=3)
        /** @var int */
        public int $licensesId=0,

        // @DataMember(Order=4)
        /** @var float */
        public float $paidAmount=0.0,

        // @DataMember(Order=5)
        /** @var DateTime */
        public DateTime $paidDate=new DateTime(),

        // @DataMember(Order=6)
        /** @var DateTime */
        public DateTime $fromDate=new DateTime(),

        // @DataMember(Order=7)
        /** @var DateTime */
        public DateTime $toDate=new DateTime(),

        // @DataMember(Order=8)
        /** @var string|null */
        public ?string $reference=null,

        // @DataMember(Order=9)
        /** @var ResponseStatus|null */
        public ?ResponseStatus $responseStatus=null
    ) {
    }

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

// @DataContract
class LicensesTransactionsEdit implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=1)
        // @Validate(Validator="NotNull")
        /** @var int */
        public int $id=0,

        // @DataMember(Order=2)
        // @Validate(Validator="NotNull")
        /** @var int */
        public int $appUserId=0,

        // @DataMember(Order=3)
        // @Validate(Validator="NotNull")
        /** @var int */
        public int $licensesId=0,

        // @DataMember(Order=4)
        // @Validate(Validator="NotNull")
        /** @var float */
        public float $paidAmount=0.0,

        // @DataMember(Order=5)
        // @Validate(Validator="NotNull")
        /** @var DateTime */
        public DateTime $paidDate=new DateTime(),

        // @DataMember(Order=6)
        // @Validate(Validator="NotNull")
        /** @var DateTime */
        public DateTime $fromDate=new DateTime(),

        // @DataMember(Order=7)
        // @Validate(Validator="NotNull")
        /** @var DateTime */
        public DateTime $toDate=new DateTime(),

        // @DataMember(Order=8)
        /** @var string|null */
        public ?string $reference=null
    ) {
    }

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

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

PUT /licenses_transactions/{Id} HTTP/1.1 
Host: api.sfgtec.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	id: 0,
	appUserId: 0,
	licensesId: 0,
	paidAmount: 0,
	paidDate: 0001-01-01,
	fromDate: 0001-01-01,
	toDate: 0001-01-01,
	reference: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	id: 0,
	appUserId: 0,
	licensesId: 0,
	paidAmount: 0,
	paidDate: 0001-01-01,
	fromDate: 0001-01-01,
	toDate: 0001-01-01,
	reference: String,
	responseStatus: 
	{
		errorCode: String,
		message: String,
		stackTrace: String,
		errors: 
		[
			{
				errorCode: String,
				fieldName: String,
				message: String,
				meta: 
				{
					String: String
				}
			}
		],
		meta: 
		{
			String: String
		}
	}
}