
software.amazon.awssdk.services.sms.model.CreateReplicationJobRequest Maven / Gradle / Ivy
/*
* Copyright 2013-2018 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.Objects;
import java.util.Optional;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
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 CreateReplicationJobRequest extends SmsRequest implements
ToCopyableBuilder {
private final String serverId;
private final Instant seedReplicationTime;
private final Integer frequency;
private final String licenseType;
private final String roleName;
private final String description;
private CreateReplicationJobRequest(BuilderImpl builder) {
super(builder);
this.serverId = builder.serverId;
this.seedReplicationTime = builder.seedReplicationTime;
this.frequency = builder.frequency;
this.licenseType = builder.licenseType;
this.roleName = builder.roleName;
this.description = builder.description;
}
/**
* Returns the value of the ServerId property for this object.
*
* @return The value of the ServerId property for this object.
*/
public String serverId() {
return serverId;
}
/**
* Returns the value of the SeedReplicationTime property for this object.
*
* @return The value of the SeedReplicationTime property for this object.
*/
public Instant seedReplicationTime() {
return seedReplicationTime;
}
/**
* Returns the value of the Frequency property for this object.
*
* @return The value of the Frequency property for this object.
*/
public Integer frequency() {
return frequency;
}
/**
* Returns the value of the LicenseType property for this object.
*
* 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 value of the LicenseType property for this object.
* @see LicenseType
*/
public LicenseType licenseType() {
return LicenseType.fromValue(licenseType);
}
/**
* Returns the value of the LicenseType property for this object.
*
* 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 value of the LicenseType property for this object.
* @see LicenseType
*/
public String licenseTypeAsString() {
return licenseType;
}
/**
* Returns the value of the RoleName property for this object.
*
* @return The value of the RoleName property for this object.
*/
public String roleName() {
return roleName;
}
/**
* Returns the value of the Description property for this object.
*
* @return The value of the Description property for this object.
*/
public String description() {
return description;
}
@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 + Objects.hashCode(serverId());
hashCode = 31 * hashCode + Objects.hashCode(seedReplicationTime());
hashCode = 31 * hashCode + Objects.hashCode(frequency());
hashCode = 31 * hashCode + Objects.hashCode(licenseTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(roleName());
hashCode = 31 * hashCode + Objects.hashCode(description());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof CreateReplicationJobRequest)) {
return false;
}
CreateReplicationJobRequest other = (CreateReplicationJobRequest) obj;
return Objects.equals(serverId(), other.serverId()) && Objects.equals(seedReplicationTime(), other.seedReplicationTime())
&& Objects.equals(frequency(), other.frequency())
&& Objects.equals(licenseTypeAsString(), other.licenseTypeAsString())
&& Objects.equals(roleName(), other.roleName()) && Objects.equals(description(), other.description());
}
@Override
public String toString() {
return ToString.builder("CreateReplicationJobRequest").add("ServerId", serverId())
.add("SeedReplicationTime", seedReplicationTime()).add("Frequency", frequency())
.add("LicenseType", licenseTypeAsString()).add("RoleName", roleName()).add("Description", description()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "serverId":
return Optional.ofNullable(clazz.cast(serverId()));
case "seedReplicationTime":
return Optional.ofNullable(clazz.cast(seedReplicationTime()));
case "frequency":
return Optional.ofNullable(clazz.cast(frequency()));
case "licenseType":
return Optional.ofNullable(clazz.cast(licenseTypeAsString()));
case "roleName":
return Optional.ofNullable(clazz.cast(roleName()));
case "description":
return Optional.ofNullable(clazz.cast(description()));
default:
return Optional.empty();
}
}
public interface Builder extends SmsRequest.Builder, CopyableBuilder {
/**
* Sets the value of the ServerId property for this object.
*
* @param serverId
* The new value for the ServerId property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder serverId(String serverId);
/**
* Sets the value of the SeedReplicationTime property for this object.
*
* @param seedReplicationTime
* The new value for the SeedReplicationTime property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder seedReplicationTime(Instant seedReplicationTime);
/**
* Sets the value of the Frequency property for this object.
*
* @param frequency
* The new value for the Frequency property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder frequency(Integer frequency);
/**
* Sets the value of the LicenseType property for this object.
*
* @param licenseType
* The new value for the LicenseType property for this object.
* @see LicenseType
* @return Returns a reference to this object so that method calls can be chained together.
* @see LicenseType
*/
Builder licenseType(String licenseType);
/**
* Sets the value of the LicenseType property for this object.
*
* @param licenseType
* The new value for the LicenseType property for this object.
* @see LicenseType
* @return Returns a reference to this object so that method calls can be chained together.
* @see LicenseType
*/
Builder licenseType(LicenseType licenseType);
/**
* Sets the value of the RoleName property for this object.
*
* @param roleName
* The new value for the RoleName property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder roleName(String roleName);
/**
* Sets the value of the Description property for this object.
*
* @param description
* The new value for the Description property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder description(String description);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer builderConsumer);
}
static final class BuilderImpl extends SmsRequest.BuilderImpl implements Builder {
private String serverId;
private Instant seedReplicationTime;
private Integer frequency;
private String licenseType;
private String roleName;
private String description;
private BuilderImpl() {
}
private BuilderImpl(CreateReplicationJobRequest model) {
super(model);
serverId(model.serverId);
seedReplicationTime(model.seedReplicationTime);
frequency(model.frequency);
licenseType(model.licenseType);
roleName(model.roleName);
description(model.description);
}
public final String getServerId() {
return serverId;
}
@Override
public final Builder serverId(String serverId) {
this.serverId = serverId;
return this;
}
public final void setServerId(String serverId) {
this.serverId = serverId;
}
public final Instant getSeedReplicationTime() {
return seedReplicationTime;
}
@Override
public final Builder seedReplicationTime(Instant seedReplicationTime) {
this.seedReplicationTime = seedReplicationTime;
return this;
}
public final void setSeedReplicationTime(Instant seedReplicationTime) {
this.seedReplicationTime = seedReplicationTime;
}
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 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.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;
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public CreateReplicationJobRequest build() {
return new CreateReplicationJobRequest(this);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy