<gh_stars>0// *** 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 Cuemby.Equinix
{
    /// <summary>
    /// Use this resource to create Metal Project API Key resources in Equinix Metal. Project API keys can
    /// be used to create and read resources in a single project. Each API key contains a token which can
    /// be used for authentication in Equinix Metal HTTP API (in HTTP request header `X-Auth-Token`).
    /// 
    /// Read-only keys only allow to list and view existing resources, read-write keys can also be used to
    /// create resources.
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using Pulumi;
    /// using Equinix = Cuemby.Equinix;
    /// 
    /// class MyStack : Stack
    /// {
    ///     public MyStack()
    ///     {
    ///         // Create a new read-only API key in existing project
    ///         var test = new Equinix.MetalProjectAPIKey("test", new Equinix.MetalProjectAPIKeyArgs
    ///         {
    ///             ProjectId = local.Existing_project_id,
    ///             Description = "Read-only key scoped to a projct",
    ///             ReadOnly = true,
    ///         });
    ///     }
    /// 
    /// }
    /// ```
    /// </summary>
    [EquinixResourceType("equinix:index/metalProjectAPIKey:MetalProjectAPIKey")]
    public partial class MetalProjectAPIKey : Pulumi.CustomResource
    {
        /// <summary>
        /// Description string for the Project API Key resource.
        /// * `read-only` - (Optional) Flag indicating whether the API key shoud be read-only.
        /// </summary>
        [Output("description")]
        public Output<string> Description { get; private set; } = null!;

        /// <summary>
        /// UUID of the project where the API key is scoped to.
        /// </summary>
        [Output("projectId")]
        public Output<string> ProjectId { get; private set; } = null!;

        /// <summary>
        /// Flag indicating whether the API key shoud be read-only
        /// </summary>
        [Output("readOnly")]
        public Output<bool> ReadOnly { get; private set; } = null!;

        /// <summary>
        /// API token which can be used in Equinix Metal API clients
        /// </summary>
        [Output("token")]
        public Output<string> Token { get; private set; } = null!;


        /// <summary>
        /// Create a MetalProjectAPIKey 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 MetalProjectAPIKey(string name, MetalProjectAPIKeyArgs args, CustomResourceOptions? options = null)
            : base("equinix:index/metalProjectAPIKey:MetalProjectAPIKey", name, args ?? new MetalProjectAPIKeyArgs(), MakeResourceOptions(options, ""))
        {
        }

        private MetalProjectAPIKey(string name, Input<string> id, MetalProjectAPIKeyState? state = null, CustomResourceOptions? options = null)
            : base("equinix:index/metalProjectAPIKey:MetalProjectAPIKey", 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/cuemby",
            };
            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 MetalProjectAPIKey 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 MetalProjectAPIKey Get(string name, Input<string> id, MetalProjectAPIKeyState? state = null, CustomResourceOptions? options = null)
        {
            return new MetalProjectAPIKey(name, id, state, options);
        }
    }

    public sealed class MetalProjectAPIKeyArgs : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Description string for the Project API Key resource.
        /// * `read-only` - (Optional) Flag indicating whether the API key shoud be read-only.
        /// </summary>
        [Input("description", required: true)]
        public Input<string> Description { get; set; } = null!;

        /// <summary>
        /// UUID of the project where the API key is scoped to.
        /// </summary>
        [Input("projectId", required: true)]
        public Input<string> ProjectId { get; set; } = null!;

        /// <summary>
        /// Flag indicating whether the API key shoud be read-only
        /// </summary>
        [Input("readOnly", required: true)]
        public Input<bool> ReadOnly { get; set; } = null!;

        public MetalProjectAPIKeyArgs()
        {
        }
    }

    public sealed class MetalProjectAPIKeyState : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Description string for the Project API Key resource.
        /// * `read-only` - (Optional) Flag indicating whether the API key shoud be read-only.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// UUID of the project where the API key is scoped to.
        /// </summary>
        [Input("projectId")]
        public Input<string>? ProjectId { get; set; }

        /// <summary>
        /// Flag indicating whether the API key shoud be read-only
        /// </summary>
        [Input("readOnly")]
        public Input<bool>? ReadOnly { get; set; }

        /// <summary>
        /// API token which can be used in Equinix Metal API clients
        /// </summary>
        [Input("token")]
        public Input<string>? Token { get; set; }

        public MetalProjectAPIKeyState()
        {
        }
    }
}
