client

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2021 License: MIT Imports: 7 Imported by: 0

README

qup-stc-client

Shake the counter API client

Documentation

Index

Constants

View Source
const (
	DateFormat = "2006-01-02"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AvailableEventResponse

type AvailableEventResponse struct {
	BlockedCountriesForSales interface{} `json:"BlockedCountriesForSales"`
	Categories               []struct {
		CategoryKey     string `json:"CategoryKey"`
		CategoryName    string `json:"CategoryName"`
		SubCategoryKey  string `json:"SubCategoryKey"`
		SubCategoryName string `json:"SubCategoryName"`
	} `json:"Categories"`
	Currency     string   `json:"Currency"`
	CurrencyCode string   `json:"CurrencyCode"`
	EventKey     string   `json:"EventKey"`
	EventName    string   `json:"EventName"`
	ImageTags    []string `json:"ImageTags"`
	ImageUrls    []string `json:"ImageUrls"`
	LowestPrice  float64  `json:"LowestPrice"`
	Performances []struct {
		Currency              string `json:"Currency"`
		CurrencyCode          string `json:"CurrencyCode"`
		ExternalPerformanceID string `json:"ExternalPerformanceID"`
		Location              struct {
			Address struct {
				CityName         string      `json:"CityName"`
				CountryID        interface{} `json:"CountryId"`
				CountryName      string      `json:"CountryName"`
				ExtraAddressLine string      `json:"ExtraAddressLine"`
				Lat              float64     `json:"Lat"`
				Lon              float64     `json:"Lon"`
				Number           string      `json:"Number"`
				PostalCode       string      `json:"PostalCode"`
				StateName        string      `json:"StateName"`
				Street           string      `json:"Street"`
			} `json:"Address"`
			GeneralInfo         interface{} `json:"GeneralInfo"`
			HandicappedInfo     interface{} `json:"HandicappedInfo"`
			ImageURL            interface{} `json:"ImageUrl"`
			LocationKey         string      `json:"LocationKey"`
			LocationName        string      `json:"LocationName"`
			MailAddress         string      `json:"MailAddress"`
			OpeningHoursInfo    interface{} `json:"OpeningHoursInfo"`
			ParkingInfo         interface{} `json:"ParkingInfo"`
			PhoneNumber         string      `json:"PhoneNumber"`
			PublicTransportInfo interface{} `json:"PublicTransportInfo"`
			Rating              interface{} `json:"Rating"`
			RestaurantInfo      interface{} `json:"RestaurantInfo"`
			ReviewCount         interface{} `json:"ReviewCount"`
			RouteInfo           interface{} `json:"RouteInfo"`
			Website             string      `json:"Website"`
		} `json:"Location"`
		LowestPrice                    float64     `json:"LowestPrice"`
		MaxSeatAmountPerOrder          interface{} `json:"MaxSeatAmountPerOrder"`
		OrderLink                      interface{} `json:"OrderLink"`
		PerformanceDescription         string      `json:"PerformanceDescription"`
		PerformanceKey                 string      `json:"PerformanceKey"`
		PerformanceName                string      `json:"PerformanceName"`
		Rating                         interface{} `json:"Rating"`
		Remarks                        int64       `json:"Remarks"`
		ReservationCostsPerTicket      interface{} `json:"ReservationCostsPerTicket"`
		ReservationCostsPerTransaction interface{} `json:"ReservationCostsPerTransaction"`
		ReviewCount                    interface{} `json:"ReviewCount"`
		SaleDateTo                     string      `json:"SaleDateTo"`
		SortOrder                      interface{} `json:"SortOrder"`
		StartDateTimeText              interface{} `json:"StartDateTimeText"`
	} `json:"Performances"`
	Performer   string      `json:"Performer"`
	Rating      interface{} `json:"Rating"`
	ReviewCount interface{} `json:"ReviewCount"`
	Tagline     string      `json:"Tagline"`
}

type AvailableEventsResponse

type AvailableEventsResponse []AvailableEventResponse

type CapacitySlot

type CapacitySlot struct {
	AvailableCapacity             int64              `json:"AvailableCapacity"`
	AvailablePriceKeys            map[string]float64 `json:"AvailablePriceKeys"`
	Code                          string             `json:"Code"`
	Date                          string             `json:"Date"`
	EndTime                       string             `json:"EndTime"`
	EndTimeMinutesAfterMidnight   int64              `json:"EndTimeMinutesAfterMidnight"`
	StartTime                     string             `json:"StartTime"`
	StartTimeMinutesAfterMidnight int64              `json:"StartTimeMinutesAfterMidnight"`
	TotalCapacity                 int64              `json:"TotalCapacity"`
}

type CapacitySlotResponse

type CapacitySlotResponse []CapacitySlot

type CapacitySlotsRequest

type CapacitySlotsRequest struct {
	PriceKeys []uuid.UUID
	StartDate time.Time
	EndDate   time.Time
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewTicketCounterClient

func NewTicketCounterClient(client http.Client, config Config) (*Client, error)

func (Client) AvailableEvents

func (c Client) AvailableEvents() (*AvailableEventsResponse, error)

func (Client) CapacitySlots

func (c Client) CapacitySlots(request *CapacitySlotsRequest) (*CapacitySlotResponse, error)

func (Client) EventPerformanceSections

func (c Client) EventPerformanceSections(request *EventPerformanceSectionsRequest) (*EventPerformanceSections, error)

func (Client) PlaceReservation

func (c Client) PlaceReservation(request *ReservationRequest) (*ReservationResponse, error)

func (Client) RetrieveReservation

func (c Client) RetrieveReservation(request *RetrieveReservationRequest) (*ReservationResponse, error)

func (Client) Token

func (c Client) Token(request *TokenRequest) (*TokenResponse, error)

type Config

type Config struct {
	Endpoint    Endpoint    `validate:"required"`
	Language    string      `validate:"required"`
	Credentials Credentials `validate:"required"`
}

type ConfirmReservationRequest

type ConfirmReservationRequest struct {
	AmountPaid float32 `json:"AmountPaid"`
}

type ConfirmReservationResponse

type ConfirmReservationResponse struct {
	PortalEditSubscriptionUrl string `json:"PortalEditSubscriptionUrl"`
	Key                       string `json:"Key"`
}

type Credentials

type Credentials struct {
	ClientId     string `validate:"required"`
	ClientSecret string `validate:"required"`
	RefreshToken string `validate:"required"`
}

type Endpoint

type Endpoint string

type EventPerformanceSection

type EventPerformanceSection struct {
	AreaCode              string      `json:"AreaCode"`
	AvailableSeats        int64       `json:"AvailableSeats"`
	Currency              string      `json:"Currency"`
	CurrencyCode          string      `json:"CurrencyCode"`
	DiscountRulesApply    bool        `json:"DiscountRulesApply"`
	EventKey              string      `json:"EventKey"`
	OrderLink             interface{} `json:"OrderLink"`
	PerformanceKey        string      `json:"PerformanceKey"`
	PerformanceSectionKey string      `json:"PerformanceSectionKey"`
	PriceTypes            []struct {
		AvailableAsPassbook  bool        `json:"AvailableAsPassbook"`
		AvailableSeats       *int64      `json:"AvailableSeats"`
		BranchePriceID       interface{} `json:"BranchePriceId"`
		ExternalPriceID      interface{} `json:"ExternalPriceId"`
		ExternalPriceTypeID  string      `json:"ExternalPriceTypeId"`
		IsMinOptional        bool        `json:"IsMinOptional"`
		MaximumAmount        interface{} `json:"MaximumAmount"`
		MinimumAmount        int64       `json:"MinimumAmount"`
		Price                float64     `json:"Price"`
		PriceKey             string      `json:"PriceKey"`
		PriceTypeDescription interface{} `json:"PriceTypeDescription"`
		PriceTypeExtraInfo   interface{} `json:"PriceTypeExtraInfo"`
		PriceTypeImageURL    interface{} `json:"PriceTypeImageUrl"`
		PriceTypeKey         string      `json:"PriceTypeKey"`
		PriceTypeName        string      `json:"PriceTypeName"`
		PriceTypeTicketName  string      `json:"PriceTypeTicketName"`
		ProductCode          string      `json:"ProductCode"`
		Remarks              int64       `json:"Remarks"`
		RequiresCapacitySlot bool        `json:"RequiresCapacitySlot"`
		ShowFrom             interface{} `json:"ShowFrom"`
		SlotsAvailable       bool        `json:"SlotsAvailable"`
		StandardPrice        bool        `json:"StandardPrice"`
		Step                 int64       `json:"Step"`
		SuccessorOf          interface{} `json:"SuccessorOf"`
		TotalSeats           *int64      `json:"TotalSeats"`
		VatPercentage        float32     `json:"VatPercentage"`
	} `json:"PriceTypes"`
	SeatedSection bool   `json:"SeatedSection"`
	SectionKey    string `json:"SectionKey"`
	SectionName   string `json:"SectionName"`
}

type EventPerformanceSections

type EventPerformanceSections []EventPerformanceSection

type EventPerformanceSectionsRequest

type EventPerformanceSectionsRequest struct {
	EventKey       uuid.UUID `validate:"required"`
	PerformanceKey uuid.UUID `validate:"required"`
}

type HttpEnvelope

type HttpEnvelope struct {
	Status int         `json:"status"`
	Data   interface{} `json:"data"`
}

type PriceTypeList

type PriceTypeList []PriceTypeListEntry

type PriceTypeListEntry

type PriceTypeListEntry struct {
	PriceKey                      string  `json:"PriceKey"`
	NrOfSeats                     int     `json:"NrOfSeats"`
	CustomValidFrom               string  `json:"CustomValidFrom,omitempty"`
	CustomValidTo                 string  `json:"CustomValidTo,omitempty"`
	CustomPrice                   float32 `json:"CustomPrice,omitempty"`
	CapacityDate                  string  `json:"CapacityDate,omitempty"`
	StartTimeMinutesAfterMidnight string  `json:"StartTimeMinutesAfterMidnight,omitempty"`
}

type ReservationRequest

type ReservationRequest struct {
	PriceTypeList            PriceTypeList `json:"PriceTypeList"`
	ExternaReservationNumber string        `json:"ExternalReservationNunmber"`
}

type ReservationResponse

type ReservationResponse struct {
	Affiliate        interface{} `json:"Affiliate"`
	BasketKey        interface{} `json:"BasketKey"`
	ConfirmedDate    interface{} `json:"ConfirmedDate"`
	ContactKey       interface{} `json:"ContactKey"`
	ContinuationLink interface{} `json:"ContinuationLink"`
	Currency         string      `json:"Currency"`
	CurrencyCode     string      `json:"CurrencyCode"`
	Discount         float64     `json:"Discount"`
	DiscountTitle    interface{} `json:"DiscountTitle"`
	EventInfo        struct {
		BlockedCountriesForSales interface{} `json:"BlockedCountriesForSales"`
		Categories               []struct {
			CategoryKey     string `json:"CategoryKey"`
			CategoryName    string `json:"CategoryName"`
			SubCategoryKey  string `json:"SubCategoryKey"`
			SubCategoryName string `json:"SubCategoryName"`
		} `json:"Categories"`
		Currency     string      `json:"Currency"`
		CurrencyCode string      `json:"CurrencyCode"`
		EventKey     string      `json:"EventKey"`
		EventName    string      `json:"EventName"`
		LowestPrice  interface{} `json:"LowestPrice"`
		Performances []struct {
			Currency              interface{} `json:"Currency"`
			CurrencyCode          interface{} `json:"CurrencyCode"`
			ExternalPerformanceID string      `json:"ExternalPerformanceID"`
			Location              struct {
				Address struct {
					CityName         string      `json:"CityName"`
					CountryID        interface{} `json:"CountryId"`
					CountryName      string      `json:"CountryName"`
					ExtraAddressLine interface{} `json:"ExtraAddressLine"`
					Lat              float64     `json:"Lat"`
					Lon              float64     `json:"Lon"`
					Number           string      `json:"Number"`
					PostalCode       interface{} `json:"PostalCode"`
					StateName        string      `json:"StateName"`
					Street           string      `json:"Street"`
				} `json:"Address"`
				GeneralInfo         interface{} `json:"GeneralInfo"`
				HandicappedInfo     interface{} `json:"HandicappedInfo"`
				ImageURL            interface{} `json:"ImageUrl"`
				LocationKey         string      `json:"LocationKey"`
				LocationName        string      `json:"LocationName"`
				MailAddress         interface{} `json:"MailAddress"`
				OpeningHoursInfo    interface{} `json:"OpeningHoursInfo"`
				ParkingInfo         interface{} `json:"ParkingInfo"`
				PhoneNumber         interface{} `json:"PhoneNumber"`
				PublicTransportInfo interface{} `json:"PublicTransportInfo"`
				Rating              interface{} `json:"Rating"`
				RestaurantInfo      interface{} `json:"RestaurantInfo"`
				ReviewCount         interface{} `json:"ReviewCount"`
				RouteInfo           interface{} `json:"RouteInfo"`
				Website             interface{} `json:"Website"`
			} `json:"Location"`
			MaxSeatAmountPerOrder          interface{} `json:"MaxSeatAmountPerOrder"`
			OrderLink                      interface{} `json:"OrderLink"`
			PerformanceDescription         string      `json:"PerformanceDescription"`
			PerformanceKey                 string      `json:"PerformanceKey"`
			PerformanceName                string      `json:"PerformanceName"`
			Rating                         interface{} `json:"Rating"`
			Remarks                        int64       `json:"Remarks"`
			ReservationCostsPerTicket      interface{} `json:"ReservationCostsPerTicket"`
			ReservationCostsPerTransaction interface{} `json:"ReservationCostsPerTransaction"`
			ReviewCount                    interface{} `json:"ReviewCount"`
			SortOrder                      interface{} `json:"SortOrder"`
			StartDateTimeText              interface{} `json:"StartDateTimeText"`
		} `json:"Performances"`
		Performer   interface{} `json:"Performer"`
		Rating      interface{} `json:"Rating"`
		ReviewCount interface{} `json:"ReviewCount"`
		Tagline     interface{} `json:"Tagline"`
	} `json:"EventInfo"`
	ExternalReservationNumber      interface{} `json:"ExternalReservationNumber"`
	ExtraInfo1                     interface{} `json:"ExtraInfo1"`
	ExtraInfo2                     interface{} `json:"ExtraInfo2"`
	ExtraInfo3                     interface{} `json:"ExtraInfo3"`
	IsBlocked                      bool        `json:"IsBlocked"`
	IsConfirmed                    bool        `json:"IsConfirmed"`
	IsPaid                         bool        `json:"IsPaid"`
	NrOfTickets                    int64       `json:"NrOfTickets"`
	OriginalTicketAmount           float64     `json:"OriginalTicketAmount"`
	PaymentCosts                   float64     `json:"PaymentCosts"`
	PaymentMethod                  interface{} `json:"PaymentMethod"`
	PerformanceSectionKey          string      `json:"PerformanceSectionKey"`
	PermissionID                   int64       `json:"PermissionId"`
	ReservationCostsPerTicket      float64     `json:"ReservationCostsPerTicket"`
	ReservationCostsPerTransaction float64     `json:"ReservationCostsPerTransaction"`
	ReservationDate                string      `json:"ReservationDate"`
	ReservationKey                 string      `json:"ReservationKey"`
	ReservationNumber              string      `json:"ReservationNumber"`
	ReservationPriceTypes          []struct {
		AvailableAsPassbook           bool        `json:"AvailableAsPassbook"`
		BranchePriceID                interface{} `json:"BranchePriceId"`
		CapacityDate                  interface{} `json:"CapacityDate"`
		CustomPrice                   interface{} `json:"CustomPrice"`
		CustomValidFrom               interface{} `json:"CustomValidFrom"`
		CustomValidTo                 interface{} `json:"CustomValidTo"`
		EndTime                       interface{} `json:"EndTime"`
		EndTimeMinutesAfterMidnight   interface{} `json:"EndTimeMinutesAfterMidnight"`
		NrOfSeats                     int64       `json:"NrOfSeats"`
		OriginalPrice                 float64     `json:"OriginalPrice"`
		PassNumber                    interface{} `json:"PassNumber"`
		Price                         float64     `json:"Price"`
		PriceKey                      string      `json:"PriceKey"`
		PriceTypeKey                  string      `json:"PriceTypeKey"`
		PriceTypeName                 string      `json:"PriceTypeName"`
		ProductCode                   string      `json:"ProductCode"`
		StartTime                     interface{} `json:"StartTime"`
		StartTimeMinutesAfterMidnight interface{} `json:"StartTimeMinutesAfterMidnight"`
		TicketValidFrom               string      `json:"TicketValidFrom"`
		TicketValidTo                 string      `json:"TicketValidTo"`
	} `json:"ReservationPriceTypes"`
	ReservationSubscriptions interface{} `json:"ReservationSubscriptions"`
	SeatSelectionLink        interface{} `json:"SeatSelectionLink"`
	SeatsTogether            interface{} `json:"SeatsTogether"`
	SectionKey               string      `json:"SectionKey"`
	SectionName              string      `json:"SectionName"`
	Status                   string      `json:"Status"`
	TicketAmount             float64     `json:"TicketAmount"`
	Tickets                  []Tickets   `json:"Tickets"`
	TicketsURL               interface{} `json:"TicketsUrl"`
	TotalAmount              float64     `json:"TotalAmount"`
	TotalVat                 float64     `json:"TotalVat"`
	VisitDate                interface{} `json:"VisitDate"`
}

type RetrieveReservationRequest

type RetrieveReservationRequest struct {
	ReservationId uuid.UUID `validate:"required"`
}

Pseudo request types

type StcClient added in v1.0.1

type StcClient struct {
	// contains filtered or unexported fields
}

func CreateClient added in v1.0.1

func CreateClient() StcClient

type TCError

type TCError struct {
	Message          string `json:"Message"`
	ErrorCode        int    `json:"ErrorCode"`
	ErrorCodeStr     string `json:"ErrorCodeStr"`
	ExceptionMessage string `json:"ExceptionMessage"`
}

type Tickets

type Tickets struct {
	TicketKey              string    `json:"TicketKey"`
	Currency               string    `json:"Currency"`
	Price                  float32   `json:"Price"`
	PriceTypeKey           string    `json:"PriceTypeKey"`
	PriceTypeName          string    `json:"PriceTypeName"`
	ExternalPriceTypeID    string    `json:"ExternalPriceTypeID"`
	BranchePriceID         string    `json:"BranchePriceID"`
	SectionName            string    `json:"SectionName"`
	TicketCode             string    `json:"TicketCode"`
	BarcodeType            string    `json:"BarcodeType"`
	RowNumber              string    `json:"RowNumber"`
	SeatNumber             string    `json:"SeatNumber"`
	TicketValidFrom        time.Time `json:"TicketValidFrom"`
	TicketValidTo          time.Time `json:"TicketValidTo"`
	LastClaimDate          time.Time `json:"LastClaimDate"`
	SubscriptionProductKey string    `json:"SubscriptionProductKey"`
	ScanningDisplayMessage string    `json:"ScanningDisplayMessage"`
	TicketText             string    `json:"TicketText"`
	SalesChannelName       string    `json:"SalesChannelName"`
	ExternalPriceID        string    `json:"ExternalPriceID"`
}

type TimeSlot

type TimeSlot struct {
	Id             string `json:"id"`
	Name           string `json:"name"`
	From           string `json:"from"`
	To             string `json:"to"`
	MaxStock       int64  `json:"max_stock"`
	AvailableStock int64  `json:"available_stock"`
}

type TimeSlots

type TimeSlots []TimeSlot

type TokenRequest

type TokenRequest struct {
	GrantType    string `json:"grant_type"`
	ClientId     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`
	RefreshToken string `json:"refresh_token"`
}

type TokenResponse

type TokenResponse struct {
	AccessToken  string `json:"access_token"`
	TokenType    string `json:"token_type"`
	ExpiresIn    int64  `json:"expires_in"`
	RefreshToken string `json:"refresh_token"`
}

type UpdateReservationRequest

type UpdateReservationRequest struct {
	TotalAmount int `json:"TotalAmount"`
}

Directories

Path Synopsis
legacy module

Jump to

Keyboard shortcuts

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