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.

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