// *** 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 GetRegistry
    {
        /// <summary>
        /// ## # Data Source: codefresh.Registry
        /// 
        /// This data source allows retrieving information on any existing registry
        /// 
        /// {{% 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 dockerhub = Codefresh.GetRegistry.Invoke(new()
        ///     {
        ///         Name = "dockerhub",
        ///     });
        /// 
        ///     // example with using data reference to existing registry, not managed by terraform
        ///     // "dockerhub" registry will be used as fallback for "dockerhub1"
        ///     var dockerhub1 = new Codefresh.Registry("dockerhub1", new()
        ///     {
        ///         Primary = !dockerhub.Apply(getRegistryResult =&gt; getRegistryResult.Primary),
        ///         Spec = new Codefresh.Inputs.RegistrySpecArgs
        ///         {
        ///             Dockerhub = new Codefresh.Inputs.RegistrySpecDockerhubArgs
        ///             {
        ///                 Username = "test",
        ///                 Password = "test",
        ///             },
        ///         },
        ///         FallbackRegistry = dockerhub.Apply(getRegistryResult =&gt; getRegistryResult.Id),
        ///     });
        /// 
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetRegistryResult> InvokeAsync(GetRegistryArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetRegistryResult>("codefresh:index/getRegistry:getRegistry", args ?? new GetRegistryArgs(), options.WithDefaults());

        /// <summary>
        /// ## # Data Source: codefresh.Registry
        /// 
        /// This data source allows retrieving information on any existing registry
        /// 
        /// {{% 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 dockerhub = Codefresh.GetRegistry.Invoke(new()
        ///     {
        ///         Name = "dockerhub",
        ///     });
        /// 
        ///     // example with using data reference to existing registry, not managed by terraform
        ///     // "dockerhub" registry will be used as fallback for "dockerhub1"
        ///     var dockerhub1 = new Codefresh.Registry("dockerhub1", new()
        ///     {
        ///         Primary = !dockerhub.Apply(getRegistryResult =&gt; getRegistryResult.Primary),
        ///         Spec = new Codefresh.Inputs.RegistrySpecArgs
        ///         {
        ///             Dockerhub = new Codefresh.Inputs.RegistrySpecDockerhubArgs
        ///             {
        ///                 Username = "test",
        ///                 Password = "test",
        ///             },
        ///         },
        ///         FallbackRegistry = dockerhub.Apply(getRegistryResult =&gt; getRegistryResult.Id),
        ///     });
        /// 
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetRegistryResult> Invoke(GetRegistryInvokeArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetRegistryResult>("codefresh:index/getRegistry:getRegistry", args ?? new GetRegistryInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetRegistryArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// Name of the registry to be retrieved
        /// </summary>
        [Input("name", required: true)]
        public string Name { get; set; } = null!;

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

    public sealed class GetRegistryInvokeArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// Name of the registry to be retrieved
        /// </summary>
        [Input("name", required: true)]
        public Input<string> Name { get; set; } = null!;

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


    [OutputType]
    public sealed class GetRegistryResult
    {
        /// <summary>
        /// Bool.
        /// </summary>
        public readonly bool Default;
        /// <summary>
        /// String.
        /// </summary>
        public readonly string Domain;
        /// <summary>
        /// String representing the id of the fallback registry.
        /// * `repository prefix` - String representing the optional prefix for registry.
        /// </summary>
        public readonly string FallbackRegistry;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        public readonly string Kind;
        public readonly string Name;
        /// <summary>
        /// Bool.
        /// </summary>
        public readonly bool Primary;
        /// <summary>
        /// String identifying the type of registry. E.g. `dockerhub, ecr, acr` and others
        /// </summary>
        public readonly string RegistryProvider;
        public readonly string RepositoryPrefix;

        [OutputConstructor]
        private GetRegistryResult(
            bool @default,

            string domain,

            string fallbackRegistry,

            string id,

            string kind,

            string name,

            bool primary,

            string registryProvider,

            string repositoryPrefix)
        {
            Default = @default;
            Domain = domain;
            FallbackRegistry = fallbackRegistry;
            Id = id;
            Kind = kind;
            Name = name;
            Primary = primary;
            RegistryProvider = registryProvider;
            RepositoryPrefix = repositoryPrefix;
        }
    }
}
