/* * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package com.amazonaws.services.iot.model; import java.io.Serializable; /** *

* The Amazon Location rule action sends device location updates from an MQTT * message to an Amazon Location tracker resource. *

*/ public class LocationAction implements Serializable { /** *

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

*/ private String roleArn; /** *

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

*/ private String trackerName; /** *

* The unique ID of the device providing the location data. *

*/ private String deviceId; /** *

* The time that the location data was sampled. The default value is the * time the MQTT message was processed. *

*/ private LocationTimestamp timestamp; /** *

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

*/ private String latitude; /** *

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

*/ private String longitude; /** *

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

* * @return

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

*/ public String getRoleArn() { return roleArn; } /** *

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

* * @param roleArn

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

*/ public void setRoleArn(String roleArn) { this.roleArn = roleArn; } /** *

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

*

* Returns a reference to this object so that method calls can be chained * together. * * @param roleArn

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

* @return A reference to this updated object so that method calls can be * chained together. */ public LocationAction withRoleArn(String roleArn) { this.roleArn = roleArn; return this; } /** *

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

* * @return

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

*/ public String getTrackerName() { return trackerName; } /** *

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

* * @param trackerName

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

*/ public void setTrackerName(String trackerName) { this.trackerName = trackerName; } /** *

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

*

* Returns a reference to this object so that method calls can be chained * together. * * @param trackerName

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

* @return A reference to this updated object so that method calls can be * chained together. */ public LocationAction withTrackerName(String trackerName) { this.trackerName = trackerName; return this; } /** *

* The unique ID of the device providing the location data. *

* * @return

* The unique ID of the device providing the location data. *

*/ public String getDeviceId() { return deviceId; } /** *

* The unique ID of the device providing the location data. *

* * @param deviceId

* The unique ID of the device providing the location data. *

*/ public void setDeviceId(String deviceId) { this.deviceId = deviceId; } /** *

* The unique ID of the device providing the location data. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param deviceId

* The unique ID of the device providing the location data. *

* @return A reference to this updated object so that method calls can be * chained together. */ public LocationAction withDeviceId(String deviceId) { this.deviceId = deviceId; return this; } /** *

* The time that the location data was sampled. The default value is the * time the MQTT message was processed. *

* * @return

* The time that the location data was sampled. The default value is * the time the MQTT message was processed. *

*/ public LocationTimestamp getTimestamp() { return timestamp; } /** *

* The time that the location data was sampled. The default value is the * time the MQTT message was processed. *

* * @param timestamp

* The time that the location data was sampled. The default value * is the time the MQTT message was processed. *

*/ public void setTimestamp(LocationTimestamp timestamp) { this.timestamp = timestamp; } /** *

* The time that the location data was sampled. The default value is the * time the MQTT message was processed. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param timestamp

* The time that the location data was sampled. The default value * is the time the MQTT message was processed. *

* @return A reference to this updated object so that method calls can be * chained together. */ public LocationAction withTimestamp(LocationTimestamp timestamp) { this.timestamp = timestamp; return this; } /** *

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

* * @return

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

*/ public String getLatitude() { return latitude; } /** *

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

* * @param latitude

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

*/ public void setLatitude(String latitude) { this.latitude = latitude; } /** *

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

*

* Returns a reference to this object so that method calls can be chained * together. * * @param latitude

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

* @return A reference to this updated object so that method calls can be * chained together. */ public LocationAction withLatitude(String latitude) { this.latitude = latitude; return this; } /** *

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

* * @return

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

*/ public String getLongitude() { return longitude; } /** *

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

* * @param longitude

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

*/ public void setLongitude(String longitude) { this.longitude = longitude; } /** *

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

*

* Returns a reference to this object so that method calls can be chained * together. * * @param longitude

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

* @return A reference to this updated object so that method calls can be * chained together. */ public LocationAction withLongitude(String longitude) { this.longitude = longitude; return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getRoleArn() != null) sb.append("roleArn: " + getRoleArn() + ","); if (getTrackerName() != null) sb.append("trackerName: " + getTrackerName() + ","); if (getDeviceId() != null) sb.append("deviceId: " + getDeviceId() + ","); if (getTimestamp() != null) sb.append("timestamp: " + getTimestamp() + ","); if (getLatitude() != null) sb.append("latitude: " + getLatitude() + ","); if (getLongitude() != null) sb.append("longitude: " + getLongitude()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getRoleArn() == null) ? 0 : getRoleArn().hashCode()); hashCode = prime * hashCode + ((getTrackerName() == null) ? 0 : getTrackerName().hashCode()); hashCode = prime * hashCode + ((getDeviceId() == null) ? 0 : getDeviceId().hashCode()); hashCode = prime * hashCode + ((getTimestamp() == null) ? 0 : getTimestamp().hashCode()); hashCode = prime * hashCode + ((getLatitude() == null) ? 0 : getLatitude().hashCode()); hashCode = prime * hashCode + ((getLongitude() == null) ? 0 : getLongitude().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof LocationAction == false) return false; LocationAction other = (LocationAction) obj; if (other.getRoleArn() == null ^ this.getRoleArn() == null) return false; if (other.getRoleArn() != null && other.getRoleArn().equals(this.getRoleArn()) == false) return false; if (other.getTrackerName() == null ^ this.getTrackerName() == null) return false; if (other.getTrackerName() != null && other.getTrackerName().equals(this.getTrackerName()) == false) return false; if (other.getDeviceId() == null ^ this.getDeviceId() == null) return false; if (other.getDeviceId() != null && other.getDeviceId().equals(this.getDeviceId()) == false) return false; if (other.getTimestamp() == null ^ this.getTimestamp() == null) return false; if (other.getTimestamp() != null && other.getTimestamp().equals(this.getTimestamp()) == false) return false; if (other.getLatitude() == null ^ this.getLatitude() == null) return false; if (other.getLatitude() != null && other.getLatitude().equals(this.getLatitude()) == false) return false; if (other.getLongitude() == null ^ this.getLongitude() == null) return false; if (other.getLongitude() != null && other.getLongitude().equals(this.getLongitude()) == false) return false; return true; } }