<filename>sdk/dotnet/TwingateServiceAccountKey.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 TwingateLabs.Twingate
{
    [TwingateResourceType("twingate:index/twingateServiceAccountKey:TwingateServiceAccountKey")]
    public partial class TwingateServiceAccountKey : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The name of the Service Key
        /// </summary>
        [Output("name")]
        public Output<string> Name { get; private set; } = null!;

        /// <summary>
        /// The id of the Service Account
        /// </summary>
        [Output("serviceAccountId")]
        public Output<string> ServiceAccountId { get; private set; } = null!;

        /// <summary>
        /// Autogenerated Service Key token. Used to configure a Twingate Client running in headless mode.
        /// </summary>
        [Output("token")]
        public Output<string> Token { get; private set; } = null!;


        /// <summary>
        /// Create a TwingateServiceAccountKey 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 TwingateServiceAccountKey(string name, TwingateServiceAccountKeyArgs args, CustomResourceOptions? options = null)
            : base("twingate:index/twingateServiceAccountKey:TwingateServiceAccountKey", name, args ?? new TwingateServiceAccountKeyArgs(), MakeResourceOptions(options, ""))
        {
        }

        private TwingateServiceAccountKey(string name, Input<string> id, TwingateServiceAccountKeyState? state = null, CustomResourceOptions? options = null)
            : base("twingate:index/twingateServiceAccountKey:TwingateServiceAccountKey", 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/twingate-labs",
                AdditionalSecretOutputs =
                {
                    "token",
                },
            };
            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 TwingateServiceAccountKey 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 TwingateServiceAccountKey Get(string name, Input<string> id, TwingateServiceAccountKeyState? state = null, CustomResourceOptions? options = null)
        {
            return new TwingateServiceAccountKey(name, id, state, options);
        }
    }

    public sealed class TwingateServiceAccountKeyArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The name of the Service Key
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// The id of the Service Account
        /// </summary>
        [Input("serviceAccountId", required: true)]
        public Input<string> ServiceAccountId { get; set; } = null!;

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

    public sealed class TwingateServiceAccountKeyState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The name of the Service Key
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// The id of the Service Account
        /// </summary>
        [Input("serviceAccountId")]
        public Input<string>? ServiceAccountId { get; set; }

        [Input("token")]
        private Input<string>? _token;

        /// <summary>
        /// Autogenerated Service Key token. Used to configure a Twingate Client running in headless mode.
        /// </summary>
        public Input<string>? Token
        {
            get => _token;
            set
            {
                var emptySecret = Output.CreateSecret(0);
                _token = Output.Tuple<Input<string>?, int>(value, emptySecret).Apply(t => t.Item1);
            }
        }

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