// *** 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;
using Pulumi;

namespace TencentCloudIAC.PulumiPackage.Tencentcloud.Organization
{
    /// <summary>
    /// Provides a resource to create a organization org_member
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using Pulumi;
    /// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
    /// 
    /// class MyStack : Stack
    /// {
    ///     public MyStack()
    ///     {
    ///         var orgMember = new Tencentcloud.Organization.OrgMember("orgMember", new Tencentcloud.Organization.OrgMemberArgs
    ///         {
    ///             NodeId = 2003721,
    ///             PermissionIds = 
    ///             {
    ///                 1,
    ///                 2,
    ///                 3,
    ///                 4,
    ///             },
    ///             PolicyType = "Financial",
    ///             Remark = "for terraform test",
    ///         });
    ///     }
    /// 
    /// }
    /// ```
    /// 
    /// ## Import
    /// 
    /// organization org_member can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import tencentcloud:Organization/orgMember:OrgMember org_member orgMember_id
    /// ```
    /// </summary>
    [TencentcloudResourceType("tencentcloud:Organization/orgMember:OrgMember")]
    public partial class OrgMember : Pulumi.CustomResource
    {
        /// <summary>
        /// Member creation time.
        /// </summary>
        [Output("createTime")]
        public Output<string> CreateTime { get; private set; } = null!;

        /// <summary>
        /// Whether to allow member to leave the organization.Valid values:- `Allow`.- `Denied`.
        /// </summary>
        [Output("isAllowQuit")]
        public Output<string> IsAllowQuit { get; private set; } = null!;

        /// <summary>
        /// Member Type.Valid values:- `Invite`: The member is invited.- `Create`: The member is created.
        /// </summary>
        [Output("memberType")]
        public Output<string> MemberType { get; private set; } = null!;

        /// <summary>
        /// Member name.
        /// </summary>
        [Output("name")]
        public Output<string> Name { get; private set; } = null!;

        /// <summary>
        /// Organization node ID.
        /// </summary>
        [Output("nodeId")]
        public Output<int> NodeId { get; private set; } = null!;

        /// <summary>
        /// Organization node name.
        /// </summary>
        [Output("nodeName")]
        public Output<string> NodeName { get; private set; } = null!;

        /// <summary>
        /// Financial management permissions.
        /// </summary>
        [Output("orgPermissions")]
        public Output<ImmutableArray<Outputs.OrgMemberOrgPermission>> OrgPermissions { get; private set; } = null!;

        /// <summary>
        /// Organization policy name.
        /// </summary>
        [Output("orgPolicyName")]
        public Output<string> OrgPolicyName { get; private set; } = null!;

        /// <summary>
        /// The member name which is payment account on behalf.
        /// </summary>
        [Output("payName")]
        public Output<string> PayName { get; private set; } = null!;

        /// <summary>
        /// The uin which is payment account on behalf.When `PermissionIds` contains 7, is required.
        /// </summary>
        [Output("payUin")]
        public Output<string?> PayUin { get; private set; } = null!;

        /// <summary>
        /// Financial management permission IDs.Valid values:- `1`: View bill.- `2`: Check balance.- `3`: Fund transfer.- `4`: Combine bill.- `5`: Issue an invoice.- `6`: Inherit discount.- `7`: Pay on behalf.value 1,2 is required.
        /// </summary>
        [Output("permissionIds")]
        public Output<ImmutableArray<int>> PermissionIds { get; private set; } = null!;

        /// <summary>
        /// Organization policy type.- `Financial`: Financial management policy.
        /// </summary>
        [Output("policyType")]
        public Output<string> PolicyType { get; private set; } = null!;

        /// <summary>
        /// Create member record ID.When create failed and needs to be recreated, is required.
        /// </summary>
        [Output("recordId")]
        public Output<int?> RecordId { get; private set; } = null!;

        /// <summary>
        /// Notes.
        /// </summary>
        [Output("remark")]
        public Output<string?> Remark { get; private set; } = null!;

        /// <summary>
        /// Member update time.
        /// </summary>
        [Output("updateTime")]
        public Output<string> UpdateTime { get; private set; } = null!;


        /// <summary>
        /// Create a OrgMember 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 OrgMember(string name, OrgMemberArgs args, CustomResourceOptions? options = null)
            : base("tencentcloud:Organization/orgMember:OrgMember", name, args ?? new OrgMemberArgs(), MakeResourceOptions(options, ""))
        {
        }

        private OrgMember(string name, Input<string> id, OrgMemberState? state = null, CustomResourceOptions? options = null)
            : base("tencentcloud:Organization/orgMember:OrgMember", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
                PluginDownloadURL = "github://api.github.com/tencentcloudstack",
            };
            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 OrgMember 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 OrgMember Get(string name, Input<string> id, OrgMemberState? state = null, CustomResourceOptions? options = null)
        {
            return new OrgMember(name, id, state, options);
        }
    }

    public sealed class OrgMemberArgs : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Member name.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// Organization node ID.
        /// </summary>
        [Input("nodeId", required: true)]
        public Input<int> NodeId { get; set; } = null!;

        /// <summary>
        /// The uin which is payment account on behalf.When `PermissionIds` contains 7, is required.
        /// </summary>
        [Input("payUin")]
        public Input<string>? PayUin { get; set; }

        [Input("permissionIds", required: true)]
        private InputList<int>? _permissionIds;

        /// <summary>
        /// Financial management permission IDs.Valid values:- `1`: View bill.- `2`: Check balance.- `3`: Fund transfer.- `4`: Combine bill.- `5`: Issue an invoice.- `6`: Inherit discount.- `7`: Pay on behalf.value 1,2 is required.
        /// </summary>
        public InputList<int> PermissionIds
        {
            get => _permissionIds ?? (_permissionIds = new InputList<int>());
            set => _permissionIds = value;
        }

        /// <summary>
        /// Organization policy type.- `Financial`: Financial management policy.
        /// </summary>
        [Input("policyType", required: true)]
        public Input<string> PolicyType { get; set; } = null!;

        /// <summary>
        /// Create member record ID.When create failed and needs to be recreated, is required.
        /// </summary>
        [Input("recordId")]
        public Input<int>? RecordId { get; set; }

        /// <summary>
        /// Notes.
        /// </summary>
        [Input("remark")]
        public Input<string>? Remark { get; set; }

        public OrgMemberArgs()
        {
        }
    }

    public sealed class OrgMemberState : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Member creation time.
        /// </summary>
        [Input("createTime")]
        public Input<string>? CreateTime { get; set; }

        /// <summary>
        /// Whether to allow member to leave the organization.Valid values:- `Allow`.- `Denied`.
        /// </summary>
        [Input("isAllowQuit")]
        public Input<string>? IsAllowQuit { get; set; }

        /// <summary>
        /// Member Type.Valid values:- `Invite`: The member is invited.- `Create`: The member is created.
        /// </summary>
        [Input("memberType")]
        public Input<string>? MemberType { get; set; }

        /// <summary>
        /// Member name.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// Organization node ID.
        /// </summary>
        [Input("nodeId")]
        public Input<int>? NodeId { get; set; }

        /// <summary>
        /// Organization node name.
        /// </summary>
        [Input("nodeName")]
        public Input<string>? NodeName { get; set; }

        [Input("orgPermissions")]
        private InputList<Inputs.OrgMemberOrgPermissionGetArgs>? _orgPermissions;

        /// <summary>
        /// Financial management permissions.
        /// </summary>
        public InputList<Inputs.OrgMemberOrgPermissionGetArgs> OrgPermissions
        {
            get => _orgPermissions ?? (_orgPermissions = new InputList<Inputs.OrgMemberOrgPermissionGetArgs>());
            set => _orgPermissions = value;
        }

        /// <summary>
        /// Organization policy name.
        /// </summary>
        [Input("orgPolicyName")]
        public Input<string>? OrgPolicyName { get; set; }

        /// <summary>
        /// The member name which is payment account on behalf.
        /// </summary>
        [Input("payName")]
        public Input<string>? PayName { get; set; }

        /// <summary>
        /// The uin which is payment account on behalf.When `PermissionIds` contains 7, is required.
        /// </summary>
        [Input("payUin")]
        public Input<string>? PayUin { get; set; }

        [Input("permissionIds")]
        private InputList<int>? _permissionIds;

        /// <summary>
        /// Financial management permission IDs.Valid values:- `1`: View bill.- `2`: Check balance.- `3`: Fund transfer.- `4`: Combine bill.- `5`: Issue an invoice.- `6`: Inherit discount.- `7`: Pay on behalf.value 1,2 is required.
        /// </summary>
        public InputList<int> PermissionIds
        {
            get => _permissionIds ?? (_permissionIds = new InputList<int>());
            set => _permissionIds = value;
        }

        /// <summary>
        /// Organization policy type.- `Financial`: Financial management policy.
        /// </summary>
        [Input("policyType")]
        public Input<string>? PolicyType { get; set; }

        /// <summary>
        /// Create member record ID.When create failed and needs to be recreated, is required.
        /// </summary>
        [Input("recordId")]
        public Input<int>? RecordId { get; set; }

        /// <summary>
        /// Notes.
        /// </summary>
        [Input("remark")]
        public Input<string>? Remark { get; set; }

        /// <summary>
        /// Member update time.
        /// </summary>
        [Input("updateTime")]
        public Input<string>? UpdateTime { get; set; }

        public OrgMemberState()
        {
        }
    }
}
