| All Verbs | /api/activityfeed/{ObjectId} |
|---|
<?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 ActivityFeedModel implements JsonSerializable
{
public function __construct(
/** @description Object linked to the event. */
// @ApiMember(DataType="Guid", Description="Object linked to the event.", IsRequired=true, Name="ObjectId")
/** @var string */
public string $ObjectId='',
/** @description Event Id */
// @ApiMember(DataType="Guid", Description="Event Id", IsRequired=true, Name="ActionEventId")
/** @var string */
public string $ActionEventId='',
/** @description Name of the object linked to the event. */
// @ApiMember(DataType="string", Description="Name of the object linked to the event.", Name="ObjectName")
/** @var string|null */
public ?string $ObjectName=null,
/** @description Event description */
// @ApiMember(DataType="string", Description="Event description", Name="ActionDescription")
/** @var string|null */
public ?string $ActionDescription=null,
/** @description Date of occurence of the event. */
// @ApiMember(DataType="DateTime", Description="Date of occurence of the event.", IsRequired=true, Name="OccurredDate")
/** @var DateTime */
public DateTime $OccurredDate=new DateTime(),
/** @description User, system or triggered */
// @ApiMember(DataType="Guid", Description="User, system or triggered", Name="AuditLevelId")
/** @var string */
public string $AuditLevelId='',
/** @description User, system or triggered */
// @ApiMember(DataType="string", Description="User, system or triggered", Name="AuditLevelName")
/** @var string|null */
public ?string $AuditLevelName=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ObjectId'])) $this->ObjectId = $o['ObjectId'];
if (isset($o['ActionEventId'])) $this->ActionEventId = $o['ActionEventId'];
if (isset($o['ObjectName'])) $this->ObjectName = $o['ObjectName'];
if (isset($o['ActionDescription'])) $this->ActionDescription = $o['ActionDescription'];
if (isset($o['OccurredDate'])) $this->OccurredDate = JsonConverters::from('DateTime', $o['OccurredDate']);
if (isset($o['AuditLevelId'])) $this->AuditLevelId = $o['AuditLevelId'];
if (isset($o['AuditLevelName'])) $this->AuditLevelName = $o['AuditLevelName'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ObjectId)) $o['ObjectId'] = $this->ObjectId;
if (isset($this->ActionEventId)) $o['ActionEventId'] = $this->ActionEventId;
if (isset($this->ObjectName)) $o['ObjectName'] = $this->ObjectName;
if (isset($this->ActionDescription)) $o['ActionDescription'] = $this->ActionDescription;
if (isset($this->OccurredDate)) $o['OccurredDate'] = JsonConverters::to('DateTime', $this->OccurredDate);
if (isset($this->AuditLevelId)) $o['AuditLevelId'] = $this->AuditLevelId;
if (isset($this->AuditLevelName)) $o['AuditLevelName'] = $this->AuditLevelName;
return empty($o) ? new class(){} : $o;
}
}
// @ApiResponse(Description="Activity feed related to the object.")
class GetActivityFeedResponse implements JsonSerializable
{
public function __construct(
/** @var array<ActivityFeedModel>|null */
public ?array $ActivityFeed=null,
/** @var int */
public int $TotalRecords=0,
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ActivityFeed'])) $this->ActivityFeed = JsonConverters::fromArray('ActivityFeedModel', $o['ActivityFeed']);
if (isset($o['TotalRecords'])) $this->TotalRecords = $o['TotalRecords'];
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ActivityFeed)) $o['ActivityFeed'] = JsonConverters::toArray('ActivityFeedModel', $this->ActivityFeed);
if (isset($this->TotalRecords)) $o['TotalRecords'] = $this->TotalRecords;
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
return empty($o) ? new class(){} : $o;
}
}
/** @description Get activity feed related to the specified object. */
// @Api(Description="Get activity feed related to the specified object.")
class GetActivityFeed implements JsonSerializable
{
public function __construct(
/** @description Object to get activity feed for. */
// @ApiMember(Description="Object to get activity feed for.", IsRequired=true, Name="ObjectId")
/** @var string */
public string $ObjectId='',
/** @description User, system or triggered. */
// @ApiMember(Description="User, system or triggered.", Name="ActivityFeedType")
/** @var array<string>|null */
public ?array $ActivityFeedType=null,
/** @description Return all feeds matching criteria or paged results? */
// @ApiMember(Description="Return all feeds matching criteria or paged results?", Name="IsPagedMode")
/** @var bool|null */
public ?bool $IsPagedMode=null,
/** @description Return feeds matching criteria on the specified page number if paged mode. */
// @ApiMember(Description="Return feeds matching criteria on the specified page number if paged mode.", Name="PageNumber")
/** @var int */
public int $PageNumber=0,
/** @description Number of feeds on each page if paged mode */
// @ApiMember(Description="Number of feeds on each page if paged mode", Name="PageSize")
/** @var int */
public int $PageSize=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ObjectId'])) $this->ObjectId = $o['ObjectId'];
if (isset($o['ActivityFeedType'])) $this->ActivityFeedType = JsonConverters::fromArray('Guid', $o['ActivityFeedType']);
if (isset($o['IsPagedMode'])) $this->IsPagedMode = $o['IsPagedMode'];
if (isset($o['PageNumber'])) $this->PageNumber = $o['PageNumber'];
if (isset($o['PageSize'])) $this->PageSize = $o['PageSize'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ObjectId)) $o['ObjectId'] = $this->ObjectId;
if (isset($this->ActivityFeedType)) $o['ActivityFeedType'] = JsonConverters::toArray('Guid', $this->ActivityFeedType);
if (isset($this->IsPagedMode)) $o['IsPagedMode'] = $this->IsPagedMode;
if (isset($this->PageNumber)) $o['PageNumber'] = $this->PageNumber;
if (isset($this->PageSize)) $o['PageSize'] = $this->PageSize;
return empty($o) ? new class(){} : $o;
}
}
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.
POST /api/activityfeed/{ObjectId} HTTP/1.1
Host: pfapi.pstpf.com.au
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<GetActivityFeed xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eros.Subtle.Canvara.WebAPIModel.ServiceModel">
<ActivityFeedType xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:guid>00000000-0000-0000-0000-000000000000</d2p1:guid>
</ActivityFeedType>
<IsPagedMode>false</IsPagedMode>
<ObjectId>00000000-0000-0000-0000-000000000000</ObjectId>
<PageNumber>0</PageNumber>
<PageSize>0</PageSize>
</GetActivityFeed>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<GetActivityFeedResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eros.Subtle.Canvara.WebAPIModel.ServiceModel">
<ActivityFeed xmlns:d2p1="http://schemas.datacontract.org/2004/07/Eros.Saguna.Common.WebAPIModel.Models">
<d2p1:ActivityFeedModel>
<d2p1:ActionDescription>String</d2p1:ActionDescription>
<d2p1:ActionEventId>00000000-0000-0000-0000-000000000000</d2p1:ActionEventId>
<d2p1:AuditLevelId>00000000-0000-0000-0000-000000000000</d2p1:AuditLevelId>
<d2p1:AuditLevelName>String</d2p1:AuditLevelName>
<d2p1:ObjectId>00000000-0000-0000-0000-000000000000</d2p1:ObjectId>
<d2p1:ObjectName>String</d2p1:ObjectName>
<d2p1:OccurredDate>0001-01-01T00:00:00</d2p1:OccurredDate>
</d2p1:ActivityFeedModel>
</ActivityFeed>
<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>
<TotalRecords>0</TotalRecords>
</GetActivityFeedResponse>