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

io.cloudshiftdev.awscdk.services.appsync.ElasticsearchDataSourceProps.kt Maven / Gradle / Ivy

The newest version!
@file:Suppress("RedundantVisibilityModifier","RedundantUnitReturnType","RemoveRedundantQualifierName","unused","UnusedImport","ClassName","REDUNDANT_PROJECTION","DEPRECATION")

package io.cloudshiftdev.awscdk.services.appsync

import io.cloudshiftdev.awscdk.common.CdkDslMarker
import io.cloudshiftdev.awscdk.common.CdkObject
import io.cloudshiftdev.awscdk.common.CdkObjectWrappers
import io.cloudshiftdev.awscdk.services.elasticsearch.IDomain
import io.cloudshiftdev.awscdk.services.iam.IRole
import kotlin.Deprecated
import kotlin.String
import kotlin.Unit

/**
 * (deprecated) Properties for the Elasticsearch Data Source.
 *
 * Example:
 *
 * ```
 * // The code below shows an example of how to instantiate this type.
 * // The values are placeholders you should change.
 * import io.cloudshiftdev.awscdk.services.appsync.*;
 * import io.cloudshiftdev.awscdk.services.elasticsearch.*;
 * import io.cloudshiftdev.awscdk.services.iam.*;
 * Domain domain;
 * GraphqlApi graphqlApi;
 * Role role;
 * ElasticsearchDataSourceProps elasticsearchDataSourceProps =
 * ElasticsearchDataSourceProps.builder()
 * .api(graphqlApi)
 * .domain(domain)
 * // the properties below are optional
 * .description("description")
 * .name("name")
 * .serviceRole(role)
 * .build();
 * ```
 *
 * * use `OpenSearchDataSourceProps` with `OpenSearchDataSource`
 */
public interface ElasticsearchDataSourceProps : BackedDataSourceProps {
  /**
   * (deprecated) The elasticsearch domain containing the endpoint for the data source.
   */
  @Deprecated(message = "deprecated in CDK")
  public fun domain(): IDomain

  /**
   * A builder for [ElasticsearchDataSourceProps]
   */
  @CdkDslMarker
  @Deprecated(message = "deprecated in CDK")
  public interface Builder {
    /**
     * @param api The API to attach this data source to. 
     */
    public fun api(api: IGraphqlApi)

    /**
     * @param description the description of the data source.
     */
    public fun description(description: String)

    /**
     * @param domain The elasticsearch domain containing the endpoint for the data source. 
     */
    @Deprecated(message = "deprecated in CDK")
    public fun domain(domain: IDomain)

    /**
     * @param name The name of the data source.
     */
    public fun name(name: String)

    /**
     * @param serviceRole The IAM service role to be assumed by AppSync to interact with the data
     * source.
     */
    public fun serviceRole(serviceRole: IRole)
  }

  private class BuilderImpl : Builder {
    private val cdkBuilder:
        software.amazon.awscdk.services.appsync.ElasticsearchDataSourceProps.Builder =
        software.amazon.awscdk.services.appsync.ElasticsearchDataSourceProps.builder()

    /**
     * @param api The API to attach this data source to. 
     */
    override fun api(api: IGraphqlApi) {
      cdkBuilder.api(api.let(IGraphqlApi.Companion::unwrap))
    }

    /**
     * @param description the description of the data source.
     */
    override fun description(description: String) {
      cdkBuilder.description(description)
    }

    /**
     * @param domain The elasticsearch domain containing the endpoint for the data source. 
     */
    @Deprecated(message = "deprecated in CDK")
    override fun domain(domain: IDomain) {
      cdkBuilder.domain(domain.let(IDomain.Companion::unwrap))
    }

    /**
     * @param name The name of the data source.
     */
    override fun name(name: String) {
      cdkBuilder.name(name)
    }

    /**
     * @param serviceRole The IAM service role to be assumed by AppSync to interact with the data
     * source.
     */
    override fun serviceRole(serviceRole: IRole) {
      cdkBuilder.serviceRole(serviceRole.let(IRole.Companion::unwrap))
    }

    public fun build(): software.amazon.awscdk.services.appsync.ElasticsearchDataSourceProps =
        cdkBuilder.build()
  }

  private class Wrapper(
    cdkObject: software.amazon.awscdk.services.appsync.ElasticsearchDataSourceProps,
  ) : CdkObject(cdkObject),
      ElasticsearchDataSourceProps {
    /**
     * The API to attach this data source to.
     */
    override fun api(): IGraphqlApi = unwrap(this).getApi().let(IGraphqlApi::wrap)

    /**
     * the description of the data source.
     *
     * Default: - None
     */
    override fun description(): String? = unwrap(this).getDescription()

    /**
     * (deprecated) The elasticsearch domain containing the endpoint for the data source.
     */
    @Deprecated(message = "deprecated in CDK")
    override fun domain(): IDomain = unwrap(this).getDomain().let(IDomain::wrap)

    /**
     * The name of the data source.
     *
     * Default: - id of data source
     */
    override fun name(): String? = unwrap(this).getName()

    /**
     * The IAM service role to be assumed by AppSync to interact with the data source.
     *
     * Default: -  Create a new role
     */
    override fun serviceRole(): IRole? = unwrap(this).getServiceRole()?.let(IRole::wrap)
  }

  public companion object {
    public operator fun invoke(block: Builder.() -> Unit = {}): ElasticsearchDataSourceProps {
      val builderImpl = BuilderImpl()
      return Wrapper(builderImpl.apply(block).build())
    }

    internal
        fun wrap(cdkObject: software.amazon.awscdk.services.appsync.ElasticsearchDataSourceProps):
        ElasticsearchDataSourceProps = CdkObjectWrappers.wrap(cdkObject) as?
        ElasticsearchDataSourceProps ?: Wrapper(cdkObject)

    internal fun unwrap(wrapped: ElasticsearchDataSourceProps):
        software.amazon.awscdk.services.appsync.ElasticsearchDataSourceProps = (wrapped as
        CdkObject).cdkObject as software.amazon.awscdk.services.appsync.ElasticsearchDataSourceProps
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy