-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add documentation for binding override classes, better mixin t…
…esting (#873)
- Loading branch information
1 parent
354157d
commit 63576ad
Showing
56 changed files
with
1,058 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
:name: testing | ||
:extra_dependencies: | ||
google-cloud-common: "~>1.0" | ||
google-cloud-location: "=0.3.beta.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 102 additions & 0 deletions
102
shared/output/cloud/vision_v1/lib/google/cloud/vision/v1/bindings_override.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
# frozen_string_literal: true | ||
|
||
# Copyright 2022 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Auto-generated by gapic-generator-ruby. DO NOT EDIT! | ||
|
||
require "gapic/config" | ||
|
||
module Google | ||
module Cloud | ||
module Vision | ||
## | ||
# @example Loading just the REST part of this package, including all its services, and instantiating a REST client | ||
# | ||
# require "google/cloud/vision/v1/rest" | ||
# client = ::Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new | ||
# | ||
module V1 | ||
## | ||
# @private | ||
# Initialize the mixin bindings configuration | ||
# | ||
def self.configure | ||
@configure ||= begin | ||
namespace = ["Google", "Cloud", "Vision"] | ||
parent_config = while namespace.any? | ||
parent_name = namespace.join "::" | ||
parent_const = const_get parent_name | ||
break parent_const.configure if parent_const.respond_to? :configure | ||
namespace.pop | ||
end | ||
|
||
default_config = Configuration.new parent_config | ||
default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ | ||
Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( | ||
uri_method: :get, | ||
uri_template: "/v1/{name}", | ||
matches: [ | ||
["name", %r{^projects/[^/]+/visionLocations/[^/]+/?$}, false] | ||
], | ||
body: nil | ||
) | ||
] | ||
default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ | ||
|
||
Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( | ||
uri_method: :get, | ||
uri_template: "/v1/{name}/visionLocations", | ||
matches: [ | ||
["name", %r{^projects/[^/]+/?$}, false] | ||
], | ||
body: nil | ||
) | ||
] | ||
default_config | ||
end | ||
yield @configure if block_given? | ||
@configure | ||
end | ||
|
||
## | ||
# @private | ||
# Configuration class for the google.cloud.vision.v1 package. | ||
# | ||
# This class contains common configuration for all services | ||
# of the google.cloud.vision.v1 package. | ||
# | ||
# This configuration is for internal use of the client library classes, | ||
# and it is not intended that the end-users will read or change it. | ||
# | ||
class Configuration | ||
extend ::Gapic::Config | ||
|
||
# @private | ||
# Overrides for http bindings for the RPC of the mixins for this package. | ||
# Services in this package should use these when creating clients for the mixin services. | ||
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] | ||
config_attr :bindings_override, {}, ::Hash, nil | ||
|
||
# @private | ||
def initialize parent_config = nil | ||
@parent_config = parent_config unless parent_config.nil? | ||
|
||
yield self if block_given? | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.