github.com/myhau/pulumi/pkg/v3@v3.70.2-0.20221116134521-f2775972e587/codegen/testing/test/testdata/resource-args-python/dotnet/Person.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::Person")]
    13      public partial class Person : global::Pulumi.CustomResource
    14      {
    15          [Output("name")]
    16          public Output<string?> Name { get; private set; } = null!;
    17  
    18          [Output("pets")]
    19          public Output<ImmutableArray<Outputs.Pet>> Pets { get; private set; } = null!;
    20  
    21  
    22          /// <summary>
    23          /// Create a Person 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 Person(string name, PersonArgs? args = null, CustomResourceOptions? options = null)
    30              : base("example::Person", name, args ?? new PersonArgs(), MakeResourceOptions(options, ""))
    31          {
    32          }
    33  
    34          private Person(string name, Input<string> id, CustomResourceOptions? options = null)
    35              : base("example::Person", 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              };
    45              var merged = CustomResourceOptions.Merge(defaultOptions, options);
    46              // Override the ID if one was specified for consistency with other language SDKs.
    47              merged.Id = id ?? merged.Id;
    48              return merged;
    49          }
    50          /// <summary>
    51          /// Get an existing Person resource's state with the given name, ID, and optional extra
    52          /// properties used to qualify the lookup.
    53          /// </summary>
    54          ///
    55          /// <param name="name">The unique name of the resulting resource.</param>
    56          /// <param name="id">The unique provider ID of the resource to lookup.</param>
    57          /// <param name="options">A bag of options that control this resource's behavior</param>
    58          public static Person Get(string name, Input<string> id, CustomResourceOptions? options = null)
    59          {
    60              return new Person(name, id, options);
    61          }
    62      }
    63  
    64      public sealed class PersonArgs : global::Pulumi.ResourceArgs
    65      {
    66          [Input("name")]
    67          public Input<string>? Name { get; set; }
    68  
    69          [Input("pets")]
    70          private InputList<Inputs.PetArgs>? _pets;
    71          public InputList<Inputs.PetArgs> Pets
    72          {
    73              get => _pets ?? (_pets = new InputList<Inputs.PetArgs>());
    74              set => _pets = value;
    75          }
    76  
    77          public PersonArgs()
    78          {
    79          }
    80          public static new PersonArgs Empty => new PersonArgs();
    81      }
    82  }