github.com/myhau/pulumi/pkg/v3@v3.70.2-0.20221116134521-f2775972e587/codegen/testing/test/testdata/replace-on-change/nodejs/cat.ts (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  import * as pulumi from "@pulumi/pulumi";
     5  import * as inputs from "./types/input";
     6  import * as outputs from "./types/output";
     7  import * as utilities from "./utilities";
     8  
     9  import {God} from "./index";
    10  
    11  export class Cat extends pulumi.CustomResource {
    12      /**
    13       * Get an existing Cat resource's state with the given name, ID, and optional extra
    14       * properties used to qualify the lookup.
    15       *
    16       * @param name The _unique_ name of the resulting resource.
    17       * @param id The _unique_ provider ID of the resource to lookup.
    18       * @param opts Optional settings to control the behavior of the CustomResource.
    19       */
    20      public static get(name: string, id: pulumi.Input<pulumi.ID>, opts?: pulumi.CustomResourceOptions): Cat {
    21          return new Cat(name, undefined as any, { ...opts, id: id });
    22      }
    23  
    24      /** @internal */
    25      public static readonly __pulumiType = 'example::Cat';
    26  
    27      /**
    28       * Returns true if the given object is an instance of Cat.  This is designed to work even
    29       * when multiple copies of the Pulumi SDK have been loaded into the same process.
    30       */
    31      public static isInstance(obj: any): obj is Cat {
    32          if (obj === undefined || obj === null) {
    33              return false;
    34          }
    35          return obj['__pulumiType'] === Cat.__pulumiType;
    36      }
    37  
    38      public /*out*/ readonly foes!: pulumi.Output<{[key: string]: outputs.Toy} | undefined>;
    39      public /*out*/ readonly friends!: pulumi.Output<outputs.Toy[] | undefined>;
    40      public /*out*/ readonly name!: pulumi.Output<string | undefined>;
    41      public /*out*/ readonly other!: pulumi.Output<God | undefined>;
    42      public /*out*/ readonly toy!: pulumi.Output<outputs.Toy | undefined>;
    43  
    44      /**
    45       * Create a Cat resource with the given unique name, arguments, and options.
    46       *
    47       * @param name The _unique_ name of the resource.
    48       * @param args The arguments to use to populate this resource's properties.
    49       * @param opts A bag of options that control this resource's behavior.
    50       */
    51      constructor(name: string, args?: CatArgs, opts?: pulumi.CustomResourceOptions) {
    52          let resourceInputs: pulumi.Inputs = {};
    53          opts = opts || {};
    54          if (!opts.id) {
    55              resourceInputs["foes"] = undefined /*out*/;
    56              resourceInputs["friends"] = undefined /*out*/;
    57              resourceInputs["name"] = undefined /*out*/;
    58              resourceInputs["other"] = undefined /*out*/;
    59              resourceInputs["toy"] = undefined /*out*/;
    60          } else {
    61              resourceInputs["foes"] = undefined /*out*/;
    62              resourceInputs["friends"] = undefined /*out*/;
    63              resourceInputs["name"] = undefined /*out*/;
    64              resourceInputs["other"] = undefined /*out*/;
    65              resourceInputs["toy"] = undefined /*out*/;
    66          }
    67          opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
    68          const secretOpts = { additionalSecretOutputs: ["name"] };
    69          opts = pulumi.mergeOptions(opts, secretOpts);
    70          const replaceOnChanges = { replaceOnChanges: ["foes.*.associated.color", "foes.*.color", "friends[*].associated.color", "friends[*].color", "name", "toy.color"] };
    71          opts = pulumi.mergeOptions(opts, replaceOnChanges);
    72          super(Cat.__pulumiType, name, resourceInputs, opts);
    73      }
    74  }
    75  
    76  /**
    77   * The set of arguments for constructing a Cat resource.
    78   */
    79  export interface CatArgs {
    80  }