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 .xml suffix or ?format=xml

HTTP + XML

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: application/xml
Content-Type: application/xml
Content-Length: length

<FinanceBalanceRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/regis.ClassLibrary.Requests">
  <uuid>String</uuid>
</FinanceBalanceRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<FinanceBalanceResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/regis.ClassLibrary.Responses">
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
        <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </d2p1:Meta>
      </d2p1:ResponseError>
    </d2p1:Errors>
    <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </d2p1:Meta>
  </ResponseStatus>
  <balance>0</balance>
  <current_program>String</current_program>
  <email>String</email>
  <first_name>String</first_name>
  <first_regent_term>String</first_regent_term>
  <first_registered_date>0001-01-01T00:00:00</first_registered_date>
  <gp_raw_balance>0</gp_raw_balance>
  <is_customer>false</is_customer>
  <is_vendor>false</is_vendor>
  <last_name>String</last_name>
  <last_registered_date>0001-01-01T00:00:00</last_registered_date>
  <regent_id>0</regent_id>
  <total_charges>0</total_charges>
  <total_payments>0</total_payments>
  <uuid>String</uuid>
</FinanceBalanceResponse>