pulumi/pkg/codegen/testing/test/testdata/plain-and-default/dotnet/ModuleResource.cs

146 lines
5.5 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 : global::Pulumi.CustomResource
{
[Output("optional_bool")]
public Output<bool?> Optional_bool { get; private set; } = null!;
/// <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.Optional_const = "val";
args.Plain_optional_const = "val";
args.Plain_required_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 : global::Pulumi.ResourceArgs
{
[Input("optional_bool")]
public Input<bool>? Optional_bool { get; set; }
[Input("optional_const")]
public Input<string>? Optional_const { get; set; }
[Input("optional_enum")]
public Input<Pulumi.FooBar.EnumThing>? Optional_enum { get; set; }
[Input("optional_number")]
public Input<double>? Optional_number { get; set; }
[Input("optional_string")]
public Input<string>? Optional_string { get; set; }
[Input("plain_optional_bool")]
public bool? Plain_optional_bool { get; set; }
[Input("plain_optional_const")]
public string? Plain_optional_const { 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_const", required: true)]
public string Plain_required_const { get; set; } = null!;
[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!;
public ModuleResourceArgs()
{
Optional_bool = true;
Optional_const = "another";
Optional_enum = Pulumi.FooBar.EnumThing.Eight;
Optional_number = 42;
Optional_string = "buzzer";
Plain_optional_bool = true;
Plain_optional_const = "another";
Plain_optional_number = 42;
Plain_optional_string = "buzzer";
Plain_required_bool = true;
Plain_required_const = "another";
Plain_required_number = 42;
Plain_required_string = "buzzer";
Required_bool = true;
Required_enum = Pulumi.FooBar.EnumThing.Four;
Required_number = 42;
Required_string = "buzzer";
}
public static new ModuleResourceArgs Empty => new ModuleResourceArgs();
}
}