commonMain.aws.sdk.kotlin.services.appsync.model.CreateDataSourceRequest.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of appsync-jvm Show documentation
Show all versions of appsync-jvm Show documentation
The AWS SDK for Kotlin client for AppSync
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.appsync.model
import aws.smithy.kotlin.runtime.SdkDsl
public class CreateDataSourceRequest private constructor(builder: Builder) {
/**
* The API ID for the GraphQL API for the `DataSource`.
*/
public val apiId: kotlin.String? = builder.apiId
/**
* A description of the `DataSource`.
*/
public val description: kotlin.String? = builder.description
/**
* Amazon DynamoDB settings.
*/
public val dynamodbConfig: aws.sdk.kotlin.services.appsync.model.DynamodbDataSourceConfig? = builder.dynamodbConfig
/**
* 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 val elasticsearchConfig: aws.sdk.kotlin.services.appsync.model.ElasticsearchDataSourceConfig? = builder.elasticsearchConfig
/**
* Amazon EventBridge settings.
*/
public val eventBridgeConfig: aws.sdk.kotlin.services.appsync.model.EventBridgeDataSourceConfig? = builder.eventBridgeConfig
/**
* HTTP endpoint settings.
*/
public val httpConfig: aws.sdk.kotlin.services.appsync.model.HttpDataSourceConfig? = builder.httpConfig
/**
* Lambda settings.
*/
public val lambdaConfig: aws.sdk.kotlin.services.appsync.model.LambdaDataSourceConfig? = builder.lambdaConfig
/**
* 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`.
*/
public val metricsConfig: aws.sdk.kotlin.services.appsync.model.DataSourceLevelMetricsConfig? = builder.metricsConfig
/**
* A user-supplied name for the `DataSource`.
*/
public val name: kotlin.String? = builder.name
/**
* Amazon OpenSearch Service settings.
*/
public val openSearchServiceConfig: aws.sdk.kotlin.services.appsync.model.OpenSearchServiceDataSourceConfig? = builder.openSearchServiceConfig
/**
* Relational database settings.
*/
public val relationalDatabaseConfig: aws.sdk.kotlin.services.appsync.model.RelationalDatabaseDataSourceConfig? = builder.relationalDatabaseConfig
/**
* 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 val serviceRoleArn: kotlin.String? = builder.serviceRoleArn
/**
* The type of the `DataSource`.
*/
public val type: aws.sdk.kotlin.services.appsync.model.DataSourceType? = builder.type
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.appsync.model.CreateDataSourceRequest = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("CreateDataSourceRequest(")
append("apiId=$apiId,")
append("description=$description,")
append("dynamodbConfig=$dynamodbConfig,")
append("elasticsearchConfig=$elasticsearchConfig,")
append("eventBridgeConfig=$eventBridgeConfig,")
append("httpConfig=$httpConfig,")
append("lambdaConfig=$lambdaConfig,")
append("metricsConfig=$metricsConfig,")
append("name=$name,")
append("openSearchServiceConfig=$openSearchServiceConfig,")
append("relationalDatabaseConfig=$relationalDatabaseConfig,")
append("serviceRoleArn=$serviceRoleArn,")
append("type=$type")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = apiId?.hashCode() ?: 0
result = 31 * result + (description?.hashCode() ?: 0)
result = 31 * result + (dynamodbConfig?.hashCode() ?: 0)
result = 31 * result + (elasticsearchConfig?.hashCode() ?: 0)
result = 31 * result + (eventBridgeConfig?.hashCode() ?: 0)
result = 31 * result + (httpConfig?.hashCode() ?: 0)
result = 31 * result + (lambdaConfig?.hashCode() ?: 0)
result = 31 * result + (metricsConfig?.hashCode() ?: 0)
result = 31 * result + (name?.hashCode() ?: 0)
result = 31 * result + (openSearchServiceConfig?.hashCode() ?: 0)
result = 31 * result + (relationalDatabaseConfig?.hashCode() ?: 0)
result = 31 * result + (serviceRoleArn?.hashCode() ?: 0)
result = 31 * result + (type?.hashCode() ?: 0)
return result
}
override fun equals(other: kotlin.Any?): kotlin.Boolean {
if (this === other) return true
if (other == null || this::class != other::class) return false
other as CreateDataSourceRequest
if (apiId != other.apiId) return false
if (description != other.description) return false
if (dynamodbConfig != other.dynamodbConfig) return false
if (elasticsearchConfig != other.elasticsearchConfig) return false
if (eventBridgeConfig != other.eventBridgeConfig) return false
if (httpConfig != other.httpConfig) return false
if (lambdaConfig != other.lambdaConfig) return false
if (metricsConfig != other.metricsConfig) return false
if (name != other.name) return false
if (openSearchServiceConfig != other.openSearchServiceConfig) return false
if (relationalDatabaseConfig != other.relationalDatabaseConfig) return false
if (serviceRoleArn != other.serviceRoleArn) return false
if (type != other.type) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.appsync.model.CreateDataSourceRequest = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The API ID for the GraphQL API for the `DataSource`.
*/
public var apiId: kotlin.String? = null
/**
* A description of the `DataSource`.
*/
public var description: kotlin.String? = null
/**
* Amazon DynamoDB settings.
*/
public var dynamodbConfig: aws.sdk.kotlin.services.appsync.model.DynamodbDataSourceConfig? = null
/**
* 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 var elasticsearchConfig: aws.sdk.kotlin.services.appsync.model.ElasticsearchDataSourceConfig? = null
/**
* Amazon EventBridge settings.
*/
public var eventBridgeConfig: aws.sdk.kotlin.services.appsync.model.EventBridgeDataSourceConfig? = null
/**
* HTTP endpoint settings.
*/
public var httpConfig: aws.sdk.kotlin.services.appsync.model.HttpDataSourceConfig? = null
/**
* Lambda settings.
*/
public var lambdaConfig: aws.sdk.kotlin.services.appsync.model.LambdaDataSourceConfig? = null
/**
* 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`.
*/
public var metricsConfig: aws.sdk.kotlin.services.appsync.model.DataSourceLevelMetricsConfig? = null
/**
* A user-supplied name for the `DataSource`.
*/
public var name: kotlin.String? = null
/**
* Amazon OpenSearch Service settings.
*/
public var openSearchServiceConfig: aws.sdk.kotlin.services.appsync.model.OpenSearchServiceDataSourceConfig? = null
/**
* Relational database settings.
*/
public var relationalDatabaseConfig: aws.sdk.kotlin.services.appsync.model.RelationalDatabaseDataSourceConfig? = null
/**
* 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 var serviceRoleArn: kotlin.String? = null
/**
* The type of the `DataSource`.
*/
public var type: aws.sdk.kotlin.services.appsync.model.DataSourceType? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.appsync.model.CreateDataSourceRequest) : this() {
this.apiId = x.apiId
this.description = x.description
this.dynamodbConfig = x.dynamodbConfig
this.elasticsearchConfig = x.elasticsearchConfig
this.eventBridgeConfig = x.eventBridgeConfig
this.httpConfig = x.httpConfig
this.lambdaConfig = x.lambdaConfig
this.metricsConfig = x.metricsConfig
this.name = x.name
this.openSearchServiceConfig = x.openSearchServiceConfig
this.relationalDatabaseConfig = x.relationalDatabaseConfig
this.serviceRoleArn = x.serviceRoleArn
this.type = x.type
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.appsync.model.CreateDataSourceRequest = CreateDataSourceRequest(this)
/**
* construct an [aws.sdk.kotlin.services.appsync.model.DynamodbDataSourceConfig] inside the given [block]
*/
public fun dynamodbConfig(block: aws.sdk.kotlin.services.appsync.model.DynamodbDataSourceConfig.Builder.() -> kotlin.Unit) {
this.dynamodbConfig = aws.sdk.kotlin.services.appsync.model.DynamodbDataSourceConfig.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.appsync.model.ElasticsearchDataSourceConfig] inside the given [block]
*/
public fun elasticsearchConfig(block: aws.sdk.kotlin.services.appsync.model.ElasticsearchDataSourceConfig.Builder.() -> kotlin.Unit) {
this.elasticsearchConfig = aws.sdk.kotlin.services.appsync.model.ElasticsearchDataSourceConfig.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.appsync.model.EventBridgeDataSourceConfig] inside the given [block]
*/
public fun eventBridgeConfig(block: aws.sdk.kotlin.services.appsync.model.EventBridgeDataSourceConfig.Builder.() -> kotlin.Unit) {
this.eventBridgeConfig = aws.sdk.kotlin.services.appsync.model.EventBridgeDataSourceConfig.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.appsync.model.HttpDataSourceConfig] inside the given [block]
*/
public fun httpConfig(block: aws.sdk.kotlin.services.appsync.model.HttpDataSourceConfig.Builder.() -> kotlin.Unit) {
this.httpConfig = aws.sdk.kotlin.services.appsync.model.HttpDataSourceConfig.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.appsync.model.LambdaDataSourceConfig] inside the given [block]
*/
public fun lambdaConfig(block: aws.sdk.kotlin.services.appsync.model.LambdaDataSourceConfig.Builder.() -> kotlin.Unit) {
this.lambdaConfig = aws.sdk.kotlin.services.appsync.model.LambdaDataSourceConfig.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.appsync.model.OpenSearchServiceDataSourceConfig] inside the given [block]
*/
public fun openSearchServiceConfig(block: aws.sdk.kotlin.services.appsync.model.OpenSearchServiceDataSourceConfig.Builder.() -> kotlin.Unit) {
this.openSearchServiceConfig = aws.sdk.kotlin.services.appsync.model.OpenSearchServiceDataSourceConfig.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.appsync.model.RelationalDatabaseDataSourceConfig] inside the given [block]
*/
public fun relationalDatabaseConfig(block: aws.sdk.kotlin.services.appsync.model.RelationalDatabaseDataSourceConfig.Builder.() -> kotlin.Unit) {
this.relationalDatabaseConfig = aws.sdk.kotlin.services.appsync.model.RelationalDatabaseDataSourceConfig.invoke(block)
}
internal fun correctErrors(): Builder {
return this
}
}
}