Class: Moonbase::Resources::Notes

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

Overview

Manage your meetings, files, and notes

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Notes

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

Parameters:



128
129
130
# File 'lib/moonbase/resources/notes.rb', line 128

def initialize(client:)
  @client = client
end

Instance Method Details

#create(body:, associations: nil, request_options: {}) ⇒ Moonbase::Models::Note

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

Create a new note.

Parameters:

Returns:

See Also:



23
24
25
26
# File 'lib/moonbase/resources/notes.rb', line 23

def create(params)
  parsed, options = Moonbase::NoteCreateParams.dump_request(params)
  @client.request(method: :post, path: "notes", body: parsed, model: Moonbase::Note, options: options)
end

#delete(id, request_options: {}) ⇒ nil

Permanently deletes a note.

Parameters:

Returns:

  • (nil)

See Also:



116
117
118
119
120
121
122
123
# File 'lib/moonbase/resources/notes.rb', line 116

def delete(id, params = {})
  @client.request(
    method: :delete,
    path: ["notes/%1$s", id],
    model: NilClass,
    options: params[:request_options]
  )
end

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

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

Returns a list of your notes.

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:



92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/moonbase/resources/notes.rb', line 92

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

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

Retrieves the details of an existing note.

Parameters:

Returns:

See Also:



39
40
41
42
43
44
45
46
# File 'lib/moonbase/resources/notes.rb', line 39

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

#update(id, body:, lock_version:, request_options: {}) ⇒ Moonbase::Models::Note

Update an existing note.

Parameters:

  • id (String)

    The ID of the note to update.

  • body (Moonbase::Models::FormattedText)

    The main content of the note.

  • lock_version (Integer)

    The current lock version of the note for optimistic concurrency control.

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

Returns:

See Also:



63
64
65
66
67
68
69
70
71
72
# File 'lib/moonbase/resources/notes.rb', line 63

def update(id, params)
  parsed, options = Moonbase::NoteUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["notes/%1$s", id],
    body: parsed,
    model: Moonbase::Note,
    options: options
  )
end