google-cloud-gsuite_add_ons-v1 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 +7 -0
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +149 -0
- data/LICENSE.md +201 -0
- data/README.md +144 -0
- data/lib/google/cloud/gsuite_add_ons/v1/gsuite_add_ons/client.rb +1208 -0
- data/lib/google/cloud/gsuite_add_ons/v1/gsuite_add_ons/credentials.rb +47 -0
- data/lib/google/cloud/gsuite_add_ons/v1/gsuite_add_ons/paths.rb +95 -0
- data/lib/google/cloud/gsuite_add_ons/v1/gsuite_add_ons.rb +76 -0
- data/lib/google/cloud/gsuite_add_ons/v1/version.rb +28 -0
- data/lib/google/cloud/gsuite_add_ons/v1.rb +40 -0
- data/lib/google/cloud/gsuiteaddons/v1/gsuiteaddons_pb.rb +107 -0
- data/lib/google/cloud/gsuiteaddons/v1/gsuiteaddons_services_pb.rb +92 -0
- data/lib/google-cloud-gsuite_add_ons-v1.rb +21 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/client.rb +318 -0
- data/proto_docs/google/api/field_behavior.rb +71 -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/script/type/addon_widget_set.rb +62 -0
- data/proto_docs/google/apps/script/type/calendar/calendar_addon_manifest.rb +114 -0
- data/proto_docs/google/apps/script/type/docs/docs_addon_manifest.rb +51 -0
- data/proto_docs/google/apps/script/type/drive/drive_addon_manifest.rb +53 -0
- data/proto_docs/google/apps/script/type/extension_point.rb +80 -0
- data/proto_docs/google/apps/script/type/gmail/gmail_addon_manifest.rb +134 -0
- data/proto_docs/google/apps/script/type/script_manifest.rb +112 -0
- data/proto_docs/google/apps/script/type/sheets/sheets_addon_manifest.rb +51 -0
- data/proto_docs/google/apps/script/type/slides/slides_addon_manifest.rb +51 -0
- data/proto_docs/google/cloud/gsuiteaddons/v1/gsuiteaddons.rb +245 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/empty.rb +34 -0
- data/proto_docs/google/protobuf/struct.rb +96 -0
- data/proto_docs/google/protobuf/wrappers.rb +121 -0
- metadata +243 -0
@@ -0,0 +1,1208 @@
|
|
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/gsuiteaddons/v1/gsuiteaddons_pb"
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module GSuiteAddOns
|
25
|
+
module V1
|
26
|
+
module GSuiteAddOns
|
27
|
+
##
|
28
|
+
# Client for the GSuiteAddOns service.
|
29
|
+
#
|
30
|
+
# A service for managing Google Workspace Add-ons deployments.
|
31
|
+
#
|
32
|
+
# A Google Workspace Add-on is a third-party embedded component that can be
|
33
|
+
# installed in Google Workspace Applications like Gmail, Calendar, Drive, and
|
34
|
+
# the Google Docs, Sheets, and Slides editors. Google Workspace Add-ons can
|
35
|
+
# display UI cards, receive contextual information from the host application,
|
36
|
+
# and perform actions in the host application (See:
|
37
|
+
# https://developers.google.com/gsuite/add-ons/overview for more information).
|
38
|
+
#
|
39
|
+
# A Google Workspace Add-on deployment resource specifies metadata about the
|
40
|
+
# add-on, including a specification of the entry points in the host application
|
41
|
+
# that trigger add-on executions (see:
|
42
|
+
# https://developers.google.com/gsuite/add-ons/concepts/gsuite-manifests).
|
43
|
+
# Add-on deployments defined via the Google Workspace Add-ons API define their
|
44
|
+
# entrypoints using HTTPS URLs (See:
|
45
|
+
# https://developers.google.com/gsuite/add-ons/guides/alternate-runtimes),
|
46
|
+
#
|
47
|
+
# A Google Workspace Add-on deployment can be installed in developer mode,
|
48
|
+
# which allows an add-on developer to test the experience an end-user would see
|
49
|
+
# when installing and running the add-on in their G Suite applications. When
|
50
|
+
# running in developer mode, more detailed error messages are exposed in the
|
51
|
+
# add-on UI to aid in debugging.
|
52
|
+
#
|
53
|
+
# A Google Workspace Add-on deployment can be published to Google Workspace
|
54
|
+
# Marketplace, which allows other Google Workspace users to discover and
|
55
|
+
# install the add-on. See:
|
56
|
+
# https://developers.google.com/gsuite/add-ons/how-tos/publish-add-on-overview
|
57
|
+
# for details.
|
58
|
+
#
|
59
|
+
class Client
|
60
|
+
include Paths
|
61
|
+
|
62
|
+
# @private
|
63
|
+
attr_reader :g_suite_add_ons_stub
|
64
|
+
|
65
|
+
##
|
66
|
+
# Configure the GSuiteAddOns Client class.
|
67
|
+
#
|
68
|
+
# See {::Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Client::Configuration}
|
69
|
+
# for a description of the configuration fields.
|
70
|
+
#
|
71
|
+
# @example
|
72
|
+
#
|
73
|
+
# # Modify the configuration for all GSuiteAddOns clients
|
74
|
+
# ::Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Client.configure do |config|
|
75
|
+
# config.timeout = 10.0
|
76
|
+
# end
|
77
|
+
#
|
78
|
+
# @yield [config] Configure the Client client.
|
79
|
+
# @yieldparam config [Client::Configuration]
|
80
|
+
#
|
81
|
+
# @return [Client::Configuration]
|
82
|
+
#
|
83
|
+
def self.configure
|
84
|
+
@configure ||= begin
|
85
|
+
namespace = ["Google", "Cloud", "GSuiteAddOns", "V1"]
|
86
|
+
parent_config = while namespace.any?
|
87
|
+
parent_name = namespace.join "::"
|
88
|
+
parent_const = const_get parent_name
|
89
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
90
|
+
namespace.pop
|
91
|
+
end
|
92
|
+
default_config = Client::Configuration.new parent_config
|
93
|
+
|
94
|
+
default_config.timeout = 10.0
|
95
|
+
default_config.retry_policy = {
|
96
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 2]
|
97
|
+
}
|
98
|
+
|
99
|
+
default_config.rpcs.get_authorization.timeout = 120.0
|
100
|
+
|
101
|
+
default_config.rpcs.create_deployment.timeout = 10.0
|
102
|
+
|
103
|
+
default_config.rpcs.delete_deployment.timeout = 10.0
|
104
|
+
|
105
|
+
default_config
|
106
|
+
end
|
107
|
+
yield @configure if block_given?
|
108
|
+
@configure
|
109
|
+
end
|
110
|
+
|
111
|
+
##
|
112
|
+
# Configure the GSuiteAddOns Client instance.
|
113
|
+
#
|
114
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
115
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
116
|
+
# should be made on {Client.configure}.
|
117
|
+
#
|
118
|
+
# See {::Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Client::Configuration}
|
119
|
+
# for a description of the configuration fields.
|
120
|
+
#
|
121
|
+
# @yield [config] Configure the Client client.
|
122
|
+
# @yieldparam config [Client::Configuration]
|
123
|
+
#
|
124
|
+
# @return [Client::Configuration]
|
125
|
+
#
|
126
|
+
def configure
|
127
|
+
yield @config if block_given?
|
128
|
+
@config
|
129
|
+
end
|
130
|
+
|
131
|
+
##
|
132
|
+
# Create a new GSuiteAddOns client object.
|
133
|
+
#
|
134
|
+
# @example
|
135
|
+
#
|
136
|
+
# # Create a client using the default configuration
|
137
|
+
# client = ::Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Client.new
|
138
|
+
#
|
139
|
+
# # Create a client using a custom configuration
|
140
|
+
# client = ::Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Client.new do |config|
|
141
|
+
# config.timeout = 10.0
|
142
|
+
# end
|
143
|
+
#
|
144
|
+
# @yield [config] Configure the GSuiteAddOns client.
|
145
|
+
# @yieldparam config [Client::Configuration]
|
146
|
+
#
|
147
|
+
def initialize
|
148
|
+
# These require statements are intentionally placed here to initialize
|
149
|
+
# the gRPC module only when it's required.
|
150
|
+
# See https://github.com/googleapis/toolkit/issues/446
|
151
|
+
require "gapic/grpc"
|
152
|
+
require "google/cloud/gsuiteaddons/v1/gsuiteaddons_services_pb"
|
153
|
+
|
154
|
+
# Create the configuration object
|
155
|
+
@config = Configuration.new Client.configure
|
156
|
+
|
157
|
+
# Yield the configuration if needed
|
158
|
+
yield @config if block_given?
|
159
|
+
|
160
|
+
# Create credentials
|
161
|
+
credentials = @config.credentials
|
162
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
163
|
+
# but only if the default endpoint does not have a region prefix.
|
164
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
165
|
+
!@config.endpoint.split(".").first.include?("-")
|
166
|
+
credentials ||= Credentials.default scope: @config.scope,
|
167
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
168
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
169
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
170
|
+
end
|
171
|
+
@quota_project_id = @config.quota_project
|
172
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
173
|
+
|
174
|
+
@g_suite_add_ons_stub = ::Gapic::ServiceStub.new(
|
175
|
+
::Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Stub,
|
176
|
+
credentials: credentials,
|
177
|
+
endpoint: @config.endpoint,
|
178
|
+
channel_args: @config.channel_args,
|
179
|
+
interceptors: @config.interceptors
|
180
|
+
)
|
181
|
+
end
|
182
|
+
|
183
|
+
# Service calls
|
184
|
+
|
185
|
+
##
|
186
|
+
# Gets the authorization information for deployments in a given project.
|
187
|
+
#
|
188
|
+
# @overload get_authorization(request, options = nil)
|
189
|
+
# Pass arguments to `get_authorization` via a request object, either of type
|
190
|
+
# {::Google::Cloud::GSuiteAddOns::V1::GetAuthorizationRequest} or an equivalent Hash.
|
191
|
+
#
|
192
|
+
# @param request [::Google::Cloud::GSuiteAddOns::V1::GetAuthorizationRequest, ::Hash]
|
193
|
+
# A request object representing the call parameters. Required. To specify no
|
194
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
195
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
196
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
197
|
+
#
|
198
|
+
# @overload get_authorization(name: nil)
|
199
|
+
# Pass arguments to `get_authorization` via keyword arguments. Note that at
|
200
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
201
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
202
|
+
#
|
203
|
+
# @param name [::String]
|
204
|
+
# Required. Name of the project for which to get the Google Workspace Add-ons
|
205
|
+
# authorization information.
|
206
|
+
#
|
207
|
+
# Example: `projects/my_project/authorization`.
|
208
|
+
#
|
209
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
210
|
+
# @yieldparam response [::Google::Cloud::GSuiteAddOns::V1::Authorization]
|
211
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
212
|
+
#
|
213
|
+
# @return [::Google::Cloud::GSuiteAddOns::V1::Authorization]
|
214
|
+
#
|
215
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
216
|
+
#
|
217
|
+
# @example Basic example
|
218
|
+
# require "google/cloud/gsuite_add_ons/v1"
|
219
|
+
#
|
220
|
+
# # Create a client object. The client can be reused for multiple calls.
|
221
|
+
# client = Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Client.new
|
222
|
+
#
|
223
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
224
|
+
# request = Google::Cloud::GSuiteAddOns::V1::GetAuthorizationRequest.new
|
225
|
+
#
|
226
|
+
# # Call the get_authorization method.
|
227
|
+
# result = client.get_authorization request
|
228
|
+
#
|
229
|
+
# # The returned object is of type Google::Cloud::GSuiteAddOns::V1::Authorization.
|
230
|
+
# p result
|
231
|
+
#
|
232
|
+
def get_authorization request, options = nil
|
233
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
234
|
+
|
235
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GSuiteAddOns::V1::GetAuthorizationRequest
|
236
|
+
|
237
|
+
# Converts hash and nil to an options object
|
238
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
239
|
+
|
240
|
+
# Customize the options with defaults
|
241
|
+
metadata = @config.rpcs.get_authorization.metadata.to_h
|
242
|
+
|
243
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
244
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
245
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
246
|
+
gapic_version: ::Google::Cloud::GSuiteAddOns::V1::VERSION
|
247
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
248
|
+
|
249
|
+
header_params = {}
|
250
|
+
if request.name
|
251
|
+
header_params["name"] = request.name
|
252
|
+
end
|
253
|
+
|
254
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
255
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
256
|
+
|
257
|
+
options.apply_defaults timeout: @config.rpcs.get_authorization.timeout,
|
258
|
+
metadata: metadata,
|
259
|
+
retry_policy: @config.rpcs.get_authorization.retry_policy
|
260
|
+
|
261
|
+
options.apply_defaults timeout: @config.timeout,
|
262
|
+
metadata: @config.metadata,
|
263
|
+
retry_policy: @config.retry_policy
|
264
|
+
|
265
|
+
@g_suite_add_ons_stub.call_rpc :get_authorization, request, options: options do |response, operation|
|
266
|
+
yield response, operation if block_given?
|
267
|
+
return response
|
268
|
+
end
|
269
|
+
rescue ::GRPC::BadStatus => e
|
270
|
+
raise ::Google::Cloud::Error.from_error(e)
|
271
|
+
end
|
272
|
+
|
273
|
+
##
|
274
|
+
# Creates a deployment with the specified name and configuration.
|
275
|
+
#
|
276
|
+
# @overload create_deployment(request, options = nil)
|
277
|
+
# Pass arguments to `create_deployment` via a request object, either of type
|
278
|
+
# {::Google::Cloud::GSuiteAddOns::V1::CreateDeploymentRequest} or an equivalent Hash.
|
279
|
+
#
|
280
|
+
# @param request [::Google::Cloud::GSuiteAddOns::V1::CreateDeploymentRequest, ::Hash]
|
281
|
+
# A request object representing the call parameters. Required. To specify no
|
282
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
283
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
284
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
285
|
+
#
|
286
|
+
# @overload create_deployment(parent: nil, deployment_id: nil, deployment: nil)
|
287
|
+
# Pass arguments to `create_deployment` via keyword arguments. Note that at
|
288
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
289
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
290
|
+
#
|
291
|
+
# @param parent [::String]
|
292
|
+
# Required. Name of the project in which to create the deployment.
|
293
|
+
#
|
294
|
+
# Example: `projects/my_project`.
|
295
|
+
# @param deployment_id [::String]
|
296
|
+
# Required. The id to use for this deployment. The full name of the created
|
297
|
+
# resource will be `projects/<project_number>/deployments/<deployment_id>`.
|
298
|
+
# @param deployment [::Google::Cloud::GSuiteAddOns::V1::Deployment, ::Hash]
|
299
|
+
# Required. The deployment to create (deployment.name cannot be set).
|
300
|
+
#
|
301
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
302
|
+
# @yieldparam response [::Google::Cloud::GSuiteAddOns::V1::Deployment]
|
303
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
304
|
+
#
|
305
|
+
# @return [::Google::Cloud::GSuiteAddOns::V1::Deployment]
|
306
|
+
#
|
307
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
308
|
+
#
|
309
|
+
# @example Basic example
|
310
|
+
# require "google/cloud/gsuite_add_ons/v1"
|
311
|
+
#
|
312
|
+
# # Create a client object. The client can be reused for multiple calls.
|
313
|
+
# client = Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Client.new
|
314
|
+
#
|
315
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
316
|
+
# request = Google::Cloud::GSuiteAddOns::V1::CreateDeploymentRequest.new
|
317
|
+
#
|
318
|
+
# # Call the create_deployment method.
|
319
|
+
# result = client.create_deployment request
|
320
|
+
#
|
321
|
+
# # The returned object is of type Google::Cloud::GSuiteAddOns::V1::Deployment.
|
322
|
+
# p result
|
323
|
+
#
|
324
|
+
def create_deployment request, options = nil
|
325
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
326
|
+
|
327
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GSuiteAddOns::V1::CreateDeploymentRequest
|
328
|
+
|
329
|
+
# Converts hash and nil to an options object
|
330
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
331
|
+
|
332
|
+
# Customize the options with defaults
|
333
|
+
metadata = @config.rpcs.create_deployment.metadata.to_h
|
334
|
+
|
335
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
336
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
337
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
338
|
+
gapic_version: ::Google::Cloud::GSuiteAddOns::V1::VERSION
|
339
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
340
|
+
|
341
|
+
header_params = {}
|
342
|
+
if request.parent
|
343
|
+
header_params["parent"] = request.parent
|
344
|
+
end
|
345
|
+
|
346
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
347
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
348
|
+
|
349
|
+
options.apply_defaults timeout: @config.rpcs.create_deployment.timeout,
|
350
|
+
metadata: metadata,
|
351
|
+
retry_policy: @config.rpcs.create_deployment.retry_policy
|
352
|
+
|
353
|
+
options.apply_defaults timeout: @config.timeout,
|
354
|
+
metadata: @config.metadata,
|
355
|
+
retry_policy: @config.retry_policy
|
356
|
+
|
357
|
+
@g_suite_add_ons_stub.call_rpc :create_deployment, request, options: options do |response, operation|
|
358
|
+
yield response, operation if block_given?
|
359
|
+
return response
|
360
|
+
end
|
361
|
+
rescue ::GRPC::BadStatus => e
|
362
|
+
raise ::Google::Cloud::Error.from_error(e)
|
363
|
+
end
|
364
|
+
|
365
|
+
##
|
366
|
+
# Creates or replaces a deployment with the specified name.
|
367
|
+
#
|
368
|
+
# @overload replace_deployment(request, options = nil)
|
369
|
+
# Pass arguments to `replace_deployment` via a request object, either of type
|
370
|
+
# {::Google::Cloud::GSuiteAddOns::V1::ReplaceDeploymentRequest} or an equivalent Hash.
|
371
|
+
#
|
372
|
+
# @param request [::Google::Cloud::GSuiteAddOns::V1::ReplaceDeploymentRequest, ::Hash]
|
373
|
+
# A request object representing the call parameters. Required. To specify no
|
374
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
375
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
376
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
377
|
+
#
|
378
|
+
# @overload replace_deployment(deployment: nil)
|
379
|
+
# Pass arguments to `replace_deployment` via keyword arguments. Note that at
|
380
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
381
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
382
|
+
#
|
383
|
+
# @param deployment [::Google::Cloud::GSuiteAddOns::V1::Deployment, ::Hash]
|
384
|
+
# Required. The deployment to create or replace.
|
385
|
+
#
|
386
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
387
|
+
# @yieldparam response [::Google::Cloud::GSuiteAddOns::V1::Deployment]
|
388
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
389
|
+
#
|
390
|
+
# @return [::Google::Cloud::GSuiteAddOns::V1::Deployment]
|
391
|
+
#
|
392
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
393
|
+
#
|
394
|
+
# @example Basic example
|
395
|
+
# require "google/cloud/gsuite_add_ons/v1"
|
396
|
+
#
|
397
|
+
# # Create a client object. The client can be reused for multiple calls.
|
398
|
+
# client = Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Client.new
|
399
|
+
#
|
400
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
401
|
+
# request = Google::Cloud::GSuiteAddOns::V1::ReplaceDeploymentRequest.new
|
402
|
+
#
|
403
|
+
# # Call the replace_deployment method.
|
404
|
+
# result = client.replace_deployment request
|
405
|
+
#
|
406
|
+
# # The returned object is of type Google::Cloud::GSuiteAddOns::V1::Deployment.
|
407
|
+
# p result
|
408
|
+
#
|
409
|
+
def replace_deployment request, options = nil
|
410
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
411
|
+
|
412
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GSuiteAddOns::V1::ReplaceDeploymentRequest
|
413
|
+
|
414
|
+
# Converts hash and nil to an options object
|
415
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
416
|
+
|
417
|
+
# Customize the options with defaults
|
418
|
+
metadata = @config.rpcs.replace_deployment.metadata.to_h
|
419
|
+
|
420
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
421
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
422
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
423
|
+
gapic_version: ::Google::Cloud::GSuiteAddOns::V1::VERSION
|
424
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
425
|
+
|
426
|
+
header_params = {}
|
427
|
+
if request.deployment&.name
|
428
|
+
header_params["deployment.name"] = request.deployment.name
|
429
|
+
end
|
430
|
+
|
431
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
432
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
433
|
+
|
434
|
+
options.apply_defaults timeout: @config.rpcs.replace_deployment.timeout,
|
435
|
+
metadata: metadata,
|
436
|
+
retry_policy: @config.rpcs.replace_deployment.retry_policy
|
437
|
+
|
438
|
+
options.apply_defaults timeout: @config.timeout,
|
439
|
+
metadata: @config.metadata,
|
440
|
+
retry_policy: @config.retry_policy
|
441
|
+
|
442
|
+
@g_suite_add_ons_stub.call_rpc :replace_deployment, request, options: options do |response, operation|
|
443
|
+
yield response, operation if block_given?
|
444
|
+
return response
|
445
|
+
end
|
446
|
+
rescue ::GRPC::BadStatus => e
|
447
|
+
raise ::Google::Cloud::Error.from_error(e)
|
448
|
+
end
|
449
|
+
|
450
|
+
##
|
451
|
+
# Gets the deployment with the specified name.
|
452
|
+
#
|
453
|
+
# @overload get_deployment(request, options = nil)
|
454
|
+
# Pass arguments to `get_deployment` via a request object, either of type
|
455
|
+
# {::Google::Cloud::GSuiteAddOns::V1::GetDeploymentRequest} or an equivalent Hash.
|
456
|
+
#
|
457
|
+
# @param request [::Google::Cloud::GSuiteAddOns::V1::GetDeploymentRequest, ::Hash]
|
458
|
+
# A request object representing the call parameters. Required. To specify no
|
459
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
460
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
461
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
462
|
+
#
|
463
|
+
# @overload get_deployment(name: nil)
|
464
|
+
# Pass arguments to `get_deployment` via keyword arguments. Note that at
|
465
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
466
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
467
|
+
#
|
468
|
+
# @param name [::String]
|
469
|
+
# Required. The full resource name of the deployment to get.
|
470
|
+
#
|
471
|
+
# Example: `projects/my_project/deployments/my_deployment`.
|
472
|
+
#
|
473
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
474
|
+
# @yieldparam response [::Google::Cloud::GSuiteAddOns::V1::Deployment]
|
475
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
476
|
+
#
|
477
|
+
# @return [::Google::Cloud::GSuiteAddOns::V1::Deployment]
|
478
|
+
#
|
479
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
480
|
+
#
|
481
|
+
# @example Basic example
|
482
|
+
# require "google/cloud/gsuite_add_ons/v1"
|
483
|
+
#
|
484
|
+
# # Create a client object. The client can be reused for multiple calls.
|
485
|
+
# client = Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Client.new
|
486
|
+
#
|
487
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
488
|
+
# request = Google::Cloud::GSuiteAddOns::V1::GetDeploymentRequest.new
|
489
|
+
#
|
490
|
+
# # Call the get_deployment method.
|
491
|
+
# result = client.get_deployment request
|
492
|
+
#
|
493
|
+
# # The returned object is of type Google::Cloud::GSuiteAddOns::V1::Deployment.
|
494
|
+
# p result
|
495
|
+
#
|
496
|
+
def get_deployment request, options = nil
|
497
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
498
|
+
|
499
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GSuiteAddOns::V1::GetDeploymentRequest
|
500
|
+
|
501
|
+
# Converts hash and nil to an options object
|
502
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
503
|
+
|
504
|
+
# Customize the options with defaults
|
505
|
+
metadata = @config.rpcs.get_deployment.metadata.to_h
|
506
|
+
|
507
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
508
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
509
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
510
|
+
gapic_version: ::Google::Cloud::GSuiteAddOns::V1::VERSION
|
511
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
512
|
+
|
513
|
+
header_params = {}
|
514
|
+
if request.name
|
515
|
+
header_params["name"] = request.name
|
516
|
+
end
|
517
|
+
|
518
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
519
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
520
|
+
|
521
|
+
options.apply_defaults timeout: @config.rpcs.get_deployment.timeout,
|
522
|
+
metadata: metadata,
|
523
|
+
retry_policy: @config.rpcs.get_deployment.retry_policy
|
524
|
+
|
525
|
+
options.apply_defaults timeout: @config.timeout,
|
526
|
+
metadata: @config.metadata,
|
527
|
+
retry_policy: @config.retry_policy
|
528
|
+
|
529
|
+
@g_suite_add_ons_stub.call_rpc :get_deployment, request, options: options do |response, operation|
|
530
|
+
yield response, operation if block_given?
|
531
|
+
return response
|
532
|
+
end
|
533
|
+
rescue ::GRPC::BadStatus => e
|
534
|
+
raise ::Google::Cloud::Error.from_error(e)
|
535
|
+
end
|
536
|
+
|
537
|
+
##
|
538
|
+
# Lists all deployments in a particular project.
|
539
|
+
#
|
540
|
+
# @overload list_deployments(request, options = nil)
|
541
|
+
# Pass arguments to `list_deployments` via a request object, either of type
|
542
|
+
# {::Google::Cloud::GSuiteAddOns::V1::ListDeploymentsRequest} or an equivalent Hash.
|
543
|
+
#
|
544
|
+
# @param request [::Google::Cloud::GSuiteAddOns::V1::ListDeploymentsRequest, ::Hash]
|
545
|
+
# A request object representing the call parameters. Required. To specify no
|
546
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
547
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
548
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
549
|
+
#
|
550
|
+
# @overload list_deployments(parent: nil, page_size: nil, page_token: nil)
|
551
|
+
# Pass arguments to `list_deployments` via keyword arguments. Note that at
|
552
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
553
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
554
|
+
#
|
555
|
+
# @param parent [::String]
|
556
|
+
# Required. Name of the project in which to create the deployment.
|
557
|
+
#
|
558
|
+
# Example: `projects/my_project`.
|
559
|
+
# @param page_size [::Integer]
|
560
|
+
# The maximum number of deployments to return. The service may return fewer
|
561
|
+
# than this value.
|
562
|
+
# If unspecified, at most 1000 deployments will be returned.
|
563
|
+
# The maximum value is 1000; values above 1000 will be coerced to 1000.
|
564
|
+
# @param page_token [::String]
|
565
|
+
# A page token, received from a previous `ListDeployments` call.
|
566
|
+
# Provide this to retrieve the subsequent page.
|
567
|
+
#
|
568
|
+
# When paginating, all other parameters provided to `ListDeployments` must
|
569
|
+
# match the call that provided the page token.
|
570
|
+
#
|
571
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
572
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::GSuiteAddOns::V1::Deployment>]
|
573
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
574
|
+
#
|
575
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::GSuiteAddOns::V1::Deployment>]
|
576
|
+
#
|
577
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
578
|
+
#
|
579
|
+
# @example Basic example
|
580
|
+
# require "google/cloud/gsuite_add_ons/v1"
|
581
|
+
#
|
582
|
+
# # Create a client object. The client can be reused for multiple calls.
|
583
|
+
# client = Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Client.new
|
584
|
+
#
|
585
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
586
|
+
# request = Google::Cloud::GSuiteAddOns::V1::ListDeploymentsRequest.new
|
587
|
+
#
|
588
|
+
# # Call the list_deployments method.
|
589
|
+
# result = client.list_deployments request
|
590
|
+
#
|
591
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
592
|
+
# # iterate over all elements by calling #each, and the enumerable
|
593
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
594
|
+
# # methods are also available for managing paging directly.
|
595
|
+
# result.each do |response|
|
596
|
+
# # Each element is of type ::Google::Cloud::GSuiteAddOns::V1::Deployment.
|
597
|
+
# p response
|
598
|
+
# end
|
599
|
+
#
|
600
|
+
def list_deployments request, options = nil
|
601
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
602
|
+
|
603
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GSuiteAddOns::V1::ListDeploymentsRequest
|
604
|
+
|
605
|
+
# Converts hash and nil to an options object
|
606
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
607
|
+
|
608
|
+
# Customize the options with defaults
|
609
|
+
metadata = @config.rpcs.list_deployments.metadata.to_h
|
610
|
+
|
611
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
612
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
613
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
614
|
+
gapic_version: ::Google::Cloud::GSuiteAddOns::V1::VERSION
|
615
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
616
|
+
|
617
|
+
header_params = {}
|
618
|
+
if request.parent
|
619
|
+
header_params["parent"] = request.parent
|
620
|
+
end
|
621
|
+
|
622
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
623
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
624
|
+
|
625
|
+
options.apply_defaults timeout: @config.rpcs.list_deployments.timeout,
|
626
|
+
metadata: metadata,
|
627
|
+
retry_policy: @config.rpcs.list_deployments.retry_policy
|
628
|
+
|
629
|
+
options.apply_defaults timeout: @config.timeout,
|
630
|
+
metadata: @config.metadata,
|
631
|
+
retry_policy: @config.retry_policy
|
632
|
+
|
633
|
+
@g_suite_add_ons_stub.call_rpc :list_deployments, request, options: options do |response, operation|
|
634
|
+
response = ::Gapic::PagedEnumerable.new @g_suite_add_ons_stub, :list_deployments, request, response, operation, options
|
635
|
+
yield response, operation if block_given?
|
636
|
+
return response
|
637
|
+
end
|
638
|
+
rescue ::GRPC::BadStatus => e
|
639
|
+
raise ::Google::Cloud::Error.from_error(e)
|
640
|
+
end
|
641
|
+
|
642
|
+
##
|
643
|
+
# Deletes the deployment with the given name.
|
644
|
+
#
|
645
|
+
# @overload delete_deployment(request, options = nil)
|
646
|
+
# Pass arguments to `delete_deployment` via a request object, either of type
|
647
|
+
# {::Google::Cloud::GSuiteAddOns::V1::DeleteDeploymentRequest} or an equivalent Hash.
|
648
|
+
#
|
649
|
+
# @param request [::Google::Cloud::GSuiteAddOns::V1::DeleteDeploymentRequest, ::Hash]
|
650
|
+
# A request object representing the call parameters. Required. To specify no
|
651
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
652
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
653
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
654
|
+
#
|
655
|
+
# @overload delete_deployment(name: nil, etag: nil)
|
656
|
+
# Pass arguments to `delete_deployment` via keyword arguments. Note that at
|
657
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
658
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
659
|
+
#
|
660
|
+
# @param name [::String]
|
661
|
+
# Required. The full resource name of the deployment to delete.
|
662
|
+
#
|
663
|
+
# Example: `projects/my_project/deployments/my_deployment`.
|
664
|
+
# @param etag [::String]
|
665
|
+
# The etag of the deployment to delete.
|
666
|
+
# If this is provided, it must match the server's etag.
|
667
|
+
#
|
668
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
669
|
+
# @yieldparam response [::Google::Protobuf::Empty]
|
670
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
671
|
+
#
|
672
|
+
# @return [::Google::Protobuf::Empty]
|
673
|
+
#
|
674
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
675
|
+
#
|
676
|
+
# @example Basic example
|
677
|
+
# require "google/cloud/gsuite_add_ons/v1"
|
678
|
+
#
|
679
|
+
# # Create a client object. The client can be reused for multiple calls.
|
680
|
+
# client = Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Client.new
|
681
|
+
#
|
682
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
683
|
+
# request = Google::Cloud::GSuiteAddOns::V1::DeleteDeploymentRequest.new
|
684
|
+
#
|
685
|
+
# # Call the delete_deployment method.
|
686
|
+
# result = client.delete_deployment request
|
687
|
+
#
|
688
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
689
|
+
# p result
|
690
|
+
#
|
691
|
+
def delete_deployment request, options = nil
|
692
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
693
|
+
|
694
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GSuiteAddOns::V1::DeleteDeploymentRequest
|
695
|
+
|
696
|
+
# Converts hash and nil to an options object
|
697
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
698
|
+
|
699
|
+
# Customize the options with defaults
|
700
|
+
metadata = @config.rpcs.delete_deployment.metadata.to_h
|
701
|
+
|
702
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
703
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
704
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
705
|
+
gapic_version: ::Google::Cloud::GSuiteAddOns::V1::VERSION
|
706
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
707
|
+
|
708
|
+
header_params = {}
|
709
|
+
if request.name
|
710
|
+
header_params["name"] = request.name
|
711
|
+
end
|
712
|
+
|
713
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
714
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
715
|
+
|
716
|
+
options.apply_defaults timeout: @config.rpcs.delete_deployment.timeout,
|
717
|
+
metadata: metadata,
|
718
|
+
retry_policy: @config.rpcs.delete_deployment.retry_policy
|
719
|
+
|
720
|
+
options.apply_defaults timeout: @config.timeout,
|
721
|
+
metadata: @config.metadata,
|
722
|
+
retry_policy: @config.retry_policy
|
723
|
+
|
724
|
+
@g_suite_add_ons_stub.call_rpc :delete_deployment, request, options: options do |response, operation|
|
725
|
+
yield response, operation if block_given?
|
726
|
+
return response
|
727
|
+
end
|
728
|
+
rescue ::GRPC::BadStatus => e
|
729
|
+
raise ::Google::Cloud::Error.from_error(e)
|
730
|
+
end
|
731
|
+
|
732
|
+
##
|
733
|
+
# Installs a deployment in developer mode.
|
734
|
+
# See:
|
735
|
+
# https://developers.google.com/gsuite/add-ons/how-tos/testing-gsuite-addons.
|
736
|
+
#
|
737
|
+
# @overload install_deployment(request, options = nil)
|
738
|
+
# Pass arguments to `install_deployment` via a request object, either of type
|
739
|
+
# {::Google::Cloud::GSuiteAddOns::V1::InstallDeploymentRequest} or an equivalent Hash.
|
740
|
+
#
|
741
|
+
# @param request [::Google::Cloud::GSuiteAddOns::V1::InstallDeploymentRequest, ::Hash]
|
742
|
+
# A request object representing the call parameters. Required. To specify no
|
743
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
744
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
745
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
746
|
+
#
|
747
|
+
# @overload install_deployment(name: nil)
|
748
|
+
# Pass arguments to `install_deployment` via keyword arguments. Note that at
|
749
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
750
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
751
|
+
#
|
752
|
+
# @param name [::String]
|
753
|
+
# Required. The full resource name of the deployment to install.
|
754
|
+
#
|
755
|
+
# Example: `projects/my_project/deployments/my_deployment`.
|
756
|
+
#
|
757
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
758
|
+
# @yieldparam response [::Google::Protobuf::Empty]
|
759
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
760
|
+
#
|
761
|
+
# @return [::Google::Protobuf::Empty]
|
762
|
+
#
|
763
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
764
|
+
#
|
765
|
+
# @example Basic example
|
766
|
+
# require "google/cloud/gsuite_add_ons/v1"
|
767
|
+
#
|
768
|
+
# # Create a client object. The client can be reused for multiple calls.
|
769
|
+
# client = Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Client.new
|
770
|
+
#
|
771
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
772
|
+
# request = Google::Cloud::GSuiteAddOns::V1::InstallDeploymentRequest.new
|
773
|
+
#
|
774
|
+
# # Call the install_deployment method.
|
775
|
+
# result = client.install_deployment request
|
776
|
+
#
|
777
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
778
|
+
# p result
|
779
|
+
#
|
780
|
+
def install_deployment request, options = nil
|
781
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
782
|
+
|
783
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GSuiteAddOns::V1::InstallDeploymentRequest
|
784
|
+
|
785
|
+
# Converts hash and nil to an options object
|
786
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
787
|
+
|
788
|
+
# Customize the options with defaults
|
789
|
+
metadata = @config.rpcs.install_deployment.metadata.to_h
|
790
|
+
|
791
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
792
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
793
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
794
|
+
gapic_version: ::Google::Cloud::GSuiteAddOns::V1::VERSION
|
795
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
796
|
+
|
797
|
+
header_params = {}
|
798
|
+
if request.name
|
799
|
+
header_params["name"] = request.name
|
800
|
+
end
|
801
|
+
|
802
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
803
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
804
|
+
|
805
|
+
options.apply_defaults timeout: @config.rpcs.install_deployment.timeout,
|
806
|
+
metadata: metadata,
|
807
|
+
retry_policy: @config.rpcs.install_deployment.retry_policy
|
808
|
+
|
809
|
+
options.apply_defaults timeout: @config.timeout,
|
810
|
+
metadata: @config.metadata,
|
811
|
+
retry_policy: @config.retry_policy
|
812
|
+
|
813
|
+
@g_suite_add_ons_stub.call_rpc :install_deployment, request, options: options do |response, operation|
|
814
|
+
yield response, operation if block_given?
|
815
|
+
return response
|
816
|
+
end
|
817
|
+
rescue ::GRPC::BadStatus => e
|
818
|
+
raise ::Google::Cloud::Error.from_error(e)
|
819
|
+
end
|
820
|
+
|
821
|
+
##
|
822
|
+
# Uninstalls a developer mode deployment.
|
823
|
+
# See:
|
824
|
+
# https://developers.google.com/gsuite/add-ons/how-tos/testing-gsuite-addons.
|
825
|
+
#
|
826
|
+
# @overload uninstall_deployment(request, options = nil)
|
827
|
+
# Pass arguments to `uninstall_deployment` via a request object, either of type
|
828
|
+
# {::Google::Cloud::GSuiteAddOns::V1::UninstallDeploymentRequest} or an equivalent Hash.
|
829
|
+
#
|
830
|
+
# @param request [::Google::Cloud::GSuiteAddOns::V1::UninstallDeploymentRequest, ::Hash]
|
831
|
+
# A request object representing the call parameters. Required. To specify no
|
832
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
833
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
834
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
835
|
+
#
|
836
|
+
# @overload uninstall_deployment(name: nil)
|
837
|
+
# Pass arguments to `uninstall_deployment` via keyword arguments. Note that at
|
838
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
839
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
840
|
+
#
|
841
|
+
# @param name [::String]
|
842
|
+
# Required. The full resource name of the deployment to install.
|
843
|
+
#
|
844
|
+
# Example: `projects/my_project/deployments/my_deployment`.
|
845
|
+
#
|
846
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
847
|
+
# @yieldparam response [::Google::Protobuf::Empty]
|
848
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
849
|
+
#
|
850
|
+
# @return [::Google::Protobuf::Empty]
|
851
|
+
#
|
852
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
853
|
+
#
|
854
|
+
# @example Basic example
|
855
|
+
# require "google/cloud/gsuite_add_ons/v1"
|
856
|
+
#
|
857
|
+
# # Create a client object. The client can be reused for multiple calls.
|
858
|
+
# client = Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Client.new
|
859
|
+
#
|
860
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
861
|
+
# request = Google::Cloud::GSuiteAddOns::V1::UninstallDeploymentRequest.new
|
862
|
+
#
|
863
|
+
# # Call the uninstall_deployment method.
|
864
|
+
# result = client.uninstall_deployment request
|
865
|
+
#
|
866
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
867
|
+
# p result
|
868
|
+
#
|
869
|
+
def uninstall_deployment request, options = nil
|
870
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
871
|
+
|
872
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GSuiteAddOns::V1::UninstallDeploymentRequest
|
873
|
+
|
874
|
+
# Converts hash and nil to an options object
|
875
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
876
|
+
|
877
|
+
# Customize the options with defaults
|
878
|
+
metadata = @config.rpcs.uninstall_deployment.metadata.to_h
|
879
|
+
|
880
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
881
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
882
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
883
|
+
gapic_version: ::Google::Cloud::GSuiteAddOns::V1::VERSION
|
884
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
885
|
+
|
886
|
+
header_params = {}
|
887
|
+
if request.name
|
888
|
+
header_params["name"] = request.name
|
889
|
+
end
|
890
|
+
|
891
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
892
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
893
|
+
|
894
|
+
options.apply_defaults timeout: @config.rpcs.uninstall_deployment.timeout,
|
895
|
+
metadata: metadata,
|
896
|
+
retry_policy: @config.rpcs.uninstall_deployment.retry_policy
|
897
|
+
|
898
|
+
options.apply_defaults timeout: @config.timeout,
|
899
|
+
metadata: @config.metadata,
|
900
|
+
retry_policy: @config.retry_policy
|
901
|
+
|
902
|
+
@g_suite_add_ons_stub.call_rpc :uninstall_deployment, request, options: options do |response, operation|
|
903
|
+
yield response, operation if block_given?
|
904
|
+
return response
|
905
|
+
end
|
906
|
+
rescue ::GRPC::BadStatus => e
|
907
|
+
raise ::Google::Cloud::Error.from_error(e)
|
908
|
+
end
|
909
|
+
|
910
|
+
##
|
911
|
+
# Fetches the install status of a developer mode deployment.
|
912
|
+
#
|
913
|
+
# @overload get_install_status(request, options = nil)
|
914
|
+
# Pass arguments to `get_install_status` via a request object, either of type
|
915
|
+
# {::Google::Cloud::GSuiteAddOns::V1::GetInstallStatusRequest} or an equivalent Hash.
|
916
|
+
#
|
917
|
+
# @param request [::Google::Cloud::GSuiteAddOns::V1::GetInstallStatusRequest, ::Hash]
|
918
|
+
# A request object representing the call parameters. Required. To specify no
|
919
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
920
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
921
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
922
|
+
#
|
923
|
+
# @overload get_install_status(name: nil)
|
924
|
+
# Pass arguments to `get_install_status` via keyword arguments. Note that at
|
925
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
926
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
927
|
+
#
|
928
|
+
# @param name [::String]
|
929
|
+
# Required. The full resource name of the deployment.
|
930
|
+
#
|
931
|
+
# Example: `projects/my_project/deployments/my_deployment/installStatus`.
|
932
|
+
#
|
933
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
934
|
+
# @yieldparam response [::Google::Cloud::GSuiteAddOns::V1::InstallStatus]
|
935
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
936
|
+
#
|
937
|
+
# @return [::Google::Cloud::GSuiteAddOns::V1::InstallStatus]
|
938
|
+
#
|
939
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
940
|
+
#
|
941
|
+
# @example Basic example
|
942
|
+
# require "google/cloud/gsuite_add_ons/v1"
|
943
|
+
#
|
944
|
+
# # Create a client object. The client can be reused for multiple calls.
|
945
|
+
# client = Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Client.new
|
946
|
+
#
|
947
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
948
|
+
# request = Google::Cloud::GSuiteAddOns::V1::GetInstallStatusRequest.new
|
949
|
+
#
|
950
|
+
# # Call the get_install_status method.
|
951
|
+
# result = client.get_install_status request
|
952
|
+
#
|
953
|
+
# # The returned object is of type Google::Cloud::GSuiteAddOns::V1::InstallStatus.
|
954
|
+
# p result
|
955
|
+
#
|
956
|
+
def get_install_status request, options = nil
|
957
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
958
|
+
|
959
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GSuiteAddOns::V1::GetInstallStatusRequest
|
960
|
+
|
961
|
+
# Converts hash and nil to an options object
|
962
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
963
|
+
|
964
|
+
# Customize the options with defaults
|
965
|
+
metadata = @config.rpcs.get_install_status.metadata.to_h
|
966
|
+
|
967
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
968
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
969
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
970
|
+
gapic_version: ::Google::Cloud::GSuiteAddOns::V1::VERSION
|
971
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
972
|
+
|
973
|
+
header_params = {}
|
974
|
+
if request.name
|
975
|
+
header_params["name"] = request.name
|
976
|
+
end
|
977
|
+
|
978
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
979
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
980
|
+
|
981
|
+
options.apply_defaults timeout: @config.rpcs.get_install_status.timeout,
|
982
|
+
metadata: metadata,
|
983
|
+
retry_policy: @config.rpcs.get_install_status.retry_policy
|
984
|
+
|
985
|
+
options.apply_defaults timeout: @config.timeout,
|
986
|
+
metadata: @config.metadata,
|
987
|
+
retry_policy: @config.retry_policy
|
988
|
+
|
989
|
+
@g_suite_add_ons_stub.call_rpc :get_install_status, request, options: options do |response, operation|
|
990
|
+
yield response, operation if block_given?
|
991
|
+
return response
|
992
|
+
end
|
993
|
+
rescue ::GRPC::BadStatus => e
|
994
|
+
raise ::Google::Cloud::Error.from_error(e)
|
995
|
+
end
|
996
|
+
|
997
|
+
##
|
998
|
+
# Configuration class for the GSuiteAddOns API.
|
999
|
+
#
|
1000
|
+
# This class represents the configuration for GSuiteAddOns,
|
1001
|
+
# providing control over timeouts, retry behavior, logging, transport
|
1002
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
1003
|
+
# applied individually to specific RPCs. See
|
1004
|
+
# {::Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Client::Configuration::Rpcs}
|
1005
|
+
# for a list of RPCs that can be configured independently.
|
1006
|
+
#
|
1007
|
+
# Configuration can be applied globally to all clients, or to a single client
|
1008
|
+
# on construction.
|
1009
|
+
#
|
1010
|
+
# @example
|
1011
|
+
#
|
1012
|
+
# # Modify the global config, setting the timeout for
|
1013
|
+
# # get_authorization to 20 seconds,
|
1014
|
+
# # and all remaining timeouts to 10 seconds.
|
1015
|
+
# ::Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Client.configure do |config|
|
1016
|
+
# config.timeout = 10.0
|
1017
|
+
# config.rpcs.get_authorization.timeout = 20.0
|
1018
|
+
# end
|
1019
|
+
#
|
1020
|
+
# # Apply the above configuration only to a new client.
|
1021
|
+
# client = ::Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Client.new do |config|
|
1022
|
+
# config.timeout = 10.0
|
1023
|
+
# config.rpcs.get_authorization.timeout = 20.0
|
1024
|
+
# end
|
1025
|
+
#
|
1026
|
+
# @!attribute [rw] endpoint
|
1027
|
+
# The hostname or hostname:port of the service endpoint.
|
1028
|
+
# Defaults to `"gsuiteaddons.googleapis.com"`.
|
1029
|
+
# @return [::String]
|
1030
|
+
# @!attribute [rw] credentials
|
1031
|
+
# Credentials to send with calls. You may provide any of the following types:
|
1032
|
+
# * (`String`) The path to a service account key file in JSON format
|
1033
|
+
# * (`Hash`) A service account key as a Hash
|
1034
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
1035
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
1036
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
1037
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
1038
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
1039
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
1040
|
+
# * (`nil`) indicating no credentials
|
1041
|
+
# @return [::Object]
|
1042
|
+
# @!attribute [rw] scope
|
1043
|
+
# The OAuth scopes
|
1044
|
+
# @return [::Array<::String>]
|
1045
|
+
# @!attribute [rw] lib_name
|
1046
|
+
# The library name as recorded in instrumentation and logging
|
1047
|
+
# @return [::String]
|
1048
|
+
# @!attribute [rw] lib_version
|
1049
|
+
# The library version as recorded in instrumentation and logging
|
1050
|
+
# @return [::String]
|
1051
|
+
# @!attribute [rw] channel_args
|
1052
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
1053
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
1054
|
+
# @return [::Hash]
|
1055
|
+
# @!attribute [rw] interceptors
|
1056
|
+
# An array of interceptors that are run before calls are executed.
|
1057
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
1058
|
+
# @!attribute [rw] timeout
|
1059
|
+
# The call timeout in seconds.
|
1060
|
+
# @return [::Numeric]
|
1061
|
+
# @!attribute [rw] metadata
|
1062
|
+
# Additional gRPC headers to be sent with the call.
|
1063
|
+
# @return [::Hash{::Symbol=>::String}]
|
1064
|
+
# @!attribute [rw] retry_policy
|
1065
|
+
# The retry policy. The value is a hash with the following keys:
|
1066
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
1067
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
1068
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
1069
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
1070
|
+
# trigger a retry.
|
1071
|
+
# @return [::Hash]
|
1072
|
+
# @!attribute [rw] quota_project
|
1073
|
+
# A separate project against which to charge quota.
|
1074
|
+
# @return [::String]
|
1075
|
+
#
|
1076
|
+
class Configuration
|
1077
|
+
extend ::Gapic::Config
|
1078
|
+
|
1079
|
+
config_attr :endpoint, "gsuiteaddons.googleapis.com", ::String
|
1080
|
+
config_attr :credentials, nil do |value|
|
1081
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
1082
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
1083
|
+
allowed.any? { |klass| klass === value }
|
1084
|
+
end
|
1085
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
1086
|
+
config_attr :lib_name, nil, ::String, nil
|
1087
|
+
config_attr :lib_version, nil, ::String, nil
|
1088
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
1089
|
+
config_attr :interceptors, nil, ::Array, nil
|
1090
|
+
config_attr :timeout, nil, ::Numeric, nil
|
1091
|
+
config_attr :metadata, nil, ::Hash, nil
|
1092
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1093
|
+
config_attr :quota_project, nil, ::String, nil
|
1094
|
+
|
1095
|
+
# @private
|
1096
|
+
def initialize parent_config = nil
|
1097
|
+
@parent_config = parent_config unless parent_config.nil?
|
1098
|
+
|
1099
|
+
yield self if block_given?
|
1100
|
+
end
|
1101
|
+
|
1102
|
+
##
|
1103
|
+
# Configurations for individual RPCs
|
1104
|
+
# @return [Rpcs]
|
1105
|
+
#
|
1106
|
+
def rpcs
|
1107
|
+
@rpcs ||= begin
|
1108
|
+
parent_rpcs = nil
|
1109
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
1110
|
+
Rpcs.new parent_rpcs
|
1111
|
+
end
|
1112
|
+
end
|
1113
|
+
|
1114
|
+
##
|
1115
|
+
# Configuration RPC class for the GSuiteAddOns API.
|
1116
|
+
#
|
1117
|
+
# Includes fields providing the configuration for each RPC in this service.
|
1118
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
1119
|
+
# the following configuration fields:
|
1120
|
+
#
|
1121
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
1122
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
1123
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
1124
|
+
# include the following keys:
|
1125
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
1126
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
1127
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
1128
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
1129
|
+
# trigger a retry.
|
1130
|
+
#
|
1131
|
+
class Rpcs
|
1132
|
+
##
|
1133
|
+
# RPC-specific configuration for `get_authorization`
|
1134
|
+
# @return [::Gapic::Config::Method]
|
1135
|
+
#
|
1136
|
+
attr_reader :get_authorization
|
1137
|
+
##
|
1138
|
+
# RPC-specific configuration for `create_deployment`
|
1139
|
+
# @return [::Gapic::Config::Method]
|
1140
|
+
#
|
1141
|
+
attr_reader :create_deployment
|
1142
|
+
##
|
1143
|
+
# RPC-specific configuration for `replace_deployment`
|
1144
|
+
# @return [::Gapic::Config::Method]
|
1145
|
+
#
|
1146
|
+
attr_reader :replace_deployment
|
1147
|
+
##
|
1148
|
+
# RPC-specific configuration for `get_deployment`
|
1149
|
+
# @return [::Gapic::Config::Method]
|
1150
|
+
#
|
1151
|
+
attr_reader :get_deployment
|
1152
|
+
##
|
1153
|
+
# RPC-specific configuration for `list_deployments`
|
1154
|
+
# @return [::Gapic::Config::Method]
|
1155
|
+
#
|
1156
|
+
attr_reader :list_deployments
|
1157
|
+
##
|
1158
|
+
# RPC-specific configuration for `delete_deployment`
|
1159
|
+
# @return [::Gapic::Config::Method]
|
1160
|
+
#
|
1161
|
+
attr_reader :delete_deployment
|
1162
|
+
##
|
1163
|
+
# RPC-specific configuration for `install_deployment`
|
1164
|
+
# @return [::Gapic::Config::Method]
|
1165
|
+
#
|
1166
|
+
attr_reader :install_deployment
|
1167
|
+
##
|
1168
|
+
# RPC-specific configuration for `uninstall_deployment`
|
1169
|
+
# @return [::Gapic::Config::Method]
|
1170
|
+
#
|
1171
|
+
attr_reader :uninstall_deployment
|
1172
|
+
##
|
1173
|
+
# RPC-specific configuration for `get_install_status`
|
1174
|
+
# @return [::Gapic::Config::Method]
|
1175
|
+
#
|
1176
|
+
attr_reader :get_install_status
|
1177
|
+
|
1178
|
+
# @private
|
1179
|
+
def initialize parent_rpcs = nil
|
1180
|
+
get_authorization_config = parent_rpcs.get_authorization if parent_rpcs.respond_to? :get_authorization
|
1181
|
+
@get_authorization = ::Gapic::Config::Method.new get_authorization_config
|
1182
|
+
create_deployment_config = parent_rpcs.create_deployment if parent_rpcs.respond_to? :create_deployment
|
1183
|
+
@create_deployment = ::Gapic::Config::Method.new create_deployment_config
|
1184
|
+
replace_deployment_config = parent_rpcs.replace_deployment if parent_rpcs.respond_to? :replace_deployment
|
1185
|
+
@replace_deployment = ::Gapic::Config::Method.new replace_deployment_config
|
1186
|
+
get_deployment_config = parent_rpcs.get_deployment if parent_rpcs.respond_to? :get_deployment
|
1187
|
+
@get_deployment = ::Gapic::Config::Method.new get_deployment_config
|
1188
|
+
list_deployments_config = parent_rpcs.list_deployments if parent_rpcs.respond_to? :list_deployments
|
1189
|
+
@list_deployments = ::Gapic::Config::Method.new list_deployments_config
|
1190
|
+
delete_deployment_config = parent_rpcs.delete_deployment if parent_rpcs.respond_to? :delete_deployment
|
1191
|
+
@delete_deployment = ::Gapic::Config::Method.new delete_deployment_config
|
1192
|
+
install_deployment_config = parent_rpcs.install_deployment if parent_rpcs.respond_to? :install_deployment
|
1193
|
+
@install_deployment = ::Gapic::Config::Method.new install_deployment_config
|
1194
|
+
uninstall_deployment_config = parent_rpcs.uninstall_deployment if parent_rpcs.respond_to? :uninstall_deployment
|
1195
|
+
@uninstall_deployment = ::Gapic::Config::Method.new uninstall_deployment_config
|
1196
|
+
get_install_status_config = parent_rpcs.get_install_status if parent_rpcs.respond_to? :get_install_status
|
1197
|
+
@get_install_status = ::Gapic::Config::Method.new get_install_status_config
|
1198
|
+
|
1199
|
+
yield self if block_given?
|
1200
|
+
end
|
1201
|
+
end
|
1202
|
+
end
|
1203
|
+
end
|
1204
|
+
end
|
1205
|
+
end
|
1206
|
+
end
|
1207
|
+
end
|
1208
|
+
end
|