software.amazon.awssdk.services.transfer.model.CreateServerRequest Maven / Gradle / Ivy
Show all versions of transfer 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.transfer.model;
import java.util.Arrays;
import java.util.Collection;
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 java.util.stream.Collectors;
import java.util.stream.Stream;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
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 CreateServerRequest extends TransferRequest implements
ToCopyableBuilder {
private static final SdkField CERTIFICATE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Certificate").getter(getter(CreateServerRequest::certificate)).setter(setter(Builder::certificate))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Certificate").build()).build();
private static final SdkField DOMAIN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Domain")
.getter(getter(CreateServerRequest::domainAsString)).setter(setter(Builder::domain))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Domain").build()).build();
private static final SdkField ENDPOINT_DETAILS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("EndpointDetails")
.getter(getter(CreateServerRequest::endpointDetails)).setter(setter(Builder::endpointDetails))
.constructor(EndpointDetails::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EndpointDetails").build()).build();
private static final SdkField ENDPOINT_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("EndpointType").getter(getter(CreateServerRequest::endpointTypeAsString))
.setter(setter(Builder::endpointType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EndpointType").build()).build();
private static final SdkField HOST_KEY_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("HostKey").getter(getter(CreateServerRequest::hostKey)).setter(setter(Builder::hostKey))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HostKey").build()).build();
private static final SdkField IDENTITY_PROVIDER_DETAILS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("IdentityProviderDetails")
.getter(getter(CreateServerRequest::identityProviderDetails)).setter(setter(Builder::identityProviderDetails))
.constructor(IdentityProviderDetails::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IdentityProviderDetails").build())
.build();
private static final SdkField IDENTITY_PROVIDER_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("IdentityProviderType").getter(getter(CreateServerRequest::identityProviderTypeAsString))
.setter(setter(Builder::identityProviderType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IdentityProviderType").build())
.build();
private static final SdkField LOGGING_ROLE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("LoggingRole").getter(getter(CreateServerRequest::loggingRole)).setter(setter(Builder::loggingRole))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LoggingRole").build()).build();
private static final SdkField> PROTOCOLS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Protocols")
.getter(getter(CreateServerRequest::protocolsAsStrings))
.setter(setter(Builder::protocolsWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Protocols").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField SECURITY_POLICY_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SecurityPolicyName").getter(getter(CreateServerRequest::securityPolicyName))
.setter(setter(Builder::securityPolicyName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SecurityPolicyName").build())
.build();
private static final SdkField> TAGS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Tags")
.getter(getter(CreateServerRequest::tags))
.setter(setter(Builder::tags))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Tags").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(Tag::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CERTIFICATE_FIELD,
DOMAIN_FIELD, ENDPOINT_DETAILS_FIELD, ENDPOINT_TYPE_FIELD, HOST_KEY_FIELD, IDENTITY_PROVIDER_DETAILS_FIELD,
IDENTITY_PROVIDER_TYPE_FIELD, LOGGING_ROLE_FIELD, PROTOCOLS_FIELD, SECURITY_POLICY_NAME_FIELD, TAGS_FIELD));
private final String certificate;
private final String domain;
private final EndpointDetails endpointDetails;
private final String endpointType;
private final String hostKey;
private final IdentityProviderDetails identityProviderDetails;
private final String identityProviderType;
private final String loggingRole;
private final List protocols;
private final String securityPolicyName;
private final List tags;
private CreateServerRequest(BuilderImpl builder) {
super(builder);
this.certificate = builder.certificate;
this.domain = builder.domain;
this.endpointDetails = builder.endpointDetails;
this.endpointType = builder.endpointType;
this.hostKey = builder.hostKey;
this.identityProviderDetails = builder.identityProviderDetails;
this.identityProviderType = builder.identityProviderType;
this.loggingRole = builder.loggingRole;
this.protocols = builder.protocols;
this.securityPolicyName = builder.securityPolicyName;
this.tags = builder.tags;
}
/**
*
* The Amazon Resource Name (ARN) of the AWS Certificate Manager (ACM) certificate. Required when
* Protocols
is set to FTPS
.
*
*
* To request a new public certificate, see Request a public
* certificate in the AWS Certificate Manager User Guide.
*
*
* To import an existing certificate into ACM, see Importing certificates into
* ACM in the AWS Certificate Manager User Guide.
*
*
* To request a private certificate to use FTPS through private IP addresses, see Request a private
* certificate in the AWS Certificate Manager User Guide.
*
*
* Certificates with the following cryptographic algorithms and key sizes are supported:
*
*
* -
*
* 2048-bit RSA (RSA_2048)
*
*
* -
*
* 4096-bit RSA (RSA_4096)
*
*
* -
*
* Elliptic Prime Curve 256 bit (EC_prime256v1)
*
*
* -
*
* Elliptic Prime Curve 384 bit (EC_secp384r1)
*
*
* -
*
* Elliptic Prime Curve 521 bit (EC_secp521r1)
*
*
*
*
*
* The certificate must be a valid SSL/TLS X.509 version 3 certificate with FQDN or IP address specified and
* information about the issuer.
*
*
*
* @return The Amazon Resource Name (ARN) of the AWS Certificate Manager (ACM) certificate. Required when
* Protocols
is set to FTPS
.
*
* To request a new public certificate, see Request a public
* certificate in the AWS Certificate Manager User Guide.
*
*
* To import an existing certificate into ACM, see Importing certificates
* into ACM in the AWS Certificate Manager User Guide.
*
*
* To request a private certificate to use FTPS through private IP addresses, see Request a private
* certificate in the AWS Certificate Manager User Guide.
*
*
* Certificates with the following cryptographic algorithms and key sizes are supported:
*
*
* -
*
* 2048-bit RSA (RSA_2048)
*
*
* -
*
* 4096-bit RSA (RSA_4096)
*
*
* -
*
* Elliptic Prime Curve 256 bit (EC_prime256v1)
*
*
* -
*
* Elliptic Prime Curve 384 bit (EC_secp384r1)
*
*
* -
*
* Elliptic Prime Curve 521 bit (EC_secp521r1)
*
*
*
*
*
* The certificate must be a valid SSL/TLS X.509 version 3 certificate with FQDN or IP address specified and
* information about the issuer.
*
*/
public final String certificate() {
return certificate;
}
/**
* Returns the value of the Domain property for this object.
*
* If the service returns an enum value that is not available in the current SDK version, {@link #domain} will
* return {@link Domain#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #domainAsString}.
*
*
* @return The value of the Domain property for this object.
* @see Domain
*/
public final Domain domain() {
return Domain.fromValue(domain);
}
/**
* Returns the value of the Domain property for this object.
*
* If the service returns an enum value that is not available in the current SDK version, {@link #domain} will
* return {@link Domain#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #domainAsString}.
*
*
* @return The value of the Domain property for this object.
* @see Domain
*/
public final String domainAsString() {
return domain;
}
/**
*
* The virtual private cloud (VPC) endpoint settings that are configured for your server. When you host your
* endpoint within your VPC, you can make it accessible only to resources within your VPC, or you can attach Elastic
* IPs and make it accessible to clients over the internet. Your VPC's default security groups are automatically
* assigned to your endpoint.
*
*
* @return The virtual private cloud (VPC) endpoint settings that are configured for your server. When you host your
* endpoint within your VPC, you can make it accessible only to resources within your VPC, or you can attach
* Elastic IPs and make it accessible to clients over the internet. Your VPC's default security groups are
* automatically assigned to your endpoint.
*/
public final EndpointDetails endpointDetails() {
return endpointDetails;
}
/**
*
* The type of VPC endpoint that you want your server to connect to. You can choose to connect to the public
* internet or a VPC endpoint. With a VPC endpoint, you can restrict access to your server and resources only within
* your VPC.
*
*
*
* It is recommended that you use VPC
as the EndpointType
. With this endpoint type, you
* have the option to directly associate up to three Elastic IPv4 addresses (BYO IP included) with your server's
* endpoint and use VPC security groups to restrict traffic by the client's public IP address. This is not possible
* with EndpointType
set to VPC_ENDPOINT
.
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #endpointType} will
* return {@link EndpointType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #endpointTypeAsString}.
*
*
* @return The type of VPC endpoint that you want your server to connect to. You can choose to connect to the public
* internet or a VPC endpoint. With a VPC endpoint, you can restrict access to your server and resources
* only within your VPC.
*
* It is recommended that you use VPC
as the EndpointType
. With this endpoint
* type, you have the option to directly associate up to three Elastic IPv4 addresses (BYO IP included) with
* your server's endpoint and use VPC security groups to restrict traffic by the client's public IP address.
* This is not possible with EndpointType
set to VPC_ENDPOINT
.
*
* @see EndpointType
*/
public final EndpointType endpointType() {
return EndpointType.fromValue(endpointType);
}
/**
*
* The type of VPC endpoint that you want your server to connect to. You can choose to connect to the public
* internet or a VPC endpoint. With a VPC endpoint, you can restrict access to your server and resources only within
* your VPC.
*
*
*
* It is recommended that you use VPC
as the EndpointType
. With this endpoint type, you
* have the option to directly associate up to three Elastic IPv4 addresses (BYO IP included) with your server's
* endpoint and use VPC security groups to restrict traffic by the client's public IP address. This is not possible
* with EndpointType
set to VPC_ENDPOINT
.
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #endpointType} will
* return {@link EndpointType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #endpointTypeAsString}.
*
*
* @return The type of VPC endpoint that you want your server to connect to. You can choose to connect to the public
* internet or a VPC endpoint. With a VPC endpoint, you can restrict access to your server and resources
* only within your VPC.
*
* It is recommended that you use VPC
as the EndpointType
. With this endpoint
* type, you have the option to directly associate up to three Elastic IPv4 addresses (BYO IP included) with
* your server's endpoint and use VPC security groups to restrict traffic by the client's public IP address.
* This is not possible with EndpointType
set to VPC_ENDPOINT
.
*
* @see EndpointType
*/
public final String endpointTypeAsString() {
return endpointType;
}
/**
*
* The RSA private key as generated by the ssh-keygen -N "" -m PEM -f my-new-server-key
command.
*
*
*
* If you aren't planning to migrate existing users from an existing SFTP-enabled server to a new server, don't
* update the host key. Accidentally changing a server's host key can be disruptive.
*
*
*
* For more information, see Change the host key for your SFTP-enabled server in the AWS Transfer Family User Guide.
*
*
* @return The RSA private key as generated by the ssh-keygen -N "" -m PEM -f my-new-server-key
* command.
*
* If you aren't planning to migrate existing users from an existing SFTP-enabled server to a new server,
* don't update the host key. Accidentally changing a server's host key can be disruptive.
*
*
*
* For more information, see Change the host key for your SFTP-enabled server in the AWS Transfer Family User Guide.
*/
public final String hostKey() {
return hostKey;
}
/**
*
* Required when IdentityProviderType
is set to API_GATEWAY
. Accepts an array containing
* all of the information required to call a customer-supplied authentication API, including the API Gateway URL.
* Not required when IdentityProviderType
is set to SERVICE_MANAGED
.
*
*
* @return Required when IdentityProviderType
is set to API_GATEWAY
. Accepts an array
* containing all of the information required to call a customer-supplied authentication API, including the
* API Gateway URL. Not required when IdentityProviderType
is set to
* SERVICE_MANAGED
.
*/
public final IdentityProviderDetails identityProviderDetails() {
return identityProviderDetails;
}
/**
*
* Specifies the mode of authentication for a server. The default value is SERVICE_MANAGED
, which
* allows you to store and access user credentials within the AWS Transfer Family service. Use the
* API_GATEWAY
value to integrate with an identity provider of your choosing. The
* API_GATEWAY
setting requires you to provide an API Gateway endpoint URL to call for authentication
* using the IdentityProviderDetails
parameter.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #identityProviderType} will return {@link IdentityProviderType#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #identityProviderTypeAsString}.
*
*
* @return Specifies the mode of authentication for a server. The default value is SERVICE_MANAGED
,
* which allows you to store and access user credentials within the AWS Transfer Family service. Use the
* API_GATEWAY
value to integrate with an identity provider of your choosing. The
* API_GATEWAY
setting requires you to provide an API Gateway endpoint URL to call for
* authentication using the IdentityProviderDetails
parameter.
* @see IdentityProviderType
*/
public final IdentityProviderType identityProviderType() {
return IdentityProviderType.fromValue(identityProviderType);
}
/**
*
* Specifies the mode of authentication for a server. The default value is SERVICE_MANAGED
, which
* allows you to store and access user credentials within the AWS Transfer Family service. Use the
* API_GATEWAY
value to integrate with an identity provider of your choosing. The
* API_GATEWAY
setting requires you to provide an API Gateway endpoint URL to call for authentication
* using the IdentityProviderDetails
parameter.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #identityProviderType} will return {@link IdentityProviderType#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #identityProviderTypeAsString}.
*
*
* @return Specifies the mode of authentication for a server. The default value is SERVICE_MANAGED
,
* which allows you to store and access user credentials within the AWS Transfer Family service. Use the
* API_GATEWAY
value to integrate with an identity provider of your choosing. The
* API_GATEWAY
setting requires you to provide an API Gateway endpoint URL to call for
* authentication using the IdentityProviderDetails
parameter.
* @see IdentityProviderType
*/
public final String identityProviderTypeAsString() {
return identityProviderType;
}
/**
*
* Allows the service to write your users' activity to your Amazon CloudWatch logs for monitoring and auditing
* purposes.
*
*
* @return Allows the service to write your users' activity to your Amazon CloudWatch logs for monitoring and
* auditing purposes.
*/
public final String loggingRole() {
return loggingRole;
}
/**
*
* Specifies the file transfer protocol or protocols over which your file transfer protocol client can connect to
* your server's endpoint. The available protocols are:
*
*
* -
*
* SFTP
(Secure Shell (SSH) File Transfer Protocol): File transfer over SSH
*
*
* -
*
* FTPS
(File Transfer Protocol Secure): File transfer with TLS encryption
*
*
* -
*
* FTP
(File Transfer Protocol): Unencrypted file transfer
*
*
*
*
*
* If you select FTPS
, you must choose a certificate stored in AWS Certificate Manager (ACM) which will
* be used to identify your server when clients connect to it over FTPS.
*
*
* If Protocol
includes either FTP
or FTPS
, then the
* EndpointType
must be VPC
and the IdentityProviderType
must be
* API_GATEWAY
.
*
*
* If Protocol
includes FTP
, then AddressAllocationIds
cannot be associated.
*
*
* If Protocol
is set only to SFTP
, the EndpointType
can be set to
* PUBLIC
and the IdentityProviderType
can be set to SERVICE_MANAGED
.
*
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasProtocols()} to see if a value was sent in this field.
*
*
* @return Specifies the file transfer protocol or protocols over which your file transfer protocol client can
* connect to your server's endpoint. The available protocols are:
*
* -
*
* SFTP
(Secure Shell (SSH) File Transfer Protocol): File transfer over SSH
*
*
* -
*
* FTPS
(File Transfer Protocol Secure): File transfer with TLS encryption
*
*
* -
*
* FTP
(File Transfer Protocol): Unencrypted file transfer
*
*
*
*
*
* If you select FTPS
, you must choose a certificate stored in AWS Certificate Manager (ACM)
* which will be used to identify your server when clients connect to it over FTPS.
*
*
* If Protocol
includes either FTP
or FTPS
, then the
* EndpointType
must be VPC
and the IdentityProviderType
must be
* API_GATEWAY
.
*
*
* If Protocol
includes FTP
, then AddressAllocationIds
cannot be
* associated.
*
*
* If Protocol
is set only to SFTP
, the EndpointType
can be set to
* PUBLIC
and the IdentityProviderType
can be set to SERVICE_MANAGED
.
*
*/
public final List protocols() {
return ProtocolsCopier.copyStringToEnum(protocols);
}
/**
* Returns true if the Protocols property was specified by the sender (it may be empty), or false if the sender did
* not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public final boolean hasProtocols() {
return protocols != null && !(protocols instanceof SdkAutoConstructList);
}
/**
*
* Specifies the file transfer protocol or protocols over which your file transfer protocol client can connect to
* your server's endpoint. The available protocols are:
*
*
* -
*
* SFTP
(Secure Shell (SSH) File Transfer Protocol): File transfer over SSH
*
*
* -
*
* FTPS
(File Transfer Protocol Secure): File transfer with TLS encryption
*
*
* -
*
* FTP
(File Transfer Protocol): Unencrypted file transfer
*
*
*
*
*
* If you select FTPS
, you must choose a certificate stored in AWS Certificate Manager (ACM) which will
* be used to identify your server when clients connect to it over FTPS.
*
*
* If Protocol
includes either FTP
or FTPS
, then the
* EndpointType
must be VPC
and the IdentityProviderType
must be
* API_GATEWAY
.
*
*
* If Protocol
includes FTP
, then AddressAllocationIds
cannot be associated.
*
*
* If Protocol
is set only to SFTP
, the EndpointType
can be set to
* PUBLIC
and the IdentityProviderType
can be set to SERVICE_MANAGED
.
*
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasProtocols()} to see if a value was sent in this field.
*
*
* @return Specifies the file transfer protocol or protocols over which your file transfer protocol client can
* connect to your server's endpoint. The available protocols are:
*
* -
*
* SFTP
(Secure Shell (SSH) File Transfer Protocol): File transfer over SSH
*
*
* -
*
* FTPS
(File Transfer Protocol Secure): File transfer with TLS encryption
*
*
* -
*
* FTP
(File Transfer Protocol): Unencrypted file transfer
*
*
*
*
*
* If you select FTPS
, you must choose a certificate stored in AWS Certificate Manager (ACM)
* which will be used to identify your server when clients connect to it over FTPS.
*
*
* If Protocol
includes either FTP
or FTPS
, then the
* EndpointType
must be VPC
and the IdentityProviderType
must be
* API_GATEWAY
.
*
*
* If Protocol
includes FTP
, then AddressAllocationIds
cannot be
* associated.
*
*
* If Protocol
is set only to SFTP
, the EndpointType
can be set to
* PUBLIC
and the IdentityProviderType
can be set to SERVICE_MANAGED
.
*
*/
public final List protocolsAsStrings() {
return protocols;
}
/**
*
* Specifies the name of the security policy that is attached to the server.
*
*
* @return Specifies the name of the security policy that is attached to the server.
*/
public final String securityPolicyName() {
return securityPolicyName;
}
/**
* Returns true if the Tags property was specified by the sender (it may be empty), or false if the sender did not
* specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public final boolean hasTags() {
return tags != null && !(tags instanceof SdkAutoConstructList);
}
/**
*
* Key-value pairs that can be used to group and search for servers.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasTags()} to see if a value was sent in this field.
*
*
* @return Key-value pairs that can be used to group and search for servers.
*/
public final List tags() {
return tags;
}
@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(certificate());
hashCode = 31 * hashCode + Objects.hashCode(domainAsString());
hashCode = 31 * hashCode + Objects.hashCode(endpointDetails());
hashCode = 31 * hashCode + Objects.hashCode(endpointTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(hostKey());
hashCode = 31 * hashCode + Objects.hashCode(identityProviderDetails());
hashCode = 31 * hashCode + Objects.hashCode(identityProviderTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(loggingRole());
hashCode = 31 * hashCode + Objects.hashCode(hasProtocols() ? protocolsAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(securityPolicyName());
hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null);
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 CreateServerRequest)) {
return false;
}
CreateServerRequest other = (CreateServerRequest) obj;
return Objects.equals(certificate(), other.certificate()) && Objects.equals(domainAsString(), other.domainAsString())
&& Objects.equals(endpointDetails(), other.endpointDetails())
&& Objects.equals(endpointTypeAsString(), other.endpointTypeAsString())
&& Objects.equals(hostKey(), other.hostKey())
&& Objects.equals(identityProviderDetails(), other.identityProviderDetails())
&& Objects.equals(identityProviderTypeAsString(), other.identityProviderTypeAsString())
&& Objects.equals(loggingRole(), other.loggingRole()) && hasProtocols() == other.hasProtocols()
&& Objects.equals(protocolsAsStrings(), other.protocolsAsStrings())
&& Objects.equals(securityPolicyName(), other.securityPolicyName()) && hasTags() == other.hasTags()
&& Objects.equals(tags(), other.tags());
}
/**
* 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("CreateServerRequest").add("Certificate", certificate()).add("Domain", domainAsString())
.add("EndpointDetails", endpointDetails()).add("EndpointType", endpointTypeAsString())
.add("HostKey", hostKey() == null ? null : "*** Sensitive Data Redacted ***")
.add("IdentityProviderDetails", identityProviderDetails())
.add("IdentityProviderType", identityProviderTypeAsString()).add("LoggingRole", loggingRole())
.add("Protocols", hasProtocols() ? protocolsAsStrings() : null).add("SecurityPolicyName", securityPolicyName())
.add("Tags", hasTags() ? tags() : null).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Certificate":
return Optional.ofNullable(clazz.cast(certificate()));
case "Domain":
return Optional.ofNullable(clazz.cast(domainAsString()));
case "EndpointDetails":
return Optional.ofNullable(clazz.cast(endpointDetails()));
case "EndpointType":
return Optional.ofNullable(clazz.cast(endpointTypeAsString()));
case "HostKey":
return Optional.ofNullable(clazz.cast(hostKey()));
case "IdentityProviderDetails":
return Optional.ofNullable(clazz.cast(identityProviderDetails()));
case "IdentityProviderType":
return Optional.ofNullable(clazz.cast(identityProviderTypeAsString()));
case "LoggingRole":
return Optional.ofNullable(clazz.cast(loggingRole()));
case "Protocols":
return Optional.ofNullable(clazz.cast(protocolsAsStrings()));
case "SecurityPolicyName":
return Optional.ofNullable(clazz.cast(securityPolicyName()));
case "Tags":
return Optional.ofNullable(clazz.cast(tags()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function