pulumi/tests/testdata/codegen/plain-and-default-go-generi.../go/foo/moduleResource.go

183 lines
5.8 KiB
Go
Raw Permalink Normal View History

[go/sdk-gen] Fix generics-only option missing ToOutput(...) methods (#14584) # Description PR #14492 removed `ToOutput(...)` methods for output types when generating non-generic SDK variants. The fix there was added to only include these when `side-by-side` is enabled, which implicitly included `generics-only` except for a _single_ place where that wasn't the case 😓 (see comment below in `gen.go`) This PR fixes issue and includes tests for go sdkgen where `generics` setting is set to `generics-only`: - `output-funcs-go-generics-only` - `plain-and-default-go-generics-only` - `secrets-go-generics-only` - `simple-enum-schema-go-generics-only` - `simple-plain-schema-go-generics-only` ## Checklist - [ ] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [x] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2023-11-16 18:41:57 +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! ***
package foo
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumix"
"plain-and-default-go-generics-only/foo/internal"
)
type ModuleResource struct {
pulumi.CustomResourceState
OptionalBool pulumix.Output[*bool] `pulumi:"optionalBool"`
[go/sdk-gen] Fix generics-only option missing ToOutput(...) methods (#14584) # Description PR #14492 removed `ToOutput(...)` methods for output types when generating non-generic SDK variants. The fix there was added to only include these when `side-by-side` is enabled, which implicitly included `generics-only` except for a _single_ place where that wasn't the case 😓 (see comment below in `gen.go`) This PR fixes issue and includes tests for go sdkgen where `generics` setting is set to `generics-only`: - `output-funcs-go-generics-only` - `plain-and-default-go-generics-only` - `secrets-go-generics-only` - `simple-enum-schema-go-generics-only` - `simple-plain-schema-go-generics-only` ## Checklist - [ ] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [x] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2023-11-16 18:41:57 +00:00
}
// NewModuleResource registers a new resource with the given unique name, arguments, and options.
func NewModuleResource(ctx *pulumi.Context,
name string, args *ModuleResourceArgs, opts ...pulumi.ResourceOption) (*ModuleResource, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.OptionalBool == nil {
args.OptionalBool = pulumix.Ptr(true)
[go/sdk-gen] Fix generics-only option missing ToOutput(...) methods (#14584) # Description PR #14492 removed `ToOutput(...)` methods for output types when generating non-generic SDK variants. The fix there was added to only include these when `side-by-side` is enabled, which implicitly included `generics-only` except for a _single_ place where that wasn't the case 😓 (see comment below in `gen.go`) This PR fixes issue and includes tests for go sdkgen where `generics` setting is set to `generics-only`: - `output-funcs-go-generics-only` - `plain-and-default-go-generics-only` - `secrets-go-generics-only` - `simple-enum-schema-go-generics-only` - `simple-plain-schema-go-generics-only` ## Checklist - [ ] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [x] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2023-11-16 18:41:57 +00:00
}
args.OptionalConst = pulumix.Ptr("val")
if args.OptionalEnum == nil {
args.OptionalEnum = pulumix.Ptr(EnumThing(8))
[go/sdk-gen] Fix generics-only option missing ToOutput(...) methods (#14584) # Description PR #14492 removed `ToOutput(...)` methods for output types when generating non-generic SDK variants. The fix there was added to only include these when `side-by-side` is enabled, which implicitly included `generics-only` except for a _single_ place where that wasn't the case 😓 (see comment below in `gen.go`) This PR fixes issue and includes tests for go sdkgen where `generics` setting is set to `generics-only`: - `output-funcs-go-generics-only` - `plain-and-default-go-generics-only` - `secrets-go-generics-only` - `simple-enum-schema-go-generics-only` - `simple-plain-schema-go-generics-only` ## Checklist - [ ] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [x] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2023-11-16 18:41:57 +00:00
}
if args.OptionalNumber == nil {
args.OptionalNumber = pulumix.Ptr(42.0)
[go/sdk-gen] Fix generics-only option missing ToOutput(...) methods (#14584) # Description PR #14492 removed `ToOutput(...)` methods for output types when generating non-generic SDK variants. The fix there was added to only include these when `side-by-side` is enabled, which implicitly included `generics-only` except for a _single_ place where that wasn't the case 😓 (see comment below in `gen.go`) This PR fixes issue and includes tests for go sdkgen where `generics` setting is set to `generics-only`: - `output-funcs-go-generics-only` - `plain-and-default-go-generics-only` - `secrets-go-generics-only` - `simple-enum-schema-go-generics-only` - `simple-plain-schema-go-generics-only` ## Checklist - [ ] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [x] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2023-11-16 18:41:57 +00:00
}
if args.OptionalString == nil {
args.OptionalString = pulumix.Ptr("buzzer")
[go/sdk-gen] Fix generics-only option missing ToOutput(...) methods (#14584) # Description PR #14492 removed `ToOutput(...)` methods for output types when generating non-generic SDK variants. The fix there was added to only include these when `side-by-side` is enabled, which implicitly included `generics-only` except for a _single_ place where that wasn't the case 😓 (see comment below in `gen.go`) This PR fixes issue and includes tests for go sdkgen where `generics` setting is set to `generics-only`: - `output-funcs-go-generics-only` - `plain-and-default-go-generics-only` - `secrets-go-generics-only` - `simple-enum-schema-go-generics-only` - `simple-plain-schema-go-generics-only` ## Checklist - [ ] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [x] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2023-11-16 18:41:57 +00:00
}
if args.PlainOptionalBool == nil {
plainOptionalBool_ := true
args.PlainOptionalBool = &plainOptionalBool_
[go/sdk-gen] Fix generics-only option missing ToOutput(...) methods (#14584) # Description PR #14492 removed `ToOutput(...)` methods for output types when generating non-generic SDK variants. The fix there was added to only include these when `side-by-side` is enabled, which implicitly included `generics-only` except for a _single_ place where that wasn't the case 😓 (see comment below in `gen.go`) This PR fixes issue and includes tests for go sdkgen where `generics` setting is set to `generics-only`: - `output-funcs-go-generics-only` - `plain-and-default-go-generics-only` - `secrets-go-generics-only` - `simple-enum-schema-go-generics-only` - `simple-plain-schema-go-generics-only` ## Checklist - [ ] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [x] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2023-11-16 18:41:57 +00:00
}
plainOptionalConst_ := "val"
args.PlainOptionalConst = &plainOptionalConst_
if args.PlainOptionalNumber == nil {
plainOptionalNumber_ := 42.0
args.PlainOptionalNumber = &plainOptionalNumber_
[go/sdk-gen] Fix generics-only option missing ToOutput(...) methods (#14584) # Description PR #14492 removed `ToOutput(...)` methods for output types when generating non-generic SDK variants. The fix there was added to only include these when `side-by-side` is enabled, which implicitly included `generics-only` except for a _single_ place where that wasn't the case 😓 (see comment below in `gen.go`) This PR fixes issue and includes tests for go sdkgen where `generics` setting is set to `generics-only`: - `output-funcs-go-generics-only` - `plain-and-default-go-generics-only` - `secrets-go-generics-only` - `simple-enum-schema-go-generics-only` - `simple-plain-schema-go-generics-only` ## Checklist - [ ] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [x] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2023-11-16 18:41:57 +00:00
}
if args.PlainOptionalString == nil {
plainOptionalString_ := "buzzer"
args.PlainOptionalString = &plainOptionalString_
[go/sdk-gen] Fix generics-only option missing ToOutput(...) methods (#14584) # Description PR #14492 removed `ToOutput(...)` methods for output types when generating non-generic SDK variants. The fix there was added to only include these when `side-by-side` is enabled, which implicitly included `generics-only` except for a _single_ place where that wasn't the case 😓 (see comment below in `gen.go`) This PR fixes issue and includes tests for go sdkgen where `generics` setting is set to `generics-only`: - `output-funcs-go-generics-only` - `plain-and-default-go-generics-only` - `secrets-go-generics-only` - `simple-enum-schema-go-generics-only` - `simple-plain-schema-go-generics-only` ## Checklist - [ ] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [x] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2023-11-16 18:41:57 +00:00
}
if internal.IsZero(args.PlainRequiredBool) {
args.PlainRequiredBool = true
[go/sdk-gen] Fix generics-only option missing ToOutput(...) methods (#14584) # Description PR #14492 removed `ToOutput(...)` methods for output types when generating non-generic SDK variants. The fix there was added to only include these when `side-by-side` is enabled, which implicitly included `generics-only` except for a _single_ place where that wasn't the case 😓 (see comment below in `gen.go`) This PR fixes issue and includes tests for go sdkgen where `generics` setting is set to `generics-only`: - `output-funcs-go-generics-only` - `plain-and-default-go-generics-only` - `secrets-go-generics-only` - `simple-enum-schema-go-generics-only` - `simple-plain-schema-go-generics-only` ## Checklist - [ ] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [x] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2023-11-16 18:41:57 +00:00
}
args.PlainRequiredConst = "val"
if internal.IsZero(args.PlainRequiredNumber) {
args.PlainRequiredNumber = 42.0
[go/sdk-gen] Fix generics-only option missing ToOutput(...) methods (#14584) # Description PR #14492 removed `ToOutput(...)` methods for output types when generating non-generic SDK variants. The fix there was added to only include these when `side-by-side` is enabled, which implicitly included `generics-only` except for a _single_ place where that wasn't the case 😓 (see comment below in `gen.go`) This PR fixes issue and includes tests for go sdkgen where `generics` setting is set to `generics-only`: - `output-funcs-go-generics-only` - `plain-and-default-go-generics-only` - `secrets-go-generics-only` - `simple-enum-schema-go-generics-only` - `simple-plain-schema-go-generics-only` ## Checklist - [ ] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [x] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2023-11-16 18:41:57 +00:00
}
if internal.IsZero(args.PlainRequiredString) {
args.PlainRequiredString = "buzzer"
[go/sdk-gen] Fix generics-only option missing ToOutput(...) methods (#14584) # Description PR #14492 removed `ToOutput(...)` methods for output types when generating non-generic SDK variants. The fix there was added to only include these when `side-by-side` is enabled, which implicitly included `generics-only` except for a _single_ place where that wasn't the case 😓 (see comment below in `gen.go`) This PR fixes issue and includes tests for go sdkgen where `generics` setting is set to `generics-only`: - `output-funcs-go-generics-only` - `plain-and-default-go-generics-only` - `secrets-go-generics-only` - `simple-enum-schema-go-generics-only` - `simple-plain-schema-go-generics-only` ## Checklist - [ ] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [x] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2023-11-16 18:41:57 +00:00
}
if args.RequiredBool == nil {
args.RequiredBool = pulumix.Val(true)
[go/sdk-gen] Fix generics-only option missing ToOutput(...) methods (#14584) # Description PR #14492 removed `ToOutput(...)` methods for output types when generating non-generic SDK variants. The fix there was added to only include these when `side-by-side` is enabled, which implicitly included `generics-only` except for a _single_ place where that wasn't the case 😓 (see comment below in `gen.go`) This PR fixes issue and includes tests for go sdkgen where `generics` setting is set to `generics-only`: - `output-funcs-go-generics-only` - `plain-and-default-go-generics-only` - `secrets-go-generics-only` - `simple-enum-schema-go-generics-only` - `simple-plain-schema-go-generics-only` ## Checklist - [ ] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [x] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2023-11-16 18:41:57 +00:00
}
if args.RequiredEnum == nil {
args.RequiredEnum = pulumix.Val(EnumThing(4))
[go/sdk-gen] Fix generics-only option missing ToOutput(...) methods (#14584) # Description PR #14492 removed `ToOutput(...)` methods for output types when generating non-generic SDK variants. The fix there was added to only include these when `side-by-side` is enabled, which implicitly included `generics-only` except for a _single_ place where that wasn't the case 😓 (see comment below in `gen.go`) This PR fixes issue and includes tests for go sdkgen where `generics` setting is set to `generics-only`: - `output-funcs-go-generics-only` - `plain-and-default-go-generics-only` - `secrets-go-generics-only` - `simple-enum-schema-go-generics-only` - `simple-plain-schema-go-generics-only` ## Checklist - [ ] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [x] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2023-11-16 18:41:57 +00:00
}
if args.RequiredNumber == nil {
args.RequiredNumber = pulumix.Val(42.0)
[go/sdk-gen] Fix generics-only option missing ToOutput(...) methods (#14584) # Description PR #14492 removed `ToOutput(...)` methods for output types when generating non-generic SDK variants. The fix there was added to only include these when `side-by-side` is enabled, which implicitly included `generics-only` except for a _single_ place where that wasn't the case 😓 (see comment below in `gen.go`) This PR fixes issue and includes tests for go sdkgen where `generics` setting is set to `generics-only`: - `output-funcs-go-generics-only` - `plain-and-default-go-generics-only` - `secrets-go-generics-only` - `simple-enum-schema-go-generics-only` - `simple-plain-schema-go-generics-only` ## Checklist - [ ] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [x] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2023-11-16 18:41:57 +00:00
}
if args.RequiredString == nil {
args.RequiredString = pulumix.Val("buzzer")
[go/sdk-gen] Fix generics-only option missing ToOutput(...) methods (#14584) # Description PR #14492 removed `ToOutput(...)` methods for output types when generating non-generic SDK variants. The fix there was added to only include these when `side-by-side` is enabled, which implicitly included `generics-only` except for a _single_ place where that wasn't the case 😓 (see comment below in `gen.go`) This PR fixes issue and includes tests for go sdkgen where `generics` setting is set to `generics-only`: - `output-funcs-go-generics-only` - `plain-and-default-go-generics-only` - `secrets-go-generics-only` - `simple-enum-schema-go-generics-only` - `simple-plain-schema-go-generics-only` ## Checklist - [ ] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [x] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2023-11-16 18:41:57 +00:00
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource ModuleResource
err := ctx.RegisterResource("foobar::ModuleResource", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetModuleResource gets an existing ModuleResource resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetModuleResource(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ModuleResourceState, opts ...pulumi.ResourceOption) (*ModuleResource, error) {
var resource ModuleResource
err := ctx.ReadResource("foobar::ModuleResource", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ModuleResource resources.
type moduleResourceState struct {
}
type ModuleResourceState struct {
}
func (ModuleResourceState) ElementType() reflect.Type {
return reflect.TypeOf((*moduleResourceState)(nil)).Elem()
}
type moduleResourceArgs struct {
OptionalBool *bool `pulumi:"optionalBool"`
OptionalConst *string `pulumi:"optionalConst"`
OptionalEnum *EnumThing `pulumi:"optionalEnum"`
OptionalNumber *float64 `pulumi:"optionalNumber"`
OptionalString *string `pulumi:"optionalString"`
PlainOptionalBool *bool `pulumi:"plainOptionalBool"`
PlainOptionalConst *string `pulumi:"plainOptionalConst"`
PlainOptionalNumber *float64 `pulumi:"plainOptionalNumber"`
PlainOptionalString *string `pulumi:"plainOptionalString"`
PlainRequiredBool bool `pulumi:"plainRequiredBool"`
PlainRequiredConst string `pulumi:"plainRequiredConst"`
PlainRequiredNumber float64 `pulumi:"plainRequiredNumber"`
PlainRequiredString string `pulumi:"plainRequiredString"`
RequiredBool bool `pulumi:"requiredBool"`
RequiredEnum EnumThing `pulumi:"requiredEnum"`
RequiredNumber float64 `pulumi:"requiredNumber"`
RequiredString string `pulumi:"requiredString"`
[go/sdk-gen] Fix generics-only option missing ToOutput(...) methods (#14584) # Description PR #14492 removed `ToOutput(...)` methods for output types when generating non-generic SDK variants. The fix there was added to only include these when `side-by-side` is enabled, which implicitly included `generics-only` except for a _single_ place where that wasn't the case 😓 (see comment below in `gen.go`) This PR fixes issue and includes tests for go sdkgen where `generics` setting is set to `generics-only`: - `output-funcs-go-generics-only` - `plain-and-default-go-generics-only` - `secrets-go-generics-only` - `simple-enum-schema-go-generics-only` - `simple-plain-schema-go-generics-only` ## Checklist - [ ] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [x] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2023-11-16 18:41:57 +00:00
}
// The set of arguments for constructing a ModuleResource resource.
type ModuleResourceArgs struct {
OptionalBool pulumix.Input[*bool]
OptionalConst pulumix.Input[*string]
OptionalEnum pulumix.Input[*EnumThing]
OptionalNumber pulumix.Input[*float64]
OptionalString pulumix.Input[*string]
PlainOptionalBool *bool
PlainOptionalConst *string
PlainOptionalNumber *float64
PlainOptionalString *string
PlainRequiredBool bool
PlainRequiredConst string
PlainRequiredNumber float64
PlainRequiredString string
RequiredBool pulumix.Input[bool]
RequiredEnum pulumix.Input[EnumThing]
RequiredNumber pulumix.Input[float64]
RequiredString pulumix.Input[string]
[go/sdk-gen] Fix generics-only option missing ToOutput(...) methods (#14584) # Description PR #14492 removed `ToOutput(...)` methods for output types when generating non-generic SDK variants. The fix there was added to only include these when `side-by-side` is enabled, which implicitly included `generics-only` except for a _single_ place where that wasn't the case 😓 (see comment below in `gen.go`) This PR fixes issue and includes tests for go sdkgen where `generics` setting is set to `generics-only`: - `output-funcs-go-generics-only` - `plain-and-default-go-generics-only` - `secrets-go-generics-only` - `simple-enum-schema-go-generics-only` - `simple-plain-schema-go-generics-only` ## Checklist - [ ] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [x] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2023-11-16 18:41:57 +00:00
}
func (ModuleResourceArgs) ElementType() reflect.Type {
return reflect.TypeOf((*moduleResourceArgs)(nil)).Elem()
}
type ModuleResourceOutput struct{ *pulumi.OutputState }
func (ModuleResourceOutput) ElementType() reflect.Type {
return reflect.TypeOf((*ModuleResource)(nil)).Elem()
}
func (o ModuleResourceOutput) ToModuleResourceOutput() ModuleResourceOutput {
return o
}
func (o ModuleResourceOutput) ToModuleResourceOutputWithContext(ctx context.Context) ModuleResourceOutput {
return o
}
func (o ModuleResourceOutput) ToOutput(ctx context.Context) pulumix.Output[ModuleResource] {
return pulumix.Output[ModuleResource]{
OutputState: o.OutputState,
}
}
func (o ModuleResourceOutput) OptionalBool() pulumix.Output[*bool] {
value := pulumix.Apply[ModuleResource](o, func(v ModuleResource) pulumix.Output[*bool] { return v.OptionalBool })
[go/sdk-gen] Fix generics-only option missing ToOutput(...) methods (#14584) # Description PR #14492 removed `ToOutput(...)` methods for output types when generating non-generic SDK variants. The fix there was added to only include these when `side-by-side` is enabled, which implicitly included `generics-only` except for a _single_ place where that wasn't the case 😓 (see comment below in `gen.go`) This PR fixes issue and includes tests for go sdkgen where `generics` setting is set to `generics-only`: - `output-funcs-go-generics-only` - `plain-and-default-go-generics-only` - `secrets-go-generics-only` - `simple-enum-schema-go-generics-only` - `simple-plain-schema-go-generics-only` ## Checklist - [ ] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [x] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2023-11-16 18:41:57 +00:00
return pulumix.Flatten[*bool, pulumix.Output[*bool]](value)
}
func init() {
pulumi.RegisterOutputType(ModuleResourceOutput{})
}