Class: AWSCDK::CloudAssemblySchema::DestroyCommand

Inherits:
CDKCommand
  • Object
show all
Defined in:
cloud_assembly_schema/destroy_command.rb

Overview

Represents a cdk destroy command.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(enabled: nil, expected_message: nil, expect_error: nil, args: nil) ⇒ DestroyCommand

Returns a new instance of DestroyCommand.

Parameters:

  • enabled (Boolean, nil) (defaults to: nil)

    Whether or not to run this command as part of the workflow This can be used if you only want to test some of the workflow for example enable synth and disable deploy & destroy in order to limit the test to synthesis.

  • expected_message (String, nil) (defaults to: nil)

    This can be used in combination with expectedError to validate that a specific message is returned.

  • expect_error (Boolean, nil) (defaults to: nil)

    If the runner should expect this command to fail.

  • args (AWSCDK::CloudAssemblySchema::DestroyOptions, nil) (defaults to: nil)

    Additional arguments to pass to the command This can be used to test specific CLI functionality.



11
12
13
14
15
16
17
18
19
20
# File 'cloud_assembly_schema/destroy_command.rb', line 11

def initialize(enabled: nil, expected_message: nil, expect_error: nil, args: nil)
  @enabled = enabled
  Jsii::Type.check_type(@enabled, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enabled") unless @enabled.nil?
  @expected_message = expected_message
  Jsii::Type.check_type(@expected_message, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "expectedMessage") unless @expected_message.nil?
  @expect_error = expect_error
  Jsii::Type.check_type(@expect_error, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "expectError") unless @expect_error.nil?
  @args = args.is_a?(Hash) ? ::AWSCDK::CloudAssemblySchema::DestroyOptions.new(**args.transform_keys(&:to_sym)) : args
  Jsii::Type.check_type(@args, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5jbG91ZF9hc3NlbWJseV9zY2hlbWEuRGVzdHJveU9wdGlvbnMifQ==")), "args") unless @args.nil?
end

Instance Attribute Details

#argsAWSCDK::CloudAssemblySchema::DestroyOptions? (readonly)

Note:

Default: - only default args are used

Additional arguments to pass to the command This can be used to test specific CLI functionality.



41
42
43
# File 'cloud_assembly_schema/destroy_command.rb', line 41

def args
  @args
end

#enabledBoolean? (readonly)

Note:

Default: true

Whether or not to run this command as part of the workflow This can be used if you only want to test some of the workflow for example enable synth and disable deploy & destroy in order to limit the test to synthesis.

Returns:

  • (Boolean, nil)


26
27
28
# File 'cloud_assembly_schema/destroy_command.rb', line 26

def enabled
  @enabled
end

#expect_errorBoolean? (readonly)

Note:

Default: false

If the runner should expect this command to fail.

Returns:

  • (Boolean, nil)


36
37
38
# File 'cloud_assembly_schema/destroy_command.rb', line 36

def expect_error
  @expect_error
end

#expected_messageString? (readonly)

Note:

Default: - do not validate message

This can be used in combination with expectedError to validate that a specific message is returned.

Returns:

  • (String, nil)


31
32
33
# File 'cloud_assembly_schema/destroy_command.rb', line 31

def expected_message
  @expected_message
end

Class Method Details

.jsii_propertiesObject



43
44
45
46
47
48
49
50
# File 'cloud_assembly_schema/destroy_command.rb', line 43

def self.jsii_properties
  {
    :enabled => "enabled",
    :expected_message => "expectedMessage",
    :expect_error => "expectError",
    :args => "args",
  }
end

Instance Method Details

#to_jsiiObject



52
53
54
55
56
57
58
59
60
61
62
# File 'cloud_assembly_schema/destroy_command.rb', line 52

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "enabled" => @enabled,
    "expectedMessage" => @expected_message,
    "expectError" => @expect_error,
    "args" => @args,
  })
  result.compact
end