com.pulumi.awsnative.appsync.kotlin.ResolverArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-native-kotlin Show documentation
Show all versions of pulumi-aws-native-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.appsync.kotlin
import com.pulumi.awsnative.appsync.ResolverArgs.builder
import com.pulumi.awsnative.appsync.kotlin.enums.ResolverMetricsConfig
import com.pulumi.awsnative.appsync.kotlin.inputs.ResolverAppSyncRuntimeArgs
import com.pulumi.awsnative.appsync.kotlin.inputs.ResolverAppSyncRuntimeArgsBuilder
import com.pulumi.awsnative.appsync.kotlin.inputs.ResolverCachingConfigArgs
import com.pulumi.awsnative.appsync.kotlin.inputs.ResolverCachingConfigArgsBuilder
import com.pulumi.awsnative.appsync.kotlin.inputs.ResolverPipelineConfigArgs
import com.pulumi.awsnative.appsync.kotlin.inputs.ResolverPipelineConfigArgsBuilder
import com.pulumi.awsnative.appsync.kotlin.inputs.ResolverSyncConfigArgs
import com.pulumi.awsnative.appsync.kotlin.inputs.ResolverSyncConfigArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName
/**
* The ``AWS::AppSync::Resolver`` resource defines the logical GraphQL resolver that you attach to fields in a schema. Request and response templates for resolvers are written in Apache Velocity Template Language (VTL) format. For more information about resolvers, see [Resolver Mapping Template Reference](https://docs.aws.amazon.com/appsync/latest/devguide/resolver-mapping-template-reference.html).
* When you submit an update, CFNLong updates resources based on differences between what you submit and the stack's current template. To cause this resource to be updated you must change a property value for this resource in the CFNshort template. Changing the S3 file content without changing a property value will not result in an update operation.
* See [Update Behaviors of Stack Resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html) in the *User Guide*.
* ## Example Usage
* ### Example
* No Java example available.
* @property apiId The APSYlong GraphQL API to which you want to attach this resolver.
* @property cachingConfig The caching configuration for the resolver.
* @property code The ``resolver`` code that contains the request and response functions. When code is used, the ``runtime`` is required. The runtime value must be ``APPSYNC_JS``.
* @property codeS3Location The Amazon S3 endpoint.
* @property dataSourceName The resolver data source name.
* @property fieldName The GraphQL field on a type that invokes the resolver.
* @property kind The resolver type.
* + *UNIT*: A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source.
* + *PIPELINE*: A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of ``Function`` objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.
* @property maxBatchSize The maximum number of resolver request inputs that will be sent to a single LAMlong function in a ``BatchInvoke`` operation.
* @property metricsConfig Enables or disables enhanced resolver metrics for specified resolvers. Note that ``MetricsConfig`` won't be used unless the ``resolverLevelMetricsBehavior`` value is set to ``PER_RESOLVER_METRICS``. If the ``resolverLevelMetricsBehavior`` is set to ``FULL_REQUEST_RESOLVER_METRICS`` instead, ``MetricsConfig`` will be ignored. However, you can still set its value.
* @property pipelineConfig Functions linked with the pipeline resolver.
* @property requestMappingTemplate The request mapping template.
* Request mapping templates are optional when using a Lambda data source. For all other data sources, a request mapping template is required.
* @property requestMappingTemplateS3Location The location of a request mapping template in an S3 bucket. Use this if you want to provision with a template file in S3 rather than embedding it in your CFNshort template.
* @property responseMappingTemplate The response mapping template.
* @property responseMappingTemplateS3Location The location of a response mapping template in an S3 bucket. Use this if you want to provision with a template file in S3 rather than embedding it in your CFNshort template.
* @property runtime Describes a runtime used by an APSYlong resolver or APSYlong function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.
* @property syncConfig The ``SyncConfig`` for a resolver attached to a versioned data source.
* @property typeName The GraphQL type that invokes this resolver.
*/
public data class ResolverArgs(
public val apiId: Output? = null,
public val cachingConfig: Output? = null,
public val code: Output? = null,
public val codeS3Location: Output? = null,
public val dataSourceName: Output? = null,
public val fieldName: Output? = null,
public val kind: Output? = null,
public val maxBatchSize: Output? = null,
public val metricsConfig: Output? = null,
public val pipelineConfig: Output? = null,
public val requestMappingTemplate: Output? = null,
public val requestMappingTemplateS3Location: Output? = null,
public val responseMappingTemplate: Output? = null,
public val responseMappingTemplateS3Location: Output? = null,
public val runtime: Output? = null,
public val syncConfig: Output? = null,
public val typeName: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.awsnative.appsync.ResolverArgs =
com.pulumi.awsnative.appsync.ResolverArgs.builder()
.apiId(apiId?.applyValue({ args0 -> args0 }))
.cachingConfig(cachingConfig?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.code(code?.applyValue({ args0 -> args0 }))
.codeS3Location(codeS3Location?.applyValue({ args0 -> args0 }))
.dataSourceName(dataSourceName?.applyValue({ args0 -> args0 }))
.fieldName(fieldName?.applyValue({ args0 -> args0 }))
.kind(kind?.applyValue({ args0 -> args0 }))
.maxBatchSize(maxBatchSize?.applyValue({ args0 -> args0 }))
.metricsConfig(metricsConfig?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.pipelineConfig(pipelineConfig?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.requestMappingTemplate(requestMappingTemplate?.applyValue({ args0 -> args0 }))
.requestMappingTemplateS3Location(requestMappingTemplateS3Location?.applyValue({ args0 -> args0 }))
.responseMappingTemplate(responseMappingTemplate?.applyValue({ args0 -> args0 }))
.responseMappingTemplateS3Location(
responseMappingTemplateS3Location?.applyValue({ args0 ->
args0
}),
)
.runtime(runtime?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.syncConfig(syncConfig?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.typeName(typeName?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [ResolverArgs].
*/
@PulumiTagMarker
public class ResolverArgsBuilder internal constructor() {
private var apiId: Output? = null
private var cachingConfig: Output? = null
private var code: Output? = null
private var codeS3Location: Output? = null
private var dataSourceName: Output? = null
private var fieldName: Output? = null
private var kind: Output? = null
private var maxBatchSize: Output? = null
private var metricsConfig: Output? = null
private var pipelineConfig: Output? = null
private var requestMappingTemplate: Output? = null
private var requestMappingTemplateS3Location: Output? = null
private var responseMappingTemplate: Output? = null
private var responseMappingTemplateS3Location: Output? = null
private var runtime: Output? = null
private var syncConfig: Output? = null
private var typeName: Output? = null
/**
* @param value The APSYlong GraphQL API to which you want to attach this resolver.
*/
@JvmName("xnywexyxtdjpocgl")
public suspend fun apiId(`value`: Output) {
this.apiId = value
}
/**
* @param value The caching configuration for the resolver.
*/
@JvmName("hkhcsetoegjpjfvw")
public suspend fun cachingConfig(`value`: Output) {
this.cachingConfig = value
}
/**
* @param value The ``resolver`` code that contains the request and response functions. When code is used, the ``runtime`` is required. The runtime value must be ``APPSYNC_JS``.
*/
@JvmName("odcionyamndjlgpi")
public suspend fun code(`value`: Output) {
this.code = value
}
/**
* @param value The Amazon S3 endpoint.
*/
@JvmName("jcjnjwkiufutqcqi")
public suspend fun codeS3Location(`value`: Output) {
this.codeS3Location = value
}
/**
* @param value The resolver data source name.
*/
@JvmName("vaoveohbldmxqfxf")
public suspend fun dataSourceName(`value`: Output) {
this.dataSourceName = value
}
/**
* @param value The GraphQL field on a type that invokes the resolver.
*/
@JvmName("xrmnaxmcbqbxpnsg")
public suspend fun fieldName(`value`: Output) {
this.fieldName = value
}
/**
* @param value The resolver type.
* + *UNIT*: A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source.
* + *PIPELINE*: A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of ``Function`` objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.
*/
@JvmName("xqpmmxwdxjlddwil")
public suspend fun kind(`value`: Output) {
this.kind = value
}
/**
* @param value The maximum number of resolver request inputs that will be sent to a single LAMlong function in a ``BatchInvoke`` operation.
*/
@JvmName("rvopavnwykyeuvft")
public suspend fun maxBatchSize(`value`: Output) {
this.maxBatchSize = value
}
/**
* @param value Enables or disables enhanced resolver metrics for specified resolvers. Note that ``MetricsConfig`` won't be used unless the ``resolverLevelMetricsBehavior`` value is set to ``PER_RESOLVER_METRICS``. If the ``resolverLevelMetricsBehavior`` is set to ``FULL_REQUEST_RESOLVER_METRICS`` instead, ``MetricsConfig`` will be ignored. However, you can still set its value.
*/
@JvmName("tajmrvsomludbvir")
public suspend fun metricsConfig(`value`: Output) {
this.metricsConfig = value
}
/**
* @param value Functions linked with the pipeline resolver.
*/
@JvmName("freevboxooppbnyj")
public suspend fun pipelineConfig(`value`: Output) {
this.pipelineConfig = value
}
/**
* @param value The request mapping template.
* Request mapping templates are optional when using a Lambda data source. For all other data sources, a request mapping template is required.
*/
@JvmName("abfpwkgdlowrjarg")
public suspend fun requestMappingTemplate(`value`: Output) {
this.requestMappingTemplate = value
}
/**
* @param value The location of a request mapping template in an S3 bucket. Use this if you want to provision with a template file in S3 rather than embedding it in your CFNshort template.
*/
@JvmName("gamgrvnnluemahck")
public suspend fun requestMappingTemplateS3Location(`value`: Output) {
this.requestMappingTemplateS3Location = value
}
/**
* @param value The response mapping template.
*/
@JvmName("aprqbvpbmncqkuwe")
public suspend fun responseMappingTemplate(`value`: Output) {
this.responseMappingTemplate = value
}
/**
* @param value The location of a response mapping template in an S3 bucket. Use this if you want to provision with a template file in S3 rather than embedding it in your CFNshort template.
*/
@JvmName("aojlvaqkcojcshns")
public suspend fun responseMappingTemplateS3Location(`value`: Output) {
this.responseMappingTemplateS3Location = value
}
/**
* @param value Describes a runtime used by an APSYlong resolver or APSYlong function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.
*/
@JvmName("mamlexrojjxcfxxg")
public suspend fun runtime(`value`: Output) {
this.runtime = value
}
/**
* @param value The ``SyncConfig`` for a resolver attached to a versioned data source.
*/
@JvmName("bcmdircsmcumbepu")
public suspend fun syncConfig(`value`: Output) {
this.syncConfig = value
}
/**
* @param value The GraphQL type that invokes this resolver.
*/
@JvmName("vxkkfkusneixucux")
public suspend fun typeName(`value`: Output) {
this.typeName = value
}
/**
* @param value The APSYlong GraphQL API to which you want to attach this resolver.
*/
@JvmName("gttxcastdotybjkg")
public suspend fun apiId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.apiId = mapped
}
/**
* @param value The caching configuration for the resolver.
*/
@JvmName("sjmybfvrowutrhjw")
public suspend fun cachingConfig(`value`: ResolverCachingConfigArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.cachingConfig = mapped
}
/**
* @param argument The caching configuration for the resolver.
*/
@JvmName("eqrshgdmeyucokmy")
public suspend fun cachingConfig(argument: suspend ResolverCachingConfigArgsBuilder.() -> Unit) {
val toBeMapped = ResolverCachingConfigArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.cachingConfig = mapped
}
/**
* @param value The ``resolver`` code that contains the request and response functions. When code is used, the ``runtime`` is required. The runtime value must be ``APPSYNC_JS``.
*/
@JvmName("goejhluuatqhmcud")
public suspend fun code(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.code = mapped
}
/**
* @param value The Amazon S3 endpoint.
*/
@JvmName("kayambsdtjugruax")
public suspend fun codeS3Location(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.codeS3Location = mapped
}
/**
* @param value The resolver data source name.
*/
@JvmName("kgrcimktsyrhobii")
public suspend fun dataSourceName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.dataSourceName = mapped
}
/**
* @param value The GraphQL field on a type that invokes the resolver.
*/
@JvmName("rsfkjlbkrwscrtni")
public suspend fun fieldName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.fieldName = mapped
}
/**
* @param value The resolver type.
* + *UNIT*: A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source.
* + *PIPELINE*: A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of ``Function`` objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.
*/
@JvmName("vulagtdqpbxntott")
public suspend fun kind(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.kind = mapped
}
/**
* @param value The maximum number of resolver request inputs that will be sent to a single LAMlong function in a ``BatchInvoke`` operation.
*/
@JvmName("fdwddpvghnsjldtb")
public suspend fun maxBatchSize(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.maxBatchSize = mapped
}
/**
* @param value Enables or disables enhanced resolver metrics for specified resolvers. Note that ``MetricsConfig`` won't be used unless the ``resolverLevelMetricsBehavior`` value is set to ``PER_RESOLVER_METRICS``. If the ``resolverLevelMetricsBehavior`` is set to ``FULL_REQUEST_RESOLVER_METRICS`` instead, ``MetricsConfig`` will be ignored. However, you can still set its value.
*/
@JvmName("lvtxbeoobcrsjflu")
public suspend fun metricsConfig(`value`: ResolverMetricsConfig?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.metricsConfig = mapped
}
/**
* @param value Functions linked with the pipeline resolver.
*/
@JvmName("leoacvmclhofgfnb")
public suspend fun pipelineConfig(`value`: ResolverPipelineConfigArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.pipelineConfig = mapped
}
/**
* @param argument Functions linked with the pipeline resolver.
*/
@JvmName("ljacymhdjgwrrvce")
public suspend fun pipelineConfig(argument: suspend ResolverPipelineConfigArgsBuilder.() -> Unit) {
val toBeMapped = ResolverPipelineConfigArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.pipelineConfig = mapped
}
/**
* @param value The request mapping template.
* Request mapping templates are optional when using a Lambda data source. For all other data sources, a request mapping template is required.
*/
@JvmName("sdostmqnwnnsfuww")
public suspend fun requestMappingTemplate(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.requestMappingTemplate = mapped
}
/**
* @param value The location of a request mapping template in an S3 bucket. Use this if you want to provision with a template file in S3 rather than embedding it in your CFNshort template.
*/
@JvmName("ujukuwveagfbyjqx")
public suspend fun requestMappingTemplateS3Location(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.requestMappingTemplateS3Location = mapped
}
/**
* @param value The response mapping template.
*/
@JvmName("jtcisyoxgsfjtyxs")
public suspend fun responseMappingTemplate(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.responseMappingTemplate = mapped
}
/**
* @param value The location of a response mapping template in an S3 bucket. Use this if you want to provision with a template file in S3 rather than embedding it in your CFNshort template.
*/
@JvmName("agckmitpqeerboyn")
public suspend fun responseMappingTemplateS3Location(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.responseMappingTemplateS3Location = mapped
}
/**
* @param value Describes a runtime used by an APSYlong resolver or APSYlong function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.
*/
@JvmName("ubmfheuygwwverrv")
public suspend fun runtime(`value`: ResolverAppSyncRuntimeArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.runtime = mapped
}
/**
* @param argument Describes a runtime used by an APSYlong resolver or APSYlong function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.
*/
@JvmName("hstamrdovcgpfyja")
public suspend fun runtime(argument: suspend ResolverAppSyncRuntimeArgsBuilder.() -> Unit) {
val toBeMapped = ResolverAppSyncRuntimeArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.runtime = mapped
}
/**
* @param value The ``SyncConfig`` for a resolver attached to a versioned data source.
*/
@JvmName("eoxlsjecvmtyrwsa")
public suspend fun syncConfig(`value`: ResolverSyncConfigArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.syncConfig = mapped
}
/**
* @param argument The ``SyncConfig`` for a resolver attached to a versioned data source.
*/
@JvmName("qbphcgehewnrtqhu")
public suspend fun syncConfig(argument: suspend ResolverSyncConfigArgsBuilder.() -> Unit) {
val toBeMapped = ResolverSyncConfigArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.syncConfig = mapped
}
/**
* @param value The GraphQL type that invokes this resolver.
*/
@JvmName("nefpjtcytmfpmadi")
public suspend fun typeName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.typeName = mapped
}
internal fun build(): ResolverArgs = ResolverArgs(
apiId = apiId,
cachingConfig = cachingConfig,
code = code,
codeS3Location = codeS3Location,
dataSourceName = dataSourceName,
fieldName = fieldName,
kind = kind,
maxBatchSize = maxBatchSize,
metricsConfig = metricsConfig,
pipelineConfig = pipelineConfig,
requestMappingTemplate = requestMappingTemplate,
requestMappingTemplateS3Location = requestMappingTemplateS3Location,
responseMappingTemplate = responseMappingTemplate,
responseMappingTemplateS3Location = responseMappingTemplateS3Location,
runtime = runtime,
syncConfig = syncConfig,
typeName = typeName,
)
}