All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.sms.model.UpdateReplicationJobRequest Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Server Migration module holds the client classes that are used for communicating with AWS Server Migration Service

There is a newer version: 2.29.16
Show 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.sms.model;

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.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 UpdateReplicationJobRequest extends SmsRequest implements
        ToCopyableBuilder {
    private static final SdkField REPLICATION_JOB_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .getter(getter(UpdateReplicationJobRequest::replicationJobId)).setter(setter(Builder::replicationJobId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("replicationJobId").build()).build();

    private static final SdkField FREQUENCY_FIELD = SdkField. builder(MarshallingType.INTEGER)
            .getter(getter(UpdateReplicationJobRequest::frequency)).setter(setter(Builder::frequency))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("frequency").build()).build();

    private static final SdkField NEXT_REPLICATION_RUN_START_TIME_FIELD = SdkField
            . builder(MarshallingType.INSTANT)
            .getter(getter(UpdateReplicationJobRequest::nextReplicationRunStartTime))
            .setter(setter(Builder::nextReplicationRunStartTime))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("nextReplicationRunStartTime")
                    .build()).build();

    private static final SdkField LICENSE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
            .getter(getter(UpdateReplicationJobRequest::licenseTypeAsString)).setter(setter(Builder::licenseType))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("licenseType").build()).build();

    private static final SdkField ROLE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .getter(getter(UpdateReplicationJobRequest::roleName)).setter(setter(Builder::roleName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("roleName").build()).build();

    private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
            .getter(getter(UpdateReplicationJobRequest::description)).setter(setter(Builder::description))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("description").build()).build();

    private static final SdkField NUMBER_OF_RECENT_AMIS_TO_KEEP_FIELD = SdkField
            . builder(MarshallingType.INTEGER).getter(getter(UpdateReplicationJobRequest::numberOfRecentAmisToKeep))
            .setter(setter(Builder::numberOfRecentAmisToKeep))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("numberOfRecentAmisToKeep").build())
            .build();

    private static final SdkField ENCRYPTED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
            .getter(getter(UpdateReplicationJobRequest::encrypted)).setter(setter(Builder::encrypted))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("encrypted").build()).build();

    private static final SdkField KMS_KEY_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .getter(getter(UpdateReplicationJobRequest::kmsKeyId)).setter(setter(Builder::kmsKeyId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("kmsKeyId").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(REPLICATION_JOB_ID_FIELD,
            FREQUENCY_FIELD, NEXT_REPLICATION_RUN_START_TIME_FIELD, LICENSE_TYPE_FIELD, ROLE_NAME_FIELD, DESCRIPTION_FIELD,
            NUMBER_OF_RECENT_AMIS_TO_KEEP_FIELD, ENCRYPTED_FIELD, KMS_KEY_ID_FIELD));

    private final String replicationJobId;

    private final Integer frequency;

    private final Instant nextReplicationRunStartTime;

    private final String licenseType;

    private final String roleName;

    private final String description;

    private final Integer numberOfRecentAmisToKeep;

    private final Boolean encrypted;

    private final String kmsKeyId;

    private UpdateReplicationJobRequest(BuilderImpl builder) {
        super(builder);
        this.replicationJobId = builder.replicationJobId;
        this.frequency = builder.frequency;
        this.nextReplicationRunStartTime = builder.nextReplicationRunStartTime;
        this.licenseType = builder.licenseType;
        this.roleName = builder.roleName;
        this.description = builder.description;
        this.numberOfRecentAmisToKeep = builder.numberOfRecentAmisToKeep;
        this.encrypted = builder.encrypted;
        this.kmsKeyId = builder.kmsKeyId;
    }

    /**
     * 

* The identifier of the replication job. *

* * @return The identifier of the replication job. */ public String replicationJobId() { return replicationJobId; } /** *

* The time between consecutive replication runs, in hours. *

* * @return The time between consecutive replication runs, in hours. */ public Integer frequency() { return frequency; } /** *

* The start time of the next replication run. *

* * @return The start time of the next replication run. */ public Instant nextReplicationRunStartTime() { return nextReplicationRunStartTime; } /** *

* The license type to be used for the AMI created by a successful replication run. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #licenseType} will * return {@link LicenseType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #licenseTypeAsString}. *

* * @return The license type to be used for the AMI created by a successful replication run. * @see LicenseType */ public LicenseType licenseType() { return LicenseType.fromValue(licenseType); } /** *

* The license type to be used for the AMI created by a successful replication run. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #licenseType} will * return {@link LicenseType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #licenseTypeAsString}. *

* * @return The license type to be used for the AMI created by a successful replication run. * @see LicenseType */ public String licenseTypeAsString() { return licenseType; } /** *

* The name of the IAM role to be used by AWS SMS. *

* * @return The name of the IAM role to be used by AWS SMS. */ public String roleName() { return roleName; } /** *

* The description of the replication job. *

* * @return The description of the replication job. */ public String description() { return description; } /** *

* The maximum number of SMS-created AMIs to retain. The oldest will be deleted once the maximum number is reached * and a new AMI is created. *

* * @return The maximum number of SMS-created AMIs to retain. The oldest will be deleted once the maximum number is * reached and a new AMI is created. */ public Integer numberOfRecentAmisToKeep() { return numberOfRecentAmisToKeep; } /** *

* When true, the replication job produces encrypted AMIs . See also KmsKeyId below. *

* * @return When true, the replication job produces encrypted AMIs . See also KmsKeyId below. */ public Boolean encrypted() { return encrypted; } /** *

*

* KMS key ID for replication jobs that produce encrypted AMIs. Can be any of the following: *

*
    *
  • *

    * KMS key ID *

    *
  • *
  • *

    * KMS key alias *

    *
  • *
  • *

    * ARN referring to KMS key ID *

    *
  • *
  • *

    * ARN referring to KMS key alias *

    *
  • *
*

* If encrypted is true but a KMS key id is not specified, the customer's default KMS key for EBS is used. *

* * @return

* KMS key ID for replication jobs that produce encrypted AMIs. Can be any of the following: *

*
    *
  • *

    * KMS key ID *

    *
  • *
  • *

    * KMS key alias *

    *
  • *
  • *

    * ARN referring to KMS key ID *

    *
  • *
  • *

    * ARN referring to KMS key alias *

    *
  • *
*

* If encrypted is true but a KMS key id is not specified, the customer's default KMS key for EBS is * used. */ public String kmsKeyId() { return kmsKeyId; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(replicationJobId()); hashCode = 31 * hashCode + Objects.hashCode(frequency()); hashCode = 31 * hashCode + Objects.hashCode(nextReplicationRunStartTime()); hashCode = 31 * hashCode + Objects.hashCode(licenseTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(roleName()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(numberOfRecentAmisToKeep()); hashCode = 31 * hashCode + Objects.hashCode(encrypted()); hashCode = 31 * hashCode + Objects.hashCode(kmsKeyId()); 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 UpdateReplicationJobRequest)) { return false; } UpdateReplicationJobRequest other = (UpdateReplicationJobRequest) obj; return Objects.equals(replicationJobId(), other.replicationJobId()) && Objects.equals(frequency(), other.frequency()) && Objects.equals(nextReplicationRunStartTime(), other.nextReplicationRunStartTime()) && Objects.equals(licenseTypeAsString(), other.licenseTypeAsString()) && Objects.equals(roleName(), other.roleName()) && Objects.equals(description(), other.description()) && Objects.equals(numberOfRecentAmisToKeep(), other.numberOfRecentAmisToKeep()) && Objects.equals(encrypted(), other.encrypted()) && Objects.equals(kmsKeyId(), other.kmsKeyId()); } /** * 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("UpdateReplicationJobRequest").add("ReplicationJobId", replicationJobId()) .add("Frequency", frequency()).add("NextReplicationRunStartTime", nextReplicationRunStartTime()) .add("LicenseType", licenseTypeAsString()).add("RoleName", roleName()).add("Description", description()) .add("NumberOfRecentAmisToKeep", numberOfRecentAmisToKeep()).add("Encrypted", encrypted()) .add("KmsKeyId", kmsKeyId()).build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "replicationJobId": return Optional.ofNullable(clazz.cast(replicationJobId())); case "frequency": return Optional.ofNullable(clazz.cast(frequency())); case "nextReplicationRunStartTime": return Optional.ofNullable(clazz.cast(nextReplicationRunStartTime())); case "licenseType": return Optional.ofNullable(clazz.cast(licenseTypeAsString())); case "roleName": return Optional.ofNullable(clazz.cast(roleName())); case "description": return Optional.ofNullable(clazz.cast(description())); case "numberOfRecentAmisToKeep": return Optional.ofNullable(clazz.cast(numberOfRecentAmisToKeep())); case "encrypted": return Optional.ofNullable(clazz.cast(encrypted())); case "kmsKeyId": return Optional.ofNullable(clazz.cast(kmsKeyId())); default: return Optional.empty(); } } @Override public List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((UpdateReplicationJobRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SmsRequest.Builder, SdkPojo, CopyableBuilder { /** *

* The identifier of the replication job. *

* * @param replicationJobId * The identifier of the replication job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder replicationJobId(String replicationJobId); /** *

* The time between consecutive replication runs, in hours. *

* * @param frequency * The time between consecutive replication runs, in hours. * @return Returns a reference to this object so that method calls can be chained together. */ Builder frequency(Integer frequency); /** *

* The start time of the next replication run. *

* * @param nextReplicationRunStartTime * The start time of the next replication run. * @return Returns a reference to this object so that method calls can be chained together. */ Builder nextReplicationRunStartTime(Instant nextReplicationRunStartTime); /** *

* The license type to be used for the AMI created by a successful replication run. *

* * @param licenseType * The license type to be used for the AMI created by a successful replication run. * @see LicenseType * @return Returns a reference to this object so that method calls can be chained together. * @see LicenseType */ Builder licenseType(String licenseType); /** *

* The license type to be used for the AMI created by a successful replication run. *

* * @param licenseType * The license type to be used for the AMI created by a successful replication run. * @see LicenseType * @return Returns a reference to this object so that method calls can be chained together. * @see LicenseType */ Builder licenseType(LicenseType licenseType); /** *

* The name of the IAM role to be used by AWS SMS. *

* * @param roleName * The name of the IAM role to be used by AWS SMS. * @return Returns a reference to this object so that method calls can be chained together. */ Builder roleName(String roleName); /** *

* The description of the replication job. *

* * @param description * The description of the replication job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); /** *

* The maximum number of SMS-created AMIs to retain. The oldest will be deleted once the maximum number is * reached and a new AMI is created. *

* * @param numberOfRecentAmisToKeep * The maximum number of SMS-created AMIs to retain. The oldest will be deleted once the maximum number * is reached and a new AMI is created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder numberOfRecentAmisToKeep(Integer numberOfRecentAmisToKeep); /** *

* When true, the replication job produces encrypted AMIs . See also KmsKeyId below. *

* * @param encrypted * When true, the replication job produces encrypted AMIs . See also KmsKeyId below. * @return Returns a reference to this object so that method calls can be chained together. */ Builder encrypted(Boolean encrypted); /** *

*

* KMS key ID for replication jobs that produce encrypted AMIs. Can be any of the following: *

*
    *
  • *

    * KMS key ID *

    *
  • *
  • *

    * KMS key alias *

    *
  • *
  • *

    * ARN referring to KMS key ID *

    *
  • *
  • *

    * ARN referring to KMS key alias *

    *
  • *
*

* If encrypted is true but a KMS key id is not specified, the customer's default KMS key for EBS is * used. *

* * @param kmsKeyId *

* KMS key ID for replication jobs that produce encrypted AMIs. Can be any of the following: *

*
    *
  • *

    * KMS key ID *

    *
  • *
  • *

    * KMS key alias *

    *
  • *
  • *

    * ARN referring to KMS key ID *

    *
  • *
  • *

    * ARN referring to KMS key alias *

    *
  • *
*

* If encrypted is true but a KMS key id is not specified, the customer's default KMS key for EBS * is used. * @return Returns a reference to this object so that method calls can be chained together. */ Builder kmsKeyId(String kmsKeyId); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends SmsRequest.BuilderImpl implements Builder { private String replicationJobId; private Integer frequency; private Instant nextReplicationRunStartTime; private String licenseType; private String roleName; private String description; private Integer numberOfRecentAmisToKeep; private Boolean encrypted; private String kmsKeyId; private BuilderImpl() { } private BuilderImpl(UpdateReplicationJobRequest model) { super(model); replicationJobId(model.replicationJobId); frequency(model.frequency); nextReplicationRunStartTime(model.nextReplicationRunStartTime); licenseType(model.licenseType); roleName(model.roleName); description(model.description); numberOfRecentAmisToKeep(model.numberOfRecentAmisToKeep); encrypted(model.encrypted); kmsKeyId(model.kmsKeyId); } public final String getReplicationJobId() { return replicationJobId; } @Override public final Builder replicationJobId(String replicationJobId) { this.replicationJobId = replicationJobId; return this; } public final void setReplicationJobId(String replicationJobId) { this.replicationJobId = replicationJobId; } public final Integer getFrequency() { return frequency; } @Override public final Builder frequency(Integer frequency) { this.frequency = frequency; return this; } public final void setFrequency(Integer frequency) { this.frequency = frequency; } public final Instant getNextReplicationRunStartTime() { return nextReplicationRunStartTime; } @Override public final Builder nextReplicationRunStartTime(Instant nextReplicationRunStartTime) { this.nextReplicationRunStartTime = nextReplicationRunStartTime; return this; } public final void setNextReplicationRunStartTime(Instant nextReplicationRunStartTime) { this.nextReplicationRunStartTime = nextReplicationRunStartTime; } public final String getLicenseType() { return licenseType; } @Override public final Builder licenseType(String licenseType) { this.licenseType = licenseType; return this; } @Override public final Builder licenseType(LicenseType licenseType) { this.licenseType(licenseType == null ? null : licenseType.toString()); return this; } public final void setLicenseType(String licenseType) { this.licenseType = licenseType; } public final String getRoleName() { return roleName; } @Override public final Builder roleName(String roleName) { this.roleName = roleName; return this; } public final void setRoleName(String roleName) { this.roleName = roleName; } public final String getDescription() { return description; } @Override public final Builder description(String description) { this.description = description; return this; } public final void setDescription(String description) { this.description = description; } public final Integer getNumberOfRecentAmisToKeep() { return numberOfRecentAmisToKeep; } @Override public final Builder numberOfRecentAmisToKeep(Integer numberOfRecentAmisToKeep) { this.numberOfRecentAmisToKeep = numberOfRecentAmisToKeep; return this; } public final void setNumberOfRecentAmisToKeep(Integer numberOfRecentAmisToKeep) { this.numberOfRecentAmisToKeep = numberOfRecentAmisToKeep; } public final Boolean getEncrypted() { return encrypted; } @Override public final Builder encrypted(Boolean encrypted) { this.encrypted = encrypted; return this; } public final void setEncrypted(Boolean encrypted) { this.encrypted = encrypted; } public final String getKmsKeyId() { return kmsKeyId; } @Override public final Builder kmsKeyId(String kmsKeyId) { this.kmsKeyId = kmsKeyId; return this; } public final void setKmsKeyId(String kmsKeyId) { this.kmsKeyId = kmsKeyId; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public UpdateReplicationJobRequest build() { return new UpdateReplicationJobRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy