<filename>sdk/dotnet/CR/GetRepos.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.AliCloud.CR
{
    public static class GetRepos
    {
        /// <summary>
        /// This data source provides a list Container Registry repositories on Alibaba Cloud.
        /// 
        /// &gt; **NOTE:** Available in v1.35.0+
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var myRepos = AliCloud.CR.GetRepos.Invoke(new()
        ///     {
        ///         NameRegex = "my-repos",
        ///         OutputFile = "my-repo-json",
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["output"] = myRepos.Apply(getReposResult =&gt; getReposResult.Repos),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetReposResult> InvokeAsync(GetReposArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetReposResult>("alicloud:cr/getRepos:getRepos", args ?? new GetReposArgs(), options.WithDefaults());

        /// <summary>
        /// This data source provides a list Container Registry repositories on Alibaba Cloud.
        /// 
        /// &gt; **NOTE:** Available in v1.35.0+
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var myRepos = AliCloud.CR.GetRepos.Invoke(new()
        ///     {
        ///         NameRegex = "my-repos",
        ///         OutputFile = "my-repo-json",
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["output"] = myRepos.Apply(getReposResult =&gt; getReposResult.Repos),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetReposResult> Invoke(GetReposInvokeArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetReposResult>("alicloud:cr/getRepos:getRepos", args ?? new GetReposInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetReposArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// Boolean, false by default, only repository attributes are exported. Set to true if domain list and tags belong to this repository are needed. See `tags` in attributes.
        /// </summary>
        [Input("enableDetails")]
        public bool? EnableDetails { get; set; }

        /// <summary>
        /// A regex string to filter results by repository name.
        /// </summary>
        [Input("nameRegex")]
        public string? NameRegex { get; set; }

        /// <summary>
        /// Name of container registry namespace where the repositories are located in.
        /// </summary>
        [Input("namespace")]
        public string? Namespace { get; set; }

        [Input("outputFile")]
        public string? OutputFile { get; set; }

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

    public sealed class GetReposInvokeArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// Boolean, false by default, only repository attributes are exported. Set to true if domain list and tags belong to this repository are needed. See `tags` in attributes.
        /// </summary>
        [Input("enableDetails")]
        public Input<bool>? EnableDetails { get; set; }

        /// <summary>
        /// A regex string to filter results by repository name.
        /// </summary>
        [Input("nameRegex")]
        public Input<string>? NameRegex { get; set; }

        /// <summary>
        /// Name of container registry namespace where the repositories are located in.
        /// </summary>
        [Input("namespace")]
        public Input<string>? Namespace { get; set; }

        [Input("outputFile")]
        public Input<string>? OutputFile { get; set; }

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


    [OutputType]
    public sealed class GetReposResult
    {
        public readonly bool? EnableDetails;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        /// <summary>
        /// A list of matched Container Registry Repositories. Its element is set to `names`.
        /// </summary>
        public readonly ImmutableArray<string> Ids;
        public readonly string? NameRegex;
        /// <summary>
        /// A list of repository names.
        /// </summary>
        public readonly ImmutableArray<string> Names;
        /// <summary>
        /// Name of container registry namespace where repo is located.
        /// </summary>
        public readonly string? Namespace;
        public readonly string? OutputFile;
        /// <summary>
        /// A list of matched Container Registry Namespaces. Each element contains the following attributes:
        /// </summary>
        public readonly ImmutableArray<Outputs.GetReposRepoResult> Repos;

        [OutputConstructor]
        private GetReposResult(
            bool? enableDetails,

            string id,

            ImmutableArray<string> ids,

            string? nameRegex,

            ImmutableArray<string> names,

            string? @namespace,

            string? outputFile,

            ImmutableArray<Outputs.GetReposRepoResult> repos)
        {
            EnableDetails = enableDetails;
            Id = id;
            Ids = ids;
            NameRegex = nameRegex;
            Names = names;
            Namespace = @namespace;
            OutputFile = outputFile;
            Repos = repos;
        }
    }
}
