pulumi/sdk/go/pulumi-language-go/testdata/sdks/config-9.0.0/config/provider.go

106 lines
3.0 KiB
Go

// Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package config
import (
"context"
"reflect"
"errors"
"example.com/pulumi-config/sdk/go/v9/config/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type Provider struct {
pulumi.ProviderResourceState
Name pulumi.StringOutput `pulumi:"name"`
PluginDownloadURL pulumi.StringPtrOutput `pulumi:"pluginDownloadURL"`
Version pulumi.StringOutput `pulumi:"version"`
}
// NewProvider registers a new resource with the given unique name, arguments, and options.
func NewProvider(ctx *pulumi.Context,
name string, args *ProviderArgs, opts ...pulumi.ResourceOption) (*Provider, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Name == nil {
return nil, errors.New("invalid value for required argument 'Name'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Provider
err := ctx.RegisterResource("pulumi:providers:config", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
type providerArgs struct {
Name string `pulumi:"name"`
PluginDownloadURL *string `pulumi:"pluginDownloadURL"`
}
// The set of arguments for constructing a Provider resource.
type ProviderArgs struct {
Name pulumi.StringInput
PluginDownloadURL pulumi.StringPtrInput
}
func (ProviderArgs) ElementType() reflect.Type {
return reflect.TypeOf((*providerArgs)(nil)).Elem()
}
type ProviderInput interface {
pulumi.Input
ToProviderOutput() ProviderOutput
ToProviderOutputWithContext(ctx context.Context) ProviderOutput
}
func (*Provider) ElementType() reflect.Type {
return reflect.TypeOf((**Provider)(nil)).Elem()
}
func (i *Provider) ToProviderOutput() ProviderOutput {
return i.ToProviderOutputWithContext(context.Background())
}
func (i *Provider) ToProviderOutputWithContext(ctx context.Context) ProviderOutput {
return pulumi.ToOutputWithContext(ctx, i).(ProviderOutput)
}
type ProviderOutput struct{ *pulumi.OutputState }
func (ProviderOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Provider)(nil)).Elem()
}
func (o ProviderOutput) ToProviderOutput() ProviderOutput {
return o
}
func (o ProviderOutput) ToProviderOutputWithContext(ctx context.Context) ProviderOutput {
return o
}
func (o ProviderOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Provider) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
func (o ProviderOutput) PluginDownloadURL() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Provider) pulumi.StringPtrOutput { return v.PluginDownloadURL }).(pulumi.StringPtrOutput)
}
func (o ProviderOutput) Version() pulumi.StringOutput {
return o.ApplyT(func(v *Provider) pulumi.StringOutput { return v.Version }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ProviderInput)(nil)).Elem(), &Provider{})
pulumi.RegisterOutputType(ProviderOutput{})
}