software.amazon.awssdk.services.iot.model.UpdateCommandResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of iot Show documentation
Show all versions of iot Show documentation
The AWS Java SDK for AWS Iot Service module holds the client classes that are used for communicating
with AWS IoT Service
/*
* Copyright 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 software.amazon.awssdk.services.iot.model;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class UpdateCommandResponse extends IotResponse implements
ToCopyableBuilder {
private static final SdkField COMMAND_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("commandId").getter(getter(UpdateCommandResponse::commandId)).setter(setter(Builder::commandId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("commandId").build()).build();
private static final SdkField DISPLAY_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("displayName").getter(getter(UpdateCommandResponse::displayName)).setter(setter(Builder::displayName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("displayName").build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("description").getter(getter(UpdateCommandResponse::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("description").build()).build();
private static final SdkField DEPRECATED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("deprecated").getter(getter(UpdateCommandResponse::deprecated)).setter(setter(Builder::deprecated))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("deprecated").build()).build();
private static final SdkField LAST_UPDATED_AT_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("lastUpdatedAt").getter(getter(UpdateCommandResponse::lastUpdatedAt))
.setter(setter(Builder::lastUpdatedAt))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("lastUpdatedAt").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(COMMAND_ID_FIELD,
DISPLAY_NAME_FIELD, DESCRIPTION_FIELD, DEPRECATED_FIELD, LAST_UPDATED_AT_FIELD));
private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer();
private final String commandId;
private final String displayName;
private final String description;
private final Boolean deprecated;
private final Instant lastUpdatedAt;
private UpdateCommandResponse(BuilderImpl builder) {
super(builder);
this.commandId = builder.commandId;
this.displayName = builder.displayName;
this.description = builder.description;
this.deprecated = builder.deprecated;
this.lastUpdatedAt = builder.lastUpdatedAt;
}
/**
*
* The unique identifier of the command.
*
*
* @return The unique identifier of the command.
*/
public final String commandId() {
return commandId;
}
/**
*
* The updated user-friendly display name in the console for the command.
*
*
* @return The updated user-friendly display name in the console for the command.
*/
public final String displayName() {
return displayName;
}
/**
*
* The updated text description of the command.
*
*
* @return The updated text description of the command.
*/
public final String description() {
return description;
}
/**
*
* The boolean that indicates whether the command was deprecated.
*
*
* @return The boolean that indicates whether the command was deprecated.
*/
public final Boolean deprecated() {
return deprecated;
}
/**
*
* The date and time (epoch timestamp in seconds) when the command was last updated.
*
*
* @return The date and time (epoch timestamp in seconds) when the command was last updated.
*/
public final Instant lastUpdatedAt() {
return lastUpdatedAt;
}
@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(commandId());
hashCode = 31 * hashCode + Objects.hashCode(displayName());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(deprecated());
hashCode = 31 * hashCode + Objects.hashCode(lastUpdatedAt());
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 UpdateCommandResponse)) {
return false;
}
UpdateCommandResponse other = (UpdateCommandResponse) obj;
return Objects.equals(commandId(), other.commandId()) && Objects.equals(displayName(), other.displayName())
&& Objects.equals(description(), other.description()) && Objects.equals(deprecated(), other.deprecated())
&& Objects.equals(lastUpdatedAt(), other.lastUpdatedAt());
}
/**
* 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("UpdateCommandResponse").add("CommandId", commandId()).add("DisplayName", displayName())
.add("Description", description()).add("Deprecated", deprecated()).add("LastUpdatedAt", lastUpdatedAt()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "commandId":
return Optional.ofNullable(clazz.cast(commandId()));
case "displayName":
return Optional.ofNullable(clazz.cast(displayName()));
case "description":
return Optional.ofNullable(clazz.cast(description()));
case "deprecated":
return Optional.ofNullable(clazz.cast(deprecated()));
case "lastUpdatedAt":
return Optional.ofNullable(clazz.cast(lastUpdatedAt()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Map> memberNameToFieldInitializer() {
Map> map = new HashMap<>();
map.put("commandId", COMMAND_ID_FIELD);
map.put("displayName", DISPLAY_NAME_FIELD);
map.put("description", DESCRIPTION_FIELD);
map.put("deprecated", DEPRECATED_FIELD);
map.put("lastUpdatedAt", LAST_UPDATED_AT_FIELD);
return Collections.unmodifiableMap(map);
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy