software.amazon.awssdk.services.kendra.model.ConfluenceConfiguration Maven / Gradle / Ivy
Show all versions of kendra 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.kendra.model;
import java.io.Serializable;
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 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.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;
/**
*
* Provides the configuration information to connect to Confluence as your data source.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class ConfluenceConfiguration implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField SERVER_URL_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ServerUrl").getter(getter(ConfluenceConfiguration::serverUrl)).setter(setter(Builder::serverUrl))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ServerUrl").build()).build();
private static final SdkField SECRET_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SecretArn").getter(getter(ConfluenceConfiguration::secretArn)).setter(setter(Builder::secretArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SecretArn").build()).build();
private static final SdkField VERSION_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Version")
.getter(getter(ConfluenceConfiguration::versionAsString)).setter(setter(Builder::version))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Version").build()).build();
private static final SdkField SPACE_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("SpaceConfiguration")
.getter(getter(ConfluenceConfiguration::spaceConfiguration)).setter(setter(Builder::spaceConfiguration))
.constructor(ConfluenceSpaceConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SpaceConfiguration").build())
.build();
private static final SdkField PAGE_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("PageConfiguration")
.getter(getter(ConfluenceConfiguration::pageConfiguration)).setter(setter(Builder::pageConfiguration))
.constructor(ConfluencePageConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PageConfiguration").build()).build();
private static final SdkField BLOG_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("BlogConfiguration")
.getter(getter(ConfluenceConfiguration::blogConfiguration)).setter(setter(Builder::blogConfiguration))
.constructor(ConfluenceBlogConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BlogConfiguration").build()).build();
private static final SdkField ATTACHMENT_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("AttachmentConfiguration")
.getter(getter(ConfluenceConfiguration::attachmentConfiguration)).setter(setter(Builder::attachmentConfiguration))
.constructor(ConfluenceAttachmentConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AttachmentConfiguration").build())
.build();
private static final SdkField VPC_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("VpcConfiguration")
.getter(getter(ConfluenceConfiguration::vpcConfiguration)).setter(setter(Builder::vpcConfiguration))
.constructor(DataSourceVpcConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VpcConfiguration").build()).build();
private static final SdkField> INCLUSION_PATTERNS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("InclusionPatterns")
.getter(getter(ConfluenceConfiguration::inclusionPatterns))
.setter(setter(Builder::inclusionPatterns))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InclusionPatterns").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> EXCLUSION_PATTERNS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("ExclusionPatterns")
.getter(getter(ConfluenceConfiguration::exclusionPatterns))
.setter(setter(Builder::exclusionPatterns))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ExclusionPatterns").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 PROXY_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("ProxyConfiguration")
.getter(getter(ConfluenceConfiguration::proxyConfiguration)).setter(setter(Builder::proxyConfiguration))
.constructor(ProxyConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ProxyConfiguration").build())
.build();
private static final SdkField AUTHENTICATION_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("AuthenticationType").getter(getter(ConfluenceConfiguration::authenticationTypeAsString))
.setter(setter(Builder::authenticationType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AuthenticationType").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(SERVER_URL_FIELD,
SECRET_ARN_FIELD, VERSION_FIELD, SPACE_CONFIGURATION_FIELD, PAGE_CONFIGURATION_FIELD, BLOG_CONFIGURATION_FIELD,
ATTACHMENT_CONFIGURATION_FIELD, VPC_CONFIGURATION_FIELD, INCLUSION_PATTERNS_FIELD, EXCLUSION_PATTERNS_FIELD,
PROXY_CONFIGURATION_FIELD, AUTHENTICATION_TYPE_FIELD));
private static final long serialVersionUID = 1L;
private final String serverUrl;
private final String secretArn;
private final String version;
private final ConfluenceSpaceConfiguration spaceConfiguration;
private final ConfluencePageConfiguration pageConfiguration;
private final ConfluenceBlogConfiguration blogConfiguration;
private final ConfluenceAttachmentConfiguration attachmentConfiguration;
private final DataSourceVpcConfiguration vpcConfiguration;
private final List inclusionPatterns;
private final List exclusionPatterns;
private final ProxyConfiguration proxyConfiguration;
private final String authenticationType;
private ConfluenceConfiguration(BuilderImpl builder) {
this.serverUrl = builder.serverUrl;
this.secretArn = builder.secretArn;
this.version = builder.version;
this.spaceConfiguration = builder.spaceConfiguration;
this.pageConfiguration = builder.pageConfiguration;
this.blogConfiguration = builder.blogConfiguration;
this.attachmentConfiguration = builder.attachmentConfiguration;
this.vpcConfiguration = builder.vpcConfiguration;
this.inclusionPatterns = builder.inclusionPatterns;
this.exclusionPatterns = builder.exclusionPatterns;
this.proxyConfiguration = builder.proxyConfiguration;
this.authenticationType = builder.authenticationType;
}
/**
*
* The URL of your Confluence instance. Use the full URL of the server. For example,
* https://server.example.com:port/. You can also use an IP address, for example,
* https://192.168.1.113/.
*
*
* @return The URL of your Confluence instance. Use the full URL of the server. For example,
* https://server.example.com:port/. You can also use an IP address, for example,
* https://192.168.1.113/.
*/
public final String serverUrl() {
return serverUrl;
}
/**
*
* The Amazon Resource Name (ARN) of an Secrets Manager secret that contains the user name and password required to
* connect to the Confluence instance. If you use Confluence Cloud, you use a generated API token as the password.
*
*
* You can also provide authentication credentials in the form of a personal access token. For more information, see
* Using a Confluence data
* source.
*
*
* @return The Amazon Resource Name (ARN) of an Secrets Manager secret that contains the user name and password
* required to connect to the Confluence instance. If you use Confluence Cloud, you use a generated API
* token as the password.
*
* You can also provide authentication credentials in the form of a personal access token. For more
* information, see Using
* a Confluence data source.
*/
public final String secretArn() {
return secretArn;
}
/**
*
* The version or the type of Confluence installation to connect to.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #version} will
* return {@link ConfluenceVersion#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #versionAsString}.
*
*
* @return The version or the type of Confluence installation to connect to.
* @see ConfluenceVersion
*/
public final ConfluenceVersion version() {
return ConfluenceVersion.fromValue(version);
}
/**
*
* The version or the type of Confluence installation to connect to.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #version} will
* return {@link ConfluenceVersion#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #versionAsString}.
*
*
* @return The version or the type of Confluence installation to connect to.
* @see ConfluenceVersion
*/
public final String versionAsString() {
return version;
}
/**
*
* Configuration information for indexing Confluence spaces.
*
*
* @return Configuration information for indexing Confluence spaces.
*/
public final ConfluenceSpaceConfiguration spaceConfiguration() {
return spaceConfiguration;
}
/**
*
* Configuration information for indexing Confluence pages.
*
*
* @return Configuration information for indexing Confluence pages.
*/
public final ConfluencePageConfiguration pageConfiguration() {
return pageConfiguration;
}
/**
*
* Configuration information for indexing Confluence blogs.
*
*
* @return Configuration information for indexing Confluence blogs.
*/
public final ConfluenceBlogConfiguration blogConfiguration() {
return blogConfiguration;
}
/**
*
* Configuration information for indexing attachments to Confluence blogs and pages.
*
*
* @return Configuration information for indexing attachments to Confluence blogs and pages.
*/
public final ConfluenceAttachmentConfiguration attachmentConfiguration() {
return attachmentConfiguration;
}
/**
*
* Configuration information for an Amazon Virtual Private Cloud to connect to your Confluence. For more
* information, see Configuring a
* VPC.
*
*
* @return Configuration information for an Amazon Virtual Private Cloud to connect to your Confluence. For more
* information, see Configuring a VPC.
*/
public final DataSourceVpcConfiguration vpcConfiguration() {
return vpcConfiguration;
}
/**
* For responses, this returns true if the service returned a value for the InclusionPatterns property. This DOES
* NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasInclusionPatterns() {
return inclusionPatterns != null && !(inclusionPatterns instanceof SdkAutoConstructList);
}
/**
*
* A list of regular expression patterns to include certain blog posts, pages, spaces, or attachments in your
* Confluence. Content that matches the patterns are included in the index. Content that doesn't match the patterns
* is excluded from the index. If content matches both an inclusion and exclusion pattern, the exclusion pattern
* takes precedence and the content isn't included in the index.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasInclusionPatterns} method.
*
*
* @return A list of regular expression patterns to include certain blog posts, pages, spaces, or attachments in
* your Confluence. Content that matches the patterns are included in the index. Content that doesn't match
* the patterns is excluded from the index. If content matches both an inclusion and exclusion pattern, the
* exclusion pattern takes precedence and the content isn't included in the index.
*/
public final List inclusionPatterns() {
return inclusionPatterns;
}
/**
* For responses, this returns true if the service returned a value for the ExclusionPatterns property. This DOES
* NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasExclusionPatterns() {
return exclusionPatterns != null && !(exclusionPatterns instanceof SdkAutoConstructList);
}
/**
*
* A list of regular expression patterns to exclude certain blog posts, pages, spaces, or attachments in your
* Confluence. Content that matches the patterns are excluded from the index. Content that doesn't match the
* patterns is included in the index. If content matches both an inclusion and exclusion pattern, the exclusion
* pattern takes precedence and the content isn't included in the index.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasExclusionPatterns} method.
*
*
* @return A list of regular expression patterns to exclude certain blog posts, pages, spaces, or attachments in
* your Confluence. Content that matches the patterns are excluded from the index. Content that doesn't
* match the patterns is included in the index. If content matches both an inclusion and exclusion pattern,
* the exclusion pattern takes precedence and the content isn't included in the index.
*/
public final List exclusionPatterns() {
return exclusionPatterns;
}
/**
*
* Configuration information to connect to your Confluence URL instance via a web proxy. You can use this option for
* Confluence Server.
*
*
* You must provide the website host name and port number. For example, the host name of
* https://a.example.com/page1.html is "a.example.com" and the port is 443, the standard port for HTTPS.
*
*
* Web proxy credentials are optional and you can use them to connect to a web proxy server that requires basic
* authentication of user name and password. To store web proxy credentials, you use a secret in Secrets Manager.
*
*
* It is recommended that you follow best security practices when configuring your web proxy. This includes setting
* up throttling, setting up logging and monitoring, and applying security patches on a regular basis. If you use
* your web proxy with multiple data sources, sync jobs that occur at the same time could strain the load on your
* proxy. It is recommended you prepare your proxy beforehand for any security and load requirements.
*
*
* @return Configuration information to connect to your Confluence URL instance via a web proxy. You can use this
* option for Confluence Server.
*
* You must provide the website host name and port number. For example, the host name of
* https://a.example.com/page1.html is "a.example.com" and the port is 443, the standard port for
* HTTPS.
*
*
* Web proxy credentials are optional and you can use them to connect to a web proxy server that requires
* basic authentication of user name and password. To store web proxy credentials, you use a secret in
* Secrets Manager.
*
*
* It is recommended that you follow best security practices when configuring your web proxy. This includes
* setting up throttling, setting up logging and monitoring, and applying security patches on a regular
* basis. If you use your web proxy with multiple data sources, sync jobs that occur at the same time could
* strain the load on your proxy. It is recommended you prepare your proxy beforehand for any security and
* load requirements.
*/
public final ProxyConfiguration proxyConfiguration() {
return proxyConfiguration;
}
/**
*
* Whether you want to connect to Confluence using basic authentication of user name and password, or a personal
* access token. You can use a personal access token for Confluence Server.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #authenticationType} will return {@link ConfluenceAuthenticationType#UNKNOWN_TO_SDK_VERSION}. The raw
* value returned by the service is available from {@link #authenticationTypeAsString}.
*
*
* @return Whether you want to connect to Confluence using basic authentication of user name and password, or a
* personal access token. You can use a personal access token for Confluence Server.
* @see ConfluenceAuthenticationType
*/
public final ConfluenceAuthenticationType authenticationType() {
return ConfluenceAuthenticationType.fromValue(authenticationType);
}
/**
*
* Whether you want to connect to Confluence using basic authentication of user name and password, or a personal
* access token. You can use a personal access token for Confluence Server.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #authenticationType} will return {@link ConfluenceAuthenticationType#UNKNOWN_TO_SDK_VERSION}. The raw
* value returned by the service is available from {@link #authenticationTypeAsString}.
*
*
* @return Whether you want to connect to Confluence using basic authentication of user name and password, or a
* personal access token. You can use a personal access token for Confluence Server.
* @see ConfluenceAuthenticationType
*/
public final String authenticationTypeAsString() {
return authenticationType;
}
@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(serverUrl());
hashCode = 31 * hashCode + Objects.hashCode(secretArn());
hashCode = 31 * hashCode + Objects.hashCode(versionAsString());
hashCode = 31 * hashCode + Objects.hashCode(spaceConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(pageConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(blogConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(attachmentConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(vpcConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(hasInclusionPatterns() ? inclusionPatterns() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasExclusionPatterns() ? exclusionPatterns() : null);
hashCode = 31 * hashCode + Objects.hashCode(proxyConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(authenticationTypeAsString());
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 ConfluenceConfiguration)) {
return false;
}
ConfluenceConfiguration other = (ConfluenceConfiguration) obj;
return Objects.equals(serverUrl(), other.serverUrl()) && Objects.equals(secretArn(), other.secretArn())
&& Objects.equals(versionAsString(), other.versionAsString())
&& Objects.equals(spaceConfiguration(), other.spaceConfiguration())
&& Objects.equals(pageConfiguration(), other.pageConfiguration())
&& Objects.equals(blogConfiguration(), other.blogConfiguration())
&& Objects.equals(attachmentConfiguration(), other.attachmentConfiguration())
&& Objects.equals(vpcConfiguration(), other.vpcConfiguration())
&& hasInclusionPatterns() == other.hasInclusionPatterns()
&& Objects.equals(inclusionPatterns(), other.inclusionPatterns())
&& hasExclusionPatterns() == other.hasExclusionPatterns()
&& Objects.equals(exclusionPatterns(), other.exclusionPatterns())
&& Objects.equals(proxyConfiguration(), other.proxyConfiguration())
&& Objects.equals(authenticationTypeAsString(), other.authenticationTypeAsString());
}
/**
* 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("ConfluenceConfiguration").add("ServerUrl", serverUrl()).add("SecretArn", secretArn())
.add("Version", versionAsString()).add("SpaceConfiguration", spaceConfiguration())
.add("PageConfiguration", pageConfiguration()).add("BlogConfiguration", blogConfiguration())
.add("AttachmentConfiguration", attachmentConfiguration()).add("VpcConfiguration", vpcConfiguration())
.add("InclusionPatterns", hasInclusionPatterns() ? inclusionPatterns() : null)
.add("ExclusionPatterns", hasExclusionPatterns() ? exclusionPatterns() : null)
.add("ProxyConfiguration", proxyConfiguration()).add("AuthenticationType", authenticationTypeAsString()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ServerUrl":
return Optional.ofNullable(clazz.cast(serverUrl()));
case "SecretArn":
return Optional.ofNullable(clazz.cast(secretArn()));
case "Version":
return Optional.ofNullable(clazz.cast(versionAsString()));
case "SpaceConfiguration":
return Optional.ofNullable(clazz.cast(spaceConfiguration()));
case "PageConfiguration":
return Optional.ofNullable(clazz.cast(pageConfiguration()));
case "BlogConfiguration":
return Optional.ofNullable(clazz.cast(blogConfiguration()));
case "AttachmentConfiguration":
return Optional.ofNullable(clazz.cast(attachmentConfiguration()));
case "VpcConfiguration":
return Optional.ofNullable(clazz.cast(vpcConfiguration()));
case "InclusionPatterns":
return Optional.ofNullable(clazz.cast(inclusionPatterns()));
case "ExclusionPatterns":
return Optional.ofNullable(clazz.cast(exclusionPatterns()));
case "ProxyConfiguration":
return Optional.ofNullable(clazz.cast(proxyConfiguration()));
case "AuthenticationType":
return Optional.ofNullable(clazz.cast(authenticationTypeAsString()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function