pulumi/tests/testdata/codegen/go-nested-collections/go/repro/foo.go

210 lines
5.6 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 repro
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"go-nested-collections/repro/internal"
)
type Foo struct {
pulumi.CustomResourceState
ConditionSets BarArrayArrayArrayOutput `pulumi:"conditionSets"`
PrivateEndpoint pulumi.StringMapMapMapOutput `pulumi:"privateEndpoint"`
}
// NewFoo registers a new resource with the given unique name, arguments, and options.
func NewFoo(ctx *pulumi.Context,
name string, args *FooArgs, opts ...pulumi.ResourceOption) (*Foo, error) {
if args == nil {
args = &FooArgs{}
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Foo
err := ctx.RegisterResource("repro:index:Foo", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetFoo gets an existing Foo 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 GetFoo(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *FooState, opts ...pulumi.ResourceOption) (*Foo, error) {
var resource Foo
err := ctx.ReadResource("repro:index:Foo", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Foo resources.
type fooState struct {
}
type FooState struct {
}
func (FooState) ElementType() reflect.Type {
return reflect.TypeOf((*fooState)(nil)).Elem()
}
type fooArgs struct {
}
// The set of arguments for constructing a Foo resource.
type FooArgs struct {
}
func (FooArgs) ElementType() reflect.Type {
return reflect.TypeOf((*fooArgs)(nil)).Elem()
}
type FooInput interface {
pulumi.Input
ToFooOutput() FooOutput
ToFooOutputWithContext(ctx context.Context) FooOutput
}
func (*Foo) ElementType() reflect.Type {
return reflect.TypeOf((**Foo)(nil)).Elem()
}
func (i *Foo) ToFooOutput() FooOutput {
return i.ToFooOutputWithContext(context.Background())
}
func (i *Foo) ToFooOutputWithContext(ctx context.Context) FooOutput {
return pulumi.ToOutputWithContext(ctx, i).(FooOutput)
}
// FooArrayInput is an input type that accepts FooArray and FooArrayOutput values.
// You can construct a concrete instance of `FooArrayInput` via:
//
// FooArray{ FooArgs{...} }
type FooArrayInput interface {
pulumi.Input
ToFooArrayOutput() FooArrayOutput
ToFooArrayOutputWithContext(context.Context) FooArrayOutput
}
type FooArray []FooInput
func (FooArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Foo)(nil)).Elem()
}
func (i FooArray) ToFooArrayOutput() FooArrayOutput {
return i.ToFooArrayOutputWithContext(context.Background())
}
func (i FooArray) ToFooArrayOutputWithContext(ctx context.Context) FooArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(FooArrayOutput)
}
// FooMapInput is an input type that accepts FooMap and FooMapOutput values.
// You can construct a concrete instance of `FooMapInput` via:
//
// FooMap{ "key": FooArgs{...} }
type FooMapInput interface {
pulumi.Input
ToFooMapOutput() FooMapOutput
ToFooMapOutputWithContext(context.Context) FooMapOutput
}
type FooMap map[string]FooInput
func (FooMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Foo)(nil)).Elem()
}
func (i FooMap) ToFooMapOutput() FooMapOutput {
return i.ToFooMapOutputWithContext(context.Background())
}
func (i FooMap) ToFooMapOutputWithContext(ctx context.Context) FooMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(FooMapOutput)
}
type FooOutput struct{ *pulumi.OutputState }
func (FooOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Foo)(nil)).Elem()
}
func (o FooOutput) ToFooOutput() FooOutput {
return o
}
func (o FooOutput) ToFooOutputWithContext(ctx context.Context) FooOutput {
return o
}
func (o FooOutput) ConditionSets() BarArrayArrayArrayOutput {
return o.ApplyT(func(v *Foo) BarArrayArrayArrayOutput { return v.ConditionSets }).(BarArrayArrayArrayOutput)
}
func (o FooOutput) PrivateEndpoint() pulumi.StringMapMapMapOutput {
return o.ApplyT(func(v *Foo) pulumi.StringMapMapMapOutput { return v.PrivateEndpoint }).(pulumi.StringMapMapMapOutput)
}
type FooArrayOutput struct{ *pulumi.OutputState }
func (FooArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Foo)(nil)).Elem()
}
func (o FooArrayOutput) ToFooArrayOutput() FooArrayOutput {
return o
}
func (o FooArrayOutput) ToFooArrayOutputWithContext(ctx context.Context) FooArrayOutput {
return o
}
func (o FooArrayOutput) Index(i pulumi.IntInput) FooOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Foo {
return vs[0].([]*Foo)[vs[1].(int)]
}).(FooOutput)
}
type FooMapOutput struct{ *pulumi.OutputState }
func (FooMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Foo)(nil)).Elem()
}
func (o FooMapOutput) ToFooMapOutput() FooMapOutput {
return o
}
func (o FooMapOutput) ToFooMapOutputWithContext(ctx context.Context) FooMapOutput {
return o
}
func (o FooMapOutput) MapIndex(k pulumi.StringInput) FooOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Foo {
return vs[0].(map[string]*Foo)[vs[1].(string)]
}).(FooOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*FooInput)(nil)).Elem(), &Foo{})
pulumi.RegisterInputType(reflect.TypeOf((*FooArrayInput)(nil)).Elem(), FooArray{})
pulumi.RegisterInputType(reflect.TypeOf((*FooMapInput)(nil)).Elem(), FooMap{})
pulumi.RegisterOutputType(FooOutput{})
pulumi.RegisterOutputType(FooArrayOutput{})
pulumi.RegisterOutputType(FooMapOutput{})
}