DigiOffice API Services Services

<back to all web services

EmailSentNotification

The following routes are available for this service:
All Verbs/api/Outlook/EmailSentNotification
<?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};


// @Flags()
enum RequestAttributes : int
{
    case None = 0;
    case Localhost = 1;
    case LocalSubnet = 2;
    case External = 4;
    case Secure = 8;
    case InSecure = 16;
    case AnySecurityMode = 24;
    case HttpHead = 32;
    case HttpGet = 64;
    case HttpPost = 128;
    case HttpPut = 256;
    case HttpDelete = 512;
    case HttpPatch = 1024;
    case HttpOptions = 2048;
    case HttpOther = 4096;
    case AnyHttpMethod = 8160;
    case OneWay = 8192;
    case Reply = 16384;
    case AnyCallStyle = 24576;
    case Soap11 = 32768;
    case Soap12 = 65536;
    case Xml = 131072;
    case Json = 262144;
    case Jsv = 524288;
    case ProtoBuf = 1048576;
    case Csv = 2097152;
    case Html = 4194304;
    case Jsonl = 8388608;
    case MsgPack = 16777216;
    case FormatOther = 33554432;
    case AnyFormat = 67076096;
    case Http = 67108864;
    case MessageQueue = 134217728;
    case Tcp = 268435456;
    case Grpc = 536870912;
    case EndpointOther = 1073741824;
    case AnyEndpoint = 2080374784;
    case InProcess = -2147483648;
    case InternalNetworkAccess = -2147483645;
    case AnyNetworkAccessType = -2147483641;
    case Any = -1;
}

/**
 * @property bool $AcceptsBrotli
 * @property bool $AcceptsDeflate
 * @property bool $AcceptsGzip
 */
interface IRequestPreferences
{
}

/**
 * @property string|null $Name
 * @property string|null $FileName
 * @property int $ContentLength
 * @property string|null $ContentType
 * @property ByteArray|null $InputStream
 */
interface IHttpFile
{
}

/**
 * @property Object|null $OriginalRequest
 * @property IResponse|null $Response
 * @property string|null $OperationName
 * @property string|null $Verb
 * @property RequestAttributes $RequestAttributes
 * @property IRequestPreferences|null $RequestPreferences
 * @property Object|null $Dto
 * @property string|null $ContentType
 * @property bool $IsLocal
 * @property string|null $UserAgent
 * @property array<string,Cookie>|null $Cookies
 * @property string|null $ResponseContentType
 * @property bool $HasExplicitResponseContentType
 * @property array<string,Object>|null $Items
 * @property NameValueCollection|null $Headers
 * @property NameValueCollection|null $QueryString
 * @property NameValueCollection|null $FormData
 * @property bool $UseBufferedStream
 * @property string|null $RawUrl
 * @property string|null $AbsoluteUri
 * @property string|null $UserHostAddress
 * @property string|null $RemoteIp
 * @property string|null $Authorization
 * @property bool $IsSecureConnection
 * @property string[]|null $AcceptTypes
 * @property string|null $PathInfo
 * @property string|null $OriginalPathInfo
 * @property ByteArray|null $InputStream
 * @property int $ContentLength
 * @property IHttpFile[]|null $Files
 * @property string|null $UrlReferrer
 */
interface IRequest
{
}

/**
 * @property Object|null $OriginalResponse
 * @property IRequest|null $Request
 * @property int $StatusCode
 * @property string|null $StatusDescription
 * @property string|null $ContentType
 * @property ByteArray|null $OutputStream
 * @property Object|null $Dto
 * @property bool $UseBufferedStream
 * @property bool $IsClosed
 * @property bool $KeepAlive
 * @property bool $HasStarted
 * @property array<string,Object>|null $Items
 */
interface IResponse
{
}

// @DataContract
class ResourceData implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="@odata.etag")
        /** @var string|null */
        public ?string $_odata_etag=null,

        // @DataMember(Name="@odata.id")
        /** @var string|null */
        public ?string $_odata_id=null,

        // @DataMember(Name="@odata.type")
        /** @var string|null */
        public ?string $_odata_type=null,

        // @DataMember(Name="id")
        /** @var string|null */
        public ?string $id=null
    ) {
    }

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

class NotificationData implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $ChangeType=null,
        /** @var string|null */
        public ?string $ClientState=null,
        /** @var string|null */
        public ?string $Resource=null,
        /** @var ResourceData|null */
        public ?ResourceData $ResourceData=null,
        /** @var DateTime */
        public DateTime $SubscriptionExpirationDateTime=new DateTime(),
        /** @var string|null */
        public ?string $SubscriptionId=null,
        /** @var string|null */
        public ?string $TenantId=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ChangeType'])) $this->ChangeType = $o['ChangeType'];
        if (isset($o['ClientState'])) $this->ClientState = $o['ClientState'];
        if (isset($o['Resource'])) $this->Resource = $o['Resource'];
        if (isset($o['ResourceData'])) $this->ResourceData = JsonConverters::from('ResourceData', $o['ResourceData']);
        if (isset($o['SubscriptionExpirationDateTime'])) $this->SubscriptionExpirationDateTime = JsonConverters::from('DateTime', $o['SubscriptionExpirationDateTime']);
        if (isset($o['SubscriptionId'])) $this->SubscriptionId = $o['SubscriptionId'];
        if (isset($o['TenantId'])) $this->TenantId = $o['TenantId'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ChangeType)) $o['ChangeType'] = $this->ChangeType;
        if (isset($this->ClientState)) $o['ClientState'] = $this->ClientState;
        if (isset($this->Resource)) $o['Resource'] = $this->Resource;
        if (isset($this->ResourceData)) $o['ResourceData'] = JsonConverters::to('ResourceData', $this->ResourceData);
        if (isset($this->SubscriptionExpirationDateTime)) $o['SubscriptionExpirationDateTime'] = JsonConverters::to('DateTime', $this->SubscriptionExpirationDateTime);
        if (isset($this->SubscriptionId)) $o['SubscriptionId'] = $this->SubscriptionId;
        if (isset($this->TenantId)) $o['TenantId'] = $this->TenantId;
        return empty($o) ? new class(){} : $o;
    }
}

class EmailSentNotification implements JsonSerializable
{
    public function __construct(
        /** @var array<NotificationData>|null */
        public ?array $Value=null
    ) {
    }

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

PHP EmailSentNotification DTOs

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

HTTP + OTHER

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

POST /api/Outlook/EmailSentNotification HTTP/1.1 
Host: test-do-services.klokgroep.nl 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"Value":[{"ChangeType":"String","ClientState":"String","Resource":"String","ResourceData":{"@odata.etag":"String","@odata.id":"String","@odata.type":"String","id":"String"},"SubscriptionExpirationDateTime":"0001-01-01T00:00:00.0000000","SubscriptionId":"String","TenantId":"String"}]}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{Unable to show example output for type 'IResponse' using the custom 'other' filter}Cannot create an abstract class.