| All Verbs | /api/json/reply/savemedia | ||
|---|---|---|---|
| All Verbs | /api/media | ||
| All Verbs | /api/media/userprofile |
<?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 SaveMediaResponse implements JsonSerializable
{
public function __construct(
/** @description Media File Guid */
// @ApiMember(DataType="Guid", Description="Media File Guid", Name="ErosMediaFileId", ParameterType="query")
/** @var string */
public string $ErosMediaFileId='',
/** @description Media File Name */
// @ApiMember(DataType="string", Description="Media File Name", Name="MediaName", ParameterType="query")
/** @var string|null */
public ?string $MediaName=null,
/** @description The original name of the media being saved. */
// @ApiMember(DataType="string", Description="The original name of the media being saved.", Name="OriginalFileName", ParameterType="query")
/** @var string|null */
public ?string $OriginalFileName=null,
/** @description Url of the media file. */
// @ApiMember(DataType="string", Description="Url of the media file.", Name="MediaFileUrl", ParameterType="query")
/** @var string|null */
public ?string $MediaFileUrl=null,
/** @description Url of the media file thumbnail. */
// @ApiMember(DataType="string", Description="Url of the media file thumbnail.", Name="MediaFileThumbnailUrl", ParameterType="query")
/** @var string|null */
public ?string $MediaFileThumbnailUrl=null,
/** @description Service Stack Response Status. */
// @ApiMember(DataType="ResponseStatus", Description="Service Stack Response Status.", Name="ResponseStatus", ParameterType="query")
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ErosMediaFileId'])) $this->ErosMediaFileId = $o['ErosMediaFileId'];
if (isset($o['MediaName'])) $this->MediaName = $o['MediaName'];
if (isset($o['OriginalFileName'])) $this->OriginalFileName = $o['OriginalFileName'];
if (isset($o['MediaFileUrl'])) $this->MediaFileUrl = $o['MediaFileUrl'];
if (isset($o['MediaFileThumbnailUrl'])) $this->MediaFileThumbnailUrl = $o['MediaFileThumbnailUrl'];
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ErosMediaFileId)) $o['ErosMediaFileId'] = $this->ErosMediaFileId;
if (isset($this->MediaName)) $o['MediaName'] = $this->MediaName;
if (isset($this->OriginalFileName)) $o['OriginalFileName'] = $this->OriginalFileName;
if (isset($this->MediaFileUrl)) $o['MediaFileUrl'] = $this->MediaFileUrl;
if (isset($this->MediaFileThumbnailUrl)) $o['MediaFileThumbnailUrl'] = $this->MediaFileThumbnailUrl;
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
return empty($o) ? new class(){} : $o;
}
}
class SaveMedia implements JsonSerializable
{
public function __construct(
/** @description The media file Id to use. */
// @ApiMember(DataType="Guid", Description="The media file Id to use.", Name="MediaFileId", ParameterType="query")
/** @var string */
public string $MediaFileId='',
/** @var string|null */
public ?string $MediaName=null,
/** @var DateTime */
public DateTime $MediaCaptured=new DateTime(),
/** @description The licensee's contact Id linked to the media file. */
// @ApiMember(DataType="Guid", Description="The licensee's contact Id linked to the media file.", IsRequired=true, Name="ContactId", ParameterType="query")
/** @var string */
public string $ContactId='',
/** @description The id of the session in which the media file was created. */
// @ApiMember(DataType="Guid", Description="The id of the session in which the media file was created.", IsRequired=true, Name="SessionId", ParameterType="query")
/** @var string */
public string $SessionId='',
/** @var string */
public string $ApplianceId='',
/** @var string|null */
public ?string $ContainerName=null,
/** @var int|null */
public ?int $ImageWidth=null,
/** @var int|null */
public ?int $ImageHeight=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['MediaFileId'])) $this->MediaFileId = $o['MediaFileId'];
if (isset($o['MediaName'])) $this->MediaName = $o['MediaName'];
if (isset($o['MediaCaptured'])) $this->MediaCaptured = JsonConverters::from('DateTime', $o['MediaCaptured']);
if (isset($o['ContactId'])) $this->ContactId = $o['ContactId'];
if (isset($o['SessionId'])) $this->SessionId = $o['SessionId'];
if (isset($o['ApplianceId'])) $this->ApplianceId = $o['ApplianceId'];
if (isset($o['ContainerName'])) $this->ContainerName = $o['ContainerName'];
if (isset($o['ImageWidth'])) $this->ImageWidth = $o['ImageWidth'];
if (isset($o['ImageHeight'])) $this->ImageHeight = $o['ImageHeight'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->MediaFileId)) $o['MediaFileId'] = $this->MediaFileId;
if (isset($this->MediaName)) $o['MediaName'] = $this->MediaName;
if (isset($this->MediaCaptured)) $o['MediaCaptured'] = JsonConverters::to('DateTime', $this->MediaCaptured);
if (isset($this->ContactId)) $o['ContactId'] = $this->ContactId;
if (isset($this->SessionId)) $o['SessionId'] = $this->SessionId;
if (isset($this->ApplianceId)) $o['ApplianceId'] = $this->ApplianceId;
if (isset($this->ContainerName)) $o['ContainerName'] = $this->ContainerName;
if (isset($this->ImageWidth)) $o['ImageWidth'] = $this->ImageWidth;
if (isset($this->ImageHeight)) $o['ImageHeight'] = $this->ImageHeight;
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /api/json/reply/savemedia HTTP/1.1
Host: pfapi.pstpf.com.au
Accept: application/json
Content-Type: application/json
Content-Length: length
{"MediaFileId":"00000000-0000-0000-0000-000000000000","MediaName":"String","MediaCaptured":"0001-01-01T00:00:00.0000000","ContactId":"00000000-0000-0000-0000-000000000000","SessionId":"00000000-0000-0000-0000-000000000000","ApplianceId":"00000000-0000-0000-0000-000000000000","ContainerName":"String","ImageWidth":0,"ImageHeight":0}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"ErosMediaFileId":"00000000-0000-0000-0000-000000000000","MediaName":"String","OriginalFileName":"String","MediaFileUrl":"String","MediaFileThumbnailUrl":"String","ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}