github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/connect/getPrompt.go (about)

     1  // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
     2  // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
     3  
     4  package connect
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    11  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    12  )
    13  
    14  // Provides details about a specific Amazon Connect Prompt.
    15  //
    16  // ## Example Usage
    17  //
    18  // By `name`
    19  //
    20  // <!--Start PulumiCodeChooser -->
    21  // ```go
    22  // package main
    23  //
    24  // import (
    25  //
    26  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/connect"
    27  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    28  //
    29  // )
    30  //
    31  //	func main() {
    32  //		pulumi.Run(func(ctx *pulumi.Context) error {
    33  //			_, err := connect.GetPrompt(ctx, &connect.GetPromptArgs{
    34  //				InstanceId: "aaaaaaaa-bbbb-cccc-dddd-111111111111",
    35  //				Name:       "Beep.wav",
    36  //			}, nil)
    37  //			if err != nil {
    38  //				return err
    39  //			}
    40  //			return nil
    41  //		})
    42  //	}
    43  //
    44  // ```
    45  // <!--End PulumiCodeChooser -->
    46  func GetPrompt(ctx *pulumi.Context, args *GetPromptArgs, opts ...pulumi.InvokeOption) (*GetPromptResult, error) {
    47  	opts = internal.PkgInvokeDefaultOpts(opts)
    48  	var rv GetPromptResult
    49  	err := ctx.Invoke("aws:connect/getPrompt:getPrompt", args, &rv, opts...)
    50  	if err != nil {
    51  		return nil, err
    52  	}
    53  	return &rv, nil
    54  }
    55  
    56  // A collection of arguments for invoking getPrompt.
    57  type GetPromptArgs struct {
    58  	// Reference to the hosting Amazon Connect Instance
    59  	InstanceId string `pulumi:"instanceId"`
    60  	// Returns information on a specific Prompt by name
    61  	Name string `pulumi:"name"`
    62  }
    63  
    64  // A collection of values returned by getPrompt.
    65  type GetPromptResult struct {
    66  	// ARN of the Prompt.
    67  	Arn string `pulumi:"arn"`
    68  	// The provider-assigned unique ID for this managed resource.
    69  	Id         string `pulumi:"id"`
    70  	InstanceId string `pulumi:"instanceId"`
    71  	Name       string `pulumi:"name"`
    72  	// Identifier for the prompt.
    73  	PromptId string `pulumi:"promptId"`
    74  }
    75  
    76  func GetPromptOutput(ctx *pulumi.Context, args GetPromptOutputArgs, opts ...pulumi.InvokeOption) GetPromptResultOutput {
    77  	return pulumi.ToOutputWithContext(context.Background(), args).
    78  		ApplyT(func(v interface{}) (GetPromptResult, error) {
    79  			args := v.(GetPromptArgs)
    80  			r, err := GetPrompt(ctx, &args, opts...)
    81  			var s GetPromptResult
    82  			if r != nil {
    83  				s = *r
    84  			}
    85  			return s, err
    86  		}).(GetPromptResultOutput)
    87  }
    88  
    89  // A collection of arguments for invoking getPrompt.
    90  type GetPromptOutputArgs struct {
    91  	// Reference to the hosting Amazon Connect Instance
    92  	InstanceId pulumi.StringInput `pulumi:"instanceId"`
    93  	// Returns information on a specific Prompt by name
    94  	Name pulumi.StringInput `pulumi:"name"`
    95  }
    96  
    97  func (GetPromptOutputArgs) ElementType() reflect.Type {
    98  	return reflect.TypeOf((*GetPromptArgs)(nil)).Elem()
    99  }
   100  
   101  // A collection of values returned by getPrompt.
   102  type GetPromptResultOutput struct{ *pulumi.OutputState }
   103  
   104  func (GetPromptResultOutput) ElementType() reflect.Type {
   105  	return reflect.TypeOf((*GetPromptResult)(nil)).Elem()
   106  }
   107  
   108  func (o GetPromptResultOutput) ToGetPromptResultOutput() GetPromptResultOutput {
   109  	return o
   110  }
   111  
   112  func (o GetPromptResultOutput) ToGetPromptResultOutputWithContext(ctx context.Context) GetPromptResultOutput {
   113  	return o
   114  }
   115  
   116  // ARN of the Prompt.
   117  func (o GetPromptResultOutput) Arn() pulumi.StringOutput {
   118  	return o.ApplyT(func(v GetPromptResult) string { return v.Arn }).(pulumi.StringOutput)
   119  }
   120  
   121  // The provider-assigned unique ID for this managed resource.
   122  func (o GetPromptResultOutput) Id() pulumi.StringOutput {
   123  	return o.ApplyT(func(v GetPromptResult) string { return v.Id }).(pulumi.StringOutput)
   124  }
   125  
   126  func (o GetPromptResultOutput) InstanceId() pulumi.StringOutput {
   127  	return o.ApplyT(func(v GetPromptResult) string { return v.InstanceId }).(pulumi.StringOutput)
   128  }
   129  
   130  func (o GetPromptResultOutput) Name() pulumi.StringOutput {
   131  	return o.ApplyT(func(v GetPromptResult) string { return v.Name }).(pulumi.StringOutput)
   132  }
   133  
   134  // Identifier for the prompt.
   135  func (o GetPromptResultOutput) PromptId() pulumi.StringOutput {
   136  	return o.ApplyT(func(v GetPromptResult) string { return v.PromptId }).(pulumi.StringOutput)
   137  }
   138  
   139  func init() {
   140  	pulumi.RegisterOutputType(GetPromptResultOutput{})
   141  }