Documentation ¶
Overview ¶
Copyright (c) 2024 0x9ef. All rights reserved. Use of this source code is governed by an MIT license that can be found in the LICENSE file.
Copyright (c) 2024 0x9ef. All rights reserved. Use of this source code is governed by an MIT license that can be found in the LICENSE file.
Copyright (c) 2024 0x9ef. All rights reserved. Use of this source code is governed by an MIT license that can be found in the LICENSE file.
Copyright (c) 2024 0x9ef. All rights reserved. Use of this source code is governed by an MIT license that can be found in the LICENSE file.
Copyright (c) 2024 0x9ef. All rights reserved. Use of this source code is governed by an MIT license that can be found in the LICENSE file.
Copyright (c) 2024 0x9ef. All rights reserved. Use of this source code is governed by an MIT license that can be found in the LICENSE file.
Copyright (c) 2024 0x9ef. All rights reserved. Use of this source code is governed by an MIT license that can be found in the LICENSE file.
Copyright (c) 2024 0x9ef. All rights reserved. Use of this source code is governed by an MIT license that can be found in the LICENSE file.
Index ¶
- Variables
- func IsErrorCode(err error, code ErrorCode) bool
- func IsErrorRetryable(err error) bool
- func ParseE163(raw string) string
- type API
- func (api *API) CancelBooking(ctx context.Context, id string, inp *CancelBookingInput) (*CancelBookingResponse, error)
- func (api *API) ChangeBooking(ctx context.Context, id string, inp *ChangeBookingInput) (*ChangeBookingResponse, error)
- func (api *API) ConfirmBooking(ctx context.Context, inp *ConfirmBookingInput) (*ConfirmBookingResponse, error)
- func (api *API) GetBooking(ctx context.Context, id string) (*GetBookingResponse, error)
- func (api *API) GetHotelDetails(ctx context.Context, codes []int, inp *GetHotelDetailsInput) (*GetHotelDetailsResponse, error)
- func (api *API) ListAccommodations(ctx context.Context, inp *ListAccommodationsInput) (*ListAccommodationsResponse, error)
- func (api *API) ListAvailableHotels(ctx context.Context, inp *ListAvailableHotelsInput) (*ListAvailableHotelsResponse, error)
- func (api *API) ListBoardGroups(ctx context.Context, inp *ListBoardGroupsInput) (*ListBoardGroupsResponse, error)
- func (api *API) ListBoards(ctx context.Context, inp *ListBoardsInput) (*ListBoardsResponse, error)
- func (api *API) ListBookings(ctx context.Context, inp *CancelBookingInput) (*CancelBookingResponse, error)
- func (api *API) ListCategories(ctx context.Context, inp *ListCategoriesInput) (*ListCategoriesResponse, error)
- func (api *API) ListChains(ctx context.Context, inp *ListChainsInput) (*ListChainsResponse, error)
- func (api *API) ListCheckRates(ctx context.Context, inp *ListCheckRatesInput) (*ListCheckRatesResponse, error)
- func (api *API) ListClassifications(ctx context.Context, inp *ListClassificationsInput) (*ListClassificationsResponse, error)
- func (api *API) ListCountries(ctx context.Context, inp *ListCountriesInput) (*ListCountriesResp, error)
- func (api *API) ListCurrencies(ctx context.Context, inp *ListCurrenciesInput) (*ListCurrenciesResponse, error)
- func (api *API) ListDestinations(ctx context.Context, inp *ListDestinationsInput) (*ListDestinationsResponse, error)
- func (api *API) ListFacilities(ctx context.Context, inp *ListFacilitiesInput) (*ListFacilitiesResponse, error)
- func (api *API) ListFacilityGroups(ctx context.Context, inp *ListFacilityGroupsInput) (*ListFacilityGroupsResponse, error)
- func (api *API) ListFacilityTypologies(ctx context.Context, inp *ListFacilityTypologiesInput) (*ListFacilityTypologiesResponse, error)
- func (api *API) ListHotels(ctx context.Context, inp *ListHotelsInput) (*ListHotelsResponse, error)
- func (api *API) ListImageTypes(ctx context.Context, inp *ListImageTypesInput) (*ListImageTypesResponse, error)
- func (api *API) ListIssues(ctx context.Context, inp *ListIssuesInput) (*ListIssuesResponse, error)
- func (api *API) ListLanguages(ctx context.Context, inp *ListLanguagesInput) (*ListLanguagesResponse, error)
- func (api *API) ListPromotions(ctx context.Context, inp *ListPromotionsInput) (*ListPromotionsResponse, error)
- func (api *API) ListRateComments(ctx context.Context, inp *ListRateCommentsInput) (*ListRateCommentsResponse, error)
- func (api *API) ListRooms(ctx context.Context, inp *ListRoomsInput) (*ListRoomsResponse, error)
- func (api *API) ListSegments(ctx context.Context, inp *ListSegmentsInput) (*ListSegmentsResponse, error)
- func (api *API) ListTerminals(ctx context.Context, inp *ListTerminalsInput) (*ListTerminalsResponse, error)
- type Accommodation
- type Address
- type Amount
- type AuditData
- type AvailableHotel
- type AvailableHotelRoom
- type BillingAddress
- type Board
- type BoardGroup
- type Booking
- type BookingClient
- type BookingHotel
- type BookingRoom
- type BookingStatus
- type BreakDown
- type CancelBookingInput
- type CancelBookingResponse
- type CancellationPolicy
- type Category
- type Chain
- type ChangeBookingInput
- type ChangeBookingResponse
- type CheckRate
- type CheckRateHotel
- type CheckRateRoom
- type Classification
- type Client
- type CommaSliceInt
- type CommaSliceString
- type ConfirmBookingInput
- type ConfirmBookingResponse
- type ConfirmBookingRoom
- type ContactData
- type Content
- type ContentClient
- type Coordinate
- type Coordinates
- type Country
- type Currency
- type DailyRate
- type Datetime
- type Destination
- type Device
- type Discount
- type Distance
- type Email
- type Environments
- type Error
- type ErrorCode
- type Facility
- type FacilityGroup
- type FacilityTypology
- type Filter
- type FilterBoards
- type FilterHotel
- type FilterRooms
- type FloatRate
- type Geolocation
- type GetBookingResponse
- type GetHotelDetailsInput
- type GetHotelDetailsResponse
- type GroupZone
- type Holder
- type Hosts
- type Hotel
- type HotelAccomodation
- type HotelFacility
- type HotelImage
- type HotelInterestPoint
- type HotelIssue
- type HotelRoom
- type HotelRoomFacility
- type HotelRoomStay
- type HotelTerminal
- type HotelWildCard
- type ImageType
- type IncludeHotels
- type InvoiceCompany
- type Issue
- type Keyword
- type Language
- type ListAccommodationsInput
- type ListAccommodationsResponse
- type ListAvailableHotelsInput
- type ListAvailableHotelsResponse
- type ListBoardGroupsInput
- type ListBoardGroupsResponse
- type ListBoardsInput
- type ListBoardsResponse
- type ListBookingsInput
- type ListBookingsResponse
- type ListCategoriesInput
- type ListCategoriesResponse
- type ListChainsInput
- type ListChainsResponse
- type ListCheckRatesInput
- type ListCheckRatesResponse
- type ListCheckRatesRoom
- type ListClassificationsInput
- type ListClassificationsResponse
- type ListCountriesInput
- type ListCountriesResp
- type ListCurrenciesInput
- type ListCurrenciesResponse
- type ListDestinationsInput
- type ListDestinationsResponse
- type ListFacilitiesInput
- type ListFacilitiesResponse
- type ListFacilityGroupsInput
- type ListFacilityGroupsResponse
- type ListFacilityTypologiesInput
- type ListFacilityTypologiesResponse
- type ListHotelsInput
- type ListHotelsResponse
- type ListImageTypesInput
- type ListImageTypesResponse
- type ListInput
- type ListIssuesInput
- type ListIssuesResponse
- type ListLanguagesInput
- type ListLanguagesResponse
- type ListPromotionsInput
- type ListPromotionsResponse
- type ListRateCommentsInput
- type ListRateCommentsResponse
- type ListRoomsInput
- type ListRoomsResponse
- type ListSegmentsInput
- type ListSegmentsResponse
- type ListTerminalsInput
- type ListTerminalsResponse
- type Mode
- type ModificationPolicy
- type Occupancy
- type Offer
- type Option
- type Options
- type Order
- type Pax
- type PaxType
- type PaymentCard
- type PaymentData
- type PaymentType
- type Phone
- type PhoneType
- type ProcessTime
- type Promotion
- type Radius
- type Rate
- type RateComment
- type RateCommentComment
- type RateCommentItem
- type Review
- type Room
- type Segment
- type ShiftRate
- type SimpleCode
- type State
- type Stay
- type Supplier
- type Tax
- type Terminal
- type ThreeDSData
- type ThreeDSDataInfoProvided
- type Timestamp
- type TimestampTZ
- type Unit
- type UpsellingRate
- type ValidationError
- type Voucher
- type Zone
Constants ¶
This section is empty.
Variables ¶
var ( // General error. ErrNoHealthyUpstream = errors.New("no healthy upstead") ErrExternal = errors.New("external error") ErrRateLimitExceeded = errors.New("rate limits exceeded") ErrQuotaExceeded = errors.New("quota exceeded") ErrConfiguration = errors.New("configuration error") ErrSystem = errors.New("system error") ErrInvalidRequest = errors.New("invalid request") ErrInvalidData = errors.New("invalid data") // Product errors. ErrAllotmentExceeded = errors.New("allotment exceeded") ErrInsufficientAllotment = errors.New("insufficient allotment") ErrPriceHasIncreased = errors.New("price has increased") ErrPriceHasChanged = errors.New("price has changed") ErrStopSales = errors.New("stop sales") ErrBookingDoesNotExist = errors.New("booking does not exist") ErrBookingCannotBeCanceledAfterCheckIn = errors.New("cannot cancel a booking after the check-in") ErrBookingCannotBeCanceledOrModifiedWhenCheckInPast = errors.New("cannot cancel/modify a booking which has a check-in date in the past") ErrBookingCannotBeAmended = errors.New("this booking cannot be amended") ErrBookingConfirmationError = errors.New("booking confirmation error") ErrMinimumStayViolated = errors.New("minimum stay violated") ErrCodeIsInvalid = errors.New("code is invalid") ErrPleaseDoNotTryAgain = errors.New("please do not retry again") ErrHotelDoesNotAllowCancellation = errors.New("hotel does not allow cancellations") ErrReservationUnreachable = errors.New("reservation does not exist or the agency does not access") ErrUndefined = errors.New("undefined error") )
Functions ¶
func IsErrorCode ¶
IsErrorCode checks if error contains specified code.
func IsErrorRetryable ¶
IsErrorRetryable checks if error is retryable.
Types ¶
type API ¶
func (*API) CancelBooking ¶ added in v0.2.0
func (api *API) CancelBooking(ctx context.Context, id string, inp *CancelBookingInput) (*CancelBookingResponse, error)
func (*API) ChangeBooking ¶ added in v0.2.0
func (api *API) ChangeBooking(ctx context.Context, id string, inp *ChangeBookingInput) (*ChangeBookingResponse, error)
func (*API) ConfirmBooking ¶ added in v0.2.0
func (api *API) ConfirmBooking(ctx context.Context, inp *ConfirmBookingInput) (*ConfirmBookingResponse, error)
Ref - https://developer.hotelbeds.com/documentation/hotels/booking-api/api-reference/#operation/booking
func (*API) GetBooking ¶ added in v0.2.0
func (*API) GetHotelDetails ¶
func (api *API) GetHotelDetails(ctx context.Context, codes []int, inp *GetHotelDetailsInput) (*GetHotelDetailsResponse, error)
func (*API) ListAccommodations ¶ added in v0.2.0
func (api *API) ListAccommodations(ctx context.Context, inp *ListAccommodationsInput) (*ListAccommodationsResponse, error)
func (*API) ListAvailableHotels ¶
func (api *API) ListAvailableHotels(ctx context.Context, inp *ListAvailableHotelsInput) (*ListAvailableHotelsResponse, error)
func (*API) ListBoardGroups ¶ added in v0.2.0
func (api *API) ListBoardGroups(ctx context.Context, inp *ListBoardGroupsInput) (*ListBoardGroupsResponse, error)
func (*API) ListBoards ¶ added in v0.2.0
func (api *API) ListBoards(ctx context.Context, inp *ListBoardsInput) (*ListBoardsResponse, error)
func (*API) ListBookings ¶ added in v0.2.0
func (api *API) ListBookings(ctx context.Context, inp *CancelBookingInput) (*CancelBookingResponse, error)
func (*API) ListCategories ¶ added in v0.2.0
func (api *API) ListCategories(ctx context.Context, inp *ListCategoriesInput) (*ListCategoriesResponse, error)
func (*API) ListChains ¶ added in v0.2.0
func (api *API) ListChains(ctx context.Context, inp *ListChainsInput) (*ListChainsResponse, error)
func (*API) ListCheckRates ¶
func (api *API) ListCheckRates(ctx context.Context, inp *ListCheckRatesInput) (*ListCheckRatesResponse, error)
Ref - https://developer.hotelbeds.com/documentation/hotels/booking-api/api-reference/#operation/checkRate
func (*API) ListClassifications ¶ added in v0.2.0
func (api *API) ListClassifications(ctx context.Context, inp *ListClassificationsInput) (*ListClassificationsResponse, error)
func (*API) ListCountries ¶
func (api *API) ListCountries(ctx context.Context, inp *ListCountriesInput) (*ListCountriesResp, error)
func (*API) ListCurrencies ¶ added in v0.2.0
func (api *API) ListCurrencies(ctx context.Context, inp *ListCurrenciesInput) (*ListCurrenciesResponse, error)
func (*API) ListDestinations ¶
func (api *API) ListDestinations(ctx context.Context, inp *ListDestinationsInput) (*ListDestinationsResponse, error)
func (*API) ListFacilities ¶ added in v0.2.0
func (api *API) ListFacilities(ctx context.Context, inp *ListFacilitiesInput) (*ListFacilitiesResponse, error)
func (*API) ListFacilityGroups ¶ added in v0.2.0
func (api *API) ListFacilityGroups(ctx context.Context, inp *ListFacilityGroupsInput) (*ListFacilityGroupsResponse, error)
func (*API) ListFacilityTypologies ¶ added in v0.2.0
func (api *API) ListFacilityTypologies(ctx context.Context, inp *ListFacilityTypologiesInput) (*ListFacilityTypologiesResponse, error)
func (*API) ListHotels ¶
func (api *API) ListHotels(ctx context.Context, inp *ListHotelsInput) (*ListHotelsResponse, error)
func (*API) ListImageTypes ¶ added in v0.2.0
func (api *API) ListImageTypes(ctx context.Context, inp *ListImageTypesInput) (*ListImageTypesResponse, error)
func (*API) ListIssues ¶ added in v0.2.0
func (api *API) ListIssues(ctx context.Context, inp *ListIssuesInput) (*ListIssuesResponse, error)
func (*API) ListLanguages ¶ added in v0.2.0
func (api *API) ListLanguages(ctx context.Context, inp *ListLanguagesInput) (*ListLanguagesResponse, error)
func (*API) ListPromotions ¶ added in v0.2.0
func (api *API) ListPromotions(ctx context.Context, inp *ListPromotionsInput) (*ListPromotionsResponse, error)
func (*API) ListRateComments ¶ added in v0.2.0
func (api *API) ListRateComments(ctx context.Context, inp *ListRateCommentsInput) (*ListRateCommentsResponse, error)
func (*API) ListRooms ¶ added in v0.2.0
func (api *API) ListRooms(ctx context.Context, inp *ListRoomsInput) (*ListRoomsResponse, error)
func (*API) ListSegments ¶ added in v0.2.0
func (api *API) ListSegments(ctx context.Context, inp *ListSegmentsInput) (*ListSegmentsResponse, error)
func (*API) ListTerminals ¶ added in v0.2.0
func (api *API) ListTerminals(ctx context.Context, inp *ListTerminalsInput) (*ListTerminalsResponse, error)
type Accommodation ¶ added in v0.2.0
type Amount ¶
Amount is an arbitrary-precision decimal.
func (Amount) MarshalJSON ¶
func (*Amount) UnmarshalJSON ¶
type AuditData ¶
type AuditData struct { ProcessTime ProcessTime `json:"processTime"` Timestamp Timestamp `json:"timestamp"` RequestHosts Hosts `json:"requestHost"` Environments Environments `json:"environment"` ServerID string `json:"serverId"` Release string `json:"release,omitempty"` Token string `json:"token"` Internal string `json:"internal"` }
AuditData represents useful debug information about timestamp when request happened, time to process, server ID, etc...
type AvailableHotel ¶
type AvailableHotel struct { Code int `json:"code"` Name string `json:"name"` CategoryCode string `json:"categoryCode"` CategoryName string `json:"categoryName"` DestinationCode string `json:"destinationCode"` DestinationName string `json:"destinationName"` ZoneCode int `json:"zoneCode"` ZoneName string `json:"zoneName"` Latitude Coordinate `json:"latitude"` Longitude Coordinate `json:"longitude"` Rooms []AvailableHotelRoom `json:"rooms"` MinRate FloatRate `json:"minRate"` MaxRate FloatRate `json:"maxRate"` Currency string `json:"currency"` }
type AvailableHotelRoom ¶
type BillingAddress ¶ added in v0.2.0
type BoardGroup ¶ added in v0.2.0
type Booking ¶ added in v0.2.0
type Booking struct { Reference string `json:"reference"` CancellationReference string `json:"cancellationReference"` ClientReference string `json:"clientReference"` CreationDate Datetime `json:"creationDate"` CreationUser string `json:"creationUser"` Status BookingStatus `json:"status"` ModificationPolicy ModificationPolicy `json:"modificationPolicies"` AgComission string `json:"agComission"` VATComission string `json:"comissionVAT"` Holder Holder `json:"holder"` Remark string `json:"remark"` InvoiceCompany InvoiceCompany `json:"invoiceCompany"` TotalSellingRate Amount `json:"totalSellingRate"` TotalNet Amount `json:"totalNet"` PendingAmount Amount `json:"pendingAmount"` Currency string `json:"currency"` Hotel BookingHotel `json:"hotel"` }
type BookingClient ¶
type BookingClient interface { ListAvailableHotels(ctx context.Context, inp *ListAvailableHotelsInput) (*ListAvailableHotelsResponse, error) ListCheckRates(ctx context.Context, inp *ListCheckRatesInput) (*ListCheckRatesResponse, error) GetBooking(ctx context.Context, id string) (*GetBookingResponse, error) ListBookings(ctx context.Context, inp *CancelBookingInput) (*CancelBookingResponse, error) ConfirmBooking(ctx context.Context, inp *ConfirmBookingInput) (*ConfirmBookingResponse, error) ChangeBooking(ctx context.Context, id string, inp *ChangeBookingInput) (*ChangeBookingResponse, error) CancelBooking(ctx context.Context, id string, inp *CancelBookingInput) (*CancelBookingResponse, error) }
type BookingHotel ¶ added in v0.2.0
type BookingHotel struct { AvailableHotel CheckIn string `json:"checkIn"` CheckOut string `json:"checkOut"` TotalSellingRate Amount `json:"totalSellingRate"` TotalNet Amount `json:"totalNet"` PendingAmount Amount `json:"pendingAmount"` Currency string `json:"currency"` Supplier *Supplier `json:"supplier"` ClientComments string `json:"clientComments"` CancellationAmount Amount `json:"cancellationAmount"` Upselling []UpsellingRate `json:"upselling,omitempty"` Keywords []Keyword `json:"keywords,omitempty"` Reviews []Review `json:"reviews,omitempty"` Rooms []BookingRoom `json:"rooms"` }
type BookingRoom ¶ added in v0.2.0
type BookingStatus ¶ added in v0.2.0
type BookingStatus string
const ( BookingStatusConfirmed BookingStatus = "CONFIRMED" BookingStatusCancelled BookingStatus = "CANCELLED" )
func (BookingStatus) String ¶ added in v0.2.0
func (s BookingStatus) String() string
type CancelBookingInput ¶ added in v0.2.0
type CancelBookingResponse ¶ added in v0.2.0
type CancellationPolicy ¶
type CancellationPolicy struct { Amount Amount `json:"amount"` From TimestampTZ `json:"from"` }
type Category ¶ added in v0.2.0
type Category struct { Code string `json:"code"` SimpleCode SimpleCode `json:"simpleCode"` Group string `json:"group"` Description Content `json:"description"` }
type ChangeBookingInput ¶ added in v0.2.0
type ChangeBookingInput struct { // Enum: "SIMULATION" "UPDATE" // Defines if the operation will be a simulation or an actual modification. Mode Mode `json:"mode"` Payment *PaymentData `json:"paymentData"` Language string `json:"language"` Booking *Booking `json:"booking"` }
type ChangeBookingResponse ¶ added in v0.2.0
type CheckRateHotel ¶
type CheckRateHotel struct { Code int `json:"code"` Name string `json:"name"` CategoryCode string `json:"categoryCode"` CategoryName string `json:"categoryName"` DestinationCode string `json:"destinationCode"` DestinationName string `json:"destinationName"` ZoneCode int `json:"zoneCode"` ZoneName string `json:"zoneName"` Latitude Coordinate `json:"latitude"` Longitude Coordinate `json:"longitude"` Rooms []CheckRateRoom `json:"rooms"` MinRate *FloatRate `json:"minRate"` MaxRate *FloatRate `json:"maxRate"` Currency string `json:"currency"` CheckIn string `json:"checkIn"` CheckOut string `json:"checkOut"` TotalNet Amount `json:"totalNet"` PaymentDataRequired bool `json:"paymentDataRequired"` ModificationPolicies ModificationPolicy `json:"modificationPolicies"` }
type CheckRateRoom ¶
type Classification ¶ added in v0.2.0
type Client ¶
type Client interface { ContentClient BookingClient }
type CommaSliceInt ¶ added in v0.2.0
type CommaSliceInt []int
func (*CommaSliceInt) UnmarshalJSON ¶ added in v0.2.0
func (s *CommaSliceInt) UnmarshalJSON(data []byte) error
type CommaSliceString ¶ added in v0.2.0
type CommaSliceString []string
func (*CommaSliceString) UnmarshalJSON ¶ added in v0.2.0
func (s *CommaSliceString) UnmarshalJSON(data []byte) error
type ConfirmBookingInput ¶ added in v0.2.0
type ConfirmBookingInput struct { Holder Holder `json:"holder"` Payment *PaymentData `json:"paymentData,omitempty"` // Internal booking reference. ClientReference string `json:"clientReference"` // Identifies the agent name of the booking. // If empty, by default it will be the same than the apikey performing the booking . CreationUser string `json:"creationUser,omitempty"` // Free text sent to the hotelier. It can be used to request or inform of special requests to hotelier like: // “Non-smoking room preferred”, “Twin bed please”, “Upper floor preferred”, “Late arrival”…. Remark string `json:"remark,omitempty"` Voucher *Voucher `json:"voucher,omitempty"` // Margin of price difference (as percentage) accepted when a price difference occurs between // Availability/CheckRate and Booking operations. Do not use more than two decimal characters when // defining tolerance. // Example: to input a tolerance of 5%, you should input 5.00. // NOTE: Authorisation for the use of this tag is subject to prior written agreement with your sales manager Tolerance Amount `json:"tolerance,omitempty"` // Language code that defines the language of the response. // English will be used by default if this field is not informed. Language string `json:"language,omitempty"` Rooms []ConfirmBookingRoom `json:"rooms"` }
Reservations.
type ConfirmBookingResponse ¶ added in v0.2.0
type ConfirmBookingRoom ¶ added in v0.2.0
type ContactData ¶ added in v0.2.0
type ContentClient ¶
type ContentClient interface { ListHotels(ctx context.Context, inp *ListHotelsInput) (*ListHotelsResponse, error) GetHotelDetails(ctx context.Context, codes []int, inp *GetHotelDetailsInput) (*GetHotelDetailsResponse, error) ListAccommodations(ctx context.Context, inp *ListAccommodationsInput) (*ListAccommodationsResponse, error) ListCountries(ctx context.Context, inp *ListCountriesInput) (*ListCountriesResp, error) ListDestinations(ctx context.Context, inp *ListDestinationsInput) (*ListDestinationsResponse, error) ListBoards(ctx context.Context, inp *ListBoardsInput) (*ListBoardsResponse, error) ListBoardGroups(ctx context.Context, inp *ListBoardGroupsInput) (*ListBoardGroupsResponse, error) ListCategories(ctx context.Context, inp *ListCategoriesInput) (*ListCategoriesResponse, error) ListChains(ctx context.Context, inp *ListChainsInput) (*ListChainsResponse, error) ListClassifications(ctx context.Context, inp *ListClassificationsInput) (*ListClassificationsResponse, error) ListCurrencies(ctx context.Context, inp *ListCurrenciesInput) (*ListCurrenciesResponse, error) ListFacilities(ctx context.Context, inp *ListFacilitiesInput) (*ListFacilitiesResponse, error) ListFacilityGroups(ctx context.Context, inp *ListFacilityGroupsInput) (*ListFacilityGroupsResponse, error) ListFacilityTypologies(ctx context.Context, inp *ListFacilityTypologiesInput) (*ListFacilityTypologiesResponse, error) ListImageTypes(ctx context.Context, inp *ListImageTypesInput) (*ListImageTypesResponse, error) ListIssues(ctx context.Context, inp *ListIssuesInput) (*ListIssuesResponse, error) ListLanguages(ctx context.Context, inp *ListLanguagesInput) (*ListLanguagesResponse, error) ListPromotions(ctx context.Context, inp *ListPromotionsInput) (*ListPromotionsResponse, error) ListRooms(ctx context.Context, inp *ListRoomsInput) (*ListRoomsResponse, error) ListRateComments(ctx context.Context, inp *ListRateCommentsInput) (*ListRateCommentsResponse, error) ListSegments(ctx context.Context, inp *ListSegmentsInput) (*ListSegmentsResponse, error) ListTerminals(ctx context.Context, inp *ListTerminalsInput) (*ListTerminalsResponse, error) }
type Coordinate ¶
type Coordinate float64
func (*Coordinate) UnmarshalJSON ¶
func (c *Coordinate) UnmarshalJSON(data []byte) error
type Coordinates ¶
type Datetime ¶
Datetime is time with "2006-01-02" layout.
func (Datetime) MarshalJSON ¶
func (*Datetime) UnmarshalJSON ¶
type Destination ¶
type Environments ¶
type Environments []string
func (*Environments) UnmarshalJSON ¶
func (rh *Environments) UnmarshalJSON(data []byte) error
type Error ¶
type FacilityGroup ¶ added in v0.2.0
type FacilityTypology ¶ added in v0.2.0
type FacilityTypology struct { Code int `json:"code"` HasNumber bool `json:"numberFlag"` HasLogic bool `json:"logicFlag"` HasDistance bool `json:"distanceFlag"` HasAgeFrom bool `json:"ageFromFlag"` HasAgeTo bool `json:"ageToFlag"` HasTimeFrom bool `json:"timeFromFlag"` HasTimeTo bool `json:"timeToFlag"` HasIndicatesYesOrNo bool `json:"indYesOrNoFlag"` HasAmount bool `json:"amountFlag"` HasCurrency bool `json:"currencyFlag"` HasApplicationType bool `json:"appTypeFlag"` HasText bool `json:"textFlag"` }
type Filter ¶
type Filter struct { MaxHotels int `json:"maxHotels,omitempty"` MaxRooms int `json:"maxRooms,omitempty"` MinRate FloatRate `json:"minRate,omitempty"` MaxRate FloatRate `json:"maxRate,omitempty"` MaxRatesPerRoom int `json:"maxRatesPerRoom"` MinCategory int `json:"minCategory,omitempty"` MaxCategory int `json:"maxCategory,omitempty"` }
type FilterBoards ¶
type FilterHotel ¶
type FilterHotel struct {
HotelCodes []int `json:"hotel"`
}
func (*FilterHotel) Validate ¶
func (f *FilterHotel) Validate() error
type FilterRooms ¶
type FloatRate ¶
type FloatRate float64
func (FloatRate) MarshalJSON ¶
func (*FloatRate) UnmarshalJSON ¶
type Geolocation ¶
type Geolocation struct { Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` Radius Radius `json:"radius"` Unit Unit `json:"unit"` }
func (*Geolocation) Validate ¶
func (geo *Geolocation) Validate() error
type GetBookingResponse ¶ added in v0.2.0
type GetHotelDetailsInput ¶
type GetHotelDetailsResponse ¶
type Hotel ¶
type Hotel struct { Code int `json:"code"` Name Content `json:"name"` CountryCode string `json:"countryCode"` StateCode string `json:"stateCode"` DestinationCode string `json:"destinationCode"` ZoneCode int `json:"zoneCode"` Coordinates Coordinates `json:"coordinates"` CategoryCode string `json:"categoryCode"` CategoryGroupCode string `json:"categoryGroupCode"` ChainCode string `json:"chainCode"` AccommodationType *HotelAccomodation `json:"accommodationType"` AccomodationTypeCode string `json:"accomodationTypeCode,omitempty"` BoardCodes []string `json:"boardCodes"` SegmentCodes []int `json:"segmentCodes"` Address Address `json:"address"` PostalCode string `json:"postalCode"` City Content `json:"city"` Email string `json:"email"` License string `json:"license,omitempty"` URL string `json:"web"` LastUpdate Datetime `json:"lastUpdate"` S2C string `json:"S2C"` Ranking int `json:"ranking"` Phones []Phone `json:"phones"` Rooms []HotelRoom `json:"rooms"` Facilities []HotelFacility `json:"facilities"` Issues []HotelIssue `json:"issues"` Wildcards []HotelWildCard `json:"wildCards"` Terminals []HotelTerminal `json:"terminals"` InterestPoints []HotelInterestPoint `json:"interestPoints"` Images []HotelImage `json:"images,omitempty"` }
type HotelAccomodation ¶
type HotelFacility ¶ added in v0.2.0
type HotelImage ¶ added in v0.2.0
type HotelInterestPoint ¶ added in v0.2.0
type HotelIssue ¶ added in v0.2.0
type HotelRoom ¶
type HotelRoom struct { Code string `json:"roomCode"` IsParentRoom bool `json:"isParentRoom"` MinPax int `json:"minPax"` MaxPax int `json:"maxPax"` MinAdults int `json:"minAdults"` MaxAdults int `json:"maxAdults"` MinChildren int `json:"minChildren"` MaxChildren int `json:"maxChildren"` Type string `json:"roomType"` CharacteristicCode string `json:"characteristicCode"` Facilities []HotelRoomFacility `json:"roomFacilities"` }
type HotelRoomFacility ¶
type HotelRoomStay ¶
type HotelRoomStay struct { Type string `json:"stayType"` Order Order `json:"order"` Description string `json:"description"` Facilities []HotelRoomFacility `json:"roomStayFacilities"` }
type HotelTerminal ¶ added in v0.2.0
type HotelWildCard ¶ added in v0.2.0
type IncludeHotels ¶
type IncludeHotels string
const ( IncludeHotelsWebOnly IncludeHotels = "webOnly" IncludeHotelsNotOnSale IncludeHotels = "notOnSale" )
func (IncludeHotels) String ¶
func (ih IncludeHotels) String() string
type InvoiceCompany ¶ added in v0.2.0
type ListAccommodationsInput ¶ added in v0.2.0
type ListAccommodationsInput struct {
ListInput
}
type ListAccommodationsResponse ¶ added in v0.2.0
type ListAccommodationsResponse struct { Audit *AuditData `json:"auditData"` Accommodations []Accommodation }
type ListAvailableHotelsInput ¶
type ListAvailableHotelsInput struct { Stay Stay `json:"stay"` Occupancies []Occupancy `json:"occupancies"` Keywords []Keyword `json:"keywords,omitempty"` Geolocation *Geolocation `json:"geolocation,omitempty"` Filter *Filter `json:"filter,omitempty"` Boards *FilterBoards `json:"boards,omitempty"` Rooms *FilterRooms `json:"rooms,omitempty"` Hotels FilterHotel `json:"hotels"` // Displays price breakdown per each day of the hotel stay. WithDailyRate bool `json:"dailyRate"` // Hotelbeds Group client source market. SourceMarket string `json:"sourceMarket,omitempty"` // Defines the platform for multiclient developer platforms. Platform int `json:"platform,omitempty"` // Language code that defines the language of the response. // English will be used by default if this field is not informed. Language string `json:"language,omitempty"` // Filter for accomodation type. Accomodations []string `json:"accomodations,omitempty"` }
func (*ListAvailableHotelsInput) Validate ¶
func (inp *ListAvailableHotelsInput) Validate() error
type ListAvailableHotelsResponse ¶
type ListAvailableHotelsResponse struct { Audit *AuditData `json:"auditData"` Hotels struct { CheckIn Datetime `json:"checkIn"` CheckOut Datetime `json:"checkOut"` Total int `json:"total"` Hotels []AvailableHotel `json:"hotels"` } `json:"hotels"` }
type ListBoardGroupsInput ¶ added in v0.2.0
type ListBoardGroupsResponse ¶ added in v0.2.0
type ListBoardGroupsResponse struct { Audit *AuditData `json:"auditData"` Groups []BoardGroup `json:"boards"` }
type ListBoardsInput ¶ added in v0.2.0
type ListBoardsInput struct {
ListInput
}
type ListBoardsResponse ¶ added in v0.2.0
type ListBookingsInput ¶ added in v0.2.0
type ListBookingsInput struct { ListInput FilterType string `json:"filterType"` FilterClientReference string `json:"clientReference"` FilterCreationUser string `json:"creationUser"` // Parameter to filter the results by the country code of the hotel. Can include multiple values separated by commas. FilterCountires CommaSliceString `json:"country"` FilterDestinations CommaSliceString `json:"destination"` FilterHotels CommaSliceInt `json:"hotel"` // Defines the starting date of the range of bookings to be returned. FilterStart Datetime `json:"start"` // Defines the ending date of the range of bookings to be returned. value. FilterEnd Datetime `json:"end"` }
type ListBookingsResponse ¶ added in v0.2.0
type ListCategoriesInput ¶ added in v0.2.0
type ListCategoriesInput struct {
ListInput
}
type ListCategoriesResponse ¶ added in v0.2.0
type ListChainsInput ¶ added in v0.2.0
type ListChainsInput struct {
ListInput
}
type ListChainsResponse ¶ added in v0.2.0
type ListCheckRatesInput ¶
type ListCheckRatesInput struct { // Parameter to add or remove the upSelling options node to the response. Upselling bool `json:"upselling"` // When true, it will add either the percent or the numberOfnights to the cancellation policies. ExpandCXL bool `json:"expandCXL"` // Language code that defines the language of the response. // English will be used by default if this field is not informed. Language string `json:"language"` // List of rooms to be checked/valuated. Rooms []ListCheckRatesRoom `json:"rooms"` }
CheckRates.
type ListCheckRatesResponse ¶
type ListCheckRatesResponse struct { Audit *AuditData `json:"auditData"` Hotel *CheckRateHotel `json:"hotel"` }
type ListCheckRatesRoom ¶
type ListCheckRatesRoom struct { // Internal key that represents a combination of room type, category, board and occupancy. // Is returned in Availability and used to valuate a rate and confirm a booking. RateKey string `json:"rateKey"` // Data of the passengers assigned to this room. Paxes []Pax `json:"paxes"` }
type ListClassificationsInput ¶ added in v0.2.0
type ListClassificationsInput struct {
ListInput
}
type ListClassificationsResponse ¶ added in v0.2.0
type ListClassificationsResponse struct { Audit *AuditData `json:"auditData"` Classifications []Classification `json:"classifications"` }
type ListCountriesInput ¶
type ListCountriesInput struct {
ListInput
}
type ListCountriesResp ¶
type ListCurrenciesInput ¶ added in v0.2.0
type ListCurrenciesInput struct {
ListInput
}
type ListCurrenciesResponse ¶ added in v0.2.0
type ListDestinationsInput ¶
type ListDestinationsInput struct {
ListInput
}
type ListDestinationsResponse ¶
type ListDestinationsResponse struct { Audit *AuditData `json:"auditData"` Destinations []Destination `json:"destinations"` }
type ListFacilitiesInput ¶ added in v0.2.0
type ListFacilitiesInput struct {
ListInput
}
type ListFacilitiesResponse ¶ added in v0.2.0
type ListFacilityGroupsInput ¶ added in v0.2.0
type ListFacilityGroupsInput struct {
ListInput
}
type ListFacilityGroupsResponse ¶ added in v0.2.0
type ListFacilityGroupsResponse struct { Audit *AuditData `json:"auditData"` Groups []FacilityGroup `json:"facilityGroups"` }
type ListFacilityTypologiesInput ¶ added in v0.2.0
type ListFacilityTypologiesInput struct {
ListInput
}
type ListFacilityTypologiesResponse ¶ added in v0.2.0
type ListFacilityTypologiesResponse struct { Audit *AuditData `json:"auditData"` Typologies []FacilityTypology `json:"facilityTypologies"` }
type ListHotelsInput ¶
type ListHotelsInput struct { // Filter for a specific hotel or list of hotels. Codes []int `url:"hotelCode"` // Filter to limit the results for an specific country. CountryCode string `url:"countryCode"` // Filter to limit the results for an specific destination. DestinationCode string `url:"destinationCode"` // Use "webOnly" to include in the response hotels sellable only to websites. // Use "notOnSale" to include in the response hotels without rates on sale. // By default non of them is included in the response. IncludeHotels IncludeHotels `url:"includeHotels"` // The list of fields to be received in the response. To retrieve all the fields use ‘all’. // If nothing is specified, all fields are returned. See the complete list of available fields in the response. Fields []string `url:"fields"` // The language code for the language in which you want the descriptions to be returned. // If language is not specified, English will be used as default language. Language string `url:"language"` // The number of the initial record to receive. If nothing is specified, 1 is the default value. From int `url:"from"` // The number of the final record to receive. If nothing is indicated, 100 is the default value. To int `url:"to"` // Defines if you want to receive the descriptions in English if the description // is not available in the language requested. UseSecondaryLanguage *bool `url:"useSecondaryLanguage"` // Specifying this parameter limits the results to those modified or added // after the date specified. The required format is YYYY-MM-DD. LastUpdateTime Datetime `url:"lastUpdateTime"` // Sending this parameter as true in the /hotels operations will only return // the hotels which possess at least one PMSRoomCode (useful when mapping against the original property codes). OnlyPMSRoomCode *bool `url:"PMSRoomCode"` }
func (*ListHotelsInput) Validate ¶
func (inp *ListHotelsInput) Validate() error
type ListHotelsResponse ¶
type ListImageTypesInput ¶ added in v0.2.0
type ListImageTypesInput struct {
ListInput
}
type ListImageTypesResponse ¶ added in v0.2.0
type ListInput ¶ added in v0.2.0
type ListInput struct { Fields []string `url:"fields,omitempty"` Codes []string `url:"codes,omitempty"` Language string `url:"language,omitempty"` From int `url:"from"` To int `url:"to"` UseSecondaryLanguage bool `url:"useSecondaryLanguage"` LastUpdateTime *Datetime `url:"lastUpdateTime,omitempty"` }
type ListIssuesInput ¶ added in v0.2.0
type ListIssuesInput struct {
ListInput
}
type ListIssuesResponse ¶ added in v0.2.0
type ListLanguagesInput ¶ added in v0.2.0
type ListLanguagesInput struct {
ListInput
}
type ListLanguagesResponse ¶ added in v0.2.0
type ListPromotionsInput ¶ added in v0.2.0
type ListPromotionsInput struct {
ListInput
}
type ListPromotionsResponse ¶ added in v0.2.0
type ListRateCommentsInput ¶ added in v0.2.0
type ListRateCommentsInput struct {
ListInput
}
type ListRateCommentsResponse ¶ added in v0.2.0
type ListRateCommentsResponse struct { Audit *AuditData `json:"auditData"` RateComments []RateComment `json:"rateComments"` }
type ListRoomsInput ¶ added in v0.2.0
type ListRoomsResponse ¶ added in v0.2.0
type ListSegmentsInput ¶ added in v0.2.0
type ListSegmentsInput struct {
ListInput
}
type ListSegmentsResponse ¶ added in v0.2.0
type ListTerminalsInput ¶ added in v0.2.0
type ListTerminalsInput struct {
ListInput
}
type ListTerminalsResponse ¶ added in v0.2.0
type ModificationPolicy ¶
type Options ¶
type Options struct { DefaultHeaders http.Header Limit *clientx.OptionRateLimit Retry *clientx.OptionRetry }
type PaymentCard ¶ added in v0.2.0
type PaymentData ¶ added in v0.2.0
type PaymentData struct { Card PaymentCard `json:"paymentCard"` Contact ContactData `json:"contactData"` Billing *BillingAddress `json:"billingAddress"` ThreeDS *ThreeDSData `json:"threeDsData"` WebPartner int `json:"webPartner,omitempty"` Device *Device `json:"device"` }
type PaymentType ¶
type PaymentType string
const ( PaymentTypeAtWeb PaymentType = "AT_WEB" PaymentTypeAtHotel PaymentType = "AT_HOTEL" )
func (PaymentType) String ¶ added in v0.2.0
func (p PaymentType) String() string
type ProcessTime ¶
func (*ProcessTime) UnmarshalJSON ¶
func (t *ProcessTime) UnmarshalJSON(data []byte) error
type Rate ¶
type Rate struct { RateKey string `json:"rateKey"` RateClass string `json:"rateClass"` RateType string `json:"rateType"` Net Amount `json:"net"` Selling Amount `json:"sellingRate"` Allotment int `json:"allotment"` RateCommentdsID string `json:"rateCommentsId,omitempty"` PaymentType PaymentType `json:"paymentType"` Packaging bool `json:"packaging"` BoardCode string `json:"boardCode"` BoardName string `json:"boardName"` CancellationPolicies []CancellationPolicy `json:"cancellationPolicies"` Rooms int `json:"rooms"` Adults int `json:"adults"` Children int `json:"children"` Offers []Offer `json:"offers,omitempty"` }
type RateComment ¶ added in v0.2.0
type RateComment struct { // Code of the incoming office of the hotel. Incoming int `json:"incoming"` Code string `json:"code"` HotelCode int `json:"hotel"` RateComments []RateCommentItem `json:"rateComments"` }
type RateCommentComment ¶ added in v0.2.0
type RateCommentItem ¶ added in v0.2.0
type RateCommentItem struct { Codes []int `json:"rateCodes"` Comments []RateCommentComment `json:"comments"` }
type Room ¶ added in v0.2.0
type Room struct { Code string `json:"code"` Type string `json:"type"` TypeDescription Content `json:"typeDescription"` Characteristic string `json:"characteristic"` CharacteristicDescription Content `json:"characteristicDescription"` Description string `json:"description"` MinPax int `json:"minPax"` MaxPax int `json:"maxPax"` MinAdults int `json:"minAdults"` MaxAdults int `json:"maxAdults"` MinChildren int `json:"minChildren"` MaxChildren int `json:"maxChildren"` }
type SimpleCode ¶ added in v0.2.0
type SimpleCode int
const ( SimpleCode1Star SimpleCode = iota + 1 SimpleCode2Stars SimpleCode3Stars SimpleCode4Stars SimpleCode5Stars )
func (SimpleCode) Int ¶ added in v0.2.0
func (sc SimpleCode) Int() int
type Stay ¶
type Stay struct { CheckIn string `json:"checkIn"` CheckOut string `json:"checkOut"` // Amount of days after and before the check-in to check availability, keeping the same stay duration. ShiftDays int `json:"shiftDays,omitempty"` // Defines if results are returned for shiftDays even if there's no results for the searched dates. AllowOnlyShift *bool `json:"allowOnlyShift,omitempty"` }
type ThreeDSData ¶ added in v0.2.0
type ThreeDSData struct { // Enum: "PROVIDED" "REQUESTED" // Use PROVIDED if you have your own integration with a PSP Option string `json:"option"` // This field contains the 3DS version used for authentication Version string `json:"version"` InfoProvided ThreeDSDataInfoProvided `json:"infoProvided"` }
type ThreeDSDataInfoProvided ¶ added in v0.2.0
type ThreeDSDataInfoProvided struct { // Transaction identifier resulting from authentication processing. ID string `json:"id"` // Cardholder Authentication Verification Value (CAVV) CAVV string `json:"cavv"` // Electronic Commerce Indicator (ECI). The ECI value is part of the two data elements // that indicate the transaction was processed electronically. ECI string `json:"eci"` }
type Timestamp ¶
Timestamp is time with "2006-01-02 15:04:05.000" layout.
func (Timestamp) MarshalJSON ¶
func (*Timestamp) UnmarshalJSON ¶
type TimestampTZ ¶
TimestampTZ is time with "2006-01-02T15:04:05Z07:00" layout.
func (TimestampTZ) MarshalJSON ¶
func (t TimestampTZ) MarshalJSON() ([]byte, error)
func (*TimestampTZ) UnmarshalJSON ¶
func (t *TimestampTZ) UnmarshalJSON(data []byte) error
type UpsellingRate ¶ added in v0.2.0
type UpsellingRate struct { Rate Discount string `json:"discount"` DiscountPercent string `json:"discountPCT"` HotelMandatory bool `json:"hotelMandatory"` Comission Amount `json:"comission"` ComissionVAT string `json:"comissionVAT"` ComissionPercent string `json:"comissionPCT"` Rateup Amount `json:"rateup"` Brand string `json:"brand"` Taxes []Tax `json:"taxes"` DailyRates []DailyRate `json:"dailyRates"` }
type ValidationError ¶
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
type Voucher ¶ added in v0.2.0
type Voucher struct { Language string `json:"language,omitempty"` Email Email `json:"email"` // Path of the picture you want to be featured in the header of the voucher as logo. // Accepted formats: PNG, JPG, GIF & BMP. Max size: 100px x 100px. // The filename part of the picture path cannot exceed 35 characters length. Logo string `json:"logo"` }