Module: Tacokit::Client::Organizations

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

Overview

Methods for the Organizations API

Instance Method Summary collapse

Instance Method Details

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

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

#delete_organization(org_id) ⇒ Object

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

#organization(org_id, options = nil) ⇒ Tacokit::Resource

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

#organization_resource(org_id, resource, *paths) ⇒ Object



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

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

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