Module: Tacokit::Client::Organizations

Included in:
Tacokit::Client
Defined in:
lib/tacokit/client/organizations.rb

Overview

Methods for the Organizations API

See Also:

Instance Method Summary (collapse)

Instance Method Details

- (Tacokit::Resource) create_organization(display_name, options = {})

Create an organization

Parameters:

  • display_name (String)

    a name for the organization

  • options (Hash) (defaults to: {})

    options to create the organization with

Returns:

See Also:



29
30
31
# File 'lib/tacokit/client/organizations.rb', line 29

def create_organization(display_name, options = {})
  post "organizations", options.merge(display_name: display_name)
end

- (Object) delete_organization(org_id)

Delete an organization

Parameters:

  • org_id (String)

    the organization identifier

See Also:



36
37
38
# File 'lib/tacokit/client/organizations.rb', line 36

def delete_organization(org_id)
  delete organization_path(org_id)
end

- (Tacokit::Resource) organization(org_id, options = nil)

Retrieve an organization

Parameters:

  • org_id (String)

    the organization identifier

  • options (Hash) (defaults to: nil)

    options to fetch the organization with

Returns:

See Also:



11
12
13
# File 'lib/tacokit/client/organizations.rb', line 11

def organization(org_id, options = nil)
  get organization_path(org_id), options
end

- (Object) organization_resource(org_id, resource, *paths)



41
42
43
44
# File 'lib/tacokit/client/organizations.rb', line 41

def organization_resource(org_id, resource, *paths)
  paths, options = extract_options(camp(resource), *paths)
  get organization_path(org_id, *paths), options
end

- (Tacokit::Resource) update_organization(org_id, options = {})

Update an organization

Parameters:

  • org_id (String)

    the organization identifier

  • options (Hash) (defaults to: {})

    options to update the organization with

Returns:

See Also:



20
21
22
# File 'lib/tacokit/client/organizations.rb', line 20

def update_organization(org_id, options = {})
  put organization_path(org_id), options
end