// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;

namespace Pulumi.GoogleNative.AccessContextManager.V1
{
    /// <summary>
    /// Creates a GcpUserAccessBinding. If the client specifies a name, the server ignores it. Fails if a resource already exists with the same group_key. Completion of this long-running operation does not necessarily signify that the new binding is deployed onto all affected users, which may take more time.
    /// </summary>
    [GoogleNativeResourceType("google-native:accesscontextmanager/v1:GcpUserAccessBinding")]
    public partial class GcpUserAccessBinding : Pulumi.CustomResource
    {
        /// <summary>
        /// Access level that a user must have to be granted access. Only one access level is supported, not multiple. This repeated field must have exactly one element. Example: "accessPolicies/9522/accessLevels/device_trusted"
        /// </summary>
        [Output("accessLevels")]
        public Output<ImmutableArray<string>> AccessLevels { get; private set; } = null!;

        /// <summary>
        /// Immutable. Google Group id whose members are subject to this binding's restrictions. See "id" in the [G Suite Directory API's Groups resource] (https://developers.google.com/admin-sdk/directory/v1/reference/groups#resource). If a group's email address/alias is changed, this resource will continue to point at the changed group. This field does not accept group email addresses or aliases. Example: "01d520gv4vjcrht"
        /// </summary>
        [Output("groupKey")]
        public Output<string> GroupKey { get; private set; } = null!;

        /// <summary>
        /// Immutable. Assigned by the server during creation. The last segment has an arbitrary length and has only URI unreserved characters (as defined by [RFC 3986 Section 2.3](https://tools.ietf.org/html/rfc3986#section-2.3)). Should not be specified by the client during creation. Example: "organizations/256/gcpUserAccessBindings/b3-BhcX_Ud5N"
        /// </summary>
        [Output("name")]
        public Output<string> Name { get; private set; } = null!;


        /// <summary>
        /// Create a GcpUserAccessBinding resource with the given unique name, arguments, and options.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resource</param>
        /// <param name="args">The arguments used to populate this resource's properties</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public GcpUserAccessBinding(string name, GcpUserAccessBindingArgs args, CustomResourceOptions? options = null)
            : base("google-native:accesscontextmanager/v1:GcpUserAccessBinding", name, args ?? new GcpUserAccessBindingArgs(), MakeResourceOptions(options, ""))
        {
        }

        private GcpUserAccessBinding(string name, Input<string> id, CustomResourceOptions? options = null)
            : base("google-native:accesscontextmanager/v1:GcpUserAccessBinding", name, null, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
            };
            var merged = CustomResourceOptions.Merge(defaultOptions, options);
            // Override the ID if one was specified for consistency with other language SDKs.
            merged.Id = id ?? merged.Id;
            return merged;
        }
        /// <summary>
        /// Get an existing GcpUserAccessBinding resource's state with the given name, ID, and optional extra
        /// properties used to qualify the lookup.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resulting resource.</param>
        /// <param name="id">The unique provider ID of the resource to lookup.</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public static GcpUserAccessBinding Get(string name, Input<string> id, CustomResourceOptions? options = null)
        {
            return new GcpUserAccessBinding(name, id, options);
        }
    }

    public sealed class GcpUserAccessBindingArgs : Pulumi.ResourceArgs
    {
        [Input("accessLevels", required: true)]
        private InputList<string>? _accessLevels;

        /// <summary>
        /// Access level that a user must have to be granted access. Only one access level is supported, not multiple. This repeated field must have exactly one element. Example: "accessPolicies/9522/accessLevels/device_trusted"
        /// </summary>
        public InputList<string> AccessLevels
        {
            get => _accessLevels ?? (_accessLevels = new InputList<string>());
            set => _accessLevels = value;
        }

        /// <summary>
        /// Immutable. Google Group id whose members are subject to this binding's restrictions. See "id" in the [G Suite Directory API's Groups resource] (https://developers.google.com/admin-sdk/directory/v1/reference/groups#resource). If a group's email address/alias is changed, this resource will continue to point at the changed group. This field does not accept group email addresses or aliases. Example: "01d520gv4vjcrht"
        /// </summary>
        [Input("groupKey", required: true)]
        public Input<string> GroupKey { get; set; } = null!;

        /// <summary>
        /// Immutable. Assigned by the server during creation. The last segment has an arbitrary length and has only URI unreserved characters (as defined by [RFC 3986 Section 2.3](https://tools.ietf.org/html/rfc3986#section-2.3)). Should not be specified by the client during creation. Example: "organizations/256/gcpUserAccessBindings/b3-BhcX_Ud5N"
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        [Input("organizationId", required: true)]
        public Input<string> OrganizationId { get; set; } = null!;

        public GcpUserAccessBindingArgs()
        {
        }
    }
}
