google-cloud-retail-v2 0.18.2 → 0.19.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +4 -4
  3. data/README.md +3 -3
  4. data/lib/google/cloud/retail/v2/analytics_service/client.rb +486 -0
  5. data/lib/google/cloud/retail/v2/analytics_service/credentials.rb +51 -0
  6. data/lib/google/cloud/retail/v2/analytics_service/operations.rb +801 -0
  7. data/lib/google/cloud/retail/v2/analytics_service/rest/client.rb +453 -0
  8. data/lib/google/cloud/retail/v2/analytics_service/rest/operations.rb +930 -0
  9. data/lib/google/cloud/retail/v2/analytics_service/rest/service_stub.rb +129 -0
  10. data/lib/google/cloud/retail/v2/analytics_service/rest.rb +53 -0
  11. data/lib/google/cloud/retail/v2/analytics_service.rb +56 -0
  12. data/lib/google/cloud/retail/v2/analytics_service_pb.rb +48 -0
  13. data/lib/google/cloud/retail/v2/analytics_service_services_pb.rb +49 -0
  14. data/lib/google/cloud/retail/v2/catalog_pb.rb +1 -1
  15. data/lib/google/cloud/retail/v2/catalog_service_pb.rb +1 -1
  16. data/lib/google/cloud/retail/v2/common_pb.rb +1 -1
  17. data/lib/google/cloud/retail/v2/completion_service_pb.rb +1 -1
  18. data/lib/google/cloud/retail/v2/control_pb.rb +1 -1
  19. data/lib/google/cloud/retail/v2/control_service_pb.rb +1 -1
  20. data/lib/google/cloud/retail/v2/export_config_pb.rb +58 -0
  21. data/lib/google/cloud/retail/v2/import_config_pb.rb +1 -1
  22. data/lib/google/cloud/retail/v2/model_pb.rb +1 -1
  23. data/lib/google/cloud/retail/v2/model_service_pb.rb +1 -1
  24. data/lib/google/cloud/retail/v2/prediction_service_pb.rb +1 -1
  25. data/lib/google/cloud/retail/v2/product_pb.rb +1 -1
  26. data/lib/google/cloud/retail/v2/product_service_pb.rb +1 -1
  27. data/lib/google/cloud/retail/v2/purge_config_pb.rb +1 -1
  28. data/lib/google/cloud/retail/v2/rest.rb +2 -1
  29. data/lib/google/cloud/retail/v2/search_service_pb.rb +1 -1
  30. data/lib/google/cloud/retail/v2/serving_config_pb.rb +1 -1
  31. data/lib/google/cloud/retail/v2/serving_config_service_pb.rb +1 -1
  32. data/lib/google/cloud/retail/v2/user_event_pb.rb +1 -1
  33. data/lib/google/cloud/retail/v2/user_event_service_pb.rb +1 -1
  34. data/lib/google/cloud/retail/v2/version.rb +1 -1
  35. data/lib/google/cloud/retail/v2.rb +3 -2
  36. data/proto_docs/google/cloud/retail/v2/export_config.rb +180 -0
  37. metadata +14 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5f4e8dc34c807a22d6ee2660e0b01021e0d57f22ef4a49739a75f4f804911294
4
- data.tar.gz: d9fb809cb08769c8f3557fd7a7f0b8992ccc0847c3d80cb7094c1397a0e26e00
3
+ metadata.gz: 0cfc5fc310ae837af15d8fc12cd7581f93e153dee347a4934016db63266dc886
4
+ data.tar.gz: c59add7eddf1ecc3ed291ab2ced4a38c14a83b48321712d2b1c6aeeb847e84cb
5
5
  SHA512:
6
- metadata.gz: f589436aa69a250696b957a0bfa05c598f300d86fdfd4a64ea323a4d9973964bbecf8955b51567958a681d86529d12f27eb807e3aff08a83d2398e7b3cab9387
7
- data.tar.gz: 98d6b374c83d1e4ad094164f8dd62717faaa34c57278fa74ab98898938a8d91d357e02b5696cb1f62c6cb1b514ca06115114a178e1797785eb559e3bb3cb7ed6
6
+ metadata.gz: 67092bd529d653ca95f0222090542ebe971ad746208a3e52b2975e58b93b6e90b38dd2e612173d04281e291f6d6d5e8ac13e968f6b4a99f9936ce191bf38dd5f
7
+ data.tar.gz: d845c492b0da0abcec0580a6931ed217173d8f84393a6cd854db377c761c62244a0413328a3df11ad7868d875659daf1db6b0784c8cc691ecb496b993f7fdf31
data/AUTHENTICATION.md CHANGED
@@ -56,7 +56,7 @@ To configure a credentials file for an individual client initialization:
56
56
  ```ruby
57
57
  require "google/cloud/retail/v2"
58
58
 
59
- client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config|
59
+ client = ::Google::Cloud::Retail::V2::AnalyticsService::Client.new do |config|
60
60
  config.credentials = "path/to/credentialfile.json"
61
61
  end
62
62
  ```
@@ -66,11 +66,11 @@ To configure a credentials file globally for all clients:
66
66
  ```ruby
67
67
  require "google/cloud/retail/v2"
68
68
 
69
- ::Google::Cloud::Retail::V2::CatalogService::Client.configure do |config|
69
+ ::Google::Cloud::Retail::V2::AnalyticsService::Client.configure do |config|
70
70
  config.credentials = "path/to/credentialfile.json"
71
71
  end
72
72
 
73
- client = ::Google::Cloud::Retail::V2::CatalogService::Client.new
73
+ client = ::Google::Cloud::Retail::V2::AnalyticsService::Client.new
74
74
  ```
75
75
 
76
76
  ### Environment Variables
@@ -100,7 +100,7 @@ require "google/cloud/retail/v2"
100
100
 
101
101
  ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json"
102
102
 
103
- client = ::Google::Cloud::Retail::V2::CatalogService::Client.new
103
+ client = ::Google::Cloud::Retail::V2::AnalyticsService::Client.new
104
104
  ```
105
105
 
106
106
  ### Local ADC file
data/README.md CHANGED
@@ -32,9 +32,9 @@ In order to use this library, you first need to go through the following steps:
32
32
  ```ruby
33
33
  require "google/cloud/retail/v2"
34
34
 
35
- client = ::Google::Cloud::Retail::V2::CatalogService::Client.new
36
- request = ::Google::Cloud::Retail::V2::ListCatalogsRequest.new # (request fields as keyword arguments...)
37
- response = client.list_catalogs request
35
+ client = ::Google::Cloud::Retail::V2::AnalyticsService::Client.new
36
+ request = ::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest.new # (request fields as keyword arguments...)
37
+ response = client.export_analytics_metrics request
38
38
  ```
39
39
 
40
40
  View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest)
@@ -0,0 +1,486 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 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 "google/cloud/errors"
20
+ require "google/cloud/retail/v2/analytics_service_pb"
21
+ require "google/cloud/location"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Retail
26
+ module V2
27
+ module AnalyticsService
28
+ ##
29
+ # Client for the AnalyticsService service.
30
+ #
31
+ # Service for managing & accessing retail search business metric.
32
+ # Retail recommendation business metric is currently not available.
33
+ #
34
+ class Client
35
+ # @private
36
+ DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$"
37
+
38
+ # @private
39
+ attr_reader :analytics_service_stub
40
+
41
+ ##
42
+ # Configure the AnalyticsService Client class.
43
+ #
44
+ # See {::Google::Cloud::Retail::V2::AnalyticsService::Client::Configuration}
45
+ # for a description of the configuration fields.
46
+ #
47
+ # @example
48
+ #
49
+ # # Modify the configuration for all AnalyticsService clients
50
+ # ::Google::Cloud::Retail::V2::AnalyticsService::Client.configure do |config|
51
+ # config.timeout = 10.0
52
+ # end
53
+ #
54
+ # @yield [config] Configure the Client client.
55
+ # @yieldparam config [Client::Configuration]
56
+ #
57
+ # @return [Client::Configuration]
58
+ #
59
+ def self.configure
60
+ @configure ||= begin
61
+ namespace = ["Google", "Cloud", "Retail", "V2"]
62
+ parent_config = while namespace.any?
63
+ parent_name = namespace.join "::"
64
+ parent_const = const_get parent_name
65
+ break parent_const.configure if parent_const.respond_to? :configure
66
+ namespace.pop
67
+ end
68
+ default_config = Client::Configuration.new parent_config
69
+
70
+ default_config.rpcs.export_analytics_metrics.timeout = 60.0
71
+ default_config.rpcs.export_analytics_metrics.retry_policy = {
72
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
73
+ }
74
+
75
+ default_config
76
+ end
77
+ yield @configure if block_given?
78
+ @configure
79
+ end
80
+
81
+ ##
82
+ # Configure the AnalyticsService Client instance.
83
+ #
84
+ # The configuration is set to the derived mode, meaning that values can be changed,
85
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
86
+ # should be made on {Client.configure}.
87
+ #
88
+ # See {::Google::Cloud::Retail::V2::AnalyticsService::Client::Configuration}
89
+ # for a description of the configuration fields.
90
+ #
91
+ # @yield [config] Configure the Client client.
92
+ # @yieldparam config [Client::Configuration]
93
+ #
94
+ # @return [Client::Configuration]
95
+ #
96
+ def configure
97
+ yield @config if block_given?
98
+ @config
99
+ end
100
+
101
+ ##
102
+ # The effective universe domain
103
+ #
104
+ # @return [String]
105
+ #
106
+ def universe_domain
107
+ @analytics_service_stub.universe_domain
108
+ end
109
+
110
+ ##
111
+ # Create a new AnalyticsService client object.
112
+ #
113
+ # @example
114
+ #
115
+ # # Create a client using the default configuration
116
+ # client = ::Google::Cloud::Retail::V2::AnalyticsService::Client.new
117
+ #
118
+ # # Create a client using a custom configuration
119
+ # client = ::Google::Cloud::Retail::V2::AnalyticsService::Client.new do |config|
120
+ # config.timeout = 10.0
121
+ # end
122
+ #
123
+ # @yield [config] Configure the AnalyticsService client.
124
+ # @yieldparam config [Client::Configuration]
125
+ #
126
+ def initialize
127
+ # These require statements are intentionally placed here to initialize
128
+ # the gRPC module only when it's required.
129
+ # See https://github.com/googleapis/toolkit/issues/446
130
+ require "gapic/grpc"
131
+ require "google/cloud/retail/v2/analytics_service_services_pb"
132
+
133
+ # Create the configuration object
134
+ @config = Configuration.new Client.configure
135
+
136
+ # Yield the configuration if needed
137
+ yield @config if block_given?
138
+
139
+ # Create credentials
140
+ credentials = @config.credentials
141
+ # Use self-signed JWT if the endpoint is unchanged from default,
142
+ # but only if the default endpoint does not have a region prefix.
143
+ enable_self_signed_jwt = @config.endpoint.nil? ||
144
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
145
+ !@config.endpoint.split(".").first.include?("-"))
146
+ credentials ||= Credentials.default scope: @config.scope,
147
+ enable_self_signed_jwt: enable_self_signed_jwt
148
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
149
+ credentials = Credentials.new credentials, scope: @config.scope
150
+ end
151
+ @quota_project_id = @config.quota_project
152
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
153
+
154
+ @operations_client = Operations.new do |config|
155
+ config.credentials = credentials
156
+ config.quota_project = @quota_project_id
157
+ config.endpoint = @config.endpoint
158
+ config.universe_domain = @config.universe_domain
159
+ end
160
+
161
+ @analytics_service_stub = ::Gapic::ServiceStub.new(
162
+ ::Google::Cloud::Retail::V2::AnalyticsService::Stub,
163
+ credentials: credentials,
164
+ endpoint: @config.endpoint,
165
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
166
+ universe_domain: @config.universe_domain,
167
+ channel_args: @config.channel_args,
168
+ interceptors: @config.interceptors,
169
+ channel_pool_config: @config.channel_pool
170
+ )
171
+
172
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
173
+ config.credentials = credentials
174
+ config.quota_project = @quota_project_id
175
+ config.endpoint = @analytics_service_stub.endpoint
176
+ config.universe_domain = @analytics_service_stub.universe_domain
177
+ end
178
+ end
179
+
180
+ ##
181
+ # Get the associated client for long-running operations.
182
+ #
183
+ # @return [::Google::Cloud::Retail::V2::AnalyticsService::Operations]
184
+ #
185
+ attr_reader :operations_client
186
+
187
+ ##
188
+ # Get the associated client for mix-in of the Locations.
189
+ #
190
+ # @return [Google::Cloud::Location::Locations::Client]
191
+ #
192
+ attr_reader :location_client
193
+
194
+ # Service calls
195
+
196
+ ##
197
+ # Exports analytics metrics.
198
+ #
199
+ # `Operation.response` is of type `ExportAnalyticsMetricsResponse`.
200
+ # `Operation.metadata` is of type `ExportMetadata`.
201
+ #
202
+ # @overload export_analytics_metrics(request, options = nil)
203
+ # Pass arguments to `export_analytics_metrics` via a request object, either of type
204
+ # {::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest} or an equivalent Hash.
205
+ #
206
+ # @param request [::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest, ::Hash]
207
+ # A request object representing the call parameters. Required. To specify no
208
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
209
+ # @param options [::Gapic::CallOptions, ::Hash]
210
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
211
+ #
212
+ # @overload export_analytics_metrics(catalog: nil, output_config: nil, filter: nil)
213
+ # Pass arguments to `export_analytics_metrics` via keyword arguments. Note that at
214
+ # least one keyword argument is required. To specify no parameters, or to keep all
215
+ # the default parameter values, pass an empty Hash as a request object (see above).
216
+ #
217
+ # @param catalog [::String]
218
+ # Required. Full resource name of the parent catalog.
219
+ # Expected format: `projects/*/locations/*/catalogs/*`
220
+ # @param output_config [::Google::Cloud::Retail::V2::OutputConfig, ::Hash]
221
+ # Required. The output location of the data.
222
+ # @param filter [::String]
223
+ # A filtering expression to specify restrictions on returned metrics.
224
+ # The expression is a sequence of terms. Each term applies a restriction to
225
+ # the returned metrics. Use this expression to restrict results to a
226
+ # specific time range.
227
+ #
228
+ # Currently we expect only one types of fields:
229
+ #
230
+ # * `timestamp`: This can be specified twice, once with a
231
+ # less than operator and once with a greater than operator. The
232
+ # `timestamp` restriction should result in one, contiguous, valid,
233
+ # `timestamp` range.
234
+ #
235
+ # Some examples of valid filters expressions:
236
+ #
237
+ # * Example 1: `timestamp > "2012-04-23T18:25:43.511Z"
238
+ # timestamp < "2012-04-23T18:30:43.511Z"`
239
+ # * Example 2: `timestamp > "2012-04-23T18:25:43.511Z"`
240
+ #
241
+ # @yield [response, operation] Access the result along with the RPC operation
242
+ # @yieldparam response [::Gapic::Operation]
243
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
244
+ #
245
+ # @return [::Gapic::Operation]
246
+ #
247
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
248
+ #
249
+ # @example Basic example
250
+ # require "google/cloud/retail/v2"
251
+ #
252
+ # # Create a client object. The client can be reused for multiple calls.
253
+ # client = Google::Cloud::Retail::V2::AnalyticsService::Client.new
254
+ #
255
+ # # Create a request. To set request fields, pass in keyword arguments.
256
+ # request = Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest.new
257
+ #
258
+ # # Call the export_analytics_metrics method.
259
+ # result = client.export_analytics_metrics request
260
+ #
261
+ # # The returned object is of type Gapic::Operation. You can use it to
262
+ # # check the status of an operation, cancel it, or wait for results.
263
+ # # Here is how to wait for a response.
264
+ # result.wait_until_done! timeout: 60
265
+ # if result.response?
266
+ # p result.response
267
+ # else
268
+ # puts "No response received."
269
+ # end
270
+ #
271
+ def export_analytics_metrics request, options = nil
272
+ raise ::ArgumentError, "request must be provided" if request.nil?
273
+
274
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest
275
+
276
+ # Converts hash and nil to an options object
277
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
278
+
279
+ # Customize the options with defaults
280
+ metadata = @config.rpcs.export_analytics_metrics.metadata.to_h
281
+
282
+ # Set x-goog-api-client and x-goog-user-project headers
283
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
284
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
285
+ gapic_version: ::Google::Cloud::Retail::V2::VERSION
286
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
287
+
288
+ header_params = {}
289
+ if request.catalog
290
+ header_params["catalog"] = request.catalog
291
+ end
292
+
293
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
294
+ metadata[:"x-goog-request-params"] ||= request_params_header
295
+
296
+ options.apply_defaults timeout: @config.rpcs.export_analytics_metrics.timeout,
297
+ metadata: metadata,
298
+ retry_policy: @config.rpcs.export_analytics_metrics.retry_policy
299
+
300
+ options.apply_defaults timeout: @config.timeout,
301
+ metadata: @config.metadata,
302
+ retry_policy: @config.retry_policy
303
+
304
+ @analytics_service_stub.call_rpc :export_analytics_metrics, request, options: options do |response, operation|
305
+ response = ::Gapic::Operation.new response, @operations_client, options: options
306
+ yield response, operation if block_given?
307
+ return response
308
+ end
309
+ rescue ::GRPC::BadStatus => e
310
+ raise ::Google::Cloud::Error.from_error(e)
311
+ end
312
+
313
+ ##
314
+ # Configuration class for the AnalyticsService API.
315
+ #
316
+ # This class represents the configuration for AnalyticsService,
317
+ # providing control over timeouts, retry behavior, logging, transport
318
+ # parameters, and other low-level controls. Certain parameters can also be
319
+ # applied individually to specific RPCs. See
320
+ # {::Google::Cloud::Retail::V2::AnalyticsService::Client::Configuration::Rpcs}
321
+ # for a list of RPCs that can be configured independently.
322
+ #
323
+ # Configuration can be applied globally to all clients, or to a single client
324
+ # on construction.
325
+ #
326
+ # @example
327
+ #
328
+ # # Modify the global config, setting the timeout for
329
+ # # export_analytics_metrics to 20 seconds,
330
+ # # and all remaining timeouts to 10 seconds.
331
+ # ::Google::Cloud::Retail::V2::AnalyticsService::Client.configure do |config|
332
+ # config.timeout = 10.0
333
+ # config.rpcs.export_analytics_metrics.timeout = 20.0
334
+ # end
335
+ #
336
+ # # Apply the above configuration only to a new client.
337
+ # client = ::Google::Cloud::Retail::V2::AnalyticsService::Client.new do |config|
338
+ # config.timeout = 10.0
339
+ # config.rpcs.export_analytics_metrics.timeout = 20.0
340
+ # end
341
+ #
342
+ # @!attribute [rw] endpoint
343
+ # A custom service endpoint, as a hostname or hostname:port. The default is
344
+ # nil, indicating to use the default endpoint in the current universe domain.
345
+ # @return [::String,nil]
346
+ # @!attribute [rw] credentials
347
+ # Credentials to send with calls. You may provide any of the following types:
348
+ # * (`String`) The path to a service account key file in JSON format
349
+ # * (`Hash`) A service account key as a Hash
350
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
351
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
352
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
353
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
354
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
355
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
356
+ # * (`nil`) indicating no credentials
357
+ # @return [::Object]
358
+ # @!attribute [rw] scope
359
+ # The OAuth scopes
360
+ # @return [::Array<::String>]
361
+ # @!attribute [rw] lib_name
362
+ # The library name as recorded in instrumentation and logging
363
+ # @return [::String]
364
+ # @!attribute [rw] lib_version
365
+ # The library version as recorded in instrumentation and logging
366
+ # @return [::String]
367
+ # @!attribute [rw] channel_args
368
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
369
+ # `GRPC::Core::Channel` object is provided as the credential.
370
+ # @return [::Hash]
371
+ # @!attribute [rw] interceptors
372
+ # An array of interceptors that are run before calls are executed.
373
+ # @return [::Array<::GRPC::ClientInterceptor>]
374
+ # @!attribute [rw] timeout
375
+ # The call timeout in seconds.
376
+ # @return [::Numeric]
377
+ # @!attribute [rw] metadata
378
+ # Additional gRPC headers to be sent with the call.
379
+ # @return [::Hash{::Symbol=>::String}]
380
+ # @!attribute [rw] retry_policy
381
+ # The retry policy. The value is a hash with the following keys:
382
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
383
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
384
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
385
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
386
+ # trigger a retry.
387
+ # @return [::Hash]
388
+ # @!attribute [rw] quota_project
389
+ # A separate project against which to charge quota.
390
+ # @return [::String]
391
+ # @!attribute [rw] universe_domain
392
+ # The universe domain within which to make requests. This determines the
393
+ # default endpoint URL. The default value of nil uses the environment
394
+ # universe (usually the default "googleapis.com" universe).
395
+ # @return [::String,nil]
396
+ #
397
+ class Configuration
398
+ extend ::Gapic::Config
399
+
400
+ # @private
401
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
402
+ DEFAULT_ENDPOINT = "retail.googleapis.com"
403
+
404
+ config_attr :endpoint, nil, ::String, nil
405
+ config_attr :credentials, nil do |value|
406
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
407
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
408
+ allowed.any? { |klass| klass === value }
409
+ end
410
+ config_attr :scope, nil, ::String, ::Array, nil
411
+ config_attr :lib_name, nil, ::String, nil
412
+ config_attr :lib_version, nil, ::String, nil
413
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
414
+ config_attr :interceptors, nil, ::Array, nil
415
+ config_attr :timeout, nil, ::Numeric, nil
416
+ config_attr :metadata, nil, ::Hash, nil
417
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
418
+ config_attr :quota_project, nil, ::String, nil
419
+ config_attr :universe_domain, nil, ::String, nil
420
+
421
+ # @private
422
+ def initialize parent_config = nil
423
+ @parent_config = parent_config unless parent_config.nil?
424
+
425
+ yield self if block_given?
426
+ end
427
+
428
+ ##
429
+ # Configurations for individual RPCs
430
+ # @return [Rpcs]
431
+ #
432
+ def rpcs
433
+ @rpcs ||= begin
434
+ parent_rpcs = nil
435
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
436
+ Rpcs.new parent_rpcs
437
+ end
438
+ end
439
+
440
+ ##
441
+ # Configuration for the channel pool
442
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
443
+ #
444
+ def channel_pool
445
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
446
+ end
447
+
448
+ ##
449
+ # Configuration RPC class for the AnalyticsService API.
450
+ #
451
+ # Includes fields providing the configuration for each RPC in this service.
452
+ # Each configuration object is of type `Gapic::Config::Method` and includes
453
+ # the following configuration fields:
454
+ #
455
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
456
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
457
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
458
+ # include the following keys:
459
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
460
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
461
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
462
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
463
+ # trigger a retry.
464
+ #
465
+ class Rpcs
466
+ ##
467
+ # RPC-specific configuration for `export_analytics_metrics`
468
+ # @return [::Gapic::Config::Method]
469
+ #
470
+ attr_reader :export_analytics_metrics
471
+
472
+ # @private
473
+ def initialize parent_rpcs = nil
474
+ export_analytics_metrics_config = parent_rpcs.export_analytics_metrics if parent_rpcs.respond_to? :export_analytics_metrics
475
+ @export_analytics_metrics = ::Gapic::Config::Method.new export_analytics_metrics_config
476
+
477
+ yield self if block_given?
478
+ end
479
+ end
480
+ end
481
+ end
482
+ end
483
+ end
484
+ end
485
+ end
486
+ end
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 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 "googleauth"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Retail
24
+ module V2
25
+ module AnalyticsService
26
+ # Credentials for the AnalyticsService API.
27
+ class Credentials < ::Google::Auth::Credentials
28
+ self.scope = [
29
+ "https://www.googleapis.com/auth/cloud-platform"
30
+ ]
31
+ self.env_vars = [
32
+ "RETAIL_CREDENTIALS",
33
+ "RETAIL_KEYFILE",
34
+ "GOOGLE_CLOUD_CREDENTIALS",
35
+ "GOOGLE_CLOUD_KEYFILE",
36
+ "GCLOUD_KEYFILE",
37
+ "RETAIL_CREDENTIALS_JSON",
38
+ "RETAIL_KEYFILE_JSON",
39
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
40
+ "GOOGLE_CLOUD_KEYFILE_JSON",
41
+ "GCLOUD_KEYFILE_JSON"
42
+ ]
43
+ self.paths = [
44
+ "~/.config/google_cloud/application_default_credentials.json"
45
+ ]
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end