github.com/myhau/pulumi/pkg/v3@v3.70.2-0.20221116134521-f2775972e587/codegen/testing/test/testdata/replace-on-change/dotnet/ToyStore.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::ToyStore")]
    13      public partial class ToyStore : global::Pulumi.CustomResource
    14      {
    15          [Output("chew")]
    16          public Output<Outputs.Chew?> Chew { get; private set; } = null!;
    17  
    18          [Output("laser")]
    19          public Output<Outputs.Laser?> Laser { get; private set; } = null!;
    20  
    21          [Output("stuff")]
    22          public Output<ImmutableArray<Outputs.Toy>> Stuff { get; private set; } = null!;
    23  
    24          [Output("wanted")]
    25          public Output<ImmutableArray<Outputs.Toy>> Wanted { get; private set; } = null!;
    26  
    27  
    28          /// <summary>
    29          /// Create a ToyStore resource with the given unique name, arguments, and options.
    30          /// </summary>
    31          ///
    32          /// <param name="name">The unique name of the resource</param>
    33          /// <param name="args">The arguments used to populate this resource's properties</param>
    34          /// <param name="options">A bag of options that control this resource's behavior</param>
    35          public ToyStore(string name, ToyStoreArgs? args = null, CustomResourceOptions? options = null)
    36              : base("example::ToyStore", name, args ?? new ToyStoreArgs(), MakeResourceOptions(options, ""))
    37          {
    38          }
    39  
    40          private ToyStore(string name, Input<string> id, CustomResourceOptions? options = null)
    41              : base("example::ToyStore", name, null, MakeResourceOptions(options, id))
    42          {
    43          }
    44  
    45          private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
    46          {
    47              var defaultOptions = new CustomResourceOptions
    48              {
    49                  Version = Utilities.Version,
    50                  ReplaceOnChanges =
    51                  {
    52                      "chew.owner",
    53                      "laser.batteries",
    54                      "stuff[*].associated.color",
    55                      "stuff[*].color",
    56                      "wanted[*]",
    57                  },
    58              };
    59              var merged = CustomResourceOptions.Merge(defaultOptions, options);
    60              // Override the ID if one was specified for consistency with other language SDKs.
    61              merged.Id = id ?? merged.Id;
    62              return merged;
    63          }
    64          /// <summary>
    65          /// Get an existing ToyStore resource's state with the given name, ID, and optional extra
    66          /// properties used to qualify the lookup.
    67          /// </summary>
    68          ///
    69          /// <param name="name">The unique name of the resulting resource.</param>
    70          /// <param name="id">The unique provider ID of the resource to lookup.</param>
    71          /// <param name="options">A bag of options that control this resource's behavior</param>
    72          public static ToyStore Get(string name, Input<string> id, CustomResourceOptions? options = null)
    73          {
    74              return new ToyStore(name, id, options);
    75          }
    76      }
    77  
    78      public sealed class ToyStoreArgs : global::Pulumi.ResourceArgs
    79      {
    80          public ToyStoreArgs()
    81          {
    82          }
    83          public static new ToyStoreArgs Empty => new ToyStoreArgs();
    84      }
    85  }