Class: VitableConnect::Resources::Organizations

Inherits:
Object
  • Object
show all
Defined in:
lib/vitable_connect/resources/organizations.rb,
sig/vitable_connect/resources/organizations.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Organizations

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

Parameters:



61
62
63
# File 'lib/vitable_connect/resources/organizations.rb', line 61

def initialize(client:)
  @client = client
end

Instance Method Details

#create(name:, type: nil, request_options: {}) ⇒ VitableConnect::Models::OrganizationCreateResponse

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

Onboards the authenticated user's partner Organization: creates the local Organization + the creator's admin membership atomically, then mirrors it to WorkOS (creates the WorkOS org and binds the creator as admin). 409 organization_already_exists when the user already has an organization (v0: one organization per user).

Parameters:

Returns:

See Also:



26
27
28
29
30
31
32
33
34
35
36
# File 'lib/vitable_connect/resources/organizations.rb', line 26

def create(params)
  parsed, options = VitableConnect::OrganizationCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/organizations",
    body: parsed,
    model: VitableConnect::Models::OrganizationCreateResponse,
    security: {},
    options: options
  )
end

#list(request_options: {}) ⇒ VitableConnect::Models::OrganizationListResponse

Lists the organizations the authenticated caller is an active member of (paginated). Returns an empty list when the caller belongs to no organizations.

Parameters:

Returns:

See Also:



48
49
50
51
52
53
54
55
56
# File 'lib/vitable_connect/resources/organizations.rb', line 48

def list(params = {})
  @client.request(
    method: :get,
    path: "v1/organizations",
    model: VitableConnect::Models::OrganizationListResponse,
    security: {},
    options: params[:request_options]
  )
end