attributes;
private final String attributeUpdateMode;
private UpdateVehicleRequest(BuilderImpl builder) {
super(builder);
this.vehicleName = builder.vehicleName;
this.modelManifestArn = builder.modelManifestArn;
this.decoderManifestArn = builder.decoderManifestArn;
this.attributes = builder.attributes;
this.attributeUpdateMode = builder.attributeUpdateMode;
}
/**
*
* The unique ID of the vehicle to update.
*
*
* @return The unique ID of the vehicle to update.
*/
public final String vehicleName() {
return vehicleName;
}
/**
*
* The ARN of a vehicle model (model manifest) associated with the vehicle.
*
*
* @return The ARN of a vehicle model (model manifest) associated with the vehicle.
*/
public final String modelManifestArn() {
return modelManifestArn;
}
/**
*
* The ARN of the decoder manifest associated with this vehicle.
*
*
* @return The ARN of the decoder manifest associated with this vehicle.
*/
public final String decoderManifestArn() {
return decoderManifestArn;
}
/**
* For responses, this returns true if the service returned a value for the Attributes property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasAttributes() {
return attributes != null && !(attributes instanceof SdkAutoConstructMap);
}
/**
*
* Static information about a vehicle in a key-value pair. For example:
*
*
* "engineType"
: "1.3 L R2"
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasAttributes} method.
*
*
* @return Static information about a vehicle in a key-value pair. For example:
*
* "engineType"
: "1.3 L R2"
*/
public final Map attributes() {
return attributes;
}
/**
*
* The method the specified attributes will update the existing attributes on the vehicle. UseOverwite
* to replace the vehicle attributes with the specified attributes. Or use Merge
to combine all
* attributes.
*
*
* This is required if attributes are present in the input.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #attributeUpdateMode} will return {@link UpdateMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the
* service is available from {@link #attributeUpdateModeAsString}.
*
*
* @return The method the specified attributes will update the existing attributes on the vehicle. Use
* Overwite
to replace the vehicle attributes with the specified attributes. Or use
* Merge
to combine all attributes.
*
* This is required if attributes are present in the input.
* @see UpdateMode
*/
public final UpdateMode attributeUpdateMode() {
return UpdateMode.fromValue(attributeUpdateMode);
}
/**
*
* The method the specified attributes will update the existing attributes on the vehicle. UseOverwite
* to replace the vehicle attributes with the specified attributes. Or use Merge
to combine all
* attributes.
*
*
* This is required if attributes are present in the input.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #attributeUpdateMode} will return {@link UpdateMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the
* service is available from {@link #attributeUpdateModeAsString}.
*
*
* @return The method the specified attributes will update the existing attributes on the vehicle. Use
* Overwite
to replace the vehicle attributes with the specified attributes. Or use
* Merge
to combine all attributes.
*
* This is required if attributes are present in the input.
* @see UpdateMode
*/
public final String attributeUpdateModeAsString() {
return attributeUpdateMode;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(vehicleName());
hashCode = 31 * hashCode + Objects.hashCode(modelManifestArn());
hashCode = 31 * hashCode + Objects.hashCode(decoderManifestArn());
hashCode = 31 * hashCode + Objects.hashCode(hasAttributes() ? attributes() : null);
hashCode = 31 * hashCode + Objects.hashCode(attributeUpdateModeAsString());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof UpdateVehicleRequest)) {
return false;
}
UpdateVehicleRequest other = (UpdateVehicleRequest) obj;
return Objects.equals(vehicleName(), other.vehicleName()) && Objects.equals(modelManifestArn(), other.modelManifestArn())
&& Objects.equals(decoderManifestArn(), other.decoderManifestArn()) && hasAttributes() == other.hasAttributes()
&& Objects.equals(attributes(), other.attributes())
&& Objects.equals(attributeUpdateModeAsString(), other.attributeUpdateModeAsString());
}
/**
* 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.
*/
@Override
public final String toString() {
return ToString.builder("UpdateVehicleRequest").add("VehicleName", vehicleName())
.add("ModelManifestArn", modelManifestArn()).add("DecoderManifestArn", decoderManifestArn())
.add("Attributes", hasAttributes() ? attributes() : null)
.add("AttributeUpdateMode", attributeUpdateModeAsString()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "vehicleName":
return Optional.ofNullable(clazz.cast(vehicleName()));
case "modelManifestArn":
return Optional.ofNullable(clazz.cast(modelManifestArn()));
case "decoderManifestArn":
return Optional.ofNullable(clazz.cast(decoderManifestArn()));
case "attributes":
return Optional.ofNullable(clazz.cast(attributes()));
case "attributeUpdateMode":
return Optional.ofNullable(clazz.cast(attributeUpdateModeAsString()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function getter(Function g) {
return obj -> g.apply((UpdateVehicleRequest) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends IoTFleetWiseRequest.Builder, SdkPojo, CopyableBuilder {
/**
*
* The unique ID of the vehicle to update.
*
*
* @param vehicleName
* The unique ID of the vehicle to update.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder vehicleName(String vehicleName);
/**
*
* The ARN of a vehicle model (model manifest) associated with the vehicle.
*
*
* @param modelManifestArn
* The ARN of a vehicle model (model manifest) associated with the vehicle.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder modelManifestArn(String modelManifestArn);
/**
*
* The ARN of the decoder manifest associated with this vehicle.
*
*
* @param decoderManifestArn
* The ARN of the decoder manifest associated with this vehicle.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder decoderManifestArn(String decoderManifestArn);
/**
*
* Static information about a vehicle in a key-value pair. For example:
*
*
* "engineType"
: "1.3 L R2"
*
*
* @param attributes
* Static information about a vehicle in a key-value pair. For example:
*
* "engineType"
: "1.3 L R2"
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder attributes(Map attributes);
/**
*
* The method the specified attributes will update the existing attributes on the vehicle. Use
* Overwite
to replace the vehicle attributes with the specified attributes. Or use
* Merge
to combine all attributes.
*
*
* This is required if attributes are present in the input.
*
*
* @param attributeUpdateMode
* The method the specified attributes will update the existing attributes on the vehicle. Use
* Overwite
to replace the vehicle attributes with the specified attributes. Or use
* Merge
to combine all attributes.
*
* This is required if attributes are present in the input.
* @see UpdateMode
* @return Returns a reference to this object so that method calls can be chained together.
* @see UpdateMode
*/
Builder attributeUpdateMode(String attributeUpdateMode);
/**
*
* The method the specified attributes will update the existing attributes on the vehicle. Use
* Overwite
to replace the vehicle attributes with the specified attributes. Or use
* Merge
to combine all attributes.
*
*
* This is required if attributes are present in the input.
*
*
* @param attributeUpdateMode
* The method the specified attributes will update the existing attributes on the vehicle. Use
* Overwite
to replace the vehicle attributes with the specified attributes. Or use
* Merge
to combine all attributes.
*
* This is required if attributes are present in the input.
* @see UpdateMode
* @return Returns a reference to this object so that method calls can be chained together.
* @see UpdateMode
*/
Builder attributeUpdateMode(UpdateMode attributeUpdateMode);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer builderConsumer);
}
static final class BuilderImpl extends IoTFleetWiseRequest.BuilderImpl implements Builder {
private String vehicleName;
private String modelManifestArn;
private String decoderManifestArn;
private Map attributes = DefaultSdkAutoConstructMap.getInstance();
private String attributeUpdateMode;
private BuilderImpl() {
}
private BuilderImpl(UpdateVehicleRequest model) {
super(model);
vehicleName(model.vehicleName);
modelManifestArn(model.modelManifestArn);
decoderManifestArn(model.decoderManifestArn);
attributes(model.attributes);
attributeUpdateMode(model.attributeUpdateMode);
}
public final String getVehicleName() {
return vehicleName;
}
public final void setVehicleName(String vehicleName) {
this.vehicleName = vehicleName;
}
@Override
public final Builder vehicleName(String vehicleName) {
this.vehicleName = vehicleName;
return this;
}
public final String getModelManifestArn() {
return modelManifestArn;
}
public final void setModelManifestArn(String modelManifestArn) {
this.modelManifestArn = modelManifestArn;
}
@Override
public final Builder modelManifestArn(String modelManifestArn) {
this.modelManifestArn = modelManifestArn;
return this;
}
public final String getDecoderManifestArn() {
return decoderManifestArn;
}
public final void setDecoderManifestArn(String decoderManifestArn) {
this.decoderManifestArn = decoderManifestArn;
}
@Override
public final Builder decoderManifestArn(String decoderManifestArn) {
this.decoderManifestArn = decoderManifestArn;
return this;
}
public final Map getAttributes() {
if (attributes instanceof SdkAutoConstructMap) {
return null;
}
return attributes;
}
public final void setAttributes(Map attributes) {
this.attributes = _attributesMapCopier.copy(attributes);
}
@Override
public final Builder attributes(Map attributes) {
this.attributes = _attributesMapCopier.copy(attributes);
return this;
}
public final String getAttributeUpdateMode() {
return attributeUpdateMode;
}
public final void setAttributeUpdateMode(String attributeUpdateMode) {
this.attributeUpdateMode = attributeUpdateMode;
}
@Override
public final Builder attributeUpdateMode(String attributeUpdateMode) {
this.attributeUpdateMode = attributeUpdateMode;
return this;
}
@Override
public final Builder attributeUpdateMode(UpdateMode attributeUpdateMode) {
this.attributeUpdateMode(attributeUpdateMode == null ? null : attributeUpdateMode.toString());
return this;
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public UpdateVehicleRequest build() {
return new UpdateVehicleRequest(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}