Method: Falcon::DomainVulnerability#initialize

Defined in:
lib/crimson-falcon/models/domain_vulnerability.rb

#initialize(attributes = {}) ⇒ DomainVulnerability

Initializes the object

Parameters:

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

    Model attributes in the form of hash



130
131
132
133
134
135
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
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
# File 'lib/crimson-falcon/models/domain_vulnerability.rb', line 130

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

  if attributes.key?(:'community_identifiers')
    if (value = attributes[:'community_identifiers']).is_a?(Array)
      self.community_identifiers = value
    end
  end

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

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

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

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

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

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

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

  if attributes.key?(:'related_actors')
    if (value = attributes[:'related_actors']).is_a?(Array)
      self.related_actors = value
    end
  end

  if attributes.key?(:'related_reports')
    if (value = attributes[:'related_reports']).is_a?(Array)
      self.related_reports = value
    end
  end

  if attributes.key?(:'related_threats')
    if (value = attributes[:'related_threats']).is_a?(Array)
      self.related_threats = value
    end
  end

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

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