| All Verbs | /api/contactroles/{LicenseeId} |
|---|
<?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 RoleModel implements JsonSerializable
{
public function __construct(
/** @description Role Id */
// @ApiMember(DataType="Guid", Description="Role Id", IsRequired=true, Name="RoleId")
/** @var string */
public string $RoleId='',
/** @description Role Name */
// @ApiMember(DataType="string", Description="Role Name", Name="RoleName")
/** @var string|null */
public ?string $RoleName=null,
/** @description Is the role a licensee role? */
// @ApiMember(DataType="bool", Description="Is the role a licensee role?", Name="IsLicensee")
/** @var bool|null */
public ?bool $IsLicenseeRole=null,
/** @description Is manage contacts role? */
// @ApiMember(DataType="bool", Description="Is manage contacts role?", Name="IsManageContacts")
/** @var bool|null */
public ?bool $IsManageContacts=null,
/** @description Is the role a Platform role? */
// @ApiMember(DataType="bool", Description="Is the role a Platform role?", Name="IsPlatformRole")
/** @var bool|null */
public ?bool $IsPlatformRole=null,
/** @description Is the role a services role? */
// @ApiMember(DataType="bool", Description="Is the role a services role?", Name="IsServiceRole")
/** @var bool|null */
public ?bool $IsServiceRole=null,
/** @description Is the role a customer role? */
// @ApiMember(DataType="bool", Description="Is the role a customer role?", Name="IsCustomerRole")
/** @var bool|null */
public ?bool $IsCustomerRole=null,
/** @description Is the role a functional role? */
// @ApiMember(DataType="bool", Description="Is the role a functional role?", Name="IsFunctionalRole")
/** @var bool|null */
public ?bool $IsFunctionalRole=null,
/** @description Is the role an auto-accept role? */
// @ApiMember(DataType="bool", Description="Is the role an auto-accept role?", Name="IsRequestAutoAccepted")
/** @var bool|null */
public ?bool $IsRequestAutoAccepted=null,
/** @description Suite that the role belongs to */
// @ApiMember(DataType="Guid", Description="Suite that the role belongs to", Name="SuiteId")
/** @var string */
public string $SuiteId='',
/** @description Suite that the role belongs to */
// @ApiMember(DataType="string", Description="Suite that the role belongs to", Name="SuiteName")
/** @var string|null */
public ?string $SuiteName=null,
/** @description 'A' (Active) or 'I' (Inactive) */
// @ApiMember(DataType="string", Description="'A' (Active) or 'I' (Inactive)", Name="RecordStatus")
/** @var string|null */
public ?string $RecordStatus=null,
/** @description Object Connection Id, which is populated when the roles are returned based on those that are connected to an object. */
// @ApiMember(DataType="Guid", Description="Object Connection Id, which is populated when the roles are returned based on those that are connected to an object.", Name="ObjectConnectionId")
/** @var string */
public string $ObjectConnectionId=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['RoleId'])) $this->RoleId = $o['RoleId'];
if (isset($o['RoleName'])) $this->RoleName = $o['RoleName'];
if (isset($o['IsLicenseeRole'])) $this->IsLicenseeRole = $o['IsLicenseeRole'];
if (isset($o['IsManageContacts'])) $this->IsManageContacts = $o['IsManageContacts'];
if (isset($o['IsPlatformRole'])) $this->IsPlatformRole = $o['IsPlatformRole'];
if (isset($o['IsServiceRole'])) $this->IsServiceRole = $o['IsServiceRole'];
if (isset($o['IsCustomerRole'])) $this->IsCustomerRole = $o['IsCustomerRole'];
if (isset($o['IsFunctionalRole'])) $this->IsFunctionalRole = $o['IsFunctionalRole'];
if (isset($o['IsRequestAutoAccepted'])) $this->IsRequestAutoAccepted = $o['IsRequestAutoAccepted'];
if (isset($o['SuiteId'])) $this->SuiteId = $o['SuiteId'];
if (isset($o['SuiteName'])) $this->SuiteName = $o['SuiteName'];
if (isset($o['RecordStatus'])) $this->RecordStatus = $o['RecordStatus'];
if (isset($o['ObjectConnectionId'])) $this->ObjectConnectionId = $o['ObjectConnectionId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->RoleId)) $o['RoleId'] = $this->RoleId;
if (isset($this->RoleName)) $o['RoleName'] = $this->RoleName;
if (isset($this->IsLicenseeRole)) $o['IsLicenseeRole'] = $this->IsLicenseeRole;
if (isset($this->IsManageContacts)) $o['IsManageContacts'] = $this->IsManageContacts;
if (isset($this->IsPlatformRole)) $o['IsPlatformRole'] = $this->IsPlatformRole;
if (isset($this->IsServiceRole)) $o['IsServiceRole'] = $this->IsServiceRole;
if (isset($this->IsCustomerRole)) $o['IsCustomerRole'] = $this->IsCustomerRole;
if (isset($this->IsFunctionalRole)) $o['IsFunctionalRole'] = $this->IsFunctionalRole;
if (isset($this->IsRequestAutoAccepted)) $o['IsRequestAutoAccepted'] = $this->IsRequestAutoAccepted;
if (isset($this->SuiteId)) $o['SuiteId'] = $this->SuiteId;
if (isset($this->SuiteName)) $o['SuiteName'] = $this->SuiteName;
if (isset($this->RecordStatus)) $o['RecordStatus'] = $this->RecordStatus;
if (isset($this->ObjectConnectionId)) $o['ObjectConnectionId'] = $this->ObjectConnectionId;
return empty($o) ? new class(){} : $o;
}
}
// @ApiResponse(Description="List of contact roles (custom and/or standard) for the specified licensee")
class GetContactRolesForLicenseeResponse implements JsonSerializable
{
public function __construct(
/** @var array<RoleModel>|null */
public ?array $Roles=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Roles'])) $this->Roles = JsonConverters::fromArray('RoleModel', $o['Roles']);
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Roles)) $o['Roles'] = JsonConverters::toArray('RoleModel', $this->Roles);
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
return empty($o) ? new class(){} : $o;
}
}
/** @description Get contact roles (custom and/or standard) for the specified licensee */
// @Api(Description="Get contact roles (custom and/or standard) for the specified licensee")
class GetContactRolesForLicensee implements JsonSerializable
{
public function __construct(
/** @description Get contact roles (custom and/or standard) for the specified licensee */
// @ApiMember(DataType="Guid", Description="Get contact roles (custom and/or standard) for the specified licensee", IsRequired=true, Name="LicenseeId", ParameterType="query")
/** @var string */
public string $LicenseeId='',
/** @description Contact Types */
// @ApiMember(DataType="List<Guid>", Description="Contact Types", Name="ContactTypes", ParameterType="query")
/** @var array<string>|null */
public ?array $ContactTypes=null,
/** @description Custom/Standard filter */
// @ApiMember(DataType="List<Guid>", Description="Custom/Standard filter", Name="OwnerFilterIds", ParameterType="query")
/** @var array<string>|null */
public ?array $OwnerFilterIds=null,
/** @description Active/Archived filter */
// @ApiMember(DataType="string", Description="Active/Archived filter", Name="RecordStatus", ParameterType="query")
/** @var string|null */
public ?string $RecordStatus=null,
/** @description Text filter */
// @ApiMember(DataType="string", Description="Text filter", Name="SearchText", ParameterType="query")
/** @var string|null */
public ?string $SearchText=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['LicenseeId'])) $this->LicenseeId = $o['LicenseeId'];
if (isset($o['ContactTypes'])) $this->ContactTypes = JsonConverters::fromArray('Guid', $o['ContactTypes']);
if (isset($o['OwnerFilterIds'])) $this->OwnerFilterIds = JsonConverters::fromArray('Guid', $o['OwnerFilterIds']);
if (isset($o['RecordStatus'])) $this->RecordStatus = $o['RecordStatus'];
if (isset($o['SearchText'])) $this->SearchText = $o['SearchText'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->LicenseeId)) $o['LicenseeId'] = $this->LicenseeId;
if (isset($this->ContactTypes)) $o['ContactTypes'] = JsonConverters::toArray('Guid', $this->ContactTypes);
if (isset($this->OwnerFilterIds)) $o['OwnerFilterIds'] = JsonConverters::toArray('Guid', $this->OwnerFilterIds);
if (isset($this->RecordStatus)) $o['RecordStatus'] = $this->RecordStatus;
if (isset($this->SearchText)) $o['SearchText'] = $this->SearchText;
return empty($o) ? new class(){} : $o;
}
}
PHP GetContactRolesForLicensee DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /api/contactroles/{LicenseeId} HTTP/1.1
Host: pfapi.pstpf.com.au
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"LicenseeId":"00000000-0000-0000-0000-000000000000","ContactTypes":["00000000-0000-0000-0000-000000000000"],"OwnerFilterIds":["00000000-0000-0000-0000-000000000000"],"RecordStatus":"String","SearchText":"String"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"Roles":[{"RoleId":"00000000-0000-0000-0000-000000000000","RoleName":"String","IsLicenseeRole":false,"IsManageContacts":false,"IsPlatformRole":false,"IsServiceRole":false,"IsCustomerRole":false,"IsFunctionalRole":false,"IsRequestAutoAccepted":false,"SuiteId":"00000000-0000-0000-0000-000000000000","SuiteName":"String","RecordStatus":"String","ObjectConnectionId":"00000000-0000-0000-0000-000000000000"}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}