software.amazon.awssdk.services.lambda.model.SourceAccessConfiguration Maven / Gradle / Ivy
Show all versions of lambda 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.lambda.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
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;
/**
*
* To secure and define access to your event source, you can specify the authentication protocol, VPC components, or
* virtual host.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class SourceAccessConfiguration implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField TYPE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Type")
.getter(getter(SourceAccessConfiguration::typeAsString)).setter(setter(Builder::type))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Type").build()).build();
private static final SdkField URI_FIELD = SdkField. builder(MarshallingType.STRING).memberName("URI")
.getter(getter(SourceAccessConfiguration::uri)).setter(setter(Builder::uri))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("URI").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(TYPE_FIELD, URI_FIELD));
private static final Map> SDK_NAME_TO_FIELD = Collections
.unmodifiableMap(new HashMap>() {
{
put("Type", TYPE_FIELD);
put("URI", URI_FIELD);
}
});
private static final long serialVersionUID = 1L;
private final String type;
private final String uri;
private SourceAccessConfiguration(BuilderImpl builder) {
this.type = builder.type;
this.uri = builder.uri;
}
/**
*
* The type of authentication protocol, VPC components, or virtual host for your event source. For example:
* "Type":"SASL_SCRAM_512_AUTH"
.
*
*
* -
*
* BASIC_AUTH
– (Amazon MQ) The Secrets Manager secret that stores your broker credentials.
*
*
* -
*
* BASIC_AUTH
– (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for
* SASL/PLAIN authentication of your Apache Kafka brokers.
*
*
* -
*
* VPC_SUBNET
– (Self-managed Apache Kafka) The subnets associated with your VPC. Lambda connects to
* these subnets to fetch data from your self-managed Apache Kafka cluster.
*
*
* -
*
* VPC_SECURITY_GROUP
– (Self-managed Apache Kafka) The VPC security group used to manage access to
* your self-managed Apache Kafka brokers.
*
*
* -
*
* SASL_SCRAM_256_AUTH
– (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used
* for SASL SCRAM-256 authentication of your self-managed Apache Kafka brokers.
*
*
* -
*
* SASL_SCRAM_512_AUTH
– (Amazon MSK, Self-managed Apache Kafka) The Secrets Manager ARN of your secret
* key used for SASL SCRAM-512 authentication of your self-managed Apache Kafka brokers.
*
*
* -
*
* VIRTUAL_HOST
–- (RabbitMQ) The name of the virtual host in your RabbitMQ broker. Lambda uses this
* RabbitMQ host as the event source. This property cannot be specified in an UpdateEventSourceMapping API call.
*
*
* -
*
* CLIENT_CERTIFICATE_TLS_AUTH
– (Amazon MSK, self-managed Apache Kafka) The Secrets Manager ARN of
* your secret key containing the certificate chain (X.509 PEM), private key (PKCS#8 PEM), and private key password
* (optional) used for mutual TLS authentication of your MSK/Apache Kafka brokers.
*
*
* -
*
* SERVER_ROOT_CA_CERTIFICATE
– (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key
* containing the root CA certificate (X.509 PEM) used for TLS encryption of your Apache Kafka brokers.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #type} will return
* {@link SourceAccessType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #typeAsString}.
*
*
* @return The type of authentication protocol, VPC components, or virtual host for your event source. For example:
* "Type":"SASL_SCRAM_512_AUTH"
.
*
* -
*
* BASIC_AUTH
– (Amazon MQ) The Secrets Manager secret that stores your broker credentials.
*
*
* -
*
* BASIC_AUTH
– (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for
* SASL/PLAIN authentication of your Apache Kafka brokers.
*
*
* -
*
* VPC_SUBNET
– (Self-managed Apache Kafka) The subnets associated with your VPC. Lambda
* connects to these subnets to fetch data from your self-managed Apache Kafka cluster.
*
*
* -
*
* VPC_SECURITY_GROUP
– (Self-managed Apache Kafka) The VPC security group used to manage
* access to your self-managed Apache Kafka brokers.
*
*
* -
*
* SASL_SCRAM_256_AUTH
– (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key
* used for SASL SCRAM-256 authentication of your self-managed Apache Kafka brokers.
*
*
* -
*
* SASL_SCRAM_512_AUTH
– (Amazon MSK, Self-managed Apache Kafka) The Secrets Manager ARN of
* your secret key used for SASL SCRAM-512 authentication of your self-managed Apache Kafka brokers.
*
*
* -
*
* VIRTUAL_HOST
–- (RabbitMQ) The name of the virtual host in your RabbitMQ broker. Lambda uses
* this RabbitMQ host as the event source. This property cannot be specified in an UpdateEventSourceMapping
* API call.
*
*
* -
*
* CLIENT_CERTIFICATE_TLS_AUTH
– (Amazon MSK, self-managed Apache Kafka) The Secrets Manager
* ARN of your secret key containing the certificate chain (X.509 PEM), private key (PKCS#8 PEM), and
* private key password (optional) used for mutual TLS authentication of your MSK/Apache Kafka brokers.
*
*
* -
*
* SERVER_ROOT_CA_CERTIFICATE
– (Self-managed Apache Kafka) The Secrets Manager ARN of your
* secret key containing the root CA certificate (X.509 PEM) used for TLS encryption of your Apache Kafka
* brokers.
*
*
* @see SourceAccessType
*/
public final SourceAccessType type() {
return SourceAccessType.fromValue(type);
}
/**
*
* The type of authentication protocol, VPC components, or virtual host for your event source. For example:
* "Type":"SASL_SCRAM_512_AUTH"
.
*
*
* -
*
* BASIC_AUTH
– (Amazon MQ) The Secrets Manager secret that stores your broker credentials.
*
*
* -
*
* BASIC_AUTH
– (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for
* SASL/PLAIN authentication of your Apache Kafka brokers.
*
*
* -
*
* VPC_SUBNET
– (Self-managed Apache Kafka) The subnets associated with your VPC. Lambda connects to
* these subnets to fetch data from your self-managed Apache Kafka cluster.
*
*
* -
*
* VPC_SECURITY_GROUP
– (Self-managed Apache Kafka) The VPC security group used to manage access to
* your self-managed Apache Kafka brokers.
*
*
* -
*
* SASL_SCRAM_256_AUTH
– (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used
* for SASL SCRAM-256 authentication of your self-managed Apache Kafka brokers.
*
*
* -
*
* SASL_SCRAM_512_AUTH
– (Amazon MSK, Self-managed Apache Kafka) The Secrets Manager ARN of your secret
* key used for SASL SCRAM-512 authentication of your self-managed Apache Kafka brokers.
*
*
* -
*
* VIRTUAL_HOST
–- (RabbitMQ) The name of the virtual host in your RabbitMQ broker. Lambda uses this
* RabbitMQ host as the event source. This property cannot be specified in an UpdateEventSourceMapping API call.
*
*
* -
*
* CLIENT_CERTIFICATE_TLS_AUTH
– (Amazon MSK, self-managed Apache Kafka) The Secrets Manager ARN of
* your secret key containing the certificate chain (X.509 PEM), private key (PKCS#8 PEM), and private key password
* (optional) used for mutual TLS authentication of your MSK/Apache Kafka brokers.
*
*
* -
*
* SERVER_ROOT_CA_CERTIFICATE
– (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key
* containing the root CA certificate (X.509 PEM) used for TLS encryption of your Apache Kafka brokers.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #type} will return
* {@link SourceAccessType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #typeAsString}.
*
*
* @return The type of authentication protocol, VPC components, or virtual host for your event source. For example:
* "Type":"SASL_SCRAM_512_AUTH"
.
*
* -
*
* BASIC_AUTH
– (Amazon MQ) The Secrets Manager secret that stores your broker credentials.
*
*
* -
*
* BASIC_AUTH
– (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for
* SASL/PLAIN authentication of your Apache Kafka brokers.
*
*
* -
*
* VPC_SUBNET
– (Self-managed Apache Kafka) The subnets associated with your VPC. Lambda
* connects to these subnets to fetch data from your self-managed Apache Kafka cluster.
*
*
* -
*
* VPC_SECURITY_GROUP
– (Self-managed Apache Kafka) The VPC security group used to manage
* access to your self-managed Apache Kafka brokers.
*
*
* -
*
* SASL_SCRAM_256_AUTH
– (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key
* used for SASL SCRAM-256 authentication of your self-managed Apache Kafka brokers.
*
*
* -
*
* SASL_SCRAM_512_AUTH
– (Amazon MSK, Self-managed Apache Kafka) The Secrets Manager ARN of
* your secret key used for SASL SCRAM-512 authentication of your self-managed Apache Kafka brokers.
*
*
* -
*
* VIRTUAL_HOST
–- (RabbitMQ) The name of the virtual host in your RabbitMQ broker. Lambda uses
* this RabbitMQ host as the event source. This property cannot be specified in an UpdateEventSourceMapping
* API call.
*
*
* -
*
* CLIENT_CERTIFICATE_TLS_AUTH
– (Amazon MSK, self-managed Apache Kafka) The Secrets Manager
* ARN of your secret key containing the certificate chain (X.509 PEM), private key (PKCS#8 PEM), and
* private key password (optional) used for mutual TLS authentication of your MSK/Apache Kafka brokers.
*
*
* -
*
* SERVER_ROOT_CA_CERTIFICATE
– (Self-managed Apache Kafka) The Secrets Manager ARN of your
* secret key containing the root CA certificate (X.509 PEM) used for TLS encryption of your Apache Kafka
* brokers.
*
*
* @see SourceAccessType
*/
public final String typeAsString() {
return type;
}
/**
*
* The value for your chosen configuration in Type
. For example:
* "URI": "arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName"
.
*
*
* @return The value for your chosen configuration in Type
. For example:
* "URI": "arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName"
.
*/
public final String uri() {
return uri;
}
@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 + Objects.hashCode(typeAsString());
hashCode = 31 * hashCode + Objects.hashCode(uri());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof SourceAccessConfiguration)) {
return false;
}
SourceAccessConfiguration other = (SourceAccessConfiguration) obj;
return Objects.equals(typeAsString(), other.typeAsString()) && Objects.equals(uri(), other.uri());
}
/**
* 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("SourceAccessConfiguration").add("Type", typeAsString()).add("URI", uri()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Type":
return Optional.ofNullable(clazz.cast(typeAsString()));
case "URI":
return Optional.ofNullable(clazz.cast(uri()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Function