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

com.pulumi.gcp.folder.kotlin.OrganizationPolicyArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 8.12.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.folder.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.folder.OrganizationPolicyArgs.builder
import com.pulumi.gcp.folder.kotlin.inputs.OrganizationPolicyBooleanPolicyArgs
import com.pulumi.gcp.folder.kotlin.inputs.OrganizationPolicyBooleanPolicyArgsBuilder
import com.pulumi.gcp.folder.kotlin.inputs.OrganizationPolicyListPolicyArgs
import com.pulumi.gcp.folder.kotlin.inputs.OrganizationPolicyListPolicyArgsBuilder
import com.pulumi.gcp.folder.kotlin.inputs.OrganizationPolicyRestorePolicyArgs
import com.pulumi.gcp.folder.kotlin.inputs.OrganizationPolicyRestorePolicyArgsBuilder
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

/**
 * Allows management of Organization Policies for a Google Cloud Folder.
 * > **Warning:** This resource has been superseded by `gcp.orgpolicy.Policy`. `gcp.orgpolicy.Policy` uses Organization Policy API V2 instead of Cloud Resource Manager API V1 and it supports additional features such as tags and conditions.
 * To get more information about Organization Policies, see:
 * * [API documentation](https://cloud.google.com/resource-manager/reference/rest/v1/folders/setOrgPolicy)
 * * How-to Guides
 *     * [Introduction to the Organization Policy Service](https://cloud.google.com/resource-manager/docs/organization-policy/overview)
 * ## Example Usage
 * To set policy with a [boolean constraint](https://cloud.google.com/resource-manager/docs/organization-policy/quickstart-boolean-constraints):
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const serialPortPolicy = new gcp.folder.OrganizationPolicy("serial_port_policy", {
 *     folder: "folders/123456789",
 *     constraint: "compute.disableSerialPortAccess",
 *     booleanPolicy: {
 *         enforced: true,
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * serial_port_policy = gcp.folder.OrganizationPolicy("serial_port_policy",
 *     folder="folders/123456789",
 *     constraint="compute.disableSerialPortAccess",
 *     boolean_policy=gcp.folder.OrganizationPolicyBooleanPolicyArgs(
 *         enforced=True,
 *     ))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var serialPortPolicy = new Gcp.Folder.OrganizationPolicy("serial_port_policy", new()
 *     {
 *         Folder = "folders/123456789",
 *         Constraint = "compute.disableSerialPortAccess",
 *         BooleanPolicy = new Gcp.Folder.Inputs.OrganizationPolicyBooleanPolicyArgs
 *         {
 *             Enforced = true,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/folder"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := folder.NewOrganizationPolicy(ctx, "serial_port_policy", &folder.OrganizationPolicyArgs{
 * 			Folder:     pulumi.String("folders/123456789"),
 * 			Constraint: pulumi.String("compute.disableSerialPortAccess"),
 * 			BooleanPolicy: &folder.OrganizationPolicyBooleanPolicyArgs{
 * 				Enforced: pulumi.Bool(true),
 * 			},
 * 		})
 * 		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.folder.OrganizationPolicy;
 * import com.pulumi.gcp.folder.OrganizationPolicyArgs;
 * import com.pulumi.gcp.folder.inputs.OrganizationPolicyBooleanPolicyArgs;
 * 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 serialPortPolicy = new OrganizationPolicy("serialPortPolicy", OrganizationPolicyArgs.builder()
 *             .folder("folders/123456789")
 *             .constraint("compute.disableSerialPortAccess")
 *             .booleanPolicy(OrganizationPolicyBooleanPolicyArgs.builder()
 *                 .enforced(true)
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   serialPortPolicy:
 *     type: gcp:folder:OrganizationPolicy
 *     name: serial_port_policy
 *     properties:
 *       folder: folders/123456789
 *       constraint: compute.disableSerialPortAccess
 *       booleanPolicy:
 *         enforced: true
 * ```
 * 
 * To set a policy with a [list constraint](https://cloud.google.com/resource-manager/docs/organization-policy/quickstart-list-constraints):
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const servicesPolicy = new gcp.folder.OrganizationPolicy("services_policy", {
 *     folder: "folders/123456789",
 *     constraint: "serviceuser.services",
 *     listPolicy: {
 *         allow: {
 *             all: true,
 *         },
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * services_policy = gcp.folder.OrganizationPolicy("services_policy",
 *     folder="folders/123456789",
 *     constraint="serviceuser.services",
 *     list_policy=gcp.folder.OrganizationPolicyListPolicyArgs(
 *         allow=gcp.folder.OrganizationPolicyListPolicyAllowArgs(
 *             all=True,
 *         ),
 *     ))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var servicesPolicy = new Gcp.Folder.OrganizationPolicy("services_policy", new()
 *     {
 *         Folder = "folders/123456789",
 *         Constraint = "serviceuser.services",
 *         ListPolicy = new Gcp.Folder.Inputs.OrganizationPolicyListPolicyArgs
 *         {
 *             Allow = new Gcp.Folder.Inputs.OrganizationPolicyListPolicyAllowArgs
 *             {
 *                 All = true,
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/folder"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := folder.NewOrganizationPolicy(ctx, "services_policy", &folder.OrganizationPolicyArgs{
 * 			Folder:     pulumi.String("folders/123456789"),
 * 			Constraint: pulumi.String("serviceuser.services"),
 * 			ListPolicy: &folder.OrganizationPolicyListPolicyArgs{
 * 				Allow: &folder.OrganizationPolicyListPolicyAllowArgs{
 * 					All: pulumi.Bool(true),
 * 				},
 * 			},
 * 		})
 * 		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.folder.OrganizationPolicy;
 * import com.pulumi.gcp.folder.OrganizationPolicyArgs;
 * import com.pulumi.gcp.folder.inputs.OrganizationPolicyListPolicyArgs;
 * import com.pulumi.gcp.folder.inputs.OrganizationPolicyListPolicyAllowArgs;
 * 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 servicesPolicy = new OrganizationPolicy("servicesPolicy", OrganizationPolicyArgs.builder()
 *             .folder("folders/123456789")
 *             .constraint("serviceuser.services")
 *             .listPolicy(OrganizationPolicyListPolicyArgs.builder()
 *                 .allow(OrganizationPolicyListPolicyAllowArgs.builder()
 *                     .all(true)
 *                     .build())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   servicesPolicy:
 *     type: gcp:folder:OrganizationPolicy
 *     name: services_policy
 *     properties:
 *       folder: folders/123456789
 *       constraint: serviceuser.services
 *       listPolicy:
 *         allow:
 *           all: true
 * ```
 * 
 * Or to deny some services, use the following instead:
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const servicesPolicy = new gcp.folder.OrganizationPolicy("services_policy", {
 *     folder: "folders/123456789",
 *     constraint: "serviceuser.services",
 *     listPolicy: {
 *         suggestedValue: "compute.googleapis.com",
 *         deny: {
 *             values: ["cloudresourcemanager.googleapis.com"],
 *         },
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * services_policy = gcp.folder.OrganizationPolicy("services_policy",
 *     folder="folders/123456789",
 *     constraint="serviceuser.services",
 *     list_policy=gcp.folder.OrganizationPolicyListPolicyArgs(
 *         suggested_value="compute.googleapis.com",
 *         deny=gcp.folder.OrganizationPolicyListPolicyDenyArgs(
 *             values=["cloudresourcemanager.googleapis.com"],
 *         ),
 *     ))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var servicesPolicy = new Gcp.Folder.OrganizationPolicy("services_policy", new()
 *     {
 *         Folder = "folders/123456789",
 *         Constraint = "serviceuser.services",
 *         ListPolicy = new Gcp.Folder.Inputs.OrganizationPolicyListPolicyArgs
 *         {
 *             SuggestedValue = "compute.googleapis.com",
 *             Deny = new Gcp.Folder.Inputs.OrganizationPolicyListPolicyDenyArgs
 *             {
 *                 Values = new[]
 *                 {
 *                     "cloudresourcemanager.googleapis.com",
 *                 },
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/folder"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := folder.NewOrganizationPolicy(ctx, "services_policy", &folder.OrganizationPolicyArgs{
 * 			Folder:     pulumi.String("folders/123456789"),
 * 			Constraint: pulumi.String("serviceuser.services"),
 * 			ListPolicy: &folder.OrganizationPolicyListPolicyArgs{
 * 				SuggestedValue: pulumi.String("compute.googleapis.com"),
 * 				Deny: &folder.OrganizationPolicyListPolicyDenyArgs{
 * 					Values: pulumi.StringArray{
 * 						pulumi.String("cloudresourcemanager.googleapis.com"),
 * 					},
 * 				},
 * 			},
 * 		})
 * 		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.folder.OrganizationPolicy;
 * import com.pulumi.gcp.folder.OrganizationPolicyArgs;
 * import com.pulumi.gcp.folder.inputs.OrganizationPolicyListPolicyArgs;
 * import com.pulumi.gcp.folder.inputs.OrganizationPolicyListPolicyDenyArgs;
 * 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 servicesPolicy = new OrganizationPolicy("servicesPolicy", OrganizationPolicyArgs.builder()
 *             .folder("folders/123456789")
 *             .constraint("serviceuser.services")
 *             .listPolicy(OrganizationPolicyListPolicyArgs.builder()
 *                 .suggestedValue("compute.googleapis.com")
 *                 .deny(OrganizationPolicyListPolicyDenyArgs.builder()
 *                     .values("cloudresourcemanager.googleapis.com")
 *                     .build())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   servicesPolicy:
 *     type: gcp:folder:OrganizationPolicy
 *     name: services_policy
 *     properties:
 *       folder: folders/123456789
 *       constraint: serviceuser.services
 *       listPolicy:
 *         suggestedValue: compute.googleapis.com
 *         deny:
 *           values:
 *             - cloudresourcemanager.googleapis.com
 * ```
 * 
 * To restore the default folder organization policy, use the following instead:
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const servicesPolicy = new gcp.folder.OrganizationPolicy("services_policy", {
 *     folder: "folders/123456789",
 *     constraint: "serviceuser.services",
 *     restorePolicy: {
 *         "default": true,
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * services_policy = gcp.folder.OrganizationPolicy("services_policy",
 *     folder="folders/123456789",
 *     constraint="serviceuser.services",
 *     restore_policy=gcp.folder.OrganizationPolicyRestorePolicyArgs(
 *         default=True,
 *     ))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var servicesPolicy = new Gcp.Folder.OrganizationPolicy("services_policy", new()
 *     {
 *         Folder = "folders/123456789",
 *         Constraint = "serviceuser.services",
 *         RestorePolicy = new Gcp.Folder.Inputs.OrganizationPolicyRestorePolicyArgs
 *         {
 *             Default = true,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/folder"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := folder.NewOrganizationPolicy(ctx, "services_policy", &folder.OrganizationPolicyArgs{
 * 			Folder:     pulumi.String("folders/123456789"),
 * 			Constraint: pulumi.String("serviceuser.services"),
 * 			RestorePolicy: &folder.OrganizationPolicyRestorePolicyArgs{
 * 				Default: pulumi.Bool(true),
 * 			},
 * 		})
 * 		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.folder.OrganizationPolicy;
 * import com.pulumi.gcp.folder.OrganizationPolicyArgs;
 * import com.pulumi.gcp.folder.inputs.OrganizationPolicyRestorePolicyArgs;
 * 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 servicesPolicy = new OrganizationPolicy("servicesPolicy", OrganizationPolicyArgs.builder()
 *             .folder("folders/123456789")
 *             .constraint("serviceuser.services")
 *             .restorePolicy(OrganizationPolicyRestorePolicyArgs.builder()
 *                 .default_(true)
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   servicesPolicy:
 *     type: gcp:folder:OrganizationPolicy
 *     name: services_policy
 *     properties:
 *       folder: folders/123456789
 *       constraint: serviceuser.services
 *       restorePolicy:
 *         default: true
 * ```
 * 
 * ## Import
 * Folder organization policies can be imported using any of the follow formats:
 * * `folders/{{folder_id}}/constraints/serviceuser.services`
 * * `{{folder_id}}/serviceuser.services`
 * When using the `pulumi import` command, folder organization policies can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:folder/organizationPolicy:OrganizationPolicy * `google_folder_organization_policy.default folders/* ``{{folder_id}}/constraints/serviceuser.services`
 * ```
 * ```sh
 * $ pulumi import gcp:folder/organizationPolicy:OrganizationPolicy * `* `google_folder_organization_policy.default {{folder_id}}/``serviceuser.services
 * ```
 * @property booleanPolicy A boolean policy is a constraint that is either enforced or not. Structure is documented below.
 * @property constraint The name of the Constraint the Policy is configuring, for example, `serviceuser.services`. Check out the [complete list of available constraints](https://cloud.google.com/resource-manager/docs/organization-policy/understanding-constraints#available_constraints).
 * - - -
 * @property folder The resource name of the folder to set the policy for. Its format is folders/{folder_id}.
 * @property listPolicy A policy that can define specific values that are allowed or denied for the given constraint. It
 * can also be used to allow or deny all values. Structure is documented below.
 * @property restorePolicy A restore policy is a constraint to restore the default policy. Structure is documented below.
 * > **Note:** If none of [`boolean_policy`, `list_policy`, `restore_policy`] are defined the policy for a given constraint will
 * effectively be unset. This is represented in the UI as the constraint being 'Inherited'.
 * - - -
 * @property version Version of the Policy. Default version is 0.
 * */
 */
public data class OrganizationPolicyArgs(
    public val booleanPolicy: Output? = null,
    public val constraint: Output? = null,
    public val folder: Output? = null,
    public val listPolicy: Output? = null,
    public val restorePolicy: Output? = null,
    public val version: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.folder.OrganizationPolicyArgs =
        com.pulumi.gcp.folder.OrganizationPolicyArgs.builder()
            .booleanPolicy(booleanPolicy?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .constraint(constraint?.applyValue({ args0 -> args0 }))
            .folder(folder?.applyValue({ args0 -> args0 }))
            .listPolicy(listPolicy?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .restorePolicy(restorePolicy?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .version(version?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [OrganizationPolicyArgs].
 */
@PulumiTagMarker
public class OrganizationPolicyArgsBuilder internal constructor() {
    private var booleanPolicy: Output? = null

    private var constraint: Output? = null

    private var folder: Output? = null

    private var listPolicy: Output? = null

    private var restorePolicy: Output? = null

    private var version: Output? = null

    /**
     * @param value A boolean policy is a constraint that is either enforced or not. Structure is documented below.
     */
    @JvmName("oevctsvmrfpfwtfb")
    public suspend fun booleanPolicy(`value`: Output) {
        this.booleanPolicy = value
    }

    /**
     * @param value The name of the Constraint the Policy is configuring, for example, `serviceuser.services`. Check out the [complete list of available constraints](https://cloud.google.com/resource-manager/docs/organization-policy/understanding-constraints#available_constraints).
     * - - -
     */
    @JvmName("hgrugsstbsnfjkvn")
    public suspend fun constraint(`value`: Output) {
        this.constraint = value
    }

    /**
     * @param value The resource name of the folder to set the policy for. Its format is folders/{folder_id}.
     */
    @JvmName("wpneiqobwgsdwbyl")
    public suspend fun folder(`value`: Output) {
        this.folder = value
    }

    /**
     * @param value A policy that can define specific values that are allowed or denied for the given constraint. It
     * can also be used to allow or deny all values. Structure is documented below.
     */
    @JvmName("rbjbwochwkybuiuk")
    public suspend fun listPolicy(`value`: Output) {
        this.listPolicy = value
    }

    /**
     * @param value A restore policy is a constraint to restore the default policy. Structure is documented below.
     * > **Note:** If none of [`boolean_policy`, `list_policy`, `restore_policy`] are defined the policy for a given constraint will
     * effectively be unset. This is represented in the UI as the constraint being 'Inherited'.
     * - - -
     */
    @JvmName("jwqeaanpkuksprcr")
    public suspend fun restorePolicy(`value`: Output) {
        this.restorePolicy = value
    }

    /**
     * @param value Version of the Policy. Default version is 0.
     */
    @JvmName("ukpwklblyinerspd")
    public suspend fun version(`value`: Output) {
        this.version = value
    }

    /**
     * @param value A boolean policy is a constraint that is either enforced or not. Structure is documented below.
     */
    @JvmName("fljyiefwkkuqlaql")
    public suspend fun booleanPolicy(`value`: OrganizationPolicyBooleanPolicyArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.booleanPolicy = mapped
    }

    /**
     * @param argument A boolean policy is a constraint that is either enforced or not. Structure is documented below.
     */
    @JvmName("ymgjadiuxhfnegqg")
    public suspend fun booleanPolicy(argument: suspend OrganizationPolicyBooleanPolicyArgsBuilder.() -> Unit) {
        val toBeMapped = OrganizationPolicyBooleanPolicyArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.booleanPolicy = mapped
    }

    /**
     * @param value The name of the Constraint the Policy is configuring, for example, `serviceuser.services`. Check out the [complete list of available constraints](https://cloud.google.com/resource-manager/docs/organization-policy/understanding-constraints#available_constraints).
     * - - -
     */
    @JvmName("whdenafsnuakwaly")
    public suspend fun constraint(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.constraint = mapped
    }

    /**
     * @param value The resource name of the folder to set the policy for. Its format is folders/{folder_id}.
     */
    @JvmName("dushtlakgplpykex")
    public suspend fun folder(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.folder = mapped
    }

    /**
     * @param value A policy that can define specific values that are allowed or denied for the given constraint. It
     * can also be used to allow or deny all values. Structure is documented below.
     */
    @JvmName("ihodeyegjoaactks")
    public suspend fun listPolicy(`value`: OrganizationPolicyListPolicyArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.listPolicy = mapped
    }

    /**
     * @param argument A policy that can define specific values that are allowed or denied for the given constraint. It
     * can also be used to allow or deny all values. Structure is documented below.
     */
    @JvmName("cknngpxdqcaosjab")
    public suspend fun listPolicy(argument: suspend OrganizationPolicyListPolicyArgsBuilder.() -> Unit) {
        val toBeMapped = OrganizationPolicyListPolicyArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.listPolicy = mapped
    }

    /**
     * @param value A restore policy is a constraint to restore the default policy. Structure is documented below.
     * > **Note:** If none of [`boolean_policy`, `list_policy`, `restore_policy`] are defined the policy for a given constraint will
     * effectively be unset. This is represented in the UI as the constraint being 'Inherited'.
     * - - -
     */
    @JvmName("mtfdkmaotkmjxvej")
    public suspend fun restorePolicy(`value`: OrganizationPolicyRestorePolicyArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.restorePolicy = mapped
    }

    /**
     * @param argument A restore policy is a constraint to restore the default policy. Structure is documented below.
     * > **Note:** If none of [`boolean_policy`, `list_policy`, `restore_policy`] are defined the policy for a given constraint will
     * effectively be unset. This is represented in the UI as the constraint being 'Inherited'.
     * - - -
     */
    @JvmName("fjsnhgerrtautixo")
    public suspend fun restorePolicy(argument: suspend OrganizationPolicyRestorePolicyArgsBuilder.() -> Unit) {
        val toBeMapped = OrganizationPolicyRestorePolicyArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.restorePolicy = mapped
    }

    /**
     * @param value Version of the Policy. Default version is 0.
     */
    @JvmName("gmwglitpnjbgryve")
    public suspend fun version(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.version = mapped
    }

    internal fun build(): OrganizationPolicyArgs = OrganizationPolicyArgs(
        booleanPolicy = booleanPolicy,
        constraint = constraint,
        folder = folder,
        listPolicy = listPolicy,
        restorePolicy = restorePolicy,
        version = version,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy