Documentation ¶
Index ¶
- Variables
- type Auth
- type CancellationDetails
- type CancellationFeeDetails
- type Challenge
- type Client
- type Location
- type Opts
- type PaymentDetails
- type PaymentMethod
- type Reservation
- type ReservationBookToken
- type ReservationDate
- type ReservationDetails
- type ReservationDuration
- type ReservationSlot
- type ReservationTime
- type Search
- type SlotConfig
- type UserPayment
- type UserPaymentMethod
- type ValidationCode
- type Venue
- type VenueID
- type VenueSearchResult
- type VenueSearchResults
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) }
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 ¶
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 ¶
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 Search ¶
type Search struct { Results VenueSearchResults `json:"results"` GuestToken string `json:"guest_token"` }
type SlotConfig ¶
type UserPayment ¶
type UserPayment struct {
PaymentMethods []UserPaymentMethod
}
type UserPaymentMethod ¶
type ValidationCode ¶
type VenueSearchResult ¶
type VenueSearchResult struct { Venue Venue `json:"venue"` Slots []ReservationSlot `json:"slots"` }
type VenueSearchResults ¶
type VenueSearchResults struct {
Venues []VenueSearchResult `json:"venues"`
}
Click to show internal directories.
Click to hide internal directories.