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
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class UserContactConnectionModel:
# @ApiMember(DataType="Guid", Description="The Contact Role Id, that links the Contact to their role.", Name="ContactRoleId", ParameterType="query")
contact_role_id: Optional[str] = None
"""
The Contact Role Id, that links the Contact to their role.
"""
# @ApiMember(DataType="string", Description="The role name.", Name="ContactRoleName", ParameterType="query")
contact_role_name: Optional[str] = None
"""
The role name.
"""
# @ApiMember(DataType="Guid", Description="The list item role Id.", Name="ContactListItemRoleId", ParameterType="query")
contact_list_item_role_id: Optional[str] = None
"""
The list item role Id.
"""
# @ApiMember(DataType="string", Description="The URL of the contact role's image icon.", Name="ContactRolePrimaryImageURL", ParameterType="query")
contact_role_primary_image_u_r_l: Optional[str] = None
"""
The URL of the contact role's image icon.
"""
# @ApiMember(DataType="string", Description="The URL of the contact role's thumbnail image icon.", Name="ContactRolePrimaryImageThumbnailURL", ParameterType="query")
contact_role_primary_image_thumbnail_u_r_l: Optional[str] = None
"""
The URL of the contact role's thumbnail image icon.
"""
# @ApiMember(DataType="string", Description="The Guid of the contact role's media file containing the image icon details.", Name="ContactRolePrimaryImageId", ParameterType="query")
contact_role_primary_image_id: Optional[str] = None
"""
The Guid of the contact role's media file containing the image icon details.
"""
# @ApiMember(DataType="string", Description="The connected contacts Id. (licensee)", Name="ConnectionContactId", ParameterType="query")
connection_contact_id: Optional[str] = None
"""
The connected contacts Id. (licensee)
"""
# @ApiMember(DataType="string", Description="The connected contacts Full Name.", Name="ConnectionContactName", ParameterType="query")
connection_contact_name: Optional[str] = None
"""
The connected contacts Full Name.
"""
# @ApiMember(DataType="string", Description="The connected contacts role.", Name="ConnectionContactRoleName", ParameterType="query")
connection_contact_role_name: Optional[str] = None
"""
The connected contacts role.
"""
# @ApiMember(DataType="Guid", Description="The connected contacts role Id.", Name="ConnectionContactRoleId", ParameterType="query")
connection_contact_role_id: Optional[str] = None
"""
The connected contacts role Id.
"""
# @ApiMember(DataType="Guid", Description="The connected contacts list item role Id.", Name="ConnectionContactListItemRoleId", ParameterType="query")
connection_contact_list_item_role_id: Optional[str] = None
"""
The connected contacts list item role Id.
"""
# @ApiMember(DataType="string", Description="The Contacts Type.", Name="ContactTypeName", ParameterType="query")
contact_type_name: Optional[str] = None
"""
The Contacts Type.
"""
# @ApiMember(DataType="string", Description="The URL to the Connected Contacts Photo.", Name="ConnectionContactPhotoURL", ParameterType="query")
connection_contact_photo_u_r_l: Optional[str] = None
"""
The URL to the Connected Contacts Photo.
"""
# @ApiMember(DataType="bool", Description=".", Name="IsContactLicenseeRole", ParameterType="query")
is_contact_licensee_role: bool = False
"""
.
"""
# @ApiMember(DataType="bool", Description="If the connection is as a licensee this is true.", Name="IsConnectionLicenseeRole", ParameterType="query")
is_connection_licensee_role: bool = False
"""
If the connection is as a licensee this is true.
"""
# @ApiMember(DataType="string", Description="The status of the connection with the contact.", Name="ConnectionStatusName", ParameterType="query")
connection_status_name: Optional[str] = None
"""
The status of the connection with the contact.
"""
# @ApiMember(DataType="Guid", Description="The status Id of the connection with the contact.", Name="ConnectionStatusId", ParameterType="query")
connection_status_id: Optional[str] = None
"""
The status Id of the connection with the contact.
"""
# @ApiMember(DataType="Guid", Description="The ContactRoleConnectionId of an active connection with the contact.", Name="ConnectionId", ParameterType="query")
connection_id: Optional[str] = None
"""
The ContactRoleConnectionId of an active connection with the contact.
"""
# @ApiMember(DataType="Guid", Description="The ContactRoleConnectionRequest of a pending connection with the contact.", Name="ConnectionRequestId", ParameterType="query")
connection_request_id: Optional[str] = None
"""
The ContactRoleConnectionRequest of a pending connection with the contact.
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ContactEmailAddress:
# @ApiMember(DataType="Guid", Description="The Contact Id of the contact.", Name="ContactId", ParameterType="query")
contact_id: Optional[str] = None
"""
The Contact Id of the contact.
"""
# @ApiMember(DataType="string", Description="The Contact Full Name", Name="ContactName", ParameterType="query")
contact_name: Optional[str] = None
"""
The Contact Full Name
"""
# @ApiMember(DataType="string", Description="The Contact Email Address.", Name="EmailAddress", ParameterType="query")
email_address: Optional[str] = None
"""
The Contact Email Address.
"""
# @ApiMember(DataType="string", Description="The Contact Photo URL", Name="ContactPhotoURL", ParameterType="query")
contact_photo_u_r_l: Optional[str] = None
"""
The Contact Photo URL
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class UserContacts:
# @ApiMember(DataType="List<UserContactConnectionModel>", Description="A list of contact connections assigned to the user.", Name="ContactConnections", ParameterType="query")
contact_connections: Optional[List[UserContactConnectionModel]] = None
"""
A list of contact connections assigned to the user.
"""
# @ApiMember(DataType="List<ContactEmailAddressBook>", Description="A list of connected contacts and their email addresses.", Name="EmailAddressBook", ParameterType="query")
email_address_book: Optional[List[ContactEmailAddress]] = None
"""
A list of connected contacts and their email addresses.
"""
# @Api(Description="Returns a list of contacts connected to a user profiles' contact.")
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetConnectedContacts:
"""
Returns a list of contacts connected to a user profiles' contact.
"""
# @ApiMember(DataType="Guid", Description="The user's Guid. Contacts retrieved will be connected to this user.", IsRequired=true, Name="UserId", ParameterType="query")
user_id: Optional[str] = None
"""
The user's Guid. Contacts retrieved will be connected to this user.
"""
# @ApiMember(DataType="Guid", Description="The user profiles Contact Guid. Contacts connected to the user will be filted by this profiles contact ID.", IsRequired=true, Name="ContactId", ParameterType="query")
contact_id: Optional[str] = None
"""
The user profiles Contact Guid. Contacts connected to the user will be filted by this profiles contact ID.
"""
# @ApiMember(DataType="List<Guid>", Description="The suite id list. Gets contacts connected to the user filted by the suite IDs in this list..", Name="SuiteIds", ParameterType="query")
suite_ids: Optional[List[str]] = None
"""
The suite id list. Gets contacts connected to the user filted by the suite IDs in this list..
"""
Python GetConnectedContacts DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /xml/reply/GetConnectedContacts HTTP/1.1
Host: pfapi.pstpf.com.au
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<GetConnectedContacts xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eros.Subtle.Canvara.WebAPIModel.ServiceModel">
<ContactId>00000000-0000-0000-0000-000000000000</ContactId>
<SuiteIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:guid>00000000-0000-0000-0000-000000000000</d2p1:guid>
</SuiteIds>
<UserId>00000000-0000-0000-0000-000000000000</UserId>
</GetConnectedContacts>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<UserContacts xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eros.Subtle.Canvara.WebAPIModel.ServiceModel">
<ContactConnections>
<UserContactConnectionModel>
<ConnectionContactId>00000000-0000-0000-0000-000000000000</ConnectionContactId>
<ConnectionContactListItemRoleId>00000000-0000-0000-0000-000000000000</ConnectionContactListItemRoleId>
<ConnectionContactName>String</ConnectionContactName>
<ConnectionContactPhotoURL>String</ConnectionContactPhotoURL>
<ConnectionContactRoleId>00000000-0000-0000-0000-000000000000</ConnectionContactRoleId>
<ConnectionContactRoleName>String</ConnectionContactRoleName>
<ConnectionId>00000000-0000-0000-0000-000000000000</ConnectionId>
<ConnectionRequestId>00000000-0000-0000-0000-000000000000</ConnectionRequestId>
<ConnectionStatusId>00000000-0000-0000-0000-000000000000</ConnectionStatusId>
<ConnectionStatusName>String</ConnectionStatusName>
<ContactListItemRoleId>00000000-0000-0000-0000-000000000000</ContactListItemRoleId>
<ContactRoleId>00000000-0000-0000-0000-000000000000</ContactRoleId>
<ContactRoleName>String</ContactRoleName>
<ContactRolePrimaryImageId>00000000-0000-0000-0000-000000000000</ContactRolePrimaryImageId>
<ContactRolePrimaryImageThumbnailURL>String</ContactRolePrimaryImageThumbnailURL>
<ContactRolePrimaryImageURL>String</ContactRolePrimaryImageURL>
<ContactTypeName>String</ContactTypeName>
<IsConnectionLicenseeRole>false</IsConnectionLicenseeRole>
<IsContactLicenseeRole>false</IsContactLicenseeRole>
</UserContactConnectionModel>
</ContactConnections>
<EmailAddressBook>
<ContactEmailAddress>
<ContactId>00000000-0000-0000-0000-000000000000</ContactId>
<ContactName>String</ContactName>
<ContactPhotoURL>String</ContactPhotoURL>
<EmailAddress>String</EmailAddress>
</ContactEmailAddress>
</EmailAddressBook>
</UserContacts>