Class: AWSCDK::Tag

Inherits:
Jsii::Object
  • Object
show all
Includes:
IAspect
Defined in:
tag.rb

Overview

The Tag Aspect will handle adding a tag to this node and cascading tags to children.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, value, props = nil) ⇒ Tag

Returns a new instance of Tag.

Parameters:

  • key (String)

    The string key for the tag.

  • value (String)
  • props (AWSCDK::TagProps, nil) (defaults to: nil)


12
13
14
15
16
17
18
# File 'tag.rb', line 12

def initialize(key, value, props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::TagProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "key")
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "value")
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5UYWdQcm9wcyJ9")), "props") unless props.nil?
  Jsii::Object.instance_method(:initialize).bind(self).call(key, value, props)
end

Class Method Details

.jsii_overridable_methodsObject



20
21
22
23
24
25
26
27
28
29
# File 'tag.rb', line 20

def self.jsii_overridable_methods
  {
    :key => { kind: :property, name: "key", is_optional: false },
    :props => { kind: :property, name: "props", is_optional: false },
    :value => { kind: :property, name: "value", is_optional: false },
    :apply_tag => { kind: :method, name: "applyTag", is_optional: false },
    :apply_tag_v2 => { kind: :method, name: "applyTagV2", is_optional: false },
    :visit => { kind: :method, name: "visit", is_optional: false },
  }
end

Instance Method Details

#apply_tag(resource) ⇒ void

This method returns an undefined value.

Parameters:



52
53
54
55
# File 'tag.rb', line 52

def apply_tag(resource)
  Jsii::Type.check_type(resource, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5JVGFnZ2FibGUifQ==")), "resource")
  jsii_call_method("applyTag", [resource])
end

#apply_tag_v2(resource) ⇒ void

This method returns an undefined value.

Parameters:



59
60
61
62
# File 'tag.rb', line 59

def apply_tag_v2(resource)
  Jsii::Type.check_type(resource, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5JVGFnZ2FibGVWMiJ9")), "resource")
  jsii_call_method("applyTagV2", [resource])
end

#keyString

The string key for the tag.

Returns:

  • (String)


34
35
36
# File 'tag.rb', line 34

def key()
  jsii_get_property("key")
end

#propsAWSCDK::TagProps

Returns:



39
40
41
# File 'tag.rb', line 39

def props()
  jsii_get_property("props")
end

#valueString

The string value of the tag.

Returns:

  • (String)


46
47
48
# File 'tag.rb', line 46

def value()
  jsii_get_property("value")
end

#visit(construct) ⇒ void

This method returns an undefined value.

All aspects can visit an IConstruct.

Parameters:

  • construct (Constructs::IConstruct)


68
69
70
71
# File 'tag.rb', line 68

def visit(construct)
  Jsii::Type.check_type(construct, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklDb25zdHJ1Y3QifQ==")), "construct")
  jsii_call_method("visit", [construct])
end