github.com/myhau/pulumi/pkg/v3@v3.70.2-0.20221116134521-f2775972e587/codegen/testing/test/testdata/plain-and-default/dotnet/ModuleResource.cs (about) 1 // *** WARNING: this file was generated by test. *** 2 // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 4 using System; 5 using System.Collections.Generic; 6 using System.Collections.Immutable; 7 using System.Threading.Tasks; 8 using Pulumi.Serialization; 9 10 namespace Pulumi.FooBar 11 { 12 [FooBarResourceType("foobar::ModuleResource")] 13 public partial class ModuleResource : global::Pulumi.CustomResource 14 { 15 /// <summary> 16 /// Create a ModuleResource resource with the given unique name, arguments, and options. 17 /// </summary> 18 /// 19 /// <param name="name">The unique name of the resource</param> 20 /// <param name="args">The arguments used to populate this resource's properties</param> 21 /// <param name="options">A bag of options that control this resource's behavior</param> 22 public ModuleResource(string name, ModuleResourceArgs args, CustomResourceOptions? options = null) 23 : base("foobar::ModuleResource", name, MakeArgs(args), MakeResourceOptions(options, "")) 24 { 25 } 26 27 private ModuleResource(string name, Input<string> id, CustomResourceOptions? options = null) 28 : base("foobar::ModuleResource", name, null, MakeResourceOptions(options, id)) 29 { 30 } 31 32 private static ModuleResourceArgs MakeArgs(ModuleResourceArgs args) 33 { 34 args ??= new ModuleResourceArgs(); 35 args.Optional_const = "val"; 36 args.Plain_optional_const = "val"; 37 args.Plain_required_const = "val"; 38 return args; 39 } 40 41 private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id) 42 { 43 var defaultOptions = new CustomResourceOptions 44 { 45 Version = Utilities.Version, 46 }; 47 var merged = CustomResourceOptions.Merge(defaultOptions, options); 48 // Override the ID if one was specified for consistency with other language SDKs. 49 merged.Id = id ?? merged.Id; 50 return merged; 51 } 52 /// <summary> 53 /// Get an existing ModuleResource resource's state with the given name, ID, and optional extra 54 /// properties used to qualify the lookup. 55 /// </summary> 56 /// 57 /// <param name="name">The unique name of the resulting resource.</param> 58 /// <param name="id">The unique provider ID of the resource to lookup.</param> 59 /// <param name="options">A bag of options that control this resource's behavior</param> 60 public static ModuleResource Get(string name, Input<string> id, CustomResourceOptions? options = null) 61 { 62 return new ModuleResource(name, id, options); 63 } 64 } 65 66 public sealed class ModuleResourceArgs : global::Pulumi.ResourceArgs 67 { 68 [Input("optional_bool")] 69 public Input<bool>? Optional_bool { get; set; } 70 71 [Input("optional_const")] 72 public Input<string>? Optional_const { get; set; } 73 74 [Input("optional_enum")] 75 public Input<Pulumi.FooBar.EnumThing>? Optional_enum { get; set; } 76 77 [Input("optional_number")] 78 public Input<double>? Optional_number { get; set; } 79 80 [Input("optional_string")] 81 public Input<string>? Optional_string { get; set; } 82 83 [Input("plain_optional_bool")] 84 public bool? Plain_optional_bool { get; set; } 85 86 [Input("plain_optional_const")] 87 public string? Plain_optional_const { get; set; } 88 89 [Input("plain_optional_number")] 90 public double? Plain_optional_number { get; set; } 91 92 [Input("plain_optional_string")] 93 public string? Plain_optional_string { get; set; } 94 95 [Input("plain_required_bool", required: true)] 96 public bool Plain_required_bool { get; set; } 97 98 [Input("plain_required_const", required: true)] 99 public string Plain_required_const { get; set; } = null!; 100 101 [Input("plain_required_number", required: true)] 102 public double Plain_required_number { get; set; } 103 104 [Input("plain_required_string", required: true)] 105 public string Plain_required_string { get; set; } = null!; 106 107 [Input("required_bool", required: true)] 108 public Input<bool> Required_bool { get; set; } = null!; 109 110 [Input("required_enum", required: true)] 111 public Input<Pulumi.FooBar.EnumThing> Required_enum { get; set; } = null!; 112 113 [Input("required_number", required: true)] 114 public Input<double> Required_number { get; set; } = null!; 115 116 [Input("required_string", required: true)] 117 public Input<string> Required_string { get; set; } = null!; 118 119 public ModuleResourceArgs() 120 { 121 Optional_bool = true; 122 Optional_const = "another"; 123 Optional_enum = Pulumi.FooBar.EnumThing.Eight; 124 Optional_number = 42; 125 Optional_string = "buzzer"; 126 Plain_optional_bool = true; 127 Plain_optional_const = "another"; 128 Plain_optional_number = 42; 129 Plain_optional_string = "buzzer"; 130 Plain_required_bool = true; 131 Plain_required_const = "another"; 132 Plain_required_number = 42; 133 Plain_required_string = "buzzer"; 134 Required_bool = true; 135 Required_enum = Pulumi.FooBar.EnumThing.Four; 136 Required_number = 42; 137 Required_string = "buzzer"; 138 } 139 public static new ModuleResourceArgs Empty => new ModuleResourceArgs(); 140 } 141 }