github.com/myhau/pulumi/pkg/v3@v3.70.2-0.20221116134521-f2775972e587/codegen/testing/test/testdata/external-resource-schema/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 * as pulumiRandom from "@pulumi/random";
    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 name!: pulumi.Output<string | undefined>;
    39  
    40      /**
    41       * Create a Cat resource with the given unique name, arguments, and options.
    42       *
    43       * @param name The _unique_ name of the resource.
    44       * @param args The arguments to use to populate this resource's properties.
    45       * @param opts A bag of options that control this resource's behavior.
    46       */
    47      constructor(name: string, args?: CatArgs, opts?: pulumi.CustomResourceOptions) {
    48          let resourceInputs: pulumi.Inputs = {};
    49          opts = opts || {};
    50          if (!opts.id) {
    51              resourceInputs["age"] = args ? args.age : undefined;
    52              resourceInputs["pet"] = args ? args.pet : undefined;
    53              resourceInputs["name"] = undefined /*out*/;
    54          } else {
    55              resourceInputs["name"] = undefined /*out*/;
    56          }
    57          opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
    58          super(Cat.__pulumiType, name, resourceInputs, opts);
    59      }
    60  }
    61  
    62  /**
    63   * The set of arguments for constructing a Cat resource.
    64   */
    65  export interface CatArgs {
    66      age?: pulumi.Input<number>;
    67      pet?: pulumi.Input<inputs.PetArgs>;
    68  }