Remove links and meta fields from stubbed Get{Volume,Snapshot} response
The fields only exist on collection-returning API operations.
This commit is contained in:
parent
b64ee9759b
commit
b543023c9b
|
@ -1,5 +1,9 @@
|
|||
# Change Log
|
||||
|
||||
## unreleased
|
||||
|
||||
- #286 Deserialize meta - @timoreimann
|
||||
|
||||
## [v1.28.0] - 2019-12-04
|
||||
|
||||
- #282 Add valid Redis eviction policy constants - @bentranter
|
||||
|
|
2
meta.go
2
meta.go
|
@ -1,6 +1,6 @@
|
|||
package godo
|
||||
|
||||
// Meta describes generic information about the response.
|
||||
// Meta describes generic information about a response.
|
||||
type Meta struct {
|
||||
Total int `json:"total"`
|
||||
}
|
||||
|
|
|
@ -124,16 +124,7 @@ func TestStorageVolumes_Get(t *testing.T) {
|
|||
"filesystem_type": "xfs",
|
||||
"filesystem_label": "my-vol",
|
||||
"tags": ["tag1", "tag2"]
|
||||
},
|
||||
"links": {
|
||||
"pages": {
|
||||
"last": "https://api.digitalocean.com/v2/volumes?page=2",
|
||||
"next": "https://api.digitalocean.com/v2/volumes?page=2"
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"total": 28
|
||||
}
|
||||
}
|
||||
}`
|
||||
|
||||
mux.HandleFunc("/v2/volumes/80d414c6-295e-4e3a-ac58-eb9456c1e1d1", func(w http.ResponseWriter, r *http.Request) {
|
||||
|
@ -632,16 +623,7 @@ func TestStorageSnapshots_Get(t *testing.T) {
|
|||
"name": "my snapshot",
|
||||
"size_gigabytes": 100,
|
||||
"created_at": "2002-10-02T15:00:00.05Z"
|
||||
},
|
||||
"links": {
|
||||
"pages": {
|
||||
"last": "https://api.digitalocean.com/v2/volumes/98d414c6-295e-4e3a-ac58-eb9456c1e1d1/snapshots?page=2",
|
||||
"next": "https://api.digitalocean.com/v2/volumes/98d414c6-295e-4e3a-ac58-eb9456c1e1d1/snapshots?page=2"
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"total": 28
|
||||
}
|
||||
}
|
||||
}`
|
||||
|
||||
mux.HandleFunc("/v2/snapshots/80d414c6-295e-4e3a-ac58-eb9456c1e1d1", func(w http.ResponseWriter, r *http.Request) {
|
||||
|
|
Loading…
Reference in New Issue