github.com/myhau/pulumi/pkg/v3@v3.70.2-0.20221116134521-f2775972e587/codegen/testing/test/testdata/different-enum/nodejs/tree/v1/nursery.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 enums from "../../types/enums";
     8  import * as utilities from "../../utilities";
     9  
    10  export class Nursery extends pulumi.CustomResource {
    11      /**
    12       * Get an existing Nursery resource's state with the given name, ID, and optional extra
    13       * properties used to qualify the lookup.
    14       *
    15       * @param name The _unique_ name of the resulting resource.
    16       * @param id The _unique_ provider ID of the resource to lookup.
    17       * @param opts Optional settings to control the behavior of the CustomResource.
    18       */
    19      public static get(name: string, id: pulumi.Input<pulumi.ID>, opts?: pulumi.CustomResourceOptions): Nursery {
    20          return new Nursery(name, undefined as any, { ...opts, id: id });
    21      }
    22  
    23      /** @internal */
    24      public static readonly __pulumiType = 'plant:tree/v1:Nursery';
    25  
    26      /**
    27       * Returns true if the given object is an instance of Nursery.  This is designed to work even
    28       * when multiple copies of the Pulumi SDK have been loaded into the same process.
    29       */
    30      public static isInstance(obj: any): obj is Nursery {
    31          if (obj === undefined || obj === null) {
    32              return false;
    33          }
    34          return obj['__pulumiType'] === Nursery.__pulumiType;
    35      }
    36  
    37  
    38      /**
    39       * Create a Nursery resource with the given unique name, arguments, and options.
    40       *
    41       * @param name The _unique_ name of the resource.
    42       * @param args The arguments to use to populate this resource's properties.
    43       * @param opts A bag of options that control this resource's behavior.
    44       */
    45      constructor(name: string, args: NurseryArgs, opts?: pulumi.CustomResourceOptions) {
    46          let resourceInputs: pulumi.Inputs = {};
    47          opts = opts || {};
    48          if (!opts.id) {
    49              if ((!args || args.varieties === undefined) && !opts.urn) {
    50                  throw new Error("Missing required property 'varieties'");
    51              }
    52              resourceInputs["sizes"] = args ? args.sizes : undefined;
    53              resourceInputs["varieties"] = args ? args.varieties : undefined;
    54          } else {
    55          }
    56          opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
    57          super(Nursery.__pulumiType, name, resourceInputs, opts);
    58      }
    59  }
    60  
    61  /**
    62   * The set of arguments for constructing a Nursery resource.
    63   */
    64  export interface NurseryArgs {
    65      /**
    66       * The sizes of trees available
    67       */
    68      sizes?: pulumi.Input<{[key: string]: pulumi.Input<enums.tree.v1.TreeSize>}>;
    69      /**
    70       * The varieties available
    71       */
    72      varieties: pulumi.Input<pulumi.Input<enums.tree.v1.RubberTreeVariety>[]>;
    73  }