/
api_op_GetIntentVersions.go
103 lines (88 loc) · 3.77 KB
/
api_op_GetIntentVersions.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
// 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"
)
// Gets information about all of the versions of an intent. The GetIntentVersions
// operation returns an IntentMetadata object for each version of an intent. For
// example, if an intent has three numbered versions, the GetIntentVersions
// operation returns four IntentMetadata objects in the response, one for each
// numbered version and one for the $LATEST version. The GetIntentVersions
// operation always returns at least one version, the $LATEST version. This
// operation requires permissions for the lex:GetIntentVersions action.
func (c *Client) GetIntentVersions(ctx context.Context, params *GetIntentVersionsInput, optFns ...func(*Options)) (*GetIntentVersionsOutput, error) {
if params == nil {
params = &GetIntentVersionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetIntentVersions", params, optFns, addOperationGetIntentVersionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetIntentVersionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetIntentVersionsInput struct {
// The name of the intent for which versions should be returned.
//
// This member is required.
Name *string
// The maximum number of intent versions to return in the response. The default is
// 10.
MaxResults *int32
// A pagination token for fetching the next page of intent versions. If the
// response to this call is truncated, Amazon Lex returns a pagination token in the
// response. To fetch the next page of versions, specify the pagination token in
// the next request.
NextToken *string
}
type GetIntentVersionsOutput struct {
// An array of IntentMetadata objects, one for each numbered version of the intent
// plus one for the $LATEST version.
Intents []*types.IntentMetadata
// A pagination token for fetching the next page of intent versions. If the
// response to this call is truncated, Amazon Lex returns a pagination token in the
// response. To fetch the next page of versions, specify the pagination token in
// the next request.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
}
func addOperationGetIntentVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetIntentVersions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetIntentVersions{}, 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)
addOpGetIntentVersionsValidationMiddleware(stack)
stack.Initialize.Add(newServiceMetadataMiddleware_opGetIntentVersions(options.Region), middleware.Before)
addRequestIDRetrieverMiddleware(stack)
addResponseErrorMiddleware(stack)
return nil
}
func newServiceMetadataMiddleware_opGetIntentVersions(region string) awsmiddleware.RegisterServiceMetadata {
return awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "GetIntentVersions",
}
}