gapic-generator 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/gapic/generator/version.rb +1 -1
- data/lib/gapic/schema/api.rb +11 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61762b2051b75312bfc67ef070e136d8cf95cad1635e1b22270ed8a5b6cfbc99
|
4
|
+
data.tar.gz: cd867c0065831c6b5252dc0b5097417f24a74716f4e15cd243a1371ac80e5a5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8c833fe9bbb2d35c8fb0e7b307e1f0aeb0f5774fe0f174e2505bc0460fcc13ae06bf6e2761fe1e00d7e44079327fbc761f7423b72c51e58ef23c4f4220edebb
|
7
|
+
data.tar.gz: 89e7871eac1c9e01d870c2e367e67e16ac5c49580259d828c922324250a88955da88014496a8da7ff22964e18941046153158df4d8a023a7fb9a158a86c06cea
|
data/CHANGELOG.md
CHANGED
data/lib/gapic/schema/api.rb
CHANGED
@@ -354,9 +354,14 @@ module Gapic
|
|
354
354
|
# * A mapping from resource type to resource wrapper is returned.
|
355
355
|
def analyze_resources
|
356
356
|
# In order to set parent_resources, we first populate a mapping from
|
357
|
-
# parsed pattern to
|
358
|
-
#
|
359
|
-
#
|
357
|
+
# parsed pattern to resources that use it (in the patterns variable).
|
358
|
+
# Note that there may be multiple resources associated with a pattern.
|
359
|
+
# (This is uncommon, but one example is monitoring v3 which uses
|
360
|
+
# "projects/*" for its workspace type as well as inheriting the common
|
361
|
+
# project type. We thus map each pattern to an array of resources.)
|
362
|
+
# Constructing the patterns mapping is done in one pass along with
|
363
|
+
# populating the type mapping (which maps only to single resources.)
|
364
|
+
# Then, we go through all resources again, get each's expected parent
|
360
365
|
# patterns, and anything that shows up in the patterns mapping is taken
|
361
366
|
# to be a parent.
|
362
367
|
types = {}
|
@@ -367,8 +372,8 @@ module Gapic
|
|
367
372
|
end
|
368
373
|
types.each do |_type, resource|
|
369
374
|
parents = resource.parsed_parent_patterns
|
370
|
-
.
|
371
|
-
.
|
375
|
+
.flat_map { |pat| Array(patterns[pat]) }
|
376
|
+
.uniq
|
372
377
|
resource.parent_resources.replace parents
|
373
378
|
end
|
374
379
|
types
|
@@ -377,7 +382,7 @@ module Gapic
|
|
377
382
|
def populate_resource_lookups resource, types, patterns
|
378
383
|
types[resource.type] = resource
|
379
384
|
resource.parsed_patterns.each do |pat|
|
380
|
-
patterns[pat]
|
385
|
+
((patterns[pat] ||= []) << resource).uniq!
|
381
386
|
end
|
382
387
|
end
|
383
388
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gapic-generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ernest Landrito
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-
|
13
|
+
date: 2021-07-08 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: actionpack
|