pulumi/tests/testdata/codegen/output-funcs/go/mypkg/x/getBastionShareableLink.go

88 lines
3.3 KiB
Go

// Code generated by test DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package mypkg
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumix"
"output-funcs/mypkg/internal"
)
// Response for all the Bastion Shareable Link endpoints.
// API Version: 2020-11-01.
func GetBastionShareableLink(ctx *pulumi.Context, args *GetBastionShareableLinkArgs, opts ...pulumi.InvokeOption) (*GetBastionShareableLinkResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv GetBastionShareableLinkResult
err := ctx.Invoke("mypkg::getBastionShareableLink", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type GetBastionShareableLinkArgs struct {
// The name of the Bastion Host.
BastionHostName string `pulumi:"bastionHostName"`
// The name of the resource group.
ResourceGroupName string `pulumi:"resourceGroupName"`
// List of VM references.
Vms []BastionShareableLink `pulumi:"vms"`
}
// Response for all the Bastion Shareable Link endpoints.
type GetBastionShareableLinkResult struct {
// The URL to get the next set of results.
NextLink *string `pulumi:"nextLink"`
}
func GetBastionShareableLinkOutput(ctx *pulumi.Context, args GetBastionShareableLinkOutputArgs, opts ...pulumi.InvokeOption) GetBastionShareableLinkResultOutput {
outputResult := pulumix.ApplyErr[*GetBastionShareableLinkArgs](args.ToOutput(), func(plainArgs *GetBastionShareableLinkArgs) (*GetBastionShareableLinkResult, error) {
return GetBastionShareableLink(ctx, plainArgs, opts...)
})
return pulumix.Cast[GetBastionShareableLinkResultOutput, *GetBastionShareableLinkResult](outputResult)
}
type GetBastionShareableLinkOutputArgs struct {
// The name of the Bastion Host.
BastionHostName pulumix.Input[string] `pulumi:"bastionHostName"`
// The name of the resource group.
ResourceGroupName pulumix.Input[string] `pulumi:"resourceGroupName"`
// List of VM references.
Vms pulumix.Input[[]*BastionShareableLinkArgs] `pulumi:"vms"`
}
func (args GetBastionShareableLinkOutputArgs) ToOutput() pulumix.Output[*GetBastionShareableLinkArgs] {
allArgs := pulumix.All(
args.BastionHostName.ToOutput(context.Background()).AsAny(),
args.ResourceGroupName.ToOutput(context.Background()).AsAny(),
args.Vms.ToOutput(context.Background()).AsAny())
return pulumix.Apply[[]any](allArgs, func(resolvedArgs []interface{}) *GetBastionShareableLinkArgs {
return &GetBastionShareableLinkArgs{
BastionHostName: resolvedArgs[0].(string),
ResourceGroupName: resolvedArgs[1].(string),
Vms: resolvedArgs[2].([]BastionShareableLink),
}
})
}
type GetBastionShareableLinkResultOutput struct{ *pulumi.OutputState }
func (GetBastionShareableLinkResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetBastionShareableLinkResult)(nil)).Elem()
}
func (o GetBastionShareableLinkResultOutput) ToOutput(context.Context) pulumix.Output[*GetBastionShareableLinkResult] {
return pulumix.Output[*GetBastionShareableLinkResult]{
OutputState: o.OutputState,
}
}
func (o GetBastionShareableLinkResultOutput) NextLink() pulumix.Output[*string] {
return pulumix.Apply[*GetBastionShareableLinkResult](o, func(v *GetBastionShareableLinkResult) *string { return v.NextLink })
}