regis

<back to all web services

CRMTaxReceiptsRequest

Requires Authentication
Required role:REGISUserRole
The following routes are available for this service:
POST/DynamicsCRM/TaxReceipts
POST/DynamicsCRM/TaxReceipts/{regent_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 CRMTaxReceiptResponse implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $regent_id=0,
        /** @var string|null */
        public ?string $donor_first_name=null,
        /** @var string|null */
        public ?string $donor_last_name=null,
        /** @var string|null */
        public ?string $guid=null,
        /** @var string|null */
        public ?string $title=null,
        /** @var float */
        public float $total_paid_amount=0.0,
        /** @var float */
        public float $total_receipt_amount=0.0,
        /** @var bool|null */
        public ?bool $is_annual=null,
        /** @var int|null */
        public ?int $year=null,
        /** @var bool|null */
        public ?bool $has_document=null,
        /** @var string|null */
        public ?string $tax_receipt_send_method=null,
        /** @var string|null */
        public ?string $status=null,
        /** @var string|null */
        public ?string $tax_receipt_template_guid=null,
        /** @var string|null */
        public ?string $tax_receipt_template_name=null,
        /** @var string|null */
        public ?string $tax_receipt_email=null,
        /** @var DateTime|null */
        public ?DateTime $email_sent_date=null,
        /** @var string|null */
        public ?string $email_sent_to=null,
        /** @var DateTime|null */
        public ?DateTime $gift_date=null,
        /** @var DateTime|null */
        public ?DateTime $sent_date=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['regent_id'])) $this->regent_id = $o['regent_id'];
        if (isset($o['donor_first_name'])) $this->donor_first_name = $o['donor_first_name'];
        if (isset($o['donor_last_name'])) $this->donor_last_name = $o['donor_last_name'];
        if (isset($o['guid'])) $this->guid = $o['guid'];
        if (isset($o['title'])) $this->title = $o['title'];
        if (isset($o['total_paid_amount'])) $this->total_paid_amount = $o['total_paid_amount'];
        if (isset($o['total_receipt_amount'])) $this->total_receipt_amount = $o['total_receipt_amount'];
        if (isset($o['is_annual'])) $this->is_annual = $o['is_annual'];
        if (isset($o['year'])) $this->year = $o['year'];
        if (isset($o['has_document'])) $this->has_document = $o['has_document'];
        if (isset($o['tax_receipt_send_method'])) $this->tax_receipt_send_method = $o['tax_receipt_send_method'];
        if (isset($o['status'])) $this->status = $o['status'];
        if (isset($o['tax_receipt_template_guid'])) $this->tax_receipt_template_guid = $o['tax_receipt_template_guid'];
        if (isset($o['tax_receipt_template_name'])) $this->tax_receipt_template_name = $o['tax_receipt_template_name'];
        if (isset($o['tax_receipt_email'])) $this->tax_receipt_email = $o['tax_receipt_email'];
        if (isset($o['email_sent_date'])) $this->email_sent_date = JsonConverters::from('DateTime', $o['email_sent_date']);
        if (isset($o['email_sent_to'])) $this->email_sent_to = $o['email_sent_to'];
        if (isset($o['gift_date'])) $this->gift_date = JsonConverters::from('DateTime', $o['gift_date']);
        if (isset($o['sent_date'])) $this->sent_date = JsonConverters::from('DateTime', $o['sent_date']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->regent_id)) $o['regent_id'] = $this->regent_id;
        if (isset($this->donor_first_name)) $o['donor_first_name'] = $this->donor_first_name;
        if (isset($this->donor_last_name)) $o['donor_last_name'] = $this->donor_last_name;
        if (isset($this->guid)) $o['guid'] = $this->guid;
        if (isset($this->title)) $o['title'] = $this->title;
        if (isset($this->total_paid_amount)) $o['total_paid_amount'] = $this->total_paid_amount;
        if (isset($this->total_receipt_amount)) $o['total_receipt_amount'] = $this->total_receipt_amount;
        if (isset($this->is_annual)) $o['is_annual'] = $this->is_annual;
        if (isset($this->year)) $o['year'] = $this->year;
        if (isset($this->has_document)) $o['has_document'] = $this->has_document;
        if (isset($this->tax_receipt_send_method)) $o['tax_receipt_send_method'] = $this->tax_receipt_send_method;
        if (isset($this->status)) $o['status'] = $this->status;
        if (isset($this->tax_receipt_template_guid)) $o['tax_receipt_template_guid'] = $this->tax_receipt_template_guid;
        if (isset($this->tax_receipt_template_name)) $o['tax_receipt_template_name'] = $this->tax_receipt_template_name;
        if (isset($this->tax_receipt_email)) $o['tax_receipt_email'] = $this->tax_receipt_email;
        if (isset($this->email_sent_date)) $o['email_sent_date'] = JsonConverters::to('DateTime', $this->email_sent_date);
        if (isset($this->email_sent_to)) $o['email_sent_to'] = $this->email_sent_to;
        if (isset($this->gift_date)) $o['gift_date'] = JsonConverters::to('DateTime', $this->gift_date);
        if (isset($this->sent_date)) $o['sent_date'] = JsonConverters::to('DateTime', $this->sent_date);
        return empty($o) ? new class(){} : $o;
    }
}

class CRMTaxReceiptsResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $responseStatus=null,
        /** @var array<CRMTaxReceiptResponse>|null */
        public ?array $tax_receipts=null,
        /** @var DateTime|null */
        public ?DateTime $from_date=null,
        /** @var DateTime|null */
        public ?DateTime $to_date=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
        if (isset($o['tax_receipts'])) $this->tax_receipts = JsonConverters::fromArray('CRMTaxReceiptResponse', $o['tax_receipts']);
        if (isset($o['from_date'])) $this->from_date = JsonConverters::from('DateTime', $o['from_date']);
        if (isset($o['to_date'])) $this->to_date = JsonConverters::from('DateTime', $o['to_date']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
        if (isset($this->tax_receipts)) $o['tax_receipts'] = JsonConverters::toArray('CRMTaxReceiptResponse', $this->tax_receipts);
        if (isset($this->from_date)) $o['from_date'] = JsonConverters::to('DateTime', $this->from_date);
        if (isset($this->to_date)) $o['to_date'] = JsonConverters::to('DateTime', $this->to_date);
        return empty($o) ? new class(){} : $o;
    }
}

class CRMTaxReceiptsRequest implements JsonSerializable
{
    public function __construct(
        /** @var int|null */
        public ?int $regent_id=null,
        /** @var DateTime|null */
        public ?DateTime $from_date=null,
        /** @var DateTime|null */
        public ?DateTime $to_date=null,
        /** @var bool|null */
        public ?bool $has_document=null,
        /** @var int|null */
        public ?int $year=null
    ) {
    }

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

PHP CRMTaxReceiptsRequest DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

POST /DynamicsCRM/TaxReceipts HTTP/1.1 
Host: data.regent-college.edu 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"regent_id":0,"from_date":"0001-01-01T00:00:00.0000000","to_date":"0001-01-01T00:00:00.0000000","has_document":false,"year":0}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}},"tax_receipts":[{"regent_id":0,"donor_first_name":"String","donor_last_name":"String","guid":"String","title":"String","total_paid_amount":0,"total_receipt_amount":0,"is_annual":false,"year":0,"has_document":false,"tax_receipt_send_method":"String","status":"String","tax_receipt_template_guid":"String","tax_receipt_template_name":"String","tax_receipt_email":"String","email_sent_date":"0001-01-01T00:00:00.0000000","email_sent_to":"String","gift_date":"0001-01-01T00:00:00.0000000","sent_date":"0001-01-01T00:00:00.0000000"}],"from_date":"0001-01-01T00:00:00.0000000","to_date":"0001-01-01T00:00:00.0000000"}