Class: MistApi::JsiPbnItem

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/mist_api/models/jsi_pbn_item.rb

Overview

PBN (Problem Bug Notification) advisory item

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(bug_type = SKIP, customer_risk = SKIP, fixed_in = SKIP, id = SKIP, introduced_in = SKIP, models = SKIP, product_family = SKIP, release_notes = SKIP, restoration = SKIP, title = SKIP, updated_date = SKIP, versions = SKIP, workaround = SKIP, workaround_provided = SKIP) ⇒ JsiPbnItem

Returns a new instance of JsiPbnItem.



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/mist_api/models/jsi_pbn_item.rb', line 113

def initialize(bug_type = SKIP, customer_risk = SKIP, fixed_in = SKIP,
               id = SKIP, introduced_in = SKIP, models = SKIP,
               product_family = SKIP, release_notes = SKIP,
               restoration = SKIP, title = SKIP, updated_date = SKIP,
               versions = SKIP, workaround = SKIP,
               workaround_provided = SKIP)
  @bug_type = bug_type unless bug_type == SKIP
  @customer_risk = customer_risk unless customer_risk == SKIP
  @fixed_in = fixed_in unless fixed_in == SKIP
  @id = id unless id == SKIP
  @introduced_in = introduced_in unless introduced_in == SKIP
  @models = models unless models == SKIP
  @product_family = product_family unless product_family == SKIP
  @release_notes = release_notes unless release_notes == SKIP
  @restoration = restoration unless restoration == SKIP
  @title = title unless title == SKIP
  @updated_date = updated_date unless updated_date == SKIP
  @versions = versions unless versions == SKIP
  @workaround = workaround unless workaround == SKIP
  @workaround_provided = workaround_provided unless workaround_provided == SKIP
end

Instance Attribute Details

#bug_typeString

Type of the bug (Day-1, Regression)

Returns:

  • (String)


14
15
16
# File 'lib/mist_api/models/jsi_pbn_item.rb', line 14

def bug_type
  @bug_type
end

#customer_riskString

Risk level

Returns:

  • (String)


18
19
20
# File 'lib/mist_api/models/jsi_pbn_item.rb', line 18

def customer_risk
  @customer_risk
end

#fixed_inString

Release in which the issue was fixed

Returns:

  • (String)


22
23
24
# File 'lib/mist_api/models/jsi_pbn_item.rb', line 22

def fixed_in
  @fixed_in
end

#idString

ID of the PBN

Returns:

  • (String)


26
27
28
# File 'lib/mist_api/models/jsi_pbn_item.rb', line 26

def id
  @id
end

#introduced_inString

Release introduced in

Returns:

  • (String)


30
31
32
# File 'lib/mist_api/models/jsi_pbn_item.rb', line 30

def introduced_in
  @introduced_in
end

#modelsArray[String]

OS models affected

Returns:

  • (Array[String])


34
35
36
# File 'lib/mist_api/models/jsi_pbn_item.rb', line 34

def models
  @models
end

#product_familyString

Product family affected

Returns:

  • (String)


38
39
40
# File 'lib/mist_api/models/jsi_pbn_item.rb', line 38

def product_family
  @product_family
end

#release_notesString

Release notes for this PBN

Returns:

  • (String)


42
43
44
# File 'lib/mist_api/models/jsi_pbn_item.rb', line 42

def release_notes
  @release_notes
end

#restorationString

Restoration steps

Returns:

  • (String)


46
47
48
# File 'lib/mist_api/models/jsi_pbn_item.rb', line 46

def restoration
  @restoration
end

#titleString

Title of the issue

Returns:

  • (String)


50
51
52
# File 'lib/mist_api/models/jsi_pbn_item.rb', line 50

def title
  @title
end

#updated_dateInteger

PBN updated timestamp

Returns:

  • (Integer)


54
55
56
# File 'lib/mist_api/models/jsi_pbn_item.rb', line 54

def updated_date
  @updated_date
end

#versionsArray[String]

OS versions affected

Returns:

  • (Array[String])


58
59
60
# File 'lib/mist_api/models/jsi_pbn_item.rb', line 58

def versions
  @versions
end

#workaroundString

Workaround for this issue

Returns:

  • (String)


62
63
64
# File 'lib/mist_api/models/jsi_pbn_item.rb', line 62

def workaround
  @workaround
end

#workaround_providedString

Any workaround available

Returns:

  • (String)


66
67
68
# File 'lib/mist_api/models/jsi_pbn_item.rb', line 66

def workaround_provided
  @workaround_provided
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/mist_api/models/jsi_pbn_item.rb', line 136

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  bug_type = hash.key?('bug_type') ? hash['bug_type'] : SKIP
  customer_risk = hash.key?('customer_risk') ? hash['customer_risk'] : SKIP
  fixed_in = hash.key?('fixed_in') ? hash['fixed_in'] : SKIP
  id = hash.key?('id') ? hash['id'] : SKIP
  introduced_in = hash.key?('introduced_in') ? hash['introduced_in'] : SKIP
  models = hash.key?('models') ? hash['models'] : SKIP
  product_family =
    hash.key?('product_family') ? hash['product_family'] : SKIP
  release_notes = hash.key?('release_notes') ? hash['release_notes'] : SKIP
  restoration = hash.key?('restoration') ? hash['restoration'] : SKIP
  title = hash.key?('title') ? hash['title'] : SKIP
  updated_date = hash.key?('updated_date') ? hash['updated_date'] : SKIP
  versions = hash.key?('versions') ? hash['versions'] : SKIP
  workaround = hash.key?('workaround') ? hash['workaround'] : SKIP
  workaround_provided =
    hash.key?('workaround_provided') ? hash['workaround_provided'] : SKIP

  # Create object from extracted values.
  JsiPbnItem.new(bug_type,
                 customer_risk,
                 fixed_in,
                 id,
                 introduced_in,
                 models,
                 product_family,
                 release_notes,
                 restoration,
                 title,
                 updated_date,
                 versions,
                 workaround,
                 workaround_provided)
end

.namesObject

A mapping from model property names to API property names.



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/mist_api/models/jsi_pbn_item.rb', line 69

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['bug_type'] = 'bug_type'
  @_hash['customer_risk'] = 'customer_risk'
  @_hash['fixed_in'] = 'fixed_in'
  @_hash['id'] = 'id'
  @_hash['introduced_in'] = 'introduced_in'
  @_hash['models'] = 'models'
  @_hash['product_family'] = 'product_family'
  @_hash['release_notes'] = 'release_notes'
  @_hash['restoration'] = 'restoration'
  @_hash['title'] = 'title'
  @_hash['updated_date'] = 'updated_date'
  @_hash['versions'] = 'versions'
  @_hash['workaround'] = 'workaround'
  @_hash['workaround_provided'] = 'workaround_provided'
  @_hash
end

.nullablesObject

An array for nullable fields



109
110
111
# File 'lib/mist_api/models/jsi_pbn_item.rb', line 109

def self.nullables
  []
end

.optionalsObject

An array for optional fields



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/mist_api/models/jsi_pbn_item.rb', line 89

def self.optionals
  %w[
    bug_type
    customer_risk
    fixed_in
    id
    introduced_in
    models
    product_family
    release_notes
    restoration
    title
    updated_date
    versions
    workaround
    workaround_provided
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



185
186
187
188
189
190
191
192
193
194
# File 'lib/mist_api/models/jsi_pbn_item.rb', line 185

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} bug_type: #{@bug_type.inspect}, customer_risk: #{@customer_risk.inspect},"\
  " fixed_in: #{@fixed_in.inspect}, id: #{@id.inspect}, introduced_in:"\
  " #{@introduced_in.inspect}, models: #{@models.inspect}, product_family:"\
  " #{@product_family.inspect}, release_notes: #{@release_notes.inspect}, restoration:"\
  " #{@restoration.inspect}, title: #{@title.inspect}, updated_date: #{@updated_date.inspect},"\
  " versions: #{@versions.inspect}, workaround: #{@workaround.inspect}, workaround_provided:"\
  " #{@workaround_provided.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



175
176
177
178
179
180
181
182
# File 'lib/mist_api/models/jsi_pbn_item.rb', line 175

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} bug_type: #{@bug_type}, customer_risk: #{@customer_risk}, fixed_in:"\
  " #{@fixed_in}, id: #{@id}, introduced_in: #{@introduced_in}, models: #{@models},"\
  " product_family: #{@product_family}, release_notes: #{@release_notes}, restoration:"\
  " #{@restoration}, title: #{@title}, updated_date: #{@updated_date}, versions: #{@versions},"\
  " workaround: #{@workaround}, workaround_provided: #{@workaround_provided}>"
end