Commit c3c39e8
committed
monitoring: add special case for MService; revert Service->APIService
In 8a410c2,
monitoring/v3 got a new schema (item in field "schemas") named "Service". This
meant that when the generator generated the API, the name "Service" was already
a named type by the time the generator got to creating the "New" method and
corresponding struct.
So, the generator picked the next item in the "serviceTypes" list to describe
the monitoring service: New() *Service became New() *APIService. This is a
breaking change.
We don't guarantee backwards compatibility (https://godoc.org/google.golang.org/api#hdr-Versioning_and_Stability),
but this API is widely depended upon and worthy of making an exception.
This CL introduces some mapping from monitoring's Service field to
MService. It re-maps the original doc's type in-place, and then any time a
ref is requested with name Service it instead requests MService.
Fixes #425.
Change-Id: I8869a7e9b08ce7e42a9f38abf9a6d5810065efc0
Reviewed-on: https://code-review.googlesource.com/c/google-api-go-client/+/48591
Reviewed-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Chris Broadfoot <cbro@google.com>1 parent ebb9e39 commit c3c39e8
2 files changed
Lines changed: 172 additions & 157 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
410 | 416 | | |
411 | 417 | | |
412 | 418 | | |
| |||
1175 | 1181 | | |
1176 | 1182 | | |
1177 | 1183 | | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
1178 | 1193 | | |
1179 | 1194 | | |
1180 | 1195 | | |
| |||
0 commit comments