Sha256: 22f9eca0497608f4178411dd14fbe9bd96b250533c4667de60ca06193e9c73d2

Contents?: true

Size: 1.7 KB

Versions: 3

Compression:

Stored size: 1.7 KB

Contents

module Bugsnag
  module Api
    class Client

      # Methods for the Organizations API
      #
      # @see http://docs.bugsnagapiv2.apiary.io/#reference/organizations
      module Organizations
        # Create an Organization
        #
        # @return [Sawyer::Resource] New Organization
        # @see http://docs.bugsnagapiv2.apiary.io/#reference/organizations/organizations/create-an-organization
        def create_organization(name, options = {})
          post "organizations", options.merge({:name => name})
        end

        # View an Organization
        #
        # @return [Sawyer::Resource] Requested Organization
        # @see http://docs.bugsnagapiv2.apiary.io/#reference/organizations/organizations/view-an-organization
        def organization(id, options = {})
          get "organizations/#{id}", options
        end

        # Update an Organization
        #
        # @option invoice_address [String] Additional information to print on your invoice
        # @option billing_emails [Array<String>] List of billing emails
        # @return [Sawyer::Resource] Updated Organization
        # @see http://docs.bugsnagapiv2.apiary.io/#reference/organizations/organizations/update-an-organization
        def update_organization(id, name, auto_upgrade, options = {})
          patch "organizations/#{id}", options.merge({:name => name, :auto_upgrade => auto_upgrade})
        end

        # Delete an Organization
        #
        # @return 
        # @see http://docs.bugsnagapiv2.apiary.io/#reference/organizations/organizations/delete-an-organization
        def delete_organization(id, options = {})
          boolean_from_response :delete, "organizations/#{id}", options
        end
      end
    end
  end
end
  

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bugsnag-api-2.0.2 lib/bugsnag/api/client/organizations.rb
bugsnag-api-2.0.1 lib/bugsnag/api/client/organizations.rb
bugsnag-api-2.0.0 lib/bugsnag/api/client/organizations.rb