// *** 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 PiersKarsenbarg.Codefresh
{
    /// <summary>
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using Codefresh = PiersKarsenbarg.Codefresh;
    /// using Random = Pulumi.Random;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var test = new Codefresh.Account("test");
    /// 
    ///     var random = new Random.RandomString("random", new()
    ///     {
    ///         Length = 16,
    ///         Special = false,
    ///     });
    /// 
    ///     var @new = new Codefresh.ApiKey("new", new()
    ///     {
    ///         AccountId = test.Id,
    ///         UserId = data.Codefresh_account.Test_account_user.User_id,
    ///         Scopes = new[]
    ///         {
    ///             "agent",
    ///             "agents",
    ///             "audit",
    ///             "build",
    ///             "cluster",
    ///             "clusters",
    ///             "environments-v2",
    ///             "github-action",
    ///             "helm",
    ///             "kubernetes",
    ///             "pipeline",
    ///             "project",
    ///             "repos",
    ///             "runner-installation",
    ///             "step-type",
    ///             "step-types",
    ///             "view",
    ///             "workflow",
    ///         },
    ///     });
    /// 
    ///     var newAccount = new Codefresh.Provider("newAccount", new()
    ///     {
    ///         ApiUrl = "my API URL",
    ///         Token = @new.Token,
    ///     });
    /// 
    ///     var team1 = new Codefresh.Team("team1", new()
    ///     {
    ///     }, new CustomResourceOptions
    ///     {
    ///         Provider = codefresh.New_account,
    ///     });
    /// 
    /// });
    /// ```
    /// </summary>
    [CodefreshResourceType("codefresh:index/apiKey:ApiKey")]
    public partial class ApiKey : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The ID of account in which the API key will be created.
        /// </summary>
        [Output("accountId")]
        public Output<string> AccountId { get; private set; } = null!;

        /// <summary>
        /// The display name for the API key.
        /// </summary>
        [Output("name")]
        public Output<string> Name { get; private set; } = null!;

        /// <summary>
        /// A list of access scopes, that can be targeted. The possible values:
        /// - `agent`
        /// - `agents`
        /// - `audit`
        /// - `build`
        /// - `cluster`
        /// - `clusters`
        /// - `environments-v2`
        /// - `github-action`
        /// - `helm`
        /// - `kubernetes`
        /// - `pipeline`
        /// - `project`
        /// - `repos`
        /// - `runner-installation`
        /// - `step-type`
        /// - `step-types`
        /// - `view`
        /// - `workflow`
        /// </summary>
        [Output("scopes")]
        public Output<ImmutableArray<string>> Scopes { get; private set; } = null!;

        /// <summary>
        /// The Token, that should used as a new provider's token attribute.
        /// </summary>
        [Output("token")]
        public Output<string> Token { get; private set; } = null!;

        /// <summary>
        /// The ID of a user within the referenced `account_id` that will own the API key.
        /// </summary>
        [Output("userId")]
        public Output<string> UserId { get; private set; } = null!;


        /// <summary>
        /// Create a ApiKey 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 ApiKey(string name, ApiKeyArgs args, CustomResourceOptions? options = null)
            : base("codefresh:index/apiKey:ApiKey", name, args ?? new ApiKeyArgs(), MakeResourceOptions(options, ""))
        {
        }

        private ApiKey(string name, Input<string> id, ApiKeyState? state = null, CustomResourceOptions? options = null)
            : base("codefresh:index/apiKey:ApiKey", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
            };
            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 ApiKey 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 ApiKey Get(string name, Input<string> id, ApiKeyState? state = null, CustomResourceOptions? options = null)
        {
            return new ApiKey(name, id, state, options);
        }
    }

    public sealed class ApiKeyArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The ID of account in which the API key will be created.
        /// </summary>
        [Input("accountId", required: true)]
        public Input<string> AccountId { get; set; } = null!;

        /// <summary>
        /// The display name for the API key.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        [Input("scopes")]
        private InputList<string>? _scopes;

        /// <summary>
        /// A list of access scopes, that can be targeted. The possible values:
        /// - `agent`
        /// - `agents`
        /// - `audit`
        /// - `build`
        /// - `cluster`
        /// - `clusters`
        /// - `environments-v2`
        /// - `github-action`
        /// - `helm`
        /// - `kubernetes`
        /// - `pipeline`
        /// - `project`
        /// - `repos`
        /// - `runner-installation`
        /// - `step-type`
        /// - `step-types`
        /// - `view`
        /// - `workflow`
        /// </summary>
        public InputList<string> Scopes
        {
            get => _scopes ?? (_scopes = new InputList<string>());
            set => _scopes = value;
        }

        /// <summary>
        /// The ID of a user within the referenced `account_id` that will own the API key.
        /// </summary>
        [Input("userId", required: true)]
        public Input<string> UserId { get; set; } = null!;

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

    public sealed class ApiKeyState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The ID of account in which the API key will be created.
        /// </summary>
        [Input("accountId")]
        public Input<string>? AccountId { get; set; }

        /// <summary>
        /// The display name for the API key.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        [Input("scopes")]
        private InputList<string>? _scopes;

        /// <summary>
        /// A list of access scopes, that can be targeted. The possible values:
        /// - `agent`
        /// - `agents`
        /// - `audit`
        /// - `build`
        /// - `cluster`
        /// - `clusters`
        /// - `environments-v2`
        /// - `github-action`
        /// - `helm`
        /// - `kubernetes`
        /// - `pipeline`
        /// - `project`
        /// - `repos`
        /// - `runner-installation`
        /// - `step-type`
        /// - `step-types`
        /// - `view`
        /// - `workflow`
        /// </summary>
        public InputList<string> Scopes
        {
            get => _scopes ?? (_scopes = new InputList<string>());
            set => _scopes = value;
        }

        /// <summary>
        /// The Token, that should used as a new provider's token attribute.
        /// </summary>
        [Input("token")]
        public Input<string>? Token { get; set; }

        /// <summary>
        /// The ID of a user within the referenced `account_id` that will own the API key.
        /// </summary>
        [Input("userId")]
        public Input<string>? UserId { get; set; }

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