google-shopping-merchant-reports-v1 0.a → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,454 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 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/shopping/merchant/reports/v1/reports_pb"
21
+ require "google/shopping/merchant/reports/v1/report_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Shopping
25
+ module Merchant
26
+ module Reports
27
+ module V1
28
+ module ReportService
29
+ module Rest
30
+ ##
31
+ # REST client for the ReportService service.
32
+ #
33
+ # Service for retrieving reports and insights about your products, their
34
+ # performance, and their competitive environment on Google.
35
+ #
36
+ class Client
37
+ # @private
38
+ API_VERSION = ""
39
+
40
+ # @private
41
+ DEFAULT_ENDPOINT_TEMPLATE = "merchantapi.$UNIVERSE_DOMAIN$"
42
+
43
+ # @private
44
+ attr_reader :report_service_stub
45
+
46
+ ##
47
+ # Configure the ReportService Client class.
48
+ #
49
+ # See {::Google::Shopping::Merchant::Reports::V1::ReportService::Rest::Client::Configuration}
50
+ # for a description of the configuration fields.
51
+ #
52
+ # @example
53
+ #
54
+ # # Modify the configuration for all ReportService clients
55
+ # ::Google::Shopping::Merchant::Reports::V1::ReportService::Rest::Client.configure do |config|
56
+ # config.timeout = 10.0
57
+ # end
58
+ #
59
+ # @yield [config] Configure the Client client.
60
+ # @yieldparam config [Client::Configuration]
61
+ #
62
+ # @return [Client::Configuration]
63
+ #
64
+ def self.configure
65
+ @configure ||= begin
66
+ namespace = ["Google", "Shopping", "Merchant", "Reports", "V1"]
67
+ parent_config = while namespace.any?
68
+ parent_name = namespace.join "::"
69
+ parent_const = const_get parent_name
70
+ break parent_const.configure if parent_const.respond_to? :configure
71
+ namespace.pop
72
+ end
73
+ default_config = Client::Configuration.new parent_config
74
+
75
+ default_config.timeout = 60.0
76
+ default_config.retry_policy = {
77
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
78
+ }
79
+
80
+ default_config
81
+ end
82
+ yield @configure if block_given?
83
+ @configure
84
+ end
85
+
86
+ ##
87
+ # Configure the ReportService Client instance.
88
+ #
89
+ # The configuration is set to the derived mode, meaning that values can be changed,
90
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
91
+ # should be made on {Client.configure}.
92
+ #
93
+ # See {::Google::Shopping::Merchant::Reports::V1::ReportService::Rest::Client::Configuration}
94
+ # for a description of the configuration fields.
95
+ #
96
+ # @yield [config] Configure the Client client.
97
+ # @yieldparam config [Client::Configuration]
98
+ #
99
+ # @return [Client::Configuration]
100
+ #
101
+ def configure
102
+ yield @config if block_given?
103
+ @config
104
+ end
105
+
106
+ ##
107
+ # The effective universe domain
108
+ #
109
+ # @return [String]
110
+ #
111
+ def universe_domain
112
+ @report_service_stub.universe_domain
113
+ end
114
+
115
+ ##
116
+ # Create a new ReportService REST client object.
117
+ #
118
+ # @example
119
+ #
120
+ # # Create a client using the default configuration
121
+ # client = ::Google::Shopping::Merchant::Reports::V1::ReportService::Rest::Client.new
122
+ #
123
+ # # Create a client using a custom configuration
124
+ # client = ::Google::Shopping::Merchant::Reports::V1::ReportService::Rest::Client.new do |config|
125
+ # config.timeout = 10.0
126
+ # end
127
+ #
128
+ # @yield [config] Configure the ReportService client.
129
+ # @yieldparam config [Client::Configuration]
130
+ #
131
+ def initialize
132
+ # Create the configuration object
133
+ @config = Configuration.new Client.configure
134
+
135
+ # Yield the configuration if needed
136
+ yield @config if block_given?
137
+
138
+ # Create credentials
139
+ credentials = @config.credentials
140
+ # Use self-signed JWT if the endpoint is unchanged from default,
141
+ # but only if the default endpoint does not have a region prefix.
142
+ enable_self_signed_jwt = @config.endpoint.nil? ||
143
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
144
+ !@config.endpoint.split(".").first.include?("-"))
145
+ credentials ||= Credentials.default scope: @config.scope,
146
+ enable_self_signed_jwt: enable_self_signed_jwt
147
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
148
+ credentials = Credentials.new credentials, scope: @config.scope
149
+ end
150
+
151
+ @quota_project_id = @config.quota_project
152
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
153
+
154
+ @report_service_stub = ::Google::Shopping::Merchant::Reports::V1::ReportService::Rest::ServiceStub.new(
155
+ endpoint: @config.endpoint,
156
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
157
+ universe_domain: @config.universe_domain,
158
+ credentials: credentials,
159
+ logger: @config.logger
160
+ )
161
+
162
+ @report_service_stub.logger(stub: true)&.info do |entry|
163
+ entry.set_system_name
164
+ entry.set_service
165
+ entry.message = "Created client for #{entry.service}"
166
+ entry.set_credentials_fields credentials
167
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
168
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
169
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
170
+ end
171
+ end
172
+
173
+ ##
174
+ # The logger used for request/response debug logging.
175
+ #
176
+ # @return [Logger]
177
+ #
178
+ def logger
179
+ @report_service_stub.logger
180
+ end
181
+
182
+ # Service calls
183
+
184
+ ##
185
+ # Retrieves a report defined by a search query. The response might contain
186
+ # fewer rows than specified by `page_size`. Rely on `next_page_token` to
187
+ # determine if there are more rows to be requested.
188
+ #
189
+ # @overload search(request, options = nil)
190
+ # Pass arguments to `search` via a request object, either of type
191
+ # {::Google::Shopping::Merchant::Reports::V1::SearchRequest} or an equivalent Hash.
192
+ #
193
+ # @param request [::Google::Shopping::Merchant::Reports::V1::SearchRequest, ::Hash]
194
+ # A request object representing the call parameters. Required. To specify no
195
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
196
+ # @param options [::Gapic::CallOptions, ::Hash]
197
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
198
+ #
199
+ # @overload search(parent: nil, query: nil, page_size: nil, page_token: nil)
200
+ # Pass arguments to `search` via keyword arguments. Note that at
201
+ # least one keyword argument is required. To specify no parameters, or to keep all
202
+ # the default parameter values, pass an empty Hash as a request object (see above).
203
+ #
204
+ # @param parent [::String]
205
+ # Required. Id of the account making the call. Must be a standalone account
206
+ # or an MCA subaccount. Format: accounts/\\{account}
207
+ # @param query [::String]
208
+ # Required. Query that defines a report to be retrieved.
209
+ #
210
+ # For details on how to construct your query, see the [Query Language
211
+ # guide](/merchant/api/guides/reports/query-language). For the full list of
212
+ # available tables and fields, see the [Available
213
+ # fields](/merchant/api/reference/rest/reports_v1/accounts.reports).
214
+ # @param page_size [::Integer]
215
+ # Optional. Number of `ReportRows` to retrieve in a single page. Defaults to
216
+ # 1000. Values above 5000 are coerced to 5000.
217
+ # @param page_token [::String]
218
+ # Optional. Token of the page to retrieve. If not specified, the first page
219
+ # of results is returned. In order to request the next page of results, the
220
+ # value obtained from `next_page_token` in the previous response should be
221
+ # used.
222
+ # @yield [result, operation] Access the result along with the TransportOperation object
223
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Shopping::Merchant::Reports::V1::ReportRow>]
224
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
225
+ #
226
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Shopping::Merchant::Reports::V1::ReportRow>]
227
+ #
228
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
229
+ #
230
+ # @example Basic example
231
+ # require "google/shopping/merchant/reports/v1"
232
+ #
233
+ # # Create a client object. The client can be reused for multiple calls.
234
+ # client = Google::Shopping::Merchant::Reports::V1::ReportService::Rest::Client.new
235
+ #
236
+ # # Create a request. To set request fields, pass in keyword arguments.
237
+ # request = Google::Shopping::Merchant::Reports::V1::SearchRequest.new
238
+ #
239
+ # # Call the search method.
240
+ # result = client.search request
241
+ #
242
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
243
+ # # over elements, and API calls will be issued to fetch pages as needed.
244
+ # result.each do |item|
245
+ # # Each element is of type ::Google::Shopping::Merchant::Reports::V1::ReportRow.
246
+ # p item
247
+ # end
248
+ #
249
+ def search request, options = nil
250
+ raise ::ArgumentError, "request must be provided" if request.nil?
251
+
252
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Reports::V1::SearchRequest
253
+
254
+ # Converts hash and nil to an options object
255
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
256
+
257
+ # Customize the options with defaults
258
+ call_metadata = @config.rpcs.search.metadata.to_h
259
+
260
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
261
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
262
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
263
+ gapic_version: ::Google::Shopping::Merchant::Reports::V1::VERSION,
264
+ transports_version_send: [:rest]
265
+
266
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
267
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
268
+
269
+ options.apply_defaults timeout: @config.rpcs.search.timeout,
270
+ metadata: call_metadata,
271
+ retry_policy: @config.rpcs.search.retry_policy
272
+
273
+ options.apply_defaults timeout: @config.timeout,
274
+ metadata: @config.metadata,
275
+ retry_policy: @config.retry_policy
276
+
277
+ @report_service_stub.search request, options do |result, operation|
278
+ result = ::Gapic::Rest::PagedEnumerable.new @report_service_stub, :search, "results", request, result, options
279
+ yield result, operation if block_given?
280
+ throw :response, result
281
+ end
282
+ rescue ::Gapic::Rest::Error => e
283
+ raise ::Google::Cloud::Error.from_error(e)
284
+ end
285
+
286
+ ##
287
+ # Configuration class for the ReportService REST API.
288
+ #
289
+ # This class represents the configuration for ReportService REST,
290
+ # providing control over timeouts, retry behavior, logging, transport
291
+ # parameters, and other low-level controls. Certain parameters can also be
292
+ # applied individually to specific RPCs. See
293
+ # {::Google::Shopping::Merchant::Reports::V1::ReportService::Rest::Client::Configuration::Rpcs}
294
+ # for a list of RPCs that can be configured independently.
295
+ #
296
+ # Configuration can be applied globally to all clients, or to a single client
297
+ # on construction.
298
+ #
299
+ # @example
300
+ #
301
+ # # Modify the global config, setting the timeout for
302
+ # # search to 20 seconds,
303
+ # # and all remaining timeouts to 10 seconds.
304
+ # ::Google::Shopping::Merchant::Reports::V1::ReportService::Rest::Client.configure do |config|
305
+ # config.timeout = 10.0
306
+ # config.rpcs.search.timeout = 20.0
307
+ # end
308
+ #
309
+ # # Apply the above configuration only to a new client.
310
+ # client = ::Google::Shopping::Merchant::Reports::V1::ReportService::Rest::Client.new do |config|
311
+ # config.timeout = 10.0
312
+ # config.rpcs.search.timeout = 20.0
313
+ # end
314
+ #
315
+ # @!attribute [rw] endpoint
316
+ # A custom service endpoint, as a hostname or hostname:port. The default is
317
+ # nil, indicating to use the default endpoint in the current universe domain.
318
+ # @return [::String,nil]
319
+ # @!attribute [rw] credentials
320
+ # Credentials to send with calls. You may provide any of the following types:
321
+ # * (`String`) The path to a service account key file in JSON format
322
+ # * (`Hash`) A service account key as a Hash
323
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
324
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
325
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
326
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
327
+ # * (`nil`) indicating no credentials
328
+ #
329
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
330
+ # external source for authentication to Google Cloud, you must validate it before
331
+ # providing it to a Google API client library. Providing an unvalidated credential
332
+ # configuration to Google APIs can compromise the security of your systems and data.
333
+ # For more information, refer to [Validate credential configurations from external
334
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
335
+ # @return [::Object]
336
+ # @!attribute [rw] scope
337
+ # The OAuth scopes
338
+ # @return [::Array<::String>]
339
+ # @!attribute [rw] lib_name
340
+ # The library name as recorded in instrumentation and logging
341
+ # @return [::String]
342
+ # @!attribute [rw] lib_version
343
+ # The library version as recorded in instrumentation and logging
344
+ # @return [::String]
345
+ # @!attribute [rw] timeout
346
+ # The call timeout in seconds.
347
+ # @return [::Numeric]
348
+ # @!attribute [rw] metadata
349
+ # Additional headers to be sent with the call.
350
+ # @return [::Hash{::Symbol=>::String}]
351
+ # @!attribute [rw] retry_policy
352
+ # The retry policy. The value is a hash with the following keys:
353
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
354
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
355
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
356
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
357
+ # trigger a retry.
358
+ # @return [::Hash]
359
+ # @!attribute [rw] quota_project
360
+ # A separate project against which to charge quota.
361
+ # @return [::String]
362
+ # @!attribute [rw] universe_domain
363
+ # The universe domain within which to make requests. This determines the
364
+ # default endpoint URL. The default value of nil uses the environment
365
+ # universe (usually the default "googleapis.com" universe).
366
+ # @return [::String,nil]
367
+ # @!attribute [rw] logger
368
+ # A custom logger to use for request/response debug logging, or the value
369
+ # `:default` (the default) to construct a default logger, or `nil` to
370
+ # explicitly disable logging.
371
+ # @return [::Logger,:default,nil]
372
+ #
373
+ class Configuration
374
+ extend ::Gapic::Config
375
+
376
+ # @private
377
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
378
+ DEFAULT_ENDPOINT = "merchantapi.googleapis.com"
379
+
380
+ config_attr :endpoint, nil, ::String, nil
381
+ config_attr :credentials, nil do |value|
382
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
383
+ allowed.any? { |klass| klass === value }
384
+ end
385
+ config_attr :scope, nil, ::String, ::Array, nil
386
+ config_attr :lib_name, nil, ::String, nil
387
+ config_attr :lib_version, nil, ::String, nil
388
+ config_attr :timeout, nil, ::Numeric, nil
389
+ config_attr :metadata, nil, ::Hash, nil
390
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
391
+ config_attr :quota_project, nil, ::String, nil
392
+ config_attr :universe_domain, nil, ::String, nil
393
+ config_attr :logger, :default, ::Logger, nil, :default
394
+
395
+ # @private
396
+ def initialize parent_config = nil
397
+ @parent_config = parent_config unless parent_config.nil?
398
+
399
+ yield self if block_given?
400
+ end
401
+
402
+ ##
403
+ # Configurations for individual RPCs
404
+ # @return [Rpcs]
405
+ #
406
+ def rpcs
407
+ @rpcs ||= begin
408
+ parent_rpcs = nil
409
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
410
+ Rpcs.new parent_rpcs
411
+ end
412
+ end
413
+
414
+ ##
415
+ # Configuration RPC class for the ReportService API.
416
+ #
417
+ # Includes fields providing the configuration for each RPC in this service.
418
+ # Each configuration object is of type `Gapic::Config::Method` and includes
419
+ # the following configuration fields:
420
+ #
421
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
422
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
423
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
424
+ # include the following keys:
425
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
426
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
427
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
428
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
429
+ # trigger a retry.
430
+ #
431
+ class Rpcs
432
+ ##
433
+ # RPC-specific configuration for `search`
434
+ # @return [::Gapic::Config::Method]
435
+ #
436
+ attr_reader :search
437
+
438
+ # @private
439
+ def initialize parent_rpcs = nil
440
+ search_config = parent_rpcs.search if parent_rpcs.respond_to? :search
441
+ @search = ::Gapic::Config::Method.new search_config
442
+
443
+ yield self if block_given?
444
+ end
445
+ end
446
+ end
447
+ end
448
+ end
449
+ end
450
+ end
451
+ end
452
+ end
453
+ end
454
+ end
@@ -0,0 +1,145 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 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/shopping/merchant/reports/v1/reports_pb"
20
+
21
+ module Google
22
+ module Shopping
23
+ module Merchant
24
+ module Reports
25
+ module V1
26
+ module ReportService
27
+ module Rest
28
+ ##
29
+ # REST service stub for the ReportService service.
30
+ # Service stub contains baseline method implementations
31
+ # including transcoding, making the REST call, and deserialing the response.
32
+ #
33
+ class ServiceStub
34
+ # @private
35
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
36
+ # These require statements are intentionally placed here to initialize
37
+ # the REST modules only when it's required.
38
+ require "gapic/rest"
39
+
40
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
41
+ endpoint_template: endpoint_template,
42
+ universe_domain: universe_domain,
43
+ credentials: credentials,
44
+ numeric_enums: true,
45
+ service_name: self.class,
46
+ raise_faraday_errors: false,
47
+ logger: logger
48
+ end
49
+
50
+ ##
51
+ # The effective universe domain
52
+ #
53
+ # @return [String]
54
+ #
55
+ def universe_domain
56
+ @client_stub.universe_domain
57
+ end
58
+
59
+ ##
60
+ # The effective endpoint
61
+ #
62
+ # @return [String]
63
+ #
64
+ def endpoint
65
+ @client_stub.endpoint
66
+ end
67
+
68
+ ##
69
+ # The logger used for request/response debug logging.
70
+ #
71
+ # @return [Logger]
72
+ #
73
+ def logger stub: false
74
+ stub ? @client_stub.stub_logger : @client_stub.logger
75
+ end
76
+
77
+ ##
78
+ # Baseline implementation for the search REST call
79
+ #
80
+ # @param request_pb [::Google::Shopping::Merchant::Reports::V1::SearchRequest]
81
+ # A request object representing the call parameters. Required.
82
+ # @param options [::Gapic::CallOptions]
83
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
84
+ #
85
+ # @yield [result, operation] Access the result along with the TransportOperation object
86
+ # @yieldparam result [::Google::Shopping::Merchant::Reports::V1::SearchResponse]
87
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
88
+ #
89
+ # @return [::Google::Shopping::Merchant::Reports::V1::SearchResponse]
90
+ # A result object deserialized from the server's reply
91
+ def search request_pb, options = nil
92
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
93
+
94
+ verb, uri, query_string_params, body = ServiceStub.transcode_search_request request_pb
95
+ query_string_params = if query_string_params.any?
96
+ query_string_params.to_h { |p| p.split "=", 2 }
97
+ else
98
+ {}
99
+ end
100
+
101
+ response = @client_stub.make_http_request(
102
+ verb,
103
+ uri: uri,
104
+ body: body || "",
105
+ params: query_string_params,
106
+ method_name: "search",
107
+ options: options
108
+ )
109
+ operation = ::Gapic::Rest::TransportOperation.new response
110
+ result = ::Google::Shopping::Merchant::Reports::V1::SearchResponse.decode_json response.body, ignore_unknown_fields: true
111
+ catch :response do
112
+ yield result, operation if block_given?
113
+ result
114
+ end
115
+ end
116
+
117
+ ##
118
+ # @private
119
+ #
120
+ # GRPC transcoding helper method for the search REST call
121
+ #
122
+ # @param request_pb [::Google::Shopping::Merchant::Reports::V1::SearchRequest]
123
+ # A request object representing the call parameters. Required.
124
+ # @return [Array(String, [String, nil], Hash{String => String})]
125
+ # Uri, Body, Query string parameters
126
+ def self.transcode_search_request request_pb
127
+ transcoder = Gapic::Rest::GrpcTranscoder.new
128
+ .with_bindings(
129
+ uri_method: :post,
130
+ uri_template: "/reports/v1/{parent}/reports:search",
131
+ body: "*",
132
+ matches: [
133
+ ["parent", %r{^accounts/[^/]+/?$}, false]
134
+ ]
135
+ )
136
+ transcoder.transcode request_pb
137
+ end
138
+ end
139
+ end
140
+ end
141
+ end
142
+ end
143
+ end
144
+ end
145
+ end
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 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/rest"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/shopping/merchant/reports/v1/version"
24
+
25
+ require "google/shopping/merchant/reports/v1/report_service/credentials"
26
+ require "google/shopping/merchant/reports/v1/report_service/rest/client"
27
+
28
+ module Google
29
+ module Shopping
30
+ module Merchant
31
+ module Reports
32
+ module V1
33
+ ##
34
+ # Service for retrieving reports and insights about your products, their
35
+ # performance, and their competitive environment on Google.
36
+ #
37
+ # To load this service and instantiate a REST client:
38
+ #
39
+ # require "google/shopping/merchant/reports/v1/report_service/rest"
40
+ # client = ::Google::Shopping::Merchant::Reports::V1::ReportService::Rest::Client.new
41
+ #
42
+ module ReportService
43
+ # Client for the REST transport
44
+ module Rest
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+
53
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
54
+ require "google/shopping/merchant/reports/v1/report_service/rest/helpers" if ::File.file? helper_path