resy

package
v0.0.0-...-25092e8 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAPI = errors.New("resy api error")

Functions

This section is empty.

Types

type Auth

type Auth struct {
	Id                     int             `json:"id"`
	FirstName              string          `json:"first_name"`
	LastName               string          `json:"last_name"`
	MobileNumber           string          `json:"mobile_number"`
	EmAddress              string          `json:"em_address"`
	EmIsVerified           int             `json:"em_is_verified"`
	MobileNumberIsVerified int             `json:"mobile_number_is_verified"`
	IsActive               int             `json:"is_active"`
	ReferralCode           string          `json:"referral_code"`
	IsMarketable           int             `json:"is_marketable"`
	IsConcierge            int             `json:"is_concierge"`
	DateUpdated            int             `json:"date_updated"`
	DateCreated            int             `json:"date_created"`
	HasSetPassword         int             `json:"has_set_password"`
	NumBookings            int             `json:"num_bookings"`
	PaymentMethods         []PaymentMethod `json:"payment_methods"`
	ResySelect             int             `json:"resy_select"`
	ProfileImageUrl        string          `json:"profile_image_url"`
	PaymentMethodId        int             `json:"payment_method_id"`
	PaymentProviderId      int             `json:"payment_provider_id"`
	PaymentProviderName    string          `json:"payment_provider_name"`
	PaymentDisplay         string          `json:"payment_display"`
	Token                  string          `json:"token"`
	LegacyToken            string          `json:"legacy_token"`
}

type CancellationDetails

type CancellationDetails struct {
	Fee *CancellationFeeDetails `json:"fee"`
}

type CancellationFeeDetails

type CancellationFeeDetails struct {
	Amount float64 `json:"amount"`
}

type Challenge

type Challenge struct {
	MobileClaim struct {
		MobileNumber string `json:"mobile_number"`
		ClaimToken   string `json:"claim_token"`
		DateExpires  string `json:"date_expires"`
	} `json:"mobile_claim"`
	Challenge struct {
		ChallengeId string `json:"challenge_id"`
		FirstName   string `json:"first_name"`
		Message     string `json:"message"`
		Properties  []struct {
			Name    string `json:"name"`
			Type    string `json:"type"`
			Message string `json:"message"`
		} `json:"properties"`
	} `json:"challenge"`
}

type Client

type Client interface {
	// GetVenue will return a Venue by its id
	GetVenue(id int) (v Venue, err error)
	// FindReservation will find all reservations for a given day
	FindReservation(venue Venue, day time.Time, partySize int) (found Search, err error)
	// GetReservationDetails will return the reservation details for a given reservation config token
	GetReservationDetails(partySize int, day time.Time, configToken string) (v ReservationDetails, err error)
	// BookReservation will book a reservation from its bookToken
	BookReservation(bookToken string, sendPaymentMethod bool, paymentMethodID int) (v Reservation, err error)
}

func NewClient

func NewClient(opts ...Opts) (Client, error)

NewClient will return a new Client with the given options (see the With* functions for available options)

type Location

type Location struct {
	Lat  float64 `json:"latitude"`
	Long float64 `json:"longitude"`
}

type Opts

type Opts interface {
	// contains filtered or unexported methods
}

Opts is an interface which can be used to set options on the client (see the With* functions for available options)

func WithCredentialsOpts

func WithCredentialsOpts(email, password string) Opts

WithCredentialsOpts will return an Opts which will set the email and password for the client

type PaymentDetails

type PaymentDetails struct {
}

type PaymentMethod

type PaymentMethod struct {
	Id           int    `json:"id"`
	IsDefault    bool   `json:"is_default"`
	ProviderId   int    `json:"provider_id"`
	ProviderName string `json:"provider_name"`
	Display      string `json:"display"`
	Type         string `json:"type"`
	ExpYear      int    `json:"exp_year"`
	ExpMonth     int    `json:"exp_month"`
	IssuingBank  string `json:"issuing_bank"`
}

type Reservation

type Reservation struct {
	ResyToken string `json:"resy_token"`
}

type ReservationBookToken

type ReservationBookToken struct {
	Expires ReservationTime `json:"expires"`
	Value   string          `json:"value"`
}

type ReservationDate

type ReservationDate struct {
	time.Time
}

func (*ReservationDate) UnmarshalJSON

func (t *ReservationDate) UnmarshalJSON(b []byte) (err error)

type ReservationDetails

type ReservationDetails struct {
	BookToken    ReservationBookToken `json:"book_token"`
	Payment      PaymentDetails       `json:"payment"`
	User         UserPayment          `json:"user"`
	Cancellation CancellationDetails  `json:"cancellation"`
}

type ReservationDuration

type ReservationDuration struct {
	Start ReservationDate
	End   ReservationDate
}

type ReservationSlot

type ReservationSlot struct {
	Config SlotConfig          `json:"config"`
	Date   ReservationDuration `json:"date"`
}

type ReservationTime

type ReservationTime struct {
	time.Time
}
type Search struct {
	Results    VenueSearchResults `json:"results"`
	GuestToken string             `json:"guest_token"`
}

type SlotConfig

type SlotConfig struct {
	Type  string `json:"type"`
	Token string `json:"token"`
}

type UserPayment

type UserPayment struct {
	PaymentMethods []UserPaymentMethod
}

type UserPaymentMethod

type UserPaymentMethod struct {
	ID        int    `json:"id"`
	IsDefault bool   `json:"is_default"`
	Type      string `json:"type"`
}

type ValidationCode

type ValidationCode struct {
	MobileNumber string `json:"mobile_number"`
	Method       int    `json:"method"`
	Sent         bool   `json:"sent"`
}

type Venue

type Venue struct {
	Name     string   `json:"name"`
	IDs      VenueID  `json:"id"`
	Location Location `json:"location"`
}

type VenueID

type VenueID struct {
	Resy       int    `json:"resy"`
	Foursquare string `json:"foursquare"`
	Google     string `json:"google"`
}

type VenueSearchResult

type VenueSearchResult struct {
	Venue Venue             `json:"venue"`
	Slots []ReservationSlot `json:"slots"`
}

type VenueSearchResults

type VenueSearchResults struct {
	Venues []VenueSearchResult `json:"venues"`
}

Jump to

Keyboard shortcuts

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