Class: LabClient::GroupLabels

Inherits:
Common
  • Object
show all
Includes:
ClassHelpers
Defined in:
lib/labclient/groups/labels/list.rb,
lib/labclient/groups/labels/show.rb,
lib/labclient/groups/labels/client.rb,
lib/labclient/groups/labels/create.rb,
lib/labclient/groups/labels/delete.rb,
lib/labclient/groups/labels/update.rb,
lib/labclient/groups/labels/subscribe.rb,
lib/labclient/groups/labels/unsubscribe.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(group_id, query) ⇒ Object



33
34
35
36
37
# File 'lib/labclient/groups/labels/create.rb', line 33

def create(group_id, query)
  group_id = format_id(group_id)

  client.request(:post, "groups/#{group_id}/labels", GroupLabel, query)
end

#delete(group_id, label_id) ⇒ Object



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

def delete(group_id, label_id)
  group_id = format_id(group_id)
  label_id = format_id(label_id)

  client.request(:delete, "groups/#{group_id}/labels/#{label_id}", GroupLabel)
end

#list(group_id, query = {}) ⇒ Object



29
30
31
32
33
# File 'lib/labclient/groups/labels/list.rb', line 29

def list(group_id, query = {})
  group_id = format_id(group_id)

  client.request(:get, "groups/#{group_id}/labels", GroupLabel, query)
end

#show(group_id, label_id, query = {}) ⇒ Object



27
28
29
30
31
32
# File 'lib/labclient/groups/labels/show.rb', line 27

def show(group_id, label_id, query = {})
  group_id = format_id(group_id)
  label_id = format_id(label_id)

  client.request(:get, "groups/#{group_id}/labels/#{label_id}", GroupLabel, query)
end

#subscribe(group_id, label_id) ⇒ Object



28
29
30
31
32
33
# File 'lib/labclient/groups/labels/subscribe.rb', line 28

def subscribe(group_id, label_id)
  group_id = format_id(group_id)
  label_id = format_id(label_id)

  client.request(:post, "groups/#{group_id}/labels/#{label_id}/subscribe", GroupLabel)
end

#unsubscribe(group_id, label_id) ⇒ Object



28
29
30
31
32
33
# File 'lib/labclient/groups/labels/unsubscribe.rb', line 28

def unsubscribe(group_id, label_id)
  group_id = format_id(group_id)
  label_id = format_id(label_id)

  client.request(:post, "groups/#{group_id}/labels/#{label_id}/unsubscribe", GroupLabel)
end

#update(group_id, label_id, query) ⇒ Object



39
40
41
42
43
44
# File 'lib/labclient/groups/labels/update.rb', line 39

def update(group_id, label_id, query)
  group_id = format_id(group_id)
  label_id = format_id(label_id)

  client.request(:put, "groups/#{group_id}/labels/#{label_id}", GroupLabel, query)
end