-
Notifications
You must be signed in to change notification settings - Fork 7
/
model_bucket.go
377 lines (325 loc) · 10.9 KB
/
model_bucket.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
// Copyright 2019 Huawei Technologies Co.,Ltd.
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
// this file except in compliance with the License. You may obtain a copy of the
// License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
package obs
import (
"encoding/xml"
)
// ListBucketsInput is the input parameter of ListBuckets function
type ListBucketsInput struct {
QueryLocation bool
BucketType BucketType
}
// ListBucketsOutput is the result of ListBuckets function
type ListBucketsOutput struct {
BaseModel
XMLName xml.Name `xml:"ListAllMyBucketsResult"`
Owner Owner `xml:"Owner"`
Buckets []Bucket `xml:"Buckets>Bucket"`
}
// CreateBucketInput is the input parameter of CreateBucket function
type CreateBucketInput struct {
BucketLocation
Bucket string `xml:"-"`
ACL AclType `xml:"-"`
StorageClass StorageClassType `xml:"-"`
GrantReadId string `xml:"-"`
GrantWriteId string `xml:"-"`
GrantReadAcpId string `xml:"-"`
GrantWriteAcpId string `xml:"-"`
GrantFullControlId string `xml:"-"`
GrantReadDeliveredId string `xml:"-"`
GrantFullControlDeliveredId string `xml:"-"`
Epid string `xml:"-"`
AvailableZone string `xml:"-"`
IsFSFileInterface bool `xml:"-"`
}
// SetBucketStoragePolicyInput is the input parameter of SetBucketStoragePolicy function
type SetBucketStoragePolicyInput struct {
Bucket string `xml:"-"`
BucketStoragePolicy
}
type getBucketStoragePolicyOutputS3 struct {
BaseModel
BucketStoragePolicy
}
// GetBucketStoragePolicyOutput is the result of GetBucketStoragePolicy function
type GetBucketStoragePolicyOutput struct {
BaseModel
StorageClass string
}
type getBucketStoragePolicyOutputObs struct {
BaseModel
bucketStoragePolicyObs
}
// SetBucketQuotaInput is the input parameter of SetBucketQuota function
type SetBucketQuotaInput struct {
Bucket string `xml:"-"`
BucketQuota
}
// GetBucketQuotaOutput is the result of GetBucketQuota function
type GetBucketQuotaOutput struct {
BaseModel
BucketQuota
}
// GetBucketStorageInfoOutput is the result of GetBucketStorageInfo function
type GetBucketStorageInfoOutput struct {
BaseModel
XMLName xml.Name `xml:"GetBucketStorageInfoResult"`
Size int64 `xml:"Size"`
ObjectNumber int `xml:"ObjectNumber"`
}
type getBucketLocationOutputS3 struct {
BaseModel
BucketLocation
}
type getBucketLocationOutputObs struct {
BaseModel
bucketLocationObs
}
// GetBucketLocationOutput is the result of GetBucketLocation function
type GetBucketLocationOutput struct {
BaseModel
Location string `xml:"-"`
}
// GetBucketAclOutput is the result of GetBucketAcl function
type GetBucketAclOutput struct {
BaseModel
AccessControlPolicy
}
type getBucketACLOutputObs struct {
BaseModel
accessControlPolicyObs
}
// SetBucketAclInput is the input parameter of SetBucketAcl function
type SetBucketAclInput struct {
Bucket string `xml:"-"`
ACL AclType `xml:"-"`
AccessControlPolicy
}
// SetBucketPolicyInput is the input parameter of SetBucketPolicy function
type SetBucketPolicyInput struct {
Bucket string
Policy string
}
// GetBucketPolicyOutput is the result of GetBucketPolicy function
type GetBucketPolicyOutput struct {
BaseModel
Policy string `json:"body"`
}
// SetBucketCorsInput is the input parameter of SetBucketCors function
type SetBucketCorsInput struct {
Bucket string `xml:"-"`
BucketCors
}
// GetBucketCorsOutput is the result of GetBucketCors function
type GetBucketCorsOutput struct {
BaseModel
BucketCors
}
// SetBucketVersioningInput is the input parameter of SetBucketVersioning function
type SetBucketVersioningInput struct {
Bucket string `xml:"-"`
BucketVersioningConfiguration
}
// GetBucketVersioningOutput is the result of GetBucketVersioning function
type GetBucketVersioningOutput struct {
BaseModel
BucketVersioningConfiguration
}
// SetBucketWebsiteConfigurationInput is the input parameter of SetBucketWebsiteConfiguration function
type SetBucketWebsiteConfigurationInput struct {
Bucket string `xml:"-"`
BucketWebsiteConfiguration
}
// GetBucketWebsiteConfigurationOutput is the result of GetBucketWebsiteConfiguration function
type GetBucketWebsiteConfigurationOutput struct {
BaseModel
BucketWebsiteConfiguration
}
// GetBucketMetadataInput is the input parameter of GetBucketMetadata function
type GetBucketMetadataInput struct {
Bucket string
Origin string
RequestHeader string
}
// SetObjectMetadataInput is the input parameter of SetObjectMetadata function
type SetObjectMetadataInput struct {
Bucket string
Key string
VersionId string
MetadataDirective MetadataDirectiveType
CacheControl string
ContentDisposition string
ContentEncoding string
ContentLanguage string
ContentType string
Expires string
WebsiteRedirectLocation string
StorageClass StorageClassType
Metadata map[string]string
}
//SetObjectMetadataOutput is the result of SetObjectMetadata function
type SetObjectMetadataOutput struct {
BaseModel
MetadataDirective MetadataDirectiveType
CacheControl string
ContentDisposition string
ContentEncoding string
ContentLanguage string
ContentType string
Expires string
WebsiteRedirectLocation string
StorageClass StorageClassType
Metadata map[string]string
}
// GetBucketMetadataOutput is the result of GetBucketMetadata function
type GetBucketMetadataOutput struct {
BaseModel
StorageClass StorageClassType
Location string
Version string
AllowOrigin string
AllowMethod string
AllowHeader string
MaxAgeSeconds int
ExposeHeader string
Epid string
AZRedundancy string
FSStatus FSStatusType
}
// SetBucketLoggingConfigurationInput is the input parameter of SetBucketLoggingConfiguration function
type SetBucketLoggingConfigurationInput struct {
Bucket string `xml:"-"`
BucketLoggingStatus
}
// GetBucketLoggingConfigurationOutput is the result of GetBucketLoggingConfiguration function
type GetBucketLoggingConfigurationOutput struct {
BaseModel
BucketLoggingStatus
}
// BucketLifecyleConfiguration defines the bucket lifecycle configuration
type BucketLifecyleConfiguration struct {
XMLName xml.Name `xml:"LifecycleConfiguration"`
LifecycleRules []LifecycleRule `xml:"Rule"`
}
// SetBucketLifecycleConfigurationInput is the input parameter of SetBucketLifecycleConfiguration function
type SetBucketLifecycleConfigurationInput struct {
Bucket string `xml:"-"`
BucketLifecyleConfiguration
}
// GetBucketLifecycleConfigurationOutput is the result of GetBucketLifecycleConfiguration function
type GetBucketLifecycleConfigurationOutput struct {
BaseModel
BucketLifecyleConfiguration
}
// SetBucketEncryptionInput is the input parameter of SetBucketEncryption function
type SetBucketEncryptionInput struct {
Bucket string `xml:"-"`
BucketEncryptionConfiguration
}
// GetBucketEncryptionOutput is the result of GetBucketEncryption function
type GetBucketEncryptionOutput struct {
BaseModel
BucketEncryptionConfiguration
}
// SetBucketReplicationInput is the input parameter of SetBucketReplication function
type SetBucketReplicationInput struct {
Bucket string `xml:"-"`
BucketReplicationConfiguration
}
// GetBucketReplicationOutput is the result of GetBucketReplication function
type GetBucketReplicationOutput struct {
BaseModel
BucketReplicationConfiguration
}
// SetBucketTaggingInput is the input parameter of SetBucketTagging function
type SetBucketTaggingInput struct {
Bucket string `xml:"-"`
BucketTagging
}
// GetBucketTaggingOutput is the result of GetBucketTagging function
type GetBucketTaggingOutput struct {
BaseModel
BucketTagging
}
// SetBucketNotificationInput is the input parameter of SetBucketNotification function
type SetBucketNotificationInput struct {
Bucket string `xml:"-"`
BucketNotification
}
type getBucketNotificationOutputS3 struct {
BaseModel
bucketNotificationS3
}
// GetBucketNotificationOutput is the result of GetBucketNotification function
type GetBucketNotificationOutput struct {
BaseModel
BucketNotification
}
// SetBucketFetchPolicyInput is the input parameter of SetBucketFetchPolicy function
type SetBucketFetchPolicyInput struct {
Bucket string
Status FetchPolicyStatusType `json:"status"`
Agency string `json:"agency"`
}
// GetBucketFetchPolicyInput is the input parameter of GetBucketFetchPolicy function
type GetBucketFetchPolicyInput struct {
Bucket string
}
// GetBucketFetchPolicyOutput is the result of GetBucketFetchPolicy function
type GetBucketFetchPolicyOutput struct {
BaseModel
FetchResponse `json:"fetch"`
}
// DeleteBucketFetchPolicyInput is the input parameter of DeleteBucketFetchPolicy function
type DeleteBucketFetchPolicyInput struct {
Bucket string
}
// SetBucketFetchJobInput is the input parameter of SetBucketFetchJob function
type SetBucketFetchJobInput struct {
Bucket string `json:"bucket"`
URL string `json:"url"`
Host string `json:"host,omitempty"`
Key string `json:"key,omitempty"`
Md5 string `json:"md5,omitempty"`
CallBackURL string `json:"callbackurl,omitempty"`
CallBackBody string `json:"callbackbody,omitempty"`
CallBackBodyType string `json:"callbackbodytype,omitempty"`
CallBackHost string `json:"callbackhost,omitempty"`
FileType string `json:"file_type,omitempty"`
IgnoreSameKey bool `json:"ignore_same_key,omitempty"`
ObjectHeaders map[string]string `json:"objectheaders,omitempty"`
Etag string `json:"etag,omitempty"`
TrustName string `json:"trustname,omitempty"`
}
// SetBucketFetchJobOutput is the result of SetBucketFetchJob function
type SetBucketFetchJobOutput struct {
BaseModel
SetBucketFetchJobResponse
}
// GetBucketFetchJobInput is the input parameter of GetBucketFetchJob function
type GetBucketFetchJobInput struct {
Bucket string
JobID string
}
// GetBucketFetchJobOutput is the result of GetBucketFetchJob function
type GetBucketFetchJobOutput struct {
BaseModel
GetBucketFetchJobResponse
}
type GetBucketFSStatusInput struct {
GetBucketMetadataInput
}
type GetBucketFSStatusOutput struct {
GetBucketMetadataOutput
FSStatus FSStatusType
}