google-apps-events-subscriptions-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.
- checksums.yaml +4 -4
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +122 -0
- data/README.md +144 -8
- data/lib/google/apps/events/subscriptions/v1/rest.rb +39 -0
- data/lib/google/apps/events/subscriptions/v1/subscription_resource_pb.rb +57 -0
- data/lib/google/apps/events/subscriptions/v1/subscriptions_service/client.rb +1029 -0
- data/lib/google/apps/events/subscriptions/v1/subscriptions_service/credentials.rb +59 -0
- data/lib/google/apps/events/subscriptions/v1/subscriptions_service/operations.rb +803 -0
- data/lib/google/apps/events/subscriptions/v1/subscriptions_service/paths.rb +80 -0
- data/lib/google/apps/events/subscriptions/v1/subscriptions_service/rest/client.rb +977 -0
- data/lib/google/apps/events/subscriptions/v1/subscriptions_service/rest/operations.rb +897 -0
- data/lib/google/apps/events/subscriptions/v1/subscriptions_service/rest/service_stub.rb +424 -0
- data/lib/google/apps/events/subscriptions/v1/subscriptions_service/rest.rb +55 -0
- data/lib/google/apps/events/subscriptions/v1/subscriptions_service.rb +58 -0
- data/lib/google/apps/events/subscriptions/v1/subscriptions_service_pb.rb +65 -0
- data/lib/google/apps/events/subscriptions/v1/subscriptions_service_services_pb.rb +73 -0
- data/lib/google/apps/events/subscriptions/v1/version.rb +7 -2
- data/lib/google/apps/events/subscriptions/v1.rb +47 -0
- data/lib/google-apps-events-subscriptions-v1.rb +21 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/client.rb +399 -0
- data/proto_docs/google/api/field_behavior.rb +85 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/api/resource.rb +222 -0
- data/proto_docs/google/apps/events/subscriptions/v1/subscription_resource.rb +224 -0
- data/proto_docs/google/apps/events/subscriptions/v1/subscriptions_service.rb +211 -0
- data/proto_docs/google/longrunning/operations.rb +164 -0
- data/proto_docs/google/protobuf/any.rb +145 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/empty.rb +34 -0
- data/proto_docs/google/protobuf/field_mask.rb +229 -0
- data/proto_docs/google/protobuf/timestamp.rb +127 -0
- data/proto_docs/google/rpc/status.rb +48 -0
- metadata +77 -11
@@ -0,0 +1,977 @@
|
|
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/apps/events/subscriptions/v1/subscriptions_service_pb"
|
21
|
+
require "google/apps/events/subscriptions/v1/subscriptions_service/rest/service_stub"
|
22
|
+
|
23
|
+
module Google
|
24
|
+
module Apps
|
25
|
+
module Events
|
26
|
+
module Subscriptions
|
27
|
+
module V1
|
28
|
+
module SubscriptionsService
|
29
|
+
module Rest
|
30
|
+
##
|
31
|
+
# REST client for the SubscriptionsService service.
|
32
|
+
#
|
33
|
+
# A service that manages subscriptions to Google Workspace events.
|
34
|
+
#
|
35
|
+
class Client
|
36
|
+
# @private
|
37
|
+
DEFAULT_ENDPOINT_TEMPLATE = "workspaceevents.$UNIVERSE_DOMAIN$"
|
38
|
+
|
39
|
+
include Paths
|
40
|
+
|
41
|
+
# @private
|
42
|
+
attr_reader :subscriptions_service_stub
|
43
|
+
|
44
|
+
##
|
45
|
+
# Configure the SubscriptionsService Client class.
|
46
|
+
#
|
47
|
+
# See {::Google::Apps::Events::Subscriptions::V1::SubscriptionsService::Rest::Client::Configuration}
|
48
|
+
# for a description of the configuration fields.
|
49
|
+
#
|
50
|
+
# @example
|
51
|
+
#
|
52
|
+
# # Modify the configuration for all SubscriptionsService clients
|
53
|
+
# ::Google::Apps::Events::Subscriptions::V1::SubscriptionsService::Rest::Client.configure do |config|
|
54
|
+
# config.timeout = 10.0
|
55
|
+
# end
|
56
|
+
#
|
57
|
+
# @yield [config] Configure the Client client.
|
58
|
+
# @yieldparam config [Client::Configuration]
|
59
|
+
#
|
60
|
+
# @return [Client::Configuration]
|
61
|
+
#
|
62
|
+
def self.configure
|
63
|
+
@configure ||= begin
|
64
|
+
namespace = ["Google", "Apps", "Events", "Subscriptions", "V1"]
|
65
|
+
parent_config = while namespace.any?
|
66
|
+
parent_name = namespace.join "::"
|
67
|
+
parent_const = const_get parent_name
|
68
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
69
|
+
namespace.pop
|
70
|
+
end
|
71
|
+
default_config = Client::Configuration.new parent_config
|
72
|
+
|
73
|
+
default_config.rpcs.create_subscription.timeout = 60.0
|
74
|
+
|
75
|
+
default_config.rpcs.delete_subscription.timeout = 60.0
|
76
|
+
|
77
|
+
default_config.rpcs.get_subscription.timeout = 60.0
|
78
|
+
default_config.rpcs.get_subscription.retry_policy = {
|
79
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
80
|
+
}
|
81
|
+
|
82
|
+
default_config.rpcs.list_subscriptions.timeout = 60.0
|
83
|
+
default_config.rpcs.list_subscriptions.retry_policy = {
|
84
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
85
|
+
}
|
86
|
+
|
87
|
+
default_config.rpcs.update_subscription.timeout = 60.0
|
88
|
+
|
89
|
+
default_config.rpcs.reactivate_subscription.timeout = 60.0
|
90
|
+
|
91
|
+
default_config
|
92
|
+
end
|
93
|
+
yield @configure if block_given?
|
94
|
+
@configure
|
95
|
+
end
|
96
|
+
|
97
|
+
##
|
98
|
+
# Configure the SubscriptionsService Client instance.
|
99
|
+
#
|
100
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
101
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
102
|
+
# should be made on {Client.configure}.
|
103
|
+
#
|
104
|
+
# See {::Google::Apps::Events::Subscriptions::V1::SubscriptionsService::Rest::Client::Configuration}
|
105
|
+
# for a description of the configuration fields.
|
106
|
+
#
|
107
|
+
# @yield [config] Configure the Client client.
|
108
|
+
# @yieldparam config [Client::Configuration]
|
109
|
+
#
|
110
|
+
# @return [Client::Configuration]
|
111
|
+
#
|
112
|
+
def configure
|
113
|
+
yield @config if block_given?
|
114
|
+
@config
|
115
|
+
end
|
116
|
+
|
117
|
+
##
|
118
|
+
# The effective universe domain
|
119
|
+
#
|
120
|
+
# @return [String]
|
121
|
+
#
|
122
|
+
def universe_domain
|
123
|
+
@subscriptions_service_stub.universe_domain
|
124
|
+
end
|
125
|
+
|
126
|
+
##
|
127
|
+
# Create a new SubscriptionsService REST client object.
|
128
|
+
#
|
129
|
+
# @example
|
130
|
+
#
|
131
|
+
# # Create a client using the default configuration
|
132
|
+
# client = ::Google::Apps::Events::Subscriptions::V1::SubscriptionsService::Rest::Client.new
|
133
|
+
#
|
134
|
+
# # Create a client using a custom configuration
|
135
|
+
# client = ::Google::Apps::Events::Subscriptions::V1::SubscriptionsService::Rest::Client.new do |config|
|
136
|
+
# config.timeout = 10.0
|
137
|
+
# end
|
138
|
+
#
|
139
|
+
# @yield [config] Configure the SubscriptionsService client.
|
140
|
+
# @yieldparam config [Client::Configuration]
|
141
|
+
#
|
142
|
+
def initialize
|
143
|
+
# Create the configuration object
|
144
|
+
@config = Configuration.new Client.configure
|
145
|
+
|
146
|
+
# Yield the configuration if needed
|
147
|
+
yield @config if block_given?
|
148
|
+
|
149
|
+
# Create credentials
|
150
|
+
credentials = @config.credentials
|
151
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
152
|
+
# but only if the default endpoint does not have a region prefix.
|
153
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
154
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
155
|
+
!@config.endpoint.split(".").first.include?("-"))
|
156
|
+
credentials ||= Credentials.default scope: @config.scope,
|
157
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
158
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
159
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
160
|
+
end
|
161
|
+
|
162
|
+
@quota_project_id = @config.quota_project
|
163
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
164
|
+
|
165
|
+
@operations_client = ::Google::Apps::Events::Subscriptions::V1::SubscriptionsService::Rest::Operations.new do |config|
|
166
|
+
config.credentials = credentials
|
167
|
+
config.quota_project = @quota_project_id
|
168
|
+
config.endpoint = @config.endpoint
|
169
|
+
config.universe_domain = @config.universe_domain
|
170
|
+
end
|
171
|
+
|
172
|
+
@subscriptions_service_stub = ::Google::Apps::Events::Subscriptions::V1::SubscriptionsService::Rest::ServiceStub.new(
|
173
|
+
endpoint: @config.endpoint,
|
174
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
175
|
+
universe_domain: @config.universe_domain,
|
176
|
+
credentials: credentials
|
177
|
+
)
|
178
|
+
end
|
179
|
+
|
180
|
+
##
|
181
|
+
# Get the associated client for long-running operations.
|
182
|
+
#
|
183
|
+
# @return [::Google::Apps::Events::Subscriptions::V1::SubscriptionsService::Rest::Operations]
|
184
|
+
#
|
185
|
+
attr_reader :operations_client
|
186
|
+
|
187
|
+
# Service calls
|
188
|
+
|
189
|
+
##
|
190
|
+
# Creates a Google Workspace subscription. To learn how to use this
|
191
|
+
# method, see [Create a Google Workspace
|
192
|
+
# subscription](https://developers.google.com/workspace/events/guides/create-subscription).
|
193
|
+
#
|
194
|
+
# @overload create_subscription(request, options = nil)
|
195
|
+
# Pass arguments to `create_subscription` via a request object, either of type
|
196
|
+
# {::Google::Apps::Events::Subscriptions::V1::CreateSubscriptionRequest} or an equivalent Hash.
|
197
|
+
#
|
198
|
+
# @param request [::Google::Apps::Events::Subscriptions::V1::CreateSubscriptionRequest, ::Hash]
|
199
|
+
# A request object representing the call parameters. Required. To specify no
|
200
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
201
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
202
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
203
|
+
#
|
204
|
+
# @overload create_subscription(subscription: nil, validate_only: nil)
|
205
|
+
# Pass arguments to `create_subscription` via keyword arguments. Note that at
|
206
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
207
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
208
|
+
#
|
209
|
+
# @param subscription [::Google::Apps::Events::Subscriptions::V1::Subscription, ::Hash]
|
210
|
+
# Required. The subscription resource to create.
|
211
|
+
# @param validate_only [::Boolean]
|
212
|
+
# Optional. If set to `true`, validates and previews the request, but doesn't
|
213
|
+
# create the subscription.
|
214
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
215
|
+
# @yieldparam result [::Gapic::Operation]
|
216
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
217
|
+
#
|
218
|
+
# @return [::Gapic::Operation]
|
219
|
+
#
|
220
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
221
|
+
#
|
222
|
+
# @example Basic example
|
223
|
+
# require "google/apps/events/subscriptions/v1"
|
224
|
+
#
|
225
|
+
# # Create a client object. The client can be reused for multiple calls.
|
226
|
+
# client = Google::Apps::Events::Subscriptions::V1::SubscriptionsService::Rest::Client.new
|
227
|
+
#
|
228
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
229
|
+
# request = Google::Apps::Events::Subscriptions::V1::CreateSubscriptionRequest.new
|
230
|
+
#
|
231
|
+
# # Call the create_subscription method.
|
232
|
+
# result = client.create_subscription request
|
233
|
+
#
|
234
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
235
|
+
# # check the status of an operation, cancel it, or wait for results.
|
236
|
+
# # Here is how to wait for a response.
|
237
|
+
# result.wait_until_done! timeout: 60
|
238
|
+
# if result.response?
|
239
|
+
# p result.response
|
240
|
+
# else
|
241
|
+
# puts "No response received."
|
242
|
+
# end
|
243
|
+
#
|
244
|
+
def create_subscription request, options = nil
|
245
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
246
|
+
|
247
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Events::Subscriptions::V1::CreateSubscriptionRequest
|
248
|
+
|
249
|
+
# Converts hash and nil to an options object
|
250
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
251
|
+
|
252
|
+
# Customize the options with defaults
|
253
|
+
call_metadata = @config.rpcs.create_subscription.metadata.to_h
|
254
|
+
|
255
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
256
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
257
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
258
|
+
gapic_version: ::Google::Apps::Events::Subscriptions::V1::VERSION,
|
259
|
+
transports_version_send: [:rest]
|
260
|
+
|
261
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
262
|
+
|
263
|
+
options.apply_defaults timeout: @config.rpcs.create_subscription.timeout,
|
264
|
+
metadata: call_metadata,
|
265
|
+
retry_policy: @config.rpcs.create_subscription.retry_policy
|
266
|
+
|
267
|
+
options.apply_defaults timeout: @config.timeout,
|
268
|
+
metadata: @config.metadata,
|
269
|
+
retry_policy: @config.retry_policy
|
270
|
+
|
271
|
+
@subscriptions_service_stub.create_subscription request, options do |result, operation|
|
272
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
273
|
+
yield result, operation if block_given?
|
274
|
+
return result
|
275
|
+
end
|
276
|
+
rescue ::Gapic::Rest::Error => e
|
277
|
+
raise ::Google::Cloud::Error.from_error(e)
|
278
|
+
end
|
279
|
+
|
280
|
+
##
|
281
|
+
# Deletes a Google Workspace subscription.
|
282
|
+
# To learn how to use this method, see [Delete a Google Workspace
|
283
|
+
# subscription](https://developers.google.com/workspace/events/guides/delete-subscription).
|
284
|
+
#
|
285
|
+
# @overload delete_subscription(request, options = nil)
|
286
|
+
# Pass arguments to `delete_subscription` via a request object, either of type
|
287
|
+
# {::Google::Apps::Events::Subscriptions::V1::DeleteSubscriptionRequest} or an equivalent Hash.
|
288
|
+
#
|
289
|
+
# @param request [::Google::Apps::Events::Subscriptions::V1::DeleteSubscriptionRequest, ::Hash]
|
290
|
+
# A request object representing the call parameters. Required. To specify no
|
291
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
292
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
293
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
294
|
+
#
|
295
|
+
# @overload delete_subscription(name: nil, validate_only: nil, allow_missing: nil, etag: nil)
|
296
|
+
# Pass arguments to `delete_subscription` via keyword arguments. Note that at
|
297
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
298
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
299
|
+
#
|
300
|
+
# @param name [::String]
|
301
|
+
# Required. Resource name of the subscription to delete.
|
302
|
+
#
|
303
|
+
# Format: `subscriptions/{subscription}`
|
304
|
+
# @param validate_only [::Boolean]
|
305
|
+
# Optional. If set to `true`, validates and previews the request, but doesn't
|
306
|
+
# delete the subscription.
|
307
|
+
# @param allow_missing [::Boolean]
|
308
|
+
# Optional. If set to `true` and the subscription isn't found, the request
|
309
|
+
# succeeds but doesn't delete the subscription.
|
310
|
+
# @param etag [::String]
|
311
|
+
# Optional. Etag of the subscription.
|
312
|
+
#
|
313
|
+
# If present, it must match with the server's etag. Otherwise, request
|
314
|
+
# fails with the status `ABORTED`.
|
315
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
316
|
+
# @yieldparam result [::Gapic::Operation]
|
317
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
318
|
+
#
|
319
|
+
# @return [::Gapic::Operation]
|
320
|
+
#
|
321
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
322
|
+
#
|
323
|
+
# @example Basic example
|
324
|
+
# require "google/apps/events/subscriptions/v1"
|
325
|
+
#
|
326
|
+
# # Create a client object. The client can be reused for multiple calls.
|
327
|
+
# client = Google::Apps::Events::Subscriptions::V1::SubscriptionsService::Rest::Client.new
|
328
|
+
#
|
329
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
330
|
+
# request = Google::Apps::Events::Subscriptions::V1::DeleteSubscriptionRequest.new
|
331
|
+
#
|
332
|
+
# # Call the delete_subscription method.
|
333
|
+
# result = client.delete_subscription request
|
334
|
+
#
|
335
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
336
|
+
# # check the status of an operation, cancel it, or wait for results.
|
337
|
+
# # Here is how to wait for a response.
|
338
|
+
# result.wait_until_done! timeout: 60
|
339
|
+
# if result.response?
|
340
|
+
# p result.response
|
341
|
+
# else
|
342
|
+
# puts "No response received."
|
343
|
+
# end
|
344
|
+
#
|
345
|
+
def delete_subscription request, options = nil
|
346
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
347
|
+
|
348
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Events::Subscriptions::V1::DeleteSubscriptionRequest
|
349
|
+
|
350
|
+
# Converts hash and nil to an options object
|
351
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
352
|
+
|
353
|
+
# Customize the options with defaults
|
354
|
+
call_metadata = @config.rpcs.delete_subscription.metadata.to_h
|
355
|
+
|
356
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
357
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
358
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
359
|
+
gapic_version: ::Google::Apps::Events::Subscriptions::V1::VERSION,
|
360
|
+
transports_version_send: [:rest]
|
361
|
+
|
362
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
363
|
+
|
364
|
+
options.apply_defaults timeout: @config.rpcs.delete_subscription.timeout,
|
365
|
+
metadata: call_metadata,
|
366
|
+
retry_policy: @config.rpcs.delete_subscription.retry_policy
|
367
|
+
|
368
|
+
options.apply_defaults timeout: @config.timeout,
|
369
|
+
metadata: @config.metadata,
|
370
|
+
retry_policy: @config.retry_policy
|
371
|
+
|
372
|
+
@subscriptions_service_stub.delete_subscription request, options do |result, operation|
|
373
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
374
|
+
yield result, operation if block_given?
|
375
|
+
return result
|
376
|
+
end
|
377
|
+
rescue ::Gapic::Rest::Error => e
|
378
|
+
raise ::Google::Cloud::Error.from_error(e)
|
379
|
+
end
|
380
|
+
|
381
|
+
##
|
382
|
+
# Gets details about a Google Workspace subscription. To learn how to use
|
383
|
+
# this method, see [Get details about a Google Workspace
|
384
|
+
# subscription](https://developers.google.com/workspace/events/guides/get-subscription).
|
385
|
+
#
|
386
|
+
# @overload get_subscription(request, options = nil)
|
387
|
+
# Pass arguments to `get_subscription` via a request object, either of type
|
388
|
+
# {::Google::Apps::Events::Subscriptions::V1::GetSubscriptionRequest} or an equivalent Hash.
|
389
|
+
#
|
390
|
+
# @param request [::Google::Apps::Events::Subscriptions::V1::GetSubscriptionRequest, ::Hash]
|
391
|
+
# A request object representing the call parameters. Required. To specify no
|
392
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
393
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
394
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
395
|
+
#
|
396
|
+
# @overload get_subscription(name: nil)
|
397
|
+
# Pass arguments to `get_subscription` via keyword arguments. Note that at
|
398
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
399
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
400
|
+
#
|
401
|
+
# @param name [::String]
|
402
|
+
# Required. Resource name of the subscription.
|
403
|
+
#
|
404
|
+
# Format: `subscriptions/{subscription}`
|
405
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
406
|
+
# @yieldparam result [::Google::Apps::Events::Subscriptions::V1::Subscription]
|
407
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
408
|
+
#
|
409
|
+
# @return [::Google::Apps::Events::Subscriptions::V1::Subscription]
|
410
|
+
#
|
411
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
412
|
+
#
|
413
|
+
# @example Basic example
|
414
|
+
# require "google/apps/events/subscriptions/v1"
|
415
|
+
#
|
416
|
+
# # Create a client object. The client can be reused for multiple calls.
|
417
|
+
# client = Google::Apps::Events::Subscriptions::V1::SubscriptionsService::Rest::Client.new
|
418
|
+
#
|
419
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
420
|
+
# request = Google::Apps::Events::Subscriptions::V1::GetSubscriptionRequest.new
|
421
|
+
#
|
422
|
+
# # Call the get_subscription method.
|
423
|
+
# result = client.get_subscription request
|
424
|
+
#
|
425
|
+
# # The returned object is of type Google::Apps::Events::Subscriptions::V1::Subscription.
|
426
|
+
# p result
|
427
|
+
#
|
428
|
+
def get_subscription request, options = nil
|
429
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
430
|
+
|
431
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Events::Subscriptions::V1::GetSubscriptionRequest
|
432
|
+
|
433
|
+
# Converts hash and nil to an options object
|
434
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
435
|
+
|
436
|
+
# Customize the options with defaults
|
437
|
+
call_metadata = @config.rpcs.get_subscription.metadata.to_h
|
438
|
+
|
439
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
440
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
441
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
442
|
+
gapic_version: ::Google::Apps::Events::Subscriptions::V1::VERSION,
|
443
|
+
transports_version_send: [:rest]
|
444
|
+
|
445
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
446
|
+
|
447
|
+
options.apply_defaults timeout: @config.rpcs.get_subscription.timeout,
|
448
|
+
metadata: call_metadata,
|
449
|
+
retry_policy: @config.rpcs.get_subscription.retry_policy
|
450
|
+
|
451
|
+
options.apply_defaults timeout: @config.timeout,
|
452
|
+
metadata: @config.metadata,
|
453
|
+
retry_policy: @config.retry_policy
|
454
|
+
|
455
|
+
@subscriptions_service_stub.get_subscription request, options do |result, operation|
|
456
|
+
yield result, operation if block_given?
|
457
|
+
return result
|
458
|
+
end
|
459
|
+
rescue ::Gapic::Rest::Error => e
|
460
|
+
raise ::Google::Cloud::Error.from_error(e)
|
461
|
+
end
|
462
|
+
|
463
|
+
##
|
464
|
+
# Lists Google Workspace subscriptions. To learn how to use this method, see
|
465
|
+
# [List Google Workspace
|
466
|
+
# subscriptions](https://developers.google.com/workspace/events/guides/list-subscriptions).
|
467
|
+
#
|
468
|
+
# @overload list_subscriptions(request, options = nil)
|
469
|
+
# Pass arguments to `list_subscriptions` via a request object, either of type
|
470
|
+
# {::Google::Apps::Events::Subscriptions::V1::ListSubscriptionsRequest} or an equivalent Hash.
|
471
|
+
#
|
472
|
+
# @param request [::Google::Apps::Events::Subscriptions::V1::ListSubscriptionsRequest, ::Hash]
|
473
|
+
# A request object representing the call parameters. Required. To specify no
|
474
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
475
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
476
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
477
|
+
#
|
478
|
+
# @overload list_subscriptions(page_size: nil, page_token: nil, filter: nil)
|
479
|
+
# Pass arguments to `list_subscriptions` via keyword arguments. Note that at
|
480
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
481
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
482
|
+
#
|
483
|
+
# @param page_size [::Integer]
|
484
|
+
# Optional. The maximum number of subscriptions to return. The service might
|
485
|
+
# return fewer than this value.
|
486
|
+
#
|
487
|
+
# If unspecified or set to `0`, up to 50 subscriptions are returned.
|
488
|
+
#
|
489
|
+
# The maximum value is 100. If you specify a value more than 100, the system
|
490
|
+
# only returns 100 subscriptions.
|
491
|
+
# @param page_token [::String]
|
492
|
+
# Optional. A page token, received from a previous list subscriptions call.
|
493
|
+
# Provide this parameter to retrieve the subsequent page.
|
494
|
+
#
|
495
|
+
# When paginating, the filter value should match the call that provided the
|
496
|
+
# page token. Passing a different value might lead to unexpected results.
|
497
|
+
# @param filter [::String]
|
498
|
+
# Required. A query filter.
|
499
|
+
#
|
500
|
+
# You can filter subscriptions by event type (`event_types`)
|
501
|
+
# and target resource (`target_resource`).
|
502
|
+
#
|
503
|
+
# You must specify at least one event type in your query. To filter for
|
504
|
+
# multiple event types, use the `OR` operator.
|
505
|
+
#
|
506
|
+
# To filter by both event type and target resource, use the `AND` operator
|
507
|
+
# and specify the full resource name, such as
|
508
|
+
# `//chat.googleapis.com/spaces/{space}`.
|
509
|
+
#
|
510
|
+
# For example, the following queries are valid:
|
511
|
+
#
|
512
|
+
# ```
|
513
|
+
# event_types:"google.workspace.chat.membership.v1.updated" OR
|
514
|
+
# event_types:"google.workspace.chat.message.v1.created"
|
515
|
+
#
|
516
|
+
# event_types:"google.workspace.chat.message.v1.created" AND
|
517
|
+
# target_resource="//chat.googleapis.com/spaces/\\{space}"
|
518
|
+
#
|
519
|
+
# ( event_types:"google.workspace.chat.membership.v1.updated" OR
|
520
|
+
# event_types:"google.workspace.chat.message.v1.created" ) AND
|
521
|
+
# target_resource="//chat.googleapis.com/spaces/\\{space}"
|
522
|
+
# ```
|
523
|
+
#
|
524
|
+
# The server rejects invalid queries with an `INVALID_ARGUMENT`
|
525
|
+
# error.
|
526
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
527
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Apps::Events::Subscriptions::V1::Subscription>]
|
528
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
529
|
+
#
|
530
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Apps::Events::Subscriptions::V1::Subscription>]
|
531
|
+
#
|
532
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
533
|
+
#
|
534
|
+
# @example Basic example
|
535
|
+
# require "google/apps/events/subscriptions/v1"
|
536
|
+
#
|
537
|
+
# # Create a client object. The client can be reused for multiple calls.
|
538
|
+
# client = Google::Apps::Events::Subscriptions::V1::SubscriptionsService::Rest::Client.new
|
539
|
+
#
|
540
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
541
|
+
# request = Google::Apps::Events::Subscriptions::V1::ListSubscriptionsRequest.new
|
542
|
+
#
|
543
|
+
# # Call the list_subscriptions method.
|
544
|
+
# result = client.list_subscriptions request
|
545
|
+
#
|
546
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
547
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
548
|
+
# result.each do |item|
|
549
|
+
# # Each element is of type ::Google::Apps::Events::Subscriptions::V1::Subscription.
|
550
|
+
# p item
|
551
|
+
# end
|
552
|
+
#
|
553
|
+
def list_subscriptions request, options = nil
|
554
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
555
|
+
|
556
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Events::Subscriptions::V1::ListSubscriptionsRequest
|
557
|
+
|
558
|
+
# Converts hash and nil to an options object
|
559
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
560
|
+
|
561
|
+
# Customize the options with defaults
|
562
|
+
call_metadata = @config.rpcs.list_subscriptions.metadata.to_h
|
563
|
+
|
564
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
565
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
566
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
567
|
+
gapic_version: ::Google::Apps::Events::Subscriptions::V1::VERSION,
|
568
|
+
transports_version_send: [:rest]
|
569
|
+
|
570
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
571
|
+
|
572
|
+
options.apply_defaults timeout: @config.rpcs.list_subscriptions.timeout,
|
573
|
+
metadata: call_metadata,
|
574
|
+
retry_policy: @config.rpcs.list_subscriptions.retry_policy
|
575
|
+
|
576
|
+
options.apply_defaults timeout: @config.timeout,
|
577
|
+
metadata: @config.metadata,
|
578
|
+
retry_policy: @config.retry_policy
|
579
|
+
|
580
|
+
@subscriptions_service_stub.list_subscriptions request, options do |result, operation|
|
581
|
+
result = ::Gapic::Rest::PagedEnumerable.new @subscriptions_service_stub, :list_subscriptions, "subscriptions", request, result, options
|
582
|
+
yield result, operation if block_given?
|
583
|
+
return result
|
584
|
+
end
|
585
|
+
rescue ::Gapic::Rest::Error => e
|
586
|
+
raise ::Google::Cloud::Error.from_error(e)
|
587
|
+
end
|
588
|
+
|
589
|
+
##
|
590
|
+
# Updates or renews a Google Workspace subscription. To learn how to use this
|
591
|
+
# method, see [Update or renew a Google Workspace
|
592
|
+
# subscription](https://developers.google.com/workspace/events/guides/update-subscription).
|
593
|
+
#
|
594
|
+
# @overload update_subscription(request, options = nil)
|
595
|
+
# Pass arguments to `update_subscription` via a request object, either of type
|
596
|
+
# {::Google::Apps::Events::Subscriptions::V1::UpdateSubscriptionRequest} or an equivalent Hash.
|
597
|
+
#
|
598
|
+
# @param request [::Google::Apps::Events::Subscriptions::V1::UpdateSubscriptionRequest, ::Hash]
|
599
|
+
# A request object representing the call parameters. Required. To specify no
|
600
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
601
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
602
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
603
|
+
#
|
604
|
+
# @overload update_subscription(subscription: nil, update_mask: nil, validate_only: nil)
|
605
|
+
# Pass arguments to `update_subscription` via keyword arguments. Note that at
|
606
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
607
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
608
|
+
#
|
609
|
+
# @param subscription [::Google::Apps::Events::Subscriptions::V1::Subscription, ::Hash]
|
610
|
+
# Required. The subscription to update.
|
611
|
+
#
|
612
|
+
# The subscription's `name` field is used to identify the subscription to
|
613
|
+
# update.
|
614
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
615
|
+
# Optional. Required. The field to update.
|
616
|
+
#
|
617
|
+
# You can update one of the following fields in a subscription:
|
618
|
+
#
|
619
|
+
# * {::Google::Apps::Events::Subscriptions::V1::Subscription#expire_time `expire_time`}: The timestamp when the
|
620
|
+
# subscription expires.
|
621
|
+
# * {::Google::Apps::Events::Subscriptions::V1::Subscription#ttl `ttl`}: The
|
622
|
+
# time-to-live (TTL) or duration of the
|
623
|
+
# subscription.
|
624
|
+
# @param validate_only [::Boolean]
|
625
|
+
# Optional. If set to `true`, validates and previews the request, but doesn't
|
626
|
+
# update the subscription.
|
627
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
628
|
+
# @yieldparam result [::Gapic::Operation]
|
629
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
630
|
+
#
|
631
|
+
# @return [::Gapic::Operation]
|
632
|
+
#
|
633
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
634
|
+
#
|
635
|
+
# @example Basic example
|
636
|
+
# require "google/apps/events/subscriptions/v1"
|
637
|
+
#
|
638
|
+
# # Create a client object. The client can be reused for multiple calls.
|
639
|
+
# client = Google::Apps::Events::Subscriptions::V1::SubscriptionsService::Rest::Client.new
|
640
|
+
#
|
641
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
642
|
+
# request = Google::Apps::Events::Subscriptions::V1::UpdateSubscriptionRequest.new
|
643
|
+
#
|
644
|
+
# # Call the update_subscription method.
|
645
|
+
# result = client.update_subscription request
|
646
|
+
#
|
647
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
648
|
+
# # check the status of an operation, cancel it, or wait for results.
|
649
|
+
# # Here is how to wait for a response.
|
650
|
+
# result.wait_until_done! timeout: 60
|
651
|
+
# if result.response?
|
652
|
+
# p result.response
|
653
|
+
# else
|
654
|
+
# puts "No response received."
|
655
|
+
# end
|
656
|
+
#
|
657
|
+
def update_subscription request, options = nil
|
658
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
659
|
+
|
660
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Events::Subscriptions::V1::UpdateSubscriptionRequest
|
661
|
+
|
662
|
+
# Converts hash and nil to an options object
|
663
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
664
|
+
|
665
|
+
# Customize the options with defaults
|
666
|
+
call_metadata = @config.rpcs.update_subscription.metadata.to_h
|
667
|
+
|
668
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
669
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
670
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
671
|
+
gapic_version: ::Google::Apps::Events::Subscriptions::V1::VERSION,
|
672
|
+
transports_version_send: [:rest]
|
673
|
+
|
674
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
675
|
+
|
676
|
+
options.apply_defaults timeout: @config.rpcs.update_subscription.timeout,
|
677
|
+
metadata: call_metadata,
|
678
|
+
retry_policy: @config.rpcs.update_subscription.retry_policy
|
679
|
+
|
680
|
+
options.apply_defaults timeout: @config.timeout,
|
681
|
+
metadata: @config.metadata,
|
682
|
+
retry_policy: @config.retry_policy
|
683
|
+
|
684
|
+
@subscriptions_service_stub.update_subscription request, options do |result, operation|
|
685
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
686
|
+
yield result, operation if block_given?
|
687
|
+
return result
|
688
|
+
end
|
689
|
+
rescue ::Gapic::Rest::Error => e
|
690
|
+
raise ::Google::Cloud::Error.from_error(e)
|
691
|
+
end
|
692
|
+
|
693
|
+
##
|
694
|
+
# Reactivates a suspended Google Workspace subscription.
|
695
|
+
#
|
696
|
+
# This method resets your subscription's `State` field to `ACTIVE`. Before
|
697
|
+
# you use this method, you must fix the error that suspended the
|
698
|
+
# subscription. To learn how to use this method, see [Reactivate a Google
|
699
|
+
# Workspace
|
700
|
+
# subscription](https://developers.google.com/workspace/events/guides/reactivate-subscription).
|
701
|
+
#
|
702
|
+
# @overload reactivate_subscription(request, options = nil)
|
703
|
+
# Pass arguments to `reactivate_subscription` via a request object, either of type
|
704
|
+
# {::Google::Apps::Events::Subscriptions::V1::ReactivateSubscriptionRequest} or an equivalent Hash.
|
705
|
+
#
|
706
|
+
# @param request [::Google::Apps::Events::Subscriptions::V1::ReactivateSubscriptionRequest, ::Hash]
|
707
|
+
# A request object representing the call parameters. Required. To specify no
|
708
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
709
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
710
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
711
|
+
#
|
712
|
+
# @overload reactivate_subscription(name: nil)
|
713
|
+
# Pass arguments to `reactivate_subscription` via keyword arguments. Note that at
|
714
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
715
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
716
|
+
#
|
717
|
+
# @param name [::String]
|
718
|
+
# Required. Resource name of the subscription.
|
719
|
+
#
|
720
|
+
# Format: `subscriptions/{subscription}`
|
721
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
722
|
+
# @yieldparam result [::Gapic::Operation]
|
723
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
724
|
+
#
|
725
|
+
# @return [::Gapic::Operation]
|
726
|
+
#
|
727
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
728
|
+
#
|
729
|
+
# @example Basic example
|
730
|
+
# require "google/apps/events/subscriptions/v1"
|
731
|
+
#
|
732
|
+
# # Create a client object. The client can be reused for multiple calls.
|
733
|
+
# client = Google::Apps::Events::Subscriptions::V1::SubscriptionsService::Rest::Client.new
|
734
|
+
#
|
735
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
736
|
+
# request = Google::Apps::Events::Subscriptions::V1::ReactivateSubscriptionRequest.new
|
737
|
+
#
|
738
|
+
# # Call the reactivate_subscription method.
|
739
|
+
# result = client.reactivate_subscription request
|
740
|
+
#
|
741
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
742
|
+
# # check the status of an operation, cancel it, or wait for results.
|
743
|
+
# # Here is how to wait for a response.
|
744
|
+
# result.wait_until_done! timeout: 60
|
745
|
+
# if result.response?
|
746
|
+
# p result.response
|
747
|
+
# else
|
748
|
+
# puts "No response received."
|
749
|
+
# end
|
750
|
+
#
|
751
|
+
def reactivate_subscription request, options = nil
|
752
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
753
|
+
|
754
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Events::Subscriptions::V1::ReactivateSubscriptionRequest
|
755
|
+
|
756
|
+
# Converts hash and nil to an options object
|
757
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
758
|
+
|
759
|
+
# Customize the options with defaults
|
760
|
+
call_metadata = @config.rpcs.reactivate_subscription.metadata.to_h
|
761
|
+
|
762
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
763
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
764
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
765
|
+
gapic_version: ::Google::Apps::Events::Subscriptions::V1::VERSION,
|
766
|
+
transports_version_send: [:rest]
|
767
|
+
|
768
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
769
|
+
|
770
|
+
options.apply_defaults timeout: @config.rpcs.reactivate_subscription.timeout,
|
771
|
+
metadata: call_metadata,
|
772
|
+
retry_policy: @config.rpcs.reactivate_subscription.retry_policy
|
773
|
+
|
774
|
+
options.apply_defaults timeout: @config.timeout,
|
775
|
+
metadata: @config.metadata,
|
776
|
+
retry_policy: @config.retry_policy
|
777
|
+
|
778
|
+
@subscriptions_service_stub.reactivate_subscription request, options do |result, operation|
|
779
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
780
|
+
yield result, operation if block_given?
|
781
|
+
return result
|
782
|
+
end
|
783
|
+
rescue ::Gapic::Rest::Error => e
|
784
|
+
raise ::Google::Cloud::Error.from_error(e)
|
785
|
+
end
|
786
|
+
|
787
|
+
##
|
788
|
+
# Configuration class for the SubscriptionsService REST API.
|
789
|
+
#
|
790
|
+
# This class represents the configuration for SubscriptionsService REST,
|
791
|
+
# providing control over timeouts, retry behavior, logging, transport
|
792
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
793
|
+
# applied individually to specific RPCs. See
|
794
|
+
# {::Google::Apps::Events::Subscriptions::V1::SubscriptionsService::Rest::Client::Configuration::Rpcs}
|
795
|
+
# for a list of RPCs that can be configured independently.
|
796
|
+
#
|
797
|
+
# Configuration can be applied globally to all clients, or to a single client
|
798
|
+
# on construction.
|
799
|
+
#
|
800
|
+
# @example
|
801
|
+
#
|
802
|
+
# # Modify the global config, setting the timeout for
|
803
|
+
# # create_subscription to 20 seconds,
|
804
|
+
# # and all remaining timeouts to 10 seconds.
|
805
|
+
# ::Google::Apps::Events::Subscriptions::V1::SubscriptionsService::Rest::Client.configure do |config|
|
806
|
+
# config.timeout = 10.0
|
807
|
+
# config.rpcs.create_subscription.timeout = 20.0
|
808
|
+
# end
|
809
|
+
#
|
810
|
+
# # Apply the above configuration only to a new client.
|
811
|
+
# client = ::Google::Apps::Events::Subscriptions::V1::SubscriptionsService::Rest::Client.new do |config|
|
812
|
+
# config.timeout = 10.0
|
813
|
+
# config.rpcs.create_subscription.timeout = 20.0
|
814
|
+
# end
|
815
|
+
#
|
816
|
+
# @!attribute [rw] endpoint
|
817
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
818
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
819
|
+
# @return [::String,nil]
|
820
|
+
# @!attribute [rw] credentials
|
821
|
+
# Credentials to send with calls. You may provide any of the following types:
|
822
|
+
# * (`String`) The path to a service account key file in JSON format
|
823
|
+
# * (`Hash`) A service account key as a Hash
|
824
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
825
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
826
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
827
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
828
|
+
# * (`nil`) indicating no credentials
|
829
|
+
# @return [::Object]
|
830
|
+
# @!attribute [rw] scope
|
831
|
+
# The OAuth scopes
|
832
|
+
# @return [::Array<::String>]
|
833
|
+
# @!attribute [rw] lib_name
|
834
|
+
# The library name as recorded in instrumentation and logging
|
835
|
+
# @return [::String]
|
836
|
+
# @!attribute [rw] lib_version
|
837
|
+
# The library version as recorded in instrumentation and logging
|
838
|
+
# @return [::String]
|
839
|
+
# @!attribute [rw] timeout
|
840
|
+
# The call timeout in seconds.
|
841
|
+
# @return [::Numeric]
|
842
|
+
# @!attribute [rw] metadata
|
843
|
+
# Additional headers to be sent with the call.
|
844
|
+
# @return [::Hash{::Symbol=>::String}]
|
845
|
+
# @!attribute [rw] retry_policy
|
846
|
+
# The retry policy. The value is a hash with the following keys:
|
847
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
848
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
849
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
850
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
851
|
+
# trigger a retry.
|
852
|
+
# @return [::Hash]
|
853
|
+
# @!attribute [rw] quota_project
|
854
|
+
# A separate project against which to charge quota.
|
855
|
+
# @return [::String]
|
856
|
+
# @!attribute [rw] universe_domain
|
857
|
+
# The universe domain within which to make requests. This determines the
|
858
|
+
# default endpoint URL. The default value of nil uses the environment
|
859
|
+
# universe (usually the default "googleapis.com" universe).
|
860
|
+
# @return [::String,nil]
|
861
|
+
#
|
862
|
+
class Configuration
|
863
|
+
extend ::Gapic::Config
|
864
|
+
|
865
|
+
# @private
|
866
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
867
|
+
DEFAULT_ENDPOINT = "workspaceevents.googleapis.com"
|
868
|
+
|
869
|
+
config_attr :endpoint, nil, ::String, nil
|
870
|
+
config_attr :credentials, nil do |value|
|
871
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
872
|
+
allowed.any? { |klass| klass === value }
|
873
|
+
end
|
874
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
875
|
+
config_attr :lib_name, nil, ::String, nil
|
876
|
+
config_attr :lib_version, nil, ::String, nil
|
877
|
+
config_attr :timeout, nil, ::Numeric, nil
|
878
|
+
config_attr :metadata, nil, ::Hash, nil
|
879
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
880
|
+
config_attr :quota_project, nil, ::String, nil
|
881
|
+
config_attr :universe_domain, nil, ::String, nil
|
882
|
+
|
883
|
+
# @private
|
884
|
+
def initialize parent_config = nil
|
885
|
+
@parent_config = parent_config unless parent_config.nil?
|
886
|
+
|
887
|
+
yield self if block_given?
|
888
|
+
end
|
889
|
+
|
890
|
+
##
|
891
|
+
# Configurations for individual RPCs
|
892
|
+
# @return [Rpcs]
|
893
|
+
#
|
894
|
+
def rpcs
|
895
|
+
@rpcs ||= begin
|
896
|
+
parent_rpcs = nil
|
897
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
898
|
+
Rpcs.new parent_rpcs
|
899
|
+
end
|
900
|
+
end
|
901
|
+
|
902
|
+
##
|
903
|
+
# Configuration RPC class for the SubscriptionsService API.
|
904
|
+
#
|
905
|
+
# Includes fields providing the configuration for each RPC in this service.
|
906
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
907
|
+
# the following configuration fields:
|
908
|
+
#
|
909
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
910
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
|
911
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
912
|
+
# include the following keys:
|
913
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
914
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
915
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
916
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
917
|
+
# trigger a retry.
|
918
|
+
#
|
919
|
+
class Rpcs
|
920
|
+
##
|
921
|
+
# RPC-specific configuration for `create_subscription`
|
922
|
+
# @return [::Gapic::Config::Method]
|
923
|
+
#
|
924
|
+
attr_reader :create_subscription
|
925
|
+
##
|
926
|
+
# RPC-specific configuration for `delete_subscription`
|
927
|
+
# @return [::Gapic::Config::Method]
|
928
|
+
#
|
929
|
+
attr_reader :delete_subscription
|
930
|
+
##
|
931
|
+
# RPC-specific configuration for `get_subscription`
|
932
|
+
# @return [::Gapic::Config::Method]
|
933
|
+
#
|
934
|
+
attr_reader :get_subscription
|
935
|
+
##
|
936
|
+
# RPC-specific configuration for `list_subscriptions`
|
937
|
+
# @return [::Gapic::Config::Method]
|
938
|
+
#
|
939
|
+
attr_reader :list_subscriptions
|
940
|
+
##
|
941
|
+
# RPC-specific configuration for `update_subscription`
|
942
|
+
# @return [::Gapic::Config::Method]
|
943
|
+
#
|
944
|
+
attr_reader :update_subscription
|
945
|
+
##
|
946
|
+
# RPC-specific configuration for `reactivate_subscription`
|
947
|
+
# @return [::Gapic::Config::Method]
|
948
|
+
#
|
949
|
+
attr_reader :reactivate_subscription
|
950
|
+
|
951
|
+
# @private
|
952
|
+
def initialize parent_rpcs = nil
|
953
|
+
create_subscription_config = parent_rpcs.create_subscription if parent_rpcs.respond_to? :create_subscription
|
954
|
+
@create_subscription = ::Gapic::Config::Method.new create_subscription_config
|
955
|
+
delete_subscription_config = parent_rpcs.delete_subscription if parent_rpcs.respond_to? :delete_subscription
|
956
|
+
@delete_subscription = ::Gapic::Config::Method.new delete_subscription_config
|
957
|
+
get_subscription_config = parent_rpcs.get_subscription if parent_rpcs.respond_to? :get_subscription
|
958
|
+
@get_subscription = ::Gapic::Config::Method.new get_subscription_config
|
959
|
+
list_subscriptions_config = parent_rpcs.list_subscriptions if parent_rpcs.respond_to? :list_subscriptions
|
960
|
+
@list_subscriptions = ::Gapic::Config::Method.new list_subscriptions_config
|
961
|
+
update_subscription_config = parent_rpcs.update_subscription if parent_rpcs.respond_to? :update_subscription
|
962
|
+
@update_subscription = ::Gapic::Config::Method.new update_subscription_config
|
963
|
+
reactivate_subscription_config = parent_rpcs.reactivate_subscription if parent_rpcs.respond_to? :reactivate_subscription
|
964
|
+
@reactivate_subscription = ::Gapic::Config::Method.new reactivate_subscription_config
|
965
|
+
|
966
|
+
yield self if block_given?
|
967
|
+
end
|
968
|
+
end
|
969
|
+
end
|
970
|
+
end
|
971
|
+
end
|
972
|
+
end
|
973
|
+
end
|
974
|
+
end
|
975
|
+
end
|
976
|
+
end
|
977
|
+
end
|