-
Notifications
You must be signed in to change notification settings - Fork 626
/
api_op_GetExport.go
258 lines (211 loc) · 7.74 KB
/
api_op_GetExport.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package lexmodelbuildingservice
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
"github.com/aws/aws-sdk-go-v2/private/protocol"
)
// Please also see https://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetExportRequest
type GetExportInput struct {
_ struct{} `type:"structure"`
// The format of the exported data.
//
// ExportType is a required field
ExportType ExportType `location:"querystring" locationName:"exportType" type:"string" required:"true" enum:"true"`
// The name of the bot to export.
//
// Name is a required field
Name *string `location:"querystring" locationName:"name" min:"1" type:"string" required:"true"`
// The type of resource to export.
//
// ResourceType is a required field
ResourceType ResourceType `location:"querystring" locationName:"resourceType" type:"string" required:"true" enum:"true"`
// The version of the bot to export.
//
// Version is a required field
Version *string `location:"querystring" locationName:"version" min:"1" type:"string" required:"true"`
}
// String returns the string representation
func (s GetExportInput) String() string {
return awsutil.Prettify(s)
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetExportInput) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "GetExportInput"}
if len(s.ExportType) == 0 {
invalidParams.Add(aws.NewErrParamRequired("ExportType"))
}
if s.Name == nil {
invalidParams.Add(aws.NewErrParamRequired("Name"))
}
if s.Name != nil && len(*s.Name) < 1 {
invalidParams.Add(aws.NewErrParamMinLen("Name", 1))
}
if len(s.ResourceType) == 0 {
invalidParams.Add(aws.NewErrParamRequired("ResourceType"))
}
if s.Version == nil {
invalidParams.Add(aws.NewErrParamRequired("Version"))
}
if s.Version != nil && len(*s.Version) < 1 {
invalidParams.Add(aws.NewErrParamMinLen("Version", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s GetExportInput) MarshalFields(e protocol.FieldEncoder) error {
e.SetValue(protocol.HeaderTarget, "Content-Type", protocol.StringValue("application/json"), protocol.Metadata{})
if len(s.ExportType) > 0 {
v := s.ExportType
metadata := protocol.Metadata{}
e.SetValue(protocol.QueryTarget, "exportType", protocol.QuotedValue{ValueMarshaler: v}, metadata)
}
if s.Name != nil {
v := *s.Name
metadata := protocol.Metadata{}
e.SetValue(protocol.QueryTarget, "name", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
if len(s.ResourceType) > 0 {
v := s.ResourceType
metadata := protocol.Metadata{}
e.SetValue(protocol.QueryTarget, "resourceType", protocol.QuotedValue{ValueMarshaler: v}, metadata)
}
if s.Version != nil {
v := *s.Version
metadata := protocol.Metadata{}
e.SetValue(protocol.QueryTarget, "version", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
return nil
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetExportResponse
type GetExportOutput struct {
_ struct{} `type:"structure"`
// The status of the export.
//
// * IN_PROGRESS - The export is in progress.
//
// * READY - The export is complete.
//
// * FAILED - The export could not be completed.
ExportStatus ExportStatus `locationName:"exportStatus" type:"string" enum:"true"`
// The format of the exported data.
ExportType ExportType `locationName:"exportType" type:"string" enum:"true"`
// If status is FAILED, Amazon Lex provides the reason that it failed to export
// the resource.
FailureReason *string `locationName:"failureReason" type:"string"`
// The name of the bot being exported.
Name *string `locationName:"name" min:"1" type:"string"`
// The type of the exported resource.
ResourceType ResourceType `locationName:"resourceType" type:"string" enum:"true"`
// An S3 pre-signed URL that provides the location of the exported resource.
// The exported resource is a ZIP archive that contains the exported resource
// in JSON format. The structure of the archive may change. Your code should
// not rely on the archive structure.
Url *string `locationName:"url" type:"string"`
// The version of the bot being exported.
Version *string `locationName:"version" min:"1" type:"string"`
}
// String returns the string representation
func (s GetExportOutput) String() string {
return awsutil.Prettify(s)
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s GetExportOutput) MarshalFields(e protocol.FieldEncoder) error {
if len(s.ExportStatus) > 0 {
v := s.ExportStatus
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "exportStatus", protocol.QuotedValue{ValueMarshaler: v}, metadata)
}
if len(s.ExportType) > 0 {
v := s.ExportType
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "exportType", protocol.QuotedValue{ValueMarshaler: v}, metadata)
}
if s.FailureReason != nil {
v := *s.FailureReason
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "failureReason", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
if s.Name != nil {
v := *s.Name
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "name", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
if len(s.ResourceType) > 0 {
v := s.ResourceType
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "resourceType", protocol.QuotedValue{ValueMarshaler: v}, metadata)
}
if s.Url != nil {
v := *s.Url
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "url", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
if s.Version != nil {
v := *s.Version
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "version", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
return nil
}
const opGetExport = "GetExport"
// GetExportRequest returns a request value for making API operation for
// Amazon Lex Model Building Service.
//
// Exports the contents of a Amazon Lex resource in a specified format.
//
// // Example sending a request using GetExportRequest.
// req := client.GetExportRequest(params)
// resp, err := req.Send(context.TODO())
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetExport
func (c *Client) GetExportRequest(input *GetExportInput) GetExportRequest {
op := &aws.Operation{
Name: opGetExport,
HTTPMethod: "GET",
HTTPPath: "/exports/",
}
if input == nil {
input = &GetExportInput{}
}
req := c.newRequest(op, input, &GetExportOutput{})
return GetExportRequest{Request: req, Input: input, Copy: c.GetExportRequest}
}
// GetExportRequest is the request type for the
// GetExport API operation.
type GetExportRequest struct {
*aws.Request
Input *GetExportInput
Copy func(*GetExportInput) GetExportRequest
}
// Send marshals and sends the GetExport API request.
func (r GetExportRequest) Send(ctx context.Context) (*GetExportResponse, error) {
r.Request.SetContext(ctx)
err := r.Request.Send()
if err != nil {
return nil, err
}
resp := &GetExportResponse{
GetExportOutput: r.Request.Data.(*GetExportOutput),
response: &aws.Response{Request: r.Request},
}
return resp, nil
}
// GetExportResponse is the response type for the
// GetExport API operation.
type GetExportResponse struct {
*GetExportOutput
response *aws.Response
}
// SDKResponseMetdata returns the response metadata for the
// GetExport request.
func (r *GetExportResponse) SDKResponseMetdata() *aws.Response {
return r.response
}