github.com/myhau/pulumi/pkg/v3@v3.70.2-0.20221116134521-f2775972e587/codegen/testing/test/testdata/replace-on-change/go/example/god.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 example
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    11  )
    12  
    13  type God struct {
    14  	pulumi.CustomResourceState
    15  
    16  	Backwards DogOutput `pulumi:"backwards"`
    17  }
    18  
    19  // NewGod registers a new resource with the given unique name, arguments, and options.
    20  func NewGod(ctx *pulumi.Context,
    21  	name string, args *GodArgs, opts ...pulumi.ResourceOption) (*God, error) {
    22  	if args == nil {
    23  		args = &GodArgs{}
    24  	}
    25  
    26  	var resource God
    27  	err := ctx.RegisterResource("example::God", name, args, &resource, opts...)
    28  	if err != nil {
    29  		return nil, err
    30  	}
    31  	return &resource, nil
    32  }
    33  
    34  // GetGod gets an existing God 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 GetGod(ctx *pulumi.Context,
    37  	name string, id pulumi.IDInput, state *GodState, opts ...pulumi.ResourceOption) (*God, error) {
    38  	var resource God
    39  	err := ctx.ReadResource("example::God", 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 God resources.
    47  type godState struct {
    48  }
    49  
    50  type GodState struct {
    51  }
    52  
    53  func (GodState) ElementType() reflect.Type {
    54  	return reflect.TypeOf((*godState)(nil)).Elem()
    55  }
    56  
    57  type godArgs struct {
    58  }
    59  
    60  // The set of arguments for constructing a God resource.
    61  type GodArgs struct {
    62  }
    63  
    64  func (GodArgs) ElementType() reflect.Type {
    65  	return reflect.TypeOf((*godArgs)(nil)).Elem()
    66  }
    67  
    68  type GodInput interface {
    69  	pulumi.Input
    70  
    71  	ToGodOutput() GodOutput
    72  	ToGodOutputWithContext(ctx context.Context) GodOutput
    73  }
    74  
    75  func (*God) ElementType() reflect.Type {
    76  	return reflect.TypeOf((**God)(nil)).Elem()
    77  }
    78  
    79  func (i *God) ToGodOutput() GodOutput {
    80  	return i.ToGodOutputWithContext(context.Background())
    81  }
    82  
    83  func (i *God) ToGodOutputWithContext(ctx context.Context) GodOutput {
    84  	return pulumi.ToOutputWithContext(ctx, i).(GodOutput)
    85  }
    86  
    87  // GodArrayInput is an input type that accepts GodArray and GodArrayOutput values.
    88  // You can construct a concrete instance of `GodArrayInput` via:
    89  //
    90  //	GodArray{ GodArgs{...} }
    91  type GodArrayInput interface {
    92  	pulumi.Input
    93  
    94  	ToGodArrayOutput() GodArrayOutput
    95  	ToGodArrayOutputWithContext(context.Context) GodArrayOutput
    96  }
    97  
    98  type GodArray []GodInput
    99  
   100  func (GodArray) ElementType() reflect.Type {
   101  	return reflect.TypeOf((*[]*God)(nil)).Elem()
   102  }
   103  
   104  func (i GodArray) ToGodArrayOutput() GodArrayOutput {
   105  	return i.ToGodArrayOutputWithContext(context.Background())
   106  }
   107  
   108  func (i GodArray) ToGodArrayOutputWithContext(ctx context.Context) GodArrayOutput {
   109  	return pulumi.ToOutputWithContext(ctx, i).(GodArrayOutput)
   110  }
   111  
   112  // GodMapInput is an input type that accepts GodMap and GodMapOutput values.
   113  // You can construct a concrete instance of `GodMapInput` via:
   114  //
   115  //	GodMap{ "key": GodArgs{...} }
   116  type GodMapInput interface {
   117  	pulumi.Input
   118  
   119  	ToGodMapOutput() GodMapOutput
   120  	ToGodMapOutputWithContext(context.Context) GodMapOutput
   121  }
   122  
   123  type GodMap map[string]GodInput
   124  
   125  func (GodMap) ElementType() reflect.Type {
   126  	return reflect.TypeOf((*map[string]*God)(nil)).Elem()
   127  }
   128  
   129  func (i GodMap) ToGodMapOutput() GodMapOutput {
   130  	return i.ToGodMapOutputWithContext(context.Background())
   131  }
   132  
   133  func (i GodMap) ToGodMapOutputWithContext(ctx context.Context) GodMapOutput {
   134  	return pulumi.ToOutputWithContext(ctx, i).(GodMapOutput)
   135  }
   136  
   137  type GodOutput struct{ *pulumi.OutputState }
   138  
   139  func (GodOutput) ElementType() reflect.Type {
   140  	return reflect.TypeOf((**God)(nil)).Elem()
   141  }
   142  
   143  func (o GodOutput) ToGodOutput() GodOutput {
   144  	return o
   145  }
   146  
   147  func (o GodOutput) ToGodOutputWithContext(ctx context.Context) GodOutput {
   148  	return o
   149  }
   150  
   151  func (o GodOutput) Backwards() DogOutput {
   152  	return o.ApplyT(func(v *God) DogOutput { return v.Backwards }).(DogOutput)
   153  }
   154  
   155  type GodArrayOutput struct{ *pulumi.OutputState }
   156  
   157  func (GodArrayOutput) ElementType() reflect.Type {
   158  	return reflect.TypeOf((*[]*God)(nil)).Elem()
   159  }
   160  
   161  func (o GodArrayOutput) ToGodArrayOutput() GodArrayOutput {
   162  	return o
   163  }
   164  
   165  func (o GodArrayOutput) ToGodArrayOutputWithContext(ctx context.Context) GodArrayOutput {
   166  	return o
   167  }
   168  
   169  func (o GodArrayOutput) Index(i pulumi.IntInput) GodOutput {
   170  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *God {
   171  		return vs[0].([]*God)[vs[1].(int)]
   172  	}).(GodOutput)
   173  }
   174  
   175  type GodMapOutput struct{ *pulumi.OutputState }
   176  
   177  func (GodMapOutput) ElementType() reflect.Type {
   178  	return reflect.TypeOf((*map[string]*God)(nil)).Elem()
   179  }
   180  
   181  func (o GodMapOutput) ToGodMapOutput() GodMapOutput {
   182  	return o
   183  }
   184  
   185  func (o GodMapOutput) ToGodMapOutputWithContext(ctx context.Context) GodMapOutput {
   186  	return o
   187  }
   188  
   189  func (o GodMapOutput) MapIndex(k pulumi.StringInput) GodOutput {
   190  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *God {
   191  		return vs[0].(map[string]*God)[vs[1].(string)]
   192  	}).(GodOutput)
   193  }
   194  
   195  func init() {
   196  	pulumi.RegisterOutputType(GodOutput{})
   197  	pulumi.RegisterOutputType(GodArrayOutput{})
   198  	pulumi.RegisterOutputType(GodMapOutput{})
   199  }