| DELETE | /api/media | ||
|---|---|---|---|
| DELETE | /api/attachments |
<?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 DeleteMediaResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
return empty($o) ? new class(){} : $o;
}
}
class DeleteMedia implements JsonSerializable
{
public function __construct(
/** @description Guid of the Media File to be deleted. */
// @ApiMember(DataType="Guid", Description="Guid of the Media File to be deleted.", IsRequired=true, Name="MediaFileId")
/** @var string */
public string $MediaFileId='',
/** @description File Name to be deleted. */
// @ApiMember(DataType="string", Description="File Name to be deleted.", IsRequired=true, Name="FileName")
/** @var string */
public string $FileName='',
/** @description Appliance from which media file is to be deleted. */
// @ApiMember(DataType="Guid", Description="Appliance from which media file is to be deleted.", IsRequired=true, Name="ApplianceId")
/** @var string */
public string $ApplianceId='',
/** @description Container from which media file is to be deleted. Defaults to 'attachments' container for attachments. */
// @ApiMember(DataType="string", Description="Container from which media file is to be deleted. Defaults to 'attachments' container for attachments.", IsRequired=true, Name="ContainerName")
/** @var string */
public string $ContainerName='',
/** @description Object connected to the attachment being deleted. */
// @ApiMember(DataType="Guid", Description="Object connected to the attachment being deleted.", IsRequired=true, Name="ConnectedObjectId")
/** @var string */
public string $ConnectedObjectId='',
/** @description Licensee Id of the Object owner for which primary image is to be uploaded. */
// @ApiMember(DataType="Guid", Description="Licensee Id of the Object owner for which primary image is to be uploaded.", IsRequired=true, Name="ConnectedObjectLicenseeId")
/** @var string */
public string $ConnectedObjectLicenseeId='',
/** @description Is the media file being deleted the primary file linked to the object?. */
// @ApiMember(DataType="bool", Description="Is the media file being deleted the primary file linked to the object?.", Name="IsPrimary")
/** @var bool|null */
public ?bool $IsPrimary=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['MediaFileId'])) $this->MediaFileId = $o['MediaFileId'];
if (isset($o['FileName'])) $this->FileName = $o['FileName'];
if (isset($o['ApplianceId'])) $this->ApplianceId = $o['ApplianceId'];
if (isset($o['ContainerName'])) $this->ContainerName = $o['ContainerName'];
if (isset($o['ConnectedObjectId'])) $this->ConnectedObjectId = $o['ConnectedObjectId'];
if (isset($o['ConnectedObjectLicenseeId'])) $this->ConnectedObjectLicenseeId = $o['ConnectedObjectLicenseeId'];
if (isset($o['IsPrimary'])) $this->IsPrimary = $o['IsPrimary'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->MediaFileId)) $o['MediaFileId'] = $this->MediaFileId;
if (isset($this->FileName)) $o['FileName'] = $this->FileName;
if (isset($this->ApplianceId)) $o['ApplianceId'] = $this->ApplianceId;
if (isset($this->ContainerName)) $o['ContainerName'] = $this->ContainerName;
if (isset($this->ConnectedObjectId)) $o['ConnectedObjectId'] = $this->ConnectedObjectId;
if (isset($this->ConnectedObjectLicenseeId)) $o['ConnectedObjectLicenseeId'] = $this->ConnectedObjectLicenseeId;
if (isset($this->IsPrimary)) $o['IsPrimary'] = $this->IsPrimary;
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.
DELETE /api/media HTTP/1.1 Host: pfapi.pstpf.com.au Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}