Skip to content

Commit 0b984e8

Browse files
authored
Use lineage instead of api_name for property conflicts (#3885)
1 parent fd9235d commit 0b984e8

File tree

4 files changed

+25
-25
lines changed

4 files changed

+25
-25
lines changed

api/type.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ module Fields
7777
attr_reader :min_version
7878
attr_reader :exact_version
7979

80-
# A list of properties that conflict with this property.
80+
# A list of properties that conflict with this property. Uses the "lineage"
81+
# field to identify the property eg: parent.meta.label.foo
8182
attr_reader :conflicts
8283

8384
# A list of properties that at least one of must be set.
@@ -203,8 +204,7 @@ def check_conflicts
203204

204205
return if @conflicts.empty?
205206

206-
names = @__resource.all_user_properties.map(&:api_name) +
207-
@__resource.all_user_properties.map(&:name)
207+
names = @__resource.all_user_properties.map(&:lineage)
208208
@conflicts.each do |p|
209209
raise "#{p} does not exist" unless names.include?(p)
210210
end
@@ -214,8 +214,8 @@ def check_conflicts
214214
def conflicting
215215
return [] unless @__resource
216216

217-
(@__resource.all_user_properties.select { |p| @conflicts.include?(p.api_name) } +
218-
@__resource.all_user_properties.select { |p| p.conflicts.include?(@api_name) }).uniq
217+
(@__resource.all_user_properties.select { |p| @conflicts.include?(p.lineage) } +
218+
@__resource.all_user_properties.select { |p| p.conflicts.include?(lineage) }).uniq
219219
end
220220

221221
# Checks that all properties that needs at least one of their fields actually exist.

products/appengine/api.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -497,8 +497,8 @@ objects:
497497
description: |
498498
Automatic scaling is based on request rate, response latencies, and other application metrics.
499499
conflicts:
500-
- basicScaling
501-
- manualScaling
500+
- basic_scaling
501+
- manual_scaling
502502
properties:
503503
- !ruby/object:Api::Type::Integer
504504
name: 'maxConcurrentRequests'
@@ -550,8 +550,8 @@ objects:
550550
description: |
551551
Basic scaling creates instances when your application receives requests. Each instance will be shut down when the application becomes idle. Basic scaling is ideal for work that is intermittent or driven by user activity.
552552
conflicts:
553-
- automaticScaling
554-
- manualScaling
553+
- automatic_scaling
554+
- manual_scaling
555555
properties:
556556
- !ruby/object:Api::Type::String
557557
name: 'idleTimeout'
@@ -569,8 +569,8 @@ objects:
569569
description: |
570570
A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time.
571571
conflicts:
572-
- automaticScaling
573-
- basicScaling
572+
- automatic_scaling
573+
- basic_scaling
574574
properties:
575575
- !ruby/object:Api::Type::Integer
576576
name: 'instances'

products/compute/api.yaml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3066,8 +3066,8 @@ objects:
30663066
must be expressed in CIDR format. Only IPv4 is supported.
30673067
item_type: Api::Type::String
30683068
conflicts:
3069-
- sourceRanges
3070-
- sourceTags
3069+
- source_ranges
3070+
- source_tags
30713071
- !ruby/object:Api::Type::Enum
30723072
name: 'direction'
30733073
description: |
@@ -3179,8 +3179,8 @@ objects:
31793179
item_type: Api::Type::String
31803180
max_size: 10
31813181
conflicts:
3182-
- sourceTags
3183-
- targetTags
3182+
- source_tags
3183+
- target_tags
31843184
- !ruby/object:Api::Type::Array
31853185
name: 'sourceTags'
31863186
description: |
@@ -3206,8 +3206,8 @@ objects:
32063206
item_type: Api::Type::String
32073207
max_size: 10
32083208
conflicts:
3209-
- sourceTags
3210-
- targetTags
3209+
- source_tags
3210+
- target_tags
32113211
- !ruby/object:Api::Type::Array
32123212
name: 'targetTags'
32133213
description: |
@@ -8060,7 +8060,7 @@ objects:
80608060
Node type to use for nodes group that are created from this template.
80618061
Only one of nodeTypeFlexibility and nodeType can be specified.
80628062
conflicts:
8063-
- nodeTypeFlexibility
8063+
- node_type_flexibility
80648064
- !ruby/object:Api::Type::NestedObject
80658065
name: 'nodeTypeFlexibility'
80668066
description: |
@@ -8069,7 +8069,7 @@ objects:
80698069
these properties. Only one of nodeTypeFlexibility and nodeType can
80708070
be specified.
80718071
conflicts:
8072-
- nodeType
8072+
- node_type
80738073
properties:
80748074
- !ruby/object:Api::Type::String
80758075
name: cpus
@@ -11779,7 +11779,7 @@ objects:
1177911779
- !ruby/object:Api::Type::NestedObject
1178011780
name: 'snapshotSchedulePolicy'
1178111781
conflicts:
11782-
- 'groupPlacementPolicy'
11782+
- 'group_placement_policy'
1178311783
description: |
1178411784
Policy for creating snapshots of persistent disks.
1178511785
properties:
@@ -11923,7 +11923,7 @@ objects:
1192311923
- !ruby/object:Api::Type::NestedObject
1192411924
name: 'groupPlacementPolicy'
1192511925
conflicts:
11926-
- 'snapshotSchedulePolicy'
11926+
- 'snapshot_schedule_policy'
1192711927
description: |
1192811928
Policy for creating snapshots of persistent disks.
1192911929
properties:
@@ -16204,7 +16204,7 @@ objects:
1620416204
name: 'defaultRouteAction'
1620516205
# TODO: (mbang) conflicts also won't work for array path matchers yet, uncomment here once supported.
1620616206
# conflicts:
16207-
# - defaultUrlRedirect
16207+
# - path_matcher.path_matcher.default_url_redirect
1620816208
description: |
1620916209
defaultRouteAction takes effect when none of the pathRules or routeRules match. The load balancer performs
1621016210
advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request
@@ -16547,7 +16547,7 @@ objects:
1654716547
- default_url_redirect
1654816548
- default_route_action.0.weighted_backend_services
1654916549
conflicts:
16550-
- defaultRouteAction
16550+
- default_route_action
1655116551
description: |
1655216552
When none of the specified hostRules match, the request is redirected to a URL specified
1655316553
by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or
@@ -16614,7 +16614,7 @@ objects:
1661416614
- !ruby/object:Api::Type::NestedObject
1661516615
name: 'defaultRouteAction'
1661616616
conflicts:
16617-
- defaultUrlRedirect
16617+
- default_url_redirect
1661816618
description: |
1661916619
defaultRouteAction takes effect when none of the hostRules match. The load balancer performs advanced routing actions
1662016620
like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend.

products/mlengine/api.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ objects:
211211
response to increases and decreases in traffic. Care should be taken
212212
to ramp up traffic according to the model's ability to scale or you
213213
will start seeing increases in latency and 429 response codes.
214-
conflicts: ['manualScaling']
214+
conflicts: ['manual_scaling']
215215
properties:
216216
- !ruby/object:Api::Type::Integer
217217
name: 'minNodes'

0 commit comments

Comments
 (0)