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

110 lines
2.9 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"
"naming-collisions/example/internal"
)
type Component struct {
pulumi.CustomResourceState
}
// NewComponent registers a new resource with the given unique name, arguments, and options.
func NewComponent(ctx *pulumi.Context,
name string, args *ComponentArgs, opts ...pulumi.ResourceOption) (*Component, error) {
if args == nil {
args = &ComponentArgs{}
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Component
err := ctx.RegisterResource("example:mod:Component", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetComponent gets an existing Component 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 GetComponent(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ComponentState, opts ...pulumi.ResourceOption) (*Component, error) {
var resource Component
err := ctx.ReadResource("example:mod:Component", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Component resources.
type componentState struct {
}
type ComponentState struct {
}
func (ComponentState) ElementType() reflect.Type {
return reflect.TypeOf((*componentState)(nil)).Elem()
}
type componentArgs struct {
Local *Component2 `pulumi:"local"`
Main *example.MainComponent `pulumi:"main"`
}
// The set of arguments for constructing a Component resource.
type ComponentArgs struct {
Local Component2Input
Main example.MainComponentInput
}
func (ComponentArgs) ElementType() reflect.Type {
return reflect.TypeOf((*componentArgs)(nil)).Elem()
}
type ComponentInput interface {
pulumi.Input
ToComponentOutput() ComponentOutput
ToComponentOutputWithContext(ctx context.Context) ComponentOutput
}
func (*Component) ElementType() reflect.Type {
return reflect.TypeOf((**Component)(nil)).Elem()
}
func (i *Component) ToComponentOutput() ComponentOutput {
return i.ToComponentOutputWithContext(context.Background())
}
func (i *Component) ToComponentOutputWithContext(ctx context.Context) ComponentOutput {
return pulumi.ToOutputWithContext(ctx, i).(ComponentOutput)
}
type ComponentOutput struct{ *pulumi.OutputState }
func (ComponentOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Component)(nil)).Elem()
}
func (o ComponentOutput) ToComponentOutput() ComponentOutput {
return o
}
func (o ComponentOutput) ToComponentOutputWithContext(ctx context.Context) ComponentOutput {
return o
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ComponentInput)(nil)).Elem(), &Component{})
pulumi.RegisterOutputType(ComponentOutput{})
}