google-cloud-location 0.3.beta.1 → 0.3.beta.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google/cloud/location/locations/rest/client.rb +17 -14
- data/lib/google/cloud/location/locations/rest/service_stub.rb +49 -37
- data/lib/google/cloud/location/locations.rb +2 -2
- data/lib/google/cloud/location/version.rb +1 -1
- data/lib/google/cloud/location.rb +3 -5
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f528e84a74ea32718bdaa049325d1b88651bb6f35e2d07c87c4c585ef873f02
|
4
|
+
data.tar.gz: 7bcdb13de741dd61b024ed5903dde686d5bdfaa725747fa4fd4142888d62952a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 708d3b675e987eb2909b88f65c054968baa04710f5f34a764d65cec3196381e706060d40747a1d281213026d4cb23b4ddeda89a65de9fb7eb71f39a84b6b7703
|
7
|
+
data.tar.gz: 51524d30d9e86a69b0425db4e8f3c364f9dd8a56bbf89980ac93625649585bad5a2c59962053a3d2f6dc988fe943ad3aeb427ed8df4946386043b0566eddc9ab
|
@@ -194,17 +194,15 @@ module Google
|
|
194
194
|
metadata: @config.metadata,
|
195
195
|
retry_policy: @config.retry_policy
|
196
196
|
|
197
|
-
@
|
197
|
+
bindings_override = @config.bindings_override["google.cloud.location.Locations.ListLocations"]
|
198
|
+
|
199
|
+
@locations_stub.list_locations request, options, bindings_override: bindings_override do |result, response|
|
198
200
|
result = ::Gapic::Rest::PagedEnumerable.new @locations_stub, :list_locations, "locations", request, result, options
|
199
201
|
yield result, response if block_given?
|
200
202
|
return result
|
201
203
|
end
|
202
|
-
rescue ::
|
203
|
-
|
204
|
-
raise ::Gapic::Rest::Error.wrap_faraday_error e
|
205
|
-
rescue ::Gapic::Rest::Error => gapic_error
|
206
|
-
raise ::Google::Cloud::Error.from_error gapic_error
|
207
|
-
end
|
204
|
+
rescue ::Gapic::Rest::Error => e
|
205
|
+
raise ::Google::Cloud::Error.from_error(e)
|
208
206
|
end
|
209
207
|
|
210
208
|
##
|
@@ -261,16 +259,14 @@ module Google
|
|
261
259
|
metadata: @config.metadata,
|
262
260
|
retry_policy: @config.retry_policy
|
263
261
|
|
264
|
-
@
|
262
|
+
bindings_override = @config.bindings_override["google.cloud.location.Locations.GetLocation"]
|
263
|
+
|
264
|
+
@locations_stub.get_location request, options, bindings_override: bindings_override do |result, response|
|
265
265
|
yield result, response if block_given?
|
266
266
|
return result
|
267
267
|
end
|
268
|
-
rescue ::
|
269
|
-
|
270
|
-
raise ::Gapic::Rest::Error.wrap_faraday_error e
|
271
|
-
rescue ::Gapic::Rest::Error => gapic_error
|
272
|
-
raise ::Google::Cloud::Error.from_error gapic_error
|
273
|
-
end
|
268
|
+
rescue ::Gapic::Rest::Error => e
|
269
|
+
raise ::Google::Cloud::Error.from_error(e)
|
274
270
|
end
|
275
271
|
|
276
272
|
##
|
@@ -359,6 +355,13 @@ module Google
|
|
359
355
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
360
356
|
config_attr :quota_project, nil, ::String, nil
|
361
357
|
|
358
|
+
# @private
|
359
|
+
# Overrides for http bindings for the RPCs of this service
|
360
|
+
# are only used when this service is used as mixin, and only
|
361
|
+
# by the host service.
|
362
|
+
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
363
|
+
config_attr :bindings_override, {}, ::Hash, nil
|
364
|
+
|
362
365
|
# @private
|
363
366
|
def initialize parent_config = nil
|
364
367
|
@parent_config = parent_config unless parent_config.nil?
|
@@ -34,7 +34,9 @@ module Google
|
|
34
34
|
# the REST modules only when it's required.
|
35
35
|
require "gapic/rest"
|
36
36
|
|
37
|
-
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
|
37
|
+
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
|
38
|
+
numeric_enums: true,
|
39
|
+
raise_faraday_errors: false
|
38
40
|
end
|
39
41
|
|
40
42
|
##
|
@@ -44,6 +46,8 @@ module Google
|
|
44
46
|
# A request object representing the call parameters. Required.
|
45
47
|
# @param options [::Gapic::CallOptions]
|
46
48
|
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
49
|
+
# @param bindings_override [::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>, nil]
|
50
|
+
# Binding overrides for the transcoding. Only used internally.
|
47
51
|
#
|
48
52
|
# @yield [result, response] Access the result along with the Faraday response object
|
49
53
|
# @yieldparam result [::Google::Cloud::Location::ListLocationsResponse]
|
@@ -51,10 +55,10 @@ module Google
|
|
51
55
|
#
|
52
56
|
# @return [::Google::Cloud::Location::ListLocationsResponse]
|
53
57
|
# A result object deserialized from the server's reply
|
54
|
-
def list_locations request_pb, options = nil
|
58
|
+
def list_locations request_pb, options = nil, bindings_override: nil
|
55
59
|
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
56
60
|
|
57
|
-
verb, uri, query_string_params, body = ServiceStub.transcode_list_locations_request request_pb
|
61
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_list_locations_request request_pb, bindings_override: bindings_override
|
58
62
|
query_string_params = if query_string_params.any?
|
59
63
|
query_string_params.to_h { |p| p.split("=", 2) }
|
60
64
|
else
|
@@ -81,6 +85,8 @@ module Google
|
|
81
85
|
# A request object representing the call parameters. Required.
|
82
86
|
# @param options [::Gapic::CallOptions]
|
83
87
|
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
88
|
+
# @param bindings_override [::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>, nil]
|
89
|
+
# Binding overrides for the transcoding. Only used internally.
|
84
90
|
#
|
85
91
|
# @yield [result, response] Access the result along with the Faraday response object
|
86
92
|
# @yieldparam result [::Google::Cloud::Location::Location]
|
@@ -88,10 +94,10 @@ module Google
|
|
88
94
|
#
|
89
95
|
# @return [::Google::Cloud::Location::Location]
|
90
96
|
# A result object deserialized from the server's reply
|
91
|
-
def get_location request_pb, options = nil
|
97
|
+
def get_location request_pb, options = nil, bindings_override: nil
|
92
98
|
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
93
99
|
|
94
|
-
verb, uri, query_string_params, body = ServiceStub.transcode_get_location_request request_pb
|
100
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_get_location_request request_pb, bindings_override: bindings_override
|
95
101
|
query_string_params = if query_string_params.any?
|
96
102
|
query_string_params.to_h { |p| p.split("=", 2) }
|
97
103
|
else
|
@@ -118,24 +124,27 @@ module Google
|
|
118
124
|
#
|
119
125
|
# @param request_pb [::Google::Cloud::Location::ListLocationsRequest]
|
120
126
|
# A request object representing the call parameters. Required.
|
127
|
+
# @param bindings_override [::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>, nil]
|
128
|
+
# Binding overrides for the transcoding.
|
121
129
|
# @return [Array(String, [String, nil], Hash{String => String})]
|
122
130
|
# Uri, Body, Query string parameters
|
123
|
-
def self.transcode_list_locations_request request_pb
|
124
|
-
transcoder = Gapic::Rest::GrpcTranscoder.new
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
[
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
131
|
+
def self.transcode_list_locations_request request_pb, bindings_override: nil
|
132
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new(bindings_override) if bindings_override
|
133
|
+
transcoder ||= Gapic::Rest::GrpcTranscoder.new
|
134
|
+
.with_bindings(
|
135
|
+
uri_method: :get,
|
136
|
+
uri_template: "/v1/{name}",
|
137
|
+
matches: [
|
138
|
+
["name", %r{^locations/?$}, false]
|
139
|
+
]
|
140
|
+
)
|
141
|
+
.with_bindings(
|
142
|
+
uri_method: :get,
|
143
|
+
uri_template: "/v1/{name}/locations",
|
144
|
+
matches: [
|
145
|
+
["name", %r{^projects/[^/]+/?$}, false]
|
146
|
+
]
|
147
|
+
)
|
139
148
|
transcoder.transcode request_pb
|
140
149
|
end
|
141
150
|
|
@@ -146,24 +155,27 @@ module Google
|
|
146
155
|
#
|
147
156
|
# @param request_pb [::Google::Cloud::Location::GetLocationRequest]
|
148
157
|
# A request object representing the call parameters. Required.
|
158
|
+
# @param bindings_override [::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>, nil]
|
159
|
+
# Binding overrides for the transcoding.
|
149
160
|
# @return [Array(String, [String, nil], Hash{String => String})]
|
150
161
|
# Uri, Body, Query string parameters
|
151
|
-
def self.transcode_get_location_request request_pb
|
152
|
-
transcoder = Gapic::Rest::GrpcTranscoder.new
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
162
|
+
def self.transcode_get_location_request request_pb, bindings_override: nil
|
163
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new(bindings_override) if bindings_override
|
164
|
+
transcoder ||= Gapic::Rest::GrpcTranscoder.new
|
165
|
+
.with_bindings(
|
166
|
+
uri_method: :get,
|
167
|
+
uri_template: "/v1/{name}",
|
168
|
+
matches: [
|
169
|
+
["name", %r{^locations/[^/]+/?$}, false]
|
170
|
+
]
|
171
|
+
)
|
172
|
+
.with_bindings(
|
173
|
+
uri_method: :get,
|
174
|
+
uri_template: "/v1/{name}",
|
175
|
+
matches: [
|
176
|
+
["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
|
177
|
+
]
|
178
|
+
)
|
167
179
|
transcoder.transcode request_pb
|
168
180
|
end
|
169
181
|
end
|
@@ -34,12 +34,12 @@ module Google
|
|
34
34
|
# a service. Service-specific metadata is provided through the
|
35
35
|
# {::Google::Cloud::Location::Location#metadata Location.metadata} field.
|
36
36
|
#
|
37
|
-
#
|
37
|
+
# @example Load this service and instantiate a gRPC client
|
38
38
|
#
|
39
39
|
# require "google/cloud/location/locations"
|
40
40
|
# client = ::Google::Cloud::Location::Locations::Client.new
|
41
41
|
#
|
42
|
-
#
|
42
|
+
# @example Load this service and instantiate a REST client
|
43
43
|
#
|
44
44
|
# require "google/cloud/location/locations/rest"
|
45
45
|
# client = ::Google::Cloud::Location::Locations::Rest::Client.new
|
@@ -22,16 +22,14 @@ require "google/cloud/location/version"
|
|
22
22
|
module Google
|
23
23
|
module Cloud
|
24
24
|
##
|
25
|
-
#
|
25
|
+
# API client module.
|
26
26
|
#
|
27
|
-
# @example
|
27
|
+
# @example Load this package, including all its services, and instantiate a gRPC client
|
28
28
|
#
|
29
29
|
# require "google/cloud/location"
|
30
30
|
# client = ::Google::Cloud::Location::Locations::Client.new
|
31
31
|
#
|
32
|
-
#
|
33
|
-
#
|
34
|
-
# @example
|
32
|
+
# @example Load this package, including all its services, and instantiate a REST client
|
35
33
|
#
|
36
34
|
# require "google/cloud/location"
|
37
35
|
# client = ::Google::Cloud::Location::Locations::Rest::Client.new
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-location
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.beta.
|
4
|
+
version: 0.3.beta.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-12-
|
11
|
+
date: 2022-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gapic-common
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 0.16.0
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: 2.a
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
29
|
+
version: 0.16.0
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 2.a
|