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 .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 /DynamicsCRM/TaxReceipts HTTP/1.1 
Host: data.regent-college.edu 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<CRMTaxReceiptsRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/regis.DynamicsCRM.Requests">
  <from_date>0001-01-01T00:00:00</from_date>
  <has_document>false</has_document>
  <regent_id>0</regent_id>
  <to_date>0001-01-01T00:00:00</to_date>
  <year>0</year>
</CRMTaxReceiptsRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CRMTaxReceiptsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/regis.DynamicsCRM.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>
  <from_date>0001-01-01T00:00:00</from_date>
  <tax_receipts>
    <CRMTaxReceiptResponse>
      <donor_first_name>String</donor_first_name>
      <donor_last_name>String</donor_last_name>
      <email_sent_date>0001-01-01T00:00:00</email_sent_date>
      <email_sent_to>String</email_sent_to>
      <gift_date>0001-01-01T00:00:00</gift_date>
      <guid>String</guid>
      <has_document>false</has_document>
      <is_annual>false</is_annual>
      <regent_id>0</regent_id>
      <sent_date>0001-01-01T00:00:00</sent_date>
      <status>String</status>
      <tax_receipt_email>String</tax_receipt_email>
      <tax_receipt_send_method>String</tax_receipt_send_method>
      <tax_receipt_template_guid>String</tax_receipt_template_guid>
      <tax_receipt_template_name>String</tax_receipt_template_name>
      <title>String</title>
      <total_paid_amount>0</total_paid_amount>
      <total_receipt_amount>0</total_receipt_amount>
      <year>0</year>
    </CRMTaxReceiptResponse>
  </tax_receipts>
  <to_date>0001-01-01T00:00:00</to_date>
</CRMTaxReceiptsResponse>