github.com/myhau/pulumi/pkg/v3@v3.70.2-0.20221116134521-f2775972e587/codegen/testing/test/testdata/dash-named-schema/go/foo/submodule1/moduleResource.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 submodule1 5 6 import ( 7 "context" 8 "reflect" 9 10 "dash-named-schema/foo" 11 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 ) 13 14 type ModuleResource struct { 15 pulumi.CustomResourceState 16 17 Thing foo.TopLevelPtrOutput `pulumi:"thing"` 18 } 19 20 // NewModuleResource registers a new resource with the given unique name, arguments, and options. 21 func NewModuleResource(ctx *pulumi.Context, 22 name string, args *ModuleResourceArgs, opts ...pulumi.ResourceOption) (*ModuleResource, error) { 23 if args == nil { 24 args = &ModuleResourceArgs{} 25 } 26 27 var resource ModuleResource 28 err := ctx.RegisterResource("foo-bar:submodule1:ModuleResource", name, args, &resource, opts...) 29 if err != nil { 30 return nil, err 31 } 32 return &resource, nil 33 } 34 35 // GetModuleResource gets an existing ModuleResource resource's state with the given name, ID, and optional 36 // state properties that are used to uniquely qualify the lookup (nil if not required). 37 func GetModuleResource(ctx *pulumi.Context, 38 name string, id pulumi.IDInput, state *ModuleResourceState, opts ...pulumi.ResourceOption) (*ModuleResource, error) { 39 var resource ModuleResource 40 err := ctx.ReadResource("foo-bar:submodule1:ModuleResource", name, id, state, &resource, opts...) 41 if err != nil { 42 return nil, err 43 } 44 return &resource, nil 45 } 46 47 // Input properties used for looking up and filtering ModuleResource resources. 48 type moduleResourceState struct { 49 } 50 51 type ModuleResourceState struct { 52 } 53 54 func (ModuleResourceState) ElementType() reflect.Type { 55 return reflect.TypeOf((*moduleResourceState)(nil)).Elem() 56 } 57 58 type moduleResourceArgs struct { 59 Thing *foo.TopLevel `pulumi:"thing"` 60 } 61 62 // The set of arguments for constructing a ModuleResource resource. 63 type ModuleResourceArgs struct { 64 Thing foo.TopLevelPtrInput 65 } 66 67 func (ModuleResourceArgs) ElementType() reflect.Type { 68 return reflect.TypeOf((*moduleResourceArgs)(nil)).Elem() 69 } 70 71 type ModuleResourceInput interface { 72 pulumi.Input 73 74 ToModuleResourceOutput() ModuleResourceOutput 75 ToModuleResourceOutputWithContext(ctx context.Context) ModuleResourceOutput 76 } 77 78 func (*ModuleResource) ElementType() reflect.Type { 79 return reflect.TypeOf((**ModuleResource)(nil)).Elem() 80 } 81 82 func (i *ModuleResource) ToModuleResourceOutput() ModuleResourceOutput { 83 return i.ToModuleResourceOutputWithContext(context.Background()) 84 } 85 86 func (i *ModuleResource) ToModuleResourceOutputWithContext(ctx context.Context) ModuleResourceOutput { 87 return pulumi.ToOutputWithContext(ctx, i).(ModuleResourceOutput) 88 } 89 90 type ModuleResourceOutput struct{ *pulumi.OutputState } 91 92 func (ModuleResourceOutput) ElementType() reflect.Type { 93 return reflect.TypeOf((**ModuleResource)(nil)).Elem() 94 } 95 96 func (o ModuleResourceOutput) ToModuleResourceOutput() ModuleResourceOutput { 97 return o 98 } 99 100 func (o ModuleResourceOutput) ToModuleResourceOutputWithContext(ctx context.Context) ModuleResourceOutput { 101 return o 102 } 103 104 func (o ModuleResourceOutput) Thing() foo.TopLevelPtrOutput { 105 return o.ApplyT(func(v *ModuleResource) foo.TopLevelPtrOutput { return v.Thing }).(foo.TopLevelPtrOutput) 106 } 107 108 func init() { 109 pulumi.RegisterInputType(reflect.TypeOf((*ModuleResourceInput)(nil)).Elem(), &ModuleResource{}) 110 pulumi.RegisterOutputType(ModuleResourceOutput{}) 111 }