pulumi/pkg/codegen/internal/test/testdata/plain-and-default/dotnet/ModuleResource.cs
2021-11-08 15:43:36 -08:00

130 lines
4.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;
namespace Pulumi.FooBar
{
[FooBarResourceType("foobar::ModuleResource")]
public partial class ModuleResource : Pulumi.CustomResource
{
/// <summary>
/// Create a ModuleResource 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 ModuleResource(string name, ModuleResourceArgs args, CustomResourceOptions? options = null)
: base("foobar::ModuleResource", name, MakeArgs(args), MakeResourceOptions(options, ""))
{
}
private ModuleResource(string name, Input<string> id, CustomResourceOptions? options = null)
: base("foobar::ModuleResource", name, null, MakeResourceOptions(options, id))
{
}
private static ModuleResourceArgs MakeArgs(ModuleResourceArgs args)
{
args ??= new ModuleResourceArgs();
args.String_const = "val";
return args;
}
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 ModuleResource 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="options">A bag of options that control this resource's behavior</param>
public static ModuleResource Get(string name, Input<string> id, CustomResourceOptions? options = null)
{
return new ModuleResource(name, id, options);
}
}
public sealed class ModuleResourceArgs : Pulumi.ResourceArgs
{
[Input("default_bool")]
public Input<bool>? Default_bool { get; set; }
[Input("default_enum")]
public Input<Pulumi.FooBar.EnumThing>? Default_enum { get; set; }
[Input("default_number")]
public Input<double>? Default_number { get; set; }
[Input("default_string")]
public Input<string>? Default_string { get; set; }
[Input("optional_enum")]
public Input<Pulumi.FooBar.EnumThing>? Optional_enum { get; set; }
[Input("plain_optional_bool")]
public bool? Plain_optional_bool { get; set; }
[Input("plain_optional_number")]
public double? Plain_optional_number { get; set; }
[Input("plain_optional_string")]
public string? Plain_optional_string { get; set; }
[Input("plain_required_bool", required: true)]
public bool Plain_required_bool { get; set; }
[Input("plain_required_enum", required: true)]
public Pulumi.FooBar.EnumThing Plain_required_enum { get; set; }
[Input("plain_required_number", required: true)]
public double Plain_required_number { get; set; }
[Input("plain_required_string", required: true)]
public string Plain_required_string { get; set; } = null!;
[Input("required_bool", required: true)]
public Input<bool> Required_bool { get; set; } = null!;
[Input("required_enum", required: true)]
public Input<Pulumi.FooBar.EnumThing> Required_enum { get; set; } = null!;
[Input("required_number", required: true)]
public Input<double> Required_number { get; set; } = null!;
[Input("required_string", required: true)]
public Input<string> Required_string { get; set; } = null!;
[Input("string_const")]
public Input<string>? String_const { get; set; }
public ModuleResourceArgs()
{
Default_bool = true;
Default_enum = Pulumi.FooBar.EnumThing.Four;
Default_number = 42;
Default_string = "buzzer";
Optional_enum = Pulumi.FooBar.EnumThing.Eight;
Plain_optional_bool = true;
Plain_optional_number = 42;
Plain_optional_string = "buzzer";
}
}
}