pulumi/tests/testdata/codegen/provider-config-schema/dotnet/Configstation/Provider.cs

72 lines
2.9 KiB
C#

// *** WARNING: this file was generated by test. ***
// *** 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 Configstation.Pulumi.Configstation
{
[ConfigstationResourceType("pulumi:providers:configstation")]
public partial class Provider : global::Pulumi.ProviderResource
{
/// <summary>
/// Create a Provider 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 Provider(string name, ProviderArgs? args = null, CustomResourceOptions? options = null)
: base("configstation", name, args ?? new ProviderArgs(), MakeResourceOptions(options, ""))
{
}
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;
}
}
public sealed class ProviderArgs : global::Pulumi.ResourceArgs
{
/// <summary>
/// this is a relaxed string enum which can also be set via env var
/// </summary>
[Input("favoriteColor", json: true)]
public InputUnion<string, Configstation.Pulumi.Configstation.Color>? FavoriteColor { get; set; }
[Input("secretSandwiches", json: true)]
private InputList<Configstation.Pulumi.Configstation.Config.Inputs.SandwichArgs>? _secretSandwiches;
/// <summary>
/// Super duper secret sandwiches.
/// </summary>
public InputList<Configstation.Pulumi.Configstation.Config.Inputs.SandwichArgs> SecretSandwiches
{
get => _secretSandwiches ?? (_secretSandwiches = new InputList<Configstation.Pulumi.Configstation.Config.Inputs.SandwichArgs>());
set
{
var emptySecret = Output.CreateSecret(ImmutableArray.Create<Configstation.Pulumi.Configstation.Config.Inputs.SandwichArgs>());
_secretSandwiches = Output.All(value, emptySecret).Apply(v => v[0]);
}
}
public ProviderArgs()
{
FavoriteColor = Utilities.GetEnv("FAVE_COLOR");
}
public static new ProviderArgs Empty => new ProviderArgs();
}
}