// *** WARNING: this file was generated by test. ***
// *** 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"
)

// Check codegen of functions with a Dict<str,str> parameter.
func FuncWithDictParam(ctx *pulumi.Context, args *FuncWithDictParamArgs, opts ...pulumi.InvokeOption) (*FuncWithDictParamResult, error) {
	var rv FuncWithDictParamResult
	err := ctx.Invoke("mypkg::funcWithDictParam", args, &rv, opts...)
	if err != nil {
		return nil, err
	}
	return &rv, nil
}

type FuncWithDictParamArgs struct {
	A map[string]string `pulumi:"a"`
	B *string           `pulumi:"b"`
}

type FuncWithDictParamResult struct {
	R string `pulumi:"r"`
}

func FuncWithDictParamOutput(ctx *pulumi.Context, args FuncWithDictParamOutputArgs, opts ...pulumi.InvokeOption) FuncWithDictParamResultOutput {
	return pulumi.ToOutputWithContext(context.Background(), args).
		ApplyT(func(v interface{}) (FuncWithDictParamResult, error) {
			args := v.(FuncWithDictParamArgs)
			r, err := FuncWithDictParam(ctx, &args, opts...)
			return *r, err
		}).(FuncWithDictParamResultOutput)
}

type FuncWithDictParamOutputArgs struct {
	A pulumi.StringMapInput `pulumi:"a"`
	B pulumi.StringPtrInput `pulumi:"b"`
}

func (FuncWithDictParamOutputArgs) ElementType() reflect.Type {
	return reflect.TypeOf((*FuncWithDictParamArgs)(nil)).Elem()
}

type FuncWithDictParamResultOutput struct{ *pulumi.OutputState }

func (FuncWithDictParamResultOutput) ElementType() reflect.Type {
	return reflect.TypeOf((*FuncWithDictParamResult)(nil)).Elem()
}

func (o FuncWithDictParamResultOutput) ToFuncWithDictParamResultOutput() FuncWithDictParamResultOutput {
	return o
}

func (o FuncWithDictParamResultOutput) ToFuncWithDictParamResultOutputWithContext(ctx context.Context) FuncWithDictParamResultOutput {
	return o
}

func (o FuncWithDictParamResultOutput) R() pulumi.StringOutput {
	return o.ApplyT(func(v FuncWithDictParamResult) string { return v.R }).(pulumi.StringOutput)
}

func init() {
	pulumi.RegisterOutputType(FuncWithDictParamResultOutput{})
}
