Documentation ¶
Overview ¶
Copyright (c) 2022 Theofanis Vassiliou-Gioles
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Index ¶
- Constants
- func NewGuestIterator(guests []Guest) func() *Guest
- func OptionAPIURL(u string) func(*Client)
- func OptionClientCredentials(id, secret string) func(*Client)
- func OptionDebug(b bool) func(*Client)
- func OptionEnvFile(fileName string) func(*Client)
- func OptionLog(l logger) func(*Client)
- func OptionTOKENURL(u string) func(*Client)
- func OptionUseDevEnv() func(*Client)
- func OptionUseStagingEnv() func(*Client)
- type AttendanceMode
- type AttendanceState
- type AuthTestResponse
- type Categories
- type Category
- type CategorySearchParameter
- type Client
- func (api *Client) BulkImportFinishUpload(gibID string) error
- func (api *Client) BulkImportInOneGo(gbi GuestBulkImport) (*GuestBulkImport, error)
- func (api *Client) BulkImportInOneGoContext(ctx context.Context, gbi GuestBulkImport) (*GuestBulkImport, error)
- func (api *Client) BulkImportStateContext(ctx context.Context, gibID string) error
- func (api *Client) BulkImportUpdateBatch(gibID string, guests Guests) error
- func (api *Client) BulkImportUpdateBatchContext(ctx context.Context, gibID string, guests Guests) error
- func (api *Client) CheckCredentials() (bool, error)
- func (api *Client) CheckCredentialsContext(ctx context.Context) (bool, error)
- func (api *Client) CreateGuest(g Guest) (*Guest, error)
- func (api *Client) CreateGuestBulkImportObject(gbi GuestBulkImport) (*GuestBulkImport, error)
- func (api *Client) CreateGuestBulkImportObjectContext(ctx context.Context, gbi GuestBulkImport) (*GuestBulkImport, error)
- func (api *Client) CreateGuestContext(ctx context.Context, g Guest) (*Guest, error)
- func (api *Client) Debug() bool
- func (api *Client) Debugf(format string, v ...interface{})
- func (api *Client) Debugln(v ...interface{})
- func (api *Client) DeleteGuest(guestId string) error
- func (api *Client) DeleteGuestBulkImportObject(gbiId string) error
- func (api *Client) DeleteGuestBulkImportObjectContext(ctx context.Context, gbiId string) error
- func (api *Client) DeleteGuestContext(ctx context.Context, guestId string) error
- func (api *Client) GetAllBulkImports(s ...GuestBulkImportSearchParameter) (*GuestBulkImports, error)
- func (api *Client) GetAllBulkImportsContext(ctx context.Context, params GuestBulkImportSearchParameter) (*GuestBulkImports, error)
- func (api *Client) GetCategories(eventId string) (*Categories, error)
- func (api *Client) GetCategoriesContext(ctx context.Context, eventId string, params CategorySearchParameter) (*Categories, error)
- func (api *Client) GetCategoryById(categoryId string) (*Category, error)
- func (api *Client) GetCategoryByIdContext(ctx context.Context, categoryId string) (*Category, error)
- func (api *Client) GetEventById(id string) (*Event, error)
- func (api *Client) GetEventByIdContext(ctx context.Context, id string) (*Event, error)
- func (api *Client) GetEventStatistics() (*EventStatistics, error)
- func (api *Client) GetEventStatisticsByID(id string) (*EventStatistic, error)
- func (api *Client) GetEventStatisticsByIDContext(ctx context.Context, eventID string) (*EventStatistic, error)
- func (api *Client) GetEventStatisticsContext(ctx context.Context, params EventStatisticsSearchParameter) (*EventStatistics, error)
- func (api *Client) GetEvents() (*Events, error)
- func (api *Client) GetEventsContext(ctx context.Context, params EventSearchParameter) (*Events, error)
- func (api *Client) GetGuestById(guestId string) (*Guest, error)
- func (api *Client) GetGuestByIdContext(ctx context.Context, guestID string) (*Guest, error)
- func (api *Client) GetGuests(eventId string) (*Guests, error)
- func (api *Client) GetGuestsContext(ctx context.Context, eventId string, params GuestSearchParameter) (*Guests, error)
- func (api *Client) GetGuestsPaginated(eventId string, pp PaginationParameter) (GuestPages, error)
- func (api *Client) GetGuestsPaginatedContext(ctx context.Context, eventId string, pages PaginationParameter, ...) (GuestPages, error)
- func (api *Client) GetSpecificBulkImport(gbiId string) (*GuestBulkImport, error)
- func (api *Client) GetSpecificBulkImportContext(ctx context.Context, gbiId string) (*GuestBulkImport, error)
- func (api *Client) GetSpecificBulkImportState(gbiId string) (*GuestBulkImportState, error)
- func (api *Client) GetSpecificBulkImportStateContext(ctx context.Context, gbiId string) (*GuestBulkImportState, error)
- func (api *Client) Listen() (chan *GuestUpdate, error)
- func (api *Client) SearchEventStatistics(params EventStatisticsSearchParameter) (*EventStatistics, error)
- func (api *Client) SearchEvents(params EventSearchParameter) (*Events, error)
- func (api *Client) SearchGuests(id string, params GuestSearchParameter) (*Guests, error)
- func (api *Client) UpdateGuest(guest Guest) (*Guest, error)
- func (api *Client) UpdateGuestContext(ctx context.Context, g Guest) (*Guest, error)
- type CustomFieldDefinitions
- type CustomFields
- type Debug
- type Error
- type Event
- type EventPages
- type EventSearchParameter
- type EventState
- type EventStatistic
- type EventStatistics
- type EventStatisticsSearchParameter
- type Events
- type Guest
- type GuestBulkImport
- type GuestBulkImportSearchParameter
- type GuestBulkImportState
- type GuestBulkImportStatus
- type GuestBulkImports
- type GuestPages
- type GuestSearchParameter
- type GuestUpdate
- type Guests
- type InvitationState
- type ListenOptions
- type PaginationParameter
- type ResponseMetadata
- type SortBy
- type SortOrder
- type Status
- type StatusCodeError
- type SweapError
- type SweapLibraryError
- type SweapOptions
- type SweapResponse
Constants ¶
const ( NEWGUEST = "NEW_GUEST" UPDATEGUEST = "UPDATE_GUEST" )
const ( // Official endpoints for normal users // APIURL = "https://api.sweap.io/core/v1/" APIURL = "https://api.sweap.io/core/v1/" TOKENURL = "https://auth.sweap.io/realms/users/protocol/openid-connect/token" // Inofficial endpoints to the staging or dev area. // Normal API users won't need this. // For special development purposes, only APIURL_ST = "https://api.sweap.st/core/v1/" TOKENURL_ST = "https://auth.sweap.st/realms/users/protocol/openid-connect/token" APIURL_DEV = "https://api.sweap.dev/core/v1/" TOKENURL_DEV = "https://auth.sweap.dev/realms/users/protocol/openid-connect/token" )
Variables ¶
This section is empty.
Functions ¶
func NewGuestIterator ¶
NewGuestIterator creates a new iterator function that iterates over a slice of guests. It takes a slice of Guest objects as input. The returned iterator function can be called repeatedly to retrieve the next Guest from the slice. If all guests have been iterated over, the iterator function returns nil.
func OptionAPIURL ¶
OptionAPIURL set the url for the client. only useful for testing.
func OptionClientCredentials ¶
OptionClientCredentials sets an app-level token for the client.
func OptionDebug ¶
OptionDebug enable debugging for the client
func OptionEnvFile ¶
OptionEnvFile uses an env file for reading the credentials
func OptionTOKENURL ¶
OptionTOKENURL set the url for the client. only useful for testing.
func OptionUseDevEnv ¶
func OptionUseDevEnv() func(*Client)
OptionUseDevEnv selects the dev environment for the client.
func OptionUseStagingEnv ¶
func OptionUseStagingEnv() func(*Client)
OptionUseStagingEnv selects the staging environment for the client.
Types ¶
type AttendanceMode ¶
type AttendanceMode string
const ( OFFLINE AttendanceMode = "OFFLINE" ONLINE AttendanceMode = "ONLINE" MIXED AttendanceMode = "MIXED" )
type AttendanceState ¶
type AttendanceState string
const ( NONEATTENDANCE AttendanceState = "NONE" PRESENT AttendanceState = "PRESENT" GONE AttendanceState = "GONE" )
type AuthTestResponse ¶
type AuthTestResponse struct {
URL string `json:"url"`
}
AuthTestResponse ...
type Categories ¶
type Categories []Category
type CategorySearchParameter ¶
type CategorySearchParameter struct { GuestId string // optional, filters equal guest id Name string // optional, filters equal case insensitive category name ExternalID string // optional, filters equal guest externalId CreatedAfter *time.Time // optional, filters greater than guest createdAt: ISO 8601 timestamp UpdatedAfter *time.Time // optional, filters greater than guest updatedAt: ISO 8601 timestamp }
func NewCategorySearchParameter ¶
func NewCategorySearchParameter() CategorySearchParameter
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client for the Sweap API
func New ¶
func New(clientId, clientSecret string, options ...SweapOptions) (*Client, error)
NewSweap creates a new Sweap object with given credentials if authentication fails error will be non-nil
func (*Client) BulkImportFinishUpload ¶
func (*Client) BulkImportInOneGo ¶
func (api *Client) BulkImportInOneGo(gbi GuestBulkImport) (*GuestBulkImport, error)
Create Bulk Import Object creates a guest bulk object. POST /guest-bulk-imports
func (*Client) BulkImportInOneGoContext ¶
func (api *Client) BulkImportInOneGoContext(ctx context.Context, gbi GuestBulkImport) (*GuestBulkImport, error)
CreateGuestBulkImportObjectContext creates a GBI in an event and returns a GBI containing it's unigue ID with custom context
func (*Client) BulkImportStateContext ¶
func (*Client) BulkImportUpdateBatch ¶
FIXME: Need documentation
func (*Client) BulkImportUpdateBatchContext ¶
func (api *Client) BulkImportUpdateBatchContext(ctx context.Context, gibID string, guests Guests) error
FIXME: BulkImportUpdateBatchContext will update the guest with the given guestId with a custom context
func (*Client) CheckCredentials ¶
CheckCredentials will check wether valid credentials have been used GET /events/{ID}
func (*Client) CheckCredentialsContext ¶
GetEventsContext will retrieve the complete list of events with a custom context
func (*Client) CreateGuest ¶
CreateGuest creates a Guest in an event and returns a Guest containing it's unigue ID
func (*Client) CreateGuestBulkImportObject ¶
func (api *Client) CreateGuestBulkImportObject(gbi GuestBulkImport) (*GuestBulkImport, error)
Create Bulk Import Object creates a guest bulk object. POST /guest-bulk-imports
func (*Client) CreateGuestBulkImportObjectContext ¶
func (api *Client) CreateGuestBulkImportObjectContext(ctx context.Context, gbi GuestBulkImport) (*GuestBulkImport, error)
CreateGuestBulkImportObjectContext creates a GBI in an event and returns a GBI containing it's unigue ID with custom context
func (*Client) CreateGuestContext ¶
CreateGuestContext creates the provided Guest (with a given eventID) and returns a Guest containing it's unigue ID with custom context It takes a context.Context object.
func (*Client) DeleteGuest ¶
DeleteGuest will delete the guest with the given guestId. If guest is not found error will be returned
func (*Client) DeleteGuestBulkImportObject ¶
DeleteGuestBulkImportObject will delete the gbi with the given Id. If guest is not found error will be returned
func (*Client) DeleteGuestBulkImportObjectContext ¶
DeleteGuest will delete the guest with the given guestId wiht a custom context. If guest is not found error will be returned
func (*Client) DeleteGuestContext ¶
DeleteGuest will delete the guest with the given guestId wiht a custom context. If guest is not found error will be returned
func (*Client) GetAllBulkImports ¶
func (api *Client) GetAllBulkImports(s ...GuestBulkImportSearchParameter) (*GuestBulkImports, error)
GetAllBulkImports lists all bulk import objects started or completed. GET /guest-bulk-imports?[PARAMS]
func (*Client) GetAllBulkImportsContext ¶
func (api *Client) GetAllBulkImportsContext(ctx context.Context, params GuestBulkImportSearchParameter) (*GuestBulkImports, error)
func (*Client) GetCategories ¶
func (api *Client) GetCategories(eventId string) (*Categories, error)
GetCategories will retrieve the complete list of guest categories for a given eventId
func (*Client) GetCategoriesContext ¶
func (api *Client) GetCategoriesContext(ctx context.Context, eventId string, params CategorySearchParameter) (*Categories, error)
GetCategories will retrieve the complete list of guest categories for a given eventId with a custom context
func (*Client) GetCategoryById ¶
GetCategoryById will retrieve the guest with the given guestId
func (*Client) GetCategoryByIdContext ¶
func (api *Client) GetCategoryByIdContext(ctx context.Context, categoryId string) (*Category, error)
GetGuestByIdContext will retrieve the guest with the given guestId with a custom context
func (*Client) GetEventById ¶
GetEvents will retrieve the event with the given ID GET /events/{ID}
func (*Client) GetEventByIdContext ¶
GetEventsContext will retrieve the complete list of events with a custom context
func (*Client) GetEventStatistics ¶
func (api *Client) GetEventStatistics() (*EventStatistics, error)
GetEventStatistics returns all events statistics under your account.
func (*Client) GetEventStatisticsByID ¶
func (api *Client) GetEventStatisticsByID(id string) (*EventStatistic, error)
GetEventStatisticsByID will retrieve the statistic for an event with a given ID
func (*Client) GetEventStatisticsByIDContext ¶
func (api *Client) GetEventStatisticsByIDContext(ctx context.Context, eventID string) (*EventStatistic, error)
GetEventStatisticsByIDContext retrieves the statistics for an event with the given ID using a custom context. It takes a context.Context object and an event ID as input. If successful, it returns a pointer to the EventStatistic and nil error. If an error occurs during the request, it returns nil and the specific error encountered. The function can be called on a Client object.
func (*Client) GetEventStatisticsContext ¶
func (api *Client) GetEventStatisticsContext(ctx context.Context, params EventStatisticsSearchParameter) (*EventStatistics, error)
GetEventStatisticsContext returns all event statistics under your account based on the provided search parameters. It takes a context.Context object and an EventStatisticsSearchParameter object as input. If successful, it returns a pointer to EventStatistics and nil error. If an error occurs during the request, it returns nil and the specific error encountered. The function can be called on a Client object.
func (*Client) GetEventsContext ¶
func (api *Client) GetEventsContext(ctx context.Context, params EventSearchParameter) (*Events, error)
GetEventsContext will retrieve the complete list of events with a custom context
func (*Client) GetGuestById ¶
GetGuestById will retrieve the guest with the given guestId
func (*Client) GetGuestByIdContext ¶
GetGuestByIdContext retrieves the guest with the given guest ID using a custom context. It takes a context.Context object and a guest ID as input. If successful, it returns a pointer to the Guest and nil error. If an error occurs during the request, it returns nil and an error. The function can be called on a Client object.
func (*Client) GetGuests ¶
GetGuests will retrieve the complete list of guests for a given event You can only get guests for a specific event, so you need to pass the event id via query parameter eventId. The guests are not further filtered. For more fine granular control use #GetGuestsContext
func (*Client) GetGuestsContext ¶
func (api *Client) GetGuestsContext(ctx context.Context, eventId string, params GuestSearchParameter) (*Guests, error)
GetGuestsContext retrieves the complete list of guests for a given event with a custom context. It takes a context.Context object, an event ID, and GuestSearchParameter as input. If successful, it returns a pointer to Guests and nil error. If either the event ID or GuestSearchParameter is not provided, it returns nil and an error. The function can be called on a Client object.
func (*Client) GetGuestsPaginated ¶
func (api *Client) GetGuestsPaginated(eventId string, pp PaginationParameter) (GuestPages, error)
GetGuestsPaginated will retrieve the complete list of guests for a given event You can only get guests for a specific event, so you need to pass the event id via query parameter eventId. The guests are not further filtered. For more fine granular control use #GetGuestsContext
func (*Client) GetGuestsPaginatedContext ¶
func (api *Client) GetGuestsPaginatedContext(ctx context.Context, eventId string, pages PaginationParameter, params GuestSearchParameter) (GuestPages, error)
GetGuestsPaginatedContext retrieves the paginated list of guests for a given event with a custom context. It takes a context.Context object, page and size for pagination, an event ID, and GuestSearchParameter as input. If successful, it returns a pointer to Guests and nil error. If either the event ID or GuestSearchParameter is not provided, it returns nil and an error. If size The function can be called on a Client object.
func (*Client) GetSpecificBulkImport ¶
func (api *Client) GetSpecificBulkImport(gbiId string) (*GuestBulkImport, error)
func (*Client) GetSpecificBulkImportContext ¶
func (*Client) GetSpecificBulkImportState ¶
func (api *Client) GetSpecificBulkImportState(gbiId string) (*GuestBulkImportState, error)
func (*Client) GetSpecificBulkImportStateContext ¶
func (*Client) Listen ¶
func (api *Client) Listen() (chan *GuestUpdate, error)
Listen listens to guest changes (new, updates). It returns a channel of GuestUpdate objects and an error. The channel can be used to receive updates on new or updated guests. If an error occurs during the setup, it returns nil channel and the specific error encountered. The function can be called on a Client object.
func (*Client) SearchEventStatistics ¶
func (api *Client) SearchEventStatistics(params EventStatisticsSearchParameter) (*EventStatistics, error)
SearchEventStatistics will retrieve a list of statistics for events filtered by EventStatisticsSearchParameter
func (*Client) SearchEvents ¶
func (api *Client) SearchEvents(params EventSearchParameter) (*Events, error)
SearchEvents will retrieve a list of events filtered by EventSearchParameter
func (*Client) SearchGuests ¶
func (api *Client) SearchGuests(id string, params GuestSearchParameter) (*Guests, error)
SearchGuests will retrieve the complete list of Guests matching the search criteria
func (*Client) UpdateGuest ¶
UpdateGuest updates the guest with the given guest ID. It takes a Guest object as input. If successful, it returns a pointer to the updated Guest and nil error. If an error occurs during the update, it returns nil and the specific error encountered. The function can be called on a Client object.
func (*Client) UpdateGuestContext ¶
UpdateGuestContext updates the guest with the given guest ID using a custom context. It takes a context.Context object and a Guest object as input. If successful, it returns a pointer to the updated Guest and nil error. If the Guest is missing the EventID or ID, it returns a SweapLibraryError with the appropriate error message. If an error occurs during the update, it returns nil and the specific error encountered. The function can be called on a Client object.
type CustomFieldDefinitions ¶
type CustomFields ¶
type Event ¶
type Event struct { // Common fields ID string `json:"id"` Version int `json:"version"` UpdatedAt *time.Time `json:"updatedAt"` CreatedAt *time.Time `json:"createdAt"` ExternalID interface{} `json:"externalId"` // Specific fields Name string `json:"name"` StartDate time.Time `json:"startDate"` EndDate time.Time `json:"endDate"` ZoneId string `json:"zoneId"` AttendanceMode AttendanceMode `json:"attendanceMode"` State string `json:"state"` CustomFieldDefinitions []CustomFieldDefinitions `json:"customFieldDefinitions"` }
type EventPages ¶
type EventSearchParameter ¶
type EventSearchParameter struct { Id string // optional, filters equal event id Name string // optional, filters equal case insensitive event name NameContains string // optional, filters equal case insensitive event name State EventState // optional, one of DRAFT, ACTIVE, CLOSED StartDateAfter *time.Time // optional, filters greater than event startDate: ISO 8601 timestamp EndDateAfter *time.Time // optional, filters greater than event startDate: ISO 8601 timestamp ExternalID string // optional, filters equal event externalId CreatedAfter *time.Time // optional, filters greater than event createdAt: ISO 8601 timestamp UpdatedAfter *time.Time // optional, filters greater than event updatedAt: ISO 8601 timestamp }
func NewEventSearchParameters ¶
func NewEventSearchParameters() EventSearchParameter
type EventState ¶
type EventState string
const ( DRAFT EventState = "DRAFT" ACTIVE EventState = "ACTIVE" CLOSED EventState = "CLOSED" )
type EventStatistic ¶
type EventStatistic struct { // Common fields ID string `json:"id"` Version int `json:"version"` UpdatedAt time.Time `json:"updatedAt"` CreatedAt time.Time `json:"createdAt"` ExternalID interface{} `json:"externalId"` // Specific fields GuestCount int `json:"guestCount"` // Guests overall count (incl. companions) AcceptedCount int `json:"acceptedCount"` // Accepted guest count (incl. companions) DeclindedCount int `json:"declinedCount"` // Declined guest count (incl. companions) NoReplyCount int `json:"noReplyCount"` // No Reply guest count (incl. companions) CheckinCount int `json:"checkinCount"` // Check-in count (incl. companions) }
type EventStatistics ¶
type EventStatistics []EventStatistic
type EventStatisticsSearchParameter ¶
type EventStatisticsSearchParameter struct { Id string // optional, filters equal event id ExternalID string // optional, filters equal event externalId CreatedAfter *time.Time // optional, filters greater than event createdAt: ISO 8601 timestamp UpdatedAfter *time.Time // optional, filters greater than event updatedAt: ISO 8601 timestamp MinGuestCount int // optional, filters guestCount equal or greater than minGuestCount value MaxGuestCount int // optional, filters guestCount equal or lesser than maxGuestCount value MinAcceptedCount int // optional, filters acceptedCount equal or greater than minAcceptedCount value MaxAcceptedCount int // optional, filters acceptedCount equal or lesser than maxAcceptedCount value MinDeclinedCount int // optional, filters declinedCount equal or greater than minDeclinedCount value MaxDeclinedCount int // optional, filters declinedCount equal or lesser than maxDeclinedCount value MinNoReplyCount int // optional, filters noReplyCount equal or greater than minNoReplyCount value MaxNoReplyCount int // optional, filters noReplyCount equal or lesser than maxNoReplyCount value MinCheckinCount int // optional, filters checkinCount equal or greater than minCheckinCount value MaxCheckinCount int // optional, filters checkinCount equal or lesser than maxCheckinCount value }
func NewEventStatisticsSearchParameter ¶
func NewEventStatisticsSearchParameter() EventStatisticsSearchParameter
type Guest ¶
type Guest struct { // Common fields ID string `json:"id"` Version int `json:"version"` UpdatedAt *time.Time `json:"updatedAt,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty"` ExternalID interface{} `json:"externalId"` // Specific fields EventID string `json:"eventId"` FirstName string `json:"firstName"` LastName string `json:"lastName"` EntourageCount int `json:"entourageCount,omitempty"` Comment interface{} `json:"comment,omitempty"` Email string `json:"email,omitempty"` CustomFields CustomFields `json:"customFields,omitempty"` InvitationID string `json:"invitationId,omitempty"` InvitationState InvitationState `json:"invitationState"` TicketID string `json:"ticketId,omitempty"` ParentGuestID string `json:"parentGuestId"` CategoryID string `json:"categoryId"` AttendanceState AttendanceState `json:"attendanceState"` }
type GuestBulkImport ¶
type GuestBulkImport struct { // Common ID string `json:"id"` Version int `json:"version"` UpdatedAt *time.Time `json:"updatedAt"` CreatedAt *time.Time `json:"createdAt"` ExternalID interface{} `json:"externalId"` // Specific Name string `json:"name"` State *GuestBulkImportStatus `json:"state"` Guests *Guests `json:"guests"` EventId string `json:"eventId"` CustomFieldDefinitions []CustomFieldDefinitions `json:"customFieldDefinitions"` }
type GuestBulkImportSearchParameter ¶
type GuestBulkImportSearchParameter struct { GuestBulkImportId string // optional, filters equal guest-bulk-import id EventId string // optional, filters equal event id State GuestBulkImportStatus // optional, filters equal guest-bulk-import state: UPLOAD_STARTED, UPLOAD_FINISHED, IMPORT_STARTED, IMPORT_FINISHED ExternalID string // optional, filters equal guest-bulk-import externalId CreatedAfter *time.Time // optional, filters greater than guest-bulk-import createdAt: ISO 8601 timestamp UpdatedAfter *time.Time // optional, filters greater than guest-bulk-import updatedAt: ISO 8601 timestamp }
func NewGuestBulkImportSearchParameter ¶
func NewGuestBulkImportSearchParameter() GuestBulkImportSearchParameter
type GuestBulkImportState ¶
type GuestBulkImportState struct { ID string `json:"id"` State GuestBulkImportStatus `json:"state"` }
type GuestBulkImportStatus ¶
type GuestBulkImportStatus string
const ( UPLOADSTARTED GuestBulkImportStatus = "UPLOAD_STARTED" UPLOADFINISHED GuestBulkImportStatus = "UPLOAD_FINISHED" IMPORTSTARTED GuestBulkImportStatus = "IMPORT_STARTED" IMPORTFINISHED GuestBulkImportStatus = "IMPORT_FINISHED" )
type GuestBulkImports ¶
type GuestBulkImports []GuestBulkImport
type GuestPages ¶
type GuestSearchParameter ¶
type GuestSearchParameter struct { Id string // optional, filters equal guest id, result will list of 0 or 1 guest, conditionally required if eventId or invitationId are empty FirstName string // optional, filters equal case insensitive guest firstName FirstNameContains string // optional, filters contains case insensitive guest firstName LastName string // optional, filters equal case insensitive guest lastName LastNameContains string // optional, filters contains case insensitive guest lastName Email string // optional, filters equal case insensitive guest email InvitationState InvitationState // optional, filters equal guest invitationState: NONE, NO_REPLY, ACCEPTED or DECLINED ExternalID string // optional, filters equal guest externalId CreatedAfter *time.Time // optional, filters greater than guest createdAt: ISO 8601 timestamp UpdatedAfter *time.Time // optional, filters greater than guest updatedAt: ISO 8601 timestamp InvitationId string // optional, filters equal guest invitationId, result will list of 0 or 1 guest, conditionally required if event_id or id are empty TicketID string // optinal, filters equal guest ticketId }
func NewGuestSearchParameters ¶
func NewGuestSearchParameters() GuestSearchParameter
type GuestUpdate ¶
type GuestUpdate struct { EventType string Value interface{} }
GuestUpdate carries all update events for guest, let it be new guests, or updated guests
type InvitationState ¶
type InvitationState string
const ( NONE InvitationState = "NONE" NO_REPLY InvitationState = "NO_REPLY" ACCEPTED InvitationState = "ACCEPTED" DECLINED InvitationState = "DECLINED" )
type ListenOptions ¶
type ListenOptions func(*Client)
type PaginationParameter ¶
type PaginationParameter struct { Size int // optional, size of a page, if <=0 default of 100 is assumed Page int // optional, which page should be selected, if <0 default of 0 is assumed }
func NewPaginationParamter ¶
func NewPaginationParamter() PaginationParameter
type ResponseMetadata ¶
type ResponseMetadata struct { Cursor string `json:"next_cursor"` Messages []string `json:"messages"` Warnings []string `json:"warnings"` }
ResponseMetadata holds pagination metadata
type Status ¶
type Status string
const ( OK Status = "OK" BAD_REQUEST Status = "BAD_REQUEST" UNAUTHORIZED Status = "UNAUTHORIZED" VALIDATION_EXCEPTION Status = "VALIDATION_EXCEPTION" EXCEPTION Status = "EXCEPTION" WRONG_CREDENTIALS Status = "WRONG_CREDENTIALS" ACCESS_DENIED Status = "ACCESS_DENIED" NOT_FOUND Status = "NOT_FOUND" DUPLICATE_ENTITY Status = "DUPLICATE_ENTITY" )
type StatusCodeError ¶
StatusCodeError represents an http response error. type httpStatusCode interface { HTTPStatusCode() int } to handle it.
func (StatusCodeError) Error ¶
func (t StatusCodeError) Error() string
func (StatusCodeError) HTTPStatusCode ¶
func (t StatusCodeError) HTTPStatusCode() int
func (StatusCodeError) Retryable ¶
func (t StatusCodeError) Retryable() bool
type SweapError ¶
type SweapError struct { Error_ string `json:"error"` Code int `json:"code"` Message string `json:"message"` }
func (*SweapError) Error ¶
func (se *SweapError) Error() string
type SweapLibraryError ¶
type SweapLibraryError struct {
Message string
}
SweapLibraryError represents an internal library error
func (SweapLibraryError) Error ¶
func (se SweapLibraryError) Error() string
type SweapResponse ¶
type SweapResponse struct { Ok bool `json:"ok,omitempty"` Error SweapError `json:"error,omitempty"` ResponseMetadata ResponseMetadata `json:"response_metadata,omitempty"` }
SweapResponse handles parsing out errors from the web api