def paginate(path, options = {}, &block)
      instrument("paginate.bookingsync_api", path: path) do
        request_settings = {
          auto_paginate: options.delete(:auto_paginate),
          request_method: options.delete(:request_method) || :get
        }

        if block_given?
          data = fetch_with_block(path, options, request_settings, &block)
        else
          data = fetch_with_paginate(path, options, request_settings)
        end

        data
      end
    end
def paginate(path, options = {}, &block)
      instrument("paginate.bookingsync_api", path: path) do
        request_settings = {
          auto_paginate: options.delete(:auto_paginate),
          request_method: options.delete(:request_method) || :get
        }

        if block_given?
          data = fetch_with_block(path, options, request_settings, &block)
        else
          data = fetch_with_paginate(path, options, request_settings)
        end

        data
      end
    end
Make a HTTP GET or POST request to a path with pagination support.

 @param options [Hash]
 @option options [Integer] per_page: Number of resources per page
 @option options [Integer] page: Number of page to return
 @option options [Boolean] auto_paginate: If true, all resources will
   be returned. It makes multiple requestes underneath and joins the results.

 @yieldreturn [Array<BookingSync::API::Resource>] Batch of resources
 @return [Array<BookingSync::API::Resource>] Batch of resources