| All Verbs | /api/contactrolegroups/{LicenseeId} |
|---|
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
class SortOrder(str, Enum):
ASCENDING = 'Ascending'
DESCENDING = 'Descending'
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PagedModel:
# @ApiMember(DataType="int", Description="Page Number to retrieve", Name="PageNumber")
page_number: int = 0
"""
Page Number to retrieve
"""
# @ApiMember(DataType="int", Description="Number of records to retrieve", Name="PageSize")
page_size: int = 0
"""
Number of records to retrieve
"""
# @ApiMember(DataType="int", Description="Index of field to sort results by", Name="SortIndex")
sort_index: int = 0
"""
Index of field to sort results by
"""
# @ApiMember(DataType="int", Description="Sort Order - Ascending or Descending", Name="SortOrder")
sort_order: Optional[SortOrder] = None
"""
Sort Order - Ascending or Descending
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RoleGroupRolesModel:
# @ApiMember(DataType="Guid", Description="Role Id", Name="RoleId")
role_id: Optional[str] = None
"""
Role Id
"""
# @ApiMember(DataType="string", Description="Role Name", Name="RoleName")
role_name: Optional[str] = None
"""
Role Name
"""
# @ApiMember(DataType="Guid", Description="Role Group Id", Name="RoleGroupId")
role_group_id: Optional[str] = None
"""
Role Group Id
"""
# @ApiMember(DataType="string", Description="Role Group Name", Name="RoleGroupName")
role_group_name: Optional[str] = None
"""
Role Group Name
"""
# @ApiMember(DataType="Guid", Description="Role Group Role Id", Name="RoleGroupRoleId")
role_group_role_id: Optional[str] = None
"""
Role Group Role Id
"""
# @ApiMember(DataType="string", Description="'A' (Active), 'I' (Inactive)", Name="RecordStatus")
record_status: Optional[str] = None
"""
'A' (Active), 'I' (Inactive)
"""
# @ApiMember(DataType="Guid", Description="Owner Contact Id", Name="OwnerContactId")
owner_contact_id: Optional[str] = None
"""
Owner Contact Id
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RoleGroupModel:
# @ApiMember(DataType="Guid", Description="Role Group Id", Name="RoleGroupId")
role_group_id: Optional[str] = None
"""
Role Group Id
"""
# @ApiMember(DataType="string", Description="Role Group Name", Name="Name")
name: Optional[str] = None
"""
Role Group Name
"""
# @ApiMember(DataType="Guid", Description="Owner Contact Id", Name="OwnerContactId")
owner_contact_id: Optional[str] = None
"""
Owner Contact Id
"""
# @ApiMember(DataType="int", Description="Number of Roles", Name="NumberOfRoles")
number_of_roles: int = 0
"""
Number of Roles
"""
# @ApiMember(DataType="List", Description="Roles belonging to the Role Group", Name="Roles")
roles: Optional[List[RoleGroupRolesModel]] = None
"""
Roles belonging to the Role Group
"""
# @ApiMember(DataType="string", Description="'A' (Active), 'I' (Inactive)", Name="RecordStatus")
record_status: Optional[str] = None
"""
'A' (Active), 'I' (Inactive)
"""
# @ApiMember(DataType="bool", Description="True if Licensee-owned, allowing editing, deleting, archiving", Name="AllowEdit", ParameterType="query")
allow_edit: bool = False
"""
True if Licensee-owned, allowing editing, deleting, archiving
"""
# @ApiResponse(Description="List of role groups")
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetContactRoleGroupsResponse:
role_groups: Optional[List[RoleGroupModel]] = None
total_role_groups: int = 0
response_status: Optional[ResponseStatus] = None
# @Api(Description="Get role groups for the given criteria")
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetContactRoleGroups(PagedModel):
"""
Get role groups for the given criteria
"""
# @ApiMember(DataType="Guid", Description="Get contact role groups for the specified licensee", IsRequired=true, Name="LicenseeId", ParameterType="query")
licensee_id: Optional[str] = None
"""
Get contact role groups for the specified licensee
"""
# @ApiMember(DataType="string", Description="Role Group Name", Name="Name", ParameterType="query")
name: Optional[str] = None
"""
Role Group Name
"""
# @ApiMember(DataType="string", Description="Active/Archived filter", Name="RecordStatus", ParameterType="query")
record_status: Optional[str] = None
"""
Active/Archived filter
"""
Python GetContactRoleGroups 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/contactrolegroups/{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","Name":"String","RecordStatus":"String","PageNumber":0,"PageSize":0,"SortIndex":0,"SortOrder":"Ascending"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"RoleGroups":[{"RoleGroupId":"00000000-0000-0000-0000-000000000000","Name":"String","OwnerContactId":"00000000-0000-0000-0000-000000000000","NumberOfRoles":0,"Roles":[{"RoleId":"00000000-0000-0000-0000-000000000000","RoleName":"String","RoleGroupId":"00000000-0000-0000-0000-000000000000","RoleGroupName":"String","RoleGroupRoleId":"00000000-0000-0000-0000-000000000000","RecordStatus":"String","OwnerContactId":"00000000-0000-0000-0000-000000000000"}],"RecordStatus":"String","AllowEdit":false}],"TotalRoleGroups":0,"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}