/* * Copyright 2018-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.iotfleetwise.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class CreateVehicleRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *

* The unique ID of the vehicle to create. *

*/ private String vehicleName; /** *

* The Amazon Resource Name ARN of a vehicle model. *

*/ private String modelManifestArn; /** *

* The ARN of a decoder manifest. *

*/ private String decoderManifestArn; /** *

* Static information about a vehicle in a key-value pair. For example: "engineType" : * "1.3 L R2" *

*

* A campaign must include the keys (attribute names) in dataExtraDimensions for them to display in * Amazon Timestream. *

*/ private java.util.Map attributes; /** *

* An option to create a new Amazon Web Services IoT thing when creating a vehicle, or to validate an existing * Amazon Web Services IoT thing as a vehicle. *

*

* Default: *

*/ private String associationBehavior; /** *

* Metadata that can be used to manage the vehicle. *

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

* The unique ID of the vehicle to create. *

* * @param vehicleName * The unique ID of the vehicle to create. */ public void setVehicleName(String vehicleName) { this.vehicleName = vehicleName; } /** *

* The unique ID of the vehicle to create. *

* * @return The unique ID of the vehicle to create. */ public String getVehicleName() { return this.vehicleName; } /** *

* The unique ID of the vehicle to create. *

* * @param vehicleName * The unique ID of the vehicle to create. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateVehicleRequest withVehicleName(String vehicleName) { setVehicleName(vehicleName); return this; } /** *

* The Amazon Resource Name ARN of a vehicle model. *

* * @param modelManifestArn * The Amazon Resource Name ARN of a vehicle model. */ public void setModelManifestArn(String modelManifestArn) { this.modelManifestArn = modelManifestArn; } /** *

* The Amazon Resource Name ARN of a vehicle model. *

* * @return The Amazon Resource Name ARN of a vehicle model. */ public String getModelManifestArn() { return this.modelManifestArn; } /** *

* The Amazon Resource Name ARN of a vehicle model. *

* * @param modelManifestArn * The Amazon Resource Name ARN of a vehicle model. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateVehicleRequest withModelManifestArn(String modelManifestArn) { setModelManifestArn(modelManifestArn); return this; } /** *

* The ARN of a decoder manifest. *

* * @param decoderManifestArn * The ARN of a decoder manifest. */ public void setDecoderManifestArn(String decoderManifestArn) { this.decoderManifestArn = decoderManifestArn; } /** *

* The ARN of a decoder manifest. *

* * @return The ARN of a decoder manifest. */ public String getDecoderManifestArn() { return this.decoderManifestArn; } /** *

* The ARN of a decoder manifest. *

* * @param decoderManifestArn * The ARN of a decoder manifest. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateVehicleRequest withDecoderManifestArn(String decoderManifestArn) { setDecoderManifestArn(decoderManifestArn); return this; } /** *

* Static information about a vehicle in a key-value pair. For example: "engineType" : * "1.3 L R2" *

*

* A campaign must include the keys (attribute names) in dataExtraDimensions for them to display in * Amazon Timestream. *

* * @return Static information about a vehicle in a key-value pair. For example: "engineType" : * "1.3 L R2"

*

* A campaign must include the keys (attribute names) in dataExtraDimensions for them to * display in Amazon Timestream. */ public java.util.Map getAttributes() { return attributes; } /** *

* Static information about a vehicle in a key-value pair. For example: "engineType" : * "1.3 L R2" *

*

* A campaign must include the keys (attribute names) in dataExtraDimensions for them to display in * Amazon Timestream. *

* * @param attributes * Static information about a vehicle in a key-value pair. For example: "engineType" : * "1.3 L R2"

*

* A campaign must include the keys (attribute names) in dataExtraDimensions for them to display * in Amazon Timestream. */ public void setAttributes(java.util.Map attributes) { this.attributes = attributes; } /** *

* Static information about a vehicle in a key-value pair. For example: "engineType" : * "1.3 L R2" *

*

* A campaign must include the keys (attribute names) in dataExtraDimensions for them to display in * Amazon Timestream. *

* * @param attributes * Static information about a vehicle in a key-value pair. For example: "engineType" : * "1.3 L R2"

*

* A campaign must include the keys (attribute names) in dataExtraDimensions for them to display * in Amazon Timestream. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateVehicleRequest withAttributes(java.util.Map attributes) { setAttributes(attributes); return this; } /** * Add a single Attributes entry * * @see CreateVehicleRequest#withAttributes * @returns a reference to this object so that method calls can be chained together. */ public CreateVehicleRequest addAttributesEntry(String key, String value) { if (null == this.attributes) { this.attributes = new java.util.HashMap(); } if (this.attributes.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.attributes.put(key, value); return this; } /** * Removes all the entries added into Attributes. * * @return Returns a reference to this object so that method calls can be chained together. */ public CreateVehicleRequest clearAttributesEntries() { this.attributes = null; return this; } /** *

* An option to create a new Amazon Web Services IoT thing when creating a vehicle, or to validate an existing * Amazon Web Services IoT thing as a vehicle. *

*

* Default: *

* * @param associationBehavior * An option to create a new Amazon Web Services IoT thing when creating a vehicle, or to validate an * existing Amazon Web Services IoT thing as a vehicle.

*

* Default: * @see VehicleAssociationBehavior */ public void setAssociationBehavior(String associationBehavior) { this.associationBehavior = associationBehavior; } /** *

* An option to create a new Amazon Web Services IoT thing when creating a vehicle, or to validate an existing * Amazon Web Services IoT thing as a vehicle. *

*

* Default: *

* * @return An option to create a new Amazon Web Services IoT thing when creating a vehicle, or to validate an * existing Amazon Web Services IoT thing as a vehicle.

*

* Default: * @see VehicleAssociationBehavior */ public String getAssociationBehavior() { return this.associationBehavior; } /** *

* An option to create a new Amazon Web Services IoT thing when creating a vehicle, or to validate an existing * Amazon Web Services IoT thing as a vehicle. *

*

* Default: *

* * @param associationBehavior * An option to create a new Amazon Web Services IoT thing when creating a vehicle, or to validate an * existing Amazon Web Services IoT thing as a vehicle.

*

* Default: * @return Returns a reference to this object so that method calls can be chained together. * @see VehicleAssociationBehavior */ public CreateVehicleRequest withAssociationBehavior(String associationBehavior) { setAssociationBehavior(associationBehavior); return this; } /** *

* An option to create a new Amazon Web Services IoT thing when creating a vehicle, or to validate an existing * Amazon Web Services IoT thing as a vehicle. *

*

* Default: *

* * @param associationBehavior * An option to create a new Amazon Web Services IoT thing when creating a vehicle, or to validate an * existing Amazon Web Services IoT thing as a vehicle.

*

* Default: * @return Returns a reference to this object so that method calls can be chained together. * @see VehicleAssociationBehavior */ public CreateVehicleRequest withAssociationBehavior(VehicleAssociationBehavior associationBehavior) { this.associationBehavior = associationBehavior.toString(); return this; } /** *

* Metadata that can be used to manage the vehicle. *

* * @return Metadata that can be used to manage the vehicle. */ public java.util.List getTags() { return tags; } /** *

* Metadata that can be used to manage the vehicle. *

* * @param tags * Metadata that can be used to manage the vehicle. */ public void setTags(java.util.Collection tags) { if (tags == null) { this.tags = null; return; } this.tags = new java.util.ArrayList(tags); } /** *

* Metadata that can be used to manage the vehicle. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the * existing values. *

* * @param tags * Metadata that can be used to manage the vehicle. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateVehicleRequest withTags(Tag... tags) { if (this.tags == null) { setTags(new java.util.ArrayList(tags.length)); } for (Tag ele : tags) { this.tags.add(ele); } return this; } /** *

* Metadata that can be used to manage the vehicle. *

* * @param tags * Metadata that can be used to manage the vehicle. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateVehicleRequest withTags(java.util.Collection tags) { setTags(tags); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getVehicleName() != null) sb.append("VehicleName: ").append(getVehicleName()).append(","); if (getModelManifestArn() != null) sb.append("ModelManifestArn: ").append(getModelManifestArn()).append(","); if (getDecoderManifestArn() != null) sb.append("DecoderManifestArn: ").append(getDecoderManifestArn()).append(","); if (getAttributes() != null) sb.append("Attributes: ").append(getAttributes()).append(","); if (getAssociationBehavior() != null) sb.append("AssociationBehavior: ").append(getAssociationBehavior()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateVehicleRequest == false) return false; CreateVehicleRequest other = (CreateVehicleRequest) obj; if (other.getVehicleName() == null ^ this.getVehicleName() == null) return false; if (other.getVehicleName() != null && other.getVehicleName().equals(this.getVehicleName()) == false) return false; if (other.getModelManifestArn() == null ^ this.getModelManifestArn() == null) return false; if (other.getModelManifestArn() != null && other.getModelManifestArn().equals(this.getModelManifestArn()) == false) return false; if (other.getDecoderManifestArn() == null ^ this.getDecoderManifestArn() == null) return false; if (other.getDecoderManifestArn() != null && other.getDecoderManifestArn().equals(this.getDecoderManifestArn()) == false) return false; if (other.getAttributes() == null ^ this.getAttributes() == null) return false; if (other.getAttributes() != null && other.getAttributes().equals(this.getAttributes()) == false) return false; if (other.getAssociationBehavior() == null ^ this.getAssociationBehavior() == null) return false; if (other.getAssociationBehavior() != null && other.getAssociationBehavior().equals(this.getAssociationBehavior()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getVehicleName() == null) ? 0 : getVehicleName().hashCode()); hashCode = prime * hashCode + ((getModelManifestArn() == null) ? 0 : getModelManifestArn().hashCode()); hashCode = prime * hashCode + ((getDecoderManifestArn() == null) ? 0 : getDecoderManifestArn().hashCode()); hashCode = prime * hashCode + ((getAttributes() == null) ? 0 : getAttributes().hashCode()); hashCode = prime * hashCode + ((getAssociationBehavior() == null) ? 0 : getAssociationBehavior().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); return hashCode; } @Override public CreateVehicleRequest clone() { return (CreateVehicleRequest) super.clone(); } }