// *** 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.Cms
{
    public static class GetDynamicTagGroups
    {
        /// <summary>
        /// This data source provides the Cms Dynamic Tag Groups of the current Alibaba Cloud user.
        /// 
        /// &gt; **NOTE:** Available in v1.142.0+.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// Basic Usage
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var config = new Config();
        ///     var name = config.Get("name") ?? "example_value";
        ///     var defaultAlarmContactGroup = new AliCloud.Cms.AlarmContactGroup("defaultAlarmContactGroup", new()
        ///     {
        ///         AlarmContactGroupName = name,
        ///         Describe = "example_value",
        ///         EnableSubscribed = true,
        ///     });
        /// 
        ///     var defaultDynamicTagGroup = new AliCloud.Cms.DynamicTagGroup("defaultDynamicTagGroup", new()
        ///     {
        ///         ContactGroupLists = new[]
        ///         {
        ///             defaultAlarmContactGroup.Id,
        ///         },
        ///         TagKey = "your_tag_key",
        ///         MatchExpresses = new[]
        ///         {
        ///             new AliCloud.Cms.Inputs.DynamicTagGroupMatchExpressArgs
        ///             {
        ///                 TagValue = "your_tag_value",
        ///                 TagValueMatchFunction = "all",
        ///             },
        ///         },
        ///     });
        /// 
        ///     var ids = AliCloud.Cms.GetDynamicTagGroups.Invoke(new()
        ///     {
        ///         Ids = new[]
        ///         {
        ///             defaultDynamicTagGroup.Id,
        ///         },
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["cmsDynamicTagGroupId1"] = ids.Apply(getDynamicTagGroupsResult =&gt; getDynamicTagGroupsResult.Groups[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetDynamicTagGroupsResult> InvokeAsync(GetDynamicTagGroupsArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetDynamicTagGroupsResult>("alicloud:cms/getDynamicTagGroups:getDynamicTagGroups", args ?? new GetDynamicTagGroupsArgs(), options.WithDefaults());

        /// <summary>
        /// This data source provides the Cms Dynamic Tag Groups of the current Alibaba Cloud user.
        /// 
        /// &gt; **NOTE:** Available in v1.142.0+.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// Basic Usage
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var config = new Config();
        ///     var name = config.Get("name") ?? "example_value";
        ///     var defaultAlarmContactGroup = new AliCloud.Cms.AlarmContactGroup("defaultAlarmContactGroup", new()
        ///     {
        ///         AlarmContactGroupName = name,
        ///         Describe = "example_value",
        ///         EnableSubscribed = true,
        ///     });
        /// 
        ///     var defaultDynamicTagGroup = new AliCloud.Cms.DynamicTagGroup("defaultDynamicTagGroup", new()
        ///     {
        ///         ContactGroupLists = new[]
        ///         {
        ///             defaultAlarmContactGroup.Id,
        ///         },
        ///         TagKey = "your_tag_key",
        ///         MatchExpresses = new[]
        ///         {
        ///             new AliCloud.Cms.Inputs.DynamicTagGroupMatchExpressArgs
        ///             {
        ///                 TagValue = "your_tag_value",
        ///                 TagValueMatchFunction = "all",
        ///             },
        ///         },
        ///     });
        /// 
        ///     var ids = AliCloud.Cms.GetDynamicTagGroups.Invoke(new()
        ///     {
        ///         Ids = new[]
        ///         {
        ///             defaultDynamicTagGroup.Id,
        ///         },
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["cmsDynamicTagGroupId1"] = ids.Apply(getDynamicTagGroupsResult =&gt; getDynamicTagGroupsResult.Groups[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetDynamicTagGroupsResult> Invoke(GetDynamicTagGroupsInvokeArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetDynamicTagGroupsResult>("alicloud:cms/getDynamicTagGroups:getDynamicTagGroups", args ?? new GetDynamicTagGroupsInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetDynamicTagGroupsArgs : global::Pulumi.InvokeArgs
    {
        [Input("ids")]
        private List<string>? _ids;

        /// <summary>
        /// A list of Dynamic Tag Group IDs.
        /// </summary>
        public List<string> Ids
        {
            get => _ids ?? (_ids = new List<string>());
            set => _ids = value;
        }

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

        /// <summary>
        /// The status of the resource. Valid values: `RUNNING`, `FINISH`.
        /// </summary>
        [Input("status")]
        public string? Status { get; set; }

        /// <summary>
        /// The tag key of the tag.
        /// </summary>
        [Input("tagKey")]
        public string? TagKey { get; set; }

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

    public sealed class GetDynamicTagGroupsInvokeArgs : global::Pulumi.InvokeArgs
    {
        [Input("ids")]
        private InputList<string>? _ids;

        /// <summary>
        /// A list of Dynamic Tag Group IDs.
        /// </summary>
        public InputList<string> Ids
        {
            get => _ids ?? (_ids = new InputList<string>());
            set => _ids = value;
        }

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

        /// <summary>
        /// The status of the resource. Valid values: `RUNNING`, `FINISH`.
        /// </summary>
        [Input("status")]
        public Input<string>? Status { get; set; }

        /// <summary>
        /// The tag key of the tag.
        /// </summary>
        [Input("tagKey")]
        public Input<string>? TagKey { get; set; }

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


    [OutputType]
    public sealed class GetDynamicTagGroupsResult
    {
        public readonly ImmutableArray<Outputs.GetDynamicTagGroupsGroupResult> Groups;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        public readonly ImmutableArray<string> Ids;
        public readonly string? OutputFile;
        public readonly string? Status;
        public readonly string? TagKey;

        [OutputConstructor]
        private GetDynamicTagGroupsResult(
            ImmutableArray<Outputs.GetDynamicTagGroupsGroupResult> groups,

            string id,

            ImmutableArray<string> ids,

            string? outputFile,

            string? status,

            string? tagKey)
        {
            Groups = groups;
            Id = id;
            Ids = ids;
            OutputFile = outputFile;
            Status = status;
            TagKey = tagKey;
        }
    }
}
