Sha256: 0dfb5e9e33f1032413cbb980ad8e8efe108fa4fbd612d15c03a62a6a740b0550

Contents?: true

Size: 919 Bytes

Versions: 2

Compression:

Stored size: 919 Bytes

Contents

module Smartsheet
  class Search
    attr_reader :client
    private :client

    def initialize(client)
      @client = client
    end

    def search_all(query:, params: {}, header_overrides: {})
      endpoint_spec = Smartsheet::API::EndpointSpec.new(:get, ['search'])
      request_spec = Smartsheet::API::RequestSpec.new(
          header_overrides: header_overrides,
          params: params.merge({query: query})
      )
      client.make_request(endpoint_spec, request_spec)
    end

    def search_sheet(sheet_id:, query:, params: {}, header_overrides: {})
      endpoint_spec = Smartsheet::API::EndpointSpec.new(:get, ['search', 'sheets', :sheet_id])
      request_spec = Smartsheet::API::RequestSpec.new(
          header_overrides: header_overrides,
          params: params.merge({query: query}),
          sheet_id: sheet_id
      )
      client.make_request(endpoint_spec, request_spec)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
smartsheet-1.0.0.beta.2 lib/smartsheet/endpoints/search/search.rb
smartsheet-1.0.0.beta.0 lib/smartsheet/endpoints/search/search.rb