Class: AWSCDK::IoTEvents::CfnAlarmModel::AssetPropertyTimestampProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
io_t_events/cfn_alarm_model.rb

Overview

A structure that contains timestamp information. For more information, see TimeInNanos in the AWS IoT SiteWise API Reference .

You must use expressions for all parameters in AssetPropertyTimestamp . The expressions accept literals, operators, functions, references, and substitution templates.

Examples - For literal values, the expressions must contain single quotes. For example, the value for the time_in_seconds parameter can be '1586400675' .

  • For references, you must specify either variables or input values. For example, the value for the offset_in_nanos parameter can be $variable.time .
  • For a substitution template, you must use ${} , and the template must be in single quotes. A substitution template can also contain a combination of literals, operators, functions, references, and substitution templates.

In the following example, the value for the time_in_seconds parameter uses a substitution template.

'${$input.TemperatureInput.sensorData.timestamp / 1000}'

For more information, see Expressions in the AWS IoT Events Developer Guide .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(time_in_seconds:, offset_in_nanos: nil) ⇒ AssetPropertyTimestampProperty

Returns a new instance of AssetPropertyTimestampProperty.

Parameters:

  • time_in_seconds (String)

    The timestamp, in seconds, in the Unix epoch format.

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

    The nanosecond offset converted from timeInSeconds .



965
966
967
968
969
970
# File 'io_t_events/cfn_alarm_model.rb', line 965

def initialize(time_in_seconds:, offset_in_nanos: nil)
  @time_in_seconds = time_in_seconds
  Jsii::Type.check_type(@time_in_seconds, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "timeInSeconds")
  @offset_in_nanos = offset_in_nanos
  Jsii::Type.check_type(@offset_in_nanos, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "offsetInNanos") unless @offset_in_nanos.nil?
end

Instance Attribute Details

#offset_in_nanosString? (readonly)

The nanosecond offset converted from timeInSeconds .

The valid range is between 0-999999999.



985
986
987
# File 'io_t_events/cfn_alarm_model.rb', line 985

def offset_in_nanos
  @offset_in_nanos
end

#time_in_secondsString (readonly)

The timestamp, in seconds, in the Unix epoch format.

The valid range is between 1-31556889864403199.



978
979
980
# File 'io_t_events/cfn_alarm_model.rb', line 978

def time_in_seconds
  @time_in_seconds
end

Class Method Details

.jsii_propertiesObject



987
988
989
990
991
992
# File 'io_t_events/cfn_alarm_model.rb', line 987

def self.jsii_properties
  {
    :time_in_seconds => "timeInSeconds",
    :offset_in_nanos => "offsetInNanos",
  }
end

Instance Method Details

#to_jsiiObject



994
995
996
997
998
999
1000
1001
# File 'io_t_events/cfn_alarm_model.rb', line 994

def to_jsii
  result = {}
  result.merge!({
    "timeInSeconds" => @time_in_seconds,
    "offsetInNanos" => @offset_in_nanos,
  })
  result.compact
end