software.amazon.awssdk.services.greengrass.model.GetResourceDefinitionResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of greengrass Show documentation
Show all versions of greengrass Show documentation
>The AWS Java SDK for AWS Greengrass module holds the client classes that are used for communicating
with AWS Greengrass Service
/*
* Copyright 2014-2019 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.greengrass.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
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 GetResourceDefinitionResponse extends GreengrassResponse implements
ToCopyableBuilder {
private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(GetResourceDefinitionResponse::arn)).setter(setter(Builder::arn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Arn").build()).build();
private static final SdkField CREATION_TIMESTAMP_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(GetResourceDefinitionResponse::creationTimestamp)).setter(setter(Builder::creationTimestamp))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationTimestamp").build()).build();
private static final SdkField ID_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(GetResourceDefinitionResponse::id)).setter(setter(Builder::id))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Id").build()).build();
private static final SdkField LAST_UPDATED_TIMESTAMP_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(GetResourceDefinitionResponse::lastUpdatedTimestamp)).setter(setter(Builder::lastUpdatedTimestamp))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastUpdatedTimestamp").build())
.build();
private static final SdkField LATEST_VERSION_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(GetResourceDefinitionResponse::latestVersion)).setter(setter(Builder::latestVersion))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LatestVersion").build()).build();
private static final SdkField LATEST_VERSION_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(GetResourceDefinitionResponse::latestVersionArn)).setter(setter(Builder::latestVersionArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LatestVersionArn").build()).build();
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(GetResourceDefinitionResponse::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Name").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ARN_FIELD,
CREATION_TIMESTAMP_FIELD, ID_FIELD, LAST_UPDATED_TIMESTAMP_FIELD, LATEST_VERSION_FIELD, LATEST_VERSION_ARN_FIELD,
NAME_FIELD));
private final String arn;
private final String creationTimestamp;
private final String id;
private final String lastUpdatedTimestamp;
private final String latestVersion;
private final String latestVersionArn;
private final String name;
private GetResourceDefinitionResponse(BuilderImpl builder) {
super(builder);
this.arn = builder.arn;
this.creationTimestamp = builder.creationTimestamp;
this.id = builder.id;
this.lastUpdatedTimestamp = builder.lastUpdatedTimestamp;
this.latestVersion = builder.latestVersion;
this.latestVersionArn = builder.latestVersionArn;
this.name = builder.name;
}
/**
* The ARN of the definition.
*
* @return The ARN of the definition.
*/
public String arn() {
return arn;
}
/**
* The time, in milliseconds since the epoch, when the definition was created.
*
* @return The time, in milliseconds since the epoch, when the definition was created.
*/
public String creationTimestamp() {
return creationTimestamp;
}
/**
* The ID of the definition.
*
* @return The ID of the definition.
*/
public String id() {
return id;
}
/**
* The time, in milliseconds since the epoch, when the definition was last updated.
*
* @return The time, in milliseconds since the epoch, when the definition was last updated.
*/
public String lastUpdatedTimestamp() {
return lastUpdatedTimestamp;
}
/**
* The latest version of the definition.
*
* @return The latest version of the definition.
*/
public String latestVersion() {
return latestVersion;
}
/**
* The ARN of the latest version of the definition.
*
* @return The ARN of the latest version of the definition.
*/
public String latestVersionArn() {
return latestVersionArn;
}
/**
* The name of the definition.
*
* @return The name of the definition.
*/
public String name() {
return name;
}
@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 int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(arn());
hashCode = 31 * hashCode + Objects.hashCode(creationTimestamp());
hashCode = 31 * hashCode + Objects.hashCode(id());
hashCode = 31 * hashCode + Objects.hashCode(lastUpdatedTimestamp());
hashCode = 31 * hashCode + Objects.hashCode(latestVersion());
hashCode = 31 * hashCode + Objects.hashCode(latestVersionArn());
hashCode = 31 * hashCode + Objects.hashCode(name());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof GetResourceDefinitionResponse)) {
return false;
}
GetResourceDefinitionResponse other = (GetResourceDefinitionResponse) obj;
return Objects.equals(arn(), other.arn()) && Objects.equals(creationTimestamp(), other.creationTimestamp())
&& Objects.equals(id(), other.id()) && Objects.equals(lastUpdatedTimestamp(), other.lastUpdatedTimestamp())
&& Objects.equals(latestVersion(), other.latestVersion())
&& Objects.equals(latestVersionArn(), other.latestVersionArn()) && Objects.equals(name(), other.name());
}
/**
* 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 String toString() {
return ToString.builder("GetResourceDefinitionResponse").add("Arn", arn()).add("CreationTimestamp", creationTimestamp())
.add("Id", id()).add("LastUpdatedTimestamp", lastUpdatedTimestamp()).add("LatestVersion", latestVersion())
.add("LatestVersionArn", latestVersionArn()).add("Name", name()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Arn":
return Optional.ofNullable(clazz.cast(arn()));
case "CreationTimestamp":
return Optional.ofNullable(clazz.cast(creationTimestamp()));
case "Id":
return Optional.ofNullable(clazz.cast(id()));
case "LastUpdatedTimestamp":
return Optional.ofNullable(clazz.cast(lastUpdatedTimestamp()));
case "LatestVersion":
return Optional.ofNullable(clazz.cast(latestVersion()));
case "LatestVersionArn":
return Optional.ofNullable(clazz.cast(latestVersionArn()));
case "Name":
return Optional.ofNullable(clazz.cast(name()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy