Class: Moonbase::Resources::Tagsets

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

Overview

Manage your meetings, files, and notes

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Tagsets

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

Parameters:



141
142
143
# File 'lib/moonbase/resources/tagsets.rb', line 141

def initialize(client:)
  @client = client
end

Instance Method Details

#create(name:, description: nil, tags: nil, request_options: {}) ⇒ Moonbase::Models::Tagset

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

Create a new tagset.

Parameters:

  • name (String)

    The name of the tagset.

  • description (String)

    An optional description of the tagset’s purpose.

  • tags (Array<Moonbase::Models::TagsetCreateParams::Tag>)

    Optional list of tags to create with this tagset. Tags are ordered by their posi

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

Returns:

See Also:



25
26
27
28
29
30
31
32
33
34
# File 'lib/moonbase/resources/tagsets.rb', line 25

def create(params)
  parsed, options = Moonbase::TagsetCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "tagsets",
    body: parsed,
    model: Moonbase::Tagset,
    options: options
  )
end

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

Permanently deletes a tagset.

Parameters:

Returns:

  • (nil)

See Also:



129
130
131
132
133
134
135
136
# File 'lib/moonbase/resources/tagsets.rb', line 129

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

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

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

Returns a list of your tagsets.

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:



105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/moonbase/resources/tagsets.rb', line 105

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

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

Retrieves the details of an existing tagset.

Parameters:

  • id (String)

    The ID of the tagset to retrieve.

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

Returns:

See Also:



47
48
49
50
51
52
53
54
# File 'lib/moonbase/resources/tagsets.rb', line 47

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

#update(id, description: nil, name: nil, tags: nil, request_options: {}) ⇒ Moonbase::Models::Tagset

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

Updates an existing tagset.

Parameters:

  • id (String)

    The ID of the tagset to update.

  • description (String)

    An updated description of the tagset.

  • name (String)

    The new name of the tagset.

  • tags (Array<Moonbase::Models::TagsetUpdateParams::Tag>)

    Optional full list of tags for this tagset. If provided, tags are ordered by arr

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

Returns:

See Also:



76
77
78
79
80
81
82
83
84
85
# File 'lib/moonbase/resources/tagsets.rb', line 76

def update(id, params = {})
  parsed, options = Moonbase::TagsetUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["tagsets/%1$s", id],
    body: parsed,
    model: Moonbase::Tagset,
    options: options
  )
end