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

com.pulumi.gcp.cloudidentity.kotlin.GroupArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.gcp.cloudidentity.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.cloudidentity.GroupArgs.builder
import com.pulumi.gcp.cloudidentity.kotlin.inputs.GroupGroupKeyArgs
import com.pulumi.gcp.cloudidentity.kotlin.inputs.GroupGroupKeyArgsBuilder
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

/**
 * A Cloud Identity resource representing a Group.
 * To get more information about Group, see:
 * * [API documentation](https://cloud.google.com/identity/docs/reference/rest/v1beta1/groups)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/identity/docs/how-to/setup)
 * > **Warning:** If you are using User ADCs (Application Default Credentials) with this resource,
 * you must specify a `billing_project` and set `user_project_override` to true
 * in the provider configuration. Otherwise the Cloud Identity API will return a 403 error.
 * Your account must have the `serviceusage.services.use` permission on the
 * `billing_project` you defined.
 * ## Example Usage
 * ### Cloud Identity Groups Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const cloudIdentityGroupBasic = new gcp.cloudidentity.Group("cloud_identity_group_basic", {
 *     displayName: "my-identity-group",
 *     initialGroupConfig: "WITH_INITIAL_OWNER",
 *     parent: "customers/A01b123xz",
 *     groupKey: {
 *         id: "[email protected]",
 *     },
 *     labels: {
 *         "cloudidentity.googleapis.com/groups.discussion_forum": "",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * cloud_identity_group_basic = gcp.cloudidentity.Group("cloud_identity_group_basic",
 *     display_name="my-identity-group",
 *     initial_group_config="WITH_INITIAL_OWNER",
 *     parent="customers/A01b123xz",
 *     group_key={
 *         "id": "[email protected]",
 *     },
 *     labels={
 *         "cloudidentity.googleapis.com/groups.discussion_forum": "",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var cloudIdentityGroupBasic = new Gcp.CloudIdentity.Group("cloud_identity_group_basic", new()
 *     {
 *         DisplayName = "my-identity-group",
 *         InitialGroupConfig = "WITH_INITIAL_OWNER",
 *         Parent = "customers/A01b123xz",
 *         GroupKey = new Gcp.CloudIdentity.Inputs.GroupGroupKeyArgs
 *         {
 *             Id = "[email protected]",
 *         },
 *         Labels =
 *         {
 *             { "cloudidentity.googleapis.com/groups.discussion_forum", "" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/cloudidentity"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := cloudidentity.NewGroup(ctx, "cloud_identity_group_basic", &cloudidentity.GroupArgs{
 * 			DisplayName:        pulumi.String("my-identity-group"),
 * 			InitialGroupConfig: pulumi.String("WITH_INITIAL_OWNER"),
 * 			Parent:             pulumi.String("customers/A01b123xz"),
 * 			GroupKey: &cloudidentity.GroupGroupKeyArgs{
 * 				Id: pulumi.String("[email protected]"),
 * 			},
 * 			Labels: pulumi.StringMap{
 * 				"cloudidentity.googleapis.com/groups.discussion_forum": pulumi.String(""),
 * 			},
 * 		})
 * 		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.cloudidentity.Group;
 * import com.pulumi.gcp.cloudidentity.GroupArgs;
 * import com.pulumi.gcp.cloudidentity.inputs.GroupGroupKeyArgs;
 * 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 cloudIdentityGroupBasic = new Group("cloudIdentityGroupBasic", GroupArgs.builder()
 *             .displayName("my-identity-group")
 *             .initialGroupConfig("WITH_INITIAL_OWNER")
 *             .parent("customers/A01b123xz")
 *             .groupKey(GroupGroupKeyArgs.builder()
 *                 .id("[email protected]")
 *                 .build())
 *             .labels(Map.of("cloudidentity.googleapis.com/groups.discussion_forum", ""))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   cloudIdentityGroupBasic:
 *     type: gcp:cloudidentity:Group
 *     name: cloud_identity_group_basic
 *     properties:
 *       displayName: my-identity-group
 *       initialGroupConfig: WITH_INITIAL_OWNER
 *       parent: customers/A01b123xz
 *       groupKey:
 *         id: [email protected]
 *       labels:
 *         cloudidentity.googleapis.com/groups.discussion_forum:
 * ```
 * 
 * ## Import
 * Group can be imported using any of these accepted formats:
 * * `{{name}}`
 * When using the `pulumi import` command, Group can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:cloudidentity/group:Group default {{name}}
 * ```
 * @property description An extended description to help users determine the purpose of a Group. Must not be longer than 4,096 characters.
 * @property displayName The display name of the Group.
 * @property groupKey EntityKey of the Group.
 * Structure is documented below.
 * @property initialGroupConfig The initial configuration options for creating a Group. See the [API
 * reference](https://cloud.google.com/identity/docs/reference/rest/v1beta1/groups/create#initialgroupconfig) for possible
 * values. Default value: "EMPTY" Possible values: ["INITIAL_GROUP_CONFIG_UNSPECIFIED", "WITH_INITIAL_OWNER", "EMPTY"]
 * @property labels One or more label entries that apply to the Group. Currently supported labels contain a key with an empty value.
 * Google Groups are the default type of group and have a label with a key of cloudidentity.googleapis.com/groups.discussion_forum and an empty value.
 * Existing Google Groups can have an additional label with a key of cloudidentity.googleapis.com/groups.security and an empty value added to them. This is an immutable change and the security label cannot be removed once added.
 * Dynamic groups have a label with a key of cloudidentity.googleapis.com/groups.dynamic.
 * Identity-mapped groups for Cloud Search have a label with a key of system/groups/external and an empty value.
 * @property parent The resource name of the entity under which this Group resides in the
 * Cloud Identity resource hierarchy.
 * Must be of the form identitysources/{identity_source_id} for external-identity-mapped
 * groups or customers/{customer_id} for Google Groups.
 */
public data class GroupArgs(
    public val description: Output? = null,
    public val displayName: Output? = null,
    public val groupKey: Output? = null,
    public val initialGroupConfig: Output? = null,
    public val labels: Output>? = null,
    public val parent: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.cloudidentity.GroupArgs =
        com.pulumi.gcp.cloudidentity.GroupArgs.builder()
            .description(description?.applyValue({ args0 -> args0 }))
            .displayName(displayName?.applyValue({ args0 -> args0 }))
            .groupKey(groupKey?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .initialGroupConfig(initialGroupConfig?.applyValue({ args0 -> args0 }))
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .parent(parent?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [GroupArgs].
 */
@PulumiTagMarker
public class GroupArgsBuilder internal constructor() {
    private var description: Output? = null

    private var displayName: Output? = null

    private var groupKey: Output? = null

    private var initialGroupConfig: Output? = null

    private var labels: Output>? = null

    private var parent: Output? = null

    /**
     * @param value An extended description to help users determine the purpose of a Group. Must not be longer than 4,096 characters.
     */
    @JvmName("ymfvwhyvxknhaqhd")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value The display name of the Group.
     */
    @JvmName("wdlquojdivpliqop")
    public suspend fun displayName(`value`: Output) {
        this.displayName = value
    }

    /**
     * @param value EntityKey of the Group.
     * Structure is documented below.
     */
    @JvmName("lceheagmxqrcuuqe")
    public suspend fun groupKey(`value`: Output) {
        this.groupKey = value
    }

    /**
     * @param value The initial configuration options for creating a Group. See the [API
   * reference](https://cloud.google.com/identity/docs/reference/rest/v1beta1/groups/create#initialgroupconfig) for possible
     * values. Default value: "EMPTY" Possible values: ["INITIAL_GROUP_CONFIG_UNSPECIFIED", "WITH_INITIAL_OWNER", "EMPTY"]
     */
    @JvmName("hmpogxefbdygiksb")
    public suspend fun initialGroupConfig(`value`: Output) {
        this.initialGroupConfig = value
    }

    /**
     * @param value One or more label entries that apply to the Group. Currently supported labels contain a key with an empty value.
     * Google Groups are the default type of group and have a label with a key of cloudidentity.googleapis.com/groups.discussion_forum and an empty value.
     * Existing Google Groups can have an additional label with a key of cloudidentity.googleapis.com/groups.security and an empty value added to them. This is an immutable change and the security label cannot be removed once added.
     * Dynamic groups have a label with a key of cloudidentity.googleapis.com/groups.dynamic.
     * Identity-mapped groups for Cloud Search have a label with a key of system/groups/external and an empty value.
     */
    @JvmName("tumngemogpqgehrc")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

    /**
     * @param value The resource name of the entity under which this Group resides in the
     * Cloud Identity resource hierarchy.
     * Must be of the form identitysources/{identity_source_id} for external-identity-mapped
     * groups or customers/{customer_id} for Google Groups.
     */
    @JvmName("ooeoognixlgtnvvi")
    public suspend fun parent(`value`: Output) {
        this.parent = value
    }

    /**
     * @param value An extended description to help users determine the purpose of a Group. Must not be longer than 4,096 characters.
     */
    @JvmName("mfgwdrbbqdlejvaq")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value The display name of the Group.
     */
    @JvmName("gvkokwebobtkmqhw")
    public suspend fun displayName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.displayName = mapped
    }

    /**
     * @param value EntityKey of the Group.
     * Structure is documented below.
     */
    @JvmName("tikdglsvoiuuquea")
    public suspend fun groupKey(`value`: GroupGroupKeyArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.groupKey = mapped
    }

    /**
     * @param argument EntityKey of the Group.
     * Structure is documented below.
     */
    @JvmName("quywvokeqillhbpc")
    public suspend fun groupKey(argument: suspend GroupGroupKeyArgsBuilder.() -> Unit) {
        val toBeMapped = GroupGroupKeyArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.groupKey = mapped
    }

    /**
     * @param value The initial configuration options for creating a Group. See the [API
   * reference](https://cloud.google.com/identity/docs/reference/rest/v1beta1/groups/create#initialgroupconfig) for possible
     * values. Default value: "EMPTY" Possible values: ["INITIAL_GROUP_CONFIG_UNSPECIFIED", "WITH_INITIAL_OWNER", "EMPTY"]
     */
    @JvmName("tahgdjsqgycfqnwh")
    public suspend fun initialGroupConfig(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.initialGroupConfig = mapped
    }

    /**
     * @param value One or more label entries that apply to the Group. Currently supported labels contain a key with an empty value.
     * Google Groups are the default type of group and have a label with a key of cloudidentity.googleapis.com/groups.discussion_forum and an empty value.
     * Existing Google Groups can have an additional label with a key of cloudidentity.googleapis.com/groups.security and an empty value added to them. This is an immutable change and the security label cannot be removed once added.
     * Dynamic groups have a label with a key of cloudidentity.googleapis.com/groups.dynamic.
     * Identity-mapped groups for Cloud Search have a label with a key of system/groups/external and an empty value.
     */
    @JvmName("gyjihqqjbyhvscxf")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values One or more label entries that apply to the Group. Currently supported labels contain a key with an empty value.
     * Google Groups are the default type of group and have a label with a key of cloudidentity.googleapis.com/groups.discussion_forum and an empty value.
     * Existing Google Groups can have an additional label with a key of cloudidentity.googleapis.com/groups.security and an empty value added to them. This is an immutable change and the security label cannot be removed once added.
     * Dynamic groups have a label with a key of cloudidentity.googleapis.com/groups.dynamic.
     * Identity-mapped groups for Cloud Search have a label with a key of system/groups/external and an empty value.
     */
    @JvmName("lbgvgcejunuokyon")
    public fun labels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param value The resource name of the entity under which this Group resides in the
     * Cloud Identity resource hierarchy.
     * Must be of the form identitysources/{identity_source_id} for external-identity-mapped
     * groups or customers/{customer_id} for Google Groups.
     */
    @JvmName("fbwrvmyltssguanm")
    public suspend fun parent(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.parent = mapped
    }

    internal fun build(): GroupArgs = GroupArgs(
        description = description,
        displayName = displayName,
        groupKey = groupKey,
        initialGroupConfig = initialGroupConfig,
        labels = labels,
        parent = parent,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy