![JAR search and dependency download from the Maven repository](/logo.png)
com.pulumi.awsnative.apigateway.kotlin.Method.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.apigateway.kotlin
import com.pulumi.awsnative.apigateway.kotlin.outputs.MethodIntegration
import com.pulumi.awsnative.apigateway.kotlin.outputs.MethodResponse
import com.pulumi.core.Either
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import com.pulumi.awsnative.apigateway.kotlin.outputs.MethodIntegration.Companion.toKotlin as methodIntegrationToKotlin
import com.pulumi.awsnative.apigateway.kotlin.outputs.MethodResponse.Companion.toKotlin as methodResponseToKotlin
/**
* Builder for [Method].
*/
@PulumiTagMarker
public class MethodResourceBuilder internal constructor() {
public var name: String? = null
public var args: MethodArgs = MethodArgs()
public var opts: CustomResourceOptions = CustomResourceOptions()
/**
* @param name The _unique_ name of the resulting resource.
*/
public fun name(`value`: String) {
this.name = value
}
/**
* @param block The arguments to use to populate this resource's properties.
*/
public suspend fun args(block: suspend MethodArgsBuilder.() -> Unit) {
val builder = MethodArgsBuilder()
block(builder)
this.args = builder.build()
}
/**
* @param block A bag of options that control this resource's behavior.
*/
public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
}
internal fun build(): Method {
val builtJavaResource = com.pulumi.awsnative.apigateway.Method(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Method(builtJavaResource)
}
}
/**
* The ``AWS::ApiGateway::Method`` resource creates API Gateway methods that define the parameters and body that clients must send in their requests.
*/
public class Method internal constructor(
override val javaResource: com.pulumi.awsnative.apigateway.Method,
) : KotlinCustomResource(javaResource, MethodMapper) {
/**
* A boolean flag specifying whether a valid ApiKey is required to invoke this method.
*/
public val apiKeyRequired: Output?
get() = javaResource.apiKeyRequired().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* A list of authorization scopes configured on the method. The scopes are used with a ``COGNITO_USER_POOLS`` authorizer to authorize the method invocation. The authorization works by matching the method scopes against the scopes parsed from the access token in the incoming request. The method invocation is authorized if any method scopes matches a claimed scope in the access token. Otherwise, the invocation is not authorized. When the method scope is configured, the client must provide an access token instead of an identity token for authorization purposes.
*/
public val authorizationScopes: Output>?
get() = javaResource.authorizationScopes().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 -> args0 })
}).orElse(null)
})
/**
* The method's authorization type. This parameter is required. For valid values, see [Method](https://docs.aws.amazon.com/apigateway/latest/api/API_Method.html) in the *API Gateway API Reference*.
* If you specify the ``AuthorizerId`` property, specify ``CUSTOM`` or ``COGNITO_USER_POOLS`` for this property.
*/
public val authorizationType: Output?
get() = javaResource.authorizationType().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The identifier of an authorizer to use on this method. The method's authorization type must be ``CUSTOM`` or ``COGNITO_USER_POOLS``.
*/
public val authorizerId: Output?
get() = javaResource.authorizerId().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The method's HTTP verb.
*/
public val httpMethod: Output
get() = javaResource.httpMethod().applyValue({ args0 -> args0 })
/**
* Represents an ``HTTP``, ``HTTP_PROXY``, ``AWS``, ``AWS_PROXY``, or Mock integration.
*/
public val integration: Output?
get() = javaResource.integration().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
methodIntegrationToKotlin(args0)
})
}).orElse(null)
})
/**
* Gets a method response associated with a given HTTP status code.
*/
public val methodResponses: Output>?
get() = javaResource.methodResponses().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 -> args0.let({ args0 -> methodResponseToKotlin(args0) }) })
}).orElse(null)
})
/**
* A human-friendly operation identifier for the method. For example, you can assign the ``operationName`` of ``ListPets`` for the ``GET /pets`` method in the ``PetStore`` example.
*/
public val operationName: Output?
get() = javaResource.operationName().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* A key-value map specifying data schemas, represented by Model resources, (as the mapped value) of the request payloads of given content types (as the mapping key).
*/
public val requestModels: Output
© 2015 - 2025 Weber Informatics LLC | Privacy Policy