github.com/myhau/pulumi/pkg/v3@v3.70.2-0.20221116134521-f2775972e587/codegen/testing/test/testdata/secrets/dotnet/Resource.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.Mypkg 11 { 12 [MypkgResourceType("mypkg::Resource")] 13 public partial class Resource : global::Pulumi.CustomResource 14 { 15 [Output("config")] 16 public Output<Outputs.Config> Config { get; private set; } = null!; 17 18 [Output("configArray")] 19 public Output<ImmutableArray<Outputs.Config>> ConfigArray { get; private set; } = null!; 20 21 [Output("configMap")] 22 public Output<ImmutableDictionary<string, Outputs.Config>> ConfigMap { get; private set; } = null!; 23 24 [Output("foo")] 25 public Output<string> Foo { get; private set; } = null!; 26 27 [Output("fooArray")] 28 public Output<ImmutableArray<string>> FooArray { get; private set; } = null!; 29 30 [Output("fooMap")] 31 public Output<ImmutableDictionary<string, string>> FooMap { get; private set; } = null!; 32 33 34 /// <summary> 35 /// Create a Resource resource with the given unique name, arguments, and options. 36 /// </summary> 37 /// 38 /// <param name="name">The unique name of the resource</param> 39 /// <param name="args">The arguments used to populate this resource's properties</param> 40 /// <param name="options">A bag of options that control this resource's behavior</param> 41 public Resource(string name, ResourceArgs args, CustomResourceOptions? options = null) 42 : base("mypkg::Resource", name, args ?? new ResourceArgs(), MakeResourceOptions(options, "")) 43 { 44 } 45 46 private Resource(string name, Input<string> id, CustomResourceOptions? options = null) 47 : base("mypkg::Resource", name, null, MakeResourceOptions(options, id)) 48 { 49 } 50 51 private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id) 52 { 53 var defaultOptions = new CustomResourceOptions 54 { 55 Version = Utilities.Version, 56 AdditionalSecretOutputs = 57 { 58 "config", 59 "configArray", 60 "configMap", 61 "foo", 62 "fooArray", 63 "fooMap", 64 }, 65 }; 66 var merged = CustomResourceOptions.Merge(defaultOptions, options); 67 // Override the ID if one was specified for consistency with other language SDKs. 68 merged.Id = id ?? merged.Id; 69 return merged; 70 } 71 /// <summary> 72 /// Get an existing Resource resource's state with the given name, ID, and optional extra 73 /// properties used to qualify the lookup. 74 /// </summary> 75 /// 76 /// <param name="name">The unique name of the resulting resource.</param> 77 /// <param name="id">The unique provider ID of the resource to lookup.</param> 78 /// <param name="options">A bag of options that control this resource's behavior</param> 79 public static Resource Get(string name, Input<string> id, CustomResourceOptions? options = null) 80 { 81 return new Resource(name, id, options); 82 } 83 } 84 85 public sealed class ResourceArgs : global::Pulumi.ResourceArgs 86 { 87 [Input("config", required: true)] 88 private Input<Inputs.ConfigArgs>? _config; 89 public Input<Inputs.ConfigArgs>? Config 90 { 91 get => _config; 92 set 93 { 94 var emptySecret = Output.CreateSecret(0); 95 _config = Output.Tuple<Input<Inputs.ConfigArgs>?, int>(value, emptySecret).Apply(t => t.Item1); 96 } 97 } 98 99 [Input("configArray", required: true)] 100 private InputList<Inputs.ConfigArgs>? _configArray; 101 public InputList<Inputs.ConfigArgs> ConfigArray 102 { 103 get => _configArray ?? (_configArray = new InputList<Inputs.ConfigArgs>()); 104 set 105 { 106 var emptySecret = Output.CreateSecret(ImmutableArray.Create<Inputs.ConfigArgs>()); 107 _configArray = Output.All(value, emptySecret).Apply(v => v[0]); 108 } 109 } 110 111 [Input("configMap", required: true)] 112 private InputMap<Inputs.ConfigArgs>? _configMap; 113 public InputMap<Inputs.ConfigArgs> ConfigMap 114 { 115 get => _configMap ?? (_configMap = new InputMap<Inputs.ConfigArgs>()); 116 set 117 { 118 var emptySecret = Output.CreateSecret(ImmutableDictionary.Create<string, Inputs.ConfigArgs>()); 119 _configMap = Output.All(value, emptySecret).Apply(v => v[0]); 120 } 121 } 122 123 [Input("foo", required: true)] 124 private Input<string>? _foo; 125 public Input<string>? Foo 126 { 127 get => _foo; 128 set 129 { 130 var emptySecret = Output.CreateSecret(0); 131 _foo = Output.Tuple<Input<string>?, int>(value, emptySecret).Apply(t => t.Item1); 132 } 133 } 134 135 [Input("fooArray", required: true)] 136 private InputList<string>? _fooArray; 137 public InputList<string> FooArray 138 { 139 get => _fooArray ?? (_fooArray = new InputList<string>()); 140 set 141 { 142 var emptySecret = Output.CreateSecret(ImmutableArray.Create<string>()); 143 _fooArray = Output.All(value, emptySecret).Apply(v => v[0]); 144 } 145 } 146 147 [Input("fooMap", required: true)] 148 private InputMap<string>? _fooMap; 149 public InputMap<string> FooMap 150 { 151 get => _fooMap ?? (_fooMap = new InputMap<string>()); 152 set 153 { 154 var emptySecret = Output.CreateSecret(ImmutableDictionary.Create<string, string>()); 155 _fooMap = Output.All(value, emptySecret).Apply(v => v[0]); 156 } 157 } 158 159 public ResourceArgs() 160 { 161 } 162 public static new ResourceArgs Empty => new ResourceArgs(); 163 } 164 }