Class: AWSCDK::CloudAssemblySchema::PolicyViolationJson
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::CloudAssemblySchema::PolicyViolationJson
- Defined in:
- cloud_assembly_schema/policy_violation_json.rb
Overview
A single policy violation found by a validation plugin.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#custom_severity ⇒ String?
readonly
If the plugin wants to report using a non-standard severity, put it here.
-
#description ⇒ String
readonly
A description of the violation.
-
#rule_metadata ⇒ Hash{String => String}?
readonly
Additional rule-specific metadata.
-
#rule_name ⇒ String
readonly
The name of the rule that was violated.
-
#severity ⇒ String
readonly
The severity of the violation.
-
#suggested_fix ⇒ String?
readonly
How to fix the violation.
-
#violating_constructs ⇒ Array<AWSCDK::CloudAssemblySchema::ViolatingConstructJson>
readonly
Constructs that violated the rule.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(description:, rule_name:, severity:, violating_constructs:, custom_severity: nil, rule_metadata: nil, suggested_fix: nil) ⇒ PolicyViolationJson
constructor
A new instance of PolicyViolationJson.
- #to_jsii ⇒ Object
Constructor Details
#initialize(description:, rule_name:, severity:, violating_constructs:, custom_severity: nil, rule_metadata: nil, suggested_fix: nil) ⇒ PolicyViolationJson
Returns a new instance of PolicyViolationJson.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'cloud_assembly_schema/policy_violation_json.rb', line 25 def initialize(description:, rule_name:, severity:, violating_constructs:, custom_severity: nil, rule_metadata: nil, suggested_fix: nil) @description = description Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") @rule_name = rule_name Jsii::Type.check_type(@rule_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "ruleName") @severity = severity Jsii::Type.check_type(@severity, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "severity") @violating_constructs = violating_constructs.is_a?(Array) ? violating_constructs.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CloudAssemblySchema::ViolatingConstructJson.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : violating_constructs Jsii::Type.check_type(@violating_constructs, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmNsb3VkX2Fzc2VtYmx5X3NjaGVtYS5WaW9sYXRpbmdDb25zdHJ1Y3RKc29uIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "violatingConstructs") @custom_severity = custom_severity Jsii::Type.check_type(@custom_severity, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "customSeverity") unless @custom_severity.nil? @rule_metadata = Jsii::Type.check_type(@rule_metadata, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "ruleMetadata") unless @rule_metadata.nil? @suggested_fix = suggested_fix Jsii::Type.check_type(@suggested_fix, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "suggestedFix") unless @suggested_fix.nil? end |
Instance Attribute Details
#custom_severity ⇒ String? (readonly)
If the plugin wants to report using a non-standard severity, put it here.
61 62 63 |
# File 'cloud_assembly_schema/policy_violation_json.rb', line 61 def custom_severity @custom_severity end |
#description ⇒ String (readonly)
A description of the violation.
45 46 47 |
# File 'cloud_assembly_schema/policy_violation_json.rb', line 45 def description @description end |
#rule_metadata ⇒ Hash{String => String}? (readonly)
Note:
Default: - no metadata
Additional rule-specific metadata.
66 67 68 |
# File 'cloud_assembly_schema/policy_violation_json.rb', line 66 def @rule_metadata end |
#rule_name ⇒ String (readonly)
The name of the rule that was violated.
49 50 51 |
# File 'cloud_assembly_schema/policy_violation_json.rb', line 49 def rule_name @rule_name end |
#severity ⇒ String (readonly)
The severity of the violation.
53 54 55 |
# File 'cloud_assembly_schema/policy_violation_json.rb', line 53 def severity @severity end |
#suggested_fix ⇒ String? (readonly)
Note:
Default: - no fix provided
How to fix the violation.
71 72 73 |
# File 'cloud_assembly_schema/policy_violation_json.rb', line 71 def suggested_fix @suggested_fix end |
#violating_constructs ⇒ Array<AWSCDK::CloudAssemblySchema::ViolatingConstructJson> (readonly)
Constructs that violated the rule.
57 58 59 |
# File 'cloud_assembly_schema/policy_violation_json.rb', line 57 def violating_constructs @violating_constructs end |
Class Method Details
.jsii_properties ⇒ Object
73 74 75 76 77 78 79 80 81 82 83 |
# File 'cloud_assembly_schema/policy_violation_json.rb', line 73 def self.jsii_properties { :description => "description", :rule_name => "ruleName", :severity => "severity", :violating_constructs => "violatingConstructs", :custom_severity => "customSeverity", :rule_metadata => "ruleMetadata", :suggested_fix => "suggestedFix", } end |
Instance Method Details
#to_jsii ⇒ Object
85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'cloud_assembly_schema/policy_violation_json.rb', line 85 def to_jsii result = {} result.merge!({ "description" => @description, "ruleName" => @rule_name, "severity" => @severity, "violatingConstructs" => @violating_constructs, "customSeverity" => @custom_severity, "ruleMetadata" => @rule_metadata, "suggestedFix" => @suggested_fix, }) result.compact end |