regis

<back to all web services

CRMDonationNoteRequest

Requires Authentication
Required role:REGISUserRole
The following routes are available for this service:
POST/DynamicsCRM/Donation/{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 CRMDonationNoteResponse 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 $first_name=null,
        /** @var string|null */
        public ?string $last_name=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['first_name'])) $this->first_name = $o['first_name'];
        if (isset($o['last_name'])) $this->last_name = $o['last_name'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->first_name)) $o['first_name'] = $this->first_name;
        if (isset($this->last_name)) $o['last_name'] = $this->last_name;
        return empty($o) ? new class(){} : $o;
    }
}

class CRMDonationNoteRequest 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 CRMDonationNoteRequest DTOs

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

HTTP + CSV

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

POST /DynamicsCRM/Donation/{guid}/Note HTTP/1.1 
Host: data.regent-college.edu 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

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

{"first_name":"String","last_name":"String","subject":"String","text":"String","owner_first_name":"String","owner_last_name":"String","file_base64":"String","filename":"String","filesize":0,"mimetype":"String","added_date":"0001-01-01T00:00:00.0000000"}