<filename>sdk/dotnet/OrganizationManagerOrganizationIamMember.cs// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** 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.Yandex
{
    /// <summary>
    /// Allows creation and management of a single member for a single binding within
    /// the IAM policy for an existing Yandex Organization Manager organization.
    /// 
    /// &gt; **Note:** Roles controlled by `yandex.OrganizationManagerOrganizationIamBinding`
    ///    should not be assigned using `yandex.OrganizationManagerOrganizationIamMember`.
    /// 
    /// &gt; **Note:** When you delete `yandex.OrganizationManagerOrganizationIamBinding` resource,
    ///    the roles can be deleted from other users within the organization as well. Be careful!
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using Yandex = Pulumi.Yandex;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var editor = new Yandex.OrganizationManagerOrganizationIamMember("editor", new()
    ///     {
    ///         Member = "userAccount:user_id",
    ///         OrganizationId = "some_organization_id",
    ///         Role = "editor",
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// IAM member imports use space-delimited identifiers; the resource in question, the role, and the account. This member resource can be imported using the `organization id`, role, and account, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import yandex:index/organizationManagerOrganizationIamMember:OrganizationManagerOrganizationIamMember my_project "organization_id viewer dycjh@example.com"
    /// ```
    /// </summary>
    [YandexResourceType("yandex:index/organizationManagerOrganizationIamMember:OrganizationManagerOrganizationIamMember")]
    public partial class OrganizationManagerOrganizationIamMember : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The identity that will be granted the privilege that is specified in the `role` field.
        /// This field can have one of the following values:
        /// * **userAccount:{user_id}**: A unique user ID that represents a specific Yandex account.
        /// * **serviceAccount:{service_account_id}**: A unique service account ID.
        /// * **federatedUser:{federated_user_id}**: A unique federated user ID.
        /// </summary>
        [Output("member")]
        public Output<string> Member { get; private set; } = null!;

        /// <summary>
        /// ID of the organization to attach a policy to.
        /// </summary>
        [Output("organizationId")]
        public Output<string> OrganizationId { get; private set; } = null!;

        /// <summary>
        /// The role that should be assigned.
        /// </summary>
        [Output("role")]
        public Output<string> Role { get; private set; } = null!;

        [Output("sleepAfter")]
        public Output<int?> SleepAfter { get; private set; } = null!;


        /// <summary>
        /// Create a OrganizationManagerOrganizationIamMember 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 OrganizationManagerOrganizationIamMember(string name, OrganizationManagerOrganizationIamMemberArgs args, CustomResourceOptions? options = null)
            : base("yandex:index/organizationManagerOrganizationIamMember:OrganizationManagerOrganizationIamMember", name, args ?? new OrganizationManagerOrganizationIamMemberArgs(), MakeResourceOptions(options, ""))
        {
        }

        private OrganizationManagerOrganizationIamMember(string name, Input<string> id, OrganizationManagerOrganizationIamMemberState? state = null, CustomResourceOptions? options = null)
            : base("yandex:index/organizationManagerOrganizationIamMember:OrganizationManagerOrganizationIamMember", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
                PluginDownloadURL = "https://github.com/regrau/pulumi-yandex/releases",
            };
            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 OrganizationManagerOrganizationIamMember 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="state">Any extra arguments used during the lookup.</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public static OrganizationManagerOrganizationIamMember Get(string name, Input<string> id, OrganizationManagerOrganizationIamMemberState? state = null, CustomResourceOptions? options = null)
        {
            return new OrganizationManagerOrganizationIamMember(name, id, state, options);
        }
    }

    public sealed class OrganizationManagerOrganizationIamMemberArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The identity that will be granted the privilege that is specified in the `role` field.
        /// This field can have one of the following values:
        /// * **userAccount:{user_id}**: A unique user ID that represents a specific Yandex account.
        /// * **serviceAccount:{service_account_id}**: A unique service account ID.
        /// * **federatedUser:{federated_user_id}**: A unique federated user ID.
        /// </summary>
        [Input("member", required: true)]
        public Input<string> Member { get; set; } = null!;

        /// <summary>
        /// ID of the organization to attach a policy to.
        /// </summary>
        [Input("organizationId", required: true)]
        public Input<string> OrganizationId { get; set; } = null!;

        /// <summary>
        /// The role that should be assigned.
        /// </summary>
        [Input("role", required: true)]
        public Input<string> Role { get; set; } = null!;

        [Input("sleepAfter")]
        public Input<int>? SleepAfter { get; set; }

        public OrganizationManagerOrganizationIamMemberArgs()
        {
        }
        public static new OrganizationManagerOrganizationIamMemberArgs Empty => new OrganizationManagerOrganizationIamMemberArgs();
    }

    public sealed class OrganizationManagerOrganizationIamMemberState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The identity that will be granted the privilege that is specified in the `role` field.
        /// This field can have one of the following values:
        /// * **userAccount:{user_id}**: A unique user ID that represents a specific Yandex account.
        /// * **serviceAccount:{service_account_id}**: A unique service account ID.
        /// * **federatedUser:{federated_user_id}**: A unique federated user ID.
        /// </summary>
        [Input("member")]
        public Input<string>? Member { get; set; }

        /// <summary>
        /// ID of the organization to attach a policy to.
        /// </summary>
        [Input("organizationId")]
        public Input<string>? OrganizationId { get; set; }

        /// <summary>
        /// The role that should be assigned.
        /// </summary>
        [Input("role")]
        public Input<string>? Role { get; set; }

        [Input("sleepAfter")]
        public Input<int>? SleepAfter { get; set; }

        public OrganizationManagerOrganizationIamMemberState()
        {
        }
        public static new OrganizationManagerOrganizationIamMemberState Empty => new OrganizationManagerOrganizationIamMemberState();
    }
}
