Required role: | API |
All Verbs | /api/Query/MemberGetProspectMembers |
---|
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 QueryBase:
skip: Optional[int] = None
take: Optional[int] = None
order_by: Optional[str] = None
order_by_desc: Optional[str] = None
include: Optional[str] = None
fields: Optional[str] = None
meta: Optional[Dict[str, str]] = None
T = TypeVar('T')
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class QueryDb(Generic[T], QueryBase, IReturn[QueryResponse[T]]):
@staticmethod
def response_type(): return QueryResponse[T]
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class LossReasonInstance:
loss_reason_id: Optional[int] = None
reason: Optional[str] = None
deleted: Optional[bool] = None
demo: Optional[bool] = None
selectable: Optional[bool] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class UserInstance:
user_id: Optional[int] = None
user_name: Optional[str] = None
name: Optional[str] = None
email: Optional[str] = None
mobile_phone: Optional[str] = None
enabled: Optional[bool] = None
last_login: Optional[datetime.datetime] = None
created: Optional[datetime.datetime] = None
training: Optional[bool] = None
deleted: Optional[bool] = None
courses_completed: Optional[int] = None
display_home_notification: Optional[bool] = None
two_factor_enabled: Optional[bool] = None
email_confirmed: Optional[bool] = None
mobile_phone_confirmed: Optional[bool] = None
notifications: Optional[bool] = None
change_password: Optional[datetime.datetime] = None
activated: Optional[datetime.datetime] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class MemberInstance:
member_id: Optional[int] = None
member_type: Optional[int] = None
membership_number: Optional[str] = None
card_number: Optional[str] = None
company_name: Optional[str] = None
surname: Optional[str] = None
forenames: Optional[str] = None
title: Optional[str] = None
gender: Optional[int] = None
date_of_birth: Optional[datetime.datetime] = None
address1: Optional[str] = None
address2: Optional[str] = None
city: Optional[str] = None
county: Optional[str] = None
postcode: Optional[str] = None
home_phone: Optional[str] = None
mobile_phone: Optional[str] = None
email_address: 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
direct_debit_account_holder: Optional[str] = None
direct_debit_account_number: Optional[str] = None
direct_debit_sort_code: Optional[str] = None
joined_date: Optional[datetime.datetime] = None
direct_debit_bank_address: Optional[str] = None
full_name: Optional[str] = None
external_reference: Optional[str] = None
photo: Optional[bytes] = None
photo_modified_date: Optional[datetime.datetime] = None
notes: Optional[str] = None
deleted: Optional[bool] = None
demo: Optional[bool] = None
use_external_status: Optional[bool] = None
external_status: Optional[int] = None
free_text: Optional[str] = None
member_key: Optional[str] = None
balance: Optional[Decimal] = None
credit_limit: Optional[Decimal] = None
created_date: Optional[datetime.datetime] = None
modified_date: Optional[datetime.datetime] = None
deleted_date: Optional[datetime.datetime] = None
external_source: Optional[int] = None
retention_metric: Optional[Decimal] = None
monthly_attendance_frequency: Optional[Decimal] = None
assigned_to_user_id: Optional[int] = None
created_by_user_id: Optional[int] = None
deleted_by_user_id: Optional[int] = None
loss_reason: Optional[LossReasonInstance] = None
# @References(typeof(LossReasonInstance))
loss_reason_id: Optional[int] = None
won_or_lost: Optional[int] = None
won_or_lost_date: Optional[datetime.datetime] = None
gift_aid_permission: Optional[bool] = None
photo_permission: Optional[bool] = None
first_aid_permission: Optional[bool] = None
emergency_contact: Optional[str] = None
won_or_lost_by_user: Optional[UserInstance] = None
# @References(typeof(UserInstance))
won_or_lost_by_user_id: Optional[int] = None
agreed_to_terms: Optional[datetime.datetime] = None
online_booking_banned: Optional[bool] = None
country: Optional[str] = None
fingerprint_enrolled: Optional[datetime.datetime] = None
last_payment_amount: Optional[Decimal] = None
pin: Optional[str] = None
prospecting_points: Optional[int] = None
achievement_points: Optional[int] = None
parent_forenames: Optional[str] = None
parent_surname: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class MemberGetProspectMembersInstance:
member: Optional[MemberInstance] = None
# @References(typeof(MemberInstance))
member_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
full_name: Optional[str] = None
gender: Optional[int] = None
title: Optional[str] = None
forenames: Optional[str] = None
surname: Optional[str] = None
home_phone: Optional[str] = None
mobile_phone: Optional[str] = None
email_address: Optional[str] = None
date_of_birth: Optional[datetime.datetime] = None
postcode: Optional[str] = None
address1: Optional[str] = None
address2: Optional[str] = None
city: Optional[str] = None
county: 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[int] = None
recurring_payments: Optional[int] = None
overdue_payments: Optional[int] = None
branch_key: Optional[str] = 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
bookings_attended: Optional[int] = None
date_of_last_booking: Optional[datetime.datetime] = None
balance: Optional[Decimal] = None
credit_limit: Optional[Decimal] = None
member_key: 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[int] = None
created_date: Optional[datetime.datetime] = None
modified_date: Optional[datetime.datetime] = None
photo_modified_date: Optional[datetime.datetime] = None
deleted_date: Optional[datetime.datetime] = None
external_reference: Optional[str] = None
recurring_payments_paid_in_last30_days: Optional[int] = None
membership_state: Optional[int] = None
has_recurring_payments: Optional[int] = None
license_renewal_date: Optional[datetime.datetime] = None
license_reference: Optional[str] = None
license_start_date: Optional[datetime.datetime] = None
payment_recurrence_count: Optional[int] = None
# @AutoQueryViewer(Description="", IconUrl="octicon:database", Title="MemberGetProspectMembers")
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ViewMemberGetProspectMembers(QueryDb[MemberGetProspectMembersInstance]):
pass
T = TypeVar('T')
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class QueryResponse(Generic[T]):
offset: Optional[int] = None
total: Optional[int] = None
results: Optional[List[T]] = None
meta: Optional[Dict[str, str]] = None
response_status: Optional[ResponseStatus] = None
Python ViewMemberGetProspectMembers DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /api/Query/MemberGetProspectMembers HTTP/1.1
Host: api.clubmanagercentral.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
Skip: 0,
Take: 0,
OrderBy: String,
OrderByDesc: String,
Include: String,
Fields: String,
Meta:
{
String: String
}
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { Offset: 0, Total: 0, Results: [ { Member: { MemberId: 0, MemberType: 0, MembershipNumber: String, CardNumber: String, CompanyName: String, Surname: String, Forenames: String, Title: String, Gender: 0, DateOfBirth: 0001-01-01, Address1: String, Address2: String, City: String, County: String, Postcode: String, HomePhone: String, MobilePhone: String, EmailAddress: String, EmailOptOut: False, SmsOptOut: False, PhoneOptOut: False, LetterOptOut: False, DirectDebitAccountHolder: String, DirectDebitAccountNumber: String, DirectDebitSortCode: String, JoinedDate: 0001-01-01, DirectDebitBankAddress: String, FullName: String, ExternalReference: String, Photo: AA==, PhotoModifiedDate: 0001-01-01, Notes: String, Deleted: False, Demo: False, UseExternalStatus: False, ExternalStatus: 0, FreeText: String, MemberKey: 00000000000000000000000000000000, Balance: 0, CreditLimit: 0, CreatedDate: 0001-01-01, ModifiedDate: 0001-01-01, DeletedDate: 0001-01-01, ExternalSource: 0, RetentionMetric: 0, MonthlyAttendanceFrequency: 0, AssignedToUserId: 0, CreatedByUserId: 0, DeletedByUserId: 0, LossReason: { LossReasonId: 0, Reason: String, Deleted: False, Demo: False, Selectable: False }, LossReasonId: 0, WonOrLost: 0, WonOrLostDate: 0001-01-01, GiftAidPermission: False, PhotoPermission: False, FirstAidPermission: False, EmergencyContact: String, WonOrLostByUser: { UserId: 0, UserName: String, Name: String, Email: String, MobilePhone: String, Enabled: False, LastLogin: 0001-01-01, Created: 0001-01-01, Training: False, Deleted: False, CoursesCompleted: 0, DisplayHomeNotification: False, TwoFactorEnabled: False, EmailConfirmed: False, MobilePhoneConfirmed: False, Notifications: False, ChangePassword: 0001-01-01, Activated: 0001-01-01 }, WonOrLostByUserId: 0, AgreedToTerms: 0001-01-01, OnlineBookingBanned: False, Country: String, FingerprintEnrolled: 0001-01-01, LastPaymentAmount: 0, Pin: String, ProspectingPoints: 0, AchievementPoints: 0, ParentForenames: String, ParentSurname: String }, MemberId: 0, MembershipNumber: String, JoinedDate: 0001-01-01, CardNumber: String, CompanyName: String, FullName: String, Gender: 0, Title: String, Forenames: String, Surname: String, HomePhone: String, MobilePhone: String, EmailAddress: String, DateOfBirth: 0001-01-01, Postcode: String, Address1: String, Address2: String, City: String, County: String, StartDate: 0001-01-01, Expires: 0001-01-01, SessionsRemaining: 0, ContractEndDate: 0001-01-01, DaysRemaining: 0, MembershipType: String, LastAttendance: 0001-01-01, Attendance: 0, MemberType: 0, RecurringPayments: 0, OverduePayments: 0, BranchKey: 00000000000000000000000000000000, AttendanceThisWeek: 0, retentionMetric: 0, MonthlyAttendanceFrequency: 0, TotalProductSpend: 0, JournalEntry: String, BookingsAttended: 0, DateOfLastBooking: 0001-01-01, Balance: 0, CreditLimit: 0, MemberKey: 00000000000000000000000000000000, EmailOptOut: False, SmsOptOut: False, PhoneOptOut: False, LetterOptOut: False, UseExternalStatus: False, ExternalStatus: 0, CreatedDate: 0001-01-01, ModifiedDate: 0001-01-01, PhotoModifiedDate: 0001-01-01, DeletedDate: 0001-01-01, ExternalReference: String, RecurringPaymentsPaidInLast30Days: 0, MembershipState: 0, HasRecurringPayments: 0, LicenseRenewalDate: 0001-01-01, LicenseReference: String, LicenseStartDate: 0001-01-01, PaymentRecurrenceCount: 0 } ], Meta: { String: String }, ResponseStatus: { ErrorCode: String, Message: String, StackTrace: String, Errors: [ { ErrorCode: String, FieldName: String, Message: String, Meta: { String: String } } ], Meta: { String: String } } }