module BookingSync::API::Client::Applications

Public Instance Methods

application(application) click to toggle source

Get a single application

@param application [BookingSync::API::Resource|Integer] application or ID

of the application.

@return [BookingSync::API::Resource] @see developers.bookingsync.com/reference/endpoints/applications/#get-a-single-application

# File lib/bookingsync/api/client/applications.rb, line 25
def application(application)
  get("applications/#{application}").pop
end
applications(options = {}, &block) click to toggle source

List applications

Returns all applications supported in BookingSync. @param options [Hash] A customizable set of options. @option options [Array] fields: List of fields to be fetched. @return [Array<BookingSync::API::Resource>] Array of applications.

@example Get the list of applications for the current account

applications = @api.applications
applications.first.title # => "Internet"

@see developers.bookingsync.com/reference/endpoints/applications/#list-applications

# File lib/bookingsync/api/client/applications.rb, line 15
def applications(options = {}, &block)
  paginate :applications, options, &block
end
edit_application(application, options = {}) click to toggle source

Edit an application

@param application [BookingSync::API::Resource|Integer] application or ID of the application to be updated @param options [Hash] application attributes to be updated @return [BookingSync::API::Resource] Updated application on success, exception is raised otherwise @example

application = @api.applications.first
@api.edit_application(application, { default_price_increase: 3 })
# File lib/bookingsync/api/client/applications.rb, line 38
def edit_application(application, options = {})
  put("applications/#{application}", applications: [options]).pop
end