pulumi/tests/testdata/codegen/unions-inside-arrays/go/example/x/exampleServer.go

101 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 example
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumix"
"unions-inside-arrays/example/internal"
)
type ExampleServer struct {
pulumi.CustomResourceState
Name pulumix.Output[*string] `pulumi:"name"`
}
// NewExampleServer registers a new resource with the given unique name, arguments, and options.
func NewExampleServer(ctx *pulumi.Context,
name string, args *ExampleServerArgs, opts ...pulumi.ResourceOption) (*ExampleServer, error) {
if args == nil {
args = &ExampleServerArgs{}
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource ExampleServer
err := ctx.RegisterResource("example:index:ExampleServer", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetExampleServer gets an existing ExampleServer 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 GetExampleServer(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ExampleServerState, opts ...pulumi.ResourceOption) (*ExampleServer, error) {
var resource ExampleServer
err := ctx.ReadResource("example:index:ExampleServer", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ExampleServer resources.
type exampleServerState struct {
}
type ExampleServerState struct {
}
func (ExampleServerState) ElementType() reflect.Type {
return reflect.TypeOf((*exampleServerState)(nil)).Elem()
}
type exampleServerArgs struct {
PropertiesCollection []interface{} `pulumi:"propertiesCollection"`
}
// The set of arguments for constructing a ExampleServer resource.
type ExampleServerArgs struct {
PropertiesCollection pulumix.Input[[]any]
}
func (ExampleServerArgs) ElementType() reflect.Type {
return reflect.TypeOf((*exampleServerArgs)(nil)).Elem()
}
type ExampleServerOutput struct{ *pulumi.OutputState }
func (ExampleServerOutput) ElementType() reflect.Type {
return reflect.TypeOf((*ExampleServer)(nil)).Elem()
}
func (o ExampleServerOutput) ToExampleServerOutput() ExampleServerOutput {
return o
}
func (o ExampleServerOutput) ToExampleServerOutputWithContext(ctx context.Context) ExampleServerOutput {
return o
}
func (o ExampleServerOutput) ToOutput(ctx context.Context) pulumix.Output[ExampleServer] {
return pulumix.Output[ExampleServer]{
OutputState: o.OutputState,
}
}
func (o ExampleServerOutput) Name() pulumix.Output[*string] {
value := pulumix.Apply[ExampleServer](o, func(v ExampleServer) pulumix.Output[*string] { return v.Name })
return pulumix.Flatten[*string, pulumix.Output[*string]](value)
}
func init() {
pulumi.RegisterOutputType(ExampleServerOutput{})
}