Documentation
¶
Index ¶
- Constants
- Variables
- func ValidateHotelCode(hotelCode string) error
- func ValidateLanguageUniqueness(descs []Description) error
- func ValidateNonNilString(s *string) error
- func ValidateOverlaps[T version.DateRangeProvider](ranges []T) error
- func ValidateString(s string) error
- type Description
- type Error
- func ErrDateRangeOverlaps(range1, range2 timex.DateRange) *Error
- func ErrDuplicateBaseByGuestAmt(numberOfGuests int) *Error
- func ErrInvCodeNotFound(invCode string) *Error
- func ErrInvTypeCodeNotFound(invTypeCode string) *Error
- func ErrInvalidBookingLimit(n int) *Error
- func ErrInvalidInvType(invType string) *Error
- func ErrInvalidPictureCategoryCode(code int) *Error
- func ErrInvalidRoomAmenityType(code int) *Error
- func ErrInvalidRoomClassificationCode(roomClassificationCode int) *Error
- func ErrInvalidRoomType(roomType int) *Error
- func ErrInvalidUniqueID(status string, uidType int) *Error
- func ErrMaxAgeOutOfRange(childMaxAge, ratePlanAdultMinAge int) *Error
- func ErrMinAgeOutOfRange(childMinAge, ratePlanChildMinAge int) *Error
- func ErrMinStayArrivalGratherThanMaxStayArrival(min, max int) *Error
- func ErrMinStayGratherThanMaxStay(min, max int) *Error
- func ErrMissingBaseByGuestAmtWithStdOccupancy(std int) *Error
- func ErrRatePlanNotFound(code string) *Error
- type ErrorWarningType
- type Response
- type Status
- type Success
- type TextFormat
- type URL
- type Validatable
- type Warning
Constants ¶
View Source
const ( TextFormatPlainText = "PlainText" TextFormatHTML = "HTML" )
Variables ¶
View Source
var ( ErrMissingHotelCode = newMissingAttributeError("HotelCode") ErrDeltasNotSupported = newError("deltas not supported") ErrMissingInvTypeCode = newMissingAttributeError("InvTypeCode") ErrMissingInvCode = newMissingAttributeError("InvCode") ErrBookingThresholdNotSupported = newError("room status free but not bookable (booking threshold) not supported") ErrBookingThresholdGreaterThanBookingLimit = newError("attribute BookingThreshold must be ≤ attribute BookingLimit") ErrMissingCode = newMissingAttributeError("Code") ErrChildOccupancyNotSupported = newError("child occupancy not supported") ErrMaxChildOccGreaterThanMaxOcc = newError("child occupancy must be ≤ max occupancy") ErrStdOccLowerThanMinOcc = newError("standard occupancy must be ≥ min occupancy") ErrMaxOccLowerThanStdOcc = newError("max occupancy must be ≥ standard occupancy") ErrMissingLongName = newMissingElementError("MultimediaDescription with attribute InfoCode = 25 (Long name)") ErrDuplicateLanguage = newError("duplicate language found for element Description") ErrRoomsNotSupported = newError("rooms not supported") ErrMissingRoomID = newMissingAttributeError("RoomID") ErrMissingID = newMissingAttributeError("UniqueID.ID") ErrMissingRoomStay = newMissingElementError("RoomStay") ErrDuplicateAlternativeRoomStay = newError("at most one alternative room stay is allowed") ErrUnexpectedAlternativeRoomStay = newError("alternative room stay is not allowed") ErrMissingRoomType = newMissingElementError("RoomType") ErrUnexpectedRoomType = newUnexpectedElementError("RoomType") ErrMissingRoomTypeCode = newMissingAttributeError("RoomTypeCode") ErrMissingRatePlan = newMissingElementError("RatePlan") ErrUnexpectedRatePlan = newUnexpectedElementError("RatePlan") ErrMissingRatePlanCode = newMissingAttributeError("RatePlanCode") ErrInvalidPercent = newError("percent must be ≤ 100") ErrMissingMealsIncluded = newMissingElementError("MealsIncluded") ErrMissingGuestCount = newMissingElementError("GuestCount") ErrUnexpectedGuestCounts = newUnexpectedElementError("GuestCounts") ErrDuplicateAdultGuestCount = newError("duplicate element GuestCount for adults") ErrMissingStart = newMissingAttributeError("Start") ErrMissingEnd = newMissingAttributeError("End") ErrMissingTotal = newMissingElementError("Total") ErrUnexpectedTotal = newUnexpectedElementError("Total") ErrStartAfterEnd = newError("start must be ≤ end") ErrMissingDuration = newMissingAttributeError("Duration") ErrUnexpectedStartDateWindow = newUnexpectedElementError("StartDateWindow") ErrUnexpectedDuration = newUnexpectedAttributeError("Duration") ErrMissingTimeSpan = newMissingElementError("TimeSpan") ErrMissingStartDateWindow = newMissingElementError("StartDateWindow") ErrEarliestDateAfterLatestDate = newError("earliest date must be ≤ latest date") ErrDurationOutOfRange = newError("duration exceeds the allowed date range") ErrInvalidNamePrefix = newError("invalid value for attribute NamePrefix") ErrMissingGivenName = newMissingAttributeError("GivenName") ErrMissingSurname = newMissingAttributeError("Surname") ErrInvalidNameTitle = newError("invalid value for attribute NameTitle") ErrInvalidAddressLine = newError("invalid value for attribute AddressLine") ErrInvalidCityName = newError("invalid value for attribute CityName") ErrInvalidPostalCode = newError("invalid value for attribute PostalCode") ErrInvalidCountryNameCode = newError("invalid value for attribute CountryName.Code") ErrInvalidListItem = newError("invalid value for element ListItem") ErrInvalidCommentText = newError("invalid value for element Comment.Text") ErrInvalidPenaltyDescriptionText = newError("invalid value for attribute element PenaltyDescription.Text") ErrInvalidResIDValue = newError("invalid value for attribute ResIDValue") ErrInvalidResIDSource = newError("invalid value for attribute ResIDSource") ErrInvalidResIDSourceContext = newError("invalid value for attribute ResIDSourceContext") ErrInvalidCompanyNameCode = newError("invalid value for attribute CompanyName.Code") ErrInvalidCompanyNameValue = newError("invalid value for element CompanyName") ErrInvalidEmail = newError("invalid value for element Email") ErrMissingCurrencyCode = newMissingAttributeError("CurrencyCode") ErrRatePlanJoinNotSupported = newError("rate plan join not supported") ErrMissingOfferRule = newMissingElementError("OfferRule") ErrOfferRuleBookingOffsetNotSupported = newError("offer rule booking offset not supported") ErrOfferRuleDOWLOSNotSupported = newError("offer rule days of week and lengths of stay not supported") ErrStayThroughNotAllowedInOfferRule = newError("invalid value for attribute MinMaxMessageType inside element OfferRule") ErrMissingAdultOccupancy = newMissingElementError("Occupancy with attribute AgeQualifyingCode = 10") ErrInvalidMinOccupancy = newError("min occupancy must be ≤ 99") ErrInvalidMaxOccupancy = newError("max occupancy must be ≤ 99") ErrDuplicateChildOccupancy = newError("duplicate element Occupancy with attribute AgeQualifyingCode = 8") ErrDuplicateFreeNightOffer = newError("duplicate free night offer") ErrDuplicateFamilyOffer = newError("duplicate family offer") ErrFreeNightOfferNotSupported = newError("free night offer not supported") ErrMissingNightsRequired = newMissingAttributeError("NightsRequired") ErrMissingNightsDiscounted = newMissingAttributeError("NightsDiscounted") ErrInvalidDiscountPattern = newError("invalid value for attribute DiscountPattern") ErrFamilyOfferNotSupported = newError("free night offer not supported") ErrInvalidGuestAgeQualifyngCode = newError("invalid value for attribute Guest.AgeQualifyingCode") ErrRoomTypeBookingRulesNotSupported = newError("room type booking rules not supported") ErrArrivalDOWNotSupported = newError("arrival days of week not supported") ErrDepartureDOWNotSupported = newError("departure days of week not supported") ErrMissingStaticRate = newMissingElementError("static Rate") ErrInvalidRateTimeUnit = newError("invalid value for attribute RateTimeUnit") ErrMissingBaseByGuestAmt = newMissingElementError("BaseByGuestAmt") ErrMissingUnitMultiplier = newMissingAttributeError("UnitMultiplier") ErrMissingNumberOfGuests = newMissingAttributeError("NumberOfGuests") ErrMissingAgeQualifyingCode = newMissingAttributeError("AgeQualifyingCode") ErrMissingAmountAfterTax = newMissingAttributeError("AmountAfterTax") ErrMissingAmount = newMissingAttributeError("Amount") ErrDuplicateAdditionalGuestAmountAdult = newError("duplicate element AdditionalGuestAmount with attribute AgeQualifyingCode = 10") ErrChildrenNotAllowed = newError("children not allowed") ErrMissingMinAge = newMissingAttributeError("MinAge") ErrMinAgeGreaterThanOrEqualsThanMaxAge = newError("attribute MinAge must be < attribute MaxAge") ErrSupplementsNotSupported = newError("supplements not supported") ErrMissingAddToBasicRateIndicator = newMissingAttributeError("AddToBasicRateIndicator") ErrMissingMandatoryIndicator = newMissingAttributeError("MandatoryIndicator") ErrMissingChargeTypeCode = newMissingAttributeError("ChargeTypeCode") ErrInvalidDOWString = newError("invalid value for attribute InvCode with attribute InvType = ALPINEBITSDOW") ErrUnexpectedOffers = newUnexpectedElementError("Offers") ErrUnexpectedDescription = newUnexpectedElementError("Description") ErrUnexpectedBookingRules = newUnexpectedElementError("BookingRules") ErrUnexpectedRates = newUnexpectedElementError("Rates") ErrUnexpectedSupplements = newUnexpectedElementError("Supplements") ErrUnexpectedGuest = newUnexpectedElementError("Guest") ErrUnexpectedNightsRequired = newUnexpectedAttributeError("NightsRequired") ErrUnexpectedNightsDiscounted = newUnexpectedAttributeError("NightsDiscounted") ErrUnexpectedDiscountPattern = newUnexpectedAttributeError("DiscountPattern") ErrUnexpectedInvTypeCode = newUnexpectedAttributeError("InvTypeCode") ErrUnexpectedStart = newUnexpectedAttributeError("Start") ErrUnexpectedEnd = newUnexpectedAttributeError("End") ErrUnexpectedNumberOfGuests = newUnexpectedAttributeError("NumberOfGuests") ErrUnexpectedAgeQualifyingCode = newUnexpectedAttributeError("AgeQualifyingCode") ErrUnexpectedAmountAfterTax = newUnexpectedAttributeError("AmountAfterTax") ErrUnexpectedBaseByGuestAmt = newError("static rates can contain only one element BaseByGuestAmt") ErrUnexpectedAdditionalGuestAmounts = newUnexpectedElementError("AdditionalGuestAmounts") ErrUnexpectedRateTimeUnit = newUnexpectedAttributeError("RateTimeUnit") ErrUnexpectedUnitMultiplier = newUnexpectedAttributeError("UnitMultiplier") ErrUnexpectedMealsIncluded = newUnexpectedElementError("MealsIncluded") ErrUnexpectedType = newUnexpectedAttributeError("Type") ErrUnexpectedAmount = newUnexpectedAttributeError("Amount") ErrUnexpectedAddToBasicRateIndicator = newUnexpectedAttributeError("AddToBasicRateIndicator") ErrUnexpectedMandatoryIndicator = newUnexpectedAttributeError("MandatoryIndicator") ErrUnexpectedChargeTypeCode = newUnexpectedAttributeError("ChargeTypeCode") )
Functions ¶
func ValidateHotelCode ¶
func ValidateLanguageUniqueness ¶
func ValidateLanguageUniqueness(descs []Description) error
func ValidateNonNilString ¶
func ValidateOverlaps ¶
func ValidateOverlaps[T version.DateRangeProvider](ranges []T) error
func ValidateString ¶
Types ¶
type Description ¶
type Description struct { TextFormat TextFormat `xml:"TextFormat,attr"` Language string `xml:"Language,attr"` Value string `xml:",innerxml"` }
type Error ¶
type Error struct { Type ErrorWarningType `xml:"Type,attr"` Code int `xml:"Code,attr,omitempty"` Status Status `xml:"Status,attr,omitempty"` Value string `xml:",innerxml"` }
func ErrDateRangeOverlaps ¶
func ErrInvCodeNotFound ¶
func ErrInvTypeCodeNotFound ¶
func ErrInvalidBookingLimit ¶
func ErrInvalidInvType ¶
func ErrInvalidRoomType ¶
func ErrInvalidUniqueID ¶
func ErrMaxAgeOutOfRange ¶
func ErrMinAgeOutOfRange ¶
func ErrRatePlanNotFound ¶
type ErrorWarningType ¶
type ErrorWarningType int
const ( ErrorWarningTypeAdvisory ErrorWarningType = 11 ErrorWarningTypeApplicationError ErrorWarningType = 13 )
type Response ¶
type Response struct { Success *Success `xml:"Success"` Warnings *[]Warning `xml:"Warnings>Warning"` Errors *[]Error `xml:"Errors>Error"` }
func (*Response) AppendError ¶
func (*Response) AppendWarning ¶
func (*Response) SetSuccess ¶
func (r *Response) SetSuccess()
type TextFormat ¶
type TextFormat string
type Validatable ¶
Click to show internal directories.
Click to hide internal directories.