regis

<back to all web services

FinanceBalanceRequest

Requires Authentication
Required permission:ReadAccountBalance
The following routes are available for this service:
POST/Finance/Balance/{uuid}
<?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 FinanceBalanceResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $responseStatus=null,
        /** @var int */
        public int $regent_id=0,
        /** @var string|null */
        public ?string $first_name=null,
        /** @var string|null */
        public ?string $last_name=null,
        /** @var string|null */
        public ?string $email=null,
        /** @var string|null */
        public ?string $current_program=null,
        /** @var string|null */
        public ?string $first_regent_term=null,
        /** @var DateTime|null */
        public ?DateTime $first_registered_date=null,
        /** @var DateTime|null */
        public ?DateTime $last_registered_date=null,
        /** @var string|null */
        public ?string $uuid=null,
        /** @var float */
        public float $total_payments=0.0,
        /** @var float */
        public float $total_charges=0.0,
        /** @var float */
        public float $balance=0.0,
        /** @var float */
        public float $gp_raw_balance=0.0,
        /** @var bool|null */
        public ?bool $is_vendor=null,
        /** @var bool|null */
        public ?bool $is_customer=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
        if (isset($o['regent_id'])) $this->regent_id = $o['regent_id'];
        if (isset($o['first_name'])) $this->first_name = $o['first_name'];
        if (isset($o['last_name'])) $this->last_name = $o['last_name'];
        if (isset($o['email'])) $this->email = $o['email'];
        if (isset($o['current_program'])) $this->current_program = $o['current_program'];
        if (isset($o['first_regent_term'])) $this->first_regent_term = $o['first_regent_term'];
        if (isset($o['first_registered_date'])) $this->first_registered_date = JsonConverters::from('DateTime', $o['first_registered_date']);
        if (isset($o['last_registered_date'])) $this->last_registered_date = JsonConverters::from('DateTime', $o['last_registered_date']);
        if (isset($o['uuid'])) $this->uuid = $o['uuid'];
        if (isset($o['total_payments'])) $this->total_payments = $o['total_payments'];
        if (isset($o['total_charges'])) $this->total_charges = $o['total_charges'];
        if (isset($o['balance'])) $this->balance = $o['balance'];
        if (isset($o['gp_raw_balance'])) $this->gp_raw_balance = $o['gp_raw_balance'];
        if (isset($o['is_vendor'])) $this->is_vendor = $o['is_vendor'];
        if (isset($o['is_customer'])) $this->is_customer = $o['is_customer'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
        if (isset($this->regent_id)) $o['regent_id'] = $this->regent_id;
        if (isset($this->first_name)) $o['first_name'] = $this->first_name;
        if (isset($this->last_name)) $o['last_name'] = $this->last_name;
        if (isset($this->email)) $o['email'] = $this->email;
        if (isset($this->current_program)) $o['current_program'] = $this->current_program;
        if (isset($this->first_regent_term)) $o['first_regent_term'] = $this->first_regent_term;
        if (isset($this->first_registered_date)) $o['first_registered_date'] = JsonConverters::to('DateTime', $this->first_registered_date);
        if (isset($this->last_registered_date)) $o['last_registered_date'] = JsonConverters::to('DateTime', $this->last_registered_date);
        if (isset($this->uuid)) $o['uuid'] = $this->uuid;
        if (isset($this->total_payments)) $o['total_payments'] = $this->total_payments;
        if (isset($this->total_charges)) $o['total_charges'] = $this->total_charges;
        if (isset($this->balance)) $o['balance'] = $this->balance;
        if (isset($this->gp_raw_balance)) $o['gp_raw_balance'] = $this->gp_raw_balance;
        if (isset($this->is_vendor)) $o['is_vendor'] = $this->is_vendor;
        if (isset($this->is_customer)) $o['is_customer'] = $this->is_customer;
        return empty($o) ? new class(){} : $o;
    }
}

class FinanceBalanceRequest implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $uuid=null
    ) {
    }

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

PHP FinanceBalanceRequest DTOs

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

HTTP + OTHER

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

POST /Finance/Balance/{uuid} HTTP/1.1 
Host: data.regent-college.edu 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"uuid":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}},"regent_id":0,"first_name":"String","last_name":"String","email":"String","current_program":"String","first_regent_term":"String","first_registered_date":"0001-01-01T00:00:00.0000000","last_registered_date":"0001-01-01T00:00:00.0000000","uuid":"String","total_payments":0,"total_charges":0,"balance":0,"gp_raw_balance":0,"is_vendor":false,"is_customer":false}