Class: AWSCDK::CustomerProfiles::CfnCalculatedAttributeDefinition::RangeProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
customer_profiles/cfn_calculated_attribute_definition.rb

Overview

The relative time period over which data is included in the aggregation.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(unit:, timestamp_format: nil, timestamp_source: nil, value: nil, value_range: nil) ⇒ RangeProperty

Returns a new instance of RangeProperty.

Parameters:

  • unit (String)

    The unit of time.

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

    The format the timestamp field in your JSON object is specified.

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

    An expression specifying the field in your JSON object from which the date should be parsed.

  • value (Numeric, nil) (defaults to: nil)

    The amount of time of the specified unit.

  • value_range (AWSCDK::IResolvable, AWSCDK::CustomerProfiles::CfnCalculatedAttributeDefinition::ValueRangeProperty, nil) (defaults to: nil)

    A structure letting customers specify a relative time window over which over which data is included in the Calculated Attribute.



775
776
777
778
779
780
781
782
783
784
785
786
# File 'customer_profiles/cfn_calculated_attribute_definition.rb', line 775

def initialize(unit:, timestamp_format: nil, timestamp_source: nil, value: nil, value_range: nil)
  @unit = unit
  Jsii::Type.check_type(@unit, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "unit")
  @timestamp_format = timestamp_format
  Jsii::Type.check_type(@timestamp_format, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "timestampFormat") unless @timestamp_format.nil?
  @timestamp_source = timestamp_source
  Jsii::Type.check_type(@timestamp_source, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "timestampSource") unless @timestamp_source.nil?
  @value = value
  Jsii::Type.check_type(@value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "value") unless @value.nil?
  @value_range = value_range.is_a?(Hash) ? ::AWSCDK::CustomerProfiles::CfnCalculatedAttributeDefinition::ValueRangeProperty.new(**value_range.transform_keys(&:to_sym)) : value_range
  Jsii::Type.check_type(@value_range, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jdXN0b21lcnByb2ZpbGVzLkNmbkNhbGN1bGF0ZWRBdHRyaWJ1dGVEZWZpbml0aW9uLlZhbHVlUmFuZ2VQcm9wZXJ0eSJ9XX19")), "valueRange") unless @value_range.nil?
end

Instance Attribute Details

#timestamp_formatString? (readonly)

The format the timestamp field in your JSON object is specified.

This value should be one of EPOCHMILLI (for Unix epoch timestamps with second/millisecond level precision) or ISO_8601 (following ISO_8601 format with second/millisecond level precision, with an optional offset of Z or in the format HH:MM or HHMM.). E.g. if your object type is MyType and source JSON is {"timestamp": "2001-07-04T12:08:56.235-0700"}, then TimestampFormat should be "ISO_8601"



799
800
801
# File 'customer_profiles/cfn_calculated_attribute_definition.rb', line 799

def timestamp_format
  @timestamp_format
end

#timestamp_sourceString? (readonly)

An expression specifying the field in your JSON object from which the date should be parsed.

The expression should follow the structure of "of timestamp field in JSON pointer format>". E.g. if your object type is MyType and source JSON is {"timestamp": "1737587945945"}, then TimestampSource should be "MyType.generatedAt.timestamp"



806
807
808
# File 'customer_profiles/cfn_calculated_attribute_definition.rb', line 806

def timestamp_source
  @timestamp_source
end

#unitString (readonly)

The unit of time.



792
793
794
# File 'customer_profiles/cfn_calculated_attribute_definition.rb', line 792

def unit
  @unit
end

#valueNumeric? (readonly)

The amount of time of the specified unit.



811
812
813
# File 'customer_profiles/cfn_calculated_attribute_definition.rb', line 811

def value
  @value
end

#value_rangeAWSCDK::IResolvable, ... (readonly)

A structure letting customers specify a relative time window over which over which data is included in the Calculated Attribute.

Use positive numbers to indicate that the endpoint is in the past, and negative numbers to indicate it is in the future. ValueRange overrides Value.



818
819
820
# File 'customer_profiles/cfn_calculated_attribute_definition.rb', line 818

def value_range
  @value_range
end

Class Method Details

.jsii_propertiesObject



820
821
822
823
824
825
826
827
828
# File 'customer_profiles/cfn_calculated_attribute_definition.rb', line 820

def self.jsii_properties
  {
    :unit => "unit",
    :timestamp_format => "timestampFormat",
    :timestamp_source => "timestampSource",
    :value => "value",
    :value_range => "valueRange",
  }
end

Instance Method Details

#to_jsiiObject



830
831
832
833
834
835
836
837
838
839
840
# File 'customer_profiles/cfn_calculated_attribute_definition.rb', line 830

def to_jsii
  result = {}
  result.merge!({
    "unit" => @unit,
    "timestampFormat" => @timestamp_format,
    "timestampSource" => @timestamp_source,
    "value" => @value,
    "valueRange" => @value_range,
  })
  result.compact
end