Class: Moonbase::Resources::Views::Items

Inherits:
Object
  • Object
show all
Defined in:
lib/moonbase/resources/views/items.rb

Overview

Manage your collections and items

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Items

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Items.

Parameters:



44
45
46
# File 'lib/moonbase/resources/views/items.rb', line 44

def initialize(client:)
  @client = client
end

Instance Method Details

#list(id, after: nil, before: nil, limit: nil, request_options: {}) ⇒ Moonbase::Internal::CursorPage<Moonbase::Models::Item>

Some parameter documentations has been truncated, see Models::Views::ItemListParams for more details.

Returns a list of items that are part of the specified view.

Parameters:

  • id (String)

    The ID of the view.

  • after (String)

    When specified, returns results starting immediately after the item identified b

  • before (String)

    When specified, returns results starting immediately before the item identified

  • limit (Integer)

    Maximum number of items to return per page. Must be between 1 and 100. Defaults

  • request_options (Moonbase::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/moonbase/resources/views/items.rb', line 28

def list(id, params = {})
  parsed, options = Moonbase::Views::ItemListParams.dump_request(params)
  query = Moonbase::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["views/%1$s/items", id],
    query: query,
    page: Moonbase::Internal::CursorPage,
    model: Moonbase::Item,
    options: options
  )
end