Class: AWSCDK::Logs::CfnTransformer::ListToMapProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Logs::CfnTransformer::ListToMapProperty
- Defined in:
- logs/cfn_transformer.rb
Overview
This processor takes a list of objects that contain key fields, and converts them into a map of target keys.
For more information about this processor including examples, see listToMap in the CloudWatch Logs User Guide .
Instance Attribute Summary collapse
-
#flatten ⇒ Boolean, ...
readonly
A Boolean value to indicate whether the list will be flattened into single items.
-
#flattened_element ⇒ String?
readonly
If you set
flattentotrue, useflattenedElementto specify which element,firstorlast, to keep. -
#key ⇒ String
readonly
The key of the field to be extracted as keys in the generated map.
-
#source ⇒ String
readonly
The key in the log event that has a list of objects that will be converted to a map.
-
#target ⇒ String?
readonly
The key of the field that will hold the generated map.
-
#value_key ⇒ String?
readonly
If this is specified, the values that you specify in this parameter will be extracted from the
sourceobjects and put into the values of the generated map.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(key:, source:, flatten: nil, flattened_element: nil, target: nil, value_key: nil) ⇒ ListToMapProperty
constructor
A new instance of ListToMapProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(key:, source:, flatten: nil, flattened_element: nil, target: nil, value_key: nil) ⇒ ListToMapProperty
Returns a new instance of ListToMapProperty.
970 971 972 973 974 975 976 977 978 979 980 981 982 983 |
# File 'logs/cfn_transformer.rb', line 970 def initialize(key:, source:, flatten: nil, flattened_element: nil, target: nil, value_key: nil) @key = key Jsii::Type.check_type(@key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "key") @source = source Jsii::Type.check_type(@source, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "source") @flatten = flatten Jsii::Type.check_type(@flatten, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "flatten") unless @flatten.nil? @flattened_element = flattened_element Jsii::Type.check_type(@flattened_element, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "flattenedElement") unless @flattened_element.nil? @target = target Jsii::Type.check_type(@target, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "target") unless @target.nil? @value_key = value_key Jsii::Type.check_type(@value_key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "valueKey") unless @value_key.nil? end |
Instance Attribute Details
#flatten ⇒ Boolean, ... (readonly)
A Boolean value to indicate whether the list will be flattened into single items.
Specify true to flatten the list. The default is false
1001 1002 1003 |
# File 'logs/cfn_transformer.rb', line 1001 def flatten @flatten end |
#flattened_element ⇒ String? (readonly)
If you set flatten to true , use flattenedElement to specify which element, first or last , to keep.
You must specify this parameter if flatten is true
1008 1009 1010 |
# File 'logs/cfn_transformer.rb', line 1008 def flattened_element @flattened_element end |
#key ⇒ String (readonly)
The key of the field to be extracted as keys in the generated map.
989 990 991 |
# File 'logs/cfn_transformer.rb', line 989 def key @key end |
#source ⇒ String (readonly)
The key in the log event that has a list of objects that will be converted to a map.
994 995 996 |
# File 'logs/cfn_transformer.rb', line 994 def source @source end |
#target ⇒ String? (readonly)
The key of the field that will hold the generated map.
1013 1014 1015 |
# File 'logs/cfn_transformer.rb', line 1013 def target @target end |
#value_key ⇒ String? (readonly)
If this is specified, the values that you specify in this parameter will be extracted from the source objects and put into the values of the generated map.
Otherwise, original objects in the source list will be put into the values of the generated map.
1020 1021 1022 |
# File 'logs/cfn_transformer.rb', line 1020 def value_key @value_key end |
Class Method Details
.jsii_properties ⇒ Object
1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 |
# File 'logs/cfn_transformer.rb', line 1022 def self.jsii_properties { :key => "key", :source => "source", :flatten => "flatten", :flattened_element => "flattenedElement", :target => "target", :value_key => "valueKey", } end |
Instance Method Details
#to_jsii ⇒ Object
1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 |
# File 'logs/cfn_transformer.rb', line 1033 def to_jsii result = {} result.merge!({ "key" => @key, "source" => @source, "flatten" => @flatten, "flattenedElement" => @flattened_element, "target" => @target, "valueKey" => @value_key, }) result.compact end |