/* * 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.geo.model; import java.io.Serializable; import com.amazonaws.AmazonWebServiceRequest; /** *

* Evaluates device positions against the geofence geometries from a given * geofence collection. *

*

* This operation always returns an empty response because geofences are * asynchronously evaluated. The evaluation determines if the device has entered * or exited a geofenced area, and then publishes one of the following events to * Amazon EventBridge: *

* * *

* The last geofence that a device was observed within is tracked for 30 days * after the most recent device position update. *

*
*

* Geofence evaluation uses the given device position. It does not account for * the optional Accuracy of a DevicePositionUpdate. *

*
*

* The DeviceID is used as a string to represent the device. You do * not need to have a Tracker associated with the * DeviceID. *

*
*/ public class BatchEvaluateGeofencesRequest extends AmazonWebServiceRequest implements Serializable { /** *

* The geofence collection used in evaluating the position of devices * against its geofences. *

*

* Constraints:
* Length: 1 - 100
* Pattern: ^[-._\w]+$
*/ private String collectionName; /** *

* Contains device details for each device to be evaluated against the given * geofence collection. *

*/ private java.util.List devicePositionUpdates; /** *

* The geofence collection used in evaluating the position of devices * against its geofences. *

*

* Constraints:
* Length: 1 - 100
* Pattern: ^[-._\w]+$
* * @return

* The geofence collection used in evaluating the position of * devices against its geofences. *

*/ public String getCollectionName() { return collectionName; } /** *

* The geofence collection used in evaluating the position of devices * against its geofences. *

*

* Constraints:
* Length: 1 - 100
* Pattern: ^[-._\w]+$
* * @param collectionName

* The geofence collection used in evaluating the position of * devices against its geofences. *

*/ public void setCollectionName(String collectionName) { this.collectionName = collectionName; } /** *

* The geofence collection used in evaluating the position of devices * against its geofences. *

*

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

* Constraints:
* Length: 1 - 100
* Pattern: ^[-._\w]+$
* * @param collectionName

* The geofence collection used in evaluating the position of * devices against its geofences. *

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

* Contains device details for each device to be evaluated against the given * geofence collection. *

* * @return

* Contains device details for each device to be evaluated against * the given geofence collection. *

*/ public java.util.List getDevicePositionUpdates() { return devicePositionUpdates; } /** *

* Contains device details for each device to be evaluated against the given * geofence collection. *

* * @param devicePositionUpdates

* Contains device details for each device to be evaluated * against the given geofence collection. *

*/ public void setDevicePositionUpdates( java.util.Collection devicePositionUpdates) { if (devicePositionUpdates == null) { this.devicePositionUpdates = null; return; } this.devicePositionUpdates = new java.util.ArrayList( devicePositionUpdates); } /** *

* Contains device details for each device to be evaluated against the given * geofence collection. *

*

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

* Contains device details for each device to be evaluated * against the given geofence collection. *

* @return A reference to this updated object so that method calls can be * chained together. */ public BatchEvaluateGeofencesRequest withDevicePositionUpdates( DevicePositionUpdate... devicePositionUpdates) { if (getDevicePositionUpdates() == null) { this.devicePositionUpdates = new java.util.ArrayList( devicePositionUpdates.length); } for (DevicePositionUpdate value : devicePositionUpdates) { this.devicePositionUpdates.add(value); } return this; } /** *

* Contains device details for each device to be evaluated against the given * geofence collection. *

*

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

* Contains device details for each device to be evaluated * against the given geofence collection. *

* @return A reference to this updated object so that method calls can be * chained together. */ public BatchEvaluateGeofencesRequest withDevicePositionUpdates( java.util.Collection devicePositionUpdates) { setDevicePositionUpdates(devicePositionUpdates); 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 (getCollectionName() != null) sb.append("CollectionName: " + getCollectionName() + ","); if (getDevicePositionUpdates() != null) sb.append("DevicePositionUpdates: " + getDevicePositionUpdates()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getCollectionName() == null) ? 0 : getCollectionName().hashCode()); hashCode = prime * hashCode + ((getDevicePositionUpdates() == null) ? 0 : getDevicePositionUpdates().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof BatchEvaluateGeofencesRequest == false) return false; BatchEvaluateGeofencesRequest other = (BatchEvaluateGeofencesRequest) obj; if (other.getCollectionName() == null ^ this.getCollectionName() == null) return false; if (other.getCollectionName() != null && other.getCollectionName().equals(this.getCollectionName()) == false) return false; if (other.getDevicePositionUpdates() == null ^ this.getDevicePositionUpdates() == null) return false; if (other.getDevicePositionUpdates() != null && other.getDevicePositionUpdates().equals(this.getDevicePositionUpdates()) == false) return false; return true; } }