Travel.Stays.Brands (travel v0.2.0)

Copy Markdown View Source

List and get hotel brands.

Endpoints

  • GET /stays/brands - List all brands
  • GET /stays/brands/{id} - Get a brand

Examples

# List all brands
{:ok, response} = Travel.Stays.Brands.list()

# Get a brand by ID
{:ok, response} = Travel.Stays.Brands.get("brd_123")

@link https://duffel.com/docs/api/stays/brands

Summary

Functions

Get a brand by ID.

List all accommodation brands.

Functions

get(brand_id)

@spec get(String.t()) ::
  {:ok, Travel.Types.DuffelResponse.t()} | {:error, Travel.Error.t() | term()}

Get a brand by ID.

Parameters

  • brand_id - The brand ID

Returns

  • {:ok, %Travel.Types.DuffelResponse{data: %Types.StaysAccommodationBrand{}}} on success
  • {:error, %Travel.Error{}} on failure

list()

@spec list() ::
  {:ok, Travel.Types.DuffelResponse.t()} | {:error, Travel.Error.t() | term()}

List all accommodation brands.

Returns

  • {:ok, %Travel.Types.DuffelResponse{data: [%Types.StaysAccommodationBrand{}]}} on success
  • {:error, %Travel.Error{}} on failure