/
api_op_GetBotChannelAssociations.go
110 lines (93 loc) · 4.04 KB
/
api_op_GetBotChannelAssociations.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
// Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice/types"
"github.com/awslabs/smithy-go/middleware"
smithyhttp "github.com/awslabs/smithy-go/transport/http"
)
// Returns a list of all of the channels associated with the specified bot. The
// GetBotChannelAssociations operation requires permissions for the
// lex:GetBotChannelAssociations action.
func (c *Client) GetBotChannelAssociations(ctx context.Context, params *GetBotChannelAssociationsInput, optFns ...func(*Options)) (*GetBotChannelAssociationsOutput, error) {
if params == nil {
params = &GetBotChannelAssociationsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetBotChannelAssociations", params, optFns, addOperationGetBotChannelAssociationsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetBotChannelAssociationsOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetBotChannelAssociationsInput struct {
// An alias pointing to the specific version of the Amazon Lex bot to which this
// association is being made.
//
// This member is required.
BotAlias *string
// The name of the Amazon Lex bot in the association.
//
// This member is required.
BotName *string
// The maximum number of associations to return in the response. The default is 50.
MaxResults *int32
// Substring to match in channel association names. An association will be returned
// if any part of its name matches the substring. For example, "xyz" matches both
// "xyzabc" and "abcxyz." To return all bot channel associations, use a hyphen
// ("-") as the nameContains parameter.
NameContains *string
// A pagination token for fetching the next page of associations. If the response
// to this call is truncated, Amazon Lex returns a pagination token in the
// response. To fetch the next page of associations, specify the pagination token
// in the next request.
NextToken *string
}
type GetBotChannelAssociationsOutput struct {
// An array of objects, one for each association, that provides information about
// the Amazon Lex bot and its association with the channel.
BotChannelAssociations []*types.BotChannelAssociation
// A pagination token that fetches the next page of associations. If the response
// to this call is truncated, Amazon Lex returns a pagination token in the
// response. To fetch the next page of associations, specify the pagination token
// in the next request.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
}
func addOperationGetBotChannelAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetBotChannelAssociations{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetBotChannelAssociations{}, middleware.After)
if err != nil {
return err
}
awsmiddleware.AddRequestInvocationIDMiddleware(stack)
smithyhttp.AddContentLengthMiddleware(stack)
addResolveEndpointMiddleware(stack, options)
v4.AddComputePayloadSHA256Middleware(stack)
addRetryMiddlewares(stack, options)
addHTTPSignerV4Middleware(stack, options)
awsmiddleware.AddAttemptClockSkewMiddleware(stack)
addClientUserAgent(stack)
smithyhttp.AddErrorCloseResponseBodyMiddleware(stack)
smithyhttp.AddCloseResponseBodyMiddleware(stack)
addOpGetBotChannelAssociationsValidationMiddleware(stack)
stack.Initialize.Add(newServiceMetadataMiddleware_opGetBotChannelAssociations(options.Region), middleware.Before)
addRequestIDRetrieverMiddleware(stack)
addResponseErrorMiddleware(stack)
return nil
}
func newServiceMetadataMiddleware_opGetBotChannelAssociations(region string) awsmiddleware.RegisterServiceMetadata {
return awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "GetBotChannelAssociations",
}
}