Required role: | API |
All Verbs | /api/Query/Membership |
---|
import java.math.*
import java.util.*
import net.servicestack.client.*
import com.google.gson.annotations.*
import com.google.gson.reflect.*
@AutoQueryViewer(Description="", IconUrl="octicon:database", Title="Membership")
open class FindMembership : QueryDb<MembershipInstance>()
{
}
open class QueryDb<T> : QueryBase()
{
}
@DataContract
open class QueryBase
{
@DataMember(Order=1)
var Skip:Int? = null
@DataMember(Order=2)
var Take:Int? = null
@DataMember(Order=3)
var OrderBy:String? = null
@DataMember(Order=4)
var OrderByDesc:String? = null
@DataMember(Order=5)
var Include:String? = null
@DataMember(Order=6)
var Fields:String? = null
@DataMember(Order=7)
var Meta:HashMap<String,String> = HashMap<String,String>()
}
open class MembershipInstance
{
var MembershipId:Int? = null
var StartDate:Date? = null
var EndDate:Date? = null
var ContractEndDate:Date? = null
var Name:String? = null
var EnrolmentFee:BigDecimal? = null
var InductionFee:BigDecimal? = null
var MembershipFee:BigDecimal? = null
var DirectDebitPayment:BigDecimal? = null
var DirectDebitDate:Date? = null
var Member:MemberInstance? = null
@References(MemberInstance.class)
var MemberId:Int? = null
var RefererMemberId:Int? = null
var PromotionId:Int? = null
var Payment1Fee:BigDecimal? = null
var Payment1Date:Date? = null
var Payment2Fee:BigDecimal? = null
var Payment2Date:Date? = null
var Payment1Type:Int? = null
var Payment1Method:Int? = null
var Payment2Type:Int? = null
var Payment2Method:Int? = null
var Payment3Type:Int? = null
var Payment3Method:Int? = null
var Payment3Fee:BigDecimal? = null
var Payment3Date:Date? = null
var MembershipType:MembershipTypeInstance? = null
@References(MembershipTypeInstance.class)
var MembershipTypeId:Int? = null
var ProviderId:Int? = null
var Definition:String? = null
var HasRecurringPayments:Boolean? = null
var Deleted:Boolean? = null
var Demo:Boolean? = null
var MembershipKey:UUID? = null
var SessionsRemaining:Int? = null
var ClassesRemaining:Int? = null
var Cancelled:Date? = null
var APICreated:Date? = null
var SuspensionStart:Date? = null
var SuspensionEnd:Date? = null
var IpAddress:String? = null
}
open class MemberInstance
{
var MemberId:Int? = null
var MemberType:Int? = null
var MembershipNumber:String? = null
var CardNumber:String? = null
var CompanyName:String? = null
var Surname:String? = null
var Forenames:String? = null
var Title:String? = null
var Gender:Int? = null
var DateOfBirth:Date? = null
var Address1:String? = null
var Address2:String? = null
var City:String? = null
var County:String? = null
var Postcode:String? = null
var HomePhone:String? = null
var MobilePhone:String? = null
var EmailAddress:String? = null
var EmailOptOut:Boolean? = null
var SmsOptOut:Boolean? = null
var PhoneOptOut:Boolean? = null
var LetterOptOut:Boolean? = null
var DirectDebitAccountHolder:String? = null
var DirectDebitAccountNumber:String? = null
var DirectDebitSortCode:String? = null
var JoinedDate:Date? = null
var DirectDebitBankAddress:String? = null
var FullName:String? = null
var ExternalReference:String? = null
var Photo:ByteArray? = null
var PhotoModifiedDate:Date? = null
var Notes:String? = null
var Deleted:Boolean? = null
var Demo:Boolean? = null
var UseExternalStatus:Boolean? = null
var ExternalStatus:Int? = null
var FreeText:String? = null
var MemberKey:UUID? = null
var Balance:BigDecimal? = null
var CreditLimit:BigDecimal? = null
var CreatedDate:Date? = null
var ModifiedDate:Date? = null
var DeletedDate:Date? = null
var ExternalSource:Int? = null
var RetentionMetric:BigDecimal? = null
var MonthlyAttendanceFrequency:BigDecimal? = null
var AssignedToUserId:Int? = null
var CreatedByUserId:Int? = null
var DeletedByUserId:Int? = null
var LossReason:LossReasonInstance? = null
@References(LossReasonInstance.class)
var LossReasonId:Int? = null
var WonOrLost:Int? = null
var WonOrLostDate:Date? = null
var GiftAidPermission:Boolean? = null
var PhotoPermission:Boolean? = null
var FirstAidPermission:Boolean? = null
var EmergencyContact:String? = null
var WonOrLostByUser:UserInstance? = null
@References(UserInstance.class)
var WonOrLostByUserId:Int? = null
var AgreedToTerms:Date? = null
var OnlineBookingBanned:Boolean? = null
var Country:String? = null
var FingerprintEnrolled:Date? = null
var LastPaymentAmount:BigDecimal? = null
var Pin:String? = null
var ProspectingPoints:Int? = null
var AchievementPoints:Int? = null
var ParentForenames:String? = null
var ParentSurname:String? = null
}
open class LossReasonInstance
{
var LossReasonId:Int? = null
var Reason:String? = null
var Deleted:Boolean? = null
var Demo:Boolean? = null
var Selectable:Boolean? = null
}
open class UserInstance
{
var UserId:Int? = null
var UserName:String? = null
var Name:String? = null
var Email:String? = null
var MobilePhone:String? = null
var Enabled:Boolean? = null
var LastLogin:Date? = null
var Created:Date? = null
var Training:Boolean? = null
var Deleted:Boolean? = null
var CoursesCompleted:Int? = null
var DisplayHomeNotification:Boolean? = null
var TwoFactorEnabled:Boolean? = null
var EmailConfirmed:Boolean? = null
var MobilePhoneConfirmed:Boolean? = null
var Notifications:Boolean? = null
var ChangePassword:Date? = null
var Activated:Date? = null
}
open class MembershipTypeInstance
{
var MembershipTypeId:Int? = null
var Name:String? = null
var Description:String? = null
var Definition:String? = null
var Schedule:ScheduleInstance? = null
@References(ScheduleInstance.class)
var ScheduleId:Int? = null
var Deleted:Boolean? = null
var Demo:Boolean? = null
var Public:Boolean? = null
var SessionsRemaining:Int? = null
var ClassesRemaining:Int? = null
var SortOrder:Int? = null
var Special:Boolean? = null
var MultiSiteAccess:Boolean? = null
var MemberLimit:Int? = null
var PromotionCode:String? = null
var PromotionStart:Date? = null
var PromotionEnd:Date? = null
var LicensesRemaining:Int? = null
var BookingAccessOnly:Boolean? = null
var SessionsPeriod:Int? = null
var SessionsFrequency:Int? = null
var StartsOn:Date? = null
var AllowSelectionAfterStartsOn:Boolean? = null
}
open class ScheduleInstance
{
var ScheduleId:Int? = null
var Name:String? = null
var Description:String? = null
var MondayFrom:TimeSpan? = null
var MondayTo:TimeSpan? = null
var TuesdayFrom:TimeSpan? = null
var TuesdayTo:TimeSpan? = null
var WednesdayFrom:TimeSpan? = null
var WednesdayTo:TimeSpan? = null
var ThursdayFrom:TimeSpan? = null
var ThursdayTo:TimeSpan? = null
var FridayFrom:TimeSpan? = null
var FridayTo:TimeSpan? = null
var SaturdayFrom:TimeSpan? = null
var SaturdayTo:TimeSpan? = null
var SundayFrom:TimeSpan? = null
var SundayTo:TimeSpan? = null
var ScheduleType:Int? = null
var Deleted:Boolean? = null
var Demo:Boolean? = null
}
@DataContract
open class QueryResponse<T>
{
@DataMember(Order=1)
var Offset:Int? = null
@DataMember(Order=2)
var Total:Int? = null
@DataMember(Order=3)
var Results:ArrayList<T> = ArrayList<T>()
@DataMember(Order=4)
var Meta:HashMap<String,String> = HashMap<String,String>()
@DataMember(Order=5)
var ResponseStatus:ResponseStatus? = null
}
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/Membership 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: [ { MembershipId: 0, StartDate: 0001-01-01, EndDate: 0001-01-01, ContractEndDate: 0001-01-01, Name: String, EnrolmentFee: 0, InductionFee: 0, MembershipFee: 0, DirectDebitPayment: 0, DirectDebitDate: 0001-01-01, 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, RefererMemberId: 0, PromotionId: 0, Payment1Fee: 0, Payment1Date: 0001-01-01, Payment2Fee: 0, Payment2Date: 0001-01-01, Payment1Type: 0, Payment1Method: 0, Payment2Type: 0, Payment2Method: 0, Payment3Type: 0, Payment3Method: 0, Payment3Fee: 0, Payment3Date: 0001-01-01, MembershipType: { MembershipTypeId: 0, Name: String, Description: String, Definition: String, Schedule: { ScheduleId: 0, Name: String, Description: String, MondayFrom: PT0S, MondayTo: PT0S, TuesdayFrom: PT0S, TuesdayTo: PT0S, WednesdayFrom: PT0S, WednesdayTo: PT0S, ThursdayFrom: PT0S, ThursdayTo: PT0S, FridayFrom: PT0S, FridayTo: PT0S, SaturdayFrom: PT0S, SaturdayTo: PT0S, SundayFrom: PT0S, SundayTo: PT0S, ScheduleType: 0, Deleted: False, Demo: False }, ScheduleId: 0, Deleted: False, Demo: False, Public: False, SessionsRemaining: 0, ClassesRemaining: 0, SortOrder: 0, Special: False, MultiSiteAccess: False, MemberLimit: 0, PromotionCode: String, PromotionStart: 0001-01-01, PromotionEnd: 0001-01-01, LicensesRemaining: 0, BookingAccessOnly: False, SessionsPeriod: 0, SessionsFrequency: 0, StartsOn: 0001-01-01, AllowSelectionAfterStartsOn: False }, MembershipTypeId: 0, ProviderId: 0, Definition: String, HasRecurringPayments: False, Deleted: False, Demo: False, MembershipKey: 00000000000000000000000000000000, SessionsRemaining: 0, ClassesRemaining: 0, Cancelled: 0001-01-01, APICreated: 0001-01-01, SuspensionStart: 0001-01-01, SuspensionEnd: 0001-01-01, IpAddress: String } ], Meta: { String: String }, ResponseStatus: { ErrorCode: String, Message: String, StackTrace: String, Errors: [ { ErrorCode: String, FieldName: String, Message: String, Meta: { String: String } } ], Meta: { String: String } } }