software.amazon.awssdk.services.greengrass.model.Deployment 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
The 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.greengrass.model;
import java.io.Serializable;
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;
/**
* Information about a deployment.
*/
@Generated("software.amazon.awssdk:codegen")
public final class Deployment implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField CREATED_AT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CreatedAt").getter(getter(Deployment::createdAt)).setter(setter(Builder::createdAt))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreatedAt").build()).build();
private static final SdkField DEPLOYMENT_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DeploymentArn").getter(getter(Deployment::deploymentArn)).setter(setter(Builder::deploymentArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeploymentArn").build()).build();
private static final SdkField DEPLOYMENT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DeploymentId").getter(getter(Deployment::deploymentId)).setter(setter(Builder::deploymentId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeploymentId").build()).build();
private static final SdkField DEPLOYMENT_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DeploymentType").getter(getter(Deployment::deploymentTypeAsString))
.setter(setter(Builder::deploymentType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeploymentType").build()).build();
private static final SdkField GROUP_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("GroupArn").getter(getter(Deployment::groupArn)).setter(setter(Builder::groupArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("GroupArn").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CREATED_AT_FIELD,
DEPLOYMENT_ARN_FIELD, DEPLOYMENT_ID_FIELD, DEPLOYMENT_TYPE_FIELD, GROUP_ARN_FIELD));
private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer();
private static final long serialVersionUID = 1L;
private final String createdAt;
private final String deploymentArn;
private final String deploymentId;
private final String deploymentType;
private final String groupArn;
private Deployment(BuilderImpl builder) {
this.createdAt = builder.createdAt;
this.deploymentArn = builder.deploymentArn;
this.deploymentId = builder.deploymentId;
this.deploymentType = builder.deploymentType;
this.groupArn = builder.groupArn;
}
/**
* The time, in milliseconds since the epoch, when the deployment was created.
*
* @return The time, in milliseconds since the epoch, when the deployment was created.
*/
public final String createdAt() {
return createdAt;
}
/**
* The ARN of the deployment.
*
* @return The ARN of the deployment.
*/
public final String deploymentArn() {
return deploymentArn;
}
/**
* The ID of the deployment.
*
* @return The ID of the deployment.
*/
public final String deploymentId() {
return deploymentId;
}
/**
* The type of the deployment.
*
* If the service returns an enum value that is not available in the current SDK version, {@link #deploymentType}
* will return {@link DeploymentType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #deploymentTypeAsString}.
*
*
* @return The type of the deployment.
* @see DeploymentType
*/
public final DeploymentType deploymentType() {
return DeploymentType.fromValue(deploymentType);
}
/**
* The type of the deployment.
*
* If the service returns an enum value that is not available in the current SDK version, {@link #deploymentType}
* will return {@link DeploymentType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #deploymentTypeAsString}.
*
*
* @return The type of the deployment.
* @see DeploymentType
*/
public final String deploymentTypeAsString() {
return deploymentType;
}
/**
* The ARN of the group for this deployment.
*
* @return The ARN of the group for this deployment.
*/
public final String groupArn() {
return groupArn;
}
@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 + Objects.hashCode(createdAt());
hashCode = 31 * hashCode + Objects.hashCode(deploymentArn());
hashCode = 31 * hashCode + Objects.hashCode(deploymentId());
hashCode = 31 * hashCode + Objects.hashCode(deploymentTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(groupArn());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof Deployment)) {
return false;
}
Deployment other = (Deployment) obj;
return Objects.equals(createdAt(), other.createdAt()) && Objects.equals(deploymentArn(), other.deploymentArn())
&& Objects.equals(deploymentId(), other.deploymentId())
&& Objects.equals(deploymentTypeAsString(), other.deploymentTypeAsString())
&& Objects.equals(groupArn(), other.groupArn());
}
/**
* 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("Deployment").add("CreatedAt", createdAt()).add("DeploymentArn", deploymentArn())
.add("DeploymentId", deploymentId()).add("DeploymentType", deploymentTypeAsString()).add("GroupArn", groupArn())
.build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "CreatedAt":
return Optional.ofNullable(clazz.cast(createdAt()));
case "DeploymentArn":
return Optional.ofNullable(clazz.cast(deploymentArn()));
case "DeploymentId":
return Optional.ofNullable(clazz.cast(deploymentId()));
case "DeploymentType":
return Optional.ofNullable(clazz.cast(deploymentTypeAsString()));
case "GroupArn":
return Optional.ofNullable(clazz.cast(groupArn()));
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("CreatedAt", CREATED_AT_FIELD);
map.put("DeploymentArn", DEPLOYMENT_ARN_FIELD);
map.put("DeploymentId", DEPLOYMENT_ID_FIELD);
map.put("DeploymentType", DEPLOYMENT_TYPE_FIELD);
map.put("GroupArn", GROUP_ARN_FIELD);
return Collections.unmodifiableMap(map);
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy