google-cloud-channel-v1 0.15.0 → 0.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/google/cloud/channel/v1/cloud_channel_reports_service/client.rb +12 -16
- data/lib/google/cloud/channel/v1/cloud_channel_reports_service/operations.rb +12 -14
- data/lib/google/cloud/channel/v1/cloud_channel_reports_service/rest/client.rb +583 -0
- data/lib/google/cloud/channel/v1/cloud_channel_reports_service/rest/operations.rb +793 -0
- data/lib/google/cloud/channel/v1/cloud_channel_reports_service/rest/service_stub.rb +227 -0
- data/lib/google/cloud/channel/v1/cloud_channel_reports_service/rest.rb +56 -0
- data/lib/google/cloud/channel/v1/cloud_channel_reports_service.rb +7 -1
- data/lib/google/cloud/channel/v1/cloud_channel_service/client.rb +92 -116
- data/lib/google/cloud/channel/v1/cloud_channel_service/operations.rb +12 -14
- data/lib/google/cloud/channel/v1/cloud_channel_service/rest/client.rb +4784 -0
- data/lib/google/cloud/channel/v1/cloud_channel_service/rest/operations.rb +793 -0
- data/lib/google/cloud/channel/v1/cloud_channel_service/rest/service_stub.rb +2771 -0
- data/lib/google/cloud/channel/v1/cloud_channel_service/rest.rb +72 -0
- data/lib/google/cloud/channel/v1/cloud_channel_service.rb +7 -1
- data/lib/google/cloud/channel/v1/rest.rb +38 -0
- data/lib/google/cloud/channel/v1/version.rb +1 -1
- data/lib/google/cloud/channel/v1.rb +7 -2
- metadata +19 -8
@@ -0,0 +1,583 @@
|
|
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 "google/cloud/errors"
|
20
|
+
require "google/cloud/channel/v1/reports_service_pb"
|
21
|
+
require "google/cloud/channel/v1/cloud_channel_reports_service/rest/service_stub"
|
22
|
+
|
23
|
+
module Google
|
24
|
+
module Cloud
|
25
|
+
module Channel
|
26
|
+
module V1
|
27
|
+
module CloudChannelReportsService
|
28
|
+
module Rest
|
29
|
+
##
|
30
|
+
# REST client for the CloudChannelReportsService service.
|
31
|
+
#
|
32
|
+
# CloudChannelReportsService lets Google Cloud resellers and
|
33
|
+
# distributors retrieve and combine a variety of data in Cloud Channel for
|
34
|
+
# multiple products (Google Cloud Platform (GCP), Google Voice, and
|
35
|
+
# Google Workspace.)
|
36
|
+
#
|
37
|
+
class Client
|
38
|
+
include Paths
|
39
|
+
|
40
|
+
# @private
|
41
|
+
attr_reader :cloud_channel_reports_service_stub
|
42
|
+
|
43
|
+
##
|
44
|
+
# Configure the CloudChannelReportsService Client class.
|
45
|
+
#
|
46
|
+
# See {::Google::Cloud::Channel::V1::CloudChannelReportsService::Rest::Client::Configuration}
|
47
|
+
# for a description of the configuration fields.
|
48
|
+
#
|
49
|
+
# @example
|
50
|
+
#
|
51
|
+
# # Modify the configuration for all CloudChannelReportsService clients
|
52
|
+
# ::Google::Cloud::Channel::V1::CloudChannelReportsService::Rest::Client.configure do |config|
|
53
|
+
# config.timeout = 10.0
|
54
|
+
# end
|
55
|
+
#
|
56
|
+
# @yield [config] Configure the Client client.
|
57
|
+
# @yieldparam config [Client::Configuration]
|
58
|
+
#
|
59
|
+
# @return [Client::Configuration]
|
60
|
+
#
|
61
|
+
def self.configure
|
62
|
+
@configure ||= begin
|
63
|
+
namespace = ["Google", "Cloud", "Channel", "V1"]
|
64
|
+
parent_config = while namespace.any?
|
65
|
+
parent_name = namespace.join "::"
|
66
|
+
parent_const = const_get parent_name
|
67
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
68
|
+
namespace.pop
|
69
|
+
end
|
70
|
+
default_config = Client::Configuration.new parent_config
|
71
|
+
|
72
|
+
default_config
|
73
|
+
end
|
74
|
+
yield @configure if block_given?
|
75
|
+
@configure
|
76
|
+
end
|
77
|
+
|
78
|
+
##
|
79
|
+
# Configure the CloudChannelReportsService Client instance.
|
80
|
+
#
|
81
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
82
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
83
|
+
# should be made on {Client.configure}.
|
84
|
+
#
|
85
|
+
# See {::Google::Cloud::Channel::V1::CloudChannelReportsService::Rest::Client::Configuration}
|
86
|
+
# for a description of the configuration fields.
|
87
|
+
#
|
88
|
+
# @yield [config] Configure the Client client.
|
89
|
+
# @yieldparam config [Client::Configuration]
|
90
|
+
#
|
91
|
+
# @return [Client::Configuration]
|
92
|
+
#
|
93
|
+
def configure
|
94
|
+
yield @config if block_given?
|
95
|
+
@config
|
96
|
+
end
|
97
|
+
|
98
|
+
##
|
99
|
+
# Create a new CloudChannelReportsService REST client object.
|
100
|
+
#
|
101
|
+
# @example
|
102
|
+
#
|
103
|
+
# # Create a client using the default configuration
|
104
|
+
# client = ::Google::Cloud::Channel::V1::CloudChannelReportsService::Rest::Client.new
|
105
|
+
#
|
106
|
+
# # Create a client using a custom configuration
|
107
|
+
# client = ::Google::Cloud::Channel::V1::CloudChannelReportsService::Rest::Client.new do |config|
|
108
|
+
# config.timeout = 10.0
|
109
|
+
# end
|
110
|
+
#
|
111
|
+
# @yield [config] Configure the CloudChannelReportsService client.
|
112
|
+
# @yieldparam config [Client::Configuration]
|
113
|
+
#
|
114
|
+
def initialize
|
115
|
+
# Create the configuration object
|
116
|
+
@config = Configuration.new Client.configure
|
117
|
+
|
118
|
+
# Yield the configuration if needed
|
119
|
+
yield @config if block_given?
|
120
|
+
|
121
|
+
# Create credentials
|
122
|
+
credentials = @config.credentials
|
123
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
124
|
+
# but only if the default endpoint does not have a region prefix.
|
125
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
126
|
+
!@config.endpoint.split(".").first.include?("-")
|
127
|
+
credentials ||= Credentials.default scope: @config.scope,
|
128
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
129
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
130
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
131
|
+
end
|
132
|
+
|
133
|
+
@quota_project_id = @config.quota_project
|
134
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
135
|
+
|
136
|
+
@operations_client = ::Google::Cloud::Channel::V1::CloudChannelReportsService::Rest::Operations.new do |config|
|
137
|
+
config.credentials = credentials
|
138
|
+
config.quota_project = @quota_project_id
|
139
|
+
config.endpoint = @config.endpoint
|
140
|
+
end
|
141
|
+
|
142
|
+
@cloud_channel_reports_service_stub = ::Google::Cloud::Channel::V1::CloudChannelReportsService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
|
143
|
+
end
|
144
|
+
|
145
|
+
##
|
146
|
+
# Get the associated client for long-running operations.
|
147
|
+
#
|
148
|
+
# @return [::Google::Cloud::Channel::V1::CloudChannelReportsService::Rest::Operations]
|
149
|
+
#
|
150
|
+
attr_reader :operations_client
|
151
|
+
|
152
|
+
# Service calls
|
153
|
+
|
154
|
+
##
|
155
|
+
# Begins generation of data for a given report. The report
|
156
|
+
# identifier is a UID (for example, `613bf59q`).
|
157
|
+
#
|
158
|
+
# Possible error codes:
|
159
|
+
#
|
160
|
+
# * PERMISSION_DENIED: The user doesn't have access to this report.
|
161
|
+
# * INVALID_ARGUMENT: Required request parameters are missing
|
162
|
+
# or invalid.
|
163
|
+
# * NOT_FOUND: The report identifier was not found.
|
164
|
+
# * INTERNAL: Any non-user error related to a technical issue
|
165
|
+
# in the backend. Contact Cloud Channel support.
|
166
|
+
# * UNKNOWN: Any non-user error related to a technical issue
|
167
|
+
# in the backend. Contact Cloud Channel support.
|
168
|
+
#
|
169
|
+
# Return value:
|
170
|
+
# The ID of a long-running operation.
|
171
|
+
#
|
172
|
+
# To get the results of the operation, call the GetOperation method of
|
173
|
+
# CloudChannelOperationsService. The Operation metadata contains an
|
174
|
+
# instance of {::Google::Cloud::Channel::V1::OperationMetadata OperationMetadata}.
|
175
|
+
#
|
176
|
+
# To get the results of report generation, call
|
177
|
+
# {::Google::Cloud::Channel::V1::CloudChannelReportsService::Rest::Client#fetch_report_results CloudChannelReportsService.FetchReportResults}
|
178
|
+
# with the
|
179
|
+
# {::Google::Cloud::Channel::V1::RunReportJobResponse#report_job RunReportJobResponse.report_job}.
|
180
|
+
#
|
181
|
+
# @overload run_report_job(request, options = nil)
|
182
|
+
# Pass arguments to `run_report_job` via a request object, either of type
|
183
|
+
# {::Google::Cloud::Channel::V1::RunReportJobRequest} or an equivalent Hash.
|
184
|
+
#
|
185
|
+
# @param request [::Google::Cloud::Channel::V1::RunReportJobRequest, ::Hash]
|
186
|
+
# A request object representing the call parameters. Required. To specify no
|
187
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
188
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
189
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
190
|
+
#
|
191
|
+
# @overload run_report_job(name: nil, date_range: nil, filter: nil, language_code: nil)
|
192
|
+
# Pass arguments to `run_report_job` via keyword arguments. Note that at
|
193
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
194
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
195
|
+
#
|
196
|
+
# @param name [::String]
|
197
|
+
# Required. The report's resource name. Specifies the account and report used
|
198
|
+
# to generate report data. The report_id identifier is a UID (for example,
|
199
|
+
# `613bf59q`).
|
200
|
+
# Name uses the format:
|
201
|
+
# accounts/\\{account_id}/reports/\\{report_id}
|
202
|
+
# @param date_range [::Google::Cloud::Channel::V1::DateRange, ::Hash]
|
203
|
+
# Optional. The range of usage or invoice dates to include in the result.
|
204
|
+
# @param filter [::String]
|
205
|
+
# Optional. A structured string that defines conditions on dimension columns
|
206
|
+
# to restrict the report output.
|
207
|
+
#
|
208
|
+
# Filters support logical operators (AND, OR, NOT) and conditional operators
|
209
|
+
# (=, !=, <, >, <=, and >=) using `column_id` as keys.
|
210
|
+
#
|
211
|
+
# For example:
|
212
|
+
# `(customer:"accounts/C123abc/customers/S456def" OR
|
213
|
+
# customer:"accounts/C123abc/customers/S789ghi") AND
|
214
|
+
# invoice_start_date.year >= 2022`
|
215
|
+
# @param language_code [::String]
|
216
|
+
# Optional. The BCP-47 language code, such as "en-US". If specified, the
|
217
|
+
# response is localized to the corresponding language code if the
|
218
|
+
# original data sources support it.
|
219
|
+
# Default is "en-US".
|
220
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
221
|
+
# @yieldparam result [::Gapic::Operation]
|
222
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
223
|
+
#
|
224
|
+
# @return [::Gapic::Operation]
|
225
|
+
#
|
226
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
227
|
+
def run_report_job request, options = nil
|
228
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
229
|
+
|
230
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::RunReportJobRequest
|
231
|
+
|
232
|
+
# Converts hash and nil to an options object
|
233
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
234
|
+
|
235
|
+
# Customize the options with defaults
|
236
|
+
call_metadata = @config.rpcs.run_report_job.metadata.to_h
|
237
|
+
|
238
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
239
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
240
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
241
|
+
gapic_version: ::Google::Cloud::Channel::V1::VERSION,
|
242
|
+
transports_version_send: [:rest]
|
243
|
+
|
244
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
245
|
+
|
246
|
+
options.apply_defaults timeout: @config.rpcs.run_report_job.timeout,
|
247
|
+
metadata: call_metadata,
|
248
|
+
retry_policy: @config.rpcs.run_report_job.retry_policy
|
249
|
+
|
250
|
+
options.apply_defaults timeout: @config.timeout,
|
251
|
+
metadata: @config.metadata,
|
252
|
+
retry_policy: @config.retry_policy
|
253
|
+
|
254
|
+
@cloud_channel_reports_service_stub.run_report_job request, options do |result, operation|
|
255
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
256
|
+
yield result, operation if block_given?
|
257
|
+
return result
|
258
|
+
end
|
259
|
+
rescue ::Gapic::Rest::Error => e
|
260
|
+
raise ::Google::Cloud::Error.from_error(e)
|
261
|
+
end
|
262
|
+
|
263
|
+
##
|
264
|
+
# Retrieves data generated by
|
265
|
+
# {::Google::Cloud::Channel::V1::CloudChannelReportsService::Rest::Client#run_report_job CloudChannelReportsService.RunReportJob}.
|
266
|
+
#
|
267
|
+
# @overload fetch_report_results(request, options = nil)
|
268
|
+
# Pass arguments to `fetch_report_results` via a request object, either of type
|
269
|
+
# {::Google::Cloud::Channel::V1::FetchReportResultsRequest} or an equivalent Hash.
|
270
|
+
#
|
271
|
+
# @param request [::Google::Cloud::Channel::V1::FetchReportResultsRequest, ::Hash]
|
272
|
+
# A request object representing the call parameters. Required. To specify no
|
273
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
274
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
275
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
276
|
+
#
|
277
|
+
# @overload fetch_report_results(report_job: nil, page_size: nil, page_token: nil)
|
278
|
+
# Pass arguments to `fetch_report_results` via keyword arguments. Note that at
|
279
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
280
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
281
|
+
#
|
282
|
+
# @param report_job [::String]
|
283
|
+
# Required. The report job created by
|
284
|
+
# {::Google::Cloud::Channel::V1::CloudChannelReportsService::Rest::Client#run_report_job CloudChannelReportsService.RunReportJob}.
|
285
|
+
# Report_job uses the format:
|
286
|
+
# accounts/\\{account_id}/reportJobs/\\{report_job_id}
|
287
|
+
# @param page_size [::Integer]
|
288
|
+
# Optional. Requested page size of the report. The server may return fewer
|
289
|
+
# results than requested. If you don't specify a page size, the server uses a
|
290
|
+
# sensible default (may change over time).
|
291
|
+
#
|
292
|
+
# The maximum value is 30,000; the server will change larger values to
|
293
|
+
# 30,000.
|
294
|
+
# @param page_token [::String]
|
295
|
+
# Optional. A token that specifies a page of results beyond the first page.
|
296
|
+
# Obtained through
|
297
|
+
# {::Google::Cloud::Channel::V1::FetchReportResultsResponse#next_page_token FetchReportResultsResponse.next_page_token}
|
298
|
+
# of the previous
|
299
|
+
# {::Google::Cloud::Channel::V1::CloudChannelReportsService::Rest::Client#fetch_report_results CloudChannelReportsService.FetchReportResults}
|
300
|
+
# call.
|
301
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
302
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Channel::V1::Row>]
|
303
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
304
|
+
#
|
305
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Channel::V1::Row>]
|
306
|
+
#
|
307
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
308
|
+
def fetch_report_results request, options = nil
|
309
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
310
|
+
|
311
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::FetchReportResultsRequest
|
312
|
+
|
313
|
+
# Converts hash and nil to an options object
|
314
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
315
|
+
|
316
|
+
# Customize the options with defaults
|
317
|
+
call_metadata = @config.rpcs.fetch_report_results.metadata.to_h
|
318
|
+
|
319
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
320
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
321
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
322
|
+
gapic_version: ::Google::Cloud::Channel::V1::VERSION,
|
323
|
+
transports_version_send: [:rest]
|
324
|
+
|
325
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
326
|
+
|
327
|
+
options.apply_defaults timeout: @config.rpcs.fetch_report_results.timeout,
|
328
|
+
metadata: call_metadata,
|
329
|
+
retry_policy: @config.rpcs.fetch_report_results.retry_policy
|
330
|
+
|
331
|
+
options.apply_defaults timeout: @config.timeout,
|
332
|
+
metadata: @config.metadata,
|
333
|
+
retry_policy: @config.retry_policy
|
334
|
+
|
335
|
+
@cloud_channel_reports_service_stub.fetch_report_results request, options do |result, operation|
|
336
|
+
result = ::Gapic::Rest::PagedEnumerable.new @cloud_channel_reports_service_stub, :fetch_report_results, "rows", request, result, options
|
337
|
+
yield result, operation if block_given?
|
338
|
+
return result
|
339
|
+
end
|
340
|
+
rescue ::Gapic::Rest::Error => e
|
341
|
+
raise ::Google::Cloud::Error.from_error(e)
|
342
|
+
end
|
343
|
+
|
344
|
+
##
|
345
|
+
# Lists the reports that RunReportJob can run. These reports include an ID,
|
346
|
+
# a description, and the list of columns that will be in the result.
|
347
|
+
#
|
348
|
+
# @overload list_reports(request, options = nil)
|
349
|
+
# Pass arguments to `list_reports` via a request object, either of type
|
350
|
+
# {::Google::Cloud::Channel::V1::ListReportsRequest} or an equivalent Hash.
|
351
|
+
#
|
352
|
+
# @param request [::Google::Cloud::Channel::V1::ListReportsRequest, ::Hash]
|
353
|
+
# A request object representing the call parameters. Required. To specify no
|
354
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
355
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
356
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
357
|
+
#
|
358
|
+
# @overload list_reports(parent: nil, page_size: nil, page_token: nil, language_code: nil)
|
359
|
+
# Pass arguments to `list_reports` via keyword arguments. Note that at
|
360
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
361
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
362
|
+
#
|
363
|
+
# @param parent [::String]
|
364
|
+
# Required. The resource name of the partner account to list available
|
365
|
+
# reports for. Parent uses the format: accounts/\\{account_id}
|
366
|
+
# @param page_size [::Integer]
|
367
|
+
# Optional. Requested page size of the report. The server might return fewer
|
368
|
+
# results than requested. If unspecified, returns 20 reports. The maximum
|
369
|
+
# value is 100.
|
370
|
+
# @param page_token [::String]
|
371
|
+
# Optional. A token that specifies a page of results beyond the first page.
|
372
|
+
# Obtained through
|
373
|
+
# {::Google::Cloud::Channel::V1::ListReportsResponse#next_page_token ListReportsResponse.next_page_token}
|
374
|
+
# of the previous
|
375
|
+
# {::Google::Cloud::Channel::V1::CloudChannelReportsService::Rest::Client#list_reports CloudChannelReportsService.ListReports}
|
376
|
+
# call.
|
377
|
+
# @param language_code [::String]
|
378
|
+
# Optional. The BCP-47 language code, such as "en-US". If specified, the
|
379
|
+
# response is localized to the corresponding language code if the
|
380
|
+
# original data sources support it.
|
381
|
+
# Default is "en-US".
|
382
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
383
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Channel::V1::Report>]
|
384
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
385
|
+
#
|
386
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Channel::V1::Report>]
|
387
|
+
#
|
388
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
389
|
+
def list_reports request, options = nil
|
390
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
391
|
+
|
392
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ListReportsRequest
|
393
|
+
|
394
|
+
# Converts hash and nil to an options object
|
395
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
396
|
+
|
397
|
+
# Customize the options with defaults
|
398
|
+
call_metadata = @config.rpcs.list_reports.metadata.to_h
|
399
|
+
|
400
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
401
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
402
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
403
|
+
gapic_version: ::Google::Cloud::Channel::V1::VERSION,
|
404
|
+
transports_version_send: [:rest]
|
405
|
+
|
406
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
407
|
+
|
408
|
+
options.apply_defaults timeout: @config.rpcs.list_reports.timeout,
|
409
|
+
metadata: call_metadata,
|
410
|
+
retry_policy: @config.rpcs.list_reports.retry_policy
|
411
|
+
|
412
|
+
options.apply_defaults timeout: @config.timeout,
|
413
|
+
metadata: @config.metadata,
|
414
|
+
retry_policy: @config.retry_policy
|
415
|
+
|
416
|
+
@cloud_channel_reports_service_stub.list_reports request, options do |result, operation|
|
417
|
+
result = ::Gapic::Rest::PagedEnumerable.new @cloud_channel_reports_service_stub, :list_reports, "reports", request, result, options
|
418
|
+
yield result, operation if block_given?
|
419
|
+
return result
|
420
|
+
end
|
421
|
+
rescue ::Gapic::Rest::Error => e
|
422
|
+
raise ::Google::Cloud::Error.from_error(e)
|
423
|
+
end
|
424
|
+
|
425
|
+
##
|
426
|
+
# Configuration class for the CloudChannelReportsService REST API.
|
427
|
+
#
|
428
|
+
# This class represents the configuration for CloudChannelReportsService REST,
|
429
|
+
# providing control over timeouts, retry behavior, logging, transport
|
430
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
431
|
+
# applied individually to specific RPCs. See
|
432
|
+
# {::Google::Cloud::Channel::V1::CloudChannelReportsService::Rest::Client::Configuration::Rpcs}
|
433
|
+
# for a list of RPCs that can be configured independently.
|
434
|
+
#
|
435
|
+
# Configuration can be applied globally to all clients, or to a single client
|
436
|
+
# on construction.
|
437
|
+
#
|
438
|
+
# @example
|
439
|
+
#
|
440
|
+
# # Modify the global config, setting the timeout for
|
441
|
+
# # run_report_job to 20 seconds,
|
442
|
+
# # and all remaining timeouts to 10 seconds.
|
443
|
+
# ::Google::Cloud::Channel::V1::CloudChannelReportsService::Rest::Client.configure do |config|
|
444
|
+
# config.timeout = 10.0
|
445
|
+
# config.rpcs.run_report_job.timeout = 20.0
|
446
|
+
# end
|
447
|
+
#
|
448
|
+
# # Apply the above configuration only to a new client.
|
449
|
+
# client = ::Google::Cloud::Channel::V1::CloudChannelReportsService::Rest::Client.new do |config|
|
450
|
+
# config.timeout = 10.0
|
451
|
+
# config.rpcs.run_report_job.timeout = 20.0
|
452
|
+
# end
|
453
|
+
#
|
454
|
+
# @!attribute [rw] endpoint
|
455
|
+
# The hostname or hostname:port of the service endpoint.
|
456
|
+
# Defaults to `"cloudchannel.googleapis.com"`.
|
457
|
+
# @return [::String]
|
458
|
+
# @!attribute [rw] credentials
|
459
|
+
# Credentials to send with calls. You may provide any of the following types:
|
460
|
+
# * (`String`) The path to a service account key file in JSON format
|
461
|
+
# * (`Hash`) A service account key as a Hash
|
462
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
463
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
464
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
465
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
466
|
+
# * (`nil`) indicating no credentials
|
467
|
+
# @return [::Object]
|
468
|
+
# @!attribute [rw] scope
|
469
|
+
# The OAuth scopes
|
470
|
+
# @return [::Array<::String>]
|
471
|
+
# @!attribute [rw] lib_name
|
472
|
+
# The library name as recorded in instrumentation and logging
|
473
|
+
# @return [::String]
|
474
|
+
# @!attribute [rw] lib_version
|
475
|
+
# The library version as recorded in instrumentation and logging
|
476
|
+
# @return [::String]
|
477
|
+
# @!attribute [rw] timeout
|
478
|
+
# The call timeout in seconds.
|
479
|
+
# @return [::Numeric]
|
480
|
+
# @!attribute [rw] metadata
|
481
|
+
# Additional headers to be sent with the call.
|
482
|
+
# @return [::Hash{::Symbol=>::String}]
|
483
|
+
# @!attribute [rw] retry_policy
|
484
|
+
# The retry policy. The value is a hash with the following keys:
|
485
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
486
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
487
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
488
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
489
|
+
# trigger a retry.
|
490
|
+
# @return [::Hash]
|
491
|
+
# @!attribute [rw] quota_project
|
492
|
+
# A separate project against which to charge quota.
|
493
|
+
# @return [::String]
|
494
|
+
#
|
495
|
+
class Configuration
|
496
|
+
extend ::Gapic::Config
|
497
|
+
|
498
|
+
config_attr :endpoint, "cloudchannel.googleapis.com", ::String
|
499
|
+
config_attr :credentials, nil do |value|
|
500
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
501
|
+
allowed.any? { |klass| klass === value }
|
502
|
+
end
|
503
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
504
|
+
config_attr :lib_name, nil, ::String, nil
|
505
|
+
config_attr :lib_version, nil, ::String, nil
|
506
|
+
config_attr :timeout, nil, ::Numeric, nil
|
507
|
+
config_attr :metadata, nil, ::Hash, nil
|
508
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
509
|
+
config_attr :quota_project, nil, ::String, nil
|
510
|
+
|
511
|
+
# @private
|
512
|
+
def initialize parent_config = nil
|
513
|
+
@parent_config = parent_config unless parent_config.nil?
|
514
|
+
|
515
|
+
yield self if block_given?
|
516
|
+
end
|
517
|
+
|
518
|
+
##
|
519
|
+
# Configurations for individual RPCs
|
520
|
+
# @return [Rpcs]
|
521
|
+
#
|
522
|
+
def rpcs
|
523
|
+
@rpcs ||= begin
|
524
|
+
parent_rpcs = nil
|
525
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
526
|
+
Rpcs.new parent_rpcs
|
527
|
+
end
|
528
|
+
end
|
529
|
+
|
530
|
+
##
|
531
|
+
# Configuration RPC class for the CloudChannelReportsService API.
|
532
|
+
#
|
533
|
+
# Includes fields providing the configuration for each RPC in this service.
|
534
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
535
|
+
# the following configuration fields:
|
536
|
+
#
|
537
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
538
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
|
539
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
540
|
+
# include the following keys:
|
541
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
542
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
543
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
544
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
545
|
+
# trigger a retry.
|
546
|
+
#
|
547
|
+
class Rpcs
|
548
|
+
##
|
549
|
+
# RPC-specific configuration for `run_report_job`
|
550
|
+
# @return [::Gapic::Config::Method]
|
551
|
+
#
|
552
|
+
attr_reader :run_report_job
|
553
|
+
##
|
554
|
+
# RPC-specific configuration for `fetch_report_results`
|
555
|
+
# @return [::Gapic::Config::Method]
|
556
|
+
#
|
557
|
+
attr_reader :fetch_report_results
|
558
|
+
##
|
559
|
+
# RPC-specific configuration for `list_reports`
|
560
|
+
# @return [::Gapic::Config::Method]
|
561
|
+
#
|
562
|
+
attr_reader :list_reports
|
563
|
+
|
564
|
+
# @private
|
565
|
+
def initialize parent_rpcs = nil
|
566
|
+
run_report_job_config = parent_rpcs.run_report_job if parent_rpcs.respond_to? :run_report_job
|
567
|
+
@run_report_job = ::Gapic::Config::Method.new run_report_job_config
|
568
|
+
fetch_report_results_config = parent_rpcs.fetch_report_results if parent_rpcs.respond_to? :fetch_report_results
|
569
|
+
@fetch_report_results = ::Gapic::Config::Method.new fetch_report_results_config
|
570
|
+
list_reports_config = parent_rpcs.list_reports if parent_rpcs.respond_to? :list_reports
|
571
|
+
@list_reports = ::Gapic::Config::Method.new list_reports_config
|
572
|
+
|
573
|
+
yield self if block_given?
|
574
|
+
end
|
575
|
+
end
|
576
|
+
end
|
577
|
+
end
|
578
|
+
end
|
579
|
+
end
|
580
|
+
end
|
581
|
+
end
|
582
|
+
end
|
583
|
+
end
|