Ajouter et implémenter certaines responses #118

Merged
vlbeaudoin merged 4 commits from fix/bucket_list_response into main 2023-08-20 18:04:54 -04:00
Showing only changes of commit 9ebf27dbaf - Show all commits

View file

@ -271,3 +271,17 @@ func (a *API) CallWithData(method, route string, data []byte) (string, error) {
//return "", errors.New(fmt.Sprintf("method must be 'POST' or 'PUT', got '%s'", method))
return "", errors.New(fmt.Sprintf("method must be 'POST', got '%s'", method))
}
func (a *API) ListBuckets() (models.V1BucketListResponse, error) {
var response models.V1BucketListResponse
result, err := a.Call(http.MethodGet, "/v1/bucket")
if err != nil {
return response, err
}
if err = json.Unmarshal(result, &response); err != nil {
return response, err
}
return response, nil
}