<reponame>Dwonczykj/gember_deploy<filename>sdk/dotnet/Tencentcloud/Cdn/UrlPush.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;
using Pulumi;

namespace TencentCloudIAC.PulumiPackage.Tencentcloud.Cdn
{
    /// <summary>
    /// Provide a resource to invoke a Url Push request.
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using Pulumi;
    /// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
    /// 
    /// class MyStack : Stack
    /// {
    ///     public MyStack()
    ///     {
    ///         var foo = new Tencentcloud.Cdn.UrlPush("foo", new Tencentcloud.Cdn.UrlPushArgs
    ///         {
    ///             Urls = 
    ///             {
    ///                 "https://www.example.com/b",
    ///             },
    ///         });
    ///     }
    /// 
    /// }
    /// ```
    /// 
    /// argument to request new push task with same urls
    /// 
    /// ```csharp
    /// using Pulumi;
    /// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
    /// 
    /// class MyStack : Stack
    /// {
    ///     public MyStack()
    ///     {
    ///         var foo = new Tencentcloud.Cdn.UrlPush("foo", new Tencentcloud.Cdn.UrlPushArgs
    ///         {
    ///             Redo = 1,
    ///             Urls = 
    ///             {
    ///                 "https://www.example.com/a",
    ///             },
    ///         });
    ///     }
    /// 
    /// }
    /// ```
    /// </summary>
    [TencentcloudResourceType("tencentcloud:Cdn/urlPush:UrlPush")]
    public partial class UrlPush : Pulumi.CustomResource
    {
        /// <summary>
        /// Specify push area. NOTE: only push same area cache contents.
        /// </summary>
        [Output("area")]
        public Output<string?> Area { get; private set; } = null!;

        /// <summary>
        /// Layer to push.
        /// </summary>
        [Output("layer")]
        public Output<string?> Layer { get; private set; } = null!;

        /// <summary>
        /// Whether to recursive parse m3u8 files.
        /// </summary>
        [Output("parseM3u8")]
        public Output<bool?> ParseM3u8 { get; private set; } = null!;

        /// <summary>
        /// logs of latest push task.
        /// </summary>
        [Output("pushHistories")]
        public Output<ImmutableArray<Outputs.UrlPushPushHistory>> PushHistories { get; private set; } = null!;

        /// <summary>
        /// Change to push again. NOTE: this argument only works while resource update, if set to `0` or null will not be triggered.
        /// </summary>
        [Output("redo")]
        public Output<int?> Redo { get; private set; } = null!;

        /// <summary>
        /// Push task id.
        /// </summary>
        [Output("taskId")]
        public Output<string> TaskId { get; private set; } = null!;

        /// <summary>
        /// List of url to push. NOTE: urls need include protocol prefix `http://` or `https://`.
        /// </summary>
        [Output("urls")]
        public Output<ImmutableArray<string>> Urls { get; private set; } = null!;

        /// <summary>
        /// Specify `User-Agent` HTTP header, default: `TencentCdn`.
        /// </summary>
        [Output("userAgent")]
        public Output<string?> UserAgent { get; private set; } = null!;


        /// <summary>
        /// Create a UrlPush resource with the given unique name, arguments, and options.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resource</param>
        /// <param name="args">The arguments used to populate this resource's properties</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public UrlPush(string name, UrlPushArgs args, CustomResourceOptions? options = null)
            : base("tencentcloud:Cdn/urlPush:UrlPush", name, args ?? new UrlPushArgs(), MakeResourceOptions(options, ""))
        {
        }

        private UrlPush(string name, Input<string> id, UrlPushState? state = null, CustomResourceOptions? options = null)
            : base("tencentcloud:Cdn/urlPush:UrlPush", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
                PluginDownloadURL = "github://api.github.com/tencentcloudstack",
            };
            var merged = CustomResourceOptions.Merge(defaultOptions, options);
            // Override the ID if one was specified for consistency with other language SDKs.
            merged.Id = id ?? merged.Id;
            return merged;
        }
        /// <summary>
        /// Get an existing UrlPush resource's state with the given name, ID, and optional extra
        /// properties used to qualify the lookup.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resulting resource.</param>
        /// <param name="id">The unique provider ID of the resource to lookup.</param>
        /// <param name="state">Any extra arguments used during the lookup.</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public static UrlPush Get(string name, Input<string> id, UrlPushState? state = null, CustomResourceOptions? options = null)
        {
            return new UrlPush(name, id, state, options);
        }
    }

    public sealed class UrlPushArgs : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Specify push area. NOTE: only push same area cache contents.
        /// </summary>
        [Input("area")]
        public Input<string>? Area { get; set; }

        /// <summary>
        /// Layer to push.
        /// </summary>
        [Input("layer")]
        public Input<string>? Layer { get; set; }

        /// <summary>
        /// Whether to recursive parse m3u8 files.
        /// </summary>
        [Input("parseM3u8")]
        public Input<bool>? ParseM3u8 { get; set; }

        /// <summary>
        /// Change to push again. NOTE: this argument only works while resource update, if set to `0` or null will not be triggered.
        /// </summary>
        [Input("redo")]
        public Input<int>? Redo { get; set; }

        [Input("urls", required: true)]
        private InputList<string>? _urls;

        /// <summary>
        /// List of url to push. NOTE: urls need include protocol prefix `http://` or `https://`.
        /// </summary>
        public InputList<string> Urls
        {
            get => _urls ?? (_urls = new InputList<string>());
            set => _urls = value;
        }

        /// <summary>
        /// Specify `User-Agent` HTTP header, default: `TencentCdn`.
        /// </summary>
        [Input("userAgent")]
        public Input<string>? UserAgent { get; set; }

        public UrlPushArgs()
        {
        }
    }

    public sealed class UrlPushState : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Specify push area. NOTE: only push same area cache contents.
        /// </summary>
        [Input("area")]
        public Input<string>? Area { get; set; }

        /// <summary>
        /// Layer to push.
        /// </summary>
        [Input("layer")]
        public Input<string>? Layer { get; set; }

        /// <summary>
        /// Whether to recursive parse m3u8 files.
        /// </summary>
        [Input("parseM3u8")]
        public Input<bool>? ParseM3u8 { get; set; }

        [Input("pushHistories")]
        private InputList<Inputs.UrlPushPushHistoryGetArgs>? _pushHistories;

        /// <summary>
        /// logs of latest push task.
        /// </summary>
        public InputList<Inputs.UrlPushPushHistoryGetArgs> PushHistories
        {
            get => _pushHistories ?? (_pushHistories = new InputList<Inputs.UrlPushPushHistoryGetArgs>());
            set => _pushHistories = value;
        }

        /// <summary>
        /// Change to push again. NOTE: this argument only works while resource update, if set to `0` or null will not be triggered.
        /// </summary>
        [Input("redo")]
        public Input<int>? Redo { get; set; }

        /// <summary>
        /// Push task id.
        /// </summary>
        [Input("taskId")]
        public Input<string>? TaskId { get; set; }

        [Input("urls")]
        private InputList<string>? _urls;

        /// <summary>
        /// List of url to push. NOTE: urls need include protocol prefix `http://` or `https://`.
        /// </summary>
        public InputList<string> Urls
        {
            get => _urls ?? (_urls = new InputList<string>());
            set => _urls = value;
        }

        /// <summary>
        /// Specify `User-Agent` HTTP header, default: `TencentCdn`.
        /// </summary>
        [Input("userAgent")]
        public Input<string>? UserAgent { get; set; }

        public UrlPushState()
        {
        }
    }
}
