Module: Bugsnag::Api::Client::Organizations

Included in:
Bugsnag::Api::Client
Defined in:
lib/bugsnag/api/client/organizations.rb

Overview

Methods for the Organizations API

Instance Method Summary collapse

Instance Method Details

#create_organization(name, options = {}) ⇒ Sawyer::Resource

Create an Organization



13
14
15
# File 'lib/bugsnag/api/client/organizations.rb', line 13

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

#delete_organization(id, options = {}) ⇒ Object

Delete an Organization



39
40
41
# File 'lib/bugsnag/api/client/organizations.rb', line 39

def delete_organization(id, options = {})
  boolean_from_response :delete, "organizations/#{id}", options
end

#organization(id, options = {}) ⇒ Sawyer::Resource

View an Organization

Returns:

  • (Sawyer::Resource)

    Requested Organization

See Also:



21
22
23
# File 'lib/bugsnag/api/client/organizations.rb', line 21

def organization(id, options = {})
  get "organizations/#{id}", options
end

#update_organization(id, name, auto_upgrade, options = {}) ⇒ Sawyer::Resource

Update an Organization

Parameters:

  • invoice_address (Hash)

    a customizable set of options

  • billing_emails (Hash)

    a customizable set of options

Returns:

  • (Sawyer::Resource)

    Updated Organization

See Also:



31
32
33
# File 'lib/bugsnag/api/client/organizations.rb', line 31

def update_organization(id, name, auto_upgrade, options = {})
  patch "organizations/#{id}", options.merge({:name => name, :auto_upgrade => auto_upgrade})
end