Class: SemgrepWebApp::ProtosScaV1SbomFormatVersion
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- SemgrepWebApp::ProtosScaV1SbomFormatVersion
- Defined in:
- lib/semgrep_web_app/models/protos_sca_v1_sbom_format_version.rb
Overview
ProtosScaV1SbomFormatVersion Model.
Instance Attribute Summary collapse
-
#cyclonedx_version ⇒ CyclonedxVersion
CycloneDX schema version for the SBOM export.
-
#format ⇒ Format
Format for the SBOM export.
-
#version ⇒ String
Deprecated.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(cyclonedx_version: SKIP, format: Format::SBOM_FORMAT_CYCLONEDX, version: SKIP, additional_properties: nil) ⇒ ProtosScaV1SbomFormatVersion
constructor
A new instance of ProtosScaV1SbomFormatVersion.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(cyclonedx_version: SKIP, format: Format::SBOM_FORMAT_CYCLONEDX, version: SKIP, additional_properties: nil) ⇒ ProtosScaV1SbomFormatVersion
Returns a new instance of ProtosScaV1SbomFormatVersion.
58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/semgrep_web_app/models/protos_sca_v1_sbom_format_version.rb', line 58 def initialize(cyclonedx_version: SKIP, format: Format::SBOM_FORMAT_CYCLONEDX, version: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @cyclonedx_version = cyclonedx_version unless cyclonedx_version == SKIP @format = format unless format == SKIP @version = version unless version == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#cyclonedx_version ⇒ CyclonedxVersion
CycloneDX schema version for the SBOM export. Supported: 1.4, 1.5, 1.6, 1.7. Defaults to 1.4 when unset.
| value | description |
|---|---|
| SBOM_CYCLONE_DX_VERSION_V1_4 | |
| SBOM_CYCLONE_DX_VERSION_V1_5 | |
| SBOM_CYCLONE_DX_VERSION_V1_6 | |
| SBOM_CYCLONE_DX_VERSION_V1_7 |
21 22 23 |
# File 'lib/semgrep_web_app/models/protos_sca_v1_sbom_format_version.rb', line 21 def cyclonedx_version @cyclonedx_version end |
#format ⇒ Format
Format for the SBOM export.
| value | description |
|---|---|
| SBOM_FORMAT_CYCLONEDX |
28 29 30 |
# File 'lib/semgrep_web_app/models/protos_sca_v1_sbom_format_version.rb', line 28 def format @format end |
#version ⇒ String
Deprecated. Use cyclonedx_version. Free-text CycloneDX version, e.g.
"1.7".
33 34 35 |
# File 'lib/semgrep_web_app/models/protos_sca_v1_sbom_format_version.rb', line 33 def version @version end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/semgrep_web_app/models/protos_sca_v1_sbom_format_version.rb', line 71 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. cyclonedx_version = hash.key?('cyclonedxVersion') ? hash['cyclonedxVersion'] : SKIP format = hash['format'] ||= Format::SBOM_FORMAT_CYCLONEDX version = hash.key?('version') ? hash['version'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. ProtosScaV1SbomFormatVersion.new(cyclonedx_version: cyclonedx_version, format: format, version: version, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
36 37 38 39 40 41 42 |
# File 'lib/semgrep_web_app/models/protos_sca_v1_sbom_format_version.rb', line 36 def self.names @_hash = {} if @_hash.nil? @_hash['cyclonedx_version'] = 'cyclonedxVersion' @_hash['format'] = 'format' @_hash['version'] = 'version' @_hash end |
.nullables ⇒ Object
An array for nullable fields
54 55 56 |
# File 'lib/semgrep_web_app/models/protos_sca_v1_sbom_format_version.rb', line 54 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
45 46 47 48 49 50 51 |
# File 'lib/semgrep_web_app/models/protos_sca_v1_sbom_format_version.rb', line 45 def self.optionals %w[ cyclonedx_version format version ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
102 103 104 105 106 107 |
# File 'lib/semgrep_web_app/models/protos_sca_v1_sbom_format_version.rb', line 102 def inspect class_name = self.class.name.split('::').last "<#{class_name} cyclonedx_version: #{@cyclonedx_version.inspect}, format:"\ " #{@format.inspect}, version: #{@version.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
95 96 97 98 99 |
# File 'lib/semgrep_web_app/models/protos_sca_v1_sbom_format_version.rb', line 95 def to_s class_name = self.class.name.split('::').last "<#{class_name} cyclonedx_version: #{@cyclonedx_version}, format: #{@format}, version:"\ " #{@version}, additional_properties: #{@additional_properties}>" end |