Class: LabClient::ProjectTriggers

Inherits:
Common
  • Object
show all
Includes:
ClassHelpers
Defined in:
lib/labclient/projects/triggers/list.rb,
lib/labclient/projects/triggers/show.rb,
lib/labclient/projects/triggers/client.rb,
lib/labclient/projects/triggers/create.rb,
lib/labclient/projects/triggers/delete.rb

Overview

Specifics

Constant Summary

Constants included from AccessLevel

AccessLevel::HUMAN_ACCESS_LEVELS, AccessLevel::MACHINE_ACCESS_LEVELS

Instance Attribute Summary

Attributes inherited from Common

#client

Instance Method Summary collapse

Methods included from ClassHelpers

#has?, #keys, #raw

Methods inherited from Common

#api_methods, #api_methods_help, #format_id, #format_query_id, #format_query_ids, #format_time?, #group_name, #help, #initialize, #inspect, #klass, #protected_query_access_level, #query_access_level, #query_format_time

Methods included from Docs

#demo, #desc, #doc, docs, #example, #group_name, #help, json, #markdown, #navigation, #option, #result, #subtitle, #title

Methods included from AccessLevel

#human_access_level, #human_protected_access_level, #machine_access_level, #machine_protected_access_level

Constructor Details

This class inherits a constructor from LabClient::Common

Instance Method Details

#create(project_id, description) ⇒ Object



30
31
32
33
34
35
# File 'lib/labclient/projects/triggers/create.rb', line 30

def create(project_id, description)
  project_id = format_id(project_id)
  query = { description: description }

  client.request(:post, "projects/#{project_id}/triggers", ProjectTrigger, query)
end

#delete(project_id, trigger_id) ⇒ Object



26
27
28
29
30
31
# File 'lib/labclient/projects/triggers/delete.rb', line 26

def delete(project_id, trigger_id)
  project_id = format_id(project_id)
  trigger_id = format_id(trigger_id)

  client.request(:delete, "projects/#{project_id}/triggers/#{trigger_id}")
end

#list(project_id) ⇒ Object



22
23
24
25
26
# File 'lib/labclient/projects/triggers/list.rb', line 22

def list(project_id)
  project_id = format_id(project_id)

  client.request(:get, "projects/#{project_id}/triggers", ProjectTrigger)
end

#show(project_id, trigger_id) ⇒ Object



20
21
22
23
24
25
# File 'lib/labclient/projects/triggers/show.rb', line 20

def show(project_id, trigger_id)
  project_id = format_id(project_id)
  trigger_id = format_id(trigger_id)

  client.request(:get, "projects/#{project_id}/triggers/#{trigger_id}", ProjectTrigger)
end