pulumi/pkg/codegen/internal/test/testdata/plain-object-disable-defaults/docs/funcwithalloptionalinputs/_index.md
Ian Wahbe 4b7985384c
[codegen/go] Call site defaults for Pulumi Object types (#8411)
* Add test case

* Fix tests

* Add test dependencies correctly

* Feed through error handling

* Include test output

* Get types to line up

* Add remaining test files

* Update changelog

* Correctly find type paths

* Handle transitive objects

* Handle required fields

* Add feature flag for go

* Add required+default test case

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

* Add more flags.

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

* Add plain object to env-helper test

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

* Handle plain types

* Handle function inputs

* Fix the indentation

* Handle output types correctly

* Remove unnecessary `!`

* Add test case

* Fix tests

* Add test dependencies correctly

* Feed through error handling

* Include test output

* Get types to line up

* Add remaining test files

* Update changelog

* Correctly find type paths

* Handle transitive objects

* Handle required fields

* Add required+default test case

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

* Add plain object to env-helper test

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

* Handle plain types

* Handle function inputs

* Fix the indentation

* Handle output types correctly

* Remove unnecessary `!`

* Start on `genPlainObjectDefaultFunc`

* Add missing change to fix test

* Run tests with merge

* Refactor out assign

* Merge in next _index.md diff

* Change method name to `Defaults`

* Handle enums correctly

* Another attempt at _index.md

* Make module generation deterministic

* Add checks for old values

* Insert defaults in resources

* Fix docs generation

Credit to @praneetloke

* Progress on adding defaults to Resource arguments

* Handle resource argument defaults

* Don't create defaults if disableObjectDefaults

* Rename test folder

* Add test for disable flag

* Fix disable test

* Update docs

* Abstract out nil comparisons

* Use reflection to test for empty values

* Simplify Ptr and pulumi.Any type handling

* Remove unused function

* Apply defaults to functions

* Update new test with master codegen

* Tests + nil check
2021-11-23 15:10:15 -08:00

16 KiB


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

Check codegen of functions with all optional inputs.

Using funcWithAllOptionalInputs

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 %}}

function funcWithAllOptionalInputs(args: FuncWithAllOptionalInputsArgs, opts?: InvokeOptions): Promise<FuncWithAllOptionalInputsResult>
function funcWithAllOptionalInputsOutput(args: FuncWithAllOptionalInputsOutputArgs, opts?: InvokeOptions): Output<FuncWithAllOptionalInputsResult>
{{% /choosable %}}

{{% choosable language python %}}

def func_with_all_optional_inputs(a: Optional[HelmReleaseSettings] = None,
                                  b: Optional[str] = None,
                                  opts: Optional[InvokeOptions] = None) -> FuncWithAllOptionalInputsResult
def func_with_all_optional_inputs_output(a: Optional[pulumi.Input[HelmReleaseSettingsArgs]] = None,
                                  b: Optional[pulumi.Input[str]] = None,
                                  opts: Optional[InvokeOptions] = None) -> Output[FuncWithAllOptionalInputsResult]
{{% /choosable %}}

{{% choosable language go %}}

func FuncWithAllOptionalInputs(ctx *Context, args *FuncWithAllOptionalInputsArgs, opts ...InvokeOption) (*FuncWithAllOptionalInputsResult, error)
func FuncWithAllOptionalInputsOutput(ctx *Context, args *FuncWithAllOptionalInputsOutputArgs, opts ...InvokeOption) FuncWithAllOptionalInputsResultOutput

> Note: This function is named FuncWithAllOptionalInputs in the Go SDK.

{{% /choosable %}}

{{% choosable language csharp %}}

public static class FuncWithAllOptionalInputs 
{
    public static Task<FuncWithAllOptionalInputsResult> InvokeAsync(FuncWithAllOptionalInputsArgs args, InvokeOptions? opts = null)
    public static Output<FuncWithAllOptionalInputsResult> Invoke(FuncWithAllOptionalInputsInvokeArgs args, InvokeOptions? opts = null)
}
{{% /choosable %}}

The following arguments are supported:

{{% choosable language csharp %}}

A HelmReleaseSettings
{{% md %}}Property A{{% /md %}}
B string
{{% md %}}Property B{{% /md %}}
{{% /choosable %}}

{{% choosable language go %}}

A HelmReleaseSettings
{{% md %}}Property A{{% /md %}}
B string
{{% md %}}Property B{{% /md %}}
{{% /choosable %}}

{{% choosable language nodejs %}}

a HelmReleaseSettings
{{% md %}}Property A{{% /md %}}
b string
{{% md %}}Property B{{% /md %}}
{{% /choosable %}}

{{% choosable language python %}}

a HelmReleaseSettings
{{% md %}}Property A{{% /md %}}
b str
{{% md %}}Property B{{% /md %}}
{{% /choosable %}}

funcWithAllOptionalInputs Result

The following output properties are available:

{{% choosable language csharp %}}

R string
{{% md %}}{{% /md %}}
{{% /choosable %}}

{{% choosable language go %}}

R string
{{% md %}}{{% /md %}}
{{% /choosable %}}

{{% choosable language nodejs %}}

r string
{{% md %}}{{% /md %}}
{{% /choosable %}}

{{% choosable language python %}}

r str
{{% md %}}{{% /md %}}
{{% /choosable %}}

Supporting Types

HelmReleaseSettings

{{% choosable language csharp %}}

RequiredArg string
{{% md %}}to test required args{{% /md %}}
Driver string
{{% md %}}The backend storage driver for Helm. Values are: configmap, secret, memory, sql.{{% /md %}}
PluginsPath string
{{% md %}}The path to the helm plugins directory.{{% /md %}}
{{% /choosable %}}

{{% choosable language go %}}

RequiredArg string
{{% md %}}to test required args{{% /md %}}
Driver string
{{% md %}}The backend storage driver for Helm. Values are: configmap, secret, memory, sql.{{% /md %}}
PluginsPath string
{{% md %}}The path to the helm plugins directory.{{% /md %}}
{{% /choosable %}}

{{% choosable language nodejs %}}

requiredArg string
{{% md %}}to test required args{{% /md %}}
driver string
{{% md %}}The backend storage driver for Helm. Values are: configmap, secret, memory, sql.{{% /md %}}
pluginsPath string
{{% md %}}The path to the helm plugins directory.{{% /md %}}
{{% /choosable %}}

{{% choosable language python %}}

required_arg str
{{% md %}}to test required args{{% /md %}}
driver str
{{% md %}}The backend storage driver for Helm. Values are: configmap, secret, memory, sql.{{% /md %}}
plugins_path str
{{% md %}}The path to the helm plugins directory.{{% /md %}}
{{% /choosable %}}

Package Details

Repository
License