regis

<back to all web services

CRMTaxReceiptNoteRequest

Requires Authentication
Required role:REGISUserRole
The following routes are available for this service:
POST/DynamicsCRM/TaxReceipt/{guid}/Note
<?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 CRMNoteResponse implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $subject=null,
        /** @var string|null */
        public ?string $text=null,
        /** @var string|null */
        public ?string $owner_first_name=null,
        /** @var string|null */
        public ?string $owner_last_name=null,
        /** @var string|null */
        public ?string $file_base64=null,
        /** @var string|null */
        public ?string $filename=null,
        /** @var int */
        public int $filesize=0,
        /** @var string|null */
        public ?string $mimetype=null,
        /** @var DateTime|null */
        public ?DateTime $added_date=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['subject'])) $this->subject = $o['subject'];
        if (isset($o['text'])) $this->text = $o['text'];
        if (isset($o['owner_first_name'])) $this->owner_first_name = $o['owner_first_name'];
        if (isset($o['owner_last_name'])) $this->owner_last_name = $o['owner_last_name'];
        if (isset($o['file_base64'])) $this->file_base64 = $o['file_base64'];
        if (isset($o['filename'])) $this->filename = $o['filename'];
        if (isset($o['filesize'])) $this->filesize = $o['filesize'];
        if (isset($o['mimetype'])) $this->mimetype = $o['mimetype'];
        if (isset($o['added_date'])) $this->added_date = JsonConverters::from('DateTime', $o['added_date']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->subject)) $o['subject'] = $this->subject;
        if (isset($this->text)) $o['text'] = $this->text;
        if (isset($this->owner_first_name)) $o['owner_first_name'] = $this->owner_first_name;
        if (isset($this->owner_last_name)) $o['owner_last_name'] = $this->owner_last_name;
        if (isset($this->file_base64)) $o['file_base64'] = $this->file_base64;
        if (isset($this->filename)) $o['filename'] = $this->filename;
        if (isset($this->filesize)) $o['filesize'] = $this->filesize;
        if (isset($this->mimetype)) $o['mimetype'] = $this->mimetype;
        if (isset($this->added_date)) $o['added_date'] = JsonConverters::to('DateTime', $this->added_date);
        return empty($o) ? new class(){} : $o;
    }
}

class CRMTaxReceiptNoteResponse extends CRMNoteResponse implements JsonSerializable
{
    /**
     * @param string|null $subject
     * @param string|null $text
     * @param string|null $owner_first_name
     * @param string|null $owner_last_name
     * @param string|null $file_base64
     * @param string|null $filename
     * @param int $filesize
     * @param string|null $mimetype
     * @param DateTime|null $added_date
     */
    public function __construct(
        ?string $subject=null,
        ?string $text=null,
        ?string $owner_first_name=null,
        ?string $owner_last_name=null,
        ?string $file_base64=null,
        ?string $filename=null,
        int $filesize=0,
        ?string $mimetype=null,
        ?DateTime $added_date=null,
        /** @var string|null */
        public ?string $guid=null,
        /** @var string|null */
        public ?string $receipt_template_name=null,
        /** @var DateTime|null */
        public ?DateTime $receipt_sent_date=null,
        /** @var DateTime|null */
        public ?DateTime $receipt_email_sent_date=null,
        /** @var string|null */
        public ?string $receipt_email_sent_to=null,
        /** @var string|null */
        public ?string $salutation=null,
        /** @var string|null */
        public ?string $first_name=null,
        /** @var string|null */
        public ?string $last_name=null,
        /** @var string|null */
        public ?string $receipt_email=null
    ) {
        parent::__construct($subject,$text,$owner_first_name,$owner_last_name,$file_base64,$filename,$filesize,$mimetype,$added_date);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['guid'])) $this->guid = $o['guid'];
        if (isset($o['receipt_template_name'])) $this->receipt_template_name = $o['receipt_template_name'];
        if (isset($o['receipt_sent_date'])) $this->receipt_sent_date = JsonConverters::from('DateTime', $o['receipt_sent_date']);
        if (isset($o['receipt_email_sent_date'])) $this->receipt_email_sent_date = JsonConverters::from('DateTime', $o['receipt_email_sent_date']);
        if (isset($o['receipt_email_sent_to'])) $this->receipt_email_sent_to = $o['receipt_email_sent_to'];
        if (isset($o['salutation'])) $this->salutation = $o['salutation'];
        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['receipt_email'])) $this->receipt_email = $o['receipt_email'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->guid)) $o['guid'] = $this->guid;
        if (isset($this->receipt_template_name)) $o['receipt_template_name'] = $this->receipt_template_name;
        if (isset($this->receipt_sent_date)) $o['receipt_sent_date'] = JsonConverters::to('DateTime', $this->receipt_sent_date);
        if (isset($this->receipt_email_sent_date)) $o['receipt_email_sent_date'] = JsonConverters::to('DateTime', $this->receipt_email_sent_date);
        if (isset($this->receipt_email_sent_to)) $o['receipt_email_sent_to'] = $this->receipt_email_sent_to;
        if (isset($this->salutation)) $o['salutation'] = $this->salutation;
        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->receipt_email)) $o['receipt_email'] = $this->receipt_email;
        return empty($o) ? new class(){} : $o;
    }
}

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

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

PHP CRMTaxReceiptNoteRequest 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/TaxReceipt/{guid}/Note HTTP/1.1 
Host: data.regent-college.edu 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

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

<CRMTaxReceiptNoteResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/regis.DynamicsCRM.Responses">
  <added_date>0001-01-01T00:00:00</added_date>
  <file_base64>String</file_base64>
  <filename>String</filename>
  <filesize>0</filesize>
  <mimetype>String</mimetype>
  <owner_first_name>String</owner_first_name>
  <owner_last_name>String</owner_last_name>
  <subject>String</subject>
  <text>String</text>
  <first_name>String</first_name>
  <guid>String</guid>
  <last_name>String</last_name>
  <receipt_email>String</receipt_email>
  <receipt_email_sent_date>0001-01-01T00:00:00</receipt_email_sent_date>
  <receipt_email_sent_to>String</receipt_email_sent_to>
  <receipt_sent_date>0001-01-01T00:00:00</receipt_sent_date>
  <receipt_template_name>String</receipt_template_name>
  <salutation>String</salutation>
</CRMTaxReceiptNoteResponse>