Class: AWSCDK::IoT::CfnPolicyProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
io_t/cfn_policy_props.rb

Overview

Properties for defining a CfnPolicy.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(policy_document:, policy_name: nil, tags: nil) ⇒ CfnPolicyProps

Returns a new instance of CfnPolicyProps.

Parameters:

  • policy_document (Object)

    The JSON document that describes the policy.

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

    The policy name.

  • tags (Array<AWSCDK::CfnTag>, nil) (defaults to: nil)


12
13
14
15
16
17
18
19
# File 'io_t/cfn_policy_props.rb', line 12

def initialize(policy_document:, policy_name: nil, tags: nil)
  @policy_document = policy_document
  Jsii::Type.check_type(@policy_document, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "policyDocument")
  @policy_name = policy_name
  Jsii::Type.check_type(@policy_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "policyName") unless @policy_name.nil?
  @tags = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil?
end

Instance Attribute Details

#policy_documentObject (readonly)

The JSON document that describes the policy.



25
26
27
# File 'io_t/cfn_policy_props.rb', line 25

def policy_document
  @policy_document
end

#policy_nameString? (readonly)

The policy name.



30
31
32
# File 'io_t/cfn_policy_props.rb', line 30

def policy_name
  @policy_name
end

#tagsArray<AWSCDK::CfnTag>? (readonly)



33
34
35
# File 'io_t/cfn_policy_props.rb', line 33

def tags
  @tags
end

Class Method Details

.jsii_propertiesObject



35
36
37
38
39
40
41
# File 'io_t/cfn_policy_props.rb', line 35

def self.jsii_properties
  {
    :policy_document => "policyDocument",
    :policy_name => "policyName",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



43
44
45
46
47
48
49
50
51
# File 'io_t/cfn_policy_props.rb', line 43

def to_jsii
  result = {}
  result.merge!({
    "policyDocument" => @policy_document,
    "policyName" => @policy_name,
    "tags" => @tags,
  })
  result.compact
end