/
api_op_GetSlotTypeVersions.go
103 lines (88 loc) · 3.83 KB
/
api_op_GetSlotTypeVersions.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 versions of a slot type. The GetSlotTypeVersions
// operation returns a SlotTypeMetadata object for each version of a slot type. For
// example, if a slot type has three numbered versions, the GetSlotTypeVersions
// operation returns four SlotTypeMetadata objects in the response, one for each
// numbered version and one for the $LATEST version. The GetSlotTypeVersions
// operation always returns at least one version, the $LATEST version. This
// operation requires permissions for the lex:GetSlotTypeVersions action.
func (c *Client) GetSlotTypeVersions(ctx context.Context, params *GetSlotTypeVersionsInput, optFns ...func(*Options)) (*GetSlotTypeVersionsOutput, error) {
if params == nil {
params = &GetSlotTypeVersionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetSlotTypeVersions", params, optFns, addOperationGetSlotTypeVersionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetSlotTypeVersionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetSlotTypeVersionsInput struct {
// The name of the slot type for which versions should be returned.
//
// This member is required.
Name *string
// The maximum number of slot type versions to return in the response. The default
// is 10.
MaxResults *int32
// A pagination token for fetching the next page of slot type 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 GetSlotTypeVersionsOutput struct {
// A pagination token for fetching the next page of slot type 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
// An array of SlotTypeMetadata objects, one for each numbered version of the slot
// type plus one for the $LATEST version.
SlotTypes []*types.SlotTypeMetadata
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
}
func addOperationGetSlotTypeVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSlotTypeVersions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSlotTypeVersions{}, 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)
addOpGetSlotTypeVersionsValidationMiddleware(stack)
stack.Initialize.Add(newServiceMetadataMiddleware_opGetSlotTypeVersions(options.Region), middleware.Before)
addRequestIDRetrieverMiddleware(stack)
addResponseErrorMiddleware(stack)
return nil
}
func newServiceMetadataMiddleware_opGetSlotTypeVersions(region string) awsmiddleware.RegisterServiceMetadata {
return awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "GetSlotTypeVersions",
}
}