Class: AWSCDK::Logs::StringMutatorProps

Inherits:
BaseProcessorProps
  • Object
show all
Defined in:
logs/string_mutator_props.rb

Overview

Properties for creating string mutator processors.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, lower_case_keys: nil, split_options: nil, substitute_options: nil, trim_keys: nil, upper_case_keys: nil) ⇒ StringMutatorProps

Returns a new instance of StringMutatorProps.

Parameters:

  • type (AWSCDK::Logs::StringMutatorType)

    The type of string mutation operation.

  • lower_case_keys (Array<String>, nil) (defaults to: nil)

    Keys for strings to convert to lowercase.

  • split_options (AWSCDK::Logs::SplitStringProperty, nil) (defaults to: nil)

    Options for string splitting.

  • substitute_options (AWSCDK::Logs::SubstituteStringProperty, nil) (defaults to: nil)

    Options for string substitution.

  • trim_keys (Array<String>, nil) (defaults to: nil)

    Keys for strings to trim.

  • upper_case_keys (Array<String>, nil) (defaults to: nil)

    Keys for strings to convert to uppercase.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'logs/string_mutator_props.rb', line 13

def initialize(type:, lower_case_keys: nil, split_options: nil, substitute_options: nil, trim_keys: nil, upper_case_keys: nil)
  @type = type
  Jsii::Type.check_type(@type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbG9ncy5TdHJpbmdNdXRhdG9yVHlwZSJ9")), "type")
  @lower_case_keys = lower_case_keys
  Jsii::Type.check_type(@lower_case_keys, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "lowerCaseKeys") unless @lower_case_keys.nil?
  @split_options = split_options.is_a?(Hash) ? ::AWSCDK::Logs::SplitStringProperty.new(**split_options.transform_keys(&:to_sym)) : split_options
  Jsii::Type.check_type(@split_options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbG9ncy5TcGxpdFN0cmluZ1Byb3BlcnR5In0=")), "splitOptions") unless @split_options.nil?
  @substitute_options = substitute_options.is_a?(Hash) ? ::AWSCDK::Logs::SubstituteStringProperty.new(**substitute_options.transform_keys(&:to_sym)) : substitute_options
  Jsii::Type.check_type(@substitute_options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbG9ncy5TdWJzdGl0dXRlU3RyaW5nUHJvcGVydHkifQ==")), "substituteOptions") unless @substitute_options.nil?
  @trim_keys = trim_keys
  Jsii::Type.check_type(@trim_keys, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "trimKeys") unless @trim_keys.nil?
  @upper_case_keys = upper_case_keys
  Jsii::Type.check_type(@upper_case_keys, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "upperCaseKeys") unless @upper_case_keys.nil?
end

Instance Attribute Details

#lower_case_keysArray<String>? (readonly)

Note:

Default: - No lowercase processor is created if props not set

Keys for strings to convert to lowercase.

Required when type is LOWER_CASE.

Returns:

  • (Array<String>, nil)


38
39
40
# File 'logs/string_mutator_props.rb', line 38

def lower_case_keys
  @lower_case_keys
end

#split_optionsAWSCDK::Logs::SplitStringProperty? (readonly)

Note:

Default: - No string splitting processor is created if props not set

Options for string splitting.

Required when type is SPLIT.



45
46
47
# File 'logs/string_mutator_props.rb', line 45

def split_options
  @split_options
end

#substitute_optionsAWSCDK::Logs::SubstituteStringProperty? (readonly)

Note:

Default: - No string substitution processor is created if props not set

Options for string substitution.

Required when type is SUBSTITUTE.



52
53
54
# File 'logs/string_mutator_props.rb', line 52

def substitute_options
  @substitute_options
end

#trim_keysArray<String>? (readonly)

Note:

Default: - No trim processor is created if props not set

Keys for strings to trim.

Required when type is TRIM.

Returns:

  • (Array<String>, nil)


59
60
61
# File 'logs/string_mutator_props.rb', line 59

def trim_keys
  @trim_keys
end

#typeAWSCDK::Logs::StringMutatorType (readonly)

The type of string mutation operation.



31
32
33
# File 'logs/string_mutator_props.rb', line 31

def type
  @type
end

#upper_case_keysArray<String>? (readonly)

Note:

Default: - No uppercase processor is created if props not set

Keys for strings to convert to uppercase.

Required when type is UPPER_CASE.

Returns:

  • (Array<String>, nil)


66
67
68
# File 'logs/string_mutator_props.rb', line 66

def upper_case_keys
  @upper_case_keys
end

Class Method Details

.jsii_propertiesObject



68
69
70
71
72
73
74
75
76
77
# File 'logs/string_mutator_props.rb', line 68

def self.jsii_properties
  {
    :type => "type",
    :lower_case_keys => "lowerCaseKeys",
    :split_options => "splitOptions",
    :substitute_options => "substituteOptions",
    :trim_keys => "trimKeys",
    :upper_case_keys => "upperCaseKeys",
  }
end

Instance Method Details

#to_jsiiObject



79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'logs/string_mutator_props.rb', line 79

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "type" => @type,
    "lowerCaseKeys" => @lower_case_keys,
    "splitOptions" => @split_options,
    "substituteOptions" => @substitute_options,
    "trimKeys" => @trim_keys,
    "upperCaseKeys" => @upper_case_keys,
  })
  result.compact
end