pulumi/tests/testdata/codegen/naming-collisions/go/example/mod/component2.go

105 lines
2.8 KiB
Go

// Code generated by test DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package mod
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"naming-collisions/example/internal"
)
type Component2 struct {
pulumi.CustomResourceState
}
// NewComponent2 registers a new resource with the given unique name, arguments, and options.
func NewComponent2(ctx *pulumi.Context,
name string, args *Component2Args, opts ...pulumi.ResourceOption) (*Component2, error) {
if args == nil {
args = &Component2Args{}
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Component2
err := ctx.RegisterResource("example:mod:Component2", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetComponent2 gets an existing Component2 resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetComponent2(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *Component2State, opts ...pulumi.ResourceOption) (*Component2, error) {
var resource Component2
err := ctx.ReadResource("example:mod:Component2", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Component2 resources.
type component2State struct {
}
type Component2State struct {
}
func (Component2State) ElementType() reflect.Type {
return reflect.TypeOf((*component2State)(nil)).Elem()
}
type component2Args struct {
}
// The set of arguments for constructing a Component2 resource.
type Component2Args struct {
}
func (Component2Args) ElementType() reflect.Type {
return reflect.TypeOf((*component2Args)(nil)).Elem()
}
type Component2Input interface {
pulumi.Input
ToComponent2Output() Component2Output
ToComponent2OutputWithContext(ctx context.Context) Component2Output
}
func (*Component2) ElementType() reflect.Type {
return reflect.TypeOf((**Component2)(nil)).Elem()
}
func (i *Component2) ToComponent2Output() Component2Output {
return i.ToComponent2OutputWithContext(context.Background())
}
func (i *Component2) ToComponent2OutputWithContext(ctx context.Context) Component2Output {
return pulumi.ToOutputWithContext(ctx, i).(Component2Output)
}
type Component2Output struct{ *pulumi.OutputState }
func (Component2Output) ElementType() reflect.Type {
return reflect.TypeOf((**Component2)(nil)).Elem()
}
func (o Component2Output) ToComponent2Output() Component2Output {
return o
}
func (o Component2Output) ToComponent2OutputWithContext(ctx context.Context) Component2Output {
return o
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*Component2Input)(nil)).Elem(), &Component2{})
pulumi.RegisterOutputType(Component2Output{})
}