You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1008 lines
43 KiB

3 years ago
3 years ago
3 years ago
3 years ago
  1. package s3api
  2. import (
  3. "bytes"
  4. "encoding/base64"
  5. "encoding/xml"
  6. "time"
  7. )
  8. type AccessControlList struct {
  9. Grant []Grant `xml:"Grant,omitempty"`
  10. }
  11. type AccessControlPolicy struct {
  12. Owner CanonicalUser `xml:"Owner"`
  13. AccessControlList AccessControlList `xml:"AccessControlList"`
  14. }
  15. type AmazonCustomerByEmail struct {
  16. EmailAddress string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ EmailAddress"`
  17. }
  18. type BucketLoggingStatus struct {
  19. LoggingEnabled LoggingSettings `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LoggingEnabled,omitempty"`
  20. }
  21. type CanonicalUser struct {
  22. ID string `xml:"ID"`
  23. DisplayName string `xml:"DisplayName,omitempty"`
  24. }
  25. type CopyObject struct {
  26. SourceBucket string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ SourceBucket"`
  27. SourceKey string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ SourceKey"`
  28. DestinationBucket string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ DestinationBucket"`
  29. DestinationKey string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ DestinationKey"`
  30. MetadataDirective MetadataDirective `xml:"http://s3.amazonaws.com/doc/2006-03-01/ MetadataDirective,omitempty"`
  31. Metadata []MetadataEntry `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Metadata,omitempty"`
  32. AccessControlList AccessControlList `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AccessControlList,omitempty"`
  33. CopySourceIfModifiedSince time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ CopySourceIfModifiedSince,omitempty"`
  34. CopySourceIfUnmodifiedSince time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ CopySourceIfUnmodifiedSince,omitempty"`
  35. CopySourceIfMatch []string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ CopySourceIfMatch,omitempty"`
  36. CopySourceIfNoneMatch []string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ CopySourceIfNoneMatch,omitempty"`
  37. StorageClass StorageClass `xml:"http://s3.amazonaws.com/doc/2006-03-01/ StorageClass,omitempty"`
  38. AWSAccessKeyId string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AWSAccessKeyId,omitempty"`
  39. Timestamp time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  40. Signature string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Signature,omitempty"`
  41. Credential string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Credential,omitempty"`
  42. }
  43. func (t *CopyObject) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  44. type T CopyObject
  45. var layout struct {
  46. *T
  47. CopySourceIfModifiedSince *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ CopySourceIfModifiedSince,omitempty"`
  48. CopySourceIfUnmodifiedSince *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ CopySourceIfUnmodifiedSince,omitempty"`
  49. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  50. }
  51. layout.T = (*T)(t)
  52. layout.CopySourceIfModifiedSince = (*xsdDateTime)(&layout.T.CopySourceIfModifiedSince)
  53. layout.CopySourceIfUnmodifiedSince = (*xsdDateTime)(&layout.T.CopySourceIfUnmodifiedSince)
  54. layout.Timestamp = (*xsdDateTime)(&layout.T.Timestamp)
  55. return e.EncodeElement(layout, start)
  56. }
  57. func (t *CopyObject) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
  58. type T CopyObject
  59. var overlay struct {
  60. *T
  61. CopySourceIfModifiedSince *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ CopySourceIfModifiedSince,omitempty"`
  62. CopySourceIfUnmodifiedSince *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ CopySourceIfUnmodifiedSince,omitempty"`
  63. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  64. }
  65. overlay.T = (*T)(t)
  66. overlay.CopySourceIfModifiedSince = (*xsdDateTime)(&overlay.T.CopySourceIfModifiedSince)
  67. overlay.CopySourceIfUnmodifiedSince = (*xsdDateTime)(&overlay.T.CopySourceIfUnmodifiedSince)
  68. overlay.Timestamp = (*xsdDateTime)(&overlay.T.Timestamp)
  69. return d.DecodeElement(&overlay, &start)
  70. }
  71. type CopyObjectResponse struct {
  72. CopyObjectResult CopyObjectResult `xml:"http://s3.amazonaws.com/doc/2006-03-01/ CopyObjectResult"`
  73. }
  74. type CopyObjectResult struct {
  75. LastModified time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LastModified"`
  76. ETag string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ETag"`
  77. }
  78. func (t *CopyObjectResult) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  79. type T CopyObjectResult
  80. var layout struct {
  81. *T
  82. LastModified *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LastModified"`
  83. }
  84. layout.T = (*T)(t)
  85. layout.LastModified = (*xsdDateTime)(&layout.T.LastModified)
  86. return e.EncodeElement(layout, start)
  87. }
  88. func (t *CopyObjectResult) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
  89. type T CopyObjectResult
  90. var overlay struct {
  91. *T
  92. LastModified *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LastModified"`
  93. }
  94. overlay.T = (*T)(t)
  95. overlay.LastModified = (*xsdDateTime)(&overlay.T.LastModified)
  96. return d.DecodeElement(&overlay, &start)
  97. }
  98. type CreateBucket struct {
  99. Bucket string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Bucket"`
  100. AccessControlList AccessControlList `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AccessControlList,omitempty"`
  101. AWSAccessKeyId string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AWSAccessKeyId,omitempty"`
  102. Timestamp time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  103. Signature string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Signature,omitempty"`
  104. }
  105. func (t *CreateBucket) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  106. type T CreateBucket
  107. var layout struct {
  108. *T
  109. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  110. }
  111. layout.T = (*T)(t)
  112. layout.Timestamp = (*xsdDateTime)(&layout.T.Timestamp)
  113. return e.EncodeElement(layout, start)
  114. }
  115. func (t *CreateBucket) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
  116. type T CreateBucket
  117. var overlay struct {
  118. *T
  119. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  120. }
  121. overlay.T = (*T)(t)
  122. overlay.Timestamp = (*xsdDateTime)(&overlay.T.Timestamp)
  123. return d.DecodeElement(&overlay, &start)
  124. }
  125. type CreateBucketConfiguration struct {
  126. LocationConstraint string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LocationConstraint"`
  127. }
  128. type CreateBucketResponse struct {
  129. CreateBucketReturn CreateBucketResult `xml:"http://s3.amazonaws.com/doc/2006-03-01/ CreateBucketReturn"`
  130. }
  131. type CreateBucketResult struct {
  132. BucketName string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ BucketName"`
  133. }
  134. type DeleteBucket struct {
  135. Bucket string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Bucket"`
  136. AWSAccessKeyId string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AWSAccessKeyId,omitempty"`
  137. Timestamp time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  138. Signature string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Signature,omitempty"`
  139. Credential string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Credential,omitempty"`
  140. }
  141. func (t *DeleteBucket) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  142. type T DeleteBucket
  143. var layout struct {
  144. *T
  145. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  146. }
  147. layout.T = (*T)(t)
  148. layout.Timestamp = (*xsdDateTime)(&layout.T.Timestamp)
  149. return e.EncodeElement(layout, start)
  150. }
  151. func (t *DeleteBucket) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
  152. type T DeleteBucket
  153. var overlay struct {
  154. *T
  155. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  156. }
  157. overlay.T = (*T)(t)
  158. overlay.Timestamp = (*xsdDateTime)(&overlay.T.Timestamp)
  159. return d.DecodeElement(&overlay, &start)
  160. }
  161. type DeleteBucketResponse struct {
  162. DeleteBucketResponse Status `xml:"http://s3.amazonaws.com/doc/2006-03-01/ DeleteBucketResponse"`
  163. }
  164. type DeleteMarkerEntry struct {
  165. Key string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Key"`
  166. VersionId string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ VersionId"`
  167. IsLatest bool `xml:"http://s3.amazonaws.com/doc/2006-03-01/ IsLatest"`
  168. LastModified time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LastModified"`
  169. Owner CanonicalUser `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Owner,omitempty"`
  170. }
  171. func (t *DeleteMarkerEntry) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  172. type T DeleteMarkerEntry
  173. var layout struct {
  174. *T
  175. LastModified *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LastModified"`
  176. }
  177. layout.T = (*T)(t)
  178. layout.LastModified = (*xsdDateTime)(&layout.T.LastModified)
  179. return e.EncodeElement(layout, start)
  180. }
  181. func (t *DeleteMarkerEntry) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
  182. type T DeleteMarkerEntry
  183. var overlay struct {
  184. *T
  185. LastModified *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LastModified"`
  186. }
  187. overlay.T = (*T)(t)
  188. overlay.LastModified = (*xsdDateTime)(&overlay.T.LastModified)
  189. return d.DecodeElement(&overlay, &start)
  190. }
  191. type DeleteObject struct {
  192. Bucket string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Bucket"`
  193. Key string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Key"`
  194. AWSAccessKeyId string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AWSAccessKeyId,omitempty"`
  195. Timestamp time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  196. Signature string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Signature,omitempty"`
  197. Credential string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Credential,omitempty"`
  198. }
  199. func (t *DeleteObject) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  200. type T DeleteObject
  201. var layout struct {
  202. *T
  203. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  204. }
  205. layout.T = (*T)(t)
  206. layout.Timestamp = (*xsdDateTime)(&layout.T.Timestamp)
  207. return e.EncodeElement(layout, start)
  208. }
  209. func (t *DeleteObject) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
  210. type T DeleteObject
  211. var overlay struct {
  212. *T
  213. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  214. }
  215. overlay.T = (*T)(t)
  216. overlay.Timestamp = (*xsdDateTime)(&overlay.T.Timestamp)
  217. return d.DecodeElement(&overlay, &start)
  218. }
  219. type DeleteObjectResponse struct {
  220. DeleteObjectResponse Status `xml:"http://s3.amazonaws.com/doc/2006-03-01/ DeleteObjectResponse"`
  221. }
  222. type GetBucketAccessControlPolicy struct {
  223. Bucket string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Bucket"`
  224. AWSAccessKeyId string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AWSAccessKeyId,omitempty"`
  225. Timestamp time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  226. Signature string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Signature,omitempty"`
  227. Credential string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Credential,omitempty"`
  228. }
  229. func (t *GetBucketAccessControlPolicy) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  230. type T GetBucketAccessControlPolicy
  231. var layout struct {
  232. *T
  233. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  234. }
  235. layout.T = (*T)(t)
  236. layout.Timestamp = (*xsdDateTime)(&layout.T.Timestamp)
  237. return e.EncodeElement(layout, start)
  238. }
  239. func (t *GetBucketAccessControlPolicy) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
  240. type T GetBucketAccessControlPolicy
  241. var overlay struct {
  242. *T
  243. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  244. }
  245. overlay.T = (*T)(t)
  246. overlay.Timestamp = (*xsdDateTime)(&overlay.T.Timestamp)
  247. return d.DecodeElement(&overlay, &start)
  248. }
  249. type GetBucketAccessControlPolicyResponse struct {
  250. GetBucketAccessControlPolicyResponse AccessControlPolicy `xml:"http://s3.amazonaws.com/doc/2006-03-01/ GetBucketAccessControlPolicyResponse"`
  251. }
  252. type GetBucketLoggingStatus struct {
  253. Bucket string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Bucket"`
  254. AWSAccessKeyId string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AWSAccessKeyId,omitempty"`
  255. Timestamp time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  256. Signature string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Signature,omitempty"`
  257. Credential string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Credential,omitempty"`
  258. }
  259. func (t *GetBucketLoggingStatus) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  260. type T GetBucketLoggingStatus
  261. var layout struct {
  262. *T
  263. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  264. }
  265. layout.T = (*T)(t)
  266. layout.Timestamp = (*xsdDateTime)(&layout.T.Timestamp)
  267. return e.EncodeElement(layout, start)
  268. }
  269. func (t *GetBucketLoggingStatus) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
  270. type T GetBucketLoggingStatus
  271. var overlay struct {
  272. *T
  273. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  274. }
  275. overlay.T = (*T)(t)
  276. overlay.Timestamp = (*xsdDateTime)(&overlay.T.Timestamp)
  277. return d.DecodeElement(&overlay, &start)
  278. }
  279. type GetBucketLoggingStatusResponse struct {
  280. GetBucketLoggingStatusResponse BucketLoggingStatus `xml:"http://s3.amazonaws.com/doc/2006-03-01/ GetBucketLoggingStatusResponse"`
  281. }
  282. type GetObject struct {
  283. Bucket string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Bucket"`
  284. Key string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Key"`
  285. GetMetadata bool `xml:"http://s3.amazonaws.com/doc/2006-03-01/ GetMetadata"`
  286. GetData bool `xml:"http://s3.amazonaws.com/doc/2006-03-01/ GetData"`
  287. InlineData bool `xml:"http://s3.amazonaws.com/doc/2006-03-01/ InlineData"`
  288. AWSAccessKeyId string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AWSAccessKeyId,omitempty"`
  289. Timestamp time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  290. Signature string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Signature,omitempty"`
  291. Credential string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Credential,omitempty"`
  292. }
  293. func (t *GetObject) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  294. type T GetObject
  295. var layout struct {
  296. *T
  297. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  298. }
  299. layout.T = (*T)(t)
  300. layout.Timestamp = (*xsdDateTime)(&layout.T.Timestamp)
  301. return e.EncodeElement(layout, start)
  302. }
  303. func (t *GetObject) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
  304. type T GetObject
  305. var overlay struct {
  306. *T
  307. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  308. }
  309. overlay.T = (*T)(t)
  310. overlay.Timestamp = (*xsdDateTime)(&overlay.T.Timestamp)
  311. return d.DecodeElement(&overlay, &start)
  312. }
  313. type GetObjectAccessControlPolicy struct {
  314. Bucket string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Bucket"`
  315. Key string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Key"`
  316. AWSAccessKeyId string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AWSAccessKeyId,omitempty"`
  317. Timestamp time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  318. Signature string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Signature,omitempty"`
  319. Credential string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Credential,omitempty"`
  320. }
  321. func (t *GetObjectAccessControlPolicy) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  322. type T GetObjectAccessControlPolicy
  323. var layout struct {
  324. *T
  325. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  326. }
  327. layout.T = (*T)(t)
  328. layout.Timestamp = (*xsdDateTime)(&layout.T.Timestamp)
  329. return e.EncodeElement(layout, start)
  330. }
  331. func (t *GetObjectAccessControlPolicy) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
  332. type T GetObjectAccessControlPolicy
  333. var overlay struct {
  334. *T
  335. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  336. }
  337. overlay.T = (*T)(t)
  338. overlay.Timestamp = (*xsdDateTime)(&overlay.T.Timestamp)
  339. return d.DecodeElement(&overlay, &start)
  340. }
  341. type GetObjectAccessControlPolicyResponse struct {
  342. GetObjectAccessControlPolicyResponse AccessControlPolicy `xml:"http://s3.amazonaws.com/doc/2006-03-01/ GetObjectAccessControlPolicyResponse"`
  343. }
  344. type GetObjectExtended struct {
  345. Bucket string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Bucket"`
  346. Key string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Key"`
  347. GetMetadata bool `xml:"http://s3.amazonaws.com/doc/2006-03-01/ GetMetadata"`
  348. GetData bool `xml:"http://s3.amazonaws.com/doc/2006-03-01/ GetData"`
  349. InlineData bool `xml:"http://s3.amazonaws.com/doc/2006-03-01/ InlineData"`
  350. ByteRangeStart int64 `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ByteRangeStart,omitempty"`
  351. ByteRangeEnd int64 `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ByteRangeEnd,omitempty"`
  352. IfModifiedSince time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ IfModifiedSince,omitempty"`
  353. IfUnmodifiedSince time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ IfUnmodifiedSince,omitempty"`
  354. IfMatch []string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ IfMatch,omitempty"`
  355. IfNoneMatch []string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ IfNoneMatch,omitempty"`
  356. ReturnCompleteObjectOnConditionFailure bool `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ReturnCompleteObjectOnConditionFailure,omitempty"`
  357. AWSAccessKeyId string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AWSAccessKeyId,omitempty"`
  358. Timestamp time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  359. Signature string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Signature,omitempty"`
  360. Credential string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Credential,omitempty"`
  361. }
  362. func (t *GetObjectExtended) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  363. type T GetObjectExtended
  364. var layout struct {
  365. *T
  366. IfModifiedSince *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ IfModifiedSince,omitempty"`
  367. IfUnmodifiedSince *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ IfUnmodifiedSince,omitempty"`
  368. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  369. }
  370. layout.T = (*T)(t)
  371. layout.IfModifiedSince = (*xsdDateTime)(&layout.T.IfModifiedSince)
  372. layout.IfUnmodifiedSince = (*xsdDateTime)(&layout.T.IfUnmodifiedSince)
  373. layout.Timestamp = (*xsdDateTime)(&layout.T.Timestamp)
  374. return e.EncodeElement(layout, start)
  375. }
  376. func (t *GetObjectExtended) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
  377. type T GetObjectExtended
  378. var overlay struct {
  379. *T
  380. IfModifiedSince *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ IfModifiedSince,omitempty"`
  381. IfUnmodifiedSince *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ IfUnmodifiedSince,omitempty"`
  382. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  383. }
  384. overlay.T = (*T)(t)
  385. overlay.IfModifiedSince = (*xsdDateTime)(&overlay.T.IfModifiedSince)
  386. overlay.IfUnmodifiedSince = (*xsdDateTime)(&overlay.T.IfUnmodifiedSince)
  387. overlay.Timestamp = (*xsdDateTime)(&overlay.T.Timestamp)
  388. return d.DecodeElement(&overlay, &start)
  389. }
  390. type GetObjectExtendedResponse struct {
  391. GetObjectResponse GetObjectResult `xml:"http://s3.amazonaws.com/doc/2006-03-01/ GetObjectResponse"`
  392. }
  393. type GetObjectResponse struct {
  394. GetObjectResponse GetObjectResult `xml:"http://s3.amazonaws.com/doc/2006-03-01/ GetObjectResponse"`
  395. }
  396. type GetObjectResult struct {
  397. Metadata []MetadataEntry `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Metadata,omitempty"`
  398. Data []byte `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Data,omitempty"`
  399. LastModified time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LastModified"`
  400. ETag string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ETag"`
  401. Status Status `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Status"`
  402. }
  403. func (t *GetObjectResult) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  404. type T GetObjectResult
  405. var layout struct {
  406. *T
  407. Data *xsdBase64Binary `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Data,omitempty"`
  408. LastModified *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LastModified"`
  409. }
  410. layout.T = (*T)(t)
  411. layout.Data = (*xsdBase64Binary)(&layout.T.Data)
  412. layout.LastModified = (*xsdDateTime)(&layout.T.LastModified)
  413. return e.EncodeElement(layout, start)
  414. }
  415. func (t *GetObjectResult) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
  416. type T GetObjectResult
  417. var overlay struct {
  418. *T
  419. Data *xsdBase64Binary `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Data,omitempty"`
  420. LastModified *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LastModified"`
  421. }
  422. overlay.T = (*T)(t)
  423. overlay.Data = (*xsdBase64Binary)(&overlay.T.Data)
  424. overlay.LastModified = (*xsdDateTime)(&overlay.T.LastModified)
  425. return d.DecodeElement(&overlay, &start)
  426. }
  427. type Grant struct {
  428. Grantee Grantee `xml:"Grantee"`
  429. Permission Permission `xml:"Permission"`
  430. }
  431. type Grantee struct {
  432. XMLNS string `xml:"xmlns:xsi,attr"`
  433. XMLXSI string `xml:"xsi:type,attr"`
  434. Type string `xml:"Type"`
  435. ID string `xml:"ID,omitempty"`
  436. DisplayName string `xml:"DisplayName,omitempty"`
  437. URI string `xml:"URI,omitempty"`
  438. }
  439. type Group struct {
  440. URI string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ URI"`
  441. }
  442. type ListAllMyBuckets struct {
  443. AWSAccessKeyId string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AWSAccessKeyId,omitempty"`
  444. Timestamp time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  445. Signature string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Signature,omitempty"`
  446. }
  447. func (t *ListAllMyBuckets) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  448. type T ListAllMyBuckets
  449. var layout struct {
  450. *T
  451. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  452. }
  453. layout.T = (*T)(t)
  454. layout.Timestamp = (*xsdDateTime)(&layout.T.Timestamp)
  455. return e.EncodeElement(layout, start)
  456. }
  457. func (t *ListAllMyBuckets) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
  458. type T ListAllMyBuckets
  459. var overlay struct {
  460. *T
  461. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  462. }
  463. overlay.T = (*T)(t)
  464. overlay.Timestamp = (*xsdDateTime)(&overlay.T.Timestamp)
  465. return d.DecodeElement(&overlay, &start)
  466. }
  467. type ListAllMyBucketsEntry struct {
  468. Name string `xml:"Name"`
  469. CreationDate time.Time `xml:"CreationDate"`
  470. }
  471. func (t *ListAllMyBucketsEntry) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  472. type T ListAllMyBucketsEntry
  473. var layout struct {
  474. *T
  475. CreationDate *xsdDateTime `xml:"CreationDate"`
  476. }
  477. layout.T = (*T)(t)
  478. layout.CreationDate = (*xsdDateTime)(&layout.T.CreationDate)
  479. return e.EncodeElement(layout, start)
  480. }
  481. func (t *ListAllMyBucketsEntry) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
  482. type T ListAllMyBucketsEntry
  483. var overlay struct {
  484. *T
  485. CreationDate *xsdDateTime `xml:"CreationDate"`
  486. }
  487. overlay.T = (*T)(t)
  488. overlay.CreationDate = (*xsdDateTime)(&overlay.T.CreationDate)
  489. return d.DecodeElement(&overlay, &start)
  490. }
  491. type ListAllMyBucketsList struct {
  492. Bucket []ListAllMyBucketsEntry `xml:"Bucket,omitempty"`
  493. }
  494. type ListAllMyBucketsResponse struct {
  495. ListAllMyBucketsResponse ListAllMyBucketsResult `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ListAllMyBucketsResponse"`
  496. }
  497. type ListBucket struct {
  498. Bucket string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Bucket"`
  499. Prefix string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Prefix,omitempty"`
  500. Marker string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Marker,omitempty"`
  501. MaxKeys int `xml:"http://s3.amazonaws.com/doc/2006-03-01/ MaxKeys,omitempty"`
  502. Delimiter string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Delimiter,omitempty"`
  503. AWSAccessKeyId string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AWSAccessKeyId,omitempty"`
  504. Timestamp time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  505. Signature string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Signature,omitempty"`
  506. Credential string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Credential,omitempty"`
  507. }
  508. func (t *ListBucket) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  509. type T ListBucket
  510. var layout struct {
  511. *T
  512. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  513. }
  514. layout.T = (*T)(t)
  515. layout.Timestamp = (*xsdDateTime)(&layout.T.Timestamp)
  516. return e.EncodeElement(layout, start)
  517. }
  518. func (t *ListBucket) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
  519. type T ListBucket
  520. var overlay struct {
  521. *T
  522. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  523. }
  524. overlay.T = (*T)(t)
  525. overlay.Timestamp = (*xsdDateTime)(&overlay.T.Timestamp)
  526. return d.DecodeElement(&overlay, &start)
  527. }
  528. type ListBucketResponse struct {
  529. ListBucketResponse ListBucketResult `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ListBucketResponse"`
  530. }
  531. type ListBucketResult struct {
  532. XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ListBucketResult"`
  533. Metadata []MetadataEntry `xml:"Metadata,omitempty"`
  534. Name string `xml:"Name"`
  535. Prefix string `xml:"Prefix"`
  536. Marker string `xml:"Marker"`
  537. NextMarker string `xml:"NextMarker,omitempty"`
  538. MaxKeys int `xml:"MaxKeys"`
  539. Delimiter string `xml:"Delimiter,omitempty"`
  540. IsTruncated bool `xml:"IsTruncated"`
  541. Contents []ListEntry `xml:"Contents,omitempty"`
  542. CommonPrefixes []PrefixEntry `xml:"CommonPrefixes,omitempty"`
  543. }
  544. type ListEntry struct {
  545. Key string `xml:"Key"`
  546. LastModified time.Time `xml:"LastModified"`
  547. ETag string `xml:"ETag"`
  548. Size int64 `xml:"Size"`
  549. Owner CanonicalUser `xml:"Owner,omitempty"`
  550. StorageClass StorageClass `xml:"StorageClass"`
  551. }
  552. func (t *ListEntry) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  553. type T ListEntry
  554. var layout struct {
  555. *T
  556. LastModified *xsdDateTime `xml:"LastModified"`
  557. }
  558. layout.T = (*T)(t)
  559. layout.LastModified = (*xsdDateTime)(&layout.T.LastModified)
  560. return e.EncodeElement(layout, start)
  561. }
  562. func (t *ListEntry) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
  563. type T ListEntry
  564. var overlay struct {
  565. *T
  566. LastModified *xsdDateTime `xml:"LastModified"`
  567. }
  568. overlay.T = (*T)(t)
  569. overlay.LastModified = (*xsdDateTime)(&overlay.T.LastModified)
  570. return d.DecodeElement(&overlay, &start)
  571. }
  572. type ListVersionsResponse struct {
  573. ListVersionsResponse ListVersionsResult `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ListVersionsResponse"`
  574. }
  575. type ListVersionsResult struct {
  576. Metadata []MetadataEntry `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Metadata,omitempty"`
  577. Name string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Name"`
  578. Prefix string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Prefix"`
  579. KeyMarker string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ KeyMarker"`
  580. VersionIdMarker string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ VersionIdMarker"`
  581. NextKeyMarker string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ NextKeyMarker,omitempty"`
  582. NextVersionIdMarker string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ NextVersionIdMarker,omitempty"`
  583. MaxKeys int `xml:"http://s3.amazonaws.com/doc/2006-03-01/ MaxKeys"`
  584. Delimiter string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Delimiter,omitempty"`
  585. IsTruncated bool `xml:"http://s3.amazonaws.com/doc/2006-03-01/ IsTruncated"`
  586. Version VersionEntry `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Version"`
  587. DeleteMarker DeleteMarkerEntry `xml:"http://s3.amazonaws.com/doc/2006-03-01/ DeleteMarker"`
  588. CommonPrefixes []PrefixEntry `xml:"http://s3.amazonaws.com/doc/2006-03-01/ CommonPrefixes,omitempty"`
  589. }
  590. type LocationConstraint struct {
  591. LocationConstraint string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LocationConstraint"`
  592. }
  593. type LoggingSettings struct {
  594. TargetBucket string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ TargetBucket"`
  595. TargetPrefix string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ TargetPrefix"`
  596. TargetGrants AccessControlList `xml:"http://s3.amazonaws.com/doc/2006-03-01/ TargetGrants,omitempty"`
  597. }
  598. // May be one of COPY, REPLACE
  599. type MetadataDirective string
  600. type MetadataEntry struct {
  601. Name string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Name"`
  602. Value string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Value"`
  603. }
  604. // May be one of Enabled, Disabled
  605. type MfaDeleteStatus string
  606. type NotificationConfiguration struct {
  607. TopicConfiguration []TopicConfiguration `xml:"http://s3.amazonaws.com/doc/2006-03-01/ TopicConfiguration,omitempty"`
  608. }
  609. // May be one of BucketOwner, Requester
  610. type Payer string
  611. // May be one of READ, WRITE, READ_ACP, WRITE_ACP, FULL_CONTROL
  612. type Permission string
  613. type PostResponse struct {
  614. Location string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Location"`
  615. Bucket string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Bucket"`
  616. Key string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Key"`
  617. ETag string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ETag"`
  618. }
  619. type PrefixEntry struct {
  620. Prefix string `xml:"Prefix"`
  621. }
  622. type PutObject struct {
  623. Bucket string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Bucket"`
  624. Key string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Key"`
  625. Metadata []MetadataEntry `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Metadata,omitempty"`
  626. ContentLength int64 `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ContentLength"`
  627. AccessControlList AccessControlList `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AccessControlList,omitempty"`
  628. StorageClass StorageClass `xml:"http://s3.amazonaws.com/doc/2006-03-01/ StorageClass,omitempty"`
  629. AWSAccessKeyId string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AWSAccessKeyId,omitempty"`
  630. Timestamp time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  631. Signature string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Signature,omitempty"`
  632. Credential string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Credential,omitempty"`
  633. }
  634. func (t *PutObject) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  635. type T PutObject
  636. var layout struct {
  637. *T
  638. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  639. }
  640. layout.T = (*T)(t)
  641. layout.Timestamp = (*xsdDateTime)(&layout.T.Timestamp)
  642. return e.EncodeElement(layout, start)
  643. }
  644. func (t *PutObject) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
  645. type T PutObject
  646. var overlay struct {
  647. *T
  648. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  649. }
  650. overlay.T = (*T)(t)
  651. overlay.Timestamp = (*xsdDateTime)(&overlay.T.Timestamp)
  652. return d.DecodeElement(&overlay, &start)
  653. }
  654. type PutObjectInline struct {
  655. Bucket string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Bucket"`
  656. Key string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Key"`
  657. Metadata []MetadataEntry `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Metadata,omitempty"`
  658. Data []byte `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Data"`
  659. ContentLength int64 `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ContentLength"`
  660. AccessControlList AccessControlList `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AccessControlList,omitempty"`
  661. StorageClass StorageClass `xml:"http://s3.amazonaws.com/doc/2006-03-01/ StorageClass,omitempty"`
  662. AWSAccessKeyId string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AWSAccessKeyId,omitempty"`
  663. Timestamp time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  664. Signature string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Signature,omitempty"`
  665. Credential string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Credential,omitempty"`
  666. }
  667. func (t *PutObjectInline) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  668. type T PutObjectInline
  669. var layout struct {
  670. *T
  671. Data *xsdBase64Binary `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Data"`
  672. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  673. }
  674. layout.T = (*T)(t)
  675. layout.Data = (*xsdBase64Binary)(&layout.T.Data)
  676. layout.Timestamp = (*xsdDateTime)(&layout.T.Timestamp)
  677. return e.EncodeElement(layout, start)
  678. }
  679. func (t *PutObjectInline) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
  680. type T PutObjectInline
  681. var overlay struct {
  682. *T
  683. Data *xsdBase64Binary `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Data"`
  684. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  685. }
  686. overlay.T = (*T)(t)
  687. overlay.Data = (*xsdBase64Binary)(&overlay.T.Data)
  688. overlay.Timestamp = (*xsdDateTime)(&overlay.T.Timestamp)
  689. return d.DecodeElement(&overlay, &start)
  690. }
  691. type PutObjectInlineResponse struct {
  692. PutObjectInlineResponse PutObjectResult `xml:"http://s3.amazonaws.com/doc/2006-03-01/ PutObjectInlineResponse"`
  693. }
  694. type PutObjectResponse struct {
  695. PutObjectResponse PutObjectResult `xml:"http://s3.amazonaws.com/doc/2006-03-01/ PutObjectResponse"`
  696. }
  697. type PutObjectResult struct {
  698. ETag string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ETag"`
  699. LastModified time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LastModified"`
  700. }
  701. func (t *PutObjectResult) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  702. type T PutObjectResult
  703. var layout struct {
  704. *T
  705. LastModified *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LastModified"`
  706. }
  707. layout.T = (*T)(t)
  708. layout.LastModified = (*xsdDateTime)(&layout.T.LastModified)
  709. return e.EncodeElement(layout, start)
  710. }
  711. func (t *PutObjectResult) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
  712. type T PutObjectResult
  713. var overlay struct {
  714. *T
  715. LastModified *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LastModified"`
  716. }
  717. overlay.T = (*T)(t)
  718. overlay.LastModified = (*xsdDateTime)(&overlay.T.LastModified)
  719. return d.DecodeElement(&overlay, &start)
  720. }
  721. type RequestPaymentConfiguration struct {
  722. Payer Payer `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Payer"`
  723. }
  724. type Result struct {
  725. Status Status `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Status"`
  726. }
  727. type SetBucketAccessControlPolicy struct {
  728. Bucket string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Bucket"`
  729. AccessControlList AccessControlList `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AccessControlList,omitempty"`
  730. AWSAccessKeyId string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AWSAccessKeyId,omitempty"`
  731. Timestamp time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  732. Signature string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Signature,omitempty"`
  733. Credential string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Credential,omitempty"`
  734. }
  735. func (t *SetBucketAccessControlPolicy) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  736. type T SetBucketAccessControlPolicy
  737. var layout struct {
  738. *T
  739. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  740. }
  741. layout.T = (*T)(t)
  742. layout.Timestamp = (*xsdDateTime)(&layout.T.Timestamp)
  743. return e.EncodeElement(layout, start)
  744. }
  745. func (t *SetBucketAccessControlPolicy) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
  746. type T SetBucketAccessControlPolicy
  747. var overlay struct {
  748. *T
  749. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  750. }
  751. overlay.T = (*T)(t)
  752. overlay.Timestamp = (*xsdDateTime)(&overlay.T.Timestamp)
  753. return d.DecodeElement(&overlay, &start)
  754. }
  755. type SetBucketAccessControlPolicyResponse struct {
  756. }
  757. type SetBucketLoggingStatus struct {
  758. Bucket string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Bucket"`
  759. AWSAccessKeyId string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AWSAccessKeyId,omitempty"`
  760. Timestamp time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  761. Signature string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Signature,omitempty"`
  762. Credential string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Credential,omitempty"`
  763. BucketLoggingStatus BucketLoggingStatus `xml:"http://s3.amazonaws.com/doc/2006-03-01/ BucketLoggingStatus"`
  764. }
  765. func (t *SetBucketLoggingStatus) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  766. type T SetBucketLoggingStatus
  767. var layout struct {
  768. *T
  769. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  770. }
  771. layout.T = (*T)(t)
  772. layout.Timestamp = (*xsdDateTime)(&layout.T.Timestamp)
  773. return e.EncodeElement(layout, start)
  774. }
  775. func (t *SetBucketLoggingStatus) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
  776. type T SetBucketLoggingStatus
  777. var overlay struct {
  778. *T
  779. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  780. }
  781. overlay.T = (*T)(t)
  782. overlay.Timestamp = (*xsdDateTime)(&overlay.T.Timestamp)
  783. return d.DecodeElement(&overlay, &start)
  784. }
  785. type SetBucketLoggingStatusResponse struct {
  786. }
  787. type SetObjectAccessControlPolicy struct {
  788. Bucket string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Bucket"`
  789. Key string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Key"`
  790. AccessControlList AccessControlList `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AccessControlList"`
  791. AWSAccessKeyId string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AWSAccessKeyId,omitempty"`
  792. Timestamp time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  793. Signature string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Signature,omitempty"`
  794. Credential string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Credential,omitempty"`
  795. }
  796. func (t *SetObjectAccessControlPolicy) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  797. type T SetObjectAccessControlPolicy
  798. var layout struct {
  799. *T
  800. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  801. }
  802. layout.T = (*T)(t)
  803. layout.Timestamp = (*xsdDateTime)(&layout.T.Timestamp)
  804. return e.EncodeElement(layout, start)
  805. }
  806. func (t *SetObjectAccessControlPolicy) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
  807. type T SetObjectAccessControlPolicy
  808. var overlay struct {
  809. *T
  810. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  811. }
  812. overlay.T = (*T)(t)
  813. overlay.Timestamp = (*xsdDateTime)(&overlay.T.Timestamp)
  814. return d.DecodeElement(&overlay, &start)
  815. }
  816. type SetObjectAccessControlPolicyResponse struct {
  817. }
  818. type Status struct {
  819. Code int `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Code"`
  820. Description string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Description"`
  821. }
  822. // May be one of STANDARD, REDUCED_REDUNDANCY, GLACIER, UNKNOWN
  823. type StorageClass string
  824. type TopicConfiguration struct {
  825. Topic string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Topic"`
  826. Event []string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Event"`
  827. }
  828. type User struct {
  829. }
  830. type VersionEntry struct {
  831. Key string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Key"`
  832. VersionId string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ VersionId"`
  833. IsLatest bool `xml:"http://s3.amazonaws.com/doc/2006-03-01/ IsLatest"`
  834. LastModified time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LastModified"`
  835. ETag string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ETag"`
  836. Size int64 `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Size"`
  837. Owner CanonicalUser `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Owner,omitempty"`
  838. StorageClass StorageClass `xml:"http://s3.amazonaws.com/doc/2006-03-01/ StorageClass"`
  839. }
  840. func (t *VersionEntry) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  841. type T VersionEntry
  842. var layout struct {
  843. *T
  844. LastModified *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LastModified"`
  845. }
  846. layout.T = (*T)(t)
  847. layout.LastModified = (*xsdDateTime)(&layout.T.LastModified)
  848. return e.EncodeElement(layout, start)
  849. }
  850. func (t *VersionEntry) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
  851. type T VersionEntry
  852. var overlay struct {
  853. *T
  854. LastModified *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LastModified"`
  855. }
  856. overlay.T = (*T)(t)
  857. overlay.LastModified = (*xsdDateTime)(&overlay.T.LastModified)
  858. return d.DecodeElement(&overlay, &start)
  859. }
  860. type VersioningConfiguration struct {
  861. Status VersioningStatus `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Status,omitempty"`
  862. MfaDelete MfaDeleteStatus `xml:"http://s3.amazonaws.com/doc/2006-03-01/ MfaDelete,omitempty"`
  863. }
  864. // May be one of Enabled, Suspended
  865. type VersioningStatus string
  866. type xsdBase64Binary []byte
  867. func (b *xsdBase64Binary) UnmarshalText(text []byte) (err error) {
  868. *b, err = base64.StdEncoding.DecodeString(string(text))
  869. return
  870. }
  871. func (b xsdBase64Binary) MarshalText() ([]byte, error) {
  872. var buf bytes.Buffer
  873. enc := base64.NewEncoder(base64.StdEncoding, &buf)
  874. enc.Write([]byte(b))
  875. enc.Close()
  876. return buf.Bytes(), nil
  877. }
  878. type xsdDateTime time.Time
  879. func (t *xsdDateTime) UnmarshalText(text []byte) error {
  880. return _unmarshalTime(text, (*time.Time)(t), s3TimeFormat)
  881. }
  882. func (t xsdDateTime) MarshalText() ([]byte, error) {
  883. return []byte((time.Time)(t).Format(s3TimeFormat)), nil
  884. }
  885. func (t xsdDateTime) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  886. if (time.Time)(t).IsZero() {
  887. return nil
  888. }
  889. m, err := t.MarshalText()
  890. if err != nil {
  891. return err
  892. }
  893. return e.EncodeElement(m, start)
  894. }
  895. func (t xsdDateTime) MarshalXMLAttr(name xml.Name) (xml.Attr, error) {
  896. if (time.Time)(t).IsZero() {
  897. return xml.Attr{}, nil
  898. }
  899. m, err := t.MarshalText()
  900. return xml.Attr{Name: name, Value: string(m)}, err
  901. }
  902. func _unmarshalTime(text []byte, t *time.Time, format string) (err error) {
  903. s := string(bytes.TrimSpace(text))
  904. *t, err = time.Parse(format, s)
  905. if _, ok := err.(*time.ParseError); ok {
  906. *t, err = time.Parse(format+"Z07:00", s)
  907. }
  908. return err
  909. }