Class: Openlayer::Resources::Workspaces

Inherits:
Object
  • Object
show all
Defined in:
lib/openlayer/resources/workspaces.rb,
lib/openlayer/resources/workspaces/invites.rb,
lib/openlayer/resources/workspaces/api_keys.rb

Defined Under Namespace

Classes: APIKeys, Invites

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Workspaces

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

Parameters:



63
64
65
66
67
# File 'lib/openlayer/resources/workspaces.rb', line 63

def initialize(client:)
  @client = client
  @invites = Openlayer::Resources::Workspaces::Invites.new(client: client)
  @api_keys = Openlayer::Resources::Workspaces::APIKeys.new(client: client)
end

Instance Attribute Details

#api_keysOpenlayer::Resources::Workspaces::APIKeys (readonly)



10
11
12
# File 'lib/openlayer/resources/workspaces.rb', line 10

def api_keys
  @api_keys
end

#invitesOpenlayer::Resources::Workspaces::Invites (readonly)



7
8
9
# File 'lib/openlayer/resources/workspaces.rb', line 7

def invites
  @invites
end

Instance Method Details

#retrieve(workspace_id, request_options: {}) ⇒ Openlayer::Models::WorkspaceRetrieveResponse

Retrieve a workspace by its ID.

Parameters:

Returns:

See Also:



23
24
25
26
27
28
29
30
# File 'lib/openlayer/resources/workspaces.rb', line 23

def retrieve(workspace_id, params = {})
  @client.request(
    method: :get,
    path: ["workspaces/%1$s", workspace_id],
    model: Openlayer::Models::WorkspaceRetrieveResponse,
    options: params[:request_options]
  )
end

#update(workspace_id, invite_code: nil, name: nil, slug: nil, request_options: {}) ⇒ Openlayer::Models::WorkspaceUpdateResponse

Update a workspace.

Parameters:

  • workspace_id (String)

    The workspace id.

  • invite_code (String)

    The workspace invite code.

  • name (String)

    The workspace name.

  • slug (String)

    The workspace slug.

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

Returns:

See Also:



49
50
51
52
53
54
55
56
57
58
# File 'lib/openlayer/resources/workspaces.rb', line 49

def update(workspace_id, params = {})
  parsed, options = Openlayer::WorkspaceUpdateParams.dump_request(params)
  @client.request(
    method: :put,
    path: ["workspaces/%1$s", workspace_id],
    body: parsed,
    model: Openlayer::Models::WorkspaceUpdateResponse,
    options: options
  )
end