1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package lexmodelbuildingservice
4
5import (
6	"context"
7	awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
8	"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
9	"github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12	"time"
13)
14
15// Returns information about the association between an Amazon Lex bot and a
16// messaging platform. This operation requires permissions for the
17// lex:GetBotChannelAssociation action.
18func (c *Client) GetBotChannelAssociation(ctx context.Context, params *GetBotChannelAssociationInput, optFns ...func(*Options)) (*GetBotChannelAssociationOutput, error) {
19	if params == nil {
20		params = &GetBotChannelAssociationInput{}
21	}
22
23	result, metadata, err := c.invokeOperation(ctx, "GetBotChannelAssociation", params, optFns, addOperationGetBotChannelAssociationMiddlewares)
24	if err != nil {
25		return nil, err
26	}
27
28	out := result.(*GetBotChannelAssociationOutput)
29	out.ResultMetadata = metadata
30	return out, nil
31}
32
33type GetBotChannelAssociationInput struct {
34
35	// An alias pointing to the specific version of the Amazon Lex bot to which this
36	// association is being made.
37	//
38	// This member is required.
39	BotAlias *string
40
41	// The name of the Amazon Lex bot.
42	//
43	// This member is required.
44	BotName *string
45
46	// The name of the association between the bot and the channel. The name is case
47	// sensitive.
48	//
49	// This member is required.
50	Name *string
51}
52
53type GetBotChannelAssociationOutput struct {
54
55	// An alias pointing to the specific version of the Amazon Lex bot to which this
56	// association is being made.
57	BotAlias *string
58
59	// Provides information that the messaging platform needs to communicate with the
60	// Amazon Lex bot.
61	BotConfiguration map[string]string
62
63	// The name of the Amazon Lex bot.
64	BotName *string
65
66	// The date that the association between the bot and the channel was created.
67	CreatedDate *time.Time
68
69	// A description of the association between the bot and the channel.
70	Description *string
71
72	// If status is FAILED, Amazon Lex provides the reason that it failed to create the
73	// association.
74	FailureReason *string
75
76	// The name of the association between the bot and the channel.
77	Name *string
78
79	// The status of the bot channel.
80	//
81	// * CREATED - The channel has been created and is
82	// ready for use.
83	//
84	// * IN_PROGRESS - Channel creation is in progress.
85	//
86	// * FAILED -
87	// There was an error creating the channel. For information about the reason for
88	// the failure, see the failureReason field.
89	Status types.ChannelStatus
90
91	// The type of the messaging platform.
92	Type types.ChannelType
93
94	// Metadata pertaining to the operation's result.
95	ResultMetadata middleware.Metadata
96}
97
98func addOperationGetBotChannelAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) {
99	err = stack.Serialize.Add(&awsRestjson1_serializeOpGetBotChannelAssociation{}, middleware.After)
100	if err != nil {
101		return err
102	}
103	err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetBotChannelAssociation{}, middleware.After)
104	if err != nil {
105		return err
106	}
107	if err = addSetLoggerMiddleware(stack, options); err != nil {
108		return err
109	}
110	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
111		return err
112	}
113	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
114		return err
115	}
116	if err = addResolveEndpointMiddleware(stack, options); err != nil {
117		return err
118	}
119	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
120		return err
121	}
122	if err = addRetryMiddlewares(stack, options); err != nil {
123		return err
124	}
125	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
126		return err
127	}
128	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
129		return err
130	}
131	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
132		return err
133	}
134	if err = addClientUserAgent(stack); err != nil {
135		return err
136	}
137	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
138		return err
139	}
140	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
141		return err
142	}
143	if err = addOpGetBotChannelAssociationValidationMiddleware(stack); err != nil {
144		return err
145	}
146	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetBotChannelAssociation(options.Region), middleware.Before); err != nil {
147		return err
148	}
149	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
150		return err
151	}
152	if err = addResponseErrorMiddleware(stack); err != nil {
153		return err
154	}
155	if err = addRequestResponseLogging(stack, options); err != nil {
156		return err
157	}
158	return nil
159}
160
161func newServiceMetadataMiddleware_opGetBotChannelAssociation(region string) *awsmiddleware.RegisterServiceMetadata {
162	return &awsmiddleware.RegisterServiceMetadata{
163		Region:        region,
164		ServiceID:     ServiceID,
165		SigningName:   "lex",
166		OperationName: "GetBotChannelAssociation",
167	}
168}
169