Class: Sarif::ExternalPropertyFileReferences

Inherits:
Object
  • Object
show all
Defined in:
lib/sarif/external_property_file_references.rb

Overview

References to external property files that should be inlined with the content of a root log file.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(conversion: nil, graphs: [], externalized_properties: nil, artifacts: [], invocations: [], logical_locations: [], thread_flow_locations: [], results: [], taxonomies: [], addresses: [], driver: nil, extensions: [], policies: [], translations: [], web_requests: [], web_responses: [], properties: nil) ⇒ ExternalPropertyFileReferences

Returns a new instance of ExternalPropertyFileReferences.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/sarif/external_property_file_references.rb', line 8

def initialize(conversion: nil, graphs: [], externalized_properties: nil, artifacts: [], invocations: [], logical_locations: [], thread_flow_locations: [], results: [], taxonomies: [], addresses: [], driver: nil, extensions: [], policies: [], translations: [], web_requests: [], web_responses: [], properties: nil)
  @conversion = conversion
  @graphs = graphs
  @externalized_properties = externalized_properties
  @artifacts = artifacts
  @invocations = invocations
  @logical_locations = logical_locations
  @thread_flow_locations = thread_flow_locations
  @results = results
  @taxonomies = taxonomies
  @addresses = addresses
  @driver = driver
  @extensions = extensions
  @policies = policies
  @translations = translations
  @web_requests = web_requests
  @web_responses = web_responses
  @properties = properties
end

Instance Attribute Details

#addressesObject

Returns the value of attribute addresses.



6
7
8
# File 'lib/sarif/external_property_file_references.rb', line 6

def addresses
  @addresses
end

#artifactsObject

Returns the value of attribute artifacts.



6
7
8
# File 'lib/sarif/external_property_file_references.rb', line 6

def artifacts
  @artifacts
end

#conversionObject

Returns the value of attribute conversion.



6
7
8
# File 'lib/sarif/external_property_file_references.rb', line 6

def conversion
  @conversion
end

#driverObject

Returns the value of attribute driver.



6
7
8
# File 'lib/sarif/external_property_file_references.rb', line 6

def driver
  @driver
end

#extensionsObject

Returns the value of attribute extensions.



6
7
8
# File 'lib/sarif/external_property_file_references.rb', line 6

def extensions
  @extensions
end

#externalized_propertiesObject

Returns the value of attribute externalized_properties.



6
7
8
# File 'lib/sarif/external_property_file_references.rb', line 6

def externalized_properties
  @externalized_properties
end

#graphsObject

Returns the value of attribute graphs.



6
7
8
# File 'lib/sarif/external_property_file_references.rb', line 6

def graphs
  @graphs
end

#invocationsObject

Returns the value of attribute invocations.



6
7
8
# File 'lib/sarif/external_property_file_references.rb', line 6

def invocations
  @invocations
end

#logical_locationsObject

Returns the value of attribute logical_locations.



6
7
8
# File 'lib/sarif/external_property_file_references.rb', line 6

def logical_locations
  @logical_locations
end

#policiesObject

Returns the value of attribute policies.



6
7
8
# File 'lib/sarif/external_property_file_references.rb', line 6

def policies
  @policies
end

#propertiesObject

Returns the value of attribute properties.



6
7
8
# File 'lib/sarif/external_property_file_references.rb', line 6

def properties
  @properties
end

#resultsObject

Returns the value of attribute results.



6
7
8
# File 'lib/sarif/external_property_file_references.rb', line 6

def results
  @results
end

#taxonomiesObject

Returns the value of attribute taxonomies.



6
7
8
# File 'lib/sarif/external_property_file_references.rb', line 6

def taxonomies
  @taxonomies
end

#thread_flow_locationsObject

Returns the value of attribute thread_flow_locations.



6
7
8
# File 'lib/sarif/external_property_file_references.rb', line 6

def thread_flow_locations
  @thread_flow_locations
end

#translationsObject

Returns the value of attribute translations.



6
7
8
# File 'lib/sarif/external_property_file_references.rb', line 6

def translations
  @translations
end

#web_requestsObject

Returns the value of attribute web_requests.



6
7
8
# File 'lib/sarif/external_property_file_references.rb', line 6

def web_requests
  @web_requests
end

#web_responsesObject

Returns the value of attribute web_responses.



6
7
8
# File 'lib/sarif/external_property_file_references.rb', line 6

def web_responses
  @web_responses
end

Class Method Details

.from_hash(h) ⇒ Object



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/sarif/external_property_file_references.rb', line 54

def self.from_hash(h)
  return nil if h.nil?
  new(
    conversion: ExternalPropertyFileReference.from_hash(h["conversion"]),
    graphs: h["graphs"]&.map { |v| ExternalPropertyFileReference.from_hash(v) } || [],
    externalized_properties: ExternalPropertyFileReference.from_hash(h["externalizedProperties"]),
    artifacts: h["artifacts"]&.map { |v| ExternalPropertyFileReference.from_hash(v) } || [],
    invocations: h["invocations"]&.map { |v| ExternalPropertyFileReference.from_hash(v) } || [],
    logical_locations: h["logicalLocations"]&.map { |v| ExternalPropertyFileReference.from_hash(v) } || [],
    thread_flow_locations: h["threadFlowLocations"]&.map { |v| ExternalPropertyFileReference.from_hash(v) } || [],
    results: h["results"]&.map { |v| ExternalPropertyFileReference.from_hash(v) } || [],
    taxonomies: h["taxonomies"]&.map { |v| ExternalPropertyFileReference.from_hash(v) } || [],
    addresses: h["addresses"]&.map { |v| ExternalPropertyFileReference.from_hash(v) } || [],
    driver: ExternalPropertyFileReference.from_hash(h["driver"]),
    extensions: h["extensions"]&.map { |v| ExternalPropertyFileReference.from_hash(v) } || [],
    policies: h["policies"]&.map { |v| ExternalPropertyFileReference.from_hash(v) } || [],
    translations: h["translations"]&.map { |v| ExternalPropertyFileReference.from_hash(v) } || [],
    web_requests: h["webRequests"]&.map { |v| ExternalPropertyFileReference.from_hash(v) } || [],
    web_responses: h["webResponses"]&.map { |v| ExternalPropertyFileReference.from_hash(v) } || [],
    properties: h["properties"]
  )
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



77
78
79
80
# File 'lib/sarif/external_property_file_references.rb', line 77

def ==(other)
  return false unless other.is_a?(ExternalPropertyFileReferences)
  @conversion == other.conversion && @graphs == other.graphs && @externalized_properties == other.externalized_properties && @artifacts == other.artifacts && @invocations == other.invocations && @logical_locations == other.logical_locations && @thread_flow_locations == other.thread_flow_locations && @results == other.results && @taxonomies == other.taxonomies && @addresses == other.addresses && @driver == other.driver && @extensions == other.extensions && @policies == other.policies && @translations == other.translations && @web_requests == other.web_requests && @web_responses == other.web_responses && @properties == other.properties
end

#hashObject



84
85
86
# File 'lib/sarif/external_property_file_references.rb', line 84

def hash
  [@conversion, @graphs, @externalized_properties, @artifacts, @invocations, @logical_locations, @thread_flow_locations, @results, @taxonomies, @addresses, @driver, @extensions, @policies, @translations, @web_requests, @web_responses, @properties].hash
end

#to_hObject



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/sarif/external_property_file_references.rb', line 28

def to_h
  h = {}
  h["conversion"] = @conversion&.to_h unless @conversion.nil?
  h["graphs"] = @graphs&.map(&:to_h) if @graphs&.any?
  h["externalizedProperties"] = @externalized_properties&.to_h unless @externalized_properties.nil?
  h["artifacts"] = @artifacts&.map(&:to_h) if @artifacts&.any?
  h["invocations"] = @invocations&.map(&:to_h) if @invocations&.any?
  h["logicalLocations"] = @logical_locations&.map(&:to_h) if @logical_locations&.any?
  h["threadFlowLocations"] = @thread_flow_locations&.map(&:to_h) if @thread_flow_locations&.any?
  h["results"] = @results&.map(&:to_h) if @results&.any?
  h["taxonomies"] = @taxonomies&.map(&:to_h) if @taxonomies&.any?
  h["addresses"] = @addresses&.map(&:to_h) if @addresses&.any?
  h["driver"] = @driver&.to_h unless @driver.nil?
  h["extensions"] = @extensions&.map(&:to_h) if @extensions&.any?
  h["policies"] = @policies&.map(&:to_h) if @policies&.any?
  h["translations"] = @translations&.map(&:to_h) if @translations&.any?
  h["webRequests"] = @web_requests&.map(&:to_h) if @web_requests&.any?
  h["webResponses"] = @web_responses&.map(&:to_h) if @web_responses&.any?
  h["properties"] = @properties unless @properties.nil?
  h
end

#to_json(pretty: false) ⇒ Object



50
51
52
# File 'lib/sarif/external_property_file_references.rb', line 50

def to_json(pretty: false)
  pretty ? JSON.pretty_generate(to_h) : JSON.generate(to_h)
end