github.com/myhau/pulumi/pkg/v3@v3.70.2-0.20221116134521-f2775972e587/codegen/testing/test/testdata/other-owned/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 using Pulumi; 10 11 namespace Other.Example 12 { 13 [ExampleResourceType("example::Resource")] 14 public partial class Resource : global::Pulumi.CustomResource 15 { 16 [Output("bar")] 17 public Output<string?> Bar { get; private set; } = null!; 18 19 20 /// <summary> 21 /// Create a Resource resource with the given unique name, arguments, and options. 22 /// </summary> 23 /// 24 /// <param name="name">The unique name of the resource</param> 25 /// <param name="args">The arguments used to populate this resource's properties</param> 26 /// <param name="options">A bag of options that control this resource's behavior</param> 27 public Resource(string name, ResourceArgs? args = null, CustomResourceOptions? options = null) 28 : base("example::Resource", name, args ?? new ResourceArgs(), MakeResourceOptions(options, "")) 29 { 30 } 31 32 private Resource(string name, Input<string> id, CustomResourceOptions? options = null) 33 : base("example::Resource", name, null, MakeResourceOptions(options, id)) 34 { 35 } 36 37 private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id) 38 { 39 var defaultOptions = new CustomResourceOptions 40 { 41 Version = Utilities.Version, 42 PluginDownloadURL = "example.com/download", 43 AdditionalSecretOutputs = 44 { 45 "bar", 46 }, 47 }; 48 var merged = CustomResourceOptions.Merge(defaultOptions, options); 49 // Override the ID if one was specified for consistency with other language SDKs. 50 merged.Id = id ?? merged.Id; 51 return merged; 52 } 53 /// <summary> 54 /// Get an existing Resource resource's state with the given name, ID, and optional extra 55 /// properties used to qualify the lookup. 56 /// </summary> 57 /// 58 /// <param name="name">The unique name of the resulting resource.</param> 59 /// <param name="id">The unique provider ID of the resource to lookup.</param> 60 /// <param name="options">A bag of options that control this resource's behavior</param> 61 public static Resource Get(string name, Input<string> id, CustomResourceOptions? options = null) 62 { 63 return new Resource(name, id, options); 64 } 65 } 66 67 public sealed class ResourceArgs : global::Pulumi.ResourceArgs 68 { 69 [Input("bar")] 70 private Input<string>? _bar; 71 public Input<string>? Bar 72 { 73 get => _bar; 74 set 75 { 76 var emptySecret = Output.CreateSecret(0); 77 _bar = Output.Tuple<Input<string>?, int>(value, emptySecret).Apply(t => t.Item1); 78 } 79 } 80 81 public ResourceArgs() 82 { 83 } 84 public static new ResourceArgs Empty => new ResourceArgs(); 85 } 86 }