github.com/myhau/pulumi/pkg/v3@v3.70.2-0.20221116134521-f2775972e587/codegen/testing/test/testdata/simple-resource-schema/go/example/provider.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 type Provider struct { 14 pulumi.ProviderResourceState 15 } 16 17 // NewProvider registers a new resource with the given unique name, arguments, and options. 18 func NewProvider(ctx *pulumi.Context, 19 name string, args *ProviderArgs, opts ...pulumi.ResourceOption) (*Provider, error) { 20 if args == nil { 21 args = &ProviderArgs{} 22 } 23 24 opts = pkgResourceDefaultOpts(opts) 25 var resource Provider 26 err := ctx.RegisterResource("pulumi:providers:example", name, args, &resource, opts...) 27 if err != nil { 28 return nil, err 29 } 30 return &resource, nil 31 } 32 33 type providerArgs struct { 34 } 35 36 // The set of arguments for constructing a Provider resource. 37 type ProviderArgs struct { 38 } 39 40 func (ProviderArgs) ElementType() reflect.Type { 41 return reflect.TypeOf((*providerArgs)(nil)).Elem() 42 } 43 44 type ProviderInput interface { 45 pulumi.Input 46 47 ToProviderOutput() ProviderOutput 48 ToProviderOutputWithContext(ctx context.Context) ProviderOutput 49 } 50 51 func (*Provider) ElementType() reflect.Type { 52 return reflect.TypeOf((**Provider)(nil)).Elem() 53 } 54 55 func (i *Provider) ToProviderOutput() ProviderOutput { 56 return i.ToProviderOutputWithContext(context.Background()) 57 } 58 59 func (i *Provider) ToProviderOutputWithContext(ctx context.Context) ProviderOutput { 60 return pulumi.ToOutputWithContext(ctx, i).(ProviderOutput) 61 } 62 63 type ProviderOutput struct{ *pulumi.OutputState } 64 65 func (ProviderOutput) ElementType() reflect.Type { 66 return reflect.TypeOf((**Provider)(nil)).Elem() 67 } 68 69 func (o ProviderOutput) ToProviderOutput() ProviderOutput { 70 return o 71 } 72 73 func (o ProviderOutput) ToProviderOutputWithContext(ctx context.Context) ProviderOutput { 74 return o 75 } 76 77 func init() { 78 pulumi.RegisterInputType(reflect.TypeOf((*ProviderInput)(nil)).Elem(), &Provider{}) 79 pulumi.RegisterOutputType(ProviderOutput{}) 80 }