| GET | /api/automation/{AutomationId}/documentation |
|---|
<?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 AutomationModel implements JsonSerializable
{
public function __construct(
/** @description The unique automation Id */
// @ApiMember(Description="The unique automation Id", ParameterType="query")
/** @var string */
public string $AutomationId='',
/** @description The automation type Id */
// @ApiMember(Description="The automation type Id", ParameterType="query")
/** @var string */
public string $AutomationTypeId='',
/** @description The automation type */
// @ApiMember(Description="The automation type", ParameterType="query")
/** @var string|null */
public ?string $AutomationType=null,
/** @description The object this automation applies to */
// @ApiMember(Description="The object this automation applies to", ParameterType="query")
/** @var string */
public string $ObjectId='',
/** @description The object name this automation applies to */
// @ApiMember(Description="The object name this automation applies to", ParameterType="query")
/** @var string|null */
public ?string $ObjectName=null,
/** @description The Id of the object type that this automation applies to. */
// @ApiMember(Description="The Id of the object type that this automation applies to. ", ParameterType="query")
/** @var string */
public string $RmsTableCtxIdObject='',
/** @description The name of the object type that this automation applies to. */
// @ApiMember(Description="The name of the object type that this automation applies to.", ParameterType="query")
/** @var string|null */
public ?string $RmsTableCtxName=null,
/** @description A guid list containing the selected system action Id's that trigger this automation. */
// @ApiMember(Description="A guid list containing the selected system action Id's that trigger this automation.", ParameterType="query")
/** @var array<string>|null */
public ?array $ActionList=null,
/** @description A comma separated string of the selected system action names that trigger this automation. */
// @ApiMember(Description="A comma separated string of the selected system action names that trigger this automation.", ParameterType="query")
/** @var string|null */
public ?string $Actions=null,
/** @description Name of the automation. */
// @ApiMember(Description="Name of the automation.", ParameterType="query")
/** @var string|null */
public ?string $Name=null,
/** @description Description of the automation */
// @ApiMember(Description="Description of the automation", ParameterType="query")
/** @var string|null */
public ?string $Description=null,
/** @description Owner Contact Id */
// @ApiMember(Description="Owner Contact Id", ParameterType="query")
/** @var string */
public string $OwnerContactId='',
/** @description Record Status of the automation. */
// @ApiMember(Description="Record Status of the automation.", ParameterType="query")
/** @var string|null */
public ?string $RecordStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['AutomationId'])) $this->AutomationId = $o['AutomationId'];
if (isset($o['AutomationTypeId'])) $this->AutomationTypeId = $o['AutomationTypeId'];
if (isset($o['AutomationType'])) $this->AutomationType = $o['AutomationType'];
if (isset($o['ObjectId'])) $this->ObjectId = $o['ObjectId'];
if (isset($o['ObjectName'])) $this->ObjectName = $o['ObjectName'];
if (isset($o['RmsTableCtxIdObject'])) $this->RmsTableCtxIdObject = $o['RmsTableCtxIdObject'];
if (isset($o['RmsTableCtxName'])) $this->RmsTableCtxName = $o['RmsTableCtxName'];
if (isset($o['ActionList'])) $this->ActionList = JsonConverters::fromArray('Guid', $o['ActionList']);
if (isset($o['Actions'])) $this->Actions = $o['Actions'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Description'])) $this->Description = $o['Description'];
if (isset($o['OwnerContactId'])) $this->OwnerContactId = $o['OwnerContactId'];
if (isset($o['RecordStatus'])) $this->RecordStatus = $o['RecordStatus'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->AutomationId)) $o['AutomationId'] = $this->AutomationId;
if (isset($this->AutomationTypeId)) $o['AutomationTypeId'] = $this->AutomationTypeId;
if (isset($this->AutomationType)) $o['AutomationType'] = $this->AutomationType;
if (isset($this->ObjectId)) $o['ObjectId'] = $this->ObjectId;
if (isset($this->ObjectName)) $o['ObjectName'] = $this->ObjectName;
if (isset($this->RmsTableCtxIdObject)) $o['RmsTableCtxIdObject'] = $this->RmsTableCtxIdObject;
if (isset($this->RmsTableCtxName)) $o['RmsTableCtxName'] = $this->RmsTableCtxName;
if (isset($this->ActionList)) $o['ActionList'] = JsonConverters::toArray('Guid', $this->ActionList);
if (isset($this->Actions)) $o['Actions'] = $this->Actions;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Description)) $o['Description'] = $this->Description;
if (isset($this->OwnerContactId)) $o['OwnerContactId'] = $this->OwnerContactId;
if (isset($this->RecordStatus)) $o['RecordStatus'] = $this->RecordStatus;
return empty($o) ? new class(){} : $o;
}
}
class AutoDocumentationModel extends AutomationModel implements JsonSerializable
{
/**
* @param string $AutomationId
* @param string $AutomationTypeId
* @param string|null $AutomationType
* @param string $ObjectId
* @param string|null $ObjectName
* @param string $RmsTableCtxIdObject
* @param string|null $RmsTableCtxName
* @param array<string>|null $ActionList
* @param string|null $Actions
* @param string|null $Name
* @param string|null $Description
* @param string $OwnerContactId
* @param string|null $RecordStatus
*/
public function __construct(
string $AutomationId='',
string $AutomationTypeId='',
?string $AutomationType=null,
string $ObjectId='',
?string $ObjectName=null,
string $RmsTableCtxIdObject='',
?string $RmsTableCtxName=null,
?array $ActionList=null,
?string $Actions=null,
?string $Name=null,
?string $Description=null,
string $OwnerContactId='',
?string $RecordStatus=null,
/** @description Report Id */
// @ApiMember(Description="Report Id", ParameterType="query")
/** @var string */
public string $ReportId='',
/** @description Report Name */
// @ApiMember(Description="Report Name", ParameterType="query")
/** @var string|null */
public ?string $Report=null,
/** @description Document Type Id */
// @ApiMember(Description="Document Type Id", ParameterType="query")
/** @var string */
public string $DocumentTypeId='',
/** @description Document Type */
// @ApiMember(Description="Document Type", ParameterType="query")
/** @var string|null */
public ?string $DocumentType=null,
/** @description Document Status Id */
// @ApiMember(Description="Document Status Id", ParameterType="query")
/** @var string */
public string $DocumentStatusId='',
/** @description The Document Status */
// @ApiMember(Description="The Document Status", ParameterType="query")
/** @var string|null */
public ?string $DocumentStatus=null
) {
parent::__construct($AutomationId,$AutomationTypeId,$AutomationType,$ObjectId,$ObjectName,$RmsTableCtxIdObject,$RmsTableCtxName,$ActionList,$Actions,$Name,$Description,$OwnerContactId,$RecordStatus);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['ReportId'])) $this->ReportId = $o['ReportId'];
if (isset($o['Report'])) $this->Report = $o['Report'];
if (isset($o['DocumentTypeId'])) $this->DocumentTypeId = $o['DocumentTypeId'];
if (isset($o['DocumentType'])) $this->DocumentType = $o['DocumentType'];
if (isset($o['DocumentStatusId'])) $this->DocumentStatusId = $o['DocumentStatusId'];
if (isset($o['DocumentStatus'])) $this->DocumentStatus = $o['DocumentStatus'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->ReportId)) $o['ReportId'] = $this->ReportId;
if (isset($this->Report)) $o['Report'] = $this->Report;
if (isset($this->DocumentTypeId)) $o['DocumentTypeId'] = $this->DocumentTypeId;
if (isset($this->DocumentType)) $o['DocumentType'] = $this->DocumentType;
if (isset($this->DocumentStatusId)) $o['DocumentStatusId'] = $this->DocumentStatusId;
if (isset($this->DocumentStatus)) $o['DocumentStatus'] = $this->DocumentStatus;
return empty($o) ? new class(){} : $o;
}
}
// @ApiResponse(Description="Returns a documentation automation")
class GetDocumentationAutomationResponse implements JsonSerializable
{
public function __construct(
/** @description Documentation Automation */
// @ApiMember(Description="Documentation Automation")
/** @var AutoDocumentationModel|null */
public ?AutoDocumentationModel $Automation=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Automation'])) $this->Automation = JsonConverters::from('AutoDocumentationModel', $o['Automation']);
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Automation)) $o['Automation'] = JsonConverters::to('AutoDocumentationModel', $this->Automation);
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
return empty($o) ? new class(){} : $o;
}
}
/** @description Get details of a specific documentation automation */
// @Api(Description="Get details of a specific documentation automation")
class GetDocumentationAutomation implements JsonSerializable
{
public function __construct(
/** @description Automation Id. */
// @ApiMember(Description="Automation Id.", ParameterType="path")
/** @var string */
public string $AutomationId=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['AutomationId'])) $this->AutomationId = $o['AutomationId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->AutomationId)) $o['AutomationId'] = $this->AutomationId;
return empty($o) ? new class(){} : $o;
}
}
PHP GetDocumentationAutomation DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /api/automation/{AutomationId}/documentation HTTP/1.1
Host: pfapi.pstpf.com.au
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<GetDocumentationAutomationResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eros.Subtle.Canvara.WebAPIModel.ServiceModel">
<Automation xmlns:d2p1="http://schemas.datacontract.org/2004/07/Eros.Saguna.Common.WebAPIModel.Models">
<d2p1:ActionList xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:guid>00000000-0000-0000-0000-000000000000</d3p1:guid>
</d2p1:ActionList>
<d2p1:Actions>String</d2p1:Actions>
<d2p1:AutomationId>00000000-0000-0000-0000-000000000000</d2p1:AutomationId>
<d2p1:AutomationType>String</d2p1:AutomationType>
<d2p1:AutomationTypeId>00000000-0000-0000-0000-000000000000</d2p1:AutomationTypeId>
<d2p1:Description>String</d2p1:Description>
<d2p1:Name>String</d2p1:Name>
<d2p1:ObjectId>00000000-0000-0000-0000-000000000000</d2p1:ObjectId>
<d2p1:ObjectName>String</d2p1:ObjectName>
<d2p1:OwnerContactId>00000000-0000-0000-0000-000000000000</d2p1:OwnerContactId>
<d2p1:RecordStatus>String</d2p1:RecordStatus>
<d2p1:RmsTableCtxIdObject>00000000-0000-0000-0000-000000000000</d2p1:RmsTableCtxIdObject>
<d2p1:RmsTableCtxName>String</d2p1:RmsTableCtxName>
<d2p1:DocumentStatus>String</d2p1:DocumentStatus>
<d2p1:DocumentStatusId>00000000-0000-0000-0000-000000000000</d2p1:DocumentStatusId>
<d2p1:DocumentType>String</d2p1:DocumentType>
<d2p1:DocumentTypeId>00000000-0000-0000-0000-000000000000</d2p1:DocumentTypeId>
<d2p1:Report>String</d2p1:Report>
<d2p1:ReportId>00000000-0000-0000-0000-000000000000</d2p1:ReportId>
</Automation>
<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>
</GetDocumentationAutomationResponse>