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

com.pulumi.azure.apimanagement.kotlin.AuthorizationServerArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.apimanagement.kotlin

import com.pulumi.azure.apimanagement.AuthorizationServerArgs.builder
import com.pulumi.azure.apimanagement.kotlin.inputs.AuthorizationServerTokenBodyParameterArgs
import com.pulumi.azure.apimanagement.kotlin.inputs.AuthorizationServerTokenBodyParameterArgsBuilder
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.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Manages an Authorization Server within an API Management Service.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = azure.apimanagement.getService({
 *     name: "search-api",
 *     resourceGroupName: "search-service",
 * });
 * const exampleAuthorizationServer = new azure.apimanagement.AuthorizationServer("example", {
 *     name: "test-server",
 *     apiManagementName: example.then(example => example.name),
 *     resourceGroupName: example.then(example => example.resourceGroupName),
 *     displayName: "Test Server",
 *     authorizationEndpoint: "https://example.mydomain.com/client/authorize",
 *     clientId: "42424242-4242-4242-4242-424242424242",
 *     clientRegistrationEndpoint: "https://example.mydomain.com/client/register",
 *     grantTypes: ["authorizationCode"],
 *     authorizationMethods: ["GET"],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.apimanagement.get_service(name="search-api",
 *     resource_group_name="search-service")
 * example_authorization_server = azure.apimanagement.AuthorizationServer("example",
 *     name="test-server",
 *     api_management_name=example.name,
 *     resource_group_name=example.resource_group_name,
 *     display_name="Test Server",
 *     authorization_endpoint="https://example.mydomain.com/client/authorize",
 *     client_id="42424242-4242-4242-4242-424242424242",
 *     client_registration_endpoint="https://example.mydomain.com/client/register",
 *     grant_types=["authorizationCode"],
 *     authorization_methods=["GET"])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = Azure.ApiManagement.GetService.Invoke(new()
 *     {
 *         Name = "search-api",
 *         ResourceGroupName = "search-service",
 *     });
 *     var exampleAuthorizationServer = new Azure.ApiManagement.AuthorizationServer("example", new()
 *     {
 *         Name = "test-server",
 *         ApiManagementName = example.Apply(getServiceResult => getServiceResult.Name),
 *         ResourceGroupName = example.Apply(getServiceResult => getServiceResult.ResourceGroupName),
 *         DisplayName = "Test Server",
 *         AuthorizationEndpoint = "https://example.mydomain.com/client/authorize",
 *         ClientId = "42424242-4242-4242-4242-424242424242",
 *         ClientRegistrationEndpoint = "https://example.mydomain.com/client/register",
 *         GrantTypes = new[]
 *         {
 *             "authorizationCode",
 *         },
 *         AuthorizationMethods = new[]
 *         {
 *             "GET",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := apimanagement.LookupService(ctx, &apimanagement.LookupServiceArgs{
 * 			Name:              "search-api",
 * 			ResourceGroupName: "search-service",
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = apimanagement.NewAuthorizationServer(ctx, "example", &apimanagement.AuthorizationServerArgs{
 * 			Name:                       pulumi.String("test-server"),
 * 			ApiManagementName:          pulumi.String(example.Name),
 * 			ResourceGroupName:          pulumi.String(example.ResourceGroupName),
 * 			DisplayName:                pulumi.String("Test Server"),
 * 			AuthorizationEndpoint:      pulumi.String("https://example.mydomain.com/client/authorize"),
 * 			ClientId:                   pulumi.String("42424242-4242-4242-4242-424242424242"),
 * 			ClientRegistrationEndpoint: pulumi.String("https://example.mydomain.com/client/register"),
 * 			GrantTypes: pulumi.StringArray{
 * 				pulumi.String("authorizationCode"),
 * 			},
 * 			AuthorizationMethods: pulumi.StringArray{
 * 				pulumi.String("GET"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azure.apimanagement.ApimanagementFunctions;
 * import com.pulumi.azure.apimanagement.inputs.GetServiceArgs;
 * import com.pulumi.azure.apimanagement.AuthorizationServer;
 * import com.pulumi.azure.apimanagement.AuthorizationServerArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         final var example = ApimanagementFunctions.getService(GetServiceArgs.builder()
 *             .name("search-api")
 *             .resourceGroupName("search-service")
 *             .build());
 *         var exampleAuthorizationServer = new AuthorizationServer("exampleAuthorizationServer", AuthorizationServerArgs.builder()
 *             .name("test-server")
 *             .apiManagementName(example.applyValue(getServiceResult -> getServiceResult.name()))
 *             .resourceGroupName(example.applyValue(getServiceResult -> getServiceResult.resourceGroupName()))
 *             .displayName("Test Server")
 *             .authorizationEndpoint("https://example.mydomain.com/client/authorize")
 *             .clientId("42424242-4242-4242-4242-424242424242")
 *             .clientRegistrationEndpoint("https://example.mydomain.com/client/register")
 *             .grantTypes("authorizationCode")
 *             .authorizationMethods("GET")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   exampleAuthorizationServer:
 *     type: azure:apimanagement:AuthorizationServer
 *     name: example
 *     properties:
 *       name: test-server
 *       apiManagementName: ${example.name}
 *       resourceGroupName: ${example.resourceGroupName}
 *       displayName: Test Server
 *       authorizationEndpoint: https://example.mydomain.com/client/authorize
 *       clientId: 42424242-4242-4242-4242-424242424242
 *       clientRegistrationEndpoint: https://example.mydomain.com/client/register
 *       grantTypes:
 *         - authorizationCode
 *       authorizationMethods:
 *         - GET
 * variables:
 *   example:
 *     fn::invoke:
 *       Function: azure:apimanagement:getService
 *       Arguments:
 *         name: search-api
 *         resourceGroupName: search-service
 * ```
 * 
 * ## Import
 * API Management Authorization Servers can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:apimanagement/authorizationServer:AuthorizationServer example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.ApiManagement/service/service1/authorizationServers/server1
 * ```
 * @property apiManagementName The name of the API Management Service in which this Authorization Server should be created. Changing this forces a new resource to be created.
 * @property authorizationEndpoint The OAUTH Authorization Endpoint.
 * @property authorizationMethods The HTTP Verbs supported by the Authorization Endpoint. Possible values are `DELETE`, `GET`, `HEAD`, `OPTIONS`, `PATCH`, `POST`, `PUT` and `TRACE`.
 * > **NOTE:** `GET` must always be present.
 * @property bearerTokenSendingMethods The mechanism by which Access Tokens are passed to the API. Possible values are `authorizationHeader` and `query`.
 * @property clientAuthenticationMethods The Authentication Methods supported by the Token endpoint of this Authorization Server.. Possible values are `Basic` and `Body`.
 * @property clientId The Client/App ID registered with this Authorization Server.
 * @property clientRegistrationEndpoint The URI of page where Client/App Registration is performed for this Authorization Server.
 * @property clientSecret The Client/App Secret registered with this Authorization Server.
 * @property defaultScope The Default Scope used when requesting an Access Token, specified as a string containing space-delimited values.
 * @property description A description of the Authorization Server, which may contain HTML formatting tags.
 * @property displayName The user-friendly name of this Authorization Server.
 * @property grantTypes Form of Authorization Grants required when requesting an Access Token. Possible values are `authorizationCode`, `clientCredentials`, `implicit` and `resourceOwnerPassword`.
 * @property name The name of this Authorization Server. Changing this forces a new resource to be created.
 * @property resourceGroupName The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
 * @property resourceOwnerPassword The password associated with the Resource Owner.
 * > **NOTE:** This can only be specified when `grant_type` includes `resourceOwnerPassword`.
 * @property resourceOwnerUsername The username associated with the Resource Owner.
 * > **NOTE:** This can only be specified when `grant_type` includes `resourceOwnerPassword`.
 * @property supportState Does this Authorization Server support State? If this is set to `true` the client may use the state parameter to raise protocol security.
 * @property tokenBodyParameters A `token_body_parameter` block as defined below.
 * @property tokenEndpoint The OAUTH Token Endpoint.
 */
public data class AuthorizationServerArgs(
    public val apiManagementName: Output? = null,
    public val authorizationEndpoint: Output? = null,
    public val authorizationMethods: Output>? = null,
    public val bearerTokenSendingMethods: Output>? = null,
    public val clientAuthenticationMethods: Output>? = null,
    public val clientId: Output? = null,
    public val clientRegistrationEndpoint: Output? = null,
    public val clientSecret: Output? = null,
    public val defaultScope: Output? = null,
    public val description: Output? = null,
    public val displayName: Output? = null,
    public val grantTypes: Output>? = null,
    public val name: Output? = null,
    public val resourceGroupName: Output? = null,
    public val resourceOwnerPassword: Output? = null,
    public val resourceOwnerUsername: Output? = null,
    public val supportState: Output? = null,
    public val tokenBodyParameters: Output>? = null,
    public val tokenEndpoint: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.apimanagement.AuthorizationServerArgs =
        com.pulumi.azure.apimanagement.AuthorizationServerArgs.builder()
            .apiManagementName(apiManagementName?.applyValue({ args0 -> args0 }))
            .authorizationEndpoint(authorizationEndpoint?.applyValue({ args0 -> args0 }))
            .authorizationMethods(authorizationMethods?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .bearerTokenSendingMethods(
                bearerTokenSendingMethods?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0
                    })
                }),
            )
            .clientAuthenticationMethods(
                clientAuthenticationMethods?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0
                    })
                }),
            )
            .clientId(clientId?.applyValue({ args0 -> args0 }))
            .clientRegistrationEndpoint(clientRegistrationEndpoint?.applyValue({ args0 -> args0 }))
            .clientSecret(clientSecret?.applyValue({ args0 -> args0 }))
            .defaultScope(defaultScope?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .displayName(displayName?.applyValue({ args0 -> args0 }))
            .grantTypes(grantTypes?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .name(name?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .resourceOwnerPassword(resourceOwnerPassword?.applyValue({ args0 -> args0 }))
            .resourceOwnerUsername(resourceOwnerUsername?.applyValue({ args0 -> args0 }))
            .supportState(supportState?.applyValue({ args0 -> args0 }))
            .tokenBodyParameters(
                tokenBodyParameters?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .tokenEndpoint(tokenEndpoint?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [AuthorizationServerArgs].
 */
@PulumiTagMarker
public class AuthorizationServerArgsBuilder internal constructor() {
    private var apiManagementName: Output? = null

    private var authorizationEndpoint: Output? = null

    private var authorizationMethods: Output>? = null

    private var bearerTokenSendingMethods: Output>? = null

    private var clientAuthenticationMethods: Output>? = null

    private var clientId: Output? = null

    private var clientRegistrationEndpoint: Output? = null

    private var clientSecret: Output? = null

    private var defaultScope: Output? = null

    private var description: Output? = null

    private var displayName: Output? = null

    private var grantTypes: Output>? = null

    private var name: Output? = null

    private var resourceGroupName: Output? = null

    private var resourceOwnerPassword: Output? = null

    private var resourceOwnerUsername: Output? = null

    private var supportState: Output? = null

    private var tokenBodyParameters: Output>? = null

    private var tokenEndpoint: Output? = null

    /**
     * @param value The name of the API Management Service in which this Authorization Server should be created. Changing this forces a new resource to be created.
     */
    @JvmName("sgvhskqryyibgkpq")
    public suspend fun apiManagementName(`value`: Output) {
        this.apiManagementName = value
    }

    /**
     * @param value The OAUTH Authorization Endpoint.
     */
    @JvmName("gdxilxmpndmpbutx")
    public suspend fun authorizationEndpoint(`value`: Output) {
        this.authorizationEndpoint = value
    }

    /**
     * @param value The HTTP Verbs supported by the Authorization Endpoint. Possible values are `DELETE`, `GET`, `HEAD`, `OPTIONS`, `PATCH`, `POST`, `PUT` and `TRACE`.
     * > **NOTE:** `GET` must always be present.
     */
    @JvmName("vggmubgijowqinxh")
    public suspend fun authorizationMethods(`value`: Output>) {
        this.authorizationMethods = value
    }

    @JvmName("vptkvgndeipwjnjb")
    public suspend fun authorizationMethods(vararg values: Output) {
        this.authorizationMethods = Output.all(values.asList())
    }

    /**
     * @param values The HTTP Verbs supported by the Authorization Endpoint. Possible values are `DELETE`, `GET`, `HEAD`, `OPTIONS`, `PATCH`, `POST`, `PUT` and `TRACE`.
     * > **NOTE:** `GET` must always be present.
     */
    @JvmName("iivtfqqwstghpopq")
    public suspend fun authorizationMethods(values: List>) {
        this.authorizationMethods = Output.all(values)
    }

    /**
     * @param value The mechanism by which Access Tokens are passed to the API. Possible values are `authorizationHeader` and `query`.
     */
    @JvmName("wqabmltwrebjydxd")
    public suspend fun bearerTokenSendingMethods(`value`: Output>) {
        this.bearerTokenSendingMethods = value
    }

    @JvmName("jitvyfildfkwtdoq")
    public suspend fun bearerTokenSendingMethods(vararg values: Output) {
        this.bearerTokenSendingMethods = Output.all(values.asList())
    }

    /**
     * @param values The mechanism by which Access Tokens are passed to the API. Possible values are `authorizationHeader` and `query`.
     */
    @JvmName("phcskgrmsjodjcdh")
    public suspend fun bearerTokenSendingMethods(values: List>) {
        this.bearerTokenSendingMethods = Output.all(values)
    }

    /**
     * @param value The Authentication Methods supported by the Token endpoint of this Authorization Server.. Possible values are `Basic` and `Body`.
     */
    @JvmName("loujcyxwlbgklyej")
    public suspend fun clientAuthenticationMethods(`value`: Output>) {
        this.clientAuthenticationMethods = value
    }

    @JvmName("knoivsmcvaqoqmor")
    public suspend fun clientAuthenticationMethods(vararg values: Output) {
        this.clientAuthenticationMethods = Output.all(values.asList())
    }

    /**
     * @param values The Authentication Methods supported by the Token endpoint of this Authorization Server.. Possible values are `Basic` and `Body`.
     */
    @JvmName("pqwdwtyxvyaornxg")
    public suspend fun clientAuthenticationMethods(values: List>) {
        this.clientAuthenticationMethods = Output.all(values)
    }

    /**
     * @param value The Client/App ID registered with this Authorization Server.
     */
    @JvmName("tgvtmfyytfitoasp")
    public suspend fun clientId(`value`: Output) {
        this.clientId = value
    }

    /**
     * @param value The URI of page where Client/App Registration is performed for this Authorization Server.
     */
    @JvmName("mnqvmsrajxfcrecr")
    public suspend fun clientRegistrationEndpoint(`value`: Output) {
        this.clientRegistrationEndpoint = value
    }

    /**
     * @param value The Client/App Secret registered with this Authorization Server.
     */
    @JvmName("yqpdmudahprurlsv")
    public suspend fun clientSecret(`value`: Output) {
        this.clientSecret = value
    }

    /**
     * @param value The Default Scope used when requesting an Access Token, specified as a string containing space-delimited values.
     */
    @JvmName("xrhrsjlmbtnkcpod")
    public suspend fun defaultScope(`value`: Output) {
        this.defaultScope = value
    }

    /**
     * @param value A description of the Authorization Server, which may contain HTML formatting tags.
     */
    @JvmName("xqudqykgreotttdj")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value The user-friendly name of this Authorization Server.
     */
    @JvmName("pkwytcsgstynkagq")
    public suspend fun displayName(`value`: Output) {
        this.displayName = value
    }

    /**
     * @param value Form of Authorization Grants required when requesting an Access Token. Possible values are `authorizationCode`, `clientCredentials`, `implicit` and `resourceOwnerPassword`.
     */
    @JvmName("vhpguxvettvhixfj")
    public suspend fun grantTypes(`value`: Output>) {
        this.grantTypes = value
    }

    @JvmName("jfbuhbciyvtjuics")
    public suspend fun grantTypes(vararg values: Output) {
        this.grantTypes = Output.all(values.asList())
    }

    /**
     * @param values Form of Authorization Grants required when requesting an Access Token. Possible values are `authorizationCode`, `clientCredentials`, `implicit` and `resourceOwnerPassword`.
     */
    @JvmName("klopcignnpyrwmnr")
    public suspend fun grantTypes(values: List>) {
        this.grantTypes = Output.all(values)
    }

    /**
     * @param value The name of this Authorization Server. Changing this forces a new resource to be created.
     */
    @JvmName("mwppcddbhsfqlxmj")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
     */
    @JvmName("bjhajkprqqooeegx")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value The password associated with the Resource Owner.
     * > **NOTE:** This can only be specified when `grant_type` includes `resourceOwnerPassword`.
     */
    @JvmName("prpbsrnhhinihupa")
    public suspend fun resourceOwnerPassword(`value`: Output) {
        this.resourceOwnerPassword = value
    }

    /**
     * @param value The username associated with the Resource Owner.
     * > **NOTE:** This can only be specified when `grant_type` includes `resourceOwnerPassword`.
     */
    @JvmName("wsxbcliccwvnaxmc")
    public suspend fun resourceOwnerUsername(`value`: Output) {
        this.resourceOwnerUsername = value
    }

    /**
     * @param value Does this Authorization Server support State? If this is set to `true` the client may use the state parameter to raise protocol security.
     */
    @JvmName("bnnpmumeqqqrchay")
    public suspend fun supportState(`value`: Output) {
        this.supportState = value
    }

    /**
     * @param value A `token_body_parameter` block as defined below.
     */
    @JvmName("ikgxhphminxqttxr")
    public suspend
    fun tokenBodyParameters(`value`: Output>) {
        this.tokenBodyParameters = value
    }

    @JvmName("upimnwbmvnidamha")
    public suspend fun tokenBodyParameters(
        vararg
        values: Output,
    ) {
        this.tokenBodyParameters = Output.all(values.asList())
    }

    /**
     * @param values A `token_body_parameter` block as defined below.
     */
    @JvmName("nxgaxkahhiaatfcn")
    public suspend
    fun tokenBodyParameters(values: List>) {
        this.tokenBodyParameters = Output.all(values)
    }

    /**
     * @param value The OAUTH Token Endpoint.
     */
    @JvmName("mulbboxtmqggymai")
    public suspend fun tokenEndpoint(`value`: Output) {
        this.tokenEndpoint = value
    }

    /**
     * @param value The name of the API Management Service in which this Authorization Server should be created. Changing this forces a new resource to be created.
     */
    @JvmName("onpveujphglewbjd")
    public suspend fun apiManagementName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.apiManagementName = mapped
    }

    /**
     * @param value The OAUTH Authorization Endpoint.
     */
    @JvmName("mrheecowcmmtjqmv")
    public suspend fun authorizationEndpoint(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.authorizationEndpoint = mapped
    }

    /**
     * @param value The HTTP Verbs supported by the Authorization Endpoint. Possible values are `DELETE`, `GET`, `HEAD`, `OPTIONS`, `PATCH`, `POST`, `PUT` and `TRACE`.
     * > **NOTE:** `GET` must always be present.
     */
    @JvmName("msdrggyrmubkxcpc")
    public suspend fun authorizationMethods(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.authorizationMethods = mapped
    }

    /**
     * @param values The HTTP Verbs supported by the Authorization Endpoint. Possible values are `DELETE`, `GET`, `HEAD`, `OPTIONS`, `PATCH`, `POST`, `PUT` and `TRACE`.
     * > **NOTE:** `GET` must always be present.
     */
    @JvmName("akvfsehabcbqgebu")
    public suspend fun authorizationMethods(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.authorizationMethods = mapped
    }

    /**
     * @param value The mechanism by which Access Tokens are passed to the API. Possible values are `authorizationHeader` and `query`.
     */
    @JvmName("eywnwrkmcpmapiyf")
    public suspend fun bearerTokenSendingMethods(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.bearerTokenSendingMethods = mapped
    }

    /**
     * @param values The mechanism by which Access Tokens are passed to the API. Possible values are `authorizationHeader` and `query`.
     */
    @JvmName("ajedkfjxuefcetuy")
    public suspend fun bearerTokenSendingMethods(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.bearerTokenSendingMethods = mapped
    }

    /**
     * @param value The Authentication Methods supported by the Token endpoint of this Authorization Server.. Possible values are `Basic` and `Body`.
     */
    @JvmName("efyymtrnwrhfvmxj")
    public suspend fun clientAuthenticationMethods(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.clientAuthenticationMethods = mapped
    }

    /**
     * @param values The Authentication Methods supported by the Token endpoint of this Authorization Server.. Possible values are `Basic` and `Body`.
     */
    @JvmName("kmrtbrntjhwpvmda")
    public suspend fun clientAuthenticationMethods(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.clientAuthenticationMethods = mapped
    }

    /**
     * @param value The Client/App ID registered with this Authorization Server.
     */
    @JvmName("uspuobedxyihbsft")
    public suspend fun clientId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.clientId = mapped
    }

    /**
     * @param value The URI of page where Client/App Registration is performed for this Authorization Server.
     */
    @JvmName("xdjcuwvgtpjuoxem")
    public suspend fun clientRegistrationEndpoint(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.clientRegistrationEndpoint = mapped
    }

    /**
     * @param value The Client/App Secret registered with this Authorization Server.
     */
    @JvmName("aikuienbpuvguhad")
    public suspend fun clientSecret(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.clientSecret = mapped
    }

    /**
     * @param value The Default Scope used when requesting an Access Token, specified as a string containing space-delimited values.
     */
    @JvmName("ephrqnipgijfcmke")
    public suspend fun defaultScope(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.defaultScope = mapped
    }

    /**
     * @param value A description of the Authorization Server, which may contain HTML formatting tags.
     */
    @JvmName("buhltepcinfdrrew")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value The user-friendly name of this Authorization Server.
     */
    @JvmName("xlmplbonogyemouh")
    public suspend fun displayName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.displayName = mapped
    }

    /**
     * @param value Form of Authorization Grants required when requesting an Access Token. Possible values are `authorizationCode`, `clientCredentials`, `implicit` and `resourceOwnerPassword`.
     */
    @JvmName("rwhsgxwioqxkimfp")
    public suspend fun grantTypes(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.grantTypes = mapped
    }

    /**
     * @param values Form of Authorization Grants required when requesting an Access Token. Possible values are `authorizationCode`, `clientCredentials`, `implicit` and `resourceOwnerPassword`.
     */
    @JvmName("eiwywftomtmoyhlv")
    public suspend fun grantTypes(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.grantTypes = mapped
    }

    /**
     * @param value The name of this Authorization Server. Changing this forces a new resource to be created.
     */
    @JvmName("exghjhpplhgqxolb")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
     */
    @JvmName("gbwuhdnqhmdysswu")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value The password associated with the Resource Owner.
     * > **NOTE:** This can only be specified when `grant_type` includes `resourceOwnerPassword`.
     */
    @JvmName("vebukbldxhxiwoao")
    public suspend fun resourceOwnerPassword(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceOwnerPassword = mapped
    }

    /**
     * @param value The username associated with the Resource Owner.
     * > **NOTE:** This can only be specified when `grant_type` includes `resourceOwnerPassword`.
     */
    @JvmName("omdngkykakokxoyq")
    public suspend fun resourceOwnerUsername(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceOwnerUsername = mapped
    }

    /**
     * @param value Does this Authorization Server support State? If this is set to `true` the client may use the state parameter to raise protocol security.
     */
    @JvmName("yhvphafpemuqcvka")
    public suspend fun supportState(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.supportState = mapped
    }

    /**
     * @param value A `token_body_parameter` block as defined below.
     */
    @JvmName("qsnemyfsqtjauttu")
    public suspend
    fun tokenBodyParameters(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tokenBodyParameters = mapped
    }

    /**
     * @param argument A `token_body_parameter` block as defined below.
     */
    @JvmName("ledrhnehqkgneqnc")
    public suspend
    fun tokenBodyParameters(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            AuthorizationServerTokenBodyParameterArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.tokenBodyParameters = mapped
    }

    /**
     * @param argument A `token_body_parameter` block as defined below.
     */
    @JvmName("feikrrkhwddsffrq")
    public suspend fun tokenBodyParameters(
        vararg
        argument: suspend AuthorizationServerTokenBodyParameterArgsBuilder.() -> Unit,
    ) {
        val toBeMapped = argument.toList().map {
            AuthorizationServerTokenBodyParameterArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.tokenBodyParameters = mapped
    }

    /**
     * @param argument A `token_body_parameter` block as defined below.
     */
    @JvmName("cjjvphscirbowpca")
    public suspend
    fun tokenBodyParameters(argument: suspend AuthorizationServerTokenBodyParameterArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            AuthorizationServerTokenBodyParameterArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.tokenBodyParameters = mapped
    }

    /**
     * @param values A `token_body_parameter` block as defined below.
     */
    @JvmName("tbvpporykjrcjcah")
    public suspend fun tokenBodyParameters(vararg values: AuthorizationServerTokenBodyParameterArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tokenBodyParameters = mapped
    }

    /**
     * @param value The OAUTH Token Endpoint.
     */
    @JvmName("nypvaymgccanwieo")
    public suspend fun tokenEndpoint(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tokenEndpoint = mapped
    }

    internal fun build(): AuthorizationServerArgs = AuthorizationServerArgs(
        apiManagementName = apiManagementName,
        authorizationEndpoint = authorizationEndpoint,
        authorizationMethods = authorizationMethods,
        bearerTokenSendingMethods = bearerTokenSendingMethods,
        clientAuthenticationMethods = clientAuthenticationMethods,
        clientId = clientId,
        clientRegistrationEndpoint = clientRegistrationEndpoint,
        clientSecret = clientSecret,
        defaultScope = defaultScope,
        description = description,
        displayName = displayName,
        grantTypes = grantTypes,
        name = name,
        resourceGroupName = resourceGroupName,
        resourceOwnerPassword = resourceOwnerPassword,
        resourceOwnerUsername = resourceOwnerUsername,
        supportState = supportState,
        tokenBodyParameters = tokenBodyParameters,
        tokenEndpoint = tokenEndpoint,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy