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.

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