google-cloud-service_directory-v1 0.7.1 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dc43248af4aa3edaec0ee4ab8350748ff36fa451e376754820213ebfa61b72c3
4
- data.tar.gz: f81f89316aa19cc9803179f15f582c60a14abed040516f662877c51dae9c41ae
3
+ metadata.gz: eb7347a1fe5c67d04d998a4266ffbda679f9c694f33ff7a2d0d7c24220930b1a
4
+ data.tar.gz: b0f5b0db819fbdf152ff72716242f0932869da6d4defe662c61c89fe7a01cd42
5
5
  SHA512:
6
- metadata.gz: 208fa1bf6c2b833d5ecf5afd9eb2ffc5641775fb33db4315cad569cc0e1c9753c9691c4e20162807cc4151bfa2fa6242b2aca12de3475f69024e2ac8d27bf32f
7
- data.tar.gz: b9f1991c063d88d25488a1ed4ecd325d9ec49da864ab3477b05ff3cadd694987dde146b5f0e65af5a71b9490c6a00a563511216e574dc48119a6f81e199c0d7e
6
+ metadata.gz: 4baabb7351990bfae900bac4402d4c05ee3432c7aaf480270945fcc11dc2c4a9fdefe41be51870e9cdbca80492a42b8716c4afabc519e95ffc7b8ae925113a53
7
+ data.tar.gz: da32f7379aa9d81c103cd4eeffbc11ca60399e901a8ea9976e86ca9a5dad6f608b661aeb95451910b48e9ac195af35e922d947fb318c7fd32529eb6081ae7473
@@ -0,0 +1,102 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/config"
20
+
21
+ module Google
22
+ module Cloud
23
+ module ServiceDirectory
24
+ ##
25
+ # @example Loading just the REST part of this package, including all its services, and instantiating a REST client
26
+ #
27
+ # require "google/cloud/service_directory/v1/rest"
28
+ # client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Rest::Client.new
29
+ #
30
+ module V1
31
+ ##
32
+ # @private
33
+ # Initialize the mixin bindings configuration
34
+ #
35
+ def self.configure
36
+ @configure ||= begin
37
+ namespace = ["Google", "Cloud", "ServiceDirectory"]
38
+ parent_config = while namespace.any?
39
+ parent_name = namespace.join "::"
40
+ parent_const = const_get parent_name
41
+ break parent_const.configure if parent_const.respond_to? :configure
42
+ namespace.pop
43
+ end
44
+
45
+ default_config = Configuration.new parent_config
46
+ default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [
47
+ Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
48
+ uri_method: :get,
49
+ uri_template: "/v1/{name}",
50
+ matches: [
51
+ ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
52
+ ],
53
+ body: nil
54
+ )
55
+ ]
56
+ default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [
57
+
58
+ Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
59
+ uri_method: :get,
60
+ uri_template: "/v1/{name}/locations",
61
+ matches: [
62
+ ["name", %r{^projects/[^/]+/?$}, false]
63
+ ],
64
+ body: nil
65
+ )
66
+ ]
67
+ default_config
68
+ end
69
+ yield @configure if block_given?
70
+ @configure
71
+ end
72
+
73
+ ##
74
+ # @private
75
+ # Configuration class for the google.cloud.servicedirectory.v1 package.
76
+ #
77
+ # This class contains common configuration for all services
78
+ # of the google.cloud.servicedirectory.v1 package.
79
+ #
80
+ # This configuration is for internal use of the client library classes,
81
+ # and it is not intended that the end-users will read or change it.
82
+ #
83
+ class Configuration
84
+ extend ::Gapic::Config
85
+
86
+ # @private
87
+ # Overrides for http bindings for the RPC of the mixins for this package.
88
+ # Services in this package should use these when creating clients for the mixin services.
89
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
90
+ config_attr :bindings_override, {}, ::Hash, nil
91
+
92
+ # @private
93
+ def initialize parent_config = nil
94
+ @parent_config = parent_config unless parent_config.nil?
95
+
96
+ yield self if block_given?
97
+ end
98
+ end
99
+ end
100
+ end
101
+ end
102
+ end
@@ -18,6 +18,7 @@
18
18
 
19
19
  require "google/cloud/errors"
20
20
  require "google/cloud/servicedirectory/v1/lookup_service_pb"
21
+ require "google/cloud/location"
21
22
 
22
23
  module Google
23
24
  module Cloud
@@ -138,6 +139,12 @@ module Google
138
139
  @quota_project_id = @config.quota_project
139
140
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
140
141
 
142
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
143
+ config.credentials = credentials
144
+ config.quota_project = @quota_project_id
145
+ config.endpoint = @config.endpoint
146
+ end
147
+
141
148
  @lookup_service_stub = ::Gapic::ServiceStub.new(
142
149
  ::Google::Cloud::ServiceDirectory::V1::LookupService::Stub,
143
150
  credentials: credentials,
@@ -147,6 +154,13 @@ module Google
147
154
  )
148
155
  end
149
156
 
157
+ ##
158
+ # Get the associated client for mix-in of the Locations.
159
+ #
160
+ # @return [Google::Cloud::Location::Locations::Client]
161
+ #
162
+ attr_reader :location_client
163
+
150
164
  # Service calls
151
165
 
152
166
  ##
@@ -178,22 +192,40 @@ module Google
178
192
  # @param endpoint_filter [::String]
179
193
  # Optional. The filter applied to the endpoints of the resolved service.
180
194
  #
181
- # General filter string syntax:
182
- # <field> <operator> <value> (<logical connector>)
183
- # <field> can be "name" or "metadata.<key>" for map field.
184
- # <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS and is
185
- # roughly the same as "=".
186
- # <value> must be the same data type as the field.
187
- # <logical connector> can be "AND, OR, NOT".
195
+ # General `filter` string syntax:
196
+ # `<field> <operator> <value> (<logical connector>)`
197
+ #
198
+ # * `<field>` can be `name`, `address`, `port`, or `annotations.<key>` for
199
+ # map field
200
+ # * `<operator>` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:`
201
+ # means `HAS`, and is roughly the same as `=`
202
+ # * `<value>` must be the same data type as field
203
+ # * `<logical connector>` can be `AND`, `OR`, `NOT`
188
204
  #
189
205
  # Examples of valid filters:
190
- # * "metadata.owner" returns Endpoints that have a label with the
191
- # key "owner", this is the same as "metadata:owner"
192
- # * "metadata.protocol=gRPC" returns Endpoints that have key/value
193
- # "protocol=gRPC"
194
- # * "metadata.owner!=sd AND metadata.foo=bar" returns
195
- # Endpoints that have "owner" field in metadata with a value that is not
196
- # "sd" AND have the key/value foo=bar.
206
+ #
207
+ # * `annotations.owner` returns endpoints that have a annotation with the
208
+ # key `owner`, this is the same as `annotations:owner`
209
+ # * `annotations.protocol=gRPC` returns endpoints that have key/value
210
+ # `protocol=gRPC`
211
+ # * `address=192.108.1.105` returns endpoints that have this address
212
+ # * `port>8080` returns endpoints that have port number larger than 8080
213
+ # *
214
+ # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c`
215
+ # returns endpoints that have name that is alphabetically later than the
216
+ # string, so "endpoint-e" is returned but "endpoint-a" is not
217
+ # *
218
+ # `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1`
219
+ # returns the endpoint that has an endpoint_id equal to `ep-1`
220
+ # * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that
221
+ # have `owner` in annotation key but value is not `sd` AND have
222
+ # key/value `foo=bar`
223
+ # * `doesnotexist.foo=bar` returns an empty list. Note that endpoint
224
+ # doesn't have a field called "doesnotexist". Since the filter does not
225
+ # match any endpoint, it returns no results
226
+ #
227
+ # For more information about filtering, see
228
+ # [API Filtering](https://aip.dev/160).
197
229
  #
198
230
  # @yield [response, operation] Access the result along with the RPC operation
199
231
  # @yieldparam response [::Google::Cloud::ServiceDirectory::V1::ResolveServiceResponse]
@@ -19,6 +19,7 @@
19
19
  require "google/cloud/errors"
20
20
  require "google/cloud/servicedirectory/v1/lookup_service_pb"
21
21
  require "google/cloud/service_directory/v1/lookup_service/rest/service_stub"
22
+ require "google/cloud/location/rest"
22
23
 
23
24
  module Google
24
25
  module Cloud
@@ -135,9 +136,23 @@ module Google
135
136
  @quota_project_id = @config.quota_project
136
137
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
137
138
 
139
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
140
+ config.credentials = credentials
141
+ config.quota_project = @quota_project_id
142
+ config.endpoint = @config.endpoint
143
+ config.bindings_override = @config.bindings_override
144
+ end
145
+
138
146
  @lookup_service_stub = ::Google::Cloud::ServiceDirectory::V1::LookupService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
139
147
  end
140
148
 
149
+ ##
150
+ # Get the associated client for mix-in of the Locations.
151
+ #
152
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
153
+ #
154
+ attr_reader :location_client
155
+
141
156
  # Service calls
142
157
 
143
158
  ##
@@ -169,22 +184,40 @@ module Google
169
184
  # @param endpoint_filter [::String]
170
185
  # Optional. The filter applied to the endpoints of the resolved service.
171
186
  #
172
- # General filter string syntax:
173
- # <field> <operator> <value> (<logical connector>)
174
- # <field> can be "name" or "metadata.<key>" for map field.
175
- # <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS and is
176
- # roughly the same as "=".
177
- # <value> must be the same data type as the field.
178
- # <logical connector> can be "AND, OR, NOT".
187
+ # General `filter` string syntax:
188
+ # `<field> <operator> <value> (<logical connector>)`
189
+ #
190
+ # * `<field>` can be `name`, `address`, `port`, or `annotations.<key>` for
191
+ # map field
192
+ # * `<operator>` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:`
193
+ # means `HAS`, and is roughly the same as `=`
194
+ # * `<value>` must be the same data type as field
195
+ # * `<logical connector>` can be `AND`, `OR`, `NOT`
179
196
  #
180
197
  # Examples of valid filters:
181
- # * "metadata.owner" returns Endpoints that have a label with the
182
- # key "owner", this is the same as "metadata:owner"
183
- # * "metadata.protocol=gRPC" returns Endpoints that have key/value
184
- # "protocol=gRPC"
185
- # * "metadata.owner!=sd AND metadata.foo=bar" returns
186
- # Endpoints that have "owner" field in metadata with a value that is not
187
- # "sd" AND have the key/value foo=bar.
198
+ #
199
+ # * `annotations.owner` returns endpoints that have a annotation with the
200
+ # key `owner`, this is the same as `annotations:owner`
201
+ # * `annotations.protocol=gRPC` returns endpoints that have key/value
202
+ # `protocol=gRPC`
203
+ # * `address=192.108.1.105` returns endpoints that have this address
204
+ # * `port>8080` returns endpoints that have port number larger than 8080
205
+ # *
206
+ # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c`
207
+ # returns endpoints that have name that is alphabetically later than the
208
+ # string, so "endpoint-e" is returned but "endpoint-a" is not
209
+ # *
210
+ # `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1`
211
+ # returns the endpoint that has an endpoint_id equal to `ep-1`
212
+ # * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that
213
+ # have `owner` in annotation key but value is not `sd` AND have
214
+ # key/value `foo=bar`
215
+ # * `doesnotexist.foo=bar` returns an empty list. Note that endpoint
216
+ # doesn't have a field called "doesnotexist". Since the filter does not
217
+ # match any endpoint, it returns no results
218
+ #
219
+ # For more information about filtering, see
220
+ # [API Filtering](https://aip.dev/160).
188
221
  # @yield [result, operation] Access the result along with the TransportOperation object
189
222
  # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::ResolveServiceResponse]
190
223
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -315,6 +348,13 @@ module Google
315
348
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
316
349
  config_attr :quota_project, nil, ::String, nil
317
350
 
351
+ # @private
352
+ # Overrides for http bindings for the RPCs of this service
353
+ # are only used when this service is used as mixin, and only
354
+ # by the host service.
355
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
356
+ config_attr :bindings_override, {}, ::Hash, nil
357
+
318
358
  # @private
319
359
  def initialize parent_config = nil
320
360
  @parent_config = parent_config unless parent_config.nil?
@@ -21,6 +21,7 @@ require "gapic/config"
21
21
  require "gapic/config/method"
22
22
 
23
23
  require "google/cloud/service_directory/v1/version"
24
+ require "google/cloud/service_directory/v1/bindings_override"
24
25
 
25
26
  require "google/cloud/service_directory/v1/lookup_service/credentials"
26
27
  require "google/cloud/service_directory/v1/lookup_service/paths"