Module: Bugsnag::Api::Client::Projects

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

Overview

Methods for the Projects API

Instance Method Summary collapse

Instance Method Details

#create_project(org_id, name, type, options = {}) ⇒ Sawyer::Resource

Create a Project in an Organization



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

def create_project(org_id, name, type, options = {})
  post "organizations/#{org_id}/projects", options.merge({:name => name, :type => type})
end

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

Delete a Project



55
56
57
# File 'lib/bugsnag/api/client/projects.rb', line 55

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

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

View a Project

Returns:

  • (Sawyer::Resource)

    Requested Project

See Also:



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

def project(id, options = {})
  get "projects/#{id}", options
end

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

Regenerate a Project's notifier API key



47
48
49
# File 'lib/bugsnag/api/client/projects.rb', line 47

def regenerate_api_key(id, options = {})
  delete "projects/#{id}/api_key", options
end

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

Update a Project

Parameters:

  • name (Hash)

    a customizable set of options

  • global_grouping (Hash)

    a customizable set of options

  • location_grouping (Hash)

    a customizable set of options

  • discarded_app_versions (Hash)

    a customizable set of options

  • discarded_errors (Hash)

    a customizable set of options

  • url_whitelist (Hash)

    a customizable set of options

  • ignore_old_browsers (Hash)

    a customizable set of options

  • ignored_browser_versions (Hash)

    a customizable set of options

  • resolve_on_deploy (Hash)

    a customizable set of options

  • collaborator_ids (Hash)

    a customizable set of options

Returns:

  • (Sawyer::Resource)

    Updated Project

See Also:



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

def update_project(id, options = {})
  patch "projects/#{id}", options
end