Class: AWSCDK::IoTEvents::CfnDetectorModel::AssetPropertyTimestampProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
io_t_events/cfn_detector_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 .



782
783
784
785
786
787
# File 'io_t_events/cfn_detector_model.rb', line 782

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.



802
803
804
# File 'io_t_events/cfn_detector_model.rb', line 802

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.



795
796
797
# File 'io_t_events/cfn_detector_model.rb', line 795

def time_in_seconds
  @time_in_seconds
end

Class Method Details

.jsii_propertiesObject



804
805
806
807
808
809
# File 'io_t_events/cfn_detector_model.rb', line 804

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

Instance Method Details

#to_jsiiObject



811
812
813
814
815
816
817
818
# File 'io_t_events/cfn_detector_model.rb', line 811

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