Module: Gitlab::Client::AwardEmojis

Included in:
Gitlab::Client
Defined in:
lib/gitlab/client/award_emojis.rb

Overview

Defines methods related to Award Emojis.

Instance Method Summary collapse

Instance Method Details

#award_emoji(project, awardable_id, awardable_type, award_id) ⇒ Gitlab::ObjectifiedHash

Gets a single award emoji for an awardable(issue, merge request or snippet)

Examples:

Gitlab.award_emoji(1, 80, 'issue', 4)
Gitlab.award_emoji(1, 60, 'merge_request', 4)
Gitlab.award_emoji(1, 40, 'snippet', 4)

Parameters:

  • project (Integer)

    The ID of a project.

  • awardable_id (Integer)

    The ID of an awardable(issue, merge request or snippet).

  • awardable_type (String)

    The type of the awardable(can be 'issue', 'merge_request' or 'snippet')

  • award_id (Integer)

    The ID of an award emoji.

Returns:


48
49
50
# File 'lib/gitlab/client/award_emojis.rb', line 48

def award_emoji(project, awardable_id, awardable_type, award_id)
  get("/projects/#{url_encode project}/#{awardable_type}s/#{awardable_id}/award_emoji/#{award_id}")
end

#award_emojis(project, awardable_id, awardable_type) ⇒ Array<Gitlab::ObjectifiedHash>

Gets a list of all award emoji for an awardable(issue, merge request or snippet)

Examples:

Gitlab.award_emojis(1, 80, 'issue')
Gitlab.award_emojis(1, 60, 'merge_request')
Gitlab.award_emojis(1, 40, 'snippet')

Parameters:

  • project (Integer)

    The ID of a project.

  • awardable_id (Integer)

    The ID of an awardable(issue, merge request or snippet).

  • awardable_type (String)

    The type of the awardable(can be 'issue', 'merge_request' or 'snippet')

Returns:


16
17
18
# File 'lib/gitlab/client/award_emojis.rb', line 16

def award_emojis(project, awardable_id, awardable_type)
  get("/projects/#{url_encode project}/#{awardable_type}s/#{awardable_id}/award_emoji")
end

#create_award_emoji(project, awardable_id, awardable_type, emoji_name) ⇒ Gitlab::ObjectifiedHash

Awards a new emoji to an awardable(issue, merge request or snippet)

Examples:

Gitlab.create_award_emoji(1, 80, 'issue', 'blowfish')
Gitlab.create_award_emoji(1, 80, 'merge_request', 'blowfish')
Gitlab.create_award_emoji(1, 80, 'snippet', 'blowfish')

Parameters:

  • project (Integer)

    The ID of a project.

  • awardable_id (Integer)

    The ID of an awardable(issue, merge request or snippet).

  • awardable_type (String)

    The type of the awardable(can be 'issue', 'merge_request' or 'snippet')

  • emoji_name (String)

    The name of the emoji, without colons.

Returns:


81
82
83
# File 'lib/gitlab/client/award_emojis.rb', line 81

def create_award_emoji(project, awardable_id, awardable_type, emoji_name)
  post("/projects/#{url_encode project}/#{awardable_type}s/#{awardable_id}/award_emoji", body: {name: emoji_name})
end

#create_note_award_emoji(project, awardable_id, awardable_type, note_id, emoji_name) ⇒ Gitlab::ObjectifiedHash

Awards a new emoji to a note on an awardable(issue, merge request or snippet)

Examples:

Gitlab.create_note_award_emoji(1, 80, 'issue', 1, 'blowfish')
Gitlab.create_note_award_emoji(1, 80, 'merge_request', 1, 'blowfish')
Gitlab.create_note_award_emoji(1, 80, 'snippet', 1, 'blowfish')

Parameters:

  • project (Integer)

    The ID of a project.

  • awardable_id (Integer)

    The ID of an awardable(issue, merge request or snippet).

  • awardable_type (String)

    The type of the awardable(can be 'issue', 'merge_request' or 'snippet')

  • note_id (Integer)

    The ID of a note.

  • emoji_name (String)

    The name of the emoji, without colons.

Returns:


98
99
100
# File 'lib/gitlab/client/award_emojis.rb', line 98

def create_note_award_emoji(project, awardable_id, awardable_type, note_id, emoji_name)
  post("/projects/#{url_encode project}/#{awardable_type}s/#{awardable_id}/notes/#{note_id}/award_emoji", body: {name: emoji_name})
end

#delete_award_emoji(project, awardable_id, awardable_type, award_id) ⇒ void

This method returns an undefined value.

Deletes a single award emoji from an awardable(issue, merge request or snippet)

Examples:

Gitlab.delete_award_emoji(1, 80, 'issue', 4)
Gitlab.delete_award_emoji(1, 60, 'merge_request', 4)
Gitlab.delete_award_emoji(1, 40, 'snippet', 4)

Parameters:

  • project (Integer)

    The ID of a project.

  • awardable_id (Integer)

    The ID of an awardable(issue, merge request or snippet).

  • awardable_type (String)

    The type of the awardable(can be 'issue', 'merge_request' or 'snippet')

  • award_id (Integer)

    The ID of an award emoji.


114
115
116
# File 'lib/gitlab/client/award_emojis.rb', line 114

def delete_award_emoji(project, awardable_id, awardable_type, award_id)
  delete("/projects/#{url_encode project}/#{awardable_type}s/#{awardable_id}/award_emoji/#{award_id}")
end

#delete_note_award_emoji(project, awardable_id, awardable_type, note_id, award_id) ⇒ void

This method returns an undefined value.

Deletes a single award emoji from a single note on an awardable(issue, merge request or snippet)

Examples:

Gitlab.delete_note_award_emoji(1, 80, 'issue', 1, 4)
Gitlab.delete_note_award_emoji(1, 60, 'merge_request', 1, 4)
Gitlab.delete_note_award_emoji(1, 40, 'snippet', 1, 4)

Parameters:

  • project (Integer)

    The ID of a project.

  • awardable_id (Integer)

    The ID of an awardable(issue, merge request or snippet).

  • awardable_type (String)

    The type of the awardable(can be 'issue', 'merge_request' or 'snippet')

  • note_id (Integer)

    The ID of a note.

  • award_id (Integer)

    The ID of an award emoji.


131
132
133
# File 'lib/gitlab/client/award_emojis.rb', line 131

def delete_note_award_emoji(project, awardable_id, awardable_type, note_id, award_id)
  delete("/projects/#{url_encode project}/#{awardable_type}s/#{awardable_id}/notes/#{note_id}/award_emoji/#{award_id}")
end

#note_award_emoji(project, awardable_id, awardable_type, note_id, award_id) ⇒ Gitlab::ObjectifiedHash

Gets a single award emoji from a single note on an awardable(issue, merge request or snippet)

Examples:

Gitlab.note_award_emoji(1, 80, 'issue', 1, 4)
Gitlab.note_award_emoji(1, 60, 'merge_request', 1, 4)
Gitlab.note_award_emoji(1, 40, 'snippet', 1, 4)

Parameters:

  • project (Integer)

    The ID of a project.

  • awardable_id (Integer)

    The ID of an awardable(issue, merge request or snippet).

  • awardable_type (String)

    The type of the awardable(can be 'issue', 'merge_request' or 'snippet')

  • note_id (Integer)

    The ID of a note.

  • award_id (Integer)

    The ID of an award emoji.

Returns:


65
66
67
# File 'lib/gitlab/client/award_emojis.rb', line 65

def note_award_emoji(project, awardable_id, awardable_type, note_id, award_id)
  get("/projects/#{url_encode project}/#{awardable_type}s/#{awardable_id}/notes/#{note_id}/award_emoji/#{award_id}")
end

#note_award_emojis(project, awardable_id, awardable_type, note_id) ⇒ Array<Gitlab::ObjectifiedHash>

Gets a list of all award emoji for a single note on an awardable(issue, merge request or snippet)

Examples:

Gitlab.note_award_emojis(1, 80, 'issue', 1)
Gitlab.note_award_emojis(1, 60, 'merge_request', 1)
Gitlab.note_award_emojis(1, 40, 'snippet', 1)

Parameters:

  • project (Integer)

    The ID of a project.

  • awardable_id (Integer)

    The ID of an awardable(issue, merge request or snippet).

  • awardable_type (String)

    The type of the awardable(can be 'issue', 'merge_request' or 'snippet')

  • note_id (Integer)

    The ID of a note.

Returns:


32
33
34
# File 'lib/gitlab/client/award_emojis.rb', line 32

def note_award_emojis(project, awardable_id, awardable_type, note_id)
  get("/projects/#{url_encode project}/#{awardable_type}s/#{awardable_id}/notes/#{note_id}/award_emoji")
end