github.com/myhau/pulumi/pkg/v3@v3.70.2-0.20221116134521-f2775972e587/codegen/testing/test/testdata/regress-go-10527/go/world/universe.go (about)

     1  // Code generated by test DO NOT EDIT.
     2  // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
     3  
     4  package world
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    11  )
    12  
    13  type Universe struct {
    14  	pulumi.CustomResourceState
    15  }
    16  
    17  // NewUniverse registers a new resource with the given unique name, arguments, and options.
    18  func NewUniverse(ctx *pulumi.Context,
    19  	name string, args *UniverseArgs, opts ...pulumi.ResourceOption) (*Universe, error) {
    20  	if args == nil {
    21  		args = &UniverseArgs{}
    22  	}
    23  
    24  	var resource Universe
    25  	err := ctx.RegisterResource("world::Universe", name, args, &resource, opts...)
    26  	if err != nil {
    27  		return nil, err
    28  	}
    29  	return &resource, nil
    30  }
    31  
    32  // GetUniverse gets an existing Universe resource's state with the given name, ID, and optional
    33  // state properties that are used to uniquely qualify the lookup (nil if not required).
    34  func GetUniverse(ctx *pulumi.Context,
    35  	name string, id pulumi.IDInput, state *UniverseState, opts ...pulumi.ResourceOption) (*Universe, error) {
    36  	var resource Universe
    37  	err := ctx.ReadResource("world::Universe", name, id, state, &resource, opts...)
    38  	if err != nil {
    39  		return nil, err
    40  	}
    41  	return &resource, nil
    42  }
    43  
    44  // Input properties used for looking up and filtering Universe resources.
    45  type universeState struct {
    46  }
    47  
    48  type UniverseState struct {
    49  }
    50  
    51  func (UniverseState) ElementType() reflect.Type {
    52  	return reflect.TypeOf((*universeState)(nil)).Elem()
    53  }
    54  
    55  type universeArgs struct {
    56  	Worlds map[string]World `pulumi:"worlds"`
    57  }
    58  
    59  // The set of arguments for constructing a Universe resource.
    60  type UniverseArgs struct {
    61  	Worlds WorldMapInput
    62  }
    63  
    64  func (UniverseArgs) ElementType() reflect.Type {
    65  	return reflect.TypeOf((*universeArgs)(nil)).Elem()
    66  }
    67  
    68  type UniverseInput interface {
    69  	pulumi.Input
    70  
    71  	ToUniverseOutput() UniverseOutput
    72  	ToUniverseOutputWithContext(ctx context.Context) UniverseOutput
    73  }
    74  
    75  func (*Universe) ElementType() reflect.Type {
    76  	return reflect.TypeOf((**Universe)(nil)).Elem()
    77  }
    78  
    79  func (i *Universe) ToUniverseOutput() UniverseOutput {
    80  	return i.ToUniverseOutputWithContext(context.Background())
    81  }
    82  
    83  func (i *Universe) ToUniverseOutputWithContext(ctx context.Context) UniverseOutput {
    84  	return pulumi.ToOutputWithContext(ctx, i).(UniverseOutput)
    85  }
    86  
    87  type UniverseOutput struct{ *pulumi.OutputState }
    88  
    89  func (UniverseOutput) ElementType() reflect.Type {
    90  	return reflect.TypeOf((**Universe)(nil)).Elem()
    91  }
    92  
    93  func (o UniverseOutput) ToUniverseOutput() UniverseOutput {
    94  	return o
    95  }
    96  
    97  func (o UniverseOutput) ToUniverseOutputWithContext(ctx context.Context) UniverseOutput {
    98  	return o
    99  }
   100  
   101  func init() {
   102  	pulumi.RegisterInputType(reflect.TypeOf((*UniverseInput)(nil)).Elem(), &Universe{})
   103  	pulumi.RegisterOutputType(UniverseOutput{})
   104  }