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

com.pulumi.gcp.networkservices.kotlin.EndpointPolicyArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.gcp.networkservices.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.networkservices.EndpointPolicyArgs.builder
import com.pulumi.gcp.networkservices.kotlin.inputs.EndpointPolicyEndpointMatcherArgs
import com.pulumi.gcp.networkservices.kotlin.inputs.EndpointPolicyEndpointMatcherArgsBuilder
import com.pulumi.gcp.networkservices.kotlin.inputs.EndpointPolicyTrafficPortSelectorArgs
import com.pulumi.gcp.networkservices.kotlin.inputs.EndpointPolicyTrafficPortSelectorArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * ## Example Usage
 * ### Network Services Endpoint Policy Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const _default = new gcp.networkservices.EndpointPolicy("default", {
 *     name: "my-endpoint-policy",
 *     labels: {
 *         foo: "bar",
 *     },
 *     description: "my description",
 *     type: "SIDECAR_PROXY",
 *     trafficPortSelector: {
 *         ports: ["8081"],
 *     },
 *     endpointMatcher: {
 *         metadataLabelMatcher: {
 *             metadataLabelMatchCriteria: "MATCH_ANY",
 *             metadataLabels: [{
 *                 labelName: "foo",
 *                 labelValue: "bar",
 *             }],
 *         },
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default = gcp.networkservices.EndpointPolicy("default",
 *     name="my-endpoint-policy",
 *     labels={
 *         "foo": "bar",
 *     },
 *     description="my description",
 *     type="SIDECAR_PROXY",
 *     traffic_port_selector={
 *         "ports": ["8081"],
 *     },
 *     endpoint_matcher={
 *         "metadata_label_matcher": {
 *             "metadata_label_match_criteria": "MATCH_ANY",
 *             "metadata_labels": [{
 *                 "label_name": "foo",
 *                 "label_value": "bar",
 *             }],
 *         },
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @default = new Gcp.NetworkServices.EndpointPolicy("default", new()
 *     {
 *         Name = "my-endpoint-policy",
 *         Labels =
 *         {
 *             { "foo", "bar" },
 *         },
 *         Description = "my description",
 *         Type = "SIDECAR_PROXY",
 *         TrafficPortSelector = new Gcp.NetworkServices.Inputs.EndpointPolicyTrafficPortSelectorArgs
 *         {
 *             Ports = new[]
 *             {
 *                 "8081",
 *             },
 *         },
 *         EndpointMatcher = new Gcp.NetworkServices.Inputs.EndpointPolicyEndpointMatcherArgs
 *         {
 *             MetadataLabelMatcher = new Gcp.NetworkServices.Inputs.EndpointPolicyEndpointMatcherMetadataLabelMatcherArgs
 *             {
 *                 MetadataLabelMatchCriteria = "MATCH_ANY",
 *                 MetadataLabels = new[]
 *                 {
 *                     new Gcp.NetworkServices.Inputs.EndpointPolicyEndpointMatcherMetadataLabelMatcherMetadataLabelArgs
 *                     {
 *                         LabelName = "foo",
 *                         LabelValue = "bar",
 *                     },
 *                 },
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/networkservices"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := networkservices.NewEndpointPolicy(ctx, "default", &networkservices.EndpointPolicyArgs{
 * 			Name: pulumi.String("my-endpoint-policy"),
 * 			Labels: pulumi.StringMap{
 * 				"foo": pulumi.String("bar"),
 * 			},
 * 			Description: pulumi.String("my description"),
 * 			Type:        pulumi.String("SIDECAR_PROXY"),
 * 			TrafficPortSelector: &networkservices.EndpointPolicyTrafficPortSelectorArgs{
 * 				Ports: pulumi.StringArray{
 * 					pulumi.String("8081"),
 * 				},
 * 			},
 * 			EndpointMatcher: &networkservices.EndpointPolicyEndpointMatcherArgs{
 * 				MetadataLabelMatcher: &networkservices.EndpointPolicyEndpointMatcherMetadataLabelMatcherArgs{
 * 					MetadataLabelMatchCriteria: pulumi.String("MATCH_ANY"),
 * 					MetadataLabels: networkservices.EndpointPolicyEndpointMatcherMetadataLabelMatcherMetadataLabelArray{
 * 						&networkservices.EndpointPolicyEndpointMatcherMetadataLabelMatcherMetadataLabelArgs{
 * 							LabelName:  pulumi.String("foo"),
 * 							LabelValue: pulumi.String("bar"),
 * 						},
 * 					},
 * 				},
 * 			},
 * 		})
 * 		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.gcp.networkservices.EndpointPolicy;
 * import com.pulumi.gcp.networkservices.EndpointPolicyArgs;
 * import com.pulumi.gcp.networkservices.inputs.EndpointPolicyTrafficPortSelectorArgs;
 * import com.pulumi.gcp.networkservices.inputs.EndpointPolicyEndpointMatcherArgs;
 * import com.pulumi.gcp.networkservices.inputs.EndpointPolicyEndpointMatcherMetadataLabelMatcherArgs;
 * 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) {
 *         var default_ = new EndpointPolicy("default", EndpointPolicyArgs.builder()
 *             .name("my-endpoint-policy")
 *             .labels(Map.of("foo", "bar"))
 *             .description("my description")
 *             .type("SIDECAR_PROXY")
 *             .trafficPortSelector(EndpointPolicyTrafficPortSelectorArgs.builder()
 *                 .ports("8081")
 *                 .build())
 *             .endpointMatcher(EndpointPolicyEndpointMatcherArgs.builder()
 *                 .metadataLabelMatcher(EndpointPolicyEndpointMatcherMetadataLabelMatcherArgs.builder()
 *                     .metadataLabelMatchCriteria("MATCH_ANY")
 *                     .metadataLabels(EndpointPolicyEndpointMatcherMetadataLabelMatcherMetadataLabelArgs.builder()
 *                         .labelName("foo")
 *                         .labelValue("bar")
 *                         .build())
 *                     .build())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:networkservices:EndpointPolicy
 *     properties:
 *       name: my-endpoint-policy
 *       labels:
 *         foo: bar
 *       description: my description
 *       type: SIDECAR_PROXY
 *       trafficPortSelector:
 *         ports:
 *           - '8081'
 *       endpointMatcher:
 *         metadataLabelMatcher:
 *           metadataLabelMatchCriteria: MATCH_ANY
 *           metadataLabels:
 *             - labelName: foo
 *               labelValue: bar
 * ```
 * 
 * ### Network Services Endpoint Policy Empty Match
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const _default = new gcp.networkservices.EndpointPolicy("default", {
 *     name: "my-endpoint-policy",
 *     labels: {
 *         foo: "bar",
 *     },
 *     description: "my description",
 *     type: "SIDECAR_PROXY",
 *     trafficPortSelector: {
 *         ports: ["8081"],
 *     },
 *     endpointMatcher: {
 *         metadataLabelMatcher: {
 *             metadataLabelMatchCriteria: "MATCH_ANY",
 *         },
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default = gcp.networkservices.EndpointPolicy("default",
 *     name="my-endpoint-policy",
 *     labels={
 *         "foo": "bar",
 *     },
 *     description="my description",
 *     type="SIDECAR_PROXY",
 *     traffic_port_selector={
 *         "ports": ["8081"],
 *     },
 *     endpoint_matcher={
 *         "metadata_label_matcher": {
 *             "metadata_label_match_criteria": "MATCH_ANY",
 *         },
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @default = new Gcp.NetworkServices.EndpointPolicy("default", new()
 *     {
 *         Name = "my-endpoint-policy",
 *         Labels =
 *         {
 *             { "foo", "bar" },
 *         },
 *         Description = "my description",
 *         Type = "SIDECAR_PROXY",
 *         TrafficPortSelector = new Gcp.NetworkServices.Inputs.EndpointPolicyTrafficPortSelectorArgs
 *         {
 *             Ports = new[]
 *             {
 *                 "8081",
 *             },
 *         },
 *         EndpointMatcher = new Gcp.NetworkServices.Inputs.EndpointPolicyEndpointMatcherArgs
 *         {
 *             MetadataLabelMatcher = new Gcp.NetworkServices.Inputs.EndpointPolicyEndpointMatcherMetadataLabelMatcherArgs
 *             {
 *                 MetadataLabelMatchCriteria = "MATCH_ANY",
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/networkservices"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := networkservices.NewEndpointPolicy(ctx, "default", &networkservices.EndpointPolicyArgs{
 * 			Name: pulumi.String("my-endpoint-policy"),
 * 			Labels: pulumi.StringMap{
 * 				"foo": pulumi.String("bar"),
 * 			},
 * 			Description: pulumi.String("my description"),
 * 			Type:        pulumi.String("SIDECAR_PROXY"),
 * 			TrafficPortSelector: &networkservices.EndpointPolicyTrafficPortSelectorArgs{
 * 				Ports: pulumi.StringArray{
 * 					pulumi.String("8081"),
 * 				},
 * 			},
 * 			EndpointMatcher: &networkservices.EndpointPolicyEndpointMatcherArgs{
 * 				MetadataLabelMatcher: &networkservices.EndpointPolicyEndpointMatcherMetadataLabelMatcherArgs{
 * 					MetadataLabelMatchCriteria: pulumi.String("MATCH_ANY"),
 * 				},
 * 			},
 * 		})
 * 		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.gcp.networkservices.EndpointPolicy;
 * import com.pulumi.gcp.networkservices.EndpointPolicyArgs;
 * import com.pulumi.gcp.networkservices.inputs.EndpointPolicyTrafficPortSelectorArgs;
 * import com.pulumi.gcp.networkservices.inputs.EndpointPolicyEndpointMatcherArgs;
 * import com.pulumi.gcp.networkservices.inputs.EndpointPolicyEndpointMatcherMetadataLabelMatcherArgs;
 * 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) {
 *         var default_ = new EndpointPolicy("default", EndpointPolicyArgs.builder()
 *             .name("my-endpoint-policy")
 *             .labels(Map.of("foo", "bar"))
 *             .description("my description")
 *             .type("SIDECAR_PROXY")
 *             .trafficPortSelector(EndpointPolicyTrafficPortSelectorArgs.builder()
 *                 .ports("8081")
 *                 .build())
 *             .endpointMatcher(EndpointPolicyEndpointMatcherArgs.builder()
 *                 .metadataLabelMatcher(EndpointPolicyEndpointMatcherMetadataLabelMatcherArgs.builder()
 *                     .metadataLabelMatchCriteria("MATCH_ANY")
 *                     .build())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:networkservices:EndpointPolicy
 *     properties:
 *       name: my-endpoint-policy
 *       labels:
 *         foo: bar
 *       description: my description
 *       type: SIDECAR_PROXY
 *       trafficPortSelector:
 *         ports:
 *           - '8081'
 *       endpointMatcher:
 *         metadataLabelMatcher:
 *           metadataLabelMatchCriteria: MATCH_ANY
 * ```
 * 
 * ## Import
 * EndpointPolicy can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/global/endpointPolicies/{{name}}`
 * * `{{project}}/{{name}}`
 * * `{{name}}`
 * When using the `pulumi import` command, EndpointPolicy can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:networkservices/endpointPolicy:EndpointPolicy default projects/{{project}}/locations/global/endpointPolicies/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:networkservices/endpointPolicy:EndpointPolicy default {{project}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:networkservices/endpointPolicy:EndpointPolicy default {{name}}
 * ```
 * @property authorizationPolicy This field specifies the URL of AuthorizationPolicy resource that applies authorization policies to the inbound traffic
 * at the matched endpoints.
 * @property clientTlsPolicy A URL referring to a ClientTlsPolicy resource. ClientTlsPolicy can be set to specify the authentication for traffic from
 * the proxy to the actual endpoints.
 * @property description A free-text description of the resource. Max length 1024 characters.
 * @property endpointMatcher Required. A matcher that selects endpoints to which the policies should be applied.
 * Structure is documented below.
 * @property labels Set of label tags associated with the TcpRoute resource. **Note**: This field is non-authoritative, and will only manage
 * the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on
 * the resource.
 * @property name Name of the EndpointPolicy resource.
 * @property project
 * @property serverTlsPolicy A URL referring to ServerTlsPolicy resource. ServerTlsPolicy is used to determine the authentication policy to be
 * applied to terminate the inbound traffic at the identified backends.
 * @property trafficPortSelector Port selector for the (matched) endpoints. If no port selector is provided, the matched config is applied to all ports.
 * @property type The type of endpoint policy. This is primarily used to validate the configuration.
 * Possible values are: `SIDECAR_PROXY`, `GRPC_SERVER`.
 */
public data class EndpointPolicyArgs(
    public val authorizationPolicy: Output? = null,
    public val clientTlsPolicy: Output? = null,
    public val description: Output? = null,
    public val endpointMatcher: Output? = null,
    public val labels: Output>? = null,
    public val name: Output? = null,
    public val project: Output? = null,
    public val serverTlsPolicy: Output? = null,
    public val trafficPortSelector: Output? = null,
    public val type: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.networkservices.EndpointPolicyArgs =
        com.pulumi.gcp.networkservices.EndpointPolicyArgs.builder()
            .authorizationPolicy(authorizationPolicy?.applyValue({ args0 -> args0 }))
            .clientTlsPolicy(clientTlsPolicy?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .endpointMatcher(endpointMatcher?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .name(name?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .serverTlsPolicy(serverTlsPolicy?.applyValue({ args0 -> args0 }))
            .trafficPortSelector(
                trafficPortSelector?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .type(type?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [EndpointPolicyArgs].
 */
@PulumiTagMarker
public class EndpointPolicyArgsBuilder internal constructor() {
    private var authorizationPolicy: Output? = null

    private var clientTlsPolicy: Output? = null

    private var description: Output? = null

    private var endpointMatcher: Output? = null

    private var labels: Output>? = null

    private var name: Output? = null

    private var project: Output? = null

    private var serverTlsPolicy: Output? = null

    private var trafficPortSelector: Output? = null

    private var type: Output? = null

    /**
     * @param value This field specifies the URL of AuthorizationPolicy resource that applies authorization policies to the inbound traffic
     * at the matched endpoints.
     */
    @JvmName("gdxihviyplhsoepi")
    public suspend fun authorizationPolicy(`value`: Output) {
        this.authorizationPolicy = value
    }

    /**
     * @param value A URL referring to a ClientTlsPolicy resource. ClientTlsPolicy can be set to specify the authentication for traffic from
     * the proxy to the actual endpoints.
     */
    @JvmName("oxtsgsuculnhovcf")
    public suspend fun clientTlsPolicy(`value`: Output) {
        this.clientTlsPolicy = value
    }

    /**
     * @param value A free-text description of the resource. Max length 1024 characters.
     */
    @JvmName("mgqbqjogcxvakdov")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value Required. A matcher that selects endpoints to which the policies should be applied.
     * Structure is documented below.
     */
    @JvmName("jcgndkjyvosajebu")
    public suspend fun endpointMatcher(`value`: Output) {
        this.endpointMatcher = value
    }

    /**
     * @param value Set of label tags associated with the TcpRoute resource. **Note**: This field is non-authoritative, and will only manage
     * the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on
     * the resource.
     */
    @JvmName("cqhsxodhqlxsvxxy")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

    /**
     * @param value Name of the EndpointPolicy resource.
     */
    @JvmName("bhrdqltwqrblsjtt")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value
     */
    @JvmName("pfpmcpjmfhbwmygb")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value A URL referring to ServerTlsPolicy resource. ServerTlsPolicy is used to determine the authentication policy to be
     * applied to terminate the inbound traffic at the identified backends.
     */
    @JvmName("ypsannojggiupupp")
    public suspend fun serverTlsPolicy(`value`: Output) {
        this.serverTlsPolicy = value
    }

    /**
     * @param value Port selector for the (matched) endpoints. If no port selector is provided, the matched config is applied to all ports.
     */
    @JvmName("boapqsieqkghkepo")
    public suspend fun trafficPortSelector(`value`: Output) {
        this.trafficPortSelector = value
    }

    /**
     * @param value The type of endpoint policy. This is primarily used to validate the configuration.
     * Possible values are: `SIDECAR_PROXY`, `GRPC_SERVER`.
     */
    @JvmName("oaisnhjqavytcddb")
    public suspend fun type(`value`: Output) {
        this.type = value
    }

    /**
     * @param value This field specifies the URL of AuthorizationPolicy resource that applies authorization policies to the inbound traffic
     * at the matched endpoints.
     */
    @JvmName("mnormjmtteiskgsm")
    public suspend fun authorizationPolicy(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.authorizationPolicy = mapped
    }

    /**
     * @param value A URL referring to a ClientTlsPolicy resource. ClientTlsPolicy can be set to specify the authentication for traffic from
     * the proxy to the actual endpoints.
     */
    @JvmName("sorsbfkjbgicqabm")
    public suspend fun clientTlsPolicy(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.clientTlsPolicy = mapped
    }

    /**
     * @param value A free-text description of the resource. Max length 1024 characters.
     */
    @JvmName("vqielvoddiepggdn")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value Required. A matcher that selects endpoints to which the policies should be applied.
     * Structure is documented below.
     */
    @JvmName("xidaftqvftvnjnka")
    public suspend fun endpointMatcher(`value`: EndpointPolicyEndpointMatcherArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.endpointMatcher = mapped
    }

    /**
     * @param argument Required. A matcher that selects endpoints to which the policies should be applied.
     * Structure is documented below.
     */
    @JvmName("nylvojpwgugqghje")
    public suspend fun endpointMatcher(argument: suspend EndpointPolicyEndpointMatcherArgsBuilder.() -> Unit) {
        val toBeMapped = EndpointPolicyEndpointMatcherArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.endpointMatcher = mapped
    }

    /**
     * @param value Set of label tags associated with the TcpRoute resource. **Note**: This field is non-authoritative, and will only manage
     * the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on
     * the resource.
     */
    @JvmName("xsxgofbthgryeykn")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values Set of label tags associated with the TcpRoute resource. **Note**: This field is non-authoritative, and will only manage
     * the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on
     * the resource.
     */
    @JvmName("qxwtpugxcebssium")
    public fun labels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param value Name of the EndpointPolicy resource.
     */
    @JvmName("tkmyxcwtjihydwnp")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value
     */
    @JvmName("iemwtollbeuhpswu")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value A URL referring to ServerTlsPolicy resource. ServerTlsPolicy is used to determine the authentication policy to be
     * applied to terminate the inbound traffic at the identified backends.
     */
    @JvmName("fbiyxpillutabxxs")
    public suspend fun serverTlsPolicy(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.serverTlsPolicy = mapped
    }

    /**
     * @param value Port selector for the (matched) endpoints. If no port selector is provided, the matched config is applied to all ports.
     */
    @JvmName("aqrohdhmgngausdo")
    public suspend fun trafficPortSelector(`value`: EndpointPolicyTrafficPortSelectorArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.trafficPortSelector = mapped
    }

    /**
     * @param argument Port selector for the (matched) endpoints. If no port selector is provided, the matched config is applied to all ports.
     */
    @JvmName("imjapmkyqwgcgdeq")
    public suspend fun trafficPortSelector(argument: suspend EndpointPolicyTrafficPortSelectorArgsBuilder.() -> Unit) {
        val toBeMapped = EndpointPolicyTrafficPortSelectorArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.trafficPortSelector = mapped
    }

    /**
     * @param value The type of endpoint policy. This is primarily used to validate the configuration.
     * Possible values are: `SIDECAR_PROXY`, `GRPC_SERVER`.
     */
    @JvmName("jyyjmurjmmliqayo")
    public suspend fun type(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.type = mapped
    }

    internal fun build(): EndpointPolicyArgs = EndpointPolicyArgs(
        authorizationPolicy = authorizationPolicy,
        clientTlsPolicy = clientTlsPolicy,
        description = description,
        endpointMatcher = endpointMatcher,
        labels = labels,
        name = name,
        project = project,
        serverTlsPolicy = serverTlsPolicy,
        trafficPortSelector = trafficPortSelector,
        type = type,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy