events

package
v2.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EventSupport eventSupportNS

Functions

func DateFormat

func DateFormat(date *time.Time) string

Types

type BestAvailableParams

type BestAvailableParams struct {
	Number      int           `json:"number"`
	Categories  []CategoryKey `json:"categories,omitempty"`
	ExtraData   []ExtraData   `json:"extraData,omitempty"`
	TicketTypes []string      `json:"ticketTypes,omitempty"`
}

type BestAvailableResult

type BestAvailableResult struct {
	NextToEachOther bool                       `json:"nextToEachOther"`
	Objects         []string                   `json:"objects"`
	ObjectDetails   map[string]EventObjectInfo `json:"objectDetails"`
}

type BestAvailableStatusChangeParams

type BestAvailableStatusChangeParams struct {
	Status         ObjectStatus        `json:"status"`
	BestAvailable  BestAvailableParams `json:"bestAvailable"`
	HoldToken      string              `json:"holdToken,omitempty"`
	OrderId        string              `json:"orderId,omitempty"`
	KeepExtraData  bool                `json:"keepExtraData"`
	IgnoreChannels bool                `json:"ignoreChannels"`
	ChannelKeys    []string            `json:"channelKeys,omitempty"`
}

type Category

type Category struct {
	Key        CategoryKey `json:"key"`
	Label      string      `json:"label"`
	Color      string      `json:"color"`
	Accessible bool        `json:"accessible"`
}

type CategoryKey

type CategoryKey struct {
	Key interface{}
}

func (CategoryKey) KeyAsString

func (categoryKey CategoryKey) KeyAsString() string

func (CategoryKey) MarshalJSON

func (categoryKey CategoryKey) MarshalJSON() ([]byte, error)

func (*CategoryKey) UnmarshalJSON

func (categoryKey *CategoryKey) UnmarshalJSON(data []byte) error

type ChangeObjectStatusInBatchResult

type ChangeObjectStatusInBatchResult struct {
	Results []ChangeObjectStatusResult `json:"results"`
}

type ChangeObjectStatusResult

type ChangeObjectStatusResult struct {
	Objects map[string]EventObjectInfo `json:"objects"`
}

type Channel

type Channel struct {
	Key     string   `json:"key"`
	Name    string   `json:"name"`
	Color   string   `json:"color"`
	Index   int32    `json:"index"`
	Objects []string `json:"objects"`
}

type Channels

type Channels struct {
	Client *req.Client
}

func (*Channels) AddObjects

func (channels *Channels) AddObjects(eventKey string, channelKey string, objects []string) error

func (*Channels) Create

func (channels *Channels) Create(eventKey string, params ...*CreateChannelParams) error

func (*Channels) Delete

func (channels *Channels) Delete(eventKey string, channelKey string) error

func (*Channels) RemoveObjects

func (channels *Channels) RemoveObjects(eventKey string, channelKey string, objects []string) error

func (*Channels) Replace

func (channels *Channels) Replace(eventKey string, newChannels ...CreateChannelParams) error

func (*Channels) Update

func (channels *Channels) Update(eventKey string, channelKey string, params UpdateChannelParams) error

type CreateChannelParams

type CreateChannelParams struct {
	Key     string   `json:"key"`
	Name    string   `json:"name"`
	Color   string   `json:"color"`
	Index   int32    `json:"index,omitempty"`
	Objects []string `json:"objects,omitempty"`
}

type CreateChannelParamsOption

type CreateChannelParamsOption func(Params *CreateChannelParams)

type CreateEventParams

type CreateEventParams struct {
	ChartKey string `json:"chartKey"`
	*EventParams
}

type CreateEventResult

type CreateEventResult struct {
	Events []Event `json:"events"`
}

type CreateMultipleEventsRequest

type CreateMultipleEventsRequest struct {
	ChartKey string        `json:"chartKey"`
	Events   []EventParams `json:"events"`
}

type Event

type Event struct {
	Id                    int64                  `json:"id,omitempty"`
	Key                   string                 `json:"key,omitempty"`
	Name                  string                 `json:"name,omitempty"`
	Date                  string                 `json:"date,omitempty"`
	ChartKey              string                 `json:"chartKey"`
	HoldToken             string                 `json:"holdToken,omitempty"`
	TableBookingConfig    TableBookingConfig     `json:"tableBookingConfig,omitempty"`
	SupportsBestAvailable bool                   `json:"supportsBestAvailable,omitempty"`
	ForSaleConfig         *ForSaleConfig         `json:"forSaleConfig,omitempty"`
	CreatedOn             *time.Time             `json:"createdOn"`
	UpdatedOn             *time.Time             `json:"updatedOn,omitempty"`
	Categories            []Category             `json:"categories,omitempty"`
	ObjectCategories      map[string]CategoryKey `json:"objectCategories,omitempty"`
	Channels              []Channel              `json:"channels,omitempty"`
	IsInThePast           bool                   `json:"isInThePast"`
}

type EventObjectInfo

type EventObjectInfo struct {
	Status         ObjectStatus `json:"status"`
	OrderId        string       `json:"orderId"`
	ExtraData      ExtraData    `json:"extraData"`
	Label          string       `json:"label"`
	Labels         Labels       `json:"labels"`
	IDs            IDs          `json:"ids"`
	CategoryLabel  string       `json:"categoryLabel"`
	CategoryKey    CategoryKey  `json:"categoryKey"`
	TicketType     string       `json:"ticketType"`
	ForSale        bool         `json:"forSale"`
	Section        string       `json:"section"`
	Entrance       string       `json:"entrance"`
	NumBooked      int          `json:"numBooked"`
	Capacity       int          `json:"capacity"`
	ObjectType     string       `json:"objectType"`
	LeftNeighbour  string       `json:"leftNeighbour"`
	RightNeighbour string       `json:"rightNeighbour"`
	HoldToken      *string      `json:"holdToken"`
}

type EventParams

type EventParams struct {
	EventKey           string                  `json:"eventKey,omitempty"`
	Name               string                  `json:"name,omitempty"`
	Date               string                  `json:"date,omitempty"`
	TableBookingConfig *TableBookingConfig     `json:"tableBookingConfig,omitempty"`
	ObjectCategories   *map[string]CategoryKey `json:"objectCategories,omitempty"`
	Categories         *[]Category             `json:"categories,omitempty"`
	Channels           *[]CreateChannelParams  `json:"channels,omitempty"`
}

type Events

type Events struct {
	Client *req.Client
}

func (*Events) Book

func (events *Events) Book(eventKey string, objectIds ...string) (*ChangeObjectStatusResult, error)

func (*Events) BookBestAvailable

func (events *Events) BookBestAvailable(eventKey string, params BestAvailableParams) (*BestAvailableResult, error)

func (*Events) BookBestAvailableWithHoldToken

func (events *Events) BookBestAvailableWithHoldToken(eventKey string, params BestAvailableParams, holdToken string) (*BestAvailableResult, error)

func (*Events) BookBestAvailableWithOptions

func (events *Events) BookBestAvailableWithOptions(eventKey string, params BestAvailableStatusChangeParams) (*BestAvailableResult, error)

func (*Events) BookWithHoldToken

func (events *Events) BookWithHoldToken(eventKey string, objectIds []string, holdToken *string) (*ChangeObjectStatusResult, error)

func (*Events) BookWithObjectProperties

func (events *Events) BookWithObjectProperties(eventKey string, objectProperties ...ObjectProperties) (*ChangeObjectStatusResult, error)

func (*Events) BookWithObjectPropertiesAndHoldToken

func (events *Events) BookWithObjectPropertiesAndHoldToken(eventKey string, objectProperties []ObjectProperties, holdToken *string) (*ChangeObjectStatusResult, error)

func (*Events) BookWithOptions

func (events *Events) BookWithOptions(statusChangeParams *StatusChangeParams) (*ChangeObjectStatusResult, error)

func (*Events) ChangeBestAvailableObjectStatus

func (events *Events) ChangeBestAvailableObjectStatus(eventKey string, bestAvailableStatusChangeParams *BestAvailableStatusChangeParams) (*BestAvailableResult, error)

func (*Events) ChangeObjectStatus

func (events *Events) ChangeObjectStatus(eventKeys []string, objects []string, status ObjectStatus) (*ChangeObjectStatusResult, error)

func (*Events) ChangeObjectStatusInBatch

func (events *Events) ChangeObjectStatusInBatch(statusChangeInBatchParams ...StatusChangeInBatchParams) (*ChangeObjectStatusInBatchResult, error)

func (*Events) ChangeObjectStatusWithOptions

func (events *Events) ChangeObjectStatusWithOptions(statusChangeparams *StatusChangeParams) (*ChangeObjectStatusResult, error)

func (*Events) Create

func (events *Events) Create(params *CreateEventParams) (*Event, error)

func (*Events) CreateMultiple

func (events *Events) CreateMultiple(chartKey string, params ...EventParams) (*CreateEventResult, error)

func (*Events) Delete

func (events *Events) Delete(eventKey string) error

func (*Events) Hold

func (events *Events) Hold(eventKey string, objectIds []string, holdToken *string) (*ChangeObjectStatusResult, error)

func (*Events) HoldBestAvailable

func (events *Events) HoldBestAvailable(eventKey string, params BestAvailableParams, holdToken string) (*BestAvailableResult, error)

func (*Events) HoldWithObjectProperties

func (events *Events) HoldWithObjectProperties(eventKey string, objectProperties []ObjectProperties, holdToken *string) (*ChangeObjectStatusResult, error)

func (*Events) HoldWithOptions

func (events *Events) HoldWithOptions(statusChangeParams *StatusChangeParams) (*ChangeObjectStatusResult, error)

func (*Events) ListAll

func (events *Events) ListAll(opts ...shared.PaginationParamsOption) ([]Event, error)

func (*Events) ListFirstPage

func (events *Events) ListFirstPage(opts ...shared.PaginationParamsOption) (*shared.Page[Event], error)

func (*Events) ListPageAfter

func (events *Events) ListPageAfter(id int64, opts ...shared.PaginationParamsOption) (*shared.Page[Event], error)

func (*Events) ListPageBefore

func (events *Events) ListPageBefore(id int64, opts ...shared.PaginationParamsOption) (*shared.Page[Event], error)

func (*Events) MarkAsForSale

func (events *Events) MarkAsForSale(eventKey string, forSaleConfig *ForSaleConfigParams) error

func (*Events) MarkAsNotForSale

func (events *Events) MarkAsNotForSale(eventKey string, forSaleConfig *ForSaleConfigParams) error

func (*Events) MarkEverythingAsForSale

func (events *Events) MarkEverythingAsForSale(eventKey string) error

func (*Events) Release

func (events *Events) Release(eventKey string, objectIds ...string) (*ChangeObjectStatusResult, error)

func (*Events) ReleaseWithHoldToken

func (events *Events) ReleaseWithHoldToken(eventKey string, objectIds []string, holdToken *string) (*ChangeObjectStatusResult, error)

func (*Events) ReleaseWithOptions

func (events *Events) ReleaseWithOptions(statusChangeParams *StatusChangeParams) (*ChangeObjectStatusResult, error)

func (*Events) RemoveCategories

func (events *Events) RemoveCategories(eventKey string) error

func (*Events) RemoveObjectCategories

func (events *Events) RemoveObjectCategories(eventKey string) error

func (*Events) Retrieve

func (events *Events) Retrieve(eventKey string) (*Event, error)

func (*Events) RetrieveObjectInfo

func (events *Events) RetrieveObjectInfo(eventKey string, objectLabels ...string) (map[string]EventObjectInfo, error)

func (*Events) StatusChanges

func (events *Events) StatusChanges(eventKey string, opts ...ListParamsOption) *shared.Lister[StatusChange]

func (*Events) StatusChangesForObject

func (events *Events) StatusChangesForObject(eventKey string, objectLabel string) *shared.Lister[StatusChange]

func (*Events) Update

func (events *Events) Update(eventKey string, params *UpdateEventParams) error

func (*Events) UpdateExtraData

func (events *Events) UpdateExtraData(eventKey string, extraData map[string]ExtraData) error

type ExtraData

type ExtraData = map[string]string

type ForSaleConfig

type ForSaleConfig struct {
	ForSale    bool           `json:"forSale"`
	Objects    []string       `json:"objects"`
	AreaPlaces map[string]int `json:"areaPlaces"`
	Categories []string       `json:"categories"`
}

type ForSaleConfigParams

type ForSaleConfigParams struct {
	Objects    []string       `json:"objects,omitempty"`
	AreaPlaces map[string]int `json:"areaPlaces,omitempty"`
	Categories []string       `json:"categories,omitempty"`
}

type IDs

type IDs struct {
	Own     string `json:"own"`
	Parent  string `json:"parent"`
	Section string `json:"section"`
}

type LabelAndType

type LabelAndType struct {
	Label string `json:"label"`
	Type  string `json:"type"`
}

type Labels

type Labels struct {
	Own     LabelAndType `json:"own"`
	Parent  LabelAndType `json:"parent"`
	Section string       `json:"section"`
}

type ListParamsOption

type ListParamsOption func(Params *shared.PageFetcher[StatusChange])

type Mode

type Mode string
const (
	INHERIT      Mode = "INHERIT"
	ALL_BY_SEAT  Mode = "ALL_BY_SEAT"
	ALL_BY_TABLE Mode = "ALL_BY_TABLE"
	CUSTOM       Mode = "CUSTOM"
)

type ObjectProperties

type ObjectProperties struct {
	ObjectId   string            `json:"objectId"`
	ExtraData  map[string]string `json:"extraData,omitempty"`
	TicketType string            `json:"ticketType,omitempty"`
	Quantity   int               `json:"quantity,omitempty"`
}

type ObjectStatus

type ObjectStatus string
const (
	FREE   ObjectStatus = "free"
	BOOKED ObjectStatus = "booked"
	HELD   ObjectStatus = "reservedByToken"
)

type StatusChange

type StatusChange struct {
	Id                      int64              `json:"id"`
	EventId                 int64              `json:"eventId"`
	Status                  string             `json:"status"`
	Date                    *time.Time         `json:"date"`
	OrderId                 string             `json:"orderId"`
	ObjectLabel             string             `json:"objectLabel"`
	ExtraData               ExtraData          `json:"extraData"`
	Origin                  StatusChangeOrigin `json:"origin"`
	IsPresentOnChart        bool               `json:"isPresentOnChart"`
	NotPresentOnChartReason string             `json:"notPresentOnChartReason"`
	HoldToken               string             `json:"holdToken"`
}

type StatusChangeInBatchParams

type StatusChangeInBatchParams struct {
	Event string `json:"event"`
	StatusChanges
}

type StatusChangeInBatchRequest

type StatusChangeInBatchRequest struct {
	StatusChanges []StatusChangeInBatchParams `json:"statusChanges"`
}

type StatusChangeOrigin

type StatusChangeOrigin struct {
	Type string `json:"type"`
	Ip   string `json:"ip"`
}

type StatusChangeParams

type StatusChangeParams struct {
	Events []string `json:"events"`
	StatusChanges
}

type StatusChanges

type StatusChanges struct {
	Status                   ObjectStatus       `json:"status"`
	Objects                  []ObjectProperties `json:"objects"`
	HoldToken                string             `json:"holdToken,omitempty"`
	OrderId                  string             `json:"orderId,omitempty"`
	KeepExtraData            bool               `json:"keepExtraData"`
	IgnoreChannels           bool               `json:"ignoreChannels"`
	ChannelKeys              []string           `json:"channelKeys,omitempty"`
	AllowedPreviousStatuses  []ObjectStatus     `json:"allowedPreviousStatuses,omitempty"`
	RejectedPreviousStatuses []ObjectStatus     `json:"rejectedPreviousStatuses,omitempty"`
}

type TableBookingConfig

type TableBookingConfig struct {
	Mode   Mode                        `json:"mode"`
	Tables map[string]TableBookingMode `json:"tables,omitempty"`
}

type TableBookingMode

type TableBookingMode string
const (
	BY_TABLE TableBookingMode = "BY_TABLE"
	BY_SEAT  TableBookingMode = "BY_SEAT"
)

type TableBookingModeSupportNS

type TableBookingModeSupportNS struct{}
var TableBookingSupport TableBookingModeSupportNS

func (TableBookingModeSupportNS) AllBySeat

func (TableBookingModeSupportNS) AllByTables

func (TableBookingModeSupportNS) Custom

func (TableBookingModeSupportNS) Inherit

type UpdateChannelParams

type UpdateChannelParams struct {
	Name    string   `json:"name,omitempty"`
	Color   string   `json:"color,omitempty"`
	Objects []string `json:"objects,omitempty"`
}

type UpdateEventParams

type UpdateEventParams struct {
	ChartKey    *string `json:"chartKey,omitempty"`
	IsInThePast *bool   `json:"isInThePast,omitempty"`
	*EventParams
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL