<filename>sdk/dotnet/IotCoreDevice.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;

namespace Pulumi.Yandex
{
    /// <summary>
    /// Allows management of [Yandex.Cloud IoT Device](https://cloud.yandex.com/docs/iot-core/quickstart).
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using Yandex = Pulumi.Yandex;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var myDevice = new Yandex.IotCoreDevice("myDevice", new()
    ///     {
    ///         Aliases = 
    ///         {
    ///             { "some_alias1/subtopic", "$devices/{id}/events/somesubtopic" },
    ///             { "some_alias2/subtopic", "$devices/{id}/events/aaa/bbb" },
    ///         },
    ///         Certificates = new[]
    ///         {
    ///             "public part of certificate1",
    ///             "public part of certificate2",
    ///         },
    ///         Description = "any description",
    ///         Passwords = new[]
    ///         {
    ///             "my-password1",
    ///             "my-password2",
    ///         },
    ///         RegistryId = "are1sampleregistryid11",
    ///     });
    /// 
    /// });
    /// ```
    /// </summary>
    [YandexResourceType("yandex:index/iotCoreDevice:IotCoreDevice")]
    public partial class IotCoreDevice : global::Pulumi.CustomResource
    {
        /// <summary>
        /// A set of key/value aliases pairs to assign to the IoT Core Device
        /// </summary>
        [Output("aliases")]
        public Output<ImmutableDictionary<string, string>?> Aliases { get; private set; } = null!;

        /// <summary>
        /// A set of certificate's fingerprints for the IoT Core Device
        /// </summary>
        [Output("certificates")]
        public Output<ImmutableArray<string>> Certificates { get; private set; } = null!;

        /// <summary>
        /// Creation timestamp of the IoT Core Device
        /// </summary>
        [Output("createdAt")]
        public Output<string> CreatedAt { get; private set; } = null!;

        /// <summary>
        /// Description of the IoT Core Device
        /// </summary>
        [Output("description")]
        public Output<string?> Description { get; private set; } = null!;

        /// <summary>
        /// IoT Core Device name used to define device
        /// </summary>
        [Output("name")]
        public Output<string> Name { get; private set; } = null!;

        /// <summary>
        /// A set of passwords's id for the IoT Core Device
        /// </summary>
        [Output("passwords")]
        public Output<ImmutableArray<string>> Passwords { get; private set; } = null!;

        /// <summary>
        /// IoT Core Registry ID for the IoT Core Device
        /// </summary>
        [Output("registryId")]
        public Output<string> RegistryId { get; private set; } = null!;


        /// <summary>
        /// Create a IotCoreDevice 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 IotCoreDevice(string name, IotCoreDeviceArgs args, CustomResourceOptions? options = null)
            : base("yandex:index/iotCoreDevice:IotCoreDevice", name, args ?? new IotCoreDeviceArgs(), MakeResourceOptions(options, ""))
        {
        }

        private IotCoreDevice(string name, Input<string> id, IotCoreDeviceState? state = null, CustomResourceOptions? options = null)
            : base("yandex:index/iotCoreDevice:IotCoreDevice", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
                PluginDownloadURL = "https://github.com/regrau/pulumi-yandex/releases",
                AdditionalSecretOutputs =
                {
                    "passwords",
                },
            };
            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 IotCoreDevice 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 IotCoreDevice Get(string name, Input<string> id, IotCoreDeviceState? state = null, CustomResourceOptions? options = null)
        {
            return new IotCoreDevice(name, id, state, options);
        }
    }

    public sealed class IotCoreDeviceArgs : global::Pulumi.ResourceArgs
    {
        [Input("aliases")]
        private InputMap<string>? _aliases;

        /// <summary>
        /// A set of key/value aliases pairs to assign to the IoT Core Device
        /// </summary>
        public InputMap<string> Aliases
        {
            get => _aliases ?? (_aliases = new InputMap<string>());
            set => _aliases = value;
        }

        [Input("certificates")]
        private InputList<string>? _certificates;

        /// <summary>
        /// A set of certificate's fingerprints for the IoT Core Device
        /// </summary>
        public InputList<string> Certificates
        {
            get => _certificates ?? (_certificates = new InputList<string>());
            set => _certificates = value;
        }

        /// <summary>
        /// Description of the IoT Core Device
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// IoT Core Device name used to define device
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        [Input("passwords")]
        private InputList<string>? _passwords;

        /// <summary>
        /// A set of passwords's id for the IoT Core Device
        /// </summary>
        public InputList<string> Passwords
        {
            get => _passwords ?? (_passwords = new InputList<string>());
            set
            {
                var emptySecret = Output.CreateSecret(ImmutableArray.Create<string>());
                _passwords = Output.All(value, emptySecret).Apply(v => v[0]);
            }
        }

        /// <summary>
        /// IoT Core Registry ID for the IoT Core Device
        /// </summary>
        [Input("registryId", required: true)]
        public Input<string> RegistryId { get; set; } = null!;

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

    public sealed class IotCoreDeviceState : global::Pulumi.ResourceArgs
    {
        [Input("aliases")]
        private InputMap<string>? _aliases;

        /// <summary>
        /// A set of key/value aliases pairs to assign to the IoT Core Device
        /// </summary>
        public InputMap<string> Aliases
        {
            get => _aliases ?? (_aliases = new InputMap<string>());
            set => _aliases = value;
        }

        [Input("certificates")]
        private InputList<string>? _certificates;

        /// <summary>
        /// A set of certificate's fingerprints for the IoT Core Device
        /// </summary>
        public InputList<string> Certificates
        {
            get => _certificates ?? (_certificates = new InputList<string>());
            set => _certificates = value;
        }

        /// <summary>
        /// Creation timestamp of the IoT Core Device
        /// </summary>
        [Input("createdAt")]
        public Input<string>? CreatedAt { get; set; }

        /// <summary>
        /// Description of the IoT Core Device
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// IoT Core Device name used to define device
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        [Input("passwords")]
        private InputList<string>? _passwords;

        /// <summary>
        /// A set of passwords's id for the IoT Core Device
        /// </summary>
        public InputList<string> Passwords
        {
            get => _passwords ?? (_passwords = new InputList<string>());
            set
            {
                var emptySecret = Output.CreateSecret(ImmutableArray.Create<string>());
                _passwords = Output.All(value, emptySecret).Apply(v => v[0]);
            }
        }

        /// <summary>
        /// IoT Core Registry ID for the IoT Core Device
        /// </summary>
        [Input("registryId")]
        public Input<string>? RegistryId { get; set; }

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