All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.iot.model.UpdateCommandResponse Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Iot Service module holds the client classes that are used for communicating with AWS IoT Service

There is a newer version: 2.30.1
Show newest version
/*
 * 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 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 getter(Function g) { return obj -> g.apply((UpdateCommandResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends IotResponse.Builder, SdkPojo, CopyableBuilder { /** *

* The unique identifier of the command. *

* * @param commandId * The unique identifier of the command. * @return Returns a reference to this object so that method calls can be chained together. */ Builder commandId(String commandId); /** *

* The updated user-friendly display name in the console for the command. *

* * @param displayName * The updated user-friendly display name in the console for the command. * @return Returns a reference to this object so that method calls can be chained together. */ Builder displayName(String displayName); /** *

* The updated text description of the command. *

* * @param description * The updated text description of the command. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); /** *

* The boolean that indicates whether the command was deprecated. *

* * @param deprecated * The boolean that indicates whether the command was deprecated. * @return Returns a reference to this object so that method calls can be chained together. */ Builder deprecated(Boolean deprecated); /** *

* The date and time (epoch timestamp in seconds) when the command was last updated. *

* * @param lastUpdatedAt * The date and time (epoch timestamp in seconds) when the command was last updated. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastUpdatedAt(Instant lastUpdatedAt); } static final class BuilderImpl extends IotResponse.BuilderImpl implements Builder { private String commandId; private String displayName; private String description; private Boolean deprecated; private Instant lastUpdatedAt; private BuilderImpl() { } private BuilderImpl(UpdateCommandResponse model) { super(model); commandId(model.commandId); displayName(model.displayName); description(model.description); deprecated(model.deprecated); lastUpdatedAt(model.lastUpdatedAt); } public final String getCommandId() { return commandId; } public final void setCommandId(String commandId) { this.commandId = commandId; } @Override public final Builder commandId(String commandId) { this.commandId = commandId; return this; } public final String getDisplayName() { return displayName; } public final void setDisplayName(String displayName) { this.displayName = displayName; } @Override public final Builder displayName(String displayName) { this.displayName = displayName; return this; } public final String getDescription() { return description; } public final void setDescription(String description) { this.description = description; } @Override public final Builder description(String description) { this.description = description; return this; } public final Boolean getDeprecated() { return deprecated; } public final void setDeprecated(Boolean deprecated) { this.deprecated = deprecated; } @Override public final Builder deprecated(Boolean deprecated) { this.deprecated = deprecated; return this; } public final Instant getLastUpdatedAt() { return lastUpdatedAt; } public final void setLastUpdatedAt(Instant lastUpdatedAt) { this.lastUpdatedAt = lastUpdatedAt; } @Override public final Builder lastUpdatedAt(Instant lastUpdatedAt) { this.lastUpdatedAt = lastUpdatedAt; return this; } @Override public UpdateCommandResponse build() { return new UpdateCommandResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy