// *** 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.Onepassword
{
    public static class GetItem
    {
        /// <summary>
        /// Use this data source to get details of an item by its vault uuid and either the title or the uuid of the item.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Onepassword = Pulumi.Onepassword;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var example = Output.Create(Onepassword.GetItem.InvokeAsync(new Onepassword.GetItemArgs
        ///         {
        ///             Vault = @var.Demo_vault,
        ///             Uuid = onepassword_item.Demo_sections.Uuid,
        ///         }));
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetItemResult> InvokeAsync(GetItemArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetItemResult>("onepassword:index/getItem:GetItem", args ?? new GetItemArgs(), options.WithDefaults());

        /// <summary>
        /// Use this data source to get details of an item by its vault uuid and either the title or the uuid of the item.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Onepassword = Pulumi.Onepassword;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var example = Output.Create(Onepassword.GetItem.InvokeAsync(new Onepassword.GetItemArgs
        ///         {
        ///             Vault = @var.Demo_vault,
        ///             Uuid = onepassword_item.Demo_sections.Uuid,
        ///         }));
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetItemResult> Invoke(GetItemInvokeArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetItemResult>("onepassword:index/getItem:GetItem", args ?? new GetItemInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetItemArgs : Pulumi.InvokeArgs
    {
        /// <summary>
        /// The title of the item to retrieve. This field will be populated with the title of the item if the item it looked up by its UUID.
        /// </summary>
        [Input("title")]
        public string? Title { get; set; }

        /// <summary>
        /// The UUID of the item to retrieve. This field will be populated with the UUID of the item if the item it looked up by its title.
        /// </summary>
        [Input("uuid")]
        public string? Uuid { get; set; }

        /// <summary>
        /// The UUID of the vault the item is in.
        /// </summary>
        [Input("vault", required: true)]
        public string Vault { get; set; } = null!;

        public GetItemArgs()
        {
        }
    }

    public sealed class GetItemInvokeArgs : Pulumi.InvokeArgs
    {
        /// <summary>
        /// The title of the item to retrieve. This field will be populated with the title of the item if the item it looked up by its UUID.
        /// </summary>
        [Input("title")]
        public Input<string>? Title { get; set; }

        /// <summary>
        /// The UUID of the item to retrieve. This field will be populated with the UUID of the item if the item it looked up by its title.
        /// </summary>
        [Input("uuid")]
        public Input<string>? Uuid { get; set; }

        /// <summary>
        /// The UUID of the vault the item is in.
        /// </summary>
        [Input("vault", required: true)]
        public Input<string> Vault { get; set; } = null!;

        public GetItemInvokeArgs()
        {
        }
    }


    [OutputType]
    public sealed class GetItemResult
    {
        /// <summary>
        /// The category of the item. One of ["login" "password" "database"]
        /// </summary>
        public readonly string Category;
        /// <summary>
        /// (Only applies to the database category) The name of the database.
        /// </summary>
        public readonly string Database;
        /// <summary>
        /// (Only applies to the database category) The address where the database can be found
        /// </summary>
        public readonly string Hostname;
        public readonly string Id;
        /// <summary>
        /// Password for this item.
        /// </summary>
        public readonly string Password;
        /// <summary>
        /// (Only applies to the database category) The port the database is listening on.
        /// </summary>
        public readonly string Port;
        /// <summary>
        /// A list of custom sections in an item
        /// </summary>
        public readonly ImmutableArray<Outputs.GetItemSectionResult> Sections;
        /// <summary>
        /// An array of strings of the tags assigned to the item.
        /// </summary>
        public readonly ImmutableArray<string> Tags;
        /// <summary>
        /// The title of the item to retrieve. This field will be populated with the title of the item if the item it looked up by its UUID.
        /// </summary>
        public readonly string Title;
        /// <summary>
        /// (Only applies to the database category) The type of database. One of ["db2" "filemaker" "msaccess" "mssql" "mysql" "oracle" "postgresql" "sqlite" "other"]
        /// </summary>
        public readonly string Type;
        /// <summary>
        /// The primary URL for the item.
        /// </summary>
        public readonly string Url;
        /// <summary>
        /// Username for this item.
        /// </summary>
        public readonly string Username;
        /// <summary>
        /// The UUID of the item to retrieve. This field will be populated with the UUID of the item if the item it looked up by its title.
        /// </summary>
        public readonly string Uuid;
        /// <summary>
        /// The UUID of the vault the item is in.
        /// </summary>
        public readonly string Vault;

        [OutputConstructor]
        private GetItemResult(
            string category,

            string database,

            string hostname,

            string id,

            string password,

            string port,

            ImmutableArray<Outputs.GetItemSectionResult> sections,

            ImmutableArray<string> tags,

            string title,

            string type,

            string url,

            string username,

            string uuid,

            string vault)
        {
            Category = category;
            Database = database;
            Hostname = hostname;
            Id = id;
            Password = password;
            Port = port;
            Sections = sections;
            Tags = tags;
            Title = title;
            Type = type;
            Url = url;
            Username = username;
            Uuid = uuid;
            Vault = vault;
        }
    }
}
