Documentation
¶
Index ¶
- type ApiRequest
- type Client
- func (c *Client) CountAccommodations() (int, error)
- func (c *Client) CountAccommodationsWithFilter(filter map[string]string) (int, error)
- func (c *Client) CountReferences() (int, error)
- func (c *Client) GetAccommodation(accoid string) (obtypes.AccommodationReference, error)
- func (c *Client) GetAccommodations(queryParams map[string]string) ([]obtypes.AccommodationReference, error)
- func (c *Client) GetAllAccommodations(queryParams map[string]string) ([]obtypes.AccommodationReference, []error)
- func (c *Client) GetAllPlaces() ([]obtypes.Place, error)
- func (c *Client) GetAllProviders(engine *string) (obtypes.Providers, error)
- func (c *Client) GetCitiFacts(provider string) ([]obtypes.CitiFact, error)
- func (c *Client) GetMinimalReferences(queryParams map[string]string) ([]obtypes.MinimalReference, error)
- func (c *Client) GetProvider(providerID string) (*obtypes.Provider, error)
- func (c *Client) GetProviders(engine *string) (obtypes.Providers, error)
- func (c *Client) PostAcco(acco obtypes.AccommodationReference) (string, error)
- func (c *Client) PostAccoForGroup(acco obtypes.AccommodationReference, group string) (string, error)
- func (c *Client) PostBooking(b obtypes.Booking) (string, error)
- func (c *Client) PostOccupanciesConcurrently(jobconfig JobConfig, occupancies []obtypes.PostableOccupancies) []error
- func (c *Client) PostOccupancy(occupancy obtypes.PostableOccupanciesExternal) (string, error)
- func (c *Client) PostProviderFeatures(providerID string, payload PostProviderFeaturesPayload) error
- func (c *Client) PostProviderFeaturesForGroup(group, providerID string, payload PostProviderFeaturesPayload) error
- func (c *Client) PutOccupancy(occupancy obtypes.PostableOccupancies) (string, error)
- type Job
- type JobAllAccos
- type JobConfig
- type JobConfigOccupancy
- type JobOccupancy
- type JobResult
- type JobResultAllAccos
- type JobResultOccupancy
- type PostProviderFeaturesPayload
- type ProviderFeature
- type RequestResult
- type RequestResultOccupancy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiRequest ¶
type Client ¶
func NewClient ¶
NewClient returns a Client instance with the `apikey` set. It is using the endpoints specified in the environment variables `OB_API_URL` and `OB_POST_URL`. If unspecified, the default endpoints are used.
func NewClientWithURL ¶
NewClient returns a Client instance with the `apikey` set and endpoints defined explicitly.
func (*Client) CountAccommodations ¶
CountAccommodations retrieves the total number of accommodations.
func (*Client) CountAccommodationsWithFilter ¶
CountAccommodationsWithFilter retrieves only the number of accommodations matching `filter` parameters.
func (*Client) CountReferences ¶
CountReferences retrieves a number of references for a group.
func (*Client) GetAccommodation ¶
func (c *Client) GetAccommodation(accoid string) (obtypes.AccommodationReference, error)
GetAccommodation retrieves a single accommodation.
func (*Client) GetAccommodations ¶
func (c *Client) GetAccommodations(queryParams map[string]string) ([]obtypes.AccommodationReference, error)
GetAccommodations queries for accommodation with search parameters. It only retrieves a single result set as specified with the `limit` and `skip` parameters.
func (*Client) GetAllAccommodations ¶
func (c *Client) GetAllAccommodations(queryParams map[string]string) ([]obtypes.AccommodationReference, []error)
GetAllAccommodations queries for accommodation with search parameters. It automatically pages through the results until all accommodations are fetched.
func (*Client) GetAllPlaces ¶
GetAllPlaces retrieves all places.
func (*Client) GetAllProviders ¶
GetAllProviders retrieves either all providers when `engine` is nil, or all providers for multiple group. A super key is necessary for this endpoint.
func (*Client) GetCitiFacts ¶
GetCitiFacts retrieves specific information of CITI references.
func (*Client) GetMinimalReferences ¶
func (c *Client) GetMinimalReferences(queryParams map[string]string) ([]obtypes.MinimalReference, error)
GetMinimalReferences retrieves a minimal version of references matching `queryParams`. This is used by other importers to get external IDs etc.
func (*Client) GetProvider ¶
GetProvider retrieves a single provider by ID.
func (*Client) GetProviders ¶
GetProviders retrieves either all providers when `engine` is nil, or all providers.
func (*Client) PostAcco ¶
func (c *Client) PostAcco(acco obtypes.AccommodationReference) (string, error)
PostAcco posts a single reference.
func (*Client) PostAccoForGroup ¶
func (c *Client) PostAccoForGroup(acco obtypes.AccommodationReference, group string) (string, error)
PostAccoForGroup allows posting with a super key for any group.
func (*Client) PostBooking ¶
PostBooking posts a single booking instance.
func (*Client) PostOccupanciesConcurrently ¶
func (c *Client) PostOccupanciesConcurrently(jobconfig JobConfig, occupancies []obtypes.PostableOccupancies) []error
PostOccupanciesConcurrently is like `PutOccupancy` but processes multiple calendars concurrently.
func (*Client) PostOccupancy ¶
func (c *Client) PostOccupancy(occupancy obtypes.PostableOccupanciesExternal) (string, error)
PostOccupancy posts an availability calendar for a reference, but by specifying the `provider_id` and `external_id`.
func (*Client) PostProviderFeatures ¶
func (c *Client) PostProviderFeatures(providerID string, payload PostProviderFeaturesPayload) error
PostProviderFeatures posts provider features for a single provider.
func (*Client) PostProviderFeaturesForGroup ¶
func (c *Client) PostProviderFeaturesForGroup(group, providerID string, payload PostProviderFeaturesPayload) error
PostProviderFeaturesForGroup is like PostProviderFeatures but allows to post for any group. A super key is necessary for this endpoint.
func (*Client) PutOccupancy ¶
func (c *Client) PutOccupancy(occupancy obtypes.PostableOccupancies) (string, error)
PutOccupancy posts an availability calendar for a reference using the reference ID.
type Job ¶
type Job struct { Acco obtypes.AccommodationReference Client *Client // contains filtered or unexported fields }
type JobAllAccos ¶
type JobConfigOccupancy ¶
type JobOccupancy ¶
type JobOccupancy struct { Occupancy obtypes.PostableOccupancies Client *Client // contains filtered or unexported fields }
type JobResult ¶
type JobResult struct { Jobid int Error error Response string Request RequestResult }
type JobResultAllAccos ¶
type JobResultAllAccos struct { Jobid int Error error Accos []obtypes.AccommodationReference }
type JobResultOccupancy ¶
type JobResultOccupancy struct { Jobid int Error error Response string Request RequestResult }
type PostProviderFeaturesPayload ¶
type PostProviderFeaturesPayload []ProviderFeature
func (*PostProviderFeaturesPayload) AddDistinct ¶
func (s *PostProviderFeaturesPayload) AddDistinct(pf ProviderFeature)
AddDistinct adds the feature only if it doesn't already exist
func (*PostProviderFeaturesPayload) HasKey ¶
func (s *PostProviderFeaturesPayload) HasKey(key string) bool
func (*PostProviderFeaturesPayload) UpdateTranslation ¶
func (s *PostProviderFeaturesPayload) UpdateTranslation(id, lang, value string)
UpdateTranslation updates the translation of a feature if it exists otherwise discarded