diff options
author | Jake Champlin <jake.champlin.27@gmail.com> | 2017-06-06 12:40:07 -0400 |
---|---|---|
committer | Jake Champlin <jake.champlin.27@gmail.com> | 2017-06-06 12:40:07 -0400 |
commit | bae9f6d2fd5eb5bc80929bd393932b23f14d7c93 (patch) | |
tree | ca9ab12a7d78b1fc27a8f734729081357ce6d252 /vendor/github.com/aws/aws-sdk-go | |
parent | 254c495b6bebab3fb72a243c4bce858d79e6ee99 (diff) | |
download | terraform-provider-statuscake-bae9f6d2fd5eb5bc80929bd393932b23f14d7c93.tar.gz terraform-provider-statuscake-bae9f6d2fd5eb5bc80929bd393932b23f14d7c93.tar.zst terraform-provider-statuscake-bae9f6d2fd5eb5bc80929bd393932b23f14d7c93.zip |
Initial transfer of provider code
Diffstat (limited to 'vendor/github.com/aws/aws-sdk-go')
101 files changed, 37182 insertions, 0 deletions
diff --git a/vendor/github.com/aws/aws-sdk-go/LICENSE.txt b/vendor/github.com/aws/aws-sdk-go/LICENSE.txt new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/LICENSE.txt | |||
@@ -0,0 +1,202 @@ | |||
1 | |||
2 | Apache License | ||
3 | Version 2.0, January 2004 | ||
4 | http://www.apache.org/licenses/ | ||
5 | |||
6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | ||
7 | |||
8 | 1. Definitions. | ||
9 | |||
10 | "License" shall mean the terms and conditions for use, reproduction, | ||
11 | and distribution as defined by Sections 1 through 9 of this document. | ||
12 | |||
13 | "Licensor" shall mean the copyright owner or entity authorized by | ||
14 | the copyright owner that is granting the License. | ||
15 | |||
16 | "Legal Entity" shall mean the union of the acting entity and all | ||
17 | other entities that control, are controlled by, or are under common | ||
18 | control with that entity. For the purposes of this definition, | ||
19 | "control" means (i) the power, direct or indirect, to cause the | ||
20 | direction or management of such entity, whether by contract or | ||
21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the | ||
22 | outstanding shares, or (iii) beneficial ownership of such entity. | ||
23 | |||
24 | "You" (or "Your") shall mean an individual or Legal Entity | ||
25 | exercising permissions granted by this License. | ||
26 | |||
27 | "Source" form shall mean the preferred form for making modifications, | ||
28 | including but not limited to software source code, documentation | ||
29 | source, and configuration files. | ||
30 | |||
31 | "Object" form shall mean any form resulting from mechanical | ||
32 | transformation or translation of a Source form, including but | ||
33 | not limited to compiled object code, generated documentation, | ||
34 | and conversions to other media types. | ||
35 | |||
36 | "Work" shall mean the work of authorship, whether in Source or | ||
37 | Object form, made available under the License, as indicated by a | ||
38 | copyright notice that is included in or attached to the work | ||
39 | (an example is provided in the Appendix below). | ||
40 | |||
41 | "Derivative Works" shall mean any work, whether in Source or Object | ||
42 | form, that is based on (or derived from) the Work and for which the | ||
43 | editorial revisions, annotations, elaborations, or other modifications | ||
44 | represent, as a whole, an original work of authorship. For the purposes | ||
45 | of this License, Derivative Works shall not include works that remain | ||
46 | separable from, or merely link (or bind by name) to the interfaces of, | ||
47 | the Work and Derivative Works thereof. | ||
48 | |||
49 | "Contribution" shall mean any work of authorship, including | ||
50 | the original version of the Work and any modifications or additions | ||
51 | to that Work or Derivative Works thereof, that is intentionally | ||
52 | submitted to Licensor for inclusion in the Work by the copyright owner | ||
53 | or by an individual or Legal Entity authorized to submit on behalf of | ||
54 | the copyright owner. For the purposes of this definition, "submitted" | ||
55 | means any form of electronic, verbal, or written communication sent | ||
56 | to the Licensor or its representatives, including but not limited to | ||
57 | communication on electronic mailing lists, source code control systems, | ||
58 | and issue tracking systems that are managed by, or on behalf of, the | ||
59 | Licensor for the purpose of discussing and improving the Work, but | ||
60 | excluding communication that is conspicuously marked or otherwise | ||
61 | designated in writing by the copyright owner as "Not a Contribution." | ||
62 | |||
63 | "Contributor" shall mean Licensor and any individual or Legal Entity | ||
64 | on behalf of whom a Contribution has been received by Licensor and | ||
65 | subsequently incorporated within the Work. | ||
66 | |||
67 | 2. Grant of Copyright License. Subject to the terms and conditions of | ||
68 | this License, each Contributor hereby grants to You a perpetual, | ||
69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable | ||
70 | copyright license to reproduce, prepare Derivative Works of, | ||
71 | publicly display, publicly perform, sublicense, and distribute the | ||
72 | Work and such Derivative Works in Source or Object form. | ||
73 | |||
74 | 3. Grant of Patent License. Subject to the terms and conditions of | ||
75 | this License, each Contributor hereby grants to You a perpetual, | ||
76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable | ||
77 | (except as stated in this section) patent license to make, have made, | ||
78 | use, offer to sell, sell, import, and otherwise transfer the Work, | ||
79 | where such license applies only to those patent claims licensable | ||
80 | by such Contributor that are necessarily infringed by their | ||
81 | Contribution(s) alone or by combination of their Contribution(s) | ||
82 | with the Work to which such Contribution(s) was submitted. If You | ||
83 | institute patent litigation against any entity (including a | ||
84 | cross-claim or counterclaim in a lawsuit) alleging that the Work | ||
85 | or a Contribution incorporated within the Work constitutes direct | ||
86 | or contributory patent infringement, then any patent licenses | ||
87 | granted to You under this License for that Work shall terminate | ||
88 | as of the date such litigation is filed. | ||
89 | |||
90 | 4. Redistribution. You may reproduce and distribute copies of the | ||
91 | Work or Derivative Works thereof in any medium, with or without | ||
92 | modifications, and in Source or Object form, provided that You | ||
93 | meet the following conditions: | ||
94 | |||
95 | (a) You must give any other recipients of the Work or | ||
96 | Derivative Works a copy of this License; and | ||
97 | |||
98 | (b) You must cause any modified files to carry prominent notices | ||
99 | stating that You changed the files; and | ||
100 | |||
101 | (c) You must retain, in the Source form of any Derivative Works | ||
102 | that You distribute, all copyright, patent, trademark, and | ||
103 | attribution notices from the Source form of the Work, | ||
104 | excluding those notices that do not pertain to any part of | ||
105 | the Derivative Works; and | ||
106 | |||
107 | (d) If the Work includes a "NOTICE" text file as part of its | ||
108 | distribution, then any Derivative Works that You distribute must | ||
109 | include a readable copy of the attribution notices contained | ||
110 | within such NOTICE file, excluding those notices that do not | ||
111 | pertain to any part of the Derivative Works, in at least one | ||
112 | of the following places: within a NOTICE text file distributed | ||
113 | as part of the Derivative Works; within the Source form or | ||
114 | documentation, if provided along with the Derivative Works; or, | ||
115 | within a display generated by the Derivative Works, if and | ||
116 | wherever such third-party notices normally appear. The contents | ||
117 | of the NOTICE file are for informational purposes only and | ||
118 | do not modify the License. You may add Your own attribution | ||
119 | notices within Derivative Works that You distribute, alongside | ||
120 | or as an addendum to the NOTICE text from the Work, provided | ||
121 | that such additional attribution notices cannot be construed | ||
122 | as modifying the License. | ||
123 | |||
124 | You may add Your own copyright statement to Your modifications and | ||
125 | may provide additional or different license terms and conditions | ||
126 | for use, reproduction, or distribution of Your modifications, or | ||
127 | for any such Derivative Works as a whole, provided Your use, | ||
128 | reproduction, and distribution of the Work otherwise complies with | ||
129 | the conditions stated in this License. | ||
130 | |||
131 | 5. Submission of Contributions. Unless You explicitly state otherwise, | ||
132 | any Contribution intentionally submitted for inclusion in the Work | ||
133 | by You to the Licensor shall be under the terms and conditions of | ||
134 | this License, without any additional terms or conditions. | ||
135 | Notwithstanding the above, nothing herein shall supersede or modify | ||
136 | the terms of any separate license agreement you may have executed | ||
137 | with Licensor regarding such Contributions. | ||
138 | |||
139 | 6. Trademarks. This License does not grant permission to use the trade | ||
140 | names, trademarks, service marks, or product names of the Licensor, | ||
141 | except as required for reasonable and customary use in describing the | ||
142 | origin of the Work and reproducing the content of the NOTICE file. | ||
143 | |||
144 | 7. Disclaimer of Warranty. Unless required by applicable law or | ||
145 | agreed to in writing, Licensor provides the Work (and each | ||
146 | Contributor provides its Contributions) on an "AS IS" BASIS, | ||
147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | ||
148 | implied, including, without limitation, any warranties or conditions | ||
149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A | ||
150 | PARTICULAR PURPOSE. You are solely responsible for determining the | ||
151 | appropriateness of using or redistributing the Work and assume any | ||
152 | risks associated with Your exercise of permissions under this License. | ||
153 | |||
154 | 8. Limitation of Liability. In no event and under no legal theory, | ||
155 | whether in tort (including negligence), contract, or otherwise, | ||
156 | unless required by applicable law (such as deliberate and grossly | ||
157 | negligent acts) or agreed to in writing, shall any Contributor be | ||
158 | liable to You for damages, including any direct, indirect, special, | ||
159 | incidental, or consequential damages of any character arising as a | ||
160 | result of this License or out of the use or inability to use the | ||
161 | Work (including but not limited to damages for loss of goodwill, | ||
162 | work stoppage, computer failure or malfunction, or any and all | ||
163 | other commercial damages or losses), even if such Contributor | ||
164 | has been advised of the possibility of such damages. | ||
165 | |||
166 | 9. Accepting Warranty or Additional Liability. While redistributing | ||
167 | the Work or Derivative Works thereof, You may choose to offer, | ||
168 | and charge a fee for, acceptance of support, warranty, indemnity, | ||
169 | or other liability obligations and/or rights consistent with this | ||
170 | License. However, in accepting such obligations, You may act only | ||
171 | on Your own behalf and on Your sole responsibility, not on behalf | ||
172 | of any other Contributor, and only if You agree to indemnify, | ||
173 | defend, and hold each Contributor harmless for any liability | ||
174 | incurred by, or claims asserted against, such Contributor by reason | ||
175 | of your accepting any such warranty or additional liability. | ||
176 | |||
177 | END OF TERMS AND CONDITIONS | ||
178 | |||
179 | APPENDIX: How to apply the Apache License to your work. | ||
180 | |||
181 | To apply the Apache License to your work, attach the following | ||
182 | boilerplate notice, with the fields enclosed by brackets "[]" | ||
183 | replaced with your own identifying information. (Don't include | ||
184 | the brackets!) The text should be enclosed in the appropriate | ||
185 | comment syntax for the file format. We also recommend that a | ||
186 | file or class name and description of purpose be included on the | ||
187 | same "printed page" as the copyright notice for easier | ||
188 | identification within third-party archives. | ||
189 | |||
190 | Copyright [yyyy] [name of copyright owner] | ||
191 | |||
192 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
193 | you may not use this file except in compliance with the License. | ||
194 | You may obtain a copy of the License at | ||
195 | |||
196 | http://www.apache.org/licenses/LICENSE-2.0 | ||
197 | |||
198 | Unless required by applicable law or agreed to in writing, software | ||
199 | distributed under the License is distributed on an "AS IS" BASIS, | ||
200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
201 | See the License for the specific language governing permissions and | ||
202 | limitations under the License. | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/NOTICE.txt b/vendor/github.com/aws/aws-sdk-go/NOTICE.txt new file mode 100644 index 0000000..5f14d11 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/NOTICE.txt | |||
@@ -0,0 +1,3 @@ | |||
1 | AWS SDK for Go | ||
2 | Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
3 | Copyright 2014-2015 Stripe, Inc. | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/awserr/error.go b/vendor/github.com/aws/aws-sdk-go/aws/awserr/error.go new file mode 100644 index 0000000..56fdfc2 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/awserr/error.go | |||
@@ -0,0 +1,145 @@ | |||
1 | // Package awserr represents API error interface accessors for the SDK. | ||
2 | package awserr | ||
3 | |||
4 | // An Error wraps lower level errors with code, message and an original error. | ||
5 | // The underlying concrete error type may also satisfy other interfaces which | ||
6 | // can be to used to obtain more specific information about the error. | ||
7 | // | ||
8 | // Calling Error() or String() will always include the full information about | ||
9 | // an error based on its underlying type. | ||
10 | // | ||
11 | // Example: | ||
12 | // | ||
13 | // output, err := s3manage.Upload(svc, input, opts) | ||
14 | // if err != nil { | ||
15 | // if awsErr, ok := err.(awserr.Error); ok { | ||
16 | // // Get error details | ||
17 | // log.Println("Error:", awsErr.Code(), awsErr.Message()) | ||
18 | // | ||
19 | // // Prints out full error message, including original error if there was one. | ||
20 | // log.Println("Error:", awsErr.Error()) | ||
21 | // | ||
22 | // // Get original error | ||
23 | // if origErr := awsErr.OrigErr(); origErr != nil { | ||
24 | // // operate on original error. | ||
25 | // } | ||
26 | // } else { | ||
27 | // fmt.Println(err.Error()) | ||
28 | // } | ||
29 | // } | ||
30 | // | ||
31 | type Error interface { | ||
32 | // Satisfy the generic error interface. | ||
33 | error | ||
34 | |||
35 | // Returns the short phrase depicting the classification of the error. | ||
36 | Code() string | ||
37 | |||
38 | // Returns the error details message. | ||
39 | Message() string | ||
40 | |||
41 | // Returns the original error if one was set. Nil is returned if not set. | ||
42 | OrigErr() error | ||
43 | } | ||
44 | |||
45 | // BatchError is a batch of errors which also wraps lower level errors with | ||
46 | // code, message, and original errors. Calling Error() will include all errors | ||
47 | // that occurred in the batch. | ||
48 | // | ||
49 | // Deprecated: Replaced with BatchedErrors. Only defined for backwards | ||
50 | // compatibility. | ||
51 | type BatchError interface { | ||
52 | // Satisfy the generic error interface. | ||
53 | error | ||
54 | |||
55 | // Returns the short phrase depicting the classification of the error. | ||
56 | Code() string | ||
57 | |||
58 | // Returns the error details message. | ||
59 | Message() string | ||
60 | |||
61 | // Returns the original error if one was set. Nil is returned if not set. | ||
62 | OrigErrs() []error | ||
63 | } | ||
64 | |||
65 | // BatchedErrors is a batch of errors which also wraps lower level errors with | ||
66 | // code, message, and original errors. Calling Error() will include all errors | ||
67 | // that occurred in the batch. | ||
68 | // | ||
69 | // Replaces BatchError | ||
70 | type BatchedErrors interface { | ||
71 | // Satisfy the base Error interface. | ||
72 | Error | ||
73 | |||
74 | // Returns the original error if one was set. Nil is returned if not set. | ||
75 | OrigErrs() []error | ||
76 | } | ||
77 | |||
78 | // New returns an Error object described by the code, message, and origErr. | ||
79 | // | ||
80 | // If origErr satisfies the Error interface it will not be wrapped within a new | ||
81 | // Error object and will instead be returned. | ||
82 | func New(code, message string, origErr error) Error { | ||
83 | var errs []error | ||
84 | if origErr != nil { | ||
85 | errs = append(errs, origErr) | ||
86 | } | ||
87 | return newBaseError(code, message, errs) | ||
88 | } | ||
89 | |||
90 | // NewBatchError returns an BatchedErrors with a collection of errors as an | ||
91 | // array of errors. | ||
92 | func NewBatchError(code, message string, errs []error) BatchedErrors { | ||
93 | return newBaseError(code, message, errs) | ||
94 | } | ||
95 | |||
96 | // A RequestFailure is an interface to extract request failure information from | ||
97 | // an Error such as the request ID of the failed request returned by a service. | ||
98 | // RequestFailures may not always have a requestID value if the request failed | ||
99 | // prior to reaching the service such as a connection error. | ||
100 | // | ||
101 | // Example: | ||
102 | // | ||
103 | // output, err := s3manage.Upload(svc, input, opts) | ||
104 | // if err != nil { | ||
105 | // if reqerr, ok := err.(RequestFailure); ok { | ||
106 | // log.Println("Request failed", reqerr.Code(), reqerr.Message(), reqerr.RequestID()) | ||
107 | // } else { | ||
108 | // log.Println("Error:", err.Error()) | ||
109 | // } | ||
110 | // } | ||
111 | // | ||
112 | // Combined with awserr.Error: | ||
113 | // | ||
114 | // output, err := s3manage.Upload(svc, input, opts) | ||
115 | // if err != nil { | ||
116 | // if awsErr, ok := err.(awserr.Error); ok { | ||
117 | // // Generic AWS Error with Code, Message, and original error (if any) | ||
118 | // fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) | ||
119 | // | ||
120 | // if reqErr, ok := err.(awserr.RequestFailure); ok { | ||
121 | // // A service error occurred | ||
122 | // fmt.Println(reqErr.StatusCode(), reqErr.RequestID()) | ||
123 | // } | ||
124 | // } else { | ||
125 | // fmt.Println(err.Error()) | ||
126 | // } | ||
127 | // } | ||
128 | // | ||
129 | type RequestFailure interface { | ||
130 | Error | ||
131 | |||
132 | // The status code of the HTTP response. | ||
133 | StatusCode() int | ||
134 | |||
135 | // The request ID returned by the service for a request failure. This will | ||
136 | // be empty if no request ID is available such as the request failed due | ||
137 | // to a connection error. | ||
138 | RequestID() string | ||
139 | } | ||
140 | |||
141 | // NewRequestFailure returns a new request error wrapper for the given Error | ||
142 | // provided. | ||
143 | func NewRequestFailure(err Error, statusCode int, reqID string) RequestFailure { | ||
144 | return newRequestError(err, statusCode, reqID) | ||
145 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go b/vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go new file mode 100644 index 0000000..0202a00 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go | |||
@@ -0,0 +1,194 @@ | |||
1 | package awserr | ||
2 | |||
3 | import "fmt" | ||
4 | |||
5 | // SprintError returns a string of the formatted error code. | ||
6 | // | ||
7 | // Both extra and origErr are optional. If they are included their lines | ||
8 | // will be added, but if they are not included their lines will be ignored. | ||
9 | func SprintError(code, message, extra string, origErr error) string { | ||
10 | msg := fmt.Sprintf("%s: %s", code, message) | ||
11 | if extra != "" { | ||
12 | msg = fmt.Sprintf("%s\n\t%s", msg, extra) | ||
13 | } | ||
14 | if origErr != nil { | ||
15 | msg = fmt.Sprintf("%s\ncaused by: %s", msg, origErr.Error()) | ||
16 | } | ||
17 | return msg | ||
18 | } | ||
19 | |||
20 | // A baseError wraps the code and message which defines an error. It also | ||
21 | // can be used to wrap an original error object. | ||
22 | // | ||
23 | // Should be used as the root for errors satisfying the awserr.Error. Also | ||
24 | // for any error which does not fit into a specific error wrapper type. | ||
25 | type baseError struct { | ||
26 | // Classification of error | ||
27 | code string | ||
28 | |||
29 | // Detailed information about error | ||
30 | message string | ||
31 | |||
32 | // Optional original error this error is based off of. Allows building | ||
33 | // chained errors. | ||
34 | errs []error | ||
35 | } | ||
36 | |||
37 | // newBaseError returns an error object for the code, message, and errors. | ||
38 | // | ||
39 | // code is a short no whitespace phrase depicting the classification of | ||
40 | // the error that is being created. | ||
41 | // | ||
42 | // message is the free flow string containing detailed information about the | ||
43 | // error. | ||
44 | // | ||
45 | // origErrs is the error objects which will be nested under the new errors to | ||
46 | // be returned. | ||
47 | func newBaseError(code, message string, origErrs []error) *baseError { | ||
48 | b := &baseError{ | ||
49 | code: code, | ||
50 | message: message, | ||
51 | errs: origErrs, | ||
52 | } | ||
53 | |||
54 | return b | ||
55 | } | ||
56 | |||
57 | // Error returns the string representation of the error. | ||
58 | // | ||
59 | // See ErrorWithExtra for formatting. | ||
60 | // | ||
61 | // Satisfies the error interface. | ||
62 | func (b baseError) Error() string { | ||
63 | size := len(b.errs) | ||
64 | if size > 0 { | ||
65 | return SprintError(b.code, b.message, "", errorList(b.errs)) | ||
66 | } | ||
67 | |||
68 | return SprintError(b.code, b.message, "", nil) | ||
69 | } | ||
70 | |||
71 | // String returns the string representation of the error. | ||
72 | // Alias for Error to satisfy the stringer interface. | ||
73 | func (b baseError) String() string { | ||
74 | return b.Error() | ||
75 | } | ||
76 | |||
77 | // Code returns the short phrase depicting the classification of the error. | ||
78 | func (b baseError) Code() string { | ||
79 | return b.code | ||
80 | } | ||
81 | |||
82 | // Message returns the error details message. | ||
83 | func (b baseError) Message() string { | ||
84 | return b.message | ||
85 | } | ||
86 | |||
87 | // OrigErr returns the original error if one was set. Nil is returned if no | ||
88 | // error was set. This only returns the first element in the list. If the full | ||
89 | // list is needed, use BatchedErrors. | ||
90 | func (b baseError) OrigErr() error { | ||
91 | switch len(b.errs) { | ||
92 | case 0: | ||
93 | return nil | ||
94 | case 1: | ||
95 | return b.errs[0] | ||
96 | default: | ||
97 | if err, ok := b.errs[0].(Error); ok { | ||
98 | return NewBatchError(err.Code(), err.Message(), b.errs[1:]) | ||
99 | } | ||
100 | return NewBatchError("BatchedErrors", | ||
101 | "multiple errors occurred", b.errs) | ||
102 | } | ||
103 | } | ||
104 | |||
105 | // OrigErrs returns the original errors if one was set. An empty slice is | ||
106 | // returned if no error was set. | ||
107 | func (b baseError) OrigErrs() []error { | ||
108 | return b.errs | ||
109 | } | ||
110 | |||
111 | // So that the Error interface type can be included as an anonymous field | ||
112 | // in the requestError struct and not conflict with the error.Error() method. | ||
113 | type awsError Error | ||
114 | |||
115 | // A requestError wraps a request or service error. | ||
116 | // | ||
117 | // Composed of baseError for code, message, and original error. | ||
118 | type requestError struct { | ||
119 | awsError | ||
120 | statusCode int | ||
121 | requestID string | ||
122 | } | ||
123 | |||
124 | // newRequestError returns a wrapped error with additional information for | ||
125 | // request status code, and service requestID. | ||
126 | // | ||
127 | // Should be used to wrap all request which involve service requests. Even if | ||
128 | // the request failed without a service response, but had an HTTP status code | ||
129 | // that may be meaningful. | ||
130 | // | ||
131 | // Also wraps original errors via the baseError. | ||
132 | func newRequestError(err Error, statusCode int, requestID string) *requestError { | ||
133 | return &requestError{ | ||
134 | awsError: err, | ||
135 | statusCode: statusCode, | ||
136 | requestID: requestID, | ||
137 | } | ||
138 | } | ||
139 | |||
140 | // Error returns the string representation of the error. | ||
141 | // Satisfies the error interface. | ||
142 | func (r requestError) Error() string { | ||
143 | extra := fmt.Sprintf("status code: %d, request id: %s", | ||
144 | r.statusCode, r.requestID) | ||
145 | return SprintError(r.Code(), r.Message(), extra, r.OrigErr()) | ||
146 | } | ||
147 | |||
148 | // String returns the string representation of the error. | ||
149 | // Alias for Error to satisfy the stringer interface. | ||
150 | func (r requestError) String() string { | ||
151 | return r.Error() | ||
152 | } | ||
153 | |||
154 | // StatusCode returns the wrapped status code for the error | ||
155 | func (r requestError) StatusCode() int { | ||
156 | return r.statusCode | ||
157 | } | ||
158 | |||
159 | // RequestID returns the wrapped requestID | ||
160 | func (r requestError) RequestID() string { | ||
161 | return r.requestID | ||
162 | } | ||
163 | |||
164 | // OrigErrs returns the original errors if one was set. An empty slice is | ||
165 | // returned if no error was set. | ||
166 | func (r requestError) OrigErrs() []error { | ||
167 | if b, ok := r.awsError.(BatchedErrors); ok { | ||
168 | return b.OrigErrs() | ||
169 | } | ||
170 | return []error{r.OrigErr()} | ||
171 | } | ||
172 | |||
173 | // An error list that satisfies the golang interface | ||
174 | type errorList []error | ||
175 | |||
176 | // Error returns the string representation of the error. | ||
177 | // | ||
178 | // Satisfies the error interface. | ||
179 | func (e errorList) Error() string { | ||
180 | msg := "" | ||
181 | // How do we want to handle the array size being zero | ||
182 | if size := len(e); size > 0 { | ||
183 | for i := 0; i < size; i++ { | ||
184 | msg += fmt.Sprintf("%s", e[i].Error()) | ||
185 | // We check the next index to see if it is within the slice. | ||
186 | // If it is, then we append a newline. We do this, because unit tests | ||
187 | // could be broken with the additional '\n' | ||
188 | if i+1 < size { | ||
189 | msg += "\n" | ||
190 | } | ||
191 | } | ||
192 | } | ||
193 | return msg | ||
194 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/copy.go b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/copy.go new file mode 100644 index 0000000..1a3d106 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/copy.go | |||
@@ -0,0 +1,108 @@ | |||
1 | package awsutil | ||
2 | |||
3 | import ( | ||
4 | "io" | ||
5 | "reflect" | ||
6 | "time" | ||
7 | ) | ||
8 | |||
9 | // Copy deeply copies a src structure to dst. Useful for copying request and | ||
10 | // response structures. | ||
11 | // | ||
12 | // Can copy between structs of different type, but will only copy fields which | ||
13 | // are assignable, and exist in both structs. Fields which are not assignable, | ||
14 | // or do not exist in both structs are ignored. | ||
15 | func Copy(dst, src interface{}) { | ||
16 | dstval := reflect.ValueOf(dst) | ||
17 | if !dstval.IsValid() { | ||
18 | panic("Copy dst cannot be nil") | ||
19 | } | ||
20 | |||
21 | rcopy(dstval, reflect.ValueOf(src), true) | ||
22 | } | ||
23 | |||
24 | // CopyOf returns a copy of src while also allocating the memory for dst. | ||
25 | // src must be a pointer type or this operation will fail. | ||
26 | func CopyOf(src interface{}) (dst interface{}) { | ||
27 | dsti := reflect.New(reflect.TypeOf(src).Elem()) | ||
28 | dst = dsti.Interface() | ||
29 | rcopy(dsti, reflect.ValueOf(src), true) | ||
30 | return | ||
31 | } | ||
32 | |||
33 | // rcopy performs a recursive copy of values from the source to destination. | ||
34 | // | ||
35 | // root is used to skip certain aspects of the copy which are not valid | ||
36 | // for the root node of a object. | ||
37 | func rcopy(dst, src reflect.Value, root bool) { | ||
38 | if !src.IsValid() { | ||
39 | return | ||
40 | } | ||
41 | |||
42 | switch src.Kind() { | ||
43 | case reflect.Ptr: | ||
44 | if _, ok := src.Interface().(io.Reader); ok { | ||
45 | if dst.Kind() == reflect.Ptr && dst.Elem().CanSet() { | ||
46 | dst.Elem().Set(src) | ||
47 | } else if dst.CanSet() { | ||
48 | dst.Set(src) | ||
49 | } | ||
50 | } else { | ||
51 | e := src.Type().Elem() | ||
52 | if dst.CanSet() && !src.IsNil() { | ||
53 | if _, ok := src.Interface().(*time.Time); !ok { | ||
54 | dst.Set(reflect.New(e)) | ||
55 | } else { | ||
56 | tempValue := reflect.New(e) | ||
57 | tempValue.Elem().Set(src.Elem()) | ||
58 | // Sets time.Time's unexported values | ||
59 | dst.Set(tempValue) | ||
60 | } | ||
61 | } | ||
62 | if src.Elem().IsValid() { | ||
63 | // Keep the current root state since the depth hasn't changed | ||
64 | rcopy(dst.Elem(), src.Elem(), root) | ||
65 | } | ||
66 | } | ||
67 | case reflect.Struct: | ||
68 | t := dst.Type() | ||
69 | for i := 0; i < t.NumField(); i++ { | ||
70 | name := t.Field(i).Name | ||
71 | srcVal := src.FieldByName(name) | ||
72 | dstVal := dst.FieldByName(name) | ||
73 | if srcVal.IsValid() && dstVal.CanSet() { | ||
74 | rcopy(dstVal, srcVal, false) | ||
75 | } | ||
76 | } | ||
77 | case reflect.Slice: | ||
78 | if src.IsNil() { | ||
79 | break | ||
80 | } | ||
81 | |||
82 | s := reflect.MakeSlice(src.Type(), src.Len(), src.Cap()) | ||
83 | dst.Set(s) | ||
84 | for i := 0; i < src.Len(); i++ { | ||
85 | rcopy(dst.Index(i), src.Index(i), false) | ||
86 | } | ||
87 | case reflect.Map: | ||
88 | if src.IsNil() { | ||
89 | break | ||
90 | } | ||
91 | |||
92 | s := reflect.MakeMap(src.Type()) | ||
93 | dst.Set(s) | ||
94 | for _, k := range src.MapKeys() { | ||
95 | v := src.MapIndex(k) | ||
96 | v2 := reflect.New(v.Type()).Elem() | ||
97 | rcopy(v2, v, false) | ||
98 | dst.SetMapIndex(k, v2) | ||
99 | } | ||
100 | default: | ||
101 | // Assign the value if possible. If its not assignable, the value would | ||
102 | // need to be converted and the impact of that may be unexpected, or is | ||
103 | // not compatible with the dst type. | ||
104 | if src.Type().AssignableTo(dst.Type()) { | ||
105 | dst.Set(src) | ||
106 | } | ||
107 | } | ||
108 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/equal.go b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/equal.go new file mode 100644 index 0000000..59fa4a5 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/equal.go | |||
@@ -0,0 +1,27 @@ | |||
1 | package awsutil | ||
2 | |||
3 | import ( | ||
4 | "reflect" | ||
5 | ) | ||
6 | |||
7 | // DeepEqual returns if the two values are deeply equal like reflect.DeepEqual. | ||
8 | // In addition to this, this method will also dereference the input values if | ||
9 | // possible so the DeepEqual performed will not fail if one parameter is a | ||
10 | // pointer and the other is not. | ||
11 | // | ||
12 | // DeepEqual will not perform indirection of nested values of the input parameters. | ||
13 | func DeepEqual(a, b interface{}) bool { | ||
14 | ra := reflect.Indirect(reflect.ValueOf(a)) | ||
15 | rb := reflect.Indirect(reflect.ValueOf(b)) | ||
16 | |||
17 | if raValid, rbValid := ra.IsValid(), rb.IsValid(); !raValid && !rbValid { | ||
18 | // If the elements are both nil, and of the same type the are equal | ||
19 | // If they are of different types they are not equal | ||
20 | return reflect.TypeOf(a) == reflect.TypeOf(b) | ||
21 | } else if raValid != rbValid { | ||
22 | // Both values must be valid to be equal | ||
23 | return false | ||
24 | } | ||
25 | |||
26 | return reflect.DeepEqual(ra.Interface(), rb.Interface()) | ||
27 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go new file mode 100644 index 0000000..11c52c3 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go | |||
@@ -0,0 +1,222 @@ | |||
1 | package awsutil | ||
2 | |||
3 | import ( | ||
4 | "reflect" | ||
5 | "regexp" | ||
6 | "strconv" | ||
7 | "strings" | ||
8 | |||
9 | "github.com/jmespath/go-jmespath" | ||
10 | ) | ||
11 | |||
12 | var indexRe = regexp.MustCompile(`(.+)\[(-?\d+)?\]$`) | ||
13 | |||
14 | // rValuesAtPath returns a slice of values found in value v. The values | ||
15 | // in v are explored recursively so all nested values are collected. | ||
16 | func rValuesAtPath(v interface{}, path string, createPath, caseSensitive, nilTerm bool) []reflect.Value { | ||
17 | pathparts := strings.Split(path, "||") | ||
18 | if len(pathparts) > 1 { | ||
19 | for _, pathpart := range pathparts { | ||
20 | vals := rValuesAtPath(v, pathpart, createPath, caseSensitive, nilTerm) | ||
21 | if len(vals) > 0 { | ||
22 | return vals | ||
23 | } | ||
24 | } | ||
25 | return nil | ||
26 | } | ||
27 | |||
28 | values := []reflect.Value{reflect.Indirect(reflect.ValueOf(v))} | ||
29 | components := strings.Split(path, ".") | ||
30 | for len(values) > 0 && len(components) > 0 { | ||
31 | var index *int64 | ||
32 | var indexStar bool | ||
33 | c := strings.TrimSpace(components[0]) | ||
34 | if c == "" { // no actual component, illegal syntax | ||
35 | return nil | ||
36 | } else if caseSensitive && c != "*" && strings.ToLower(c[0:1]) == c[0:1] { | ||
37 | // TODO normalize case for user | ||
38 | return nil // don't support unexported fields | ||
39 | } | ||
40 | |||
41 | // parse this component | ||
42 | if m := indexRe.FindStringSubmatch(c); m != nil { | ||
43 | c = m[1] | ||
44 | if m[2] == "" { | ||
45 | index = nil | ||
46 | indexStar = true | ||
47 | } else { | ||
48 | i, _ := strconv.ParseInt(m[2], 10, 32) | ||
49 | index = &i | ||
50 | indexStar = false | ||
51 | } | ||
52 | } | ||
53 | |||
54 | nextvals := []reflect.Value{} | ||
55 | for _, value := range values { | ||
56 | // pull component name out of struct member | ||
57 | if value.Kind() != reflect.Struct { | ||
58 | continue | ||
59 | } | ||
60 | |||
61 | if c == "*" { // pull all members | ||
62 | for i := 0; i < value.NumField(); i++ { | ||
63 | if f := reflect.Indirect(value.Field(i)); f.IsValid() { | ||
64 | nextvals = append(nextvals, f) | ||
65 | } | ||
66 | } | ||
67 | continue | ||
68 | } | ||
69 | |||
70 | value = value.FieldByNameFunc(func(name string) bool { | ||
71 | if c == name { | ||
72 | return true | ||
73 | } else if !caseSensitive && strings.ToLower(name) == strings.ToLower(c) { | ||
74 | return true | ||
75 | } | ||
76 | return false | ||
77 | }) | ||
78 | |||
79 | if nilTerm && value.Kind() == reflect.Ptr && len(components[1:]) == 0 { | ||
80 | if !value.IsNil() { | ||
81 | value.Set(reflect.Zero(value.Type())) | ||
82 | } | ||
83 | return []reflect.Value{value} | ||
84 | } | ||
85 | |||
86 | if createPath && value.Kind() == reflect.Ptr && value.IsNil() { | ||
87 | // TODO if the value is the terminus it should not be created | ||
88 | // if the value to be set to its position is nil. | ||
89 | value.Set(reflect.New(value.Type().Elem())) | ||
90 | value = value.Elem() | ||
91 | } else { | ||
92 | value = reflect.Indirect(value) | ||
93 | } | ||
94 | |||
95 | if value.Kind() == reflect.Slice || value.Kind() == reflect.Map { | ||
96 | if !createPath && value.IsNil() { | ||
97 | value = reflect.ValueOf(nil) | ||
98 | } | ||
99 | } | ||
100 | |||
101 | if value.IsValid() { | ||
102 | nextvals = append(nextvals, value) | ||
103 | } | ||
104 | } | ||
105 | values = nextvals | ||
106 | |||
107 | if indexStar || index != nil { | ||
108 | nextvals = []reflect.Value{} | ||
109 | for _, valItem := range values { | ||
110 | value := reflect.Indirect(valItem) | ||
111 | if value.Kind() != reflect.Slice { | ||
112 | continue | ||
113 | } | ||
114 | |||
115 | if indexStar { // grab all indices | ||
116 | for i := 0; i < value.Len(); i++ { | ||
117 | idx := reflect.Indirect(value.Index(i)) | ||
118 | if idx.IsValid() { | ||
119 | nextvals = append(nextvals, idx) | ||
120 | } | ||
121 | } | ||
122 | continue | ||
123 | } | ||
124 | |||
125 | // pull out index | ||
126 | i := int(*index) | ||
127 | if i >= value.Len() { // check out of bounds | ||
128 | if createPath { | ||
129 | // TODO resize slice | ||
130 | } else { | ||
131 | continue | ||
132 | } | ||
133 | } else if i < 0 { // support negative indexing | ||
134 | i = value.Len() + i | ||
135 | } | ||
136 | value = reflect.Indirect(value.Index(i)) | ||
137 | |||
138 | if value.Kind() == reflect.Slice || value.Kind() == reflect.Map { | ||
139 | if !createPath && value.IsNil() { | ||
140 | value = reflect.ValueOf(nil) | ||
141 | } | ||
142 | } | ||
143 | |||
144 | if value.IsValid() { | ||
145 | nextvals = append(nextvals, value) | ||
146 | } | ||
147 | } | ||
148 | values = nextvals | ||
149 | } | ||
150 | |||
151 | components = components[1:] | ||
152 | } | ||
153 | return values | ||
154 | } | ||
155 | |||
156 | // ValuesAtPath returns a list of values at the case insensitive lexical | ||
157 | // path inside of a structure. | ||
158 | func ValuesAtPath(i interface{}, path string) ([]interface{}, error) { | ||
159 | result, err := jmespath.Search(path, i) | ||
160 | if err != nil { | ||
161 | return nil, err | ||
162 | } | ||
163 | |||
164 | v := reflect.ValueOf(result) | ||
165 | if !v.IsValid() || (v.Kind() == reflect.Ptr && v.IsNil()) { | ||
166 | return nil, nil | ||
167 | } | ||
168 | if s, ok := result.([]interface{}); ok { | ||
169 | return s, err | ||
170 | } | ||
171 | if v.Kind() == reflect.Map && v.Len() == 0 { | ||
172 | return nil, nil | ||
173 | } | ||
174 | if v.Kind() == reflect.Slice { | ||
175 | out := make([]interface{}, v.Len()) | ||
176 | for i := 0; i < v.Len(); i++ { | ||
177 | out[i] = v.Index(i).Interface() | ||
178 | } | ||
179 | return out, nil | ||
180 | } | ||
181 | |||
182 | return []interface{}{result}, nil | ||
183 | } | ||
184 | |||
185 | // SetValueAtPath sets a value at the case insensitive lexical path inside | ||
186 | // of a structure. | ||
187 | func SetValueAtPath(i interface{}, path string, v interface{}) { | ||
188 | if rvals := rValuesAtPath(i, path, true, false, v == nil); rvals != nil { | ||
189 | for _, rval := range rvals { | ||
190 | if rval.Kind() == reflect.Ptr && rval.IsNil() { | ||
191 | continue | ||
192 | } | ||
193 | setValue(rval, v) | ||
194 | } | ||
195 | } | ||
196 | } | ||
197 | |||
198 | func setValue(dstVal reflect.Value, src interface{}) { | ||
199 | if dstVal.Kind() == reflect.Ptr { | ||
200 | dstVal = reflect.Indirect(dstVal) | ||
201 | } | ||
202 | srcVal := reflect.ValueOf(src) | ||
203 | |||
204 | if !srcVal.IsValid() { // src is literal nil | ||
205 | if dstVal.CanAddr() { | ||
206 | // Convert to pointer so that pointer's value can be nil'ed | ||
207 | // dstVal = dstVal.Addr() | ||
208 | } | ||
209 | dstVal.Set(reflect.Zero(dstVal.Type())) | ||
210 | |||
211 | } else if srcVal.Kind() == reflect.Ptr { | ||
212 | if srcVal.IsNil() { | ||
213 | srcVal = reflect.Zero(dstVal.Type()) | ||
214 | } else { | ||
215 | srcVal = reflect.ValueOf(src).Elem() | ||
216 | } | ||
217 | dstVal.Set(srcVal) | ||
218 | } else { | ||
219 | dstVal.Set(srcVal) | ||
220 | } | ||
221 | |||
222 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/prettify.go b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/prettify.go new file mode 100644 index 0000000..710eb43 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/prettify.go | |||
@@ -0,0 +1,113 @@ | |||
1 | package awsutil | ||
2 | |||
3 | import ( | ||
4 | "bytes" | ||
5 | "fmt" | ||
6 | "io" | ||
7 | "reflect" | ||
8 | "strings" | ||
9 | ) | ||
10 | |||
11 | // Prettify returns the string representation of a value. | ||
12 | func Prettify(i interface{}) string { | ||
13 | var buf bytes.Buffer | ||
14 | prettify(reflect.ValueOf(i), 0, &buf) | ||
15 | return buf.String() | ||
16 | } | ||
17 | |||
18 | // prettify will recursively walk value v to build a textual | ||
19 | // representation of the value. | ||
20 | func prettify(v reflect.Value, indent int, buf *bytes.Buffer) { | ||
21 | for v.Kind() == reflect.Ptr { | ||
22 | v = v.Elem() | ||
23 | } | ||
24 | |||
25 | switch v.Kind() { | ||
26 | case reflect.Struct: | ||
27 | strtype := v.Type().String() | ||
28 | if strtype == "time.Time" { | ||
29 | fmt.Fprintf(buf, "%s", v.Interface()) | ||
30 | break | ||
31 | } else if strings.HasPrefix(strtype, "io.") { | ||
32 | buf.WriteString("<buffer>") | ||
33 | break | ||
34 | } | ||
35 | |||
36 | buf.WriteString("{\n") | ||
37 | |||
38 | names := []string{} | ||
39 | for i := 0; i < v.Type().NumField(); i++ { | ||
40 | name := v.Type().Field(i).Name | ||
41 | f := v.Field(i) | ||
42 | if name[0:1] == strings.ToLower(name[0:1]) { | ||
43 | continue // ignore unexported fields | ||
44 | } | ||
45 | if (f.Kind() == reflect.Ptr || f.Kind() == reflect.Slice || f.Kind() == reflect.Map) && f.IsNil() { | ||
46 | continue // ignore unset fields | ||
47 | } | ||
48 | names = append(names, name) | ||
49 | } | ||
50 | |||
51 | for i, n := range names { | ||
52 | val := v.FieldByName(n) | ||
53 | buf.WriteString(strings.Repeat(" ", indent+2)) | ||
54 | buf.WriteString(n + ": ") | ||
55 | prettify(val, indent+2, buf) | ||
56 | |||
57 | if i < len(names)-1 { | ||
58 | buf.WriteString(",\n") | ||
59 | } | ||
60 | } | ||
61 | |||
62 | buf.WriteString("\n" + strings.Repeat(" ", indent) + "}") | ||
63 | case reflect.Slice: | ||
64 | strtype := v.Type().String() | ||
65 | if strtype == "[]uint8" { | ||
66 | fmt.Fprintf(buf, "<binary> len %d", v.Len()) | ||
67 | break | ||
68 | } | ||
69 | |||
70 | nl, id, id2 := "", "", "" | ||
71 | if v.Len() > 3 { | ||
72 | nl, id, id2 = "\n", strings.Repeat(" ", indent), strings.Repeat(" ", indent+2) | ||
73 | } | ||
74 | buf.WriteString("[" + nl) | ||
75 | for i := 0; i < v.Len(); i++ { | ||
76 | buf.WriteString(id2) | ||
77 | prettify(v.Index(i), indent+2, buf) | ||
78 | |||
79 | if i < v.Len()-1 { | ||
80 | buf.WriteString("," + nl) | ||
81 | } | ||
82 | } | ||
83 | |||
84 | buf.WriteString(nl + id + "]") | ||
85 | case reflect.Map: | ||
86 | buf.WriteString("{\n") | ||
87 | |||
88 | for i, k := range v.MapKeys() { | ||
89 | buf.WriteString(strings.Repeat(" ", indent+2)) | ||
90 | buf.WriteString(k.String() + ": ") | ||
91 | prettify(v.MapIndex(k), indent+2, buf) | ||
92 | |||
93 | if i < v.Len()-1 { | ||
94 | buf.WriteString(",\n") | ||
95 | } | ||
96 | } | ||
97 | |||
98 | buf.WriteString("\n" + strings.Repeat(" ", indent) + "}") | ||
99 | default: | ||
100 | if !v.IsValid() { | ||
101 | fmt.Fprint(buf, "<invalid value>") | ||
102 | return | ||
103 | } | ||
104 | format := "%v" | ||
105 | switch v.Interface().(type) { | ||
106 | case string: | ||
107 | format = "%q" | ||
108 | case io.ReadSeeker, io.Reader: | ||
109 | format = "buffer(%p)" | ||
110 | } | ||
111 | fmt.Fprintf(buf, format, v.Interface()) | ||
112 | } | ||
113 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/string_value.go b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/string_value.go new file mode 100644 index 0000000..b6432f1 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/string_value.go | |||
@@ -0,0 +1,89 @@ | |||
1 | package awsutil | ||
2 | |||
3 | import ( | ||
4 | "bytes" | ||
5 | "fmt" | ||
6 | "reflect" | ||
7 | "strings" | ||
8 | ) | ||
9 | |||
10 | // StringValue returns the string representation of a value. | ||
11 | func StringValue(i interface{}) string { | ||
12 | var buf bytes.Buffer | ||
13 | stringValue(reflect.ValueOf(i), 0, &buf) | ||
14 | return buf.String() | ||
15 | } | ||
16 | |||
17 | func stringValue(v reflect.Value, indent int, buf *bytes.Buffer) { | ||
18 | for v.Kind() == reflect.Ptr { | ||
19 | v = v.Elem() | ||
20 | } | ||
21 | |||
22 | switch v.Kind() { | ||
23 | case reflect.Struct: | ||
24 | buf.WriteString("{\n") | ||
25 | |||
26 | names := []string{} | ||
27 | for i := 0; i < v.Type().NumField(); i++ { | ||
28 | name := v.Type().Field(i).Name | ||
29 | f := v.Field(i) | ||
30 | if name[0:1] == strings.ToLower(name[0:1]) { | ||
31 | continue // ignore unexported fields | ||
32 | } | ||
33 | if (f.Kind() == reflect.Ptr || f.Kind() == reflect.Slice) && f.IsNil() { | ||
34 | continue // ignore unset fields | ||
35 | } | ||
36 | names = append(names, name) | ||
37 | } | ||
38 | |||
39 | for i, n := range names { | ||
40 | val := v.FieldByName(n) | ||
41 | buf.WriteString(strings.Repeat(" ", indent+2)) | ||
42 | buf.WriteString(n + ": ") | ||
43 | stringValue(val, indent+2, buf) | ||
44 | |||
45 | if i < len(names)-1 { | ||
46 | buf.WriteString(",\n") | ||
47 | } | ||
48 | } | ||
49 | |||
50 | buf.WriteString("\n" + strings.Repeat(" ", indent) + "}") | ||
51 | case reflect.Slice: | ||
52 | nl, id, id2 := "", "", "" | ||
53 | if v.Len() > 3 { | ||
54 | nl, id, id2 = "\n", strings.Repeat(" ", indent), strings.Repeat(" ", indent+2) | ||
55 | } | ||
56 | buf.WriteString("[" + nl) | ||
57 | for i := 0; i < v.Len(); i++ { | ||
58 | buf.WriteString(id2) | ||
59 | stringValue(v.Index(i), indent+2, buf) | ||
60 | |||
61 | if i < v.Len()-1 { | ||
62 | buf.WriteString("," + nl) | ||
63 | } | ||
64 | } | ||
65 | |||
66 | buf.WriteString(nl + id + "]") | ||
67 | case reflect.Map: | ||
68 | buf.WriteString("{\n") | ||
69 | |||
70 | for i, k := range v.MapKeys() { | ||
71 | buf.WriteString(strings.Repeat(" ", indent+2)) | ||
72 | buf.WriteString(k.String() + ": ") | ||
73 | stringValue(v.MapIndex(k), indent+2, buf) | ||
74 | |||
75 | if i < v.Len()-1 { | ||
76 | buf.WriteString(",\n") | ||
77 | } | ||
78 | } | ||
79 | |||
80 | buf.WriteString("\n" + strings.Repeat(" ", indent) + "}") | ||
81 | default: | ||
82 | format := "%v" | ||
83 | switch v.Interface().(type) { | ||
84 | case string: | ||
85 | format = "%q" | ||
86 | } | ||
87 | fmt.Fprintf(buf, format, v.Interface()) | ||
88 | } | ||
89 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/client/client.go b/vendor/github.com/aws/aws-sdk-go/aws/client/client.go new file mode 100644 index 0000000..48b0fbd --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/client/client.go | |||
@@ -0,0 +1,149 @@ | |||
1 | package client | ||
2 | |||
3 | import ( | ||
4 | "fmt" | ||
5 | "net/http/httputil" | ||
6 | |||
7 | "github.com/aws/aws-sdk-go/aws" | ||
8 | "github.com/aws/aws-sdk-go/aws/awserr" | ||
9 | "github.com/aws/aws-sdk-go/aws/client/metadata" | ||
10 | "github.com/aws/aws-sdk-go/aws/request" | ||
11 | ) | ||
12 | |||
13 | // A Config provides configuration to a service client instance. | ||
14 | type Config struct { | ||
15 | Config *aws.Config | ||
16 | Handlers request.Handlers | ||
17 | Endpoint string | ||
18 | SigningRegion string | ||
19 | SigningName string | ||
20 | } | ||
21 | |||
22 | // ConfigProvider provides a generic way for a service client to receive | ||
23 | // the ClientConfig without circular dependencies. | ||
24 | type ConfigProvider interface { | ||
25 | ClientConfig(serviceName string, cfgs ...*aws.Config) Config | ||
26 | } | ||
27 | |||
28 | // ConfigNoResolveEndpointProvider same as ConfigProvider except it will not | ||
29 | // resolve the endpoint automatically. The service client's endpoint must be | ||
30 | // provided via the aws.Config.Endpoint field. | ||
31 | type ConfigNoResolveEndpointProvider interface { | ||
32 | ClientConfigNoResolveEndpoint(cfgs ...*aws.Config) Config | ||
33 | } | ||
34 | |||
35 | // A Client implements the base client request and response handling | ||
36 | // used by all service clients. | ||
37 | type Client struct { | ||
38 | request.Retryer | ||
39 | metadata.ClientInfo | ||
40 | |||
41 | Config aws.Config | ||
42 | Handlers request.Handlers | ||
43 | } | ||
44 | |||
45 | // New will return a pointer to a new initialized service client. | ||
46 | func New(cfg aws.Config, info metadata.ClientInfo, handlers request.Handlers, options ...func(*Client)) *Client { | ||
47 | svc := &Client{ | ||
48 | Config: cfg, | ||
49 | ClientInfo: info, | ||
50 | Handlers: handlers.Copy(), | ||
51 | } | ||
52 | |||
53 | switch retryer, ok := cfg.Retryer.(request.Retryer); { | ||
54 | case ok: | ||
55 | svc.Retryer = retryer | ||
56 | case cfg.Retryer != nil && cfg.Logger != nil: | ||
57 | s := fmt.Sprintf("WARNING: %T does not implement request.Retryer; using DefaultRetryer instead", cfg.Retryer) | ||
58 | cfg.Logger.Log(s) | ||
59 | fallthrough | ||
60 | default: | ||
61 | maxRetries := aws.IntValue(cfg.MaxRetries) | ||
62 | if cfg.MaxRetries == nil || maxRetries == aws.UseServiceDefaultRetries { | ||
63 | maxRetries = 3 | ||
64 | } | ||
65 | svc.Retryer = DefaultRetryer{NumMaxRetries: maxRetries} | ||
66 | } | ||
67 | |||
68 | svc.AddDebugHandlers() | ||
69 | |||
70 | for _, option := range options { | ||
71 | option(svc) | ||
72 | } | ||
73 | |||
74 | return svc | ||
75 | } | ||
76 | |||
77 | // NewRequest returns a new Request pointer for the service API | ||
78 | // operation and parameters. | ||
79 | func (c *Client) NewRequest(operation *request.Operation, params interface{}, data interface{}) *request.Request { | ||
80 | return request.New(c.Config, c.ClientInfo, c.Handlers, c.Retryer, operation, params, data) | ||
81 | } | ||
82 | |||
83 | // AddDebugHandlers injects debug logging handlers into the service to log request | ||
84 | // debug information. | ||
85 | func (c *Client) AddDebugHandlers() { | ||
86 | if !c.Config.LogLevel.AtLeast(aws.LogDebug) { | ||
87 | return | ||
88 | } | ||
89 | |||
90 | c.Handlers.Send.PushFrontNamed(request.NamedHandler{Name: "awssdk.client.LogRequest", Fn: logRequest}) | ||
91 | c.Handlers.Send.PushBackNamed(request.NamedHandler{Name: "awssdk.client.LogResponse", Fn: logResponse}) | ||
92 | } | ||
93 | |||
94 | const logReqMsg = `DEBUG: Request %s/%s Details: | ||
95 | ---[ REQUEST POST-SIGN ]----------------------------- | ||
96 | %s | ||
97 | -----------------------------------------------------` | ||
98 | |||
99 | const logReqErrMsg = `DEBUG ERROR: Request %s/%s: | ||
100 | ---[ REQUEST DUMP ERROR ]----------------------------- | ||
101 | %s | ||
102 | -----------------------------------------------------` | ||
103 | |||
104 | func logRequest(r *request.Request) { | ||
105 | logBody := r.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody) | ||
106 | dumpedBody, err := httputil.DumpRequestOut(r.HTTPRequest, logBody) | ||
107 | if err != nil { | ||
108 | r.Config.Logger.Log(fmt.Sprintf(logReqErrMsg, r.ClientInfo.ServiceName, r.Operation.Name, err)) | ||
109 | r.Error = awserr.New(request.ErrCodeRead, "an error occurred during request body reading", err) | ||
110 | return | ||
111 | } | ||
112 | |||
113 | if logBody { | ||
114 | // Reset the request body because dumpRequest will re-wrap the r.HTTPRequest's | ||
115 | // Body as a NoOpCloser and will not be reset after read by the HTTP | ||
116 | // client reader. | ||
117 | r.ResetBody() | ||
118 | } | ||
119 | |||
120 | r.Config.Logger.Log(fmt.Sprintf(logReqMsg, r.ClientInfo.ServiceName, r.Operation.Name, string(dumpedBody))) | ||
121 | } | ||
122 | |||
123 | const logRespMsg = `DEBUG: Response %s/%s Details: | ||
124 | ---[ RESPONSE ]-------------------------------------- | ||
125 | %s | ||
126 | -----------------------------------------------------` | ||
127 | |||
128 | const logRespErrMsg = `DEBUG ERROR: Response %s/%s: | ||
129 | ---[ RESPONSE DUMP ERROR ]----------------------------- | ||
130 | %s | ||
131 | -----------------------------------------------------` | ||
132 | |||
133 | func logResponse(r *request.Request) { | ||
134 | var msg = "no response data" | ||
135 | if r.HTTPResponse != nil { | ||
136 | logBody := r.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody) | ||
137 | dumpedBody, err := httputil.DumpResponse(r.HTTPResponse, logBody) | ||
138 | if err != nil { | ||
139 | r.Config.Logger.Log(fmt.Sprintf(logRespErrMsg, r.ClientInfo.ServiceName, r.Operation.Name, err)) | ||
140 | r.Error = awserr.New(request.ErrCodeRead, "an error occurred during response body reading", err) | ||
141 | return | ||
142 | } | ||
143 | |||
144 | msg = string(dumpedBody) | ||
145 | } else if r.Error != nil { | ||
146 | msg = r.Error.Error() | ||
147 | } | ||
148 | r.Config.Logger.Log(fmt.Sprintf(logRespMsg, r.ClientInfo.ServiceName, r.Operation.Name, msg)) | ||
149 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/client/default_retryer.go b/vendor/github.com/aws/aws-sdk-go/aws/client/default_retryer.go new file mode 100644 index 0000000..1313478 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/client/default_retryer.go | |||
@@ -0,0 +1,96 @@ | |||
1 | package client | ||
2 | |||
3 | import ( | ||
4 | "math/rand" | ||
5 | "sync" | ||
6 | "time" | ||
7 | |||
8 | "github.com/aws/aws-sdk-go/aws/request" | ||
9 | ) | ||
10 | |||
11 | // DefaultRetryer implements basic retry logic using exponential backoff for | ||
12 | // most services. If you want to implement custom retry logic, implement the | ||
13 | // request.Retryer interface or create a structure type that composes this | ||
14 | // struct and override the specific methods. For example, to override only | ||
15 | // the MaxRetries method: | ||
16 | // | ||
17 | // type retryer struct { | ||
18 | // service.DefaultRetryer | ||
19 | // } | ||
20 | // | ||
21 | // // This implementation always has 100 max retries | ||
22 | // func (d retryer) MaxRetries() uint { return 100 } | ||
23 | type DefaultRetryer struct { | ||
24 | NumMaxRetries int | ||
25 | } | ||
26 | |||
27 | // MaxRetries returns the number of maximum returns the service will use to make | ||
28 | // an individual API request. | ||
29 | func (d DefaultRetryer) MaxRetries() int { | ||
30 | return d.NumMaxRetries | ||
31 | } | ||
32 | |||
33 | var seededRand = rand.New(&lockedSource{src: rand.NewSource(time.Now().UnixNano())}) | ||
34 | |||
35 | // RetryRules returns the delay duration before retrying this request again | ||
36 | func (d DefaultRetryer) RetryRules(r *request.Request) time.Duration { | ||
37 | // Set the upper limit of delay in retrying at ~five minutes | ||
38 | minTime := 30 | ||
39 | throttle := d.shouldThrottle(r) | ||
40 | if throttle { | ||
41 | minTime = 500 | ||
42 | } | ||
43 | |||
44 | retryCount := r.RetryCount | ||
45 | if retryCount > 13 { | ||
46 | retryCount = 13 | ||
47 | } else if throttle && retryCount > 8 { | ||
48 | retryCount = 8 | ||
49 | } | ||
50 | |||
51 | delay := (1 << uint(retryCount)) * (seededRand.Intn(minTime) + minTime) | ||
52 | return time.Duration(delay) * time.Millisecond | ||
53 | } | ||
54 | |||
55 | // ShouldRetry returns true if the request should be retried. | ||
56 | func (d DefaultRetryer) ShouldRetry(r *request.Request) bool { | ||
57 | // If one of the other handlers already set the retry state | ||
58 | // we don't want to override it based on the service's state | ||
59 | if r.Retryable != nil { | ||
60 | return *r.Retryable | ||
61 | } | ||
62 | |||
63 | if r.HTTPResponse.StatusCode >= 500 { | ||
64 | return true | ||
65 | } | ||
66 | return r.IsErrorRetryable() || d.shouldThrottle(r) | ||
67 | } | ||
68 | |||
69 | // ShouldThrottle returns true if the request should be throttled. | ||
70 | func (d DefaultRetryer) shouldThrottle(r *request.Request) bool { | ||
71 | if r.HTTPResponse.StatusCode == 502 || | ||
72 | r.HTTPResponse.StatusCode == 503 || | ||
73 | r.HTTPResponse.StatusCode == 504 { | ||
74 | return true | ||
75 | } | ||
76 | return r.IsErrorThrottle() | ||
77 | } | ||
78 | |||
79 | // lockedSource is a thread-safe implementation of rand.Source | ||
80 | type lockedSource struct { | ||
81 | lk sync.Mutex | ||
82 | src rand.Source | ||
83 | } | ||
84 | |||
85 | func (r *lockedSource) Int63() (n int64) { | ||
86 | r.lk.Lock() | ||
87 | n = r.src.Int63() | ||
88 | r.lk.Unlock() | ||
89 | return | ||
90 | } | ||
91 | |||
92 | func (r *lockedSource) Seed(seed int64) { | ||
93 | r.lk.Lock() | ||
94 | r.src.Seed(seed) | ||
95 | r.lk.Unlock() | ||
96 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go b/vendor/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go new file mode 100644 index 0000000..4778056 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go | |||
@@ -0,0 +1,12 @@ | |||
1 | package metadata | ||
2 | |||
3 | // ClientInfo wraps immutable data from the client.Client structure. | ||
4 | type ClientInfo struct { | ||
5 | ServiceName string | ||
6 | APIVersion string | ||
7 | Endpoint string | ||
8 | SigningName string | ||
9 | SigningRegion string | ||
10 | JSONVersion string | ||
11 | TargetPrefix string | ||
12 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/config.go b/vendor/github.com/aws/aws-sdk-go/aws/config.go new file mode 100644 index 0000000..d1f31f1 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/config.go | |||
@@ -0,0 +1,470 @@ | |||
1 | package aws | ||
2 | |||
3 | import ( | ||
4 | "net/http" | ||
5 | "time" | ||
6 | |||
7 | "github.com/aws/aws-sdk-go/aws/credentials" | ||
8 | "github.com/aws/aws-sdk-go/aws/endpoints" | ||
9 | ) | ||
10 | |||
11 | // UseServiceDefaultRetries instructs the config to use the service's own | ||
12 | // default number of retries. This will be the default action if | ||
13 | // Config.MaxRetries is nil also. | ||
14 | const UseServiceDefaultRetries = -1 | ||
15 | |||
16 | // RequestRetryer is an alias for a type that implements the request.Retryer | ||
17 | // interface. | ||
18 | type RequestRetryer interface{} | ||
19 | |||
20 | // A Config provides service configuration for service clients. By default, | ||
21 | // all clients will use the defaults.DefaultConfig tructure. | ||
22 | // | ||
23 | // // Create Session with MaxRetry configuration to be shared by multiple | ||
24 | // // service clients. | ||
25 | // sess := session.Must(session.NewSession(&aws.Config{ | ||
26 | // MaxRetries: aws.Int(3), | ||
27 | // })) | ||
28 | // | ||
29 | // // Create S3 service client with a specific Region. | ||
30 | // svc := s3.New(sess, &aws.Config{ | ||
31 | // Region: aws.String("us-west-2"), | ||
32 | // }) | ||
33 | type Config struct { | ||
34 | // Enables verbose error printing of all credential chain errors. | ||
35 | // Should be used when wanting to see all errors while attempting to | ||
36 | // retrieve credentials. | ||
37 | CredentialsChainVerboseErrors *bool | ||
38 | |||
39 | // The credentials object to use when signing requests. Defaults to a | ||
40 | // chain of credential providers to search for credentials in environment | ||
41 | // variables, shared credential file, and EC2 Instance Roles. | ||
42 | Credentials *credentials.Credentials | ||
43 | |||
44 | // An optional endpoint URL (hostname only or fully qualified URI) | ||
45 | // that overrides the default generated endpoint for a client. Set this | ||
46 | // to `""` to use the default generated endpoint. | ||
47 | // | ||
48 | // @note You must still provide a `Region` value when specifying an | ||
49 | // endpoint for a client. | ||
50 | Endpoint *string | ||
51 | |||
52 | // The resolver to use for looking up endpoints for AWS service clients | ||
53 | // to use based on region. | ||
54 | EndpointResolver endpoints.Resolver | ||
55 | |||
56 | // EnforceShouldRetryCheck is used in the AfterRetryHandler to always call | ||
57 | // ShouldRetry regardless of whether or not if request.Retryable is set. | ||
58 | // This will utilize ShouldRetry method of custom retryers. If EnforceShouldRetryCheck | ||
59 | // is not set, then ShouldRetry will only be called if request.Retryable is nil. | ||
60 | // Proper handling of the request.Retryable field is important when setting this field. | ||
61 | EnforceShouldRetryCheck *bool | ||
62 | |||
63 | // The region to send requests to. This parameter is required and must | ||
64 | // be configured globally or on a per-client basis unless otherwise | ||
65 | // noted. A full list of regions is found in the "Regions and Endpoints" | ||
66 | // document. | ||
67 | // | ||
68 | // @see http://docs.aws.amazon.com/general/latest/gr/rande.html | ||
69 | // AWS Regions and Endpoints | ||
70 | Region *string | ||
71 | |||
72 | // Set this to `true` to disable SSL when sending requests. Defaults | ||
73 | // to `false`. | ||
74 | DisableSSL *bool | ||
75 | |||
76 | // The HTTP client to use when sending requests. Defaults to | ||
77 | // `http.DefaultClient`. | ||
78 | HTTPClient *http.Client | ||
79 | |||
80 | // An integer value representing the logging level. The default log level | ||
81 | // is zero (LogOff), which represents no logging. To enable logging set | ||
82 | // to a LogLevel Value. | ||
83 | LogLevel *LogLevelType | ||
84 | |||
85 | // The logger writer interface to write logging messages to. Defaults to | ||
86 | // standard out. | ||
87 | Logger Logger | ||
88 | |||
89 | // The maximum number of times that a request will be retried for failures. | ||
90 | // Defaults to -1, which defers the max retry setting to the service | ||
91 | // specific configuration. | ||
92 | MaxRetries *int | ||
93 | |||
94 | // Retryer guides how HTTP requests should be retried in case of | ||
95 | // recoverable failures. | ||
96 | // | ||
97 | // When nil or the value does not implement the request.Retryer interface, | ||
98 | // the request.DefaultRetryer will be used. | ||
99 | // | ||
100 | // When both Retryer and MaxRetries are non-nil, the former is used and | ||
101 | // the latter ignored. | ||
102 | // | ||
103 | // To set the Retryer field in a type-safe manner and with chaining, use | ||
104 | // the request.WithRetryer helper function: | ||
105 | // | ||
106 | // cfg := request.WithRetryer(aws.NewConfig(), myRetryer) | ||
107 | // | ||
108 | Retryer RequestRetryer | ||
109 | |||
110 | // Disables semantic parameter validation, which validates input for | ||
111 | // missing required fields and/or other semantic request input errors. | ||
112 | DisableParamValidation *bool | ||
113 | |||
114 | // Disables the computation of request and response checksums, e.g., | ||
115 | // CRC32 checksums in Amazon DynamoDB. | ||
116 | DisableComputeChecksums *bool | ||
117 | |||
118 | // Set this to `true` to force the request to use path-style addressing, | ||
119 | // i.e., `http://s3.amazonaws.com/BUCKET/KEY`. By default, the S3 client | ||
120 | // will use virtual hosted bucket addressing when possible | ||
121 | // (`http://BUCKET.s3.amazonaws.com/KEY`). | ||
122 | // | ||
123 | // @note This configuration option is specific to the Amazon S3 service. | ||
124 | // @see http://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html | ||
125 | // Amazon S3: Virtual Hosting of Buckets | ||
126 | S3ForcePathStyle *bool | ||
127 | |||
128 | // Set this to `true` to disable the SDK adding the `Expect: 100-Continue` | ||
129 | // header to PUT requests over 2MB of content. 100-Continue instructs the | ||
130 | // HTTP client not to send the body until the service responds with a | ||
131 | // `continue` status. This is useful to prevent sending the request body | ||
132 | // until after the request is authenticated, and validated. | ||
133 | // | ||
134 | // http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPUT.html | ||
135 | // | ||
136 | // 100-Continue is only enabled for Go 1.6 and above. See `http.Transport`'s | ||
137 | // `ExpectContinueTimeout` for information on adjusting the continue wait | ||
138 | // timeout. https://golang.org/pkg/net/http/#Transport | ||
139 | // | ||
140 | // You should use this flag to disble 100-Continue if you experience issues | ||
141 | // with proxies or third party S3 compatible services. | ||
142 | S3Disable100Continue *bool | ||
143 | |||
144 | // Set this to `true` to enable S3 Accelerate feature. For all operations | ||
145 | // compatible with S3 Accelerate will use the accelerate endpoint for | ||
146 | // requests. Requests not compatible will fall back to normal S3 requests. | ||
147 | // | ||
148 | // The bucket must be enable for accelerate to be used with S3 client with | ||
149 | // accelerate enabled. If the bucket is not enabled for accelerate an error | ||
150 | // will be returned. The bucket name must be DNS compatible to also work | ||
151 | // with accelerate. | ||
152 | S3UseAccelerate *bool | ||
153 | |||
154 | // Set this to `true` to disable the EC2Metadata client from overriding the | ||
155 | // default http.Client's Timeout. This is helpful if you do not want the | ||
156 | // EC2Metadata client to create a new http.Client. This options is only | ||
157 | // meaningful if you're not already using a custom HTTP client with the | ||
158 | // SDK. Enabled by default. | ||
159 | // | ||
160 | // Must be set and provided to the session.NewSession() in order to disable | ||
161 | // the EC2Metadata overriding the timeout for default credentials chain. | ||
162 | // | ||
163 | // Example: | ||
164 | // sess := session.Must(session.NewSession(aws.NewConfig() | ||
165 | // .WithEC2MetadataDiableTimeoutOverride(true))) | ||
166 | // | ||
167 | // svc := s3.New(sess) | ||
168 | // | ||
169 | EC2MetadataDisableTimeoutOverride *bool | ||
170 | |||
171 | // Instructs the endpiont to be generated for a service client to | ||
172 | // be the dual stack endpoint. The dual stack endpoint will support | ||
173 | // both IPv4 and IPv6 addressing. | ||
174 | // | ||
175 | // Setting this for a service which does not support dual stack will fail | ||
176 | // to make requets. It is not recommended to set this value on the session | ||
177 | // as it will apply to all service clients created with the session. Even | ||
178 | // services which don't support dual stack endpoints. | ||
179 | // | ||
180 | // If the Endpoint config value is also provided the UseDualStack flag | ||
181 | // will be ignored. | ||
182 | // | ||
183 | // Only supported with. | ||
184 | // | ||
185 | // sess := session.Must(session.NewSession()) | ||
186 | // | ||
187 | // svc := s3.New(sess, &aws.Config{ | ||
188 | // UseDualStack: aws.Bool(true), | ||
189 | // }) | ||
190 | UseDualStack *bool | ||
191 | |||
192 | // SleepDelay is an override for the func the SDK will call when sleeping | ||
193 | // during the lifecycle of a request. Specifically this will be used for | ||
194 | // request delays. This value should only be used for testing. To adjust | ||
195 | // the delay of a request see the aws/client.DefaultRetryer and | ||
196 | // aws/request.Retryer. | ||
197 | // | ||
198 | // SleepDelay will prevent any Context from being used for canceling retry | ||
199 | // delay of an API operation. It is recommended to not use SleepDelay at all | ||
200 | // and specify a Retryer instead. | ||
201 | SleepDelay func(time.Duration) | ||
202 | |||
203 | // DisableRestProtocolURICleaning will not clean the URL path when making rest protocol requests. | ||
204 | // Will default to false. This would only be used for empty directory names in s3 requests. | ||
205 | // | ||
206 | // Example: | ||
207 | // sess := session.Must(session.NewSession(&aws.Config{ | ||
208 | // DisableRestProtocolURICleaning: aws.Bool(true), | ||
209 | // })) | ||
210 | // | ||
211 | // svc := s3.New(sess) | ||
212 | // out, err := svc.GetObject(&s3.GetObjectInput { | ||
213 | // Bucket: aws.String("bucketname"), | ||
214 | // Key: aws.String("//foo//bar//moo"), | ||
215 | // }) | ||
216 | DisableRestProtocolURICleaning *bool | ||
217 | } | ||
218 | |||
219 | // NewConfig returns a new Config pointer that can be chained with builder | ||
220 | // methods to set multiple configuration values inline without using pointers. | ||
221 | // | ||
222 | // // Create Session with MaxRetry configuration to be shared by multiple | ||
223 | // // service clients. | ||
224 | // sess := session.Must(session.NewSession(aws.NewConfig(). | ||
225 | // WithMaxRetries(3), | ||
226 | // )) | ||
227 | // | ||
228 | // // Create S3 service client with a specific Region. | ||
229 | // svc := s3.New(sess, aws.NewConfig(). | ||
230 | // WithRegion("us-west-2"), | ||
231 | // ) | ||
232 | func NewConfig() *Config { | ||
233 | return &Config{} | ||
234 | } | ||
235 | |||
236 | // WithCredentialsChainVerboseErrors sets a config verbose errors boolean and returning | ||
237 | // a Config pointer. | ||
238 | func (c *Config) WithCredentialsChainVerboseErrors(verboseErrs bool) *Config { | ||
239 | c.CredentialsChainVerboseErrors = &verboseErrs | ||
240 | return c | ||
241 | } | ||
242 | |||
243 | // WithCredentials sets a config Credentials value returning a Config pointer | ||
244 | // for chaining. | ||
245 | func (c *Config) WithCredentials(creds *credentials.Credentials) *Config { | ||
246 | c.Credentials = creds | ||
247 | return c | ||
248 | } | ||
249 | |||
250 | // WithEndpoint sets a config Endpoint value returning a Config pointer for | ||
251 | // chaining. | ||
252 | func (c *Config) WithEndpoint(endpoint string) *Config { | ||
253 | c.Endpoint = &endpoint | ||
254 | return c | ||
255 | } | ||
256 | |||
257 | // WithEndpointResolver sets a config EndpointResolver value returning a | ||
258 | // Config pointer for chaining. | ||
259 | func (c *Config) WithEndpointResolver(resolver endpoints.Resolver) *Config { | ||
260 | c.EndpointResolver = resolver | ||
261 | return c | ||
262 | } | ||
263 | |||
264 | // WithRegion sets a config Region value returning a Config pointer for | ||
265 | // chaining. | ||
266 | func (c *Config) WithRegion(region string) *Config { | ||
267 | c.Region = ®ion | ||
268 | return c | ||
269 | } | ||
270 | |||
271 | // WithDisableSSL sets a config DisableSSL value returning a Config pointer | ||
272 | // for chaining. | ||
273 | func (c *Config) WithDisableSSL(disable bool) *Config { | ||
274 | c.DisableSSL = &disable | ||
275 | return c | ||
276 | } | ||
277 | |||
278 | // WithHTTPClient sets a config HTTPClient value returning a Config pointer | ||
279 | // for chaining. | ||
280 | func (c *Config) WithHTTPClient(client *http.Client) *Config { | ||
281 | c.HTTPClient = client | ||
282 | return c | ||
283 | } | ||
284 | |||
285 | // WithMaxRetries sets a config MaxRetries value returning a Config pointer | ||
286 | // for chaining. | ||
287 | func (c *Config) WithMaxRetries(max int) *Config { | ||
288 | c.MaxRetries = &max | ||
289 | return c | ||
290 | } | ||
291 | |||
292 | // WithDisableParamValidation sets a config DisableParamValidation value | ||
293 | // returning a Config pointer for chaining. | ||
294 | func (c *Config) WithDisableParamValidation(disable bool) *Config { | ||
295 | c.DisableParamValidation = &disable | ||
296 | return c | ||
297 | } | ||
298 | |||
299 | // WithDisableComputeChecksums sets a config DisableComputeChecksums value | ||
300 | // returning a Config pointer for chaining. | ||
301 | func (c *Config) WithDisableComputeChecksums(disable bool) *Config { | ||
302 | c.DisableComputeChecksums = &disable | ||
303 | return c | ||
304 | } | ||
305 | |||
306 | // WithLogLevel sets a config LogLevel value returning a Config pointer for | ||
307 | // chaining. | ||
308 | func (c *Config) WithLogLevel(level LogLevelType) *Config { | ||
309 | c.LogLevel = &level | ||
310 | return c | ||
311 | } | ||
312 | |||
313 | // WithLogger sets a config Logger value returning a Config pointer for | ||
314 | // chaining. | ||
315 | func (c *Config) WithLogger(logger Logger) *Config { | ||
316 | c.Logger = logger | ||
317 | return c | ||
318 | } | ||
319 | |||
320 | // WithS3ForcePathStyle sets a config S3ForcePathStyle value returning a Config | ||
321 | // pointer for chaining. | ||
322 | func (c *Config) WithS3ForcePathStyle(force bool) *Config { | ||
323 | c.S3ForcePathStyle = &force | ||
324 | return c | ||
325 | } | ||
326 | |||
327 | // WithS3Disable100Continue sets a config S3Disable100Continue value returning | ||
328 | // a Config pointer for chaining. | ||
329 | func (c *Config) WithS3Disable100Continue(disable bool) *Config { | ||
330 | c.S3Disable100Continue = &disable | ||
331 | return c | ||
332 | } | ||
333 | |||
334 | // WithS3UseAccelerate sets a config S3UseAccelerate value returning a Config | ||
335 | // pointer for chaining. | ||
336 | func (c *Config) WithS3UseAccelerate(enable bool) *Config { | ||
337 | c.S3UseAccelerate = &enable | ||
338 | return c | ||
339 | } | ||
340 | |||
341 | // WithUseDualStack sets a config UseDualStack value returning a Config | ||
342 | // pointer for chaining. | ||
343 | func (c *Config) WithUseDualStack(enable bool) *Config { | ||
344 | c.UseDualStack = &enable | ||
345 | return c | ||
346 | } | ||
347 | |||
348 | // WithEC2MetadataDisableTimeoutOverride sets a config EC2MetadataDisableTimeoutOverride value | ||
349 | // returning a Config pointer for chaining. | ||
350 | func (c *Config) WithEC2MetadataDisableTimeoutOverride(enable bool) *Config { | ||
351 | c.EC2MetadataDisableTimeoutOverride = &enable | ||
352 | return c | ||
353 | } | ||
354 | |||
355 | // WithSleepDelay overrides the function used to sleep while waiting for the | ||
356 | // next retry. Defaults to time.Sleep. | ||
357 | func (c *Config) WithSleepDelay(fn func(time.Duration)) *Config { | ||
358 | c.SleepDelay = fn | ||
359 | return c | ||
360 | } | ||
361 | |||
362 | // MergeIn merges the passed in configs into the existing config object. | ||
363 | func (c *Config) MergeIn(cfgs ...*Config) { | ||
364 | for _, other := range cfgs { | ||
365 | mergeInConfig(c, other) | ||
366 | } | ||
367 | } | ||
368 | |||
369 | func mergeInConfig(dst *Config, other *Config) { | ||
370 | if other == nil { | ||
371 | return | ||
372 | } | ||
373 | |||
374 | if other.CredentialsChainVerboseErrors != nil { | ||
375 | dst.CredentialsChainVerboseErrors = other.CredentialsChainVerboseErrors | ||
376 | } | ||
377 | |||
378 | if other.Credentials != nil { | ||
379 | dst.Credentials = other.Credentials | ||
380 | } | ||
381 | |||
382 | if other.Endpoint != nil { | ||
383 | dst.Endpoint = other.Endpoint | ||
384 | } | ||
385 | |||
386 | if other.EndpointResolver != nil { | ||
387 | dst.EndpointResolver = other.EndpointResolver | ||
388 | } | ||
389 | |||
390 | if other.Region != nil { | ||
391 | dst.Region = other.Region | ||
392 | } | ||
393 | |||
394 | if other.DisableSSL != nil { | ||
395 | dst.DisableSSL = other.DisableSSL | ||
396 | } | ||
397 | |||
398 | if other.HTTPClient != nil { | ||
399 | dst.HTTPClient = other.HTTPClient | ||
400 | } | ||
401 | |||
402 | if other.LogLevel != nil { | ||
403 | dst.LogLevel = other.LogLevel | ||
404 | } | ||
405 | |||
406 | if other.Logger != nil { | ||
407 | dst.Logger = other.Logger | ||
408 | } | ||
409 | |||
410 | if other.MaxRetries != nil { | ||
411 | dst.MaxRetries = other.MaxRetries | ||
412 | } | ||
413 | |||
414 | if other.Retryer != nil { | ||
415 | dst.Retryer = other.Retryer | ||
416 | } | ||
417 | |||
418 | if other.DisableParamValidation != nil { | ||
419 | dst.DisableParamValidation = other.DisableParamValidation | ||
420 | } | ||
421 | |||
422 | if other.DisableComputeChecksums != nil { | ||
423 | dst.DisableComputeChecksums = other.DisableComputeChecksums | ||
424 | } | ||
425 | |||
426 | if other.S3ForcePathStyle != nil { | ||
427 | dst.S3ForcePathStyle = other.S3ForcePathStyle | ||
428 | } | ||
429 | |||
430 | if other.S3Disable100Continue != nil { | ||
431 | dst.S3Disable100Continue = other.S3Disable100Continue | ||
432 | } | ||
433 | |||
434 | if other.S3UseAccelerate != nil { | ||
435 | dst.S3UseAccelerate = other.S3UseAccelerate | ||
436 | } | ||
437 | |||
438 | if other.UseDualStack != nil { | ||
439 | dst.UseDualStack = other.UseDualStack | ||
440 | } | ||
441 | |||
442 | if other.EC2MetadataDisableTimeoutOverride != nil { | ||
443 | dst.EC2MetadataDisableTimeoutOverride = other.EC2MetadataDisableTimeoutOverride | ||
444 | } | ||
445 | |||
446 | if other.SleepDelay != nil { | ||
447 | dst.SleepDelay = other.SleepDelay | ||
448 | } | ||
449 | |||
450 | if other.DisableRestProtocolURICleaning != nil { | ||
451 | dst.DisableRestProtocolURICleaning = other.DisableRestProtocolURICleaning | ||
452 | } | ||
453 | |||
454 | if other.EnforceShouldRetryCheck != nil { | ||
455 | dst.EnforceShouldRetryCheck = other.EnforceShouldRetryCheck | ||
456 | } | ||
457 | } | ||
458 | |||
459 | // Copy will return a shallow copy of the Config object. If any additional | ||
460 | // configurations are provided they will be merged into the new config returned. | ||
461 | func (c *Config) Copy(cfgs ...*Config) *Config { | ||
462 | dst := &Config{} | ||
463 | dst.MergeIn(c) | ||
464 | |||
465 | for _, cfg := range cfgs { | ||
466 | dst.MergeIn(cfg) | ||
467 | } | ||
468 | |||
469 | return dst | ||
470 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/context.go b/vendor/github.com/aws/aws-sdk-go/aws/context.go new file mode 100644 index 0000000..79f4268 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/context.go | |||
@@ -0,0 +1,71 @@ | |||
1 | package aws | ||
2 | |||
3 | import ( | ||
4 | "time" | ||
5 | ) | ||
6 | |||
7 | // Context is an copy of the Go v1.7 stdlib's context.Context interface. | ||
8 | // It is represented as a SDK interface to enable you to use the "WithContext" | ||
9 | // API methods with Go v1.6 and a Context type such as golang.org/x/net/context. | ||
10 | // | ||
11 | // See https://golang.org/pkg/context on how to use contexts. | ||
12 | type Context interface { | ||
13 | // Deadline returns the time when work done on behalf of this context | ||
14 | // should be canceled. Deadline returns ok==false when no deadline is | ||
15 | // set. Successive calls to Deadline return the same results. | ||
16 | Deadline() (deadline time.Time, ok bool) | ||
17 | |||
18 | // Done returns a channel that's closed when work done on behalf of this | ||
19 | // context should be canceled. Done may return nil if this context can | ||
20 | // never be canceled. Successive calls to Done return the same value. | ||
21 | Done() <-chan struct{} | ||
22 | |||
23 | // Err returns a non-nil error value after Done is closed. Err returns | ||
24 | // Canceled if the context was canceled or DeadlineExceeded if the | ||
25 | // context's deadline passed. No other values for Err are defined. | ||
26 | // After Done is closed, successive calls to Err return the same value. | ||
27 | Err() error | ||
28 | |||
29 | // Value returns the value associated with this context for key, or nil | ||
30 | // if no value is associated with key. Successive calls to Value with | ||
31 | // the same key returns the same result. | ||
32 | // | ||
33 | // Use context values only for request-scoped data that transits | ||
34 | // processes and API boundaries, not for passing optional parameters to | ||
35 | // functions. | ||
36 | Value(key interface{}) interface{} | ||
37 | } | ||
38 | |||
39 | // BackgroundContext returns a context that will never be canceled, has no | ||
40 | // values, and no deadline. This context is used by the SDK to provide | ||
41 | // backwards compatibility with non-context API operations and functionality. | ||
42 | // | ||
43 | // Go 1.6 and before: | ||
44 | // This context function is equivalent to context.Background in the Go stdlib. | ||
45 | // | ||
46 | // Go 1.7 and later: | ||
47 | // The context returned will be the value returned by context.Background() | ||
48 | // | ||
49 | // See https://golang.org/pkg/context for more information on Contexts. | ||
50 | func BackgroundContext() Context { | ||
51 | return backgroundCtx | ||
52 | } | ||
53 | |||
54 | // SleepWithContext will wait for the timer duration to expire, or the context | ||
55 | // is canceled. Which ever happens first. If the context is canceled the Context's | ||
56 | // error will be returned. | ||
57 | // | ||
58 | // Expects Context to always return a non-nil error if the Done channel is closed. | ||
59 | func SleepWithContext(ctx Context, dur time.Duration) error { | ||
60 | t := time.NewTimer(dur) | ||
61 | defer t.Stop() | ||
62 | |||
63 | select { | ||
64 | case <-t.C: | ||
65 | break | ||
66 | case <-ctx.Done(): | ||
67 | return ctx.Err() | ||
68 | } | ||
69 | |||
70 | return nil | ||
71 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/context_1_6.go b/vendor/github.com/aws/aws-sdk-go/aws/context_1_6.go new file mode 100644 index 0000000..e8cf93d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/context_1_6.go | |||
@@ -0,0 +1,41 @@ | |||
1 | // +build !go1.7 | ||
2 | |||
3 | package aws | ||
4 | |||
5 | import "time" | ||
6 | |||
7 | // An emptyCtx is a copy of the the Go 1.7 context.emptyCtx type. This | ||
8 | // is copied to provide a 1.6 and 1.5 safe version of context that is compatible | ||
9 | // with Go 1.7's Context. | ||
10 | // | ||
11 | // An emptyCtx is never canceled, has no values, and has no deadline. It is not | ||
12 | // struct{}, since vars of this type must have distinct addresses. | ||
13 | type emptyCtx int | ||
14 | |||
15 | func (*emptyCtx) Deadline() (deadline time.Time, ok bool) { | ||
16 | return | ||
17 | } | ||
18 | |||
19 | func (*emptyCtx) Done() <-chan struct{} { | ||
20 | return nil | ||
21 | } | ||
22 | |||
23 | func (*emptyCtx) Err() error { | ||
24 | return nil | ||
25 | } | ||
26 | |||
27 | func (*emptyCtx) Value(key interface{}) interface{} { | ||
28 | return nil | ||
29 | } | ||
30 | |||
31 | func (e *emptyCtx) String() string { | ||
32 | switch e { | ||
33 | case backgroundCtx: | ||
34 | return "aws.BackgroundContext" | ||
35 | } | ||
36 | return "unknown empty Context" | ||
37 | } | ||
38 | |||
39 | var ( | ||
40 | backgroundCtx = new(emptyCtx) | ||
41 | ) | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/context_1_7.go b/vendor/github.com/aws/aws-sdk-go/aws/context_1_7.go new file mode 100644 index 0000000..064f75c --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/context_1_7.go | |||
@@ -0,0 +1,9 @@ | |||
1 | // +build go1.7 | ||
2 | |||
3 | package aws | ||
4 | |||
5 | import "context" | ||
6 | |||
7 | var ( | ||
8 | backgroundCtx = context.Background() | ||
9 | ) | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/convert_types.go b/vendor/github.com/aws/aws-sdk-go/aws/convert_types.go new file mode 100644 index 0000000..3b73a7d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/convert_types.go | |||
@@ -0,0 +1,369 @@ | |||
1 | package aws | ||
2 | |||
3 | import "time" | ||
4 | |||
5 | // String returns a pointer to the string value passed in. | ||
6 | func String(v string) *string { | ||
7 | return &v | ||
8 | } | ||
9 | |||
10 | // StringValue returns the value of the string pointer passed in or | ||
11 | // "" if the pointer is nil. | ||
12 | func StringValue(v *string) string { | ||
13 | if v != nil { | ||
14 | return *v | ||
15 | } | ||
16 | return "" | ||
17 | } | ||
18 | |||
19 | // StringSlice converts a slice of string values into a slice of | ||
20 | // string pointers | ||
21 | func StringSlice(src []string) []*string { | ||
22 | dst := make([]*string, len(src)) | ||
23 | for i := 0; i < len(src); i++ { | ||
24 | dst[i] = &(src[i]) | ||
25 | } | ||
26 | return dst | ||
27 | } | ||
28 | |||
29 | // StringValueSlice converts a slice of string pointers into a slice of | ||
30 | // string values | ||
31 | func StringValueSlice(src []*string) []string { | ||
32 | dst := make([]string, len(src)) | ||
33 | for i := 0; i < len(src); i++ { | ||
34 | if src[i] != nil { | ||
35 | dst[i] = *(src[i]) | ||
36 | } | ||
37 | } | ||
38 | return dst | ||
39 | } | ||
40 | |||
41 | // StringMap converts a string map of string values into a string | ||
42 | // map of string pointers | ||
43 | func StringMap(src map[string]string) map[string]*string { | ||
44 | dst := make(map[string]*string) | ||
45 | for k, val := range src { | ||
46 | v := val | ||
47 | dst[k] = &v | ||
48 | } | ||
49 | return dst | ||
50 | } | ||
51 | |||
52 | // StringValueMap converts a string map of string pointers into a string | ||
53 | // map of string values | ||
54 | func StringValueMap(src map[string]*string) map[string]string { | ||
55 | dst := make(map[string]string) | ||
56 | for k, val := range src { | ||
57 | if val != nil { | ||
58 | dst[k] = *val | ||
59 | } | ||
60 | } | ||
61 | return dst | ||
62 | } | ||
63 | |||
64 | // Bool returns a pointer to the bool value passed in. | ||
65 | func Bool(v bool) *bool { | ||
66 | return &v | ||
67 | } | ||
68 | |||
69 | // BoolValue returns the value of the bool pointer passed in or | ||
70 | // false if the pointer is nil. | ||
71 | func BoolValue(v *bool) bool { | ||
72 | if v != nil { | ||
73 | return *v | ||
74 | } | ||
75 | return false | ||
76 | } | ||
77 | |||
78 | // BoolSlice converts a slice of bool values into a slice of | ||
79 | // bool pointers | ||
80 | func BoolSlice(src []bool) []*bool { | ||
81 | dst := make([]*bool, len(src)) | ||
82 | for i := 0; i < len(src); i++ { | ||
83 | dst[i] = &(src[i]) | ||
84 | } | ||
85 | return dst | ||
86 | } | ||
87 | |||
88 | // BoolValueSlice converts a slice of bool pointers into a slice of | ||
89 | // bool values | ||
90 | func BoolValueSlice(src []*bool) []bool { | ||
91 | dst := make([]bool, len(src)) | ||
92 | for i := 0; i < len(src); i++ { | ||
93 | if src[i] != nil { | ||
94 | dst[i] = *(src[i]) | ||
95 | } | ||
96 | } | ||
97 | return dst | ||
98 | } | ||
99 | |||
100 | // BoolMap converts a string map of bool values into a string | ||
101 | // map of bool pointers | ||
102 | func BoolMap(src map[string]bool) map[string]*bool { | ||
103 | dst := make(map[string]*bool) | ||
104 | for k, val := range src { | ||
105 | v := val | ||
106 | dst[k] = &v | ||
107 | } | ||
108 | return dst | ||
109 | } | ||
110 | |||
111 | // BoolValueMap converts a string map of bool pointers into a string | ||
112 | // map of bool values | ||
113 | func BoolValueMap(src map[string]*bool) map[string]bool { | ||
114 | dst := make(map[string]bool) | ||
115 | for k, val := range src { | ||
116 | if val != nil { | ||
117 | dst[k] = *val | ||
118 | } | ||
119 | } | ||
120 | return dst | ||
121 | } | ||
122 | |||
123 | // Int returns a pointer to the int value passed in. | ||
124 | func Int(v int) *int { | ||
125 | return &v | ||
126 | } | ||
127 | |||
128 | // IntValue returns the value of the int pointer passed in or | ||
129 | // 0 if the pointer is nil. | ||
130 | func IntValue(v *int) int { | ||
131 | if v != nil { | ||
132 | return *v | ||
133 | } | ||
134 | return 0 | ||
135 | } | ||
136 | |||
137 | // IntSlice converts a slice of int values into a slice of | ||
138 | // int pointers | ||
139 | func IntSlice(src []int) []*int { | ||
140 | dst := make([]*int, len(src)) | ||
141 | for i := 0; i < len(src); i++ { | ||
142 | dst[i] = &(src[i]) | ||
143 | } | ||
144 | return dst | ||
145 | } | ||
146 | |||
147 | // IntValueSlice converts a slice of int pointers into a slice of | ||
148 | // int values | ||
149 | func IntValueSlice(src []*int) []int { | ||
150 | dst := make([]int, len(src)) | ||
151 | for i := 0; i < len(src); i++ { | ||
152 | if src[i] != nil { | ||
153 | dst[i] = *(src[i]) | ||
154 | } | ||
155 | } | ||
156 | return dst | ||
157 | } | ||
158 | |||
159 | // IntMap converts a string map of int values into a string | ||
160 | // map of int pointers | ||
161 | func IntMap(src map[string]int) map[string]*int { | ||
162 | dst := make(map[string]*int) | ||
163 | for k, val := range src { | ||
164 | v := val | ||
165 | dst[k] = &v | ||
166 | } | ||
167 | return dst | ||
168 | } | ||
169 | |||
170 | // IntValueMap converts a string map of int pointers into a string | ||
171 | // map of int values | ||
172 | func IntValueMap(src map[string]*int) map[string]int { | ||
173 | dst := make(map[string]int) | ||
174 | for k, val := range src { | ||
175 | if val != nil { | ||
176 | dst[k] = *val | ||
177 | } | ||
178 | } | ||
179 | return dst | ||
180 | } | ||
181 | |||
182 | // Int64 returns a pointer to the int64 value passed in. | ||
183 | func Int64(v int64) *int64 { | ||
184 | return &v | ||
185 | } | ||
186 | |||
187 | // Int64Value returns the value of the int64 pointer passed in or | ||
188 | // 0 if the pointer is nil. | ||
189 | func Int64Value(v *int64) int64 { | ||
190 | if v != nil { | ||
191 | return *v | ||
192 | } | ||
193 | return 0 | ||
194 | } | ||
195 | |||
196 | // Int64Slice converts a slice of int64 values into a slice of | ||
197 | // int64 pointers | ||
198 | func Int64Slice(src []int64) []*int64 { | ||
199 | dst := make([]*int64, len(src)) | ||
200 | for i := 0; i < len(src); i++ { | ||
201 | dst[i] = &(src[i]) | ||
202 | } | ||
203 | return dst | ||
204 | } | ||
205 | |||
206 | // Int64ValueSlice converts a slice of int64 pointers into a slice of | ||
207 | // int64 values | ||
208 | func Int64ValueSlice(src []*int64) []int64 { | ||
209 | dst := make([]int64, len(src)) | ||
210 | for i := 0; i < len(src); i++ { | ||
211 | if src[i] != nil { | ||
212 | dst[i] = *(src[i]) | ||
213 | } | ||
214 | } | ||
215 | return dst | ||
216 | } | ||
217 | |||
218 | // Int64Map converts a string map of int64 values into a string | ||
219 | // map of int64 pointers | ||
220 | func Int64Map(src map[string]int64) map[string]*int64 { | ||
221 | dst := make(map[string]*int64) | ||
222 | for k, val := range src { | ||
223 | v := val | ||
224 | dst[k] = &v | ||
225 | } | ||
226 | return dst | ||
227 | } | ||
228 | |||
229 | // Int64ValueMap converts a string map of int64 pointers into a string | ||
230 | // map of int64 values | ||
231 | func Int64ValueMap(src map[string]*int64) map[string]int64 { | ||
232 | dst := make(map[string]int64) | ||
233 | for k, val := range src { | ||
234 | if val != nil { | ||
235 | dst[k] = *val | ||
236 | } | ||
237 | } | ||
238 | return dst | ||
239 | } | ||
240 | |||
241 | // Float64 returns a pointer to the float64 value passed in. | ||
242 | func Float64(v float64) *float64 { | ||
243 | return &v | ||
244 | } | ||
245 | |||
246 | // Float64Value returns the value of the float64 pointer passed in or | ||
247 | // 0 if the pointer is nil. | ||
248 | func Float64Value(v *float64) float64 { | ||
249 | if v != nil { | ||
250 | return *v | ||
251 | } | ||
252 | return 0 | ||
253 | } | ||
254 | |||
255 | // Float64Slice converts a slice of float64 values into a slice of | ||
256 | // float64 pointers | ||
257 | func Float64Slice(src []float64) []*float64 { | ||
258 | dst := make([]*float64, len(src)) | ||
259 | for i := 0; i < len(src); i++ { | ||
260 | dst[i] = &(src[i]) | ||
261 | } | ||
262 | return dst | ||
263 | } | ||
264 | |||
265 | // Float64ValueSlice converts a slice of float64 pointers into a slice of | ||
266 | // float64 values | ||
267 | func Float64ValueSlice(src []*float64) []float64 { | ||
268 | dst := make([]float64, len(src)) | ||
269 | for i := 0; i < len(src); i++ { | ||
270 | if src[i] != nil { | ||
271 | dst[i] = *(src[i]) | ||
272 | } | ||
273 | } | ||
274 | return dst | ||
275 | } | ||
276 | |||
277 | // Float64Map converts a string map of float64 values into a string | ||
278 | // map of float64 pointers | ||
279 | func Float64Map(src map[string]float64) map[string]*float64 { | ||
280 | dst := make(map[string]*float64) | ||
281 | for k, val := range src { | ||
282 | v := val | ||
283 | dst[k] = &v | ||
284 | } | ||
285 | return dst | ||
286 | } | ||
287 | |||
288 | // Float64ValueMap converts a string map of float64 pointers into a string | ||
289 | // map of float64 values | ||
290 | func Float64ValueMap(src map[string]*float64) map[string]float64 { | ||
291 | dst := make(map[string]float64) | ||
292 | for k, val := range src { | ||
293 | if val != nil { | ||
294 | dst[k] = *val | ||
295 | } | ||
296 | } | ||
297 | return dst | ||
298 | } | ||
299 | |||
300 | // Time returns a pointer to the time.Time value passed in. | ||
301 | func Time(v time.Time) *time.Time { | ||
302 | return &v | ||
303 | } | ||
304 | |||
305 | // TimeValue returns the value of the time.Time pointer passed in or | ||
306 | // time.Time{} if the pointer is nil. | ||
307 | func TimeValue(v *time.Time) time.Time { | ||
308 | if v != nil { | ||
309 | return *v | ||
310 | } | ||
311 | return time.Time{} | ||
312 | } | ||
313 | |||
314 | // TimeUnixMilli returns a Unix timestamp in milliseconds from "January 1, 1970 UTC". | ||
315 | // The result is undefined if the Unix time cannot be represented by an int64. | ||
316 | // Which includes calling TimeUnixMilli on a zero Time is undefined. | ||
317 | // | ||
318 | // This utility is useful for service API's such as CloudWatch Logs which require | ||
319 | // their unix time values to be in milliseconds. | ||
320 | // | ||
321 | // See Go stdlib https://golang.org/pkg/time/#Time.UnixNano for more information. | ||
322 | func TimeUnixMilli(t time.Time) int64 { | ||
323 | return t.UnixNano() / int64(time.Millisecond/time.Nanosecond) | ||
324 | } | ||
325 | |||
326 | // TimeSlice converts a slice of time.Time values into a slice of | ||
327 | // time.Time pointers | ||
328 | func TimeSlice(src []time.Time) []*time.Time { | ||
329 | dst := make([]*time.Time, len(src)) | ||
330 | for i := 0; i < len(src); i++ { | ||
331 | dst[i] = &(src[i]) | ||
332 | } | ||
333 | return dst | ||
334 | } | ||
335 | |||
336 | // TimeValueSlice converts a slice of time.Time pointers into a slice of | ||
337 | // time.Time values | ||
338 | func TimeValueSlice(src []*time.Time) []time.Time { | ||
339 | dst := make([]time.Time, len(src)) | ||
340 | for i := 0; i < len(src); i++ { | ||
341 | if src[i] != nil { | ||
342 | dst[i] = *(src[i]) | ||
343 | } | ||
344 | } | ||
345 | return dst | ||
346 | } | ||
347 | |||
348 | // TimeMap converts a string map of time.Time values into a string | ||
349 | // map of time.Time pointers | ||
350 | func TimeMap(src map[string]time.Time) map[string]*time.Time { | ||
351 | dst := make(map[string]*time.Time) | ||
352 | for k, val := range src { | ||
353 | v := val | ||
354 | dst[k] = &v | ||
355 | } | ||
356 | return dst | ||
357 | } | ||
358 | |||
359 | // TimeValueMap converts a string map of time.Time pointers into a string | ||
360 | // map of time.Time values | ||
361 | func TimeValueMap(src map[string]*time.Time) map[string]time.Time { | ||
362 | dst := make(map[string]time.Time) | ||
363 | for k, val := range src { | ||
364 | if val != nil { | ||
365 | dst[k] = *val | ||
366 | } | ||
367 | } | ||
368 | return dst | ||
369 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go b/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go new file mode 100644 index 0000000..25b461c --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go | |||
@@ -0,0 +1,226 @@ | |||
1 | package corehandlers | ||
2 | |||
3 | import ( | ||
4 | "bytes" | ||
5 | "fmt" | ||
6 | "io" | ||
7 | "io/ioutil" | ||
8 | "net/http" | ||
9 | "net/url" | ||
10 | "regexp" | ||
11 | "runtime" | ||
12 | "strconv" | ||
13 | "time" | ||
14 | |||
15 | "github.com/aws/aws-sdk-go/aws" | ||
16 | "github.com/aws/aws-sdk-go/aws/awserr" | ||
17 | "github.com/aws/aws-sdk-go/aws/credentials" | ||
18 | "github.com/aws/aws-sdk-go/aws/request" | ||
19 | ) | ||
20 | |||
21 | // Interface for matching types which also have a Len method. | ||
22 | type lener interface { | ||
23 | Len() int | ||
24 | } | ||
25 | |||
26 | // BuildContentLengthHandler builds the content length of a request based on the body, | ||
27 | // or will use the HTTPRequest.Header's "Content-Length" if defined. If unable | ||
28 | // to determine request body length and no "Content-Length" was specified it will panic. | ||
29 | // | ||
30 | // The Content-Length will only be added to the request if the length of the body | ||
31 | // is greater than 0. If the body is empty or the current `Content-Length` | ||
32 | // header is <= 0, the header will also be stripped. | ||
33 | var BuildContentLengthHandler = request.NamedHandler{Name: "core.BuildContentLengthHandler", Fn: func(r *request.Request) { | ||
34 | var length int64 | ||
35 | |||
36 | if slength := r.HTTPRequest.Header.Get("Content-Length"); slength != "" { | ||
37 | length, _ = strconv.ParseInt(slength, 10, 64) | ||
38 | } else { | ||
39 | switch body := r.Body.(type) { | ||
40 | case nil: | ||
41 | length = 0 | ||
42 | case lener: | ||
43 | length = int64(body.Len()) | ||
44 | case io.Seeker: | ||
45 | r.BodyStart, _ = body.Seek(0, 1) | ||
46 | end, _ := body.Seek(0, 2) | ||
47 | body.Seek(r.BodyStart, 0) // make sure to seek back to original location | ||
48 | length = end - r.BodyStart | ||
49 | default: | ||
50 | panic("Cannot get length of body, must provide `ContentLength`") | ||
51 | } | ||
52 | } | ||
53 | |||
54 | if length > 0 { | ||
55 | r.HTTPRequest.ContentLength = length | ||
56 | r.HTTPRequest.Header.Set("Content-Length", fmt.Sprintf("%d", length)) | ||
57 | } else { | ||
58 | r.HTTPRequest.ContentLength = 0 | ||
59 | r.HTTPRequest.Header.Del("Content-Length") | ||
60 | } | ||
61 | }} | ||
62 | |||
63 | // SDKVersionUserAgentHandler is a request handler for adding the SDK Version to the user agent. | ||
64 | var SDKVersionUserAgentHandler = request.NamedHandler{ | ||
65 | Name: "core.SDKVersionUserAgentHandler", | ||
66 | Fn: request.MakeAddToUserAgentHandler(aws.SDKName, aws.SDKVersion, | ||
67 | runtime.Version(), runtime.GOOS, runtime.GOARCH), | ||
68 | } | ||
69 | |||
70 | var reStatusCode = regexp.MustCompile(`^(\d{3})`) | ||
71 | |||
72 | // ValidateReqSigHandler is a request handler to ensure that the request's | ||
73 | // signature doesn't expire before it is sent. This can happen when a request | ||
74 | // is built and signed significantly before it is sent. Or significant delays | ||
75 | // occur when retrying requests that would cause the signature to expire. | ||
76 | var ValidateReqSigHandler = request.NamedHandler{ | ||
77 | Name: "core.ValidateReqSigHandler", | ||
78 | Fn: func(r *request.Request) { | ||
79 | // Unsigned requests are not signed | ||
80 | if r.Config.Credentials == credentials.AnonymousCredentials { | ||
81 | return | ||
82 | } | ||
83 | |||
84 | signedTime := r.Time | ||
85 | if !r.LastSignedAt.IsZero() { | ||
86 | signedTime = r.LastSignedAt | ||
87 | } | ||
88 | |||
89 | // 10 minutes to allow for some clock skew/delays in transmission. | ||
90 | // Would be improved with aws/aws-sdk-go#423 | ||
91 | if signedTime.Add(10 * time.Minute).After(time.Now()) { | ||
92 | return | ||
93 | } | ||
94 | |||
95 | fmt.Println("request expired, resigning") | ||
96 | r.Sign() | ||
97 | }, | ||
98 | } | ||
99 | |||
100 | // SendHandler is a request handler to send service request using HTTP client. | ||
101 | var SendHandler = request.NamedHandler{ | ||
102 | Name: "core.SendHandler", | ||
103 | Fn: func(r *request.Request) { | ||
104 | sender := sendFollowRedirects | ||
105 | if r.DisableFollowRedirects { | ||
106 | sender = sendWithoutFollowRedirects | ||
107 | } | ||
108 | |||
109 | var err error | ||
110 | r.HTTPResponse, err = sender(r) | ||
111 | if err != nil { | ||
112 | handleSendError(r, err) | ||
113 | } | ||
114 | }, | ||
115 | } | ||
116 | |||
117 | func sendFollowRedirects(r *request.Request) (*http.Response, error) { | ||
118 | return r.Config.HTTPClient.Do(r.HTTPRequest) | ||
119 | } | ||
120 | |||
121 | func sendWithoutFollowRedirects(r *request.Request) (*http.Response, error) { | ||
122 | transport := r.Config.HTTPClient.Transport | ||
123 | if transport == nil { | ||
124 | transport = http.DefaultTransport | ||
125 | } | ||
126 | |||
127 | return transport.RoundTrip(r.HTTPRequest) | ||
128 | } | ||
129 | |||
130 | func handleSendError(r *request.Request, err error) { | ||
131 | // Prevent leaking if an HTTPResponse was returned. Clean up | ||
132 | // the body. | ||
133 | if r.HTTPResponse != nil { | ||
134 | r.HTTPResponse.Body.Close() | ||
135 | } | ||
136 | // Capture the case where url.Error is returned for error processing | ||
137 | // response. e.g. 301 without location header comes back as string | ||
138 | // error and r.HTTPResponse is nil. Other URL redirect errors will | ||
139 | // comeback in a similar method. | ||
140 | if e, ok := err.(*url.Error); ok && e.Err != nil { | ||
141 | if s := reStatusCode.FindStringSubmatch(e.Err.Error()); s != nil { | ||
142 | code, _ := strconv.ParseInt(s[1], 10, 64) | ||
143 | r.HTTPResponse = &http.Response{ | ||
144 | StatusCode: int(code), | ||
145 | Status: http.StatusText(int(code)), | ||
146 | Body: ioutil.NopCloser(bytes.NewReader([]byte{})), | ||
147 | } | ||
148 | return | ||
149 | } | ||
150 | } | ||
151 | if r.HTTPResponse == nil { | ||
152 | // Add a dummy request response object to ensure the HTTPResponse | ||
153 | // value is consistent. | ||
154 | r.HTTPResponse = &http.Response{ | ||
155 | StatusCode: int(0), | ||
156 | Status: http.StatusText(int(0)), | ||
157 | Body: ioutil.NopCloser(bytes.NewReader([]byte{})), | ||
158 | } | ||
159 | } | ||
160 | // Catch all other request errors. | ||
161 | r.Error = awserr.New("RequestError", "send request failed", err) | ||
162 | r.Retryable = aws.Bool(true) // network errors are retryable | ||
163 | |||
164 | // Override the error with a context canceled error, if that was canceled. | ||
165 | ctx := r.Context() | ||
166 | select { | ||
167 | case <-ctx.Done(): | ||
168 | r.Error = awserr.New(request.CanceledErrorCode, | ||
169 | "request context canceled", ctx.Err()) | ||
170 | r.Retryable = aws.Bool(false) | ||
171 | default: | ||
172 | } | ||
173 | } | ||
174 | |||
175 | // ValidateResponseHandler is a request handler to validate service response. | ||
176 | var ValidateResponseHandler = request.NamedHandler{Name: "core.ValidateResponseHandler", Fn: func(r *request.Request) { | ||
177 | if r.HTTPResponse.StatusCode == 0 || r.HTTPResponse.StatusCode >= 300 { | ||
178 | // this may be replaced by an UnmarshalError handler | ||
179 | r.Error = awserr.New("UnknownError", "unknown error", nil) | ||
180 | } | ||
181 | }} | ||
182 | |||
183 | // AfterRetryHandler performs final checks to determine if the request should | ||
184 | // be retried and how long to delay. | ||
185 | var AfterRetryHandler = request.NamedHandler{Name: "core.AfterRetryHandler", Fn: func(r *request.Request) { | ||
186 | // If one of the other handlers already set the retry state | ||
187 | // we don't want to override it based on the service's state | ||
188 | if r.Retryable == nil || aws.BoolValue(r.Config.EnforceShouldRetryCheck) { | ||
189 | r.Retryable = aws.Bool(r.ShouldRetry(r)) | ||
190 | } | ||
191 | |||
192 | if r.WillRetry() { | ||
193 | r.RetryDelay = r.RetryRules(r) | ||
194 | |||
195 | if sleepFn := r.Config.SleepDelay; sleepFn != nil { | ||
196 | // Support SleepDelay for backwards compatibility and testing | ||
197 | sleepFn(r.RetryDelay) | ||
198 | } else if err := aws.SleepWithContext(r.Context(), r.RetryDelay); err != nil { | ||
199 | r.Error = awserr.New(request.CanceledErrorCode, | ||
200 | "request context canceled", err) | ||
201 | r.Retryable = aws.Bool(false) | ||
202 | return | ||
203 | } | ||
204 | |||
205 | // when the expired token exception occurs the credentials | ||
206 | // need to be expired locally so that the next request to | ||
207 | // get credentials will trigger a credentials refresh. | ||
208 | if r.IsErrorExpired() { | ||
209 | r.Config.Credentials.Expire() | ||
210 | } | ||
211 | |||
212 | r.RetryCount++ | ||
213 | r.Error = nil | ||
214 | } | ||
215 | }} | ||
216 | |||
217 | // ValidateEndpointHandler is a request handler to validate a request had the | ||
218 | // appropriate Region and Endpoint set. Will set r.Error if the endpoint or | ||
219 | // region is not valid. | ||
220 | var ValidateEndpointHandler = request.NamedHandler{Name: "core.ValidateEndpointHandler", Fn: func(r *request.Request) { | ||
221 | if r.ClientInfo.SigningRegion == "" && aws.StringValue(r.Config.Region) == "" { | ||
222 | r.Error = aws.ErrMissingRegion | ||
223 | } else if r.ClientInfo.Endpoint == "" { | ||
224 | r.Error = aws.ErrMissingEndpoint | ||
225 | } | ||
226 | }} | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator.go b/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator.go new file mode 100644 index 0000000..7d50b15 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator.go | |||
@@ -0,0 +1,17 @@ | |||
1 | package corehandlers | ||
2 | |||
3 | import "github.com/aws/aws-sdk-go/aws/request" | ||
4 | |||
5 | // ValidateParametersHandler is a request handler to validate the input parameters. | ||
6 | // Validating parameters only has meaning if done prior to the request being sent. | ||
7 | var ValidateParametersHandler = request.NamedHandler{Name: "core.ValidateParametersHandler", Fn: func(r *request.Request) { | ||
8 | if !r.ParamsFilled() { | ||
9 | return | ||
10 | } | ||
11 | |||
12 | if v, ok := r.Params.(request.Validator); ok { | ||
13 | if err := v.Validate(); err != nil { | ||
14 | r.Error = err | ||
15 | } | ||
16 | } | ||
17 | }} | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/chain_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/chain_provider.go new file mode 100644 index 0000000..f298d65 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/chain_provider.go | |||
@@ -0,0 +1,102 @@ | |||
1 | package credentials | ||
2 | |||
3 | import ( | ||
4 | "github.com/aws/aws-sdk-go/aws/awserr" | ||
5 | ) | ||
6 | |||
7 | var ( | ||
8 | // ErrNoValidProvidersFoundInChain Is returned when there are no valid | ||
9 | // providers in the ChainProvider. | ||
10 | // | ||
11 | // This has been deprecated. For verbose error messaging set | ||
12 | // aws.Config.CredentialsChainVerboseErrors to true | ||
13 | // | ||
14 | // @readonly | ||
15 | ErrNoValidProvidersFoundInChain = awserr.New("NoCredentialProviders", | ||
16 | `no valid providers in chain. Deprecated. | ||
17 | For verbose messaging see aws.Config.CredentialsChainVerboseErrors`, | ||
18 | nil) | ||
19 | ) | ||
20 | |||
21 | // A ChainProvider will search for a provider which returns credentials | ||
22 | // and cache that provider until Retrieve is called again. | ||
23 | // | ||
24 | // The ChainProvider provides a way of chaining multiple providers together | ||
25 | // which will pick the first available using priority order of the Providers | ||
26 | // in the list. | ||
27 | // | ||
28 | // If none of the Providers retrieve valid credentials Value, ChainProvider's | ||
29 | // Retrieve() will return the error ErrNoValidProvidersFoundInChain. | ||
30 | // | ||
31 | // If a Provider is found which returns valid credentials Value ChainProvider | ||
32 | // will cache that Provider for all calls to IsExpired(), until Retrieve is | ||
33 | // called again. | ||
34 | // | ||
35 | // Example of ChainProvider to be used with an EnvProvider and EC2RoleProvider. | ||
36 | // In this example EnvProvider will first check if any credentials are available | ||
37 | // via the environment variables. If there are none ChainProvider will check | ||
38 | // the next Provider in the list, EC2RoleProvider in this case. If EC2RoleProvider | ||
39 | // does not return any credentials ChainProvider will return the error | ||
40 | // ErrNoValidProvidersFoundInChain | ||
41 | // | ||
42 | // creds := credentials.NewChainCredentials( | ||
43 | // []credentials.Provider{ | ||
44 | // &credentials.EnvProvider{}, | ||
45 | // &ec2rolecreds.EC2RoleProvider{ | ||
46 | // Client: ec2metadata.New(sess), | ||
47 | // }, | ||
48 | // }) | ||
49 | // | ||
50 | // // Usage of ChainCredentials with aws.Config | ||
51 | // svc := ec2.New(session.Must(session.NewSession(&aws.Config{ | ||
52 | // Credentials: creds, | ||
53 | // }))) | ||
54 | // | ||
55 | type ChainProvider struct { | ||
56 | Providers []Provider | ||
57 | curr Provider | ||
58 | VerboseErrors bool | ||
59 | } | ||
60 | |||
61 | // NewChainCredentials returns a pointer to a new Credentials object | ||
62 | // wrapping a chain of providers. | ||
63 | func NewChainCredentials(providers []Provider) *Credentials { | ||
64 | return NewCredentials(&ChainProvider{ | ||
65 | Providers: append([]Provider{}, providers...), | ||
66 | }) | ||
67 | } | ||
68 | |||
69 | // Retrieve returns the credentials value or error if no provider returned | ||
70 | // without error. | ||
71 | // | ||
72 | // If a provider is found it will be cached and any calls to IsExpired() | ||
73 | // will return the expired state of the cached provider. | ||
74 | func (c *ChainProvider) Retrieve() (Value, error) { | ||
75 | var errs []error | ||
76 | for _, p := range c.Providers { | ||
77 | creds, err := p.Retrieve() | ||
78 | if err == nil { | ||
79 | c.curr = p | ||
80 | return creds, nil | ||
81 | } | ||
82 | errs = append(errs, err) | ||
83 | } | ||
84 | c.curr = nil | ||
85 | |||
86 | var err error | ||
87 | err = ErrNoValidProvidersFoundInChain | ||
88 | if c.VerboseErrors { | ||
89 | err = awserr.NewBatchError("NoCredentialProviders", "no valid providers in chain", errs) | ||
90 | } | ||
91 | return Value{}, err | ||
92 | } | ||
93 | |||
94 | // IsExpired will returned the expired state of the currently cached provider | ||
95 | // if there is one. If there is no current provider, true will be returned. | ||
96 | func (c *ChainProvider) IsExpired() bool { | ||
97 | if c.curr != nil { | ||
98 | return c.curr.IsExpired() | ||
99 | } | ||
100 | |||
101 | return true | ||
102 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go new file mode 100644 index 0000000..42416fc --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go | |||
@@ -0,0 +1,246 @@ | |||
1 | // Package credentials provides credential retrieval and management | ||
2 | // | ||
3 | // The Credentials is the primary method of getting access to and managing | ||
4 | // credentials Values. Using dependency injection retrieval of the credential | ||
5 | // values is handled by a object which satisfies the Provider interface. | ||
6 | // | ||
7 | // By default the Credentials.Get() will cache the successful result of a | ||
8 | // Provider's Retrieve() until Provider.IsExpired() returns true. At which | ||
9 | // point Credentials will call Provider's Retrieve() to get new credential Value. | ||
10 | // | ||
11 | // The Provider is responsible for determining when credentials Value have expired. | ||
12 | // It is also important to note that Credentials will always call Retrieve the | ||
13 | // first time Credentials.Get() is called. | ||
14 | // | ||
15 | // Example of using the environment variable credentials. | ||
16 | // | ||
17 | // creds := credentials.NewEnvCredentials() | ||
18 | // | ||
19 | // // Retrieve the credentials value | ||
20 | // credValue, err := creds.Get() | ||
21 | // if err != nil { | ||
22 | // // handle error | ||
23 | // } | ||
24 | // | ||
25 | // Example of forcing credentials to expire and be refreshed on the next Get(). | ||
26 | // This may be helpful to proactively expire credentials and refresh them sooner | ||
27 | // than they would naturally expire on their own. | ||
28 | // | ||
29 | // creds := credentials.NewCredentials(&ec2rolecreds.EC2RoleProvider{}) | ||
30 | // creds.Expire() | ||
31 | // credsValue, err := creds.Get() | ||
32 | // // New credentials will be retrieved instead of from cache. | ||
33 | // | ||
34 | // | ||
35 | // Custom Provider | ||
36 | // | ||
37 | // Each Provider built into this package also provides a helper method to generate | ||
38 | // a Credentials pointer setup with the provider. To use a custom Provider just | ||
39 | // create a type which satisfies the Provider interface and pass it to the | ||
40 | // NewCredentials method. | ||
41 | // | ||
42 | // type MyProvider struct{} | ||
43 | // func (m *MyProvider) Retrieve() (Value, error) {...} | ||
44 | // func (m *MyProvider) IsExpired() bool {...} | ||
45 | // | ||
46 | // creds := credentials.NewCredentials(&MyProvider{}) | ||
47 | // credValue, err := creds.Get() | ||
48 | // | ||
49 | package credentials | ||
50 | |||
51 | import ( | ||
52 | "sync" | ||
53 | "time" | ||
54 | ) | ||
55 | |||
56 | // AnonymousCredentials is an empty Credential object that can be used as | ||
57 | // dummy placeholder credentials for requests that do not need signed. | ||
58 | // | ||
59 | // This Credentials can be used to configure a service to not sign requests | ||
60 | // when making service API calls. For example, when accessing public | ||
61 | // s3 buckets. | ||
62 | // | ||
63 | // svc := s3.New(session.Must(session.NewSession(&aws.Config{ | ||
64 | // Credentials: credentials.AnonymousCredentials, | ||
65 | // }))) | ||
66 | // // Access public S3 buckets. | ||
67 | // | ||
68 | // @readonly | ||
69 | var AnonymousCredentials = NewStaticCredentials("", "", "") | ||
70 | |||
71 | // A Value is the AWS credentials value for individual credential fields. | ||
72 | type Value struct { | ||
73 | // AWS Access key ID | ||
74 | AccessKeyID string | ||
75 | |||
76 | // AWS Secret Access Key | ||
77 | SecretAccessKey string | ||
78 | |||
79 | // AWS Session Token | ||
80 | SessionToken string | ||
81 | |||
82 | // Provider used to get credentials | ||
83 | ProviderName string | ||
84 | } | ||
85 | |||
86 | // A Provider is the interface for any component which will provide credentials | ||
87 | // Value. A provider is required to manage its own Expired state, and what to | ||
88 | // be expired means. | ||
89 | // | ||
90 | // The Provider should not need to implement its own mutexes, because | ||
91 | // that will be managed by Credentials. | ||
92 | type Provider interface { | ||
93 | // Retrieve returns nil if it successfully retrieved the value. | ||
94 | // Error is returned if the value were not obtainable, or empty. | ||
95 | Retrieve() (Value, error) | ||
96 | |||
97 | // IsExpired returns if the credentials are no longer valid, and need | ||
98 | // to be retrieved. | ||
99 | IsExpired() bool | ||
100 | } | ||
101 | |||
102 | // An ErrorProvider is a stub credentials provider that always returns an error | ||
103 | // this is used by the SDK when construction a known provider is not possible | ||
104 | // due to an error. | ||
105 | type ErrorProvider struct { | ||
106 | // The error to be returned from Retrieve | ||
107 | Err error | ||
108 | |||
109 | // The provider name to set on the Retrieved returned Value | ||
110 | ProviderName string | ||
111 | } | ||
112 | |||
113 | // Retrieve will always return the error that the ErrorProvider was created with. | ||
114 | func (p ErrorProvider) Retrieve() (Value, error) { | ||
115 | return Value{ProviderName: p.ProviderName}, p.Err | ||
116 | } | ||
117 | |||
118 | // IsExpired will always return not expired. | ||
119 | func (p ErrorProvider) IsExpired() bool { | ||
120 | return false | ||
121 | } | ||
122 | |||
123 | // A Expiry provides shared expiration logic to be used by credentials | ||
124 | // providers to implement expiry functionality. | ||
125 | // | ||
126 | // The best method to use this struct is as an anonymous field within the | ||
127 | // provider's struct. | ||
128 | // | ||
129 | // Example: | ||
130 | // type EC2RoleProvider struct { | ||
131 | // Expiry | ||
132 | // ... | ||
133 | // } | ||
134 | type Expiry struct { | ||
135 | // The date/time when to expire on | ||
136 | expiration time.Time | ||
137 | |||
138 | // If set will be used by IsExpired to determine the current time. | ||
139 | // Defaults to time.Now if CurrentTime is not set. Available for testing | ||
140 | // to be able to mock out the current time. | ||
141 | CurrentTime func() time.Time | ||
142 | } | ||
143 | |||
144 | // SetExpiration sets the expiration IsExpired will check when called. | ||
145 | // | ||
146 | // If window is greater than 0 the expiration time will be reduced by the | ||
147 | // window value. | ||
148 | // | ||
149 | // Using a window is helpful to trigger credentials to expire sooner than | ||
150 | // the expiration time given to ensure no requests are made with expired | ||
151 | // tokens. | ||
152 | func (e *Expiry) SetExpiration(expiration time.Time, window time.Duration) { | ||
153 | e.expiration = expiration | ||
154 | if window > 0 { | ||
155 | e.expiration = e.expiration.Add(-window) | ||
156 | } | ||
157 | } | ||
158 | |||
159 | // IsExpired returns if the credentials are expired. | ||
160 | func (e *Expiry) IsExpired() bool { | ||
161 | if e.CurrentTime == nil { | ||
162 | e.CurrentTime = time.Now | ||
163 | } | ||
164 | return e.expiration.Before(e.CurrentTime()) | ||
165 | } | ||
166 | |||
167 | // A Credentials provides synchronous safe retrieval of AWS credentials Value. | ||
168 | // Credentials will cache the credentials value until they expire. Once the value | ||
169 | // expires the next Get will attempt to retrieve valid credentials. | ||
170 | // | ||
171 | // Credentials is safe to use across multiple goroutines and will manage the | ||
172 | // synchronous state so the Providers do not need to implement their own | ||
173 | // synchronization. | ||
174 | // | ||
175 | // The first Credentials.Get() will always call Provider.Retrieve() to get the | ||
176 | // first instance of the credentials Value. All calls to Get() after that | ||
177 | // will return the cached credentials Value until IsExpired() returns true. | ||
178 | type Credentials struct { | ||
179 | creds Value | ||
180 | forceRefresh bool | ||
181 | m sync.Mutex | ||
182 | |||
183 | provider Provider | ||
184 | } | ||
185 | |||
186 | // NewCredentials returns a pointer to a new Credentials with the provider set. | ||
187 | func NewCredentials(provider Provider) *Credentials { | ||
188 | return &Credentials{ | ||
189 | provider: provider, | ||
190 | forceRefresh: true, | ||
191 | } | ||
192 | } | ||
193 | |||
194 | // Get returns the credentials value, or error if the credentials Value failed | ||
195 | // to be retrieved. | ||
196 | // | ||
197 | // Will return the cached credentials Value if it has not expired. If the | ||
198 | // credentials Value has expired the Provider's Retrieve() will be called | ||
199 | // to refresh the credentials. | ||
200 | // | ||
201 | // If Credentials.Expire() was called the credentials Value will be force | ||
202 | // expired, and the next call to Get() will cause them to be refreshed. | ||
203 | func (c *Credentials) Get() (Value, error) { | ||
204 | c.m.Lock() | ||
205 | defer c.m.Unlock() | ||
206 | |||
207 | if c.isExpired() { | ||
208 | creds, err := c.provider.Retrieve() | ||
209 | if err != nil { | ||
210 | return Value{}, err | ||
211 | } | ||
212 | c.creds = creds | ||
213 | c.forceRefresh = false | ||
214 | } | ||
215 | |||
216 | return c.creds, nil | ||
217 | } | ||
218 | |||
219 | // Expire expires the credentials and forces them to be retrieved on the | ||
220 | // next call to Get(). | ||
221 | // | ||
222 | // This will override the Provider's expired state, and force Credentials | ||
223 | // to call the Provider's Retrieve(). | ||
224 | func (c *Credentials) Expire() { | ||
225 | c.m.Lock() | ||
226 | defer c.m.Unlock() | ||
227 | |||
228 | c.forceRefresh = true | ||
229 | } | ||
230 | |||
231 | // IsExpired returns if the credentials are no longer valid, and need | ||
232 | // to be retrieved. | ||
233 | // | ||
234 | // If the Credentials were forced to be expired with Expire() this will | ||
235 | // reflect that override. | ||
236 | func (c *Credentials) IsExpired() bool { | ||
237 | c.m.Lock() | ||
238 | defer c.m.Unlock() | ||
239 | |||
240 | return c.isExpired() | ||
241 | } | ||
242 | |||
243 | // isExpired helper method wrapping the definition of expired credentials. | ||
244 | func (c *Credentials) isExpired() bool { | ||
245 | return c.forceRefresh || c.provider.IsExpired() | ||
246 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider.go new file mode 100644 index 0000000..c397495 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider.go | |||
@@ -0,0 +1,178 @@ | |||
1 | package ec2rolecreds | ||
2 | |||
3 | import ( | ||
4 | "bufio" | ||
5 | "encoding/json" | ||
6 | "fmt" | ||
7 | "path" | ||
8 | "strings" | ||
9 | "time" | ||
10 | |||
11 | "github.com/aws/aws-sdk-go/aws/awserr" | ||
12 | "github.com/aws/aws-sdk-go/aws/client" | ||
13 | "github.com/aws/aws-sdk-go/aws/credentials" | ||
14 | "github.com/aws/aws-sdk-go/aws/ec2metadata" | ||
15 | ) | ||
16 | |||
17 | // ProviderName provides a name of EC2Role provider | ||
18 | const ProviderName = "EC2RoleProvider" | ||
19 | |||
20 | // A EC2RoleProvider retrieves credentials from the EC2 service, and keeps track if | ||
21 | // those credentials are expired. | ||
22 | // | ||
23 | // Example how to configure the EC2RoleProvider with custom http Client, Endpoint | ||
24 | // or ExpiryWindow | ||
25 | // | ||
26 | // p := &ec2rolecreds.EC2RoleProvider{ | ||
27 | // // Pass in a custom timeout to be used when requesting | ||
28 | // // IAM EC2 Role credentials. | ||
29 | // Client: ec2metadata.New(sess, aws.Config{ | ||
30 | // HTTPClient: &http.Client{Timeout: 10 * time.Second}, | ||
31 | // }), | ||
32 | // | ||
33 | // // Do not use early expiry of credentials. If a non zero value is | ||
34 | // // specified the credentials will be expired early | ||
35 | // ExpiryWindow: 0, | ||
36 | // } | ||
37 | type EC2RoleProvider struct { | ||
38 | credentials.Expiry | ||
39 | |||
40 | // Required EC2Metadata client to use when connecting to EC2 metadata service. | ||
41 | Client *ec2metadata.EC2Metadata | ||
42 | |||
43 | // ExpiryWindow will allow the credentials to trigger refreshing prior to | ||
44 | // the credentials actually expiring. This is beneficial so race conditions | ||
45 | // with expiring credentials do not cause request to fail unexpectedly | ||
46 | // due to ExpiredTokenException exceptions. | ||
47 | // | ||
48 | // So a ExpiryWindow of 10s would cause calls to IsExpired() to return true | ||
49 | // 10 seconds before the credentials are actually expired. | ||
50 | // | ||
51 | // If ExpiryWindow is 0 or less it will be ignored. | ||
52 | ExpiryWindow time.Duration | ||
53 | } | ||
54 | |||
55 | // NewCredentials returns a pointer to a new Credentials object wrapping | ||
56 | // the EC2RoleProvider. Takes a ConfigProvider to create a EC2Metadata client. | ||
57 | // The ConfigProvider is satisfied by the session.Session type. | ||
58 | func NewCredentials(c client.ConfigProvider, options ...func(*EC2RoleProvider)) *credentials.Credentials { | ||
59 | p := &EC2RoleProvider{ | ||
60 | Client: ec2metadata.New(c), | ||
61 | } | ||
62 | |||
63 | for _, option := range options { | ||
64 | option(p) | ||
65 | } | ||
66 | |||
67 | return credentials.NewCredentials(p) | ||
68 | } | ||
69 | |||
70 | // NewCredentialsWithClient returns a pointer to a new Credentials object wrapping | ||
71 | // the EC2RoleProvider. Takes a EC2Metadata client to use when connecting to EC2 | ||
72 | // metadata service. | ||
73 | func NewCredentialsWithClient(client *ec2metadata.EC2Metadata, options ...func(*EC2RoleProvider)) *credentials.Credentials { | ||
74 | p := &EC2RoleProvider{ | ||
75 | Client: client, | ||
76 | } | ||
77 | |||
78 | for _, option := range options { | ||
79 | option(p) | ||
80 | } | ||
81 | |||
82 | return credentials.NewCredentials(p) | ||
83 | } | ||
84 | |||
85 | // Retrieve retrieves credentials from the EC2 service. | ||
86 | // Error will be returned if the request fails, or unable to extract | ||
87 | // the desired credentials. | ||
88 | func (m *EC2RoleProvider) Retrieve() (credentials.Value, error) { | ||
89 | credsList, err := requestCredList(m.Client) | ||
90 | if err != nil { | ||
91 | return credentials.Value{ProviderName: ProviderName}, err | ||
92 | } | ||
93 | |||
94 | if len(credsList) == 0 { | ||
95 | return credentials.Value{ProviderName: ProviderName}, awserr.New("EmptyEC2RoleList", "empty EC2 Role list", nil) | ||
96 | } | ||
97 | credsName := credsList[0] | ||
98 | |||
99 | roleCreds, err := requestCred(m.Client, credsName) | ||
100 | if err != nil { | ||
101 | return credentials.Value{ProviderName: ProviderName}, err | ||
102 | } | ||
103 | |||
104 | m.SetExpiration(roleCreds.Expiration, m.ExpiryWindow) | ||
105 | |||
106 | return credentials.Value{ | ||
107 | AccessKeyID: roleCreds.AccessKeyID, | ||
108 | SecretAccessKey: roleCreds.SecretAccessKey, | ||
109 | SessionToken: roleCreds.Token, | ||
110 | ProviderName: ProviderName, | ||
111 | }, nil | ||
112 | } | ||
113 | |||
114 | // A ec2RoleCredRespBody provides the shape for unmarshaling credential | ||
115 | // request responses. | ||
116 | type ec2RoleCredRespBody struct { | ||
117 | // Success State | ||
118 | Expiration time.Time | ||
119 | AccessKeyID string | ||
120 | SecretAccessKey string | ||
121 | Token string | ||
122 | |||
123 | // Error state | ||
124 | Code string | ||
125 | Message string | ||
126 | } | ||
127 | |||
128 | const iamSecurityCredsPath = "/iam/security-credentials" | ||
129 | |||
130 | // requestCredList requests a list of credentials from the EC2 service. | ||
131 | // If there are no credentials, or there is an error making or receiving the request | ||
132 | func requestCredList(client *ec2metadata.EC2Metadata) ([]string, error) { | ||
133 | resp, err := client.GetMetadata(iamSecurityCredsPath) | ||
134 | if err != nil { | ||
135 | return nil, awserr.New("EC2RoleRequestError", "no EC2 instance role found", err) | ||
136 | } | ||
137 | |||
138 | credsList := []string{} | ||
139 | s := bufio.NewScanner(strings.NewReader(resp)) | ||
140 | for s.Scan() { | ||
141 | credsList = append(credsList, s.Text()) | ||
142 | } | ||
143 | |||
144 | if err := s.Err(); err != nil { | ||
145 | return nil, awserr.New("SerializationError", "failed to read EC2 instance role from metadata service", err) | ||
146 | } | ||
147 | |||
148 | return credsList, nil | ||
149 | } | ||
150 | |||
151 | // requestCred requests the credentials for a specific credentials from the EC2 service. | ||
152 | // | ||
153 | // If the credentials cannot be found, or there is an error reading the response | ||
154 | // and error will be returned. | ||
155 | func requestCred(client *ec2metadata.EC2Metadata, credsName string) (ec2RoleCredRespBody, error) { | ||
156 | resp, err := client.GetMetadata(path.Join(iamSecurityCredsPath, credsName)) | ||
157 | if err != nil { | ||
158 | return ec2RoleCredRespBody{}, | ||
159 | awserr.New("EC2RoleRequestError", | ||
160 | fmt.Sprintf("failed to get %s EC2 instance role credentials", credsName), | ||
161 | err) | ||
162 | } | ||
163 | |||
164 | respCreds := ec2RoleCredRespBody{} | ||
165 | if err := json.NewDecoder(strings.NewReader(resp)).Decode(&respCreds); err != nil { | ||
166 | return ec2RoleCredRespBody{}, | ||
167 | awserr.New("SerializationError", | ||
168 | fmt.Sprintf("failed to decode %s EC2 instance role credentials", credsName), | ||
169 | err) | ||
170 | } | ||
171 | |||
172 | if respCreds.Code != "Success" { | ||
173 | // If an error code was returned something failed requesting the role. | ||
174 | return ec2RoleCredRespBody{}, awserr.New(respCreds.Code, respCreds.Message, nil) | ||
175 | } | ||
176 | |||
177 | return respCreds, nil | ||
178 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/endpointcreds/provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/endpointcreds/provider.go new file mode 100644 index 0000000..a4cec5c --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/endpointcreds/provider.go | |||
@@ -0,0 +1,191 @@ | |||
1 | // Package endpointcreds provides support for retrieving credentials from an | ||
2 | // arbitrary HTTP endpoint. | ||
3 | // | ||
4 | // The credentials endpoint Provider can receive both static and refreshable | ||
5 | // credentials that will expire. Credentials are static when an "Expiration" | ||
6 | // value is not provided in the endpoint's response. | ||
7 | // | ||
8 | // Static credentials will never expire once they have been retrieved. The format | ||
9 | // of the static credentials response: | ||
10 | // { | ||
11 | // "AccessKeyId" : "MUA...", | ||
12 | // "SecretAccessKey" : "/7PC5om....", | ||
13 | // } | ||
14 | // | ||
15 | // Refreshable credentials will expire within the "ExpiryWindow" of the Expiration | ||
16 | // value in the response. The format of the refreshable credentials response: | ||
17 | // { | ||
18 | // "AccessKeyId" : "MUA...", | ||
19 | // "SecretAccessKey" : "/7PC5om....", | ||
20 | // "Token" : "AQoDY....=", | ||
21 | // "Expiration" : "2016-02-25T06:03:31Z" | ||
22 | // } | ||
23 | // | ||
24 | // Errors should be returned in the following format and only returned with 400 | ||
25 | // or 500 HTTP status codes. | ||
26 | // { | ||
27 | // "code": "ErrorCode", | ||
28 | // "message": "Helpful error message." | ||
29 | // } | ||
30 | package endpointcreds | ||
31 | |||
32 | import ( | ||
33 | "encoding/json" | ||
34 | "time" | ||
35 | |||
36 | "github.com/aws/aws-sdk-go/aws" | ||
37 | "github.com/aws/aws-sdk-go/aws/awserr" | ||
38 | "github.com/aws/aws-sdk-go/aws/client" | ||
39 | "github.com/aws/aws-sdk-go/aws/client/metadata" | ||
40 | "github.com/aws/aws-sdk-go/aws/credentials" | ||
41 | "github.com/aws/aws-sdk-go/aws/request" | ||
42 | ) | ||
43 | |||
44 | // ProviderName is the name of the credentials provider. | ||
45 | const ProviderName = `CredentialsEndpointProvider` | ||
46 | |||
47 | // Provider satisfies the credentials.Provider interface, and is a client to | ||
48 | // retrieve credentials from an arbitrary endpoint. | ||
49 | type Provider struct { | ||
50 | staticCreds bool | ||
51 | credentials.Expiry | ||
52 | |||
53 | // Requires a AWS Client to make HTTP requests to the endpoint with. | ||
54 | // the Endpoint the request will be made to is provided by the aws.Config's | ||
55 | // Endpoint value. | ||
56 | Client *client.Client | ||
57 | |||
58 | // ExpiryWindow will allow the credentials to trigger refreshing prior to | ||
59 | // the credentials actually expiring. This is beneficial so race conditions | ||
60 | // with expiring credentials do not cause request to fail unexpectedly | ||
61 | // due to ExpiredTokenException exceptions. | ||
62 | // | ||
63 | // So a ExpiryWindow of 10s would cause calls to IsExpired() to return true | ||
64 | // 10 seconds before the credentials are actually expired. | ||
65 | // | ||
66 | // If ExpiryWindow is 0 or less it will be ignored. | ||
67 | ExpiryWindow time.Duration | ||
68 | } | ||
69 | |||
70 | // NewProviderClient returns a credentials Provider for retrieving AWS credentials | ||
71 | // from arbitrary endpoint. | ||
72 | func NewProviderClient(cfg aws.Config, handlers request.Handlers, endpoint string, options ...func(*Provider)) credentials.Provider { | ||
73 | p := &Provider{ | ||
74 | Client: client.New( | ||
75 | cfg, | ||
76 | metadata.ClientInfo{ | ||
77 | ServiceName: "CredentialsEndpoint", | ||
78 | Endpoint: endpoint, | ||
79 | }, | ||
80 | handlers, | ||
81 | ), | ||
82 | } | ||
83 | |||
84 | p.Client.Handlers.Unmarshal.PushBack(unmarshalHandler) | ||
85 | p.Client.Handlers.UnmarshalError.PushBack(unmarshalError) | ||
86 | p.Client.Handlers.Validate.Clear() | ||
87 | p.Client.Handlers.Validate.PushBack(validateEndpointHandler) | ||
88 | |||
89 | for _, option := range options { | ||
90 | option(p) | ||
91 | } | ||
92 | |||
93 | return p | ||
94 | } | ||
95 | |||
96 | // NewCredentialsClient returns a Credentials wrapper for retrieving credentials | ||
97 | // from an arbitrary endpoint concurrently. The client will request the | ||
98 | func NewCredentialsClient(cfg aws.Config, handlers request.Handlers, endpoint string, options ...func(*Provider)) *credentials.Credentials { | ||
99 | return credentials.NewCredentials(NewProviderClient(cfg, handlers, endpoint, options...)) | ||
100 | } | ||
101 | |||
102 | // IsExpired returns true if the credentials retrieved are expired, or not yet | ||
103 | // retrieved. | ||
104 | func (p *Provider) IsExpired() bool { | ||
105 | if p.staticCreds { | ||
106 | return false | ||
107 | } | ||
108 | return p.Expiry.IsExpired() | ||
109 | } | ||
110 | |||
111 | // Retrieve will attempt to request the credentials from the endpoint the Provider | ||
112 | // was configured for. And error will be returned if the retrieval fails. | ||
113 | func (p *Provider) Retrieve() (credentials.Value, error) { | ||
114 | resp, err := p.getCredentials() | ||
115 | if err != nil { | ||
116 | return credentials.Value{ProviderName: ProviderName}, | ||
117 | awserr.New("CredentialsEndpointError", "failed to load credentials", err) | ||
118 | } | ||
119 | |||
120 | if resp.Expiration != nil { | ||
121 | p.SetExpiration(*resp.Expiration, p.ExpiryWindow) | ||
122 | } else { | ||
123 | p.staticCreds = true | ||
124 | } | ||
125 | |||
126 | return credentials.Value{ | ||
127 | AccessKeyID: resp.AccessKeyID, | ||
128 | SecretAccessKey: resp.SecretAccessKey, | ||
129 | SessionToken: resp.Token, | ||
130 | ProviderName: ProviderName, | ||
131 | }, nil | ||
132 | } | ||
133 | |||
134 | type getCredentialsOutput struct { | ||
135 | Expiration *time.Time | ||
136 | AccessKeyID string | ||
137 | SecretAccessKey string | ||
138 | Token string | ||
139 | } | ||
140 | |||
141 | type errorOutput struct { | ||
142 | Code string `json:"code"` | ||
143 | Message string `json:"message"` | ||
144 | } | ||
145 | |||
146 | func (p *Provider) getCredentials() (*getCredentialsOutput, error) { | ||
147 | op := &request.Operation{ | ||
148 | Name: "GetCredentials", | ||
149 | HTTPMethod: "GET", | ||
150 | } | ||
151 | |||
152 | out := &getCredentialsOutput{} | ||
153 | req := p.Client.NewRequest(op, nil, out) | ||
154 | req.HTTPRequest.Header.Set("Accept", "application/json") | ||
155 | |||
156 | return out, req.Send() | ||
157 | } | ||
158 | |||
159 | func validateEndpointHandler(r *request.Request) { | ||
160 | if len(r.ClientInfo.Endpoint) == 0 { | ||
161 | r.Error = aws.ErrMissingEndpoint | ||
162 | } | ||
163 | } | ||
164 | |||
165 | func unmarshalHandler(r *request.Request) { | ||
166 | defer r.HTTPResponse.Body.Close() | ||
167 | |||
168 | out := r.Data.(*getCredentialsOutput) | ||
169 | if err := json.NewDecoder(r.HTTPResponse.Body).Decode(&out); err != nil { | ||
170 | r.Error = awserr.New("SerializationError", | ||
171 | "failed to decode endpoint credentials", | ||
172 | err, | ||
173 | ) | ||
174 | } | ||
175 | } | ||
176 | |||
177 | func unmarshalError(r *request.Request) { | ||
178 | defer r.HTTPResponse.Body.Close() | ||
179 | |||
180 | var errOut errorOutput | ||
181 | if err := json.NewDecoder(r.HTTPResponse.Body).Decode(&errOut); err != nil { | ||
182 | r.Error = awserr.New("SerializationError", | ||
183 | "failed to decode endpoint credentials", | ||
184 | err, | ||
185 | ) | ||
186 | } | ||
187 | |||
188 | // Response body format is not consistent between metadata endpoints. | ||
189 | // Grab the error message as a string and include that as the source error | ||
190 | r.Error = awserr.New(errOut.Code, errOut.Message, nil) | ||
191 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/env_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/env_provider.go new file mode 100644 index 0000000..c14231a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/env_provider.go | |||
@@ -0,0 +1,78 @@ | |||
1 | package credentials | ||
2 | |||
3 | import ( | ||
4 | "os" | ||
5 | |||
6 | "github.com/aws/aws-sdk-go/aws/awserr" | ||
7 | ) | ||
8 | |||
9 | // EnvProviderName provides a name of Env provider | ||
10 | const EnvProviderName = "EnvProvider" | ||
11 | |||
12 | var ( | ||
13 | // ErrAccessKeyIDNotFound is returned when the AWS Access Key ID can't be | ||
14 | // found in the process's environment. | ||
15 | // | ||
16 | // @readonly | ||
17 | ErrAccessKeyIDNotFound = awserr.New("EnvAccessKeyNotFound", "AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY not found in environment", nil) | ||
18 | |||
19 | // ErrSecretAccessKeyNotFound is returned when the AWS Secret Access Key | ||
20 | // can't be found in the process's environment. | ||
21 | // | ||
22 | // @readonly | ||
23 | ErrSecretAccessKeyNotFound = awserr.New("EnvSecretNotFound", "AWS_SECRET_ACCESS_KEY or AWS_SECRET_KEY not found in environment", nil) | ||
24 | ) | ||
25 | |||
26 | // A EnvProvider retrieves credentials from the environment variables of the | ||
27 | // running process. Environment credentials never expire. | ||
28 | // | ||
29 | // Environment variables used: | ||
30 | // | ||
31 | // * Access Key ID: AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY | ||
32 | // | ||
33 | // * Secret Access Key: AWS_SECRET_ACCESS_KEY or AWS_SECRET_KEY | ||
34 | type EnvProvider struct { | ||
35 | retrieved bool | ||
36 | } | ||
37 | |||
38 | // NewEnvCredentials returns a pointer to a new Credentials object | ||
39 | // wrapping the environment variable provider. | ||
40 | func NewEnvCredentials() *Credentials { | ||
41 | return NewCredentials(&EnvProvider{}) | ||
42 | } | ||
43 | |||
44 | // Retrieve retrieves the keys from the environment. | ||
45 | func (e *EnvProvider) Retrieve() (Value, error) { | ||
46 | e.retrieved = false | ||
47 | |||
48 | id := os.Getenv("AWS_ACCESS_KEY_ID") | ||
49 | if id == "" { | ||
50 | id = os.Getenv("AWS_ACCESS_KEY") | ||
51 | } | ||
52 | |||
53 | secret := os.Getenv("AWS_SECRET_ACCESS_KEY") | ||
54 | if secret == "" { | ||
55 | secret = os.Getenv("AWS_SECRET_KEY") | ||
56 | } | ||
57 | |||
58 | if id == "" { | ||
59 | return Value{ProviderName: EnvProviderName}, ErrAccessKeyIDNotFound | ||
60 | } | ||
61 | |||
62 | if secret == "" { | ||
63 | return Value{ProviderName: EnvProviderName}, ErrSecretAccessKeyNotFound | ||
64 | } | ||
65 | |||
66 | e.retrieved = true | ||
67 | return Value{ | ||
68 | AccessKeyID: id, | ||
69 | SecretAccessKey: secret, | ||
70 | SessionToken: os.Getenv("AWS_SESSION_TOKEN"), | ||
71 | ProviderName: EnvProviderName, | ||
72 | }, nil | ||
73 | } | ||
74 | |||
75 | // IsExpired returns if the credentials have been retrieved. | ||
76 | func (e *EnvProvider) IsExpired() bool { | ||
77 | return !e.retrieved | ||
78 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/example.ini b/vendor/github.com/aws/aws-sdk-go/aws/credentials/example.ini new file mode 100644 index 0000000..7fc91d9 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/example.ini | |||
@@ -0,0 +1,12 @@ | |||
1 | [default] | ||
2 | aws_access_key_id = accessKey | ||
3 | aws_secret_access_key = secret | ||
4 | aws_session_token = token | ||
5 | |||
6 | [no_token] | ||
7 | aws_access_key_id = accessKey | ||
8 | aws_secret_access_key = secret | ||
9 | |||
10 | [with_colon] | ||
11 | aws_access_key_id: accessKey | ||
12 | aws_secret_access_key: secret | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider.go new file mode 100644 index 0000000..7fb7cbf --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider.go | |||
@@ -0,0 +1,151 @@ | |||
1 | package credentials | ||
2 | |||
3 | import ( | ||
4 | "fmt" | ||
5 | "os" | ||
6 | "path/filepath" | ||
7 | |||
8 | "github.com/go-ini/ini" | ||
9 | |||
10 | "github.com/aws/aws-sdk-go/aws/awserr" | ||
11 | ) | ||
12 | |||
13 | // SharedCredsProviderName provides a name of SharedCreds provider | ||
14 | const SharedCredsProviderName = "SharedCredentialsProvider" | ||
15 | |||
16 | var ( | ||
17 | // ErrSharedCredentialsHomeNotFound is emitted when the user directory cannot be found. | ||
18 | // | ||
19 | // @readonly | ||
20 | ErrSharedCredentialsHomeNotFound = awserr.New("UserHomeNotFound", "user home directory not found.", nil) | ||
21 | ) | ||
22 | |||
23 | // A SharedCredentialsProvider retrieves credentials from the current user's home | ||
24 | // directory, and keeps track if those credentials are expired. | ||
25 | // | ||
26 | // Profile ini file example: $HOME/.aws/credentials | ||
27 | type SharedCredentialsProvider struct { | ||
28 | // Path to the shared credentials file. | ||
29 | // | ||
30 | // If empty will look for "AWS_SHARED_CREDENTIALS_FILE" env variable. If the | ||
31 | // env value is empty will default to current user's home directory. | ||
32 | // Linux/OSX: "$HOME/.aws/credentials" | ||
33 | // Windows: "%USERPROFILE%\.aws\credentials" | ||
34 | Filename string | ||
35 | |||
36 | // AWS Profile to extract credentials from the shared credentials file. If empty | ||
37 | // will default to environment variable "AWS_PROFILE" or "default" if | ||
38 | // environment variable is also not set. | ||
39 | Profile string | ||
40 | |||
41 | // retrieved states if the credentials have been successfully retrieved. | ||
42 | retrieved bool | ||
43 | } | ||
44 | |||
45 | // NewSharedCredentials returns a pointer to a new Credentials object | ||
46 | // wrapping the Profile file provider. | ||
47 | func NewSharedCredentials(filename, profile string) *Credentials { | ||
48 | return NewCredentials(&SharedCredentialsProvider{ | ||
49 | Filename: filename, | ||
50 | Profile: profile, | ||
51 | }) | ||
52 | } | ||
53 | |||
54 | // Retrieve reads and extracts the shared credentials from the current | ||
55 | // users home directory. | ||
56 | func (p *SharedCredentialsProvider) Retrieve() (Value, error) { | ||
57 | p.retrieved = false | ||
58 | |||
59 | filename, err := p.filename() | ||
60 | if err != nil { | ||
61 | return Value{ProviderName: SharedCredsProviderName}, err | ||
62 | } | ||
63 | |||
64 | creds, err := loadProfile(filename, p.profile()) | ||
65 | if err != nil { | ||
66 | return Value{ProviderName: SharedCredsProviderName}, err | ||
67 | } | ||
68 | |||
69 | p.retrieved = true | ||
70 | return creds, nil | ||
71 | } | ||
72 | |||
73 | // IsExpired returns if the shared credentials have expired. | ||
74 | func (p *SharedCredentialsProvider) IsExpired() bool { | ||
75 | return !p.retrieved | ||
76 | } | ||
77 | |||
78 | // loadProfiles loads from the file pointed to by shared credentials filename for profile. | ||
79 | // The credentials retrieved from the profile will be returned or error. Error will be | ||
80 | // returned if it fails to read from the file, or the data is invalid. | ||
81 | func loadProfile(filename, profile string) (Value, error) { | ||
82 | config, err := ini.Load(filename) | ||
83 | if err != nil { | ||
84 | return Value{ProviderName: SharedCredsProviderName}, awserr.New("SharedCredsLoad", "failed to load shared credentials file", err) | ||
85 | } | ||
86 | iniProfile, err := config.GetSection(profile) | ||
87 | if err != nil { | ||
88 | return Value{ProviderName: SharedCredsProviderName}, awserr.New("SharedCredsLoad", "failed to get profile", err) | ||
89 | } | ||
90 | |||
91 | id, err := iniProfile.GetKey("aws_access_key_id") | ||
92 | if err != nil { | ||
93 | return Value{ProviderName: SharedCredsProviderName}, awserr.New("SharedCredsAccessKey", | ||
94 | fmt.Sprintf("shared credentials %s in %s did not contain aws_access_key_id", profile, filename), | ||
95 | err) | ||
96 | } | ||
97 | |||
98 | secret, err := iniProfile.GetKey("aws_secret_access_key") | ||
99 | if err != nil { | ||
100 | return Value{ProviderName: SharedCredsProviderName}, awserr.New("SharedCredsSecret", | ||
101 | fmt.Sprintf("shared credentials %s in %s did not contain aws_secret_access_key", profile, filename), | ||
102 | nil) | ||
103 | } | ||
104 | |||
105 | // Default to empty string if not found | ||
106 | token := iniProfile.Key("aws_session_token") | ||
107 | |||
108 | return Value{ | ||
109 | AccessKeyID: id.String(), | ||
110 | SecretAccessKey: secret.String(), | ||
111 | SessionToken: token.String(), | ||
112 | ProviderName: SharedCredsProviderName, | ||
113 | }, nil | ||
114 | } | ||
115 | |||
116 | // filename returns the filename to use to read AWS shared credentials. | ||
117 | // | ||
118 | // Will return an error if the user's home directory path cannot be found. | ||
119 | func (p *SharedCredentialsProvider) filename() (string, error) { | ||
120 | if p.Filename == "" { | ||
121 | if p.Filename = os.Getenv("AWS_SHARED_CREDENTIALS_FILE"); p.Filename != "" { | ||
122 | return p.Filename, nil | ||
123 | } | ||
124 | |||
125 | homeDir := os.Getenv("HOME") // *nix | ||
126 | if homeDir == "" { // Windows | ||
127 | homeDir = os.Getenv("USERPROFILE") | ||
128 | } | ||
129 | if homeDir == "" { | ||
130 | return "", ErrSharedCredentialsHomeNotFound | ||
131 | } | ||
132 | |||
133 | p.Filename = filepath.Join(homeDir, ".aws", "credentials") | ||
134 | } | ||
135 | |||
136 | return p.Filename, nil | ||
137 | } | ||
138 | |||
139 | // profile returns the AWS shared credentials profile. If empty will read | ||
140 | // environment variable "AWS_PROFILE". If that is not set profile will | ||
141 | // return "default". | ||
142 | func (p *SharedCredentialsProvider) profile() string { | ||
143 | if p.Profile == "" { | ||
144 | p.Profile = os.Getenv("AWS_PROFILE") | ||
145 | } | ||
146 | if p.Profile == "" { | ||
147 | p.Profile = "default" | ||
148 | } | ||
149 | |||
150 | return p.Profile | ||
151 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/static_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/static_provider.go new file mode 100644 index 0000000..4f5dab3 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/static_provider.go | |||
@@ -0,0 +1,57 @@ | |||
1 | package credentials | ||
2 | |||
3 | import ( | ||
4 | "github.com/aws/aws-sdk-go/aws/awserr" | ||
5 | ) | ||
6 | |||
7 | // StaticProviderName provides a name of Static provider | ||
8 | const StaticProviderName = "StaticProvider" | ||
9 | |||
10 | var ( | ||
11 | // ErrStaticCredentialsEmpty is emitted when static credentials are empty. | ||
12 | // | ||
13 | // @readonly | ||
14 | ErrStaticCredentialsEmpty = awserr.New("EmptyStaticCreds", "static credentials are empty", nil) | ||
15 | ) | ||
16 | |||
17 | // A StaticProvider is a set of credentials which are set programmatically, | ||
18 | // and will never expire. | ||
19 | type StaticProvider struct { | ||
20 | Value | ||
21 | } | ||
22 | |||
23 | // NewStaticCredentials returns a pointer to a new Credentials object | ||
24 | // wrapping a static credentials value provider. | ||
25 | func NewStaticCredentials(id, secret, token string) *Credentials { | ||
26 | return NewCredentials(&StaticProvider{Value: Value{ | ||
27 | AccessKeyID: id, | ||
28 | SecretAccessKey: secret, | ||
29 | SessionToken: token, | ||
30 | }}) | ||
31 | } | ||
32 | |||
33 | // NewStaticCredentialsFromCreds returns a pointer to a new Credentials object | ||
34 | // wrapping the static credentials value provide. Same as NewStaticCredentials | ||
35 | // but takes the creds Value instead of individual fields | ||
36 | func NewStaticCredentialsFromCreds(creds Value) *Credentials { | ||
37 | return NewCredentials(&StaticProvider{Value: creds}) | ||
38 | } | ||
39 | |||
40 | // Retrieve returns the credentials or error if the credentials are invalid. | ||
41 | func (s *StaticProvider) Retrieve() (Value, error) { | ||
42 | if s.AccessKeyID == "" || s.SecretAccessKey == "" { | ||
43 | return Value{ProviderName: StaticProviderName}, ErrStaticCredentialsEmpty | ||
44 | } | ||
45 | |||
46 | if len(s.Value.ProviderName) == 0 { | ||
47 | s.Value.ProviderName = StaticProviderName | ||
48 | } | ||
49 | return s.Value, nil | ||
50 | } | ||
51 | |||
52 | // IsExpired returns if the credentials are expired. | ||
53 | // | ||
54 | // For StaticProvider, the credentials never expired. | ||
55 | func (s *StaticProvider) IsExpired() bool { | ||
56 | return false | ||
57 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go new file mode 100644 index 0000000..4108e43 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go | |||
@@ -0,0 +1,298 @@ | |||
1 | /* | ||
2 | Package stscreds are credential Providers to retrieve STS AWS credentials. | ||
3 | |||
4 | STS provides multiple ways to retrieve credentials which can be used when making | ||
5 | future AWS service API operation calls. | ||
6 | |||
7 | The SDK will ensure that per instance of credentials.Credentials all requests | ||
8 | to refresh the credentials will be synchronized. But, the SDK is unable to | ||
9 | ensure synchronous usage of the AssumeRoleProvider if the value is shared | ||
10 | between multiple Credentials, Sessions or service clients. | ||
11 | |||
12 | Assume Role | ||
13 | |||
14 | To assume an IAM role using STS with the SDK you can create a new Credentials | ||
15 | with the SDKs's stscreds package. | ||
16 | |||
17 | // Initial credentials loaded from SDK's default credential chain. Such as | ||
18 | // the environment, shared credentials (~/.aws/credentials), or EC2 Instance | ||
19 | // Role. These credentials will be used to to make the STS Assume Role API. | ||
20 | sess := session.Must(session.NewSession()) | ||
21 | |||
22 | // Create the credentials from AssumeRoleProvider to assume the role | ||
23 | // referenced by the "myRoleARN" ARN. | ||
24 | creds := stscreds.NewCredentials(sess, "myRoleArn") | ||
25 | |||
26 | // Create service client value configured for credentials | ||
27 | // from assumed role. | ||
28 | svc := s3.New(sess, &aws.Config{Credentials: creds}) | ||
29 | |||
30 | Assume Role with static MFA Token | ||
31 | |||
32 | To assume an IAM role with a MFA token you can either specify a MFA token code | ||
33 | directly or provide a function to prompt the user each time the credentials | ||
34 | need to refresh the role's credentials. Specifying the TokenCode should be used | ||
35 | for short lived operations that will not need to be refreshed, and when you do | ||
36 | not want to have direct control over the user provides their MFA token. | ||
37 | |||
38 | With TokenCode the AssumeRoleProvider will be not be able to refresh the role's | ||
39 | credentials. | ||
40 | |||
41 | // Create the credentials from AssumeRoleProvider to assume the role | ||
42 | // referenced by the "myRoleARN" ARN using the MFA token code provided. | ||
43 | creds := stscreds.NewCredentials(sess, "myRoleArn", func(p *stscreds.AssumeRoleProvider) { | ||
44 | p.SerialNumber = aws.String("myTokenSerialNumber") | ||
45 | p.TokenCode = aws.String("00000000") | ||
46 | }) | ||
47 | |||
48 | // Create service client value configured for credentials | ||
49 | // from assumed role. | ||
50 | svc := s3.New(sess, &aws.Config{Credentials: creds}) | ||
51 | |||
52 | Assume Role with MFA Token Provider | ||
53 | |||
54 | To assume an IAM role with MFA for longer running tasks where the credentials | ||
55 | may need to be refreshed setting the TokenProvider field of AssumeRoleProvider | ||
56 | will allow the credential provider to prompt for new MFA token code when the | ||
57 | role's credentials need to be refreshed. | ||
58 | |||
59 | The StdinTokenProvider function is available to prompt on stdin to retrieve | ||
60 | the MFA token code from the user. You can also implement custom prompts by | ||
61 | satisfing the TokenProvider function signature. | ||
62 | |||
63 | Using StdinTokenProvider with multiple AssumeRoleProviders, or Credentials will | ||
64 | have undesirable results as the StdinTokenProvider will not be synchronized. A | ||
65 | single Credentials with an AssumeRoleProvider can be shared safely. | ||
66 | |||
67 | // Create the credentials from AssumeRoleProvider to assume the role | ||
68 | // referenced by the "myRoleARN" ARN. Prompting for MFA token from stdin. | ||
69 | creds := stscreds.NewCredentials(sess, "myRoleArn", func(p *stscreds.AssumeRoleProvider) { | ||
70 | p.SerialNumber = aws.String("myTokenSerialNumber") | ||
71 | p.TokenProvider = stscreds.StdinTokenProvider | ||
72 | }) | ||
73 | |||
74 | // Create service client value configured for credentials | ||
75 | // from assumed role. | ||
76 | svc := s3.New(sess, &aws.Config{Credentials: creds}) | ||
77 | |||
78 | */ | ||
79 | package stscreds | ||
80 | |||
81 | import ( | ||
82 | "fmt" | ||
83 | "time" | ||
84 | |||
85 | "github.com/aws/aws-sdk-go/aws" | ||
86 | "github.com/aws/aws-sdk-go/aws/awserr" | ||
87 | "github.com/aws/aws-sdk-go/aws/client" | ||
88 | "github.com/aws/aws-sdk-go/aws/credentials" | ||
89 | "github.com/aws/aws-sdk-go/service/sts" | ||
90 | ) | ||
91 | |||
92 | // StdinTokenProvider will prompt on stdout and read from stdin for a string value. | ||
93 | // An error is returned if reading from stdin fails. | ||
94 | // | ||
95 | // Use this function go read MFA tokens from stdin. The function makes no attempt | ||
96 | // to make atomic prompts from stdin across multiple gorouties. | ||
97 | // | ||
98 | // Using StdinTokenProvider with multiple AssumeRoleProviders, or Credentials will | ||
99 | // have undesirable results as the StdinTokenProvider will not be synchronized. A | ||
100 | // single Credentials with an AssumeRoleProvider can be shared safely | ||
101 | // | ||
102 | // Will wait forever until something is provided on the stdin. | ||
103 | func StdinTokenProvider() (string, error) { | ||
104 | var v string | ||
105 | fmt.Printf("Assume Role MFA token code: ") | ||
106 | _, err := fmt.Scanln(&v) | ||
107 | |||
108 | return v, err | ||
109 | } | ||
110 | |||
111 | // ProviderName provides a name of AssumeRole provider | ||
112 | const ProviderName = "AssumeRoleProvider" | ||
113 | |||
114 | // AssumeRoler represents the minimal subset of the STS client API used by this provider. | ||
115 | type AssumeRoler interface { | ||
116 | AssumeRole(input *sts.AssumeRoleInput) (*sts.AssumeRoleOutput, error) | ||
117 | } | ||
118 | |||
119 | // DefaultDuration is the default amount of time in minutes that the credentials | ||
120 | // will be valid for. | ||
121 | var DefaultDuration = time.Duration(15) * time.Minute | ||
122 | |||
123 | // AssumeRoleProvider retrieves temporary credentials from the STS service, and | ||
124 | // keeps track of their expiration time. | ||
125 | // | ||
126 | // This credential provider will be used by the SDKs default credential change | ||
127 | // when shared configuration is enabled, and the shared config or shared credentials | ||
128 | // file configure assume role. See Session docs for how to do this. | ||
129 | // | ||
130 | // AssumeRoleProvider does not provide any synchronization and it is not safe | ||
131 | // to share this value across multiple Credentials, Sessions, or service clients | ||
132 | // without also sharing the same Credentials instance. | ||
133 | type AssumeRoleProvider struct { | ||
134 | credentials.Expiry | ||
135 | |||
136 | // STS client to make assume role request with. | ||
137 | Client AssumeRoler | ||
138 | |||
139 | // Role to be assumed. | ||
140 | RoleARN string | ||
141 | |||
142 | // Session name, if you wish to reuse the credentials elsewhere. | ||
143 | RoleSessionName string | ||
144 | |||
145 | // Expiry duration of the STS credentials. Defaults to 15 minutes if not set. | ||
146 | Duration time.Duration | ||
147 | |||
148 | // Optional ExternalID to pass along, defaults to nil if not set. | ||
149 | ExternalID *string | ||
150 | |||
151 | // The policy plain text must be 2048 bytes or shorter. However, an internal | ||
152 | // conversion compresses it into a packed binary format with a separate limit. | ||
153 | // The PackedPolicySize response element indicates by percentage how close to | ||
154 | // the upper size limit the policy is, with 100% equaling the maximum allowed | ||
155 | // size. | ||
156 | Policy *string | ||
157 | |||
158 | // The identification number of the MFA device that is associated with the user | ||
159 | // who is making the AssumeRole call. Specify this value if the trust policy | ||
160 | // of the role being assumed includes a condition that requires MFA authentication. | ||
161 | // The value is either the serial number for a hardware device (such as GAHT12345678) | ||
162 | // or an Amazon Resource Name (ARN) for a virtual device (such as arn:aws:iam::123456789012:mfa/user). | ||
163 | SerialNumber *string | ||
164 | |||
165 | // The value provided by the MFA device, if the trust policy of the role being | ||
166 | // assumed requires MFA (that is, if the policy includes a condition that tests | ||
167 | // for MFA). If the role being assumed requires MFA and if the TokenCode value | ||
168 | // is missing or expired, the AssumeRole call returns an "access denied" error. | ||
169 | // | ||
170 | // If SerialNumber is set and neither TokenCode nor TokenProvider are also | ||
171 | // set an error will be returned. | ||
172 | TokenCode *string | ||
173 | |||
174 | // Async method of providing MFA token code for assuming an IAM role with MFA. | ||
175 | // The value returned by the function will be used as the TokenCode in the Retrieve | ||
176 | // call. See StdinTokenProvider for a provider that prompts and reads from stdin. | ||
177 | // | ||
178 | // This token provider will be called when ever the assumed role's | ||
179 | // credentials need to be refreshed when SerialNumber is also set and | ||
180 | // TokenCode is not set. | ||
181 | // | ||
182 | // If both TokenCode and TokenProvider is set, TokenProvider will be used and | ||
183 | // TokenCode is ignored. | ||
184 | TokenProvider func() (string, error) | ||
185 | |||
186 | // ExpiryWindow will allow the credentials to trigger refreshing prior to | ||
187 | // the credentials actually expiring. This is beneficial so race conditions | ||
188 | // with expiring credentials do not cause request to fail unexpectedly | ||
189 | // due to ExpiredTokenException exceptions. | ||
190 | // | ||
191 | // So a ExpiryWindow of 10s would cause calls to IsExpired() to return true | ||
192 | // 10 seconds before the credentials are actually expired. | ||
193 | // | ||
194 | // If ExpiryWindow is 0 or less it will be ignored. | ||
195 | ExpiryWindow time.Duration | ||
196 | } | ||
197 | |||
198 | // NewCredentials returns a pointer to a new Credentials object wrapping the | ||
199 | // AssumeRoleProvider. The credentials will expire every 15 minutes and the | ||
200 | // role will be named after a nanosecond timestamp of this operation. | ||
201 | // | ||
202 | // Takes a Config provider to create the STS client. The ConfigProvider is | ||
203 | // satisfied by the session.Session type. | ||
204 | // | ||
205 | // It is safe to share the returned Credentials with multiple Sessions and | ||
206 | // service clients. All access to the credentials and refreshing them | ||
207 | // will be synchronized. | ||
208 | func NewCredentials(c client.ConfigProvider, roleARN string, options ...func(*AssumeRoleProvider)) *credentials.Credentials { | ||
209 | p := &AssumeRoleProvider{ | ||
210 | Client: sts.New(c), | ||
211 | RoleARN: roleARN, | ||
212 | Duration: DefaultDuration, | ||
213 | } | ||
214 | |||
215 | for _, option := range options { | ||
216 | option(p) | ||
217 | } | ||
218 | |||
219 | return credentials.NewCredentials(p) | ||
220 | } | ||
221 | |||
222 | // NewCredentialsWithClient returns a pointer to a new Credentials object wrapping the | ||
223 | // AssumeRoleProvider. The credentials will expire every 15 minutes and the | ||
224 | // role will be named after a nanosecond timestamp of this operation. | ||
225 | // | ||
226 | // Takes an AssumeRoler which can be satisfied by the STS client. | ||
227 | // | ||
228 | // It is safe to share the returned Credentials with multiple Sessions and | ||
229 | // service clients. All access to the credentials and refreshing them | ||
230 | // will be synchronized. | ||
231 | func NewCredentialsWithClient(svc AssumeRoler, roleARN string, options ...func(*AssumeRoleProvider)) *credentials.Credentials { | ||
232 | p := &AssumeRoleProvider{ | ||
233 | Client: svc, | ||
234 | RoleARN: roleARN, | ||
235 | Duration: DefaultDuration, | ||
236 | } | ||
237 | |||
238 | for _, option := range options { | ||
239 | option(p) | ||
240 | } | ||
241 | |||
242 | return credentials.NewCredentials(p) | ||
243 | } | ||
244 | |||
245 | // Retrieve generates a new set of temporary credentials using STS. | ||
246 | func (p *AssumeRoleProvider) Retrieve() (credentials.Value, error) { | ||
247 | |||
248 | // Apply defaults where parameters are not set. | ||
249 | if p.RoleSessionName == "" { | ||
250 | // Try to work out a role name that will hopefully end up unique. | ||
251 | p.RoleSessionName = fmt.Sprintf("%d", time.Now().UTC().UnixNano()) | ||
252 | } | ||
253 | if p.Duration == 0 { | ||
254 | // Expire as often as AWS permits. | ||
255 | p.Duration = DefaultDuration | ||
256 | } | ||
257 | input := &sts.AssumeRoleInput{ | ||
258 | DurationSeconds: aws.Int64(int64(p.Duration / time.Second)), | ||
259 | RoleArn: aws.String(p.RoleARN), | ||
260 | RoleSessionName: aws.String(p.RoleSessionName), | ||
261 | ExternalId: p.ExternalID, | ||
262 | } | ||
263 | if p.Policy != nil { | ||
264 | input.Policy = p.Policy | ||
265 | } | ||
266 | if p.SerialNumber != nil { | ||
267 | if p.TokenCode != nil { | ||
268 | input.SerialNumber = p.SerialNumber | ||
269 | input.TokenCode = p.TokenCode | ||
270 | } else if p.TokenProvider != nil { | ||
271 | input.SerialNumber = p.SerialNumber | ||
272 | code, err := p.TokenProvider() | ||
273 | if err != nil { | ||
274 | return credentials.Value{ProviderName: ProviderName}, err | ||
275 | } | ||
276 | input.TokenCode = aws.String(code) | ||
277 | } else { | ||
278 | return credentials.Value{ProviderName: ProviderName}, | ||
279 | awserr.New("AssumeRoleTokenNotAvailable", | ||
280 | "assume role with MFA enabled, but neither TokenCode nor TokenProvider are set", nil) | ||
281 | } | ||
282 | } | ||
283 | |||
284 | roleOutput, err := p.Client.AssumeRole(input) | ||
285 | if err != nil { | ||
286 | return credentials.Value{ProviderName: ProviderName}, err | ||
287 | } | ||
288 | |||
289 | // We will proactively generate new credentials before they expire. | ||
290 | p.SetExpiration(*roleOutput.Credentials.Expiration, p.ExpiryWindow) | ||
291 | |||
292 | return credentials.Value{ | ||
293 | AccessKeyID: *roleOutput.Credentials.AccessKeyId, | ||
294 | SecretAccessKey: *roleOutput.Credentials.SecretAccessKey, | ||
295 | SessionToken: *roleOutput.Credentials.SessionToken, | ||
296 | ProviderName: ProviderName, | ||
297 | }, nil | ||
298 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults.go b/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults.go new file mode 100644 index 0000000..07afe3b --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults.go | |||
@@ -0,0 +1,163 @@ | |||
1 | // Package defaults is a collection of helpers to retrieve the SDK's default | ||
2 | // configuration and handlers. | ||
3 | // | ||
4 | // Generally this package shouldn't be used directly, but session.Session | ||
5 | // instead. This package is useful when you need to reset the defaults | ||
6 | // of a session or service client to the SDK defaults before setting | ||
7 | // additional parameters. | ||
8 | package defaults | ||
9 | |||
10 | import ( | ||
11 | "fmt" | ||
12 | "net/http" | ||
13 | "net/url" | ||
14 | "os" | ||
15 | "time" | ||
16 | |||
17 | "github.com/aws/aws-sdk-go/aws" | ||
18 | "github.com/aws/aws-sdk-go/aws/awserr" | ||
19 | "github.com/aws/aws-sdk-go/aws/corehandlers" | ||
20 | "github.com/aws/aws-sdk-go/aws/credentials" | ||
21 | "github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds" | ||
22 | "github.com/aws/aws-sdk-go/aws/credentials/endpointcreds" | ||
23 | "github.com/aws/aws-sdk-go/aws/ec2metadata" | ||
24 | "github.com/aws/aws-sdk-go/aws/endpoints" | ||
25 | "github.com/aws/aws-sdk-go/aws/request" | ||
26 | ) | ||
27 | |||
28 | // A Defaults provides a collection of default values for SDK clients. | ||
29 | type Defaults struct { | ||
30 | Config *aws.Config | ||
31 | Handlers request.Handlers | ||
32 | } | ||
33 | |||
34 | // Get returns the SDK's default values with Config and handlers pre-configured. | ||
35 | func Get() Defaults { | ||
36 | cfg := Config() | ||
37 | handlers := Handlers() | ||
38 | cfg.Credentials = CredChain(cfg, handlers) | ||
39 | |||
40 | return Defaults{ | ||
41 | Config: cfg, | ||
42 | Handlers: handlers, | ||
43 | } | ||
44 | } | ||
45 | |||
46 | // Config returns the default configuration without credentials. | ||
47 | // To retrieve a config with credentials also included use | ||
48 | // `defaults.Get().Config` instead. | ||
49 | // | ||
50 | // Generally you shouldn't need to use this method directly, but | ||
51 | // is available if you need to reset the configuration of an | ||
52 | // existing service client or session. | ||
53 | func Config() *aws.Config { | ||
54 | return aws.NewConfig(). | ||
55 | WithCredentials(credentials.AnonymousCredentials). | ||
56 | WithRegion(os.Getenv("AWS_REGION")). | ||
57 | WithHTTPClient(http.DefaultClient). | ||
58 | WithMaxRetries(aws.UseServiceDefaultRetries). | ||
59 | WithLogger(aws.NewDefaultLogger()). | ||
60 | WithLogLevel(aws.LogOff). | ||
61 | WithEndpointResolver(endpoints.DefaultResolver()) | ||
62 | } | ||
63 | |||
64 | // Handlers returns the default request handlers. | ||
65 | // | ||
66 | // Generally you shouldn't need to use this method directly, but | ||
67 | // is available if you need to reset the request handlers of an | ||
68 | // existing service client or session. | ||
69 | func Handlers() request.Handlers { | ||
70 | var handlers request.Handlers | ||
71 | |||
72 | handlers.Validate.PushBackNamed(corehandlers.ValidateEndpointHandler) | ||
73 | handlers.Validate.AfterEachFn = request.HandlerListStopOnError | ||
74 | handlers.Build.PushBackNamed(corehandlers.SDKVersionUserAgentHandler) | ||
75 | handlers.Build.AfterEachFn = request.HandlerListStopOnError | ||
76 | handlers.Sign.PushBackNamed(corehandlers.BuildContentLengthHandler) | ||
77 | handlers.Send.PushBackNamed(corehandlers.ValidateReqSigHandler) | ||
78 | handlers.Send.PushBackNamed(corehandlers.SendHandler) | ||
79 | handlers.AfterRetry.PushBackNamed(corehandlers.AfterRetryHandler) | ||
80 | handlers.ValidateResponse.PushBackNamed(corehandlers.ValidateResponseHandler) | ||
81 | |||
82 | return handlers | ||
83 | } | ||
84 | |||
85 | // CredChain returns the default credential chain. | ||
86 | // | ||
87 | // Generally you shouldn't need to use this method directly, but | ||
88 | // is available if you need to reset the credentials of an | ||
89 | // existing service client or session's Config. | ||
90 | func CredChain(cfg *aws.Config, handlers request.Handlers) *credentials.Credentials { | ||
91 | return credentials.NewCredentials(&credentials.ChainProvider{ | ||
92 | VerboseErrors: aws.BoolValue(cfg.CredentialsChainVerboseErrors), | ||
93 | Providers: []credentials.Provider{ | ||
94 | &credentials.EnvProvider{}, | ||
95 | &credentials.SharedCredentialsProvider{Filename: "", Profile: ""}, | ||
96 | RemoteCredProvider(*cfg, handlers), | ||
97 | }, | ||
98 | }) | ||
99 | } | ||
100 | |||
101 | const ( | ||
102 | httpProviderEnvVar = "AWS_CONTAINER_CREDENTIALS_FULL_URI" | ||
103 | ecsCredsProviderEnvVar = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI" | ||
104 | ) | ||
105 | |||
106 | // RemoteCredProvider returns a credentials provider for the default remote | ||
107 | // endpoints such as EC2 or ECS Roles. | ||
108 | func RemoteCredProvider(cfg aws.Config, handlers request.Handlers) credentials.Provider { | ||
109 | if u := os.Getenv(httpProviderEnvVar); len(u) > 0 { | ||
110 | return localHTTPCredProvider(cfg, handlers, u) | ||
111 | } | ||
112 | |||
113 | if uri := os.Getenv(ecsCredsProviderEnvVar); len(uri) > 0 { | ||
114 | u := fmt.Sprintf("http://169.254.170.2%s", uri) | ||
115 | return httpCredProvider(cfg, handlers, u) | ||
116 | } | ||
117 | |||
118 | return ec2RoleProvider(cfg, handlers) | ||
119 | } | ||
120 | |||
121 | func localHTTPCredProvider(cfg aws.Config, handlers request.Handlers, u string) credentials.Provider { | ||
122 | var errMsg string | ||
123 | |||
124 | parsed, err := url.Parse(u) | ||
125 | if err != nil { | ||
126 | errMsg = fmt.Sprintf("invalid URL, %v", err) | ||
127 | } else if host := aws.URLHostname(parsed); !(host == "localhost" || host == "127.0.0.1") { | ||
128 | errMsg = fmt.Sprintf("invalid host address, %q, only localhost and 127.0.0.1 are valid.", host) | ||
129 | } | ||
130 | |||
131 | if len(errMsg) > 0 { | ||
132 | if cfg.Logger != nil { | ||
133 | cfg.Logger.Log("Ignoring, HTTP credential provider", errMsg, err) | ||
134 | } | ||
135 | return credentials.ErrorProvider{ | ||
136 | Err: awserr.New("CredentialsEndpointError", errMsg, err), | ||
137 | ProviderName: endpointcreds.ProviderName, | ||
138 | } | ||
139 | } | ||
140 | |||
141 | return httpCredProvider(cfg, handlers, u) | ||
142 | } | ||
143 | |||
144 | func httpCredProvider(cfg aws.Config, handlers request.Handlers, u string) credentials.Provider { | ||
145 | return endpointcreds.NewProviderClient(cfg, handlers, u, | ||
146 | func(p *endpointcreds.Provider) { | ||
147 | p.ExpiryWindow = 5 * time.Minute | ||
148 | }, | ||
149 | ) | ||
150 | } | ||
151 | |||
152 | func ec2RoleProvider(cfg aws.Config, handlers request.Handlers) credentials.Provider { | ||
153 | resolver := cfg.EndpointResolver | ||
154 | if resolver == nil { | ||
155 | resolver = endpoints.DefaultResolver() | ||
156 | } | ||
157 | |||
158 | e, _ := resolver.EndpointFor(endpoints.Ec2metadataServiceID, "") | ||
159 | return &ec2rolecreds.EC2RoleProvider{ | ||
160 | Client: ec2metadata.NewClient(cfg, handlers, e.URL, e.SigningRegion), | ||
161 | ExpiryWindow: 5 * time.Minute, | ||
162 | } | ||
163 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/doc.go b/vendor/github.com/aws/aws-sdk-go/aws/doc.go new file mode 100644 index 0000000..4fcb616 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/doc.go | |||
@@ -0,0 +1,56 @@ | |||
1 | // Package aws provides the core SDK's utilities and shared types. Use this package's | ||
2 | // utilities to simplify setting and reading API operations parameters. | ||
3 | // | ||
4 | // Value and Pointer Conversion Utilities | ||
5 | // | ||
6 | // This package includes a helper conversion utility for each scalar type the SDK's | ||
7 | // API use. These utilities make getting a pointer of the scalar, and dereferencing | ||
8 | // a pointer easier. | ||
9 | // | ||
10 | // Each conversion utility comes in two forms. Value to Pointer and Pointer to Value. | ||
11 | // The Pointer to value will safely dereference the pointer and return its value. | ||
12 | // If the pointer was nil, the scalar's zero value will be returned. | ||
13 | // | ||
14 | // The value to pointer functions will be named after the scalar type. So get a | ||
15 | // *string from a string value use the "String" function. This makes it easy to | ||
16 | // to get pointer of a literal string value, because getting the address of a | ||
17 | // literal requires assigning the value to a variable first. | ||
18 | // | ||
19 | // var strPtr *string | ||
20 | // | ||
21 | // // Without the SDK's conversion functions | ||
22 | // str := "my string" | ||
23 | // strPtr = &str | ||
24 | // | ||
25 | // // With the SDK's conversion functions | ||
26 | // strPtr = aws.String("my string") | ||
27 | // | ||
28 | // // Convert *string to string value | ||
29 | // str = aws.StringValue(strPtr) | ||
30 | // | ||
31 | // In addition to scalars the aws package also includes conversion utilities for | ||
32 | // map and slice for commonly types used in API parameters. The map and slice | ||
33 | // conversion functions use similar naming pattern as the scalar conversion | ||
34 | // functions. | ||
35 | // | ||
36 | // var strPtrs []*string | ||
37 | // var strs []string = []string{"Go", "Gophers", "Go"} | ||
38 | // | ||
39 | // // Convert []string to []*string | ||
40 | // strPtrs = aws.StringSlice(strs) | ||
41 | // | ||
42 | // // Convert []*string to []string | ||
43 | // strs = aws.StringValueSlice(strPtrs) | ||
44 | // | ||
45 | // SDK Default HTTP Client | ||
46 | // | ||
47 | // The SDK will use the http.DefaultClient if a HTTP client is not provided to | ||
48 | // the SDK's Session, or service client constructor. This means that if the | ||
49 | // http.DefaultClient is modified by other components of your application the | ||
50 | // modifications will be picked up by the SDK as well. | ||
51 | // | ||
52 | // In some cases this might be intended, but it is a better practice to create | ||
53 | // a custom HTTP Client to share explicitly through your application. You can | ||
54 | // configure the SDK to use the custom HTTP Client by setting the HTTPClient | ||
55 | // value of the SDK's Config type when creating a Session or service client. | ||
56 | package aws | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go new file mode 100644 index 0000000..984407a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go | |||
@@ -0,0 +1,162 @@ | |||
1 | package ec2metadata | ||
2 | |||
3 | import ( | ||
4 | "encoding/json" | ||
5 | "fmt" | ||
6 | "net/http" | ||
7 | "path" | ||
8 | "strings" | ||
9 | "time" | ||
10 | |||
11 | "github.com/aws/aws-sdk-go/aws/awserr" | ||
12 | "github.com/aws/aws-sdk-go/aws/request" | ||
13 | ) | ||
14 | |||
15 | // GetMetadata uses the path provided to request information from the EC2 | ||
16 | // instance metdata service. The content will be returned as a string, or | ||
17 | // error if the request failed. | ||
18 | func (c *EC2Metadata) GetMetadata(p string) (string, error) { | ||
19 | op := &request.Operation{ | ||
20 | Name: "GetMetadata", | ||
21 | HTTPMethod: "GET", | ||
22 | HTTPPath: path.Join("/", "meta-data", p), | ||
23 | } | ||
24 | |||
25 | output := &metadataOutput{} | ||
26 | req := c.NewRequest(op, nil, output) | ||
27 | |||
28 | return output.Content, req.Send() | ||
29 | } | ||
30 | |||
31 | // GetUserData returns the userdata that was configured for the service. If | ||
32 | // there is no user-data setup for the EC2 instance a "NotFoundError" error | ||
33 | // code will be returned. | ||
34 | func (c *EC2Metadata) GetUserData() (string, error) { | ||
35 | op := &request.Operation{ | ||
36 | Name: "GetUserData", | ||
37 | HTTPMethod: "GET", | ||
38 | HTTPPath: path.Join("/", "user-data"), | ||
39 | } | ||
40 | |||
41 | output := &metadataOutput{} | ||
42 | req := c.NewRequest(op, nil, output) | ||
43 | req.Handlers.UnmarshalError.PushBack(func(r *request.Request) { | ||
44 | if r.HTTPResponse.StatusCode == http.StatusNotFound { | ||
45 | r.Error = awserr.New("NotFoundError", "user-data not found", r.Error) | ||
46 | } | ||
47 | }) | ||
48 | |||
49 | return output.Content, req.Send() | ||
50 | } | ||
51 | |||
52 | // GetDynamicData uses the path provided to request information from the EC2 | ||
53 | // instance metadata service for dynamic data. The content will be returned | ||
54 | // as a string, or error if the request failed. | ||
55 | func (c *EC2Metadata) GetDynamicData(p string) (string, error) { | ||
56 | op := &request.Operation{ | ||
57 | Name: "GetDynamicData", | ||
58 | HTTPMethod: "GET", | ||
59 | HTTPPath: path.Join("/", "dynamic", p), | ||
60 | } | ||
61 | |||
62 | output := &metadataOutput{} | ||
63 | req := c.NewRequest(op, nil, output) | ||
64 | |||
65 | return output.Content, req.Send() | ||
66 | } | ||
67 | |||
68 | // GetInstanceIdentityDocument retrieves an identity document describing an | ||
69 | // instance. Error is returned if the request fails or is unable to parse | ||
70 | // the response. | ||
71 | func (c *EC2Metadata) GetInstanceIdentityDocument() (EC2InstanceIdentityDocument, error) { | ||
72 | resp, err := c.GetDynamicData("instance-identity/document") | ||
73 | if err != nil { | ||
74 | return EC2InstanceIdentityDocument{}, | ||
75 | awserr.New("EC2MetadataRequestError", | ||
76 | "failed to get EC2 instance identity document", err) | ||
77 | } | ||
78 | |||
79 | doc := EC2InstanceIdentityDocument{} | ||
80 | if err := json.NewDecoder(strings.NewReader(resp)).Decode(&doc); err != nil { | ||
81 | return EC2InstanceIdentityDocument{}, | ||
82 | awserr.New("SerializationError", | ||
83 | "failed to decode EC2 instance identity document", err) | ||
84 | } | ||
85 | |||
86 | return doc, nil | ||
87 | } | ||
88 | |||
89 | // IAMInfo retrieves IAM info from the metadata API | ||
90 | func (c *EC2Metadata) IAMInfo() (EC2IAMInfo, error) { | ||
91 | resp, err := c.GetMetadata("iam/info") | ||
92 | if err != nil { | ||
93 | return EC2IAMInfo{}, | ||
94 | awserr.New("EC2MetadataRequestError", | ||
95 | "failed to get EC2 IAM info", err) | ||
96 | } | ||
97 | |||
98 | info := EC2IAMInfo{} | ||
99 | if err := json.NewDecoder(strings.NewReader(resp)).Decode(&info); err != nil { | ||
100 | return EC2IAMInfo{}, | ||
101 | awserr.New("SerializationError", | ||
102 | "failed to decode EC2 IAM info", err) | ||
103 | } | ||
104 | |||
105 | if info.Code != "Success" { | ||
106 | errMsg := fmt.Sprintf("failed to get EC2 IAM Info (%s)", info.Code) | ||
107 | return EC2IAMInfo{}, | ||
108 | awserr.New("EC2MetadataError", errMsg, nil) | ||
109 | } | ||
110 | |||
111 | return info, nil | ||
112 | } | ||
113 | |||
114 | // Region returns the region the instance is running in. | ||
115 | func (c *EC2Metadata) Region() (string, error) { | ||
116 | resp, err := c.GetMetadata("placement/availability-zone") | ||
117 | if err != nil { | ||
118 | return "", err | ||
119 | } | ||
120 | |||
121 | // returns region without the suffix. Eg: us-west-2a becomes us-west-2 | ||
122 | return resp[:len(resp)-1], nil | ||
123 | } | ||
124 | |||
125 | // Available returns if the application has access to the EC2 Metadata service. | ||
126 | // Can be used to determine if application is running within an EC2 Instance and | ||
127 | // the metadata service is available. | ||
128 | func (c *EC2Metadata) Available() bool { | ||
129 | if _, err := c.GetMetadata("instance-id"); err != nil { | ||
130 | return false | ||
131 | } | ||
132 | |||
133 | return true | ||
134 | } | ||
135 | |||
136 | // An EC2IAMInfo provides the shape for unmarshaling | ||
137 | // an IAM info from the metadata API | ||
138 | type EC2IAMInfo struct { | ||
139 | Code string | ||
140 | LastUpdated time.Time | ||
141 | InstanceProfileArn string | ||
142 | InstanceProfileID string | ||
143 | } | ||
144 | |||
145 | // An EC2InstanceIdentityDocument provides the shape for unmarshaling | ||
146 | // an instance identity document | ||
147 | type EC2InstanceIdentityDocument struct { | ||
148 | DevpayProductCodes []string `json:"devpayProductCodes"` | ||
149 | AvailabilityZone string `json:"availabilityZone"` | ||
150 | PrivateIP string `json:"privateIp"` | ||
151 | Version string `json:"version"` | ||
152 | Region string `json:"region"` | ||
153 | InstanceID string `json:"instanceId"` | ||
154 | BillingProducts []string `json:"billingProducts"` | ||
155 | InstanceType string `json:"instanceType"` | ||
156 | AccountID string `json:"accountId"` | ||
157 | PendingTime time.Time `json:"pendingTime"` | ||
158 | ImageID string `json:"imageId"` | ||
159 | KernelID string `json:"kernelId"` | ||
160 | RamdiskID string `json:"ramdiskId"` | ||
161 | Architecture string `json:"architecture"` | ||
162 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go new file mode 100644 index 0000000..5b4379d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go | |||
@@ -0,0 +1,124 @@ | |||
1 | // Package ec2metadata provides the client for making API calls to the | ||
2 | // EC2 Metadata service. | ||
3 | package ec2metadata | ||
4 | |||
5 | import ( | ||
6 | "bytes" | ||
7 | "errors" | ||
8 | "io" | ||
9 | "net/http" | ||
10 | "time" | ||
11 | |||
12 | "github.com/aws/aws-sdk-go/aws" | ||
13 | "github.com/aws/aws-sdk-go/aws/awserr" | ||
14 | "github.com/aws/aws-sdk-go/aws/client" | ||
15 | "github.com/aws/aws-sdk-go/aws/client/metadata" | ||
16 | "github.com/aws/aws-sdk-go/aws/request" | ||
17 | ) | ||
18 | |||
19 | // ServiceName is the name of the service. | ||
20 | const ServiceName = "ec2metadata" | ||
21 | |||
22 | // A EC2Metadata is an EC2 Metadata service Client. | ||
23 | type EC2Metadata struct { | ||
24 | *client.Client | ||
25 | } | ||
26 | |||
27 | // New creates a new instance of the EC2Metadata client with a session. | ||
28 | // This client is safe to use across multiple goroutines. | ||
29 | // | ||
30 | // | ||
31 | // Example: | ||
32 | // // Create a EC2Metadata client from just a session. | ||
33 | // svc := ec2metadata.New(mySession) | ||
34 | // | ||
35 | // // Create a EC2Metadata client with additional configuration | ||
36 | // svc := ec2metadata.New(mySession, aws.NewConfig().WithLogLevel(aws.LogDebugHTTPBody)) | ||
37 | func New(p client.ConfigProvider, cfgs ...*aws.Config) *EC2Metadata { | ||
38 | c := p.ClientConfig(ServiceName, cfgs...) | ||
39 | return NewClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) | ||
40 | } | ||
41 | |||
42 | // NewClient returns a new EC2Metadata client. Should be used to create | ||
43 | // a client when not using a session. Generally using just New with a session | ||
44 | // is preferred. | ||
45 | // | ||
46 | // If an unmodified HTTP client is provided from the stdlib default, or no client | ||
47 | // the EC2RoleProvider's EC2Metadata HTTP client's timeout will be shortened. | ||
48 | // To disable this set Config.EC2MetadataDisableTimeoutOverride to false. Enabled by default. | ||
49 | func NewClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string, opts ...func(*client.Client)) *EC2Metadata { | ||
50 | if !aws.BoolValue(cfg.EC2MetadataDisableTimeoutOverride) && httpClientZero(cfg.HTTPClient) { | ||
51 | // If the http client is unmodified and this feature is not disabled | ||
52 | // set custom timeouts for EC2Metadata requests. | ||
53 | cfg.HTTPClient = &http.Client{ | ||
54 | // use a shorter timeout than default because the metadata | ||
55 | // service is local if it is running, and to fail faster | ||
56 | // if not running on an ec2 instance. | ||
57 | Timeout: 5 * time.Second, | ||
58 | } | ||
59 | } | ||
60 | |||
61 | svc := &EC2Metadata{ | ||
62 | Client: client.New( | ||
63 | cfg, | ||
64 | metadata.ClientInfo{ | ||
65 | ServiceName: ServiceName, | ||
66 | Endpoint: endpoint, | ||
67 | APIVersion: "latest", | ||
68 | }, | ||
69 | handlers, | ||
70 | ), | ||
71 | } | ||
72 | |||
73 | svc.Handlers.Unmarshal.PushBack(unmarshalHandler) | ||
74 | svc.Handlers.UnmarshalError.PushBack(unmarshalError) | ||
75 | svc.Handlers.Validate.Clear() | ||
76 | svc.Handlers.Validate.PushBack(validateEndpointHandler) | ||
77 | |||
78 | // Add additional options to the service config | ||
79 | for _, option := range opts { | ||
80 | option(svc.Client) | ||
81 | } | ||
82 | |||
83 | return svc | ||
84 | } | ||
85 | |||
86 | func httpClientZero(c *http.Client) bool { | ||
87 | return c == nil || (c.Transport == nil && c.CheckRedirect == nil && c.Jar == nil && c.Timeout == 0) | ||
88 | } | ||
89 | |||
90 | type metadataOutput struct { | ||
91 | Content string | ||
92 | } | ||
93 | |||
94 | func unmarshalHandler(r *request.Request) { | ||
95 | defer r.HTTPResponse.Body.Close() | ||
96 | b := &bytes.Buffer{} | ||
97 | if _, err := io.Copy(b, r.HTTPResponse.Body); err != nil { | ||
98 | r.Error = awserr.New("SerializationError", "unable to unmarshal EC2 metadata respose", err) | ||
99 | return | ||
100 | } | ||
101 | |||
102 | if data, ok := r.Data.(*metadataOutput); ok { | ||
103 | data.Content = b.String() | ||
104 | } | ||
105 | } | ||
106 | |||
107 | func unmarshalError(r *request.Request) { | ||
108 | defer r.HTTPResponse.Body.Close() | ||
109 | b := &bytes.Buffer{} | ||
110 | if _, err := io.Copy(b, r.HTTPResponse.Body); err != nil { | ||
111 | r.Error = awserr.New("SerializationError", "unable to unmarshal EC2 metadata error respose", err) | ||
112 | return | ||
113 | } | ||
114 | |||
115 | // Response body format is not consistent between metadata endpoints. | ||
116 | // Grab the error message as a string and include that as the source error | ||
117 | r.Error = awserr.New("EC2MetadataError", "failed to make EC2Metadata request", errors.New(b.String())) | ||
118 | } | ||
119 | |||
120 | func validateEndpointHandler(r *request.Request) { | ||
121 | if r.ClientInfo.Endpoint == "" { | ||
122 | r.Error = aws.ErrMissingEndpoint | ||
123 | } | ||
124 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/decode.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/decode.go new file mode 100644 index 0000000..74f72de --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/decode.go | |||
@@ -0,0 +1,133 @@ | |||
1 | package endpoints | ||
2 | |||
3 | import ( | ||
4 | "encoding/json" | ||
5 | "fmt" | ||
6 | "io" | ||
7 | |||
8 | "github.com/aws/aws-sdk-go/aws/awserr" | ||
9 | ) | ||
10 | |||
11 | type modelDefinition map[string]json.RawMessage | ||
12 | |||
13 | // A DecodeModelOptions are the options for how the endpoints model definition | ||
14 | // are decoded. | ||
15 | type DecodeModelOptions struct { | ||
16 | SkipCustomizations bool | ||
17 | } | ||
18 | |||
19 | // Set combines all of the option functions together. | ||
20 | func (d *DecodeModelOptions) Set(optFns ...func(*DecodeModelOptions)) { | ||
21 | for _, fn := range optFns { | ||
22 | fn(d) | ||
23 | } | ||
24 | } | ||
25 | |||
26 | // DecodeModel unmarshals a Regions and Endpoint model definition file into | ||
27 | // a endpoint Resolver. If the file format is not supported, or an error occurs | ||
28 | // when unmarshaling the model an error will be returned. | ||
29 | // | ||
30 | // Casting the return value of this func to a EnumPartitions will | ||
31 | // allow you to get a list of the partitions in the order the endpoints | ||
32 | // will be resolved in. | ||
33 | // | ||
34 | // resolver, err := endpoints.DecodeModel(reader) | ||
35 | // | ||
36 | // partitions := resolver.(endpoints.EnumPartitions).Partitions() | ||
37 | // for _, p := range partitions { | ||
38 | // // ... inspect partitions | ||
39 | // } | ||
40 | func DecodeModel(r io.Reader, optFns ...func(*DecodeModelOptions)) (Resolver, error) { | ||
41 | var opts DecodeModelOptions | ||
42 | opts.Set(optFns...) | ||
43 | |||
44 | // Get the version of the partition file to determine what | ||
45 | // unmarshaling model to use. | ||
46 | modelDef := modelDefinition{} | ||
47 | if err := json.NewDecoder(r).Decode(&modelDef); err != nil { | ||
48 | return nil, newDecodeModelError("failed to decode endpoints model", err) | ||
49 | } | ||
50 | |||
51 | var version string | ||
52 | if b, ok := modelDef["version"]; ok { | ||
53 | version = string(b) | ||
54 | } else { | ||
55 | return nil, newDecodeModelError("endpoints version not found in model", nil) | ||
56 | } | ||
57 | |||
58 | if version == "3" { | ||
59 | return decodeV3Endpoints(modelDef, opts) | ||
60 | } | ||
61 | |||
62 | return nil, newDecodeModelError( | ||
63 | fmt.Sprintf("endpoints version %s, not supported", version), nil) | ||
64 | } | ||
65 | |||
66 | func decodeV3Endpoints(modelDef modelDefinition, opts DecodeModelOptions) (Resolver, error) { | ||
67 | b, ok := modelDef["partitions"] | ||
68 | if !ok { | ||
69 | return nil, newDecodeModelError("endpoints model missing partitions", nil) | ||
70 | } | ||
71 | |||
72 | ps := partitions{} | ||
73 | if err := json.Unmarshal(b, &ps); err != nil { | ||
74 | return nil, newDecodeModelError("failed to decode endpoints model", err) | ||
75 | } | ||
76 | |||
77 | if opts.SkipCustomizations { | ||
78 | return ps, nil | ||
79 | } | ||
80 | |||
81 | // Customization | ||
82 | for i := 0; i < len(ps); i++ { | ||
83 | p := &ps[i] | ||
84 | custAddEC2Metadata(p) | ||
85 | custAddS3DualStack(p) | ||
86 | custRmIotDataService(p) | ||
87 | } | ||
88 | |||
89 | return ps, nil | ||
90 | } | ||
91 | |||
92 | func custAddS3DualStack(p *partition) { | ||
93 | if p.ID != "aws" { | ||
94 | return | ||
95 | } | ||
96 | |||
97 | s, ok := p.Services["s3"] | ||
98 | if !ok { | ||
99 | return | ||
100 | } | ||
101 | |||
102 | s.Defaults.HasDualStack = boxedTrue | ||
103 | s.Defaults.DualStackHostname = "{service}.dualstack.{region}.{dnsSuffix}" | ||
104 | |||
105 | p.Services["s3"] = s | ||
106 | } | ||
107 | |||
108 | func custAddEC2Metadata(p *partition) { | ||
109 | p.Services["ec2metadata"] = service{ | ||
110 | IsRegionalized: boxedFalse, | ||
111 | PartitionEndpoint: "aws-global", | ||
112 | Endpoints: endpoints{ | ||
113 | "aws-global": endpoint{ | ||
114 | Hostname: "169.254.169.254/latest", | ||
115 | Protocols: []string{"http"}, | ||
116 | }, | ||
117 | }, | ||
118 | } | ||
119 | } | ||
120 | |||
121 | func custRmIotDataService(p *partition) { | ||
122 | delete(p.Services, "data.iot") | ||
123 | } | ||
124 | |||
125 | type decodeModelError struct { | ||
126 | awsError | ||
127 | } | ||
128 | |||
129 | func newDecodeModelError(msg string, err error) decodeModelError { | ||
130 | return decodeModelError{ | ||
131 | awsError: awserr.New("DecodeEndpointsModelError", msg, err), | ||
132 | } | ||
133 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go new file mode 100644 index 0000000..e6d7ede --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go | |||
@@ -0,0 +1,2174 @@ | |||
1 | // Code generated by aws/endpoints/v3model_codegen.go. DO NOT EDIT. | ||
2 | |||
3 | package endpoints | ||
4 | |||
5 | import ( | ||
6 | "regexp" | ||
7 | ) | ||
8 | |||
9 | // Partition identifiers | ||
10 | const ( | ||
11 | AwsPartitionID = "aws" // AWS Standard partition. | ||
12 | AwsCnPartitionID = "aws-cn" // AWS China partition. | ||
13 | AwsUsGovPartitionID = "aws-us-gov" // AWS GovCloud (US) partition. | ||
14 | ) | ||
15 | |||
16 | // AWS Standard partition's regions. | ||
17 | const ( | ||
18 | ApNortheast1RegionID = "ap-northeast-1" // Asia Pacific (Tokyo). | ||
19 | ApNortheast2RegionID = "ap-northeast-2" // Asia Pacific (Seoul). | ||
20 | ApSouth1RegionID = "ap-south-1" // Asia Pacific (Mumbai). | ||
21 | ApSoutheast1RegionID = "ap-southeast-1" // Asia Pacific (Singapore). | ||
22 | ApSoutheast2RegionID = "ap-southeast-2" // Asia Pacific (Sydney). | ||
23 | CaCentral1RegionID = "ca-central-1" // Canada (Central). | ||
24 | EuCentral1RegionID = "eu-central-1" // EU (Frankfurt). | ||
25 | EuWest1RegionID = "eu-west-1" // EU (Ireland). | ||
26 | EuWest2RegionID = "eu-west-2" // EU (London). | ||
27 | SaEast1RegionID = "sa-east-1" // South America (Sao Paulo). | ||
28 | UsEast1RegionID = "us-east-1" // US East (N. Virginia). | ||
29 | UsEast2RegionID = "us-east-2" // US East (Ohio). | ||
30 | UsWest1RegionID = "us-west-1" // US West (N. California). | ||
31 | UsWest2RegionID = "us-west-2" // US West (Oregon). | ||
32 | ) | ||
33 | |||
34 | // AWS China partition's regions. | ||
35 | const ( | ||
36 | CnNorth1RegionID = "cn-north-1" // China (Beijing). | ||
37 | ) | ||
38 | |||
39 | // AWS GovCloud (US) partition's regions. | ||
40 | const ( | ||
41 | UsGovWest1RegionID = "us-gov-west-1" // AWS GovCloud (US). | ||
42 | ) | ||
43 | |||
44 | // Service identifiers | ||
45 | const ( | ||
46 | AcmServiceID = "acm" // Acm. | ||
47 | ApigatewayServiceID = "apigateway" // Apigateway. | ||
48 | ApplicationAutoscalingServiceID = "application-autoscaling" // ApplicationAutoscaling. | ||
49 | Appstream2ServiceID = "appstream2" // Appstream2. | ||
50 | AutoscalingServiceID = "autoscaling" // Autoscaling. | ||
51 | BatchServiceID = "batch" // Batch. | ||
52 | BudgetsServiceID = "budgets" // Budgets. | ||
53 | ClouddirectoryServiceID = "clouddirectory" // Clouddirectory. | ||
54 | CloudformationServiceID = "cloudformation" // Cloudformation. | ||
55 | CloudfrontServiceID = "cloudfront" // Cloudfront. | ||
56 | CloudhsmServiceID = "cloudhsm" // Cloudhsm. | ||
57 | CloudsearchServiceID = "cloudsearch" // Cloudsearch. | ||
58 | CloudtrailServiceID = "cloudtrail" // Cloudtrail. | ||
59 | CodebuildServiceID = "codebuild" // Codebuild. | ||
60 | CodecommitServiceID = "codecommit" // Codecommit. | ||
61 | CodedeployServiceID = "codedeploy" // Codedeploy. | ||
62 | CodepipelineServiceID = "codepipeline" // Codepipeline. | ||
63 | CodestarServiceID = "codestar" // Codestar. | ||
64 | CognitoIdentityServiceID = "cognito-identity" // CognitoIdentity. | ||
65 | CognitoIdpServiceID = "cognito-idp" // CognitoIdp. | ||
66 | CognitoSyncServiceID = "cognito-sync" // CognitoSync. | ||
67 | ConfigServiceID = "config" // Config. | ||
68 | CurServiceID = "cur" // Cur. | ||
69 | DatapipelineServiceID = "datapipeline" // Datapipeline. | ||
70 | DevicefarmServiceID = "devicefarm" // Devicefarm. | ||
71 | DirectconnectServiceID = "directconnect" // Directconnect. | ||
72 | DiscoveryServiceID = "discovery" // Discovery. | ||
73 | DmsServiceID = "dms" // Dms. | ||
74 | DsServiceID = "ds" // Ds. | ||
75 | DynamodbServiceID = "dynamodb" // Dynamodb. | ||
76 | Ec2ServiceID = "ec2" // Ec2. | ||
77 | Ec2metadataServiceID = "ec2metadata" // Ec2metadata. | ||
78 | EcrServiceID = "ecr" // Ecr. | ||
79 | EcsServiceID = "ecs" // Ecs. | ||
80 | ElasticacheServiceID = "elasticache" // Elasticache. | ||
81 | ElasticbeanstalkServiceID = "elasticbeanstalk" // Elasticbeanstalk. | ||
82 | ElasticfilesystemServiceID = "elasticfilesystem" // Elasticfilesystem. | ||
83 | ElasticloadbalancingServiceID = "elasticloadbalancing" // Elasticloadbalancing. | ||
84 | ElasticmapreduceServiceID = "elasticmapreduce" // Elasticmapreduce. | ||
85 | ElastictranscoderServiceID = "elastictranscoder" // Elastictranscoder. | ||
86 | EmailServiceID = "email" // Email. | ||
87 | EntitlementMarketplaceServiceID = "entitlement.marketplace" // EntitlementMarketplace. | ||
88 | EsServiceID = "es" // Es. | ||
89 | EventsServiceID = "events" // Events. | ||
90 | FirehoseServiceID = "firehose" // Firehose. | ||
91 | GameliftServiceID = "gamelift" // Gamelift. | ||
92 | GlacierServiceID = "glacier" // Glacier. | ||
93 | HealthServiceID = "health" // Health. | ||
94 | IamServiceID = "iam" // Iam. | ||
95 | ImportexportServiceID = "importexport" // Importexport. | ||
96 | InspectorServiceID = "inspector" // Inspector. | ||
97 | IotServiceID = "iot" // Iot. | ||
98 | KinesisServiceID = "kinesis" // Kinesis. | ||
99 | KinesisanalyticsServiceID = "kinesisanalytics" // Kinesisanalytics. | ||
100 | KmsServiceID = "kms" // Kms. | ||
101 | LambdaServiceID = "lambda" // Lambda. | ||
102 | LightsailServiceID = "lightsail" // Lightsail. | ||
103 | LogsServiceID = "logs" // Logs. | ||
104 | MachinelearningServiceID = "machinelearning" // Machinelearning. | ||
105 | MarketplacecommerceanalyticsServiceID = "marketplacecommerceanalytics" // Marketplacecommerceanalytics. | ||
106 | MeteringMarketplaceServiceID = "metering.marketplace" // MeteringMarketplace. | ||
107 | MobileanalyticsServiceID = "mobileanalytics" // Mobileanalytics. | ||
108 | ModelsLexServiceID = "models.lex" // ModelsLex. | ||
109 | MonitoringServiceID = "monitoring" // Monitoring. | ||
110 | MturkRequesterServiceID = "mturk-requester" // MturkRequester. | ||
111 | OpsworksServiceID = "opsworks" // Opsworks. | ||
112 | OpsworksCmServiceID = "opsworks-cm" // OpsworksCm. | ||
113 | OrganizationsServiceID = "organizations" // Organizations. | ||
114 | PinpointServiceID = "pinpoint" // Pinpoint. | ||
115 | PollyServiceID = "polly" // Polly. | ||
116 | RdsServiceID = "rds" // Rds. | ||
117 | RedshiftServiceID = "redshift" // Redshift. | ||
118 | RekognitionServiceID = "rekognition" // Rekognition. | ||
119 | Route53ServiceID = "route53" // Route53. | ||
120 | Route53domainsServiceID = "route53domains" // Route53domains. | ||
121 | RuntimeLexServiceID = "runtime.lex" // RuntimeLex. | ||
122 | S3ServiceID = "s3" // S3. | ||
123 | SdbServiceID = "sdb" // Sdb. | ||
124 | ServicecatalogServiceID = "servicecatalog" // Servicecatalog. | ||
125 | ShieldServiceID = "shield" // Shield. | ||
126 | SmsServiceID = "sms" // Sms. | ||
127 | SnowballServiceID = "snowball" // Snowball. | ||
128 | SnsServiceID = "sns" // Sns. | ||
129 | SqsServiceID = "sqs" // Sqs. | ||
130 | SsmServiceID = "ssm" // Ssm. | ||
131 | StatesServiceID = "states" // States. | ||
132 | StoragegatewayServiceID = "storagegateway" // Storagegateway. | ||
133 | StreamsDynamodbServiceID = "streams.dynamodb" // StreamsDynamodb. | ||
134 | StsServiceID = "sts" // Sts. | ||
135 | SupportServiceID = "support" // Support. | ||
136 | SwfServiceID = "swf" // Swf. | ||
137 | TaggingServiceID = "tagging" // Tagging. | ||
138 | WafServiceID = "waf" // Waf. | ||
139 | WafRegionalServiceID = "waf-regional" // WafRegional. | ||
140 | WorkdocsServiceID = "workdocs" // Workdocs. | ||
141 | WorkspacesServiceID = "workspaces" // Workspaces. | ||
142 | XrayServiceID = "xray" // Xray. | ||
143 | ) | ||
144 | |||
145 | // DefaultResolver returns an Endpoint resolver that will be able | ||
146 | // to resolve endpoints for: AWS Standard, AWS China, and AWS GovCloud (US). | ||
147 | // | ||
148 | // Use DefaultPartitions() to get the list of the default partitions. | ||
149 | func DefaultResolver() Resolver { | ||
150 | return defaultPartitions | ||
151 | } | ||
152 | |||
153 | // DefaultPartitions returns a list of the partitions the SDK is bundled | ||
154 | // with. The available partitions are: AWS Standard, AWS China, and AWS GovCloud (US). | ||
155 | // | ||
156 | // partitions := endpoints.DefaultPartitions | ||
157 | // for _, p := range partitions { | ||
158 | // // ... inspect partitions | ||
159 | // } | ||
160 | func DefaultPartitions() []Partition { | ||
161 | return defaultPartitions.Partitions() | ||
162 | } | ||
163 | |||
164 | var defaultPartitions = partitions{ | ||
165 | awsPartition, | ||
166 | awscnPartition, | ||
167 | awsusgovPartition, | ||
168 | } | ||
169 | |||
170 | // AwsPartition returns the Resolver for AWS Standard. | ||
171 | func AwsPartition() Partition { | ||
172 | return awsPartition.Partition() | ||
173 | } | ||
174 | |||
175 | var awsPartition = partition{ | ||
176 | ID: "aws", | ||
177 | Name: "AWS Standard", | ||
178 | DNSSuffix: "amazonaws.com", | ||
179 | RegionRegex: regionRegex{ | ||
180 | Regexp: func() *regexp.Regexp { | ||
181 | reg, _ := regexp.Compile("^(us|eu|ap|sa|ca)\\-\\w+\\-\\d+$") | ||
182 | return reg | ||
183 | }(), | ||
184 | }, | ||
185 | Defaults: endpoint{ | ||
186 | Hostname: "{service}.{region}.{dnsSuffix}", | ||
187 | Protocols: []string{"https"}, | ||
188 | SignatureVersions: []string{"v4"}, | ||
189 | }, | ||
190 | Regions: regions{ | ||
191 | "ap-northeast-1": region{ | ||
192 | Description: "Asia Pacific (Tokyo)", | ||
193 | }, | ||
194 | "ap-northeast-2": region{ | ||
195 | Description: "Asia Pacific (Seoul)", | ||
196 | }, | ||
197 | "ap-south-1": region{ | ||
198 | Description: "Asia Pacific (Mumbai)", | ||
199 | }, | ||
200 | "ap-southeast-1": region{ | ||
201 | Description: "Asia Pacific (Singapore)", | ||
202 | }, | ||
203 | "ap-southeast-2": region{ | ||
204 | Description: "Asia Pacific (Sydney)", | ||
205 | }, | ||
206 | "ca-central-1": region{ | ||
207 | Description: "Canada (Central)", | ||
208 | }, | ||
209 | "eu-central-1": region{ | ||
210 | Description: "EU (Frankfurt)", | ||
211 | }, | ||
212 | "eu-west-1": region{ | ||
213 | Description: "EU (Ireland)", | ||
214 | }, | ||
215 | "eu-west-2": region{ | ||
216 | Description: "EU (London)", | ||
217 | }, | ||
218 | "sa-east-1": region{ | ||
219 | Description: "South America (Sao Paulo)", | ||
220 | }, | ||
221 | "us-east-1": region{ | ||
222 | Description: "US East (N. Virginia)", | ||
223 | }, | ||
224 | "us-east-2": region{ | ||
225 | Description: "US East (Ohio)", | ||
226 | }, | ||
227 | "us-west-1": region{ | ||
228 | Description: "US West (N. California)", | ||
229 | }, | ||
230 | "us-west-2": region{ | ||
231 | Description: "US West (Oregon)", | ||
232 | }, | ||
233 | }, | ||
234 | Services: services{ | ||
235 | "acm": service{ | ||
236 | |||
237 | Endpoints: endpoints{ | ||
238 | "ap-northeast-1": endpoint{}, | ||
239 | "ap-northeast-2": endpoint{}, | ||
240 | "ap-south-1": endpoint{}, | ||
241 | "ap-southeast-1": endpoint{}, | ||
242 | "ap-southeast-2": endpoint{}, | ||
243 | "ca-central-1": endpoint{}, | ||
244 | "eu-central-1": endpoint{}, | ||
245 | "eu-west-1": endpoint{}, | ||
246 | "eu-west-2": endpoint{}, | ||
247 | "sa-east-1": endpoint{}, | ||
248 | "us-east-1": endpoint{}, | ||
249 | "us-east-2": endpoint{}, | ||
250 | "us-west-1": endpoint{}, | ||
251 | "us-west-2": endpoint{}, | ||
252 | }, | ||
253 | }, | ||
254 | "apigateway": service{ | ||
255 | |||
256 | Endpoints: endpoints{ | ||
257 | "ap-northeast-1": endpoint{}, | ||
258 | "ap-northeast-2": endpoint{}, | ||
259 | "ap-south-1": endpoint{}, | ||
260 | "ap-southeast-1": endpoint{}, | ||
261 | "ap-southeast-2": endpoint{}, | ||
262 | "eu-central-1": endpoint{}, | ||
263 | "eu-west-1": endpoint{}, | ||
264 | "eu-west-2": endpoint{}, | ||
265 | "us-east-1": endpoint{}, | ||
266 | "us-east-2": endpoint{}, | ||
267 | "us-west-1": endpoint{}, | ||
268 | "us-west-2": endpoint{}, | ||
269 | }, | ||
270 | }, | ||
271 | "application-autoscaling": service{ | ||
272 | Defaults: endpoint{ | ||
273 | Hostname: "autoscaling.{region}.amazonaws.com", | ||
274 | Protocols: []string{"http", "https"}, | ||
275 | CredentialScope: credentialScope{ | ||
276 | Service: "application-autoscaling", | ||
277 | }, | ||
278 | }, | ||
279 | Endpoints: endpoints{ | ||
280 | "ap-northeast-1": endpoint{}, | ||
281 | "ap-northeast-2": endpoint{}, | ||
282 | "ap-south-1": endpoint{}, | ||
283 | "ap-southeast-1": endpoint{}, | ||
284 | "ap-southeast-2": endpoint{}, | ||
285 | "ca-central-1": endpoint{}, | ||
286 | "eu-central-1": endpoint{}, | ||
287 | "eu-west-1": endpoint{}, | ||
288 | "eu-west-2": endpoint{}, | ||
289 | "sa-east-1": endpoint{}, | ||
290 | "us-east-1": endpoint{}, | ||
291 | "us-east-2": endpoint{}, | ||
292 | "us-west-1": endpoint{}, | ||
293 | "us-west-2": endpoint{}, | ||
294 | }, | ||
295 | }, | ||
296 | "appstream2": service{ | ||
297 | Defaults: endpoint{ | ||
298 | Protocols: []string{"https"}, | ||
299 | CredentialScope: credentialScope{ | ||
300 | Service: "appstream", | ||
301 | }, | ||
302 | }, | ||
303 | Endpoints: endpoints{ | ||
304 | "ap-northeast-1": endpoint{}, | ||
305 | "eu-west-1": endpoint{}, | ||
306 | "us-east-1": endpoint{}, | ||
307 | "us-west-2": endpoint{}, | ||
308 | }, | ||
309 | }, | ||
310 | "autoscaling": service{ | ||
311 | Defaults: endpoint{ | ||
312 | Protocols: []string{"http", "https"}, | ||
313 | }, | ||
314 | Endpoints: endpoints{ | ||
315 | "ap-northeast-1": endpoint{}, | ||
316 | "ap-northeast-2": endpoint{}, | ||
317 | "ap-south-1": endpoint{}, | ||
318 | "ap-southeast-1": endpoint{}, | ||
319 | "ap-southeast-2": endpoint{}, | ||
320 | "ca-central-1": endpoint{}, | ||
321 | "eu-central-1": endpoint{}, | ||
322 | "eu-west-1": endpoint{}, | ||
323 | "eu-west-2": endpoint{}, | ||
324 | "sa-east-1": endpoint{}, | ||
325 | "us-east-1": endpoint{}, | ||
326 | "us-east-2": endpoint{}, | ||
327 | "us-west-1": endpoint{}, | ||
328 | "us-west-2": endpoint{}, | ||
329 | }, | ||
330 | }, | ||
331 | "batch": service{ | ||
332 | |||
333 | Endpoints: endpoints{ | ||
334 | "us-east-1": endpoint{}, | ||
335 | }, | ||
336 | }, | ||
337 | "budgets": service{ | ||
338 | PartitionEndpoint: "aws-global", | ||
339 | IsRegionalized: boxedFalse, | ||
340 | |||
341 | Endpoints: endpoints{ | ||
342 | "aws-global": endpoint{ | ||
343 | Hostname: "budgets.amazonaws.com", | ||
344 | CredentialScope: credentialScope{ | ||
345 | Region: "us-east-1", | ||
346 | }, | ||
347 | }, | ||
348 | }, | ||
349 | }, | ||
350 | "clouddirectory": service{ | ||
351 | |||
352 | Endpoints: endpoints{ | ||
353 | "ap-southeast-1": endpoint{}, | ||
354 | "ap-southeast-2": endpoint{}, | ||
355 | "eu-west-1": endpoint{}, | ||
356 | "eu-west-2": endpoint{}, | ||
357 | "us-east-1": endpoint{}, | ||
358 | "us-east-2": endpoint{}, | ||
359 | "us-west-2": endpoint{}, | ||
360 | }, | ||
361 | }, | ||
362 | "cloudformation": service{ | ||
363 | |||
364 | Endpoints: endpoints{ | ||
365 | "ap-northeast-1": endpoint{}, | ||
366 | "ap-northeast-2": endpoint{}, | ||
367 | "ap-south-1": endpoint{}, | ||
368 | "ap-southeast-1": endpoint{}, | ||
369 | "ap-southeast-2": endpoint{}, | ||
370 | "ca-central-1": endpoint{}, | ||
371 | "eu-central-1": endpoint{}, | ||
372 | "eu-west-1": endpoint{}, | ||
373 | "eu-west-2": endpoint{}, | ||
374 | "sa-east-1": endpoint{}, | ||
375 | "us-east-1": endpoint{}, | ||
376 | "us-east-2": endpoint{}, | ||
377 | "us-west-1": endpoint{}, | ||
378 | "us-west-2": endpoint{}, | ||
379 | }, | ||
380 | }, | ||
381 | "cloudfront": service{ | ||
382 | PartitionEndpoint: "aws-global", | ||
383 | IsRegionalized: boxedFalse, | ||
384 | |||
385 | Endpoints: endpoints{ | ||
386 | "aws-global": endpoint{ | ||
387 | Hostname: "cloudfront.amazonaws.com", | ||
388 | Protocols: []string{"http", "https"}, | ||
389 | CredentialScope: credentialScope{ | ||
390 | Region: "us-east-1", | ||
391 | }, | ||
392 | }, | ||
393 | }, | ||
394 | }, | ||
395 | "cloudhsm": service{ | ||
396 | |||
397 | Endpoints: endpoints{ | ||
398 | "ap-northeast-1": endpoint{}, | ||
399 | "ap-southeast-1": endpoint{}, | ||
400 | "ap-southeast-2": endpoint{}, | ||
401 | "ca-central-1": endpoint{}, | ||
402 | "eu-central-1": endpoint{}, | ||
403 | "eu-west-1": endpoint{}, | ||
404 | "us-east-1": endpoint{}, | ||
405 | "us-east-2": endpoint{}, | ||
406 | "us-west-1": endpoint{}, | ||
407 | "us-west-2": endpoint{}, | ||
408 | }, | ||
409 | }, | ||
410 | "cloudsearch": service{ | ||
411 | |||
412 | Endpoints: endpoints{ | ||
413 | "ap-northeast-1": endpoint{}, | ||
414 | "ap-northeast-2": endpoint{}, | ||
415 | "ap-southeast-1": endpoint{}, | ||
416 | "ap-southeast-2": endpoint{}, | ||
417 | "eu-central-1": endpoint{}, | ||
418 | "eu-west-1": endpoint{}, | ||
419 | "sa-east-1": endpoint{}, | ||
420 | "us-east-1": endpoint{}, | ||
421 | "us-west-1": endpoint{}, | ||
422 | "us-west-2": endpoint{}, | ||
423 | }, | ||
424 | }, | ||
425 | "cloudtrail": service{ | ||
426 | |||
427 | Endpoints: endpoints{ | ||
428 | "ap-northeast-1": endpoint{}, | ||
429 | "ap-northeast-2": endpoint{}, | ||
430 | "ap-south-1": endpoint{}, | ||
431 | "ap-southeast-1": endpoint{}, | ||
432 | "ap-southeast-2": endpoint{}, | ||
433 | "ca-central-1": endpoint{}, | ||
434 | "eu-central-1": endpoint{}, | ||
435 | "eu-west-1": endpoint{}, | ||
436 | "eu-west-2": endpoint{}, | ||
437 | "sa-east-1": endpoint{}, | ||
438 | "us-east-1": endpoint{}, | ||
439 | "us-east-2": endpoint{}, | ||
440 | "us-west-1": endpoint{}, | ||
441 | "us-west-2": endpoint{}, | ||
442 | }, | ||
443 | }, | ||
444 | "codebuild": service{ | ||
445 | |||
446 | Endpoints: endpoints{ | ||
447 | "ap-northeast-1": endpoint{}, | ||
448 | "ap-southeast-1": endpoint{}, | ||
449 | "ap-southeast-2": endpoint{}, | ||
450 | "eu-central-1": endpoint{}, | ||
451 | "eu-west-1": endpoint{}, | ||
452 | "us-east-1": endpoint{}, | ||
453 | "us-east-2": endpoint{}, | ||
454 | "us-west-2": endpoint{}, | ||
455 | }, | ||
456 | }, | ||
457 | "codecommit": service{ | ||
458 | |||
459 | Endpoints: endpoints{ | ||
460 | "eu-west-1": endpoint{}, | ||
461 | "us-east-1": endpoint{}, | ||
462 | "us-east-2": endpoint{}, | ||
463 | "us-west-2": endpoint{}, | ||
464 | }, | ||
465 | }, | ||
466 | "codedeploy": service{ | ||
467 | |||
468 | Endpoints: endpoints{ | ||
469 | "ap-northeast-1": endpoint{}, | ||
470 | "ap-northeast-2": endpoint{}, | ||
471 | "ap-south-1": endpoint{}, | ||
472 | "ap-southeast-1": endpoint{}, | ||
473 | "ap-southeast-2": endpoint{}, | ||
474 | "ca-central-1": endpoint{}, | ||
475 | "eu-central-1": endpoint{}, | ||
476 | "eu-west-1": endpoint{}, | ||
477 | "eu-west-2": endpoint{}, | ||
478 | "sa-east-1": endpoint{}, | ||
479 | "us-east-1": endpoint{}, | ||
480 | "us-east-2": endpoint{}, | ||
481 | "us-west-1": endpoint{}, | ||
482 | "us-west-2": endpoint{}, | ||
483 | }, | ||
484 | }, | ||
485 | "codepipeline": service{ | ||
486 | |||
487 | Endpoints: endpoints{ | ||
488 | "ap-northeast-1": endpoint{}, | ||
489 | "ap-southeast-1": endpoint{}, | ||
490 | "ap-southeast-2": endpoint{}, | ||
491 | "eu-central-1": endpoint{}, | ||
492 | "eu-west-1": endpoint{}, | ||
493 | "sa-east-1": endpoint{}, | ||
494 | "us-east-1": endpoint{}, | ||
495 | "us-east-2": endpoint{}, | ||
496 | "us-west-2": endpoint{}, | ||
497 | }, | ||
498 | }, | ||
499 | "codestar": service{ | ||
500 | |||
501 | Endpoints: endpoints{ | ||
502 | "eu-west-1": endpoint{}, | ||
503 | "us-east-1": endpoint{}, | ||
504 | "us-east-2": endpoint{}, | ||
505 | "us-west-2": endpoint{}, | ||
506 | }, | ||
507 | }, | ||
508 | "cognito-identity": service{ | ||
509 | |||
510 | Endpoints: endpoints{ | ||
511 | "ap-northeast-1": endpoint{}, | ||
512 | "ap-northeast-2": endpoint{}, | ||
513 | "ap-south-1": endpoint{}, | ||
514 | "ap-southeast-2": endpoint{}, | ||
515 | "eu-central-1": endpoint{}, | ||
516 | "eu-west-1": endpoint{}, | ||
517 | "eu-west-2": endpoint{}, | ||
518 | "us-east-1": endpoint{}, | ||
519 | "us-east-2": endpoint{}, | ||
520 | "us-west-2": endpoint{}, | ||
521 | }, | ||
522 | }, | ||
523 | "cognito-idp": service{ | ||
524 | |||
525 | Endpoints: endpoints{ | ||
526 | "ap-northeast-1": endpoint{}, | ||
527 | "ap-northeast-2": endpoint{}, | ||
528 | "ap-south-1": endpoint{}, | ||
529 | "ap-southeast-2": endpoint{}, | ||
530 | "eu-central-1": endpoint{}, | ||
531 | "eu-west-1": endpoint{}, | ||
532 | "eu-west-2": endpoint{}, | ||
533 | "us-east-1": endpoint{}, | ||
534 | "us-east-2": endpoint{}, | ||
535 | "us-west-2": endpoint{}, | ||
536 | }, | ||
537 | }, | ||
538 | "cognito-sync": service{ | ||
539 | |||
540 | Endpoints: endpoints{ | ||
541 | "ap-northeast-1": endpoint{}, | ||
542 | "ap-northeast-2": endpoint{}, | ||
543 | "ap-south-1": endpoint{}, | ||
544 | "ap-southeast-2": endpoint{}, | ||
545 | "eu-central-1": endpoint{}, | ||
546 | "eu-west-1": endpoint{}, | ||
547 | "eu-west-2": endpoint{}, | ||
548 | "us-east-1": endpoint{}, | ||
549 | "us-east-2": endpoint{}, | ||
550 | "us-west-2": endpoint{}, | ||
551 | }, | ||
552 | }, | ||
553 | "config": service{ | ||
554 | |||
555 | Endpoints: endpoints{ | ||
556 | "ap-northeast-1": endpoint{}, | ||
557 | "ap-northeast-2": endpoint{}, | ||
558 | "ap-south-1": endpoint{}, | ||
559 | "ap-southeast-1": endpoint{}, | ||
560 | "ap-southeast-2": endpoint{}, | ||
561 | "ca-central-1": endpoint{}, | ||
562 | "eu-central-1": endpoint{}, | ||
563 | "eu-west-1": endpoint{}, | ||
564 | "eu-west-2": endpoint{}, | ||
565 | "sa-east-1": endpoint{}, | ||
566 | "us-east-1": endpoint{}, | ||
567 | "us-east-2": endpoint{}, | ||
568 | "us-west-1": endpoint{}, | ||
569 | "us-west-2": endpoint{}, | ||
570 | }, | ||
571 | }, | ||
572 | "cur": service{ | ||
573 | |||
574 | Endpoints: endpoints{ | ||
575 | "us-east-1": endpoint{}, | ||
576 | }, | ||
577 | }, | ||
578 | "datapipeline": service{ | ||
579 | |||
580 | Endpoints: endpoints{ | ||
581 | "ap-northeast-1": endpoint{}, | ||
582 | "ap-southeast-2": endpoint{}, | ||
583 | "eu-west-1": endpoint{}, | ||
584 | "us-east-1": endpoint{}, | ||
585 | "us-west-2": endpoint{}, | ||
586 | }, | ||
587 | }, | ||
588 | "devicefarm": service{ | ||
589 | |||
590 | Endpoints: endpoints{ | ||
591 | "us-west-2": endpoint{}, | ||
592 | }, | ||
593 | }, | ||
594 | "directconnect": service{ | ||
595 | |||
596 | Endpoints: endpoints{ | ||
597 | "ap-northeast-1": endpoint{}, | ||
598 | "ap-northeast-2": endpoint{}, | ||
599 | "ap-south-1": endpoint{}, | ||
600 | "ap-southeast-1": endpoint{}, | ||
601 | "ap-southeast-2": endpoint{}, | ||
602 | "ca-central-1": endpoint{}, | ||
603 | "eu-central-1": endpoint{}, | ||
604 | "eu-west-1": endpoint{}, | ||
605 | "eu-west-2": endpoint{}, | ||
606 | "sa-east-1": endpoint{}, | ||
607 | "us-east-1": endpoint{}, | ||
608 | "us-east-2": endpoint{}, | ||
609 | "us-west-1": endpoint{}, | ||
610 | "us-west-2": endpoint{}, | ||
611 | }, | ||
612 | }, | ||
613 | "discovery": service{ | ||
614 | |||
615 | Endpoints: endpoints{ | ||
616 | "us-west-2": endpoint{}, | ||
617 | }, | ||
618 | }, | ||
619 | "dms": service{ | ||
620 | |||
621 | Endpoints: endpoints{ | ||
622 | "ap-northeast-1": endpoint{}, | ||
623 | "ap-northeast-2": endpoint{}, | ||
624 | "ap-south-1": endpoint{}, | ||
625 | "ap-southeast-1": endpoint{}, | ||
626 | "ap-southeast-2": endpoint{}, | ||
627 | "ca-central-1": endpoint{}, | ||
628 | "eu-central-1": endpoint{}, | ||
629 | "eu-west-1": endpoint{}, | ||
630 | "eu-west-2": endpoint{}, | ||
631 | "sa-east-1": endpoint{}, | ||
632 | "us-east-1": endpoint{}, | ||
633 | "us-east-2": endpoint{}, | ||
634 | "us-west-1": endpoint{}, | ||
635 | "us-west-2": endpoint{}, | ||
636 | }, | ||
637 | }, | ||
638 | "ds": service{ | ||
639 | |||
640 | Endpoints: endpoints{ | ||
641 | "ap-northeast-1": endpoint{}, | ||
642 | "ap-southeast-1": endpoint{}, | ||
643 | "ap-southeast-2": endpoint{}, | ||
644 | "eu-central-1": endpoint{}, | ||
645 | "eu-west-1": endpoint{}, | ||
646 | "us-east-1": endpoint{}, | ||
647 | "us-west-2": endpoint{}, | ||
648 | }, | ||
649 | }, | ||
650 | "dynamodb": service{ | ||
651 | Defaults: endpoint{ | ||
652 | Protocols: []string{"http", "https"}, | ||
653 | }, | ||
654 | Endpoints: endpoints{ | ||
655 | "ap-northeast-1": endpoint{}, | ||
656 | "ap-northeast-2": endpoint{}, | ||
657 | "ap-south-1": endpoint{}, | ||
658 | "ap-southeast-1": endpoint{}, | ||
659 | "ap-southeast-2": endpoint{}, | ||
660 | "ca-central-1": endpoint{}, | ||
661 | "eu-central-1": endpoint{}, | ||
662 | "eu-west-1": endpoint{}, | ||
663 | "eu-west-2": endpoint{}, | ||
664 | "local": endpoint{ | ||
665 | Hostname: "localhost:8000", | ||
666 | Protocols: []string{"http"}, | ||
667 | CredentialScope: credentialScope{ | ||
668 | Region: "us-east-1", | ||
669 | }, | ||
670 | }, | ||
671 | "sa-east-1": endpoint{}, | ||
672 | "us-east-1": endpoint{}, | ||
673 | "us-east-2": endpoint{}, | ||
674 | "us-west-1": endpoint{}, | ||
675 | "us-west-2": endpoint{}, | ||
676 | }, | ||
677 | }, | ||
678 | "ec2": service{ | ||
679 | Defaults: endpoint{ | ||
680 | Protocols: []string{"http", "https"}, | ||
681 | }, | ||
682 | Endpoints: endpoints{ | ||
683 | "ap-northeast-1": endpoint{}, | ||
684 | "ap-northeast-2": endpoint{}, | ||
685 | "ap-south-1": endpoint{}, | ||
686 | "ap-southeast-1": endpoint{}, | ||
687 | "ap-southeast-2": endpoint{}, | ||
688 | "ca-central-1": endpoint{}, | ||
689 | "eu-central-1": endpoint{}, | ||
690 | "eu-west-1": endpoint{}, | ||
691 | "eu-west-2": endpoint{}, | ||
692 | "sa-east-1": endpoint{}, | ||
693 | "us-east-1": endpoint{}, | ||
694 | "us-east-2": endpoint{}, | ||
695 | "us-west-1": endpoint{}, | ||
696 | "us-west-2": endpoint{}, | ||
697 | }, | ||
698 | }, | ||
699 | "ec2metadata": service{ | ||
700 | PartitionEndpoint: "aws-global", | ||
701 | IsRegionalized: boxedFalse, | ||
702 | |||
703 | Endpoints: endpoints{ | ||
704 | "aws-global": endpoint{ | ||
705 | Hostname: "169.254.169.254/latest", | ||
706 | Protocols: []string{"http"}, | ||
707 | }, | ||
708 | }, | ||
709 | }, | ||
710 | "ecr": service{ | ||
711 | |||
712 | Endpoints: endpoints{ | ||
713 | "ap-northeast-1": endpoint{}, | ||
714 | "ap-southeast-1": endpoint{}, | ||
715 | "ap-southeast-2": endpoint{}, | ||
716 | "ca-central-1": endpoint{}, | ||
717 | "eu-central-1": endpoint{}, | ||
718 | "eu-west-1": endpoint{}, | ||
719 | "eu-west-2": endpoint{}, | ||
720 | "us-east-1": endpoint{}, | ||
721 | "us-east-2": endpoint{}, | ||
722 | "us-west-1": endpoint{}, | ||
723 | "us-west-2": endpoint{}, | ||
724 | }, | ||
725 | }, | ||
726 | "ecs": service{ | ||
727 | |||
728 | Endpoints: endpoints{ | ||
729 | "ap-northeast-1": endpoint{}, | ||
730 | "ap-southeast-1": endpoint{}, | ||
731 | "ap-southeast-2": endpoint{}, | ||
732 | "ca-central-1": endpoint{}, | ||
733 | "eu-central-1": endpoint{}, | ||
734 | "eu-west-1": endpoint{}, | ||
735 | "eu-west-2": endpoint{}, | ||
736 | "us-east-1": endpoint{}, | ||
737 | "us-east-2": endpoint{}, | ||
738 | "us-west-1": endpoint{}, | ||
739 | "us-west-2": endpoint{}, | ||
740 | }, | ||
741 | }, | ||
742 | "elasticache": service{ | ||
743 | |||
744 | Endpoints: endpoints{ | ||
745 | "ap-northeast-1": endpoint{}, | ||
746 | "ap-northeast-2": endpoint{}, | ||
747 | "ap-south-1": endpoint{}, | ||
748 | "ap-southeast-1": endpoint{}, | ||
749 | "ap-southeast-2": endpoint{}, | ||
750 | "ca-central-1": endpoint{}, | ||
751 | "eu-central-1": endpoint{}, | ||
752 | "eu-west-1": endpoint{}, | ||
753 | "eu-west-2": endpoint{}, | ||
754 | "sa-east-1": endpoint{}, | ||
755 | "us-east-1": endpoint{}, | ||
756 | "us-east-2": endpoint{}, | ||
757 | "us-west-1": endpoint{}, | ||
758 | "us-west-2": endpoint{}, | ||
759 | }, | ||
760 | }, | ||
761 | "elasticbeanstalk": service{ | ||
762 | |||
763 | Endpoints: endpoints{ | ||
764 | "ap-northeast-1": endpoint{}, | ||
765 | "ap-northeast-2": endpoint{}, | ||
766 | "ap-south-1": endpoint{}, | ||
767 | "ap-southeast-1": endpoint{}, | ||
768 | "ap-southeast-2": endpoint{}, | ||
769 | "ca-central-1": endpoint{}, | ||
770 | "eu-central-1": endpoint{}, | ||
771 | "eu-west-1": endpoint{}, | ||
772 | "eu-west-2": endpoint{}, | ||
773 | "sa-east-1": endpoint{}, | ||
774 | "us-east-1": endpoint{}, | ||
775 | "us-east-2": endpoint{}, | ||
776 | "us-west-1": endpoint{}, | ||
777 | "us-west-2": endpoint{}, | ||
778 | }, | ||
779 | }, | ||
780 | "elasticfilesystem": service{ | ||
781 | |||
782 | Endpoints: endpoints{ | ||
783 | "ap-southeast-2": endpoint{}, | ||
784 | "eu-west-1": endpoint{}, | ||
785 | "us-east-1": endpoint{}, | ||
786 | "us-east-2": endpoint{}, | ||
787 | "us-west-2": endpoint{}, | ||
788 | }, | ||
789 | }, | ||
790 | "elasticloadbalancing": service{ | ||
791 | Defaults: endpoint{ | ||
792 | Protocols: []string{"http", "https"}, | ||
793 | }, | ||
794 | Endpoints: endpoints{ | ||
795 | "ap-northeast-1": endpoint{}, | ||
796 | "ap-northeast-2": endpoint{}, | ||
797 | "ap-south-1": endpoint{}, | ||
798 | "ap-southeast-1": endpoint{}, | ||
799 | "ap-southeast-2": endpoint{}, | ||
800 | "ca-central-1": endpoint{}, | ||
801 | "eu-central-1": endpoint{}, | ||
802 | "eu-west-1": endpoint{}, | ||
803 | "eu-west-2": endpoint{}, | ||
804 | "sa-east-1": endpoint{}, | ||
805 | "us-east-1": endpoint{}, | ||
806 | "us-east-2": endpoint{}, | ||
807 | "us-west-1": endpoint{}, | ||
808 | "us-west-2": endpoint{}, | ||
809 | }, | ||
810 | }, | ||
811 | "elasticmapreduce": service{ | ||
812 | Defaults: endpoint{ | ||
813 | SSLCommonName: "{region}.{service}.{dnsSuffix}", | ||
814 | Protocols: []string{"http", "https"}, | ||
815 | }, | ||
816 | Endpoints: endpoints{ | ||
817 | "ap-northeast-1": endpoint{}, | ||
818 | "ap-northeast-2": endpoint{}, | ||
819 | "ap-south-1": endpoint{}, | ||
820 | "ap-southeast-1": endpoint{}, | ||
821 | "ap-southeast-2": endpoint{}, | ||
822 | "ca-central-1": endpoint{}, | ||
823 | "eu-central-1": endpoint{ | ||
824 | SSLCommonName: "{service}.{region}.{dnsSuffix}", | ||
825 | }, | ||
826 | "eu-west-1": endpoint{}, | ||
827 | "eu-west-2": endpoint{}, | ||
828 | "sa-east-1": endpoint{}, | ||
829 | "us-east-1": endpoint{ | ||
830 | SSLCommonName: "{service}.{region}.{dnsSuffix}", | ||
831 | }, | ||
832 | "us-east-2": endpoint{}, | ||
833 | "us-west-1": endpoint{}, | ||
834 | "us-west-2": endpoint{}, | ||
835 | }, | ||
836 | }, | ||
837 | "elastictranscoder": service{ | ||
838 | |||
839 | Endpoints: endpoints{ | ||
840 | "ap-northeast-1": endpoint{}, | ||
841 | "ap-south-1": endpoint{}, | ||
842 | "ap-southeast-1": endpoint{}, | ||
843 | "ap-southeast-2": endpoint{}, | ||
844 | "eu-west-1": endpoint{}, | ||
845 | "us-east-1": endpoint{}, | ||
846 | "us-west-1": endpoint{}, | ||
847 | "us-west-2": endpoint{}, | ||
848 | }, | ||
849 | }, | ||
850 | "email": service{ | ||
851 | |||
852 | Endpoints: endpoints{ | ||
853 | "eu-west-1": endpoint{}, | ||
854 | "us-east-1": endpoint{}, | ||
855 | "us-west-2": endpoint{}, | ||
856 | }, | ||
857 | }, | ||
858 | "entitlement.marketplace": service{ | ||
859 | Defaults: endpoint{ | ||
860 | CredentialScope: credentialScope{ | ||
861 | Service: "aws-marketplace", | ||
862 | }, | ||
863 | }, | ||
864 | Endpoints: endpoints{ | ||
865 | "us-east-1": endpoint{}, | ||
866 | }, | ||
867 | }, | ||
868 | "es": service{ | ||
869 | |||
870 | Endpoints: endpoints{ | ||
871 | "ap-northeast-1": endpoint{}, | ||
872 | "ap-northeast-2": endpoint{}, | ||
873 | "ap-south-1": endpoint{}, | ||
874 | "ap-southeast-1": endpoint{}, | ||
875 | "ap-southeast-2": endpoint{}, | ||
876 | "ca-central-1": endpoint{}, | ||
877 | "eu-central-1": endpoint{}, | ||
878 | "eu-west-1": endpoint{}, | ||
879 | "eu-west-2": endpoint{}, | ||
880 | "sa-east-1": endpoint{}, | ||
881 | "us-east-1": endpoint{}, | ||
882 | "us-east-2": endpoint{}, | ||
883 | "us-west-1": endpoint{}, | ||
884 | "us-west-2": endpoint{}, | ||
885 | }, | ||
886 | }, | ||
887 | "events": service{ | ||
888 | |||
889 | Endpoints: endpoints{ | ||
890 | "ap-northeast-1": endpoint{}, | ||
891 | "ap-northeast-2": endpoint{}, | ||
892 | "ap-south-1": endpoint{}, | ||
893 | "ap-southeast-1": endpoint{}, | ||
894 | "ap-southeast-2": endpoint{}, | ||
895 | "ca-central-1": endpoint{}, | ||
896 | "eu-central-1": endpoint{}, | ||
897 | "eu-west-1": endpoint{}, | ||
898 | "eu-west-2": endpoint{}, | ||
899 | "sa-east-1": endpoint{}, | ||
900 | "us-east-1": endpoint{}, | ||
901 | "us-east-2": endpoint{}, | ||
902 | "us-west-1": endpoint{}, | ||
903 | "us-west-2": endpoint{}, | ||
904 | }, | ||
905 | }, | ||
906 | "firehose": service{ | ||
907 | |||
908 | Endpoints: endpoints{ | ||
909 | "eu-west-1": endpoint{}, | ||
910 | "us-east-1": endpoint{}, | ||
911 | "us-west-2": endpoint{}, | ||
912 | }, | ||
913 | }, | ||
914 | "gamelift": service{ | ||
915 | |||
916 | Endpoints: endpoints{ | ||
917 | "ap-northeast-1": endpoint{}, | ||
918 | "ap-northeast-2": endpoint{}, | ||
919 | "ap-south-1": endpoint{}, | ||
920 | "ap-southeast-1": endpoint{}, | ||
921 | "eu-central-1": endpoint{}, | ||
922 | "eu-west-1": endpoint{}, | ||
923 | "sa-east-1": endpoint{}, | ||
924 | "us-east-1": endpoint{}, | ||
925 | "us-west-2": endpoint{}, | ||
926 | }, | ||
927 | }, | ||
928 | "glacier": service{ | ||
929 | Defaults: endpoint{ | ||
930 | Protocols: []string{"http", "https"}, | ||
931 | }, | ||
932 | Endpoints: endpoints{ | ||
933 | "ap-northeast-1": endpoint{}, | ||
934 | "ap-northeast-2": endpoint{}, | ||
935 | "ap-south-1": endpoint{}, | ||
936 | "ap-southeast-2": endpoint{}, | ||
937 | "ca-central-1": endpoint{}, | ||
938 | "eu-central-1": endpoint{}, | ||
939 | "eu-west-1": endpoint{}, | ||
940 | "eu-west-2": endpoint{}, | ||
941 | "us-east-1": endpoint{}, | ||
942 | "us-east-2": endpoint{}, | ||
943 | "us-west-1": endpoint{}, | ||
944 | "us-west-2": endpoint{}, | ||
945 | }, | ||
946 | }, | ||
947 | "health": service{ | ||
948 | |||
949 | Endpoints: endpoints{ | ||
950 | "us-east-1": endpoint{}, | ||
951 | }, | ||
952 | }, | ||
953 | "iam": service{ | ||
954 | PartitionEndpoint: "aws-global", | ||
955 | IsRegionalized: boxedFalse, | ||
956 | |||
957 | Endpoints: endpoints{ | ||
958 | "aws-global": endpoint{ | ||
959 | Hostname: "iam.amazonaws.com", | ||
960 | CredentialScope: credentialScope{ | ||
961 | Region: "us-east-1", | ||
962 | }, | ||
963 | }, | ||
964 | }, | ||
965 | }, | ||
966 | "importexport": service{ | ||
967 | PartitionEndpoint: "aws-global", | ||
968 | IsRegionalized: boxedFalse, | ||
969 | |||
970 | Endpoints: endpoints{ | ||
971 | "aws-global": endpoint{ | ||
972 | Hostname: "importexport.amazonaws.com", | ||
973 | SignatureVersions: []string{"v2", "v4"}, | ||
974 | CredentialScope: credentialScope{ | ||
975 | Region: "us-east-1", | ||
976 | Service: "IngestionService", | ||
977 | }, | ||
978 | }, | ||
979 | }, | ||
980 | }, | ||
981 | "inspector": service{ | ||
982 | |||
983 | Endpoints: endpoints{ | ||
984 | "ap-northeast-1": endpoint{}, | ||
985 | "ap-northeast-2": endpoint{}, | ||
986 | "ap-south-1": endpoint{}, | ||
987 | "ap-southeast-2": endpoint{}, | ||
988 | "eu-west-1": endpoint{}, | ||
989 | "us-east-1": endpoint{}, | ||
990 | "us-west-2": endpoint{}, | ||
991 | }, | ||
992 | }, | ||
993 | "iot": service{ | ||
994 | Defaults: endpoint{ | ||
995 | CredentialScope: credentialScope{ | ||
996 | Service: "execute-api", | ||
997 | }, | ||
998 | }, | ||
999 | Endpoints: endpoints{ | ||
1000 | "ap-northeast-1": endpoint{}, | ||
1001 | "ap-northeast-2": endpoint{}, | ||
1002 | "ap-southeast-1": endpoint{}, | ||
1003 | "ap-southeast-2": endpoint{}, | ||
1004 | "eu-central-1": endpoint{}, | ||
1005 | "eu-west-1": endpoint{}, | ||
1006 | "eu-west-2": endpoint{}, | ||
1007 | "us-east-1": endpoint{}, | ||
1008 | "us-east-2": endpoint{}, | ||
1009 | "us-west-2": endpoint{}, | ||
1010 | }, | ||
1011 | }, | ||
1012 | "kinesis": service{ | ||
1013 | |||
1014 | Endpoints: endpoints{ | ||
1015 | "ap-northeast-1": endpoint{}, | ||
1016 | "ap-northeast-2": endpoint{}, | ||
1017 | "ap-south-1": endpoint{}, | ||
1018 | "ap-southeast-1": endpoint{}, | ||
1019 | "ap-southeast-2": endpoint{}, | ||
1020 | "ca-central-1": endpoint{}, | ||
1021 | "eu-central-1": endpoint{}, | ||
1022 | "eu-west-1": endpoint{}, | ||
1023 | "eu-west-2": endpoint{}, | ||
1024 | "sa-east-1": endpoint{}, | ||
1025 | "us-east-1": endpoint{}, | ||
1026 | "us-east-2": endpoint{}, | ||
1027 | "us-west-1": endpoint{}, | ||
1028 | "us-west-2": endpoint{}, | ||
1029 | }, | ||
1030 | }, | ||
1031 | "kinesisanalytics": service{ | ||
1032 | |||
1033 | Endpoints: endpoints{ | ||
1034 | "eu-west-1": endpoint{}, | ||
1035 | "us-east-1": endpoint{}, | ||
1036 | "us-west-2": endpoint{}, | ||
1037 | }, | ||
1038 | }, | ||
1039 | "kms": service{ | ||
1040 | |||
1041 | Endpoints: endpoints{ | ||
1042 | "ap-northeast-1": endpoint{}, | ||
1043 | "ap-northeast-2": endpoint{}, | ||
1044 | "ap-south-1": endpoint{}, | ||
1045 | "ap-southeast-1": endpoint{}, | ||
1046 | "ap-southeast-2": endpoint{}, | ||
1047 | "ca-central-1": endpoint{}, | ||
1048 | "eu-central-1": endpoint{}, | ||
1049 | "eu-west-1": endpoint{}, | ||
1050 | "eu-west-2": endpoint{}, | ||
1051 | "sa-east-1": endpoint{}, | ||
1052 | "us-east-1": endpoint{}, | ||
1053 | "us-east-2": endpoint{}, | ||
1054 | "us-west-1": endpoint{}, | ||
1055 | "us-west-2": endpoint{}, | ||
1056 | }, | ||
1057 | }, | ||
1058 | "lambda": service{ | ||
1059 | |||
1060 | Endpoints: endpoints{ | ||
1061 | "ap-northeast-1": endpoint{}, | ||
1062 | "ap-northeast-2": endpoint{}, | ||
1063 | "ap-south-1": endpoint{}, | ||
1064 | "ap-southeast-1": endpoint{}, | ||
1065 | "ap-southeast-2": endpoint{}, | ||
1066 | "eu-central-1": endpoint{}, | ||
1067 | "eu-west-1": endpoint{}, | ||
1068 | "eu-west-2": endpoint{}, | ||
1069 | "us-east-1": endpoint{}, | ||
1070 | "us-east-2": endpoint{}, | ||
1071 | "us-west-1": endpoint{}, | ||
1072 | "us-west-2": endpoint{}, | ||
1073 | }, | ||
1074 | }, | ||
1075 | "lightsail": service{ | ||
1076 | |||
1077 | Endpoints: endpoints{ | ||
1078 | "us-east-1": endpoint{}, | ||
1079 | }, | ||
1080 | }, | ||
1081 | "logs": service{ | ||
1082 | |||
1083 | Endpoints: endpoints{ | ||
1084 | "ap-northeast-1": endpoint{}, | ||
1085 | "ap-northeast-2": endpoint{}, | ||
1086 | "ap-south-1": endpoint{}, | ||
1087 | "ap-southeast-1": endpoint{}, | ||
1088 | "ap-southeast-2": endpoint{}, | ||
1089 | "ca-central-1": endpoint{}, | ||
1090 | "eu-central-1": endpoint{}, | ||
1091 | "eu-west-1": endpoint{}, | ||
1092 | "eu-west-2": endpoint{}, | ||
1093 | "sa-east-1": endpoint{}, | ||
1094 | "us-east-1": endpoint{}, | ||
1095 | "us-east-2": endpoint{}, | ||
1096 | "us-west-1": endpoint{}, | ||
1097 | "us-west-2": endpoint{}, | ||
1098 | }, | ||
1099 | }, | ||
1100 | "machinelearning": service{ | ||
1101 | |||
1102 | Endpoints: endpoints{ | ||
1103 | "eu-west-1": endpoint{}, | ||
1104 | "us-east-1": endpoint{}, | ||
1105 | }, | ||
1106 | }, | ||
1107 | "marketplacecommerceanalytics": service{ | ||
1108 | |||
1109 | Endpoints: endpoints{ | ||
1110 | "us-east-1": endpoint{}, | ||
1111 | }, | ||
1112 | }, | ||
1113 | "metering.marketplace": service{ | ||
1114 | Defaults: endpoint{ | ||
1115 | CredentialScope: credentialScope{ | ||
1116 | Service: "aws-marketplace", | ||
1117 | }, | ||
1118 | }, | ||
1119 | Endpoints: endpoints{ | ||
1120 | "ap-northeast-1": endpoint{}, | ||
1121 | "ap-northeast-2": endpoint{}, | ||
1122 | "ap-south-1": endpoint{}, | ||
1123 | "ap-southeast-1": endpoint{}, | ||
1124 | "ap-southeast-2": endpoint{}, | ||
1125 | "ca-central-1": endpoint{}, | ||
1126 | "eu-central-1": endpoint{}, | ||
1127 | "eu-west-1": endpoint{}, | ||
1128 | "eu-west-2": endpoint{}, | ||
1129 | "sa-east-1": endpoint{}, | ||
1130 | "us-east-1": endpoint{}, | ||
1131 | "us-east-2": endpoint{}, | ||
1132 | "us-west-1": endpoint{}, | ||
1133 | "us-west-2": endpoint{}, | ||
1134 | }, | ||
1135 | }, | ||
1136 | "mobileanalytics": service{ | ||
1137 | |||
1138 | Endpoints: endpoints{ | ||
1139 | "us-east-1": endpoint{}, | ||
1140 | }, | ||
1141 | }, | ||
1142 | "models.lex": service{ | ||
1143 | Defaults: endpoint{ | ||
1144 | CredentialScope: credentialScope{ | ||
1145 | Service: "lex", | ||
1146 | }, | ||
1147 | }, | ||
1148 | Endpoints: endpoints{ | ||
1149 | "us-east-1": endpoint{}, | ||
1150 | }, | ||
1151 | }, | ||
1152 | "monitoring": service{ | ||
1153 | Defaults: endpoint{ | ||
1154 | Protocols: []string{"http", "https"}, | ||
1155 | }, | ||
1156 | Endpoints: endpoints{ | ||
1157 | "ap-northeast-1": endpoint{}, | ||
1158 | "ap-northeast-2": endpoint{}, | ||
1159 | "ap-south-1": endpoint{}, | ||
1160 | "ap-southeast-1": endpoint{}, | ||
1161 | "ap-southeast-2": endpoint{}, | ||
1162 | "ca-central-1": endpoint{}, | ||
1163 | "eu-central-1": endpoint{}, | ||
1164 | "eu-west-1": endpoint{}, | ||
1165 | "eu-west-2": endpoint{}, | ||
1166 | "sa-east-1": endpoint{}, | ||
1167 | "us-east-1": endpoint{}, | ||
1168 | "us-east-2": endpoint{}, | ||
1169 | "us-west-1": endpoint{}, | ||
1170 | "us-west-2": endpoint{}, | ||
1171 | }, | ||
1172 | }, | ||
1173 | "mturk-requester": service{ | ||
1174 | IsRegionalized: boxedFalse, | ||
1175 | |||
1176 | Endpoints: endpoints{ | ||
1177 | "sandbox": endpoint{ | ||
1178 | Hostname: "mturk-requester-sandbox.us-east-1.amazonaws.com", | ||
1179 | }, | ||
1180 | "us-east-1": endpoint{}, | ||
1181 | }, | ||
1182 | }, | ||
1183 | "opsworks": service{ | ||
1184 | |||
1185 | Endpoints: endpoints{ | ||
1186 | "ap-northeast-1": endpoint{}, | ||
1187 | "ap-northeast-2": endpoint{}, | ||
1188 | "ap-south-1": endpoint{}, | ||
1189 | "ap-southeast-1": endpoint{}, | ||
1190 | "ap-southeast-2": endpoint{}, | ||
1191 | "eu-central-1": endpoint{}, | ||
1192 | "eu-west-1": endpoint{}, | ||
1193 | "eu-west-2": endpoint{}, | ||
1194 | "sa-east-1": endpoint{}, | ||
1195 | "us-east-1": endpoint{}, | ||
1196 | "us-east-2": endpoint{}, | ||
1197 | "us-west-1": endpoint{}, | ||
1198 | "us-west-2": endpoint{}, | ||
1199 | }, | ||
1200 | }, | ||
1201 | "opsworks-cm": service{ | ||
1202 | |||
1203 | Endpoints: endpoints{ | ||
1204 | "eu-west-1": endpoint{}, | ||
1205 | "us-east-1": endpoint{}, | ||
1206 | "us-west-2": endpoint{}, | ||
1207 | }, | ||
1208 | }, | ||
1209 | "organizations": service{ | ||
1210 | PartitionEndpoint: "aws-global", | ||
1211 | IsRegionalized: boxedFalse, | ||
1212 | |||
1213 | Endpoints: endpoints{ | ||
1214 | "aws-global": endpoint{ | ||
1215 | Hostname: "organizations.us-east-1.amazonaws.com", | ||
1216 | CredentialScope: credentialScope{ | ||
1217 | Region: "us-east-1", | ||
1218 | }, | ||
1219 | }, | ||
1220 | }, | ||
1221 | }, | ||
1222 | "pinpoint": service{ | ||
1223 | Defaults: endpoint{ | ||
1224 | CredentialScope: credentialScope{ | ||
1225 | Service: "mobiletargeting", | ||
1226 | }, | ||
1227 | }, | ||
1228 | Endpoints: endpoints{ | ||
1229 | "us-east-1": endpoint{}, | ||
1230 | }, | ||
1231 | }, | ||
1232 | "polly": service{ | ||
1233 | |||
1234 | Endpoints: endpoints{ | ||
1235 | "eu-west-1": endpoint{}, | ||
1236 | "us-east-1": endpoint{}, | ||
1237 | "us-east-2": endpoint{}, | ||
1238 | "us-west-2": endpoint{}, | ||
1239 | }, | ||
1240 | }, | ||
1241 | "rds": service{ | ||
1242 | |||
1243 | Endpoints: endpoints{ | ||
1244 | "ap-northeast-1": endpoint{}, | ||
1245 | "ap-northeast-2": endpoint{}, | ||
1246 | "ap-south-1": endpoint{}, | ||
1247 | "ap-southeast-1": endpoint{}, | ||
1248 | "ap-southeast-2": endpoint{}, | ||
1249 | "ca-central-1": endpoint{}, | ||
1250 | "eu-central-1": endpoint{}, | ||
1251 | "eu-west-1": endpoint{}, | ||
1252 | "eu-west-2": endpoint{}, | ||
1253 | "sa-east-1": endpoint{}, | ||
1254 | "us-east-1": endpoint{ | ||
1255 | SSLCommonName: "{service}.{dnsSuffix}", | ||
1256 | }, | ||
1257 | "us-east-2": endpoint{}, | ||
1258 | "us-west-1": endpoint{}, | ||
1259 | "us-west-2": endpoint{}, | ||
1260 | }, | ||
1261 | }, | ||
1262 | "redshift": service{ | ||
1263 | |||
1264 | Endpoints: endpoints{ | ||
1265 | "ap-northeast-1": endpoint{}, | ||
1266 | "ap-northeast-2": endpoint{}, | ||
1267 | "ap-south-1": endpoint{}, | ||
1268 | "ap-southeast-1": endpoint{}, | ||
1269 | "ap-southeast-2": endpoint{}, | ||
1270 | "ca-central-1": endpoint{}, | ||
1271 | "eu-central-1": endpoint{}, | ||
1272 | "eu-west-1": endpoint{}, | ||
1273 | "eu-west-2": endpoint{}, | ||
1274 | "sa-east-1": endpoint{}, | ||
1275 | "us-east-1": endpoint{}, | ||
1276 | "us-east-2": endpoint{}, | ||
1277 | "us-west-1": endpoint{}, | ||
1278 | "us-west-2": endpoint{}, | ||
1279 | }, | ||
1280 | }, | ||
1281 | "rekognition": service{ | ||
1282 | |||
1283 | Endpoints: endpoints{ | ||
1284 | "eu-west-1": endpoint{}, | ||
1285 | "us-east-1": endpoint{}, | ||
1286 | "us-west-2": endpoint{}, | ||
1287 | }, | ||
1288 | }, | ||
1289 | "route53": service{ | ||
1290 | PartitionEndpoint: "aws-global", | ||
1291 | IsRegionalized: boxedFalse, | ||
1292 | |||
1293 | Endpoints: endpoints{ | ||
1294 | "aws-global": endpoint{ | ||
1295 | Hostname: "route53.amazonaws.com", | ||
1296 | CredentialScope: credentialScope{ | ||
1297 | Region: "us-east-1", | ||
1298 | }, | ||
1299 | }, | ||
1300 | }, | ||
1301 | }, | ||
1302 | "route53domains": service{ | ||
1303 | |||
1304 | Endpoints: endpoints{ | ||
1305 | "us-east-1": endpoint{}, | ||
1306 | }, | ||
1307 | }, | ||
1308 | "runtime.lex": service{ | ||
1309 | Defaults: endpoint{ | ||
1310 | CredentialScope: credentialScope{ | ||
1311 | Service: "lex", | ||
1312 | }, | ||
1313 | }, | ||
1314 | Endpoints: endpoints{ | ||
1315 | "us-east-1": endpoint{}, | ||
1316 | }, | ||
1317 | }, | ||
1318 | "s3": service{ | ||
1319 | PartitionEndpoint: "us-east-1", | ||
1320 | IsRegionalized: boxedTrue, | ||
1321 | Defaults: endpoint{ | ||
1322 | Protocols: []string{"http", "https"}, | ||
1323 | SignatureVersions: []string{"s3v4"}, | ||
1324 | |||
1325 | HasDualStack: boxedTrue, | ||
1326 | DualStackHostname: "{service}.dualstack.{region}.{dnsSuffix}", | ||
1327 | }, | ||
1328 | Endpoints: endpoints{ | ||
1329 | "ap-northeast-1": endpoint{ | ||
1330 | Hostname: "s3-ap-northeast-1.amazonaws.com", | ||
1331 | SignatureVersions: []string{"s3", "s3v4"}, | ||
1332 | }, | ||
1333 | "ap-northeast-2": endpoint{}, | ||
1334 | "ap-south-1": endpoint{}, | ||
1335 | "ap-southeast-1": endpoint{ | ||
1336 | Hostname: "s3-ap-southeast-1.amazonaws.com", | ||
1337 | SignatureVersions: []string{"s3", "s3v4"}, | ||
1338 | }, | ||
1339 | "ap-southeast-2": endpoint{ | ||
1340 | Hostname: "s3-ap-southeast-2.amazonaws.com", | ||
1341 | SignatureVersions: []string{"s3", "s3v4"}, | ||
1342 | }, | ||
1343 | "ca-central-1": endpoint{}, | ||
1344 | "eu-central-1": endpoint{}, | ||
1345 | "eu-west-1": endpoint{ | ||
1346 | Hostname: "s3-eu-west-1.amazonaws.com", | ||
1347 | SignatureVersions: []string{"s3", "s3v4"}, | ||
1348 | }, | ||
1349 | "eu-west-2": endpoint{}, | ||
1350 | "s3-external-1": endpoint{ | ||
1351 | Hostname: "s3-external-1.amazonaws.com", | ||
1352 | SignatureVersions: []string{"s3", "s3v4"}, | ||
1353 | CredentialScope: credentialScope{ | ||
1354 | Region: "us-east-1", | ||
1355 | }, | ||
1356 | }, | ||
1357 | "sa-east-1": endpoint{ | ||
1358 | Hostname: "s3-sa-east-1.amazonaws.com", | ||
1359 | SignatureVersions: []string{"s3", "s3v4"}, | ||
1360 | }, | ||
1361 | "us-east-1": endpoint{ | ||
1362 | Hostname: "s3.amazonaws.com", | ||
1363 | SignatureVersions: []string{"s3", "s3v4"}, | ||
1364 | }, | ||
1365 | "us-east-2": endpoint{}, | ||
1366 | "us-west-1": endpoint{ | ||
1367 | Hostname: "s3-us-west-1.amazonaws.com", | ||
1368 | SignatureVersions: []string{"s3", "s3v4"}, | ||
1369 | }, | ||
1370 | "us-west-2": endpoint{ | ||
1371 | Hostname: "s3-us-west-2.amazonaws.com", | ||
1372 | SignatureVersions: []string{"s3", "s3v4"}, | ||
1373 | }, | ||
1374 | }, | ||
1375 | }, | ||
1376 | "sdb": service{ | ||
1377 | Defaults: endpoint{ | ||
1378 | Protocols: []string{"http", "https"}, | ||
1379 | SignatureVersions: []string{"v2"}, | ||
1380 | }, | ||
1381 | Endpoints: endpoints{ | ||
1382 | "ap-northeast-1": endpoint{}, | ||
1383 | "ap-southeast-1": endpoint{}, | ||
1384 | "ap-southeast-2": endpoint{}, | ||
1385 | "eu-west-1": endpoint{}, | ||
1386 | "sa-east-1": endpoint{}, | ||
1387 | "us-east-1": endpoint{ | ||
1388 | Hostname: "sdb.amazonaws.com", | ||
1389 | }, | ||
1390 | "us-west-1": endpoint{}, | ||
1391 | "us-west-2": endpoint{}, | ||
1392 | }, | ||
1393 | }, | ||
1394 | "servicecatalog": service{ | ||
1395 | |||
1396 | Endpoints: endpoints{ | ||
1397 | "ap-northeast-1": endpoint{}, | ||
1398 | "ap-southeast-1": endpoint{}, | ||
1399 | "ap-southeast-2": endpoint{}, | ||
1400 | "ca-central-1": endpoint{}, | ||
1401 | "eu-central-1": endpoint{}, | ||
1402 | "eu-west-1": endpoint{}, | ||
1403 | "eu-west-2": endpoint{}, | ||
1404 | "us-east-1": endpoint{}, | ||
1405 | "us-east-2": endpoint{}, | ||
1406 | "us-west-2": endpoint{}, | ||
1407 | }, | ||
1408 | }, | ||
1409 | "shield": service{ | ||
1410 | IsRegionalized: boxedFalse, | ||
1411 | Defaults: endpoint{ | ||
1412 | SSLCommonName: "Shield.us-east-1.amazonaws.com", | ||
1413 | Protocols: []string{"https"}, | ||
1414 | }, | ||
1415 | Endpoints: endpoints{ | ||
1416 | "us-east-1": endpoint{}, | ||
1417 | }, | ||
1418 | }, | ||
1419 | "sms": service{ | ||
1420 | |||
1421 | Endpoints: endpoints{ | ||
1422 | "ap-southeast-2": endpoint{}, | ||
1423 | "eu-west-1": endpoint{}, | ||
1424 | "us-east-1": endpoint{}, | ||
1425 | }, | ||
1426 | }, | ||
1427 | "snowball": service{ | ||
1428 | |||
1429 | Endpoints: endpoints{ | ||
1430 | "ap-south-1": endpoint{}, | ||
1431 | "ap-southeast-2": endpoint{}, | ||
1432 | "eu-central-1": endpoint{}, | ||
1433 | "eu-west-1": endpoint{}, | ||
1434 | "eu-west-2": endpoint{}, | ||
1435 | "us-east-1": endpoint{}, | ||
1436 | "us-east-2": endpoint{}, | ||
1437 | "us-west-1": endpoint{}, | ||
1438 | "us-west-2": endpoint{}, | ||
1439 | }, | ||
1440 | }, | ||
1441 | "sns": service{ | ||
1442 | Defaults: endpoint{ | ||
1443 | Protocols: []string{"http", "https"}, | ||
1444 | }, | ||
1445 | Endpoints: endpoints{ | ||
1446 | "ap-northeast-1": endpoint{}, | ||
1447 | "ap-northeast-2": endpoint{}, | ||
1448 | "ap-south-1": endpoint{}, | ||
1449 | "ap-southeast-1": endpoint{}, | ||
1450 | "ap-southeast-2": endpoint{}, | ||
1451 | "ca-central-1": endpoint{}, | ||
1452 | "eu-central-1": endpoint{}, | ||
1453 | "eu-west-1": endpoint{}, | ||
1454 | "eu-west-2": endpoint{}, | ||
1455 | "sa-east-1": endpoint{}, | ||
1456 | "us-east-1": endpoint{}, | ||
1457 | "us-east-2": endpoint{}, | ||
1458 | "us-west-1": endpoint{}, | ||
1459 | "us-west-2": endpoint{}, | ||
1460 | }, | ||
1461 | }, | ||
1462 | "sqs": service{ | ||
1463 | Defaults: endpoint{ | ||
1464 | SSLCommonName: "{region}.queue.{dnsSuffix}", | ||
1465 | Protocols: []string{"http", "https"}, | ||
1466 | }, | ||
1467 | Endpoints: endpoints{ | ||
1468 | "ap-northeast-1": endpoint{}, | ||
1469 | "ap-northeast-2": endpoint{}, | ||
1470 | "ap-south-1": endpoint{}, | ||
1471 | "ap-southeast-1": endpoint{}, | ||
1472 | "ap-southeast-2": endpoint{}, | ||
1473 | "ca-central-1": endpoint{}, | ||
1474 | "eu-central-1": endpoint{}, | ||
1475 | "eu-west-1": endpoint{}, | ||
1476 | "eu-west-2": endpoint{}, | ||
1477 | "sa-east-1": endpoint{}, | ||
1478 | "us-east-1": endpoint{ | ||
1479 | SSLCommonName: "queue.{dnsSuffix}", | ||
1480 | }, | ||
1481 | "us-east-2": endpoint{}, | ||
1482 | "us-west-1": endpoint{}, | ||
1483 | "us-west-2": endpoint{}, | ||
1484 | }, | ||
1485 | }, | ||
1486 | "ssm": service{ | ||
1487 | |||
1488 | Endpoints: endpoints{ | ||
1489 | "ap-northeast-1": endpoint{}, | ||
1490 | "ap-northeast-2": endpoint{}, | ||
1491 | "ap-southeast-1": endpoint{}, | ||
1492 | "ap-southeast-2": endpoint{}, | ||
1493 | "eu-central-1": endpoint{}, | ||
1494 | "eu-west-1": endpoint{}, | ||
1495 | "sa-east-1": endpoint{}, | ||
1496 | "us-east-1": endpoint{}, | ||
1497 | "us-east-2": endpoint{}, | ||
1498 | "us-west-1": endpoint{}, | ||
1499 | "us-west-2": endpoint{}, | ||
1500 | }, | ||
1501 | }, | ||
1502 | "states": service{ | ||
1503 | |||
1504 | Endpoints: endpoints{ | ||
1505 | "ap-northeast-1": endpoint{}, | ||
1506 | "eu-central-1": endpoint{}, | ||
1507 | "eu-west-1": endpoint{}, | ||
1508 | "us-east-1": endpoint{}, | ||
1509 | "us-east-2": endpoint{}, | ||
1510 | "us-west-2": endpoint{}, | ||
1511 | }, | ||
1512 | }, | ||
1513 | "storagegateway": service{ | ||
1514 | |||
1515 | Endpoints: endpoints{ | ||
1516 | "ap-northeast-1": endpoint{}, | ||
1517 | "ap-northeast-2": endpoint{}, | ||
1518 | "ap-south-1": endpoint{}, | ||
1519 | "ap-southeast-1": endpoint{}, | ||
1520 | "ap-southeast-2": endpoint{}, | ||
1521 | "ca-central-1": endpoint{}, | ||
1522 | "eu-central-1": endpoint{}, | ||
1523 | "eu-west-1": endpoint{}, | ||
1524 | "eu-west-2": endpoint{}, | ||
1525 | "sa-east-1": endpoint{}, | ||
1526 | "us-east-1": endpoint{}, | ||
1527 | "us-east-2": endpoint{}, | ||
1528 | "us-west-1": endpoint{}, | ||
1529 | "us-west-2": endpoint{}, | ||
1530 | }, | ||
1531 | }, | ||
1532 | "streams.dynamodb": service{ | ||
1533 | Defaults: endpoint{ | ||
1534 | Protocols: []string{"http", "http", "https", "https"}, | ||
1535 | CredentialScope: credentialScope{ | ||
1536 | Service: "dynamodb", | ||
1537 | }, | ||
1538 | }, | ||
1539 | Endpoints: endpoints{ | ||
1540 | "ap-northeast-1": endpoint{}, | ||
1541 | "ap-northeast-2": endpoint{}, | ||
1542 | "ap-south-1": endpoint{}, | ||
1543 | "ap-southeast-1": endpoint{}, | ||
1544 | "ap-southeast-2": endpoint{}, | ||
1545 | "ca-central-1": endpoint{}, | ||
1546 | "eu-central-1": endpoint{}, | ||
1547 | "eu-west-1": endpoint{}, | ||
1548 | "eu-west-2": endpoint{}, | ||
1549 | "local": endpoint{ | ||
1550 | Hostname: "localhost:8000", | ||
1551 | Protocols: []string{"http"}, | ||
1552 | CredentialScope: credentialScope{ | ||
1553 | Region: "us-east-1", | ||
1554 | }, | ||
1555 | }, | ||
1556 | "sa-east-1": endpoint{}, | ||
1557 | "us-east-1": endpoint{}, | ||
1558 | "us-east-2": endpoint{}, | ||
1559 | "us-west-1": endpoint{}, | ||
1560 | "us-west-2": endpoint{}, | ||
1561 | }, | ||
1562 | }, | ||
1563 | "sts": service{ | ||
1564 | PartitionEndpoint: "aws-global", | ||
1565 | Defaults: endpoint{ | ||
1566 | Hostname: "sts.amazonaws.com", | ||
1567 | CredentialScope: credentialScope{ | ||
1568 | Region: "us-east-1", | ||
1569 | }, | ||
1570 | }, | ||
1571 | Endpoints: endpoints{ | ||
1572 | "ap-northeast-1": endpoint{}, | ||
1573 | "ap-northeast-2": endpoint{ | ||
1574 | Hostname: "sts.ap-northeast-2.amazonaws.com", | ||
1575 | CredentialScope: credentialScope{ | ||
1576 | Region: "ap-northeast-2", | ||
1577 | }, | ||
1578 | }, | ||
1579 | "ap-south-1": endpoint{}, | ||
1580 | "ap-southeast-1": endpoint{}, | ||
1581 | "ap-southeast-2": endpoint{}, | ||
1582 | "aws-global": endpoint{}, | ||
1583 | "ca-central-1": endpoint{}, | ||
1584 | "eu-central-1": endpoint{}, | ||
1585 | "eu-west-1": endpoint{}, | ||
1586 | "eu-west-2": endpoint{}, | ||
1587 | "sa-east-1": endpoint{}, | ||
1588 | "us-east-1": endpoint{}, | ||
1589 | "us-east-2": endpoint{}, | ||
1590 | "us-west-1": endpoint{}, | ||
1591 | "us-west-2": endpoint{}, | ||
1592 | }, | ||
1593 | }, | ||
1594 | "support": service{ | ||
1595 | |||
1596 | Endpoints: endpoints{ | ||
1597 | "us-east-1": endpoint{}, | ||
1598 | }, | ||
1599 | }, | ||
1600 | "swf": service{ | ||
1601 | |||
1602 | Endpoints: endpoints{ | ||
1603 | "ap-northeast-1": endpoint{}, | ||
1604 | "ap-northeast-2": endpoint{}, | ||
1605 | "ap-south-1": endpoint{}, | ||
1606 | "ap-southeast-1": endpoint{}, | ||
1607 | "ap-southeast-2": endpoint{}, | ||
1608 | "ca-central-1": endpoint{}, | ||
1609 | "eu-central-1": endpoint{}, | ||
1610 | "eu-west-1": endpoint{}, | ||
1611 | "eu-west-2": endpoint{}, | ||
1612 | "sa-east-1": endpoint{}, | ||
1613 | "us-east-1": endpoint{}, | ||
1614 | "us-east-2": endpoint{}, | ||
1615 | "us-west-1": endpoint{}, | ||
1616 | "us-west-2": endpoint{}, | ||
1617 | }, | ||
1618 | }, | ||
1619 | "tagging": service{ | ||
1620 | |||
1621 | Endpoints: endpoints{ | ||
1622 | "ap-northeast-1": endpoint{}, | ||
1623 | "ap-northeast-2": endpoint{}, | ||
1624 | "ap-south-1": endpoint{}, | ||
1625 | "ap-southeast-1": endpoint{}, | ||
1626 | "ap-southeast-2": endpoint{}, | ||
1627 | "ca-central-1": endpoint{}, | ||
1628 | "eu-central-1": endpoint{}, | ||
1629 | "eu-west-1": endpoint{}, | ||
1630 | "eu-west-2": endpoint{}, | ||
1631 | "sa-east-1": endpoint{}, | ||
1632 | "us-east-1": endpoint{}, | ||
1633 | "us-east-2": endpoint{}, | ||
1634 | "us-west-1": endpoint{}, | ||
1635 | "us-west-2": endpoint{}, | ||
1636 | }, | ||
1637 | }, | ||
1638 | "waf": service{ | ||
1639 | PartitionEndpoint: "aws-global", | ||
1640 | IsRegionalized: boxedFalse, | ||
1641 | |||
1642 | Endpoints: endpoints{ | ||
1643 | "aws-global": endpoint{ | ||
1644 | Hostname: "waf.amazonaws.com", | ||
1645 | CredentialScope: credentialScope{ | ||
1646 | Region: "us-east-1", | ||
1647 | }, | ||
1648 | }, | ||
1649 | }, | ||
1650 | }, | ||
1651 | "waf-regional": service{ | ||
1652 | |||
1653 | Endpoints: endpoints{ | ||
1654 | "ap-northeast-1": endpoint{}, | ||
1655 | "eu-west-1": endpoint{}, | ||
1656 | "us-east-1": endpoint{}, | ||
1657 | "us-west-2": endpoint{}, | ||
1658 | }, | ||
1659 | }, | ||
1660 | "workdocs": service{ | ||
1661 | |||
1662 | Endpoints: endpoints{ | ||
1663 | "ap-northeast-1": endpoint{}, | ||
1664 | "ap-southeast-1": endpoint{}, | ||
1665 | "ap-southeast-2": endpoint{}, | ||
1666 | "eu-west-1": endpoint{}, | ||
1667 | "us-east-1": endpoint{}, | ||
1668 | "us-west-2": endpoint{}, | ||
1669 | }, | ||
1670 | }, | ||
1671 | "workspaces": service{ | ||
1672 | |||
1673 | Endpoints: endpoints{ | ||
1674 | "ap-northeast-1": endpoint{}, | ||
1675 | "ap-southeast-1": endpoint{}, | ||
1676 | "ap-southeast-2": endpoint{}, | ||
1677 | "eu-central-1": endpoint{}, | ||
1678 | "eu-west-1": endpoint{}, | ||
1679 | "us-east-1": endpoint{}, | ||
1680 | "us-west-2": endpoint{}, | ||
1681 | }, | ||
1682 | }, | ||
1683 | "xray": service{ | ||
1684 | |||
1685 | Endpoints: endpoints{ | ||
1686 | "ap-northeast-1": endpoint{}, | ||
1687 | "ap-northeast-2": endpoint{}, | ||
1688 | "ap-south-1": endpoint{}, | ||
1689 | "ap-southeast-1": endpoint{}, | ||
1690 | "ap-southeast-2": endpoint{}, | ||
1691 | "eu-central-1": endpoint{}, | ||
1692 | "eu-west-1": endpoint{}, | ||
1693 | "sa-east-1": endpoint{}, | ||
1694 | "us-east-1": endpoint{}, | ||
1695 | "us-east-2": endpoint{}, | ||
1696 | "us-west-1": endpoint{}, | ||
1697 | "us-west-2": endpoint{}, | ||
1698 | }, | ||
1699 | }, | ||
1700 | }, | ||
1701 | } | ||
1702 | |||
1703 | // AwsCnPartition returns the Resolver for AWS China. | ||
1704 | func AwsCnPartition() Partition { | ||
1705 | return awscnPartition.Partition() | ||
1706 | } | ||
1707 | |||
1708 | var awscnPartition = partition{ | ||
1709 | ID: "aws-cn", | ||
1710 | Name: "AWS China", | ||
1711 | DNSSuffix: "amazonaws.com.cn", | ||
1712 | RegionRegex: regionRegex{ | ||
1713 | Regexp: func() *regexp.Regexp { | ||
1714 | reg, _ := regexp.Compile("^cn\\-\\w+\\-\\d+$") | ||
1715 | return reg | ||
1716 | }(), | ||
1717 | }, | ||
1718 | Defaults: endpoint{ | ||
1719 | Hostname: "{service}.{region}.{dnsSuffix}", | ||
1720 | Protocols: []string{"https"}, | ||
1721 | SignatureVersions: []string{"v4"}, | ||
1722 | }, | ||
1723 | Regions: regions{ | ||
1724 | "cn-north-1": region{ | ||
1725 | Description: "China (Beijing)", | ||
1726 | }, | ||
1727 | }, | ||
1728 | Services: services{ | ||
1729 | "autoscaling": service{ | ||
1730 | Defaults: endpoint{ | ||
1731 | Protocols: []string{"http", "https"}, | ||
1732 | }, | ||
1733 | Endpoints: endpoints{ | ||
1734 | "cn-north-1": endpoint{}, | ||
1735 | }, | ||
1736 | }, | ||
1737 | "cloudformation": service{ | ||
1738 | |||
1739 | Endpoints: endpoints{ | ||
1740 | "cn-north-1": endpoint{}, | ||
1741 | }, | ||
1742 | }, | ||
1743 | "cloudtrail": service{ | ||
1744 | |||
1745 | Endpoints: endpoints{ | ||
1746 | "cn-north-1": endpoint{}, | ||
1747 | }, | ||
1748 | }, | ||
1749 | "codedeploy": service{ | ||
1750 | |||
1751 | Endpoints: endpoints{ | ||
1752 | "cn-north-1": endpoint{}, | ||
1753 | }, | ||
1754 | }, | ||
1755 | "config": service{ | ||
1756 | |||
1757 | Endpoints: endpoints{ | ||
1758 | "cn-north-1": endpoint{}, | ||
1759 | }, | ||
1760 | }, | ||
1761 | "directconnect": service{ | ||
1762 | |||
1763 | Endpoints: endpoints{ | ||
1764 | "cn-north-1": endpoint{}, | ||
1765 | }, | ||
1766 | }, | ||
1767 | "dynamodb": service{ | ||
1768 | Defaults: endpoint{ | ||
1769 | Protocols: []string{"http", "https"}, | ||
1770 | }, | ||
1771 | Endpoints: endpoints{ | ||
1772 | "cn-north-1": endpoint{}, | ||
1773 | }, | ||
1774 | }, | ||
1775 | "ec2": service{ | ||
1776 | Defaults: endpoint{ | ||
1777 | Protocols: []string{"http", "https"}, | ||
1778 | }, | ||
1779 | Endpoints: endpoints{ | ||
1780 | "cn-north-1": endpoint{}, | ||
1781 | }, | ||
1782 | }, | ||
1783 | "ec2metadata": service{ | ||
1784 | PartitionEndpoint: "aws-global", | ||
1785 | IsRegionalized: boxedFalse, | ||
1786 | |||
1787 | Endpoints: endpoints{ | ||
1788 | "aws-global": endpoint{ | ||
1789 | Hostname: "169.254.169.254/latest", | ||
1790 | Protocols: []string{"http"}, | ||
1791 | }, | ||
1792 | }, | ||
1793 | }, | ||
1794 | "elasticache": service{ | ||
1795 | |||
1796 | Endpoints: endpoints{ | ||
1797 | "cn-north-1": endpoint{}, | ||
1798 | }, | ||
1799 | }, | ||
1800 | "elasticbeanstalk": service{ | ||
1801 | |||
1802 | Endpoints: endpoints{ | ||
1803 | "cn-north-1": endpoint{}, | ||
1804 | }, | ||
1805 | }, | ||
1806 | "elasticloadbalancing": service{ | ||
1807 | Defaults: endpoint{ | ||
1808 | Protocols: []string{"http", "https"}, | ||
1809 | }, | ||
1810 | Endpoints: endpoints{ | ||
1811 | "cn-north-1": endpoint{}, | ||
1812 | }, | ||
1813 | }, | ||
1814 | "elasticmapreduce": service{ | ||
1815 | Defaults: endpoint{ | ||
1816 | Protocols: []string{"http", "https"}, | ||
1817 | }, | ||
1818 | Endpoints: endpoints{ | ||
1819 | "cn-north-1": endpoint{}, | ||
1820 | }, | ||
1821 | }, | ||
1822 | "events": service{ | ||
1823 | |||
1824 | Endpoints: endpoints{ | ||
1825 | "cn-north-1": endpoint{}, | ||
1826 | }, | ||
1827 | }, | ||
1828 | "glacier": service{ | ||
1829 | Defaults: endpoint{ | ||
1830 | Protocols: []string{"http", "https"}, | ||
1831 | }, | ||
1832 | Endpoints: endpoints{ | ||
1833 | "cn-north-1": endpoint{}, | ||
1834 | }, | ||
1835 | }, | ||
1836 | "iam": service{ | ||
1837 | PartitionEndpoint: "aws-cn-global", | ||
1838 | IsRegionalized: boxedFalse, | ||
1839 | |||
1840 | Endpoints: endpoints{ | ||
1841 | "aws-cn-global": endpoint{ | ||
1842 | Hostname: "iam.cn-north-1.amazonaws.com.cn", | ||
1843 | CredentialScope: credentialScope{ | ||
1844 | Region: "cn-north-1", | ||
1845 | }, | ||
1846 | }, | ||
1847 | }, | ||
1848 | }, | ||
1849 | "kinesis": service{ | ||
1850 | |||
1851 | Endpoints: endpoints{ | ||
1852 | "cn-north-1": endpoint{}, | ||
1853 | }, | ||
1854 | }, | ||
1855 | "logs": service{ | ||
1856 | |||
1857 | Endpoints: endpoints{ | ||
1858 | "cn-north-1": endpoint{}, | ||
1859 | }, | ||
1860 | }, | ||
1861 | "monitoring": service{ | ||
1862 | Defaults: endpoint{ | ||
1863 | Protocols: []string{"http", "https"}, | ||
1864 | }, | ||
1865 | Endpoints: endpoints{ | ||
1866 | "cn-north-1": endpoint{}, | ||
1867 | }, | ||
1868 | }, | ||
1869 | "rds": service{ | ||
1870 | |||
1871 | Endpoints: endpoints{ | ||
1872 | "cn-north-1": endpoint{}, | ||
1873 | }, | ||
1874 | }, | ||
1875 | "redshift": service{ | ||
1876 | |||
1877 | Endpoints: endpoints{ | ||
1878 | "cn-north-1": endpoint{}, | ||
1879 | }, | ||
1880 | }, | ||
1881 | "s3": service{ | ||
1882 | Defaults: endpoint{ | ||
1883 | Protocols: []string{"http", "https"}, | ||
1884 | SignatureVersions: []string{"s3v4"}, | ||
1885 | }, | ||
1886 | Endpoints: endpoints{ | ||
1887 | "cn-north-1": endpoint{}, | ||
1888 | }, | ||
1889 | }, | ||
1890 | "sns": service{ | ||
1891 | Defaults: endpoint{ | ||
1892 | Protocols: []string{"http", "https"}, | ||
1893 | }, | ||
1894 | Endpoints: endpoints{ | ||
1895 | "cn-north-1": endpoint{}, | ||
1896 | }, | ||
1897 | }, | ||
1898 | "sqs": service{ | ||
1899 | Defaults: endpoint{ | ||
1900 | SSLCommonName: "{region}.queue.{dnsSuffix}", | ||
1901 | Protocols: []string{"http", "https"}, | ||
1902 | }, | ||
1903 | Endpoints: endpoints{ | ||
1904 | "cn-north-1": endpoint{}, | ||
1905 | }, | ||
1906 | }, | ||
1907 | "storagegateway": service{ | ||
1908 | |||
1909 | Endpoints: endpoints{ | ||
1910 | "cn-north-1": endpoint{}, | ||
1911 | }, | ||
1912 | }, | ||
1913 | "streams.dynamodb": service{ | ||
1914 | Defaults: endpoint{ | ||
1915 | Protocols: []string{"http", "http", "https", "https"}, | ||
1916 | CredentialScope: credentialScope{ | ||
1917 | Service: "dynamodb", | ||
1918 | }, | ||
1919 | }, | ||
1920 | Endpoints: endpoints{ | ||
1921 | "cn-north-1": endpoint{}, | ||
1922 | }, | ||
1923 | }, | ||
1924 | "sts": service{ | ||
1925 | |||
1926 | Endpoints: endpoints{ | ||
1927 | "cn-north-1": endpoint{}, | ||
1928 | }, | ||
1929 | }, | ||
1930 | "swf": service{ | ||
1931 | |||
1932 | Endpoints: endpoints{ | ||
1933 | "cn-north-1": endpoint{}, | ||
1934 | }, | ||
1935 | }, | ||
1936 | "tagging": service{ | ||
1937 | |||
1938 | Endpoints: endpoints{ | ||
1939 | "cn-north-1": endpoint{}, | ||
1940 | }, | ||
1941 | }, | ||
1942 | }, | ||
1943 | } | ||
1944 | |||
1945 | // AwsUsGovPartition returns the Resolver for AWS GovCloud (US). | ||
1946 | func AwsUsGovPartition() Partition { | ||
1947 | return awsusgovPartition.Partition() | ||
1948 | } | ||
1949 | |||
1950 | var awsusgovPartition = partition{ | ||
1951 | ID: "aws-us-gov", | ||
1952 | Name: "AWS GovCloud (US)", | ||
1953 | DNSSuffix: "amazonaws.com", | ||
1954 | RegionRegex: regionRegex{ | ||
1955 | Regexp: func() *regexp.Regexp { | ||
1956 | reg, _ := regexp.Compile("^us\\-gov\\-\\w+\\-\\d+$") | ||
1957 | return reg | ||
1958 | }(), | ||
1959 | }, | ||
1960 | Defaults: endpoint{ | ||
1961 | Hostname: "{service}.{region}.{dnsSuffix}", | ||
1962 | Protocols: []string{"https"}, | ||
1963 | SignatureVersions: []string{"v4"}, | ||
1964 | }, | ||
1965 | Regions: regions{ | ||
1966 | "us-gov-west-1": region{ | ||
1967 | Description: "AWS GovCloud (US)", | ||
1968 | }, | ||
1969 | }, | ||
1970 | Services: services{ | ||
1971 | "autoscaling": service{ | ||
1972 | |||
1973 | Endpoints: endpoints{ | ||
1974 | "us-gov-west-1": endpoint{ | ||
1975 | Protocols: []string{"http", "https"}, | ||
1976 | }, | ||
1977 | }, | ||
1978 | }, | ||
1979 | "cloudformation": service{ | ||
1980 | |||
1981 | Endpoints: endpoints{ | ||
1982 | "us-gov-west-1": endpoint{}, | ||
1983 | }, | ||
1984 | }, | ||
1985 | "cloudhsm": service{ | ||
1986 | |||
1987 | Endpoints: endpoints{ | ||
1988 | "us-gov-west-1": endpoint{}, | ||
1989 | }, | ||
1990 | }, | ||
1991 | "cloudtrail": service{ | ||
1992 | |||
1993 | Endpoints: endpoints{ | ||
1994 | "us-gov-west-1": endpoint{}, | ||
1995 | }, | ||
1996 | }, | ||
1997 | "config": service{ | ||
1998 | |||
1999 | Endpoints: endpoints{ | ||
2000 | "us-gov-west-1": endpoint{}, | ||
2001 | }, | ||
2002 | }, | ||
2003 | "directconnect": service{ | ||
2004 | |||
2005 | Endpoints: endpoints{ | ||
2006 | "us-gov-west-1": endpoint{}, | ||
2007 | }, | ||
2008 | }, | ||
2009 | "dynamodb": service{ | ||
2010 | |||
2011 | Endpoints: endpoints{ | ||
2012 | "us-gov-west-1": endpoint{}, | ||
2013 | }, | ||
2014 | }, | ||
2015 | "ec2": service{ | ||
2016 | |||
2017 | Endpoints: endpoints{ | ||
2018 | "us-gov-west-1": endpoint{}, | ||
2019 | }, | ||
2020 | }, | ||
2021 | "ec2metadata": service{ | ||
2022 | PartitionEndpoint: "aws-global", | ||
2023 | IsRegionalized: boxedFalse, | ||
2024 | |||
2025 | Endpoints: endpoints{ | ||
2026 | "aws-global": endpoint{ | ||
2027 | Hostname: "169.254.169.254/latest", | ||
2028 | Protocols: []string{"http"}, | ||
2029 | }, | ||
2030 | }, | ||
2031 | }, | ||
2032 | "elasticache": service{ | ||
2033 | |||
2034 | Endpoints: endpoints{ | ||
2035 | "us-gov-west-1": endpoint{}, | ||
2036 | }, | ||
2037 | }, | ||
2038 | "elasticloadbalancing": service{ | ||
2039 | |||
2040 | Endpoints: endpoints{ | ||
2041 | "us-gov-west-1": endpoint{ | ||
2042 | Protocols: []string{"http", "https"}, | ||
2043 | }, | ||
2044 | }, | ||
2045 | }, | ||
2046 | "elasticmapreduce": service{ | ||
2047 | |||
2048 | Endpoints: endpoints{ | ||
2049 | "us-gov-west-1": endpoint{ | ||
2050 | Protocols: []string{"http", "https"}, | ||
2051 | }, | ||
2052 | }, | ||
2053 | }, | ||
2054 | "glacier": service{ | ||
2055 | |||
2056 | Endpoints: endpoints{ | ||
2057 | "us-gov-west-1": endpoint{ | ||
2058 | Protocols: []string{"http", "https"}, | ||
2059 | }, | ||
2060 | }, | ||
2061 | }, | ||
2062 | "iam": service{ | ||
2063 | PartitionEndpoint: "aws-us-gov-global", | ||
2064 | IsRegionalized: boxedFalse, | ||
2065 | |||
2066 | Endpoints: endpoints{ | ||
2067 | "aws-us-gov-global": endpoint{ | ||
2068 | Hostname: "iam.us-gov.amazonaws.com", | ||
2069 | CredentialScope: credentialScope{ | ||
2070 | Region: "us-gov-west-1", | ||
2071 | }, | ||
2072 | }, | ||
2073 | }, | ||
2074 | }, | ||
2075 | "kinesis": service{ | ||
2076 | |||
2077 | Endpoints: endpoints{ | ||
2078 | "us-gov-west-1": endpoint{}, | ||
2079 | }, | ||
2080 | }, | ||
2081 | "kms": service{ | ||
2082 | |||
2083 | Endpoints: endpoints{ | ||
2084 | "us-gov-west-1": endpoint{}, | ||
2085 | }, | ||
2086 | }, | ||
2087 | "logs": service{ | ||
2088 | |||
2089 | Endpoints: endpoints{ | ||
2090 | "us-gov-west-1": endpoint{}, | ||
2091 | }, | ||
2092 | }, | ||
2093 | "monitoring": service{ | ||
2094 | |||
2095 | Endpoints: endpoints{ | ||
2096 | "us-gov-west-1": endpoint{}, | ||
2097 | }, | ||
2098 | }, | ||
2099 | "rds": service{ | ||
2100 | |||
2101 | Endpoints: endpoints{ | ||
2102 | "us-gov-west-1": endpoint{}, | ||
2103 | }, | ||
2104 | }, | ||
2105 | "redshift": service{ | ||
2106 | |||
2107 | Endpoints: endpoints{ | ||
2108 | "us-gov-west-1": endpoint{}, | ||
2109 | }, | ||
2110 | }, | ||
2111 | "s3": service{ | ||
2112 | Defaults: endpoint{ | ||
2113 | SignatureVersions: []string{"s3", "s3v4"}, | ||
2114 | }, | ||
2115 | Endpoints: endpoints{ | ||
2116 | "fips-us-gov-west-1": endpoint{ | ||
2117 | Hostname: "s3-fips-us-gov-west-1.amazonaws.com", | ||
2118 | CredentialScope: credentialScope{ | ||
2119 | Region: "us-gov-west-1", | ||
2120 | }, | ||
2121 | }, | ||
2122 | "us-gov-west-1": endpoint{ | ||
2123 | Hostname: "s3-us-gov-west-1.amazonaws.com", | ||
2124 | Protocols: []string{"http", "https"}, | ||
2125 | }, | ||
2126 | }, | ||
2127 | }, | ||
2128 | "snowball": service{ | ||
2129 | |||
2130 | Endpoints: endpoints{ | ||
2131 | "us-gov-west-1": endpoint{}, | ||
2132 | }, | ||
2133 | }, | ||
2134 | "sns": service{ | ||
2135 | |||
2136 | Endpoints: endpoints{ | ||
2137 | "us-gov-west-1": endpoint{ | ||
2138 | Protocols: []string{"http", "https"}, | ||
2139 | }, | ||
2140 | }, | ||
2141 | }, | ||
2142 | "sqs": service{ | ||
2143 | |||
2144 | Endpoints: endpoints{ | ||
2145 | "us-gov-west-1": endpoint{ | ||
2146 | SSLCommonName: "{region}.queue.{dnsSuffix}", | ||
2147 | Protocols: []string{"http", "https"}, | ||
2148 | }, | ||
2149 | }, | ||
2150 | }, | ||
2151 | "streams.dynamodb": service{ | ||
2152 | Defaults: endpoint{ | ||
2153 | CredentialScope: credentialScope{ | ||
2154 | Service: "dynamodb", | ||
2155 | }, | ||
2156 | }, | ||
2157 | Endpoints: endpoints{ | ||
2158 | "us-gov-west-1": endpoint{}, | ||
2159 | }, | ||
2160 | }, | ||
2161 | "sts": service{ | ||
2162 | |||
2163 | Endpoints: endpoints{ | ||
2164 | "us-gov-west-1": endpoint{}, | ||
2165 | }, | ||
2166 | }, | ||
2167 | "swf": service{ | ||
2168 | |||
2169 | Endpoints: endpoints{ | ||
2170 | "us-gov-west-1": endpoint{}, | ||
2171 | }, | ||
2172 | }, | ||
2173 | }, | ||
2174 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/doc.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/doc.go new file mode 100644 index 0000000..a0e9bc4 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/doc.go | |||
@@ -0,0 +1,66 @@ | |||
1 | // Package endpoints provides the types and functionality for defining regions | ||
2 | // and endpoints, as well as querying those definitions. | ||
3 | // | ||
4 | // The SDK's Regions and Endpoints metadata is code generated into the endpoints | ||
5 | // package, and is accessible via the DefaultResolver function. This function | ||
6 | // returns a endpoint Resolver will search the metadata and build an associated | ||
7 | // endpoint if one is found. The default resolver will search all partitions | ||
8 | // known by the SDK. e.g AWS Standard (aws), AWS China (aws-cn), and | ||
9 | // AWS GovCloud (US) (aws-us-gov). | ||
10 | // . | ||
11 | // | ||
12 | // Enumerating Regions and Endpoint Metadata | ||
13 | // | ||
14 | // Casting the Resolver returned by DefaultResolver to a EnumPartitions interface | ||
15 | // will allow you to get access to the list of underlying Partitions with the | ||
16 | // Partitions method. This is helpful if you want to limit the SDK's endpoint | ||
17 | // resolving to a single partition, or enumerate regions, services, and endpoints | ||
18 | // in the partition. | ||
19 | // | ||
20 | // resolver := endpoints.DefaultResolver() | ||
21 | // partitions := resolver.(endpoints.EnumPartitions).Partitions() | ||
22 | // | ||
23 | // for _, p := range partitions { | ||
24 | // fmt.Println("Regions for", p.Name) | ||
25 | // for id, _ := range p.Regions() { | ||
26 | // fmt.Println("*", id) | ||
27 | // } | ||
28 | // | ||
29 | // fmt.Println("Services for", p.Name) | ||
30 | // for id, _ := range p.Services() { | ||
31 | // fmt.Println("*", id) | ||
32 | // } | ||
33 | // } | ||
34 | // | ||
35 | // Using Custom Endpoints | ||
36 | // | ||
37 | // The endpoints package also gives you the ability to use your own logic how | ||
38 | // endpoints are resolved. This is a great way to define a custom endpoint | ||
39 | // for select services, without passing that logic down through your code. | ||
40 | // | ||
41 | // If a type implements the Resolver interface it can be used to resolve | ||
42 | // endpoints. To use this with the SDK's Session and Config set the value | ||
43 | // of the type to the EndpointsResolver field of aws.Config when initializing | ||
44 | // the session, or service client. | ||
45 | // | ||
46 | // In addition the ResolverFunc is a wrapper for a func matching the signature | ||
47 | // of Resolver.EndpointFor, converting it to a type that satisfies the | ||
48 | // Resolver interface. | ||
49 | // | ||
50 | // | ||
51 | // myCustomResolver := func(service, region string, optFns ...func(*endpoints.Options)) (endpoints.ResolvedEndpoint, error) { | ||
52 | // if service == endpoints.S3ServiceID { | ||
53 | // return endpoints.ResolvedEndpoint{ | ||
54 | // URL: "s3.custom.endpoint.com", | ||
55 | // SigningRegion: "custom-signing-region", | ||
56 | // }, nil | ||
57 | // } | ||
58 | // | ||
59 | // return endpoints.DefaultResolver().EndpointFor(service, region, optFns...) | ||
60 | // } | ||
61 | // | ||
62 | // sess := session.Must(session.NewSession(&aws.Config{ | ||
63 | // Region: aws.String("us-west-2"), | ||
64 | // EndpointResolver: endpoints.ResolverFunc(myCustomResolver), | ||
65 | // })) | ||
66 | package endpoints | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go new file mode 100644 index 0000000..9c3eedb --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go | |||
@@ -0,0 +1,439 @@ | |||
1 | package endpoints | ||
2 | |||
3 | import ( | ||
4 | "fmt" | ||
5 | "regexp" | ||
6 | |||
7 | "github.com/aws/aws-sdk-go/aws/awserr" | ||
8 | ) | ||
9 | |||
10 | // Options provide the configuration needed to direct how the | ||
11 | // endpoints will be resolved. | ||
12 | type Options struct { | ||
13 | // DisableSSL forces the endpoint to be resolved as HTTP. | ||
14 | // instead of HTTPS if the service supports it. | ||
15 | DisableSSL bool | ||
16 | |||
17 | // Sets the resolver to resolve the endpoint as a dualstack endpoint | ||
18 | // for the service. If dualstack support for a service is not known and | ||
19 | // StrictMatching is not enabled a dualstack endpoint for the service will | ||
20 | // be returned. This endpoint may not be valid. If StrictMatching is | ||
21 | // enabled only services that are known to support dualstack will return | ||
22 | // dualstack endpoints. | ||
23 | UseDualStack bool | ||
24 | |||
25 | // Enables strict matching of services and regions resolved endpoints. | ||
26 | // If the partition doesn't enumerate the exact service and region an | ||
27 | // error will be returned. This option will prevent returning endpoints | ||
28 | // that look valid, but may not resolve to any real endpoint. | ||
29 | StrictMatching bool | ||
30 | |||
31 | // Enables resolving a service endpoint based on the region provided if the | ||
32 | // service does not exist. The service endpoint ID will be used as the service | ||
33 | // domain name prefix. By default the endpoint resolver requires the service | ||
34 | // to be known when resolving endpoints. | ||
35 | // | ||
36 | // If resolving an endpoint on the partition list the provided region will | ||
37 | // be used to determine which partition's domain name pattern to the service | ||
38 | // endpoint ID with. If both the service and region are unkonwn and resolving | ||
39 | // the endpoint on partition list an UnknownEndpointError error will be returned. | ||
40 | // | ||
41 | // If resolving and endpoint on a partition specific resolver that partition's | ||
42 | // domain name pattern will be used with the service endpoint ID. If both | ||
43 | // region and service do not exist when resolving an endpoint on a specific | ||
44 | // partition the partition's domain pattern will be used to combine the | ||
45 | // endpoint and region together. | ||
46 | // | ||
47 | // This option is ignored if StrictMatching is enabled. | ||
48 | ResolveUnknownService bool | ||
49 | } | ||
50 | |||
51 | // Set combines all of the option functions together. | ||
52 | func (o *Options) Set(optFns ...func(*Options)) { | ||
53 | for _, fn := range optFns { | ||
54 | fn(o) | ||
55 | } | ||
56 | } | ||
57 | |||
58 | // DisableSSLOption sets the DisableSSL options. Can be used as a functional | ||
59 | // option when resolving endpoints. | ||
60 | func DisableSSLOption(o *Options) { | ||
61 | o.DisableSSL = true | ||
62 | } | ||
63 | |||
64 | // UseDualStackOption sets the UseDualStack option. Can be used as a functional | ||
65 | // option when resolving endpoints. | ||
66 | func UseDualStackOption(o *Options) { | ||
67 | o.UseDualStack = true | ||
68 | } | ||
69 | |||
70 | // StrictMatchingOption sets the StrictMatching option. Can be used as a functional | ||
71 | // option when resolving endpoints. | ||
72 | func StrictMatchingOption(o *Options) { | ||
73 | o.StrictMatching = true | ||
74 | } | ||
75 | |||
76 | // ResolveUnknownServiceOption sets the ResolveUnknownService option. Can be used | ||
77 | // as a functional option when resolving endpoints. | ||
78 | func ResolveUnknownServiceOption(o *Options) { | ||
79 | o.ResolveUnknownService = true | ||
80 | } | ||
81 | |||
82 | // A Resolver provides the interface for functionality to resolve endpoints. | ||
83 | // The build in Partition and DefaultResolver return value satisfy this interface. | ||
84 | type Resolver interface { | ||
85 | EndpointFor(service, region string, opts ...func(*Options)) (ResolvedEndpoint, error) | ||
86 | } | ||
87 | |||
88 | // ResolverFunc is a helper utility that wraps a function so it satisfies the | ||
89 | // Resolver interface. This is useful when you want to add additional endpoint | ||
90 | // resolving logic, or stub out specific endpoints with custom values. | ||
91 | type ResolverFunc func(service, region string, opts ...func(*Options)) (ResolvedEndpoint, error) | ||
92 | |||
93 | // EndpointFor wraps the ResolverFunc function to satisfy the Resolver interface. | ||
94 | func (fn ResolverFunc) EndpointFor(service, region string, opts ...func(*Options)) (ResolvedEndpoint, error) { | ||
95 | return fn(service, region, opts...) | ||
96 | } | ||
97 | |||
98 | var schemeRE = regexp.MustCompile("^([^:]+)://") | ||
99 | |||
100 | // AddScheme adds the HTTP or HTTPS schemes to a endpoint URL if there is no | ||
101 | // scheme. If disableSSL is true HTTP will set HTTP instead of the default HTTPS. | ||
102 | // | ||
103 | // If disableSSL is set, it will only set the URL's scheme if the URL does not | ||
104 | // contain a scheme. | ||
105 | func AddScheme(endpoint string, disableSSL bool) string { | ||
106 | if !schemeRE.MatchString(endpoint) { | ||
107 | scheme := "https" | ||
108 | if disableSSL { | ||
109 | scheme = "http" | ||
110 | } | ||
111 | endpoint = fmt.Sprintf("%s://%s", scheme, endpoint) | ||
112 | } | ||
113 | |||
114 | return endpoint | ||
115 | } | ||
116 | |||
117 | // EnumPartitions a provides a way to retrieve the underlying partitions that | ||
118 | // make up the SDK's default Resolver, or any resolver decoded from a model | ||
119 | // file. | ||
120 | // | ||
121 | // Use this interface with DefaultResolver and DecodeModels to get the list of | ||
122 | // Partitions. | ||
123 | type EnumPartitions interface { | ||
124 | Partitions() []Partition | ||
125 | } | ||
126 | |||
127 | // RegionsForService returns a map of regions for the partition and service. | ||
128 | // If either the partition or service does not exist false will be returned | ||
129 | // as the second parameter. | ||
130 | // | ||
131 | // This example shows how to get the regions for DynamoDB in the AWS partition. | ||
132 | // rs, exists := endpoints.RegionsForService(endpoints.DefaultPartitions(), endpoints.AwsPartitionID, endpoints.DynamodbServiceID) | ||
133 | // | ||
134 | // This is equivalent to using the partition directly. | ||
135 | // rs := endpoints.AwsPartition().Services()[endpoints.DynamodbServiceID].Regions() | ||
136 | func RegionsForService(ps []Partition, partitionID, serviceID string) (map[string]Region, bool) { | ||
137 | for _, p := range ps { | ||
138 | if p.ID() != partitionID { | ||
139 | continue | ||
140 | } | ||
141 | if _, ok := p.p.Services[serviceID]; !ok { | ||
142 | break | ||
143 | } | ||
144 | |||
145 | s := Service{ | ||
146 | id: serviceID, | ||
147 | p: p.p, | ||
148 | } | ||
149 | return s.Regions(), true | ||
150 | } | ||
151 | |||
152 | return map[string]Region{}, false | ||
153 | } | ||
154 | |||
155 | // PartitionForRegion returns the first partition which includes the region | ||
156 | // passed in. This includes both known regions and regions which match | ||
157 | // a pattern supported by the partition which may include regions that are | ||
158 | // not explicitly known by the partition. Use the Regions method of the | ||
159 | // returned Partition if explicit support is needed. | ||
160 | func PartitionForRegion(ps []Partition, regionID string) (Partition, bool) { | ||
161 | for _, p := range ps { | ||
162 | if _, ok := p.p.Regions[regionID]; ok || p.p.RegionRegex.MatchString(regionID) { | ||
163 | return p, true | ||
164 | } | ||
165 | } | ||
166 | |||
167 | return Partition{}, false | ||
168 | } | ||
169 | |||
170 | // A Partition provides the ability to enumerate the partition's regions | ||
171 | // and services. | ||
172 | type Partition struct { | ||
173 | id string | ||
174 | p *partition | ||
175 | } | ||
176 | |||
177 | // ID returns the identifier of the partition. | ||
178 | func (p Partition) ID() string { return p.id } | ||
179 | |||
180 | // EndpointFor attempts to resolve the endpoint based on service and region. | ||
181 | // See Options for information on configuring how the endpoint is resolved. | ||
182 | // | ||
183 | // If the service cannot be found in the metadata the UnknownServiceError | ||
184 | // error will be returned. This validation will occur regardless if | ||
185 | // StrictMatching is enabled. To enable resolving unknown services set the | ||
186 | // "ResolveUnknownService" option to true. When StrictMatching is disabled | ||
187 | // this option allows the partition resolver to resolve a endpoint based on | ||
188 | // the service endpoint ID provided. | ||
189 | // | ||
190 | // When resolving endpoints you can choose to enable StrictMatching. This will | ||
191 | // require the provided service and region to be known by the partition. | ||
192 | // If the endpoint cannot be strictly resolved an error will be returned. This | ||
193 | // mode is useful to ensure the endpoint resolved is valid. Without | ||
194 | // StrictMatching enabled the endpoint returned my look valid but may not work. | ||
195 | // StrictMatching requires the SDK to be updated if you want to take advantage | ||
196 | // of new regions and services expansions. | ||
197 | // | ||
198 | // Errors that can be returned. | ||
199 | // * UnknownServiceError | ||
200 | // * UnknownEndpointError | ||
201 | func (p Partition) EndpointFor(service, region string, opts ...func(*Options)) (ResolvedEndpoint, error) { | ||
202 | return p.p.EndpointFor(service, region, opts...) | ||
203 | } | ||
204 | |||
205 | // Regions returns a map of Regions indexed by their ID. This is useful for | ||
206 | // enumerating over the regions in a partition. | ||
207 | func (p Partition) Regions() map[string]Region { | ||
208 | rs := map[string]Region{} | ||
209 | for id := range p.p.Regions { | ||
210 | rs[id] = Region{ | ||
211 | id: id, | ||
212 | p: p.p, | ||
213 | } | ||
214 | } | ||
215 | |||
216 | return rs | ||
217 | } | ||
218 | |||
219 | // Services returns a map of Service indexed by their ID. This is useful for | ||
220 | // enumerating over the services in a partition. | ||
221 | func (p Partition) Services() map[string]Service { | ||
222 | ss := map[string]Service{} | ||
223 | for id := range p.p.Services { | ||
224 | ss[id] = Service{ | ||
225 | id: id, | ||
226 | p: p.p, | ||
227 | } | ||
228 | } | ||
229 | |||
230 | return ss | ||
231 | } | ||
232 | |||
233 | // A Region provides information about a region, and ability to resolve an | ||
234 | // endpoint from the context of a region, given a service. | ||
235 | type Region struct { | ||
236 | id, desc string | ||
237 | p *partition | ||
238 | } | ||
239 | |||
240 | // ID returns the region's identifier. | ||
241 | func (r Region) ID() string { return r.id } | ||
242 | |||
243 | // ResolveEndpoint resolves an endpoint from the context of the region given | ||
244 | // a service. See Partition.EndpointFor for usage and errors that can be returned. | ||
245 | func (r Region) ResolveEndpoint(service string, opts ...func(*Options)) (ResolvedEndpoint, error) { | ||
246 | return r.p.EndpointFor(service, r.id, opts...) | ||
247 | } | ||
248 | |||
249 | // Services returns a list of all services that are known to be in this region. | ||
250 | func (r Region) Services() map[string]Service { | ||
251 | ss := map[string]Service{} | ||
252 | for id, s := range r.p.Services { | ||
253 | if _, ok := s.Endpoints[r.id]; ok { | ||
254 | ss[id] = Service{ | ||
255 | id: id, | ||
256 | p: r.p, | ||
257 | } | ||
258 | } | ||
259 | } | ||
260 | |||
261 | return ss | ||
262 | } | ||
263 | |||
264 | // A Service provides information about a service, and ability to resolve an | ||
265 | // endpoint from the context of a service, given a region. | ||
266 | type Service struct { | ||
267 | id string | ||
268 | p *partition | ||
269 | } | ||
270 | |||
271 | // ID returns the identifier for the service. | ||
272 | func (s Service) ID() string { return s.id } | ||
273 | |||
274 | // ResolveEndpoint resolves an endpoint from the context of a service given | ||
275 | // a region. See Partition.EndpointFor for usage and errors that can be returned. | ||
276 | func (s Service) ResolveEndpoint(region string, opts ...func(*Options)) (ResolvedEndpoint, error) { | ||
277 | return s.p.EndpointFor(s.id, region, opts...) | ||
278 | } | ||
279 | |||
280 | // Regions returns a map of Regions that the service is present in. | ||
281 | // | ||
282 | // A region is the AWS region the service exists in. Whereas a Endpoint is | ||
283 | // an URL that can be resolved to a instance of a service. | ||
284 | func (s Service) Regions() map[string]Region { | ||
285 | rs := map[string]Region{} | ||
286 | for id := range s.p.Services[s.id].Endpoints { | ||
287 | if _, ok := s.p.Regions[id]; ok { | ||
288 | rs[id] = Region{ | ||
289 | id: id, | ||
290 | p: s.p, | ||
291 | } | ||
292 | } | ||
293 | } | ||
294 | |||
295 | return rs | ||
296 | } | ||
297 | |||
298 | // Endpoints returns a map of Endpoints indexed by their ID for all known | ||
299 | // endpoints for a service. | ||
300 | // | ||
301 | // A region is the AWS region the service exists in. Whereas a Endpoint is | ||
302 | // an URL that can be resolved to a instance of a service. | ||
303 | func (s Service) Endpoints() map[string]Endpoint { | ||
304 | es := map[string]Endpoint{} | ||
305 | for id := range s.p.Services[s.id].Endpoints { | ||
306 | es[id] = Endpoint{ | ||
307 | id: id, | ||
308 | serviceID: s.id, | ||
309 | p: s.p, | ||
310 | } | ||
311 | } | ||
312 | |||
313 | return es | ||
314 | } | ||
315 | |||
316 | // A Endpoint provides information about endpoints, and provides the ability | ||
317 | // to resolve that endpoint for the service, and the region the endpoint | ||
318 | // represents. | ||
319 | type Endpoint struct { | ||
320 | id string | ||
321 | serviceID string | ||
322 | p *partition | ||
323 | } | ||
324 | |||
325 | // ID returns the identifier for an endpoint. | ||
326 | func (e Endpoint) ID() string { return e.id } | ||
327 | |||
328 | // ServiceID returns the identifier the endpoint belongs to. | ||
329 | func (e Endpoint) ServiceID() string { return e.serviceID } | ||
330 | |||
331 | // ResolveEndpoint resolves an endpoint from the context of a service and | ||
332 | // region the endpoint represents. See Partition.EndpointFor for usage and | ||
333 | // errors that can be returned. | ||
334 | func (e Endpoint) ResolveEndpoint(opts ...func(*Options)) (ResolvedEndpoint, error) { | ||
335 | return e.p.EndpointFor(e.serviceID, e.id, opts...) | ||
336 | } | ||
337 | |||
338 | // A ResolvedEndpoint is an endpoint that has been resolved based on a partition | ||
339 | // service, and region. | ||
340 | type ResolvedEndpoint struct { | ||
341 | // The endpoint URL | ||
342 | URL string | ||
343 | |||
344 | // The region that should be used for signing requests. | ||
345 | SigningRegion string | ||
346 | |||
347 | // The service name that should be used for signing requests. | ||
348 | SigningName string | ||
349 | |||
350 | // The signing method that should be used for signing requests. | ||
351 | SigningMethod string | ||
352 | } | ||
353 | |||
354 | // So that the Error interface type can be included as an anonymous field | ||
355 | // in the requestError struct and not conflict with the error.Error() method. | ||
356 | type awsError awserr.Error | ||
357 | |||
358 | // A EndpointNotFoundError is returned when in StrictMatching mode, and the | ||
359 | // endpoint for the service and region cannot be found in any of the partitions. | ||
360 | type EndpointNotFoundError struct { | ||
361 | awsError | ||
362 | Partition string | ||
363 | Service string | ||
364 | Region string | ||
365 | } | ||
366 | |||
367 | // A UnknownServiceError is returned when the service does not resolve to an | ||
368 | // endpoint. Includes a list of all known services for the partition. Returned | ||
369 | // when a partition does not support the service. | ||
370 | type UnknownServiceError struct { | ||
371 | awsError | ||
372 | Partition string | ||
373 | Service string | ||
374 | Known []string | ||
375 | } | ||
376 | |||
377 | // NewUnknownServiceError builds and returns UnknownServiceError. | ||
378 | func NewUnknownServiceError(p, s string, known []string) UnknownServiceError { | ||
379 | return UnknownServiceError{ | ||
380 | awsError: awserr.New("UnknownServiceError", | ||
381 | "could not resolve endpoint for unknown service", nil), | ||
382 | Partition: p, | ||
383 | Service: s, | ||
384 | Known: known, | ||
385 | } | ||
386 | } | ||
387 | |||
388 | // String returns the string representation of the error. | ||
389 | func (e UnknownServiceError) Error() string { | ||
390 | extra := fmt.Sprintf("partition: %q, service: %q", | ||
391 | e.Partition, e.Service) | ||
392 | if len(e.Known) > 0 { | ||
393 | extra += fmt.Sprintf(", known: %v", e.Known) | ||
394 | } | ||
395 | return awserr.SprintError(e.Code(), e.Message(), extra, e.OrigErr()) | ||
396 | } | ||
397 | |||
398 | // String returns the string representation of the error. | ||
399 | func (e UnknownServiceError) String() string { | ||
400 | return e.Error() | ||
401 | } | ||
402 | |||
403 | // A UnknownEndpointError is returned when in StrictMatching mode and the | ||
404 | // service is valid, but the region does not resolve to an endpoint. Includes | ||
405 | // a list of all known endpoints for the service. | ||
406 | type UnknownEndpointError struct { | ||
407 | awsError | ||
408 | Partition string | ||
409 | Service string | ||
410 | Region string | ||
411 | Known []string | ||
412 | } | ||
413 | |||
414 | // NewUnknownEndpointError builds and returns UnknownEndpointError. | ||
415 | func NewUnknownEndpointError(p, s, r string, known []string) UnknownEndpointError { | ||
416 | return UnknownEndpointError{ | ||
417 | awsError: awserr.New("UnknownEndpointError", | ||
418 | "could not resolve endpoint", nil), | ||
419 | Partition: p, | ||
420 | Service: s, | ||
421 | Region: r, | ||
422 | Known: known, | ||
423 | } | ||
424 | } | ||
425 | |||
426 | // String returns the string representation of the error. | ||
427 | func (e UnknownEndpointError) Error() string { | ||
428 | extra := fmt.Sprintf("partition: %q, service: %q, region: %q", | ||
429 | e.Partition, e.Service, e.Region) | ||
430 | if len(e.Known) > 0 { | ||
431 | extra += fmt.Sprintf(", known: %v", e.Known) | ||
432 | } | ||
433 | return awserr.SprintError(e.Code(), e.Message(), extra, e.OrigErr()) | ||
434 | } | ||
435 | |||
436 | // String returns the string representation of the error. | ||
437 | func (e UnknownEndpointError) String() string { | ||
438 | return e.Error() | ||
439 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go new file mode 100644 index 0000000..13d968a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go | |||
@@ -0,0 +1,303 @@ | |||
1 | package endpoints | ||
2 | |||
3 | import ( | ||
4 | "fmt" | ||
5 | "regexp" | ||
6 | "strconv" | ||
7 | "strings" | ||
8 | ) | ||
9 | |||
10 | type partitions []partition | ||
11 | |||
12 | func (ps partitions) EndpointFor(service, region string, opts ...func(*Options)) (ResolvedEndpoint, error) { | ||
13 | var opt Options | ||
14 | opt.Set(opts...) | ||
15 | |||
16 | for i := 0; i < len(ps); i++ { | ||
17 | if !ps[i].canResolveEndpoint(service, region, opt.StrictMatching) { | ||
18 | continue | ||
19 | } | ||
20 | |||
21 | return ps[i].EndpointFor(service, region, opts...) | ||
22 | } | ||
23 | |||
24 | // If loose matching fallback to first partition format to use | ||
25 | // when resolving the endpoint. | ||
26 | if !opt.StrictMatching && len(ps) > 0 { | ||
27 | return ps[0].EndpointFor(service, region, opts...) | ||
28 | } | ||
29 | |||
30 | return ResolvedEndpoint{}, NewUnknownEndpointError("all partitions", service, region, []string{}) | ||
31 | } | ||
32 | |||
33 | // Partitions satisfies the EnumPartitions interface and returns a list | ||
34 | // of Partitions representing each partition represented in the SDK's | ||
35 | // endpoints model. | ||
36 | func (ps partitions) Partitions() []Partition { | ||
37 | parts := make([]Partition, 0, len(ps)) | ||
38 | for i := 0; i < len(ps); i++ { | ||
39 | parts = append(parts, ps[i].Partition()) | ||
40 | } | ||
41 | |||
42 | return parts | ||
43 | } | ||
44 | |||
45 | type partition struct { | ||
46 | ID string `json:"partition"` | ||
47 | Name string `json:"partitionName"` | ||
48 | DNSSuffix string `json:"dnsSuffix"` | ||
49 | RegionRegex regionRegex `json:"regionRegex"` | ||
50 | Defaults endpoint `json:"defaults"` | ||
51 | Regions regions `json:"regions"` | ||
52 | Services services `json:"services"` | ||
53 | } | ||
54 | |||
55 | func (p partition) Partition() Partition { | ||
56 | return Partition{ | ||
57 | id: p.ID, | ||
58 | p: &p, | ||
59 | } | ||
60 | } | ||
61 | |||
62 | func (p partition) canResolveEndpoint(service, region string, strictMatch bool) bool { | ||
63 | s, hasService := p.Services[service] | ||
64 | _, hasEndpoint := s.Endpoints[region] | ||
65 | |||
66 | if hasEndpoint && hasService { | ||
67 | return true | ||
68 | } | ||
69 | |||
70 | if strictMatch { | ||
71 | return false | ||
72 | } | ||
73 | |||
74 | return p.RegionRegex.MatchString(region) | ||
75 | } | ||
76 | |||
77 | func (p partition) EndpointFor(service, region string, opts ...func(*Options)) (resolved ResolvedEndpoint, err error) { | ||
78 | var opt Options | ||
79 | opt.Set(opts...) | ||
80 | |||
81 | s, hasService := p.Services[service] | ||
82 | if !(hasService || opt.ResolveUnknownService) { | ||
83 | // Only return error if the resolver will not fallback to creating | ||
84 | // endpoint based on service endpoint ID passed in. | ||
85 | return resolved, NewUnknownServiceError(p.ID, service, serviceList(p.Services)) | ||
86 | } | ||
87 | |||
88 | e, hasEndpoint := s.endpointForRegion(region) | ||
89 | if !hasEndpoint && opt.StrictMatching { | ||
90 | return resolved, NewUnknownEndpointError(p.ID, service, region, endpointList(s.Endpoints)) | ||
91 | } | ||
92 | |||
93 | defs := []endpoint{p.Defaults, s.Defaults} | ||
94 | return e.resolve(service, region, p.DNSSuffix, defs, opt), nil | ||
95 | } | ||
96 | |||
97 | func serviceList(ss services) []string { | ||
98 | list := make([]string, 0, len(ss)) | ||
99 | for k := range ss { | ||
100 | list = append(list, k) | ||
101 | } | ||
102 | return list | ||
103 | } | ||
104 | func endpointList(es endpoints) []string { | ||
105 | list := make([]string, 0, len(es)) | ||
106 | for k := range es { | ||
107 | list = append(list, k) | ||
108 | } | ||
109 | return list | ||
110 | } | ||
111 | |||
112 | type regionRegex struct { | ||
113 | *regexp.Regexp | ||
114 | } | ||
115 | |||
116 | func (rr *regionRegex) UnmarshalJSON(b []byte) (err error) { | ||
117 | // Strip leading and trailing quotes | ||
118 | regex, err := strconv.Unquote(string(b)) | ||
119 | if err != nil { | ||
120 | return fmt.Errorf("unable to strip quotes from regex, %v", err) | ||
121 | } | ||
122 | |||
123 | rr.Regexp, err = regexp.Compile(regex) | ||
124 | if err != nil { | ||
125 | return fmt.Errorf("unable to unmarshal region regex, %v", err) | ||
126 | } | ||
127 | return nil | ||
128 | } | ||
129 | |||
130 | type regions map[string]region | ||
131 | |||
132 | type region struct { | ||
133 | Description string `json:"description"` | ||
134 | } | ||
135 | |||
136 | type services map[string]service | ||
137 | |||
138 | type service struct { | ||
139 | PartitionEndpoint string `json:"partitionEndpoint"` | ||
140 | IsRegionalized boxedBool `json:"isRegionalized,omitempty"` | ||
141 | Defaults endpoint `json:"defaults"` | ||
142 | Endpoints endpoints `json:"endpoints"` | ||
143 | } | ||
144 | |||
145 | func (s *service) endpointForRegion(region string) (endpoint, bool) { | ||
146 | if s.IsRegionalized == boxedFalse { | ||
147 | return s.Endpoints[s.PartitionEndpoint], region == s.PartitionEndpoint | ||
148 | } | ||
149 | |||
150 | if e, ok := s.Endpoints[region]; ok { | ||
151 | return e, true | ||
152 | } | ||
153 | |||
154 | // Unable to find any matching endpoint, return | ||
155 | // blank that will be used for generic endpoint creation. | ||
156 | return endpoint{}, false | ||
157 | } | ||
158 | |||
159 | type endpoints map[string]endpoint | ||
160 | |||
161 | type endpoint struct { | ||
162 | Hostname string `json:"hostname"` | ||
163 | Protocols []string `json:"protocols"` | ||
164 | CredentialScope credentialScope `json:"credentialScope"` | ||
165 | |||
166 | // Custom fields not modeled | ||
167 | HasDualStack boxedBool `json:"-"` | ||
168 | DualStackHostname string `json:"-"` | ||
169 | |||
170 | // Signature Version not used | ||
171 | SignatureVersions []string `json:"signatureVersions"` | ||
172 | |||
173 | // SSLCommonName not used. | ||
174 | SSLCommonName string `json:"sslCommonName"` | ||
175 | } | ||
176 | |||
177 | const ( | ||
178 | defaultProtocol = "https" | ||
179 | defaultSigner = "v4" | ||
180 | ) | ||
181 | |||
182 | var ( | ||
183 | protocolPriority = []string{"https", "http"} | ||
184 | signerPriority = []string{"v4", "v2"} | ||
185 | ) | ||
186 | |||
187 | func getByPriority(s []string, p []string, def string) string { | ||
188 | if len(s) == 0 { | ||
189 | return def | ||
190 | } | ||
191 | |||
192 | for i := 0; i < len(p); i++ { | ||
193 | for j := 0; j < len(s); j++ { | ||
194 | if s[j] == p[i] { | ||
195 | return s[j] | ||
196 | } | ||
197 | } | ||
198 | } | ||
199 | |||
200 | return s[0] | ||
201 | } | ||
202 | |||
203 | func (e endpoint) resolve(service, region, dnsSuffix string, defs []endpoint, opts Options) ResolvedEndpoint { | ||
204 | var merged endpoint | ||
205 | for _, def := range defs { | ||
206 | merged.mergeIn(def) | ||
207 | } | ||
208 | merged.mergeIn(e) | ||
209 | e = merged | ||
210 | |||
211 | hostname := e.Hostname | ||
212 | |||
213 | // Offset the hostname for dualstack if enabled | ||
214 | if opts.UseDualStack && e.HasDualStack == boxedTrue { | ||
215 | hostname = e.DualStackHostname | ||
216 | } | ||
217 | |||
218 | u := strings.Replace(hostname, "{service}", service, 1) | ||
219 | u = strings.Replace(u, "{region}", region, 1) | ||
220 | u = strings.Replace(u, "{dnsSuffix}", dnsSuffix, 1) | ||
221 | |||
222 | scheme := getEndpointScheme(e.Protocols, opts.DisableSSL) | ||
223 | u = fmt.Sprintf("%s://%s", scheme, u) | ||
224 | |||
225 | signingRegion := e.CredentialScope.Region | ||
226 | if len(signingRegion) == 0 { | ||
227 | signingRegion = region | ||
228 | } | ||
229 | signingName := e.CredentialScope.Service | ||
230 | if len(signingName) == 0 { | ||
231 | signingName = service | ||
232 | } | ||
233 | |||
234 | return ResolvedEndpoint{ | ||
235 | URL: u, | ||
236 | SigningRegion: signingRegion, | ||
237 | SigningName: signingName, | ||
238 | SigningMethod: getByPriority(e.SignatureVersions, signerPriority, defaultSigner), | ||
239 | } | ||
240 | } | ||
241 | |||
242 | func getEndpointScheme(protocols []string, disableSSL bool) string { | ||
243 | if disableSSL { | ||
244 | return "http" | ||
245 | } | ||
246 | |||
247 | return getByPriority(protocols, protocolPriority, defaultProtocol) | ||
248 | } | ||
249 | |||
250 | func (e *endpoint) mergeIn(other endpoint) { | ||
251 | if len(other.Hostname) > 0 { | ||
252 | e.Hostname = other.Hostname | ||
253 | } | ||
254 | if len(other.Protocols) > 0 { | ||
255 | e.Protocols = other.Protocols | ||
256 | } | ||
257 | if len(other.SignatureVersions) > 0 { | ||
258 | e.SignatureVersions = other.SignatureVersions | ||
259 | } | ||
260 | if len(other.CredentialScope.Region) > 0 { | ||
261 | e.CredentialScope.Region = other.CredentialScope.Region | ||
262 | } | ||
263 | if len(other.CredentialScope.Service) > 0 { | ||
264 | e.CredentialScope.Service = other.CredentialScope.Service | ||
265 | } | ||
266 | if len(other.SSLCommonName) > 0 { | ||
267 | e.SSLCommonName = other.SSLCommonName | ||
268 | } | ||
269 | if other.HasDualStack != boxedBoolUnset { | ||
270 | e.HasDualStack = other.HasDualStack | ||
271 | } | ||
272 | if len(other.DualStackHostname) > 0 { | ||
273 | e.DualStackHostname = other.DualStackHostname | ||
274 | } | ||
275 | } | ||
276 | |||
277 | type credentialScope struct { | ||
278 | Region string `json:"region"` | ||
279 | Service string `json:"service"` | ||
280 | } | ||
281 | |||
282 | type boxedBool int | ||
283 | |||
284 | func (b *boxedBool) UnmarshalJSON(buf []byte) error { | ||
285 | v, err := strconv.ParseBool(string(buf)) | ||
286 | if err != nil { | ||
287 | return err | ||
288 | } | ||
289 | |||
290 | if v { | ||
291 | *b = boxedTrue | ||
292 | } else { | ||
293 | *b = boxedFalse | ||
294 | } | ||
295 | |||
296 | return nil | ||
297 | } | ||
298 | |||
299 | const ( | ||
300 | boxedBoolUnset boxedBool = iota | ||
301 | boxedFalse | ||
302 | boxedTrue | ||
303 | ) | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model_codegen.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model_codegen.go new file mode 100644 index 0000000..05e92df --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model_codegen.go | |||
@@ -0,0 +1,337 @@ | |||
1 | // +build codegen | ||
2 | |||
3 | package endpoints | ||
4 | |||
5 | import ( | ||
6 | "fmt" | ||
7 | "io" | ||
8 | "reflect" | ||
9 | "strings" | ||
10 | "text/template" | ||
11 | "unicode" | ||
12 | ) | ||
13 | |||
14 | // A CodeGenOptions are the options for code generating the endpoints into | ||
15 | // Go code from the endpoints model definition. | ||
16 | type CodeGenOptions struct { | ||
17 | // Options for how the model will be decoded. | ||
18 | DecodeModelOptions DecodeModelOptions | ||
19 | } | ||
20 | |||
21 | // Set combines all of the option functions together | ||
22 | func (d *CodeGenOptions) Set(optFns ...func(*CodeGenOptions)) { | ||
23 | for _, fn := range optFns { | ||
24 | fn(d) | ||
25 | } | ||
26 | } | ||
27 | |||
28 | // CodeGenModel given a endpoints model file will decode it and attempt to | ||
29 | // generate Go code from the model definition. Error will be returned if | ||
30 | // the code is unable to be generated, or decoded. | ||
31 | func CodeGenModel(modelFile io.Reader, outFile io.Writer, optFns ...func(*CodeGenOptions)) error { | ||
32 | var opts CodeGenOptions | ||
33 | opts.Set(optFns...) | ||
34 | |||
35 | resolver, err := DecodeModel(modelFile, func(d *DecodeModelOptions) { | ||
36 | *d = opts.DecodeModelOptions | ||
37 | }) | ||
38 | if err != nil { | ||
39 | return err | ||
40 | } | ||
41 | |||
42 | tmpl := template.Must(template.New("tmpl").Funcs(funcMap).Parse(v3Tmpl)) | ||
43 | if err := tmpl.ExecuteTemplate(outFile, "defaults", resolver); err != nil { | ||
44 | return fmt.Errorf("failed to execute template, %v", err) | ||
45 | } | ||
46 | |||
47 | return nil | ||
48 | } | ||
49 | |||
50 | func toSymbol(v string) string { | ||
51 | out := []rune{} | ||
52 | for _, c := range strings.Title(v) { | ||
53 | if !(unicode.IsNumber(c) || unicode.IsLetter(c)) { | ||
54 | continue | ||
55 | } | ||
56 | |||
57 | out = append(out, c) | ||
58 | } | ||
59 | |||
60 | return string(out) | ||
61 | } | ||
62 | |||
63 | func quoteString(v string) string { | ||
64 | return fmt.Sprintf("%q", v) | ||
65 | } | ||
66 | |||
67 | func regionConstName(p, r string) string { | ||
68 | return toSymbol(p) + toSymbol(r) | ||
69 | } | ||
70 | |||
71 | func partitionGetter(id string) string { | ||
72 | return fmt.Sprintf("%sPartition", toSymbol(id)) | ||
73 | } | ||
74 | |||
75 | func partitionVarName(id string) string { | ||
76 | return fmt.Sprintf("%sPartition", strings.ToLower(toSymbol(id))) | ||
77 | } | ||
78 | |||
79 | func listPartitionNames(ps partitions) string { | ||
80 | names := []string{} | ||
81 | switch len(ps) { | ||
82 | case 1: | ||
83 | return ps[0].Name | ||
84 | case 2: | ||
85 | return fmt.Sprintf("%s and %s", ps[0].Name, ps[1].Name) | ||
86 | default: | ||
87 | for i, p := range ps { | ||
88 | if i == len(ps)-1 { | ||
89 | names = append(names, "and "+p.Name) | ||
90 | } else { | ||
91 | names = append(names, p.Name) | ||
92 | } | ||
93 | } | ||
94 | return strings.Join(names, ", ") | ||
95 | } | ||
96 | } | ||
97 | |||
98 | func boxedBoolIfSet(msg string, v boxedBool) string { | ||
99 | switch v { | ||
100 | case boxedTrue: | ||
101 | return fmt.Sprintf(msg, "boxedTrue") | ||
102 | case boxedFalse: | ||
103 | return fmt.Sprintf(msg, "boxedFalse") | ||
104 | default: | ||
105 | return "" | ||
106 | } | ||
107 | } | ||
108 | |||
109 | func stringIfSet(msg, v string) string { | ||
110 | if len(v) == 0 { | ||
111 | return "" | ||
112 | } | ||
113 | |||
114 | return fmt.Sprintf(msg, v) | ||
115 | } | ||
116 | |||
117 | func stringSliceIfSet(msg string, vs []string) string { | ||
118 | if len(vs) == 0 { | ||
119 | return "" | ||
120 | } | ||
121 | |||
122 | names := []string{} | ||
123 | for _, v := range vs { | ||
124 | names = append(names, `"`+v+`"`) | ||
125 | } | ||
126 | |||
127 | return fmt.Sprintf(msg, strings.Join(names, ",")) | ||
128 | } | ||
129 | |||
130 | func endpointIsSet(v endpoint) bool { | ||
131 | return !reflect.DeepEqual(v, endpoint{}) | ||
132 | } | ||
133 | |||
134 | func serviceSet(ps partitions) map[string]struct{} { | ||
135 | set := map[string]struct{}{} | ||
136 | for _, p := range ps { | ||
137 | for id := range p.Services { | ||
138 | set[id] = struct{}{} | ||
139 | } | ||
140 | } | ||
141 | |||
142 | return set | ||
143 | } | ||
144 | |||
145 | var funcMap = template.FuncMap{ | ||
146 | "ToSymbol": toSymbol, | ||
147 | "QuoteString": quoteString, | ||
148 | "RegionConst": regionConstName, | ||
149 | "PartitionGetter": partitionGetter, | ||
150 | "PartitionVarName": partitionVarName, | ||
151 | "ListPartitionNames": listPartitionNames, | ||
152 | "BoxedBoolIfSet": boxedBoolIfSet, | ||
153 | "StringIfSet": stringIfSet, | ||
154 | "StringSliceIfSet": stringSliceIfSet, | ||
155 | "EndpointIsSet": endpointIsSet, | ||
156 | "ServicesSet": serviceSet, | ||
157 | } | ||
158 | |||
159 | const v3Tmpl = ` | ||
160 | {{ define "defaults" -}} | ||
161 | // Code generated by aws/endpoints/v3model_codegen.go. DO NOT EDIT. | ||
162 | |||
163 | package endpoints | ||
164 | |||
165 | import ( | ||
166 | "regexp" | ||
167 | ) | ||
168 | |||
169 | {{ template "partition consts" . }} | ||
170 | |||
171 | {{ range $_, $partition := . }} | ||
172 | {{ template "partition region consts" $partition }} | ||
173 | {{ end }} | ||
174 | |||
175 | {{ template "service consts" . }} | ||
176 | |||
177 | {{ template "endpoint resolvers" . }} | ||
178 | {{- end }} | ||
179 | |||
180 | {{ define "partition consts" }} | ||
181 | // Partition identifiers | ||
182 | const ( | ||
183 | {{ range $_, $p := . -}} | ||
184 | {{ ToSymbol $p.ID }}PartitionID = {{ QuoteString $p.ID }} // {{ $p.Name }} partition. | ||
185 | {{ end -}} | ||
186 | ) | ||
187 | {{- end }} | ||
188 | |||
189 | {{ define "partition region consts" }} | ||
190 | // {{ .Name }} partition's regions. | ||
191 | const ( | ||
192 | {{ range $id, $region := .Regions -}} | ||
193 | {{ ToSymbol $id }}RegionID = {{ QuoteString $id }} // {{ $region.Description }}. | ||
194 | {{ end -}} | ||
195 | ) | ||
196 | {{- end }} | ||
197 | |||
198 | {{ define "service consts" }} | ||
199 | // Service identifiers | ||
200 | const ( | ||
201 | {{ $serviceSet := ServicesSet . -}} | ||
202 | {{ range $id, $_ := $serviceSet -}} | ||
203 | {{ ToSymbol $id }}ServiceID = {{ QuoteString $id }} // {{ ToSymbol $id }}. | ||
204 | {{ end -}} | ||
205 | ) | ||
206 | {{- end }} | ||
207 | |||
208 | {{ define "endpoint resolvers" }} | ||
209 | // DefaultResolver returns an Endpoint resolver that will be able | ||
210 | // to resolve endpoints for: {{ ListPartitionNames . }}. | ||
211 | // | ||
212 | // Use DefaultPartitions() to get the list of the default partitions. | ||
213 | func DefaultResolver() Resolver { | ||
214 | return defaultPartitions | ||
215 | } | ||
216 | |||
217 | // DefaultPartitions returns a list of the partitions the SDK is bundled | ||
218 | // with. The available partitions are: {{ ListPartitionNames . }}. | ||
219 | // | ||
220 | // partitions := endpoints.DefaultPartitions | ||
221 | // for _, p := range partitions { | ||
222 | // // ... inspect partitions | ||
223 | // } | ||
224 | func DefaultPartitions() []Partition { | ||
225 | return defaultPartitions.Partitions() | ||
226 | } | ||
227 | |||
228 | var defaultPartitions = partitions{ | ||
229 | {{ range $_, $partition := . -}} | ||
230 | {{ PartitionVarName $partition.ID }}, | ||
231 | {{ end }} | ||
232 | } | ||
233 | |||
234 | {{ range $_, $partition := . -}} | ||
235 | {{ $name := PartitionGetter $partition.ID -}} | ||
236 | // {{ $name }} returns the Resolver for {{ $partition.Name }}. | ||
237 | func {{ $name }}() Partition { | ||
238 | return {{ PartitionVarName $partition.ID }}.Partition() | ||
239 | } | ||
240 | var {{ PartitionVarName $partition.ID }} = {{ template "gocode Partition" $partition }} | ||
241 | {{ end }} | ||
242 | {{ end }} | ||
243 | |||
244 | {{ define "default partitions" }} | ||
245 | func DefaultPartitions() []Partition { | ||
246 | return []partition{ | ||
247 | {{ range $_, $partition := . -}} | ||
248 | // {{ ToSymbol $partition.ID}}Partition(), | ||
249 | {{ end }} | ||
250 | } | ||
251 | } | ||
252 | {{ end }} | ||
253 | |||
254 | {{ define "gocode Partition" -}} | ||
255 | partition{ | ||
256 | {{ StringIfSet "ID: %q,\n" .ID -}} | ||
257 | {{ StringIfSet "Name: %q,\n" .Name -}} | ||
258 | {{ StringIfSet "DNSSuffix: %q,\n" .DNSSuffix -}} | ||
259 | RegionRegex: {{ template "gocode RegionRegex" .RegionRegex }}, | ||
260 | {{ if EndpointIsSet .Defaults -}} | ||
261 | Defaults: {{ template "gocode Endpoint" .Defaults }}, | ||
262 | {{- end }} | ||
263 | Regions: {{ template "gocode Regions" .Regions }}, | ||
264 | Services: {{ template "gocode Services" .Services }}, | ||
265 | } | ||
266 | {{- end }} | ||
267 | |||
268 | {{ define "gocode RegionRegex" -}} | ||
269 | regionRegex{ | ||
270 | Regexp: func() *regexp.Regexp{ | ||
271 | reg, _ := regexp.Compile({{ QuoteString .Regexp.String }}) | ||
272 | return reg | ||
273 | }(), | ||
274 | } | ||
275 | {{- end }} | ||
276 | |||
277 | {{ define "gocode Regions" -}} | ||
278 | regions{ | ||
279 | {{ range $id, $region := . -}} | ||
280 | "{{ $id }}": {{ template "gocode Region" $region }}, | ||
281 | {{ end -}} | ||
282 | } | ||
283 | {{- end }} | ||
284 | |||
285 | {{ define "gocode Region" -}} | ||
286 | region{ | ||
287 | {{ StringIfSet "Description: %q,\n" .Description -}} | ||
288 | } | ||
289 | {{- end }} | ||
290 | |||
291 | {{ define "gocode Services" -}} | ||
292 | services{ | ||
293 | {{ range $id, $service := . -}} | ||
294 | "{{ $id }}": {{ template "gocode Service" $service }}, | ||
295 | {{ end }} | ||
296 | } | ||
297 | {{- end }} | ||
298 | |||
299 | {{ define "gocode Service" -}} | ||
300 | service{ | ||
301 | {{ StringIfSet "PartitionEndpoint: %q,\n" .PartitionEndpoint -}} | ||
302 | {{ BoxedBoolIfSet "IsRegionalized: %s,\n" .IsRegionalized -}} | ||
303 | {{ if EndpointIsSet .Defaults -}} | ||
304 | Defaults: {{ template "gocode Endpoint" .Defaults -}}, | ||
305 | {{- end }} | ||
306 | {{ if .Endpoints -}} | ||
307 | Endpoints: {{ template "gocode Endpoints" .Endpoints }}, | ||
308 | {{- end }} | ||
309 | } | ||
310 | {{- end }} | ||
311 | |||
312 | {{ define "gocode Endpoints" -}} | ||
313 | endpoints{ | ||
314 | {{ range $id, $endpoint := . -}} | ||
315 | "{{ $id }}": {{ template "gocode Endpoint" $endpoint }}, | ||
316 | {{ end }} | ||
317 | } | ||
318 | {{- end }} | ||
319 | |||
320 | {{ define "gocode Endpoint" -}} | ||
321 | endpoint{ | ||
322 | {{ StringIfSet "Hostname: %q,\n" .Hostname -}} | ||
323 | {{ StringIfSet "SSLCommonName: %q,\n" .SSLCommonName -}} | ||
324 | {{ StringSliceIfSet "Protocols: []string{%s},\n" .Protocols -}} | ||
325 | {{ StringSliceIfSet "SignatureVersions: []string{%s},\n" .SignatureVersions -}} | ||
326 | {{ if or .CredentialScope.Region .CredentialScope.Service -}} | ||
327 | CredentialScope: credentialScope{ | ||
328 | {{ StringIfSet "Region: %q,\n" .CredentialScope.Region -}} | ||
329 | {{ StringIfSet "Service: %q,\n" .CredentialScope.Service -}} | ||
330 | }, | ||
331 | {{- end }} | ||
332 | {{ BoxedBoolIfSet "HasDualStack: %s,\n" .HasDualStack -}} | ||
333 | {{ StringIfSet "DualStackHostname: %q,\n" .DualStackHostname -}} | ||
334 | |||
335 | } | ||
336 | {{- end }} | ||
337 | ` | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/errors.go b/vendor/github.com/aws/aws-sdk-go/aws/errors.go new file mode 100644 index 0000000..5766361 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/errors.go | |||
@@ -0,0 +1,17 @@ | |||
1 | package aws | ||
2 | |||
3 | import "github.com/aws/aws-sdk-go/aws/awserr" | ||
4 | |||
5 | var ( | ||
6 | // ErrMissingRegion is an error that is returned if region configuration is | ||
7 | // not found. | ||
8 | // | ||
9 | // @readonly | ||
10 | ErrMissingRegion = awserr.New("MissingRegion", "could not find region configuration", nil) | ||
11 | |||
12 | // ErrMissingEndpoint is an error that is returned if an endpoint cannot be | ||
13 | // resolved for a service. | ||
14 | // | ||
15 | // @readonly | ||
16 | ErrMissingEndpoint = awserr.New("MissingEndpoint", "'Endpoint' configuration is required for this service", nil) | ||
17 | ) | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/jsonvalue.go b/vendor/github.com/aws/aws-sdk-go/aws/jsonvalue.go new file mode 100644 index 0000000..91a6f27 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/jsonvalue.go | |||
@@ -0,0 +1,12 @@ | |||
1 | package aws | ||
2 | |||
3 | // JSONValue is a representation of a grab bag type that will be marshaled | ||
4 | // into a json string. This type can be used just like any other map. | ||
5 | // | ||
6 | // Example: | ||
7 | // | ||
8 | // values := aws.JSONValue{ | ||
9 | // "Foo": "Bar", | ||
10 | // } | ||
11 | // values["Baz"] = "Qux" | ||
12 | type JSONValue map[string]interface{} | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/logger.go b/vendor/github.com/aws/aws-sdk-go/aws/logger.go new file mode 100644 index 0000000..db87188 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/logger.go | |||
@@ -0,0 +1,112 @@ | |||
1 | package aws | ||
2 | |||
3 | import ( | ||
4 | "log" | ||
5 | "os" | ||
6 | ) | ||
7 | |||
8 | // A LogLevelType defines the level logging should be performed at. Used to instruct | ||
9 | // the SDK which statements should be logged. | ||
10 | type LogLevelType uint | ||
11 | |||
12 | // LogLevel returns the pointer to a LogLevel. Should be used to workaround | ||
13 | // not being able to take the address of a non-composite literal. | ||
14 | func LogLevel(l LogLevelType) *LogLevelType { | ||
15 | return &l | ||
16 | } | ||
17 | |||
18 | // Value returns the LogLevel value or the default value LogOff if the LogLevel | ||
19 | // is nil. Safe to use on nil value LogLevelTypes. | ||
20 | func (l *LogLevelType) Value() LogLevelType { | ||
21 | if l != nil { | ||
22 | return *l | ||
23 | } | ||
24 | return LogOff | ||
25 | } | ||
26 | |||
27 | // Matches returns true if the v LogLevel is enabled by this LogLevel. Should be | ||
28 | // used with logging sub levels. Is safe to use on nil value LogLevelTypes. If | ||
29 | // LogLevel is nill, will default to LogOff comparison. | ||
30 | func (l *LogLevelType) Matches(v LogLevelType) bool { | ||
31 | c := l.Value() | ||
32 | return c&v == v | ||
33 | } | ||
34 | |||
35 | // AtLeast returns true if this LogLevel is at least high enough to satisfies v. | ||
36 | // Is safe to use on nil value LogLevelTypes. If LogLevel is nill, will default | ||
37 | // to LogOff comparison. | ||
38 | func (l *LogLevelType) AtLeast(v LogLevelType) bool { | ||
39 | c := l.Value() | ||
40 | return c >= v | ||
41 | } | ||
42 | |||
43 | const ( | ||
44 | // LogOff states that no logging should be performed by the SDK. This is the | ||
45 | // default state of the SDK, and should be use to disable all logging. | ||
46 | LogOff LogLevelType = iota * 0x1000 | ||
47 | |||
48 | // LogDebug state that debug output should be logged by the SDK. This should | ||
49 | // be used to inspect request made and responses received. | ||
50 | LogDebug | ||
51 | ) | ||
52 | |||
53 | // Debug Logging Sub Levels | ||
54 | const ( | ||
55 | // LogDebugWithSigning states that the SDK should log request signing and | ||
56 | // presigning events. This should be used to log the signing details of | ||
57 | // requests for debugging. Will also enable LogDebug. | ||
58 | LogDebugWithSigning LogLevelType = LogDebug | (1 << iota) | ||
59 | |||
60 | // LogDebugWithHTTPBody states the SDK should log HTTP request and response | ||
61 | // HTTP bodys in addition to the headers and path. This should be used to | ||
62 | // see the body content of requests and responses made while using the SDK | ||
63 | // Will also enable LogDebug. | ||
64 | LogDebugWithHTTPBody | ||
65 | |||
66 | // LogDebugWithRequestRetries states the SDK should log when service requests will | ||
67 | // be retried. This should be used to log when you want to log when service | ||
68 | // requests are being retried. Will also enable LogDebug. | ||
69 | LogDebugWithRequestRetries | ||
70 | |||
71 | // LogDebugWithRequestErrors states the SDK should log when service requests fail | ||
72 | // to build, send, validate, or unmarshal. | ||
73 | LogDebugWithRequestErrors | ||
74 | ) | ||
75 | |||
76 | // A Logger is a minimalistic interface for the SDK to log messages to. Should | ||
77 | // be used to provide custom logging writers for the SDK to use. | ||
78 | type Logger interface { | ||
79 | Log(...interface{}) | ||
80 | } | ||
81 | |||
82 | // A LoggerFunc is a convenience type to convert a function taking a variadic | ||
83 | // list of arguments and wrap it so the Logger interface can be used. | ||
84 | // | ||
85 | // Example: | ||
86 | // s3.New(sess, &aws.Config{Logger: aws.LoggerFunc(func(args ...interface{}) { | ||
87 | // fmt.Fprintln(os.Stdout, args...) | ||
88 | // })}) | ||
89 | type LoggerFunc func(...interface{}) | ||
90 | |||
91 | // Log calls the wrapped function with the arguments provided | ||
92 | func (f LoggerFunc) Log(args ...interface{}) { | ||
93 | f(args...) | ||
94 | } | ||
95 | |||
96 | // NewDefaultLogger returns a Logger which will write log messages to stdout, and | ||
97 | // use same formatting runes as the stdlib log.Logger | ||
98 | func NewDefaultLogger() Logger { | ||
99 | return &defaultLogger{ | ||
100 | logger: log.New(os.Stdout, "", log.LstdFlags), | ||
101 | } | ||
102 | } | ||
103 | |||
104 | // A defaultLogger provides a minimalistic logger satisfying the Logger interface. | ||
105 | type defaultLogger struct { | ||
106 | logger *log.Logger | ||
107 | } | ||
108 | |||
109 | // Log logs the parameters to the stdlib logger. See log.Println. | ||
110 | func (l defaultLogger) Log(args ...interface{}) { | ||
111 | l.logger.Println(args...) | ||
112 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error.go b/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error.go new file mode 100644 index 0000000..10fc8cb --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error.go | |||
@@ -0,0 +1,19 @@ | |||
1 | // +build !appengine | ||
2 | |||
3 | package request | ||
4 | |||
5 | import ( | ||
6 | "net" | ||
7 | "os" | ||
8 | "syscall" | ||
9 | ) | ||
10 | |||
11 | func isErrConnectionReset(err error) bool { | ||
12 | if opErr, ok := err.(*net.OpError); ok { | ||
13 | if sysErr, ok := opErr.Err.(*os.SyscallError); ok { | ||
14 | return sysErr.Err == syscall.ECONNRESET | ||
15 | } | ||
16 | } | ||
17 | |||
18 | return false | ||
19 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error_appengine.go b/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error_appengine.go new file mode 100644 index 0000000..996196e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error_appengine.go | |||
@@ -0,0 +1,11 @@ | |||
1 | // +build appengine | ||
2 | |||
3 | package request | ||
4 | |||
5 | import ( | ||
6 | "strings" | ||
7 | ) | ||
8 | |||
9 | func isErrConnectionReset(err error) bool { | ||
10 | return strings.Contains(err.Error(), "connection reset") | ||
11 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/handlers.go b/vendor/github.com/aws/aws-sdk-go/aws/request/handlers.go new file mode 100644 index 0000000..6c14336 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/handlers.go | |||
@@ -0,0 +1,225 @@ | |||
1 | package request | ||
2 | |||
3 | import ( | ||
4 | "fmt" | ||
5 | "strings" | ||
6 | ) | ||
7 | |||
8 | // A Handlers provides a collection of request handlers for various | ||
9 | // stages of handling requests. | ||
10 | type Handlers struct { | ||
11 | Validate HandlerList | ||
12 | Build HandlerList | ||
13 | Sign HandlerList | ||
14 | Send HandlerList | ||
15 | ValidateResponse HandlerList | ||
16 | Unmarshal HandlerList | ||
17 | UnmarshalMeta HandlerList | ||
18 | UnmarshalError HandlerList | ||
19 | Retry HandlerList | ||
20 | AfterRetry HandlerList | ||
21 | Complete HandlerList | ||
22 | } | ||
23 | |||
24 | // Copy returns of this handler's lists. | ||
25 | func (h *Handlers) Copy() Handlers { | ||
26 | return Handlers{ | ||
27 | Validate: h.Validate.copy(), | ||
28 | Build: h.Build.copy(), | ||
29 | Sign: h.Sign.copy(), | ||
30 | Send: h.Send.copy(), | ||
31 | ValidateResponse: h.ValidateResponse.copy(), | ||
32 | Unmarshal: h.Unmarshal.copy(), | ||
33 | UnmarshalError: h.UnmarshalError.copy(), | ||
34 | UnmarshalMeta: h.UnmarshalMeta.copy(), | ||
35 | Retry: h.Retry.copy(), | ||
36 | AfterRetry: h.AfterRetry.copy(), | ||
37 | Complete: h.Complete.copy(), | ||
38 | } | ||
39 | } | ||
40 | |||
41 | // Clear removes callback functions for all handlers | ||
42 | func (h *Handlers) Clear() { | ||
43 | h.Validate.Clear() | ||
44 | h.Build.Clear() | ||
45 | h.Send.Clear() | ||
46 | h.Sign.Clear() | ||
47 | h.Unmarshal.Clear() | ||
48 | h.UnmarshalMeta.Clear() | ||
49 | h.UnmarshalError.Clear() | ||
50 | h.ValidateResponse.Clear() | ||
51 | h.Retry.Clear() | ||
52 | h.AfterRetry.Clear() | ||
53 | h.Complete.Clear() | ||
54 | } | ||
55 | |||
56 | // A HandlerListRunItem represents an entry in the HandlerList which | ||
57 | // is being run. | ||
58 | type HandlerListRunItem struct { | ||
59 | Index int | ||
60 | Handler NamedHandler | ||
61 | Request *Request | ||
62 | } | ||
63 | |||
64 | // A HandlerList manages zero or more handlers in a list. | ||
65 | type HandlerList struct { | ||
66 | list []NamedHandler | ||
67 | |||
68 | // Called after each request handler in the list is called. If set | ||
69 | // and the func returns true the HandlerList will continue to iterate | ||
70 | // over the request handlers. If false is returned the HandlerList | ||
71 | // will stop iterating. | ||
72 | // | ||
73 | // Should be used if extra logic to be performed between each handler | ||
74 | // in the list. This can be used to terminate a list's iteration | ||
75 | // based on a condition such as error like, HandlerListStopOnError. | ||
76 | // Or for logging like HandlerListLogItem. | ||
77 | AfterEachFn func(item HandlerListRunItem) bool | ||
78 | } | ||
79 | |||
80 | // A NamedHandler is a struct that contains a name and function callback. | ||
81 | type NamedHandler struct { | ||
82 | Name string | ||
83 | Fn func(*Request) | ||
84 | } | ||
85 | |||
86 | // copy creates a copy of the handler list. | ||
87 | func (l *HandlerList) copy() HandlerList { | ||
88 | n := HandlerList{ | ||
89 | AfterEachFn: l.AfterEachFn, | ||
90 | } | ||
91 | if len(l.list) == 0 { | ||
92 | return n | ||
93 | } | ||
94 | |||
95 | n.list = append(make([]NamedHandler, 0, len(l.list)), l.list...) | ||
96 | return n | ||
97 | } | ||
98 | |||
99 | // Clear clears the handler list. | ||
100 | func (l *HandlerList) Clear() { | ||
101 | l.list = l.list[0:0] | ||
102 | } | ||
103 | |||
104 | // Len returns the number of handlers in the list. | ||
105 | func (l *HandlerList) Len() int { | ||
106 | return len(l.list) | ||
107 | } | ||
108 | |||
109 | // PushBack pushes handler f to the back of the handler list. | ||
110 | func (l *HandlerList) PushBack(f func(*Request)) { | ||
111 | l.PushBackNamed(NamedHandler{"__anonymous", f}) | ||
112 | } | ||
113 | |||
114 | // PushBackNamed pushes named handler f to the back of the handler list. | ||
115 | func (l *HandlerList) PushBackNamed(n NamedHandler) { | ||
116 | if cap(l.list) == 0 { | ||
117 | l.list = make([]NamedHandler, 0, 5) | ||
118 | } | ||
119 | l.list = append(l.list, n) | ||
120 | } | ||
121 | |||
122 | // PushFront pushes handler f to the front of the handler list. | ||
123 | func (l *HandlerList) PushFront(f func(*Request)) { | ||
124 | l.PushFrontNamed(NamedHandler{"__anonymous", f}) | ||
125 | } | ||
126 | |||
127 | // PushFrontNamed pushes named handler f to the front of the handler list. | ||
128 | func (l *HandlerList) PushFrontNamed(n NamedHandler) { | ||
129 | if cap(l.list) == len(l.list) { | ||
130 | // Allocating new list required | ||
131 | l.list = append([]NamedHandler{n}, l.list...) | ||
132 | } else { | ||
133 | // Enough room to prepend into list. | ||
134 | l.list = append(l.list, NamedHandler{}) | ||
135 | copy(l.list[1:], l.list) | ||
136 | l.list[0] = n | ||
137 | } | ||
138 | } | ||
139 | |||
140 | // Remove removes a NamedHandler n | ||
141 | func (l *HandlerList) Remove(n NamedHandler) { | ||
142 | l.RemoveByName(n.Name) | ||
143 | } | ||
144 | |||
145 | // RemoveByName removes a NamedHandler by name. | ||
146 | func (l *HandlerList) RemoveByName(name string) { | ||
147 | for i := 0; i < len(l.list); i++ { | ||
148 | m := l.list[i] | ||
149 | if m.Name == name { | ||
150 | // Shift array preventing creating new arrays | ||
151 | copy(l.list[i:], l.list[i+1:]) | ||
152 | l.list[len(l.list)-1] = NamedHandler{} | ||
153 | l.list = l.list[:len(l.list)-1] | ||
154 | |||
155 | // decrement list so next check to length is correct | ||
156 | i-- | ||
157 | } | ||
158 | } | ||
159 | } | ||
160 | |||
161 | // Run executes all handlers in the list with a given request object. | ||
162 | func (l *HandlerList) Run(r *Request) { | ||
163 | for i, h := range l.list { | ||
164 | h.Fn(r) | ||
165 | item := HandlerListRunItem{ | ||
166 | Index: i, Handler: h, Request: r, | ||
167 | } | ||
168 | if l.AfterEachFn != nil && !l.AfterEachFn(item) { | ||
169 | return | ||
170 | } | ||
171 | } | ||
172 | } | ||
173 | |||
174 | // HandlerListLogItem logs the request handler and the state of the | ||
175 | // request's Error value. Always returns true to continue iterating | ||
176 | // request handlers in a HandlerList. | ||
177 | func HandlerListLogItem(item HandlerListRunItem) bool { | ||
178 | if item.Request.Config.Logger == nil { | ||
179 | return true | ||
180 | } | ||
181 | item.Request.Config.Logger.Log("DEBUG: RequestHandler", | ||
182 | item.Index, item.Handler.Name, item.Request.Error) | ||
183 | |||
184 | return true | ||
185 | } | ||
186 | |||
187 | // HandlerListStopOnError returns false to stop the HandlerList iterating | ||
188 | // over request handlers if Request.Error is not nil. True otherwise | ||
189 | // to continue iterating. | ||
190 | func HandlerListStopOnError(item HandlerListRunItem) bool { | ||
191 | return item.Request.Error == nil | ||
192 | } | ||
193 | |||
194 | // WithAppendUserAgent will add a string to the user agent prefixed with a | ||
195 | // single white space. | ||
196 | func WithAppendUserAgent(s string) Option { | ||
197 | return func(r *Request) { | ||
198 | r.Handlers.Build.PushBack(func(r2 *Request) { | ||
199 | AddToUserAgent(r, s) | ||
200 | }) | ||
201 | } | ||
202 | } | ||
203 | |||
204 | // MakeAddToUserAgentHandler will add the name/version pair to the User-Agent request | ||
205 | // header. If the extra parameters are provided they will be added as metadata to the | ||
206 | // name/version pair resulting in the following format. | ||
207 | // "name/version (extra0; extra1; ...)" | ||
208 | // The user agent part will be concatenated with this current request's user agent string. | ||
209 | func MakeAddToUserAgentHandler(name, version string, extra ...string) func(*Request) { | ||
210 | ua := fmt.Sprintf("%s/%s", name, version) | ||
211 | if len(extra) > 0 { | ||
212 | ua += fmt.Sprintf(" (%s)", strings.Join(extra, "; ")) | ||
213 | } | ||
214 | return func(r *Request) { | ||
215 | AddToUserAgent(r, ua) | ||
216 | } | ||
217 | } | ||
218 | |||
219 | // MakeAddToUserAgentFreeFormHandler adds the input to the User-Agent request header. | ||
220 | // The input string will be concatenated with the current request's user agent string. | ||
221 | func MakeAddToUserAgentFreeFormHandler(s string) func(*Request) { | ||
222 | return func(r *Request) { | ||
223 | AddToUserAgent(r, s) | ||
224 | } | ||
225 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/http_request.go b/vendor/github.com/aws/aws-sdk-go/aws/request/http_request.go new file mode 100644 index 0000000..79f7960 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/http_request.go | |||
@@ -0,0 +1,24 @@ | |||
1 | package request | ||
2 | |||
3 | import ( | ||
4 | "io" | ||
5 | "net/http" | ||
6 | "net/url" | ||
7 | ) | ||
8 | |||
9 | func copyHTTPRequest(r *http.Request, body io.ReadCloser) *http.Request { | ||
10 | req := new(http.Request) | ||
11 | *req = *r | ||
12 | req.URL = &url.URL{} | ||
13 | *req.URL = *r.URL | ||
14 | req.Body = body | ||
15 | |||
16 | req.Header = http.Header{} | ||
17 | for k, v := range r.Header { | ||
18 | for _, vv := range v { | ||
19 | req.Header.Add(k, vv) | ||
20 | } | ||
21 | } | ||
22 | |||
23 | return req | ||
24 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/offset_reader.go b/vendor/github.com/aws/aws-sdk-go/aws/request/offset_reader.go new file mode 100644 index 0000000..02f07f4 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/offset_reader.go | |||
@@ -0,0 +1,58 @@ | |||
1 | package request | ||
2 | |||
3 | import ( | ||
4 | "io" | ||
5 | "sync" | ||
6 | ) | ||
7 | |||
8 | // offsetReader is a thread-safe io.ReadCloser to prevent racing | ||
9 | // with retrying requests | ||
10 | type offsetReader struct { | ||
11 | buf io.ReadSeeker | ||
12 | lock sync.Mutex | ||
13 | closed bool | ||
14 | } | ||
15 | |||
16 | func newOffsetReader(buf io.ReadSeeker, offset int64) *offsetReader { | ||
17 | reader := &offsetReader{} | ||
18 | buf.Seek(offset, 0) | ||
19 | |||
20 | reader.buf = buf | ||
21 | return reader | ||
22 | } | ||
23 | |||
24 | // Close will close the instance of the offset reader's access to | ||
25 | // the underlying io.ReadSeeker. | ||
26 | func (o *offsetReader) Close() error { | ||
27 | o.lock.Lock() | ||
28 | defer o.lock.Unlock() | ||
29 | o.closed = true | ||
30 | return nil | ||
31 | } | ||
32 | |||
33 | // Read is a thread-safe read of the underlying io.ReadSeeker | ||
34 | func (o *offsetReader) Read(p []byte) (int, error) { | ||
35 | o.lock.Lock() | ||
36 | defer o.lock.Unlock() | ||
37 | |||
38 | if o.closed { | ||
39 | return 0, io.EOF | ||
40 | } | ||
41 | |||
42 | return o.buf.Read(p) | ||
43 | } | ||
44 | |||
45 | // Seek is a thread-safe seeking operation. | ||
46 | func (o *offsetReader) Seek(offset int64, whence int) (int64, error) { | ||
47 | o.lock.Lock() | ||
48 | defer o.lock.Unlock() | ||
49 | |||
50 | return o.buf.Seek(offset, whence) | ||
51 | } | ||
52 | |||
53 | // CloseAndCopy will return a new offsetReader with a copy of the old buffer | ||
54 | // and close the old buffer. | ||
55 | func (o *offsetReader) CloseAndCopy(offset int64) *offsetReader { | ||
56 | o.Close() | ||
57 | return newOffsetReader(o.buf, offset) | ||
58 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/request.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request.go new file mode 100644 index 0000000..4f4f112 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/request.go | |||
@@ -0,0 +1,575 @@ | |||
1 | package request | ||
2 | |||
3 | import ( | ||
4 | "bytes" | ||
5 | "fmt" | ||
6 | "io" | ||
7 | "net" | ||
8 | "net/http" | ||
9 | "net/url" | ||
10 | "reflect" | ||
11 | "strings" | ||
12 | "time" | ||
13 | |||
14 | "github.com/aws/aws-sdk-go/aws" | ||
15 | "github.com/aws/aws-sdk-go/aws/awserr" | ||
16 | "github.com/aws/aws-sdk-go/aws/client/metadata" | ||
17 | ) | ||
18 | |||
19 | const ( | ||
20 | // ErrCodeSerialization is the serialization error code that is received | ||
21 | // during protocol unmarshaling. | ||
22 | ErrCodeSerialization = "SerializationError" | ||
23 | |||
24 | // ErrCodeRead is an error that is returned during HTTP reads. | ||
25 | ErrCodeRead = "ReadError" | ||
26 | |||
27 | // ErrCodeResponseTimeout is the connection timeout error that is recieved | ||
28 | // during body reads. | ||
29 | ErrCodeResponseTimeout = "ResponseTimeout" | ||
30 | |||
31 | // CanceledErrorCode is the error code that will be returned by an | ||
32 | // API request that was canceled. Requests given a aws.Context may | ||
33 | // return this error when canceled. | ||
34 | CanceledErrorCode = "RequestCanceled" | ||
35 | ) | ||
36 | |||
37 | // A Request is the service request to be made. | ||
38 | type Request struct { | ||
39 | Config aws.Config | ||
40 | ClientInfo metadata.ClientInfo | ||
41 | Handlers Handlers | ||
42 | |||
43 | Retryer | ||
44 | Time time.Time | ||
45 | ExpireTime time.Duration | ||
46 | Operation *Operation | ||
47 | HTTPRequest *http.Request | ||
48 | HTTPResponse *http.Response | ||
49 | Body io.ReadSeeker | ||
50 | BodyStart int64 // offset from beginning of Body that the request body starts | ||
51 | Params interface{} | ||
52 | Error error | ||
53 | Data interface{} | ||
54 | RequestID string | ||
55 | RetryCount int | ||
56 | Retryable *bool | ||
57 | RetryDelay time.Duration | ||
58 | NotHoist bool | ||
59 | SignedHeaderVals http.Header | ||
60 | LastSignedAt time.Time | ||
61 | DisableFollowRedirects bool | ||
62 | |||
63 | context aws.Context | ||
64 | |||
65 | built bool | ||
66 | |||
67 | // Need to persist an intermediate body between the input Body and HTTP | ||
68 | // request body because the HTTP Client's transport can maintain a reference | ||
69 | // to the HTTP request's body after the client has returned. This value is | ||
70 | // safe to use concurrently and wrap the input Body for each HTTP request. | ||
71 | safeBody *offsetReader | ||
72 | } | ||
73 | |||
74 | // An Operation is the service API operation to be made. | ||
75 | type Operation struct { | ||
76 | Name string | ||
77 | HTTPMethod string | ||
78 | HTTPPath string | ||
79 | *Paginator | ||
80 | |||
81 | BeforePresignFn func(r *Request) error | ||
82 | } | ||
83 | |||
84 | // New returns a new Request pointer for the service API | ||
85 | // operation and parameters. | ||
86 | // | ||
87 | // Params is any value of input parameters to be the request payload. | ||
88 | // Data is pointer value to an object which the request's response | ||
89 | // payload will be deserialized to. | ||
90 | func New(cfg aws.Config, clientInfo metadata.ClientInfo, handlers Handlers, | ||
91 | retryer Retryer, operation *Operation, params interface{}, data interface{}) *Request { | ||
92 | |||
93 | method := operation.HTTPMethod | ||
94 | if method == "" { | ||
95 | method = "POST" | ||
96 | } | ||
97 | |||
98 | httpReq, _ := http.NewRequest(method, "", nil) | ||
99 | |||
100 | var err error | ||
101 | httpReq.URL, err = url.Parse(clientInfo.Endpoint + operation.HTTPPath) | ||
102 | if err != nil { | ||
103 | httpReq.URL = &url.URL{} | ||
104 | err = awserr.New("InvalidEndpointURL", "invalid endpoint uri", err) | ||
105 | } | ||
106 | |||
107 | r := &Request{ | ||
108 | Config: cfg, | ||
109 | ClientInfo: clientInfo, | ||
110 | Handlers: handlers.Copy(), | ||
111 | |||
112 | Retryer: retryer, | ||
113 | Time: time.Now(), | ||
114 | ExpireTime: 0, | ||
115 | Operation: operation, | ||
116 | HTTPRequest: httpReq, | ||
117 | Body: nil, | ||
118 | Params: params, | ||
119 | Error: err, | ||
120 | Data: data, | ||
121 | } | ||
122 | r.SetBufferBody([]byte{}) | ||
123 | |||
124 | return r | ||
125 | } | ||
126 | |||
127 | // A Option is a functional option that can augment or modify a request when | ||
128 | // using a WithContext API operation method. | ||
129 | type Option func(*Request) | ||
130 | |||
131 | // WithGetResponseHeader builds a request Option which will retrieve a single | ||
132 | // header value from the HTTP Response. If there are multiple values for the | ||
133 | // header key use WithGetResponseHeaders instead to access the http.Header | ||
134 | // map directly. The passed in val pointer must be non-nil. | ||
135 | // | ||
136 | // This Option can be used multiple times with a single API operation. | ||
137 | // | ||
138 | // var id2, versionID string | ||
139 | // svc.PutObjectWithContext(ctx, params, | ||
140 | // request.WithGetResponseHeader("x-amz-id-2", &id2), | ||
141 | // request.WithGetResponseHeader("x-amz-version-id", &versionID), | ||
142 | // ) | ||
143 | func WithGetResponseHeader(key string, val *string) Option { | ||
144 | return func(r *Request) { | ||
145 | r.Handlers.Complete.PushBack(func(req *Request) { | ||
146 | *val = req.HTTPResponse.Header.Get(key) | ||
147 | }) | ||
148 | } | ||
149 | } | ||
150 | |||
151 | // WithGetResponseHeaders builds a request Option which will retrieve the | ||
152 | // headers from the HTTP response and assign them to the passed in headers | ||
153 | // variable. The passed in headers pointer must be non-nil. | ||
154 | // | ||
155 | // var headers http.Header | ||
156 | // svc.PutObjectWithContext(ctx, params, request.WithGetResponseHeaders(&headers)) | ||
157 | func WithGetResponseHeaders(headers *http.Header) Option { | ||
158 | return func(r *Request) { | ||
159 | r.Handlers.Complete.PushBack(func(req *Request) { | ||
160 | *headers = req.HTTPResponse.Header | ||
161 | }) | ||
162 | } | ||
163 | } | ||
164 | |||
165 | // WithLogLevel is a request option that will set the request to use a specific | ||
166 | // log level when the request is made. | ||
167 | // | ||
168 | // svc.PutObjectWithContext(ctx, params, request.WithLogLevel(aws.LogDebugWithHTTPBody) | ||
169 | func WithLogLevel(l aws.LogLevelType) Option { | ||
170 | return func(r *Request) { | ||
171 | r.Config.LogLevel = aws.LogLevel(l) | ||
172 | } | ||
173 | } | ||
174 | |||
175 | // ApplyOptions will apply each option to the request calling them in the order | ||
176 | // the were provided. | ||
177 | func (r *Request) ApplyOptions(opts ...Option) { | ||
178 | for _, opt := range opts { | ||
179 | opt(r) | ||
180 | } | ||
181 | } | ||
182 | |||
183 | // Context will always returns a non-nil context. If Request does not have a | ||
184 | // context aws.BackgroundContext will be returned. | ||
185 | func (r *Request) Context() aws.Context { | ||
186 | if r.context != nil { | ||
187 | return r.context | ||
188 | } | ||
189 | return aws.BackgroundContext() | ||
190 | } | ||
191 | |||
192 | // SetContext adds a Context to the current request that can be used to cancel | ||
193 | // a in-flight request. The Context value must not be nil, or this method will | ||
194 | // panic. | ||
195 | // | ||
196 | // Unlike http.Request.WithContext, SetContext does not return a copy of the | ||
197 | // Request. It is not safe to use use a single Request value for multiple | ||
198 | // requests. A new Request should be created for each API operation request. | ||
199 | // | ||
200 | // Go 1.6 and below: | ||
201 | // The http.Request's Cancel field will be set to the Done() value of | ||
202 | // the context. This will overwrite the Cancel field's value. | ||
203 | // | ||
204 | // Go 1.7 and above: | ||
205 | // The http.Request.WithContext will be used to set the context on the underlying | ||
206 | // http.Request. This will create a shallow copy of the http.Request. The SDK | ||
207 | // may create sub contexts in the future for nested requests such as retries. | ||
208 | func (r *Request) SetContext(ctx aws.Context) { | ||
209 | if ctx == nil { | ||
210 | panic("context cannot be nil") | ||
211 | } | ||
212 | setRequestContext(r, ctx) | ||
213 | } | ||
214 | |||
215 | // WillRetry returns if the request's can be retried. | ||
216 | func (r *Request) WillRetry() bool { | ||
217 | return r.Error != nil && aws.BoolValue(r.Retryable) && r.RetryCount < r.MaxRetries() | ||
218 | } | ||
219 | |||
220 | // ParamsFilled returns if the request's parameters have been populated | ||
221 | // and the parameters are valid. False is returned if no parameters are | ||
222 | // provided or invalid. | ||
223 | func (r *Request) ParamsFilled() bool { | ||
224 | return r.Params != nil && reflect.ValueOf(r.Params).Elem().IsValid() | ||
225 | } | ||
226 | |||
227 | // DataFilled returns true if the request's data for response deserialization | ||
228 | // target has been set and is a valid. False is returned if data is not | ||
229 | // set, or is invalid. | ||
230 | func (r *Request) DataFilled() bool { | ||
231 | return r.Data != nil && reflect.ValueOf(r.Data).Elem().IsValid() | ||
232 | } | ||
233 | |||
234 | // SetBufferBody will set the request's body bytes that will be sent to | ||
235 | // the service API. | ||
236 | func (r *Request) SetBufferBody(buf []byte) { | ||
237 | r.SetReaderBody(bytes.NewReader(buf)) | ||
238 | } | ||
239 | |||
240 | // SetStringBody sets the body of the request to be backed by a string. | ||
241 | func (r *Request) SetStringBody(s string) { | ||
242 | r.SetReaderBody(strings.NewReader(s)) | ||
243 | } | ||
244 | |||
245 | // SetReaderBody will set the request's body reader. | ||
246 | func (r *Request) SetReaderBody(reader io.ReadSeeker) { | ||
247 | r.Body = reader | ||
248 | r.ResetBody() | ||
249 | } | ||
250 | |||
251 | // Presign returns the request's signed URL. Error will be returned | ||
252 | // if the signing fails. | ||
253 | func (r *Request) Presign(expireTime time.Duration) (string, error) { | ||
254 | r.ExpireTime = expireTime | ||
255 | r.NotHoist = false | ||
256 | |||
257 | if r.Operation.BeforePresignFn != nil { | ||
258 | r = r.copy() | ||
259 | err := r.Operation.BeforePresignFn(r) | ||
260 | if err != nil { | ||
261 | return "", err | ||
262 | } | ||
263 | } | ||
264 | |||
265 | r.Sign() | ||
266 | if r.Error != nil { | ||
267 | return "", r.Error | ||
268 | } | ||
269 | return r.HTTPRequest.URL.String(), nil | ||
270 | } | ||
271 | |||
272 | // PresignRequest behaves just like presign, but hoists all headers and signs them. | ||
273 | // Also returns the signed hash back to the user | ||
274 | func (r *Request) PresignRequest(expireTime time.Duration) (string, http.Header, error) { | ||
275 | r.ExpireTime = expireTime | ||
276 | r.NotHoist = true | ||
277 | r.Sign() | ||
278 | if r.Error != nil { | ||
279 | return "", nil, r.Error | ||
280 | } | ||
281 | return r.HTTPRequest.URL.String(), r.SignedHeaderVals, nil | ||
282 | } | ||
283 | |||
284 | func debugLogReqError(r *Request, stage string, retrying bool, err error) { | ||
285 | if !r.Config.LogLevel.Matches(aws.LogDebugWithRequestErrors) { | ||
286 | return | ||
287 | } | ||
288 | |||
289 | retryStr := "not retrying" | ||
290 | if retrying { | ||
291 | retryStr = "will retry" | ||
292 | } | ||
293 | |||
294 | r.Config.Logger.Log(fmt.Sprintf("DEBUG: %s %s/%s failed, %s, error %v", | ||
295 | stage, r.ClientInfo.ServiceName, r.Operation.Name, retryStr, err)) | ||
296 | } | ||
297 | |||
298 | // Build will build the request's object so it can be signed and sent | ||
299 | // to the service. Build will also validate all the request's parameters. | ||
300 | // Anny additional build Handlers set on this request will be run | ||
301 | // in the order they were set. | ||
302 | // | ||
303 | // The request will only be built once. Multiple calls to build will have | ||
304 | // no effect. | ||
305 | // | ||
306 | // If any Validate or Build errors occur the build will stop and the error | ||
307 | // which occurred will be returned. | ||
308 | func (r *Request) Build() error { | ||
309 | if !r.built { | ||
310 | r.Handlers.Validate.Run(r) | ||
311 | if r.Error != nil { | ||
312 | debugLogReqError(r, "Validate Request", false, r.Error) | ||
313 | return r.Error | ||
314 | } | ||
315 | r.Handlers.Build.Run(r) | ||
316 | if r.Error != nil { | ||
317 | debugLogReqError(r, "Build Request", false, r.Error) | ||
318 | return r.Error | ||
319 | } | ||
320 | r.built = true | ||
321 | } | ||
322 | |||
323 | return r.Error | ||
324 | } | ||
325 | |||
326 | // Sign will sign the request returning error if errors are encountered. | ||
327 | // | ||
328 | // Send will build the request prior to signing. All Sign Handlers will | ||
329 | // be executed in the order they were set. | ||
330 | func (r *Request) Sign() error { | ||
331 | r.Build() | ||
332 | if r.Error != nil { | ||
333 | debugLogReqError(r, "Build Request", false, r.Error) | ||
334 | return r.Error | ||
335 | } | ||
336 | |||
337 | r.Handlers.Sign.Run(r) | ||
338 | return r.Error | ||
339 | } | ||
340 | |||
341 | // ResetBody rewinds the request body backto its starting position, and | ||
342 | // set's the HTTP Request body reference. When the body is read prior | ||
343 | // to being sent in the HTTP request it will need to be rewound. | ||
344 | func (r *Request) ResetBody() { | ||
345 | if r.safeBody != nil { | ||
346 | r.safeBody.Close() | ||
347 | } | ||
348 | |||
349 | r.safeBody = newOffsetReader(r.Body, r.BodyStart) | ||
350 | |||
351 | // Go 1.8 tightened and clarified the rules code needs to use when building | ||
352 | // requests with the http package. Go 1.8 removed the automatic detection | ||
353 | // of if the Request.Body was empty, or actually had bytes in it. The SDK | ||
354 | // always sets the Request.Body even if it is empty and should not actually | ||
355 | // be sent. This is incorrect. | ||
356 | // | ||
357 | // Go 1.8 did add a http.NoBody value that the SDK can use to tell the http | ||
358 | // client that the request really should be sent without a body. The | ||
359 | // Request.Body cannot be set to nil, which is preferable, because the | ||
360 | // field is exported and could introduce nil pointer dereferences for users | ||
361 | // of the SDK if they used that field. | ||
362 | // | ||
363 | // Related golang/go#18257 | ||
364 | l, err := computeBodyLength(r.Body) | ||
365 | if err != nil { | ||
366 | r.Error = awserr.New(ErrCodeSerialization, "failed to compute request body size", err) | ||
367 | return | ||
368 | } | ||
369 | |||
370 | if l == 0 { | ||
371 | r.HTTPRequest.Body = noBodyReader | ||
372 | } else if l > 0 { | ||
373 | r.HTTPRequest.Body = r.safeBody | ||
374 | } else { | ||
375 | // Hack to prevent sending bodies for methods where the body | ||
376 | // should be ignored by the server. Sending bodies on these | ||
377 | // methods without an associated ContentLength will cause the | ||
378 | // request to socket timeout because the server does not handle | ||
379 | // Transfer-Encoding: chunked bodies for these methods. | ||
380 | // | ||
381 | // This would only happen if a aws.ReaderSeekerCloser was used with | ||
382 | // a io.Reader that was not also an io.Seeker. | ||
383 | switch r.Operation.HTTPMethod { | ||
384 | case "GET", "HEAD", "DELETE": | ||
385 | r.HTTPRequest.Body = noBodyReader | ||
386 | default: | ||
387 | r.HTTPRequest.Body = r.safeBody | ||
388 | } | ||
389 | } | ||
390 | } | ||
391 | |||
392 | // Attempts to compute the length of the body of the reader using the | ||
393 | // io.Seeker interface. If the value is not seekable because of being | ||
394 | // a ReaderSeekerCloser without an unerlying Seeker -1 will be returned. | ||
395 | // If no error occurs the length of the body will be returned. | ||
396 | func computeBodyLength(r io.ReadSeeker) (int64, error) { | ||
397 | seekable := true | ||
398 | // Determine if the seeker is actually seekable. ReaderSeekerCloser | ||
399 | // hides the fact that a io.Readers might not actually be seekable. | ||
400 | switch v := r.(type) { | ||
401 | case aws.ReaderSeekerCloser: | ||
402 | seekable = v.IsSeeker() | ||
403 | case *aws.ReaderSeekerCloser: | ||
404 | seekable = v.IsSeeker() | ||
405 | } | ||
406 | if !seekable { | ||
407 | return -1, nil | ||
408 | } | ||
409 | |||
410 | curOffset, err := r.Seek(0, 1) | ||
411 | if err != nil { | ||
412 | return 0, err | ||
413 | } | ||
414 | |||
415 | endOffset, err := r.Seek(0, 2) | ||
416 | if err != nil { | ||
417 | return 0, err | ||
418 | } | ||
419 | |||
420 | _, err = r.Seek(curOffset, 0) | ||
421 | if err != nil { | ||
422 | return 0, err | ||
423 | } | ||
424 | |||
425 | return endOffset - curOffset, nil | ||
426 | } | ||
427 | |||
428 | // GetBody will return an io.ReadSeeker of the Request's underlying | ||
429 | // input body with a concurrency safe wrapper. | ||
430 | func (r *Request) GetBody() io.ReadSeeker { | ||
431 | return r.safeBody | ||
432 | } | ||
433 | |||
434 | // Send will send the request returning error if errors are encountered. | ||
435 | // | ||
436 | // Send will sign the request prior to sending. All Send Handlers will | ||
437 | // be executed in the order they were set. | ||
438 | // | ||
439 | // Canceling a request is non-deterministic. If a request has been canceled, | ||
440 | // then the transport will choose, randomly, one of the state channels during | ||
441 | // reads or getting the connection. | ||
442 | // | ||
443 | // readLoop() and getConn(req *Request, cm connectMethod) | ||
444 | // https://github.com/golang/go/blob/master/src/net/http/transport.go | ||
445 | // | ||
446 | // Send will not close the request.Request's body. | ||
447 | func (r *Request) Send() error { | ||
448 | defer func() { | ||
449 | // Regardless of success or failure of the request trigger the Complete | ||
450 | // request handlers. | ||
451 | r.Handlers.Complete.Run(r) | ||
452 | }() | ||
453 | |||
454 | for { | ||
455 | if aws.BoolValue(r.Retryable) { | ||
456 | if r.Config.LogLevel.Matches(aws.LogDebugWithRequestRetries) { | ||
457 | r.Config.Logger.Log(fmt.Sprintf("DEBUG: Retrying Request %s/%s, attempt %d", | ||
458 | r.ClientInfo.ServiceName, r.Operation.Name, r.RetryCount)) | ||
459 | } | ||
460 | |||
461 | // The previous http.Request will have a reference to the r.Body | ||
462 | // and the HTTP Client's Transport may still be reading from | ||
463 | // the request's body even though the Client's Do returned. | ||
464 | r.HTTPRequest = copyHTTPRequest(r.HTTPRequest, nil) | ||
465 | r.ResetBody() | ||
466 | |||
467 | // Closing response body to ensure that no response body is leaked | ||
468 | // between retry attempts. | ||
469 | if r.HTTPResponse != nil && r.HTTPResponse.Body != nil { | ||
470 | r.HTTPResponse.Body.Close() | ||
471 | } | ||
472 | } | ||
473 | |||
474 | r.Sign() | ||
475 | if r.Error != nil { | ||
476 | return r.Error | ||
477 | } | ||
478 | |||
479 | r.Retryable = nil | ||
480 | |||
481 | r.Handlers.Send.Run(r) | ||
482 | if r.Error != nil { | ||
483 | if !shouldRetryCancel(r) { | ||
484 | return r.Error | ||
485 | } | ||
486 | |||
487 | err := r.Error | ||
488 | r.Handlers.Retry.Run(r) | ||
489 | r.Handlers.AfterRetry.Run(r) | ||
490 | if r.Error != nil { | ||
491 | debugLogReqError(r, "Send Request", false, r.Error) | ||
492 | return r.Error | ||
493 | } | ||
494 | debugLogReqError(r, "Send Request", true, err) | ||
495 | continue | ||
496 | } | ||
497 | r.Handlers.UnmarshalMeta.Run(r) | ||
498 | r.Handlers.ValidateResponse.Run(r) | ||
499 | if r.Error != nil { | ||
500 | err := r.Error | ||
501 | r.Handlers.UnmarshalError.Run(r) | ||
502 | r.Handlers.Retry.Run(r) | ||
503 | r.Handlers.AfterRetry.Run(r) | ||
504 | if r.Error != nil { | ||
505 | debugLogReqError(r, "Validate Response", false, r.Error) | ||
506 | return r.Error | ||
507 | } | ||
508 | debugLogReqError(r, "Validate Response", true, err) | ||
509 | continue | ||
510 | } | ||
511 | |||
512 | r.Handlers.Unmarshal.Run(r) | ||
513 | if r.Error != nil { | ||
514 | err := r.Error | ||
515 | r.Handlers.Retry.Run(r) | ||
516 | r.Handlers.AfterRetry.Run(r) | ||
517 | if r.Error != nil { | ||
518 | debugLogReqError(r, "Unmarshal Response", false, r.Error) | ||
519 | return r.Error | ||
520 | } | ||
521 | debugLogReqError(r, "Unmarshal Response", true, err) | ||
522 | continue | ||
523 | } | ||
524 | |||
525 | break | ||
526 | } | ||
527 | |||
528 | return nil | ||
529 | } | ||
530 | |||
531 | // copy will copy a request which will allow for local manipulation of the | ||
532 | // request. | ||
533 | func (r *Request) copy() *Request { | ||
534 | req := &Request{} | ||
535 | *req = *r | ||
536 | req.Handlers = r.Handlers.Copy() | ||
537 | op := *r.Operation | ||
538 | req.Operation = &op | ||
539 | return req | ||
540 | } | ||
541 | |||
542 | // AddToUserAgent adds the string to the end of the request's current user agent. | ||
543 | func AddToUserAgent(r *Request, s string) { | ||
544 | curUA := r.HTTPRequest.Header.Get("User-Agent") | ||
545 | if len(curUA) > 0 { | ||
546 | s = curUA + " " + s | ||
547 | } | ||
548 | r.HTTPRequest.Header.Set("User-Agent", s) | ||
549 | } | ||
550 | |||
551 | func shouldRetryCancel(r *Request) bool { | ||
552 | awsErr, ok := r.Error.(awserr.Error) | ||
553 | timeoutErr := false | ||
554 | errStr := r.Error.Error() | ||
555 | if ok { | ||
556 | if awsErr.Code() == CanceledErrorCode { | ||
557 | return false | ||
558 | } | ||
559 | err := awsErr.OrigErr() | ||
560 | netErr, netOK := err.(net.Error) | ||
561 | timeoutErr = netOK && netErr.Temporary() | ||
562 | if urlErr, ok := err.(*url.Error); !timeoutErr && ok { | ||
563 | errStr = urlErr.Err.Error() | ||
564 | } | ||
565 | } | ||
566 | |||
567 | // There can be two types of canceled errors here. | ||
568 | // The first being a net.Error and the other being an error. | ||
569 | // If the request was timed out, we want to continue the retry | ||
570 | // process. Otherwise, return the canceled error. | ||
571 | return timeoutErr || | ||
572 | (errStr != "net/http: request canceled" && | ||
573 | errStr != "net/http: request canceled while waiting for connection") | ||
574 | |||
575 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_7.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_7.go new file mode 100644 index 0000000..1323af9 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_7.go | |||
@@ -0,0 +1,21 @@ | |||
1 | // +build !go1.8 | ||
2 | |||
3 | package request | ||
4 | |||
5 | import "io" | ||
6 | |||
7 | // NoBody is an io.ReadCloser with no bytes. Read always returns EOF | ||
8 | // and Close always returns nil. It can be used in an outgoing client | ||
9 | // request to explicitly signal that a request has zero bytes. | ||
10 | // An alternative, however, is to simply set Request.Body to nil. | ||
11 | // | ||
12 | // Copy of Go 1.8 NoBody type from net/http/http.go | ||
13 | type noBody struct{} | ||
14 | |||
15 | func (noBody) Read([]byte) (int, error) { return 0, io.EOF } | ||
16 | func (noBody) Close() error { return nil } | ||
17 | func (noBody) WriteTo(io.Writer) (int64, error) { return 0, nil } | ||
18 | |||
19 | // Is an empty reader that will trigger the Go HTTP client to not include | ||
20 | // and body in the HTTP request. | ||
21 | var noBodyReader = noBody{} | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_8.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_8.go new file mode 100644 index 0000000..8b963f4 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_8.go | |||
@@ -0,0 +1,9 @@ | |||
1 | // +build go1.8 | ||
2 | |||
3 | package request | ||
4 | |||
5 | import "net/http" | ||
6 | |||
7 | // Is a http.NoBody reader instructing Go HTTP client to not include | ||
8 | // and body in the HTTP request. | ||
9 | var noBodyReader = http.NoBody | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/request_context.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request_context.go new file mode 100644 index 0000000..a7365cd --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/request_context.go | |||
@@ -0,0 +1,14 @@ | |||
1 | // +build go1.7 | ||
2 | |||
3 | package request | ||
4 | |||
5 | import "github.com/aws/aws-sdk-go/aws" | ||
6 | |||
7 | // setContext updates the Request to use the passed in context for cancellation. | ||
8 | // Context will also be used for request retry delay. | ||
9 | // | ||
10 | // Creates shallow copy of the http.Request with the WithContext method. | ||
11 | func setRequestContext(r *Request, ctx aws.Context) { | ||
12 | r.context = ctx | ||
13 | r.HTTPRequest = r.HTTPRequest.WithContext(ctx) | ||
14 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/request_context_1_6.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request_context_1_6.go new file mode 100644 index 0000000..307fa07 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/request_context_1_6.go | |||
@@ -0,0 +1,14 @@ | |||
1 | // +build !go1.7 | ||
2 | |||
3 | package request | ||
4 | |||
5 | import "github.com/aws/aws-sdk-go/aws" | ||
6 | |||
7 | // setContext updates the Request to use the passed in context for cancellation. | ||
8 | // Context will also be used for request retry delay. | ||
9 | // | ||
10 | // Creates shallow copy of the http.Request with the WithContext method. | ||
11 | func setRequestContext(r *Request, ctx aws.Context) { | ||
12 | r.context = ctx | ||
13 | r.HTTPRequest.Cancel = ctx.Done() | ||
14 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination.go new file mode 100644 index 0000000..59de673 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination.go | |||
@@ -0,0 +1,236 @@ | |||
1 | package request | ||
2 | |||
3 | import ( | ||
4 | "reflect" | ||
5 | "sync/atomic" | ||
6 | |||
7 | "github.com/aws/aws-sdk-go/aws" | ||
8 | "github.com/aws/aws-sdk-go/aws/awsutil" | ||
9 | ) | ||
10 | |||
11 | // A Pagination provides paginating of SDK API operations which are paginatable. | ||
12 | // Generally you should not use this type directly, but use the "Pages" API | ||
13 | // operations method to automatically perform pagination for you. Such as, | ||
14 | // "S3.ListObjectsPages", and "S3.ListObjectsPagesWithContext" methods. | ||
15 | // | ||
16 | // Pagination differs from a Paginator type in that pagination is the type that | ||
17 | // does the pagination between API operations, and Paginator defines the | ||
18 | // configuration that will be used per page request. | ||
19 | // | ||
20 | // cont := true | ||
21 | // for p.Next() && cont { | ||
22 | // data := p.Page().(*s3.ListObjectsOutput) | ||
23 | // // process the page's data | ||
24 | // } | ||
25 | // return p.Err() | ||
26 | // | ||
27 | // See service client API operation Pages methods for examples how the SDK will | ||
28 | // use the Pagination type. | ||
29 | type Pagination struct { | ||
30 | // Function to return a Request value for each pagination request. | ||
31 | // Any configuration or handlers that need to be applied to the request | ||
32 | // prior to getting the next page should be done here before the request | ||
33 | // returned. | ||
34 | // | ||
35 | // NewRequest should always be built from the same API operations. It is | ||
36 | // undefined if different API operations are returned on subsequent calls. | ||
37 | NewRequest func() (*Request, error) | ||
38 | |||
39 | started bool | ||
40 | nextTokens []interface{} | ||
41 | |||
42 | err error | ||
43 | curPage interface{} | ||
44 | } | ||
45 | |||
46 | // HasNextPage will return true if Pagination is able to determine that the API | ||
47 | // operation has additional pages. False will be returned if there are no more | ||
48 | // pages remaining. | ||
49 | // | ||
50 | // Will always return true if Next has not been called yet. | ||
51 | func (p *Pagination) HasNextPage() bool { | ||
52 | return !(p.started && len(p.nextTokens) == 0) | ||
53 | } | ||
54 | |||
55 | // Err returns the error Pagination encountered when retrieving the next page. | ||
56 | func (p *Pagination) Err() error { | ||
57 | return p.err | ||
58 | } | ||
59 | |||
60 | // Page returns the current page. Page should only be called after a successful | ||
61 | // call to Next. It is undefined what Page will return if Page is called after | ||
62 | // Next returns false. | ||
63 | func (p *Pagination) Page() interface{} { | ||
64 | return p.curPage | ||
65 | } | ||
66 | |||
67 | // Next will attempt to retrieve the next page for the API operation. When a page | ||
68 | // is retrieved true will be returned. If the page cannot be retrieved, or there | ||
69 | // are no more pages false will be returned. | ||
70 | // | ||
71 | // Use the Page method to retrieve the current page data. The data will need | ||
72 | // to be cast to the API operation's output type. | ||
73 | // | ||
74 | // Use the Err method to determine if an error occurred if Page returns false. | ||
75 | func (p *Pagination) Next() bool { | ||
76 | if !p.HasNextPage() { | ||
77 | return false | ||
78 | } | ||
79 | |||
80 | req, err := p.NewRequest() | ||
81 | if err != nil { | ||
82 | p.err = err | ||
83 | return false | ||
84 | } | ||
85 | |||
86 | if p.started { | ||
87 | for i, intok := range req.Operation.InputTokens { | ||
88 | awsutil.SetValueAtPath(req.Params, intok, p.nextTokens[i]) | ||
89 | } | ||
90 | } | ||
91 | p.started = true | ||
92 | |||
93 | err = req.Send() | ||
94 | if err != nil { | ||
95 | p.err = err | ||
96 | return false | ||
97 | } | ||
98 | |||
99 | p.nextTokens = req.nextPageTokens() | ||
100 | p.curPage = req.Data | ||
101 | |||
102 | return true | ||
103 | } | ||
104 | |||
105 | // A Paginator is the configuration data that defines how an API operation | ||
106 | // should be paginated. This type is used by the API service models to define | ||
107 | // the generated pagination config for service APIs. | ||
108 | // | ||
109 | // The Pagination type is what provides iterating between pages of an API. It | ||
110 | // is only used to store the token metadata the SDK should use for performing | ||
111 | // pagination. | ||
112 | type Paginator struct { | ||
113 | InputTokens []string | ||
114 | OutputTokens []string | ||
115 | LimitToken string | ||
116 | TruncationToken string | ||
117 | } | ||
118 | |||
119 | // nextPageTokens returns the tokens to use when asking for the next page of data. | ||
120 | func (r *Request) nextPageTokens() []interface{} { | ||
121 | if r.Operation.Paginator == nil { | ||
122 | return nil | ||
123 | } | ||
124 | if r.Operation.TruncationToken != "" { | ||
125 | tr, _ := awsutil.ValuesAtPath(r.Data, r.Operation.TruncationToken) | ||
126 | if len(tr) == 0 { | ||
127 | return nil | ||
128 | } | ||
129 | |||
130 | switch v := tr[0].(type) { | ||
131 | case *bool: | ||
132 | if !aws.BoolValue(v) { | ||
133 | return nil | ||
134 | } | ||
135 | case bool: | ||
136 | if v == false { | ||
137 | return nil | ||
138 | } | ||
139 | } | ||
140 | } | ||
141 | |||
142 | tokens := []interface{}{} | ||
143 | tokenAdded := false | ||
144 | for _, outToken := range r.Operation.OutputTokens { | ||
145 | v, _ := awsutil.ValuesAtPath(r.Data, outToken) | ||
146 | if len(v) > 0 { | ||
147 | tokens = append(tokens, v[0]) | ||
148 | tokenAdded = true | ||
149 | } else { | ||
150 | tokens = append(tokens, nil) | ||
151 | } | ||
152 | } | ||
153 | if !tokenAdded { | ||
154 | return nil | ||
155 | } | ||
156 | |||
157 | return tokens | ||
158 | } | ||
159 | |||
160 | // Ensure a deprecated item is only logged once instead of each time its used. | ||
161 | func logDeprecatedf(logger aws.Logger, flag *int32, msg string) { | ||
162 | if logger == nil { | ||
163 | return | ||
164 | } | ||
165 | if atomic.CompareAndSwapInt32(flag, 0, 1) { | ||
166 | logger.Log(msg) | ||
167 | } | ||
168 | } | ||
169 | |||
170 | var ( | ||
171 | logDeprecatedHasNextPage int32 | ||
172 | logDeprecatedNextPage int32 | ||
173 | logDeprecatedEachPage int32 | ||
174 | ) | ||
175 | |||
176 | // HasNextPage returns true if this request has more pages of data available. | ||
177 | // | ||
178 | // Deprecated Use Pagination type for configurable pagination of API operations | ||
179 | func (r *Request) HasNextPage() bool { | ||
180 | logDeprecatedf(r.Config.Logger, &logDeprecatedHasNextPage, | ||
181 | "Request.HasNextPage deprecated. Use Pagination type for configurable pagination of API operations") | ||
182 | |||
183 | return len(r.nextPageTokens()) > 0 | ||
184 | } | ||
185 | |||
186 | // NextPage returns a new Request that can be executed to return the next | ||
187 | // page of result data. Call .Send() on this request to execute it. | ||
188 | // | ||
189 | // Deprecated Use Pagination type for configurable pagination of API operations | ||
190 | func (r *Request) NextPage() *Request { | ||
191 | logDeprecatedf(r.Config.Logger, &logDeprecatedNextPage, | ||
192 | "Request.NextPage deprecated. Use Pagination type for configurable pagination of API operations") | ||
193 | |||
194 | tokens := r.nextPageTokens() | ||
195 | if len(tokens) == 0 { | ||
196 | return nil | ||
197 | } | ||
198 | |||
199 | data := reflect.New(reflect.TypeOf(r.Data).Elem()).Interface() | ||
200 | nr := New(r.Config, r.ClientInfo, r.Handlers, r.Retryer, r.Operation, awsutil.CopyOf(r.Params), data) | ||
201 | for i, intok := range nr.Operation.InputTokens { | ||
202 | awsutil.SetValueAtPath(nr.Params, intok, tokens[i]) | ||
203 | } | ||
204 | return nr | ||
205 | } | ||
206 | |||
207 | // EachPage iterates over each page of a paginated request object. The fn | ||
208 | // parameter should be a function with the following sample signature: | ||
209 | // | ||
210 | // func(page *T, lastPage bool) bool { | ||
211 | // return true // return false to stop iterating | ||
212 | // } | ||
213 | // | ||
214 | // Where "T" is the structure type matching the output structure of the given | ||
215 | // operation. For example, a request object generated by | ||
216 | // DynamoDB.ListTablesRequest() would expect to see dynamodb.ListTablesOutput | ||
217 | // as the structure "T". The lastPage value represents whether the page is | ||
218 | // the last page of data or not. The return value of this function should | ||
219 | // return true to keep iterating or false to stop. | ||
220 | // | ||
221 | // Deprecated Use Pagination type for configurable pagination of API operations | ||
222 | func (r *Request) EachPage(fn func(data interface{}, isLastPage bool) (shouldContinue bool)) error { | ||
223 | logDeprecatedf(r.Config.Logger, &logDeprecatedEachPage, | ||
224 | "Request.EachPage deprecated. Use Pagination type for configurable pagination of API operations") | ||
225 | |||
226 | for page := r; page != nil; page = page.NextPage() { | ||
227 | if err := page.Send(); err != nil { | ||
228 | return err | ||
229 | } | ||
230 | if getNextPage := fn(page.Data, !page.HasNextPage()); !getNextPage { | ||
231 | return page.Error | ||
232 | } | ||
233 | } | ||
234 | |||
235 | return nil | ||
236 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go b/vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go new file mode 100644 index 0000000..7af81de --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go | |||
@@ -0,0 +1,154 @@ | |||
1 | package request | ||
2 | |||
3 | import ( | ||
4 | "time" | ||
5 | |||
6 | "github.com/aws/aws-sdk-go/aws" | ||
7 | "github.com/aws/aws-sdk-go/aws/awserr" | ||
8 | ) | ||
9 | |||
10 | // Retryer is an interface to control retry logic for a given service. | ||
11 | // The default implementation used by most services is the service.DefaultRetryer | ||
12 | // structure, which contains basic retry logic using exponential backoff. | ||
13 | type Retryer interface { | ||
14 | RetryRules(*Request) time.Duration | ||
15 | ShouldRetry(*Request) bool | ||
16 | MaxRetries() int | ||
17 | } | ||
18 | |||
19 | // WithRetryer sets a config Retryer value to the given Config returning it | ||
20 | // for chaining. | ||
21 | func WithRetryer(cfg *aws.Config, retryer Retryer) *aws.Config { | ||
22 | cfg.Retryer = retryer | ||
23 | return cfg | ||
24 | } | ||
25 | |||
26 | // retryableCodes is a collection of service response codes which are retry-able | ||
27 | // without any further action. | ||
28 | var retryableCodes = map[string]struct{}{ | ||
29 | "RequestError": {}, | ||
30 | "RequestTimeout": {}, | ||
31 | ErrCodeResponseTimeout: {}, | ||
32 | "RequestTimeoutException": {}, // Glacier's flavor of RequestTimeout | ||
33 | } | ||
34 | |||
35 | var throttleCodes = map[string]struct{}{ | ||
36 | "ProvisionedThroughputExceededException": {}, | ||
37 | "Throttling": {}, | ||
38 | "ThrottlingException": {}, | ||
39 | "RequestLimitExceeded": {}, | ||
40 | "RequestThrottled": {}, | ||
41 | "LimitExceededException": {}, // Deleting 10+ DynamoDb tables at once | ||
42 | "TooManyRequestsException": {}, // Lambda functions | ||
43 | "PriorRequestNotComplete": {}, // Route53 | ||
44 | } | ||
45 | |||
46 | // credsExpiredCodes is a collection of error codes which signify the credentials | ||
47 | // need to be refreshed. Expired tokens require refreshing of credentials, and | ||
48 | // resigning before the request can be retried. | ||
49 | var credsExpiredCodes = map[string]struct{}{ | ||
50 | "ExpiredToken": {}, | ||
51 | "ExpiredTokenException": {}, | ||
52 | "RequestExpired": {}, // EC2 Only | ||
53 | } | ||
54 | |||
55 | func isCodeThrottle(code string) bool { | ||
56 | _, ok := throttleCodes[code] | ||
57 | return ok | ||
58 | } | ||
59 | |||
60 | func isCodeRetryable(code string) bool { | ||
61 | if _, ok := retryableCodes[code]; ok { | ||
62 | return true | ||
63 | } | ||
64 | |||
65 | return isCodeExpiredCreds(code) | ||
66 | } | ||
67 | |||
68 | func isCodeExpiredCreds(code string) bool { | ||
69 | _, ok := credsExpiredCodes[code] | ||
70 | return ok | ||
71 | } | ||
72 | |||
73 | var validParentCodes = map[string]struct{}{ | ||
74 | ErrCodeSerialization: struct{}{}, | ||
75 | ErrCodeRead: struct{}{}, | ||
76 | } | ||
77 | |||
78 | func isNestedErrorRetryable(parentErr awserr.Error) bool { | ||
79 | if parentErr == nil { | ||
80 | return false | ||
81 | } | ||
82 | |||
83 | if _, ok := validParentCodes[parentErr.Code()]; !ok { | ||
84 | return false | ||
85 | } | ||
86 | |||
87 | err := parentErr.OrigErr() | ||
88 | if err == nil { | ||
89 | return false | ||
90 | } | ||
91 | |||
92 | if aerr, ok := err.(awserr.Error); ok { | ||
93 | return isCodeRetryable(aerr.Code()) | ||
94 | } | ||
95 | |||
96 | return isErrConnectionReset(err) | ||
97 | } | ||
98 | |||
99 | // IsErrorRetryable returns whether the error is retryable, based on its Code. | ||
100 | // Returns false if error is nil. | ||
101 | func IsErrorRetryable(err error) bool { | ||
102 | if err != nil { | ||
103 | if aerr, ok := err.(awserr.Error); ok { | ||
104 | return isCodeRetryable(aerr.Code()) || isNestedErrorRetryable(aerr) | ||
105 | } | ||
106 | } | ||
107 | return false | ||
108 | } | ||
109 | |||
110 | // IsErrorThrottle returns whether the error is to be throttled based on its code. | ||
111 | // Returns false if error is nil. | ||
112 | func IsErrorThrottle(err error) bool { | ||
113 | if err != nil { | ||
114 | if aerr, ok := err.(awserr.Error); ok { | ||
115 | return isCodeThrottle(aerr.Code()) | ||
116 | } | ||
117 | } | ||
118 | return false | ||
119 | } | ||
120 | |||
121 | // IsErrorExpiredCreds returns whether the error code is a credential expiry error. | ||
122 | // Returns false if error is nil. | ||
123 | func IsErrorExpiredCreds(err error) bool { | ||
124 | if err != nil { | ||
125 | if aerr, ok := err.(awserr.Error); ok { | ||
126 | return isCodeExpiredCreds(aerr.Code()) | ||
127 | } | ||
128 | } | ||
129 | return false | ||
130 | } | ||
131 | |||
132 | // IsErrorRetryable returns whether the error is retryable, based on its Code. | ||
133 | // Returns false if the request has no Error set. | ||
134 | // | ||
135 | // Alias for the utility function IsErrorRetryable | ||
136 | func (r *Request) IsErrorRetryable() bool { | ||
137 | return IsErrorRetryable(r.Error) | ||
138 | } | ||
139 | |||
140 | // IsErrorThrottle returns whether the error is to be throttled based on its code. | ||
141 | // Returns false if the request has no Error set | ||
142 | // | ||
143 | // Alias for the utility function IsErrorThrottle | ||
144 | func (r *Request) IsErrorThrottle() bool { | ||
145 | return IsErrorThrottle(r.Error) | ||
146 | } | ||
147 | |||
148 | // IsErrorExpired returns whether the error code is a credential expiry error. | ||
149 | // Returns false if the request has no Error set. | ||
150 | // | ||
151 | // Alias for the utility function IsErrorExpiredCreds | ||
152 | func (r *Request) IsErrorExpired() bool { | ||
153 | return IsErrorExpiredCreds(r.Error) | ||
154 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/timeout_read_closer.go b/vendor/github.com/aws/aws-sdk-go/aws/request/timeout_read_closer.go new file mode 100644 index 0000000..09a44eb --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/timeout_read_closer.go | |||
@@ -0,0 +1,94 @@ | |||
1 | package request | ||
2 | |||
3 | import ( | ||
4 | "io" | ||
5 | "time" | ||
6 | |||
7 | "github.com/aws/aws-sdk-go/aws/awserr" | ||
8 | ) | ||
9 | |||
10 | var timeoutErr = awserr.New( | ||
11 | ErrCodeResponseTimeout, | ||
12 | "read on body has reached the timeout limit", | ||
13 | nil, | ||
14 | ) | ||
15 | |||
16 | type readResult struct { | ||
17 | n int | ||
18 | err error | ||
19 | } | ||
20 | |||
21 | // timeoutReadCloser will handle body reads that take too long. | ||
22 | // We will return a ErrReadTimeout error if a timeout occurs. | ||
23 | type timeoutReadCloser struct { | ||
24 | reader io.ReadCloser | ||
25 | duration time.Duration | ||
26 | } | ||
27 | |||
28 | // Read will spin off a goroutine to call the reader's Read method. We will | ||
29 | // select on the timer's channel or the read's channel. Whoever completes first | ||
30 | // will be returned. | ||
31 | func (r *timeoutReadCloser) Read(b []byte) (int, error) { | ||
32 | timer := time.NewTimer(r.duration) | ||
33 | c := make(chan readResult, 1) | ||
34 | |||
35 | go func() { | ||
36 | n, err := r.reader.Read(b) | ||
37 | timer.Stop() | ||
38 | c <- readResult{n: n, err: err} | ||
39 | }() | ||
40 | |||
41 | select { | ||
42 | case data := <-c: | ||
43 | return data.n, data.err | ||
44 | case <-timer.C: | ||
45 | return 0, timeoutErr | ||
46 | } | ||
47 | } | ||
48 | |||
49 | func (r *timeoutReadCloser) Close() error { | ||
50 | return r.reader.Close() | ||
51 | } | ||
52 | |||
53 | const ( | ||
54 | // HandlerResponseTimeout is what we use to signify the name of the | ||
55 | // response timeout handler. | ||
56 | HandlerResponseTimeout = "ResponseTimeoutHandler" | ||
57 | ) | ||
58 | |||
59 | // adaptToResponseTimeoutError is a handler that will replace any top level error | ||
60 | // to a ErrCodeResponseTimeout, if its child is that. | ||
61 | func adaptToResponseTimeoutError(req *Request) { | ||
62 | if err, ok := req.Error.(awserr.Error); ok { | ||
63 | aerr, ok := err.OrigErr().(awserr.Error) | ||
64 | if ok && aerr.Code() == ErrCodeResponseTimeout { | ||
65 | req.Error = aerr | ||
66 | } | ||
67 | } | ||
68 | } | ||
69 | |||
70 | // WithResponseReadTimeout is a request option that will wrap the body in a timeout read closer. | ||
71 | // This will allow for per read timeouts. If a timeout occurred, we will return the | ||
72 | // ErrCodeResponseTimeout. | ||
73 | // | ||
74 | // svc.PutObjectWithContext(ctx, params, request.WithTimeoutReadCloser(30 * time.Second) | ||
75 | func WithResponseReadTimeout(duration time.Duration) Option { | ||
76 | return func(r *Request) { | ||
77 | |||
78 | var timeoutHandler = NamedHandler{ | ||
79 | HandlerResponseTimeout, | ||
80 | func(req *Request) { | ||
81 | req.HTTPResponse.Body = &timeoutReadCloser{ | ||
82 | reader: req.HTTPResponse.Body, | ||
83 | duration: duration, | ||
84 | } | ||
85 | }} | ||
86 | |||
87 | // remove the handler so we are not stomping over any new durations. | ||
88 | r.Handlers.Send.RemoveByName(HandlerResponseTimeout) | ||
89 | r.Handlers.Send.PushBackNamed(timeoutHandler) | ||
90 | |||
91 | r.Handlers.Unmarshal.PushBack(adaptToResponseTimeoutError) | ||
92 | r.Handlers.UnmarshalError.PushBack(adaptToResponseTimeoutError) | ||
93 | } | ||
94 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/validation.go b/vendor/github.com/aws/aws-sdk-go/aws/request/validation.go new file mode 100644 index 0000000..2520286 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/validation.go | |||
@@ -0,0 +1,234 @@ | |||
1 | package request | ||
2 | |||
3 | import ( | ||
4 | "bytes" | ||
5 | "fmt" | ||
6 | |||
7 | "github.com/aws/aws-sdk-go/aws/awserr" | ||
8 | ) | ||
9 | |||
10 | const ( | ||
11 | // InvalidParameterErrCode is the error code for invalid parameters errors | ||
12 | InvalidParameterErrCode = "InvalidParameter" | ||
13 | // ParamRequiredErrCode is the error code for required parameter errors | ||
14 | ParamRequiredErrCode = "ParamRequiredError" | ||
15 | // ParamMinValueErrCode is the error code for fields with too low of a | ||
16 | // number value. | ||
17 | ParamMinValueErrCode = "ParamMinValueError" | ||
18 | // ParamMinLenErrCode is the error code for fields without enough elements. | ||
19 | ParamMinLenErrCode = "ParamMinLenError" | ||
20 | ) | ||
21 | |||
22 | // Validator provides a way for types to perform validation logic on their | ||
23 | // input values that external code can use to determine if a type's values | ||
24 | // are valid. | ||
25 | type Validator interface { | ||
26 | Validate() error | ||
27 | } | ||
28 | |||
29 | // An ErrInvalidParams provides wrapping of invalid parameter errors found when | ||
30 | // validating API operation input parameters. | ||
31 | type ErrInvalidParams struct { | ||
32 | // Context is the base context of the invalid parameter group. | ||
33 | Context string | ||
34 | errs []ErrInvalidParam | ||
35 | } | ||
36 | |||
37 | // Add adds a new invalid parameter error to the collection of invalid | ||
38 | // parameters. The context of the invalid parameter will be updated to reflect | ||
39 | // this collection. | ||
40 | func (e *ErrInvalidParams) Add(err ErrInvalidParam) { | ||
41 | err.SetContext(e.Context) | ||
42 | e.errs = append(e.errs, err) | ||
43 | } | ||
44 | |||
45 | // AddNested adds the invalid parameter errors from another ErrInvalidParams | ||
46 | // value into this collection. The nested errors will have their nested context | ||
47 | // updated and base context to reflect the merging. | ||
48 | // | ||
49 | // Use for nested validations errors. | ||
50 | func (e *ErrInvalidParams) AddNested(nestedCtx string, nested ErrInvalidParams) { | ||
51 | for _, err := range nested.errs { | ||
52 | err.SetContext(e.Context) | ||
53 | err.AddNestedContext(nestedCtx) | ||
54 | e.errs = append(e.errs, err) | ||
55 | } | ||
56 | } | ||
57 | |||
58 | // Len returns the number of invalid parameter errors | ||
59 | func (e ErrInvalidParams) Len() int { | ||
60 | return len(e.errs) | ||
61 | } | ||
62 | |||
63 | // Code returns the code of the error | ||
64 | func (e ErrInvalidParams) Code() string { | ||
65 | return InvalidParameterErrCode | ||
66 | } | ||
67 | |||
68 | // Message returns the message of the error | ||
69 | func (e ErrInvalidParams) Message() string { | ||
70 | return fmt.Sprintf("%d validation error(s) found.", len(e.errs)) | ||
71 | } | ||
72 | |||
73 | // Error returns the string formatted form of the invalid parameters. | ||
74 | func (e ErrInvalidParams) Error() string { | ||
75 | w := &bytes.Buffer{} | ||
76 | fmt.Fprintf(w, "%s: %s\n", e.Code(), e.Message()) | ||
77 | |||
78 | for _, err := range e.errs { | ||
79 | fmt.Fprintf(w, "- %s\n", err.Message()) | ||
80 | } | ||
81 | |||
82 | return w.String() | ||
83 | } | ||
84 | |||
85 | // OrigErr returns the invalid parameters as a awserr.BatchedErrors value | ||
86 | func (e ErrInvalidParams) OrigErr() error { | ||
87 | return awserr.NewBatchError( | ||
88 | InvalidParameterErrCode, e.Message(), e.OrigErrs()) | ||
89 | } | ||
90 | |||
91 | // OrigErrs returns a slice of the invalid parameters | ||
92 | func (e ErrInvalidParams) OrigErrs() []error { | ||
93 | errs := make([]error, len(e.errs)) | ||
94 | for i := 0; i < len(errs); i++ { | ||
95 | errs[i] = e.errs[i] | ||
96 | } | ||
97 | |||
98 | return errs | ||
99 | } | ||
100 | |||
101 | // An ErrInvalidParam represents an invalid parameter error type. | ||
102 | type ErrInvalidParam interface { | ||
103 | awserr.Error | ||
104 | |||
105 | // Field name the error occurred on. | ||
106 | Field() string | ||
107 | |||
108 | // SetContext updates the context of the error. | ||
109 | SetContext(string) | ||
110 | |||
111 | // AddNestedContext updates the error's context to include a nested level. | ||
112 | AddNestedContext(string) | ||
113 | } | ||
114 | |||
115 | type errInvalidParam struct { | ||
116 | context string | ||
117 | nestedContext string | ||
118 | field string | ||
119 | code string | ||
120 | msg string | ||
121 | } | ||
122 | |||
123 | // Code returns the error code for the type of invalid parameter. | ||
124 | func (e *errInvalidParam) Code() string { | ||
125 | return e.code | ||
126 | } | ||
127 | |||
128 | // Message returns the reason the parameter was invalid, and its context. | ||
129 | func (e *errInvalidParam) Message() string { | ||
130 | return fmt.Sprintf("%s, %s.", e.msg, e.Field()) | ||
131 | } | ||
132 | |||
133 | // Error returns the string version of the invalid parameter error. | ||
134 | func (e *errInvalidParam) Error() string { | ||
135 | return fmt.Sprintf("%s: %s", e.code, e.Message()) | ||
136 | } | ||
137 | |||
138 | // OrigErr returns nil, Implemented for awserr.Error interface. | ||
139 | func (e *errInvalidParam) OrigErr() error { | ||
140 | return nil | ||
141 | } | ||
142 | |||
143 | // Field Returns the field and context the error occurred. | ||
144 | func (e *errInvalidParam) Field() string { | ||
145 | field := e.context | ||
146 | if len(field) > 0 { | ||
147 | field += "." | ||
148 | } | ||
149 | if len(e.nestedContext) > 0 { | ||
150 | field += fmt.Sprintf("%s.", e.nestedContext) | ||
151 | } | ||
152 | field += e.field | ||
153 | |||
154 | return field | ||
155 | } | ||
156 | |||
157 | // SetContext updates the base context of the error. | ||
158 | func (e *errInvalidParam) SetContext(ctx string) { | ||
159 | e.context = ctx | ||
160 | } | ||
161 | |||
162 | // AddNestedContext prepends a context to the field's path. | ||
163 | func (e *errInvalidParam) AddNestedContext(ctx string) { | ||
164 | if len(e.nestedContext) == 0 { | ||
165 | e.nestedContext = ctx | ||
166 | } else { | ||
167 | e.nestedContext = fmt.Sprintf("%s.%s", ctx, e.nestedContext) | ||
168 | } | ||
169 | |||
170 | } | ||
171 | |||
172 | // An ErrParamRequired represents an required parameter error. | ||
173 | type ErrParamRequired struct { | ||
174 | errInvalidParam | ||
175 | } | ||
176 | |||
177 | // NewErrParamRequired creates a new required parameter error. | ||
178 | func NewErrParamRequired(field string) *ErrParamRequired { | ||
179 | return &ErrParamRequired{ | ||
180 | errInvalidParam{ | ||
181 | code: ParamRequiredErrCode, | ||
182 | field: field, | ||
183 | msg: fmt.Sprintf("missing required field"), | ||
184 | }, | ||
185 | } | ||
186 | } | ||
187 | |||
188 | // An ErrParamMinValue represents a minimum value parameter error. | ||
189 | type ErrParamMinValue struct { | ||
190 | errInvalidParam | ||
191 | min float64 | ||
192 | } | ||
193 | |||
194 | // NewErrParamMinValue creates a new minimum value parameter error. | ||
195 | func NewErrParamMinValue(field string, min float64) *ErrParamMinValue { | ||
196 | return &ErrParamMinValue{ | ||
197 | errInvalidParam: errInvalidParam{ | ||
198 | code: ParamMinValueErrCode, | ||
199 | field: field, | ||
200 | msg: fmt.Sprintf("minimum field value of %v", min), | ||
201 | }, | ||
202 | min: min, | ||
203 | } | ||
204 | } | ||
205 | |||
206 | // MinValue returns the field's require minimum value. | ||
207 | // | ||
208 | // float64 is returned for both int and float min values. | ||
209 | func (e *ErrParamMinValue) MinValue() float64 { | ||
210 | return e.min | ||
211 | } | ||
212 | |||
213 | // An ErrParamMinLen represents a minimum length parameter error. | ||
214 | type ErrParamMinLen struct { | ||
215 | errInvalidParam | ||
216 | min int | ||
217 | } | ||
218 | |||
219 | // NewErrParamMinLen creates a new minimum length parameter error. | ||
220 | func NewErrParamMinLen(field string, min int) *ErrParamMinLen { | ||
221 | return &ErrParamMinLen{ | ||
222 | errInvalidParam: errInvalidParam{ | ||
223 | code: ParamMinValueErrCode, | ||
224 | field: field, | ||
225 | msg: fmt.Sprintf("minimum field size of %v", min), | ||
226 | }, | ||
227 | min: min, | ||
228 | } | ||
229 | } | ||
230 | |||
231 | // MinLen returns the field's required minimum length. | ||
232 | func (e *ErrParamMinLen) MinLen() int { | ||
233 | return e.min | ||
234 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/waiter.go b/vendor/github.com/aws/aws-sdk-go/aws/request/waiter.go new file mode 100644 index 0000000..22d2f80 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/waiter.go | |||
@@ -0,0 +1,287 @@ | |||
1 | package request | ||
2 | |||
3 | import ( | ||
4 | "fmt" | ||
5 | "time" | ||
6 | |||
7 | "github.com/aws/aws-sdk-go/aws" | ||
8 | "github.com/aws/aws-sdk-go/aws/awserr" | ||
9 | "github.com/aws/aws-sdk-go/aws/awsutil" | ||
10 | ) | ||
11 | |||
12 | // WaiterResourceNotReadyErrorCode is the error code returned by a waiter when | ||
13 | // the waiter's max attempts have been exhausted. | ||
14 | const WaiterResourceNotReadyErrorCode = "ResourceNotReady" | ||
15 | |||
16 | // A WaiterOption is a function that will update the Waiter value's fields to | ||
17 | // configure the waiter. | ||
18 | type WaiterOption func(*Waiter) | ||
19 | |||
20 | // WithWaiterMaxAttempts returns the maximum number of times the waiter should | ||
21 | // attempt to check the resource for the target state. | ||
22 | func WithWaiterMaxAttempts(max int) WaiterOption { | ||
23 | return func(w *Waiter) { | ||
24 | w.MaxAttempts = max | ||
25 | } | ||
26 | } | ||
27 | |||
28 | // WaiterDelay will return a delay the waiter should pause between attempts to | ||
29 | // check the resource state. The passed in attempt is the number of times the | ||
30 | // Waiter has checked the resource state. | ||
31 | // | ||
32 | // Attempt is the number of attempts the Waiter has made checking the resource | ||
33 | // state. | ||
34 | type WaiterDelay func(attempt int) time.Duration | ||
35 | |||
36 | // ConstantWaiterDelay returns a WaiterDelay that will always return a constant | ||
37 | // delay the waiter should use between attempts. It ignores the number of | ||
38 | // attempts made. | ||
39 | func ConstantWaiterDelay(delay time.Duration) WaiterDelay { | ||
40 | return func(attempt int) time.Duration { | ||
41 | return delay | ||
42 | } | ||
43 | } | ||
44 | |||
45 | // WithWaiterDelay will set the Waiter to use the WaiterDelay passed in. | ||
46 | func WithWaiterDelay(delayer WaiterDelay) WaiterOption { | ||
47 | return func(w *Waiter) { | ||
48 | w.Delay = delayer | ||
49 | } | ||
50 | } | ||
51 | |||
52 | // WithWaiterLogger returns a waiter option to set the logger a waiter | ||
53 | // should use to log warnings and errors to. | ||
54 | func WithWaiterLogger(logger aws.Logger) WaiterOption { | ||
55 | return func(w *Waiter) { | ||
56 | w.Logger = logger | ||
57 | } | ||
58 | } | ||
59 | |||
60 | // WithWaiterRequestOptions returns a waiter option setting the request | ||
61 | // options for each request the waiter makes. Appends to waiter's request | ||
62 | // options already set. | ||
63 | func WithWaiterRequestOptions(opts ...Option) WaiterOption { | ||
64 | return func(w *Waiter) { | ||
65 | w.RequestOptions = append(w.RequestOptions, opts...) | ||
66 | } | ||
67 | } | ||
68 | |||
69 | // A Waiter provides the functionality to perform a blocking call which will | ||
70 | // wait for a resource state to be satisfied by a service. | ||
71 | // | ||
72 | // This type should not be used directly. The API operations provided in the | ||
73 | // service packages prefixed with "WaitUntil" should be used instead. | ||
74 | type Waiter struct { | ||
75 | Name string | ||
76 | Acceptors []WaiterAcceptor | ||
77 | Logger aws.Logger | ||
78 | |||
79 | MaxAttempts int | ||
80 | Delay WaiterDelay | ||
81 | |||
82 | RequestOptions []Option | ||
83 | NewRequest func([]Option) (*Request, error) | ||
84 | } | ||
85 | |||
86 | // ApplyOptions updates the waiter with the list of waiter options provided. | ||
87 | func (w *Waiter) ApplyOptions(opts ...WaiterOption) { | ||
88 | for _, fn := range opts { | ||
89 | fn(w) | ||
90 | } | ||
91 | } | ||
92 | |||
93 | // WaiterState are states the waiter uses based on WaiterAcceptor definitions | ||
94 | // to identify if the resource state the waiter is waiting on has occurred. | ||
95 | type WaiterState int | ||
96 | |||
97 | // String returns the string representation of the waiter state. | ||
98 | func (s WaiterState) String() string { | ||
99 | switch s { | ||
100 | case SuccessWaiterState: | ||
101 | return "success" | ||
102 | case FailureWaiterState: | ||
103 | return "failure" | ||
104 | case RetryWaiterState: | ||
105 | return "retry" | ||
106 | default: | ||
107 | return "unknown waiter state" | ||
108 | } | ||
109 | } | ||
110 | |||
111 | // States the waiter acceptors will use to identify target resource states. | ||
112 | const ( | ||
113 | SuccessWaiterState WaiterState = iota // waiter successful | ||
114 | FailureWaiterState // waiter failed | ||
115 | RetryWaiterState // waiter needs to be retried | ||
116 | ) | ||
117 | |||
118 | // WaiterMatchMode is the mode that the waiter will use to match the WaiterAcceptor | ||
119 | // definition's Expected attribute. | ||
120 | type WaiterMatchMode int | ||
121 | |||
122 | // Modes the waiter will use when inspecting API response to identify target | ||
123 | // resource states. | ||
124 | const ( | ||
125 | PathAllWaiterMatch WaiterMatchMode = iota // match on all paths | ||
126 | PathWaiterMatch // match on specific path | ||
127 | PathAnyWaiterMatch // match on any path | ||
128 | PathListWaiterMatch // match on list of paths | ||
129 | StatusWaiterMatch // match on status code | ||
130 | ErrorWaiterMatch // match on error | ||
131 | ) | ||
132 | |||
133 | // String returns the string representation of the waiter match mode. | ||
134 | func (m WaiterMatchMode) String() string { | ||
135 | switch m { | ||
136 | case PathAllWaiterMatch: | ||
137 | return "pathAll" | ||
138 | case PathWaiterMatch: | ||
139 | return "path" | ||
140 | case PathAnyWaiterMatch: | ||
141 | return "pathAny" | ||
142 | case PathListWaiterMatch: | ||
143 | return "pathList" | ||
144 | case StatusWaiterMatch: | ||
145 | return "status" | ||
146 | case ErrorWaiterMatch: | ||
147 | return "error" | ||
148 | default: | ||
149 | return "unknown waiter match mode" | ||
150 | } | ||
151 | } | ||
152 | |||
153 | // WaitWithContext will make requests for the API operation using NewRequest to | ||
154 | // build API requests. The request's response will be compared against the | ||
155 | // Waiter's Acceptors to determine the successful state of the resource the | ||
156 | // waiter is inspecting. | ||
157 | // | ||
158 | // The passed in context must not be nil. If it is nil a panic will occur. The | ||
159 | // Context will be used to cancel the waiter's pending requests and retry delays. | ||
160 | // Use aws.BackgroundContext if no context is available. | ||
161 | // | ||
162 | // The waiter will continue until the target state defined by the Acceptors, | ||
163 | // or the max attempts expires. | ||
164 | // | ||
165 | // Will return the WaiterResourceNotReadyErrorCode error code if the waiter's | ||
166 | // retryer ShouldRetry returns false. This normally will happen when the max | ||
167 | // wait attempts expires. | ||
168 | func (w Waiter) WaitWithContext(ctx aws.Context) error { | ||
169 | |||
170 | for attempt := 1; ; attempt++ { | ||
171 | req, err := w.NewRequest(w.RequestOptions) | ||
172 | if err != nil { | ||
173 | waiterLogf(w.Logger, "unable to create request %v", err) | ||
174 | return err | ||
175 | } | ||
176 | req.Handlers.Build.PushBack(MakeAddToUserAgentFreeFormHandler("Waiter")) | ||
177 | err = req.Send() | ||
178 | |||
179 | // See if any of the acceptors match the request's response, or error | ||
180 | for _, a := range w.Acceptors { | ||
181 | if matched, matchErr := a.match(w.Name, w.Logger, req, err); matched { | ||
182 | return matchErr | ||
183 | } | ||
184 | } | ||
185 | |||
186 | // The Waiter should only check the resource state MaxAttempts times | ||
187 | // This is here instead of in the for loop above to prevent delaying | ||
188 | // unnecessary when the waiter will not retry. | ||
189 | if attempt == w.MaxAttempts { | ||
190 | break | ||
191 | } | ||
192 | |||
193 | // Delay to wait before inspecting the resource again | ||
194 | delay := w.Delay(attempt) | ||
195 | if sleepFn := req.Config.SleepDelay; sleepFn != nil { | ||
196 | // Support SleepDelay for backwards compatibility and testing | ||
197 | sleepFn(delay) | ||
198 | } else if err := aws.SleepWithContext(ctx, delay); err != nil { | ||
199 | return awserr.New(CanceledErrorCode, "waiter context canceled", err) | ||
200 | } | ||
201 | } | ||
202 | |||
203 | return awserr.New(WaiterResourceNotReadyErrorCode, "exceeded wait attempts", nil) | ||
204 | } | ||
205 | |||
206 | // A WaiterAcceptor provides the information needed to wait for an API operation | ||
207 | // to complete. | ||
208 | type WaiterAcceptor struct { | ||
209 | State WaiterState | ||
210 | Matcher WaiterMatchMode | ||
211 | Argument string | ||
212 | Expected interface{} | ||
213 | } | ||
214 | |||
215 | // match returns if the acceptor found a match with the passed in request | ||
216 | // or error. True is returned if the acceptor made a match, error is returned | ||
217 | // if there was an error attempting to perform the match. | ||
218 | func (a *WaiterAcceptor) match(name string, l aws.Logger, req *Request, err error) (bool, error) { | ||
219 | result := false | ||
220 | var vals []interface{} | ||
221 | |||
222 | switch a.Matcher { | ||
223 | case PathAllWaiterMatch, PathWaiterMatch: | ||
224 | // Require all matches to be equal for result to match | ||
225 | vals, _ = awsutil.ValuesAtPath(req.Data, a.Argument) | ||
226 | if len(vals) == 0 { | ||
227 | break | ||
228 | } | ||
229 | result = true | ||
230 | for _, val := range vals { | ||
231 | if !awsutil.DeepEqual(val, a.Expected) { | ||
232 | result = false | ||
233 | break | ||
234 | } | ||
235 | } | ||
236 | case PathAnyWaiterMatch: | ||
237 | // Only a single match needs to equal for the result to match | ||
238 | vals, _ = awsutil.ValuesAtPath(req.Data, a.Argument) | ||
239 | for _, val := range vals { | ||
240 | if awsutil.DeepEqual(val, a.Expected) { | ||
241 | result = true | ||
242 | break | ||
243 | } | ||
244 | } | ||
245 | case PathListWaiterMatch: | ||
246 | // ignored matcher | ||
247 | case StatusWaiterMatch: | ||
248 | s := a.Expected.(int) | ||
249 | result = s == req.HTTPResponse.StatusCode | ||
250 | case ErrorWaiterMatch: | ||
251 | if aerr, ok := err.(awserr.Error); ok { | ||
252 | result = aerr.Code() == a.Expected.(string) | ||
253 | } | ||
254 | default: | ||
255 | waiterLogf(l, "WARNING: Waiter %s encountered unexpected matcher: %s", | ||
256 | name, a.Matcher) | ||
257 | } | ||
258 | |||
259 | if !result { | ||
260 | // If there was no matching result found there is nothing more to do | ||
261 | // for this response, retry the request. | ||
262 | return false, nil | ||
263 | } | ||
264 | |||
265 | switch a.State { | ||
266 | case SuccessWaiterState: | ||
267 | // waiter completed | ||
268 | return true, nil | ||
269 | case FailureWaiterState: | ||
270 | // Waiter failure state triggered | ||
271 | return true, awserr.New(WaiterResourceNotReadyErrorCode, | ||
272 | "failed waiting for successful resource state", err) | ||
273 | case RetryWaiterState: | ||
274 | // clear the error and retry the operation | ||
275 | return false, nil | ||
276 | default: | ||
277 | waiterLogf(l, "WARNING: Waiter %s encountered unexpected state: %s", | ||
278 | name, a.State) | ||
279 | return false, nil | ||
280 | } | ||
281 | } | ||
282 | |||
283 | func waiterLogf(logger aws.Logger, msg string, args ...interface{}) { | ||
284 | if logger != nil { | ||
285 | logger.Log(fmt.Sprintf(msg, args...)) | ||
286 | } | ||
287 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go b/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go new file mode 100644 index 0000000..ea7b886 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go | |||
@@ -0,0 +1,273 @@ | |||
1 | /* | ||
2 | Package session provides configuration for the SDK's service clients. | ||
3 | |||
4 | Sessions can be shared across all service clients that share the same base | ||
5 | configuration. The Session is built from the SDK's default configuration and | ||
6 | request handlers. | ||
7 | |||
8 | Sessions should be cached when possible, because creating a new Session will | ||
9 | load all configuration values from the environment, and config files each time | ||
10 | the Session is created. Sharing the Session value across all of your service | ||
11 | clients will ensure the configuration is loaded the fewest number of times possible. | ||
12 | |||
13 | Concurrency | ||
14 | |||
15 | Sessions are safe to use concurrently as long as the Session is not being | ||
16 | modified. The SDK will not modify the Session once the Session has been created. | ||
17 | Creating service clients concurrently from a shared Session is safe. | ||
18 | |||
19 | Sessions from Shared Config | ||
20 | |||
21 | Sessions can be created using the method above that will only load the | ||
22 | additional config if the AWS_SDK_LOAD_CONFIG environment variable is set. | ||
23 | Alternatively you can explicitly create a Session with shared config enabled. | ||
24 | To do this you can use NewSessionWithOptions to configure how the Session will | ||
25 | be created. Using the NewSessionWithOptions with SharedConfigState set to | ||
26 | SharedConfigEnable will create the session as if the AWS_SDK_LOAD_CONFIG | ||
27 | environment variable was set. | ||
28 | |||
29 | Creating Sessions | ||
30 | |||
31 | When creating Sessions optional aws.Config values can be passed in that will | ||
32 | override the default, or loaded config values the Session is being created | ||
33 | with. This allows you to provide additional, or case based, configuration | ||
34 | as needed. | ||
35 | |||
36 | By default NewSession will only load credentials from the shared credentials | ||
37 | file (~/.aws/credentials). If the AWS_SDK_LOAD_CONFIG environment variable is | ||
38 | set to a truthy value the Session will be created from the configuration | ||
39 | values from the shared config (~/.aws/config) and shared credentials | ||
40 | (~/.aws/credentials) files. See the section Sessions from Shared Config for | ||
41 | more information. | ||
42 | |||
43 | Create a Session with the default config and request handlers. With credentials | ||
44 | region, and profile loaded from the environment and shared config automatically. | ||
45 | Requires the AWS_PROFILE to be set, or "default" is used. | ||
46 | |||
47 | // Create Session | ||
48 | sess := session.Must(session.NewSession()) | ||
49 | |||
50 | // Create a Session with a custom region | ||
51 | sess := session.Must(session.NewSession(&aws.Config{ | ||
52 | Region: aws.String("us-east-1"), | ||
53 | })) | ||
54 | |||
55 | // Create a S3 client instance from a session | ||
56 | sess := session.Must(session.NewSession()) | ||
57 | |||
58 | svc := s3.New(sess) | ||
59 | |||
60 | Create Session With Option Overrides | ||
61 | |||
62 | In addition to NewSession, Sessions can be created using NewSessionWithOptions. | ||
63 | This func allows you to control and override how the Session will be created | ||
64 | through code instead of being driven by environment variables only. | ||
65 | |||
66 | Use NewSessionWithOptions when you want to provide the config profile, or | ||
67 | override the shared config state (AWS_SDK_LOAD_CONFIG). | ||
68 | |||
69 | // Equivalent to session.NewSession() | ||
70 | sess := session.Must(session.NewSessionWithOptions(session.Options{ | ||
71 | // Options | ||
72 | })) | ||
73 | |||
74 | // Specify profile to load for the session's config | ||
75 | sess := session.Must(session.NewSessionWithOptions(session.Options{ | ||
76 | Profile: "profile_name", | ||
77 | })) | ||
78 | |||
79 | // Specify profile for config and region for requests | ||
80 | sess := session.Must(session.NewSessionWithOptions(session.Options{ | ||
81 | Config: aws.Config{Region: aws.String("us-east-1")}, | ||
82 | Profile: "profile_name", | ||
83 | })) | ||
84 | |||
85 | // Force enable Shared Config support | ||
86 | sess := session.Must(session.NewSessionWithOptions(session.Options{ | ||
87 | SharedConfigState: session.SharedConfigEnable, | ||
88 | })) | ||
89 | |||
90 | Adding Handlers | ||
91 | |||
92 | You can add handlers to a session for processing HTTP requests. All service | ||
93 | clients that use the session inherit the handlers. For example, the following | ||
94 | handler logs every request and its payload made by a service client: | ||
95 | |||
96 | // Create a session, and add additional handlers for all service | ||
97 | // clients created with the Session to inherit. Adds logging handler. | ||
98 | sess := session.Must(session.NewSession()) | ||
99 | |||
100 | sess.Handlers.Send.PushFront(func(r *request.Request) { | ||
101 | // Log every request made and its payload | ||
102 | logger.Println("Request: %s/%s, Payload: %s", | ||
103 | r.ClientInfo.ServiceName, r.Operation, r.Params) | ||
104 | }) | ||
105 | |||
106 | Deprecated "New" function | ||
107 | |||
108 | The New session function has been deprecated because it does not provide good | ||
109 | way to return errors that occur when loading the configuration files and values. | ||
110 | Because of this, NewSession was created so errors can be retrieved when | ||
111 | creating a session fails. | ||
112 | |||
113 | Shared Config Fields | ||
114 | |||
115 | By default the SDK will only load the shared credentials file's (~/.aws/credentials) | ||
116 | credentials values, and all other config is provided by the environment variables, | ||
117 | SDK defaults, and user provided aws.Config values. | ||
118 | |||
119 | If the AWS_SDK_LOAD_CONFIG environment variable is set, or SharedConfigEnable | ||
120 | option is used to create the Session the full shared config values will be | ||
121 | loaded. This includes credentials, region, and support for assume role. In | ||
122 | addition the Session will load its configuration from both the shared config | ||
123 | file (~/.aws/config) and shared credentials file (~/.aws/credentials). Both | ||
124 | files have the same format. | ||
125 | |||
126 | If both config files are present the configuration from both files will be | ||
127 | read. The Session will be created from configuration values from the shared | ||
128 | credentials file (~/.aws/credentials) over those in the shared config file (~/.aws/config). | ||
129 | |||
130 | Credentials are the values the SDK should use for authenticating requests with | ||
131 | AWS Services. They arfrom a configuration file will need to include both | ||
132 | aws_access_key_id and aws_secret_access_key must be provided together in the | ||
133 | same file to be considered valid. The values will be ignored if not a complete | ||
134 | group. aws_session_token is an optional field that can be provided if both of | ||
135 | the other two fields are also provided. | ||
136 | |||
137 | aws_access_key_id = AKID | ||
138 | aws_secret_access_key = SECRET | ||
139 | aws_session_token = TOKEN | ||
140 | |||
141 | Assume Role values allow you to configure the SDK to assume an IAM role using | ||
142 | a set of credentials provided in a config file via the source_profile field. | ||
143 | Both "role_arn" and "source_profile" are required. The SDK supports assuming | ||
144 | a role with MFA token if the session option AssumeRoleTokenProvider | ||
145 | is set. | ||
146 | |||
147 | role_arn = arn:aws:iam::<account_number>:role/<role_name> | ||
148 | source_profile = profile_with_creds | ||
149 | external_id = 1234 | ||
150 | mfa_serial = <serial or mfa arn> | ||
151 | role_session_name = session_name | ||
152 | |||
153 | Region is the region the SDK should use for looking up AWS service endpoints | ||
154 | and signing requests. | ||
155 | |||
156 | region = us-east-1 | ||
157 | |||
158 | Assume Role with MFA token | ||
159 | |||
160 | To create a session with support for assuming an IAM role with MFA set the | ||
161 | session option AssumeRoleTokenProvider to a function that will prompt for the | ||
162 | MFA token code when the SDK assumes the role and refreshes the role's credentials. | ||
163 | This allows you to configure the SDK via the shared config to assumea role | ||
164 | with MFA tokens. | ||
165 | |||
166 | In order for the SDK to assume a role with MFA the SharedConfigState | ||
167 | session option must be set to SharedConfigEnable, or AWS_SDK_LOAD_CONFIG | ||
168 | environment variable set. | ||
169 | |||
170 | The shared configuration instructs the SDK to assume an IAM role with MFA | ||
171 | when the mfa_serial configuration field is set in the shared config | ||
172 | (~/.aws/config) or shared credentials (~/.aws/credentials) file. | ||
173 | |||
174 | If mfa_serial is set in the configuration, the SDK will assume the role, and | ||
175 | the AssumeRoleTokenProvider session option is not set an an error will | ||
176 | be returned when creating the session. | ||
177 | |||
178 | sess := session.Must(session.NewSessionWithOptions(session.Options{ | ||
179 | AssumeRoleTokenProvider: stscreds.StdinTokenProvider, | ||
180 | })) | ||
181 | |||
182 | // Create service client value configured for credentials | ||
183 | // from assumed role. | ||
184 | svc := s3.New(sess) | ||
185 | |||
186 | To setup assume role outside of a session see the stscrds.AssumeRoleProvider | ||
187 | documentation. | ||
188 | |||
189 | Environment Variables | ||
190 | |||
191 | When a Session is created several environment variables can be set to adjust | ||
192 | how the SDK functions, and what configuration data it loads when creating | ||
193 | Sessions. All environment values are optional, but some values like credentials | ||
194 | require multiple of the values to set or the partial values will be ignored. | ||
195 | All environment variable values are strings unless otherwise noted. | ||
196 | |||
197 | Environment configuration values. If set both Access Key ID and Secret Access | ||
198 | Key must be provided. Session Token and optionally also be provided, but is | ||
199 | not required. | ||
200 | |||
201 | # Access Key ID | ||
202 | AWS_ACCESS_KEY_ID=AKID | ||
203 | AWS_ACCESS_KEY=AKID # only read if AWS_ACCESS_KEY_ID is not set. | ||
204 | |||
205 | # Secret Access Key | ||
206 | AWS_SECRET_ACCESS_KEY=SECRET | ||
207 | AWS_SECRET_KEY=SECRET=SECRET # only read if AWS_SECRET_ACCESS_KEY is not set. | ||
208 | |||
209 | # Session Token | ||
210 | AWS_SESSION_TOKEN=TOKEN | ||
211 | |||
212 | Region value will instruct the SDK where to make service API requests to. If is | ||
213 | not provided in the environment the region must be provided before a service | ||
214 | client request is made. | ||
215 | |||
216 | AWS_REGION=us-east-1 | ||
217 | |||
218 | # AWS_DEFAULT_REGION is only read if AWS_SDK_LOAD_CONFIG is also set, | ||
219 | # and AWS_REGION is not also set. | ||
220 | AWS_DEFAULT_REGION=us-east-1 | ||
221 | |||
222 | Profile name the SDK should load use when loading shared config from the | ||
223 | configuration files. If not provided "default" will be used as the profile name. | ||
224 | |||
225 | AWS_PROFILE=my_profile | ||
226 | |||
227 | # AWS_DEFAULT_PROFILE is only read if AWS_SDK_LOAD_CONFIG is also set, | ||
228 | # and AWS_PROFILE is not also set. | ||
229 | AWS_DEFAULT_PROFILE=my_profile | ||
230 | |||
231 | SDK load config instructs the SDK to load the shared config in addition to | ||
232 | shared credentials. This also expands the configuration loaded so the shared | ||
233 | credentials will have parity with the shared config file. This also enables | ||
234 | Region and Profile support for the AWS_DEFAULT_REGION and AWS_DEFAULT_PROFILE | ||
235 | env values as well. | ||
236 | |||
237 | AWS_SDK_LOAD_CONFIG=1 | ||
238 | |||
239 | Shared credentials file path can be set to instruct the SDK to use an alternative | ||
240 | file for the shared credentials. If not set the file will be loaded from | ||
241 | $HOME/.aws/credentials on Linux/Unix based systems, and | ||
242 | %USERPROFILE%\.aws\credentials on Windows. | ||
243 | |||
244 | AWS_SHARED_CREDENTIALS_FILE=$HOME/my_shared_credentials | ||
245 | |||
246 | Shared config file path can be set to instruct the SDK to use an alternative | ||
247 | file for the shared config. If not set the file will be loaded from | ||
248 | $HOME/.aws/config on Linux/Unix based systems, and | ||
249 | %USERPROFILE%\.aws\config on Windows. | ||
250 | |||
251 | AWS_CONFIG_FILE=$HOME/my_shared_config | ||
252 | |||
253 | Path to a custom Credentials Authority (CA) bundle PEM file that the SDK | ||
254 | will use instead of the default system's root CA bundle. Use this only | ||
255 | if you want to replace the CA bundle the SDK uses for TLS requests. | ||
256 | |||
257 | AWS_CA_BUNDLE=$HOME/my_custom_ca_bundle | ||
258 | |||
259 | Enabling this option will attempt to merge the Transport into the SDK's HTTP | ||
260 | client. If the client's Transport is not a http.Transport an error will be | ||
261 | returned. If the Transport's TLS config is set this option will cause the SDK | ||
262 | to overwrite the Transport's TLS config's RootCAs value. If the CA bundle file | ||
263 | contains multiple certificates all of them will be loaded. | ||
264 | |||
265 | The Session option CustomCABundle is also available when creating sessions | ||
266 | to also enable this feature. CustomCABundle session option field has priority | ||
267 | over the AWS_CA_BUNDLE environment variable, and will be used if both are set. | ||
268 | |||
269 | Setting a custom HTTPClient in the aws.Config options will override this setting. | ||
270 | To use this option and custom HTTP client, the HTTP client needs to be provided | ||
271 | when creating the session. Not the service client. | ||
272 | */ | ||
273 | package session | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go b/vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go new file mode 100644 index 0000000..e6278a7 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go | |||
@@ -0,0 +1,208 @@ | |||
1 | package session | ||
2 | |||
3 | import ( | ||
4 | "os" | ||
5 | "path/filepath" | ||
6 | "strconv" | ||
7 | |||
8 | "github.com/aws/aws-sdk-go/aws/credentials" | ||
9 | ) | ||
10 | |||
11 | // envConfig is a collection of environment values the SDK will read | ||
12 | // setup config from. All environment values are optional. But some values | ||
13 | // such as credentials require multiple values to be complete or the values | ||
14 | // will be ignored. | ||
15 | type envConfig struct { | ||
16 | // Environment configuration values. If set both Access Key ID and Secret Access | ||
17 | // Key must be provided. Session Token and optionally also be provided, but is | ||
18 | // not required. | ||
19 | // | ||
20 | // # Access Key ID | ||
21 | // AWS_ACCESS_KEY_ID=AKID | ||
22 | // AWS_ACCESS_KEY=AKID # only read if AWS_ACCESS_KEY_ID is not set. | ||
23 | // | ||
24 | // # Secret Access Key | ||
25 | // AWS_SECRET_ACCESS_KEY=SECRET | ||
26 | // AWS_SECRET_KEY=SECRET=SECRET # only read if AWS_SECRET_ACCESS_KEY is not set. | ||
27 | // | ||
28 | // # Session Token | ||
29 | // AWS_SESSION_TOKEN=TOKEN | ||
30 | Creds credentials.Value | ||
31 | |||
32 | // Region value will instruct the SDK where to make service API requests to. If is | ||
33 | // not provided in the environment the region must be provided before a service | ||
34 | // client request is made. | ||
35 | // | ||
36 | // AWS_REGION=us-east-1 | ||
37 | // | ||
38 | // # AWS_DEFAULT_REGION is only read if AWS_SDK_LOAD_CONFIG is also set, | ||
39 | // # and AWS_REGION is not also set. | ||
40 | // AWS_DEFAULT_REGION=us-east-1 | ||
41 | Region string | ||
42 | |||
43 | // Profile name the SDK should load use when loading shared configuration from the | ||
44 | // shared configuration files. If not provided "default" will be used as the | ||
45 | // profile name. | ||
46 | // | ||
47 | // AWS_PROFILE=my_profile | ||
48 | // | ||
49 | // # AWS_DEFAULT_PROFILE is only read if AWS_SDK_LOAD_CONFIG is also set, | ||
50 | // # and AWS_PROFILE is not also set. | ||
51 | // AWS_DEFAULT_PROFILE=my_profile | ||
52 | Profile string | ||
53 | |||
54 | // SDK load config instructs the SDK to load the shared config in addition to | ||
55 | // shared credentials. This also expands the configuration loaded from the shared | ||
56 | // credentials to have parity with the shared config file. This also enables | ||
57 | // Region and Profile support for the AWS_DEFAULT_REGION and AWS_DEFAULT_PROFILE | ||
58 | // env values as well. | ||
59 | // | ||
60 | // AWS_SDK_LOAD_CONFIG=1 | ||
61 | EnableSharedConfig bool | ||
62 | |||
63 | // Shared credentials file path can be set to instruct the SDK to use an alternate | ||
64 | // file for the shared credentials. If not set the file will be loaded from | ||
65 | // $HOME/.aws/credentials on Linux/Unix based systems, and | ||
66 | // %USERPROFILE%\.aws\credentials on Windows. | ||
67 | // | ||
68 | // AWS_SHARED_CREDENTIALS_FILE=$HOME/my_shared_credentials | ||
69 | SharedCredentialsFile string | ||
70 | |||
71 | // Shared config file path can be set to instruct the SDK to use an alternate | ||
72 | // file for the shared config. If not set the file will be loaded from | ||
73 | // $HOME/.aws/config on Linux/Unix based systems, and | ||
74 | // %USERPROFILE%\.aws\config on Windows. | ||
75 | // | ||
76 | // AWS_CONFIG_FILE=$HOME/my_shared_config | ||
77 | SharedConfigFile string | ||
78 | |||
79 | // Sets the path to a custom Credentials Authroity (CA) Bundle PEM file | ||
80 | // that the SDK will use instead of the the system's root CA bundle. | ||
81 | // Only use this if you want to configure the SDK to use a custom set | ||
82 | // of CAs. | ||
83 | // | ||
84 | // Enabling this option will attempt to merge the Transport | ||
85 | // into the SDK's HTTP client. If the client's Transport is | ||
86 | // not a http.Transport an error will be returned. If the | ||
87 | // Transport's TLS config is set this option will cause the | ||
88 | // SDK to overwrite the Transport's TLS config's RootCAs value. | ||
89 | // | ||
90 | // Setting a custom HTTPClient in the aws.Config options will override this setting. | ||
91 | // To use this option and custom HTTP client, the HTTP client needs to be provided | ||
92 | // when creating the session. Not the service client. | ||
93 | // | ||
94 | // AWS_CA_BUNDLE=$HOME/my_custom_ca_bundle | ||
95 | CustomCABundle string | ||
96 | } | ||
97 | |||
98 | var ( | ||
99 | credAccessEnvKey = []string{ | ||
100 | "AWS_ACCESS_KEY_ID", | ||
101 | "AWS_ACCESS_KEY", | ||
102 | } | ||
103 | credSecretEnvKey = []string{ | ||
104 | "AWS_SECRET_ACCESS_KEY", | ||
105 | "AWS_SECRET_KEY", | ||
106 | } | ||
107 | credSessionEnvKey = []string{ | ||
108 | "AWS_SESSION_TOKEN", | ||
109 | } | ||
110 | |||
111 | regionEnvKeys = []string{ | ||
112 | "AWS_REGION", | ||
113 | "AWS_DEFAULT_REGION", // Only read if AWS_SDK_LOAD_CONFIG is also set | ||
114 | } | ||
115 | profileEnvKeys = []string{ | ||
116 | "AWS_PROFILE", | ||
117 | "AWS_DEFAULT_PROFILE", // Only read if AWS_SDK_LOAD_CONFIG is also set | ||
118 | } | ||
119 | ) | ||
120 | |||
121 | // loadEnvConfig retrieves the SDK's environment configuration. | ||
122 | // See `envConfig` for the values that will be retrieved. | ||
123 | // | ||
124 | // If the environment variable `AWS_SDK_LOAD_CONFIG` is set to a truthy value | ||
125 | // the shared SDK config will be loaded in addition to the SDK's specific | ||
126 | // configuration values. | ||
127 | func loadEnvConfig() envConfig { | ||
128 | enableSharedConfig, _ := strconv.ParseBool(os.Getenv("AWS_SDK_LOAD_CONFIG")) | ||
129 | return envConfigLoad(enableSharedConfig) | ||
130 | } | ||
131 | |||
132 | // loadEnvSharedConfig retrieves the SDK's environment configuration, and the | ||
133 | // SDK shared config. See `envConfig` for the values that will be retrieved. | ||
134 | // | ||
135 | // Loads the shared configuration in addition to the SDK's specific configuration. | ||
136 | // This will load the same values as `loadEnvConfig` if the `AWS_SDK_LOAD_CONFIG` | ||
137 | // environment variable is set. | ||
138 | func loadSharedEnvConfig() envConfig { | ||
139 | return envConfigLoad(true) | ||
140 | } | ||
141 | |||
142 | func envConfigLoad(enableSharedConfig bool) envConfig { | ||
143 | cfg := envConfig{} | ||
144 | |||
145 | cfg.EnableSharedConfig = enableSharedConfig | ||
146 | |||
147 | setFromEnvVal(&cfg.Creds.AccessKeyID, credAccessEnvKey) | ||
148 | setFromEnvVal(&cfg.Creds.SecretAccessKey, credSecretEnvKey) | ||
149 | setFromEnvVal(&cfg.Creds.SessionToken, credSessionEnvKey) | ||
150 | |||
151 | // Require logical grouping of credentials | ||
152 | if len(cfg.Creds.AccessKeyID) == 0 || len(cfg.Creds.SecretAccessKey) == 0 { | ||
153 | cfg.Creds = credentials.Value{} | ||
154 | } else { | ||
155 | cfg.Creds.ProviderName = "EnvConfigCredentials" | ||
156 | } | ||
157 | |||
158 | regionKeys := regionEnvKeys | ||
159 | profileKeys := profileEnvKeys | ||
160 | if !cfg.EnableSharedConfig { | ||
161 | regionKeys = regionKeys[:1] | ||
162 | profileKeys = profileKeys[:1] | ||
163 | } | ||
164 | |||
165 | setFromEnvVal(&cfg.Region, regionKeys) | ||
166 | setFromEnvVal(&cfg.Profile, profileKeys) | ||
167 | |||
168 | cfg.SharedCredentialsFile = sharedCredentialsFilename() | ||
169 | cfg.SharedConfigFile = sharedConfigFilename() | ||
170 | |||
171 | cfg.CustomCABundle = os.Getenv("AWS_CA_BUNDLE") | ||
172 | |||
173 | return cfg | ||
174 | } | ||
175 | |||
176 | func setFromEnvVal(dst *string, keys []string) { | ||
177 | for _, k := range keys { | ||
178 | if v := os.Getenv(k); len(v) > 0 { | ||
179 | *dst = v | ||
180 | break | ||
181 | } | ||
182 | } | ||
183 | } | ||
184 | |||
185 | func sharedCredentialsFilename() string { | ||
186 | if name := os.Getenv("AWS_SHARED_CREDENTIALS_FILE"); len(name) > 0 { | ||
187 | return name | ||
188 | } | ||
189 | |||
190 | return filepath.Join(userHomeDir(), ".aws", "credentials") | ||
191 | } | ||
192 | |||
193 | func sharedConfigFilename() string { | ||
194 | if name := os.Getenv("AWS_CONFIG_FILE"); len(name) > 0 { | ||
195 | return name | ||
196 | } | ||
197 | |||
198 | return filepath.Join(userHomeDir(), ".aws", "config") | ||
199 | } | ||
200 | |||
201 | func userHomeDir() string { | ||
202 | homeDir := os.Getenv("HOME") // *nix | ||
203 | if len(homeDir) == 0 { // windows | ||
204 | homeDir = os.Getenv("USERPROFILE") | ||
205 | } | ||
206 | |||
207 | return homeDir | ||
208 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/session.go b/vendor/github.com/aws/aws-sdk-go/aws/session/session.go new file mode 100644 index 0000000..4792d3a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/session.go | |||
@@ -0,0 +1,590 @@ | |||
1 | package session | ||
2 | |||
3 | import ( | ||
4 | "crypto/tls" | ||
5 | "crypto/x509" | ||
6 | "fmt" | ||
7 | "io" | ||
8 | "io/ioutil" | ||
9 | "net/http" | ||
10 | "os" | ||
11 | |||
12 | "github.com/aws/aws-sdk-go/aws" | ||
13 | "github.com/aws/aws-sdk-go/aws/awserr" | ||
14 | "github.com/aws/aws-sdk-go/aws/client" | ||
15 | "github.com/aws/aws-sdk-go/aws/corehandlers" | ||
16 | "github.com/aws/aws-sdk-go/aws/credentials" | ||
17 | "github.com/aws/aws-sdk-go/aws/credentials/stscreds" | ||
18 | "github.com/aws/aws-sdk-go/aws/defaults" | ||
19 | "github.com/aws/aws-sdk-go/aws/endpoints" | ||
20 | "github.com/aws/aws-sdk-go/aws/request" | ||
21 | ) | ||
22 | |||
23 | // A Session provides a central location to create service clients from and | ||
24 | // store configurations and request handlers for those services. | ||
25 | // | ||
26 | // Sessions are safe to create service clients concurrently, but it is not safe | ||
27 | // to mutate the Session concurrently. | ||
28 | // | ||
29 | // The Session satisfies the service client's client.ClientConfigProvider. | ||
30 | type Session struct { | ||
31 | Config *aws.Config | ||
32 | Handlers request.Handlers | ||
33 | } | ||
34 | |||
35 | // New creates a new instance of the handlers merging in the provided configs | ||
36 | // on top of the SDK's default configurations. Once the Session is created it | ||
37 | // can be mutated to modify the Config or Handlers. The Session is safe to be | ||
38 | // read concurrently, but it should not be written to concurrently. | ||
39 | // | ||
40 | // If the AWS_SDK_LOAD_CONFIG environment is set to a truthy value, the New | ||
41 | // method could now encounter an error when loading the configuration. When | ||
42 | // The environment variable is set, and an error occurs, New will return a | ||
43 | // session that will fail all requests reporting the error that occurred while | ||
44 | // loading the session. Use NewSession to get the error when creating the | ||
45 | // session. | ||
46 | // | ||
47 | // If the AWS_SDK_LOAD_CONFIG environment variable is set to a truthy value | ||
48 | // the shared config file (~/.aws/config) will also be loaded, in addition to | ||
49 | // the shared credentials file (~/.aws/credentials). Values set in both the | ||
50 | // shared config, and shared credentials will be taken from the shared | ||
51 | // credentials file. | ||
52 | // | ||
53 | // Deprecated: Use NewSession functions to create sessions instead. NewSession | ||
54 | // has the same functionality as New except an error can be returned when the | ||
55 | // func is called instead of waiting to receive an error until a request is made. | ||
56 | func New(cfgs ...*aws.Config) *Session { | ||
57 | // load initial config from environment | ||
58 | envCfg := loadEnvConfig() | ||
59 | |||
60 | if envCfg.EnableSharedConfig { | ||
61 | s, err := newSession(Options{}, envCfg, cfgs...) | ||
62 | if err != nil { | ||
63 | // Old session.New expected all errors to be discovered when | ||
64 | // a request is made, and would report the errors then. This | ||
65 | // needs to be replicated if an error occurs while creating | ||
66 | // the session. | ||
67 | msg := "failed to create session with AWS_SDK_LOAD_CONFIG enabled. " + | ||
68 | "Use session.NewSession to handle errors occurring during session creation." | ||
69 | |||
70 | // Session creation failed, need to report the error and prevent | ||
71 | // any requests from succeeding. | ||
72 | s = &Session{Config: defaults.Config()} | ||
73 | s.Config.MergeIn(cfgs...) | ||
74 | s.Config.Logger.Log("ERROR:", msg, "Error:", err) | ||
75 | s.Handlers.Validate.PushBack(func(r *request.Request) { | ||
76 | r.Error = err | ||
77 | }) | ||
78 | } | ||
79 | return s | ||
80 | } | ||
81 | |||
82 | return deprecatedNewSession(cfgs...) | ||
83 | } | ||
84 | |||
85 | // NewSession returns a new Session created from SDK defaults, config files, | ||
86 | // environment, and user provided config files. Once the Session is created | ||
87 | // it can be mutated to modify the Config or Handlers. The Session is safe to | ||
88 | // be read concurrently, but it should not be written to concurrently. | ||
89 | // | ||
90 | // If the AWS_SDK_LOAD_CONFIG environment variable is set to a truthy value | ||
91 | // the shared config file (~/.aws/config) will also be loaded in addition to | ||
92 | // the shared credentials file (~/.aws/credentials). Values set in both the | ||
93 | // shared config, and shared credentials will be taken from the shared | ||
94 | // credentials file. Enabling the Shared Config will also allow the Session | ||
95 | // to be built with retrieving credentials with AssumeRole set in the config. | ||
96 | // | ||
97 | // See the NewSessionWithOptions func for information on how to override or | ||
98 | // control through code how the Session will be created. Such as specifying the | ||
99 | // config profile, and controlling if shared config is enabled or not. | ||
100 | func NewSession(cfgs ...*aws.Config) (*Session, error) { | ||
101 | opts := Options{} | ||
102 | opts.Config.MergeIn(cfgs...) | ||
103 | |||
104 | return NewSessionWithOptions(opts) | ||
105 | } | ||
106 | |||
107 | // SharedConfigState provides the ability to optionally override the state | ||
108 | // of the session's creation based on the shared config being enabled or | ||
109 | // disabled. | ||
110 | type SharedConfigState int | ||
111 | |||
112 | const ( | ||
113 | // SharedConfigStateFromEnv does not override any state of the | ||
114 | // AWS_SDK_LOAD_CONFIG env var. It is the default value of the | ||
115 | // SharedConfigState type. | ||
116 | SharedConfigStateFromEnv SharedConfigState = iota | ||
117 | |||
118 | // SharedConfigDisable overrides the AWS_SDK_LOAD_CONFIG env var value | ||
119 | // and disables the shared config functionality. | ||
120 | SharedConfigDisable | ||
121 | |||
122 | // SharedConfigEnable overrides the AWS_SDK_LOAD_CONFIG env var value | ||
123 | // and enables the shared config functionality. | ||
124 | SharedConfigEnable | ||
125 | ) | ||
126 | |||
127 | // Options provides the means to control how a Session is created and what | ||
128 | // configuration values will be loaded. | ||
129 | // | ||
130 | type Options struct { | ||
131 | // Provides config values for the SDK to use when creating service clients | ||
132 | // and making API requests to services. Any value set in with this field | ||
133 | // will override the associated value provided by the SDK defaults, | ||
134 | // environment or config files where relevant. | ||
135 | // | ||
136 | // If not set, configuration values from from SDK defaults, environment, | ||
137 | // config will be used. | ||
138 | Config aws.Config | ||
139 | |||
140 | // Overrides the config profile the Session should be created from. If not | ||
141 | // set the value of the environment variable will be loaded (AWS_PROFILE, | ||
142 | // or AWS_DEFAULT_PROFILE if the Shared Config is enabled). | ||
143 | // | ||
144 | // If not set and environment variables are not set the "default" | ||
145 | // (DefaultSharedConfigProfile) will be used as the profile to load the | ||
146 | // session config from. | ||
147 | Profile string | ||
148 | |||
149 | // Instructs how the Session will be created based on the AWS_SDK_LOAD_CONFIG | ||
150 | // environment variable. By default a Session will be created using the | ||
151 | // value provided by the AWS_SDK_LOAD_CONFIG environment variable. | ||
152 | // | ||
153 | // Setting this value to SharedConfigEnable or SharedConfigDisable | ||
154 | // will allow you to override the AWS_SDK_LOAD_CONFIG environment variable | ||
155 | // and enable or disable the shared config functionality. | ||
156 | SharedConfigState SharedConfigState | ||
157 | |||
158 | // When the SDK's shared config is configured to assume a role with MFA | ||
159 | // this option is required in order to provide the mechanism that will | ||
160 | // retrieve the MFA token. There is no default value for this field. If | ||
161 | // it is not set an error will be returned when creating the session. | ||
162 | // | ||
163 | // This token provider will be called when ever the assumed role's | ||
164 | // credentials need to be refreshed. Within the context of service clients | ||
165 | // all sharing the same session the SDK will ensure calls to the token | ||
166 | // provider are atomic. When sharing a token provider across multiple | ||
167 | // sessions additional synchronization logic is needed to ensure the | ||
168 | // token providers do not introduce race conditions. It is recommend to | ||
169 | // share the session where possible. | ||
170 | // | ||
171 | // stscreds.StdinTokenProvider is a basic implementation that will prompt | ||
172 | // from stdin for the MFA token code. | ||
173 | // | ||
174 | // This field is only used if the shared configuration is enabled, and | ||
175 | // the config enables assume role wit MFA via the mfa_serial field. | ||
176 | AssumeRoleTokenProvider func() (string, error) | ||
177 | |||
178 | // Reader for a custom Credentials Authority (CA) bundle in PEM format that | ||
179 | // the SDK will use instead of the default system's root CA bundle. Use this | ||
180 | // only if you want to replace the CA bundle the SDK uses for TLS requests. | ||
181 | // | ||
182 | // Enabling this option will attempt to merge the Transport into the SDK's HTTP | ||
183 | // client. If the client's Transport is not a http.Transport an error will be | ||
184 | // returned. If the Transport's TLS config is set this option will cause the SDK | ||
185 | // to overwrite the Transport's TLS config's RootCAs value. If the CA | ||
186 | // bundle reader contains multiple certificates all of them will be loaded. | ||
187 | // | ||
188 | // The Session option CustomCABundle is also available when creating sessions | ||
189 | // to also enable this feature. CustomCABundle session option field has priority | ||
190 | // over the AWS_CA_BUNDLE environment variable, and will be used if both are set. | ||
191 | CustomCABundle io.Reader | ||
192 | } | ||
193 | |||
194 | // NewSessionWithOptions returns a new Session created from SDK defaults, config files, | ||
195 | // environment, and user provided config files. This func uses the Options | ||
196 | // values to configure how the Session is created. | ||
197 | // | ||
198 | // If the AWS_SDK_LOAD_CONFIG environment variable is set to a truthy value | ||
199 | // the shared config file (~/.aws/config) will also be loaded in addition to | ||
200 | // the shared credentials file (~/.aws/credentials). Values set in both the | ||
201 | // shared config, and shared credentials will be taken from the shared | ||
202 | // credentials file. Enabling the Shared Config will also allow the Session | ||
203 | // to be built with retrieving credentials with AssumeRole set in the config. | ||
204 | // | ||
205 | // // Equivalent to session.New | ||
206 | // sess := session.Must(session.NewSessionWithOptions(session.Options{})) | ||
207 | // | ||
208 | // // Specify profile to load for the session's config | ||
209 | // sess := session.Must(session.NewSessionWithOptions(session.Options{ | ||
210 | // Profile: "profile_name", | ||
211 | // })) | ||
212 | // | ||
213 | // // Specify profile for config and region for requests | ||
214 | // sess := session.Must(session.NewSessionWithOptions(session.Options{ | ||
215 | // Config: aws.Config{Region: aws.String("us-east-1")}, | ||
216 | // Profile: "profile_name", | ||
217 | // })) | ||
218 | // | ||
219 | // // Force enable Shared Config support | ||
220 | // sess := session.Must(session.NewSessionWithOptions(session.Options{ | ||
221 | // SharedConfigState: session.SharedConfigEnable, | ||
222 | // })) | ||
223 | func NewSessionWithOptions(opts Options) (*Session, error) { | ||
224 | var envCfg envConfig | ||
225 | if opts.SharedConfigState == SharedConfigEnable { | ||
226 | envCfg = loadSharedEnvConfig() | ||
227 | } else { | ||
228 | envCfg = loadEnvConfig() | ||
229 | } | ||
230 | |||
231 | if len(opts.Profile) > 0 { | ||
232 | envCfg.Profile = opts.Profile | ||
233 | } | ||
234 | |||
235 | switch opts.SharedConfigState { | ||
236 | case SharedConfigDisable: | ||
237 | envCfg.EnableSharedConfig = false | ||
238 | case SharedConfigEnable: | ||
239 | envCfg.EnableSharedConfig = true | ||
240 | } | ||
241 | |||
242 | // Only use AWS_CA_BUNDLE if session option is not provided. | ||
243 | if len(envCfg.CustomCABundle) != 0 && opts.CustomCABundle == nil { | ||
244 | f, err := os.Open(envCfg.CustomCABundle) | ||
245 | if err != nil { | ||
246 | return nil, awserr.New("LoadCustomCABundleError", | ||
247 | "failed to open custom CA bundle PEM file", err) | ||
248 | } | ||
249 | defer f.Close() | ||
250 | opts.CustomCABundle = f | ||
251 | } | ||
252 | |||
253 | return newSession(opts, envCfg, &opts.Config) | ||
254 | } | ||
255 | |||
256 | // Must is a helper function to ensure the Session is valid and there was no | ||
257 | // error when calling a NewSession function. | ||
258 | // | ||
259 | // This helper is intended to be used in variable initialization to load the | ||
260 | // Session and configuration at startup. Such as: | ||
261 | // | ||
262 | // var sess = session.Must(session.NewSession()) | ||
263 | func Must(sess *Session, err error) *Session { | ||
264 | if err != nil { | ||
265 | panic(err) | ||
266 | } | ||
267 | |||
268 | return sess | ||
269 | } | ||
270 | |||
271 | func deprecatedNewSession(cfgs ...*aws.Config) *Session { | ||
272 | cfg := defaults.Config() | ||
273 | handlers := defaults.Handlers() | ||
274 | |||
275 | // Apply the passed in configs so the configuration can be applied to the | ||
276 | // default credential chain | ||
277 | cfg.MergeIn(cfgs...) | ||
278 | if cfg.EndpointResolver == nil { | ||
279 | // An endpoint resolver is required for a session to be able to provide | ||
280 | // endpoints for service client configurations. | ||
281 | cfg.EndpointResolver = endpoints.DefaultResolver() | ||
282 | } | ||
283 | cfg.Credentials = defaults.CredChain(cfg, handlers) | ||
284 | |||
285 | // Reapply any passed in configs to override credentials if set | ||
286 | cfg.MergeIn(cfgs...) | ||
287 | |||
288 | s := &Session{ | ||
289 | Config: cfg, | ||
290 | Handlers: handlers, | ||
291 | } | ||
292 | |||
293 | initHandlers(s) | ||
294 | |||
295 | return s | ||
296 | } | ||
297 | |||
298 | func newSession(opts Options, envCfg envConfig, cfgs ...*aws.Config) (*Session, error) { | ||
299 | cfg := defaults.Config() | ||
300 | handlers := defaults.Handlers() | ||
301 | |||
302 | // Get a merged version of the user provided config to determine if | ||
303 | // credentials were. | ||
304 | userCfg := &aws.Config{} | ||
305 | userCfg.MergeIn(cfgs...) | ||
306 | |||
307 | // Order config files will be loaded in with later files overwriting | ||
308 | // previous config file values. | ||
309 | cfgFiles := []string{envCfg.SharedConfigFile, envCfg.SharedCredentialsFile} | ||
310 | if !envCfg.EnableSharedConfig { | ||
311 | // The shared config file (~/.aws/config) is only loaded if instructed | ||
312 | // to load via the envConfig.EnableSharedConfig (AWS_SDK_LOAD_CONFIG). | ||
313 | cfgFiles = cfgFiles[1:] | ||
314 | } | ||
315 | |||
316 | // Load additional config from file(s) | ||
317 | sharedCfg, err := loadSharedConfig(envCfg.Profile, cfgFiles) | ||
318 | if err != nil { | ||
319 | return nil, err | ||
320 | } | ||
321 | |||
322 | if err := mergeConfigSrcs(cfg, userCfg, envCfg, sharedCfg, handlers, opts); err != nil { | ||
323 | return nil, err | ||
324 | } | ||
325 | |||
326 | s := &Session{ | ||
327 | Config: cfg, | ||
328 | Handlers: handlers, | ||
329 | } | ||
330 | |||
331 | initHandlers(s) | ||
332 | |||
333 | // Setup HTTP client with custom cert bundle if enabled | ||
334 | if opts.CustomCABundle != nil { | ||
335 | if err := loadCustomCABundle(s, opts.CustomCABundle); err != nil { | ||
336 | return nil, err | ||
337 | } | ||
338 | } | ||
339 | |||
340 | return s, nil | ||
341 | } | ||
342 | |||
343 | func loadCustomCABundle(s *Session, bundle io.Reader) error { | ||
344 | var t *http.Transport | ||
345 | switch v := s.Config.HTTPClient.Transport.(type) { | ||
346 | case *http.Transport: | ||
347 | t = v | ||
348 | default: | ||
349 | if s.Config.HTTPClient.Transport != nil { | ||
350 | return awserr.New("LoadCustomCABundleError", | ||
351 | "unable to load custom CA bundle, HTTPClient's transport unsupported type", nil) | ||
352 | } | ||
353 | } | ||
354 | if t == nil { | ||
355 | t = &http.Transport{} | ||
356 | } | ||
357 | |||
358 | p, err := loadCertPool(bundle) | ||
359 | if err != nil { | ||
360 | return err | ||
361 | } | ||
362 | if t.TLSClientConfig == nil { | ||
363 | t.TLSClientConfig = &tls.Config{} | ||
364 | } | ||
365 | t.TLSClientConfig.RootCAs = p | ||
366 | |||
367 | s.Config.HTTPClient.Transport = t | ||
368 | |||
369 | return nil | ||
370 | } | ||
371 | |||
372 | func loadCertPool(r io.Reader) (*x509.CertPool, error) { | ||
373 | b, err := ioutil.ReadAll(r) | ||
374 | if err != nil { | ||
375 | return nil, awserr.New("LoadCustomCABundleError", | ||
376 | "failed to read custom CA bundle PEM file", err) | ||
377 | } | ||
378 | |||
379 | p := x509.NewCertPool() | ||
380 | if !p.AppendCertsFromPEM(b) { | ||
381 | return nil, awserr.New("LoadCustomCABundleError", | ||
382 | "failed to load custom CA bundle PEM file", err) | ||
383 | } | ||
384 | |||
385 | return p, nil | ||
386 | } | ||
387 | |||
388 | func mergeConfigSrcs(cfg, userCfg *aws.Config, envCfg envConfig, sharedCfg sharedConfig, handlers request.Handlers, sessOpts Options) error { | ||
389 | // Merge in user provided configuration | ||
390 | cfg.MergeIn(userCfg) | ||
391 | |||
392 | // Region if not already set by user | ||
393 | if len(aws.StringValue(cfg.Region)) == 0 { | ||
394 | if len(envCfg.Region) > 0 { | ||
395 | cfg.WithRegion(envCfg.Region) | ||
396 | } else if envCfg.EnableSharedConfig && len(sharedCfg.Region) > 0 { | ||
397 | cfg.WithRegion(sharedCfg.Region) | ||
398 | } | ||
399 | } | ||
400 | |||
401 | // Configure credentials if not already set | ||
402 | if cfg.Credentials == credentials.AnonymousCredentials && userCfg.Credentials == nil { | ||
403 | if len(envCfg.Creds.AccessKeyID) > 0 { | ||
404 | cfg.Credentials = credentials.NewStaticCredentialsFromCreds( | ||
405 | envCfg.Creds, | ||
406 | ) | ||
407 | } else if envCfg.EnableSharedConfig && len(sharedCfg.AssumeRole.RoleARN) > 0 && sharedCfg.AssumeRoleSource != nil { | ||
408 | cfgCp := *cfg | ||
409 | cfgCp.Credentials = credentials.NewStaticCredentialsFromCreds( | ||
410 | sharedCfg.AssumeRoleSource.Creds, | ||
411 | ) | ||
412 | if len(sharedCfg.AssumeRole.MFASerial) > 0 && sessOpts.AssumeRoleTokenProvider == nil { | ||
413 | // AssumeRole Token provider is required if doing Assume Role | ||
414 | // with MFA. | ||
415 | return AssumeRoleTokenProviderNotSetError{} | ||
416 | } | ||
417 | cfg.Credentials = stscreds.NewCredentials( | ||
418 | &Session{ | ||
419 | Config: &cfgCp, | ||
420 | Handlers: handlers.Copy(), | ||
421 | }, | ||
422 | sharedCfg.AssumeRole.RoleARN, | ||
423 | func(opt *stscreds.AssumeRoleProvider) { | ||
424 | opt.RoleSessionName = sharedCfg.AssumeRole.RoleSessionName | ||
425 | |||
426 | // Assume role with external ID | ||
427 | if len(sharedCfg.AssumeRole.ExternalID) > 0 { | ||
428 | opt.ExternalID = aws.String(sharedCfg.AssumeRole.ExternalID) | ||
429 | } | ||
430 | |||
431 | // Assume role with MFA | ||
432 | if len(sharedCfg.AssumeRole.MFASerial) > 0 { | ||
433 | opt.SerialNumber = aws.String(sharedCfg.AssumeRole.MFASerial) | ||
434 | opt.TokenProvider = sessOpts.AssumeRoleTokenProvider | ||
435 | } | ||
436 | }, | ||
437 | ) | ||
438 | } else if len(sharedCfg.Creds.AccessKeyID) > 0 { | ||
439 | cfg.Credentials = credentials.NewStaticCredentialsFromCreds( | ||
440 | sharedCfg.Creds, | ||
441 | ) | ||
442 | } else { | ||
443 | // Fallback to default credentials provider, include mock errors | ||
444 | // for the credential chain so user can identify why credentials | ||
445 | // failed to be retrieved. | ||
446 | cfg.Credentials = credentials.NewCredentials(&credentials.ChainProvider{ | ||
447 | VerboseErrors: aws.BoolValue(cfg.CredentialsChainVerboseErrors), | ||
448 | Providers: []credentials.Provider{ | ||
449 | &credProviderError{Err: awserr.New("EnvAccessKeyNotFound", "failed to find credentials in the environment.", nil)}, | ||
450 | &credProviderError{Err: awserr.New("SharedCredsLoad", fmt.Sprintf("failed to load profile, %s.", envCfg.Profile), nil)}, | ||
451 | defaults.RemoteCredProvider(*cfg, handlers), | ||
452 | }, | ||
453 | }) | ||
454 | } | ||
455 | } | ||
456 | |||
457 | return nil | ||
458 | } | ||
459 | |||
460 | // AssumeRoleTokenProviderNotSetError is an error returned when creating a session when the | ||
461 | // MFAToken option is not set when shared config is configured load assume a | ||
462 | // role with an MFA token. | ||
463 | type AssumeRoleTokenProviderNotSetError struct{} | ||
464 | |||
465 | // Code is the short id of the error. | ||
466 | func (e AssumeRoleTokenProviderNotSetError) Code() string { | ||
467 | return "AssumeRoleTokenProviderNotSetError" | ||
468 | } | ||
469 | |||
470 | // Message is the description of the error | ||
471 | func (e AssumeRoleTokenProviderNotSetError) Message() string { | ||
472 | return fmt.Sprintf("assume role with MFA enabled, but AssumeRoleTokenProvider session option not set.") | ||
473 | } | ||
474 | |||
475 | // OrigErr is the underlying error that caused the failure. | ||
476 | func (e AssumeRoleTokenProviderNotSetError) OrigErr() error { | ||
477 | return nil | ||
478 | } | ||
479 | |||
480 | // Error satisfies the error interface. | ||
481 | func (e AssumeRoleTokenProviderNotSetError) Error() string { | ||
482 | return awserr.SprintError(e.Code(), e.Message(), "", nil) | ||
483 | } | ||
484 | |||
485 | type credProviderError struct { | ||
486 | Err error | ||
487 | } | ||
488 | |||
489 | var emptyCreds = credentials.Value{} | ||
490 | |||
491 | func (c credProviderError) Retrieve() (credentials.Value, error) { | ||
492 | return credentials.Value{}, c.Err | ||
493 | } | ||
494 | func (c credProviderError) IsExpired() bool { | ||
495 | return true | ||
496 | } | ||
497 | |||
498 | func initHandlers(s *Session) { | ||
499 | // Add the Validate parameter handler if it is not disabled. | ||
500 | s.Handlers.Validate.Remove(corehandlers.ValidateParametersHandler) | ||
501 | if !aws.BoolValue(s.Config.DisableParamValidation) { | ||
502 | s.Handlers.Validate.PushBackNamed(corehandlers.ValidateParametersHandler) | ||
503 | } | ||
504 | } | ||
505 | |||
506 | // Copy creates and returns a copy of the current Session, coping the config | ||
507 | // and handlers. If any additional configs are provided they will be merged | ||
508 | // on top of the Session's copied config. | ||
509 | // | ||
510 | // // Create a copy of the current Session, configured for the us-west-2 region. | ||
511 | // sess.Copy(&aws.Config{Region: aws.String("us-west-2")}) | ||
512 | func (s *Session) Copy(cfgs ...*aws.Config) *Session { | ||
513 | newSession := &Session{ | ||
514 | Config: s.Config.Copy(cfgs...), | ||
515 | Handlers: s.Handlers.Copy(), | ||
516 | } | ||
517 | |||
518 | initHandlers(newSession) | ||
519 | |||
520 | return newSession | ||
521 | } | ||
522 | |||
523 | // ClientConfig satisfies the client.ConfigProvider interface and is used to | ||
524 | // configure the service client instances. Passing the Session to the service | ||
525 | // client's constructor (New) will use this method to configure the client. | ||
526 | func (s *Session) ClientConfig(serviceName string, cfgs ...*aws.Config) client.Config { | ||
527 | // Backwards compatibility, the error will be eaten if user calls ClientConfig | ||
528 | // directly. All SDK services will use ClientconfigWithError. | ||
529 | cfg, _ := s.clientConfigWithErr(serviceName, cfgs...) | ||
530 | |||
531 | return cfg | ||
532 | } | ||
533 | |||
534 | func (s *Session) clientConfigWithErr(serviceName string, cfgs ...*aws.Config) (client.Config, error) { | ||
535 | s = s.Copy(cfgs...) | ||
536 | |||
537 | var resolved endpoints.ResolvedEndpoint | ||
538 | var err error | ||
539 | |||
540 | region := aws.StringValue(s.Config.Region) | ||
541 | |||
542 | if endpoint := aws.StringValue(s.Config.Endpoint); len(endpoint) != 0 { | ||
543 | resolved.URL = endpoints.AddScheme(endpoint, aws.BoolValue(s.Config.DisableSSL)) | ||
544 | resolved.SigningRegion = region | ||
545 | } else { | ||
546 | resolved, err = s.Config.EndpointResolver.EndpointFor( | ||
547 | serviceName, region, | ||
548 | func(opt *endpoints.Options) { | ||
549 | opt.DisableSSL = aws.BoolValue(s.Config.DisableSSL) | ||
550 | opt.UseDualStack = aws.BoolValue(s.Config.UseDualStack) | ||
551 | |||
552 | // Support the condition where the service is modeled but its | ||
553 | // endpoint metadata is not available. | ||
554 | opt.ResolveUnknownService = true | ||
555 | }, | ||
556 | ) | ||
557 | } | ||
558 | |||
559 | return client.Config{ | ||
560 | Config: s.Config, | ||
561 | Handlers: s.Handlers, | ||
562 | Endpoint: resolved.URL, | ||
563 | SigningRegion: resolved.SigningRegion, | ||
564 | SigningName: resolved.SigningName, | ||
565 | }, err | ||
566 | } | ||
567 | |||
568 | // ClientConfigNoResolveEndpoint is the same as ClientConfig with the exception | ||
569 | // that the EndpointResolver will not be used to resolve the endpoint. The only | ||
570 | // endpoint set must come from the aws.Config.Endpoint field. | ||
571 | func (s *Session) ClientConfigNoResolveEndpoint(cfgs ...*aws.Config) client.Config { | ||
572 | s = s.Copy(cfgs...) | ||
573 | |||
574 | var resolved endpoints.ResolvedEndpoint | ||
575 | |||
576 | region := aws.StringValue(s.Config.Region) | ||
577 | |||
578 | if ep := aws.StringValue(s.Config.Endpoint); len(ep) > 0 { | ||
579 | resolved.URL = endpoints.AddScheme(ep, aws.BoolValue(s.Config.DisableSSL)) | ||
580 | resolved.SigningRegion = region | ||
581 | } | ||
582 | |||
583 | return client.Config{ | ||
584 | Config: s.Config, | ||
585 | Handlers: s.Handlers, | ||
586 | Endpoint: resolved.URL, | ||
587 | SigningRegion: resolved.SigningRegion, | ||
588 | SigningName: resolved.SigningName, | ||
589 | } | ||
590 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go b/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go new file mode 100644 index 0000000..b58076f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go | |||
@@ -0,0 +1,295 @@ | |||
1 | package session | ||
2 | |||
3 | import ( | ||
4 | "fmt" | ||
5 | "io/ioutil" | ||
6 | |||
7 | "github.com/aws/aws-sdk-go/aws/awserr" | ||
8 | "github.com/aws/aws-sdk-go/aws/credentials" | ||
9 | "github.com/go-ini/ini" | ||
10 | ) | ||
11 | |||
12 | const ( | ||
13 | // Static Credentials group | ||
14 | accessKeyIDKey = `aws_access_key_id` // group required | ||
15 | secretAccessKey = `aws_secret_access_key` // group required | ||
16 | sessionTokenKey = `aws_session_token` // optional | ||
17 | |||
18 | // Assume Role Credentials group | ||
19 | roleArnKey = `role_arn` // group required | ||
20 | sourceProfileKey = `source_profile` // group required | ||
21 | externalIDKey = `external_id` // optional | ||
22 | mfaSerialKey = `mfa_serial` // optional | ||
23 | roleSessionNameKey = `role_session_name` // optional | ||
24 | |||
25 | // Additional Config fields | ||
26 | regionKey = `region` | ||
27 | |||
28 | // DefaultSharedConfigProfile is the default profile to be used when | ||
29 | // loading configuration from the config files if another profile name | ||
30 | // is not provided. | ||
31 | DefaultSharedConfigProfile = `default` | ||
32 | ) | ||
33 | |||
34 | type assumeRoleConfig struct { | ||
35 | RoleARN string | ||
36 | SourceProfile string | ||
37 | ExternalID string | ||
38 | MFASerial string | ||
39 | RoleSessionName string | ||
40 | } | ||
41 | |||
42 | // sharedConfig represents the configuration fields of the SDK config files. | ||
43 | type sharedConfig struct { | ||
44 | // Credentials values from the config file. Both aws_access_key_id | ||
45 | // and aws_secret_access_key must be provided together in the same file | ||
46 | // to be considered valid. The values will be ignored if not a complete group. | ||
47 | // aws_session_token is an optional field that can be provided if both of the | ||
48 | // other two fields are also provided. | ||
49 | // | ||
50 | // aws_access_key_id | ||
51 | // aws_secret_access_key | ||
52 | // aws_session_token | ||
53 | Creds credentials.Value | ||
54 | |||
55 | AssumeRole assumeRoleConfig | ||
56 | AssumeRoleSource *sharedConfig | ||
57 | |||
58 | // Region is the region the SDK should use for looking up AWS service endpoints | ||
59 | // and signing requests. | ||
60 | // | ||
61 | // region | ||
62 | Region string | ||
63 | } | ||
64 | |||
65 | type sharedConfigFile struct { | ||
66 | Filename string | ||
67 | IniData *ini.File | ||
68 | } | ||
69 | |||
70 | // loadSharedConfig retrieves the configuration from the list of files | ||
71 | // using the profile provided. The order the files are listed will determine | ||
72 | // precedence. Values in subsequent files will overwrite values defined in | ||
73 | // earlier files. | ||
74 | // | ||
75 | // For example, given two files A and B. Both define credentials. If the order | ||
76 | // of the files are A then B, B's credential values will be used instead of A's. | ||
77 | // | ||
78 | // See sharedConfig.setFromFile for information how the config files | ||
79 | // will be loaded. | ||
80 | func loadSharedConfig(profile string, filenames []string) (sharedConfig, error) { | ||
81 | if len(profile) == 0 { | ||
82 | profile = DefaultSharedConfigProfile | ||
83 | } | ||
84 | |||
85 | files, err := loadSharedConfigIniFiles(filenames) | ||
86 | if err != nil { | ||
87 | return sharedConfig{}, err | ||
88 | } | ||
89 | |||
90 | cfg := sharedConfig{} | ||
91 | if err = cfg.setFromIniFiles(profile, files); err != nil { | ||
92 | return sharedConfig{}, err | ||
93 | } | ||
94 | |||
95 | if len(cfg.AssumeRole.SourceProfile) > 0 { | ||
96 | if err := cfg.setAssumeRoleSource(profile, files); err != nil { | ||
97 | return sharedConfig{}, err | ||
98 | } | ||
99 | } | ||
100 | |||
101 | return cfg, nil | ||
102 | } | ||
103 | |||
104 | func loadSharedConfigIniFiles(filenames []string) ([]sharedConfigFile, error) { | ||
105 | files := make([]sharedConfigFile, 0, len(filenames)) | ||
106 | |||
107 | for _, filename := range filenames { | ||
108 | b, err := ioutil.ReadFile(filename) | ||
109 | if err != nil { | ||
110 | // Skip files which can't be opened and read for whatever reason | ||
111 | continue | ||
112 | } | ||
113 | |||
114 | f, err := ini.Load(b) | ||
115 | if err != nil { | ||
116 | return nil, SharedConfigLoadError{Filename: filename} | ||
117 | } | ||
118 | |||
119 | files = append(files, sharedConfigFile{ | ||
120 | Filename: filename, IniData: f, | ||
121 | }) | ||
122 | } | ||
123 | |||
124 | return files, nil | ||
125 | } | ||
126 | |||
127 | func (cfg *sharedConfig) setAssumeRoleSource(origProfile string, files []sharedConfigFile) error { | ||
128 | var assumeRoleSrc sharedConfig | ||
129 | |||
130 | // Multiple level assume role chains are not support | ||
131 | if cfg.AssumeRole.SourceProfile == origProfile { | ||
132 | assumeRoleSrc = *cfg | ||
133 | assumeRoleSrc.AssumeRole = assumeRoleConfig{} | ||
134 | } else { | ||
135 | err := assumeRoleSrc.setFromIniFiles(cfg.AssumeRole.SourceProfile, files) | ||
136 | if err != nil { | ||
137 | return err | ||
138 | } | ||
139 | } | ||
140 | |||
141 | if len(assumeRoleSrc.Creds.AccessKeyID) == 0 { | ||
142 | return SharedConfigAssumeRoleError{RoleARN: cfg.AssumeRole.RoleARN} | ||
143 | } | ||
144 | |||
145 | cfg.AssumeRoleSource = &assumeRoleSrc | ||
146 | |||
147 | return nil | ||
148 | } | ||
149 | |||
150 | func (cfg *sharedConfig) setFromIniFiles(profile string, files []sharedConfigFile) error { | ||
151 | // Trim files from the list that don't exist. | ||
152 | for _, f := range files { | ||
153 | if err := cfg.setFromIniFile(profile, f); err != nil { | ||
154 | if _, ok := err.(SharedConfigProfileNotExistsError); ok { | ||
155 | // Ignore proviles missings | ||
156 | continue | ||
157 | } | ||
158 | return err | ||
159 | } | ||
160 | } | ||
161 | |||
162 | return nil | ||
163 | } | ||
164 | |||
165 | // setFromFile loads the configuration from the file using | ||
166 | // the profile provided. A sharedConfig pointer type value is used so that | ||
167 | // multiple config file loadings can be chained. | ||
168 | // | ||
169 | // Only loads complete logically grouped values, and will not set fields in cfg | ||
170 | // for incomplete grouped values in the config. Such as credentials. For example | ||
171 | // if a config file only includes aws_access_key_id but no aws_secret_access_key | ||
172 | // the aws_access_key_id will be ignored. | ||
173 | func (cfg *sharedConfig) setFromIniFile(profile string, file sharedConfigFile) error { | ||
174 | section, err := file.IniData.GetSection(profile) | ||
175 | if err != nil { | ||
176 | // Fallback to to alternate profile name: profile <name> | ||
177 | section, err = file.IniData.GetSection(fmt.Sprintf("profile %s", profile)) | ||
178 | if err != nil { | ||
179 | return SharedConfigProfileNotExistsError{Profile: profile, Err: err} | ||
180 | } | ||
181 | } | ||
182 | |||
183 | // Shared Credentials | ||
184 | akid := section.Key(accessKeyIDKey).String() | ||
185 | secret := section.Key(secretAccessKey).String() | ||
186 | if len(akid) > 0 && len(secret) > 0 { | ||
187 | cfg.Creds = credentials.Value{ | ||
188 | AccessKeyID: akid, | ||
189 | SecretAccessKey: secret, | ||
190 | SessionToken: section.Key(sessionTokenKey).String(), | ||
191 | ProviderName: fmt.Sprintf("SharedConfigCredentials: %s", file.Filename), | ||
192 | } | ||
193 | } | ||
194 | |||
195 | // Assume Role | ||
196 | roleArn := section.Key(roleArnKey).String() | ||
197 | srcProfile := section.Key(sourceProfileKey).String() | ||
198 | if len(roleArn) > 0 && len(srcProfile) > 0 { | ||
199 | cfg.AssumeRole = assumeRoleConfig{ | ||
200 | RoleARN: roleArn, | ||
201 | SourceProfile: srcProfile, | ||
202 | ExternalID: section.Key(externalIDKey).String(), | ||
203 | MFASerial: section.Key(mfaSerialKey).String(), | ||
204 | RoleSessionName: section.Key(roleSessionNameKey).String(), | ||
205 | } | ||
206 | } | ||
207 | |||
208 | // Region | ||
209 | if v := section.Key(regionKey).String(); len(v) > 0 { | ||
210 | cfg.Region = v | ||
211 | } | ||
212 | |||
213 | return nil | ||
214 | } | ||
215 | |||
216 | // SharedConfigLoadError is an error for the shared config file failed to load. | ||
217 | type SharedConfigLoadError struct { | ||
218 | Filename string | ||
219 | Err error | ||
220 | } | ||
221 | |||
222 | // Code is the short id of the error. | ||
223 | func (e SharedConfigLoadError) Code() string { | ||
224 | return "SharedConfigLoadError" | ||
225 | } | ||
226 | |||
227 | // Message is the description of the error | ||
228 | func (e SharedConfigLoadError) Message() string { | ||
229 | return fmt.Sprintf("failed to load config file, %s", e.Filename) | ||
230 | } | ||
231 | |||
232 | // OrigErr is the underlying error that caused the failure. | ||
233 | func (e SharedConfigLoadError) OrigErr() error { | ||
234 | return e.Err | ||
235 | } | ||
236 | |||
237 | // Error satisfies the error interface. | ||
238 | func (e SharedConfigLoadError) Error() string { | ||
239 | return awserr.SprintError(e.Code(), e.Message(), "", e.Err) | ||
240 | } | ||
241 | |||
242 | // SharedConfigProfileNotExistsError is an error for the shared config when | ||
243 | // the profile was not find in the config file. | ||
244 | type SharedConfigProfileNotExistsError struct { | ||
245 | Profile string | ||
246 | Err error | ||
247 | } | ||
248 | |||
249 | // Code is the short id of the error. | ||
250 | func (e SharedConfigProfileNotExistsError) Code() string { | ||
251 | return "SharedConfigProfileNotExistsError" | ||
252 | } | ||
253 | |||
254 | // Message is the description of the error | ||
255 | func (e SharedConfigProfileNotExistsError) Message() string { | ||
256 | return fmt.Sprintf("failed to get profile, %s", e.Profile) | ||
257 | } | ||
258 | |||
259 | // OrigErr is the underlying error that caused the failure. | ||
260 | func (e SharedConfigProfileNotExistsError) OrigErr() error { | ||
261 | return e.Err | ||
262 | } | ||
263 | |||
264 | // Error satisfies the error interface. | ||
265 | func (e SharedConfigProfileNotExistsError) Error() string { | ||
266 | return awserr.SprintError(e.Code(), e.Message(), "", e.Err) | ||
267 | } | ||
268 | |||
269 | // SharedConfigAssumeRoleError is an error for the shared config when the | ||
270 | // profile contains assume role information, but that information is invalid | ||
271 | // or not complete. | ||
272 | type SharedConfigAssumeRoleError struct { | ||
273 | RoleARN string | ||
274 | } | ||
275 | |||
276 | // Code is the short id of the error. | ||
277 | func (e SharedConfigAssumeRoleError) Code() string { | ||
278 | return "SharedConfigAssumeRoleError" | ||
279 | } | ||
280 | |||
281 | // Message is the description of the error | ||
282 | func (e SharedConfigAssumeRoleError) Message() string { | ||
283 | return fmt.Sprintf("failed to load assume role for %s, source profile has no shared credentials", | ||
284 | e.RoleARN) | ||
285 | } | ||
286 | |||
287 | // OrigErr is the underlying error that caused the failure. | ||
288 | func (e SharedConfigAssumeRoleError) OrigErr() error { | ||
289 | return nil | ||
290 | } | ||
291 | |||
292 | // Error satisfies the error interface. | ||
293 | func (e SharedConfigAssumeRoleError) Error() string { | ||
294 | return awserr.SprintError(e.Code(), e.Message(), "", nil) | ||
295 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/header_rules.go b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/header_rules.go new file mode 100644 index 0000000..244c86d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/header_rules.go | |||
@@ -0,0 +1,82 @@ | |||
1 | package v4 | ||
2 | |||
3 | import ( | ||
4 | "net/http" | ||
5 | "strings" | ||
6 | ) | ||
7 | |||
8 | // validator houses a set of rule needed for validation of a | ||
9 | // string value | ||
10 | type rules []rule | ||
11 | |||
12 | // rule interface allows for more flexible rules and just simply | ||
13 | // checks whether or not a value adheres to that rule | ||
14 | type rule interface { | ||
15 | IsValid(value string) bool | ||
16 | } | ||
17 | |||
18 | // IsValid will iterate through all rules and see if any rules | ||
19 | // apply to the value and supports nested rules | ||
20 | func (r rules) IsValid(value string) bool { | ||
21 | for _, rule := range r { | ||
22 | if rule.IsValid(value) { | ||
23 | return true | ||
24 | } | ||
25 | } | ||
26 | return false | ||
27 | } | ||
28 | |||
29 | // mapRule generic rule for maps | ||
30 | type mapRule map[string]struct{} | ||
31 | |||
32 | // IsValid for the map rule satisfies whether it exists in the map | ||
33 | func (m mapRule) IsValid(value string) bool { | ||
34 | _, ok := m[value] | ||
35 | return ok | ||
36 | } | ||
37 | |||
38 | // whitelist is a generic rule for whitelisting | ||
39 | type whitelist struct { | ||
40 | rule | ||
41 | } | ||
42 | |||
43 | // IsValid for whitelist checks if the value is within the whitelist | ||
44 | func (w whitelist) IsValid(value string) bool { | ||
45 | return w.rule.IsValid(value) | ||
46 | } | ||
47 | |||
48 | // blacklist is a generic rule for blacklisting | ||
49 | type blacklist struct { | ||
50 | rule | ||
51 | } | ||
52 | |||
53 | // IsValid for whitelist checks if the value is within the whitelist | ||
54 | func (b blacklist) IsValid(value string) bool { | ||
55 | return !b.rule.IsValid(value) | ||
56 | } | ||
57 | |||
58 | type patterns []string | ||
59 | |||
60 | // IsValid for patterns checks each pattern and returns if a match has | ||
61 | // been found | ||
62 | func (p patterns) IsValid(value string) bool { | ||
63 | for _, pattern := range p { | ||
64 | if strings.HasPrefix(http.CanonicalHeaderKey(value), pattern) { | ||
65 | return true | ||
66 | } | ||
67 | } | ||
68 | return false | ||
69 | } | ||
70 | |||
71 | // inclusiveRules rules allow for rules to depend on one another | ||
72 | type inclusiveRules []rule | ||
73 | |||
74 | // IsValid will return true if all rules are true | ||
75 | func (r inclusiveRules) IsValid(value string) bool { | ||
76 | for _, rule := range r { | ||
77 | if !rule.IsValid(value) { | ||
78 | return false | ||
79 | } | ||
80 | } | ||
81 | return true | ||
82 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/options.go b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/options.go new file mode 100644 index 0000000..6aa2ed2 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/options.go | |||
@@ -0,0 +1,7 @@ | |||
1 | package v4 | ||
2 | |||
3 | // WithUnsignedPayload will enable and set the UnsignedPayload field to | ||
4 | // true of the signer. | ||
5 | func WithUnsignedPayload(v4 *Signer) { | ||
6 | v4.UnsignedPayload = true | ||
7 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/uri_path.go b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/uri_path.go new file mode 100644 index 0000000..bd082e9 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/uri_path.go | |||
@@ -0,0 +1,24 @@ | |||
1 | // +build go1.5 | ||
2 | |||
3 | package v4 | ||
4 | |||
5 | import ( | ||
6 | "net/url" | ||
7 | "strings" | ||
8 | ) | ||
9 | |||
10 | func getURIPath(u *url.URL) string { | ||
11 | var uri string | ||
12 | |||
13 | if len(u.Opaque) > 0 { | ||
14 | uri = "/" + strings.Join(strings.Split(u.Opaque, "/")[3:], "/") | ||
15 | } else { | ||
16 | uri = u.EscapedPath() | ||
17 | } | ||
18 | |||
19 | if len(uri) == 0 { | ||
20 | uri = "/" | ||
21 | } | ||
22 | |||
23 | return uri | ||
24 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go new file mode 100644 index 0000000..434ac87 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go | |||
@@ -0,0 +1,761 @@ | |||
1 | // Package v4 implements signing for AWS V4 signer | ||
2 | // | ||
3 | // Provides request signing for request that need to be signed with | ||
4 | // AWS V4 Signatures. | ||
5 | // | ||
6 | // Standalone Signer | ||
7 | // | ||
8 | // Generally using the signer outside of the SDK should not require any additional | ||
9 | // logic when using Go v1.5 or higher. The signer does this by taking advantage | ||
10 | // of the URL.EscapedPath method. If your request URI requires additional escaping | ||
11 | // you many need to use the URL.Opaque to define what the raw URI should be sent | ||
12 | // to the service as. | ||
13 | // | ||
14 | // The signer will first check the URL.Opaque field, and use its value if set. | ||
15 | // The signer does require the URL.Opaque field to be set in the form of: | ||
16 | // | ||
17 | // "//<hostname>/<path>" | ||
18 | // | ||
19 | // // e.g. | ||
20 | // "//example.com/some/path" | ||
21 | // | ||
22 | // The leading "//" and hostname are required or the URL.Opaque escaping will | ||
23 | // not work correctly. | ||
24 | // | ||
25 | // If URL.Opaque is not set the signer will fallback to the URL.EscapedPath() | ||
26 | // method and using the returned value. If you're using Go v1.4 you must set | ||
27 | // URL.Opaque if the URI path needs escaping. If URL.Opaque is not set with | ||
28 | // Go v1.5 the signer will fallback to URL.Path. | ||
29 | // | ||
30 | // AWS v4 signature validation requires that the canonical string's URI path | ||
31 | // element must be the URI escaped form of the HTTP request's path. | ||
32 | // http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html | ||
33 | // | ||
34 | // The Go HTTP client will perform escaping automatically on the request. Some | ||
35 | // of these escaping may cause signature validation errors because the HTTP | ||
36 | // request differs from the URI path or query that the signature was generated. | ||
37 | // https://golang.org/pkg/net/url/#URL.EscapedPath | ||
38 | // | ||
39 | // Because of this, it is recommended that when using the signer outside of the | ||
40 | // SDK that explicitly escaping the request prior to being signed is preferable, | ||
41 | // and will help prevent signature validation errors. This can be done by setting | ||
42 | // the URL.Opaque or URL.RawPath. The SDK will use URL.Opaque first and then | ||
43 | // call URL.EscapedPath() if Opaque is not set. | ||
44 | // | ||
45 | // If signing a request intended for HTTP2 server, and you're using Go 1.6.2 | ||
46 | // through 1.7.4 you should use the URL.RawPath as the pre-escaped form of the | ||
47 | // request URL. https://github.com/golang/go/issues/16847 points to a bug in | ||
48 | // Go pre 1.8 that failes to make HTTP2 requests using absolute URL in the HTTP | ||
49 | // message. URL.Opaque generally will force Go to make requests with absolute URL. | ||
50 | // URL.RawPath does not do this, but RawPath must be a valid escaping of Path | ||
51 | // or url.EscapedPath will ignore the RawPath escaping. | ||
52 | // | ||
53 | // Test `TestStandaloneSign` provides a complete example of using the signer | ||
54 | // outside of the SDK and pre-escaping the URI path. | ||
55 | package v4 | ||
56 | |||
57 | import ( | ||
58 | "bytes" | ||
59 | "crypto/hmac" | ||
60 | "crypto/sha256" | ||
61 | "encoding/hex" | ||
62 | "fmt" | ||
63 | "io" | ||
64 | "io/ioutil" | ||
65 | "net/http" | ||
66 | "net/url" | ||
67 | "sort" | ||
68 | "strconv" | ||
69 | "strings" | ||
70 | "time" | ||
71 | |||
72 | "github.com/aws/aws-sdk-go/aws" | ||
73 | "github.com/aws/aws-sdk-go/aws/credentials" | ||
74 | "github.com/aws/aws-sdk-go/aws/request" | ||
75 | "github.com/aws/aws-sdk-go/private/protocol/rest" | ||
76 | ) | ||
77 | |||
78 | const ( | ||
79 | authHeaderPrefix = "AWS4-HMAC-SHA256" | ||
80 | timeFormat = "20060102T150405Z" | ||
81 | shortTimeFormat = "20060102" | ||
82 | |||
83 | // emptyStringSHA256 is a SHA256 of an empty string | ||
84 | emptyStringSHA256 = `e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855` | ||
85 | ) | ||
86 | |||
87 | var ignoredHeaders = rules{ | ||
88 | blacklist{ | ||
89 | mapRule{ | ||
90 | "Authorization": struct{}{}, | ||
91 | "User-Agent": struct{}{}, | ||
92 | "X-Amzn-Trace-Id": struct{}{}, | ||
93 | }, | ||
94 | }, | ||
95 | } | ||
96 | |||
97 | // requiredSignedHeaders is a whitelist for build canonical headers. | ||
98 | var requiredSignedHeaders = rules{ | ||
99 | whitelist{ | ||
100 | mapRule{ | ||
101 | "Cache-Control": struct{}{}, | ||
102 | "Content-Disposition": struct{}{}, | ||
103 | "Content-Encoding": struct{}{}, | ||
104 | "Content-Language": struct{}{}, | ||
105 | "Content-Md5": struct{}{}, | ||
106 | "Content-Type": struct{}{}, | ||
107 | "Expires": struct{}{}, | ||
108 | "If-Match": struct{}{}, | ||
109 | "If-Modified-Since": struct{}{}, | ||
110 | "If-None-Match": struct{}{}, | ||
111 | "If-Unmodified-Since": struct{}{}, | ||
112 | "Range": struct{}{}, | ||
113 | "X-Amz-Acl": struct{}{}, | ||
114 | "X-Amz-Copy-Source": struct{}{}, | ||
115 | "X-Amz-Copy-Source-If-Match": struct{}{}, | ||
116 | "X-Amz-Copy-Source-If-Modified-Since": struct{}{}, | ||
117 | "X-Amz-Copy-Source-If-None-Match": struct{}{}, | ||
118 | "X-Amz-Copy-Source-If-Unmodified-Since": struct{}{}, | ||
119 | "X-Amz-Copy-Source-Range": struct{}{}, | ||
120 | "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Algorithm": struct{}{}, | ||
121 | "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key": struct{}{}, | ||
122 | "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key-Md5": struct{}{}, | ||
123 | "X-Amz-Grant-Full-control": struct{}{}, | ||
124 | "X-Amz-Grant-Read": struct{}{}, | ||
125 | "X-Amz-Grant-Read-Acp": struct{}{}, | ||
126 | "X-Amz-Grant-Write": struct{}{}, | ||
127 | "X-Amz-Grant-Write-Acp": struct{}{}, | ||
128 | "X-Amz-Metadata-Directive": struct{}{}, | ||
129 | "X-Amz-Mfa": struct{}{}, | ||
130 | "X-Amz-Request-Payer": struct{}{}, | ||
131 | "X-Amz-Server-Side-Encryption": struct{}{}, | ||
132 | "X-Amz-Server-Side-Encryption-Aws-Kms-Key-Id": struct{}{}, | ||
133 | "X-Amz-Server-Side-Encryption-Customer-Algorithm": struct{}{}, | ||
134 | "X-Amz-Server-Side-Encryption-Customer-Key": struct{}{}, | ||
135 | "X-Amz-Server-Side-Encryption-Customer-Key-Md5": struct{}{}, | ||
136 | "X-Amz-Storage-Class": struct{}{}, | ||
137 | "X-Amz-Website-Redirect-Location": struct{}{}, | ||
138 | }, | ||
139 | }, | ||
140 | patterns{"X-Amz-Meta-"}, | ||
141 | } | ||
142 | |||
143 | // allowedHoisting is a whitelist for build query headers. The boolean value | ||
144 | // represents whether or not it is a pattern. | ||
145 | var allowedQueryHoisting = inclusiveRules{ | ||
146 | blacklist{requiredSignedHeaders}, | ||
147 | patterns{"X-Amz-"}, | ||
148 | } | ||
149 | |||
150 | // Signer applies AWS v4 signing to given request. Use this to sign requests | ||
151 | // that need to be signed with AWS V4 Signatures. | ||
152 | type Signer struct { | ||
153 | // The authentication credentials the request will be signed against. | ||
154 | // This value must be set to sign requests. | ||
155 | Credentials *credentials.Credentials | ||
156 | |||
157 | // Sets the log level the signer should use when reporting information to | ||
158 | // the logger. If the logger is nil nothing will be logged. See | ||
159 | // aws.LogLevelType for more information on available logging levels | ||
160 | // | ||
161 | // By default nothing will be logged. | ||
162 | Debug aws.LogLevelType | ||
163 | |||
164 | // The logger loging information will be written to. If there the logger | ||
165 | // is nil, nothing will be logged. | ||
166 | Logger aws.Logger | ||
167 | |||
168 | // Disables the Signer's moving HTTP header key/value pairs from the HTTP | ||
169 | // request header to the request's query string. This is most commonly used | ||
170 | // with pre-signed requests preventing headers from being added to the | ||
171 | // request's query string. | ||
172 | DisableHeaderHoisting bool | ||
173 | |||
174 | // Disables the automatic escaping of the URI path of the request for the | ||
175 | // siganture's canonical string's path. For services that do not need additional | ||
176 | // escaping then use this to disable the signer escaping the path. | ||
177 | // | ||
178 | // S3 is an example of a service that does not need additional escaping. | ||
179 | // | ||
180 | // http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html | ||
181 | DisableURIPathEscaping bool | ||
182 | |||
183 | // Disales the automatical setting of the HTTP request's Body field with the | ||
184 | // io.ReadSeeker passed in to the signer. This is useful if you're using a | ||
185 | // custom wrapper around the body for the io.ReadSeeker and want to preserve | ||
186 | // the Body value on the Request.Body. | ||
187 | // | ||
188 | // This does run the risk of signing a request with a body that will not be | ||
189 | // sent in the request. Need to ensure that the underlying data of the Body | ||
190 | // values are the same. | ||
191 | DisableRequestBodyOverwrite bool | ||
192 | |||
193 | // currentTimeFn returns the time value which represents the current time. | ||
194 | // This value should only be used for testing. If it is nil the default | ||
195 | // time.Now will be used. | ||
196 | currentTimeFn func() time.Time | ||
197 | |||
198 | // UnsignedPayload will prevent signing of the payload. This will only | ||
199 | // work for services that have support for this. | ||
200 | UnsignedPayload bool | ||
201 | } | ||
202 | |||
203 | // NewSigner returns a Signer pointer configured with the credentials and optional | ||
204 | // option values provided. If not options are provided the Signer will use its | ||
205 | // default configuration. | ||
206 | func NewSigner(credentials *credentials.Credentials, options ...func(*Signer)) *Signer { | ||
207 | v4 := &Signer{ | ||
208 | Credentials: credentials, | ||
209 | } | ||
210 | |||
211 | for _, option := range options { | ||
212 | option(v4) | ||
213 | } | ||
214 | |||
215 | return v4 | ||
216 | } | ||
217 | |||
218 | type signingCtx struct { | ||
219 | ServiceName string | ||
220 | Region string | ||
221 | Request *http.Request | ||
222 | Body io.ReadSeeker | ||
223 | Query url.Values | ||
224 | Time time.Time | ||
225 | ExpireTime time.Duration | ||
226 | SignedHeaderVals http.Header | ||
227 | |||
228 | DisableURIPathEscaping bool | ||
229 | |||
230 | credValues credentials.Value | ||
231 | isPresign bool | ||
232 | formattedTime string | ||
233 | formattedShortTime string | ||
234 | unsignedPayload bool | ||
235 | |||
236 | bodyDigest string | ||
237 | signedHeaders string | ||
238 | canonicalHeaders string | ||
239 | canonicalString string | ||
240 | credentialString string | ||
241 | stringToSign string | ||
242 | signature string | ||
243 | authorization string | ||
244 | } | ||
245 | |||
246 | // Sign signs AWS v4 requests with the provided body, service name, region the | ||
247 | // request is made to, and time the request is signed at. The signTime allows | ||
248 | // you to specify that a request is signed for the future, and cannot be | ||
249 | // used until then. | ||
250 | // | ||
251 | // Returns a list of HTTP headers that were included in the signature or an | ||
252 | // error if signing the request failed. Generally for signed requests this value | ||
253 | // is not needed as the full request context will be captured by the http.Request | ||
254 | // value. It is included for reference though. | ||
255 | // | ||
256 | // Sign will set the request's Body to be the `body` parameter passed in. If | ||
257 | // the body is not already an io.ReadCloser, it will be wrapped within one. If | ||
258 | // a `nil` body parameter passed to Sign, the request's Body field will be | ||
259 | // also set to nil. Its important to note that this functionality will not | ||
260 | // change the request's ContentLength of the request. | ||
261 | // | ||
262 | // Sign differs from Presign in that it will sign the request using HTTP | ||
263 | // header values. This type of signing is intended for http.Request values that | ||
264 | // will not be shared, or are shared in a way the header values on the request | ||
265 | // will not be lost. | ||
266 | // | ||
267 | // The requests body is an io.ReadSeeker so the SHA256 of the body can be | ||
268 | // generated. To bypass the signer computing the hash you can set the | ||
269 | // "X-Amz-Content-Sha256" header with a precomputed value. The signer will | ||
270 | // only compute the hash if the request header value is empty. | ||
271 | func (v4 Signer) Sign(r *http.Request, body io.ReadSeeker, service, region string, signTime time.Time) (http.Header, error) { | ||
272 | return v4.signWithBody(r, body, service, region, 0, signTime) | ||
273 | } | ||
274 | |||
275 | // Presign signs AWS v4 requests with the provided body, service name, region | ||
276 | // the request is made to, and time the request is signed at. The signTime | ||
277 | // allows you to specify that a request is signed for the future, and cannot | ||
278 | // be used until then. | ||
279 | // | ||
280 | // Returns a list of HTTP headers that were included in the signature or an | ||
281 | // error if signing the request failed. For presigned requests these headers | ||
282 | // and their values must be included on the HTTP request when it is made. This | ||
283 | // is helpful to know what header values need to be shared with the party the | ||
284 | // presigned request will be distributed to. | ||
285 | // | ||
286 | // Presign differs from Sign in that it will sign the request using query string | ||
287 | // instead of header values. This allows you to share the Presigned Request's | ||
288 | // URL with third parties, or distribute it throughout your system with minimal | ||
289 | // dependencies. | ||
290 | // | ||
291 | // Presign also takes an exp value which is the duration the | ||
292 | // signed request will be valid after the signing time. This is allows you to | ||
293 | // set when the request will expire. | ||
294 | // | ||
295 | // The requests body is an io.ReadSeeker so the SHA256 of the body can be | ||
296 | // generated. To bypass the signer computing the hash you can set the | ||
297 | // "X-Amz-Content-Sha256" header with a precomputed value. The signer will | ||
298 | // only compute the hash if the request header value is empty. | ||
299 | // | ||
300 | // Presigning a S3 request will not compute the body's SHA256 hash by default. | ||
301 | // This is done due to the general use case for S3 presigned URLs is to share | ||
302 | // PUT/GET capabilities. If you would like to include the body's SHA256 in the | ||
303 | // presigned request's signature you can set the "X-Amz-Content-Sha256" | ||
304 | // HTTP header and that will be included in the request's signature. | ||
305 | func (v4 Signer) Presign(r *http.Request, body io.ReadSeeker, service, region string, exp time.Duration, signTime time.Time) (http.Header, error) { | ||
306 | return v4.signWithBody(r, body, service, region, exp, signTime) | ||
307 | } | ||
308 | |||
309 | func (v4 Signer) signWithBody(r *http.Request, body io.ReadSeeker, service, region string, exp time.Duration, signTime time.Time) (http.Header, error) { | ||
310 | currentTimeFn := v4.currentTimeFn | ||
311 | if currentTimeFn == nil { | ||
312 | currentTimeFn = time.Now | ||
313 | } | ||
314 | |||
315 | ctx := &signingCtx{ | ||
316 | Request: r, | ||
317 | Body: body, | ||
318 | Query: r.URL.Query(), | ||
319 | Time: signTime, | ||
320 | ExpireTime: exp, | ||
321 | isPresign: exp != 0, | ||
322 | ServiceName: service, | ||
323 | Region: region, | ||
324 | DisableURIPathEscaping: v4.DisableURIPathEscaping, | ||
325 | unsignedPayload: v4.UnsignedPayload, | ||
326 | } | ||
327 | |||
328 | for key := range ctx.Query { | ||
329 | sort.Strings(ctx.Query[key]) | ||
330 | } | ||
331 | |||
332 | if ctx.isRequestSigned() { | ||
333 | ctx.Time = currentTimeFn() | ||
334 | ctx.handlePresignRemoval() | ||
335 | } | ||
336 | |||
337 | var err error | ||
338 | ctx.credValues, err = v4.Credentials.Get() | ||
339 | if err != nil { | ||
340 | return http.Header{}, err | ||
341 | } | ||
342 | |||
343 | ctx.assignAmzQueryValues() | ||
344 | ctx.build(v4.DisableHeaderHoisting) | ||
345 | |||
346 | // If the request is not presigned the body should be attached to it. This | ||
347 | // prevents the confusion of wanting to send a signed request without | ||
348 | // the body the request was signed for attached. | ||
349 | if !(v4.DisableRequestBodyOverwrite || ctx.isPresign) { | ||
350 | var reader io.ReadCloser | ||
351 | if body != nil { | ||
352 | var ok bool | ||
353 | if reader, ok = body.(io.ReadCloser); !ok { | ||
354 | reader = ioutil.NopCloser(body) | ||
355 | } | ||
356 | } | ||
357 | r.Body = reader | ||
358 | } | ||
359 | |||
360 | if v4.Debug.Matches(aws.LogDebugWithSigning) { | ||
361 | v4.logSigningInfo(ctx) | ||
362 | } | ||
363 | |||
364 | return ctx.SignedHeaderVals, nil | ||
365 | } | ||
366 | |||
367 | func (ctx *signingCtx) handlePresignRemoval() { | ||
368 | if !ctx.isPresign { | ||
369 | return | ||
370 | } | ||
371 | |||
372 | // The credentials have expired for this request. The current signing | ||
373 | // is invalid, and needs to be request because the request will fail. | ||
374 | ctx.removePresign() | ||
375 | |||
376 | // Update the request's query string to ensure the values stays in | ||
377 | // sync in the case retrieving the new credentials fails. | ||
378 | ctx.Request.URL.RawQuery = ctx.Query.Encode() | ||
379 | } | ||
380 | |||
381 | func (ctx *signingCtx) assignAmzQueryValues() { | ||
382 | if ctx.isPresign { | ||
383 | ctx.Query.Set("X-Amz-Algorithm", authHeaderPrefix) | ||
384 | if ctx.credValues.SessionToken != "" { | ||
385 | ctx.Query.Set("X-Amz-Security-Token", ctx.credValues.SessionToken) | ||
386 | } else { | ||
387 | ctx.Query.Del("X-Amz-Security-Token") | ||
388 | } | ||
389 | |||
390 | return | ||
391 | } | ||
392 | |||
393 | if ctx.credValues.SessionToken != "" { | ||
394 | ctx.Request.Header.Set("X-Amz-Security-Token", ctx.credValues.SessionToken) | ||
395 | } | ||
396 | } | ||
397 | |||
398 | // SignRequestHandler is a named request handler the SDK will use to sign | ||
399 | // service client request with using the V4 signature. | ||
400 | var SignRequestHandler = request.NamedHandler{ | ||
401 | Name: "v4.SignRequestHandler", Fn: SignSDKRequest, | ||
402 | } | ||
403 | |||
404 | // SignSDKRequest signs an AWS request with the V4 signature. This | ||
405 | // request handler is bested used only with the SDK's built in service client's | ||
406 | // API operation requests. | ||
407 | // | ||
408 | // This function should not be used on its on its own, but in conjunction with | ||
409 | // an AWS service client's API operation call. To sign a standalone request | ||
410 | // not created by a service client's API operation method use the "Sign" or | ||
411 | // "Presign" functions of the "Signer" type. | ||
412 | // | ||
413 | // If the credentials of the request's config are set to | ||
414 | // credentials.AnonymousCredentials the request will not be signed. | ||
415 | func SignSDKRequest(req *request.Request) { | ||
416 | signSDKRequestWithCurrTime(req, time.Now) | ||
417 | } | ||
418 | |||
419 | // BuildNamedHandler will build a generic handler for signing. | ||
420 | func BuildNamedHandler(name string, opts ...func(*Signer)) request.NamedHandler { | ||
421 | return request.NamedHandler{ | ||
422 | Name: name, | ||
423 | Fn: func(req *request.Request) { | ||
424 | signSDKRequestWithCurrTime(req, time.Now, opts...) | ||
425 | }, | ||
426 | } | ||
427 | } | ||
428 | |||
429 | func signSDKRequestWithCurrTime(req *request.Request, curTimeFn func() time.Time, opts ...func(*Signer)) { | ||
430 | // If the request does not need to be signed ignore the signing of the | ||
431 | // request if the AnonymousCredentials object is used. | ||
432 | if req.Config.Credentials == credentials.AnonymousCredentials { | ||
433 | return | ||
434 | } | ||
435 | |||
436 | region := req.ClientInfo.SigningRegion | ||
437 | if region == "" { | ||
438 | region = aws.StringValue(req.Config.Region) | ||
439 | } | ||
440 | |||
441 | name := req.ClientInfo.SigningName | ||
442 | if name == "" { | ||
443 | name = req.ClientInfo.ServiceName | ||
444 | } | ||
445 | |||
446 | v4 := NewSigner(req.Config.Credentials, func(v4 *Signer) { | ||
447 | v4.Debug = req.Config.LogLevel.Value() | ||
448 | v4.Logger = req.Config.Logger | ||
449 | v4.DisableHeaderHoisting = req.NotHoist | ||
450 | v4.currentTimeFn = curTimeFn | ||
451 | if name == "s3" { | ||
452 | // S3 service should not have any escaping applied | ||
453 | v4.DisableURIPathEscaping = true | ||
454 | } | ||
455 | // Prevents setting the HTTPRequest's Body. Since the Body could be | ||
456 | // wrapped in a custom io.Closer that we do not want to be stompped | ||
457 | // on top of by the signer. | ||
458 | v4.DisableRequestBodyOverwrite = true | ||
459 | }) | ||
460 | |||
461 | for _, opt := range opts { | ||
462 | opt(v4) | ||
463 | } | ||
464 | |||
465 | signingTime := req.Time | ||
466 | if !req.LastSignedAt.IsZero() { | ||
467 | signingTime = req.LastSignedAt | ||
468 | } | ||
469 | |||
470 | signedHeaders, err := v4.signWithBody(req.HTTPRequest, req.GetBody(), | ||
471 | name, region, req.ExpireTime, signingTime, | ||
472 | ) | ||
473 | if err != nil { | ||
474 | req.Error = err | ||
475 | req.SignedHeaderVals = nil | ||
476 | return | ||
477 | } | ||
478 | |||
479 | req.SignedHeaderVals = signedHeaders | ||
480 | req.LastSignedAt = curTimeFn() | ||
481 | } | ||
482 | |||
483 | const logSignInfoMsg = `DEBUG: Request Signature: | ||
484 | ---[ CANONICAL STRING ]----------------------------- | ||
485 | %s | ||
486 | ---[ STRING TO SIGN ]-------------------------------- | ||
487 | %s%s | ||
488 | -----------------------------------------------------` | ||
489 | const logSignedURLMsg = ` | ||
490 | ---[ SIGNED URL ]------------------------------------ | ||
491 | %s` | ||
492 | |||
493 | func (v4 *Signer) logSigningInfo(ctx *signingCtx) { | ||
494 | signedURLMsg := "" | ||
495 | if ctx.isPresign { | ||
496 | signedURLMsg = fmt.Sprintf(logSignedURLMsg, ctx.Request.URL.String()) | ||
497 | } | ||
498 | msg := fmt.Sprintf(logSignInfoMsg, ctx.canonicalString, ctx.stringToSign, signedURLMsg) | ||
499 | v4.Logger.Log(msg) | ||
500 | } | ||
501 | |||
502 | func (ctx *signingCtx) build(disableHeaderHoisting bool) { | ||
503 | ctx.buildTime() // no depends | ||
504 | ctx.buildCredentialString() // no depends | ||
505 | |||
506 | unsignedHeaders := ctx.Request.Header | ||
507 | if ctx.isPresign { | ||
508 | if !disableHeaderHoisting { | ||
509 | urlValues := url.Values{} | ||
510 | urlValues, unsignedHeaders = buildQuery(allowedQueryHoisting, unsignedHeaders) // no depends | ||
511 | for k := range urlValues { | ||
512 | ctx.Query[k] = urlValues[k] | ||
513 | } | ||
514 | } | ||
515 | } | ||
516 | |||
517 | ctx.buildBodyDigest() | ||
518 | ctx.buildCanonicalHeaders(ignoredHeaders, unsignedHeaders) | ||
519 | ctx.buildCanonicalString() // depends on canon headers / signed headers | ||
520 | ctx.buildStringToSign() // depends on canon string | ||
521 | ctx.buildSignature() // depends on string to sign | ||
522 | |||
523 | if ctx.isPresign { | ||
524 | ctx.Request.URL.RawQuery += "&X-Amz-Signature=" + ctx.signature | ||
525 | } else { | ||
526 | parts := []string{ | ||
527 | authHeaderPrefix + " Credential=" + ctx.credValues.AccessKeyID + "/" + ctx.credentialString, | ||
528 | "SignedHeaders=" + ctx.signedHeaders, | ||
529 | "Signature=" + ctx.signature, | ||
530 | } | ||
531 | ctx.Request.Header.Set("Authorization", strings.Join(parts, ", ")) | ||
532 | } | ||
533 | } | ||
534 | |||
535 | func (ctx *signingCtx) buildTime() { | ||
536 | ctx.formattedTime = ctx.Time.UTC().Format(timeFormat) | ||
537 | ctx.formattedShortTime = ctx.Time.UTC().Format(shortTimeFormat) | ||
538 | |||
539 | if ctx.isPresign { | ||
540 | duration := int64(ctx.ExpireTime / time.Second) | ||
541 | ctx.Query.Set("X-Amz-Date", ctx.formattedTime) | ||
542 | ctx.Query.Set("X-Amz-Expires", strconv.FormatInt(duration, 10)) | ||
543 | } else { | ||
544 | ctx.Request.Header.Set("X-Amz-Date", ctx.formattedTime) | ||
545 | } | ||
546 | } | ||
547 | |||
548 | func (ctx *signingCtx) buildCredentialString() { | ||
549 | ctx.credentialString = strings.Join([]string{ | ||
550 | ctx.formattedShortTime, | ||
551 | ctx.Region, | ||
552 | ctx.ServiceName, | ||
553 | "aws4_request", | ||
554 | }, "/") | ||
555 | |||
556 | if ctx.isPresign { | ||
557 | ctx.Query.Set("X-Amz-Credential", ctx.credValues.AccessKeyID+"/"+ctx.credentialString) | ||
558 | } | ||
559 | } | ||
560 | |||
561 | func buildQuery(r rule, header http.Header) (url.Values, http.Header) { | ||
562 | query := url.Values{} | ||
563 | unsignedHeaders := http.Header{} | ||
564 | for k, h := range header { | ||
565 | if r.IsValid(k) { | ||
566 | query[k] = h | ||
567 | } else { | ||
568 | unsignedHeaders[k] = h | ||
569 | } | ||
570 | } | ||
571 | |||
572 | return query, unsignedHeaders | ||
573 | } | ||
574 | func (ctx *signingCtx) buildCanonicalHeaders(r rule, header http.Header) { | ||
575 | var headers []string | ||
576 | headers = append(headers, "host") | ||
577 | for k, v := range header { | ||
578 | canonicalKey := http.CanonicalHeaderKey(k) | ||
579 | if !r.IsValid(canonicalKey) { | ||
580 | continue // ignored header | ||
581 | } | ||
582 | if ctx.SignedHeaderVals == nil { | ||
583 | ctx.SignedHeaderVals = make(http.Header) | ||
584 | } | ||
585 | |||
586 | lowerCaseKey := strings.ToLower(k) | ||
587 | if _, ok := ctx.SignedHeaderVals[lowerCaseKey]; ok { | ||
588 | // include additional values | ||
589 | ctx.SignedHeaderVals[lowerCaseKey] = append(ctx.SignedHeaderVals[lowerCaseKey], v...) | ||
590 | continue | ||
591 | } | ||
592 | |||
593 | headers = append(headers, lowerCaseKey) | ||
594 | ctx.SignedHeaderVals[lowerCaseKey] = v | ||
595 | } | ||
596 | sort.Strings(headers) | ||
597 | |||
598 | ctx.signedHeaders = strings.Join(headers, ";") | ||
599 | |||
600 | if ctx.isPresign { | ||
601 | ctx.Query.Set("X-Amz-SignedHeaders", ctx.signedHeaders) | ||
602 | } | ||
603 | |||
604 | headerValues := make([]string, len(headers)) | ||
605 | for i, k := range headers { | ||
606 | if k == "host" { | ||
607 | headerValues[i] = "host:" + ctx.Request.URL.Host | ||
608 | } else { | ||
609 | headerValues[i] = k + ":" + | ||
610 | strings.Join(ctx.SignedHeaderVals[k], ",") | ||
611 | } | ||
612 | } | ||
613 | |||
614 | ctx.canonicalHeaders = strings.Join(stripExcessSpaces(headerValues), "\n") | ||
615 | } | ||
616 | |||
617 | func (ctx *signingCtx) buildCanonicalString() { | ||
618 | ctx.Request.URL.RawQuery = strings.Replace(ctx.Query.Encode(), "+", "%20", -1) | ||
619 | |||
620 | uri := getURIPath(ctx.Request.URL) | ||
621 | |||
622 | if !ctx.DisableURIPathEscaping { | ||
623 | uri = rest.EscapePath(uri, false) | ||
624 | } | ||
625 | |||
626 | ctx.canonicalString = strings.Join([]string{ | ||
627 | ctx.Request.Method, | ||
628 | uri, | ||
629 | ctx.Request.URL.RawQuery, | ||
630 | ctx.canonicalHeaders + "\n", | ||
631 | ctx.signedHeaders, | ||
632 | ctx.bodyDigest, | ||
633 | }, "\n") | ||
634 | } | ||
635 | |||
636 | func (ctx *signingCtx) buildStringToSign() { | ||
637 | ctx.stringToSign = strings.Join([]string{ | ||
638 | authHeaderPrefix, | ||
639 | ctx.formattedTime, | ||
640 | ctx.credentialString, | ||
641 | hex.EncodeToString(makeSha256([]byte(ctx.canonicalString))), | ||
642 | }, "\n") | ||
643 | } | ||
644 | |||
645 | func (ctx *signingCtx) buildSignature() { | ||
646 | secret := ctx.credValues.SecretAccessKey | ||
647 | date := makeHmac([]byte("AWS4"+secret), []byte(ctx.formattedShortTime)) | ||
648 | region := makeHmac(date, []byte(ctx.Region)) | ||
649 | service := makeHmac(region, []byte(ctx.ServiceName)) | ||
650 | credentials := makeHmac(service, []byte("aws4_request")) | ||
651 | signature := makeHmac(credentials, []byte(ctx.stringToSign)) | ||
652 | ctx.signature = hex.EncodeToString(signature) | ||
653 | } | ||
654 | |||
655 | func (ctx *signingCtx) buildBodyDigest() { | ||
656 | hash := ctx.Request.Header.Get("X-Amz-Content-Sha256") | ||
657 | if hash == "" { | ||
658 | if ctx.unsignedPayload || (ctx.isPresign && ctx.ServiceName == "s3") { | ||
659 | hash = "UNSIGNED-PAYLOAD" | ||
660 | } else if ctx.Body == nil { | ||
661 | hash = emptyStringSHA256 | ||
662 | } else { | ||
663 | hash = hex.EncodeToString(makeSha256Reader(ctx.Body)) | ||
664 | } | ||
665 | if ctx.unsignedPayload || ctx.ServiceName == "s3" || ctx.ServiceName == "glacier" { | ||
666 | ctx.Request.Header.Set("X-Amz-Content-Sha256", hash) | ||
667 | } | ||
668 | } | ||
669 | ctx.bodyDigest = hash | ||
670 | } | ||
671 | |||
672 | // isRequestSigned returns if the request is currently signed or presigned | ||
673 | func (ctx *signingCtx) isRequestSigned() bool { | ||
674 | if ctx.isPresign && ctx.Query.Get("X-Amz-Signature") != "" { | ||
675 | return true | ||
676 | } | ||
677 | if ctx.Request.Header.Get("Authorization") != "" { | ||
678 | return true | ||
679 | } | ||
680 | |||
681 | return false | ||
682 | } | ||
683 | |||
684 | // unsign removes signing flags for both signed and presigned requests. | ||
685 | func (ctx *signingCtx) removePresign() { | ||
686 | ctx.Query.Del("X-Amz-Algorithm") | ||
687 | ctx.Query.Del("X-Amz-Signature") | ||
688 | ctx.Query.Del("X-Amz-Security-Token") | ||
689 | ctx.Query.Del("X-Amz-Date") | ||
690 | ctx.Query.Del("X-Amz-Expires") | ||
691 | ctx.Query.Del("X-Amz-Credential") | ||
692 | ctx.Query.Del("X-Amz-SignedHeaders") | ||
693 | } | ||
694 | |||
695 | func makeHmac(key []byte, data []byte) []byte { | ||
696 | hash := hmac.New(sha256.New, key) | ||
697 | hash.Write(data) | ||
698 | return hash.Sum(nil) | ||
699 | } | ||
700 | |||
701 | func makeSha256(data []byte) []byte { | ||
702 | hash := sha256.New() | ||
703 | hash.Write(data) | ||
704 | return hash.Sum(nil) | ||
705 | } | ||
706 | |||
707 | func makeSha256Reader(reader io.ReadSeeker) []byte { | ||
708 | hash := sha256.New() | ||
709 | start, _ := reader.Seek(0, 1) | ||
710 | defer reader.Seek(start, 0) | ||
711 | |||
712 | io.Copy(hash, reader) | ||
713 | return hash.Sum(nil) | ||
714 | } | ||
715 | |||
716 | const doubleSpaces = " " | ||
717 | |||
718 | var doubleSpaceBytes = []byte(doubleSpaces) | ||
719 | |||
720 | func stripExcessSpaces(headerVals []string) []string { | ||
721 | vals := make([]string, len(headerVals)) | ||
722 | for i, str := range headerVals { | ||
723 | // Trim leading and trailing spaces | ||
724 | trimmed := strings.TrimSpace(str) | ||
725 | |||
726 | idx := strings.Index(trimmed, doubleSpaces) | ||
727 | var buf []byte | ||
728 | for idx > -1 { | ||
729 | // Multiple adjacent spaces found | ||
730 | if buf == nil { | ||
731 | // first time create the buffer | ||
732 | buf = []byte(trimmed) | ||
733 | } | ||
734 | |||
735 | stripToIdx := -1 | ||
736 | for j := idx + 1; j < len(buf); j++ { | ||
737 | if buf[j] != ' ' { | ||
738 | buf = append(buf[:idx+1], buf[j:]...) | ||
739 | stripToIdx = j | ||
740 | break | ||
741 | } | ||
742 | } | ||
743 | |||
744 | if stripToIdx >= 0 { | ||
745 | idx = bytes.Index(buf[stripToIdx:], doubleSpaceBytes) | ||
746 | if idx >= 0 { | ||
747 | idx += stripToIdx | ||
748 | } | ||
749 | } else { | ||
750 | idx = -1 | ||
751 | } | ||
752 | } | ||
753 | |||
754 | if buf != nil { | ||
755 | vals[i] = string(buf) | ||
756 | } else { | ||
757 | vals[i] = trimmed | ||
758 | } | ||
759 | } | ||
760 | return vals | ||
761 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/types.go b/vendor/github.com/aws/aws-sdk-go/aws/types.go new file mode 100644 index 0000000..0e2d864 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/types.go | |||
@@ -0,0 +1,118 @@ | |||
1 | package aws | ||
2 | |||
3 | import ( | ||
4 | "io" | ||
5 | "sync" | ||
6 | ) | ||
7 | |||
8 | // ReadSeekCloser wraps a io.Reader returning a ReaderSeekerCloser. Should | ||
9 | // only be used with an io.Reader that is also an io.Seeker. Doing so may | ||
10 | // cause request signature errors, or request body's not sent for GET, HEAD | ||
11 | // and DELETE HTTP methods. | ||
12 | // | ||
13 | // Deprecated: Should only be used with io.ReadSeeker. If using for | ||
14 | // S3 PutObject to stream content use s3manager.Uploader instead. | ||
15 | func ReadSeekCloser(r io.Reader) ReaderSeekerCloser { | ||
16 | return ReaderSeekerCloser{r} | ||
17 | } | ||
18 | |||
19 | // ReaderSeekerCloser represents a reader that can also delegate io.Seeker and | ||
20 | // io.Closer interfaces to the underlying object if they are available. | ||
21 | type ReaderSeekerCloser struct { | ||
22 | r io.Reader | ||
23 | } | ||
24 | |||
25 | // Read reads from the reader up to size of p. The number of bytes read, and | ||
26 | // error if it occurred will be returned. | ||
27 | // | ||
28 | // If the reader is not an io.Reader zero bytes read, and nil error will be returned. | ||
29 | // | ||
30 | // Performs the same functionality as io.Reader Read | ||
31 | func (r ReaderSeekerCloser) Read(p []byte) (int, error) { | ||
32 | switch t := r.r.(type) { | ||
33 | case io.Reader: | ||
34 | return t.Read(p) | ||
35 | } | ||
36 | return 0, nil | ||
37 | } | ||
38 | |||
39 | // Seek sets the offset for the next Read to offset, interpreted according to | ||
40 | // whence: 0 means relative to the origin of the file, 1 means relative to the | ||
41 | // current offset, and 2 means relative to the end. Seek returns the new offset | ||
42 | // and an error, if any. | ||
43 | // | ||
44 | // If the ReaderSeekerCloser is not an io.Seeker nothing will be done. | ||
45 | func (r ReaderSeekerCloser) Seek(offset int64, whence int) (int64, error) { | ||
46 | switch t := r.r.(type) { | ||
47 | case io.Seeker: | ||
48 | return t.Seek(offset, whence) | ||
49 | } | ||
50 | return int64(0), nil | ||
51 | } | ||
52 | |||
53 | // IsSeeker returns if the underlying reader is also a seeker. | ||
54 | func (r ReaderSeekerCloser) IsSeeker() bool { | ||
55 | _, ok := r.r.(io.Seeker) | ||
56 | return ok | ||
57 | } | ||
58 | |||
59 | // Close closes the ReaderSeekerCloser. | ||
60 | // | ||
61 | // If the ReaderSeekerCloser is not an io.Closer nothing will be done. | ||
62 | func (r ReaderSeekerCloser) Close() error { | ||
63 | switch t := r.r.(type) { | ||
64 | case io.Closer: | ||
65 | return t.Close() | ||
66 | } | ||
67 | return nil | ||
68 | } | ||
69 | |||
70 | // A WriteAtBuffer provides a in memory buffer supporting the io.WriterAt interface | ||
71 | // Can be used with the s3manager.Downloader to download content to a buffer | ||
72 | // in memory. Safe to use concurrently. | ||
73 | type WriteAtBuffer struct { | ||
74 | buf []byte | ||
75 | m sync.Mutex | ||
76 | |||
77 | // GrowthCoeff defines the growth rate of the internal buffer. By | ||
78 | // default, the growth rate is 1, where expanding the internal | ||
79 | // buffer will allocate only enough capacity to fit the new expected | ||
80 | // length. | ||
81 | GrowthCoeff float64 | ||
82 | } | ||
83 | |||
84 | // NewWriteAtBuffer creates a WriteAtBuffer with an internal buffer | ||
85 | // provided by buf. | ||
86 | func NewWriteAtBuffer(buf []byte) *WriteAtBuffer { | ||
87 | return &WriteAtBuffer{buf: buf} | ||
88 | } | ||
89 | |||
90 | // WriteAt writes a slice of bytes to a buffer starting at the position provided | ||
91 | // The number of bytes written will be returned, or error. Can overwrite previous | ||
92 | // written slices if the write ats overlap. | ||
93 | func (b *WriteAtBuffer) WriteAt(p []byte, pos int64) (n int, err error) { | ||
94 | pLen := len(p) | ||
95 | expLen := pos + int64(pLen) | ||
96 | b.m.Lock() | ||
97 | defer b.m.Unlock() | ||
98 | if int64(len(b.buf)) < expLen { | ||
99 | if int64(cap(b.buf)) < expLen { | ||
100 | if b.GrowthCoeff < 1 { | ||
101 | b.GrowthCoeff = 1 | ||
102 | } | ||
103 | newBuf := make([]byte, expLen, int64(b.GrowthCoeff*float64(expLen))) | ||
104 | copy(newBuf, b.buf) | ||
105 | b.buf = newBuf | ||
106 | } | ||
107 | b.buf = b.buf[:expLen] | ||
108 | } | ||
109 | copy(b.buf[pos:], p) | ||
110 | return pLen, nil | ||
111 | } | ||
112 | |||
113 | // Bytes returns a slice of bytes written to the buffer. | ||
114 | func (b *WriteAtBuffer) Bytes() []byte { | ||
115 | b.m.Lock() | ||
116 | defer b.m.Unlock() | ||
117 | return b.buf | ||
118 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/url.go b/vendor/github.com/aws/aws-sdk-go/aws/url.go new file mode 100644 index 0000000..6192b24 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/url.go | |||
@@ -0,0 +1,12 @@ | |||
1 | // +build go1.8 | ||
2 | |||
3 | package aws | ||
4 | |||
5 | import "net/url" | ||
6 | |||
7 | // URLHostname will extract the Hostname without port from the URL value. | ||
8 | // | ||
9 | // Wrapper of net/url#URL.Hostname for backwards Go version compatibility. | ||
10 | func URLHostname(url *url.URL) string { | ||
11 | return url.Hostname() | ||
12 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/url_1_7.go b/vendor/github.com/aws/aws-sdk-go/aws/url_1_7.go new file mode 100644 index 0000000..0210d27 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/url_1_7.go | |||
@@ -0,0 +1,29 @@ | |||
1 | // +build !go1.8 | ||
2 | |||
3 | package aws | ||
4 | |||
5 | import ( | ||
6 | "net/url" | ||
7 | "strings" | ||
8 | ) | ||
9 | |||
10 | // URLHostname will extract the Hostname without port from the URL value. | ||
11 | // | ||
12 | // Copy of Go 1.8's net/url#URL.Hostname functionality. | ||
13 | func URLHostname(url *url.URL) string { | ||
14 | return stripPort(url.Host) | ||
15 | |||
16 | } | ||
17 | |||
18 | // stripPort is copy of Go 1.8 url#URL.Hostname functionality. | ||
19 | // https://golang.org/src/net/url/url.go | ||
20 | func stripPort(hostport string) string { | ||
21 | colon := strings.IndexByte(hostport, ':') | ||
22 | if colon == -1 { | ||
23 | return hostport | ||
24 | } | ||
25 | if i := strings.IndexByte(hostport, ']'); i != -1 { | ||
26 | return strings.TrimPrefix(hostport[:i], "[") | ||
27 | } | ||
28 | return hostport[:colon] | ||
29 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/version.go b/vendor/github.com/aws/aws-sdk-go/aws/version.go new file mode 100644 index 0000000..129dad9 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/version.go | |||
@@ -0,0 +1,8 @@ | |||
1 | // Package aws provides core functionality for making requests to AWS services. | ||
2 | package aws | ||
3 | |||
4 | // SDKName is the name of this AWS SDK | ||
5 | const SDKName = "aws-sdk-go" | ||
6 | |||
7 | // SDKVersion is the version of this SDK | ||
8 | const SDKVersion = "1.8.21" | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/idempotency.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/idempotency.go new file mode 100644 index 0000000..53831df --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/idempotency.go | |||
@@ -0,0 +1,75 @@ | |||
1 | package protocol | ||
2 | |||
3 | import ( | ||
4 | "crypto/rand" | ||
5 | "fmt" | ||
6 | "reflect" | ||
7 | ) | ||
8 | |||
9 | // RandReader is the random reader the protocol package will use to read | ||
10 | // random bytes from. This is exported for testing, and should not be used. | ||
11 | var RandReader = rand.Reader | ||
12 | |||
13 | const idempotencyTokenFillTag = `idempotencyToken` | ||
14 | |||
15 | // CanSetIdempotencyToken returns true if the struct field should be | ||
16 | // automatically populated with a Idempotency token. | ||
17 | // | ||
18 | // Only *string and string type fields that are tagged with idempotencyToken | ||
19 | // which are not already set can be auto filled. | ||
20 | func CanSetIdempotencyToken(v reflect.Value, f reflect.StructField) bool { | ||
21 | switch u := v.Interface().(type) { | ||
22 | // To auto fill an Idempotency token the field must be a string, | ||
23 | // tagged for auto fill, and have a zero value. | ||
24 | case *string: | ||
25 | return u == nil && len(f.Tag.Get(idempotencyTokenFillTag)) != 0 | ||
26 | case string: | ||
27 | return len(u) == 0 && len(f.Tag.Get(idempotencyTokenFillTag)) != 0 | ||
28 | } | ||
29 | |||
30 | return false | ||
31 | } | ||
32 | |||
33 | // GetIdempotencyToken returns a randomly generated idempotency token. | ||
34 | func GetIdempotencyToken() string { | ||
35 | b := make([]byte, 16) | ||
36 | RandReader.Read(b) | ||
37 | |||
38 | return UUIDVersion4(b) | ||
39 | } | ||
40 | |||
41 | // SetIdempotencyToken will set the value provided with a Idempotency Token. | ||
42 | // Given that the value can be set. Will panic if value is not setable. | ||
43 | func SetIdempotencyToken(v reflect.Value) { | ||
44 | if v.Kind() == reflect.Ptr { | ||
45 | if v.IsNil() && v.CanSet() { | ||
46 | v.Set(reflect.New(v.Type().Elem())) | ||
47 | } | ||
48 | v = v.Elem() | ||
49 | } | ||
50 | v = reflect.Indirect(v) | ||
51 | |||
52 | if !v.CanSet() { | ||
53 | panic(fmt.Sprintf("unable to set idempotnecy token %v", v)) | ||
54 | } | ||
55 | |||
56 | b := make([]byte, 16) | ||
57 | _, err := rand.Read(b) | ||
58 | if err != nil { | ||
59 | // TODO handle error | ||
60 | return | ||
61 | } | ||
62 | |||
63 | v.Set(reflect.ValueOf(UUIDVersion4(b))) | ||
64 | } | ||
65 | |||
66 | // UUIDVersion4 returns a Version 4 random UUID from the byte slice provided | ||
67 | func UUIDVersion4(u []byte) string { | ||
68 | // https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_.28random.29 | ||
69 | // 13th character is "4" | ||
70 | u[6] = (u[6] | 0x40) & 0x4F | ||
71 | // 17th character is "8", "9", "a", or "b" | ||
72 | u[8] = (u[8] | 0x80) & 0xBF | ||
73 | |||
74 | return fmt.Sprintf(`%X-%X-%X-%X-%X`, u[0:4], u[4:6], u[6:8], u[8:10], u[10:]) | ||
75 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/build.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/build.go new file mode 100644 index 0000000..18169f0 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/build.go | |||
@@ -0,0 +1,36 @@ | |||
1 | // Package query provides serialization of AWS query requests, and responses. | ||
2 | package query | ||
3 | |||
4 | //go:generate go run -tags codegen ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/input/query.json build_test.go | ||
5 | |||
6 | import ( | ||
7 | "net/url" | ||
8 | |||
9 | "github.com/aws/aws-sdk-go/aws/awserr" | ||
10 | "github.com/aws/aws-sdk-go/aws/request" | ||
11 | "github.com/aws/aws-sdk-go/private/protocol/query/queryutil" | ||
12 | ) | ||
13 | |||
14 | // BuildHandler is a named request handler for building query protocol requests | ||
15 | var BuildHandler = request.NamedHandler{Name: "awssdk.query.Build", Fn: Build} | ||
16 | |||
17 | // Build builds a request for an AWS Query service. | ||
18 | func Build(r *request.Request) { | ||
19 | body := url.Values{ | ||
20 | "Action": {r.Operation.Name}, | ||
21 | "Version": {r.ClientInfo.APIVersion}, | ||
22 | } | ||
23 | if err := queryutil.Parse(body, r.Params, false); err != nil { | ||
24 | r.Error = awserr.New("SerializationError", "failed encoding Query request", err) | ||
25 | return | ||
26 | } | ||
27 | |||
28 | if r.ExpireTime == 0 { | ||
29 | r.HTTPRequest.Method = "POST" | ||
30 | r.HTTPRequest.Header.Set("Content-Type", "application/x-www-form-urlencoded; charset=utf-8") | ||
31 | r.SetBufferBody([]byte(body.Encode())) | ||
32 | } else { // This is a pre-signed request | ||
33 | r.HTTPRequest.Method = "GET" | ||
34 | r.HTTPRequest.URL.RawQuery = body.Encode() | ||
35 | } | ||
36 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/queryutil/queryutil.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/queryutil/queryutil.go new file mode 100644 index 0000000..524ca95 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/queryutil/queryutil.go | |||
@@ -0,0 +1,237 @@ | |||
1 | package queryutil | ||
2 | |||
3 | import ( | ||
4 | "encoding/base64" | ||
5 | "fmt" | ||
6 | "net/url" | ||
7 | "reflect" | ||
8 | "sort" | ||
9 | "strconv" | ||
10 | "strings" | ||
11 | "time" | ||
12 | |||
13 | "github.com/aws/aws-sdk-go/private/protocol" | ||
14 | ) | ||
15 | |||
16 | // Parse parses an object i and fills a url.Values object. The isEC2 flag | ||
17 | // indicates if this is the EC2 Query sub-protocol. | ||
18 | func Parse(body url.Values, i interface{}, isEC2 bool) error { | ||
19 | q := queryParser{isEC2: isEC2} | ||
20 | return q.parseValue(body, reflect.ValueOf(i), "", "") | ||
21 | } | ||
22 | |||
23 | func elemOf(value reflect.Value) reflect.Value { | ||
24 | for value.Kind() == reflect.Ptr { | ||
25 | value = value.Elem() | ||
26 | } | ||
27 | return value | ||
28 | } | ||
29 | |||
30 | type queryParser struct { | ||
31 | isEC2 bool | ||
32 | } | ||
33 | |||
34 | func (q *queryParser) parseValue(v url.Values, value reflect.Value, prefix string, tag reflect.StructTag) error { | ||
35 | value = elemOf(value) | ||
36 | |||
37 | // no need to handle zero values | ||
38 | if !value.IsValid() { | ||
39 | return nil | ||
40 | } | ||
41 | |||
42 | t := tag.Get("type") | ||
43 | if t == "" { | ||
44 | switch value.Kind() { | ||
45 | case reflect.Struct: | ||
46 | t = "structure" | ||
47 | case reflect.Slice: | ||
48 | t = "list" | ||
49 | case reflect.Map: | ||
50 | t = "map" | ||
51 | } | ||
52 | } | ||
53 | |||
54 | switch t { | ||
55 | case "structure": | ||
56 | return q.parseStruct(v, value, prefix) | ||
57 | case "list": | ||
58 | return q.parseList(v, value, prefix, tag) | ||
59 | case "map": | ||
60 | return q.parseMap(v, value, prefix, tag) | ||
61 | default: | ||
62 | return q.parseScalar(v, value, prefix, tag) | ||
63 | } | ||
64 | } | ||
65 | |||
66 | func (q *queryParser) parseStruct(v url.Values, value reflect.Value, prefix string) error { | ||
67 | if !value.IsValid() { | ||
68 | return nil | ||
69 | } | ||
70 | |||
71 | t := value.Type() | ||
72 | for i := 0; i < value.NumField(); i++ { | ||
73 | elemValue := elemOf(value.Field(i)) | ||
74 | field := t.Field(i) | ||
75 | |||
76 | if field.PkgPath != "" { | ||
77 | continue // ignore unexported fields | ||
78 | } | ||
79 | if field.Tag.Get("ignore") != "" { | ||
80 | continue | ||
81 | } | ||
82 | |||
83 | if protocol.CanSetIdempotencyToken(value.Field(i), field) { | ||
84 | token := protocol.GetIdempotencyToken() | ||
85 | elemValue = reflect.ValueOf(token) | ||
86 | } | ||
87 | |||
88 | var name string | ||
89 | if q.isEC2 { | ||
90 | name = field.Tag.Get("queryName") | ||
91 | } | ||
92 | if name == "" { | ||
93 | if field.Tag.Get("flattened") != "" && field.Tag.Get("locationNameList") != "" { | ||
94 | name = field.Tag.Get("locationNameList") | ||
95 | } else if locName := field.Tag.Get("locationName"); locName != "" { | ||
96 | name = locName | ||
97 | } | ||
98 | if name != "" && q.isEC2 { | ||
99 | name = strings.ToUpper(name[0:1]) + name[1:] | ||
100 | } | ||
101 | } | ||
102 | if name == "" { | ||
103 | name = field.Name | ||
104 | } | ||
105 | |||
106 | if prefix != "" { | ||
107 | name = prefix + "." + name | ||
108 | } | ||
109 | |||
110 | if err := q.parseValue(v, elemValue, name, field.Tag); err != nil { | ||
111 | return err | ||
112 | } | ||
113 | } | ||
114 | return nil | ||
115 | } | ||
116 | |||
117 | func (q *queryParser) parseList(v url.Values, value reflect.Value, prefix string, tag reflect.StructTag) error { | ||
118 | // If it's empty, generate an empty value | ||
119 | if !value.IsNil() && value.Len() == 0 { | ||
120 | v.Set(prefix, "") | ||
121 | return nil | ||
122 | } | ||
123 | |||
124 | // check for unflattened list member | ||
125 | if !q.isEC2 && tag.Get("flattened") == "" { | ||
126 | if listName := tag.Get("locationNameList"); listName == "" { | ||
127 | prefix += ".member" | ||
128 | } else { | ||
129 | prefix += "." + listName | ||
130 | } | ||
131 | } | ||
132 | |||
133 | for i := 0; i < value.Len(); i++ { | ||
134 | slicePrefix := prefix | ||
135 | if slicePrefix == "" { | ||
136 | slicePrefix = strconv.Itoa(i + 1) | ||
137 | } else { | ||
138 | slicePrefix = slicePrefix + "." + strconv.Itoa(i+1) | ||
139 | } | ||
140 | if err := q.parseValue(v, value.Index(i), slicePrefix, ""); err != nil { | ||
141 | return err | ||
142 | } | ||
143 | } | ||
144 | return nil | ||
145 | } | ||
146 | |||
147 | func (q *queryParser) parseMap(v url.Values, value reflect.Value, prefix string, tag reflect.StructTag) error { | ||
148 | // If it's empty, generate an empty value | ||
149 | if !value.IsNil() && value.Len() == 0 { | ||
150 | v.Set(prefix, "") | ||
151 | return nil | ||
152 | } | ||
153 | |||
154 | // check for unflattened list member | ||
155 | if !q.isEC2 && tag.Get("flattened") == "" { | ||
156 | prefix += ".entry" | ||
157 | } | ||
158 | |||
159 | // sort keys for improved serialization consistency. | ||
160 | // this is not strictly necessary for protocol support. | ||
161 | mapKeyValues := value.MapKeys() | ||
162 | mapKeys := map[string]reflect.Value{} | ||
163 | mapKeyNames := make([]string, len(mapKeyValues)) | ||
164 | for i, mapKey := range mapKeyValues { | ||
165 | name := mapKey.String() | ||
166 | mapKeys[name] = mapKey | ||
167 | mapKeyNames[i] = name | ||
168 | } | ||
169 | sort.Strings(mapKeyNames) | ||
170 | |||
171 | for i, mapKeyName := range mapKeyNames { | ||
172 | mapKey := mapKeys[mapKeyName] | ||
173 | mapValue := value.MapIndex(mapKey) | ||
174 | |||
175 | kname := tag.Get("locationNameKey") | ||
176 | if kname == "" { | ||
177 | kname = "key" | ||
178 | } | ||
179 | vname := tag.Get("locationNameValue") | ||
180 | if vname == "" { | ||
181 | vname = "value" | ||
182 | } | ||
183 | |||
184 | // serialize key | ||
185 | var keyName string | ||
186 | if prefix == "" { | ||
187 | keyName = strconv.Itoa(i+1) + "." + kname | ||
188 | } else { | ||
189 | keyName = prefix + "." + strconv.Itoa(i+1) + "." + kname | ||
190 | } | ||
191 | |||
192 | if err := q.parseValue(v, mapKey, keyName, ""); err != nil { | ||
193 | return err | ||
194 | } | ||
195 | |||
196 | // serialize value | ||
197 | var valueName string | ||
198 | if prefix == "" { | ||
199 | valueName = strconv.Itoa(i+1) + "." + vname | ||
200 | } else { | ||
201 | valueName = prefix + "." + strconv.Itoa(i+1) + "." + vname | ||
202 | } | ||
203 | |||
204 | if err := q.parseValue(v, mapValue, valueName, ""); err != nil { | ||
205 | return err | ||
206 | } | ||
207 | } | ||
208 | |||
209 | return nil | ||
210 | } | ||
211 | |||
212 | func (q *queryParser) parseScalar(v url.Values, r reflect.Value, name string, tag reflect.StructTag) error { | ||
213 | switch value := r.Interface().(type) { | ||
214 | case string: | ||
215 | v.Set(name, value) | ||
216 | case []byte: | ||
217 | if !r.IsNil() { | ||
218 | v.Set(name, base64.StdEncoding.EncodeToString(value)) | ||
219 | } | ||
220 | case bool: | ||
221 | v.Set(name, strconv.FormatBool(value)) | ||
222 | case int64: | ||
223 | v.Set(name, strconv.FormatInt(value, 10)) | ||
224 | case int: | ||
225 | v.Set(name, strconv.Itoa(value)) | ||
226 | case float64: | ||
227 | v.Set(name, strconv.FormatFloat(value, 'f', -1, 64)) | ||
228 | case float32: | ||
229 | v.Set(name, strconv.FormatFloat(float64(value), 'f', -1, 32)) | ||
230 | case time.Time: | ||
231 | const ISO8601UTC = "2006-01-02T15:04:05Z" | ||
232 | v.Set(name, value.UTC().Format(ISO8601UTC)) | ||
233 | default: | ||
234 | return fmt.Errorf("unsupported value for param %s: %v (%s)", name, r.Interface(), r.Type().Name()) | ||
235 | } | ||
236 | return nil | ||
237 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal.go new file mode 100644 index 0000000..e0f4d5a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal.go | |||
@@ -0,0 +1,35 @@ | |||
1 | package query | ||
2 | |||
3 | //go:generate go run -tags codegen ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/output/query.json unmarshal_test.go | ||
4 | |||
5 | import ( | ||
6 | "encoding/xml" | ||
7 | |||
8 | "github.com/aws/aws-sdk-go/aws/awserr" | ||
9 | "github.com/aws/aws-sdk-go/aws/request" | ||
10 | "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" | ||
11 | ) | ||
12 | |||
13 | // UnmarshalHandler is a named request handler for unmarshaling query protocol requests | ||
14 | var UnmarshalHandler = request.NamedHandler{Name: "awssdk.query.Unmarshal", Fn: Unmarshal} | ||
15 | |||
16 | // UnmarshalMetaHandler is a named request handler for unmarshaling query protocol request metadata | ||
17 | var UnmarshalMetaHandler = request.NamedHandler{Name: "awssdk.query.UnmarshalMeta", Fn: UnmarshalMeta} | ||
18 | |||
19 | // Unmarshal unmarshals a response for an AWS Query service. | ||
20 | func Unmarshal(r *request.Request) { | ||
21 | defer r.HTTPResponse.Body.Close() | ||
22 | if r.DataFilled() { | ||
23 | decoder := xml.NewDecoder(r.HTTPResponse.Body) | ||
24 | err := xmlutil.UnmarshalXML(r.Data, decoder, r.Operation.Name+"Result") | ||
25 | if err != nil { | ||
26 | r.Error = awserr.New("SerializationError", "failed decoding Query response", err) | ||
27 | return | ||
28 | } | ||
29 | } | ||
30 | } | ||
31 | |||
32 | // UnmarshalMeta unmarshals header response values for an AWS Query service. | ||
33 | func UnmarshalMeta(r *request.Request) { | ||
34 | r.RequestID = r.HTTPResponse.Header.Get("X-Amzn-Requestid") | ||
35 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_error.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_error.go new file mode 100644 index 0000000..f214296 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_error.go | |||
@@ -0,0 +1,66 @@ | |||
1 | package query | ||
2 | |||
3 | import ( | ||
4 | "encoding/xml" | ||
5 | "io/ioutil" | ||
6 | |||
7 | "github.com/aws/aws-sdk-go/aws/awserr" | ||
8 | "github.com/aws/aws-sdk-go/aws/request" | ||
9 | ) | ||
10 | |||
11 | type xmlErrorResponse struct { | ||
12 | XMLName xml.Name `xml:"ErrorResponse"` | ||
13 | Code string `xml:"Error>Code"` | ||
14 | Message string `xml:"Error>Message"` | ||
15 | RequestID string `xml:"RequestId"` | ||
16 | } | ||
17 | |||
18 | type xmlServiceUnavailableResponse struct { | ||
19 | XMLName xml.Name `xml:"ServiceUnavailableException"` | ||
20 | } | ||
21 | |||
22 | // UnmarshalErrorHandler is a name request handler to unmarshal request errors | ||
23 | var UnmarshalErrorHandler = request.NamedHandler{Name: "awssdk.query.UnmarshalError", Fn: UnmarshalError} | ||
24 | |||
25 | // UnmarshalError unmarshals an error response for an AWS Query service. | ||
26 | func UnmarshalError(r *request.Request) { | ||
27 | defer r.HTTPResponse.Body.Close() | ||
28 | |||
29 | bodyBytes, err := ioutil.ReadAll(r.HTTPResponse.Body) | ||
30 | if err != nil { | ||
31 | r.Error = awserr.New("SerializationError", "failed to read from query HTTP response body", err) | ||
32 | return | ||
33 | } | ||
34 | |||
35 | // First check for specific error | ||
36 | resp := xmlErrorResponse{} | ||
37 | decodeErr := xml.Unmarshal(bodyBytes, &resp) | ||
38 | if decodeErr == nil { | ||
39 | reqID := resp.RequestID | ||
40 | if reqID == "" { | ||
41 | reqID = r.RequestID | ||
42 | } | ||
43 | r.Error = awserr.NewRequestFailure( | ||
44 | awserr.New(resp.Code, resp.Message, nil), | ||
45 | r.HTTPResponse.StatusCode, | ||
46 | reqID, | ||
47 | ) | ||
48 | return | ||
49 | } | ||
50 | |||
51 | // Check for unhandled error | ||
52 | servUnavailResp := xmlServiceUnavailableResponse{} | ||
53 | unavailErr := xml.Unmarshal(bodyBytes, &servUnavailResp) | ||
54 | if unavailErr == nil { | ||
55 | r.Error = awserr.NewRequestFailure( | ||
56 | awserr.New("ServiceUnavailableException", "service is unavailable", nil), | ||
57 | r.HTTPResponse.StatusCode, | ||
58 | r.RequestID, | ||
59 | ) | ||
60 | return | ||
61 | } | ||
62 | |||
63 | // Failed to retrieve any error message from the response body | ||
64 | r.Error = awserr.New("SerializationError", | ||
65 | "failed to decode query XML error response", decodeErr) | ||
66 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/build.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/build.go new file mode 100644 index 0000000..7161835 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/build.go | |||
@@ -0,0 +1,290 @@ | |||
1 | // Package rest provides RESTful serialization of AWS requests and responses. | ||
2 | package rest | ||
3 | |||
4 | import ( | ||
5 | "bytes" | ||
6 | "encoding/base64" | ||
7 | "encoding/json" | ||
8 | "fmt" | ||
9 | "io" | ||
10 | "net/http" | ||
11 | "net/url" | ||
12 | "path" | ||
13 | "reflect" | ||
14 | "strconv" | ||
15 | "strings" | ||
16 | "time" | ||
17 | |||
18 | "github.com/aws/aws-sdk-go/aws" | ||
19 | "github.com/aws/aws-sdk-go/aws/awserr" | ||
20 | "github.com/aws/aws-sdk-go/aws/request" | ||
21 | ) | ||
22 | |||
23 | // RFC822 returns an RFC822 formatted timestamp for AWS protocols | ||
24 | const RFC822 = "Mon, 2 Jan 2006 15:04:05 GMT" | ||
25 | |||
26 | // Whether the byte value can be sent without escaping in AWS URLs | ||
27 | var noEscape [256]bool | ||
28 | |||
29 | var errValueNotSet = fmt.Errorf("value not set") | ||
30 | |||
31 | func init() { | ||
32 | for i := 0; i < len(noEscape); i++ { | ||
33 | // AWS expects every character except these to be escaped | ||
34 | noEscape[i] = (i >= 'A' && i <= 'Z') || | ||
35 | (i >= 'a' && i <= 'z') || | ||
36 | (i >= '0' && i <= '9') || | ||
37 | i == '-' || | ||
38 | i == '.' || | ||
39 | i == '_' || | ||
40 | i == '~' | ||
41 | } | ||
42 | } | ||
43 | |||
44 | // BuildHandler is a named request handler for building rest protocol requests | ||
45 | var BuildHandler = request.NamedHandler{Name: "awssdk.rest.Build", Fn: Build} | ||
46 | |||
47 | // Build builds the REST component of a service request. | ||
48 | func Build(r *request.Request) { | ||
49 | if r.ParamsFilled() { | ||
50 | v := reflect.ValueOf(r.Params).Elem() | ||
51 | buildLocationElements(r, v, false) | ||
52 | buildBody(r, v) | ||
53 | } | ||
54 | } | ||
55 | |||
56 | // BuildAsGET builds the REST component of a service request with the ability to hoist | ||
57 | // data from the body. | ||
58 | func BuildAsGET(r *request.Request) { | ||
59 | if r.ParamsFilled() { | ||
60 | v := reflect.ValueOf(r.Params).Elem() | ||
61 | buildLocationElements(r, v, true) | ||
62 | buildBody(r, v) | ||
63 | } | ||
64 | } | ||
65 | |||
66 | func buildLocationElements(r *request.Request, v reflect.Value, buildGETQuery bool) { | ||
67 | query := r.HTTPRequest.URL.Query() | ||
68 | |||
69 | // Setup the raw path to match the base path pattern. This is needed | ||
70 | // so that when the path is mutated a custom escaped version can be | ||
71 | // stored in RawPath that will be used by the Go client. | ||
72 | r.HTTPRequest.URL.RawPath = r.HTTPRequest.URL.Path | ||
73 | |||
74 | for i := 0; i < v.NumField(); i++ { | ||
75 | m := v.Field(i) | ||
76 | if n := v.Type().Field(i).Name; n[0:1] == strings.ToLower(n[0:1]) { | ||
77 | continue | ||
78 | } | ||
79 | |||
80 | if m.IsValid() { | ||
81 | field := v.Type().Field(i) | ||
82 | name := field.Tag.Get("locationName") | ||
83 | if name == "" { | ||
84 | name = field.Name | ||
85 | } | ||
86 | if kind := m.Kind(); kind == reflect.Ptr { | ||
87 | m = m.Elem() | ||
88 | } else if kind == reflect.Interface { | ||
89 | if !m.Elem().IsValid() { | ||
90 | continue | ||
91 | } | ||
92 | } | ||
93 | if !m.IsValid() { | ||
94 | continue | ||
95 | } | ||
96 | if field.Tag.Get("ignore") != "" { | ||
97 | continue | ||
98 | } | ||
99 | |||
100 | var err error | ||
101 | switch field.Tag.Get("location") { | ||
102 | case "headers": // header maps | ||
103 | err = buildHeaderMap(&r.HTTPRequest.Header, m, field.Tag) | ||
104 | case "header": | ||
105 | err = buildHeader(&r.HTTPRequest.Header, m, name, field.Tag) | ||
106 | case "uri": | ||
107 | err = buildURI(r.HTTPRequest.URL, m, name, field.Tag) | ||
108 | case "querystring": | ||
109 | err = buildQueryString(query, m, name, field.Tag) | ||
110 | default: | ||
111 | if buildGETQuery { | ||
112 | err = buildQueryString(query, m, name, field.Tag) | ||
113 | } | ||
114 | } | ||
115 | r.Error = err | ||
116 | } | ||
117 | if r.Error != nil { | ||
118 | return | ||
119 | } | ||
120 | } | ||
121 | |||
122 | r.HTTPRequest.URL.RawQuery = query.Encode() | ||
123 | if !aws.BoolValue(r.Config.DisableRestProtocolURICleaning) { | ||
124 | cleanPath(r.HTTPRequest.URL) | ||
125 | } | ||
126 | } | ||
127 | |||
128 | func buildBody(r *request.Request, v reflect.Value) { | ||
129 | if field, ok := v.Type().FieldByName("_"); ok { | ||
130 | if payloadName := field.Tag.Get("payload"); payloadName != "" { | ||
131 | pfield, _ := v.Type().FieldByName(payloadName) | ||
132 | if ptag := pfield.Tag.Get("type"); ptag != "" && ptag != "structure" { | ||
133 | payload := reflect.Indirect(v.FieldByName(payloadName)) | ||
134 | if payload.IsValid() && payload.Interface() != nil { | ||
135 | switch reader := payload.Interface().(type) { | ||
136 | case io.ReadSeeker: | ||
137 | r.SetReaderBody(reader) | ||
138 | case []byte: | ||
139 | r.SetBufferBody(reader) | ||
140 | case string: | ||
141 | r.SetStringBody(reader) | ||
142 | default: | ||
143 | r.Error = awserr.New("SerializationError", | ||
144 | "failed to encode REST request", | ||
145 | fmt.Errorf("unknown payload type %s", payload.Type())) | ||
146 | } | ||
147 | } | ||
148 | } | ||
149 | } | ||
150 | } | ||
151 | } | ||
152 | |||
153 | func buildHeader(header *http.Header, v reflect.Value, name string, tag reflect.StructTag) error { | ||
154 | str, err := convertType(v, tag) | ||
155 | if err == errValueNotSet { | ||
156 | return nil | ||
157 | } else if err != nil { | ||
158 | return awserr.New("SerializationError", "failed to encode REST request", err) | ||
159 | } | ||
160 | |||
161 | header.Add(name, str) | ||
162 | |||
163 | return nil | ||
164 | } | ||
165 | |||
166 | func buildHeaderMap(header *http.Header, v reflect.Value, tag reflect.StructTag) error { | ||
167 | prefix := tag.Get("locationName") | ||
168 | for _, key := range v.MapKeys() { | ||
169 | str, err := convertType(v.MapIndex(key), tag) | ||
170 | if err == errValueNotSet { | ||
171 | continue | ||
172 | } else if err != nil { | ||
173 | return awserr.New("SerializationError", "failed to encode REST request", err) | ||
174 | |||
175 | } | ||
176 | |||
177 | header.Add(prefix+key.String(), str) | ||
178 | } | ||
179 | return nil | ||
180 | } | ||
181 | |||
182 | func buildURI(u *url.URL, v reflect.Value, name string, tag reflect.StructTag) error { | ||
183 | value, err := convertType(v, tag) | ||
184 | if err == errValueNotSet { | ||
185 | return nil | ||
186 | } else if err != nil { | ||
187 | return awserr.New("SerializationError", "failed to encode REST request", err) | ||
188 | } | ||
189 | |||
190 | u.Path = strings.Replace(u.Path, "{"+name+"}", value, -1) | ||
191 | u.Path = strings.Replace(u.Path, "{"+name+"+}", value, -1) | ||
192 | |||
193 | u.RawPath = strings.Replace(u.RawPath, "{"+name+"}", EscapePath(value, true), -1) | ||
194 | u.RawPath = strings.Replace(u.RawPath, "{"+name+"+}", EscapePath(value, false), -1) | ||
195 | |||
196 | return nil | ||
197 | } | ||
198 | |||
199 | func buildQueryString(query url.Values, v reflect.Value, name string, tag reflect.StructTag) error { | ||
200 | switch value := v.Interface().(type) { | ||
201 | case []*string: | ||
202 | for _, item := range value { | ||
203 | query.Add(name, *item) | ||
204 | } | ||
205 | case map[string]*string: | ||
206 | for key, item := range value { | ||
207 | query.Add(key, *item) | ||
208 | } | ||
209 | case map[string][]*string: | ||
210 | for key, items := range value { | ||
211 | for _, item := range items { | ||
212 | query.Add(key, *item) | ||
213 | } | ||
214 | } | ||
215 | default: | ||
216 | str, err := convertType(v, tag) | ||
217 | if err == errValueNotSet { | ||
218 | return nil | ||
219 | } else if err != nil { | ||
220 | return awserr.New("SerializationError", "failed to encode REST request", err) | ||
221 | } | ||
222 | query.Set(name, str) | ||
223 | } | ||
224 | |||
225 | return nil | ||
226 | } | ||
227 | |||
228 | func cleanPath(u *url.URL) { | ||
229 | hasSlash := strings.HasSuffix(u.Path, "/") | ||
230 | |||
231 | // clean up path, removing duplicate `/` | ||
232 | u.Path = path.Clean(u.Path) | ||
233 | u.RawPath = path.Clean(u.RawPath) | ||
234 | |||
235 | if hasSlash && !strings.HasSuffix(u.Path, "/") { | ||
236 | u.Path += "/" | ||
237 | u.RawPath += "/" | ||
238 | } | ||
239 | } | ||
240 | |||
241 | // EscapePath escapes part of a URL path in Amazon style | ||
242 | func EscapePath(path string, encodeSep bool) string { | ||
243 | var buf bytes.Buffer | ||
244 | for i := 0; i < len(path); i++ { | ||
245 | c := path[i] | ||
246 | if noEscape[c] || (c == '/' && !encodeSep) { | ||
247 | buf.WriteByte(c) | ||
248 | } else { | ||
249 | fmt.Fprintf(&buf, "%%%02X", c) | ||
250 | } | ||
251 | } | ||
252 | return buf.String() | ||
253 | } | ||
254 | |||
255 | func convertType(v reflect.Value, tag reflect.StructTag) (string, error) { | ||
256 | v = reflect.Indirect(v) | ||
257 | if !v.IsValid() { | ||
258 | return "", errValueNotSet | ||
259 | } | ||
260 | |||
261 | var str string | ||
262 | switch value := v.Interface().(type) { | ||
263 | case string: | ||
264 | str = value | ||
265 | case []byte: | ||
266 | str = base64.StdEncoding.EncodeToString(value) | ||
267 | case bool: | ||
268 | str = strconv.FormatBool(value) | ||
269 | case int64: | ||
270 | str = strconv.FormatInt(value, 10) | ||
271 | case float64: | ||
272 | str = strconv.FormatFloat(value, 'f', -1, 64) | ||
273 | case time.Time: | ||
274 | str = value.UTC().Format(RFC822) | ||
275 | case aws.JSONValue: | ||
276 | b, err := json.Marshal(value) | ||
277 | if err != nil { | ||
278 | return "", err | ||
279 | } | ||
280 | if tag.Get("location") == "header" { | ||
281 | str = base64.StdEncoding.EncodeToString(b) | ||
282 | } else { | ||
283 | str = string(b) | ||
284 | } | ||
285 | default: | ||
286 | err := fmt.Errorf("Unsupported value for param %v (%s)", v.Interface(), v.Type()) | ||
287 | return "", err | ||
288 | } | ||
289 | return str, nil | ||
290 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/payload.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/payload.go new file mode 100644 index 0000000..4366de2 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/payload.go | |||
@@ -0,0 +1,45 @@ | |||
1 | package rest | ||
2 | |||
3 | import "reflect" | ||
4 | |||
5 | // PayloadMember returns the payload field member of i if there is one, or nil. | ||
6 | func PayloadMember(i interface{}) interface{} { | ||
7 | if i == nil { | ||
8 | return nil | ||
9 | } | ||
10 | |||
11 | v := reflect.ValueOf(i).Elem() | ||
12 | if !v.IsValid() { | ||
13 | return nil | ||
14 | } | ||
15 | if field, ok := v.Type().FieldByName("_"); ok { | ||
16 | if payloadName := field.Tag.Get("payload"); payloadName != "" { | ||
17 | field, _ := v.Type().FieldByName(payloadName) | ||
18 | if field.Tag.Get("type") != "structure" { | ||
19 | return nil | ||
20 | } | ||
21 | |||
22 | payload := v.FieldByName(payloadName) | ||
23 | if payload.IsValid() || (payload.Kind() == reflect.Ptr && !payload.IsNil()) { | ||
24 | return payload.Interface() | ||
25 | } | ||
26 | } | ||
27 | } | ||
28 | return nil | ||
29 | } | ||
30 | |||
31 | // PayloadType returns the type of a payload field member of i if there is one, or "". | ||
32 | func PayloadType(i interface{}) string { | ||
33 | v := reflect.Indirect(reflect.ValueOf(i)) | ||
34 | if !v.IsValid() { | ||
35 | return "" | ||
36 | } | ||
37 | if field, ok := v.Type().FieldByName("_"); ok { | ||
38 | if payloadName := field.Tag.Get("payload"); payloadName != "" { | ||
39 | if member, ok := v.Type().FieldByName(payloadName); ok { | ||
40 | return member.Tag.Get("type") | ||
41 | } | ||
42 | } | ||
43 | } | ||
44 | return "" | ||
45 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go new file mode 100644 index 0000000..7a779ee --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go | |||
@@ -0,0 +1,227 @@ | |||
1 | package rest | ||
2 | |||
3 | import ( | ||
4 | "bytes" | ||
5 | "encoding/base64" | ||
6 | "encoding/json" | ||
7 | "fmt" | ||
8 | "io" | ||
9 | "io/ioutil" | ||
10 | "net/http" | ||
11 | "reflect" | ||
12 | "strconv" | ||
13 | "strings" | ||
14 | "time" | ||
15 | |||
16 | "github.com/aws/aws-sdk-go/aws" | ||
17 | "github.com/aws/aws-sdk-go/aws/awserr" | ||
18 | "github.com/aws/aws-sdk-go/aws/request" | ||
19 | ) | ||
20 | |||
21 | // UnmarshalHandler is a named request handler for unmarshaling rest protocol requests | ||
22 | var UnmarshalHandler = request.NamedHandler{Name: "awssdk.rest.Unmarshal", Fn: Unmarshal} | ||
23 | |||
24 | // UnmarshalMetaHandler is a named request handler for unmarshaling rest protocol request metadata | ||
25 | var UnmarshalMetaHandler = request.NamedHandler{Name: "awssdk.rest.UnmarshalMeta", Fn: UnmarshalMeta} | ||
26 | |||
27 | // Unmarshal unmarshals the REST component of a response in a REST service. | ||
28 | func Unmarshal(r *request.Request) { | ||
29 | if r.DataFilled() { | ||
30 | v := reflect.Indirect(reflect.ValueOf(r.Data)) | ||
31 | unmarshalBody(r, v) | ||
32 | } | ||
33 | } | ||
34 | |||
35 | // UnmarshalMeta unmarshals the REST metadata of a response in a REST service | ||
36 | func UnmarshalMeta(r *request.Request) { | ||
37 | r.RequestID = r.HTTPResponse.Header.Get("X-Amzn-Requestid") | ||
38 | if r.RequestID == "" { | ||
39 | // Alternative version of request id in the header | ||
40 | r.RequestID = r.HTTPResponse.Header.Get("X-Amz-Request-Id") | ||
41 | } | ||
42 | if r.DataFilled() { | ||
43 | v := reflect.Indirect(reflect.ValueOf(r.Data)) | ||
44 | unmarshalLocationElements(r, v) | ||
45 | } | ||
46 | } | ||
47 | |||
48 | func unmarshalBody(r *request.Request, v reflect.Value) { | ||
49 | if field, ok := v.Type().FieldByName("_"); ok { | ||
50 | if payloadName := field.Tag.Get("payload"); payloadName != "" { | ||
51 | pfield, _ := v.Type().FieldByName(payloadName) | ||
52 | if ptag := pfield.Tag.Get("type"); ptag != "" && ptag != "structure" { | ||
53 | payload := v.FieldByName(payloadName) | ||
54 | if payload.IsValid() { | ||
55 | switch payload.Interface().(type) { | ||
56 | case []byte: | ||
57 | defer r.HTTPResponse.Body.Close() | ||
58 | b, err := ioutil.ReadAll(r.HTTPResponse.Body) | ||
59 | if err != nil { | ||
60 | r.Error = awserr.New("SerializationError", "failed to decode REST response", err) | ||
61 | } else { | ||
62 | payload.Set(reflect.ValueOf(b)) | ||
63 | } | ||
64 | case *string: | ||
65 | defer r.HTTPResponse.Body.Close() | ||
66 | b, err := ioutil.ReadAll(r.HTTPResponse.Body) | ||
67 | if err != nil { | ||
68 | r.Error = awserr.New("SerializationError", "failed to decode REST response", err) | ||
69 | } else { | ||
70 | str := string(b) | ||
71 | payload.Set(reflect.ValueOf(&str)) | ||
72 | } | ||
73 | default: | ||
74 | switch payload.Type().String() { | ||
75 | case "io.ReadCloser": | ||
76 | payload.Set(reflect.ValueOf(r.HTTPResponse.Body)) | ||
77 | case "io.ReadSeeker": | ||
78 | b, err := ioutil.ReadAll(r.HTTPResponse.Body) | ||
79 | if err != nil { | ||
80 | r.Error = awserr.New("SerializationError", | ||
81 | "failed to read response body", err) | ||
82 | return | ||
83 | } | ||
84 | payload.Set(reflect.ValueOf(ioutil.NopCloser(bytes.NewReader(b)))) | ||
85 | default: | ||
86 | io.Copy(ioutil.Discard, r.HTTPResponse.Body) | ||
87 | defer r.HTTPResponse.Body.Close() | ||
88 | r.Error = awserr.New("SerializationError", | ||
89 | "failed to decode REST response", | ||
90 | fmt.Errorf("unknown payload type %s", payload.Type())) | ||
91 | } | ||
92 | } | ||
93 | } | ||
94 | } | ||
95 | } | ||
96 | } | ||
97 | } | ||
98 | |||
99 | func unmarshalLocationElements(r *request.Request, v reflect.Value) { | ||
100 | for i := 0; i < v.NumField(); i++ { | ||
101 | m, field := v.Field(i), v.Type().Field(i) | ||
102 | if n := field.Name; n[0:1] == strings.ToLower(n[0:1]) { | ||
103 | continue | ||
104 | } | ||
105 | |||
106 | if m.IsValid() { | ||
107 | name := field.Tag.Get("locationName") | ||
108 | if name == "" { | ||
109 | name = field.Name | ||
110 | } | ||
111 | |||
112 | switch field.Tag.Get("location") { | ||
113 | case "statusCode": | ||
114 | unmarshalStatusCode(m, r.HTTPResponse.StatusCode) | ||
115 | case "header": | ||
116 | err := unmarshalHeader(m, r.HTTPResponse.Header.Get(name), field.Tag) | ||
117 | if err != nil { | ||
118 | r.Error = awserr.New("SerializationError", "failed to decode REST response", err) | ||
119 | break | ||
120 | } | ||
121 | case "headers": | ||
122 | prefix := field.Tag.Get("locationName") | ||
123 | err := unmarshalHeaderMap(m, r.HTTPResponse.Header, prefix) | ||
124 | if err != nil { | ||
125 | r.Error = awserr.New("SerializationError", "failed to decode REST response", err) | ||
126 | break | ||
127 | } | ||
128 | } | ||
129 | } | ||
130 | if r.Error != nil { | ||
131 | return | ||
132 | } | ||
133 | } | ||
134 | } | ||
135 | |||
136 | func unmarshalStatusCode(v reflect.Value, statusCode int) { | ||
137 | if !v.IsValid() { | ||
138 | return | ||
139 | } | ||
140 | |||
141 | switch v.Interface().(type) { | ||
142 | case *int64: | ||
143 | s := int64(statusCode) | ||
144 | v.Set(reflect.ValueOf(&s)) | ||
145 | } | ||
146 | } | ||
147 | |||
148 | func unmarshalHeaderMap(r reflect.Value, headers http.Header, prefix string) error { | ||
149 | switch r.Interface().(type) { | ||
150 | case map[string]*string: // we only support string map value types | ||
151 | out := map[string]*string{} | ||
152 | for k, v := range headers { | ||
153 | k = http.CanonicalHeaderKey(k) | ||
154 | if strings.HasPrefix(strings.ToLower(k), strings.ToLower(prefix)) { | ||
155 | out[k[len(prefix):]] = &v[0] | ||
156 | } | ||
157 | } | ||
158 | r.Set(reflect.ValueOf(out)) | ||
159 | } | ||
160 | return nil | ||
161 | } | ||
162 | |||
163 | func unmarshalHeader(v reflect.Value, header string, tag reflect.StructTag) error { | ||
164 | isJSONValue := tag.Get("type") == "jsonvalue" | ||
165 | if isJSONValue { | ||
166 | if len(header) == 0 { | ||
167 | return nil | ||
168 | } | ||
169 | } else if !v.IsValid() || (header == "" && v.Elem().Kind() != reflect.String) { | ||
170 | return nil | ||
171 | } | ||
172 | |||
173 | switch v.Interface().(type) { | ||
174 | case *string: | ||
175 | v.Set(reflect.ValueOf(&header)) | ||
176 | case []byte: | ||
177 | b, err := base64.StdEncoding.DecodeString(header) | ||
178 | if err != nil { | ||
179 | return err | ||
180 | } | ||
181 | v.Set(reflect.ValueOf(&b)) | ||
182 | case *bool: | ||
183 | b, err := strconv.ParseBool(header) | ||
184 | if err != nil { | ||
185 | return err | ||
186 | } | ||
187 | v.Set(reflect.ValueOf(&b)) | ||
188 | case *int64: | ||
189 | i, err := strconv.ParseInt(header, 10, 64) | ||
190 | if err != nil { | ||
191 | return err | ||
192 | } | ||
193 | v.Set(reflect.ValueOf(&i)) | ||
194 | case *float64: | ||
195 | f, err := strconv.ParseFloat(header, 64) | ||
196 | if err != nil { | ||
197 | return err | ||
198 | } | ||
199 | v.Set(reflect.ValueOf(&f)) | ||
200 | case *time.Time: | ||
201 | t, err := time.Parse(RFC822, header) | ||
202 | if err != nil { | ||
203 | return err | ||
204 | } | ||
205 | v.Set(reflect.ValueOf(&t)) | ||
206 | case aws.JSONValue: | ||
207 | b := []byte(header) | ||
208 | var err error | ||
209 | if tag.Get("location") == "header" { | ||
210 | b, err = base64.StdEncoding.DecodeString(header) | ||
211 | if err != nil { | ||
212 | return err | ||
213 | } | ||
214 | } | ||
215 | |||
216 | m := aws.JSONValue{} | ||
217 | err = json.Unmarshal(b, &m) | ||
218 | if err != nil { | ||
219 | return err | ||
220 | } | ||
221 | v.Set(reflect.ValueOf(m)) | ||
222 | default: | ||
223 | err := fmt.Errorf("Unsupported value for param %v (%s)", v.Interface(), v.Type()) | ||
224 | return err | ||
225 | } | ||
226 | return nil | ||
227 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/restxml.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/restxml.go new file mode 100644 index 0000000..7bdf4c8 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/restxml.go | |||
@@ -0,0 +1,69 @@ | |||
1 | // Package restxml provides RESTful XML serialization of AWS | ||
2 | // requests and responses. | ||
3 | package restxml | ||
4 | |||
5 | //go:generate go run -tags codegen ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/input/rest-xml.json build_test.go | ||
6 | //go:generate go run -tags codegen ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/output/rest-xml.json unmarshal_test.go | ||
7 | |||
8 | import ( | ||
9 | "bytes" | ||
10 | "encoding/xml" | ||
11 | |||
12 | "github.com/aws/aws-sdk-go/aws/awserr" | ||
13 | "github.com/aws/aws-sdk-go/aws/request" | ||
14 | "github.com/aws/aws-sdk-go/private/protocol/query" | ||
15 | "github.com/aws/aws-sdk-go/private/protocol/rest" | ||
16 | "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" | ||
17 | ) | ||
18 | |||
19 | // BuildHandler is a named request handler for building restxml protocol requests | ||
20 | var BuildHandler = request.NamedHandler{Name: "awssdk.restxml.Build", Fn: Build} | ||
21 | |||
22 | // UnmarshalHandler is a named request handler for unmarshaling restxml protocol requests | ||
23 | var UnmarshalHandler = request.NamedHandler{Name: "awssdk.restxml.Unmarshal", Fn: Unmarshal} | ||
24 | |||
25 | // UnmarshalMetaHandler is a named request handler for unmarshaling restxml protocol request metadata | ||
26 | var UnmarshalMetaHandler = request.NamedHandler{Name: "awssdk.restxml.UnmarshalMeta", Fn: UnmarshalMeta} | ||
27 | |||
28 | // UnmarshalErrorHandler is a named request handler for unmarshaling restxml protocol request errors | ||
29 | var UnmarshalErrorHandler = request.NamedHandler{Name: "awssdk.restxml.UnmarshalError", Fn: UnmarshalError} | ||
30 | |||
31 | // Build builds a request payload for the REST XML protocol. | ||
32 | func Build(r *request.Request) { | ||
33 | rest.Build(r) | ||
34 | |||
35 | if t := rest.PayloadType(r.Params); t == "structure" || t == "" { | ||
36 | var buf bytes.Buffer | ||
37 | err := xmlutil.BuildXML(r.Params, xml.NewEncoder(&buf)) | ||
38 | if err != nil { | ||
39 | r.Error = awserr.New("SerializationError", "failed to encode rest XML request", err) | ||
40 | return | ||
41 | } | ||
42 | r.SetBufferBody(buf.Bytes()) | ||
43 | } | ||
44 | } | ||
45 | |||
46 | // Unmarshal unmarshals a payload response for the REST XML protocol. | ||
47 | func Unmarshal(r *request.Request) { | ||
48 | if t := rest.PayloadType(r.Data); t == "structure" || t == "" { | ||
49 | defer r.HTTPResponse.Body.Close() | ||
50 | decoder := xml.NewDecoder(r.HTTPResponse.Body) | ||
51 | err := xmlutil.UnmarshalXML(r.Data, decoder, "") | ||
52 | if err != nil { | ||
53 | r.Error = awserr.New("SerializationError", "failed to decode REST XML response", err) | ||
54 | return | ||
55 | } | ||
56 | } else { | ||
57 | rest.Unmarshal(r) | ||
58 | } | ||
59 | } | ||
60 | |||
61 | // UnmarshalMeta unmarshals response headers for the REST XML protocol. | ||
62 | func UnmarshalMeta(r *request.Request) { | ||
63 | rest.UnmarshalMeta(r) | ||
64 | } | ||
65 | |||
66 | // UnmarshalError unmarshals a response error for the REST XML protocol. | ||
67 | func UnmarshalError(r *request.Request) { | ||
68 | query.UnmarshalError(r) | ||
69 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/unmarshal.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/unmarshal.go new file mode 100644 index 0000000..da1a681 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/unmarshal.go | |||
@@ -0,0 +1,21 @@ | |||
1 | package protocol | ||
2 | |||
3 | import ( | ||
4 | "io" | ||
5 | "io/ioutil" | ||
6 | |||
7 | "github.com/aws/aws-sdk-go/aws/request" | ||
8 | ) | ||
9 | |||
10 | // UnmarshalDiscardBodyHandler is a named request handler to empty and close a response's body | ||
11 | var UnmarshalDiscardBodyHandler = request.NamedHandler{Name: "awssdk.shared.UnmarshalDiscardBody", Fn: UnmarshalDiscardBody} | ||
12 | |||
13 | // UnmarshalDiscardBody is a request handler to empty a response's body and closing it. | ||
14 | func UnmarshalDiscardBody(r *request.Request) { | ||
15 | if r.HTTPResponse == nil || r.HTTPResponse.Body == nil { | ||
16 | return | ||
17 | } | ||
18 | |||
19 | io.Copy(ioutil.Discard, r.HTTPResponse.Body) | ||
20 | r.HTTPResponse.Body.Close() | ||
21 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/build.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/build.go new file mode 100644 index 0000000..7091b45 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/build.go | |||
@@ -0,0 +1,296 @@ | |||
1 | // Package xmlutil provides XML serialization of AWS requests and responses. | ||
2 | package xmlutil | ||
3 | |||
4 | import ( | ||
5 | "encoding/base64" | ||
6 | "encoding/xml" | ||
7 | "fmt" | ||
8 | "reflect" | ||
9 | "sort" | ||
10 | "strconv" | ||
11 | "time" | ||
12 | |||
13 | "github.com/aws/aws-sdk-go/private/protocol" | ||
14 | ) | ||
15 | |||
16 | // BuildXML will serialize params into an xml.Encoder. | ||
17 | // Error will be returned if the serialization of any of the params or nested values fails. | ||
18 | func BuildXML(params interface{}, e *xml.Encoder) error { | ||
19 | b := xmlBuilder{encoder: e, namespaces: map[string]string{}} | ||
20 | root := NewXMLElement(xml.Name{}) | ||
21 | if err := b.buildValue(reflect.ValueOf(params), root, ""); err != nil { | ||
22 | return err | ||
23 | } | ||
24 | for _, c := range root.Children { | ||
25 | for _, v := range c { | ||
26 | return StructToXML(e, v, false) | ||
27 | } | ||
28 | } | ||
29 | return nil | ||
30 | } | ||
31 | |||
32 | // Returns the reflection element of a value, if it is a pointer. | ||
33 | func elemOf(value reflect.Value) reflect.Value { | ||
34 | for value.Kind() == reflect.Ptr { | ||
35 | value = value.Elem() | ||
36 | } | ||
37 | return value | ||
38 | } | ||
39 | |||
40 | // A xmlBuilder serializes values from Go code to XML | ||
41 | type xmlBuilder struct { | ||
42 | encoder *xml.Encoder | ||
43 | namespaces map[string]string | ||
44 | } | ||
45 | |||
46 | // buildValue generic XMLNode builder for any type. Will build value for their specific type | ||
47 | // struct, list, map, scalar. | ||
48 | // | ||
49 | // Also takes a "type" tag value to set what type a value should be converted to XMLNode as. If | ||
50 | // type is not provided reflect will be used to determine the value's type. | ||
51 | func (b *xmlBuilder) buildValue(value reflect.Value, current *XMLNode, tag reflect.StructTag) error { | ||
52 | value = elemOf(value) | ||
53 | if !value.IsValid() { // no need to handle zero values | ||
54 | return nil | ||
55 | } else if tag.Get("location") != "" { // don't handle non-body location values | ||
56 | return nil | ||
57 | } | ||
58 | |||
59 | t := tag.Get("type") | ||
60 | if t == "" { | ||
61 | switch value.Kind() { | ||
62 | case reflect.Struct: | ||
63 | t = "structure" | ||
64 | case reflect.Slice: | ||
65 | t = "list" | ||
66 | case reflect.Map: | ||
67 | t = "map" | ||
68 | } | ||
69 | } | ||
70 | |||
71 | switch t { | ||
72 | case "structure": | ||
73 | if field, ok := value.Type().FieldByName("_"); ok { | ||
74 | tag = tag + reflect.StructTag(" ") + field.Tag | ||
75 | } | ||
76 | return b.buildStruct(value, current, tag) | ||
77 | case "list": | ||
78 | return b.buildList(value, current, tag) | ||
79 | case "map": | ||
80 | return b.buildMap(value, current, tag) | ||
81 | default: | ||
82 | return b.buildScalar(value, current, tag) | ||
83 | } | ||
84 | } | ||
85 | |||
86 | // buildStruct adds a struct and its fields to the current XMLNode. All fields any any nested | ||
87 | // types are converted to XMLNodes also. | ||
88 | func (b *xmlBuilder) buildStruct(value reflect.Value, current *XMLNode, tag reflect.StructTag) error { | ||
89 | if !value.IsValid() { | ||
90 | return nil | ||
91 | } | ||
92 | |||
93 | fieldAdded := false | ||
94 | |||
95 | // unwrap payloads | ||
96 | if payload := tag.Get("payload"); payload != "" { | ||
97 | field, _ := value.Type().FieldByName(payload) | ||
98 | tag = field.Tag | ||
99 | value = elemOf(value.FieldByName(payload)) | ||
100 | |||
101 | if !value.IsValid() { | ||
102 | return nil | ||
103 | } | ||
104 | } | ||
105 | |||
106 | child := NewXMLElement(xml.Name{Local: tag.Get("locationName")}) | ||
107 | |||
108 | // there is an xmlNamespace associated with this struct | ||
109 | if prefix, uri := tag.Get("xmlPrefix"), tag.Get("xmlURI"); uri != "" { | ||
110 | ns := xml.Attr{ | ||
111 | Name: xml.Name{Local: "xmlns"}, | ||
112 | Value: uri, | ||
113 | } | ||
114 | if prefix != "" { | ||
115 | b.namespaces[prefix] = uri // register the namespace | ||
116 | ns.Name.Local = "xmlns:" + prefix | ||
117 | } | ||
118 | |||
119 | child.Attr = append(child.Attr, ns) | ||
120 | } | ||
121 | |||
122 | t := value.Type() | ||
123 | for i := 0; i < value.NumField(); i++ { | ||
124 | member := elemOf(value.Field(i)) | ||
125 | field := t.Field(i) | ||
126 | |||
127 | if field.PkgPath != "" { | ||
128 | continue // ignore unexported fields | ||
129 | } | ||
130 | if field.Tag.Get("ignore") != "" { | ||
131 | continue | ||
132 | } | ||
133 | |||
134 | mTag := field.Tag | ||
135 | if mTag.Get("location") != "" { // skip non-body members | ||
136 | continue | ||
137 | } | ||
138 | |||
139 | if protocol.CanSetIdempotencyToken(value.Field(i), field) { | ||
140 | token := protocol.GetIdempotencyToken() | ||
141 | member = reflect.ValueOf(token) | ||
142 | } | ||
143 | |||
144 | memberName := mTag.Get("locationName") | ||
145 | if memberName == "" { | ||
146 | memberName = field.Name | ||
147 | mTag = reflect.StructTag(string(mTag) + ` locationName:"` + memberName + `"`) | ||
148 | } | ||
149 | if err := b.buildValue(member, child, mTag); err != nil { | ||
150 | return err | ||
151 | } | ||
152 | |||
153 | fieldAdded = true | ||
154 | } | ||
155 | |||
156 | if fieldAdded { // only append this child if we have one ore more valid members | ||
157 | current.AddChild(child) | ||
158 | } | ||
159 | |||
160 | return nil | ||
161 | } | ||
162 | |||
163 | // buildList adds the value's list items to the current XMLNode as children nodes. All | ||
164 | // nested values in the list are converted to XMLNodes also. | ||
165 | func (b *xmlBuilder) buildList(value reflect.Value, current *XMLNode, tag reflect.StructTag) error { | ||
166 | if value.IsNil() { // don't build omitted lists | ||
167 | return nil | ||
168 | } | ||
169 | |||
170 | // check for unflattened list member | ||
171 | flattened := tag.Get("flattened") != "" | ||
172 | |||
173 | xname := xml.Name{Local: tag.Get("locationName")} | ||
174 | if flattened { | ||
175 | for i := 0; i < value.Len(); i++ { | ||
176 | child := NewXMLElement(xname) | ||
177 | current.AddChild(child) | ||
178 | if err := b.buildValue(value.Index(i), child, ""); err != nil { | ||
179 | return err | ||
180 | } | ||
181 | } | ||
182 | } else { | ||
183 | list := NewXMLElement(xname) | ||
184 | current.AddChild(list) | ||
185 | |||
186 | for i := 0; i < value.Len(); i++ { | ||
187 | iname := tag.Get("locationNameList") | ||
188 | if iname == "" { | ||
189 | iname = "member" | ||
190 | } | ||
191 | |||
192 | child := NewXMLElement(xml.Name{Local: iname}) | ||
193 | list.AddChild(child) | ||
194 | if err := b.buildValue(value.Index(i), child, ""); err != nil { | ||
195 | return err | ||
196 | } | ||
197 | } | ||
198 | } | ||
199 | |||
200 | return nil | ||
201 | } | ||
202 | |||
203 | // buildMap adds the value's key/value pairs to the current XMLNode as children nodes. All | ||
204 | // nested values in the map are converted to XMLNodes also. | ||
205 | // | ||
206 | // Error will be returned if it is unable to build the map's values into XMLNodes | ||
207 | func (b *xmlBuilder) buildMap(value reflect.Value, current *XMLNode, tag reflect.StructTag) error { | ||
208 | if value.IsNil() { // don't build omitted maps | ||
209 | return nil | ||
210 | } | ||
211 | |||
212 | maproot := NewXMLElement(xml.Name{Local: tag.Get("locationName")}) | ||
213 | current.AddChild(maproot) | ||
214 | current = maproot | ||
215 | |||
216 | kname, vname := "key", "value" | ||
217 | if n := tag.Get("locationNameKey"); n != "" { | ||
218 | kname = n | ||
219 | } | ||
220 | if n := tag.Get("locationNameValue"); n != "" { | ||
221 | vname = n | ||
222 | } | ||
223 | |||
224 | // sorting is not required for compliance, but it makes testing easier | ||
225 | keys := make([]string, value.Len()) | ||
226 | for i, k := range value.MapKeys() { | ||
227 | keys[i] = k.String() | ||
228 | } | ||
229 | sort.Strings(keys) | ||
230 | |||
231 | for _, k := range keys { | ||
232 | v := value.MapIndex(reflect.ValueOf(k)) | ||
233 | |||
234 | mapcur := current | ||
235 | if tag.Get("flattened") == "" { // add "entry" tag to non-flat maps | ||
236 | child := NewXMLElement(xml.Name{Local: "entry"}) | ||
237 | mapcur.AddChild(child) | ||
238 | mapcur = child | ||
239 | } | ||
240 | |||
241 | kchild := NewXMLElement(xml.Name{Local: kname}) | ||
242 | kchild.Text = k | ||
243 | vchild := NewXMLElement(xml.Name{Local: vname}) | ||
244 | mapcur.AddChild(kchild) | ||
245 | mapcur.AddChild(vchild) | ||
246 | |||
247 | if err := b.buildValue(v, vchild, ""); err != nil { | ||
248 | return err | ||
249 | } | ||
250 | } | ||
251 | |||
252 | return nil | ||
253 | } | ||
254 | |||
255 | // buildScalar will convert the value into a string and append it as a attribute or child | ||
256 | // of the current XMLNode. | ||
257 | // | ||
258 | // The value will be added as an attribute if tag contains a "xmlAttribute" attribute value. | ||
259 | // | ||
260 | // Error will be returned if the value type is unsupported. | ||
261 | func (b *xmlBuilder) buildScalar(value reflect.Value, current *XMLNode, tag reflect.StructTag) error { | ||
262 | var str string | ||
263 | switch converted := value.Interface().(type) { | ||
264 | case string: | ||
265 | str = converted | ||
266 | case []byte: | ||
267 | if !value.IsNil() { | ||
268 | str = base64.StdEncoding.EncodeToString(converted) | ||
269 | } | ||
270 | case bool: | ||
271 | str = strconv.FormatBool(converted) | ||
272 | case int64: | ||
273 | str = strconv.FormatInt(converted, 10) | ||
274 | case int: | ||
275 | str = strconv.Itoa(converted) | ||
276 | case float64: | ||
277 | str = strconv.FormatFloat(converted, 'f', -1, 64) | ||
278 | case float32: | ||
279 | str = strconv.FormatFloat(float64(converted), 'f', -1, 32) | ||
280 | case time.Time: | ||
281 | const ISO8601UTC = "2006-01-02T15:04:05Z" | ||
282 | str = converted.UTC().Format(ISO8601UTC) | ||
283 | default: | ||
284 | return fmt.Errorf("unsupported value for param %s: %v (%s)", | ||
285 | tag.Get("locationName"), value.Interface(), value.Type().Name()) | ||
286 | } | ||
287 | |||
288 | xname := xml.Name{Local: tag.Get("locationName")} | ||
289 | if tag.Get("xmlAttribute") != "" { // put into current node's attribute list | ||
290 | attr := xml.Attr{Name: xname, Value: str} | ||
291 | current.Attr = append(current.Attr, attr) | ||
292 | } else { // regular text node | ||
293 | current.AddChild(&XMLNode{Name: xname, Text: str}) | ||
294 | } | ||
295 | return nil | ||
296 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/unmarshal.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/unmarshal.go new file mode 100644 index 0000000..8758462 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/unmarshal.go | |||
@@ -0,0 +1,260 @@ | |||
1 | package xmlutil | ||
2 | |||
3 | import ( | ||
4 | "encoding/base64" | ||
5 | "encoding/xml" | ||
6 | "fmt" | ||
7 | "io" | ||
8 | "reflect" | ||
9 | "strconv" | ||
10 | "strings" | ||
11 | "time" | ||
12 | ) | ||
13 | |||
14 | // UnmarshalXML deserializes an xml.Decoder into the container v. V | ||
15 | // needs to match the shape of the XML expected to be decoded. | ||
16 | // If the shape doesn't match unmarshaling will fail. | ||
17 | func UnmarshalXML(v interface{}, d *xml.Decoder, wrapper string) error { | ||
18 | n, err := XMLToStruct(d, nil) | ||
19 | if err != nil { | ||
20 | return err | ||
21 | } | ||
22 | if n.Children != nil { | ||
23 | for _, root := range n.Children { | ||
24 | for _, c := range root { | ||
25 | if wrappedChild, ok := c.Children[wrapper]; ok { | ||
26 | c = wrappedChild[0] // pull out wrapped element | ||
27 | } | ||
28 | |||
29 | err = parse(reflect.ValueOf(v), c, "") | ||
30 | if err != nil { | ||
31 | if err == io.EOF { | ||
32 | return nil | ||
33 | } | ||
34 | return err | ||
35 | } | ||
36 | } | ||
37 | } | ||
38 | return nil | ||
39 | } | ||
40 | return nil | ||
41 | } | ||
42 | |||
43 | // parse deserializes any value from the XMLNode. The type tag is used to infer the type, or reflect | ||
44 | // will be used to determine the type from r. | ||
45 | func parse(r reflect.Value, node *XMLNode, tag reflect.StructTag) error { | ||
46 | rtype := r.Type() | ||
47 | if rtype.Kind() == reflect.Ptr { | ||
48 | rtype = rtype.Elem() // check kind of actual element type | ||
49 | } | ||
50 | |||
51 | t := tag.Get("type") | ||
52 | if t == "" { | ||
53 | switch rtype.Kind() { | ||
54 | case reflect.Struct: | ||
55 | t = "structure" | ||
56 | case reflect.Slice: | ||
57 | t = "list" | ||
58 | case reflect.Map: | ||
59 | t = "map" | ||
60 | } | ||
61 | } | ||
62 | |||
63 | switch t { | ||
64 | case "structure": | ||
65 | if field, ok := rtype.FieldByName("_"); ok { | ||
66 | tag = field.Tag | ||
67 | } | ||
68 | return parseStruct(r, node, tag) | ||
69 | case "list": | ||
70 | return parseList(r, node, tag) | ||
71 | case "map": | ||
72 | return parseMap(r, node, tag) | ||
73 | default: | ||
74 | return parseScalar(r, node, tag) | ||
75 | } | ||
76 | } | ||
77 | |||
78 | // parseStruct deserializes a structure and its fields from an XMLNode. Any nested | ||
79 | // types in the structure will also be deserialized. | ||
80 | func parseStruct(r reflect.Value, node *XMLNode, tag reflect.StructTag) error { | ||
81 | t := r.Type() | ||
82 | if r.Kind() == reflect.Ptr { | ||
83 | if r.IsNil() { // create the structure if it's nil | ||
84 | s := reflect.New(r.Type().Elem()) | ||
85 | r.Set(s) | ||
86 | r = s | ||
87 | } | ||
88 | |||
89 | r = r.Elem() | ||
90 | t = t.Elem() | ||
91 | } | ||
92 | |||
93 | // unwrap any payloads | ||
94 | if payload := tag.Get("payload"); payload != "" { | ||
95 | field, _ := t.FieldByName(payload) | ||
96 | return parseStruct(r.FieldByName(payload), node, field.Tag) | ||
97 | } | ||
98 | |||
99 | for i := 0; i < t.NumField(); i++ { | ||
100 | field := t.Field(i) | ||
101 | if c := field.Name[0:1]; strings.ToLower(c) == c { | ||
102 | continue // ignore unexported fields | ||
103 | } | ||
104 | |||
105 | // figure out what this field is called | ||
106 | name := field.Name | ||
107 | if field.Tag.Get("flattened") != "" && field.Tag.Get("locationNameList") != "" { | ||
108 | name = field.Tag.Get("locationNameList") | ||
109 | } else if locName := field.Tag.Get("locationName"); locName != "" { | ||
110 | name = locName | ||
111 | } | ||
112 | |||
113 | // try to find the field by name in elements | ||
114 | elems := node.Children[name] | ||
115 | |||
116 | if elems == nil { // try to find the field in attributes | ||
117 | if val, ok := node.findElem(name); ok { | ||
118 | elems = []*XMLNode{{Text: val}} | ||
119 | } | ||
120 | } | ||
121 | |||
122 | member := r.FieldByName(field.Name) | ||
123 | for _, elem := range elems { | ||
124 | err := parse(member, elem, field.Tag) | ||
125 | if err != nil { | ||
126 | return err | ||
127 | } | ||
128 | } | ||
129 | } | ||
130 | return nil | ||
131 | } | ||
132 | |||
133 | // parseList deserializes a list of values from an XML node. Each list entry | ||
134 | // will also be deserialized. | ||
135 | func parseList(r reflect.Value, node *XMLNode, tag reflect.StructTag) error { | ||
136 | t := r.Type() | ||
137 | |||
138 | if tag.Get("flattened") == "" { // look at all item entries | ||
139 | mname := "member" | ||
140 | if name := tag.Get("locationNameList"); name != "" { | ||
141 | mname = name | ||
142 | } | ||
143 | |||
144 | if Children, ok := node.Children[mname]; ok { | ||
145 | if r.IsNil() { | ||
146 | r.Set(reflect.MakeSlice(t, len(Children), len(Children))) | ||
147 | } | ||
148 | |||
149 | for i, c := range Children { | ||
150 | err := parse(r.Index(i), c, "") | ||
151 | if err != nil { | ||
152 | return err | ||
153 | } | ||
154 | } | ||
155 | } | ||
156 | } else { // flattened list means this is a single element | ||
157 | if r.IsNil() { | ||
158 | r.Set(reflect.MakeSlice(t, 0, 0)) | ||
159 | } | ||
160 | |||
161 | childR := reflect.Zero(t.Elem()) | ||
162 | r.Set(reflect.Append(r, childR)) | ||
163 | err := parse(r.Index(r.Len()-1), node, "") | ||
164 | if err != nil { | ||
165 | return err | ||
166 | } | ||
167 | } | ||
168 | |||
169 | return nil | ||
170 | } | ||
171 | |||
172 | // parseMap deserializes a map from an XMLNode. The direct children of the XMLNode | ||
173 | // will also be deserialized as map entries. | ||
174 | func parseMap(r reflect.Value, node *XMLNode, tag reflect.StructTag) error { | ||
175 | if r.IsNil() { | ||
176 | r.Set(reflect.MakeMap(r.Type())) | ||
177 | } | ||
178 | |||
179 | if tag.Get("flattened") == "" { // look at all child entries | ||
180 | for _, entry := range node.Children["entry"] { | ||
181 | parseMapEntry(r, entry, tag) | ||
182 | } | ||
183 | } else { // this element is itself an entry | ||
184 | parseMapEntry(r, node, tag) | ||
185 | } | ||
186 | |||
187 | return nil | ||
188 | } | ||
189 | |||
190 | // parseMapEntry deserializes a map entry from a XML node. | ||
191 | func parseMapEntry(r reflect.Value, node *XMLNode, tag reflect.StructTag) error { | ||
192 | kname, vname := "key", "value" | ||
193 | if n := tag.Get("locationNameKey"); n != "" { | ||
194 | kname = n | ||
195 | } | ||
196 | if n := tag.Get("locationNameValue"); n != "" { | ||
197 | vname = n | ||
198 | } | ||
199 | |||
200 | keys, ok := node.Children[kname] | ||
201 | values := node.Children[vname] | ||
202 | if ok { | ||
203 | for i, key := range keys { | ||
204 | keyR := reflect.ValueOf(key.Text) | ||
205 | value := values[i] | ||
206 | valueR := reflect.New(r.Type().Elem()).Elem() | ||
207 | |||
208 | parse(valueR, value, "") | ||
209 | r.SetMapIndex(keyR, valueR) | ||
210 | } | ||
211 | } | ||
212 | return nil | ||
213 | } | ||
214 | |||
215 | // parseScaller deserializes an XMLNode value into a concrete type based on the | ||
216 | // interface type of r. | ||
217 | // | ||
218 | // Error is returned if the deserialization fails due to invalid type conversion, | ||
219 | // or unsupported interface type. | ||
220 | func parseScalar(r reflect.Value, node *XMLNode, tag reflect.StructTag) error { | ||
221 | switch r.Interface().(type) { | ||
222 | case *string: | ||
223 | r.Set(reflect.ValueOf(&node.Text)) | ||
224 | return nil | ||
225 | case []byte: | ||
226 | b, err := base64.StdEncoding.DecodeString(node.Text) | ||
227 | if err != nil { | ||
228 | return err | ||
229 | } | ||
230 | r.Set(reflect.ValueOf(b)) | ||
231 | case *bool: | ||
232 | v, err := strconv.ParseBool(node.Text) | ||
233 | if err != nil { | ||
234 | return err | ||
235 | } | ||
236 | r.Set(reflect.ValueOf(&v)) | ||
237 | case *int64: | ||
238 | v, err := strconv.ParseInt(node.Text, 10, 64) | ||
239 | if err != nil { | ||
240 | return err | ||
241 | } | ||
242 | r.Set(reflect.ValueOf(&v)) | ||
243 | case *float64: | ||
244 | v, err := strconv.ParseFloat(node.Text, 64) | ||
245 | if err != nil { | ||
246 | return err | ||
247 | } | ||
248 | r.Set(reflect.ValueOf(&v)) | ||
249 | case *time.Time: | ||
250 | const ISO8601UTC = "2006-01-02T15:04:05Z" | ||
251 | t, err := time.Parse(ISO8601UTC, node.Text) | ||
252 | if err != nil { | ||
253 | return err | ||
254 | } | ||
255 | r.Set(reflect.ValueOf(&t)) | ||
256 | default: | ||
257 | return fmt.Errorf("unsupported value: %v (%s)", r.Interface(), r.Type()) | ||
258 | } | ||
259 | return nil | ||
260 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go new file mode 100644 index 0000000..3e970b6 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go | |||
@@ -0,0 +1,147 @@ | |||
1 | package xmlutil | ||
2 | |||
3 | import ( | ||
4 | "encoding/xml" | ||
5 | "fmt" | ||
6 | "io" | ||
7 | "sort" | ||
8 | ) | ||
9 | |||
10 | // A XMLNode contains the values to be encoded or decoded. | ||
11 | type XMLNode struct { | ||
12 | Name xml.Name `json:",omitempty"` | ||
13 | Children map[string][]*XMLNode `json:",omitempty"` | ||
14 | Text string `json:",omitempty"` | ||
15 | Attr []xml.Attr `json:",omitempty"` | ||
16 | |||
17 | namespaces map[string]string | ||
18 | parent *XMLNode | ||
19 | } | ||
20 | |||
21 | // NewXMLElement returns a pointer to a new XMLNode initialized to default values. | ||
22 | func NewXMLElement(name xml.Name) *XMLNode { | ||
23 | return &XMLNode{ | ||
24 | Name: name, | ||
25 | Children: map[string][]*XMLNode{}, | ||
26 | Attr: []xml.Attr{}, | ||
27 | } | ||
28 | } | ||
29 | |||
30 | // AddChild adds child to the XMLNode. | ||
31 | func (n *XMLNode) AddChild(child *XMLNode) { | ||
32 | if _, ok := n.Children[child.Name.Local]; !ok { | ||
33 | n.Children[child.Name.Local] = []*XMLNode{} | ||
34 | } | ||
35 | n.Children[child.Name.Local] = append(n.Children[child.Name.Local], child) | ||
36 | } | ||
37 | |||
38 | // XMLToStruct converts a xml.Decoder stream to XMLNode with nested values. | ||
39 | func XMLToStruct(d *xml.Decoder, s *xml.StartElement) (*XMLNode, error) { | ||
40 | out := &XMLNode{} | ||
41 | for { | ||
42 | tok, err := d.Token() | ||
43 | if err != nil { | ||
44 | if err == io.EOF { | ||
45 | break | ||
46 | } else { | ||
47 | return out, err | ||
48 | } | ||
49 | } | ||
50 | |||
51 | if tok == nil { | ||
52 | break | ||
53 | } | ||
54 | |||
55 | switch typed := tok.(type) { | ||
56 | case xml.CharData: | ||
57 | out.Text = string(typed.Copy()) | ||
58 | case xml.StartElement: | ||
59 | el := typed.Copy() | ||
60 | out.Attr = el.Attr | ||
61 | if out.Children == nil { | ||
62 | out.Children = map[string][]*XMLNode{} | ||
63 | } | ||
64 | |||
65 | name := typed.Name.Local | ||
66 | slice := out.Children[name] | ||
67 | if slice == nil { | ||
68 | slice = []*XMLNode{} | ||
69 | } | ||
70 | node, e := XMLToStruct(d, &el) | ||
71 | out.findNamespaces() | ||
72 | if e != nil { | ||
73 | return out, e | ||
74 | } | ||
75 | node.Name = typed.Name | ||
76 | node.findNamespaces() | ||
77 | tempOut := *out | ||
78 | // Save into a temp variable, simply because out gets squashed during | ||
79 | // loop iterations | ||
80 | node.parent = &tempOut | ||
81 | slice = append(slice, node) | ||
82 | out.Children[name] = slice | ||
83 | case xml.EndElement: | ||
84 | if s != nil && s.Name.Local == typed.Name.Local { // matching end token | ||
85 | return out, nil | ||
86 | } | ||
87 | out = &XMLNode{} | ||
88 | } | ||
89 | } | ||
90 | return out, nil | ||
91 | } | ||
92 | |||
93 | func (n *XMLNode) findNamespaces() { | ||
94 | ns := map[string]string{} | ||
95 | for _, a := range n.Attr { | ||
96 | if a.Name.Space == "xmlns" { | ||
97 | ns[a.Value] = a.Name.Local | ||
98 | } | ||
99 | } | ||
100 | |||
101 | n.namespaces = ns | ||
102 | } | ||
103 | |||
104 | func (n *XMLNode) findElem(name string) (string, bool) { | ||
105 | for node := n; node != nil; node = node.parent { | ||
106 | for _, a := range node.Attr { | ||
107 | namespace := a.Name.Space | ||
108 | if v, ok := node.namespaces[namespace]; ok { | ||
109 | namespace = v | ||
110 | } | ||
111 | if name == fmt.Sprintf("%s:%s", namespace, a.Name.Local) { | ||
112 | return a.Value, true | ||
113 | } | ||
114 | } | ||
115 | } | ||
116 | return "", false | ||
117 | } | ||
118 | |||
119 | // StructToXML writes an XMLNode to a xml.Encoder as tokens. | ||
120 | func StructToXML(e *xml.Encoder, node *XMLNode, sorted bool) error { | ||
121 | e.EncodeToken(xml.StartElement{Name: node.Name, Attr: node.Attr}) | ||
122 | |||
123 | if node.Text != "" { | ||
124 | e.EncodeToken(xml.CharData([]byte(node.Text))) | ||
125 | } else if sorted { | ||
126 | sortedNames := []string{} | ||
127 | for k := range node.Children { | ||
128 | sortedNames = append(sortedNames, k) | ||
129 | } | ||
130 | sort.Strings(sortedNames) | ||
131 | |||
132 | for _, k := range sortedNames { | ||
133 | for _, v := range node.Children[k] { | ||
134 | StructToXML(e, v, sorted) | ||
135 | } | ||
136 | } | ||
137 | } else { | ||
138 | for _, c := range node.Children { | ||
139 | for _, v := range c { | ||
140 | StructToXML(e, v, sorted) | ||
141 | } | ||
142 | } | ||
143 | } | ||
144 | |||
145 | e.EncodeToken(xml.EndElement{Name: node.Name}) | ||
146 | return e.Flush() | ||
147 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/api.go b/vendor/github.com/aws/aws-sdk-go/service/s3/api.go new file mode 100644 index 0000000..52ac02c --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/api.go | |||
@@ -0,0 +1,19245 @@ | |||
1 | // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. | ||
2 | |||
3 | package s3 | ||
4 | |||
5 | import ( | ||
6 | "fmt" | ||
7 | "io" | ||
8 | "time" | ||
9 | |||
10 | "github.com/aws/aws-sdk-go/aws" | ||
11 | "github.com/aws/aws-sdk-go/aws/awsutil" | ||
12 | "github.com/aws/aws-sdk-go/aws/request" | ||
13 | "github.com/aws/aws-sdk-go/private/protocol" | ||
14 | "github.com/aws/aws-sdk-go/private/protocol/restxml" | ||
15 | ) | ||
16 | |||
17 | const opAbortMultipartUpload = "AbortMultipartUpload" | ||
18 | |||
19 | // AbortMultipartUploadRequest generates a "aws/request.Request" representing the | ||
20 | // client's request for the AbortMultipartUpload operation. The "output" return | ||
21 | // value can be used to capture response data after the request's "Send" method | ||
22 | // is called. | ||
23 | // | ||
24 | // See AbortMultipartUpload for usage and error information. | ||
25 | // | ||
26 | // Creating a request object using this method should be used when you want to inject | ||
27 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
28 | // access properties on the request object before or after sending the request. If | ||
29 | // you just want the service response, call the AbortMultipartUpload method directly | ||
30 | // instead. | ||
31 | // | ||
32 | // Note: You must call the "Send" method on the returned request object in order | ||
33 | // to execute the request. | ||
34 | // | ||
35 | // // Example sending a request using the AbortMultipartUploadRequest method. | ||
36 | // req, resp := client.AbortMultipartUploadRequest(params) | ||
37 | // | ||
38 | // err := req.Send() | ||
39 | // if err == nil { // resp is now filled | ||
40 | // fmt.Println(resp) | ||
41 | // } | ||
42 | // | ||
43 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AbortMultipartUpload | ||
44 | func (c *S3) AbortMultipartUploadRequest(input *AbortMultipartUploadInput) (req *request.Request, output *AbortMultipartUploadOutput) { | ||
45 | op := &request.Operation{ | ||
46 | Name: opAbortMultipartUpload, | ||
47 | HTTPMethod: "DELETE", | ||
48 | HTTPPath: "/{Bucket}/{Key+}", | ||
49 | } | ||
50 | |||
51 | if input == nil { | ||
52 | input = &AbortMultipartUploadInput{} | ||
53 | } | ||
54 | |||
55 | output = &AbortMultipartUploadOutput{} | ||
56 | req = c.newRequest(op, input, output) | ||
57 | return | ||
58 | } | ||
59 | |||
60 | // AbortMultipartUpload API operation for Amazon Simple Storage Service. | ||
61 | // | ||
62 | // Aborts a multipart upload. | ||
63 | // | ||
64 | // To verify that all parts have been removed, so you don't get charged for | ||
65 | // the part storage, you should call the List Parts operation and ensure the | ||
66 | // parts list is empty. | ||
67 | // | ||
68 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
69 | // with awserr.Error's Code and Message methods to get detailed information about | ||
70 | // the error. | ||
71 | // | ||
72 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
73 | // API operation AbortMultipartUpload for usage and error information. | ||
74 | // | ||
75 | // Returned Error Codes: | ||
76 | // * ErrCodeNoSuchUpload "NoSuchUpload" | ||
77 | // The specified multipart upload does not exist. | ||
78 | // | ||
79 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AbortMultipartUpload | ||
80 | func (c *S3) AbortMultipartUpload(input *AbortMultipartUploadInput) (*AbortMultipartUploadOutput, error) { | ||
81 | req, out := c.AbortMultipartUploadRequest(input) | ||
82 | return out, req.Send() | ||
83 | } | ||
84 | |||
85 | // AbortMultipartUploadWithContext is the same as AbortMultipartUpload with the addition of | ||
86 | // the ability to pass a context and additional request options. | ||
87 | // | ||
88 | // See AbortMultipartUpload for details on how to use this API operation. | ||
89 | // | ||
90 | // The context must be non-nil and will be used for request cancellation. If | ||
91 | // the context is nil a panic will occur. In the future the SDK may create | ||
92 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
93 | // for more information on using Contexts. | ||
94 | func (c *S3) AbortMultipartUploadWithContext(ctx aws.Context, input *AbortMultipartUploadInput, opts ...request.Option) (*AbortMultipartUploadOutput, error) { | ||
95 | req, out := c.AbortMultipartUploadRequest(input) | ||
96 | req.SetContext(ctx) | ||
97 | req.ApplyOptions(opts...) | ||
98 | return out, req.Send() | ||
99 | } | ||
100 | |||
101 | const opCompleteMultipartUpload = "CompleteMultipartUpload" | ||
102 | |||
103 | // CompleteMultipartUploadRequest generates a "aws/request.Request" representing the | ||
104 | // client's request for the CompleteMultipartUpload operation. The "output" return | ||
105 | // value can be used to capture response data after the request's "Send" method | ||
106 | // is called. | ||
107 | // | ||
108 | // See CompleteMultipartUpload for usage and error information. | ||
109 | // | ||
110 | // Creating a request object using this method should be used when you want to inject | ||
111 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
112 | // access properties on the request object before or after sending the request. If | ||
113 | // you just want the service response, call the CompleteMultipartUpload method directly | ||
114 | // instead. | ||
115 | // | ||
116 | // Note: You must call the "Send" method on the returned request object in order | ||
117 | // to execute the request. | ||
118 | // | ||
119 | // // Example sending a request using the CompleteMultipartUploadRequest method. | ||
120 | // req, resp := client.CompleteMultipartUploadRequest(params) | ||
121 | // | ||
122 | // err := req.Send() | ||
123 | // if err == nil { // resp is now filled | ||
124 | // fmt.Println(resp) | ||
125 | // } | ||
126 | // | ||
127 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CompleteMultipartUpload | ||
128 | func (c *S3) CompleteMultipartUploadRequest(input *CompleteMultipartUploadInput) (req *request.Request, output *CompleteMultipartUploadOutput) { | ||
129 | op := &request.Operation{ | ||
130 | Name: opCompleteMultipartUpload, | ||
131 | HTTPMethod: "POST", | ||
132 | HTTPPath: "/{Bucket}/{Key+}", | ||
133 | } | ||
134 | |||
135 | if input == nil { | ||
136 | input = &CompleteMultipartUploadInput{} | ||
137 | } | ||
138 | |||
139 | output = &CompleteMultipartUploadOutput{} | ||
140 | req = c.newRequest(op, input, output) | ||
141 | return | ||
142 | } | ||
143 | |||
144 | // CompleteMultipartUpload API operation for Amazon Simple Storage Service. | ||
145 | // | ||
146 | // Completes a multipart upload by assembling previously uploaded parts. | ||
147 | // | ||
148 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
149 | // with awserr.Error's Code and Message methods to get detailed information about | ||
150 | // the error. | ||
151 | // | ||
152 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
153 | // API operation CompleteMultipartUpload for usage and error information. | ||
154 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CompleteMultipartUpload | ||
155 | func (c *S3) CompleteMultipartUpload(input *CompleteMultipartUploadInput) (*CompleteMultipartUploadOutput, error) { | ||
156 | req, out := c.CompleteMultipartUploadRequest(input) | ||
157 | return out, req.Send() | ||
158 | } | ||
159 | |||
160 | // CompleteMultipartUploadWithContext is the same as CompleteMultipartUpload with the addition of | ||
161 | // the ability to pass a context and additional request options. | ||
162 | // | ||
163 | // See CompleteMultipartUpload for details on how to use this API operation. | ||
164 | // | ||
165 | // The context must be non-nil and will be used for request cancellation. If | ||
166 | // the context is nil a panic will occur. In the future the SDK may create | ||
167 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
168 | // for more information on using Contexts. | ||
169 | func (c *S3) CompleteMultipartUploadWithContext(ctx aws.Context, input *CompleteMultipartUploadInput, opts ...request.Option) (*CompleteMultipartUploadOutput, error) { | ||
170 | req, out := c.CompleteMultipartUploadRequest(input) | ||
171 | req.SetContext(ctx) | ||
172 | req.ApplyOptions(opts...) | ||
173 | return out, req.Send() | ||
174 | } | ||
175 | |||
176 | const opCopyObject = "CopyObject" | ||
177 | |||
178 | // CopyObjectRequest generates a "aws/request.Request" representing the | ||
179 | // client's request for the CopyObject operation. The "output" return | ||
180 | // value can be used to capture response data after the request's "Send" method | ||
181 | // is called. | ||
182 | // | ||
183 | // See CopyObject for usage and error information. | ||
184 | // | ||
185 | // Creating a request object using this method should be used when you want to inject | ||
186 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
187 | // access properties on the request object before or after sending the request. If | ||
188 | // you just want the service response, call the CopyObject method directly | ||
189 | // instead. | ||
190 | // | ||
191 | // Note: You must call the "Send" method on the returned request object in order | ||
192 | // to execute the request. | ||
193 | // | ||
194 | // // Example sending a request using the CopyObjectRequest method. | ||
195 | // req, resp := client.CopyObjectRequest(params) | ||
196 | // | ||
197 | // err := req.Send() | ||
198 | // if err == nil { // resp is now filled | ||
199 | // fmt.Println(resp) | ||
200 | // } | ||
201 | // | ||
202 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CopyObject | ||
203 | func (c *S3) CopyObjectRequest(input *CopyObjectInput) (req *request.Request, output *CopyObjectOutput) { | ||
204 | op := &request.Operation{ | ||
205 | Name: opCopyObject, | ||
206 | HTTPMethod: "PUT", | ||
207 | HTTPPath: "/{Bucket}/{Key+}", | ||
208 | } | ||
209 | |||
210 | if input == nil { | ||
211 | input = &CopyObjectInput{} | ||
212 | } | ||
213 | |||
214 | output = &CopyObjectOutput{} | ||
215 | req = c.newRequest(op, input, output) | ||
216 | return | ||
217 | } | ||
218 | |||
219 | // CopyObject API operation for Amazon Simple Storage Service. | ||
220 | // | ||
221 | // Creates a copy of an object that is already stored in Amazon S3. | ||
222 | // | ||
223 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
224 | // with awserr.Error's Code and Message methods to get detailed information about | ||
225 | // the error. | ||
226 | // | ||
227 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
228 | // API operation CopyObject for usage and error information. | ||
229 | // | ||
230 | // Returned Error Codes: | ||
231 | // * ErrCodeObjectNotInActiveTierError "ObjectNotInActiveTierError" | ||
232 | // The source object of the COPY operation is not in the active tier and is | ||
233 | // only stored in Amazon Glacier. | ||
234 | // | ||
235 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CopyObject | ||
236 | func (c *S3) CopyObject(input *CopyObjectInput) (*CopyObjectOutput, error) { | ||
237 | req, out := c.CopyObjectRequest(input) | ||
238 | return out, req.Send() | ||
239 | } | ||
240 | |||
241 | // CopyObjectWithContext is the same as CopyObject with the addition of | ||
242 | // the ability to pass a context and additional request options. | ||
243 | // | ||
244 | // See CopyObject for details on how to use this API operation. | ||
245 | // | ||
246 | // The context must be non-nil and will be used for request cancellation. If | ||
247 | // the context is nil a panic will occur. In the future the SDK may create | ||
248 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
249 | // for more information on using Contexts. | ||
250 | func (c *S3) CopyObjectWithContext(ctx aws.Context, input *CopyObjectInput, opts ...request.Option) (*CopyObjectOutput, error) { | ||
251 | req, out := c.CopyObjectRequest(input) | ||
252 | req.SetContext(ctx) | ||
253 | req.ApplyOptions(opts...) | ||
254 | return out, req.Send() | ||
255 | } | ||
256 | |||
257 | const opCreateBucket = "CreateBucket" | ||
258 | |||
259 | // CreateBucketRequest generates a "aws/request.Request" representing the | ||
260 | // client's request for the CreateBucket operation. The "output" return | ||
261 | // value can be used to capture response data after the request's "Send" method | ||
262 | // is called. | ||
263 | // | ||
264 | // See CreateBucket for usage and error information. | ||
265 | // | ||
266 | // Creating a request object using this method should be used when you want to inject | ||
267 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
268 | // access properties on the request object before or after sending the request. If | ||
269 | // you just want the service response, call the CreateBucket method directly | ||
270 | // instead. | ||
271 | // | ||
272 | // Note: You must call the "Send" method on the returned request object in order | ||
273 | // to execute the request. | ||
274 | // | ||
275 | // // Example sending a request using the CreateBucketRequest method. | ||
276 | // req, resp := client.CreateBucketRequest(params) | ||
277 | // | ||
278 | // err := req.Send() | ||
279 | // if err == nil { // resp is now filled | ||
280 | // fmt.Println(resp) | ||
281 | // } | ||
282 | // | ||
283 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateBucket | ||
284 | func (c *S3) CreateBucketRequest(input *CreateBucketInput) (req *request.Request, output *CreateBucketOutput) { | ||
285 | op := &request.Operation{ | ||
286 | Name: opCreateBucket, | ||
287 | HTTPMethod: "PUT", | ||
288 | HTTPPath: "/{Bucket}", | ||
289 | } | ||
290 | |||
291 | if input == nil { | ||
292 | input = &CreateBucketInput{} | ||
293 | } | ||
294 | |||
295 | output = &CreateBucketOutput{} | ||
296 | req = c.newRequest(op, input, output) | ||
297 | return | ||
298 | } | ||
299 | |||
300 | // CreateBucket API operation for Amazon Simple Storage Service. | ||
301 | // | ||
302 | // Creates a new bucket. | ||
303 | // | ||
304 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
305 | // with awserr.Error's Code and Message methods to get detailed information about | ||
306 | // the error. | ||
307 | // | ||
308 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
309 | // API operation CreateBucket for usage and error information. | ||
310 | // | ||
311 | // Returned Error Codes: | ||
312 | // * ErrCodeBucketAlreadyExists "BucketAlreadyExists" | ||
313 | // The requested bucket name is not available. The bucket namespace is shared | ||
314 | // by all users of the system. Please select a different name and try again. | ||
315 | // | ||
316 | // * ErrCodeBucketAlreadyOwnedByYou "BucketAlreadyOwnedByYou" | ||
317 | // | ||
318 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateBucket | ||
319 | func (c *S3) CreateBucket(input *CreateBucketInput) (*CreateBucketOutput, error) { | ||
320 | req, out := c.CreateBucketRequest(input) | ||
321 | return out, req.Send() | ||
322 | } | ||
323 | |||
324 | // CreateBucketWithContext is the same as CreateBucket with the addition of | ||
325 | // the ability to pass a context and additional request options. | ||
326 | // | ||
327 | // See CreateBucket for details on how to use this API operation. | ||
328 | // | ||
329 | // The context must be non-nil and will be used for request cancellation. If | ||
330 | // the context is nil a panic will occur. In the future the SDK may create | ||
331 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
332 | // for more information on using Contexts. | ||
333 | func (c *S3) CreateBucketWithContext(ctx aws.Context, input *CreateBucketInput, opts ...request.Option) (*CreateBucketOutput, error) { | ||
334 | req, out := c.CreateBucketRequest(input) | ||
335 | req.SetContext(ctx) | ||
336 | req.ApplyOptions(opts...) | ||
337 | return out, req.Send() | ||
338 | } | ||
339 | |||
340 | const opCreateMultipartUpload = "CreateMultipartUpload" | ||
341 | |||
342 | // CreateMultipartUploadRequest generates a "aws/request.Request" representing the | ||
343 | // client's request for the CreateMultipartUpload operation. The "output" return | ||
344 | // value can be used to capture response data after the request's "Send" method | ||
345 | // is called. | ||
346 | // | ||
347 | // See CreateMultipartUpload for usage and error information. | ||
348 | // | ||
349 | // Creating a request object using this method should be used when you want to inject | ||
350 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
351 | // access properties on the request object before or after sending the request. If | ||
352 | // you just want the service response, call the CreateMultipartUpload method directly | ||
353 | // instead. | ||
354 | // | ||
355 | // Note: You must call the "Send" method on the returned request object in order | ||
356 | // to execute the request. | ||
357 | // | ||
358 | // // Example sending a request using the CreateMultipartUploadRequest method. | ||
359 | // req, resp := client.CreateMultipartUploadRequest(params) | ||
360 | // | ||
361 | // err := req.Send() | ||
362 | // if err == nil { // resp is now filled | ||
363 | // fmt.Println(resp) | ||
364 | // } | ||
365 | // | ||
366 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateMultipartUpload | ||
367 | func (c *S3) CreateMultipartUploadRequest(input *CreateMultipartUploadInput) (req *request.Request, output *CreateMultipartUploadOutput) { | ||
368 | op := &request.Operation{ | ||
369 | Name: opCreateMultipartUpload, | ||
370 | HTTPMethod: "POST", | ||
371 | HTTPPath: "/{Bucket}/{Key+}?uploads", | ||
372 | } | ||
373 | |||
374 | if input == nil { | ||
375 | input = &CreateMultipartUploadInput{} | ||
376 | } | ||
377 | |||
378 | output = &CreateMultipartUploadOutput{} | ||
379 | req = c.newRequest(op, input, output) | ||
380 | return | ||
381 | } | ||
382 | |||
383 | // CreateMultipartUpload API operation for Amazon Simple Storage Service. | ||
384 | // | ||
385 | // Initiates a multipart upload and returns an upload ID. | ||
386 | // | ||
387 | // Note: After you initiate multipart upload and upload one or more parts, you | ||
388 | // must either complete or abort multipart upload in order to stop getting charged | ||
389 | // for storage of the uploaded parts. Only after you either complete or abort | ||
390 | // multipart upload, Amazon S3 frees up the parts storage and stops charging | ||
391 | // you for the parts storage. | ||
392 | // | ||
393 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
394 | // with awserr.Error's Code and Message methods to get detailed information about | ||
395 | // the error. | ||
396 | // | ||
397 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
398 | // API operation CreateMultipartUpload for usage and error information. | ||
399 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateMultipartUpload | ||
400 | func (c *S3) CreateMultipartUpload(input *CreateMultipartUploadInput) (*CreateMultipartUploadOutput, error) { | ||
401 | req, out := c.CreateMultipartUploadRequest(input) | ||
402 | return out, req.Send() | ||
403 | } | ||
404 | |||
405 | // CreateMultipartUploadWithContext is the same as CreateMultipartUpload with the addition of | ||
406 | // the ability to pass a context and additional request options. | ||
407 | // | ||
408 | // See CreateMultipartUpload for details on how to use this API operation. | ||
409 | // | ||
410 | // The context must be non-nil and will be used for request cancellation. If | ||
411 | // the context is nil a panic will occur. In the future the SDK may create | ||
412 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
413 | // for more information on using Contexts. | ||
414 | func (c *S3) CreateMultipartUploadWithContext(ctx aws.Context, input *CreateMultipartUploadInput, opts ...request.Option) (*CreateMultipartUploadOutput, error) { | ||
415 | req, out := c.CreateMultipartUploadRequest(input) | ||
416 | req.SetContext(ctx) | ||
417 | req.ApplyOptions(opts...) | ||
418 | return out, req.Send() | ||
419 | } | ||
420 | |||
421 | const opDeleteBucket = "DeleteBucket" | ||
422 | |||
423 | // DeleteBucketRequest generates a "aws/request.Request" representing the | ||
424 | // client's request for the DeleteBucket operation. The "output" return | ||
425 | // value can be used to capture response data after the request's "Send" method | ||
426 | // is called. | ||
427 | // | ||
428 | // See DeleteBucket for usage and error information. | ||
429 | // | ||
430 | // Creating a request object using this method should be used when you want to inject | ||
431 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
432 | // access properties on the request object before or after sending the request. If | ||
433 | // you just want the service response, call the DeleteBucket method directly | ||
434 | // instead. | ||
435 | // | ||
436 | // Note: You must call the "Send" method on the returned request object in order | ||
437 | // to execute the request. | ||
438 | // | ||
439 | // // Example sending a request using the DeleteBucketRequest method. | ||
440 | // req, resp := client.DeleteBucketRequest(params) | ||
441 | // | ||
442 | // err := req.Send() | ||
443 | // if err == nil { // resp is now filled | ||
444 | // fmt.Println(resp) | ||
445 | // } | ||
446 | // | ||
447 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucket | ||
448 | func (c *S3) DeleteBucketRequest(input *DeleteBucketInput) (req *request.Request, output *DeleteBucketOutput) { | ||
449 | op := &request.Operation{ | ||
450 | Name: opDeleteBucket, | ||
451 | HTTPMethod: "DELETE", | ||
452 | HTTPPath: "/{Bucket}", | ||
453 | } | ||
454 | |||
455 | if input == nil { | ||
456 | input = &DeleteBucketInput{} | ||
457 | } | ||
458 | |||
459 | output = &DeleteBucketOutput{} | ||
460 | req = c.newRequest(op, input, output) | ||
461 | req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) | ||
462 | req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) | ||
463 | return | ||
464 | } | ||
465 | |||
466 | // DeleteBucket API operation for Amazon Simple Storage Service. | ||
467 | // | ||
468 | // Deletes the bucket. All objects (including all object versions and Delete | ||
469 | // Markers) in the bucket must be deleted before the bucket itself can be deleted. | ||
470 | // | ||
471 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
472 | // with awserr.Error's Code and Message methods to get detailed information about | ||
473 | // the error. | ||
474 | // | ||
475 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
476 | // API operation DeleteBucket for usage and error information. | ||
477 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucket | ||
478 | func (c *S3) DeleteBucket(input *DeleteBucketInput) (*DeleteBucketOutput, error) { | ||
479 | req, out := c.DeleteBucketRequest(input) | ||
480 | return out, req.Send() | ||
481 | } | ||
482 | |||
483 | // DeleteBucketWithContext is the same as DeleteBucket with the addition of | ||
484 | // the ability to pass a context and additional request options. | ||
485 | // | ||
486 | // See DeleteBucket for details on how to use this API operation. | ||
487 | // | ||
488 | // The context must be non-nil and will be used for request cancellation. If | ||
489 | // the context is nil a panic will occur. In the future the SDK may create | ||
490 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
491 | // for more information on using Contexts. | ||
492 | func (c *S3) DeleteBucketWithContext(ctx aws.Context, input *DeleteBucketInput, opts ...request.Option) (*DeleteBucketOutput, error) { | ||
493 | req, out := c.DeleteBucketRequest(input) | ||
494 | req.SetContext(ctx) | ||
495 | req.ApplyOptions(opts...) | ||
496 | return out, req.Send() | ||
497 | } | ||
498 | |||
499 | const opDeleteBucketAnalyticsConfiguration = "DeleteBucketAnalyticsConfiguration" | ||
500 | |||
501 | // DeleteBucketAnalyticsConfigurationRequest generates a "aws/request.Request" representing the | ||
502 | // client's request for the DeleteBucketAnalyticsConfiguration operation. The "output" return | ||
503 | // value can be used to capture response data after the request's "Send" method | ||
504 | // is called. | ||
505 | // | ||
506 | // See DeleteBucketAnalyticsConfiguration for usage and error information. | ||
507 | // | ||
508 | // Creating a request object using this method should be used when you want to inject | ||
509 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
510 | // access properties on the request object before or after sending the request. If | ||
511 | // you just want the service response, call the DeleteBucketAnalyticsConfiguration method directly | ||
512 | // instead. | ||
513 | // | ||
514 | // Note: You must call the "Send" method on the returned request object in order | ||
515 | // to execute the request. | ||
516 | // | ||
517 | // // Example sending a request using the DeleteBucketAnalyticsConfigurationRequest method. | ||
518 | // req, resp := client.DeleteBucketAnalyticsConfigurationRequest(params) | ||
519 | // | ||
520 | // err := req.Send() | ||
521 | // if err == nil { // resp is now filled | ||
522 | // fmt.Println(resp) | ||
523 | // } | ||
524 | // | ||
525 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketAnalyticsConfiguration | ||
526 | func (c *S3) DeleteBucketAnalyticsConfigurationRequest(input *DeleteBucketAnalyticsConfigurationInput) (req *request.Request, output *DeleteBucketAnalyticsConfigurationOutput) { | ||
527 | op := &request.Operation{ | ||
528 | Name: opDeleteBucketAnalyticsConfiguration, | ||
529 | HTTPMethod: "DELETE", | ||
530 | HTTPPath: "/{Bucket}?analytics", | ||
531 | } | ||
532 | |||
533 | if input == nil { | ||
534 | input = &DeleteBucketAnalyticsConfigurationInput{} | ||
535 | } | ||
536 | |||
537 | output = &DeleteBucketAnalyticsConfigurationOutput{} | ||
538 | req = c.newRequest(op, input, output) | ||
539 | req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) | ||
540 | req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) | ||
541 | return | ||
542 | } | ||
543 | |||
544 | // DeleteBucketAnalyticsConfiguration API operation for Amazon Simple Storage Service. | ||
545 | // | ||
546 | // Deletes an analytics configuration for the bucket (specified by the analytics | ||
547 | // configuration ID). | ||
548 | // | ||
549 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
550 | // with awserr.Error's Code and Message methods to get detailed information about | ||
551 | // the error. | ||
552 | // | ||
553 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
554 | // API operation DeleteBucketAnalyticsConfiguration for usage and error information. | ||
555 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketAnalyticsConfiguration | ||
556 | func (c *S3) DeleteBucketAnalyticsConfiguration(input *DeleteBucketAnalyticsConfigurationInput) (*DeleteBucketAnalyticsConfigurationOutput, error) { | ||
557 | req, out := c.DeleteBucketAnalyticsConfigurationRequest(input) | ||
558 | return out, req.Send() | ||
559 | } | ||
560 | |||
561 | // DeleteBucketAnalyticsConfigurationWithContext is the same as DeleteBucketAnalyticsConfiguration with the addition of | ||
562 | // the ability to pass a context and additional request options. | ||
563 | // | ||
564 | // See DeleteBucketAnalyticsConfiguration for details on how to use this API operation. | ||
565 | // | ||
566 | // The context must be non-nil and will be used for request cancellation. If | ||
567 | // the context is nil a panic will occur. In the future the SDK may create | ||
568 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
569 | // for more information on using Contexts. | ||
570 | func (c *S3) DeleteBucketAnalyticsConfigurationWithContext(ctx aws.Context, input *DeleteBucketAnalyticsConfigurationInput, opts ...request.Option) (*DeleteBucketAnalyticsConfigurationOutput, error) { | ||
571 | req, out := c.DeleteBucketAnalyticsConfigurationRequest(input) | ||
572 | req.SetContext(ctx) | ||
573 | req.ApplyOptions(opts...) | ||
574 | return out, req.Send() | ||
575 | } | ||
576 | |||
577 | const opDeleteBucketCors = "DeleteBucketCors" | ||
578 | |||
579 | // DeleteBucketCorsRequest generates a "aws/request.Request" representing the | ||
580 | // client's request for the DeleteBucketCors operation. The "output" return | ||
581 | // value can be used to capture response data after the request's "Send" method | ||
582 | // is called. | ||
583 | // | ||
584 | // See DeleteBucketCors for usage and error information. | ||
585 | // | ||
586 | // Creating a request object using this method should be used when you want to inject | ||
587 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
588 | // access properties on the request object before or after sending the request. If | ||
589 | // you just want the service response, call the DeleteBucketCors method directly | ||
590 | // instead. | ||
591 | // | ||
592 | // Note: You must call the "Send" method on the returned request object in order | ||
593 | // to execute the request. | ||
594 | // | ||
595 | // // Example sending a request using the DeleteBucketCorsRequest method. | ||
596 | // req, resp := client.DeleteBucketCorsRequest(params) | ||
597 | // | ||
598 | // err := req.Send() | ||
599 | // if err == nil { // resp is now filled | ||
600 | // fmt.Println(resp) | ||
601 | // } | ||
602 | // | ||
603 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketCors | ||
604 | func (c *S3) DeleteBucketCorsRequest(input *DeleteBucketCorsInput) (req *request.Request, output *DeleteBucketCorsOutput) { | ||
605 | op := &request.Operation{ | ||
606 | Name: opDeleteBucketCors, | ||
607 | HTTPMethod: "DELETE", | ||
608 | HTTPPath: "/{Bucket}?cors", | ||
609 | } | ||
610 | |||
611 | if input == nil { | ||
612 | input = &DeleteBucketCorsInput{} | ||
613 | } | ||
614 | |||
615 | output = &DeleteBucketCorsOutput{} | ||
616 | req = c.newRequest(op, input, output) | ||
617 | req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) | ||
618 | req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) | ||
619 | return | ||
620 | } | ||
621 | |||
622 | // DeleteBucketCors API operation for Amazon Simple Storage Service. | ||
623 | // | ||
624 | // Deletes the cors configuration information set for the bucket. | ||
625 | // | ||
626 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
627 | // with awserr.Error's Code and Message methods to get detailed information about | ||
628 | // the error. | ||
629 | // | ||
630 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
631 | // API operation DeleteBucketCors for usage and error information. | ||
632 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketCors | ||
633 | func (c *S3) DeleteBucketCors(input *DeleteBucketCorsInput) (*DeleteBucketCorsOutput, error) { | ||
634 | req, out := c.DeleteBucketCorsRequest(input) | ||
635 | return out, req.Send() | ||
636 | } | ||
637 | |||
638 | // DeleteBucketCorsWithContext is the same as DeleteBucketCors with the addition of | ||
639 | // the ability to pass a context and additional request options. | ||
640 | // | ||
641 | // See DeleteBucketCors for details on how to use this API operation. | ||
642 | // | ||
643 | // The context must be non-nil and will be used for request cancellation. If | ||
644 | // the context is nil a panic will occur. In the future the SDK may create | ||
645 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
646 | // for more information on using Contexts. | ||
647 | func (c *S3) DeleteBucketCorsWithContext(ctx aws.Context, input *DeleteBucketCorsInput, opts ...request.Option) (*DeleteBucketCorsOutput, error) { | ||
648 | req, out := c.DeleteBucketCorsRequest(input) | ||
649 | req.SetContext(ctx) | ||
650 | req.ApplyOptions(opts...) | ||
651 | return out, req.Send() | ||
652 | } | ||
653 | |||
654 | const opDeleteBucketInventoryConfiguration = "DeleteBucketInventoryConfiguration" | ||
655 | |||
656 | // DeleteBucketInventoryConfigurationRequest generates a "aws/request.Request" representing the | ||
657 | // client's request for the DeleteBucketInventoryConfiguration operation. The "output" return | ||
658 | // value can be used to capture response data after the request's "Send" method | ||
659 | // is called. | ||
660 | // | ||
661 | // See DeleteBucketInventoryConfiguration for usage and error information. | ||
662 | // | ||
663 | // Creating a request object using this method should be used when you want to inject | ||
664 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
665 | // access properties on the request object before or after sending the request. If | ||
666 | // you just want the service response, call the DeleteBucketInventoryConfiguration method directly | ||
667 | // instead. | ||
668 | // | ||
669 | // Note: You must call the "Send" method on the returned request object in order | ||
670 | // to execute the request. | ||
671 | // | ||
672 | // // Example sending a request using the DeleteBucketInventoryConfigurationRequest method. | ||
673 | // req, resp := client.DeleteBucketInventoryConfigurationRequest(params) | ||
674 | // | ||
675 | // err := req.Send() | ||
676 | // if err == nil { // resp is now filled | ||
677 | // fmt.Println(resp) | ||
678 | // } | ||
679 | // | ||
680 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketInventoryConfiguration | ||
681 | func (c *S3) DeleteBucketInventoryConfigurationRequest(input *DeleteBucketInventoryConfigurationInput) (req *request.Request, output *DeleteBucketInventoryConfigurationOutput) { | ||
682 | op := &request.Operation{ | ||
683 | Name: opDeleteBucketInventoryConfiguration, | ||
684 | HTTPMethod: "DELETE", | ||
685 | HTTPPath: "/{Bucket}?inventory", | ||
686 | } | ||
687 | |||
688 | if input == nil { | ||
689 | input = &DeleteBucketInventoryConfigurationInput{} | ||
690 | } | ||
691 | |||
692 | output = &DeleteBucketInventoryConfigurationOutput{} | ||
693 | req = c.newRequest(op, input, output) | ||
694 | req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) | ||
695 | req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) | ||
696 | return | ||
697 | } | ||
698 | |||
699 | // DeleteBucketInventoryConfiguration API operation for Amazon Simple Storage Service. | ||
700 | // | ||
701 | // Deletes an inventory configuration (identified by the inventory ID) from | ||
702 | // the bucket. | ||
703 | // | ||
704 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
705 | // with awserr.Error's Code and Message methods to get detailed information about | ||
706 | // the error. | ||
707 | // | ||
708 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
709 | // API operation DeleteBucketInventoryConfiguration for usage and error information. | ||
710 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketInventoryConfiguration | ||
711 | func (c *S3) DeleteBucketInventoryConfiguration(input *DeleteBucketInventoryConfigurationInput) (*DeleteBucketInventoryConfigurationOutput, error) { | ||
712 | req, out := c.DeleteBucketInventoryConfigurationRequest(input) | ||
713 | return out, req.Send() | ||
714 | } | ||
715 | |||
716 | // DeleteBucketInventoryConfigurationWithContext is the same as DeleteBucketInventoryConfiguration with the addition of | ||
717 | // the ability to pass a context and additional request options. | ||
718 | // | ||
719 | // See DeleteBucketInventoryConfiguration for details on how to use this API operation. | ||
720 | // | ||
721 | // The context must be non-nil and will be used for request cancellation. If | ||
722 | // the context is nil a panic will occur. In the future the SDK may create | ||
723 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
724 | // for more information on using Contexts. | ||
725 | func (c *S3) DeleteBucketInventoryConfigurationWithContext(ctx aws.Context, input *DeleteBucketInventoryConfigurationInput, opts ...request.Option) (*DeleteBucketInventoryConfigurationOutput, error) { | ||
726 | req, out := c.DeleteBucketInventoryConfigurationRequest(input) | ||
727 | req.SetContext(ctx) | ||
728 | req.ApplyOptions(opts...) | ||
729 | return out, req.Send() | ||
730 | } | ||
731 | |||
732 | const opDeleteBucketLifecycle = "DeleteBucketLifecycle" | ||
733 | |||
734 | // DeleteBucketLifecycleRequest generates a "aws/request.Request" representing the | ||
735 | // client's request for the DeleteBucketLifecycle operation. The "output" return | ||
736 | // value can be used to capture response data after the request's "Send" method | ||
737 | // is called. | ||
738 | // | ||
739 | // See DeleteBucketLifecycle for usage and error information. | ||
740 | // | ||
741 | // Creating a request object using this method should be used when you want to inject | ||
742 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
743 | // access properties on the request object before or after sending the request. If | ||
744 | // you just want the service response, call the DeleteBucketLifecycle method directly | ||
745 | // instead. | ||
746 | // | ||
747 | // Note: You must call the "Send" method on the returned request object in order | ||
748 | // to execute the request. | ||
749 | // | ||
750 | // // Example sending a request using the DeleteBucketLifecycleRequest method. | ||
751 | // req, resp := client.DeleteBucketLifecycleRequest(params) | ||
752 | // | ||
753 | // err := req.Send() | ||
754 | // if err == nil { // resp is now filled | ||
755 | // fmt.Println(resp) | ||
756 | // } | ||
757 | // | ||
758 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketLifecycle | ||
759 | func (c *S3) DeleteBucketLifecycleRequest(input *DeleteBucketLifecycleInput) (req *request.Request, output *DeleteBucketLifecycleOutput) { | ||
760 | op := &request.Operation{ | ||
761 | Name: opDeleteBucketLifecycle, | ||
762 | HTTPMethod: "DELETE", | ||
763 | HTTPPath: "/{Bucket}?lifecycle", | ||
764 | } | ||
765 | |||
766 | if input == nil { | ||
767 | input = &DeleteBucketLifecycleInput{} | ||
768 | } | ||
769 | |||
770 | output = &DeleteBucketLifecycleOutput{} | ||
771 | req = c.newRequest(op, input, output) | ||
772 | req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) | ||
773 | req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) | ||
774 | return | ||
775 | } | ||
776 | |||
777 | // DeleteBucketLifecycle API operation for Amazon Simple Storage Service. | ||
778 | // | ||
779 | // Deletes the lifecycle configuration from the bucket. | ||
780 | // | ||
781 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
782 | // with awserr.Error's Code and Message methods to get detailed information about | ||
783 | // the error. | ||
784 | // | ||
785 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
786 | // API operation DeleteBucketLifecycle for usage and error information. | ||
787 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketLifecycle | ||
788 | func (c *S3) DeleteBucketLifecycle(input *DeleteBucketLifecycleInput) (*DeleteBucketLifecycleOutput, error) { | ||
789 | req, out := c.DeleteBucketLifecycleRequest(input) | ||
790 | return out, req.Send() | ||
791 | } | ||
792 | |||
793 | // DeleteBucketLifecycleWithContext is the same as DeleteBucketLifecycle with the addition of | ||
794 | // the ability to pass a context and additional request options. | ||
795 | // | ||
796 | // See DeleteBucketLifecycle for details on how to use this API operation. | ||
797 | // | ||
798 | // The context must be non-nil and will be used for request cancellation. If | ||
799 | // the context is nil a panic will occur. In the future the SDK may create | ||
800 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
801 | // for more information on using Contexts. | ||
802 | func (c *S3) DeleteBucketLifecycleWithContext(ctx aws.Context, input *DeleteBucketLifecycleInput, opts ...request.Option) (*DeleteBucketLifecycleOutput, error) { | ||
803 | req, out := c.DeleteBucketLifecycleRequest(input) | ||
804 | req.SetContext(ctx) | ||
805 | req.ApplyOptions(opts...) | ||
806 | return out, req.Send() | ||
807 | } | ||
808 | |||
809 | const opDeleteBucketMetricsConfiguration = "DeleteBucketMetricsConfiguration" | ||
810 | |||
811 | // DeleteBucketMetricsConfigurationRequest generates a "aws/request.Request" representing the | ||
812 | // client's request for the DeleteBucketMetricsConfiguration operation. The "output" return | ||
813 | // value can be used to capture response data after the request's "Send" method | ||
814 | // is called. | ||
815 | // | ||
816 | // See DeleteBucketMetricsConfiguration for usage and error information. | ||
817 | // | ||
818 | // Creating a request object using this method should be used when you want to inject | ||
819 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
820 | // access properties on the request object before or after sending the request. If | ||
821 | // you just want the service response, call the DeleteBucketMetricsConfiguration method directly | ||
822 | // instead. | ||
823 | // | ||
824 | // Note: You must call the "Send" method on the returned request object in order | ||
825 | // to execute the request. | ||
826 | // | ||
827 | // // Example sending a request using the DeleteBucketMetricsConfigurationRequest method. | ||
828 | // req, resp := client.DeleteBucketMetricsConfigurationRequest(params) | ||
829 | // | ||
830 | // err := req.Send() | ||
831 | // if err == nil { // resp is now filled | ||
832 | // fmt.Println(resp) | ||
833 | // } | ||
834 | // | ||
835 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketMetricsConfiguration | ||
836 | func (c *S3) DeleteBucketMetricsConfigurationRequest(input *DeleteBucketMetricsConfigurationInput) (req *request.Request, output *DeleteBucketMetricsConfigurationOutput) { | ||
837 | op := &request.Operation{ | ||
838 | Name: opDeleteBucketMetricsConfiguration, | ||
839 | HTTPMethod: "DELETE", | ||
840 | HTTPPath: "/{Bucket}?metrics", | ||
841 | } | ||
842 | |||
843 | if input == nil { | ||
844 | input = &DeleteBucketMetricsConfigurationInput{} | ||
845 | } | ||
846 | |||
847 | output = &DeleteBucketMetricsConfigurationOutput{} | ||
848 | req = c.newRequest(op, input, output) | ||
849 | req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) | ||
850 | req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) | ||
851 | return | ||
852 | } | ||
853 | |||
854 | // DeleteBucketMetricsConfiguration API operation for Amazon Simple Storage Service. | ||
855 | // | ||
856 | // Deletes a metrics configuration (specified by the metrics configuration ID) | ||
857 | // from the bucket. | ||
858 | // | ||
859 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
860 | // with awserr.Error's Code and Message methods to get detailed information about | ||
861 | // the error. | ||
862 | // | ||
863 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
864 | // API operation DeleteBucketMetricsConfiguration for usage and error information. | ||
865 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketMetricsConfiguration | ||
866 | func (c *S3) DeleteBucketMetricsConfiguration(input *DeleteBucketMetricsConfigurationInput) (*DeleteBucketMetricsConfigurationOutput, error) { | ||
867 | req, out := c.DeleteBucketMetricsConfigurationRequest(input) | ||
868 | return out, req.Send() | ||
869 | } | ||
870 | |||
871 | // DeleteBucketMetricsConfigurationWithContext is the same as DeleteBucketMetricsConfiguration with the addition of | ||
872 | // the ability to pass a context and additional request options. | ||
873 | // | ||
874 | // See DeleteBucketMetricsConfiguration for details on how to use this API operation. | ||
875 | // | ||
876 | // The context must be non-nil and will be used for request cancellation. If | ||
877 | // the context is nil a panic will occur. In the future the SDK may create | ||
878 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
879 | // for more information on using Contexts. | ||
880 | func (c *S3) DeleteBucketMetricsConfigurationWithContext(ctx aws.Context, input *DeleteBucketMetricsConfigurationInput, opts ...request.Option) (*DeleteBucketMetricsConfigurationOutput, error) { | ||
881 | req, out := c.DeleteBucketMetricsConfigurationRequest(input) | ||
882 | req.SetContext(ctx) | ||
883 | req.ApplyOptions(opts...) | ||
884 | return out, req.Send() | ||
885 | } | ||
886 | |||
887 | const opDeleteBucketPolicy = "DeleteBucketPolicy" | ||
888 | |||
889 | // DeleteBucketPolicyRequest generates a "aws/request.Request" representing the | ||
890 | // client's request for the DeleteBucketPolicy operation. The "output" return | ||
891 | // value can be used to capture response data after the request's "Send" method | ||
892 | // is called. | ||
893 | // | ||
894 | // See DeleteBucketPolicy for usage and error information. | ||
895 | // | ||
896 | // Creating a request object using this method should be used when you want to inject | ||
897 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
898 | // access properties on the request object before or after sending the request. If | ||
899 | // you just want the service response, call the DeleteBucketPolicy method directly | ||
900 | // instead. | ||
901 | // | ||
902 | // Note: You must call the "Send" method on the returned request object in order | ||
903 | // to execute the request. | ||
904 | // | ||
905 | // // Example sending a request using the DeleteBucketPolicyRequest method. | ||
906 | // req, resp := client.DeleteBucketPolicyRequest(params) | ||
907 | // | ||
908 | // err := req.Send() | ||
909 | // if err == nil { // resp is now filled | ||
910 | // fmt.Println(resp) | ||
911 | // } | ||
912 | // | ||
913 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketPolicy | ||
914 | func (c *S3) DeleteBucketPolicyRequest(input *DeleteBucketPolicyInput) (req *request.Request, output *DeleteBucketPolicyOutput) { | ||
915 | op := &request.Operation{ | ||
916 | Name: opDeleteBucketPolicy, | ||
917 | HTTPMethod: "DELETE", | ||
918 | HTTPPath: "/{Bucket}?policy", | ||
919 | } | ||
920 | |||
921 | if input == nil { | ||
922 | input = &DeleteBucketPolicyInput{} | ||
923 | } | ||
924 | |||
925 | output = &DeleteBucketPolicyOutput{} | ||
926 | req = c.newRequest(op, input, output) | ||
927 | req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) | ||
928 | req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) | ||
929 | return | ||
930 | } | ||
931 | |||
932 | // DeleteBucketPolicy API operation for Amazon Simple Storage Service. | ||
933 | // | ||
934 | // Deletes the policy from the bucket. | ||
935 | // | ||
936 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
937 | // with awserr.Error's Code and Message methods to get detailed information about | ||
938 | // the error. | ||
939 | // | ||
940 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
941 | // API operation DeleteBucketPolicy for usage and error information. | ||
942 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketPolicy | ||
943 | func (c *S3) DeleteBucketPolicy(input *DeleteBucketPolicyInput) (*DeleteBucketPolicyOutput, error) { | ||
944 | req, out := c.DeleteBucketPolicyRequest(input) | ||
945 | return out, req.Send() | ||
946 | } | ||
947 | |||
948 | // DeleteBucketPolicyWithContext is the same as DeleteBucketPolicy with the addition of | ||
949 | // the ability to pass a context and additional request options. | ||
950 | // | ||
951 | // See DeleteBucketPolicy for details on how to use this API operation. | ||
952 | // | ||
953 | // The context must be non-nil and will be used for request cancellation. If | ||
954 | // the context is nil a panic will occur. In the future the SDK may create | ||
955 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
956 | // for more information on using Contexts. | ||
957 | func (c *S3) DeleteBucketPolicyWithContext(ctx aws.Context, input *DeleteBucketPolicyInput, opts ...request.Option) (*DeleteBucketPolicyOutput, error) { | ||
958 | req, out := c.DeleteBucketPolicyRequest(input) | ||
959 | req.SetContext(ctx) | ||
960 | req.ApplyOptions(opts...) | ||
961 | return out, req.Send() | ||
962 | } | ||
963 | |||
964 | const opDeleteBucketReplication = "DeleteBucketReplication" | ||
965 | |||
966 | // DeleteBucketReplicationRequest generates a "aws/request.Request" representing the | ||
967 | // client's request for the DeleteBucketReplication operation. The "output" return | ||
968 | // value can be used to capture response data after the request's "Send" method | ||
969 | // is called. | ||
970 | // | ||
971 | // See DeleteBucketReplication for usage and error information. | ||
972 | // | ||
973 | // Creating a request object using this method should be used when you want to inject | ||
974 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
975 | // access properties on the request object before or after sending the request. If | ||
976 | // you just want the service response, call the DeleteBucketReplication method directly | ||
977 | // instead. | ||
978 | // | ||
979 | // Note: You must call the "Send" method on the returned request object in order | ||
980 | // to execute the request. | ||
981 | // | ||
982 | // // Example sending a request using the DeleteBucketReplicationRequest method. | ||
983 | // req, resp := client.DeleteBucketReplicationRequest(params) | ||
984 | // | ||
985 | // err := req.Send() | ||
986 | // if err == nil { // resp is now filled | ||
987 | // fmt.Println(resp) | ||
988 | // } | ||
989 | // | ||
990 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketReplication | ||
991 | func (c *S3) DeleteBucketReplicationRequest(input *DeleteBucketReplicationInput) (req *request.Request, output *DeleteBucketReplicationOutput) { | ||
992 | op := &request.Operation{ | ||
993 | Name: opDeleteBucketReplication, | ||
994 | HTTPMethod: "DELETE", | ||
995 | HTTPPath: "/{Bucket}?replication", | ||
996 | } | ||
997 | |||
998 | if input == nil { | ||
999 | input = &DeleteBucketReplicationInput{} | ||
1000 | } | ||
1001 | |||
1002 | output = &DeleteBucketReplicationOutput{} | ||
1003 | req = c.newRequest(op, input, output) | ||
1004 | req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) | ||
1005 | req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) | ||
1006 | return | ||
1007 | } | ||
1008 | |||
1009 | // DeleteBucketReplication API operation for Amazon Simple Storage Service. | ||
1010 | // | ||
1011 | // Deletes the replication configuration from the bucket. | ||
1012 | // | ||
1013 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
1014 | // with awserr.Error's Code and Message methods to get detailed information about | ||
1015 | // the error. | ||
1016 | // | ||
1017 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
1018 | // API operation DeleteBucketReplication for usage and error information. | ||
1019 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketReplication | ||
1020 | func (c *S3) DeleteBucketReplication(input *DeleteBucketReplicationInput) (*DeleteBucketReplicationOutput, error) { | ||
1021 | req, out := c.DeleteBucketReplicationRequest(input) | ||
1022 | return out, req.Send() | ||
1023 | } | ||
1024 | |||
1025 | // DeleteBucketReplicationWithContext is the same as DeleteBucketReplication with the addition of | ||
1026 | // the ability to pass a context and additional request options. | ||
1027 | // | ||
1028 | // See DeleteBucketReplication for details on how to use this API operation. | ||
1029 | // | ||
1030 | // The context must be non-nil and will be used for request cancellation. If | ||
1031 | // the context is nil a panic will occur. In the future the SDK may create | ||
1032 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
1033 | // for more information on using Contexts. | ||
1034 | func (c *S3) DeleteBucketReplicationWithContext(ctx aws.Context, input *DeleteBucketReplicationInput, opts ...request.Option) (*DeleteBucketReplicationOutput, error) { | ||
1035 | req, out := c.DeleteBucketReplicationRequest(input) | ||
1036 | req.SetContext(ctx) | ||
1037 | req.ApplyOptions(opts...) | ||
1038 | return out, req.Send() | ||
1039 | } | ||
1040 | |||
1041 | const opDeleteBucketTagging = "DeleteBucketTagging" | ||
1042 | |||
1043 | // DeleteBucketTaggingRequest generates a "aws/request.Request" representing the | ||
1044 | // client's request for the DeleteBucketTagging operation. The "output" return | ||
1045 | // value can be used to capture response data after the request's "Send" method | ||
1046 | // is called. | ||
1047 | // | ||
1048 | // See DeleteBucketTagging for usage and error information. | ||
1049 | // | ||
1050 | // Creating a request object using this method should be used when you want to inject | ||
1051 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
1052 | // access properties on the request object before or after sending the request. If | ||
1053 | // you just want the service response, call the DeleteBucketTagging method directly | ||
1054 | // instead. | ||
1055 | // | ||
1056 | // Note: You must call the "Send" method on the returned request object in order | ||
1057 | // to execute the request. | ||
1058 | // | ||
1059 | // // Example sending a request using the DeleteBucketTaggingRequest method. | ||
1060 | // req, resp := client.DeleteBucketTaggingRequest(params) | ||
1061 | // | ||
1062 | // err := req.Send() | ||
1063 | // if err == nil { // resp is now filled | ||
1064 | // fmt.Println(resp) | ||
1065 | // } | ||
1066 | // | ||
1067 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketTagging | ||
1068 | func (c *S3) DeleteBucketTaggingRequest(input *DeleteBucketTaggingInput) (req *request.Request, output *DeleteBucketTaggingOutput) { | ||
1069 | op := &request.Operation{ | ||
1070 | Name: opDeleteBucketTagging, | ||
1071 | HTTPMethod: "DELETE", | ||
1072 | HTTPPath: "/{Bucket}?tagging", | ||
1073 | } | ||
1074 | |||
1075 | if input == nil { | ||
1076 | input = &DeleteBucketTaggingInput{} | ||
1077 | } | ||
1078 | |||
1079 | output = &DeleteBucketTaggingOutput{} | ||
1080 | req = c.newRequest(op, input, output) | ||
1081 | req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) | ||
1082 | req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) | ||
1083 | return | ||
1084 | } | ||
1085 | |||
1086 | // DeleteBucketTagging API operation for Amazon Simple Storage Service. | ||
1087 | // | ||
1088 | // Deletes the tags from the bucket. | ||
1089 | // | ||
1090 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
1091 | // with awserr.Error's Code and Message methods to get detailed information about | ||
1092 | // the error. | ||
1093 | // | ||
1094 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
1095 | // API operation DeleteBucketTagging for usage and error information. | ||
1096 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketTagging | ||
1097 | func (c *S3) DeleteBucketTagging(input *DeleteBucketTaggingInput) (*DeleteBucketTaggingOutput, error) { | ||
1098 | req, out := c.DeleteBucketTaggingRequest(input) | ||
1099 | return out, req.Send() | ||
1100 | } | ||
1101 | |||
1102 | // DeleteBucketTaggingWithContext is the same as DeleteBucketTagging with the addition of | ||
1103 | // the ability to pass a context and additional request options. | ||
1104 | // | ||
1105 | // See DeleteBucketTagging for details on how to use this API operation. | ||
1106 | // | ||
1107 | // The context must be non-nil and will be used for request cancellation. If | ||
1108 | // the context is nil a panic will occur. In the future the SDK may create | ||
1109 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
1110 | // for more information on using Contexts. | ||
1111 | func (c *S3) DeleteBucketTaggingWithContext(ctx aws.Context, input *DeleteBucketTaggingInput, opts ...request.Option) (*DeleteBucketTaggingOutput, error) { | ||
1112 | req, out := c.DeleteBucketTaggingRequest(input) | ||
1113 | req.SetContext(ctx) | ||
1114 | req.ApplyOptions(opts...) | ||
1115 | return out, req.Send() | ||
1116 | } | ||
1117 | |||
1118 | const opDeleteBucketWebsite = "DeleteBucketWebsite" | ||
1119 | |||
1120 | // DeleteBucketWebsiteRequest generates a "aws/request.Request" representing the | ||
1121 | // client's request for the DeleteBucketWebsite operation. The "output" return | ||
1122 | // value can be used to capture response data after the request's "Send" method | ||
1123 | // is called. | ||
1124 | // | ||
1125 | // See DeleteBucketWebsite for usage and error information. | ||
1126 | // | ||
1127 | // Creating a request object using this method should be used when you want to inject | ||
1128 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
1129 | // access properties on the request object before or after sending the request. If | ||
1130 | // you just want the service response, call the DeleteBucketWebsite method directly | ||
1131 | // instead. | ||
1132 | // | ||
1133 | // Note: You must call the "Send" method on the returned request object in order | ||
1134 | // to execute the request. | ||
1135 | // | ||
1136 | // // Example sending a request using the DeleteBucketWebsiteRequest method. | ||
1137 | // req, resp := client.DeleteBucketWebsiteRequest(params) | ||
1138 | // | ||
1139 | // err := req.Send() | ||
1140 | // if err == nil { // resp is now filled | ||
1141 | // fmt.Println(resp) | ||
1142 | // } | ||
1143 | // | ||
1144 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketWebsite | ||
1145 | func (c *S3) DeleteBucketWebsiteRequest(input *DeleteBucketWebsiteInput) (req *request.Request, output *DeleteBucketWebsiteOutput) { | ||
1146 | op := &request.Operation{ | ||
1147 | Name: opDeleteBucketWebsite, | ||
1148 | HTTPMethod: "DELETE", | ||
1149 | HTTPPath: "/{Bucket}?website", | ||
1150 | } | ||
1151 | |||
1152 | if input == nil { | ||
1153 | input = &DeleteBucketWebsiteInput{} | ||
1154 | } | ||
1155 | |||
1156 | output = &DeleteBucketWebsiteOutput{} | ||
1157 | req = c.newRequest(op, input, output) | ||
1158 | req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) | ||
1159 | req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) | ||
1160 | return | ||
1161 | } | ||
1162 | |||
1163 | // DeleteBucketWebsite API operation for Amazon Simple Storage Service. | ||
1164 | // | ||
1165 | // This operation removes the website configuration from the bucket. | ||
1166 | // | ||
1167 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
1168 | // with awserr.Error's Code and Message methods to get detailed information about | ||
1169 | // the error. | ||
1170 | // | ||
1171 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
1172 | // API operation DeleteBucketWebsite for usage and error information. | ||
1173 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketWebsite | ||
1174 | func (c *S3) DeleteBucketWebsite(input *DeleteBucketWebsiteInput) (*DeleteBucketWebsiteOutput, error) { | ||
1175 | req, out := c.DeleteBucketWebsiteRequest(input) | ||
1176 | return out, req.Send() | ||
1177 | } | ||
1178 | |||
1179 | // DeleteBucketWebsiteWithContext is the same as DeleteBucketWebsite with the addition of | ||
1180 | // the ability to pass a context and additional request options. | ||
1181 | // | ||
1182 | // See DeleteBucketWebsite for details on how to use this API operation. | ||
1183 | // | ||
1184 | // The context must be non-nil and will be used for request cancellation. If | ||
1185 | // the context is nil a panic will occur. In the future the SDK may create | ||
1186 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
1187 | // for more information on using Contexts. | ||
1188 | func (c *S3) DeleteBucketWebsiteWithContext(ctx aws.Context, input *DeleteBucketWebsiteInput, opts ...request.Option) (*DeleteBucketWebsiteOutput, error) { | ||
1189 | req, out := c.DeleteBucketWebsiteRequest(input) | ||
1190 | req.SetContext(ctx) | ||
1191 | req.ApplyOptions(opts...) | ||
1192 | return out, req.Send() | ||
1193 | } | ||
1194 | |||
1195 | const opDeleteObject = "DeleteObject" | ||
1196 | |||
1197 | // DeleteObjectRequest generates a "aws/request.Request" representing the | ||
1198 | // client's request for the DeleteObject operation. The "output" return | ||
1199 | // value can be used to capture response data after the request's "Send" method | ||
1200 | // is called. | ||
1201 | // | ||
1202 | // See DeleteObject for usage and error information. | ||
1203 | // | ||
1204 | // Creating a request object using this method should be used when you want to inject | ||
1205 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
1206 | // access properties on the request object before or after sending the request. If | ||
1207 | // you just want the service response, call the DeleteObject method directly | ||
1208 | // instead. | ||
1209 | // | ||
1210 | // Note: You must call the "Send" method on the returned request object in order | ||
1211 | // to execute the request. | ||
1212 | // | ||
1213 | // // Example sending a request using the DeleteObjectRequest method. | ||
1214 | // req, resp := client.DeleteObjectRequest(params) | ||
1215 | // | ||
1216 | // err := req.Send() | ||
1217 | // if err == nil { // resp is now filled | ||
1218 | // fmt.Println(resp) | ||
1219 | // } | ||
1220 | // | ||
1221 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObject | ||
1222 | func (c *S3) DeleteObjectRequest(input *DeleteObjectInput) (req *request.Request, output *DeleteObjectOutput) { | ||
1223 | op := &request.Operation{ | ||
1224 | Name: opDeleteObject, | ||
1225 | HTTPMethod: "DELETE", | ||
1226 | HTTPPath: "/{Bucket}/{Key+}", | ||
1227 | } | ||
1228 | |||
1229 | if input == nil { | ||
1230 | input = &DeleteObjectInput{} | ||
1231 | } | ||
1232 | |||
1233 | output = &DeleteObjectOutput{} | ||
1234 | req = c.newRequest(op, input, output) | ||
1235 | return | ||
1236 | } | ||
1237 | |||
1238 | // DeleteObject API operation for Amazon Simple Storage Service. | ||
1239 | // | ||
1240 | // Removes the null version (if there is one) of an object and inserts a delete | ||
1241 | // marker, which becomes the latest version of the object. If there isn't a | ||
1242 | // null version, Amazon S3 does not remove any objects. | ||
1243 | // | ||
1244 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
1245 | // with awserr.Error's Code and Message methods to get detailed information about | ||
1246 | // the error. | ||
1247 | // | ||
1248 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
1249 | // API operation DeleteObject for usage and error information. | ||
1250 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObject | ||
1251 | func (c *S3) DeleteObject(input *DeleteObjectInput) (*DeleteObjectOutput, error) { | ||
1252 | req, out := c.DeleteObjectRequest(input) | ||
1253 | return out, req.Send() | ||
1254 | } | ||
1255 | |||
1256 | // DeleteObjectWithContext is the same as DeleteObject with the addition of | ||
1257 | // the ability to pass a context and additional request options. | ||
1258 | // | ||
1259 | // See DeleteObject for details on how to use this API operation. | ||
1260 | // | ||
1261 | // The context must be non-nil and will be used for request cancellation. If | ||
1262 | // the context is nil a panic will occur. In the future the SDK may create | ||
1263 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
1264 | // for more information on using Contexts. | ||
1265 | func (c *S3) DeleteObjectWithContext(ctx aws.Context, input *DeleteObjectInput, opts ...request.Option) (*DeleteObjectOutput, error) { | ||
1266 | req, out := c.DeleteObjectRequest(input) | ||
1267 | req.SetContext(ctx) | ||
1268 | req.ApplyOptions(opts...) | ||
1269 | return out, req.Send() | ||
1270 | } | ||
1271 | |||
1272 | const opDeleteObjectTagging = "DeleteObjectTagging" | ||
1273 | |||
1274 | // DeleteObjectTaggingRequest generates a "aws/request.Request" representing the | ||
1275 | // client's request for the DeleteObjectTagging operation. The "output" return | ||
1276 | // value can be used to capture response data after the request's "Send" method | ||
1277 | // is called. | ||
1278 | // | ||
1279 | // See DeleteObjectTagging for usage and error information. | ||
1280 | // | ||
1281 | // Creating a request object using this method should be used when you want to inject | ||
1282 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
1283 | // access properties on the request object before or after sending the request. If | ||
1284 | // you just want the service response, call the DeleteObjectTagging method directly | ||
1285 | // instead. | ||
1286 | // | ||
1287 | // Note: You must call the "Send" method on the returned request object in order | ||
1288 | // to execute the request. | ||
1289 | // | ||
1290 | // // Example sending a request using the DeleteObjectTaggingRequest method. | ||
1291 | // req, resp := client.DeleteObjectTaggingRequest(params) | ||
1292 | // | ||
1293 | // err := req.Send() | ||
1294 | // if err == nil { // resp is now filled | ||
1295 | // fmt.Println(resp) | ||
1296 | // } | ||
1297 | // | ||
1298 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjectTagging | ||
1299 | func (c *S3) DeleteObjectTaggingRequest(input *DeleteObjectTaggingInput) (req *request.Request, output *DeleteObjectTaggingOutput) { | ||
1300 | op := &request.Operation{ | ||
1301 | Name: opDeleteObjectTagging, | ||
1302 | HTTPMethod: "DELETE", | ||
1303 | HTTPPath: "/{Bucket}/{Key+}?tagging", | ||
1304 | } | ||
1305 | |||
1306 | if input == nil { | ||
1307 | input = &DeleteObjectTaggingInput{} | ||
1308 | } | ||
1309 | |||
1310 | output = &DeleteObjectTaggingOutput{} | ||
1311 | req = c.newRequest(op, input, output) | ||
1312 | return | ||
1313 | } | ||
1314 | |||
1315 | // DeleteObjectTagging API operation for Amazon Simple Storage Service. | ||
1316 | // | ||
1317 | // Removes the tag-set from an existing object. | ||
1318 | // | ||
1319 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
1320 | // with awserr.Error's Code and Message methods to get detailed information about | ||
1321 | // the error. | ||
1322 | // | ||
1323 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
1324 | // API operation DeleteObjectTagging for usage and error information. | ||
1325 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjectTagging | ||
1326 | func (c *S3) DeleteObjectTagging(input *DeleteObjectTaggingInput) (*DeleteObjectTaggingOutput, error) { | ||
1327 | req, out := c.DeleteObjectTaggingRequest(input) | ||
1328 | return out, req.Send() | ||
1329 | } | ||
1330 | |||
1331 | // DeleteObjectTaggingWithContext is the same as DeleteObjectTagging with the addition of | ||
1332 | // the ability to pass a context and additional request options. | ||
1333 | // | ||
1334 | // See DeleteObjectTagging for details on how to use this API operation. | ||
1335 | // | ||
1336 | // The context must be non-nil and will be used for request cancellation. If | ||
1337 | // the context is nil a panic will occur. In the future the SDK may create | ||
1338 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
1339 | // for more information on using Contexts. | ||
1340 | func (c *S3) DeleteObjectTaggingWithContext(ctx aws.Context, input *DeleteObjectTaggingInput, opts ...request.Option) (*DeleteObjectTaggingOutput, error) { | ||
1341 | req, out := c.DeleteObjectTaggingRequest(input) | ||
1342 | req.SetContext(ctx) | ||
1343 | req.ApplyOptions(opts...) | ||
1344 | return out, req.Send() | ||
1345 | } | ||
1346 | |||
1347 | const opDeleteObjects = "DeleteObjects" | ||
1348 | |||
1349 | // DeleteObjectsRequest generates a "aws/request.Request" representing the | ||
1350 | // client's request for the DeleteObjects operation. The "output" return | ||
1351 | // value can be used to capture response data after the request's "Send" method | ||
1352 | // is called. | ||
1353 | // | ||
1354 | // See DeleteObjects for usage and error information. | ||
1355 | // | ||
1356 | // Creating a request object using this method should be used when you want to inject | ||
1357 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
1358 | // access properties on the request object before or after sending the request. If | ||
1359 | // you just want the service response, call the DeleteObjects method directly | ||
1360 | // instead. | ||
1361 | // | ||
1362 | // Note: You must call the "Send" method on the returned request object in order | ||
1363 | // to execute the request. | ||
1364 | // | ||
1365 | // // Example sending a request using the DeleteObjectsRequest method. | ||
1366 | // req, resp := client.DeleteObjectsRequest(params) | ||
1367 | // | ||
1368 | // err := req.Send() | ||
1369 | // if err == nil { // resp is now filled | ||
1370 | // fmt.Println(resp) | ||
1371 | // } | ||
1372 | // | ||
1373 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjects | ||
1374 | func (c *S3) DeleteObjectsRequest(input *DeleteObjectsInput) (req *request.Request, output *DeleteObjectsOutput) { | ||
1375 | op := &request.Operation{ | ||
1376 | Name: opDeleteObjects, | ||
1377 | HTTPMethod: "POST", | ||
1378 | HTTPPath: "/{Bucket}?delete", | ||
1379 | } | ||
1380 | |||
1381 | if input == nil { | ||
1382 | input = &DeleteObjectsInput{} | ||
1383 | } | ||
1384 | |||
1385 | output = &DeleteObjectsOutput{} | ||
1386 | req = c.newRequest(op, input, output) | ||
1387 | return | ||
1388 | } | ||
1389 | |||
1390 | // DeleteObjects API operation for Amazon Simple Storage Service. | ||
1391 | // | ||
1392 | // This operation enables you to delete multiple objects from a bucket using | ||
1393 | // a single HTTP request. You may specify up to 1000 keys. | ||
1394 | // | ||
1395 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
1396 | // with awserr.Error's Code and Message methods to get detailed information about | ||
1397 | // the error. | ||
1398 | // | ||
1399 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
1400 | // API operation DeleteObjects for usage and error information. | ||
1401 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjects | ||
1402 | func (c *S3) DeleteObjects(input *DeleteObjectsInput) (*DeleteObjectsOutput, error) { | ||
1403 | req, out := c.DeleteObjectsRequest(input) | ||
1404 | return out, req.Send() | ||
1405 | } | ||
1406 | |||
1407 | // DeleteObjectsWithContext is the same as DeleteObjects with the addition of | ||
1408 | // the ability to pass a context and additional request options. | ||
1409 | // | ||
1410 | // See DeleteObjects for details on how to use this API operation. | ||
1411 | // | ||
1412 | // The context must be non-nil and will be used for request cancellation. If | ||
1413 | // the context is nil a panic will occur. In the future the SDK may create | ||
1414 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
1415 | // for more information on using Contexts. | ||
1416 | func (c *S3) DeleteObjectsWithContext(ctx aws.Context, input *DeleteObjectsInput, opts ...request.Option) (*DeleteObjectsOutput, error) { | ||
1417 | req, out := c.DeleteObjectsRequest(input) | ||
1418 | req.SetContext(ctx) | ||
1419 | req.ApplyOptions(opts...) | ||
1420 | return out, req.Send() | ||
1421 | } | ||
1422 | |||
1423 | const opGetBucketAccelerateConfiguration = "GetBucketAccelerateConfiguration" | ||
1424 | |||
1425 | // GetBucketAccelerateConfigurationRequest generates a "aws/request.Request" representing the | ||
1426 | // client's request for the GetBucketAccelerateConfiguration operation. The "output" return | ||
1427 | // value can be used to capture response data after the request's "Send" method | ||
1428 | // is called. | ||
1429 | // | ||
1430 | // See GetBucketAccelerateConfiguration for usage and error information. | ||
1431 | // | ||
1432 | // Creating a request object using this method should be used when you want to inject | ||
1433 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
1434 | // access properties on the request object before or after sending the request. If | ||
1435 | // you just want the service response, call the GetBucketAccelerateConfiguration method directly | ||
1436 | // instead. | ||
1437 | // | ||
1438 | // Note: You must call the "Send" method on the returned request object in order | ||
1439 | // to execute the request. | ||
1440 | // | ||
1441 | // // Example sending a request using the GetBucketAccelerateConfigurationRequest method. | ||
1442 | // req, resp := client.GetBucketAccelerateConfigurationRequest(params) | ||
1443 | // | ||
1444 | // err := req.Send() | ||
1445 | // if err == nil { // resp is now filled | ||
1446 | // fmt.Println(resp) | ||
1447 | // } | ||
1448 | // | ||
1449 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAccelerateConfiguration | ||
1450 | func (c *S3) GetBucketAccelerateConfigurationRequest(input *GetBucketAccelerateConfigurationInput) (req *request.Request, output *GetBucketAccelerateConfigurationOutput) { | ||
1451 | op := &request.Operation{ | ||
1452 | Name: opGetBucketAccelerateConfiguration, | ||
1453 | HTTPMethod: "GET", | ||
1454 | HTTPPath: "/{Bucket}?accelerate", | ||
1455 | } | ||
1456 | |||
1457 | if input == nil { | ||
1458 | input = &GetBucketAccelerateConfigurationInput{} | ||
1459 | } | ||
1460 | |||
1461 | output = &GetBucketAccelerateConfigurationOutput{} | ||
1462 | req = c.newRequest(op, input, output) | ||
1463 | return | ||
1464 | } | ||
1465 | |||
1466 | // GetBucketAccelerateConfiguration API operation for Amazon Simple Storage Service. | ||
1467 | // | ||
1468 | // Returns the accelerate configuration of a bucket. | ||
1469 | // | ||
1470 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
1471 | // with awserr.Error's Code and Message methods to get detailed information about | ||
1472 | // the error. | ||
1473 | // | ||
1474 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
1475 | // API operation GetBucketAccelerateConfiguration for usage and error information. | ||
1476 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAccelerateConfiguration | ||
1477 | func (c *S3) GetBucketAccelerateConfiguration(input *GetBucketAccelerateConfigurationInput) (*GetBucketAccelerateConfigurationOutput, error) { | ||
1478 | req, out := c.GetBucketAccelerateConfigurationRequest(input) | ||
1479 | return out, req.Send() | ||
1480 | } | ||
1481 | |||
1482 | // GetBucketAccelerateConfigurationWithContext is the same as GetBucketAccelerateConfiguration with the addition of | ||
1483 | // the ability to pass a context and additional request options. | ||
1484 | // | ||
1485 | // See GetBucketAccelerateConfiguration for details on how to use this API operation. | ||
1486 | // | ||
1487 | // The context must be non-nil and will be used for request cancellation. If | ||
1488 | // the context is nil a panic will occur. In the future the SDK may create | ||
1489 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
1490 | // for more information on using Contexts. | ||
1491 | func (c *S3) GetBucketAccelerateConfigurationWithContext(ctx aws.Context, input *GetBucketAccelerateConfigurationInput, opts ...request.Option) (*GetBucketAccelerateConfigurationOutput, error) { | ||
1492 | req, out := c.GetBucketAccelerateConfigurationRequest(input) | ||
1493 | req.SetContext(ctx) | ||
1494 | req.ApplyOptions(opts...) | ||
1495 | return out, req.Send() | ||
1496 | } | ||
1497 | |||
1498 | const opGetBucketAcl = "GetBucketAcl" | ||
1499 | |||
1500 | // GetBucketAclRequest generates a "aws/request.Request" representing the | ||
1501 | // client's request for the GetBucketAcl operation. The "output" return | ||
1502 | // value can be used to capture response data after the request's "Send" method | ||
1503 | // is called. | ||
1504 | // | ||
1505 | // See GetBucketAcl for usage and error information. | ||
1506 | // | ||
1507 | // Creating a request object using this method should be used when you want to inject | ||
1508 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
1509 | // access properties on the request object before or after sending the request. If | ||
1510 | // you just want the service response, call the GetBucketAcl method directly | ||
1511 | // instead. | ||
1512 | // | ||
1513 | // Note: You must call the "Send" method on the returned request object in order | ||
1514 | // to execute the request. | ||
1515 | // | ||
1516 | // // Example sending a request using the GetBucketAclRequest method. | ||
1517 | // req, resp := client.GetBucketAclRequest(params) | ||
1518 | // | ||
1519 | // err := req.Send() | ||
1520 | // if err == nil { // resp is now filled | ||
1521 | // fmt.Println(resp) | ||
1522 | // } | ||
1523 | // | ||
1524 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAcl | ||
1525 | func (c *S3) GetBucketAclRequest(input *GetBucketAclInput) (req *request.Request, output *GetBucketAclOutput) { | ||
1526 | op := &request.Operation{ | ||
1527 | Name: opGetBucketAcl, | ||
1528 | HTTPMethod: "GET", | ||
1529 | HTTPPath: "/{Bucket}?acl", | ||
1530 | } | ||
1531 | |||
1532 | if input == nil { | ||
1533 | input = &GetBucketAclInput{} | ||
1534 | } | ||
1535 | |||
1536 | output = &GetBucketAclOutput{} | ||
1537 | req = c.newRequest(op, input, output) | ||
1538 | return | ||
1539 | } | ||
1540 | |||
1541 | // GetBucketAcl API operation for Amazon Simple Storage Service. | ||
1542 | // | ||
1543 | // Gets the access control policy for the bucket. | ||
1544 | // | ||
1545 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
1546 | // with awserr.Error's Code and Message methods to get detailed information about | ||
1547 | // the error. | ||
1548 | // | ||
1549 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
1550 | // API operation GetBucketAcl for usage and error information. | ||
1551 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAcl | ||
1552 | func (c *S3) GetBucketAcl(input *GetBucketAclInput) (*GetBucketAclOutput, error) { | ||
1553 | req, out := c.GetBucketAclRequest(input) | ||
1554 | return out, req.Send() | ||
1555 | } | ||
1556 | |||
1557 | // GetBucketAclWithContext is the same as GetBucketAcl with the addition of | ||
1558 | // the ability to pass a context and additional request options. | ||
1559 | // | ||
1560 | // See GetBucketAcl for details on how to use this API operation. | ||
1561 | // | ||
1562 | // The context must be non-nil and will be used for request cancellation. If | ||
1563 | // the context is nil a panic will occur. In the future the SDK may create | ||
1564 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
1565 | // for more information on using Contexts. | ||
1566 | func (c *S3) GetBucketAclWithContext(ctx aws.Context, input *GetBucketAclInput, opts ...request.Option) (*GetBucketAclOutput, error) { | ||
1567 | req, out := c.GetBucketAclRequest(input) | ||
1568 | req.SetContext(ctx) | ||
1569 | req.ApplyOptions(opts...) | ||
1570 | return out, req.Send() | ||
1571 | } | ||
1572 | |||
1573 | const opGetBucketAnalyticsConfiguration = "GetBucketAnalyticsConfiguration" | ||
1574 | |||
1575 | // GetBucketAnalyticsConfigurationRequest generates a "aws/request.Request" representing the | ||
1576 | // client's request for the GetBucketAnalyticsConfiguration operation. The "output" return | ||
1577 | // value can be used to capture response data after the request's "Send" method | ||
1578 | // is called. | ||
1579 | // | ||
1580 | // See GetBucketAnalyticsConfiguration for usage and error information. | ||
1581 | // | ||
1582 | // Creating a request object using this method should be used when you want to inject | ||
1583 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
1584 | // access properties on the request object before or after sending the request. If | ||
1585 | // you just want the service response, call the GetBucketAnalyticsConfiguration method directly | ||
1586 | // instead. | ||
1587 | // | ||
1588 | // Note: You must call the "Send" method on the returned request object in order | ||
1589 | // to execute the request. | ||
1590 | // | ||
1591 | // // Example sending a request using the GetBucketAnalyticsConfigurationRequest method. | ||
1592 | // req, resp := client.GetBucketAnalyticsConfigurationRequest(params) | ||
1593 | // | ||
1594 | // err := req.Send() | ||
1595 | // if err == nil { // resp is now filled | ||
1596 | // fmt.Println(resp) | ||
1597 | // } | ||
1598 | // | ||
1599 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAnalyticsConfiguration | ||
1600 | func (c *S3) GetBucketAnalyticsConfigurationRequest(input *GetBucketAnalyticsConfigurationInput) (req *request.Request, output *GetBucketAnalyticsConfigurationOutput) { | ||
1601 | op := &request.Operation{ | ||
1602 | Name: opGetBucketAnalyticsConfiguration, | ||
1603 | HTTPMethod: "GET", | ||
1604 | HTTPPath: "/{Bucket}?analytics", | ||
1605 | } | ||
1606 | |||
1607 | if input == nil { | ||
1608 | input = &GetBucketAnalyticsConfigurationInput{} | ||
1609 | } | ||
1610 | |||
1611 | output = &GetBucketAnalyticsConfigurationOutput{} | ||
1612 | req = c.newRequest(op, input, output) | ||
1613 | return | ||
1614 | } | ||
1615 | |||
1616 | // GetBucketAnalyticsConfiguration API operation for Amazon Simple Storage Service. | ||
1617 | // | ||
1618 | // Gets an analytics configuration for the bucket (specified by the analytics | ||
1619 | // configuration ID). | ||
1620 | // | ||
1621 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
1622 | // with awserr.Error's Code and Message methods to get detailed information about | ||
1623 | // the error. | ||
1624 | // | ||
1625 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
1626 | // API operation GetBucketAnalyticsConfiguration for usage and error information. | ||
1627 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAnalyticsConfiguration | ||
1628 | func (c *S3) GetBucketAnalyticsConfiguration(input *GetBucketAnalyticsConfigurationInput) (*GetBucketAnalyticsConfigurationOutput, error) { | ||
1629 | req, out := c.GetBucketAnalyticsConfigurationRequest(input) | ||
1630 | return out, req.Send() | ||
1631 | } | ||
1632 | |||
1633 | // GetBucketAnalyticsConfigurationWithContext is the same as GetBucketAnalyticsConfiguration with the addition of | ||
1634 | // the ability to pass a context and additional request options. | ||
1635 | // | ||
1636 | // See GetBucketAnalyticsConfiguration for details on how to use this API operation. | ||
1637 | // | ||
1638 | // The context must be non-nil and will be used for request cancellation. If | ||
1639 | // the context is nil a panic will occur. In the future the SDK may create | ||
1640 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
1641 | // for more information on using Contexts. | ||
1642 | func (c *S3) GetBucketAnalyticsConfigurationWithContext(ctx aws.Context, input *GetBucketAnalyticsConfigurationInput, opts ...request.Option) (*GetBucketAnalyticsConfigurationOutput, error) { | ||
1643 | req, out := c.GetBucketAnalyticsConfigurationRequest(input) | ||
1644 | req.SetContext(ctx) | ||
1645 | req.ApplyOptions(opts...) | ||
1646 | return out, req.Send() | ||
1647 | } | ||
1648 | |||
1649 | const opGetBucketCors = "GetBucketCors" | ||
1650 | |||
1651 | // GetBucketCorsRequest generates a "aws/request.Request" representing the | ||
1652 | // client's request for the GetBucketCors operation. The "output" return | ||
1653 | // value can be used to capture response data after the request's "Send" method | ||
1654 | // is called. | ||
1655 | // | ||
1656 | // See GetBucketCors for usage and error information. | ||
1657 | // | ||
1658 | // Creating a request object using this method should be used when you want to inject | ||
1659 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
1660 | // access properties on the request object before or after sending the request. If | ||
1661 | // you just want the service response, call the GetBucketCors method directly | ||
1662 | // instead. | ||
1663 | // | ||
1664 | // Note: You must call the "Send" method on the returned request object in order | ||
1665 | // to execute the request. | ||
1666 | // | ||
1667 | // // Example sending a request using the GetBucketCorsRequest method. | ||
1668 | // req, resp := client.GetBucketCorsRequest(params) | ||
1669 | // | ||
1670 | // err := req.Send() | ||
1671 | // if err == nil { // resp is now filled | ||
1672 | // fmt.Println(resp) | ||
1673 | // } | ||
1674 | // | ||
1675 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketCors | ||
1676 | func (c *S3) GetBucketCorsRequest(input *GetBucketCorsInput) (req *request.Request, output *GetBucketCorsOutput) { | ||
1677 | op := &request.Operation{ | ||
1678 | Name: opGetBucketCors, | ||
1679 | HTTPMethod: "GET", | ||
1680 | HTTPPath: "/{Bucket}?cors", | ||
1681 | } | ||
1682 | |||
1683 | if input == nil { | ||
1684 | input = &GetBucketCorsInput{} | ||
1685 | } | ||
1686 | |||
1687 | output = &GetBucketCorsOutput{} | ||
1688 | req = c.newRequest(op, input, output) | ||
1689 | return | ||
1690 | } | ||
1691 | |||
1692 | // GetBucketCors API operation for Amazon Simple Storage Service. | ||
1693 | // | ||
1694 | // Returns the cors configuration for the bucket. | ||
1695 | // | ||
1696 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
1697 | // with awserr.Error's Code and Message methods to get detailed information about | ||
1698 | // the error. | ||
1699 | // | ||
1700 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
1701 | // API operation GetBucketCors for usage and error information. | ||
1702 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketCors | ||
1703 | func (c *S3) GetBucketCors(input *GetBucketCorsInput) (*GetBucketCorsOutput, error) { | ||
1704 | req, out := c.GetBucketCorsRequest(input) | ||
1705 | return out, req.Send() | ||
1706 | } | ||
1707 | |||
1708 | // GetBucketCorsWithContext is the same as GetBucketCors with the addition of | ||
1709 | // the ability to pass a context and additional request options. | ||
1710 | // | ||
1711 | // See GetBucketCors for details on how to use this API operation. | ||
1712 | // | ||
1713 | // The context must be non-nil and will be used for request cancellation. If | ||
1714 | // the context is nil a panic will occur. In the future the SDK may create | ||
1715 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
1716 | // for more information on using Contexts. | ||
1717 | func (c *S3) GetBucketCorsWithContext(ctx aws.Context, input *GetBucketCorsInput, opts ...request.Option) (*GetBucketCorsOutput, error) { | ||
1718 | req, out := c.GetBucketCorsRequest(input) | ||
1719 | req.SetContext(ctx) | ||
1720 | req.ApplyOptions(opts...) | ||
1721 | return out, req.Send() | ||
1722 | } | ||
1723 | |||
1724 | const opGetBucketInventoryConfiguration = "GetBucketInventoryConfiguration" | ||
1725 | |||
1726 | // GetBucketInventoryConfigurationRequest generates a "aws/request.Request" representing the | ||
1727 | // client's request for the GetBucketInventoryConfiguration operation. The "output" return | ||
1728 | // value can be used to capture response data after the request's "Send" method | ||
1729 | // is called. | ||
1730 | // | ||
1731 | // See GetBucketInventoryConfiguration for usage and error information. | ||
1732 | // | ||
1733 | // Creating a request object using this method should be used when you want to inject | ||
1734 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
1735 | // access properties on the request object before or after sending the request. If | ||
1736 | // you just want the service response, call the GetBucketInventoryConfiguration method directly | ||
1737 | // instead. | ||
1738 | // | ||
1739 | // Note: You must call the "Send" method on the returned request object in order | ||
1740 | // to execute the request. | ||
1741 | // | ||
1742 | // // Example sending a request using the GetBucketInventoryConfigurationRequest method. | ||
1743 | // req, resp := client.GetBucketInventoryConfigurationRequest(params) | ||
1744 | // | ||
1745 | // err := req.Send() | ||
1746 | // if err == nil { // resp is now filled | ||
1747 | // fmt.Println(resp) | ||
1748 | // } | ||
1749 | // | ||
1750 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketInventoryConfiguration | ||
1751 | func (c *S3) GetBucketInventoryConfigurationRequest(input *GetBucketInventoryConfigurationInput) (req *request.Request, output *GetBucketInventoryConfigurationOutput) { | ||
1752 | op := &request.Operation{ | ||
1753 | Name: opGetBucketInventoryConfiguration, | ||
1754 | HTTPMethod: "GET", | ||
1755 | HTTPPath: "/{Bucket}?inventory", | ||
1756 | } | ||
1757 | |||
1758 | if input == nil { | ||
1759 | input = &GetBucketInventoryConfigurationInput{} | ||
1760 | } | ||
1761 | |||
1762 | output = &GetBucketInventoryConfigurationOutput{} | ||
1763 | req = c.newRequest(op, input, output) | ||
1764 | return | ||
1765 | } | ||
1766 | |||
1767 | // GetBucketInventoryConfiguration API operation for Amazon Simple Storage Service. | ||
1768 | // | ||
1769 | // Returns an inventory configuration (identified by the inventory ID) from | ||
1770 | // the bucket. | ||
1771 | // | ||
1772 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
1773 | // with awserr.Error's Code and Message methods to get detailed information about | ||
1774 | // the error. | ||
1775 | // | ||
1776 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
1777 | // API operation GetBucketInventoryConfiguration for usage and error information. | ||
1778 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketInventoryConfiguration | ||
1779 | func (c *S3) GetBucketInventoryConfiguration(input *GetBucketInventoryConfigurationInput) (*GetBucketInventoryConfigurationOutput, error) { | ||
1780 | req, out := c.GetBucketInventoryConfigurationRequest(input) | ||
1781 | return out, req.Send() | ||
1782 | } | ||
1783 | |||
1784 | // GetBucketInventoryConfigurationWithContext is the same as GetBucketInventoryConfiguration with the addition of | ||
1785 | // the ability to pass a context and additional request options. | ||
1786 | // | ||
1787 | // See GetBucketInventoryConfiguration for details on how to use this API operation. | ||
1788 | // | ||
1789 | // The context must be non-nil and will be used for request cancellation. If | ||
1790 | // the context is nil a panic will occur. In the future the SDK may create | ||
1791 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
1792 | // for more information on using Contexts. | ||
1793 | func (c *S3) GetBucketInventoryConfigurationWithContext(ctx aws.Context, input *GetBucketInventoryConfigurationInput, opts ...request.Option) (*GetBucketInventoryConfigurationOutput, error) { | ||
1794 | req, out := c.GetBucketInventoryConfigurationRequest(input) | ||
1795 | req.SetContext(ctx) | ||
1796 | req.ApplyOptions(opts...) | ||
1797 | return out, req.Send() | ||
1798 | } | ||
1799 | |||
1800 | const opGetBucketLifecycle = "GetBucketLifecycle" | ||
1801 | |||
1802 | // GetBucketLifecycleRequest generates a "aws/request.Request" representing the | ||
1803 | // client's request for the GetBucketLifecycle operation. The "output" return | ||
1804 | // value can be used to capture response data after the request's "Send" method | ||
1805 | // is called. | ||
1806 | // | ||
1807 | // See GetBucketLifecycle for usage and error information. | ||
1808 | // | ||
1809 | // Creating a request object using this method should be used when you want to inject | ||
1810 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
1811 | // access properties on the request object before or after sending the request. If | ||
1812 | // you just want the service response, call the GetBucketLifecycle method directly | ||
1813 | // instead. | ||
1814 | // | ||
1815 | // Note: You must call the "Send" method on the returned request object in order | ||
1816 | // to execute the request. | ||
1817 | // | ||
1818 | // // Example sending a request using the GetBucketLifecycleRequest method. | ||
1819 | // req, resp := client.GetBucketLifecycleRequest(params) | ||
1820 | // | ||
1821 | // err := req.Send() | ||
1822 | // if err == nil { // resp is now filled | ||
1823 | // fmt.Println(resp) | ||
1824 | // } | ||
1825 | // | ||
1826 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLifecycle | ||
1827 | func (c *S3) GetBucketLifecycleRequest(input *GetBucketLifecycleInput) (req *request.Request, output *GetBucketLifecycleOutput) { | ||
1828 | if c.Client.Config.Logger != nil { | ||
1829 | c.Client.Config.Logger.Log("This operation, GetBucketLifecycle, has been deprecated") | ||
1830 | } | ||
1831 | op := &request.Operation{ | ||
1832 | Name: opGetBucketLifecycle, | ||
1833 | HTTPMethod: "GET", | ||
1834 | HTTPPath: "/{Bucket}?lifecycle", | ||
1835 | } | ||
1836 | |||
1837 | if input == nil { | ||
1838 | input = &GetBucketLifecycleInput{} | ||
1839 | } | ||
1840 | |||
1841 | output = &GetBucketLifecycleOutput{} | ||
1842 | req = c.newRequest(op, input, output) | ||
1843 | return | ||
1844 | } | ||
1845 | |||
1846 | // GetBucketLifecycle API operation for Amazon Simple Storage Service. | ||
1847 | // | ||
1848 | // Deprecated, see the GetBucketLifecycleConfiguration operation. | ||
1849 | // | ||
1850 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
1851 | // with awserr.Error's Code and Message methods to get detailed information about | ||
1852 | // the error. | ||
1853 | // | ||
1854 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
1855 | // API operation GetBucketLifecycle for usage and error information. | ||
1856 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLifecycle | ||
1857 | func (c *S3) GetBucketLifecycle(input *GetBucketLifecycleInput) (*GetBucketLifecycleOutput, error) { | ||
1858 | req, out := c.GetBucketLifecycleRequest(input) | ||
1859 | return out, req.Send() | ||
1860 | } | ||
1861 | |||
1862 | // GetBucketLifecycleWithContext is the same as GetBucketLifecycle with the addition of | ||
1863 | // the ability to pass a context and additional request options. | ||
1864 | // | ||
1865 | // See GetBucketLifecycle for details on how to use this API operation. | ||
1866 | // | ||
1867 | // The context must be non-nil and will be used for request cancellation. If | ||
1868 | // the context is nil a panic will occur. In the future the SDK may create | ||
1869 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
1870 | // for more information on using Contexts. | ||
1871 | func (c *S3) GetBucketLifecycleWithContext(ctx aws.Context, input *GetBucketLifecycleInput, opts ...request.Option) (*GetBucketLifecycleOutput, error) { | ||
1872 | req, out := c.GetBucketLifecycleRequest(input) | ||
1873 | req.SetContext(ctx) | ||
1874 | req.ApplyOptions(opts...) | ||
1875 | return out, req.Send() | ||
1876 | } | ||
1877 | |||
1878 | const opGetBucketLifecycleConfiguration = "GetBucketLifecycleConfiguration" | ||
1879 | |||
1880 | // GetBucketLifecycleConfigurationRequest generates a "aws/request.Request" representing the | ||
1881 | // client's request for the GetBucketLifecycleConfiguration operation. The "output" return | ||
1882 | // value can be used to capture response data after the request's "Send" method | ||
1883 | // is called. | ||
1884 | // | ||
1885 | // See GetBucketLifecycleConfiguration for usage and error information. | ||
1886 | // | ||
1887 | // Creating a request object using this method should be used when you want to inject | ||
1888 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
1889 | // access properties on the request object before or after sending the request. If | ||
1890 | // you just want the service response, call the GetBucketLifecycleConfiguration method directly | ||
1891 | // instead. | ||
1892 | // | ||
1893 | // Note: You must call the "Send" method on the returned request object in order | ||
1894 | // to execute the request. | ||
1895 | // | ||
1896 | // // Example sending a request using the GetBucketLifecycleConfigurationRequest method. | ||
1897 | // req, resp := client.GetBucketLifecycleConfigurationRequest(params) | ||
1898 | // | ||
1899 | // err := req.Send() | ||
1900 | // if err == nil { // resp is now filled | ||
1901 | // fmt.Println(resp) | ||
1902 | // } | ||
1903 | // | ||
1904 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLifecycleConfiguration | ||
1905 | func (c *S3) GetBucketLifecycleConfigurationRequest(input *GetBucketLifecycleConfigurationInput) (req *request.Request, output *GetBucketLifecycleConfigurationOutput) { | ||
1906 | op := &request.Operation{ | ||
1907 | Name: opGetBucketLifecycleConfiguration, | ||
1908 | HTTPMethod: "GET", | ||
1909 | HTTPPath: "/{Bucket}?lifecycle", | ||
1910 | } | ||
1911 | |||
1912 | if input == nil { | ||
1913 | input = &GetBucketLifecycleConfigurationInput{} | ||
1914 | } | ||
1915 | |||
1916 | output = &GetBucketLifecycleConfigurationOutput{} | ||
1917 | req = c.newRequest(op, input, output) | ||
1918 | return | ||
1919 | } | ||
1920 | |||
1921 | // GetBucketLifecycleConfiguration API operation for Amazon Simple Storage Service. | ||
1922 | // | ||
1923 | // Returns the lifecycle configuration information set on the bucket. | ||
1924 | // | ||
1925 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
1926 | // with awserr.Error's Code and Message methods to get detailed information about | ||
1927 | // the error. | ||
1928 | // | ||
1929 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
1930 | // API operation GetBucketLifecycleConfiguration for usage and error information. | ||
1931 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLifecycleConfiguration | ||
1932 | func (c *S3) GetBucketLifecycleConfiguration(input *GetBucketLifecycleConfigurationInput) (*GetBucketLifecycleConfigurationOutput, error) { | ||
1933 | req, out := c.GetBucketLifecycleConfigurationRequest(input) | ||
1934 | return out, req.Send() | ||
1935 | } | ||
1936 | |||
1937 | // GetBucketLifecycleConfigurationWithContext is the same as GetBucketLifecycleConfiguration with the addition of | ||
1938 | // the ability to pass a context and additional request options. | ||
1939 | // | ||
1940 | // See GetBucketLifecycleConfiguration for details on how to use this API operation. | ||
1941 | // | ||
1942 | // The context must be non-nil and will be used for request cancellation. If | ||
1943 | // the context is nil a panic will occur. In the future the SDK may create | ||
1944 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
1945 | // for more information on using Contexts. | ||
1946 | func (c *S3) GetBucketLifecycleConfigurationWithContext(ctx aws.Context, input *GetBucketLifecycleConfigurationInput, opts ...request.Option) (*GetBucketLifecycleConfigurationOutput, error) { | ||
1947 | req, out := c.GetBucketLifecycleConfigurationRequest(input) | ||
1948 | req.SetContext(ctx) | ||
1949 | req.ApplyOptions(opts...) | ||
1950 | return out, req.Send() | ||
1951 | } | ||
1952 | |||
1953 | const opGetBucketLocation = "GetBucketLocation" | ||
1954 | |||
1955 | // GetBucketLocationRequest generates a "aws/request.Request" representing the | ||
1956 | // client's request for the GetBucketLocation operation. The "output" return | ||
1957 | // value can be used to capture response data after the request's "Send" method | ||
1958 | // is called. | ||
1959 | // | ||
1960 | // See GetBucketLocation for usage and error information. | ||
1961 | // | ||
1962 | // Creating a request object using this method should be used when you want to inject | ||
1963 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
1964 | // access properties on the request object before or after sending the request. If | ||
1965 | // you just want the service response, call the GetBucketLocation method directly | ||
1966 | // instead. | ||
1967 | // | ||
1968 | // Note: You must call the "Send" method on the returned request object in order | ||
1969 | // to execute the request. | ||
1970 | // | ||
1971 | // // Example sending a request using the GetBucketLocationRequest method. | ||
1972 | // req, resp := client.GetBucketLocationRequest(params) | ||
1973 | // | ||
1974 | // err := req.Send() | ||
1975 | // if err == nil { // resp is now filled | ||
1976 | // fmt.Println(resp) | ||
1977 | // } | ||
1978 | // | ||
1979 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLocation | ||
1980 | func (c *S3) GetBucketLocationRequest(input *GetBucketLocationInput) (req *request.Request, output *GetBucketLocationOutput) { | ||
1981 | op := &request.Operation{ | ||
1982 | Name: opGetBucketLocation, | ||
1983 | HTTPMethod: "GET", | ||
1984 | HTTPPath: "/{Bucket}?location", | ||
1985 | } | ||
1986 | |||
1987 | if input == nil { | ||
1988 | input = &GetBucketLocationInput{} | ||
1989 | } | ||
1990 | |||
1991 | output = &GetBucketLocationOutput{} | ||
1992 | req = c.newRequest(op, input, output) | ||
1993 | return | ||
1994 | } | ||
1995 | |||
1996 | // GetBucketLocation API operation for Amazon Simple Storage Service. | ||
1997 | // | ||
1998 | // Returns the region the bucket resides in. | ||
1999 | // | ||
2000 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
2001 | // with awserr.Error's Code and Message methods to get detailed information about | ||
2002 | // the error. | ||
2003 | // | ||
2004 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
2005 | // API operation GetBucketLocation for usage and error information. | ||
2006 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLocation | ||
2007 | func (c *S3) GetBucketLocation(input *GetBucketLocationInput) (*GetBucketLocationOutput, error) { | ||
2008 | req, out := c.GetBucketLocationRequest(input) | ||
2009 | return out, req.Send() | ||
2010 | } | ||
2011 | |||
2012 | // GetBucketLocationWithContext is the same as GetBucketLocation with the addition of | ||
2013 | // the ability to pass a context and additional request options. | ||
2014 | // | ||
2015 | // See GetBucketLocation for details on how to use this API operation. | ||
2016 | // | ||
2017 | // The context must be non-nil and will be used for request cancellation. If | ||
2018 | // the context is nil a panic will occur. In the future the SDK may create | ||
2019 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
2020 | // for more information on using Contexts. | ||
2021 | func (c *S3) GetBucketLocationWithContext(ctx aws.Context, input *GetBucketLocationInput, opts ...request.Option) (*GetBucketLocationOutput, error) { | ||
2022 | req, out := c.GetBucketLocationRequest(input) | ||
2023 | req.SetContext(ctx) | ||
2024 | req.ApplyOptions(opts...) | ||
2025 | return out, req.Send() | ||
2026 | } | ||
2027 | |||
2028 | const opGetBucketLogging = "GetBucketLogging" | ||
2029 | |||
2030 | // GetBucketLoggingRequest generates a "aws/request.Request" representing the | ||
2031 | // client's request for the GetBucketLogging operation. The "output" return | ||
2032 | // value can be used to capture response data after the request's "Send" method | ||
2033 | // is called. | ||
2034 | // | ||
2035 | // See GetBucketLogging for usage and error information. | ||
2036 | // | ||
2037 | // Creating a request object using this method should be used when you want to inject | ||
2038 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
2039 | // access properties on the request object before or after sending the request. If | ||
2040 | // you just want the service response, call the GetBucketLogging method directly | ||
2041 | // instead. | ||
2042 | // | ||
2043 | // Note: You must call the "Send" method on the returned request object in order | ||
2044 | // to execute the request. | ||
2045 | // | ||
2046 | // // Example sending a request using the GetBucketLoggingRequest method. | ||
2047 | // req, resp := client.GetBucketLoggingRequest(params) | ||
2048 | // | ||
2049 | // err := req.Send() | ||
2050 | // if err == nil { // resp is now filled | ||
2051 | // fmt.Println(resp) | ||
2052 | // } | ||
2053 | // | ||
2054 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLogging | ||
2055 | func (c *S3) GetBucketLoggingRequest(input *GetBucketLoggingInput) (req *request.Request, output *GetBucketLoggingOutput) { | ||
2056 | op := &request.Operation{ | ||
2057 | Name: opGetBucketLogging, | ||
2058 | HTTPMethod: "GET", | ||
2059 | HTTPPath: "/{Bucket}?logging", | ||
2060 | } | ||
2061 | |||
2062 | if input == nil { | ||
2063 | input = &GetBucketLoggingInput{} | ||
2064 | } | ||
2065 | |||
2066 | output = &GetBucketLoggingOutput{} | ||
2067 | req = c.newRequest(op, input, output) | ||
2068 | return | ||
2069 | } | ||
2070 | |||
2071 | // GetBucketLogging API operation for Amazon Simple Storage Service. | ||
2072 | // | ||
2073 | // Returns the logging status of a bucket and the permissions users have to | ||
2074 | // view and modify that status. To use GET, you must be the bucket owner. | ||
2075 | // | ||
2076 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
2077 | // with awserr.Error's Code and Message methods to get detailed information about | ||
2078 | // the error. | ||
2079 | // | ||
2080 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
2081 | // API operation GetBucketLogging for usage and error information. | ||
2082 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLogging | ||
2083 | func (c *S3) GetBucketLogging(input *GetBucketLoggingInput) (*GetBucketLoggingOutput, error) { | ||
2084 | req, out := c.GetBucketLoggingRequest(input) | ||
2085 | return out, req.Send() | ||
2086 | } | ||
2087 | |||
2088 | // GetBucketLoggingWithContext is the same as GetBucketLogging with the addition of | ||
2089 | // the ability to pass a context and additional request options. | ||
2090 | // | ||
2091 | // See GetBucketLogging for details on how to use this API operation. | ||
2092 | // | ||
2093 | // The context must be non-nil and will be used for request cancellation. If | ||
2094 | // the context is nil a panic will occur. In the future the SDK may create | ||
2095 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
2096 | // for more information on using Contexts. | ||
2097 | func (c *S3) GetBucketLoggingWithContext(ctx aws.Context, input *GetBucketLoggingInput, opts ...request.Option) (*GetBucketLoggingOutput, error) { | ||
2098 | req, out := c.GetBucketLoggingRequest(input) | ||
2099 | req.SetContext(ctx) | ||
2100 | req.ApplyOptions(opts...) | ||
2101 | return out, req.Send() | ||
2102 | } | ||
2103 | |||
2104 | const opGetBucketMetricsConfiguration = "GetBucketMetricsConfiguration" | ||
2105 | |||
2106 | // GetBucketMetricsConfigurationRequest generates a "aws/request.Request" representing the | ||
2107 | // client's request for the GetBucketMetricsConfiguration operation. The "output" return | ||
2108 | // value can be used to capture response data after the request's "Send" method | ||
2109 | // is called. | ||
2110 | // | ||
2111 | // See GetBucketMetricsConfiguration for usage and error information. | ||
2112 | // | ||
2113 | // Creating a request object using this method should be used when you want to inject | ||
2114 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
2115 | // access properties on the request object before or after sending the request. If | ||
2116 | // you just want the service response, call the GetBucketMetricsConfiguration method directly | ||
2117 | // instead. | ||
2118 | // | ||
2119 | // Note: You must call the "Send" method on the returned request object in order | ||
2120 | // to execute the request. | ||
2121 | // | ||
2122 | // // Example sending a request using the GetBucketMetricsConfigurationRequest method. | ||
2123 | // req, resp := client.GetBucketMetricsConfigurationRequest(params) | ||
2124 | // | ||
2125 | // err := req.Send() | ||
2126 | // if err == nil { // resp is now filled | ||
2127 | // fmt.Println(resp) | ||
2128 | // } | ||
2129 | // | ||
2130 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketMetricsConfiguration | ||
2131 | func (c *S3) GetBucketMetricsConfigurationRequest(input *GetBucketMetricsConfigurationInput) (req *request.Request, output *GetBucketMetricsConfigurationOutput) { | ||
2132 | op := &request.Operation{ | ||
2133 | Name: opGetBucketMetricsConfiguration, | ||
2134 | HTTPMethod: "GET", | ||
2135 | HTTPPath: "/{Bucket}?metrics", | ||
2136 | } | ||
2137 | |||
2138 | if input == nil { | ||
2139 | input = &GetBucketMetricsConfigurationInput{} | ||
2140 | } | ||
2141 | |||
2142 | output = &GetBucketMetricsConfigurationOutput{} | ||
2143 | req = c.newRequest(op, input, output) | ||
2144 | return | ||
2145 | } | ||
2146 | |||
2147 | // GetBucketMetricsConfiguration API operation for Amazon Simple Storage Service. | ||
2148 | // | ||
2149 | // Gets a metrics configuration (specified by the metrics configuration ID) | ||
2150 | // from the bucket. | ||
2151 | // | ||
2152 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
2153 | // with awserr.Error's Code and Message methods to get detailed information about | ||
2154 | // the error. | ||
2155 | // | ||
2156 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
2157 | // API operation GetBucketMetricsConfiguration for usage and error information. | ||
2158 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketMetricsConfiguration | ||
2159 | func (c *S3) GetBucketMetricsConfiguration(input *GetBucketMetricsConfigurationInput) (*GetBucketMetricsConfigurationOutput, error) { | ||
2160 | req, out := c.GetBucketMetricsConfigurationRequest(input) | ||
2161 | return out, req.Send() | ||
2162 | } | ||
2163 | |||
2164 | // GetBucketMetricsConfigurationWithContext is the same as GetBucketMetricsConfiguration with the addition of | ||
2165 | // the ability to pass a context and additional request options. | ||
2166 | // | ||
2167 | // See GetBucketMetricsConfiguration for details on how to use this API operation. | ||
2168 | // | ||
2169 | // The context must be non-nil and will be used for request cancellation. If | ||
2170 | // the context is nil a panic will occur. In the future the SDK may create | ||
2171 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
2172 | // for more information on using Contexts. | ||
2173 | func (c *S3) GetBucketMetricsConfigurationWithContext(ctx aws.Context, input *GetBucketMetricsConfigurationInput, opts ...request.Option) (*GetBucketMetricsConfigurationOutput, error) { | ||
2174 | req, out := c.GetBucketMetricsConfigurationRequest(input) | ||
2175 | req.SetContext(ctx) | ||
2176 | req.ApplyOptions(opts...) | ||
2177 | return out, req.Send() | ||
2178 | } | ||
2179 | |||
2180 | const opGetBucketNotification = "GetBucketNotification" | ||
2181 | |||
2182 | // GetBucketNotificationRequest generates a "aws/request.Request" representing the | ||
2183 | // client's request for the GetBucketNotification operation. The "output" return | ||
2184 | // value can be used to capture response data after the request's "Send" method | ||
2185 | // is called. | ||
2186 | // | ||
2187 | // See GetBucketNotification for usage and error information. | ||
2188 | // | ||
2189 | // Creating a request object using this method should be used when you want to inject | ||
2190 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
2191 | // access properties on the request object before or after sending the request. If | ||
2192 | // you just want the service response, call the GetBucketNotification method directly | ||
2193 | // instead. | ||
2194 | // | ||
2195 | // Note: You must call the "Send" method on the returned request object in order | ||
2196 | // to execute the request. | ||
2197 | // | ||
2198 | // // Example sending a request using the GetBucketNotificationRequest method. | ||
2199 | // req, resp := client.GetBucketNotificationRequest(params) | ||
2200 | // | ||
2201 | // err := req.Send() | ||
2202 | // if err == nil { // resp is now filled | ||
2203 | // fmt.Println(resp) | ||
2204 | // } | ||
2205 | // | ||
2206 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketNotification | ||
2207 | func (c *S3) GetBucketNotificationRequest(input *GetBucketNotificationConfigurationRequest) (req *request.Request, output *NotificationConfigurationDeprecated) { | ||
2208 | if c.Client.Config.Logger != nil { | ||
2209 | c.Client.Config.Logger.Log("This operation, GetBucketNotification, has been deprecated") | ||
2210 | } | ||
2211 | op := &request.Operation{ | ||
2212 | Name: opGetBucketNotification, | ||
2213 | HTTPMethod: "GET", | ||
2214 | HTTPPath: "/{Bucket}?notification", | ||
2215 | } | ||
2216 | |||
2217 | if input == nil { | ||
2218 | input = &GetBucketNotificationConfigurationRequest{} | ||
2219 | } | ||
2220 | |||
2221 | output = &NotificationConfigurationDeprecated{} | ||
2222 | req = c.newRequest(op, input, output) | ||
2223 | return | ||
2224 | } | ||
2225 | |||
2226 | // GetBucketNotification API operation for Amazon Simple Storage Service. | ||
2227 | // | ||
2228 | // Deprecated, see the GetBucketNotificationConfiguration operation. | ||
2229 | // | ||
2230 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
2231 | // with awserr.Error's Code and Message methods to get detailed information about | ||
2232 | // the error. | ||
2233 | // | ||
2234 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
2235 | // API operation GetBucketNotification for usage and error information. | ||
2236 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketNotification | ||
2237 | func (c *S3) GetBucketNotification(input *GetBucketNotificationConfigurationRequest) (*NotificationConfigurationDeprecated, error) { | ||
2238 | req, out := c.GetBucketNotificationRequest(input) | ||
2239 | return out, req.Send() | ||
2240 | } | ||
2241 | |||
2242 | // GetBucketNotificationWithContext is the same as GetBucketNotification with the addition of | ||
2243 | // the ability to pass a context and additional request options. | ||
2244 | // | ||
2245 | // See GetBucketNotification for details on how to use this API operation. | ||
2246 | // | ||
2247 | // The context must be non-nil and will be used for request cancellation. If | ||
2248 | // the context is nil a panic will occur. In the future the SDK may create | ||
2249 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
2250 | // for more information on using Contexts. | ||
2251 | func (c *S3) GetBucketNotificationWithContext(ctx aws.Context, input *GetBucketNotificationConfigurationRequest, opts ...request.Option) (*NotificationConfigurationDeprecated, error) { | ||
2252 | req, out := c.GetBucketNotificationRequest(input) | ||
2253 | req.SetContext(ctx) | ||
2254 | req.ApplyOptions(opts...) | ||
2255 | return out, req.Send() | ||
2256 | } | ||
2257 | |||
2258 | const opGetBucketNotificationConfiguration = "GetBucketNotificationConfiguration" | ||
2259 | |||
2260 | // GetBucketNotificationConfigurationRequest generates a "aws/request.Request" representing the | ||
2261 | // client's request for the GetBucketNotificationConfiguration operation. The "output" return | ||
2262 | // value can be used to capture response data after the request's "Send" method | ||
2263 | // is called. | ||
2264 | // | ||
2265 | // See GetBucketNotificationConfiguration for usage and error information. | ||
2266 | // | ||
2267 | // Creating a request object using this method should be used when you want to inject | ||
2268 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
2269 | // access properties on the request object before or after sending the request. If | ||
2270 | // you just want the service response, call the GetBucketNotificationConfiguration method directly | ||
2271 | // instead. | ||
2272 | // | ||
2273 | // Note: You must call the "Send" method on the returned request object in order | ||
2274 | // to execute the request. | ||
2275 | // | ||
2276 | // // Example sending a request using the GetBucketNotificationConfigurationRequest method. | ||
2277 | // req, resp := client.GetBucketNotificationConfigurationRequest(params) | ||
2278 | // | ||
2279 | // err := req.Send() | ||
2280 | // if err == nil { // resp is now filled | ||
2281 | // fmt.Println(resp) | ||
2282 | // } | ||
2283 | // | ||
2284 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketNotificationConfiguration | ||
2285 | func (c *S3) GetBucketNotificationConfigurationRequest(input *GetBucketNotificationConfigurationRequest) (req *request.Request, output *NotificationConfiguration) { | ||
2286 | op := &request.Operation{ | ||
2287 | Name: opGetBucketNotificationConfiguration, | ||
2288 | HTTPMethod: "GET", | ||
2289 | HTTPPath: "/{Bucket}?notification", | ||
2290 | } | ||
2291 | |||
2292 | if input == nil { | ||
2293 | input = &GetBucketNotificationConfigurationRequest{} | ||
2294 | } | ||
2295 | |||
2296 | output = &NotificationConfiguration{} | ||
2297 | req = c.newRequest(op, input, output) | ||
2298 | return | ||
2299 | } | ||
2300 | |||
2301 | // GetBucketNotificationConfiguration API operation for Amazon Simple Storage Service. | ||
2302 | // | ||
2303 | // Returns the notification configuration of a bucket. | ||
2304 | // | ||
2305 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
2306 | // with awserr.Error's Code and Message methods to get detailed information about | ||
2307 | // the error. | ||
2308 | // | ||
2309 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
2310 | // API operation GetBucketNotificationConfiguration for usage and error information. | ||
2311 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketNotificationConfiguration | ||
2312 | func (c *S3) GetBucketNotificationConfiguration(input *GetBucketNotificationConfigurationRequest) (*NotificationConfiguration, error) { | ||
2313 | req, out := c.GetBucketNotificationConfigurationRequest(input) | ||
2314 | return out, req.Send() | ||
2315 | } | ||
2316 | |||
2317 | // GetBucketNotificationConfigurationWithContext is the same as GetBucketNotificationConfiguration with the addition of | ||
2318 | // the ability to pass a context and additional request options. | ||
2319 | // | ||
2320 | // See GetBucketNotificationConfiguration for details on how to use this API operation. | ||
2321 | // | ||
2322 | // The context must be non-nil and will be used for request cancellation. If | ||
2323 | // the context is nil a panic will occur. In the future the SDK may create | ||
2324 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
2325 | // for more information on using Contexts. | ||
2326 | func (c *S3) GetBucketNotificationConfigurationWithContext(ctx aws.Context, input *GetBucketNotificationConfigurationRequest, opts ...request.Option) (*NotificationConfiguration, error) { | ||
2327 | req, out := c.GetBucketNotificationConfigurationRequest(input) | ||
2328 | req.SetContext(ctx) | ||
2329 | req.ApplyOptions(opts...) | ||
2330 | return out, req.Send() | ||
2331 | } | ||
2332 | |||
2333 | const opGetBucketPolicy = "GetBucketPolicy" | ||
2334 | |||
2335 | // GetBucketPolicyRequest generates a "aws/request.Request" representing the | ||
2336 | // client's request for the GetBucketPolicy operation. The "output" return | ||
2337 | // value can be used to capture response data after the request's "Send" method | ||
2338 | // is called. | ||
2339 | // | ||
2340 | // See GetBucketPolicy for usage and error information. | ||
2341 | // | ||
2342 | // Creating a request object using this method should be used when you want to inject | ||
2343 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
2344 | // access properties on the request object before or after sending the request. If | ||
2345 | // you just want the service response, call the GetBucketPolicy method directly | ||
2346 | // instead. | ||
2347 | // | ||
2348 | // Note: You must call the "Send" method on the returned request object in order | ||
2349 | // to execute the request. | ||
2350 | // | ||
2351 | // // Example sending a request using the GetBucketPolicyRequest method. | ||
2352 | // req, resp := client.GetBucketPolicyRequest(params) | ||
2353 | // | ||
2354 | // err := req.Send() | ||
2355 | // if err == nil { // resp is now filled | ||
2356 | // fmt.Println(resp) | ||
2357 | // } | ||
2358 | // | ||
2359 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketPolicy | ||
2360 | func (c *S3) GetBucketPolicyRequest(input *GetBucketPolicyInput) (req *request.Request, output *GetBucketPolicyOutput) { | ||
2361 | op := &request.Operation{ | ||
2362 | Name: opGetBucketPolicy, | ||
2363 | HTTPMethod: "GET", | ||
2364 | HTTPPath: "/{Bucket}?policy", | ||
2365 | } | ||
2366 | |||
2367 | if input == nil { | ||
2368 | input = &GetBucketPolicyInput{} | ||
2369 | } | ||
2370 | |||
2371 | output = &GetBucketPolicyOutput{} | ||
2372 | req = c.newRequest(op, input, output) | ||
2373 | return | ||
2374 | } | ||
2375 | |||
2376 | // GetBucketPolicy API operation for Amazon Simple Storage Service. | ||
2377 | // | ||
2378 | // Returns the policy of a specified bucket. | ||
2379 | // | ||
2380 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
2381 | // with awserr.Error's Code and Message methods to get detailed information about | ||
2382 | // the error. | ||
2383 | // | ||
2384 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
2385 | // API operation GetBucketPolicy for usage and error information. | ||
2386 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketPolicy | ||
2387 | func (c *S3) GetBucketPolicy(input *GetBucketPolicyInput) (*GetBucketPolicyOutput, error) { | ||
2388 | req, out := c.GetBucketPolicyRequest(input) | ||
2389 | return out, req.Send() | ||
2390 | } | ||
2391 | |||
2392 | // GetBucketPolicyWithContext is the same as GetBucketPolicy with the addition of | ||
2393 | // the ability to pass a context and additional request options. | ||
2394 | // | ||
2395 | // See GetBucketPolicy for details on how to use this API operation. | ||
2396 | // | ||
2397 | // The context must be non-nil and will be used for request cancellation. If | ||
2398 | // the context is nil a panic will occur. In the future the SDK may create | ||
2399 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
2400 | // for more information on using Contexts. | ||
2401 | func (c *S3) GetBucketPolicyWithContext(ctx aws.Context, input *GetBucketPolicyInput, opts ...request.Option) (*GetBucketPolicyOutput, error) { | ||
2402 | req, out := c.GetBucketPolicyRequest(input) | ||
2403 | req.SetContext(ctx) | ||
2404 | req.ApplyOptions(opts...) | ||
2405 | return out, req.Send() | ||
2406 | } | ||
2407 | |||
2408 | const opGetBucketReplication = "GetBucketReplication" | ||
2409 | |||
2410 | // GetBucketReplicationRequest generates a "aws/request.Request" representing the | ||
2411 | // client's request for the GetBucketReplication operation. The "output" return | ||
2412 | // value can be used to capture response data after the request's "Send" method | ||
2413 | // is called. | ||
2414 | // | ||
2415 | // See GetBucketReplication for usage and error information. | ||
2416 | // | ||
2417 | // Creating a request object using this method should be used when you want to inject | ||
2418 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
2419 | // access properties on the request object before or after sending the request. If | ||
2420 | // you just want the service response, call the GetBucketReplication method directly | ||
2421 | // instead. | ||
2422 | // | ||
2423 | // Note: You must call the "Send" method on the returned request object in order | ||
2424 | // to execute the request. | ||
2425 | // | ||
2426 | // // Example sending a request using the GetBucketReplicationRequest method. | ||
2427 | // req, resp := client.GetBucketReplicationRequest(params) | ||
2428 | // | ||
2429 | // err := req.Send() | ||
2430 | // if err == nil { // resp is now filled | ||
2431 | // fmt.Println(resp) | ||
2432 | // } | ||
2433 | // | ||
2434 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketReplication | ||
2435 | func (c *S3) GetBucketReplicationRequest(input *GetBucketReplicationInput) (req *request.Request, output *GetBucketReplicationOutput) { | ||
2436 | op := &request.Operation{ | ||
2437 | Name: opGetBucketReplication, | ||
2438 | HTTPMethod: "GET", | ||
2439 | HTTPPath: "/{Bucket}?replication", | ||
2440 | } | ||
2441 | |||
2442 | if input == nil { | ||
2443 | input = &GetBucketReplicationInput{} | ||
2444 | } | ||
2445 | |||
2446 | output = &GetBucketReplicationOutput{} | ||
2447 | req = c.newRequest(op, input, output) | ||
2448 | return | ||
2449 | } | ||
2450 | |||
2451 | // GetBucketReplication API operation for Amazon Simple Storage Service. | ||
2452 | // | ||
2453 | // Returns the replication configuration of a bucket. | ||
2454 | // | ||
2455 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
2456 | // with awserr.Error's Code and Message methods to get detailed information about | ||
2457 | // the error. | ||
2458 | // | ||
2459 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
2460 | // API operation GetBucketReplication for usage and error information. | ||
2461 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketReplication | ||
2462 | func (c *S3) GetBucketReplication(input *GetBucketReplicationInput) (*GetBucketReplicationOutput, error) { | ||
2463 | req, out := c.GetBucketReplicationRequest(input) | ||
2464 | return out, req.Send() | ||
2465 | } | ||
2466 | |||
2467 | // GetBucketReplicationWithContext is the same as GetBucketReplication with the addition of | ||
2468 | // the ability to pass a context and additional request options. | ||
2469 | // | ||
2470 | // See GetBucketReplication for details on how to use this API operation. | ||
2471 | // | ||
2472 | // The context must be non-nil and will be used for request cancellation. If | ||
2473 | // the context is nil a panic will occur. In the future the SDK may create | ||
2474 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
2475 | // for more information on using Contexts. | ||
2476 | func (c *S3) GetBucketReplicationWithContext(ctx aws.Context, input *GetBucketReplicationInput, opts ...request.Option) (*GetBucketReplicationOutput, error) { | ||
2477 | req, out := c.GetBucketReplicationRequest(input) | ||
2478 | req.SetContext(ctx) | ||
2479 | req.ApplyOptions(opts...) | ||
2480 | return out, req.Send() | ||
2481 | } | ||
2482 | |||
2483 | const opGetBucketRequestPayment = "GetBucketRequestPayment" | ||
2484 | |||
2485 | // GetBucketRequestPaymentRequest generates a "aws/request.Request" representing the | ||
2486 | // client's request for the GetBucketRequestPayment operation. The "output" return | ||
2487 | // value can be used to capture response data after the request's "Send" method | ||
2488 | // is called. | ||
2489 | // | ||
2490 | // See GetBucketRequestPayment for usage and error information. | ||
2491 | // | ||
2492 | // Creating a request object using this method should be used when you want to inject | ||
2493 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
2494 | // access properties on the request object before or after sending the request. If | ||
2495 | // you just want the service response, call the GetBucketRequestPayment method directly | ||
2496 | // instead. | ||
2497 | // | ||
2498 | // Note: You must call the "Send" method on the returned request object in order | ||
2499 | // to execute the request. | ||
2500 | // | ||
2501 | // // Example sending a request using the GetBucketRequestPaymentRequest method. | ||
2502 | // req, resp := client.GetBucketRequestPaymentRequest(params) | ||
2503 | // | ||
2504 | // err := req.Send() | ||
2505 | // if err == nil { // resp is now filled | ||
2506 | // fmt.Println(resp) | ||
2507 | // } | ||
2508 | // | ||
2509 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketRequestPayment | ||
2510 | func (c *S3) GetBucketRequestPaymentRequest(input *GetBucketRequestPaymentInput) (req *request.Request, output *GetBucketRequestPaymentOutput) { | ||
2511 | op := &request.Operation{ | ||
2512 | Name: opGetBucketRequestPayment, | ||
2513 | HTTPMethod: "GET", | ||
2514 | HTTPPath: "/{Bucket}?requestPayment", | ||
2515 | } | ||
2516 | |||
2517 | if input == nil { | ||
2518 | input = &GetBucketRequestPaymentInput{} | ||
2519 | } | ||
2520 | |||
2521 | output = &GetBucketRequestPaymentOutput{} | ||
2522 | req = c.newRequest(op, input, output) | ||
2523 | return | ||
2524 | } | ||
2525 | |||
2526 | // GetBucketRequestPayment API operation for Amazon Simple Storage Service. | ||
2527 | // | ||
2528 | // Returns the request payment configuration of a bucket. | ||
2529 | // | ||
2530 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
2531 | // with awserr.Error's Code and Message methods to get detailed information about | ||
2532 | // the error. | ||
2533 | // | ||
2534 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
2535 | // API operation GetBucketRequestPayment for usage and error information. | ||
2536 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketRequestPayment | ||
2537 | func (c *S3) GetBucketRequestPayment(input *GetBucketRequestPaymentInput) (*GetBucketRequestPaymentOutput, error) { | ||
2538 | req, out := c.GetBucketRequestPaymentRequest(input) | ||
2539 | return out, req.Send() | ||
2540 | } | ||
2541 | |||
2542 | // GetBucketRequestPaymentWithContext is the same as GetBucketRequestPayment with the addition of | ||
2543 | // the ability to pass a context and additional request options. | ||
2544 | // | ||
2545 | // See GetBucketRequestPayment for details on how to use this API operation. | ||
2546 | // | ||
2547 | // The context must be non-nil and will be used for request cancellation. If | ||
2548 | // the context is nil a panic will occur. In the future the SDK may create | ||
2549 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
2550 | // for more information on using Contexts. | ||
2551 | func (c *S3) GetBucketRequestPaymentWithContext(ctx aws.Context, input *GetBucketRequestPaymentInput, opts ...request.Option) (*GetBucketRequestPaymentOutput, error) { | ||
2552 | req, out := c.GetBucketRequestPaymentRequest(input) | ||
2553 | req.SetContext(ctx) | ||
2554 | req.ApplyOptions(opts...) | ||
2555 | return out, req.Send() | ||
2556 | } | ||
2557 | |||
2558 | const opGetBucketTagging = "GetBucketTagging" | ||
2559 | |||
2560 | // GetBucketTaggingRequest generates a "aws/request.Request" representing the | ||
2561 | // client's request for the GetBucketTagging operation. The "output" return | ||
2562 | // value can be used to capture response data after the request's "Send" method | ||
2563 | // is called. | ||
2564 | // | ||
2565 | // See GetBucketTagging for usage and error information. | ||
2566 | // | ||
2567 | // Creating a request object using this method should be used when you want to inject | ||
2568 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
2569 | // access properties on the request object before or after sending the request. If | ||
2570 | // you just want the service response, call the GetBucketTagging method directly | ||
2571 | // instead. | ||
2572 | // | ||
2573 | // Note: You must call the "Send" method on the returned request object in order | ||
2574 | // to execute the request. | ||
2575 | // | ||
2576 | // // Example sending a request using the GetBucketTaggingRequest method. | ||
2577 | // req, resp := client.GetBucketTaggingRequest(params) | ||
2578 | // | ||
2579 | // err := req.Send() | ||
2580 | // if err == nil { // resp is now filled | ||
2581 | // fmt.Println(resp) | ||
2582 | // } | ||
2583 | // | ||
2584 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketTagging | ||
2585 | func (c *S3) GetBucketTaggingRequest(input *GetBucketTaggingInput) (req *request.Request, output *GetBucketTaggingOutput) { | ||
2586 | op := &request.Operation{ | ||
2587 | Name: opGetBucketTagging, | ||
2588 | HTTPMethod: "GET", | ||
2589 | HTTPPath: "/{Bucket}?tagging", | ||
2590 | } | ||
2591 | |||
2592 | if input == nil { | ||
2593 | input = &GetBucketTaggingInput{} | ||
2594 | } | ||
2595 | |||
2596 | output = &GetBucketTaggingOutput{} | ||
2597 | req = c.newRequest(op, input, output) | ||
2598 | return | ||
2599 | } | ||
2600 | |||
2601 | // GetBucketTagging API operation for Amazon Simple Storage Service. | ||
2602 | // | ||
2603 | // Returns the tag set associated with the bucket. | ||
2604 | // | ||
2605 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
2606 | // with awserr.Error's Code and Message methods to get detailed information about | ||
2607 | // the error. | ||
2608 | // | ||
2609 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
2610 | // API operation GetBucketTagging for usage and error information. | ||
2611 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketTagging | ||
2612 | func (c *S3) GetBucketTagging(input *GetBucketTaggingInput) (*GetBucketTaggingOutput, error) { | ||
2613 | req, out := c.GetBucketTaggingRequest(input) | ||
2614 | return out, req.Send() | ||
2615 | } | ||
2616 | |||
2617 | // GetBucketTaggingWithContext is the same as GetBucketTagging with the addition of | ||
2618 | // the ability to pass a context and additional request options. | ||
2619 | // | ||
2620 | // See GetBucketTagging for details on how to use this API operation. | ||
2621 | // | ||
2622 | // The context must be non-nil and will be used for request cancellation. If | ||
2623 | // the context is nil a panic will occur. In the future the SDK may create | ||
2624 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
2625 | // for more information on using Contexts. | ||
2626 | func (c *S3) GetBucketTaggingWithContext(ctx aws.Context, input *GetBucketTaggingInput, opts ...request.Option) (*GetBucketTaggingOutput, error) { | ||
2627 | req, out := c.GetBucketTaggingRequest(input) | ||
2628 | req.SetContext(ctx) | ||
2629 | req.ApplyOptions(opts...) | ||
2630 | return out, req.Send() | ||
2631 | } | ||
2632 | |||
2633 | const opGetBucketVersioning = "GetBucketVersioning" | ||
2634 | |||
2635 | // GetBucketVersioningRequest generates a "aws/request.Request" representing the | ||
2636 | // client's request for the GetBucketVersioning operation. The "output" return | ||
2637 | // value can be used to capture response data after the request's "Send" method | ||
2638 | // is called. | ||
2639 | // | ||
2640 | // See GetBucketVersioning for usage and error information. | ||
2641 | // | ||
2642 | // Creating a request object using this method should be used when you want to inject | ||
2643 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
2644 | // access properties on the request object before or after sending the request. If | ||
2645 | // you just want the service response, call the GetBucketVersioning method directly | ||
2646 | // instead. | ||
2647 | // | ||
2648 | // Note: You must call the "Send" method on the returned request object in order | ||
2649 | // to execute the request. | ||
2650 | // | ||
2651 | // // Example sending a request using the GetBucketVersioningRequest method. | ||
2652 | // req, resp := client.GetBucketVersioningRequest(params) | ||
2653 | // | ||
2654 | // err := req.Send() | ||
2655 | // if err == nil { // resp is now filled | ||
2656 | // fmt.Println(resp) | ||
2657 | // } | ||
2658 | // | ||
2659 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketVersioning | ||
2660 | func (c *S3) GetBucketVersioningRequest(input *GetBucketVersioningInput) (req *request.Request, output *GetBucketVersioningOutput) { | ||
2661 | op := &request.Operation{ | ||
2662 | Name: opGetBucketVersioning, | ||
2663 | HTTPMethod: "GET", | ||
2664 | HTTPPath: "/{Bucket}?versioning", | ||
2665 | } | ||
2666 | |||
2667 | if input == nil { | ||
2668 | input = &GetBucketVersioningInput{} | ||
2669 | } | ||
2670 | |||
2671 | output = &GetBucketVersioningOutput{} | ||
2672 | req = c.newRequest(op, input, output) | ||
2673 | return | ||
2674 | } | ||
2675 | |||
2676 | // GetBucketVersioning API operation for Amazon Simple Storage Service. | ||
2677 | // | ||
2678 | // Returns the versioning state of a bucket. | ||
2679 | // | ||
2680 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
2681 | // with awserr.Error's Code and Message methods to get detailed information about | ||
2682 | // the error. | ||
2683 | // | ||
2684 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
2685 | // API operation GetBucketVersioning for usage and error information. | ||
2686 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketVersioning | ||
2687 | func (c *S3) GetBucketVersioning(input *GetBucketVersioningInput) (*GetBucketVersioningOutput, error) { | ||
2688 | req, out := c.GetBucketVersioningRequest(input) | ||
2689 | return out, req.Send() | ||
2690 | } | ||
2691 | |||
2692 | // GetBucketVersioningWithContext is the same as GetBucketVersioning with the addition of | ||
2693 | // the ability to pass a context and additional request options. | ||
2694 | // | ||
2695 | // See GetBucketVersioning for details on how to use this API operation. | ||
2696 | // | ||
2697 | // The context must be non-nil and will be used for request cancellation. If | ||
2698 | // the context is nil a panic will occur. In the future the SDK may create | ||
2699 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
2700 | // for more information on using Contexts. | ||
2701 | func (c *S3) GetBucketVersioningWithContext(ctx aws.Context, input *GetBucketVersioningInput, opts ...request.Option) (*GetBucketVersioningOutput, error) { | ||
2702 | req, out := c.GetBucketVersioningRequest(input) | ||
2703 | req.SetContext(ctx) | ||
2704 | req.ApplyOptions(opts...) | ||
2705 | return out, req.Send() | ||
2706 | } | ||
2707 | |||
2708 | const opGetBucketWebsite = "GetBucketWebsite" | ||
2709 | |||
2710 | // GetBucketWebsiteRequest generates a "aws/request.Request" representing the | ||
2711 | // client's request for the GetBucketWebsite operation. The "output" return | ||
2712 | // value can be used to capture response data after the request's "Send" method | ||
2713 | // is called. | ||
2714 | // | ||
2715 | // See GetBucketWebsite for usage and error information. | ||
2716 | // | ||
2717 | // Creating a request object using this method should be used when you want to inject | ||
2718 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
2719 | // access properties on the request object before or after sending the request. If | ||
2720 | // you just want the service response, call the GetBucketWebsite method directly | ||
2721 | // instead. | ||
2722 | // | ||
2723 | // Note: You must call the "Send" method on the returned request object in order | ||
2724 | // to execute the request. | ||
2725 | // | ||
2726 | // // Example sending a request using the GetBucketWebsiteRequest method. | ||
2727 | // req, resp := client.GetBucketWebsiteRequest(params) | ||
2728 | // | ||
2729 | // err := req.Send() | ||
2730 | // if err == nil { // resp is now filled | ||
2731 | // fmt.Println(resp) | ||
2732 | // } | ||
2733 | // | ||
2734 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketWebsite | ||
2735 | func (c *S3) GetBucketWebsiteRequest(input *GetBucketWebsiteInput) (req *request.Request, output *GetBucketWebsiteOutput) { | ||
2736 | op := &request.Operation{ | ||
2737 | Name: opGetBucketWebsite, | ||
2738 | HTTPMethod: "GET", | ||
2739 | HTTPPath: "/{Bucket}?website", | ||
2740 | } | ||
2741 | |||
2742 | if input == nil { | ||
2743 | input = &GetBucketWebsiteInput{} | ||
2744 | } | ||
2745 | |||
2746 | output = &GetBucketWebsiteOutput{} | ||
2747 | req = c.newRequest(op, input, output) | ||
2748 | return | ||
2749 | } | ||
2750 | |||
2751 | // GetBucketWebsite API operation for Amazon Simple Storage Service. | ||
2752 | // | ||
2753 | // Returns the website configuration for a bucket. | ||
2754 | // | ||
2755 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
2756 | // with awserr.Error's Code and Message methods to get detailed information about | ||
2757 | // the error. | ||
2758 | // | ||
2759 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
2760 | // API operation GetBucketWebsite for usage and error information. | ||
2761 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketWebsite | ||
2762 | func (c *S3) GetBucketWebsite(input *GetBucketWebsiteInput) (*GetBucketWebsiteOutput, error) { | ||
2763 | req, out := c.GetBucketWebsiteRequest(input) | ||
2764 | return out, req.Send() | ||
2765 | } | ||
2766 | |||
2767 | // GetBucketWebsiteWithContext is the same as GetBucketWebsite with the addition of | ||
2768 | // the ability to pass a context and additional request options. | ||
2769 | // | ||
2770 | // See GetBucketWebsite for details on how to use this API operation. | ||
2771 | // | ||
2772 | // The context must be non-nil and will be used for request cancellation. If | ||
2773 | // the context is nil a panic will occur. In the future the SDK may create | ||
2774 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
2775 | // for more information on using Contexts. | ||
2776 | func (c *S3) GetBucketWebsiteWithContext(ctx aws.Context, input *GetBucketWebsiteInput, opts ...request.Option) (*GetBucketWebsiteOutput, error) { | ||
2777 | req, out := c.GetBucketWebsiteRequest(input) | ||
2778 | req.SetContext(ctx) | ||
2779 | req.ApplyOptions(opts...) | ||
2780 | return out, req.Send() | ||
2781 | } | ||
2782 | |||
2783 | const opGetObject = "GetObject" | ||
2784 | |||
2785 | // GetObjectRequest generates a "aws/request.Request" representing the | ||
2786 | // client's request for the GetObject operation. The "output" return | ||
2787 | // value can be used to capture response data after the request's "Send" method | ||
2788 | // is called. | ||
2789 | // | ||
2790 | // See GetObject for usage and error information. | ||
2791 | // | ||
2792 | // Creating a request object using this method should be used when you want to inject | ||
2793 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
2794 | // access properties on the request object before or after sending the request. If | ||
2795 | // you just want the service response, call the GetObject method directly | ||
2796 | // instead. | ||
2797 | // | ||
2798 | // Note: You must call the "Send" method on the returned request object in order | ||
2799 | // to execute the request. | ||
2800 | // | ||
2801 | // // Example sending a request using the GetObjectRequest method. | ||
2802 | // req, resp := client.GetObjectRequest(params) | ||
2803 | // | ||
2804 | // err := req.Send() | ||
2805 | // if err == nil { // resp is now filled | ||
2806 | // fmt.Println(resp) | ||
2807 | // } | ||
2808 | // | ||
2809 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObject | ||
2810 | func (c *S3) GetObjectRequest(input *GetObjectInput) (req *request.Request, output *GetObjectOutput) { | ||
2811 | op := &request.Operation{ | ||
2812 | Name: opGetObject, | ||
2813 | HTTPMethod: "GET", | ||
2814 | HTTPPath: "/{Bucket}/{Key+}", | ||
2815 | } | ||
2816 | |||
2817 | if input == nil { | ||
2818 | input = &GetObjectInput{} | ||
2819 | } | ||
2820 | |||
2821 | output = &GetObjectOutput{} | ||
2822 | req = c.newRequest(op, input, output) | ||
2823 | return | ||
2824 | } | ||
2825 | |||
2826 | // GetObject API operation for Amazon Simple Storage Service. | ||
2827 | // | ||
2828 | // Retrieves objects from Amazon S3. | ||
2829 | // | ||
2830 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
2831 | // with awserr.Error's Code and Message methods to get detailed information about | ||
2832 | // the error. | ||
2833 | // | ||
2834 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
2835 | // API operation GetObject for usage and error information. | ||
2836 | // | ||
2837 | // Returned Error Codes: | ||
2838 | // * ErrCodeNoSuchKey "NoSuchKey" | ||
2839 | // The specified key does not exist. | ||
2840 | // | ||
2841 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObject | ||
2842 | func (c *S3) GetObject(input *GetObjectInput) (*GetObjectOutput, error) { | ||
2843 | req, out := c.GetObjectRequest(input) | ||
2844 | return out, req.Send() | ||
2845 | } | ||
2846 | |||
2847 | // GetObjectWithContext is the same as GetObject with the addition of | ||
2848 | // the ability to pass a context and additional request options. | ||
2849 | // | ||
2850 | // See GetObject for details on how to use this API operation. | ||
2851 | // | ||
2852 | // The context must be non-nil and will be used for request cancellation. If | ||
2853 | // the context is nil a panic will occur. In the future the SDK may create | ||
2854 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
2855 | // for more information on using Contexts. | ||
2856 | func (c *S3) GetObjectWithContext(ctx aws.Context, input *GetObjectInput, opts ...request.Option) (*GetObjectOutput, error) { | ||
2857 | req, out := c.GetObjectRequest(input) | ||
2858 | req.SetContext(ctx) | ||
2859 | req.ApplyOptions(opts...) | ||
2860 | return out, req.Send() | ||
2861 | } | ||
2862 | |||
2863 | const opGetObjectAcl = "GetObjectAcl" | ||
2864 | |||
2865 | // GetObjectAclRequest generates a "aws/request.Request" representing the | ||
2866 | // client's request for the GetObjectAcl operation. The "output" return | ||
2867 | // value can be used to capture response data after the request's "Send" method | ||
2868 | // is called. | ||
2869 | // | ||
2870 | // See GetObjectAcl for usage and error information. | ||
2871 | // | ||
2872 | // Creating a request object using this method should be used when you want to inject | ||
2873 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
2874 | // access properties on the request object before or after sending the request. If | ||
2875 | // you just want the service response, call the GetObjectAcl method directly | ||
2876 | // instead. | ||
2877 | // | ||
2878 | // Note: You must call the "Send" method on the returned request object in order | ||
2879 | // to execute the request. | ||
2880 | // | ||
2881 | // // Example sending a request using the GetObjectAclRequest method. | ||
2882 | // req, resp := client.GetObjectAclRequest(params) | ||
2883 | // | ||
2884 | // err := req.Send() | ||
2885 | // if err == nil { // resp is now filled | ||
2886 | // fmt.Println(resp) | ||
2887 | // } | ||
2888 | // | ||
2889 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectAcl | ||
2890 | func (c *S3) GetObjectAclRequest(input *GetObjectAclInput) (req *request.Request, output *GetObjectAclOutput) { | ||
2891 | op := &request.Operation{ | ||
2892 | Name: opGetObjectAcl, | ||
2893 | HTTPMethod: "GET", | ||
2894 | HTTPPath: "/{Bucket}/{Key+}?acl", | ||
2895 | } | ||
2896 | |||
2897 | if input == nil { | ||
2898 | input = &GetObjectAclInput{} | ||
2899 | } | ||
2900 | |||
2901 | output = &GetObjectAclOutput{} | ||
2902 | req = c.newRequest(op, input, output) | ||
2903 | return | ||
2904 | } | ||
2905 | |||
2906 | // GetObjectAcl API operation for Amazon Simple Storage Service. | ||
2907 | // | ||
2908 | // Returns the access control list (ACL) of an object. | ||
2909 | // | ||
2910 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
2911 | // with awserr.Error's Code and Message methods to get detailed information about | ||
2912 | // the error. | ||
2913 | // | ||
2914 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
2915 | // API operation GetObjectAcl for usage and error information. | ||
2916 | // | ||
2917 | // Returned Error Codes: | ||
2918 | // * ErrCodeNoSuchKey "NoSuchKey" | ||
2919 | // The specified key does not exist. | ||
2920 | // | ||
2921 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectAcl | ||
2922 | func (c *S3) GetObjectAcl(input *GetObjectAclInput) (*GetObjectAclOutput, error) { | ||
2923 | req, out := c.GetObjectAclRequest(input) | ||
2924 | return out, req.Send() | ||
2925 | } | ||
2926 | |||
2927 | // GetObjectAclWithContext is the same as GetObjectAcl with the addition of | ||
2928 | // the ability to pass a context and additional request options. | ||
2929 | // | ||
2930 | // See GetObjectAcl for details on how to use this API operation. | ||
2931 | // | ||
2932 | // The context must be non-nil and will be used for request cancellation. If | ||
2933 | // the context is nil a panic will occur. In the future the SDK may create | ||
2934 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
2935 | // for more information on using Contexts. | ||
2936 | func (c *S3) GetObjectAclWithContext(ctx aws.Context, input *GetObjectAclInput, opts ...request.Option) (*GetObjectAclOutput, error) { | ||
2937 | req, out := c.GetObjectAclRequest(input) | ||
2938 | req.SetContext(ctx) | ||
2939 | req.ApplyOptions(opts...) | ||
2940 | return out, req.Send() | ||
2941 | } | ||
2942 | |||
2943 | const opGetObjectTagging = "GetObjectTagging" | ||
2944 | |||
2945 | // GetObjectTaggingRequest generates a "aws/request.Request" representing the | ||
2946 | // client's request for the GetObjectTagging operation. The "output" return | ||
2947 | // value can be used to capture response data after the request's "Send" method | ||
2948 | // is called. | ||
2949 | // | ||
2950 | // See GetObjectTagging for usage and error information. | ||
2951 | // | ||
2952 | // Creating a request object using this method should be used when you want to inject | ||
2953 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
2954 | // access properties on the request object before or after sending the request. If | ||
2955 | // you just want the service response, call the GetObjectTagging method directly | ||
2956 | // instead. | ||
2957 | // | ||
2958 | // Note: You must call the "Send" method on the returned request object in order | ||
2959 | // to execute the request. | ||
2960 | // | ||
2961 | // // Example sending a request using the GetObjectTaggingRequest method. | ||
2962 | // req, resp := client.GetObjectTaggingRequest(params) | ||
2963 | // | ||
2964 | // err := req.Send() | ||
2965 | // if err == nil { // resp is now filled | ||
2966 | // fmt.Println(resp) | ||
2967 | // } | ||
2968 | // | ||
2969 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectTagging | ||
2970 | func (c *S3) GetObjectTaggingRequest(input *GetObjectTaggingInput) (req *request.Request, output *GetObjectTaggingOutput) { | ||
2971 | op := &request.Operation{ | ||
2972 | Name: opGetObjectTagging, | ||
2973 | HTTPMethod: "GET", | ||
2974 | HTTPPath: "/{Bucket}/{Key+}?tagging", | ||
2975 | } | ||
2976 | |||
2977 | if input == nil { | ||
2978 | input = &GetObjectTaggingInput{} | ||
2979 | } | ||
2980 | |||
2981 | output = &GetObjectTaggingOutput{} | ||
2982 | req = c.newRequest(op, input, output) | ||
2983 | return | ||
2984 | } | ||
2985 | |||
2986 | // GetObjectTagging API operation for Amazon Simple Storage Service. | ||
2987 | // | ||
2988 | // Returns the tag-set of an object. | ||
2989 | // | ||
2990 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
2991 | // with awserr.Error's Code and Message methods to get detailed information about | ||
2992 | // the error. | ||
2993 | // | ||
2994 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
2995 | // API operation GetObjectTagging for usage and error information. | ||
2996 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectTagging | ||
2997 | func (c *S3) GetObjectTagging(input *GetObjectTaggingInput) (*GetObjectTaggingOutput, error) { | ||
2998 | req, out := c.GetObjectTaggingRequest(input) | ||
2999 | return out, req.Send() | ||
3000 | } | ||
3001 | |||
3002 | // GetObjectTaggingWithContext is the same as GetObjectTagging with the addition of | ||
3003 | // the ability to pass a context and additional request options. | ||
3004 | // | ||
3005 | // See GetObjectTagging for details on how to use this API operation. | ||
3006 | // | ||
3007 | // The context must be non-nil and will be used for request cancellation. If | ||
3008 | // the context is nil a panic will occur. In the future the SDK may create | ||
3009 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
3010 | // for more information on using Contexts. | ||
3011 | func (c *S3) GetObjectTaggingWithContext(ctx aws.Context, input *GetObjectTaggingInput, opts ...request.Option) (*GetObjectTaggingOutput, error) { | ||
3012 | req, out := c.GetObjectTaggingRequest(input) | ||
3013 | req.SetContext(ctx) | ||
3014 | req.ApplyOptions(opts...) | ||
3015 | return out, req.Send() | ||
3016 | } | ||
3017 | |||
3018 | const opGetObjectTorrent = "GetObjectTorrent" | ||
3019 | |||
3020 | // GetObjectTorrentRequest generates a "aws/request.Request" representing the | ||
3021 | // client's request for the GetObjectTorrent operation. The "output" return | ||
3022 | // value can be used to capture response data after the request's "Send" method | ||
3023 | // is called. | ||
3024 | // | ||
3025 | // See GetObjectTorrent for usage and error information. | ||
3026 | // | ||
3027 | // Creating a request object using this method should be used when you want to inject | ||
3028 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
3029 | // access properties on the request object before or after sending the request. If | ||
3030 | // you just want the service response, call the GetObjectTorrent method directly | ||
3031 | // instead. | ||
3032 | // | ||
3033 | // Note: You must call the "Send" method on the returned request object in order | ||
3034 | // to execute the request. | ||
3035 | // | ||
3036 | // // Example sending a request using the GetObjectTorrentRequest method. | ||
3037 | // req, resp := client.GetObjectTorrentRequest(params) | ||
3038 | // | ||
3039 | // err := req.Send() | ||
3040 | // if err == nil { // resp is now filled | ||
3041 | // fmt.Println(resp) | ||
3042 | // } | ||
3043 | // | ||
3044 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectTorrent | ||
3045 | func (c *S3) GetObjectTorrentRequest(input *GetObjectTorrentInput) (req *request.Request, output *GetObjectTorrentOutput) { | ||
3046 | op := &request.Operation{ | ||
3047 | Name: opGetObjectTorrent, | ||
3048 | HTTPMethod: "GET", | ||
3049 | HTTPPath: "/{Bucket}/{Key+}?torrent", | ||
3050 | } | ||
3051 | |||
3052 | if input == nil { | ||
3053 | input = &GetObjectTorrentInput{} | ||
3054 | } | ||
3055 | |||
3056 | output = &GetObjectTorrentOutput{} | ||
3057 | req = c.newRequest(op, input, output) | ||
3058 | return | ||
3059 | } | ||
3060 | |||
3061 | // GetObjectTorrent API operation for Amazon Simple Storage Service. | ||
3062 | // | ||
3063 | // Return torrent files from a bucket. | ||
3064 | // | ||
3065 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
3066 | // with awserr.Error's Code and Message methods to get detailed information about | ||
3067 | // the error. | ||
3068 | // | ||
3069 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
3070 | // API operation GetObjectTorrent for usage and error information. | ||
3071 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectTorrent | ||
3072 | func (c *S3) GetObjectTorrent(input *GetObjectTorrentInput) (*GetObjectTorrentOutput, error) { | ||
3073 | req, out := c.GetObjectTorrentRequest(input) | ||
3074 | return out, req.Send() | ||
3075 | } | ||
3076 | |||
3077 | // GetObjectTorrentWithContext is the same as GetObjectTorrent with the addition of | ||
3078 | // the ability to pass a context and additional request options. | ||
3079 | // | ||
3080 | // See GetObjectTorrent for details on how to use this API operation. | ||
3081 | // | ||
3082 | // The context must be non-nil and will be used for request cancellation. If | ||
3083 | // the context is nil a panic will occur. In the future the SDK may create | ||
3084 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
3085 | // for more information on using Contexts. | ||
3086 | func (c *S3) GetObjectTorrentWithContext(ctx aws.Context, input *GetObjectTorrentInput, opts ...request.Option) (*GetObjectTorrentOutput, error) { | ||
3087 | req, out := c.GetObjectTorrentRequest(input) | ||
3088 | req.SetContext(ctx) | ||
3089 | req.ApplyOptions(opts...) | ||
3090 | return out, req.Send() | ||
3091 | } | ||
3092 | |||
3093 | const opHeadBucket = "HeadBucket" | ||
3094 | |||
3095 | // HeadBucketRequest generates a "aws/request.Request" representing the | ||
3096 | // client's request for the HeadBucket operation. The "output" return | ||
3097 | // value can be used to capture response data after the request's "Send" method | ||
3098 | // is called. | ||
3099 | // | ||
3100 | // See HeadBucket for usage and error information. | ||
3101 | // | ||
3102 | // Creating a request object using this method should be used when you want to inject | ||
3103 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
3104 | // access properties on the request object before or after sending the request. If | ||
3105 | // you just want the service response, call the HeadBucket method directly | ||
3106 | // instead. | ||
3107 | // | ||
3108 | // Note: You must call the "Send" method on the returned request object in order | ||
3109 | // to execute the request. | ||
3110 | // | ||
3111 | // // Example sending a request using the HeadBucketRequest method. | ||
3112 | // req, resp := client.HeadBucketRequest(params) | ||
3113 | // | ||
3114 | // err := req.Send() | ||
3115 | // if err == nil { // resp is now filled | ||
3116 | // fmt.Println(resp) | ||
3117 | // } | ||
3118 | // | ||
3119 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/HeadBucket | ||
3120 | func (c *S3) HeadBucketRequest(input *HeadBucketInput) (req *request.Request, output *HeadBucketOutput) { | ||
3121 | op := &request.Operation{ | ||
3122 | Name: opHeadBucket, | ||
3123 | HTTPMethod: "HEAD", | ||
3124 | HTTPPath: "/{Bucket}", | ||
3125 | } | ||
3126 | |||
3127 | if input == nil { | ||
3128 | input = &HeadBucketInput{} | ||
3129 | } | ||
3130 | |||
3131 | output = &HeadBucketOutput{} | ||
3132 | req = c.newRequest(op, input, output) | ||
3133 | req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) | ||
3134 | req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) | ||
3135 | return | ||
3136 | } | ||
3137 | |||
3138 | // HeadBucket API operation for Amazon Simple Storage Service. | ||
3139 | // | ||
3140 | // This operation is useful to determine if a bucket exists and you have permission | ||
3141 | // to access it. | ||
3142 | // | ||
3143 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
3144 | // with awserr.Error's Code and Message methods to get detailed information about | ||
3145 | // the error. | ||
3146 | // | ||
3147 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
3148 | // API operation HeadBucket for usage and error information. | ||
3149 | // | ||
3150 | // Returned Error Codes: | ||
3151 | // * ErrCodeNoSuchBucket "NoSuchBucket" | ||
3152 | // The specified bucket does not exist. | ||
3153 | // | ||
3154 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/HeadBucket | ||
3155 | func (c *S3) HeadBucket(input *HeadBucketInput) (*HeadBucketOutput, error) { | ||
3156 | req, out := c.HeadBucketRequest(input) | ||
3157 | return out, req.Send() | ||
3158 | } | ||
3159 | |||
3160 | // HeadBucketWithContext is the same as HeadBucket with the addition of | ||
3161 | // the ability to pass a context and additional request options. | ||
3162 | // | ||
3163 | // See HeadBucket for details on how to use this API operation. | ||
3164 | // | ||
3165 | // The context must be non-nil and will be used for request cancellation. If | ||
3166 | // the context is nil a panic will occur. In the future the SDK may create | ||
3167 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
3168 | // for more information on using Contexts. | ||
3169 | func (c *S3) HeadBucketWithContext(ctx aws.Context, input *HeadBucketInput, opts ...request.Option) (*HeadBucketOutput, error) { | ||
3170 | req, out := c.HeadBucketRequest(input) | ||
3171 | req.SetContext(ctx) | ||
3172 | req.ApplyOptions(opts...) | ||
3173 | return out, req.Send() | ||
3174 | } | ||
3175 | |||
3176 | const opHeadObject = "HeadObject" | ||
3177 | |||
3178 | // HeadObjectRequest generates a "aws/request.Request" representing the | ||
3179 | // client's request for the HeadObject operation. The "output" return | ||
3180 | // value can be used to capture response data after the request's "Send" method | ||
3181 | // is called. | ||
3182 | // | ||
3183 | // See HeadObject for usage and error information. | ||
3184 | // | ||
3185 | // Creating a request object using this method should be used when you want to inject | ||
3186 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
3187 | // access properties on the request object before or after sending the request. If | ||
3188 | // you just want the service response, call the HeadObject method directly | ||
3189 | // instead. | ||
3190 | // | ||
3191 | // Note: You must call the "Send" method on the returned request object in order | ||
3192 | // to execute the request. | ||
3193 | // | ||
3194 | // // Example sending a request using the HeadObjectRequest method. | ||
3195 | // req, resp := client.HeadObjectRequest(params) | ||
3196 | // | ||
3197 | // err := req.Send() | ||
3198 | // if err == nil { // resp is now filled | ||
3199 | // fmt.Println(resp) | ||
3200 | // } | ||
3201 | // | ||
3202 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/HeadObject | ||
3203 | func (c *S3) HeadObjectRequest(input *HeadObjectInput) (req *request.Request, output *HeadObjectOutput) { | ||
3204 | op := &request.Operation{ | ||
3205 | Name: opHeadObject, | ||
3206 | HTTPMethod: "HEAD", | ||
3207 | HTTPPath: "/{Bucket}/{Key+}", | ||
3208 | } | ||
3209 | |||
3210 | if input == nil { | ||
3211 | input = &HeadObjectInput{} | ||
3212 | } | ||
3213 | |||
3214 | output = &HeadObjectOutput{} | ||
3215 | req = c.newRequest(op, input, output) | ||
3216 | return | ||
3217 | } | ||
3218 | |||
3219 | // HeadObject API operation for Amazon Simple Storage Service. | ||
3220 | // | ||
3221 | // The HEAD operation retrieves metadata from an object without returning the | ||
3222 | // object itself. This operation is useful if you're only interested in an object's | ||
3223 | // metadata. To use HEAD, you must have READ access to the object. | ||
3224 | // | ||
3225 | // See http://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#RESTErrorResponses | ||
3226 | // for more information on returned errors. | ||
3227 | // | ||
3228 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
3229 | // with awserr.Error's Code and Message methods to get detailed information about | ||
3230 | // the error. | ||
3231 | // | ||
3232 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
3233 | // API operation HeadObject for usage and error information. | ||
3234 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/HeadObject | ||
3235 | func (c *S3) HeadObject(input *HeadObjectInput) (*HeadObjectOutput, error) { | ||
3236 | req, out := c.HeadObjectRequest(input) | ||
3237 | return out, req.Send() | ||
3238 | } | ||
3239 | |||
3240 | // HeadObjectWithContext is the same as HeadObject with the addition of | ||
3241 | // the ability to pass a context and additional request options. | ||
3242 | // | ||
3243 | // See HeadObject for details on how to use this API operation. | ||
3244 | // | ||
3245 | // The context must be non-nil and will be used for request cancellation. If | ||
3246 | // the context is nil a panic will occur. In the future the SDK may create | ||
3247 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
3248 | // for more information on using Contexts. | ||
3249 | func (c *S3) HeadObjectWithContext(ctx aws.Context, input *HeadObjectInput, opts ...request.Option) (*HeadObjectOutput, error) { | ||
3250 | req, out := c.HeadObjectRequest(input) | ||
3251 | req.SetContext(ctx) | ||
3252 | req.ApplyOptions(opts...) | ||
3253 | return out, req.Send() | ||
3254 | } | ||
3255 | |||
3256 | const opListBucketAnalyticsConfigurations = "ListBucketAnalyticsConfigurations" | ||
3257 | |||
3258 | // ListBucketAnalyticsConfigurationsRequest generates a "aws/request.Request" representing the | ||
3259 | // client's request for the ListBucketAnalyticsConfigurations operation. The "output" return | ||
3260 | // value can be used to capture response data after the request's "Send" method | ||
3261 | // is called. | ||
3262 | // | ||
3263 | // See ListBucketAnalyticsConfigurations for usage and error information. | ||
3264 | // | ||
3265 | // Creating a request object using this method should be used when you want to inject | ||
3266 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
3267 | // access properties on the request object before or after sending the request. If | ||
3268 | // you just want the service response, call the ListBucketAnalyticsConfigurations method directly | ||
3269 | // instead. | ||
3270 | // | ||
3271 | // Note: You must call the "Send" method on the returned request object in order | ||
3272 | // to execute the request. | ||
3273 | // | ||
3274 | // // Example sending a request using the ListBucketAnalyticsConfigurationsRequest method. | ||
3275 | // req, resp := client.ListBucketAnalyticsConfigurationsRequest(params) | ||
3276 | // | ||
3277 | // err := req.Send() | ||
3278 | // if err == nil { // resp is now filled | ||
3279 | // fmt.Println(resp) | ||
3280 | // } | ||
3281 | // | ||
3282 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketAnalyticsConfigurations | ||
3283 | func (c *S3) ListBucketAnalyticsConfigurationsRequest(input *ListBucketAnalyticsConfigurationsInput) (req *request.Request, output *ListBucketAnalyticsConfigurationsOutput) { | ||
3284 | op := &request.Operation{ | ||
3285 | Name: opListBucketAnalyticsConfigurations, | ||
3286 | HTTPMethod: "GET", | ||
3287 | HTTPPath: "/{Bucket}?analytics", | ||
3288 | } | ||
3289 | |||
3290 | if input == nil { | ||
3291 | input = &ListBucketAnalyticsConfigurationsInput{} | ||
3292 | } | ||
3293 | |||
3294 | output = &ListBucketAnalyticsConfigurationsOutput{} | ||
3295 | req = c.newRequest(op, input, output) | ||
3296 | return | ||
3297 | } | ||
3298 | |||
3299 | // ListBucketAnalyticsConfigurations API operation for Amazon Simple Storage Service. | ||
3300 | // | ||
3301 | // Lists the analytics configurations for the bucket. | ||
3302 | // | ||
3303 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
3304 | // with awserr.Error's Code and Message methods to get detailed information about | ||
3305 | // the error. | ||
3306 | // | ||
3307 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
3308 | // API operation ListBucketAnalyticsConfigurations for usage and error information. | ||
3309 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketAnalyticsConfigurations | ||
3310 | func (c *S3) ListBucketAnalyticsConfigurations(input *ListBucketAnalyticsConfigurationsInput) (*ListBucketAnalyticsConfigurationsOutput, error) { | ||
3311 | req, out := c.ListBucketAnalyticsConfigurationsRequest(input) | ||
3312 | return out, req.Send() | ||
3313 | } | ||
3314 | |||
3315 | // ListBucketAnalyticsConfigurationsWithContext is the same as ListBucketAnalyticsConfigurations with the addition of | ||
3316 | // the ability to pass a context and additional request options. | ||
3317 | // | ||
3318 | // See ListBucketAnalyticsConfigurations for details on how to use this API operation. | ||
3319 | // | ||
3320 | // The context must be non-nil and will be used for request cancellation. If | ||
3321 | // the context is nil a panic will occur. In the future the SDK may create | ||
3322 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
3323 | // for more information on using Contexts. | ||
3324 | func (c *S3) ListBucketAnalyticsConfigurationsWithContext(ctx aws.Context, input *ListBucketAnalyticsConfigurationsInput, opts ...request.Option) (*ListBucketAnalyticsConfigurationsOutput, error) { | ||
3325 | req, out := c.ListBucketAnalyticsConfigurationsRequest(input) | ||
3326 | req.SetContext(ctx) | ||
3327 | req.ApplyOptions(opts...) | ||
3328 | return out, req.Send() | ||
3329 | } | ||
3330 | |||
3331 | const opListBucketInventoryConfigurations = "ListBucketInventoryConfigurations" | ||
3332 | |||
3333 | // ListBucketInventoryConfigurationsRequest generates a "aws/request.Request" representing the | ||
3334 | // client's request for the ListBucketInventoryConfigurations operation. The "output" return | ||
3335 | // value can be used to capture response data after the request's "Send" method | ||
3336 | // is called. | ||
3337 | // | ||
3338 | // See ListBucketInventoryConfigurations for usage and error information. | ||
3339 | // | ||
3340 | // Creating a request object using this method should be used when you want to inject | ||
3341 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
3342 | // access properties on the request object before or after sending the request. If | ||
3343 | // you just want the service response, call the ListBucketInventoryConfigurations method directly | ||
3344 | // instead. | ||
3345 | // | ||
3346 | // Note: You must call the "Send" method on the returned request object in order | ||
3347 | // to execute the request. | ||
3348 | // | ||
3349 | // // Example sending a request using the ListBucketInventoryConfigurationsRequest method. | ||
3350 | // req, resp := client.ListBucketInventoryConfigurationsRequest(params) | ||
3351 | // | ||
3352 | // err := req.Send() | ||
3353 | // if err == nil { // resp is now filled | ||
3354 | // fmt.Println(resp) | ||
3355 | // } | ||
3356 | // | ||
3357 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketInventoryConfigurations | ||
3358 | func (c *S3) ListBucketInventoryConfigurationsRequest(input *ListBucketInventoryConfigurationsInput) (req *request.Request, output *ListBucketInventoryConfigurationsOutput) { | ||
3359 | op := &request.Operation{ | ||
3360 | Name: opListBucketInventoryConfigurations, | ||
3361 | HTTPMethod: "GET", | ||
3362 | HTTPPath: "/{Bucket}?inventory", | ||
3363 | } | ||
3364 | |||
3365 | if input == nil { | ||
3366 | input = &ListBucketInventoryConfigurationsInput{} | ||
3367 | } | ||
3368 | |||
3369 | output = &ListBucketInventoryConfigurationsOutput{} | ||
3370 | req = c.newRequest(op, input, output) | ||
3371 | return | ||
3372 | } | ||
3373 | |||
3374 | // ListBucketInventoryConfigurations API operation for Amazon Simple Storage Service. | ||
3375 | // | ||
3376 | // Returns a list of inventory configurations for the bucket. | ||
3377 | // | ||
3378 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
3379 | // with awserr.Error's Code and Message methods to get detailed information about | ||
3380 | // the error. | ||
3381 | // | ||
3382 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
3383 | // API operation ListBucketInventoryConfigurations for usage and error information. | ||
3384 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketInventoryConfigurations | ||
3385 | func (c *S3) ListBucketInventoryConfigurations(input *ListBucketInventoryConfigurationsInput) (*ListBucketInventoryConfigurationsOutput, error) { | ||
3386 | req, out := c.ListBucketInventoryConfigurationsRequest(input) | ||
3387 | return out, req.Send() | ||
3388 | } | ||
3389 | |||
3390 | // ListBucketInventoryConfigurationsWithContext is the same as ListBucketInventoryConfigurations with the addition of | ||
3391 | // the ability to pass a context and additional request options. | ||
3392 | // | ||
3393 | // See ListBucketInventoryConfigurations for details on how to use this API operation. | ||
3394 | // | ||
3395 | // The context must be non-nil and will be used for request cancellation. If | ||
3396 | // the context is nil a panic will occur. In the future the SDK may create | ||
3397 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
3398 | // for more information on using Contexts. | ||
3399 | func (c *S3) ListBucketInventoryConfigurationsWithContext(ctx aws.Context, input *ListBucketInventoryConfigurationsInput, opts ...request.Option) (*ListBucketInventoryConfigurationsOutput, error) { | ||
3400 | req, out := c.ListBucketInventoryConfigurationsRequest(input) | ||
3401 | req.SetContext(ctx) | ||
3402 | req.ApplyOptions(opts...) | ||
3403 | return out, req.Send() | ||
3404 | } | ||
3405 | |||
3406 | const opListBucketMetricsConfigurations = "ListBucketMetricsConfigurations" | ||
3407 | |||
3408 | // ListBucketMetricsConfigurationsRequest generates a "aws/request.Request" representing the | ||
3409 | // client's request for the ListBucketMetricsConfigurations operation. The "output" return | ||
3410 | // value can be used to capture response data after the request's "Send" method | ||
3411 | // is called. | ||
3412 | // | ||
3413 | // See ListBucketMetricsConfigurations for usage and error information. | ||
3414 | // | ||
3415 | // Creating a request object using this method should be used when you want to inject | ||
3416 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
3417 | // access properties on the request object before or after sending the request. If | ||
3418 | // you just want the service response, call the ListBucketMetricsConfigurations method directly | ||
3419 | // instead. | ||
3420 | // | ||
3421 | // Note: You must call the "Send" method on the returned request object in order | ||
3422 | // to execute the request. | ||
3423 | // | ||
3424 | // // Example sending a request using the ListBucketMetricsConfigurationsRequest method. | ||
3425 | // req, resp := client.ListBucketMetricsConfigurationsRequest(params) | ||
3426 | // | ||
3427 | // err := req.Send() | ||
3428 | // if err == nil { // resp is now filled | ||
3429 | // fmt.Println(resp) | ||
3430 | // } | ||
3431 | // | ||
3432 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketMetricsConfigurations | ||
3433 | func (c *S3) ListBucketMetricsConfigurationsRequest(input *ListBucketMetricsConfigurationsInput) (req *request.Request, output *ListBucketMetricsConfigurationsOutput) { | ||
3434 | op := &request.Operation{ | ||
3435 | Name: opListBucketMetricsConfigurations, | ||
3436 | HTTPMethod: "GET", | ||
3437 | HTTPPath: "/{Bucket}?metrics", | ||
3438 | } | ||
3439 | |||
3440 | if input == nil { | ||
3441 | input = &ListBucketMetricsConfigurationsInput{} | ||
3442 | } | ||
3443 | |||
3444 | output = &ListBucketMetricsConfigurationsOutput{} | ||
3445 | req = c.newRequest(op, input, output) | ||
3446 | return | ||
3447 | } | ||
3448 | |||
3449 | // ListBucketMetricsConfigurations API operation for Amazon Simple Storage Service. | ||
3450 | // | ||
3451 | // Lists the metrics configurations for the bucket. | ||
3452 | // | ||
3453 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
3454 | // with awserr.Error's Code and Message methods to get detailed information about | ||
3455 | // the error. | ||
3456 | // | ||
3457 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
3458 | // API operation ListBucketMetricsConfigurations for usage and error information. | ||
3459 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketMetricsConfigurations | ||
3460 | func (c *S3) ListBucketMetricsConfigurations(input *ListBucketMetricsConfigurationsInput) (*ListBucketMetricsConfigurationsOutput, error) { | ||
3461 | req, out := c.ListBucketMetricsConfigurationsRequest(input) | ||
3462 | return out, req.Send() | ||
3463 | } | ||
3464 | |||
3465 | // ListBucketMetricsConfigurationsWithContext is the same as ListBucketMetricsConfigurations with the addition of | ||
3466 | // the ability to pass a context and additional request options. | ||
3467 | // | ||
3468 | // See ListBucketMetricsConfigurations for details on how to use this API operation. | ||
3469 | // | ||
3470 | // The context must be non-nil and will be used for request cancellation. If | ||
3471 | // the context is nil a panic will occur. In the future the SDK may create | ||
3472 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
3473 | // for more information on using Contexts. | ||
3474 | func (c *S3) ListBucketMetricsConfigurationsWithContext(ctx aws.Context, input *ListBucketMetricsConfigurationsInput, opts ...request.Option) (*ListBucketMetricsConfigurationsOutput, error) { | ||
3475 | req, out := c.ListBucketMetricsConfigurationsRequest(input) | ||
3476 | req.SetContext(ctx) | ||
3477 | req.ApplyOptions(opts...) | ||
3478 | return out, req.Send() | ||
3479 | } | ||
3480 | |||
3481 | const opListBuckets = "ListBuckets" | ||
3482 | |||
3483 | // ListBucketsRequest generates a "aws/request.Request" representing the | ||
3484 | // client's request for the ListBuckets operation. The "output" return | ||
3485 | // value can be used to capture response data after the request's "Send" method | ||
3486 | // is called. | ||
3487 | // | ||
3488 | // See ListBuckets for usage and error information. | ||
3489 | // | ||
3490 | // Creating a request object using this method should be used when you want to inject | ||
3491 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
3492 | // access properties on the request object before or after sending the request. If | ||
3493 | // you just want the service response, call the ListBuckets method directly | ||
3494 | // instead. | ||
3495 | // | ||
3496 | // Note: You must call the "Send" method on the returned request object in order | ||
3497 | // to execute the request. | ||
3498 | // | ||
3499 | // // Example sending a request using the ListBucketsRequest method. | ||
3500 | // req, resp := client.ListBucketsRequest(params) | ||
3501 | // | ||
3502 | // err := req.Send() | ||
3503 | // if err == nil { // resp is now filled | ||
3504 | // fmt.Println(resp) | ||
3505 | // } | ||
3506 | // | ||
3507 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBuckets | ||
3508 | func (c *S3) ListBucketsRequest(input *ListBucketsInput) (req *request.Request, output *ListBucketsOutput) { | ||
3509 | op := &request.Operation{ | ||
3510 | Name: opListBuckets, | ||
3511 | HTTPMethod: "GET", | ||
3512 | HTTPPath: "/", | ||
3513 | } | ||
3514 | |||
3515 | if input == nil { | ||
3516 | input = &ListBucketsInput{} | ||
3517 | } | ||
3518 | |||
3519 | output = &ListBucketsOutput{} | ||
3520 | req = c.newRequest(op, input, output) | ||
3521 | return | ||
3522 | } | ||
3523 | |||
3524 | // ListBuckets API operation for Amazon Simple Storage Service. | ||
3525 | // | ||
3526 | // Returns a list of all buckets owned by the authenticated sender of the request. | ||
3527 | // | ||
3528 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
3529 | // with awserr.Error's Code and Message methods to get detailed information about | ||
3530 | // the error. | ||
3531 | // | ||
3532 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
3533 | // API operation ListBuckets for usage and error information. | ||
3534 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBuckets | ||
3535 | func (c *S3) ListBuckets(input *ListBucketsInput) (*ListBucketsOutput, error) { | ||
3536 | req, out := c.ListBucketsRequest(input) | ||
3537 | return out, req.Send() | ||
3538 | } | ||
3539 | |||
3540 | // ListBucketsWithContext is the same as ListBuckets with the addition of | ||
3541 | // the ability to pass a context and additional request options. | ||
3542 | // | ||
3543 | // See ListBuckets for details on how to use this API operation. | ||
3544 | // | ||
3545 | // The context must be non-nil and will be used for request cancellation. If | ||
3546 | // the context is nil a panic will occur. In the future the SDK may create | ||
3547 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
3548 | // for more information on using Contexts. | ||
3549 | func (c *S3) ListBucketsWithContext(ctx aws.Context, input *ListBucketsInput, opts ...request.Option) (*ListBucketsOutput, error) { | ||
3550 | req, out := c.ListBucketsRequest(input) | ||
3551 | req.SetContext(ctx) | ||
3552 | req.ApplyOptions(opts...) | ||
3553 | return out, req.Send() | ||
3554 | } | ||
3555 | |||
3556 | const opListMultipartUploads = "ListMultipartUploads" | ||
3557 | |||
3558 | // ListMultipartUploadsRequest generates a "aws/request.Request" representing the | ||
3559 | // client's request for the ListMultipartUploads operation. The "output" return | ||
3560 | // value can be used to capture response data after the request's "Send" method | ||
3561 | // is called. | ||
3562 | // | ||
3563 | // See ListMultipartUploads for usage and error information. | ||
3564 | // | ||
3565 | // Creating a request object using this method should be used when you want to inject | ||
3566 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
3567 | // access properties on the request object before or after sending the request. If | ||
3568 | // you just want the service response, call the ListMultipartUploads method directly | ||
3569 | // instead. | ||
3570 | // | ||
3571 | // Note: You must call the "Send" method on the returned request object in order | ||
3572 | // to execute the request. | ||
3573 | // | ||
3574 | // // Example sending a request using the ListMultipartUploadsRequest method. | ||
3575 | // req, resp := client.ListMultipartUploadsRequest(params) | ||
3576 | // | ||
3577 | // err := req.Send() | ||
3578 | // if err == nil { // resp is now filled | ||
3579 | // fmt.Println(resp) | ||
3580 | // } | ||
3581 | // | ||
3582 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListMultipartUploads | ||
3583 | func (c *S3) ListMultipartUploadsRequest(input *ListMultipartUploadsInput) (req *request.Request, output *ListMultipartUploadsOutput) { | ||
3584 | op := &request.Operation{ | ||
3585 | Name: opListMultipartUploads, | ||
3586 | HTTPMethod: "GET", | ||
3587 | HTTPPath: "/{Bucket}?uploads", | ||
3588 | Paginator: &request.Paginator{ | ||
3589 | InputTokens: []string{"KeyMarker", "UploadIdMarker"}, | ||
3590 | OutputTokens: []string{"NextKeyMarker", "NextUploadIdMarker"}, | ||
3591 | LimitToken: "MaxUploads", | ||
3592 | TruncationToken: "IsTruncated", | ||
3593 | }, | ||
3594 | } | ||
3595 | |||
3596 | if input == nil { | ||
3597 | input = &ListMultipartUploadsInput{} | ||
3598 | } | ||
3599 | |||
3600 | output = &ListMultipartUploadsOutput{} | ||
3601 | req = c.newRequest(op, input, output) | ||
3602 | return | ||
3603 | } | ||
3604 | |||
3605 | // ListMultipartUploads API operation for Amazon Simple Storage Service. | ||
3606 | // | ||
3607 | // This operation lists in-progress multipart uploads. | ||
3608 | // | ||
3609 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
3610 | // with awserr.Error's Code and Message methods to get detailed information about | ||
3611 | // the error. | ||
3612 | // | ||
3613 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
3614 | // API operation ListMultipartUploads for usage and error information. | ||
3615 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListMultipartUploads | ||
3616 | func (c *S3) ListMultipartUploads(input *ListMultipartUploadsInput) (*ListMultipartUploadsOutput, error) { | ||
3617 | req, out := c.ListMultipartUploadsRequest(input) | ||
3618 | return out, req.Send() | ||
3619 | } | ||
3620 | |||
3621 | // ListMultipartUploadsWithContext is the same as ListMultipartUploads with the addition of | ||
3622 | // the ability to pass a context and additional request options. | ||
3623 | // | ||
3624 | // See ListMultipartUploads for details on how to use this API operation. | ||
3625 | // | ||
3626 | // The context must be non-nil and will be used for request cancellation. If | ||
3627 | // the context is nil a panic will occur. In the future the SDK may create | ||
3628 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
3629 | // for more information on using Contexts. | ||
3630 | func (c *S3) ListMultipartUploadsWithContext(ctx aws.Context, input *ListMultipartUploadsInput, opts ...request.Option) (*ListMultipartUploadsOutput, error) { | ||
3631 | req, out := c.ListMultipartUploadsRequest(input) | ||
3632 | req.SetContext(ctx) | ||
3633 | req.ApplyOptions(opts...) | ||
3634 | return out, req.Send() | ||
3635 | } | ||
3636 | |||
3637 | // ListMultipartUploadsPages iterates over the pages of a ListMultipartUploads operation, | ||
3638 | // calling the "fn" function with the response data for each page. To stop | ||
3639 | // iterating, return false from the fn function. | ||
3640 | // | ||
3641 | // See ListMultipartUploads method for more information on how to use this operation. | ||
3642 | // | ||
3643 | // Note: This operation can generate multiple requests to a service. | ||
3644 | // | ||
3645 | // // Example iterating over at most 3 pages of a ListMultipartUploads operation. | ||
3646 | // pageNum := 0 | ||
3647 | // err := client.ListMultipartUploadsPages(params, | ||
3648 | // func(page *ListMultipartUploadsOutput, lastPage bool) bool { | ||
3649 | // pageNum++ | ||
3650 | // fmt.Println(page) | ||
3651 | // return pageNum <= 3 | ||
3652 | // }) | ||
3653 | // | ||
3654 | func (c *S3) ListMultipartUploadsPages(input *ListMultipartUploadsInput, fn func(*ListMultipartUploadsOutput, bool) bool) error { | ||
3655 | return c.ListMultipartUploadsPagesWithContext(aws.BackgroundContext(), input, fn) | ||
3656 | } | ||
3657 | |||
3658 | // ListMultipartUploadsPagesWithContext same as ListMultipartUploadsPages except | ||
3659 | // it takes a Context and allows setting request options on the pages. | ||
3660 | // | ||
3661 | // The context must be non-nil and will be used for request cancellation. If | ||
3662 | // the context is nil a panic will occur. In the future the SDK may create | ||
3663 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
3664 | // for more information on using Contexts. | ||
3665 | func (c *S3) ListMultipartUploadsPagesWithContext(ctx aws.Context, input *ListMultipartUploadsInput, fn func(*ListMultipartUploadsOutput, bool) bool, opts ...request.Option) error { | ||
3666 | p := request.Pagination{ | ||
3667 | NewRequest: func() (*request.Request, error) { | ||
3668 | var inCpy *ListMultipartUploadsInput | ||
3669 | if input != nil { | ||
3670 | tmp := *input | ||
3671 | inCpy = &tmp | ||
3672 | } | ||
3673 | req, _ := c.ListMultipartUploadsRequest(inCpy) | ||
3674 | req.SetContext(ctx) | ||
3675 | req.ApplyOptions(opts...) | ||
3676 | return req, nil | ||
3677 | }, | ||
3678 | } | ||
3679 | |||
3680 | cont := true | ||
3681 | for p.Next() && cont { | ||
3682 | cont = fn(p.Page().(*ListMultipartUploadsOutput), !p.HasNextPage()) | ||
3683 | } | ||
3684 | return p.Err() | ||
3685 | } | ||
3686 | |||
3687 | const opListObjectVersions = "ListObjectVersions" | ||
3688 | |||
3689 | // ListObjectVersionsRequest generates a "aws/request.Request" representing the | ||
3690 | // client's request for the ListObjectVersions operation. The "output" return | ||
3691 | // value can be used to capture response data after the request's "Send" method | ||
3692 | // is called. | ||
3693 | // | ||
3694 | // See ListObjectVersions for usage and error information. | ||
3695 | // | ||
3696 | // Creating a request object using this method should be used when you want to inject | ||
3697 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
3698 | // access properties on the request object before or after sending the request. If | ||
3699 | // you just want the service response, call the ListObjectVersions method directly | ||
3700 | // instead. | ||
3701 | // | ||
3702 | // Note: You must call the "Send" method on the returned request object in order | ||
3703 | // to execute the request. | ||
3704 | // | ||
3705 | // // Example sending a request using the ListObjectVersionsRequest method. | ||
3706 | // req, resp := client.ListObjectVersionsRequest(params) | ||
3707 | // | ||
3708 | // err := req.Send() | ||
3709 | // if err == nil { // resp is now filled | ||
3710 | // fmt.Println(resp) | ||
3711 | // } | ||
3712 | // | ||
3713 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectVersions | ||
3714 | func (c *S3) ListObjectVersionsRequest(input *ListObjectVersionsInput) (req *request.Request, output *ListObjectVersionsOutput) { | ||
3715 | op := &request.Operation{ | ||
3716 | Name: opListObjectVersions, | ||
3717 | HTTPMethod: "GET", | ||
3718 | HTTPPath: "/{Bucket}?versions", | ||
3719 | Paginator: &request.Paginator{ | ||
3720 | InputTokens: []string{"KeyMarker", "VersionIdMarker"}, | ||
3721 | OutputTokens: []string{"NextKeyMarker", "NextVersionIdMarker"}, | ||
3722 | LimitToken: "MaxKeys", | ||
3723 | TruncationToken: "IsTruncated", | ||
3724 | }, | ||
3725 | } | ||
3726 | |||
3727 | if input == nil { | ||
3728 | input = &ListObjectVersionsInput{} | ||
3729 | } | ||
3730 | |||
3731 | output = &ListObjectVersionsOutput{} | ||
3732 | req = c.newRequest(op, input, output) | ||
3733 | return | ||
3734 | } | ||
3735 | |||
3736 | // ListObjectVersions API operation for Amazon Simple Storage Service. | ||
3737 | // | ||
3738 | // Returns metadata about all of the versions of objects in a bucket. | ||
3739 | // | ||
3740 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
3741 | // with awserr.Error's Code and Message methods to get detailed information about | ||
3742 | // the error. | ||
3743 | // | ||
3744 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
3745 | // API operation ListObjectVersions for usage and error information. | ||
3746 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectVersions | ||
3747 | func (c *S3) ListObjectVersions(input *ListObjectVersionsInput) (*ListObjectVersionsOutput, error) { | ||
3748 | req, out := c.ListObjectVersionsRequest(input) | ||
3749 | return out, req.Send() | ||
3750 | } | ||
3751 | |||
3752 | // ListObjectVersionsWithContext is the same as ListObjectVersions with the addition of | ||
3753 | // the ability to pass a context and additional request options. | ||
3754 | // | ||
3755 | // See ListObjectVersions for details on how to use this API operation. | ||
3756 | // | ||
3757 | // The context must be non-nil and will be used for request cancellation. If | ||
3758 | // the context is nil a panic will occur. In the future the SDK may create | ||
3759 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
3760 | // for more information on using Contexts. | ||
3761 | func (c *S3) ListObjectVersionsWithContext(ctx aws.Context, input *ListObjectVersionsInput, opts ...request.Option) (*ListObjectVersionsOutput, error) { | ||
3762 | req, out := c.ListObjectVersionsRequest(input) | ||
3763 | req.SetContext(ctx) | ||
3764 | req.ApplyOptions(opts...) | ||
3765 | return out, req.Send() | ||
3766 | } | ||
3767 | |||
3768 | // ListObjectVersionsPages iterates over the pages of a ListObjectVersions operation, | ||
3769 | // calling the "fn" function with the response data for each page. To stop | ||
3770 | // iterating, return false from the fn function. | ||
3771 | // | ||
3772 | // See ListObjectVersions method for more information on how to use this operation. | ||
3773 | // | ||
3774 | // Note: This operation can generate multiple requests to a service. | ||
3775 | // | ||
3776 | // // Example iterating over at most 3 pages of a ListObjectVersions operation. | ||
3777 | // pageNum := 0 | ||
3778 | // err := client.ListObjectVersionsPages(params, | ||
3779 | // func(page *ListObjectVersionsOutput, lastPage bool) bool { | ||
3780 | // pageNum++ | ||
3781 | // fmt.Println(page) | ||
3782 | // return pageNum <= 3 | ||
3783 | // }) | ||
3784 | // | ||
3785 | func (c *S3) ListObjectVersionsPages(input *ListObjectVersionsInput, fn func(*ListObjectVersionsOutput, bool) bool) error { | ||
3786 | return c.ListObjectVersionsPagesWithContext(aws.BackgroundContext(), input, fn) | ||
3787 | } | ||
3788 | |||
3789 | // ListObjectVersionsPagesWithContext same as ListObjectVersionsPages except | ||
3790 | // it takes a Context and allows setting request options on the pages. | ||
3791 | // | ||
3792 | // The context must be non-nil and will be used for request cancellation. If | ||
3793 | // the context is nil a panic will occur. In the future the SDK may create | ||
3794 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
3795 | // for more information on using Contexts. | ||
3796 | func (c *S3) ListObjectVersionsPagesWithContext(ctx aws.Context, input *ListObjectVersionsInput, fn func(*ListObjectVersionsOutput, bool) bool, opts ...request.Option) error { | ||
3797 | p := request.Pagination{ | ||
3798 | NewRequest: func() (*request.Request, error) { | ||
3799 | var inCpy *ListObjectVersionsInput | ||
3800 | if input != nil { | ||
3801 | tmp := *input | ||
3802 | inCpy = &tmp | ||
3803 | } | ||
3804 | req, _ := c.ListObjectVersionsRequest(inCpy) | ||
3805 | req.SetContext(ctx) | ||
3806 | req.ApplyOptions(opts...) | ||
3807 | return req, nil | ||
3808 | }, | ||
3809 | } | ||
3810 | |||
3811 | cont := true | ||
3812 | for p.Next() && cont { | ||
3813 | cont = fn(p.Page().(*ListObjectVersionsOutput), !p.HasNextPage()) | ||
3814 | } | ||
3815 | return p.Err() | ||
3816 | } | ||
3817 | |||
3818 | const opListObjects = "ListObjects" | ||
3819 | |||
3820 | // ListObjectsRequest generates a "aws/request.Request" representing the | ||
3821 | // client's request for the ListObjects operation. The "output" return | ||
3822 | // value can be used to capture response data after the request's "Send" method | ||
3823 | // is called. | ||
3824 | // | ||
3825 | // See ListObjects for usage and error information. | ||
3826 | // | ||
3827 | // Creating a request object using this method should be used when you want to inject | ||
3828 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
3829 | // access properties on the request object before or after sending the request. If | ||
3830 | // you just want the service response, call the ListObjects method directly | ||
3831 | // instead. | ||
3832 | // | ||
3833 | // Note: You must call the "Send" method on the returned request object in order | ||
3834 | // to execute the request. | ||
3835 | // | ||
3836 | // // Example sending a request using the ListObjectsRequest method. | ||
3837 | // req, resp := client.ListObjectsRequest(params) | ||
3838 | // | ||
3839 | // err := req.Send() | ||
3840 | // if err == nil { // resp is now filled | ||
3841 | // fmt.Println(resp) | ||
3842 | // } | ||
3843 | // | ||
3844 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjects | ||
3845 | func (c *S3) ListObjectsRequest(input *ListObjectsInput) (req *request.Request, output *ListObjectsOutput) { | ||
3846 | op := &request.Operation{ | ||
3847 | Name: opListObjects, | ||
3848 | HTTPMethod: "GET", | ||
3849 | HTTPPath: "/{Bucket}", | ||
3850 | Paginator: &request.Paginator{ | ||
3851 | InputTokens: []string{"Marker"}, | ||
3852 | OutputTokens: []string{"NextMarker || Contents[-1].Key"}, | ||
3853 | LimitToken: "MaxKeys", | ||
3854 | TruncationToken: "IsTruncated", | ||
3855 | }, | ||
3856 | } | ||
3857 | |||
3858 | if input == nil { | ||
3859 | input = &ListObjectsInput{} | ||
3860 | } | ||
3861 | |||
3862 | output = &ListObjectsOutput{} | ||
3863 | req = c.newRequest(op, input, output) | ||
3864 | return | ||
3865 | } | ||
3866 | |||
3867 | // ListObjects API operation for Amazon Simple Storage Service. | ||
3868 | // | ||
3869 | // Returns some or all (up to 1000) of the objects in a bucket. You can use | ||
3870 | // the request parameters as selection criteria to return a subset of the objects | ||
3871 | // in a bucket. | ||
3872 | // | ||
3873 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
3874 | // with awserr.Error's Code and Message methods to get detailed information about | ||
3875 | // the error. | ||
3876 | // | ||
3877 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
3878 | // API operation ListObjects for usage and error information. | ||
3879 | // | ||
3880 | // Returned Error Codes: | ||
3881 | // * ErrCodeNoSuchBucket "NoSuchBucket" | ||
3882 | // The specified bucket does not exist. | ||
3883 | // | ||
3884 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjects | ||
3885 | func (c *S3) ListObjects(input *ListObjectsInput) (*ListObjectsOutput, error) { | ||
3886 | req, out := c.ListObjectsRequest(input) | ||
3887 | return out, req.Send() | ||
3888 | } | ||
3889 | |||
3890 | // ListObjectsWithContext is the same as ListObjects with the addition of | ||
3891 | // the ability to pass a context and additional request options. | ||
3892 | // | ||
3893 | // See ListObjects for details on how to use this API operation. | ||
3894 | // | ||
3895 | // The context must be non-nil and will be used for request cancellation. If | ||
3896 | // the context is nil a panic will occur. In the future the SDK may create | ||
3897 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
3898 | // for more information on using Contexts. | ||
3899 | func (c *S3) ListObjectsWithContext(ctx aws.Context, input *ListObjectsInput, opts ...request.Option) (*ListObjectsOutput, error) { | ||
3900 | req, out := c.ListObjectsRequest(input) | ||
3901 | req.SetContext(ctx) | ||
3902 | req.ApplyOptions(opts...) | ||
3903 | return out, req.Send() | ||
3904 | } | ||
3905 | |||
3906 | // ListObjectsPages iterates over the pages of a ListObjects operation, | ||
3907 | // calling the "fn" function with the response data for each page. To stop | ||
3908 | // iterating, return false from the fn function. | ||
3909 | // | ||
3910 | // See ListObjects method for more information on how to use this operation. | ||
3911 | // | ||
3912 | // Note: This operation can generate multiple requests to a service. | ||
3913 | // | ||
3914 | // // Example iterating over at most 3 pages of a ListObjects operation. | ||
3915 | // pageNum := 0 | ||
3916 | // err := client.ListObjectsPages(params, | ||
3917 | // func(page *ListObjectsOutput, lastPage bool) bool { | ||
3918 | // pageNum++ | ||
3919 | // fmt.Println(page) | ||
3920 | // return pageNum <= 3 | ||
3921 | // }) | ||
3922 | // | ||
3923 | func (c *S3) ListObjectsPages(input *ListObjectsInput, fn func(*ListObjectsOutput, bool) bool) error { | ||
3924 | return c.ListObjectsPagesWithContext(aws.BackgroundContext(), input, fn) | ||
3925 | } | ||
3926 | |||
3927 | // ListObjectsPagesWithContext same as ListObjectsPages except | ||
3928 | // it takes a Context and allows setting request options on the pages. | ||
3929 | // | ||
3930 | // The context must be non-nil and will be used for request cancellation. If | ||
3931 | // the context is nil a panic will occur. In the future the SDK may create | ||
3932 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
3933 | // for more information on using Contexts. | ||
3934 | func (c *S3) ListObjectsPagesWithContext(ctx aws.Context, input *ListObjectsInput, fn func(*ListObjectsOutput, bool) bool, opts ...request.Option) error { | ||
3935 | p := request.Pagination{ | ||
3936 | NewRequest: func() (*request.Request, error) { | ||
3937 | var inCpy *ListObjectsInput | ||
3938 | if input != nil { | ||
3939 | tmp := *input | ||
3940 | inCpy = &tmp | ||
3941 | } | ||
3942 | req, _ := c.ListObjectsRequest(inCpy) | ||
3943 | req.SetContext(ctx) | ||
3944 | req.ApplyOptions(opts...) | ||
3945 | return req, nil | ||
3946 | }, | ||
3947 | } | ||
3948 | |||
3949 | cont := true | ||
3950 | for p.Next() && cont { | ||
3951 | cont = fn(p.Page().(*ListObjectsOutput), !p.HasNextPage()) | ||
3952 | } | ||
3953 | return p.Err() | ||
3954 | } | ||
3955 | |||
3956 | const opListObjectsV2 = "ListObjectsV2" | ||
3957 | |||
3958 | // ListObjectsV2Request generates a "aws/request.Request" representing the | ||
3959 | // client's request for the ListObjectsV2 operation. The "output" return | ||
3960 | // value can be used to capture response data after the request's "Send" method | ||
3961 | // is called. | ||
3962 | // | ||
3963 | // See ListObjectsV2 for usage and error information. | ||
3964 | // | ||
3965 | // Creating a request object using this method should be used when you want to inject | ||
3966 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
3967 | // access properties on the request object before or after sending the request. If | ||
3968 | // you just want the service response, call the ListObjectsV2 method directly | ||
3969 | // instead. | ||
3970 | // | ||
3971 | // Note: You must call the "Send" method on the returned request object in order | ||
3972 | // to execute the request. | ||
3973 | // | ||
3974 | // // Example sending a request using the ListObjectsV2Request method. | ||
3975 | // req, resp := client.ListObjectsV2Request(params) | ||
3976 | // | ||
3977 | // err := req.Send() | ||
3978 | // if err == nil { // resp is now filled | ||
3979 | // fmt.Println(resp) | ||
3980 | // } | ||
3981 | // | ||
3982 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectsV2 | ||
3983 | func (c *S3) ListObjectsV2Request(input *ListObjectsV2Input) (req *request.Request, output *ListObjectsV2Output) { | ||
3984 | op := &request.Operation{ | ||
3985 | Name: opListObjectsV2, | ||
3986 | HTTPMethod: "GET", | ||
3987 | HTTPPath: "/{Bucket}?list-type=2", | ||
3988 | Paginator: &request.Paginator{ | ||
3989 | InputTokens: []string{"ContinuationToken"}, | ||
3990 | OutputTokens: []string{"NextContinuationToken"}, | ||
3991 | LimitToken: "MaxKeys", | ||
3992 | TruncationToken: "", | ||
3993 | }, | ||
3994 | } | ||
3995 | |||
3996 | if input == nil { | ||
3997 | input = &ListObjectsV2Input{} | ||
3998 | } | ||
3999 | |||
4000 | output = &ListObjectsV2Output{} | ||
4001 | req = c.newRequest(op, input, output) | ||
4002 | return | ||
4003 | } | ||
4004 | |||
4005 | // ListObjectsV2 API operation for Amazon Simple Storage Service. | ||
4006 | // | ||
4007 | // Returns some or all (up to 1000) of the objects in a bucket. You can use | ||
4008 | // the request parameters as selection criteria to return a subset of the objects | ||
4009 | // in a bucket. Note: ListObjectsV2 is the revised List Objects API and we recommend | ||
4010 | // you use this revised API for new application development. | ||
4011 | // | ||
4012 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
4013 | // with awserr.Error's Code and Message methods to get detailed information about | ||
4014 | // the error. | ||
4015 | // | ||
4016 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
4017 | // API operation ListObjectsV2 for usage and error information. | ||
4018 | // | ||
4019 | // Returned Error Codes: | ||
4020 | // * ErrCodeNoSuchBucket "NoSuchBucket" | ||
4021 | // The specified bucket does not exist. | ||
4022 | // | ||
4023 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectsV2 | ||
4024 | func (c *S3) ListObjectsV2(input *ListObjectsV2Input) (*ListObjectsV2Output, error) { | ||
4025 | req, out := c.ListObjectsV2Request(input) | ||
4026 | return out, req.Send() | ||
4027 | } | ||
4028 | |||
4029 | // ListObjectsV2WithContext is the same as ListObjectsV2 with the addition of | ||
4030 | // the ability to pass a context and additional request options. | ||
4031 | // | ||
4032 | // See ListObjectsV2 for details on how to use this API operation. | ||
4033 | // | ||
4034 | // The context must be non-nil and will be used for request cancellation. If | ||
4035 | // the context is nil a panic will occur. In the future the SDK may create | ||
4036 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
4037 | // for more information on using Contexts. | ||
4038 | func (c *S3) ListObjectsV2WithContext(ctx aws.Context, input *ListObjectsV2Input, opts ...request.Option) (*ListObjectsV2Output, error) { | ||
4039 | req, out := c.ListObjectsV2Request(input) | ||
4040 | req.SetContext(ctx) | ||
4041 | req.ApplyOptions(opts...) | ||
4042 | return out, req.Send() | ||
4043 | } | ||
4044 | |||
4045 | // ListObjectsV2Pages iterates over the pages of a ListObjectsV2 operation, | ||
4046 | // calling the "fn" function with the response data for each page. To stop | ||
4047 | // iterating, return false from the fn function. | ||
4048 | // | ||
4049 | // See ListObjectsV2 method for more information on how to use this operation. | ||
4050 | // | ||
4051 | // Note: This operation can generate multiple requests to a service. | ||
4052 | // | ||
4053 | // // Example iterating over at most 3 pages of a ListObjectsV2 operation. | ||
4054 | // pageNum := 0 | ||
4055 | // err := client.ListObjectsV2Pages(params, | ||
4056 | // func(page *ListObjectsV2Output, lastPage bool) bool { | ||
4057 | // pageNum++ | ||
4058 | // fmt.Println(page) | ||
4059 | // return pageNum <= 3 | ||
4060 | // }) | ||
4061 | // | ||
4062 | func (c *S3) ListObjectsV2Pages(input *ListObjectsV2Input, fn func(*ListObjectsV2Output, bool) bool) error { | ||
4063 | return c.ListObjectsV2PagesWithContext(aws.BackgroundContext(), input, fn) | ||
4064 | } | ||
4065 | |||
4066 | // ListObjectsV2PagesWithContext same as ListObjectsV2Pages except | ||
4067 | // it takes a Context and allows setting request options on the pages. | ||
4068 | // | ||
4069 | // The context must be non-nil and will be used for request cancellation. If | ||
4070 | // the context is nil a panic will occur. In the future the SDK may create | ||
4071 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
4072 | // for more information on using Contexts. | ||
4073 | func (c *S3) ListObjectsV2PagesWithContext(ctx aws.Context, input *ListObjectsV2Input, fn func(*ListObjectsV2Output, bool) bool, opts ...request.Option) error { | ||
4074 | p := request.Pagination{ | ||
4075 | NewRequest: func() (*request.Request, error) { | ||
4076 | var inCpy *ListObjectsV2Input | ||
4077 | if input != nil { | ||
4078 | tmp := *input | ||
4079 | inCpy = &tmp | ||
4080 | } | ||
4081 | req, _ := c.ListObjectsV2Request(inCpy) | ||
4082 | req.SetContext(ctx) | ||
4083 | req.ApplyOptions(opts...) | ||
4084 | return req, nil | ||
4085 | }, | ||
4086 | } | ||
4087 | |||
4088 | cont := true | ||
4089 | for p.Next() && cont { | ||
4090 | cont = fn(p.Page().(*ListObjectsV2Output), !p.HasNextPage()) | ||
4091 | } | ||
4092 | return p.Err() | ||
4093 | } | ||
4094 | |||
4095 | const opListParts = "ListParts" | ||
4096 | |||
4097 | // ListPartsRequest generates a "aws/request.Request" representing the | ||
4098 | // client's request for the ListParts operation. The "output" return | ||
4099 | // value can be used to capture response data after the request's "Send" method | ||
4100 | // is called. | ||
4101 | // | ||
4102 | // See ListParts for usage and error information. | ||
4103 | // | ||
4104 | // Creating a request object using this method should be used when you want to inject | ||
4105 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
4106 | // access properties on the request object before or after sending the request. If | ||
4107 | // you just want the service response, call the ListParts method directly | ||
4108 | // instead. | ||
4109 | // | ||
4110 | // Note: You must call the "Send" method on the returned request object in order | ||
4111 | // to execute the request. | ||
4112 | // | ||
4113 | // // Example sending a request using the ListPartsRequest method. | ||
4114 | // req, resp := client.ListPartsRequest(params) | ||
4115 | // | ||
4116 | // err := req.Send() | ||
4117 | // if err == nil { // resp is now filled | ||
4118 | // fmt.Println(resp) | ||
4119 | // } | ||
4120 | // | ||
4121 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListParts | ||
4122 | func (c *S3) ListPartsRequest(input *ListPartsInput) (req *request.Request, output *ListPartsOutput) { | ||
4123 | op := &request.Operation{ | ||
4124 | Name: opListParts, | ||
4125 | HTTPMethod: "GET", | ||
4126 | HTTPPath: "/{Bucket}/{Key+}", | ||
4127 | Paginator: &request.Paginator{ | ||
4128 | InputTokens: []string{"PartNumberMarker"}, | ||
4129 | OutputTokens: []string{"NextPartNumberMarker"}, | ||
4130 | LimitToken: "MaxParts", | ||
4131 | TruncationToken: "IsTruncated", | ||
4132 | }, | ||
4133 | } | ||
4134 | |||
4135 | if input == nil { | ||
4136 | input = &ListPartsInput{} | ||
4137 | } | ||
4138 | |||
4139 | output = &ListPartsOutput{} | ||
4140 | req = c.newRequest(op, input, output) | ||
4141 | return | ||
4142 | } | ||
4143 | |||
4144 | // ListParts API operation for Amazon Simple Storage Service. | ||
4145 | // | ||
4146 | // Lists the parts that have been uploaded for a specific multipart upload. | ||
4147 | // | ||
4148 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
4149 | // with awserr.Error's Code and Message methods to get detailed information about | ||
4150 | // the error. | ||
4151 | // | ||
4152 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
4153 | // API operation ListParts for usage and error information. | ||
4154 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListParts | ||
4155 | func (c *S3) ListParts(input *ListPartsInput) (*ListPartsOutput, error) { | ||
4156 | req, out := c.ListPartsRequest(input) | ||
4157 | return out, req.Send() | ||
4158 | } | ||
4159 | |||
4160 | // ListPartsWithContext is the same as ListParts with the addition of | ||
4161 | // the ability to pass a context and additional request options. | ||
4162 | // | ||
4163 | // See ListParts for details on how to use this API operation. | ||
4164 | // | ||
4165 | // The context must be non-nil and will be used for request cancellation. If | ||
4166 | // the context is nil a panic will occur. In the future the SDK may create | ||
4167 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
4168 | // for more information on using Contexts. | ||
4169 | func (c *S3) ListPartsWithContext(ctx aws.Context, input *ListPartsInput, opts ...request.Option) (*ListPartsOutput, error) { | ||
4170 | req, out := c.ListPartsRequest(input) | ||
4171 | req.SetContext(ctx) | ||
4172 | req.ApplyOptions(opts...) | ||
4173 | return out, req.Send() | ||
4174 | } | ||
4175 | |||
4176 | // ListPartsPages iterates over the pages of a ListParts operation, | ||
4177 | // calling the "fn" function with the response data for each page. To stop | ||
4178 | // iterating, return false from the fn function. | ||
4179 | // | ||
4180 | // See ListParts method for more information on how to use this operation. | ||
4181 | // | ||
4182 | // Note: This operation can generate multiple requests to a service. | ||
4183 | // | ||
4184 | // // Example iterating over at most 3 pages of a ListParts operation. | ||
4185 | // pageNum := 0 | ||
4186 | // err := client.ListPartsPages(params, | ||
4187 | // func(page *ListPartsOutput, lastPage bool) bool { | ||
4188 | // pageNum++ | ||
4189 | // fmt.Println(page) | ||
4190 | // return pageNum <= 3 | ||
4191 | // }) | ||
4192 | // | ||
4193 | func (c *S3) ListPartsPages(input *ListPartsInput, fn func(*ListPartsOutput, bool) bool) error { | ||
4194 | return c.ListPartsPagesWithContext(aws.BackgroundContext(), input, fn) | ||
4195 | } | ||
4196 | |||
4197 | // ListPartsPagesWithContext same as ListPartsPages except | ||
4198 | // it takes a Context and allows setting request options on the pages. | ||
4199 | // | ||
4200 | // The context must be non-nil and will be used for request cancellation. If | ||
4201 | // the context is nil a panic will occur. In the future the SDK may create | ||
4202 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
4203 | // for more information on using Contexts. | ||
4204 | func (c *S3) ListPartsPagesWithContext(ctx aws.Context, input *ListPartsInput, fn func(*ListPartsOutput, bool) bool, opts ...request.Option) error { | ||
4205 | p := request.Pagination{ | ||
4206 | NewRequest: func() (*request.Request, error) { | ||
4207 | var inCpy *ListPartsInput | ||
4208 | if input != nil { | ||
4209 | tmp := *input | ||
4210 | inCpy = &tmp | ||
4211 | } | ||
4212 | req, _ := c.ListPartsRequest(inCpy) | ||
4213 | req.SetContext(ctx) | ||
4214 | req.ApplyOptions(opts...) | ||
4215 | return req, nil | ||
4216 | }, | ||
4217 | } | ||
4218 | |||
4219 | cont := true | ||
4220 | for p.Next() && cont { | ||
4221 | cont = fn(p.Page().(*ListPartsOutput), !p.HasNextPage()) | ||
4222 | } | ||
4223 | return p.Err() | ||
4224 | } | ||
4225 | |||
4226 | const opPutBucketAccelerateConfiguration = "PutBucketAccelerateConfiguration" | ||
4227 | |||
4228 | // PutBucketAccelerateConfigurationRequest generates a "aws/request.Request" representing the | ||
4229 | // client's request for the PutBucketAccelerateConfiguration operation. The "output" return | ||
4230 | // value can be used to capture response data after the request's "Send" method | ||
4231 | // is called. | ||
4232 | // | ||
4233 | // See PutBucketAccelerateConfiguration for usage and error information. | ||
4234 | // | ||
4235 | // Creating a request object using this method should be used when you want to inject | ||
4236 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
4237 | // access properties on the request object before or after sending the request. If | ||
4238 | // you just want the service response, call the PutBucketAccelerateConfiguration method directly | ||
4239 | // instead. | ||
4240 | // | ||
4241 | // Note: You must call the "Send" method on the returned request object in order | ||
4242 | // to execute the request. | ||
4243 | // | ||
4244 | // // Example sending a request using the PutBucketAccelerateConfigurationRequest method. | ||
4245 | // req, resp := client.PutBucketAccelerateConfigurationRequest(params) | ||
4246 | // | ||
4247 | // err := req.Send() | ||
4248 | // if err == nil { // resp is now filled | ||
4249 | // fmt.Println(resp) | ||
4250 | // } | ||
4251 | // | ||
4252 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAccelerateConfiguration | ||
4253 | func (c *S3) PutBucketAccelerateConfigurationRequest(input *PutBucketAccelerateConfigurationInput) (req *request.Request, output *PutBucketAccelerateConfigurationOutput) { | ||
4254 | op := &request.Operation{ | ||
4255 | Name: opPutBucketAccelerateConfiguration, | ||
4256 | HTTPMethod: "PUT", | ||
4257 | HTTPPath: "/{Bucket}?accelerate", | ||
4258 | } | ||
4259 | |||
4260 | if input == nil { | ||
4261 | input = &PutBucketAccelerateConfigurationInput{} | ||
4262 | } | ||
4263 | |||
4264 | output = &PutBucketAccelerateConfigurationOutput{} | ||
4265 | req = c.newRequest(op, input, output) | ||
4266 | req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) | ||
4267 | req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) | ||
4268 | return | ||
4269 | } | ||
4270 | |||
4271 | // PutBucketAccelerateConfiguration API operation for Amazon Simple Storage Service. | ||
4272 | // | ||
4273 | // Sets the accelerate configuration of an existing bucket. | ||
4274 | // | ||
4275 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
4276 | // with awserr.Error's Code and Message methods to get detailed information about | ||
4277 | // the error. | ||
4278 | // | ||
4279 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
4280 | // API operation PutBucketAccelerateConfiguration for usage and error information. | ||
4281 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAccelerateConfiguration | ||
4282 | func (c *S3) PutBucketAccelerateConfiguration(input *PutBucketAccelerateConfigurationInput) (*PutBucketAccelerateConfigurationOutput, error) { | ||
4283 | req, out := c.PutBucketAccelerateConfigurationRequest(input) | ||
4284 | return out, req.Send() | ||
4285 | } | ||
4286 | |||
4287 | // PutBucketAccelerateConfigurationWithContext is the same as PutBucketAccelerateConfiguration with the addition of | ||
4288 | // the ability to pass a context and additional request options. | ||
4289 | // | ||
4290 | // See PutBucketAccelerateConfiguration for details on how to use this API operation. | ||
4291 | // | ||
4292 | // The context must be non-nil and will be used for request cancellation. If | ||
4293 | // the context is nil a panic will occur. In the future the SDK may create | ||
4294 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
4295 | // for more information on using Contexts. | ||
4296 | func (c *S3) PutBucketAccelerateConfigurationWithContext(ctx aws.Context, input *PutBucketAccelerateConfigurationInput, opts ...request.Option) (*PutBucketAccelerateConfigurationOutput, error) { | ||
4297 | req, out := c.PutBucketAccelerateConfigurationRequest(input) | ||
4298 | req.SetContext(ctx) | ||
4299 | req.ApplyOptions(opts...) | ||
4300 | return out, req.Send() | ||
4301 | } | ||
4302 | |||
4303 | const opPutBucketAcl = "PutBucketAcl" | ||
4304 | |||
4305 | // PutBucketAclRequest generates a "aws/request.Request" representing the | ||
4306 | // client's request for the PutBucketAcl operation. The "output" return | ||
4307 | // value can be used to capture response data after the request's "Send" method | ||
4308 | // is called. | ||
4309 | // | ||
4310 | // See PutBucketAcl for usage and error information. | ||
4311 | // | ||
4312 | // Creating a request object using this method should be used when you want to inject | ||
4313 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
4314 | // access properties on the request object before or after sending the request. If | ||
4315 | // you just want the service response, call the PutBucketAcl method directly | ||
4316 | // instead. | ||
4317 | // | ||
4318 | // Note: You must call the "Send" method on the returned request object in order | ||
4319 | // to execute the request. | ||
4320 | // | ||
4321 | // // Example sending a request using the PutBucketAclRequest method. | ||
4322 | // req, resp := client.PutBucketAclRequest(params) | ||
4323 | // | ||
4324 | // err := req.Send() | ||
4325 | // if err == nil { // resp is now filled | ||
4326 | // fmt.Println(resp) | ||
4327 | // } | ||
4328 | // | ||
4329 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAcl | ||
4330 | func (c *S3) PutBucketAclRequest(input *PutBucketAclInput) (req *request.Request, output *PutBucketAclOutput) { | ||
4331 | op := &request.Operation{ | ||
4332 | Name: opPutBucketAcl, | ||
4333 | HTTPMethod: "PUT", | ||
4334 | HTTPPath: "/{Bucket}?acl", | ||
4335 | } | ||
4336 | |||
4337 | if input == nil { | ||
4338 | input = &PutBucketAclInput{} | ||
4339 | } | ||
4340 | |||
4341 | output = &PutBucketAclOutput{} | ||
4342 | req = c.newRequest(op, input, output) | ||
4343 | req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) | ||
4344 | req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) | ||
4345 | return | ||
4346 | } | ||
4347 | |||
4348 | // PutBucketAcl API operation for Amazon Simple Storage Service. | ||
4349 | // | ||
4350 | // Sets the permissions on a bucket using access control lists (ACL). | ||
4351 | // | ||
4352 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
4353 | // with awserr.Error's Code and Message methods to get detailed information about | ||
4354 | // the error. | ||
4355 | // | ||
4356 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
4357 | // API operation PutBucketAcl for usage and error information. | ||
4358 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAcl | ||
4359 | func (c *S3) PutBucketAcl(input *PutBucketAclInput) (*PutBucketAclOutput, error) { | ||
4360 | req, out := c.PutBucketAclRequest(input) | ||
4361 | return out, req.Send() | ||
4362 | } | ||
4363 | |||
4364 | // PutBucketAclWithContext is the same as PutBucketAcl with the addition of | ||
4365 | // the ability to pass a context and additional request options. | ||
4366 | // | ||
4367 | // See PutBucketAcl for details on how to use this API operation. | ||
4368 | // | ||
4369 | // The context must be non-nil and will be used for request cancellation. If | ||
4370 | // the context is nil a panic will occur. In the future the SDK may create | ||
4371 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
4372 | // for more information on using Contexts. | ||
4373 | func (c *S3) PutBucketAclWithContext(ctx aws.Context, input *PutBucketAclInput, opts ...request.Option) (*PutBucketAclOutput, error) { | ||
4374 | req, out := c.PutBucketAclRequest(input) | ||
4375 | req.SetContext(ctx) | ||
4376 | req.ApplyOptions(opts...) | ||
4377 | return out, req.Send() | ||
4378 | } | ||
4379 | |||
4380 | const opPutBucketAnalyticsConfiguration = "PutBucketAnalyticsConfiguration" | ||
4381 | |||
4382 | // PutBucketAnalyticsConfigurationRequest generates a "aws/request.Request" representing the | ||
4383 | // client's request for the PutBucketAnalyticsConfiguration operation. The "output" return | ||
4384 | // value can be used to capture response data after the request's "Send" method | ||
4385 | // is called. | ||
4386 | // | ||
4387 | // See PutBucketAnalyticsConfiguration for usage and error information. | ||
4388 | // | ||
4389 | // Creating a request object using this method should be used when you want to inject | ||
4390 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
4391 | // access properties on the request object before or after sending the request. If | ||
4392 | // you just want the service response, call the PutBucketAnalyticsConfiguration method directly | ||
4393 | // instead. | ||
4394 | // | ||
4395 | // Note: You must call the "Send" method on the returned request object in order | ||
4396 | // to execute the request. | ||
4397 | // | ||
4398 | // // Example sending a request using the PutBucketAnalyticsConfigurationRequest method. | ||
4399 | // req, resp := client.PutBucketAnalyticsConfigurationRequest(params) | ||
4400 | // | ||
4401 | // err := req.Send() | ||
4402 | // if err == nil { // resp is now filled | ||
4403 | // fmt.Println(resp) | ||
4404 | // } | ||
4405 | // | ||
4406 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAnalyticsConfiguration | ||
4407 | func (c *S3) PutBucketAnalyticsConfigurationRequest(input *PutBucketAnalyticsConfigurationInput) (req *request.Request, output *PutBucketAnalyticsConfigurationOutput) { | ||
4408 | op := &request.Operation{ | ||
4409 | Name: opPutBucketAnalyticsConfiguration, | ||
4410 | HTTPMethod: "PUT", | ||
4411 | HTTPPath: "/{Bucket}?analytics", | ||
4412 | } | ||
4413 | |||
4414 | if input == nil { | ||
4415 | input = &PutBucketAnalyticsConfigurationInput{} | ||
4416 | } | ||
4417 | |||
4418 | output = &PutBucketAnalyticsConfigurationOutput{} | ||
4419 | req = c.newRequest(op, input, output) | ||
4420 | req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) | ||
4421 | req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) | ||
4422 | return | ||
4423 | } | ||
4424 | |||
4425 | // PutBucketAnalyticsConfiguration API operation for Amazon Simple Storage Service. | ||
4426 | // | ||
4427 | // Sets an analytics configuration for the bucket (specified by the analytics | ||
4428 | // configuration ID). | ||
4429 | // | ||
4430 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
4431 | // with awserr.Error's Code and Message methods to get detailed information about | ||
4432 | // the error. | ||
4433 | // | ||
4434 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
4435 | // API operation PutBucketAnalyticsConfiguration for usage and error information. | ||
4436 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAnalyticsConfiguration | ||
4437 | func (c *S3) PutBucketAnalyticsConfiguration(input *PutBucketAnalyticsConfigurationInput) (*PutBucketAnalyticsConfigurationOutput, error) { | ||
4438 | req, out := c.PutBucketAnalyticsConfigurationRequest(input) | ||
4439 | return out, req.Send() | ||
4440 | } | ||
4441 | |||
4442 | // PutBucketAnalyticsConfigurationWithContext is the same as PutBucketAnalyticsConfiguration with the addition of | ||
4443 | // the ability to pass a context and additional request options. | ||
4444 | // | ||
4445 | // See PutBucketAnalyticsConfiguration for details on how to use this API operation. | ||
4446 | // | ||
4447 | // The context must be non-nil and will be used for request cancellation. If | ||
4448 | // the context is nil a panic will occur. In the future the SDK may create | ||
4449 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
4450 | // for more information on using Contexts. | ||
4451 | func (c *S3) PutBucketAnalyticsConfigurationWithContext(ctx aws.Context, input *PutBucketAnalyticsConfigurationInput, opts ...request.Option) (*PutBucketAnalyticsConfigurationOutput, error) { | ||
4452 | req, out := c.PutBucketAnalyticsConfigurationRequest(input) | ||
4453 | req.SetContext(ctx) | ||
4454 | req.ApplyOptions(opts...) | ||
4455 | return out, req.Send() | ||
4456 | } | ||
4457 | |||
4458 | const opPutBucketCors = "PutBucketCors" | ||
4459 | |||
4460 | // PutBucketCorsRequest generates a "aws/request.Request" representing the | ||
4461 | // client's request for the PutBucketCors operation. The "output" return | ||
4462 | // value can be used to capture response data after the request's "Send" method | ||
4463 | // is called. | ||
4464 | // | ||
4465 | // See PutBucketCors for usage and error information. | ||
4466 | // | ||
4467 | // Creating a request object using this method should be used when you want to inject | ||
4468 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
4469 | // access properties on the request object before or after sending the request. If | ||
4470 | // you just want the service response, call the PutBucketCors method directly | ||
4471 | // instead. | ||
4472 | // | ||
4473 | // Note: You must call the "Send" method on the returned request object in order | ||
4474 | // to execute the request. | ||
4475 | // | ||
4476 | // // Example sending a request using the PutBucketCorsRequest method. | ||
4477 | // req, resp := client.PutBucketCorsRequest(params) | ||
4478 | // | ||
4479 | // err := req.Send() | ||
4480 | // if err == nil { // resp is now filled | ||
4481 | // fmt.Println(resp) | ||
4482 | // } | ||
4483 | // | ||
4484 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketCors | ||
4485 | func (c *S3) PutBucketCorsRequest(input *PutBucketCorsInput) (req *request.Request, output *PutBucketCorsOutput) { | ||
4486 | op := &request.Operation{ | ||
4487 | Name: opPutBucketCors, | ||
4488 | HTTPMethod: "PUT", | ||
4489 | HTTPPath: "/{Bucket}?cors", | ||
4490 | } | ||
4491 | |||
4492 | if input == nil { | ||
4493 | input = &PutBucketCorsInput{} | ||
4494 | } | ||
4495 | |||
4496 | output = &PutBucketCorsOutput{} | ||
4497 | req = c.newRequest(op, input, output) | ||
4498 | req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) | ||
4499 | req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) | ||
4500 | return | ||
4501 | } | ||
4502 | |||
4503 | // PutBucketCors API operation for Amazon Simple Storage Service. | ||
4504 | // | ||
4505 | // Sets the cors configuration for a bucket. | ||
4506 | // | ||
4507 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
4508 | // with awserr.Error's Code and Message methods to get detailed information about | ||
4509 | // the error. | ||
4510 | // | ||
4511 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
4512 | // API operation PutBucketCors for usage and error information. | ||
4513 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketCors | ||
4514 | func (c *S3) PutBucketCors(input *PutBucketCorsInput) (*PutBucketCorsOutput, error) { | ||
4515 | req, out := c.PutBucketCorsRequest(input) | ||
4516 | return out, req.Send() | ||
4517 | } | ||
4518 | |||
4519 | // PutBucketCorsWithContext is the same as PutBucketCors with the addition of | ||
4520 | // the ability to pass a context and additional request options. | ||
4521 | // | ||
4522 | // See PutBucketCors for details on how to use this API operation. | ||
4523 | // | ||
4524 | // The context must be non-nil and will be used for request cancellation. If | ||
4525 | // the context is nil a panic will occur. In the future the SDK may create | ||
4526 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
4527 | // for more information on using Contexts. | ||
4528 | func (c *S3) PutBucketCorsWithContext(ctx aws.Context, input *PutBucketCorsInput, opts ...request.Option) (*PutBucketCorsOutput, error) { | ||
4529 | req, out := c.PutBucketCorsRequest(input) | ||
4530 | req.SetContext(ctx) | ||
4531 | req.ApplyOptions(opts...) | ||
4532 | return out, req.Send() | ||
4533 | } | ||
4534 | |||
4535 | const opPutBucketInventoryConfiguration = "PutBucketInventoryConfiguration" | ||
4536 | |||
4537 | // PutBucketInventoryConfigurationRequest generates a "aws/request.Request" representing the | ||
4538 | // client's request for the PutBucketInventoryConfiguration operation. The "output" return | ||
4539 | // value can be used to capture response data after the request's "Send" method | ||
4540 | // is called. | ||
4541 | // | ||
4542 | // See PutBucketInventoryConfiguration for usage and error information. | ||
4543 | // | ||
4544 | // Creating a request object using this method should be used when you want to inject | ||
4545 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
4546 | // access properties on the request object before or after sending the request. If | ||
4547 | // you just want the service response, call the PutBucketInventoryConfiguration method directly | ||
4548 | // instead. | ||
4549 | // | ||
4550 | // Note: You must call the "Send" method on the returned request object in order | ||
4551 | // to execute the request. | ||
4552 | // | ||
4553 | // // Example sending a request using the PutBucketInventoryConfigurationRequest method. | ||
4554 | // req, resp := client.PutBucketInventoryConfigurationRequest(params) | ||
4555 | // | ||
4556 | // err := req.Send() | ||
4557 | // if err == nil { // resp is now filled | ||
4558 | // fmt.Println(resp) | ||
4559 | // } | ||
4560 | // | ||
4561 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketInventoryConfiguration | ||
4562 | func (c *S3) PutBucketInventoryConfigurationRequest(input *PutBucketInventoryConfigurationInput) (req *request.Request, output *PutBucketInventoryConfigurationOutput) { | ||
4563 | op := &request.Operation{ | ||
4564 | Name: opPutBucketInventoryConfiguration, | ||
4565 | HTTPMethod: "PUT", | ||
4566 | HTTPPath: "/{Bucket}?inventory", | ||
4567 | } | ||
4568 | |||
4569 | if input == nil { | ||
4570 | input = &PutBucketInventoryConfigurationInput{} | ||
4571 | } | ||
4572 | |||
4573 | output = &PutBucketInventoryConfigurationOutput{} | ||
4574 | req = c.newRequest(op, input, output) | ||
4575 | req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) | ||
4576 | req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) | ||
4577 | return | ||
4578 | } | ||
4579 | |||
4580 | // PutBucketInventoryConfiguration API operation for Amazon Simple Storage Service. | ||
4581 | // | ||
4582 | // Adds an inventory configuration (identified by the inventory ID) from the | ||
4583 | // bucket. | ||
4584 | // | ||
4585 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
4586 | // with awserr.Error's Code and Message methods to get detailed information about | ||
4587 | // the error. | ||
4588 | // | ||
4589 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
4590 | // API operation PutBucketInventoryConfiguration for usage and error information. | ||
4591 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketInventoryConfiguration | ||
4592 | func (c *S3) PutBucketInventoryConfiguration(input *PutBucketInventoryConfigurationInput) (*PutBucketInventoryConfigurationOutput, error) { | ||
4593 | req, out := c.PutBucketInventoryConfigurationRequest(input) | ||
4594 | return out, req.Send() | ||
4595 | } | ||
4596 | |||
4597 | // PutBucketInventoryConfigurationWithContext is the same as PutBucketInventoryConfiguration with the addition of | ||
4598 | // the ability to pass a context and additional request options. | ||
4599 | // | ||
4600 | // See PutBucketInventoryConfiguration for details on how to use this API operation. | ||
4601 | // | ||
4602 | // The context must be non-nil and will be used for request cancellation. If | ||
4603 | // the context is nil a panic will occur. In the future the SDK may create | ||
4604 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
4605 | // for more information on using Contexts. | ||
4606 | func (c *S3) PutBucketInventoryConfigurationWithContext(ctx aws.Context, input *PutBucketInventoryConfigurationInput, opts ...request.Option) (*PutBucketInventoryConfigurationOutput, error) { | ||
4607 | req, out := c.PutBucketInventoryConfigurationRequest(input) | ||
4608 | req.SetContext(ctx) | ||
4609 | req.ApplyOptions(opts...) | ||
4610 | return out, req.Send() | ||
4611 | } | ||
4612 | |||
4613 | const opPutBucketLifecycle = "PutBucketLifecycle" | ||
4614 | |||
4615 | // PutBucketLifecycleRequest generates a "aws/request.Request" representing the | ||
4616 | // client's request for the PutBucketLifecycle operation. The "output" return | ||
4617 | // value can be used to capture response data after the request's "Send" method | ||
4618 | // is called. | ||
4619 | // | ||
4620 | // See PutBucketLifecycle for usage and error information. | ||
4621 | // | ||
4622 | // Creating a request object using this method should be used when you want to inject | ||
4623 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
4624 | // access properties on the request object before or after sending the request. If | ||
4625 | // you just want the service response, call the PutBucketLifecycle method directly | ||
4626 | // instead. | ||
4627 | // | ||
4628 | // Note: You must call the "Send" method on the returned request object in order | ||
4629 | // to execute the request. | ||
4630 | // | ||
4631 | // // Example sending a request using the PutBucketLifecycleRequest method. | ||
4632 | // req, resp := client.PutBucketLifecycleRequest(params) | ||
4633 | // | ||
4634 | // err := req.Send() | ||
4635 | // if err == nil { // resp is now filled | ||
4636 | // fmt.Println(resp) | ||
4637 | // } | ||
4638 | // | ||
4639 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLifecycle | ||
4640 | func (c *S3) PutBucketLifecycleRequest(input *PutBucketLifecycleInput) (req *request.Request, output *PutBucketLifecycleOutput) { | ||
4641 | if c.Client.Config.Logger != nil { | ||
4642 | c.Client.Config.Logger.Log("This operation, PutBucketLifecycle, has been deprecated") | ||
4643 | } | ||
4644 | op := &request.Operation{ | ||
4645 | Name: opPutBucketLifecycle, | ||
4646 | HTTPMethod: "PUT", | ||
4647 | HTTPPath: "/{Bucket}?lifecycle", | ||
4648 | } | ||
4649 | |||
4650 | if input == nil { | ||
4651 | input = &PutBucketLifecycleInput{} | ||
4652 | } | ||
4653 | |||
4654 | output = &PutBucketLifecycleOutput{} | ||
4655 | req = c.newRequest(op, input, output) | ||
4656 | req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) | ||
4657 | req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) | ||
4658 | return | ||
4659 | } | ||
4660 | |||
4661 | // PutBucketLifecycle API operation for Amazon Simple Storage Service. | ||
4662 | // | ||
4663 | // Deprecated, see the PutBucketLifecycleConfiguration operation. | ||
4664 | // | ||
4665 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
4666 | // with awserr.Error's Code and Message methods to get detailed information about | ||
4667 | // the error. | ||
4668 | // | ||
4669 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
4670 | // API operation PutBucketLifecycle for usage and error information. | ||
4671 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLifecycle | ||
4672 | func (c *S3) PutBucketLifecycle(input *PutBucketLifecycleInput) (*PutBucketLifecycleOutput, error) { | ||
4673 | req, out := c.PutBucketLifecycleRequest(input) | ||
4674 | return out, req.Send() | ||
4675 | } | ||
4676 | |||
4677 | // PutBucketLifecycleWithContext is the same as PutBucketLifecycle with the addition of | ||
4678 | // the ability to pass a context and additional request options. | ||
4679 | // | ||
4680 | // See PutBucketLifecycle for details on how to use this API operation. | ||
4681 | // | ||
4682 | // The context must be non-nil and will be used for request cancellation. If | ||
4683 | // the context is nil a panic will occur. In the future the SDK may create | ||
4684 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
4685 | // for more information on using Contexts. | ||
4686 | func (c *S3) PutBucketLifecycleWithContext(ctx aws.Context, input *PutBucketLifecycleInput, opts ...request.Option) (*PutBucketLifecycleOutput, error) { | ||
4687 | req, out := c.PutBucketLifecycleRequest(input) | ||
4688 | req.SetContext(ctx) | ||
4689 | req.ApplyOptions(opts...) | ||
4690 | return out, req.Send() | ||
4691 | } | ||
4692 | |||
4693 | const opPutBucketLifecycleConfiguration = "PutBucketLifecycleConfiguration" | ||
4694 | |||
4695 | // PutBucketLifecycleConfigurationRequest generates a "aws/request.Request" representing the | ||
4696 | // client's request for the PutBucketLifecycleConfiguration operation. The "output" return | ||
4697 | // value can be used to capture response data after the request's "Send" method | ||
4698 | // is called. | ||
4699 | // | ||
4700 | // See PutBucketLifecycleConfiguration for usage and error information. | ||
4701 | // | ||
4702 | // Creating a request object using this method should be used when you want to inject | ||
4703 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
4704 | // access properties on the request object before or after sending the request. If | ||
4705 | // you just want the service response, call the PutBucketLifecycleConfiguration method directly | ||
4706 | // instead. | ||
4707 | // | ||
4708 | // Note: You must call the "Send" method on the returned request object in order | ||
4709 | // to execute the request. | ||
4710 | // | ||
4711 | // // Example sending a request using the PutBucketLifecycleConfigurationRequest method. | ||
4712 | // req, resp := client.PutBucketLifecycleConfigurationRequest(params) | ||
4713 | // | ||
4714 | // err := req.Send() | ||
4715 | // if err == nil { // resp is now filled | ||
4716 | // fmt.Println(resp) | ||
4717 | // } | ||
4718 | // | ||
4719 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLifecycleConfiguration | ||
4720 | func (c *S3) PutBucketLifecycleConfigurationRequest(input *PutBucketLifecycleConfigurationInput) (req *request.Request, output *PutBucketLifecycleConfigurationOutput) { | ||
4721 | op := &request.Operation{ | ||
4722 | Name: opPutBucketLifecycleConfiguration, | ||
4723 | HTTPMethod: "PUT", | ||
4724 | HTTPPath: "/{Bucket}?lifecycle", | ||
4725 | } | ||
4726 | |||
4727 | if input == nil { | ||
4728 | input = &PutBucketLifecycleConfigurationInput{} | ||
4729 | } | ||
4730 | |||
4731 | output = &PutBucketLifecycleConfigurationOutput{} | ||
4732 | req = c.newRequest(op, input, output) | ||
4733 | req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) | ||
4734 | req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) | ||
4735 | return | ||
4736 | } | ||
4737 | |||
4738 | // PutBucketLifecycleConfiguration API operation for Amazon Simple Storage Service. | ||
4739 | // | ||
4740 | // Sets lifecycle configuration for your bucket. If a lifecycle configuration | ||
4741 | // exists, it replaces it. | ||
4742 | // | ||
4743 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
4744 | // with awserr.Error's Code and Message methods to get detailed information about | ||
4745 | // the error. | ||
4746 | // | ||
4747 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
4748 | // API operation PutBucketLifecycleConfiguration for usage and error information. | ||
4749 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLifecycleConfiguration | ||
4750 | func (c *S3) PutBucketLifecycleConfiguration(input *PutBucketLifecycleConfigurationInput) (*PutBucketLifecycleConfigurationOutput, error) { | ||
4751 | req, out := c.PutBucketLifecycleConfigurationRequest(input) | ||
4752 | return out, req.Send() | ||
4753 | } | ||
4754 | |||
4755 | // PutBucketLifecycleConfigurationWithContext is the same as PutBucketLifecycleConfiguration with the addition of | ||
4756 | // the ability to pass a context and additional request options. | ||
4757 | // | ||
4758 | // See PutBucketLifecycleConfiguration for details on how to use this API operation. | ||
4759 | // | ||
4760 | // The context must be non-nil and will be used for request cancellation. If | ||
4761 | // the context is nil a panic will occur. In the future the SDK may create | ||
4762 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
4763 | // for more information on using Contexts. | ||
4764 | func (c *S3) PutBucketLifecycleConfigurationWithContext(ctx aws.Context, input *PutBucketLifecycleConfigurationInput, opts ...request.Option) (*PutBucketLifecycleConfigurationOutput, error) { | ||
4765 | req, out := c.PutBucketLifecycleConfigurationRequest(input) | ||
4766 | req.SetContext(ctx) | ||
4767 | req.ApplyOptions(opts...) | ||
4768 | return out, req.Send() | ||
4769 | } | ||
4770 | |||
4771 | const opPutBucketLogging = "PutBucketLogging" | ||
4772 | |||
4773 | // PutBucketLoggingRequest generates a "aws/request.Request" representing the | ||
4774 | // client's request for the PutBucketLogging operation. The "output" return | ||
4775 | // value can be used to capture response data after the request's "Send" method | ||
4776 | // is called. | ||
4777 | // | ||
4778 | // See PutBucketLogging for usage and error information. | ||
4779 | // | ||
4780 | // Creating a request object using this method should be used when you want to inject | ||
4781 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
4782 | // access properties on the request object before or after sending the request. If | ||
4783 | // you just want the service response, call the PutBucketLogging method directly | ||
4784 | // instead. | ||
4785 | // | ||
4786 | // Note: You must call the "Send" method on the returned request object in order | ||
4787 | // to execute the request. | ||
4788 | // | ||
4789 | // // Example sending a request using the PutBucketLoggingRequest method. | ||
4790 | // req, resp := client.PutBucketLoggingRequest(params) | ||
4791 | // | ||
4792 | // err := req.Send() | ||
4793 | // if err == nil { // resp is now filled | ||
4794 | // fmt.Println(resp) | ||
4795 | // } | ||
4796 | // | ||
4797 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLogging | ||
4798 | func (c *S3) PutBucketLoggingRequest(input *PutBucketLoggingInput) (req *request.Request, output *PutBucketLoggingOutput) { | ||
4799 | op := &request.Operation{ | ||
4800 | Name: opPutBucketLogging, | ||
4801 | HTTPMethod: "PUT", | ||
4802 | HTTPPath: "/{Bucket}?logging", | ||
4803 | } | ||
4804 | |||
4805 | if input == nil { | ||
4806 | input = &PutBucketLoggingInput{} | ||
4807 | } | ||
4808 | |||
4809 | output = &PutBucketLoggingOutput{} | ||
4810 | req = c.newRequest(op, input, output) | ||
4811 | req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) | ||
4812 | req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) | ||
4813 | return | ||
4814 | } | ||
4815 | |||
4816 | // PutBucketLogging API operation for Amazon Simple Storage Service. | ||
4817 | // | ||
4818 | // Set the logging parameters for a bucket and to specify permissions for who | ||
4819 | // can view and modify the logging parameters. To set the logging status of | ||
4820 | // a bucket, you must be the bucket owner. | ||
4821 | // | ||
4822 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
4823 | // with awserr.Error's Code and Message methods to get detailed information about | ||
4824 | // the error. | ||
4825 | // | ||
4826 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
4827 | // API operation PutBucketLogging for usage and error information. | ||
4828 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLogging | ||
4829 | func (c *S3) PutBucketLogging(input *PutBucketLoggingInput) (*PutBucketLoggingOutput, error) { | ||
4830 | req, out := c.PutBucketLoggingRequest(input) | ||
4831 | return out, req.Send() | ||
4832 | } | ||
4833 | |||
4834 | // PutBucketLoggingWithContext is the same as PutBucketLogging with the addition of | ||
4835 | // the ability to pass a context and additional request options. | ||
4836 | // | ||
4837 | // See PutBucketLogging for details on how to use this API operation. | ||
4838 | // | ||
4839 | // The context must be non-nil and will be used for request cancellation. If | ||
4840 | // the context is nil a panic will occur. In the future the SDK may create | ||
4841 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
4842 | // for more information on using Contexts. | ||
4843 | func (c *S3) PutBucketLoggingWithContext(ctx aws.Context, input *PutBucketLoggingInput, opts ...request.Option) (*PutBucketLoggingOutput, error) { | ||
4844 | req, out := c.PutBucketLoggingRequest(input) | ||
4845 | req.SetContext(ctx) | ||
4846 | req.ApplyOptions(opts...) | ||
4847 | return out, req.Send() | ||
4848 | } | ||
4849 | |||
4850 | const opPutBucketMetricsConfiguration = "PutBucketMetricsConfiguration" | ||
4851 | |||
4852 | // PutBucketMetricsConfigurationRequest generates a "aws/request.Request" representing the | ||
4853 | // client's request for the PutBucketMetricsConfiguration operation. The "output" return | ||
4854 | // value can be used to capture response data after the request's "Send" method | ||
4855 | // is called. | ||
4856 | // | ||
4857 | // See PutBucketMetricsConfiguration for usage and error information. | ||
4858 | // | ||
4859 | // Creating a request object using this method should be used when you want to inject | ||
4860 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
4861 | // access properties on the request object before or after sending the request. If | ||
4862 | // you just want the service response, call the PutBucketMetricsConfiguration method directly | ||
4863 | // instead. | ||
4864 | // | ||
4865 | // Note: You must call the "Send" method on the returned request object in order | ||
4866 | // to execute the request. | ||
4867 | // | ||
4868 | // // Example sending a request using the PutBucketMetricsConfigurationRequest method. | ||
4869 | // req, resp := client.PutBucketMetricsConfigurationRequest(params) | ||
4870 | // | ||
4871 | // err := req.Send() | ||
4872 | // if err == nil { // resp is now filled | ||
4873 | // fmt.Println(resp) | ||
4874 | // } | ||
4875 | // | ||
4876 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketMetricsConfiguration | ||
4877 | func (c *S3) PutBucketMetricsConfigurationRequest(input *PutBucketMetricsConfigurationInput) (req *request.Request, output *PutBucketMetricsConfigurationOutput) { | ||
4878 | op := &request.Operation{ | ||
4879 | Name: opPutBucketMetricsConfiguration, | ||
4880 | HTTPMethod: "PUT", | ||
4881 | HTTPPath: "/{Bucket}?metrics", | ||
4882 | } | ||
4883 | |||
4884 | if input == nil { | ||
4885 | input = &PutBucketMetricsConfigurationInput{} | ||
4886 | } | ||
4887 | |||
4888 | output = &PutBucketMetricsConfigurationOutput{} | ||
4889 | req = c.newRequest(op, input, output) | ||
4890 | req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) | ||
4891 | req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) | ||
4892 | return | ||
4893 | } | ||
4894 | |||
4895 | // PutBucketMetricsConfiguration API operation for Amazon Simple Storage Service. | ||
4896 | // | ||
4897 | // Sets a metrics configuration (specified by the metrics configuration ID) | ||
4898 | // for the bucket. | ||
4899 | // | ||
4900 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
4901 | // with awserr.Error's Code and Message methods to get detailed information about | ||
4902 | // the error. | ||
4903 | // | ||
4904 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
4905 | // API operation PutBucketMetricsConfiguration for usage and error information. | ||
4906 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketMetricsConfiguration | ||
4907 | func (c *S3) PutBucketMetricsConfiguration(input *PutBucketMetricsConfigurationInput) (*PutBucketMetricsConfigurationOutput, error) { | ||
4908 | req, out := c.PutBucketMetricsConfigurationRequest(input) | ||
4909 | return out, req.Send() | ||
4910 | } | ||
4911 | |||
4912 | // PutBucketMetricsConfigurationWithContext is the same as PutBucketMetricsConfiguration with the addition of | ||
4913 | // the ability to pass a context and additional request options. | ||
4914 | // | ||
4915 | // See PutBucketMetricsConfiguration for details on how to use this API operation. | ||
4916 | // | ||
4917 | // The context must be non-nil and will be used for request cancellation. If | ||
4918 | // the context is nil a panic will occur. In the future the SDK may create | ||
4919 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
4920 | // for more information on using Contexts. | ||
4921 | func (c *S3) PutBucketMetricsConfigurationWithContext(ctx aws.Context, input *PutBucketMetricsConfigurationInput, opts ...request.Option) (*PutBucketMetricsConfigurationOutput, error) { | ||
4922 | req, out := c.PutBucketMetricsConfigurationRequest(input) | ||
4923 | req.SetContext(ctx) | ||
4924 | req.ApplyOptions(opts...) | ||
4925 | return out, req.Send() | ||
4926 | } | ||
4927 | |||
4928 | const opPutBucketNotification = "PutBucketNotification" | ||
4929 | |||
4930 | // PutBucketNotificationRequest generates a "aws/request.Request" representing the | ||
4931 | // client's request for the PutBucketNotification operation. The "output" return | ||
4932 | // value can be used to capture response data after the request's "Send" method | ||
4933 | // is called. | ||
4934 | // | ||
4935 | // See PutBucketNotification for usage and error information. | ||
4936 | // | ||
4937 | // Creating a request object using this method should be used when you want to inject | ||
4938 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
4939 | // access properties on the request object before or after sending the request. If | ||
4940 | // you just want the service response, call the PutBucketNotification method directly | ||
4941 | // instead. | ||
4942 | // | ||
4943 | // Note: You must call the "Send" method on the returned request object in order | ||
4944 | // to execute the request. | ||
4945 | // | ||
4946 | // // Example sending a request using the PutBucketNotificationRequest method. | ||
4947 | // req, resp := client.PutBucketNotificationRequest(params) | ||
4948 | // | ||
4949 | // err := req.Send() | ||
4950 | // if err == nil { // resp is now filled | ||
4951 | // fmt.Println(resp) | ||
4952 | // } | ||
4953 | // | ||
4954 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketNotification | ||
4955 | func (c *S3) PutBucketNotificationRequest(input *PutBucketNotificationInput) (req *request.Request, output *PutBucketNotificationOutput) { | ||
4956 | if c.Client.Config.Logger != nil { | ||
4957 | c.Client.Config.Logger.Log("This operation, PutBucketNotification, has been deprecated") | ||
4958 | } | ||
4959 | op := &request.Operation{ | ||
4960 | Name: opPutBucketNotification, | ||
4961 | HTTPMethod: "PUT", | ||
4962 | HTTPPath: "/{Bucket}?notification", | ||
4963 | } | ||
4964 | |||
4965 | if input == nil { | ||
4966 | input = &PutBucketNotificationInput{} | ||
4967 | } | ||
4968 | |||
4969 | output = &PutBucketNotificationOutput{} | ||
4970 | req = c.newRequest(op, input, output) | ||
4971 | req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) | ||
4972 | req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) | ||
4973 | return | ||
4974 | } | ||
4975 | |||
4976 | // PutBucketNotification API operation for Amazon Simple Storage Service. | ||
4977 | // | ||
4978 | // Deprecated, see the PutBucketNotificationConfiguraiton operation. | ||
4979 | // | ||
4980 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
4981 | // with awserr.Error's Code and Message methods to get detailed information about | ||
4982 | // the error. | ||
4983 | // | ||
4984 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
4985 | // API operation PutBucketNotification for usage and error information. | ||
4986 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketNotification | ||
4987 | func (c *S3) PutBucketNotification(input *PutBucketNotificationInput) (*PutBucketNotificationOutput, error) { | ||
4988 | req, out := c.PutBucketNotificationRequest(input) | ||
4989 | return out, req.Send() | ||
4990 | } | ||
4991 | |||
4992 | // PutBucketNotificationWithContext is the same as PutBucketNotification with the addition of | ||
4993 | // the ability to pass a context and additional request options. | ||
4994 | // | ||
4995 | // See PutBucketNotification for details on how to use this API operation. | ||
4996 | // | ||
4997 | // The context must be non-nil and will be used for request cancellation. If | ||
4998 | // the context is nil a panic will occur. In the future the SDK may create | ||
4999 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
5000 | // for more information on using Contexts. | ||
5001 | func (c *S3) PutBucketNotificationWithContext(ctx aws.Context, input *PutBucketNotificationInput, opts ...request.Option) (*PutBucketNotificationOutput, error) { | ||
5002 | req, out := c.PutBucketNotificationRequest(input) | ||
5003 | req.SetContext(ctx) | ||
5004 | req.ApplyOptions(opts...) | ||
5005 | return out, req.Send() | ||
5006 | } | ||
5007 | |||
5008 | const opPutBucketNotificationConfiguration = "PutBucketNotificationConfiguration" | ||
5009 | |||
5010 | // PutBucketNotificationConfigurationRequest generates a "aws/request.Request" representing the | ||
5011 | // client's request for the PutBucketNotificationConfiguration operation. The "output" return | ||
5012 | // value can be used to capture response data after the request's "Send" method | ||
5013 | // is called. | ||
5014 | // | ||
5015 | // See PutBucketNotificationConfiguration for usage and error information. | ||
5016 | // | ||
5017 | // Creating a request object using this method should be used when you want to inject | ||
5018 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
5019 | // access properties on the request object before or after sending the request. If | ||
5020 | // you just want the service response, call the PutBucketNotificationConfiguration method directly | ||
5021 | // instead. | ||
5022 | // | ||
5023 | // Note: You must call the "Send" method on the returned request object in order | ||
5024 | // to execute the request. | ||
5025 | // | ||
5026 | // // Example sending a request using the PutBucketNotificationConfigurationRequest method. | ||
5027 | // req, resp := client.PutBucketNotificationConfigurationRequest(params) | ||
5028 | // | ||
5029 | // err := req.Send() | ||
5030 | // if err == nil { // resp is now filled | ||
5031 | // fmt.Println(resp) | ||
5032 | // } | ||
5033 | // | ||
5034 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketNotificationConfiguration | ||
5035 | func (c *S3) PutBucketNotificationConfigurationRequest(input *PutBucketNotificationConfigurationInput) (req *request.Request, output *PutBucketNotificationConfigurationOutput) { | ||
5036 | op := &request.Operation{ | ||
5037 | Name: opPutBucketNotificationConfiguration, | ||
5038 | HTTPMethod: "PUT", | ||
5039 | HTTPPath: "/{Bucket}?notification", | ||
5040 | } | ||
5041 | |||
5042 | if input == nil { | ||
5043 | input = &PutBucketNotificationConfigurationInput{} | ||
5044 | } | ||
5045 | |||
5046 | output = &PutBucketNotificationConfigurationOutput{} | ||
5047 | req = c.newRequest(op, input, output) | ||
5048 | req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) | ||
5049 | req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) | ||
5050 | return | ||
5051 | } | ||
5052 | |||
5053 | // PutBucketNotificationConfiguration API operation for Amazon Simple Storage Service. | ||
5054 | // | ||
5055 | // Enables notifications of specified events for a bucket. | ||
5056 | // | ||
5057 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
5058 | // with awserr.Error's Code and Message methods to get detailed information about | ||
5059 | // the error. | ||
5060 | // | ||
5061 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
5062 | // API operation PutBucketNotificationConfiguration for usage and error information. | ||
5063 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketNotificationConfiguration | ||
5064 | func (c *S3) PutBucketNotificationConfiguration(input *PutBucketNotificationConfigurationInput) (*PutBucketNotificationConfigurationOutput, error) { | ||
5065 | req, out := c.PutBucketNotificationConfigurationRequest(input) | ||
5066 | return out, req.Send() | ||
5067 | } | ||
5068 | |||
5069 | // PutBucketNotificationConfigurationWithContext is the same as PutBucketNotificationConfiguration with the addition of | ||
5070 | // the ability to pass a context and additional request options. | ||
5071 | // | ||
5072 | // See PutBucketNotificationConfiguration for details on how to use this API operation. | ||
5073 | // | ||
5074 | // The context must be non-nil and will be used for request cancellation. If | ||
5075 | // the context is nil a panic will occur. In the future the SDK may create | ||
5076 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
5077 | // for more information on using Contexts. | ||
5078 | func (c *S3) PutBucketNotificationConfigurationWithContext(ctx aws.Context, input *PutBucketNotificationConfigurationInput, opts ...request.Option) (*PutBucketNotificationConfigurationOutput, error) { | ||
5079 | req, out := c.PutBucketNotificationConfigurationRequest(input) | ||
5080 | req.SetContext(ctx) | ||
5081 | req.ApplyOptions(opts...) | ||
5082 | return out, req.Send() | ||
5083 | } | ||
5084 | |||
5085 | const opPutBucketPolicy = "PutBucketPolicy" | ||
5086 | |||
5087 | // PutBucketPolicyRequest generates a "aws/request.Request" representing the | ||
5088 | // client's request for the PutBucketPolicy operation. The "output" return | ||
5089 | // value can be used to capture response data after the request's "Send" method | ||
5090 | // is called. | ||
5091 | // | ||
5092 | // See PutBucketPolicy for usage and error information. | ||
5093 | // | ||
5094 | // Creating a request object using this method should be used when you want to inject | ||
5095 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
5096 | // access properties on the request object before or after sending the request. If | ||
5097 | // you just want the service response, call the PutBucketPolicy method directly | ||
5098 | // instead. | ||
5099 | // | ||
5100 | // Note: You must call the "Send" method on the returned request object in order | ||
5101 | // to execute the request. | ||
5102 | // | ||
5103 | // // Example sending a request using the PutBucketPolicyRequest method. | ||
5104 | // req, resp := client.PutBucketPolicyRequest(params) | ||
5105 | // | ||
5106 | // err := req.Send() | ||
5107 | // if err == nil { // resp is now filled | ||
5108 | // fmt.Println(resp) | ||
5109 | // } | ||
5110 | // | ||
5111 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketPolicy | ||
5112 | func (c *S3) PutBucketPolicyRequest(input *PutBucketPolicyInput) (req *request.Request, output *PutBucketPolicyOutput) { | ||
5113 | op := &request.Operation{ | ||
5114 | Name: opPutBucketPolicy, | ||
5115 | HTTPMethod: "PUT", | ||
5116 | HTTPPath: "/{Bucket}?policy", | ||
5117 | } | ||
5118 | |||
5119 | if input == nil { | ||
5120 | input = &PutBucketPolicyInput{} | ||
5121 | } | ||
5122 | |||
5123 | output = &PutBucketPolicyOutput{} | ||
5124 | req = c.newRequest(op, input, output) | ||
5125 | req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) | ||
5126 | req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) | ||
5127 | return | ||
5128 | } | ||
5129 | |||
5130 | // PutBucketPolicy API operation for Amazon Simple Storage Service. | ||
5131 | // | ||
5132 | // Replaces a policy on a bucket. If the bucket already has a policy, the one | ||
5133 | // in this request completely replaces it. | ||
5134 | // | ||
5135 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
5136 | // with awserr.Error's Code and Message methods to get detailed information about | ||
5137 | // the error. | ||
5138 | // | ||
5139 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
5140 | // API operation PutBucketPolicy for usage and error information. | ||
5141 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketPolicy | ||
5142 | func (c *S3) PutBucketPolicy(input *PutBucketPolicyInput) (*PutBucketPolicyOutput, error) { | ||
5143 | req, out := c.PutBucketPolicyRequest(input) | ||
5144 | return out, req.Send() | ||
5145 | } | ||
5146 | |||
5147 | // PutBucketPolicyWithContext is the same as PutBucketPolicy with the addition of | ||
5148 | // the ability to pass a context and additional request options. | ||
5149 | // | ||
5150 | // See PutBucketPolicy for details on how to use this API operation. | ||
5151 | // | ||
5152 | // The context must be non-nil and will be used for request cancellation. If | ||
5153 | // the context is nil a panic will occur. In the future the SDK may create | ||
5154 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
5155 | // for more information on using Contexts. | ||
5156 | func (c *S3) PutBucketPolicyWithContext(ctx aws.Context, input *PutBucketPolicyInput, opts ...request.Option) (*PutBucketPolicyOutput, error) { | ||
5157 | req, out := c.PutBucketPolicyRequest(input) | ||
5158 | req.SetContext(ctx) | ||
5159 | req.ApplyOptions(opts...) | ||
5160 | return out, req.Send() | ||
5161 | } | ||
5162 | |||
5163 | const opPutBucketReplication = "PutBucketReplication" | ||
5164 | |||
5165 | // PutBucketReplicationRequest generates a "aws/request.Request" representing the | ||
5166 | // client's request for the PutBucketReplication operation. The "output" return | ||
5167 | // value can be used to capture response data after the request's "Send" method | ||
5168 | // is called. | ||
5169 | // | ||
5170 | // See PutBucketReplication for usage and error information. | ||
5171 | // | ||
5172 | // Creating a request object using this method should be used when you want to inject | ||
5173 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
5174 | // access properties on the request object before or after sending the request. If | ||
5175 | // you just want the service response, call the PutBucketReplication method directly | ||
5176 | // instead. | ||
5177 | // | ||
5178 | // Note: You must call the "Send" method on the returned request object in order | ||
5179 | // to execute the request. | ||
5180 | // | ||
5181 | // // Example sending a request using the PutBucketReplicationRequest method. | ||
5182 | // req, resp := client.PutBucketReplicationRequest(params) | ||
5183 | // | ||
5184 | // err := req.Send() | ||
5185 | // if err == nil { // resp is now filled | ||
5186 | // fmt.Println(resp) | ||
5187 | // } | ||
5188 | // | ||
5189 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketReplication | ||
5190 | func (c *S3) PutBucketReplicationRequest(input *PutBucketReplicationInput) (req *request.Request, output *PutBucketReplicationOutput) { | ||
5191 | op := &request.Operation{ | ||
5192 | Name: opPutBucketReplication, | ||
5193 | HTTPMethod: "PUT", | ||
5194 | HTTPPath: "/{Bucket}?replication", | ||
5195 | } | ||
5196 | |||
5197 | if input == nil { | ||
5198 | input = &PutBucketReplicationInput{} | ||
5199 | } | ||
5200 | |||
5201 | output = &PutBucketReplicationOutput{} | ||
5202 | req = c.newRequest(op, input, output) | ||
5203 | req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) | ||
5204 | req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) | ||
5205 | return | ||
5206 | } | ||
5207 | |||
5208 | // PutBucketReplication API operation for Amazon Simple Storage Service. | ||
5209 | // | ||
5210 | // Creates a new replication configuration (or replaces an existing one, if | ||
5211 | // present). | ||
5212 | // | ||
5213 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
5214 | // with awserr.Error's Code and Message methods to get detailed information about | ||
5215 | // the error. | ||
5216 | // | ||
5217 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
5218 | // API operation PutBucketReplication for usage and error information. | ||
5219 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketReplication | ||
5220 | func (c *S3) PutBucketReplication(input *PutBucketReplicationInput) (*PutBucketReplicationOutput, error) { | ||
5221 | req, out := c.PutBucketReplicationRequest(input) | ||
5222 | return out, req.Send() | ||
5223 | } | ||
5224 | |||
5225 | // PutBucketReplicationWithContext is the same as PutBucketReplication with the addition of | ||
5226 | // the ability to pass a context and additional request options. | ||
5227 | // | ||
5228 | // See PutBucketReplication for details on how to use this API operation. | ||
5229 | // | ||
5230 | // The context must be non-nil and will be used for request cancellation. If | ||
5231 | // the context is nil a panic will occur. In the future the SDK may create | ||
5232 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
5233 | // for more information on using Contexts. | ||
5234 | func (c *S3) PutBucketReplicationWithContext(ctx aws.Context, input *PutBucketReplicationInput, opts ...request.Option) (*PutBucketReplicationOutput, error) { | ||
5235 | req, out := c.PutBucketReplicationRequest(input) | ||
5236 | req.SetContext(ctx) | ||
5237 | req.ApplyOptions(opts...) | ||
5238 | return out, req.Send() | ||
5239 | } | ||
5240 | |||
5241 | const opPutBucketRequestPayment = "PutBucketRequestPayment" | ||
5242 | |||
5243 | // PutBucketRequestPaymentRequest generates a "aws/request.Request" representing the | ||
5244 | // client's request for the PutBucketRequestPayment operation. The "output" return | ||
5245 | // value can be used to capture response data after the request's "Send" method | ||
5246 | // is called. | ||
5247 | // | ||
5248 | // See PutBucketRequestPayment for usage and error information. | ||
5249 | // | ||
5250 | // Creating a request object using this method should be used when you want to inject | ||
5251 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
5252 | // access properties on the request object before or after sending the request. If | ||
5253 | // you just want the service response, call the PutBucketRequestPayment method directly | ||
5254 | // instead. | ||
5255 | // | ||
5256 | // Note: You must call the "Send" method on the returned request object in order | ||
5257 | // to execute the request. | ||
5258 | // | ||
5259 | // // Example sending a request using the PutBucketRequestPaymentRequest method. | ||
5260 | // req, resp := client.PutBucketRequestPaymentRequest(params) | ||
5261 | // | ||
5262 | // err := req.Send() | ||
5263 | // if err == nil { // resp is now filled | ||
5264 | // fmt.Println(resp) | ||
5265 | // } | ||
5266 | // | ||
5267 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketRequestPayment | ||
5268 | func (c *S3) PutBucketRequestPaymentRequest(input *PutBucketRequestPaymentInput) (req *request.Request, output *PutBucketRequestPaymentOutput) { | ||
5269 | op := &request.Operation{ | ||
5270 | Name: opPutBucketRequestPayment, | ||
5271 | HTTPMethod: "PUT", | ||
5272 | HTTPPath: "/{Bucket}?requestPayment", | ||
5273 | } | ||
5274 | |||
5275 | if input == nil { | ||
5276 | input = &PutBucketRequestPaymentInput{} | ||
5277 | } | ||
5278 | |||
5279 | output = &PutBucketRequestPaymentOutput{} | ||
5280 | req = c.newRequest(op, input, output) | ||
5281 | req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) | ||
5282 | req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) | ||
5283 | return | ||
5284 | } | ||
5285 | |||
5286 | // PutBucketRequestPayment API operation for Amazon Simple Storage Service. | ||
5287 | // | ||
5288 | // Sets the request payment configuration for a bucket. By default, the bucket | ||
5289 | // owner pays for downloads from the bucket. This configuration parameter enables | ||
5290 | // the bucket owner (only) to specify that the person requesting the download | ||
5291 | // will be charged for the download. Documentation on requester pays buckets | ||
5292 | // can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.html | ||
5293 | // | ||
5294 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
5295 | // with awserr.Error's Code and Message methods to get detailed information about | ||
5296 | // the error. | ||
5297 | // | ||
5298 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
5299 | // API operation PutBucketRequestPayment for usage and error information. | ||
5300 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketRequestPayment | ||
5301 | func (c *S3) PutBucketRequestPayment(input *PutBucketRequestPaymentInput) (*PutBucketRequestPaymentOutput, error) { | ||
5302 | req, out := c.PutBucketRequestPaymentRequest(input) | ||
5303 | return out, req.Send() | ||
5304 | } | ||
5305 | |||
5306 | // PutBucketRequestPaymentWithContext is the same as PutBucketRequestPayment with the addition of | ||
5307 | // the ability to pass a context and additional request options. | ||
5308 | // | ||
5309 | // See PutBucketRequestPayment for details on how to use this API operation. | ||
5310 | // | ||
5311 | // The context must be non-nil and will be used for request cancellation. If | ||
5312 | // the context is nil a panic will occur. In the future the SDK may create | ||
5313 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
5314 | // for more information on using Contexts. | ||
5315 | func (c *S3) PutBucketRequestPaymentWithContext(ctx aws.Context, input *PutBucketRequestPaymentInput, opts ...request.Option) (*PutBucketRequestPaymentOutput, error) { | ||
5316 | req, out := c.PutBucketRequestPaymentRequest(input) | ||
5317 | req.SetContext(ctx) | ||
5318 | req.ApplyOptions(opts...) | ||
5319 | return out, req.Send() | ||
5320 | } | ||
5321 | |||
5322 | const opPutBucketTagging = "PutBucketTagging" | ||
5323 | |||
5324 | // PutBucketTaggingRequest generates a "aws/request.Request" representing the | ||
5325 | // client's request for the PutBucketTagging operation. The "output" return | ||
5326 | // value can be used to capture response data after the request's "Send" method | ||
5327 | // is called. | ||
5328 | // | ||
5329 | // See PutBucketTagging for usage and error information. | ||
5330 | // | ||
5331 | // Creating a request object using this method should be used when you want to inject | ||
5332 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
5333 | // access properties on the request object before or after sending the request. If | ||
5334 | // you just want the service response, call the PutBucketTagging method directly | ||
5335 | // instead. | ||
5336 | // | ||
5337 | // Note: You must call the "Send" method on the returned request object in order | ||
5338 | // to execute the request. | ||
5339 | // | ||
5340 | // // Example sending a request using the PutBucketTaggingRequest method. | ||
5341 | // req, resp := client.PutBucketTaggingRequest(params) | ||
5342 | // | ||
5343 | // err := req.Send() | ||
5344 | // if err == nil { // resp is now filled | ||
5345 | // fmt.Println(resp) | ||
5346 | // } | ||
5347 | // | ||
5348 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketTagging | ||
5349 | func (c *S3) PutBucketTaggingRequest(input *PutBucketTaggingInput) (req *request.Request, output *PutBucketTaggingOutput) { | ||
5350 | op := &request.Operation{ | ||
5351 | Name: opPutBucketTagging, | ||
5352 | HTTPMethod: "PUT", | ||
5353 | HTTPPath: "/{Bucket}?tagging", | ||
5354 | } | ||
5355 | |||
5356 | if input == nil { | ||
5357 | input = &PutBucketTaggingInput{} | ||
5358 | } | ||
5359 | |||
5360 | output = &PutBucketTaggingOutput{} | ||
5361 | req = c.newRequest(op, input, output) | ||
5362 | req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) | ||
5363 | req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) | ||
5364 | return | ||
5365 | } | ||
5366 | |||
5367 | // PutBucketTagging API operation for Amazon Simple Storage Service. | ||
5368 | // | ||
5369 | // Sets the tags for a bucket. | ||
5370 | // | ||
5371 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
5372 | // with awserr.Error's Code and Message methods to get detailed information about | ||
5373 | // the error. | ||
5374 | // | ||
5375 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
5376 | // API operation PutBucketTagging for usage and error information. | ||
5377 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketTagging | ||
5378 | func (c *S3) PutBucketTagging(input *PutBucketTaggingInput) (*PutBucketTaggingOutput, error) { | ||
5379 | req, out := c.PutBucketTaggingRequest(input) | ||
5380 | return out, req.Send() | ||
5381 | } | ||
5382 | |||
5383 | // PutBucketTaggingWithContext is the same as PutBucketTagging with the addition of | ||
5384 | // the ability to pass a context and additional request options. | ||
5385 | // | ||
5386 | // See PutBucketTagging for details on how to use this API operation. | ||
5387 | // | ||
5388 | // The context must be non-nil and will be used for request cancellation. If | ||
5389 | // the context is nil a panic will occur. In the future the SDK may create | ||
5390 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
5391 | // for more information on using Contexts. | ||
5392 | func (c *S3) PutBucketTaggingWithContext(ctx aws.Context, input *PutBucketTaggingInput, opts ...request.Option) (*PutBucketTaggingOutput, error) { | ||
5393 | req, out := c.PutBucketTaggingRequest(input) | ||
5394 | req.SetContext(ctx) | ||
5395 | req.ApplyOptions(opts...) | ||
5396 | return out, req.Send() | ||
5397 | } | ||
5398 | |||
5399 | const opPutBucketVersioning = "PutBucketVersioning" | ||
5400 | |||
5401 | // PutBucketVersioningRequest generates a "aws/request.Request" representing the | ||
5402 | // client's request for the PutBucketVersioning operation. The "output" return | ||
5403 | // value can be used to capture response data after the request's "Send" method | ||
5404 | // is called. | ||
5405 | // | ||
5406 | // See PutBucketVersioning for usage and error information. | ||
5407 | // | ||
5408 | // Creating a request object using this method should be used when you want to inject | ||
5409 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
5410 | // access properties on the request object before or after sending the request. If | ||
5411 | // you just want the service response, call the PutBucketVersioning method directly | ||
5412 | // instead. | ||
5413 | // | ||
5414 | // Note: You must call the "Send" method on the returned request object in order | ||
5415 | // to execute the request. | ||
5416 | // | ||
5417 | // // Example sending a request using the PutBucketVersioningRequest method. | ||
5418 | // req, resp := client.PutBucketVersioningRequest(params) | ||
5419 | // | ||
5420 | // err := req.Send() | ||
5421 | // if err == nil { // resp is now filled | ||
5422 | // fmt.Println(resp) | ||
5423 | // } | ||
5424 | // | ||
5425 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketVersioning | ||
5426 | func (c *S3) PutBucketVersioningRequest(input *PutBucketVersioningInput) (req *request.Request, output *PutBucketVersioningOutput) { | ||
5427 | op := &request.Operation{ | ||
5428 | Name: opPutBucketVersioning, | ||
5429 | HTTPMethod: "PUT", | ||
5430 | HTTPPath: "/{Bucket}?versioning", | ||
5431 | } | ||
5432 | |||
5433 | if input == nil { | ||
5434 | input = &PutBucketVersioningInput{} | ||
5435 | } | ||
5436 | |||
5437 | output = &PutBucketVersioningOutput{} | ||
5438 | req = c.newRequest(op, input, output) | ||
5439 | req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) | ||
5440 | req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) | ||
5441 | return | ||
5442 | } | ||
5443 | |||
5444 | // PutBucketVersioning API operation for Amazon Simple Storage Service. | ||
5445 | // | ||
5446 | // Sets the versioning state of an existing bucket. To set the versioning state, | ||
5447 | // you must be the bucket owner. | ||
5448 | // | ||
5449 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
5450 | // with awserr.Error's Code and Message methods to get detailed information about | ||
5451 | // the error. | ||
5452 | // | ||
5453 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
5454 | // API operation PutBucketVersioning for usage and error information. | ||
5455 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketVersioning | ||
5456 | func (c *S3) PutBucketVersioning(input *PutBucketVersioningInput) (*PutBucketVersioningOutput, error) { | ||
5457 | req, out := c.PutBucketVersioningRequest(input) | ||
5458 | return out, req.Send() | ||
5459 | } | ||
5460 | |||
5461 | // PutBucketVersioningWithContext is the same as PutBucketVersioning with the addition of | ||
5462 | // the ability to pass a context and additional request options. | ||
5463 | // | ||
5464 | // See PutBucketVersioning for details on how to use this API operation. | ||
5465 | // | ||
5466 | // The context must be non-nil and will be used for request cancellation. If | ||
5467 | // the context is nil a panic will occur. In the future the SDK may create | ||
5468 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
5469 | // for more information on using Contexts. | ||
5470 | func (c *S3) PutBucketVersioningWithContext(ctx aws.Context, input *PutBucketVersioningInput, opts ...request.Option) (*PutBucketVersioningOutput, error) { | ||
5471 | req, out := c.PutBucketVersioningRequest(input) | ||
5472 | req.SetContext(ctx) | ||
5473 | req.ApplyOptions(opts...) | ||
5474 | return out, req.Send() | ||
5475 | } | ||
5476 | |||
5477 | const opPutBucketWebsite = "PutBucketWebsite" | ||
5478 | |||
5479 | // PutBucketWebsiteRequest generates a "aws/request.Request" representing the | ||
5480 | // client's request for the PutBucketWebsite operation. The "output" return | ||
5481 | // value can be used to capture response data after the request's "Send" method | ||
5482 | // is called. | ||
5483 | // | ||
5484 | // See PutBucketWebsite for usage and error information. | ||
5485 | // | ||
5486 | // Creating a request object using this method should be used when you want to inject | ||
5487 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
5488 | // access properties on the request object before or after sending the request. If | ||
5489 | // you just want the service response, call the PutBucketWebsite method directly | ||
5490 | // instead. | ||
5491 | // | ||
5492 | // Note: You must call the "Send" method on the returned request object in order | ||
5493 | // to execute the request. | ||
5494 | // | ||
5495 | // // Example sending a request using the PutBucketWebsiteRequest method. | ||
5496 | // req, resp := client.PutBucketWebsiteRequest(params) | ||
5497 | // | ||
5498 | // err := req.Send() | ||
5499 | // if err == nil { // resp is now filled | ||
5500 | // fmt.Println(resp) | ||
5501 | // } | ||
5502 | // | ||
5503 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketWebsite | ||
5504 | func (c *S3) PutBucketWebsiteRequest(input *PutBucketWebsiteInput) (req *request.Request, output *PutBucketWebsiteOutput) { | ||
5505 | op := &request.Operation{ | ||
5506 | Name: opPutBucketWebsite, | ||
5507 | HTTPMethod: "PUT", | ||
5508 | HTTPPath: "/{Bucket}?website", | ||
5509 | } | ||
5510 | |||
5511 | if input == nil { | ||
5512 | input = &PutBucketWebsiteInput{} | ||
5513 | } | ||
5514 | |||
5515 | output = &PutBucketWebsiteOutput{} | ||
5516 | req = c.newRequest(op, input, output) | ||
5517 | req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) | ||
5518 | req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) | ||
5519 | return | ||
5520 | } | ||
5521 | |||
5522 | // PutBucketWebsite API operation for Amazon Simple Storage Service. | ||
5523 | // | ||
5524 | // Set the website configuration for a bucket. | ||
5525 | // | ||
5526 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
5527 | // with awserr.Error's Code and Message methods to get detailed information about | ||
5528 | // the error. | ||
5529 | // | ||
5530 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
5531 | // API operation PutBucketWebsite for usage and error information. | ||
5532 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketWebsite | ||
5533 | func (c *S3) PutBucketWebsite(input *PutBucketWebsiteInput) (*PutBucketWebsiteOutput, error) { | ||
5534 | req, out := c.PutBucketWebsiteRequest(input) | ||
5535 | return out, req.Send() | ||
5536 | } | ||
5537 | |||
5538 | // PutBucketWebsiteWithContext is the same as PutBucketWebsite with the addition of | ||
5539 | // the ability to pass a context and additional request options. | ||
5540 | // | ||
5541 | // See PutBucketWebsite for details on how to use this API operation. | ||
5542 | // | ||
5543 | // The context must be non-nil and will be used for request cancellation. If | ||
5544 | // the context is nil a panic will occur. In the future the SDK may create | ||
5545 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
5546 | // for more information on using Contexts. | ||
5547 | func (c *S3) PutBucketWebsiteWithContext(ctx aws.Context, input *PutBucketWebsiteInput, opts ...request.Option) (*PutBucketWebsiteOutput, error) { | ||
5548 | req, out := c.PutBucketWebsiteRequest(input) | ||
5549 | req.SetContext(ctx) | ||
5550 | req.ApplyOptions(opts...) | ||
5551 | return out, req.Send() | ||
5552 | } | ||
5553 | |||
5554 | const opPutObject = "PutObject" | ||
5555 | |||
5556 | // PutObjectRequest generates a "aws/request.Request" representing the | ||
5557 | // client's request for the PutObject operation. The "output" return | ||
5558 | // value can be used to capture response data after the request's "Send" method | ||
5559 | // is called. | ||
5560 | // | ||
5561 | // See PutObject for usage and error information. | ||
5562 | // | ||
5563 | // Creating a request object using this method should be used when you want to inject | ||
5564 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
5565 | // access properties on the request object before or after sending the request. If | ||
5566 | // you just want the service response, call the PutObject method directly | ||
5567 | // instead. | ||
5568 | // | ||
5569 | // Note: You must call the "Send" method on the returned request object in order | ||
5570 | // to execute the request. | ||
5571 | // | ||
5572 | // // Example sending a request using the PutObjectRequest method. | ||
5573 | // req, resp := client.PutObjectRequest(params) | ||
5574 | // | ||
5575 | // err := req.Send() | ||
5576 | // if err == nil { // resp is now filled | ||
5577 | // fmt.Println(resp) | ||
5578 | // } | ||
5579 | // | ||
5580 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObject | ||
5581 | func (c *S3) PutObjectRequest(input *PutObjectInput) (req *request.Request, output *PutObjectOutput) { | ||
5582 | op := &request.Operation{ | ||
5583 | Name: opPutObject, | ||
5584 | HTTPMethod: "PUT", | ||
5585 | HTTPPath: "/{Bucket}/{Key+}", | ||
5586 | } | ||
5587 | |||
5588 | if input == nil { | ||
5589 | input = &PutObjectInput{} | ||
5590 | } | ||
5591 | |||
5592 | output = &PutObjectOutput{} | ||
5593 | req = c.newRequest(op, input, output) | ||
5594 | return | ||
5595 | } | ||
5596 | |||
5597 | // PutObject API operation for Amazon Simple Storage Service. | ||
5598 | // | ||
5599 | // Adds an object to a bucket. | ||
5600 | // | ||
5601 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
5602 | // with awserr.Error's Code and Message methods to get detailed information about | ||
5603 | // the error. | ||
5604 | // | ||
5605 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
5606 | // API operation PutObject for usage and error information. | ||
5607 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObject | ||
5608 | func (c *S3) PutObject(input *PutObjectInput) (*PutObjectOutput, error) { | ||
5609 | req, out := c.PutObjectRequest(input) | ||
5610 | return out, req.Send() | ||
5611 | } | ||
5612 | |||
5613 | // PutObjectWithContext is the same as PutObject with the addition of | ||
5614 | // the ability to pass a context and additional request options. | ||
5615 | // | ||
5616 | // See PutObject for details on how to use this API operation. | ||
5617 | // | ||
5618 | // The context must be non-nil and will be used for request cancellation. If | ||
5619 | // the context is nil a panic will occur. In the future the SDK may create | ||
5620 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
5621 | // for more information on using Contexts. | ||
5622 | func (c *S3) PutObjectWithContext(ctx aws.Context, input *PutObjectInput, opts ...request.Option) (*PutObjectOutput, error) { | ||
5623 | req, out := c.PutObjectRequest(input) | ||
5624 | req.SetContext(ctx) | ||
5625 | req.ApplyOptions(opts...) | ||
5626 | return out, req.Send() | ||
5627 | } | ||
5628 | |||
5629 | const opPutObjectAcl = "PutObjectAcl" | ||
5630 | |||
5631 | // PutObjectAclRequest generates a "aws/request.Request" representing the | ||
5632 | // client's request for the PutObjectAcl operation. The "output" return | ||
5633 | // value can be used to capture response data after the request's "Send" method | ||
5634 | // is called. | ||
5635 | // | ||
5636 | // See PutObjectAcl for usage and error information. | ||
5637 | // | ||
5638 | // Creating a request object using this method should be used when you want to inject | ||
5639 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
5640 | // access properties on the request object before or after sending the request. If | ||
5641 | // you just want the service response, call the PutObjectAcl method directly | ||
5642 | // instead. | ||
5643 | // | ||
5644 | // Note: You must call the "Send" method on the returned request object in order | ||
5645 | // to execute the request. | ||
5646 | // | ||
5647 | // // Example sending a request using the PutObjectAclRequest method. | ||
5648 | // req, resp := client.PutObjectAclRequest(params) | ||
5649 | // | ||
5650 | // err := req.Send() | ||
5651 | // if err == nil { // resp is now filled | ||
5652 | // fmt.Println(resp) | ||
5653 | // } | ||
5654 | // | ||
5655 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectAcl | ||
5656 | func (c *S3) PutObjectAclRequest(input *PutObjectAclInput) (req *request.Request, output *PutObjectAclOutput) { | ||
5657 | op := &request.Operation{ | ||
5658 | Name: opPutObjectAcl, | ||
5659 | HTTPMethod: "PUT", | ||
5660 | HTTPPath: "/{Bucket}/{Key+}?acl", | ||
5661 | } | ||
5662 | |||
5663 | if input == nil { | ||
5664 | input = &PutObjectAclInput{} | ||
5665 | } | ||
5666 | |||
5667 | output = &PutObjectAclOutput{} | ||
5668 | req = c.newRequest(op, input, output) | ||
5669 | return | ||
5670 | } | ||
5671 | |||
5672 | // PutObjectAcl API operation for Amazon Simple Storage Service. | ||
5673 | // | ||
5674 | // uses the acl subresource to set the access control list (ACL) permissions | ||
5675 | // for an object that already exists in a bucket | ||
5676 | // | ||
5677 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
5678 | // with awserr.Error's Code and Message methods to get detailed information about | ||
5679 | // the error. | ||
5680 | // | ||
5681 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
5682 | // API operation PutObjectAcl for usage and error information. | ||
5683 | // | ||
5684 | // Returned Error Codes: | ||
5685 | // * ErrCodeNoSuchKey "NoSuchKey" | ||
5686 | // The specified key does not exist. | ||
5687 | // | ||
5688 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectAcl | ||
5689 | func (c *S3) PutObjectAcl(input *PutObjectAclInput) (*PutObjectAclOutput, error) { | ||
5690 | req, out := c.PutObjectAclRequest(input) | ||
5691 | return out, req.Send() | ||
5692 | } | ||
5693 | |||
5694 | // PutObjectAclWithContext is the same as PutObjectAcl with the addition of | ||
5695 | // the ability to pass a context and additional request options. | ||
5696 | // | ||
5697 | // See PutObjectAcl for details on how to use this API operation. | ||
5698 | // | ||
5699 | // The context must be non-nil and will be used for request cancellation. If | ||
5700 | // the context is nil a panic will occur. In the future the SDK may create | ||
5701 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
5702 | // for more information on using Contexts. | ||
5703 | func (c *S3) PutObjectAclWithContext(ctx aws.Context, input *PutObjectAclInput, opts ...request.Option) (*PutObjectAclOutput, error) { | ||
5704 | req, out := c.PutObjectAclRequest(input) | ||
5705 | req.SetContext(ctx) | ||
5706 | req.ApplyOptions(opts...) | ||
5707 | return out, req.Send() | ||
5708 | } | ||
5709 | |||
5710 | const opPutObjectTagging = "PutObjectTagging" | ||
5711 | |||
5712 | // PutObjectTaggingRequest generates a "aws/request.Request" representing the | ||
5713 | // client's request for the PutObjectTagging operation. The "output" return | ||
5714 | // value can be used to capture response data after the request's "Send" method | ||
5715 | // is called. | ||
5716 | // | ||
5717 | // See PutObjectTagging for usage and error information. | ||
5718 | // | ||
5719 | // Creating a request object using this method should be used when you want to inject | ||
5720 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
5721 | // access properties on the request object before or after sending the request. If | ||
5722 | // you just want the service response, call the PutObjectTagging method directly | ||
5723 | // instead. | ||
5724 | // | ||
5725 | // Note: You must call the "Send" method on the returned request object in order | ||
5726 | // to execute the request. | ||
5727 | // | ||
5728 | // // Example sending a request using the PutObjectTaggingRequest method. | ||
5729 | // req, resp := client.PutObjectTaggingRequest(params) | ||
5730 | // | ||
5731 | // err := req.Send() | ||
5732 | // if err == nil { // resp is now filled | ||
5733 | // fmt.Println(resp) | ||
5734 | // } | ||
5735 | // | ||
5736 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectTagging | ||
5737 | func (c *S3) PutObjectTaggingRequest(input *PutObjectTaggingInput) (req *request.Request, output *PutObjectTaggingOutput) { | ||
5738 | op := &request.Operation{ | ||
5739 | Name: opPutObjectTagging, | ||
5740 | HTTPMethod: "PUT", | ||
5741 | HTTPPath: "/{Bucket}/{Key+}?tagging", | ||
5742 | } | ||
5743 | |||
5744 | if input == nil { | ||
5745 | input = &PutObjectTaggingInput{} | ||
5746 | } | ||
5747 | |||
5748 | output = &PutObjectTaggingOutput{} | ||
5749 | req = c.newRequest(op, input, output) | ||
5750 | return | ||
5751 | } | ||
5752 | |||
5753 | // PutObjectTagging API operation for Amazon Simple Storage Service. | ||
5754 | // | ||
5755 | // Sets the supplied tag-set to an object that already exists in a bucket | ||
5756 | // | ||
5757 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
5758 | // with awserr.Error's Code and Message methods to get detailed information about | ||
5759 | // the error. | ||
5760 | // | ||
5761 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
5762 | // API operation PutObjectTagging for usage and error information. | ||
5763 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectTagging | ||
5764 | func (c *S3) PutObjectTagging(input *PutObjectTaggingInput) (*PutObjectTaggingOutput, error) { | ||
5765 | req, out := c.PutObjectTaggingRequest(input) | ||
5766 | return out, req.Send() | ||
5767 | } | ||
5768 | |||
5769 | // PutObjectTaggingWithContext is the same as PutObjectTagging with the addition of | ||
5770 | // the ability to pass a context and additional request options. | ||
5771 | // | ||
5772 | // See PutObjectTagging for details on how to use this API operation. | ||
5773 | // | ||
5774 | // The context must be non-nil and will be used for request cancellation. If | ||
5775 | // the context is nil a panic will occur. In the future the SDK may create | ||
5776 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
5777 | // for more information on using Contexts. | ||
5778 | func (c *S3) PutObjectTaggingWithContext(ctx aws.Context, input *PutObjectTaggingInput, opts ...request.Option) (*PutObjectTaggingOutput, error) { | ||
5779 | req, out := c.PutObjectTaggingRequest(input) | ||
5780 | req.SetContext(ctx) | ||
5781 | req.ApplyOptions(opts...) | ||
5782 | return out, req.Send() | ||
5783 | } | ||
5784 | |||
5785 | const opRestoreObject = "RestoreObject" | ||
5786 | |||
5787 | // RestoreObjectRequest generates a "aws/request.Request" representing the | ||
5788 | // client's request for the RestoreObject operation. The "output" return | ||
5789 | // value can be used to capture response data after the request's "Send" method | ||
5790 | // is called. | ||
5791 | // | ||
5792 | // See RestoreObject for usage and error information. | ||
5793 | // | ||
5794 | // Creating a request object using this method should be used when you want to inject | ||
5795 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
5796 | // access properties on the request object before or after sending the request. If | ||
5797 | // you just want the service response, call the RestoreObject method directly | ||
5798 | // instead. | ||
5799 | // | ||
5800 | // Note: You must call the "Send" method on the returned request object in order | ||
5801 | // to execute the request. | ||
5802 | // | ||
5803 | // // Example sending a request using the RestoreObjectRequest method. | ||
5804 | // req, resp := client.RestoreObjectRequest(params) | ||
5805 | // | ||
5806 | // err := req.Send() | ||
5807 | // if err == nil { // resp is now filled | ||
5808 | // fmt.Println(resp) | ||
5809 | // } | ||
5810 | // | ||
5811 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/RestoreObject | ||
5812 | func (c *S3) RestoreObjectRequest(input *RestoreObjectInput) (req *request.Request, output *RestoreObjectOutput) { | ||
5813 | op := &request.Operation{ | ||
5814 | Name: opRestoreObject, | ||
5815 | HTTPMethod: "POST", | ||
5816 | HTTPPath: "/{Bucket}/{Key+}?restore", | ||
5817 | } | ||
5818 | |||
5819 | if input == nil { | ||
5820 | input = &RestoreObjectInput{} | ||
5821 | } | ||
5822 | |||
5823 | output = &RestoreObjectOutput{} | ||
5824 | req = c.newRequest(op, input, output) | ||
5825 | return | ||
5826 | } | ||
5827 | |||
5828 | // RestoreObject API operation for Amazon Simple Storage Service. | ||
5829 | // | ||
5830 | // Restores an archived copy of an object back into Amazon S3 | ||
5831 | // | ||
5832 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
5833 | // with awserr.Error's Code and Message methods to get detailed information about | ||
5834 | // the error. | ||
5835 | // | ||
5836 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
5837 | // API operation RestoreObject for usage and error information. | ||
5838 | // | ||
5839 | // Returned Error Codes: | ||
5840 | // * ErrCodeObjectAlreadyInActiveTierError "ObjectAlreadyInActiveTierError" | ||
5841 | // This operation is not allowed against this storage tier | ||
5842 | // | ||
5843 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/RestoreObject | ||
5844 | func (c *S3) RestoreObject(input *RestoreObjectInput) (*RestoreObjectOutput, error) { | ||
5845 | req, out := c.RestoreObjectRequest(input) | ||
5846 | return out, req.Send() | ||
5847 | } | ||
5848 | |||
5849 | // RestoreObjectWithContext is the same as RestoreObject with the addition of | ||
5850 | // the ability to pass a context and additional request options. | ||
5851 | // | ||
5852 | // See RestoreObject for details on how to use this API operation. | ||
5853 | // | ||
5854 | // The context must be non-nil and will be used for request cancellation. If | ||
5855 | // the context is nil a panic will occur. In the future the SDK may create | ||
5856 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
5857 | // for more information on using Contexts. | ||
5858 | func (c *S3) RestoreObjectWithContext(ctx aws.Context, input *RestoreObjectInput, opts ...request.Option) (*RestoreObjectOutput, error) { | ||
5859 | req, out := c.RestoreObjectRequest(input) | ||
5860 | req.SetContext(ctx) | ||
5861 | req.ApplyOptions(opts...) | ||
5862 | return out, req.Send() | ||
5863 | } | ||
5864 | |||
5865 | const opUploadPart = "UploadPart" | ||
5866 | |||
5867 | // UploadPartRequest generates a "aws/request.Request" representing the | ||
5868 | // client's request for the UploadPart operation. The "output" return | ||
5869 | // value can be used to capture response data after the request's "Send" method | ||
5870 | // is called. | ||
5871 | // | ||
5872 | // See UploadPart for usage and error information. | ||
5873 | // | ||
5874 | // Creating a request object using this method should be used when you want to inject | ||
5875 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
5876 | // access properties on the request object before or after sending the request. If | ||
5877 | // you just want the service response, call the UploadPart method directly | ||
5878 | // instead. | ||
5879 | // | ||
5880 | // Note: You must call the "Send" method on the returned request object in order | ||
5881 | // to execute the request. | ||
5882 | // | ||
5883 | // // Example sending a request using the UploadPartRequest method. | ||
5884 | // req, resp := client.UploadPartRequest(params) | ||
5885 | // | ||
5886 | // err := req.Send() | ||
5887 | // if err == nil { // resp is now filled | ||
5888 | // fmt.Println(resp) | ||
5889 | // } | ||
5890 | // | ||
5891 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/UploadPart | ||
5892 | func (c *S3) UploadPartRequest(input *UploadPartInput) (req *request.Request, output *UploadPartOutput) { | ||
5893 | op := &request.Operation{ | ||
5894 | Name: opUploadPart, | ||
5895 | HTTPMethod: "PUT", | ||
5896 | HTTPPath: "/{Bucket}/{Key+}", | ||
5897 | } | ||
5898 | |||
5899 | if input == nil { | ||
5900 | input = &UploadPartInput{} | ||
5901 | } | ||
5902 | |||
5903 | output = &UploadPartOutput{} | ||
5904 | req = c.newRequest(op, input, output) | ||
5905 | return | ||
5906 | } | ||
5907 | |||
5908 | // UploadPart API operation for Amazon Simple Storage Service. | ||
5909 | // | ||
5910 | // Uploads a part in a multipart upload. | ||
5911 | // | ||
5912 | // Note: After you initiate multipart upload and upload one or more parts, you | ||
5913 | // must either complete or abort multipart upload in order to stop getting charged | ||
5914 | // for storage of the uploaded parts. Only after you either complete or abort | ||
5915 | // multipart upload, Amazon S3 frees up the parts storage and stops charging | ||
5916 | // you for the parts storage. | ||
5917 | // | ||
5918 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
5919 | // with awserr.Error's Code and Message methods to get detailed information about | ||
5920 | // the error. | ||
5921 | // | ||
5922 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
5923 | // API operation UploadPart for usage and error information. | ||
5924 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/UploadPart | ||
5925 | func (c *S3) UploadPart(input *UploadPartInput) (*UploadPartOutput, error) { | ||
5926 | req, out := c.UploadPartRequest(input) | ||
5927 | return out, req.Send() | ||
5928 | } | ||
5929 | |||
5930 | // UploadPartWithContext is the same as UploadPart with the addition of | ||
5931 | // the ability to pass a context and additional request options. | ||
5932 | // | ||
5933 | // See UploadPart for details on how to use this API operation. | ||
5934 | // | ||
5935 | // The context must be non-nil and will be used for request cancellation. If | ||
5936 | // the context is nil a panic will occur. In the future the SDK may create | ||
5937 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
5938 | // for more information on using Contexts. | ||
5939 | func (c *S3) UploadPartWithContext(ctx aws.Context, input *UploadPartInput, opts ...request.Option) (*UploadPartOutput, error) { | ||
5940 | req, out := c.UploadPartRequest(input) | ||
5941 | req.SetContext(ctx) | ||
5942 | req.ApplyOptions(opts...) | ||
5943 | return out, req.Send() | ||
5944 | } | ||
5945 | |||
5946 | const opUploadPartCopy = "UploadPartCopy" | ||
5947 | |||
5948 | // UploadPartCopyRequest generates a "aws/request.Request" representing the | ||
5949 | // client's request for the UploadPartCopy operation. The "output" return | ||
5950 | // value can be used to capture response data after the request's "Send" method | ||
5951 | // is called. | ||
5952 | // | ||
5953 | // See UploadPartCopy for usage and error information. | ||
5954 | // | ||
5955 | // Creating a request object using this method should be used when you want to inject | ||
5956 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
5957 | // access properties on the request object before or after sending the request. If | ||
5958 | // you just want the service response, call the UploadPartCopy method directly | ||
5959 | // instead. | ||
5960 | // | ||
5961 | // Note: You must call the "Send" method on the returned request object in order | ||
5962 | // to execute the request. | ||
5963 | // | ||
5964 | // // Example sending a request using the UploadPartCopyRequest method. | ||
5965 | // req, resp := client.UploadPartCopyRequest(params) | ||
5966 | // | ||
5967 | // err := req.Send() | ||
5968 | // if err == nil { // resp is now filled | ||
5969 | // fmt.Println(resp) | ||
5970 | // } | ||
5971 | // | ||
5972 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/UploadPartCopy | ||
5973 | func (c *S3) UploadPartCopyRequest(input *UploadPartCopyInput) (req *request.Request, output *UploadPartCopyOutput) { | ||
5974 | op := &request.Operation{ | ||
5975 | Name: opUploadPartCopy, | ||
5976 | HTTPMethod: "PUT", | ||
5977 | HTTPPath: "/{Bucket}/{Key+}", | ||
5978 | } | ||
5979 | |||
5980 | if input == nil { | ||
5981 | input = &UploadPartCopyInput{} | ||
5982 | } | ||
5983 | |||
5984 | output = &UploadPartCopyOutput{} | ||
5985 | req = c.newRequest(op, input, output) | ||
5986 | return | ||
5987 | } | ||
5988 | |||
5989 | // UploadPartCopy API operation for Amazon Simple Storage Service. | ||
5990 | // | ||
5991 | // Uploads a part by copying data from an existing object as data source. | ||
5992 | // | ||
5993 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
5994 | // with awserr.Error's Code and Message methods to get detailed information about | ||
5995 | // the error. | ||
5996 | // | ||
5997 | // See the AWS API reference guide for Amazon Simple Storage Service's | ||
5998 | // API operation UploadPartCopy for usage and error information. | ||
5999 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/UploadPartCopy | ||
6000 | func (c *S3) UploadPartCopy(input *UploadPartCopyInput) (*UploadPartCopyOutput, error) { | ||
6001 | req, out := c.UploadPartCopyRequest(input) | ||
6002 | return out, req.Send() | ||
6003 | } | ||
6004 | |||
6005 | // UploadPartCopyWithContext is the same as UploadPartCopy with the addition of | ||
6006 | // the ability to pass a context and additional request options. | ||
6007 | // | ||
6008 | // See UploadPartCopy for details on how to use this API operation. | ||
6009 | // | ||
6010 | // The context must be non-nil and will be used for request cancellation. If | ||
6011 | // the context is nil a panic will occur. In the future the SDK may create | ||
6012 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
6013 | // for more information on using Contexts. | ||
6014 | func (c *S3) UploadPartCopyWithContext(ctx aws.Context, input *UploadPartCopyInput, opts ...request.Option) (*UploadPartCopyOutput, error) { | ||
6015 | req, out := c.UploadPartCopyRequest(input) | ||
6016 | req.SetContext(ctx) | ||
6017 | req.ApplyOptions(opts...) | ||
6018 | return out, req.Send() | ||
6019 | } | ||
6020 | |||
6021 | // Specifies the days since the initiation of an Incomplete Multipart Upload | ||
6022 | // that Lifecycle will wait before permanently removing all parts of the upload. | ||
6023 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AbortIncompleteMultipartUpload | ||
6024 | type AbortIncompleteMultipartUpload struct { | ||
6025 | _ struct{} `type:"structure"` | ||
6026 | |||
6027 | // Indicates the number of days that must pass since initiation for Lifecycle | ||
6028 | // to abort an Incomplete Multipart Upload. | ||
6029 | DaysAfterInitiation *int64 `type:"integer"` | ||
6030 | } | ||
6031 | |||
6032 | // String returns the string representation | ||
6033 | func (s AbortIncompleteMultipartUpload) String() string { | ||
6034 | return awsutil.Prettify(s) | ||
6035 | } | ||
6036 | |||
6037 | // GoString returns the string representation | ||
6038 | func (s AbortIncompleteMultipartUpload) GoString() string { | ||
6039 | return s.String() | ||
6040 | } | ||
6041 | |||
6042 | // SetDaysAfterInitiation sets the DaysAfterInitiation field's value. | ||
6043 | func (s *AbortIncompleteMultipartUpload) SetDaysAfterInitiation(v int64) *AbortIncompleteMultipartUpload { | ||
6044 | s.DaysAfterInitiation = &v | ||
6045 | return s | ||
6046 | } | ||
6047 | |||
6048 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AbortMultipartUploadRequest | ||
6049 | type AbortMultipartUploadInput struct { | ||
6050 | _ struct{} `type:"structure"` | ||
6051 | |||
6052 | // Bucket is a required field | ||
6053 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
6054 | |||
6055 | // Key is a required field | ||
6056 | Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` | ||
6057 | |||
6058 | // Confirms that the requester knows that she or he will be charged for the | ||
6059 | // request. Bucket owners need not specify this parameter in their requests. | ||
6060 | // Documentation on downloading objects from requester pays buckets can be found | ||
6061 | // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html | ||
6062 | RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` | ||
6063 | |||
6064 | // UploadId is a required field | ||
6065 | UploadId *string `location:"querystring" locationName:"uploadId" type:"string" required:"true"` | ||
6066 | } | ||
6067 | |||
6068 | // String returns the string representation | ||
6069 | func (s AbortMultipartUploadInput) String() string { | ||
6070 | return awsutil.Prettify(s) | ||
6071 | } | ||
6072 | |||
6073 | // GoString returns the string representation | ||
6074 | func (s AbortMultipartUploadInput) GoString() string { | ||
6075 | return s.String() | ||
6076 | } | ||
6077 | |||
6078 | // Validate inspects the fields of the type to determine if they are valid. | ||
6079 | func (s *AbortMultipartUploadInput) Validate() error { | ||
6080 | invalidParams := request.ErrInvalidParams{Context: "AbortMultipartUploadInput"} | ||
6081 | if s.Bucket == nil { | ||
6082 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
6083 | } | ||
6084 | if s.Key == nil { | ||
6085 | invalidParams.Add(request.NewErrParamRequired("Key")) | ||
6086 | } | ||
6087 | if s.Key != nil && len(*s.Key) < 1 { | ||
6088 | invalidParams.Add(request.NewErrParamMinLen("Key", 1)) | ||
6089 | } | ||
6090 | if s.UploadId == nil { | ||
6091 | invalidParams.Add(request.NewErrParamRequired("UploadId")) | ||
6092 | } | ||
6093 | |||
6094 | if invalidParams.Len() > 0 { | ||
6095 | return invalidParams | ||
6096 | } | ||
6097 | return nil | ||
6098 | } | ||
6099 | |||
6100 | // SetBucket sets the Bucket field's value. | ||
6101 | func (s *AbortMultipartUploadInput) SetBucket(v string) *AbortMultipartUploadInput { | ||
6102 | s.Bucket = &v | ||
6103 | return s | ||
6104 | } | ||
6105 | |||
6106 | // SetKey sets the Key field's value. | ||
6107 | func (s *AbortMultipartUploadInput) SetKey(v string) *AbortMultipartUploadInput { | ||
6108 | s.Key = &v | ||
6109 | return s | ||
6110 | } | ||
6111 | |||
6112 | // SetRequestPayer sets the RequestPayer field's value. | ||
6113 | func (s *AbortMultipartUploadInput) SetRequestPayer(v string) *AbortMultipartUploadInput { | ||
6114 | s.RequestPayer = &v | ||
6115 | return s | ||
6116 | } | ||
6117 | |||
6118 | // SetUploadId sets the UploadId field's value. | ||
6119 | func (s *AbortMultipartUploadInput) SetUploadId(v string) *AbortMultipartUploadInput { | ||
6120 | s.UploadId = &v | ||
6121 | return s | ||
6122 | } | ||
6123 | |||
6124 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AbortMultipartUploadOutput | ||
6125 | type AbortMultipartUploadOutput struct { | ||
6126 | _ struct{} `type:"structure"` | ||
6127 | |||
6128 | // If present, indicates that the requester was successfully charged for the | ||
6129 | // request. | ||
6130 | RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` | ||
6131 | } | ||
6132 | |||
6133 | // String returns the string representation | ||
6134 | func (s AbortMultipartUploadOutput) String() string { | ||
6135 | return awsutil.Prettify(s) | ||
6136 | } | ||
6137 | |||
6138 | // GoString returns the string representation | ||
6139 | func (s AbortMultipartUploadOutput) GoString() string { | ||
6140 | return s.String() | ||
6141 | } | ||
6142 | |||
6143 | // SetRequestCharged sets the RequestCharged field's value. | ||
6144 | func (s *AbortMultipartUploadOutput) SetRequestCharged(v string) *AbortMultipartUploadOutput { | ||
6145 | s.RequestCharged = &v | ||
6146 | return s | ||
6147 | } | ||
6148 | |||
6149 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AccelerateConfiguration | ||
6150 | type AccelerateConfiguration struct { | ||
6151 | _ struct{} `type:"structure"` | ||
6152 | |||
6153 | // The accelerate configuration of the bucket. | ||
6154 | Status *string `type:"string" enum:"BucketAccelerateStatus"` | ||
6155 | } | ||
6156 | |||
6157 | // String returns the string representation | ||
6158 | func (s AccelerateConfiguration) String() string { | ||
6159 | return awsutil.Prettify(s) | ||
6160 | } | ||
6161 | |||
6162 | // GoString returns the string representation | ||
6163 | func (s AccelerateConfiguration) GoString() string { | ||
6164 | return s.String() | ||
6165 | } | ||
6166 | |||
6167 | // SetStatus sets the Status field's value. | ||
6168 | func (s *AccelerateConfiguration) SetStatus(v string) *AccelerateConfiguration { | ||
6169 | s.Status = &v | ||
6170 | return s | ||
6171 | } | ||
6172 | |||
6173 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AccessControlPolicy | ||
6174 | type AccessControlPolicy struct { | ||
6175 | _ struct{} `type:"structure"` | ||
6176 | |||
6177 | // A list of grants. | ||
6178 | Grants []*Grant `locationName:"AccessControlList" locationNameList:"Grant" type:"list"` | ||
6179 | |||
6180 | Owner *Owner `type:"structure"` | ||
6181 | } | ||
6182 | |||
6183 | // String returns the string representation | ||
6184 | func (s AccessControlPolicy) String() string { | ||
6185 | return awsutil.Prettify(s) | ||
6186 | } | ||
6187 | |||
6188 | // GoString returns the string representation | ||
6189 | func (s AccessControlPolicy) GoString() string { | ||
6190 | return s.String() | ||
6191 | } | ||
6192 | |||
6193 | // Validate inspects the fields of the type to determine if they are valid. | ||
6194 | func (s *AccessControlPolicy) Validate() error { | ||
6195 | invalidParams := request.ErrInvalidParams{Context: "AccessControlPolicy"} | ||
6196 | if s.Grants != nil { | ||
6197 | for i, v := range s.Grants { | ||
6198 | if v == nil { | ||
6199 | continue | ||
6200 | } | ||
6201 | if err := v.Validate(); err != nil { | ||
6202 | invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Grants", i), err.(request.ErrInvalidParams)) | ||
6203 | } | ||
6204 | } | ||
6205 | } | ||
6206 | |||
6207 | if invalidParams.Len() > 0 { | ||
6208 | return invalidParams | ||
6209 | } | ||
6210 | return nil | ||
6211 | } | ||
6212 | |||
6213 | // SetGrants sets the Grants field's value. | ||
6214 | func (s *AccessControlPolicy) SetGrants(v []*Grant) *AccessControlPolicy { | ||
6215 | s.Grants = v | ||
6216 | return s | ||
6217 | } | ||
6218 | |||
6219 | // SetOwner sets the Owner field's value. | ||
6220 | func (s *AccessControlPolicy) SetOwner(v *Owner) *AccessControlPolicy { | ||
6221 | s.Owner = v | ||
6222 | return s | ||
6223 | } | ||
6224 | |||
6225 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AnalyticsAndOperator | ||
6226 | type AnalyticsAndOperator struct { | ||
6227 | _ struct{} `type:"structure"` | ||
6228 | |||
6229 | // The prefix to use when evaluating an AND predicate. | ||
6230 | Prefix *string `type:"string"` | ||
6231 | |||
6232 | // The list of tags to use when evaluating an AND predicate. | ||
6233 | Tags []*Tag `locationName:"Tag" locationNameList:"Tag" type:"list" flattened:"true"` | ||
6234 | } | ||
6235 | |||
6236 | // String returns the string representation | ||
6237 | func (s AnalyticsAndOperator) String() string { | ||
6238 | return awsutil.Prettify(s) | ||
6239 | } | ||
6240 | |||
6241 | // GoString returns the string representation | ||
6242 | func (s AnalyticsAndOperator) GoString() string { | ||
6243 | return s.String() | ||
6244 | } | ||
6245 | |||
6246 | // Validate inspects the fields of the type to determine if they are valid. | ||
6247 | func (s *AnalyticsAndOperator) Validate() error { | ||
6248 | invalidParams := request.ErrInvalidParams{Context: "AnalyticsAndOperator"} | ||
6249 | if s.Tags != nil { | ||
6250 | for i, v := range s.Tags { | ||
6251 | if v == nil { | ||
6252 | continue | ||
6253 | } | ||
6254 | if err := v.Validate(); err != nil { | ||
6255 | invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) | ||
6256 | } | ||
6257 | } | ||
6258 | } | ||
6259 | |||
6260 | if invalidParams.Len() > 0 { | ||
6261 | return invalidParams | ||
6262 | } | ||
6263 | return nil | ||
6264 | } | ||
6265 | |||
6266 | // SetPrefix sets the Prefix field's value. | ||
6267 | func (s *AnalyticsAndOperator) SetPrefix(v string) *AnalyticsAndOperator { | ||
6268 | s.Prefix = &v | ||
6269 | return s | ||
6270 | } | ||
6271 | |||
6272 | // SetTags sets the Tags field's value. | ||
6273 | func (s *AnalyticsAndOperator) SetTags(v []*Tag) *AnalyticsAndOperator { | ||
6274 | s.Tags = v | ||
6275 | return s | ||
6276 | } | ||
6277 | |||
6278 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AnalyticsConfiguration | ||
6279 | type AnalyticsConfiguration struct { | ||
6280 | _ struct{} `type:"structure"` | ||
6281 | |||
6282 | // The filter used to describe a set of objects for analyses. A filter must | ||
6283 | // have exactly one prefix, one tag, or one conjunction (AnalyticsAndOperator). | ||
6284 | // If no filter is provided, all objects will be considered in any analysis. | ||
6285 | Filter *AnalyticsFilter `type:"structure"` | ||
6286 | |||
6287 | // The identifier used to represent an analytics configuration. | ||
6288 | // | ||
6289 | // Id is a required field | ||
6290 | Id *string `type:"string" required:"true"` | ||
6291 | |||
6292 | // If present, it indicates that data related to access patterns will be collected | ||
6293 | // and made available to analyze the tradeoffs between different storage classes. | ||
6294 | // | ||
6295 | // StorageClassAnalysis is a required field | ||
6296 | StorageClassAnalysis *StorageClassAnalysis `type:"structure" required:"true"` | ||
6297 | } | ||
6298 | |||
6299 | // String returns the string representation | ||
6300 | func (s AnalyticsConfiguration) String() string { | ||
6301 | return awsutil.Prettify(s) | ||
6302 | } | ||
6303 | |||
6304 | // GoString returns the string representation | ||
6305 | func (s AnalyticsConfiguration) GoString() string { | ||
6306 | return s.String() | ||
6307 | } | ||
6308 | |||
6309 | // Validate inspects the fields of the type to determine if they are valid. | ||
6310 | func (s *AnalyticsConfiguration) Validate() error { | ||
6311 | invalidParams := request.ErrInvalidParams{Context: "AnalyticsConfiguration"} | ||
6312 | if s.Id == nil { | ||
6313 | invalidParams.Add(request.NewErrParamRequired("Id")) | ||
6314 | } | ||
6315 | if s.StorageClassAnalysis == nil { | ||
6316 | invalidParams.Add(request.NewErrParamRequired("StorageClassAnalysis")) | ||
6317 | } | ||
6318 | if s.Filter != nil { | ||
6319 | if err := s.Filter.Validate(); err != nil { | ||
6320 | invalidParams.AddNested("Filter", err.(request.ErrInvalidParams)) | ||
6321 | } | ||
6322 | } | ||
6323 | if s.StorageClassAnalysis != nil { | ||
6324 | if err := s.StorageClassAnalysis.Validate(); err != nil { | ||
6325 | invalidParams.AddNested("StorageClassAnalysis", err.(request.ErrInvalidParams)) | ||
6326 | } | ||
6327 | } | ||
6328 | |||
6329 | if invalidParams.Len() > 0 { | ||
6330 | return invalidParams | ||
6331 | } | ||
6332 | return nil | ||
6333 | } | ||
6334 | |||
6335 | // SetFilter sets the Filter field's value. | ||
6336 | func (s *AnalyticsConfiguration) SetFilter(v *AnalyticsFilter) *AnalyticsConfiguration { | ||
6337 | s.Filter = v | ||
6338 | return s | ||
6339 | } | ||
6340 | |||
6341 | // SetId sets the Id field's value. | ||
6342 | func (s *AnalyticsConfiguration) SetId(v string) *AnalyticsConfiguration { | ||
6343 | s.Id = &v | ||
6344 | return s | ||
6345 | } | ||
6346 | |||
6347 | // SetStorageClassAnalysis sets the StorageClassAnalysis field's value. | ||
6348 | func (s *AnalyticsConfiguration) SetStorageClassAnalysis(v *StorageClassAnalysis) *AnalyticsConfiguration { | ||
6349 | s.StorageClassAnalysis = v | ||
6350 | return s | ||
6351 | } | ||
6352 | |||
6353 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AnalyticsExportDestination | ||
6354 | type AnalyticsExportDestination struct { | ||
6355 | _ struct{} `type:"structure"` | ||
6356 | |||
6357 | // A destination signifying output to an S3 bucket. | ||
6358 | // | ||
6359 | // S3BucketDestination is a required field | ||
6360 | S3BucketDestination *AnalyticsS3BucketDestination `type:"structure" required:"true"` | ||
6361 | } | ||
6362 | |||
6363 | // String returns the string representation | ||
6364 | func (s AnalyticsExportDestination) String() string { | ||
6365 | return awsutil.Prettify(s) | ||
6366 | } | ||
6367 | |||
6368 | // GoString returns the string representation | ||
6369 | func (s AnalyticsExportDestination) GoString() string { | ||
6370 | return s.String() | ||
6371 | } | ||
6372 | |||
6373 | // Validate inspects the fields of the type to determine if they are valid. | ||
6374 | func (s *AnalyticsExportDestination) Validate() error { | ||
6375 | invalidParams := request.ErrInvalidParams{Context: "AnalyticsExportDestination"} | ||
6376 | if s.S3BucketDestination == nil { | ||
6377 | invalidParams.Add(request.NewErrParamRequired("S3BucketDestination")) | ||
6378 | } | ||
6379 | if s.S3BucketDestination != nil { | ||
6380 | if err := s.S3BucketDestination.Validate(); err != nil { | ||
6381 | invalidParams.AddNested("S3BucketDestination", err.(request.ErrInvalidParams)) | ||
6382 | } | ||
6383 | } | ||
6384 | |||
6385 | if invalidParams.Len() > 0 { | ||
6386 | return invalidParams | ||
6387 | } | ||
6388 | return nil | ||
6389 | } | ||
6390 | |||
6391 | // SetS3BucketDestination sets the S3BucketDestination field's value. | ||
6392 | func (s *AnalyticsExportDestination) SetS3BucketDestination(v *AnalyticsS3BucketDestination) *AnalyticsExportDestination { | ||
6393 | s.S3BucketDestination = v | ||
6394 | return s | ||
6395 | } | ||
6396 | |||
6397 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AnalyticsFilter | ||
6398 | type AnalyticsFilter struct { | ||
6399 | _ struct{} `type:"structure"` | ||
6400 | |||
6401 | // A conjunction (logical AND) of predicates, which is used in evaluating an | ||
6402 | // analytics filter. The operator must have at least two predicates. | ||
6403 | And *AnalyticsAndOperator `type:"structure"` | ||
6404 | |||
6405 | // The prefix to use when evaluating an analytics filter. | ||
6406 | Prefix *string `type:"string"` | ||
6407 | |||
6408 | // The tag to use when evaluating an analytics filter. | ||
6409 | Tag *Tag `type:"structure"` | ||
6410 | } | ||
6411 | |||
6412 | // String returns the string representation | ||
6413 | func (s AnalyticsFilter) String() string { | ||
6414 | return awsutil.Prettify(s) | ||
6415 | } | ||
6416 | |||
6417 | // GoString returns the string representation | ||
6418 | func (s AnalyticsFilter) GoString() string { | ||
6419 | return s.String() | ||
6420 | } | ||
6421 | |||
6422 | // Validate inspects the fields of the type to determine if they are valid. | ||
6423 | func (s *AnalyticsFilter) Validate() error { | ||
6424 | invalidParams := request.ErrInvalidParams{Context: "AnalyticsFilter"} | ||
6425 | if s.And != nil { | ||
6426 | if err := s.And.Validate(); err != nil { | ||
6427 | invalidParams.AddNested("And", err.(request.ErrInvalidParams)) | ||
6428 | } | ||
6429 | } | ||
6430 | if s.Tag != nil { | ||
6431 | if err := s.Tag.Validate(); err != nil { | ||
6432 | invalidParams.AddNested("Tag", err.(request.ErrInvalidParams)) | ||
6433 | } | ||
6434 | } | ||
6435 | |||
6436 | if invalidParams.Len() > 0 { | ||
6437 | return invalidParams | ||
6438 | } | ||
6439 | return nil | ||
6440 | } | ||
6441 | |||
6442 | // SetAnd sets the And field's value. | ||
6443 | func (s *AnalyticsFilter) SetAnd(v *AnalyticsAndOperator) *AnalyticsFilter { | ||
6444 | s.And = v | ||
6445 | return s | ||
6446 | } | ||
6447 | |||
6448 | // SetPrefix sets the Prefix field's value. | ||
6449 | func (s *AnalyticsFilter) SetPrefix(v string) *AnalyticsFilter { | ||
6450 | s.Prefix = &v | ||
6451 | return s | ||
6452 | } | ||
6453 | |||
6454 | // SetTag sets the Tag field's value. | ||
6455 | func (s *AnalyticsFilter) SetTag(v *Tag) *AnalyticsFilter { | ||
6456 | s.Tag = v | ||
6457 | return s | ||
6458 | } | ||
6459 | |||
6460 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AnalyticsS3BucketDestination | ||
6461 | type AnalyticsS3BucketDestination struct { | ||
6462 | _ struct{} `type:"structure"` | ||
6463 | |||
6464 | // The Amazon resource name (ARN) of the bucket to which data is exported. | ||
6465 | // | ||
6466 | // Bucket is a required field | ||
6467 | Bucket *string `type:"string" required:"true"` | ||
6468 | |||
6469 | // The account ID that owns the destination bucket. If no account ID is provided, | ||
6470 | // the owner will not be validated prior to exporting data. | ||
6471 | BucketAccountId *string `type:"string"` | ||
6472 | |||
6473 | // The file format used when exporting data to Amazon S3. | ||
6474 | // | ||
6475 | // Format is a required field | ||
6476 | Format *string `type:"string" required:"true" enum:"AnalyticsS3ExportFileFormat"` | ||
6477 | |||
6478 | // The prefix to use when exporting data. The exported data begins with this | ||
6479 | // prefix. | ||
6480 | Prefix *string `type:"string"` | ||
6481 | } | ||
6482 | |||
6483 | // String returns the string representation | ||
6484 | func (s AnalyticsS3BucketDestination) String() string { | ||
6485 | return awsutil.Prettify(s) | ||
6486 | } | ||
6487 | |||
6488 | // GoString returns the string representation | ||
6489 | func (s AnalyticsS3BucketDestination) GoString() string { | ||
6490 | return s.String() | ||
6491 | } | ||
6492 | |||
6493 | // Validate inspects the fields of the type to determine if they are valid. | ||
6494 | func (s *AnalyticsS3BucketDestination) Validate() error { | ||
6495 | invalidParams := request.ErrInvalidParams{Context: "AnalyticsS3BucketDestination"} | ||
6496 | if s.Bucket == nil { | ||
6497 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
6498 | } | ||
6499 | if s.Format == nil { | ||
6500 | invalidParams.Add(request.NewErrParamRequired("Format")) | ||
6501 | } | ||
6502 | |||
6503 | if invalidParams.Len() > 0 { | ||
6504 | return invalidParams | ||
6505 | } | ||
6506 | return nil | ||
6507 | } | ||
6508 | |||
6509 | // SetBucket sets the Bucket field's value. | ||
6510 | func (s *AnalyticsS3BucketDestination) SetBucket(v string) *AnalyticsS3BucketDestination { | ||
6511 | s.Bucket = &v | ||
6512 | return s | ||
6513 | } | ||
6514 | |||
6515 | // SetBucketAccountId sets the BucketAccountId field's value. | ||
6516 | func (s *AnalyticsS3BucketDestination) SetBucketAccountId(v string) *AnalyticsS3BucketDestination { | ||
6517 | s.BucketAccountId = &v | ||
6518 | return s | ||
6519 | } | ||
6520 | |||
6521 | // SetFormat sets the Format field's value. | ||
6522 | func (s *AnalyticsS3BucketDestination) SetFormat(v string) *AnalyticsS3BucketDestination { | ||
6523 | s.Format = &v | ||
6524 | return s | ||
6525 | } | ||
6526 | |||
6527 | // SetPrefix sets the Prefix field's value. | ||
6528 | func (s *AnalyticsS3BucketDestination) SetPrefix(v string) *AnalyticsS3BucketDestination { | ||
6529 | s.Prefix = &v | ||
6530 | return s | ||
6531 | } | ||
6532 | |||
6533 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Bucket | ||
6534 | type Bucket struct { | ||
6535 | _ struct{} `type:"structure"` | ||
6536 | |||
6537 | // Date the bucket was created. | ||
6538 | CreationDate *time.Time `type:"timestamp" timestampFormat:"iso8601"` | ||
6539 | |||
6540 | // The name of the bucket. | ||
6541 | Name *string `type:"string"` | ||
6542 | } | ||
6543 | |||
6544 | // String returns the string representation | ||
6545 | func (s Bucket) String() string { | ||
6546 | return awsutil.Prettify(s) | ||
6547 | } | ||
6548 | |||
6549 | // GoString returns the string representation | ||
6550 | func (s Bucket) GoString() string { | ||
6551 | return s.String() | ||
6552 | } | ||
6553 | |||
6554 | // SetCreationDate sets the CreationDate field's value. | ||
6555 | func (s *Bucket) SetCreationDate(v time.Time) *Bucket { | ||
6556 | s.CreationDate = &v | ||
6557 | return s | ||
6558 | } | ||
6559 | |||
6560 | // SetName sets the Name field's value. | ||
6561 | func (s *Bucket) SetName(v string) *Bucket { | ||
6562 | s.Name = &v | ||
6563 | return s | ||
6564 | } | ||
6565 | |||
6566 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/BucketLifecycleConfiguration | ||
6567 | type BucketLifecycleConfiguration struct { | ||
6568 | _ struct{} `type:"structure"` | ||
6569 | |||
6570 | // Rules is a required field | ||
6571 | Rules []*LifecycleRule `locationName:"Rule" type:"list" flattened:"true" required:"true"` | ||
6572 | } | ||
6573 | |||
6574 | // String returns the string representation | ||
6575 | func (s BucketLifecycleConfiguration) String() string { | ||
6576 | return awsutil.Prettify(s) | ||
6577 | } | ||
6578 | |||
6579 | // GoString returns the string representation | ||
6580 | func (s BucketLifecycleConfiguration) GoString() string { | ||
6581 | return s.String() | ||
6582 | } | ||
6583 | |||
6584 | // Validate inspects the fields of the type to determine if they are valid. | ||
6585 | func (s *BucketLifecycleConfiguration) Validate() error { | ||
6586 | invalidParams := request.ErrInvalidParams{Context: "BucketLifecycleConfiguration"} | ||
6587 | if s.Rules == nil { | ||
6588 | invalidParams.Add(request.NewErrParamRequired("Rules")) | ||
6589 | } | ||
6590 | if s.Rules != nil { | ||
6591 | for i, v := range s.Rules { | ||
6592 | if v == nil { | ||
6593 | continue | ||
6594 | } | ||
6595 | if err := v.Validate(); err != nil { | ||
6596 | invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Rules", i), err.(request.ErrInvalidParams)) | ||
6597 | } | ||
6598 | } | ||
6599 | } | ||
6600 | |||
6601 | if invalidParams.Len() > 0 { | ||
6602 | return invalidParams | ||
6603 | } | ||
6604 | return nil | ||
6605 | } | ||
6606 | |||
6607 | // SetRules sets the Rules field's value. | ||
6608 | func (s *BucketLifecycleConfiguration) SetRules(v []*LifecycleRule) *BucketLifecycleConfiguration { | ||
6609 | s.Rules = v | ||
6610 | return s | ||
6611 | } | ||
6612 | |||
6613 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/BucketLoggingStatus | ||
6614 | type BucketLoggingStatus struct { | ||
6615 | _ struct{} `type:"structure"` | ||
6616 | |||
6617 | LoggingEnabled *LoggingEnabled `type:"structure"` | ||
6618 | } | ||
6619 | |||
6620 | // String returns the string representation | ||
6621 | func (s BucketLoggingStatus) String() string { | ||
6622 | return awsutil.Prettify(s) | ||
6623 | } | ||
6624 | |||
6625 | // GoString returns the string representation | ||
6626 | func (s BucketLoggingStatus) GoString() string { | ||
6627 | return s.String() | ||
6628 | } | ||
6629 | |||
6630 | // Validate inspects the fields of the type to determine if they are valid. | ||
6631 | func (s *BucketLoggingStatus) Validate() error { | ||
6632 | invalidParams := request.ErrInvalidParams{Context: "BucketLoggingStatus"} | ||
6633 | if s.LoggingEnabled != nil { | ||
6634 | if err := s.LoggingEnabled.Validate(); err != nil { | ||
6635 | invalidParams.AddNested("LoggingEnabled", err.(request.ErrInvalidParams)) | ||
6636 | } | ||
6637 | } | ||
6638 | |||
6639 | if invalidParams.Len() > 0 { | ||
6640 | return invalidParams | ||
6641 | } | ||
6642 | return nil | ||
6643 | } | ||
6644 | |||
6645 | // SetLoggingEnabled sets the LoggingEnabled field's value. | ||
6646 | func (s *BucketLoggingStatus) SetLoggingEnabled(v *LoggingEnabled) *BucketLoggingStatus { | ||
6647 | s.LoggingEnabled = v | ||
6648 | return s | ||
6649 | } | ||
6650 | |||
6651 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CORSConfiguration | ||
6652 | type CORSConfiguration struct { | ||
6653 | _ struct{} `type:"structure"` | ||
6654 | |||
6655 | // CORSRules is a required field | ||
6656 | CORSRules []*CORSRule `locationName:"CORSRule" type:"list" flattened:"true" required:"true"` | ||
6657 | } | ||
6658 | |||
6659 | // String returns the string representation | ||
6660 | func (s CORSConfiguration) String() string { | ||
6661 | return awsutil.Prettify(s) | ||
6662 | } | ||
6663 | |||
6664 | // GoString returns the string representation | ||
6665 | func (s CORSConfiguration) GoString() string { | ||
6666 | return s.String() | ||
6667 | } | ||
6668 | |||
6669 | // Validate inspects the fields of the type to determine if they are valid. | ||
6670 | func (s *CORSConfiguration) Validate() error { | ||
6671 | invalidParams := request.ErrInvalidParams{Context: "CORSConfiguration"} | ||
6672 | if s.CORSRules == nil { | ||
6673 | invalidParams.Add(request.NewErrParamRequired("CORSRules")) | ||
6674 | } | ||
6675 | if s.CORSRules != nil { | ||
6676 | for i, v := range s.CORSRules { | ||
6677 | if v == nil { | ||
6678 | continue | ||
6679 | } | ||
6680 | if err := v.Validate(); err != nil { | ||
6681 | invalidParams.AddNested(fmt.Sprintf("%s[%v]", "CORSRules", i), err.(request.ErrInvalidParams)) | ||
6682 | } | ||
6683 | } | ||
6684 | } | ||
6685 | |||
6686 | if invalidParams.Len() > 0 { | ||
6687 | return invalidParams | ||
6688 | } | ||
6689 | return nil | ||
6690 | } | ||
6691 | |||
6692 | // SetCORSRules sets the CORSRules field's value. | ||
6693 | func (s *CORSConfiguration) SetCORSRules(v []*CORSRule) *CORSConfiguration { | ||
6694 | s.CORSRules = v | ||
6695 | return s | ||
6696 | } | ||
6697 | |||
6698 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CORSRule | ||
6699 | type CORSRule struct { | ||
6700 | _ struct{} `type:"structure"` | ||
6701 | |||
6702 | // Specifies which headers are allowed in a pre-flight OPTIONS request. | ||
6703 | AllowedHeaders []*string `locationName:"AllowedHeader" type:"list" flattened:"true"` | ||
6704 | |||
6705 | // Identifies HTTP methods that the domain/origin specified in the rule is allowed | ||
6706 | // to execute. | ||
6707 | // | ||
6708 | // AllowedMethods is a required field | ||
6709 | AllowedMethods []*string `locationName:"AllowedMethod" type:"list" flattened:"true" required:"true"` | ||
6710 | |||
6711 | // One or more origins you want customers to be able to access the bucket from. | ||
6712 | // | ||
6713 | // AllowedOrigins is a required field | ||
6714 | AllowedOrigins []*string `locationName:"AllowedOrigin" type:"list" flattened:"true" required:"true"` | ||
6715 | |||
6716 | // One or more headers in the response that you want customers to be able to | ||
6717 | // access from their applications (for example, from a JavaScript XMLHttpRequest | ||
6718 | // object). | ||
6719 | ExposeHeaders []*string `locationName:"ExposeHeader" type:"list" flattened:"true"` | ||
6720 | |||
6721 | // The time in seconds that your browser is to cache the preflight response | ||
6722 | // for the specified resource. | ||
6723 | MaxAgeSeconds *int64 `type:"integer"` | ||
6724 | } | ||
6725 | |||
6726 | // String returns the string representation | ||
6727 | func (s CORSRule) String() string { | ||
6728 | return awsutil.Prettify(s) | ||
6729 | } | ||
6730 | |||
6731 | // GoString returns the string representation | ||
6732 | func (s CORSRule) GoString() string { | ||
6733 | return s.String() | ||
6734 | } | ||
6735 | |||
6736 | // Validate inspects the fields of the type to determine if they are valid. | ||
6737 | func (s *CORSRule) Validate() error { | ||
6738 | invalidParams := request.ErrInvalidParams{Context: "CORSRule"} | ||
6739 | if s.AllowedMethods == nil { | ||
6740 | invalidParams.Add(request.NewErrParamRequired("AllowedMethods")) | ||
6741 | } | ||
6742 | if s.AllowedOrigins == nil { | ||
6743 | invalidParams.Add(request.NewErrParamRequired("AllowedOrigins")) | ||
6744 | } | ||
6745 | |||
6746 | if invalidParams.Len() > 0 { | ||
6747 | return invalidParams | ||
6748 | } | ||
6749 | return nil | ||
6750 | } | ||
6751 | |||
6752 | // SetAllowedHeaders sets the AllowedHeaders field's value. | ||
6753 | func (s *CORSRule) SetAllowedHeaders(v []*string) *CORSRule { | ||
6754 | s.AllowedHeaders = v | ||
6755 | return s | ||
6756 | } | ||
6757 | |||
6758 | // SetAllowedMethods sets the AllowedMethods field's value. | ||
6759 | func (s *CORSRule) SetAllowedMethods(v []*string) *CORSRule { | ||
6760 | s.AllowedMethods = v | ||
6761 | return s | ||
6762 | } | ||
6763 | |||
6764 | // SetAllowedOrigins sets the AllowedOrigins field's value. | ||
6765 | func (s *CORSRule) SetAllowedOrigins(v []*string) *CORSRule { | ||
6766 | s.AllowedOrigins = v | ||
6767 | return s | ||
6768 | } | ||
6769 | |||
6770 | // SetExposeHeaders sets the ExposeHeaders field's value. | ||
6771 | func (s *CORSRule) SetExposeHeaders(v []*string) *CORSRule { | ||
6772 | s.ExposeHeaders = v | ||
6773 | return s | ||
6774 | } | ||
6775 | |||
6776 | // SetMaxAgeSeconds sets the MaxAgeSeconds field's value. | ||
6777 | func (s *CORSRule) SetMaxAgeSeconds(v int64) *CORSRule { | ||
6778 | s.MaxAgeSeconds = &v | ||
6779 | return s | ||
6780 | } | ||
6781 | |||
6782 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CloudFunctionConfiguration | ||
6783 | type CloudFunctionConfiguration struct { | ||
6784 | _ struct{} `type:"structure"` | ||
6785 | |||
6786 | CloudFunction *string `type:"string"` | ||
6787 | |||
6788 | // Bucket event for which to send notifications. | ||
6789 | Event *string `deprecated:"true" type:"string" enum:"Event"` | ||
6790 | |||
6791 | Events []*string `locationName:"Event" type:"list" flattened:"true"` | ||
6792 | |||
6793 | // Optional unique identifier for configurations in a notification configuration. | ||
6794 | // If you don't provide one, Amazon S3 will assign an ID. | ||
6795 | Id *string `type:"string"` | ||
6796 | |||
6797 | InvocationRole *string `type:"string"` | ||
6798 | } | ||
6799 | |||
6800 | // String returns the string representation | ||
6801 | func (s CloudFunctionConfiguration) String() string { | ||
6802 | return awsutil.Prettify(s) | ||
6803 | } | ||
6804 | |||
6805 | // GoString returns the string representation | ||
6806 | func (s CloudFunctionConfiguration) GoString() string { | ||
6807 | return s.String() | ||
6808 | } | ||
6809 | |||
6810 | // SetCloudFunction sets the CloudFunction field's value. | ||
6811 | func (s *CloudFunctionConfiguration) SetCloudFunction(v string) *CloudFunctionConfiguration { | ||
6812 | s.CloudFunction = &v | ||
6813 | return s | ||
6814 | } | ||
6815 | |||
6816 | // SetEvent sets the Event field's value. | ||
6817 | func (s *CloudFunctionConfiguration) SetEvent(v string) *CloudFunctionConfiguration { | ||
6818 | s.Event = &v | ||
6819 | return s | ||
6820 | } | ||
6821 | |||
6822 | // SetEvents sets the Events field's value. | ||
6823 | func (s *CloudFunctionConfiguration) SetEvents(v []*string) *CloudFunctionConfiguration { | ||
6824 | s.Events = v | ||
6825 | return s | ||
6826 | } | ||
6827 | |||
6828 | // SetId sets the Id field's value. | ||
6829 | func (s *CloudFunctionConfiguration) SetId(v string) *CloudFunctionConfiguration { | ||
6830 | s.Id = &v | ||
6831 | return s | ||
6832 | } | ||
6833 | |||
6834 | // SetInvocationRole sets the InvocationRole field's value. | ||
6835 | func (s *CloudFunctionConfiguration) SetInvocationRole(v string) *CloudFunctionConfiguration { | ||
6836 | s.InvocationRole = &v | ||
6837 | return s | ||
6838 | } | ||
6839 | |||
6840 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CommonPrefix | ||
6841 | type CommonPrefix struct { | ||
6842 | _ struct{} `type:"structure"` | ||
6843 | |||
6844 | Prefix *string `type:"string"` | ||
6845 | } | ||
6846 | |||
6847 | // String returns the string representation | ||
6848 | func (s CommonPrefix) String() string { | ||
6849 | return awsutil.Prettify(s) | ||
6850 | } | ||
6851 | |||
6852 | // GoString returns the string representation | ||
6853 | func (s CommonPrefix) GoString() string { | ||
6854 | return s.String() | ||
6855 | } | ||
6856 | |||
6857 | // SetPrefix sets the Prefix field's value. | ||
6858 | func (s *CommonPrefix) SetPrefix(v string) *CommonPrefix { | ||
6859 | s.Prefix = &v | ||
6860 | return s | ||
6861 | } | ||
6862 | |||
6863 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CompleteMultipartUploadRequest | ||
6864 | type CompleteMultipartUploadInput struct { | ||
6865 | _ struct{} `type:"structure" payload:"MultipartUpload"` | ||
6866 | |||
6867 | // Bucket is a required field | ||
6868 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
6869 | |||
6870 | // Key is a required field | ||
6871 | Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` | ||
6872 | |||
6873 | MultipartUpload *CompletedMultipartUpload `locationName:"CompleteMultipartUpload" type:"structure"` | ||
6874 | |||
6875 | // Confirms that the requester knows that she or he will be charged for the | ||
6876 | // request. Bucket owners need not specify this parameter in their requests. | ||
6877 | // Documentation on downloading objects from requester pays buckets can be found | ||
6878 | // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html | ||
6879 | RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` | ||
6880 | |||
6881 | // UploadId is a required field | ||
6882 | UploadId *string `location:"querystring" locationName:"uploadId" type:"string" required:"true"` | ||
6883 | } | ||
6884 | |||
6885 | // String returns the string representation | ||
6886 | func (s CompleteMultipartUploadInput) String() string { | ||
6887 | return awsutil.Prettify(s) | ||
6888 | } | ||
6889 | |||
6890 | // GoString returns the string representation | ||
6891 | func (s CompleteMultipartUploadInput) GoString() string { | ||
6892 | return s.String() | ||
6893 | } | ||
6894 | |||
6895 | // Validate inspects the fields of the type to determine if they are valid. | ||
6896 | func (s *CompleteMultipartUploadInput) Validate() error { | ||
6897 | invalidParams := request.ErrInvalidParams{Context: "CompleteMultipartUploadInput"} | ||
6898 | if s.Bucket == nil { | ||
6899 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
6900 | } | ||
6901 | if s.Key == nil { | ||
6902 | invalidParams.Add(request.NewErrParamRequired("Key")) | ||
6903 | } | ||
6904 | if s.Key != nil && len(*s.Key) < 1 { | ||
6905 | invalidParams.Add(request.NewErrParamMinLen("Key", 1)) | ||
6906 | } | ||
6907 | if s.UploadId == nil { | ||
6908 | invalidParams.Add(request.NewErrParamRequired("UploadId")) | ||
6909 | } | ||
6910 | |||
6911 | if invalidParams.Len() > 0 { | ||
6912 | return invalidParams | ||
6913 | } | ||
6914 | return nil | ||
6915 | } | ||
6916 | |||
6917 | // SetBucket sets the Bucket field's value. | ||
6918 | func (s *CompleteMultipartUploadInput) SetBucket(v string) *CompleteMultipartUploadInput { | ||
6919 | s.Bucket = &v | ||
6920 | return s | ||
6921 | } | ||
6922 | |||
6923 | // SetKey sets the Key field's value. | ||
6924 | func (s *CompleteMultipartUploadInput) SetKey(v string) *CompleteMultipartUploadInput { | ||
6925 | s.Key = &v | ||
6926 | return s | ||
6927 | } | ||
6928 | |||
6929 | // SetMultipartUpload sets the MultipartUpload field's value. | ||
6930 | func (s *CompleteMultipartUploadInput) SetMultipartUpload(v *CompletedMultipartUpload) *CompleteMultipartUploadInput { | ||
6931 | s.MultipartUpload = v | ||
6932 | return s | ||
6933 | } | ||
6934 | |||
6935 | // SetRequestPayer sets the RequestPayer field's value. | ||
6936 | func (s *CompleteMultipartUploadInput) SetRequestPayer(v string) *CompleteMultipartUploadInput { | ||
6937 | s.RequestPayer = &v | ||
6938 | return s | ||
6939 | } | ||
6940 | |||
6941 | // SetUploadId sets the UploadId field's value. | ||
6942 | func (s *CompleteMultipartUploadInput) SetUploadId(v string) *CompleteMultipartUploadInput { | ||
6943 | s.UploadId = &v | ||
6944 | return s | ||
6945 | } | ||
6946 | |||
6947 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CompleteMultipartUploadOutput | ||
6948 | type CompleteMultipartUploadOutput struct { | ||
6949 | _ struct{} `type:"structure"` | ||
6950 | |||
6951 | Bucket *string `type:"string"` | ||
6952 | |||
6953 | // Entity tag of the object. | ||
6954 | ETag *string `type:"string"` | ||
6955 | |||
6956 | // If the object expiration is configured, this will contain the expiration | ||
6957 | // date (expiry-date) and rule ID (rule-id). The value of rule-id is URL encoded. | ||
6958 | Expiration *string `location:"header" locationName:"x-amz-expiration" type:"string"` | ||
6959 | |||
6960 | Key *string `min:"1" type:"string"` | ||
6961 | |||
6962 | Location *string `type:"string"` | ||
6963 | |||
6964 | // If present, indicates that the requester was successfully charged for the | ||
6965 | // request. | ||
6966 | RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` | ||
6967 | |||
6968 | // If present, specifies the ID of the AWS Key Management Service (KMS) master | ||
6969 | // encryption key that was used for the object. | ||
6970 | SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string"` | ||
6971 | |||
6972 | // The Server-side encryption algorithm used when storing this object in S3 | ||
6973 | // (e.g., AES256, aws:kms). | ||
6974 | ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` | ||
6975 | |||
6976 | // Version of the object. | ||
6977 | VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` | ||
6978 | } | ||
6979 | |||
6980 | // String returns the string representation | ||
6981 | func (s CompleteMultipartUploadOutput) String() string { | ||
6982 | return awsutil.Prettify(s) | ||
6983 | } | ||
6984 | |||
6985 | // GoString returns the string representation | ||
6986 | func (s CompleteMultipartUploadOutput) GoString() string { | ||
6987 | return s.String() | ||
6988 | } | ||
6989 | |||
6990 | // SetBucket sets the Bucket field's value. | ||
6991 | func (s *CompleteMultipartUploadOutput) SetBucket(v string) *CompleteMultipartUploadOutput { | ||
6992 | s.Bucket = &v | ||
6993 | return s | ||
6994 | } | ||
6995 | |||
6996 | // SetETag sets the ETag field's value. | ||
6997 | func (s *CompleteMultipartUploadOutput) SetETag(v string) *CompleteMultipartUploadOutput { | ||
6998 | s.ETag = &v | ||
6999 | return s | ||
7000 | } | ||
7001 | |||
7002 | // SetExpiration sets the Expiration field's value. | ||
7003 | func (s *CompleteMultipartUploadOutput) SetExpiration(v string) *CompleteMultipartUploadOutput { | ||
7004 | s.Expiration = &v | ||
7005 | return s | ||
7006 | } | ||
7007 | |||
7008 | // SetKey sets the Key field's value. | ||
7009 | func (s *CompleteMultipartUploadOutput) SetKey(v string) *CompleteMultipartUploadOutput { | ||
7010 | s.Key = &v | ||
7011 | return s | ||
7012 | } | ||
7013 | |||
7014 | // SetLocation sets the Location field's value. | ||
7015 | func (s *CompleteMultipartUploadOutput) SetLocation(v string) *CompleteMultipartUploadOutput { | ||
7016 | s.Location = &v | ||
7017 | return s | ||
7018 | } | ||
7019 | |||
7020 | // SetRequestCharged sets the RequestCharged field's value. | ||
7021 | func (s *CompleteMultipartUploadOutput) SetRequestCharged(v string) *CompleteMultipartUploadOutput { | ||
7022 | s.RequestCharged = &v | ||
7023 | return s | ||
7024 | } | ||
7025 | |||
7026 | // SetSSEKMSKeyId sets the SSEKMSKeyId field's value. | ||
7027 | func (s *CompleteMultipartUploadOutput) SetSSEKMSKeyId(v string) *CompleteMultipartUploadOutput { | ||
7028 | s.SSEKMSKeyId = &v | ||
7029 | return s | ||
7030 | } | ||
7031 | |||
7032 | // SetServerSideEncryption sets the ServerSideEncryption field's value. | ||
7033 | func (s *CompleteMultipartUploadOutput) SetServerSideEncryption(v string) *CompleteMultipartUploadOutput { | ||
7034 | s.ServerSideEncryption = &v | ||
7035 | return s | ||
7036 | } | ||
7037 | |||
7038 | // SetVersionId sets the VersionId field's value. | ||
7039 | func (s *CompleteMultipartUploadOutput) SetVersionId(v string) *CompleteMultipartUploadOutput { | ||
7040 | s.VersionId = &v | ||
7041 | return s | ||
7042 | } | ||
7043 | |||
7044 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CompletedMultipartUpload | ||
7045 | type CompletedMultipartUpload struct { | ||
7046 | _ struct{} `type:"structure"` | ||
7047 | |||
7048 | Parts []*CompletedPart `locationName:"Part" type:"list" flattened:"true"` | ||
7049 | } | ||
7050 | |||
7051 | // String returns the string representation | ||
7052 | func (s CompletedMultipartUpload) String() string { | ||
7053 | return awsutil.Prettify(s) | ||
7054 | } | ||
7055 | |||
7056 | // GoString returns the string representation | ||
7057 | func (s CompletedMultipartUpload) GoString() string { | ||
7058 | return s.String() | ||
7059 | } | ||
7060 | |||
7061 | // SetParts sets the Parts field's value. | ||
7062 | func (s *CompletedMultipartUpload) SetParts(v []*CompletedPart) *CompletedMultipartUpload { | ||
7063 | s.Parts = v | ||
7064 | return s | ||
7065 | } | ||
7066 | |||
7067 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CompletedPart | ||
7068 | type CompletedPart struct { | ||
7069 | _ struct{} `type:"structure"` | ||
7070 | |||
7071 | // Entity tag returned when the part was uploaded. | ||
7072 | ETag *string `type:"string"` | ||
7073 | |||
7074 | // Part number that identifies the part. This is a positive integer between | ||
7075 | // 1 and 10,000. | ||
7076 | PartNumber *int64 `type:"integer"` | ||
7077 | } | ||
7078 | |||
7079 | // String returns the string representation | ||
7080 | func (s CompletedPart) String() string { | ||
7081 | return awsutil.Prettify(s) | ||
7082 | } | ||
7083 | |||
7084 | // GoString returns the string representation | ||
7085 | func (s CompletedPart) GoString() string { | ||
7086 | return s.String() | ||
7087 | } | ||
7088 | |||
7089 | // SetETag sets the ETag field's value. | ||
7090 | func (s *CompletedPart) SetETag(v string) *CompletedPart { | ||
7091 | s.ETag = &v | ||
7092 | return s | ||
7093 | } | ||
7094 | |||
7095 | // SetPartNumber sets the PartNumber field's value. | ||
7096 | func (s *CompletedPart) SetPartNumber(v int64) *CompletedPart { | ||
7097 | s.PartNumber = &v | ||
7098 | return s | ||
7099 | } | ||
7100 | |||
7101 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Condition | ||
7102 | type Condition struct { | ||
7103 | _ struct{} `type:"structure"` | ||
7104 | |||
7105 | // The HTTP error code when the redirect is applied. In the event of an error, | ||
7106 | // if the error code equals this value, then the specified redirect is applied. | ||
7107 | // Required when parent element Condition is specified and sibling KeyPrefixEquals | ||
7108 | // is not specified. If both are specified, then both must be true for the redirect | ||
7109 | // to be applied. | ||
7110 | HttpErrorCodeReturnedEquals *string `type:"string"` | ||
7111 | |||
7112 | // The object key name prefix when the redirect is applied. For example, to | ||
7113 | // redirect requests for ExamplePage.html, the key prefix will be ExamplePage.html. | ||
7114 | // To redirect request for all pages with the prefix docs/, the key prefix will | ||
7115 | // be /docs, which identifies all objects in the docs/ folder. Required when | ||
7116 | // the parent element Condition is specified and sibling HttpErrorCodeReturnedEquals | ||
7117 | // is not specified. If both conditions are specified, both must be true for | ||
7118 | // the redirect to be applied. | ||
7119 | KeyPrefixEquals *string `type:"string"` | ||
7120 | } | ||
7121 | |||
7122 | // String returns the string representation | ||
7123 | func (s Condition) String() string { | ||
7124 | return awsutil.Prettify(s) | ||
7125 | } | ||
7126 | |||
7127 | // GoString returns the string representation | ||
7128 | func (s Condition) GoString() string { | ||
7129 | return s.String() | ||
7130 | } | ||
7131 | |||
7132 | // SetHttpErrorCodeReturnedEquals sets the HttpErrorCodeReturnedEquals field's value. | ||
7133 | func (s *Condition) SetHttpErrorCodeReturnedEquals(v string) *Condition { | ||
7134 | s.HttpErrorCodeReturnedEquals = &v | ||
7135 | return s | ||
7136 | } | ||
7137 | |||
7138 | // SetKeyPrefixEquals sets the KeyPrefixEquals field's value. | ||
7139 | func (s *Condition) SetKeyPrefixEquals(v string) *Condition { | ||
7140 | s.KeyPrefixEquals = &v | ||
7141 | return s | ||
7142 | } | ||
7143 | |||
7144 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CopyObjectRequest | ||
7145 | type CopyObjectInput struct { | ||
7146 | _ struct{} `type:"structure"` | ||
7147 | |||
7148 | // The canned ACL to apply to the object. | ||
7149 | ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"ObjectCannedACL"` | ||
7150 | |||
7151 | // Bucket is a required field | ||
7152 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
7153 | |||
7154 | // Specifies caching behavior along the request/reply chain. | ||
7155 | CacheControl *string `location:"header" locationName:"Cache-Control" type:"string"` | ||
7156 | |||
7157 | // Specifies presentational information for the object. | ||
7158 | ContentDisposition *string `location:"header" locationName:"Content-Disposition" type:"string"` | ||
7159 | |||
7160 | // Specifies what content encodings have been applied to the object and thus | ||
7161 | // what decoding mechanisms must be applied to obtain the media-type referenced | ||
7162 | // by the Content-Type header field. | ||
7163 | ContentEncoding *string `location:"header" locationName:"Content-Encoding" type:"string"` | ||
7164 | |||
7165 | // The language the content is in. | ||
7166 | ContentLanguage *string `location:"header" locationName:"Content-Language" type:"string"` | ||
7167 | |||
7168 | // A standard MIME type describing the format of the object data. | ||
7169 | ContentType *string `location:"header" locationName:"Content-Type" type:"string"` | ||
7170 | |||
7171 | // The name of the source bucket and key name of the source object, separated | ||
7172 | // by a slash (/). Must be URL-encoded. | ||
7173 | // | ||
7174 | // CopySource is a required field | ||
7175 | CopySource *string `location:"header" locationName:"x-amz-copy-source" type:"string" required:"true"` | ||
7176 | |||
7177 | // Copies the object if its entity tag (ETag) matches the specified tag. | ||
7178 | CopySourceIfMatch *string `location:"header" locationName:"x-amz-copy-source-if-match" type:"string"` | ||
7179 | |||
7180 | // Copies the object if it has been modified since the specified time. | ||
7181 | CopySourceIfModifiedSince *time.Time `location:"header" locationName:"x-amz-copy-source-if-modified-since" type:"timestamp" timestampFormat:"rfc822"` | ||
7182 | |||
7183 | // Copies the object if its entity tag (ETag) is different than the specified | ||
7184 | // ETag. | ||
7185 | CopySourceIfNoneMatch *string `location:"header" locationName:"x-amz-copy-source-if-none-match" type:"string"` | ||
7186 | |||
7187 | // Copies the object if it hasn't been modified since the specified time. | ||
7188 | CopySourceIfUnmodifiedSince *time.Time `location:"header" locationName:"x-amz-copy-source-if-unmodified-since" type:"timestamp" timestampFormat:"rfc822"` | ||
7189 | |||
7190 | // Specifies the algorithm to use when decrypting the source object (e.g., AES256). | ||
7191 | CopySourceSSECustomerAlgorithm *string `location:"header" locationName:"x-amz-copy-source-server-side-encryption-customer-algorithm" type:"string"` | ||
7192 | |||
7193 | // Specifies the customer-provided encryption key for Amazon S3 to use to decrypt | ||
7194 | // the source object. The encryption key provided in this header must be one | ||
7195 | // that was used when the source object was created. | ||
7196 | CopySourceSSECustomerKey *string `location:"header" locationName:"x-amz-copy-source-server-side-encryption-customer-key" type:"string"` | ||
7197 | |||
7198 | // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. | ||
7199 | // Amazon S3 uses this header for a message integrity check to ensure the encryption | ||
7200 | // key was transmitted without error. | ||
7201 | CopySourceSSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-copy-source-server-side-encryption-customer-key-MD5" type:"string"` | ||
7202 | |||
7203 | // The date and time at which the object is no longer cacheable. | ||
7204 | Expires *time.Time `location:"header" locationName:"Expires" type:"timestamp" timestampFormat:"rfc822"` | ||
7205 | |||
7206 | // Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. | ||
7207 | GrantFullControl *string `location:"header" locationName:"x-amz-grant-full-control" type:"string"` | ||
7208 | |||
7209 | // Allows grantee to read the object data and its metadata. | ||
7210 | GrantRead *string `location:"header" locationName:"x-amz-grant-read" type:"string"` | ||
7211 | |||
7212 | // Allows grantee to read the object ACL. | ||
7213 | GrantReadACP *string `location:"header" locationName:"x-amz-grant-read-acp" type:"string"` | ||
7214 | |||
7215 | // Allows grantee to write the ACL for the applicable object. | ||
7216 | GrantWriteACP *string `location:"header" locationName:"x-amz-grant-write-acp" type:"string"` | ||
7217 | |||
7218 | // Key is a required field | ||
7219 | Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` | ||
7220 | |||
7221 | // A map of metadata to store with the object in S3. | ||
7222 | Metadata map[string]*string `location:"headers" locationName:"x-amz-meta-" type:"map"` | ||
7223 | |||
7224 | // Specifies whether the metadata is copied from the source object or replaced | ||
7225 | // with metadata provided in the request. | ||
7226 | MetadataDirective *string `location:"header" locationName:"x-amz-metadata-directive" type:"string" enum:"MetadataDirective"` | ||
7227 | |||
7228 | // Confirms that the requester knows that she or he will be charged for the | ||
7229 | // request. Bucket owners need not specify this parameter in their requests. | ||
7230 | // Documentation on downloading objects from requester pays buckets can be found | ||
7231 | // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html | ||
7232 | RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` | ||
7233 | |||
7234 | // Specifies the algorithm to use to when encrypting the object (e.g., AES256). | ||
7235 | SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` | ||
7236 | |||
7237 | // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting | ||
7238 | // data. This value is used to store the object and then it is discarded; Amazon | ||
7239 | // does not store the encryption key. The key must be appropriate for use with | ||
7240 | // the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm | ||
7241 | // header. | ||
7242 | SSECustomerKey *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string"` | ||
7243 | |||
7244 | // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. | ||
7245 | // Amazon S3 uses this header for a message integrity check to ensure the encryption | ||
7246 | // key was transmitted without error. | ||
7247 | SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` | ||
7248 | |||
7249 | // Specifies the AWS KMS key ID to use for object encryption. All GET and PUT | ||
7250 | // requests for an object protected by AWS KMS will fail if not made via SSL | ||
7251 | // or using SigV4. Documentation on configuring any of the officially supported | ||
7252 | // AWS SDKs and CLI can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version | ||
7253 | SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string"` | ||
7254 | |||
7255 | // The Server-side encryption algorithm used when storing this object in S3 | ||
7256 | // (e.g., AES256, aws:kms). | ||
7257 | ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` | ||
7258 | |||
7259 | // The type of storage to use for the object. Defaults to 'STANDARD'. | ||
7260 | StorageClass *string `location:"header" locationName:"x-amz-storage-class" type:"string" enum:"StorageClass"` | ||
7261 | |||
7262 | // The tag-set for the object destination object this value must be used in | ||
7263 | // conjunction with the TaggingDirective. The tag-set must be encoded as URL | ||
7264 | // Query parameters | ||
7265 | Tagging *string `location:"header" locationName:"x-amz-tagging" type:"string"` | ||
7266 | |||
7267 | // Specifies whether the object tag-set are copied from the source object or | ||
7268 | // replaced with tag-set provided in the request. | ||
7269 | TaggingDirective *string `location:"header" locationName:"x-amz-tagging-directive" type:"string" enum:"TaggingDirective"` | ||
7270 | |||
7271 | // If the bucket is configured as a website, redirects requests for this object | ||
7272 | // to another object in the same bucket or to an external URL. Amazon S3 stores | ||
7273 | // the value of this header in the object metadata. | ||
7274 | WebsiteRedirectLocation *string `location:"header" locationName:"x-amz-website-redirect-location" type:"string"` | ||
7275 | } | ||
7276 | |||
7277 | // String returns the string representation | ||
7278 | func (s CopyObjectInput) String() string { | ||
7279 | return awsutil.Prettify(s) | ||
7280 | } | ||
7281 | |||
7282 | // GoString returns the string representation | ||
7283 | func (s CopyObjectInput) GoString() string { | ||
7284 | return s.String() | ||
7285 | } | ||
7286 | |||
7287 | // Validate inspects the fields of the type to determine if they are valid. | ||
7288 | func (s *CopyObjectInput) Validate() error { | ||
7289 | invalidParams := request.ErrInvalidParams{Context: "CopyObjectInput"} | ||
7290 | if s.Bucket == nil { | ||
7291 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
7292 | } | ||
7293 | if s.CopySource == nil { | ||
7294 | invalidParams.Add(request.NewErrParamRequired("CopySource")) | ||
7295 | } | ||
7296 | if s.Key == nil { | ||
7297 | invalidParams.Add(request.NewErrParamRequired("Key")) | ||
7298 | } | ||
7299 | if s.Key != nil && len(*s.Key) < 1 { | ||
7300 | invalidParams.Add(request.NewErrParamMinLen("Key", 1)) | ||
7301 | } | ||
7302 | |||
7303 | if invalidParams.Len() > 0 { | ||
7304 | return invalidParams | ||
7305 | } | ||
7306 | return nil | ||
7307 | } | ||
7308 | |||
7309 | // SetACL sets the ACL field's value. | ||
7310 | func (s *CopyObjectInput) SetACL(v string) *CopyObjectInput { | ||
7311 | s.ACL = &v | ||
7312 | return s | ||
7313 | } | ||
7314 | |||
7315 | // SetBucket sets the Bucket field's value. | ||
7316 | func (s *CopyObjectInput) SetBucket(v string) *CopyObjectInput { | ||
7317 | s.Bucket = &v | ||
7318 | return s | ||
7319 | } | ||
7320 | |||
7321 | // SetCacheControl sets the CacheControl field's value. | ||
7322 | func (s *CopyObjectInput) SetCacheControl(v string) *CopyObjectInput { | ||
7323 | s.CacheControl = &v | ||
7324 | return s | ||
7325 | } | ||
7326 | |||
7327 | // SetContentDisposition sets the ContentDisposition field's value. | ||
7328 | func (s *CopyObjectInput) SetContentDisposition(v string) *CopyObjectInput { | ||
7329 | s.ContentDisposition = &v | ||
7330 | return s | ||
7331 | } | ||
7332 | |||
7333 | // SetContentEncoding sets the ContentEncoding field's value. | ||
7334 | func (s *CopyObjectInput) SetContentEncoding(v string) *CopyObjectInput { | ||
7335 | s.ContentEncoding = &v | ||
7336 | return s | ||
7337 | } | ||
7338 | |||
7339 | // SetContentLanguage sets the ContentLanguage field's value. | ||
7340 | func (s *CopyObjectInput) SetContentLanguage(v string) *CopyObjectInput { | ||
7341 | s.ContentLanguage = &v | ||
7342 | return s | ||
7343 | } | ||
7344 | |||
7345 | // SetContentType sets the ContentType field's value. | ||
7346 | func (s *CopyObjectInput) SetContentType(v string) *CopyObjectInput { | ||
7347 | s.ContentType = &v | ||
7348 | return s | ||
7349 | } | ||
7350 | |||
7351 | // SetCopySource sets the CopySource field's value. | ||
7352 | func (s *CopyObjectInput) SetCopySource(v string) *CopyObjectInput { | ||
7353 | s.CopySource = &v | ||
7354 | return s | ||
7355 | } | ||
7356 | |||
7357 | // SetCopySourceIfMatch sets the CopySourceIfMatch field's value. | ||
7358 | func (s *CopyObjectInput) SetCopySourceIfMatch(v string) *CopyObjectInput { | ||
7359 | s.CopySourceIfMatch = &v | ||
7360 | return s | ||
7361 | } | ||
7362 | |||
7363 | // SetCopySourceIfModifiedSince sets the CopySourceIfModifiedSince field's value. | ||
7364 | func (s *CopyObjectInput) SetCopySourceIfModifiedSince(v time.Time) *CopyObjectInput { | ||
7365 | s.CopySourceIfModifiedSince = &v | ||
7366 | return s | ||
7367 | } | ||
7368 | |||
7369 | // SetCopySourceIfNoneMatch sets the CopySourceIfNoneMatch field's value. | ||
7370 | func (s *CopyObjectInput) SetCopySourceIfNoneMatch(v string) *CopyObjectInput { | ||
7371 | s.CopySourceIfNoneMatch = &v | ||
7372 | return s | ||
7373 | } | ||
7374 | |||
7375 | // SetCopySourceIfUnmodifiedSince sets the CopySourceIfUnmodifiedSince field's value. | ||
7376 | func (s *CopyObjectInput) SetCopySourceIfUnmodifiedSince(v time.Time) *CopyObjectInput { | ||
7377 | s.CopySourceIfUnmodifiedSince = &v | ||
7378 | return s | ||
7379 | } | ||
7380 | |||
7381 | // SetCopySourceSSECustomerAlgorithm sets the CopySourceSSECustomerAlgorithm field's value. | ||
7382 | func (s *CopyObjectInput) SetCopySourceSSECustomerAlgorithm(v string) *CopyObjectInput { | ||
7383 | s.CopySourceSSECustomerAlgorithm = &v | ||
7384 | return s | ||
7385 | } | ||
7386 | |||
7387 | // SetCopySourceSSECustomerKey sets the CopySourceSSECustomerKey field's value. | ||
7388 | func (s *CopyObjectInput) SetCopySourceSSECustomerKey(v string) *CopyObjectInput { | ||
7389 | s.CopySourceSSECustomerKey = &v | ||
7390 | return s | ||
7391 | } | ||
7392 | |||
7393 | // SetCopySourceSSECustomerKeyMD5 sets the CopySourceSSECustomerKeyMD5 field's value. | ||
7394 | func (s *CopyObjectInput) SetCopySourceSSECustomerKeyMD5(v string) *CopyObjectInput { | ||
7395 | s.CopySourceSSECustomerKeyMD5 = &v | ||
7396 | return s | ||
7397 | } | ||
7398 | |||
7399 | // SetExpires sets the Expires field's value. | ||
7400 | func (s *CopyObjectInput) SetExpires(v time.Time) *CopyObjectInput { | ||
7401 | s.Expires = &v | ||
7402 | return s | ||
7403 | } | ||
7404 | |||
7405 | // SetGrantFullControl sets the GrantFullControl field's value. | ||
7406 | func (s *CopyObjectInput) SetGrantFullControl(v string) *CopyObjectInput { | ||
7407 | s.GrantFullControl = &v | ||
7408 | return s | ||
7409 | } | ||
7410 | |||
7411 | // SetGrantRead sets the GrantRead field's value. | ||
7412 | func (s *CopyObjectInput) SetGrantRead(v string) *CopyObjectInput { | ||
7413 | s.GrantRead = &v | ||
7414 | return s | ||
7415 | } | ||
7416 | |||
7417 | // SetGrantReadACP sets the GrantReadACP field's value. | ||
7418 | func (s *CopyObjectInput) SetGrantReadACP(v string) *CopyObjectInput { | ||
7419 | s.GrantReadACP = &v | ||
7420 | return s | ||
7421 | } | ||
7422 | |||
7423 | // SetGrantWriteACP sets the GrantWriteACP field's value. | ||
7424 | func (s *CopyObjectInput) SetGrantWriteACP(v string) *CopyObjectInput { | ||
7425 | s.GrantWriteACP = &v | ||
7426 | return s | ||
7427 | } | ||
7428 | |||
7429 | // SetKey sets the Key field's value. | ||
7430 | func (s *CopyObjectInput) SetKey(v string) *CopyObjectInput { | ||
7431 | s.Key = &v | ||
7432 | return s | ||
7433 | } | ||
7434 | |||
7435 | // SetMetadata sets the Metadata field's value. | ||
7436 | func (s *CopyObjectInput) SetMetadata(v map[string]*string) *CopyObjectInput { | ||
7437 | s.Metadata = v | ||
7438 | return s | ||
7439 | } | ||
7440 | |||
7441 | // SetMetadataDirective sets the MetadataDirective field's value. | ||
7442 | func (s *CopyObjectInput) SetMetadataDirective(v string) *CopyObjectInput { | ||
7443 | s.MetadataDirective = &v | ||
7444 | return s | ||
7445 | } | ||
7446 | |||
7447 | // SetRequestPayer sets the RequestPayer field's value. | ||
7448 | func (s *CopyObjectInput) SetRequestPayer(v string) *CopyObjectInput { | ||
7449 | s.RequestPayer = &v | ||
7450 | return s | ||
7451 | } | ||
7452 | |||
7453 | // SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. | ||
7454 | func (s *CopyObjectInput) SetSSECustomerAlgorithm(v string) *CopyObjectInput { | ||
7455 | s.SSECustomerAlgorithm = &v | ||
7456 | return s | ||
7457 | } | ||
7458 | |||
7459 | // SetSSECustomerKey sets the SSECustomerKey field's value. | ||
7460 | func (s *CopyObjectInput) SetSSECustomerKey(v string) *CopyObjectInput { | ||
7461 | s.SSECustomerKey = &v | ||
7462 | return s | ||
7463 | } | ||
7464 | |||
7465 | // SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. | ||
7466 | func (s *CopyObjectInput) SetSSECustomerKeyMD5(v string) *CopyObjectInput { | ||
7467 | s.SSECustomerKeyMD5 = &v | ||
7468 | return s | ||
7469 | } | ||
7470 | |||
7471 | // SetSSEKMSKeyId sets the SSEKMSKeyId field's value. | ||
7472 | func (s *CopyObjectInput) SetSSEKMSKeyId(v string) *CopyObjectInput { | ||
7473 | s.SSEKMSKeyId = &v | ||
7474 | return s | ||
7475 | } | ||
7476 | |||
7477 | // SetServerSideEncryption sets the ServerSideEncryption field's value. | ||
7478 | func (s *CopyObjectInput) SetServerSideEncryption(v string) *CopyObjectInput { | ||
7479 | s.ServerSideEncryption = &v | ||
7480 | return s | ||
7481 | } | ||
7482 | |||
7483 | // SetStorageClass sets the StorageClass field's value. | ||
7484 | func (s *CopyObjectInput) SetStorageClass(v string) *CopyObjectInput { | ||
7485 | s.StorageClass = &v | ||
7486 | return s | ||
7487 | } | ||
7488 | |||
7489 | // SetTagging sets the Tagging field's value. | ||
7490 | func (s *CopyObjectInput) SetTagging(v string) *CopyObjectInput { | ||
7491 | s.Tagging = &v | ||
7492 | return s | ||
7493 | } | ||
7494 | |||
7495 | // SetTaggingDirective sets the TaggingDirective field's value. | ||
7496 | func (s *CopyObjectInput) SetTaggingDirective(v string) *CopyObjectInput { | ||
7497 | s.TaggingDirective = &v | ||
7498 | return s | ||
7499 | } | ||
7500 | |||
7501 | // SetWebsiteRedirectLocation sets the WebsiteRedirectLocation field's value. | ||
7502 | func (s *CopyObjectInput) SetWebsiteRedirectLocation(v string) *CopyObjectInput { | ||
7503 | s.WebsiteRedirectLocation = &v | ||
7504 | return s | ||
7505 | } | ||
7506 | |||
7507 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CopyObjectOutput | ||
7508 | type CopyObjectOutput struct { | ||
7509 | _ struct{} `type:"structure" payload:"CopyObjectResult"` | ||
7510 | |||
7511 | CopyObjectResult *CopyObjectResult `type:"structure"` | ||
7512 | |||
7513 | CopySourceVersionId *string `location:"header" locationName:"x-amz-copy-source-version-id" type:"string"` | ||
7514 | |||
7515 | // If the object expiration is configured, the response includes this header. | ||
7516 | Expiration *string `location:"header" locationName:"x-amz-expiration" type:"string"` | ||
7517 | |||
7518 | // If present, indicates that the requester was successfully charged for the | ||
7519 | // request. | ||
7520 | RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` | ||
7521 | |||
7522 | // If server-side encryption with a customer-provided encryption key was requested, | ||
7523 | // the response will include this header confirming the encryption algorithm | ||
7524 | // used. | ||
7525 | SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` | ||
7526 | |||
7527 | // If server-side encryption with a customer-provided encryption key was requested, | ||
7528 | // the response will include this header to provide round trip message integrity | ||
7529 | // verification of the customer-provided encryption key. | ||
7530 | SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` | ||
7531 | |||
7532 | // If present, specifies the ID of the AWS Key Management Service (KMS) master | ||
7533 | // encryption key that was used for the object. | ||
7534 | SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string"` | ||
7535 | |||
7536 | // The Server-side encryption algorithm used when storing this object in S3 | ||
7537 | // (e.g., AES256, aws:kms). | ||
7538 | ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` | ||
7539 | |||
7540 | // Version ID of the newly created copy. | ||
7541 | VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` | ||
7542 | } | ||
7543 | |||
7544 | // String returns the string representation | ||
7545 | func (s CopyObjectOutput) String() string { | ||
7546 | return awsutil.Prettify(s) | ||
7547 | } | ||
7548 | |||
7549 | // GoString returns the string representation | ||
7550 | func (s CopyObjectOutput) GoString() string { | ||
7551 | return s.String() | ||
7552 | } | ||
7553 | |||
7554 | // SetCopyObjectResult sets the CopyObjectResult field's value. | ||
7555 | func (s *CopyObjectOutput) SetCopyObjectResult(v *CopyObjectResult) *CopyObjectOutput { | ||
7556 | s.CopyObjectResult = v | ||
7557 | return s | ||
7558 | } | ||
7559 | |||
7560 | // SetCopySourceVersionId sets the CopySourceVersionId field's value. | ||
7561 | func (s *CopyObjectOutput) SetCopySourceVersionId(v string) *CopyObjectOutput { | ||
7562 | s.CopySourceVersionId = &v | ||
7563 | return s | ||
7564 | } | ||
7565 | |||
7566 | // SetExpiration sets the Expiration field's value. | ||
7567 | func (s *CopyObjectOutput) SetExpiration(v string) *CopyObjectOutput { | ||
7568 | s.Expiration = &v | ||
7569 | return s | ||
7570 | } | ||
7571 | |||
7572 | // SetRequestCharged sets the RequestCharged field's value. | ||
7573 | func (s *CopyObjectOutput) SetRequestCharged(v string) *CopyObjectOutput { | ||
7574 | s.RequestCharged = &v | ||
7575 | return s | ||
7576 | } | ||
7577 | |||
7578 | // SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. | ||
7579 | func (s *CopyObjectOutput) SetSSECustomerAlgorithm(v string) *CopyObjectOutput { | ||
7580 | s.SSECustomerAlgorithm = &v | ||
7581 | return s | ||
7582 | } | ||
7583 | |||
7584 | // SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. | ||
7585 | func (s *CopyObjectOutput) SetSSECustomerKeyMD5(v string) *CopyObjectOutput { | ||
7586 | s.SSECustomerKeyMD5 = &v | ||
7587 | return s | ||
7588 | } | ||
7589 | |||
7590 | // SetSSEKMSKeyId sets the SSEKMSKeyId field's value. | ||
7591 | func (s *CopyObjectOutput) SetSSEKMSKeyId(v string) *CopyObjectOutput { | ||
7592 | s.SSEKMSKeyId = &v | ||
7593 | return s | ||
7594 | } | ||
7595 | |||
7596 | // SetServerSideEncryption sets the ServerSideEncryption field's value. | ||
7597 | func (s *CopyObjectOutput) SetServerSideEncryption(v string) *CopyObjectOutput { | ||
7598 | s.ServerSideEncryption = &v | ||
7599 | return s | ||
7600 | } | ||
7601 | |||
7602 | // SetVersionId sets the VersionId field's value. | ||
7603 | func (s *CopyObjectOutput) SetVersionId(v string) *CopyObjectOutput { | ||
7604 | s.VersionId = &v | ||
7605 | return s | ||
7606 | } | ||
7607 | |||
7608 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CopyObjectResult | ||
7609 | type CopyObjectResult struct { | ||
7610 | _ struct{} `type:"structure"` | ||
7611 | |||
7612 | ETag *string `type:"string"` | ||
7613 | |||
7614 | LastModified *time.Time `type:"timestamp" timestampFormat:"iso8601"` | ||
7615 | } | ||
7616 | |||
7617 | // String returns the string representation | ||
7618 | func (s CopyObjectResult) String() string { | ||
7619 | return awsutil.Prettify(s) | ||
7620 | } | ||
7621 | |||
7622 | // GoString returns the string representation | ||
7623 | func (s CopyObjectResult) GoString() string { | ||
7624 | return s.String() | ||
7625 | } | ||
7626 | |||
7627 | // SetETag sets the ETag field's value. | ||
7628 | func (s *CopyObjectResult) SetETag(v string) *CopyObjectResult { | ||
7629 | s.ETag = &v | ||
7630 | return s | ||
7631 | } | ||
7632 | |||
7633 | // SetLastModified sets the LastModified field's value. | ||
7634 | func (s *CopyObjectResult) SetLastModified(v time.Time) *CopyObjectResult { | ||
7635 | s.LastModified = &v | ||
7636 | return s | ||
7637 | } | ||
7638 | |||
7639 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CopyPartResult | ||
7640 | type CopyPartResult struct { | ||
7641 | _ struct{} `type:"structure"` | ||
7642 | |||
7643 | // Entity tag of the object. | ||
7644 | ETag *string `type:"string"` | ||
7645 | |||
7646 | // Date and time at which the object was uploaded. | ||
7647 | LastModified *time.Time `type:"timestamp" timestampFormat:"iso8601"` | ||
7648 | } | ||
7649 | |||
7650 | // String returns the string representation | ||
7651 | func (s CopyPartResult) String() string { | ||
7652 | return awsutil.Prettify(s) | ||
7653 | } | ||
7654 | |||
7655 | // GoString returns the string representation | ||
7656 | func (s CopyPartResult) GoString() string { | ||
7657 | return s.String() | ||
7658 | } | ||
7659 | |||
7660 | // SetETag sets the ETag field's value. | ||
7661 | func (s *CopyPartResult) SetETag(v string) *CopyPartResult { | ||
7662 | s.ETag = &v | ||
7663 | return s | ||
7664 | } | ||
7665 | |||
7666 | // SetLastModified sets the LastModified field's value. | ||
7667 | func (s *CopyPartResult) SetLastModified(v time.Time) *CopyPartResult { | ||
7668 | s.LastModified = &v | ||
7669 | return s | ||
7670 | } | ||
7671 | |||
7672 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateBucketConfiguration | ||
7673 | type CreateBucketConfiguration struct { | ||
7674 | _ struct{} `type:"structure"` | ||
7675 | |||
7676 | // Specifies the region where the bucket will be created. If you don't specify | ||
7677 | // a region, the bucket will be created in US Standard. | ||
7678 | LocationConstraint *string `type:"string" enum:"BucketLocationConstraint"` | ||
7679 | } | ||
7680 | |||
7681 | // String returns the string representation | ||
7682 | func (s CreateBucketConfiguration) String() string { | ||
7683 | return awsutil.Prettify(s) | ||
7684 | } | ||
7685 | |||
7686 | // GoString returns the string representation | ||
7687 | func (s CreateBucketConfiguration) GoString() string { | ||
7688 | return s.String() | ||
7689 | } | ||
7690 | |||
7691 | // SetLocationConstraint sets the LocationConstraint field's value. | ||
7692 | func (s *CreateBucketConfiguration) SetLocationConstraint(v string) *CreateBucketConfiguration { | ||
7693 | s.LocationConstraint = &v | ||
7694 | return s | ||
7695 | } | ||
7696 | |||
7697 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateBucketRequest | ||
7698 | type CreateBucketInput struct { | ||
7699 | _ struct{} `type:"structure" payload:"CreateBucketConfiguration"` | ||
7700 | |||
7701 | // The canned ACL to apply to the bucket. | ||
7702 | ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"BucketCannedACL"` | ||
7703 | |||
7704 | // Bucket is a required field | ||
7705 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
7706 | |||
7707 | CreateBucketConfiguration *CreateBucketConfiguration `locationName:"CreateBucketConfiguration" type:"structure"` | ||
7708 | |||
7709 | // Allows grantee the read, write, read ACP, and write ACP permissions on the | ||
7710 | // bucket. | ||
7711 | GrantFullControl *string `location:"header" locationName:"x-amz-grant-full-control" type:"string"` | ||
7712 | |||
7713 | // Allows grantee to list the objects in the bucket. | ||
7714 | GrantRead *string `location:"header" locationName:"x-amz-grant-read" type:"string"` | ||
7715 | |||
7716 | // Allows grantee to read the bucket ACL. | ||
7717 | GrantReadACP *string `location:"header" locationName:"x-amz-grant-read-acp" type:"string"` | ||
7718 | |||
7719 | // Allows grantee to create, overwrite, and delete any object in the bucket. | ||
7720 | GrantWrite *string `location:"header" locationName:"x-amz-grant-write" type:"string"` | ||
7721 | |||
7722 | // Allows grantee to write the ACL for the applicable bucket. | ||
7723 | GrantWriteACP *string `location:"header" locationName:"x-amz-grant-write-acp" type:"string"` | ||
7724 | } | ||
7725 | |||
7726 | // String returns the string representation | ||
7727 | func (s CreateBucketInput) String() string { | ||
7728 | return awsutil.Prettify(s) | ||
7729 | } | ||
7730 | |||
7731 | // GoString returns the string representation | ||
7732 | func (s CreateBucketInput) GoString() string { | ||
7733 | return s.String() | ||
7734 | } | ||
7735 | |||
7736 | // Validate inspects the fields of the type to determine if they are valid. | ||
7737 | func (s *CreateBucketInput) Validate() error { | ||
7738 | invalidParams := request.ErrInvalidParams{Context: "CreateBucketInput"} | ||
7739 | if s.Bucket == nil { | ||
7740 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
7741 | } | ||
7742 | |||
7743 | if invalidParams.Len() > 0 { | ||
7744 | return invalidParams | ||
7745 | } | ||
7746 | return nil | ||
7747 | } | ||
7748 | |||
7749 | // SetACL sets the ACL field's value. | ||
7750 | func (s *CreateBucketInput) SetACL(v string) *CreateBucketInput { | ||
7751 | s.ACL = &v | ||
7752 | return s | ||
7753 | } | ||
7754 | |||
7755 | // SetBucket sets the Bucket field's value. | ||
7756 | func (s *CreateBucketInput) SetBucket(v string) *CreateBucketInput { | ||
7757 | s.Bucket = &v | ||
7758 | return s | ||
7759 | } | ||
7760 | |||
7761 | // SetCreateBucketConfiguration sets the CreateBucketConfiguration field's value. | ||
7762 | func (s *CreateBucketInput) SetCreateBucketConfiguration(v *CreateBucketConfiguration) *CreateBucketInput { | ||
7763 | s.CreateBucketConfiguration = v | ||
7764 | return s | ||
7765 | } | ||
7766 | |||
7767 | // SetGrantFullControl sets the GrantFullControl field's value. | ||
7768 | func (s *CreateBucketInput) SetGrantFullControl(v string) *CreateBucketInput { | ||
7769 | s.GrantFullControl = &v | ||
7770 | return s | ||
7771 | } | ||
7772 | |||
7773 | // SetGrantRead sets the GrantRead field's value. | ||
7774 | func (s *CreateBucketInput) SetGrantRead(v string) *CreateBucketInput { | ||
7775 | s.GrantRead = &v | ||
7776 | return s | ||
7777 | } | ||
7778 | |||
7779 | // SetGrantReadACP sets the GrantReadACP field's value. | ||
7780 | func (s *CreateBucketInput) SetGrantReadACP(v string) *CreateBucketInput { | ||
7781 | s.GrantReadACP = &v | ||
7782 | return s | ||
7783 | } | ||
7784 | |||
7785 | // SetGrantWrite sets the GrantWrite field's value. | ||
7786 | func (s *CreateBucketInput) SetGrantWrite(v string) *CreateBucketInput { | ||
7787 | s.GrantWrite = &v | ||
7788 | return s | ||
7789 | } | ||
7790 | |||
7791 | // SetGrantWriteACP sets the GrantWriteACP field's value. | ||
7792 | func (s *CreateBucketInput) SetGrantWriteACP(v string) *CreateBucketInput { | ||
7793 | s.GrantWriteACP = &v | ||
7794 | return s | ||
7795 | } | ||
7796 | |||
7797 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateBucketOutput | ||
7798 | type CreateBucketOutput struct { | ||
7799 | _ struct{} `type:"structure"` | ||
7800 | |||
7801 | Location *string `location:"header" locationName:"Location" type:"string"` | ||
7802 | } | ||
7803 | |||
7804 | // String returns the string representation | ||
7805 | func (s CreateBucketOutput) String() string { | ||
7806 | return awsutil.Prettify(s) | ||
7807 | } | ||
7808 | |||
7809 | // GoString returns the string representation | ||
7810 | func (s CreateBucketOutput) GoString() string { | ||
7811 | return s.String() | ||
7812 | } | ||
7813 | |||
7814 | // SetLocation sets the Location field's value. | ||
7815 | func (s *CreateBucketOutput) SetLocation(v string) *CreateBucketOutput { | ||
7816 | s.Location = &v | ||
7817 | return s | ||
7818 | } | ||
7819 | |||
7820 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateMultipartUploadRequest | ||
7821 | type CreateMultipartUploadInput struct { | ||
7822 | _ struct{} `type:"structure"` | ||
7823 | |||
7824 | // The canned ACL to apply to the object. | ||
7825 | ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"ObjectCannedACL"` | ||
7826 | |||
7827 | // Bucket is a required field | ||
7828 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
7829 | |||
7830 | // Specifies caching behavior along the request/reply chain. | ||
7831 | CacheControl *string `location:"header" locationName:"Cache-Control" type:"string"` | ||
7832 | |||
7833 | // Specifies presentational information for the object. | ||
7834 | ContentDisposition *string `location:"header" locationName:"Content-Disposition" type:"string"` | ||
7835 | |||
7836 | // Specifies what content encodings have been applied to the object and thus | ||
7837 | // what decoding mechanisms must be applied to obtain the media-type referenced | ||
7838 | // by the Content-Type header field. | ||
7839 | ContentEncoding *string `location:"header" locationName:"Content-Encoding" type:"string"` | ||
7840 | |||
7841 | // The language the content is in. | ||
7842 | ContentLanguage *string `location:"header" locationName:"Content-Language" type:"string"` | ||
7843 | |||
7844 | // A standard MIME type describing the format of the object data. | ||
7845 | ContentType *string `location:"header" locationName:"Content-Type" type:"string"` | ||
7846 | |||
7847 | // The date and time at which the object is no longer cacheable. | ||
7848 | Expires *time.Time `location:"header" locationName:"Expires" type:"timestamp" timestampFormat:"rfc822"` | ||
7849 | |||
7850 | // Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. | ||
7851 | GrantFullControl *string `location:"header" locationName:"x-amz-grant-full-control" type:"string"` | ||
7852 | |||
7853 | // Allows grantee to read the object data and its metadata. | ||
7854 | GrantRead *string `location:"header" locationName:"x-amz-grant-read" type:"string"` | ||
7855 | |||
7856 | // Allows grantee to read the object ACL. | ||
7857 | GrantReadACP *string `location:"header" locationName:"x-amz-grant-read-acp" type:"string"` | ||
7858 | |||
7859 | // Allows grantee to write the ACL for the applicable object. | ||
7860 | GrantWriteACP *string `location:"header" locationName:"x-amz-grant-write-acp" type:"string"` | ||
7861 | |||
7862 | // Key is a required field | ||
7863 | Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` | ||
7864 | |||
7865 | // A map of metadata to store with the object in S3. | ||
7866 | Metadata map[string]*string `location:"headers" locationName:"x-amz-meta-" type:"map"` | ||
7867 | |||
7868 | // Confirms that the requester knows that she or he will be charged for the | ||
7869 | // request. Bucket owners need not specify this parameter in their requests. | ||
7870 | // Documentation on downloading objects from requester pays buckets can be found | ||
7871 | // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html | ||
7872 | RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` | ||
7873 | |||
7874 | // Specifies the algorithm to use to when encrypting the object (e.g., AES256). | ||
7875 | SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` | ||
7876 | |||
7877 | // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting | ||
7878 | // data. This value is used to store the object and then it is discarded; Amazon | ||
7879 | // does not store the encryption key. The key must be appropriate for use with | ||
7880 | // the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm | ||
7881 | // header. | ||
7882 | SSECustomerKey *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string"` | ||
7883 | |||
7884 | // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. | ||
7885 | // Amazon S3 uses this header for a message integrity check to ensure the encryption | ||
7886 | // key was transmitted without error. | ||
7887 | SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` | ||
7888 | |||
7889 | // Specifies the AWS KMS key ID to use for object encryption. All GET and PUT | ||
7890 | // requests for an object protected by AWS KMS will fail if not made via SSL | ||
7891 | // or using SigV4. Documentation on configuring any of the officially supported | ||
7892 | // AWS SDKs and CLI can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version | ||
7893 | SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string"` | ||
7894 | |||
7895 | // The Server-side encryption algorithm used when storing this object in S3 | ||
7896 | // (e.g., AES256, aws:kms). | ||
7897 | ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` | ||
7898 | |||
7899 | // The type of storage to use for the object. Defaults to 'STANDARD'. | ||
7900 | StorageClass *string `location:"header" locationName:"x-amz-storage-class" type:"string" enum:"StorageClass"` | ||
7901 | |||
7902 | // If the bucket is configured as a website, redirects requests for this object | ||
7903 | // to another object in the same bucket or to an external URL. Amazon S3 stores | ||
7904 | // the value of this header in the object metadata. | ||
7905 | WebsiteRedirectLocation *string `location:"header" locationName:"x-amz-website-redirect-location" type:"string"` | ||
7906 | } | ||
7907 | |||
7908 | // String returns the string representation | ||
7909 | func (s CreateMultipartUploadInput) String() string { | ||
7910 | return awsutil.Prettify(s) | ||
7911 | } | ||
7912 | |||
7913 | // GoString returns the string representation | ||
7914 | func (s CreateMultipartUploadInput) GoString() string { | ||
7915 | return s.String() | ||
7916 | } | ||
7917 | |||
7918 | // Validate inspects the fields of the type to determine if they are valid. | ||
7919 | func (s *CreateMultipartUploadInput) Validate() error { | ||
7920 | invalidParams := request.ErrInvalidParams{Context: "CreateMultipartUploadInput"} | ||
7921 | if s.Bucket == nil { | ||
7922 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
7923 | } | ||
7924 | if s.Key == nil { | ||
7925 | invalidParams.Add(request.NewErrParamRequired("Key")) | ||
7926 | } | ||
7927 | if s.Key != nil && len(*s.Key) < 1 { | ||
7928 | invalidParams.Add(request.NewErrParamMinLen("Key", 1)) | ||
7929 | } | ||
7930 | |||
7931 | if invalidParams.Len() > 0 { | ||
7932 | return invalidParams | ||
7933 | } | ||
7934 | return nil | ||
7935 | } | ||
7936 | |||
7937 | // SetACL sets the ACL field's value. | ||
7938 | func (s *CreateMultipartUploadInput) SetACL(v string) *CreateMultipartUploadInput { | ||
7939 | s.ACL = &v | ||
7940 | return s | ||
7941 | } | ||
7942 | |||
7943 | // SetBucket sets the Bucket field's value. | ||
7944 | func (s *CreateMultipartUploadInput) SetBucket(v string) *CreateMultipartUploadInput { | ||
7945 | s.Bucket = &v | ||
7946 | return s | ||
7947 | } | ||
7948 | |||
7949 | // SetCacheControl sets the CacheControl field's value. | ||
7950 | func (s *CreateMultipartUploadInput) SetCacheControl(v string) *CreateMultipartUploadInput { | ||
7951 | s.CacheControl = &v | ||
7952 | return s | ||
7953 | } | ||
7954 | |||
7955 | // SetContentDisposition sets the ContentDisposition field's value. | ||
7956 | func (s *CreateMultipartUploadInput) SetContentDisposition(v string) *CreateMultipartUploadInput { | ||
7957 | s.ContentDisposition = &v | ||
7958 | return s | ||
7959 | } | ||
7960 | |||
7961 | // SetContentEncoding sets the ContentEncoding field's value. | ||
7962 | func (s *CreateMultipartUploadInput) SetContentEncoding(v string) *CreateMultipartUploadInput { | ||
7963 | s.ContentEncoding = &v | ||
7964 | return s | ||
7965 | } | ||
7966 | |||
7967 | // SetContentLanguage sets the ContentLanguage field's value. | ||
7968 | func (s *CreateMultipartUploadInput) SetContentLanguage(v string) *CreateMultipartUploadInput { | ||
7969 | s.ContentLanguage = &v | ||
7970 | return s | ||
7971 | } | ||
7972 | |||
7973 | // SetContentType sets the ContentType field's value. | ||
7974 | func (s *CreateMultipartUploadInput) SetContentType(v string) *CreateMultipartUploadInput { | ||
7975 | s.ContentType = &v | ||
7976 | return s | ||
7977 | } | ||
7978 | |||
7979 | // SetExpires sets the Expires field's value. | ||
7980 | func (s *CreateMultipartUploadInput) SetExpires(v time.Time) *CreateMultipartUploadInput { | ||
7981 | s.Expires = &v | ||
7982 | return s | ||
7983 | } | ||
7984 | |||
7985 | // SetGrantFullControl sets the GrantFullControl field's value. | ||
7986 | func (s *CreateMultipartUploadInput) SetGrantFullControl(v string) *CreateMultipartUploadInput { | ||
7987 | s.GrantFullControl = &v | ||
7988 | return s | ||
7989 | } | ||
7990 | |||
7991 | // SetGrantRead sets the GrantRead field's value. | ||
7992 | func (s *CreateMultipartUploadInput) SetGrantRead(v string) *CreateMultipartUploadInput { | ||
7993 | s.GrantRead = &v | ||
7994 | return s | ||
7995 | } | ||
7996 | |||
7997 | // SetGrantReadACP sets the GrantReadACP field's value. | ||
7998 | func (s *CreateMultipartUploadInput) SetGrantReadACP(v string) *CreateMultipartUploadInput { | ||
7999 | s.GrantReadACP = &v | ||
8000 | return s | ||
8001 | } | ||
8002 | |||
8003 | // SetGrantWriteACP sets the GrantWriteACP field's value. | ||
8004 | func (s *CreateMultipartUploadInput) SetGrantWriteACP(v string) *CreateMultipartUploadInput { | ||
8005 | s.GrantWriteACP = &v | ||
8006 | return s | ||
8007 | } | ||
8008 | |||
8009 | // SetKey sets the Key field's value. | ||
8010 | func (s *CreateMultipartUploadInput) SetKey(v string) *CreateMultipartUploadInput { | ||
8011 | s.Key = &v | ||
8012 | return s | ||
8013 | } | ||
8014 | |||
8015 | // SetMetadata sets the Metadata field's value. | ||
8016 | func (s *CreateMultipartUploadInput) SetMetadata(v map[string]*string) *CreateMultipartUploadInput { | ||
8017 | s.Metadata = v | ||
8018 | return s | ||
8019 | } | ||
8020 | |||
8021 | // SetRequestPayer sets the RequestPayer field's value. | ||
8022 | func (s *CreateMultipartUploadInput) SetRequestPayer(v string) *CreateMultipartUploadInput { | ||
8023 | s.RequestPayer = &v | ||
8024 | return s | ||
8025 | } | ||
8026 | |||
8027 | // SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. | ||
8028 | func (s *CreateMultipartUploadInput) SetSSECustomerAlgorithm(v string) *CreateMultipartUploadInput { | ||
8029 | s.SSECustomerAlgorithm = &v | ||
8030 | return s | ||
8031 | } | ||
8032 | |||
8033 | // SetSSECustomerKey sets the SSECustomerKey field's value. | ||
8034 | func (s *CreateMultipartUploadInput) SetSSECustomerKey(v string) *CreateMultipartUploadInput { | ||
8035 | s.SSECustomerKey = &v | ||
8036 | return s | ||
8037 | } | ||
8038 | |||
8039 | // SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. | ||
8040 | func (s *CreateMultipartUploadInput) SetSSECustomerKeyMD5(v string) *CreateMultipartUploadInput { | ||
8041 | s.SSECustomerKeyMD5 = &v | ||
8042 | return s | ||
8043 | } | ||
8044 | |||
8045 | // SetSSEKMSKeyId sets the SSEKMSKeyId field's value. | ||
8046 | func (s *CreateMultipartUploadInput) SetSSEKMSKeyId(v string) *CreateMultipartUploadInput { | ||
8047 | s.SSEKMSKeyId = &v | ||
8048 | return s | ||
8049 | } | ||
8050 | |||
8051 | // SetServerSideEncryption sets the ServerSideEncryption field's value. | ||
8052 | func (s *CreateMultipartUploadInput) SetServerSideEncryption(v string) *CreateMultipartUploadInput { | ||
8053 | s.ServerSideEncryption = &v | ||
8054 | return s | ||
8055 | } | ||
8056 | |||
8057 | // SetStorageClass sets the StorageClass field's value. | ||
8058 | func (s *CreateMultipartUploadInput) SetStorageClass(v string) *CreateMultipartUploadInput { | ||
8059 | s.StorageClass = &v | ||
8060 | return s | ||
8061 | } | ||
8062 | |||
8063 | // SetWebsiteRedirectLocation sets the WebsiteRedirectLocation field's value. | ||
8064 | func (s *CreateMultipartUploadInput) SetWebsiteRedirectLocation(v string) *CreateMultipartUploadInput { | ||
8065 | s.WebsiteRedirectLocation = &v | ||
8066 | return s | ||
8067 | } | ||
8068 | |||
8069 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateMultipartUploadOutput | ||
8070 | type CreateMultipartUploadOutput struct { | ||
8071 | _ struct{} `type:"structure"` | ||
8072 | |||
8073 | // Date when multipart upload will become eligible for abort operation by lifecycle. | ||
8074 | AbortDate *time.Time `location:"header" locationName:"x-amz-abort-date" type:"timestamp" timestampFormat:"rfc822"` | ||
8075 | |||
8076 | // Id of the lifecycle rule that makes a multipart upload eligible for abort | ||
8077 | // operation. | ||
8078 | AbortRuleId *string `location:"header" locationName:"x-amz-abort-rule-id" type:"string"` | ||
8079 | |||
8080 | // Name of the bucket to which the multipart upload was initiated. | ||
8081 | Bucket *string `locationName:"Bucket" type:"string"` | ||
8082 | |||
8083 | // Object key for which the multipart upload was initiated. | ||
8084 | Key *string `min:"1" type:"string"` | ||
8085 | |||
8086 | // If present, indicates that the requester was successfully charged for the | ||
8087 | // request. | ||
8088 | RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` | ||
8089 | |||
8090 | // If server-side encryption with a customer-provided encryption key was requested, | ||
8091 | // the response will include this header confirming the encryption algorithm | ||
8092 | // used. | ||
8093 | SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` | ||
8094 | |||
8095 | // If server-side encryption with a customer-provided encryption key was requested, | ||
8096 | // the response will include this header to provide round trip message integrity | ||
8097 | // verification of the customer-provided encryption key. | ||
8098 | SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` | ||
8099 | |||
8100 | // If present, specifies the ID of the AWS Key Management Service (KMS) master | ||
8101 | // encryption key that was used for the object. | ||
8102 | SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string"` | ||
8103 | |||
8104 | // The Server-side encryption algorithm used when storing this object in S3 | ||
8105 | // (e.g., AES256, aws:kms). | ||
8106 | ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` | ||
8107 | |||
8108 | // ID for the initiated multipart upload. | ||
8109 | UploadId *string `type:"string"` | ||
8110 | } | ||
8111 | |||
8112 | // String returns the string representation | ||
8113 | func (s CreateMultipartUploadOutput) String() string { | ||
8114 | return awsutil.Prettify(s) | ||
8115 | } | ||
8116 | |||
8117 | // GoString returns the string representation | ||
8118 | func (s CreateMultipartUploadOutput) GoString() string { | ||
8119 | return s.String() | ||
8120 | } | ||
8121 | |||
8122 | // SetAbortDate sets the AbortDate field's value. | ||
8123 | func (s *CreateMultipartUploadOutput) SetAbortDate(v time.Time) *CreateMultipartUploadOutput { | ||
8124 | s.AbortDate = &v | ||
8125 | return s | ||
8126 | } | ||
8127 | |||
8128 | // SetAbortRuleId sets the AbortRuleId field's value. | ||
8129 | func (s *CreateMultipartUploadOutput) SetAbortRuleId(v string) *CreateMultipartUploadOutput { | ||
8130 | s.AbortRuleId = &v | ||
8131 | return s | ||
8132 | } | ||
8133 | |||
8134 | // SetBucket sets the Bucket field's value. | ||
8135 | func (s *CreateMultipartUploadOutput) SetBucket(v string) *CreateMultipartUploadOutput { | ||
8136 | s.Bucket = &v | ||
8137 | return s | ||
8138 | } | ||
8139 | |||
8140 | // SetKey sets the Key field's value. | ||
8141 | func (s *CreateMultipartUploadOutput) SetKey(v string) *CreateMultipartUploadOutput { | ||
8142 | s.Key = &v | ||
8143 | return s | ||
8144 | } | ||
8145 | |||
8146 | // SetRequestCharged sets the RequestCharged field's value. | ||
8147 | func (s *CreateMultipartUploadOutput) SetRequestCharged(v string) *CreateMultipartUploadOutput { | ||
8148 | s.RequestCharged = &v | ||
8149 | return s | ||
8150 | } | ||
8151 | |||
8152 | // SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. | ||
8153 | func (s *CreateMultipartUploadOutput) SetSSECustomerAlgorithm(v string) *CreateMultipartUploadOutput { | ||
8154 | s.SSECustomerAlgorithm = &v | ||
8155 | return s | ||
8156 | } | ||
8157 | |||
8158 | // SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. | ||
8159 | func (s *CreateMultipartUploadOutput) SetSSECustomerKeyMD5(v string) *CreateMultipartUploadOutput { | ||
8160 | s.SSECustomerKeyMD5 = &v | ||
8161 | return s | ||
8162 | } | ||
8163 | |||
8164 | // SetSSEKMSKeyId sets the SSEKMSKeyId field's value. | ||
8165 | func (s *CreateMultipartUploadOutput) SetSSEKMSKeyId(v string) *CreateMultipartUploadOutput { | ||
8166 | s.SSEKMSKeyId = &v | ||
8167 | return s | ||
8168 | } | ||
8169 | |||
8170 | // SetServerSideEncryption sets the ServerSideEncryption field's value. | ||
8171 | func (s *CreateMultipartUploadOutput) SetServerSideEncryption(v string) *CreateMultipartUploadOutput { | ||
8172 | s.ServerSideEncryption = &v | ||
8173 | return s | ||
8174 | } | ||
8175 | |||
8176 | // SetUploadId sets the UploadId field's value. | ||
8177 | func (s *CreateMultipartUploadOutput) SetUploadId(v string) *CreateMultipartUploadOutput { | ||
8178 | s.UploadId = &v | ||
8179 | return s | ||
8180 | } | ||
8181 | |||
8182 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Delete | ||
8183 | type Delete struct { | ||
8184 | _ struct{} `type:"structure"` | ||
8185 | |||
8186 | // Objects is a required field | ||
8187 | Objects []*ObjectIdentifier `locationName:"Object" type:"list" flattened:"true" required:"true"` | ||
8188 | |||
8189 | // Element to enable quiet mode for the request. When you add this element, | ||
8190 | // you must set its value to true. | ||
8191 | Quiet *bool `type:"boolean"` | ||
8192 | } | ||
8193 | |||
8194 | // String returns the string representation | ||
8195 | func (s Delete) String() string { | ||
8196 | return awsutil.Prettify(s) | ||
8197 | } | ||
8198 | |||
8199 | // GoString returns the string representation | ||
8200 | func (s Delete) GoString() string { | ||
8201 | return s.String() | ||
8202 | } | ||
8203 | |||
8204 | // Validate inspects the fields of the type to determine if they are valid. | ||
8205 | func (s *Delete) Validate() error { | ||
8206 | invalidParams := request.ErrInvalidParams{Context: "Delete"} | ||
8207 | if s.Objects == nil { | ||
8208 | invalidParams.Add(request.NewErrParamRequired("Objects")) | ||
8209 | } | ||
8210 | if s.Objects != nil { | ||
8211 | for i, v := range s.Objects { | ||
8212 | if v == nil { | ||
8213 | continue | ||
8214 | } | ||
8215 | if err := v.Validate(); err != nil { | ||
8216 | invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Objects", i), err.(request.ErrInvalidParams)) | ||
8217 | } | ||
8218 | } | ||
8219 | } | ||
8220 | |||
8221 | if invalidParams.Len() > 0 { | ||
8222 | return invalidParams | ||
8223 | } | ||
8224 | return nil | ||
8225 | } | ||
8226 | |||
8227 | // SetObjects sets the Objects field's value. | ||
8228 | func (s *Delete) SetObjects(v []*ObjectIdentifier) *Delete { | ||
8229 | s.Objects = v | ||
8230 | return s | ||
8231 | } | ||
8232 | |||
8233 | // SetQuiet sets the Quiet field's value. | ||
8234 | func (s *Delete) SetQuiet(v bool) *Delete { | ||
8235 | s.Quiet = &v | ||
8236 | return s | ||
8237 | } | ||
8238 | |||
8239 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketAnalyticsConfigurationRequest | ||
8240 | type DeleteBucketAnalyticsConfigurationInput struct { | ||
8241 | _ struct{} `type:"structure"` | ||
8242 | |||
8243 | // The name of the bucket from which an analytics configuration is deleted. | ||
8244 | // | ||
8245 | // Bucket is a required field | ||
8246 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
8247 | |||
8248 | // The identifier used to represent an analytics configuration. | ||
8249 | // | ||
8250 | // Id is a required field | ||
8251 | Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` | ||
8252 | } | ||
8253 | |||
8254 | // String returns the string representation | ||
8255 | func (s DeleteBucketAnalyticsConfigurationInput) String() string { | ||
8256 | return awsutil.Prettify(s) | ||
8257 | } | ||
8258 | |||
8259 | // GoString returns the string representation | ||
8260 | func (s DeleteBucketAnalyticsConfigurationInput) GoString() string { | ||
8261 | return s.String() | ||
8262 | } | ||
8263 | |||
8264 | // Validate inspects the fields of the type to determine if they are valid. | ||
8265 | func (s *DeleteBucketAnalyticsConfigurationInput) Validate() error { | ||
8266 | invalidParams := request.ErrInvalidParams{Context: "DeleteBucketAnalyticsConfigurationInput"} | ||
8267 | if s.Bucket == nil { | ||
8268 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
8269 | } | ||
8270 | if s.Id == nil { | ||
8271 | invalidParams.Add(request.NewErrParamRequired("Id")) | ||
8272 | } | ||
8273 | |||
8274 | if invalidParams.Len() > 0 { | ||
8275 | return invalidParams | ||
8276 | } | ||
8277 | return nil | ||
8278 | } | ||
8279 | |||
8280 | // SetBucket sets the Bucket field's value. | ||
8281 | func (s *DeleteBucketAnalyticsConfigurationInput) SetBucket(v string) *DeleteBucketAnalyticsConfigurationInput { | ||
8282 | s.Bucket = &v | ||
8283 | return s | ||
8284 | } | ||
8285 | |||
8286 | // SetId sets the Id field's value. | ||
8287 | func (s *DeleteBucketAnalyticsConfigurationInput) SetId(v string) *DeleteBucketAnalyticsConfigurationInput { | ||
8288 | s.Id = &v | ||
8289 | return s | ||
8290 | } | ||
8291 | |||
8292 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketAnalyticsConfigurationOutput | ||
8293 | type DeleteBucketAnalyticsConfigurationOutput struct { | ||
8294 | _ struct{} `type:"structure"` | ||
8295 | } | ||
8296 | |||
8297 | // String returns the string representation | ||
8298 | func (s DeleteBucketAnalyticsConfigurationOutput) String() string { | ||
8299 | return awsutil.Prettify(s) | ||
8300 | } | ||
8301 | |||
8302 | // GoString returns the string representation | ||
8303 | func (s DeleteBucketAnalyticsConfigurationOutput) GoString() string { | ||
8304 | return s.String() | ||
8305 | } | ||
8306 | |||
8307 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketCorsRequest | ||
8308 | type DeleteBucketCorsInput struct { | ||
8309 | _ struct{} `type:"structure"` | ||
8310 | |||
8311 | // Bucket is a required field | ||
8312 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
8313 | } | ||
8314 | |||
8315 | // String returns the string representation | ||
8316 | func (s DeleteBucketCorsInput) String() string { | ||
8317 | return awsutil.Prettify(s) | ||
8318 | } | ||
8319 | |||
8320 | // GoString returns the string representation | ||
8321 | func (s DeleteBucketCorsInput) GoString() string { | ||
8322 | return s.String() | ||
8323 | } | ||
8324 | |||
8325 | // Validate inspects the fields of the type to determine if they are valid. | ||
8326 | func (s *DeleteBucketCorsInput) Validate() error { | ||
8327 | invalidParams := request.ErrInvalidParams{Context: "DeleteBucketCorsInput"} | ||
8328 | if s.Bucket == nil { | ||
8329 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
8330 | } | ||
8331 | |||
8332 | if invalidParams.Len() > 0 { | ||
8333 | return invalidParams | ||
8334 | } | ||
8335 | return nil | ||
8336 | } | ||
8337 | |||
8338 | // SetBucket sets the Bucket field's value. | ||
8339 | func (s *DeleteBucketCorsInput) SetBucket(v string) *DeleteBucketCorsInput { | ||
8340 | s.Bucket = &v | ||
8341 | return s | ||
8342 | } | ||
8343 | |||
8344 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketCorsOutput | ||
8345 | type DeleteBucketCorsOutput struct { | ||
8346 | _ struct{} `type:"structure"` | ||
8347 | } | ||
8348 | |||
8349 | // String returns the string representation | ||
8350 | func (s DeleteBucketCorsOutput) String() string { | ||
8351 | return awsutil.Prettify(s) | ||
8352 | } | ||
8353 | |||
8354 | // GoString returns the string representation | ||
8355 | func (s DeleteBucketCorsOutput) GoString() string { | ||
8356 | return s.String() | ||
8357 | } | ||
8358 | |||
8359 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketRequest | ||
8360 | type DeleteBucketInput struct { | ||
8361 | _ struct{} `type:"structure"` | ||
8362 | |||
8363 | // Bucket is a required field | ||
8364 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
8365 | } | ||
8366 | |||
8367 | // String returns the string representation | ||
8368 | func (s DeleteBucketInput) String() string { | ||
8369 | return awsutil.Prettify(s) | ||
8370 | } | ||
8371 | |||
8372 | // GoString returns the string representation | ||
8373 | func (s DeleteBucketInput) GoString() string { | ||
8374 | return s.String() | ||
8375 | } | ||
8376 | |||
8377 | // Validate inspects the fields of the type to determine if they are valid. | ||
8378 | func (s *DeleteBucketInput) Validate() error { | ||
8379 | invalidParams := request.ErrInvalidParams{Context: "DeleteBucketInput"} | ||
8380 | if s.Bucket == nil { | ||
8381 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
8382 | } | ||
8383 | |||
8384 | if invalidParams.Len() > 0 { | ||
8385 | return invalidParams | ||
8386 | } | ||
8387 | return nil | ||
8388 | } | ||
8389 | |||
8390 | // SetBucket sets the Bucket field's value. | ||
8391 | func (s *DeleteBucketInput) SetBucket(v string) *DeleteBucketInput { | ||
8392 | s.Bucket = &v | ||
8393 | return s | ||
8394 | } | ||
8395 | |||
8396 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketInventoryConfigurationRequest | ||
8397 | type DeleteBucketInventoryConfigurationInput struct { | ||
8398 | _ struct{} `type:"structure"` | ||
8399 | |||
8400 | // The name of the bucket containing the inventory configuration to delete. | ||
8401 | // | ||
8402 | // Bucket is a required field | ||
8403 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
8404 | |||
8405 | // The ID used to identify the inventory configuration. | ||
8406 | // | ||
8407 | // Id is a required field | ||
8408 | Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` | ||
8409 | } | ||
8410 | |||
8411 | // String returns the string representation | ||
8412 | func (s DeleteBucketInventoryConfigurationInput) String() string { | ||
8413 | return awsutil.Prettify(s) | ||
8414 | } | ||
8415 | |||
8416 | // GoString returns the string representation | ||
8417 | func (s DeleteBucketInventoryConfigurationInput) GoString() string { | ||
8418 | return s.String() | ||
8419 | } | ||
8420 | |||
8421 | // Validate inspects the fields of the type to determine if they are valid. | ||
8422 | func (s *DeleteBucketInventoryConfigurationInput) Validate() error { | ||
8423 | invalidParams := request.ErrInvalidParams{Context: "DeleteBucketInventoryConfigurationInput"} | ||
8424 | if s.Bucket == nil { | ||
8425 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
8426 | } | ||
8427 | if s.Id == nil { | ||
8428 | invalidParams.Add(request.NewErrParamRequired("Id")) | ||
8429 | } | ||
8430 | |||
8431 | if invalidParams.Len() > 0 { | ||
8432 | return invalidParams | ||
8433 | } | ||
8434 | return nil | ||
8435 | } | ||
8436 | |||
8437 | // SetBucket sets the Bucket field's value. | ||
8438 | func (s *DeleteBucketInventoryConfigurationInput) SetBucket(v string) *DeleteBucketInventoryConfigurationInput { | ||
8439 | s.Bucket = &v | ||
8440 | return s | ||
8441 | } | ||
8442 | |||
8443 | // SetId sets the Id field's value. | ||
8444 | func (s *DeleteBucketInventoryConfigurationInput) SetId(v string) *DeleteBucketInventoryConfigurationInput { | ||
8445 | s.Id = &v | ||
8446 | return s | ||
8447 | } | ||
8448 | |||
8449 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketInventoryConfigurationOutput | ||
8450 | type DeleteBucketInventoryConfigurationOutput struct { | ||
8451 | _ struct{} `type:"structure"` | ||
8452 | } | ||
8453 | |||
8454 | // String returns the string representation | ||
8455 | func (s DeleteBucketInventoryConfigurationOutput) String() string { | ||
8456 | return awsutil.Prettify(s) | ||
8457 | } | ||
8458 | |||
8459 | // GoString returns the string representation | ||
8460 | func (s DeleteBucketInventoryConfigurationOutput) GoString() string { | ||
8461 | return s.String() | ||
8462 | } | ||
8463 | |||
8464 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketLifecycleRequest | ||
8465 | type DeleteBucketLifecycleInput struct { | ||
8466 | _ struct{} `type:"structure"` | ||
8467 | |||
8468 | // Bucket is a required field | ||
8469 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
8470 | } | ||
8471 | |||
8472 | // String returns the string representation | ||
8473 | func (s DeleteBucketLifecycleInput) String() string { | ||
8474 | return awsutil.Prettify(s) | ||
8475 | } | ||
8476 | |||
8477 | // GoString returns the string representation | ||
8478 | func (s DeleteBucketLifecycleInput) GoString() string { | ||
8479 | return s.String() | ||
8480 | } | ||
8481 | |||
8482 | // Validate inspects the fields of the type to determine if they are valid. | ||
8483 | func (s *DeleteBucketLifecycleInput) Validate() error { | ||
8484 | invalidParams := request.ErrInvalidParams{Context: "DeleteBucketLifecycleInput"} | ||
8485 | if s.Bucket == nil { | ||
8486 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
8487 | } | ||
8488 | |||
8489 | if invalidParams.Len() > 0 { | ||
8490 | return invalidParams | ||
8491 | } | ||
8492 | return nil | ||
8493 | } | ||
8494 | |||
8495 | // SetBucket sets the Bucket field's value. | ||
8496 | func (s *DeleteBucketLifecycleInput) SetBucket(v string) *DeleteBucketLifecycleInput { | ||
8497 | s.Bucket = &v | ||
8498 | return s | ||
8499 | } | ||
8500 | |||
8501 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketLifecycleOutput | ||
8502 | type DeleteBucketLifecycleOutput struct { | ||
8503 | _ struct{} `type:"structure"` | ||
8504 | } | ||
8505 | |||
8506 | // String returns the string representation | ||
8507 | func (s DeleteBucketLifecycleOutput) String() string { | ||
8508 | return awsutil.Prettify(s) | ||
8509 | } | ||
8510 | |||
8511 | // GoString returns the string representation | ||
8512 | func (s DeleteBucketLifecycleOutput) GoString() string { | ||
8513 | return s.String() | ||
8514 | } | ||
8515 | |||
8516 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketMetricsConfigurationRequest | ||
8517 | type DeleteBucketMetricsConfigurationInput struct { | ||
8518 | _ struct{} `type:"structure"` | ||
8519 | |||
8520 | // The name of the bucket containing the metrics configuration to delete. | ||
8521 | // | ||
8522 | // Bucket is a required field | ||
8523 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
8524 | |||
8525 | // The ID used to identify the metrics configuration. | ||
8526 | // | ||
8527 | // Id is a required field | ||
8528 | Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` | ||
8529 | } | ||
8530 | |||
8531 | // String returns the string representation | ||
8532 | func (s DeleteBucketMetricsConfigurationInput) String() string { | ||
8533 | return awsutil.Prettify(s) | ||
8534 | } | ||
8535 | |||
8536 | // GoString returns the string representation | ||
8537 | func (s DeleteBucketMetricsConfigurationInput) GoString() string { | ||
8538 | return s.String() | ||
8539 | } | ||
8540 | |||
8541 | // Validate inspects the fields of the type to determine if they are valid. | ||
8542 | func (s *DeleteBucketMetricsConfigurationInput) Validate() error { | ||
8543 | invalidParams := request.ErrInvalidParams{Context: "DeleteBucketMetricsConfigurationInput"} | ||
8544 | if s.Bucket == nil { | ||
8545 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
8546 | } | ||
8547 | if s.Id == nil { | ||
8548 | invalidParams.Add(request.NewErrParamRequired("Id")) | ||
8549 | } | ||
8550 | |||
8551 | if invalidParams.Len() > 0 { | ||
8552 | return invalidParams | ||
8553 | } | ||
8554 | return nil | ||
8555 | } | ||
8556 | |||
8557 | // SetBucket sets the Bucket field's value. | ||
8558 | func (s *DeleteBucketMetricsConfigurationInput) SetBucket(v string) *DeleteBucketMetricsConfigurationInput { | ||
8559 | s.Bucket = &v | ||
8560 | return s | ||
8561 | } | ||
8562 | |||
8563 | // SetId sets the Id field's value. | ||
8564 | func (s *DeleteBucketMetricsConfigurationInput) SetId(v string) *DeleteBucketMetricsConfigurationInput { | ||
8565 | s.Id = &v | ||
8566 | return s | ||
8567 | } | ||
8568 | |||
8569 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketMetricsConfigurationOutput | ||
8570 | type DeleteBucketMetricsConfigurationOutput struct { | ||
8571 | _ struct{} `type:"structure"` | ||
8572 | } | ||
8573 | |||
8574 | // String returns the string representation | ||
8575 | func (s DeleteBucketMetricsConfigurationOutput) String() string { | ||
8576 | return awsutil.Prettify(s) | ||
8577 | } | ||
8578 | |||
8579 | // GoString returns the string representation | ||
8580 | func (s DeleteBucketMetricsConfigurationOutput) GoString() string { | ||
8581 | return s.String() | ||
8582 | } | ||
8583 | |||
8584 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketOutput | ||
8585 | type DeleteBucketOutput struct { | ||
8586 | _ struct{} `type:"structure"` | ||
8587 | } | ||
8588 | |||
8589 | // String returns the string representation | ||
8590 | func (s DeleteBucketOutput) String() string { | ||
8591 | return awsutil.Prettify(s) | ||
8592 | } | ||
8593 | |||
8594 | // GoString returns the string representation | ||
8595 | func (s DeleteBucketOutput) GoString() string { | ||
8596 | return s.String() | ||
8597 | } | ||
8598 | |||
8599 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketPolicyRequest | ||
8600 | type DeleteBucketPolicyInput struct { | ||
8601 | _ struct{} `type:"structure"` | ||
8602 | |||
8603 | // Bucket is a required field | ||
8604 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
8605 | } | ||
8606 | |||
8607 | // String returns the string representation | ||
8608 | func (s DeleteBucketPolicyInput) String() string { | ||
8609 | return awsutil.Prettify(s) | ||
8610 | } | ||
8611 | |||
8612 | // GoString returns the string representation | ||
8613 | func (s DeleteBucketPolicyInput) GoString() string { | ||
8614 | return s.String() | ||
8615 | } | ||
8616 | |||
8617 | // Validate inspects the fields of the type to determine if they are valid. | ||
8618 | func (s *DeleteBucketPolicyInput) Validate() error { | ||
8619 | invalidParams := request.ErrInvalidParams{Context: "DeleteBucketPolicyInput"} | ||
8620 | if s.Bucket == nil { | ||
8621 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
8622 | } | ||
8623 | |||
8624 | if invalidParams.Len() > 0 { | ||
8625 | return invalidParams | ||
8626 | } | ||
8627 | return nil | ||
8628 | } | ||
8629 | |||
8630 | // SetBucket sets the Bucket field's value. | ||
8631 | func (s *DeleteBucketPolicyInput) SetBucket(v string) *DeleteBucketPolicyInput { | ||
8632 | s.Bucket = &v | ||
8633 | return s | ||
8634 | } | ||
8635 | |||
8636 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketPolicyOutput | ||
8637 | type DeleteBucketPolicyOutput struct { | ||
8638 | _ struct{} `type:"structure"` | ||
8639 | } | ||
8640 | |||
8641 | // String returns the string representation | ||
8642 | func (s DeleteBucketPolicyOutput) String() string { | ||
8643 | return awsutil.Prettify(s) | ||
8644 | } | ||
8645 | |||
8646 | // GoString returns the string representation | ||
8647 | func (s DeleteBucketPolicyOutput) GoString() string { | ||
8648 | return s.String() | ||
8649 | } | ||
8650 | |||
8651 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketReplicationRequest | ||
8652 | type DeleteBucketReplicationInput struct { | ||
8653 | _ struct{} `type:"structure"` | ||
8654 | |||
8655 | // Bucket is a required field | ||
8656 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
8657 | } | ||
8658 | |||
8659 | // String returns the string representation | ||
8660 | func (s DeleteBucketReplicationInput) String() string { | ||
8661 | return awsutil.Prettify(s) | ||
8662 | } | ||
8663 | |||
8664 | // GoString returns the string representation | ||
8665 | func (s DeleteBucketReplicationInput) GoString() string { | ||
8666 | return s.String() | ||
8667 | } | ||
8668 | |||
8669 | // Validate inspects the fields of the type to determine if they are valid. | ||
8670 | func (s *DeleteBucketReplicationInput) Validate() error { | ||
8671 | invalidParams := request.ErrInvalidParams{Context: "DeleteBucketReplicationInput"} | ||
8672 | if s.Bucket == nil { | ||
8673 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
8674 | } | ||
8675 | |||
8676 | if invalidParams.Len() > 0 { | ||
8677 | return invalidParams | ||
8678 | } | ||
8679 | return nil | ||
8680 | } | ||
8681 | |||
8682 | // SetBucket sets the Bucket field's value. | ||
8683 | func (s *DeleteBucketReplicationInput) SetBucket(v string) *DeleteBucketReplicationInput { | ||
8684 | s.Bucket = &v | ||
8685 | return s | ||
8686 | } | ||
8687 | |||
8688 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketReplicationOutput | ||
8689 | type DeleteBucketReplicationOutput struct { | ||
8690 | _ struct{} `type:"structure"` | ||
8691 | } | ||
8692 | |||
8693 | // String returns the string representation | ||
8694 | func (s DeleteBucketReplicationOutput) String() string { | ||
8695 | return awsutil.Prettify(s) | ||
8696 | } | ||
8697 | |||
8698 | // GoString returns the string representation | ||
8699 | func (s DeleteBucketReplicationOutput) GoString() string { | ||
8700 | return s.String() | ||
8701 | } | ||
8702 | |||
8703 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketTaggingRequest | ||
8704 | type DeleteBucketTaggingInput struct { | ||
8705 | _ struct{} `type:"structure"` | ||
8706 | |||
8707 | // Bucket is a required field | ||
8708 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
8709 | } | ||
8710 | |||
8711 | // String returns the string representation | ||
8712 | func (s DeleteBucketTaggingInput) String() string { | ||
8713 | return awsutil.Prettify(s) | ||
8714 | } | ||
8715 | |||
8716 | // GoString returns the string representation | ||
8717 | func (s DeleteBucketTaggingInput) GoString() string { | ||
8718 | return s.String() | ||
8719 | } | ||
8720 | |||
8721 | // Validate inspects the fields of the type to determine if they are valid. | ||
8722 | func (s *DeleteBucketTaggingInput) Validate() error { | ||
8723 | invalidParams := request.ErrInvalidParams{Context: "DeleteBucketTaggingInput"} | ||
8724 | if s.Bucket == nil { | ||
8725 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
8726 | } | ||
8727 | |||
8728 | if invalidParams.Len() > 0 { | ||
8729 | return invalidParams | ||
8730 | } | ||
8731 | return nil | ||
8732 | } | ||
8733 | |||
8734 | // SetBucket sets the Bucket field's value. | ||
8735 | func (s *DeleteBucketTaggingInput) SetBucket(v string) *DeleteBucketTaggingInput { | ||
8736 | s.Bucket = &v | ||
8737 | return s | ||
8738 | } | ||
8739 | |||
8740 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketTaggingOutput | ||
8741 | type DeleteBucketTaggingOutput struct { | ||
8742 | _ struct{} `type:"structure"` | ||
8743 | } | ||
8744 | |||
8745 | // String returns the string representation | ||
8746 | func (s DeleteBucketTaggingOutput) String() string { | ||
8747 | return awsutil.Prettify(s) | ||
8748 | } | ||
8749 | |||
8750 | // GoString returns the string representation | ||
8751 | func (s DeleteBucketTaggingOutput) GoString() string { | ||
8752 | return s.String() | ||
8753 | } | ||
8754 | |||
8755 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketWebsiteRequest | ||
8756 | type DeleteBucketWebsiteInput struct { | ||
8757 | _ struct{} `type:"structure"` | ||
8758 | |||
8759 | // Bucket is a required field | ||
8760 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
8761 | } | ||
8762 | |||
8763 | // String returns the string representation | ||
8764 | func (s DeleteBucketWebsiteInput) String() string { | ||
8765 | return awsutil.Prettify(s) | ||
8766 | } | ||
8767 | |||
8768 | // GoString returns the string representation | ||
8769 | func (s DeleteBucketWebsiteInput) GoString() string { | ||
8770 | return s.String() | ||
8771 | } | ||
8772 | |||
8773 | // Validate inspects the fields of the type to determine if they are valid. | ||
8774 | func (s *DeleteBucketWebsiteInput) Validate() error { | ||
8775 | invalidParams := request.ErrInvalidParams{Context: "DeleteBucketWebsiteInput"} | ||
8776 | if s.Bucket == nil { | ||
8777 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
8778 | } | ||
8779 | |||
8780 | if invalidParams.Len() > 0 { | ||
8781 | return invalidParams | ||
8782 | } | ||
8783 | return nil | ||
8784 | } | ||
8785 | |||
8786 | // SetBucket sets the Bucket field's value. | ||
8787 | func (s *DeleteBucketWebsiteInput) SetBucket(v string) *DeleteBucketWebsiteInput { | ||
8788 | s.Bucket = &v | ||
8789 | return s | ||
8790 | } | ||
8791 | |||
8792 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketWebsiteOutput | ||
8793 | type DeleteBucketWebsiteOutput struct { | ||
8794 | _ struct{} `type:"structure"` | ||
8795 | } | ||
8796 | |||
8797 | // String returns the string representation | ||
8798 | func (s DeleteBucketWebsiteOutput) String() string { | ||
8799 | return awsutil.Prettify(s) | ||
8800 | } | ||
8801 | |||
8802 | // GoString returns the string representation | ||
8803 | func (s DeleteBucketWebsiteOutput) GoString() string { | ||
8804 | return s.String() | ||
8805 | } | ||
8806 | |||
8807 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteMarkerEntry | ||
8808 | type DeleteMarkerEntry struct { | ||
8809 | _ struct{} `type:"structure"` | ||
8810 | |||
8811 | // Specifies whether the object is (true) or is not (false) the latest version | ||
8812 | // of an object. | ||
8813 | IsLatest *bool `type:"boolean"` | ||
8814 | |||
8815 | // The object key. | ||
8816 | Key *string `min:"1" type:"string"` | ||
8817 | |||
8818 | // Date and time the object was last modified. | ||
8819 | LastModified *time.Time `type:"timestamp" timestampFormat:"iso8601"` | ||
8820 | |||
8821 | Owner *Owner `type:"structure"` | ||
8822 | |||
8823 | // Version ID of an object. | ||
8824 | VersionId *string `type:"string"` | ||
8825 | } | ||
8826 | |||
8827 | // String returns the string representation | ||
8828 | func (s DeleteMarkerEntry) String() string { | ||
8829 | return awsutil.Prettify(s) | ||
8830 | } | ||
8831 | |||
8832 | // GoString returns the string representation | ||
8833 | func (s DeleteMarkerEntry) GoString() string { | ||
8834 | return s.String() | ||
8835 | } | ||
8836 | |||
8837 | // SetIsLatest sets the IsLatest field's value. | ||
8838 | func (s *DeleteMarkerEntry) SetIsLatest(v bool) *DeleteMarkerEntry { | ||
8839 | s.IsLatest = &v | ||
8840 | return s | ||
8841 | } | ||
8842 | |||
8843 | // SetKey sets the Key field's value. | ||
8844 | func (s *DeleteMarkerEntry) SetKey(v string) *DeleteMarkerEntry { | ||
8845 | s.Key = &v | ||
8846 | return s | ||
8847 | } | ||
8848 | |||
8849 | // SetLastModified sets the LastModified field's value. | ||
8850 | func (s *DeleteMarkerEntry) SetLastModified(v time.Time) *DeleteMarkerEntry { | ||
8851 | s.LastModified = &v | ||
8852 | return s | ||
8853 | } | ||
8854 | |||
8855 | // SetOwner sets the Owner field's value. | ||
8856 | func (s *DeleteMarkerEntry) SetOwner(v *Owner) *DeleteMarkerEntry { | ||
8857 | s.Owner = v | ||
8858 | return s | ||
8859 | } | ||
8860 | |||
8861 | // SetVersionId sets the VersionId field's value. | ||
8862 | func (s *DeleteMarkerEntry) SetVersionId(v string) *DeleteMarkerEntry { | ||
8863 | s.VersionId = &v | ||
8864 | return s | ||
8865 | } | ||
8866 | |||
8867 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjectRequest | ||
8868 | type DeleteObjectInput struct { | ||
8869 | _ struct{} `type:"structure"` | ||
8870 | |||
8871 | // Bucket is a required field | ||
8872 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
8873 | |||
8874 | // Key is a required field | ||
8875 | Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` | ||
8876 | |||
8877 | // The concatenation of the authentication device's serial number, a space, | ||
8878 | // and the value that is displayed on your authentication device. | ||
8879 | MFA *string `location:"header" locationName:"x-amz-mfa" type:"string"` | ||
8880 | |||
8881 | // Confirms that the requester knows that she or he will be charged for the | ||
8882 | // request. Bucket owners need not specify this parameter in their requests. | ||
8883 | // Documentation on downloading objects from requester pays buckets can be found | ||
8884 | // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html | ||
8885 | RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` | ||
8886 | |||
8887 | // VersionId used to reference a specific version of the object. | ||
8888 | VersionId *string `location:"querystring" locationName:"versionId" type:"string"` | ||
8889 | } | ||
8890 | |||
8891 | // String returns the string representation | ||
8892 | func (s DeleteObjectInput) String() string { | ||
8893 | return awsutil.Prettify(s) | ||
8894 | } | ||
8895 | |||
8896 | // GoString returns the string representation | ||
8897 | func (s DeleteObjectInput) GoString() string { | ||
8898 | return s.String() | ||
8899 | } | ||
8900 | |||
8901 | // Validate inspects the fields of the type to determine if they are valid. | ||
8902 | func (s *DeleteObjectInput) Validate() error { | ||
8903 | invalidParams := request.ErrInvalidParams{Context: "DeleteObjectInput"} | ||
8904 | if s.Bucket == nil { | ||
8905 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
8906 | } | ||
8907 | if s.Key == nil { | ||
8908 | invalidParams.Add(request.NewErrParamRequired("Key")) | ||
8909 | } | ||
8910 | if s.Key != nil && len(*s.Key) < 1 { | ||
8911 | invalidParams.Add(request.NewErrParamMinLen("Key", 1)) | ||
8912 | } | ||
8913 | |||
8914 | if invalidParams.Len() > 0 { | ||
8915 | return invalidParams | ||
8916 | } | ||
8917 | return nil | ||
8918 | } | ||
8919 | |||
8920 | // SetBucket sets the Bucket field's value. | ||
8921 | func (s *DeleteObjectInput) SetBucket(v string) *DeleteObjectInput { | ||
8922 | s.Bucket = &v | ||
8923 | return s | ||
8924 | } | ||
8925 | |||
8926 | // SetKey sets the Key field's value. | ||
8927 | func (s *DeleteObjectInput) SetKey(v string) *DeleteObjectInput { | ||
8928 | s.Key = &v | ||
8929 | return s | ||
8930 | } | ||
8931 | |||
8932 | // SetMFA sets the MFA field's value. | ||
8933 | func (s *DeleteObjectInput) SetMFA(v string) *DeleteObjectInput { | ||
8934 | s.MFA = &v | ||
8935 | return s | ||
8936 | } | ||
8937 | |||
8938 | // SetRequestPayer sets the RequestPayer field's value. | ||
8939 | func (s *DeleteObjectInput) SetRequestPayer(v string) *DeleteObjectInput { | ||
8940 | s.RequestPayer = &v | ||
8941 | return s | ||
8942 | } | ||
8943 | |||
8944 | // SetVersionId sets the VersionId field's value. | ||
8945 | func (s *DeleteObjectInput) SetVersionId(v string) *DeleteObjectInput { | ||
8946 | s.VersionId = &v | ||
8947 | return s | ||
8948 | } | ||
8949 | |||
8950 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjectOutput | ||
8951 | type DeleteObjectOutput struct { | ||
8952 | _ struct{} `type:"structure"` | ||
8953 | |||
8954 | // Specifies whether the versioned object that was permanently deleted was (true) | ||
8955 | // or was not (false) a delete marker. | ||
8956 | DeleteMarker *bool `location:"header" locationName:"x-amz-delete-marker" type:"boolean"` | ||
8957 | |||
8958 | // If present, indicates that the requester was successfully charged for the | ||
8959 | // request. | ||
8960 | RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` | ||
8961 | |||
8962 | // Returns the version ID of the delete marker created as a result of the DELETE | ||
8963 | // operation. | ||
8964 | VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` | ||
8965 | } | ||
8966 | |||
8967 | // String returns the string representation | ||
8968 | func (s DeleteObjectOutput) String() string { | ||
8969 | return awsutil.Prettify(s) | ||
8970 | } | ||
8971 | |||
8972 | // GoString returns the string representation | ||
8973 | func (s DeleteObjectOutput) GoString() string { | ||
8974 | return s.String() | ||
8975 | } | ||
8976 | |||
8977 | // SetDeleteMarker sets the DeleteMarker field's value. | ||
8978 | func (s *DeleteObjectOutput) SetDeleteMarker(v bool) *DeleteObjectOutput { | ||
8979 | s.DeleteMarker = &v | ||
8980 | return s | ||
8981 | } | ||
8982 | |||
8983 | // SetRequestCharged sets the RequestCharged field's value. | ||
8984 | func (s *DeleteObjectOutput) SetRequestCharged(v string) *DeleteObjectOutput { | ||
8985 | s.RequestCharged = &v | ||
8986 | return s | ||
8987 | } | ||
8988 | |||
8989 | // SetVersionId sets the VersionId field's value. | ||
8990 | func (s *DeleteObjectOutput) SetVersionId(v string) *DeleteObjectOutput { | ||
8991 | s.VersionId = &v | ||
8992 | return s | ||
8993 | } | ||
8994 | |||
8995 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjectTaggingRequest | ||
8996 | type DeleteObjectTaggingInput struct { | ||
8997 | _ struct{} `type:"structure"` | ||
8998 | |||
8999 | // Bucket is a required field | ||
9000 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
9001 | |||
9002 | // Key is a required field | ||
9003 | Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` | ||
9004 | |||
9005 | // The versionId of the object that the tag-set will be removed from. | ||
9006 | VersionId *string `location:"querystring" locationName:"versionId" type:"string"` | ||
9007 | } | ||
9008 | |||
9009 | // String returns the string representation | ||
9010 | func (s DeleteObjectTaggingInput) String() string { | ||
9011 | return awsutil.Prettify(s) | ||
9012 | } | ||
9013 | |||
9014 | // GoString returns the string representation | ||
9015 | func (s DeleteObjectTaggingInput) GoString() string { | ||
9016 | return s.String() | ||
9017 | } | ||
9018 | |||
9019 | // Validate inspects the fields of the type to determine if they are valid. | ||
9020 | func (s *DeleteObjectTaggingInput) Validate() error { | ||
9021 | invalidParams := request.ErrInvalidParams{Context: "DeleteObjectTaggingInput"} | ||
9022 | if s.Bucket == nil { | ||
9023 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
9024 | } | ||
9025 | if s.Key == nil { | ||
9026 | invalidParams.Add(request.NewErrParamRequired("Key")) | ||
9027 | } | ||
9028 | if s.Key != nil && len(*s.Key) < 1 { | ||
9029 | invalidParams.Add(request.NewErrParamMinLen("Key", 1)) | ||
9030 | } | ||
9031 | |||
9032 | if invalidParams.Len() > 0 { | ||
9033 | return invalidParams | ||
9034 | } | ||
9035 | return nil | ||
9036 | } | ||
9037 | |||
9038 | // SetBucket sets the Bucket field's value. | ||
9039 | func (s *DeleteObjectTaggingInput) SetBucket(v string) *DeleteObjectTaggingInput { | ||
9040 | s.Bucket = &v | ||
9041 | return s | ||
9042 | } | ||
9043 | |||
9044 | // SetKey sets the Key field's value. | ||
9045 | func (s *DeleteObjectTaggingInput) SetKey(v string) *DeleteObjectTaggingInput { | ||
9046 | s.Key = &v | ||
9047 | return s | ||
9048 | } | ||
9049 | |||
9050 | // SetVersionId sets the VersionId field's value. | ||
9051 | func (s *DeleteObjectTaggingInput) SetVersionId(v string) *DeleteObjectTaggingInput { | ||
9052 | s.VersionId = &v | ||
9053 | return s | ||
9054 | } | ||
9055 | |||
9056 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjectTaggingOutput | ||
9057 | type DeleteObjectTaggingOutput struct { | ||
9058 | _ struct{} `type:"structure"` | ||
9059 | |||
9060 | // The versionId of the object the tag-set was removed from. | ||
9061 | VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` | ||
9062 | } | ||
9063 | |||
9064 | // String returns the string representation | ||
9065 | func (s DeleteObjectTaggingOutput) String() string { | ||
9066 | return awsutil.Prettify(s) | ||
9067 | } | ||
9068 | |||
9069 | // GoString returns the string representation | ||
9070 | func (s DeleteObjectTaggingOutput) GoString() string { | ||
9071 | return s.String() | ||
9072 | } | ||
9073 | |||
9074 | // SetVersionId sets the VersionId field's value. | ||
9075 | func (s *DeleteObjectTaggingOutput) SetVersionId(v string) *DeleteObjectTaggingOutput { | ||
9076 | s.VersionId = &v | ||
9077 | return s | ||
9078 | } | ||
9079 | |||
9080 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjectsRequest | ||
9081 | type DeleteObjectsInput struct { | ||
9082 | _ struct{} `type:"structure" payload:"Delete"` | ||
9083 | |||
9084 | // Bucket is a required field | ||
9085 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
9086 | |||
9087 | // Delete is a required field | ||
9088 | Delete *Delete `locationName:"Delete" type:"structure" required:"true"` | ||
9089 | |||
9090 | // The concatenation of the authentication device's serial number, a space, | ||
9091 | // and the value that is displayed on your authentication device. | ||
9092 | MFA *string `location:"header" locationName:"x-amz-mfa" type:"string"` | ||
9093 | |||
9094 | // Confirms that the requester knows that she or he will be charged for the | ||
9095 | // request. Bucket owners need not specify this parameter in their requests. | ||
9096 | // Documentation on downloading objects from requester pays buckets can be found | ||
9097 | // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html | ||
9098 | RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` | ||
9099 | } | ||
9100 | |||
9101 | // String returns the string representation | ||
9102 | func (s DeleteObjectsInput) String() string { | ||
9103 | return awsutil.Prettify(s) | ||
9104 | } | ||
9105 | |||
9106 | // GoString returns the string representation | ||
9107 | func (s DeleteObjectsInput) GoString() string { | ||
9108 | return s.String() | ||
9109 | } | ||
9110 | |||
9111 | // Validate inspects the fields of the type to determine if they are valid. | ||
9112 | func (s *DeleteObjectsInput) Validate() error { | ||
9113 | invalidParams := request.ErrInvalidParams{Context: "DeleteObjectsInput"} | ||
9114 | if s.Bucket == nil { | ||
9115 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
9116 | } | ||
9117 | if s.Delete == nil { | ||
9118 | invalidParams.Add(request.NewErrParamRequired("Delete")) | ||
9119 | } | ||
9120 | if s.Delete != nil { | ||
9121 | if err := s.Delete.Validate(); err != nil { | ||
9122 | invalidParams.AddNested("Delete", err.(request.ErrInvalidParams)) | ||
9123 | } | ||
9124 | } | ||
9125 | |||
9126 | if invalidParams.Len() > 0 { | ||
9127 | return invalidParams | ||
9128 | } | ||
9129 | return nil | ||
9130 | } | ||
9131 | |||
9132 | // SetBucket sets the Bucket field's value. | ||
9133 | func (s *DeleteObjectsInput) SetBucket(v string) *DeleteObjectsInput { | ||
9134 | s.Bucket = &v | ||
9135 | return s | ||
9136 | } | ||
9137 | |||
9138 | // SetDelete sets the Delete field's value. | ||
9139 | func (s *DeleteObjectsInput) SetDelete(v *Delete) *DeleteObjectsInput { | ||
9140 | s.Delete = v | ||
9141 | return s | ||
9142 | } | ||
9143 | |||
9144 | // SetMFA sets the MFA field's value. | ||
9145 | func (s *DeleteObjectsInput) SetMFA(v string) *DeleteObjectsInput { | ||
9146 | s.MFA = &v | ||
9147 | return s | ||
9148 | } | ||
9149 | |||
9150 | // SetRequestPayer sets the RequestPayer field's value. | ||
9151 | func (s *DeleteObjectsInput) SetRequestPayer(v string) *DeleteObjectsInput { | ||
9152 | s.RequestPayer = &v | ||
9153 | return s | ||
9154 | } | ||
9155 | |||
9156 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjectsOutput | ||
9157 | type DeleteObjectsOutput struct { | ||
9158 | _ struct{} `type:"structure"` | ||
9159 | |||
9160 | Deleted []*DeletedObject `type:"list" flattened:"true"` | ||
9161 | |||
9162 | Errors []*Error `locationName:"Error" type:"list" flattened:"true"` | ||
9163 | |||
9164 | // If present, indicates that the requester was successfully charged for the | ||
9165 | // request. | ||
9166 | RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` | ||
9167 | } | ||
9168 | |||
9169 | // String returns the string representation | ||
9170 | func (s DeleteObjectsOutput) String() string { | ||
9171 | return awsutil.Prettify(s) | ||
9172 | } | ||
9173 | |||
9174 | // GoString returns the string representation | ||
9175 | func (s DeleteObjectsOutput) GoString() string { | ||
9176 | return s.String() | ||
9177 | } | ||
9178 | |||
9179 | // SetDeleted sets the Deleted field's value. | ||
9180 | func (s *DeleteObjectsOutput) SetDeleted(v []*DeletedObject) *DeleteObjectsOutput { | ||
9181 | s.Deleted = v | ||
9182 | return s | ||
9183 | } | ||
9184 | |||
9185 | // SetErrors sets the Errors field's value. | ||
9186 | func (s *DeleteObjectsOutput) SetErrors(v []*Error) *DeleteObjectsOutput { | ||
9187 | s.Errors = v | ||
9188 | return s | ||
9189 | } | ||
9190 | |||
9191 | // SetRequestCharged sets the RequestCharged field's value. | ||
9192 | func (s *DeleteObjectsOutput) SetRequestCharged(v string) *DeleteObjectsOutput { | ||
9193 | s.RequestCharged = &v | ||
9194 | return s | ||
9195 | } | ||
9196 | |||
9197 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeletedObject | ||
9198 | type DeletedObject struct { | ||
9199 | _ struct{} `type:"structure"` | ||
9200 | |||
9201 | DeleteMarker *bool `type:"boolean"` | ||
9202 | |||
9203 | DeleteMarkerVersionId *string `type:"string"` | ||
9204 | |||
9205 | Key *string `min:"1" type:"string"` | ||
9206 | |||
9207 | VersionId *string `type:"string"` | ||
9208 | } | ||
9209 | |||
9210 | // String returns the string representation | ||
9211 | func (s DeletedObject) String() string { | ||
9212 | return awsutil.Prettify(s) | ||
9213 | } | ||
9214 | |||
9215 | // GoString returns the string representation | ||
9216 | func (s DeletedObject) GoString() string { | ||
9217 | return s.String() | ||
9218 | } | ||
9219 | |||
9220 | // SetDeleteMarker sets the DeleteMarker field's value. | ||
9221 | func (s *DeletedObject) SetDeleteMarker(v bool) *DeletedObject { | ||
9222 | s.DeleteMarker = &v | ||
9223 | return s | ||
9224 | } | ||
9225 | |||
9226 | // SetDeleteMarkerVersionId sets the DeleteMarkerVersionId field's value. | ||
9227 | func (s *DeletedObject) SetDeleteMarkerVersionId(v string) *DeletedObject { | ||
9228 | s.DeleteMarkerVersionId = &v | ||
9229 | return s | ||
9230 | } | ||
9231 | |||
9232 | // SetKey sets the Key field's value. | ||
9233 | func (s *DeletedObject) SetKey(v string) *DeletedObject { | ||
9234 | s.Key = &v | ||
9235 | return s | ||
9236 | } | ||
9237 | |||
9238 | // SetVersionId sets the VersionId field's value. | ||
9239 | func (s *DeletedObject) SetVersionId(v string) *DeletedObject { | ||
9240 | s.VersionId = &v | ||
9241 | return s | ||
9242 | } | ||
9243 | |||
9244 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Destination | ||
9245 | type Destination struct { | ||
9246 | _ struct{} `type:"structure"` | ||
9247 | |||
9248 | // Amazon resource name (ARN) of the bucket where you want Amazon S3 to store | ||
9249 | // replicas of the object identified by the rule. | ||
9250 | // | ||
9251 | // Bucket is a required field | ||
9252 | Bucket *string `type:"string" required:"true"` | ||
9253 | |||
9254 | // The class of storage used to store the object. | ||
9255 | StorageClass *string `type:"string" enum:"StorageClass"` | ||
9256 | } | ||
9257 | |||
9258 | // String returns the string representation | ||
9259 | func (s Destination) String() string { | ||
9260 | return awsutil.Prettify(s) | ||
9261 | } | ||
9262 | |||
9263 | // GoString returns the string representation | ||
9264 | func (s Destination) GoString() string { | ||
9265 | return s.String() | ||
9266 | } | ||
9267 | |||
9268 | // Validate inspects the fields of the type to determine if they are valid. | ||
9269 | func (s *Destination) Validate() error { | ||
9270 | invalidParams := request.ErrInvalidParams{Context: "Destination"} | ||
9271 | if s.Bucket == nil { | ||
9272 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
9273 | } | ||
9274 | |||
9275 | if invalidParams.Len() > 0 { | ||
9276 | return invalidParams | ||
9277 | } | ||
9278 | return nil | ||
9279 | } | ||
9280 | |||
9281 | // SetBucket sets the Bucket field's value. | ||
9282 | func (s *Destination) SetBucket(v string) *Destination { | ||
9283 | s.Bucket = &v | ||
9284 | return s | ||
9285 | } | ||
9286 | |||
9287 | // SetStorageClass sets the StorageClass field's value. | ||
9288 | func (s *Destination) SetStorageClass(v string) *Destination { | ||
9289 | s.StorageClass = &v | ||
9290 | return s | ||
9291 | } | ||
9292 | |||
9293 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Error | ||
9294 | type Error struct { | ||
9295 | _ struct{} `type:"structure"` | ||
9296 | |||
9297 | Code *string `type:"string"` | ||
9298 | |||
9299 | Key *string `min:"1" type:"string"` | ||
9300 | |||
9301 | Message *string `type:"string"` | ||
9302 | |||
9303 | VersionId *string `type:"string"` | ||
9304 | } | ||
9305 | |||
9306 | // String returns the string representation | ||
9307 | func (s Error) String() string { | ||
9308 | return awsutil.Prettify(s) | ||
9309 | } | ||
9310 | |||
9311 | // GoString returns the string representation | ||
9312 | func (s Error) GoString() string { | ||
9313 | return s.String() | ||
9314 | } | ||
9315 | |||
9316 | // SetCode sets the Code field's value. | ||
9317 | func (s *Error) SetCode(v string) *Error { | ||
9318 | s.Code = &v | ||
9319 | return s | ||
9320 | } | ||
9321 | |||
9322 | // SetKey sets the Key field's value. | ||
9323 | func (s *Error) SetKey(v string) *Error { | ||
9324 | s.Key = &v | ||
9325 | return s | ||
9326 | } | ||
9327 | |||
9328 | // SetMessage sets the Message field's value. | ||
9329 | func (s *Error) SetMessage(v string) *Error { | ||
9330 | s.Message = &v | ||
9331 | return s | ||
9332 | } | ||
9333 | |||
9334 | // SetVersionId sets the VersionId field's value. | ||
9335 | func (s *Error) SetVersionId(v string) *Error { | ||
9336 | s.VersionId = &v | ||
9337 | return s | ||
9338 | } | ||
9339 | |||
9340 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ErrorDocument | ||
9341 | type ErrorDocument struct { | ||
9342 | _ struct{} `type:"structure"` | ||
9343 | |||
9344 | // The object key name to use when a 4XX class error occurs. | ||
9345 | // | ||
9346 | // Key is a required field | ||
9347 | Key *string `min:"1" type:"string" required:"true"` | ||
9348 | } | ||
9349 | |||
9350 | // String returns the string representation | ||
9351 | func (s ErrorDocument) String() string { | ||
9352 | return awsutil.Prettify(s) | ||
9353 | } | ||
9354 | |||
9355 | // GoString returns the string representation | ||
9356 | func (s ErrorDocument) GoString() string { | ||
9357 | return s.String() | ||
9358 | } | ||
9359 | |||
9360 | // Validate inspects the fields of the type to determine if they are valid. | ||
9361 | func (s *ErrorDocument) Validate() error { | ||
9362 | invalidParams := request.ErrInvalidParams{Context: "ErrorDocument"} | ||
9363 | if s.Key == nil { | ||
9364 | invalidParams.Add(request.NewErrParamRequired("Key")) | ||
9365 | } | ||
9366 | if s.Key != nil && len(*s.Key) < 1 { | ||
9367 | invalidParams.Add(request.NewErrParamMinLen("Key", 1)) | ||
9368 | } | ||
9369 | |||
9370 | if invalidParams.Len() > 0 { | ||
9371 | return invalidParams | ||
9372 | } | ||
9373 | return nil | ||
9374 | } | ||
9375 | |||
9376 | // SetKey sets the Key field's value. | ||
9377 | func (s *ErrorDocument) SetKey(v string) *ErrorDocument { | ||
9378 | s.Key = &v | ||
9379 | return s | ||
9380 | } | ||
9381 | |||
9382 | // Container for key value pair that defines the criteria for the filter rule. | ||
9383 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/FilterRule | ||
9384 | type FilterRule struct { | ||
9385 | _ struct{} `type:"structure"` | ||
9386 | |||
9387 | // Object key name prefix or suffix identifying one or more objects to which | ||
9388 | // the filtering rule applies. Maximum prefix length can be up to 1,024 characters. | ||
9389 | // Overlapping prefixes and suffixes are not supported. For more information, | ||
9390 | // go to Configuring Event Notifications (http://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) | ||
9391 | Name *string `type:"string" enum:"FilterRuleName"` | ||
9392 | |||
9393 | Value *string `type:"string"` | ||
9394 | } | ||
9395 | |||
9396 | // String returns the string representation | ||
9397 | func (s FilterRule) String() string { | ||
9398 | return awsutil.Prettify(s) | ||
9399 | } | ||
9400 | |||
9401 | // GoString returns the string representation | ||
9402 | func (s FilterRule) GoString() string { | ||
9403 | return s.String() | ||
9404 | } | ||
9405 | |||
9406 | // SetName sets the Name field's value. | ||
9407 | func (s *FilterRule) SetName(v string) *FilterRule { | ||
9408 | s.Name = &v | ||
9409 | return s | ||
9410 | } | ||
9411 | |||
9412 | // SetValue sets the Value field's value. | ||
9413 | func (s *FilterRule) SetValue(v string) *FilterRule { | ||
9414 | s.Value = &v | ||
9415 | return s | ||
9416 | } | ||
9417 | |||
9418 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAccelerateConfigurationRequest | ||
9419 | type GetBucketAccelerateConfigurationInput struct { | ||
9420 | _ struct{} `type:"structure"` | ||
9421 | |||
9422 | // Name of the bucket for which the accelerate configuration is retrieved. | ||
9423 | // | ||
9424 | // Bucket is a required field | ||
9425 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
9426 | } | ||
9427 | |||
9428 | // String returns the string representation | ||
9429 | func (s GetBucketAccelerateConfigurationInput) String() string { | ||
9430 | return awsutil.Prettify(s) | ||
9431 | } | ||
9432 | |||
9433 | // GoString returns the string representation | ||
9434 | func (s GetBucketAccelerateConfigurationInput) GoString() string { | ||
9435 | return s.String() | ||
9436 | } | ||
9437 | |||
9438 | // Validate inspects the fields of the type to determine if they are valid. | ||
9439 | func (s *GetBucketAccelerateConfigurationInput) Validate() error { | ||
9440 | invalidParams := request.ErrInvalidParams{Context: "GetBucketAccelerateConfigurationInput"} | ||
9441 | if s.Bucket == nil { | ||
9442 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
9443 | } | ||
9444 | |||
9445 | if invalidParams.Len() > 0 { | ||
9446 | return invalidParams | ||
9447 | } | ||
9448 | return nil | ||
9449 | } | ||
9450 | |||
9451 | // SetBucket sets the Bucket field's value. | ||
9452 | func (s *GetBucketAccelerateConfigurationInput) SetBucket(v string) *GetBucketAccelerateConfigurationInput { | ||
9453 | s.Bucket = &v | ||
9454 | return s | ||
9455 | } | ||
9456 | |||
9457 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAccelerateConfigurationOutput | ||
9458 | type GetBucketAccelerateConfigurationOutput struct { | ||
9459 | _ struct{} `type:"structure"` | ||
9460 | |||
9461 | // The accelerate configuration of the bucket. | ||
9462 | Status *string `type:"string" enum:"BucketAccelerateStatus"` | ||
9463 | } | ||
9464 | |||
9465 | // String returns the string representation | ||
9466 | func (s GetBucketAccelerateConfigurationOutput) String() string { | ||
9467 | return awsutil.Prettify(s) | ||
9468 | } | ||
9469 | |||
9470 | // GoString returns the string representation | ||
9471 | func (s GetBucketAccelerateConfigurationOutput) GoString() string { | ||
9472 | return s.String() | ||
9473 | } | ||
9474 | |||
9475 | // SetStatus sets the Status field's value. | ||
9476 | func (s *GetBucketAccelerateConfigurationOutput) SetStatus(v string) *GetBucketAccelerateConfigurationOutput { | ||
9477 | s.Status = &v | ||
9478 | return s | ||
9479 | } | ||
9480 | |||
9481 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAclRequest | ||
9482 | type GetBucketAclInput struct { | ||
9483 | _ struct{} `type:"structure"` | ||
9484 | |||
9485 | // Bucket is a required field | ||
9486 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
9487 | } | ||
9488 | |||
9489 | // String returns the string representation | ||
9490 | func (s GetBucketAclInput) String() string { | ||
9491 | return awsutil.Prettify(s) | ||
9492 | } | ||
9493 | |||
9494 | // GoString returns the string representation | ||
9495 | func (s GetBucketAclInput) GoString() string { | ||
9496 | return s.String() | ||
9497 | } | ||
9498 | |||
9499 | // Validate inspects the fields of the type to determine if they are valid. | ||
9500 | func (s *GetBucketAclInput) Validate() error { | ||
9501 | invalidParams := request.ErrInvalidParams{Context: "GetBucketAclInput"} | ||
9502 | if s.Bucket == nil { | ||
9503 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
9504 | } | ||
9505 | |||
9506 | if invalidParams.Len() > 0 { | ||
9507 | return invalidParams | ||
9508 | } | ||
9509 | return nil | ||
9510 | } | ||
9511 | |||
9512 | // SetBucket sets the Bucket field's value. | ||
9513 | func (s *GetBucketAclInput) SetBucket(v string) *GetBucketAclInput { | ||
9514 | s.Bucket = &v | ||
9515 | return s | ||
9516 | } | ||
9517 | |||
9518 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAclOutput | ||
9519 | type GetBucketAclOutput struct { | ||
9520 | _ struct{} `type:"structure"` | ||
9521 | |||
9522 | // A list of grants. | ||
9523 | Grants []*Grant `locationName:"AccessControlList" locationNameList:"Grant" type:"list"` | ||
9524 | |||
9525 | Owner *Owner `type:"structure"` | ||
9526 | } | ||
9527 | |||
9528 | // String returns the string representation | ||
9529 | func (s GetBucketAclOutput) String() string { | ||
9530 | return awsutil.Prettify(s) | ||
9531 | } | ||
9532 | |||
9533 | // GoString returns the string representation | ||
9534 | func (s GetBucketAclOutput) GoString() string { | ||
9535 | return s.String() | ||
9536 | } | ||
9537 | |||
9538 | // SetGrants sets the Grants field's value. | ||
9539 | func (s *GetBucketAclOutput) SetGrants(v []*Grant) *GetBucketAclOutput { | ||
9540 | s.Grants = v | ||
9541 | return s | ||
9542 | } | ||
9543 | |||
9544 | // SetOwner sets the Owner field's value. | ||
9545 | func (s *GetBucketAclOutput) SetOwner(v *Owner) *GetBucketAclOutput { | ||
9546 | s.Owner = v | ||
9547 | return s | ||
9548 | } | ||
9549 | |||
9550 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAnalyticsConfigurationRequest | ||
9551 | type GetBucketAnalyticsConfigurationInput struct { | ||
9552 | _ struct{} `type:"structure"` | ||
9553 | |||
9554 | // The name of the bucket from which an analytics configuration is retrieved. | ||
9555 | // | ||
9556 | // Bucket is a required field | ||
9557 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
9558 | |||
9559 | // The identifier used to represent an analytics configuration. | ||
9560 | // | ||
9561 | // Id is a required field | ||
9562 | Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` | ||
9563 | } | ||
9564 | |||
9565 | // String returns the string representation | ||
9566 | func (s GetBucketAnalyticsConfigurationInput) String() string { | ||
9567 | return awsutil.Prettify(s) | ||
9568 | } | ||
9569 | |||
9570 | // GoString returns the string representation | ||
9571 | func (s GetBucketAnalyticsConfigurationInput) GoString() string { | ||
9572 | return s.String() | ||
9573 | } | ||
9574 | |||
9575 | // Validate inspects the fields of the type to determine if they are valid. | ||
9576 | func (s *GetBucketAnalyticsConfigurationInput) Validate() error { | ||
9577 | invalidParams := request.ErrInvalidParams{Context: "GetBucketAnalyticsConfigurationInput"} | ||
9578 | if s.Bucket == nil { | ||
9579 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
9580 | } | ||
9581 | if s.Id == nil { | ||
9582 | invalidParams.Add(request.NewErrParamRequired("Id")) | ||
9583 | } | ||
9584 | |||
9585 | if invalidParams.Len() > 0 { | ||
9586 | return invalidParams | ||
9587 | } | ||
9588 | return nil | ||
9589 | } | ||
9590 | |||
9591 | // SetBucket sets the Bucket field's value. | ||
9592 | func (s *GetBucketAnalyticsConfigurationInput) SetBucket(v string) *GetBucketAnalyticsConfigurationInput { | ||
9593 | s.Bucket = &v | ||
9594 | return s | ||
9595 | } | ||
9596 | |||
9597 | // SetId sets the Id field's value. | ||
9598 | func (s *GetBucketAnalyticsConfigurationInput) SetId(v string) *GetBucketAnalyticsConfigurationInput { | ||
9599 | s.Id = &v | ||
9600 | return s | ||
9601 | } | ||
9602 | |||
9603 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAnalyticsConfigurationOutput | ||
9604 | type GetBucketAnalyticsConfigurationOutput struct { | ||
9605 | _ struct{} `type:"structure" payload:"AnalyticsConfiguration"` | ||
9606 | |||
9607 | // The configuration and any analyses for the analytics filter. | ||
9608 | AnalyticsConfiguration *AnalyticsConfiguration `type:"structure"` | ||
9609 | } | ||
9610 | |||
9611 | // String returns the string representation | ||
9612 | func (s GetBucketAnalyticsConfigurationOutput) String() string { | ||
9613 | return awsutil.Prettify(s) | ||
9614 | } | ||
9615 | |||
9616 | // GoString returns the string representation | ||
9617 | func (s GetBucketAnalyticsConfigurationOutput) GoString() string { | ||
9618 | return s.String() | ||
9619 | } | ||
9620 | |||
9621 | // SetAnalyticsConfiguration sets the AnalyticsConfiguration field's value. | ||
9622 | func (s *GetBucketAnalyticsConfigurationOutput) SetAnalyticsConfiguration(v *AnalyticsConfiguration) *GetBucketAnalyticsConfigurationOutput { | ||
9623 | s.AnalyticsConfiguration = v | ||
9624 | return s | ||
9625 | } | ||
9626 | |||
9627 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketCorsRequest | ||
9628 | type GetBucketCorsInput struct { | ||
9629 | _ struct{} `type:"structure"` | ||
9630 | |||
9631 | // Bucket is a required field | ||
9632 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
9633 | } | ||
9634 | |||
9635 | // String returns the string representation | ||
9636 | func (s GetBucketCorsInput) String() string { | ||
9637 | return awsutil.Prettify(s) | ||
9638 | } | ||
9639 | |||
9640 | // GoString returns the string representation | ||
9641 | func (s GetBucketCorsInput) GoString() string { | ||
9642 | return s.String() | ||
9643 | } | ||
9644 | |||
9645 | // Validate inspects the fields of the type to determine if they are valid. | ||
9646 | func (s *GetBucketCorsInput) Validate() error { | ||
9647 | invalidParams := request.ErrInvalidParams{Context: "GetBucketCorsInput"} | ||
9648 | if s.Bucket == nil { | ||
9649 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
9650 | } | ||
9651 | |||
9652 | if invalidParams.Len() > 0 { | ||
9653 | return invalidParams | ||
9654 | } | ||
9655 | return nil | ||
9656 | } | ||
9657 | |||
9658 | // SetBucket sets the Bucket field's value. | ||
9659 | func (s *GetBucketCorsInput) SetBucket(v string) *GetBucketCorsInput { | ||
9660 | s.Bucket = &v | ||
9661 | return s | ||
9662 | } | ||
9663 | |||
9664 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketCorsOutput | ||
9665 | type GetBucketCorsOutput struct { | ||
9666 | _ struct{} `type:"structure"` | ||
9667 | |||
9668 | CORSRules []*CORSRule `locationName:"CORSRule" type:"list" flattened:"true"` | ||
9669 | } | ||
9670 | |||
9671 | // String returns the string representation | ||
9672 | func (s GetBucketCorsOutput) String() string { | ||
9673 | return awsutil.Prettify(s) | ||
9674 | } | ||
9675 | |||
9676 | // GoString returns the string representation | ||
9677 | func (s GetBucketCorsOutput) GoString() string { | ||
9678 | return s.String() | ||
9679 | } | ||
9680 | |||
9681 | // SetCORSRules sets the CORSRules field's value. | ||
9682 | func (s *GetBucketCorsOutput) SetCORSRules(v []*CORSRule) *GetBucketCorsOutput { | ||
9683 | s.CORSRules = v | ||
9684 | return s | ||
9685 | } | ||
9686 | |||
9687 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketInventoryConfigurationRequest | ||
9688 | type GetBucketInventoryConfigurationInput struct { | ||
9689 | _ struct{} `type:"structure"` | ||
9690 | |||
9691 | // The name of the bucket containing the inventory configuration to retrieve. | ||
9692 | // | ||
9693 | // Bucket is a required field | ||
9694 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
9695 | |||
9696 | // The ID used to identify the inventory configuration. | ||
9697 | // | ||
9698 | // Id is a required field | ||
9699 | Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` | ||
9700 | } | ||
9701 | |||
9702 | // String returns the string representation | ||
9703 | func (s GetBucketInventoryConfigurationInput) String() string { | ||
9704 | return awsutil.Prettify(s) | ||
9705 | } | ||
9706 | |||
9707 | // GoString returns the string representation | ||
9708 | func (s GetBucketInventoryConfigurationInput) GoString() string { | ||
9709 | return s.String() | ||
9710 | } | ||
9711 | |||
9712 | // Validate inspects the fields of the type to determine if they are valid. | ||
9713 | func (s *GetBucketInventoryConfigurationInput) Validate() error { | ||
9714 | invalidParams := request.ErrInvalidParams{Context: "GetBucketInventoryConfigurationInput"} | ||
9715 | if s.Bucket == nil { | ||
9716 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
9717 | } | ||
9718 | if s.Id == nil { | ||
9719 | invalidParams.Add(request.NewErrParamRequired("Id")) | ||
9720 | } | ||
9721 | |||
9722 | if invalidParams.Len() > 0 { | ||
9723 | return invalidParams | ||
9724 | } | ||
9725 | return nil | ||
9726 | } | ||
9727 | |||
9728 | // SetBucket sets the Bucket field's value. | ||
9729 | func (s *GetBucketInventoryConfigurationInput) SetBucket(v string) *GetBucketInventoryConfigurationInput { | ||
9730 | s.Bucket = &v | ||
9731 | return s | ||
9732 | } | ||
9733 | |||
9734 | // SetId sets the Id field's value. | ||
9735 | func (s *GetBucketInventoryConfigurationInput) SetId(v string) *GetBucketInventoryConfigurationInput { | ||
9736 | s.Id = &v | ||
9737 | return s | ||
9738 | } | ||
9739 | |||
9740 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketInventoryConfigurationOutput | ||
9741 | type GetBucketInventoryConfigurationOutput struct { | ||
9742 | _ struct{} `type:"structure" payload:"InventoryConfiguration"` | ||
9743 | |||
9744 | // Specifies the inventory configuration. | ||
9745 | InventoryConfiguration *InventoryConfiguration `type:"structure"` | ||
9746 | } | ||
9747 | |||
9748 | // String returns the string representation | ||
9749 | func (s GetBucketInventoryConfigurationOutput) String() string { | ||
9750 | return awsutil.Prettify(s) | ||
9751 | } | ||
9752 | |||
9753 | // GoString returns the string representation | ||
9754 | func (s GetBucketInventoryConfigurationOutput) GoString() string { | ||
9755 | return s.String() | ||
9756 | } | ||
9757 | |||
9758 | // SetInventoryConfiguration sets the InventoryConfiguration field's value. | ||
9759 | func (s *GetBucketInventoryConfigurationOutput) SetInventoryConfiguration(v *InventoryConfiguration) *GetBucketInventoryConfigurationOutput { | ||
9760 | s.InventoryConfiguration = v | ||
9761 | return s | ||
9762 | } | ||
9763 | |||
9764 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLifecycleConfigurationRequest | ||
9765 | type GetBucketLifecycleConfigurationInput struct { | ||
9766 | _ struct{} `type:"structure"` | ||
9767 | |||
9768 | // Bucket is a required field | ||
9769 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
9770 | } | ||
9771 | |||
9772 | // String returns the string representation | ||
9773 | func (s GetBucketLifecycleConfigurationInput) String() string { | ||
9774 | return awsutil.Prettify(s) | ||
9775 | } | ||
9776 | |||
9777 | // GoString returns the string representation | ||
9778 | func (s GetBucketLifecycleConfigurationInput) GoString() string { | ||
9779 | return s.String() | ||
9780 | } | ||
9781 | |||
9782 | // Validate inspects the fields of the type to determine if they are valid. | ||
9783 | func (s *GetBucketLifecycleConfigurationInput) Validate() error { | ||
9784 | invalidParams := request.ErrInvalidParams{Context: "GetBucketLifecycleConfigurationInput"} | ||
9785 | if s.Bucket == nil { | ||
9786 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
9787 | } | ||
9788 | |||
9789 | if invalidParams.Len() > 0 { | ||
9790 | return invalidParams | ||
9791 | } | ||
9792 | return nil | ||
9793 | } | ||
9794 | |||
9795 | // SetBucket sets the Bucket field's value. | ||
9796 | func (s *GetBucketLifecycleConfigurationInput) SetBucket(v string) *GetBucketLifecycleConfigurationInput { | ||
9797 | s.Bucket = &v | ||
9798 | return s | ||
9799 | } | ||
9800 | |||
9801 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLifecycleConfigurationOutput | ||
9802 | type GetBucketLifecycleConfigurationOutput struct { | ||
9803 | _ struct{} `type:"structure"` | ||
9804 | |||
9805 | Rules []*LifecycleRule `locationName:"Rule" type:"list" flattened:"true"` | ||
9806 | } | ||
9807 | |||
9808 | // String returns the string representation | ||
9809 | func (s GetBucketLifecycleConfigurationOutput) String() string { | ||
9810 | return awsutil.Prettify(s) | ||
9811 | } | ||
9812 | |||
9813 | // GoString returns the string representation | ||
9814 | func (s GetBucketLifecycleConfigurationOutput) GoString() string { | ||
9815 | return s.String() | ||
9816 | } | ||
9817 | |||
9818 | // SetRules sets the Rules field's value. | ||
9819 | func (s *GetBucketLifecycleConfigurationOutput) SetRules(v []*LifecycleRule) *GetBucketLifecycleConfigurationOutput { | ||
9820 | s.Rules = v | ||
9821 | return s | ||
9822 | } | ||
9823 | |||
9824 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLifecycleRequest | ||
9825 | type GetBucketLifecycleInput struct { | ||
9826 | _ struct{} `type:"structure"` | ||
9827 | |||
9828 | // Bucket is a required field | ||
9829 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
9830 | } | ||
9831 | |||
9832 | // String returns the string representation | ||
9833 | func (s GetBucketLifecycleInput) String() string { | ||
9834 | return awsutil.Prettify(s) | ||
9835 | } | ||
9836 | |||
9837 | // GoString returns the string representation | ||
9838 | func (s GetBucketLifecycleInput) GoString() string { | ||
9839 | return s.String() | ||
9840 | } | ||
9841 | |||
9842 | // Validate inspects the fields of the type to determine if they are valid. | ||
9843 | func (s *GetBucketLifecycleInput) Validate() error { | ||
9844 | invalidParams := request.ErrInvalidParams{Context: "GetBucketLifecycleInput"} | ||
9845 | if s.Bucket == nil { | ||
9846 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
9847 | } | ||
9848 | |||
9849 | if invalidParams.Len() > 0 { | ||
9850 | return invalidParams | ||
9851 | } | ||
9852 | return nil | ||
9853 | } | ||
9854 | |||
9855 | // SetBucket sets the Bucket field's value. | ||
9856 | func (s *GetBucketLifecycleInput) SetBucket(v string) *GetBucketLifecycleInput { | ||
9857 | s.Bucket = &v | ||
9858 | return s | ||
9859 | } | ||
9860 | |||
9861 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLifecycleOutput | ||
9862 | type GetBucketLifecycleOutput struct { | ||
9863 | _ struct{} `type:"structure"` | ||
9864 | |||
9865 | Rules []*Rule `locationName:"Rule" type:"list" flattened:"true"` | ||
9866 | } | ||
9867 | |||
9868 | // String returns the string representation | ||
9869 | func (s GetBucketLifecycleOutput) String() string { | ||
9870 | return awsutil.Prettify(s) | ||
9871 | } | ||
9872 | |||
9873 | // GoString returns the string representation | ||
9874 | func (s GetBucketLifecycleOutput) GoString() string { | ||
9875 | return s.String() | ||
9876 | } | ||
9877 | |||
9878 | // SetRules sets the Rules field's value. | ||
9879 | func (s *GetBucketLifecycleOutput) SetRules(v []*Rule) *GetBucketLifecycleOutput { | ||
9880 | s.Rules = v | ||
9881 | return s | ||
9882 | } | ||
9883 | |||
9884 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLocationRequest | ||
9885 | type GetBucketLocationInput struct { | ||
9886 | _ struct{} `type:"structure"` | ||
9887 | |||
9888 | // Bucket is a required field | ||
9889 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
9890 | } | ||
9891 | |||
9892 | // String returns the string representation | ||
9893 | func (s GetBucketLocationInput) String() string { | ||
9894 | return awsutil.Prettify(s) | ||
9895 | } | ||
9896 | |||
9897 | // GoString returns the string representation | ||
9898 | func (s GetBucketLocationInput) GoString() string { | ||
9899 | return s.String() | ||
9900 | } | ||
9901 | |||
9902 | // Validate inspects the fields of the type to determine if they are valid. | ||
9903 | func (s *GetBucketLocationInput) Validate() error { | ||
9904 | invalidParams := request.ErrInvalidParams{Context: "GetBucketLocationInput"} | ||
9905 | if s.Bucket == nil { | ||
9906 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
9907 | } | ||
9908 | |||
9909 | if invalidParams.Len() > 0 { | ||
9910 | return invalidParams | ||
9911 | } | ||
9912 | return nil | ||
9913 | } | ||
9914 | |||
9915 | // SetBucket sets the Bucket field's value. | ||
9916 | func (s *GetBucketLocationInput) SetBucket(v string) *GetBucketLocationInput { | ||
9917 | s.Bucket = &v | ||
9918 | return s | ||
9919 | } | ||
9920 | |||
9921 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLocationOutput | ||
9922 | type GetBucketLocationOutput struct { | ||
9923 | _ struct{} `type:"structure"` | ||
9924 | |||
9925 | LocationConstraint *string `type:"string" enum:"BucketLocationConstraint"` | ||
9926 | } | ||
9927 | |||
9928 | // String returns the string representation | ||
9929 | func (s GetBucketLocationOutput) String() string { | ||
9930 | return awsutil.Prettify(s) | ||
9931 | } | ||
9932 | |||
9933 | // GoString returns the string representation | ||
9934 | func (s GetBucketLocationOutput) GoString() string { | ||
9935 | return s.String() | ||
9936 | } | ||
9937 | |||
9938 | // SetLocationConstraint sets the LocationConstraint field's value. | ||
9939 | func (s *GetBucketLocationOutput) SetLocationConstraint(v string) *GetBucketLocationOutput { | ||
9940 | s.LocationConstraint = &v | ||
9941 | return s | ||
9942 | } | ||
9943 | |||
9944 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLoggingRequest | ||
9945 | type GetBucketLoggingInput struct { | ||
9946 | _ struct{} `type:"structure"` | ||
9947 | |||
9948 | // Bucket is a required field | ||
9949 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
9950 | } | ||
9951 | |||
9952 | // String returns the string representation | ||
9953 | func (s GetBucketLoggingInput) String() string { | ||
9954 | return awsutil.Prettify(s) | ||
9955 | } | ||
9956 | |||
9957 | // GoString returns the string representation | ||
9958 | func (s GetBucketLoggingInput) GoString() string { | ||
9959 | return s.String() | ||
9960 | } | ||
9961 | |||
9962 | // Validate inspects the fields of the type to determine if they are valid. | ||
9963 | func (s *GetBucketLoggingInput) Validate() error { | ||
9964 | invalidParams := request.ErrInvalidParams{Context: "GetBucketLoggingInput"} | ||
9965 | if s.Bucket == nil { | ||
9966 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
9967 | } | ||
9968 | |||
9969 | if invalidParams.Len() > 0 { | ||
9970 | return invalidParams | ||
9971 | } | ||
9972 | return nil | ||
9973 | } | ||
9974 | |||
9975 | // SetBucket sets the Bucket field's value. | ||
9976 | func (s *GetBucketLoggingInput) SetBucket(v string) *GetBucketLoggingInput { | ||
9977 | s.Bucket = &v | ||
9978 | return s | ||
9979 | } | ||
9980 | |||
9981 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLoggingOutput | ||
9982 | type GetBucketLoggingOutput struct { | ||
9983 | _ struct{} `type:"structure"` | ||
9984 | |||
9985 | LoggingEnabled *LoggingEnabled `type:"structure"` | ||
9986 | } | ||
9987 | |||
9988 | // String returns the string representation | ||
9989 | func (s GetBucketLoggingOutput) String() string { | ||
9990 | return awsutil.Prettify(s) | ||
9991 | } | ||
9992 | |||
9993 | // GoString returns the string representation | ||
9994 | func (s GetBucketLoggingOutput) GoString() string { | ||
9995 | return s.String() | ||
9996 | } | ||
9997 | |||
9998 | // SetLoggingEnabled sets the LoggingEnabled field's value. | ||
9999 | func (s *GetBucketLoggingOutput) SetLoggingEnabled(v *LoggingEnabled) *GetBucketLoggingOutput { | ||
10000 | s.LoggingEnabled = v | ||
10001 | return s | ||
10002 | } | ||
10003 | |||
10004 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketMetricsConfigurationRequest | ||
10005 | type GetBucketMetricsConfigurationInput struct { | ||
10006 | _ struct{} `type:"structure"` | ||
10007 | |||
10008 | // The name of the bucket containing the metrics configuration to retrieve. | ||
10009 | // | ||
10010 | // Bucket is a required field | ||
10011 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
10012 | |||
10013 | // The ID used to identify the metrics configuration. | ||
10014 | // | ||
10015 | // Id is a required field | ||
10016 | Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` | ||
10017 | } | ||
10018 | |||
10019 | // String returns the string representation | ||
10020 | func (s GetBucketMetricsConfigurationInput) String() string { | ||
10021 | return awsutil.Prettify(s) | ||
10022 | } | ||
10023 | |||
10024 | // GoString returns the string representation | ||
10025 | func (s GetBucketMetricsConfigurationInput) GoString() string { | ||
10026 | return s.String() | ||
10027 | } | ||
10028 | |||
10029 | // Validate inspects the fields of the type to determine if they are valid. | ||
10030 | func (s *GetBucketMetricsConfigurationInput) Validate() error { | ||
10031 | invalidParams := request.ErrInvalidParams{Context: "GetBucketMetricsConfigurationInput"} | ||
10032 | if s.Bucket == nil { | ||
10033 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
10034 | } | ||
10035 | if s.Id == nil { | ||
10036 | invalidParams.Add(request.NewErrParamRequired("Id")) | ||
10037 | } | ||
10038 | |||
10039 | if invalidParams.Len() > 0 { | ||
10040 | return invalidParams | ||
10041 | } | ||
10042 | return nil | ||
10043 | } | ||
10044 | |||
10045 | // SetBucket sets the Bucket field's value. | ||
10046 | func (s *GetBucketMetricsConfigurationInput) SetBucket(v string) *GetBucketMetricsConfigurationInput { | ||
10047 | s.Bucket = &v | ||
10048 | return s | ||
10049 | } | ||
10050 | |||
10051 | // SetId sets the Id field's value. | ||
10052 | func (s *GetBucketMetricsConfigurationInput) SetId(v string) *GetBucketMetricsConfigurationInput { | ||
10053 | s.Id = &v | ||
10054 | return s | ||
10055 | } | ||
10056 | |||
10057 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketMetricsConfigurationOutput | ||
10058 | type GetBucketMetricsConfigurationOutput struct { | ||
10059 | _ struct{} `type:"structure" payload:"MetricsConfiguration"` | ||
10060 | |||
10061 | // Specifies the metrics configuration. | ||
10062 | MetricsConfiguration *MetricsConfiguration `type:"structure"` | ||
10063 | } | ||
10064 | |||
10065 | // String returns the string representation | ||
10066 | func (s GetBucketMetricsConfigurationOutput) String() string { | ||
10067 | return awsutil.Prettify(s) | ||
10068 | } | ||
10069 | |||
10070 | // GoString returns the string representation | ||
10071 | func (s GetBucketMetricsConfigurationOutput) GoString() string { | ||
10072 | return s.String() | ||
10073 | } | ||
10074 | |||
10075 | // SetMetricsConfiguration sets the MetricsConfiguration field's value. | ||
10076 | func (s *GetBucketMetricsConfigurationOutput) SetMetricsConfiguration(v *MetricsConfiguration) *GetBucketMetricsConfigurationOutput { | ||
10077 | s.MetricsConfiguration = v | ||
10078 | return s | ||
10079 | } | ||
10080 | |||
10081 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketNotificationConfigurationRequest | ||
10082 | type GetBucketNotificationConfigurationRequest struct { | ||
10083 | _ struct{} `type:"structure"` | ||
10084 | |||
10085 | // Name of the bucket to get the notification configuration for. | ||
10086 | // | ||
10087 | // Bucket is a required field | ||
10088 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
10089 | } | ||
10090 | |||
10091 | // String returns the string representation | ||
10092 | func (s GetBucketNotificationConfigurationRequest) String() string { | ||
10093 | return awsutil.Prettify(s) | ||
10094 | } | ||
10095 | |||
10096 | // GoString returns the string representation | ||
10097 | func (s GetBucketNotificationConfigurationRequest) GoString() string { | ||
10098 | return s.String() | ||
10099 | } | ||
10100 | |||
10101 | // Validate inspects the fields of the type to determine if they are valid. | ||
10102 | func (s *GetBucketNotificationConfigurationRequest) Validate() error { | ||
10103 | invalidParams := request.ErrInvalidParams{Context: "GetBucketNotificationConfigurationRequest"} | ||
10104 | if s.Bucket == nil { | ||
10105 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
10106 | } | ||
10107 | |||
10108 | if invalidParams.Len() > 0 { | ||
10109 | return invalidParams | ||
10110 | } | ||
10111 | return nil | ||
10112 | } | ||
10113 | |||
10114 | // SetBucket sets the Bucket field's value. | ||
10115 | func (s *GetBucketNotificationConfigurationRequest) SetBucket(v string) *GetBucketNotificationConfigurationRequest { | ||
10116 | s.Bucket = &v | ||
10117 | return s | ||
10118 | } | ||
10119 | |||
10120 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketPolicyRequest | ||
10121 | type GetBucketPolicyInput struct { | ||
10122 | _ struct{} `type:"structure"` | ||
10123 | |||
10124 | // Bucket is a required field | ||
10125 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
10126 | } | ||
10127 | |||
10128 | // String returns the string representation | ||
10129 | func (s GetBucketPolicyInput) String() string { | ||
10130 | return awsutil.Prettify(s) | ||
10131 | } | ||
10132 | |||
10133 | // GoString returns the string representation | ||
10134 | func (s GetBucketPolicyInput) GoString() string { | ||
10135 | return s.String() | ||
10136 | } | ||
10137 | |||
10138 | // Validate inspects the fields of the type to determine if they are valid. | ||
10139 | func (s *GetBucketPolicyInput) Validate() error { | ||
10140 | invalidParams := request.ErrInvalidParams{Context: "GetBucketPolicyInput"} | ||
10141 | if s.Bucket == nil { | ||
10142 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
10143 | } | ||
10144 | |||
10145 | if invalidParams.Len() > 0 { | ||
10146 | return invalidParams | ||
10147 | } | ||
10148 | return nil | ||
10149 | } | ||
10150 | |||
10151 | // SetBucket sets the Bucket field's value. | ||
10152 | func (s *GetBucketPolicyInput) SetBucket(v string) *GetBucketPolicyInput { | ||
10153 | s.Bucket = &v | ||
10154 | return s | ||
10155 | } | ||
10156 | |||
10157 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketPolicyOutput | ||
10158 | type GetBucketPolicyOutput struct { | ||
10159 | _ struct{} `type:"structure" payload:"Policy"` | ||
10160 | |||
10161 | // The bucket policy as a JSON document. | ||
10162 | Policy *string `type:"string"` | ||
10163 | } | ||
10164 | |||
10165 | // String returns the string representation | ||
10166 | func (s GetBucketPolicyOutput) String() string { | ||
10167 | return awsutil.Prettify(s) | ||
10168 | } | ||
10169 | |||
10170 | // GoString returns the string representation | ||
10171 | func (s GetBucketPolicyOutput) GoString() string { | ||
10172 | return s.String() | ||
10173 | } | ||
10174 | |||
10175 | // SetPolicy sets the Policy field's value. | ||
10176 | func (s *GetBucketPolicyOutput) SetPolicy(v string) *GetBucketPolicyOutput { | ||
10177 | s.Policy = &v | ||
10178 | return s | ||
10179 | } | ||
10180 | |||
10181 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketReplicationRequest | ||
10182 | type GetBucketReplicationInput struct { | ||
10183 | _ struct{} `type:"structure"` | ||
10184 | |||
10185 | // Bucket is a required field | ||
10186 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
10187 | } | ||
10188 | |||
10189 | // String returns the string representation | ||
10190 | func (s GetBucketReplicationInput) String() string { | ||
10191 | return awsutil.Prettify(s) | ||
10192 | } | ||
10193 | |||
10194 | // GoString returns the string representation | ||
10195 | func (s GetBucketReplicationInput) GoString() string { | ||
10196 | return s.String() | ||
10197 | } | ||
10198 | |||
10199 | // Validate inspects the fields of the type to determine if they are valid. | ||
10200 | func (s *GetBucketReplicationInput) Validate() error { | ||
10201 | invalidParams := request.ErrInvalidParams{Context: "GetBucketReplicationInput"} | ||
10202 | if s.Bucket == nil { | ||
10203 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
10204 | } | ||
10205 | |||
10206 | if invalidParams.Len() > 0 { | ||
10207 | return invalidParams | ||
10208 | } | ||
10209 | return nil | ||
10210 | } | ||
10211 | |||
10212 | // SetBucket sets the Bucket field's value. | ||
10213 | func (s *GetBucketReplicationInput) SetBucket(v string) *GetBucketReplicationInput { | ||
10214 | s.Bucket = &v | ||
10215 | return s | ||
10216 | } | ||
10217 | |||
10218 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketReplicationOutput | ||
10219 | type GetBucketReplicationOutput struct { | ||
10220 | _ struct{} `type:"structure" payload:"ReplicationConfiguration"` | ||
10221 | |||
10222 | // Container for replication rules. You can add as many as 1,000 rules. Total | ||
10223 | // replication configuration size can be up to 2 MB. | ||
10224 | ReplicationConfiguration *ReplicationConfiguration `type:"structure"` | ||
10225 | } | ||
10226 | |||
10227 | // String returns the string representation | ||
10228 | func (s GetBucketReplicationOutput) String() string { | ||
10229 | return awsutil.Prettify(s) | ||
10230 | } | ||
10231 | |||
10232 | // GoString returns the string representation | ||
10233 | func (s GetBucketReplicationOutput) GoString() string { | ||
10234 | return s.String() | ||
10235 | } | ||
10236 | |||
10237 | // SetReplicationConfiguration sets the ReplicationConfiguration field's value. | ||
10238 | func (s *GetBucketReplicationOutput) SetReplicationConfiguration(v *ReplicationConfiguration) *GetBucketReplicationOutput { | ||
10239 | s.ReplicationConfiguration = v | ||
10240 | return s | ||
10241 | } | ||
10242 | |||
10243 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketRequestPaymentRequest | ||
10244 | type GetBucketRequestPaymentInput struct { | ||
10245 | _ struct{} `type:"structure"` | ||
10246 | |||
10247 | // Bucket is a required field | ||
10248 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
10249 | } | ||
10250 | |||
10251 | // String returns the string representation | ||
10252 | func (s GetBucketRequestPaymentInput) String() string { | ||
10253 | return awsutil.Prettify(s) | ||
10254 | } | ||
10255 | |||
10256 | // GoString returns the string representation | ||
10257 | func (s GetBucketRequestPaymentInput) GoString() string { | ||
10258 | return s.String() | ||
10259 | } | ||
10260 | |||
10261 | // Validate inspects the fields of the type to determine if they are valid. | ||
10262 | func (s *GetBucketRequestPaymentInput) Validate() error { | ||
10263 | invalidParams := request.ErrInvalidParams{Context: "GetBucketRequestPaymentInput"} | ||
10264 | if s.Bucket == nil { | ||
10265 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
10266 | } | ||
10267 | |||
10268 | if invalidParams.Len() > 0 { | ||
10269 | return invalidParams | ||
10270 | } | ||
10271 | return nil | ||
10272 | } | ||
10273 | |||
10274 | // SetBucket sets the Bucket field's value. | ||
10275 | func (s *GetBucketRequestPaymentInput) SetBucket(v string) *GetBucketRequestPaymentInput { | ||
10276 | s.Bucket = &v | ||
10277 | return s | ||
10278 | } | ||
10279 | |||
10280 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketRequestPaymentOutput | ||
10281 | type GetBucketRequestPaymentOutput struct { | ||
10282 | _ struct{} `type:"structure"` | ||
10283 | |||
10284 | // Specifies who pays for the download and request fees. | ||
10285 | Payer *string `type:"string" enum:"Payer"` | ||
10286 | } | ||
10287 | |||
10288 | // String returns the string representation | ||
10289 | func (s GetBucketRequestPaymentOutput) String() string { | ||
10290 | return awsutil.Prettify(s) | ||
10291 | } | ||
10292 | |||
10293 | // GoString returns the string representation | ||
10294 | func (s GetBucketRequestPaymentOutput) GoString() string { | ||
10295 | return s.String() | ||
10296 | } | ||
10297 | |||
10298 | // SetPayer sets the Payer field's value. | ||
10299 | func (s *GetBucketRequestPaymentOutput) SetPayer(v string) *GetBucketRequestPaymentOutput { | ||
10300 | s.Payer = &v | ||
10301 | return s | ||
10302 | } | ||
10303 | |||
10304 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketTaggingRequest | ||
10305 | type GetBucketTaggingInput struct { | ||
10306 | _ struct{} `type:"structure"` | ||
10307 | |||
10308 | // Bucket is a required field | ||
10309 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
10310 | } | ||
10311 | |||
10312 | // String returns the string representation | ||
10313 | func (s GetBucketTaggingInput) String() string { | ||
10314 | return awsutil.Prettify(s) | ||
10315 | } | ||
10316 | |||
10317 | // GoString returns the string representation | ||
10318 | func (s GetBucketTaggingInput) GoString() string { | ||
10319 | return s.String() | ||
10320 | } | ||
10321 | |||
10322 | // Validate inspects the fields of the type to determine if they are valid. | ||
10323 | func (s *GetBucketTaggingInput) Validate() error { | ||
10324 | invalidParams := request.ErrInvalidParams{Context: "GetBucketTaggingInput"} | ||
10325 | if s.Bucket == nil { | ||
10326 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
10327 | } | ||
10328 | |||
10329 | if invalidParams.Len() > 0 { | ||
10330 | return invalidParams | ||
10331 | } | ||
10332 | return nil | ||
10333 | } | ||
10334 | |||
10335 | // SetBucket sets the Bucket field's value. | ||
10336 | func (s *GetBucketTaggingInput) SetBucket(v string) *GetBucketTaggingInput { | ||
10337 | s.Bucket = &v | ||
10338 | return s | ||
10339 | } | ||
10340 | |||
10341 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketTaggingOutput | ||
10342 | type GetBucketTaggingOutput struct { | ||
10343 | _ struct{} `type:"structure"` | ||
10344 | |||
10345 | // TagSet is a required field | ||
10346 | TagSet []*Tag `locationNameList:"Tag" type:"list" required:"true"` | ||
10347 | } | ||
10348 | |||
10349 | // String returns the string representation | ||
10350 | func (s GetBucketTaggingOutput) String() string { | ||
10351 | return awsutil.Prettify(s) | ||
10352 | } | ||
10353 | |||
10354 | // GoString returns the string representation | ||
10355 | func (s GetBucketTaggingOutput) GoString() string { | ||
10356 | return s.String() | ||
10357 | } | ||
10358 | |||
10359 | // SetTagSet sets the TagSet field's value. | ||
10360 | func (s *GetBucketTaggingOutput) SetTagSet(v []*Tag) *GetBucketTaggingOutput { | ||
10361 | s.TagSet = v | ||
10362 | return s | ||
10363 | } | ||
10364 | |||
10365 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketVersioningRequest | ||
10366 | type GetBucketVersioningInput struct { | ||
10367 | _ struct{} `type:"structure"` | ||
10368 | |||
10369 | // Bucket is a required field | ||
10370 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
10371 | } | ||
10372 | |||
10373 | // String returns the string representation | ||
10374 | func (s GetBucketVersioningInput) String() string { | ||
10375 | return awsutil.Prettify(s) | ||
10376 | } | ||
10377 | |||
10378 | // GoString returns the string representation | ||
10379 | func (s GetBucketVersioningInput) GoString() string { | ||
10380 | return s.String() | ||
10381 | } | ||
10382 | |||
10383 | // Validate inspects the fields of the type to determine if they are valid. | ||
10384 | func (s *GetBucketVersioningInput) Validate() error { | ||
10385 | invalidParams := request.ErrInvalidParams{Context: "GetBucketVersioningInput"} | ||
10386 | if s.Bucket == nil { | ||
10387 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
10388 | } | ||
10389 | |||
10390 | if invalidParams.Len() > 0 { | ||
10391 | return invalidParams | ||
10392 | } | ||
10393 | return nil | ||
10394 | } | ||
10395 | |||
10396 | // SetBucket sets the Bucket field's value. | ||
10397 | func (s *GetBucketVersioningInput) SetBucket(v string) *GetBucketVersioningInput { | ||
10398 | s.Bucket = &v | ||
10399 | return s | ||
10400 | } | ||
10401 | |||
10402 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketVersioningOutput | ||
10403 | type GetBucketVersioningOutput struct { | ||
10404 | _ struct{} `type:"structure"` | ||
10405 | |||
10406 | // Specifies whether MFA delete is enabled in the bucket versioning configuration. | ||
10407 | // This element is only returned if the bucket has been configured with MFA | ||
10408 | // delete. If the bucket has never been so configured, this element is not returned. | ||
10409 | MFADelete *string `locationName:"MfaDelete" type:"string" enum:"MFADeleteStatus"` | ||
10410 | |||
10411 | // The versioning state of the bucket. | ||
10412 | Status *string `type:"string" enum:"BucketVersioningStatus"` | ||
10413 | } | ||
10414 | |||
10415 | // String returns the string representation | ||
10416 | func (s GetBucketVersioningOutput) String() string { | ||
10417 | return awsutil.Prettify(s) | ||
10418 | } | ||
10419 | |||
10420 | // GoString returns the string representation | ||
10421 | func (s GetBucketVersioningOutput) GoString() string { | ||
10422 | return s.String() | ||
10423 | } | ||
10424 | |||
10425 | // SetMFADelete sets the MFADelete field's value. | ||
10426 | func (s *GetBucketVersioningOutput) SetMFADelete(v string) *GetBucketVersioningOutput { | ||
10427 | s.MFADelete = &v | ||
10428 | return s | ||
10429 | } | ||
10430 | |||
10431 | // SetStatus sets the Status field's value. | ||
10432 | func (s *GetBucketVersioningOutput) SetStatus(v string) *GetBucketVersioningOutput { | ||
10433 | s.Status = &v | ||
10434 | return s | ||
10435 | } | ||
10436 | |||
10437 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketWebsiteRequest | ||
10438 | type GetBucketWebsiteInput struct { | ||
10439 | _ struct{} `type:"structure"` | ||
10440 | |||
10441 | // Bucket is a required field | ||
10442 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
10443 | } | ||
10444 | |||
10445 | // String returns the string representation | ||
10446 | func (s GetBucketWebsiteInput) String() string { | ||
10447 | return awsutil.Prettify(s) | ||
10448 | } | ||
10449 | |||
10450 | // GoString returns the string representation | ||
10451 | func (s GetBucketWebsiteInput) GoString() string { | ||
10452 | return s.String() | ||
10453 | } | ||
10454 | |||
10455 | // Validate inspects the fields of the type to determine if they are valid. | ||
10456 | func (s *GetBucketWebsiteInput) Validate() error { | ||
10457 | invalidParams := request.ErrInvalidParams{Context: "GetBucketWebsiteInput"} | ||
10458 | if s.Bucket == nil { | ||
10459 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
10460 | } | ||
10461 | |||
10462 | if invalidParams.Len() > 0 { | ||
10463 | return invalidParams | ||
10464 | } | ||
10465 | return nil | ||
10466 | } | ||
10467 | |||
10468 | // SetBucket sets the Bucket field's value. | ||
10469 | func (s *GetBucketWebsiteInput) SetBucket(v string) *GetBucketWebsiteInput { | ||
10470 | s.Bucket = &v | ||
10471 | return s | ||
10472 | } | ||
10473 | |||
10474 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketWebsiteOutput | ||
10475 | type GetBucketWebsiteOutput struct { | ||
10476 | _ struct{} `type:"structure"` | ||
10477 | |||
10478 | ErrorDocument *ErrorDocument `type:"structure"` | ||
10479 | |||
10480 | IndexDocument *IndexDocument `type:"structure"` | ||
10481 | |||
10482 | RedirectAllRequestsTo *RedirectAllRequestsTo `type:"structure"` | ||
10483 | |||
10484 | RoutingRules []*RoutingRule `locationNameList:"RoutingRule" type:"list"` | ||
10485 | } | ||
10486 | |||
10487 | // String returns the string representation | ||
10488 | func (s GetBucketWebsiteOutput) String() string { | ||
10489 | return awsutil.Prettify(s) | ||
10490 | } | ||
10491 | |||
10492 | // GoString returns the string representation | ||
10493 | func (s GetBucketWebsiteOutput) GoString() string { | ||
10494 | return s.String() | ||
10495 | } | ||
10496 | |||
10497 | // SetErrorDocument sets the ErrorDocument field's value. | ||
10498 | func (s *GetBucketWebsiteOutput) SetErrorDocument(v *ErrorDocument) *GetBucketWebsiteOutput { | ||
10499 | s.ErrorDocument = v | ||
10500 | return s | ||
10501 | } | ||
10502 | |||
10503 | // SetIndexDocument sets the IndexDocument field's value. | ||
10504 | func (s *GetBucketWebsiteOutput) SetIndexDocument(v *IndexDocument) *GetBucketWebsiteOutput { | ||
10505 | s.IndexDocument = v | ||
10506 | return s | ||
10507 | } | ||
10508 | |||
10509 | // SetRedirectAllRequestsTo sets the RedirectAllRequestsTo field's value. | ||
10510 | func (s *GetBucketWebsiteOutput) SetRedirectAllRequestsTo(v *RedirectAllRequestsTo) *GetBucketWebsiteOutput { | ||
10511 | s.RedirectAllRequestsTo = v | ||
10512 | return s | ||
10513 | } | ||
10514 | |||
10515 | // SetRoutingRules sets the RoutingRules field's value. | ||
10516 | func (s *GetBucketWebsiteOutput) SetRoutingRules(v []*RoutingRule) *GetBucketWebsiteOutput { | ||
10517 | s.RoutingRules = v | ||
10518 | return s | ||
10519 | } | ||
10520 | |||
10521 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectAclRequest | ||
10522 | type GetObjectAclInput struct { | ||
10523 | _ struct{} `type:"structure"` | ||
10524 | |||
10525 | // Bucket is a required field | ||
10526 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
10527 | |||
10528 | // Key is a required field | ||
10529 | Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` | ||
10530 | |||
10531 | // Confirms that the requester knows that she or he will be charged for the | ||
10532 | // request. Bucket owners need not specify this parameter in their requests. | ||
10533 | // Documentation on downloading objects from requester pays buckets can be found | ||
10534 | // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html | ||
10535 | RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` | ||
10536 | |||
10537 | // VersionId used to reference a specific version of the object. | ||
10538 | VersionId *string `location:"querystring" locationName:"versionId" type:"string"` | ||
10539 | } | ||
10540 | |||
10541 | // String returns the string representation | ||
10542 | func (s GetObjectAclInput) String() string { | ||
10543 | return awsutil.Prettify(s) | ||
10544 | } | ||
10545 | |||
10546 | // GoString returns the string representation | ||
10547 | func (s GetObjectAclInput) GoString() string { | ||
10548 | return s.String() | ||
10549 | } | ||
10550 | |||
10551 | // Validate inspects the fields of the type to determine if they are valid. | ||
10552 | func (s *GetObjectAclInput) Validate() error { | ||
10553 | invalidParams := request.ErrInvalidParams{Context: "GetObjectAclInput"} | ||
10554 | if s.Bucket == nil { | ||
10555 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
10556 | } | ||
10557 | if s.Key == nil { | ||
10558 | invalidParams.Add(request.NewErrParamRequired("Key")) | ||
10559 | } | ||
10560 | if s.Key != nil && len(*s.Key) < 1 { | ||
10561 | invalidParams.Add(request.NewErrParamMinLen("Key", 1)) | ||
10562 | } | ||
10563 | |||
10564 | if invalidParams.Len() > 0 { | ||
10565 | return invalidParams | ||
10566 | } | ||
10567 | return nil | ||
10568 | } | ||
10569 | |||
10570 | // SetBucket sets the Bucket field's value. | ||
10571 | func (s *GetObjectAclInput) SetBucket(v string) *GetObjectAclInput { | ||
10572 | s.Bucket = &v | ||
10573 | return s | ||
10574 | } | ||
10575 | |||
10576 | // SetKey sets the Key field's value. | ||
10577 | func (s *GetObjectAclInput) SetKey(v string) *GetObjectAclInput { | ||
10578 | s.Key = &v | ||
10579 | return s | ||
10580 | } | ||
10581 | |||
10582 | // SetRequestPayer sets the RequestPayer field's value. | ||
10583 | func (s *GetObjectAclInput) SetRequestPayer(v string) *GetObjectAclInput { | ||
10584 | s.RequestPayer = &v | ||
10585 | return s | ||
10586 | } | ||
10587 | |||
10588 | // SetVersionId sets the VersionId field's value. | ||
10589 | func (s *GetObjectAclInput) SetVersionId(v string) *GetObjectAclInput { | ||
10590 | s.VersionId = &v | ||
10591 | return s | ||
10592 | } | ||
10593 | |||
10594 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectAclOutput | ||
10595 | type GetObjectAclOutput struct { | ||
10596 | _ struct{} `type:"structure"` | ||
10597 | |||
10598 | // A list of grants. | ||
10599 | Grants []*Grant `locationName:"AccessControlList" locationNameList:"Grant" type:"list"` | ||
10600 | |||
10601 | Owner *Owner `type:"structure"` | ||
10602 | |||
10603 | // If present, indicates that the requester was successfully charged for the | ||
10604 | // request. | ||
10605 | RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` | ||
10606 | } | ||
10607 | |||
10608 | // String returns the string representation | ||
10609 | func (s GetObjectAclOutput) String() string { | ||
10610 | return awsutil.Prettify(s) | ||
10611 | } | ||
10612 | |||
10613 | // GoString returns the string representation | ||
10614 | func (s GetObjectAclOutput) GoString() string { | ||
10615 | return s.String() | ||
10616 | } | ||
10617 | |||
10618 | // SetGrants sets the Grants field's value. | ||
10619 | func (s *GetObjectAclOutput) SetGrants(v []*Grant) *GetObjectAclOutput { | ||
10620 | s.Grants = v | ||
10621 | return s | ||
10622 | } | ||
10623 | |||
10624 | // SetOwner sets the Owner field's value. | ||
10625 | func (s *GetObjectAclOutput) SetOwner(v *Owner) *GetObjectAclOutput { | ||
10626 | s.Owner = v | ||
10627 | return s | ||
10628 | } | ||
10629 | |||
10630 | // SetRequestCharged sets the RequestCharged field's value. | ||
10631 | func (s *GetObjectAclOutput) SetRequestCharged(v string) *GetObjectAclOutput { | ||
10632 | s.RequestCharged = &v | ||
10633 | return s | ||
10634 | } | ||
10635 | |||
10636 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectRequest | ||
10637 | type GetObjectInput struct { | ||
10638 | _ struct{} `type:"structure"` | ||
10639 | |||
10640 | // Bucket is a required field | ||
10641 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
10642 | |||
10643 | // Return the object only if its entity tag (ETag) is the same as the one specified, | ||
10644 | // otherwise return a 412 (precondition failed). | ||
10645 | IfMatch *string `location:"header" locationName:"If-Match" type:"string"` | ||
10646 | |||
10647 | // Return the object only if it has been modified since the specified time, | ||
10648 | // otherwise return a 304 (not modified). | ||
10649 | IfModifiedSince *time.Time `location:"header" locationName:"If-Modified-Since" type:"timestamp" timestampFormat:"rfc822"` | ||
10650 | |||
10651 | // Return the object only if its entity tag (ETag) is different from the one | ||
10652 | // specified, otherwise return a 304 (not modified). | ||
10653 | IfNoneMatch *string `location:"header" locationName:"If-None-Match" type:"string"` | ||
10654 | |||
10655 | // Return the object only if it has not been modified since the specified time, | ||
10656 | // otherwise return a 412 (precondition failed). | ||
10657 | IfUnmodifiedSince *time.Time `location:"header" locationName:"If-Unmodified-Since" type:"timestamp" timestampFormat:"rfc822"` | ||
10658 | |||
10659 | // Key is a required field | ||
10660 | Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` | ||
10661 | |||
10662 | // Part number of the object being read. This is a positive integer between | ||
10663 | // 1 and 10,000. Effectively performs a 'ranged' GET request for the part specified. | ||
10664 | // Useful for downloading just a part of an object. | ||
10665 | PartNumber *int64 `location:"querystring" locationName:"partNumber" type:"integer"` | ||
10666 | |||
10667 | // Downloads the specified range bytes of an object. For more information about | ||
10668 | // the HTTP Range header, go to http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35. | ||
10669 | Range *string `location:"header" locationName:"Range" type:"string"` | ||
10670 | |||
10671 | // Confirms that the requester knows that she or he will be charged for the | ||
10672 | // request. Bucket owners need not specify this parameter in their requests. | ||
10673 | // Documentation on downloading objects from requester pays buckets can be found | ||
10674 | // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html | ||
10675 | RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` | ||
10676 | |||
10677 | // Sets the Cache-Control header of the response. | ||
10678 | ResponseCacheControl *string `location:"querystring" locationName:"response-cache-control" type:"string"` | ||
10679 | |||
10680 | // Sets the Content-Disposition header of the response | ||
10681 | ResponseContentDisposition *string `location:"querystring" locationName:"response-content-disposition" type:"string"` | ||
10682 | |||
10683 | // Sets the Content-Encoding header of the response. | ||
10684 | ResponseContentEncoding *string `location:"querystring" locationName:"response-content-encoding" type:"string"` | ||
10685 | |||
10686 | // Sets the Content-Language header of the response. | ||
10687 | ResponseContentLanguage *string `location:"querystring" locationName:"response-content-language" type:"string"` | ||
10688 | |||
10689 | // Sets the Content-Type header of the response. | ||
10690 | ResponseContentType *string `location:"querystring" locationName:"response-content-type" type:"string"` | ||
10691 | |||
10692 | // Sets the Expires header of the response. | ||
10693 | ResponseExpires *time.Time `location:"querystring" locationName:"response-expires" type:"timestamp" timestampFormat:"iso8601"` | ||
10694 | |||
10695 | // Specifies the algorithm to use to when encrypting the object (e.g., AES256). | ||
10696 | SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` | ||
10697 | |||
10698 | // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting | ||
10699 | // data. This value is used to store the object and then it is discarded; Amazon | ||
10700 | // does not store the encryption key. The key must be appropriate for use with | ||
10701 | // the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm | ||
10702 | // header. | ||
10703 | SSECustomerKey *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string"` | ||
10704 | |||
10705 | // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. | ||
10706 | // Amazon S3 uses this header for a message integrity check to ensure the encryption | ||
10707 | // key was transmitted without error. | ||
10708 | SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` | ||
10709 | |||
10710 | // VersionId used to reference a specific version of the object. | ||
10711 | VersionId *string `location:"querystring" locationName:"versionId" type:"string"` | ||
10712 | } | ||
10713 | |||
10714 | // String returns the string representation | ||
10715 | func (s GetObjectInput) String() string { | ||
10716 | return awsutil.Prettify(s) | ||
10717 | } | ||
10718 | |||
10719 | // GoString returns the string representation | ||
10720 | func (s GetObjectInput) GoString() string { | ||
10721 | return s.String() | ||
10722 | } | ||
10723 | |||
10724 | // Validate inspects the fields of the type to determine if they are valid. | ||
10725 | func (s *GetObjectInput) Validate() error { | ||
10726 | invalidParams := request.ErrInvalidParams{Context: "GetObjectInput"} | ||
10727 | if s.Bucket == nil { | ||
10728 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
10729 | } | ||
10730 | if s.Key == nil { | ||
10731 | invalidParams.Add(request.NewErrParamRequired("Key")) | ||
10732 | } | ||
10733 | if s.Key != nil && len(*s.Key) < 1 { | ||
10734 | invalidParams.Add(request.NewErrParamMinLen("Key", 1)) | ||
10735 | } | ||
10736 | |||
10737 | if invalidParams.Len() > 0 { | ||
10738 | return invalidParams | ||
10739 | } | ||
10740 | return nil | ||
10741 | } | ||
10742 | |||
10743 | // SetBucket sets the Bucket field's value. | ||
10744 | func (s *GetObjectInput) SetBucket(v string) *GetObjectInput { | ||
10745 | s.Bucket = &v | ||
10746 | return s | ||
10747 | } | ||
10748 | |||
10749 | // SetIfMatch sets the IfMatch field's value. | ||
10750 | func (s *GetObjectInput) SetIfMatch(v string) *GetObjectInput { | ||
10751 | s.IfMatch = &v | ||
10752 | return s | ||
10753 | } | ||
10754 | |||
10755 | // SetIfModifiedSince sets the IfModifiedSince field's value. | ||
10756 | func (s *GetObjectInput) SetIfModifiedSince(v time.Time) *GetObjectInput { | ||
10757 | s.IfModifiedSince = &v | ||
10758 | return s | ||
10759 | } | ||
10760 | |||
10761 | // SetIfNoneMatch sets the IfNoneMatch field's value. | ||
10762 | func (s *GetObjectInput) SetIfNoneMatch(v string) *GetObjectInput { | ||
10763 | s.IfNoneMatch = &v | ||
10764 | return s | ||
10765 | } | ||
10766 | |||
10767 | // SetIfUnmodifiedSince sets the IfUnmodifiedSince field's value. | ||
10768 | func (s *GetObjectInput) SetIfUnmodifiedSince(v time.Time) *GetObjectInput { | ||
10769 | s.IfUnmodifiedSince = &v | ||
10770 | return s | ||
10771 | } | ||
10772 | |||
10773 | // SetKey sets the Key field's value. | ||
10774 | func (s *GetObjectInput) SetKey(v string) *GetObjectInput { | ||
10775 | s.Key = &v | ||
10776 | return s | ||
10777 | } | ||
10778 | |||
10779 | // SetPartNumber sets the PartNumber field's value. | ||
10780 | func (s *GetObjectInput) SetPartNumber(v int64) *GetObjectInput { | ||
10781 | s.PartNumber = &v | ||
10782 | return s | ||
10783 | } | ||
10784 | |||
10785 | // SetRange sets the Range field's value. | ||
10786 | func (s *GetObjectInput) SetRange(v string) *GetObjectInput { | ||
10787 | s.Range = &v | ||
10788 | return s | ||
10789 | } | ||
10790 | |||
10791 | // SetRequestPayer sets the RequestPayer field's value. | ||
10792 | func (s *GetObjectInput) SetRequestPayer(v string) *GetObjectInput { | ||
10793 | s.RequestPayer = &v | ||
10794 | return s | ||
10795 | } | ||
10796 | |||
10797 | // SetResponseCacheControl sets the ResponseCacheControl field's value. | ||
10798 | func (s *GetObjectInput) SetResponseCacheControl(v string) *GetObjectInput { | ||
10799 | s.ResponseCacheControl = &v | ||
10800 | return s | ||
10801 | } | ||
10802 | |||
10803 | // SetResponseContentDisposition sets the ResponseContentDisposition field's value. | ||
10804 | func (s *GetObjectInput) SetResponseContentDisposition(v string) *GetObjectInput { | ||
10805 | s.ResponseContentDisposition = &v | ||
10806 | return s | ||
10807 | } | ||
10808 | |||
10809 | // SetResponseContentEncoding sets the ResponseContentEncoding field's value. | ||
10810 | func (s *GetObjectInput) SetResponseContentEncoding(v string) *GetObjectInput { | ||
10811 | s.ResponseContentEncoding = &v | ||
10812 | return s | ||
10813 | } | ||
10814 | |||
10815 | // SetResponseContentLanguage sets the ResponseContentLanguage field's value. | ||
10816 | func (s *GetObjectInput) SetResponseContentLanguage(v string) *GetObjectInput { | ||
10817 | s.ResponseContentLanguage = &v | ||
10818 | return s | ||
10819 | } | ||
10820 | |||
10821 | // SetResponseContentType sets the ResponseContentType field's value. | ||
10822 | func (s *GetObjectInput) SetResponseContentType(v string) *GetObjectInput { | ||
10823 | s.ResponseContentType = &v | ||
10824 | return s | ||
10825 | } | ||
10826 | |||
10827 | // SetResponseExpires sets the ResponseExpires field's value. | ||
10828 | func (s *GetObjectInput) SetResponseExpires(v time.Time) *GetObjectInput { | ||
10829 | s.ResponseExpires = &v | ||
10830 | return s | ||
10831 | } | ||
10832 | |||
10833 | // SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. | ||
10834 | func (s *GetObjectInput) SetSSECustomerAlgorithm(v string) *GetObjectInput { | ||
10835 | s.SSECustomerAlgorithm = &v | ||
10836 | return s | ||
10837 | } | ||
10838 | |||
10839 | // SetSSECustomerKey sets the SSECustomerKey field's value. | ||
10840 | func (s *GetObjectInput) SetSSECustomerKey(v string) *GetObjectInput { | ||
10841 | s.SSECustomerKey = &v | ||
10842 | return s | ||
10843 | } | ||
10844 | |||
10845 | // SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. | ||
10846 | func (s *GetObjectInput) SetSSECustomerKeyMD5(v string) *GetObjectInput { | ||
10847 | s.SSECustomerKeyMD5 = &v | ||
10848 | return s | ||
10849 | } | ||
10850 | |||
10851 | // SetVersionId sets the VersionId field's value. | ||
10852 | func (s *GetObjectInput) SetVersionId(v string) *GetObjectInput { | ||
10853 | s.VersionId = &v | ||
10854 | return s | ||
10855 | } | ||
10856 | |||
10857 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectOutput | ||
10858 | type GetObjectOutput struct { | ||
10859 | _ struct{} `type:"structure" payload:"Body"` | ||
10860 | |||
10861 | AcceptRanges *string `location:"header" locationName:"accept-ranges" type:"string"` | ||
10862 | |||
10863 | // Object data. | ||
10864 | Body io.ReadCloser `type:"blob"` | ||
10865 | |||
10866 | // Specifies caching behavior along the request/reply chain. | ||
10867 | CacheControl *string `location:"header" locationName:"Cache-Control" type:"string"` | ||
10868 | |||
10869 | // Specifies presentational information for the object. | ||
10870 | ContentDisposition *string `location:"header" locationName:"Content-Disposition" type:"string"` | ||
10871 | |||
10872 | // Specifies what content encodings have been applied to the object and thus | ||
10873 | // what decoding mechanisms must be applied to obtain the media-type referenced | ||
10874 | // by the Content-Type header field. | ||
10875 | ContentEncoding *string `location:"header" locationName:"Content-Encoding" type:"string"` | ||
10876 | |||
10877 | // The language the content is in. | ||
10878 | ContentLanguage *string `location:"header" locationName:"Content-Language" type:"string"` | ||
10879 | |||
10880 | // Size of the body in bytes. | ||
10881 | ContentLength *int64 `location:"header" locationName:"Content-Length" type:"long"` | ||
10882 | |||
10883 | // The portion of the object returned in the response. | ||
10884 | ContentRange *string `location:"header" locationName:"Content-Range" type:"string"` | ||
10885 | |||
10886 | // A standard MIME type describing the format of the object data. | ||
10887 | ContentType *string `location:"header" locationName:"Content-Type" type:"string"` | ||
10888 | |||
10889 | // Specifies whether the object retrieved was (true) or was not (false) a Delete | ||
10890 | // Marker. If false, this response header does not appear in the response. | ||
10891 | DeleteMarker *bool `location:"header" locationName:"x-amz-delete-marker" type:"boolean"` | ||
10892 | |||
10893 | // An ETag is an opaque identifier assigned by a web server to a specific version | ||
10894 | // of a resource found at a URL | ||
10895 | ETag *string `location:"header" locationName:"ETag" type:"string"` | ||
10896 | |||
10897 | // If the object expiration is configured (see PUT Bucket lifecycle), the response | ||
10898 | // includes this header. It includes the expiry-date and rule-id key value pairs | ||
10899 | // providing object expiration information. The value of the rule-id is URL | ||
10900 | // encoded. | ||
10901 | Expiration *string `location:"header" locationName:"x-amz-expiration" type:"string"` | ||
10902 | |||
10903 | // The date and time at which the object is no longer cacheable. | ||
10904 | Expires *string `location:"header" locationName:"Expires" type:"string"` | ||
10905 | |||
10906 | // Last modified date of the object | ||
10907 | LastModified *time.Time `location:"header" locationName:"Last-Modified" type:"timestamp" timestampFormat:"rfc822"` | ||
10908 | |||
10909 | // A map of metadata to store with the object in S3. | ||
10910 | Metadata map[string]*string `location:"headers" locationName:"x-amz-meta-" type:"map"` | ||
10911 | |||
10912 | // This is set to the number of metadata entries not returned in x-amz-meta | ||
10913 | // headers. This can happen if you create metadata using an API like SOAP that | ||
10914 | // supports more flexible metadata than the REST API. For example, using SOAP, | ||
10915 | // you can create metadata whose values are not legal HTTP headers. | ||
10916 | MissingMeta *int64 `location:"header" locationName:"x-amz-missing-meta" type:"integer"` | ||
10917 | |||
10918 | // The count of parts this object has. | ||
10919 | PartsCount *int64 `location:"header" locationName:"x-amz-mp-parts-count" type:"integer"` | ||
10920 | |||
10921 | ReplicationStatus *string `location:"header" locationName:"x-amz-replication-status" type:"string" enum:"ReplicationStatus"` | ||
10922 | |||
10923 | // If present, indicates that the requester was successfully charged for the | ||
10924 | // request. | ||
10925 | RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` | ||
10926 | |||
10927 | // Provides information about object restoration operation and expiration time | ||
10928 | // of the restored object copy. | ||
10929 | Restore *string `location:"header" locationName:"x-amz-restore" type:"string"` | ||
10930 | |||
10931 | // If server-side encryption with a customer-provided encryption key was requested, | ||
10932 | // the response will include this header confirming the encryption algorithm | ||
10933 | // used. | ||
10934 | SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` | ||
10935 | |||
10936 | // If server-side encryption with a customer-provided encryption key was requested, | ||
10937 | // the response will include this header to provide round trip message integrity | ||
10938 | // verification of the customer-provided encryption key. | ||
10939 | SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` | ||
10940 | |||
10941 | // If present, specifies the ID of the AWS Key Management Service (KMS) master | ||
10942 | // encryption key that was used for the object. | ||
10943 | SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string"` | ||
10944 | |||
10945 | // The Server-side encryption algorithm used when storing this object in S3 | ||
10946 | // (e.g., AES256, aws:kms). | ||
10947 | ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` | ||
10948 | |||
10949 | StorageClass *string `location:"header" locationName:"x-amz-storage-class" type:"string" enum:"StorageClass"` | ||
10950 | |||
10951 | // The number of tags, if any, on the object. | ||
10952 | TagCount *int64 `location:"header" locationName:"x-amz-tagging-count" type:"integer"` | ||
10953 | |||
10954 | // Version of the object. | ||
10955 | VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` | ||
10956 | |||
10957 | // If the bucket is configured as a website, redirects requests for this object | ||
10958 | // to another object in the same bucket or to an external URL. Amazon S3 stores | ||
10959 | // the value of this header in the object metadata. | ||
10960 | WebsiteRedirectLocation *string `location:"header" locationName:"x-amz-website-redirect-location" type:"string"` | ||
10961 | } | ||
10962 | |||
10963 | // String returns the string representation | ||
10964 | func (s GetObjectOutput) String() string { | ||
10965 | return awsutil.Prettify(s) | ||
10966 | } | ||
10967 | |||
10968 | // GoString returns the string representation | ||
10969 | func (s GetObjectOutput) GoString() string { | ||
10970 | return s.String() | ||
10971 | } | ||
10972 | |||
10973 | // SetAcceptRanges sets the AcceptRanges field's value. | ||
10974 | func (s *GetObjectOutput) SetAcceptRanges(v string) *GetObjectOutput { | ||
10975 | s.AcceptRanges = &v | ||
10976 | return s | ||
10977 | } | ||
10978 | |||
10979 | // SetBody sets the Body field's value. | ||
10980 | func (s *GetObjectOutput) SetBody(v io.ReadCloser) *GetObjectOutput { | ||
10981 | s.Body = v | ||
10982 | return s | ||
10983 | } | ||
10984 | |||
10985 | // SetCacheControl sets the CacheControl field's value. | ||
10986 | func (s *GetObjectOutput) SetCacheControl(v string) *GetObjectOutput { | ||
10987 | s.CacheControl = &v | ||
10988 | return s | ||
10989 | } | ||
10990 | |||
10991 | // SetContentDisposition sets the ContentDisposition field's value. | ||
10992 | func (s *GetObjectOutput) SetContentDisposition(v string) *GetObjectOutput { | ||
10993 | s.ContentDisposition = &v | ||
10994 | return s | ||
10995 | } | ||
10996 | |||
10997 | // SetContentEncoding sets the ContentEncoding field's value. | ||
10998 | func (s *GetObjectOutput) SetContentEncoding(v string) *GetObjectOutput { | ||
10999 | s.ContentEncoding = &v | ||
11000 | return s | ||
11001 | } | ||
11002 | |||
11003 | // SetContentLanguage sets the ContentLanguage field's value. | ||
11004 | func (s *GetObjectOutput) SetContentLanguage(v string) *GetObjectOutput { | ||
11005 | s.ContentLanguage = &v | ||
11006 | return s | ||
11007 | } | ||
11008 | |||
11009 | // SetContentLength sets the ContentLength field's value. | ||
11010 | func (s *GetObjectOutput) SetContentLength(v int64) *GetObjectOutput { | ||
11011 | s.ContentLength = &v | ||
11012 | return s | ||
11013 | } | ||
11014 | |||
11015 | // SetContentRange sets the ContentRange field's value. | ||
11016 | func (s *GetObjectOutput) SetContentRange(v string) *GetObjectOutput { | ||
11017 | s.ContentRange = &v | ||
11018 | return s | ||
11019 | } | ||
11020 | |||
11021 | // SetContentType sets the ContentType field's value. | ||
11022 | func (s *GetObjectOutput) SetContentType(v string) *GetObjectOutput { | ||
11023 | s.ContentType = &v | ||
11024 | return s | ||
11025 | } | ||
11026 | |||
11027 | // SetDeleteMarker sets the DeleteMarker field's value. | ||
11028 | func (s *GetObjectOutput) SetDeleteMarker(v bool) *GetObjectOutput { | ||
11029 | s.DeleteMarker = &v | ||
11030 | return s | ||
11031 | } | ||
11032 | |||
11033 | // SetETag sets the ETag field's value. | ||
11034 | func (s *GetObjectOutput) SetETag(v string) *GetObjectOutput { | ||
11035 | s.ETag = &v | ||
11036 | return s | ||
11037 | } | ||
11038 | |||
11039 | // SetExpiration sets the Expiration field's value. | ||
11040 | func (s *GetObjectOutput) SetExpiration(v string) *GetObjectOutput { | ||
11041 | s.Expiration = &v | ||
11042 | return s | ||
11043 | } | ||
11044 | |||
11045 | // SetExpires sets the Expires field's value. | ||
11046 | func (s *GetObjectOutput) SetExpires(v string) *GetObjectOutput { | ||
11047 | s.Expires = &v | ||
11048 | return s | ||
11049 | } | ||
11050 | |||
11051 | // SetLastModified sets the LastModified field's value. | ||
11052 | func (s *GetObjectOutput) SetLastModified(v time.Time) *GetObjectOutput { | ||
11053 | s.LastModified = &v | ||
11054 | return s | ||
11055 | } | ||
11056 | |||
11057 | // SetMetadata sets the Metadata field's value. | ||
11058 | func (s *GetObjectOutput) SetMetadata(v map[string]*string) *GetObjectOutput { | ||
11059 | s.Metadata = v | ||
11060 | return s | ||
11061 | } | ||
11062 | |||
11063 | // SetMissingMeta sets the MissingMeta field's value. | ||
11064 | func (s *GetObjectOutput) SetMissingMeta(v int64) *GetObjectOutput { | ||
11065 | s.MissingMeta = &v | ||
11066 | return s | ||
11067 | } | ||
11068 | |||
11069 | // SetPartsCount sets the PartsCount field's value. | ||
11070 | func (s *GetObjectOutput) SetPartsCount(v int64) *GetObjectOutput { | ||
11071 | s.PartsCount = &v | ||
11072 | return s | ||
11073 | } | ||
11074 | |||
11075 | // SetReplicationStatus sets the ReplicationStatus field's value. | ||
11076 | func (s *GetObjectOutput) SetReplicationStatus(v string) *GetObjectOutput { | ||
11077 | s.ReplicationStatus = &v | ||
11078 | return s | ||
11079 | } | ||
11080 | |||
11081 | // SetRequestCharged sets the RequestCharged field's value. | ||
11082 | func (s *GetObjectOutput) SetRequestCharged(v string) *GetObjectOutput { | ||
11083 | s.RequestCharged = &v | ||
11084 | return s | ||
11085 | } | ||
11086 | |||
11087 | // SetRestore sets the Restore field's value. | ||
11088 | func (s *GetObjectOutput) SetRestore(v string) *GetObjectOutput { | ||
11089 | s.Restore = &v | ||
11090 | return s | ||
11091 | } | ||
11092 | |||
11093 | // SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. | ||
11094 | func (s *GetObjectOutput) SetSSECustomerAlgorithm(v string) *GetObjectOutput { | ||
11095 | s.SSECustomerAlgorithm = &v | ||
11096 | return s | ||
11097 | } | ||
11098 | |||
11099 | // SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. | ||
11100 | func (s *GetObjectOutput) SetSSECustomerKeyMD5(v string) *GetObjectOutput { | ||
11101 | s.SSECustomerKeyMD5 = &v | ||
11102 | return s | ||
11103 | } | ||
11104 | |||
11105 | // SetSSEKMSKeyId sets the SSEKMSKeyId field's value. | ||
11106 | func (s *GetObjectOutput) SetSSEKMSKeyId(v string) *GetObjectOutput { | ||
11107 | s.SSEKMSKeyId = &v | ||
11108 | return s | ||
11109 | } | ||
11110 | |||
11111 | // SetServerSideEncryption sets the ServerSideEncryption field's value. | ||
11112 | func (s *GetObjectOutput) SetServerSideEncryption(v string) *GetObjectOutput { | ||
11113 | s.ServerSideEncryption = &v | ||
11114 | return s | ||
11115 | } | ||
11116 | |||
11117 | // SetStorageClass sets the StorageClass field's value. | ||
11118 | func (s *GetObjectOutput) SetStorageClass(v string) *GetObjectOutput { | ||
11119 | s.StorageClass = &v | ||
11120 | return s | ||
11121 | } | ||
11122 | |||
11123 | // SetTagCount sets the TagCount field's value. | ||
11124 | func (s *GetObjectOutput) SetTagCount(v int64) *GetObjectOutput { | ||
11125 | s.TagCount = &v | ||
11126 | return s | ||
11127 | } | ||
11128 | |||
11129 | // SetVersionId sets the VersionId field's value. | ||
11130 | func (s *GetObjectOutput) SetVersionId(v string) *GetObjectOutput { | ||
11131 | s.VersionId = &v | ||
11132 | return s | ||
11133 | } | ||
11134 | |||
11135 | // SetWebsiteRedirectLocation sets the WebsiteRedirectLocation field's value. | ||
11136 | func (s *GetObjectOutput) SetWebsiteRedirectLocation(v string) *GetObjectOutput { | ||
11137 | s.WebsiteRedirectLocation = &v | ||
11138 | return s | ||
11139 | } | ||
11140 | |||
11141 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectTaggingRequest | ||
11142 | type GetObjectTaggingInput struct { | ||
11143 | _ struct{} `type:"structure"` | ||
11144 | |||
11145 | // Bucket is a required field | ||
11146 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
11147 | |||
11148 | // Key is a required field | ||
11149 | Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` | ||
11150 | |||
11151 | VersionId *string `location:"querystring" locationName:"versionId" type:"string"` | ||
11152 | } | ||
11153 | |||
11154 | // String returns the string representation | ||
11155 | func (s GetObjectTaggingInput) String() string { | ||
11156 | return awsutil.Prettify(s) | ||
11157 | } | ||
11158 | |||
11159 | // GoString returns the string representation | ||
11160 | func (s GetObjectTaggingInput) GoString() string { | ||
11161 | return s.String() | ||
11162 | } | ||
11163 | |||
11164 | // Validate inspects the fields of the type to determine if they are valid. | ||
11165 | func (s *GetObjectTaggingInput) Validate() error { | ||
11166 | invalidParams := request.ErrInvalidParams{Context: "GetObjectTaggingInput"} | ||
11167 | if s.Bucket == nil { | ||
11168 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
11169 | } | ||
11170 | if s.Key == nil { | ||
11171 | invalidParams.Add(request.NewErrParamRequired("Key")) | ||
11172 | } | ||
11173 | if s.Key != nil && len(*s.Key) < 1 { | ||
11174 | invalidParams.Add(request.NewErrParamMinLen("Key", 1)) | ||
11175 | } | ||
11176 | |||
11177 | if invalidParams.Len() > 0 { | ||
11178 | return invalidParams | ||
11179 | } | ||
11180 | return nil | ||
11181 | } | ||
11182 | |||
11183 | // SetBucket sets the Bucket field's value. | ||
11184 | func (s *GetObjectTaggingInput) SetBucket(v string) *GetObjectTaggingInput { | ||
11185 | s.Bucket = &v | ||
11186 | return s | ||
11187 | } | ||
11188 | |||
11189 | // SetKey sets the Key field's value. | ||
11190 | func (s *GetObjectTaggingInput) SetKey(v string) *GetObjectTaggingInput { | ||
11191 | s.Key = &v | ||
11192 | return s | ||
11193 | } | ||
11194 | |||
11195 | // SetVersionId sets the VersionId field's value. | ||
11196 | func (s *GetObjectTaggingInput) SetVersionId(v string) *GetObjectTaggingInput { | ||
11197 | s.VersionId = &v | ||
11198 | return s | ||
11199 | } | ||
11200 | |||
11201 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectTaggingOutput | ||
11202 | type GetObjectTaggingOutput struct { | ||
11203 | _ struct{} `type:"structure"` | ||
11204 | |||
11205 | // TagSet is a required field | ||
11206 | TagSet []*Tag `locationNameList:"Tag" type:"list" required:"true"` | ||
11207 | |||
11208 | VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` | ||
11209 | } | ||
11210 | |||
11211 | // String returns the string representation | ||
11212 | func (s GetObjectTaggingOutput) String() string { | ||
11213 | return awsutil.Prettify(s) | ||
11214 | } | ||
11215 | |||
11216 | // GoString returns the string representation | ||
11217 | func (s GetObjectTaggingOutput) GoString() string { | ||
11218 | return s.String() | ||
11219 | } | ||
11220 | |||
11221 | // SetTagSet sets the TagSet field's value. | ||
11222 | func (s *GetObjectTaggingOutput) SetTagSet(v []*Tag) *GetObjectTaggingOutput { | ||
11223 | s.TagSet = v | ||
11224 | return s | ||
11225 | } | ||
11226 | |||
11227 | // SetVersionId sets the VersionId field's value. | ||
11228 | func (s *GetObjectTaggingOutput) SetVersionId(v string) *GetObjectTaggingOutput { | ||
11229 | s.VersionId = &v | ||
11230 | return s | ||
11231 | } | ||
11232 | |||
11233 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectTorrentRequest | ||
11234 | type GetObjectTorrentInput struct { | ||
11235 | _ struct{} `type:"structure"` | ||
11236 | |||
11237 | // Bucket is a required field | ||
11238 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
11239 | |||
11240 | // Key is a required field | ||
11241 | Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` | ||
11242 | |||
11243 | // Confirms that the requester knows that she or he will be charged for the | ||
11244 | // request. Bucket owners need not specify this parameter in their requests. | ||
11245 | // Documentation on downloading objects from requester pays buckets can be found | ||
11246 | // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html | ||
11247 | RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` | ||
11248 | } | ||
11249 | |||
11250 | // String returns the string representation | ||
11251 | func (s GetObjectTorrentInput) String() string { | ||
11252 | return awsutil.Prettify(s) | ||
11253 | } | ||
11254 | |||
11255 | // GoString returns the string representation | ||
11256 | func (s GetObjectTorrentInput) GoString() string { | ||
11257 | return s.String() | ||
11258 | } | ||
11259 | |||
11260 | // Validate inspects the fields of the type to determine if they are valid. | ||
11261 | func (s *GetObjectTorrentInput) Validate() error { | ||
11262 | invalidParams := request.ErrInvalidParams{Context: "GetObjectTorrentInput"} | ||
11263 | if s.Bucket == nil { | ||
11264 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
11265 | } | ||
11266 | if s.Key == nil { | ||
11267 | invalidParams.Add(request.NewErrParamRequired("Key")) | ||
11268 | } | ||
11269 | if s.Key != nil && len(*s.Key) < 1 { | ||
11270 | invalidParams.Add(request.NewErrParamMinLen("Key", 1)) | ||
11271 | } | ||
11272 | |||
11273 | if invalidParams.Len() > 0 { | ||
11274 | return invalidParams | ||
11275 | } | ||
11276 | return nil | ||
11277 | } | ||
11278 | |||
11279 | // SetBucket sets the Bucket field's value. | ||
11280 | func (s *GetObjectTorrentInput) SetBucket(v string) *GetObjectTorrentInput { | ||
11281 | s.Bucket = &v | ||
11282 | return s | ||
11283 | } | ||
11284 | |||
11285 | // SetKey sets the Key field's value. | ||
11286 | func (s *GetObjectTorrentInput) SetKey(v string) *GetObjectTorrentInput { | ||
11287 | s.Key = &v | ||
11288 | return s | ||
11289 | } | ||
11290 | |||
11291 | // SetRequestPayer sets the RequestPayer field's value. | ||
11292 | func (s *GetObjectTorrentInput) SetRequestPayer(v string) *GetObjectTorrentInput { | ||
11293 | s.RequestPayer = &v | ||
11294 | return s | ||
11295 | } | ||
11296 | |||
11297 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectTorrentOutput | ||
11298 | type GetObjectTorrentOutput struct { | ||
11299 | _ struct{} `type:"structure" payload:"Body"` | ||
11300 | |||
11301 | Body io.ReadCloser `type:"blob"` | ||
11302 | |||
11303 | // If present, indicates that the requester was successfully charged for the | ||
11304 | // request. | ||
11305 | RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` | ||
11306 | } | ||
11307 | |||
11308 | // String returns the string representation | ||
11309 | func (s GetObjectTorrentOutput) String() string { | ||
11310 | return awsutil.Prettify(s) | ||
11311 | } | ||
11312 | |||
11313 | // GoString returns the string representation | ||
11314 | func (s GetObjectTorrentOutput) GoString() string { | ||
11315 | return s.String() | ||
11316 | } | ||
11317 | |||
11318 | // SetBody sets the Body field's value. | ||
11319 | func (s *GetObjectTorrentOutput) SetBody(v io.ReadCloser) *GetObjectTorrentOutput { | ||
11320 | s.Body = v | ||
11321 | return s | ||
11322 | } | ||
11323 | |||
11324 | // SetRequestCharged sets the RequestCharged field's value. | ||
11325 | func (s *GetObjectTorrentOutput) SetRequestCharged(v string) *GetObjectTorrentOutput { | ||
11326 | s.RequestCharged = &v | ||
11327 | return s | ||
11328 | } | ||
11329 | |||
11330 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GlacierJobParameters | ||
11331 | type GlacierJobParameters struct { | ||
11332 | _ struct{} `type:"structure"` | ||
11333 | |||
11334 | // Glacier retrieval tier at which the restore will be processed. | ||
11335 | // | ||
11336 | // Tier is a required field | ||
11337 | Tier *string `type:"string" required:"true" enum:"Tier"` | ||
11338 | } | ||
11339 | |||
11340 | // String returns the string representation | ||
11341 | func (s GlacierJobParameters) String() string { | ||
11342 | return awsutil.Prettify(s) | ||
11343 | } | ||
11344 | |||
11345 | // GoString returns the string representation | ||
11346 | func (s GlacierJobParameters) GoString() string { | ||
11347 | return s.String() | ||
11348 | } | ||
11349 | |||
11350 | // Validate inspects the fields of the type to determine if they are valid. | ||
11351 | func (s *GlacierJobParameters) Validate() error { | ||
11352 | invalidParams := request.ErrInvalidParams{Context: "GlacierJobParameters"} | ||
11353 | if s.Tier == nil { | ||
11354 | invalidParams.Add(request.NewErrParamRequired("Tier")) | ||
11355 | } | ||
11356 | |||
11357 | if invalidParams.Len() > 0 { | ||
11358 | return invalidParams | ||
11359 | } | ||
11360 | return nil | ||
11361 | } | ||
11362 | |||
11363 | // SetTier sets the Tier field's value. | ||
11364 | func (s *GlacierJobParameters) SetTier(v string) *GlacierJobParameters { | ||
11365 | s.Tier = &v | ||
11366 | return s | ||
11367 | } | ||
11368 | |||
11369 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Grant | ||
11370 | type Grant struct { | ||
11371 | _ struct{} `type:"structure"` | ||
11372 | |||
11373 | Grantee *Grantee `type:"structure"` | ||
11374 | |||
11375 | // Specifies the permission given to the grantee. | ||
11376 | Permission *string `type:"string" enum:"Permission"` | ||
11377 | } | ||
11378 | |||
11379 | // String returns the string representation | ||
11380 | func (s Grant) String() string { | ||
11381 | return awsutil.Prettify(s) | ||
11382 | } | ||
11383 | |||
11384 | // GoString returns the string representation | ||
11385 | func (s Grant) GoString() string { | ||
11386 | return s.String() | ||
11387 | } | ||
11388 | |||
11389 | // Validate inspects the fields of the type to determine if they are valid. | ||
11390 | func (s *Grant) Validate() error { | ||
11391 | invalidParams := request.ErrInvalidParams{Context: "Grant"} | ||
11392 | if s.Grantee != nil { | ||
11393 | if err := s.Grantee.Validate(); err != nil { | ||
11394 | invalidParams.AddNested("Grantee", err.(request.ErrInvalidParams)) | ||
11395 | } | ||
11396 | } | ||
11397 | |||
11398 | if invalidParams.Len() > 0 { | ||
11399 | return invalidParams | ||
11400 | } | ||
11401 | return nil | ||
11402 | } | ||
11403 | |||
11404 | // SetGrantee sets the Grantee field's value. | ||
11405 | func (s *Grant) SetGrantee(v *Grantee) *Grant { | ||
11406 | s.Grantee = v | ||
11407 | return s | ||
11408 | } | ||
11409 | |||
11410 | // SetPermission sets the Permission field's value. | ||
11411 | func (s *Grant) SetPermission(v string) *Grant { | ||
11412 | s.Permission = &v | ||
11413 | return s | ||
11414 | } | ||
11415 | |||
11416 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Grantee | ||
11417 | type Grantee struct { | ||
11418 | _ struct{} `type:"structure" xmlPrefix:"xsi" xmlURI:"http://www.w3.org/2001/XMLSchema-instance"` | ||
11419 | |||
11420 | // Screen name of the grantee. | ||
11421 | DisplayName *string `type:"string"` | ||
11422 | |||
11423 | // Email address of the grantee. | ||
11424 | EmailAddress *string `type:"string"` | ||
11425 | |||
11426 | // The canonical user ID of the grantee. | ||
11427 | ID *string `type:"string"` | ||
11428 | |||
11429 | // Type of grantee | ||
11430 | // | ||
11431 | // Type is a required field | ||
11432 | Type *string `locationName:"xsi:type" type:"string" xmlAttribute:"true" required:"true" enum:"Type"` | ||
11433 | |||
11434 | // URI of the grantee group. | ||
11435 | URI *string `type:"string"` | ||
11436 | } | ||
11437 | |||
11438 | // String returns the string representation | ||
11439 | func (s Grantee) String() string { | ||
11440 | return awsutil.Prettify(s) | ||
11441 | } | ||
11442 | |||
11443 | // GoString returns the string representation | ||
11444 | func (s Grantee) GoString() string { | ||
11445 | return s.String() | ||
11446 | } | ||
11447 | |||
11448 | // Validate inspects the fields of the type to determine if they are valid. | ||
11449 | func (s *Grantee) Validate() error { | ||
11450 | invalidParams := request.ErrInvalidParams{Context: "Grantee"} | ||
11451 | if s.Type == nil { | ||
11452 | invalidParams.Add(request.NewErrParamRequired("Type")) | ||
11453 | } | ||
11454 | |||
11455 | if invalidParams.Len() > 0 { | ||
11456 | return invalidParams | ||
11457 | } | ||
11458 | return nil | ||
11459 | } | ||
11460 | |||
11461 | // SetDisplayName sets the DisplayName field's value. | ||
11462 | func (s *Grantee) SetDisplayName(v string) *Grantee { | ||
11463 | s.DisplayName = &v | ||
11464 | return s | ||
11465 | } | ||
11466 | |||
11467 | // SetEmailAddress sets the EmailAddress field's value. | ||
11468 | func (s *Grantee) SetEmailAddress(v string) *Grantee { | ||
11469 | s.EmailAddress = &v | ||
11470 | return s | ||
11471 | } | ||
11472 | |||
11473 | // SetID sets the ID field's value. | ||
11474 | func (s *Grantee) SetID(v string) *Grantee { | ||
11475 | s.ID = &v | ||
11476 | return s | ||
11477 | } | ||
11478 | |||
11479 | // SetType sets the Type field's value. | ||
11480 | func (s *Grantee) SetType(v string) *Grantee { | ||
11481 | s.Type = &v | ||
11482 | return s | ||
11483 | } | ||
11484 | |||
11485 | // SetURI sets the URI field's value. | ||
11486 | func (s *Grantee) SetURI(v string) *Grantee { | ||
11487 | s.URI = &v | ||
11488 | return s | ||
11489 | } | ||
11490 | |||
11491 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/HeadBucketRequest | ||
11492 | type HeadBucketInput struct { | ||
11493 | _ struct{} `type:"structure"` | ||
11494 | |||
11495 | // Bucket is a required field | ||
11496 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
11497 | } | ||
11498 | |||
11499 | // String returns the string representation | ||
11500 | func (s HeadBucketInput) String() string { | ||
11501 | return awsutil.Prettify(s) | ||
11502 | } | ||
11503 | |||
11504 | // GoString returns the string representation | ||
11505 | func (s HeadBucketInput) GoString() string { | ||
11506 | return s.String() | ||
11507 | } | ||
11508 | |||
11509 | // Validate inspects the fields of the type to determine if they are valid. | ||
11510 | func (s *HeadBucketInput) Validate() error { | ||
11511 | invalidParams := request.ErrInvalidParams{Context: "HeadBucketInput"} | ||
11512 | if s.Bucket == nil { | ||
11513 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
11514 | } | ||
11515 | |||
11516 | if invalidParams.Len() > 0 { | ||
11517 | return invalidParams | ||
11518 | } | ||
11519 | return nil | ||
11520 | } | ||
11521 | |||
11522 | // SetBucket sets the Bucket field's value. | ||
11523 | func (s *HeadBucketInput) SetBucket(v string) *HeadBucketInput { | ||
11524 | s.Bucket = &v | ||
11525 | return s | ||
11526 | } | ||
11527 | |||
11528 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/HeadBucketOutput | ||
11529 | type HeadBucketOutput struct { | ||
11530 | _ struct{} `type:"structure"` | ||
11531 | } | ||
11532 | |||
11533 | // String returns the string representation | ||
11534 | func (s HeadBucketOutput) String() string { | ||
11535 | return awsutil.Prettify(s) | ||
11536 | } | ||
11537 | |||
11538 | // GoString returns the string representation | ||
11539 | func (s HeadBucketOutput) GoString() string { | ||
11540 | return s.String() | ||
11541 | } | ||
11542 | |||
11543 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/HeadObjectRequest | ||
11544 | type HeadObjectInput struct { | ||
11545 | _ struct{} `type:"structure"` | ||
11546 | |||
11547 | // Bucket is a required field | ||
11548 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
11549 | |||
11550 | // Return the object only if its entity tag (ETag) is the same as the one specified, | ||
11551 | // otherwise return a 412 (precondition failed). | ||
11552 | IfMatch *string `location:"header" locationName:"If-Match" type:"string"` | ||
11553 | |||
11554 | // Return the object only if it has been modified since the specified time, | ||
11555 | // otherwise return a 304 (not modified). | ||
11556 | IfModifiedSince *time.Time `location:"header" locationName:"If-Modified-Since" type:"timestamp" timestampFormat:"rfc822"` | ||
11557 | |||
11558 | // Return the object only if its entity tag (ETag) is different from the one | ||
11559 | // specified, otherwise return a 304 (not modified). | ||
11560 | IfNoneMatch *string `location:"header" locationName:"If-None-Match" type:"string"` | ||
11561 | |||
11562 | // Return the object only if it has not been modified since the specified time, | ||
11563 | // otherwise return a 412 (precondition failed). | ||
11564 | IfUnmodifiedSince *time.Time `location:"header" locationName:"If-Unmodified-Since" type:"timestamp" timestampFormat:"rfc822"` | ||
11565 | |||
11566 | // Key is a required field | ||
11567 | Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` | ||
11568 | |||
11569 | // Part number of the object being read. This is a positive integer between | ||
11570 | // 1 and 10,000. Effectively performs a 'ranged' HEAD request for the part specified. | ||
11571 | // Useful querying about the size of the part and the number of parts in this | ||
11572 | // object. | ||
11573 | PartNumber *int64 `location:"querystring" locationName:"partNumber" type:"integer"` | ||
11574 | |||
11575 | // Downloads the specified range bytes of an object. For more information about | ||
11576 | // the HTTP Range header, go to http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35. | ||
11577 | Range *string `location:"header" locationName:"Range" type:"string"` | ||
11578 | |||
11579 | // Confirms that the requester knows that she or he will be charged for the | ||
11580 | // request. Bucket owners need not specify this parameter in their requests. | ||
11581 | // Documentation on downloading objects from requester pays buckets can be found | ||
11582 | // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html | ||
11583 | RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` | ||
11584 | |||
11585 | // Specifies the algorithm to use to when encrypting the object (e.g., AES256). | ||
11586 | SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` | ||
11587 | |||
11588 | // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting | ||
11589 | // data. This value is used to store the object and then it is discarded; Amazon | ||
11590 | // does not store the encryption key. The key must be appropriate for use with | ||
11591 | // the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm | ||
11592 | // header. | ||
11593 | SSECustomerKey *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string"` | ||
11594 | |||
11595 | // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. | ||
11596 | // Amazon S3 uses this header for a message integrity check to ensure the encryption | ||
11597 | // key was transmitted without error. | ||
11598 | SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` | ||
11599 | |||
11600 | // VersionId used to reference a specific version of the object. | ||
11601 | VersionId *string `location:"querystring" locationName:"versionId" type:"string"` | ||
11602 | } | ||
11603 | |||
11604 | // String returns the string representation | ||
11605 | func (s HeadObjectInput) String() string { | ||
11606 | return awsutil.Prettify(s) | ||
11607 | } | ||
11608 | |||
11609 | // GoString returns the string representation | ||
11610 | func (s HeadObjectInput) GoString() string { | ||
11611 | return s.String() | ||
11612 | } | ||
11613 | |||
11614 | // Validate inspects the fields of the type to determine if they are valid. | ||
11615 | func (s *HeadObjectInput) Validate() error { | ||
11616 | invalidParams := request.ErrInvalidParams{Context: "HeadObjectInput"} | ||
11617 | if s.Bucket == nil { | ||
11618 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
11619 | } | ||
11620 | if s.Key == nil { | ||
11621 | invalidParams.Add(request.NewErrParamRequired("Key")) | ||
11622 | } | ||
11623 | if s.Key != nil && len(*s.Key) < 1 { | ||
11624 | invalidParams.Add(request.NewErrParamMinLen("Key", 1)) | ||
11625 | } | ||
11626 | |||
11627 | if invalidParams.Len() > 0 { | ||
11628 | return invalidParams | ||
11629 | } | ||
11630 | return nil | ||
11631 | } | ||
11632 | |||
11633 | // SetBucket sets the Bucket field's value. | ||
11634 | func (s *HeadObjectInput) SetBucket(v string) *HeadObjectInput { | ||
11635 | s.Bucket = &v | ||
11636 | return s | ||
11637 | } | ||
11638 | |||
11639 | // SetIfMatch sets the IfMatch field's value. | ||
11640 | func (s *HeadObjectInput) SetIfMatch(v string) *HeadObjectInput { | ||
11641 | s.IfMatch = &v | ||
11642 | return s | ||
11643 | } | ||
11644 | |||
11645 | // SetIfModifiedSince sets the IfModifiedSince field's value. | ||
11646 | func (s *HeadObjectInput) SetIfModifiedSince(v time.Time) *HeadObjectInput { | ||
11647 | s.IfModifiedSince = &v | ||
11648 | return s | ||
11649 | } | ||
11650 | |||
11651 | // SetIfNoneMatch sets the IfNoneMatch field's value. | ||
11652 | func (s *HeadObjectInput) SetIfNoneMatch(v string) *HeadObjectInput { | ||
11653 | s.IfNoneMatch = &v | ||
11654 | return s | ||
11655 | } | ||
11656 | |||
11657 | // SetIfUnmodifiedSince sets the IfUnmodifiedSince field's value. | ||
11658 | func (s *HeadObjectInput) SetIfUnmodifiedSince(v time.Time) *HeadObjectInput { | ||
11659 | s.IfUnmodifiedSince = &v | ||
11660 | return s | ||
11661 | } | ||
11662 | |||
11663 | // SetKey sets the Key field's value. | ||
11664 | func (s *HeadObjectInput) SetKey(v string) *HeadObjectInput { | ||
11665 | s.Key = &v | ||
11666 | return s | ||
11667 | } | ||
11668 | |||
11669 | // SetPartNumber sets the PartNumber field's value. | ||
11670 | func (s *HeadObjectInput) SetPartNumber(v int64) *HeadObjectInput { | ||
11671 | s.PartNumber = &v | ||
11672 | return s | ||
11673 | } | ||
11674 | |||
11675 | // SetRange sets the Range field's value. | ||
11676 | func (s *HeadObjectInput) SetRange(v string) *HeadObjectInput { | ||
11677 | s.Range = &v | ||
11678 | return s | ||
11679 | } | ||
11680 | |||
11681 | // SetRequestPayer sets the RequestPayer field's value. | ||
11682 | func (s *HeadObjectInput) SetRequestPayer(v string) *HeadObjectInput { | ||
11683 | s.RequestPayer = &v | ||
11684 | return s | ||
11685 | } | ||
11686 | |||
11687 | // SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. | ||
11688 | func (s *HeadObjectInput) SetSSECustomerAlgorithm(v string) *HeadObjectInput { | ||
11689 | s.SSECustomerAlgorithm = &v | ||
11690 | return s | ||
11691 | } | ||
11692 | |||
11693 | // SetSSECustomerKey sets the SSECustomerKey field's value. | ||
11694 | func (s *HeadObjectInput) SetSSECustomerKey(v string) *HeadObjectInput { | ||
11695 | s.SSECustomerKey = &v | ||
11696 | return s | ||
11697 | } | ||
11698 | |||
11699 | // SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. | ||
11700 | func (s *HeadObjectInput) SetSSECustomerKeyMD5(v string) *HeadObjectInput { | ||
11701 | s.SSECustomerKeyMD5 = &v | ||
11702 | return s | ||
11703 | } | ||
11704 | |||
11705 | // SetVersionId sets the VersionId field's value. | ||
11706 | func (s *HeadObjectInput) SetVersionId(v string) *HeadObjectInput { | ||
11707 | s.VersionId = &v | ||
11708 | return s | ||
11709 | } | ||
11710 | |||
11711 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/HeadObjectOutput | ||
11712 | type HeadObjectOutput struct { | ||
11713 | _ struct{} `type:"structure"` | ||
11714 | |||
11715 | AcceptRanges *string `location:"header" locationName:"accept-ranges" type:"string"` | ||
11716 | |||
11717 | // Specifies caching behavior along the request/reply chain. | ||
11718 | CacheControl *string `location:"header" locationName:"Cache-Control" type:"string"` | ||
11719 | |||
11720 | // Specifies presentational information for the object. | ||
11721 | ContentDisposition *string `location:"header" locationName:"Content-Disposition" type:"string"` | ||
11722 | |||
11723 | // Specifies what content encodings have been applied to the object and thus | ||
11724 | // what decoding mechanisms must be applied to obtain the media-type referenced | ||
11725 | // by the Content-Type header field. | ||
11726 | ContentEncoding *string `location:"header" locationName:"Content-Encoding" type:"string"` | ||
11727 | |||
11728 | // The language the content is in. | ||
11729 | ContentLanguage *string `location:"header" locationName:"Content-Language" type:"string"` | ||
11730 | |||
11731 | // Size of the body in bytes. | ||
11732 | ContentLength *int64 `location:"header" locationName:"Content-Length" type:"long"` | ||
11733 | |||
11734 | // A standard MIME type describing the format of the object data. | ||
11735 | ContentType *string `location:"header" locationName:"Content-Type" type:"string"` | ||
11736 | |||
11737 | // Specifies whether the object retrieved was (true) or was not (false) a Delete | ||
11738 | // Marker. If false, this response header does not appear in the response. | ||
11739 | DeleteMarker *bool `location:"header" locationName:"x-amz-delete-marker" type:"boolean"` | ||
11740 | |||
11741 | // An ETag is an opaque identifier assigned by a web server to a specific version | ||
11742 | // of a resource found at a URL | ||
11743 | ETag *string `location:"header" locationName:"ETag" type:"string"` | ||
11744 | |||
11745 | // If the object expiration is configured (see PUT Bucket lifecycle), the response | ||
11746 | // includes this header. It includes the expiry-date and rule-id key value pairs | ||
11747 | // providing object expiration information. The value of the rule-id is URL | ||
11748 | // encoded. | ||
11749 | Expiration *string `location:"header" locationName:"x-amz-expiration" type:"string"` | ||
11750 | |||
11751 | // The date and time at which the object is no longer cacheable. | ||
11752 | Expires *string `location:"header" locationName:"Expires" type:"string"` | ||
11753 | |||
11754 | // Last modified date of the object | ||
11755 | LastModified *time.Time `location:"header" locationName:"Last-Modified" type:"timestamp" timestampFormat:"rfc822"` | ||
11756 | |||
11757 | // A map of metadata to store with the object in S3. | ||
11758 | Metadata map[string]*string `location:"headers" locationName:"x-amz-meta-" type:"map"` | ||
11759 | |||
11760 | // This is set to the number of metadata entries not returned in x-amz-meta | ||
11761 | // headers. This can happen if you create metadata using an API like SOAP that | ||
11762 | // supports more flexible metadata than the REST API. For example, using SOAP, | ||
11763 | // you can create metadata whose values are not legal HTTP headers. | ||
11764 | MissingMeta *int64 `location:"header" locationName:"x-amz-missing-meta" type:"integer"` | ||
11765 | |||
11766 | // The count of parts this object has. | ||
11767 | PartsCount *int64 `location:"header" locationName:"x-amz-mp-parts-count" type:"integer"` | ||
11768 | |||
11769 | ReplicationStatus *string `location:"header" locationName:"x-amz-replication-status" type:"string" enum:"ReplicationStatus"` | ||
11770 | |||
11771 | // If present, indicates that the requester was successfully charged for the | ||
11772 | // request. | ||
11773 | RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` | ||
11774 | |||
11775 | // Provides information about object restoration operation and expiration time | ||
11776 | // of the restored object copy. | ||
11777 | Restore *string `location:"header" locationName:"x-amz-restore" type:"string"` | ||
11778 | |||
11779 | // If server-side encryption with a customer-provided encryption key was requested, | ||
11780 | // the response will include this header confirming the encryption algorithm | ||
11781 | // used. | ||
11782 | SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` | ||
11783 | |||
11784 | // If server-side encryption with a customer-provided encryption key was requested, | ||
11785 | // the response will include this header to provide round trip message integrity | ||
11786 | // verification of the customer-provided encryption key. | ||
11787 | SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` | ||
11788 | |||
11789 | // If present, specifies the ID of the AWS Key Management Service (KMS) master | ||
11790 | // encryption key that was used for the object. | ||
11791 | SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string"` | ||
11792 | |||
11793 | // The Server-side encryption algorithm used when storing this object in S3 | ||
11794 | // (e.g., AES256, aws:kms). | ||
11795 | ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` | ||
11796 | |||
11797 | StorageClass *string `location:"header" locationName:"x-amz-storage-class" type:"string" enum:"StorageClass"` | ||
11798 | |||
11799 | // Version of the object. | ||
11800 | VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` | ||
11801 | |||
11802 | // If the bucket is configured as a website, redirects requests for this object | ||
11803 | // to another object in the same bucket or to an external URL. Amazon S3 stores | ||
11804 | // the value of this header in the object metadata. | ||
11805 | WebsiteRedirectLocation *string `location:"header" locationName:"x-amz-website-redirect-location" type:"string"` | ||
11806 | } | ||
11807 | |||
11808 | // String returns the string representation | ||
11809 | func (s HeadObjectOutput) String() string { | ||
11810 | return awsutil.Prettify(s) | ||
11811 | } | ||
11812 | |||
11813 | // GoString returns the string representation | ||
11814 | func (s HeadObjectOutput) GoString() string { | ||
11815 | return s.String() | ||
11816 | } | ||
11817 | |||
11818 | // SetAcceptRanges sets the AcceptRanges field's value. | ||
11819 | func (s *HeadObjectOutput) SetAcceptRanges(v string) *HeadObjectOutput { | ||
11820 | s.AcceptRanges = &v | ||
11821 | return s | ||
11822 | } | ||
11823 | |||
11824 | // SetCacheControl sets the CacheControl field's value. | ||
11825 | func (s *HeadObjectOutput) SetCacheControl(v string) *HeadObjectOutput { | ||
11826 | s.CacheControl = &v | ||
11827 | return s | ||
11828 | } | ||
11829 | |||
11830 | // SetContentDisposition sets the ContentDisposition field's value. | ||
11831 | func (s *HeadObjectOutput) SetContentDisposition(v string) *HeadObjectOutput { | ||
11832 | s.ContentDisposition = &v | ||
11833 | return s | ||
11834 | } | ||
11835 | |||
11836 | // SetContentEncoding sets the ContentEncoding field's value. | ||
11837 | func (s *HeadObjectOutput) SetContentEncoding(v string) *HeadObjectOutput { | ||
11838 | s.ContentEncoding = &v | ||
11839 | return s | ||
11840 | } | ||
11841 | |||
11842 | // SetContentLanguage sets the ContentLanguage field's value. | ||
11843 | func (s *HeadObjectOutput) SetContentLanguage(v string) *HeadObjectOutput { | ||
11844 | s.ContentLanguage = &v | ||
11845 | return s | ||
11846 | } | ||
11847 | |||
11848 | // SetContentLength sets the ContentLength field's value. | ||
11849 | func (s *HeadObjectOutput) SetContentLength(v int64) *HeadObjectOutput { | ||
11850 | s.ContentLength = &v | ||
11851 | return s | ||
11852 | } | ||
11853 | |||
11854 | // SetContentType sets the ContentType field's value. | ||
11855 | func (s *HeadObjectOutput) SetContentType(v string) *HeadObjectOutput { | ||
11856 | s.ContentType = &v | ||
11857 | return s | ||
11858 | } | ||
11859 | |||
11860 | // SetDeleteMarker sets the DeleteMarker field's value. | ||
11861 | func (s *HeadObjectOutput) SetDeleteMarker(v bool) *HeadObjectOutput { | ||
11862 | s.DeleteMarker = &v | ||
11863 | return s | ||
11864 | } | ||
11865 | |||
11866 | // SetETag sets the ETag field's value. | ||
11867 | func (s *HeadObjectOutput) SetETag(v string) *HeadObjectOutput { | ||
11868 | s.ETag = &v | ||
11869 | return s | ||
11870 | } | ||
11871 | |||
11872 | // SetExpiration sets the Expiration field's value. | ||
11873 | func (s *HeadObjectOutput) SetExpiration(v string) *HeadObjectOutput { | ||
11874 | s.Expiration = &v | ||
11875 | return s | ||
11876 | } | ||
11877 | |||
11878 | // SetExpires sets the Expires field's value. | ||
11879 | func (s *HeadObjectOutput) SetExpires(v string) *HeadObjectOutput { | ||
11880 | s.Expires = &v | ||
11881 | return s | ||
11882 | } | ||
11883 | |||
11884 | // SetLastModified sets the LastModified field's value. | ||
11885 | func (s *HeadObjectOutput) SetLastModified(v time.Time) *HeadObjectOutput { | ||
11886 | s.LastModified = &v | ||
11887 | return s | ||
11888 | } | ||
11889 | |||
11890 | // SetMetadata sets the Metadata field's value. | ||
11891 | func (s *HeadObjectOutput) SetMetadata(v map[string]*string) *HeadObjectOutput { | ||
11892 | s.Metadata = v | ||
11893 | return s | ||
11894 | } | ||
11895 | |||
11896 | // SetMissingMeta sets the MissingMeta field's value. | ||
11897 | func (s *HeadObjectOutput) SetMissingMeta(v int64) *HeadObjectOutput { | ||
11898 | s.MissingMeta = &v | ||
11899 | return s | ||
11900 | } | ||
11901 | |||
11902 | // SetPartsCount sets the PartsCount field's value. | ||
11903 | func (s *HeadObjectOutput) SetPartsCount(v int64) *HeadObjectOutput { | ||
11904 | s.PartsCount = &v | ||
11905 | return s | ||
11906 | } | ||
11907 | |||
11908 | // SetReplicationStatus sets the ReplicationStatus field's value. | ||
11909 | func (s *HeadObjectOutput) SetReplicationStatus(v string) *HeadObjectOutput { | ||
11910 | s.ReplicationStatus = &v | ||
11911 | return s | ||
11912 | } | ||
11913 | |||
11914 | // SetRequestCharged sets the RequestCharged field's value. | ||
11915 | func (s *HeadObjectOutput) SetRequestCharged(v string) *HeadObjectOutput { | ||
11916 | s.RequestCharged = &v | ||
11917 | return s | ||
11918 | } | ||
11919 | |||
11920 | // SetRestore sets the Restore field's value. | ||
11921 | func (s *HeadObjectOutput) SetRestore(v string) *HeadObjectOutput { | ||
11922 | s.Restore = &v | ||
11923 | return s | ||
11924 | } | ||
11925 | |||
11926 | // SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. | ||
11927 | func (s *HeadObjectOutput) SetSSECustomerAlgorithm(v string) *HeadObjectOutput { | ||
11928 | s.SSECustomerAlgorithm = &v | ||
11929 | return s | ||
11930 | } | ||
11931 | |||
11932 | // SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. | ||
11933 | func (s *HeadObjectOutput) SetSSECustomerKeyMD5(v string) *HeadObjectOutput { | ||
11934 | s.SSECustomerKeyMD5 = &v | ||
11935 | return s | ||
11936 | } | ||
11937 | |||
11938 | // SetSSEKMSKeyId sets the SSEKMSKeyId field's value. | ||
11939 | func (s *HeadObjectOutput) SetSSEKMSKeyId(v string) *HeadObjectOutput { | ||
11940 | s.SSEKMSKeyId = &v | ||
11941 | return s | ||
11942 | } | ||
11943 | |||
11944 | // SetServerSideEncryption sets the ServerSideEncryption field's value. | ||
11945 | func (s *HeadObjectOutput) SetServerSideEncryption(v string) *HeadObjectOutput { | ||
11946 | s.ServerSideEncryption = &v | ||
11947 | return s | ||
11948 | } | ||
11949 | |||
11950 | // SetStorageClass sets the StorageClass field's value. | ||
11951 | func (s *HeadObjectOutput) SetStorageClass(v string) *HeadObjectOutput { | ||
11952 | s.StorageClass = &v | ||
11953 | return s | ||
11954 | } | ||
11955 | |||
11956 | // SetVersionId sets the VersionId field's value. | ||
11957 | func (s *HeadObjectOutput) SetVersionId(v string) *HeadObjectOutput { | ||
11958 | s.VersionId = &v | ||
11959 | return s | ||
11960 | } | ||
11961 | |||
11962 | // SetWebsiteRedirectLocation sets the WebsiteRedirectLocation field's value. | ||
11963 | func (s *HeadObjectOutput) SetWebsiteRedirectLocation(v string) *HeadObjectOutput { | ||
11964 | s.WebsiteRedirectLocation = &v | ||
11965 | return s | ||
11966 | } | ||
11967 | |||
11968 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/IndexDocument | ||
11969 | type IndexDocument struct { | ||
11970 | _ struct{} `type:"structure"` | ||
11971 | |||
11972 | // A suffix that is appended to a request that is for a directory on the website | ||
11973 | // endpoint (e.g. if the suffix is index.html and you make a request to samplebucket/images/ | ||
11974 | // the data that is returned will be for the object with the key name images/index.html) | ||
11975 | // The suffix must not be empty and must not include a slash character. | ||
11976 | // | ||
11977 | // Suffix is a required field | ||
11978 | Suffix *string `type:"string" required:"true"` | ||
11979 | } | ||
11980 | |||
11981 | // String returns the string representation | ||
11982 | func (s IndexDocument) String() string { | ||
11983 | return awsutil.Prettify(s) | ||
11984 | } | ||
11985 | |||
11986 | // GoString returns the string representation | ||
11987 | func (s IndexDocument) GoString() string { | ||
11988 | return s.String() | ||
11989 | } | ||
11990 | |||
11991 | // Validate inspects the fields of the type to determine if they are valid. | ||
11992 | func (s *IndexDocument) Validate() error { | ||
11993 | invalidParams := request.ErrInvalidParams{Context: "IndexDocument"} | ||
11994 | if s.Suffix == nil { | ||
11995 | invalidParams.Add(request.NewErrParamRequired("Suffix")) | ||
11996 | } | ||
11997 | |||
11998 | if invalidParams.Len() > 0 { | ||
11999 | return invalidParams | ||
12000 | } | ||
12001 | return nil | ||
12002 | } | ||
12003 | |||
12004 | // SetSuffix sets the Suffix field's value. | ||
12005 | func (s *IndexDocument) SetSuffix(v string) *IndexDocument { | ||
12006 | s.Suffix = &v | ||
12007 | return s | ||
12008 | } | ||
12009 | |||
12010 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Initiator | ||
12011 | type Initiator struct { | ||
12012 | _ struct{} `type:"structure"` | ||
12013 | |||
12014 | // Name of the Principal. | ||
12015 | DisplayName *string `type:"string"` | ||
12016 | |||
12017 | // If the principal is an AWS account, it provides the Canonical User ID. If | ||
12018 | // the principal is an IAM User, it provides a user ARN value. | ||
12019 | ID *string `type:"string"` | ||
12020 | } | ||
12021 | |||
12022 | // String returns the string representation | ||
12023 | func (s Initiator) String() string { | ||
12024 | return awsutil.Prettify(s) | ||
12025 | } | ||
12026 | |||
12027 | // GoString returns the string representation | ||
12028 | func (s Initiator) GoString() string { | ||
12029 | return s.String() | ||
12030 | } | ||
12031 | |||
12032 | // SetDisplayName sets the DisplayName field's value. | ||
12033 | func (s *Initiator) SetDisplayName(v string) *Initiator { | ||
12034 | s.DisplayName = &v | ||
12035 | return s | ||
12036 | } | ||
12037 | |||
12038 | // SetID sets the ID field's value. | ||
12039 | func (s *Initiator) SetID(v string) *Initiator { | ||
12040 | s.ID = &v | ||
12041 | return s | ||
12042 | } | ||
12043 | |||
12044 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/InventoryConfiguration | ||
12045 | type InventoryConfiguration struct { | ||
12046 | _ struct{} `type:"structure"` | ||
12047 | |||
12048 | // Contains information about where to publish the inventory results. | ||
12049 | // | ||
12050 | // Destination is a required field | ||
12051 | Destination *InventoryDestination `type:"structure" required:"true"` | ||
12052 | |||
12053 | // Specifies an inventory filter. The inventory only includes objects that meet | ||
12054 | // the filter's criteria. | ||
12055 | Filter *InventoryFilter `type:"structure"` | ||
12056 | |||
12057 | // The ID used to identify the inventory configuration. | ||
12058 | // | ||
12059 | // Id is a required field | ||
12060 | Id *string `type:"string" required:"true"` | ||
12061 | |||
12062 | // Specifies which object version(s) to included in the inventory results. | ||
12063 | // | ||
12064 | // IncludedObjectVersions is a required field | ||
12065 | IncludedObjectVersions *string `type:"string" required:"true" enum:"InventoryIncludedObjectVersions"` | ||
12066 | |||
12067 | // Specifies whether the inventory is enabled or disabled. | ||
12068 | // | ||
12069 | // IsEnabled is a required field | ||
12070 | IsEnabled *bool `type:"boolean" required:"true"` | ||
12071 | |||
12072 | // Contains the optional fields that are included in the inventory results. | ||
12073 | OptionalFields []*string `locationNameList:"Field" type:"list"` | ||
12074 | |||
12075 | // Specifies the schedule for generating inventory results. | ||
12076 | // | ||
12077 | // Schedule is a required field | ||
12078 | Schedule *InventorySchedule `type:"structure" required:"true"` | ||
12079 | } | ||
12080 | |||
12081 | // String returns the string representation | ||
12082 | func (s InventoryConfiguration) String() string { | ||
12083 | return awsutil.Prettify(s) | ||
12084 | } | ||
12085 | |||
12086 | // GoString returns the string representation | ||
12087 | func (s InventoryConfiguration) GoString() string { | ||
12088 | return s.String() | ||
12089 | } | ||
12090 | |||
12091 | // Validate inspects the fields of the type to determine if they are valid. | ||
12092 | func (s *InventoryConfiguration) Validate() error { | ||
12093 | invalidParams := request.ErrInvalidParams{Context: "InventoryConfiguration"} | ||
12094 | if s.Destination == nil { | ||
12095 | invalidParams.Add(request.NewErrParamRequired("Destination")) | ||
12096 | } | ||
12097 | if s.Id == nil { | ||
12098 | invalidParams.Add(request.NewErrParamRequired("Id")) | ||
12099 | } | ||
12100 | if s.IncludedObjectVersions == nil { | ||
12101 | invalidParams.Add(request.NewErrParamRequired("IncludedObjectVersions")) | ||
12102 | } | ||
12103 | if s.IsEnabled == nil { | ||
12104 | invalidParams.Add(request.NewErrParamRequired("IsEnabled")) | ||
12105 | } | ||
12106 | if s.Schedule == nil { | ||
12107 | invalidParams.Add(request.NewErrParamRequired("Schedule")) | ||
12108 | } | ||
12109 | if s.Destination != nil { | ||
12110 | if err := s.Destination.Validate(); err != nil { | ||
12111 | invalidParams.AddNested("Destination", err.(request.ErrInvalidParams)) | ||
12112 | } | ||
12113 | } | ||
12114 | if s.Filter != nil { | ||
12115 | if err := s.Filter.Validate(); err != nil { | ||
12116 | invalidParams.AddNested("Filter", err.(request.ErrInvalidParams)) | ||
12117 | } | ||
12118 | } | ||
12119 | if s.Schedule != nil { | ||
12120 | if err := s.Schedule.Validate(); err != nil { | ||
12121 | invalidParams.AddNested("Schedule", err.(request.ErrInvalidParams)) | ||
12122 | } | ||
12123 | } | ||
12124 | |||
12125 | if invalidParams.Len() > 0 { | ||
12126 | return invalidParams | ||
12127 | } | ||
12128 | return nil | ||
12129 | } | ||
12130 | |||
12131 | // SetDestination sets the Destination field's value. | ||
12132 | func (s *InventoryConfiguration) SetDestination(v *InventoryDestination) *InventoryConfiguration { | ||
12133 | s.Destination = v | ||
12134 | return s | ||
12135 | } | ||
12136 | |||
12137 | // SetFilter sets the Filter field's value. | ||
12138 | func (s *InventoryConfiguration) SetFilter(v *InventoryFilter) *InventoryConfiguration { | ||
12139 | s.Filter = v | ||
12140 | return s | ||
12141 | } | ||
12142 | |||
12143 | // SetId sets the Id field's value. | ||
12144 | func (s *InventoryConfiguration) SetId(v string) *InventoryConfiguration { | ||
12145 | s.Id = &v | ||
12146 | return s | ||
12147 | } | ||
12148 | |||
12149 | // SetIncludedObjectVersions sets the IncludedObjectVersions field's value. | ||
12150 | func (s *InventoryConfiguration) SetIncludedObjectVersions(v string) *InventoryConfiguration { | ||
12151 | s.IncludedObjectVersions = &v | ||
12152 | return s | ||
12153 | } | ||
12154 | |||
12155 | // SetIsEnabled sets the IsEnabled field's value. | ||
12156 | func (s *InventoryConfiguration) SetIsEnabled(v bool) *InventoryConfiguration { | ||
12157 | s.IsEnabled = &v | ||
12158 | return s | ||
12159 | } | ||
12160 | |||
12161 | // SetOptionalFields sets the OptionalFields field's value. | ||
12162 | func (s *InventoryConfiguration) SetOptionalFields(v []*string) *InventoryConfiguration { | ||
12163 | s.OptionalFields = v | ||
12164 | return s | ||
12165 | } | ||
12166 | |||
12167 | // SetSchedule sets the Schedule field's value. | ||
12168 | func (s *InventoryConfiguration) SetSchedule(v *InventorySchedule) *InventoryConfiguration { | ||
12169 | s.Schedule = v | ||
12170 | return s | ||
12171 | } | ||
12172 | |||
12173 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/InventoryDestination | ||
12174 | type InventoryDestination struct { | ||
12175 | _ struct{} `type:"structure"` | ||
12176 | |||
12177 | // Contains the bucket name, file format, bucket owner (optional), and prefix | ||
12178 | // (optional) where inventory results are published. | ||
12179 | // | ||
12180 | // S3BucketDestination is a required field | ||
12181 | S3BucketDestination *InventoryS3BucketDestination `type:"structure" required:"true"` | ||
12182 | } | ||
12183 | |||
12184 | // String returns the string representation | ||
12185 | func (s InventoryDestination) String() string { | ||
12186 | return awsutil.Prettify(s) | ||
12187 | } | ||
12188 | |||
12189 | // GoString returns the string representation | ||
12190 | func (s InventoryDestination) GoString() string { | ||
12191 | return s.String() | ||
12192 | } | ||
12193 | |||
12194 | // Validate inspects the fields of the type to determine if they are valid. | ||
12195 | func (s *InventoryDestination) Validate() error { | ||
12196 | invalidParams := request.ErrInvalidParams{Context: "InventoryDestination"} | ||
12197 | if s.S3BucketDestination == nil { | ||
12198 | invalidParams.Add(request.NewErrParamRequired("S3BucketDestination")) | ||
12199 | } | ||
12200 | if s.S3BucketDestination != nil { | ||
12201 | if err := s.S3BucketDestination.Validate(); err != nil { | ||
12202 | invalidParams.AddNested("S3BucketDestination", err.(request.ErrInvalidParams)) | ||
12203 | } | ||
12204 | } | ||
12205 | |||
12206 | if invalidParams.Len() > 0 { | ||
12207 | return invalidParams | ||
12208 | } | ||
12209 | return nil | ||
12210 | } | ||
12211 | |||
12212 | // SetS3BucketDestination sets the S3BucketDestination field's value. | ||
12213 | func (s *InventoryDestination) SetS3BucketDestination(v *InventoryS3BucketDestination) *InventoryDestination { | ||
12214 | s.S3BucketDestination = v | ||
12215 | return s | ||
12216 | } | ||
12217 | |||
12218 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/InventoryFilter | ||
12219 | type InventoryFilter struct { | ||
12220 | _ struct{} `type:"structure"` | ||
12221 | |||
12222 | // The prefix that an object must have to be included in the inventory results. | ||
12223 | // | ||
12224 | // Prefix is a required field | ||
12225 | Prefix *string `type:"string" required:"true"` | ||
12226 | } | ||
12227 | |||
12228 | // String returns the string representation | ||
12229 | func (s InventoryFilter) String() string { | ||
12230 | return awsutil.Prettify(s) | ||
12231 | } | ||
12232 | |||
12233 | // GoString returns the string representation | ||
12234 | func (s InventoryFilter) GoString() string { | ||
12235 | return s.String() | ||
12236 | } | ||
12237 | |||
12238 | // Validate inspects the fields of the type to determine if they are valid. | ||
12239 | func (s *InventoryFilter) Validate() error { | ||
12240 | invalidParams := request.ErrInvalidParams{Context: "InventoryFilter"} | ||
12241 | if s.Prefix == nil { | ||
12242 | invalidParams.Add(request.NewErrParamRequired("Prefix")) | ||
12243 | } | ||
12244 | |||
12245 | if invalidParams.Len() > 0 { | ||
12246 | return invalidParams | ||
12247 | } | ||
12248 | return nil | ||
12249 | } | ||
12250 | |||
12251 | // SetPrefix sets the Prefix field's value. | ||
12252 | func (s *InventoryFilter) SetPrefix(v string) *InventoryFilter { | ||
12253 | s.Prefix = &v | ||
12254 | return s | ||
12255 | } | ||
12256 | |||
12257 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/InventoryS3BucketDestination | ||
12258 | type InventoryS3BucketDestination struct { | ||
12259 | _ struct{} `type:"structure"` | ||
12260 | |||
12261 | // The ID of the account that owns the destination bucket. | ||
12262 | AccountId *string `type:"string"` | ||
12263 | |||
12264 | // The Amazon resource name (ARN) of the bucket where inventory results will | ||
12265 | // be published. | ||
12266 | // | ||
12267 | // Bucket is a required field | ||
12268 | Bucket *string `type:"string" required:"true"` | ||
12269 | |||
12270 | // Specifies the output format of the inventory results. | ||
12271 | // | ||
12272 | // Format is a required field | ||
12273 | Format *string `type:"string" required:"true" enum:"InventoryFormat"` | ||
12274 | |||
12275 | // The prefix that is prepended to all inventory results. | ||
12276 | Prefix *string `type:"string"` | ||
12277 | } | ||
12278 | |||
12279 | // String returns the string representation | ||
12280 | func (s InventoryS3BucketDestination) String() string { | ||
12281 | return awsutil.Prettify(s) | ||
12282 | } | ||
12283 | |||
12284 | // GoString returns the string representation | ||
12285 | func (s InventoryS3BucketDestination) GoString() string { | ||
12286 | return s.String() | ||
12287 | } | ||
12288 | |||
12289 | // Validate inspects the fields of the type to determine if they are valid. | ||
12290 | func (s *InventoryS3BucketDestination) Validate() error { | ||
12291 | invalidParams := request.ErrInvalidParams{Context: "InventoryS3BucketDestination"} | ||
12292 | if s.Bucket == nil { | ||
12293 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
12294 | } | ||
12295 | if s.Format == nil { | ||
12296 | invalidParams.Add(request.NewErrParamRequired("Format")) | ||
12297 | } | ||
12298 | |||
12299 | if invalidParams.Len() > 0 { | ||
12300 | return invalidParams | ||
12301 | } | ||
12302 | return nil | ||
12303 | } | ||
12304 | |||
12305 | // SetAccountId sets the AccountId field's value. | ||
12306 | func (s *InventoryS3BucketDestination) SetAccountId(v string) *InventoryS3BucketDestination { | ||
12307 | s.AccountId = &v | ||
12308 | return s | ||
12309 | } | ||
12310 | |||
12311 | // SetBucket sets the Bucket field's value. | ||
12312 | func (s *InventoryS3BucketDestination) SetBucket(v string) *InventoryS3BucketDestination { | ||
12313 | s.Bucket = &v | ||
12314 | return s | ||
12315 | } | ||
12316 | |||
12317 | // SetFormat sets the Format field's value. | ||
12318 | func (s *InventoryS3BucketDestination) SetFormat(v string) *InventoryS3BucketDestination { | ||
12319 | s.Format = &v | ||
12320 | return s | ||
12321 | } | ||
12322 | |||
12323 | // SetPrefix sets the Prefix field's value. | ||
12324 | func (s *InventoryS3BucketDestination) SetPrefix(v string) *InventoryS3BucketDestination { | ||
12325 | s.Prefix = &v | ||
12326 | return s | ||
12327 | } | ||
12328 | |||
12329 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/InventorySchedule | ||
12330 | type InventorySchedule struct { | ||
12331 | _ struct{} `type:"structure"` | ||
12332 | |||
12333 | // Specifies how frequently inventory results are produced. | ||
12334 | // | ||
12335 | // Frequency is a required field | ||
12336 | Frequency *string `type:"string" required:"true" enum:"InventoryFrequency"` | ||
12337 | } | ||
12338 | |||
12339 | // String returns the string representation | ||
12340 | func (s InventorySchedule) String() string { | ||
12341 | return awsutil.Prettify(s) | ||
12342 | } | ||
12343 | |||
12344 | // GoString returns the string representation | ||
12345 | func (s InventorySchedule) GoString() string { | ||
12346 | return s.String() | ||
12347 | } | ||
12348 | |||
12349 | // Validate inspects the fields of the type to determine if they are valid. | ||
12350 | func (s *InventorySchedule) Validate() error { | ||
12351 | invalidParams := request.ErrInvalidParams{Context: "InventorySchedule"} | ||
12352 | if s.Frequency == nil { | ||
12353 | invalidParams.Add(request.NewErrParamRequired("Frequency")) | ||
12354 | } | ||
12355 | |||
12356 | if invalidParams.Len() > 0 { | ||
12357 | return invalidParams | ||
12358 | } | ||
12359 | return nil | ||
12360 | } | ||
12361 | |||
12362 | // SetFrequency sets the Frequency field's value. | ||
12363 | func (s *InventorySchedule) SetFrequency(v string) *InventorySchedule { | ||
12364 | s.Frequency = &v | ||
12365 | return s | ||
12366 | } | ||
12367 | |||
12368 | // Container for object key name prefix and suffix filtering rules. | ||
12369 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/S3KeyFilter | ||
12370 | type KeyFilter struct { | ||
12371 | _ struct{} `type:"structure"` | ||
12372 | |||
12373 | // A list of containers for key value pair that defines the criteria for the | ||
12374 | // filter rule. | ||
12375 | FilterRules []*FilterRule `locationName:"FilterRule" type:"list" flattened:"true"` | ||
12376 | } | ||
12377 | |||
12378 | // String returns the string representation | ||
12379 | func (s KeyFilter) String() string { | ||
12380 | return awsutil.Prettify(s) | ||
12381 | } | ||
12382 | |||
12383 | // GoString returns the string representation | ||
12384 | func (s KeyFilter) GoString() string { | ||
12385 | return s.String() | ||
12386 | } | ||
12387 | |||
12388 | // SetFilterRules sets the FilterRules field's value. | ||
12389 | func (s *KeyFilter) SetFilterRules(v []*FilterRule) *KeyFilter { | ||
12390 | s.FilterRules = v | ||
12391 | return s | ||
12392 | } | ||
12393 | |||
12394 | // Container for specifying the AWS Lambda notification configuration. | ||
12395 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/LambdaFunctionConfiguration | ||
12396 | type LambdaFunctionConfiguration struct { | ||
12397 | _ struct{} `type:"structure"` | ||
12398 | |||
12399 | // Events is a required field | ||
12400 | Events []*string `locationName:"Event" type:"list" flattened:"true" required:"true"` | ||
12401 | |||
12402 | // Container for object key name filtering rules. For information about key | ||
12403 | // name filtering, go to Configuring Event Notifications (http://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) | ||
12404 | Filter *NotificationConfigurationFilter `type:"structure"` | ||
12405 | |||
12406 | // Optional unique identifier for configurations in a notification configuration. | ||
12407 | // If you don't provide one, Amazon S3 will assign an ID. | ||
12408 | Id *string `type:"string"` | ||
12409 | |||
12410 | // Lambda cloud function ARN that Amazon S3 can invoke when it detects events | ||
12411 | // of the specified type. | ||
12412 | // | ||
12413 | // LambdaFunctionArn is a required field | ||
12414 | LambdaFunctionArn *string `locationName:"CloudFunction" type:"string" required:"true"` | ||
12415 | } | ||
12416 | |||
12417 | // String returns the string representation | ||
12418 | func (s LambdaFunctionConfiguration) String() string { | ||
12419 | return awsutil.Prettify(s) | ||
12420 | } | ||
12421 | |||
12422 | // GoString returns the string representation | ||
12423 | func (s LambdaFunctionConfiguration) GoString() string { | ||
12424 | return s.String() | ||
12425 | } | ||
12426 | |||
12427 | // Validate inspects the fields of the type to determine if they are valid. | ||
12428 | func (s *LambdaFunctionConfiguration) Validate() error { | ||
12429 | invalidParams := request.ErrInvalidParams{Context: "LambdaFunctionConfiguration"} | ||
12430 | if s.Events == nil { | ||
12431 | invalidParams.Add(request.NewErrParamRequired("Events")) | ||
12432 | } | ||
12433 | if s.LambdaFunctionArn == nil { | ||
12434 | invalidParams.Add(request.NewErrParamRequired("LambdaFunctionArn")) | ||
12435 | } | ||
12436 | |||
12437 | if invalidParams.Len() > 0 { | ||
12438 | return invalidParams | ||
12439 | } | ||
12440 | return nil | ||
12441 | } | ||
12442 | |||
12443 | // SetEvents sets the Events field's value. | ||
12444 | func (s *LambdaFunctionConfiguration) SetEvents(v []*string) *LambdaFunctionConfiguration { | ||
12445 | s.Events = v | ||
12446 | return s | ||
12447 | } | ||
12448 | |||
12449 | // SetFilter sets the Filter field's value. | ||
12450 | func (s *LambdaFunctionConfiguration) SetFilter(v *NotificationConfigurationFilter) *LambdaFunctionConfiguration { | ||
12451 | s.Filter = v | ||
12452 | return s | ||
12453 | } | ||
12454 | |||
12455 | // SetId sets the Id field's value. | ||
12456 | func (s *LambdaFunctionConfiguration) SetId(v string) *LambdaFunctionConfiguration { | ||
12457 | s.Id = &v | ||
12458 | return s | ||
12459 | } | ||
12460 | |||
12461 | // SetLambdaFunctionArn sets the LambdaFunctionArn field's value. | ||
12462 | func (s *LambdaFunctionConfiguration) SetLambdaFunctionArn(v string) *LambdaFunctionConfiguration { | ||
12463 | s.LambdaFunctionArn = &v | ||
12464 | return s | ||
12465 | } | ||
12466 | |||
12467 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/LifecycleConfiguration | ||
12468 | type LifecycleConfiguration struct { | ||
12469 | _ struct{} `type:"structure"` | ||
12470 | |||
12471 | // Rules is a required field | ||
12472 | Rules []*Rule `locationName:"Rule" type:"list" flattened:"true" required:"true"` | ||
12473 | } | ||
12474 | |||
12475 | // String returns the string representation | ||
12476 | func (s LifecycleConfiguration) String() string { | ||
12477 | return awsutil.Prettify(s) | ||
12478 | } | ||
12479 | |||
12480 | // GoString returns the string representation | ||
12481 | func (s LifecycleConfiguration) GoString() string { | ||
12482 | return s.String() | ||
12483 | } | ||
12484 | |||
12485 | // Validate inspects the fields of the type to determine if they are valid. | ||
12486 | func (s *LifecycleConfiguration) Validate() error { | ||
12487 | invalidParams := request.ErrInvalidParams{Context: "LifecycleConfiguration"} | ||
12488 | if s.Rules == nil { | ||
12489 | invalidParams.Add(request.NewErrParamRequired("Rules")) | ||
12490 | } | ||
12491 | if s.Rules != nil { | ||
12492 | for i, v := range s.Rules { | ||
12493 | if v == nil { | ||
12494 | continue | ||
12495 | } | ||
12496 | if err := v.Validate(); err != nil { | ||
12497 | invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Rules", i), err.(request.ErrInvalidParams)) | ||
12498 | } | ||
12499 | } | ||
12500 | } | ||
12501 | |||
12502 | if invalidParams.Len() > 0 { | ||
12503 | return invalidParams | ||
12504 | } | ||
12505 | return nil | ||
12506 | } | ||
12507 | |||
12508 | // SetRules sets the Rules field's value. | ||
12509 | func (s *LifecycleConfiguration) SetRules(v []*Rule) *LifecycleConfiguration { | ||
12510 | s.Rules = v | ||
12511 | return s | ||
12512 | } | ||
12513 | |||
12514 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/LifecycleExpiration | ||
12515 | type LifecycleExpiration struct { | ||
12516 | _ struct{} `type:"structure"` | ||
12517 | |||
12518 | // Indicates at what date the object is to be moved or deleted. Should be in | ||
12519 | // GMT ISO 8601 Format. | ||
12520 | Date *time.Time `type:"timestamp" timestampFormat:"iso8601"` | ||
12521 | |||
12522 | // Indicates the lifetime, in days, of the objects that are subject to the rule. | ||
12523 | // The value must be a non-zero positive integer. | ||
12524 | Days *int64 `type:"integer"` | ||
12525 | |||
12526 | // Indicates whether Amazon S3 will remove a delete marker with no noncurrent | ||
12527 | // versions. If set to true, the delete marker will be expired; if set to false | ||
12528 | // the policy takes no action. This cannot be specified with Days or Date in | ||
12529 | // a Lifecycle Expiration Policy. | ||
12530 | ExpiredObjectDeleteMarker *bool `type:"boolean"` | ||
12531 | } | ||
12532 | |||
12533 | // String returns the string representation | ||
12534 | func (s LifecycleExpiration) String() string { | ||
12535 | return awsutil.Prettify(s) | ||
12536 | } | ||
12537 | |||
12538 | // GoString returns the string representation | ||
12539 | func (s LifecycleExpiration) GoString() string { | ||
12540 | return s.String() | ||
12541 | } | ||
12542 | |||
12543 | // SetDate sets the Date field's value. | ||
12544 | func (s *LifecycleExpiration) SetDate(v time.Time) *LifecycleExpiration { | ||
12545 | s.Date = &v | ||
12546 | return s | ||
12547 | } | ||
12548 | |||
12549 | // SetDays sets the Days field's value. | ||
12550 | func (s *LifecycleExpiration) SetDays(v int64) *LifecycleExpiration { | ||
12551 | s.Days = &v | ||
12552 | return s | ||
12553 | } | ||
12554 | |||
12555 | // SetExpiredObjectDeleteMarker sets the ExpiredObjectDeleteMarker field's value. | ||
12556 | func (s *LifecycleExpiration) SetExpiredObjectDeleteMarker(v bool) *LifecycleExpiration { | ||
12557 | s.ExpiredObjectDeleteMarker = &v | ||
12558 | return s | ||
12559 | } | ||
12560 | |||
12561 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/LifecycleRule | ||
12562 | type LifecycleRule struct { | ||
12563 | _ struct{} `type:"structure"` | ||
12564 | |||
12565 | // Specifies the days since the initiation of an Incomplete Multipart Upload | ||
12566 | // that Lifecycle will wait before permanently removing all parts of the upload. | ||
12567 | AbortIncompleteMultipartUpload *AbortIncompleteMultipartUpload `type:"structure"` | ||
12568 | |||
12569 | Expiration *LifecycleExpiration `type:"structure"` | ||
12570 | |||
12571 | // The Filter is used to identify objects that a Lifecycle Rule applies to. | ||
12572 | // A Filter must have exactly one of Prefix, Tag, or And specified. | ||
12573 | Filter *LifecycleRuleFilter `type:"structure"` | ||
12574 | |||
12575 | // Unique identifier for the rule. The value cannot be longer than 255 characters. | ||
12576 | ID *string `type:"string"` | ||
12577 | |||
12578 | // Specifies when noncurrent object versions expire. Upon expiration, Amazon | ||
12579 | // S3 permanently deletes the noncurrent object versions. You set this lifecycle | ||
12580 | // configuration action on a bucket that has versioning enabled (or suspended) | ||
12581 | // to request that Amazon S3 delete noncurrent object versions at a specific | ||
12582 | // period in the object's lifetime. | ||
12583 | NoncurrentVersionExpiration *NoncurrentVersionExpiration `type:"structure"` | ||
12584 | |||
12585 | NoncurrentVersionTransitions []*NoncurrentVersionTransition `locationName:"NoncurrentVersionTransition" type:"list" flattened:"true"` | ||
12586 | |||
12587 | // Prefix identifying one or more objects to which the rule applies. This is | ||
12588 | // deprecated; use Filter instead. | ||
12589 | Prefix *string `deprecated:"true" type:"string"` | ||
12590 | |||
12591 | // If 'Enabled', the rule is currently being applied. If 'Disabled', the rule | ||
12592 | // is not currently being applied. | ||
12593 | // | ||
12594 | // Status is a required field | ||
12595 | Status *string `type:"string" required:"true" enum:"ExpirationStatus"` | ||
12596 | |||
12597 | Transitions []*Transition `locationName:"Transition" type:"list" flattened:"true"` | ||
12598 | } | ||
12599 | |||
12600 | // String returns the string representation | ||
12601 | func (s LifecycleRule) String() string { | ||
12602 | return awsutil.Prettify(s) | ||
12603 | } | ||
12604 | |||
12605 | // GoString returns the string representation | ||
12606 | func (s LifecycleRule) GoString() string { | ||
12607 | return s.String() | ||
12608 | } | ||
12609 | |||
12610 | // Validate inspects the fields of the type to determine if they are valid. | ||
12611 | func (s *LifecycleRule) Validate() error { | ||
12612 | invalidParams := request.ErrInvalidParams{Context: "LifecycleRule"} | ||
12613 | if s.Status == nil { | ||
12614 | invalidParams.Add(request.NewErrParamRequired("Status")) | ||
12615 | } | ||
12616 | if s.Filter != nil { | ||
12617 | if err := s.Filter.Validate(); err != nil { | ||
12618 | invalidParams.AddNested("Filter", err.(request.ErrInvalidParams)) | ||
12619 | } | ||
12620 | } | ||
12621 | |||
12622 | if invalidParams.Len() > 0 { | ||
12623 | return invalidParams | ||
12624 | } | ||
12625 | return nil | ||
12626 | } | ||
12627 | |||
12628 | // SetAbortIncompleteMultipartUpload sets the AbortIncompleteMultipartUpload field's value. | ||
12629 | func (s *LifecycleRule) SetAbortIncompleteMultipartUpload(v *AbortIncompleteMultipartUpload) *LifecycleRule { | ||
12630 | s.AbortIncompleteMultipartUpload = v | ||
12631 | return s | ||
12632 | } | ||
12633 | |||
12634 | // SetExpiration sets the Expiration field's value. | ||
12635 | func (s *LifecycleRule) SetExpiration(v *LifecycleExpiration) *LifecycleRule { | ||
12636 | s.Expiration = v | ||
12637 | return s | ||
12638 | } | ||
12639 | |||
12640 | // SetFilter sets the Filter field's value. | ||
12641 | func (s *LifecycleRule) SetFilter(v *LifecycleRuleFilter) *LifecycleRule { | ||
12642 | s.Filter = v | ||
12643 | return s | ||
12644 | } | ||
12645 | |||
12646 | // SetID sets the ID field's value. | ||
12647 | func (s *LifecycleRule) SetID(v string) *LifecycleRule { | ||
12648 | s.ID = &v | ||
12649 | return s | ||
12650 | } | ||
12651 | |||
12652 | // SetNoncurrentVersionExpiration sets the NoncurrentVersionExpiration field's value. | ||
12653 | func (s *LifecycleRule) SetNoncurrentVersionExpiration(v *NoncurrentVersionExpiration) *LifecycleRule { | ||
12654 | s.NoncurrentVersionExpiration = v | ||
12655 | return s | ||
12656 | } | ||
12657 | |||
12658 | // SetNoncurrentVersionTransitions sets the NoncurrentVersionTransitions field's value. | ||
12659 | func (s *LifecycleRule) SetNoncurrentVersionTransitions(v []*NoncurrentVersionTransition) *LifecycleRule { | ||
12660 | s.NoncurrentVersionTransitions = v | ||
12661 | return s | ||
12662 | } | ||
12663 | |||
12664 | // SetPrefix sets the Prefix field's value. | ||
12665 | func (s *LifecycleRule) SetPrefix(v string) *LifecycleRule { | ||
12666 | s.Prefix = &v | ||
12667 | return s | ||
12668 | } | ||
12669 | |||
12670 | // SetStatus sets the Status field's value. | ||
12671 | func (s *LifecycleRule) SetStatus(v string) *LifecycleRule { | ||
12672 | s.Status = &v | ||
12673 | return s | ||
12674 | } | ||
12675 | |||
12676 | // SetTransitions sets the Transitions field's value. | ||
12677 | func (s *LifecycleRule) SetTransitions(v []*Transition) *LifecycleRule { | ||
12678 | s.Transitions = v | ||
12679 | return s | ||
12680 | } | ||
12681 | |||
12682 | // This is used in a Lifecycle Rule Filter to apply a logical AND to two or | ||
12683 | // more predicates. The Lifecycle Rule will apply to any object matching all | ||
12684 | // of the predicates configured inside the And operator. | ||
12685 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/LifecycleRuleAndOperator | ||
12686 | type LifecycleRuleAndOperator struct { | ||
12687 | _ struct{} `type:"structure"` | ||
12688 | |||
12689 | Prefix *string `type:"string"` | ||
12690 | |||
12691 | // All of these tags must exist in the object's tag set in order for the rule | ||
12692 | // to apply. | ||
12693 | Tags []*Tag `locationName:"Tag" locationNameList:"Tag" type:"list" flattened:"true"` | ||
12694 | } | ||
12695 | |||
12696 | // String returns the string representation | ||
12697 | func (s LifecycleRuleAndOperator) String() string { | ||
12698 | return awsutil.Prettify(s) | ||
12699 | } | ||
12700 | |||
12701 | // GoString returns the string representation | ||
12702 | func (s LifecycleRuleAndOperator) GoString() string { | ||
12703 | return s.String() | ||
12704 | } | ||
12705 | |||
12706 | // Validate inspects the fields of the type to determine if they are valid. | ||
12707 | func (s *LifecycleRuleAndOperator) Validate() error { | ||
12708 | invalidParams := request.ErrInvalidParams{Context: "LifecycleRuleAndOperator"} | ||
12709 | if s.Tags != nil { | ||
12710 | for i, v := range s.Tags { | ||
12711 | if v == nil { | ||
12712 | continue | ||
12713 | } | ||
12714 | if err := v.Validate(); err != nil { | ||
12715 | invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) | ||
12716 | } | ||
12717 | } | ||
12718 | } | ||
12719 | |||
12720 | if invalidParams.Len() > 0 { | ||
12721 | return invalidParams | ||
12722 | } | ||
12723 | return nil | ||
12724 | } | ||
12725 | |||
12726 | // SetPrefix sets the Prefix field's value. | ||
12727 | func (s *LifecycleRuleAndOperator) SetPrefix(v string) *LifecycleRuleAndOperator { | ||
12728 | s.Prefix = &v | ||
12729 | return s | ||
12730 | } | ||
12731 | |||
12732 | // SetTags sets the Tags field's value. | ||
12733 | func (s *LifecycleRuleAndOperator) SetTags(v []*Tag) *LifecycleRuleAndOperator { | ||
12734 | s.Tags = v | ||
12735 | return s | ||
12736 | } | ||
12737 | |||
12738 | // The Filter is used to identify objects that a Lifecycle Rule applies to. | ||
12739 | // A Filter must have exactly one of Prefix, Tag, or And specified. | ||
12740 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/LifecycleRuleFilter | ||
12741 | type LifecycleRuleFilter struct { | ||
12742 | _ struct{} `type:"structure"` | ||
12743 | |||
12744 | // This is used in a Lifecycle Rule Filter to apply a logical AND to two or | ||
12745 | // more predicates. The Lifecycle Rule will apply to any object matching all | ||
12746 | // of the predicates configured inside the And operator. | ||
12747 | And *LifecycleRuleAndOperator `type:"structure"` | ||
12748 | |||
12749 | // Prefix identifying one or more objects to which the rule applies. | ||
12750 | Prefix *string `type:"string"` | ||
12751 | |||
12752 | // This tag must exist in the object's tag set in order for the rule to apply. | ||
12753 | Tag *Tag `type:"structure"` | ||
12754 | } | ||
12755 | |||
12756 | // String returns the string representation | ||
12757 | func (s LifecycleRuleFilter) String() string { | ||
12758 | return awsutil.Prettify(s) | ||
12759 | } | ||
12760 | |||
12761 | // GoString returns the string representation | ||
12762 | func (s LifecycleRuleFilter) GoString() string { | ||
12763 | return s.String() | ||
12764 | } | ||
12765 | |||
12766 | // Validate inspects the fields of the type to determine if they are valid. | ||
12767 | func (s *LifecycleRuleFilter) Validate() error { | ||
12768 | invalidParams := request.ErrInvalidParams{Context: "LifecycleRuleFilter"} | ||
12769 | if s.And != nil { | ||
12770 | if err := s.And.Validate(); err != nil { | ||
12771 | invalidParams.AddNested("And", err.(request.ErrInvalidParams)) | ||
12772 | } | ||
12773 | } | ||
12774 | if s.Tag != nil { | ||
12775 | if err := s.Tag.Validate(); err != nil { | ||
12776 | invalidParams.AddNested("Tag", err.(request.ErrInvalidParams)) | ||
12777 | } | ||
12778 | } | ||
12779 | |||
12780 | if invalidParams.Len() > 0 { | ||
12781 | return invalidParams | ||
12782 | } | ||
12783 | return nil | ||
12784 | } | ||
12785 | |||
12786 | // SetAnd sets the And field's value. | ||
12787 | func (s *LifecycleRuleFilter) SetAnd(v *LifecycleRuleAndOperator) *LifecycleRuleFilter { | ||
12788 | s.And = v | ||
12789 | return s | ||
12790 | } | ||
12791 | |||
12792 | // SetPrefix sets the Prefix field's value. | ||
12793 | func (s *LifecycleRuleFilter) SetPrefix(v string) *LifecycleRuleFilter { | ||
12794 | s.Prefix = &v | ||
12795 | return s | ||
12796 | } | ||
12797 | |||
12798 | // SetTag sets the Tag field's value. | ||
12799 | func (s *LifecycleRuleFilter) SetTag(v *Tag) *LifecycleRuleFilter { | ||
12800 | s.Tag = v | ||
12801 | return s | ||
12802 | } | ||
12803 | |||
12804 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketAnalyticsConfigurationsRequest | ||
12805 | type ListBucketAnalyticsConfigurationsInput struct { | ||
12806 | _ struct{} `type:"structure"` | ||
12807 | |||
12808 | // The name of the bucket from which analytics configurations are retrieved. | ||
12809 | // | ||
12810 | // Bucket is a required field | ||
12811 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
12812 | |||
12813 | // The ContinuationToken that represents a placeholder from where this request | ||
12814 | // should begin. | ||
12815 | ContinuationToken *string `location:"querystring" locationName:"continuation-token" type:"string"` | ||
12816 | } | ||
12817 | |||
12818 | // String returns the string representation | ||
12819 | func (s ListBucketAnalyticsConfigurationsInput) String() string { | ||
12820 | return awsutil.Prettify(s) | ||
12821 | } | ||
12822 | |||
12823 | // GoString returns the string representation | ||
12824 | func (s ListBucketAnalyticsConfigurationsInput) GoString() string { | ||
12825 | return s.String() | ||
12826 | } | ||
12827 | |||
12828 | // Validate inspects the fields of the type to determine if they are valid. | ||
12829 | func (s *ListBucketAnalyticsConfigurationsInput) Validate() error { | ||
12830 | invalidParams := request.ErrInvalidParams{Context: "ListBucketAnalyticsConfigurationsInput"} | ||
12831 | if s.Bucket == nil { | ||
12832 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
12833 | } | ||
12834 | |||
12835 | if invalidParams.Len() > 0 { | ||
12836 | return invalidParams | ||
12837 | } | ||
12838 | return nil | ||
12839 | } | ||
12840 | |||
12841 | // SetBucket sets the Bucket field's value. | ||
12842 | func (s *ListBucketAnalyticsConfigurationsInput) SetBucket(v string) *ListBucketAnalyticsConfigurationsInput { | ||
12843 | s.Bucket = &v | ||
12844 | return s | ||
12845 | } | ||
12846 | |||
12847 | // SetContinuationToken sets the ContinuationToken field's value. | ||
12848 | func (s *ListBucketAnalyticsConfigurationsInput) SetContinuationToken(v string) *ListBucketAnalyticsConfigurationsInput { | ||
12849 | s.ContinuationToken = &v | ||
12850 | return s | ||
12851 | } | ||
12852 | |||
12853 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketAnalyticsConfigurationsOutput | ||
12854 | type ListBucketAnalyticsConfigurationsOutput struct { | ||
12855 | _ struct{} `type:"structure"` | ||
12856 | |||
12857 | // The list of analytics configurations for a bucket. | ||
12858 | AnalyticsConfigurationList []*AnalyticsConfiguration `locationName:"AnalyticsConfiguration" type:"list" flattened:"true"` | ||
12859 | |||
12860 | // The ContinuationToken that represents where this request began. | ||
12861 | ContinuationToken *string `type:"string"` | ||
12862 | |||
12863 | // Indicates whether the returned list of analytics configurations is complete. | ||
12864 | // A value of true indicates that the list is not complete and the NextContinuationToken | ||
12865 | // will be provided for a subsequent request. | ||
12866 | IsTruncated *bool `type:"boolean"` | ||
12867 | |||
12868 | // NextContinuationToken is sent when isTruncated is true, which indicates that | ||
12869 | // there are more analytics configurations to list. The next request must include | ||
12870 | // this NextContinuationToken. The token is obfuscated and is not a usable value. | ||
12871 | NextContinuationToken *string `type:"string"` | ||
12872 | } | ||
12873 | |||
12874 | // String returns the string representation | ||
12875 | func (s ListBucketAnalyticsConfigurationsOutput) String() string { | ||
12876 | return awsutil.Prettify(s) | ||
12877 | } | ||
12878 | |||
12879 | // GoString returns the string representation | ||
12880 | func (s ListBucketAnalyticsConfigurationsOutput) GoString() string { | ||
12881 | return s.String() | ||
12882 | } | ||
12883 | |||
12884 | // SetAnalyticsConfigurationList sets the AnalyticsConfigurationList field's value. | ||
12885 | func (s *ListBucketAnalyticsConfigurationsOutput) SetAnalyticsConfigurationList(v []*AnalyticsConfiguration) *ListBucketAnalyticsConfigurationsOutput { | ||
12886 | s.AnalyticsConfigurationList = v | ||
12887 | return s | ||
12888 | } | ||
12889 | |||
12890 | // SetContinuationToken sets the ContinuationToken field's value. | ||
12891 | func (s *ListBucketAnalyticsConfigurationsOutput) SetContinuationToken(v string) *ListBucketAnalyticsConfigurationsOutput { | ||
12892 | s.ContinuationToken = &v | ||
12893 | return s | ||
12894 | } | ||
12895 | |||
12896 | // SetIsTruncated sets the IsTruncated field's value. | ||
12897 | func (s *ListBucketAnalyticsConfigurationsOutput) SetIsTruncated(v bool) *ListBucketAnalyticsConfigurationsOutput { | ||
12898 | s.IsTruncated = &v | ||
12899 | return s | ||
12900 | } | ||
12901 | |||
12902 | // SetNextContinuationToken sets the NextContinuationToken field's value. | ||
12903 | func (s *ListBucketAnalyticsConfigurationsOutput) SetNextContinuationToken(v string) *ListBucketAnalyticsConfigurationsOutput { | ||
12904 | s.NextContinuationToken = &v | ||
12905 | return s | ||
12906 | } | ||
12907 | |||
12908 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketInventoryConfigurationsRequest | ||
12909 | type ListBucketInventoryConfigurationsInput struct { | ||
12910 | _ struct{} `type:"structure"` | ||
12911 | |||
12912 | // The name of the bucket containing the inventory configurations to retrieve. | ||
12913 | // | ||
12914 | // Bucket is a required field | ||
12915 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
12916 | |||
12917 | // The marker used to continue an inventory configuration listing that has been | ||
12918 | // truncated. Use the NextContinuationToken from a previously truncated list | ||
12919 | // response to continue the listing. The continuation token is an opaque value | ||
12920 | // that Amazon S3 understands. | ||
12921 | ContinuationToken *string `location:"querystring" locationName:"continuation-token" type:"string"` | ||
12922 | } | ||
12923 | |||
12924 | // String returns the string representation | ||
12925 | func (s ListBucketInventoryConfigurationsInput) String() string { | ||
12926 | return awsutil.Prettify(s) | ||
12927 | } | ||
12928 | |||
12929 | // GoString returns the string representation | ||
12930 | func (s ListBucketInventoryConfigurationsInput) GoString() string { | ||
12931 | return s.String() | ||
12932 | } | ||
12933 | |||
12934 | // Validate inspects the fields of the type to determine if they are valid. | ||
12935 | func (s *ListBucketInventoryConfigurationsInput) Validate() error { | ||
12936 | invalidParams := request.ErrInvalidParams{Context: "ListBucketInventoryConfigurationsInput"} | ||
12937 | if s.Bucket == nil { | ||
12938 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
12939 | } | ||
12940 | |||
12941 | if invalidParams.Len() > 0 { | ||
12942 | return invalidParams | ||
12943 | } | ||
12944 | return nil | ||
12945 | } | ||
12946 | |||
12947 | // SetBucket sets the Bucket field's value. | ||
12948 | func (s *ListBucketInventoryConfigurationsInput) SetBucket(v string) *ListBucketInventoryConfigurationsInput { | ||
12949 | s.Bucket = &v | ||
12950 | return s | ||
12951 | } | ||
12952 | |||
12953 | // SetContinuationToken sets the ContinuationToken field's value. | ||
12954 | func (s *ListBucketInventoryConfigurationsInput) SetContinuationToken(v string) *ListBucketInventoryConfigurationsInput { | ||
12955 | s.ContinuationToken = &v | ||
12956 | return s | ||
12957 | } | ||
12958 | |||
12959 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketInventoryConfigurationsOutput | ||
12960 | type ListBucketInventoryConfigurationsOutput struct { | ||
12961 | _ struct{} `type:"structure"` | ||
12962 | |||
12963 | // If sent in the request, the marker that is used as a starting point for this | ||
12964 | // inventory configuration list response. | ||
12965 | ContinuationToken *string `type:"string"` | ||
12966 | |||
12967 | // The list of inventory configurations for a bucket. | ||
12968 | InventoryConfigurationList []*InventoryConfiguration `locationName:"InventoryConfiguration" type:"list" flattened:"true"` | ||
12969 | |||
12970 | // Indicates whether the returned list of inventory configurations is truncated | ||
12971 | // in this response. A value of true indicates that the list is truncated. | ||
12972 | IsTruncated *bool `type:"boolean"` | ||
12973 | |||
12974 | // The marker used to continue this inventory configuration listing. Use the | ||
12975 | // NextContinuationToken from this response to continue the listing in a subsequent | ||
12976 | // request. The continuation token is an opaque value that Amazon S3 understands. | ||
12977 | NextContinuationToken *string `type:"string"` | ||
12978 | } | ||
12979 | |||
12980 | // String returns the string representation | ||
12981 | func (s ListBucketInventoryConfigurationsOutput) String() string { | ||
12982 | return awsutil.Prettify(s) | ||
12983 | } | ||
12984 | |||
12985 | // GoString returns the string representation | ||
12986 | func (s ListBucketInventoryConfigurationsOutput) GoString() string { | ||
12987 | return s.String() | ||
12988 | } | ||
12989 | |||
12990 | // SetContinuationToken sets the ContinuationToken field's value. | ||
12991 | func (s *ListBucketInventoryConfigurationsOutput) SetContinuationToken(v string) *ListBucketInventoryConfigurationsOutput { | ||
12992 | s.ContinuationToken = &v | ||
12993 | return s | ||
12994 | } | ||
12995 | |||
12996 | // SetInventoryConfigurationList sets the InventoryConfigurationList field's value. | ||
12997 | func (s *ListBucketInventoryConfigurationsOutput) SetInventoryConfigurationList(v []*InventoryConfiguration) *ListBucketInventoryConfigurationsOutput { | ||
12998 | s.InventoryConfigurationList = v | ||
12999 | return s | ||
13000 | } | ||
13001 | |||
13002 | // SetIsTruncated sets the IsTruncated field's value. | ||
13003 | func (s *ListBucketInventoryConfigurationsOutput) SetIsTruncated(v bool) *ListBucketInventoryConfigurationsOutput { | ||
13004 | s.IsTruncated = &v | ||
13005 | return s | ||
13006 | } | ||
13007 | |||
13008 | // SetNextContinuationToken sets the NextContinuationToken field's value. | ||
13009 | func (s *ListBucketInventoryConfigurationsOutput) SetNextContinuationToken(v string) *ListBucketInventoryConfigurationsOutput { | ||
13010 | s.NextContinuationToken = &v | ||
13011 | return s | ||
13012 | } | ||
13013 | |||
13014 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketMetricsConfigurationsRequest | ||
13015 | type ListBucketMetricsConfigurationsInput struct { | ||
13016 | _ struct{} `type:"structure"` | ||
13017 | |||
13018 | // The name of the bucket containing the metrics configurations to retrieve. | ||
13019 | // | ||
13020 | // Bucket is a required field | ||
13021 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
13022 | |||
13023 | // The marker that is used to continue a metrics configuration listing that | ||
13024 | // has been truncated. Use the NextContinuationToken from a previously truncated | ||
13025 | // list response to continue the listing. The continuation token is an opaque | ||
13026 | // value that Amazon S3 understands. | ||
13027 | ContinuationToken *string `location:"querystring" locationName:"continuation-token" type:"string"` | ||
13028 | } | ||
13029 | |||
13030 | // String returns the string representation | ||
13031 | func (s ListBucketMetricsConfigurationsInput) String() string { | ||
13032 | return awsutil.Prettify(s) | ||
13033 | } | ||
13034 | |||
13035 | // GoString returns the string representation | ||
13036 | func (s ListBucketMetricsConfigurationsInput) GoString() string { | ||
13037 | return s.String() | ||
13038 | } | ||
13039 | |||
13040 | // Validate inspects the fields of the type to determine if they are valid. | ||
13041 | func (s *ListBucketMetricsConfigurationsInput) Validate() error { | ||
13042 | invalidParams := request.ErrInvalidParams{Context: "ListBucketMetricsConfigurationsInput"} | ||
13043 | if s.Bucket == nil { | ||
13044 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
13045 | } | ||
13046 | |||
13047 | if invalidParams.Len() > 0 { | ||
13048 | return invalidParams | ||
13049 | } | ||
13050 | return nil | ||
13051 | } | ||
13052 | |||
13053 | // SetBucket sets the Bucket field's value. | ||
13054 | func (s *ListBucketMetricsConfigurationsInput) SetBucket(v string) *ListBucketMetricsConfigurationsInput { | ||
13055 | s.Bucket = &v | ||
13056 | return s | ||
13057 | } | ||
13058 | |||
13059 | // SetContinuationToken sets the ContinuationToken field's value. | ||
13060 | func (s *ListBucketMetricsConfigurationsInput) SetContinuationToken(v string) *ListBucketMetricsConfigurationsInput { | ||
13061 | s.ContinuationToken = &v | ||
13062 | return s | ||
13063 | } | ||
13064 | |||
13065 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketMetricsConfigurationsOutput | ||
13066 | type ListBucketMetricsConfigurationsOutput struct { | ||
13067 | _ struct{} `type:"structure"` | ||
13068 | |||
13069 | // The marker that is used as a starting point for this metrics configuration | ||
13070 | // list response. This value is present if it was sent in the request. | ||
13071 | ContinuationToken *string `type:"string"` | ||
13072 | |||
13073 | // Indicates whether the returned list of metrics configurations is complete. | ||
13074 | // A value of true indicates that the list is not complete and the NextContinuationToken | ||
13075 | // will be provided for a subsequent request. | ||
13076 | IsTruncated *bool `type:"boolean"` | ||
13077 | |||
13078 | // The list of metrics configurations for a bucket. | ||
13079 | MetricsConfigurationList []*MetricsConfiguration `locationName:"MetricsConfiguration" type:"list" flattened:"true"` | ||
13080 | |||
13081 | // The marker used to continue a metrics configuration listing that has been | ||
13082 | // truncated. Use the NextContinuationToken from a previously truncated list | ||
13083 | // response to continue the listing. The continuation token is an opaque value | ||
13084 | // that Amazon S3 understands. | ||
13085 | NextContinuationToken *string `type:"string"` | ||
13086 | } | ||
13087 | |||
13088 | // String returns the string representation | ||
13089 | func (s ListBucketMetricsConfigurationsOutput) String() string { | ||
13090 | return awsutil.Prettify(s) | ||
13091 | } | ||
13092 | |||
13093 | // GoString returns the string representation | ||
13094 | func (s ListBucketMetricsConfigurationsOutput) GoString() string { | ||
13095 | return s.String() | ||
13096 | } | ||
13097 | |||
13098 | // SetContinuationToken sets the ContinuationToken field's value. | ||
13099 | func (s *ListBucketMetricsConfigurationsOutput) SetContinuationToken(v string) *ListBucketMetricsConfigurationsOutput { | ||
13100 | s.ContinuationToken = &v | ||
13101 | return s | ||
13102 | } | ||
13103 | |||
13104 | // SetIsTruncated sets the IsTruncated field's value. | ||
13105 | func (s *ListBucketMetricsConfigurationsOutput) SetIsTruncated(v bool) *ListBucketMetricsConfigurationsOutput { | ||
13106 | s.IsTruncated = &v | ||
13107 | return s | ||
13108 | } | ||
13109 | |||
13110 | // SetMetricsConfigurationList sets the MetricsConfigurationList field's value. | ||
13111 | func (s *ListBucketMetricsConfigurationsOutput) SetMetricsConfigurationList(v []*MetricsConfiguration) *ListBucketMetricsConfigurationsOutput { | ||
13112 | s.MetricsConfigurationList = v | ||
13113 | return s | ||
13114 | } | ||
13115 | |||
13116 | // SetNextContinuationToken sets the NextContinuationToken field's value. | ||
13117 | func (s *ListBucketMetricsConfigurationsOutput) SetNextContinuationToken(v string) *ListBucketMetricsConfigurationsOutput { | ||
13118 | s.NextContinuationToken = &v | ||
13119 | return s | ||
13120 | } | ||
13121 | |||
13122 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketsInput | ||
13123 | type ListBucketsInput struct { | ||
13124 | _ struct{} `type:"structure"` | ||
13125 | } | ||
13126 | |||
13127 | // String returns the string representation | ||
13128 | func (s ListBucketsInput) String() string { | ||
13129 | return awsutil.Prettify(s) | ||
13130 | } | ||
13131 | |||
13132 | // GoString returns the string representation | ||
13133 | func (s ListBucketsInput) GoString() string { | ||
13134 | return s.String() | ||
13135 | } | ||
13136 | |||
13137 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketsOutput | ||
13138 | type ListBucketsOutput struct { | ||
13139 | _ struct{} `type:"structure"` | ||
13140 | |||
13141 | Buckets []*Bucket `locationNameList:"Bucket" type:"list"` | ||
13142 | |||
13143 | Owner *Owner `type:"structure"` | ||
13144 | } | ||
13145 | |||
13146 | // String returns the string representation | ||
13147 | func (s ListBucketsOutput) String() string { | ||
13148 | return awsutil.Prettify(s) | ||
13149 | } | ||
13150 | |||
13151 | // GoString returns the string representation | ||
13152 | func (s ListBucketsOutput) GoString() string { | ||
13153 | return s.String() | ||
13154 | } | ||
13155 | |||
13156 | // SetBuckets sets the Buckets field's value. | ||
13157 | func (s *ListBucketsOutput) SetBuckets(v []*Bucket) *ListBucketsOutput { | ||
13158 | s.Buckets = v | ||
13159 | return s | ||
13160 | } | ||
13161 | |||
13162 | // SetOwner sets the Owner field's value. | ||
13163 | func (s *ListBucketsOutput) SetOwner(v *Owner) *ListBucketsOutput { | ||
13164 | s.Owner = v | ||
13165 | return s | ||
13166 | } | ||
13167 | |||
13168 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListMultipartUploadsRequest | ||
13169 | type ListMultipartUploadsInput struct { | ||
13170 | _ struct{} `type:"structure"` | ||
13171 | |||
13172 | // Bucket is a required field | ||
13173 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
13174 | |||
13175 | // Character you use to group keys. | ||
13176 | Delimiter *string `location:"querystring" locationName:"delimiter" type:"string"` | ||
13177 | |||
13178 | // Requests Amazon S3 to encode the object keys in the response and specifies | ||
13179 | // the encoding method to use. An object key may contain any Unicode character; | ||
13180 | // however, XML 1.0 parser cannot parse some characters, such as characters | ||
13181 | // with an ASCII value from 0 to 10. For characters that are not supported in | ||
13182 | // XML 1.0, you can add this parameter to request that Amazon S3 encode the | ||
13183 | // keys in the response. | ||
13184 | EncodingType *string `location:"querystring" locationName:"encoding-type" type:"string" enum:"EncodingType"` | ||
13185 | |||
13186 | // Together with upload-id-marker, this parameter specifies the multipart upload | ||
13187 | // after which listing should begin. | ||
13188 | KeyMarker *string `location:"querystring" locationName:"key-marker" type:"string"` | ||
13189 | |||
13190 | // Sets the maximum number of multipart uploads, from 1 to 1,000, to return | ||
13191 | // in the response body. 1,000 is the maximum number of uploads that can be | ||
13192 | // returned in a response. | ||
13193 | MaxUploads *int64 `location:"querystring" locationName:"max-uploads" type:"integer"` | ||
13194 | |||
13195 | // Lists in-progress uploads only for those keys that begin with the specified | ||
13196 | // prefix. | ||
13197 | Prefix *string `location:"querystring" locationName:"prefix" type:"string"` | ||
13198 | |||
13199 | // Together with key-marker, specifies the multipart upload after which listing | ||
13200 | // should begin. If key-marker is not specified, the upload-id-marker parameter | ||
13201 | // is ignored. | ||
13202 | UploadIdMarker *string `location:"querystring" locationName:"upload-id-marker" type:"string"` | ||
13203 | } | ||
13204 | |||
13205 | // String returns the string representation | ||
13206 | func (s ListMultipartUploadsInput) String() string { | ||
13207 | return awsutil.Prettify(s) | ||
13208 | } | ||
13209 | |||
13210 | // GoString returns the string representation | ||
13211 | func (s ListMultipartUploadsInput) GoString() string { | ||
13212 | return s.String() | ||
13213 | } | ||
13214 | |||
13215 | // Validate inspects the fields of the type to determine if they are valid. | ||
13216 | func (s *ListMultipartUploadsInput) Validate() error { | ||
13217 | invalidParams := request.ErrInvalidParams{Context: "ListMultipartUploadsInput"} | ||
13218 | if s.Bucket == nil { | ||
13219 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
13220 | } | ||
13221 | |||
13222 | if invalidParams.Len() > 0 { | ||
13223 | return invalidParams | ||
13224 | } | ||
13225 | return nil | ||
13226 | } | ||
13227 | |||
13228 | // SetBucket sets the Bucket field's value. | ||
13229 | func (s *ListMultipartUploadsInput) SetBucket(v string) *ListMultipartUploadsInput { | ||
13230 | s.Bucket = &v | ||
13231 | return s | ||
13232 | } | ||
13233 | |||
13234 | // SetDelimiter sets the Delimiter field's value. | ||
13235 | func (s *ListMultipartUploadsInput) SetDelimiter(v string) *ListMultipartUploadsInput { | ||
13236 | s.Delimiter = &v | ||
13237 | return s | ||
13238 | } | ||
13239 | |||
13240 | // SetEncodingType sets the EncodingType field's value. | ||
13241 | func (s *ListMultipartUploadsInput) SetEncodingType(v string) *ListMultipartUploadsInput { | ||
13242 | s.EncodingType = &v | ||
13243 | return s | ||
13244 | } | ||
13245 | |||
13246 | // SetKeyMarker sets the KeyMarker field's value. | ||
13247 | func (s *ListMultipartUploadsInput) SetKeyMarker(v string) *ListMultipartUploadsInput { | ||
13248 | s.KeyMarker = &v | ||
13249 | return s | ||
13250 | } | ||
13251 | |||
13252 | // SetMaxUploads sets the MaxUploads field's value. | ||
13253 | func (s *ListMultipartUploadsInput) SetMaxUploads(v int64) *ListMultipartUploadsInput { | ||
13254 | s.MaxUploads = &v | ||
13255 | return s | ||
13256 | } | ||
13257 | |||
13258 | // SetPrefix sets the Prefix field's value. | ||
13259 | func (s *ListMultipartUploadsInput) SetPrefix(v string) *ListMultipartUploadsInput { | ||
13260 | s.Prefix = &v | ||
13261 | return s | ||
13262 | } | ||
13263 | |||
13264 | // SetUploadIdMarker sets the UploadIdMarker field's value. | ||
13265 | func (s *ListMultipartUploadsInput) SetUploadIdMarker(v string) *ListMultipartUploadsInput { | ||
13266 | s.UploadIdMarker = &v | ||
13267 | return s | ||
13268 | } | ||
13269 | |||
13270 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListMultipartUploadsOutput | ||
13271 | type ListMultipartUploadsOutput struct { | ||
13272 | _ struct{} `type:"structure"` | ||
13273 | |||
13274 | // Name of the bucket to which the multipart upload was initiated. | ||
13275 | Bucket *string `type:"string"` | ||
13276 | |||
13277 | CommonPrefixes []*CommonPrefix `type:"list" flattened:"true"` | ||
13278 | |||
13279 | Delimiter *string `type:"string"` | ||
13280 | |||
13281 | // Encoding type used by Amazon S3 to encode object keys in the response. | ||
13282 | EncodingType *string `type:"string" enum:"EncodingType"` | ||
13283 | |||
13284 | // Indicates whether the returned list of multipart uploads is truncated. A | ||
13285 | // value of true indicates that the list was truncated. The list can be truncated | ||
13286 | // if the number of multipart uploads exceeds the limit allowed or specified | ||
13287 | // by max uploads. | ||
13288 | IsTruncated *bool `type:"boolean"` | ||
13289 | |||
13290 | // The key at or after which the listing began. | ||
13291 | KeyMarker *string `type:"string"` | ||
13292 | |||
13293 | // Maximum number of multipart uploads that could have been included in the | ||
13294 | // response. | ||
13295 | MaxUploads *int64 `type:"integer"` | ||
13296 | |||
13297 | // When a list is truncated, this element specifies the value that should be | ||
13298 | // used for the key-marker request parameter in a subsequent request. | ||
13299 | NextKeyMarker *string `type:"string"` | ||
13300 | |||
13301 | // When a list is truncated, this element specifies the value that should be | ||
13302 | // used for the upload-id-marker request parameter in a subsequent request. | ||
13303 | NextUploadIdMarker *string `type:"string"` | ||
13304 | |||
13305 | // When a prefix is provided in the request, this field contains the specified | ||
13306 | // prefix. The result contains only keys starting with the specified prefix. | ||
13307 | Prefix *string `type:"string"` | ||
13308 | |||
13309 | // Upload ID after which listing began. | ||
13310 | UploadIdMarker *string `type:"string"` | ||
13311 | |||
13312 | Uploads []*MultipartUpload `locationName:"Upload" type:"list" flattened:"true"` | ||
13313 | } | ||
13314 | |||
13315 | // String returns the string representation | ||
13316 | func (s ListMultipartUploadsOutput) String() string { | ||
13317 | return awsutil.Prettify(s) | ||
13318 | } | ||
13319 | |||
13320 | // GoString returns the string representation | ||
13321 | func (s ListMultipartUploadsOutput) GoString() string { | ||
13322 | return s.String() | ||
13323 | } | ||
13324 | |||
13325 | // SetBucket sets the Bucket field's value. | ||
13326 | func (s *ListMultipartUploadsOutput) SetBucket(v string) *ListMultipartUploadsOutput { | ||
13327 | s.Bucket = &v | ||
13328 | return s | ||
13329 | } | ||
13330 | |||
13331 | // SetCommonPrefixes sets the CommonPrefixes field's value. | ||
13332 | func (s *ListMultipartUploadsOutput) SetCommonPrefixes(v []*CommonPrefix) *ListMultipartUploadsOutput { | ||
13333 | s.CommonPrefixes = v | ||
13334 | return s | ||
13335 | } | ||
13336 | |||
13337 | // SetDelimiter sets the Delimiter field's value. | ||
13338 | func (s *ListMultipartUploadsOutput) SetDelimiter(v string) *ListMultipartUploadsOutput { | ||
13339 | s.Delimiter = &v | ||
13340 | return s | ||
13341 | } | ||
13342 | |||
13343 | // SetEncodingType sets the EncodingType field's value. | ||
13344 | func (s *ListMultipartUploadsOutput) SetEncodingType(v string) *ListMultipartUploadsOutput { | ||
13345 | s.EncodingType = &v | ||
13346 | return s | ||
13347 | } | ||
13348 | |||
13349 | // SetIsTruncated sets the IsTruncated field's value. | ||
13350 | func (s *ListMultipartUploadsOutput) SetIsTruncated(v bool) *ListMultipartUploadsOutput { | ||
13351 | s.IsTruncated = &v | ||
13352 | return s | ||
13353 | } | ||
13354 | |||
13355 | // SetKeyMarker sets the KeyMarker field's value. | ||
13356 | func (s *ListMultipartUploadsOutput) SetKeyMarker(v string) *ListMultipartUploadsOutput { | ||
13357 | s.KeyMarker = &v | ||
13358 | return s | ||
13359 | } | ||
13360 | |||
13361 | // SetMaxUploads sets the MaxUploads field's value. | ||
13362 | func (s *ListMultipartUploadsOutput) SetMaxUploads(v int64) *ListMultipartUploadsOutput { | ||
13363 | s.MaxUploads = &v | ||
13364 | return s | ||
13365 | } | ||
13366 | |||
13367 | // SetNextKeyMarker sets the NextKeyMarker field's value. | ||
13368 | func (s *ListMultipartUploadsOutput) SetNextKeyMarker(v string) *ListMultipartUploadsOutput { | ||
13369 | s.NextKeyMarker = &v | ||
13370 | return s | ||
13371 | } | ||
13372 | |||
13373 | // SetNextUploadIdMarker sets the NextUploadIdMarker field's value. | ||
13374 | func (s *ListMultipartUploadsOutput) SetNextUploadIdMarker(v string) *ListMultipartUploadsOutput { | ||
13375 | s.NextUploadIdMarker = &v | ||
13376 | return s | ||
13377 | } | ||
13378 | |||
13379 | // SetPrefix sets the Prefix field's value. | ||
13380 | func (s *ListMultipartUploadsOutput) SetPrefix(v string) *ListMultipartUploadsOutput { | ||
13381 | s.Prefix = &v | ||
13382 | return s | ||
13383 | } | ||
13384 | |||
13385 | // SetUploadIdMarker sets the UploadIdMarker field's value. | ||
13386 | func (s *ListMultipartUploadsOutput) SetUploadIdMarker(v string) *ListMultipartUploadsOutput { | ||
13387 | s.UploadIdMarker = &v | ||
13388 | return s | ||
13389 | } | ||
13390 | |||
13391 | // SetUploads sets the Uploads field's value. | ||
13392 | func (s *ListMultipartUploadsOutput) SetUploads(v []*MultipartUpload) *ListMultipartUploadsOutput { | ||
13393 | s.Uploads = v | ||
13394 | return s | ||
13395 | } | ||
13396 | |||
13397 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectVersionsRequest | ||
13398 | type ListObjectVersionsInput struct { | ||
13399 | _ struct{} `type:"structure"` | ||
13400 | |||
13401 | // Bucket is a required field | ||
13402 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
13403 | |||
13404 | // A delimiter is a character you use to group keys. | ||
13405 | Delimiter *string `location:"querystring" locationName:"delimiter" type:"string"` | ||
13406 | |||
13407 | // Requests Amazon S3 to encode the object keys in the response and specifies | ||
13408 | // the encoding method to use. An object key may contain any Unicode character; | ||
13409 | // however, XML 1.0 parser cannot parse some characters, such as characters | ||
13410 | // with an ASCII value from 0 to 10. For characters that are not supported in | ||
13411 | // XML 1.0, you can add this parameter to request that Amazon S3 encode the | ||
13412 | // keys in the response. | ||
13413 | EncodingType *string `location:"querystring" locationName:"encoding-type" type:"string" enum:"EncodingType"` | ||
13414 | |||
13415 | // Specifies the key to start with when listing objects in a bucket. | ||
13416 | KeyMarker *string `location:"querystring" locationName:"key-marker" type:"string"` | ||
13417 | |||
13418 | // Sets the maximum number of keys returned in the response. The response might | ||
13419 | // contain fewer keys but will never contain more. | ||
13420 | MaxKeys *int64 `location:"querystring" locationName:"max-keys" type:"integer"` | ||
13421 | |||
13422 | // Limits the response to keys that begin with the specified prefix. | ||
13423 | Prefix *string `location:"querystring" locationName:"prefix" type:"string"` | ||
13424 | |||
13425 | // Specifies the object version you want to start listing from. | ||
13426 | VersionIdMarker *string `location:"querystring" locationName:"version-id-marker" type:"string"` | ||
13427 | } | ||
13428 | |||
13429 | // String returns the string representation | ||
13430 | func (s ListObjectVersionsInput) String() string { | ||
13431 | return awsutil.Prettify(s) | ||
13432 | } | ||
13433 | |||
13434 | // GoString returns the string representation | ||
13435 | func (s ListObjectVersionsInput) GoString() string { | ||
13436 | return s.String() | ||
13437 | } | ||
13438 | |||
13439 | // Validate inspects the fields of the type to determine if they are valid. | ||
13440 | func (s *ListObjectVersionsInput) Validate() error { | ||
13441 | invalidParams := request.ErrInvalidParams{Context: "ListObjectVersionsInput"} | ||
13442 | if s.Bucket == nil { | ||
13443 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
13444 | } | ||
13445 | |||
13446 | if invalidParams.Len() > 0 { | ||
13447 | return invalidParams | ||
13448 | } | ||
13449 | return nil | ||
13450 | } | ||
13451 | |||
13452 | // SetBucket sets the Bucket field's value. | ||
13453 | func (s *ListObjectVersionsInput) SetBucket(v string) *ListObjectVersionsInput { | ||
13454 | s.Bucket = &v | ||
13455 | return s | ||
13456 | } | ||
13457 | |||
13458 | // SetDelimiter sets the Delimiter field's value. | ||
13459 | func (s *ListObjectVersionsInput) SetDelimiter(v string) *ListObjectVersionsInput { | ||
13460 | s.Delimiter = &v | ||
13461 | return s | ||
13462 | } | ||
13463 | |||
13464 | // SetEncodingType sets the EncodingType field's value. | ||
13465 | func (s *ListObjectVersionsInput) SetEncodingType(v string) *ListObjectVersionsInput { | ||
13466 | s.EncodingType = &v | ||
13467 | return s | ||
13468 | } | ||
13469 | |||
13470 | // SetKeyMarker sets the KeyMarker field's value. | ||
13471 | func (s *ListObjectVersionsInput) SetKeyMarker(v string) *ListObjectVersionsInput { | ||
13472 | s.KeyMarker = &v | ||
13473 | return s | ||
13474 | } | ||
13475 | |||
13476 | // SetMaxKeys sets the MaxKeys field's value. | ||
13477 | func (s *ListObjectVersionsInput) SetMaxKeys(v int64) *ListObjectVersionsInput { | ||
13478 | s.MaxKeys = &v | ||
13479 | return s | ||
13480 | } | ||
13481 | |||
13482 | // SetPrefix sets the Prefix field's value. | ||
13483 | func (s *ListObjectVersionsInput) SetPrefix(v string) *ListObjectVersionsInput { | ||
13484 | s.Prefix = &v | ||
13485 | return s | ||
13486 | } | ||
13487 | |||
13488 | // SetVersionIdMarker sets the VersionIdMarker field's value. | ||
13489 | func (s *ListObjectVersionsInput) SetVersionIdMarker(v string) *ListObjectVersionsInput { | ||
13490 | s.VersionIdMarker = &v | ||
13491 | return s | ||
13492 | } | ||
13493 | |||
13494 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectVersionsOutput | ||
13495 | type ListObjectVersionsOutput struct { | ||
13496 | _ struct{} `type:"structure"` | ||
13497 | |||
13498 | CommonPrefixes []*CommonPrefix `type:"list" flattened:"true"` | ||
13499 | |||
13500 | DeleteMarkers []*DeleteMarkerEntry `locationName:"DeleteMarker" type:"list" flattened:"true"` | ||
13501 | |||
13502 | Delimiter *string `type:"string"` | ||
13503 | |||
13504 | // Encoding type used by Amazon S3 to encode object keys in the response. | ||
13505 | EncodingType *string `type:"string" enum:"EncodingType"` | ||
13506 | |||
13507 | // A flag that indicates whether or not Amazon S3 returned all of the results | ||
13508 | // that satisfied the search criteria. If your results were truncated, you can | ||
13509 | // make a follow-up paginated request using the NextKeyMarker and NextVersionIdMarker | ||
13510 | // response parameters as a starting place in another request to return the | ||
13511 | // rest of the results. | ||
13512 | IsTruncated *bool `type:"boolean"` | ||
13513 | |||
13514 | // Marks the last Key returned in a truncated response. | ||
13515 | KeyMarker *string `type:"string"` | ||
13516 | |||
13517 | MaxKeys *int64 `type:"integer"` | ||
13518 | |||
13519 | Name *string `type:"string"` | ||
13520 | |||
13521 | // Use this value for the key marker request parameter in a subsequent request. | ||
13522 | NextKeyMarker *string `type:"string"` | ||
13523 | |||
13524 | // Use this value for the next version id marker parameter in a subsequent request. | ||
13525 | NextVersionIdMarker *string `type:"string"` | ||
13526 | |||
13527 | Prefix *string `type:"string"` | ||
13528 | |||
13529 | VersionIdMarker *string `type:"string"` | ||
13530 | |||
13531 | Versions []*ObjectVersion `locationName:"Version" type:"list" flattened:"true"` | ||
13532 | } | ||
13533 | |||
13534 | // String returns the string representation | ||
13535 | func (s ListObjectVersionsOutput) String() string { | ||
13536 | return awsutil.Prettify(s) | ||
13537 | } | ||
13538 | |||
13539 | // GoString returns the string representation | ||
13540 | func (s ListObjectVersionsOutput) GoString() string { | ||
13541 | return s.String() | ||
13542 | } | ||
13543 | |||
13544 | // SetCommonPrefixes sets the CommonPrefixes field's value. | ||
13545 | func (s *ListObjectVersionsOutput) SetCommonPrefixes(v []*CommonPrefix) *ListObjectVersionsOutput { | ||
13546 | s.CommonPrefixes = v | ||
13547 | return s | ||
13548 | } | ||
13549 | |||
13550 | // SetDeleteMarkers sets the DeleteMarkers field's value. | ||
13551 | func (s *ListObjectVersionsOutput) SetDeleteMarkers(v []*DeleteMarkerEntry) *ListObjectVersionsOutput { | ||
13552 | s.DeleteMarkers = v | ||
13553 | return s | ||
13554 | } | ||
13555 | |||
13556 | // SetDelimiter sets the Delimiter field's value. | ||
13557 | func (s *ListObjectVersionsOutput) SetDelimiter(v string) *ListObjectVersionsOutput { | ||
13558 | s.Delimiter = &v | ||
13559 | return s | ||
13560 | } | ||
13561 | |||
13562 | // SetEncodingType sets the EncodingType field's value. | ||
13563 | func (s *ListObjectVersionsOutput) SetEncodingType(v string) *ListObjectVersionsOutput { | ||
13564 | s.EncodingType = &v | ||
13565 | return s | ||
13566 | } | ||
13567 | |||
13568 | // SetIsTruncated sets the IsTruncated field's value. | ||
13569 | func (s *ListObjectVersionsOutput) SetIsTruncated(v bool) *ListObjectVersionsOutput { | ||
13570 | s.IsTruncated = &v | ||
13571 | return s | ||
13572 | } | ||
13573 | |||
13574 | // SetKeyMarker sets the KeyMarker field's value. | ||
13575 | func (s *ListObjectVersionsOutput) SetKeyMarker(v string) *ListObjectVersionsOutput { | ||
13576 | s.KeyMarker = &v | ||
13577 | return s | ||
13578 | } | ||
13579 | |||
13580 | // SetMaxKeys sets the MaxKeys field's value. | ||
13581 | func (s *ListObjectVersionsOutput) SetMaxKeys(v int64) *ListObjectVersionsOutput { | ||
13582 | s.MaxKeys = &v | ||
13583 | return s | ||
13584 | } | ||
13585 | |||
13586 | // SetName sets the Name field's value. | ||
13587 | func (s *ListObjectVersionsOutput) SetName(v string) *ListObjectVersionsOutput { | ||
13588 | s.Name = &v | ||
13589 | return s | ||
13590 | } | ||
13591 | |||
13592 | // SetNextKeyMarker sets the NextKeyMarker field's value. | ||
13593 | func (s *ListObjectVersionsOutput) SetNextKeyMarker(v string) *ListObjectVersionsOutput { | ||
13594 | s.NextKeyMarker = &v | ||
13595 | return s | ||
13596 | } | ||
13597 | |||
13598 | // SetNextVersionIdMarker sets the NextVersionIdMarker field's value. | ||
13599 | func (s *ListObjectVersionsOutput) SetNextVersionIdMarker(v string) *ListObjectVersionsOutput { | ||
13600 | s.NextVersionIdMarker = &v | ||
13601 | return s | ||
13602 | } | ||
13603 | |||
13604 | // SetPrefix sets the Prefix field's value. | ||
13605 | func (s *ListObjectVersionsOutput) SetPrefix(v string) *ListObjectVersionsOutput { | ||
13606 | s.Prefix = &v | ||
13607 | return s | ||
13608 | } | ||
13609 | |||
13610 | // SetVersionIdMarker sets the VersionIdMarker field's value. | ||
13611 | func (s *ListObjectVersionsOutput) SetVersionIdMarker(v string) *ListObjectVersionsOutput { | ||
13612 | s.VersionIdMarker = &v | ||
13613 | return s | ||
13614 | } | ||
13615 | |||
13616 | // SetVersions sets the Versions field's value. | ||
13617 | func (s *ListObjectVersionsOutput) SetVersions(v []*ObjectVersion) *ListObjectVersionsOutput { | ||
13618 | s.Versions = v | ||
13619 | return s | ||
13620 | } | ||
13621 | |||
13622 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectsRequest | ||
13623 | type ListObjectsInput struct { | ||
13624 | _ struct{} `type:"structure"` | ||
13625 | |||
13626 | // Bucket is a required field | ||
13627 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
13628 | |||
13629 | // A delimiter is a character you use to group keys. | ||
13630 | Delimiter *string `location:"querystring" locationName:"delimiter" type:"string"` | ||
13631 | |||
13632 | // Requests Amazon S3 to encode the object keys in the response and specifies | ||
13633 | // the encoding method to use. An object key may contain any Unicode character; | ||
13634 | // however, XML 1.0 parser cannot parse some characters, such as characters | ||
13635 | // with an ASCII value from 0 to 10. For characters that are not supported in | ||
13636 | // XML 1.0, you can add this parameter to request that Amazon S3 encode the | ||
13637 | // keys in the response. | ||
13638 | EncodingType *string `location:"querystring" locationName:"encoding-type" type:"string" enum:"EncodingType"` | ||
13639 | |||
13640 | // Specifies the key to start with when listing objects in a bucket. | ||
13641 | Marker *string `location:"querystring" locationName:"marker" type:"string"` | ||
13642 | |||
13643 | // Sets the maximum number of keys returned in the response. The response might | ||
13644 | // contain fewer keys but will never contain more. | ||
13645 | MaxKeys *int64 `location:"querystring" locationName:"max-keys" type:"integer"` | ||
13646 | |||
13647 | // Limits the response to keys that begin with the specified prefix. | ||
13648 | Prefix *string `location:"querystring" locationName:"prefix" type:"string"` | ||
13649 | |||
13650 | // Confirms that the requester knows that she or he will be charged for the | ||
13651 | // list objects request. Bucket owners need not specify this parameter in their | ||
13652 | // requests. | ||
13653 | RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` | ||
13654 | } | ||
13655 | |||
13656 | // String returns the string representation | ||
13657 | func (s ListObjectsInput) String() string { | ||
13658 | return awsutil.Prettify(s) | ||
13659 | } | ||
13660 | |||
13661 | // GoString returns the string representation | ||
13662 | func (s ListObjectsInput) GoString() string { | ||
13663 | return s.String() | ||
13664 | } | ||
13665 | |||
13666 | // Validate inspects the fields of the type to determine if they are valid. | ||
13667 | func (s *ListObjectsInput) Validate() error { | ||
13668 | invalidParams := request.ErrInvalidParams{Context: "ListObjectsInput"} | ||
13669 | if s.Bucket == nil { | ||
13670 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
13671 | } | ||
13672 | |||
13673 | if invalidParams.Len() > 0 { | ||
13674 | return invalidParams | ||
13675 | } | ||
13676 | return nil | ||
13677 | } | ||
13678 | |||
13679 | // SetBucket sets the Bucket field's value. | ||
13680 | func (s *ListObjectsInput) SetBucket(v string) *ListObjectsInput { | ||
13681 | s.Bucket = &v | ||
13682 | return s | ||
13683 | } | ||
13684 | |||
13685 | // SetDelimiter sets the Delimiter field's value. | ||
13686 | func (s *ListObjectsInput) SetDelimiter(v string) *ListObjectsInput { | ||
13687 | s.Delimiter = &v | ||
13688 | return s | ||
13689 | } | ||
13690 | |||
13691 | // SetEncodingType sets the EncodingType field's value. | ||
13692 | func (s *ListObjectsInput) SetEncodingType(v string) *ListObjectsInput { | ||
13693 | s.EncodingType = &v | ||
13694 | return s | ||
13695 | } | ||
13696 | |||
13697 | // SetMarker sets the Marker field's value. | ||
13698 | func (s *ListObjectsInput) SetMarker(v string) *ListObjectsInput { | ||
13699 | s.Marker = &v | ||
13700 | return s | ||
13701 | } | ||
13702 | |||
13703 | // SetMaxKeys sets the MaxKeys field's value. | ||
13704 | func (s *ListObjectsInput) SetMaxKeys(v int64) *ListObjectsInput { | ||
13705 | s.MaxKeys = &v | ||
13706 | return s | ||
13707 | } | ||
13708 | |||
13709 | // SetPrefix sets the Prefix field's value. | ||
13710 | func (s *ListObjectsInput) SetPrefix(v string) *ListObjectsInput { | ||
13711 | s.Prefix = &v | ||
13712 | return s | ||
13713 | } | ||
13714 | |||
13715 | // SetRequestPayer sets the RequestPayer field's value. | ||
13716 | func (s *ListObjectsInput) SetRequestPayer(v string) *ListObjectsInput { | ||
13717 | s.RequestPayer = &v | ||
13718 | return s | ||
13719 | } | ||
13720 | |||
13721 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectsOutput | ||
13722 | type ListObjectsOutput struct { | ||
13723 | _ struct{} `type:"structure"` | ||
13724 | |||
13725 | CommonPrefixes []*CommonPrefix `type:"list" flattened:"true"` | ||
13726 | |||
13727 | Contents []*Object `type:"list" flattened:"true"` | ||
13728 | |||
13729 | Delimiter *string `type:"string"` | ||
13730 | |||
13731 | // Encoding type used by Amazon S3 to encode object keys in the response. | ||
13732 | EncodingType *string `type:"string" enum:"EncodingType"` | ||
13733 | |||
13734 | // A flag that indicates whether or not Amazon S3 returned all of the results | ||
13735 | // that satisfied the search criteria. | ||
13736 | IsTruncated *bool `type:"boolean"` | ||
13737 | |||
13738 | Marker *string `type:"string"` | ||
13739 | |||
13740 | MaxKeys *int64 `type:"integer"` | ||
13741 | |||
13742 | Name *string `type:"string"` | ||
13743 | |||
13744 | // When response is truncated (the IsTruncated element value in the response | ||
13745 | // is true), you can use the key name in this field as marker in the subsequent | ||
13746 | // request to get next set of objects. Amazon S3 lists objects in alphabetical | ||
13747 | // order Note: This element is returned only if you have delimiter request parameter | ||
13748 | // specified. If response does not include the NextMaker and it is truncated, | ||
13749 | // you can use the value of the last Key in the response as the marker in the | ||
13750 | // subsequent request to get the next set of object keys. | ||
13751 | NextMarker *string `type:"string"` | ||
13752 | |||
13753 | Prefix *string `type:"string"` | ||
13754 | } | ||
13755 | |||
13756 | // String returns the string representation | ||
13757 | func (s ListObjectsOutput) String() string { | ||
13758 | return awsutil.Prettify(s) | ||
13759 | } | ||
13760 | |||
13761 | // GoString returns the string representation | ||
13762 | func (s ListObjectsOutput) GoString() string { | ||
13763 | return s.String() | ||
13764 | } | ||
13765 | |||
13766 | // SetCommonPrefixes sets the CommonPrefixes field's value. | ||
13767 | func (s *ListObjectsOutput) SetCommonPrefixes(v []*CommonPrefix) *ListObjectsOutput { | ||
13768 | s.CommonPrefixes = v | ||
13769 | return s | ||
13770 | } | ||
13771 | |||
13772 | // SetContents sets the Contents field's value. | ||
13773 | func (s *ListObjectsOutput) SetContents(v []*Object) *ListObjectsOutput { | ||
13774 | s.Contents = v | ||
13775 | return s | ||
13776 | } | ||
13777 | |||
13778 | // SetDelimiter sets the Delimiter field's value. | ||
13779 | func (s *ListObjectsOutput) SetDelimiter(v string) *ListObjectsOutput { | ||
13780 | s.Delimiter = &v | ||
13781 | return s | ||
13782 | } | ||
13783 | |||
13784 | // SetEncodingType sets the EncodingType field's value. | ||
13785 | func (s *ListObjectsOutput) SetEncodingType(v string) *ListObjectsOutput { | ||
13786 | s.EncodingType = &v | ||
13787 | return s | ||
13788 | } | ||
13789 | |||
13790 | // SetIsTruncated sets the IsTruncated field's value. | ||
13791 | func (s *ListObjectsOutput) SetIsTruncated(v bool) *ListObjectsOutput { | ||
13792 | s.IsTruncated = &v | ||
13793 | return s | ||
13794 | } | ||
13795 | |||
13796 | // SetMarker sets the Marker field's value. | ||
13797 | func (s *ListObjectsOutput) SetMarker(v string) *ListObjectsOutput { | ||
13798 | s.Marker = &v | ||
13799 | return s | ||
13800 | } | ||
13801 | |||
13802 | // SetMaxKeys sets the MaxKeys field's value. | ||
13803 | func (s *ListObjectsOutput) SetMaxKeys(v int64) *ListObjectsOutput { | ||
13804 | s.MaxKeys = &v | ||
13805 | return s | ||
13806 | } | ||
13807 | |||
13808 | // SetName sets the Name field's value. | ||
13809 | func (s *ListObjectsOutput) SetName(v string) *ListObjectsOutput { | ||
13810 | s.Name = &v | ||
13811 | return s | ||
13812 | } | ||
13813 | |||
13814 | // SetNextMarker sets the NextMarker field's value. | ||
13815 | func (s *ListObjectsOutput) SetNextMarker(v string) *ListObjectsOutput { | ||
13816 | s.NextMarker = &v | ||
13817 | return s | ||
13818 | } | ||
13819 | |||
13820 | // SetPrefix sets the Prefix field's value. | ||
13821 | func (s *ListObjectsOutput) SetPrefix(v string) *ListObjectsOutput { | ||
13822 | s.Prefix = &v | ||
13823 | return s | ||
13824 | } | ||
13825 | |||
13826 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectsV2Request | ||
13827 | type ListObjectsV2Input struct { | ||
13828 | _ struct{} `type:"structure"` | ||
13829 | |||
13830 | // Name of the bucket to list. | ||
13831 | // | ||
13832 | // Bucket is a required field | ||
13833 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
13834 | |||
13835 | // ContinuationToken indicates Amazon S3 that the list is being continued on | ||
13836 | // this bucket with a token. ContinuationToken is obfuscated and is not a real | ||
13837 | // key | ||
13838 | ContinuationToken *string `location:"querystring" locationName:"continuation-token" type:"string"` | ||
13839 | |||
13840 | // A delimiter is a character you use to group keys. | ||
13841 | Delimiter *string `location:"querystring" locationName:"delimiter" type:"string"` | ||
13842 | |||
13843 | // Encoding type used by Amazon S3 to encode object keys in the response. | ||
13844 | EncodingType *string `location:"querystring" locationName:"encoding-type" type:"string" enum:"EncodingType"` | ||
13845 | |||
13846 | // The owner field is not present in listV2 by default, if you want to return | ||
13847 | // owner field with each key in the result then set the fetch owner field to | ||
13848 | // true | ||
13849 | FetchOwner *bool `location:"querystring" locationName:"fetch-owner" type:"boolean"` | ||
13850 | |||
13851 | // Sets the maximum number of keys returned in the response. The response might | ||
13852 | // contain fewer keys but will never contain more. | ||
13853 | MaxKeys *int64 `location:"querystring" locationName:"max-keys" type:"integer"` | ||
13854 | |||
13855 | // Limits the response to keys that begin with the specified prefix. | ||
13856 | Prefix *string `location:"querystring" locationName:"prefix" type:"string"` | ||
13857 | |||
13858 | // Confirms that the requester knows that she or he will be charged for the | ||
13859 | // list objects request in V2 style. Bucket owners need not specify this parameter | ||
13860 | // in their requests. | ||
13861 | RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` | ||
13862 | |||
13863 | // StartAfter is where you want Amazon S3 to start listing from. Amazon S3 starts | ||
13864 | // listing after this specified key. StartAfter can be any key in the bucket | ||
13865 | StartAfter *string `location:"querystring" locationName:"start-after" type:"string"` | ||
13866 | } | ||
13867 | |||
13868 | // String returns the string representation | ||
13869 | func (s ListObjectsV2Input) String() string { | ||
13870 | return awsutil.Prettify(s) | ||
13871 | } | ||
13872 | |||
13873 | // GoString returns the string representation | ||
13874 | func (s ListObjectsV2Input) GoString() string { | ||
13875 | return s.String() | ||
13876 | } | ||
13877 | |||
13878 | // Validate inspects the fields of the type to determine if they are valid. | ||
13879 | func (s *ListObjectsV2Input) Validate() error { | ||
13880 | invalidParams := request.ErrInvalidParams{Context: "ListObjectsV2Input"} | ||
13881 | if s.Bucket == nil { | ||
13882 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
13883 | } | ||
13884 | |||
13885 | if invalidParams.Len() > 0 { | ||
13886 | return invalidParams | ||
13887 | } | ||
13888 | return nil | ||
13889 | } | ||
13890 | |||
13891 | // SetBucket sets the Bucket field's value. | ||
13892 | func (s *ListObjectsV2Input) SetBucket(v string) *ListObjectsV2Input { | ||
13893 | s.Bucket = &v | ||
13894 | return s | ||
13895 | } | ||
13896 | |||
13897 | // SetContinuationToken sets the ContinuationToken field's value. | ||
13898 | func (s *ListObjectsV2Input) SetContinuationToken(v string) *ListObjectsV2Input { | ||
13899 | s.ContinuationToken = &v | ||
13900 | return s | ||
13901 | } | ||
13902 | |||
13903 | // SetDelimiter sets the Delimiter field's value. | ||
13904 | func (s *ListObjectsV2Input) SetDelimiter(v string) *ListObjectsV2Input { | ||
13905 | s.Delimiter = &v | ||
13906 | return s | ||
13907 | } | ||
13908 | |||
13909 | // SetEncodingType sets the EncodingType field's value. | ||
13910 | func (s *ListObjectsV2Input) SetEncodingType(v string) *ListObjectsV2Input { | ||
13911 | s.EncodingType = &v | ||
13912 | return s | ||
13913 | } | ||
13914 | |||
13915 | // SetFetchOwner sets the FetchOwner field's value. | ||
13916 | func (s *ListObjectsV2Input) SetFetchOwner(v bool) *ListObjectsV2Input { | ||
13917 | s.FetchOwner = &v | ||
13918 | return s | ||
13919 | } | ||
13920 | |||
13921 | // SetMaxKeys sets the MaxKeys field's value. | ||
13922 | func (s *ListObjectsV2Input) SetMaxKeys(v int64) *ListObjectsV2Input { | ||
13923 | s.MaxKeys = &v | ||
13924 | return s | ||
13925 | } | ||
13926 | |||
13927 | // SetPrefix sets the Prefix field's value. | ||
13928 | func (s *ListObjectsV2Input) SetPrefix(v string) *ListObjectsV2Input { | ||
13929 | s.Prefix = &v | ||
13930 | return s | ||
13931 | } | ||
13932 | |||
13933 | // SetRequestPayer sets the RequestPayer field's value. | ||
13934 | func (s *ListObjectsV2Input) SetRequestPayer(v string) *ListObjectsV2Input { | ||
13935 | s.RequestPayer = &v | ||
13936 | return s | ||
13937 | } | ||
13938 | |||
13939 | // SetStartAfter sets the StartAfter field's value. | ||
13940 | func (s *ListObjectsV2Input) SetStartAfter(v string) *ListObjectsV2Input { | ||
13941 | s.StartAfter = &v | ||
13942 | return s | ||
13943 | } | ||
13944 | |||
13945 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectsV2Output | ||
13946 | type ListObjectsV2Output struct { | ||
13947 | _ struct{} `type:"structure"` | ||
13948 | |||
13949 | // CommonPrefixes contains all (if there are any) keys between Prefix and the | ||
13950 | // next occurrence of the string specified by delimiter | ||
13951 | CommonPrefixes []*CommonPrefix `type:"list" flattened:"true"` | ||
13952 | |||
13953 | // Metadata about each object returned. | ||
13954 | Contents []*Object `type:"list" flattened:"true"` | ||
13955 | |||
13956 | // ContinuationToken indicates Amazon S3 that the list is being continued on | ||
13957 | // this bucket with a token. ContinuationToken is obfuscated and is not a real | ||
13958 | // key | ||
13959 | ContinuationToken *string `type:"string"` | ||
13960 | |||
13961 | // A delimiter is a character you use to group keys. | ||
13962 | Delimiter *string `type:"string"` | ||
13963 | |||
13964 | // Encoding type used by Amazon S3 to encode object keys in the response. | ||
13965 | EncodingType *string `type:"string" enum:"EncodingType"` | ||
13966 | |||
13967 | // A flag that indicates whether or not Amazon S3 returned all of the results | ||
13968 | // that satisfied the search criteria. | ||
13969 | IsTruncated *bool `type:"boolean"` | ||
13970 | |||
13971 | // KeyCount is the number of keys returned with this request. KeyCount will | ||
13972 | // always be less than equals to MaxKeys field. Say you ask for 50 keys, your | ||
13973 | // result will include less than equals 50 keys | ||
13974 | KeyCount *int64 `type:"integer"` | ||
13975 | |||
13976 | // Sets the maximum number of keys returned in the response. The response might | ||
13977 | // contain fewer keys but will never contain more. | ||
13978 | MaxKeys *int64 `type:"integer"` | ||
13979 | |||
13980 | // Name of the bucket to list. | ||
13981 | Name *string `type:"string"` | ||
13982 | |||
13983 | // NextContinuationToken is sent when isTruncated is true which means there | ||
13984 | // are more keys in the bucket that can be listed. The next list requests to | ||
13985 | // Amazon S3 can be continued with this NextContinuationToken. NextContinuationToken | ||
13986 | // is obfuscated and is not a real key | ||
13987 | NextContinuationToken *string `type:"string"` | ||
13988 | |||
13989 | // Limits the response to keys that begin with the specified prefix. | ||
13990 | Prefix *string `type:"string"` | ||
13991 | |||
13992 | // StartAfter is where you want Amazon S3 to start listing from. Amazon S3 starts | ||
13993 | // listing after this specified key. StartAfter can be any key in the bucket | ||
13994 | StartAfter *string `type:"string"` | ||
13995 | } | ||
13996 | |||
13997 | // String returns the string representation | ||
13998 | func (s ListObjectsV2Output) String() string { | ||
13999 | return awsutil.Prettify(s) | ||
14000 | } | ||
14001 | |||
14002 | // GoString returns the string representation | ||
14003 | func (s ListObjectsV2Output) GoString() string { | ||
14004 | return s.String() | ||
14005 | } | ||
14006 | |||
14007 | // SetCommonPrefixes sets the CommonPrefixes field's value. | ||
14008 | func (s *ListObjectsV2Output) SetCommonPrefixes(v []*CommonPrefix) *ListObjectsV2Output { | ||
14009 | s.CommonPrefixes = v | ||
14010 | return s | ||
14011 | } | ||
14012 | |||
14013 | // SetContents sets the Contents field's value. | ||
14014 | func (s *ListObjectsV2Output) SetContents(v []*Object) *ListObjectsV2Output { | ||
14015 | s.Contents = v | ||
14016 | return s | ||
14017 | } | ||
14018 | |||
14019 | // SetContinuationToken sets the ContinuationToken field's value. | ||
14020 | func (s *ListObjectsV2Output) SetContinuationToken(v string) *ListObjectsV2Output { | ||
14021 | s.ContinuationToken = &v | ||
14022 | return s | ||
14023 | } | ||
14024 | |||
14025 | // SetDelimiter sets the Delimiter field's value. | ||
14026 | func (s *ListObjectsV2Output) SetDelimiter(v string) *ListObjectsV2Output { | ||
14027 | s.Delimiter = &v | ||
14028 | return s | ||
14029 | } | ||
14030 | |||
14031 | // SetEncodingType sets the EncodingType field's value. | ||
14032 | func (s *ListObjectsV2Output) SetEncodingType(v string) *ListObjectsV2Output { | ||
14033 | s.EncodingType = &v | ||
14034 | return s | ||
14035 | } | ||
14036 | |||
14037 | // SetIsTruncated sets the IsTruncated field's value. | ||
14038 | func (s *ListObjectsV2Output) SetIsTruncated(v bool) *ListObjectsV2Output { | ||
14039 | s.IsTruncated = &v | ||
14040 | return s | ||
14041 | } | ||
14042 | |||
14043 | // SetKeyCount sets the KeyCount field's value. | ||
14044 | func (s *ListObjectsV2Output) SetKeyCount(v int64) *ListObjectsV2Output { | ||
14045 | s.KeyCount = &v | ||
14046 | return s | ||
14047 | } | ||
14048 | |||
14049 | // SetMaxKeys sets the MaxKeys field's value. | ||
14050 | func (s *ListObjectsV2Output) SetMaxKeys(v int64) *ListObjectsV2Output { | ||
14051 | s.MaxKeys = &v | ||
14052 | return s | ||
14053 | } | ||
14054 | |||
14055 | // SetName sets the Name field's value. | ||
14056 | func (s *ListObjectsV2Output) SetName(v string) *ListObjectsV2Output { | ||
14057 | s.Name = &v | ||
14058 | return s | ||
14059 | } | ||
14060 | |||
14061 | // SetNextContinuationToken sets the NextContinuationToken field's value. | ||
14062 | func (s *ListObjectsV2Output) SetNextContinuationToken(v string) *ListObjectsV2Output { | ||
14063 | s.NextContinuationToken = &v | ||
14064 | return s | ||
14065 | } | ||
14066 | |||
14067 | // SetPrefix sets the Prefix field's value. | ||
14068 | func (s *ListObjectsV2Output) SetPrefix(v string) *ListObjectsV2Output { | ||
14069 | s.Prefix = &v | ||
14070 | return s | ||
14071 | } | ||
14072 | |||
14073 | // SetStartAfter sets the StartAfter field's value. | ||
14074 | func (s *ListObjectsV2Output) SetStartAfter(v string) *ListObjectsV2Output { | ||
14075 | s.StartAfter = &v | ||
14076 | return s | ||
14077 | } | ||
14078 | |||
14079 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListPartsRequest | ||
14080 | type ListPartsInput struct { | ||
14081 | _ struct{} `type:"structure"` | ||
14082 | |||
14083 | // Bucket is a required field | ||
14084 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
14085 | |||
14086 | // Key is a required field | ||
14087 | Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` | ||
14088 | |||
14089 | // Sets the maximum number of parts to return. | ||
14090 | MaxParts *int64 `location:"querystring" locationName:"max-parts" type:"integer"` | ||
14091 | |||
14092 | // Specifies the part after which listing should begin. Only parts with higher | ||
14093 | // part numbers will be listed. | ||
14094 | PartNumberMarker *int64 `location:"querystring" locationName:"part-number-marker" type:"integer"` | ||
14095 | |||
14096 | // Confirms that the requester knows that she or he will be charged for the | ||
14097 | // request. Bucket owners need not specify this parameter in their requests. | ||
14098 | // Documentation on downloading objects from requester pays buckets can be found | ||
14099 | // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html | ||
14100 | RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` | ||
14101 | |||
14102 | // Upload ID identifying the multipart upload whose parts are being listed. | ||
14103 | // | ||
14104 | // UploadId is a required field | ||
14105 | UploadId *string `location:"querystring" locationName:"uploadId" type:"string" required:"true"` | ||
14106 | } | ||
14107 | |||
14108 | // String returns the string representation | ||
14109 | func (s ListPartsInput) String() string { | ||
14110 | return awsutil.Prettify(s) | ||
14111 | } | ||
14112 | |||
14113 | // GoString returns the string representation | ||
14114 | func (s ListPartsInput) GoString() string { | ||
14115 | return s.String() | ||
14116 | } | ||
14117 | |||
14118 | // Validate inspects the fields of the type to determine if they are valid. | ||
14119 | func (s *ListPartsInput) Validate() error { | ||
14120 | invalidParams := request.ErrInvalidParams{Context: "ListPartsInput"} | ||
14121 | if s.Bucket == nil { | ||
14122 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
14123 | } | ||
14124 | if s.Key == nil { | ||
14125 | invalidParams.Add(request.NewErrParamRequired("Key")) | ||
14126 | } | ||
14127 | if s.Key != nil && len(*s.Key) < 1 { | ||
14128 | invalidParams.Add(request.NewErrParamMinLen("Key", 1)) | ||
14129 | } | ||
14130 | if s.UploadId == nil { | ||
14131 | invalidParams.Add(request.NewErrParamRequired("UploadId")) | ||
14132 | } | ||
14133 | |||
14134 | if invalidParams.Len() > 0 { | ||
14135 | return invalidParams | ||
14136 | } | ||
14137 | return nil | ||
14138 | } | ||
14139 | |||
14140 | // SetBucket sets the Bucket field's value. | ||
14141 | func (s *ListPartsInput) SetBucket(v string) *ListPartsInput { | ||
14142 | s.Bucket = &v | ||
14143 | return s | ||
14144 | } | ||
14145 | |||
14146 | // SetKey sets the Key field's value. | ||
14147 | func (s *ListPartsInput) SetKey(v string) *ListPartsInput { | ||
14148 | s.Key = &v | ||
14149 | return s | ||
14150 | } | ||
14151 | |||
14152 | // SetMaxParts sets the MaxParts field's value. | ||
14153 | func (s *ListPartsInput) SetMaxParts(v int64) *ListPartsInput { | ||
14154 | s.MaxParts = &v | ||
14155 | return s | ||
14156 | } | ||
14157 | |||
14158 | // SetPartNumberMarker sets the PartNumberMarker field's value. | ||
14159 | func (s *ListPartsInput) SetPartNumberMarker(v int64) *ListPartsInput { | ||
14160 | s.PartNumberMarker = &v | ||
14161 | return s | ||
14162 | } | ||
14163 | |||
14164 | // SetRequestPayer sets the RequestPayer field's value. | ||
14165 | func (s *ListPartsInput) SetRequestPayer(v string) *ListPartsInput { | ||
14166 | s.RequestPayer = &v | ||
14167 | return s | ||
14168 | } | ||
14169 | |||
14170 | // SetUploadId sets the UploadId field's value. | ||
14171 | func (s *ListPartsInput) SetUploadId(v string) *ListPartsInput { | ||
14172 | s.UploadId = &v | ||
14173 | return s | ||
14174 | } | ||
14175 | |||
14176 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListPartsOutput | ||
14177 | type ListPartsOutput struct { | ||
14178 | _ struct{} `type:"structure"` | ||
14179 | |||
14180 | // Date when multipart upload will become eligible for abort operation by lifecycle. | ||
14181 | AbortDate *time.Time `location:"header" locationName:"x-amz-abort-date" type:"timestamp" timestampFormat:"rfc822"` | ||
14182 | |||
14183 | // Id of the lifecycle rule that makes a multipart upload eligible for abort | ||
14184 | // operation. | ||
14185 | AbortRuleId *string `location:"header" locationName:"x-amz-abort-rule-id" type:"string"` | ||
14186 | |||
14187 | // Name of the bucket to which the multipart upload was initiated. | ||
14188 | Bucket *string `type:"string"` | ||
14189 | |||
14190 | // Identifies who initiated the multipart upload. | ||
14191 | Initiator *Initiator `type:"structure"` | ||
14192 | |||
14193 | // Indicates whether the returned list of parts is truncated. | ||
14194 | IsTruncated *bool `type:"boolean"` | ||
14195 | |||
14196 | // Object key for which the multipart upload was initiated. | ||
14197 | Key *string `min:"1" type:"string"` | ||
14198 | |||
14199 | // Maximum number of parts that were allowed in the response. | ||
14200 | MaxParts *int64 `type:"integer"` | ||
14201 | |||
14202 | // When a list is truncated, this element specifies the last part in the list, | ||
14203 | // as well as the value to use for the part-number-marker request parameter | ||
14204 | // in a subsequent request. | ||
14205 | NextPartNumberMarker *int64 `type:"integer"` | ||
14206 | |||
14207 | Owner *Owner `type:"structure"` | ||
14208 | |||
14209 | // Part number after which listing begins. | ||
14210 | PartNumberMarker *int64 `type:"integer"` | ||
14211 | |||
14212 | Parts []*Part `locationName:"Part" type:"list" flattened:"true"` | ||
14213 | |||
14214 | // If present, indicates that the requester was successfully charged for the | ||
14215 | // request. | ||
14216 | RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` | ||
14217 | |||
14218 | // The class of storage used to store the object. | ||
14219 | StorageClass *string `type:"string" enum:"StorageClass"` | ||
14220 | |||
14221 | // Upload ID identifying the multipart upload whose parts are being listed. | ||
14222 | UploadId *string `type:"string"` | ||
14223 | } | ||
14224 | |||
14225 | // String returns the string representation | ||
14226 | func (s ListPartsOutput) String() string { | ||
14227 | return awsutil.Prettify(s) | ||
14228 | } | ||
14229 | |||
14230 | // GoString returns the string representation | ||
14231 | func (s ListPartsOutput) GoString() string { | ||
14232 | return s.String() | ||
14233 | } | ||
14234 | |||
14235 | // SetAbortDate sets the AbortDate field's value. | ||
14236 | func (s *ListPartsOutput) SetAbortDate(v time.Time) *ListPartsOutput { | ||
14237 | s.AbortDate = &v | ||
14238 | return s | ||
14239 | } | ||
14240 | |||
14241 | // SetAbortRuleId sets the AbortRuleId field's value. | ||
14242 | func (s *ListPartsOutput) SetAbortRuleId(v string) *ListPartsOutput { | ||
14243 | s.AbortRuleId = &v | ||
14244 | return s | ||
14245 | } | ||
14246 | |||
14247 | // SetBucket sets the Bucket field's value. | ||
14248 | func (s *ListPartsOutput) SetBucket(v string) *ListPartsOutput { | ||
14249 | s.Bucket = &v | ||
14250 | return s | ||
14251 | } | ||
14252 | |||
14253 | // SetInitiator sets the Initiator field's value. | ||
14254 | func (s *ListPartsOutput) SetInitiator(v *Initiator) *ListPartsOutput { | ||
14255 | s.Initiator = v | ||
14256 | return s | ||
14257 | } | ||
14258 | |||
14259 | // SetIsTruncated sets the IsTruncated field's value. | ||
14260 | func (s *ListPartsOutput) SetIsTruncated(v bool) *ListPartsOutput { | ||
14261 | s.IsTruncated = &v | ||
14262 | return s | ||
14263 | } | ||
14264 | |||
14265 | // SetKey sets the Key field's value. | ||
14266 | func (s *ListPartsOutput) SetKey(v string) *ListPartsOutput { | ||
14267 | s.Key = &v | ||
14268 | return s | ||
14269 | } | ||
14270 | |||
14271 | // SetMaxParts sets the MaxParts field's value. | ||
14272 | func (s *ListPartsOutput) SetMaxParts(v int64) *ListPartsOutput { | ||
14273 | s.MaxParts = &v | ||
14274 | return s | ||
14275 | } | ||
14276 | |||
14277 | // SetNextPartNumberMarker sets the NextPartNumberMarker field's value. | ||
14278 | func (s *ListPartsOutput) SetNextPartNumberMarker(v int64) *ListPartsOutput { | ||
14279 | s.NextPartNumberMarker = &v | ||
14280 | return s | ||
14281 | } | ||
14282 | |||
14283 | // SetOwner sets the Owner field's value. | ||
14284 | func (s *ListPartsOutput) SetOwner(v *Owner) *ListPartsOutput { | ||
14285 | s.Owner = v | ||
14286 | return s | ||
14287 | } | ||
14288 | |||
14289 | // SetPartNumberMarker sets the PartNumberMarker field's value. | ||
14290 | func (s *ListPartsOutput) SetPartNumberMarker(v int64) *ListPartsOutput { | ||
14291 | s.PartNumberMarker = &v | ||
14292 | return s | ||
14293 | } | ||
14294 | |||
14295 | // SetParts sets the Parts field's value. | ||
14296 | func (s *ListPartsOutput) SetParts(v []*Part) *ListPartsOutput { | ||
14297 | s.Parts = v | ||
14298 | return s | ||
14299 | } | ||
14300 | |||
14301 | // SetRequestCharged sets the RequestCharged field's value. | ||
14302 | func (s *ListPartsOutput) SetRequestCharged(v string) *ListPartsOutput { | ||
14303 | s.RequestCharged = &v | ||
14304 | return s | ||
14305 | } | ||
14306 | |||
14307 | // SetStorageClass sets the StorageClass field's value. | ||
14308 | func (s *ListPartsOutput) SetStorageClass(v string) *ListPartsOutput { | ||
14309 | s.StorageClass = &v | ||
14310 | return s | ||
14311 | } | ||
14312 | |||
14313 | // SetUploadId sets the UploadId field's value. | ||
14314 | func (s *ListPartsOutput) SetUploadId(v string) *ListPartsOutput { | ||
14315 | s.UploadId = &v | ||
14316 | return s | ||
14317 | } | ||
14318 | |||
14319 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/LoggingEnabled | ||
14320 | type LoggingEnabled struct { | ||
14321 | _ struct{} `type:"structure"` | ||
14322 | |||
14323 | // Specifies the bucket where you want Amazon S3 to store server access logs. | ||
14324 | // You can have your logs delivered to any bucket that you own, including the | ||
14325 | // same bucket that is being logged. You can also configure multiple buckets | ||
14326 | // to deliver their logs to the same target bucket. In this case you should | ||
14327 | // choose a different TargetPrefix for each source bucket so that the delivered | ||
14328 | // log files can be distinguished by key. | ||
14329 | TargetBucket *string `type:"string"` | ||
14330 | |||
14331 | TargetGrants []*TargetGrant `locationNameList:"Grant" type:"list"` | ||
14332 | |||
14333 | // This element lets you specify a prefix for the keys that the log files will | ||
14334 | // be stored under. | ||
14335 | TargetPrefix *string `type:"string"` | ||
14336 | } | ||
14337 | |||
14338 | // String returns the string representation | ||
14339 | func (s LoggingEnabled) String() string { | ||
14340 | return awsutil.Prettify(s) | ||
14341 | } | ||
14342 | |||
14343 | // GoString returns the string representation | ||
14344 | func (s LoggingEnabled) GoString() string { | ||
14345 | return s.String() | ||
14346 | } | ||
14347 | |||
14348 | // Validate inspects the fields of the type to determine if they are valid. | ||
14349 | func (s *LoggingEnabled) Validate() error { | ||
14350 | invalidParams := request.ErrInvalidParams{Context: "LoggingEnabled"} | ||
14351 | if s.TargetGrants != nil { | ||
14352 | for i, v := range s.TargetGrants { | ||
14353 | if v == nil { | ||
14354 | continue | ||
14355 | } | ||
14356 | if err := v.Validate(); err != nil { | ||
14357 | invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TargetGrants", i), err.(request.ErrInvalidParams)) | ||
14358 | } | ||
14359 | } | ||
14360 | } | ||
14361 | |||
14362 | if invalidParams.Len() > 0 { | ||
14363 | return invalidParams | ||
14364 | } | ||
14365 | return nil | ||
14366 | } | ||
14367 | |||
14368 | // SetTargetBucket sets the TargetBucket field's value. | ||
14369 | func (s *LoggingEnabled) SetTargetBucket(v string) *LoggingEnabled { | ||
14370 | s.TargetBucket = &v | ||
14371 | return s | ||
14372 | } | ||
14373 | |||
14374 | // SetTargetGrants sets the TargetGrants field's value. | ||
14375 | func (s *LoggingEnabled) SetTargetGrants(v []*TargetGrant) *LoggingEnabled { | ||
14376 | s.TargetGrants = v | ||
14377 | return s | ||
14378 | } | ||
14379 | |||
14380 | // SetTargetPrefix sets the TargetPrefix field's value. | ||
14381 | func (s *LoggingEnabled) SetTargetPrefix(v string) *LoggingEnabled { | ||
14382 | s.TargetPrefix = &v | ||
14383 | return s | ||
14384 | } | ||
14385 | |||
14386 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/MetricsAndOperator | ||
14387 | type MetricsAndOperator struct { | ||
14388 | _ struct{} `type:"structure"` | ||
14389 | |||
14390 | // The prefix used when evaluating an AND predicate. | ||
14391 | Prefix *string `type:"string"` | ||
14392 | |||
14393 | // The list of tags used when evaluating an AND predicate. | ||
14394 | Tags []*Tag `locationName:"Tag" locationNameList:"Tag" type:"list" flattened:"true"` | ||
14395 | } | ||
14396 | |||
14397 | // String returns the string representation | ||
14398 | func (s MetricsAndOperator) String() string { | ||
14399 | return awsutil.Prettify(s) | ||
14400 | } | ||
14401 | |||
14402 | // GoString returns the string representation | ||
14403 | func (s MetricsAndOperator) GoString() string { | ||
14404 | return s.String() | ||
14405 | } | ||
14406 | |||
14407 | // Validate inspects the fields of the type to determine if they are valid. | ||
14408 | func (s *MetricsAndOperator) Validate() error { | ||
14409 | invalidParams := request.ErrInvalidParams{Context: "MetricsAndOperator"} | ||
14410 | if s.Tags != nil { | ||
14411 | for i, v := range s.Tags { | ||
14412 | if v == nil { | ||
14413 | continue | ||
14414 | } | ||
14415 | if err := v.Validate(); err != nil { | ||
14416 | invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) | ||
14417 | } | ||
14418 | } | ||
14419 | } | ||
14420 | |||
14421 | if invalidParams.Len() > 0 { | ||
14422 | return invalidParams | ||
14423 | } | ||
14424 | return nil | ||
14425 | } | ||
14426 | |||
14427 | // SetPrefix sets the Prefix field's value. | ||
14428 | func (s *MetricsAndOperator) SetPrefix(v string) *MetricsAndOperator { | ||
14429 | s.Prefix = &v | ||
14430 | return s | ||
14431 | } | ||
14432 | |||
14433 | // SetTags sets the Tags field's value. | ||
14434 | func (s *MetricsAndOperator) SetTags(v []*Tag) *MetricsAndOperator { | ||
14435 | s.Tags = v | ||
14436 | return s | ||
14437 | } | ||
14438 | |||
14439 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/MetricsConfiguration | ||
14440 | type MetricsConfiguration struct { | ||
14441 | _ struct{} `type:"structure"` | ||
14442 | |||
14443 | // Specifies a metrics configuration filter. The metrics configuration will | ||
14444 | // only include objects that meet the filter's criteria. A filter must be a | ||
14445 | // prefix, a tag, or a conjunction (MetricsAndOperator). | ||
14446 | Filter *MetricsFilter `type:"structure"` | ||
14447 | |||
14448 | // The ID used to identify the metrics configuration. | ||
14449 | // | ||
14450 | // Id is a required field | ||
14451 | Id *string `type:"string" required:"true"` | ||
14452 | } | ||
14453 | |||
14454 | // String returns the string representation | ||
14455 | func (s MetricsConfiguration) String() string { | ||
14456 | return awsutil.Prettify(s) | ||
14457 | } | ||
14458 | |||
14459 | // GoString returns the string representation | ||
14460 | func (s MetricsConfiguration) GoString() string { | ||
14461 | return s.String() | ||
14462 | } | ||
14463 | |||
14464 | // Validate inspects the fields of the type to determine if they are valid. | ||
14465 | func (s *MetricsConfiguration) Validate() error { | ||
14466 | invalidParams := request.ErrInvalidParams{Context: "MetricsConfiguration"} | ||
14467 | if s.Id == nil { | ||
14468 | invalidParams.Add(request.NewErrParamRequired("Id")) | ||
14469 | } | ||
14470 | if s.Filter != nil { | ||
14471 | if err := s.Filter.Validate(); err != nil { | ||
14472 | invalidParams.AddNested("Filter", err.(request.ErrInvalidParams)) | ||
14473 | } | ||
14474 | } | ||
14475 | |||
14476 | if invalidParams.Len() > 0 { | ||
14477 | return invalidParams | ||
14478 | } | ||
14479 | return nil | ||
14480 | } | ||
14481 | |||
14482 | // SetFilter sets the Filter field's value. | ||
14483 | func (s *MetricsConfiguration) SetFilter(v *MetricsFilter) *MetricsConfiguration { | ||
14484 | s.Filter = v | ||
14485 | return s | ||
14486 | } | ||
14487 | |||
14488 | // SetId sets the Id field's value. | ||
14489 | func (s *MetricsConfiguration) SetId(v string) *MetricsConfiguration { | ||
14490 | s.Id = &v | ||
14491 | return s | ||
14492 | } | ||
14493 | |||
14494 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/MetricsFilter | ||
14495 | type MetricsFilter struct { | ||
14496 | _ struct{} `type:"structure"` | ||
14497 | |||
14498 | // A conjunction (logical AND) of predicates, which is used in evaluating a | ||
14499 | // metrics filter. The operator must have at least two predicates, and an object | ||
14500 | // must match all of the predicates in order for the filter to apply. | ||
14501 | And *MetricsAndOperator `type:"structure"` | ||
14502 | |||
14503 | // The prefix used when evaluating a metrics filter. | ||
14504 | Prefix *string `type:"string"` | ||
14505 | |||
14506 | // The tag used when evaluating a metrics filter. | ||
14507 | Tag *Tag `type:"structure"` | ||
14508 | } | ||
14509 | |||
14510 | // String returns the string representation | ||
14511 | func (s MetricsFilter) String() string { | ||
14512 | return awsutil.Prettify(s) | ||
14513 | } | ||
14514 | |||
14515 | // GoString returns the string representation | ||
14516 | func (s MetricsFilter) GoString() string { | ||
14517 | return s.String() | ||
14518 | } | ||
14519 | |||
14520 | // Validate inspects the fields of the type to determine if they are valid. | ||
14521 | func (s *MetricsFilter) Validate() error { | ||
14522 | invalidParams := request.ErrInvalidParams{Context: "MetricsFilter"} | ||
14523 | if s.And != nil { | ||
14524 | if err := s.And.Validate(); err != nil { | ||
14525 | invalidParams.AddNested("And", err.(request.ErrInvalidParams)) | ||
14526 | } | ||
14527 | } | ||
14528 | if s.Tag != nil { | ||
14529 | if err := s.Tag.Validate(); err != nil { | ||
14530 | invalidParams.AddNested("Tag", err.(request.ErrInvalidParams)) | ||
14531 | } | ||
14532 | } | ||
14533 | |||
14534 | if invalidParams.Len() > 0 { | ||
14535 | return invalidParams | ||
14536 | } | ||
14537 | return nil | ||
14538 | } | ||
14539 | |||
14540 | // SetAnd sets the And field's value. | ||
14541 | func (s *MetricsFilter) SetAnd(v *MetricsAndOperator) *MetricsFilter { | ||
14542 | s.And = v | ||
14543 | return s | ||
14544 | } | ||
14545 | |||
14546 | // SetPrefix sets the Prefix field's value. | ||
14547 | func (s *MetricsFilter) SetPrefix(v string) *MetricsFilter { | ||
14548 | s.Prefix = &v | ||
14549 | return s | ||
14550 | } | ||
14551 | |||
14552 | // SetTag sets the Tag field's value. | ||
14553 | func (s *MetricsFilter) SetTag(v *Tag) *MetricsFilter { | ||
14554 | s.Tag = v | ||
14555 | return s | ||
14556 | } | ||
14557 | |||
14558 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/MultipartUpload | ||
14559 | type MultipartUpload struct { | ||
14560 | _ struct{} `type:"structure"` | ||
14561 | |||
14562 | // Date and time at which the multipart upload was initiated. | ||
14563 | Initiated *time.Time `type:"timestamp" timestampFormat:"iso8601"` | ||
14564 | |||
14565 | // Identifies who initiated the multipart upload. | ||
14566 | Initiator *Initiator `type:"structure"` | ||
14567 | |||
14568 | // Key of the object for which the multipart upload was initiated. | ||
14569 | Key *string `min:"1" type:"string"` | ||
14570 | |||
14571 | Owner *Owner `type:"structure"` | ||
14572 | |||
14573 | // The class of storage used to store the object. | ||
14574 | StorageClass *string `type:"string" enum:"StorageClass"` | ||
14575 | |||
14576 | // Upload ID that identifies the multipart upload. | ||
14577 | UploadId *string `type:"string"` | ||
14578 | } | ||
14579 | |||
14580 | // String returns the string representation | ||
14581 | func (s MultipartUpload) String() string { | ||
14582 | return awsutil.Prettify(s) | ||
14583 | } | ||
14584 | |||
14585 | // GoString returns the string representation | ||
14586 | func (s MultipartUpload) GoString() string { | ||
14587 | return s.String() | ||
14588 | } | ||
14589 | |||
14590 | // SetInitiated sets the Initiated field's value. | ||
14591 | func (s *MultipartUpload) SetInitiated(v time.Time) *MultipartUpload { | ||
14592 | s.Initiated = &v | ||
14593 | return s | ||
14594 | } | ||
14595 | |||
14596 | // SetInitiator sets the Initiator field's value. | ||
14597 | func (s *MultipartUpload) SetInitiator(v *Initiator) *MultipartUpload { | ||
14598 | s.Initiator = v | ||
14599 | return s | ||
14600 | } | ||
14601 | |||
14602 | // SetKey sets the Key field's value. | ||
14603 | func (s *MultipartUpload) SetKey(v string) *MultipartUpload { | ||
14604 | s.Key = &v | ||
14605 | return s | ||
14606 | } | ||
14607 | |||
14608 | // SetOwner sets the Owner field's value. | ||
14609 | func (s *MultipartUpload) SetOwner(v *Owner) *MultipartUpload { | ||
14610 | s.Owner = v | ||
14611 | return s | ||
14612 | } | ||
14613 | |||
14614 | // SetStorageClass sets the StorageClass field's value. | ||
14615 | func (s *MultipartUpload) SetStorageClass(v string) *MultipartUpload { | ||
14616 | s.StorageClass = &v | ||
14617 | return s | ||
14618 | } | ||
14619 | |||
14620 | // SetUploadId sets the UploadId field's value. | ||
14621 | func (s *MultipartUpload) SetUploadId(v string) *MultipartUpload { | ||
14622 | s.UploadId = &v | ||
14623 | return s | ||
14624 | } | ||
14625 | |||
14626 | // Specifies when noncurrent object versions expire. Upon expiration, Amazon | ||
14627 | // S3 permanently deletes the noncurrent object versions. You set this lifecycle | ||
14628 | // configuration action on a bucket that has versioning enabled (or suspended) | ||
14629 | // to request that Amazon S3 delete noncurrent object versions at a specific | ||
14630 | // period in the object's lifetime. | ||
14631 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/NoncurrentVersionExpiration | ||
14632 | type NoncurrentVersionExpiration struct { | ||
14633 | _ struct{} `type:"structure"` | ||
14634 | |||
14635 | // Specifies the number of days an object is noncurrent before Amazon S3 can | ||
14636 | // perform the associated action. For information about the noncurrent days | ||
14637 | // calculations, see How Amazon S3 Calculates When an Object Became Noncurrent | ||
14638 | // (http://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html) | ||
14639 | NoncurrentDays *int64 `type:"integer"` | ||
14640 | } | ||
14641 | |||
14642 | // String returns the string representation | ||
14643 | func (s NoncurrentVersionExpiration) String() string { | ||
14644 | return awsutil.Prettify(s) | ||
14645 | } | ||
14646 | |||
14647 | // GoString returns the string representation | ||
14648 | func (s NoncurrentVersionExpiration) GoString() string { | ||
14649 | return s.String() | ||
14650 | } | ||
14651 | |||
14652 | // SetNoncurrentDays sets the NoncurrentDays field's value. | ||
14653 | func (s *NoncurrentVersionExpiration) SetNoncurrentDays(v int64) *NoncurrentVersionExpiration { | ||
14654 | s.NoncurrentDays = &v | ||
14655 | return s | ||
14656 | } | ||
14657 | |||
14658 | // Container for the transition rule that describes when noncurrent objects | ||
14659 | // transition to the STANDARD_IA or GLACIER storage class. If your bucket is | ||
14660 | // versioning-enabled (or versioning is suspended), you can set this action | ||
14661 | // to request that Amazon S3 transition noncurrent object versions to the STANDARD_IA | ||
14662 | // or GLACIER storage class at a specific period in the object's lifetime. | ||
14663 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/NoncurrentVersionTransition | ||
14664 | type NoncurrentVersionTransition struct { | ||
14665 | _ struct{} `type:"structure"` | ||
14666 | |||
14667 | // Specifies the number of days an object is noncurrent before Amazon S3 can | ||
14668 | // perform the associated action. For information about the noncurrent days | ||
14669 | // calculations, see How Amazon S3 Calculates When an Object Became Noncurrent | ||
14670 | // (http://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html) | ||
14671 | NoncurrentDays *int64 `type:"integer"` | ||
14672 | |||
14673 | // The class of storage used to store the object. | ||
14674 | StorageClass *string `type:"string" enum:"TransitionStorageClass"` | ||
14675 | } | ||
14676 | |||
14677 | // String returns the string representation | ||
14678 | func (s NoncurrentVersionTransition) String() string { | ||
14679 | return awsutil.Prettify(s) | ||
14680 | } | ||
14681 | |||
14682 | // GoString returns the string representation | ||
14683 | func (s NoncurrentVersionTransition) GoString() string { | ||
14684 | return s.String() | ||
14685 | } | ||
14686 | |||
14687 | // SetNoncurrentDays sets the NoncurrentDays field's value. | ||
14688 | func (s *NoncurrentVersionTransition) SetNoncurrentDays(v int64) *NoncurrentVersionTransition { | ||
14689 | s.NoncurrentDays = &v | ||
14690 | return s | ||
14691 | } | ||
14692 | |||
14693 | // SetStorageClass sets the StorageClass field's value. | ||
14694 | func (s *NoncurrentVersionTransition) SetStorageClass(v string) *NoncurrentVersionTransition { | ||
14695 | s.StorageClass = &v | ||
14696 | return s | ||
14697 | } | ||
14698 | |||
14699 | // Container for specifying the notification configuration of the bucket. If | ||
14700 | // this element is empty, notifications are turned off on the bucket. | ||
14701 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/NotificationConfiguration | ||
14702 | type NotificationConfiguration struct { | ||
14703 | _ struct{} `type:"structure"` | ||
14704 | |||
14705 | LambdaFunctionConfigurations []*LambdaFunctionConfiguration `locationName:"CloudFunctionConfiguration" type:"list" flattened:"true"` | ||
14706 | |||
14707 | QueueConfigurations []*QueueConfiguration `locationName:"QueueConfiguration" type:"list" flattened:"true"` | ||
14708 | |||
14709 | TopicConfigurations []*TopicConfiguration `locationName:"TopicConfiguration" type:"list" flattened:"true"` | ||
14710 | } | ||
14711 | |||
14712 | // String returns the string representation | ||
14713 | func (s NotificationConfiguration) String() string { | ||
14714 | return awsutil.Prettify(s) | ||
14715 | } | ||
14716 | |||
14717 | // GoString returns the string representation | ||
14718 | func (s NotificationConfiguration) GoString() string { | ||
14719 | return s.String() | ||
14720 | } | ||
14721 | |||
14722 | // Validate inspects the fields of the type to determine if they are valid. | ||
14723 | func (s *NotificationConfiguration) Validate() error { | ||
14724 | invalidParams := request.ErrInvalidParams{Context: "NotificationConfiguration"} | ||
14725 | if s.LambdaFunctionConfigurations != nil { | ||
14726 | for i, v := range s.LambdaFunctionConfigurations { | ||
14727 | if v == nil { | ||
14728 | continue | ||
14729 | } | ||
14730 | if err := v.Validate(); err != nil { | ||
14731 | invalidParams.AddNested(fmt.Sprintf("%s[%v]", "LambdaFunctionConfigurations", i), err.(request.ErrInvalidParams)) | ||
14732 | } | ||
14733 | } | ||
14734 | } | ||
14735 | if s.QueueConfigurations != nil { | ||
14736 | for i, v := range s.QueueConfigurations { | ||
14737 | if v == nil { | ||
14738 | continue | ||
14739 | } | ||
14740 | if err := v.Validate(); err != nil { | ||
14741 | invalidParams.AddNested(fmt.Sprintf("%s[%v]", "QueueConfigurations", i), err.(request.ErrInvalidParams)) | ||
14742 | } | ||
14743 | } | ||
14744 | } | ||
14745 | if s.TopicConfigurations != nil { | ||
14746 | for i, v := range s.TopicConfigurations { | ||
14747 | if v == nil { | ||
14748 | continue | ||
14749 | } | ||
14750 | if err := v.Validate(); err != nil { | ||
14751 | invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TopicConfigurations", i), err.(request.ErrInvalidParams)) | ||
14752 | } | ||
14753 | } | ||
14754 | } | ||
14755 | |||
14756 | if invalidParams.Len() > 0 { | ||
14757 | return invalidParams | ||
14758 | } | ||
14759 | return nil | ||
14760 | } | ||
14761 | |||
14762 | // SetLambdaFunctionConfigurations sets the LambdaFunctionConfigurations field's value. | ||
14763 | func (s *NotificationConfiguration) SetLambdaFunctionConfigurations(v []*LambdaFunctionConfiguration) *NotificationConfiguration { | ||
14764 | s.LambdaFunctionConfigurations = v | ||
14765 | return s | ||
14766 | } | ||
14767 | |||
14768 | // SetQueueConfigurations sets the QueueConfigurations field's value. | ||
14769 | func (s *NotificationConfiguration) SetQueueConfigurations(v []*QueueConfiguration) *NotificationConfiguration { | ||
14770 | s.QueueConfigurations = v | ||
14771 | return s | ||
14772 | } | ||
14773 | |||
14774 | // SetTopicConfigurations sets the TopicConfigurations field's value. | ||
14775 | func (s *NotificationConfiguration) SetTopicConfigurations(v []*TopicConfiguration) *NotificationConfiguration { | ||
14776 | s.TopicConfigurations = v | ||
14777 | return s | ||
14778 | } | ||
14779 | |||
14780 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/NotificationConfigurationDeprecated | ||
14781 | type NotificationConfigurationDeprecated struct { | ||
14782 | _ struct{} `type:"structure"` | ||
14783 | |||
14784 | CloudFunctionConfiguration *CloudFunctionConfiguration `type:"structure"` | ||
14785 | |||
14786 | QueueConfiguration *QueueConfigurationDeprecated `type:"structure"` | ||
14787 | |||
14788 | TopicConfiguration *TopicConfigurationDeprecated `type:"structure"` | ||
14789 | } | ||
14790 | |||
14791 | // String returns the string representation | ||
14792 | func (s NotificationConfigurationDeprecated) String() string { | ||
14793 | return awsutil.Prettify(s) | ||
14794 | } | ||
14795 | |||
14796 | // GoString returns the string representation | ||
14797 | func (s NotificationConfigurationDeprecated) GoString() string { | ||
14798 | return s.String() | ||
14799 | } | ||
14800 | |||
14801 | // SetCloudFunctionConfiguration sets the CloudFunctionConfiguration field's value. | ||
14802 | func (s *NotificationConfigurationDeprecated) SetCloudFunctionConfiguration(v *CloudFunctionConfiguration) *NotificationConfigurationDeprecated { | ||
14803 | s.CloudFunctionConfiguration = v | ||
14804 | return s | ||
14805 | } | ||
14806 | |||
14807 | // SetQueueConfiguration sets the QueueConfiguration field's value. | ||
14808 | func (s *NotificationConfigurationDeprecated) SetQueueConfiguration(v *QueueConfigurationDeprecated) *NotificationConfigurationDeprecated { | ||
14809 | s.QueueConfiguration = v | ||
14810 | return s | ||
14811 | } | ||
14812 | |||
14813 | // SetTopicConfiguration sets the TopicConfiguration field's value. | ||
14814 | func (s *NotificationConfigurationDeprecated) SetTopicConfiguration(v *TopicConfigurationDeprecated) *NotificationConfigurationDeprecated { | ||
14815 | s.TopicConfiguration = v | ||
14816 | return s | ||
14817 | } | ||
14818 | |||
14819 | // Container for object key name filtering rules. For information about key | ||
14820 | // name filtering, go to Configuring Event Notifications (http://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) | ||
14821 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/NotificationConfigurationFilter | ||
14822 | type NotificationConfigurationFilter struct { | ||
14823 | _ struct{} `type:"structure"` | ||
14824 | |||
14825 | // Container for object key name prefix and suffix filtering rules. | ||
14826 | Key *KeyFilter `locationName:"S3Key" type:"structure"` | ||
14827 | } | ||
14828 | |||
14829 | // String returns the string representation | ||
14830 | func (s NotificationConfigurationFilter) String() string { | ||
14831 | return awsutil.Prettify(s) | ||
14832 | } | ||
14833 | |||
14834 | // GoString returns the string representation | ||
14835 | func (s NotificationConfigurationFilter) GoString() string { | ||
14836 | return s.String() | ||
14837 | } | ||
14838 | |||
14839 | // SetKey sets the Key field's value. | ||
14840 | func (s *NotificationConfigurationFilter) SetKey(v *KeyFilter) *NotificationConfigurationFilter { | ||
14841 | s.Key = v | ||
14842 | return s | ||
14843 | } | ||
14844 | |||
14845 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Object | ||
14846 | type Object struct { | ||
14847 | _ struct{} `type:"structure"` | ||
14848 | |||
14849 | ETag *string `type:"string"` | ||
14850 | |||
14851 | Key *string `min:"1" type:"string"` | ||
14852 | |||
14853 | LastModified *time.Time `type:"timestamp" timestampFormat:"iso8601"` | ||
14854 | |||
14855 | Owner *Owner `type:"structure"` | ||
14856 | |||
14857 | Size *int64 `type:"integer"` | ||
14858 | |||
14859 | // The class of storage used to store the object. | ||
14860 | StorageClass *string `type:"string" enum:"ObjectStorageClass"` | ||
14861 | } | ||
14862 | |||
14863 | // String returns the string representation | ||
14864 | func (s Object) String() string { | ||
14865 | return awsutil.Prettify(s) | ||
14866 | } | ||
14867 | |||
14868 | // GoString returns the string representation | ||
14869 | func (s Object) GoString() string { | ||
14870 | return s.String() | ||
14871 | } | ||
14872 | |||
14873 | // SetETag sets the ETag field's value. | ||
14874 | func (s *Object) SetETag(v string) *Object { | ||
14875 | s.ETag = &v | ||
14876 | return s | ||
14877 | } | ||
14878 | |||
14879 | // SetKey sets the Key field's value. | ||
14880 | func (s *Object) SetKey(v string) *Object { | ||
14881 | s.Key = &v | ||
14882 | return s | ||
14883 | } | ||
14884 | |||
14885 | // SetLastModified sets the LastModified field's value. | ||
14886 | func (s *Object) SetLastModified(v time.Time) *Object { | ||
14887 | s.LastModified = &v | ||
14888 | return s | ||
14889 | } | ||
14890 | |||
14891 | // SetOwner sets the Owner field's value. | ||
14892 | func (s *Object) SetOwner(v *Owner) *Object { | ||
14893 | s.Owner = v | ||
14894 | return s | ||
14895 | } | ||
14896 | |||
14897 | // SetSize sets the Size field's value. | ||
14898 | func (s *Object) SetSize(v int64) *Object { | ||
14899 | s.Size = &v | ||
14900 | return s | ||
14901 | } | ||
14902 | |||
14903 | // SetStorageClass sets the StorageClass field's value. | ||
14904 | func (s *Object) SetStorageClass(v string) *Object { | ||
14905 | s.StorageClass = &v | ||
14906 | return s | ||
14907 | } | ||
14908 | |||
14909 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ObjectIdentifier | ||
14910 | type ObjectIdentifier struct { | ||
14911 | _ struct{} `type:"structure"` | ||
14912 | |||
14913 | // Key name of the object to delete. | ||
14914 | // | ||
14915 | // Key is a required field | ||
14916 | Key *string `min:"1" type:"string" required:"true"` | ||
14917 | |||
14918 | // VersionId for the specific version of the object to delete. | ||
14919 | VersionId *string `type:"string"` | ||
14920 | } | ||
14921 | |||
14922 | // String returns the string representation | ||
14923 | func (s ObjectIdentifier) String() string { | ||
14924 | return awsutil.Prettify(s) | ||
14925 | } | ||
14926 | |||
14927 | // GoString returns the string representation | ||
14928 | func (s ObjectIdentifier) GoString() string { | ||
14929 | return s.String() | ||
14930 | } | ||
14931 | |||
14932 | // Validate inspects the fields of the type to determine if they are valid. | ||
14933 | func (s *ObjectIdentifier) Validate() error { | ||
14934 | invalidParams := request.ErrInvalidParams{Context: "ObjectIdentifier"} | ||
14935 | if s.Key == nil { | ||
14936 | invalidParams.Add(request.NewErrParamRequired("Key")) | ||
14937 | } | ||
14938 | if s.Key != nil && len(*s.Key) < 1 { | ||
14939 | invalidParams.Add(request.NewErrParamMinLen("Key", 1)) | ||
14940 | } | ||
14941 | |||
14942 | if invalidParams.Len() > 0 { | ||
14943 | return invalidParams | ||
14944 | } | ||
14945 | return nil | ||
14946 | } | ||
14947 | |||
14948 | // SetKey sets the Key field's value. | ||
14949 | func (s *ObjectIdentifier) SetKey(v string) *ObjectIdentifier { | ||
14950 | s.Key = &v | ||
14951 | return s | ||
14952 | } | ||
14953 | |||
14954 | // SetVersionId sets the VersionId field's value. | ||
14955 | func (s *ObjectIdentifier) SetVersionId(v string) *ObjectIdentifier { | ||
14956 | s.VersionId = &v | ||
14957 | return s | ||
14958 | } | ||
14959 | |||
14960 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ObjectVersion | ||
14961 | type ObjectVersion struct { | ||
14962 | _ struct{} `type:"structure"` | ||
14963 | |||
14964 | ETag *string `type:"string"` | ||
14965 | |||
14966 | // Specifies whether the object is (true) or is not (false) the latest version | ||
14967 | // of an object. | ||
14968 | IsLatest *bool `type:"boolean"` | ||
14969 | |||
14970 | // The object key. | ||
14971 | Key *string `min:"1" type:"string"` | ||
14972 | |||
14973 | // Date and time the object was last modified. | ||
14974 | LastModified *time.Time `type:"timestamp" timestampFormat:"iso8601"` | ||
14975 | |||
14976 | Owner *Owner `type:"structure"` | ||
14977 | |||
14978 | // Size in bytes of the object. | ||
14979 | Size *int64 `type:"integer"` | ||
14980 | |||
14981 | // The class of storage used to store the object. | ||
14982 | StorageClass *string `type:"string" enum:"ObjectVersionStorageClass"` | ||
14983 | |||
14984 | // Version ID of an object. | ||
14985 | VersionId *string `type:"string"` | ||
14986 | } | ||
14987 | |||
14988 | // String returns the string representation | ||
14989 | func (s ObjectVersion) String() string { | ||
14990 | return awsutil.Prettify(s) | ||
14991 | } | ||
14992 | |||
14993 | // GoString returns the string representation | ||
14994 | func (s ObjectVersion) GoString() string { | ||
14995 | return s.String() | ||
14996 | } | ||
14997 | |||
14998 | // SetETag sets the ETag field's value. | ||
14999 | func (s *ObjectVersion) SetETag(v string) *ObjectVersion { | ||
15000 | s.ETag = &v | ||
15001 | return s | ||
15002 | } | ||
15003 | |||
15004 | // SetIsLatest sets the IsLatest field's value. | ||
15005 | func (s *ObjectVersion) SetIsLatest(v bool) *ObjectVersion { | ||
15006 | s.IsLatest = &v | ||
15007 | return s | ||
15008 | } | ||
15009 | |||
15010 | // SetKey sets the Key field's value. | ||
15011 | func (s *ObjectVersion) SetKey(v string) *ObjectVersion { | ||
15012 | s.Key = &v | ||
15013 | return s | ||
15014 | } | ||
15015 | |||
15016 | // SetLastModified sets the LastModified field's value. | ||
15017 | func (s *ObjectVersion) SetLastModified(v time.Time) *ObjectVersion { | ||
15018 | s.LastModified = &v | ||
15019 | return s | ||
15020 | } | ||
15021 | |||
15022 | // SetOwner sets the Owner field's value. | ||
15023 | func (s *ObjectVersion) SetOwner(v *Owner) *ObjectVersion { | ||
15024 | s.Owner = v | ||
15025 | return s | ||
15026 | } | ||
15027 | |||
15028 | // SetSize sets the Size field's value. | ||
15029 | func (s *ObjectVersion) SetSize(v int64) *ObjectVersion { | ||
15030 | s.Size = &v | ||
15031 | return s | ||
15032 | } | ||
15033 | |||
15034 | // SetStorageClass sets the StorageClass field's value. | ||
15035 | func (s *ObjectVersion) SetStorageClass(v string) *ObjectVersion { | ||
15036 | s.StorageClass = &v | ||
15037 | return s | ||
15038 | } | ||
15039 | |||
15040 | // SetVersionId sets the VersionId field's value. | ||
15041 | func (s *ObjectVersion) SetVersionId(v string) *ObjectVersion { | ||
15042 | s.VersionId = &v | ||
15043 | return s | ||
15044 | } | ||
15045 | |||
15046 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Owner | ||
15047 | type Owner struct { | ||
15048 | _ struct{} `type:"structure"` | ||
15049 | |||
15050 | DisplayName *string `type:"string"` | ||
15051 | |||
15052 | ID *string `type:"string"` | ||
15053 | } | ||
15054 | |||
15055 | // String returns the string representation | ||
15056 | func (s Owner) String() string { | ||
15057 | return awsutil.Prettify(s) | ||
15058 | } | ||
15059 | |||
15060 | // GoString returns the string representation | ||
15061 | func (s Owner) GoString() string { | ||
15062 | return s.String() | ||
15063 | } | ||
15064 | |||
15065 | // SetDisplayName sets the DisplayName field's value. | ||
15066 | func (s *Owner) SetDisplayName(v string) *Owner { | ||
15067 | s.DisplayName = &v | ||
15068 | return s | ||
15069 | } | ||
15070 | |||
15071 | // SetID sets the ID field's value. | ||
15072 | func (s *Owner) SetID(v string) *Owner { | ||
15073 | s.ID = &v | ||
15074 | return s | ||
15075 | } | ||
15076 | |||
15077 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Part | ||
15078 | type Part struct { | ||
15079 | _ struct{} `type:"structure"` | ||
15080 | |||
15081 | // Entity tag returned when the part was uploaded. | ||
15082 | ETag *string `type:"string"` | ||
15083 | |||
15084 | // Date and time at which the part was uploaded. | ||
15085 | LastModified *time.Time `type:"timestamp" timestampFormat:"iso8601"` | ||
15086 | |||
15087 | // Part number identifying the part. This is a positive integer between 1 and | ||
15088 | // 10,000. | ||
15089 | PartNumber *int64 `type:"integer"` | ||
15090 | |||
15091 | // Size of the uploaded part data. | ||
15092 | Size *int64 `type:"integer"` | ||
15093 | } | ||
15094 | |||
15095 | // String returns the string representation | ||
15096 | func (s Part) String() string { | ||
15097 | return awsutil.Prettify(s) | ||
15098 | } | ||
15099 | |||
15100 | // GoString returns the string representation | ||
15101 | func (s Part) GoString() string { | ||
15102 | return s.String() | ||
15103 | } | ||
15104 | |||
15105 | // SetETag sets the ETag field's value. | ||
15106 | func (s *Part) SetETag(v string) *Part { | ||
15107 | s.ETag = &v | ||
15108 | return s | ||
15109 | } | ||
15110 | |||
15111 | // SetLastModified sets the LastModified field's value. | ||
15112 | func (s *Part) SetLastModified(v time.Time) *Part { | ||
15113 | s.LastModified = &v | ||
15114 | return s | ||
15115 | } | ||
15116 | |||
15117 | // SetPartNumber sets the PartNumber field's value. | ||
15118 | func (s *Part) SetPartNumber(v int64) *Part { | ||
15119 | s.PartNumber = &v | ||
15120 | return s | ||
15121 | } | ||
15122 | |||
15123 | // SetSize sets the Size field's value. | ||
15124 | func (s *Part) SetSize(v int64) *Part { | ||
15125 | s.Size = &v | ||
15126 | return s | ||
15127 | } | ||
15128 | |||
15129 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAccelerateConfigurationRequest | ||
15130 | type PutBucketAccelerateConfigurationInput struct { | ||
15131 | _ struct{} `type:"structure" payload:"AccelerateConfiguration"` | ||
15132 | |||
15133 | // Specifies the Accelerate Configuration you want to set for the bucket. | ||
15134 | // | ||
15135 | // AccelerateConfiguration is a required field | ||
15136 | AccelerateConfiguration *AccelerateConfiguration `locationName:"AccelerateConfiguration" type:"structure" required:"true"` | ||
15137 | |||
15138 | // Name of the bucket for which the accelerate configuration is set. | ||
15139 | // | ||
15140 | // Bucket is a required field | ||
15141 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
15142 | } | ||
15143 | |||
15144 | // String returns the string representation | ||
15145 | func (s PutBucketAccelerateConfigurationInput) String() string { | ||
15146 | return awsutil.Prettify(s) | ||
15147 | } | ||
15148 | |||
15149 | // GoString returns the string representation | ||
15150 | func (s PutBucketAccelerateConfigurationInput) GoString() string { | ||
15151 | return s.String() | ||
15152 | } | ||
15153 | |||
15154 | // Validate inspects the fields of the type to determine if they are valid. | ||
15155 | func (s *PutBucketAccelerateConfigurationInput) Validate() error { | ||
15156 | invalidParams := request.ErrInvalidParams{Context: "PutBucketAccelerateConfigurationInput"} | ||
15157 | if s.AccelerateConfiguration == nil { | ||
15158 | invalidParams.Add(request.NewErrParamRequired("AccelerateConfiguration")) | ||
15159 | } | ||
15160 | if s.Bucket == nil { | ||
15161 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
15162 | } | ||
15163 | |||
15164 | if invalidParams.Len() > 0 { | ||
15165 | return invalidParams | ||
15166 | } | ||
15167 | return nil | ||
15168 | } | ||
15169 | |||
15170 | // SetAccelerateConfiguration sets the AccelerateConfiguration field's value. | ||
15171 | func (s *PutBucketAccelerateConfigurationInput) SetAccelerateConfiguration(v *AccelerateConfiguration) *PutBucketAccelerateConfigurationInput { | ||
15172 | s.AccelerateConfiguration = v | ||
15173 | return s | ||
15174 | } | ||
15175 | |||
15176 | // SetBucket sets the Bucket field's value. | ||
15177 | func (s *PutBucketAccelerateConfigurationInput) SetBucket(v string) *PutBucketAccelerateConfigurationInput { | ||
15178 | s.Bucket = &v | ||
15179 | return s | ||
15180 | } | ||
15181 | |||
15182 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAccelerateConfigurationOutput | ||
15183 | type PutBucketAccelerateConfigurationOutput struct { | ||
15184 | _ struct{} `type:"structure"` | ||
15185 | } | ||
15186 | |||
15187 | // String returns the string representation | ||
15188 | func (s PutBucketAccelerateConfigurationOutput) String() string { | ||
15189 | return awsutil.Prettify(s) | ||
15190 | } | ||
15191 | |||
15192 | // GoString returns the string representation | ||
15193 | func (s PutBucketAccelerateConfigurationOutput) GoString() string { | ||
15194 | return s.String() | ||
15195 | } | ||
15196 | |||
15197 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAclRequest | ||
15198 | type PutBucketAclInput struct { | ||
15199 | _ struct{} `type:"structure" payload:"AccessControlPolicy"` | ||
15200 | |||
15201 | // The canned ACL to apply to the bucket. | ||
15202 | ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"BucketCannedACL"` | ||
15203 | |||
15204 | AccessControlPolicy *AccessControlPolicy `locationName:"AccessControlPolicy" type:"structure"` | ||
15205 | |||
15206 | // Bucket is a required field | ||
15207 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
15208 | |||
15209 | // Allows grantee the read, write, read ACP, and write ACP permissions on the | ||
15210 | // bucket. | ||
15211 | GrantFullControl *string `location:"header" locationName:"x-amz-grant-full-control" type:"string"` | ||
15212 | |||
15213 | // Allows grantee to list the objects in the bucket. | ||
15214 | GrantRead *string `location:"header" locationName:"x-amz-grant-read" type:"string"` | ||
15215 | |||
15216 | // Allows grantee to read the bucket ACL. | ||
15217 | GrantReadACP *string `location:"header" locationName:"x-amz-grant-read-acp" type:"string"` | ||
15218 | |||
15219 | // Allows grantee to create, overwrite, and delete any object in the bucket. | ||
15220 | GrantWrite *string `location:"header" locationName:"x-amz-grant-write" type:"string"` | ||
15221 | |||
15222 | // Allows grantee to write the ACL for the applicable bucket. | ||
15223 | GrantWriteACP *string `location:"header" locationName:"x-amz-grant-write-acp" type:"string"` | ||
15224 | } | ||
15225 | |||
15226 | // String returns the string representation | ||
15227 | func (s PutBucketAclInput) String() string { | ||
15228 | return awsutil.Prettify(s) | ||
15229 | } | ||
15230 | |||
15231 | // GoString returns the string representation | ||
15232 | func (s PutBucketAclInput) GoString() string { | ||
15233 | return s.String() | ||
15234 | } | ||
15235 | |||
15236 | // Validate inspects the fields of the type to determine if they are valid. | ||
15237 | func (s *PutBucketAclInput) Validate() error { | ||
15238 | invalidParams := request.ErrInvalidParams{Context: "PutBucketAclInput"} | ||
15239 | if s.Bucket == nil { | ||
15240 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
15241 | } | ||
15242 | if s.AccessControlPolicy != nil { | ||
15243 | if err := s.AccessControlPolicy.Validate(); err != nil { | ||
15244 | invalidParams.AddNested("AccessControlPolicy", err.(request.ErrInvalidParams)) | ||
15245 | } | ||
15246 | } | ||
15247 | |||
15248 | if invalidParams.Len() > 0 { | ||
15249 | return invalidParams | ||
15250 | } | ||
15251 | return nil | ||
15252 | } | ||
15253 | |||
15254 | // SetACL sets the ACL field's value. | ||
15255 | func (s *PutBucketAclInput) SetACL(v string) *PutBucketAclInput { | ||
15256 | s.ACL = &v | ||
15257 | return s | ||
15258 | } | ||
15259 | |||
15260 | // SetAccessControlPolicy sets the AccessControlPolicy field's value. | ||
15261 | func (s *PutBucketAclInput) SetAccessControlPolicy(v *AccessControlPolicy) *PutBucketAclInput { | ||
15262 | s.AccessControlPolicy = v | ||
15263 | return s | ||
15264 | } | ||
15265 | |||
15266 | // SetBucket sets the Bucket field's value. | ||
15267 | func (s *PutBucketAclInput) SetBucket(v string) *PutBucketAclInput { | ||
15268 | s.Bucket = &v | ||
15269 | return s | ||
15270 | } | ||
15271 | |||
15272 | // SetGrantFullControl sets the GrantFullControl field's value. | ||
15273 | func (s *PutBucketAclInput) SetGrantFullControl(v string) *PutBucketAclInput { | ||
15274 | s.GrantFullControl = &v | ||
15275 | return s | ||
15276 | } | ||
15277 | |||
15278 | // SetGrantRead sets the GrantRead field's value. | ||
15279 | func (s *PutBucketAclInput) SetGrantRead(v string) *PutBucketAclInput { | ||
15280 | s.GrantRead = &v | ||
15281 | return s | ||
15282 | } | ||
15283 | |||
15284 | // SetGrantReadACP sets the GrantReadACP field's value. | ||
15285 | func (s *PutBucketAclInput) SetGrantReadACP(v string) *PutBucketAclInput { | ||
15286 | s.GrantReadACP = &v | ||
15287 | return s | ||
15288 | } | ||
15289 | |||
15290 | // SetGrantWrite sets the GrantWrite field's value. | ||
15291 | func (s *PutBucketAclInput) SetGrantWrite(v string) *PutBucketAclInput { | ||
15292 | s.GrantWrite = &v | ||
15293 | return s | ||
15294 | } | ||
15295 | |||
15296 | // SetGrantWriteACP sets the GrantWriteACP field's value. | ||
15297 | func (s *PutBucketAclInput) SetGrantWriteACP(v string) *PutBucketAclInput { | ||
15298 | s.GrantWriteACP = &v | ||
15299 | return s | ||
15300 | } | ||
15301 | |||
15302 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAclOutput | ||
15303 | type PutBucketAclOutput struct { | ||
15304 | _ struct{} `type:"structure"` | ||
15305 | } | ||
15306 | |||
15307 | // String returns the string representation | ||
15308 | func (s PutBucketAclOutput) String() string { | ||
15309 | return awsutil.Prettify(s) | ||
15310 | } | ||
15311 | |||
15312 | // GoString returns the string representation | ||
15313 | func (s PutBucketAclOutput) GoString() string { | ||
15314 | return s.String() | ||
15315 | } | ||
15316 | |||
15317 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAnalyticsConfigurationRequest | ||
15318 | type PutBucketAnalyticsConfigurationInput struct { | ||
15319 | _ struct{} `type:"structure" payload:"AnalyticsConfiguration"` | ||
15320 | |||
15321 | // The configuration and any analyses for the analytics filter. | ||
15322 | // | ||
15323 | // AnalyticsConfiguration is a required field | ||
15324 | AnalyticsConfiguration *AnalyticsConfiguration `locationName:"AnalyticsConfiguration" type:"structure" required:"true"` | ||
15325 | |||
15326 | // The name of the bucket to which an analytics configuration is stored. | ||
15327 | // | ||
15328 | // Bucket is a required field | ||
15329 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
15330 | |||
15331 | // The identifier used to represent an analytics configuration. | ||
15332 | // | ||
15333 | // Id is a required field | ||
15334 | Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` | ||
15335 | } | ||
15336 | |||
15337 | // String returns the string representation | ||
15338 | func (s PutBucketAnalyticsConfigurationInput) String() string { | ||
15339 | return awsutil.Prettify(s) | ||
15340 | } | ||
15341 | |||
15342 | // GoString returns the string representation | ||
15343 | func (s PutBucketAnalyticsConfigurationInput) GoString() string { | ||
15344 | return s.String() | ||
15345 | } | ||
15346 | |||
15347 | // Validate inspects the fields of the type to determine if they are valid. | ||
15348 | func (s *PutBucketAnalyticsConfigurationInput) Validate() error { | ||
15349 | invalidParams := request.ErrInvalidParams{Context: "PutBucketAnalyticsConfigurationInput"} | ||
15350 | if s.AnalyticsConfiguration == nil { | ||
15351 | invalidParams.Add(request.NewErrParamRequired("AnalyticsConfiguration")) | ||
15352 | } | ||
15353 | if s.Bucket == nil { | ||
15354 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
15355 | } | ||
15356 | if s.Id == nil { | ||
15357 | invalidParams.Add(request.NewErrParamRequired("Id")) | ||
15358 | } | ||
15359 | if s.AnalyticsConfiguration != nil { | ||
15360 | if err := s.AnalyticsConfiguration.Validate(); err != nil { | ||
15361 | invalidParams.AddNested("AnalyticsConfiguration", err.(request.ErrInvalidParams)) | ||
15362 | } | ||
15363 | } | ||
15364 | |||
15365 | if invalidParams.Len() > 0 { | ||
15366 | return invalidParams | ||
15367 | } | ||
15368 | return nil | ||
15369 | } | ||
15370 | |||
15371 | // SetAnalyticsConfiguration sets the AnalyticsConfiguration field's value. | ||
15372 | func (s *PutBucketAnalyticsConfigurationInput) SetAnalyticsConfiguration(v *AnalyticsConfiguration) *PutBucketAnalyticsConfigurationInput { | ||
15373 | s.AnalyticsConfiguration = v | ||
15374 | return s | ||
15375 | } | ||
15376 | |||
15377 | // SetBucket sets the Bucket field's value. | ||
15378 | func (s *PutBucketAnalyticsConfigurationInput) SetBucket(v string) *PutBucketAnalyticsConfigurationInput { | ||
15379 | s.Bucket = &v | ||
15380 | return s | ||
15381 | } | ||
15382 | |||
15383 | // SetId sets the Id field's value. | ||
15384 | func (s *PutBucketAnalyticsConfigurationInput) SetId(v string) *PutBucketAnalyticsConfigurationInput { | ||
15385 | s.Id = &v | ||
15386 | return s | ||
15387 | } | ||
15388 | |||
15389 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAnalyticsConfigurationOutput | ||
15390 | type PutBucketAnalyticsConfigurationOutput struct { | ||
15391 | _ struct{} `type:"structure"` | ||
15392 | } | ||
15393 | |||
15394 | // String returns the string representation | ||
15395 | func (s PutBucketAnalyticsConfigurationOutput) String() string { | ||
15396 | return awsutil.Prettify(s) | ||
15397 | } | ||
15398 | |||
15399 | // GoString returns the string representation | ||
15400 | func (s PutBucketAnalyticsConfigurationOutput) GoString() string { | ||
15401 | return s.String() | ||
15402 | } | ||
15403 | |||
15404 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketCorsRequest | ||
15405 | type PutBucketCorsInput struct { | ||
15406 | _ struct{} `type:"structure" payload:"CORSConfiguration"` | ||
15407 | |||
15408 | // Bucket is a required field | ||
15409 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
15410 | |||
15411 | // CORSConfiguration is a required field | ||
15412 | CORSConfiguration *CORSConfiguration `locationName:"CORSConfiguration" type:"structure" required:"true"` | ||
15413 | } | ||
15414 | |||
15415 | // String returns the string representation | ||
15416 | func (s PutBucketCorsInput) String() string { | ||
15417 | return awsutil.Prettify(s) | ||
15418 | } | ||
15419 | |||
15420 | // GoString returns the string representation | ||
15421 | func (s PutBucketCorsInput) GoString() string { | ||
15422 | return s.String() | ||
15423 | } | ||
15424 | |||
15425 | // Validate inspects the fields of the type to determine if they are valid. | ||
15426 | func (s *PutBucketCorsInput) Validate() error { | ||
15427 | invalidParams := request.ErrInvalidParams{Context: "PutBucketCorsInput"} | ||
15428 | if s.Bucket == nil { | ||
15429 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
15430 | } | ||
15431 | if s.CORSConfiguration == nil { | ||
15432 | invalidParams.Add(request.NewErrParamRequired("CORSConfiguration")) | ||
15433 | } | ||
15434 | if s.CORSConfiguration != nil { | ||
15435 | if err := s.CORSConfiguration.Validate(); err != nil { | ||
15436 | invalidParams.AddNested("CORSConfiguration", err.(request.ErrInvalidParams)) | ||
15437 | } | ||
15438 | } | ||
15439 | |||
15440 | if invalidParams.Len() > 0 { | ||
15441 | return invalidParams | ||
15442 | } | ||
15443 | return nil | ||
15444 | } | ||
15445 | |||
15446 | // SetBucket sets the Bucket field's value. | ||
15447 | func (s *PutBucketCorsInput) SetBucket(v string) *PutBucketCorsInput { | ||
15448 | s.Bucket = &v | ||
15449 | return s | ||
15450 | } | ||
15451 | |||
15452 | // SetCORSConfiguration sets the CORSConfiguration field's value. | ||
15453 | func (s *PutBucketCorsInput) SetCORSConfiguration(v *CORSConfiguration) *PutBucketCorsInput { | ||
15454 | s.CORSConfiguration = v | ||
15455 | return s | ||
15456 | } | ||
15457 | |||
15458 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketCorsOutput | ||
15459 | type PutBucketCorsOutput struct { | ||
15460 | _ struct{} `type:"structure"` | ||
15461 | } | ||
15462 | |||
15463 | // String returns the string representation | ||
15464 | func (s PutBucketCorsOutput) String() string { | ||
15465 | return awsutil.Prettify(s) | ||
15466 | } | ||
15467 | |||
15468 | // GoString returns the string representation | ||
15469 | func (s PutBucketCorsOutput) GoString() string { | ||
15470 | return s.String() | ||
15471 | } | ||
15472 | |||
15473 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketInventoryConfigurationRequest | ||
15474 | type PutBucketInventoryConfigurationInput struct { | ||
15475 | _ struct{} `type:"structure" payload:"InventoryConfiguration"` | ||
15476 | |||
15477 | // The name of the bucket where the inventory configuration will be stored. | ||
15478 | // | ||
15479 | // Bucket is a required field | ||
15480 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
15481 | |||
15482 | // The ID used to identify the inventory configuration. | ||
15483 | // | ||
15484 | // Id is a required field | ||
15485 | Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` | ||
15486 | |||
15487 | // Specifies the inventory configuration. | ||
15488 | // | ||
15489 | // InventoryConfiguration is a required field | ||
15490 | InventoryConfiguration *InventoryConfiguration `locationName:"InventoryConfiguration" type:"structure" required:"true"` | ||
15491 | } | ||
15492 | |||
15493 | // String returns the string representation | ||
15494 | func (s PutBucketInventoryConfigurationInput) String() string { | ||
15495 | return awsutil.Prettify(s) | ||
15496 | } | ||
15497 | |||
15498 | // GoString returns the string representation | ||
15499 | func (s PutBucketInventoryConfigurationInput) GoString() string { | ||
15500 | return s.String() | ||
15501 | } | ||
15502 | |||
15503 | // Validate inspects the fields of the type to determine if they are valid. | ||
15504 | func (s *PutBucketInventoryConfigurationInput) Validate() error { | ||
15505 | invalidParams := request.ErrInvalidParams{Context: "PutBucketInventoryConfigurationInput"} | ||
15506 | if s.Bucket == nil { | ||
15507 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
15508 | } | ||
15509 | if s.Id == nil { | ||
15510 | invalidParams.Add(request.NewErrParamRequired("Id")) | ||
15511 | } | ||
15512 | if s.InventoryConfiguration == nil { | ||
15513 | invalidParams.Add(request.NewErrParamRequired("InventoryConfiguration")) | ||
15514 | } | ||
15515 | if s.InventoryConfiguration != nil { | ||
15516 | if err := s.InventoryConfiguration.Validate(); err != nil { | ||
15517 | invalidParams.AddNested("InventoryConfiguration", err.(request.ErrInvalidParams)) | ||
15518 | } | ||
15519 | } | ||
15520 | |||
15521 | if invalidParams.Len() > 0 { | ||
15522 | return invalidParams | ||
15523 | } | ||
15524 | return nil | ||
15525 | } | ||
15526 | |||
15527 | // SetBucket sets the Bucket field's value. | ||
15528 | func (s *PutBucketInventoryConfigurationInput) SetBucket(v string) *PutBucketInventoryConfigurationInput { | ||
15529 | s.Bucket = &v | ||
15530 | return s | ||
15531 | } | ||
15532 | |||
15533 | // SetId sets the Id field's value. | ||
15534 | func (s *PutBucketInventoryConfigurationInput) SetId(v string) *PutBucketInventoryConfigurationInput { | ||
15535 | s.Id = &v | ||
15536 | return s | ||
15537 | } | ||
15538 | |||
15539 | // SetInventoryConfiguration sets the InventoryConfiguration field's value. | ||
15540 | func (s *PutBucketInventoryConfigurationInput) SetInventoryConfiguration(v *InventoryConfiguration) *PutBucketInventoryConfigurationInput { | ||
15541 | s.InventoryConfiguration = v | ||
15542 | return s | ||
15543 | } | ||
15544 | |||
15545 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketInventoryConfigurationOutput | ||
15546 | type PutBucketInventoryConfigurationOutput struct { | ||
15547 | _ struct{} `type:"structure"` | ||
15548 | } | ||
15549 | |||
15550 | // String returns the string representation | ||
15551 | func (s PutBucketInventoryConfigurationOutput) String() string { | ||
15552 | return awsutil.Prettify(s) | ||
15553 | } | ||
15554 | |||
15555 | // GoString returns the string representation | ||
15556 | func (s PutBucketInventoryConfigurationOutput) GoString() string { | ||
15557 | return s.String() | ||
15558 | } | ||
15559 | |||
15560 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLifecycleConfigurationRequest | ||
15561 | type PutBucketLifecycleConfigurationInput struct { | ||
15562 | _ struct{} `type:"structure" payload:"LifecycleConfiguration"` | ||
15563 | |||
15564 | // Bucket is a required field | ||
15565 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
15566 | |||
15567 | LifecycleConfiguration *BucketLifecycleConfiguration `locationName:"LifecycleConfiguration" type:"structure"` | ||
15568 | } | ||
15569 | |||
15570 | // String returns the string representation | ||
15571 | func (s PutBucketLifecycleConfigurationInput) String() string { | ||
15572 | return awsutil.Prettify(s) | ||
15573 | } | ||
15574 | |||
15575 | // GoString returns the string representation | ||
15576 | func (s PutBucketLifecycleConfigurationInput) GoString() string { | ||
15577 | return s.String() | ||
15578 | } | ||
15579 | |||
15580 | // Validate inspects the fields of the type to determine if they are valid. | ||
15581 | func (s *PutBucketLifecycleConfigurationInput) Validate() error { | ||
15582 | invalidParams := request.ErrInvalidParams{Context: "PutBucketLifecycleConfigurationInput"} | ||
15583 | if s.Bucket == nil { | ||
15584 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
15585 | } | ||
15586 | if s.LifecycleConfiguration != nil { | ||
15587 | if err := s.LifecycleConfiguration.Validate(); err != nil { | ||
15588 | invalidParams.AddNested("LifecycleConfiguration", err.(request.ErrInvalidParams)) | ||
15589 | } | ||
15590 | } | ||
15591 | |||
15592 | if invalidParams.Len() > 0 { | ||
15593 | return invalidParams | ||
15594 | } | ||
15595 | return nil | ||
15596 | } | ||
15597 | |||
15598 | // SetBucket sets the Bucket field's value. | ||
15599 | func (s *PutBucketLifecycleConfigurationInput) SetBucket(v string) *PutBucketLifecycleConfigurationInput { | ||
15600 | s.Bucket = &v | ||
15601 | return s | ||
15602 | } | ||
15603 | |||
15604 | // SetLifecycleConfiguration sets the LifecycleConfiguration field's value. | ||
15605 | func (s *PutBucketLifecycleConfigurationInput) SetLifecycleConfiguration(v *BucketLifecycleConfiguration) *PutBucketLifecycleConfigurationInput { | ||
15606 | s.LifecycleConfiguration = v | ||
15607 | return s | ||
15608 | } | ||
15609 | |||
15610 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLifecycleConfigurationOutput | ||
15611 | type PutBucketLifecycleConfigurationOutput struct { | ||
15612 | _ struct{} `type:"structure"` | ||
15613 | } | ||
15614 | |||
15615 | // String returns the string representation | ||
15616 | func (s PutBucketLifecycleConfigurationOutput) String() string { | ||
15617 | return awsutil.Prettify(s) | ||
15618 | } | ||
15619 | |||
15620 | // GoString returns the string representation | ||
15621 | func (s PutBucketLifecycleConfigurationOutput) GoString() string { | ||
15622 | return s.String() | ||
15623 | } | ||
15624 | |||
15625 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLifecycleRequest | ||
15626 | type PutBucketLifecycleInput struct { | ||
15627 | _ struct{} `type:"structure" payload:"LifecycleConfiguration"` | ||
15628 | |||
15629 | // Bucket is a required field | ||
15630 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
15631 | |||
15632 | LifecycleConfiguration *LifecycleConfiguration `locationName:"LifecycleConfiguration" type:"structure"` | ||
15633 | } | ||
15634 | |||
15635 | // String returns the string representation | ||
15636 | func (s PutBucketLifecycleInput) String() string { | ||
15637 | return awsutil.Prettify(s) | ||
15638 | } | ||
15639 | |||
15640 | // GoString returns the string representation | ||
15641 | func (s PutBucketLifecycleInput) GoString() string { | ||
15642 | return s.String() | ||
15643 | } | ||
15644 | |||
15645 | // Validate inspects the fields of the type to determine if they are valid. | ||
15646 | func (s *PutBucketLifecycleInput) Validate() error { | ||
15647 | invalidParams := request.ErrInvalidParams{Context: "PutBucketLifecycleInput"} | ||
15648 | if s.Bucket == nil { | ||
15649 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
15650 | } | ||
15651 | if s.LifecycleConfiguration != nil { | ||
15652 | if err := s.LifecycleConfiguration.Validate(); err != nil { | ||
15653 | invalidParams.AddNested("LifecycleConfiguration", err.(request.ErrInvalidParams)) | ||
15654 | } | ||
15655 | } | ||
15656 | |||
15657 | if invalidParams.Len() > 0 { | ||
15658 | return invalidParams | ||
15659 | } | ||
15660 | return nil | ||
15661 | } | ||
15662 | |||
15663 | // SetBucket sets the Bucket field's value. | ||
15664 | func (s *PutBucketLifecycleInput) SetBucket(v string) *PutBucketLifecycleInput { | ||
15665 | s.Bucket = &v | ||
15666 | return s | ||
15667 | } | ||
15668 | |||
15669 | // SetLifecycleConfiguration sets the LifecycleConfiguration field's value. | ||
15670 | func (s *PutBucketLifecycleInput) SetLifecycleConfiguration(v *LifecycleConfiguration) *PutBucketLifecycleInput { | ||
15671 | s.LifecycleConfiguration = v | ||
15672 | return s | ||
15673 | } | ||
15674 | |||
15675 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLifecycleOutput | ||
15676 | type PutBucketLifecycleOutput struct { | ||
15677 | _ struct{} `type:"structure"` | ||
15678 | } | ||
15679 | |||
15680 | // String returns the string representation | ||
15681 | func (s PutBucketLifecycleOutput) String() string { | ||
15682 | return awsutil.Prettify(s) | ||
15683 | } | ||
15684 | |||
15685 | // GoString returns the string representation | ||
15686 | func (s PutBucketLifecycleOutput) GoString() string { | ||
15687 | return s.String() | ||
15688 | } | ||
15689 | |||
15690 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLoggingRequest | ||
15691 | type PutBucketLoggingInput struct { | ||
15692 | _ struct{} `type:"structure" payload:"BucketLoggingStatus"` | ||
15693 | |||
15694 | // Bucket is a required field | ||
15695 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
15696 | |||
15697 | // BucketLoggingStatus is a required field | ||
15698 | BucketLoggingStatus *BucketLoggingStatus `locationName:"BucketLoggingStatus" type:"structure" required:"true"` | ||
15699 | } | ||
15700 | |||
15701 | // String returns the string representation | ||
15702 | func (s PutBucketLoggingInput) String() string { | ||
15703 | return awsutil.Prettify(s) | ||
15704 | } | ||
15705 | |||
15706 | // GoString returns the string representation | ||
15707 | func (s PutBucketLoggingInput) GoString() string { | ||
15708 | return s.String() | ||
15709 | } | ||
15710 | |||
15711 | // Validate inspects the fields of the type to determine if they are valid. | ||
15712 | func (s *PutBucketLoggingInput) Validate() error { | ||
15713 | invalidParams := request.ErrInvalidParams{Context: "PutBucketLoggingInput"} | ||
15714 | if s.Bucket == nil { | ||
15715 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
15716 | } | ||
15717 | if s.BucketLoggingStatus == nil { | ||
15718 | invalidParams.Add(request.NewErrParamRequired("BucketLoggingStatus")) | ||
15719 | } | ||
15720 | if s.BucketLoggingStatus != nil { | ||
15721 | if err := s.BucketLoggingStatus.Validate(); err != nil { | ||
15722 | invalidParams.AddNested("BucketLoggingStatus", err.(request.ErrInvalidParams)) | ||
15723 | } | ||
15724 | } | ||
15725 | |||
15726 | if invalidParams.Len() > 0 { | ||
15727 | return invalidParams | ||
15728 | } | ||
15729 | return nil | ||
15730 | } | ||
15731 | |||
15732 | // SetBucket sets the Bucket field's value. | ||
15733 | func (s *PutBucketLoggingInput) SetBucket(v string) *PutBucketLoggingInput { | ||
15734 | s.Bucket = &v | ||
15735 | return s | ||
15736 | } | ||
15737 | |||
15738 | // SetBucketLoggingStatus sets the BucketLoggingStatus field's value. | ||
15739 | func (s *PutBucketLoggingInput) SetBucketLoggingStatus(v *BucketLoggingStatus) *PutBucketLoggingInput { | ||
15740 | s.BucketLoggingStatus = v | ||
15741 | return s | ||
15742 | } | ||
15743 | |||
15744 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLoggingOutput | ||
15745 | type PutBucketLoggingOutput struct { | ||
15746 | _ struct{} `type:"structure"` | ||
15747 | } | ||
15748 | |||
15749 | // String returns the string representation | ||
15750 | func (s PutBucketLoggingOutput) String() string { | ||
15751 | return awsutil.Prettify(s) | ||
15752 | } | ||
15753 | |||
15754 | // GoString returns the string representation | ||
15755 | func (s PutBucketLoggingOutput) GoString() string { | ||
15756 | return s.String() | ||
15757 | } | ||
15758 | |||
15759 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketMetricsConfigurationRequest | ||
15760 | type PutBucketMetricsConfigurationInput struct { | ||
15761 | _ struct{} `type:"structure" payload:"MetricsConfiguration"` | ||
15762 | |||
15763 | // The name of the bucket for which the metrics configuration is set. | ||
15764 | // | ||
15765 | // Bucket is a required field | ||
15766 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
15767 | |||
15768 | // The ID used to identify the metrics configuration. | ||
15769 | // | ||
15770 | // Id is a required field | ||
15771 | Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` | ||
15772 | |||
15773 | // Specifies the metrics configuration. | ||
15774 | // | ||
15775 | // MetricsConfiguration is a required field | ||
15776 | MetricsConfiguration *MetricsConfiguration `locationName:"MetricsConfiguration" type:"structure" required:"true"` | ||
15777 | } | ||
15778 | |||
15779 | // String returns the string representation | ||
15780 | func (s PutBucketMetricsConfigurationInput) String() string { | ||
15781 | return awsutil.Prettify(s) | ||
15782 | } | ||
15783 | |||
15784 | // GoString returns the string representation | ||
15785 | func (s PutBucketMetricsConfigurationInput) GoString() string { | ||
15786 | return s.String() | ||
15787 | } | ||
15788 | |||
15789 | // Validate inspects the fields of the type to determine if they are valid. | ||
15790 | func (s *PutBucketMetricsConfigurationInput) Validate() error { | ||
15791 | invalidParams := request.ErrInvalidParams{Context: "PutBucketMetricsConfigurationInput"} | ||
15792 | if s.Bucket == nil { | ||
15793 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
15794 | } | ||
15795 | if s.Id == nil { | ||
15796 | invalidParams.Add(request.NewErrParamRequired("Id")) | ||
15797 | } | ||
15798 | if s.MetricsConfiguration == nil { | ||
15799 | invalidParams.Add(request.NewErrParamRequired("MetricsConfiguration")) | ||
15800 | } | ||
15801 | if s.MetricsConfiguration != nil { | ||
15802 | if err := s.MetricsConfiguration.Validate(); err != nil { | ||
15803 | invalidParams.AddNested("MetricsConfiguration", err.(request.ErrInvalidParams)) | ||
15804 | } | ||
15805 | } | ||
15806 | |||
15807 | if invalidParams.Len() > 0 { | ||
15808 | return invalidParams | ||
15809 | } | ||
15810 | return nil | ||
15811 | } | ||
15812 | |||
15813 | // SetBucket sets the Bucket field's value. | ||
15814 | func (s *PutBucketMetricsConfigurationInput) SetBucket(v string) *PutBucketMetricsConfigurationInput { | ||
15815 | s.Bucket = &v | ||
15816 | return s | ||
15817 | } | ||
15818 | |||
15819 | // SetId sets the Id field's value. | ||
15820 | func (s *PutBucketMetricsConfigurationInput) SetId(v string) *PutBucketMetricsConfigurationInput { | ||
15821 | s.Id = &v | ||
15822 | return s | ||
15823 | } | ||
15824 | |||
15825 | // SetMetricsConfiguration sets the MetricsConfiguration field's value. | ||
15826 | func (s *PutBucketMetricsConfigurationInput) SetMetricsConfiguration(v *MetricsConfiguration) *PutBucketMetricsConfigurationInput { | ||
15827 | s.MetricsConfiguration = v | ||
15828 | return s | ||
15829 | } | ||
15830 | |||
15831 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketMetricsConfigurationOutput | ||
15832 | type PutBucketMetricsConfigurationOutput struct { | ||
15833 | _ struct{} `type:"structure"` | ||
15834 | } | ||
15835 | |||
15836 | // String returns the string representation | ||
15837 | func (s PutBucketMetricsConfigurationOutput) String() string { | ||
15838 | return awsutil.Prettify(s) | ||
15839 | } | ||
15840 | |||
15841 | // GoString returns the string representation | ||
15842 | func (s PutBucketMetricsConfigurationOutput) GoString() string { | ||
15843 | return s.String() | ||
15844 | } | ||
15845 | |||
15846 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketNotificationConfigurationRequest | ||
15847 | type PutBucketNotificationConfigurationInput struct { | ||
15848 | _ struct{} `type:"structure" payload:"NotificationConfiguration"` | ||
15849 | |||
15850 | // Bucket is a required field | ||
15851 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
15852 | |||
15853 | // Container for specifying the notification configuration of the bucket. If | ||
15854 | // this element is empty, notifications are turned off on the bucket. | ||
15855 | // | ||
15856 | // NotificationConfiguration is a required field | ||
15857 | NotificationConfiguration *NotificationConfiguration `locationName:"NotificationConfiguration" type:"structure" required:"true"` | ||
15858 | } | ||
15859 | |||
15860 | // String returns the string representation | ||
15861 | func (s PutBucketNotificationConfigurationInput) String() string { | ||
15862 | return awsutil.Prettify(s) | ||
15863 | } | ||
15864 | |||
15865 | // GoString returns the string representation | ||
15866 | func (s PutBucketNotificationConfigurationInput) GoString() string { | ||
15867 | return s.String() | ||
15868 | } | ||
15869 | |||
15870 | // Validate inspects the fields of the type to determine if they are valid. | ||
15871 | func (s *PutBucketNotificationConfigurationInput) Validate() error { | ||
15872 | invalidParams := request.ErrInvalidParams{Context: "PutBucketNotificationConfigurationInput"} | ||
15873 | if s.Bucket == nil { | ||
15874 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
15875 | } | ||
15876 | if s.NotificationConfiguration == nil { | ||
15877 | invalidParams.Add(request.NewErrParamRequired("NotificationConfiguration")) | ||
15878 | } | ||
15879 | if s.NotificationConfiguration != nil { | ||
15880 | if err := s.NotificationConfiguration.Validate(); err != nil { | ||
15881 | invalidParams.AddNested("NotificationConfiguration", err.(request.ErrInvalidParams)) | ||
15882 | } | ||
15883 | } | ||
15884 | |||
15885 | if invalidParams.Len() > 0 { | ||
15886 | return invalidParams | ||
15887 | } | ||
15888 | return nil | ||
15889 | } | ||
15890 | |||
15891 | // SetBucket sets the Bucket field's value. | ||
15892 | func (s *PutBucketNotificationConfigurationInput) SetBucket(v string) *PutBucketNotificationConfigurationInput { | ||
15893 | s.Bucket = &v | ||
15894 | return s | ||
15895 | } | ||
15896 | |||
15897 | // SetNotificationConfiguration sets the NotificationConfiguration field's value. | ||
15898 | func (s *PutBucketNotificationConfigurationInput) SetNotificationConfiguration(v *NotificationConfiguration) *PutBucketNotificationConfigurationInput { | ||
15899 | s.NotificationConfiguration = v | ||
15900 | return s | ||
15901 | } | ||
15902 | |||
15903 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketNotificationConfigurationOutput | ||
15904 | type PutBucketNotificationConfigurationOutput struct { | ||
15905 | _ struct{} `type:"structure"` | ||
15906 | } | ||
15907 | |||
15908 | // String returns the string representation | ||
15909 | func (s PutBucketNotificationConfigurationOutput) String() string { | ||
15910 | return awsutil.Prettify(s) | ||
15911 | } | ||
15912 | |||
15913 | // GoString returns the string representation | ||
15914 | func (s PutBucketNotificationConfigurationOutput) GoString() string { | ||
15915 | return s.String() | ||
15916 | } | ||
15917 | |||
15918 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketNotificationRequest | ||
15919 | type PutBucketNotificationInput struct { | ||
15920 | _ struct{} `type:"structure" payload:"NotificationConfiguration"` | ||
15921 | |||
15922 | // Bucket is a required field | ||
15923 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
15924 | |||
15925 | // NotificationConfiguration is a required field | ||
15926 | NotificationConfiguration *NotificationConfigurationDeprecated `locationName:"NotificationConfiguration" type:"structure" required:"true"` | ||
15927 | } | ||
15928 | |||
15929 | // String returns the string representation | ||
15930 | func (s PutBucketNotificationInput) String() string { | ||
15931 | return awsutil.Prettify(s) | ||
15932 | } | ||
15933 | |||
15934 | // GoString returns the string representation | ||
15935 | func (s PutBucketNotificationInput) GoString() string { | ||
15936 | return s.String() | ||
15937 | } | ||
15938 | |||
15939 | // Validate inspects the fields of the type to determine if they are valid. | ||
15940 | func (s *PutBucketNotificationInput) Validate() error { | ||
15941 | invalidParams := request.ErrInvalidParams{Context: "PutBucketNotificationInput"} | ||
15942 | if s.Bucket == nil { | ||
15943 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
15944 | } | ||
15945 | if s.NotificationConfiguration == nil { | ||
15946 | invalidParams.Add(request.NewErrParamRequired("NotificationConfiguration")) | ||
15947 | } | ||
15948 | |||
15949 | if invalidParams.Len() > 0 { | ||
15950 | return invalidParams | ||
15951 | } | ||
15952 | return nil | ||
15953 | } | ||
15954 | |||
15955 | // SetBucket sets the Bucket field's value. | ||
15956 | func (s *PutBucketNotificationInput) SetBucket(v string) *PutBucketNotificationInput { | ||
15957 | s.Bucket = &v | ||
15958 | return s | ||
15959 | } | ||
15960 | |||
15961 | // SetNotificationConfiguration sets the NotificationConfiguration field's value. | ||
15962 | func (s *PutBucketNotificationInput) SetNotificationConfiguration(v *NotificationConfigurationDeprecated) *PutBucketNotificationInput { | ||
15963 | s.NotificationConfiguration = v | ||
15964 | return s | ||
15965 | } | ||
15966 | |||
15967 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketNotificationOutput | ||
15968 | type PutBucketNotificationOutput struct { | ||
15969 | _ struct{} `type:"structure"` | ||
15970 | } | ||
15971 | |||
15972 | // String returns the string representation | ||
15973 | func (s PutBucketNotificationOutput) String() string { | ||
15974 | return awsutil.Prettify(s) | ||
15975 | } | ||
15976 | |||
15977 | // GoString returns the string representation | ||
15978 | func (s PutBucketNotificationOutput) GoString() string { | ||
15979 | return s.String() | ||
15980 | } | ||
15981 | |||
15982 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketPolicyRequest | ||
15983 | type PutBucketPolicyInput struct { | ||
15984 | _ struct{} `type:"structure" payload:"Policy"` | ||
15985 | |||
15986 | // Bucket is a required field | ||
15987 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
15988 | |||
15989 | // The bucket policy as a JSON document. | ||
15990 | // | ||
15991 | // Policy is a required field | ||
15992 | Policy *string `type:"string" required:"true"` | ||
15993 | } | ||
15994 | |||
15995 | // String returns the string representation | ||
15996 | func (s PutBucketPolicyInput) String() string { | ||
15997 | return awsutil.Prettify(s) | ||
15998 | } | ||
15999 | |||
16000 | // GoString returns the string representation | ||
16001 | func (s PutBucketPolicyInput) GoString() string { | ||
16002 | return s.String() | ||
16003 | } | ||
16004 | |||
16005 | // Validate inspects the fields of the type to determine if they are valid. | ||
16006 | func (s *PutBucketPolicyInput) Validate() error { | ||
16007 | invalidParams := request.ErrInvalidParams{Context: "PutBucketPolicyInput"} | ||
16008 | if s.Bucket == nil { | ||
16009 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
16010 | } | ||
16011 | if s.Policy == nil { | ||
16012 | invalidParams.Add(request.NewErrParamRequired("Policy")) | ||
16013 | } | ||
16014 | |||
16015 | if invalidParams.Len() > 0 { | ||
16016 | return invalidParams | ||
16017 | } | ||
16018 | return nil | ||
16019 | } | ||
16020 | |||
16021 | // SetBucket sets the Bucket field's value. | ||
16022 | func (s *PutBucketPolicyInput) SetBucket(v string) *PutBucketPolicyInput { | ||
16023 | s.Bucket = &v | ||
16024 | return s | ||
16025 | } | ||
16026 | |||
16027 | // SetPolicy sets the Policy field's value. | ||
16028 | func (s *PutBucketPolicyInput) SetPolicy(v string) *PutBucketPolicyInput { | ||
16029 | s.Policy = &v | ||
16030 | return s | ||
16031 | } | ||
16032 | |||
16033 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketPolicyOutput | ||
16034 | type PutBucketPolicyOutput struct { | ||
16035 | _ struct{} `type:"structure"` | ||
16036 | } | ||
16037 | |||
16038 | // String returns the string representation | ||
16039 | func (s PutBucketPolicyOutput) String() string { | ||
16040 | return awsutil.Prettify(s) | ||
16041 | } | ||
16042 | |||
16043 | // GoString returns the string representation | ||
16044 | func (s PutBucketPolicyOutput) GoString() string { | ||
16045 | return s.String() | ||
16046 | } | ||
16047 | |||
16048 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketReplicationRequest | ||
16049 | type PutBucketReplicationInput struct { | ||
16050 | _ struct{} `type:"structure" payload:"ReplicationConfiguration"` | ||
16051 | |||
16052 | // Bucket is a required field | ||
16053 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
16054 | |||
16055 | // Container for replication rules. You can add as many as 1,000 rules. Total | ||
16056 | // replication configuration size can be up to 2 MB. | ||
16057 | // | ||
16058 | // ReplicationConfiguration is a required field | ||
16059 | ReplicationConfiguration *ReplicationConfiguration `locationName:"ReplicationConfiguration" type:"structure" required:"true"` | ||
16060 | } | ||
16061 | |||
16062 | // String returns the string representation | ||
16063 | func (s PutBucketReplicationInput) String() string { | ||
16064 | return awsutil.Prettify(s) | ||
16065 | } | ||
16066 | |||
16067 | // GoString returns the string representation | ||
16068 | func (s PutBucketReplicationInput) GoString() string { | ||
16069 | return s.String() | ||
16070 | } | ||
16071 | |||
16072 | // Validate inspects the fields of the type to determine if they are valid. | ||
16073 | func (s *PutBucketReplicationInput) Validate() error { | ||
16074 | invalidParams := request.ErrInvalidParams{Context: "PutBucketReplicationInput"} | ||
16075 | if s.Bucket == nil { | ||
16076 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
16077 | } | ||
16078 | if s.ReplicationConfiguration == nil { | ||
16079 | invalidParams.Add(request.NewErrParamRequired("ReplicationConfiguration")) | ||
16080 | } | ||
16081 | if s.ReplicationConfiguration != nil { | ||
16082 | if err := s.ReplicationConfiguration.Validate(); err != nil { | ||
16083 | invalidParams.AddNested("ReplicationConfiguration", err.(request.ErrInvalidParams)) | ||
16084 | } | ||
16085 | } | ||
16086 | |||
16087 | if invalidParams.Len() > 0 { | ||
16088 | return invalidParams | ||
16089 | } | ||
16090 | return nil | ||
16091 | } | ||
16092 | |||
16093 | // SetBucket sets the Bucket field's value. | ||
16094 | func (s *PutBucketReplicationInput) SetBucket(v string) *PutBucketReplicationInput { | ||
16095 | s.Bucket = &v | ||
16096 | return s | ||
16097 | } | ||
16098 | |||
16099 | // SetReplicationConfiguration sets the ReplicationConfiguration field's value. | ||
16100 | func (s *PutBucketReplicationInput) SetReplicationConfiguration(v *ReplicationConfiguration) *PutBucketReplicationInput { | ||
16101 | s.ReplicationConfiguration = v | ||
16102 | return s | ||
16103 | } | ||
16104 | |||
16105 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketReplicationOutput | ||
16106 | type PutBucketReplicationOutput struct { | ||
16107 | _ struct{} `type:"structure"` | ||
16108 | } | ||
16109 | |||
16110 | // String returns the string representation | ||
16111 | func (s PutBucketReplicationOutput) String() string { | ||
16112 | return awsutil.Prettify(s) | ||
16113 | } | ||
16114 | |||
16115 | // GoString returns the string representation | ||
16116 | func (s PutBucketReplicationOutput) GoString() string { | ||
16117 | return s.String() | ||
16118 | } | ||
16119 | |||
16120 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketRequestPaymentRequest | ||
16121 | type PutBucketRequestPaymentInput struct { | ||
16122 | _ struct{} `type:"structure" payload:"RequestPaymentConfiguration"` | ||
16123 | |||
16124 | // Bucket is a required field | ||
16125 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
16126 | |||
16127 | // RequestPaymentConfiguration is a required field | ||
16128 | RequestPaymentConfiguration *RequestPaymentConfiguration `locationName:"RequestPaymentConfiguration" type:"structure" required:"true"` | ||
16129 | } | ||
16130 | |||
16131 | // String returns the string representation | ||
16132 | func (s PutBucketRequestPaymentInput) String() string { | ||
16133 | return awsutil.Prettify(s) | ||
16134 | } | ||
16135 | |||
16136 | // GoString returns the string representation | ||
16137 | func (s PutBucketRequestPaymentInput) GoString() string { | ||
16138 | return s.String() | ||
16139 | } | ||
16140 | |||
16141 | // Validate inspects the fields of the type to determine if they are valid. | ||
16142 | func (s *PutBucketRequestPaymentInput) Validate() error { | ||
16143 | invalidParams := request.ErrInvalidParams{Context: "PutBucketRequestPaymentInput"} | ||
16144 | if s.Bucket == nil { | ||
16145 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
16146 | } | ||
16147 | if s.RequestPaymentConfiguration == nil { | ||
16148 | invalidParams.Add(request.NewErrParamRequired("RequestPaymentConfiguration")) | ||
16149 | } | ||
16150 | if s.RequestPaymentConfiguration != nil { | ||
16151 | if err := s.RequestPaymentConfiguration.Validate(); err != nil { | ||
16152 | invalidParams.AddNested("RequestPaymentConfiguration", err.(request.ErrInvalidParams)) | ||
16153 | } | ||
16154 | } | ||
16155 | |||
16156 | if invalidParams.Len() > 0 { | ||
16157 | return invalidParams | ||
16158 | } | ||
16159 | return nil | ||
16160 | } | ||
16161 | |||
16162 | // SetBucket sets the Bucket field's value. | ||
16163 | func (s *PutBucketRequestPaymentInput) SetBucket(v string) *PutBucketRequestPaymentInput { | ||
16164 | s.Bucket = &v | ||
16165 | return s | ||
16166 | } | ||
16167 | |||
16168 | // SetRequestPaymentConfiguration sets the RequestPaymentConfiguration field's value. | ||
16169 | func (s *PutBucketRequestPaymentInput) SetRequestPaymentConfiguration(v *RequestPaymentConfiguration) *PutBucketRequestPaymentInput { | ||
16170 | s.RequestPaymentConfiguration = v | ||
16171 | return s | ||
16172 | } | ||
16173 | |||
16174 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketRequestPaymentOutput | ||
16175 | type PutBucketRequestPaymentOutput struct { | ||
16176 | _ struct{} `type:"structure"` | ||
16177 | } | ||
16178 | |||
16179 | // String returns the string representation | ||
16180 | func (s PutBucketRequestPaymentOutput) String() string { | ||
16181 | return awsutil.Prettify(s) | ||
16182 | } | ||
16183 | |||
16184 | // GoString returns the string representation | ||
16185 | func (s PutBucketRequestPaymentOutput) GoString() string { | ||
16186 | return s.String() | ||
16187 | } | ||
16188 | |||
16189 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketTaggingRequest | ||
16190 | type PutBucketTaggingInput struct { | ||
16191 | _ struct{} `type:"structure" payload:"Tagging"` | ||
16192 | |||
16193 | // Bucket is a required field | ||
16194 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
16195 | |||
16196 | // Tagging is a required field | ||
16197 | Tagging *Tagging `locationName:"Tagging" type:"structure" required:"true"` | ||
16198 | } | ||
16199 | |||
16200 | // String returns the string representation | ||
16201 | func (s PutBucketTaggingInput) String() string { | ||
16202 | return awsutil.Prettify(s) | ||
16203 | } | ||
16204 | |||
16205 | // GoString returns the string representation | ||
16206 | func (s PutBucketTaggingInput) GoString() string { | ||
16207 | return s.String() | ||
16208 | } | ||
16209 | |||
16210 | // Validate inspects the fields of the type to determine if they are valid. | ||
16211 | func (s *PutBucketTaggingInput) Validate() error { | ||
16212 | invalidParams := request.ErrInvalidParams{Context: "PutBucketTaggingInput"} | ||
16213 | if s.Bucket == nil { | ||
16214 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
16215 | } | ||
16216 | if s.Tagging == nil { | ||
16217 | invalidParams.Add(request.NewErrParamRequired("Tagging")) | ||
16218 | } | ||
16219 | if s.Tagging != nil { | ||
16220 | if err := s.Tagging.Validate(); err != nil { | ||
16221 | invalidParams.AddNested("Tagging", err.(request.ErrInvalidParams)) | ||
16222 | } | ||
16223 | } | ||
16224 | |||
16225 | if invalidParams.Len() > 0 { | ||
16226 | return invalidParams | ||
16227 | } | ||
16228 | return nil | ||
16229 | } | ||
16230 | |||
16231 | // SetBucket sets the Bucket field's value. | ||
16232 | func (s *PutBucketTaggingInput) SetBucket(v string) *PutBucketTaggingInput { | ||
16233 | s.Bucket = &v | ||
16234 | return s | ||
16235 | } | ||
16236 | |||
16237 | // SetTagging sets the Tagging field's value. | ||
16238 | func (s *PutBucketTaggingInput) SetTagging(v *Tagging) *PutBucketTaggingInput { | ||
16239 | s.Tagging = v | ||
16240 | return s | ||
16241 | } | ||
16242 | |||
16243 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketTaggingOutput | ||
16244 | type PutBucketTaggingOutput struct { | ||
16245 | _ struct{} `type:"structure"` | ||
16246 | } | ||
16247 | |||
16248 | // String returns the string representation | ||
16249 | func (s PutBucketTaggingOutput) String() string { | ||
16250 | return awsutil.Prettify(s) | ||
16251 | } | ||
16252 | |||
16253 | // GoString returns the string representation | ||
16254 | func (s PutBucketTaggingOutput) GoString() string { | ||
16255 | return s.String() | ||
16256 | } | ||
16257 | |||
16258 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketVersioningRequest | ||
16259 | type PutBucketVersioningInput struct { | ||
16260 | _ struct{} `type:"structure" payload:"VersioningConfiguration"` | ||
16261 | |||
16262 | // Bucket is a required field | ||
16263 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
16264 | |||
16265 | // The concatenation of the authentication device's serial number, a space, | ||
16266 | // and the value that is displayed on your authentication device. | ||
16267 | MFA *string `location:"header" locationName:"x-amz-mfa" type:"string"` | ||
16268 | |||
16269 | // VersioningConfiguration is a required field | ||
16270 | VersioningConfiguration *VersioningConfiguration `locationName:"VersioningConfiguration" type:"structure" required:"true"` | ||
16271 | } | ||
16272 | |||
16273 | // String returns the string representation | ||
16274 | func (s PutBucketVersioningInput) String() string { | ||
16275 | return awsutil.Prettify(s) | ||
16276 | } | ||
16277 | |||
16278 | // GoString returns the string representation | ||
16279 | func (s PutBucketVersioningInput) GoString() string { | ||
16280 | return s.String() | ||
16281 | } | ||
16282 | |||
16283 | // Validate inspects the fields of the type to determine if they are valid. | ||
16284 | func (s *PutBucketVersioningInput) Validate() error { | ||
16285 | invalidParams := request.ErrInvalidParams{Context: "PutBucketVersioningInput"} | ||
16286 | if s.Bucket == nil { | ||
16287 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
16288 | } | ||
16289 | if s.VersioningConfiguration == nil { | ||
16290 | invalidParams.Add(request.NewErrParamRequired("VersioningConfiguration")) | ||
16291 | } | ||
16292 | |||
16293 | if invalidParams.Len() > 0 { | ||
16294 | return invalidParams | ||
16295 | } | ||
16296 | return nil | ||
16297 | } | ||
16298 | |||
16299 | // SetBucket sets the Bucket field's value. | ||
16300 | func (s *PutBucketVersioningInput) SetBucket(v string) *PutBucketVersioningInput { | ||
16301 | s.Bucket = &v | ||
16302 | return s | ||
16303 | } | ||
16304 | |||
16305 | // SetMFA sets the MFA field's value. | ||
16306 | func (s *PutBucketVersioningInput) SetMFA(v string) *PutBucketVersioningInput { | ||
16307 | s.MFA = &v | ||
16308 | return s | ||
16309 | } | ||
16310 | |||
16311 | // SetVersioningConfiguration sets the VersioningConfiguration field's value. | ||
16312 | func (s *PutBucketVersioningInput) SetVersioningConfiguration(v *VersioningConfiguration) *PutBucketVersioningInput { | ||
16313 | s.VersioningConfiguration = v | ||
16314 | return s | ||
16315 | } | ||
16316 | |||
16317 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketVersioningOutput | ||
16318 | type PutBucketVersioningOutput struct { | ||
16319 | _ struct{} `type:"structure"` | ||
16320 | } | ||
16321 | |||
16322 | // String returns the string representation | ||
16323 | func (s PutBucketVersioningOutput) String() string { | ||
16324 | return awsutil.Prettify(s) | ||
16325 | } | ||
16326 | |||
16327 | // GoString returns the string representation | ||
16328 | func (s PutBucketVersioningOutput) GoString() string { | ||
16329 | return s.String() | ||
16330 | } | ||
16331 | |||
16332 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketWebsiteRequest | ||
16333 | type PutBucketWebsiteInput struct { | ||
16334 | _ struct{} `type:"structure" payload:"WebsiteConfiguration"` | ||
16335 | |||
16336 | // Bucket is a required field | ||
16337 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
16338 | |||
16339 | // WebsiteConfiguration is a required field | ||
16340 | WebsiteConfiguration *WebsiteConfiguration `locationName:"WebsiteConfiguration" type:"structure" required:"true"` | ||
16341 | } | ||
16342 | |||
16343 | // String returns the string representation | ||
16344 | func (s PutBucketWebsiteInput) String() string { | ||
16345 | return awsutil.Prettify(s) | ||
16346 | } | ||
16347 | |||
16348 | // GoString returns the string representation | ||
16349 | func (s PutBucketWebsiteInput) GoString() string { | ||
16350 | return s.String() | ||
16351 | } | ||
16352 | |||
16353 | // Validate inspects the fields of the type to determine if they are valid. | ||
16354 | func (s *PutBucketWebsiteInput) Validate() error { | ||
16355 | invalidParams := request.ErrInvalidParams{Context: "PutBucketWebsiteInput"} | ||
16356 | if s.Bucket == nil { | ||
16357 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
16358 | } | ||
16359 | if s.WebsiteConfiguration == nil { | ||
16360 | invalidParams.Add(request.NewErrParamRequired("WebsiteConfiguration")) | ||
16361 | } | ||
16362 | if s.WebsiteConfiguration != nil { | ||
16363 | if err := s.WebsiteConfiguration.Validate(); err != nil { | ||
16364 | invalidParams.AddNested("WebsiteConfiguration", err.(request.ErrInvalidParams)) | ||
16365 | } | ||
16366 | } | ||
16367 | |||
16368 | if invalidParams.Len() > 0 { | ||
16369 | return invalidParams | ||
16370 | } | ||
16371 | return nil | ||
16372 | } | ||
16373 | |||
16374 | // SetBucket sets the Bucket field's value. | ||
16375 | func (s *PutBucketWebsiteInput) SetBucket(v string) *PutBucketWebsiteInput { | ||
16376 | s.Bucket = &v | ||
16377 | return s | ||
16378 | } | ||
16379 | |||
16380 | // SetWebsiteConfiguration sets the WebsiteConfiguration field's value. | ||
16381 | func (s *PutBucketWebsiteInput) SetWebsiteConfiguration(v *WebsiteConfiguration) *PutBucketWebsiteInput { | ||
16382 | s.WebsiteConfiguration = v | ||
16383 | return s | ||
16384 | } | ||
16385 | |||
16386 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketWebsiteOutput | ||
16387 | type PutBucketWebsiteOutput struct { | ||
16388 | _ struct{} `type:"structure"` | ||
16389 | } | ||
16390 | |||
16391 | // String returns the string representation | ||
16392 | func (s PutBucketWebsiteOutput) String() string { | ||
16393 | return awsutil.Prettify(s) | ||
16394 | } | ||
16395 | |||
16396 | // GoString returns the string representation | ||
16397 | func (s PutBucketWebsiteOutput) GoString() string { | ||
16398 | return s.String() | ||
16399 | } | ||
16400 | |||
16401 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectAclRequest | ||
16402 | type PutObjectAclInput struct { | ||
16403 | _ struct{} `type:"structure" payload:"AccessControlPolicy"` | ||
16404 | |||
16405 | // The canned ACL to apply to the object. | ||
16406 | ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"ObjectCannedACL"` | ||
16407 | |||
16408 | AccessControlPolicy *AccessControlPolicy `locationName:"AccessControlPolicy" type:"structure"` | ||
16409 | |||
16410 | // Bucket is a required field | ||
16411 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
16412 | |||
16413 | // Allows grantee the read, write, read ACP, and write ACP permissions on the | ||
16414 | // bucket. | ||
16415 | GrantFullControl *string `location:"header" locationName:"x-amz-grant-full-control" type:"string"` | ||
16416 | |||
16417 | // Allows grantee to list the objects in the bucket. | ||
16418 | GrantRead *string `location:"header" locationName:"x-amz-grant-read" type:"string"` | ||
16419 | |||
16420 | // Allows grantee to read the bucket ACL. | ||
16421 | GrantReadACP *string `location:"header" locationName:"x-amz-grant-read-acp" type:"string"` | ||
16422 | |||
16423 | // Allows grantee to create, overwrite, and delete any object in the bucket. | ||
16424 | GrantWrite *string `location:"header" locationName:"x-amz-grant-write" type:"string"` | ||
16425 | |||
16426 | // Allows grantee to write the ACL for the applicable bucket. | ||
16427 | GrantWriteACP *string `location:"header" locationName:"x-amz-grant-write-acp" type:"string"` | ||
16428 | |||
16429 | // Key is a required field | ||
16430 | Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` | ||
16431 | |||
16432 | // Confirms that the requester knows that she or he will be charged for the | ||
16433 | // request. Bucket owners need not specify this parameter in their requests. | ||
16434 | // Documentation on downloading objects from requester pays buckets can be found | ||
16435 | // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html | ||
16436 | RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` | ||
16437 | |||
16438 | // VersionId used to reference a specific version of the object. | ||
16439 | VersionId *string `location:"querystring" locationName:"versionId" type:"string"` | ||
16440 | } | ||
16441 | |||
16442 | // String returns the string representation | ||
16443 | func (s PutObjectAclInput) String() string { | ||
16444 | return awsutil.Prettify(s) | ||
16445 | } | ||
16446 | |||
16447 | // GoString returns the string representation | ||
16448 | func (s PutObjectAclInput) GoString() string { | ||
16449 | return s.String() | ||
16450 | } | ||
16451 | |||
16452 | // Validate inspects the fields of the type to determine if they are valid. | ||
16453 | func (s *PutObjectAclInput) Validate() error { | ||
16454 | invalidParams := request.ErrInvalidParams{Context: "PutObjectAclInput"} | ||
16455 | if s.Bucket == nil { | ||
16456 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
16457 | } | ||
16458 | if s.Key == nil { | ||
16459 | invalidParams.Add(request.NewErrParamRequired("Key")) | ||
16460 | } | ||
16461 | if s.Key != nil && len(*s.Key) < 1 { | ||
16462 | invalidParams.Add(request.NewErrParamMinLen("Key", 1)) | ||
16463 | } | ||
16464 | if s.AccessControlPolicy != nil { | ||
16465 | if err := s.AccessControlPolicy.Validate(); err != nil { | ||
16466 | invalidParams.AddNested("AccessControlPolicy", err.(request.ErrInvalidParams)) | ||
16467 | } | ||
16468 | } | ||
16469 | |||
16470 | if invalidParams.Len() > 0 { | ||
16471 | return invalidParams | ||
16472 | } | ||
16473 | return nil | ||
16474 | } | ||
16475 | |||
16476 | // SetACL sets the ACL field's value. | ||
16477 | func (s *PutObjectAclInput) SetACL(v string) *PutObjectAclInput { | ||
16478 | s.ACL = &v | ||
16479 | return s | ||
16480 | } | ||
16481 | |||
16482 | // SetAccessControlPolicy sets the AccessControlPolicy field's value. | ||
16483 | func (s *PutObjectAclInput) SetAccessControlPolicy(v *AccessControlPolicy) *PutObjectAclInput { | ||
16484 | s.AccessControlPolicy = v | ||
16485 | return s | ||
16486 | } | ||
16487 | |||
16488 | // SetBucket sets the Bucket field's value. | ||
16489 | func (s *PutObjectAclInput) SetBucket(v string) *PutObjectAclInput { | ||
16490 | s.Bucket = &v | ||
16491 | return s | ||
16492 | } | ||
16493 | |||
16494 | // SetGrantFullControl sets the GrantFullControl field's value. | ||
16495 | func (s *PutObjectAclInput) SetGrantFullControl(v string) *PutObjectAclInput { | ||
16496 | s.GrantFullControl = &v | ||
16497 | return s | ||
16498 | } | ||
16499 | |||
16500 | // SetGrantRead sets the GrantRead field's value. | ||
16501 | func (s *PutObjectAclInput) SetGrantRead(v string) *PutObjectAclInput { | ||
16502 | s.GrantRead = &v | ||
16503 | return s | ||
16504 | } | ||
16505 | |||
16506 | // SetGrantReadACP sets the GrantReadACP field's value. | ||
16507 | func (s *PutObjectAclInput) SetGrantReadACP(v string) *PutObjectAclInput { | ||
16508 | s.GrantReadACP = &v | ||
16509 | return s | ||
16510 | } | ||
16511 | |||
16512 | // SetGrantWrite sets the GrantWrite field's value. | ||
16513 | func (s *PutObjectAclInput) SetGrantWrite(v string) *PutObjectAclInput { | ||
16514 | s.GrantWrite = &v | ||
16515 | return s | ||
16516 | } | ||
16517 | |||
16518 | // SetGrantWriteACP sets the GrantWriteACP field's value. | ||
16519 | func (s *PutObjectAclInput) SetGrantWriteACP(v string) *PutObjectAclInput { | ||
16520 | s.GrantWriteACP = &v | ||
16521 | return s | ||
16522 | } | ||
16523 | |||
16524 | // SetKey sets the Key field's value. | ||
16525 | func (s *PutObjectAclInput) SetKey(v string) *PutObjectAclInput { | ||
16526 | s.Key = &v | ||
16527 | return s | ||
16528 | } | ||
16529 | |||
16530 | // SetRequestPayer sets the RequestPayer field's value. | ||
16531 | func (s *PutObjectAclInput) SetRequestPayer(v string) *PutObjectAclInput { | ||
16532 | s.RequestPayer = &v | ||
16533 | return s | ||
16534 | } | ||
16535 | |||
16536 | // SetVersionId sets the VersionId field's value. | ||
16537 | func (s *PutObjectAclInput) SetVersionId(v string) *PutObjectAclInput { | ||
16538 | s.VersionId = &v | ||
16539 | return s | ||
16540 | } | ||
16541 | |||
16542 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectAclOutput | ||
16543 | type PutObjectAclOutput struct { | ||
16544 | _ struct{} `type:"structure"` | ||
16545 | |||
16546 | // If present, indicates that the requester was successfully charged for the | ||
16547 | // request. | ||
16548 | RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` | ||
16549 | } | ||
16550 | |||
16551 | // String returns the string representation | ||
16552 | func (s PutObjectAclOutput) String() string { | ||
16553 | return awsutil.Prettify(s) | ||
16554 | } | ||
16555 | |||
16556 | // GoString returns the string representation | ||
16557 | func (s PutObjectAclOutput) GoString() string { | ||
16558 | return s.String() | ||
16559 | } | ||
16560 | |||
16561 | // SetRequestCharged sets the RequestCharged field's value. | ||
16562 | func (s *PutObjectAclOutput) SetRequestCharged(v string) *PutObjectAclOutput { | ||
16563 | s.RequestCharged = &v | ||
16564 | return s | ||
16565 | } | ||
16566 | |||
16567 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectRequest | ||
16568 | type PutObjectInput struct { | ||
16569 | _ struct{} `type:"structure" payload:"Body"` | ||
16570 | |||
16571 | // The canned ACL to apply to the object. | ||
16572 | ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"ObjectCannedACL"` | ||
16573 | |||
16574 | // Object data. | ||
16575 | Body io.ReadSeeker `type:"blob"` | ||
16576 | |||
16577 | // Name of the bucket to which the PUT operation was initiated. | ||
16578 | // | ||
16579 | // Bucket is a required field | ||
16580 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
16581 | |||
16582 | // Specifies caching behavior along the request/reply chain. | ||
16583 | CacheControl *string `location:"header" locationName:"Cache-Control" type:"string"` | ||
16584 | |||
16585 | // Specifies presentational information for the object. | ||
16586 | ContentDisposition *string `location:"header" locationName:"Content-Disposition" type:"string"` | ||
16587 | |||
16588 | // Specifies what content encodings have been applied to the object and thus | ||
16589 | // what decoding mechanisms must be applied to obtain the media-type referenced | ||
16590 | // by the Content-Type header field. | ||
16591 | ContentEncoding *string `location:"header" locationName:"Content-Encoding" type:"string"` | ||
16592 | |||
16593 | // The language the content is in. | ||
16594 | ContentLanguage *string `location:"header" locationName:"Content-Language" type:"string"` | ||
16595 | |||
16596 | // Size of the body in bytes. This parameter is useful when the size of the | ||
16597 | // body cannot be determined automatically. | ||
16598 | ContentLength *int64 `location:"header" locationName:"Content-Length" type:"long"` | ||
16599 | |||
16600 | // A standard MIME type describing the format of the object data. | ||
16601 | ContentType *string `location:"header" locationName:"Content-Type" type:"string"` | ||
16602 | |||
16603 | // The date and time at which the object is no longer cacheable. | ||
16604 | Expires *time.Time `location:"header" locationName:"Expires" type:"timestamp" timestampFormat:"rfc822"` | ||
16605 | |||
16606 | // Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. | ||
16607 | GrantFullControl *string `location:"header" locationName:"x-amz-grant-full-control" type:"string"` | ||
16608 | |||
16609 | // Allows grantee to read the object data and its metadata. | ||
16610 | GrantRead *string `location:"header" locationName:"x-amz-grant-read" type:"string"` | ||
16611 | |||
16612 | // Allows grantee to read the object ACL. | ||
16613 | GrantReadACP *string `location:"header" locationName:"x-amz-grant-read-acp" type:"string"` | ||
16614 | |||
16615 | // Allows grantee to write the ACL for the applicable object. | ||
16616 | GrantWriteACP *string `location:"header" locationName:"x-amz-grant-write-acp" type:"string"` | ||
16617 | |||
16618 | // Object key for which the PUT operation was initiated. | ||
16619 | // | ||
16620 | // Key is a required field | ||
16621 | Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` | ||
16622 | |||
16623 | // A map of metadata to store with the object in S3. | ||
16624 | Metadata map[string]*string `location:"headers" locationName:"x-amz-meta-" type:"map"` | ||
16625 | |||
16626 | // Confirms that the requester knows that she or he will be charged for the | ||
16627 | // request. Bucket owners need not specify this parameter in their requests. | ||
16628 | // Documentation on downloading objects from requester pays buckets can be found | ||
16629 | // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html | ||
16630 | RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` | ||
16631 | |||
16632 | // Specifies the algorithm to use to when encrypting the object (e.g., AES256). | ||
16633 | SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` | ||
16634 | |||
16635 | // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting | ||
16636 | // data. This value is used to store the object and then it is discarded; Amazon | ||
16637 | // does not store the encryption key. The key must be appropriate for use with | ||
16638 | // the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm | ||
16639 | // header. | ||
16640 | SSECustomerKey *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string"` | ||
16641 | |||
16642 | // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. | ||
16643 | // Amazon S3 uses this header for a message integrity check to ensure the encryption | ||
16644 | // key was transmitted without error. | ||
16645 | SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` | ||
16646 | |||
16647 | // Specifies the AWS KMS key ID to use for object encryption. All GET and PUT | ||
16648 | // requests for an object protected by AWS KMS will fail if not made via SSL | ||
16649 | // or using SigV4. Documentation on configuring any of the officially supported | ||
16650 | // AWS SDKs and CLI can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version | ||
16651 | SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string"` | ||
16652 | |||
16653 | // The Server-side encryption algorithm used when storing this object in S3 | ||
16654 | // (e.g., AES256, aws:kms). | ||
16655 | ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` | ||
16656 | |||
16657 | // The type of storage to use for the object. Defaults to 'STANDARD'. | ||
16658 | StorageClass *string `location:"header" locationName:"x-amz-storage-class" type:"string" enum:"StorageClass"` | ||
16659 | |||
16660 | // The tag-set for the object. The tag-set must be encoded as URL Query parameters | ||
16661 | Tagging *string `location:"header" locationName:"x-amz-tagging" type:"string"` | ||
16662 | |||
16663 | // If the bucket is configured as a website, redirects requests for this object | ||
16664 | // to another object in the same bucket or to an external URL. Amazon S3 stores | ||
16665 | // the value of this header in the object metadata. | ||
16666 | WebsiteRedirectLocation *string `location:"header" locationName:"x-amz-website-redirect-location" type:"string"` | ||
16667 | } | ||
16668 | |||
16669 | // String returns the string representation | ||
16670 | func (s PutObjectInput) String() string { | ||
16671 | return awsutil.Prettify(s) | ||
16672 | } | ||
16673 | |||
16674 | // GoString returns the string representation | ||
16675 | func (s PutObjectInput) GoString() string { | ||
16676 | return s.String() | ||
16677 | } | ||
16678 | |||
16679 | // Validate inspects the fields of the type to determine if they are valid. | ||
16680 | func (s *PutObjectInput) Validate() error { | ||
16681 | invalidParams := request.ErrInvalidParams{Context: "PutObjectInput"} | ||
16682 | if s.Bucket == nil { | ||
16683 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
16684 | } | ||
16685 | if s.Key == nil { | ||
16686 | invalidParams.Add(request.NewErrParamRequired("Key")) | ||
16687 | } | ||
16688 | if s.Key != nil && len(*s.Key) < 1 { | ||
16689 | invalidParams.Add(request.NewErrParamMinLen("Key", 1)) | ||
16690 | } | ||
16691 | |||
16692 | if invalidParams.Len() > 0 { | ||
16693 | return invalidParams | ||
16694 | } | ||
16695 | return nil | ||
16696 | } | ||
16697 | |||
16698 | // SetACL sets the ACL field's value. | ||
16699 | func (s *PutObjectInput) SetACL(v string) *PutObjectInput { | ||
16700 | s.ACL = &v | ||
16701 | return s | ||
16702 | } | ||
16703 | |||
16704 | // SetBody sets the Body field's value. | ||
16705 | func (s *PutObjectInput) SetBody(v io.ReadSeeker) *PutObjectInput { | ||
16706 | s.Body = v | ||
16707 | return s | ||
16708 | } | ||
16709 | |||
16710 | // SetBucket sets the Bucket field's value. | ||
16711 | func (s *PutObjectInput) SetBucket(v string) *PutObjectInput { | ||
16712 | s.Bucket = &v | ||
16713 | return s | ||
16714 | } | ||
16715 | |||
16716 | // SetCacheControl sets the CacheControl field's value. | ||
16717 | func (s *PutObjectInput) SetCacheControl(v string) *PutObjectInput { | ||
16718 | s.CacheControl = &v | ||
16719 | return s | ||
16720 | } | ||
16721 | |||
16722 | // SetContentDisposition sets the ContentDisposition field's value. | ||
16723 | func (s *PutObjectInput) SetContentDisposition(v string) *PutObjectInput { | ||
16724 | s.ContentDisposition = &v | ||
16725 | return s | ||
16726 | } | ||
16727 | |||
16728 | // SetContentEncoding sets the ContentEncoding field's value. | ||
16729 | func (s *PutObjectInput) SetContentEncoding(v string) *PutObjectInput { | ||
16730 | s.ContentEncoding = &v | ||
16731 | return s | ||
16732 | } | ||
16733 | |||
16734 | // SetContentLanguage sets the ContentLanguage field's value. | ||
16735 | func (s *PutObjectInput) SetContentLanguage(v string) *PutObjectInput { | ||
16736 | s.ContentLanguage = &v | ||
16737 | return s | ||
16738 | } | ||
16739 | |||
16740 | // SetContentLength sets the ContentLength field's value. | ||
16741 | func (s *PutObjectInput) SetContentLength(v int64) *PutObjectInput { | ||
16742 | s.ContentLength = &v | ||
16743 | return s | ||
16744 | } | ||
16745 | |||
16746 | // SetContentType sets the ContentType field's value. | ||
16747 | func (s *PutObjectInput) SetContentType(v string) *PutObjectInput { | ||
16748 | s.ContentType = &v | ||
16749 | return s | ||
16750 | } | ||
16751 | |||
16752 | // SetExpires sets the Expires field's value. | ||
16753 | func (s *PutObjectInput) SetExpires(v time.Time) *PutObjectInput { | ||
16754 | s.Expires = &v | ||
16755 | return s | ||
16756 | } | ||
16757 | |||
16758 | // SetGrantFullControl sets the GrantFullControl field's value. | ||
16759 | func (s *PutObjectInput) SetGrantFullControl(v string) *PutObjectInput { | ||
16760 | s.GrantFullControl = &v | ||
16761 | return s | ||
16762 | } | ||
16763 | |||
16764 | // SetGrantRead sets the GrantRead field's value. | ||
16765 | func (s *PutObjectInput) SetGrantRead(v string) *PutObjectInput { | ||
16766 | s.GrantRead = &v | ||
16767 | return s | ||
16768 | } | ||
16769 | |||
16770 | // SetGrantReadACP sets the GrantReadACP field's value. | ||
16771 | func (s *PutObjectInput) SetGrantReadACP(v string) *PutObjectInput { | ||
16772 | s.GrantReadACP = &v | ||
16773 | return s | ||
16774 | } | ||
16775 | |||
16776 | // SetGrantWriteACP sets the GrantWriteACP field's value. | ||
16777 | func (s *PutObjectInput) SetGrantWriteACP(v string) *PutObjectInput { | ||
16778 | s.GrantWriteACP = &v | ||
16779 | return s | ||
16780 | } | ||
16781 | |||
16782 | // SetKey sets the Key field's value. | ||
16783 | func (s *PutObjectInput) SetKey(v string) *PutObjectInput { | ||
16784 | s.Key = &v | ||
16785 | return s | ||
16786 | } | ||
16787 | |||
16788 | // SetMetadata sets the Metadata field's value. | ||
16789 | func (s *PutObjectInput) SetMetadata(v map[string]*string) *PutObjectInput { | ||
16790 | s.Metadata = v | ||
16791 | return s | ||
16792 | } | ||
16793 | |||
16794 | // SetRequestPayer sets the RequestPayer field's value. | ||
16795 | func (s *PutObjectInput) SetRequestPayer(v string) *PutObjectInput { | ||
16796 | s.RequestPayer = &v | ||
16797 | return s | ||
16798 | } | ||
16799 | |||
16800 | // SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. | ||
16801 | func (s *PutObjectInput) SetSSECustomerAlgorithm(v string) *PutObjectInput { | ||
16802 | s.SSECustomerAlgorithm = &v | ||
16803 | return s | ||
16804 | } | ||
16805 | |||
16806 | // SetSSECustomerKey sets the SSECustomerKey field's value. | ||
16807 | func (s *PutObjectInput) SetSSECustomerKey(v string) *PutObjectInput { | ||
16808 | s.SSECustomerKey = &v | ||
16809 | return s | ||
16810 | } | ||
16811 | |||
16812 | // SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. | ||
16813 | func (s *PutObjectInput) SetSSECustomerKeyMD5(v string) *PutObjectInput { | ||
16814 | s.SSECustomerKeyMD5 = &v | ||
16815 | return s | ||
16816 | } | ||
16817 | |||
16818 | // SetSSEKMSKeyId sets the SSEKMSKeyId field's value. | ||
16819 | func (s *PutObjectInput) SetSSEKMSKeyId(v string) *PutObjectInput { | ||
16820 | s.SSEKMSKeyId = &v | ||
16821 | return s | ||
16822 | } | ||
16823 | |||
16824 | // SetServerSideEncryption sets the ServerSideEncryption field's value. | ||
16825 | func (s *PutObjectInput) SetServerSideEncryption(v string) *PutObjectInput { | ||
16826 | s.ServerSideEncryption = &v | ||
16827 | return s | ||
16828 | } | ||
16829 | |||
16830 | // SetStorageClass sets the StorageClass field's value. | ||
16831 | func (s *PutObjectInput) SetStorageClass(v string) *PutObjectInput { | ||
16832 | s.StorageClass = &v | ||
16833 | return s | ||
16834 | } | ||
16835 | |||
16836 | // SetTagging sets the Tagging field's value. | ||
16837 | func (s *PutObjectInput) SetTagging(v string) *PutObjectInput { | ||
16838 | s.Tagging = &v | ||
16839 | return s | ||
16840 | } | ||
16841 | |||
16842 | // SetWebsiteRedirectLocation sets the WebsiteRedirectLocation field's value. | ||
16843 | func (s *PutObjectInput) SetWebsiteRedirectLocation(v string) *PutObjectInput { | ||
16844 | s.WebsiteRedirectLocation = &v | ||
16845 | return s | ||
16846 | } | ||
16847 | |||
16848 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectOutput | ||
16849 | type PutObjectOutput struct { | ||
16850 | _ struct{} `type:"structure"` | ||
16851 | |||
16852 | // Entity tag for the uploaded object. | ||
16853 | ETag *string `location:"header" locationName:"ETag" type:"string"` | ||
16854 | |||
16855 | // If the object expiration is configured, this will contain the expiration | ||
16856 | // date (expiry-date) and rule ID (rule-id). The value of rule-id is URL encoded. | ||
16857 | Expiration *string `location:"header" locationName:"x-amz-expiration" type:"string"` | ||
16858 | |||
16859 | // If present, indicates that the requester was successfully charged for the | ||
16860 | // request. | ||
16861 | RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` | ||
16862 | |||
16863 | // If server-side encryption with a customer-provided encryption key was requested, | ||
16864 | // the response will include this header confirming the encryption algorithm | ||
16865 | // used. | ||
16866 | SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` | ||
16867 | |||
16868 | // If server-side encryption with a customer-provided encryption key was requested, | ||
16869 | // the response will include this header to provide round trip message integrity | ||
16870 | // verification of the customer-provided encryption key. | ||
16871 | SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` | ||
16872 | |||
16873 | // If present, specifies the ID of the AWS Key Management Service (KMS) master | ||
16874 | // encryption key that was used for the object. | ||
16875 | SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string"` | ||
16876 | |||
16877 | // The Server-side encryption algorithm used when storing this object in S3 | ||
16878 | // (e.g., AES256, aws:kms). | ||
16879 | ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` | ||
16880 | |||
16881 | // Version of the object. | ||
16882 | VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` | ||
16883 | } | ||
16884 | |||
16885 | // String returns the string representation | ||
16886 | func (s PutObjectOutput) String() string { | ||
16887 | return awsutil.Prettify(s) | ||
16888 | } | ||
16889 | |||
16890 | // GoString returns the string representation | ||
16891 | func (s PutObjectOutput) GoString() string { | ||
16892 | return s.String() | ||
16893 | } | ||
16894 | |||
16895 | // SetETag sets the ETag field's value. | ||
16896 | func (s *PutObjectOutput) SetETag(v string) *PutObjectOutput { | ||
16897 | s.ETag = &v | ||
16898 | return s | ||
16899 | } | ||
16900 | |||
16901 | // SetExpiration sets the Expiration field's value. | ||
16902 | func (s *PutObjectOutput) SetExpiration(v string) *PutObjectOutput { | ||
16903 | s.Expiration = &v | ||
16904 | return s | ||
16905 | } | ||
16906 | |||
16907 | // SetRequestCharged sets the RequestCharged field's value. | ||
16908 | func (s *PutObjectOutput) SetRequestCharged(v string) *PutObjectOutput { | ||
16909 | s.RequestCharged = &v | ||
16910 | return s | ||
16911 | } | ||
16912 | |||
16913 | // SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. | ||
16914 | func (s *PutObjectOutput) SetSSECustomerAlgorithm(v string) *PutObjectOutput { | ||
16915 | s.SSECustomerAlgorithm = &v | ||
16916 | return s | ||
16917 | } | ||
16918 | |||
16919 | // SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. | ||
16920 | func (s *PutObjectOutput) SetSSECustomerKeyMD5(v string) *PutObjectOutput { | ||
16921 | s.SSECustomerKeyMD5 = &v | ||
16922 | return s | ||
16923 | } | ||
16924 | |||
16925 | // SetSSEKMSKeyId sets the SSEKMSKeyId field's value. | ||
16926 | func (s *PutObjectOutput) SetSSEKMSKeyId(v string) *PutObjectOutput { | ||
16927 | s.SSEKMSKeyId = &v | ||
16928 | return s | ||
16929 | } | ||
16930 | |||
16931 | // SetServerSideEncryption sets the ServerSideEncryption field's value. | ||
16932 | func (s *PutObjectOutput) SetServerSideEncryption(v string) *PutObjectOutput { | ||
16933 | s.ServerSideEncryption = &v | ||
16934 | return s | ||
16935 | } | ||
16936 | |||
16937 | // SetVersionId sets the VersionId field's value. | ||
16938 | func (s *PutObjectOutput) SetVersionId(v string) *PutObjectOutput { | ||
16939 | s.VersionId = &v | ||
16940 | return s | ||
16941 | } | ||
16942 | |||
16943 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectTaggingRequest | ||
16944 | type PutObjectTaggingInput struct { | ||
16945 | _ struct{} `type:"structure" payload:"Tagging"` | ||
16946 | |||
16947 | // Bucket is a required field | ||
16948 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
16949 | |||
16950 | // Key is a required field | ||
16951 | Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` | ||
16952 | |||
16953 | // Tagging is a required field | ||
16954 | Tagging *Tagging `locationName:"Tagging" type:"structure" required:"true"` | ||
16955 | |||
16956 | VersionId *string `location:"querystring" locationName:"versionId" type:"string"` | ||
16957 | } | ||
16958 | |||
16959 | // String returns the string representation | ||
16960 | func (s PutObjectTaggingInput) String() string { | ||
16961 | return awsutil.Prettify(s) | ||
16962 | } | ||
16963 | |||
16964 | // GoString returns the string representation | ||
16965 | func (s PutObjectTaggingInput) GoString() string { | ||
16966 | return s.String() | ||
16967 | } | ||
16968 | |||
16969 | // Validate inspects the fields of the type to determine if they are valid. | ||
16970 | func (s *PutObjectTaggingInput) Validate() error { | ||
16971 | invalidParams := request.ErrInvalidParams{Context: "PutObjectTaggingInput"} | ||
16972 | if s.Bucket == nil { | ||
16973 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
16974 | } | ||
16975 | if s.Key == nil { | ||
16976 | invalidParams.Add(request.NewErrParamRequired("Key")) | ||
16977 | } | ||
16978 | if s.Key != nil && len(*s.Key) < 1 { | ||
16979 | invalidParams.Add(request.NewErrParamMinLen("Key", 1)) | ||
16980 | } | ||
16981 | if s.Tagging == nil { | ||
16982 | invalidParams.Add(request.NewErrParamRequired("Tagging")) | ||
16983 | } | ||
16984 | if s.Tagging != nil { | ||
16985 | if err := s.Tagging.Validate(); err != nil { | ||
16986 | invalidParams.AddNested("Tagging", err.(request.ErrInvalidParams)) | ||
16987 | } | ||
16988 | } | ||
16989 | |||
16990 | if invalidParams.Len() > 0 { | ||
16991 | return invalidParams | ||
16992 | } | ||
16993 | return nil | ||
16994 | } | ||
16995 | |||
16996 | // SetBucket sets the Bucket field's value. | ||
16997 | func (s *PutObjectTaggingInput) SetBucket(v string) *PutObjectTaggingInput { | ||
16998 | s.Bucket = &v | ||
16999 | return s | ||
17000 | } | ||
17001 | |||
17002 | // SetKey sets the Key field's value. | ||
17003 | func (s *PutObjectTaggingInput) SetKey(v string) *PutObjectTaggingInput { | ||
17004 | s.Key = &v | ||
17005 | return s | ||
17006 | } | ||
17007 | |||
17008 | // SetTagging sets the Tagging field's value. | ||
17009 | func (s *PutObjectTaggingInput) SetTagging(v *Tagging) *PutObjectTaggingInput { | ||
17010 | s.Tagging = v | ||
17011 | return s | ||
17012 | } | ||
17013 | |||
17014 | // SetVersionId sets the VersionId field's value. | ||
17015 | func (s *PutObjectTaggingInput) SetVersionId(v string) *PutObjectTaggingInput { | ||
17016 | s.VersionId = &v | ||
17017 | return s | ||
17018 | } | ||
17019 | |||
17020 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectTaggingOutput | ||
17021 | type PutObjectTaggingOutput struct { | ||
17022 | _ struct{} `type:"structure"` | ||
17023 | |||
17024 | VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` | ||
17025 | } | ||
17026 | |||
17027 | // String returns the string representation | ||
17028 | func (s PutObjectTaggingOutput) String() string { | ||
17029 | return awsutil.Prettify(s) | ||
17030 | } | ||
17031 | |||
17032 | // GoString returns the string representation | ||
17033 | func (s PutObjectTaggingOutput) GoString() string { | ||
17034 | return s.String() | ||
17035 | } | ||
17036 | |||
17037 | // SetVersionId sets the VersionId field's value. | ||
17038 | func (s *PutObjectTaggingOutput) SetVersionId(v string) *PutObjectTaggingOutput { | ||
17039 | s.VersionId = &v | ||
17040 | return s | ||
17041 | } | ||
17042 | |||
17043 | // Container for specifying an configuration when you want Amazon S3 to publish | ||
17044 | // events to an Amazon Simple Queue Service (Amazon SQS) queue. | ||
17045 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/QueueConfiguration | ||
17046 | type QueueConfiguration struct { | ||
17047 | _ struct{} `type:"structure"` | ||
17048 | |||
17049 | // Events is a required field | ||
17050 | Events []*string `locationName:"Event" type:"list" flattened:"true" required:"true"` | ||
17051 | |||
17052 | // Container for object key name filtering rules. For information about key | ||
17053 | // name filtering, go to Configuring Event Notifications (http://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) | ||
17054 | Filter *NotificationConfigurationFilter `type:"structure"` | ||
17055 | |||
17056 | // Optional unique identifier for configurations in a notification configuration. | ||
17057 | // If you don't provide one, Amazon S3 will assign an ID. | ||
17058 | Id *string `type:"string"` | ||
17059 | |||
17060 | // Amazon SQS queue ARN to which Amazon S3 will publish a message when it detects | ||
17061 | // events of specified type. | ||
17062 | // | ||
17063 | // QueueArn is a required field | ||
17064 | QueueArn *string `locationName:"Queue" type:"string" required:"true"` | ||
17065 | } | ||
17066 | |||
17067 | // String returns the string representation | ||
17068 | func (s QueueConfiguration) String() string { | ||
17069 | return awsutil.Prettify(s) | ||
17070 | } | ||
17071 | |||
17072 | // GoString returns the string representation | ||
17073 | func (s QueueConfiguration) GoString() string { | ||
17074 | return s.String() | ||
17075 | } | ||
17076 | |||
17077 | // Validate inspects the fields of the type to determine if they are valid. | ||
17078 | func (s *QueueConfiguration) Validate() error { | ||
17079 | invalidParams := request.ErrInvalidParams{Context: "QueueConfiguration"} | ||
17080 | if s.Events == nil { | ||
17081 | invalidParams.Add(request.NewErrParamRequired("Events")) | ||
17082 | } | ||
17083 | if s.QueueArn == nil { | ||
17084 | invalidParams.Add(request.NewErrParamRequired("QueueArn")) | ||
17085 | } | ||
17086 | |||
17087 | if invalidParams.Len() > 0 { | ||
17088 | return invalidParams | ||
17089 | } | ||
17090 | return nil | ||
17091 | } | ||
17092 | |||
17093 | // SetEvents sets the Events field's value. | ||
17094 | func (s *QueueConfiguration) SetEvents(v []*string) *QueueConfiguration { | ||
17095 | s.Events = v | ||
17096 | return s | ||
17097 | } | ||
17098 | |||
17099 | // SetFilter sets the Filter field's value. | ||
17100 | func (s *QueueConfiguration) SetFilter(v *NotificationConfigurationFilter) *QueueConfiguration { | ||
17101 | s.Filter = v | ||
17102 | return s | ||
17103 | } | ||
17104 | |||
17105 | // SetId sets the Id field's value. | ||
17106 | func (s *QueueConfiguration) SetId(v string) *QueueConfiguration { | ||
17107 | s.Id = &v | ||
17108 | return s | ||
17109 | } | ||
17110 | |||
17111 | // SetQueueArn sets the QueueArn field's value. | ||
17112 | func (s *QueueConfiguration) SetQueueArn(v string) *QueueConfiguration { | ||
17113 | s.QueueArn = &v | ||
17114 | return s | ||
17115 | } | ||
17116 | |||
17117 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/QueueConfigurationDeprecated | ||
17118 | type QueueConfigurationDeprecated struct { | ||
17119 | _ struct{} `type:"structure"` | ||
17120 | |||
17121 | // Bucket event for which to send notifications. | ||
17122 | Event *string `deprecated:"true" type:"string" enum:"Event"` | ||
17123 | |||
17124 | Events []*string `locationName:"Event" type:"list" flattened:"true"` | ||
17125 | |||
17126 | // Optional unique identifier for configurations in a notification configuration. | ||
17127 | // If you don't provide one, Amazon S3 will assign an ID. | ||
17128 | Id *string `type:"string"` | ||
17129 | |||
17130 | Queue *string `type:"string"` | ||
17131 | } | ||
17132 | |||
17133 | // String returns the string representation | ||
17134 | func (s QueueConfigurationDeprecated) String() string { | ||
17135 | return awsutil.Prettify(s) | ||
17136 | } | ||
17137 | |||
17138 | // GoString returns the string representation | ||
17139 | func (s QueueConfigurationDeprecated) GoString() string { | ||
17140 | return s.String() | ||
17141 | } | ||
17142 | |||
17143 | // SetEvent sets the Event field's value. | ||
17144 | func (s *QueueConfigurationDeprecated) SetEvent(v string) *QueueConfigurationDeprecated { | ||
17145 | s.Event = &v | ||
17146 | return s | ||
17147 | } | ||
17148 | |||
17149 | // SetEvents sets the Events field's value. | ||
17150 | func (s *QueueConfigurationDeprecated) SetEvents(v []*string) *QueueConfigurationDeprecated { | ||
17151 | s.Events = v | ||
17152 | return s | ||
17153 | } | ||
17154 | |||
17155 | // SetId sets the Id field's value. | ||
17156 | func (s *QueueConfigurationDeprecated) SetId(v string) *QueueConfigurationDeprecated { | ||
17157 | s.Id = &v | ||
17158 | return s | ||
17159 | } | ||
17160 | |||
17161 | // SetQueue sets the Queue field's value. | ||
17162 | func (s *QueueConfigurationDeprecated) SetQueue(v string) *QueueConfigurationDeprecated { | ||
17163 | s.Queue = &v | ||
17164 | return s | ||
17165 | } | ||
17166 | |||
17167 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Redirect | ||
17168 | type Redirect struct { | ||
17169 | _ struct{} `type:"structure"` | ||
17170 | |||
17171 | // The host name to use in the redirect request. | ||
17172 | HostName *string `type:"string"` | ||
17173 | |||
17174 | // The HTTP redirect code to use on the response. Not required if one of the | ||
17175 | // siblings is present. | ||
17176 | HttpRedirectCode *string `type:"string"` | ||
17177 | |||
17178 | // Protocol to use (http, https) when redirecting requests. The default is the | ||
17179 | // protocol that is used in the original request. | ||
17180 | Protocol *string `type:"string" enum:"Protocol"` | ||
17181 | |||
17182 | // The object key prefix to use in the redirect request. For example, to redirect | ||
17183 | // requests for all pages with prefix docs/ (objects in the docs/ folder) to | ||
17184 | // documents/, you can set a condition block with KeyPrefixEquals set to docs/ | ||
17185 | // and in the Redirect set ReplaceKeyPrefixWith to /documents. Not required | ||
17186 | // if one of the siblings is present. Can be present only if ReplaceKeyWith | ||
17187 | // is not provided. | ||
17188 | ReplaceKeyPrefixWith *string `type:"string"` | ||
17189 | |||
17190 | // The specific object key to use in the redirect request. For example, redirect | ||
17191 | // request to error.html. Not required if one of the sibling is present. Can | ||
17192 | // be present only if ReplaceKeyPrefixWith is not provided. | ||
17193 | ReplaceKeyWith *string `type:"string"` | ||
17194 | } | ||
17195 | |||
17196 | // String returns the string representation | ||
17197 | func (s Redirect) String() string { | ||
17198 | return awsutil.Prettify(s) | ||
17199 | } | ||
17200 | |||
17201 | // GoString returns the string representation | ||
17202 | func (s Redirect) GoString() string { | ||
17203 | return s.String() | ||
17204 | } | ||
17205 | |||
17206 | // SetHostName sets the HostName field's value. | ||
17207 | func (s *Redirect) SetHostName(v string) *Redirect { | ||
17208 | s.HostName = &v | ||
17209 | return s | ||
17210 | } | ||
17211 | |||
17212 | // SetHttpRedirectCode sets the HttpRedirectCode field's value. | ||
17213 | func (s *Redirect) SetHttpRedirectCode(v string) *Redirect { | ||
17214 | s.HttpRedirectCode = &v | ||
17215 | return s | ||
17216 | } | ||
17217 | |||
17218 | // SetProtocol sets the Protocol field's value. | ||
17219 | func (s *Redirect) SetProtocol(v string) *Redirect { | ||
17220 | s.Protocol = &v | ||
17221 | return s | ||
17222 | } | ||
17223 | |||
17224 | // SetReplaceKeyPrefixWith sets the ReplaceKeyPrefixWith field's value. | ||
17225 | func (s *Redirect) SetReplaceKeyPrefixWith(v string) *Redirect { | ||
17226 | s.ReplaceKeyPrefixWith = &v | ||
17227 | return s | ||
17228 | } | ||
17229 | |||
17230 | // SetReplaceKeyWith sets the ReplaceKeyWith field's value. | ||
17231 | func (s *Redirect) SetReplaceKeyWith(v string) *Redirect { | ||
17232 | s.ReplaceKeyWith = &v | ||
17233 | return s | ||
17234 | } | ||
17235 | |||
17236 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/RedirectAllRequestsTo | ||
17237 | type RedirectAllRequestsTo struct { | ||
17238 | _ struct{} `type:"structure"` | ||
17239 | |||
17240 | // Name of the host where requests will be redirected. | ||
17241 | // | ||
17242 | // HostName is a required field | ||
17243 | HostName *string `type:"string" required:"true"` | ||
17244 | |||
17245 | // Protocol to use (http, https) when redirecting requests. The default is the | ||
17246 | // protocol that is used in the original request. | ||
17247 | Protocol *string `type:"string" enum:"Protocol"` | ||
17248 | } | ||
17249 | |||
17250 | // String returns the string representation | ||
17251 | func (s RedirectAllRequestsTo) String() string { | ||
17252 | return awsutil.Prettify(s) | ||
17253 | } | ||
17254 | |||
17255 | // GoString returns the string representation | ||
17256 | func (s RedirectAllRequestsTo) GoString() string { | ||
17257 | return s.String() | ||
17258 | } | ||
17259 | |||
17260 | // Validate inspects the fields of the type to determine if they are valid. | ||
17261 | func (s *RedirectAllRequestsTo) Validate() error { | ||
17262 | invalidParams := request.ErrInvalidParams{Context: "RedirectAllRequestsTo"} | ||
17263 | if s.HostName == nil { | ||
17264 | invalidParams.Add(request.NewErrParamRequired("HostName")) | ||
17265 | } | ||
17266 | |||
17267 | if invalidParams.Len() > 0 { | ||
17268 | return invalidParams | ||
17269 | } | ||
17270 | return nil | ||
17271 | } | ||
17272 | |||
17273 | // SetHostName sets the HostName field's value. | ||
17274 | func (s *RedirectAllRequestsTo) SetHostName(v string) *RedirectAllRequestsTo { | ||
17275 | s.HostName = &v | ||
17276 | return s | ||
17277 | } | ||
17278 | |||
17279 | // SetProtocol sets the Protocol field's value. | ||
17280 | func (s *RedirectAllRequestsTo) SetProtocol(v string) *RedirectAllRequestsTo { | ||
17281 | s.Protocol = &v | ||
17282 | return s | ||
17283 | } | ||
17284 | |||
17285 | // Container for replication rules. You can add as many as 1,000 rules. Total | ||
17286 | // replication configuration size can be up to 2 MB. | ||
17287 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ReplicationConfiguration | ||
17288 | type ReplicationConfiguration struct { | ||
17289 | _ struct{} `type:"structure"` | ||
17290 | |||
17291 | // Amazon Resource Name (ARN) of an IAM role for Amazon S3 to assume when replicating | ||
17292 | // the objects. | ||
17293 | // | ||
17294 | // Role is a required field | ||
17295 | Role *string `type:"string" required:"true"` | ||
17296 | |||
17297 | // Container for information about a particular replication rule. Replication | ||
17298 | // configuration must have at least one rule and can contain up to 1,000 rules. | ||
17299 | // | ||
17300 | // Rules is a required field | ||
17301 | Rules []*ReplicationRule `locationName:"Rule" type:"list" flattened:"true" required:"true"` | ||
17302 | } | ||
17303 | |||
17304 | // String returns the string representation | ||
17305 | func (s ReplicationConfiguration) String() string { | ||
17306 | return awsutil.Prettify(s) | ||
17307 | } | ||
17308 | |||
17309 | // GoString returns the string representation | ||
17310 | func (s ReplicationConfiguration) GoString() string { | ||
17311 | return s.String() | ||
17312 | } | ||
17313 | |||
17314 | // Validate inspects the fields of the type to determine if they are valid. | ||
17315 | func (s *ReplicationConfiguration) Validate() error { | ||
17316 | invalidParams := request.ErrInvalidParams{Context: "ReplicationConfiguration"} | ||
17317 | if s.Role == nil { | ||
17318 | invalidParams.Add(request.NewErrParamRequired("Role")) | ||
17319 | } | ||
17320 | if s.Rules == nil { | ||
17321 | invalidParams.Add(request.NewErrParamRequired("Rules")) | ||
17322 | } | ||
17323 | if s.Rules != nil { | ||
17324 | for i, v := range s.Rules { | ||
17325 | if v == nil { | ||
17326 | continue | ||
17327 | } | ||
17328 | if err := v.Validate(); err != nil { | ||
17329 | invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Rules", i), err.(request.ErrInvalidParams)) | ||
17330 | } | ||
17331 | } | ||
17332 | } | ||
17333 | |||
17334 | if invalidParams.Len() > 0 { | ||
17335 | return invalidParams | ||
17336 | } | ||
17337 | return nil | ||
17338 | } | ||
17339 | |||
17340 | // SetRole sets the Role field's value. | ||
17341 | func (s *ReplicationConfiguration) SetRole(v string) *ReplicationConfiguration { | ||
17342 | s.Role = &v | ||
17343 | return s | ||
17344 | } | ||
17345 | |||
17346 | // SetRules sets the Rules field's value. | ||
17347 | func (s *ReplicationConfiguration) SetRules(v []*ReplicationRule) *ReplicationConfiguration { | ||
17348 | s.Rules = v | ||
17349 | return s | ||
17350 | } | ||
17351 | |||
17352 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ReplicationRule | ||
17353 | type ReplicationRule struct { | ||
17354 | _ struct{} `type:"structure"` | ||
17355 | |||
17356 | // Destination is a required field | ||
17357 | Destination *Destination `type:"structure" required:"true"` | ||
17358 | |||
17359 | // Unique identifier for the rule. The value cannot be longer than 255 characters. | ||
17360 | ID *string `type:"string"` | ||
17361 | |||
17362 | // Object keyname prefix identifying one or more objects to which the rule applies. | ||
17363 | // Maximum prefix length can be up to 1,024 characters. Overlapping prefixes | ||
17364 | // are not supported. | ||
17365 | // | ||
17366 | // Prefix is a required field | ||
17367 | Prefix *string `type:"string" required:"true"` | ||
17368 | |||
17369 | // The rule is ignored if status is not Enabled. | ||
17370 | // | ||
17371 | // Status is a required field | ||
17372 | Status *string `type:"string" required:"true" enum:"ReplicationRuleStatus"` | ||
17373 | } | ||
17374 | |||
17375 | // String returns the string representation | ||
17376 | func (s ReplicationRule) String() string { | ||
17377 | return awsutil.Prettify(s) | ||
17378 | } | ||
17379 | |||
17380 | // GoString returns the string representation | ||
17381 | func (s ReplicationRule) GoString() string { | ||
17382 | return s.String() | ||
17383 | } | ||
17384 | |||
17385 | // Validate inspects the fields of the type to determine if they are valid. | ||
17386 | func (s *ReplicationRule) Validate() error { | ||
17387 | invalidParams := request.ErrInvalidParams{Context: "ReplicationRule"} | ||
17388 | if s.Destination == nil { | ||
17389 | invalidParams.Add(request.NewErrParamRequired("Destination")) | ||
17390 | } | ||
17391 | if s.Prefix == nil { | ||
17392 | invalidParams.Add(request.NewErrParamRequired("Prefix")) | ||
17393 | } | ||
17394 | if s.Status == nil { | ||
17395 | invalidParams.Add(request.NewErrParamRequired("Status")) | ||
17396 | } | ||
17397 | if s.Destination != nil { | ||
17398 | if err := s.Destination.Validate(); err != nil { | ||
17399 | invalidParams.AddNested("Destination", err.(request.ErrInvalidParams)) | ||
17400 | } | ||
17401 | } | ||
17402 | |||
17403 | if invalidParams.Len() > 0 { | ||
17404 | return invalidParams | ||
17405 | } | ||
17406 | return nil | ||
17407 | } | ||
17408 | |||
17409 | // SetDestination sets the Destination field's value. | ||
17410 | func (s *ReplicationRule) SetDestination(v *Destination) *ReplicationRule { | ||
17411 | s.Destination = v | ||
17412 | return s | ||
17413 | } | ||
17414 | |||
17415 | // SetID sets the ID field's value. | ||
17416 | func (s *ReplicationRule) SetID(v string) *ReplicationRule { | ||
17417 | s.ID = &v | ||
17418 | return s | ||
17419 | } | ||
17420 | |||
17421 | // SetPrefix sets the Prefix field's value. | ||
17422 | func (s *ReplicationRule) SetPrefix(v string) *ReplicationRule { | ||
17423 | s.Prefix = &v | ||
17424 | return s | ||
17425 | } | ||
17426 | |||
17427 | // SetStatus sets the Status field's value. | ||
17428 | func (s *ReplicationRule) SetStatus(v string) *ReplicationRule { | ||
17429 | s.Status = &v | ||
17430 | return s | ||
17431 | } | ||
17432 | |||
17433 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/RequestPaymentConfiguration | ||
17434 | type RequestPaymentConfiguration struct { | ||
17435 | _ struct{} `type:"structure"` | ||
17436 | |||
17437 | // Specifies who pays for the download and request fees. | ||
17438 | // | ||
17439 | // Payer is a required field | ||
17440 | Payer *string `type:"string" required:"true" enum:"Payer"` | ||
17441 | } | ||
17442 | |||
17443 | // String returns the string representation | ||
17444 | func (s RequestPaymentConfiguration) String() string { | ||
17445 | return awsutil.Prettify(s) | ||
17446 | } | ||
17447 | |||
17448 | // GoString returns the string representation | ||
17449 | func (s RequestPaymentConfiguration) GoString() string { | ||
17450 | return s.String() | ||
17451 | } | ||
17452 | |||
17453 | // Validate inspects the fields of the type to determine if they are valid. | ||
17454 | func (s *RequestPaymentConfiguration) Validate() error { | ||
17455 | invalidParams := request.ErrInvalidParams{Context: "RequestPaymentConfiguration"} | ||
17456 | if s.Payer == nil { | ||
17457 | invalidParams.Add(request.NewErrParamRequired("Payer")) | ||
17458 | } | ||
17459 | |||
17460 | if invalidParams.Len() > 0 { | ||
17461 | return invalidParams | ||
17462 | } | ||
17463 | return nil | ||
17464 | } | ||
17465 | |||
17466 | // SetPayer sets the Payer field's value. | ||
17467 | func (s *RequestPaymentConfiguration) SetPayer(v string) *RequestPaymentConfiguration { | ||
17468 | s.Payer = &v | ||
17469 | return s | ||
17470 | } | ||
17471 | |||
17472 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/RestoreObjectRequest | ||
17473 | type RestoreObjectInput struct { | ||
17474 | _ struct{} `type:"structure" payload:"RestoreRequest"` | ||
17475 | |||
17476 | // Bucket is a required field | ||
17477 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
17478 | |||
17479 | // Key is a required field | ||
17480 | Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` | ||
17481 | |||
17482 | // Confirms that the requester knows that she or he will be charged for the | ||
17483 | // request. Bucket owners need not specify this parameter in their requests. | ||
17484 | // Documentation on downloading objects from requester pays buckets can be found | ||
17485 | // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html | ||
17486 | RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` | ||
17487 | |||
17488 | RestoreRequest *RestoreRequest `locationName:"RestoreRequest" type:"structure"` | ||
17489 | |||
17490 | VersionId *string `location:"querystring" locationName:"versionId" type:"string"` | ||
17491 | } | ||
17492 | |||
17493 | // String returns the string representation | ||
17494 | func (s RestoreObjectInput) String() string { | ||
17495 | return awsutil.Prettify(s) | ||
17496 | } | ||
17497 | |||
17498 | // GoString returns the string representation | ||
17499 | func (s RestoreObjectInput) GoString() string { | ||
17500 | return s.String() | ||
17501 | } | ||
17502 | |||
17503 | // Validate inspects the fields of the type to determine if they are valid. | ||
17504 | func (s *RestoreObjectInput) Validate() error { | ||
17505 | invalidParams := request.ErrInvalidParams{Context: "RestoreObjectInput"} | ||
17506 | if s.Bucket == nil { | ||
17507 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
17508 | } | ||
17509 | if s.Key == nil { | ||
17510 | invalidParams.Add(request.NewErrParamRequired("Key")) | ||
17511 | } | ||
17512 | if s.Key != nil && len(*s.Key) < 1 { | ||
17513 | invalidParams.Add(request.NewErrParamMinLen("Key", 1)) | ||
17514 | } | ||
17515 | if s.RestoreRequest != nil { | ||
17516 | if err := s.RestoreRequest.Validate(); err != nil { | ||
17517 | invalidParams.AddNested("RestoreRequest", err.(request.ErrInvalidParams)) | ||
17518 | } | ||
17519 | } | ||
17520 | |||
17521 | if invalidParams.Len() > 0 { | ||
17522 | return invalidParams | ||
17523 | } | ||
17524 | return nil | ||
17525 | } | ||
17526 | |||
17527 | // SetBucket sets the Bucket field's value. | ||
17528 | func (s *RestoreObjectInput) SetBucket(v string) *RestoreObjectInput { | ||
17529 | s.Bucket = &v | ||
17530 | return s | ||
17531 | } | ||
17532 | |||
17533 | // SetKey sets the Key field's value. | ||
17534 | func (s *RestoreObjectInput) SetKey(v string) *RestoreObjectInput { | ||
17535 | s.Key = &v | ||
17536 | return s | ||
17537 | } | ||
17538 | |||
17539 | // SetRequestPayer sets the RequestPayer field's value. | ||
17540 | func (s *RestoreObjectInput) SetRequestPayer(v string) *RestoreObjectInput { | ||
17541 | s.RequestPayer = &v | ||
17542 | return s | ||
17543 | } | ||
17544 | |||
17545 | // SetRestoreRequest sets the RestoreRequest field's value. | ||
17546 | func (s *RestoreObjectInput) SetRestoreRequest(v *RestoreRequest) *RestoreObjectInput { | ||
17547 | s.RestoreRequest = v | ||
17548 | return s | ||
17549 | } | ||
17550 | |||
17551 | // SetVersionId sets the VersionId field's value. | ||
17552 | func (s *RestoreObjectInput) SetVersionId(v string) *RestoreObjectInput { | ||
17553 | s.VersionId = &v | ||
17554 | return s | ||
17555 | } | ||
17556 | |||
17557 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/RestoreObjectOutput | ||
17558 | type RestoreObjectOutput struct { | ||
17559 | _ struct{} `type:"structure"` | ||
17560 | |||
17561 | // If present, indicates that the requester was successfully charged for the | ||
17562 | // request. | ||
17563 | RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` | ||
17564 | } | ||
17565 | |||
17566 | // String returns the string representation | ||
17567 | func (s RestoreObjectOutput) String() string { | ||
17568 | return awsutil.Prettify(s) | ||
17569 | } | ||
17570 | |||
17571 | // GoString returns the string representation | ||
17572 | func (s RestoreObjectOutput) GoString() string { | ||
17573 | return s.String() | ||
17574 | } | ||
17575 | |||
17576 | // SetRequestCharged sets the RequestCharged field's value. | ||
17577 | func (s *RestoreObjectOutput) SetRequestCharged(v string) *RestoreObjectOutput { | ||
17578 | s.RequestCharged = &v | ||
17579 | return s | ||
17580 | } | ||
17581 | |||
17582 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/RestoreRequest | ||
17583 | type RestoreRequest struct { | ||
17584 | _ struct{} `type:"structure"` | ||
17585 | |||
17586 | // Lifetime of the active copy in days | ||
17587 | // | ||
17588 | // Days is a required field | ||
17589 | Days *int64 `type:"integer" required:"true"` | ||
17590 | |||
17591 | // Glacier related prameters pertaining to this job. | ||
17592 | GlacierJobParameters *GlacierJobParameters `type:"structure"` | ||
17593 | } | ||
17594 | |||
17595 | // String returns the string representation | ||
17596 | func (s RestoreRequest) String() string { | ||
17597 | return awsutil.Prettify(s) | ||
17598 | } | ||
17599 | |||
17600 | // GoString returns the string representation | ||
17601 | func (s RestoreRequest) GoString() string { | ||
17602 | return s.String() | ||
17603 | } | ||
17604 | |||
17605 | // Validate inspects the fields of the type to determine if they are valid. | ||
17606 | func (s *RestoreRequest) Validate() error { | ||
17607 | invalidParams := request.ErrInvalidParams{Context: "RestoreRequest"} | ||
17608 | if s.Days == nil { | ||
17609 | invalidParams.Add(request.NewErrParamRequired("Days")) | ||
17610 | } | ||
17611 | if s.GlacierJobParameters != nil { | ||
17612 | if err := s.GlacierJobParameters.Validate(); err != nil { | ||
17613 | invalidParams.AddNested("GlacierJobParameters", err.(request.ErrInvalidParams)) | ||
17614 | } | ||
17615 | } | ||
17616 | |||
17617 | if invalidParams.Len() > 0 { | ||
17618 | return invalidParams | ||
17619 | } | ||
17620 | return nil | ||
17621 | } | ||
17622 | |||
17623 | // SetDays sets the Days field's value. | ||
17624 | func (s *RestoreRequest) SetDays(v int64) *RestoreRequest { | ||
17625 | s.Days = &v | ||
17626 | return s | ||
17627 | } | ||
17628 | |||
17629 | // SetGlacierJobParameters sets the GlacierJobParameters field's value. | ||
17630 | func (s *RestoreRequest) SetGlacierJobParameters(v *GlacierJobParameters) *RestoreRequest { | ||
17631 | s.GlacierJobParameters = v | ||
17632 | return s | ||
17633 | } | ||
17634 | |||
17635 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/RoutingRule | ||
17636 | type RoutingRule struct { | ||
17637 | _ struct{} `type:"structure"` | ||
17638 | |||
17639 | // A container for describing a condition that must be met for the specified | ||
17640 | // redirect to apply. For example, 1. If request is for pages in the /docs folder, | ||
17641 | // redirect to the /documents folder. 2. If request results in HTTP error 4xx, | ||
17642 | // redirect request to another host where you might process the error. | ||
17643 | Condition *Condition `type:"structure"` | ||
17644 | |||
17645 | // Container for redirect information. You can redirect requests to another | ||
17646 | // host, to another page, or with another protocol. In the event of an error, | ||
17647 | // you can can specify a different error code to return. | ||
17648 | // | ||
17649 | // Redirect is a required field | ||
17650 | Redirect *Redirect `type:"structure" required:"true"` | ||
17651 | } | ||
17652 | |||
17653 | // String returns the string representation | ||
17654 | func (s RoutingRule) String() string { | ||
17655 | return awsutil.Prettify(s) | ||
17656 | } | ||
17657 | |||
17658 | // GoString returns the string representation | ||
17659 | func (s RoutingRule) GoString() string { | ||
17660 | return s.String() | ||
17661 | } | ||
17662 | |||
17663 | // Validate inspects the fields of the type to determine if they are valid. | ||
17664 | func (s *RoutingRule) Validate() error { | ||
17665 | invalidParams := request.ErrInvalidParams{Context: "RoutingRule"} | ||
17666 | if s.Redirect == nil { | ||
17667 | invalidParams.Add(request.NewErrParamRequired("Redirect")) | ||
17668 | } | ||
17669 | |||
17670 | if invalidParams.Len() > 0 { | ||
17671 | return invalidParams | ||
17672 | } | ||
17673 | return nil | ||
17674 | } | ||
17675 | |||
17676 | // SetCondition sets the Condition field's value. | ||
17677 | func (s *RoutingRule) SetCondition(v *Condition) *RoutingRule { | ||
17678 | s.Condition = v | ||
17679 | return s | ||
17680 | } | ||
17681 | |||
17682 | // SetRedirect sets the Redirect field's value. | ||
17683 | func (s *RoutingRule) SetRedirect(v *Redirect) *RoutingRule { | ||
17684 | s.Redirect = v | ||
17685 | return s | ||
17686 | } | ||
17687 | |||
17688 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Rule | ||
17689 | type Rule struct { | ||
17690 | _ struct{} `type:"structure"` | ||
17691 | |||
17692 | // Specifies the days since the initiation of an Incomplete Multipart Upload | ||
17693 | // that Lifecycle will wait before permanently removing all parts of the upload. | ||
17694 | AbortIncompleteMultipartUpload *AbortIncompleteMultipartUpload `type:"structure"` | ||
17695 | |||
17696 | Expiration *LifecycleExpiration `type:"structure"` | ||
17697 | |||
17698 | // Unique identifier for the rule. The value cannot be longer than 255 characters. | ||
17699 | ID *string `type:"string"` | ||
17700 | |||
17701 | // Specifies when noncurrent object versions expire. Upon expiration, Amazon | ||
17702 | // S3 permanently deletes the noncurrent object versions. You set this lifecycle | ||
17703 | // configuration action on a bucket that has versioning enabled (or suspended) | ||
17704 | // to request that Amazon S3 delete noncurrent object versions at a specific | ||
17705 | // period in the object's lifetime. | ||
17706 | NoncurrentVersionExpiration *NoncurrentVersionExpiration `type:"structure"` | ||
17707 | |||
17708 | // Container for the transition rule that describes when noncurrent objects | ||
17709 | // transition to the STANDARD_IA or GLACIER storage class. If your bucket is | ||
17710 | // versioning-enabled (or versioning is suspended), you can set this action | ||
17711 | // to request that Amazon S3 transition noncurrent object versions to the STANDARD_IA | ||
17712 | // or GLACIER storage class at a specific period in the object's lifetime. | ||
17713 | NoncurrentVersionTransition *NoncurrentVersionTransition `type:"structure"` | ||
17714 | |||
17715 | // Prefix identifying one or more objects to which the rule applies. | ||
17716 | // | ||
17717 | // Prefix is a required field | ||
17718 | Prefix *string `type:"string" required:"true"` | ||
17719 | |||
17720 | // If 'Enabled', the rule is currently being applied. If 'Disabled', the rule | ||
17721 | // is not currently being applied. | ||
17722 | // | ||
17723 | // Status is a required field | ||
17724 | Status *string `type:"string" required:"true" enum:"ExpirationStatus"` | ||
17725 | |||
17726 | Transition *Transition `type:"structure"` | ||
17727 | } | ||
17728 | |||
17729 | // String returns the string representation | ||
17730 | func (s Rule) String() string { | ||
17731 | return awsutil.Prettify(s) | ||
17732 | } | ||
17733 | |||
17734 | // GoString returns the string representation | ||
17735 | func (s Rule) GoString() string { | ||
17736 | return s.String() | ||
17737 | } | ||
17738 | |||
17739 | // Validate inspects the fields of the type to determine if they are valid. | ||
17740 | func (s *Rule) Validate() error { | ||
17741 | invalidParams := request.ErrInvalidParams{Context: "Rule"} | ||
17742 | if s.Prefix == nil { | ||
17743 | invalidParams.Add(request.NewErrParamRequired("Prefix")) | ||
17744 | } | ||
17745 | if s.Status == nil { | ||
17746 | invalidParams.Add(request.NewErrParamRequired("Status")) | ||
17747 | } | ||
17748 | |||
17749 | if invalidParams.Len() > 0 { | ||
17750 | return invalidParams | ||
17751 | } | ||
17752 | return nil | ||
17753 | } | ||
17754 | |||
17755 | // SetAbortIncompleteMultipartUpload sets the AbortIncompleteMultipartUpload field's value. | ||
17756 | func (s *Rule) SetAbortIncompleteMultipartUpload(v *AbortIncompleteMultipartUpload) *Rule { | ||
17757 | s.AbortIncompleteMultipartUpload = v | ||
17758 | return s | ||
17759 | } | ||
17760 | |||
17761 | // SetExpiration sets the Expiration field's value. | ||
17762 | func (s *Rule) SetExpiration(v *LifecycleExpiration) *Rule { | ||
17763 | s.Expiration = v | ||
17764 | return s | ||
17765 | } | ||
17766 | |||
17767 | // SetID sets the ID field's value. | ||
17768 | func (s *Rule) SetID(v string) *Rule { | ||
17769 | s.ID = &v | ||
17770 | return s | ||
17771 | } | ||
17772 | |||
17773 | // SetNoncurrentVersionExpiration sets the NoncurrentVersionExpiration field's value. | ||
17774 | func (s *Rule) SetNoncurrentVersionExpiration(v *NoncurrentVersionExpiration) *Rule { | ||
17775 | s.NoncurrentVersionExpiration = v | ||
17776 | return s | ||
17777 | } | ||
17778 | |||
17779 | // SetNoncurrentVersionTransition sets the NoncurrentVersionTransition field's value. | ||
17780 | func (s *Rule) SetNoncurrentVersionTransition(v *NoncurrentVersionTransition) *Rule { | ||
17781 | s.NoncurrentVersionTransition = v | ||
17782 | return s | ||
17783 | } | ||
17784 | |||
17785 | // SetPrefix sets the Prefix field's value. | ||
17786 | func (s *Rule) SetPrefix(v string) *Rule { | ||
17787 | s.Prefix = &v | ||
17788 | return s | ||
17789 | } | ||
17790 | |||
17791 | // SetStatus sets the Status field's value. | ||
17792 | func (s *Rule) SetStatus(v string) *Rule { | ||
17793 | s.Status = &v | ||
17794 | return s | ||
17795 | } | ||
17796 | |||
17797 | // SetTransition sets the Transition field's value. | ||
17798 | func (s *Rule) SetTransition(v *Transition) *Rule { | ||
17799 | s.Transition = v | ||
17800 | return s | ||
17801 | } | ||
17802 | |||
17803 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/StorageClassAnalysis | ||
17804 | type StorageClassAnalysis struct { | ||
17805 | _ struct{} `type:"structure"` | ||
17806 | |||
17807 | // A container used to describe how data related to the storage class analysis | ||
17808 | // should be exported. | ||
17809 | DataExport *StorageClassAnalysisDataExport `type:"structure"` | ||
17810 | } | ||
17811 | |||
17812 | // String returns the string representation | ||
17813 | func (s StorageClassAnalysis) String() string { | ||
17814 | return awsutil.Prettify(s) | ||
17815 | } | ||
17816 | |||
17817 | // GoString returns the string representation | ||
17818 | func (s StorageClassAnalysis) GoString() string { | ||
17819 | return s.String() | ||
17820 | } | ||
17821 | |||
17822 | // Validate inspects the fields of the type to determine if they are valid. | ||
17823 | func (s *StorageClassAnalysis) Validate() error { | ||
17824 | invalidParams := request.ErrInvalidParams{Context: "StorageClassAnalysis"} | ||
17825 | if s.DataExport != nil { | ||
17826 | if err := s.DataExport.Validate(); err != nil { | ||
17827 | invalidParams.AddNested("DataExport", err.(request.ErrInvalidParams)) | ||
17828 | } | ||
17829 | } | ||
17830 | |||
17831 | if invalidParams.Len() > 0 { | ||
17832 | return invalidParams | ||
17833 | } | ||
17834 | return nil | ||
17835 | } | ||
17836 | |||
17837 | // SetDataExport sets the DataExport field's value. | ||
17838 | func (s *StorageClassAnalysis) SetDataExport(v *StorageClassAnalysisDataExport) *StorageClassAnalysis { | ||
17839 | s.DataExport = v | ||
17840 | return s | ||
17841 | } | ||
17842 | |||
17843 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/StorageClassAnalysisDataExport | ||
17844 | type StorageClassAnalysisDataExport struct { | ||
17845 | _ struct{} `type:"structure"` | ||
17846 | |||
17847 | // The place to store the data for an analysis. | ||
17848 | // | ||
17849 | // Destination is a required field | ||
17850 | Destination *AnalyticsExportDestination `type:"structure" required:"true"` | ||
17851 | |||
17852 | // The version of the output schema to use when exporting data. Must be V_1. | ||
17853 | // | ||
17854 | // OutputSchemaVersion is a required field | ||
17855 | OutputSchemaVersion *string `type:"string" required:"true" enum:"StorageClassAnalysisSchemaVersion"` | ||
17856 | } | ||
17857 | |||
17858 | // String returns the string representation | ||
17859 | func (s StorageClassAnalysisDataExport) String() string { | ||
17860 | return awsutil.Prettify(s) | ||
17861 | } | ||
17862 | |||
17863 | // GoString returns the string representation | ||
17864 | func (s StorageClassAnalysisDataExport) GoString() string { | ||
17865 | return s.String() | ||
17866 | } | ||
17867 | |||
17868 | // Validate inspects the fields of the type to determine if they are valid. | ||
17869 | func (s *StorageClassAnalysisDataExport) Validate() error { | ||
17870 | invalidParams := request.ErrInvalidParams{Context: "StorageClassAnalysisDataExport"} | ||
17871 | if s.Destination == nil { | ||
17872 | invalidParams.Add(request.NewErrParamRequired("Destination")) | ||
17873 | } | ||
17874 | if s.OutputSchemaVersion == nil { | ||
17875 | invalidParams.Add(request.NewErrParamRequired("OutputSchemaVersion")) | ||
17876 | } | ||
17877 | if s.Destination != nil { | ||
17878 | if err := s.Destination.Validate(); err != nil { | ||
17879 | invalidParams.AddNested("Destination", err.(request.ErrInvalidParams)) | ||
17880 | } | ||
17881 | } | ||
17882 | |||
17883 | if invalidParams.Len() > 0 { | ||
17884 | return invalidParams | ||
17885 | } | ||
17886 | return nil | ||
17887 | } | ||
17888 | |||
17889 | // SetDestination sets the Destination field's value. | ||
17890 | func (s *StorageClassAnalysisDataExport) SetDestination(v *AnalyticsExportDestination) *StorageClassAnalysisDataExport { | ||
17891 | s.Destination = v | ||
17892 | return s | ||
17893 | } | ||
17894 | |||
17895 | // SetOutputSchemaVersion sets the OutputSchemaVersion field's value. | ||
17896 | func (s *StorageClassAnalysisDataExport) SetOutputSchemaVersion(v string) *StorageClassAnalysisDataExport { | ||
17897 | s.OutputSchemaVersion = &v | ||
17898 | return s | ||
17899 | } | ||
17900 | |||
17901 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Tag | ||
17902 | type Tag struct { | ||
17903 | _ struct{} `type:"structure"` | ||
17904 | |||
17905 | // Name of the tag. | ||
17906 | // | ||
17907 | // Key is a required field | ||
17908 | Key *string `min:"1" type:"string" required:"true"` | ||
17909 | |||
17910 | // Value of the tag. | ||
17911 | // | ||
17912 | // Value is a required field | ||
17913 | Value *string `type:"string" required:"true"` | ||
17914 | } | ||
17915 | |||
17916 | // String returns the string representation | ||
17917 | func (s Tag) String() string { | ||
17918 | return awsutil.Prettify(s) | ||
17919 | } | ||
17920 | |||
17921 | // GoString returns the string representation | ||
17922 | func (s Tag) GoString() string { | ||
17923 | return s.String() | ||
17924 | } | ||
17925 | |||
17926 | // Validate inspects the fields of the type to determine if they are valid. | ||
17927 | func (s *Tag) Validate() error { | ||
17928 | invalidParams := request.ErrInvalidParams{Context: "Tag"} | ||
17929 | if s.Key == nil { | ||
17930 | invalidParams.Add(request.NewErrParamRequired("Key")) | ||
17931 | } | ||
17932 | if s.Key != nil && len(*s.Key) < 1 { | ||
17933 | invalidParams.Add(request.NewErrParamMinLen("Key", 1)) | ||
17934 | } | ||
17935 | if s.Value == nil { | ||
17936 | invalidParams.Add(request.NewErrParamRequired("Value")) | ||
17937 | } | ||
17938 | |||
17939 | if invalidParams.Len() > 0 { | ||
17940 | return invalidParams | ||
17941 | } | ||
17942 | return nil | ||
17943 | } | ||
17944 | |||
17945 | // SetKey sets the Key field's value. | ||
17946 | func (s *Tag) SetKey(v string) *Tag { | ||
17947 | s.Key = &v | ||
17948 | return s | ||
17949 | } | ||
17950 | |||
17951 | // SetValue sets the Value field's value. | ||
17952 | func (s *Tag) SetValue(v string) *Tag { | ||
17953 | s.Value = &v | ||
17954 | return s | ||
17955 | } | ||
17956 | |||
17957 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Tagging | ||
17958 | type Tagging struct { | ||
17959 | _ struct{} `type:"structure"` | ||
17960 | |||
17961 | // TagSet is a required field | ||
17962 | TagSet []*Tag `locationNameList:"Tag" type:"list" required:"true"` | ||
17963 | } | ||
17964 | |||
17965 | // String returns the string representation | ||
17966 | func (s Tagging) String() string { | ||
17967 | return awsutil.Prettify(s) | ||
17968 | } | ||
17969 | |||
17970 | // GoString returns the string representation | ||
17971 | func (s Tagging) GoString() string { | ||
17972 | return s.String() | ||
17973 | } | ||
17974 | |||
17975 | // Validate inspects the fields of the type to determine if they are valid. | ||
17976 | func (s *Tagging) Validate() error { | ||
17977 | invalidParams := request.ErrInvalidParams{Context: "Tagging"} | ||
17978 | if s.TagSet == nil { | ||
17979 | invalidParams.Add(request.NewErrParamRequired("TagSet")) | ||
17980 | } | ||
17981 | if s.TagSet != nil { | ||
17982 | for i, v := range s.TagSet { | ||
17983 | if v == nil { | ||
17984 | continue | ||
17985 | } | ||
17986 | if err := v.Validate(); err != nil { | ||
17987 | invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TagSet", i), err.(request.ErrInvalidParams)) | ||
17988 | } | ||
17989 | } | ||
17990 | } | ||
17991 | |||
17992 | if invalidParams.Len() > 0 { | ||
17993 | return invalidParams | ||
17994 | } | ||
17995 | return nil | ||
17996 | } | ||
17997 | |||
17998 | // SetTagSet sets the TagSet field's value. | ||
17999 | func (s *Tagging) SetTagSet(v []*Tag) *Tagging { | ||
18000 | s.TagSet = v | ||
18001 | return s | ||
18002 | } | ||
18003 | |||
18004 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/TargetGrant | ||
18005 | type TargetGrant struct { | ||
18006 | _ struct{} `type:"structure"` | ||
18007 | |||
18008 | Grantee *Grantee `type:"structure"` | ||
18009 | |||
18010 | // Logging permissions assigned to the Grantee for the bucket. | ||
18011 | Permission *string `type:"string" enum:"BucketLogsPermission"` | ||
18012 | } | ||
18013 | |||
18014 | // String returns the string representation | ||
18015 | func (s TargetGrant) String() string { | ||
18016 | return awsutil.Prettify(s) | ||
18017 | } | ||
18018 | |||
18019 | // GoString returns the string representation | ||
18020 | func (s TargetGrant) GoString() string { | ||
18021 | return s.String() | ||
18022 | } | ||
18023 | |||
18024 | // Validate inspects the fields of the type to determine if they are valid. | ||
18025 | func (s *TargetGrant) Validate() error { | ||
18026 | invalidParams := request.ErrInvalidParams{Context: "TargetGrant"} | ||
18027 | if s.Grantee != nil { | ||
18028 | if err := s.Grantee.Validate(); err != nil { | ||
18029 | invalidParams.AddNested("Grantee", err.(request.ErrInvalidParams)) | ||
18030 | } | ||
18031 | } | ||
18032 | |||
18033 | if invalidParams.Len() > 0 { | ||
18034 | return invalidParams | ||
18035 | } | ||
18036 | return nil | ||
18037 | } | ||
18038 | |||
18039 | // SetGrantee sets the Grantee field's value. | ||
18040 | func (s *TargetGrant) SetGrantee(v *Grantee) *TargetGrant { | ||
18041 | s.Grantee = v | ||
18042 | return s | ||
18043 | } | ||
18044 | |||
18045 | // SetPermission sets the Permission field's value. | ||
18046 | func (s *TargetGrant) SetPermission(v string) *TargetGrant { | ||
18047 | s.Permission = &v | ||
18048 | return s | ||
18049 | } | ||
18050 | |||
18051 | // Container for specifying the configuration when you want Amazon S3 to publish | ||
18052 | // events to an Amazon Simple Notification Service (Amazon SNS) topic. | ||
18053 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/TopicConfiguration | ||
18054 | type TopicConfiguration struct { | ||
18055 | _ struct{} `type:"structure"` | ||
18056 | |||
18057 | // Events is a required field | ||
18058 | Events []*string `locationName:"Event" type:"list" flattened:"true" required:"true"` | ||
18059 | |||
18060 | // Container for object key name filtering rules. For information about key | ||
18061 | // name filtering, go to Configuring Event Notifications (http://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) | ||
18062 | Filter *NotificationConfigurationFilter `type:"structure"` | ||
18063 | |||
18064 | // Optional unique identifier for configurations in a notification configuration. | ||
18065 | // If you don't provide one, Amazon S3 will assign an ID. | ||
18066 | Id *string `type:"string"` | ||
18067 | |||
18068 | // Amazon SNS topic ARN to which Amazon S3 will publish a message when it detects | ||
18069 | // events of specified type. | ||
18070 | // | ||
18071 | // TopicArn is a required field | ||
18072 | TopicArn *string `locationName:"Topic" type:"string" required:"true"` | ||
18073 | } | ||
18074 | |||
18075 | // String returns the string representation | ||
18076 | func (s TopicConfiguration) String() string { | ||
18077 | return awsutil.Prettify(s) | ||
18078 | } | ||
18079 | |||
18080 | // GoString returns the string representation | ||
18081 | func (s TopicConfiguration) GoString() string { | ||
18082 | return s.String() | ||
18083 | } | ||
18084 | |||
18085 | // Validate inspects the fields of the type to determine if they are valid. | ||
18086 | func (s *TopicConfiguration) Validate() error { | ||
18087 | invalidParams := request.ErrInvalidParams{Context: "TopicConfiguration"} | ||
18088 | if s.Events == nil { | ||
18089 | invalidParams.Add(request.NewErrParamRequired("Events")) | ||
18090 | } | ||
18091 | if s.TopicArn == nil { | ||
18092 | invalidParams.Add(request.NewErrParamRequired("TopicArn")) | ||
18093 | } | ||
18094 | |||
18095 | if invalidParams.Len() > 0 { | ||
18096 | return invalidParams | ||
18097 | } | ||
18098 | return nil | ||
18099 | } | ||
18100 | |||
18101 | // SetEvents sets the Events field's value. | ||
18102 | func (s *TopicConfiguration) SetEvents(v []*string) *TopicConfiguration { | ||
18103 | s.Events = v | ||
18104 | return s | ||
18105 | } | ||
18106 | |||
18107 | // SetFilter sets the Filter field's value. | ||
18108 | func (s *TopicConfiguration) SetFilter(v *NotificationConfigurationFilter) *TopicConfiguration { | ||
18109 | s.Filter = v | ||
18110 | return s | ||
18111 | } | ||
18112 | |||
18113 | // SetId sets the Id field's value. | ||
18114 | func (s *TopicConfiguration) SetId(v string) *TopicConfiguration { | ||
18115 | s.Id = &v | ||
18116 | return s | ||
18117 | } | ||
18118 | |||
18119 | // SetTopicArn sets the TopicArn field's value. | ||
18120 | func (s *TopicConfiguration) SetTopicArn(v string) *TopicConfiguration { | ||
18121 | s.TopicArn = &v | ||
18122 | return s | ||
18123 | } | ||
18124 | |||
18125 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/TopicConfigurationDeprecated | ||
18126 | type TopicConfigurationDeprecated struct { | ||
18127 | _ struct{} `type:"structure"` | ||
18128 | |||
18129 | // Bucket event for which to send notifications. | ||
18130 | Event *string `deprecated:"true" type:"string" enum:"Event"` | ||
18131 | |||
18132 | Events []*string `locationName:"Event" type:"list" flattened:"true"` | ||
18133 | |||
18134 | // Optional unique identifier for configurations in a notification configuration. | ||
18135 | // If you don't provide one, Amazon S3 will assign an ID. | ||
18136 | Id *string `type:"string"` | ||
18137 | |||
18138 | // Amazon SNS topic to which Amazon S3 will publish a message to report the | ||
18139 | // specified events for the bucket. | ||
18140 | Topic *string `type:"string"` | ||
18141 | } | ||
18142 | |||
18143 | // String returns the string representation | ||
18144 | func (s TopicConfigurationDeprecated) String() string { | ||
18145 | return awsutil.Prettify(s) | ||
18146 | } | ||
18147 | |||
18148 | // GoString returns the string representation | ||
18149 | func (s TopicConfigurationDeprecated) GoString() string { | ||
18150 | return s.String() | ||
18151 | } | ||
18152 | |||
18153 | // SetEvent sets the Event field's value. | ||
18154 | func (s *TopicConfigurationDeprecated) SetEvent(v string) *TopicConfigurationDeprecated { | ||
18155 | s.Event = &v | ||
18156 | return s | ||
18157 | } | ||
18158 | |||
18159 | // SetEvents sets the Events field's value. | ||
18160 | func (s *TopicConfigurationDeprecated) SetEvents(v []*string) *TopicConfigurationDeprecated { | ||
18161 | s.Events = v | ||
18162 | return s | ||
18163 | } | ||
18164 | |||
18165 | // SetId sets the Id field's value. | ||
18166 | func (s *TopicConfigurationDeprecated) SetId(v string) *TopicConfigurationDeprecated { | ||
18167 | s.Id = &v | ||
18168 | return s | ||
18169 | } | ||
18170 | |||
18171 | // SetTopic sets the Topic field's value. | ||
18172 | func (s *TopicConfigurationDeprecated) SetTopic(v string) *TopicConfigurationDeprecated { | ||
18173 | s.Topic = &v | ||
18174 | return s | ||
18175 | } | ||
18176 | |||
18177 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Transition | ||
18178 | type Transition struct { | ||
18179 | _ struct{} `type:"structure"` | ||
18180 | |||
18181 | // Indicates at what date the object is to be moved or deleted. Should be in | ||
18182 | // GMT ISO 8601 Format. | ||
18183 | Date *time.Time `type:"timestamp" timestampFormat:"iso8601"` | ||
18184 | |||
18185 | // Indicates the lifetime, in days, of the objects that are subject to the rule. | ||
18186 | // The value must be a non-zero positive integer. | ||
18187 | Days *int64 `type:"integer"` | ||
18188 | |||
18189 | // The class of storage used to store the object. | ||
18190 | StorageClass *string `type:"string" enum:"TransitionStorageClass"` | ||
18191 | } | ||
18192 | |||
18193 | // String returns the string representation | ||
18194 | func (s Transition) String() string { | ||
18195 | return awsutil.Prettify(s) | ||
18196 | } | ||
18197 | |||
18198 | // GoString returns the string representation | ||
18199 | func (s Transition) GoString() string { | ||
18200 | return s.String() | ||
18201 | } | ||
18202 | |||
18203 | // SetDate sets the Date field's value. | ||
18204 | func (s *Transition) SetDate(v time.Time) *Transition { | ||
18205 | s.Date = &v | ||
18206 | return s | ||
18207 | } | ||
18208 | |||
18209 | // SetDays sets the Days field's value. | ||
18210 | func (s *Transition) SetDays(v int64) *Transition { | ||
18211 | s.Days = &v | ||
18212 | return s | ||
18213 | } | ||
18214 | |||
18215 | // SetStorageClass sets the StorageClass field's value. | ||
18216 | func (s *Transition) SetStorageClass(v string) *Transition { | ||
18217 | s.StorageClass = &v | ||
18218 | return s | ||
18219 | } | ||
18220 | |||
18221 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/UploadPartCopyRequest | ||
18222 | type UploadPartCopyInput struct { | ||
18223 | _ struct{} `type:"structure"` | ||
18224 | |||
18225 | // Bucket is a required field | ||
18226 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
18227 | |||
18228 | // The name of the source bucket and key name of the source object, separated | ||
18229 | // by a slash (/). Must be URL-encoded. | ||
18230 | // | ||
18231 | // CopySource is a required field | ||
18232 | CopySource *string `location:"header" locationName:"x-amz-copy-source" type:"string" required:"true"` | ||
18233 | |||
18234 | // Copies the object if its entity tag (ETag) matches the specified tag. | ||
18235 | CopySourceIfMatch *string `location:"header" locationName:"x-amz-copy-source-if-match" type:"string"` | ||
18236 | |||
18237 | // Copies the object if it has been modified since the specified time. | ||
18238 | CopySourceIfModifiedSince *time.Time `location:"header" locationName:"x-amz-copy-source-if-modified-since" type:"timestamp" timestampFormat:"rfc822"` | ||
18239 | |||
18240 | // Copies the object if its entity tag (ETag) is different than the specified | ||
18241 | // ETag. | ||
18242 | CopySourceIfNoneMatch *string `location:"header" locationName:"x-amz-copy-source-if-none-match" type:"string"` | ||
18243 | |||
18244 | // Copies the object if it hasn't been modified since the specified time. | ||
18245 | CopySourceIfUnmodifiedSince *time.Time `location:"header" locationName:"x-amz-copy-source-if-unmodified-since" type:"timestamp" timestampFormat:"rfc822"` | ||
18246 | |||
18247 | // The range of bytes to copy from the source object. The range value must use | ||
18248 | // the form bytes=first-last, where the first and last are the zero-based byte | ||
18249 | // offsets to copy. For example, bytes=0-9 indicates that you want to copy the | ||
18250 | // first ten bytes of the source. You can copy a range only if the source object | ||
18251 | // is greater than 5 GB. | ||
18252 | CopySourceRange *string `location:"header" locationName:"x-amz-copy-source-range" type:"string"` | ||
18253 | |||
18254 | // Specifies the algorithm to use when decrypting the source object (e.g., AES256). | ||
18255 | CopySourceSSECustomerAlgorithm *string `location:"header" locationName:"x-amz-copy-source-server-side-encryption-customer-algorithm" type:"string"` | ||
18256 | |||
18257 | // Specifies the customer-provided encryption key for Amazon S3 to use to decrypt | ||
18258 | // the source object. The encryption key provided in this header must be one | ||
18259 | // that was used when the source object was created. | ||
18260 | CopySourceSSECustomerKey *string `location:"header" locationName:"x-amz-copy-source-server-side-encryption-customer-key" type:"string"` | ||
18261 | |||
18262 | // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. | ||
18263 | // Amazon S3 uses this header for a message integrity check to ensure the encryption | ||
18264 | // key was transmitted without error. | ||
18265 | CopySourceSSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-copy-source-server-side-encryption-customer-key-MD5" type:"string"` | ||
18266 | |||
18267 | // Key is a required field | ||
18268 | Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` | ||
18269 | |||
18270 | // Part number of part being copied. This is a positive integer between 1 and | ||
18271 | // 10,000. | ||
18272 | // | ||
18273 | // PartNumber is a required field | ||
18274 | PartNumber *int64 `location:"querystring" locationName:"partNumber" type:"integer" required:"true"` | ||
18275 | |||
18276 | // Confirms that the requester knows that she or he will be charged for the | ||
18277 | // request. Bucket owners need not specify this parameter in their requests. | ||
18278 | // Documentation on downloading objects from requester pays buckets can be found | ||
18279 | // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html | ||
18280 | RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` | ||
18281 | |||
18282 | // Specifies the algorithm to use to when encrypting the object (e.g., AES256). | ||
18283 | SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` | ||
18284 | |||
18285 | // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting | ||
18286 | // data. This value is used to store the object and then it is discarded; Amazon | ||
18287 | // does not store the encryption key. The key must be appropriate for use with | ||
18288 | // the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm | ||
18289 | // header. This must be the same encryption key specified in the initiate multipart | ||
18290 | // upload request. | ||
18291 | SSECustomerKey *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string"` | ||
18292 | |||
18293 | // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. | ||
18294 | // Amazon S3 uses this header for a message integrity check to ensure the encryption | ||
18295 | // key was transmitted without error. | ||
18296 | SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` | ||
18297 | |||
18298 | // Upload ID identifying the multipart upload whose part is being copied. | ||
18299 | // | ||
18300 | // UploadId is a required field | ||
18301 | UploadId *string `location:"querystring" locationName:"uploadId" type:"string" required:"true"` | ||
18302 | } | ||
18303 | |||
18304 | // String returns the string representation | ||
18305 | func (s UploadPartCopyInput) String() string { | ||
18306 | return awsutil.Prettify(s) | ||
18307 | } | ||
18308 | |||
18309 | // GoString returns the string representation | ||
18310 | func (s UploadPartCopyInput) GoString() string { | ||
18311 | return s.String() | ||
18312 | } | ||
18313 | |||
18314 | // Validate inspects the fields of the type to determine if they are valid. | ||
18315 | func (s *UploadPartCopyInput) Validate() error { | ||
18316 | invalidParams := request.ErrInvalidParams{Context: "UploadPartCopyInput"} | ||
18317 | if s.Bucket == nil { | ||
18318 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
18319 | } | ||
18320 | if s.CopySource == nil { | ||
18321 | invalidParams.Add(request.NewErrParamRequired("CopySource")) | ||
18322 | } | ||
18323 | if s.Key == nil { | ||
18324 | invalidParams.Add(request.NewErrParamRequired("Key")) | ||
18325 | } | ||
18326 | if s.Key != nil && len(*s.Key) < 1 { | ||
18327 | invalidParams.Add(request.NewErrParamMinLen("Key", 1)) | ||
18328 | } | ||
18329 | if s.PartNumber == nil { | ||
18330 | invalidParams.Add(request.NewErrParamRequired("PartNumber")) | ||
18331 | } | ||
18332 | if s.UploadId == nil { | ||
18333 | invalidParams.Add(request.NewErrParamRequired("UploadId")) | ||
18334 | } | ||
18335 | |||
18336 | if invalidParams.Len() > 0 { | ||
18337 | return invalidParams | ||
18338 | } | ||
18339 | return nil | ||
18340 | } | ||
18341 | |||
18342 | // SetBucket sets the Bucket field's value. | ||
18343 | func (s *UploadPartCopyInput) SetBucket(v string) *UploadPartCopyInput { | ||
18344 | s.Bucket = &v | ||
18345 | return s | ||
18346 | } | ||
18347 | |||
18348 | // SetCopySource sets the CopySource field's value. | ||
18349 | func (s *UploadPartCopyInput) SetCopySource(v string) *UploadPartCopyInput { | ||
18350 | s.CopySource = &v | ||
18351 | return s | ||
18352 | } | ||
18353 | |||
18354 | // SetCopySourceIfMatch sets the CopySourceIfMatch field's value. | ||
18355 | func (s *UploadPartCopyInput) SetCopySourceIfMatch(v string) *UploadPartCopyInput { | ||
18356 | s.CopySourceIfMatch = &v | ||
18357 | return s | ||
18358 | } | ||
18359 | |||
18360 | // SetCopySourceIfModifiedSince sets the CopySourceIfModifiedSince field's value. | ||
18361 | func (s *UploadPartCopyInput) SetCopySourceIfModifiedSince(v time.Time) *UploadPartCopyInput { | ||
18362 | s.CopySourceIfModifiedSince = &v | ||
18363 | return s | ||
18364 | } | ||
18365 | |||
18366 | // SetCopySourceIfNoneMatch sets the CopySourceIfNoneMatch field's value. | ||
18367 | func (s *UploadPartCopyInput) SetCopySourceIfNoneMatch(v string) *UploadPartCopyInput { | ||
18368 | s.CopySourceIfNoneMatch = &v | ||
18369 | return s | ||
18370 | } | ||
18371 | |||
18372 | // SetCopySourceIfUnmodifiedSince sets the CopySourceIfUnmodifiedSince field's value. | ||
18373 | func (s *UploadPartCopyInput) SetCopySourceIfUnmodifiedSince(v time.Time) *UploadPartCopyInput { | ||
18374 | s.CopySourceIfUnmodifiedSince = &v | ||
18375 | return s | ||
18376 | } | ||
18377 | |||
18378 | // SetCopySourceRange sets the CopySourceRange field's value. | ||
18379 | func (s *UploadPartCopyInput) SetCopySourceRange(v string) *UploadPartCopyInput { | ||
18380 | s.CopySourceRange = &v | ||
18381 | return s | ||
18382 | } | ||
18383 | |||
18384 | // SetCopySourceSSECustomerAlgorithm sets the CopySourceSSECustomerAlgorithm field's value. | ||
18385 | func (s *UploadPartCopyInput) SetCopySourceSSECustomerAlgorithm(v string) *UploadPartCopyInput { | ||
18386 | s.CopySourceSSECustomerAlgorithm = &v | ||
18387 | return s | ||
18388 | } | ||
18389 | |||
18390 | // SetCopySourceSSECustomerKey sets the CopySourceSSECustomerKey field's value. | ||
18391 | func (s *UploadPartCopyInput) SetCopySourceSSECustomerKey(v string) *UploadPartCopyInput { | ||
18392 | s.CopySourceSSECustomerKey = &v | ||
18393 | return s | ||
18394 | } | ||
18395 | |||
18396 | // SetCopySourceSSECustomerKeyMD5 sets the CopySourceSSECustomerKeyMD5 field's value. | ||
18397 | func (s *UploadPartCopyInput) SetCopySourceSSECustomerKeyMD5(v string) *UploadPartCopyInput { | ||
18398 | s.CopySourceSSECustomerKeyMD5 = &v | ||
18399 | return s | ||
18400 | } | ||
18401 | |||
18402 | // SetKey sets the Key field's value. | ||
18403 | func (s *UploadPartCopyInput) SetKey(v string) *UploadPartCopyInput { | ||
18404 | s.Key = &v | ||
18405 | return s | ||
18406 | } | ||
18407 | |||
18408 | // SetPartNumber sets the PartNumber field's value. | ||
18409 | func (s *UploadPartCopyInput) SetPartNumber(v int64) *UploadPartCopyInput { | ||
18410 | s.PartNumber = &v | ||
18411 | return s | ||
18412 | } | ||
18413 | |||
18414 | // SetRequestPayer sets the RequestPayer field's value. | ||
18415 | func (s *UploadPartCopyInput) SetRequestPayer(v string) *UploadPartCopyInput { | ||
18416 | s.RequestPayer = &v | ||
18417 | return s | ||
18418 | } | ||
18419 | |||
18420 | // SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. | ||
18421 | func (s *UploadPartCopyInput) SetSSECustomerAlgorithm(v string) *UploadPartCopyInput { | ||
18422 | s.SSECustomerAlgorithm = &v | ||
18423 | return s | ||
18424 | } | ||
18425 | |||
18426 | // SetSSECustomerKey sets the SSECustomerKey field's value. | ||
18427 | func (s *UploadPartCopyInput) SetSSECustomerKey(v string) *UploadPartCopyInput { | ||
18428 | s.SSECustomerKey = &v | ||
18429 | return s | ||
18430 | } | ||
18431 | |||
18432 | // SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. | ||
18433 | func (s *UploadPartCopyInput) SetSSECustomerKeyMD5(v string) *UploadPartCopyInput { | ||
18434 | s.SSECustomerKeyMD5 = &v | ||
18435 | return s | ||
18436 | } | ||
18437 | |||
18438 | // SetUploadId sets the UploadId field's value. | ||
18439 | func (s *UploadPartCopyInput) SetUploadId(v string) *UploadPartCopyInput { | ||
18440 | s.UploadId = &v | ||
18441 | return s | ||
18442 | } | ||
18443 | |||
18444 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/UploadPartCopyOutput | ||
18445 | type UploadPartCopyOutput struct { | ||
18446 | _ struct{} `type:"structure" payload:"CopyPartResult"` | ||
18447 | |||
18448 | CopyPartResult *CopyPartResult `type:"structure"` | ||
18449 | |||
18450 | // The version of the source object that was copied, if you have enabled versioning | ||
18451 | // on the source bucket. | ||
18452 | CopySourceVersionId *string `location:"header" locationName:"x-amz-copy-source-version-id" type:"string"` | ||
18453 | |||
18454 | // If present, indicates that the requester was successfully charged for the | ||
18455 | // request. | ||
18456 | RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` | ||
18457 | |||
18458 | // If server-side encryption with a customer-provided encryption key was requested, | ||
18459 | // the response will include this header confirming the encryption algorithm | ||
18460 | // used. | ||
18461 | SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` | ||
18462 | |||
18463 | // If server-side encryption with a customer-provided encryption key was requested, | ||
18464 | // the response will include this header to provide round trip message integrity | ||
18465 | // verification of the customer-provided encryption key. | ||
18466 | SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` | ||
18467 | |||
18468 | // If present, specifies the ID of the AWS Key Management Service (KMS) master | ||
18469 | // encryption key that was used for the object. | ||
18470 | SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string"` | ||
18471 | |||
18472 | // The Server-side encryption algorithm used when storing this object in S3 | ||
18473 | // (e.g., AES256, aws:kms). | ||
18474 | ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` | ||
18475 | } | ||
18476 | |||
18477 | // String returns the string representation | ||
18478 | func (s UploadPartCopyOutput) String() string { | ||
18479 | return awsutil.Prettify(s) | ||
18480 | } | ||
18481 | |||
18482 | // GoString returns the string representation | ||
18483 | func (s UploadPartCopyOutput) GoString() string { | ||
18484 | return s.String() | ||
18485 | } | ||
18486 | |||
18487 | // SetCopyPartResult sets the CopyPartResult field's value. | ||
18488 | func (s *UploadPartCopyOutput) SetCopyPartResult(v *CopyPartResult) *UploadPartCopyOutput { | ||
18489 | s.CopyPartResult = v | ||
18490 | return s | ||
18491 | } | ||
18492 | |||
18493 | // SetCopySourceVersionId sets the CopySourceVersionId field's value. | ||
18494 | func (s *UploadPartCopyOutput) SetCopySourceVersionId(v string) *UploadPartCopyOutput { | ||
18495 | s.CopySourceVersionId = &v | ||
18496 | return s | ||
18497 | } | ||
18498 | |||
18499 | // SetRequestCharged sets the RequestCharged field's value. | ||
18500 | func (s *UploadPartCopyOutput) SetRequestCharged(v string) *UploadPartCopyOutput { | ||
18501 | s.RequestCharged = &v | ||
18502 | return s | ||
18503 | } | ||
18504 | |||
18505 | // SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. | ||
18506 | func (s *UploadPartCopyOutput) SetSSECustomerAlgorithm(v string) *UploadPartCopyOutput { | ||
18507 | s.SSECustomerAlgorithm = &v | ||
18508 | return s | ||
18509 | } | ||
18510 | |||
18511 | // SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. | ||
18512 | func (s *UploadPartCopyOutput) SetSSECustomerKeyMD5(v string) *UploadPartCopyOutput { | ||
18513 | s.SSECustomerKeyMD5 = &v | ||
18514 | return s | ||
18515 | } | ||
18516 | |||
18517 | // SetSSEKMSKeyId sets the SSEKMSKeyId field's value. | ||
18518 | func (s *UploadPartCopyOutput) SetSSEKMSKeyId(v string) *UploadPartCopyOutput { | ||
18519 | s.SSEKMSKeyId = &v | ||
18520 | return s | ||
18521 | } | ||
18522 | |||
18523 | // SetServerSideEncryption sets the ServerSideEncryption field's value. | ||
18524 | func (s *UploadPartCopyOutput) SetServerSideEncryption(v string) *UploadPartCopyOutput { | ||
18525 | s.ServerSideEncryption = &v | ||
18526 | return s | ||
18527 | } | ||
18528 | |||
18529 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/UploadPartRequest | ||
18530 | type UploadPartInput struct { | ||
18531 | _ struct{} `type:"structure" payload:"Body"` | ||
18532 | |||
18533 | // Object data. | ||
18534 | Body io.ReadSeeker `type:"blob"` | ||
18535 | |||
18536 | // Name of the bucket to which the multipart upload was initiated. | ||
18537 | // | ||
18538 | // Bucket is a required field | ||
18539 | Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` | ||
18540 | |||
18541 | // Size of the body in bytes. This parameter is useful when the size of the | ||
18542 | // body cannot be determined automatically. | ||
18543 | ContentLength *int64 `location:"header" locationName:"Content-Length" type:"long"` | ||
18544 | |||
18545 | // Object key for which the multipart upload was initiated. | ||
18546 | // | ||
18547 | // Key is a required field | ||
18548 | Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` | ||
18549 | |||
18550 | // Part number of part being uploaded. This is a positive integer between 1 | ||
18551 | // and 10,000. | ||
18552 | // | ||
18553 | // PartNumber is a required field | ||
18554 | PartNumber *int64 `location:"querystring" locationName:"partNumber" type:"integer" required:"true"` | ||
18555 | |||
18556 | // Confirms that the requester knows that she or he will be charged for the | ||
18557 | // request. Bucket owners need not specify this parameter in their requests. | ||
18558 | // Documentation on downloading objects from requester pays buckets can be found | ||
18559 | // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html | ||
18560 | RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` | ||
18561 | |||
18562 | // Specifies the algorithm to use to when encrypting the object (e.g., AES256). | ||
18563 | SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` | ||
18564 | |||
18565 | // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting | ||
18566 | // data. This value is used to store the object and then it is discarded; Amazon | ||
18567 | // does not store the encryption key. The key must be appropriate for use with | ||
18568 | // the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm | ||
18569 | // header. This must be the same encryption key specified in the initiate multipart | ||
18570 | // upload request. | ||
18571 | SSECustomerKey *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string"` | ||
18572 | |||
18573 | // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. | ||
18574 | // Amazon S3 uses this header for a message integrity check to ensure the encryption | ||
18575 | // key was transmitted without error. | ||
18576 | SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` | ||
18577 | |||
18578 | // Upload ID identifying the multipart upload whose part is being uploaded. | ||
18579 | // | ||
18580 | // UploadId is a required field | ||
18581 | UploadId *string `location:"querystring" locationName:"uploadId" type:"string" required:"true"` | ||
18582 | } | ||
18583 | |||
18584 | // String returns the string representation | ||
18585 | func (s UploadPartInput) String() string { | ||
18586 | return awsutil.Prettify(s) | ||
18587 | } | ||
18588 | |||
18589 | // GoString returns the string representation | ||
18590 | func (s UploadPartInput) GoString() string { | ||
18591 | return s.String() | ||
18592 | } | ||
18593 | |||
18594 | // Validate inspects the fields of the type to determine if they are valid. | ||
18595 | func (s *UploadPartInput) Validate() error { | ||
18596 | invalidParams := request.ErrInvalidParams{Context: "UploadPartInput"} | ||
18597 | if s.Bucket == nil { | ||
18598 | invalidParams.Add(request.NewErrParamRequired("Bucket")) | ||
18599 | } | ||
18600 | if s.Key == nil { | ||
18601 | invalidParams.Add(request.NewErrParamRequired("Key")) | ||
18602 | } | ||
18603 | if s.Key != nil && len(*s.Key) < 1 { | ||
18604 | invalidParams.Add(request.NewErrParamMinLen("Key", 1)) | ||
18605 | } | ||
18606 | if s.PartNumber == nil { | ||
18607 | invalidParams.Add(request.NewErrParamRequired("PartNumber")) | ||
18608 | } | ||
18609 | if s.UploadId == nil { | ||
18610 | invalidParams.Add(request.NewErrParamRequired("UploadId")) | ||
18611 | } | ||
18612 | |||
18613 | if invalidParams.Len() > 0 { | ||
18614 | return invalidParams | ||
18615 | } | ||
18616 | return nil | ||
18617 | } | ||
18618 | |||
18619 | // SetBody sets the Body field's value. | ||
18620 | func (s *UploadPartInput) SetBody(v io.ReadSeeker) *UploadPartInput { | ||
18621 | s.Body = v | ||
18622 | return s | ||
18623 | } | ||
18624 | |||
18625 | // SetBucket sets the Bucket field's value. | ||
18626 | func (s *UploadPartInput) SetBucket(v string) *UploadPartInput { | ||
18627 | s.Bucket = &v | ||
18628 | return s | ||
18629 | } | ||
18630 | |||
18631 | // SetContentLength sets the ContentLength field's value. | ||
18632 | func (s *UploadPartInput) SetContentLength(v int64) *UploadPartInput { | ||
18633 | s.ContentLength = &v | ||
18634 | return s | ||
18635 | } | ||
18636 | |||
18637 | // SetKey sets the Key field's value. | ||
18638 | func (s *UploadPartInput) SetKey(v string) *UploadPartInput { | ||
18639 | s.Key = &v | ||
18640 | return s | ||
18641 | } | ||
18642 | |||
18643 | // SetPartNumber sets the PartNumber field's value. | ||
18644 | func (s *UploadPartInput) SetPartNumber(v int64) *UploadPartInput { | ||
18645 | s.PartNumber = &v | ||
18646 | return s | ||
18647 | } | ||
18648 | |||
18649 | // SetRequestPayer sets the RequestPayer field's value. | ||
18650 | func (s *UploadPartInput) SetRequestPayer(v string) *UploadPartInput { | ||
18651 | s.RequestPayer = &v | ||
18652 | return s | ||
18653 | } | ||
18654 | |||
18655 | // SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. | ||
18656 | func (s *UploadPartInput) SetSSECustomerAlgorithm(v string) *UploadPartInput { | ||
18657 | s.SSECustomerAlgorithm = &v | ||
18658 | return s | ||
18659 | } | ||
18660 | |||
18661 | // SetSSECustomerKey sets the SSECustomerKey field's value. | ||
18662 | func (s *UploadPartInput) SetSSECustomerKey(v string) *UploadPartInput { | ||
18663 | s.SSECustomerKey = &v | ||
18664 | return s | ||
18665 | } | ||
18666 | |||
18667 | // SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. | ||
18668 | func (s *UploadPartInput) SetSSECustomerKeyMD5(v string) *UploadPartInput { | ||
18669 | s.SSECustomerKeyMD5 = &v | ||
18670 | return s | ||
18671 | } | ||
18672 | |||
18673 | // SetUploadId sets the UploadId field's value. | ||
18674 | func (s *UploadPartInput) SetUploadId(v string) *UploadPartInput { | ||
18675 | s.UploadId = &v | ||
18676 | return s | ||
18677 | } | ||
18678 | |||
18679 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/UploadPartOutput | ||
18680 | type UploadPartOutput struct { | ||
18681 | _ struct{} `type:"structure"` | ||
18682 | |||
18683 | // Entity tag for the uploaded object. | ||
18684 | ETag *string `location:"header" locationName:"ETag" type:"string"` | ||
18685 | |||
18686 | // If present, indicates that the requester was successfully charged for the | ||
18687 | // request. | ||
18688 | RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` | ||
18689 | |||
18690 | // If server-side encryption with a customer-provided encryption key was requested, | ||
18691 | // the response will include this header confirming the encryption algorithm | ||
18692 | // used. | ||
18693 | SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` | ||
18694 | |||
18695 | // If server-side encryption with a customer-provided encryption key was requested, | ||
18696 | // the response will include this header to provide round trip message integrity | ||
18697 | // verification of the customer-provided encryption key. | ||
18698 | SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` | ||
18699 | |||
18700 | // If present, specifies the ID of the AWS Key Management Service (KMS) master | ||
18701 | // encryption key that was used for the object. | ||
18702 | SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string"` | ||
18703 | |||
18704 | // The Server-side encryption algorithm used when storing this object in S3 | ||
18705 | // (e.g., AES256, aws:kms). | ||
18706 | ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` | ||
18707 | } | ||
18708 | |||
18709 | // String returns the string representation | ||
18710 | func (s UploadPartOutput) String() string { | ||
18711 | return awsutil.Prettify(s) | ||
18712 | } | ||
18713 | |||
18714 | // GoString returns the string representation | ||
18715 | func (s UploadPartOutput) GoString() string { | ||
18716 | return s.String() | ||
18717 | } | ||
18718 | |||
18719 | // SetETag sets the ETag field's value. | ||
18720 | func (s *UploadPartOutput) SetETag(v string) *UploadPartOutput { | ||
18721 | s.ETag = &v | ||
18722 | return s | ||
18723 | } | ||
18724 | |||
18725 | // SetRequestCharged sets the RequestCharged field's value. | ||
18726 | func (s *UploadPartOutput) SetRequestCharged(v string) *UploadPartOutput { | ||
18727 | s.RequestCharged = &v | ||
18728 | return s | ||
18729 | } | ||
18730 | |||
18731 | // SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. | ||
18732 | func (s *UploadPartOutput) SetSSECustomerAlgorithm(v string) *UploadPartOutput { | ||
18733 | s.SSECustomerAlgorithm = &v | ||
18734 | return s | ||
18735 | } | ||
18736 | |||
18737 | // SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. | ||
18738 | func (s *UploadPartOutput) SetSSECustomerKeyMD5(v string) *UploadPartOutput { | ||
18739 | s.SSECustomerKeyMD5 = &v | ||
18740 | return s | ||
18741 | } | ||
18742 | |||
18743 | // SetSSEKMSKeyId sets the SSEKMSKeyId field's value. | ||
18744 | func (s *UploadPartOutput) SetSSEKMSKeyId(v string) *UploadPartOutput { | ||
18745 | s.SSEKMSKeyId = &v | ||
18746 | return s | ||
18747 | } | ||
18748 | |||
18749 | // SetServerSideEncryption sets the ServerSideEncryption field's value. | ||
18750 | func (s *UploadPartOutput) SetServerSideEncryption(v string) *UploadPartOutput { | ||
18751 | s.ServerSideEncryption = &v | ||
18752 | return s | ||
18753 | } | ||
18754 | |||
18755 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/VersioningConfiguration | ||
18756 | type VersioningConfiguration struct { | ||
18757 | _ struct{} `type:"structure"` | ||
18758 | |||
18759 | // Specifies whether MFA delete is enabled in the bucket versioning configuration. | ||
18760 | // This element is only returned if the bucket has been configured with MFA | ||
18761 | // delete. If the bucket has never been so configured, this element is not returned. | ||
18762 | MFADelete *string `locationName:"MfaDelete" type:"string" enum:"MFADelete"` | ||
18763 | |||
18764 | // The versioning state of the bucket. | ||
18765 | Status *string `type:"string" enum:"BucketVersioningStatus"` | ||
18766 | } | ||
18767 | |||
18768 | // String returns the string representation | ||
18769 | func (s VersioningConfiguration) String() string { | ||
18770 | return awsutil.Prettify(s) | ||
18771 | } | ||
18772 | |||
18773 | // GoString returns the string representation | ||
18774 | func (s VersioningConfiguration) GoString() string { | ||
18775 | return s.String() | ||
18776 | } | ||
18777 | |||
18778 | // SetMFADelete sets the MFADelete field's value. | ||
18779 | func (s *VersioningConfiguration) SetMFADelete(v string) *VersioningConfiguration { | ||
18780 | s.MFADelete = &v | ||
18781 | return s | ||
18782 | } | ||
18783 | |||
18784 | // SetStatus sets the Status field's value. | ||
18785 | func (s *VersioningConfiguration) SetStatus(v string) *VersioningConfiguration { | ||
18786 | s.Status = &v | ||
18787 | return s | ||
18788 | } | ||
18789 | |||
18790 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/WebsiteConfiguration | ||
18791 | type WebsiteConfiguration struct { | ||
18792 | _ struct{} `type:"structure"` | ||
18793 | |||
18794 | ErrorDocument *ErrorDocument `type:"structure"` | ||
18795 | |||
18796 | IndexDocument *IndexDocument `type:"structure"` | ||
18797 | |||
18798 | RedirectAllRequestsTo *RedirectAllRequestsTo `type:"structure"` | ||
18799 | |||
18800 | RoutingRules []*RoutingRule `locationNameList:"RoutingRule" type:"list"` | ||
18801 | } | ||
18802 | |||
18803 | // String returns the string representation | ||
18804 | func (s WebsiteConfiguration) String() string { | ||
18805 | return awsutil.Prettify(s) | ||
18806 | } | ||
18807 | |||
18808 | // GoString returns the string representation | ||
18809 | func (s WebsiteConfiguration) GoString() string { | ||
18810 | return s.String() | ||
18811 | } | ||
18812 | |||
18813 | // Validate inspects the fields of the type to determine if they are valid. | ||
18814 | func (s *WebsiteConfiguration) Validate() error { | ||
18815 | invalidParams := request.ErrInvalidParams{Context: "WebsiteConfiguration"} | ||
18816 | if s.ErrorDocument != nil { | ||
18817 | if err := s.ErrorDocument.Validate(); err != nil { | ||
18818 | invalidParams.AddNested("ErrorDocument", err.(request.ErrInvalidParams)) | ||
18819 | } | ||
18820 | } | ||
18821 | if s.IndexDocument != nil { | ||
18822 | if err := s.IndexDocument.Validate(); err != nil { | ||
18823 | invalidParams.AddNested("IndexDocument", err.(request.ErrInvalidParams)) | ||
18824 | } | ||
18825 | } | ||
18826 | if s.RedirectAllRequestsTo != nil { | ||
18827 | if err := s.RedirectAllRequestsTo.Validate(); err != nil { | ||
18828 | invalidParams.AddNested("RedirectAllRequestsTo", err.(request.ErrInvalidParams)) | ||
18829 | } | ||
18830 | } | ||
18831 | if s.RoutingRules != nil { | ||
18832 | for i, v := range s.RoutingRules { | ||
18833 | if v == nil { | ||
18834 | continue | ||
18835 | } | ||
18836 | if err := v.Validate(); err != nil { | ||
18837 | invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RoutingRules", i), err.(request.ErrInvalidParams)) | ||
18838 | } | ||
18839 | } | ||
18840 | } | ||
18841 | |||
18842 | if invalidParams.Len() > 0 { | ||
18843 | return invalidParams | ||
18844 | } | ||
18845 | return nil | ||
18846 | } | ||
18847 | |||
18848 | // SetErrorDocument sets the ErrorDocument field's value. | ||
18849 | func (s *WebsiteConfiguration) SetErrorDocument(v *ErrorDocument) *WebsiteConfiguration { | ||
18850 | s.ErrorDocument = v | ||
18851 | return s | ||
18852 | } | ||
18853 | |||
18854 | // SetIndexDocument sets the IndexDocument field's value. | ||
18855 | func (s *WebsiteConfiguration) SetIndexDocument(v *IndexDocument) *WebsiteConfiguration { | ||
18856 | s.IndexDocument = v | ||
18857 | return s | ||
18858 | } | ||
18859 | |||
18860 | // SetRedirectAllRequestsTo sets the RedirectAllRequestsTo field's value. | ||
18861 | func (s *WebsiteConfiguration) SetRedirectAllRequestsTo(v *RedirectAllRequestsTo) *WebsiteConfiguration { | ||
18862 | s.RedirectAllRequestsTo = v | ||
18863 | return s | ||
18864 | } | ||
18865 | |||
18866 | // SetRoutingRules sets the RoutingRules field's value. | ||
18867 | func (s *WebsiteConfiguration) SetRoutingRules(v []*RoutingRule) *WebsiteConfiguration { | ||
18868 | s.RoutingRules = v | ||
18869 | return s | ||
18870 | } | ||
18871 | |||
18872 | const ( | ||
18873 | // AnalyticsS3ExportFileFormatCsv is a AnalyticsS3ExportFileFormat enum value | ||
18874 | AnalyticsS3ExportFileFormatCsv = "CSV" | ||
18875 | ) | ||
18876 | |||
18877 | const ( | ||
18878 | // BucketAccelerateStatusEnabled is a BucketAccelerateStatus enum value | ||
18879 | BucketAccelerateStatusEnabled = "Enabled" | ||
18880 | |||
18881 | // BucketAccelerateStatusSuspended is a BucketAccelerateStatus enum value | ||
18882 | BucketAccelerateStatusSuspended = "Suspended" | ||
18883 | ) | ||
18884 | |||
18885 | const ( | ||
18886 | // BucketCannedACLPrivate is a BucketCannedACL enum value | ||
18887 | BucketCannedACLPrivate = "private" | ||
18888 | |||
18889 | // BucketCannedACLPublicRead is a BucketCannedACL enum value | ||
18890 | BucketCannedACLPublicRead = "public-read" | ||
18891 | |||
18892 | // BucketCannedACLPublicReadWrite is a BucketCannedACL enum value | ||
18893 | BucketCannedACLPublicReadWrite = "public-read-write" | ||
18894 | |||
18895 | // BucketCannedACLAuthenticatedRead is a BucketCannedACL enum value | ||
18896 | BucketCannedACLAuthenticatedRead = "authenticated-read" | ||
18897 | ) | ||
18898 | |||
18899 | const ( | ||
18900 | // BucketLocationConstraintEu is a BucketLocationConstraint enum value | ||
18901 | BucketLocationConstraintEu = "EU" | ||
18902 | |||
18903 | // BucketLocationConstraintEuWest1 is a BucketLocationConstraint enum value | ||
18904 | BucketLocationConstraintEuWest1 = "eu-west-1" | ||
18905 | |||
18906 | // BucketLocationConstraintUsWest1 is a BucketLocationConstraint enum value | ||
18907 | BucketLocationConstraintUsWest1 = "us-west-1" | ||
18908 | |||
18909 | // BucketLocationConstraintUsWest2 is a BucketLocationConstraint enum value | ||
18910 | BucketLocationConstraintUsWest2 = "us-west-2" | ||
18911 | |||
18912 | // BucketLocationConstraintApSouth1 is a BucketLocationConstraint enum value | ||
18913 | BucketLocationConstraintApSouth1 = "ap-south-1" | ||
18914 | |||
18915 | // BucketLocationConstraintApSoutheast1 is a BucketLocationConstraint enum value | ||
18916 | BucketLocationConstraintApSoutheast1 = "ap-southeast-1" | ||
18917 | |||
18918 | // BucketLocationConstraintApSoutheast2 is a BucketLocationConstraint enum value | ||
18919 | BucketLocationConstraintApSoutheast2 = "ap-southeast-2" | ||
18920 | |||
18921 | // BucketLocationConstraintApNortheast1 is a BucketLocationConstraint enum value | ||
18922 | BucketLocationConstraintApNortheast1 = "ap-northeast-1" | ||
18923 | |||
18924 | // BucketLocationConstraintSaEast1 is a BucketLocationConstraint enum value | ||
18925 | BucketLocationConstraintSaEast1 = "sa-east-1" | ||
18926 | |||
18927 | // BucketLocationConstraintCnNorth1 is a BucketLocationConstraint enum value | ||
18928 | BucketLocationConstraintCnNorth1 = "cn-north-1" | ||
18929 | |||
18930 | // BucketLocationConstraintEuCentral1 is a BucketLocationConstraint enum value | ||
18931 | BucketLocationConstraintEuCentral1 = "eu-central-1" | ||
18932 | ) | ||
18933 | |||
18934 | const ( | ||
18935 | // BucketLogsPermissionFullControl is a BucketLogsPermission enum value | ||
18936 | BucketLogsPermissionFullControl = "FULL_CONTROL" | ||
18937 | |||
18938 | // BucketLogsPermissionRead is a BucketLogsPermission enum value | ||
18939 | BucketLogsPermissionRead = "READ" | ||
18940 | |||
18941 | // BucketLogsPermissionWrite is a BucketLogsPermission enum value | ||
18942 | BucketLogsPermissionWrite = "WRITE" | ||
18943 | ) | ||
18944 | |||
18945 | const ( | ||
18946 | // BucketVersioningStatusEnabled is a BucketVersioningStatus enum value | ||
18947 | BucketVersioningStatusEnabled = "Enabled" | ||
18948 | |||
18949 | // BucketVersioningStatusSuspended is a BucketVersioningStatus enum value | ||
18950 | BucketVersioningStatusSuspended = "Suspended" | ||
18951 | ) | ||
18952 | |||
18953 | // Requests Amazon S3 to encode the object keys in the response and specifies | ||
18954 | // the encoding method to use. An object key may contain any Unicode character; | ||
18955 | // however, XML 1.0 parser cannot parse some characters, such as characters | ||
18956 | // with an ASCII value from 0 to 10. For characters that are not supported in | ||
18957 | // XML 1.0, you can add this parameter to request that Amazon S3 encode the | ||
18958 | // keys in the response. | ||
18959 | const ( | ||
18960 | // EncodingTypeUrl is a EncodingType enum value | ||
18961 | EncodingTypeUrl = "url" | ||
18962 | ) | ||
18963 | |||
18964 | // Bucket event for which to send notifications. | ||
18965 | const ( | ||
18966 | // EventS3ReducedRedundancyLostObject is a Event enum value | ||
18967 | EventS3ReducedRedundancyLostObject = "s3:ReducedRedundancyLostObject" | ||
18968 | |||
18969 | // EventS3ObjectCreated is a Event enum value | ||
18970 | EventS3ObjectCreated = "s3:ObjectCreated:*" | ||
18971 | |||
18972 | // EventS3ObjectCreatedPut is a Event enum value | ||
18973 | EventS3ObjectCreatedPut = "s3:ObjectCreated:Put" | ||
18974 | |||
18975 | // EventS3ObjectCreatedPost is a Event enum value | ||
18976 | EventS3ObjectCreatedPost = "s3:ObjectCreated:Post" | ||
18977 | |||
18978 | // EventS3ObjectCreatedCopy is a Event enum value | ||
18979 | EventS3ObjectCreatedCopy = "s3:ObjectCreated:Copy" | ||
18980 | |||
18981 | // EventS3ObjectCreatedCompleteMultipartUpload is a Event enum value | ||
18982 | EventS3ObjectCreatedCompleteMultipartUpload = "s3:ObjectCreated:CompleteMultipartUpload" | ||
18983 | |||
18984 | // EventS3ObjectRemoved is a Event enum value | ||
18985 | EventS3ObjectRemoved = "s3:ObjectRemoved:*" | ||
18986 | |||
18987 | // EventS3ObjectRemovedDelete is a Event enum value | ||
18988 | EventS3ObjectRemovedDelete = "s3:ObjectRemoved:Delete" | ||
18989 | |||
18990 | // EventS3ObjectRemovedDeleteMarkerCreated is a Event enum value | ||
18991 | EventS3ObjectRemovedDeleteMarkerCreated = "s3:ObjectRemoved:DeleteMarkerCreated" | ||
18992 | ) | ||
18993 | |||
18994 | const ( | ||
18995 | // ExpirationStatusEnabled is a ExpirationStatus enum value | ||
18996 | ExpirationStatusEnabled = "Enabled" | ||
18997 | |||
18998 | // ExpirationStatusDisabled is a ExpirationStatus enum value | ||
18999 | ExpirationStatusDisabled = "Disabled" | ||
19000 | ) | ||
19001 | |||
19002 | const ( | ||
19003 | // FilterRuleNamePrefix is a FilterRuleName enum value | ||
19004 | FilterRuleNamePrefix = "prefix" | ||
19005 | |||
19006 | // FilterRuleNameSuffix is a FilterRuleName enum value | ||
19007 | FilterRuleNameSuffix = "suffix" | ||
19008 | ) | ||
19009 | |||
19010 | const ( | ||
19011 | // InventoryFormatCsv is a InventoryFormat enum value | ||
19012 | InventoryFormatCsv = "CSV" | ||
19013 | ) | ||
19014 | |||
19015 | const ( | ||
19016 | // InventoryFrequencyDaily is a InventoryFrequency enum value | ||
19017 | InventoryFrequencyDaily = "Daily" | ||
19018 | |||
19019 | // InventoryFrequencyWeekly is a InventoryFrequency enum value | ||
19020 | InventoryFrequencyWeekly = "Weekly" | ||
19021 | ) | ||
19022 | |||
19023 | const ( | ||
19024 | // InventoryIncludedObjectVersionsAll is a InventoryIncludedObjectVersions enum value | ||
19025 | InventoryIncludedObjectVersionsAll = "All" | ||
19026 | |||
19027 | // InventoryIncludedObjectVersionsCurrent is a InventoryIncludedObjectVersions enum value | ||
19028 | InventoryIncludedObjectVersionsCurrent = "Current" | ||
19029 | ) | ||
19030 | |||
19031 | const ( | ||
19032 | // InventoryOptionalFieldSize is a InventoryOptionalField enum value | ||
19033 | InventoryOptionalFieldSize = "Size" | ||
19034 | |||
19035 | // InventoryOptionalFieldLastModifiedDate is a InventoryOptionalField enum value | ||
19036 | InventoryOptionalFieldLastModifiedDate = "LastModifiedDate" | ||
19037 | |||
19038 | // InventoryOptionalFieldStorageClass is a InventoryOptionalField enum value | ||
19039 | InventoryOptionalFieldStorageClass = "StorageClass" | ||
19040 | |||
19041 | // InventoryOptionalFieldEtag is a InventoryOptionalField enum value | ||
19042 | InventoryOptionalFieldEtag = "ETag" | ||
19043 | |||
19044 | // InventoryOptionalFieldIsMultipartUploaded is a InventoryOptionalField enum value | ||
19045 | InventoryOptionalFieldIsMultipartUploaded = "IsMultipartUploaded" | ||
19046 | |||
19047 | // InventoryOptionalFieldReplicationStatus is a InventoryOptionalField enum value | ||
19048 | InventoryOptionalFieldReplicationStatus = "ReplicationStatus" | ||
19049 | ) | ||
19050 | |||
19051 | const ( | ||
19052 | // MFADeleteEnabled is a MFADelete enum value | ||
19053 | MFADeleteEnabled = "Enabled" | ||
19054 | |||
19055 | // MFADeleteDisabled is a MFADelete enum value | ||
19056 | MFADeleteDisabled = "Disabled" | ||
19057 | ) | ||
19058 | |||
19059 | const ( | ||
19060 | // MFADeleteStatusEnabled is a MFADeleteStatus enum value | ||
19061 | MFADeleteStatusEnabled = "Enabled" | ||
19062 | |||
19063 | // MFADeleteStatusDisabled is a MFADeleteStatus enum value | ||
19064 | MFADeleteStatusDisabled = "Disabled" | ||
19065 | ) | ||
19066 | |||
19067 | const ( | ||
19068 | // MetadataDirectiveCopy is a MetadataDirective enum value | ||
19069 | MetadataDirectiveCopy = "COPY" | ||
19070 | |||
19071 | // MetadataDirectiveReplace is a MetadataDirective enum value | ||
19072 | MetadataDirectiveReplace = "REPLACE" | ||
19073 | ) | ||
19074 | |||
19075 | const ( | ||
19076 | // ObjectCannedACLPrivate is a ObjectCannedACL enum value | ||
19077 | ObjectCannedACLPrivate = "private" | ||
19078 | |||
19079 | // ObjectCannedACLPublicRead is a ObjectCannedACL enum value | ||
19080 | ObjectCannedACLPublicRead = "public-read" | ||
19081 | |||
19082 | // ObjectCannedACLPublicReadWrite is a ObjectCannedACL enum value | ||
19083 | ObjectCannedACLPublicReadWrite = "public-read-write" | ||
19084 | |||
19085 | // ObjectCannedACLAuthenticatedRead is a ObjectCannedACL enum value | ||
19086 | ObjectCannedACLAuthenticatedRead = "authenticated-read" | ||
19087 | |||
19088 | // ObjectCannedACLAwsExecRead is a ObjectCannedACL enum value | ||
19089 | ObjectCannedACLAwsExecRead = "aws-exec-read" | ||
19090 | |||
19091 | // ObjectCannedACLBucketOwnerRead is a ObjectCannedACL enum value | ||
19092 | ObjectCannedACLBucketOwnerRead = "bucket-owner-read" | ||
19093 | |||
19094 | // ObjectCannedACLBucketOwnerFullControl is a ObjectCannedACL enum value | ||
19095 | ObjectCannedACLBucketOwnerFullControl = "bucket-owner-full-control" | ||
19096 | ) | ||
19097 | |||
19098 | const ( | ||
19099 | // ObjectStorageClassStandard is a ObjectStorageClass enum value | ||
19100 | ObjectStorageClassStandard = "STANDARD" | ||
19101 | |||
19102 | // ObjectStorageClassReducedRedundancy is a ObjectStorageClass enum value | ||
19103 | ObjectStorageClassReducedRedundancy = "REDUCED_REDUNDANCY" | ||
19104 | |||
19105 | // ObjectStorageClassGlacier is a ObjectStorageClass enum value | ||
19106 | ObjectStorageClassGlacier = "GLACIER" | ||
19107 | ) | ||
19108 | |||
19109 | const ( | ||
19110 | // ObjectVersionStorageClassStandard is a ObjectVersionStorageClass enum value | ||
19111 | ObjectVersionStorageClassStandard = "STANDARD" | ||
19112 | ) | ||
19113 | |||
19114 | const ( | ||
19115 | // PayerRequester is a Payer enum value | ||
19116 | PayerRequester = "Requester" | ||
19117 | |||
19118 | // PayerBucketOwner is a Payer enum value | ||
19119 | PayerBucketOwner = "BucketOwner" | ||
19120 | ) | ||
19121 | |||
19122 | const ( | ||
19123 | // PermissionFullControl is a Permission enum value | ||
19124 | PermissionFullControl = "FULL_CONTROL" | ||
19125 | |||
19126 | // PermissionWrite is a Permission enum value | ||
19127 | PermissionWrite = "WRITE" | ||
19128 | |||
19129 | // PermissionWriteAcp is a Permission enum value | ||
19130 | PermissionWriteAcp = "WRITE_ACP" | ||
19131 | |||
19132 | // PermissionRead is a Permission enum value | ||
19133 | PermissionRead = "READ" | ||
19134 | |||
19135 | // PermissionReadAcp is a Permission enum value | ||
19136 | PermissionReadAcp = "READ_ACP" | ||
19137 | ) | ||
19138 | |||
19139 | const ( | ||
19140 | // ProtocolHttp is a Protocol enum value | ||
19141 | ProtocolHttp = "http" | ||
19142 | |||
19143 | // ProtocolHttps is a Protocol enum value | ||
19144 | ProtocolHttps = "https" | ||
19145 | ) | ||
19146 | |||
19147 | const ( | ||
19148 | // ReplicationRuleStatusEnabled is a ReplicationRuleStatus enum value | ||
19149 | ReplicationRuleStatusEnabled = "Enabled" | ||
19150 | |||
19151 | // ReplicationRuleStatusDisabled is a ReplicationRuleStatus enum value | ||
19152 | ReplicationRuleStatusDisabled = "Disabled" | ||
19153 | ) | ||
19154 | |||
19155 | const ( | ||
19156 | // ReplicationStatusComplete is a ReplicationStatus enum value | ||
19157 | ReplicationStatusComplete = "COMPLETE" | ||
19158 | |||
19159 | // ReplicationStatusPending is a ReplicationStatus enum value | ||
19160 | ReplicationStatusPending = "PENDING" | ||
19161 | |||
19162 | // ReplicationStatusFailed is a ReplicationStatus enum value | ||
19163 | ReplicationStatusFailed = "FAILED" | ||
19164 | |||
19165 | // ReplicationStatusReplica is a ReplicationStatus enum value | ||
19166 | ReplicationStatusReplica = "REPLICA" | ||
19167 | ) | ||
19168 | |||
19169 | // If present, indicates that the requester was successfully charged for the | ||
19170 | // request. | ||
19171 | const ( | ||
19172 | // RequestChargedRequester is a RequestCharged enum value | ||
19173 | RequestChargedRequester = "requester" | ||
19174 | ) | ||
19175 | |||
19176 | // Confirms that the requester knows that she or he will be charged for the | ||
19177 | // request. Bucket owners need not specify this parameter in their requests. | ||
19178 | // Documentation on downloading objects from requester pays buckets can be found | ||
19179 | // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html | ||
19180 | const ( | ||
19181 | // RequestPayerRequester is a RequestPayer enum value | ||
19182 | RequestPayerRequester = "requester" | ||
19183 | ) | ||
19184 | |||
19185 | const ( | ||
19186 | // ServerSideEncryptionAes256 is a ServerSideEncryption enum value | ||
19187 | ServerSideEncryptionAes256 = "AES256" | ||
19188 | |||
19189 | // ServerSideEncryptionAwsKms is a ServerSideEncryption enum value | ||
19190 | ServerSideEncryptionAwsKms = "aws:kms" | ||
19191 | ) | ||
19192 | |||
19193 | const ( | ||
19194 | // StorageClassStandard is a StorageClass enum value | ||
19195 | StorageClassStandard = "STANDARD" | ||
19196 | |||
19197 | // StorageClassReducedRedundancy is a StorageClass enum value | ||
19198 | StorageClassReducedRedundancy = "REDUCED_REDUNDANCY" | ||
19199 | |||
19200 | // StorageClassStandardIa is a StorageClass enum value | ||
19201 | StorageClassStandardIa = "STANDARD_IA" | ||
19202 | ) | ||
19203 | |||
19204 | const ( | ||
19205 | // StorageClassAnalysisSchemaVersionV1 is a StorageClassAnalysisSchemaVersion enum value | ||
19206 | StorageClassAnalysisSchemaVersionV1 = "V_1" | ||
19207 | ) | ||
19208 | |||
19209 | const ( | ||
19210 | // TaggingDirectiveCopy is a TaggingDirective enum value | ||
19211 | TaggingDirectiveCopy = "COPY" | ||
19212 | |||
19213 | // TaggingDirectiveReplace is a TaggingDirective enum value | ||
19214 | TaggingDirectiveReplace = "REPLACE" | ||
19215 | ) | ||
19216 | |||
19217 | const ( | ||
19218 | // TierStandard is a Tier enum value | ||
19219 | TierStandard = "Standard" | ||
19220 | |||
19221 | // TierBulk is a Tier enum value | ||
19222 | TierBulk = "Bulk" | ||
19223 | |||
19224 | // TierExpedited is a Tier enum value | ||
19225 | TierExpedited = "Expedited" | ||
19226 | ) | ||
19227 | |||
19228 | const ( | ||
19229 | // TransitionStorageClassGlacier is a TransitionStorageClass enum value | ||
19230 | TransitionStorageClassGlacier = "GLACIER" | ||
19231 | |||
19232 | // TransitionStorageClassStandardIa is a TransitionStorageClass enum value | ||
19233 | TransitionStorageClassStandardIa = "STANDARD_IA" | ||
19234 | ) | ||
19235 | |||
19236 | const ( | ||
19237 | // TypeCanonicalUser is a Type enum value | ||
19238 | TypeCanonicalUser = "CanonicalUser" | ||
19239 | |||
19240 | // TypeAmazonCustomerByEmail is a Type enum value | ||
19241 | TypeAmazonCustomerByEmail = "AmazonCustomerByEmail" | ||
19242 | |||
19243 | // TypeGroup is a Type enum value | ||
19244 | TypeGroup = "Group" | ||
19245 | ) | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/bucket_location.go b/vendor/github.com/aws/aws-sdk-go/service/s3/bucket_location.go new file mode 100644 index 0000000..bc68a46 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/bucket_location.go | |||
@@ -0,0 +1,106 @@ | |||
1 | package s3 | ||
2 | |||
3 | import ( | ||
4 | "io/ioutil" | ||
5 | "regexp" | ||
6 | |||
7 | "github.com/aws/aws-sdk-go/aws" | ||
8 | "github.com/aws/aws-sdk-go/aws/awserr" | ||
9 | "github.com/aws/aws-sdk-go/aws/awsutil" | ||
10 | "github.com/aws/aws-sdk-go/aws/request" | ||
11 | ) | ||
12 | |||
13 | var reBucketLocation = regexp.MustCompile(`>([^<>]+)<\/Location`) | ||
14 | |||
15 | // NormalizeBucketLocation is a utility function which will update the | ||
16 | // passed in value to always be a region ID. Generally this would be used | ||
17 | // with GetBucketLocation API operation. | ||
18 | // | ||
19 | // Replaces empty string with "us-east-1", and "EU" with "eu-west-1". | ||
20 | // | ||
21 | // See http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETlocation.html | ||
22 | // for more information on the values that can be returned. | ||
23 | func NormalizeBucketLocation(loc string) string { | ||
24 | switch loc { | ||
25 | case "": | ||
26 | loc = "us-east-1" | ||
27 | case "EU": | ||
28 | loc = "eu-west-1" | ||
29 | } | ||
30 | |||
31 | return loc | ||
32 | } | ||
33 | |||
34 | // NormalizeBucketLocationHandler is a request handler which will update the | ||
35 | // GetBucketLocation's result LocationConstraint value to always be a region ID. | ||
36 | // | ||
37 | // Replaces empty string with "us-east-1", and "EU" with "eu-west-1". | ||
38 | // | ||
39 | // See http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETlocation.html | ||
40 | // for more information on the values that can be returned. | ||
41 | // | ||
42 | // req, result := svc.GetBucketLocationRequest(&s3.GetBucketLocationInput{ | ||
43 | // Bucket: aws.String(bucket), | ||
44 | // }) | ||
45 | // req.Handlers.Unmarshal.PushBackNamed(NormalizeBucketLocationHandler) | ||
46 | // err := req.Send() | ||
47 | var NormalizeBucketLocationHandler = request.NamedHandler{ | ||
48 | Name: "awssdk.s3.NormalizeBucketLocation", | ||
49 | Fn: func(req *request.Request) { | ||
50 | if req.Error != nil { | ||
51 | return | ||
52 | } | ||
53 | |||
54 | out := req.Data.(*GetBucketLocationOutput) | ||
55 | loc := NormalizeBucketLocation(aws.StringValue(out.LocationConstraint)) | ||
56 | out.LocationConstraint = aws.String(loc) | ||
57 | }, | ||
58 | } | ||
59 | |||
60 | // WithNormalizeBucketLocation is a request option which will update the | ||
61 | // GetBucketLocation's result LocationConstraint value to always be a region ID. | ||
62 | // | ||
63 | // Replaces empty string with "us-east-1", and "EU" with "eu-west-1". | ||
64 | // | ||
65 | // See http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETlocation.html | ||
66 | // for more information on the values that can be returned. | ||
67 | // | ||
68 | // result, err := svc.GetBucketLocationWithContext(ctx, | ||
69 | // &s3.GetBucketLocationInput{ | ||
70 | // Bucket: aws.String(bucket), | ||
71 | // }, | ||
72 | // s3.WithNormalizeBucketLocation, | ||
73 | // ) | ||
74 | func WithNormalizeBucketLocation(r *request.Request) { | ||
75 | r.Handlers.Unmarshal.PushBackNamed(NormalizeBucketLocationHandler) | ||
76 | } | ||
77 | |||
78 | func buildGetBucketLocation(r *request.Request) { | ||
79 | if r.DataFilled() { | ||
80 | out := r.Data.(*GetBucketLocationOutput) | ||
81 | b, err := ioutil.ReadAll(r.HTTPResponse.Body) | ||
82 | if err != nil { | ||
83 | r.Error = awserr.New("SerializationError", "failed reading response body", err) | ||
84 | return | ||
85 | } | ||
86 | |||
87 | match := reBucketLocation.FindSubmatch(b) | ||
88 | if len(match) > 1 { | ||
89 | loc := string(match[1]) | ||
90 | out.LocationConstraint = aws.String(loc) | ||
91 | } | ||
92 | } | ||
93 | } | ||
94 | |||
95 | func populateLocationConstraint(r *request.Request) { | ||
96 | if r.ParamsFilled() && aws.StringValue(r.Config.Region) != "us-east-1" { | ||
97 | in := r.Params.(*CreateBucketInput) | ||
98 | if in.CreateBucketConfiguration == nil { | ||
99 | r.Params = awsutil.CopyOf(r.Params) | ||
100 | in = r.Params.(*CreateBucketInput) | ||
101 | in.CreateBucketConfiguration = &CreateBucketConfiguration{ | ||
102 | LocationConstraint: r.Config.Region, | ||
103 | } | ||
104 | } | ||
105 | } | ||
106 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/content_md5.go b/vendor/github.com/aws/aws-sdk-go/service/s3/content_md5.go new file mode 100644 index 0000000..9fc5df9 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/content_md5.go | |||
@@ -0,0 +1,36 @@ | |||
1 | package s3 | ||
2 | |||
3 | import ( | ||
4 | "crypto/md5" | ||
5 | "encoding/base64" | ||
6 | "io" | ||
7 | |||
8 | "github.com/aws/aws-sdk-go/aws/awserr" | ||
9 | "github.com/aws/aws-sdk-go/aws/request" | ||
10 | ) | ||
11 | |||
12 | // contentMD5 computes and sets the HTTP Content-MD5 header for requests that | ||
13 | // require it. | ||
14 | func contentMD5(r *request.Request) { | ||
15 | h := md5.New() | ||
16 | |||
17 | // hash the body. seek back to the first position after reading to reset | ||
18 | // the body for transmission. copy errors may be assumed to be from the | ||
19 | // body. | ||
20 | _, err := io.Copy(h, r.Body) | ||
21 | if err != nil { | ||
22 | r.Error = awserr.New("ContentMD5", "failed to read body", err) | ||
23 | return | ||
24 | } | ||
25 | _, err = r.Body.Seek(0, 0) | ||
26 | if err != nil { | ||
27 | r.Error = awserr.New("ContentMD5", "failed to seek body", err) | ||
28 | return | ||
29 | } | ||
30 | |||
31 | // encode the md5 checksum in base64 and set the request header. | ||
32 | sum := h.Sum(nil) | ||
33 | sum64 := make([]byte, base64.StdEncoding.EncodedLen(len(sum))) | ||
34 | base64.StdEncoding.Encode(sum64, sum) | ||
35 | r.HTTPRequest.Header.Set("Content-MD5", string(sum64)) | ||
36 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/customizations.go b/vendor/github.com/aws/aws-sdk-go/service/s3/customizations.go new file mode 100644 index 0000000..8463347 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/customizations.go | |||
@@ -0,0 +1,46 @@ | |||
1 | package s3 | ||
2 | |||
3 | import ( | ||
4 | "github.com/aws/aws-sdk-go/aws/client" | ||
5 | "github.com/aws/aws-sdk-go/aws/request" | ||
6 | ) | ||
7 | |||
8 | func init() { | ||
9 | initClient = defaultInitClientFn | ||
10 | initRequest = defaultInitRequestFn | ||
11 | } | ||
12 | |||
13 | func defaultInitClientFn(c *client.Client) { | ||
14 | // Support building custom endpoints based on config | ||
15 | c.Handlers.Build.PushFront(updateEndpointForS3Config) | ||
16 | |||
17 | // Require SSL when using SSE keys | ||
18 | c.Handlers.Validate.PushBack(validateSSERequiresSSL) | ||
19 | c.Handlers.Build.PushBack(computeSSEKeys) | ||
20 | |||
21 | // S3 uses custom error unmarshaling logic | ||
22 | c.Handlers.UnmarshalError.Clear() | ||
23 | c.Handlers.UnmarshalError.PushBack(unmarshalError) | ||
24 | } | ||
25 | |||
26 | func defaultInitRequestFn(r *request.Request) { | ||
27 | // Add reuest handlers for specific platforms. | ||
28 | // e.g. 100-continue support for PUT requests using Go 1.6 | ||
29 | platformRequestHandlers(r) | ||
30 | |||
31 | switch r.Operation.Name { | ||
32 | case opPutBucketCors, opPutBucketLifecycle, opPutBucketPolicy, | ||
33 | opPutBucketTagging, opDeleteObjects, opPutBucketLifecycleConfiguration, | ||
34 | opPutBucketReplication: | ||
35 | // These S3 operations require Content-MD5 to be set | ||
36 | r.Handlers.Build.PushBack(contentMD5) | ||
37 | case opGetBucketLocation: | ||
38 | // GetBucketLocation has custom parsing logic | ||
39 | r.Handlers.Unmarshal.PushFront(buildGetBucketLocation) | ||
40 | case opCreateBucket: | ||
41 | // Auto-populate LocationConstraint with current region | ||
42 | r.Handlers.Validate.PushFront(populateLocationConstraint) | ||
43 | case opCopyObject, opUploadPartCopy, opCompleteMultipartUpload: | ||
44 | r.Handlers.Unmarshal.PushFront(copyMultipartStatusOKUnmarhsalError) | ||
45 | } | ||
46 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/doc.go b/vendor/github.com/aws/aws-sdk-go/service/s3/doc.go new file mode 100644 index 0000000..f045fd0 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/doc.go | |||
@@ -0,0 +1,78 @@ | |||
1 | // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. | ||
2 | |||
3 | // Package s3 provides the client and types for making API | ||
4 | // requests to Amazon Simple Storage Service. | ||
5 | // | ||
6 | // See https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01 for more information on this service. | ||
7 | // | ||
8 | // See s3 package documentation for more information. | ||
9 | // https://docs.aws.amazon.com/sdk-for-go/api/service/s3/ | ||
10 | // | ||
11 | // Using the Client | ||
12 | // | ||
13 | // To use the client for Amazon Simple Storage Service you will first need | ||
14 | // to create a new instance of it. | ||
15 | // | ||
16 | // When creating a client for an AWS service you'll first need to have a Session | ||
17 | // already created. The Session provides configuration that can be shared | ||
18 | // between multiple service clients. Additional configuration can be applied to | ||
19 | // the Session and service's client when they are constructed. The aws package's | ||
20 | // Config type contains several fields such as Region for the AWS Region the | ||
21 | // client should make API requests too. The optional Config value can be provided | ||
22 | // as the variadic argument for Sessions and client creation. | ||
23 | // | ||
24 | // Once the service's client is created you can use it to make API requests the | ||
25 | // AWS service. These clients are safe to use concurrently. | ||
26 | // | ||
27 | // // Create a session to share configuration, and load external configuration. | ||
28 | // sess := session.Must(session.NewSession()) | ||
29 | // | ||
30 | // // Create the service's client with the session. | ||
31 | // svc := s3.New(sess) | ||
32 | // | ||
33 | // See the SDK's documentation for more information on how to use service clients. | ||
34 | // https://docs.aws.amazon.com/sdk-for-go/api/ | ||
35 | // | ||
36 | // See aws package's Config type for more information on configuration options. | ||
37 | // https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config | ||
38 | // | ||
39 | // See the Amazon Simple Storage Service client S3 for more | ||
40 | // information on creating the service's client. | ||
41 | // https://docs.aws.amazon.com/sdk-for-go/api/service/s3/#New | ||
42 | // | ||
43 | // Once the client is created you can make an API request to the service. | ||
44 | // Each API method takes a input parameter, and returns the service response | ||
45 | // and an error. | ||
46 | // | ||
47 | // The API method will document which error codes the service can be returned | ||
48 | // by the operation if the service models the API operation's errors. These | ||
49 | // errors will also be available as const strings prefixed with "ErrCode". | ||
50 | // | ||
51 | // result, err := svc.AbortMultipartUpload(params) | ||
52 | // if err != nil { | ||
53 | // // Cast err to awserr.Error to handle specific error codes. | ||
54 | // aerr, ok := err.(awserr.Error) | ||
55 | // if ok && aerr.Code() == <error code to check for> { | ||
56 | // // Specific error code handling | ||
57 | // } | ||
58 | // return err | ||
59 | // } | ||
60 | // | ||
61 | // fmt.Println("AbortMultipartUpload result:") | ||
62 | // fmt.Println(result) | ||
63 | // | ||
64 | // Using the Client with Context | ||
65 | // | ||
66 | // The service's client also provides methods to make API requests with a Context | ||
67 | // value. This allows you to control the timeout, and cancellation of pending | ||
68 | // requests. These methods also take request Option as variadic parameter to apply | ||
69 | // additional configuration to the API request. | ||
70 | // | ||
71 | // ctx := context.Background() | ||
72 | // | ||
73 | // result, err := svc.AbortMultipartUploadWithContext(ctx, params) | ||
74 | // | ||
75 | // See the request package documentation for more information on using Context pattern | ||
76 | // with the SDK. | ||
77 | // https://docs.aws.amazon.com/sdk-for-go/api/aws/request/ | ||
78 | package s3 | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/doc_custom.go b/vendor/github.com/aws/aws-sdk-go/service/s3/doc_custom.go new file mode 100644 index 0000000..b794a63 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/doc_custom.go | |||
@@ -0,0 +1,109 @@ | |||
1 | // Upload Managers | ||
2 | // | ||
3 | // The s3manager package's Uploader provides concurrent upload of content to S3 | ||
4 | // by taking advantage of S3's Multipart APIs. The Uploader also supports both | ||
5 | // io.Reader for streaming uploads, and will also take advantage of io.ReadSeeker | ||
6 | // for optimizations if the Body satisfies that type. Once the Uploader instance | ||
7 | // is created you can call Upload concurrently from multiple goroutines safely. | ||
8 | // | ||
9 | // // The session the S3 Uploader will use | ||
10 | // sess := session.Must(session.NewSession()) | ||
11 | // | ||
12 | // // Create an uploader with the session and default options | ||
13 | // uploader := s3manager.NewUploader(sess) | ||
14 | // | ||
15 | // f, err := os.Open(filename) | ||
16 | // if err != nil { | ||
17 | // return fmt.Errorf("failed to open file %q, %v", filename, err) | ||
18 | // } | ||
19 | // | ||
20 | // // Upload the file to S3. | ||
21 | // result, err := uploader.Upload(&s3manager.UploadInput{ | ||
22 | // Bucket: aws.String(myBucket), | ||
23 | // Key: aws.String(myString), | ||
24 | // Body: f, | ||
25 | // }) | ||
26 | // if err != nil { | ||
27 | // return fmt.Errorf("failed to upload file, %v", err) | ||
28 | // } | ||
29 | // fmt.Printf("file uploaded to, %s\n", aws.StringValue(result.Location)) | ||
30 | // | ||
31 | // See the s3manager package's Uploader type documentation for more information. | ||
32 | // https://docs.aws.amazon.com/sdk-for-go/api/service/s3/s3manager/#Uploader | ||
33 | // | ||
34 | // Download Manager | ||
35 | // | ||
36 | // The s3manager package's Downloader provides concurrently downloading of Objects | ||
37 | // from S3. The Downloader will write S3 Object content with an io.WriterAt. | ||
38 | // Once the Downloader instance is created you can call Upload concurrently from | ||
39 | // multiple goroutines safely. | ||
40 | // | ||
41 | // // The session the S3 Downloader will use | ||
42 | // sess := session.Must(session.NewSession()) | ||
43 | // | ||
44 | // // Create a downloader with the session and default options | ||
45 | // downloader := s3manager.NewDownloader(sess) | ||
46 | // | ||
47 | // // Create a file to write the S3 Object contents to. | ||
48 | // f, err := os.Create(filename) | ||
49 | // if err != nil { | ||
50 | // return fmt.Errorf("failed to create file %q, %v", filename, err) | ||
51 | // } | ||
52 | // | ||
53 | // // Write the contents of S3 Object to the file | ||
54 | // n, err := downloader.Download(f, &s3.GetObjectInput{ | ||
55 | // Bucket: aws.String(myBucket), | ||
56 | // Key: aws.String(myString), | ||
57 | // }) | ||
58 | // if err != nil { | ||
59 | // return fmt.Errorf("failed to upload file, %v", err) | ||
60 | // } | ||
61 | // fmt.Printf("file downloaded, %d bytes\n", n) | ||
62 | // | ||
63 | // See the s3manager package's Downloader type documentation for more information. | ||
64 | // https://docs.aws.amazon.com/sdk-for-go/api/service/s3/s3manager/#Downloader | ||
65 | // | ||
66 | // Get Bucket Region | ||
67 | // | ||
68 | // GetBucketRegion will attempt to get the region for a bucket using a region | ||
69 | // hint to determine which AWS partition to perform the query on. Use this utility | ||
70 | // to determine the region a bucket is in. | ||
71 | // | ||
72 | // sess := session.Must(session.NewSession()) | ||
73 | // | ||
74 | // bucket := "my-bucket" | ||
75 | // region, err := s3manager.GetBucketRegion(ctx, sess, bucket, "us-west-2") | ||
76 | // if err != nil { | ||
77 | // if aerr, ok := err.(awserr.Error); ok && aerr.Code() == "NotFound" { | ||
78 | // fmt.Fprintf(os.Stderr, "unable to find bucket %s's region not found\n", bucket) | ||
79 | // } | ||
80 | // return err | ||
81 | // } | ||
82 | // fmt.Printf("Bucket %s is in %s region\n", bucket, region) | ||
83 | // | ||
84 | // See the s3manager package's GetBucketRegion function documentation for more information | ||
85 | // https://docs.aws.amazon.com/sdk-for-go/api/service/s3/s3manager/#GetBucketRegion | ||
86 | // | ||
87 | // S3 Crypto Client | ||
88 | // | ||
89 | // The s3crypto package provides the tools to upload and download encrypted | ||
90 | // content from S3. The Encryption and Decryption clients can be used concurrently | ||
91 | // once the client is created. | ||
92 | // | ||
93 | // sess := session.Must(session.NewSession()) | ||
94 | // | ||
95 | // // Create the decryption client. | ||
96 | // svc := s3crypto.NewDecryptionClient(sess) | ||
97 | // | ||
98 | // // The object will be downloaded from S3 and decrypted locally. By metadata | ||
99 | // // about the object's encryption will instruct the decryption client how | ||
100 | // // decrypt the content of the object. By default KMS is used for keys. | ||
101 | // result, err := svc.GetObject(&s3.GetObjectInput { | ||
102 | // Bucket: aws.String(myBucket), | ||
103 | // Key: aws.String(myKey), | ||
104 | // }) | ||
105 | // | ||
106 | // See the s3crypto package documentation for more information. | ||
107 | // https://docs.aws.amazon.com/sdk-for-go/api/service/s3/s3crypto/ | ||
108 | // | ||
109 | package s3 | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/errors.go b/vendor/github.com/aws/aws-sdk-go/service/s3/errors.go new file mode 100644 index 0000000..931cb17 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/errors.go | |||
@@ -0,0 +1,48 @@ | |||
1 | // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. | ||
2 | |||
3 | package s3 | ||
4 | |||
5 | const ( | ||
6 | |||
7 | // ErrCodeBucketAlreadyExists for service response error code | ||
8 | // "BucketAlreadyExists". | ||
9 | // | ||
10 | // The requested bucket name is not available. The bucket namespace is shared | ||
11 | // by all users of the system. Please select a different name and try again. | ||
12 | ErrCodeBucketAlreadyExists = "BucketAlreadyExists" | ||
13 | |||
14 | // ErrCodeBucketAlreadyOwnedByYou for service response error code | ||
15 | // "BucketAlreadyOwnedByYou". | ||
16 | ErrCodeBucketAlreadyOwnedByYou = "BucketAlreadyOwnedByYou" | ||
17 | |||
18 | // ErrCodeNoSuchBucket for service response error code | ||
19 | // "NoSuchBucket". | ||
20 | // | ||
21 | // The specified bucket does not exist. | ||
22 | ErrCodeNoSuchBucket = "NoSuchBucket" | ||
23 | |||
24 | // ErrCodeNoSuchKey for service response error code | ||
25 | // "NoSuchKey". | ||
26 | // | ||
27 | // The specified key does not exist. | ||
28 | ErrCodeNoSuchKey = "NoSuchKey" | ||
29 | |||
30 | // ErrCodeNoSuchUpload for service response error code | ||
31 | // "NoSuchUpload". | ||
32 | // | ||
33 | // The specified multipart upload does not exist. | ||
34 | ErrCodeNoSuchUpload = "NoSuchUpload" | ||
35 | |||
36 | // ErrCodeObjectAlreadyInActiveTierError for service response error code | ||
37 | // "ObjectAlreadyInActiveTierError". | ||
38 | // | ||
39 | // This operation is not allowed against this storage tier | ||
40 | ErrCodeObjectAlreadyInActiveTierError = "ObjectAlreadyInActiveTierError" | ||
41 | |||
42 | // ErrCodeObjectNotInActiveTierError for service response error code | ||
43 | // "ObjectNotInActiveTierError". | ||
44 | // | ||
45 | // The source object of the COPY operation is not in the active tier and is | ||
46 | // only stored in Amazon Glacier. | ||
47 | ErrCodeObjectNotInActiveTierError = "ObjectNotInActiveTierError" | ||
48 | ) | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/host_style_bucket.go b/vendor/github.com/aws/aws-sdk-go/service/s3/host_style_bucket.go new file mode 100644 index 0000000..ec3ffe4 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/host_style_bucket.go | |||
@@ -0,0 +1,162 @@ | |||
1 | package s3 | ||
2 | |||
3 | import ( | ||
4 | "fmt" | ||
5 | "net/url" | ||
6 | "regexp" | ||
7 | "strings" | ||
8 | |||
9 | "github.com/aws/aws-sdk-go/aws" | ||
10 | "github.com/aws/aws-sdk-go/aws/awserr" | ||
11 | "github.com/aws/aws-sdk-go/aws/awsutil" | ||
12 | "github.com/aws/aws-sdk-go/aws/request" | ||
13 | ) | ||
14 | |||
15 | // an operationBlacklist is a list of operation names that should a | ||
16 | // request handler should not be executed with. | ||
17 | type operationBlacklist []string | ||
18 | |||
19 | // Continue will return true of the Request's operation name is not | ||
20 | // in the blacklist. False otherwise. | ||
21 | func (b operationBlacklist) Continue(r *request.Request) bool { | ||
22 | for i := 0; i < len(b); i++ { | ||
23 | if b[i] == r.Operation.Name { | ||
24 | return false | ||
25 | } | ||
26 | } | ||
27 | return true | ||
28 | } | ||
29 | |||
30 | var accelerateOpBlacklist = operationBlacklist{ | ||
31 | opListBuckets, opCreateBucket, opDeleteBucket, | ||
32 | } | ||
33 | |||
34 | // Request handler to automatically add the bucket name to the endpoint domain | ||
35 | // if possible. This style of bucket is valid for all bucket names which are | ||
36 | // DNS compatible and do not contain "." | ||
37 | func updateEndpointForS3Config(r *request.Request) { | ||
38 | forceHostStyle := aws.BoolValue(r.Config.S3ForcePathStyle) | ||
39 | accelerate := aws.BoolValue(r.Config.S3UseAccelerate) | ||
40 | |||
41 | if accelerate && accelerateOpBlacklist.Continue(r) { | ||
42 | if forceHostStyle { | ||
43 | if r.Config.Logger != nil { | ||
44 | r.Config.Logger.Log("ERROR: aws.Config.S3UseAccelerate is not compatible with aws.Config.S3ForcePathStyle, ignoring S3ForcePathStyle.") | ||
45 | } | ||
46 | } | ||
47 | updateEndpointForAccelerate(r) | ||
48 | } else if !forceHostStyle && r.Operation.Name != opGetBucketLocation { | ||
49 | updateEndpointForHostStyle(r) | ||
50 | } | ||
51 | } | ||
52 | |||
53 | func updateEndpointForHostStyle(r *request.Request) { | ||
54 | bucket, ok := bucketNameFromReqParams(r.Params) | ||
55 | if !ok { | ||
56 | // Ignore operation requests if the bucketname was not provided | ||
57 | // if this is an input validation error the validation handler | ||
58 | // will report it. | ||
59 | return | ||
60 | } | ||
61 | |||
62 | if !hostCompatibleBucketName(r.HTTPRequest.URL, bucket) { | ||
63 | // bucket name must be valid to put into the host | ||
64 | return | ||
65 | } | ||
66 | |||
67 | moveBucketToHost(r.HTTPRequest.URL, bucket) | ||
68 | } | ||
69 | |||
70 | var ( | ||
71 | accelElem = []byte("s3-accelerate.dualstack.") | ||
72 | ) | ||
73 | |||
74 | func updateEndpointForAccelerate(r *request.Request) { | ||
75 | bucket, ok := bucketNameFromReqParams(r.Params) | ||
76 | if !ok { | ||
77 | // Ignore operation requests if the bucketname was not provided | ||
78 | // if this is an input validation error the validation handler | ||
79 | // will report it. | ||
80 | return | ||
81 | } | ||
82 | |||
83 | if !hostCompatibleBucketName(r.HTTPRequest.URL, bucket) { | ||
84 | r.Error = awserr.New("InvalidParameterException", | ||
85 | fmt.Sprintf("bucket name %s is not compatible with S3 Accelerate", bucket), | ||
86 | nil) | ||
87 | return | ||
88 | } | ||
89 | |||
90 | parts := strings.Split(r.HTTPRequest.URL.Host, ".") | ||
91 | if len(parts) < 3 { | ||
92 | r.Error = awserr.New("InvalidParameterExecption", | ||
93 | fmt.Sprintf("unable to update endpoint host for S3 accelerate, hostname invalid, %s", | ||
94 | r.HTTPRequest.URL.Host), nil) | ||
95 | return | ||
96 | } | ||
97 | |||
98 | if parts[0] == "s3" || strings.HasPrefix(parts[0], "s3-") { | ||
99 | parts[0] = "s3-accelerate" | ||
100 | } | ||
101 | for i := 1; i+1 < len(parts); i++ { | ||
102 | if parts[i] == aws.StringValue(r.Config.Region) { | ||
103 | parts = append(parts[:i], parts[i+1:]...) | ||
104 | break | ||
105 | } | ||
106 | } | ||
107 | |||
108 | r.HTTPRequest.URL.Host = strings.Join(parts, ".") | ||
109 | |||
110 | moveBucketToHost(r.HTTPRequest.URL, bucket) | ||
111 | } | ||
112 | |||
113 | // Attempts to retrieve the bucket name from the request input parameters. | ||
114 | // If no bucket is found, or the field is empty "", false will be returned. | ||
115 | func bucketNameFromReqParams(params interface{}) (string, bool) { | ||
116 | b, _ := awsutil.ValuesAtPath(params, "Bucket") | ||
117 | if len(b) == 0 { | ||
118 | return "", false | ||
119 | } | ||
120 | |||
121 | if bucket, ok := b[0].(*string); ok { | ||
122 | if bucketStr := aws.StringValue(bucket); bucketStr != "" { | ||
123 | return bucketStr, true | ||
124 | } | ||
125 | } | ||
126 | |||
127 | return "", false | ||
128 | } | ||
129 | |||
130 | // hostCompatibleBucketName returns true if the request should | ||
131 | // put the bucket in the host. This is false if S3ForcePathStyle is | ||
132 | // explicitly set or if the bucket is not DNS compatible. | ||
133 | func hostCompatibleBucketName(u *url.URL, bucket string) bool { | ||
134 | // Bucket might be DNS compatible but dots in the hostname will fail | ||
135 | // certificate validation, so do not use host-style. | ||
136 | if u.Scheme == "https" && strings.Contains(bucket, ".") { | ||
137 | return false | ||
138 | } | ||
139 | |||
140 | // if the bucket is DNS compatible | ||
141 | return dnsCompatibleBucketName(bucket) | ||
142 | } | ||
143 | |||
144 | var reDomain = regexp.MustCompile(`^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$`) | ||
145 | var reIPAddress = regexp.MustCompile(`^(\d+\.){3}\d+$`) | ||
146 | |||
147 | // dnsCompatibleBucketName returns true if the bucket name is DNS compatible. | ||
148 | // Buckets created outside of the classic region MUST be DNS compatible. | ||
149 | func dnsCompatibleBucketName(bucket string) bool { | ||
150 | return reDomain.MatchString(bucket) && | ||
151 | !reIPAddress.MatchString(bucket) && | ||
152 | !strings.Contains(bucket, "..") | ||
153 | } | ||
154 | |||
155 | // moveBucketToHost moves the bucket name from the URI path to URL host. | ||
156 | func moveBucketToHost(u *url.URL, bucket string) { | ||
157 | u.Host = bucket + "." + u.Host | ||
158 | u.Path = strings.Replace(u.Path, "/{Bucket}", "", -1) | ||
159 | if u.Path == "" { | ||
160 | u.Path = "/" | ||
161 | } | ||
162 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers.go b/vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers.go new file mode 100644 index 0000000..8e6f330 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers.go | |||
@@ -0,0 +1,8 @@ | |||
1 | // +build !go1.6 | ||
2 | |||
3 | package s3 | ||
4 | |||
5 | import "github.com/aws/aws-sdk-go/aws/request" | ||
6 | |||
7 | func platformRequestHandlers(r *request.Request) { | ||
8 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers_go1.6.go b/vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers_go1.6.go new file mode 100644 index 0000000..14d05f7 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers_go1.6.go | |||
@@ -0,0 +1,28 @@ | |||
1 | // +build go1.6 | ||
2 | |||
3 | package s3 | ||
4 | |||
5 | import ( | ||
6 | "github.com/aws/aws-sdk-go/aws" | ||
7 | "github.com/aws/aws-sdk-go/aws/request" | ||
8 | ) | ||
9 | |||
10 | func platformRequestHandlers(r *request.Request) { | ||
11 | if r.Operation.HTTPMethod == "PUT" { | ||
12 | // 100-Continue should only be used on put requests. | ||
13 | r.Handlers.Sign.PushBack(add100Continue) | ||
14 | } | ||
15 | } | ||
16 | |||
17 | func add100Continue(r *request.Request) { | ||
18 | if aws.BoolValue(r.Config.S3Disable100Continue) { | ||
19 | return | ||
20 | } | ||
21 | if r.HTTPRequest.ContentLength < 1024*1024*2 { | ||
22 | // Ignore requests smaller than 2MB. This helps prevent delaying | ||
23 | // requests unnecessarily. | ||
24 | return | ||
25 | } | ||
26 | |||
27 | r.HTTPRequest.Header.Set("Expect", "100-Continue") | ||
28 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/service.go b/vendor/github.com/aws/aws-sdk-go/service/s3/service.go new file mode 100644 index 0000000..614e477 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/service.go | |||
@@ -0,0 +1,93 @@ | |||
1 | // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. | ||
2 | |||
3 | package s3 | ||
4 | |||
5 | import ( | ||
6 | "github.com/aws/aws-sdk-go/aws" | ||
7 | "github.com/aws/aws-sdk-go/aws/client" | ||
8 | "github.com/aws/aws-sdk-go/aws/client/metadata" | ||
9 | "github.com/aws/aws-sdk-go/aws/request" | ||
10 | "github.com/aws/aws-sdk-go/aws/signer/v4" | ||
11 | "github.com/aws/aws-sdk-go/private/protocol/restxml" | ||
12 | ) | ||
13 | |||
14 | // S3 provides the API operation methods for making requests to | ||
15 | // Amazon Simple Storage Service. See this package's package overview docs | ||
16 | // for details on the service. | ||
17 | // | ||
18 | // S3 methods are safe to use concurrently. It is not safe to | ||
19 | // modify mutate any of the struct's properties though. | ||
20 | type S3 struct { | ||
21 | *client.Client | ||
22 | } | ||
23 | |||
24 | // Used for custom client initialization logic | ||
25 | var initClient func(*client.Client) | ||
26 | |||
27 | // Used for custom request initialization logic | ||
28 | var initRequest func(*request.Request) | ||
29 | |||
30 | // Service information constants | ||
31 | const ( | ||
32 | ServiceName = "s3" // Service endpoint prefix API calls made to. | ||
33 | EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. | ||
34 | ) | ||
35 | |||
36 | // New creates a new instance of the S3 client with a session. | ||
37 | // If additional configuration is needed for the client instance use the optional | ||
38 | // aws.Config parameter to add your extra config. | ||
39 | // | ||
40 | // Example: | ||
41 | // // Create a S3 client from just a session. | ||
42 | // svc := s3.New(mySession) | ||
43 | // | ||
44 | // // Create a S3 client with additional configuration | ||
45 | // svc := s3.New(mySession, aws.NewConfig().WithRegion("us-west-2")) | ||
46 | func New(p client.ConfigProvider, cfgs ...*aws.Config) *S3 { | ||
47 | c := p.ClientConfig(EndpointsID, cfgs...) | ||
48 | return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) | ||
49 | } | ||
50 | |||
51 | // newClient creates, initializes and returns a new service client instance. | ||
52 | func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *S3 { | ||
53 | svc := &S3{ | ||
54 | Client: client.New( | ||
55 | cfg, | ||
56 | metadata.ClientInfo{ | ||
57 | ServiceName: ServiceName, | ||
58 | SigningName: signingName, | ||
59 | SigningRegion: signingRegion, | ||
60 | Endpoint: endpoint, | ||
61 | APIVersion: "2006-03-01", | ||
62 | }, | ||
63 | handlers, | ||
64 | ), | ||
65 | } | ||
66 | |||
67 | // Handlers | ||
68 | svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) | ||
69 | svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) | ||
70 | svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) | ||
71 | svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) | ||
72 | svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) | ||
73 | |||
74 | // Run custom client initialization if present | ||
75 | if initClient != nil { | ||
76 | initClient(svc.Client) | ||
77 | } | ||
78 | |||
79 | return svc | ||
80 | } | ||
81 | |||
82 | // newRequest creates a new request for a S3 operation and runs any | ||
83 | // custom request initialization. | ||
84 | func (c *S3) newRequest(op *request.Operation, params, data interface{}) *request.Request { | ||
85 | req := c.NewRequest(op, params, data) | ||
86 | |||
87 | // Run custom request initialization if present | ||
88 | if initRequest != nil { | ||
89 | initRequest(req) | ||
90 | } | ||
91 | |||
92 | return req | ||
93 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/sse.go b/vendor/github.com/aws/aws-sdk-go/service/s3/sse.go new file mode 100644 index 0000000..268ea2f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/sse.go | |||
@@ -0,0 +1,44 @@ | |||
1 | package s3 | ||
2 | |||
3 | import ( | ||
4 | "crypto/md5" | ||
5 | "encoding/base64" | ||
6 | |||
7 | "github.com/aws/aws-sdk-go/aws/awserr" | ||
8 | "github.com/aws/aws-sdk-go/aws/awsutil" | ||
9 | "github.com/aws/aws-sdk-go/aws/request" | ||
10 | ) | ||
11 | |||
12 | var errSSERequiresSSL = awserr.New("ConfigError", "cannot send SSE keys over HTTP.", nil) | ||
13 | |||
14 | func validateSSERequiresSSL(r *request.Request) { | ||
15 | if r.HTTPRequest.URL.Scheme != "https" { | ||
16 | p, _ := awsutil.ValuesAtPath(r.Params, "SSECustomerKey||CopySourceSSECustomerKey") | ||
17 | if len(p) > 0 { | ||
18 | r.Error = errSSERequiresSSL | ||
19 | } | ||
20 | } | ||
21 | } | ||
22 | |||
23 | func computeSSEKeys(r *request.Request) { | ||
24 | headers := []string{ | ||
25 | "x-amz-server-side-encryption-customer-key", | ||
26 | "x-amz-copy-source-server-side-encryption-customer-key", | ||
27 | } | ||
28 | |||
29 | for _, h := range headers { | ||
30 | md5h := h + "-md5" | ||
31 | if key := r.HTTPRequest.Header.Get(h); key != "" { | ||
32 | // Base64-encode the value | ||
33 | b64v := base64.StdEncoding.EncodeToString([]byte(key)) | ||
34 | r.HTTPRequest.Header.Set(h, b64v) | ||
35 | |||
36 | // Add MD5 if it wasn't computed | ||
37 | if r.HTTPRequest.Header.Get(md5h) == "" { | ||
38 | sum := md5.Sum([]byte(key)) | ||
39 | b64sum := base64.StdEncoding.EncodeToString(sum[:]) | ||
40 | r.HTTPRequest.Header.Set(md5h, b64sum) | ||
41 | } | ||
42 | } | ||
43 | } | ||
44 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/statusok_error.go b/vendor/github.com/aws/aws-sdk-go/service/s3/statusok_error.go new file mode 100644 index 0000000..5a78fd3 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/statusok_error.go | |||
@@ -0,0 +1,35 @@ | |||
1 | package s3 | ||
2 | |||
3 | import ( | ||
4 | "bytes" | ||
5 | "io/ioutil" | ||
6 | "net/http" | ||
7 | |||
8 | "github.com/aws/aws-sdk-go/aws/awserr" | ||
9 | "github.com/aws/aws-sdk-go/aws/request" | ||
10 | ) | ||
11 | |||
12 | func copyMultipartStatusOKUnmarhsalError(r *request.Request) { | ||
13 | b, err := ioutil.ReadAll(r.HTTPResponse.Body) | ||
14 | if err != nil { | ||
15 | r.Error = awserr.New("SerializationError", "unable to read response body", err) | ||
16 | return | ||
17 | } | ||
18 | body := bytes.NewReader(b) | ||
19 | r.HTTPResponse.Body = ioutil.NopCloser(body) | ||
20 | defer body.Seek(0, 0) | ||
21 | |||
22 | if body.Len() == 0 { | ||
23 | // If there is no body don't attempt to parse the body. | ||
24 | return | ||
25 | } | ||
26 | |||
27 | unmarshalError(r) | ||
28 | if err, ok := r.Error.(awserr.Error); ok && err != nil { | ||
29 | if err.Code() == "SerializationError" { | ||
30 | r.Error = nil | ||
31 | return | ||
32 | } | ||
33 | r.HTTPResponse.StatusCode = http.StatusServiceUnavailable | ||
34 | } | ||
35 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error.go b/vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error.go new file mode 100644 index 0000000..bcca862 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error.go | |||
@@ -0,0 +1,103 @@ | |||
1 | package s3 | ||
2 | |||
3 | import ( | ||
4 | "encoding/xml" | ||
5 | "fmt" | ||
6 | "io" | ||
7 | "io/ioutil" | ||
8 | "net/http" | ||
9 | "strings" | ||
10 | |||
11 | "github.com/aws/aws-sdk-go/aws" | ||
12 | "github.com/aws/aws-sdk-go/aws/awserr" | ||
13 | "github.com/aws/aws-sdk-go/aws/request" | ||
14 | ) | ||
15 | |||
16 | type xmlErrorResponse struct { | ||
17 | XMLName xml.Name `xml:"Error"` | ||
18 | Code string `xml:"Code"` | ||
19 | Message string `xml:"Message"` | ||
20 | } | ||
21 | |||
22 | func unmarshalError(r *request.Request) { | ||
23 | defer r.HTTPResponse.Body.Close() | ||
24 | defer io.Copy(ioutil.Discard, r.HTTPResponse.Body) | ||
25 | |||
26 | hostID := r.HTTPResponse.Header.Get("X-Amz-Id-2") | ||
27 | |||
28 | // Bucket exists in a different region, and request needs | ||
29 | // to be made to the correct region. | ||
30 | if r.HTTPResponse.StatusCode == http.StatusMovedPermanently { | ||
31 | r.Error = requestFailure{ | ||
32 | RequestFailure: awserr.NewRequestFailure( | ||
33 | awserr.New("BucketRegionError", | ||
34 | fmt.Sprintf("incorrect region, the bucket is not in '%s' region", | ||
35 | aws.StringValue(r.Config.Region)), | ||
36 | nil), | ||
37 | r.HTTPResponse.StatusCode, | ||
38 | r.RequestID, | ||
39 | ), | ||
40 | hostID: hostID, | ||
41 | } | ||
42 | return | ||
43 | } | ||
44 | |||
45 | var errCode, errMsg string | ||
46 | |||
47 | // Attempt to parse error from body if it is known | ||
48 | resp := &xmlErrorResponse{} | ||
49 | err := xml.NewDecoder(r.HTTPResponse.Body).Decode(resp) | ||
50 | if err != nil && err != io.EOF { | ||
51 | errCode = "SerializationError" | ||
52 | errMsg = "failed to decode S3 XML error response" | ||
53 | } else { | ||
54 | errCode = resp.Code | ||
55 | errMsg = resp.Message | ||
56 | err = nil | ||
57 | } | ||
58 | |||
59 | // Fallback to status code converted to message if still no error code | ||
60 | if len(errCode) == 0 { | ||
61 | statusText := http.StatusText(r.HTTPResponse.StatusCode) | ||
62 | errCode = strings.Replace(statusText, " ", "", -1) | ||
63 | errMsg = statusText | ||
64 | } | ||
65 | |||
66 | r.Error = requestFailure{ | ||
67 | RequestFailure: awserr.NewRequestFailure( | ||
68 | awserr.New(errCode, errMsg, err), | ||
69 | r.HTTPResponse.StatusCode, | ||
70 | r.RequestID, | ||
71 | ), | ||
72 | hostID: hostID, | ||
73 | } | ||
74 | } | ||
75 | |||
76 | // A RequestFailure provides access to the S3 Request ID and Host ID values | ||
77 | // returned from API operation errors. Getting the error as a string will | ||
78 | // return the formated error with the same information as awserr.RequestFailure, | ||
79 | // while also adding the HostID value from the response. | ||
80 | type RequestFailure interface { | ||
81 | awserr.RequestFailure | ||
82 | |||
83 | // Host ID is the S3 Host ID needed for debug, and contacting support | ||
84 | HostID() string | ||
85 | } | ||
86 | |||
87 | type requestFailure struct { | ||
88 | awserr.RequestFailure | ||
89 | |||
90 | hostID string | ||
91 | } | ||
92 | |||
93 | func (r requestFailure) Error() string { | ||
94 | extra := fmt.Sprintf("status code: %d, request id: %s, host id: %s", | ||
95 | r.StatusCode(), r.RequestID(), r.hostID) | ||
96 | return awserr.SprintError(r.Code(), r.Message(), extra, r.OrigErr()) | ||
97 | } | ||
98 | func (r requestFailure) String() string { | ||
99 | return r.Error() | ||
100 | } | ||
101 | func (r requestFailure) HostID() string { | ||
102 | return r.hostID | ||
103 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/s3/waiters.go new file mode 100644 index 0000000..cccfa8c --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/waiters.go | |||
@@ -0,0 +1,214 @@ | |||
1 | // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. | ||
2 | |||
3 | package s3 | ||
4 | |||
5 | import ( | ||
6 | "time" | ||
7 | |||
8 | "github.com/aws/aws-sdk-go/aws" | ||
9 | "github.com/aws/aws-sdk-go/aws/request" | ||
10 | ) | ||
11 | |||
12 | // WaitUntilBucketExists uses the Amazon S3 API operation | ||
13 | // HeadBucket to wait for a condition to be met before returning. | ||
14 | // If the condition is not meet within the max attempt window an error will | ||
15 | // be returned. | ||
16 | func (c *S3) WaitUntilBucketExists(input *HeadBucketInput) error { | ||
17 | return c.WaitUntilBucketExistsWithContext(aws.BackgroundContext(), input) | ||
18 | } | ||
19 | |||
20 | // WaitUntilBucketExistsWithContext is an extended version of WaitUntilBucketExists. | ||
21 | // With the support for passing in a context and options to configure the | ||
22 | // Waiter and the underlying request options. | ||
23 | // | ||
24 | // The context must be non-nil and will be used for request cancellation. If | ||
25 | // the context is nil a panic will occur. In the future the SDK may create | ||
26 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
27 | // for more information on using Contexts. | ||
28 | func (c *S3) WaitUntilBucketExistsWithContext(ctx aws.Context, input *HeadBucketInput, opts ...request.WaiterOption) error { | ||
29 | w := request.Waiter{ | ||
30 | Name: "WaitUntilBucketExists", | ||
31 | MaxAttempts: 20, | ||
32 | Delay: request.ConstantWaiterDelay(5 * time.Second), | ||
33 | Acceptors: []request.WaiterAcceptor{ | ||
34 | { | ||
35 | State: request.SuccessWaiterState, | ||
36 | Matcher: request.StatusWaiterMatch, | ||
37 | Expected: 200, | ||
38 | }, | ||
39 | { | ||
40 | State: request.SuccessWaiterState, | ||
41 | Matcher: request.StatusWaiterMatch, | ||
42 | Expected: 301, | ||
43 | }, | ||
44 | { | ||
45 | State: request.SuccessWaiterState, | ||
46 | Matcher: request.StatusWaiterMatch, | ||
47 | Expected: 403, | ||
48 | }, | ||
49 | { | ||
50 | State: request.RetryWaiterState, | ||
51 | Matcher: request.StatusWaiterMatch, | ||
52 | Expected: 404, | ||
53 | }, | ||
54 | }, | ||
55 | Logger: c.Config.Logger, | ||
56 | NewRequest: func(opts []request.Option) (*request.Request, error) { | ||
57 | var inCpy *HeadBucketInput | ||
58 | if input != nil { | ||
59 | tmp := *input | ||
60 | inCpy = &tmp | ||
61 | } | ||
62 | req, _ := c.HeadBucketRequest(inCpy) | ||
63 | req.SetContext(ctx) | ||
64 | req.ApplyOptions(opts...) | ||
65 | return req, nil | ||
66 | }, | ||
67 | } | ||
68 | w.ApplyOptions(opts...) | ||
69 | |||
70 | return w.WaitWithContext(ctx) | ||
71 | } | ||
72 | |||
73 | // WaitUntilBucketNotExists uses the Amazon S3 API operation | ||
74 | // HeadBucket to wait for a condition to be met before returning. | ||
75 | // If the condition is not meet within the max attempt window an error will | ||
76 | // be returned. | ||
77 | func (c *S3) WaitUntilBucketNotExists(input *HeadBucketInput) error { | ||
78 | return c.WaitUntilBucketNotExistsWithContext(aws.BackgroundContext(), input) | ||
79 | } | ||
80 | |||
81 | // WaitUntilBucketNotExistsWithContext is an extended version of WaitUntilBucketNotExists. | ||
82 | // With the support for passing in a context and options to configure the | ||
83 | // Waiter and the underlying request options. | ||
84 | // | ||
85 | // The context must be non-nil and will be used for request cancellation. If | ||
86 | // the context is nil a panic will occur. In the future the SDK may create | ||
87 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
88 | // for more information on using Contexts. | ||
89 | func (c *S3) WaitUntilBucketNotExistsWithContext(ctx aws.Context, input *HeadBucketInput, opts ...request.WaiterOption) error { | ||
90 | w := request.Waiter{ | ||
91 | Name: "WaitUntilBucketNotExists", | ||
92 | MaxAttempts: 20, | ||
93 | Delay: request.ConstantWaiterDelay(5 * time.Second), | ||
94 | Acceptors: []request.WaiterAcceptor{ | ||
95 | { | ||
96 | State: request.SuccessWaiterState, | ||
97 | Matcher: request.StatusWaiterMatch, | ||
98 | Expected: 404, | ||
99 | }, | ||
100 | }, | ||
101 | Logger: c.Config.Logger, | ||
102 | NewRequest: func(opts []request.Option) (*request.Request, error) { | ||
103 | var inCpy *HeadBucketInput | ||
104 | if input != nil { | ||
105 | tmp := *input | ||
106 | inCpy = &tmp | ||
107 | } | ||
108 | req, _ := c.HeadBucketRequest(inCpy) | ||
109 | req.SetContext(ctx) | ||
110 | req.ApplyOptions(opts...) | ||
111 | return req, nil | ||
112 | }, | ||
113 | } | ||
114 | w.ApplyOptions(opts...) | ||
115 | |||
116 | return w.WaitWithContext(ctx) | ||
117 | } | ||
118 | |||
119 | // WaitUntilObjectExists uses the Amazon S3 API operation | ||
120 | // HeadObject to wait for a condition to be met before returning. | ||
121 | // If the condition is not meet within the max attempt window an error will | ||
122 | // be returned. | ||
123 | func (c *S3) WaitUntilObjectExists(input *HeadObjectInput) error { | ||
124 | return c.WaitUntilObjectExistsWithContext(aws.BackgroundContext(), input) | ||
125 | } | ||
126 | |||
127 | // WaitUntilObjectExistsWithContext is an extended version of WaitUntilObjectExists. | ||
128 | // With the support for passing in a context and options to configure the | ||
129 | // Waiter and the underlying request options. | ||
130 | // | ||
131 | // The context must be non-nil and will be used for request cancellation. If | ||
132 | // the context is nil a panic will occur. In the future the SDK may create | ||
133 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
134 | // for more information on using Contexts. | ||
135 | func (c *S3) WaitUntilObjectExistsWithContext(ctx aws.Context, input *HeadObjectInput, opts ...request.WaiterOption) error { | ||
136 | w := request.Waiter{ | ||
137 | Name: "WaitUntilObjectExists", | ||
138 | MaxAttempts: 20, | ||
139 | Delay: request.ConstantWaiterDelay(5 * time.Second), | ||
140 | Acceptors: []request.WaiterAcceptor{ | ||
141 | { | ||
142 | State: request.SuccessWaiterState, | ||
143 | Matcher: request.StatusWaiterMatch, | ||
144 | Expected: 200, | ||
145 | }, | ||
146 | { | ||
147 | State: request.RetryWaiterState, | ||
148 | Matcher: request.StatusWaiterMatch, | ||
149 | Expected: 404, | ||
150 | }, | ||
151 | }, | ||
152 | Logger: c.Config.Logger, | ||
153 | NewRequest: func(opts []request.Option) (*request.Request, error) { | ||
154 | var inCpy *HeadObjectInput | ||
155 | if input != nil { | ||
156 | tmp := *input | ||
157 | inCpy = &tmp | ||
158 | } | ||
159 | req, _ := c.HeadObjectRequest(inCpy) | ||
160 | req.SetContext(ctx) | ||
161 | req.ApplyOptions(opts...) | ||
162 | return req, nil | ||
163 | }, | ||
164 | } | ||
165 | w.ApplyOptions(opts...) | ||
166 | |||
167 | return w.WaitWithContext(ctx) | ||
168 | } | ||
169 | |||
170 | // WaitUntilObjectNotExists uses the Amazon S3 API operation | ||
171 | // HeadObject to wait for a condition to be met before returning. | ||
172 | // If the condition is not meet within the max attempt window an error will | ||
173 | // be returned. | ||
174 | func (c *S3) WaitUntilObjectNotExists(input *HeadObjectInput) error { | ||
175 | return c.WaitUntilObjectNotExistsWithContext(aws.BackgroundContext(), input) | ||
176 | } | ||
177 | |||
178 | // WaitUntilObjectNotExistsWithContext is an extended version of WaitUntilObjectNotExists. | ||
179 | // With the support for passing in a context and options to configure the | ||
180 | // Waiter and the underlying request options. | ||
181 | // | ||
182 | // The context must be non-nil and will be used for request cancellation. If | ||
183 | // the context is nil a panic will occur. In the future the SDK may create | ||
184 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
185 | // for more information on using Contexts. | ||
186 | func (c *S3) WaitUntilObjectNotExistsWithContext(ctx aws.Context, input *HeadObjectInput, opts ...request.WaiterOption) error { | ||
187 | w := request.Waiter{ | ||
188 | Name: "WaitUntilObjectNotExists", | ||
189 | MaxAttempts: 20, | ||
190 | Delay: request.ConstantWaiterDelay(5 * time.Second), | ||
191 | Acceptors: []request.WaiterAcceptor{ | ||
192 | { | ||
193 | State: request.SuccessWaiterState, | ||
194 | Matcher: request.StatusWaiterMatch, | ||
195 | Expected: 404, | ||
196 | }, | ||
197 | }, | ||
198 | Logger: c.Config.Logger, | ||
199 | NewRequest: func(opts []request.Option) (*request.Request, error) { | ||
200 | var inCpy *HeadObjectInput | ||
201 | if input != nil { | ||
202 | tmp := *input | ||
203 | inCpy = &tmp | ||
204 | } | ||
205 | req, _ := c.HeadObjectRequest(inCpy) | ||
206 | req.SetContext(ctx) | ||
207 | req.ApplyOptions(opts...) | ||
208 | return req, nil | ||
209 | }, | ||
210 | } | ||
211 | w.ApplyOptions(opts...) | ||
212 | |||
213 | return w.WaitWithContext(ctx) | ||
214 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/api.go b/vendor/github.com/aws/aws-sdk-go/service/sts/api.go new file mode 100644 index 0000000..2de6528 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/sts/api.go | |||
@@ -0,0 +1,2365 @@ | |||
1 | // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. | ||
2 | |||
3 | package sts | ||
4 | |||
5 | import ( | ||
6 | "time" | ||
7 | |||
8 | "github.com/aws/aws-sdk-go/aws" | ||
9 | "github.com/aws/aws-sdk-go/aws/awsutil" | ||
10 | "github.com/aws/aws-sdk-go/aws/request" | ||
11 | ) | ||
12 | |||
13 | const opAssumeRole = "AssumeRole" | ||
14 | |||
15 | // AssumeRoleRequest generates a "aws/request.Request" representing the | ||
16 | // client's request for the AssumeRole operation. The "output" return | ||
17 | // value can be used to capture response data after the request's "Send" method | ||
18 | // is called. | ||
19 | // | ||
20 | // See AssumeRole for usage and error information. | ||
21 | // | ||
22 | // Creating a request object using this method should be used when you want to inject | ||
23 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
24 | // access properties on the request object before or after sending the request. If | ||
25 | // you just want the service response, call the AssumeRole method directly | ||
26 | // instead. | ||
27 | // | ||
28 | // Note: You must call the "Send" method on the returned request object in order | ||
29 | // to execute the request. | ||
30 | // | ||
31 | // // Example sending a request using the AssumeRoleRequest method. | ||
32 | // req, resp := client.AssumeRoleRequest(params) | ||
33 | // | ||
34 | // err := req.Send() | ||
35 | // if err == nil { // resp is now filled | ||
36 | // fmt.Println(resp) | ||
37 | // } | ||
38 | // | ||
39 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRole | ||
40 | func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, output *AssumeRoleOutput) { | ||
41 | op := &request.Operation{ | ||
42 | Name: opAssumeRole, | ||
43 | HTTPMethod: "POST", | ||
44 | HTTPPath: "/", | ||
45 | } | ||
46 | |||
47 | if input == nil { | ||
48 | input = &AssumeRoleInput{} | ||
49 | } | ||
50 | |||
51 | output = &AssumeRoleOutput{} | ||
52 | req = c.newRequest(op, input, output) | ||
53 | return | ||
54 | } | ||
55 | |||
56 | // AssumeRole API operation for AWS Security Token Service. | ||
57 | // | ||
58 | // Returns a set of temporary security credentials (consisting of an access | ||
59 | // key ID, a secret access key, and a security token) that you can use to access | ||
60 | // AWS resources that you might not normally have access to. Typically, you | ||
61 | // use AssumeRole for cross-account access or federation. For a comparison of | ||
62 | // AssumeRole with the other APIs that produce temporary credentials, see Requesting | ||
63 | // Temporary Security Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) | ||
64 | // and Comparing the AWS STS APIs (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) | ||
65 | // in the IAM User Guide. | ||
66 | // | ||
67 | // Important: You cannot call AssumeRole by using AWS root account credentials; | ||
68 | // access is denied. You must use credentials for an IAM user or an IAM role | ||
69 | // to call AssumeRole. | ||
70 | // | ||
71 | // For cross-account access, imagine that you own multiple accounts and need | ||
72 | // to access resources in each account. You could create long-term credentials | ||
73 | // in each account to access those resources. However, managing all those credentials | ||
74 | // and remembering which one can access which account can be time consuming. | ||
75 | // Instead, you can create one set of long-term credentials in one account and | ||
76 | // then use temporary security credentials to access all the other accounts | ||
77 | // by assuming roles in those accounts. For more information about roles, see | ||
78 | // IAM Roles (Delegation and Federation) (http://docs.aws.amazon.com/IAM/latest/UserGuide/roles-toplevel.html) | ||
79 | // in the IAM User Guide. | ||
80 | // | ||
81 | // For federation, you can, for example, grant single sign-on access to the | ||
82 | // AWS Management Console. If you already have an identity and authentication | ||
83 | // system in your corporate network, you don't have to recreate user identities | ||
84 | // in AWS in order to grant those user identities access to AWS. Instead, after | ||
85 | // a user has been authenticated, you call AssumeRole (and specify the role | ||
86 | // with the appropriate permissions) to get temporary security credentials for | ||
87 | // that user. With those temporary security credentials, you construct a sign-in | ||
88 | // URL that users can use to access the console. For more information, see Common | ||
89 | // Scenarios for Temporary Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html#sts-introduction) | ||
90 | // in the IAM User Guide. | ||
91 | // | ||
92 | // The temporary security credentials are valid for the duration that you specified | ||
93 | // when calling AssumeRole, which can be from 900 seconds (15 minutes) to a | ||
94 | // maximum of 3600 seconds (1 hour). The default is 1 hour. | ||
95 | // | ||
96 | // The temporary security credentials created by AssumeRole can be used to make | ||
97 | // API calls to any AWS service with the following exception: you cannot call | ||
98 | // the STS service's GetFederationToken or GetSessionToken APIs. | ||
99 | // | ||
100 | // Optionally, you can pass an IAM access policy to this operation. If you choose | ||
101 | // not to pass a policy, the temporary security credentials that are returned | ||
102 | // by the operation have the permissions that are defined in the access policy | ||
103 | // of the role that is being assumed. If you pass a policy to this operation, | ||
104 | // the temporary security credentials that are returned by the operation have | ||
105 | // the permissions that are allowed by both the access policy of the role that | ||
106 | // is being assumed, and the policy that you pass. This gives you a way to further | ||
107 | // restrict the permissions for the resulting temporary security credentials. | ||
108 | // You cannot use the passed policy to grant permissions that are in excess | ||
109 | // of those allowed by the access policy of the role that is being assumed. | ||
110 | // For more information, see Permissions for AssumeRole, AssumeRoleWithSAML, | ||
111 | // and AssumeRoleWithWebIdentity (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html) | ||
112 | // in the IAM User Guide. | ||
113 | // | ||
114 | // To assume a role, your AWS account must be trusted by the role. The trust | ||
115 | // relationship is defined in the role's trust policy when the role is created. | ||
116 | // That trust policy states which accounts are allowed to delegate access to | ||
117 | // this account's role. | ||
118 | // | ||
119 | // The user who wants to access the role must also have permissions delegated | ||
120 | // from the role's administrator. If the user is in a different account than | ||
121 | // the role, then the user's administrator must attach a policy that allows | ||
122 | // the user to call AssumeRole on the ARN of the role in the other account. | ||
123 | // If the user is in the same account as the role, then you can either attach | ||
124 | // a policy to the user (identical to the previous different account user), | ||
125 | // or you can add the user as a principal directly in the role's trust policy | ||
126 | // | ||
127 | // Using MFA with AssumeRole | ||
128 | // | ||
129 | // You can optionally include multi-factor authentication (MFA) information | ||
130 | // when you call AssumeRole. This is useful for cross-account scenarios in which | ||
131 | // you want to make sure that the user who is assuming the role has been authenticated | ||
132 | // using an AWS MFA device. In that scenario, the trust policy of the role being | ||
133 | // assumed includes a condition that tests for MFA authentication; if the caller | ||
134 | // does not include valid MFA information, the request to assume the role is | ||
135 | // denied. The condition in a trust policy that tests for MFA authentication | ||
136 | // might look like the following example. | ||
137 | // | ||
138 | // "Condition": {"Bool": {"aws:MultiFactorAuthPresent": true}} | ||
139 | // | ||
140 | // For more information, see Configuring MFA-Protected API Access (http://docs.aws.amazon.com/IAM/latest/UserGuide/MFAProtectedAPI.html) | ||
141 | // in the IAM User Guide guide. | ||
142 | // | ||
143 | // To use MFA with AssumeRole, you pass values for the SerialNumber and TokenCode | ||
144 | // parameters. The SerialNumber value identifies the user's hardware or virtual | ||
145 | // MFA device. The TokenCode is the time-based one-time password (TOTP) that | ||
146 | // the MFA devices produces. | ||
147 | // | ||
148 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
149 | // with awserr.Error's Code and Message methods to get detailed information about | ||
150 | // the error. | ||
151 | // | ||
152 | // See the AWS API reference guide for AWS Security Token Service's | ||
153 | // API operation AssumeRole for usage and error information. | ||
154 | // | ||
155 | // Returned Error Codes: | ||
156 | // * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument" | ||
157 | // The request was rejected because the policy document was malformed. The error | ||
158 | // message describes the specific error. | ||
159 | // | ||
160 | // * ErrCodePackedPolicyTooLargeException "PackedPolicyTooLarge" | ||
161 | // The request was rejected because the policy document was too large. The error | ||
162 | // message describes how big the policy document is, in packed form, as a percentage | ||
163 | // of what the API allows. | ||
164 | // | ||
165 | // * ErrCodeRegionDisabledException "RegionDisabledException" | ||
166 | // STS is not activated in the requested region for the account that is being | ||
167 | // asked to generate credentials. The account administrator must use the IAM | ||
168 | // console to activate STS in that region. For more information, see Activating | ||
169 | // and Deactivating AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) | ||
170 | // in the IAM User Guide. | ||
171 | // | ||
172 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRole | ||
173 | func (c *STS) AssumeRole(input *AssumeRoleInput) (*AssumeRoleOutput, error) { | ||
174 | req, out := c.AssumeRoleRequest(input) | ||
175 | return out, req.Send() | ||
176 | } | ||
177 | |||
178 | // AssumeRoleWithContext is the same as AssumeRole with the addition of | ||
179 | // the ability to pass a context and additional request options. | ||
180 | // | ||
181 | // See AssumeRole for details on how to use this API operation. | ||
182 | // | ||
183 | // The context must be non-nil and will be used for request cancellation. If | ||
184 | // the context is nil a panic will occur. In the future the SDK may create | ||
185 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
186 | // for more information on using Contexts. | ||
187 | func (c *STS) AssumeRoleWithContext(ctx aws.Context, input *AssumeRoleInput, opts ...request.Option) (*AssumeRoleOutput, error) { | ||
188 | req, out := c.AssumeRoleRequest(input) | ||
189 | req.SetContext(ctx) | ||
190 | req.ApplyOptions(opts...) | ||
191 | return out, req.Send() | ||
192 | } | ||
193 | |||
194 | const opAssumeRoleWithSAML = "AssumeRoleWithSAML" | ||
195 | |||
196 | // AssumeRoleWithSAMLRequest generates a "aws/request.Request" representing the | ||
197 | // client's request for the AssumeRoleWithSAML operation. The "output" return | ||
198 | // value can be used to capture response data after the request's "Send" method | ||
199 | // is called. | ||
200 | // | ||
201 | // See AssumeRoleWithSAML for usage and error information. | ||
202 | // | ||
203 | // Creating a request object using this method should be used when you want to inject | ||
204 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
205 | // access properties on the request object before or after sending the request. If | ||
206 | // you just want the service response, call the AssumeRoleWithSAML method directly | ||
207 | // instead. | ||
208 | // | ||
209 | // Note: You must call the "Send" method on the returned request object in order | ||
210 | // to execute the request. | ||
211 | // | ||
212 | // // Example sending a request using the AssumeRoleWithSAMLRequest method. | ||
213 | // req, resp := client.AssumeRoleWithSAMLRequest(params) | ||
214 | // | ||
215 | // err := req.Send() | ||
216 | // if err == nil { // resp is now filled | ||
217 | // fmt.Println(resp) | ||
218 | // } | ||
219 | // | ||
220 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithSAML | ||
221 | func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *request.Request, output *AssumeRoleWithSAMLOutput) { | ||
222 | op := &request.Operation{ | ||
223 | Name: opAssumeRoleWithSAML, | ||
224 | HTTPMethod: "POST", | ||
225 | HTTPPath: "/", | ||
226 | } | ||
227 | |||
228 | if input == nil { | ||
229 | input = &AssumeRoleWithSAMLInput{} | ||
230 | } | ||
231 | |||
232 | output = &AssumeRoleWithSAMLOutput{} | ||
233 | req = c.newRequest(op, input, output) | ||
234 | return | ||
235 | } | ||
236 | |||
237 | // AssumeRoleWithSAML API operation for AWS Security Token Service. | ||
238 | // | ||
239 | // Returns a set of temporary security credentials for users who have been authenticated | ||
240 | // via a SAML authentication response. This operation provides a mechanism for | ||
241 | // tying an enterprise identity store or directory to role-based AWS access | ||
242 | // without user-specific credentials or configuration. For a comparison of AssumeRoleWithSAML | ||
243 | // with the other APIs that produce temporary credentials, see Requesting Temporary | ||
244 | // Security Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) | ||
245 | // and Comparing the AWS STS APIs (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) | ||
246 | // in the IAM User Guide. | ||
247 | // | ||
248 | // The temporary security credentials returned by this operation consist of | ||
249 | // an access key ID, a secret access key, and a security token. Applications | ||
250 | // can use these temporary security credentials to sign calls to AWS services. | ||
251 | // | ||
252 | // The temporary security credentials are valid for the duration that you specified | ||
253 | // when calling AssumeRole, or until the time specified in the SAML authentication | ||
254 | // response's SessionNotOnOrAfter value, whichever is shorter. The duration | ||
255 | // can be from 900 seconds (15 minutes) to a maximum of 3600 seconds (1 hour). | ||
256 | // The default is 1 hour. | ||
257 | // | ||
258 | // The temporary security credentials created by AssumeRoleWithSAML can be used | ||
259 | // to make API calls to any AWS service with the following exception: you cannot | ||
260 | // call the STS service's GetFederationToken or GetSessionToken APIs. | ||
261 | // | ||
262 | // Optionally, you can pass an IAM access policy to this operation. If you choose | ||
263 | // not to pass a policy, the temporary security credentials that are returned | ||
264 | // by the operation have the permissions that are defined in the access policy | ||
265 | // of the role that is being assumed. If you pass a policy to this operation, | ||
266 | // the temporary security credentials that are returned by the operation have | ||
267 | // the permissions that are allowed by the intersection of both the access policy | ||
268 | // of the role that is being assumed, and the policy that you pass. This means | ||
269 | // that both policies must grant the permission for the action to be allowed. | ||
270 | // This gives you a way to further restrict the permissions for the resulting | ||
271 | // temporary security credentials. You cannot use the passed policy to grant | ||
272 | // permissions that are in excess of those allowed by the access policy of the | ||
273 | // role that is being assumed. For more information, see Permissions for AssumeRole, | ||
274 | // AssumeRoleWithSAML, and AssumeRoleWithWebIdentity (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html) | ||
275 | // in the IAM User Guide. | ||
276 | // | ||
277 | // Before your application can call AssumeRoleWithSAML, you must configure your | ||
278 | // SAML identity provider (IdP) to issue the claims required by AWS. Additionally, | ||
279 | // you must use AWS Identity and Access Management (IAM) to create a SAML provider | ||
280 | // entity in your AWS account that represents your identity provider, and create | ||
281 | // an IAM role that specifies this SAML provider in its trust policy. | ||
282 | // | ||
283 | // Calling AssumeRoleWithSAML does not require the use of AWS security credentials. | ||
284 | // The identity of the caller is validated by using keys in the metadata document | ||
285 | // that is uploaded for the SAML provider entity for your identity provider. | ||
286 | // | ||
287 | // Calling AssumeRoleWithSAML can result in an entry in your AWS CloudTrail | ||
288 | // logs. The entry includes the value in the NameID element of the SAML assertion. | ||
289 | // We recommend that you use a NameIDType that is not associated with any personally | ||
290 | // identifiable information (PII). For example, you could instead use the Persistent | ||
291 | // Identifier (urn:oasis:names:tc:SAML:2.0:nameid-format:persistent). | ||
292 | // | ||
293 | // For more information, see the following resources: | ||
294 | // | ||
295 | // * About SAML 2.0-based Federation (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html) | ||
296 | // in the IAM User Guide. | ||
297 | // | ||
298 | // * Creating SAML Identity Providers (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml.html) | ||
299 | // in the IAM User Guide. | ||
300 | // | ||
301 | // * Configuring a Relying Party and Claims (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml_relying-party.html) | ||
302 | // in the IAM User Guide. | ||
303 | // | ||
304 | // * Creating a Role for SAML 2.0 Federation (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-idp_saml.html) | ||
305 | // in the IAM User Guide. | ||
306 | // | ||
307 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
308 | // with awserr.Error's Code and Message methods to get detailed information about | ||
309 | // the error. | ||
310 | // | ||
311 | // See the AWS API reference guide for AWS Security Token Service's | ||
312 | // API operation AssumeRoleWithSAML for usage and error information. | ||
313 | // | ||
314 | // Returned Error Codes: | ||
315 | // * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument" | ||
316 | // The request was rejected because the policy document was malformed. The error | ||
317 | // message describes the specific error. | ||
318 | // | ||
319 | // * ErrCodePackedPolicyTooLargeException "PackedPolicyTooLarge" | ||
320 | // The request was rejected because the policy document was too large. The error | ||
321 | // message describes how big the policy document is, in packed form, as a percentage | ||
322 | // of what the API allows. | ||
323 | // | ||
324 | // * ErrCodeIDPRejectedClaimException "IDPRejectedClaim" | ||
325 | // The identity provider (IdP) reported that authentication failed. This might | ||
326 | // be because the claim is invalid. | ||
327 | // | ||
328 | // If this error is returned for the AssumeRoleWithWebIdentity operation, it | ||
329 | // can also mean that the claim has expired or has been explicitly revoked. | ||
330 | // | ||
331 | // * ErrCodeInvalidIdentityTokenException "InvalidIdentityToken" | ||
332 | // The web identity token that was passed could not be validated by AWS. Get | ||
333 | // a new identity token from the identity provider and then retry the request. | ||
334 | // | ||
335 | // * ErrCodeExpiredTokenException "ExpiredTokenException" | ||
336 | // The web identity token that was passed is expired or is not valid. Get a | ||
337 | // new identity token from the identity provider and then retry the request. | ||
338 | // | ||
339 | // * ErrCodeRegionDisabledException "RegionDisabledException" | ||
340 | // STS is not activated in the requested region for the account that is being | ||
341 | // asked to generate credentials. The account administrator must use the IAM | ||
342 | // console to activate STS in that region. For more information, see Activating | ||
343 | // and Deactivating AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) | ||
344 | // in the IAM User Guide. | ||
345 | // | ||
346 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithSAML | ||
347 | func (c *STS) AssumeRoleWithSAML(input *AssumeRoleWithSAMLInput) (*AssumeRoleWithSAMLOutput, error) { | ||
348 | req, out := c.AssumeRoleWithSAMLRequest(input) | ||
349 | return out, req.Send() | ||
350 | } | ||
351 | |||
352 | // AssumeRoleWithSAMLWithContext is the same as AssumeRoleWithSAML with the addition of | ||
353 | // the ability to pass a context and additional request options. | ||
354 | // | ||
355 | // See AssumeRoleWithSAML for details on how to use this API operation. | ||
356 | // | ||
357 | // The context must be non-nil and will be used for request cancellation. If | ||
358 | // the context is nil a panic will occur. In the future the SDK may create | ||
359 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
360 | // for more information on using Contexts. | ||
361 | func (c *STS) AssumeRoleWithSAMLWithContext(ctx aws.Context, input *AssumeRoleWithSAMLInput, opts ...request.Option) (*AssumeRoleWithSAMLOutput, error) { | ||
362 | req, out := c.AssumeRoleWithSAMLRequest(input) | ||
363 | req.SetContext(ctx) | ||
364 | req.ApplyOptions(opts...) | ||
365 | return out, req.Send() | ||
366 | } | ||
367 | |||
368 | const opAssumeRoleWithWebIdentity = "AssumeRoleWithWebIdentity" | ||
369 | |||
370 | // AssumeRoleWithWebIdentityRequest generates a "aws/request.Request" representing the | ||
371 | // client's request for the AssumeRoleWithWebIdentity operation. The "output" return | ||
372 | // value can be used to capture response data after the request's "Send" method | ||
373 | // is called. | ||
374 | // | ||
375 | // See AssumeRoleWithWebIdentity for usage and error information. | ||
376 | // | ||
377 | // Creating a request object using this method should be used when you want to inject | ||
378 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
379 | // access properties on the request object before or after sending the request. If | ||
380 | // you just want the service response, call the AssumeRoleWithWebIdentity method directly | ||
381 | // instead. | ||
382 | // | ||
383 | // Note: You must call the "Send" method on the returned request object in order | ||
384 | // to execute the request. | ||
385 | // | ||
386 | // // Example sending a request using the AssumeRoleWithWebIdentityRequest method. | ||
387 | // req, resp := client.AssumeRoleWithWebIdentityRequest(params) | ||
388 | // | ||
389 | // err := req.Send() | ||
390 | // if err == nil { // resp is now filled | ||
391 | // fmt.Println(resp) | ||
392 | // } | ||
393 | // | ||
394 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithWebIdentity | ||
395 | func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityInput) (req *request.Request, output *AssumeRoleWithWebIdentityOutput) { | ||
396 | op := &request.Operation{ | ||
397 | Name: opAssumeRoleWithWebIdentity, | ||
398 | HTTPMethod: "POST", | ||
399 | HTTPPath: "/", | ||
400 | } | ||
401 | |||
402 | if input == nil { | ||
403 | input = &AssumeRoleWithWebIdentityInput{} | ||
404 | } | ||
405 | |||
406 | output = &AssumeRoleWithWebIdentityOutput{} | ||
407 | req = c.newRequest(op, input, output) | ||
408 | return | ||
409 | } | ||
410 | |||
411 | // AssumeRoleWithWebIdentity API operation for AWS Security Token Service. | ||
412 | // | ||
413 | // Returns a set of temporary security credentials for users who have been authenticated | ||
414 | // in a mobile or web application with a web identity provider, such as Amazon | ||
415 | // Cognito, Login with Amazon, Facebook, Google, or any OpenID Connect-compatible | ||
416 | // identity provider. | ||
417 | // | ||
418 | // For mobile applications, we recommend that you use Amazon Cognito. You can | ||
419 | // use Amazon Cognito with the AWS SDK for iOS (http://aws.amazon.com/sdkforios/) | ||
420 | // and the AWS SDK for Android (http://aws.amazon.com/sdkforandroid/) to uniquely | ||
421 | // identify a user and supply the user with a consistent identity throughout | ||
422 | // the lifetime of an application. | ||
423 | // | ||
424 | // To learn more about Amazon Cognito, see Amazon Cognito Overview (http://docs.aws.amazon.com/mobile/sdkforandroid/developerguide/cognito-auth.html#d0e840) | ||
425 | // in the AWS SDK for Android Developer Guide guide and Amazon Cognito Overview | ||
426 | // (http://docs.aws.amazon.com/mobile/sdkforios/developerguide/cognito-auth.html#d0e664) | ||
427 | // in the AWS SDK for iOS Developer Guide. | ||
428 | // | ||
429 | // Calling AssumeRoleWithWebIdentity does not require the use of AWS security | ||
430 | // credentials. Therefore, you can distribute an application (for example, on | ||
431 | // mobile devices) that requests temporary security credentials without including | ||
432 | // long-term AWS credentials in the application, and without deploying server-based | ||
433 | // proxy services that use long-term AWS credentials. Instead, the identity | ||
434 | // of the caller is validated by using a token from the web identity provider. | ||
435 | // For a comparison of AssumeRoleWithWebIdentity with the other APIs that produce | ||
436 | // temporary credentials, see Requesting Temporary Security Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) | ||
437 | // and Comparing the AWS STS APIs (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) | ||
438 | // in the IAM User Guide. | ||
439 | // | ||
440 | // The temporary security credentials returned by this API consist of an access | ||
441 | // key ID, a secret access key, and a security token. Applications can use these | ||
442 | // temporary security credentials to sign calls to AWS service APIs. | ||
443 | // | ||
444 | // The credentials are valid for the duration that you specified when calling | ||
445 | // AssumeRoleWithWebIdentity, which can be from 900 seconds (15 minutes) to | ||
446 | // a maximum of 3600 seconds (1 hour). The default is 1 hour. | ||
447 | // | ||
448 | // The temporary security credentials created by AssumeRoleWithWebIdentity can | ||
449 | // be used to make API calls to any AWS service with the following exception: | ||
450 | // you cannot call the STS service's GetFederationToken or GetSessionToken APIs. | ||
451 | // | ||
452 | // Optionally, you can pass an IAM access policy to this operation. If you choose | ||
453 | // not to pass a policy, the temporary security credentials that are returned | ||
454 | // by the operation have the permissions that are defined in the access policy | ||
455 | // of the role that is being assumed. If you pass a policy to this operation, | ||
456 | // the temporary security credentials that are returned by the operation have | ||
457 | // the permissions that are allowed by both the access policy of the role that | ||
458 | // is being assumed, and the policy that you pass. This gives you a way to further | ||
459 | // restrict the permissions for the resulting temporary security credentials. | ||
460 | // You cannot use the passed policy to grant permissions that are in excess | ||
461 | // of those allowed by the access policy of the role that is being assumed. | ||
462 | // For more information, see Permissions for AssumeRole, AssumeRoleWithSAML, | ||
463 | // and AssumeRoleWithWebIdentity (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html) | ||
464 | // in the IAM User Guide. | ||
465 | // | ||
466 | // Before your application can call AssumeRoleWithWebIdentity, you must have | ||
467 | // an identity token from a supported identity provider and create a role that | ||
468 | // the application can assume. The role that your application assumes must trust | ||
469 | // the identity provider that is associated with the identity token. In other | ||
470 | // words, the identity provider must be specified in the role's trust policy. | ||
471 | // | ||
472 | // Calling AssumeRoleWithWebIdentity can result in an entry in your AWS CloudTrail | ||
473 | // logs. The entry includes the Subject (http://openid.net/specs/openid-connect-core-1_0.html#Claims) | ||
474 | // of the provided Web Identity Token. We recommend that you avoid using any | ||
475 | // personally identifiable information (PII) in this field. For example, you | ||
476 | // could instead use a GUID or a pairwise identifier, as suggested in the OIDC | ||
477 | // specification (http://openid.net/specs/openid-connect-core-1_0.html#SubjectIDTypes). | ||
478 | // | ||
479 | // For more information about how to use web identity federation and the AssumeRoleWithWebIdentity | ||
480 | // API, see the following resources: | ||
481 | // | ||
482 | // * Using Web Identity Federation APIs for Mobile Apps (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_oidc_manual.html) | ||
483 | // and Federation Through a Web-based Identity Provider (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity). | ||
484 | // | ||
485 | // | ||
486 | // * Web Identity Federation Playground (https://web-identity-federation-playground.s3.amazonaws.com/index.html). | ||
487 | // This interactive website lets you walk through the process of authenticating | ||
488 | // via Login with Amazon, Facebook, or Google, getting temporary security | ||
489 | // credentials, and then using those credentials to make a request to AWS. | ||
490 | // | ||
491 | // | ||
492 | // * AWS SDK for iOS (http://aws.amazon.com/sdkforios/) and AWS SDK for Android | ||
493 | // (http://aws.amazon.com/sdkforandroid/). These toolkits contain sample | ||
494 | // apps that show how to invoke the identity providers, and then how to use | ||
495 | // the information from these providers to get and use temporary security | ||
496 | // credentials. | ||
497 | // | ||
498 | // * Web Identity Federation with Mobile Applications (http://aws.amazon.com/articles/4617974389850313). | ||
499 | // This article discusses web identity federation and shows an example of | ||
500 | // how to use web identity federation to get access to content in Amazon | ||
501 | // S3. | ||
502 | // | ||
503 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
504 | // with awserr.Error's Code and Message methods to get detailed information about | ||
505 | // the error. | ||
506 | // | ||
507 | // See the AWS API reference guide for AWS Security Token Service's | ||
508 | // API operation AssumeRoleWithWebIdentity for usage and error information. | ||
509 | // | ||
510 | // Returned Error Codes: | ||
511 | // * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument" | ||
512 | // The request was rejected because the policy document was malformed. The error | ||
513 | // message describes the specific error. | ||
514 | // | ||
515 | // * ErrCodePackedPolicyTooLargeException "PackedPolicyTooLarge" | ||
516 | // The request was rejected because the policy document was too large. The error | ||
517 | // message describes how big the policy document is, in packed form, as a percentage | ||
518 | // of what the API allows. | ||
519 | // | ||
520 | // * ErrCodeIDPRejectedClaimException "IDPRejectedClaim" | ||
521 | // The identity provider (IdP) reported that authentication failed. This might | ||
522 | // be because the claim is invalid. | ||
523 | // | ||
524 | // If this error is returned for the AssumeRoleWithWebIdentity operation, it | ||
525 | // can also mean that the claim has expired or has been explicitly revoked. | ||
526 | // | ||
527 | // * ErrCodeIDPCommunicationErrorException "IDPCommunicationError" | ||
528 | // The request could not be fulfilled because the non-AWS identity provider | ||
529 | // (IDP) that was asked to verify the incoming identity token could not be reached. | ||
530 | // This is often a transient error caused by network conditions. Retry the request | ||
531 | // a limited number of times so that you don't exceed the request rate. If the | ||
532 | // error persists, the non-AWS identity provider might be down or not responding. | ||
533 | // | ||
534 | // * ErrCodeInvalidIdentityTokenException "InvalidIdentityToken" | ||
535 | // The web identity token that was passed could not be validated by AWS. Get | ||
536 | // a new identity token from the identity provider and then retry the request. | ||
537 | // | ||
538 | // * ErrCodeExpiredTokenException "ExpiredTokenException" | ||
539 | // The web identity token that was passed is expired or is not valid. Get a | ||
540 | // new identity token from the identity provider and then retry the request. | ||
541 | // | ||
542 | // * ErrCodeRegionDisabledException "RegionDisabledException" | ||
543 | // STS is not activated in the requested region for the account that is being | ||
544 | // asked to generate credentials. The account administrator must use the IAM | ||
545 | // console to activate STS in that region. For more information, see Activating | ||
546 | // and Deactivating AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) | ||
547 | // in the IAM User Guide. | ||
548 | // | ||
549 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithWebIdentity | ||
550 | func (c *STS) AssumeRoleWithWebIdentity(input *AssumeRoleWithWebIdentityInput) (*AssumeRoleWithWebIdentityOutput, error) { | ||
551 | req, out := c.AssumeRoleWithWebIdentityRequest(input) | ||
552 | return out, req.Send() | ||
553 | } | ||
554 | |||
555 | // AssumeRoleWithWebIdentityWithContext is the same as AssumeRoleWithWebIdentity with the addition of | ||
556 | // the ability to pass a context and additional request options. | ||
557 | // | ||
558 | // See AssumeRoleWithWebIdentity for details on how to use this API operation. | ||
559 | // | ||
560 | // The context must be non-nil and will be used for request cancellation. If | ||
561 | // the context is nil a panic will occur. In the future the SDK may create | ||
562 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
563 | // for more information on using Contexts. | ||
564 | func (c *STS) AssumeRoleWithWebIdentityWithContext(ctx aws.Context, input *AssumeRoleWithWebIdentityInput, opts ...request.Option) (*AssumeRoleWithWebIdentityOutput, error) { | ||
565 | req, out := c.AssumeRoleWithWebIdentityRequest(input) | ||
566 | req.SetContext(ctx) | ||
567 | req.ApplyOptions(opts...) | ||
568 | return out, req.Send() | ||
569 | } | ||
570 | |||
571 | const opDecodeAuthorizationMessage = "DecodeAuthorizationMessage" | ||
572 | |||
573 | // DecodeAuthorizationMessageRequest generates a "aws/request.Request" representing the | ||
574 | // client's request for the DecodeAuthorizationMessage operation. The "output" return | ||
575 | // value can be used to capture response data after the request's "Send" method | ||
576 | // is called. | ||
577 | // | ||
578 | // See DecodeAuthorizationMessage for usage and error information. | ||
579 | // | ||
580 | // Creating a request object using this method should be used when you want to inject | ||
581 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
582 | // access properties on the request object before or after sending the request. If | ||
583 | // you just want the service response, call the DecodeAuthorizationMessage method directly | ||
584 | // instead. | ||
585 | // | ||
586 | // Note: You must call the "Send" method on the returned request object in order | ||
587 | // to execute the request. | ||
588 | // | ||
589 | // // Example sending a request using the DecodeAuthorizationMessageRequest method. | ||
590 | // req, resp := client.DecodeAuthorizationMessageRequest(params) | ||
591 | // | ||
592 | // err := req.Send() | ||
593 | // if err == nil { // resp is now filled | ||
594 | // fmt.Println(resp) | ||
595 | // } | ||
596 | // | ||
597 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/DecodeAuthorizationMessage | ||
598 | func (c *STS) DecodeAuthorizationMessageRequest(input *DecodeAuthorizationMessageInput) (req *request.Request, output *DecodeAuthorizationMessageOutput) { | ||
599 | op := &request.Operation{ | ||
600 | Name: opDecodeAuthorizationMessage, | ||
601 | HTTPMethod: "POST", | ||
602 | HTTPPath: "/", | ||
603 | } | ||
604 | |||
605 | if input == nil { | ||
606 | input = &DecodeAuthorizationMessageInput{} | ||
607 | } | ||
608 | |||
609 | output = &DecodeAuthorizationMessageOutput{} | ||
610 | req = c.newRequest(op, input, output) | ||
611 | return | ||
612 | } | ||
613 | |||
614 | // DecodeAuthorizationMessage API operation for AWS Security Token Service. | ||
615 | // | ||
616 | // Decodes additional information about the authorization status of a request | ||
617 | // from an encoded message returned in response to an AWS request. | ||
618 | // | ||
619 | // For example, if a user is not authorized to perform an action that he or | ||
620 | // she has requested, the request returns a Client.UnauthorizedOperation response | ||
621 | // (an HTTP 403 response). Some AWS actions additionally return an encoded message | ||
622 | // that can provide details about this authorization failure. | ||
623 | // | ||
624 | // Only certain AWS actions return an encoded authorization message. The documentation | ||
625 | // for an individual action indicates whether that action returns an encoded | ||
626 | // message in addition to returning an HTTP code. | ||
627 | // | ||
628 | // The message is encoded because the details of the authorization status can | ||
629 | // constitute privileged information that the user who requested the action | ||
630 | // should not see. To decode an authorization status message, a user must be | ||
631 | // granted permissions via an IAM policy to request the DecodeAuthorizationMessage | ||
632 | // (sts:DecodeAuthorizationMessage) action. | ||
633 | // | ||
634 | // The decoded message includes the following type of information: | ||
635 | // | ||
636 | // * Whether the request was denied due to an explicit deny or due to the | ||
637 | // absence of an explicit allow. For more information, see Determining Whether | ||
638 | // a Request is Allowed or Denied (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html#policy-eval-denyallow) | ||
639 | // in the IAM User Guide. | ||
640 | // | ||
641 | // * The principal who made the request. | ||
642 | // | ||
643 | // * The requested action. | ||
644 | // | ||
645 | // * The requested resource. | ||
646 | // | ||
647 | // * The values of condition keys in the context of the user's request. | ||
648 | // | ||
649 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
650 | // with awserr.Error's Code and Message methods to get detailed information about | ||
651 | // the error. | ||
652 | // | ||
653 | // See the AWS API reference guide for AWS Security Token Service's | ||
654 | // API operation DecodeAuthorizationMessage for usage and error information. | ||
655 | // | ||
656 | // Returned Error Codes: | ||
657 | // * ErrCodeInvalidAuthorizationMessageException "InvalidAuthorizationMessageException" | ||
658 | // The error returned if the message passed to DecodeAuthorizationMessage was | ||
659 | // invalid. This can happen if the token contains invalid characters, such as | ||
660 | // linebreaks. | ||
661 | // | ||
662 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/DecodeAuthorizationMessage | ||
663 | func (c *STS) DecodeAuthorizationMessage(input *DecodeAuthorizationMessageInput) (*DecodeAuthorizationMessageOutput, error) { | ||
664 | req, out := c.DecodeAuthorizationMessageRequest(input) | ||
665 | return out, req.Send() | ||
666 | } | ||
667 | |||
668 | // DecodeAuthorizationMessageWithContext is the same as DecodeAuthorizationMessage with the addition of | ||
669 | // the ability to pass a context and additional request options. | ||
670 | // | ||
671 | // See DecodeAuthorizationMessage for details on how to use this API operation. | ||
672 | // | ||
673 | // The context must be non-nil and will be used for request cancellation. If | ||
674 | // the context is nil a panic will occur. In the future the SDK may create | ||
675 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
676 | // for more information on using Contexts. | ||
677 | func (c *STS) DecodeAuthorizationMessageWithContext(ctx aws.Context, input *DecodeAuthorizationMessageInput, opts ...request.Option) (*DecodeAuthorizationMessageOutput, error) { | ||
678 | req, out := c.DecodeAuthorizationMessageRequest(input) | ||
679 | req.SetContext(ctx) | ||
680 | req.ApplyOptions(opts...) | ||
681 | return out, req.Send() | ||
682 | } | ||
683 | |||
684 | const opGetCallerIdentity = "GetCallerIdentity" | ||
685 | |||
686 | // GetCallerIdentityRequest generates a "aws/request.Request" representing the | ||
687 | // client's request for the GetCallerIdentity operation. The "output" return | ||
688 | // value can be used to capture response data after the request's "Send" method | ||
689 | // is called. | ||
690 | // | ||
691 | // See GetCallerIdentity for usage and error information. | ||
692 | // | ||
693 | // Creating a request object using this method should be used when you want to inject | ||
694 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
695 | // access properties on the request object before or after sending the request. If | ||
696 | // you just want the service response, call the GetCallerIdentity method directly | ||
697 | // instead. | ||
698 | // | ||
699 | // Note: You must call the "Send" method on the returned request object in order | ||
700 | // to execute the request. | ||
701 | // | ||
702 | // // Example sending a request using the GetCallerIdentityRequest method. | ||
703 | // req, resp := client.GetCallerIdentityRequest(params) | ||
704 | // | ||
705 | // err := req.Send() | ||
706 | // if err == nil { // resp is now filled | ||
707 | // fmt.Println(resp) | ||
708 | // } | ||
709 | // | ||
710 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetCallerIdentity | ||
711 | func (c *STS) GetCallerIdentityRequest(input *GetCallerIdentityInput) (req *request.Request, output *GetCallerIdentityOutput) { | ||
712 | op := &request.Operation{ | ||
713 | Name: opGetCallerIdentity, | ||
714 | HTTPMethod: "POST", | ||
715 | HTTPPath: "/", | ||
716 | } | ||
717 | |||
718 | if input == nil { | ||
719 | input = &GetCallerIdentityInput{} | ||
720 | } | ||
721 | |||
722 | output = &GetCallerIdentityOutput{} | ||
723 | req = c.newRequest(op, input, output) | ||
724 | return | ||
725 | } | ||
726 | |||
727 | // GetCallerIdentity API operation for AWS Security Token Service. | ||
728 | // | ||
729 | // Returns details about the IAM identity whose credentials are used to call | ||
730 | // the API. | ||
731 | // | ||
732 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
733 | // with awserr.Error's Code and Message methods to get detailed information about | ||
734 | // the error. | ||
735 | // | ||
736 | // See the AWS API reference guide for AWS Security Token Service's | ||
737 | // API operation GetCallerIdentity for usage and error information. | ||
738 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetCallerIdentity | ||
739 | func (c *STS) GetCallerIdentity(input *GetCallerIdentityInput) (*GetCallerIdentityOutput, error) { | ||
740 | req, out := c.GetCallerIdentityRequest(input) | ||
741 | return out, req.Send() | ||
742 | } | ||
743 | |||
744 | // GetCallerIdentityWithContext is the same as GetCallerIdentity with the addition of | ||
745 | // the ability to pass a context and additional request options. | ||
746 | // | ||
747 | // See GetCallerIdentity for details on how to use this API operation. | ||
748 | // | ||
749 | // The context must be non-nil and will be used for request cancellation. If | ||
750 | // the context is nil a panic will occur. In the future the SDK may create | ||
751 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
752 | // for more information on using Contexts. | ||
753 | func (c *STS) GetCallerIdentityWithContext(ctx aws.Context, input *GetCallerIdentityInput, opts ...request.Option) (*GetCallerIdentityOutput, error) { | ||
754 | req, out := c.GetCallerIdentityRequest(input) | ||
755 | req.SetContext(ctx) | ||
756 | req.ApplyOptions(opts...) | ||
757 | return out, req.Send() | ||
758 | } | ||
759 | |||
760 | const opGetFederationToken = "GetFederationToken" | ||
761 | |||
762 | // GetFederationTokenRequest generates a "aws/request.Request" representing the | ||
763 | // client's request for the GetFederationToken operation. The "output" return | ||
764 | // value can be used to capture response data after the request's "Send" method | ||
765 | // is called. | ||
766 | // | ||
767 | // See GetFederationToken for usage and error information. | ||
768 | // | ||
769 | // Creating a request object using this method should be used when you want to inject | ||
770 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
771 | // access properties on the request object before or after sending the request. If | ||
772 | // you just want the service response, call the GetFederationToken method directly | ||
773 | // instead. | ||
774 | // | ||
775 | // Note: You must call the "Send" method on the returned request object in order | ||
776 | // to execute the request. | ||
777 | // | ||
778 | // // Example sending a request using the GetFederationTokenRequest method. | ||
779 | // req, resp := client.GetFederationTokenRequest(params) | ||
780 | // | ||
781 | // err := req.Send() | ||
782 | // if err == nil { // resp is now filled | ||
783 | // fmt.Println(resp) | ||
784 | // } | ||
785 | // | ||
786 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetFederationToken | ||
787 | func (c *STS) GetFederationTokenRequest(input *GetFederationTokenInput) (req *request.Request, output *GetFederationTokenOutput) { | ||
788 | op := &request.Operation{ | ||
789 | Name: opGetFederationToken, | ||
790 | HTTPMethod: "POST", | ||
791 | HTTPPath: "/", | ||
792 | } | ||
793 | |||
794 | if input == nil { | ||
795 | input = &GetFederationTokenInput{} | ||
796 | } | ||
797 | |||
798 | output = &GetFederationTokenOutput{} | ||
799 | req = c.newRequest(op, input, output) | ||
800 | return | ||
801 | } | ||
802 | |||
803 | // GetFederationToken API operation for AWS Security Token Service. | ||
804 | // | ||
805 | // Returns a set of temporary security credentials (consisting of an access | ||
806 | // key ID, a secret access key, and a security token) for a federated user. | ||
807 | // A typical use is in a proxy application that gets temporary security credentials | ||
808 | // on behalf of distributed applications inside a corporate network. Because | ||
809 | // you must call the GetFederationToken action using the long-term security | ||
810 | // credentials of an IAM user, this call is appropriate in contexts where those | ||
811 | // credentials can be safely stored, usually in a server-based application. | ||
812 | // For a comparison of GetFederationToken with the other APIs that produce temporary | ||
813 | // credentials, see Requesting Temporary Security Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) | ||
814 | // and Comparing the AWS STS APIs (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) | ||
815 | // in the IAM User Guide. | ||
816 | // | ||
817 | // If you are creating a mobile-based or browser-based app that can authenticate | ||
818 | // users using a web identity provider like Login with Amazon, Facebook, Google, | ||
819 | // or an OpenID Connect-compatible identity provider, we recommend that you | ||
820 | // use Amazon Cognito (http://aws.amazon.com/cognito/) or AssumeRoleWithWebIdentity. | ||
821 | // For more information, see Federation Through a Web-based Identity Provider | ||
822 | // (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity). | ||
823 | // | ||
824 | // The GetFederationToken action must be called by using the long-term AWS security | ||
825 | // credentials of an IAM user. You can also call GetFederationToken using the | ||
826 | // security credentials of an AWS root account, but we do not recommended it. | ||
827 | // Instead, we recommend that you create an IAM user for the purpose of the | ||
828 | // proxy application and then attach a policy to the IAM user that limits federated | ||
829 | // users to only the actions and resources that they need access to. For more | ||
830 | // information, see IAM Best Practices (http://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html) | ||
831 | // in the IAM User Guide. | ||
832 | // | ||
833 | // The temporary security credentials that are obtained by using the long-term | ||
834 | // credentials of an IAM user are valid for the specified duration, from 900 | ||
835 | // seconds (15 minutes) up to a maximium of 129600 seconds (36 hours). The default | ||
836 | // is 43200 seconds (12 hours). Temporary credentials that are obtained by using | ||
837 | // AWS root account credentials have a maximum duration of 3600 seconds (1 hour). | ||
838 | // | ||
839 | // The temporary security credentials created by GetFederationToken can be used | ||
840 | // to make API calls to any AWS service with the following exceptions: | ||
841 | // | ||
842 | // * You cannot use these credentials to call any IAM APIs. | ||
843 | // | ||
844 | // * You cannot call any STS APIs except GetCallerIdentity. | ||
845 | // | ||
846 | // Permissions | ||
847 | // | ||
848 | // The permissions for the temporary security credentials returned by GetFederationToken | ||
849 | // are determined by a combination of the following: | ||
850 | // | ||
851 | // * The policy or policies that are attached to the IAM user whose credentials | ||
852 | // are used to call GetFederationToken. | ||
853 | // | ||
854 | // * The policy that is passed as a parameter in the call. | ||
855 | // | ||
856 | // The passed policy is attached to the temporary security credentials that | ||
857 | // result from the GetFederationToken API call--that is, to the federated user. | ||
858 | // When the federated user makes an AWS request, AWS evaluates the policy attached | ||
859 | // to the federated user in combination with the policy or policies attached | ||
860 | // to the IAM user whose credentials were used to call GetFederationToken. AWS | ||
861 | // allows the federated user's request only when both the federated user and | ||
862 | // the IAM user are explicitly allowed to perform the requested action. The | ||
863 | // passed policy cannot grant more permissions than those that are defined in | ||
864 | // the IAM user policy. | ||
865 | // | ||
866 | // A typical use case is that the permissions of the IAM user whose credentials | ||
867 | // are used to call GetFederationToken are designed to allow access to all the | ||
868 | // actions and resources that any federated user will need. Then, for individual | ||
869 | // users, you pass a policy to the operation that scopes down the permissions | ||
870 | // to a level that's appropriate to that individual user, using a policy that | ||
871 | // allows only a subset of permissions that are granted to the IAM user. | ||
872 | // | ||
873 | // If you do not pass a policy, the resulting temporary security credentials | ||
874 | // have no effective permissions. The only exception is when the temporary security | ||
875 | // credentials are used to access a resource that has a resource-based policy | ||
876 | // that specifically allows the federated user to access the resource. | ||
877 | // | ||
878 | // For more information about how permissions work, see Permissions for GetFederationToken | ||
879 | // (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_getfederationtoken.html). | ||
880 | // For information about using GetFederationToken to create temporary security | ||
881 | // credentials, see GetFederationToken—Federation Through a Custom Identity | ||
882 | // Broker (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getfederationtoken). | ||
883 | // | ||
884 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
885 | // with awserr.Error's Code and Message methods to get detailed information about | ||
886 | // the error. | ||
887 | // | ||
888 | // See the AWS API reference guide for AWS Security Token Service's | ||
889 | // API operation GetFederationToken for usage and error information. | ||
890 | // | ||
891 | // Returned Error Codes: | ||
892 | // * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument" | ||
893 | // The request was rejected because the policy document was malformed. The error | ||
894 | // message describes the specific error. | ||
895 | // | ||
896 | // * ErrCodePackedPolicyTooLargeException "PackedPolicyTooLarge" | ||
897 | // The request was rejected because the policy document was too large. The error | ||
898 | // message describes how big the policy document is, in packed form, as a percentage | ||
899 | // of what the API allows. | ||
900 | // | ||
901 | // * ErrCodeRegionDisabledException "RegionDisabledException" | ||
902 | // STS is not activated in the requested region for the account that is being | ||
903 | // asked to generate credentials. The account administrator must use the IAM | ||
904 | // console to activate STS in that region. For more information, see Activating | ||
905 | // and Deactivating AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) | ||
906 | // in the IAM User Guide. | ||
907 | // | ||
908 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetFederationToken | ||
909 | func (c *STS) GetFederationToken(input *GetFederationTokenInput) (*GetFederationTokenOutput, error) { | ||
910 | req, out := c.GetFederationTokenRequest(input) | ||
911 | return out, req.Send() | ||
912 | } | ||
913 | |||
914 | // GetFederationTokenWithContext is the same as GetFederationToken with the addition of | ||
915 | // the ability to pass a context and additional request options. | ||
916 | // | ||
917 | // See GetFederationToken for details on how to use this API operation. | ||
918 | // | ||
919 | // The context must be non-nil and will be used for request cancellation. If | ||
920 | // the context is nil a panic will occur. In the future the SDK may create | ||
921 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
922 | // for more information on using Contexts. | ||
923 | func (c *STS) GetFederationTokenWithContext(ctx aws.Context, input *GetFederationTokenInput, opts ...request.Option) (*GetFederationTokenOutput, error) { | ||
924 | req, out := c.GetFederationTokenRequest(input) | ||
925 | req.SetContext(ctx) | ||
926 | req.ApplyOptions(opts...) | ||
927 | return out, req.Send() | ||
928 | } | ||
929 | |||
930 | const opGetSessionToken = "GetSessionToken" | ||
931 | |||
932 | // GetSessionTokenRequest generates a "aws/request.Request" representing the | ||
933 | // client's request for the GetSessionToken operation. The "output" return | ||
934 | // value can be used to capture response data after the request's "Send" method | ||
935 | // is called. | ||
936 | // | ||
937 | // See GetSessionToken for usage and error information. | ||
938 | // | ||
939 | // Creating a request object using this method should be used when you want to inject | ||
940 | // custom logic into the request's lifecycle using a custom handler, or if you want to | ||
941 | // access properties on the request object before or after sending the request. If | ||
942 | // you just want the service response, call the GetSessionToken method directly | ||
943 | // instead. | ||
944 | // | ||
945 | // Note: You must call the "Send" method on the returned request object in order | ||
946 | // to execute the request. | ||
947 | // | ||
948 | // // Example sending a request using the GetSessionTokenRequest method. | ||
949 | // req, resp := client.GetSessionTokenRequest(params) | ||
950 | // | ||
951 | // err := req.Send() | ||
952 | // if err == nil { // resp is now filled | ||
953 | // fmt.Println(resp) | ||
954 | // } | ||
955 | // | ||
956 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetSessionToken | ||
957 | func (c *STS) GetSessionTokenRequest(input *GetSessionTokenInput) (req *request.Request, output *GetSessionTokenOutput) { | ||
958 | op := &request.Operation{ | ||
959 | Name: opGetSessionToken, | ||
960 | HTTPMethod: "POST", | ||
961 | HTTPPath: "/", | ||
962 | } | ||
963 | |||
964 | if input == nil { | ||
965 | input = &GetSessionTokenInput{} | ||
966 | } | ||
967 | |||
968 | output = &GetSessionTokenOutput{} | ||
969 | req = c.newRequest(op, input, output) | ||
970 | return | ||
971 | } | ||
972 | |||
973 | // GetSessionToken API operation for AWS Security Token Service. | ||
974 | // | ||
975 | // Returns a set of temporary credentials for an AWS account or IAM user. The | ||
976 | // credentials consist of an access key ID, a secret access key, and a security | ||
977 | // token. Typically, you use GetSessionToken if you want to use MFA to protect | ||
978 | // programmatic calls to specific AWS APIs like Amazon EC2 StopInstances. MFA-enabled | ||
979 | // IAM users would need to call GetSessionToken and submit an MFA code that | ||
980 | // is associated with their MFA device. Using the temporary security credentials | ||
981 | // that are returned from the call, IAM users can then make programmatic calls | ||
982 | // to APIs that require MFA authentication. If you do not supply a correct MFA | ||
983 | // code, then the API returns an access denied error. For a comparison of GetSessionToken | ||
984 | // with the other APIs that produce temporary credentials, see Requesting Temporary | ||
985 | // Security Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) | ||
986 | // and Comparing the AWS STS APIs (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) | ||
987 | // in the IAM User Guide. | ||
988 | // | ||
989 | // The GetSessionToken action must be called by using the long-term AWS security | ||
990 | // credentials of the AWS account or an IAM user. Credentials that are created | ||
991 | // by IAM users are valid for the duration that you specify, from 900 seconds | ||
992 | // (15 minutes) up to a maximum of 129600 seconds (36 hours), with a default | ||
993 | // of 43200 seconds (12 hours); credentials that are created by using account | ||
994 | // credentials can range from 900 seconds (15 minutes) up to a maximum of 3600 | ||
995 | // seconds (1 hour), with a default of 1 hour. | ||
996 | // | ||
997 | // The temporary security credentials created by GetSessionToken can be used | ||
998 | // to make API calls to any AWS service with the following exceptions: | ||
999 | // | ||
1000 | // * You cannot call any IAM APIs unless MFA authentication information is | ||
1001 | // included in the request. | ||
1002 | // | ||
1003 | // * You cannot call any STS API exceptAssumeRole or GetCallerIdentity. | ||
1004 | // | ||
1005 | // We recommend that you do not call GetSessionToken with root account credentials. | ||
1006 | // Instead, follow our best practices (http://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#create-iam-users) | ||
1007 | // by creating one or more IAM users, giving them the necessary permissions, | ||
1008 | // and using IAM users for everyday interaction with AWS. | ||
1009 | // | ||
1010 | // The permissions associated with the temporary security credentials returned | ||
1011 | // by GetSessionToken are based on the permissions associated with account or | ||
1012 | // IAM user whose credentials are used to call the action. If GetSessionToken | ||
1013 | // is called using root account credentials, the temporary credentials have | ||
1014 | // root account permissions. Similarly, if GetSessionToken is called using the | ||
1015 | // credentials of an IAM user, the temporary credentials have the same permissions | ||
1016 | // as the IAM user. | ||
1017 | // | ||
1018 | // For more information about using GetSessionToken to create temporary credentials, | ||
1019 | // go to Temporary Credentials for Users in Untrusted Environments (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getsessiontoken) | ||
1020 | // in the IAM User Guide. | ||
1021 | // | ||
1022 | // Returns awserr.Error for service API and SDK errors. Use runtime type assertions | ||
1023 | // with awserr.Error's Code and Message methods to get detailed information about | ||
1024 | // the error. | ||
1025 | // | ||
1026 | // See the AWS API reference guide for AWS Security Token Service's | ||
1027 | // API operation GetSessionToken for usage and error information. | ||
1028 | // | ||
1029 | // Returned Error Codes: | ||
1030 | // * ErrCodeRegionDisabledException "RegionDisabledException" | ||
1031 | // STS is not activated in the requested region for the account that is being | ||
1032 | // asked to generate credentials. The account administrator must use the IAM | ||
1033 | // console to activate STS in that region. For more information, see Activating | ||
1034 | // and Deactivating AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) | ||
1035 | // in the IAM User Guide. | ||
1036 | // | ||
1037 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetSessionToken | ||
1038 | func (c *STS) GetSessionToken(input *GetSessionTokenInput) (*GetSessionTokenOutput, error) { | ||
1039 | req, out := c.GetSessionTokenRequest(input) | ||
1040 | return out, req.Send() | ||
1041 | } | ||
1042 | |||
1043 | // GetSessionTokenWithContext is the same as GetSessionToken with the addition of | ||
1044 | // the ability to pass a context and additional request options. | ||
1045 | // | ||
1046 | // See GetSessionToken for details on how to use this API operation. | ||
1047 | // | ||
1048 | // The context must be non-nil and will be used for request cancellation. If | ||
1049 | // the context is nil a panic will occur. In the future the SDK may create | ||
1050 | // sub-contexts for http.Requests. See https://golang.org/pkg/context/ | ||
1051 | // for more information on using Contexts. | ||
1052 | func (c *STS) GetSessionTokenWithContext(ctx aws.Context, input *GetSessionTokenInput, opts ...request.Option) (*GetSessionTokenOutput, error) { | ||
1053 | req, out := c.GetSessionTokenRequest(input) | ||
1054 | req.SetContext(ctx) | ||
1055 | req.ApplyOptions(opts...) | ||
1056 | return out, req.Send() | ||
1057 | } | ||
1058 | |||
1059 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleRequest | ||
1060 | type AssumeRoleInput struct { | ||
1061 | _ struct{} `type:"structure"` | ||
1062 | |||
1063 | // The duration, in seconds, of the role session. The value can range from 900 | ||
1064 | // seconds (15 minutes) to 3600 seconds (1 hour). By default, the value is set | ||
1065 | // to 3600 seconds. | ||
1066 | // | ||
1067 | // This is separate from the duration of a console session that you might request | ||
1068 | // using the returned credentials. The request to the federation endpoint for | ||
1069 | // a console sign-in token takes a SessionDuration parameter that specifies | ||
1070 | // the maximum length of the console session, separately from the DurationSeconds | ||
1071 | // parameter on this API. For more information, see Creating a URL that Enables | ||
1072 | // Federated Users to Access the AWS Management Console (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html) | ||
1073 | // in the IAM User Guide. | ||
1074 | DurationSeconds *int64 `min:"900" type:"integer"` | ||
1075 | |||
1076 | // A unique identifier that is used by third parties when assuming roles in | ||
1077 | // their customers' accounts. For each role that the third party can assume, | ||
1078 | // they should instruct their customers to ensure the role's trust policy checks | ||
1079 | // for the external ID that the third party generated. Each time the third party | ||
1080 | // assumes the role, they should pass the customer's external ID. The external | ||
1081 | // ID is useful in order to help third parties bind a role to the customer who | ||
1082 | // created it. For more information about the external ID, see How to Use an | ||
1083 | // External ID When Granting Access to Your AWS Resources to a Third Party (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html) | ||
1084 | // in the IAM User Guide. | ||
1085 | // | ||
1086 | // The regex used to validated this parameter is a string of characters consisting | ||
1087 | // of upper- and lower-case alphanumeric characters with no spaces. You can | ||
1088 | // also include underscores or any of the following characters: =,.@:\/- | ||
1089 | ExternalId *string `min:"2" type:"string"` | ||
1090 | |||
1091 | // An IAM policy in JSON format. | ||
1092 | // | ||
1093 | // This parameter is optional. If you pass a policy, the temporary security | ||
1094 | // credentials that are returned by the operation have the permissions that | ||
1095 | // are allowed by both (the intersection of) the access policy of the role that | ||
1096 | // is being assumed, and the policy that you pass. This gives you a way to further | ||
1097 | // restrict the permissions for the resulting temporary security credentials. | ||
1098 | // You cannot use the passed policy to grant permissions that are in excess | ||
1099 | // of those allowed by the access policy of the role that is being assumed. | ||
1100 | // For more information, see Permissions for AssumeRole, AssumeRoleWithSAML, | ||
1101 | // and AssumeRoleWithWebIdentity (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html) | ||
1102 | // in the IAM User Guide. | ||
1103 | // | ||
1104 | // The format for this parameter, as described by its regex pattern, is a string | ||
1105 | // of characters up to 2048 characters in length. The characters can be any | ||
1106 | // ASCII character from the space character to the end of the valid character | ||
1107 | // list (\u0020-\u00FF). It can also include the tab (\u0009), linefeed (\u000A), | ||
1108 | // and carriage return (\u000D) characters. | ||
1109 | // | ||
1110 | // The policy plain text must be 2048 bytes or shorter. However, an internal | ||
1111 | // conversion compresses it into a packed binary format with a separate limit. | ||
1112 | // The PackedPolicySize response element indicates by percentage how close to | ||
1113 | // the upper size limit the policy is, with 100% equaling the maximum allowed | ||
1114 | // size. | ||
1115 | Policy *string `min:"1" type:"string"` | ||
1116 | |||
1117 | // The Amazon Resource Name (ARN) of the role to assume. | ||
1118 | // | ||
1119 | // RoleArn is a required field | ||
1120 | RoleArn *string `min:"20" type:"string" required:"true"` | ||
1121 | |||
1122 | // An identifier for the assumed role session. | ||
1123 | // | ||
1124 | // Use the role session name to uniquely identify a session when the same role | ||
1125 | // is assumed by different principals or for different reasons. In cross-account | ||
1126 | // scenarios, the role session name is visible to, and can be logged by the | ||
1127 | // account that owns the role. The role session name is also used in the ARN | ||
1128 | // of the assumed role principal. This means that subsequent cross-account API | ||
1129 | // requests using the temporary security credentials will expose the role session | ||
1130 | // name to the external account in their CloudTrail logs. | ||
1131 | // | ||
1132 | // The regex used to validate this parameter is a string of characters consisting | ||
1133 | // of upper- and lower-case alphanumeric characters with no spaces. You can | ||
1134 | // also include underscores or any of the following characters: =,.@- | ||
1135 | // | ||
1136 | // RoleSessionName is a required field | ||
1137 | RoleSessionName *string `min:"2" type:"string" required:"true"` | ||
1138 | |||
1139 | // The identification number of the MFA device that is associated with the user | ||
1140 | // who is making the AssumeRole call. Specify this value if the trust policy | ||
1141 | // of the role being assumed includes a condition that requires MFA authentication. | ||
1142 | // The value is either the serial number for a hardware device (such as GAHT12345678) | ||
1143 | // or an Amazon Resource Name (ARN) for a virtual device (such as arn:aws:iam::123456789012:mfa/user). | ||
1144 | // | ||
1145 | // The regex used to validate this parameter is a string of characters consisting | ||
1146 | // of upper- and lower-case alphanumeric characters with no spaces. You can | ||
1147 | // also include underscores or any of the following characters: =,.@- | ||
1148 | SerialNumber *string `min:"9" type:"string"` | ||
1149 | |||
1150 | // The value provided by the MFA device, if the trust policy of the role being | ||
1151 | // assumed requires MFA (that is, if the policy includes a condition that tests | ||
1152 | // for MFA). If the role being assumed requires MFA and if the TokenCode value | ||
1153 | // is missing or expired, the AssumeRole call returns an "access denied" error. | ||
1154 | // | ||
1155 | // The format for this parameter, as described by its regex pattern, is a sequence | ||
1156 | // of six numeric digits. | ||
1157 | TokenCode *string `min:"6" type:"string"` | ||
1158 | } | ||
1159 | |||
1160 | // String returns the string representation | ||
1161 | func (s AssumeRoleInput) String() string { | ||
1162 | return awsutil.Prettify(s) | ||
1163 | } | ||
1164 | |||
1165 | // GoString returns the string representation | ||
1166 | func (s AssumeRoleInput) GoString() string { | ||
1167 | return s.String() | ||
1168 | } | ||
1169 | |||
1170 | // Validate inspects the fields of the type to determine if they are valid. | ||
1171 | func (s *AssumeRoleInput) Validate() error { | ||
1172 | invalidParams := request.ErrInvalidParams{Context: "AssumeRoleInput"} | ||
1173 | if s.DurationSeconds != nil && *s.DurationSeconds < 900 { | ||
1174 | invalidParams.Add(request.NewErrParamMinValue("DurationSeconds", 900)) | ||
1175 | } | ||
1176 | if s.ExternalId != nil && len(*s.ExternalId) < 2 { | ||
1177 | invalidParams.Add(request.NewErrParamMinLen("ExternalId", 2)) | ||
1178 | } | ||
1179 | if s.Policy != nil && len(*s.Policy) < 1 { | ||
1180 | invalidParams.Add(request.NewErrParamMinLen("Policy", 1)) | ||
1181 | } | ||
1182 | if s.RoleArn == nil { | ||
1183 | invalidParams.Add(request.NewErrParamRequired("RoleArn")) | ||
1184 | } | ||
1185 | if s.RoleArn != nil && len(*s.RoleArn) < 20 { | ||
1186 | invalidParams.Add(request.NewErrParamMinLen("RoleArn", 20)) | ||
1187 | } | ||
1188 | if s.RoleSessionName == nil { | ||
1189 | invalidParams.Add(request.NewErrParamRequired("RoleSessionName")) | ||
1190 | } | ||
1191 | if s.RoleSessionName != nil && len(*s.RoleSessionName) < 2 { | ||
1192 | invalidParams.Add(request.NewErrParamMinLen("RoleSessionName", 2)) | ||
1193 | } | ||
1194 | if s.SerialNumber != nil && len(*s.SerialNumber) < 9 { | ||
1195 | invalidParams.Add(request.NewErrParamMinLen("SerialNumber", 9)) | ||
1196 | } | ||
1197 | if s.TokenCode != nil && len(*s.TokenCode) < 6 { | ||
1198 | invalidParams.Add(request.NewErrParamMinLen("TokenCode", 6)) | ||
1199 | } | ||
1200 | |||
1201 | if invalidParams.Len() > 0 { | ||
1202 | return invalidParams | ||
1203 | } | ||
1204 | return nil | ||
1205 | } | ||
1206 | |||
1207 | // SetDurationSeconds sets the DurationSeconds field's value. | ||
1208 | func (s *AssumeRoleInput) SetDurationSeconds(v int64) *AssumeRoleInput { | ||
1209 | s.DurationSeconds = &v | ||
1210 | return s | ||
1211 | } | ||
1212 | |||
1213 | // SetExternalId sets the ExternalId field's value. | ||
1214 | func (s *AssumeRoleInput) SetExternalId(v string) *AssumeRoleInput { | ||
1215 | s.ExternalId = &v | ||
1216 | return s | ||
1217 | } | ||
1218 | |||
1219 | // SetPolicy sets the Policy field's value. | ||
1220 | func (s *AssumeRoleInput) SetPolicy(v string) *AssumeRoleInput { | ||
1221 | s.Policy = &v | ||
1222 | return s | ||
1223 | } | ||
1224 | |||
1225 | // SetRoleArn sets the RoleArn field's value. | ||
1226 | func (s *AssumeRoleInput) SetRoleArn(v string) *AssumeRoleInput { | ||
1227 | s.RoleArn = &v | ||
1228 | return s | ||
1229 | } | ||
1230 | |||
1231 | // SetRoleSessionName sets the RoleSessionName field's value. | ||
1232 | func (s *AssumeRoleInput) SetRoleSessionName(v string) *AssumeRoleInput { | ||
1233 | s.RoleSessionName = &v | ||
1234 | return s | ||
1235 | } | ||
1236 | |||
1237 | // SetSerialNumber sets the SerialNumber field's value. | ||
1238 | func (s *AssumeRoleInput) SetSerialNumber(v string) *AssumeRoleInput { | ||
1239 | s.SerialNumber = &v | ||
1240 | return s | ||
1241 | } | ||
1242 | |||
1243 | // SetTokenCode sets the TokenCode field's value. | ||
1244 | func (s *AssumeRoleInput) SetTokenCode(v string) *AssumeRoleInput { | ||
1245 | s.TokenCode = &v | ||
1246 | return s | ||
1247 | } | ||
1248 | |||
1249 | // Contains the response to a successful AssumeRole request, including temporary | ||
1250 | // AWS credentials that can be used to make AWS requests. | ||
1251 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleResponse | ||
1252 | type AssumeRoleOutput struct { | ||
1253 | _ struct{} `type:"structure"` | ||
1254 | |||
1255 | // The Amazon Resource Name (ARN) and the assumed role ID, which are identifiers | ||
1256 | // that you can use to refer to the resulting temporary security credentials. | ||
1257 | // For example, you can reference these credentials as a principal in a resource-based | ||
1258 | // policy by using the ARN or assumed role ID. The ARN and ID include the RoleSessionName | ||
1259 | // that you specified when you called AssumeRole. | ||
1260 | AssumedRoleUser *AssumedRoleUser `type:"structure"` | ||
1261 | |||
1262 | // The temporary security credentials, which include an access key ID, a secret | ||
1263 | // access key, and a security (or session) token. | ||
1264 | // | ||
1265 | // Note: The size of the security token that STS APIs return is not fixed. We | ||
1266 | // strongly recommend that you make no assumptions about the maximum size. As | ||
1267 | // of this writing, the typical size is less than 4096 bytes, but that can vary. | ||
1268 | // Also, future updates to AWS might require larger sizes. | ||
1269 | Credentials *Credentials `type:"structure"` | ||
1270 | |||
1271 | // A percentage value that indicates the size of the policy in packed form. | ||
1272 | // The service rejects any policy with a packed size greater than 100 percent, | ||
1273 | // which means the policy exceeded the allowed space. | ||
1274 | PackedPolicySize *int64 `type:"integer"` | ||
1275 | } | ||
1276 | |||
1277 | // String returns the string representation | ||
1278 | func (s AssumeRoleOutput) String() string { | ||
1279 | return awsutil.Prettify(s) | ||
1280 | } | ||
1281 | |||
1282 | // GoString returns the string representation | ||
1283 | func (s AssumeRoleOutput) GoString() string { | ||
1284 | return s.String() | ||
1285 | } | ||
1286 | |||
1287 | // SetAssumedRoleUser sets the AssumedRoleUser field's value. | ||
1288 | func (s *AssumeRoleOutput) SetAssumedRoleUser(v *AssumedRoleUser) *AssumeRoleOutput { | ||
1289 | s.AssumedRoleUser = v | ||
1290 | return s | ||
1291 | } | ||
1292 | |||
1293 | // SetCredentials sets the Credentials field's value. | ||
1294 | func (s *AssumeRoleOutput) SetCredentials(v *Credentials) *AssumeRoleOutput { | ||
1295 | s.Credentials = v | ||
1296 | return s | ||
1297 | } | ||
1298 | |||
1299 | // SetPackedPolicySize sets the PackedPolicySize field's value. | ||
1300 | func (s *AssumeRoleOutput) SetPackedPolicySize(v int64) *AssumeRoleOutput { | ||
1301 | s.PackedPolicySize = &v | ||
1302 | return s | ||
1303 | } | ||
1304 | |||
1305 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithSAMLRequest | ||
1306 | type AssumeRoleWithSAMLInput struct { | ||
1307 | _ struct{} `type:"structure"` | ||
1308 | |||
1309 | // The duration, in seconds, of the role session. The value can range from 900 | ||
1310 | // seconds (15 minutes) to 3600 seconds (1 hour). By default, the value is set | ||
1311 | // to 3600 seconds. An expiration can also be specified in the SAML authentication | ||
1312 | // response's SessionNotOnOrAfter value. The actual expiration time is whichever | ||
1313 | // value is shorter. | ||
1314 | // | ||
1315 | // This is separate from the duration of a console session that you might request | ||
1316 | // using the returned credentials. The request to the federation endpoint for | ||
1317 | // a console sign-in token takes a SessionDuration parameter that specifies | ||
1318 | // the maximum length of the console session, separately from the DurationSeconds | ||
1319 | // parameter on this API. For more information, see Enabling SAML 2.0 Federated | ||
1320 | // Users to Access the AWS Management Console (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-saml.html) | ||
1321 | // in the IAM User Guide. | ||
1322 | DurationSeconds *int64 `min:"900" type:"integer"` | ||
1323 | |||
1324 | // An IAM policy in JSON format. | ||
1325 | // | ||
1326 | // The policy parameter is optional. If you pass a policy, the temporary security | ||
1327 | // credentials that are returned by the operation have the permissions that | ||
1328 | // are allowed by both the access policy of the role that is being assumed, | ||
1329 | // and the policy that you pass. This gives you a way to further restrict the | ||
1330 | // permissions for the resulting temporary security credentials. You cannot | ||
1331 | // use the passed policy to grant permissions that are in excess of those allowed | ||
1332 | // by the access policy of the role that is being assumed. For more information, | ||
1333 | // Permissions for AssumeRole, AssumeRoleWithSAML, and AssumeRoleWithWebIdentity | ||
1334 | // (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html) | ||
1335 | // in the IAM User Guide. | ||
1336 | // | ||
1337 | // The format for this parameter, as described by its regex pattern, is a string | ||
1338 | // of characters up to 2048 characters in length. The characters can be any | ||
1339 | // ASCII character from the space character to the end of the valid character | ||
1340 | // list (\u0020-\u00FF). It can also include the tab (\u0009), linefeed (\u000A), | ||
1341 | // and carriage return (\u000D) characters. | ||
1342 | // | ||
1343 | // The policy plain text must be 2048 bytes or shorter. However, an internal | ||
1344 | // conversion compresses it into a packed binary format with a separate limit. | ||
1345 | // The PackedPolicySize response element indicates by percentage how close to | ||
1346 | // the upper size limit the policy is, with 100% equaling the maximum allowed | ||
1347 | // size. | ||
1348 | Policy *string `min:"1" type:"string"` | ||
1349 | |||
1350 | // The Amazon Resource Name (ARN) of the SAML provider in IAM that describes | ||
1351 | // the IdP. | ||
1352 | // | ||
1353 | // PrincipalArn is a required field | ||
1354 | PrincipalArn *string `min:"20" type:"string" required:"true"` | ||
1355 | |||
1356 | // The Amazon Resource Name (ARN) of the role that the caller is assuming. | ||
1357 | // | ||
1358 | // RoleArn is a required field | ||
1359 | RoleArn *string `min:"20" type:"string" required:"true"` | ||
1360 | |||
1361 | // The base-64 encoded SAML authentication response provided by the IdP. | ||
1362 | // | ||
1363 | // For more information, see Configuring a Relying Party and Adding Claims (http://docs.aws.amazon.com/IAM/latest/UserGuide/create-role-saml-IdP-tasks.html) | ||
1364 | // in the Using IAM guide. | ||
1365 | // | ||
1366 | // SAMLAssertion is a required field | ||
1367 | SAMLAssertion *string `min:"4" type:"string" required:"true"` | ||
1368 | } | ||
1369 | |||
1370 | // String returns the string representation | ||
1371 | func (s AssumeRoleWithSAMLInput) String() string { | ||
1372 | return awsutil.Prettify(s) | ||
1373 | } | ||
1374 | |||
1375 | // GoString returns the string representation | ||
1376 | func (s AssumeRoleWithSAMLInput) GoString() string { | ||
1377 | return s.String() | ||
1378 | } | ||
1379 | |||
1380 | // Validate inspects the fields of the type to determine if they are valid. | ||
1381 | func (s *AssumeRoleWithSAMLInput) Validate() error { | ||
1382 | invalidParams := request.ErrInvalidParams{Context: "AssumeRoleWithSAMLInput"} | ||
1383 | if s.DurationSeconds != nil && *s.DurationSeconds < 900 { | ||
1384 | invalidParams.Add(request.NewErrParamMinValue("DurationSeconds", 900)) | ||
1385 | } | ||
1386 | if s.Policy != nil && len(*s.Policy) < 1 { | ||
1387 | invalidParams.Add(request.NewErrParamMinLen("Policy", 1)) | ||
1388 | } | ||
1389 | if s.PrincipalArn == nil { | ||
1390 | invalidParams.Add(request.NewErrParamRequired("PrincipalArn")) | ||
1391 | } | ||
1392 | if s.PrincipalArn != nil && len(*s.PrincipalArn) < 20 { | ||
1393 | invalidParams.Add(request.NewErrParamMinLen("PrincipalArn", 20)) | ||
1394 | } | ||
1395 | if s.RoleArn == nil { | ||
1396 | invalidParams.Add(request.NewErrParamRequired("RoleArn")) | ||
1397 | } | ||
1398 | if s.RoleArn != nil && len(*s.RoleArn) < 20 { | ||
1399 | invalidParams.Add(request.NewErrParamMinLen("RoleArn", 20)) | ||
1400 | } | ||
1401 | if s.SAMLAssertion == nil { | ||
1402 | invalidParams.Add(request.NewErrParamRequired("SAMLAssertion")) | ||
1403 | } | ||
1404 | if s.SAMLAssertion != nil && len(*s.SAMLAssertion) < 4 { | ||
1405 | invalidParams.Add(request.NewErrParamMinLen("SAMLAssertion", 4)) | ||
1406 | } | ||
1407 | |||
1408 | if invalidParams.Len() > 0 { | ||
1409 | return invalidParams | ||
1410 | } | ||
1411 | return nil | ||
1412 | } | ||
1413 | |||
1414 | // SetDurationSeconds sets the DurationSeconds field's value. | ||
1415 | func (s *AssumeRoleWithSAMLInput) SetDurationSeconds(v int64) *AssumeRoleWithSAMLInput { | ||
1416 | s.DurationSeconds = &v | ||
1417 | return s | ||
1418 | } | ||
1419 | |||
1420 | // SetPolicy sets the Policy field's value. | ||
1421 | func (s *AssumeRoleWithSAMLInput) SetPolicy(v string) *AssumeRoleWithSAMLInput { | ||
1422 | s.Policy = &v | ||
1423 | return s | ||
1424 | } | ||
1425 | |||
1426 | // SetPrincipalArn sets the PrincipalArn field's value. | ||
1427 | func (s *AssumeRoleWithSAMLInput) SetPrincipalArn(v string) *AssumeRoleWithSAMLInput { | ||
1428 | s.PrincipalArn = &v | ||
1429 | return s | ||
1430 | } | ||
1431 | |||
1432 | // SetRoleArn sets the RoleArn field's value. | ||
1433 | func (s *AssumeRoleWithSAMLInput) SetRoleArn(v string) *AssumeRoleWithSAMLInput { | ||
1434 | s.RoleArn = &v | ||
1435 | return s | ||
1436 | } | ||
1437 | |||
1438 | // SetSAMLAssertion sets the SAMLAssertion field's value. | ||
1439 | func (s *AssumeRoleWithSAMLInput) SetSAMLAssertion(v string) *AssumeRoleWithSAMLInput { | ||
1440 | s.SAMLAssertion = &v | ||
1441 | return s | ||
1442 | } | ||
1443 | |||
1444 | // Contains the response to a successful AssumeRoleWithSAML request, including | ||
1445 | // temporary AWS credentials that can be used to make AWS requests. | ||
1446 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithSAMLResponse | ||
1447 | type AssumeRoleWithSAMLOutput struct { | ||
1448 | _ struct{} `type:"structure"` | ||
1449 | |||
1450 | // The identifiers for the temporary security credentials that the operation | ||
1451 | // returns. | ||
1452 | AssumedRoleUser *AssumedRoleUser `type:"structure"` | ||
1453 | |||
1454 | // The value of the Recipient attribute of the SubjectConfirmationData element | ||
1455 | // of the SAML assertion. | ||
1456 | Audience *string `type:"string"` | ||
1457 | |||
1458 | // The temporary security credentials, which include an access key ID, a secret | ||
1459 | // access key, and a security (or session) token. | ||
1460 | // | ||
1461 | // Note: The size of the security token that STS APIs return is not fixed. We | ||
1462 | // strongly recommend that you make no assumptions about the maximum size. As | ||
1463 | // of this writing, the typical size is less than 4096 bytes, but that can vary. | ||
1464 | // Also, future updates to AWS might require larger sizes. | ||
1465 | Credentials *Credentials `type:"structure"` | ||
1466 | |||
1467 | // The value of the Issuer element of the SAML assertion. | ||
1468 | Issuer *string `type:"string"` | ||
1469 | |||
1470 | // A hash value based on the concatenation of the Issuer response value, the | ||
1471 | // AWS account ID, and the friendly name (the last part of the ARN) of the SAML | ||
1472 | // provider in IAM. The combination of NameQualifier and Subject can be used | ||
1473 | // to uniquely identify a federated user. | ||
1474 | // | ||
1475 | // The following pseudocode shows how the hash value is calculated: | ||
1476 | // | ||
1477 | // BASE64 ( SHA1 ( "https://example.com/saml" + "123456789012" + "/MySAMLIdP" | ||
1478 | // ) ) | ||
1479 | NameQualifier *string `type:"string"` | ||
1480 | |||
1481 | // A percentage value that indicates the size of the policy in packed form. | ||
1482 | // The service rejects any policy with a packed size greater than 100 percent, | ||
1483 | // which means the policy exceeded the allowed space. | ||
1484 | PackedPolicySize *int64 `type:"integer"` | ||
1485 | |||
1486 | // The value of the NameID element in the Subject element of the SAML assertion. | ||
1487 | Subject *string `type:"string"` | ||
1488 | |||
1489 | // The format of the name ID, as defined by the Format attribute in the NameID | ||
1490 | // element of the SAML assertion. Typical examples of the format are transient | ||
1491 | // or persistent. | ||
1492 | // | ||
1493 | // If the format includes the prefix urn:oasis:names:tc:SAML:2.0:nameid-format, | ||
1494 | // that prefix is removed. For example, urn:oasis:names:tc:SAML:2.0:nameid-format:transient | ||
1495 | // is returned as transient. If the format includes any other prefix, the format | ||
1496 | // is returned with no modifications. | ||
1497 | SubjectType *string `type:"string"` | ||
1498 | } | ||
1499 | |||
1500 | // String returns the string representation | ||
1501 | func (s AssumeRoleWithSAMLOutput) String() string { | ||
1502 | return awsutil.Prettify(s) | ||
1503 | } | ||
1504 | |||
1505 | // GoString returns the string representation | ||
1506 | func (s AssumeRoleWithSAMLOutput) GoString() string { | ||
1507 | return s.String() | ||
1508 | } | ||
1509 | |||
1510 | // SetAssumedRoleUser sets the AssumedRoleUser field's value. | ||
1511 | func (s *AssumeRoleWithSAMLOutput) SetAssumedRoleUser(v *AssumedRoleUser) *AssumeRoleWithSAMLOutput { | ||
1512 | s.AssumedRoleUser = v | ||
1513 | return s | ||
1514 | } | ||
1515 | |||
1516 | // SetAudience sets the Audience field's value. | ||
1517 | func (s *AssumeRoleWithSAMLOutput) SetAudience(v string) *AssumeRoleWithSAMLOutput { | ||
1518 | s.Audience = &v | ||
1519 | return s | ||
1520 | } | ||
1521 | |||
1522 | // SetCredentials sets the Credentials field's value. | ||
1523 | func (s *AssumeRoleWithSAMLOutput) SetCredentials(v *Credentials) *AssumeRoleWithSAMLOutput { | ||
1524 | s.Credentials = v | ||
1525 | return s | ||
1526 | } | ||
1527 | |||
1528 | // SetIssuer sets the Issuer field's value. | ||
1529 | func (s *AssumeRoleWithSAMLOutput) SetIssuer(v string) *AssumeRoleWithSAMLOutput { | ||
1530 | s.Issuer = &v | ||
1531 | return s | ||
1532 | } | ||
1533 | |||
1534 | // SetNameQualifier sets the NameQualifier field's value. | ||
1535 | func (s *AssumeRoleWithSAMLOutput) SetNameQualifier(v string) *AssumeRoleWithSAMLOutput { | ||
1536 | s.NameQualifier = &v | ||
1537 | return s | ||
1538 | } | ||
1539 | |||
1540 | // SetPackedPolicySize sets the PackedPolicySize field's value. | ||
1541 | func (s *AssumeRoleWithSAMLOutput) SetPackedPolicySize(v int64) *AssumeRoleWithSAMLOutput { | ||
1542 | s.PackedPolicySize = &v | ||
1543 | return s | ||
1544 | } | ||
1545 | |||
1546 | // SetSubject sets the Subject field's value. | ||
1547 | func (s *AssumeRoleWithSAMLOutput) SetSubject(v string) *AssumeRoleWithSAMLOutput { | ||
1548 | s.Subject = &v | ||
1549 | return s | ||
1550 | } | ||
1551 | |||
1552 | // SetSubjectType sets the SubjectType field's value. | ||
1553 | func (s *AssumeRoleWithSAMLOutput) SetSubjectType(v string) *AssumeRoleWithSAMLOutput { | ||
1554 | s.SubjectType = &v | ||
1555 | return s | ||
1556 | } | ||
1557 | |||
1558 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithWebIdentityRequest | ||
1559 | type AssumeRoleWithWebIdentityInput struct { | ||
1560 | _ struct{} `type:"structure"` | ||
1561 | |||
1562 | // The duration, in seconds, of the role session. The value can range from 900 | ||
1563 | // seconds (15 minutes) to 3600 seconds (1 hour). By default, the value is set | ||
1564 | // to 3600 seconds. | ||
1565 | // | ||
1566 | // This is separate from the duration of a console session that you might request | ||
1567 | // using the returned credentials. The request to the federation endpoint for | ||
1568 | // a console sign-in token takes a SessionDuration parameter that specifies | ||
1569 | // the maximum length of the console session, separately from the DurationSeconds | ||
1570 | // parameter on this API. For more information, see Creating a URL that Enables | ||
1571 | // Federated Users to Access the AWS Management Console (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html) | ||
1572 | // in the IAM User Guide. | ||
1573 | DurationSeconds *int64 `min:"900" type:"integer"` | ||
1574 | |||
1575 | // An IAM policy in JSON format. | ||
1576 | // | ||
1577 | // The policy parameter is optional. If you pass a policy, the temporary security | ||
1578 | // credentials that are returned by the operation have the permissions that | ||
1579 | // are allowed by both the access policy of the role that is being assumed, | ||
1580 | // and the policy that you pass. This gives you a way to further restrict the | ||
1581 | // permissions for the resulting temporary security credentials. You cannot | ||
1582 | // use the passed policy to grant permissions that are in excess of those allowed | ||
1583 | // by the access policy of the role that is being assumed. For more information, | ||
1584 | // see Permissions for AssumeRoleWithWebIdentity (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html) | ||
1585 | // in the IAM User Guide. | ||
1586 | // | ||
1587 | // The format for this parameter, as described by its regex pattern, is a string | ||
1588 | // of characters up to 2048 characters in length. The characters can be any | ||
1589 | // ASCII character from the space character to the end of the valid character | ||
1590 | // list (\u0020-\u00FF). It can also include the tab (\u0009), linefeed (\u000A), | ||
1591 | // and carriage return (\u000D) characters. | ||
1592 | // | ||
1593 | // The policy plain text must be 2048 bytes or shorter. However, an internal | ||
1594 | // conversion compresses it into a packed binary format with a separate limit. | ||
1595 | // The PackedPolicySize response element indicates by percentage how close to | ||
1596 | // the upper size limit the policy is, with 100% equaling the maximum allowed | ||
1597 | // size. | ||
1598 | Policy *string `min:"1" type:"string"` | ||
1599 | |||
1600 | // The fully qualified host component of the domain name of the identity provider. | ||
1601 | // | ||
1602 | // Specify this value only for OAuth 2.0 access tokens. Currently www.amazon.com | ||
1603 | // and graph.facebook.com are the only supported identity providers for OAuth | ||
1604 | // 2.0 access tokens. Do not include URL schemes and port numbers. | ||
1605 | // | ||
1606 | // Do not specify this value for OpenID Connect ID tokens. | ||
1607 | ProviderId *string `min:"4" type:"string"` | ||
1608 | |||
1609 | // The Amazon Resource Name (ARN) of the role that the caller is assuming. | ||
1610 | // | ||
1611 | // RoleArn is a required field | ||
1612 | RoleArn *string `min:"20" type:"string" required:"true"` | ||
1613 | |||
1614 | // An identifier for the assumed role session. Typically, you pass the name | ||
1615 | // or identifier that is associated with the user who is using your application. | ||
1616 | // That way, the temporary security credentials that your application will use | ||
1617 | // are associated with that user. This session name is included as part of the | ||
1618 | // ARN and assumed role ID in the AssumedRoleUser response element. | ||
1619 | // | ||
1620 | // The regex used to validate this parameter is a string of characters consisting | ||
1621 | // of upper- and lower-case alphanumeric characters with no spaces. You can | ||
1622 | // also include underscores or any of the following characters: =,.@- | ||
1623 | // | ||
1624 | // RoleSessionName is a required field | ||
1625 | RoleSessionName *string `min:"2" type:"string" required:"true"` | ||
1626 | |||
1627 | // The OAuth 2.0 access token or OpenID Connect ID token that is provided by | ||
1628 | // the identity provider. Your application must get this token by authenticating | ||
1629 | // the user who is using your application with a web identity provider before | ||
1630 | // the application makes an AssumeRoleWithWebIdentity call. | ||
1631 | // | ||
1632 | // WebIdentityToken is a required field | ||
1633 | WebIdentityToken *string `min:"4" type:"string" required:"true"` | ||
1634 | } | ||
1635 | |||
1636 | // String returns the string representation | ||
1637 | func (s AssumeRoleWithWebIdentityInput) String() string { | ||
1638 | return awsutil.Prettify(s) | ||
1639 | } | ||
1640 | |||
1641 | // GoString returns the string representation | ||
1642 | func (s AssumeRoleWithWebIdentityInput) GoString() string { | ||
1643 | return s.String() | ||
1644 | } | ||
1645 | |||
1646 | // Validate inspects the fields of the type to determine if they are valid. | ||
1647 | func (s *AssumeRoleWithWebIdentityInput) Validate() error { | ||
1648 | invalidParams := request.ErrInvalidParams{Context: "AssumeRoleWithWebIdentityInput"} | ||
1649 | if s.DurationSeconds != nil && *s.DurationSeconds < 900 { | ||
1650 | invalidParams.Add(request.NewErrParamMinValue("DurationSeconds", 900)) | ||
1651 | } | ||
1652 | if s.Policy != nil && len(*s.Policy) < 1 { | ||
1653 | invalidParams.Add(request.NewErrParamMinLen("Policy", 1)) | ||
1654 | } | ||
1655 | if s.ProviderId != nil && len(*s.ProviderId) < 4 { | ||
1656 | invalidParams.Add(request.NewErrParamMinLen("ProviderId", 4)) | ||
1657 | } | ||
1658 | if s.RoleArn == nil { | ||
1659 | invalidParams.Add(request.NewErrParamRequired("RoleArn")) | ||
1660 | } | ||
1661 | if s.RoleArn != nil && len(*s.RoleArn) < 20 { | ||
1662 | invalidParams.Add(request.NewErrParamMinLen("RoleArn", 20)) | ||
1663 | } | ||
1664 | if s.RoleSessionName == nil { | ||
1665 | invalidParams.Add(request.NewErrParamRequired("RoleSessionName")) | ||
1666 | } | ||
1667 | if s.RoleSessionName != nil && len(*s.RoleSessionName) < 2 { | ||
1668 | invalidParams.Add(request.NewErrParamMinLen("RoleSessionName", 2)) | ||
1669 | } | ||
1670 | if s.WebIdentityToken == nil { | ||
1671 | invalidParams.Add(request.NewErrParamRequired("WebIdentityToken")) | ||
1672 | } | ||
1673 | if s.WebIdentityToken != nil && len(*s.WebIdentityToken) < 4 { | ||
1674 | invalidParams.Add(request.NewErrParamMinLen("WebIdentityToken", 4)) | ||
1675 | } | ||
1676 | |||
1677 | if invalidParams.Len() > 0 { | ||
1678 | return invalidParams | ||
1679 | } | ||
1680 | return nil | ||
1681 | } | ||
1682 | |||
1683 | // SetDurationSeconds sets the DurationSeconds field's value. | ||
1684 | func (s *AssumeRoleWithWebIdentityInput) SetDurationSeconds(v int64) *AssumeRoleWithWebIdentityInput { | ||
1685 | s.DurationSeconds = &v | ||
1686 | return s | ||
1687 | } | ||
1688 | |||
1689 | // SetPolicy sets the Policy field's value. | ||
1690 | func (s *AssumeRoleWithWebIdentityInput) SetPolicy(v string) *AssumeRoleWithWebIdentityInput { | ||
1691 | s.Policy = &v | ||
1692 | return s | ||
1693 | } | ||
1694 | |||
1695 | // SetProviderId sets the ProviderId field's value. | ||
1696 | func (s *AssumeRoleWithWebIdentityInput) SetProviderId(v string) *AssumeRoleWithWebIdentityInput { | ||
1697 | s.ProviderId = &v | ||
1698 | return s | ||
1699 | } | ||
1700 | |||
1701 | // SetRoleArn sets the RoleArn field's value. | ||
1702 | func (s *AssumeRoleWithWebIdentityInput) SetRoleArn(v string) *AssumeRoleWithWebIdentityInput { | ||
1703 | s.RoleArn = &v | ||
1704 | return s | ||
1705 | } | ||
1706 | |||
1707 | // SetRoleSessionName sets the RoleSessionName field's value. | ||
1708 | func (s *AssumeRoleWithWebIdentityInput) SetRoleSessionName(v string) *AssumeRoleWithWebIdentityInput { | ||
1709 | s.RoleSessionName = &v | ||
1710 | return s | ||
1711 | } | ||
1712 | |||
1713 | // SetWebIdentityToken sets the WebIdentityToken field's value. | ||
1714 | func (s *AssumeRoleWithWebIdentityInput) SetWebIdentityToken(v string) *AssumeRoleWithWebIdentityInput { | ||
1715 | s.WebIdentityToken = &v | ||
1716 | return s | ||
1717 | } | ||
1718 | |||
1719 | // Contains the response to a successful AssumeRoleWithWebIdentity request, | ||
1720 | // including temporary AWS credentials that can be used to make AWS requests. | ||
1721 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithWebIdentityResponse | ||
1722 | type AssumeRoleWithWebIdentityOutput struct { | ||
1723 | _ struct{} `type:"structure"` | ||
1724 | |||
1725 | // The Amazon Resource Name (ARN) and the assumed role ID, which are identifiers | ||
1726 | // that you can use to refer to the resulting temporary security credentials. | ||
1727 | // For example, you can reference these credentials as a principal in a resource-based | ||
1728 | // policy by using the ARN or assumed role ID. The ARN and ID include the RoleSessionName | ||
1729 | // that you specified when you called AssumeRole. | ||
1730 | AssumedRoleUser *AssumedRoleUser `type:"structure"` | ||
1731 | |||
1732 | // The intended audience (also known as client ID) of the web identity token. | ||
1733 | // This is traditionally the client identifier issued to the application that | ||
1734 | // requested the web identity token. | ||
1735 | Audience *string `type:"string"` | ||
1736 | |||
1737 | // The temporary security credentials, which include an access key ID, a secret | ||
1738 | // access key, and a security token. | ||
1739 | // | ||
1740 | // Note: The size of the security token that STS APIs return is not fixed. We | ||
1741 | // strongly recommend that you make no assumptions about the maximum size. As | ||
1742 | // of this writing, the typical size is less than 4096 bytes, but that can vary. | ||
1743 | // Also, future updates to AWS might require larger sizes. | ||
1744 | Credentials *Credentials `type:"structure"` | ||
1745 | |||
1746 | // A percentage value that indicates the size of the policy in packed form. | ||
1747 | // The service rejects any policy with a packed size greater than 100 percent, | ||
1748 | // which means the policy exceeded the allowed space. | ||
1749 | PackedPolicySize *int64 `type:"integer"` | ||
1750 | |||
1751 | // The issuing authority of the web identity token presented. For OpenID Connect | ||
1752 | // ID Tokens this contains the value of the iss field. For OAuth 2.0 access | ||
1753 | // tokens, this contains the value of the ProviderId parameter that was passed | ||
1754 | // in the AssumeRoleWithWebIdentity request. | ||
1755 | Provider *string `type:"string"` | ||
1756 | |||
1757 | // The unique user identifier that is returned by the identity provider. This | ||
1758 | // identifier is associated with the WebIdentityToken that was submitted with | ||
1759 | // the AssumeRoleWithWebIdentity call. The identifier is typically unique to | ||
1760 | // the user and the application that acquired the WebIdentityToken (pairwise | ||
1761 | // identifier). For OpenID Connect ID tokens, this field contains the value | ||
1762 | // returned by the identity provider as the token's sub (Subject) claim. | ||
1763 | SubjectFromWebIdentityToken *string `min:"6" type:"string"` | ||
1764 | } | ||
1765 | |||
1766 | // String returns the string representation | ||
1767 | func (s AssumeRoleWithWebIdentityOutput) String() string { | ||
1768 | return awsutil.Prettify(s) | ||
1769 | } | ||
1770 | |||
1771 | // GoString returns the string representation | ||
1772 | func (s AssumeRoleWithWebIdentityOutput) GoString() string { | ||
1773 | return s.String() | ||
1774 | } | ||
1775 | |||
1776 | // SetAssumedRoleUser sets the AssumedRoleUser field's value. | ||
1777 | func (s *AssumeRoleWithWebIdentityOutput) SetAssumedRoleUser(v *AssumedRoleUser) *AssumeRoleWithWebIdentityOutput { | ||
1778 | s.AssumedRoleUser = v | ||
1779 | return s | ||
1780 | } | ||
1781 | |||
1782 | // SetAudience sets the Audience field's value. | ||
1783 | func (s *AssumeRoleWithWebIdentityOutput) SetAudience(v string) *AssumeRoleWithWebIdentityOutput { | ||
1784 | s.Audience = &v | ||
1785 | return s | ||
1786 | } | ||
1787 | |||
1788 | // SetCredentials sets the Credentials field's value. | ||
1789 | func (s *AssumeRoleWithWebIdentityOutput) SetCredentials(v *Credentials) *AssumeRoleWithWebIdentityOutput { | ||
1790 | s.Credentials = v | ||
1791 | return s | ||
1792 | } | ||
1793 | |||
1794 | // SetPackedPolicySize sets the PackedPolicySize field's value. | ||
1795 | func (s *AssumeRoleWithWebIdentityOutput) SetPackedPolicySize(v int64) *AssumeRoleWithWebIdentityOutput { | ||
1796 | s.PackedPolicySize = &v | ||
1797 | return s | ||
1798 | } | ||
1799 | |||
1800 | // SetProvider sets the Provider field's value. | ||
1801 | func (s *AssumeRoleWithWebIdentityOutput) SetProvider(v string) *AssumeRoleWithWebIdentityOutput { | ||
1802 | s.Provider = &v | ||
1803 | return s | ||
1804 | } | ||
1805 | |||
1806 | // SetSubjectFromWebIdentityToken sets the SubjectFromWebIdentityToken field's value. | ||
1807 | func (s *AssumeRoleWithWebIdentityOutput) SetSubjectFromWebIdentityToken(v string) *AssumeRoleWithWebIdentityOutput { | ||
1808 | s.SubjectFromWebIdentityToken = &v | ||
1809 | return s | ||
1810 | } | ||
1811 | |||
1812 | // The identifiers for the temporary security credentials that the operation | ||
1813 | // returns. | ||
1814 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumedRoleUser | ||
1815 | type AssumedRoleUser struct { | ||
1816 | _ struct{} `type:"structure"` | ||
1817 | |||
1818 | // The ARN of the temporary security credentials that are returned from the | ||
1819 | // AssumeRole action. For more information about ARNs and how to use them in | ||
1820 | // policies, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) | ||
1821 | // in Using IAM. | ||
1822 | // | ||
1823 | // Arn is a required field | ||
1824 | Arn *string `min:"20" type:"string" required:"true"` | ||
1825 | |||
1826 | // A unique identifier that contains the role ID and the role session name of | ||
1827 | // the role that is being assumed. The role ID is generated by AWS when the | ||
1828 | // role is created. | ||
1829 | // | ||
1830 | // AssumedRoleId is a required field | ||
1831 | AssumedRoleId *string `min:"2" type:"string" required:"true"` | ||
1832 | } | ||
1833 | |||
1834 | // String returns the string representation | ||
1835 | func (s AssumedRoleUser) String() string { | ||
1836 | return awsutil.Prettify(s) | ||
1837 | } | ||
1838 | |||
1839 | // GoString returns the string representation | ||
1840 | func (s AssumedRoleUser) GoString() string { | ||
1841 | return s.String() | ||
1842 | } | ||
1843 | |||
1844 | // SetArn sets the Arn field's value. | ||
1845 | func (s *AssumedRoleUser) SetArn(v string) *AssumedRoleUser { | ||
1846 | s.Arn = &v | ||
1847 | return s | ||
1848 | } | ||
1849 | |||
1850 | // SetAssumedRoleId sets the AssumedRoleId field's value. | ||
1851 | func (s *AssumedRoleUser) SetAssumedRoleId(v string) *AssumedRoleUser { | ||
1852 | s.AssumedRoleId = &v | ||
1853 | return s | ||
1854 | } | ||
1855 | |||
1856 | // AWS credentials for API authentication. | ||
1857 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/Credentials | ||
1858 | type Credentials struct { | ||
1859 | _ struct{} `type:"structure"` | ||
1860 | |||
1861 | // The access key ID that identifies the temporary security credentials. | ||
1862 | // | ||
1863 | // AccessKeyId is a required field | ||
1864 | AccessKeyId *string `min:"16" type:"string" required:"true"` | ||
1865 | |||
1866 | // The date on which the current credentials expire. | ||
1867 | // | ||
1868 | // Expiration is a required field | ||
1869 | Expiration *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` | ||
1870 | |||
1871 | // The secret access key that can be used to sign requests. | ||
1872 | // | ||
1873 | // SecretAccessKey is a required field | ||
1874 | SecretAccessKey *string `type:"string" required:"true"` | ||
1875 | |||
1876 | // The token that users must pass to the service API to use the temporary credentials. | ||
1877 | // | ||
1878 | // SessionToken is a required field | ||
1879 | SessionToken *string `type:"string" required:"true"` | ||
1880 | } | ||
1881 | |||
1882 | // String returns the string representation | ||
1883 | func (s Credentials) String() string { | ||
1884 | return awsutil.Prettify(s) | ||
1885 | } | ||
1886 | |||
1887 | // GoString returns the string representation | ||
1888 | func (s Credentials) GoString() string { | ||
1889 | return s.String() | ||
1890 | } | ||
1891 | |||
1892 | // SetAccessKeyId sets the AccessKeyId field's value. | ||
1893 | func (s *Credentials) SetAccessKeyId(v string) *Credentials { | ||
1894 | s.AccessKeyId = &v | ||
1895 | return s | ||
1896 | } | ||
1897 | |||
1898 | // SetExpiration sets the Expiration field's value. | ||
1899 | func (s *Credentials) SetExpiration(v time.Time) *Credentials { | ||
1900 | s.Expiration = &v | ||
1901 | return s | ||
1902 | } | ||
1903 | |||
1904 | // SetSecretAccessKey sets the SecretAccessKey field's value. | ||
1905 | func (s *Credentials) SetSecretAccessKey(v string) *Credentials { | ||
1906 | s.SecretAccessKey = &v | ||
1907 | return s | ||
1908 | } | ||
1909 | |||
1910 | // SetSessionToken sets the SessionToken field's value. | ||
1911 | func (s *Credentials) SetSessionToken(v string) *Credentials { | ||
1912 | s.SessionToken = &v | ||
1913 | return s | ||
1914 | } | ||
1915 | |||
1916 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/DecodeAuthorizationMessageRequest | ||
1917 | type DecodeAuthorizationMessageInput struct { | ||
1918 | _ struct{} `type:"structure"` | ||
1919 | |||
1920 | // The encoded message that was returned with the response. | ||
1921 | // | ||
1922 | // EncodedMessage is a required field | ||
1923 | EncodedMessage *string `min:"1" type:"string" required:"true"` | ||
1924 | } | ||
1925 | |||
1926 | // String returns the string representation | ||
1927 | func (s DecodeAuthorizationMessageInput) String() string { | ||
1928 | return awsutil.Prettify(s) | ||
1929 | } | ||
1930 | |||
1931 | // GoString returns the string representation | ||
1932 | func (s DecodeAuthorizationMessageInput) GoString() string { | ||
1933 | return s.String() | ||
1934 | } | ||
1935 | |||
1936 | // Validate inspects the fields of the type to determine if they are valid. | ||
1937 | func (s *DecodeAuthorizationMessageInput) Validate() error { | ||
1938 | invalidParams := request.ErrInvalidParams{Context: "DecodeAuthorizationMessageInput"} | ||
1939 | if s.EncodedMessage == nil { | ||
1940 | invalidParams.Add(request.NewErrParamRequired("EncodedMessage")) | ||
1941 | } | ||
1942 | if s.EncodedMessage != nil && len(*s.EncodedMessage) < 1 { | ||
1943 | invalidParams.Add(request.NewErrParamMinLen("EncodedMessage", 1)) | ||
1944 | } | ||
1945 | |||
1946 | if invalidParams.Len() > 0 { | ||
1947 | return invalidParams | ||
1948 | } | ||
1949 | return nil | ||
1950 | } | ||
1951 | |||
1952 | // SetEncodedMessage sets the EncodedMessage field's value. | ||
1953 | func (s *DecodeAuthorizationMessageInput) SetEncodedMessage(v string) *DecodeAuthorizationMessageInput { | ||
1954 | s.EncodedMessage = &v | ||
1955 | return s | ||
1956 | } | ||
1957 | |||
1958 | // A document that contains additional information about the authorization status | ||
1959 | // of a request from an encoded message that is returned in response to an AWS | ||
1960 | // request. | ||
1961 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/DecodeAuthorizationMessageResponse | ||
1962 | type DecodeAuthorizationMessageOutput struct { | ||
1963 | _ struct{} `type:"structure"` | ||
1964 | |||
1965 | // An XML document that contains the decoded message. | ||
1966 | DecodedMessage *string `type:"string"` | ||
1967 | } | ||
1968 | |||
1969 | // String returns the string representation | ||
1970 | func (s DecodeAuthorizationMessageOutput) String() string { | ||
1971 | return awsutil.Prettify(s) | ||
1972 | } | ||
1973 | |||
1974 | // GoString returns the string representation | ||
1975 | func (s DecodeAuthorizationMessageOutput) GoString() string { | ||
1976 | return s.String() | ||
1977 | } | ||
1978 | |||
1979 | // SetDecodedMessage sets the DecodedMessage field's value. | ||
1980 | func (s *DecodeAuthorizationMessageOutput) SetDecodedMessage(v string) *DecodeAuthorizationMessageOutput { | ||
1981 | s.DecodedMessage = &v | ||
1982 | return s | ||
1983 | } | ||
1984 | |||
1985 | // Identifiers for the federated user that is associated with the credentials. | ||
1986 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/FederatedUser | ||
1987 | type FederatedUser struct { | ||
1988 | _ struct{} `type:"structure"` | ||
1989 | |||
1990 | // The ARN that specifies the federated user that is associated with the credentials. | ||
1991 | // For more information about ARNs and how to use them in policies, see IAM | ||
1992 | // Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) | ||
1993 | // in Using IAM. | ||
1994 | // | ||
1995 | // Arn is a required field | ||
1996 | Arn *string `min:"20" type:"string" required:"true"` | ||
1997 | |||
1998 | // The string that identifies the federated user associated with the credentials, | ||
1999 | // similar to the unique ID of an IAM user. | ||
2000 | // | ||
2001 | // FederatedUserId is a required field | ||
2002 | FederatedUserId *string `min:"2" type:"string" required:"true"` | ||
2003 | } | ||
2004 | |||
2005 | // String returns the string representation | ||
2006 | func (s FederatedUser) String() string { | ||
2007 | return awsutil.Prettify(s) | ||
2008 | } | ||
2009 | |||
2010 | // GoString returns the string representation | ||
2011 | func (s FederatedUser) GoString() string { | ||
2012 | return s.String() | ||
2013 | } | ||
2014 | |||
2015 | // SetArn sets the Arn field's value. | ||
2016 | func (s *FederatedUser) SetArn(v string) *FederatedUser { | ||
2017 | s.Arn = &v | ||
2018 | return s | ||
2019 | } | ||
2020 | |||
2021 | // SetFederatedUserId sets the FederatedUserId field's value. | ||
2022 | func (s *FederatedUser) SetFederatedUserId(v string) *FederatedUser { | ||
2023 | s.FederatedUserId = &v | ||
2024 | return s | ||
2025 | } | ||
2026 | |||
2027 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetCallerIdentityRequest | ||
2028 | type GetCallerIdentityInput struct { | ||
2029 | _ struct{} `type:"structure"` | ||
2030 | } | ||
2031 | |||
2032 | // String returns the string representation | ||
2033 | func (s GetCallerIdentityInput) String() string { | ||
2034 | return awsutil.Prettify(s) | ||
2035 | } | ||
2036 | |||
2037 | // GoString returns the string representation | ||
2038 | func (s GetCallerIdentityInput) GoString() string { | ||
2039 | return s.String() | ||
2040 | } | ||
2041 | |||
2042 | // Contains the response to a successful GetCallerIdentity request, including | ||
2043 | // information about the entity making the request. | ||
2044 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetCallerIdentityResponse | ||
2045 | type GetCallerIdentityOutput struct { | ||
2046 | _ struct{} `type:"structure"` | ||
2047 | |||
2048 | // The AWS account ID number of the account that owns or contains the calling | ||
2049 | // entity. | ||
2050 | Account *string `type:"string"` | ||
2051 | |||
2052 | // The AWS ARN associated with the calling entity. | ||
2053 | Arn *string `min:"20" type:"string"` | ||
2054 | |||
2055 | // The unique identifier of the calling entity. The exact value depends on the | ||
2056 | // type of entity making the call. The values returned are those listed in the | ||
2057 | // aws:userid column in the Principal table (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable) | ||
2058 | // found on the Policy Variables reference page in the IAM User Guide. | ||
2059 | UserId *string `type:"string"` | ||
2060 | } | ||
2061 | |||
2062 | // String returns the string representation | ||
2063 | func (s GetCallerIdentityOutput) String() string { | ||
2064 | return awsutil.Prettify(s) | ||
2065 | } | ||
2066 | |||
2067 | // GoString returns the string representation | ||
2068 | func (s GetCallerIdentityOutput) GoString() string { | ||
2069 | return s.String() | ||
2070 | } | ||
2071 | |||
2072 | // SetAccount sets the Account field's value. | ||
2073 | func (s *GetCallerIdentityOutput) SetAccount(v string) *GetCallerIdentityOutput { | ||
2074 | s.Account = &v | ||
2075 | return s | ||
2076 | } | ||
2077 | |||
2078 | // SetArn sets the Arn field's value. | ||
2079 | func (s *GetCallerIdentityOutput) SetArn(v string) *GetCallerIdentityOutput { | ||
2080 | s.Arn = &v | ||
2081 | return s | ||
2082 | } | ||
2083 | |||
2084 | // SetUserId sets the UserId field's value. | ||
2085 | func (s *GetCallerIdentityOutput) SetUserId(v string) *GetCallerIdentityOutput { | ||
2086 | s.UserId = &v | ||
2087 | return s | ||
2088 | } | ||
2089 | |||
2090 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetFederationTokenRequest | ||
2091 | type GetFederationTokenInput struct { | ||
2092 | _ struct{} `type:"structure"` | ||
2093 | |||
2094 | // The duration, in seconds, that the session should last. Acceptable durations | ||
2095 | // for federation sessions range from 900 seconds (15 minutes) to 129600 seconds | ||
2096 | // (36 hours), with 43200 seconds (12 hours) as the default. Sessions obtained | ||
2097 | // using AWS account (root) credentials are restricted to a maximum of 3600 | ||
2098 | // seconds (one hour). If the specified duration is longer than one hour, the | ||
2099 | // session obtained by using AWS account (root) credentials defaults to one | ||
2100 | // hour. | ||
2101 | DurationSeconds *int64 `min:"900" type:"integer"` | ||
2102 | |||
2103 | // The name of the federated user. The name is used as an identifier for the | ||
2104 | // temporary security credentials (such as Bob). For example, you can reference | ||
2105 | // the federated user name in a resource-based policy, such as in an Amazon | ||
2106 | // S3 bucket policy. | ||
2107 | // | ||
2108 | // The regex used to validate this parameter is a string of characters consisting | ||
2109 | // of upper- and lower-case alphanumeric characters with no spaces. You can | ||
2110 | // also include underscores or any of the following characters: =,.@- | ||
2111 | // | ||
2112 | // Name is a required field | ||
2113 | Name *string `min:"2" type:"string" required:"true"` | ||
2114 | |||
2115 | // An IAM policy in JSON format that is passed with the GetFederationToken call | ||
2116 | // and evaluated along with the policy or policies that are attached to the | ||
2117 | // IAM user whose credentials are used to call GetFederationToken. The passed | ||
2118 | // policy is used to scope down the permissions that are available to the IAM | ||
2119 | // user, by allowing only a subset of the permissions that are granted to the | ||
2120 | // IAM user. The passed policy cannot grant more permissions than those granted | ||
2121 | // to the IAM user. The final permissions for the federated user are the most | ||
2122 | // restrictive set based on the intersection of the passed policy and the IAM | ||
2123 | // user policy. | ||
2124 | // | ||
2125 | // If you do not pass a policy, the resulting temporary security credentials | ||
2126 | // have no effective permissions. The only exception is when the temporary security | ||
2127 | // credentials are used to access a resource that has a resource-based policy | ||
2128 | // that specifically allows the federated user to access the resource. | ||
2129 | // | ||
2130 | // The format for this parameter, as described by its regex pattern, is a string | ||
2131 | // of characters up to 2048 characters in length. The characters can be any | ||
2132 | // ASCII character from the space character to the end of the valid character | ||
2133 | // list (\u0020-\u00FF). It can also include the tab (\u0009), linefeed (\u000A), | ||
2134 | // and carriage return (\u000D) characters. | ||
2135 | // | ||
2136 | // The policy plain text must be 2048 bytes or shorter. However, an internal | ||
2137 | // conversion compresses it into a packed binary format with a separate limit. | ||
2138 | // The PackedPolicySize response element indicates by percentage how close to | ||
2139 | // the upper size limit the policy is, with 100% equaling the maximum allowed | ||
2140 | // size. | ||
2141 | // | ||
2142 | // For more information about how permissions work, see Permissions for GetFederationToken | ||
2143 | // (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_getfederationtoken.html). | ||
2144 | Policy *string `min:"1" type:"string"` | ||
2145 | } | ||
2146 | |||
2147 | // String returns the string representation | ||
2148 | func (s GetFederationTokenInput) String() string { | ||
2149 | return awsutil.Prettify(s) | ||
2150 | } | ||
2151 | |||
2152 | // GoString returns the string representation | ||
2153 | func (s GetFederationTokenInput) GoString() string { | ||
2154 | return s.String() | ||
2155 | } | ||
2156 | |||
2157 | // Validate inspects the fields of the type to determine if they are valid. | ||
2158 | func (s *GetFederationTokenInput) Validate() error { | ||
2159 | invalidParams := request.ErrInvalidParams{Context: "GetFederationTokenInput"} | ||
2160 | if s.DurationSeconds != nil && *s.DurationSeconds < 900 { | ||
2161 | invalidParams.Add(request.NewErrParamMinValue("DurationSeconds", 900)) | ||
2162 | } | ||
2163 | if s.Name == nil { | ||
2164 | invalidParams.Add(request.NewErrParamRequired("Name")) | ||
2165 | } | ||
2166 | if s.Name != nil && len(*s.Name) < 2 { | ||
2167 | invalidParams.Add(request.NewErrParamMinLen("Name", 2)) | ||
2168 | } | ||
2169 | if s.Policy != nil && len(*s.Policy) < 1 { | ||
2170 | invalidParams.Add(request.NewErrParamMinLen("Policy", 1)) | ||
2171 | } | ||
2172 | |||
2173 | if invalidParams.Len() > 0 { | ||
2174 | return invalidParams | ||
2175 | } | ||
2176 | return nil | ||
2177 | } | ||
2178 | |||
2179 | // SetDurationSeconds sets the DurationSeconds field's value. | ||
2180 | func (s *GetFederationTokenInput) SetDurationSeconds(v int64) *GetFederationTokenInput { | ||
2181 | s.DurationSeconds = &v | ||
2182 | return s | ||
2183 | } | ||
2184 | |||
2185 | // SetName sets the Name field's value. | ||
2186 | func (s *GetFederationTokenInput) SetName(v string) *GetFederationTokenInput { | ||
2187 | s.Name = &v | ||
2188 | return s | ||
2189 | } | ||
2190 | |||
2191 | // SetPolicy sets the Policy field's value. | ||
2192 | func (s *GetFederationTokenInput) SetPolicy(v string) *GetFederationTokenInput { | ||
2193 | s.Policy = &v | ||
2194 | return s | ||
2195 | } | ||
2196 | |||
2197 | // Contains the response to a successful GetFederationToken request, including | ||
2198 | // temporary AWS credentials that can be used to make AWS requests. | ||
2199 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetFederationTokenResponse | ||
2200 | type GetFederationTokenOutput struct { | ||
2201 | _ struct{} `type:"structure"` | ||
2202 | |||
2203 | // The temporary security credentials, which include an access key ID, a secret | ||
2204 | // access key, and a security (or session) token. | ||
2205 | // | ||
2206 | // Note: The size of the security token that STS APIs return is not fixed. We | ||
2207 | // strongly recommend that you make no assumptions about the maximum size. As | ||
2208 | // of this writing, the typical size is less than 4096 bytes, but that can vary. | ||
2209 | // Also, future updates to AWS might require larger sizes. | ||
2210 | Credentials *Credentials `type:"structure"` | ||
2211 | |||
2212 | // Identifiers for the federated user associated with the credentials (such | ||
2213 | // as arn:aws:sts::123456789012:federated-user/Bob or 123456789012:Bob). You | ||
2214 | // can use the federated user's ARN in your resource-based policies, such as | ||
2215 | // an Amazon S3 bucket policy. | ||
2216 | FederatedUser *FederatedUser `type:"structure"` | ||
2217 | |||
2218 | // A percentage value indicating the size of the policy in packed form. The | ||
2219 | // service rejects policies for which the packed size is greater than 100 percent | ||
2220 | // of the allowed value. | ||
2221 | PackedPolicySize *int64 `type:"integer"` | ||
2222 | } | ||
2223 | |||
2224 | // String returns the string representation | ||
2225 | func (s GetFederationTokenOutput) String() string { | ||
2226 | return awsutil.Prettify(s) | ||
2227 | } | ||
2228 | |||
2229 | // GoString returns the string representation | ||
2230 | func (s GetFederationTokenOutput) GoString() string { | ||
2231 | return s.String() | ||
2232 | } | ||
2233 | |||
2234 | // SetCredentials sets the Credentials field's value. | ||
2235 | func (s *GetFederationTokenOutput) SetCredentials(v *Credentials) *GetFederationTokenOutput { | ||
2236 | s.Credentials = v | ||
2237 | return s | ||
2238 | } | ||
2239 | |||
2240 | // SetFederatedUser sets the FederatedUser field's value. | ||
2241 | func (s *GetFederationTokenOutput) SetFederatedUser(v *FederatedUser) *GetFederationTokenOutput { | ||
2242 | s.FederatedUser = v | ||
2243 | return s | ||
2244 | } | ||
2245 | |||
2246 | // SetPackedPolicySize sets the PackedPolicySize field's value. | ||
2247 | func (s *GetFederationTokenOutput) SetPackedPolicySize(v int64) *GetFederationTokenOutput { | ||
2248 | s.PackedPolicySize = &v | ||
2249 | return s | ||
2250 | } | ||
2251 | |||
2252 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetSessionTokenRequest | ||
2253 | type GetSessionTokenInput struct { | ||
2254 | _ struct{} `type:"structure"` | ||
2255 | |||
2256 | // The duration, in seconds, that the credentials should remain valid. Acceptable | ||
2257 | // durations for IAM user sessions range from 900 seconds (15 minutes) to 129600 | ||
2258 | // seconds (36 hours), with 43200 seconds (12 hours) as the default. Sessions | ||
2259 | // for AWS account owners are restricted to a maximum of 3600 seconds (one hour). | ||
2260 | // If the duration is longer than one hour, the session for AWS account owners | ||
2261 | // defaults to one hour. | ||
2262 | DurationSeconds *int64 `min:"900" type:"integer"` | ||
2263 | |||
2264 | // The identification number of the MFA device that is associated with the IAM | ||
2265 | // user who is making the GetSessionToken call. Specify this value if the IAM | ||
2266 | // user has a policy that requires MFA authentication. The value is either the | ||
2267 | // serial number for a hardware device (such as GAHT12345678) or an Amazon Resource | ||
2268 | // Name (ARN) for a virtual device (such as arn:aws:iam::123456789012:mfa/user). | ||
2269 | // You can find the device for an IAM user by going to the AWS Management Console | ||
2270 | // and viewing the user's security credentials. | ||
2271 | // | ||
2272 | // The regex used to validate this parameter is a string of characters consisting | ||
2273 | // of upper- and lower-case alphanumeric characters with no spaces. You can | ||
2274 | // also include underscores or any of the following characters: =,.@- | ||
2275 | SerialNumber *string `min:"9" type:"string"` | ||
2276 | |||
2277 | // The value provided by the MFA device, if MFA is required. If any policy requires | ||
2278 | // the IAM user to submit an MFA code, specify this value. If MFA authentication | ||
2279 | // is required, and the user does not provide a code when requesting a set of | ||
2280 | // temporary security credentials, the user will receive an "access denied" | ||
2281 | // response when requesting resources that require MFA authentication. | ||
2282 | // | ||
2283 | // The format for this parameter, as described by its regex pattern, is a sequence | ||
2284 | // of six numeric digits. | ||
2285 | TokenCode *string `min:"6" type:"string"` | ||
2286 | } | ||
2287 | |||
2288 | // String returns the string representation | ||
2289 | func (s GetSessionTokenInput) String() string { | ||
2290 | return awsutil.Prettify(s) | ||
2291 | } | ||
2292 | |||
2293 | // GoString returns the string representation | ||
2294 | func (s GetSessionTokenInput) GoString() string { | ||
2295 | return s.String() | ||
2296 | } | ||
2297 | |||
2298 | // Validate inspects the fields of the type to determine if they are valid. | ||
2299 | func (s *GetSessionTokenInput) Validate() error { | ||
2300 | invalidParams := request.ErrInvalidParams{Context: "GetSessionTokenInput"} | ||
2301 | if s.DurationSeconds != nil && *s.DurationSeconds < 900 { | ||
2302 | invalidParams.Add(request.NewErrParamMinValue("DurationSeconds", 900)) | ||
2303 | } | ||
2304 | if s.SerialNumber != nil && len(*s.SerialNumber) < 9 { | ||
2305 | invalidParams.Add(request.NewErrParamMinLen("SerialNumber", 9)) | ||
2306 | } | ||
2307 | if s.TokenCode != nil && len(*s.TokenCode) < 6 { | ||
2308 | invalidParams.Add(request.NewErrParamMinLen("TokenCode", 6)) | ||
2309 | } | ||
2310 | |||
2311 | if invalidParams.Len() > 0 { | ||
2312 | return invalidParams | ||
2313 | } | ||
2314 | return nil | ||
2315 | } | ||
2316 | |||
2317 | // SetDurationSeconds sets the DurationSeconds field's value. | ||
2318 | func (s *GetSessionTokenInput) SetDurationSeconds(v int64) *GetSessionTokenInput { | ||
2319 | s.DurationSeconds = &v | ||
2320 | return s | ||
2321 | } | ||
2322 | |||
2323 | // SetSerialNumber sets the SerialNumber field's value. | ||
2324 | func (s *GetSessionTokenInput) SetSerialNumber(v string) *GetSessionTokenInput { | ||
2325 | s.SerialNumber = &v | ||
2326 | return s | ||
2327 | } | ||
2328 | |||
2329 | // SetTokenCode sets the TokenCode field's value. | ||
2330 | func (s *GetSessionTokenInput) SetTokenCode(v string) *GetSessionTokenInput { | ||
2331 | s.TokenCode = &v | ||
2332 | return s | ||
2333 | } | ||
2334 | |||
2335 | // Contains the response to a successful GetSessionToken request, including | ||
2336 | // temporary AWS credentials that can be used to make AWS requests. | ||
2337 | // Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetSessionTokenResponse | ||
2338 | type GetSessionTokenOutput struct { | ||
2339 | _ struct{} `type:"structure"` | ||
2340 | |||
2341 | // The temporary security credentials, which include an access key ID, a secret | ||
2342 | // access key, and a security (or session) token. | ||
2343 | // | ||
2344 | // Note: The size of the security token that STS APIs return is not fixed. We | ||
2345 | // strongly recommend that you make no assumptions about the maximum size. As | ||
2346 | // of this writing, the typical size is less than 4096 bytes, but that can vary. | ||
2347 | // Also, future updates to AWS might require larger sizes. | ||
2348 | Credentials *Credentials `type:"structure"` | ||
2349 | } | ||
2350 | |||
2351 | // String returns the string representation | ||
2352 | func (s GetSessionTokenOutput) String() string { | ||
2353 | return awsutil.Prettify(s) | ||
2354 | } | ||
2355 | |||
2356 | // GoString returns the string representation | ||
2357 | func (s GetSessionTokenOutput) GoString() string { | ||
2358 | return s.String() | ||
2359 | } | ||
2360 | |||
2361 | // SetCredentials sets the Credentials field's value. | ||
2362 | func (s *GetSessionTokenOutput) SetCredentials(v *Credentials) *GetSessionTokenOutput { | ||
2363 | s.Credentials = v | ||
2364 | return s | ||
2365 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go b/vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go new file mode 100644 index 0000000..4010cc7 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go | |||
@@ -0,0 +1,12 @@ | |||
1 | package sts | ||
2 | |||
3 | import "github.com/aws/aws-sdk-go/aws/request" | ||
4 | |||
5 | func init() { | ||
6 | initRequest = func(r *request.Request) { | ||
7 | switch r.Operation.Name { | ||
8 | case opAssumeRoleWithSAML, opAssumeRoleWithWebIdentity: | ||
9 | r.Handlers.Sign.Clear() // these operations are unsigned | ||
10 | } | ||
11 | } | ||
12 | } | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/doc.go b/vendor/github.com/aws/aws-sdk-go/service/sts/doc.go new file mode 100644 index 0000000..d2af518 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/sts/doc.go | |||
@@ -0,0 +1,124 @@ | |||
1 | // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. | ||
2 | |||
3 | // Package sts provides the client and types for making API | ||
4 | // requests to AWS Security Token Service. | ||
5 | // | ||
6 | // The AWS Security Token Service (STS) is a web service that enables you to | ||
7 | // request temporary, limited-privilege credentials for AWS Identity and Access | ||
8 | // Management (IAM) users or for users that you authenticate (federated users). | ||
9 | // This guide provides descriptions of the STS API. For more detailed information | ||
10 | // about using this service, go to Temporary Security Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html). | ||
11 | // | ||
12 | // As an alternative to using the API, you can use one of the AWS SDKs, which | ||
13 | // consist of libraries and sample code for various programming languages and | ||
14 | // platforms (Java, Ruby, .NET, iOS, Android, etc.). The SDKs provide a convenient | ||
15 | // way to create programmatic access to STS. For example, the SDKs take care | ||
16 | // of cryptographically signing requests, managing errors, and retrying requests | ||
17 | // automatically. For information about the AWS SDKs, including how to download | ||
18 | // and install them, see the Tools for Amazon Web Services page (http://aws.amazon.com/tools/). | ||
19 | // | ||
20 | // For information about setting up signatures and authorization through the | ||
21 | // API, go to Signing AWS API Requests (http://docs.aws.amazon.com/general/latest/gr/signing_aws_api_requests.html) | ||
22 | // in the AWS General Reference. For general information about the Query API, | ||
23 | // go to Making Query Requests (http://docs.aws.amazon.com/IAM/latest/UserGuide/IAM_UsingQueryAPI.html) | ||
24 | // in Using IAM. For information about using security tokens with other AWS | ||
25 | // products, go to AWS Services That Work with IAM (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-services-that-work-with-iam.html) | ||
26 | // in the IAM User Guide. | ||
27 | // | ||
28 | // If you're new to AWS and need additional technical information about a specific | ||
29 | // AWS product, you can find the product's technical documentation at http://aws.amazon.com/documentation/ | ||
30 | // (http://aws.amazon.com/documentation/). | ||
31 | // | ||
32 | // Endpoints | ||
33 | // | ||
34 | // The AWS Security Token Service (STS) has a default endpoint of https://sts.amazonaws.com | ||
35 | // that maps to the US East (N. Virginia) region. Additional regions are available | ||
36 | // and are activated by default. For more information, see Activating and Deactivating | ||
37 | // AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) | ||
38 | // in the IAM User Guide. | ||
39 | // | ||
40 | // For information about STS endpoints, see Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html#sts_region) | ||
41 | // in the AWS General Reference. | ||
42 | // | ||
43 | // Recording API requests | ||
44 | // | ||
45 | // STS supports AWS CloudTrail, which is a service that records AWS calls for | ||
46 | // your AWS account and delivers log files to an Amazon S3 bucket. By using | ||
47 | // information collected by CloudTrail, you can determine what requests were | ||
48 | // successfully made to STS, who made the request, when it was made, and so | ||
49 | // on. To learn more about CloudTrail, including how to turn it on and find | ||
50 | // your log files, see the AWS CloudTrail User Guide (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/what_is_cloud_trail_top_level.html). | ||
51 | // | ||
52 | // See https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15 for more information on this service. | ||
53 | // | ||
54 | // See sts package documentation for more information. | ||
55 | // https://docs.aws.amazon.com/sdk-for-go/api/service/sts/ | ||
56 | // | ||
57 | // Using the Client | ||
58 | // | ||
59 | // To use the client for AWS Security Token Service you will first need | ||
60 | // to create a new instance of it. | ||
61 | // | ||
62 | // When creating a client for an AWS service you'll first need to have a Session | ||
63 | // already created. The Session provides configuration that can be shared | ||
64 | // between multiple service clients. Additional configuration can be applied to | ||
65 | // the Session and service's client when they are constructed. The aws package's | ||
66 | // Config type contains several fields such as Region for the AWS Region the | ||
67 | // client should make API requests too. The optional Config value can be provided | ||
68 | // as the variadic argument for Sessions and client creation. | ||
69 | // | ||
70 | // Once the service's client is created you can use it to make API requests the | ||
71 | // AWS service. These clients are safe to use concurrently. | ||
72 | // | ||
73 | // // Create a session to share configuration, and load external configuration. | ||
74 | // sess := session.Must(session.NewSession()) | ||
75 | // | ||
76 | // // Create the service's client with the session. | ||
77 | // svc := sts.New(sess) | ||
78 | // | ||
79 | // See the SDK's documentation for more information on how to use service clients. | ||
80 | // https://docs.aws.amazon.com/sdk-for-go/api/ | ||
81 | // | ||
82 | // See aws package's Config type for more information on configuration options. | ||
83 | // https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config | ||
84 | // | ||
85 | // See the AWS Security Token Service client STS for more | ||
86 | // information on creating the service's client. | ||
87 | // https://docs.aws.amazon.com/sdk-for-go/api/service/sts/#New | ||
88 | // | ||
89 | // Once the client is created you can make an API request to the service. | ||
90 | // Each API method takes a input parameter, and returns the service response | ||
91 | // and an error. | ||
92 | // | ||
93 | // The API method will document which error codes the service can be returned | ||
94 | // by the operation if the service models the API operation's errors. These | ||
95 | // errors will also be available as const strings prefixed with "ErrCode". | ||
96 | // | ||
97 | // result, err := svc.AssumeRole(params) | ||
98 | // if err != nil { | ||
99 | // // Cast err to awserr.Error to handle specific error codes. | ||
100 | // aerr, ok := err.(awserr.Error) | ||
101 | // if ok && aerr.Code() == <error code to check for> { | ||
102 | // // Specific error code handling | ||
103 | // } | ||
104 | // return err | ||
105 | // } | ||
106 | // | ||
107 | // fmt.Println("AssumeRole result:") | ||
108 | // fmt.Println(result) | ||
109 | // | ||
110 | // Using the Client with Context | ||
111 | // | ||
112 | // The service's client also provides methods to make API requests with a Context | ||
113 | // value. This allows you to control the timeout, and cancellation of pending | ||
114 | // requests. These methods also take request Option as variadic parameter to apply | ||
115 | // additional configuration to the API request. | ||
116 | // | ||
117 | // ctx := context.Background() | ||
118 | // | ||
119 | // result, err := svc.AssumeRoleWithContext(ctx, params) | ||
120 | // | ||
121 | // See the request package documentation for more information on using Context pattern | ||
122 | // with the SDK. | ||
123 | // https://docs.aws.amazon.com/sdk-for-go/api/aws/request/ | ||
124 | package sts | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/errors.go b/vendor/github.com/aws/aws-sdk-go/service/sts/errors.go new file mode 100644 index 0000000..e24884e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/sts/errors.go | |||
@@ -0,0 +1,73 @@ | |||
1 | // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. | ||
2 | |||
3 | package sts | ||
4 | |||
5 | const ( | ||
6 | |||
7 | // ErrCodeExpiredTokenException for service response error code | ||
8 | // "ExpiredTokenException". | ||
9 | // | ||
10 | // The web identity token that was passed is expired or is not valid. Get a | ||
11 | // new identity token from the identity provider and then retry the request. | ||
12 | ErrCodeExpiredTokenException = "ExpiredTokenException" | ||
13 | |||
14 | // ErrCodeIDPCommunicationErrorException for service response error code | ||
15 | // "IDPCommunicationError". | ||
16 | // | ||
17 | // The request could not be fulfilled because the non-AWS identity provider | ||
18 | // (IDP) that was asked to verify the incoming identity token could not be reached. | ||
19 | // This is often a transient error caused by network conditions. Retry the request | ||
20 | // a limited number of times so that you don't exceed the request rate. If the | ||
21 | // error persists, the non-AWS identity provider might be down or not responding. | ||
22 | ErrCodeIDPCommunicationErrorException = "IDPCommunicationError" | ||
23 | |||
24 | // ErrCodeIDPRejectedClaimException for service response error code | ||
25 | // "IDPRejectedClaim". | ||
26 | // | ||
27 | // The identity provider (IdP) reported that authentication failed. This might | ||
28 | // be because the claim is invalid. | ||
29 | // | ||
30 | // If this error is returned for the AssumeRoleWithWebIdentity operation, it | ||
31 | // can also mean that the claim has expired or has been explicitly revoked. | ||
32 | ErrCodeIDPRejectedClaimException = "IDPRejectedClaim" | ||
33 | |||
34 | // ErrCodeInvalidAuthorizationMessageException for service response error code | ||
35 | // "InvalidAuthorizationMessageException". | ||
36 | // | ||
37 | // The error returned if the message passed to DecodeAuthorizationMessage was | ||
38 | // invalid. This can happen if the token contains invalid characters, such as | ||
39 | // linebreaks. | ||
40 | ErrCodeInvalidAuthorizationMessageException = "InvalidAuthorizationMessageException" | ||
41 | |||
42 | // ErrCodeInvalidIdentityTokenException for service response error code | ||
43 | // "InvalidIdentityToken". | ||
44 | // | ||
45 | // The web identity token that was passed could not be validated by AWS. Get | ||
46 | // a new identity token from the identity provider and then retry the request. | ||
47 | ErrCodeInvalidIdentityTokenException = "InvalidIdentityToken" | ||
48 | |||
49 | // ErrCodeMalformedPolicyDocumentException for service response error code | ||
50 | // "MalformedPolicyDocument". | ||
51 | // | ||
52 | // The request was rejected because the policy document was malformed. The error | ||
53 | // message describes the specific error. | ||
54 | ErrCodeMalformedPolicyDocumentException = "MalformedPolicyDocument" | ||
55 | |||
56 | // ErrCodePackedPolicyTooLargeException for service response error code | ||
57 | // "PackedPolicyTooLarge". | ||
58 | // | ||
59 | // The request was rejected because the policy document was too large. The error | ||
60 | // message describes how big the policy document is, in packed form, as a percentage | ||
61 | // of what the API allows. | ||
62 | ErrCodePackedPolicyTooLargeException = "PackedPolicyTooLarge" | ||
63 | |||
64 | // ErrCodeRegionDisabledException for service response error code | ||
65 | // "RegionDisabledException". | ||
66 | // | ||
67 | // STS is not activated in the requested region for the account that is being | ||
68 | // asked to generate credentials. The account administrator must use the IAM | ||
69 | // console to activate STS in that region. For more information, see Activating | ||
70 | // and Deactivating AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) | ||
71 | // in the IAM User Guide. | ||
72 | ErrCodeRegionDisabledException = "RegionDisabledException" | ||
73 | ) | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/service.go b/vendor/github.com/aws/aws-sdk-go/service/sts/service.go new file mode 100644 index 0000000..1ee5839 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/sts/service.go | |||
@@ -0,0 +1,93 @@ | |||
1 | // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. | ||
2 | |||
3 | package sts | ||
4 | |||
5 | import ( | ||
6 | "github.com/aws/aws-sdk-go/aws" | ||
7 | "github.com/aws/aws-sdk-go/aws/client" | ||
8 | "github.com/aws/aws-sdk-go/aws/client/metadata" | ||
9 | "github.com/aws/aws-sdk-go/aws/request" | ||
10 | "github.com/aws/aws-sdk-go/aws/signer/v4" | ||
11 | "github.com/aws/aws-sdk-go/private/protocol/query" | ||
12 | ) | ||
13 | |||
14 | // STS provides the API operation methods for making requests to | ||
15 | // AWS Security Token Service. See this package's package overview docs | ||
16 | // for details on the service. | ||
17 | // | ||
18 | // STS methods are safe to use concurrently. It is not safe to | ||
19 | // modify mutate any of the struct's properties though. | ||
20 | type STS struct { | ||
21 | *client.Client | ||
22 | } | ||
23 | |||
24 | // Used for custom client initialization logic | ||
25 | var initClient func(*client.Client) | ||
26 | |||
27 | // Used for custom request initialization logic | ||
28 | var initRequest func(*request.Request) | ||
29 | |||
30 | // Service information constants | ||
31 | const ( | ||
32 | ServiceName = "sts" // Service endpoint prefix API calls made to. | ||
33 | EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. | ||
34 | ) | ||
35 | |||
36 | // New creates a new instance of the STS client with a session. | ||
37 | // If additional configuration is needed for the client instance use the optional | ||
38 | // aws.Config parameter to add your extra config. | ||
39 | // | ||
40 | // Example: | ||
41 | // // Create a STS client from just a session. | ||
42 | // svc := sts.New(mySession) | ||
43 | // | ||
44 | // // Create a STS client with additional configuration | ||
45 | // svc := sts.New(mySession, aws.NewConfig().WithRegion("us-west-2")) | ||
46 | func New(p client.ConfigProvider, cfgs ...*aws.Config) *STS { | ||
47 | c := p.ClientConfig(EndpointsID, cfgs...) | ||
48 | return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) | ||
49 | } | ||
50 | |||
51 | // newClient creates, initializes and returns a new service client instance. | ||
52 | func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *STS { | ||
53 | svc := &STS{ | ||
54 | Client: client.New( | ||
55 | cfg, | ||
56 | metadata.ClientInfo{ | ||
57 | ServiceName: ServiceName, | ||
58 | SigningName: signingName, | ||
59 | SigningRegion: signingRegion, | ||
60 | Endpoint: endpoint, | ||
61 | APIVersion: "2011-06-15", | ||
62 | }, | ||
63 | handlers, | ||
64 | ), | ||
65 | } | ||
66 | |||
67 | // Handlers | ||
68 | svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) | ||
69 | svc.Handlers.Build.PushBackNamed(query.BuildHandler) | ||
70 | svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) | ||
71 | svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) | ||
72 | svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) | ||
73 | |||
74 | // Run custom client initialization if present | ||
75 | if initClient != nil { | ||
76 | initClient(svc.Client) | ||
77 | } | ||
78 | |||
79 | return svc | ||
80 | } | ||
81 | |||
82 | // newRequest creates a new request for a STS operation and runs any | ||
83 | // custom request initialization. | ||
84 | func (c *STS) newRequest(op *request.Operation, params, data interface{}) *request.Request { | ||
85 | req := c.NewRequest(op, params, data) | ||
86 | |||
87 | // Run custom request initialization if present | ||
88 | if initRequest != nil { | ||
89 | initRequest(req) | ||
90 | } | ||
91 | |||
92 | return req | ||
93 | } | ||