Class: Athenian::JIRAEpicChild

Inherits:
Object
  • Object
show all
Defined in:
lib/athenian/models/jira_epic_child.rb

Overview

Details about a JIRA issue contained in an epic.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ JIRAEpicChild

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



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
# File 'lib/athenian/models/jira_epic_child.rb', line 152

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, 'The input argument (attributes) must be a hash in `Athenian::JIRAEpicChild` 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::JIRAEpicChild`. 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?(:'subtasks')
    self.subtasks = attributes[:'subtasks']
  end

  if attributes.key?(:'prs')
    self.prs = attributes[:'prs']
  end
end

Instance Attribute Details

#acknowledge_timeObject

Returns the value of attribute acknowledge_time.



34
35
36
# File 'lib/athenian/models/jira_epic_child.rb', line 34

def acknowledge_time
  @acknowledge_time
end

#assigneeObject

Name of the assigned person.



44
45
46
# File 'lib/athenian/models/jira_epic_child.rb', line 44

def assignee
  @assignee
end

#comment_listObject

The list of comments for the issue.



50
51
52
# File 'lib/athenian/models/jira_epic_child.rb', line 50

def comment_list
  @comment_list
end

#commentsObject

Number of comments in the issue excluding sub-tasks and children.



47
48
49
# File 'lib/athenian/models/jira_epic_child.rb', line 47

def comments
  @comments
end

#createdObject

When this issue was created.



23
24
25
# File 'lib/athenian/models/jira_epic_child.rb', line 23

def created
  @created
end

#idObject

JIRA issue key ‘PROJECT-###`.



17
18
19
# File 'lib/athenian/models/jira_epic_child.rb', line 17

def id
  @id
end

#lead_timeObject

Returns the value of attribute lead_time.



36
37
38
# File 'lib/athenian/models/jira_epic_child.rb', line 36

def lead_time
  @lead_time
end

#life_timeObject

Returns the value of attribute life_time.



38
39
40
# File 'lib/athenian/models/jira_epic_child.rb', line 38

def life_time
  @life_time
end

#priorityObject

Name of the priority. The details are returned in ‘FilteredJIRAStuff.priorities`.



53
54
55
# File 'lib/athenian/models/jira_epic_child.rb', line 53

def priority
  @priority
end

#prsObject

Number of mapped pull requests.



74
75
76
# File 'lib/athenian/models/jira_epic_child.rb', line 74

def prs
  @prs
end

#rendered_descriptionObject

The description of the issue rendered as HTML.



56
57
58
# File 'lib/athenian/models/jira_epic_child.rb', line 56

def rendered_description
  @rendered_description
end

#reporterObject

Name of the person who reported the issue.



41
42
43
# File 'lib/athenian/models/jira_epic_child.rb', line 41

def reporter
  @reporter
end

#resolvedObject

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`.



32
33
34
# File 'lib/athenian/models/jira_epic_child.rb', line 32

def resolved
  @resolved
end

#statusObject

Name of the status. The details are returned in ‘FilteredJIRAStuff.statuses`.



59
60
61
# File 'lib/athenian/models/jira_epic_child.rb', line 59

def status
  @status
end

#story_pointsObject

Value of the "story points" field.



62
63
64
# File 'lib/athenian/models/jira_epic_child.rb', line 62

def story_points
  @story_points
end

#subtasksObject

Number of sub-tasks.



71
72
73
# File 'lib/athenian/models/jira_epic_child.rb', line 71

def subtasks
  @subtasks
end

#titleObject

Title of this issue.



20
21
22
# File 'lib/athenian/models/jira_epic_child.rb', line 20

def title
  @title
end

#typeObject

Name of the issue type. The details are returned in ‘FilteredJIRAStuff.issue_types`.



65
66
67
# File 'lib/athenian/models/jira_epic_child.rb', line 65

def type
  @type
end

#updatedObject

When this issue was last updated.



26
27
28
# File 'lib/athenian/models/jira_epic_child.rb', line 26

def updated
  @updated
end

#urlObject

Link to the issue in JIRA web application.



68
69
70
# File 'lib/athenian/models/jira_epic_child.rb', line 68

def url
  @url
end

#work_beganObject

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`.



29
30
31
# File 'lib/athenian/models/jira_epic_child.rb', line 29

def work_began
  @work_began
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



104
105
106
# File 'lib/athenian/models/jira_epic_child.rb', line 104

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/athenian/models/jira_epic_child.rb', line 77

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',
    :'subtasks' => :'subtasks',
    :'prs' => :'prs'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



373
374
375
# File 'lib/athenian/models/jira_epic_child.rb', line 373

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_all_ofObject

List of class defined in allOf (OpenAPI v3)



143
144
145
146
147
148
# File 'lib/athenian/models/jira_epic_child.rb', line 143

def self.openapi_all_of
  [
  :'JIRAEpicChildAllOf',
  :'JIRAEpicIssueCommon'
  ]
end

.openapi_nullableObject

List of attributes with nullable: true



136
137
138
139
140
# File 'lib/athenian/models/jira_epic_child.rb', line 136

def self.openapi_nullable
  Set.new([
    :'priority',
  ])
end

.openapi_typesObject

Attribute type mapping.



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/athenian/models/jira_epic_child.rb', line 109

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',
    :'subtasks' => :'Integer',
    :'prs' => :'Integer'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
# File 'lib/athenian/models/jira_epic_child.rb', line 332

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 &&
      subtasks == o.subtasks &&
      prs == o.prs
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



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
438
439
440
441
# File 'lib/athenian/models/jira_epic_child.rb', line 404

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

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



475
476
477
478
479
480
481
482
483
484
485
486
487
# File 'lib/athenian/models/jira_epic_child.rb', line 475

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

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
# File 'lib/athenian/models/jira_epic_child.rb', line 380

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

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


360
361
362
# File 'lib/athenian/models/jira_epic_child.rb', line 360

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



366
367
368
# File 'lib/athenian/models/jira_epic_child.rb', line 366

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, subtasks, prs].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



254
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
307
308
309
# File 'lib/athenian/models/jira_epic_child.rb', line 254

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 @subtasks.nil?
    invalid_properties.push('invalid value for "subtasks", subtasks cannot be nil.')
  end

  if @prs.nil?
    invalid_properties.push('invalid value for "prs", prs cannot be nil.')
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



451
452
453
# File 'lib/athenian/models/jira_epic_child.rb', line 451

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



457
458
459
460
461
462
463
464
465
466
467
468
469
# File 'lib/athenian/models/jira_epic_child.rb', line 457

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_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



445
446
447
# File 'lib/athenian/models/jira_epic_child.rb', line 445

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
# File 'lib/athenian/models/jira_epic_child.rb', line 313

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 @subtasks.nil?
  return false if @prs.nil?
  true
end