github.com/myhau/pulumi/pkg/v3@v3.70.2-0.20221116134521-f2775972e587/codegen/testing/test/testdata/go-nested-collections/go/repro/foo.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 repro
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    11  )
    12  
    13  type Foo struct {
    14  	pulumi.CustomResourceState
    15  
    16  	ConditionSets BarArrayArrayArrayOutput `pulumi:"conditionSets"`
    17  }
    18  
    19  // NewFoo registers a new resource with the given unique name, arguments, and options.
    20  func NewFoo(ctx *pulumi.Context,
    21  	name string, args *FooArgs, opts ...pulumi.ResourceOption) (*Foo, error) {
    22  	if args == nil {
    23  		args = &FooArgs{}
    24  	}
    25  
    26  	var resource Foo
    27  	err := ctx.RegisterResource("repro:index:Foo", name, args, &resource, opts...)
    28  	if err != nil {
    29  		return nil, err
    30  	}
    31  	return &resource, nil
    32  }
    33  
    34  // GetFoo gets an existing Foo resource's state with the given name, ID, and optional
    35  // state properties that are used to uniquely qualify the lookup (nil if not required).
    36  func GetFoo(ctx *pulumi.Context,
    37  	name string, id pulumi.IDInput, state *FooState, opts ...pulumi.ResourceOption) (*Foo, error) {
    38  	var resource Foo
    39  	err := ctx.ReadResource("repro:index:Foo", name, id, state, &resource, opts...)
    40  	if err != nil {
    41  		return nil, err
    42  	}
    43  	return &resource, nil
    44  }
    45  
    46  // Input properties used for looking up and filtering Foo resources.
    47  type fooState struct {
    48  }
    49  
    50  type FooState struct {
    51  }
    52  
    53  func (FooState) ElementType() reflect.Type {
    54  	return reflect.TypeOf((*fooState)(nil)).Elem()
    55  }
    56  
    57  type fooArgs struct {
    58  }
    59  
    60  // The set of arguments for constructing a Foo resource.
    61  type FooArgs struct {
    62  }
    63  
    64  func (FooArgs) ElementType() reflect.Type {
    65  	return reflect.TypeOf((*fooArgs)(nil)).Elem()
    66  }
    67  
    68  type FooInput interface {
    69  	pulumi.Input
    70  
    71  	ToFooOutput() FooOutput
    72  	ToFooOutputWithContext(ctx context.Context) FooOutput
    73  }
    74  
    75  func (*Foo) ElementType() reflect.Type {
    76  	return reflect.TypeOf((**Foo)(nil)).Elem()
    77  }
    78  
    79  func (i *Foo) ToFooOutput() FooOutput {
    80  	return i.ToFooOutputWithContext(context.Background())
    81  }
    82  
    83  func (i *Foo) ToFooOutputWithContext(ctx context.Context) FooOutput {
    84  	return pulumi.ToOutputWithContext(ctx, i).(FooOutput)
    85  }
    86  
    87  // FooArrayInput is an input type that accepts FooArray and FooArrayOutput values.
    88  // You can construct a concrete instance of `FooArrayInput` via:
    89  //
    90  //	FooArray{ FooArgs{...} }
    91  type FooArrayInput interface {
    92  	pulumi.Input
    93  
    94  	ToFooArrayOutput() FooArrayOutput
    95  	ToFooArrayOutputWithContext(context.Context) FooArrayOutput
    96  }
    97  
    98  type FooArray []FooInput
    99  
   100  func (FooArray) ElementType() reflect.Type {
   101  	return reflect.TypeOf((*[]*Foo)(nil)).Elem()
   102  }
   103  
   104  func (i FooArray) ToFooArrayOutput() FooArrayOutput {
   105  	return i.ToFooArrayOutputWithContext(context.Background())
   106  }
   107  
   108  func (i FooArray) ToFooArrayOutputWithContext(ctx context.Context) FooArrayOutput {
   109  	return pulumi.ToOutputWithContext(ctx, i).(FooArrayOutput)
   110  }
   111  
   112  // FooMapInput is an input type that accepts FooMap and FooMapOutput values.
   113  // You can construct a concrete instance of `FooMapInput` via:
   114  //
   115  //	FooMap{ "key": FooArgs{...} }
   116  type FooMapInput interface {
   117  	pulumi.Input
   118  
   119  	ToFooMapOutput() FooMapOutput
   120  	ToFooMapOutputWithContext(context.Context) FooMapOutput
   121  }
   122  
   123  type FooMap map[string]FooInput
   124  
   125  func (FooMap) ElementType() reflect.Type {
   126  	return reflect.TypeOf((*map[string]*Foo)(nil)).Elem()
   127  }
   128  
   129  func (i FooMap) ToFooMapOutput() FooMapOutput {
   130  	return i.ToFooMapOutputWithContext(context.Background())
   131  }
   132  
   133  func (i FooMap) ToFooMapOutputWithContext(ctx context.Context) FooMapOutput {
   134  	return pulumi.ToOutputWithContext(ctx, i).(FooMapOutput)
   135  }
   136  
   137  type FooOutput struct{ *pulumi.OutputState }
   138  
   139  func (FooOutput) ElementType() reflect.Type {
   140  	return reflect.TypeOf((**Foo)(nil)).Elem()
   141  }
   142  
   143  func (o FooOutput) ToFooOutput() FooOutput {
   144  	return o
   145  }
   146  
   147  func (o FooOutput) ToFooOutputWithContext(ctx context.Context) FooOutput {
   148  	return o
   149  }
   150  
   151  func (o FooOutput) ConditionSets() BarArrayArrayArrayOutput {
   152  	return o.ApplyT(func(v *Foo) BarArrayArrayArrayOutput { return v.ConditionSets }).(BarArrayArrayArrayOutput)
   153  }
   154  
   155  type FooArrayOutput struct{ *pulumi.OutputState }
   156  
   157  func (FooArrayOutput) ElementType() reflect.Type {
   158  	return reflect.TypeOf((*[]*Foo)(nil)).Elem()
   159  }
   160  
   161  func (o FooArrayOutput) ToFooArrayOutput() FooArrayOutput {
   162  	return o
   163  }
   164  
   165  func (o FooArrayOutput) ToFooArrayOutputWithContext(ctx context.Context) FooArrayOutput {
   166  	return o
   167  }
   168  
   169  func (o FooArrayOutput) Index(i pulumi.IntInput) FooOutput {
   170  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Foo {
   171  		return vs[0].([]*Foo)[vs[1].(int)]
   172  	}).(FooOutput)
   173  }
   174  
   175  type FooMapOutput struct{ *pulumi.OutputState }
   176  
   177  func (FooMapOutput) ElementType() reflect.Type {
   178  	return reflect.TypeOf((*map[string]*Foo)(nil)).Elem()
   179  }
   180  
   181  func (o FooMapOutput) ToFooMapOutput() FooMapOutput {
   182  	return o
   183  }
   184  
   185  func (o FooMapOutput) ToFooMapOutputWithContext(ctx context.Context) FooMapOutput {
   186  	return o
   187  }
   188  
   189  func (o FooMapOutput) MapIndex(k pulumi.StringInput) FooOutput {
   190  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Foo {
   191  		return vs[0].(map[string]*Foo)[vs[1].(string)]
   192  	}).(FooOutput)
   193  }
   194  
   195  func init() {
   196  	pulumi.RegisterInputType(reflect.TypeOf((*FooInput)(nil)).Elem(), &Foo{})
   197  	pulumi.RegisterInputType(reflect.TypeOf((*FooArrayInput)(nil)).Elem(), FooArray{})
   198  	pulumi.RegisterInputType(reflect.TypeOf((*FooMapInput)(nil)).Elem(), FooMap{})
   199  	pulumi.RegisterOutputType(FooOutput{})
   200  	pulumi.RegisterOutputType(FooArrayOutput{})
   201  	pulumi.RegisterOutputType(FooMapOutput{})
   202  }