Trendsic Platform Service

<back to all web services

AgentEventRegistrationRequest

Requires Authentication
Requires any of the roles:Agent, Administrator, Agent, Administrator
The following routes are available for this service:
GET,POST,OPTIONS/v1/AgentEventRegistration
<?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 AgentEventRegistration implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $AgentEventRegistrationId='',
        /** @var string */
        public string $EventRegistrationId='',
        /** @var string */
        public string $UserId='',
        /** @var int */
        public int $NumberAttending=0,
        /** @var float */
        public float $TotalCost=0.0,
        /** @var string|null */
        public ?string $StripeChargeId=null,
        /** @var DateTime */
        public DateTime $DateCreated=new DateTime()
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['AgentEventRegistrationId'])) $this->AgentEventRegistrationId = $o['AgentEventRegistrationId'];
        if (isset($o['EventRegistrationId'])) $this->EventRegistrationId = $o['EventRegistrationId'];
        if (isset($o['UserId'])) $this->UserId = $o['UserId'];
        if (isset($o['NumberAttending'])) $this->NumberAttending = $o['NumberAttending'];
        if (isset($o['TotalCost'])) $this->TotalCost = $o['TotalCost'];
        if (isset($o['StripeChargeId'])) $this->StripeChargeId = $o['StripeChargeId'];
        if (isset($o['DateCreated'])) $this->DateCreated = JsonConverters::from('DateTime', $o['DateCreated']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->AgentEventRegistrationId)) $o['AgentEventRegistrationId'] = $this->AgentEventRegistrationId;
        if (isset($this->EventRegistrationId)) $o['EventRegistrationId'] = $this->EventRegistrationId;
        if (isset($this->UserId)) $o['UserId'] = $this->UserId;
        if (isset($this->NumberAttending)) $o['NumberAttending'] = $this->NumberAttending;
        if (isset($this->TotalCost)) $o['TotalCost'] = $this->TotalCost;
        if (isset($this->StripeChargeId)) $o['StripeChargeId'] = $this->StripeChargeId;
        if (isset($this->DateCreated)) $o['DateCreated'] = JsonConverters::to('DateTime', $this->DateCreated);
        return empty($o) ? new class(){} : $o;
    }
}

class AgentEventRegistrationResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var array<AgentEventRegistration>|null */
        public ?array $AgentEventRegistration=null
    ) {
    }

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

class AgentEventRegistrationRequest implements JsonSerializable
{
    public function __construct(
        /** @var array<AgentEventRegistration>|null */
        public ?array $AgentEventRegistration=null,
        /** @var string|null */
        public ?string $StripeToken=null,
        /** @var string|null */
        public ?string $RegistrationDescription=null,
        /** @var string */
        public string $EventRegistrationId=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['AgentEventRegistration'])) $this->AgentEventRegistration = JsonConverters::fromArray('AgentEventRegistration', $o['AgentEventRegistration']);
        if (isset($o['StripeToken'])) $this->StripeToken = $o['StripeToken'];
        if (isset($o['RegistrationDescription'])) $this->RegistrationDescription = $o['RegistrationDescription'];
        if (isset($o['EventRegistrationId'])) $this->EventRegistrationId = $o['EventRegistrationId'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->AgentEventRegistration)) $o['AgentEventRegistration'] = JsonConverters::toArray('AgentEventRegistration', $this->AgentEventRegistration);
        if (isset($this->StripeToken)) $o['StripeToken'] = $this->StripeToken;
        if (isset($this->RegistrationDescription)) $o['RegistrationDescription'] = $this->RegistrationDescription;
        if (isset($this->EventRegistrationId)) $o['EventRegistrationId'] = $this->EventRegistrationId;
        return empty($o) ? new class(){} : $o;
    }
}

PHP AgentEventRegistrationRequest 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 /v1/AgentEventRegistration HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<AgentEventRegistrationRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <AgentEventRegistration>
    <AgentEventRegistration>
      <AgentEventRegistrationId>00000000-0000-0000-0000-000000000000</AgentEventRegistrationId>
      <DateCreated>0001-01-01T00:00:00</DateCreated>
      <EventRegistrationId>00000000-0000-0000-0000-000000000000</EventRegistrationId>
      <NumberAttending>0</NumberAttending>
      <StripeChargeId>String</StripeChargeId>
      <TotalCost>0</TotalCost>
      <UserId>00000000-0000-0000-0000-000000000000</UserId>
    </AgentEventRegistration>
  </AgentEventRegistration>
  <EventRegistrationId>00000000-0000-0000-0000-000000000000</EventRegistrationId>
  <RegistrationDescription>String</RegistrationDescription>
  <StripeToken>String</StripeToken>
</AgentEventRegistrationRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<AgentEventRegistrationResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <AgentEventRegistration>
    <AgentEventRegistration>
      <AgentEventRegistrationId>00000000-0000-0000-0000-000000000000</AgentEventRegistrationId>
      <DateCreated>0001-01-01T00:00:00</DateCreated>
      <EventRegistrationId>00000000-0000-0000-0000-000000000000</EventRegistrationId>
      <NumberAttending>0</NumberAttending>
      <StripeChargeId>String</StripeChargeId>
      <TotalCost>0</TotalCost>
      <UserId>00000000-0000-0000-0000-000000000000</UserId>
    </AgentEventRegistration>
  </AgentEventRegistration>
  <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>
</AgentEventRegistrationResponse>