Compare commits

..

15 commits

Author SHA1 Message Date
Anton Tayanovskyy 4d4ff9f1d6
Fixes 8403 name conflicts in Go codegen (#8492)
* Apply fn renaming on Result name conflict

* Add tests

* Add test declaration to test driver

* Accept baselines for other langs
2021-11-24 20:13:47 -05:00
Fraser Waters 2d26cdd9ed
Run validate function even if dryRun=true (#8494)
Hit this while trying to add some validation checks to runs of Preview while using plans. Seems one test actually was assuming this was the case already and just hasn't been running it's expected validate function.
2021-11-24 22:13:29 +00:00
Pat Gavlin b14bc09b1c
Update a misleading comment. (#8491) 2021-11-24 10:37:08 -08:00
Fraser Waters 09b7aa9186
Add String and GoString to Result (#8490)
I got fed up of assert errors in tests that looked like:
```
Expected nil, but got: &result.simpleResult{err:(*errors.fundamental)(0xc0002fa5d0)}
```

It was very hard to work out at a glance what had gone wrong and I kept
having to hook a debugger just to look at what the error was.

With GoString these now print something like:
```
Expected nil, but got: &simpleResult{err: Unexpected diag message: <{%reset%}>resource violates plan: properties changed: -zed, -baz, -foo<{%reset%}>
}
```

Which is much more useful.
2021-11-24 17:01:55 +00:00
Alex Mullans c39343fa3d
Update CONTRIBUTING.md with latest information (#8451)
* Update CONTRIBUTING.md

* Add `make dist` to recommended make targets
2021-11-23 16:31:56 -08:00
Ian Wahbe 4b7985384c
[codegen/go] Call site defaults for Pulumi Object types (#8411)
* Add test case

* Fix tests

* Add test dependencies correctly

* Feed through error handling

* Include test output

* Get types to line up

* Add remaining test files

* Update changelog

* Correctly find type paths

* Handle transitive objects

* Handle required fields

* Add feature flag for go

* Add required+default test case

* Don't `<any>` cast known types.

* Add more flags.

I realize this should really wait for PR#8400 to merge.

* Add plain object to env-helper test

This test fails right now. My next problem is fixing it.

* Handle plain types

* Handle function inputs

* Fix the indentation

* Handle output types correctly

* Remove unnecessary `!`

* Add test case

* Fix tests

* Add test dependencies correctly

* Feed through error handling

* Include test output

* Get types to line up

* Add remaining test files

* Update changelog

* Correctly find type paths

* Handle transitive objects

* Handle required fields

* Add required+default test case

* Don't `<any>` cast known types.

* Add plain object to env-helper test

This test fails right now. My next problem is fixing it.

* Handle plain types

* Handle function inputs

* Fix the indentation

* Handle output types correctly

* Remove unnecessary `!`

* Start on `genPlainObjectDefaultFunc`

* Add missing change to fix test

* Run tests with merge

* Refactor out assign

* Merge in next _index.md diff

* Change method name to `Defaults`

* Handle enums correctly

* Another attempt at _index.md

* Make module generation deterministic

* Add checks for old values

* Insert defaults in resources

* Fix docs generation

Credit to @praneetloke

* Progress on adding defaults to Resource arguments

* Handle resource argument defaults

* Don't create defaults if disableObjectDefaults

* Rename test folder

* Add test for disable flag

* Fix disable test

* Update docs

* Abstract out nil comparisons

* Use reflection to test for empty values

* Simplify Ptr and pulumi.Any type handling

* Remove unused function

* Apply defaults to functions

* Update new test with master codegen

* Tests + nil check
2021-11-23 15:10:15 -08:00
Anton Tayanovskyy 6cb801cf17
Add a unit test to check Array/Index (#8486) 2021-11-23 16:52:02 -05:00
Pat Gavlin 52d01bb915
[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 10:24:56 -08:00
Ian Wahbe c1c82b8317
Change build green link from travis to github (#8483) 2021-11-22 17:00:05 -08:00
Ian Wahbe e77d780370
Cleanup CHANGELOG_PENDING.md (#8482) 2021-11-22 16:59:22 -08:00
Ian Wahbe 72a4e1fc3f
Update pkg -> sdk dependency (#8481) 2021-11-22 14:39:54 -08:00
Ian Wahbe c6cefcd3f4
Prepare for v3.18.1 release (#8480) 2021-11-22 14:30:47 -08:00
Ian Wahbe 4029a1c89b
iwahbe/8474/dont serialize unknown values (#8475)
* Don't serialize unknown values

* Add test

* Update CHANGELOG_PENDING.md
2021-11-22 12:40:17 -08:00
Ian Wahbe d9dd88c740
Add tsconfig option to specify tsconfig path (#8452)
* Add tsconfig option to specify tsconfig path

* Add CHANGELOG entry and fix lint

* Add a test

* Fix test
2021-11-22 11:42:39 -08:00
Anton Tayanovskyy 574a6a104d
Do not FailNow() in generators (#8469) 2021-11-19 20:39:11 -05:00
342 changed files with 11128 additions and 2615 deletions

View file

@ -1,6 +1,43 @@
CHANGELOG
=========
## 3.18.1 (2021-11-22)
### Improvements
- [cli] - When running `pulumi new https://github.com/name/repo`, check
for branch `main` if branch `master` doesn't exist.
[#8463](https://github.com/pulumi/pulumi/pull/8463)
- [codegen/python] - Program generator now uses `fn_output` forms where
appropriate, simplifying auto-generated examples.
[#8433](https://github.com/pulumi/pulumi/pull/8433)
- [codegen/go] - Program generator now uses fnOutput forms where
appropriate, simplifying auto-generated examples.
[#8431](https://github.com/pulumi/pulumi/pull/8431)
- [codegen/dotnet] - Program generator now uses `Invoke` forms where
appropriate, simplifying auto-generated examples.
[#8432](https://github.com/pulumi/pulumi/pull/8432)
### Bug Fixes
- [cli/nodejs] - Allow specifying the tsconfig file used in Pulumi.yaml.
[#8452](https://github.com/pulumi/pulumi/pull/8452)
- [codegen/nodejs] - Respect default values in Pulumi object types.
[#8400](https://github.com/pulumi/pulumi/pull/8400)
- [sdk/python] - Correctly handle version checking python virtual environments.
[#8465](https://github.com/pulumi/pulumi/pull/8465)
- [cli] - Catch expected errors in stacks with filestate backends.
[#8455](https://github.com/pulumi/pulumi/pull/8455)
- [sdk/dotnet] - Do not attempt to serialize unknown values.
[#8475](https://github.com/pulumi/pulumi/pull/8475)
## 3.18.0 (2021-11-17)
### Improvements

View file

@ -1,31 +1,12 @@
### Improvements
- [cli] - When running `pulumi new https://github.com/name/repo`, check
for branch `main` if branch `master` doesn't exist.
[#8463](https://github.com/pulumi/pulumi/pull/8463)
- [codegen/python] - Program generator now uses `fn_output` forms where
appropriate, simplifying auto-generated examples.
[#8433](https://github.com/pulumi/pulumi/pull/8433)
- [codegen/go] - Program generator now uses fnOutput forms where
appropriate, simplifying auto-generated examples.
[#8431](https://github.com/pulumi/pulumi/pull/8431)
- [codegen/dotnet] - Program generator now uses `Invoke` forms where
appropriate, simplifying auto-generated examples.
[#8432](https://github.com/pulumi/pulumi/pull/8432)
- [codegen/go] - Remove `ResourcePtr` types from generated SDKs. Besides being
unnecessary--`Resource` types already accommodate `nil` to indicate the lack of
a value--the implementation of `Ptr` types for resources was incorrect, making
these types virtually unusable in practice.
[#8449](https://github.com/pulumi/pulumi/pull/8449)
### Bug Fixes
- [codegen/typescript] - Respect default values in Pulumi object types.
[#8400](https://github.com/pulumi/pulumi/pull/8400)
- [codegen] - Forbid nonsensical combinations of schema property flags.
[#8373](https://github.com/pulumi/pulumi/pull/8373)
- [sdk/python] - Correctly handle version checking python virtual environments.
[#8465](https://github.com/pulumi/pulumi/pull/8465)
- [cli] - Catch expected errors in stacks with filestate backends.
[#8455](https://github.com/pulumi/pulumi/pull/8455)
- [codegen/go] - Respect default values in Pulumi object types.
[#8411](https://github.com/pulumi/pulumi/pull/8400)

View file

@ -22,7 +22,7 @@ To hack on Pulumi, you'll need to get a development environment set up. You'll w
You can easily get all required dependencies with brew and npm
```bash
brew install node pipenv python@3 typescript yarn go@1.17 golangci/tap/golangci-lint pulumi/tap/pulumictl
brew install node pipenv python@3 typescript yarn go@1.17 golangci/tap/golangci-lint pulumi/tap/pulumictl coreutils
curl https://raw.githubusercontent.com/Homebrew/homebrew-cask/0272f0d33f/Casks/dotnet-sdk.rb > dotnet-sdk.rb # v3.1.0
brew install --HEAD -s dotnet-sdk.rb
rm dotnet-sdk.rb
@ -53,9 +53,10 @@ ulimit -n 5000
Across our projects, we try to use a regular set of make targets. The ones you'll care most about are:
0. `make ensure`, which restores/installs any build dependencies
1. `make ensure`, which restores/installs any build dependencies
1. `make dist`, which just builds and installs the Pulumi CLI
1. `make`, which builds Pulumi and runs a quick set of tests
2. `make all` which builds Pulumi and runs the quick tests and a larger set of tests.
1. `make all` which builds Pulumi and runs the quick tests and a larger set of tests.
We make heavy use of integration level testing where we invoke `pulumi` to create and then delete cloud resources. This requires you to have a Pulumi account (so [sign up for free](https://pulumi.com) today if you haven't already) and login with `pulumi login`.

View file

@ -173,8 +173,8 @@ details of the core Pulumi CLI and [programming model concepts](https://www.pulu
| Architecture | Build Status |
| ------------ | ------------ |
| Linux/macOS x64 | [![Linux x64 Build Status](https://travis-ci.com/pulumi/pulumi.svg?token=cTUUEgrxaTEGyecqJpDn&branch=master)](https://travis-ci.com/pulumi/pulumi) |
| Windows x64 | [![Windows x64 Build Status](https://ci.appveyor.com/api/projects/status/uqrduw6qnoss7g4i?svg=true&branch=master)](https://ci.appveyor.com/project/pulumi/pulumi) |
| Linux/macOS x64 | [![Linux x64 Build Status](https://github.com/pulumi/pulumi/actions/workflows/master.yml/badge.svg)](https://github.com/pulumi/pulumi/actions/workflows/master.yml) |
| Windows x64 | [![Windows x64 Build Status](https://ci.appveyor.com/api/projects/status/uqrduw6qnoss7g4i?svg=true&branch=master)](https://ci.appveyor.com/project/pulumi/pulumi) |
### Languages

View file

@ -114,6 +114,9 @@ type pkgContext struct {
// Determines if we should emit type registration code
disableInputTypeRegistrations bool
// Determines if we should emit object defaults code
disableObjectDefaults bool
}
func (pkg *pkgContext) detailsForType(t schema.Type) *typeDetails {
@ -269,6 +272,7 @@ func rawResourceName(r *schema.Resource) string {
return tokenToName(r.Token)
}
// If `nil` is a valid value of type `t`.
func isNilType(t schema.Type) bool {
switch t := t.(type) {
case *schema.OptionalType, *schema.ArrayType, *schema.MapType, *schema.ResourceType, *schema.InputType:
@ -295,23 +299,6 @@ func isNilType(t schema.Type) bool {
return false
}
// The default value for a Pulumi primitive type.
func primitiveNilValue(t schema.Type) string {
contract.Assert(schema.IsPrimitiveType(t))
switch t {
case schema.BoolType:
return "false"
case schema.IntType:
return "0"
case schema.NumberType:
return "0.0"
case schema.StringType:
return "\"\""
default:
return "nil"
}
}
func (pkg *pkgContext) inputType(t schema.Type) (result string) {
switch t := codegen.SimplifyInputUnion(t).(type) {
case *schema.OptionalType:
@ -513,7 +500,12 @@ func (pkg *pkgContext) typeStringImpl(t schema.Type, argsType bool) string {
}
func (pkg *pkgContext) typeString(t schema.Type) string {
return pkg.typeStringImpl(t, false)
s := pkg.typeStringImpl(t, false)
if s == "pulumi." {
return "pulumi.Any"
}
return s
}
func (pkg *pkgContext) isExternalReference(t schema.Type) bool {
@ -633,6 +625,9 @@ func (pkg *pkgContext) outputType(t schema.Type) string {
}
// TODO(pdg): union types
return "pulumi.AnyOutput"
case *schema.InputType:
// We can't make output types for input types. We instead strip the input and try again.
return pkg.outputType(t.ElementType)
default:
switch t {
case schema.BoolType:
@ -784,16 +779,14 @@ type genInputImplementationArgs struct {
elementType string
ptrMethods bool
toOutputMethods bool
resourceType bool
}
func genInputImplementation(w io.Writer, name, receiverType, elementType string, ptrMethods, resourceType bool) {
func genInputImplementation(w io.Writer, name, receiverType, elementType string, ptrMethods bool) {
genInputImplementationWithArgs(w, genInputImplementationArgs{
name: name,
receiverType: receiverType,
elementType: elementType,
ptrMethods: ptrMethods,
resourceType: resourceType,
toOutputMethods: true,
})
}
@ -802,14 +795,9 @@ func genInputImplementationWithArgs(w io.Writer, genArgs genInputImplementationA
name := genArgs.name
receiverType := genArgs.receiverType
elementType := genArgs.elementType
resourceType := genArgs.resourceType
fmt.Fprintf(w, "func (%s) ElementType() reflect.Type {\n", receiverType)
if resourceType {
fmt.Fprintf(w, "\treturn reflect.TypeOf((*%s)(nil))\n", elementType)
} else {
fmt.Fprintf(w, "\treturn reflect.TypeOf((*%s)(nil)).Elem()\n", elementType)
}
fmt.Fprintf(w, "\treturn reflect.TypeOf((*%s)(nil)).Elem()\n", elementType)
fmt.Fprintf(w, "}\n\n")
if genArgs.toOutputMethods {
@ -837,15 +825,11 @@ func genInputImplementationWithArgs(w io.Writer, genArgs genInputImplementationA
}
}
func genOutputType(w io.Writer, baseName, elementType string, ptrMethods, resourceType bool) {
func genOutputType(w io.Writer, baseName, elementType string, ptrMethods bool) {
fmt.Fprintf(w, "type %sOutput struct { *pulumi.OutputState }\n\n", baseName)
fmt.Fprintf(w, "func (%sOutput) ElementType() reflect.Type {\n", baseName)
if resourceType {
fmt.Fprintf(w, "\treturn reflect.TypeOf((*%s)(nil))\n", elementType)
} else {
fmt.Fprintf(w, "\treturn reflect.TypeOf((*%s)(nil)).Elem()\n", elementType)
}
fmt.Fprintf(w, "\treturn reflect.TypeOf((*%s)(nil)).Elem()\n", elementType)
fmt.Fprintf(w, "}\n\n")
fmt.Fprintf(w, "func (o %[1]sOutput) To%[2]sOutput() %[1]sOutput {\n", baseName, Title(baseName))
@ -869,8 +853,8 @@ func genOutputType(w io.Writer, baseName, elementType string, ptrMethods, resour
}
}
func genArrayOutput(w io.Writer, baseName, elementType string, resourceType bool) {
genOutputType(w, baseName+"Array", "[]"+elementType, false, resourceType)
func genArrayOutput(w io.Writer, baseName, elementType string) {
genOutputType(w, baseName+"Array", "[]"+elementType, false)
fmt.Fprintf(w, "func (o %[1]sArrayOutput) Index(i pulumi.IntInput) %[1]sOutput {\n", baseName)
fmt.Fprintf(w, "\treturn pulumi.All(o, i).ApplyT(func (vs []interface{}) %s {\n", elementType)
@ -879,8 +863,8 @@ func genArrayOutput(w io.Writer, baseName, elementType string, resourceType bool
fmt.Fprintf(w, "}\n\n")
}
func genMapOutput(w io.Writer, baseName, elementType string, resourceType bool) {
genOutputType(w, baseName+"Map", "map[string]"+elementType, false, resourceType)
func genMapOutput(w io.Writer, baseName, elementType string) {
genOutputType(w, baseName+"Map", "map[string]"+elementType, false)
fmt.Fprintf(w, "func (o %[1]sMapOutput) MapIndex(k pulumi.StringInput) %[1]sOutput {\n", baseName)
fmt.Fprintf(w, "\treturn pulumi.All(o, k).ApplyT(func (vs []interface{}) %s{\n", elementType)
@ -889,8 +873,8 @@ func genMapOutput(w io.Writer, baseName, elementType string, resourceType bool)
fmt.Fprintf(w, "}\n\n")
}
func genPtrOutput(w io.Writer, baseName, elementType string, resourceType bool) {
genOutputType(w, baseName+"Ptr", "*"+elementType, false, resourceType)
func genPtrOutput(w io.Writer, baseName, elementType string) {
genOutputType(w, baseName+"Ptr", "*"+elementType, false)
fmt.Fprintf(w, "func (o %[1]sPtrOutput) Elem() %[1]sOutput {\n", baseName)
fmt.Fprintf(w, "\treturn o.ApplyT(func(v *%[1]s) %[1]s {\n", baseName)
@ -956,7 +940,7 @@ func (pkg *pkgContext) genEnum(w io.Writer, enumType *schema.EnumType) error {
fmt.Fprintf(w, "type %[1]sArray []%[1]s\n\n", name)
genInputImplementation(w, name+"Array", name+"Array", "[]"+name, false, false)
genInputImplementation(w, name+"Array", name+"Array", "[]"+name, false)
}
// Generate the map input.
@ -965,24 +949,24 @@ func (pkg *pkgContext) genEnum(w io.Writer, enumType *schema.EnumType) error {
fmt.Fprintf(w, "type %[1]sMap map[string]%[1]s\n\n", name)
genInputImplementation(w, name+"Map", name+"Map", "map[string]"+name, false, false)
genInputImplementation(w, name+"Map", name+"Map", "map[string]"+name, false)
}
// Generate the array output
if details.arrayElement {
genArrayOutput(w, name, name, false)
genArrayOutput(w, name, name)
}
// Generate the map output.
if details.mapElement {
genMapOutput(w, name, name, false)
genMapOutput(w, name, name)
}
return nil
}
func (pkg *pkgContext) genEnumOutputTypes(w io.Writer, name, elementArgsType, elementGoType, asFuncName string) {
genOutputType(w, name, name, true, false)
genOutputType(w, name, name, true)
fmt.Fprintf(w, "func (o %[1]sOutput) To%[2]sOutput() %[3]sOutput {\n", name, asFuncName, elementArgsType)
fmt.Fprintf(w, "return o.To%sOutputWithContext(context.Background())\n", asFuncName)
@ -1005,7 +989,7 @@ func (pkg *pkgContext) genEnumOutputTypes(w io.Writer, name, elementArgsType, el
fmt.Fprintf(w, "}).(%sPtrOutput)\n", elementArgsType)
fmt.Fprint(w, "}\n\n")
genPtrOutput(w, name, name, false)
genPtrOutput(w, name, name)
fmt.Fprintf(w, "func (o %[1]sPtrOutput) To%[2]sPtrOutput() %[3]sPtrOutput {\n", name, asFuncName, elementArgsType)
fmt.Fprintf(w, "return o.To%sPtrOutputWithContext(context.Background())\n", asFuncName)
@ -1107,6 +1091,27 @@ func (pkg *pkgContext) genEnumInputFuncs(w io.Writer, typeName string, enum *sch
fmt.Fprintln(w)
}
func (pkg *pkgContext) assignProperty(w io.Writer, p *schema.Property, object, value string, indirectAssign bool) {
t := strings.TrimSuffix(pkg.typeString(p.Type), "Input")
switch codegen.UnwrapType(p.Type).(type) {
case *schema.EnumType:
t = ""
}
if codegen.IsNOptionalInput(p.Type) {
if t != "" {
value = fmt.Sprintf("%s(%s)", t, value)
}
fmt.Fprintf(w, "\targs.%s = %s\n", Title(p.Name), value)
} else if indirectAssign {
tmpName := camel(p.Name) + "_"
fmt.Fprintf(w, "%s := %s\n", tmpName, value)
fmt.Fprintf(w, "%s.%s = &%s\n", object, Title(p.Name), tmpName)
} else {
fmt.Fprintf(w, "%s.%s = %s\n", object, Title(p.Name), value)
}
}
func (pkg *pkgContext) genPlainType(w io.Writer, name, comment, deprecationMessage string,
properties []*schema.Property) {
@ -1119,6 +1124,66 @@ func (pkg *pkgContext) genPlainType(w io.Writer, name, comment, deprecationMessa
fmt.Fprintf(w, "}\n\n")
}
func (pkg *pkgContext) genPlainObjectDefaultFunc(w io.Writer, name string,
properties []*schema.Property) error {
defaults := []*schema.Property{}
for _, p := range properties {
if p.DefaultValue != nil || codegen.IsProvideDefaultsFuncRequired(p.Type) {
defaults = append(defaults, p)
}
}
// There are no defaults, so we don't need to generate a defaults function.
if len(defaults) == 0 {
return nil
}
printComment(w, fmt.Sprintf("%s sets the appropriate defaults for %s", ProvideDefaultsMethodName, name), false)
fmt.Fprintf(w, "func (val *%[1]s) %[2]s() *%[1]s {\n", name, ProvideDefaultsMethodName)
fmt.Fprint(w, "if val == nil {\n return nil\n}\n")
fmt.Fprint(w, "tmp := *val\n")
for _, p := range defaults {
if p.DefaultValue != nil {
dv, err := pkg.getDefaultValue(p.DefaultValue, codegen.UnwrapType(p.Type))
if err != nil {
return err
}
pkg.needsUtils = true
fmt.Fprintf(w, "if isZero(tmp.%s) {\n", Title(p.Name))
pkg.assignProperty(w, p, "tmp", dv, !p.IsRequired())
fmt.Fprintf(w, "}\n")
} else if funcName := pkg.provideDefaultsFuncName(p.Type); funcName != "" {
var member string
if codegen.IsNOptionalInput(p.Type) {
f := fmt.Sprintf("func(v %[1]s) %[1]s { return v.%[2]s*() }", name, funcName)
member = fmt.Sprintf("tmp.%[1]s.ApplyT(%[2]s)\n", Title(p.Name), f)
} else {
member = fmt.Sprintf("tmp.%[1]s.%[2]s()\n", Title(p.Name), funcName)
}
sigil := ""
if p.IsRequired() {
sigil = "*"
}
pkg.assignProperty(w, p, "tmp", sigil+member, false)
} else {
panic(fmt.Sprintf("Property %s[%s] should not be in the default list", p.Name, p.Type.String()))
}
}
fmt.Fprintf(w, "return &tmp\n}\n")
return nil
}
// The name of the method used to instantiate defaults.
const ProvideDefaultsMethodName = "Defaults"
func (pkg *pkgContext) provideDefaultsFuncName(typ schema.Type) string {
if !codegen.IsProvideDefaultsFuncRequired(typ) {
return ""
}
return ProvideDefaultsMethodName
}
func (pkg *pkgContext) genInputTypes(w io.Writer, t *schema.ObjectType, details *typeDetails) {
contract.Assert(t.IsInputShape())
@ -1129,7 +1194,7 @@ func (pkg *pkgContext) genInputTypes(w io.Writer, t *schema.ObjectType, details
pkg.genInputArgsStruct(w, name+"Args", t)
genInputImplementation(w, name, name+"Args", name, details.ptrElement, false)
genInputImplementation(w, name, name+"Args", name, details.ptrElement)
// Generate the pointer input.
if details.ptrElement {
@ -1143,7 +1208,7 @@ func (pkg *pkgContext) genInputTypes(w io.Writer, t *schema.ObjectType, details
fmt.Fprintf(w, "\treturn (*%s)(v)\n", ptrTypeName)
fmt.Fprintf(w, "}\n\n")
genInputImplementation(w, name+"Ptr", "*"+ptrTypeName, "*"+name, false, false)
genInputImplementation(w, name+"Ptr", "*"+ptrTypeName, "*"+name, false)
}
// Generate the array input.
@ -1152,7 +1217,7 @@ func (pkg *pkgContext) genInputTypes(w io.Writer, t *schema.ObjectType, details
fmt.Fprintf(w, "type %[1]sArray []%[1]sInput\n\n", name)
genInputImplementation(w, name+"Array", name+"Array", "[]"+name, false, false)
genInputImplementation(w, name+"Array", name+"Array", "[]"+name, false)
}
// Generate the map input.
@ -1161,7 +1226,7 @@ func (pkg *pkgContext) genInputTypes(w io.Writer, t *schema.ObjectType, details
fmt.Fprintf(w, "type %[1]sMap map[string]%[1]sInput\n\n", name)
genInputImplementation(w, name+"Map", name+"Map", "map[string]"+name, false, false)
genInputImplementation(w, name+"Map", name+"Map", "map[string]"+name, false)
}
}
@ -1200,7 +1265,6 @@ func (pkg *pkgContext) genOutputTypes(w io.Writer, genArgs genOutputTypesArgs) {
name, /* baseName */
name, /* elementType */
details.ptrElement, /* ptrMethods */
false, /* resourceType */
)
for _, p := range t.Properties {
@ -1219,7 +1283,7 @@ func (pkg *pkgContext) genOutputTypes(w io.Writer, genArgs genOutputTypesArgs) {
}
if details.ptrElement {
genPtrOutput(w, name, name, false)
genPtrOutput(w, name, name)
for _, p := range t.Properties {
printCommentWithDeprecationMessage(w, p.Comment, p.DeprecationMessage, false)
@ -1252,11 +1316,11 @@ func (pkg *pkgContext) genOutputTypes(w io.Writer, genArgs genOutputTypesArgs) {
}
if details.arrayElement {
genArrayOutput(w, name, name, false)
genArrayOutput(w, name, name)
}
if details.mapElement {
genMapOutput(w, name, name, false)
genMapOutput(w, name, name)
}
}
@ -1310,6 +1374,11 @@ func (pkg *pkgContext) getDefaultValue(dv *schema.DefaultValue, t schema.Type) (
return "", err
}
val = v
switch t.(type) {
case *schema.EnumType:
typeName := strings.TrimSuffix(pkg.typeString(codegen.UnwrapType(t)), "Input")
val = fmt.Sprintf("%s(%s)", typeName, val)
}
}
if len(dv.Environment) > 0 {
@ -1393,6 +1462,8 @@ func (pkg *pkgContext) genResource(w io.Writer, r *schema.Resource, generateReso
fmt.Fprintf(w, "\t}\n\n")
// Produce the inputs.
// Check all required inputs are present
for _, p := range r.InputProperties {
if p.IsRequired() && isNilType(p.Type) && p.DefaultValue == nil {
fmt.Fprintf(w, "\tif args.%s == nil {\n", Title(p.Name))
@ -1401,26 +1472,8 @@ func (pkg *pkgContext) genResource(w io.Writer, r *schema.Resource, generateReso
}
}
assign := func(p *schema.Property, value string, indentation int) {
ind := strings.Repeat("\t", indentation)
t := strings.TrimSuffix(pkg.typeString(p.Type), "Input")
switch codegen.UnwrapType(p.Type).(type) {
case *schema.EnumType:
t = strings.TrimSuffix(t, "Ptr")
}
if t == "pulumi." {
t = "pulumi.Any"
}
if codegen.IsNOptionalInput(p.Type) {
fmt.Fprintf(w, "\targs.%s = %s(%s)\n", Title(p.Name), t, value)
} else if isNilType(p.Type) {
tmpName := camel(p.Name) + "_"
fmt.Fprintf(w, "%s%s := %s\n", ind, tmpName, value)
fmt.Fprintf(w, "%sargs.%s = &%s\n", ind, Title(p.Name), tmpName)
} else {
fmt.Fprintf(w, "%sargs.%s = %s\n", ind, Title(p.Name), value)
}
assign := func(p *schema.Property, value string) {
pkg.assignProperty(w, p, "args", value, isNilType(p.Type))
}
for _, p := range r.InputProperties {
@ -1429,19 +1482,51 @@ func (pkg *pkgContext) genResource(w io.Writer, r *schema.Resource, generateReso
if err != nil {
return err
}
assign(p, v, 1)
assign(p, v)
} else if p.DefaultValue != nil {
v, err := pkg.getDefaultValue(p.DefaultValue, codegen.UnwrapType(p.Type))
dv, err := pkg.getDefaultValue(p.DefaultValue, codegen.UnwrapType(p.Type))
if err != nil {
return err
}
defaultComp := "nil"
if !codegen.IsNOptionalInput(p.Type) && !isNilType(p.Type) {
defaultComp = primitiveNilValue(p.Type)
}
fmt.Fprintf(w, "\tif args.%s == %s {\n", Title(p.Name), defaultComp)
assign(p, v, 2)
pkg.needsUtils = true
fmt.Fprintf(w, "\tif isZero(args.%s) {\n", Title(p.Name))
assign(p, dv)
fmt.Fprintf(w, "\t}\n")
} else if name := pkg.provideDefaultsFuncName(p.Type); name != "" && !pkg.disableObjectDefaults {
var value string
var needsNilCheck bool
if codegen.IsNOptionalInput(p.Type) {
innerFuncType := strings.TrimSuffix(pkg.typeString(codegen.UnwrapType(p.Type)), "Args")
applyName := fmt.Sprintf("%sApplier", camel(p.Name))
fmt.Fprintf(w, "%[3]s := func(v %[1]s) *%[1]s { return v.%[2]s() }\n", innerFuncType, name, applyName)
outputValue := pkg.convertToOutput(fmt.Sprintf("args.%s", Title(p.Name)), p.Type)
outputType := pkg.typeString(p.Type)
if strings.HasSuffix(outputType, "Input") {
outputType = strings.TrimSuffix(outputType, "Input") + "Output"
}
// Because applies return pointers, we need to convert to PtrOutput and then call .Elem().
var tail string
if !strings.HasSuffix(outputType, "PtrOutput") {
outputType = strings.TrimSuffix(outputType, "Output") + "PtrOutput"
tail = ".Elem()"
}
needsNilCheck = !p.IsRequired()
value = fmt.Sprintf("%s.ApplyT(%s).(%s)%s", outputValue, applyName, outputType, tail)
} else {
value = fmt.Sprintf("args.%[1]s.%[2]s()", Title(p.Name), name)
}
v := func() {
fmt.Fprintf(w, "args.%[1]s = %s\n", Title(p.Name), value)
}
if needsNilCheck {
fmt.Fprintf(w, "if args.%s != nil {\n", Title(p.Name))
v()
fmt.Fprint(w, "}\n")
} else {
v()
}
}
}
@ -1708,42 +1793,26 @@ func (pkg *pkgContext) genResource(w io.Writer, r *schema.Resource, generateReso
fmt.Fprintf(w, "\tTo%[1]sOutputWithContext(ctx context.Context) %[1]sOutput\n", name)
fmt.Fprintf(w, "}\n\n")
genInputImplementation(w, name, "*"+name, name, generateResourceContainerTypes, true)
genInputImplementation(w, name, "*"+name, "*"+name, false)
if generateResourceContainerTypes {
// Emit the resource pointer input type.
fmt.Fprintf(w, "type %sPtrInput interface {\n", name)
fmt.Fprintf(w, "\tpulumi.Input\n\n")
fmt.Fprintf(w, "\tTo%[1]sPtrOutput() %[1]sPtrOutput\n", name)
fmt.Fprintf(w, "\tTo%[1]sPtrOutputWithContext(ctx context.Context) %[1]sPtrOutput\n", name)
fmt.Fprintf(w, "}\n\n")
ptrTypeName := camel(name) + "PtrType"
fmt.Fprintf(w, "type %s %sArgs\n\n", ptrTypeName, name)
genInputImplementation(w, name+"Ptr", "*"+ptrTypeName, "*"+name, false, true)
if generateResourceContainerTypes && !r.IsProvider {
// Generate the resource array input.
pkg.genInputInterface(w, name+"Array")
fmt.Fprintf(w, "type %[1]sArray []%[1]sInput\n\n", name)
genInputImplementation(w, name+"Array", name+"Array", "[]*"+name, false)
if !r.IsProvider {
// Generate the resource array input.
pkg.genInputInterface(w, name+"Array")
fmt.Fprintf(w, "type %[1]sArray []%[1]sInput\n\n", name)
genInputImplementation(w, name+"Array", name+"Array", "[]*"+name, false, false)
// Generate the resource map input.
pkg.genInputInterface(w, name+"Map")
fmt.Fprintf(w, "type %[1]sMap map[string]%[1]sInput\n\n", name)
genInputImplementation(w, name+"Map", name+"Map", "map[string]*"+name, false, false)
}
// Generate the resource map input.
pkg.genInputInterface(w, name+"Map")
fmt.Fprintf(w, "type %[1]sMap map[string]%[1]sInput\n\n", name)
genInputImplementation(w, name+"Map", name+"Map", "map[string]*"+name, false)
}
// Emit the resource output type.
genOutputType(w, name, name, generateResourceContainerTypes, true)
genOutputType(w, name, "*"+name, false)
if generateResourceContainerTypes {
genPtrOutput(w, name, name, true)
if !r.IsProvider {
genArrayOutput(w, name, name, true)
genMapOutput(w, name, name, true)
}
if generateResourceContainerTypes && !r.IsProvider {
genArrayOutput(w, name, "*"+name)
genMapOutput(w, name, "*"+name)
}
pkg.genResourceRegistrations(w, r, generateResourceContainerTypes)
@ -1751,6 +1820,30 @@ func (pkg *pkgContext) genResource(w io.Writer, r *schema.Resource, generateReso
return nil
}
// Takes an expression and type, and returns a string that converts that expression to an Output type.
//
// Examples:
// ("bar", Foo of ObjectType) => "bar.ToFooOutput()"
// ("id", FooOutput) => "id"
// ("ptr", FooInput of ObjectType) => "ptr.ToFooPtrOutput().Elem()"
func (pkg *pkgContext) convertToOutput(expr string, typ schema.Type) string {
elemConversion := ""
switch typ.(type) {
case *schema.OptionalType:
elemConversion = ".Elem()"
}
outputType := pkg.outputType(typ)
// Remove any element before the last .
outputType = outputType[strings.LastIndex(outputType, ".")+1:]
if strings.HasSuffix(outputType, "ArgsOutput") {
outputType = strings.TrimSuffix(outputType, "ArgsOutput") + "Output"
}
if elemConversion != "" {
outputType = strings.TrimSuffix(outputType, "Output") + "PtrOutput"
}
return fmt.Sprintf("%s.To%s()%s", expr, outputType, elemConversion)
}
func NeedsGoOutputVersion(f *schema.Function) bool {
fPkg := f.Package
@ -1768,7 +1861,7 @@ func NeedsGoOutputVersion(f *schema.Function) bool {
return f.NeedsOutputVersion()
}
func (pkg *pkgContext) genFunctionCodeFile(f *schema.Function) string {
func (pkg *pkgContext) genFunctionCodeFile(f *schema.Function) (string, error) {
importsAndAliases := map[string]string{}
pkg.getImports(f, importsAndAliases)
buffer := &bytes.Buffer{}
@ -1779,12 +1872,14 @@ func (pkg *pkgContext) genFunctionCodeFile(f *schema.Function) string {
}
pkg.genHeader(buffer, imports, importsAndAliases)
pkg.genFunction(buffer, f)
if err := pkg.genFunction(buffer, f); err != nil {
return "", err
}
pkg.genFunctionOutputVersion(buffer, f)
return buffer.String()
return buffer.String(), nil
}
func (pkg *pkgContext) genFunction(w io.Writer, f *schema.Function) {
func (pkg *pkgContext) genFunction(w io.Writer, f *schema.Function) error {
name := pkg.functionName(f)
printCommentWithDeprecationMessage(w, f.Comment, f.DeprecationMessage, false)
@ -1805,6 +1900,8 @@ func (pkg *pkgContext) genFunction(w io.Writer, f *schema.Function) {
var inputsVar string
if f.Inputs == nil {
inputsVar = "nil"
} else if codegen.IsProvideDefaultsFuncRequired(f.Inputs) && !pkg.disableObjectDefaults {
inputsVar = "args.Defaults()"
} else {
inputsVar = "args"
}
@ -1828,19 +1925,38 @@ func (pkg *pkgContext) genFunction(w io.Writer, f *schema.Function) {
fmt.Fprintf(w, "\t}\n")
// Return the result.
fmt.Fprintf(w, "\treturn &rv, nil\n")
var retValue string
if codegen.IsProvideDefaultsFuncRequired(f.Outputs) && !pkg.disableObjectDefaults {
retValue = "rv.Defaults()"
} else {
retValue = "&rv"
}
fmt.Fprintf(w, "\treturn %s, nil\n", retValue)
}
fmt.Fprintf(w, "}\n")
// If there are argument and/or return types, emit them.
if f.Inputs != nil {
fmt.Fprintf(w, "\n")
pkg.genPlainType(w, pkg.functionArgsTypeName(f), f.Inputs.Comment, "", f.Inputs.Properties)
fnInputsName := pkg.functionArgsTypeName(f)
pkg.genPlainType(w, fnInputsName, f.Inputs.Comment, "", f.Inputs.Properties)
if codegen.IsProvideDefaultsFuncRequired(f.Inputs) && !pkg.disableObjectDefaults {
if err := pkg.genPlainObjectDefaultFunc(w, fnInputsName, f.Inputs.Properties); err != nil {
return err
}
}
}
if f.Outputs != nil {
fmt.Fprintf(w, "\n")
pkg.genPlainType(w, pkg.functionResultTypeName(f), f.Outputs.Comment, "", f.Outputs.Properties)
fnOutputsName := pkg.functionResultTypeName(f)
pkg.genPlainType(w, fnOutputsName, f.Outputs.Comment, "", f.Outputs.Properties)
if codegen.IsProvideDefaultsFuncRequired(f.Outputs) && !pkg.disableObjectDefaults {
if err := pkg.genPlainObjectDefaultFunc(w, fnOutputsName, f.Outputs.Properties); err != nil {
return err
}
}
}
return nil
}
func (pkg *pkgContext) functionName(f *schema.Function) string {
@ -2019,16 +2135,24 @@ func rewriteCyclicObjectFields(pkg *schema.Package) {
}
}
func (pkg *pkgContext) genType(w io.Writer, obj *schema.ObjectType) {
func (pkg *pkgContext) genType(w io.Writer, obj *schema.ObjectType) error {
contract.Assert(!obj.IsInputShape())
if obj.IsOverlay {
// This type is generated by the provider, so no further action is required.
return
return nil
}
plainName := pkg.tokenToType(obj.Token)
pkg.genPlainType(w, plainName, obj.Comment, "", obj.Properties)
if !pkg.disableObjectDefaults {
if err := pkg.genPlainObjectDefaultFunc(w, plainName, obj.Properties); err != nil {
return err
}
}
pkg.genPlainType(w, pkg.tokenToType(obj.Token), obj.Comment, "", obj.Properties)
pkg.genInputTypes(w, obj.InputShape, pkg.detailsForType(obj))
pkg.genOutputTypes(w, genOutputTypesArgs{t: obj})
return nil
}
func (pkg *pkgContext) addSuffixesToName(typ schema.Type, name string) []string {
@ -2100,16 +2224,16 @@ func (pkg *pkgContext) genNestedCollectionTypes(w io.Writer, types map[string]ma
names = append(names, name)
if strings.HasSuffix(name, "Array") {
fmt.Fprintf(w, "type %s []%sInput\n\n", name, elementTypeName)
genInputImplementation(w, name, name, elementTypeName, false, false)
genInputImplementation(w, name, name, elementTypeName, false)
genArrayOutput(w, strings.TrimSuffix(name, "Array"), elementTypeName, false)
genArrayOutput(w, strings.TrimSuffix(name, "Array"), elementTypeName)
}
if strings.HasSuffix(name, "Map") {
fmt.Fprintf(w, "type %s map[string]%sInput\n\n", name, elementTypeName)
genInputImplementation(w, name, name, elementTypeName, false, false)
genInputImplementation(w, name, name, elementTypeName, false)
genMapOutput(w, strings.TrimSuffix(name, "Map"), elementTypeName, false)
genMapOutput(w, strings.TrimSuffix(name, "Map"), elementTypeName)
}
pkg.genInputInterface(w, name)
}
@ -2236,18 +2360,13 @@ func (pkg *pkgContext) genResourceRegistrations(w io.Writer, r *schema.Resource,
fmt.Fprintf(w,
"\tpulumi.RegisterInputType(reflect.TypeOf((*%[1]sInput)(nil)).Elem(), &%[1]s{})\n",
name)
if generateResourceContainerTypes {
if generateResourceContainerTypes && !r.IsProvider {
fmt.Fprintf(w,
"\tpulumi.RegisterInputType(reflect.TypeOf((*%[1]sPtrInput)(nil)).Elem(), &%[1]s{})\n",
"\tpulumi.RegisterInputType(reflect.TypeOf((*%[1]sArrayInput)(nil)).Elem(), %[1]sArray{})\n",
name)
fmt.Fprintf(w,
"\tpulumi.RegisterInputType(reflect.TypeOf((*%[1]sMapInput)(nil)).Elem(), %[1]sMap{})\n",
name)
if !r.IsProvider {
fmt.Fprintf(w,
"\tpulumi.RegisterInputType(reflect.TypeOf((*%[1]sArrayInput)(nil)).Elem(), %[1]sArray{})\n",
name)
fmt.Fprintf(w,
"\tpulumi.RegisterInputType(reflect.TypeOf((*%[1]sMapInput)(nil)).Elem(), %[1]sMap{})\n",
name)
}
}
}
// Register all output types
@ -2262,12 +2381,9 @@ func (pkg *pkgContext) genResourceRegistrations(w io.Writer, r *schema.Resource,
}
}
if generateResourceContainerTypes {
fmt.Fprintf(w, "\tpulumi.RegisterOutputType(%sPtrOutput{})\n", name)
if !r.IsProvider {
fmt.Fprintf(w, "\tpulumi.RegisterOutputType(%sArrayOutput{})\n", name)
fmt.Fprintf(w, "\tpulumi.RegisterOutputType(%sMapOutput{})\n", name)
}
if generateResourceContainerTypes && !r.IsProvider {
fmt.Fprintf(w, "\tpulumi.RegisterOutputType(%sArrayOutput{})\n", name)
fmt.Fprintf(w, "\tpulumi.RegisterOutputType(%sMapOutput{})\n", name)
}
fmt.Fprintf(w, "}\n\n")
}
@ -2670,6 +2786,7 @@ func generatePackageContextMap(tool string, pkg *schema.Package, goInfo GoPackag
packages: packages,
liftSingleValueMethodReturns: goInfo.LiftSingleValueMethodReturns,
disableInputTypeRegistrations: goInfo.DisableInputTypeRegistrations,
disableObjectDefaults: goInfo.DisableObjectDefaults,
}
packages[mod] = pack
}
@ -2993,8 +3110,10 @@ func generatePackageContextMap(tool string, pkg *schema.Package, goInfo GoPackag
pkg.functions = append(pkg.functions, f)
name := tokenToName(f.Token)
originalName := name
if pkg.names.Has(name) {
if pkg.names.Has(name) ||
pkg.names.Has(name+"Args") ||
pkg.names.Has(name+"Result") {
switch {
case strings.HasPrefix(name, "New"):
name = "Create" + name[3:]
@ -3007,15 +3126,9 @@ func generatePackageContextMap(tool string, pkg *schema.Package, goInfo GoPackag
if f.Inputs != nil {
pkg.names.Add(name + "Args")
if originalName != name {
pkg.renamed[originalName+"Args"] = name + "Args"
}
}
if f.Outputs != nil {
pkg.names.Add(name + "Result")
if originalName != name {
pkg.renamed[originalName+"Result"] = name + "Result"
}
}
}
@ -3204,7 +3317,10 @@ func GeneratePackage(tool string, pkg *schema.Package) (map[string][]byte, error
}
fileName := path.Join(mod, camel(tokenToName(f.Token))+".go")
code := pkg.genFunctionCodeFile(f)
code, err := pkg.genFunctionCodeFile(f)
if err != nil {
return nil, err
}
setFile(fileName, code)
}
@ -3244,7 +3360,9 @@ func GeneratePackage(tool string, pkg *schema.Package) (map[string][]byte, error
pkg.genHeader(buffer, []string{"context", "reflect"}, importsAndAliases)
for _, t := range pkg.types {
pkg.genType(buffer, t)
if err := pkg.genType(buffer, t); err != nil {
return nil, err
}
delete(knownTypes, t)
}
@ -3380,4 +3498,12 @@ func PkgVersion() (semver.Version, error) {
}
return semver.Version{}, fmt.Errorf("failed to determine the package version from %%s", pkgPath)
}
// isZero is a null safe check for if a value is it's types zero value.
func isZero(v interface{}) bool {
if v == nil {
return true
}
return reflect.ValueOf(v).IsZero()
}
`

View file

@ -43,7 +43,9 @@ func CRDTypes(tool string, pkg *schema.Package) (map[string]*bytes.Buffer, error
if len(pkg.types) > 0 {
for _, t := range pkg.types {
pkg.genType(buffer, t)
if err := pkg.genType(buffer, t); err != nil {
return nil, err
}
}
pkg.genTypeRegistrations(buffer, pkg.types)
}

View file

@ -60,6 +60,10 @@ type GoPackageInfo struct {
// Feature flag to disable generating input type registration. This is a
// space saving measure.
DisableInputTypeRegistrations bool `json:"disableInputTypeRegistrations,omitempty"`
// Feature flag to disable generating Pulumi object default functions. This is a
// space saving measure.
DisableObjectDefaults bool `json:"disableObjectDefaults,omitempty"`
}
// Importer implements schema.Language for Go.

View file

@ -60,8 +60,7 @@ var sdkTests = []sdkTest{
Directory: "external-resource-schema",
Description: "External resource schema",
SkipCompileCheck: codegen.NewStringSet(nodejs, golang),
Skip: codegen.NewStringSet("python/test", "nodejs/test",
/* TODO[pulumi/pulumi#8308] */ "all"),
Skip: codegen.NewStringSet("python/test", "nodejs/test"),
},
{
Directory: "nested-module",
@ -78,8 +77,7 @@ var sdkTests = []sdkTest{
{
Directory: "plain-schema-gh6957",
Description: "Repro for #6957",
Skip: codegen.NewStringSet("python/test", "nodejs/test",
/* TODO[pulumi/pulumi#8308] */ "all"),
Skip: codegen.NewStringSet("python/test", "nodejs/test"),
},
{
Directory: "resource-args-python-case-insensitive",
@ -155,8 +153,7 @@ var sdkTests = []sdkTest{
Description: "A resource url with a hyphen in its path",
// TODO[pulumi/pulumi#8370]: Re-enable compiling for Go.
SkipCompileCheck: codegen.NewStringSet(golang),
Skip: codegen.NewStringSet("python/test", "nodejs/test",
/* TODO[pulumi/pulumi#8308] */ "all"),
Skip: codegen.NewStringSet("python/test", "nodejs/test"),
},
{
Directory: "output-funcs",
@ -195,11 +192,22 @@ var sdkTests = []sdkTest{
SkipCompileCheck: codegen.NewStringSet(nodejs),
},
{
Directory: "env-helper",
Description: "Ensure that eviromental helpers are generated (repro #8132)",
Directory: "plain-object-defaults",
Description: "Ensure that object defaults are generated (repro #8132)",
Skip: codegen.NewStringSet("python/test", "nodejs/test"),
SkipCompileCheck: codegen.NewStringSet(dotnet),
},
{
Directory: "plain-object-disable-defaults",
Description: "Ensure that we can still compile safely when defaults are disabled",
Skip: codegen.NewStringSet("python/test", "nodejs/test"),
SkipCompileCheck: codegen.NewStringSet(dotnet),
},
{
Directory: "regress-8403",
Description: "Regress pulumi/pulumi#8403",
SkipCompileCheck: codegen.NewStringSet(dotnet, python, nodejs),
},
}
var genSDKOnly bool
@ -294,11 +302,6 @@ func TestSDKCodegen(t *testing.T, opts *SDKCodegenOptions) { // revive:disable-l
}
t.Log(tt.Description)
// Skip all check. This needs to be here because it needs to skip
// the codegen.
if tt.Skip.Has("all") {
t.SkipNow()
}
dirPath := filepath.Join(testDir, filepath.FromSlash(tt.Directory))

View file

@ -48,7 +48,7 @@ type ProviderInput interface {
}
func (*Provider) ElementType() reflect.Type {
return reflect.TypeOf((*Provider)(nil))
return reflect.TypeOf((**Provider)(nil)).Elem()
}
func (i *Provider) ToProviderOutput() ProviderOutput {
@ -62,7 +62,7 @@ func (i *Provider) ToProviderOutputWithContext(ctx context.Context) ProviderOutp
type ProviderOutput struct{ *pulumi.OutputState }
func (ProviderOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Provider)(nil))
return reflect.TypeOf((**Provider)(nil)).Elem()
}
func (o ProviderOutput) ToProviderOutput() ProviderOutput {

View file

@ -75,3 +75,11 @@ func PkgVersion() (semver.Version, error) {
}
return semver.Version{}, fmt.Errorf("failed to determine the package version from %s", pkgPath)
}
// isZero is a null safe check for if a value is it's types zero value.
func isZero(v interface{}) bool {
if v == nil {
return true
}
return reflect.ValueOf(v).IsZero()
}

View file

@ -48,7 +48,7 @@ type ProviderInput interface {
}
func (*Provider) ElementType() reflect.Type {
return reflect.TypeOf((*Provider)(nil))
return reflect.TypeOf((**Provider)(nil)).Elem()
}
func (i *Provider) ToProviderOutput() ProviderOutput {
@ -62,7 +62,7 @@ func (i *Provider) ToProviderOutputWithContext(ctx context.Context) ProviderOutp
type ProviderOutput struct{ *pulumi.OutputState }
func (ProviderOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Provider)(nil))
return reflect.TypeOf((**Provider)(nil)).Elem()
}
func (o ProviderOutput) ToProviderOutput() ProviderOutput {

View file

@ -75,3 +75,11 @@ func PkgVersion() (semver.Version, error) {
}
return semver.Version{}, fmt.Errorf("failed to determine the package version from %s", pkgPath)
}
// isZero is a null safe check for if a value is it's types zero value.
func isZero(v interface{}) bool {
if v == nil {
return true
}
return reflect.ValueOf(v).IsZero()
}

View file

@ -76,7 +76,7 @@ type ModuleResourceInput interface {
}
func (*ModuleResource) ElementType() reflect.Type {
return reflect.TypeOf((*ModuleResource)(nil))
return reflect.TypeOf((**ModuleResource)(nil)).Elem()
}
func (i *ModuleResource) ToModuleResourceOutput() ModuleResourceOutput {
@ -90,7 +90,7 @@ func (i *ModuleResource) ToModuleResourceOutputWithContext(ctx context.Context)
type ModuleResourceOutput struct{ *pulumi.OutputState }
func (ModuleResourceOutput) ElementType() reflect.Type {
return reflect.TypeOf((*ModuleResource)(nil))
return reflect.TypeOf((**ModuleResource)(nil)).Elem()
}
func (o ModuleResourceOutput) ToModuleResourceOutput() ModuleResourceOutput {

View file

@ -167,6 +167,14 @@ The RubberTree resource accepts the following [input]({{< relref "/docs/intro/co
<span class="property-indicator"></span>
<span class="property-type"><a href="#diameter">Pulumi.<wbr>Plant.<wbr>Tree.<wbr>V1.<wbr>Diameter</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-required"
title="Required">
<span id="type_csharp">
<a href="#type_csharp" style="color: inherit; text-decoration: inherit;">Type</a>
</span>
<span class="property-indicator"></span>
<span class="property-type"><a href="#rubbertreevariety">Pulumi.<wbr>Plant.<wbr>Tree.<wbr>V1.<wbr>Rubber<wbr>Tree<wbr>Variety</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="container_csharp">
@ -191,14 +199,6 @@ The RubberTree resource accepts the following [input]({{< relref "/docs/intro/co
<span class="property-indicator"></span>
<span class="property-type"><a href="#treesize">Pulumi.<wbr>Plant.<wbr>Tree.<wbr>V1.<wbr>Tree<wbr>Size</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="type_csharp">
<a href="#type_csharp" style="color: inherit; text-decoration: inherit;">Type</a>
</span>
<span class="property-indicator"></span>
<span class="property-type"><a href="#rubbertreevariety">Pulumi.<wbr>Plant.<wbr>Tree.<wbr>V1.<wbr>Rubber<wbr>Tree<wbr>Variety</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd></dl>
{{% /choosable %}}
@ -211,6 +211,14 @@ The RubberTree resource accepts the following [input]({{< relref "/docs/intro/co
<span class="property-indicator"></span>
<span class="property-type"><a href="#diameter">Diameter</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-required"
title="Required">
<span id="type_go">
<a href="#type_go" style="color: inherit; text-decoration: inherit;">Type</a>
</span>
<span class="property-indicator"></span>
<span class="property-type"><a href="#rubbertreevariety">Rubber<wbr>Tree<wbr>Variety</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="container_go">
@ -235,14 +243,6 @@ The RubberTree resource accepts the following [input]({{< relref "/docs/intro/co
<span class="property-indicator"></span>
<span class="property-type"><a href="#treesize">Tree<wbr>Size</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="type_go">
<a href="#type_go" style="color: inherit; text-decoration: inherit;">Type</a>
</span>
<span class="property-indicator"></span>
<span class="property-type"><a href="#rubbertreevariety">Rubber<wbr>Tree<wbr>Variety</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd></dl>
{{% /choosable %}}
@ -255,6 +255,14 @@ The RubberTree resource accepts the following [input]({{< relref "/docs/intro/co
<span class="property-indicator"></span>
<span class="property-type"><a href="#diameter">Diameter</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-required"
title="Required">
<span id="type_nodejs">
<a href="#type_nodejs" style="color: inherit; text-decoration: inherit;">type</a>
</span>
<span class="property-indicator"></span>
<span class="property-type"><a href="#rubbertreevariety">Rubber<wbr>Tree<wbr>Variety</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="container_nodejs">
@ -279,14 +287,6 @@ The RubberTree resource accepts the following [input]({{< relref "/docs/intro/co
<span class="property-indicator"></span>
<span class="property-type"><a href="#treesize">Tree<wbr>Size</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="type_nodejs">
<a href="#type_nodejs" style="color: inherit; text-decoration: inherit;">type</a>
</span>
<span class="property-indicator"></span>
<span class="property-type"><a href="#rubbertreevariety">Rubber<wbr>Tree<wbr>Variety</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd></dl>
{{% /choosable %}}
@ -299,6 +299,14 @@ The RubberTree resource accepts the following [input]({{< relref "/docs/intro/co
<span class="property-indicator"></span>
<span class="property-type"><a href="#diameter">Diameter</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-required"
title="Required">
<span id="type_python">
<a href="#type_python" style="color: inherit; text-decoration: inherit;">type</a>
</span>
<span class="property-indicator"></span>
<span class="property-type"><a href="#rubbertreevariety">Rubber<wbr>Tree<wbr>Variety</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="container_python">
@ -323,14 +331,6 @@ The RubberTree resource accepts the following [input]({{< relref "/docs/intro/co
<span class="property-indicator"></span>
<span class="property-type"><a href="#treesize">Tree<wbr>Size</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="type_python">
<a href="#type_python" style="color: inherit; text-decoration: inherit;">type</a>
</span>
<span class="property-indicator"></span>
<span class="property-type"><a href="#rubbertreevariety">Rubber<wbr>Tree<wbr>Variety</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd></dl>
{{% /choosable %}}

View file

@ -25,7 +25,7 @@ namespace Pulumi.Plant.Tree.V1
public Output<Pulumi.Plant.Tree.V1.TreeSize?> Size { get; private set; } = null!;
[Output("type")]
public Output<Pulumi.Plant.Tree.V1.RubberTreeVariety?> Type { get; private set; } = null!;
public Output<Pulumi.Plant.Tree.V1.RubberTreeVariety> Type { get; private set; } = null!;
/// <summary>
@ -85,11 +85,12 @@ namespace Pulumi.Plant.Tree.V1
[Input("size")]
public Input<Pulumi.Plant.Tree.V1.TreeSize>? Size { get; set; }
[Input("type")]
public Input<Pulumi.Plant.Tree.V1.RubberTreeVariety>? Type { get; set; }
[Input("type", required: true)]
public Input<Pulumi.Plant.Tree.V1.RubberTreeVariety> Type { get; set; } = null!;
public RubberTreeArgs()
{
Diameter = Pulumi.Plant.Tree.V1.Diameter.Sixinch;
Farm = "(unknown)";
Size = Pulumi.Plant.Tree.V1.TreeSize.Medium;
Type = Pulumi.Plant.Tree.V1.RubberTreeVariety.Burgundy;

View file

@ -9,6 +9,7 @@
"plant-provider/tree/v1/init.go",
"plant-provider/tree/v1/nursery.go",
"plant-provider/tree/v1/pulumiEnums.go",
"plant-provider/tree/v1/pulumiUtilities.go",
"plant-provider/tree/v1/rubberTree.go"
]
}

View file

@ -48,7 +48,7 @@ type ProviderInput interface {
}
func (*Provider) ElementType() reflect.Type {
return reflect.TypeOf((*Provider)(nil))
return reflect.TypeOf((**Provider)(nil)).Elem()
}
func (i *Provider) ToProviderOutput() ProviderOutput {
@ -62,7 +62,7 @@ func (i *Provider) ToProviderOutputWithContext(ctx context.Context) ProviderOutp
type ProviderOutput struct{ *pulumi.OutputState }
func (ProviderOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Provider)(nil))
return reflect.TypeOf((**Provider)(nil)).Elem()
}
func (o ProviderOutput) ToProviderOutput() ProviderOutput {

View file

@ -17,6 +17,19 @@ type Container struct {
Size ContainerSize `pulumi:"size"`
}
// Defaults sets the appropriate defaults for Container
func (val *Container) Defaults() *Container {
if val == nil {
return nil
}
tmp := *val
if isZero(tmp.Brightness) {
brightness_ := ContainerBrightness(1.0)
tmp.Brightness = &brightness_
}
return &tmp
}
// ContainerInput is an input type that accepts ContainerArgs and ContainerOutput values.
// You can construct a concrete instance of `ContainerInput` via:
//

View file

@ -75,3 +75,11 @@ func PkgVersion() (semver.Version, error) {
}
return semver.Version{}, fmt.Errorf("failed to determine the package version from %s", pkgPath)
}
// isZero is a null safe check for if a value is it's types zero value.
func isZero(v interface{}) bool {
if v == nil {
return true
}
return reflect.ValueOf(v).IsZero()
}

View file

@ -83,7 +83,7 @@ type NurseryInput interface {
}
func (*Nursery) ElementType() reflect.Type {
return reflect.TypeOf((*Nursery)(nil))
return reflect.TypeOf((**Nursery)(nil)).Elem()
}
func (i *Nursery) ToNurseryOutput() NurseryOutput {
@ -97,7 +97,7 @@ func (i *Nursery) ToNurseryOutputWithContext(ctx context.Context) NurseryOutput
type NurseryOutput struct{ *pulumi.OutputState }
func (NurseryOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Nursery)(nil))
return reflect.TypeOf((**Nursery)(nil)).Elem()
}
func (o NurseryOutput) ToNurseryOutput() NurseryOutput {

View file

@ -0,0 +1,85 @@
// *** WARNING: this file was generated by test. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package v1
import (
"fmt"
"os"
"reflect"
"regexp"
"strconv"
"strings"
"github.com/blang/semver"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type envParser func(v string) interface{}
func parseEnvBool(v string) interface{} {
b, err := strconv.ParseBool(v)
if err != nil {
return nil
}
return b
}
func parseEnvInt(v string) interface{} {
i, err := strconv.ParseInt(v, 0, 0)
if err != nil {
return nil
}
return int(i)
}
func parseEnvFloat(v string) interface{} {
f, err := strconv.ParseFloat(v, 64)
if err != nil {
return nil
}
return f
}
func parseEnvStringArray(v string) interface{} {
var result pulumi.StringArray
for _, item := range strings.Split(v, ";") {
result = append(result, pulumi.String(item))
}
return result
}
func getEnvOrDefault(def interface{}, parser envParser, vars ...string) interface{} {
for _, v := range vars {
if value := os.Getenv(v); value != "" {
if parser != nil {
return parser(value)
}
return value
}
}
return def
}
// PkgVersion uses reflection to determine the version of the current package.
func PkgVersion() (semver.Version, error) {
type sentinal struct{}
pkgPath := reflect.TypeOf(sentinal{}).PkgPath()
re := regexp.MustCompile("^.*/pulumi-plant/sdk(/v\\d+)?")
if match := re.FindStringSubmatch(pkgPath); match != nil {
vStr := match[1]
if len(vStr) == 0 { // If the version capture group was empty, default to v1.
return semver.Version{Major: 1}, nil
}
return semver.MustParse(fmt.Sprintf("%s.0.0", vStr[2:])), nil
}
return semver.Version{}, fmt.Errorf("failed to determine the package version from %s", pkgPath)
}
// isZero is a null safe check for if a value is it's types zero value.
func isZero(v interface{}) bool {
if v == nil {
return true
}
return reflect.ValueOf(v).IsZero()
}

View file

@ -19,7 +19,7 @@ type RubberTree struct {
Diameter DiameterOutput `pulumi:"diameter"`
Farm pulumi.StringPtrOutput `pulumi:"farm"`
Size TreeSizePtrOutput `pulumi:"size"`
Type RubberTreeVarietyPtrOutput `pulumi:"type"`
Type RubberTreeVarietyOutput `pulumi:"type"`
}
// NewRubberTree registers a new resource with the given unique name, arguments, and options.
@ -29,16 +29,20 @@ func NewRubberTree(ctx *pulumi.Context,
return nil, errors.New("missing one or more required arguments")
}
if args.Diameter == nil {
return nil, errors.New("invalid value for required argument 'Diameter'")
containerApplier := func(v plantprovider.Container) *plantprovider.Container { return v.Defaults() }
if args.Container != nil {
args.Container = args.Container.ToContainerPtrOutput().Elem().ApplyT(containerApplier).(plantprovider.ContainerPtrOutput)
}
if args.Farm == nil {
if isZero(args.Diameter) {
args.Diameter = Diameter(6.0)
}
if isZero(args.Farm) {
args.Farm = pulumi.StringPtr("(unknown)")
}
if args.Size == nil {
if isZero(args.Size) {
args.Size = TreeSize("medium")
}
if args.Type == nil {
if isZero(args.Type) {
args.Type = RubberTreeVariety("Burgundy")
}
var resource RubberTree
@ -79,7 +83,7 @@ type rubberTreeArgs struct {
Diameter Diameter `pulumi:"diameter"`
Farm *string `pulumi:"farm"`
Size *TreeSize `pulumi:"size"`
Type *RubberTreeVariety `pulumi:"type"`
Type RubberTreeVariety `pulumi:"type"`
}
// The set of arguments for constructing a RubberTree resource.
@ -88,7 +92,7 @@ type RubberTreeArgs struct {
Diameter DiameterInput
Farm pulumi.StringPtrInput
Size TreeSizePtrInput
Type RubberTreeVarietyPtrInput
Type RubberTreeVarietyInput
}
func (RubberTreeArgs) ElementType() reflect.Type {
@ -103,7 +107,7 @@ type RubberTreeInput interface {
}
func (*RubberTree) ElementType() reflect.Type {
return reflect.TypeOf((*RubberTree)(nil))
return reflect.TypeOf((**RubberTree)(nil)).Elem()
}
func (i *RubberTree) ToRubberTreeOutput() RubberTreeOutput {
@ -117,7 +121,7 @@ func (i *RubberTree) ToRubberTreeOutputWithContext(ctx context.Context) RubberTr
type RubberTreeOutput struct{ *pulumi.OutputState }
func (RubberTreeOutput) ElementType() reflect.Type {
return reflect.TypeOf((*RubberTree)(nil))
return reflect.TypeOf((**RubberTree)(nil)).Elem()
}
func (o RubberTreeOutput) ToRubberTreeOutput() RubberTreeOutput {

View file

@ -37,7 +37,7 @@ export class RubberTree extends pulumi.CustomResource {
public readonly diameter!: pulumi.Output<enums.tree.v1.Diameter>;
public readonly farm!: pulumi.Output<enums.tree.v1.Farm | string | undefined>;
public readonly size!: pulumi.Output<enums.tree.v1.TreeSize | undefined>;
public readonly type!: pulumi.Output<enums.tree.v1.RubberTreeVariety | undefined>;
public readonly type!: pulumi.Output<enums.tree.v1.RubberTreeVariety>;
/**
* Create a RubberTree resource with the given unique name, arguments, and options.
@ -58,8 +58,11 @@ export class RubberTree extends pulumi.CustomResource {
if ((!args || args.diameter === undefined) && !opts.urn) {
throw new Error("Missing required property 'diameter'");
}
if ((!args || args.type === undefined) && !opts.urn) {
throw new Error("Missing required property 'type'");
}
resourceInputs["container"] = args ? (args.container ? pulumi.output(args.container).apply(inputs.containerArgsProvideDefaults) : undefined) : undefined;
resourceInputs["diameter"] = args ? args.diameter : undefined;
resourceInputs["diameter"] = (args ? args.diameter : undefined) ?? 6;
resourceInputs["farm"] = (args ? args.farm : undefined) ?? "(unknown)";
resourceInputs["size"] = (args ? args.size : undefined) ?? "medium";
resourceInputs["type"] = (args ? args.type : undefined) ?? "Burgundy";
@ -83,5 +86,5 @@ export interface RubberTreeArgs {
diameter: pulumi.Input<enums.tree.v1.Diameter>;
farm?: pulumi.Input<enums.tree.v1.Farm | string>;
size?: pulumi.Input<enums.tree.v1.TreeSize>;
type?: pulumi.Input<enums.tree.v1.RubberTreeVariety>;
type: pulumi.Input<enums.tree.v1.RubberTreeVariety>;
}

View file

@ -18,14 +18,19 @@ __all__ = ['RubberTreeArgs', 'RubberTree']
class RubberTreeArgs:
def __init__(__self__, *,
diameter: pulumi.Input['Diameter'],
type: pulumi.Input['RubberTreeVariety'],
container: Optional[pulumi.Input['_root_inputs.ContainerArgs']] = None,
farm: Optional[pulumi.Input[Union['Farm', str]]] = None,
size: Optional[pulumi.Input['TreeSize']] = None,
type: Optional[pulumi.Input['RubberTreeVariety']] = None):
size: Optional[pulumi.Input['TreeSize']] = None):
"""
The set of arguments for constructing a RubberTree resource.
"""
if diameter is None:
diameter = 6
pulumi.set(__self__, "diameter", diameter)
if type is None:
type = 'Burgundy'
pulumi.set(__self__, "type", type)
if container is not None:
pulumi.set(__self__, "container", container)
if farm is None:
@ -36,10 +41,6 @@ class RubberTreeArgs:
size = 'medium'
if size is not None:
pulumi.set(__self__, "size", size)
if type is None:
type = 'Burgundy'
if type is not None:
pulumi.set(__self__, "type", type)
@property
@pulumi.getter
@ -50,6 +51,15 @@ class RubberTreeArgs:
def diameter(self, value: pulumi.Input['Diameter']):
pulumi.set(self, "diameter", value)
@property
@pulumi.getter
def type(self) -> pulumi.Input['RubberTreeVariety']:
return pulumi.get(self, "type")
@type.setter
def type(self, value: pulumi.Input['RubberTreeVariety']):
pulumi.set(self, "type", value)
@property
@pulumi.getter
def container(self) -> Optional[pulumi.Input['_root_inputs.ContainerArgs']]:
@ -77,15 +87,6 @@ class RubberTreeArgs:
def size(self, value: Optional[pulumi.Input['TreeSize']]):
pulumi.set(self, "size", value)
@property
@pulumi.getter
def type(self) -> Optional[pulumi.Input['RubberTreeVariety']]:
return pulumi.get(self, "type")
@type.setter
def type(self, value: Optional[pulumi.Input['RubberTreeVariety']]):
pulumi.set(self, "type", value)
@pulumi.input_type
class _RubberTreeState:
@ -166,6 +167,8 @@ class RubberTree(pulumi.CustomResource):
__props__ = RubberTreeArgs.__new__(RubberTreeArgs)
__props__.__dict__["container"] = container
if diameter is None:
diameter = 6
if diameter is None and not opts.urn:
raise TypeError("Missing required property 'diameter'")
__props__.__dict__["diameter"] = diameter
@ -177,6 +180,8 @@ class RubberTree(pulumi.CustomResource):
__props__.__dict__["size"] = size
if type is None:
type = 'Burgundy'
if type is None and not opts.urn:
raise TypeError("Missing required property 'type'")
__props__.__dict__["type"] = type
super(RubberTree, __self__).__init__(
'plant:tree/v1:RubberTree',
@ -230,6 +235,6 @@ class RubberTree(pulumi.CustomResource):
@property
@pulumi.getter
def type(self) -> pulumi.Output[Optional['RubberTreeVariety']]:
def type(self) -> pulumi.Output['RubberTreeVariety']:
return pulumi.get(self, "type")

View file

@ -42,7 +42,8 @@
"default": "medium"
},
"diameter": {
"$ref": "#/types/plant:tree/v1:Diameter"
"$ref": "#/types/plant:tree/v1:Diameter",
"default": 6
}
},
"stateInputs": {
@ -74,11 +75,12 @@
"default": "medium"
},
"diameter": {
"$ref": "#/types/plant:tree/v1:Diameter"
"$ref": "#/types/plant:tree/v1:Diameter",
"default": 6
}
},
"required": ["diameter"],
"requiredInputs": ["diameter"]
"required": ["type", "diameter"],
"requiredInputs": ["type", "diameter"]
}
},
"types": {

View file

@ -77,7 +77,7 @@ type CatInput interface {
}
func (*Cat) ElementType() reflect.Type {
return reflect.TypeOf((*Cat)(nil))
return reflect.TypeOf((**Cat)(nil)).Elem()
}
func (i *Cat) ToCatOutput() CatOutput {
@ -88,35 +88,6 @@ func (i *Cat) ToCatOutputWithContext(ctx context.Context) CatOutput {
return pulumi.ToOutputWithContext(ctx, i).(CatOutput)
}
func (i *Cat) ToCatPtrOutput() CatPtrOutput {
return i.ToCatPtrOutputWithContext(context.Background())
}
func (i *Cat) ToCatPtrOutputWithContext(ctx context.Context) CatPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(CatPtrOutput)
}
type CatPtrInput interface {
pulumi.Input
ToCatPtrOutput() CatPtrOutput
ToCatPtrOutputWithContext(ctx context.Context) CatPtrOutput
}
type catPtrType CatArgs
func (*catPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**Cat)(nil))
}
func (i *catPtrType) ToCatPtrOutput() CatPtrOutput {
return i.ToCatPtrOutputWithContext(context.Background())
}
func (i *catPtrType) ToCatPtrOutputWithContext(ctx context.Context) CatPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(CatPtrOutput)
}
// CatArrayInput is an input type that accepts CatArray and CatArrayOutput values.
// You can construct a concrete instance of `CatArrayInput` via:
//
@ -170,7 +141,7 @@ func (i CatMap) ToCatMapOutputWithContext(ctx context.Context) CatMapOutput {
type CatOutput struct{ *pulumi.OutputState }
func (CatOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Cat)(nil))
return reflect.TypeOf((**Cat)(nil)).Elem()
}
func (o CatOutput) ToCatOutput() CatOutput {
@ -181,44 +152,10 @@ func (o CatOutput) ToCatOutputWithContext(ctx context.Context) CatOutput {
return o
}
func (o CatOutput) ToCatPtrOutput() CatPtrOutput {
return o.ToCatPtrOutputWithContext(context.Background())
}
func (o CatOutput) ToCatPtrOutputWithContext(ctx context.Context) CatPtrOutput {
return o.ApplyTWithContext(ctx, func(_ context.Context, v Cat) *Cat {
return &v
}).(CatPtrOutput)
}
type CatPtrOutput struct{ *pulumi.OutputState }
func (CatPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Cat)(nil))
}
func (o CatPtrOutput) ToCatPtrOutput() CatPtrOutput {
return o
}
func (o CatPtrOutput) ToCatPtrOutputWithContext(ctx context.Context) CatPtrOutput {
return o
}
func (o CatPtrOutput) Elem() CatOutput {
return o.ApplyT(func(v *Cat) Cat {
if v != nil {
return *v
}
var ret Cat
return ret
}).(CatOutput)
}
type CatArrayOutput struct{ *pulumi.OutputState }
func (CatArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]Cat)(nil))
return reflect.TypeOf((*[]*Cat)(nil)).Elem()
}
func (o CatArrayOutput) ToCatArrayOutput() CatArrayOutput {
@ -230,15 +167,15 @@ func (o CatArrayOutput) ToCatArrayOutputWithContext(ctx context.Context) CatArra
}
func (o CatArrayOutput) Index(i pulumi.IntInput) CatOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) Cat {
return vs[0].([]Cat)[vs[1].(int)]
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Cat {
return vs[0].([]*Cat)[vs[1].(int)]
}).(CatOutput)
}
type CatMapOutput struct{ *pulumi.OutputState }
func (CatMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]Cat)(nil))
return reflect.TypeOf((*map[string]*Cat)(nil)).Elem()
}
func (o CatMapOutput) ToCatMapOutput() CatMapOutput {
@ -250,18 +187,16 @@ func (o CatMapOutput) ToCatMapOutputWithContext(ctx context.Context) CatMapOutpu
}
func (o CatMapOutput) MapIndex(k pulumi.StringInput) CatOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) Cat {
return vs[0].(map[string]Cat)[vs[1].(string)]
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Cat {
return vs[0].(map[string]*Cat)[vs[1].(string)]
}).(CatOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*CatInput)(nil)).Elem(), &Cat{})
pulumi.RegisterInputType(reflect.TypeOf((*CatPtrInput)(nil)).Elem(), &Cat{})
pulumi.RegisterInputType(reflect.TypeOf((*CatArrayInput)(nil)).Elem(), CatArray{})
pulumi.RegisterInputType(reflect.TypeOf((*CatMapInput)(nil)).Elem(), CatMap{})
pulumi.RegisterOutputType(CatOutput{})
pulumi.RegisterOutputType(CatPtrOutput{})
pulumi.RegisterOutputType(CatArrayOutput{})
pulumi.RegisterOutputType(CatMapOutput{})
}

View file

@ -101,7 +101,7 @@ type ComponentInput interface {
}
func (*Component) ElementType() reflect.Type {
return reflect.TypeOf((*Component)(nil))
return reflect.TypeOf((**Component)(nil)).Elem()
}
func (i *Component) ToComponentOutput() ComponentOutput {
@ -112,35 +112,6 @@ func (i *Component) ToComponentOutputWithContext(ctx context.Context) ComponentO
return pulumi.ToOutputWithContext(ctx, i).(ComponentOutput)
}
func (i *Component) ToComponentPtrOutput() ComponentPtrOutput {
return i.ToComponentPtrOutputWithContext(context.Background())
}
func (i *Component) ToComponentPtrOutputWithContext(ctx context.Context) ComponentPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(ComponentPtrOutput)
}
type ComponentPtrInput interface {
pulumi.Input
ToComponentPtrOutput() ComponentPtrOutput
ToComponentPtrOutputWithContext(ctx context.Context) ComponentPtrOutput
}
type componentPtrType ComponentArgs
func (*componentPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**Component)(nil))
}
func (i *componentPtrType) ToComponentPtrOutput() ComponentPtrOutput {
return i.ToComponentPtrOutputWithContext(context.Background())
}
func (i *componentPtrType) ToComponentPtrOutputWithContext(ctx context.Context) ComponentPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(ComponentPtrOutput)
}
// ComponentArrayInput is an input type that accepts ComponentArray and ComponentArrayOutput values.
// You can construct a concrete instance of `ComponentArrayInput` via:
//
@ -194,7 +165,7 @@ func (i ComponentMap) ToComponentMapOutputWithContext(ctx context.Context) Compo
type ComponentOutput struct{ *pulumi.OutputState }
func (ComponentOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Component)(nil))
return reflect.TypeOf((**Component)(nil)).Elem()
}
func (o ComponentOutput) ToComponentOutput() ComponentOutput {
@ -205,44 +176,10 @@ func (o ComponentOutput) ToComponentOutputWithContext(ctx context.Context) Compo
return o
}
func (o ComponentOutput) ToComponentPtrOutput() ComponentPtrOutput {
return o.ToComponentPtrOutputWithContext(context.Background())
}
func (o ComponentOutput) ToComponentPtrOutputWithContext(ctx context.Context) ComponentPtrOutput {
return o.ApplyTWithContext(ctx, func(_ context.Context, v Component) *Component {
return &v
}).(ComponentPtrOutput)
}
type ComponentPtrOutput struct{ *pulumi.OutputState }
func (ComponentPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Component)(nil))
}
func (o ComponentPtrOutput) ToComponentPtrOutput() ComponentPtrOutput {
return o
}
func (o ComponentPtrOutput) ToComponentPtrOutputWithContext(ctx context.Context) ComponentPtrOutput {
return o
}
func (o ComponentPtrOutput) Elem() ComponentOutput {
return o.ApplyT(func(v *Component) Component {
if v != nil {
return *v
}
var ret Component
return ret
}).(ComponentOutput)
}
type ComponentArrayOutput struct{ *pulumi.OutputState }
func (ComponentArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]Component)(nil))
return reflect.TypeOf((*[]*Component)(nil)).Elem()
}
func (o ComponentArrayOutput) ToComponentArrayOutput() ComponentArrayOutput {
@ -254,15 +191,15 @@ func (o ComponentArrayOutput) ToComponentArrayOutputWithContext(ctx context.Cont
}
func (o ComponentArrayOutput) Index(i pulumi.IntInput) ComponentOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) Component {
return vs[0].([]Component)[vs[1].(int)]
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Component {
return vs[0].([]*Component)[vs[1].(int)]
}).(ComponentOutput)
}
type ComponentMapOutput struct{ *pulumi.OutputState }
func (ComponentMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]Component)(nil))
return reflect.TypeOf((*map[string]*Component)(nil)).Elem()
}
func (o ComponentMapOutput) ToComponentMapOutput() ComponentMapOutput {
@ -274,18 +211,16 @@ func (o ComponentMapOutput) ToComponentMapOutputWithContext(ctx context.Context)
}
func (o ComponentMapOutput) MapIndex(k pulumi.StringInput) ComponentOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) Component {
return vs[0].(map[string]Component)[vs[1].(string)]
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Component {
return vs[0].(map[string]*Component)[vs[1].(string)]
}).(ComponentOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ComponentInput)(nil)).Elem(), &Component{})
pulumi.RegisterInputType(reflect.TypeOf((*ComponentPtrInput)(nil)).Elem(), &Component{})
pulumi.RegisterInputType(reflect.TypeOf((*ComponentArrayInput)(nil)).Elem(), ComponentArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ComponentMapInput)(nil)).Elem(), ComponentMap{})
pulumi.RegisterOutputType(ComponentOutput{})
pulumi.RegisterOutputType(ComponentPtrOutput{})
pulumi.RegisterOutputType(ComponentArrayOutput{})
pulumi.RegisterOutputType(ComponentMapOutput{})
}

View file

@ -48,7 +48,7 @@ type ProviderInput interface {
}
func (*Provider) ElementType() reflect.Type {
return reflect.TypeOf((*Provider)(nil))
return reflect.TypeOf((**Provider)(nil)).Elem()
}
func (i *Provider) ToProviderOutput() ProviderOutput {
@ -59,39 +59,10 @@ func (i *Provider) ToProviderOutputWithContext(ctx context.Context) ProviderOutp
return pulumi.ToOutputWithContext(ctx, i).(ProviderOutput)
}
func (i *Provider) ToProviderPtrOutput() ProviderPtrOutput {
return i.ToProviderPtrOutputWithContext(context.Background())
}
func (i *Provider) ToProviderPtrOutputWithContext(ctx context.Context) ProviderPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(ProviderPtrOutput)
}
type ProviderPtrInput interface {
pulumi.Input
ToProviderPtrOutput() ProviderPtrOutput
ToProviderPtrOutputWithContext(ctx context.Context) ProviderPtrOutput
}
type providerPtrType ProviderArgs
func (*providerPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**Provider)(nil))
}
func (i *providerPtrType) ToProviderPtrOutput() ProviderPtrOutput {
return i.ToProviderPtrOutputWithContext(context.Background())
}
func (i *providerPtrType) ToProviderPtrOutputWithContext(ctx context.Context) ProviderPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(ProviderPtrOutput)
}
type ProviderOutput struct{ *pulumi.OutputState }
func (ProviderOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Provider)(nil))
return reflect.TypeOf((**Provider)(nil)).Elem()
}
func (o ProviderOutput) ToProviderOutput() ProviderOutput {
@ -102,43 +73,7 @@ func (o ProviderOutput) ToProviderOutputWithContext(ctx context.Context) Provide
return o
}
func (o ProviderOutput) ToProviderPtrOutput() ProviderPtrOutput {
return o.ToProviderPtrOutputWithContext(context.Background())
}
func (o ProviderOutput) ToProviderPtrOutputWithContext(ctx context.Context) ProviderPtrOutput {
return o.ApplyTWithContext(ctx, func(_ context.Context, v Provider) *Provider {
return &v
}).(ProviderPtrOutput)
}
type ProviderPtrOutput struct{ *pulumi.OutputState }
func (ProviderPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Provider)(nil))
}
func (o ProviderPtrOutput) ToProviderPtrOutput() ProviderPtrOutput {
return o
}
func (o ProviderPtrOutput) ToProviderPtrOutputWithContext(ctx context.Context) ProviderPtrOutput {
return o
}
func (o ProviderPtrOutput) Elem() ProviderOutput {
return o.ApplyT(func(v *Provider) Provider {
if v != nil {
return *v
}
var ret Provider
return ret
}).(ProviderOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ProviderInput)(nil)).Elem(), &Provider{})
pulumi.RegisterInputType(reflect.TypeOf((*ProviderPtrInput)(nil)).Elem(), &Provider{})
pulumi.RegisterOutputType(ProviderOutput{})
pulumi.RegisterOutputType(ProviderPtrOutput{})
}

View file

@ -75,3 +75,11 @@ func PkgVersion() (semver.Version, error) {
}
return semver.Version{}, fmt.Errorf("failed to determine the package version from %s", pkgPath)
}
// isZero is a null safe check for if a value is it's types zero value.
func isZero(v interface{}) bool {
if v == nil {
return true
}
return reflect.ValueOf(v).IsZero()
}

View file

@ -74,7 +74,7 @@ type WorkloadInput interface {
}
func (*Workload) ElementType() reflect.Type {
return reflect.TypeOf((*Workload)(nil))
return reflect.TypeOf((**Workload)(nil)).Elem()
}
func (i *Workload) ToWorkloadOutput() WorkloadOutput {
@ -85,35 +85,6 @@ func (i *Workload) ToWorkloadOutputWithContext(ctx context.Context) WorkloadOutp
return pulumi.ToOutputWithContext(ctx, i).(WorkloadOutput)
}
func (i *Workload) ToWorkloadPtrOutput() WorkloadPtrOutput {
return i.ToWorkloadPtrOutputWithContext(context.Background())
}
func (i *Workload) ToWorkloadPtrOutputWithContext(ctx context.Context) WorkloadPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(WorkloadPtrOutput)
}
type WorkloadPtrInput interface {
pulumi.Input
ToWorkloadPtrOutput() WorkloadPtrOutput
ToWorkloadPtrOutputWithContext(ctx context.Context) WorkloadPtrOutput
}
type workloadPtrType WorkloadArgs
func (*workloadPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**Workload)(nil))
}
func (i *workloadPtrType) ToWorkloadPtrOutput() WorkloadPtrOutput {
return i.ToWorkloadPtrOutputWithContext(context.Background())
}
func (i *workloadPtrType) ToWorkloadPtrOutputWithContext(ctx context.Context) WorkloadPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(WorkloadPtrOutput)
}
// WorkloadArrayInput is an input type that accepts WorkloadArray and WorkloadArrayOutput values.
// You can construct a concrete instance of `WorkloadArrayInput` via:
//
@ -167,7 +138,7 @@ func (i WorkloadMap) ToWorkloadMapOutputWithContext(ctx context.Context) Workloa
type WorkloadOutput struct{ *pulumi.OutputState }
func (WorkloadOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Workload)(nil))
return reflect.TypeOf((**Workload)(nil)).Elem()
}
func (o WorkloadOutput) ToWorkloadOutput() WorkloadOutput {
@ -178,44 +149,10 @@ func (o WorkloadOutput) ToWorkloadOutputWithContext(ctx context.Context) Workloa
return o
}
func (o WorkloadOutput) ToWorkloadPtrOutput() WorkloadPtrOutput {
return o.ToWorkloadPtrOutputWithContext(context.Background())
}
func (o WorkloadOutput) ToWorkloadPtrOutputWithContext(ctx context.Context) WorkloadPtrOutput {
return o.ApplyTWithContext(ctx, func(_ context.Context, v Workload) *Workload {
return &v
}).(WorkloadPtrOutput)
}
type WorkloadPtrOutput struct{ *pulumi.OutputState }
func (WorkloadPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Workload)(nil))
}
func (o WorkloadPtrOutput) ToWorkloadPtrOutput() WorkloadPtrOutput {
return o
}
func (o WorkloadPtrOutput) ToWorkloadPtrOutputWithContext(ctx context.Context) WorkloadPtrOutput {
return o
}
func (o WorkloadPtrOutput) Elem() WorkloadOutput {
return o.ApplyT(func(v *Workload) Workload {
if v != nil {
return *v
}
var ret Workload
return ret
}).(WorkloadOutput)
}
type WorkloadArrayOutput struct{ *pulumi.OutputState }
func (WorkloadArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]Workload)(nil))
return reflect.TypeOf((*[]*Workload)(nil)).Elem()
}
func (o WorkloadArrayOutput) ToWorkloadArrayOutput() WorkloadArrayOutput {
@ -227,15 +164,15 @@ func (o WorkloadArrayOutput) ToWorkloadArrayOutputWithContext(ctx context.Contex
}
func (o WorkloadArrayOutput) Index(i pulumi.IntInput) WorkloadOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) Workload {
return vs[0].([]Workload)[vs[1].(int)]
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Workload {
return vs[0].([]*Workload)[vs[1].(int)]
}).(WorkloadOutput)
}
type WorkloadMapOutput struct{ *pulumi.OutputState }
func (WorkloadMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]Workload)(nil))
return reflect.TypeOf((*map[string]*Workload)(nil)).Elem()
}
func (o WorkloadMapOutput) ToWorkloadMapOutput() WorkloadMapOutput {
@ -247,18 +184,16 @@ func (o WorkloadMapOutput) ToWorkloadMapOutputWithContext(ctx context.Context) W
}
func (o WorkloadMapOutput) MapIndex(k pulumi.StringInput) WorkloadOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) Workload {
return vs[0].(map[string]Workload)[vs[1].(string)]
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Workload {
return vs[0].(map[string]*Workload)[vs[1].(string)]
}).(WorkloadOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*WorkloadInput)(nil)).Elem(), &Workload{})
pulumi.RegisterInputType(reflect.TypeOf((*WorkloadPtrInput)(nil)).Elem(), &Workload{})
pulumi.RegisterInputType(reflect.TypeOf((*WorkloadArrayInput)(nil)).Elem(), WorkloadArray{})
pulumi.RegisterInputType(reflect.TypeOf((*WorkloadMapInput)(nil)).Elem(), WorkloadMap{})
pulumi.RegisterOutputType(WorkloadOutput{})
pulumi.RegisterOutputType(WorkloadPtrOutput{})
pulumi.RegisterOutputType(WorkloadArrayOutput{})
pulumi.RegisterOutputType(WorkloadMapOutput{})
}

View file

@ -48,7 +48,7 @@ type ProviderInput interface {
}
func (*Provider) ElementType() reflect.Type {
return reflect.TypeOf((*Provider)(nil))
return reflect.TypeOf((**Provider)(nil)).Elem()
}
func (i *Provider) ToProviderOutput() ProviderOutput {
@ -59,39 +59,10 @@ func (i *Provider) ToProviderOutputWithContext(ctx context.Context) ProviderOutp
return pulumi.ToOutputWithContext(ctx, i).(ProviderOutput)
}
func (i *Provider) ToProviderPtrOutput() ProviderPtrOutput {
return i.ToProviderPtrOutputWithContext(context.Background())
}
func (i *Provider) ToProviderPtrOutputWithContext(ctx context.Context) ProviderPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(ProviderPtrOutput)
}
type ProviderPtrInput interface {
pulumi.Input
ToProviderPtrOutput() ProviderPtrOutput
ToProviderPtrOutputWithContext(ctx context.Context) ProviderPtrOutput
}
type providerPtrType ProviderArgs
func (*providerPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**Provider)(nil))
}
func (i *providerPtrType) ToProviderPtrOutput() ProviderPtrOutput {
return i.ToProviderPtrOutputWithContext(context.Background())
}
func (i *providerPtrType) ToProviderPtrOutputWithContext(ctx context.Context) ProviderPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(ProviderPtrOutput)
}
type ProviderOutput struct{ *pulumi.OutputState }
func (ProviderOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Provider)(nil))
return reflect.TypeOf((**Provider)(nil)).Elem()
}
func (o ProviderOutput) ToProviderOutput() ProviderOutput {
@ -102,43 +73,7 @@ func (o ProviderOutput) ToProviderOutputWithContext(ctx context.Context) Provide
return o
}
func (o ProviderOutput) ToProviderPtrOutput() ProviderPtrOutput {
return o.ToProviderPtrOutputWithContext(context.Background())
}
func (o ProviderOutput) ToProviderPtrOutputWithContext(ctx context.Context) ProviderPtrOutput {
return o.ApplyTWithContext(ctx, func(_ context.Context, v Provider) *Provider {
return &v
}).(ProviderPtrOutput)
}
type ProviderPtrOutput struct{ *pulumi.OutputState }
func (ProviderPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Provider)(nil))
}
func (o ProviderPtrOutput) ToProviderPtrOutput() ProviderPtrOutput {
return o
}
func (o ProviderPtrOutput) ToProviderPtrOutputWithContext(ctx context.Context) ProviderPtrOutput {
return o
}
func (o ProviderPtrOutput) Elem() ProviderOutput {
return o.ApplyT(func(v *Provider) Provider {
if v != nil {
return *v
}
var ret Provider
return ret
}).(ProviderOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ProviderInput)(nil)).Elem(), &Provider{})
pulumi.RegisterInputType(reflect.TypeOf((*ProviderPtrInput)(nil)).Elem(), &Provider{})
pulumi.RegisterOutputType(ProviderOutput{})
pulumi.RegisterOutputType(ProviderPtrOutput{})
}

View file

@ -75,3 +75,11 @@ func PkgVersion() (semver.Version, error) {
}
return semver.Version{}, fmt.Errorf("failed to determine the package version from %s", pkgPath)
}
// isZero is a null safe check for if a value is it's types zero value.
func isZero(v interface{}) bool {
if v == nil {
return true
}
return reflect.ValueOf(v).IsZero()
}

View file

@ -65,7 +65,7 @@ type RegistryGeoReplicationInput interface {
}
func (*RegistryGeoReplication) ElementType() reflect.Type {
return reflect.TypeOf((*RegistryGeoReplication)(nil))
return reflect.TypeOf((**RegistryGeoReplication)(nil)).Elem()
}
func (i *RegistryGeoReplication) ToRegistryGeoReplicationOutput() RegistryGeoReplicationOutput {
@ -76,35 +76,6 @@ func (i *RegistryGeoReplication) ToRegistryGeoReplicationOutputWithContext(ctx c
return pulumi.ToOutputWithContext(ctx, i).(RegistryGeoReplicationOutput)
}
func (i *RegistryGeoReplication) ToRegistryGeoReplicationPtrOutput() RegistryGeoReplicationPtrOutput {
return i.ToRegistryGeoReplicationPtrOutputWithContext(context.Background())
}
func (i *RegistryGeoReplication) ToRegistryGeoReplicationPtrOutputWithContext(ctx context.Context) RegistryGeoReplicationPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(RegistryGeoReplicationPtrOutput)
}
type RegistryGeoReplicationPtrInput interface {
pulumi.Input
ToRegistryGeoReplicationPtrOutput() RegistryGeoReplicationPtrOutput
ToRegistryGeoReplicationPtrOutputWithContext(ctx context.Context) RegistryGeoReplicationPtrOutput
}
type registryGeoReplicationPtrType RegistryGeoReplicationArgs
func (*registryGeoReplicationPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**RegistryGeoReplication)(nil))
}
func (i *registryGeoReplicationPtrType) ToRegistryGeoReplicationPtrOutput() RegistryGeoReplicationPtrOutput {
return i.ToRegistryGeoReplicationPtrOutputWithContext(context.Background())
}
func (i *registryGeoReplicationPtrType) ToRegistryGeoReplicationPtrOutputWithContext(ctx context.Context) RegistryGeoReplicationPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(RegistryGeoReplicationPtrOutput)
}
// RegistryGeoReplicationArrayInput is an input type that accepts RegistryGeoReplicationArray and RegistryGeoReplicationArrayOutput values.
// You can construct a concrete instance of `RegistryGeoReplicationArrayInput` via:
//
@ -158,7 +129,7 @@ func (i RegistryGeoReplicationMap) ToRegistryGeoReplicationMapOutputWithContext(
type RegistryGeoReplicationOutput struct{ *pulumi.OutputState }
func (RegistryGeoReplicationOutput) ElementType() reflect.Type {
return reflect.TypeOf((*RegistryGeoReplication)(nil))
return reflect.TypeOf((**RegistryGeoReplication)(nil)).Elem()
}
func (o RegistryGeoReplicationOutput) ToRegistryGeoReplicationOutput() RegistryGeoReplicationOutput {
@ -169,44 +140,10 @@ func (o RegistryGeoReplicationOutput) ToRegistryGeoReplicationOutputWithContext(
return o
}
func (o RegistryGeoReplicationOutput) ToRegistryGeoReplicationPtrOutput() RegistryGeoReplicationPtrOutput {
return o.ToRegistryGeoReplicationPtrOutputWithContext(context.Background())
}
func (o RegistryGeoReplicationOutput) ToRegistryGeoReplicationPtrOutputWithContext(ctx context.Context) RegistryGeoReplicationPtrOutput {
return o.ApplyTWithContext(ctx, func(_ context.Context, v RegistryGeoReplication) *RegistryGeoReplication {
return &v
}).(RegistryGeoReplicationPtrOutput)
}
type RegistryGeoReplicationPtrOutput struct{ *pulumi.OutputState }
func (RegistryGeoReplicationPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**RegistryGeoReplication)(nil))
}
func (o RegistryGeoReplicationPtrOutput) ToRegistryGeoReplicationPtrOutput() RegistryGeoReplicationPtrOutput {
return o
}
func (o RegistryGeoReplicationPtrOutput) ToRegistryGeoReplicationPtrOutputWithContext(ctx context.Context) RegistryGeoReplicationPtrOutput {
return o
}
func (o RegistryGeoReplicationPtrOutput) Elem() RegistryGeoReplicationOutput {
return o.ApplyT(func(v *RegistryGeoReplication) RegistryGeoReplication {
if v != nil {
return *v
}
var ret RegistryGeoReplication
return ret
}).(RegistryGeoReplicationOutput)
}
type RegistryGeoReplicationArrayOutput struct{ *pulumi.OutputState }
func (RegistryGeoReplicationArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]RegistryGeoReplication)(nil))
return reflect.TypeOf((*[]*RegistryGeoReplication)(nil)).Elem()
}
func (o RegistryGeoReplicationArrayOutput) ToRegistryGeoReplicationArrayOutput() RegistryGeoReplicationArrayOutput {
@ -218,15 +155,15 @@ func (o RegistryGeoReplicationArrayOutput) ToRegistryGeoReplicationArrayOutputWi
}
func (o RegistryGeoReplicationArrayOutput) Index(i pulumi.IntInput) RegistryGeoReplicationOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) RegistryGeoReplication {
return vs[0].([]RegistryGeoReplication)[vs[1].(int)]
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *RegistryGeoReplication {
return vs[0].([]*RegistryGeoReplication)[vs[1].(int)]
}).(RegistryGeoReplicationOutput)
}
type RegistryGeoReplicationMapOutput struct{ *pulumi.OutputState }
func (RegistryGeoReplicationMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]RegistryGeoReplication)(nil))
return reflect.TypeOf((*map[string]*RegistryGeoReplication)(nil)).Elem()
}
func (o RegistryGeoReplicationMapOutput) ToRegistryGeoReplicationMapOutput() RegistryGeoReplicationMapOutput {
@ -238,18 +175,16 @@ func (o RegistryGeoReplicationMapOutput) ToRegistryGeoReplicationMapOutputWithCo
}
func (o RegistryGeoReplicationMapOutput) MapIndex(k pulumi.StringInput) RegistryGeoReplicationOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) RegistryGeoReplication {
return vs[0].(map[string]RegistryGeoReplication)[vs[1].(string)]
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *RegistryGeoReplication {
return vs[0].(map[string]*RegistryGeoReplication)[vs[1].(string)]
}).(RegistryGeoReplicationOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*RegistryGeoReplicationInput)(nil)).Elem(), &RegistryGeoReplication{})
pulumi.RegisterInputType(reflect.TypeOf((*RegistryGeoReplicationPtrInput)(nil)).Elem(), &RegistryGeoReplication{})
pulumi.RegisterInputType(reflect.TypeOf((*RegistryGeoReplicationArrayInput)(nil)).Elem(), RegistryGeoReplicationArray{})
pulumi.RegisterInputType(reflect.TypeOf((*RegistryGeoReplicationMapInput)(nil)).Elem(), RegistryGeoReplicationMap{})
pulumi.RegisterOutputType(RegistryGeoReplicationOutput{})
pulumi.RegisterOutputType(RegistryGeoReplicationPtrOutput{})
pulumi.RegisterOutputType(RegistryGeoReplicationArrayOutput{})
pulumi.RegisterOutputType(RegistryGeoReplicationMapOutput{})
}

View file

@ -48,7 +48,7 @@ type ProviderInput interface {
}
func (*Provider) ElementType() reflect.Type {
return reflect.TypeOf((*Provider)(nil))
return reflect.TypeOf((**Provider)(nil)).Elem()
}
func (i *Provider) ToProviderOutput() ProviderOutput {
@ -62,7 +62,7 @@ func (i *Provider) ToProviderOutputWithContext(ctx context.Context) ProviderOutp
type ProviderOutput struct{ *pulumi.OutputState }
func (ProviderOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Provider)(nil))
return reflect.TypeOf((**Provider)(nil)).Elem()
}
func (o ProviderOutput) ToProviderOutput() ProviderOutput {

View file

@ -75,3 +75,11 @@ func PkgVersion() (semver.Version, error) {
}
return semver.Version{}, fmt.Errorf("failed to determine the package version from %s", pkgPath)
}
// isZero is a null safe check for if a value is it's types zero value.
func isZero(v interface{}) bool {
if v == nil {
return true
}
return reflect.ValueOf(v).IsZero()
}

View file

@ -73,7 +73,7 @@ type ResourceInput interface {
}
func (*Resource) ElementType() reflect.Type {
return reflect.TypeOf((*Resource)(nil))
return reflect.TypeOf((**Resource)(nil)).Elem()
}
func (i *Resource) ToResourceOutput() ResourceOutput {
@ -87,7 +87,7 @@ func (i *Resource) ToResourceOutputWithContext(ctx context.Context) ResourceOutp
type ResourceOutput struct{ *pulumi.OutputState }
func (ResourceOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Resource)(nil))
return reflect.TypeOf((**Resource)(nil)).Elem()
}
func (o ResourceOutput) ToResourceOutput() ResourceOutput {

View file

@ -73,7 +73,7 @@ type ResourceInputResourceInput interface {
}
func (*ResourceInputResource) ElementType() reflect.Type {
return reflect.TypeOf((*ResourceInputResource)(nil))
return reflect.TypeOf((**ResourceInputResource)(nil)).Elem()
}
func (i *ResourceInputResource) ToResourceInputResourceOutput() ResourceInputResourceOutput {
@ -87,7 +87,7 @@ func (i *ResourceInputResource) ToResourceInputResourceOutputWithContext(ctx con
type ResourceInputResourceOutput struct{ *pulumi.OutputState }
func (ResourceInputResourceOutput) ElementType() reflect.Type {
return reflect.TypeOf((*ResourceInputResource)(nil))
return reflect.TypeOf((**ResourceInputResource)(nil)).Elem()
}
func (o ResourceInputResourceOutput) ToResourceInputResourceOutput() ResourceInputResourceOutput {

View file

@ -82,7 +82,7 @@ type ResourceInput interface {
}
func (*Resource) ElementType() reflect.Type {
return reflect.TypeOf((*Resource)(nil))
return reflect.TypeOf((**Resource)(nil)).Elem()
}
func (i *Resource) ToResourceOutput() ResourceOutput {
@ -96,7 +96,7 @@ func (i *Resource) ToResourceOutputWithContext(ctx context.Context) ResourceOutp
type ResourceOutput struct{ *pulumi.OutputState }
func (ResourceOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Resource)(nil))
return reflect.TypeOf((**Resource)(nil)).Elem()
}
func (o ResourceOutput) ToResourceOutput() ResourceOutput {

View file

@ -48,7 +48,7 @@ type ProviderInput interface {
}
func (*Provider) ElementType() reflect.Type {
return reflect.TypeOf((*Provider)(nil))
return reflect.TypeOf((**Provider)(nil)).Elem()
}
func (i *Provider) ToProviderOutput() ProviderOutput {
@ -62,7 +62,7 @@ func (i *Provider) ToProviderOutputWithContext(ctx context.Context) ProviderOutp
type ProviderOutput struct{ *pulumi.OutputState }
func (ProviderOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Provider)(nil))
return reflect.TypeOf((**Provider)(nil)).Elem()
}
func (o ProviderOutput) ToProviderOutput() ProviderOutput {

View file

@ -75,3 +75,11 @@ func PkgVersion() (semver.Version, error) {
}
return semver.Version{}, fmt.Errorf("failed to determine the package version from %s", pkgPath)
}
// isZero is a null safe check for if a value is it's types zero value.
func isZero(v interface{}) bool {
if v == nil {
return true
}
return reflect.ValueOf(v).IsZero()
}

View file

@ -82,7 +82,7 @@ type ResourceInput interface {
}
func (*Resource) ElementType() reflect.Type {
return reflect.TypeOf((*Resource)(nil))
return reflect.TypeOf((**Resource)(nil)).Elem()
}
func (i *Resource) ToResourceOutput() ResourceOutput {
@ -96,7 +96,7 @@ func (i *Resource) ToResourceOutputWithContext(ctx context.Context) ResourceOutp
type ResourceOutput struct{ *pulumi.OutputState }
func (ResourceOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Resource)(nil))
return reflect.TypeOf((**Resource)(nil)).Elem()
}
func (o ResourceOutput) ToResourceOutput() ResourceOutput {

View file

@ -48,7 +48,7 @@ type ProviderInput interface {
}
func (*Provider) ElementType() reflect.Type {
return reflect.TypeOf((*Provider)(nil))
return reflect.TypeOf((**Provider)(nil)).Elem()
}
func (i *Provider) ToProviderOutput() ProviderOutput {
@ -62,7 +62,7 @@ func (i *Provider) ToProviderOutputWithContext(ctx context.Context) ProviderOutp
type ProviderOutput struct{ *pulumi.OutputState }
func (ProviderOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Provider)(nil))
return reflect.TypeOf((**Provider)(nil)).Elem()
}
func (o ProviderOutput) ToProviderOutput() ProviderOutput {

View file

@ -75,3 +75,11 @@ func PkgVersion() (semver.Version, error) {
}
return semver.Version{}, fmt.Errorf("failed to determine the package version from %s", pkgPath)
}
// isZero is a null safe check for if a value is it's types zero value.
func isZero(v interface{}) bool {
if v == nil {
return true
}
return reflect.ValueOf(v).IsZero()
}

View file

@ -20,7 +20,7 @@ namespace Pulumi.Myedgeorder.Outputs
/// Represents billing type.
/// Expected value is 'Pav2'.
/// </summary>
public readonly string? BillingType;
public readonly string BillingType;
/// <summary>
/// Charging type.
/// </summary>
@ -36,7 +36,7 @@ namespace Pulumi.Myedgeorder.Outputs
[OutputConstructor]
private Pav2MeterDetailsResponse(
string? billingType,
string billingType,
string chargingType,

View file

@ -20,7 +20,7 @@ namespace Pulumi.Myedgeorder.Outputs
/// Represents billing type.
/// Expected value is 'Purchase'.
/// </summary>
public readonly string? BillingType;
public readonly string BillingType;
/// <summary>
/// Charging type.
/// </summary>
@ -44,7 +44,7 @@ namespace Pulumi.Myedgeorder.Outputs
[OutputConstructor]
private PurchaseMeterDetailsResponse(
string? billingType,
string billingType,
string chargingType,

View file

@ -48,7 +48,7 @@ type ProviderInput interface {
}
func (*Provider) ElementType() reflect.Type {
return reflect.TypeOf((*Provider)(nil))
return reflect.TypeOf((**Provider)(nil)).Elem()
}
func (i *Provider) ToProviderOutput() ProviderOutput {
@ -62,7 +62,7 @@ func (i *Provider) ToProviderOutputWithContext(ctx context.Context) ProviderOutp
type ProviderOutput struct{ *pulumi.OutputState }
func (ProviderOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Provider)(nil))
return reflect.TypeOf((**Provider)(nil)).Elem()
}
func (o ProviderOutput) ToProviderOutput() ProviderOutput {

View file

@ -1657,7 +1657,7 @@ func (o LinkResponseArrayOutput) Index(i pulumi.IntInput) LinkResponseOutput {
type Pav2MeterDetailsResponse struct {
// Represents billing type.
// Expected value is 'Pav2'.
BillingType *string `pulumi:"billingType"`
BillingType string `pulumi:"billingType"`
// Charging type.
ChargingType string `pulumi:"chargingType"`
// Validation status of requested data center and transport.
@ -1681,7 +1681,7 @@ type Pav2MeterDetailsResponseInput interface {
type Pav2MeterDetailsResponseArgs struct {
// Represents billing type.
// Expected value is 'Pav2'.
BillingType pulumi.StringPtrInput `pulumi:"billingType"`
BillingType pulumi.StringInput `pulumi:"billingType"`
// Charging type.
ChargingType pulumi.StringInput `pulumi:"chargingType"`
// Validation status of requested data center and transport.
@ -1719,8 +1719,8 @@ func (o Pav2MeterDetailsResponseOutput) ToPav2MeterDetailsResponseOutputWithCont
// Represents billing type.
// Expected value is 'Pav2'.
func (o Pav2MeterDetailsResponseOutput) BillingType() pulumi.StringPtrOutput {
return o.ApplyT(func(v Pav2MeterDetailsResponse) *string { return v.BillingType }).(pulumi.StringPtrOutput)
func (o Pav2MeterDetailsResponseOutput) BillingType() pulumi.StringOutput {
return o.ApplyT(func(v Pav2MeterDetailsResponse) string { return v.BillingType }).(pulumi.StringOutput)
}
// Charging type.
@ -2231,7 +2231,7 @@ func (o ProductResponseArrayOutput) Index(i pulumi.IntInput) ProductResponseOutp
type PurchaseMeterDetailsResponse struct {
// Represents billing type.
// Expected value is 'Purchase'.
BillingType *string `pulumi:"billingType"`
BillingType string `pulumi:"billingType"`
// Charging type.
ChargingType string `pulumi:"chargingType"`
// Billing unit applicable for Pav2 billing
@ -2259,7 +2259,7 @@ type PurchaseMeterDetailsResponseInput interface {
type PurchaseMeterDetailsResponseArgs struct {
// Represents billing type.
// Expected value is 'Purchase'.
BillingType pulumi.StringPtrInput `pulumi:"billingType"`
BillingType pulumi.StringInput `pulumi:"billingType"`
// Charging type.
ChargingType pulumi.StringInput `pulumi:"chargingType"`
// Billing unit applicable for Pav2 billing
@ -2301,8 +2301,8 @@ func (o PurchaseMeterDetailsResponseOutput) ToPurchaseMeterDetailsResponseOutput
// Represents billing type.
// Expected value is 'Purchase'.
func (o PurchaseMeterDetailsResponseOutput) BillingType() pulumi.StringPtrOutput {
return o.ApplyT(func(v PurchaseMeterDetailsResponse) *string { return v.BillingType }).(pulumi.StringPtrOutput)
func (o PurchaseMeterDetailsResponseOutput) BillingType() pulumi.StringOutput {
return o.ApplyT(func(v PurchaseMeterDetailsResponse) string { return v.BillingType }).(pulumi.StringOutput)
}
// Charging type.

View file

@ -75,3 +75,11 @@ func PkgVersion() (semver.Version, error) {
}
return semver.Version{}, fmt.Errorf("failed to determine the package version from %s", pkgPath)
}
// isZero is a null safe check for if a value is it's types zero value.
func isZero(v interface{}) bool {
if v == nil {
return true
}
return reflect.ValueOf(v).IsZero()
}

View file

@ -236,7 +236,7 @@ export interface Pav2MeterDetailsResponse {
* Represents billing type.
* Expected value is 'Pav2'.
*/
billingType?: "Pav2";
billingType: "Pav2";
/**
* Charging type.
*/
@ -373,7 +373,7 @@ export interface PurchaseMeterDetailsResponse {
* Represents billing type.
* Expected value is 'Purchase'.
*/
billingType?: "Purchase";
billingType: "Purchase";
/**
* Charging type.
*/

View file

@ -600,23 +600,31 @@ class Pav2MeterDetailsResponse(dict):
Billing type PAV2 meter details
"""
def __init__(__self__, *,
billing_type: str,
charging_type: str,
meter_guid: str,
multiplier: float,
billing_type: Optional[str] = None):
multiplier: float):
"""
Billing type PAV2 meter details
:param str billing_type: Represents billing type.
Expected value is 'Pav2'.
:param str charging_type: Charging type.
:param str meter_guid: Validation status of requested data center and transport.
:param float multiplier: Billing unit applicable for Pav2 billing
:param str billing_type: Represents billing type.
Expected value is 'Pav2'.
"""
pulumi.set(__self__, "billing_type", 'Pav2')
pulumi.set(__self__, "charging_type", charging_type)
pulumi.set(__self__, "meter_guid", meter_guid)
pulumi.set(__self__, "multiplier", multiplier)
if billing_type is not None:
pulumi.set(__self__, "billing_type", 'Pav2')
@property
@pulumi.getter(name="billingType")
def billing_type(self) -> str:
"""
Represents billing type.
Expected value is 'Pav2'.
"""
return pulumi.get(self, "billing_type")
@property
@pulumi.getter(name="chargingType")
@ -642,15 +650,6 @@ class Pav2MeterDetailsResponse(dict):
"""
return pulumi.get(self, "multiplier")
@property
@pulumi.getter(name="billingType")
def billing_type(self) -> Optional[str]:
"""
Represents billing type.
Expected value is 'Pav2'.
"""
return pulumi.get(self, "billing_type")
@pulumi.output_type
class ProductFamilyResponse(dict):
@ -955,29 +954,37 @@ class PurchaseMeterDetailsResponse(dict):
Billing type Purchase meter details
"""
def __init__(__self__, *,
billing_type: str,
charging_type: str,
multiplier: float,
product_id: str,
sku_id: str,
term_id: str,
billing_type: Optional[str] = None):
term_id: str):
"""
Billing type Purchase meter details
:param str billing_type: Represents billing type.
Expected value is 'Purchase'.
:param str charging_type: Charging type.
:param float multiplier: Billing unit applicable for Pav2 billing
:param str product_id: Product Id
:param str sku_id: Sku Id
:param str term_id: Term Id
:param str billing_type: Represents billing type.
Expected value is 'Purchase'.
"""
pulumi.set(__self__, "billing_type", 'Purchase')
pulumi.set(__self__, "charging_type", charging_type)
pulumi.set(__self__, "multiplier", multiplier)
pulumi.set(__self__, "product_id", product_id)
pulumi.set(__self__, "sku_id", sku_id)
pulumi.set(__self__, "term_id", term_id)
if billing_type is not None:
pulumi.set(__self__, "billing_type", 'Purchase')
@property
@pulumi.getter(name="billingType")
def billing_type(self) -> str:
"""
Represents billing type.
Expected value is 'Purchase'.
"""
return pulumi.get(self, "billing_type")
@property
@pulumi.getter(name="chargingType")
@ -1019,15 +1026,6 @@ class PurchaseMeterDetailsResponse(dict):
"""
return pulumi.get(self, "term_id")
@property
@pulumi.getter(name="billingType")
def billing_type(self) -> Optional[str]:
"""
Represents billing type.
Expected value is 'Purchase'.
"""
return pulumi.get(self, "billing_type")
@pulumi.output_type
class SpecificationResponse(dict):

View file

@ -814,6 +814,7 @@
},
"type": "object",
"required": [
"billingType",
"chargingType",
"multiplier",
"productId",
@ -844,6 +845,7 @@
},
"type": "object",
"required": [
"billingType",
"chargingType",
"meterGuid",
"multiplier"

View file

@ -48,7 +48,7 @@ type ProviderInput interface {
}
func (*Provider) ElementType() reflect.Type {
return reflect.TypeOf((*Provider)(nil))
return reflect.TypeOf((**Provider)(nil)).Elem()
}
func (i *Provider) ToProviderOutput() ProviderOutput {
@ -62,7 +62,7 @@ func (i *Provider) ToProviderOutputWithContext(ctx context.Context) ProviderOutp
type ProviderOutput struct{ *pulumi.OutputState }
func (ProviderOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Provider)(nil))
return reflect.TypeOf((**Provider)(nil)).Elem()
}
func (o ProviderOutput) ToProviderOutput() ProviderOutput {

View file

@ -75,3 +75,11 @@ func PkgVersion() (semver.Version, error) {
}
return semver.Version{}, fmt.Errorf("failed to determine the package version from %s", pkgPath)
}
// isZero is a null safe check for if a value is it's types zero value.
func isZero(v interface{}) bool {
if v == nil {
return true
}
return reflect.ValueOf(v).IsZero()
}

View file

@ -36,7 +36,7 @@ namespace Pulumi.Mypkg.Outputs
/// The type of SSIS object metadata.
/// Expected value is 'Environment'.
/// </summary>
public readonly string? Type;
public readonly string Type;
/// <summary>
/// Variable in environment
/// </summary>
@ -52,7 +52,7 @@ namespace Pulumi.Mypkg.Outputs
string? name,
string? type,
string type,
ImmutableArray<Outputs.SsisVariableResponse> variables)
{

View file

@ -32,7 +32,7 @@ namespace Pulumi.Mypkg.Outputs
/// The type of SSIS object metadata.
/// Expected value is 'Folder'.
/// </summary>
public readonly string? Type;
public readonly string Type;
[OutputConstructor]
private SsisFolderResponse(
@ -42,7 +42,7 @@ namespace Pulumi.Mypkg.Outputs
string? name,
string? type)
string type)
{
Description = description;
Id = id;

View file

@ -48,7 +48,7 @@ namespace Pulumi.Mypkg.Outputs
/// The type of SSIS object metadata.
/// Expected value is 'Package'.
/// </summary>
public readonly string? Type;
public readonly string Type;
[OutputConstructor]
private SsisPackageResponse(
@ -66,7 +66,7 @@ namespace Pulumi.Mypkg.Outputs
double? projectVersion,
string? type)
string type)
{
Description = description;
FolderId = folderId;

View file

@ -44,7 +44,7 @@ namespace Pulumi.Mypkg.Outputs
/// The type of SSIS object metadata.
/// Expected value is 'Project'.
/// </summary>
public readonly string? Type;
public readonly string Type;
/// <summary>
/// Project version.
/// </summary>
@ -64,7 +64,7 @@ namespace Pulumi.Mypkg.Outputs
ImmutableArray<Outputs.SsisParameterResponse> parameters,
string? type,
string type,
double? version)
{

View file

@ -35,8 +35,8 @@ func (mocks) NewResource(args pulumi.MockResourceArgs) (string, resource.Propert
}
func (mocks) Call(args pulumi.MockCallArgs) (resource.PropertyMap, error) {
if args.Token == "mypkg::listStorageAccountKeys" {
switch args.Token {
case "mypkg::listStorageAccountKeys":
targs := mypkg.ListStorageAccountKeysArgs{}
for k, v := range args.Args {
switch k {
@ -72,12 +72,11 @@ func (mocks) Call(args pulumi.MockCallArgs) (resource.PropertyMap, error) {
"keys": result.Keys,
}
return resource.NewPropertyMapFromMap(outputs), nil
}
if args.Token == "mypkg::funcWithDefaultValue" ||
args.Token == "mypkg::funcWithAllOptionalInputs" ||
args.Token == "mypkg::funcWithListParam" ||
args.Token == "mypkg::funcWithDictParam" {
case "mypkg::funcWithDefaultValue",
"mypkg::funcWithAllOptionalInputs",
"mypkg::funcWithListParam",
"mypkg::funcWithDictParam":
result := mypkg.FuncWithDefaultValueResult{
R: fmt.Sprintf("%v", args.Args),
}
@ -85,9 +84,8 @@ func (mocks) Call(args pulumi.MockCallArgs) (resource.PropertyMap, error) {
"r": result.R,
}
return resource.NewPropertyMapFromMap(outputs), nil
}
if args.Token == "mypkg::getIntegrationRuntimeObjectMetadatum" {
case "mypkg::getIntegrationRuntimeObjectMetadatum":
targs := mypkg.GetIntegrationRuntimeObjectMetadatumArgs{}
for k, v := range args.Args {
switch k {
@ -151,16 +149,13 @@ func TestListStorageAccountKeysOutput(t *testing.T) {
})
}
// TODO[pulumi/pulumi#7811]: it seems that default values are not
// supported by Go codegen yet, hence we do not observe "B" populated
// to default at all here.
func TestFuncWithDefaultValueOutput(t *testing.T) {
pulumiTest(t, func(ctx *pulumi.Context) error {
output := mypkg.FuncWithDefaultValueOutput(ctx, mypkg.FuncWithDefaultValueOutputArgs{
A: pulumi.String("my-a"),
})
r := waitOut(t, output.R())
assert.Equal(t, "map[a:{my-a}]", r)
assert.Equal(t, "map[a:{my-a} b:{b-default}]", r)
return nil
})
}

View file

@ -13,7 +13,7 @@ import (
// Check codegen of functions with default values.
func FuncWithDefaultValue(ctx *pulumi.Context, args *FuncWithDefaultValueArgs, opts ...pulumi.InvokeOption) (*FuncWithDefaultValueResult, error) {
var rv FuncWithDefaultValueResult
err := ctx.Invoke("mypkg::funcWithDefaultValue", args, &rv, opts...)
err := ctx.Invoke("mypkg::funcWithDefaultValue", args.Defaults(), &rv, opts...)
if err != nil {
return nil, err
}
@ -25,6 +25,19 @@ type FuncWithDefaultValueArgs struct {
B *string `pulumi:"b"`
}
// Defaults sets the appropriate defaults for FuncWithDefaultValueArgs
func (val *FuncWithDefaultValueArgs) Defaults() *FuncWithDefaultValueArgs {
if val == nil {
return nil
}
tmp := *val
if isZero(tmp.B) {
b_ := "b-default"
tmp.B = &b_
}
return &tmp
}
type FuncWithDefaultValueResult struct {
R string `pulumi:"r"`
}

View file

@ -48,7 +48,7 @@ type ProviderInput interface {
}
func (*Provider) ElementType() reflect.Type {
return reflect.TypeOf((*Provider)(nil))
return reflect.TypeOf((**Provider)(nil)).Elem()
}
func (i *Provider) ToProviderOutput() ProviderOutput {
@ -62,7 +62,7 @@ func (i *Provider) ToProviderOutputWithContext(ctx context.Context) ProviderOutp
type ProviderOutput struct{ *pulumi.OutputState }
func (ProviderOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Provider)(nil))
return reflect.TypeOf((**Provider)(nil)).Elem()
}
func (o ProviderOutput) ToProviderOutput() ProviderOutput {

View file

@ -249,7 +249,7 @@ type SsisEnvironmentResponse struct {
Name *string `pulumi:"name"`
// The type of SSIS object metadata.
// Expected value is 'Environment'.
Type *string `pulumi:"type"`
Type string `pulumi:"type"`
// Variable in environment
Variables []SsisVariableResponse `pulumi:"variables"`
}
@ -277,7 +277,7 @@ type SsisEnvironmentResponseArgs struct {
Name pulumi.StringPtrInput `pulumi:"name"`
// The type of SSIS object metadata.
// Expected value is 'Environment'.
Type pulumi.StringPtrInput `pulumi:"type"`
Type pulumi.StringInput `pulumi:"type"`
// Variable in environment
Variables SsisVariableResponseArrayInput `pulumi:"variables"`
}
@ -331,8 +331,8 @@ func (o SsisEnvironmentResponseOutput) Name() pulumi.StringPtrOutput {
// The type of SSIS object metadata.
// Expected value is 'Environment'.
func (o SsisEnvironmentResponseOutput) Type() pulumi.StringPtrOutput {
return o.ApplyT(func(v SsisEnvironmentResponse) *string { return v.Type }).(pulumi.StringPtrOutput)
func (o SsisEnvironmentResponseOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v SsisEnvironmentResponse) string { return v.Type }).(pulumi.StringOutput)
}
// Variable in environment
@ -350,7 +350,7 @@ type SsisFolderResponse struct {
Name *string `pulumi:"name"`
// The type of SSIS object metadata.
// Expected value is 'Folder'.
Type *string `pulumi:"type"`
Type string `pulumi:"type"`
}
// SsisFolderResponseInput is an input type that accepts SsisFolderResponseArgs and SsisFolderResponseOutput values.
@ -374,7 +374,7 @@ type SsisFolderResponseArgs struct {
Name pulumi.StringPtrInput `pulumi:"name"`
// The type of SSIS object metadata.
// Expected value is 'Folder'.
Type pulumi.StringPtrInput `pulumi:"type"`
Type pulumi.StringInput `pulumi:"type"`
}
func (SsisFolderResponseArgs) ElementType() reflect.Type {
@ -421,8 +421,8 @@ func (o SsisFolderResponseOutput) Name() pulumi.StringPtrOutput {
// The type of SSIS object metadata.
// Expected value is 'Folder'.
func (o SsisFolderResponseOutput) Type() pulumi.StringPtrOutput {
return o.ApplyT(func(v SsisFolderResponse) *string { return v.Type }).(pulumi.StringPtrOutput)
func (o SsisFolderResponseOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v SsisFolderResponse) string { return v.Type }).(pulumi.StringOutput)
}
// Ssis Package.
@ -443,7 +443,7 @@ type SsisPackageResponse struct {
ProjectVersion *float64 `pulumi:"projectVersion"`
// The type of SSIS object metadata.
// Expected value is 'Package'.
Type *string `pulumi:"type"`
Type string `pulumi:"type"`
}
// SsisPackageResponseInput is an input type that accepts SsisPackageResponseArgs and SsisPackageResponseOutput values.
@ -475,7 +475,7 @@ type SsisPackageResponseArgs struct {
ProjectVersion pulumi.Float64PtrInput `pulumi:"projectVersion"`
// The type of SSIS object metadata.
// Expected value is 'Package'.
Type pulumi.StringPtrInput `pulumi:"type"`
Type pulumi.StringInput `pulumi:"type"`
}
func (SsisPackageResponseArgs) ElementType() reflect.Type {
@ -542,8 +542,8 @@ func (o SsisPackageResponseOutput) ProjectVersion() pulumi.Float64PtrOutput {
// The type of SSIS object metadata.
// Expected value is 'Package'.
func (o SsisPackageResponseOutput) Type() pulumi.StringPtrOutput {
return o.ApplyT(func(v SsisPackageResponse) *string { return v.Type }).(pulumi.StringPtrOutput)
func (o SsisPackageResponseOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v SsisPackageResponse) string { return v.Type }).(pulumi.StringOutput)
}
// Ssis parameter.
@ -761,7 +761,7 @@ type SsisProjectResponse struct {
Parameters []SsisParameterResponse `pulumi:"parameters"`
// The type of SSIS object metadata.
// Expected value is 'Project'.
Type *string `pulumi:"type"`
Type string `pulumi:"type"`
// Project version.
Version *float64 `pulumi:"version"`
}
@ -793,7 +793,7 @@ type SsisProjectResponseArgs struct {
Parameters SsisParameterResponseArrayInput `pulumi:"parameters"`
// The type of SSIS object metadata.
// Expected value is 'Project'.
Type pulumi.StringPtrInput `pulumi:"type"`
Type pulumi.StringInput `pulumi:"type"`
// Project version.
Version pulumi.Float64PtrInput `pulumi:"version"`
}
@ -857,8 +857,8 @@ func (o SsisProjectResponseOutput) Parameters() SsisParameterResponseArrayOutput
// The type of SSIS object metadata.
// Expected value is 'Project'.
func (o SsisProjectResponseOutput) Type() pulumi.StringPtrOutput {
return o.ApplyT(func(v SsisProjectResponse) *string { return v.Type }).(pulumi.StringPtrOutput)
func (o SsisProjectResponseOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v SsisProjectResponse) string { return v.Type }).(pulumi.StringOutput)
}
// Project version.

View file

@ -75,3 +75,11 @@ func PkgVersion() (semver.Version, error) {
}
return semver.Version{}, fmt.Errorf("failed to determine the package version from %s", pkgPath)
}
// isZero is a null safe check for if a value is it's types zero value.
func isZero(v interface{}) bool {
if v == nil {
return true
}
return reflect.ValueOf(v).IsZero()
}

View file

@ -50,7 +50,7 @@ export interface SsisEnvironmentResponse {
* The type of SSIS object metadata.
* Expected value is 'Environment'.
*/
type?: "Environment";
type: "Environment";
/**
* Variable in environment
*/
@ -77,7 +77,7 @@ export interface SsisFolderResponse {
* The type of SSIS object metadata.
* Expected value is 'Folder'.
*/
type?: "Folder";
type: "Folder";
}
/**
@ -116,7 +116,7 @@ export interface SsisPackageResponse {
* The type of SSIS object metadata.
* Expected value is 'Package'.
*/
type?: "Package";
type: "Package";
}
/**
@ -205,7 +205,7 @@ export interface SsisProjectResponse {
* The type of SSIS object metadata.
* Expected value is 'Project'.
*/
type?: "Project";
type: "Project";
/**
* Project version.
*/

View file

@ -85,22 +85,23 @@ class SsisEnvironmentResponse(dict):
Ssis environment.
"""
def __init__(__self__, *,
type: str,
description: Optional[str] = None,
folder_id: Optional[float] = None,
id: Optional[float] = None,
name: Optional[str] = None,
type: Optional[str] = None,
variables: Optional[Sequence['outputs.SsisVariableResponse']] = None):
"""
Ssis environment.
:param str type: The type of SSIS object metadata.
Expected value is 'Environment'.
:param str description: Metadata description.
:param float folder_id: Folder id which contains environment.
:param float id: Metadata id.
:param str name: Metadata name.
:param str type: The type of SSIS object metadata.
Expected value is 'Environment'.
:param Sequence['SsisVariableResponse'] variables: Variable in environment
"""
pulumi.set(__self__, "type", 'Environment')
if description is not None:
pulumi.set(__self__, "description", description)
if folder_id is not None:
@ -109,11 +110,18 @@ class SsisEnvironmentResponse(dict):
pulumi.set(__self__, "id", id)
if name is not None:
pulumi.set(__self__, "name", name)
if type is not None:
pulumi.set(__self__, "type", 'Environment')
if variables is not None:
pulumi.set(__self__, "variables", variables)
@property
@pulumi.getter
def type(self) -> str:
"""
The type of SSIS object metadata.
Expected value is 'Environment'.
"""
return pulumi.get(self, "type")
@property
@pulumi.getter
def description(self) -> Optional[str]:
@ -146,15 +154,6 @@ class SsisEnvironmentResponse(dict):
"""
return pulumi.get(self, "name")
@property
@pulumi.getter
def type(self) -> Optional[str]:
"""
The type of SSIS object metadata.
Expected value is 'Environment'.
"""
return pulumi.get(self, "type")
@property
@pulumi.getter
def variables(self) -> Optional[Sequence['outputs.SsisVariableResponse']]:
@ -170,26 +169,34 @@ class SsisFolderResponse(dict):
Ssis folder.
"""
def __init__(__self__, *,
type: str,
description: Optional[str] = None,
id: Optional[float] = None,
name: Optional[str] = None,
type: Optional[str] = None):
name: Optional[str] = None):
"""
Ssis folder.
:param str type: The type of SSIS object metadata.
Expected value is 'Folder'.
:param str description: Metadata description.
:param float id: Metadata id.
:param str name: Metadata name.
:param str type: The type of SSIS object metadata.
Expected value is 'Folder'.
"""
pulumi.set(__self__, "type", 'Folder')
if description is not None:
pulumi.set(__self__, "description", description)
if id is not None:
pulumi.set(__self__, "id", id)
if name is not None:
pulumi.set(__self__, "name", name)
if type is not None:
pulumi.set(__self__, "type", 'Folder')
@property
@pulumi.getter
def type(self) -> str:
"""
The type of SSIS object metadata.
Expected value is 'Folder'.
"""
return pulumi.get(self, "type")
@property
@pulumi.getter
@ -215,15 +222,6 @@ class SsisFolderResponse(dict):
"""
return pulumi.get(self, "name")
@property
@pulumi.getter
def type(self) -> Optional[str]:
"""
The type of SSIS object metadata.
Expected value is 'Folder'.
"""
return pulumi.get(self, "type")
@pulumi.output_type
class SsisPackageResponse(dict):
@ -231,16 +229,18 @@ class SsisPackageResponse(dict):
Ssis Package.
"""
def __init__(__self__, *,
type: str,
description: Optional[str] = None,
folder_id: Optional[float] = None,
id: Optional[float] = None,
name: Optional[str] = None,
parameters: Optional[Sequence['outputs.SsisParameterResponse']] = None,
project_id: Optional[float] = None,
project_version: Optional[float] = None,
type: Optional[str] = None):
project_version: Optional[float] = None):
"""
Ssis Package.
:param str type: The type of SSIS object metadata.
Expected value is 'Package'.
:param str description: Metadata description.
:param float folder_id: Folder id which contains package.
:param float id: Metadata id.
@ -248,9 +248,8 @@ class SsisPackageResponse(dict):
:param Sequence['SsisParameterResponse'] parameters: Parameters in package
:param float project_id: Project id which contains package.
:param float project_version: Project version which contains package.
:param str type: The type of SSIS object metadata.
Expected value is 'Package'.
"""
pulumi.set(__self__, "type", 'Package')
if description is not None:
pulumi.set(__self__, "description", description)
if folder_id is not None:
@ -265,8 +264,15 @@ class SsisPackageResponse(dict):
pulumi.set(__self__, "project_id", project_id)
if project_version is not None:
pulumi.set(__self__, "project_version", project_version)
if type is not None:
pulumi.set(__self__, "type", 'Package')
@property
@pulumi.getter
def type(self) -> str:
"""
The type of SSIS object metadata.
Expected value is 'Package'.
"""
return pulumi.get(self, "type")
@property
@pulumi.getter
@ -324,15 +330,6 @@ class SsisPackageResponse(dict):
"""
return pulumi.get(self, "project_version")
@property
@pulumi.getter
def type(self) -> Optional[str]:
"""
The type of SSIS object metadata.
Expected value is 'Package'.
"""
return pulumi.get(self, "type")
@pulumi.output_type
class SsisParameterResponse(dict):
@ -495,26 +492,27 @@ class SsisProjectResponse(dict):
Ssis project.
"""
def __init__(__self__, *,
type: str,
description: Optional[str] = None,
environment_refs: Optional[Sequence['outputs.SsisEnvironmentReferenceResponse']] = None,
folder_id: Optional[float] = None,
id: Optional[float] = None,
name: Optional[str] = None,
parameters: Optional[Sequence['outputs.SsisParameterResponse']] = None,
type: Optional[str] = None,
version: Optional[float] = None):
"""
Ssis project.
:param str type: The type of SSIS object metadata.
Expected value is 'Project'.
:param str description: Metadata description.
:param Sequence['SsisEnvironmentReferenceResponse'] environment_refs: Environment reference in project
:param float folder_id: Folder id which contains project.
:param float id: Metadata id.
:param str name: Metadata name.
:param Sequence['SsisParameterResponse'] parameters: Parameters in project
:param str type: The type of SSIS object metadata.
Expected value is 'Project'.
:param float version: Project version.
"""
pulumi.set(__self__, "type", 'Project')
if description is not None:
pulumi.set(__self__, "description", description)
if environment_refs is not None:
@ -527,11 +525,18 @@ class SsisProjectResponse(dict):
pulumi.set(__self__, "name", name)
if parameters is not None:
pulumi.set(__self__, "parameters", parameters)
if type is not None:
pulumi.set(__self__, "type", 'Project')
if version is not None:
pulumi.set(__self__, "version", version)
@property
@pulumi.getter
def type(self) -> str:
"""
The type of SSIS object metadata.
Expected value is 'Project'.
"""
return pulumi.get(self, "type")
@property
@pulumi.getter
def description(self) -> Optional[str]:
@ -580,15 +585,6 @@ class SsisProjectResponse(dict):
"""
return pulumi.get(self, "parameters")
@property
@pulumi.getter
def type(self) -> Optional[str]:
"""
The type of SSIS object metadata.
Expected value is 'Project'.
"""
return pulumi.get(self, "type")
@property
@pulumi.getter
def version(self) -> Optional[float]:

View file

@ -356,7 +356,10 @@
"description": "Variable in environment"
}
},
"type": "object"
"type": "object",
"required": [
"type"
]
},
"mypkg::SsisFolderResponse": {
"description": "Ssis folder.",
@ -379,7 +382,10 @@
"const": "Folder"
}
},
"type": "object"
"type": "object",
"required": [
"type"
]
},
"mypkg::SsisPackageResponse": {
"description": "Ssis Package.",
@ -422,7 +428,10 @@
"const": "Package"
}
},
"type": "object"
"type": "object",
"required": [
"type"
]
},
"mypkg::SsisProjectResponse": {
"description": "Ssis project.",
@ -469,7 +478,10 @@
"description": "Project version."
}
},
"type": "object"
"type": "object",
"required": [
"type"
]
},
"mypkg::SsisEnvironmentReferenceResponse": {
"description": "Ssis environment reference.",

View file

@ -27,16 +27,14 @@ no_edit_this_page: true
<div class="highlight"><pre class="chroma"><code class="language-python" data-lang="python"><span class=nd>@overload</span>
<span class="k">def </span><span class="nx">ModuleResource</span><span class="p">(</span><span class="nx">resource_name</span><span class="p">:</span> <span class="nx">str</span><span class="p">,</span>
<span class="nx">opts</span><span class="p">:</span> <span class="nx"><a href="/docs/reference/pkg/python/pulumi/#pulumi.ResourceOptions">Optional[ResourceOptions]</a></span> = None<span class="p">,</span>
<span class="nx">default_bool</span><span class="p">:</span> <span class="nx">Optional[bool]</span> = None<span class="p">,</span>
<span class="nx">default_enum</span><span class="p">:</span> <span class="nx">Optional[EnumThing]</span> = None<span class="p">,</span>
<span class="nx">default_number</span><span class="p">:</span> <span class="nx">Optional[float]</span> = None<span class="p">,</span>
<span class="nx">default_string</span><span class="p">:</span> <span class="nx">Optional[str]</span> = None<span class="p">,</span>
<span class="nx">optional_bool</span><span class="p">:</span> <span class="nx">Optional[bool]</span> = None<span class="p">,</span>
<span class="nx">optional_enum</span><span class="p">:</span> <span class="nx">Optional[EnumThing]</span> = None<span class="p">,</span>
<span class="nx">optional_number</span><span class="p">:</span> <span class="nx">Optional[float]</span> = None<span class="p">,</span>
<span class="nx">optional_string</span><span class="p">:</span> <span class="nx">Optional[str]</span> = None<span class="p">,</span>
<span class="nx">plain_optional_bool</span><span class="p">:</span> <span class="nx">Optional[bool]</span> = None<span class="p">,</span>
<span class="nx">plain_optional_number</span><span class="p">:</span> <span class="nx">Optional[float]</span> = None<span class="p">,</span>
<span class="nx">plain_optional_string</span><span class="p">:</span> <span class="nx">Optional[str]</span> = None<span class="p">,</span>
<span class="nx">plain_required_bool</span><span class="p">:</span> <span class="nx">Optional[bool]</span> = None<span class="p">,</span>
<span class="nx">plain_required_enum</span><span class="p">:</span> <span class="nx">Optional[EnumThing]</span> = None<span class="p">,</span>
<span class="nx">plain_required_number</span><span class="p">:</span> <span class="nx">Optional[float]</span> = None<span class="p">,</span>
<span class="nx">plain_required_string</span><span class="p">:</span> <span class="nx">Optional[str]</span> = None<span class="p">,</span>
<span class="nx">required_bool</span><span class="p">:</span> <span class="nx">Optional[bool]</span> = None<span class="p">,</span>
@ -178,14 +176,6 @@ The ModuleResource resource accepts the following [input]({{< relref "/docs/intr
<span class="property-indicator"></span>
<span class="property-type">bool</span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-required"
title="Required">
<span id="plain_required_enum_csharp">
<a href="#plain_required_enum_csharp" style="color: inherit; text-decoration: inherit;">Plain_<wbr>required_<wbr>enum</a>
</span>
<span class="property-indicator"></span>
<span class="property-type"><a href="#enumthing">Pulumi.<wbr>Foo<wbr>Bar.<wbr>Enum<wbr>Thing</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-required"
title="Required">
<span id="plain_required_number_csharp">
@ -236,36 +226,12 @@ The ModuleResource resource accepts the following [input]({{< relref "/docs/intr
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="default_bool_csharp">
<a href="#default_bool_csharp" style="color: inherit; text-decoration: inherit;">Default_<wbr>bool</a>
<span id="optional_bool_csharp">
<a href="#optional_bool_csharp" style="color: inherit; text-decoration: inherit;">Optional_<wbr>bool</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">bool</span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="default_enum_csharp">
<a href="#default_enum_csharp" style="color: inherit; text-decoration: inherit;">Default_<wbr>enum</a>
</span>
<span class="property-indicator"></span>
<span class="property-type"><a href="#enumthing">Pulumi.<wbr>Foo<wbr>Bar.<wbr>Enum<wbr>Thing</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="default_number_csharp">
<a href="#default_number_csharp" style="color: inherit; text-decoration: inherit;">Default_<wbr>number</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">double</span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="default_string_csharp">
<a href="#default_string_csharp" style="color: inherit; text-decoration: inherit;">Default_<wbr>string</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">string</span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="optional_enum_csharp">
@ -274,6 +240,22 @@ The ModuleResource resource accepts the following [input]({{< relref "/docs/intr
<span class="property-indicator"></span>
<span class="property-type"><a href="#enumthing">Pulumi.<wbr>Foo<wbr>Bar.<wbr>Enum<wbr>Thing</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="optional_number_csharp">
<a href="#optional_number_csharp" style="color: inherit; text-decoration: inherit;">Optional_<wbr>number</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">double</span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="optional_string_csharp">
<a href="#optional_string_csharp" style="color: inherit; text-decoration: inherit;">Optional_<wbr>string</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">string</span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="plain_optional_bool_csharp">
@ -310,14 +292,6 @@ The ModuleResource resource accepts the following [input]({{< relref "/docs/intr
<span class="property-indicator"></span>
<span class="property-type">bool</span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-required"
title="Required">
<span id="plain_required_enum_go">
<a href="#plain_required_enum_go" style="color: inherit; text-decoration: inherit;">Plain_<wbr>required_<wbr>enum</a>
</span>
<span class="property-indicator"></span>
<span class="property-type"><a href="#enumthing">Enum<wbr>Thing</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-required"
title="Required">
<span id="plain_required_number_go">
@ -368,36 +342,12 @@ The ModuleResource resource accepts the following [input]({{< relref "/docs/intr
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="default_bool_go">
<a href="#default_bool_go" style="color: inherit; text-decoration: inherit;">Default_<wbr>bool</a>
<span id="optional_bool_go">
<a href="#optional_bool_go" style="color: inherit; text-decoration: inherit;">Optional_<wbr>bool</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">bool</span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="default_enum_go">
<a href="#default_enum_go" style="color: inherit; text-decoration: inherit;">Default_<wbr>enum</a>
</span>
<span class="property-indicator"></span>
<span class="property-type"><a href="#enumthing">Enum<wbr>Thing</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="default_number_go">
<a href="#default_number_go" style="color: inherit; text-decoration: inherit;">Default_<wbr>number</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">float64</span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="default_string_go">
<a href="#default_string_go" style="color: inherit; text-decoration: inherit;">Default_<wbr>string</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">string</span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="optional_enum_go">
@ -406,6 +356,22 @@ The ModuleResource resource accepts the following [input]({{< relref "/docs/intr
<span class="property-indicator"></span>
<span class="property-type"><a href="#enumthing">Enum<wbr>Thing</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="optional_number_go">
<a href="#optional_number_go" style="color: inherit; text-decoration: inherit;">Optional_<wbr>number</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">float64</span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="optional_string_go">
<a href="#optional_string_go" style="color: inherit; text-decoration: inherit;">Optional_<wbr>string</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">string</span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="plain_optional_bool_go">
@ -442,14 +408,6 @@ The ModuleResource resource accepts the following [input]({{< relref "/docs/intr
<span class="property-indicator"></span>
<span class="property-type">boolean</span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-required"
title="Required">
<span id="plain_required_enum_nodejs">
<a href="#plain_required_enum_nodejs" style="color: inherit; text-decoration: inherit;">plain_<wbr>required_<wbr>enum</a>
</span>
<span class="property-indicator"></span>
<span class="property-type"><a href="#enumthing">Enum<wbr>Thing</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-required"
title="Required">
<span id="plain_required_number_nodejs">
@ -500,36 +458,12 @@ The ModuleResource resource accepts the following [input]({{< relref "/docs/intr
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="default_bool_nodejs">
<a href="#default_bool_nodejs" style="color: inherit; text-decoration: inherit;">default_<wbr>bool</a>
<span id="optional_bool_nodejs">
<a href="#optional_bool_nodejs" style="color: inherit; text-decoration: inherit;">optional_<wbr>bool</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">boolean</span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="default_enum_nodejs">
<a href="#default_enum_nodejs" style="color: inherit; text-decoration: inherit;">default_<wbr>enum</a>
</span>
<span class="property-indicator"></span>
<span class="property-type"><a href="#enumthing">Enum<wbr>Thing</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="default_number_nodejs">
<a href="#default_number_nodejs" style="color: inherit; text-decoration: inherit;">default_<wbr>number</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">number</span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="default_string_nodejs">
<a href="#default_string_nodejs" style="color: inherit; text-decoration: inherit;">default_<wbr>string</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">string</span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="optional_enum_nodejs">
@ -538,6 +472,22 @@ The ModuleResource resource accepts the following [input]({{< relref "/docs/intr
<span class="property-indicator"></span>
<span class="property-type"><a href="#enumthing">Enum<wbr>Thing</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="optional_number_nodejs">
<a href="#optional_number_nodejs" style="color: inherit; text-decoration: inherit;">optional_<wbr>number</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">number</span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="optional_string_nodejs">
<a href="#optional_string_nodejs" style="color: inherit; text-decoration: inherit;">optional_<wbr>string</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">string</span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="plain_optional_bool_nodejs">
@ -574,14 +524,6 @@ The ModuleResource resource accepts the following [input]({{< relref "/docs/intr
<span class="property-indicator"></span>
<span class="property-type">bool</span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-required"
title="Required">
<span id="plain_required_enum_python">
<a href="#plain_required_enum_python" style="color: inherit; text-decoration: inherit;">plain_<wbr>required_<wbr>enum</a>
</span>
<span class="property-indicator"></span>
<span class="property-type"><a href="#enumthing">Enum<wbr>Thing</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-required"
title="Required">
<span id="plain_required_number_python">
@ -632,36 +574,12 @@ The ModuleResource resource accepts the following [input]({{< relref "/docs/intr
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="default_bool_python">
<a href="#default_bool_python" style="color: inherit; text-decoration: inherit;">default_<wbr>bool</a>
<span id="optional_bool_python">
<a href="#optional_bool_python" style="color: inherit; text-decoration: inherit;">optional_<wbr>bool</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">bool</span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="default_enum_python">
<a href="#default_enum_python" style="color: inherit; text-decoration: inherit;">default_<wbr>enum</a>
</span>
<span class="property-indicator"></span>
<span class="property-type"><a href="#enumthing">Enum<wbr>Thing</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="default_number_python">
<a href="#default_number_python" style="color: inherit; text-decoration: inherit;">default_<wbr>number</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">float</span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="default_string_python">
<a href="#default_string_python" style="color: inherit; text-decoration: inherit;">default_<wbr>string</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">str</span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="optional_enum_python">
@ -670,6 +588,22 @@ The ModuleResource resource accepts the following [input]({{< relref "/docs/intr
<span class="property-indicator"></span>
<span class="property-type"><a href="#enumthing">Enum<wbr>Thing</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="optional_number_python">
<a href="#optional_number_python" style="color: inherit; text-decoration: inherit;">optional_<wbr>number</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">float</span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="optional_string_python">
<a href="#optional_string_python" style="color: inherit; text-decoration: inherit;">optional_<wbr>string</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">str</span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="plain_optional_bool_python">

View file

@ -32,7 +32,9 @@ namespace Pulumi.FooBar
private static ModuleResourceArgs MakeArgs(ModuleResourceArgs args)
{
args ??= new ModuleResourceArgs();
args.String_const = "val";
args.Optional_const = "val";
args.Plain_optional_const = "val";
args.Plain_required_const = "val";
return args;
}
@ -63,24 +65,27 @@ namespace Pulumi.FooBar
public sealed class ModuleResourceArgs : Pulumi.ResourceArgs
{
[Input("default_bool")]
public Input<bool>? Default_bool { get; set; }
[Input("optional_bool")]
public Input<bool>? Optional_bool { get; set; }
[Input("default_enum")]
public Input<Pulumi.FooBar.EnumThing>? Default_enum { get; set; }
[Input("default_number")]
public Input<double>? Default_number { get; set; }
[Input("default_string")]
public Input<string>? Default_string { get; set; }
[Input("optional_const")]
public Input<string>? Optional_const { get; set; }
[Input("optional_enum")]
public Input<Pulumi.FooBar.EnumThing>? Optional_enum { get; set; }
[Input("optional_number")]
public Input<double>? Optional_number { get; set; }
[Input("optional_string")]
public Input<string>? Optional_string { get; set; }
[Input("plain_optional_bool")]
public bool? Plain_optional_bool { get; set; }
[Input("plain_optional_const")]
public string? Plain_optional_const { get; set; }
[Input("plain_optional_number")]
public double? Plain_optional_number { get; set; }
@ -90,8 +95,8 @@ namespace Pulumi.FooBar
[Input("plain_required_bool", required: true)]
public bool Plain_required_bool { get; set; }
[Input("plain_required_enum", required: true)]
public Pulumi.FooBar.EnumThing Plain_required_enum { get; set; }
[Input("plain_required_const", required: true)]
public string Plain_required_const { get; set; } = null!;
[Input("plain_required_number", required: true)]
public double Plain_required_number { get; set; }
@ -111,19 +116,25 @@ namespace Pulumi.FooBar
[Input("required_string", required: true)]
public Input<string> Required_string { get; set; } = null!;
[Input("string_const")]
public Input<string>? String_const { get; set; }
public ModuleResourceArgs()
{
Default_bool = true;
Default_enum = Pulumi.FooBar.EnumThing.Four;
Default_number = 42;
Default_string = "buzzer";
Optional_bool = true;
Optional_const = "another";
Optional_enum = Pulumi.FooBar.EnumThing.Eight;
Optional_number = 42;
Optional_string = "buzzer";
Plain_optional_bool = true;
Plain_optional_const = "another";
Plain_optional_number = 42;
Plain_optional_string = "buzzer";
Plain_required_bool = true;
Plain_required_const = "another";
Plain_required_number = 42;
Plain_required_string = "buzzer";
Required_bool = true;
Required_enum = Pulumi.FooBar.EnumThing.Four;
Required_number = 42;
Required_string = "buzzer";
}
}
}

View file

@ -22,46 +22,55 @@ func NewModuleResource(ctx *pulumi.Context,
return nil, errors.New("missing one or more required arguments")
}
if args.Required_bool == nil {
return nil, errors.New("invalid value for required argument 'Required_bool'")
if isZero(args.Optional_bool) {
args.Optional_bool = pulumi.BoolPtr(true)
}
if args.Required_enum == nil {
return nil, errors.New("invalid value for required argument 'Required_enum'")
}
if args.Required_number == nil {
return nil, errors.New("invalid value for required argument 'Required_number'")
}
if args.Required_string == nil {
return nil, errors.New("invalid value for required argument 'Required_string'")
}
if args.Default_bool == nil {
args.Default_bool = pulumi.BoolPtr(true)
}
if args.Default_enum == nil {
args.Default_enum = EnumThing(4)
}
if args.Default_number == nil {
args.Default_number = pulumi.Float64Ptr(42.0)
}
if args.Default_string == nil {
args.Default_string = pulumi.StringPtr("buzzer")
}
if args.Optional_enum == nil {
args.Optional_const = pulumi.StringPtr("val")
if isZero(args.Optional_enum) {
args.Optional_enum = EnumThing(8)
}
if args.Plain_optional_bool == nil {
if isZero(args.Optional_number) {
args.Optional_number = pulumi.Float64Ptr(42.0)
}
if isZero(args.Optional_string) {
args.Optional_string = pulumi.StringPtr("buzzer")
}
if isZero(args.Plain_optional_bool) {
plain_optional_bool_ := true
args.Plain_optional_bool = &plain_optional_bool_
}
if args.Plain_optional_number == nil {
plain_optional_const_ := "val"
args.Plain_optional_const = &plain_optional_const_
if isZero(args.Plain_optional_number) {
plain_optional_number_ := 42.0
args.Plain_optional_number = &plain_optional_number_
}
if args.Plain_optional_string == nil {
if isZero(args.Plain_optional_string) {
plain_optional_string_ := "buzzer"
args.Plain_optional_string = &plain_optional_string_
}
args.String_const = pulumi.StringPtr("val")
if isZero(args.Plain_required_bool) {
args.Plain_required_bool = true
}
args.Plain_required_const = "val"
if isZero(args.Plain_required_number) {
args.Plain_required_number = 42.0
}
if isZero(args.Plain_required_string) {
args.Plain_required_string = "buzzer"
}
if isZero(args.Required_bool) {
args.Required_bool = pulumi.Bool(true)
}
if isZero(args.Required_enum) {
args.Required_enum = EnumThing(4)
}
if isZero(args.Required_number) {
args.Required_number = pulumi.Float64(42.0)
}
if isZero(args.Required_string) {
args.Required_string = pulumi.String("buzzer")
}
var resource ModuleResource
err := ctx.RegisterResource("foobar::ModuleResource", name, args, &resource, opts...)
if err != nil {
@ -94,44 +103,44 @@ func (ModuleResourceState) ElementType() reflect.Type {
}
type moduleResourceArgs struct {
Default_bool *bool `pulumi:"default_bool"`
Default_enum *EnumThing `pulumi:"default_enum"`
Default_number *float64 `pulumi:"default_number"`
Default_string *string `pulumi:"default_string"`
Optional_bool *bool `pulumi:"optional_bool"`
Optional_const *string `pulumi:"optional_const"`
Optional_enum *EnumThing `pulumi:"optional_enum"`
Optional_number *float64 `pulumi:"optional_number"`
Optional_string *string `pulumi:"optional_string"`
Plain_optional_bool *bool `pulumi:"plain_optional_bool"`
Plain_optional_const *string `pulumi:"plain_optional_const"`
Plain_optional_number *float64 `pulumi:"plain_optional_number"`
Plain_optional_string *string `pulumi:"plain_optional_string"`
Plain_required_bool bool `pulumi:"plain_required_bool"`
Plain_required_enum EnumThing `pulumi:"plain_required_enum"`
Plain_required_const string `pulumi:"plain_required_const"`
Plain_required_number float64 `pulumi:"plain_required_number"`
Plain_required_string string `pulumi:"plain_required_string"`
Required_bool bool `pulumi:"required_bool"`
Required_enum EnumThing `pulumi:"required_enum"`
Required_number float64 `pulumi:"required_number"`
Required_string string `pulumi:"required_string"`
String_const *string `pulumi:"string_const"`
}
// The set of arguments for constructing a ModuleResource resource.
type ModuleResourceArgs struct {
Default_bool pulumi.BoolPtrInput
Default_enum EnumThingPtrInput
Default_number pulumi.Float64PtrInput
Default_string pulumi.StringPtrInput
Optional_bool pulumi.BoolPtrInput
Optional_const pulumi.StringPtrInput
Optional_enum EnumThingPtrInput
Optional_number pulumi.Float64PtrInput
Optional_string pulumi.StringPtrInput
Plain_optional_bool *bool
Plain_optional_const *string
Plain_optional_number *float64
Plain_optional_string *string
Plain_required_bool bool
Plain_required_enum EnumThing
Plain_required_const string
Plain_required_number float64
Plain_required_string string
Required_bool pulumi.BoolInput
Required_enum EnumThingInput
Required_number pulumi.Float64Input
Required_string pulumi.StringInput
String_const pulumi.StringPtrInput
}
func (ModuleResourceArgs) ElementType() reflect.Type {
@ -146,7 +155,7 @@ type ModuleResourceInput interface {
}
func (*ModuleResource) ElementType() reflect.Type {
return reflect.TypeOf((*ModuleResource)(nil))
return reflect.TypeOf((**ModuleResource)(nil)).Elem()
}
func (i *ModuleResource) ToModuleResourceOutput() ModuleResourceOutput {
@ -160,7 +169,7 @@ func (i *ModuleResource) ToModuleResourceOutputWithContext(ctx context.Context)
type ModuleResourceOutput struct{ *pulumi.OutputState }
func (ModuleResourceOutput) ElementType() reflect.Type {
return reflect.TypeOf((*ModuleResource)(nil))
return reflect.TypeOf((**ModuleResource)(nil)).Elem()
}
func (o ModuleResourceOutput) ToModuleResourceOutput() ModuleResourceOutput {

View file

@ -48,7 +48,7 @@ type ProviderInput interface {
}
func (*Provider) ElementType() reflect.Type {
return reflect.TypeOf((*Provider)(nil))
return reflect.TypeOf((**Provider)(nil)).Elem()
}
func (i *Provider) ToProviderOutput() ProviderOutput {
@ -62,7 +62,7 @@ func (i *Provider) ToProviderOutputWithContext(ctx context.Context) ProviderOutp
type ProviderOutput struct{ *pulumi.OutputState }
func (ProviderOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Provider)(nil))
return reflect.TypeOf((**Provider)(nil)).Elem()
}
func (o ProviderOutput) ToProviderOutput() ProviderOutput {

View file

@ -75,3 +75,11 @@ func PkgVersion() (semver.Version, error) {
}
return semver.Version{}, fmt.Errorf("failed to determine the package version from %s", pkgPath)
}
// isZero is a null safe check for if a value is it's types zero value.
func isZero(v interface{}) bool {
if v == nil {
return true
}
return reflect.ValueOf(v).IsZero()
}

View file

@ -47,8 +47,8 @@ export class ModuleResource extends pulumi.CustomResource {
if ((!args || args.plain_required_bool === undefined) && !opts.urn) {
throw new Error("Missing required property 'plain_required_bool'");
}
if ((!args || args.plain_required_enum === undefined) && !opts.urn) {
throw new Error("Missing required property 'plain_required_enum'");
if ((!args || args.plain_required_const === undefined) && !opts.urn) {
throw new Error("Missing required property 'plain_required_const'");
}
if ((!args || args.plain_required_number === undefined) && !opts.urn) {
throw new Error("Missing required property 'plain_required_number'");
@ -68,23 +68,23 @@ export class ModuleResource extends pulumi.CustomResource {
if ((!args || args.required_string === undefined) && !opts.urn) {
throw new Error("Missing required property 'required_string'");
}
resourceInputs["default_bool"] = (args ? args.default_bool : undefined) ?? true;
resourceInputs["default_enum"] = (args ? args.default_enum : undefined) ?? 4;
resourceInputs["default_number"] = (args ? args.default_number : undefined) ?? 42;
resourceInputs["default_string"] = (args ? args.default_string : undefined) ?? "buzzer";
resourceInputs["optional_bool"] = (args ? args.optional_bool : undefined) ?? true;
resourceInputs["optional_const"] = "val";
resourceInputs["optional_enum"] = (args ? args.optional_enum : undefined) ?? 8;
resourceInputs["optional_number"] = (args ? args.optional_number : undefined) ?? 42;
resourceInputs["optional_string"] = (args ? args.optional_string : undefined) ?? "buzzer";
resourceInputs["plain_optional_bool"] = (args ? args.plain_optional_bool : undefined) ?? true;
resourceInputs["plain_optional_const"] = "val";
resourceInputs["plain_optional_number"] = (args ? args.plain_optional_number : undefined) ?? 42;
resourceInputs["plain_optional_string"] = (args ? args.plain_optional_string : undefined) ?? "buzzer";
resourceInputs["plain_required_bool"] = args ? args.plain_required_bool : undefined;
resourceInputs["plain_required_enum"] = args ? args.plain_required_enum : undefined;
resourceInputs["plain_required_number"] = args ? args.plain_required_number : undefined;
resourceInputs["plain_required_string"] = args ? args.plain_required_string : undefined;
resourceInputs["required_bool"] = args ? args.required_bool : undefined;
resourceInputs["required_enum"] = args ? args.required_enum : undefined;
resourceInputs["required_number"] = args ? args.required_number : undefined;
resourceInputs["required_string"] = args ? args.required_string : undefined;
resourceInputs["string_const"] = "val";
resourceInputs["plain_required_bool"] = (args ? args.plain_required_bool : undefined) ?? true;
resourceInputs["plain_required_const"] = "val";
resourceInputs["plain_required_number"] = (args ? args.plain_required_number : undefined) ?? 42;
resourceInputs["plain_required_string"] = (args ? args.plain_required_string : undefined) ?? "buzzer";
resourceInputs["required_bool"] = (args ? args.required_bool : undefined) ?? true;
resourceInputs["required_enum"] = (args ? args.required_enum : undefined) ?? 4;
resourceInputs["required_number"] = (args ? args.required_number : undefined) ?? 42;
resourceInputs["required_string"] = (args ? args.required_string : undefined) ?? "buzzer";
} else {
}
if (!opts.version) {
@ -98,21 +98,21 @@ export class ModuleResource extends pulumi.CustomResource {
* The set of arguments for constructing a ModuleResource resource.
*/
export interface ModuleResourceArgs {
default_bool?: pulumi.Input<boolean>;
default_enum?: pulumi.Input<enums.EnumThing>;
default_number?: pulumi.Input<number>;
default_string?: pulumi.Input<string>;
optional_bool?: pulumi.Input<boolean>;
optional_const?: pulumi.Input<"val">;
optional_enum?: pulumi.Input<enums.EnumThing>;
optional_number?: pulumi.Input<number>;
optional_string?: pulumi.Input<string>;
plain_optional_bool?: boolean;
plain_optional_const?: "val";
plain_optional_number?: number;
plain_optional_string?: string;
plain_required_bool: boolean;
plain_required_enum: enums.EnumThing;
plain_required_const: "val";
plain_required_number: number;
plain_required_string: string;
required_bool: pulumi.Input<boolean>;
required_enum: pulumi.Input<enums.EnumThing>;
required_number: pulumi.Input<number>;
required_string: pulumi.Input<string>;
string_const?: pulumi.Input<"val">;
}

View file

@ -15,57 +15,77 @@ __all__ = ['ModuleResourceArgs', 'ModuleResource']
class ModuleResourceArgs:
def __init__(__self__, *,
plain_required_bool: bool,
plain_required_enum: 'EnumThing',
plain_required_const: str,
plain_required_number: float,
plain_required_string: str,
required_bool: pulumi.Input[bool],
required_enum: pulumi.Input['EnumThing'],
required_number: pulumi.Input[float],
required_string: pulumi.Input[str],
default_bool: Optional[pulumi.Input[bool]] = None,
default_enum: Optional[pulumi.Input['EnumThing']] = None,
default_number: Optional[pulumi.Input[float]] = None,
default_string: Optional[pulumi.Input[str]] = None,
optional_bool: Optional[pulumi.Input[bool]] = None,
optional_const: Optional[pulumi.Input[str]] = None,
optional_enum: Optional[pulumi.Input['EnumThing']] = None,
optional_number: Optional[pulumi.Input[float]] = None,
optional_string: Optional[pulumi.Input[str]] = None,
plain_optional_bool: Optional[bool] = None,
plain_optional_const: Optional[str] = None,
plain_optional_number: Optional[float] = None,
plain_optional_string: Optional[str] = None,
string_const: Optional[pulumi.Input[str]] = None):
plain_optional_string: Optional[str] = None):
"""
The set of arguments for constructing a ModuleResource resource.
"""
if plain_required_bool is None:
plain_required_bool = True
pulumi.set(__self__, "plain_required_bool", plain_required_bool)
pulumi.set(__self__, "plain_required_enum", plain_required_enum)
if plain_required_const is None:
plain_required_const = 'another'
pulumi.set(__self__, "plain_required_const", 'val')
if plain_required_number is None:
plain_required_number = 42
pulumi.set(__self__, "plain_required_number", plain_required_number)
if plain_required_string is None:
plain_required_string = 'buzzer'
pulumi.set(__self__, "plain_required_string", plain_required_string)
if required_bool is None:
required_bool = True
pulumi.set(__self__, "required_bool", required_bool)
if required_enum is None:
required_enum = 4
pulumi.set(__self__, "required_enum", required_enum)
if required_number is None:
required_number = 42
pulumi.set(__self__, "required_number", required_number)
if required_string is None:
required_string = 'buzzer'
pulumi.set(__self__, "required_string", required_string)
if default_bool is None:
default_bool = True
if default_bool is not None:
pulumi.set(__self__, "default_bool", default_bool)
if default_enum is None:
default_enum = 4
if default_enum is not None:
pulumi.set(__self__, "default_enum", default_enum)
if default_number is None:
default_number = 42
if default_number is not None:
pulumi.set(__self__, "default_number", default_number)
if default_string is None:
default_string = 'buzzer'
if default_string is not None:
pulumi.set(__self__, "default_string", default_string)
if optional_bool is None:
optional_bool = True
if optional_bool is not None:
pulumi.set(__self__, "optional_bool", optional_bool)
if optional_const is None:
optional_const = 'another'
if optional_const is not None:
pulumi.set(__self__, "optional_const", 'val')
if optional_enum is None:
optional_enum = 8
if optional_enum is not None:
pulumi.set(__self__, "optional_enum", optional_enum)
if optional_number is None:
optional_number = 42
if optional_number is not None:
pulumi.set(__self__, "optional_number", optional_number)
if optional_string is None:
optional_string = 'buzzer'
if optional_string is not None:
pulumi.set(__self__, "optional_string", optional_string)
if plain_optional_bool is None:
plain_optional_bool = True
if plain_optional_bool is not None:
pulumi.set(__self__, "plain_optional_bool", plain_optional_bool)
if plain_optional_const is None:
plain_optional_const = 'another'
if plain_optional_const is not None:
pulumi.set(__self__, "plain_optional_const", 'val')
if plain_optional_number is None:
plain_optional_number = 42
if plain_optional_number is not None:
@ -74,8 +94,6 @@ class ModuleResourceArgs:
plain_optional_string = 'buzzer'
if plain_optional_string is not None:
pulumi.set(__self__, "plain_optional_string", plain_optional_string)
if string_const is not None:
pulumi.set(__self__, "string_const", 'val')
@property
@pulumi.getter
@ -88,12 +106,12 @@ class ModuleResourceArgs:
@property
@pulumi.getter
def plain_required_enum(self) -> 'EnumThing':
return pulumi.get(self, "plain_required_enum")
def plain_required_const(self) -> str:
return pulumi.get(self, "plain_required_const")
@plain_required_enum.setter
def plain_required_enum(self, value: 'EnumThing'):
pulumi.set(self, "plain_required_enum", value)
@plain_required_const.setter
def plain_required_const(self, value: str):
pulumi.set(self, "plain_required_const", value)
@property
@pulumi.getter
@ -151,39 +169,21 @@ class ModuleResourceArgs:
@property
@pulumi.getter
def default_bool(self) -> Optional[pulumi.Input[bool]]:
return pulumi.get(self, "default_bool")
def optional_bool(self) -> Optional[pulumi.Input[bool]]:
return pulumi.get(self, "optional_bool")
@default_bool.setter
def default_bool(self, value: Optional[pulumi.Input[bool]]):
pulumi.set(self, "default_bool", value)
@optional_bool.setter
def optional_bool(self, value: Optional[pulumi.Input[bool]]):
pulumi.set(self, "optional_bool", value)
@property
@pulumi.getter
def default_enum(self) -> Optional[pulumi.Input['EnumThing']]:
return pulumi.get(self, "default_enum")
def optional_const(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "optional_const")
@default_enum.setter
def default_enum(self, value: Optional[pulumi.Input['EnumThing']]):
pulumi.set(self, "default_enum", value)
@property
@pulumi.getter
def default_number(self) -> Optional[pulumi.Input[float]]:
return pulumi.get(self, "default_number")
@default_number.setter
def default_number(self, value: Optional[pulumi.Input[float]]):
pulumi.set(self, "default_number", value)
@property
@pulumi.getter
def default_string(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "default_string")
@default_string.setter
def default_string(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "default_string", value)
@optional_const.setter
def optional_const(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "optional_const", value)
@property
@pulumi.getter
@ -194,6 +194,24 @@ class ModuleResourceArgs:
def optional_enum(self, value: Optional[pulumi.Input['EnumThing']]):
pulumi.set(self, "optional_enum", value)
@property
@pulumi.getter
def optional_number(self) -> Optional[pulumi.Input[float]]:
return pulumi.get(self, "optional_number")
@optional_number.setter
def optional_number(self, value: Optional[pulumi.Input[float]]):
pulumi.set(self, "optional_number", value)
@property
@pulumi.getter
def optional_string(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "optional_string")
@optional_string.setter
def optional_string(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "optional_string", value)
@property
@pulumi.getter
def plain_optional_bool(self) -> Optional[bool]:
@ -203,6 +221,15 @@ class ModuleResourceArgs:
def plain_optional_bool(self, value: Optional[bool]):
pulumi.set(self, "plain_optional_bool", value)
@property
@pulumi.getter
def plain_optional_const(self) -> Optional[str]:
return pulumi.get(self, "plain_optional_const")
@plain_optional_const.setter
def plain_optional_const(self, value: Optional[str]):
pulumi.set(self, "plain_optional_const", value)
@property
@pulumi.getter
def plain_optional_number(self) -> Optional[float]:
@ -221,38 +248,29 @@ class ModuleResourceArgs:
def plain_optional_string(self, value: Optional[str]):
pulumi.set(self, "plain_optional_string", value)
@property
@pulumi.getter
def string_const(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "string_const")
@string_const.setter
def string_const(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "string_const", value)
class ModuleResource(pulumi.CustomResource):
@overload
def __init__(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
default_bool: Optional[pulumi.Input[bool]] = None,
default_enum: Optional[pulumi.Input['EnumThing']] = None,
default_number: Optional[pulumi.Input[float]] = None,
default_string: Optional[pulumi.Input[str]] = None,
optional_bool: Optional[pulumi.Input[bool]] = None,
optional_const: Optional[pulumi.Input[str]] = None,
optional_enum: Optional[pulumi.Input['EnumThing']] = None,
optional_number: Optional[pulumi.Input[float]] = None,
optional_string: Optional[pulumi.Input[str]] = None,
plain_optional_bool: Optional[bool] = None,
plain_optional_const: Optional[str] = None,
plain_optional_number: Optional[float] = None,
plain_optional_string: Optional[str] = None,
plain_required_bool: Optional[bool] = None,
plain_required_enum: Optional['EnumThing'] = None,
plain_required_const: Optional[str] = None,
plain_required_number: Optional[float] = None,
plain_required_string: Optional[str] = None,
required_bool: Optional[pulumi.Input[bool]] = None,
required_enum: Optional[pulumi.Input['EnumThing']] = None,
required_number: Optional[pulumi.Input[float]] = None,
required_string: Optional[pulumi.Input[str]] = None,
string_const: Optional[pulumi.Input[str]] = None,
__props__=None):
"""
Create a ModuleResource resource with the given unique name, props, and options.
@ -282,23 +300,23 @@ class ModuleResource(pulumi.CustomResource):
def _internal_init(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
default_bool: Optional[pulumi.Input[bool]] = None,
default_enum: Optional[pulumi.Input['EnumThing']] = None,
default_number: Optional[pulumi.Input[float]] = None,
default_string: Optional[pulumi.Input[str]] = None,
optional_bool: Optional[pulumi.Input[bool]] = None,
optional_const: Optional[pulumi.Input[str]] = None,
optional_enum: Optional[pulumi.Input['EnumThing']] = None,
optional_number: Optional[pulumi.Input[float]] = None,
optional_string: Optional[pulumi.Input[str]] = None,
plain_optional_bool: Optional[bool] = None,
plain_optional_const: Optional[str] = None,
plain_optional_number: Optional[float] = None,
plain_optional_string: Optional[str] = None,
plain_required_bool: Optional[bool] = None,
plain_required_enum: Optional['EnumThing'] = None,
plain_required_const: Optional[str] = None,
plain_required_number: Optional[float] = None,
plain_required_string: Optional[str] = None,
required_bool: Optional[pulumi.Input[bool]] = None,
required_enum: Optional[pulumi.Input['EnumThing']] = None,
required_number: Optional[pulumi.Input[float]] = None,
required_string: Optional[pulumi.Input[str]] = None,
string_const: Optional[pulumi.Input[str]] = None,
__props__=None):
if opts is None:
opts = pulumi.ResourceOptions()
@ -311,55 +329,73 @@ class ModuleResource(pulumi.CustomResource):
raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
__props__ = ModuleResourceArgs.__new__(ModuleResourceArgs)
if default_bool is None:
default_bool = True
__props__.__dict__["default_bool"] = default_bool
if default_enum is None:
default_enum = 4
__props__.__dict__["default_enum"] = default_enum
if default_number is None:
default_number = 42
__props__.__dict__["default_number"] = default_number
if default_string is None:
default_string = 'buzzer'
__props__.__dict__["default_string"] = default_string
if optional_bool is None:
optional_bool = True
__props__.__dict__["optional_bool"] = optional_bool
if optional_const is None:
optional_const = 'another'
__props__.__dict__["optional_const"] = 'val'
if optional_enum is None:
optional_enum = 8
__props__.__dict__["optional_enum"] = optional_enum
if optional_number is None:
optional_number = 42
__props__.__dict__["optional_number"] = optional_number
if optional_string is None:
optional_string = 'buzzer'
__props__.__dict__["optional_string"] = optional_string
if plain_optional_bool is None:
plain_optional_bool = True
__props__.__dict__["plain_optional_bool"] = plain_optional_bool
if plain_optional_const is None:
plain_optional_const = 'another'
__props__.__dict__["plain_optional_const"] = 'val'
if plain_optional_number is None:
plain_optional_number = 42
__props__.__dict__["plain_optional_number"] = plain_optional_number
if plain_optional_string is None:
plain_optional_string = 'buzzer'
__props__.__dict__["plain_optional_string"] = plain_optional_string
if plain_required_bool is None:
plain_required_bool = True
if plain_required_bool is None and not opts.urn:
raise TypeError("Missing required property 'plain_required_bool'")
__props__.__dict__["plain_required_bool"] = plain_required_bool
if plain_required_enum is None and not opts.urn:
raise TypeError("Missing required property 'plain_required_enum'")
__props__.__dict__["plain_required_enum"] = plain_required_enum
if plain_required_const is None:
plain_required_const = 'another'
if plain_required_const is None and not opts.urn:
raise TypeError("Missing required property 'plain_required_const'")
__props__.__dict__["plain_required_const"] = 'val'
if plain_required_number is None:
plain_required_number = 42
if plain_required_number is None and not opts.urn:
raise TypeError("Missing required property 'plain_required_number'")
__props__.__dict__["plain_required_number"] = plain_required_number
if plain_required_string is None:
plain_required_string = 'buzzer'
if plain_required_string is None and not opts.urn:
raise TypeError("Missing required property 'plain_required_string'")
__props__.__dict__["plain_required_string"] = plain_required_string
if required_bool is None:
required_bool = True
if required_bool is None and not opts.urn:
raise TypeError("Missing required property 'required_bool'")
__props__.__dict__["required_bool"] = required_bool
if required_enum is None:
required_enum = 4
if required_enum is None and not opts.urn:
raise TypeError("Missing required property 'required_enum'")
__props__.__dict__["required_enum"] = required_enum
if required_number is None:
required_number = 42
if required_number is None and not opts.urn:
raise TypeError("Missing required property 'required_number'")
__props__.__dict__["required_number"] = required_number
if required_string is None:
required_string = 'buzzer'
if required_string is None and not opts.urn:
raise TypeError("Missing required property 'required_string'")
__props__.__dict__["required_string"] = required_string
__props__.__dict__["string_const"] = 'val'
super(ModuleResource, __self__).__init__(
'foobar::ModuleResource',
resource_name,

View file

@ -4,6 +4,12 @@
"resources": {
"foobar::ModuleResource": {
"inputProperties": {
"plain_optional_const": {
"type": "string",
"const": "val",
"default": "another",
"plain": true
},
"plain_optional_string": {
"type": "string",
"default": "buzzer",
@ -21,53 +27,59 @@
},
"plain_required_string": {
"type": "string",
"default": "buzzer",
"plain": true
},
"plain_required_bool": {
"type": "boolean",
"default": true,
"plain": true
},
"plain_required_number": {
"type": "number",
"default": 42,
"plain": true
},
"string_const": {
"optional_const": {
"type": "string",
"const": "val"
"const": "val",
"default": "another"
},
"optional_string": {
"type": "string",
"default": "buzzer"
},
"optional_bool": {
"type": "boolean",
"default": true
},
"optional_number": {
"type": "number",
"default": 42
},
"optional_enum": {
"$ref": "#/types/foobar::EnumThing",
"default": 8
},
"required_string": {
"type": "string"
},
"required_bool": {
"type": "boolean"
},
"required_number": {
"type": "number"
},
"plain_required_enum": {
"$ref": "#/types/foobar::EnumThing",
"plain_required_const": {
"type": "string",
"const": "val",
"default": "another",
"plain": true
},
"required_enum": {
"$ref": "#/types/foobar::EnumThing"
},
"default_string": {
"required_string": {
"type": "string",
"default": "buzzer"
},
"default_bool": {
"required_bool": {
"type": "boolean",
"default": true
},
"default_number": {
"required_number": {
"type": "number",
"default": 42
},
"default_enum": {
"required_enum": {
"$ref": "#/types/foobar::EnumThing",
"default": 4
}
@ -76,7 +88,7 @@
"plain_required_string",
"plain_required_bool",
"plain_required_number",
"plain_required_enum",
"plain_required_const",
"required_string",
"required_bool",
"required_number",

View file

@ -639,7 +639,15 @@ All [input](#inputs) properties are implicitly available as output properties. A
<span class="property-indicator"></span>
<span class="property-type"><a href="#helmreleasesettings">Helm<wbr>Release<wbr>Settings</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-required"
title="Required">
<span id="thinker_csharp">
<a href="#thinker_csharp" style="color: inherit; text-decoration: inherit;">Thinker</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">string</span>
</dt>
<dd>{{% md %}}To ask and answer{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="answer_csharp">
<a href="#answer_csharp" style="color: inherit; text-decoration: inherit;">Answer</a>
@ -671,15 +679,7 @@ All [input](#inputs) properties are implicitly available as output properties. A
<span class="property-indicator"></span>
<span class="property-type"><a href="#layeredtype">Layered<wbr>Type</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="thinker_csharp">
<a href="#thinker_csharp" style="color: inherit; text-decoration: inherit;">Thinker</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">string</span>
</dt>
<dd>{{% md %}}To ask and answer{{% /md %}}</dd></dl>
<dd>{{% md %}}{{% /md %}}</dd></dl>
{{% /choosable %}}
{{% choosable language go %}}
@ -691,7 +691,15 @@ All [input](#inputs) properties are implicitly available as output properties. A
<span class="property-indicator"></span>
<span class="property-type"><a href="#helmreleasesettings">Helm<wbr>Release<wbr>Settings</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-required"
title="Required">
<span id="thinker_go">
<a href="#thinker_go" style="color: inherit; text-decoration: inherit;">Thinker</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">string</span>
</dt>
<dd>{{% md %}}To ask and answer{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="answer_go">
<a href="#answer_go" style="color: inherit; text-decoration: inherit;">Answer</a>
@ -723,15 +731,7 @@ All [input](#inputs) properties are implicitly available as output properties. A
<span class="property-indicator"></span>
<span class="property-type"><a href="#layeredtype">Layered<wbr>Type</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="thinker_go">
<a href="#thinker_go" style="color: inherit; text-decoration: inherit;">Thinker</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">string</span>
</dt>
<dd>{{% md %}}To ask and answer{{% /md %}}</dd></dl>
<dd>{{% md %}}{{% /md %}}</dd></dl>
{{% /choosable %}}
{{% choosable language nodejs %}}
@ -743,7 +743,15 @@ All [input](#inputs) properties are implicitly available as output properties. A
<span class="property-indicator"></span>
<span class="property-type"><a href="#helmreleasesettings">Helm<wbr>Release<wbr>Settings</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-required"
title="Required">
<span id="thinker_nodejs">
<a href="#thinker_nodejs" style="color: inherit; text-decoration: inherit;">thinker</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">string</span>
</dt>
<dd>{{% md %}}To ask and answer{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="answer_nodejs">
<a href="#answer_nodejs" style="color: inherit; text-decoration: inherit;">answer</a>
@ -775,15 +783,7 @@ All [input](#inputs) properties are implicitly available as output properties. A
<span class="property-indicator"></span>
<span class="property-type"><a href="#layeredtype">Layered<wbr>Type</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="thinker_nodejs">
<a href="#thinker_nodejs" style="color: inherit; text-decoration: inherit;">thinker</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">string</span>
</dt>
<dd>{{% md %}}To ask and answer{{% /md %}}</dd></dl>
<dd>{{% md %}}{{% /md %}}</dd></dl>
{{% /choosable %}}
{{% choosable language python %}}
@ -795,7 +795,15 @@ All [input](#inputs) properties are implicitly available as output properties. A
<span class="property-indicator"></span>
<span class="property-type"><a href="#helmreleasesettings">Helm<wbr>Release<wbr>Settings</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-required"
title="Required">
<span id="thinker_python">
<a href="#thinker_python" style="color: inherit; text-decoration: inherit;">thinker</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">str</span>
</dt>
<dd>{{% md %}}To ask and answer{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="answer_python">
<a href="#answer_python" style="color: inherit; text-decoration: inherit;">answer</a>
@ -827,15 +835,7 @@ All [input](#inputs) properties are implicitly available as output properties. A
<span class="property-indicator"></span>
<span class="property-type"><a href="#layeredtype">Layered<wbr>Type</a></span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="thinker_python">
<a href="#thinker_python" style="color: inherit; text-decoration: inherit;">thinker</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">str</span>
</dt>
<dd>{{% md %}}To ask and answer{{% /md %}}</dd></dl>
<dd>{{% md %}}{{% /md %}}</dd></dl>
{{% /choosable %}}

View file

@ -42,8 +42,8 @@ namespace Pulumi.Example.Inputs
/// <summary>
/// To ask and answer
/// </summary>
[Input("thinker")]
public Input<string>? Thinker { get; set; }
[Input("thinker", required: true)]
public Input<string> Thinker { get; set; } = null!;
public LayeredTypeArgs()
{

View file

@ -0,0 +1,26 @@
// *** WARNING: this file was generated by test. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.Example.Mod1.Inputs
{
/// <summary>
/// A test for namespaces (mod 1)
/// </summary>
public sealed class TypArgs : Pulumi.ResourceArgs
{
[Input("val")]
public Input<string>? Val { get; set; }
public TypArgs()
{
Val = Utilities.GetEnv("PULUMI_EXAMPLE_MOD1_DEFAULT") ?? "mod1";
}
}
}

View file

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

Some files were not shown because too many files have changed in this diff Show more