s3api_xsd_generated.go 43 KB

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