github.com/myhau/pulumi/pkg/v3@v3.70.2-0.20221116134521-f2775972e587/codegen/testing/test/testdata/simple-resource-schema-custom-pypackage-name/go/example/argFunction.go (about) 1 // Code generated by test DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package example 5 6 import ( 7 "context" 8 "reflect" 9 10 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 11 ) 12 13 func ArgFunction(ctx *pulumi.Context, args *ArgFunctionArgs, opts ...pulumi.InvokeOption) (*ArgFunctionResult, error) { 14 var rv ArgFunctionResult 15 err := ctx.Invoke("example::argFunction", args, &rv, opts...) 16 if err != nil { 17 return nil, err 18 } 19 return &rv, nil 20 } 21 22 type ArgFunctionArgs struct { 23 Arg1 *Resource `pulumi:"arg1"` 24 } 25 26 type ArgFunctionResult struct { 27 Result *Resource `pulumi:"result"` 28 } 29 30 func ArgFunctionOutput(ctx *pulumi.Context, args ArgFunctionOutputArgs, opts ...pulumi.InvokeOption) ArgFunctionResultOutput { 31 return pulumi.ToOutputWithContext(context.Background(), args). 32 ApplyT(func(v interface{}) (ArgFunctionResult, error) { 33 args := v.(ArgFunctionArgs) 34 r, err := ArgFunction(ctx, &args, opts...) 35 var s ArgFunctionResult 36 if r != nil { 37 s = *r 38 } 39 return s, err 40 }).(ArgFunctionResultOutput) 41 } 42 43 type ArgFunctionOutputArgs struct { 44 Arg1 ResourceInput `pulumi:"arg1"` 45 } 46 47 func (ArgFunctionOutputArgs) ElementType() reflect.Type { 48 return reflect.TypeOf((*ArgFunctionArgs)(nil)).Elem() 49 } 50 51 type ArgFunctionResultOutput struct{ *pulumi.OutputState } 52 53 func (ArgFunctionResultOutput) ElementType() reflect.Type { 54 return reflect.TypeOf((*ArgFunctionResult)(nil)).Elem() 55 } 56 57 func (o ArgFunctionResultOutput) ToArgFunctionResultOutput() ArgFunctionResultOutput { 58 return o 59 } 60 61 func (o ArgFunctionResultOutput) ToArgFunctionResultOutputWithContext(ctx context.Context) ArgFunctionResultOutput { 62 return o 63 } 64 65 func (o ArgFunctionResultOutput) Result() ResourceOutput { 66 return o.ApplyT(func(v ArgFunctionResult) *Resource { return v.Result }).(ResourceOutput) 67 } 68 69 func init() { 70 pulumi.RegisterOutputType(ArgFunctionResultOutput{}) 71 }