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