2022-04-19 16:39:23 +00:00
|
|
|
// Code generated by test DO NOT EDIT.
|
|
|
|
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
|
2021-08-23 20:46:09 +00:00
|
|
|
|
2021-09-23 17:42:20 +00:00
|
|
|
package mypkg
|
2021-08-23 20:46:09 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"reflect"
|
|
|
|
|
|
|
|
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
2023-08-28 16:42:37 +00:00
|
|
|
"github.com/pulumi/pulumi/sdk/v3/go/pulumix"
|
2023-06-14 16:34:49 +00:00
|
|
|
"output-funcs/mypkg/internal"
|
2021-08-23 20:46:09 +00:00
|
|
|
)
|
|
|
|
|
2021-09-23 17:42:20 +00:00
|
|
|
// Another failing example. A list of SSIS object metadata.
|
2021-08-23 20:46:09 +00:00
|
|
|
// API Version: 2018-06-01.
|
|
|
|
func GetIntegrationRuntimeObjectMetadatum(ctx *pulumi.Context, args *GetIntegrationRuntimeObjectMetadatumArgs, opts ...pulumi.InvokeOption) (*GetIntegrationRuntimeObjectMetadatumResult, error) {
|
2023-06-14 16:34:49 +00:00
|
|
|
opts = internal.PkgInvokeDefaultOpts(opts)
|
2021-08-23 20:46:09 +00:00
|
|
|
var rv GetIntegrationRuntimeObjectMetadatumResult
|
2021-09-23 17:42:20 +00:00
|
|
|
err := ctx.Invoke("mypkg::getIntegrationRuntimeObjectMetadatum", args, &rv, opts...)
|
2021-08-23 20:46:09 +00:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return &rv, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type GetIntegrationRuntimeObjectMetadatumArgs struct {
|
|
|
|
// The factory name.
|
|
|
|
FactoryName string `pulumi:"factoryName"`
|
|
|
|
// The integration runtime name.
|
|
|
|
IntegrationRuntimeName string `pulumi:"integrationRuntimeName"`
|
|
|
|
// Metadata path.
|
|
|
|
MetadataPath *string `pulumi:"metadataPath"`
|
|
|
|
// The resource group name.
|
|
|
|
ResourceGroupName string `pulumi:"resourceGroupName"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// A list of SSIS object metadata.
|
|
|
|
type GetIntegrationRuntimeObjectMetadatumResult struct {
|
|
|
|
// The link to the next page of results, if any remaining results exist.
|
|
|
|
NextLink *string `pulumi:"nextLink"`
|
|
|
|
// List of SSIS object metadata.
|
|
|
|
Value []interface{} `pulumi:"value"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func GetIntegrationRuntimeObjectMetadatumOutput(ctx *pulumi.Context, args GetIntegrationRuntimeObjectMetadatumOutputArgs, opts ...pulumi.InvokeOption) GetIntegrationRuntimeObjectMetadatumResultOutput {
|
|
|
|
return pulumi.ToOutputWithContext(context.Background(), args).
|
|
|
|
ApplyT(func(v interface{}) (GetIntegrationRuntimeObjectMetadatumResult, error) {
|
|
|
|
args := v.(GetIntegrationRuntimeObjectMetadatumArgs)
|
|
|
|
r, err := GetIntegrationRuntimeObjectMetadatum(ctx, &args, opts...)
|
[codegen/go] Update Go SDK function output to check for errors (#9274)
* [codegen/go] Update Go SDK function output to check for errors
Fixes https://github.com/pulumi/pulumi-aws/issues/1872.
This should result in the following sample output in the Go SDK:
```
func GetPolicyDocumentOutput(ctx *pulumi.Context, args GetPolicyDocumentOutputArgs, opts ...pulumi.InvokeOption) GetPolicyDocumentResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetPolicyDocumentResult, error) {
args := v.(GetPolicyDocumentArgs)
r, err := GetPolicyDocument(ctx, &args, opts...)
if err != nil {
return nil, err
}
if r == nil {
return nil, fmt.Errorf("expected either result or error to be nil, not both")
}
return *r, err
}).(GetPolicyDocumentResultOutput)
}
```
* Fix generated code panic on *nil (#9284)
* [codegen/go] Update Go SDK function output to check for errors
Fixes https://github.com/pulumi/pulumi-aws/issues/1872.
This should result in the following sample output in the Go SDK:
```
func GetPolicyDocumentOutput(ctx *pulumi.Context, args GetPolicyDocumentOutputArgs, opts ...pulumi.InvokeOption) GetPolicyDocumentResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetPolicyDocumentResult, error) {
args := v.(GetPolicyDocumentArgs)
r, err := GetPolicyDocument(ctx, &args, opts...)
if r != nil {
s = *r
}
return s, err
}).(GetPolicyDocumentResultOutput)
}
```
* Alternate fix to safeguard dereferencing nil
* Accept codegen changes in the test suite
Co-authored-by: Guinevere Saenger <guinevere@pulumi.com>
* Update CHANGELOG_PENDING.md
Co-authored-by: Anton Tayanovskyy <anton@pulumi.com>
2022-03-25 03:11:53 +00:00
|
|
|
var s GetIntegrationRuntimeObjectMetadatumResult
|
|
|
|
if r != nil {
|
|
|
|
s = *r
|
|
|
|
}
|
|
|
|
return s, err
|
2021-08-23 20:46:09 +00:00
|
|
|
}).(GetIntegrationRuntimeObjectMetadatumResultOutput)
|
|
|
|
}
|
|
|
|
|
|
|
|
type GetIntegrationRuntimeObjectMetadatumOutputArgs struct {
|
|
|
|
// The factory name.
|
|
|
|
FactoryName pulumi.StringInput `pulumi:"factoryName"`
|
|
|
|
// The integration runtime name.
|
|
|
|
IntegrationRuntimeName pulumi.StringInput `pulumi:"integrationRuntimeName"`
|
|
|
|
// Metadata path.
|
|
|
|
MetadataPath pulumi.StringPtrInput `pulumi:"metadataPath"`
|
|
|
|
// The resource group name.
|
|
|
|
ResourceGroupName pulumi.StringInput `pulumi:"resourceGroupName"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (GetIntegrationRuntimeObjectMetadatumOutputArgs) ElementType() reflect.Type {
|
|
|
|
return reflect.TypeOf((*GetIntegrationRuntimeObjectMetadatumArgs)(nil)).Elem()
|
|
|
|
}
|
|
|
|
|
|
|
|
// A list of SSIS object metadata.
|
2021-09-23 17:42:20 +00:00
|
|
|
type GetIntegrationRuntimeObjectMetadatumResultOutput struct{ *pulumi.OutputState }
|
2021-08-23 20:46:09 +00:00
|
|
|
|
|
|
|
func (GetIntegrationRuntimeObjectMetadatumResultOutput) ElementType() reflect.Type {
|
|
|
|
return reflect.TypeOf((*GetIntegrationRuntimeObjectMetadatumResult)(nil)).Elem()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o GetIntegrationRuntimeObjectMetadatumResultOutput) ToGetIntegrationRuntimeObjectMetadatumResultOutput() GetIntegrationRuntimeObjectMetadatumResultOutput {
|
|
|
|
return o
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o GetIntegrationRuntimeObjectMetadatumResultOutput) ToGetIntegrationRuntimeObjectMetadatumResultOutputWithContext(ctx context.Context) GetIntegrationRuntimeObjectMetadatumResultOutput {
|
|
|
|
return o
|
|
|
|
}
|
|
|
|
|
2023-08-28 16:42:37 +00:00
|
|
|
func (o GetIntegrationRuntimeObjectMetadatumResultOutput) ToOutput(ctx context.Context) pulumix.Output[GetIntegrationRuntimeObjectMetadatumResult] {
|
|
|
|
return pulumix.Output[GetIntegrationRuntimeObjectMetadatumResult]{
|
|
|
|
OutputState: o.OutputState,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-08-23 20:46:09 +00:00
|
|
|
// The link to the next page of results, if any remaining results exist.
|
|
|
|
func (o GetIntegrationRuntimeObjectMetadatumResultOutput) NextLink() pulumi.StringPtrOutput {
|
2021-09-23 17:42:20 +00:00
|
|
|
return o.ApplyT(func(v GetIntegrationRuntimeObjectMetadatumResult) *string { return v.NextLink }).(pulumi.StringPtrOutput)
|
2021-08-23 20:46:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// List of SSIS object metadata.
|
|
|
|
func (o GetIntegrationRuntimeObjectMetadatumResultOutput) Value() pulumi.ArrayOutput {
|
2021-09-23 17:42:20 +00:00
|
|
|
return o.ApplyT(func(v GetIntegrationRuntimeObjectMetadatumResult) []interface{} { return v.Value }).(pulumi.ArrayOutput)
|
2021-08-23 20:46:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
2021-09-23 17:42:20 +00:00
|
|
|
pulumi.RegisterOutputType(GetIntegrationRuntimeObjectMetadatumResultOutput{})
|
2021-08-23 20:46:09 +00:00
|
|
|
}
|