Class: Moonbase::Resources::Inboxes

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

Overview

Manage your inboxes, conversations, and messages

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Inboxes

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 Inboxes.

Parameters:



61
62
63
# File 'lib/moonbase/resources/inboxes.rb', line 61

def initialize(client:)
  @client = client
end

Instance Method Details

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

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

Returns a list of shared inboxes.

Parameters:

  • 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:



45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/moonbase/resources/inboxes.rb', line 45

def list(params = {})
  parsed, options = Moonbase::InboxListParams.dump_request(params)
  query = Moonbase::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "inboxes",
    query: query,
    page: Moonbase::Internal::CursorPage,
    model: Moonbase::Inbox,
    options: options
  )
end

#retrieve(id, request_options: {}) ⇒ Moonbase::Models::Inbox

Retrieves the details of an existing inbox.

Parameters:

  • id (String)

    The ID of the Inbox to retrieve.

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

Returns:

See Also:



18
19
20
21
22
23
24
25
# File 'lib/moonbase/resources/inboxes.rb', line 18

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["inboxes/%1$s", id],
    model: Moonbase::Inbox,
    options: params[:request_options]
  )
end