Compare commits
27 commits
sdk/v3.18.
...
master
Author | SHA1 | Date | |
---|---|---|---|
4d4ff9f1d6 | |||
2d26cdd9ed | |||
b14bc09b1c | |||
09b7aa9186 | |||
c39343fa3d | |||
4b7985384c | |||
6cb801cf17 | |||
52d01bb915 | |||
c1c82b8317 | |||
e77d780370 | |||
72a4e1fc3f | |||
c6cefcd3f4 | |||
4029a1c89b | |||
d9dd88c740 | |||
574a6a104d | |||
87d8c7f074 | |||
7222e5570a | |||
dbc8ab9ad6 | |||
2c25c3fbd0 | |||
f98d39b84b | |||
e60d6bf248 | |||
e846b3201f | |||
1cedb29193 | |||
3e2f36548e | |||
013fcdec9d | |||
b0dfad44c5 | |||
50308812c4 |
7
.github/workflows/run-docs-generation.yml
vendored
7
.github/workflows/run-docs-generation.yml
vendored
|
@ -101,6 +101,13 @@ jobs:
|
|||
|
||||
./scripts/gen_resource_docs.sh aws true
|
||||
./scripts/gen_resource_docs.sh kubernetes true
|
||||
|
||||
# Undo the changes to the go.mod and go.sum files since we don't want the PR
|
||||
# to contain local overrides or the PR build in docs repo would fail.
|
||||
pushd tools/resourcedocsgen
|
||||
git checkout .
|
||||
popd
|
||||
|
||||
popd
|
||||
|
||||
echo "::set-output name=branchName::${BRANCH_NAME}"
|
||||
|
|
84
CHANGELOG.md
84
CHANGELOG.md
|
@ -1,6 +1,90 @@
|
|||
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
|
||||
- [ci] - Adds CI detector for Buildkite
|
||||
[#7933](https://github.com/pulumi/pulumi/pull/7933)
|
||||
|
||||
- [cli] - Add `--exclude-protected` flag to `pulumi destroy`.
|
||||
[#8359](https://github.com/pulumi/pulumi/pull/8359)
|
||||
|
||||
- [cli] Add the ability to use `pulumi org set [name]` to set a default org
|
||||
to use when creating a stacks in the Pulumi Service backend or self-hosted Service.
|
||||
[#8352](https://github.com/pulumi/pulumi/pull/8352)
|
||||
|
||||
- [schema] Add IsOverlay option to disable codegen for particular types.
|
||||
[#8338](https://github.com/pulumi/pulumi/pull/8338)
|
||||
[#8425](https://github.com/pulumi/pulumi/pull/8425)
|
||||
|
||||
- [sdk/dotnet] - Marshal output values.
|
||||
[#8316](https://github.com/pulumi/pulumi/pull/8316)
|
||||
|
||||
- [sdk/python] - Unmarshal output values in component provider.
|
||||
[#8212](https://github.com/pulumi/pulumi/pull/8212)
|
||||
|
||||
- [sdk/nodejs] - Unmarshal output values in component provider.
|
||||
[#8205](https://github.com/pulumi/pulumi/pull/8205)
|
||||
|
||||
- [sdk/nodejs] - Allow returning failures from Call in the provider without setting result outputs.
|
||||
[#8424](https://github.com/pulumi/pulumi/pull/8424)
|
||||
|
||||
- [sdk/go] - Allow specifying Call failures from the provider.
|
||||
[#8424](https://github.com/pulumi/pulumi/pull/8424)
|
||||
|
||||
- [codegen/nodejs] - Program generator now uses `fnOutput` forms where
|
||||
appropriate, simplifying auto-generated examples.
|
||||
[#8434](https://github.com/pulumi/pulumi/pull/8434)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- [engine] - Compute dependents correctly during targeted deletes.
|
||||
[#8360](https://github.com/pulumi/pulumi/pull/8360)
|
||||
|
||||
- [cli/engine] - Update command respects `--target-dependents`.
|
||||
[#8395](https://github.com/pulumi/pulumi/pull/8395)
|
||||
|
||||
- [docs] - Fix broken lists in dotnet docs.
|
||||
[docs#6558](https://github.com/pulumi/docs/issues/6558)
|
||||
|
||||
## 3.17.1 (2021-11-09)
|
||||
|
||||
### Improvements
|
||||
|
|
|
@ -1,44 +1,12 @@
|
|||
### Improvements
|
||||
- Adds CI detector for Buildkite
|
||||
[#7933](https://github.com/pulumi/pulumi/pull/7933)
|
||||
|
||||
- [cli] - Add `--exclude-protected` flag to `pulumi destroy`.
|
||||
[#8359](https://github.com/pulumi/pulumi/pull/8359)
|
||||
|
||||
- [cli] Adding the ability to use `pulumi org set [name]` to set a default org
|
||||
to use when creating a stacks in the Pulumi Service backend or self-hosted Service
|
||||
[#8352](https://github.com/pulumi/pulumi/pull/8352)
|
||||
|
||||
- [schema] Add IsOverlay option to disable codegen for particular types
|
||||
[#8338](https://github.com/pulumi/pulumi/pull/8338)
|
||||
[#8425](https://github.com/pulumi/pulumi/pull/8425)
|
||||
|
||||
- [sdk/dotnet] - Marshal output values.
|
||||
[#8316](https://github.com/pulumi/pulumi/pull/8316)
|
||||
|
||||
- [sdk/python] - Unmarshal output values in component provider.
|
||||
[#8212](https://github.com/pulumi/pulumi/pull/8212)
|
||||
|
||||
- [sdk/nodejs] - Unmarshal output values in component provider.
|
||||
[#8205](https://github.com/pulumi/pulumi/pull/8205)
|
||||
|
||||
- [sdk/nodejs] - Allow returning failures from Call in the provider without setting result outputs.
|
||||
[#8424](https://github.com/pulumi/pulumi/pull/8424)
|
||||
|
||||
- [sdk/go] - Allow specifying Call failures from the provider.
|
||||
[#8424](https://github.com/pulumi/pulumi/pull/8424)
|
||||
|
||||
- [codegen/nodejs] - Program generator now uses `fnOutput` forms where
|
||||
appropriate, simplifying auto-generated examples.
|
||||
[#8434](https://github.com/pulumi/pulumi/pull/8434)
|
||||
- [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
|
||||
|
||||
- [engine] - Compute dependents correctly during targeted deletes.
|
||||
[#8360](https://github.com/pulumi/pulumi/pull/8360)
|
||||
|
||||
- [cli/engine] - Update command respects `--target-dependents`
|
||||
[#8395](https://github.com/pulumi/pulumi/pull/8395)
|
||||
|
||||
- [docs] - Fix broken lists in dotnet docs
|
||||
[docs#6558](https://github.com/pulumi/docs/issues/6558)
|
||||
- [codegen/go] - Respect default values in Pulumi object types.
|
||||
[#8411](https://github.com/pulumi/pulumi/pull/8400)
|
||||
|
|
|
@ -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`.
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -323,7 +323,7 @@ func (b *localBackend) GetStack(ctx context.Context, stackRef backend.StackRefer
|
|||
snapshot, path, err := b.getStack(stackName)
|
||||
|
||||
switch {
|
||||
case gcerrors.Code(drillError(err)) == gcerrors.NotFound:
|
||||
case gcerrors.Code(err) == gcerrors.NotFound:
|
||||
return nil, nil
|
||||
case err != nil:
|
||||
return nil, err
|
||||
|
@ -882,12 +882,3 @@ func (b *localBackend) UpdateStackTags(ctx context.Context,
|
|||
// The local backend does not currently persist tags.
|
||||
return errors.New("stack tags not supported in --local mode")
|
||||
}
|
||||
|
||||
// Returns the original error in the chain. If `err` is nil, nil is returned.
|
||||
func drillError(err error) error {
|
||||
e := err
|
||||
for errors.Unwrap(e) != nil {
|
||||
e = errors.Unwrap(e)
|
||||
}
|
||||
return e
|
||||
}
|
||||
|
|
|
@ -187,3 +187,20 @@ func TestListStacksWithMultiplePassphrases(t *testing.T) {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
func TestDrillError(t *testing.T) {
|
||||
// Login to a temp dir filestate backend
|
||||
tmpDir, err := ioutil.TempDir("", "filestatebackend")
|
||||
assert.NoError(t, err)
|
||||
b, err := New(cmdutil.Diag(), "file://"+filepath.ToSlash(tmpDir))
|
||||
assert.NoError(t, err)
|
||||
ctx := context.Background()
|
||||
|
||||
// Get a non-existent stack and expect a nil error because it won't be found.
|
||||
stackRef, err := b.ParseStackReference("dev")
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error %v when parsing stack reference", err)
|
||||
}
|
||||
_, err = b.GetStack(ctx, stackRef)
|
||||
assert.Nil(t, err)
|
||||
}
|
||||
|
|
|
@ -323,7 +323,7 @@ func (b *localBackend) getHistory(name tokens.QName, pageSize int, page int) ([]
|
|||
allFiles, err := listBucket(b.bucket, dir)
|
||||
if err != nil {
|
||||
// History doesn't exist until a stack has been updated.
|
||||
if gcerrors.Code(drillError(err)) == gcerrors.NotFound {
|
||||
if gcerrors.Code(err) == gcerrors.NotFound {
|
||||
return nil, nil
|
||||
}
|
||||
return nil, err
|
||||
|
@ -391,7 +391,7 @@ func (b *localBackend) renameHistory(oldName tokens.QName, newName tokens.QName)
|
|||
allFiles, err := listBucket(b.bucket, oldHistory)
|
||||
if err != nil {
|
||||
// if there's nothing there, we don't really need to do a rename.
|
||||
if gcerrors.Code(drillError(err)) == gcerrors.NotFound {
|
||||
if gcerrors.Code(err) == gcerrors.NotFound {
|
||||
return nil
|
||||
}
|
||||
return err
|
||||
|
|
|
@ -902,8 +902,14 @@ func (mod *modContext) genNestedTypes(member interface{}, resourceType bool) []d
|
|||
// and if it appears in an input object and/or output object.
|
||||
mod.getTypes(member, tokens)
|
||||
|
||||
var typs []docNestedType
|
||||
var sortedTokens []string
|
||||
for token := range tokens {
|
||||
sortedTokens = append(sortedTokens, token)
|
||||
}
|
||||
sort.Strings(sortedTokens)
|
||||
|
||||
var typs []docNestedType
|
||||
for _, token := range sortedTokens {
|
||||
for _, t := range mod.pkg.Types {
|
||||
switch typ := t.(type) {
|
||||
case *schema.ObjectType:
|
||||
|
@ -1957,8 +1963,14 @@ func (dctx *docGenContext) generatePackage(tool string, pkg *schema.Package) (ma
|
|||
|
||||
glog.V(3).Infoln("generating package docs now...")
|
||||
files := fs{}
|
||||
for _, mod := range dctx.modules() {
|
||||
if err := mod.gen(files); err != nil {
|
||||
modules := []string{}
|
||||
modMap := dctx.modules()
|
||||
for k := range modMap {
|
||||
modules = append(modules, k)
|
||||
}
|
||||
sort.Strings(modules)
|
||||
for _, mod := range modules {
|
||||
if err := modMap[mod].gen(files); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016-2020, Pulumi Corporation.
|
||||
// Copyright 2016-2021, Pulumi Corporation.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
|
@ -46,6 +46,9 @@ type generator struct {
|
|||
asyncInit bool
|
||||
configCreated bool
|
||||
diagnostics hcl.Diagnostics
|
||||
// Helper map to emit custom type name suffixes that match
|
||||
// those emitted by codegen.
|
||||
usedInFunctionOutputVersionInputs map[schema.Type]bool
|
||||
}
|
||||
|
||||
const pulumiPackage = "pulumi"
|
||||
|
@ -343,14 +346,32 @@ func (g *generator) functionName(tokenArg model.Expression) (string, string) {
|
|||
return rootNamespace, fmt.Sprintf("%s%s.%s", rootNamespace, namespace, Title(member))
|
||||
}
|
||||
|
||||
func (g *generator) toSchemaType(destType model.Type) (schema.Type, bool) {
|
||||
schemaType, ok := pcl.GetSchemaForType(destType.(model.Type))
|
||||
if !ok {
|
||||
return nil, false
|
||||
}
|
||||
return codegen.UnwrapType(schemaType), true
|
||||
}
|
||||
|
||||
// argumentTypeName computes the C# argument class name for the given expression and model type.
|
||||
func (g *generator) argumentTypeName(expr model.Expression, destType model.Type) string {
|
||||
schemaType, ok := pcl.GetSchemaForType(destType.(model.Type))
|
||||
schemaType, ok := g.toSchemaType(destType)
|
||||
if !ok {
|
||||
return ""
|
||||
}
|
||||
suffix := "Args"
|
||||
if g.usedInFunctionOutputVersionInputs[schemaType] {
|
||||
suffix = "InputArgs"
|
||||
}
|
||||
return g.argumentTypeNameWithSuffix(expr, destType, suffix)
|
||||
}
|
||||
|
||||
schemaType = codegen.UnwrapType(schemaType)
|
||||
func (g *generator) argumentTypeNameWithSuffix(expr model.Expression, destType model.Type, suffix string) string {
|
||||
schemaType, ok := g.toSchemaType(destType)
|
||||
if !ok {
|
||||
return ""
|
||||
}
|
||||
|
||||
objType, ok := schemaType.(*schema.ObjectType)
|
||||
if !ok {
|
||||
|
@ -382,7 +403,7 @@ func (g *generator) argumentTypeName(expr model.Expression, destType model.Type)
|
|||
} else if qualifier != "" {
|
||||
namespace = namespace + "." + qualifier
|
||||
}
|
||||
member = member + "Args"
|
||||
member = member + suffix
|
||||
|
||||
return fmt.Sprintf("%s%s.%s", rootNamespace, namespace, Title(member))
|
||||
}
|
||||
|
|
|
@ -255,6 +255,28 @@ func (g *generator) genFunctionUsings(x *model.FunctionCallExpression) []string
|
|||
return []string{fmt.Sprintf("%s = Pulumi.%[1]s", pkg)}
|
||||
}
|
||||
|
||||
func (g *generator) markTypeAsUsedInFunctionOutputVersionInputs(t model.Type) {
|
||||
if g.usedInFunctionOutputVersionInputs == nil {
|
||||
g.usedInFunctionOutputVersionInputs = make(map[schema.Type]bool)
|
||||
}
|
||||
schemaType, ok := g.toSchemaType(t)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
g.usedInFunctionOutputVersionInputs[schemaType] = true
|
||||
}
|
||||
|
||||
func (g *generator) visitToMarkTypesUsedInFunctionOutputVersionInputs(expr model.Expression) {
|
||||
visitor := func(expr model.Expression) (model.Expression, hcl.Diagnostics) {
|
||||
isCons, _, t := pcl.RecognizeTypedObjectCons(expr)
|
||||
if isCons {
|
||||
g.markTypeAsUsedInFunctionOutputVersionInputs(t)
|
||||
}
|
||||
return expr, nil
|
||||
}
|
||||
model.VisitExpression(expr, nil, visitor) // nolint:errcheck
|
||||
}
|
||||
|
||||
func (g *generator) GenFunctionCallExpression(w io.Writer, expr *model.FunctionCallExpression) {
|
||||
switch expr.Name {
|
||||
case pcl.IntrinsicConvert:
|
||||
|
@ -294,10 +316,19 @@ func (g *generator) GenFunctionCallExpression(w io.Writer, expr *model.FunctionC
|
|||
case pcl.Invoke:
|
||||
_, name := g.functionName(expr.Args[0])
|
||||
|
||||
g.Fprintf(w, "%s.InvokeAsync(", name)
|
||||
if len(expr.Args) >= 2 {
|
||||
g.Fgenf(w, "%.v", expr.Args[1])
|
||||
isOut, outArgs, outArgsTy := pcl.RecognizeOutputVersionedInvoke(expr)
|
||||
if isOut {
|
||||
g.visitToMarkTypesUsedInFunctionOutputVersionInputs(outArgs)
|
||||
g.Fprintf(w, "%s.Invoke(", name)
|
||||
typeName := g.argumentTypeNameWithSuffix(expr, outArgsTy, "InvokeArgs")
|
||||
g.genObjectConsExpressionWithTypeName(w, outArgs, typeName)
|
||||
} else {
|
||||
g.Fprintf(w, "%s.InvokeAsync(", name)
|
||||
if len(expr.Args) >= 2 {
|
||||
g.Fgenf(w, "%.v", expr.Args[1])
|
||||
}
|
||||
}
|
||||
|
||||
if len(expr.Args) == 3 {
|
||||
g.Fgenf(w, ", %.v", expr.Args[2])
|
||||
}
|
||||
|
@ -446,7 +477,18 @@ func (g *generator) genObjectConsExpression(w io.Writer, expr *model.ObjectConsE
|
|||
return
|
||||
}
|
||||
|
||||
typeName := g.argumentTypeName(expr, destType)
|
||||
destTypeName := g.argumentTypeName(expr, destType)
|
||||
g.genObjectConsExpressionWithTypeName(w, expr, destTypeName)
|
||||
}
|
||||
|
||||
func (g *generator) genObjectConsExpressionWithTypeName(
|
||||
w io.Writer, expr *model.ObjectConsExpression, destTypeName string) {
|
||||
|
||||
if len(expr.Items) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
typeName := destTypeName
|
||||
if typeName != "" {
|
||||
g.Fgenf(w, "new %s", typeName)
|
||||
g.Fgenf(w, "\n%s{\n", g.Indent)
|
||||
|
|
|
@ -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 {
|
||||
|
@ -571,6 +563,10 @@ func (pkg *pkgContext) resolveObjectType(t *schema.ObjectType) string {
|
|||
}
|
||||
return name
|
||||
}
|
||||
return pkg.contextForExternalReferenceType(t).typeString(t)
|
||||
}
|
||||
|
||||
func (pkg *pkgContext) contextForExternalReferenceType(t *schema.ObjectType) *pkgContext {
|
||||
extPkg := t.Package
|
||||
var goInfo GoPackageInfo
|
||||
|
||||
|
@ -584,7 +580,7 @@ func (pkg *pkgContext) resolveObjectType(t *schema.ObjectType) string {
|
|||
pkgImportAliases: goInfo.PackageImportAliases,
|
||||
modToPkg: goInfo.ModuleToPackage,
|
||||
}
|
||||
return extPkgCtx.typeString(t)
|
||||
return extPkgCtx
|
||||
}
|
||||
|
||||
func (pkg *pkgContext) outputType(t schema.Type) string {
|
||||
|
@ -629,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:
|
||||
|
@ -780,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,
|
||||
})
|
||||
}
|
||||
|
@ -798,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 {
|
||||
|
@ -833,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))
|
||||
|
@ -865,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)
|
||||
|
@ -875,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)
|
||||
|
@ -885,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)
|
||||
|
@ -952,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.
|
||||
|
@ -961,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)
|
||||
|
@ -1001,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)
|
||||
|
@ -1103,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) {
|
||||
|
||||
|
@ -1115,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())
|
||||
|
||||
|
@ -1125,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 {
|
||||
|
@ -1139,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.
|
||||
|
@ -1148,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.
|
||||
|
@ -1157,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)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1196,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 {
|
||||
|
@ -1215,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)
|
||||
|
@ -1248,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)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1306,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 {
|
||||
|
@ -1389,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))
|
||||
|
@ -1397,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 {
|
||||
|
@ -1425,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()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1704,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)
|
||||
|
@ -1747,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
|
||||
|
||||
|
@ -1764,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{}
|
||||
|
@ -1775,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)
|
||||
|
||||
|
@ -1801,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"
|
||||
}
|
||||
|
@ -1824,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 {
|
||||
|
@ -2015,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 {
|
||||
|
@ -2096,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)
|
||||
}
|
||||
|
@ -2232,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
|
||||
|
@ -2258,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")
|
||||
}
|
||||
|
@ -2666,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
|
||||
}
|
||||
|
@ -2989,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:]
|
||||
|
@ -3003,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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3200,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)
|
||||
}
|
||||
|
||||
|
@ -3240,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)
|
||||
}
|
||||
|
||||
|
@ -3376,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()
|
||||
}
|
||||
`
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -244,9 +244,7 @@ func (g *generator) collectImports(
|
|||
}
|
||||
pulumiImports.Add(g.getPulumiImport(pkg, vPath, mod))
|
||||
} else if call.Name == pcl.IntrinsicConvert {
|
||||
if schemaType, ok := pcl.GetSchemaForType(call.Type()); ok {
|
||||
g.collectTypeImports(program, schemaType, pulumiImports)
|
||||
}
|
||||
g.collectConvertImports(program, call, pulumiImports)
|
||||
}
|
||||
|
||||
// Checking to see if this function call deserves its own dedicated helper method in the preamble
|
||||
|
@ -277,6 +275,30 @@ func (g *generator) collectImports(
|
|||
return stdImports, pulumiImports, preambleHelperMethods
|
||||
}
|
||||
|
||||
func (g *generator) collectConvertImports(
|
||||
program *pcl.Program,
|
||||
call *model.FunctionCallExpression,
|
||||
pulumiImports codegen.StringSet) {
|
||||
if schemaType, ok := pcl.GetSchemaForType(call.Type()); ok {
|
||||
// Sometimes code for a `__convert` call does not
|
||||
// really use the import of the result type. In such
|
||||
// cases it is important not to generate a
|
||||
// non-compiling unused import. Detect some of these
|
||||
// cases here.
|
||||
//
|
||||
// Fully solving this is deferred for later:
|
||||
// TODO[pulumi/pulumi#8324].
|
||||
if expr, ok := call.Args[0].(*model.TemplateExpression); ok {
|
||||
if lit, ok := expr.Parts[0].(*model.LiteralValueExpression); ok &&
|
||||
model.StringType.AssignableFrom(lit.Type()) &&
|
||||
call.Type().AssignableFrom(lit.Type()) {
|
||||
return
|
||||
}
|
||||
}
|
||||
g.collectTypeImports(program, schemaType, pulumiImports)
|
||||
}
|
||||
}
|
||||
|
||||
func (g *generator) getVersionPath(program *pcl.Program, pkg string) (string, error) {
|
||||
for _, p := range program.Packages() {
|
||||
if p.Name == pkg {
|
||||
|
@ -614,11 +636,17 @@ func (g *generator) genLocalVariable(w io.Writer, v *pcl.LocalVariable) {
|
|||
case *model.FunctionCallExpression:
|
||||
switch expr.Name {
|
||||
case pcl.Invoke:
|
||||
g.Fgenf(w, "%s, err %s %.3v;\n", name, assignment, expr)
|
||||
g.isErrAssigned = true
|
||||
g.Fgenf(w, "if err != nil {\n")
|
||||
g.Fgenf(w, "return err\n")
|
||||
g.Fgenf(w, "}\n")
|
||||
// OutputVersionedInvoke does not return an error
|
||||
noError, _, _ := pcl.RecognizeOutputVersionedInvoke(expr)
|
||||
if noError {
|
||||
g.Fgenf(w, "%s %s %.3v;\n", name, assignment, expr)
|
||||
} else {
|
||||
g.Fgenf(w, "%s, err %s %.3v;\n", name, assignment, expr)
|
||||
g.isErrAssigned = true
|
||||
g.Fgenf(w, "if err != nil {\n")
|
||||
g.Fgenf(w, "return err\n")
|
||||
g.Fgenf(w, "}\n")
|
||||
}
|
||||
case "join", "toBase64", "mimeType", "fileAsset":
|
||||
g.Fgenf(w, "%s := %.3v;\n", name, expr)
|
||||
}
|
||||
|
|
|
@ -195,7 +195,18 @@ func (g *generator) GenFunctionCallExpression(w io.Writer, expr *model.FunctionC
|
|||
if module == "" {
|
||||
module = pkg
|
||||
}
|
||||
name := fmt.Sprintf("%s.%s", module, fn)
|
||||
isOut, outArgs, outArgsType := pcl.RecognizeOutputVersionedInvoke(expr)
|
||||
if isOut {
|
||||
outTypeName, err := outputVersionFunctionArgTypeName(outArgsType)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("Error when generating an output-versioned Invoke: %w", err))
|
||||
}
|
||||
g.Fgenf(w, "%s.%sOutput(ctx, ", module, fn)
|
||||
g.genObjectConsExpressionWithTypeName(w, outArgs, outArgsType, outTypeName)
|
||||
} else {
|
||||
g.Fgenf(w, "%s.%s(ctx, ", module, fn)
|
||||
g.Fgenf(w, "%.v", expr.Args[1])
|
||||
}
|
||||
|
||||
optionsBag := ""
|
||||
var buf bytes.Buffer
|
||||
|
@ -205,9 +216,6 @@ func (g *generator) GenFunctionCallExpression(w io.Writer, expr *model.FunctionC
|
|||
g.Fgenf(&buf, ", nil")
|
||||
}
|
||||
optionsBag = buf.String()
|
||||
|
||||
g.Fgenf(w, "%s(ctx, ", name)
|
||||
g.Fgenf(w, "%.v", expr.Args[1])
|
||||
g.Fgenf(w, "%v)", optionsBag)
|
||||
case "join":
|
||||
g.Fgenf(w, "strings.Join(%v, %v)", expr.Args[1], expr.Args[0])
|
||||
|
@ -246,6 +254,32 @@ func (g *generator) GenFunctionCallExpression(w io.Writer, expr *model.FunctionC
|
|||
}
|
||||
}
|
||||
|
||||
// Currently args type for output-versioned invokes are named
|
||||
// `FOutputArgs`, but this is not yet understood by `tokenToType`. Use
|
||||
// this function to compensate.
|
||||
func outputVersionFunctionArgTypeName(t model.Type) (string, error) {
|
||||
schemaType, ok := pcl.GetSchemaForType(t)
|
||||
if !ok {
|
||||
return "", fmt.Errorf("No schema.Type type found for the given model.Type")
|
||||
}
|
||||
|
||||
objType, ok := schemaType.(*schema.ObjectType)
|
||||
if !ok {
|
||||
return "", fmt.Errorf("Expected a schema.ObjectType, got %s", schemaType.String())
|
||||
}
|
||||
|
||||
pkg := &pkgContext{pkg: &schema.Package{Name: "main"}}
|
||||
|
||||
var ty string
|
||||
if pkg.isExternalReference(objType) {
|
||||
ty = pkg.contextForExternalReferenceType(objType).tokenToType(objType.Token)
|
||||
} else {
|
||||
ty = pkg.tokenToType(objType.Token)
|
||||
}
|
||||
|
||||
return fmt.Sprintf("%sOutputArgs", strings.TrimSuffix(ty, "Args")), nil
|
||||
}
|
||||
|
||||
func (g *generator) GenIndexExpression(w io.Writer, expr *model.IndexExpression) {
|
||||
g.Fgenf(w, "%.20v[%.v]", expr.Collection, expr.Key)
|
||||
}
|
||||
|
@ -316,15 +350,10 @@ func (g *generator) genObjectConsExpression(
|
|||
w io.Writer,
|
||||
expr *model.ObjectConsExpression,
|
||||
destType model.Type,
|
||||
isInput bool,
|
||||
) {
|
||||
if len(expr.Items) == 0 {
|
||||
g.Fgenf(w, "nil")
|
||||
return
|
||||
}
|
||||
isInput bool) {
|
||||
|
||||
var temps []interface{}
|
||||
isInput = isInput || isInputty(destType)
|
||||
|
||||
typeName := g.argumentTypeName(expr, destType, isInput)
|
||||
if schemaType, ok := pcl.GetSchemaForType(destType); ok {
|
||||
if obj, ok := codegen.UnwrapType(schemaType).(*schema.ObjectType); ok {
|
||||
|
@ -334,6 +363,21 @@ func (g *generator) genObjectConsExpression(
|
|||
}
|
||||
}
|
||||
|
||||
g.genObjectConsExpressionWithTypeName(w, expr, destType, typeName)
|
||||
}
|
||||
|
||||
func (g *generator) genObjectConsExpressionWithTypeName(
|
||||
w io.Writer,
|
||||
expr *model.ObjectConsExpression,
|
||||
destType model.Type,
|
||||
typeName string) {
|
||||
|
||||
if len(expr.Items) == 0 {
|
||||
g.Fgenf(w, "nil")
|
||||
return
|
||||
}
|
||||
|
||||
var temps []interface{}
|
||||
// TODO: @pgavlin --- ineffectual assignment, was there some work in flight here?
|
||||
// if strings.HasSuffix(typeName, "Args") {
|
||||
// isInput = true
|
||||
|
@ -360,7 +404,7 @@ func (g *generator) genObjectConsExpression(
|
|||
}
|
||||
g.genTemps(w, temps)
|
||||
|
||||
if isMap || !strings.HasSuffix(typeName, "Args") {
|
||||
if isMap || !strings.HasSuffix(typeName, "Args") || strings.HasSuffix(typeName, "OutputArgs") {
|
||||
g.Fgenf(w, "%s", typeName)
|
||||
} else {
|
||||
g.Fgenf(w, "&%s", typeName)
|
||||
|
@ -814,9 +858,15 @@ func (g *generator) genApply(w io.Writer, expr *model.FunctionCallExpression) {
|
|||
isInput := false
|
||||
retType := g.argumentTypeName(nil, then.Signature.ReturnType, isInput)
|
||||
// TODO account for outputs in other namespaces like aws
|
||||
typeAssertion := fmt.Sprintf(".(%sOutput)", retType)
|
||||
if !strings.HasPrefix(retType, "pulumi.") {
|
||||
typeAssertion = fmt.Sprintf(".(pulumi.%sOutput)", Title(retType))
|
||||
// TODO[pulumi/pulumi#8453] incomplete pattern code below.
|
||||
var typeAssertion string
|
||||
if retType == "[]string" {
|
||||
typeAssertion = ".(pulumi.StringArrayOutput)"
|
||||
} else {
|
||||
typeAssertion = fmt.Sprintf(".(%sOutput)", retType)
|
||||
if !strings.HasPrefix(retType, "pulumi.") {
|
||||
typeAssertion = fmt.Sprintf(".(pulumi.%sOutput)", Title(retType))
|
||||
}
|
||||
}
|
||||
|
||||
if len(applyArgs) == 1 {
|
||||
|
|
|
@ -44,7 +44,9 @@ func (os *optionalSpiller) spillExpressionHelper(
|
|||
case *model.FunctionCallExpression:
|
||||
if x.Name == "invoke" {
|
||||
// recurse into invoke args
|
||||
isInvoke = true
|
||||
isOutputInvoke, _, _ := pcl.RecognizeOutputVersionedInvoke(x)
|
||||
// ignore output-versioned invokes as they do not need converting
|
||||
isInvoke = !isOutputInvoke
|
||||
_, diags := os.spillExpressionHelper(x.Args[1], x.Args[1].Type(), isInvoke)
|
||||
return x, diags
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -49,8 +49,9 @@ var programTests = []programTest{
|
|||
{
|
||||
Name: "aws-fargate",
|
||||
Description: "AWS Fargate",
|
||||
|
||||
// TODO[pulumi/pulumi#8440]
|
||||
SkipCompile: codegen.NewStringSet("go"),
|
||||
Skip: codegen.NewStringSet("go", "python", "dotnet"),
|
||||
},
|
||||
{
|
||||
Name: "aws-s3-logging",
|
||||
|
@ -127,7 +128,6 @@ var programTests = []programTest{
|
|||
{
|
||||
Name: "output-funcs-aws",
|
||||
Description: "Output Versioned Functions",
|
||||
Skip: codegen.NewStringSet("go", "python", "dotnet"),
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -191,6 +191,23 @@ var sdkTests = []sdkTest{
|
|||
Skip: codegen.NewStringSet("python/test", "nodejs/test"),
|
||||
SkipCompileCheck: codegen.NewStringSet(nodejs),
|
||||
},
|
||||
{
|
||||
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
|
||||
|
|
|
@ -3,7 +3,6 @@ package main
|
|||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/pulumi/pulumi-aws/sdk/v4/go/aws"
|
||||
"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
|
||||
"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ecs"
|
||||
"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/elasticloadbalancingv2"
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -28,14 +28,14 @@ export class Provider extends pulumi.ProviderResource {
|
|||
* @param opts A bag of options that control this resource's behavior.
|
||||
*/
|
||||
constructor(name: string, args?: ProviderArgs, opts?: pulumi.ResourceOptions) {
|
||||
let inputs: pulumi.Inputs = {};
|
||||
let resourceInputs: pulumi.Inputs = {};
|
||||
opts = opts || {};
|
||||
{
|
||||
}
|
||||
if (!opts.version) {
|
||||
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
|
||||
}
|
||||
super(Provider.__pulumiType, name, inputs, opts);
|
||||
super(Provider.__pulumiType, name, resourceInputs, opts);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -28,14 +28,14 @@ export class Provider extends pulumi.ProviderResource {
|
|||
* @param opts A bag of options that control this resource's behavior.
|
||||
*/
|
||||
constructor(name: string, args?: ProviderArgs, opts?: pulumi.ResourceOptions) {
|
||||
let inputs: pulumi.Inputs = {};
|
||||
let resourceInputs: pulumi.Inputs = {};
|
||||
opts = opts || {};
|
||||
{
|
||||
}
|
||||
if (!opts.version) {
|
||||
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
|
||||
}
|
||||
super(Provider.__pulumiType, name, inputs, opts);
|
||||
super(Provider.__pulumiType, name, resourceInputs, opts);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -42,17 +42,17 @@ export class ModuleResource extends pulumi.CustomResource {
|
|||
* @param opts A bag of options that control this resource's behavior.
|
||||
*/
|
||||
constructor(name: string, args?: ModuleResourceArgs, opts?: pulumi.CustomResourceOptions) {
|
||||
let inputs: pulumi.Inputs = {};
|
||||
let resourceInputs: pulumi.Inputs = {};
|
||||
opts = opts || {};
|
||||
if (!opts.id) {
|
||||
inputs["thing"] = args ? args.thing : undefined;
|
||||
resourceInputs["thing"] = args ? args.thing : undefined;
|
||||
} else {
|
||||
inputs["thing"] = undefined /*out*/;
|
||||
resourceInputs["thing"] = undefined /*out*/;
|
||||
}
|
||||
if (!opts.version) {
|
||||
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
|
||||
}
|
||||
super(ModuleResource.__pulumiType, name, inputs, opts);
|
||||
super(ModuleResource.__pulumiType, name, resourceInputs, opts);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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:
|
||||
//
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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()
|
||||
}
|
|
@ -29,16 +29,20 @@ func NewRubberTree(ctx *pulumi.Context,
|
|||
return nil, errors.New("missing one or more required arguments")
|
||||
}
|
||||
|
||||
if args.Diameter == nil {
|
||||
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 isZero(args.Diameter) {
|
||||
args.Diameter = Diameter(6.0)
|
||||
}
|
||||
if args.Farm == nil {
|
||||
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
|
||||
|
@ -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 {
|
||||
|
|
|
@ -28,14 +28,14 @@ export class Provider extends pulumi.ProviderResource {
|
|||
* @param opts A bag of options that control this resource's behavior.
|
||||
*/
|
||||
constructor(name: string, args?: ProviderArgs, opts?: pulumi.ResourceOptions) {
|
||||
let inputs: pulumi.Inputs = {};
|
||||
let resourceInputs: pulumi.Inputs = {};
|
||||
opts = opts || {};
|
||||
{
|
||||
}
|
||||
if (!opts.version) {
|
||||
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
|
||||
}
|
||||
super(Provider.__pulumiType, name, inputs, opts);
|
||||
super(Provider.__pulumiType, name, resourceInputs, opts);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -41,20 +41,20 @@ export class Nursery extends pulumi.CustomResource {
|
|||
* @param opts A bag of options that control this resource's behavior.
|
||||
*/
|
||||
constructor(name: string, args: NurseryArgs, opts?: pulumi.CustomResourceOptions) {
|
||||
let inputs: pulumi.Inputs = {};
|
||||
let resourceInputs: pulumi.Inputs = {};
|
||||
opts = opts || {};
|
||||
if (!opts.id) {
|
||||
if ((!args || args.varieties === undefined) && !opts.urn) {
|
||||
throw new Error("Missing required property 'varieties'");
|
||||
}
|
||||
inputs["sizes"] = args ? args.sizes : undefined;
|
||||
inputs["varieties"] = args ? args.varieties : undefined;
|
||||
resourceInputs["sizes"] = args ? args.sizes : undefined;
|
||||
resourceInputs["varieties"] = args ? args.varieties : undefined;
|
||||
} else {
|
||||
}
|
||||
if (!opts.version) {
|
||||
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
|
||||
}
|
||||
super(Nursery.__pulumiType, name, inputs, opts);
|
||||
super(Nursery.__pulumiType, name, resourceInputs, opts);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -48,11 +48,11 @@ export class RubberTree extends pulumi.CustomResource {
|
|||
*/
|
||||
constructor(name: string, args: RubberTreeArgs, opts?: pulumi.CustomResourceOptions)
|
||||
constructor(name: string, argsOrState?: RubberTreeArgs | RubberTreeState, opts?: pulumi.CustomResourceOptions) {
|
||||
let inputs: pulumi.Inputs = {};
|
||||
let resourceInputs: pulumi.Inputs = {};
|
||||
opts = opts || {};
|
||||
if (opts.id) {
|
||||
const state = argsOrState as RubberTreeState | undefined;
|
||||
inputs["farm"] = state ? state.farm : undefined;
|
||||
resourceInputs["farm"] = state ? state.farm : undefined;
|
||||
} else {
|
||||
const args = argsOrState as RubberTreeArgs | undefined;
|
||||
if ((!args || args.diameter === undefined) && !opts.urn) {
|
||||
|
@ -61,16 +61,16 @@ export class RubberTree extends pulumi.CustomResource {
|
|||
if ((!args || args.type === undefined) && !opts.urn) {
|
||||
throw new Error("Missing required property 'type'");
|
||||
}
|
||||
inputs["container"] = args ? args.container : undefined;
|
||||
inputs["diameter"] = (args ? args.diameter : undefined) ?? 6;
|
||||
inputs["farm"] = (args ? args.farm : undefined) ?? "(unknown)";
|
||||
inputs["size"] = (args ? args.size : undefined) ?? "medium";
|
||||
inputs["type"] = (args ? args.type : undefined) ?? "Burgundy";
|
||||
resourceInputs["container"] = args ? (args.container ? pulumi.output(args.container).apply(inputs.containerArgsProvideDefaults) : undefined) : 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";
|
||||
}
|
||||
if (!opts.version) {
|
||||
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
|
||||
}
|
||||
super(RubberTree.__pulumiType, name, inputs, opts);
|
||||
super(RubberTree.__pulumiType, name, resourceInputs, opts);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,9 +4,20 @@
|
|||
import * as pulumi from "@pulumi/pulumi";
|
||||
import { input as inputs, output as outputs, enums } from "../types";
|
||||
|
||||
import * as utilities from "../utilities";
|
||||
|
||||
export interface ContainerArgs {
|
||||
brightness?: pulumi.Input<enums.ContainerBrightness>;
|
||||
color?: pulumi.Input<enums.ContainerColor | string>;
|
||||
material?: pulumi.Input<string>;
|
||||
size: pulumi.Input<enums.ContainerSize>;
|
||||
}
|
||||
/**
|
||||
* containerArgsProvideDefaults sets the appropriate defaults for ContainerArgs
|
||||
*/
|
||||
export function containerArgsProvideDefaults(val: ContainerArgs): ContainerArgs {
|
||||
return {
|
||||
...val,
|
||||
brightness: (val.brightness) ?? 1,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -4,10 +4,21 @@
|
|||
import * as pulumi from "@pulumi/pulumi";
|
||||
import { input as inputs, output as outputs, enums } from "../types";
|
||||
|
||||
import * as utilities from "../utilities";
|
||||
|
||||
export interface Container {
|
||||
brightness?: enums.ContainerBrightness;
|
||||
color?: enums.ContainerColor | string;
|
||||
material?: string;
|
||||
size: enums.ContainerSize;
|
||||
}
|
||||
/**
|
||||
* containerProvideDefaults sets the appropriate defaults for Container
|
||||
*/
|
||||
export function containerProvideDefaults(val: Container): Container {
|
||||
return {
|
||||
...val,
|
||||
brightness: (val.brightness) ?? 1,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -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{})
|
||||
}
|
||||
|
|
|
@ -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{})
|
||||
}
|
||||
|
|
|
@ -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{})
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -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{})
|
||||
}
|
||||
|
|
|
@ -44,19 +44,19 @@ export class Cat extends pulumi.CustomResource {
|
|||
* @param opts A bag of options that control this resource's behavior.
|
||||
*/
|
||||
constructor(name: string, args?: CatArgs, opts?: pulumi.CustomResourceOptions) {
|
||||
let inputs: pulumi.Inputs = {};
|
||||
let resourceInputs: pulumi.Inputs = {};
|
||||
opts = opts || {};
|
||||
if (!opts.id) {
|
||||
inputs["age"] = args ? args.age : undefined;
|
||||
inputs["pet"] = args ? args.pet : undefined;
|
||||
inputs["name"] = undefined /*out*/;
|
||||
resourceInputs["age"] = args ? args.age : undefined;
|
||||
resourceInputs["pet"] = args ? args.pet : undefined;
|
||||
resourceInputs["name"] = undefined /*out*/;
|
||||
} else {
|
||||
inputs["name"] = undefined /*out*/;
|
||||
resourceInputs["name"] = undefined /*out*/;
|
||||
}
|
||||
if (!opts.version) {
|
||||
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
|
||||
}
|
||||
super(Cat.__pulumiType, name, inputs, opts);
|
||||
super(Cat.__pulumiType, name, resourceInputs, opts);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ export class Component extends pulumi.CustomResource {
|
|||
* @param opts A bag of options that control this resource's behavior.
|
||||
*/
|
||||
constructor(name: string, args: ComponentArgs, opts?: pulumi.CustomResourceOptions) {
|
||||
let inputs: pulumi.Inputs = {};
|
||||
let resourceInputs: pulumi.Inputs = {};
|
||||
opts = opts || {};
|
||||
if (!opts.id) {
|
||||
if ((!args || args.requiredMetadata === undefined) && !opts.urn) {
|
||||
|
@ -58,24 +58,24 @@ export class Component extends pulumi.CustomResource {
|
|||
if ((!args || args.requiredMetadataMap === undefined) && !opts.urn) {
|
||||
throw new Error("Missing required property 'requiredMetadataMap'");
|
||||
}
|
||||
inputs["metadata"] = args ? args.metadata : undefined;
|
||||
inputs["metadataArray"] = args ? args.metadataArray : undefined;
|
||||
inputs["metadataMap"] = args ? args.metadataMap : undefined;
|
||||
inputs["requiredMetadata"] = args ? args.requiredMetadata : undefined;
|
||||
inputs["requiredMetadataArray"] = args ? args.requiredMetadataArray : undefined;
|
||||
inputs["requiredMetadataMap"] = args ? args.requiredMetadataMap : undefined;
|
||||
inputs["provider"] = undefined /*out*/;
|
||||
inputs["securityGroup"] = undefined /*out*/;
|
||||
inputs["storageClasses"] = undefined /*out*/;
|
||||
resourceInputs["metadata"] = args ? args.metadata : undefined;
|
||||
resourceInputs["metadataArray"] = args ? args.metadataArray : undefined;
|
||||
resourceInputs["metadataMap"] = args ? args.metadataMap : undefined;
|
||||
resourceInputs["requiredMetadata"] = args ? args.requiredMetadata : undefined;
|
||||
resourceInputs["requiredMetadataArray"] = args ? args.requiredMetadataArray : undefined;
|
||||
resourceInputs["requiredMetadataMap"] = args ? args.requiredMetadataMap : undefined;
|
||||
resourceInputs["provider"] = undefined /*out*/;
|
||||
resourceInputs["securityGroup"] = undefined /*out*/;
|
||||
resourceInputs["storageClasses"] = undefined /*out*/;
|
||||
} else {
|
||||
inputs["provider"] = undefined /*out*/;
|
||||
inputs["securityGroup"] = undefined /*out*/;
|
||||
inputs["storageClasses"] = undefined /*out*/;
|
||||
resourceInputs["provider"] = undefined /*out*/;
|
||||
resourceInputs["securityGroup"] = undefined /*out*/;
|
||||
resourceInputs["storageClasses"] = undefined /*out*/;
|
||||
}
|
||||
if (!opts.version) {
|
||||
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
|
||||
}
|
||||
super(Component.__pulumiType, name, inputs, opts);
|
||||
super(Component.__pulumiType, name, resourceInputs, opts);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,14 +28,14 @@ export class Provider extends pulumi.ProviderResource {
|
|||
* @param opts A bag of options that control this resource's behavior.
|
||||
*/
|
||||
constructor(name: string, args?: ProviderArgs, opts?: pulumi.ResourceOptions) {
|
||||
let inputs: pulumi.Inputs = {};
|
||||
let resourceInputs: pulumi.Inputs = {};
|
||||
opts = opts || {};
|
||||
{
|
||||
}
|
||||
if (!opts.version) {
|
||||
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
|
||||
}
|
||||
super(Provider.__pulumiType, name, inputs, opts);
|
||||
super(Provider.__pulumiType, name, resourceInputs, opts);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -43,17 +43,17 @@ export class Workload extends pulumi.CustomResource {
|
|||
* @param opts A bag of options that control this resource's behavior.
|
||||
*/
|
||||
constructor(name: string, args?: WorkloadArgs, opts?: pulumi.CustomResourceOptions) {
|
||||
let inputs: pulumi.Inputs = {};
|
||||
let resourceInputs: pulumi.Inputs = {};
|
||||
opts = opts || {};
|
||||
if (!opts.id) {
|
||||
inputs["pod"] = undefined /*out*/;
|
||||
resourceInputs["pod"] = undefined /*out*/;
|
||||
} else {
|
||||
inputs["pod"] = undefined /*out*/;
|
||||
resourceInputs["pod"] = undefined /*out*/;
|
||||
}
|
||||
if (!opts.version) {
|
||||
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
|
||||
}
|
||||
super(Workload.__pulumiType, name, inputs, opts);
|
||||
super(Workload.__pulumiType, name, resourceInputs, opts);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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{})
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -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{})
|
||||
}
|
||||
|
|
|
@ -28,14 +28,14 @@ export class Provider extends pulumi.ProviderResource {
|
|||
* @param opts A bag of options that control this resource's behavior.
|
||||
*/
|
||||
constructor(name: string, args?: ProviderArgs, opts?: pulumi.ResourceOptions) {
|
||||
let inputs: pulumi.Inputs = {};
|
||||
let resourceInputs: pulumi.Inputs = {};
|
||||
opts = opts || {};
|
||||
{
|
||||
}
|
||||
if (!opts.version) {
|
||||
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
|
||||
}
|
||||
super(Provider.__pulumiType, name, inputs, opts);
|
||||
super(Provider.__pulumiType, name, resourceInputs, opts);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -42,25 +42,25 @@ export class RegistryGeoReplication extends pulumi.ComponentResource {
|
|||
* @param opts A bag of options that control this resource's behavior.
|
||||
*/
|
||||
constructor(name: string, args: RegistryGeoReplicationArgs, opts?: pulumi.ComponentResourceOptions) {
|
||||
let inputs: pulumi.Inputs = {};
|
||||
let resourceInputs: pulumi.Inputs = {};
|
||||
opts = opts || {};
|
||||
if (!opts.id) {
|
||||
if ((!args || args.resourceGroup === undefined) && !opts.urn) {
|
||||
throw new Error("Missing required property 'resourceGroup'");
|
||||
}
|
||||
inputs["resourceGroup"] = args ? args.resourceGroup : undefined;
|
||||
inputs["acrLoginServerOut"] = undefined /*out*/;
|
||||
inputs["registry"] = undefined /*out*/;
|
||||
inputs["replication"] = undefined /*out*/;
|
||||
resourceInputs["resourceGroup"] = args ? args.resourceGroup : undefined;
|
||||
resourceInputs["acrLoginServerOut"] = undefined /*out*/;
|
||||
resourceInputs["registry"] = undefined /*out*/;
|
||||
resourceInputs["replication"] = undefined /*out*/;
|
||||
} else {
|
||||
inputs["acrLoginServerOut"] = undefined /*out*/;
|
||||
inputs["registry"] = undefined /*out*/;
|
||||
inputs["replication"] = undefined /*out*/;
|
||||
resourceInputs["acrLoginServerOut"] = undefined /*out*/;
|
||||
resourceInputs["registry"] = undefined /*out*/;
|
||||
resourceInputs["replication"] = undefined /*out*/;
|
||||
}
|
||||
if (!opts.version) {
|
||||
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
|
||||
}
|
||||
super(RegistryGeoReplication.__pulumiType, name, inputs, opts, true /*remote*/);
|
||||
super(RegistryGeoReplication.__pulumiType, name, resourceInputs, opts, true /*remote*/);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -28,14 +28,14 @@ export class Provider extends pulumi.ProviderResource {
|
|||
* @param opts A bag of options that control this resource's behavior.
|
||||
*/
|
||||
constructor(name: string, args?: ProviderArgs, opts?: pulumi.ResourceOptions) {
|
||||
let inputs: pulumi.Inputs = {};
|
||||
let resourceInputs: pulumi.Inputs = {};
|
||||
opts = opts || {};
|
||||
{
|
||||
}
|
||||
if (!opts.version) {
|
||||
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
|
||||
}
|
||||
super(Provider.__pulumiType, name, inputs, opts);
|
||||
super(Provider.__pulumiType, name, resourceInputs, opts);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -41,17 +41,17 @@ export class Resource extends pulumi.CustomResource {
|
|||
* @param opts A bag of options that control this resource's behavior.
|
||||
*/
|
||||
constructor(name: string, args?: ResourceArgs, opts?: pulumi.CustomResourceOptions) {
|
||||
let inputs: pulumi.Inputs = {};
|
||||
let resourceInputs: pulumi.Inputs = {};
|
||||
opts = opts || {};
|
||||
if (!opts.id) {
|
||||
inputs["bar"] = undefined /*out*/;
|
||||
resourceInputs["bar"] = undefined /*out*/;
|
||||
} else {
|
||||
inputs["bar"] = undefined /*out*/;
|
||||
resourceInputs["bar"] = undefined /*out*/;
|
||||
}
|
||||
if (!opts.version) {
|
||||
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
|
||||
}
|
||||
super(Resource.__pulumiType, name, inputs, opts);
|
||||
super(Resource.__pulumiType, name, resourceInputs, opts);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -41,17 +41,17 @@ export class ResourceInput extends pulumi.CustomResource {
|
|||
* @param opts A bag of options that control this resource's behavior.
|
||||
*/
|
||||
constructor(name: string, args?: ResourceInputArgs, opts?: pulumi.CustomResourceOptions) {
|
||||
let inputs: pulumi.Inputs = {};
|
||||
let resourceInputs: pulumi.Inputs = {};
|
||||
opts = opts || {};
|
||||
if (!opts.id) {
|
||||
inputs["bar"] = undefined /*out*/;
|
||||
resourceInputs["bar"] = undefined /*out*/;
|
||||
} else {
|
||||
inputs["bar"] = undefined /*out*/;
|
||||
resourceInputs["bar"] = undefined /*out*/;
|
||||
}
|
||||
if (!opts.version) {
|
||||
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
|
||||
}
|
||||
super(ResourceInput.__pulumiType, name, inputs, opts);
|
||||
super(ResourceInput.__pulumiType, name, resourceInputs, opts);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -41,19 +41,19 @@ export class Resource extends pulumi.CustomResource {
|
|||
* @param opts A bag of options that control this resource's behavior.
|
||||
*/
|
||||
constructor(name: string, args?: ResourceArgs, opts?: pulumi.CustomResourceOptions) {
|
||||
let inputs: pulumi.Inputs = {};
|
||||
let resourceInputs: pulumi.Inputs = {};
|
||||
opts = opts || {};
|
||||
if (!opts.id) {
|
||||
inputs["baz"] = args?.baz ? pulumi.secret(args.baz) : undefined;
|
||||
resourceInputs["baz"] = args?.baz ? pulumi.secret(args.baz) : undefined;
|
||||
} else {
|
||||
inputs["baz"] = undefined /*out*/;
|
||||
resourceInputs["baz"] = undefined /*out*/;
|
||||
}
|
||||
if (!opts.version) {
|
||||
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
|
||||
}
|
||||
const secretOpts = { additionalSecretOutputs: ["baz"] };
|
||||
opts = pulumi.mergeOptions(opts, secretOpts);
|
||||
super(Resource.__pulumiType, name, inputs, opts);
|
||||
super(Resource.__pulumiType, name, resourceInputs, opts);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,14 +28,14 @@ export class Provider extends pulumi.ProviderResource {
|
|||
* @param opts A bag of options that control this resource's behavior.
|
||||
*/
|
||||
constructor(name: string, args?: ProviderArgs, opts?: pulumi.ResourceOptions) {
|
||||
let inputs: pulumi.Inputs = {};
|
||||
let resourceInputs: pulumi.Inputs = {};
|
||||
opts = opts || {};
|
||||
{
|
||||
}
|
||||
if (!opts.version) {
|
||||
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
|
||||
}
|
||||
super(Provider.__pulumiType, name, inputs, opts);
|
||||
super(Provider.__pulumiType, name, resourceInputs, opts);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -41,19 +41,19 @@ export class Resource extends pulumi.CustomResource {
|
|||
* @param opts A bag of options that control this resource's behavior.
|
||||
*/
|
||||
constructor(name: string, args?: ResourceArgs, opts?: pulumi.CustomResourceOptions) {
|
||||
let inputs: pulumi.Inputs = {};
|
||||
let resourceInputs: pulumi.Inputs = {};
|
||||
opts = opts || {};
|
||||
if (!opts.id) {
|
||||
inputs["bar"] = args?.bar ? pulumi.secret(args.bar) : undefined;
|
||||
resourceInputs["bar"] = args?.bar ? pulumi.secret(args.bar) : undefined;
|
||||
} else {
|
||||
inputs["bar"] = undefined /*out*/;
|
||||
resourceInputs["bar"] = undefined /*out*/;
|
||||
}
|
||||
if (!opts.version) {
|
||||
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
|
||||
}
|
||||
const secretOpts = { additionalSecretOutputs: ["bar"] };
|
||||
opts = pulumi.mergeOptions(opts, secretOpts);
|
||||
super(Resource.__pulumiType, name, inputs, opts);
|
||||
super(Resource.__pulumiType, name, resourceInputs, opts);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,14 +28,14 @@ export class Provider extends pulumi.ProviderResource {
|
|||
* @param opts A bag of options that control this resource's behavior.
|
||||
*/
|
||||
constructor(name: string, args?: ProviderArgs, opts?: pulumi.ResourceOptions) {
|
||||
let inputs: pulumi.Inputs = {};
|
||||
let resourceInputs: pulumi.Inputs = {};
|
||||
opts = opts || {};
|
||||
{
|
||||
}
|
||||
if (!opts.version) {
|
||||
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
|
||||
}
|
||||
super(Provider.__pulumiType, name, inputs, opts);
|
||||
super(Provider.__pulumiType, name, resourceInputs, opts);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
57
pkg/codegen/internal/test/testdata/output-funcs-aws-pp/dotnet/output-funcs-aws.cs
vendored
Normal file
57
pkg/codegen/internal/test/testdata/output-funcs-aws-pp/dotnet/output-funcs-aws.cs
vendored
Normal file
|
@ -0,0 +1,57 @@
|
|||
using Pulumi;
|
||||
using Aws = Pulumi.Aws;
|
||||
|
||||
class MyStack : Stack
|
||||
{
|
||||
public MyStack()
|
||||
{
|
||||
var aws_vpc = new Aws.Ec2.Vpc("aws_vpc", new Aws.Ec2.VpcArgs
|
||||
{
|
||||
CidrBlock = "10.0.0.0/16",
|
||||
InstanceTenancy = "default",
|
||||
});
|
||||
var privateS3VpcEndpoint = new Aws.Ec2.VpcEndpoint("privateS3VpcEndpoint", new Aws.Ec2.VpcEndpointArgs
|
||||
{
|
||||
VpcId = aws_vpc.Id,
|
||||
ServiceName = "com.amazonaws.us-west-2.s3",
|
||||
});
|
||||
var privateS3PrefixList = Aws.Ec2.GetPrefixList.Invoke(new Aws.Ec2.GetPrefixListInvokeArgs
|
||||
{
|
||||
PrefixListId = privateS3VpcEndpoint.PrefixListId,
|
||||
});
|
||||
var bar = new Aws.Ec2.NetworkAcl("bar", new Aws.Ec2.NetworkAclArgs
|
||||
{
|
||||
VpcId = aws_vpc.Id,
|
||||
});
|
||||
var privateS3NetworkAclRule = new Aws.Ec2.NetworkAclRule("privateS3NetworkAclRule", new Aws.Ec2.NetworkAclRuleArgs
|
||||
{
|
||||
NetworkAclId = bar.Id,
|
||||
RuleNumber = 200,
|
||||
Egress = false,
|
||||
Protocol = "tcp",
|
||||
RuleAction = "allow",
|
||||
CidrBlock = privateS3PrefixList.Apply(privateS3PrefixList => privateS3PrefixList.CidrBlocks[0]),
|
||||
FromPort = 443,
|
||||
ToPort = 443,
|
||||
});
|
||||
var amis = Aws.Ec2.GetAmiIds.Invoke(new Aws.Ec2.GetAmiIdsInvokeArgs
|
||||
{
|
||||
Owners =
|
||||
{
|
||||
bar.Id,
|
||||
},
|
||||
Filters =
|
||||
{
|
||||
new Aws.Ec2.Inputs.GetAmiIdsFilterInputArgs
|
||||
{
|
||||
Name = bar.Id,
|
||||
Values =
|
||||
{
|
||||
"pulumi*",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
}
|
63
pkg/codegen/internal/test/testdata/output-funcs-aws-pp/go/output-funcs-aws.go
vendored
Normal file
63
pkg/codegen/internal/test/testdata/output-funcs-aws-pp/go/output-funcs-aws.go
vendored
Normal file
|
@ -0,0 +1,63 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
|
||||
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||
)
|
||||
|
||||
func main() {
|
||||
pulumi.Run(func(ctx *pulumi.Context) error {
|
||||
aws_vpc, err := ec2.NewVpc(ctx, "aws_vpc", &ec2.VpcArgs{
|
||||
CidrBlock: pulumi.String("10.0.0.0/16"),
|
||||
InstanceTenancy: pulumi.String("default"),
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
privateS3VpcEndpoint, err := ec2.NewVpcEndpoint(ctx, "privateS3VpcEndpoint", &ec2.VpcEndpointArgs{
|
||||
VpcId: aws_vpc.ID(),
|
||||
ServiceName: pulumi.String("com.amazonaws.us-west-2.s3"),
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
privateS3PrefixList := ec2.GetPrefixListOutput(ctx, ec2.GetPrefixListOutputArgs{
|
||||
PrefixListId: privateS3VpcEndpoint.PrefixListId,
|
||||
}, nil)
|
||||
bar, err := ec2.NewNetworkAcl(ctx, "bar", &ec2.NetworkAclArgs{
|
||||
VpcId: aws_vpc.ID(),
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = ec2.NewNetworkAclRule(ctx, "privateS3NetworkAclRule", &ec2.NetworkAclRuleArgs{
|
||||
NetworkAclId: bar.ID(),
|
||||
RuleNumber: pulumi.Int(200),
|
||||
Egress: pulumi.Bool(false),
|
||||
Protocol: pulumi.String("tcp"),
|
||||
RuleAction: pulumi.String("allow"),
|
||||
CidrBlock: privateS3PrefixList.ApplyT(func(privateS3PrefixList ec2.GetPrefixListResult) (string, error) {
|
||||
return privateS3PrefixList.CidrBlocks[0], nil
|
||||
}).(pulumi.StringOutput),
|
||||
FromPort: pulumi.Int(443),
|
||||
ToPort: pulumi.Int(443),
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_ = ec2.GetAmiIdsOutput(ctx, ec2.GetAmiIdsOutputArgs{
|
||||
Owners: pulumi.StringArray{
|
||||
bar.ID(),
|
||||
},
|
||||
Filters: ec2.GetAmiIdsFilterArray{
|
||||
&ec2.GetAmiIdsFilterArgs{
|
||||
Name: bar.ID(),
|
||||
Values: pulumi.StringArray{
|
||||
pulumi.String("pulumi*"),
|
||||
},
|
||||
},
|
||||
},
|
||||
}, nil)
|
||||
return nil
|
||||
})
|
||||
}
|
25
pkg/codegen/internal/test/testdata/output-funcs-aws-pp/python/output-funcs-aws.py
vendored
Normal file
25
pkg/codegen/internal/test/testdata/output-funcs-aws-pp/python/output-funcs-aws.py
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
import pulumi
|
||||
import pulumi_aws as aws
|
||||
|
||||
aws_vpc = aws.ec2.Vpc("aws_vpc",
|
||||
cidr_block="10.0.0.0/16",
|
||||
instance_tenancy="default")
|
||||
private_s3_vpc_endpoint = aws.ec2.VpcEndpoint("privateS3VpcEndpoint",
|
||||
vpc_id=aws_vpc.id,
|
||||
service_name="com.amazonaws.us-west-2.s3")
|
||||
private_s3_prefix_list = aws.ec2.get_prefix_list_output(prefix_list_id=private_s3_vpc_endpoint.prefix_list_id)
|
||||
bar = aws.ec2.NetworkAcl("bar", vpc_id=aws_vpc.id)
|
||||
private_s3_network_acl_rule = aws.ec2.NetworkAclRule("privateS3NetworkAclRule",
|
||||
network_acl_id=bar.id,
|
||||
rule_number=200,
|
||||
egress=False,
|
||||
protocol="tcp",
|
||||
rule_action="allow",
|
||||
cidr_block=private_s3_prefix_list.cidr_blocks[0],
|
||||
from_port=443,
|
||||
to_port=443)
|
||||
amis = aws.ec2.get_ami_ids_output(owners=[bar.id],
|
||||
filters=[aws.ec2.GetAmiIdsFilterArgs(
|
||||
name=bar.id,
|
||||
values=["pulumi*"],
|
||||
)])
|
|
@ -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 {
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -28,14 +28,14 @@ export class Provider extends pulumi.ProviderResource {
|
|||
* @param opts A bag of options that control this resource's behavior.
|
||||
*/
|
||||
constructor(name: string, args?: ProviderArgs, opts?: pulumi.ResourceOptions) {
|
||||
let inputs: pulumi.Inputs = {};
|
||||
let resourceInputs: pulumi.Inputs = {};
|
||||
opts = opts || {};
|
||||
{
|
||||
}
|
||||
if (!opts.version) {
|
||||
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
|
||||
}
|
||||
super(Provider.__pulumiType, name, inputs, opts);
|
||||
super(Provider.__pulumiType, name, resourceInputs, opts);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -28,14 +28,14 @@ export class Provider extends pulumi.ProviderResource {
|
|||
* @param opts A bag of options that control this resource's behavior.
|
||||
*/
|
||||
constructor(name: string, args?: ProviderArgs, opts?: pulumi.ResourceOptions) {
|
||||
let inputs: pulumi.Inputs = {};
|
||||
let resourceInputs: pulumi.Inputs = {};
|
||||
opts = opts || {};
|
||||
{
|
||||
}
|
||||
if (!opts.version) {
|
||||
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
|
||||
}
|
||||
super(Provider.__pulumiType, name, inputs, opts);
|
||||
super(Provider.__pulumiType, name, resourceInputs, opts);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
})
|
||||
}
|
||||
|
|
|
@ -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"`
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -28,14 +28,14 @@ export class Provider extends pulumi.ProviderResource {
|
|||
* @param opts A bag of options that control this resource's behavior.
|
||||
*/
|
||||
constructor(name: string, args?: ProviderArgs, opts?: pulumi.ResourceOptions) {
|
||||
let inputs: pulumi.Inputs = {};
|
||||
let resourceInputs: pulumi.Inputs = {};
|
||||
opts = opts || {};
|
||||
{
|
||||
}
|
||||
if (!opts.version) {
|
||||
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
|
||||
}
|
||||
super(Provider.__pulumiType, name, inputs, opts);
|
||||
super(Provider.__pulumiType, name, resourceInputs, opts);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,53 +22,53 @@ func NewModuleResource(ctx *pulumi.Context,
|
|||
return nil, errors.New("missing one or more required arguments")
|
||||
}
|
||||
|
||||
if args.Optional_bool == nil {
|
||||
if isZero(args.Optional_bool) {
|
||||
args.Optional_bool = pulumi.BoolPtr(true)
|
||||
}
|
||||
args.Optional_const = pulumi.StringPtr("val")
|
||||
if args.Optional_enum == nil {
|
||||
if isZero(args.Optional_enum) {
|
||||
args.Optional_enum = EnumThing(8)
|
||||
}
|
||||
if args.Optional_number == nil {
|
||||
if isZero(args.Optional_number) {
|
||||
args.Optional_number = pulumi.Float64Ptr(42.0)
|
||||
}
|
||||
if args.Optional_string == nil {
|
||||
if isZero(args.Optional_string) {
|
||||
args.Optional_string = pulumi.StringPtr("buzzer")
|
||||
}
|
||||
if args.Plain_optional_bool == nil {
|
||||
if isZero(args.Plain_optional_bool) {
|
||||
plain_optional_bool_ := true
|
||||
args.Plain_optional_bool = &plain_optional_bool_
|
||||
}
|
||||
plain_optional_const_ := "val"
|
||||
args.Plain_optional_const = &plain_optional_const_
|
||||
if args.Plain_optional_number == nil {
|
||||
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_
|
||||
}
|
||||
if args.Plain_required_bool == false {
|
||||
if isZero(args.Plain_required_bool) {
|
||||
args.Plain_required_bool = true
|
||||
}
|
||||
args.Plain_required_const = "val"
|
||||
if args.Plain_required_number == 0.0 {
|
||||
if isZero(args.Plain_required_number) {
|
||||
args.Plain_required_number = 42.0
|
||||
}
|
||||
if args.Plain_required_string == "" {
|
||||
if isZero(args.Plain_required_string) {
|
||||
args.Plain_required_string = "buzzer"
|
||||
}
|
||||
if args.Required_bool == nil {
|
||||
if isZero(args.Required_bool) {
|
||||
args.Required_bool = pulumi.Bool(true)
|
||||
}
|
||||
if args.Required_enum == nil {
|
||||
if isZero(args.Required_enum) {
|
||||
args.Required_enum = EnumThing(4)
|
||||
}
|
||||
if args.Required_number == nil {
|
||||
if isZero(args.Required_number) {
|
||||
args.Required_number = pulumi.Float64(42.0)
|
||||
}
|
||||
if args.Required_string == nil {
|
||||
if isZero(args.Required_string) {
|
||||
args.Required_string = pulumi.String("buzzer")
|
||||
}
|
||||
var resource ModuleResource
|
||||
|
@ -155,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 {
|
||||
|
@ -169,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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ export class ModuleResource extends pulumi.CustomResource {
|
|||
* @param opts A bag of options that control this resource's behavior.
|
||||
*/
|
||||
constructor(name: string, args: ModuleResourceArgs, opts?: pulumi.CustomResourceOptions) {
|
||||
let inputs: pulumi.Inputs = {};
|
||||
let resourceInputs: pulumi.Inputs = {};
|
||||
opts = opts || {};
|
||||
if (!opts.id) {
|
||||
if ((!args || args.plain_required_bool === undefined) && !opts.urn) {
|
||||
|
@ -68,29 +68,29 @@ export class ModuleResource extends pulumi.CustomResource {
|
|||
if ((!args || args.required_string === undefined) && !opts.urn) {
|
||||
throw new Error("Missing required property 'required_string'");
|
||||
}
|
||||
inputs["optional_bool"] = (args ? args.optional_bool : undefined) ?? true;
|
||||
inputs["optional_const"] = "val";
|
||||
inputs["optional_enum"] = (args ? args.optional_enum : undefined) ?? 8;
|
||||
inputs["optional_number"] = (args ? args.optional_number : undefined) ?? 42;
|
||||
inputs["optional_string"] = (args ? args.optional_string : undefined) ?? "buzzer";
|
||||
inputs["plain_optional_bool"] = (args ? args.plain_optional_bool : undefined) ?? true;
|
||||
inputs["plain_optional_const"] = "val";
|
||||
inputs["plain_optional_number"] = (args ? args.plain_optional_number : undefined) ?? 42;
|
||||
inputs["plain_optional_string"] = (args ? args.plain_optional_string : undefined) ?? "buzzer";
|
||||
inputs["plain_required_bool"] = (args ? args.plain_required_bool : undefined) ?? true;
|
||||
inputs["plain_required_const"] = "val";
|
||||
inputs["plain_required_number"] = (args ? args.plain_required_number : undefined) ?? 42;
|
||||
inputs["plain_required_string"] = (args ? args.plain_required_string : undefined) ?? "buzzer";
|
||||
inputs["required_bool"] = (args ? args.required_bool : undefined) ?? true;
|
||||
inputs["required_enum"] = (args ? args.required_enum : undefined) ?? 4;
|
||||
inputs["required_number"] = (args ? args.required_number : undefined) ?? 42;
|
||||
inputs["required_string"] = (args ? args.required_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) ?? 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) {
|
||||
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
|
||||
}
|
||||
super(ModuleResource.__pulumiType, name, inputs, opts);
|
||||
super(ModuleResource.__pulumiType, name, resourceInputs, opts);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,14 +28,14 @@ export class Provider extends pulumi.ProviderResource {
|
|||
* @param opts A bag of options that control this resource's behavior.
|
||||
*/
|
||||
constructor(name: string, args?: ProviderArgs, opts?: pulumi.ResourceOptions) {
|
||||
let inputs: pulumi.Inputs = {};
|
||||
let resourceInputs: pulumi.Inputs = {};
|
||||
opts = opts || {};
|
||||
{
|
||||
}
|
||||
if (!opts.version) {
|
||||
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
|
||||
}
|
||||
super(Provider.__pulumiType, name, inputs, opts);
|
||||
super(Provider.__pulumiType, name, resourceInputs, opts);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
41
pkg/codegen/internal/test/testdata/plain-object-defaults/docs/_index.md
vendored
Normal file
41
pkg/codegen/internal/test/testdata/plain-object-defaults/docs/_index.md
vendored
Normal file
|
@ -0,0 +1,41 @@
|
|||
---
|
||||
title: "example"
|
||||
title_tag: "example Package"
|
||||
meta_desc: ""
|
||||
layout: api
|
||||
no_edit_this_page: true
|
||||
---
|
||||
|
||||
<!-- WARNING: this file was generated by test. -->
|
||||
<!-- Do not edit by hand unless you're certain you know what you are doing! -->
|
||||
|
||||
|
||||
|
||||
<h2 id="modules">Modules</h2>
|
||||
<ul class="api">
|
||||
<li><a href="mod1/" title="mod1"><span class="api-symbol api-symbol--module"></span>mod1</a></li>
|
||||
<li><a href="mod2/" title="mod2"><span class="api-symbol api-symbol--module"></span>mod2</a></li>
|
||||
</ul>
|
||||
|
||||
<h2 id="resources">Resources</h2>
|
||||
<ul class="api">
|
||||
<li><a href="foo" title="Foo"><span class="api-symbol api-symbol--resource"></span>Foo</a></li>
|
||||
<li><a href="moduletest" title="ModuleTest"><span class="api-symbol api-symbol--resource"></span>ModuleTest</a></li>
|
||||
<li><a href="provider" title="Provider"><span class="api-symbol api-symbol--resource"></span>Provider</a></li>
|
||||
</ul>
|
||||
|
||||
<h2 id="functions">Functions</h2>
|
||||
<ul class="api">
|
||||
<li><a href="funcwithalloptionalinputs" title="FuncWithAllOptionalInputs"><span class="api-symbol api-symbol--function"></span>FuncWithAllOptionalInputs</a></li>
|
||||
</ul>
|
||||
|
||||
<h2 id="package-details">Package Details</h2>
|
||||
<dl class="package-details">
|
||||
<dt>Repository</dt>
|
||||
<dd><a href=""></a></dd>
|
||||
<dt>License</dt>
|
||||
<dd></dd>
|
||||
<dt>Version</dt>
|
||||
<dd>0.0.1</dd>
|
||||
</dl>
|
||||
|
11
pkg/codegen/internal/test/testdata/plain-object-defaults/docs/codegen-manifest.json
vendored
Normal file
11
pkg/codegen/internal/test/testdata/plain-object-defaults/docs/codegen-manifest.json
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"emittedFiles": [
|
||||
"_index.md",
|
||||
"foo/_index.md",
|
||||
"funcwithalloptionalinputs/_index.md",
|
||||
"mod1/_index.md",
|
||||
"mod2/_index.md",
|
||||
"moduletest/_index.md",
|
||||
"provider/_index.md"
|
||||
]
|
||||
}
|
849
pkg/codegen/internal/test/testdata/plain-object-defaults/docs/foo/_index.md
vendored
Normal file
849
pkg/codegen/internal/test/testdata/plain-object-defaults/docs/foo/_index.md
vendored
Normal file
|
@ -0,0 +1,849 @@
|
|||
|
||||
---
|
||||
title: "Foo"
|
||||
title_tag: "example.Foo"
|
||||
meta_desc: "Documentation for the example.Foo resource with examples, input properties, output properties, lookup functions, and supporting types."
|
||||
layout: api
|
||||
no_edit_this_page: true
|
||||
---
|
||||
|
||||
|
||||
|
||||
<!-- WARNING: this file was generated by test. -->
|
||||
<!-- Do not edit by hand unless you're certain you know what you are doing! -->
|
||||
|
||||
test new feature with resoruces
|
||||
|
||||
|
||||
|
||||
|
||||
## Create a Foo Resource {#create}
|
||||
{{< chooser language "typescript,python,go,csharp" / >}}
|
||||
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<div class="highlight"><pre class="chroma"><code class="language-typescript" data-lang="typescript"><span class="k">new </span><span class="nx">Foo</span><span class="p">(</span><span class="nx">name</span><span class="p">:</span> <span class="nx">string</span><span class="p">,</span> <span class="nx">args</span><span class="p">:</span> <span class="nx"><a href="#inputs">FooArgs</a></span><span class="p">,</span> <span class="nx">opts</span><span class="p">?:</span> <span class="nx"><a href="/docs/reference/pkg/nodejs/pulumi/pulumi/#CustomResourceOptions">CustomResourceOptions</a></span><span class="p">);</span></code></pre></div>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<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">Foo</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">argument</span><span class="p">:</span> <span class="nx">Optional[str]</span> = None<span class="p">,</span>
|
||||
<span class="nx">backup_kube_client_settings</span><span class="p">:</span> <span class="nx">Optional[KubeClientSettingsArgs]</span> = None<span class="p">,</span>
|
||||
<span class="nx">kube_client_settings</span><span class="p">:</span> <span class="nx">Optional[KubeClientSettingsArgs]</span> = None<span class="p">,</span>
|
||||
<span class="nx">settings</span><span class="p">:</span> <span class="nx">Optional[LayeredTypeArgs]</span> = None<span class="p">)</span>
|
||||
<span class=nd>@overload</span>
|
||||
<span class="k">def </span><span class="nx">Foo</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">args</span><span class="p">:</span> <span class="nx"><a href="#inputs">FooArgs</a></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></code></pre></div>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<div class="highlight"><pre class="chroma"><code class="language-go" data-lang="go"><span class="k">func </span><span class="nx">NewFoo</span><span class="p">(</span><span class="nx">ctx</span><span class="p"> *</span><span class="nx"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#Context">Context</a></span><span class="p">,</span> <span class="nx">name</span><span class="p"> </span><span class="nx">string</span><span class="p">,</span> <span class="nx">args</span><span class="p"> </span><span class="nx"><a href="#inputs">FooArgs</a></span><span class="p">,</span> <span class="nx">opts</span><span class="p"> ...</span><span class="nx"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#ResourceOption">ResourceOption</a></span><span class="p">) (*<span class="nx">Foo</span>, error)</span></code></pre></div>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<div class="highlight"><pre class="chroma"><code class="language-csharp" data-lang="csharp"><span class="k">public </span><span class="nx">Foo</span><span class="p">(</span><span class="nx">string</span><span class="p"> </span><span class="nx">name<span class="p">,</span> <span class="nx"><a href="#inputs">FooArgs</a></span><span class="p"> </span><span class="nx">args<span class="p">,</span> <span class="nx"><a href="/docs/reference/pkg/dotnet/Pulumi/Pulumi.CustomResourceOptions.html">CustomResourceOptions</a></span><span class="p">? </span><span class="nx">opts = null<span class="p">)</span></code></pre></div>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
|
||||
<dl class="resources-properties"><dt
|
||||
class="property-required" title="Required">
|
||||
<span>name</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>The unique name of the resource.</dd><dt
|
||||
class="property-required" title="Required">
|
||||
<span>args</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#inputs">FooArgs</a></span>
|
||||
</dt>
|
||||
<dd>The arguments to resource properties.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>opts</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="/docs/reference/pkg/nodejs/pulumi/pulumi/#CustomResourceOptions">CustomResourceOptions</a></span>
|
||||
</dt>
|
||||
<dd>Bag of options to control resource's behavior.</dd></dl>
|
||||
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
|
||||
<dl class="resources-properties"><dt
|
||||
class="property-required" title="Required">
|
||||
<span>resource_name</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>The unique name of the resource.</dd><dt
|
||||
class="property-required" title="Required">
|
||||
<span>args</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#inputs">FooArgs</a></span>
|
||||
</dt>
|
||||
<dd>The arguments to resource properties.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>opts</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="/docs/reference/pkg/python/pulumi/#pulumi.ResourceOptions">ResourceOptions</a></span>
|
||||
</dt>
|
||||
<dd>Bag of options to control resource's behavior.</dd></dl>
|
||||
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
|
||||
<dl class="resources-properties"><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>ctx</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#Context">Context</a></span>
|
||||
</dt>
|
||||
<dd>Context object for the current deployment.</dd><dt
|
||||
class="property-required" title="Required">
|
||||
<span>name</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>The unique name of the resource.</dd><dt
|
||||
class="property-required" title="Required">
|
||||
<span>args</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#inputs">FooArgs</a></span>
|
||||
</dt>
|
||||
<dd>The arguments to resource properties.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>opts</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#ResourceOption">ResourceOption</a></span>
|
||||
</dt>
|
||||
<dd>Bag of options to control resource's behavior.</dd></dl>
|
||||
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
|
||||
<dl class="resources-properties"><dt
|
||||
class="property-required" title="Required">
|
||||
<span>name</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>The unique name of the resource.</dd><dt
|
||||
class="property-required" title="Required">
|
||||
<span>args</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#inputs">FooArgs</a></span>
|
||||
</dt>
|
||||
<dd>The arguments to resource properties.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>opts</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="/docs/reference/pkg/dotnet/Pulumi/Pulumi.CustomResourceOptions.html">CustomResourceOptions</a></span>
|
||||
</dt>
|
||||
<dd>Bag of options to control resource's behavior.</dd></dl>
|
||||
|
||||
{{% /choosable %}}
|
||||
|
||||
## Foo Resource Properties {#properties}
|
||||
|
||||
To learn more about resource properties and how to use them, see [Inputs and Outputs]({{< relref "/docs/intro/concepts/inputs-outputs" >}}) in the Architecture and Concepts docs.
|
||||
|
||||
### Inputs
|
||||
|
||||
The Foo resource accepts the following [input]({{< relref "/docs/intro/concepts/inputs-outputs" >}}) properties:
|
||||
|
||||
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="backupkubeclientsettings_csharp">
|
||||
<a href="#backupkubeclientsettings_csharp" style="color: inherit; text-decoration: inherit;">Backup<wbr>Kube<wbr>Client<wbr>Settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#kubeclientsettings">Kube<wbr>Client<wbr>Settings<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Options for tuning the Kubernetes client used by a Provider.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="argument_csharp">
|
||||
<a href="#argument_csharp" style="color: inherit; text-decoration: inherit;">Argument</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="kubeclientsettings_csharp">
|
||||
<a href="#kubeclientsettings_csharp" style="color: inherit; text-decoration: inherit;">Kube<wbr>Client<wbr>Settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#kubeclientsettings">Kube<wbr>Client<wbr>Settings<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Options for tuning the Kubernetes client used by a Provider.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="settings_csharp">
|
||||
<a href="#settings_csharp" style="color: inherit; text-decoration: inherit;">Settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#layeredtype">Layered<wbr>Type<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}describing things{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="backupkubeclientsettings_go">
|
||||
<a href="#backupkubeclientsettings_go" style="color: inherit; text-decoration: inherit;">Backup<wbr>Kube<wbr>Client<wbr>Settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#kubeclientsettings">Kube<wbr>Client<wbr>Settings<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Options for tuning the Kubernetes client used by a Provider.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="argument_go">
|
||||
<a href="#argument_go" style="color: inherit; text-decoration: inherit;">Argument</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="kubeclientsettings_go">
|
||||
<a href="#kubeclientsettings_go" style="color: inherit; text-decoration: inherit;">Kube<wbr>Client<wbr>Settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#kubeclientsettings">Kube<wbr>Client<wbr>Settings<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Options for tuning the Kubernetes client used by a Provider.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="settings_go">
|
||||
<a href="#settings_go" style="color: inherit; text-decoration: inherit;">Settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#layeredtype">Layered<wbr>Type<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}describing things{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="backupkubeclientsettings_nodejs">
|
||||
<a href="#backupkubeclientsettings_nodejs" style="color: inherit; text-decoration: inherit;">backup<wbr>Kube<wbr>Client<wbr>Settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#kubeclientsettings">Kube<wbr>Client<wbr>Settings<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Options for tuning the Kubernetes client used by a Provider.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="argument_nodejs">
|
||||
<a href="#argument_nodejs" style="color: inherit; text-decoration: inherit;">argument</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="kubeclientsettings_nodejs">
|
||||
<a href="#kubeclientsettings_nodejs" style="color: inherit; text-decoration: inherit;">kube<wbr>Client<wbr>Settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#kubeclientsettings">Kube<wbr>Client<wbr>Settings<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Options for tuning the Kubernetes client used by a Provider.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="settings_nodejs">
|
||||
<a href="#settings_nodejs" style="color: inherit; text-decoration: inherit;">settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#layeredtype">Layered<wbr>Type<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}describing things{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="backup_kube_client_settings_python">
|
||||
<a href="#backup_kube_client_settings_python" style="color: inherit; text-decoration: inherit;">backup_<wbr>kube_<wbr>client_<wbr>settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#kubeclientsettings">Kube<wbr>Client<wbr>Settings<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Options for tuning the Kubernetes client used by a Provider.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="argument_python">
|
||||
<a href="#argument_python" style="color: inherit; text-decoration: inherit;">argument</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="kube_client_settings_python">
|
||||
<a href="#kube_client_settings_python" style="color: inherit; text-decoration: inherit;">kube_<wbr>client_<wbr>settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#kubeclientsettings">Kube<wbr>Client<wbr>Settings<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Options for tuning the Kubernetes client used by a Provider.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="settings_python">
|
||||
<a href="#settings_python" style="color: inherit; text-decoration: inherit;">settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#layeredtype">Layered<wbr>Type<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}describing things{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
|
||||
### Outputs
|
||||
|
||||
All [input](#inputs) properties are implicitly available as output properties. Additionally, the Foo resource produces the following output properties:
|
||||
|
||||
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<dl class="resources-properties"><dt class="property-"
|
||||
title="">
|
||||
<span id="id_csharp">
|
||||
<a href="#id_csharp" style="color: inherit; text-decoration: inherit;">Id</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The provider-assigned unique ID for this managed resource.{{% /md %}}</dd><dt class="property-"
|
||||
title="">
|
||||
<span id="defaultkubeclientsettings_csharp">
|
||||
<a href="#defaultkubeclientsettings_csharp" style="color: inherit; text-decoration: inherit;">Default<wbr>Kube<wbr>Client<wbr>Settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#kubeclientsettings">Kube<wbr>Client<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}A test for plain types{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<dl class="resources-properties"><dt class="property-"
|
||||
title="">
|
||||
<span id="id_go">
|
||||
<a href="#id_go" style="color: inherit; text-decoration: inherit;">Id</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The provider-assigned unique ID for this managed resource.{{% /md %}}</dd><dt class="property-"
|
||||
title="">
|
||||
<span id="defaultkubeclientsettings_go">
|
||||
<a href="#defaultkubeclientsettings_go" style="color: inherit; text-decoration: inherit;">Default<wbr>Kube<wbr>Client<wbr>Settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#kubeclientsettings">Kube<wbr>Client<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}A test for plain types{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<dl class="resources-properties"><dt class="property-"
|
||||
title="">
|
||||
<span id="id_nodejs">
|
||||
<a href="#id_nodejs" style="color: inherit; text-decoration: inherit;">id</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The provider-assigned unique ID for this managed resource.{{% /md %}}</dd><dt class="property-"
|
||||
title="">
|
||||
<span id="defaultkubeclientsettings_nodejs">
|
||||
<a href="#defaultkubeclientsettings_nodejs" style="color: inherit; text-decoration: inherit;">default<wbr>Kube<wbr>Client<wbr>Settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#kubeclientsettings">Kube<wbr>Client<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}A test for plain types{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<dl class="resources-properties"><dt class="property-"
|
||||
title="">
|
||||
<span id="id_python">
|
||||
<a href="#id_python" style="color: inherit; text-decoration: inherit;">id</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The provider-assigned unique ID for this managed resource.{{% /md %}}</dd><dt class="property-"
|
||||
title="">
|
||||
<span id="default_kube_client_settings_python">
|
||||
<a href="#default_kube_client_settings_python" style="color: inherit; text-decoration: inherit;">default_<wbr>kube_<wbr>client_<wbr>settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#kubeclientsettings">Kube<wbr>Client<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}A test for plain types{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Supporting Types
|
||||
|
||||
|
||||
|
||||
<h4 id="helmreleasesettings">Helm<wbr>Release<wbr>Settings</h4>
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="requiredarg_csharp">
|
||||
<a href="#requiredarg_csharp" style="color: inherit; text-decoration: inherit;">Required<wbr>Arg</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}to test required args{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="driver_csharp">
|
||||
<a href="#driver_csharp" style="color: inherit; text-decoration: inherit;">Driver</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The backend storage driver for Helm. Values are: configmap, secret, memory, sql.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="pluginspath_csharp">
|
||||
<a href="#pluginspath_csharp" style="color: inherit; text-decoration: inherit;">Plugins<wbr>Path</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The path to the helm plugins directory.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="requiredarg_go">
|
||||
<a href="#requiredarg_go" style="color: inherit; text-decoration: inherit;">Required<wbr>Arg</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}to test required args{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="driver_go">
|
||||
<a href="#driver_go" style="color: inherit; text-decoration: inherit;">Driver</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The backend storage driver for Helm. Values are: configmap, secret, memory, sql.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="pluginspath_go">
|
||||
<a href="#pluginspath_go" style="color: inherit; text-decoration: inherit;">Plugins<wbr>Path</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The path to the helm plugins directory.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="requiredarg_nodejs">
|
||||
<a href="#requiredarg_nodejs" style="color: inherit; text-decoration: inherit;">required<wbr>Arg</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}to test required args{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="driver_nodejs">
|
||||
<a href="#driver_nodejs" style="color: inherit; text-decoration: inherit;">driver</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The backend storage driver for Helm. Values are: configmap, secret, memory, sql.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="pluginspath_nodejs">
|
||||
<a href="#pluginspath_nodejs" style="color: inherit; text-decoration: inherit;">plugins<wbr>Path</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The path to the helm plugins directory.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="required_arg_python">
|
||||
<a href="#required_arg_python" style="color: inherit; text-decoration: inherit;">required_<wbr>arg</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}to test required args{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="driver_python">
|
||||
<a href="#driver_python" style="color: inherit; text-decoration: inherit;">driver</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The backend storage driver for Helm. Values are: configmap, secret, memory, sql.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="plugins_path_python">
|
||||
<a href="#plugins_path_python" style="color: inherit; text-decoration: inherit;">plugins_<wbr>path</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The path to the helm plugins directory.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
<h4 id="kubeclientsettings">Kube<wbr>Client<wbr>Settings</h4>
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="burst_csharp">
|
||||
<a href="#burst_csharp" style="color: inherit; text-decoration: inherit;">Burst</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">int</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Maximum burst for throttle. Default value is 10.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="qps_csharp">
|
||||
<a href="#qps_csharp" style="color: inherit; text-decoration: inherit;">Qps</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">double</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Maximum queries per second (QPS) to the API server from this client. Default value is 5.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="rectest_csharp">
|
||||
<a href="#rectest_csharp" style="color: inherit; text-decoration: inherit;">Rec<wbr>Test</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#kubeclientsettings">Kube<wbr>Client<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="burst_go">
|
||||
<a href="#burst_go" style="color: inherit; text-decoration: inherit;">Burst</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">int</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Maximum burst for throttle. Default value is 10.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="qps_go">
|
||||
<a href="#qps_go" style="color: inherit; text-decoration: inherit;">Qps</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">float64</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Maximum queries per second (QPS) to the API server from this client. Default value is 5.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="rectest_go">
|
||||
<a href="#rectest_go" style="color: inherit; text-decoration: inherit;">Rec<wbr>Test</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#kubeclientsettings">Kube<wbr>Client<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="burst_nodejs">
|
||||
<a href="#burst_nodejs" style="color: inherit; text-decoration: inherit;">burst</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">number</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Maximum burst for throttle. Default value is 10.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="qps_nodejs">
|
||||
<a href="#qps_nodejs" style="color: inherit; text-decoration: inherit;">qps</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">number</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Maximum queries per second (QPS) to the API server from this client. Default value is 5.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="rectest_nodejs">
|
||||
<a href="#rectest_nodejs" style="color: inherit; text-decoration: inherit;">rec<wbr>Test</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#kubeclientsettings">Kube<wbr>Client<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="burst_python">
|
||||
<a href="#burst_python" style="color: inherit; text-decoration: inherit;">burst</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">int</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Maximum burst for throttle. Default value is 10.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="qps_python">
|
||||
<a href="#qps_python" style="color: inherit; text-decoration: inherit;">qps</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">float</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Maximum queries per second (QPS) to the API server from this client. Default value is 5.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="rec_test_python">
|
||||
<a href="#rec_test_python" style="color: inherit; text-decoration: inherit;">rec_<wbr>test</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#kubeclientsettings">Kube<wbr>Client<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
<h4 id="layeredtype">Layered<wbr>Type</h4>
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="other_csharp">
|
||||
<a href="#other_csharp" style="color: inherit; text-decoration: inherit;">Other</a>
|
||||
</span>
|
||||
<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-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>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">double</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The answer to the question{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="plainother_csharp">
|
||||
<a href="#plainother_csharp" style="color: inherit; text-decoration: inherit;">Plain<wbr>Other</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#helmreleasesettings">Helm<wbr>Release<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Test how plain types interact{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="question_csharp">
|
||||
<a href="#question_csharp" style="color: inherit; text-decoration: inherit;">Question</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The question already answered{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="recursive_csharp">
|
||||
<a href="#recursive_csharp" style="color: inherit; text-decoration: inherit;">Recursive</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#layeredtype">Layered<wbr>Type</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="other_go">
|
||||
<a href="#other_go" style="color: inherit; text-decoration: inherit;">Other</a>
|
||||
</span>
|
||||
<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-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>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">float64</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The answer to the question{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="plainother_go">
|
||||
<a href="#plainother_go" style="color: inherit; text-decoration: inherit;">Plain<wbr>Other</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#helmreleasesettings">Helm<wbr>Release<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Test how plain types interact{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="question_go">
|
||||
<a href="#question_go" style="color: inherit; text-decoration: inherit;">Question</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The question already answered{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="recursive_go">
|
||||
<a href="#recursive_go" style="color: inherit; text-decoration: inherit;">Recursive</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#layeredtype">Layered<wbr>Type</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="other_nodejs">
|
||||
<a href="#other_nodejs" style="color: inherit; text-decoration: inherit;">other</a>
|
||||
</span>
|
||||
<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-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>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">number</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The answer to the question{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="plainother_nodejs">
|
||||
<a href="#plainother_nodejs" style="color: inherit; text-decoration: inherit;">plain<wbr>Other</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#helmreleasesettings">Helm<wbr>Release<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Test how plain types interact{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="question_nodejs">
|
||||
<a href="#question_nodejs" style="color: inherit; text-decoration: inherit;">question</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The question already answered{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="recursive_nodejs">
|
||||
<a href="#recursive_nodejs" style="color: inherit; text-decoration: inherit;">recursive</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#layeredtype">Layered<wbr>Type</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="other_python">
|
||||
<a href="#other_python" style="color: inherit; text-decoration: inherit;">other</a>
|
||||
</span>
|
||||
<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-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>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">float</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The answer to the question{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="plain_other_python">
|
||||
<a href="#plain_other_python" style="color: inherit; text-decoration: inherit;">plain_<wbr>other</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#helmreleasesettings">Helm<wbr>Release<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Test how plain types interact{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="question_python">
|
||||
<a href="#question_python" style="color: inherit; text-decoration: inherit;">question</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The question already answered{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="recursive_python">
|
||||
<a href="#recursive_python" style="color: inherit; text-decoration: inherit;">recursive</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#layeredtype">Layered<wbr>Type</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
|
||||
<h2 id="package-details">Package Details</h2>
|
||||
<dl class="package-details">
|
||||
<dt>Repository</dt>
|
||||
<dd><a href=""></a></dd>
|
||||
<dt>License</dt>
|
||||
<dd></dd>
|
||||
</dl>
|
||||
|
348
pkg/codegen/internal/test/testdata/plain-object-defaults/docs/funcwithalloptionalinputs/_index.md
vendored
Normal file
348
pkg/codegen/internal/test/testdata/plain-object-defaults/docs/funcwithalloptionalinputs/_index.md
vendored
Normal file
|
@ -0,0 +1,348 @@
|
|||
|
||||
---
|
||||
title: "funcWithAllOptionalInputs"
|
||||
title_tag: "example.funcWithAllOptionalInputs"
|
||||
meta_desc: "Documentation for the example.funcWithAllOptionalInputs function with examples, input properties, output properties, and supporting types."
|
||||
layout: api
|
||||
no_edit_this_page: true
|
||||
---
|
||||
|
||||
|
||||
|
||||
<!-- WARNING: this file was generated by test. -->
|
||||
<!-- Do not edit by hand unless you're certain you know what you are doing! -->
|
||||
|
||||
Check codegen of functions with all optional inputs.
|
||||
|
||||
|
||||
|
||||
|
||||
## Using funcWithAllOptionalInputs {#using}
|
||||
|
||||
Two invocation forms are available. The direct form accepts plain
|
||||
arguments and either blocks until the result value is available, or
|
||||
returns a Promise-wrapped result. The output form accepts
|
||||
Input-wrapped arguments and returns an Output-wrapped result.
|
||||
|
||||
{{< chooser language "typescript,python,go,csharp" / >}}
|
||||
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<div class="highlight"
|
||||
><pre class="chroma"><code class="language-typescript" data-lang="typescript"
|
||||
><span class="k">function </span>funcWithAllOptionalInputs<span class="p">(</span><span class="nx">args</span><span class="p">:</span> <span class="nx">FuncWithAllOptionalInputsArgs</span><span class="p">,</span> <span class="nx">opts</span><span class="p">?:</span> <span class="nx"><a href="/docs/reference/pkg/nodejs/pulumi/pulumi/#InvokeOptions">InvokeOptions</a></span><span class="p">): Promise<<span class="nx"><a href="#result">FuncWithAllOptionalInputsResult</a></span>></span
|
||||
><span class="k">
|
||||
function </span>funcWithAllOptionalInputsOutput<span class="p">(</span><span class="nx">args</span><span class="p">:</span> <span class="nx">FuncWithAllOptionalInputsOutputArgs</span><span class="p">,</span> <span class="nx">opts</span><span class="p">?:</span> <span class="nx"><a href="/docs/reference/pkg/nodejs/pulumi/pulumi/#InvokeOptions">InvokeOptions</a></span><span class="p">): Output<<span class="nx"><a href="#result">FuncWithAllOptionalInputsResult</a></span>></span
|
||||
></code></pre></div>
|
||||
{{% /choosable %}}
|
||||
|
||||
|
||||
{{% choosable language python %}}
|
||||
<div class="highlight"><pre class="chroma"><code class="language-python" data-lang="python"
|
||||
><span class="k">def </span>func_with_all_optional_inputs<span class="p">(</span><span class="nx">a</span><span class="p">:</span> <span class="nx">Optional[HelmReleaseSettings]</span> = None<span class="p">,</span>
|
||||
<span class="nx">b</span><span class="p">:</span> <span class="nx">Optional[str]</span> = None<span class="p">,</span>
|
||||
<span class="nx">opts</span><span class="p">:</span> <span class="nx"><a href="/docs/reference/pkg/python/pulumi/#pulumi.InvokeOptions">Optional[InvokeOptions]</a></span> = None<span class="p">) -></span> <span>FuncWithAllOptionalInputsResult</span
|
||||
><span class="k">
|
||||
def </span>func_with_all_optional_inputs_output<span class="p">(</span><span class="nx">a</span><span class="p">:</span> <span class="nx">Optional[pulumi.Input[HelmReleaseSettingsArgs]]</span> = None<span class="p">,</span>
|
||||
<span class="nx">b</span><span class="p">:</span> <span class="nx">Optional[pulumi.Input[str]]</span> = None<span class="p">,</span>
|
||||
<span class="nx">opts</span><span class="p">:</span> <span class="nx"><a href="/docs/reference/pkg/python/pulumi/#pulumi.InvokeOptions">Optional[InvokeOptions]</a></span> = None<span class="p">) -></span> <span>Output[FuncWithAllOptionalInputsResult]</span
|
||||
></code></pre></div>
|
||||
{{% /choosable %}}
|
||||
|
||||
|
||||
{{% choosable language go %}}
|
||||
<div class="highlight"><pre class="chroma"><code class="language-go" data-lang="go"
|
||||
><span class="k">func </span>FuncWithAllOptionalInputs<span class="p">(</span><span class="nx">ctx</span><span class="p"> *</span><span class="nx"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#Context">Context</a></span><span class="p">,</span> <span class="nx">args</span><span class="p"> *</span><span class="nx">FuncWithAllOptionalInputsArgs</span><span class="p">,</span> <span class="nx">opts</span><span class="p"> ...</span><span class="nx"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#InvokeOption">InvokeOption</a></span><span class="p">) (*<span class="nx"><a href="#result">FuncWithAllOptionalInputsResult</a></span>, error)</span
|
||||
><span class="k">
|
||||
func </span>FuncWithAllOptionalInputsOutput<span class="p">(</span><span class="nx">ctx</span><span class="p"> *</span><span class="nx"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#Context">Context</a></span><span class="p">,</span> <span class="nx">args</span><span class="p"> *</span><span class="nx">FuncWithAllOptionalInputsOutputArgs</span><span class="p">,</span> <span class="nx">opts</span><span class="p"> ...</span><span class="nx"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#InvokeOption">InvokeOption</a></span><span class="p">) FuncWithAllOptionalInputsResultOutput</span
|
||||
></code></pre></div>
|
||||
|
||||
> Note: This function is named `FuncWithAllOptionalInputs` in the Go SDK.
|
||||
|
||||
{{% /choosable %}}
|
||||
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<div class="highlight"><pre class="chroma"><code class="language-csharp" data-lang="csharp"><span class="k">public static class </span><span class="nx">FuncWithAllOptionalInputs </span><span class="p">
|
||||
{</span><span class="k">
|
||||
public static </span>Task<<span class="nx"><a href="#result">FuncWithAllOptionalInputsResult</a></span>> <span class="p">InvokeAsync(</span><span class="nx">FuncWithAllOptionalInputsArgs</span><span class="p"> </span><span class="nx">args<span class="p">,</span> <span class="nx"><a href="/docs/reference/pkg/dotnet/Pulumi/Pulumi.InvokeOptions.html">InvokeOptions</a></span><span class="p">? </span><span class="nx">opts = null<span class="p">)</span><span class="k">
|
||||
public static </span>Output<<span class="nx"><a href="#result">FuncWithAllOptionalInputsResult</a></span>> <span class="p">Invoke(</span><span class="nx">FuncWithAllOptionalInputsInvokeArgs</span><span class="p"> </span><span class="nx">args<span class="p">,</span> <span class="nx"><a href="/docs/reference/pkg/dotnet/Pulumi/Pulumi.InvokeOptions.html">InvokeOptions</a></span><span class="p">? </span><span class="nx">opts = null<span class="p">)</span><span class="p">
|
||||
}</span></code></pre></div>
|
||||
{{% /choosable %}}
|
||||
|
||||
|
||||
|
||||
The following arguments are supported:
|
||||
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="a_csharp">
|
||||
<a href="#a_csharp" style="color: inherit; text-decoration: inherit;">A</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#helmreleasesettings">Helm<wbr>Release<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Property A{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="b_csharp">
|
||||
<a href="#b_csharp" style="color: inherit; text-decoration: inherit;">B</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Property B{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="a_go">
|
||||
<a href="#a_go" style="color: inherit; text-decoration: inherit;">A</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#helmreleasesettings">Helm<wbr>Release<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Property A{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="b_go">
|
||||
<a href="#b_go" style="color: inherit; text-decoration: inherit;">B</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Property B{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="a_nodejs">
|
||||
<a href="#a_nodejs" style="color: inherit; text-decoration: inherit;">a</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#helmreleasesettings">Helm<wbr>Release<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Property A{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="b_nodejs">
|
||||
<a href="#b_nodejs" style="color: inherit; text-decoration: inherit;">b</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Property B{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="a_python">
|
||||
<a href="#a_python" style="color: inherit; text-decoration: inherit;">a</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#helmreleasesettings">Helm<wbr>Release<wbr>Settings</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Property A{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="b_python">
|
||||
<a href="#b_python" style="color: inherit; text-decoration: inherit;">b</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}Property B{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
|
||||
|
||||
|
||||
## funcWithAllOptionalInputs Result {#result}
|
||||
|
||||
The following output properties are available:
|
||||
|
||||
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<dl class="resources-properties"><dt class="property-"
|
||||
title="">
|
||||
<span id="r_csharp">
|
||||
<a href="#r_csharp" style="color: inherit; text-decoration: inherit;">R</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<dl class="resources-properties"><dt class="property-"
|
||||
title="">
|
||||
<span id="r_go">
|
||||
<a href="#r_go" style="color: inherit; text-decoration: inherit;">R</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<dl class="resources-properties"><dt class="property-"
|
||||
title="">
|
||||
<span id="r_nodejs">
|
||||
<a href="#r_nodejs" style="color: inherit; text-decoration: inherit;">r</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<dl class="resources-properties"><dt class="property-"
|
||||
title="">
|
||||
<span id="r_python">
|
||||
<a href="#r_python" style="color: inherit; text-decoration: inherit;">r</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
|
||||
|
||||
|
||||
## Supporting Types
|
||||
|
||||
|
||||
<h4 id="helmreleasesettings">Helm<wbr>Release<wbr>Settings</h4>
|
||||
|
||||
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="requiredarg_csharp">
|
||||
<a href="#requiredarg_csharp" style="color: inherit; text-decoration: inherit;">Required<wbr>Arg</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}to test required args{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="driver_csharp">
|
||||
<a href="#driver_csharp" style="color: inherit; text-decoration: inherit;">Driver</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The backend storage driver for Helm. Values are: configmap, secret, memory, sql.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="pluginspath_csharp">
|
||||
<a href="#pluginspath_csharp" style="color: inherit; text-decoration: inherit;">Plugins<wbr>Path</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The path to the helm plugins directory.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="requiredarg_go">
|
||||
<a href="#requiredarg_go" style="color: inherit; text-decoration: inherit;">Required<wbr>Arg</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}to test required args{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="driver_go">
|
||||
<a href="#driver_go" style="color: inherit; text-decoration: inherit;">Driver</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The backend storage driver for Helm. Values are: configmap, secret, memory, sql.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="pluginspath_go">
|
||||
<a href="#pluginspath_go" style="color: inherit; text-decoration: inherit;">Plugins<wbr>Path</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The path to the helm plugins directory.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="requiredarg_nodejs">
|
||||
<a href="#requiredarg_nodejs" style="color: inherit; text-decoration: inherit;">required<wbr>Arg</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}to test required args{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="driver_nodejs">
|
||||
<a href="#driver_nodejs" style="color: inherit; text-decoration: inherit;">driver</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The backend storage driver for Helm. Values are: configmap, secret, memory, sql.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="pluginspath_nodejs">
|
||||
<a href="#pluginspath_nodejs" style="color: inherit; text-decoration: inherit;">plugins<wbr>Path</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The path to the helm plugins directory.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="required_arg_python">
|
||||
<a href="#required_arg_python" style="color: inherit; text-decoration: inherit;">required_<wbr>arg</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}to test required args{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="driver_python">
|
||||
<a href="#driver_python" style="color: inherit; text-decoration: inherit;">driver</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The backend storage driver for Helm. Values are: configmap, secret, memory, sql.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="plugins_path_python">
|
||||
<a href="#plugins_path_python" style="color: inherit; text-decoration: inherit;">plugins_<wbr>path</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The path to the helm plugins directory.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2 id="package-details">Package Details</h2>
|
||||
<dl class="package-details">
|
||||
<dt>Repository</dt>
|
||||
<dd><a href=""></a></dd>
|
||||
<dt>License</dt>
|
||||
<dd></dd>
|
||||
</dl>
|
||||
|
23
pkg/codegen/internal/test/testdata/plain-object-defaults/docs/mod1/_index.md
vendored
Normal file
23
pkg/codegen/internal/test/testdata/plain-object-defaults/docs/mod1/_index.md
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
---
|
||||
title: "mod1"
|
||||
title_tag: "example.mod1"
|
||||
meta_desc: "Explore the resources and functions of the example.mod1 module."
|
||||
layout: api
|
||||
no_edit_this_page: true
|
||||
---
|
||||
|
||||
<!-- WARNING: this file was generated by test. -->
|
||||
<!-- Do not edit by hand unless you're certain you know what you are doing! -->
|
||||
|
||||
Explore the resources and functions of the example.mod1 module.
|
||||
|
||||
<h2 id="package-details">Package Details</h2>
|
||||
<dl class="package-details">
|
||||
<dt>Repository</dt>
|
||||
<dd><a href=""></a></dd>
|
||||
<dt>License</dt>
|
||||
<dd></dd>
|
||||
<dt>Version</dt>
|
||||
<dd>0.0.1</dd>
|
||||
</dl>
|
||||
|
23
pkg/codegen/internal/test/testdata/plain-object-defaults/docs/mod2/_index.md
vendored
Normal file
23
pkg/codegen/internal/test/testdata/plain-object-defaults/docs/mod2/_index.md
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
---
|
||||
title: "mod2"
|
||||
title_tag: "example.mod2"
|
||||
meta_desc: "Explore the resources and functions of the example.mod2 module."
|
||||
layout: api
|
||||
no_edit_this_page: true
|
||||
---
|
||||
|
||||
<!-- WARNING: this file was generated by test. -->
|
||||
<!-- Do not edit by hand unless you're certain you know what you are doing! -->
|
||||
|
||||
Explore the resources and functions of the example.mod2 module.
|
||||
|
||||
<h2 id="package-details">Package Details</h2>
|
||||
<dl class="package-details">
|
||||
<dt>Repository</dt>
|
||||
<dd><a href=""></a></dd>
|
||||
<dt>License</dt>
|
||||
<dd></dd>
|
||||
<dt>Version</dt>
|
||||
<dd>0.0.1</dd>
|
||||
</dl>
|
||||
|
557
pkg/codegen/internal/test/testdata/plain-object-defaults/docs/moduletest/_index.md
vendored
Normal file
557
pkg/codegen/internal/test/testdata/plain-object-defaults/docs/moduletest/_index.md
vendored
Normal file
|
@ -0,0 +1,557 @@
|
|||
|
||||
---
|
||||
title: "ModuleTest"
|
||||
title_tag: "example.ModuleTest"
|
||||
meta_desc: "Documentation for the example.ModuleTest resource with examples, input properties, output properties, lookup functions, and supporting types."
|
||||
layout: api
|
||||
no_edit_this_page: true
|
||||
---
|
||||
|
||||
|
||||
|
||||
<!-- WARNING: this file was generated by test. -->
|
||||
<!-- Do not edit by hand unless you're certain you know what you are doing! -->
|
||||
|
||||
|
||||
|
||||
|
||||
## Create a ModuleTest Resource {#create}
|
||||
{{< chooser language "typescript,python,go,csharp" / >}}
|
||||
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<div class="highlight"><pre class="chroma"><code class="language-typescript" data-lang="typescript"><span class="k">new </span><span class="nx">ModuleTest</span><span class="p">(</span><span class="nx">name</span><span class="p">:</span> <span class="nx">string</span><span class="p">,</span> <span class="nx">args</span><span class="p">?:</span> <span class="nx"><a href="#inputs">ModuleTestArgs</a></span><span class="p">,</span> <span class="nx">opts</span><span class="p">?:</span> <span class="nx"><a href="/docs/reference/pkg/nodejs/pulumi/pulumi/#CustomResourceOptions">CustomResourceOptions</a></span><span class="p">);</span></code></pre></div>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<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">ModuleTest</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">mod1</span><span class="p">:</span> <span class="nx">Optional[_mod1.TypArgs]</span> = None<span class="p">,</span>
|
||||
<span class="nx">val</span><span class="p">:</span> <span class="nx">Optional[TypArgs]</span> = None<span class="p">)</span>
|
||||
<span class=nd>@overload</span>
|
||||
<span class="k">def </span><span class="nx">ModuleTest</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">args</span><span class="p">:</span> <span class="nx"><a href="#inputs">Optional[ModuleTestArgs]</a></span> = None<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></code></pre></div>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<div class="highlight"><pre class="chroma"><code class="language-go" data-lang="go"><span class="k">func </span><span class="nx">NewModuleTest</span><span class="p">(</span><span class="nx">ctx</span><span class="p"> *</span><span class="nx"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#Context">Context</a></span><span class="p">,</span> <span class="nx">name</span><span class="p"> </span><span class="nx">string</span><span class="p">,</span> <span class="nx">args</span><span class="p"> *</span><span class="nx"><a href="#inputs">ModuleTestArgs</a></span><span class="p">,</span> <span class="nx">opts</span><span class="p"> ...</span><span class="nx"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#ResourceOption">ResourceOption</a></span><span class="p">) (*<span class="nx">ModuleTest</span>, error)</span></code></pre></div>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<div class="highlight"><pre class="chroma"><code class="language-csharp" data-lang="csharp"><span class="k">public </span><span class="nx">ModuleTest</span><span class="p">(</span><span class="nx">string</span><span class="p"> </span><span class="nx">name<span class="p">,</span> <span class="nx"><a href="#inputs">ModuleTestArgs</a></span><span class="p">? </span><span class="nx">args = null<span class="p">,</span> <span class="nx"><a href="/docs/reference/pkg/dotnet/Pulumi/Pulumi.CustomResourceOptions.html">CustomResourceOptions</a></span><span class="p">? </span><span class="nx">opts = null<span class="p">)</span></code></pre></div>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
|
||||
<dl class="resources-properties"><dt
|
||||
class="property-required" title="Required">
|
||||
<span>name</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>The unique name of the resource.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>args</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#inputs">ModuleTestArgs</a></span>
|
||||
</dt>
|
||||
<dd>The arguments to resource properties.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>opts</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="/docs/reference/pkg/nodejs/pulumi/pulumi/#CustomResourceOptions">CustomResourceOptions</a></span>
|
||||
</dt>
|
||||
<dd>Bag of options to control resource's behavior.</dd></dl>
|
||||
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
|
||||
<dl class="resources-properties"><dt
|
||||
class="property-required" title="Required">
|
||||
<span>resource_name</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>The unique name of the resource.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>args</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#inputs">ModuleTestArgs</a></span>
|
||||
</dt>
|
||||
<dd>The arguments to resource properties.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>opts</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="/docs/reference/pkg/python/pulumi/#pulumi.ResourceOptions">ResourceOptions</a></span>
|
||||
</dt>
|
||||
<dd>Bag of options to control resource's behavior.</dd></dl>
|
||||
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
|
||||
<dl class="resources-properties"><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>ctx</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#Context">Context</a></span>
|
||||
</dt>
|
||||
<dd>Context object for the current deployment.</dd><dt
|
||||
class="property-required" title="Required">
|
||||
<span>name</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>The unique name of the resource.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>args</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#inputs">ModuleTestArgs</a></span>
|
||||
</dt>
|
||||
<dd>The arguments to resource properties.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>opts</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#ResourceOption">ResourceOption</a></span>
|
||||
</dt>
|
||||
<dd>Bag of options to control resource's behavior.</dd></dl>
|
||||
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
|
||||
<dl class="resources-properties"><dt
|
||||
class="property-required" title="Required">
|
||||
<span>name</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>The unique name of the resource.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>args</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#inputs">ModuleTestArgs</a></span>
|
||||
</dt>
|
||||
<dd>The arguments to resource properties.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>opts</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="/docs/reference/pkg/dotnet/Pulumi/Pulumi.CustomResourceOptions.html">CustomResourceOptions</a></span>
|
||||
</dt>
|
||||
<dd>Bag of options to control resource's behavior.</dd></dl>
|
||||
|
||||
{{% /choosable %}}
|
||||
|
||||
## ModuleTest Resource Properties {#properties}
|
||||
|
||||
To learn more about resource properties and how to use them, see [Inputs and Outputs]({{< relref "/docs/intro/concepts/inputs-outputs" >}}) in the Architecture and Concepts docs.
|
||||
|
||||
### Inputs
|
||||
|
||||
The ModuleTest resource accepts the following [input]({{< relref "/docs/intro/concepts/inputs-outputs" >}}) properties:
|
||||
|
||||
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="mod1_csharp">
|
||||
<a href="#mod1_csharp" style="color: inherit; text-decoration: inherit;">Mod1</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">Pulumi.<wbr>Example.<wbr>Mod1.<wbr>Inputs.<wbr>Typ<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="val_csharp">
|
||||
<a href="#val_csharp" style="color: inherit; text-decoration: inherit;">Val</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">Typ<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="mod1_go">
|
||||
<a href="#mod1_go" style="color: inherit; text-decoration: inherit;">Mod1</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">Typ<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="val_go">
|
||||
<a href="#val_go" style="color: inherit; text-decoration: inherit;">Val</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">Typ<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="mod1_nodejs">
|
||||
<a href="#mod1_nodejs" style="color: inherit; text-decoration: inherit;">mod1</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">mod1Typ<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="val_nodejs">
|
||||
<a href="#val_nodejs" style="color: inherit; text-decoration: inherit;">val</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">Typ<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="mod1_python">
|
||||
<a href="#mod1_python" style="color: inherit; text-decoration: inherit;">mod1</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">Typ<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="val_python">
|
||||
<a href="#val_python" style="color: inherit; text-decoration: inherit;">val</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">Typ<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
|
||||
### Outputs
|
||||
|
||||
All [input](#inputs) properties are implicitly available as output properties. Additionally, the ModuleTest resource produces the following output properties:
|
||||
|
||||
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<dl class="resources-properties"><dt class="property-"
|
||||
title="">
|
||||
<span id="id_csharp">
|
||||
<a href="#id_csharp" style="color: inherit; text-decoration: inherit;">Id</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The provider-assigned unique ID for this managed resource.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<dl class="resources-properties"><dt class="property-"
|
||||
title="">
|
||||
<span id="id_go">
|
||||
<a href="#id_go" style="color: inherit; text-decoration: inherit;">Id</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The provider-assigned unique ID for this managed resource.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<dl class="resources-properties"><dt class="property-"
|
||||
title="">
|
||||
<span id="id_nodejs">
|
||||
<a href="#id_nodejs" style="color: inherit; text-decoration: inherit;">id</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The provider-assigned unique ID for this managed resource.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<dl class="resources-properties"><dt class="property-"
|
||||
title="">
|
||||
<span id="id_python">
|
||||
<a href="#id_python" style="color: inherit; text-decoration: inherit;">id</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The provider-assigned unique ID for this managed resource.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Supporting Types
|
||||
|
||||
|
||||
|
||||
<h4 id="typ">Typ</h4>
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="mod1_csharp">
|
||||
<a href="#mod1_csharp" style="color: inherit; text-decoration: inherit;">Mod1</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">Pulumi.<wbr>Example.<wbr>Mod1.<wbr>Inputs.<wbr>Typ</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="mod2_csharp">
|
||||
<a href="#mod2_csharp" style="color: inherit; text-decoration: inherit;">Mod2</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">Pulumi.<wbr>Example.<wbr>Mod2.<wbr>Inputs.<wbr>Typ</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="val_csharp">
|
||||
<a href="#val_csharp" style="color: inherit; text-decoration: inherit;">Val</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="mod1_go">
|
||||
<a href="#mod1_go" style="color: inherit; text-decoration: inherit;">Mod1</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">Typ</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="mod2_go">
|
||||
<a href="#mod2_go" style="color: inherit; text-decoration: inherit;">Mod2</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">Typ</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="val_go">
|
||||
<a href="#val_go" style="color: inherit; text-decoration: inherit;">Val</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="mod1_nodejs">
|
||||
<a href="#mod1_nodejs" style="color: inherit; text-decoration: inherit;">mod1</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">mod1Typ</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="mod2_nodejs">
|
||||
<a href="#mod2_nodejs" style="color: inherit; text-decoration: inherit;">mod2</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">mod2Typ</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="val_nodejs">
|
||||
<a href="#val_nodejs" style="color: inherit; text-decoration: inherit;">val</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="mod1_python">
|
||||
<a href="#mod1_python" style="color: inherit; text-decoration: inherit;">mod1</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">Typ</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="mod2_python">
|
||||
<a href="#mod2_python" style="color: inherit; text-decoration: inherit;">mod2</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">Typ</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="val_python">
|
||||
<a href="#val_python" style="color: inherit; text-decoration: inherit;">val</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
<h4 id="typ">Typ</h4>
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="val_csharp">
|
||||
<a href="#val_csharp" style="color: inherit; text-decoration: inherit;">Val</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="val_go">
|
||||
<a href="#val_go" style="color: inherit; text-decoration: inherit;">Val</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="val_nodejs">
|
||||
<a href="#val_nodejs" style="color: inherit; text-decoration: inherit;">val</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="val_python">
|
||||
<a href="#val_python" style="color: inherit; text-decoration: inherit;">val</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
<h4 id="typ">Typ</h4>
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="mod1_csharp">
|
||||
<a href="#mod1_csharp" style="color: inherit; text-decoration: inherit;">Mod1</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">Pulumi.<wbr>Example.<wbr>Mod1.<wbr>Inputs.<wbr>Typ</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="val_csharp">
|
||||
<a href="#val_csharp" style="color: inherit; text-decoration: inherit;">Val</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="mod1_go">
|
||||
<a href="#mod1_go" style="color: inherit; text-decoration: inherit;">Mod1</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">Typ</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="val_go">
|
||||
<a href="#val_go" style="color: inherit; text-decoration: inherit;">Val</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="mod1_nodejs">
|
||||
<a href="#mod1_nodejs" style="color: inherit; text-decoration: inherit;">mod1</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">mod1Typ</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="val_nodejs">
|
||||
<a href="#val_nodejs" style="color: inherit; text-decoration: inherit;">val</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="mod1_python">
|
||||
<a href="#mod1_python" style="color: inherit; text-decoration: inherit;">mod1</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#typ">Typ</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="val_python">
|
||||
<a href="#val_python" style="color: inherit; text-decoration: inherit;">val</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
|
||||
<h2 id="package-details">Package Details</h2>
|
||||
<dl class="package-details">
|
||||
<dt>Repository</dt>
|
||||
<dd><a href=""></a></dd>
|
||||
<dt>License</dt>
|
||||
<dd></dd>
|
||||
</dl>
|
||||
|
394
pkg/codegen/internal/test/testdata/plain-object-defaults/docs/provider/_index.md
vendored
Normal file
394
pkg/codegen/internal/test/testdata/plain-object-defaults/docs/provider/_index.md
vendored
Normal file
|
@ -0,0 +1,394 @@
|
|||
|
||||
---
|
||||
title: "Provider"
|
||||
title_tag: "example.Provider"
|
||||
meta_desc: "Documentation for the example.Provider resource with examples, input properties, output properties, lookup functions, and supporting types."
|
||||
layout: api
|
||||
no_edit_this_page: true
|
||||
---
|
||||
|
||||
|
||||
|
||||
<!-- WARNING: this file was generated by test. -->
|
||||
<!-- Do not edit by hand unless you're certain you know what you are doing! -->
|
||||
|
||||
The provider type for the kubernetes package.
|
||||
|
||||
|
||||
|
||||
|
||||
## Create a Provider Resource {#create}
|
||||
{{< chooser language "typescript,python,go,csharp" / >}}
|
||||
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<div class="highlight"><pre class="chroma"><code class="language-typescript" data-lang="typescript"><span class="k">new </span><span class="nx">Provider</span><span class="p">(</span><span class="nx">name</span><span class="p">:</span> <span class="nx">string</span><span class="p">,</span> <span class="nx">args</span><span class="p">?:</span> <span class="nx"><a href="#inputs">ProviderArgs</a></span><span class="p">,</span> <span class="nx">opts</span><span class="p">?:</span> <span class="nx"><a href="/docs/reference/pkg/nodejs/pulumi/pulumi/#CustomResourceOptions">CustomResourceOptions</a></span><span class="p">);</span></code></pre></div>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<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">Provider</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">helm_release_settings</span><span class="p">:</span> <span class="nx">Optional[HelmReleaseSettingsArgs]</span> = None<span class="p">)</span>
|
||||
<span class=nd>@overload</span>
|
||||
<span class="k">def </span><span class="nx">Provider</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">args</span><span class="p">:</span> <span class="nx"><a href="#inputs">Optional[ProviderArgs]</a></span> = None<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></code></pre></div>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<div class="highlight"><pre class="chroma"><code class="language-go" data-lang="go"><span class="k">func </span><span class="nx">NewProvider</span><span class="p">(</span><span class="nx">ctx</span><span class="p"> *</span><span class="nx"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#Context">Context</a></span><span class="p">,</span> <span class="nx">name</span><span class="p"> </span><span class="nx">string</span><span class="p">,</span> <span class="nx">args</span><span class="p"> *</span><span class="nx"><a href="#inputs">ProviderArgs</a></span><span class="p">,</span> <span class="nx">opts</span><span class="p"> ...</span><span class="nx"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#ResourceOption">ResourceOption</a></span><span class="p">) (*<span class="nx">Provider</span>, error)</span></code></pre></div>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<div class="highlight"><pre class="chroma"><code class="language-csharp" data-lang="csharp"><span class="k">public </span><span class="nx">Provider</span><span class="p">(</span><span class="nx">string</span><span class="p"> </span><span class="nx">name<span class="p">,</span> <span class="nx"><a href="#inputs">ProviderArgs</a></span><span class="p">? </span><span class="nx">args = null<span class="p">,</span> <span class="nx"><a href="/docs/reference/pkg/dotnet/Pulumi/Pulumi.CustomResourceOptions.html">CustomResourceOptions</a></span><span class="p">? </span><span class="nx">opts = null<span class="p">)</span></code></pre></div>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
|
||||
<dl class="resources-properties"><dt
|
||||
class="property-required" title="Required">
|
||||
<span>name</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>The unique name of the resource.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>args</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#inputs">ProviderArgs</a></span>
|
||||
</dt>
|
||||
<dd>The arguments to resource properties.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>opts</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="/docs/reference/pkg/nodejs/pulumi/pulumi/#CustomResourceOptions">CustomResourceOptions</a></span>
|
||||
</dt>
|
||||
<dd>Bag of options to control resource's behavior.</dd></dl>
|
||||
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
|
||||
<dl class="resources-properties"><dt
|
||||
class="property-required" title="Required">
|
||||
<span>resource_name</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>The unique name of the resource.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>args</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#inputs">ProviderArgs</a></span>
|
||||
</dt>
|
||||
<dd>The arguments to resource properties.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>opts</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="/docs/reference/pkg/python/pulumi/#pulumi.ResourceOptions">ResourceOptions</a></span>
|
||||
</dt>
|
||||
<dd>Bag of options to control resource's behavior.</dd></dl>
|
||||
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
|
||||
<dl class="resources-properties"><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>ctx</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#Context">Context</a></span>
|
||||
</dt>
|
||||
<dd>Context object for the current deployment.</dd><dt
|
||||
class="property-required" title="Required">
|
||||
<span>name</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>The unique name of the resource.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>args</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#inputs">ProviderArgs</a></span>
|
||||
</dt>
|
||||
<dd>The arguments to resource properties.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>opts</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#ResourceOption">ResourceOption</a></span>
|
||||
</dt>
|
||||
<dd>Bag of options to control resource's behavior.</dd></dl>
|
||||
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
|
||||
<dl class="resources-properties"><dt
|
||||
class="property-required" title="Required">
|
||||
<span>name</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>The unique name of the resource.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>args</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#inputs">ProviderArgs</a></span>
|
||||
</dt>
|
||||
<dd>The arguments to resource properties.</dd><dt
|
||||
class="property-optional" title="Optional">
|
||||
<span>opts</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="/docs/reference/pkg/dotnet/Pulumi/Pulumi.CustomResourceOptions.html">CustomResourceOptions</a></span>
|
||||
</dt>
|
||||
<dd>Bag of options to control resource's behavior.</dd></dl>
|
||||
|
||||
{{% /choosable %}}
|
||||
|
||||
## Provider Resource Properties {#properties}
|
||||
|
||||
To learn more about resource properties and how to use them, see [Inputs and Outputs]({{< relref "/docs/intro/concepts/inputs-outputs" >}}) in the Architecture and Concepts docs.
|
||||
|
||||
### Inputs
|
||||
|
||||
The Provider resource accepts the following [input]({{< relref "/docs/intro/concepts/inputs-outputs" >}}) properties:
|
||||
|
||||
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="helmreleasesettings_csharp">
|
||||
<a href="#helmreleasesettings_csharp" style="color: inherit; text-decoration: inherit;">Helm<wbr>Release<wbr>Settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#helmreleasesettings">Helm<wbr>Release<wbr>Settings<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}BETA FEATURE - Options to configure the Helm Release resource.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="helmreleasesettings_go">
|
||||
<a href="#helmreleasesettings_go" style="color: inherit; text-decoration: inherit;">Helm<wbr>Release<wbr>Settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#helmreleasesettings">Helm<wbr>Release<wbr>Settings<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}BETA FEATURE - Options to configure the Helm Release resource.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="helmreleasesettings_nodejs">
|
||||
<a href="#helmreleasesettings_nodejs" style="color: inherit; text-decoration: inherit;">helm<wbr>Release<wbr>Settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#helmreleasesettings">Helm<wbr>Release<wbr>Settings<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}BETA FEATURE - Options to configure the Helm Release resource.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<dl class="resources-properties"><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="helm_release_settings_python">
|
||||
<a href="#helm_release_settings_python" style="color: inherit; text-decoration: inherit;">helm_<wbr>release_<wbr>settings</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type"><a href="#helmreleasesettings">Helm<wbr>Release<wbr>Settings<wbr>Args</a></span>
|
||||
</dt>
|
||||
<dd>{{% md %}}BETA FEATURE - Options to configure the Helm Release resource.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
|
||||
### Outputs
|
||||
|
||||
All [input](#inputs) properties are implicitly available as output properties. Additionally, the Provider resource produces the following output properties:
|
||||
|
||||
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<dl class="resources-properties"><dt class="property-"
|
||||
title="">
|
||||
<span id="id_csharp">
|
||||
<a href="#id_csharp" style="color: inherit; text-decoration: inherit;">Id</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The provider-assigned unique ID for this managed resource.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<dl class="resources-properties"><dt class="property-"
|
||||
title="">
|
||||
<span id="id_go">
|
||||
<a href="#id_go" style="color: inherit; text-decoration: inherit;">Id</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The provider-assigned unique ID for this managed resource.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<dl class="resources-properties"><dt class="property-"
|
||||
title="">
|
||||
<span id="id_nodejs">
|
||||
<a href="#id_nodejs" style="color: inherit; text-decoration: inherit;">id</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The provider-assigned unique ID for this managed resource.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<dl class="resources-properties"><dt class="property-"
|
||||
title="">
|
||||
<span id="id_python">
|
||||
<a href="#id_python" style="color: inherit; text-decoration: inherit;">id</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The provider-assigned unique ID for this managed resource.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Supporting Types
|
||||
|
||||
|
||||
|
||||
<h4 id="helmreleasesettings">Helm<wbr>Release<wbr>Settings</h4>
|
||||
|
||||
{{% choosable language csharp %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="requiredarg_csharp">
|
||||
<a href="#requiredarg_csharp" style="color: inherit; text-decoration: inherit;">Required<wbr>Arg</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}to test required args{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="driver_csharp">
|
||||
<a href="#driver_csharp" style="color: inherit; text-decoration: inherit;">Driver</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The backend storage driver for Helm. Values are: configmap, secret, memory, sql.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="pluginspath_csharp">
|
||||
<a href="#pluginspath_csharp" style="color: inherit; text-decoration: inherit;">Plugins<wbr>Path</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The path to the helm plugins directory.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language go %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="requiredarg_go">
|
||||
<a href="#requiredarg_go" style="color: inherit; text-decoration: inherit;">Required<wbr>Arg</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}to test required args{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="driver_go">
|
||||
<a href="#driver_go" style="color: inherit; text-decoration: inherit;">Driver</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The backend storage driver for Helm. Values are: configmap, secret, memory, sql.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="pluginspath_go">
|
||||
<a href="#pluginspath_go" style="color: inherit; text-decoration: inherit;">Plugins<wbr>Path</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The path to the helm plugins directory.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language nodejs %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="requiredarg_nodejs">
|
||||
<a href="#requiredarg_nodejs" style="color: inherit; text-decoration: inherit;">required<wbr>Arg</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}to test required args{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="driver_nodejs">
|
||||
<a href="#driver_nodejs" style="color: inherit; text-decoration: inherit;">driver</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The backend storage driver for Helm. Values are: configmap, secret, memory, sql.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="pluginspath_nodejs">
|
||||
<a href="#pluginspath_nodejs" style="color: inherit; text-decoration: inherit;">plugins<wbr>Path</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">string</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The path to the helm plugins directory.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
{{% choosable language python %}}
|
||||
<dl class="resources-properties"><dt class="property-required"
|
||||
title="Required">
|
||||
<span id="required_arg_python">
|
||||
<a href="#required_arg_python" style="color: inherit; text-decoration: inherit;">required_<wbr>arg</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}to test required args{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="driver_python">
|
||||
<a href="#driver_python" style="color: inherit; text-decoration: inherit;">driver</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The backend storage driver for Helm. Values are: configmap, secret, memory, sql.{{% /md %}}</dd><dt class="property-optional"
|
||||
title="Optional">
|
||||
<span id="plugins_path_python">
|
||||
<a href="#plugins_path_python" style="color: inherit; text-decoration: inherit;">plugins_<wbr>path</a>
|
||||
</span>
|
||||
<span class="property-indicator"></span>
|
||||
<span class="property-type">str</span>
|
||||
</dt>
|
||||
<dd>{{% md %}}The path to the helm plugins directory.{{% /md %}}</dd></dl>
|
||||
{{% /choosable %}}
|
||||
|
||||
|
||||
<h2 id="package-details">Package Details</h2>
|
||||
<dl class="package-details">
|
||||
<dt>Repository</dt>
|
||||
<dd><a href=""></a></dd>
|
||||
<dt>License</dt>
|
||||
<dd></dd>
|
||||
</dl>
|
||||
|
94
pkg/codegen/internal/test/testdata/plain-object-defaults/dotnet/Foo.cs
vendored
Normal file
94
pkg/codegen/internal/test/testdata/plain-object-defaults/dotnet/Foo.cs
vendored
Normal file
|
@ -0,0 +1,94 @@
|
|||
// *** 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
|
||||
{
|
||||
/// <summary>
|
||||
/// test new feature with resoruces
|
||||
/// </summary>
|
||||
[ExampleResourceType("example:index:Foo")]
|
||||
public partial class Foo : Pulumi.CustomResource
|
||||
{
|
||||
/// <summary>
|
||||
/// A test for plain types
|
||||
/// </summary>
|
||||
[Output("defaultKubeClientSettings")]
|
||||
public Output<Outputs.KubeClientSettings?> DefaultKubeClientSettings { get; private set; } = null!;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create a Foo resource with the given unique name, arguments, and options.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="name">The unique name of the resource</param>
|
||||
/// <param name="args">The arguments used to populate this resource's properties</param>
|
||||
/// <param name="options">A bag of options that control this resource's behavior</param>
|
||||
public Foo(string name, FooArgs args, CustomResourceOptions? options = null)
|
||||
: base("example:index:Foo", name, args ?? new FooArgs(), MakeResourceOptions(options, ""))
|
||||
{
|
||||
}
|
||||
|
||||
private Foo(string name, Input<string> id, CustomResourceOptions? options = null)
|
||||
: base("example:index:Foo", name, null, MakeResourceOptions(options, id))
|
||||
{
|
||||
}
|
||||
|
||||
private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
|
||||
{
|
||||
var defaultOptions = new CustomResourceOptions
|
||||
{
|
||||
Version = Utilities.Version,
|
||||
};
|
||||
var merged = CustomResourceOptions.Merge(defaultOptions, options);
|
||||
// Override the ID if one was specified for consistency with other language SDKs.
|
||||
merged.Id = id ?? merged.Id;
|
||||
return merged;
|
||||
}
|
||||
/// <summary>
|
||||
/// Get an existing Foo resource's state with the given name, ID, and optional extra
|
||||
/// properties used to qualify the lookup.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="name">The unique name of the resulting resource.</param>
|
||||
/// <param name="id">The unique provider ID of the resource to lookup.</param>
|
||||
/// <param name="options">A bag of options that control this resource's behavior</param>
|
||||
public static Foo Get(string name, Input<string> id, CustomResourceOptions? options = null)
|
||||
{
|
||||
return new Foo(name, id, options);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class FooArgs : Pulumi.ResourceArgs
|
||||
{
|
||||
[Input("argument")]
|
||||
public string? Argument { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Options for tuning the Kubernetes client used by a Provider.
|
||||
/// </summary>
|
||||
[Input("backupKubeClientSettings", required: true)]
|
||||
public Input<Inputs.KubeClientSettingsArgs> BackupKubeClientSettings { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Options for tuning the Kubernetes client used by a Provider.
|
||||
/// </summary>
|
||||
[Input("kubeClientSettings")]
|
||||
public Input<Inputs.KubeClientSettingsArgs>? KubeClientSettings { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// describing things
|
||||
/// </summary>
|
||||
[Input("settings")]
|
||||
public Input<Inputs.LayeredTypeArgs>? Settings { get; set; }
|
||||
|
||||
public FooArgs()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
81
pkg/codegen/internal/test/testdata/plain-object-defaults/dotnet/FuncWithAllOptionalInputs.cs
vendored
Normal file
81
pkg/codegen/internal/test/testdata/plain-object-defaults/dotnet/FuncWithAllOptionalInputs.cs
vendored
Normal file
|
@ -0,0 +1,81 @@
|
|||
// *** 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;
|
||||
using Pulumi.Utilities;
|
||||
|
||||
namespace Pulumi.Mypkg
|
||||
{
|
||||
public static class FuncWithAllOptionalInputs
|
||||
{
|
||||
/// <summary>
|
||||
/// Check codegen of functions with all optional inputs.
|
||||
/// </summary>
|
||||
public static Task<FuncWithAllOptionalInputsResult> InvokeAsync(FuncWithAllOptionalInputsArgs? args = null, InvokeOptions? options = null)
|
||||
=> Pulumi.Deployment.Instance.InvokeAsync<FuncWithAllOptionalInputsResult>("mypkg::funcWithAllOptionalInputs", args ?? new FuncWithAllOptionalInputsArgs(), options.WithVersion());
|
||||
|
||||
/// <summary>
|
||||
/// Check codegen of functions with all optional inputs.
|
||||
/// </summary>
|
||||
public static Output<FuncWithAllOptionalInputsResult> Invoke(FuncWithAllOptionalInputsInvokeArgs? args = null, InvokeOptions? options = null)
|
||||
=> Pulumi.Deployment.Instance.Invoke<FuncWithAllOptionalInputsResult>("mypkg::funcWithAllOptionalInputs", args ?? new FuncWithAllOptionalInputsInvokeArgs(), options.WithVersion());
|
||||
}
|
||||
|
||||
|
||||
public sealed class FuncWithAllOptionalInputsArgs : Pulumi.InvokeArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Property A
|
||||
/// </summary>
|
||||
[Input("a")]
|
||||
public Inputs.HelmReleaseSettings? A { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Property B
|
||||
/// </summary>
|
||||
[Input("b")]
|
||||
public string? B { get; set; }
|
||||
|
||||
public FuncWithAllOptionalInputsArgs()
|
||||
{
|
||||
B = "defValue";
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class FuncWithAllOptionalInputsInvokeArgs : Pulumi.InvokeArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Property A
|
||||
/// </summary>
|
||||
[Input("a")]
|
||||
public Input<Inputs.HelmReleaseSettingsArgs>? A { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Property B
|
||||
/// </summary>
|
||||
[Input("b")]
|
||||
public Input<string>? B { get; set; }
|
||||
|
||||
public FuncWithAllOptionalInputsInvokeArgs()
|
||||
{
|
||||
B = "defValue";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[OutputType]
|
||||
public sealed class FuncWithAllOptionalInputsResult
|
||||
{
|
||||
public readonly string R;
|
||||
|
||||
[OutputConstructor]
|
||||
private FuncWithAllOptionalInputsResult(string r)
|
||||
{
|
||||
R = r;
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue