github.com/chnsz/golangsdk@v0.0.0-20240506093406-85a3fbfa605b/openstack/obs/model_response.go (about) 1 // Copyright 2019 Huawei Technologies Co.,Ltd. 2 // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 3 // this file except in compliance with the License. You may obtain a copy of the 4 // License at 5 // 6 // http://www.apache.org/licenses/LICENSE-2.0 7 // 8 // Unless required by applicable law or agreed to in writing, software distributed 9 // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 10 // CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 // specific language governing permissions and limitations under the License. 12 13 package obs 14 15 import ( 16 "encoding/xml" 17 ) 18 19 // BaseModel defines base model response from OBS 20 type BaseModel struct { 21 StatusCode int `xml:"-"` 22 RequestId string `xml:"RequestId" json:"request_id"` 23 ResponseHeaders map[string][]string `xml:"-"` 24 } 25 26 // Error defines the error property in DeleteObjectsOutput 27 type Error struct { 28 XMLName xml.Name `xml:"Error"` 29 Key string `xml:"Key"` 30 VersionId string `xml:"VersionId"` 31 Code string `xml:"Code"` 32 Message string `xml:"Message"` 33 } 34 35 // FetchResponse defines the response fetch policy configuration 36 type FetchResponse struct { 37 Status FetchPolicyStatusType `json:"status"` 38 Agency string `json:"agency"` 39 } 40 41 // SetBucketFetchJobResponse defines the response SetBucketFetchJob configuration 42 type SetBucketFetchJobResponse struct { 43 ID string `json:"id"` 44 Wait int `json:"Wait"` 45 } 46 47 // GetBucketFetchJobResponse defines the response fetch job configuration 48 type GetBucketFetchJobResponse struct { 49 Err string `json:"err"` 50 Code string `json:"code"` 51 Status string `json:"status"` 52 Job JobResponse `json:"job"` 53 } 54 55 // JobResponse defines the response job configuration 56 type JobResponse struct { 57 Bucket string `json:"bucket"` 58 URL string `json:"url"` 59 Host string `json:"host"` 60 Key string `json:"key"` 61 Md5 string `json:"md5"` 62 CallBackURL string `json:"callbackurl"` 63 CallBackBody string `json:"callbackbody"` 64 CallBackBodyType string `json:"callbackbodytype"` 65 CallBackHost string `json:"callbackhost"` 66 FileType string `json:"file_type"` 67 IgnoreSameKey bool `json:"ignore_same_key"` 68 }