@@ -102,3 +102,61 @@ type Bucket struct {
102102 Region string `xml:"Location,omitempty"`
103103 CreationDate string `xml:",omitempty"`
104104}
105+
106+ type BucketGetObjectVersionsOptions struct {
107+ Prefix string `url:"prefix,omitempty"`
108+ Delimiter string `url:"delimiter,omitempty"`
109+ EncodingType string `url:"encoding-type,omitempty"`
110+ KeyMarker string `url:"key-marker,omitempty"`
111+ VersionIdMarker string `url:"version-id-marker,omitempty"`
112+ MaxKeys int `url:"max-keys,omitempty"`
113+ }
114+
115+ type BucketGetObjectVersionsResult struct {
116+ XMLName xml.Name `xml:"ListVersionsResult"`
117+ Name string `xml:"Name,omitempty"`
118+ EncodingType string `xml:"EncodingType,omitempty"`
119+ Prefix string `xml:"Prefix,omitempty"`
120+ KeyMarker string `xml:"KeyMarker,omitempty"`
121+ VersionIdMarker string `xml:"VersionIdMarker,omitempty"`
122+ MaxKeys int `xml:"MaxKeys,omitempty"`
123+ Delimiter string `xml:"Delimiter,omitempty"`
124+ IsTruncated bool `xml:"IsTruncated,omitempty"`
125+ NextKeyMarker string `xml:"NextKeyMarker,omitempty"`
126+ NextVersionIdMarker string `xml:"NextVersionIdMarker,omitempty"`
127+ CommonPrefixes []string `xml:"CommonPrefixes>Prefix,omitempty"`
128+ Version []ListVersionsResultVersion `xml:"Version,omitempty"`
129+ DeleteMarker []ListVersionsResultDeleteMarker `xml:"DeleteMarker,omitempty"`
130+ }
131+
132+ type ListVersionsResultVersion struct {
133+ Key string `xml:"Key,omitempty"`
134+ VersionId string `xml:"VersionId,omitempty"`
135+ IsLatest bool `xml:"IsLatest,omitempty"`
136+ LastModified string `xml:"LastModified,omitempty"`
137+ ETag string `xml:"ETag,omitempty"`
138+ Size int `xml:"Size,omitempty"`
139+ StorageClass string `xml:"StorageClass,omitempty"`
140+ Owner * Owner `xml:"Owner,omitempty"`
141+ }
142+
143+ type ListVersionsResultDeleteMarker struct {
144+ Key string `xml:"Key,omitempty"`
145+ VersionId string `xml:"VersionId,omitempty"`
146+ IsLatest bool `xml:"IsLatest,omitempty"`
147+ LastModified string `xml:"LastModified,omitempty"`
148+ Owner * Owner `xml:"Owner,omitempty"`
149+ }
150+
151+ func (s * BucketService ) GetObjectVersions (ctx context.Context , opt * BucketGetObjectVersionsOptions ) (* BucketGetObjectVersionsResult , * Response , error ) {
152+ var res BucketGetObjectVersionsResult
153+ sendOpt := sendOptions {
154+ baseURL : s .client .BaseURL .BucketURL ,
155+ uri : "/?versions" ,
156+ method : http .MethodGet ,
157+ optQuery : opt ,
158+ result : & res ,
159+ }
160+ resp , err := s .client .send (ctx , & sendOpt )
161+ return & res , resp , err
162+ }
0 commit comments