github.com/myhau/pulumi/pkg/v3@v3.70.2-0.20221116134521-f2775972e587/codegen/testing/test/testdata/simple-methods-schema/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 import * as pulumiRandom from "@pulumi/random"; 10 11 export class Foo extends pulumi.ComponentResource { 12 /** @internal */ 13 public static readonly __pulumiType = 'example::Foo'; 14 15 /** 16 * Returns true if the given object is an instance of Foo. This is designed to work even 17 * when multiple copies of the Pulumi SDK have been loaded into the same process. 18 */ 19 public static isInstance(obj: any): obj is Foo { 20 if (obj === undefined || obj === null) { 21 return false; 22 } 23 return obj['__pulumiType'] === Foo.__pulumiType; 24 } 25 26 27 /** 28 * Create a Foo resource with the given unique name, arguments, and options. 29 * 30 * @param name The _unique_ name of the resource. 31 * @param args The arguments to use to populate this resource's properties. 32 * @param opts A bag of options that control this resource's behavior. 33 */ 34 constructor(name: string, args?: FooArgs, opts?: pulumi.ComponentResourceOptions) { 35 let resourceInputs: pulumi.Inputs = {}; 36 opts = opts || {}; 37 if (!opts.id) { 38 } else { 39 } 40 opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); 41 super(Foo.__pulumiType, name, resourceInputs, opts, true /*remote*/); 42 } 43 44 /** 45 * A description of bar. 46 */ 47 bar(args: Foo.BarArgs): pulumi.Output<Foo.BarResult> { 48 return pulumi.runtime.call("example::Foo/bar", { 49 "__self__": this, 50 "baz": args.baz, 51 "bazPlain": args.bazPlain, 52 "bazRequired": args.bazRequired, 53 "boolValue": args.boolValue, 54 "boolValuePlain": args.boolValuePlain, 55 "boolValueRequired": args.boolValueRequired, 56 "name": args.name, 57 "namePlain": args.namePlain, 58 "nameRequired": args.nameRequired, 59 "stringValue": args.stringValue, 60 "stringValuePlain": args.stringValuePlain, 61 "stringValueRequired": args.stringValueRequired, 62 }, this); 63 } 64 65 baz(): void { 66 pulumi.runtime.call("example::Foo/baz", { 67 "__self__": this, 68 }, this); 69 } 70 71 /** 72 * Do something with something else 73 */ 74 generateKubeconfig(args: Foo.GenerateKubeconfigArgs): pulumi.Output<Foo.GenerateKubeconfigResult> { 75 return pulumi.runtime.call("example::Foo/generateKubeconfig", { 76 "__self__": this, 77 "boolValue": args.boolValue, 78 }, this); 79 } 80 } 81 82 /** 83 * The set of arguments for constructing a Foo resource. 84 */ 85 export interface FooArgs { 86 } 87 88 export namespace Foo { 89 /** 90 * The set of arguments for the Foo.bar method. 91 */ 92 export interface BarArgs { 93 baz?: pulumi.Input<inputs.nested.BazArgs>; 94 bazPlain?: inputs.nested.BazArgs; 95 bazRequired: pulumi.Input<inputs.nested.BazArgs>; 96 boolValue?: pulumi.Input<boolean>; 97 boolValuePlain?: boolean; 98 boolValueRequired: pulumi.Input<boolean>; 99 name?: pulumi.Input<pulumiRandom.RandomPet>; 100 namePlain?: pulumiRandom.RandomPet; 101 nameRequired: pulumi.Input<pulumiRandom.RandomPet>; 102 stringValue?: pulumi.Input<string>; 103 stringValuePlain?: string; 104 stringValueRequired: pulumi.Input<string>; 105 } 106 107 /** 108 * The results of the Foo.bar method. 109 */ 110 export interface BarResult { 111 readonly someValue: string; 112 } 113 114 /** 115 * The set of arguments for the Foo.generateKubeconfig method. 116 */ 117 export interface GenerateKubeconfigArgs { 118 boolValue: boolean; 119 } 120 121 /** 122 * The results of the Foo.generateKubeconfig method. 123 */ 124 export interface GenerateKubeconfigResult { 125 readonly kubeconfig: string; 126 } 127 128 }