
software.amazon.awssdk.services.snowball.model.UpdateJobRequest Maven / Gradle / Ivy
/*
* 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)
.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)
.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)
.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)
.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 ADDRESS_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.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)
.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)
.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)
.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)
.getter(getter(UpdateJobRequest::forwardingAddressId)).setter(setter(Builder::forwardingAddressId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ForwardingAddressId").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(JOB_ID_FIELD, ROLE_ARN_FIELD,
NOTIFICATION_FIELD, RESOURCES_FIELD, ADDRESS_ID_FIELD, SHIPPING_OPTION_FIELD, DESCRIPTION_FIELD,
SNOWBALL_CAPACITY_PREFERENCE_FIELD, FORWARDING_ADDRESS_ID_FIELD));
private final String jobId;
private final String roleARN;
private final Notification notification;
private final JobResource resources;
private final String addressId;
private final String shippingOption;
private final String description;
private final String snowballCapacityPreference;
private final String forwardingAddressId;
private UpdateJobRequest(BuilderImpl builder) {
super(builder);
this.jobId = builder.jobId;
this.roleARN = builder.roleARN;
this.notification = builder.notification;
this.resources = builder.resources;
this.addressId = builder.addressId;
this.shippingOption = builder.shippingOption;
this.description = builder.description;
this.snowballCapacityPreference = builder.snowballCapacityPreference;
this.forwardingAddressId = builder.forwardingAddressId;
}
/**
*
* 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 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
* CreateRoleAWS Identity 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 CreateRoleAWS Identity
* and Access Management (IAM) API action.
*/
public String roleARN() {
return roleARN;
}
/**
*
* The new or updated Notification object.
*
*
* @return The new or updated Notification object.
*/
public Notification notification() {
return notification;
}
/**
*
* The updated JobResource
object, or the updated JobResource object.
*
*
* @return The updated JobResource
object, or the updated JobResource object.
*/
public JobResource resources() {
return resources;
}
/**
*
* The ID of the updated Address object.
*
*
* @return The ID of the updated Address object.
*/
public 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 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 String shippingOptionAsString() {
return shippingOption;
}
/**
*
* The updated description of this job's JobMetadata object.
*
*
* @return The updated description of this job's JobMetadata object.
*/
public String description() {
return description;
}
/**
*
* The updated SnowballCapacityPreference
of this job's JobMetadata object. The 50 TB Snowballs
* are only available in the US regions.
*
*
* 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.
* @see SnowballCapacity
*/
public 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.
*
*
* 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.
* @see SnowballCapacity
*/
public 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 String forwardingAddressId() {
return forwardingAddressId;
}
@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 + 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(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());
return hashCode;
}
@Override
public boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public 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(addressId(), other.addressId())
&& Objects.equals(shippingOptionAsString(), other.shippingOptionAsString())
&& Objects.equals(description(), other.description())
&& Objects.equals(snowballCapacityPreferenceAsString(), other.snowballCapacityPreferenceAsString())
&& Objects.equals(forwardingAddressId(), other.forwardingAddressId());
}
/**
* 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("UpdateJobRequest").add("JobId", jobId()).add("RoleARN", roleARN())
.add("Notification", notification()).add("Resources", resources()).add("AddressId", addressId())
.add("ShippingOption", shippingOptionAsString()).add("Description", description())
.add("SnowballCapacityPreference", snowballCapacityPreferenceAsString())
.add("ForwardingAddressId", forwardingAddressId()).build();
}
public 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 "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()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function