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

software.amazon.awssdk.services.appsync.model.CreateDataSourceRequest Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon AppSync module holds the client classes that are used for communicating with Amazon AppSync.

There is a newer version: 2.29.15
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.appsync.model;

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 CreateDataSourceRequest extends AppSyncRequest implements
        ToCopyableBuilder {
    private static final SdkField API_ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("apiId")
            .getter(getter(CreateDataSourceRequest::apiId)).setter(setter(Builder::apiId))
            .traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("apiId").build()).build();

    private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("name")
            .getter(getter(CreateDataSourceRequest::name)).setter(setter(Builder::name))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build();

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

    private static final SdkField TYPE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("type")
            .getter(getter(CreateDataSourceRequest::typeAsString)).setter(setter(Builder::type))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("type").build()).build();

    private static final SdkField SERVICE_ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("serviceRoleArn").getter(getter(CreateDataSourceRequest::serviceRoleArn))
            .setter(setter(Builder::serviceRoleArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("serviceRoleArn").build()).build();

    private static final SdkField DYNAMODB_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("dynamodbConfig")
            .getter(getter(CreateDataSourceRequest::dynamodbConfig)).setter(setter(Builder::dynamodbConfig))
            .constructor(DynamodbDataSourceConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("dynamodbConfig").build()).build();

    private static final SdkField LAMBDA_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("lambdaConfig")
            .getter(getter(CreateDataSourceRequest::lambdaConfig)).setter(setter(Builder::lambdaConfig))
            .constructor(LambdaDataSourceConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("lambdaConfig").build()).build();

    private static final SdkField ELASTICSEARCH_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("elasticsearchConfig")
            .getter(getter(CreateDataSourceRequest::elasticsearchConfig)).setter(setter(Builder::elasticsearchConfig))
            .constructor(ElasticsearchDataSourceConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("elasticsearchConfig").build())
            .build();

    private static final SdkField OPEN_SEARCH_SERVICE_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("openSearchServiceConfig")
            .getter(getter(CreateDataSourceRequest::openSearchServiceConfig)).setter(setter(Builder::openSearchServiceConfig))
            .constructor(OpenSearchServiceDataSourceConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("openSearchServiceConfig").build())
            .build();

    private static final SdkField HTTP_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("httpConfig")
            .getter(getter(CreateDataSourceRequest::httpConfig)).setter(setter(Builder::httpConfig))
            .constructor(HttpDataSourceConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("httpConfig").build()).build();

    private static final SdkField RELATIONAL_DATABASE_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("relationalDatabaseConfig")
            .getter(getter(CreateDataSourceRequest::relationalDatabaseConfig)).setter(setter(Builder::relationalDatabaseConfig))
            .constructor(RelationalDatabaseDataSourceConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("relationalDatabaseConfig").build())
            .build();

    private static final SdkField EVENT_BRIDGE_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("eventBridgeConfig")
            .getter(getter(CreateDataSourceRequest::eventBridgeConfig)).setter(setter(Builder::eventBridgeConfig))
            .constructor(EventBridgeDataSourceConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("eventBridgeConfig").build()).build();

    private static final SdkField METRICS_CONFIG_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("metricsConfig").getter(getter(CreateDataSourceRequest::metricsConfigAsString))
            .setter(setter(Builder::metricsConfig))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("metricsConfig").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(API_ID_FIELD, NAME_FIELD,
            DESCRIPTION_FIELD, TYPE_FIELD, SERVICE_ROLE_ARN_FIELD, DYNAMODB_CONFIG_FIELD, LAMBDA_CONFIG_FIELD,
            ELASTICSEARCH_CONFIG_FIELD, OPEN_SEARCH_SERVICE_CONFIG_FIELD, HTTP_CONFIG_FIELD, RELATIONAL_DATABASE_CONFIG_FIELD,
            EVENT_BRIDGE_CONFIG_FIELD, METRICS_CONFIG_FIELD));

    private final String apiId;

    private final String name;

    private final String description;

    private final String type;

    private final String serviceRoleArn;

    private final DynamodbDataSourceConfig dynamodbConfig;

    private final LambdaDataSourceConfig lambdaConfig;

    private final ElasticsearchDataSourceConfig elasticsearchConfig;

    private final OpenSearchServiceDataSourceConfig openSearchServiceConfig;

    private final HttpDataSourceConfig httpConfig;

    private final RelationalDatabaseDataSourceConfig relationalDatabaseConfig;

    private final EventBridgeDataSourceConfig eventBridgeConfig;

    private final String metricsConfig;

    private CreateDataSourceRequest(BuilderImpl builder) {
        super(builder);
        this.apiId = builder.apiId;
        this.name = builder.name;
        this.description = builder.description;
        this.type = builder.type;
        this.serviceRoleArn = builder.serviceRoleArn;
        this.dynamodbConfig = builder.dynamodbConfig;
        this.lambdaConfig = builder.lambdaConfig;
        this.elasticsearchConfig = builder.elasticsearchConfig;
        this.openSearchServiceConfig = builder.openSearchServiceConfig;
        this.httpConfig = builder.httpConfig;
        this.relationalDatabaseConfig = builder.relationalDatabaseConfig;
        this.eventBridgeConfig = builder.eventBridgeConfig;
        this.metricsConfig = builder.metricsConfig;
    }

    /**
     * 

* The API ID for the GraphQL API for the DataSource. *

* * @return The API ID for the GraphQL API for the DataSource. */ public final String apiId() { return apiId; } /** *

* A user-supplied name for the DataSource. *

* * @return A user-supplied name for the DataSource. */ public final String name() { return name; } /** *

* A description of the DataSource. *

* * @return A description of the DataSource. */ public final String description() { return description; } /** *

* The type of the DataSource. *

*

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

* * @return The type of the DataSource. * @see DataSourceType */ public final DataSourceType type() { return DataSourceType.fromValue(type); } /** *

* The type of the DataSource. *

*

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

* * @return The type of the DataSource. * @see DataSourceType */ public final String typeAsString() { return type; } /** *

* The Identity and Access Management (IAM) service role Amazon Resource Name (ARN) for the data source. The system * assumes this role when accessing the data source. *

* * @return The Identity and Access Management (IAM) service role Amazon Resource Name (ARN) for the data source. The * system assumes this role when accessing the data source. */ public final String serviceRoleArn() { return serviceRoleArn; } /** *

* Amazon DynamoDB settings. *

* * @return Amazon DynamoDB settings. */ public final DynamodbDataSourceConfig dynamodbConfig() { return dynamodbConfig; } /** *

* Lambda settings. *

* * @return Lambda settings. */ public final LambdaDataSourceConfig lambdaConfig() { return lambdaConfig; } /** *

* Amazon OpenSearch Service settings. *

*

* As of September 2021, Amazon Elasticsearch service is Amazon OpenSearch Service. This configuration is * deprecated. For new data sources, use CreateDataSourceRequest$openSearchServiceConfig to create an * OpenSearch data source. *

* * @return Amazon OpenSearch Service settings.

*

* As of September 2021, Amazon Elasticsearch service is Amazon OpenSearch Service. This configuration is * deprecated. For new data sources, use CreateDataSourceRequest$openSearchServiceConfig to create an * OpenSearch data source. */ public final ElasticsearchDataSourceConfig elasticsearchConfig() { return elasticsearchConfig; } /** *

* Amazon OpenSearch Service settings. *

* * @return Amazon OpenSearch Service settings. */ public final OpenSearchServiceDataSourceConfig openSearchServiceConfig() { return openSearchServiceConfig; } /** *

* HTTP endpoint settings. *

* * @return HTTP endpoint settings. */ public final HttpDataSourceConfig httpConfig() { return httpConfig; } /** *

* Relational database settings. *

* * @return Relational database settings. */ public final RelationalDatabaseDataSourceConfig relationalDatabaseConfig() { return relationalDatabaseConfig; } /** *

* Amazon EventBridge settings. *

* * @return Amazon EventBridge settings. */ public final EventBridgeDataSourceConfig eventBridgeConfig() { return eventBridgeConfig; } /** *

* Enables or disables enhanced data source metrics for specified data sources. Note that metricsConfig * won't be used unless the dataSourceLevelMetricsBehavior value is set to * PER_DATA_SOURCE_METRICS. If the dataSourceLevelMetricsBehavior is set to * FULL_REQUEST_DATA_SOURCE_METRICS instead, metricsConfig will be ignored. However, you * can still set its value. *

*

* metricsConfig can be ENABLED or DISABLED. *

*

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

* * @return Enables or disables enhanced data source metrics for specified data sources. Note that * metricsConfig won't be used unless the dataSourceLevelMetricsBehavior value is * set to PER_DATA_SOURCE_METRICS. If the dataSourceLevelMetricsBehavior is set to * FULL_REQUEST_DATA_SOURCE_METRICS instead, metricsConfig will be ignored. * However, you can still set its value.

*

* metricsConfig can be ENABLED or DISABLED. * @see DataSourceLevelMetricsConfig */ public final DataSourceLevelMetricsConfig metricsConfig() { return DataSourceLevelMetricsConfig.fromValue(metricsConfig); } /** *

* Enables or disables enhanced data source metrics for specified data sources. Note that metricsConfig * won't be used unless the dataSourceLevelMetricsBehavior value is set to * PER_DATA_SOURCE_METRICS. If the dataSourceLevelMetricsBehavior is set to * FULL_REQUEST_DATA_SOURCE_METRICS instead, metricsConfig will be ignored. However, you * can still set its value. *

*

* metricsConfig can be ENABLED or DISABLED. *

*

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

* * @return Enables or disables enhanced data source metrics for specified data sources. Note that * metricsConfig won't be used unless the dataSourceLevelMetricsBehavior value is * set to PER_DATA_SOURCE_METRICS. If the dataSourceLevelMetricsBehavior is set to * FULL_REQUEST_DATA_SOURCE_METRICS instead, metricsConfig will be ignored. * However, you can still set its value.

*

* metricsConfig can be ENABLED or DISABLED. * @see DataSourceLevelMetricsConfig */ public final String metricsConfigAsString() { return metricsConfig; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(apiId()); hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(typeAsString()); hashCode = 31 * hashCode + Objects.hashCode(serviceRoleArn()); hashCode = 31 * hashCode + Objects.hashCode(dynamodbConfig()); hashCode = 31 * hashCode + Objects.hashCode(lambdaConfig()); hashCode = 31 * hashCode + Objects.hashCode(elasticsearchConfig()); hashCode = 31 * hashCode + Objects.hashCode(openSearchServiceConfig()); hashCode = 31 * hashCode + Objects.hashCode(httpConfig()); hashCode = 31 * hashCode + Objects.hashCode(relationalDatabaseConfig()); hashCode = 31 * hashCode + Objects.hashCode(eventBridgeConfig()); hashCode = 31 * hashCode + Objects.hashCode(metricsConfigAsString()); 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 CreateDataSourceRequest)) { return false; } CreateDataSourceRequest other = (CreateDataSourceRequest) obj; return Objects.equals(apiId(), other.apiId()) && Objects.equals(name(), other.name()) && Objects.equals(description(), other.description()) && Objects.equals(typeAsString(), other.typeAsString()) && Objects.equals(serviceRoleArn(), other.serviceRoleArn()) && Objects.equals(dynamodbConfig(), other.dynamodbConfig()) && Objects.equals(lambdaConfig(), other.lambdaConfig()) && Objects.equals(elasticsearchConfig(), other.elasticsearchConfig()) && Objects.equals(openSearchServiceConfig(), other.openSearchServiceConfig()) && Objects.equals(httpConfig(), other.httpConfig()) && Objects.equals(relationalDatabaseConfig(), other.relationalDatabaseConfig()) && Objects.equals(eventBridgeConfig(), other.eventBridgeConfig()) && Objects.equals(metricsConfigAsString(), other.metricsConfigAsString()); } /** * 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("CreateDataSourceRequest").add("ApiId", apiId()).add("Name", name()) .add("Description", description()).add("Type", typeAsString()).add("ServiceRoleArn", serviceRoleArn()) .add("DynamodbConfig", dynamodbConfig()).add("LambdaConfig", lambdaConfig()) .add("ElasticsearchConfig", elasticsearchConfig()).add("OpenSearchServiceConfig", openSearchServiceConfig()) .add("HttpConfig", httpConfig()).add("RelationalDatabaseConfig", relationalDatabaseConfig()) .add("EventBridgeConfig", eventBridgeConfig()).add("MetricsConfig", metricsConfigAsString()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "apiId": return Optional.ofNullable(clazz.cast(apiId())); case "name": return Optional.ofNullable(clazz.cast(name())); case "description": return Optional.ofNullable(clazz.cast(description())); case "type": return Optional.ofNullable(clazz.cast(typeAsString())); case "serviceRoleArn": return Optional.ofNullable(clazz.cast(serviceRoleArn())); case "dynamodbConfig": return Optional.ofNullable(clazz.cast(dynamodbConfig())); case "lambdaConfig": return Optional.ofNullable(clazz.cast(lambdaConfig())); case "elasticsearchConfig": return Optional.ofNullable(clazz.cast(elasticsearchConfig())); case "openSearchServiceConfig": return Optional.ofNullable(clazz.cast(openSearchServiceConfig())); case "httpConfig": return Optional.ofNullable(clazz.cast(httpConfig())); case "relationalDatabaseConfig": return Optional.ofNullable(clazz.cast(relationalDatabaseConfig())); case "eventBridgeConfig": return Optional.ofNullable(clazz.cast(eventBridgeConfig())); case "metricsConfig": return Optional.ofNullable(clazz.cast(metricsConfigAsString())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((CreateDataSourceRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends AppSyncRequest.Builder, SdkPojo, CopyableBuilder { /** *

* The API ID for the GraphQL API for the DataSource. *

* * @param apiId * The API ID for the GraphQL API for the DataSource. * @return Returns a reference to this object so that method calls can be chained together. */ Builder apiId(String apiId); /** *

* A user-supplied name for the DataSource. *

* * @param name * A user-supplied name for the DataSource. * @return Returns a reference to this object so that method calls can be chained together. */ Builder name(String name); /** *

* A description of the DataSource. *

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

* The type of the DataSource. *

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

* The type of the DataSource. *

* * @param type * The type of the DataSource. * @see DataSourceType * @return Returns a reference to this object so that method calls can be chained together. * @see DataSourceType */ Builder type(DataSourceType type); /** *

* The Identity and Access Management (IAM) service role Amazon Resource Name (ARN) for the data source. The * system assumes this role when accessing the data source. *

* * @param serviceRoleArn * The Identity and Access Management (IAM) service role Amazon Resource Name (ARN) for the data source. * The system assumes this role when accessing the data source. * @return Returns a reference to this object so that method calls can be chained together. */ Builder serviceRoleArn(String serviceRoleArn); /** *

* Amazon DynamoDB settings. *

* * @param dynamodbConfig * Amazon DynamoDB settings. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dynamodbConfig(DynamodbDataSourceConfig dynamodbConfig); /** *

* Amazon DynamoDB settings. *

* This is a convenience method that creates an instance of the {@link DynamodbDataSourceConfig.Builder} * avoiding the need to create one manually via {@link DynamodbDataSourceConfig#builder()}. * *

* When the {@link Consumer} completes, {@link DynamodbDataSourceConfig.Builder#build()} is called immediately * and its result is passed to {@link #dynamodbConfig(DynamodbDataSourceConfig)}. * * @param dynamodbConfig * a consumer that will call methods on {@link DynamodbDataSourceConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #dynamodbConfig(DynamodbDataSourceConfig) */ default Builder dynamodbConfig(Consumer dynamodbConfig) { return dynamodbConfig(DynamodbDataSourceConfig.builder().applyMutation(dynamodbConfig).build()); } /** *

* Lambda settings. *

* * @param lambdaConfig * Lambda settings. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lambdaConfig(LambdaDataSourceConfig lambdaConfig); /** *

* Lambda settings. *

* This is a convenience method that creates an instance of the {@link LambdaDataSourceConfig.Builder} avoiding * the need to create one manually via {@link LambdaDataSourceConfig#builder()}. * *

* When the {@link Consumer} completes, {@link LambdaDataSourceConfig.Builder#build()} is called immediately and * its result is passed to {@link #lambdaConfig(LambdaDataSourceConfig)}. * * @param lambdaConfig * a consumer that will call methods on {@link LambdaDataSourceConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #lambdaConfig(LambdaDataSourceConfig) */ default Builder lambdaConfig(Consumer lambdaConfig) { return lambdaConfig(LambdaDataSourceConfig.builder().applyMutation(lambdaConfig).build()); } /** *

* Amazon OpenSearch Service settings. *

*

* As of September 2021, Amazon Elasticsearch service is Amazon OpenSearch Service. This configuration is * deprecated. For new data sources, use CreateDataSourceRequest$openSearchServiceConfig to create an * OpenSearch data source. *

* * @param elasticsearchConfig * Amazon OpenSearch Service settings.

*

* As of September 2021, Amazon Elasticsearch service is Amazon OpenSearch Service. This configuration is * deprecated. For new data sources, use CreateDataSourceRequest$openSearchServiceConfig to create * an OpenSearch data source. * @return Returns a reference to this object so that method calls can be chained together. */ Builder elasticsearchConfig(ElasticsearchDataSourceConfig elasticsearchConfig); /** *

* Amazon OpenSearch Service settings. *

*

* As of September 2021, Amazon Elasticsearch service is Amazon OpenSearch Service. This configuration is * deprecated. For new data sources, use CreateDataSourceRequest$openSearchServiceConfig to create an * OpenSearch data source. *

* This is a convenience method that creates an instance of the {@link ElasticsearchDataSourceConfig.Builder} * avoiding the need to create one manually via {@link ElasticsearchDataSourceConfig#builder()}. * *

* When the {@link Consumer} completes, {@link ElasticsearchDataSourceConfig.Builder#build()} is called * immediately and its result is passed to {@link #elasticsearchConfig(ElasticsearchDataSourceConfig)}. * * @param elasticsearchConfig * a consumer that will call methods on {@link ElasticsearchDataSourceConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #elasticsearchConfig(ElasticsearchDataSourceConfig) */ default Builder elasticsearchConfig(Consumer elasticsearchConfig) { return elasticsearchConfig(ElasticsearchDataSourceConfig.builder().applyMutation(elasticsearchConfig).build()); } /** *

* Amazon OpenSearch Service settings. *

* * @param openSearchServiceConfig * Amazon OpenSearch Service settings. * @return Returns a reference to this object so that method calls can be chained together. */ Builder openSearchServiceConfig(OpenSearchServiceDataSourceConfig openSearchServiceConfig); /** *

* Amazon OpenSearch Service settings. *

* This is a convenience method that creates an instance of the * {@link OpenSearchServiceDataSourceConfig.Builder} avoiding the need to create one manually via * {@link OpenSearchServiceDataSourceConfig#builder()}. * *

* When the {@link Consumer} completes, {@link OpenSearchServiceDataSourceConfig.Builder#build()} is called * immediately and its result is passed to {@link #openSearchServiceConfig(OpenSearchServiceDataSourceConfig)}. * * @param openSearchServiceConfig * a consumer that will call methods on {@link OpenSearchServiceDataSourceConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #openSearchServiceConfig(OpenSearchServiceDataSourceConfig) */ default Builder openSearchServiceConfig(Consumer openSearchServiceConfig) { return openSearchServiceConfig(OpenSearchServiceDataSourceConfig.builder().applyMutation(openSearchServiceConfig) .build()); } /** *

* HTTP endpoint settings. *

* * @param httpConfig * HTTP endpoint settings. * @return Returns a reference to this object so that method calls can be chained together. */ Builder httpConfig(HttpDataSourceConfig httpConfig); /** *

* HTTP endpoint settings. *

* This is a convenience method that creates an instance of the {@link HttpDataSourceConfig.Builder} avoiding * the need to create one manually via {@link HttpDataSourceConfig#builder()}. * *

* When the {@link Consumer} completes, {@link HttpDataSourceConfig.Builder#build()} is called immediately and * its result is passed to {@link #httpConfig(HttpDataSourceConfig)}. * * @param httpConfig * a consumer that will call methods on {@link HttpDataSourceConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #httpConfig(HttpDataSourceConfig) */ default Builder httpConfig(Consumer httpConfig) { return httpConfig(HttpDataSourceConfig.builder().applyMutation(httpConfig).build()); } /** *

* Relational database settings. *

* * @param relationalDatabaseConfig * Relational database settings. * @return Returns a reference to this object so that method calls can be chained together. */ Builder relationalDatabaseConfig(RelationalDatabaseDataSourceConfig relationalDatabaseConfig); /** *

* Relational database settings. *

* This is a convenience method that creates an instance of the * {@link RelationalDatabaseDataSourceConfig.Builder} avoiding the need to create one manually via * {@link RelationalDatabaseDataSourceConfig#builder()}. * *

* When the {@link Consumer} completes, {@link RelationalDatabaseDataSourceConfig.Builder#build()} is called * immediately and its result is passed to {@link #relationalDatabaseConfig(RelationalDatabaseDataSourceConfig)}. * * @param relationalDatabaseConfig * a consumer that will call methods on {@link RelationalDatabaseDataSourceConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #relationalDatabaseConfig(RelationalDatabaseDataSourceConfig) */ default Builder relationalDatabaseConfig(Consumer relationalDatabaseConfig) { return relationalDatabaseConfig(RelationalDatabaseDataSourceConfig.builder().applyMutation(relationalDatabaseConfig) .build()); } /** *

* Amazon EventBridge settings. *

* * @param eventBridgeConfig * Amazon EventBridge settings. * @return Returns a reference to this object so that method calls can be chained together. */ Builder eventBridgeConfig(EventBridgeDataSourceConfig eventBridgeConfig); /** *

* Amazon EventBridge settings. *

* This is a convenience method that creates an instance of the {@link EventBridgeDataSourceConfig.Builder} * avoiding the need to create one manually via {@link EventBridgeDataSourceConfig#builder()}. * *

* When the {@link Consumer} completes, {@link EventBridgeDataSourceConfig.Builder#build()} is called * immediately and its result is passed to {@link #eventBridgeConfig(EventBridgeDataSourceConfig)}. * * @param eventBridgeConfig * a consumer that will call methods on {@link EventBridgeDataSourceConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #eventBridgeConfig(EventBridgeDataSourceConfig) */ default Builder eventBridgeConfig(Consumer eventBridgeConfig) { return eventBridgeConfig(EventBridgeDataSourceConfig.builder().applyMutation(eventBridgeConfig).build()); } /** *

* Enables or disables enhanced data source metrics for specified data sources. Note that * metricsConfig won't be used unless the dataSourceLevelMetricsBehavior value is set * to PER_DATA_SOURCE_METRICS. If the dataSourceLevelMetricsBehavior is set to * FULL_REQUEST_DATA_SOURCE_METRICS instead, metricsConfig will be ignored. However, * you can still set its value. *

*

* metricsConfig can be ENABLED or DISABLED. *

* * @param metricsConfig * Enables or disables enhanced data source metrics for specified data sources. Note that * metricsConfig won't be used unless the dataSourceLevelMetricsBehavior value * is set to PER_DATA_SOURCE_METRICS. If the dataSourceLevelMetricsBehavior is * set to FULL_REQUEST_DATA_SOURCE_METRICS instead, metricsConfig will be * ignored. However, you can still set its value.

*

* metricsConfig can be ENABLED or DISABLED. * @see DataSourceLevelMetricsConfig * @return Returns a reference to this object so that method calls can be chained together. * @see DataSourceLevelMetricsConfig */ Builder metricsConfig(String metricsConfig); /** *

* Enables or disables enhanced data source metrics for specified data sources. Note that * metricsConfig won't be used unless the dataSourceLevelMetricsBehavior value is set * to PER_DATA_SOURCE_METRICS. If the dataSourceLevelMetricsBehavior is set to * FULL_REQUEST_DATA_SOURCE_METRICS instead, metricsConfig will be ignored. However, * you can still set its value. *

*

* metricsConfig can be ENABLED or DISABLED. *

* * @param metricsConfig * Enables or disables enhanced data source metrics for specified data sources. Note that * metricsConfig won't be used unless the dataSourceLevelMetricsBehavior value * is set to PER_DATA_SOURCE_METRICS. If the dataSourceLevelMetricsBehavior is * set to FULL_REQUEST_DATA_SOURCE_METRICS instead, metricsConfig will be * ignored. However, you can still set its value.

*

* metricsConfig can be ENABLED or DISABLED. * @see DataSourceLevelMetricsConfig * @return Returns a reference to this object so that method calls can be chained together. * @see DataSourceLevelMetricsConfig */ Builder metricsConfig(DataSourceLevelMetricsConfig metricsConfig); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends AppSyncRequest.BuilderImpl implements Builder { private String apiId; private String name; private String description; private String type; private String serviceRoleArn; private DynamodbDataSourceConfig dynamodbConfig; private LambdaDataSourceConfig lambdaConfig; private ElasticsearchDataSourceConfig elasticsearchConfig; private OpenSearchServiceDataSourceConfig openSearchServiceConfig; private HttpDataSourceConfig httpConfig; private RelationalDatabaseDataSourceConfig relationalDatabaseConfig; private EventBridgeDataSourceConfig eventBridgeConfig; private String metricsConfig; private BuilderImpl() { } private BuilderImpl(CreateDataSourceRequest model) { super(model); apiId(model.apiId); name(model.name); description(model.description); type(model.type); serviceRoleArn(model.serviceRoleArn); dynamodbConfig(model.dynamodbConfig); lambdaConfig(model.lambdaConfig); elasticsearchConfig(model.elasticsearchConfig); openSearchServiceConfig(model.openSearchServiceConfig); httpConfig(model.httpConfig); relationalDatabaseConfig(model.relationalDatabaseConfig); eventBridgeConfig(model.eventBridgeConfig); metricsConfig(model.metricsConfig); } public final String getApiId() { return apiId; } public final void setApiId(String apiId) { this.apiId = apiId; } @Override public final Builder apiId(String apiId) { this.apiId = apiId; return this; } public final String getName() { return name; } public final void setName(String name) { this.name = name; } @Override public final Builder name(String name) { this.name = name; return this; } public final String getDescription() { return description; } public final void setDescription(String description) { this.description = description; } @Override public final Builder description(String description) { this.description = description; return this; } public final String getType() { return type; } public final void setType(String type) { this.type = type; } @Override public final Builder type(String type) { this.type = type; return this; } @Override public final Builder type(DataSourceType type) { this.type(type == null ? null : type.toString()); return this; } public final String getServiceRoleArn() { return serviceRoleArn; } public final void setServiceRoleArn(String serviceRoleArn) { this.serviceRoleArn = serviceRoleArn; } @Override public final Builder serviceRoleArn(String serviceRoleArn) { this.serviceRoleArn = serviceRoleArn; return this; } public final DynamodbDataSourceConfig.Builder getDynamodbConfig() { return dynamodbConfig != null ? dynamodbConfig.toBuilder() : null; } public final void setDynamodbConfig(DynamodbDataSourceConfig.BuilderImpl dynamodbConfig) { this.dynamodbConfig = dynamodbConfig != null ? dynamodbConfig.build() : null; } @Override public final Builder dynamodbConfig(DynamodbDataSourceConfig dynamodbConfig) { this.dynamodbConfig = dynamodbConfig; return this; } public final LambdaDataSourceConfig.Builder getLambdaConfig() { return lambdaConfig != null ? lambdaConfig.toBuilder() : null; } public final void setLambdaConfig(LambdaDataSourceConfig.BuilderImpl lambdaConfig) { this.lambdaConfig = lambdaConfig != null ? lambdaConfig.build() : null; } @Override public final Builder lambdaConfig(LambdaDataSourceConfig lambdaConfig) { this.lambdaConfig = lambdaConfig; return this; } public final ElasticsearchDataSourceConfig.Builder getElasticsearchConfig() { return elasticsearchConfig != null ? elasticsearchConfig.toBuilder() : null; } public final void setElasticsearchConfig(ElasticsearchDataSourceConfig.BuilderImpl elasticsearchConfig) { this.elasticsearchConfig = elasticsearchConfig != null ? elasticsearchConfig.build() : null; } @Override public final Builder elasticsearchConfig(ElasticsearchDataSourceConfig elasticsearchConfig) { this.elasticsearchConfig = elasticsearchConfig; return this; } public final OpenSearchServiceDataSourceConfig.Builder getOpenSearchServiceConfig() { return openSearchServiceConfig != null ? openSearchServiceConfig.toBuilder() : null; } public final void setOpenSearchServiceConfig(OpenSearchServiceDataSourceConfig.BuilderImpl openSearchServiceConfig) { this.openSearchServiceConfig = openSearchServiceConfig != null ? openSearchServiceConfig.build() : null; } @Override public final Builder openSearchServiceConfig(OpenSearchServiceDataSourceConfig openSearchServiceConfig) { this.openSearchServiceConfig = openSearchServiceConfig; return this; } public final HttpDataSourceConfig.Builder getHttpConfig() { return httpConfig != null ? httpConfig.toBuilder() : null; } public final void setHttpConfig(HttpDataSourceConfig.BuilderImpl httpConfig) { this.httpConfig = httpConfig != null ? httpConfig.build() : null; } @Override public final Builder httpConfig(HttpDataSourceConfig httpConfig) { this.httpConfig = httpConfig; return this; } public final RelationalDatabaseDataSourceConfig.Builder getRelationalDatabaseConfig() { return relationalDatabaseConfig != null ? relationalDatabaseConfig.toBuilder() : null; } public final void setRelationalDatabaseConfig(RelationalDatabaseDataSourceConfig.BuilderImpl relationalDatabaseConfig) { this.relationalDatabaseConfig = relationalDatabaseConfig != null ? relationalDatabaseConfig.build() : null; } @Override public final Builder relationalDatabaseConfig(RelationalDatabaseDataSourceConfig relationalDatabaseConfig) { this.relationalDatabaseConfig = relationalDatabaseConfig; return this; } public final EventBridgeDataSourceConfig.Builder getEventBridgeConfig() { return eventBridgeConfig != null ? eventBridgeConfig.toBuilder() : null; } public final void setEventBridgeConfig(EventBridgeDataSourceConfig.BuilderImpl eventBridgeConfig) { this.eventBridgeConfig = eventBridgeConfig != null ? eventBridgeConfig.build() : null; } @Override public final Builder eventBridgeConfig(EventBridgeDataSourceConfig eventBridgeConfig) { this.eventBridgeConfig = eventBridgeConfig; return this; } public final String getMetricsConfig() { return metricsConfig; } public final void setMetricsConfig(String metricsConfig) { this.metricsConfig = metricsConfig; } @Override public final Builder metricsConfig(String metricsConfig) { this.metricsConfig = metricsConfig; return this; } @Override public final Builder metricsConfig(DataSourceLevelMetricsConfig metricsConfig) { this.metricsConfig(metricsConfig == null ? null : metricsConfig.toString()); return this; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public CreateDataSourceRequest build() { return new CreateDataSourceRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy