POST,GET | /api/Member/GetMember |
---|
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 Gender(str, Enum):
UNKNOWN = 'Unknown'
MALE = 'Male'
FEMALE = 'Female'
OTHER = 'Other'
PREFER_NOT_TO_SAY = 'PreferNotToSay'
class ExternalStatus(str, Enum):
OFF = 'Off'
ACTIVE = 'Active'
PENDING = 'Pending'
CANCELLED_INSIDE_CONTRACT = 'CancelledInsideContract'
CANCELLED_OUTSIDE_CONTRACT = 'CancelledOutsideContract'
WITH_DEBT_RECOVERY = 'WithDebtRecovery'
SUSPENDED = 'Suspended'
class MemberType(str, Enum):
PROSPECT = 'Prospect'
ACTIVE = 'Active'
CANCELLED = 'Cancelled'
EXPIRED = 'Expired'
SUSPENDED = 'Suspended'
CLUB_CANCELLED = 'ClubCancelled'
DROP_OUT = 'DropOut'
class MembershipState(str, Enum):
PROSPECT = 'Prospect'
ACTIVE = 'Active'
EXPIRED = 'Expired'
CANCELLED = 'Cancelled'
PAYMENT_REQUIRED = 'PaymentRequired'
SUSPENDED = 'Suspended'
# @Flags()
class MessageTemplateContentType(IntEnum):
TRANSACTIONAL = 1
MARKETING = 2
NONE = 1048576
# @Flags()
class MessageTemplateType(IntEnum):
SMS = 1
EMAIL = 2
TELEPHONE = 4
DIRECT_MAIL = 8
NOTIFICATION = 16
PAGE = 32
NONE = 1048576
NO_CONSENT = 2097152
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Member:
member_id: Optional[int] = None
branch_id: Optional[int] = None
membership_number: Optional[str] = None
joined_date: Optional[datetime.datetime] = None
card_number: Optional[str] = None
company_name: Optional[str] = None
gender: Optional[Gender] = None
gender_name: Optional[str] = None
full_name: Optional[str] = None
title: Optional[str] = None
forenames: Optional[str] = None
surname: Optional[str] = None
address1: Optional[str] = None
address2: Optional[str] = None
county: Optional[str] = None
city: Optional[str] = None
home_phone: Optional[str] = None
mobile_phone: Optional[str] = None
email_address: Optional[str] = None
external_reference: Optional[str] = None
country: Optional[str] = None
email_opt_out: Optional[bool] = None
sms_opt_out: Optional[bool] = None
phone_opt_out: Optional[bool] = None
letter_opt_out: Optional[bool] = None
use_external_status: Optional[bool] = None
external_status: Optional[ExternalStatus] = None
date_of_birth: Optional[datetime.datetime] = None
postcode: Optional[str] = None
notes: Optional[str] = None
start_date: Optional[datetime.datetime] = None
expires: Optional[datetime.datetime] = None
sessions_remaining: Optional[int] = None
contract_end_date: Optional[datetime.datetime] = None
days_remaining: Optional[int] = None
membership_type: Optional[str] = None
last_attendance: Optional[datetime.datetime] = None
attendance: Optional[int] = None
member_type: Optional[MemberType] = None
recurring_payments: Optional[int] = None
overdue_payments: Optional[int] = None
attendance_this_week: Optional[int] = None
retention_metric: Optional[Decimal] = None
monthly_attendance_frequency: Optional[Decimal] = None
total_product_spend: Optional[Decimal] = None
journal_entry: Optional[str] = None
balance: Optional[Decimal] = None
credit_limit: Optional[Decimal] = None
guid: Optional[str] = None
membership_state: Optional[MembershipState] = None
bookings_attended: Optional[int] = None
date_of_last_booking: Optional[datetime.datetime] = None
photo_modified_date: Optional[datetime.datetime] = None
created_date: Optional[datetime.datetime] = None
modified_date: Optional[datetime.datetime] = None
deleted_date: Optional[datetime.datetime] = None
member_key: Optional[str] = None
created_by_user_id: Optional[int] = None
assigned_to_user_id: Optional[int] = None
deleted_by_user_id: Optional[int] = None
gift_aid_permission: Optional[bool] = None
first_aid_permission: Optional[bool] = None
photo_permission: Optional[bool] = None
emergency_contact: Optional[str] = None
won_or_lost: Optional[int] = None
won_or_lost_date: Optional[datetime.datetime] = None
won_or_lost_by_user_id: Optional[int] = None
license_reference: Optional[str] = None
license_start_date: Optional[datetime.datetime] = None
license_renewal_date: Optional[datetime.datetime] = None
agreed_to_terms: Optional[datetime.datetime] = None
online_booking_banned: Optional[bool] = None
child_branch_id: Optional[int] = None
child_branch: Optional[str] = None
prospecting_points: Optional[int] = None
achievement_points: Optional[int] = None
parent_forenames: Optional[str] = None
parent_surname: Optional[str] = None
grading_readiness: Optional[int] = None
direct_debit_account_holder: Optional[str] = None
direct_debit_account_number: Optional[str] = None
direct_debit_sort_code: Optional[str] = None
direct_debit_bank_address: Optional[str] = None
invited_date: Optional[datetime.datetime] = None
grade: Optional[str] = None
colour_left: Optional[str] = None
colour_right: Optional[str] = None
sessions_to_complete: Optional[int] = None
unique_id: Optional[str] = None
preference_link: Optional[str] = None
marketing_all_link: Optional[str] = None
marketing_none_link: Optional[str] = None
app_registration_id: Optional[str] = None
app_registration_link: Optional[str] = None
app_qr_image_link: Optional[str] = None
card_number_qr_image_link: Optional[str] = None
photo_thumbnail_link: Optional[str] = None
content_types_opt_in: Optional[MessageTemplateContentType] = None
template_types_opt_in: Optional[MessageTemplateType] = None
can_email: Optional[bool] = None
can_direct_mail: Optional[bool] = None
can_s_m_s: Optional[bool] = None
can_telephone: Optional[bool] = None
no_marketing_consent: Optional[bool] = None
can_send_invite: Optional[bool] = None
branch_key: Optional[str] = None
sage_link: Optional[str] = None
sage_last_payment_date: Optional[datetime.datetime] = None
sage_first_payment_date: Optional[datetime.datetime] = None
sage_last_payment_amount: Optional[Decimal] = None
sage_first_payment_amount: Optional[Decimal] = None
sage_total_paid: Optional[Decimal] = None
Python MemberService.GetMemberRequest 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 /api/Member/GetMember HTTP/1.1
Host: api.clubmanagercentral.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<MemberService.GetMemberRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ClubManager.Api.Services">
<MemberId>0</MemberId>
</MemberService.GetMemberRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <Member xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ClubManager.Interfaces.Models.Member"> <_x003C_AchievementPoints_x003E_k__BackingField>0</_x003C_AchievementPoints_x003E_k__BackingField> <_x003C_Address1_x003E_k__BackingField>String</_x003C_Address1_x003E_k__BackingField> <_x003C_Address2_x003E_k__BackingField>String</_x003C_Address2_x003E_k__BackingField> <_x003C_AgreedToTerms_x003E_k__BackingField>0001-01-01T00:00:00</_x003C_AgreedToTerms_x003E_k__BackingField> <_x003C_AssignedToUserId_x003E_k__BackingField>0</_x003C_AssignedToUserId_x003E_k__BackingField> <_x003C_AttendanceThisWeek_x003E_k__BackingField>0</_x003C_AttendanceThisWeek_x003E_k__BackingField> <_x003C_Attendance_x003E_k__BackingField>0</_x003C_Attendance_x003E_k__BackingField> <_x003C_Balance_x003E_k__BackingField>0</_x003C_Balance_x003E_k__BackingField> <_x003C_BookingsAttended_x003E_k__BackingField>0</_x003C_BookingsAttended_x003E_k__BackingField> <_x003C_BranchId_x003E_k__BackingField>0</_x003C_BranchId_x003E_k__BackingField> <_x003C_BranchKey_x003E_k__BackingField>00000000-0000-0000-0000-000000000000</_x003C_BranchKey_x003E_k__BackingField> <_x003C_CardNumber_x003E_k__BackingField>String</_x003C_CardNumber_x003E_k__BackingField> <_x003C_ChildBranchId_x003E_k__BackingField>0</_x003C_ChildBranchId_x003E_k__BackingField> <_x003C_ChildBranch_x003E_k__BackingField>String</_x003C_ChildBranch_x003E_k__BackingField> <_x003C_City_x003E_k__BackingField>String</_x003C_City_x003E_k__BackingField> <_x003C_ColourLeft_x003E_k__BackingField>String</_x003C_ColourLeft_x003E_k__BackingField> <_x003C_ColourRight_x003E_k__BackingField>String</_x003C_ColourRight_x003E_k__BackingField> <_x003C_CompanyName_x003E_k__BackingField>String</_x003C_CompanyName_x003E_k__BackingField> <_x003C_ContentTypesOptIn_x003E_k__BackingField>Transactional</_x003C_ContentTypesOptIn_x003E_k__BackingField> <_x003C_ContractEndDate_x003E_k__BackingField>0001-01-01T00:00:00</_x003C_ContractEndDate_x003E_k__BackingField> <_x003C_Country_x003E_k__BackingField>String</_x003C_Country_x003E_k__BackingField> <_x003C_County_x003E_k__BackingField>String</_x003C_County_x003E_k__BackingField> <_x003C_CreatedByUserId_x003E_k__BackingField>0</_x003C_CreatedByUserId_x003E_k__BackingField> <_x003C_CreatedDate_x003E_k__BackingField>0001-01-01T00:00:00</_x003C_CreatedDate_x003E_k__BackingField> <_x003C_CreditLimit_x003E_k__BackingField>0</_x003C_CreditLimit_x003E_k__BackingField> <_x003C_DateOfBirth_x003E_k__BackingField>0001-01-01T00:00:00</_x003C_DateOfBirth_x003E_k__BackingField> <_x003C_DateOfLastBooking_x003E_k__BackingField>0001-01-01T00:00:00</_x003C_DateOfLastBooking_x003E_k__BackingField> <_x003C_DaysRemaining_x003E_k__BackingField>0</_x003C_DaysRemaining_x003E_k__BackingField> <_x003C_DeletedByUserId_x003E_k__BackingField>0</_x003C_DeletedByUserId_x003E_k__BackingField> <_x003C_DeletedDate_x003E_k__BackingField>0001-01-01T00:00:00</_x003C_DeletedDate_x003E_k__BackingField> <_x003C_DirectDebitAccountHolder_x003E_k__BackingField>String</_x003C_DirectDebitAccountHolder_x003E_k__BackingField> <_x003C_DirectDebitAccountNumber_x003E_k__BackingField>String</_x003C_DirectDebitAccountNumber_x003E_k__BackingField> <_x003C_DirectDebitBankAddress_x003E_k__BackingField>String</_x003C_DirectDebitBankAddress_x003E_k__BackingField> <_x003C_DirectDebitSortCode_x003E_k__BackingField>String</_x003C_DirectDebitSortCode_x003E_k__BackingField> <_x003C_EmailAddress_x003E_k__BackingField>String</_x003C_EmailAddress_x003E_k__BackingField> <_x003C_EmailOptOut_x003E_k__BackingField>false</_x003C_EmailOptOut_x003E_k__BackingField> <_x003C_EmergencyContact_x003E_k__BackingField>String</_x003C_EmergencyContact_x003E_k__BackingField> <_x003C_Expires_x003E_k__BackingField>0001-01-01T00:00:00</_x003C_Expires_x003E_k__BackingField> <_x003C_ExternalReference_x003E_k__BackingField>String</_x003C_ExternalReference_x003E_k__BackingField> <_x003C_ExternalStatus_x003E_k__BackingField>Off</_x003C_ExternalStatus_x003E_k__BackingField> <_x003C_FirstAidPermission_x003E_k__BackingField>false</_x003C_FirstAidPermission_x003E_k__BackingField> <_x003C_Forenames_x003E_k__BackingField>String</_x003C_Forenames_x003E_k__BackingField> <_x003C_FullName_x003E_k__BackingField>String</_x003C_FullName_x003E_k__BackingField> <_x003C_GenderName_x003E_k__BackingField>String</_x003C_GenderName_x003E_k__BackingField> <_x003C_Gender_x003E_k__BackingField>Unknown</_x003C_Gender_x003E_k__BackingField> <_x003C_GiftAidPermission_x003E_k__BackingField>false</_x003C_GiftAidPermission_x003E_k__BackingField> <_x003C_Grade_x003E_k__BackingField>String</_x003C_Grade_x003E_k__BackingField> <_x003C_GradingReadiness_x003E_k__BackingField>0</_x003C_GradingReadiness_x003E_k__BackingField> <_x003C_HomePhone_x003E_k__BackingField>String</_x003C_HomePhone_x003E_k__BackingField> <_x003C_InvitedDate_x003E_k__BackingField>0001-01-01T00:00:00</_x003C_InvitedDate_x003E_k__BackingField> <_x003C_JoinedDate_x003E_k__BackingField>0001-01-01T00:00:00</_x003C_JoinedDate_x003E_k__BackingField> <_x003C_JournalEntry_x003E_k__BackingField>String</_x003C_JournalEntry_x003E_k__BackingField> <_x003C_LastAttendance_x003E_k__BackingField>0001-01-01T00:00:00</_x003C_LastAttendance_x003E_k__BackingField> <_x003C_LetterOptOut_x003E_k__BackingField>false</_x003C_LetterOptOut_x003E_k__BackingField> <_x003C_LicenseReference_x003E_k__BackingField>String</_x003C_LicenseReference_x003E_k__BackingField> <_x003C_LicenseRenewalDate_x003E_k__BackingField>0001-01-01T00:00:00</_x003C_LicenseRenewalDate_x003E_k__BackingField> <_x003C_LicenseStartDate_x003E_k__BackingField>0001-01-01T00:00:00</_x003C_LicenseStartDate_x003E_k__BackingField> <_x003C_MemberId_x003E_k__BackingField>0</_x003C_MemberId_x003E_k__BackingField> <_x003C_MemberKey_x003E_k__BackingField>00000000-0000-0000-0000-000000000000</_x003C_MemberKey_x003E_k__BackingField> <_x003C_MemberType_x003E_k__BackingField>Prospect</_x003C_MemberType_x003E_k__BackingField> <_x003C_MembershipNumber_x003E_k__BackingField>String</_x003C_MembershipNumber_x003E_k__BackingField> <_x003C_MembershipState_x003E_k__BackingField>Prospect</_x003C_MembershipState_x003E_k__BackingField> <_x003C_MembershipType_x003E_k__BackingField>String</_x003C_MembershipType_x003E_k__BackingField> <_x003C_MobilePhone_x003E_k__BackingField>String</_x003C_MobilePhone_x003E_k__BackingField> <_x003C_ModifiedDate_x003E_k__BackingField>0001-01-01T00:00:00</_x003C_ModifiedDate_x003E_k__BackingField> <_x003C_MonthlyAttendanceFrequency_x003E_k__BackingField>0</_x003C_MonthlyAttendanceFrequency_x003E_k__BackingField> <_x003C_Notes_x003E_k__BackingField>String</_x003C_Notes_x003E_k__BackingField> <_x003C_OnlineBookingBanned_x003E_k__BackingField>false</_x003C_OnlineBookingBanned_x003E_k__BackingField> <_x003C_OverduePayments_x003E_k__BackingField>0</_x003C_OverduePayments_x003E_k__BackingField> <_x003C_ParentForenames_x003E_k__BackingField>String</_x003C_ParentForenames_x003E_k__BackingField> <_x003C_ParentSurname_x003E_k__BackingField>String</_x003C_ParentSurname_x003E_k__BackingField> <_x003C_PhoneOptOut_x003E_k__BackingField>false</_x003C_PhoneOptOut_x003E_k__BackingField> <_x003C_PhotoModifiedDate_x003E_k__BackingField>0001-01-01T00:00:00</_x003C_PhotoModifiedDate_x003E_k__BackingField> <_x003C_PhotoPermission_x003E_k__BackingField>false</_x003C_PhotoPermission_x003E_k__BackingField> <_x003C_Postcode_x003E_k__BackingField>String</_x003C_Postcode_x003E_k__BackingField> <_x003C_ProspectingPoints_x003E_k__BackingField>0</_x003C_ProspectingPoints_x003E_k__BackingField> <_x003C_RecurringPayments_x003E_k__BackingField>0</_x003C_RecurringPayments_x003E_k__BackingField> <_x003C_SageFirstPaymentAmount_x003E_k__BackingField>0</_x003C_SageFirstPaymentAmount_x003E_k__BackingField> <_x003C_SageFirstPaymentDate_x003E_k__BackingField>0001-01-01T00:00:00</_x003C_SageFirstPaymentDate_x003E_k__BackingField> <_x003C_SageLastPaymentAmount_x003E_k__BackingField>0</_x003C_SageLastPaymentAmount_x003E_k__BackingField> <_x003C_SageLastPaymentDate_x003E_k__BackingField>0001-01-01T00:00:00</_x003C_SageLastPaymentDate_x003E_k__BackingField> <_x003C_SageLink_x003E_k__BackingField>String</_x003C_SageLink_x003E_k__BackingField> <_x003C_SageTotalPaid_x003E_k__BackingField>0</_x003C_SageTotalPaid_x003E_k__BackingField> <_x003C_SessionsRemaining_x003E_k__BackingField>0</_x003C_SessionsRemaining_x003E_k__BackingField> <_x003C_SessionsToComplete_x003E_k__BackingField>0</_x003C_SessionsToComplete_x003E_k__BackingField> <_x003C_SmsOptOut_x003E_k__BackingField>false</_x003C_SmsOptOut_x003E_k__BackingField> <_x003C_StartDate_x003E_k__BackingField>0001-01-01T00:00:00</_x003C_StartDate_x003E_k__BackingField> <_x003C_Surname_x003E_k__BackingField>String</_x003C_Surname_x003E_k__BackingField> <_x003C_TemplateTypesOptIn_x003E_k__BackingField>SMS</_x003C_TemplateTypesOptIn_x003E_k__BackingField> <_x003C_Title_x003E_k__BackingField>String</_x003C_Title_x003E_k__BackingField> <_x003C_TotalProductSpend_x003E_k__BackingField>0</_x003C_TotalProductSpend_x003E_k__BackingField> <_x003C_UseExternalStatus_x003E_k__BackingField>false</_x003C_UseExternalStatus_x003E_k__BackingField> <_x003C_WonOrLostByUserId_x003E_k__BackingField>0</_x003C_WonOrLostByUserId_x003E_k__BackingField> <_x003C_WonOrLostDate_x003E_k__BackingField>0001-01-01T00:00:00</_x003C_WonOrLostDate_x003E_k__BackingField> <_x003C_WonOrLost_x003E_k__BackingField>0</_x003C_WonOrLost_x003E_k__BackingField> <_x003C_guid_x003E_k__BackingField>00000000-0000-0000-0000-000000000000</_x003C_guid_x003E_k__BackingField> <_x003C_retentionMetric_x003E_k__BackingField>0</_x003C_retentionMetric_x003E_k__BackingField> </Member>