Platform API

<back to all web services

GetContactRoleDetails

Get details of the specified contact role, including details of the contacts and organisations sharing it

Requires Authentication
The following routes are available for this service:
All Verbs/api/contactrole/{ContactRoleId}
<?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};


enum SortOrder : string
{
    case Ascending = 'Ascending';
    case Descending = 'Descending';
}

class PagedModel implements JsonSerializable
{
    public function __construct(
        /** @description Page Number to retrieve */
        // @ApiMember(DataType="int", Description="Page Number to retrieve", Name="PageNumber")
        /** @var int */
        public int $PageNumber=0,

        /** @description Number of records to retrieve */
        // @ApiMember(DataType="int", Description="Number of records to retrieve", Name="PageSize")
        /** @var int */
        public int $PageSize=0,

        /** @description Index of field to sort results by */
        // @ApiMember(DataType="int", Description="Index of field to sort results by", Name="SortIndex")
        /** @var int */
        public int $SortIndex=0,

        /** @description Sort Order - Ascending or Descending */
        // @ApiMember(DataType="int", Description="Sort Order - Ascending or Descending", Name="SortOrder")
        /** @var SortOrder|null */
        public ?SortOrder $SortOrder=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['PageNumber'])) $this->PageNumber = $o['PageNumber'];
        if (isset($o['PageSize'])) $this->PageSize = $o['PageSize'];
        if (isset($o['SortIndex'])) $this->SortIndex = $o['SortIndex'];
        if (isset($o['SortOrder'])) $this->SortOrder = JsonConverters::from('SortOrder', $o['SortOrder']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->PageNumber)) $o['PageNumber'] = $this->PageNumber;
        if (isset($this->PageSize)) $o['PageSize'] = $this->PageSize;
        if (isset($this->SortIndex)) $o['SortIndex'] = $this->SortIndex;
        if (isset($this->SortOrder)) $o['SortOrder'] = JsonConverters::to('SortOrder', $this->SortOrder);
        return empty($o) ? new class(){} : $o;
    }
}

class UserProfileSummaryModel implements JsonSerializable
{
    public function __construct(
        /** @description User Profile Id */
        // @ApiMember(DataType="Guid", Description="User Profile Id", Name="UserProfileId")
        /** @var string */
        public string $UserProfileId='',

        /** @description User linked to the profile */
        // @ApiMember(DataType="Guid", Description="User linked to the profile", Name="UserId")
        /** @var string */
        public string $UserId='',

        /** @description Contact linked to the profile */
        // @ApiMember(DataType="Guid", Description="Contact linked to the profile", Name="ContactId")
        /** @var string */
        public string $ContactId='',

        /** @description User linked to the profile */
        // @ApiMember(DataType="string", Description="User linked to the profile", Name="UserName")
        /** @var string|null */
        public ?string $UserName=null,

        /** @description User Profile Name */
        // @ApiMember(DataType="string", Description="User Profile Name", Name="ProfileName")
        /** @var string|null */
        public ?string $ProfileName=null,

        /** @description Full name of the contact linked to the profile */
        // @ApiMember(DataType="string", Description="Full name of the contact linked to the profile", Name="ContactFullName")
        /** @var string|null */
        public ?string $ContactFullName=null,

        /** @description Email Address of the contact linked to the profile */
        // @ApiMember(DataType="string", Description="Email Address of the contact linked to the profile", Name="EmailAddress")
        /** @var string|null */
        public ?string $EmailAddress=null,

        /** @description Email signature of the contact linked to the profile */
        // @ApiMember(DataType="string", Description="Email signature of the contact linked to the profile", Name="EmailSignature")
        /** @var string|null */
        public ?string $EmailSignature=null,

        /** @description Mobile number of the contact linked to the profile */
        // @ApiMember(DataType="string", Description="Mobile number of the contact linked to the profile", Name="MobileNumber")
        /** @var string|null */
        public ?string $MobileNumber=null,

        /** @description Phone number of the contact linked to the profile */
        // @ApiMember(DataType="string", Description="Phone number of the contact linked to the profile", Name="PhoneNumber")
        /** @var string|null */
        public ?string $PhoneNumber=null,

        /** @description Type of contact (person, organisation etc.) linked to the profile */
        // @ApiMember(DataType="string", Description="Type of contact (person, organisation etc.) linked to the profile", Name="ContactTypeId")
        /** @var string */
        public string $ContactTypeId='',

        /** @description Type of contact (person, organisation etc.) linked to the profile */
        // @ApiMember(DataType="string", Description="Type of contact (person, organisation etc.) linked to the profile", Name="ContactTypeName")
        /** @var string|null */
        public ?string $ContactTypeName=null,

        /** @description First name of the contact linked to the profile */
        // @ApiMember(DataType="string", Description="First name of the contact linked to the profile", Name="FirstName")
        /** @var string|null */
        public ?string $FirstName=null,

        /** @description Surname of the contact linked to the profile */
        // @ApiMember(DataType="string", Description="Surname of the contact linked to the profile", Name="Surname")
        /** @var string|null */
        public ?string $Surname=null,

        /** @description Title of contact linked to the profile */
        // @ApiMember(DataType="string", Description="Title of contact linked to the profile", Name="Title")
        /** @var string|null */
        public ?string $Title=null,

        /** @description Legal name of contact linked to the profile */
        // @ApiMember(DataType="string", Description="Legal name of contact linked to the profile", Name="LegalName")
        /** @var string|null */
        public ?string $LegalName=null,

        /** @description Trading name of contact linked to the profile */
        // @ApiMember(DataType="string", Description="Trading name of contact linked to the profile", Name="TradingName")
        /** @var string|null */
        public ?string $TradingName=null,

        /** @description Australian Business Number */
        // @ApiMember(DataType="string", Description="Australian Business Number", Name="Abn", ParameterType="query")
        /** @var string|null */
        public ?string $Abn=null,

        /** @description Australian Company Number */
        // @ApiMember(DataType="string", Description="Australian Company Number", Name="Acn", ParameterType="query")
        /** @var string|null */
        public ?string $Acn=null,

        /** @description Australian Registered Body Number */
        // @ApiMember(DataType="string", Description="Australian Registered Body Number", Name="Arbn", ParameterType="query")
        /** @var string|null */
        public ?string $Arbn=null,

        /** @description Indicates if the Contact is registered for GST. */
        // @ApiMember(DataType="bool", Description="Indicates if the Contact is registered for GST.", Name="GstRegistered", ParameterType="query")
        /** @var bool|null */
        public ?bool $GstRegistered=null,

        /** @description True if english is a secondary language for the contact. */
        // @ApiMember(DataType="bool", Description="True if english is a secondary language for the contact.", Name="ESL", ParameterType="query")
        /** @var bool|null */
        public ?bool $ESL=null,

        /** @description Language that is the primary language for the contact. */
        // @ApiMember(DataType="string", Description="Language that is the primary language for the contact.", Name="Language", ParameterType="query")
        /** @var string|null */
        public ?string $Language=null,

        /** @description True if an interpreter is required. */
        // @ApiMember(DataType="bool", Description="True if an interpreter is required.", Name="InterpreterRequired", ParameterType="query")
        /** @var bool|null */
        public ?bool $InterpreterRequired=null,

        /** @description Licensee specific notes about the contact. */
        // @ApiMember(DataType="string", Description="Licensee specific notes about the contact.", Name="LicenseeNotes", ParameterType="query")
        /** @var string|null */
        public ?string $LicenseeNotes=null,

        /** @description Profile photo of contact linked to the profile */
        // @ApiMember(DataType="string", Description="Profile photo of contact linked to the profile", Name="ProfilePhotoUrl")
        /** @var string|null */
        public ?string $ProfilePhotoUrl=null,

        /** @description Thumbnail photo of contact linked to the profile */
        // @ApiMember(DataType="string", Description="Thumbnail photo of contact linked to the profile", Name="ProfilePhotoThumbnailUrl")
        /** @var string|null */
        public ?string $ProfilePhotoThumbnailUrl=null,

        /** @description Profile photo id of contact linked to the profile */
        // @ApiMember(DataType="Guid", Description="Profile photo id of contact linked to the profile", Name="ProfileImageId")
        /** @var string */
        public string $ProfileImageId='',

        /** @description Profile description */
        // @ApiMember(DataType="string", Description="Profile description", Name="Description")
        /** @var string|null */
        public ?string $Description=null,

        /** @description Employment Industry */
        // @ApiMember(DataType="string", Description="Employment Industry", Name="EmploymentIndustry")
        /** @var string|null */
        public ?string $EmploymentIndustry=null,

        /** @description Employment Role */
        // @ApiMember(DataType="string", Description="Employment Role", Name="EmploymentRole")
        /** @var string|null */
        public ?string $EmploymentRole=null,

        /** @description Areas of Work */
        // @ApiMember(DataType="string", Description="Areas of Work", Name="EmploymentGeographicArea")
        /** @var string|null */
        public ?string $EmploymentGeographicArea=null,

        /** @description The contacts timezone. */
        // @ApiMember(DataType="Guid", Description="The contacts timezone.", Name="Timezone", ParameterType="query")
        /** @var string */
        public string $Timezone='',

        /** @description Timezone Name */
        // @ApiMember(DataType="string", Description="Timezone Name", Name="TimezoneName", ParameterType="query")
        /** @var string|null */
        public ?string $TimezoneName=null,

        /** @description The primary address of the contact */
        // @ApiMember(DataType="string", Description="The primary address of the contact", Name="PrimaryAddress", ParameterType="query")
        /** @var string|null */
        public ?string $PrimaryAddress=null,

        /** @description Is this an active contact? Or an inactive contact (deleted account)? */
        // @ApiMember(DataType="bool", Description="Is this an active contact? Or an inactive contact (deleted account)?", Name="IsActiveContact")
        /** @var bool|null */
        public ?bool $IsActiveContact=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['UserProfileId'])) $this->UserProfileId = $o['UserProfileId'];
        if (isset($o['UserId'])) $this->UserId = $o['UserId'];
        if (isset($o['ContactId'])) $this->ContactId = $o['ContactId'];
        if (isset($o['UserName'])) $this->UserName = $o['UserName'];
        if (isset($o['ProfileName'])) $this->ProfileName = $o['ProfileName'];
        if (isset($o['ContactFullName'])) $this->ContactFullName = $o['ContactFullName'];
        if (isset($o['EmailAddress'])) $this->EmailAddress = $o['EmailAddress'];
        if (isset($o['EmailSignature'])) $this->EmailSignature = $o['EmailSignature'];
        if (isset($o['MobileNumber'])) $this->MobileNumber = $o['MobileNumber'];
        if (isset($o['PhoneNumber'])) $this->PhoneNumber = $o['PhoneNumber'];
        if (isset($o['ContactTypeId'])) $this->ContactTypeId = $o['ContactTypeId'];
        if (isset($o['ContactTypeName'])) $this->ContactTypeName = $o['ContactTypeName'];
        if (isset($o['FirstName'])) $this->FirstName = $o['FirstName'];
        if (isset($o['Surname'])) $this->Surname = $o['Surname'];
        if (isset($o['Title'])) $this->Title = $o['Title'];
        if (isset($o['LegalName'])) $this->LegalName = $o['LegalName'];
        if (isset($o['TradingName'])) $this->TradingName = $o['TradingName'];
        if (isset($o['Abn'])) $this->Abn = $o['Abn'];
        if (isset($o['Acn'])) $this->Acn = $o['Acn'];
        if (isset($o['Arbn'])) $this->Arbn = $o['Arbn'];
        if (isset($o['GstRegistered'])) $this->GstRegistered = $o['GstRegistered'];
        if (isset($o['ESL'])) $this->ESL = $o['ESL'];
        if (isset($o['Language'])) $this->Language = $o['Language'];
        if (isset($o['InterpreterRequired'])) $this->InterpreterRequired = $o['InterpreterRequired'];
        if (isset($o['LicenseeNotes'])) $this->LicenseeNotes = $o['LicenseeNotes'];
        if (isset($o['ProfilePhotoUrl'])) $this->ProfilePhotoUrl = $o['ProfilePhotoUrl'];
        if (isset($o['ProfilePhotoThumbnailUrl'])) $this->ProfilePhotoThumbnailUrl = $o['ProfilePhotoThumbnailUrl'];
        if (isset($o['ProfileImageId'])) $this->ProfileImageId = $o['ProfileImageId'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['EmploymentIndustry'])) $this->EmploymentIndustry = $o['EmploymentIndustry'];
        if (isset($o['EmploymentRole'])) $this->EmploymentRole = $o['EmploymentRole'];
        if (isset($o['EmploymentGeographicArea'])) $this->EmploymentGeographicArea = $o['EmploymentGeographicArea'];
        if (isset($o['Timezone'])) $this->Timezone = $o['Timezone'];
        if (isset($o['TimezoneName'])) $this->TimezoneName = $o['TimezoneName'];
        if (isset($o['PrimaryAddress'])) $this->PrimaryAddress = $o['PrimaryAddress'];
        if (isset($o['IsActiveContact'])) $this->IsActiveContact = $o['IsActiveContact'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->UserProfileId)) $o['UserProfileId'] = $this->UserProfileId;
        if (isset($this->UserId)) $o['UserId'] = $this->UserId;
        if (isset($this->ContactId)) $o['ContactId'] = $this->ContactId;
        if (isset($this->UserName)) $o['UserName'] = $this->UserName;
        if (isset($this->ProfileName)) $o['ProfileName'] = $this->ProfileName;
        if (isset($this->ContactFullName)) $o['ContactFullName'] = $this->ContactFullName;
        if (isset($this->EmailAddress)) $o['EmailAddress'] = $this->EmailAddress;
        if (isset($this->EmailSignature)) $o['EmailSignature'] = $this->EmailSignature;
        if (isset($this->MobileNumber)) $o['MobileNumber'] = $this->MobileNumber;
        if (isset($this->PhoneNumber)) $o['PhoneNumber'] = $this->PhoneNumber;
        if (isset($this->ContactTypeId)) $o['ContactTypeId'] = $this->ContactTypeId;
        if (isset($this->ContactTypeName)) $o['ContactTypeName'] = $this->ContactTypeName;
        if (isset($this->FirstName)) $o['FirstName'] = $this->FirstName;
        if (isset($this->Surname)) $o['Surname'] = $this->Surname;
        if (isset($this->Title)) $o['Title'] = $this->Title;
        if (isset($this->LegalName)) $o['LegalName'] = $this->LegalName;
        if (isset($this->TradingName)) $o['TradingName'] = $this->TradingName;
        if (isset($this->Abn)) $o['Abn'] = $this->Abn;
        if (isset($this->Acn)) $o['Acn'] = $this->Acn;
        if (isset($this->Arbn)) $o['Arbn'] = $this->Arbn;
        if (isset($this->GstRegistered)) $o['GstRegistered'] = $this->GstRegistered;
        if (isset($this->ESL)) $o['ESL'] = $this->ESL;
        if (isset($this->Language)) $o['Language'] = $this->Language;
        if (isset($this->InterpreterRequired)) $o['InterpreterRequired'] = $this->InterpreterRequired;
        if (isset($this->LicenseeNotes)) $o['LicenseeNotes'] = $this->LicenseeNotes;
        if (isset($this->ProfilePhotoUrl)) $o['ProfilePhotoUrl'] = $this->ProfilePhotoUrl;
        if (isset($this->ProfilePhotoThumbnailUrl)) $o['ProfilePhotoThumbnailUrl'] = $this->ProfilePhotoThumbnailUrl;
        if (isset($this->ProfileImageId)) $o['ProfileImageId'] = $this->ProfileImageId;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->EmploymentIndustry)) $o['EmploymentIndustry'] = $this->EmploymentIndustry;
        if (isset($this->EmploymentRole)) $o['EmploymentRole'] = $this->EmploymentRole;
        if (isset($this->EmploymentGeographicArea)) $o['EmploymentGeographicArea'] = $this->EmploymentGeographicArea;
        if (isset($this->Timezone)) $o['Timezone'] = $this->Timezone;
        if (isset($this->TimezoneName)) $o['TimezoneName'] = $this->TimezoneName;
        if (isset($this->PrimaryAddress)) $o['PrimaryAddress'] = $this->PrimaryAddress;
        if (isset($this->IsActiveContact)) $o['IsActiveContact'] = $this->IsActiveContact;
        return empty($o) ? new class(){} : $o;
    }
}

class ObjectShareModel implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $ObjectShareId='',
        /** @var string */
        public string $ObjectId='',
        /** @var string|null */
        public ?string $ObjectName=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Description=null,
        /** @var string|null */
        public ?string $Reference=null,
        /** @var string */
        public string $ContactId='',
        /** @var string|null */
        public ?string $ContactName=null,
        /** @var string|null */
        public ?string $ContactType=null,
        /** @var string|null */
        public ?string $ContactImageUrlPrimary=null,
        /** @var string|null */
        public ?string $ContactImageUrlPrimaryThmbnail=null,
        /** @var string */
        public string $ShareStatusId='',
        /** @var string|null */
        public ?string $ShareStatusName=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ObjectShareId'])) $this->ObjectShareId = $o['ObjectShareId'];
        if (isset($o['ObjectId'])) $this->ObjectId = $o['ObjectId'];
        if (isset($o['ObjectName'])) $this->ObjectName = $o['ObjectName'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['Reference'])) $this->Reference = $o['Reference'];
        if (isset($o['ContactId'])) $this->ContactId = $o['ContactId'];
        if (isset($o['ContactName'])) $this->ContactName = $o['ContactName'];
        if (isset($o['ContactType'])) $this->ContactType = $o['ContactType'];
        if (isset($o['ContactImageUrlPrimary'])) $this->ContactImageUrlPrimary = $o['ContactImageUrlPrimary'];
        if (isset($o['ContactImageUrlPrimaryThmbnail'])) $this->ContactImageUrlPrimaryThmbnail = $o['ContactImageUrlPrimaryThmbnail'];
        if (isset($o['ShareStatusId'])) $this->ShareStatusId = $o['ShareStatusId'];
        if (isset($o['ShareStatusName'])) $this->ShareStatusName = $o['ShareStatusName'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ObjectShareId)) $o['ObjectShareId'] = $this->ObjectShareId;
        if (isset($this->ObjectId)) $o['ObjectId'] = $this->ObjectId;
        if (isset($this->ObjectName)) $o['ObjectName'] = $this->ObjectName;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->Reference)) $o['Reference'] = $this->Reference;
        if (isset($this->ContactId)) $o['ContactId'] = $this->ContactId;
        if (isset($this->ContactName)) $o['ContactName'] = $this->ContactName;
        if (isset($this->ContactType)) $o['ContactType'] = $this->ContactType;
        if (isset($this->ContactImageUrlPrimary)) $o['ContactImageUrlPrimary'] = $this->ContactImageUrlPrimary;
        if (isset($this->ContactImageUrlPrimaryThmbnail)) $o['ContactImageUrlPrimaryThmbnail'] = $this->ContactImageUrlPrimaryThmbnail;
        if (isset($this->ShareStatusId)) $o['ShareStatusId'] = $this->ShareStatusId;
        if (isset($this->ShareStatusName)) $o['ShareStatusName'] = $this->ShareStatusName;
        return empty($o) ? new class(){} : $o;
    }
}

class ListItemFilterModel implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $ListItemFilterId='',
        /** @var string|null */
        public ?string $FilterName=null,
        /** @var string */
        public string $ListId='',
        /** @var string */
        public string $ListItemId='',
        /** @var bool|null */
        public ?bool $ListItemIsInFilter=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ListItemFilterId'])) $this->ListItemFilterId = $o['ListItemFilterId'];
        if (isset($o['FilterName'])) $this->FilterName = $o['FilterName'];
        if (isset($o['ListId'])) $this->ListId = $o['ListId'];
        if (isset($o['ListItemId'])) $this->ListItemId = $o['ListItemId'];
        if (isset($o['ListItemIsInFilter'])) $this->ListItemIsInFilter = $o['ListItemIsInFilter'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ListItemFilterId)) $o['ListItemFilterId'] = $this->ListItemFilterId;
        if (isset($this->FilterName)) $o['FilterName'] = $this->FilterName;
        if (isset($this->ListId)) $o['ListId'] = $this->ListId;
        if (isset($this->ListItemId)) $o['ListItemId'] = $this->ListItemId;
        if (isset($this->ListItemIsInFilter)) $o['ListItemIsInFilter'] = $this->ListItemIsInFilter;
        return empty($o) ? new class(){} : $o;
    }
}

class ViewRoleModel extends PagedModel implements JsonSerializable
{
    /**
     * @param int $PageNumber
     * @param int $PageSize
     * @param int $SortIndex
     * @param SortOrder|null $SortOrder
     */
    public function __construct(
        int $PageNumber=0,
        int $PageSize=0,
        int $SortIndex=0,
        ?SortOrder $SortOrder=null,
        /** @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 Role Connection Definition Id */
        // @ApiMember(DataType="Guid", Description="Role Connection Definition Id", Name="RoleConnectionDefinitionId")
        /** @var string */
        public string $RoleConnectionDefinitionId='',

        /** @description Contact Types the Role applies to */
        // @ApiMember(DataType="List", Description="Contact Types the Role applies to", Name="ContactTypes")
        /** @var array<string>|null */
        public ?array $ContactTypes=null,

        /** @description Does the role require contacts to accept it? */
        // @ApiMember(DataType="bool", Description="Does the role require contacts to accept it?", Name="RequireContactsToAccept")
        /** @var bool|null */
        public ?bool $RequireContactsToAccept=null,

        /** @var bool|null */
        public ?bool $IsPlatformRole=null,
        /** @var bool|null */
        public ?bool $CanAddContacts=null,
        /** @var bool|null */
        public ?bool $CanShareRole=null,
        /** @var bool|null */
        public ?bool $CanEditRole=null,
        /** @var bool|null */
        public ?bool $CanEditContactTypes=null,
        /** @var array<UserProfileSummaryModel>|null */
        public ?array $Contacts=null,
        /** @var array<ObjectShareModel>|null */
        public ?array $ShareDetails=null,
        /** @var array<ListItemFilterModel>|null */
        public ?array $ListItemFilters=null,
        /** @var string */
        public string $ContactIdOwner='',
        /** @var int */
        public int $TotalItemCount=0
    ) {
        parent::__construct($PageNumber,$PageSize,$SortIndex,$SortOrder);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['RoleId'])) $this->RoleId = $o['RoleId'];
        if (isset($o['RoleName'])) $this->RoleName = $o['RoleName'];
        if (isset($o['RoleConnectionDefinitionId'])) $this->RoleConnectionDefinitionId = $o['RoleConnectionDefinitionId'];
        if (isset($o['ContactTypes'])) $this->ContactTypes = JsonConverters::fromArray('Guid', $o['ContactTypes']);
        if (isset($o['RequireContactsToAccept'])) $this->RequireContactsToAccept = $o['RequireContactsToAccept'];
        if (isset($o['IsPlatformRole'])) $this->IsPlatformRole = $o['IsPlatformRole'];
        if (isset($o['CanAddContacts'])) $this->CanAddContacts = $o['CanAddContacts'];
        if (isset($o['CanShareRole'])) $this->CanShareRole = $o['CanShareRole'];
        if (isset($o['CanEditRole'])) $this->CanEditRole = $o['CanEditRole'];
        if (isset($o['CanEditContactTypes'])) $this->CanEditContactTypes = $o['CanEditContactTypes'];
        if (isset($o['Contacts'])) $this->Contacts = JsonConverters::fromArray('UserProfileSummaryModel', $o['Contacts']);
        if (isset($o['ShareDetails'])) $this->ShareDetails = JsonConverters::fromArray('ObjectShareModel', $o['ShareDetails']);
        if (isset($o['ListItemFilters'])) $this->ListItemFilters = JsonConverters::fromArray('ListItemFilterModel', $o['ListItemFilters']);
        if (isset($o['ContactIdOwner'])) $this->ContactIdOwner = $o['ContactIdOwner'];
        if (isset($o['TotalItemCount'])) $this->TotalItemCount = $o['TotalItemCount'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->RoleId)) $o['RoleId'] = $this->RoleId;
        if (isset($this->RoleName)) $o['RoleName'] = $this->RoleName;
        if (isset($this->RoleConnectionDefinitionId)) $o['RoleConnectionDefinitionId'] = $this->RoleConnectionDefinitionId;
        if (isset($this->ContactTypes)) $o['ContactTypes'] = JsonConverters::toArray('Guid', $this->ContactTypes);
        if (isset($this->RequireContactsToAccept)) $o['RequireContactsToAccept'] = $this->RequireContactsToAccept;
        if (isset($this->IsPlatformRole)) $o['IsPlatformRole'] = $this->IsPlatformRole;
        if (isset($this->CanAddContacts)) $o['CanAddContacts'] = $this->CanAddContacts;
        if (isset($this->CanShareRole)) $o['CanShareRole'] = $this->CanShareRole;
        if (isset($this->CanEditRole)) $o['CanEditRole'] = $this->CanEditRole;
        if (isset($this->CanEditContactTypes)) $o['CanEditContactTypes'] = $this->CanEditContactTypes;
        if (isset($this->Contacts)) $o['Contacts'] = JsonConverters::toArray('UserProfileSummaryModel', $this->Contacts);
        if (isset($this->ShareDetails)) $o['ShareDetails'] = JsonConverters::toArray('ObjectShareModel', $this->ShareDetails);
        if (isset($this->ListItemFilters)) $o['ListItemFilters'] = JsonConverters::toArray('ListItemFilterModel', $this->ListItemFilters);
        if (isset($this->ContactIdOwner)) $o['ContactIdOwner'] = $this->ContactIdOwner;
        if (isset($this->TotalItemCount)) $o['TotalItemCount'] = $this->TotalItemCount;
        return empty($o) ? new class(){} : $o;
    }
}

// @ApiResponse(Description="Details of the specified contact role, including details of the contacts and organisations sharing it")
class GetContactRoleDetailsResponse implements JsonSerializable
{
    public function __construct(
        /** @var ViewRoleModel|null */
        public ?ViewRoleModel $ContactRole=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ContactRole'])) $this->ContactRole = JsonConverters::from('ViewRoleModel', $o['ContactRole']);
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ContactRole)) $o['ContactRole'] = JsonConverters::to('ViewRoleModel', $this->ContactRole);
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

/** @description Get details of the specified contact role, including details of the contacts and organisations sharing it */
// @Api(Description="Get details of the specified contact role, including details of the contacts and organisations sharing it")
class GetContactRoleDetails extends PagedModel implements JsonSerializable
{
    /**
     * @param int $PageNumber
     * @param int $PageSize
     * @param int $SortIndex
     * @param SortOrder|null $SortOrder
     */
    public function __construct(
        int $PageNumber=0,
        int $PageSize=0,
        int $SortIndex=0,
        ?SortOrder $SortOrder=null,
        /** @description The Contact Role Guid. Records retrieved will belong to this contact. */
        // @ApiMember(DataType="Guid", Description="The Contact Role Guid. Records retrieved will belong to this contact.", IsRequired=true, Name="ContactRoleId", ParameterType="query")
        /** @var string */
        public string $ContactRoleId='',

        /** @description Text filter */
        // @ApiMember(DataType="string", Description="Text filter", Name="SearchText", ParameterType="query")
        /** @var string|null */
        public ?string $SearchText=null
    ) {
        parent::__construct($PageNumber,$PageSize,$SortIndex,$SortOrder);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['ContactRoleId'])) $this->ContactRoleId = $o['ContactRoleId'];
        if (isset($o['SearchText'])) $this->SearchText = $o['SearchText'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->ContactRoleId)) $o['ContactRoleId'] = $this->ContactRoleId;
        if (isset($this->SearchText)) $o['SearchText'] = $this->SearchText;
        return empty($o) ? new class(){} : $o;
    }
}

PHP GetContactRoleDetails DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /api/contactrole/{ContactRoleId} HTTP/1.1 
Host: pfapi.pstpf.com.au 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"ContactRoleId":"00000000-0000-0000-0000-000000000000","SearchText":"String","PageNumber":0,"PageSize":0,"SortIndex":0,"SortOrder":"Ascending"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"ContactRole":{"RoleId":"00000000-0000-0000-0000-000000000000","RoleName":"String","RoleConnectionDefinitionId":"00000000-0000-0000-0000-000000000000","ContactTypes":["00000000-0000-0000-0000-000000000000"],"RequireContactsToAccept":false,"IsPlatformRole":false,"CanAddContacts":false,"CanShareRole":false,"CanEditRole":false,"CanEditContactTypes":false,"Contacts":[{"UserProfileId":"00000000-0000-0000-0000-000000000000","UserId":"00000000-0000-0000-0000-000000000000","ContactId":"00000000-0000-0000-0000-000000000000","UserName":"String","ProfileName":"String","ContactFullName":"String","EmailAddress":"String","EmailSignature":"String","MobileNumber":"String","PhoneNumber":"String","ContactTypeId":"00000000-0000-0000-0000-000000000000","ContactTypeName":"String","FirstName":"String","Surname":"String","Title":"String","LegalName":"String","TradingName":"String","Abn":"String","Acn":"String","Arbn":"String","GstRegistered":false,"ESL":false,"Language":"String","InterpreterRequired":false,"LicenseeNotes":"String","ProfilePhotoUrl":"String","ProfilePhotoThumbnailUrl":"String","ProfileImageId":"00000000-0000-0000-0000-000000000000","Description":"String","EmploymentIndustry":"String","EmploymentRole":"String","EmploymentGeographicArea":"String","Timezone":"00000000-0000-0000-0000-000000000000","TimezoneName":"String","PrimaryAddress":"String","IsActiveContact":false}],"ShareDetails":null,"ListItemFilters":[{"ListItemFilterId":"00000000-0000-0000-0000-000000000000","FilterName":"String","ListId":"00000000-0000-0000-0000-000000000000","ListItemId":"00000000-0000-0000-0000-000000000000","ListItemIsInFilter":false}],"ContactIdOwner":"00000000-0000-0000-0000-000000000000","TotalItemCount":0,"PageNumber":0,"PageSize":0,"SortIndex":0,"SortOrder":"Ascending"},"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}