<filename>sdk/dotnet/JsonGenericApi.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 Pulumiverse.Fortios
{
    /// <summary>
    /// FortiAPI Generic Interface.
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using System.Linq;
    /// using Pulumi;
    /// using Fortios = Pulumiverse.Fortios;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var test1 = new Fortios.JsonGenericApi("test1", new()
    ///     {
    ///         Json = "",
    ///         Method = "GET",
    ///         Path = "/api/v2/cmdb/firewall/address",
    ///     });
    /// 
    ///     var test2 = new Fortios.JsonGenericApi("test2", new()
    ///     {
    ///         Json = @"{
    ///   ""name"": ""11221"",
    ///   ""type"": ""geography"",
    ///   ""fqdn"": """",
    ///   ""country"": ""AL"",
    ///   ""comment"": ""ccc"",
    ///   ""visibility"": ""enable"",
    ///   ""associated-interface"": ""port1"",
    ///   ""allow-routing"": ""disable""
    /// }
    /// 
    /// ",
    ///         Method = "POST",
    ///         Path = "/api/v2/cmdb/firewall/address",
    ///     });
    /// 
    ///     var test3 = new Fortios.JsonGenericApi("test3", new()
    ///     {
    ///         Json = "",
    ///         Method = "PUT",
    ///         Path = "/api/v2/cmdb/firewall/policy/3",
    ///         Specialparams = "action=move&amp;after=1",
    ///     });
    /// 
    ///     return new Dictionary&lt;string, object?&gt;
    ///     {
    ///         ["response1"] = test1.Response,
    ///         ["response2"] = test2.Response,
    ///         ["response3"] = test3.Response,
    ///     };
    /// });
    /// ```
    /// </summary>
    [FortiosResourceType("fortios:index/jsonGenericApi:JsonGenericApi")]
    public partial class JsonGenericApi : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The argument is optional, if it is set, when its value changes, the resource will be re-created. It is usually used when the return value needs to be forced to update.
        /// </summary>
        [Output("forceRecreate")]
        public Output<string?> ForceRecreate { get; private set; } = null!;

        /// <summary>
        /// Body data in JSON format.
        /// </summary>
        [Output("json")]
        public Output<string?> Json { get; private set; } = null!;

        /// <summary>
        /// HTTP method.
        /// </summary>
        [Output("method")]
        public Output<string> Method { get; private set; } = null!;

        /// <summary>
        /// FortiAPI URL path.
        /// </summary>
        [Output("path")]
        public Output<string> Path { get; private set; } = null!;

        /// <summary>
        /// FortiAPI returns results.
        /// </summary>
        [Output("response")]
        public Output<string> Response { get; private set; } = null!;

        /// <summary>
        /// URL parameters, in addition to the URL path, user can specify URL parameters which are appended to the URL path.
        /// </summary>
        [Output("specialparams")]
        public Output<string?> Specialparams { get; private set; } = null!;

        [Output("vdomparam")]
        public Output<string?> Vdomparam { get; private set; } = null!;


        /// <summary>
        /// Create a JsonGenericApi 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 JsonGenericApi(string name, JsonGenericApiArgs args, CustomResourceOptions? options = null)
            : base("fortios:index/jsonGenericApi:JsonGenericApi", name, args ?? new JsonGenericApiArgs(), MakeResourceOptions(options, ""))
        {
        }

        private JsonGenericApi(string name, Input<string> id, JsonGenericApiState? state = null, CustomResourceOptions? options = null)
            : base("fortios:index/jsonGenericApi:JsonGenericApi", 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/pulumiverse/pulumi-fortios",
            };
            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 JsonGenericApi 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 JsonGenericApi Get(string name, Input<string> id, JsonGenericApiState? state = null, CustomResourceOptions? options = null)
        {
            return new JsonGenericApi(name, id, state, options);
        }
    }

    public sealed class JsonGenericApiArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The argument is optional, if it is set, when its value changes, the resource will be re-created. It is usually used when the return value needs to be forced to update.
        /// </summary>
        [Input("forceRecreate")]
        public Input<string>? ForceRecreate { get; set; }

        /// <summary>
        /// Body data in JSON format.
        /// </summary>
        [Input("json")]
        public Input<string>? Json { get; set; }

        /// <summary>
        /// HTTP method.
        /// </summary>
        [Input("method", required: true)]
        public Input<string> Method { get; set; } = null!;

        /// <summary>
        /// FortiAPI URL path.
        /// </summary>
        [Input("path", required: true)]
        public Input<string> Path { get; set; } = null!;

        /// <summary>
        /// URL parameters, in addition to the URL path, user can specify URL parameters which are appended to the URL path.
        /// </summary>
        [Input("specialparams")]
        public Input<string>? Specialparams { get; set; }

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

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

    public sealed class JsonGenericApiState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The argument is optional, if it is set, when its value changes, the resource will be re-created. It is usually used when the return value needs to be forced to update.
        /// </summary>
        [Input("forceRecreate")]
        public Input<string>? ForceRecreate { get; set; }

        /// <summary>
        /// Body data in JSON format.
        /// </summary>
        [Input("json")]
        public Input<string>? Json { get; set; }

        /// <summary>
        /// HTTP method.
        /// </summary>
        [Input("method")]
        public Input<string>? Method { get; set; }

        /// <summary>
        /// FortiAPI URL path.
        /// </summary>
        [Input("path")]
        public Input<string>? Path { get; set; }

        /// <summary>
        /// FortiAPI returns results.
        /// </summary>
        [Input("response")]
        public Input<string>? Response { get; set; }

        /// <summary>
        /// URL parameters, in addition to the URL path, user can specify URL parameters which are appended to the URL path.
        /// </summary>
        [Input("specialparams")]
        public Input<string>? Specialparams { get; set; }

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

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