// *** 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 PiersKarsenbarg.Codefresh
{
    public static class GetUser
    {
        /// <summary>
        /// ## # User Data Source
        /// 
        /// Use this data source to get the User from existing users for use in other resources.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using Codefresh = PiersKarsenbarg.Codefresh;
        /// using Codefresh = Pulumi.Codefresh;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var admin = Codefresh.GetUser.Invoke(new()
        ///     {
        ///         Email = "hzdkv@example.com",
        ///     });
        /// 
        ///     var admins = new Codefresh.Team("admins", new()
        ///     {
        ///         Users = new[]
        ///         {
        ///             admin.Apply(getUserResult =&gt; getUserResult.UserId),
        ///             "&lt;ANY USER ID&gt;",
        ///         },
        ///     });
        /// 
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetUserResult> InvokeAsync(GetUserArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetUserResult>("codefresh:index/getUser:getUser", args ?? new GetUserArgs(), options.WithDefaults());

        /// <summary>
        /// ## # User Data Source
        /// 
        /// Use this data source to get the User from existing users for use in other resources.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using Codefresh = PiersKarsenbarg.Codefresh;
        /// using Codefresh = Pulumi.Codefresh;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var admin = Codefresh.GetUser.Invoke(new()
        ///     {
        ///         Email = "hzdkv@example.com",
        ///     });
        /// 
        ///     var admins = new Codefresh.Team("admins", new()
        ///     {
        ///         Users = new[]
        ///         {
        ///             admin.Apply(getUserResult =&gt; getUserResult.UserId),
        ///             "&lt;ANY USER ID&gt;",
        ///         },
        ///     });
        /// 
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetUserResult> Invoke(GetUserInvokeArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetUserResult>("codefresh:index/getUser:getUser", args ?? new GetUserInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetUserArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// The email of user to filter.
        /// </summary>
        [Input("email", required: true)]
        public string Email { get; set; } = null!;

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

    public sealed class GetUserInvokeArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// The email of user to filter.
        /// </summary>
        [Input("email", required: true)]
        public Input<string> Email { get; set; } = null!;

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


    [OutputType]
    public sealed class GetUserResult
    {
        public readonly string Email;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        public readonly ImmutableArray<Outputs.GetUserLoginResult> Logins;
        public readonly ImmutableArray<Outputs.GetUserPersonalResult> Personals;
        public readonly ImmutableArray<string> Roles;
        public readonly ImmutableArray<Outputs.GetUserShortProfileResult> ShortProfiles;
        public readonly string Status;
        public readonly string UserId;
        public readonly string UserName;

        [OutputConstructor]
        private GetUserResult(
            string email,

            string id,

            ImmutableArray<Outputs.GetUserLoginResult> logins,

            ImmutableArray<Outputs.GetUserPersonalResult> personals,

            ImmutableArray<string> roles,

            ImmutableArray<Outputs.GetUserShortProfileResult> shortProfiles,

            string status,

            string userId,

            string userName)
        {
            Email = email;
            Id = id;
            Logins = logins;
            Personals = personals;
            Roles = roles;
            ShortProfiles = shortProfiles;
            Status = status;
            UserId = userId;
            UserName = userName;
        }
    }
}
