Class: Athenian::JIRAIssue
- Inherits:
-
Object
- Object
- Athenian::JIRAIssue
- Defined in:
- lib/athenian/models/jira_issue.rb
Instance Attribute Summary collapse
-
#acknowledge_time ⇒ Object
Returns the value of attribute acknowledge_time.
-
#assignee ⇒ Object
Name of the assigned person.
-
#comment_list ⇒ Object
The list of comments for the issue.
-
#comments ⇒ Object
Number of comments in the issue excluding sub-tasks and children.
-
#created ⇒ Object
When this issue was created.
-
#id ⇒ Object
JIRA issue key ‘PROJECT-###`.
-
#lead_time ⇒ Object
Returns the value of attribute lead_time.
-
#life_time ⇒ Object
Returns the value of attribute life_time.
-
#priority ⇒ Object
Name of the priority.
-
#project ⇒ Object
Identifier of the project where this issue exists.
-
#prs ⇒ Object
Details about the mapped PRs.
-
#rendered_description ⇒ Object
The description of the issue rendered as HTML.
-
#reporter ⇒ Object
Name of the person who reported the issue.
-
#resolved ⇒ Object
When the issue finished: the stage is "Done" and all PRs are either released or rejected.
-
#status ⇒ Object
Name of the status.
-
#story_points ⇒ Object
Value of the "story points" field.
-
#title ⇒ Object
Title of this issue.
-
#type ⇒ Object
Name of the issue type.
-
#updated ⇒ Object
When this issue was last updated.
-
#url ⇒ Object
Link to the issue in JIRA web application.
-
#work_began ⇒ Object
When the issue entered the "In Progress" stage or received a PR.
Class Method Summary collapse
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_all_of ⇒ Object
List of class defined in allOf (OpenAPI v3).
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ JIRAIssue
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ JIRAIssue
Initializes the object
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 |
# File 'lib/athenian/models/jira_issue.rb', line 151 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, 'The input argument (attributes) must be a hash in `Athenian::JIRAIssue` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `Athenian::JIRAIssue`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'id') self.id = attributes[:'id'] end if attributes.key?(:'title') self.title = attributes[:'title'] end if attributes.key?(:'created') self.created = attributes[:'created'] end if attributes.key?(:'updated') self.updated = attributes[:'updated'] end if attributes.key?(:'work_began') self.work_began = attributes[:'work_began'] end if attributes.key?(:'resolved') self.resolved = attributes[:'resolved'] end if attributes.key?(:'acknowledge_time') self.acknowledge_time = attributes[:'acknowledge_time'] end if attributes.key?(:'lead_time') self.lead_time = attributes[:'lead_time'] end if attributes.key?(:'life_time') self.life_time = attributes[:'life_time'] end if attributes.key?(:'reporter') self.reporter = attributes[:'reporter'] end if attributes.key?(:'assignee') self.assignee = attributes[:'assignee'] end if attributes.key?(:'comments') self.comments = attributes[:'comments'] end if attributes.key?(:'comment_list') if (value = attributes[:'comment_list']).is_a?(Array) self.comment_list = value end end if attributes.key?(:'priority') self.priority = attributes[:'priority'] end if attributes.key?(:'rendered_description') self.rendered_description = attributes[:'rendered_description'] end if attributes.key?(:'status') self.status = attributes[:'status'] end if attributes.key?(:'story_points') self.story_points = attributes[:'story_points'] end if attributes.key?(:'type') self.type = attributes[:'type'] end if attributes.key?(:'url') self.url = attributes[:'url'] end if attributes.key?(:'project') self.project = attributes[:'project'] end if attributes.key?(:'prs') if (value = attributes[:'prs']).is_a?(Array) self.prs = value end end end |
Instance Attribute Details
#acknowledge_time ⇒ Object
Returns the value of attribute acknowledge_time.
33 34 35 |
# File 'lib/athenian/models/jira_issue.rb', line 33 def acknowledge_time @acknowledge_time end |
#assignee ⇒ Object
Name of the assigned person.
43 44 45 |
# File 'lib/athenian/models/jira_issue.rb', line 43 def assignee @assignee end |
#comment_list ⇒ Object
The list of comments for the issue.
49 50 51 |
# File 'lib/athenian/models/jira_issue.rb', line 49 def comment_list @comment_list end |
#comments ⇒ Object
Number of comments in the issue excluding sub-tasks and children.
46 47 48 |
# File 'lib/athenian/models/jira_issue.rb', line 46 def comments @comments end |
#created ⇒ Object
When this issue was created.
22 23 24 |
# File 'lib/athenian/models/jira_issue.rb', line 22 def created @created end |
#id ⇒ Object
JIRA issue key ‘PROJECT-###`.
16 17 18 |
# File 'lib/athenian/models/jira_issue.rb', line 16 def id @id end |
#lead_time ⇒ Object
Returns the value of attribute lead_time.
35 36 37 |
# File 'lib/athenian/models/jira_issue.rb', line 35 def lead_time @lead_time end |
#life_time ⇒ Object
Returns the value of attribute life_time.
37 38 39 |
# File 'lib/athenian/models/jira_issue.rb', line 37 def life_time @life_time end |
#priority ⇒ Object
Name of the priority. The details are returned in ‘FilteredJIRAStuff.priorities`.
52 53 54 |
# File 'lib/athenian/models/jira_issue.rb', line 52 def priority @priority end |
#project ⇒ Object
Identifier of the project where this issue exists.
70 71 72 |
# File 'lib/athenian/models/jira_issue.rb', line 70 def project @project end |
#prs ⇒ Object
Details about the mapped PRs. ‘jira` field is unfilled.
73 74 75 |
# File 'lib/athenian/models/jira_issue.rb', line 73 def prs @prs end |
#rendered_description ⇒ Object
The description of the issue rendered as HTML.
55 56 57 |
# File 'lib/athenian/models/jira_issue.rb', line 55 def rendered_description @rendered_description end |
#reporter ⇒ Object
Name of the person who reported the issue.
40 41 42 |
# File 'lib/athenian/models/jira_issue.rb', line 40 def reporter @reporter end |
#resolved ⇒ Object
When the issue finished: the stage is "Done" and all PRs are either released or rejected. This timestamp can be missing and is always greater than or equal to ‘work_began`.
31 32 33 |
# File 'lib/athenian/models/jira_issue.rb', line 31 def resolved @resolved end |
#status ⇒ Object
Name of the status. The details are returned in ‘FilteredJIRAStuff.statuses`.
58 59 60 |
# File 'lib/athenian/models/jira_issue.rb', line 58 def status @status end |
#story_points ⇒ Object
Value of the "story points" field.
61 62 63 |
# File 'lib/athenian/models/jira_issue.rb', line 61 def story_points @story_points end |
#title ⇒ Object
Title of this issue.
19 20 21 |
# File 'lib/athenian/models/jira_issue.rb', line 19 def title @title end |
#type ⇒ Object
Name of the issue type. The details are returned in ‘FilteredJIRAStuff.issue_types`.
64 65 66 |
# File 'lib/athenian/models/jira_issue.rb', line 64 def type @type end |
#updated ⇒ Object
When this issue was last updated.
25 26 27 |
# File 'lib/athenian/models/jira_issue.rb', line 25 def updated @updated end |
#url ⇒ Object
Link to the issue in JIRA web application.
67 68 69 |
# File 'lib/athenian/models/jira_issue.rb', line 67 def url @url end |
#work_began ⇒ Object
When the issue entered the "In Progress" stage or received a PR. This timestamp can be missing and is always less than or equal to ‘resolved`.
28 29 30 |
# File 'lib/athenian/models/jira_issue.rb', line 28 def work_began @work_began end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
103 104 105 |
# File 'lib/athenian/models/jira_issue.rb', line 103 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/athenian/models/jira_issue.rb', line 76 def self.attribute_map { :'id' => :'id', :'title' => :'title', :'created' => :'created', :'updated' => :'updated', :'work_began' => :'work_began', :'resolved' => :'resolved', :'acknowledge_time' => :'acknowledge_time', :'lead_time' => :'lead_time', :'life_time' => :'life_time', :'reporter' => :'reporter', :'assignee' => :'assignee', :'comments' => :'comments', :'comment_list' => :'comment_list', :'priority' => :'priority', :'rendered_description' => :'rendered_description', :'status' => :'status', :'story_points' => :'story_points', :'type' => :'type', :'url' => :'url', :'project' => :'project', :'prs' => :'prs' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
369 370 371 |
# File 'lib/athenian/models/jira_issue.rb', line 369 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_all_of ⇒ Object
List of class defined in allOf (OpenAPI v3)
142 143 144 145 146 147 |
# File 'lib/athenian/models/jira_issue.rb', line 142 def self.openapi_all_of [ :'JIRAEpicIssueCommon', :'JIRAIssueAllOf' ] end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
135 136 137 138 139 |
# File 'lib/athenian/models/jira_issue.rb', line 135 def self.openapi_nullable Set.new([ :'priority', ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
# File 'lib/athenian/models/jira_issue.rb', line 108 def self.openapi_types { :'id' => :'String', :'title' => :'String', :'created' => :'Time', :'updated' => :'Time', :'work_began' => :'Time', :'resolved' => :'Time', :'acknowledge_time' => :'Object', :'lead_time' => :'Object', :'life_time' => :'Object', :'reporter' => :'String', :'assignee' => :'String', :'comments' => :'Integer', :'comment_list' => :'Array<JIRAComment>', :'priority' => :'String', :'rendered_description' => :'String', :'status' => :'String', :'story_points' => :'Float', :'type' => :'String', :'url' => :'String', :'project' => :'String', :'prs' => :'Array<PullRequest>' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 |
# File 'lib/athenian/models/jira_issue.rb', line 328 def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && title == o.title && created == o.created && updated == o.updated && work_began == o.work_began && resolved == o.resolved && acknowledge_time == o.acknowledge_time && lead_time == o.lead_time && life_time == o.life_time && reporter == o.reporter && assignee == o.assignee && comments == o.comments && comment_list == o.comment_list && priority == o.priority && rendered_description == o.rendered_description && status == o.status && story_points == o.story_points && type == o.type && url == o.url && project == o.project && prs == o.prs end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 |
# File 'lib/athenian/models/jira_issue.rb', line 400 def _deserialize(type, value) case type.to_sym when :Time Time.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model # models (e.g. Pet) or oneOf klass = Athenian.const_get(type) klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
471 472 473 474 475 476 477 478 479 480 481 482 483 |
# File 'lib/athenian/models/jira_issue.rb', line 471 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 |
# File 'lib/athenian/models/jira_issue.rb', line 376 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end end self end |
#eql?(o) ⇒ Boolean
356 357 358 |
# File 'lib/athenian/models/jira_issue.rb', line 356 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
362 363 364 |
# File 'lib/athenian/models/jira_issue.rb', line 362 def hash [id, title, created, updated, work_began, resolved, acknowledge_time, lead_time, life_time, reporter, assignee, comments, comment_list, priority, rendered_description, status, story_points, type, url, project, prs].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 |
# File 'lib/athenian/models/jira_issue.rb', line 255 def list_invalid_properties invalid_properties = Array.new if @id.nil? invalid_properties.push('invalid value for "id", id cannot be nil.') end if @title.nil? invalid_properties.push('invalid value for "title", title cannot be nil.') end if @created.nil? invalid_properties.push('invalid value for "created", created cannot be nil.') end if @updated.nil? invalid_properties.push('invalid value for "updated", updated cannot be nil.') end if @acknowledge_time.nil? invalid_properties.push('invalid value for "acknowledge_time", acknowledge_time cannot be nil.') end if @life_time.nil? invalid_properties.push('invalid value for "life_time", life_time cannot be nil.') end if @reporter.nil? invalid_properties.push('invalid value for "reporter", reporter cannot be nil.') end if @comments.nil? invalid_properties.push('invalid value for "comments", comments cannot be nil.') end if @status.nil? invalid_properties.push('invalid value for "status", status cannot be nil.') end if @type.nil? invalid_properties.push('invalid value for "type", type cannot be nil.') end if @url.nil? invalid_properties.push('invalid value for "url", url cannot be nil.') end if @project.nil? invalid_properties.push('invalid value for "project", project cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
447 448 449 |
# File 'lib/athenian/models/jira_issue.rb', line 447 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
453 454 455 456 457 458 459 460 461 462 463 464 465 |
# File 'lib/athenian/models/jira_issue.rb', line 453 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
441 442 443 |
# File 'lib/athenian/models/jira_issue.rb', line 441 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 |
# File 'lib/athenian/models/jira_issue.rb', line 310 def valid? return false if @id.nil? return false if @title.nil? return false if @created.nil? return false if @updated.nil? return false if @acknowledge_time.nil? return false if @life_time.nil? return false if @reporter.nil? return false if @comments.nil? return false if @status.nil? return false if @type.nil? return false if @url.nil? return false if @project.nil? true end |