Class: AWSCDK::IoT::CfnTopicRule::LocationActionProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
io_t/cfn_topic_rule.rb

Overview

Describes an action to send device location updates from an MQTT message to an Amazon Location tracker resource.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(device_id:, latitude:, longitude:, role_arn:, tracker_name:, timestamp: nil) ⇒ LocationActionProperty

Returns a new instance of LocationActionProperty.

Parameters:

  • device_id (String)

    The unique ID of the device providing the location data.

  • latitude (String)

    A string that evaluates to a double value that represents the latitude of the device's location.

  • longitude (String)

    A string that evaluates to a double value that represents the longitude of the device's location.

  • role_arn (String)

    The IAM role that grants permission to write to the Amazon Location resource.

  • tracker_name (String)

    The name of the tracker resource in Amazon Location in which the location is updated.

  • timestamp (AWSCDK::IResolvable, AWSCDK::IoT::CfnTopicRule::TimestampProperty, nil) (defaults to: nil)

    The time that the location data was sampled.



2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
# File 'io_t/cfn_topic_rule.rb', line 2125

def initialize(device_id:, latitude:, longitude:, role_arn:, tracker_name:, timestamp: nil)
  @device_id = device_id
  Jsii::Type.check_type(@device_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "deviceId")
  @latitude = latitude
  Jsii::Type.check_type(@latitude, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "latitude")
  @longitude = longitude
  Jsii::Type.check_type(@longitude, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "longitude")
  @role_arn = role_arn
  Jsii::Type.check_type(@role_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "roleArn")
  @tracker_name = tracker_name
  Jsii::Type.check_type(@tracker_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "trackerName")
  @timestamp = timestamp.is_a?(Hash) ? ::AWSCDK::IoT::CfnTopicRule::TimestampProperty.new(**timestamp.transform_keys(&:to_sym)) : timestamp
  Jsii::Type.check_type(@timestamp, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19pb3QuQ2ZuVG9waWNSdWxlLlRpbWVzdGFtcFByb3BlcnR5In1dfX0=")), "timestamp") unless @timestamp.nil?
end

Instance Attribute Details

#device_idString (readonly)

The unique ID of the device providing the location data.



2144
2145
2146
# File 'io_t/cfn_topic_rule.rb', line 2144

def device_id
  @device_id
end

#latitudeString (readonly)

A string that evaluates to a double value that represents the latitude of the device's location.



2149
2150
2151
# File 'io_t/cfn_topic_rule.rb', line 2149

def latitude
  @latitude
end

#longitudeString (readonly)

A string that evaluates to a double value that represents the longitude of the device's location.



2154
2155
2156
# File 'io_t/cfn_topic_rule.rb', line 2154

def longitude
  @longitude
end

#role_arnString (readonly)

The IAM role that grants permission to write to the Amazon Location resource.



2159
2160
2161
# File 'io_t/cfn_topic_rule.rb', line 2159

def role_arn
  @role_arn
end

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

The time that the location data was sampled.

The default value is the time the MQTT message was processed.



2171
2172
2173
# File 'io_t/cfn_topic_rule.rb', line 2171

def timestamp
  @timestamp
end

#tracker_nameString (readonly)

The name of the tracker resource in Amazon Location in which the location is updated.



2164
2165
2166
# File 'io_t/cfn_topic_rule.rb', line 2164

def tracker_name
  @tracker_name
end

Class Method Details

.jsii_propertiesObject



2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
# File 'io_t/cfn_topic_rule.rb', line 2173

def self.jsii_properties
  {
    :device_id => "deviceId",
    :latitude => "latitude",
    :longitude => "longitude",
    :role_arn => "roleArn",
    :tracker_name => "trackerName",
    :timestamp => "timestamp",
  }
end

Instance Method Details

#to_jsiiObject



2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
# File 'io_t/cfn_topic_rule.rb', line 2184

def to_jsii
  result = {}
  result.merge!({
    "deviceId" => @device_id,
    "latitude" => @latitude,
    "longitude" => @longitude,
    "roleArn" => @role_arn,
    "trackerName" => @tracker_name,
    "timestamp" => @timestamp,
  })
  result.compact
end