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:



50
51
52
# File 'lib/gitlab/client/award_emojis.rb', line 50

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:



18
19
20
# File 'lib/gitlab/client/award_emojis.rb', line 18

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:



83
84
85
# File 'lib/gitlab/client/award_emojis.rb', line 83

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:



100
101
102
# File 'lib/gitlab/client/award_emojis.rb', line 100

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.



116
117
118
# File 'lib/gitlab/client/award_emojis.rb', line 116

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.



133
134
135
# File 'lib/gitlab/client/award_emojis.rb', line 133

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:



67
68
69
# File 'lib/gitlab/client/award_emojis.rb', line 67

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:



34
35
36
# File 'lib/gitlab/client/award_emojis.rb', line 34

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