Class: MistApi::JsiSirtItem

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

Overview

SIRT 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(cvss_score = SKIP, id = SKIP, models = SKIP, problem = SKIP, published_date = SKIP, release_notes = SKIP, severity = SKIP, solution = SKIP, title = SKIP, updated_date = SKIP, versions = SKIP, workaround = SKIP) ⇒ JsiSirtItem

Returns a new instance of JsiSirtItem.



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/mist_api/models/jsi_sirt_item.rb', line 101

def initialize(cvss_score = SKIP, id = SKIP, models = SKIP, problem = SKIP,
               published_date = SKIP, release_notes = SKIP, severity = SKIP,
               solution = SKIP, title = SKIP, updated_date = SKIP,
               versions = SKIP, workaround = SKIP)
  @cvss_score = cvss_score unless cvss_score == SKIP
  @id = id unless id == SKIP
  @models = models unless models == SKIP
  @problem = problem unless problem == SKIP
  @published_date = published_date unless published_date == SKIP
  @release_notes = release_notes unless release_notes == SKIP
  @severity = severity unless severity == SKIP
  @solution = solution unless solution == SKIP
  @title = title unless title == SKIP
  @updated_date = updated_date unless updated_date == SKIP
  @versions = versions unless versions == SKIP
  @workaround = workaround unless workaround == SKIP
end

Instance Attribute Details

#cvss_scoreFloat

CVSS score

Returns:

  • (Float)


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

def cvss_score
  @cvss_score
end

#idString

ID of the SIRT

Returns:

  • (String)


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

def id
  @id
end

#modelsArray[String]

OS models affected

Returns:

  • (Array[String])


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

def models
  @models
end

#problemString

Problem description

Returns:

  • (String)


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

def problem
  @problem
end

#published_dateInteger

Release date of the SIRT issue

Returns:

  • (Integer)


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

def published_date
  @published_date
end

#release_notesString

Release notes if any

Returns:

  • (String)


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

def release_notes
  @release_notes
end

#severityString

Severity of the issue

Returns:

  • (String)


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

def severity
  @severity
end

#solutionString

Solution for the security issue

Returns:

  • (String)


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

def solution
  @solution
end

#titleString

Title of the SIRT

Returns:

  • (String)


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

def title
  @title
end

#updated_dateInteger

JSA updated timestamp

Returns:

  • (Integer)


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

def updated_date
  @updated_date
end

#versionsArray[String]

OS versions affected

Returns:

  • (Array[String])


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

def versions
  @versions
end

#workaroundString

Workaround provided

Returns:

  • (String)


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

def workaround
  @workaround
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/mist_api/models/jsi_sirt_item.rb', line 120

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  cvss_score = hash.key?('cvss_score') ? hash['cvss_score'] : SKIP
  id = hash.key?('id') ? hash['id'] : SKIP
  models = hash.key?('models') ? hash['models'] : SKIP
  problem = hash.key?('problem') ? hash['problem'] : SKIP
  published_date =
    hash.key?('published_date') ? hash['published_date'] : SKIP
  release_notes = hash.key?('release_notes') ? hash['release_notes'] : SKIP
  severity = hash.key?('severity') ? hash['severity'] : SKIP
  solution = hash.key?('solution') ? hash['solution'] : 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

  # Create object from extracted values.
  JsiSirtItem.new(cvss_score,
                  id,
                  models,
                  problem,
                  published_date,
                  release_notes,
                  severity,
                  solution,
                  title,
                  updated_date,
                  versions,
                  workaround)
end

.namesObject

A mapping from model property names to API property names.



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/mist_api/models/jsi_sirt_item.rb', line 61

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['cvss_score'] = 'cvss_score'
  @_hash['id'] = 'id'
  @_hash['models'] = 'models'
  @_hash['problem'] = 'problem'
  @_hash['published_date'] = 'published_date'
  @_hash['release_notes'] = 'release_notes'
  @_hash['severity'] = 'severity'
  @_hash['solution'] = 'solution'
  @_hash['title'] = 'title'
  @_hash['updated_date'] = 'updated_date'
  @_hash['versions'] = 'versions'
  @_hash['workaround'] = 'workaround'
  @_hash
end

.nullablesObject

An array for nullable fields



97
98
99
# File 'lib/mist_api/models/jsi_sirt_item.rb', line 97

def self.nullables
  []
end

.optionalsObject

An array for optional fields



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/mist_api/models/jsi_sirt_item.rb', line 79

def self.optionals
  %w[
    cvss_score
    id
    models
    problem
    published_date
    release_notes
    severity
    solution
    title
    updated_date
    versions
    workaround
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



163
164
165
166
167
168
169
170
171
# File 'lib/mist_api/models/jsi_sirt_item.rb', line 163

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} cvss_score: #{@cvss_score.inspect}, id: #{@id.inspect}, models:"\
  " #{@models.inspect}, problem: #{@problem.inspect}, published_date:"\
  " #{@published_date.inspect}, release_notes: #{@release_notes.inspect}, severity:"\
  " #{@severity.inspect}, solution: #{@solution.inspect}, title: #{@title.inspect},"\
  " updated_date: #{@updated_date.inspect}, versions: #{@versions.inspect}, workaround:"\
  " #{@workaround.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



154
155
156
157
158
159
160
# File 'lib/mist_api/models/jsi_sirt_item.rb', line 154

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} cvss_score: #{@cvss_score}, id: #{@id}, models: #{@models}, problem:"\
  " #{@problem}, published_date: #{@published_date}, release_notes: #{@release_notes},"\
  " severity: #{@severity}, solution: #{@solution}, title: #{@title}, updated_date:"\
  " #{@updated_date}, versions: #{@versions}, workaround: #{@workaround}>"
end