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.

997 lines
44 KiB

  1. package s3api
  2. import (
  3. "bytes"
  4. "encoding/base64"
  5. "encoding/xml"
  6. "time"
  7. )
  8. type AccessControlList struct {
  9. Grant []Grant `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Grant,omitempty"`
  10. }
  11. type AccessControlPolicy struct {
  12. Owner CanonicalUser `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Owner"`
  13. AccessControlList AccessControlList `xml:"http://s3.amazonaws.com/doc/2006-03-01/ 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:"http://s3.amazonaws.com/doc/2006-03-01/ ID"`
  23. DisplayName string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ 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:"http://s3.amazonaws.com/doc/2006-03-01/ Grantee"`
  429. Permission Permission `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Permission"`
  430. }
  431. type Grantee struct {
  432. }
  433. type Group struct {
  434. URI string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ URI"`
  435. }
  436. type ListAllMyBuckets struct {
  437. AWSAccessKeyId string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AWSAccessKeyId,omitempty"`
  438. Timestamp time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  439. Signature string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Signature,omitempty"`
  440. }
  441. func (t *ListAllMyBuckets) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  442. type T ListAllMyBuckets
  443. var layout struct {
  444. *T
  445. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  446. }
  447. layout.T = (*T)(t)
  448. layout.Timestamp = (*xsdDateTime)(&layout.T.Timestamp)
  449. return e.EncodeElement(layout, start)
  450. }
  451. func (t *ListAllMyBuckets) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
  452. type T ListAllMyBuckets
  453. var overlay struct {
  454. *T
  455. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  456. }
  457. overlay.T = (*T)(t)
  458. overlay.Timestamp = (*xsdDateTime)(&overlay.T.Timestamp)
  459. return d.DecodeElement(&overlay, &start)
  460. }
  461. type ListAllMyBucketsEntry struct {
  462. Name string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Name"`
  463. CreationDate time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ CreationDate"`
  464. }
  465. func (t *ListAllMyBucketsEntry) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  466. type T ListAllMyBucketsEntry
  467. var layout struct {
  468. *T
  469. CreationDate *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ CreationDate"`
  470. }
  471. layout.T = (*T)(t)
  472. layout.CreationDate = (*xsdDateTime)(&layout.T.CreationDate)
  473. return e.EncodeElement(layout, start)
  474. }
  475. func (t *ListAllMyBucketsEntry) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
  476. type T ListAllMyBucketsEntry
  477. var overlay struct {
  478. *T
  479. CreationDate *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ CreationDate"`
  480. }
  481. overlay.T = (*T)(t)
  482. overlay.CreationDate = (*xsdDateTime)(&overlay.T.CreationDate)
  483. return d.DecodeElement(&overlay, &start)
  484. }
  485. type ListAllMyBucketsList struct {
  486. Bucket []ListAllMyBucketsEntry `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Bucket,omitempty"`
  487. }
  488. type ListAllMyBucketsResponse struct {
  489. ListAllMyBucketsResponse ListAllMyBucketsResult `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ListAllMyBucketsResponse"`
  490. }
  491. type ListBucket struct {
  492. Bucket string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Bucket"`
  493. Prefix string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Prefix,omitempty"`
  494. Marker string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Marker,omitempty"`
  495. MaxKeys int `xml:"http://s3.amazonaws.com/doc/2006-03-01/ MaxKeys,omitempty"`
  496. Delimiter string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Delimiter,omitempty"`
  497. AWSAccessKeyId string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AWSAccessKeyId,omitempty"`
  498. Timestamp time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  499. Signature string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Signature,omitempty"`
  500. Credential string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Credential,omitempty"`
  501. }
  502. func (t *ListBucket) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  503. type T ListBucket
  504. var layout struct {
  505. *T
  506. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  507. }
  508. layout.T = (*T)(t)
  509. layout.Timestamp = (*xsdDateTime)(&layout.T.Timestamp)
  510. return e.EncodeElement(layout, start)
  511. }
  512. func (t *ListBucket) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
  513. type T ListBucket
  514. var overlay struct {
  515. *T
  516. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  517. }
  518. overlay.T = (*T)(t)
  519. overlay.Timestamp = (*xsdDateTime)(&overlay.T.Timestamp)
  520. return d.DecodeElement(&overlay, &start)
  521. }
  522. type ListBucketResponse struct {
  523. ListBucketResponse ListBucketResult `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ListBucketResponse"`
  524. }
  525. type ListBucketResult struct {
  526. Metadata []MetadataEntry `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Metadata,omitempty"`
  527. Name string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Name"`
  528. Prefix string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Prefix"`
  529. Marker string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Marker"`
  530. NextMarker string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ NextMarker,omitempty"`
  531. MaxKeys int `xml:"http://s3.amazonaws.com/doc/2006-03-01/ MaxKeys"`
  532. Delimiter string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Delimiter,omitempty"`
  533. IsTruncated bool `xml:"http://s3.amazonaws.com/doc/2006-03-01/ IsTruncated"`
  534. Contents []ListEntry `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Contents,omitempty"`
  535. CommonPrefixes []PrefixEntry `xml:"http://s3.amazonaws.com/doc/2006-03-01/ CommonPrefixes,omitempty"`
  536. }
  537. type ListEntry struct {
  538. Key string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Key"`
  539. LastModified time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LastModified"`
  540. ETag string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ETag"`
  541. Size int64 `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Size"`
  542. Owner CanonicalUser `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Owner,omitempty"`
  543. StorageClass StorageClass `xml:"http://s3.amazonaws.com/doc/2006-03-01/ StorageClass"`
  544. }
  545. func (t *ListEntry) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  546. type T ListEntry
  547. var layout struct {
  548. *T
  549. LastModified *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LastModified"`
  550. }
  551. layout.T = (*T)(t)
  552. layout.LastModified = (*xsdDateTime)(&layout.T.LastModified)
  553. return e.EncodeElement(layout, start)
  554. }
  555. func (t *ListEntry) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
  556. type T ListEntry
  557. var overlay struct {
  558. *T
  559. LastModified *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LastModified"`
  560. }
  561. overlay.T = (*T)(t)
  562. overlay.LastModified = (*xsdDateTime)(&overlay.T.LastModified)
  563. return d.DecodeElement(&overlay, &start)
  564. }
  565. type ListVersionsResponse struct {
  566. ListVersionsResponse ListVersionsResult `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ListVersionsResponse"`
  567. }
  568. type ListVersionsResult struct {
  569. Metadata []MetadataEntry `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Metadata,omitempty"`
  570. Name string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Name"`
  571. Prefix string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Prefix"`
  572. KeyMarker string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ KeyMarker"`
  573. VersionIdMarker string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ VersionIdMarker"`
  574. NextKeyMarker string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ NextKeyMarker,omitempty"`
  575. NextVersionIdMarker string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ NextVersionIdMarker,omitempty"`
  576. MaxKeys int `xml:"http://s3.amazonaws.com/doc/2006-03-01/ MaxKeys"`
  577. Delimiter string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Delimiter,omitempty"`
  578. IsTruncated bool `xml:"http://s3.amazonaws.com/doc/2006-03-01/ IsTruncated"`
  579. Version VersionEntry `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Version"`
  580. DeleteMarker DeleteMarkerEntry `xml:"http://s3.amazonaws.com/doc/2006-03-01/ DeleteMarker"`
  581. CommonPrefixes []PrefixEntry `xml:"http://s3.amazonaws.com/doc/2006-03-01/ CommonPrefixes,omitempty"`
  582. }
  583. type LoggingSettings struct {
  584. TargetBucket string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ TargetBucket"`
  585. TargetPrefix string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ TargetPrefix"`
  586. TargetGrants AccessControlList `xml:"http://s3.amazonaws.com/doc/2006-03-01/ TargetGrants,omitempty"`
  587. }
  588. // May be one of COPY, REPLACE
  589. type MetadataDirective string
  590. type MetadataEntry struct {
  591. Name string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Name"`
  592. Value string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Value"`
  593. }
  594. // May be one of Enabled, Disabled
  595. type MfaDeleteStatus string
  596. type NotificationConfiguration struct {
  597. TopicConfiguration []TopicConfiguration `xml:"http://s3.amazonaws.com/doc/2006-03-01/ TopicConfiguration,omitempty"`
  598. }
  599. // May be one of BucketOwner, Requester
  600. type Payer string
  601. // May be one of READ, WRITE, READ_ACP, WRITE_ACP, FULL_CONTROL
  602. type Permission string
  603. type PostResponse struct {
  604. Location string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Location"`
  605. Bucket string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Bucket"`
  606. Key string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Key"`
  607. ETag string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ETag"`
  608. }
  609. type PrefixEntry struct {
  610. Prefix string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Prefix"`
  611. }
  612. type PutObject struct {
  613. Bucket string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Bucket"`
  614. Key string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Key"`
  615. Metadata []MetadataEntry `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Metadata,omitempty"`
  616. ContentLength int64 `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ContentLength"`
  617. AccessControlList AccessControlList `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AccessControlList,omitempty"`
  618. StorageClass StorageClass `xml:"http://s3.amazonaws.com/doc/2006-03-01/ StorageClass,omitempty"`
  619. AWSAccessKeyId string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AWSAccessKeyId,omitempty"`
  620. Timestamp time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  621. Signature string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Signature,omitempty"`
  622. Credential string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Credential,omitempty"`
  623. }
  624. func (t *PutObject) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  625. type T PutObject
  626. var layout struct {
  627. *T
  628. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  629. }
  630. layout.T = (*T)(t)
  631. layout.Timestamp = (*xsdDateTime)(&layout.T.Timestamp)
  632. return e.EncodeElement(layout, start)
  633. }
  634. func (t *PutObject) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
  635. type T PutObject
  636. var overlay struct {
  637. *T
  638. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  639. }
  640. overlay.T = (*T)(t)
  641. overlay.Timestamp = (*xsdDateTime)(&overlay.T.Timestamp)
  642. return d.DecodeElement(&overlay, &start)
  643. }
  644. type PutObjectInline struct {
  645. Bucket string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Bucket"`
  646. Key string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Key"`
  647. Metadata []MetadataEntry `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Metadata,omitempty"`
  648. Data []byte `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Data"`
  649. ContentLength int64 `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ContentLength"`
  650. AccessControlList AccessControlList `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AccessControlList,omitempty"`
  651. StorageClass StorageClass `xml:"http://s3.amazonaws.com/doc/2006-03-01/ StorageClass,omitempty"`
  652. AWSAccessKeyId string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AWSAccessKeyId,omitempty"`
  653. Timestamp time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  654. Signature string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Signature,omitempty"`
  655. Credential string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Credential,omitempty"`
  656. }
  657. func (t *PutObjectInline) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  658. type T PutObjectInline
  659. var layout struct {
  660. *T
  661. Data *xsdBase64Binary `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Data"`
  662. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  663. }
  664. layout.T = (*T)(t)
  665. layout.Data = (*xsdBase64Binary)(&layout.T.Data)
  666. layout.Timestamp = (*xsdDateTime)(&layout.T.Timestamp)
  667. return e.EncodeElement(layout, start)
  668. }
  669. func (t *PutObjectInline) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
  670. type T PutObjectInline
  671. var overlay struct {
  672. *T
  673. Data *xsdBase64Binary `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Data"`
  674. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  675. }
  676. overlay.T = (*T)(t)
  677. overlay.Data = (*xsdBase64Binary)(&overlay.T.Data)
  678. overlay.Timestamp = (*xsdDateTime)(&overlay.T.Timestamp)
  679. return d.DecodeElement(&overlay, &start)
  680. }
  681. type PutObjectInlineResponse struct {
  682. PutObjectInlineResponse PutObjectResult `xml:"http://s3.amazonaws.com/doc/2006-03-01/ PutObjectInlineResponse"`
  683. }
  684. type PutObjectResponse struct {
  685. PutObjectResponse PutObjectResult `xml:"http://s3.amazonaws.com/doc/2006-03-01/ PutObjectResponse"`
  686. }
  687. type PutObjectResult struct {
  688. ETag string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ETag"`
  689. LastModified time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LastModified"`
  690. }
  691. func (t *PutObjectResult) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  692. type T PutObjectResult
  693. var layout struct {
  694. *T
  695. LastModified *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LastModified"`
  696. }
  697. layout.T = (*T)(t)
  698. layout.LastModified = (*xsdDateTime)(&layout.T.LastModified)
  699. return e.EncodeElement(layout, start)
  700. }
  701. func (t *PutObjectResult) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
  702. type T PutObjectResult
  703. var overlay struct {
  704. *T
  705. LastModified *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LastModified"`
  706. }
  707. overlay.T = (*T)(t)
  708. overlay.LastModified = (*xsdDateTime)(&overlay.T.LastModified)
  709. return d.DecodeElement(&overlay, &start)
  710. }
  711. type RequestPaymentConfiguration struct {
  712. Payer Payer `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Payer"`
  713. }
  714. type Result struct {
  715. Status Status `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Status"`
  716. }
  717. type SetBucketAccessControlPolicy struct {
  718. Bucket string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Bucket"`
  719. AccessControlList AccessControlList `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AccessControlList,omitempty"`
  720. AWSAccessKeyId string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AWSAccessKeyId,omitempty"`
  721. Timestamp time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  722. Signature string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Signature,omitempty"`
  723. Credential string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Credential,omitempty"`
  724. }
  725. func (t *SetBucketAccessControlPolicy) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  726. type T SetBucketAccessControlPolicy
  727. var layout struct {
  728. *T
  729. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  730. }
  731. layout.T = (*T)(t)
  732. layout.Timestamp = (*xsdDateTime)(&layout.T.Timestamp)
  733. return e.EncodeElement(layout, start)
  734. }
  735. func (t *SetBucketAccessControlPolicy) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
  736. type T SetBucketAccessControlPolicy
  737. var overlay struct {
  738. *T
  739. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  740. }
  741. overlay.T = (*T)(t)
  742. overlay.Timestamp = (*xsdDateTime)(&overlay.T.Timestamp)
  743. return d.DecodeElement(&overlay, &start)
  744. }
  745. type SetBucketAccessControlPolicyResponse struct {
  746. }
  747. type SetBucketLoggingStatus struct {
  748. Bucket string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Bucket"`
  749. AWSAccessKeyId string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AWSAccessKeyId,omitempty"`
  750. Timestamp time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  751. Signature string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Signature,omitempty"`
  752. Credential string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Credential,omitempty"`
  753. BucketLoggingStatus BucketLoggingStatus `xml:"http://s3.amazonaws.com/doc/2006-03-01/ BucketLoggingStatus"`
  754. }
  755. func (t *SetBucketLoggingStatus) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  756. type T SetBucketLoggingStatus
  757. var layout struct {
  758. *T
  759. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  760. }
  761. layout.T = (*T)(t)
  762. layout.Timestamp = (*xsdDateTime)(&layout.T.Timestamp)
  763. return e.EncodeElement(layout, start)
  764. }
  765. func (t *SetBucketLoggingStatus) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
  766. type T SetBucketLoggingStatus
  767. var overlay struct {
  768. *T
  769. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  770. }
  771. overlay.T = (*T)(t)
  772. overlay.Timestamp = (*xsdDateTime)(&overlay.T.Timestamp)
  773. return d.DecodeElement(&overlay, &start)
  774. }
  775. type SetBucketLoggingStatusResponse struct {
  776. }
  777. type SetObjectAccessControlPolicy struct {
  778. Bucket string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Bucket"`
  779. Key string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Key"`
  780. AccessControlList AccessControlList `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AccessControlList"`
  781. AWSAccessKeyId string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AWSAccessKeyId,omitempty"`
  782. Timestamp time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  783. Signature string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Signature,omitempty"`
  784. Credential string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Credential,omitempty"`
  785. }
  786. func (t *SetObjectAccessControlPolicy) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  787. type T SetObjectAccessControlPolicy
  788. var layout struct {
  789. *T
  790. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  791. }
  792. layout.T = (*T)(t)
  793. layout.Timestamp = (*xsdDateTime)(&layout.T.Timestamp)
  794. return e.EncodeElement(layout, start)
  795. }
  796. func (t *SetObjectAccessControlPolicy) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
  797. type T SetObjectAccessControlPolicy
  798. var overlay struct {
  799. *T
  800. Timestamp *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Timestamp,omitempty"`
  801. }
  802. overlay.T = (*T)(t)
  803. overlay.Timestamp = (*xsdDateTime)(&overlay.T.Timestamp)
  804. return d.DecodeElement(&overlay, &start)
  805. }
  806. type SetObjectAccessControlPolicyResponse struct {
  807. }
  808. type Status struct {
  809. Code int `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Code"`
  810. Description string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Description"`
  811. }
  812. // May be one of STANDARD, REDUCED_REDUNDANCY, GLACIER, UNKNOWN
  813. type StorageClass string
  814. type TopicConfiguration struct {
  815. Topic string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Topic"`
  816. Event []string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Event"`
  817. }
  818. type User struct {
  819. }
  820. type VersionEntry struct {
  821. Key string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Key"`
  822. VersionId string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ VersionId"`
  823. IsLatest bool `xml:"http://s3.amazonaws.com/doc/2006-03-01/ IsLatest"`
  824. LastModified time.Time `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LastModified"`
  825. ETag string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ETag"`
  826. Size int64 `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Size"`
  827. Owner CanonicalUser `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Owner,omitempty"`
  828. StorageClass StorageClass `xml:"http://s3.amazonaws.com/doc/2006-03-01/ StorageClass"`
  829. }
  830. func (t *VersionEntry) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  831. type T VersionEntry
  832. var layout struct {
  833. *T
  834. LastModified *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LastModified"`
  835. }
  836. layout.T = (*T)(t)
  837. layout.LastModified = (*xsdDateTime)(&layout.T.LastModified)
  838. return e.EncodeElement(layout, start)
  839. }
  840. func (t *VersionEntry) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
  841. type T VersionEntry
  842. var overlay struct {
  843. *T
  844. LastModified *xsdDateTime `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LastModified"`
  845. }
  846. overlay.T = (*T)(t)
  847. overlay.LastModified = (*xsdDateTime)(&overlay.T.LastModified)
  848. return d.DecodeElement(&overlay, &start)
  849. }
  850. type VersioningConfiguration struct {
  851. Status VersioningStatus `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Status,omitempty"`
  852. MfaDelete MfaDeleteStatus `xml:"http://s3.amazonaws.com/doc/2006-03-01/ MfaDelete,omitempty"`
  853. }
  854. // May be one of Enabled, Suspended
  855. type VersioningStatus string
  856. type xsdBase64Binary []byte
  857. func (b *xsdBase64Binary) UnmarshalText(text []byte) (err error) {
  858. *b, err = base64.StdEncoding.DecodeString(string(text))
  859. return
  860. }
  861. func (b xsdBase64Binary) MarshalText() ([]byte, error) {
  862. var buf bytes.Buffer
  863. enc := base64.NewEncoder(base64.StdEncoding, &buf)
  864. enc.Write([]byte(b))
  865. enc.Close()
  866. return buf.Bytes(), nil
  867. }
  868. type xsdDateTime time.Time
  869. func (t *xsdDateTime) UnmarshalText(text []byte) error {
  870. return _unmarshalTime(text, (*time.Time)(t), "2006-01-02T15:04:05.999999999")
  871. }
  872. func (t xsdDateTime) MarshalText() ([]byte, error) {
  873. return []byte((time.Time)(t).Format("2006-01-02T15:04:05.999999999")), nil
  874. }
  875. func (t xsdDateTime) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
  876. if (time.Time)(t).IsZero() {
  877. return nil
  878. }
  879. m, err := t.MarshalText()
  880. if err != nil {
  881. return err
  882. }
  883. return e.EncodeElement(m, start)
  884. }
  885. func (t xsdDateTime) MarshalXMLAttr(name xml.Name) (xml.Attr, error) {
  886. if (time.Time)(t).IsZero() {
  887. return xml.Attr{}, nil
  888. }
  889. m, err := t.MarshalText()
  890. return xml.Attr{Name: name, Value: string(m)}, err
  891. }
  892. func _unmarshalTime(text []byte, t *time.Time, format string) (err error) {
  893. s := string(bytes.TrimSpace(text))
  894. *t, err = time.Parse(format, s)
  895. if _, ok := err.(*time.ParseError); ok {
  896. *t, err = time.Parse(format+"Z07:00", s)
  897. }
  898. return err
  899. }