github.com/myhau/pulumi/pkg/v3@v3.70.2-0.20221116134521-f2775972e587/codegen/testing/test/testdata/plain-object-disable-defaults/nodejs/foo.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  /**
    10   * test new feature with resoruces
    11   */
    12  export class Foo extends pulumi.CustomResource {
    13      /**
    14       * Get an existing Foo resource's state with the given name, ID, and optional extra
    15       * properties used to qualify the lookup.
    16       *
    17       * @param name The _unique_ name of the resulting resource.
    18       * @param id The _unique_ provider ID of the resource to lookup.
    19       * @param opts Optional settings to control the behavior of the CustomResource.
    20       */
    21      public static get(name: string, id: pulumi.Input<pulumi.ID>, opts?: pulumi.CustomResourceOptions): Foo {
    22          return new Foo(name, undefined as any, { ...opts, id: id });
    23      }
    24  
    25      /** @internal */
    26      public static readonly __pulumiType = 'example:index:Foo';
    27  
    28      /**
    29       * Returns true if the given object is an instance of Foo.  This is designed to work even
    30       * when multiple copies of the Pulumi SDK have been loaded into the same process.
    31       */
    32      public static isInstance(obj: any): obj is Foo {
    33          if (obj === undefined || obj === null) {
    34              return false;
    35          }
    36          return obj['__pulumiType'] === Foo.__pulumiType;
    37      }
    38  
    39      /**
    40       * A test for plain types
    41       */
    42      public /*out*/ readonly defaultKubeClientSettings!: pulumi.Output<outputs.KubeClientSettings | undefined>;
    43  
    44      /**
    45       * Create a Foo 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: FooArgs, opts?: pulumi.CustomResourceOptions) {
    52          let resourceInputs: pulumi.Inputs = {};
    53          opts = opts || {};
    54          if (!opts.id) {
    55              if ((!args || args.backupKubeClientSettings === undefined) && !opts.urn) {
    56                  throw new Error("Missing required property 'backupKubeClientSettings'");
    57              }
    58              resourceInputs["argument"] = args ? args.argument : undefined;
    59              resourceInputs["backupKubeClientSettings"] = args ? (args.backupKubeClientSettings ? pulumi.output(args.backupKubeClientSettings).apply(inputs.kubeClientSettingsArgsProvideDefaults) : undefined) : undefined;
    60              resourceInputs["kubeClientSettings"] = args ? (args.kubeClientSettings ? pulumi.output(args.kubeClientSettings).apply(inputs.kubeClientSettingsArgsProvideDefaults) : undefined) : undefined;
    61              resourceInputs["settings"] = args ? (args.settings ? pulumi.output(args.settings).apply(inputs.layeredTypeArgsProvideDefaults) : undefined) : undefined;
    62              resourceInputs["defaultKubeClientSettings"] = undefined /*out*/;
    63          } else {
    64              resourceInputs["defaultKubeClientSettings"] = undefined /*out*/;
    65          }
    66          opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
    67          super(Foo.__pulumiType, name, resourceInputs, opts);
    68      }
    69  }
    70  
    71  /**
    72   * The set of arguments for constructing a Foo resource.
    73   */
    74  export interface FooArgs {
    75      argument?: string;
    76      /**
    77       * Options for tuning the Kubernetes client used by a Provider.
    78       */
    79      backupKubeClientSettings: pulumi.Input<inputs.KubeClientSettingsArgs>;
    80      /**
    81       * Options for tuning the Kubernetes client used by a Provider.
    82       */
    83      kubeClientSettings?: pulumi.Input<inputs.KubeClientSettingsArgs>;
    84      /**
    85       * describing things
    86       */
    87      settings?: pulumi.Input<inputs.LayeredTypeArgs>;
    88  }