Commit 6fc78e5
authored
feat: add
Introduces the `--resource-name-alias` CLI flag to allow API owners
to safely disambiguate fully qualified resource paths that flatten
to identical method names in the generated client.
The flag accepts mappings in the format `resource.path/Name:AliasName`.
The configuration is parsed natively into the compiler Options and
injected into the schema models during construction, avoiding global
state mutations.
Example usage in BUILD.bazel:
```
--resource-name-alias=ces.googleapis.com/Tool:CesTool
```
Towards: b/505425328--resource-name-alias flag to resolve namespace collisions (googleapis#16769)1 parent 6224fb6 commit 6fc78e5Copy full SHA for 6fc78e5
6 files changed
+191-3Lines changed: 191 additions & 3 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- packages/gapic-generator
- gapic
- schema
- utils
- tests/unit
- generator
- schema/wrappers
Expand file treeCollapse file tree
Open diff view settings
Collapse file
packages/gapic-generator/gapic/schema/api.py
Copy file name to clipboardExpand all lines: packages/gapic-generator/gapic/schema/api.py+1Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1689 | 1689 | |
1690 | 1690 | |
1691 | 1691 | |
| 1692 | + |
1692 | 1693 | |
1693 | 1694 | |
1694 | 1695 | |
|
Collapse file
packages/gapic-generator/gapic/schema/wrappers.py
Copy file name to clipboardExpand all lines: packages/gapic-generator/gapic/schema/wrappers.py+30-1Lines changed: 30 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
520 | 520 | |
521 | 521 | |
522 | 522 | |
| 523 | + |
523 | 524 | |
524 | 525 | |
525 | 526 | |
| ||
688 | 689 | |
689 | 690 | |
690 | 691 | |
691 | | - |
| 692 | + |
| 693 | + |
| 694 | + |
| 695 | + |
| 696 | + |
| 697 | + |
692 | 698 | |
693 | 699 | |
694 | 700 | |
| ||
2323 | 2329 | |
2324 | 2330 | |
2325 | 2331 | |
| 2332 | + |
| 2333 | + |
| 2334 | + |
| 2335 | + |
| 2336 | + |
| 2337 | + |
| 2338 | + |
| 2339 | + |
| 2340 | + |
| 2341 | + |
| 2342 | + |
| 2343 | + |
| 2344 | + |
| 2345 | + |
| 2346 | + |
| 2347 | + |
| 2348 | + |
| 2349 | + |
| 2350 | + |
| 2351 | + |
| 2352 | + |
| 2353 | + |
| 2354 | + |
2326 | 2355 | |
2327 | 2356 | |
2328 | 2357 | |
|
Collapse file
packages/gapic-generator/gapic/utils/options.py
Copy file name to clipboardExpand all lines: packages/gapic-generator/gapic/utils/options.py+36-1Lines changed: 36 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
51 | 51 | |
52 | 52 | |
53 | 53 | |
| 54 | + |
54 | 55 | |
55 | 56 | |
56 | 57 | |
| ||
72 | 73 | |
73 | 74 | |
74 | 75 | |
75 | | - |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | + |
76 | 81 | |
77 | 82 | |
78 | 83 | |
| ||
188 | 193 | |
189 | 194 | |
190 | 195 | |
| 196 | + |
| 197 | + |
| 198 | + |
| 199 | + |
| 200 | + |
| 201 | + |
| 202 | + |
| 203 | + |
| 204 | + |
| 205 | + |
| 206 | + |
| 207 | + |
| 208 | + |
| 209 | + |
| 210 | + |
| 211 | + |
| 212 | + |
| 213 | + |
| 214 | + |
| 215 | + |
| 216 | + |
| 217 | + |
| 218 | + |
| 219 | + |
| 220 | + |
| 221 | + |
| 222 | + |
| 223 | + |
| 224 | + |
191 | 225 | |
192 | 226 | |
193 | 227 | |
| ||
210 | 244 | |
211 | 245 | |
212 | 246 | |
| 247 | + |
213 | 248 | |
214 | 249 | |
215 | 250 | |
|
Collapse file
packages/gapic-generator/tests/unit/generator/test_options.py
Copy file name to clipboardExpand all lines: packages/gapic-generator/tests/unit/generator/test_options.py+26Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
254 | 254 | |
255 | 255 | |
256 | 256 | |
| 257 | + |
| 258 | + |
| 259 | + |
| 260 | + |
| 261 | + |
| 262 | + |
| 263 | + |
| 264 | + |
| 265 | + |
| 266 | + |
| 267 | + |
| 268 | + |
| 269 | + |
| 270 | + |
| 271 | + |
| 272 | + |
| 273 | + |
| 274 | + |
| 275 | + |
| 276 | + |
| 277 | + |
| 278 | + |
| 279 | + |
| 280 | + |
| 281 | + |
| 282 | + |
Collapse file
packages/gapic-generator/tests/unit/schema/wrappers/test_message.py
Copy file name to clipboardExpand all lines: packages/gapic-generator/tests/unit/schema/wrappers/test_message.py+41Lines changed: 41 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
473 | 473 | |
474 | 474 | |
475 | 475 | |
| 476 | + |
| 477 | + |
| 478 | + |
| 479 | + |
| 480 | + |
| 481 | + |
| 482 | + |
| 483 | + |
| 484 | + |
| 485 | + |
| 486 | + |
| 487 | + |
| 488 | + |
| 489 | + |
| 490 | + |
| 491 | + |
| 492 | + |
| 493 | + |
| 494 | + |
| 495 | + |
| 496 | + |
| 497 | + |
| 498 | + |
| 499 | + |
| 500 | + |
| 501 | + |
| 502 | + |
| 503 | + |
| 504 | + |
| 505 | + |
| 506 | + |
| 507 | + |
| 508 | + |
| 509 | + |
| 510 | + |
| 511 | + |
| 512 | + |
| 513 | + |
| 514 | + |
| 515 | + |
| 516 | + |
Collapse file
packages/gapic-generator/tests/unit/schema/wrappers/test_service.py
Copy file name to clipboardExpand all lines: packages/gapic-generator/tests/unit/schema/wrappers/test_service.py+57-1Lines changed: 57 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
14 | 14 | |
15 | 15 | |
16 | 16 | |
| 17 | + |
17 | 18 | |
18 | 19 | |
19 | 20 | |
20 | 21 | |
21 | 22 | |
22 | 23 | |
23 | 24 | |
24 | | - |
| 25 | + |
| 26 | + |
25 | 27 | |
26 | 28 | |
27 | 29 | |
| ||
693 | 695 | |
694 | 696 | |
695 | 697 | |
| 698 | + |
| 699 | + |
| 700 | + |
| 701 | + |
| 702 | + |
| 703 | + |
| 704 | + |
| 705 | + |
| 706 | + |
| 707 | + |
| 708 | + |
| 709 | + |
| 710 | + |
| 711 | + |
| 712 | + |
| 713 | + |
| 714 | + |
| 715 | + |
| 716 | + |
| 717 | + |
| 718 | + |
| 719 | + |
| 720 | + |
| 721 | + |
| 722 | + |
| 723 | + |
| 724 | + |
| 725 | + |
| 726 | + |
| 727 | + |
| 728 | + |
| 729 | + |
| 730 | + |
| 731 | + |
| 732 | + |
| 733 | + |
| 734 | + |
| 735 | + |
| 736 | + |
| 737 | + |
| 738 | + |
| 739 | + |
| 740 | + |
| 741 | + |
| 742 | + |
| 743 | + |
| 744 | + |
| 745 | + |
| 746 | + |
| 747 | + |
| 748 | + |
| 749 | + |
| 750 | + |
| 751 | + |
0 commit comments