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