2022-04-19 16:39:23 +00:00
|
|
|
// Code generated by test DO NOT EDIT.
|
|
|
|
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
|
2021-06-24 16:17:55 +00:00
|
|
|
|
|
|
|
package xyz
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"reflect"
|
|
|
|
|
2022-11-01 09:02:01 +00:00
|
|
|
"errors"
|
2021-06-24 16:17:55 +00:00
|
|
|
"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/s3"
|
|
|
|
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
2023-06-14 19:59:47 +00:00
|
|
|
"plain-schema-gh6957/xyz/internal"
|
2021-06-24 16:17:55 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type StaticPage struct {
|
|
|
|
pulumi.ResourceState
|
|
|
|
|
|
|
|
// The bucket resource.
|
|
|
|
Bucket s3.BucketOutput `pulumi:"bucket"`
|
|
|
|
// The website URL.
|
|
|
|
WebsiteUrl pulumi.StringOutput `pulumi:"websiteUrl"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewStaticPage registers a new resource with the given unique name, arguments, and options.
|
|
|
|
func NewStaticPage(ctx *pulumi.Context,
|
|
|
|
name string, args *StaticPageArgs, opts ...pulumi.ResourceOption) (*StaticPage, error) {
|
|
|
|
if args == nil {
|
|
|
|
return nil, errors.New("missing one or more required arguments")
|
|
|
|
}
|
|
|
|
|
|
|
|
if args.IndexContent == nil {
|
|
|
|
return nil, errors.New("invalid value for required argument 'IndexContent'")
|
|
|
|
}
|
2023-06-14 16:34:49 +00:00
|
|
|
opts = internal.PkgResourceDefaultOpts(opts)
|
2021-06-24 16:17:55 +00:00
|
|
|
var resource StaticPage
|
|
|
|
err := ctx.RegisterRemoteComponentResource("xyz:index:StaticPage", name, args, &resource, opts...)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return &resource, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type staticPageArgs struct {
|
|
|
|
Foo *Foo `pulumi:"foo"`
|
|
|
|
// The HTML content for index.html.
|
|
|
|
IndexContent string `pulumi:"indexContent"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// The set of arguments for constructing a StaticPage resource.
|
|
|
|
type StaticPageArgs struct {
|
2022-05-03 18:13:21 +00:00
|
|
|
Foo *FooArgs
|
2021-06-24 16:17:55 +00:00
|
|
|
// The HTML content for index.html.
|
|
|
|
IndexContent pulumi.StringInput
|
|
|
|
}
|
|
|
|
|
|
|
|
func (StaticPageArgs) ElementType() reflect.Type {
|
|
|
|
return reflect.TypeOf((*staticPageArgs)(nil)).Elem()
|
|
|
|
}
|
|
|
|
|
|
|
|
type StaticPageInput interface {
|
|
|
|
pulumi.Input
|
|
|
|
|
|
|
|
ToStaticPageOutput() StaticPageOutput
|
|
|
|
ToStaticPageOutputWithContext(ctx context.Context) StaticPageOutput
|
|
|
|
}
|
|
|
|
|
|
|
|
func (*StaticPage) ElementType() reflect.Type {
|
[codegen/go] Remove ResourcePtr input/output types (#8449)
These changes remove the `Ptr` variants of input/ouptut types for
resources. A `TPtr` input or output is normally generated for `T` if `T`
is present in an `optional(input(T))` or `optional(output(T))` and if
the Go representation for `T` is not nilable. The generation of `Ptr`
variants for resource types breaks the latter rule: the canonical
representation of a resource type named `Foo` is a pointer to a struct
type named `Foo` (i.e. `*Foo`). `Foo` itself is not a resource, as it
does not implement the Go `Resource` interface. Because this
representation already accommodates `nil` to indicate the lack of a
value, we need not generate `FooPtr{Input,Output}` types.
Besides being unnecessary, the implementation of `Ptr` types for
resources was incorrect. Rather than using `**Foo` as their element
type, these types use `*Foo`--identical to the element type used for
the normal input/output types. Furthermore, the generated code for
at least `FooOutput.ToFooPtrOutputWithContext` and `FooPtrOutput.Elem`
was incorrect, making these types virtually unusable in practice.
Finally, these `Ptr` types should never appear on input/output
properties in practice, as the logic we use to generate input and output
type references never generates them for `optional({input,output}(T)).
Instead, it generates references to the standard input/output types.
Though this is _technically_ a breaking change--it changes the set of
exported types for any package that defines resources--I believe that in
practice it will be invisible to users for the reasons stated above.
These types are not usable, and were never referenced.
This is preparatory work for #7943.
2021-11-23 18:24:56 +00:00
|
|
|
return reflect.TypeOf((**StaticPage)(nil)).Elem()
|
2021-06-24 16:17:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (i *StaticPage) ToStaticPageOutput() StaticPageOutput {
|
|
|
|
return i.ToStaticPageOutputWithContext(context.Background())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (i *StaticPage) ToStaticPageOutputWithContext(ctx context.Context) StaticPageOutput {
|
|
|
|
return pulumi.ToOutputWithContext(ctx, i).(StaticPageOutput)
|
|
|
|
}
|
|
|
|
|
|
|
|
// StaticPageArrayInput is an input type that accepts StaticPageArray and StaticPageArrayOutput values.
|
|
|
|
// You can construct a concrete instance of `StaticPageArrayInput` via:
|
|
|
|
//
|
2022-09-14 02:12:02 +00:00
|
|
|
// StaticPageArray{ StaticPageArgs{...} }
|
2021-06-24 16:17:55 +00:00
|
|
|
type StaticPageArrayInput interface {
|
|
|
|
pulumi.Input
|
|
|
|
|
|
|
|
ToStaticPageArrayOutput() StaticPageArrayOutput
|
|
|
|
ToStaticPageArrayOutputWithContext(context.Context) StaticPageArrayOutput
|
|
|
|
}
|
|
|
|
|
|
|
|
type StaticPageArray []StaticPageInput
|
|
|
|
|
|
|
|
func (StaticPageArray) ElementType() reflect.Type {
|
2021-07-27 02:23:17 +00:00
|
|
|
return reflect.TypeOf((*[]*StaticPage)(nil)).Elem()
|
2021-06-24 16:17:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (i StaticPageArray) ToStaticPageArrayOutput() StaticPageArrayOutput {
|
|
|
|
return i.ToStaticPageArrayOutputWithContext(context.Background())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (i StaticPageArray) ToStaticPageArrayOutputWithContext(ctx context.Context) StaticPageArrayOutput {
|
|
|
|
return pulumi.ToOutputWithContext(ctx, i).(StaticPageArrayOutput)
|
|
|
|
}
|
|
|
|
|
|
|
|
// StaticPageMapInput is an input type that accepts StaticPageMap and StaticPageMapOutput values.
|
|
|
|
// You can construct a concrete instance of `StaticPageMapInput` via:
|
|
|
|
//
|
2022-09-14 02:12:02 +00:00
|
|
|
// StaticPageMap{ "key": StaticPageArgs{...} }
|
2021-06-24 16:17:55 +00:00
|
|
|
type StaticPageMapInput interface {
|
|
|
|
pulumi.Input
|
|
|
|
|
|
|
|
ToStaticPageMapOutput() StaticPageMapOutput
|
|
|
|
ToStaticPageMapOutputWithContext(context.Context) StaticPageMapOutput
|
|
|
|
}
|
|
|
|
|
|
|
|
type StaticPageMap map[string]StaticPageInput
|
|
|
|
|
|
|
|
func (StaticPageMap) ElementType() reflect.Type {
|
2021-07-27 02:23:17 +00:00
|
|
|
return reflect.TypeOf((*map[string]*StaticPage)(nil)).Elem()
|
2021-06-24 16:17:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (i StaticPageMap) ToStaticPageMapOutput() StaticPageMapOutput {
|
|
|
|
return i.ToStaticPageMapOutputWithContext(context.Background())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (i StaticPageMap) ToStaticPageMapOutputWithContext(ctx context.Context) StaticPageMapOutput {
|
|
|
|
return pulumi.ToOutputWithContext(ctx, i).(StaticPageMapOutput)
|
|
|
|
}
|
|
|
|
|
2021-08-02 20:43:24 +00:00
|
|
|
type StaticPageOutput struct{ *pulumi.OutputState }
|
2021-06-24 16:17:55 +00:00
|
|
|
|
|
|
|
func (StaticPageOutput) ElementType() reflect.Type {
|
[codegen/go] Remove ResourcePtr input/output types (#8449)
These changes remove the `Ptr` variants of input/ouptut types for
resources. A `TPtr` input or output is normally generated for `T` if `T`
is present in an `optional(input(T))` or `optional(output(T))` and if
the Go representation for `T` is not nilable. The generation of `Ptr`
variants for resource types breaks the latter rule: the canonical
representation of a resource type named `Foo` is a pointer to a struct
type named `Foo` (i.e. `*Foo`). `Foo` itself is not a resource, as it
does not implement the Go `Resource` interface. Because this
representation already accommodates `nil` to indicate the lack of a
value, we need not generate `FooPtr{Input,Output}` types.
Besides being unnecessary, the implementation of `Ptr` types for
resources was incorrect. Rather than using `**Foo` as their element
type, these types use `*Foo`--identical to the element type used for
the normal input/output types. Furthermore, the generated code for
at least `FooOutput.ToFooPtrOutputWithContext` and `FooPtrOutput.Elem`
was incorrect, making these types virtually unusable in practice.
Finally, these `Ptr` types should never appear on input/output
properties in practice, as the logic we use to generate input and output
type references never generates them for `optional({input,output}(T)).
Instead, it generates references to the standard input/output types.
Though this is _technically_ a breaking change--it changes the set of
exported types for any package that defines resources--I believe that in
practice it will be invisible to users for the reasons stated above.
These types are not usable, and were never referenced.
This is preparatory work for #7943.
2021-11-23 18:24:56 +00:00
|
|
|
return reflect.TypeOf((**StaticPage)(nil)).Elem()
|
2021-06-24 16:17:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (o StaticPageOutput) ToStaticPageOutput() StaticPageOutput {
|
|
|
|
return o
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o StaticPageOutput) ToStaticPageOutputWithContext(ctx context.Context) StaticPageOutput {
|
|
|
|
return o
|
|
|
|
}
|
|
|
|
|
2022-05-03 18:36:57 +00:00
|
|
|
// The bucket resource.
|
|
|
|
func (o StaticPageOutput) Bucket() s3.BucketOutput {
|
|
|
|
return o.ApplyT(func(v *StaticPage) s3.BucketOutput { return v.Bucket }).(s3.BucketOutput)
|
|
|
|
}
|
|
|
|
|
|
|
|
// The website URL.
|
|
|
|
func (o StaticPageOutput) WebsiteUrl() pulumi.StringOutput {
|
|
|
|
return o.ApplyT(func(v *StaticPage) pulumi.StringOutput { return v.WebsiteUrl }).(pulumi.StringOutput)
|
|
|
|
}
|
|
|
|
|
2021-06-24 16:17:55 +00:00
|
|
|
type StaticPageArrayOutput struct{ *pulumi.OutputState }
|
|
|
|
|
|
|
|
func (StaticPageArrayOutput) ElementType() reflect.Type {
|
[codegen/go] Remove ResourcePtr input/output types (#8449)
These changes remove the `Ptr` variants of input/ouptut types for
resources. A `TPtr` input or output is normally generated for `T` if `T`
is present in an `optional(input(T))` or `optional(output(T))` and if
the Go representation for `T` is not nilable. The generation of `Ptr`
variants for resource types breaks the latter rule: the canonical
representation of a resource type named `Foo` is a pointer to a struct
type named `Foo` (i.e. `*Foo`). `Foo` itself is not a resource, as it
does not implement the Go `Resource` interface. Because this
representation already accommodates `nil` to indicate the lack of a
value, we need not generate `FooPtr{Input,Output}` types.
Besides being unnecessary, the implementation of `Ptr` types for
resources was incorrect. Rather than using `**Foo` as their element
type, these types use `*Foo`--identical to the element type used for
the normal input/output types. Furthermore, the generated code for
at least `FooOutput.ToFooPtrOutputWithContext` and `FooPtrOutput.Elem`
was incorrect, making these types virtually unusable in practice.
Finally, these `Ptr` types should never appear on input/output
properties in practice, as the logic we use to generate input and output
type references never generates them for `optional({input,output}(T)).
Instead, it generates references to the standard input/output types.
Though this is _technically_ a breaking change--it changes the set of
exported types for any package that defines resources--I believe that in
practice it will be invisible to users for the reasons stated above.
These types are not usable, and were never referenced.
This is preparatory work for #7943.
2021-11-23 18:24:56 +00:00
|
|
|
return reflect.TypeOf((*[]*StaticPage)(nil)).Elem()
|
2021-06-24 16:17:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (o StaticPageArrayOutput) ToStaticPageArrayOutput() StaticPageArrayOutput {
|
|
|
|
return o
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o StaticPageArrayOutput) ToStaticPageArrayOutputWithContext(ctx context.Context) StaticPageArrayOutput {
|
|
|
|
return o
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o StaticPageArrayOutput) Index(i pulumi.IntInput) StaticPageOutput {
|
[codegen/go] Remove ResourcePtr input/output types (#8449)
These changes remove the `Ptr` variants of input/ouptut types for
resources. A `TPtr` input or output is normally generated for `T` if `T`
is present in an `optional(input(T))` or `optional(output(T))` and if
the Go representation for `T` is not nilable. The generation of `Ptr`
variants for resource types breaks the latter rule: the canonical
representation of a resource type named `Foo` is a pointer to a struct
type named `Foo` (i.e. `*Foo`). `Foo` itself is not a resource, as it
does not implement the Go `Resource` interface. Because this
representation already accommodates `nil` to indicate the lack of a
value, we need not generate `FooPtr{Input,Output}` types.
Besides being unnecessary, the implementation of `Ptr` types for
resources was incorrect. Rather than using `**Foo` as their element
type, these types use `*Foo`--identical to the element type used for
the normal input/output types. Furthermore, the generated code for
at least `FooOutput.ToFooPtrOutputWithContext` and `FooPtrOutput.Elem`
was incorrect, making these types virtually unusable in practice.
Finally, these `Ptr` types should never appear on input/output
properties in practice, as the logic we use to generate input and output
type references never generates them for `optional({input,output}(T)).
Instead, it generates references to the standard input/output types.
Though this is _technically_ a breaking change--it changes the set of
exported types for any package that defines resources--I believe that in
practice it will be invisible to users for the reasons stated above.
These types are not usable, and were never referenced.
This is preparatory work for #7943.
2021-11-23 18:24:56 +00:00
|
|
|
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *StaticPage {
|
|
|
|
return vs[0].([]*StaticPage)[vs[1].(int)]
|
2021-06-24 16:17:55 +00:00
|
|
|
}).(StaticPageOutput)
|
|
|
|
}
|
|
|
|
|
|
|
|
type StaticPageMapOutput struct{ *pulumi.OutputState }
|
|
|
|
|
|
|
|
func (StaticPageMapOutput) ElementType() reflect.Type {
|
[codegen/go] Remove ResourcePtr input/output types (#8449)
These changes remove the `Ptr` variants of input/ouptut types for
resources. A `TPtr` input or output is normally generated for `T` if `T`
is present in an `optional(input(T))` or `optional(output(T))` and if
the Go representation for `T` is not nilable. The generation of `Ptr`
variants for resource types breaks the latter rule: the canonical
representation of a resource type named `Foo` is a pointer to a struct
type named `Foo` (i.e. `*Foo`). `Foo` itself is not a resource, as it
does not implement the Go `Resource` interface. Because this
representation already accommodates `nil` to indicate the lack of a
value, we need not generate `FooPtr{Input,Output}` types.
Besides being unnecessary, the implementation of `Ptr` types for
resources was incorrect. Rather than using `**Foo` as their element
type, these types use `*Foo`--identical to the element type used for
the normal input/output types. Furthermore, the generated code for
at least `FooOutput.ToFooPtrOutputWithContext` and `FooPtrOutput.Elem`
was incorrect, making these types virtually unusable in practice.
Finally, these `Ptr` types should never appear on input/output
properties in practice, as the logic we use to generate input and output
type references never generates them for `optional({input,output}(T)).
Instead, it generates references to the standard input/output types.
Though this is _technically_ a breaking change--it changes the set of
exported types for any package that defines resources--I believe that in
practice it will be invisible to users for the reasons stated above.
These types are not usable, and were never referenced.
This is preparatory work for #7943.
2021-11-23 18:24:56 +00:00
|
|
|
return reflect.TypeOf((*map[string]*StaticPage)(nil)).Elem()
|
2021-06-24 16:17:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (o StaticPageMapOutput) ToStaticPageMapOutput() StaticPageMapOutput {
|
|
|
|
return o
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o StaticPageMapOutput) ToStaticPageMapOutputWithContext(ctx context.Context) StaticPageMapOutput {
|
|
|
|
return o
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o StaticPageMapOutput) MapIndex(k pulumi.StringInput) StaticPageOutput {
|
[codegen/go] Remove ResourcePtr input/output types (#8449)
These changes remove the `Ptr` variants of input/ouptut types for
resources. A `TPtr` input or output is normally generated for `T` if `T`
is present in an `optional(input(T))` or `optional(output(T))` and if
the Go representation for `T` is not nilable. The generation of `Ptr`
variants for resource types breaks the latter rule: the canonical
representation of a resource type named `Foo` is a pointer to a struct
type named `Foo` (i.e. `*Foo`). `Foo` itself is not a resource, as it
does not implement the Go `Resource` interface. Because this
representation already accommodates `nil` to indicate the lack of a
value, we need not generate `FooPtr{Input,Output}` types.
Besides being unnecessary, the implementation of `Ptr` types for
resources was incorrect. Rather than using `**Foo` as their element
type, these types use `*Foo`--identical to the element type used for
the normal input/output types. Furthermore, the generated code for
at least `FooOutput.ToFooPtrOutputWithContext` and `FooPtrOutput.Elem`
was incorrect, making these types virtually unusable in practice.
Finally, these `Ptr` types should never appear on input/output
properties in practice, as the logic we use to generate input and output
type references never generates them for `optional({input,output}(T)).
Instead, it generates references to the standard input/output types.
Though this is _technically_ a breaking change--it changes the set of
exported types for any package that defines resources--I believe that in
practice it will be invisible to users for the reasons stated above.
These types are not usable, and were never referenced.
This is preparatory work for #7943.
2021-11-23 18:24:56 +00:00
|
|
|
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *StaticPage {
|
|
|
|
return vs[0].(map[string]*StaticPage)[vs[1].(string)]
|
2021-06-24 16:17:55 +00:00
|
|
|
}).(StaticPageOutput)
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
2021-10-14 17:41:40 +00:00
|
|
|
pulumi.RegisterInputType(reflect.TypeOf((*StaticPageInput)(nil)).Elem(), &StaticPage{})
|
|
|
|
pulumi.RegisterInputType(reflect.TypeOf((*StaticPageArrayInput)(nil)).Elem(), StaticPageArray{})
|
|
|
|
pulumi.RegisterInputType(reflect.TypeOf((*StaticPageMapInput)(nil)).Elem(), StaticPageMap{})
|
2021-06-24 16:17:55 +00:00
|
|
|
pulumi.RegisterOutputType(StaticPageOutput{})
|
|
|
|
pulumi.RegisterOutputType(StaticPageArrayOutput{})
|
|
|
|
pulumi.RegisterOutputType(StaticPageMapOutput{})
|
|
|
|
}
|