Class: AWSCDK::Logs::DateTimeConverterProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Logs::DateTimeConverterProperty
- Defined in:
- logs/date_time_converter_property.rb
Overview
This processor converts a datetime string into a format that you specify.
For more information about this processor including examples, see datetimeConverter in the CloudWatch Logs User Guide.
Instance Attribute Summary collapse
-
#locale ⇒ String
readonly
The locale of the source field.
-
#match_patterns ⇒ Array<String>
readonly
A list of patterns to match against the source field.
-
#source ⇒ String
readonly
The key to apply the date conversion to.
-
#source_timezone ⇒ String?
readonly
The time zone of the source field.
-
#target ⇒ String
readonly
The JSON field to store the result in.
-
#target_format ⇒ String?
readonly
The datetime format to use for the converted data in the target field.
-
#target_timezone ⇒ String?
readonly
The time zone of the target field.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(locale:, match_patterns:, source:, target:, source_timezone: nil, target_format: nil, target_timezone: nil) ⇒ DateTimeConverterProperty
constructor
A new instance of DateTimeConverterProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(locale:, match_patterns:, source:, target:, source_timezone: nil, target_format: nil, target_timezone: nil) ⇒ DateTimeConverterProperty
Returns a new instance of DateTimeConverterProperty.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'logs/date_time_converter_property.rb', line 16 def initialize(locale:, match_patterns:, source:, target:, source_timezone: nil, target_format: nil, target_timezone: nil) @locale = locale Jsii::Type.check_type(@locale, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "locale") @match_patterns = match_patterns Jsii::Type.check_type(@match_patterns, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "matchPatterns") @source = source Jsii::Type.check_type(@source, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "source") @target = target Jsii::Type.check_type(@target, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "target") @source_timezone = source_timezone Jsii::Type.check_type(@source_timezone, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "sourceTimezone") unless @source_timezone.nil? @target_format = target_format Jsii::Type.check_type(@target_format, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "targetFormat") unless @target_format.nil? @target_timezone = target_timezone Jsii::Type.check_type(@target_timezone, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "targetTimezone") unless @target_timezone.nil? end |
Instance Attribute Details
#locale ⇒ String (readonly)
The locale of the source field.
36 37 38 |
# File 'logs/date_time_converter_property.rb', line 36 def locale @locale end |
#match_patterns ⇒ Array<String> (readonly)
A list of patterns to match against the source field.
40 41 42 |
# File 'logs/date_time_converter_property.rb', line 40 def match_patterns @match_patterns end |
#source ⇒ String (readonly)
The key to apply the date conversion to.
44 45 46 |
# File 'logs/date_time_converter_property.rb', line 44 def source @source end |
#source_timezone ⇒ String? (readonly)
Default: UTC
The time zone of the source field.
53 54 55 |
# File 'logs/date_time_converter_property.rb', line 53 def source_timezone @source_timezone end |
#target ⇒ String (readonly)
The JSON field to store the result in.
48 49 50 |
# File 'logs/date_time_converter_property.rb', line 48 def target @target end |
#target_format ⇒ String? (readonly)
Default: "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"
The datetime format to use for the converted data in the target field.
58 59 60 |
# File 'logs/date_time_converter_property.rb', line 58 def target_format @target_format end |
#target_timezone ⇒ String? (readonly)
Default: UTC
The time zone of the target field.
63 64 65 |
# File 'logs/date_time_converter_property.rb', line 63 def target_timezone @target_timezone end |
Class Method Details
.jsii_properties ⇒ Object
65 66 67 68 69 70 71 72 73 74 75 |
# File 'logs/date_time_converter_property.rb', line 65 def self.jsii_properties { :locale => "locale", :match_patterns => "matchPatterns", :source => "source", :target => "target", :source_timezone => "sourceTimezone", :target_format => "targetFormat", :target_timezone => "targetTimezone", } end |
Instance Method Details
#to_jsii ⇒ Object
77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'logs/date_time_converter_property.rb', line 77 def to_jsii result = {} result.merge!({ "locale" => @locale, "matchPatterns" => @match_patterns, "source" => @source, "target" => @target, "sourceTimezone" => @source_timezone, "targetFormat" => @target_format, "targetTimezone" => @target_timezone, }) result.compact end |