Module: BacklogKit::Client::Watching

Included in:
BacklogKit::Client
Defined in:
lib/backlog_kit/client/watching.rb

Overview

Methods for the Watching API

Instance Method Summary collapse

Instance Method Details

#add_watching(issue_id_or_key, params = {}) ⇒ BacklogKit::Response

Add a watching

Parameters:

  • issue_id_or_key (Integer, String)

    Issue id or Issue key

  • params (Hash) (defaults to: {})

    Request parameters

Returns:



36
37
38
39
# File 'lib/backlog_kit/client/watching.rb', line 36

def add_watching(issue_id_or_key, params = {})
  params[:issue_id_or_key] = issue_id_or_key
  post('watchings', params)
end

#get_watching(watching_id) ⇒ BacklogKit::Response

Get a watching

Parameters:

  • watching_id (Integer, String)

    Watching id

Returns:



27
28
29
# File 'lib/backlog_kit/client/watching.rb', line 27

def get_watching(watching_id)
  get("watchings/#{watching_id}")
end

#get_watching_count(user_id, params = {}) ⇒ BacklogKit::Response

Get number of watchings

Parameters:

  • user_id (Integer, String)

    User id

  • params (Hash) (defaults to: {})

    Request parameters

Returns:



19
20
21
# File 'lib/backlog_kit/client/watching.rb', line 19

def get_watching_count(user_id, params = {})
  get("users/#{user_id}/watchings/count", params)
end

#get_watchings(user_id, params = {}) ⇒ BacklogKit::Response

Get list of watchings

Parameters:

  • user_id (Integer, String)

    User id

  • params (Hash) (defaults to: {})

    Request parameters

Returns:



10
11
12
# File 'lib/backlog_kit/client/watching.rb', line 10

def get_watchings(user_id, params = {})
  get("users/#{user_id}/watchings", params)
end

#mark_as_read_watching(watching_id) ⇒ BacklogKit::Response

Mark a watching as read

Parameters:

  • watching_id (Integer, String)

    Watching id

Returns:



70
71
72
# File 'lib/backlog_kit/client/watching.rb', line 70

def mark_as_read_watching(watching_id)
  post("watchings/#{watching_id}/markAsRead")
end

#mark_as_read_watchings(user_id) ⇒ BacklogKit::Response

Mark watchings as read

Parameters:

  • user_id (Integer, String)

    User id

Returns:



62
63
64
# File 'lib/backlog_kit/client/watching.rb', line 62

def mark_as_read_watchings(user_id)
  post("users/#{user_id}/watchings/markAsChecked")
end

#remove_watching(watching_id) ⇒ BacklogKit::Response

Remove a watching

Parameters:

  • watching_id (Integer, String)

    Watching id

Returns:



54
55
56
# File 'lib/backlog_kit/client/watching.rb', line 54

def remove_watching(watching_id)
  delete("watchings/#{watching_id}")
end

#update_watching(watching_id, params = {}) ⇒ BacklogKit::Response

Update a watching

Parameters:

  • watching_id (Integer, String)

    Watching id

  • params (Hash) (defaults to: {})

    Request parameters

Returns:



46
47
48
# File 'lib/backlog_kit/client/watching.rb', line 46

def update_watching(watching_id, params = {})
  patch("watchings/#{watching_id}", params)
end