module Gitlab::Client::Label
Overview
Defines methods related to label.
See http://docs.gitlab.com/ce/api/labels.html
Direct including types
Defined in:
gitlab/client/label.crInstance Method Summary
-
#create_label(project_id : Int32, name : String, color : String, description : String | Nil = nil) : JSON::Any
Create label in a project.
-
#delete_label(project_id : Int32, name : String) : JSON::Any | Bool
Delete a label in a project.
-
#edit_label(project_id : Int32, name : String, form : Hash = {} of String => String) : JSON::Any
Edit a label in a project.
-
#labels(project_id : Int32, params : Hash | Nil = nil) : JSON::Any
Gets a list labels in a project.
-
#subscribe_label(project_id : Int32, label_id : Int32 | String) : JSON::Any
Subscribe a label in a project.
-
#unsubscribe_label(project_id : Int32, label_id : Int32 | String) : JSON::Any
Unsubscribe a label in a project.
Instance Method Detail
def create_label(project_id : Int32, name : String, color : String, description : String | Nil = nil) : JSON::Any
#
Create label in a project.
- param [Int32] project_id The ID of a project.
- param [String] name The name of a label.
- param [String] color The color of the label in 6-digit hex notation with leading # sign.
- param [String] description The description of the label.
- return [JSON::Any] Information about the created label in a project.
client.create_label(1, "hotfix", "#E2C08D")
client.create_label(1, "feature", "#C678DD", "next release features")
def delete_label(project_id : Int32, name : String) : JSON::Any | Bool
#
Delete a label in a project.
- param [Int32] project_id The ID of a project.
- param [String] name The name of a label.
- return [JSON::Any] Information about the deleted label.
client.delete_issue(4, 3)
def edit_label(project_id : Int32, name : String, form : Hash = {} of String => String) : JSON::Any
#
Edit a label in a project.
- param [Int32] project_id The ID of a project.
- param [String] name The name of a label.
- param [Hash] params A customizable set of params.
- option params [String] :new_name The new name of the label.
- option params [String] :color The color of the label in 6-digit hex notation with leading # sign.
- option params [String] :description The description of the label.
- return [JSON::Any] Information about the updated label in a project.
client.edit_label(1, "hotfix", {"new_name" => "bugs"})
client.edit_label(1, "hotfix", {"color" => "#BE5046"})
def labels(project_id : Int32, params : Hash | Nil = nil) : JSON::Any
#
Gets a list labels in a project.
- param [Int32] project_id The ID of a project.
- param [Hash] params A customizable set of params.
- option params [String] :page The page number.
- option params [String] :per_page The number of results per page. default is 20
- return [JSON::Any] List of issues under a project.
client.labels(1)
client.labels(1, {"per_page" => "10"})
def subscribe_label(project_id : Int32, label_id : Int32 | String) : JSON::Any
#
Subscribe a label in a project.
- param [Int32] project_id The ID of a project.
- param [Int32] label_id The ID of a label.
- return [JSON::Any] Information about the subscribed label in a project.
client.subscribe_label(1, 38)
def unsubscribe_label(project_id : Int32, label_id : Int32 | String) : JSON::Any
#
Unsubscribe a label in a project.
- param [Int32] project_id The ID of a project.
- param [Int32] label_id The ID of a label.
- return [JSON::Any] Information about the subscribed label in a project.
client.unsubscribe_label(1, 38)