Class: LabClient::EpicDiscussions

Inherits:
Common
  • Object
show all
Includes:
ClassHelpers
Defined in:
lib/labclient/discussions/epics/list.rb,
lib/labclient/discussions/epics/show.rb,
lib/labclient/discussions/epics/client.rb,
lib/labclient/discussions/epics/create.rb,
lib/labclient/discussions/epics/delete.rb,
lib/labclient/discussions/epics/update.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, epic_id, query = {}) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/labclient/discussions/epics/create.rb', line 23

def create(project_id, epic_id, query = {})
  project_id = format_id(project_id)
  epic_id = format_id(epic_id)

  query[:created_at] = query[:created_at].to_time.iso8601 if format_time?(query[:created_at])

  client.request(:post, "projects/#{project_id}/epics/#{epic_id}/discussions", Discussion, query)
end

#delete(project_id, epic_id, discussion_id) ⇒ Object

Delete



12
13
14
15
16
17
18
# File 'lib/labclient/discussions/epics/delete.rb', line 12

def delete(project_id, epic_id, discussion_id)
  project_id = format_id(project_id)
  epic_id = format_id(epic_id)
  discussion_id = format_id(discussion_id)

  client.request(:delete, "projects/#{project_id}/epics/#{epic_id}/discussions/#{discussion_id}")
end

#list(project_id, epic_id) ⇒ Object



15
16
17
18
19
20
# File 'lib/labclient/discussions/epics/list.rb', line 15

def list(project_id, epic_id)
  project_id = format_id(project_id)
  epic_id = format_id(epic_id)

  client.request(:get, "projects/#{project_id}/epics/#{epic_id}/discussions", Discussion)
end

#show(project_id, epic_id, discussion_id) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/labclient/discussions/epics/show.rb', line 14

def show(project_id, epic_id, discussion_id)
  project_id = format_id(project_id)
  epic_id = format_id(epic_id)
  discussion_id = format_id(discussion_id)

  client.request(:get, "projects/#{project_id}/epics/#{epic_id}/discussions/#{discussion_id}", Discussion)
end

#update(project_id, epic_id, discussion_id, body) ⇒ Object

Show



23
24
25
26
27
28
29
30
# File 'lib/labclient/discussions/epics/update.rb', line 23

def update(project_id, epic_id, discussion_id, body)
  project_id = format_id(project_id)
  epic_id = format_id(epic_id)
  discussion_id = format_id(discussion_id)
  query = { body: body }

  client.request(:put, "projects/#{project_id}/epics/#{epic_id}/discussions/#{discussion_id}", Discussion, query)
end