software.amazon.awssdk.services.snowball.model.UpdateJobRequest 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.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.awscore.AwsRequestOverrideConfiguration;
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 UpdateJobRequest extends SnowballRequest implements
ToCopyableBuilder {
private static final SdkField JOB_ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("JobId")
.getter(getter(UpdateJobRequest::jobId)).setter(setter(Builder::jobId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("JobId").build()).build();
private static final SdkField ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("RoleARN").getter(getter(UpdateJobRequest::roleARN)).setter(setter(Builder::roleARN))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RoleARN").build()).build();
private static final SdkField NOTIFICATION_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("Notification").getter(getter(UpdateJobRequest::notification)).setter(setter(Builder::notification))
.constructor(Notification::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Notification").build()).build();
private static final SdkField RESOURCES_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("Resources").getter(getter(UpdateJobRequest::resources)).setter(setter(Builder::resources))
.constructor(JobResource::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Resources").build()).build();
private static final SdkField ON_DEVICE_SERVICE_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("OnDeviceServiceConfiguration")
.getter(getter(UpdateJobRequest::onDeviceServiceConfiguration))
.setter(setter(Builder::onDeviceServiceConfiguration))
.constructor(OnDeviceServiceConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OnDeviceServiceConfiguration")
.build()).build();
private static final SdkField ADDRESS_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("AddressId").getter(getter(UpdateJobRequest::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(UpdateJobRequest::shippingOptionAsString))
.setter(setter(Builder::shippingOption))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ShippingOption").build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Description").getter(getter(UpdateJobRequest::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();
private static final SdkField SNOWBALL_CAPACITY_PREFERENCE_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("SnowballCapacityPreference")
.getter(getter(UpdateJobRequest::snowballCapacityPreferenceAsString))
.setter(setter(Builder::snowballCapacityPreference))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SnowballCapacityPreference").build())
.build();
private static final SdkField FORWARDING_ADDRESS_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ForwardingAddressId").getter(getter(UpdateJobRequest::forwardingAddressId))
.setter(setter(Builder::forwardingAddressId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ForwardingAddressId").build())
.build();
private static final SdkField PICKUP_DETAILS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("PickupDetails")
.getter(getter(UpdateJobRequest::pickupDetails)).setter(setter(Builder::pickupDetails))
.constructor(PickupDetails::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PickupDetails").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(JOB_ID_FIELD, ROLE_ARN_FIELD,
NOTIFICATION_FIELD, RESOURCES_FIELD, ON_DEVICE_SERVICE_CONFIGURATION_FIELD, ADDRESS_ID_FIELD, SHIPPING_OPTION_FIELD,
DESCRIPTION_FIELD, SNOWBALL_CAPACITY_PREFERENCE_FIELD, FORWARDING_ADDRESS_ID_FIELD, PICKUP_DETAILS_FIELD));
private final String jobId;
private final String roleARN;
private final Notification notification;
private final JobResource resources;
private final OnDeviceServiceConfiguration onDeviceServiceConfiguration;
private final String addressId;
private final String shippingOption;
private final String description;
private final String snowballCapacityPreference;
private final String forwardingAddressId;
private final PickupDetails pickupDetails;
private UpdateJobRequest(BuilderImpl builder) {
super(builder);
this.jobId = builder.jobId;
this.roleARN = builder.roleARN;
this.notification = builder.notification;
this.resources = builder.resources;
this.onDeviceServiceConfiguration = builder.onDeviceServiceConfiguration;
this.addressId = builder.addressId;
this.shippingOption = builder.shippingOption;
this.description = builder.description;
this.snowballCapacityPreference = builder.snowballCapacityPreference;
this.forwardingAddressId = builder.forwardingAddressId;
this.pickupDetails = builder.pickupDetails;
}
/**
*
* The job ID of the job that you want to update, for example JID123e4567-e89b-12d3-a456-426655440000
.
*
*
* @return The job ID of the job that you want to update, for example
* JID123e4567-e89b-12d3-a456-426655440000
.
*/
public final String jobId() {
return jobId;
}
/**
*
* The new role Amazon Resource Name (ARN) that you want to associate with this job. To create a role ARN, use the
* CreateRoleIdentity and
* Access Management (IAM) API action.
*
*
* @return The new role Amazon Resource Name (ARN) that you want to associate with this job. To create a role ARN,
* use the CreateRoleIdentity and
* Access Management (IAM) API action.
*/
public final String roleARN() {
return roleARN;
}
/**
*
* The new or updated Notification object.
*
*
* @return The new or updated Notification object.
*/
public final Notification notification() {
return notification;
}
/**
*
* The updated JobResource
object, or the updated JobResource object.
*
*
* @return The updated JobResource
object, or the updated JobResource object.
*/
public final JobResource resources() {
return resources;
}
/**
*
* Specifies the service or services on the Snow Family device that your transferred data will be exported from or
* imported into. Amazon Web Services Snow Family supports Amazon S3 and NFS (Network File System) and the Amazon
* Web Services Storage Gateway service Tape Gateway type.
*
*
* @return Specifies the service or services on the Snow Family device that your transferred data will be exported
* from or imported into. Amazon Web Services Snow Family supports Amazon S3 and NFS (Network File System)
* and the Amazon Web Services Storage Gateway service Tape Gateway type.
*/
public final OnDeviceServiceConfiguration onDeviceServiceConfiguration() {
return onDeviceServiceConfiguration;
}
/**
*
* The ID of the updated Address object.
*
*
* @return The ID of the updated Address object.
*/
public final String addressId() {
return addressId;
}
/**
*
* The updated shipping option value of this job's ShippingDetails object.
*
*
* 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 updated shipping option value of this job's ShippingDetails object.
* @see ShippingOption
*/
public final ShippingOption shippingOption() {
return ShippingOption.fromValue(shippingOption);
}
/**
*
* The updated shipping option value of this job's ShippingDetails object.
*
*
* 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 updated shipping option value of this job's ShippingDetails object.
* @see ShippingOption
*/
public final String shippingOptionAsString() {
return shippingOption;
}
/**
*
* The updated description of this job's JobMetadata object.
*
*
* @return The updated description of this job's JobMetadata object.
*/
public final String description() {
return description;
}
/**
*
* The updated SnowballCapacityPreference
of this job's JobMetadata object. The 50 TB Snowballs
* are only available in the US regions.
*
*
* For more information, see "https://docs.aws.amazon.com/snowball/latest/snowcone-guide/snow-device-types.html"
* (Snow Family Devices and Capacity) in the Snowcone User Guide or
* "https://docs.aws.amazon.com/snowball/latest/developer-guide/snow-device-types.html" (Snow Family Devices and
* Capacity) in the Snowcone User Guide.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #snowballCapacityPreference} will return {@link SnowballCapacity#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #snowballCapacityPreferenceAsString}.
*
*
* @return The updated SnowballCapacityPreference
of this job's JobMetadata object. The 50 TB
* Snowballs are only available in the US regions.
*
* For more information, see
* "https://docs.aws.amazon.com/snowball/latest/snowcone-guide/snow-device-types.html" (Snow Family Devices
* and Capacity) in the Snowcone User Guide or
* "https://docs.aws.amazon.com/snowball/latest/developer-guide/snow-device-types.html" (Snow Family Devices
* and Capacity) in the Snowcone User Guide.
* @see SnowballCapacity
*/
public final SnowballCapacity snowballCapacityPreference() {
return SnowballCapacity.fromValue(snowballCapacityPreference);
}
/**
*
* The updated SnowballCapacityPreference
of this job's JobMetadata object. The 50 TB Snowballs
* are only available in the US regions.
*
*
* For more information, see "https://docs.aws.amazon.com/snowball/latest/snowcone-guide/snow-device-types.html"
* (Snow Family Devices and Capacity) in the Snowcone User Guide or
* "https://docs.aws.amazon.com/snowball/latest/developer-guide/snow-device-types.html" (Snow Family Devices and
* Capacity) in the Snowcone User Guide.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #snowballCapacityPreference} will return {@link SnowballCapacity#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #snowballCapacityPreferenceAsString}.
*
*
* @return The updated SnowballCapacityPreference
of this job's JobMetadata object. The 50 TB
* Snowballs are only available in the US regions.
*
* For more information, see
* "https://docs.aws.amazon.com/snowball/latest/snowcone-guide/snow-device-types.html" (Snow Family Devices
* and Capacity) in the Snowcone User Guide or
* "https://docs.aws.amazon.com/snowball/latest/developer-guide/snow-device-types.html" (Snow Family Devices
* and Capacity) in the Snowcone User Guide.
* @see SnowballCapacity
*/
public final String snowballCapacityPreferenceAsString() {
return snowballCapacityPreference;
}
/**
*
* The updated ID for the forwarding address for a job. This field is not supported in most regions.
*
*
* @return The updated ID for the forwarding address for a job. This field is not supported in most regions.
*/
public final String forwardingAddressId() {
return forwardingAddressId;
}
/**
* Returns the value of the PickupDetails property for this object.
*
* @return The value of the PickupDetails property for this object.
*/
public final PickupDetails pickupDetails() {
return pickupDetails;
}
@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(jobId());
hashCode = 31 * hashCode + Objects.hashCode(roleARN());
hashCode = 31 * hashCode + Objects.hashCode(notification());
hashCode = 31 * hashCode + Objects.hashCode(resources());
hashCode = 31 * hashCode + Objects.hashCode(onDeviceServiceConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(addressId());
hashCode = 31 * hashCode + Objects.hashCode(shippingOptionAsString());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(snowballCapacityPreferenceAsString());
hashCode = 31 * hashCode + Objects.hashCode(forwardingAddressId());
hashCode = 31 * hashCode + Objects.hashCode(pickupDetails());
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 UpdateJobRequest)) {
return false;
}
UpdateJobRequest other = (UpdateJobRequest) obj;
return Objects.equals(jobId(), other.jobId()) && Objects.equals(roleARN(), other.roleARN())
&& Objects.equals(notification(), other.notification()) && Objects.equals(resources(), other.resources())
&& Objects.equals(onDeviceServiceConfiguration(), other.onDeviceServiceConfiguration())
&& Objects.equals(addressId(), other.addressId())
&& Objects.equals(shippingOptionAsString(), other.shippingOptionAsString())
&& Objects.equals(description(), other.description())
&& Objects.equals(snowballCapacityPreferenceAsString(), other.snowballCapacityPreferenceAsString())
&& Objects.equals(forwardingAddressId(), other.forwardingAddressId())
&& Objects.equals(pickupDetails(), other.pickupDetails());
}
/**
* 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("UpdateJobRequest").add("JobId", jobId()).add("RoleARN", roleARN())
.add("Notification", notification()).add("Resources", resources())
.add("OnDeviceServiceConfiguration", onDeviceServiceConfiguration()).add("AddressId", addressId())
.add("ShippingOption", shippingOptionAsString()).add("Description", description())
.add("SnowballCapacityPreference", snowballCapacityPreferenceAsString())
.add("ForwardingAddressId", forwardingAddressId()).add("PickupDetails", pickupDetails()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "JobId":
return Optional.ofNullable(clazz.cast(jobId()));
case "RoleARN":
return Optional.ofNullable(clazz.cast(roleARN()));
case "Notification":
return Optional.ofNullable(clazz.cast(notification()));
case "Resources":
return Optional.ofNullable(clazz.cast(resources()));
case "OnDeviceServiceConfiguration":
return Optional.ofNullable(clazz.cast(onDeviceServiceConfiguration()));
case "AddressId":
return Optional.ofNullable(clazz.cast(addressId()));
case "ShippingOption":
return Optional.ofNullable(clazz.cast(shippingOptionAsString()));
case "Description":
return Optional.ofNullable(clazz.cast(description()));
case "SnowballCapacityPreference":
return Optional.ofNullable(clazz.cast(snowballCapacityPreferenceAsString()));
case "ForwardingAddressId":
return Optional.ofNullable(clazz.cast(forwardingAddressId()));
case "PickupDetails":
return Optional.ofNullable(clazz.cast(pickupDetails()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function