class Geet::Github::Label
def self.create(name, color, api_interface)
def self.create(name, color, api_interface) api_path = 'labels' request_data = {name:, color:} api_interface.send_request(api_path, data: request_data) new(name, color) end
def self.list(api_interface)
def self.list(api_interface) api_path = 'labels' response = T.cast(api_interface.send_request(api_path, multipage: true), T::Array[T::Hash[String, T.untyped]]) response.map do |label_entry| name = T.cast(label_entry.fetch('name'), String) color = T.cast(label_entry.fetch('color'), String) new(name, color) end end
def initialize(name, color)
def initialize(name, color) @name = name @color = color end