software.amazon.awssdk.services.snowball.model.ClusterMetadata Maven / Gradle / Ivy
Show all versions of snowball Show documentation
/*
* 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.snowball.model;
import java.io.Serializable;
import java.time.Instant;
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.Consumer;
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;
/**
*
* Contains metadata about a specific cluster.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class ClusterMetadata implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField CLUSTER_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ClusterId").getter(getter(ClusterMetadata::clusterId)).setter(setter(Builder::clusterId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ClusterId").build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Description").getter(getter(ClusterMetadata::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();
private static final SdkField KMS_KEY_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("KmsKeyARN").getter(getter(ClusterMetadata::kmsKeyARN)).setter(setter(Builder::kmsKeyARN))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KmsKeyARN").build()).build();
private static final SdkField ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("RoleARN").getter(getter(ClusterMetadata::roleARN)).setter(setter(Builder::roleARN))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RoleARN").build()).build();
private static final SdkField CLUSTER_STATE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ClusterState").getter(getter(ClusterMetadata::clusterStateAsString))
.setter(setter(Builder::clusterState))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ClusterState").build()).build();
private static final SdkField JOB_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("JobType").getter(getter(ClusterMetadata::jobTypeAsString)).setter(setter(Builder::jobType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("JobType").build()).build();
private static final SdkField SNOWBALL_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SnowballType").getter(getter(ClusterMetadata::snowballTypeAsString))
.setter(setter(Builder::snowballType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SnowballType").build()).build();
private static final SdkField CREATION_DATE_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("CreationDate").getter(getter(ClusterMetadata::creationDate)).setter(setter(Builder::creationDate))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationDate").build()).build();
private static final SdkField RESOURCES_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("Resources").getter(getter(ClusterMetadata::resources)).setter(setter(Builder::resources))
.constructor(JobResource::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Resources").build()).build();
private static final SdkField ADDRESS_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("AddressId").getter(getter(ClusterMetadata::addressId)).setter(setter(Builder::addressId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AddressId").build()).build();
private static final SdkField SHIPPING_OPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ShippingOption").getter(getter(ClusterMetadata::shippingOptionAsString))
.setter(setter(Builder::shippingOption))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ShippingOption").build()).build();
private static final SdkField NOTIFICATION_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("Notification").getter(getter(ClusterMetadata::notification)).setter(setter(Builder::notification))
.constructor(Notification::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Notification").build()).build();
private static final SdkField FORWARDING_ADDRESS_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ForwardingAddressId").getter(getter(ClusterMetadata::forwardingAddressId))
.setter(setter(Builder::forwardingAddressId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ForwardingAddressId").build())
.build();
private static final SdkField TAX_DOCUMENTS_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("TaxDocuments").getter(getter(ClusterMetadata::taxDocuments)).setter(setter(Builder::taxDocuments))
.constructor(TaxDocuments::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TaxDocuments").build()).build();
private static final SdkField ON_DEVICE_SERVICE_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("OnDeviceServiceConfiguration")
.getter(getter(ClusterMetadata::onDeviceServiceConfiguration))
.setter(setter(Builder::onDeviceServiceConfiguration))
.constructor(OnDeviceServiceConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OnDeviceServiceConfiguration")
.build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CLUSTER_ID_FIELD,
DESCRIPTION_FIELD, KMS_KEY_ARN_FIELD, ROLE_ARN_FIELD, CLUSTER_STATE_FIELD, JOB_TYPE_FIELD, SNOWBALL_TYPE_FIELD,
CREATION_DATE_FIELD, RESOURCES_FIELD, ADDRESS_ID_FIELD, SHIPPING_OPTION_FIELD, NOTIFICATION_FIELD,
FORWARDING_ADDRESS_ID_FIELD, TAX_DOCUMENTS_FIELD, ON_DEVICE_SERVICE_CONFIGURATION_FIELD));
private static final long serialVersionUID = 1L;
private final String clusterId;
private final String description;
private final String kmsKeyARN;
private final String roleARN;
private final String clusterState;
private final String jobType;
private final String snowballType;
private final Instant creationDate;
private final JobResource resources;
private final String addressId;
private final String shippingOption;
private final Notification notification;
private final String forwardingAddressId;
private final TaxDocuments taxDocuments;
private final OnDeviceServiceConfiguration onDeviceServiceConfiguration;
private ClusterMetadata(BuilderImpl builder) {
this.clusterId = builder.clusterId;
this.description = builder.description;
this.kmsKeyARN = builder.kmsKeyARN;
this.roleARN = builder.roleARN;
this.clusterState = builder.clusterState;
this.jobType = builder.jobType;
this.snowballType = builder.snowballType;
this.creationDate = builder.creationDate;
this.resources = builder.resources;
this.addressId = builder.addressId;
this.shippingOption = builder.shippingOption;
this.notification = builder.notification;
this.forwardingAddressId = builder.forwardingAddressId;
this.taxDocuments = builder.taxDocuments;
this.onDeviceServiceConfiguration = builder.onDeviceServiceConfiguration;
}
/**
*
* The automatically generated ID for a cluster.
*
*
* @return The automatically generated ID for a cluster.
*/
public final String clusterId() {
return clusterId;
}
/**
*
* The optional description of the cluster.
*
*
* @return The optional description of the cluster.
*/
public final String description() {
return description;
}
/**
*
* The KmsKeyARN
Amazon Resource Name (ARN) associated with this cluster. This ARN was created using
* the CreateKey API action in
* Key Management Service (KMS.
*
*
* @return The KmsKeyARN
Amazon Resource Name (ARN) associated with this cluster. This ARN was created
* using the CreateKey
* API action in Key Management Service (KMS.
*/
public final String kmsKeyARN() {
return kmsKeyARN;
}
/**
*
* The role ARN associated with this cluster. This ARN was created using the CreateRole API action in
* Identity and Access Management (IAM).
*
*
* @return The role ARN associated with this cluster. This ARN was created using the CreateRole API action
* in Identity and Access Management (IAM).
*/
public final String roleARN() {
return roleARN;
}
/**
*
* The current status of the cluster.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #clusterState} will
* return {@link ClusterState#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #clusterStateAsString}.
*
*
* @return The current status of the cluster.
* @see ClusterState
*/
public final ClusterState clusterState() {
return ClusterState.fromValue(clusterState);
}
/**
*
* The current status of the cluster.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #clusterState} will
* return {@link ClusterState#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #clusterStateAsString}.
*
*
* @return The current status of the cluster.
* @see ClusterState
*/
public final String clusterStateAsString() {
return clusterState;
}
/**
*
* The type of job for this cluster. Currently, the only job type supported for clusters is LOCAL_USE
.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #jobType} will
* return {@link JobType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #jobTypeAsString}.
*
*
* @return The type of job for this cluster. Currently, the only job type supported for clusters is
* LOCAL_USE
.
* @see JobType
*/
public final JobType jobType() {
return JobType.fromValue(jobType);
}
/**
*
* The type of job for this cluster. Currently, the only job type supported for clusters is LOCAL_USE
.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #jobType} will
* return {@link JobType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #jobTypeAsString}.
*
*
* @return The type of job for this cluster. Currently, the only job type supported for clusters is
* LOCAL_USE
.
* @see JobType
*/
public final String jobTypeAsString() {
return jobType;
}
/**
*
* The type of Snowcone device to use for this cluster.
*
*
*
* For cluster jobs, Amazon Web Services Snow Family currently supports only the EDGE
device type.
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #snowballType} will
* return {@link SnowballType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #snowballTypeAsString}.
*
*
* @return The type of Snowcone device to use for this cluster.
*
* For cluster jobs, Amazon Web Services Snow Family currently supports only the EDGE
device
* type.
*
* @see SnowballType
*/
public final SnowballType snowballType() {
return SnowballType.fromValue(snowballType);
}
/**
*
* The type of Snowcone device to use for this cluster.
*
*
*
* For cluster jobs, Amazon Web Services Snow Family currently supports only the EDGE
device type.
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #snowballType} will
* return {@link SnowballType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #snowballTypeAsString}.
*
*
* @return The type of Snowcone device to use for this cluster.
*
* For cluster jobs, Amazon Web Services Snow Family currently supports only the EDGE
device
* type.
*
* @see SnowballType
*/
public final String snowballTypeAsString() {
return snowballType;
}
/**
*
* The creation date for this cluster.
*
*
* @return The creation date for this cluster.
*/
public final Instant creationDate() {
return creationDate;
}
/**
*
* The arrays of JobResource objects that can include updated S3Resource objects or
* LambdaResource objects.
*
*
* @return The arrays of JobResource objects that can include updated S3Resource objects or
* LambdaResource objects.
*/
public final JobResource resources() {
return resources;
}
/**
*
* The automatically generated ID for a specific address.
*
*
* @return The automatically generated ID for a specific address.
*/
public final String addressId() {
return addressId;
}
/**
*
* The shipping speed for each node in this cluster. This speed doesn't dictate how soon you'll get each device,
* rather it represents how quickly each device moves to its destination while in transit. Regional shipping speeds
* are as follows:
*
*
* -
*
* In Australia, you have access to express shipping. Typically, devices shipped express are delivered in about a
* day.
*
*
* -
*
* In the European Union (EU), you have access to express shipping. Typically, Snow devices shipped express are
* delivered in about a day. In addition, most countries in the EU have access to standard shipping, which typically
* takes less than a week, one way.
*
*
* -
*
* In India, Snow devices are delivered in one to seven days.
*
*
* -
*
* In the US, you have access to one-day shipping and two-day shipping.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #shippingOption}
* will return {@link ShippingOption#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #shippingOptionAsString}.
*
*
* @return The shipping speed for each node in this cluster. This speed doesn't dictate how soon you'll get each
* device, rather it represents how quickly each device moves to its destination while in transit. Regional
* shipping speeds are as follows:
*
* -
*
* In Australia, you have access to express shipping. Typically, devices shipped express are delivered in
* about a day.
*
*
* -
*
* In the European Union (EU), you have access to express shipping. Typically, Snow devices shipped express
* are delivered in about a day. In addition, most countries in the EU have access to standard shipping,
* which typically takes less than a week, one way.
*
*
* -
*
* In India, Snow devices are delivered in one to seven days.
*
*
* -
*
* In the US, you have access to one-day shipping and two-day shipping.
*
*
* @see ShippingOption
*/
public final ShippingOption shippingOption() {
return ShippingOption.fromValue(shippingOption);
}
/**
*
* The shipping speed for each node in this cluster. This speed doesn't dictate how soon you'll get each device,
* rather it represents how quickly each device moves to its destination while in transit. Regional shipping speeds
* are as follows:
*
*
* -
*
* In Australia, you have access to express shipping. Typically, devices shipped express are delivered in about a
* day.
*
*
* -
*
* In the European Union (EU), you have access to express shipping. Typically, Snow devices shipped express are
* delivered in about a day. In addition, most countries in the EU have access to standard shipping, which typically
* takes less than a week, one way.
*
*
* -
*
* In India, Snow devices are delivered in one to seven days.
*
*
* -
*
* In the US, you have access to one-day shipping and two-day shipping.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #shippingOption}
* will return {@link ShippingOption#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #shippingOptionAsString}.
*
*
* @return The shipping speed for each node in this cluster. This speed doesn't dictate how soon you'll get each
* device, rather it represents how quickly each device moves to its destination while in transit. Regional
* shipping speeds are as follows:
*
* -
*
* In Australia, you have access to express shipping. Typically, devices shipped express are delivered in
* about a day.
*
*
* -
*
* In the European Union (EU), you have access to express shipping. Typically, Snow devices shipped express
* are delivered in about a day. In addition, most countries in the EU have access to standard shipping,
* which typically takes less than a week, one way.
*
*
* -
*
* In India, Snow devices are delivered in one to seven days.
*
*
* -
*
* In the US, you have access to one-day shipping and two-day shipping.
*
*
* @see ShippingOption
*/
public final String shippingOptionAsString() {
return shippingOption;
}
/**
*
* The Amazon Simple Notification Service (Amazon SNS) notification settings for this cluster.
*
*
* @return The Amazon Simple Notification Service (Amazon SNS) notification settings for this cluster.
*/
public final Notification notification() {
return notification;
}
/**
*
* The ID of the address that you want a cluster shipped to, after it will be shipped to its primary address. This
* field is not supported in most regions.
*
*
* @return The ID of the address that you want a cluster shipped to, after it will be shipped to its primary
* address. This field is not supported in most regions.
*/
public final String forwardingAddressId() {
return forwardingAddressId;
}
/**
*
* The tax documents required in your Amazon Web Services Region.
*
*
* @return The tax documents required in your Amazon Web Services Region.
*/
public final TaxDocuments taxDocuments() {
return taxDocuments;
}
/**
*
* Represents metadata and configuration settings for services on an Amazon Web Services Snow Family device.
*
*
* @return Represents metadata and configuration settings for services on an Amazon Web Services Snow Family device.
*/
public final OnDeviceServiceConfiguration onDeviceServiceConfiguration() {
return onDeviceServiceConfiguration;
}
@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(clusterId());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(kmsKeyARN());
hashCode = 31 * hashCode + Objects.hashCode(roleARN());
hashCode = 31 * hashCode + Objects.hashCode(clusterStateAsString());
hashCode = 31 * hashCode + Objects.hashCode(jobTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(snowballTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(creationDate());
hashCode = 31 * hashCode + Objects.hashCode(resources());
hashCode = 31 * hashCode + Objects.hashCode(addressId());
hashCode = 31 * hashCode + Objects.hashCode(shippingOptionAsString());
hashCode = 31 * hashCode + Objects.hashCode(notification());
hashCode = 31 * hashCode + Objects.hashCode(forwardingAddressId());
hashCode = 31 * hashCode + Objects.hashCode(taxDocuments());
hashCode = 31 * hashCode + Objects.hashCode(onDeviceServiceConfiguration());
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 ClusterMetadata)) {
return false;
}
ClusterMetadata other = (ClusterMetadata) obj;
return Objects.equals(clusterId(), other.clusterId()) && Objects.equals(description(), other.description())
&& Objects.equals(kmsKeyARN(), other.kmsKeyARN()) && Objects.equals(roleARN(), other.roleARN())
&& Objects.equals(clusterStateAsString(), other.clusterStateAsString())
&& Objects.equals(jobTypeAsString(), other.jobTypeAsString())
&& Objects.equals(snowballTypeAsString(), other.snowballTypeAsString())
&& Objects.equals(creationDate(), other.creationDate()) && Objects.equals(resources(), other.resources())
&& Objects.equals(addressId(), other.addressId())
&& Objects.equals(shippingOptionAsString(), other.shippingOptionAsString())
&& Objects.equals(notification(), other.notification())
&& Objects.equals(forwardingAddressId(), other.forwardingAddressId())
&& Objects.equals(taxDocuments(), other.taxDocuments())
&& Objects.equals(onDeviceServiceConfiguration(), other.onDeviceServiceConfiguration());
}
/**
* 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("ClusterMetadata").add("ClusterId", clusterId()).add("Description", description())
.add("KmsKeyARN", kmsKeyARN()).add("RoleARN", roleARN()).add("ClusterState", clusterStateAsString())
.add("JobType", jobTypeAsString()).add("SnowballType", snowballTypeAsString())
.add("CreationDate", creationDate()).add("Resources", resources()).add("AddressId", addressId())
.add("ShippingOption", shippingOptionAsString()).add("Notification", notification())
.add("ForwardingAddressId", forwardingAddressId()).add("TaxDocuments", taxDocuments())
.add("OnDeviceServiceConfiguration", onDeviceServiceConfiguration()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ClusterId":
return Optional.ofNullable(clazz.cast(clusterId()));
case "Description":
return Optional.ofNullable(clazz.cast(description()));
case "KmsKeyARN":
return Optional.ofNullable(clazz.cast(kmsKeyARN()));
case "RoleARN":
return Optional.ofNullable(clazz.cast(roleARN()));
case "ClusterState":
return Optional.ofNullable(clazz.cast(clusterStateAsString()));
case "JobType":
return Optional.ofNullable(clazz.cast(jobTypeAsString()));
case "SnowballType":
return Optional.ofNullable(clazz.cast(snowballTypeAsString()));
case "CreationDate":
return Optional.ofNullable(clazz.cast(creationDate()));
case "Resources":
return Optional.ofNullable(clazz.cast(resources()));
case "AddressId":
return Optional.ofNullable(clazz.cast(addressId()));
case "ShippingOption":
return Optional.ofNullable(clazz.cast(shippingOptionAsString()));
case "Notification":
return Optional.ofNullable(clazz.cast(notification()));
case "ForwardingAddressId":
return Optional.ofNullable(clazz.cast(forwardingAddressId()));
case "TaxDocuments":
return Optional.ofNullable(clazz.cast(taxDocuments()));
case "OnDeviceServiceConfiguration":
return Optional.ofNullable(clazz.cast(onDeviceServiceConfiguration()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function