google-cloud-gsuite_add_ons-v1 0.3.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +72 -99
- data/lib/google/cloud/gsuite_add_ons/v1/gsuite_add_ons/client.rb +41 -9
- data/lib/google/cloud/gsuite_add_ons/v1/gsuite_add_ons/rest/client.rb +181 -7
- data/lib/google/cloud/gsuite_add_ons/v1/gsuite_add_ons/rest/service_stub.rb +14 -2
- data/lib/google/cloud/gsuite_add_ons/v1/version.rb +1 -1
- data/proto_docs/google/api/client.rb +14 -0
- data/proto_docs/google/api/field_behavior.rb +14 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c7a6b2087a5b4a4b93d7a7d98764417702fdf66a1b4b0b79cf629aece9c997b
|
4
|
+
data.tar.gz: 97e5073ce452848b99a4ec02b136d812174f83a8cb6e9e50212ac01ee471f73c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 927daa3a18b8d4ef4f4c09d05810fa52e21c443da7752f668738d5a16017675cbe7635919a375583f33af54207bad832a8f8b8339946cc7fe4eb0d2346262e97
|
7
|
+
data.tar.gz: 7ab6b36144146252032d27c2789eaf2c452ec82ac633ea829f8de4c7ffb16c404ae9b2c698d3c16f622af8637a4ec392e4e456154994199593c237667529b6df
|
data/AUTHENTICATION.md
CHANGED
@@ -1,149 +1,122 @@
|
|
1
1
|
# Authentication
|
2
2
|
|
3
|
-
|
4
|
-
[
|
5
|
-
|
6
|
-
[Google Cloud Platform environments](#google-cloud-platform-environments) the
|
7
|
-
credentials will be discovered automatically. When running on other
|
8
|
-
environments, the Service Account credentials can be specified by providing the
|
9
|
-
path to the
|
10
|
-
[JSON keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys)
|
11
|
-
for the account (or the JSON itself) in
|
12
|
-
[environment variables](#environment-variables). Additionally, Cloud SDK
|
13
|
-
credentials can also be discovered automatically, but this is only recommended
|
14
|
-
during development.
|
3
|
+
The recommended way to authenticate to the google-cloud-gsuite_add_ons-v1 library is to use
|
4
|
+
[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials).
|
5
|
+
To review all of your authentication options, see [Credentials lookup](#credential-lookup).
|
15
6
|
|
16
7
|
## Quickstart
|
17
8
|
|
18
|
-
|
19
|
-
|
9
|
+
The following example shows how to set up authentication for a local development
|
10
|
+
environment with your user credentials.
|
20
11
|
|
21
|
-
|
22
|
-
|
23
|
-
```
|
24
|
-
|
25
|
-
3. Initialize the client.
|
12
|
+
**NOTE:** This method is _not_ recommended for running in production. User credentials
|
13
|
+
should be used only during development.
|
26
14
|
|
27
|
-
|
28
|
-
|
15
|
+
1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk).
|
16
|
+
2. Set up a local ADC file with your user credentials:
|
29
17
|
|
30
|
-
|
18
|
+
```sh
|
19
|
+
gcloud auth application-default login
|
31
20
|
```
|
32
21
|
|
33
|
-
|
34
|
-
|
35
|
-
The google-cloud-gsuite_add_ons-v1 library aims to make authentication
|
36
|
-
as simple as possible, and provides several mechanisms to configure your system
|
37
|
-
without requiring **Service Account Credentials** directly in code.
|
38
|
-
|
39
|
-
**Credentials** are discovered in the following order:
|
40
|
-
|
41
|
-
1. Specify credentials in method arguments
|
42
|
-
2. Specify credentials in configuration
|
43
|
-
3. Discover credentials path in environment variables
|
44
|
-
4. Discover credentials JSON in environment variables
|
45
|
-
5. Discover credentials file in the Cloud SDK's path
|
46
|
-
6. Discover GCP credentials
|
47
|
-
|
48
|
-
### Google Cloud Platform environments
|
22
|
+
3. Write code as if already authenticated.
|
49
23
|
|
50
|
-
|
51
|
-
|
52
|
-
Functions (GCF) and Cloud Run, **Credentials** are discovered automatically.
|
53
|
-
Code should be written as if already authenticated.
|
24
|
+
For more information about setting up authentication for a local development environment, see
|
25
|
+
[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev).
|
54
26
|
|
55
|
-
|
27
|
+
## Credential Lookup
|
56
28
|
|
57
|
-
The
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
**Credentials JSON** file can be stored in the environment variable, or the
|
62
|
-
**Credentials JSON** itself can be stored for environments such as Docker
|
63
|
-
containers where writing files is difficult or not encouraged.
|
29
|
+
The google-cloud-gsuite_add_ons-v1 library provides several mechanisms to configure your system.
|
30
|
+
Generally, using Application Default Credentials to facilitate automatic
|
31
|
+
credentials discovery is the easist method. But if you need to explicitly specify
|
32
|
+
credentials, there are several methods available to you.
|
64
33
|
|
65
|
-
|
66
|
-
checks for credentials are configured on the service Credentials class (such as
|
67
|
-
{::Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Credentials}):
|
34
|
+
Credentials are accepted in the following ways, in the following order or precedence:
|
68
35
|
|
69
|
-
|
70
|
-
|
71
|
-
|
36
|
+
1. Credentials specified in method arguments
|
37
|
+
2. Credentials specified in configuration
|
38
|
+
3. Credentials pointed to or included in environment variables
|
39
|
+
4. Credentials found in local ADC file
|
40
|
+
5. Credentials returned by the metadata server for the attached service account (GCP)
|
72
41
|
|
73
|
-
|
74
|
-
require "google/cloud/gsuite_add_ons/v1"
|
75
|
-
|
76
|
-
ENV["GOOGLE_CLOUD_CREDENTIALS"] = "path/to/keyfile.json"
|
42
|
+
### Configuration
|
77
43
|
|
78
|
-
client
|
79
|
-
|
44
|
+
You can configure a path to a JSON credentials file, either for an individual client object or
|
45
|
+
globally, for all client objects. The JSON file can contain credentials created for
|
46
|
+
[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation),
|
47
|
+
[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a
|
48
|
+
[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key).
|
80
49
|
|
81
|
-
|
50
|
+
Note: Service account keys are a security risk if not managed correctly. You should
|
51
|
+
[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree)
|
52
|
+
whenever possible.
|
82
53
|
|
83
|
-
|
84
|
-
it in an environment variable. Either on an individual client initialization:
|
54
|
+
To configure a credentials file for an individual client initialization:
|
85
55
|
|
86
56
|
```ruby
|
87
57
|
require "google/cloud/gsuite_add_ons/v1"
|
88
58
|
|
89
59
|
client = ::Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Client.new do |config|
|
90
|
-
config.credentials = "path/to/
|
60
|
+
config.credentials = "path/to/credentialfile.json"
|
91
61
|
end
|
92
62
|
```
|
93
63
|
|
94
|
-
|
64
|
+
To configure a credentials file globally for all clients:
|
95
65
|
|
96
66
|
```ruby
|
97
67
|
require "google/cloud/gsuite_add_ons/v1"
|
98
68
|
|
99
69
|
::Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Client.configure do |config|
|
100
|
-
config.credentials = "path/to/
|
70
|
+
config.credentials = "path/to/credentialfile.json"
|
101
71
|
end
|
102
72
|
|
103
73
|
client = ::Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Client.new
|
104
74
|
```
|
105
75
|
|
106
|
-
###
|
76
|
+
### Environment Variables
|
107
77
|
|
108
|
-
|
109
|
-
|
110
|
-
|
78
|
+
You can also use an environment variable to provide a JSON credentials file.
|
79
|
+
The environment variable can contain a path to the credentials file or, for
|
80
|
+
environments such as Docker containers where writing files is not encouraged,
|
81
|
+
you can include the credentials file itself.
|
111
82
|
|
112
|
-
|
83
|
+
The JSON file can contain credentials created for
|
84
|
+
[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation),
|
85
|
+
[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a
|
86
|
+
[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key).
|
113
87
|
|
114
|
-
|
115
|
-
|
116
|
-
|
88
|
+
Note: Service account keys are a security risk if not managed correctly. You should
|
89
|
+
[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree)
|
90
|
+
whenever possible.
|
91
|
+
|
92
|
+
The environment variables that google-cloud-gsuite_add_ons-v1
|
93
|
+
checks for credentials are:
|
117
94
|
|
118
|
-
|
119
|
-
*
|
95
|
+
* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
|
96
|
+
* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
|
120
97
|
|
121
|
-
|
98
|
+
```ruby
|
99
|
+
require "google/cloud/gsuite_add_ons/v1"
|
122
100
|
|
123
|
-
|
124
|
-
connect to the APIs. You will use the **JSON key file** to
|
125
|
-
connect to most services with google-cloud-gsuite_add_ons-v1.
|
101
|
+
ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json"
|
126
102
|
|
127
|
-
|
128
|
-
|
129
|
-
need a Google Developers service account.
|
103
|
+
client = ::Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Client.new
|
104
|
+
```
|
130
105
|
|
131
|
-
|
132
|
-
2. Create a new project or click on an existing project.
|
133
|
-
3. Activate the menu in the upper left and select **APIs & Services**. From
|
134
|
-
here, you will enable the APIs that your application requires.
|
106
|
+
### Local ADC file
|
135
107
|
|
136
|
-
|
108
|
+
You can set up a local ADC file with your user credentials for authentication during
|
109
|
+
development. If credentials are not provided in code or in environment variables,
|
110
|
+
then the local ADC credentials are discovered.
|
137
111
|
|
138
|
-
|
112
|
+
Follow the steps in [Quickstart](#quickstart) to set up a local ADC file.
|
139
113
|
|
140
|
-
|
141
|
-
"Service account" to be guided through downloading a new JSON key file.
|
114
|
+
### Google Cloud Platform environments
|
142
115
|
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
116
|
+
When running on Google Cloud Platform (GCP), including Google Compute Engine
|
117
|
+
(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud
|
118
|
+
Functions (GCF) and Cloud Run, credentials are retrieved from the attached
|
119
|
+
service account automatically. Code should be written as if already authenticated.
|
147
120
|
|
148
|
-
|
149
|
-
|
121
|
+
For more information, see
|
122
|
+
[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa).
|
@@ -57,6 +57,9 @@ module Google
|
|
57
57
|
# for details.
|
58
58
|
#
|
59
59
|
class Client
|
60
|
+
# @private
|
61
|
+
DEFAULT_ENDPOINT_TEMPLATE = "gsuiteaddons.$UNIVERSE_DOMAIN$"
|
62
|
+
|
60
63
|
include Paths
|
61
64
|
|
62
65
|
# @private
|
@@ -128,6 +131,15 @@ module Google
|
|
128
131
|
@config
|
129
132
|
end
|
130
133
|
|
134
|
+
##
|
135
|
+
# The effective universe domain
|
136
|
+
#
|
137
|
+
# @return [String]
|
138
|
+
#
|
139
|
+
def universe_domain
|
140
|
+
@g_suite_add_ons_stub.universe_domain
|
141
|
+
end
|
142
|
+
|
131
143
|
##
|
132
144
|
# Create a new GSuiteAddOns client object.
|
133
145
|
#
|
@@ -161,8 +173,9 @@ module Google
|
|
161
173
|
credentials = @config.credentials
|
162
174
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
163
175
|
# but only if the default endpoint does not have a region prefix.
|
164
|
-
enable_self_signed_jwt = @config.endpoint
|
165
|
-
|
176
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
177
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
178
|
+
!@config.endpoint.split(".").first.include?("-"))
|
166
179
|
credentials ||= Credentials.default scope: @config.scope,
|
167
180
|
enable_self_signed_jwt: enable_self_signed_jwt
|
168
181
|
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
@@ -173,10 +186,13 @@ module Google
|
|
173
186
|
|
174
187
|
@g_suite_add_ons_stub = ::Gapic::ServiceStub.new(
|
175
188
|
::Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Stub,
|
176
|
-
credentials:
|
177
|
-
endpoint:
|
189
|
+
credentials: credentials,
|
190
|
+
endpoint: @config.endpoint,
|
191
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
192
|
+
universe_domain: @config.universe_domain,
|
178
193
|
channel_args: @config.channel_args,
|
179
|
-
interceptors: @config.interceptors
|
194
|
+
interceptors: @config.interceptors,
|
195
|
+
channel_pool_config: @config.channel_pool
|
180
196
|
)
|
181
197
|
end
|
182
198
|
|
@@ -1022,9 +1038,9 @@ module Google
|
|
1022
1038
|
# end
|
1023
1039
|
#
|
1024
1040
|
# @!attribute [rw] endpoint
|
1025
|
-
#
|
1026
|
-
#
|
1027
|
-
# @return [::String]
|
1041
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
1042
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
1043
|
+
# @return [::String,nil]
|
1028
1044
|
# @!attribute [rw] credentials
|
1029
1045
|
# Credentials to send with calls. You may provide any of the following types:
|
1030
1046
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -1070,13 +1086,20 @@ module Google
|
|
1070
1086
|
# @!attribute [rw] quota_project
|
1071
1087
|
# A separate project against which to charge quota.
|
1072
1088
|
# @return [::String]
|
1089
|
+
# @!attribute [rw] universe_domain
|
1090
|
+
# The universe domain within which to make requests. This determines the
|
1091
|
+
# default endpoint URL. The default value of nil uses the environment
|
1092
|
+
# universe (usually the default "googleapis.com" universe).
|
1093
|
+
# @return [::String,nil]
|
1073
1094
|
#
|
1074
1095
|
class Configuration
|
1075
1096
|
extend ::Gapic::Config
|
1076
1097
|
|
1098
|
+
# @private
|
1099
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
1077
1100
|
DEFAULT_ENDPOINT = "gsuiteaddons.googleapis.com"
|
1078
1101
|
|
1079
|
-
config_attr :endpoint,
|
1102
|
+
config_attr :endpoint, nil, ::String, nil
|
1080
1103
|
config_attr :credentials, nil do |value|
|
1081
1104
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
1082
1105
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
@@ -1091,6 +1114,7 @@ module Google
|
|
1091
1114
|
config_attr :metadata, nil, ::Hash, nil
|
1092
1115
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1093
1116
|
config_attr :quota_project, nil, ::String, nil
|
1117
|
+
config_attr :universe_domain, nil, ::String, nil
|
1094
1118
|
|
1095
1119
|
# @private
|
1096
1120
|
def initialize parent_config = nil
|
@@ -1111,6 +1135,14 @@ module Google
|
|
1111
1135
|
end
|
1112
1136
|
end
|
1113
1137
|
|
1138
|
+
##
|
1139
|
+
# Configuration for the channel pool
|
1140
|
+
# @return [::Gapic::ServiceStub::ChannelPool::Configuration]
|
1141
|
+
#
|
1142
|
+
def channel_pool
|
1143
|
+
@channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
|
1144
|
+
end
|
1145
|
+
|
1114
1146
|
##
|
1115
1147
|
# Configuration RPC class for the GSuiteAddOns API.
|
1116
1148
|
#
|
@@ -59,6 +59,9 @@ module Google
|
|
59
59
|
# for details.
|
60
60
|
#
|
61
61
|
class Client
|
62
|
+
# @private
|
63
|
+
DEFAULT_ENDPOINT_TEMPLATE = "gsuiteaddons.$UNIVERSE_DOMAIN$"
|
64
|
+
|
62
65
|
include Paths
|
63
66
|
|
64
67
|
# @private
|
@@ -130,6 +133,15 @@ module Google
|
|
130
133
|
@config
|
131
134
|
end
|
132
135
|
|
136
|
+
##
|
137
|
+
# The effective universe domain
|
138
|
+
#
|
139
|
+
# @return [String]
|
140
|
+
#
|
141
|
+
def universe_domain
|
142
|
+
@g_suite_add_ons_stub.universe_domain
|
143
|
+
end
|
144
|
+
|
133
145
|
##
|
134
146
|
# Create a new GSuiteAddOns REST client object.
|
135
147
|
#
|
@@ -157,8 +169,9 @@ module Google
|
|
157
169
|
credentials = @config.credentials
|
158
170
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
159
171
|
# but only if the default endpoint does not have a region prefix.
|
160
|
-
enable_self_signed_jwt = @config.endpoint
|
161
|
-
|
172
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
173
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
174
|
+
!@config.endpoint.split(".").first.include?("-"))
|
162
175
|
credentials ||= Credentials.default scope: @config.scope,
|
163
176
|
enable_self_signed_jwt: enable_self_signed_jwt
|
164
177
|
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
@@ -168,7 +181,12 @@ module Google
|
|
168
181
|
@quota_project_id = @config.quota_project
|
169
182
|
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
170
183
|
|
171
|
-
@g_suite_add_ons_stub = ::Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Rest::ServiceStub.new
|
184
|
+
@g_suite_add_ons_stub = ::Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Rest::ServiceStub.new(
|
185
|
+
endpoint: @config.endpoint,
|
186
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
187
|
+
universe_domain: @config.universe_domain,
|
188
|
+
credentials: credentials
|
189
|
+
)
|
172
190
|
end
|
173
191
|
|
174
192
|
# Service calls
|
@@ -203,6 +221,22 @@ module Google
|
|
203
221
|
# @return [::Google::Cloud::GSuiteAddOns::V1::Authorization]
|
204
222
|
#
|
205
223
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
224
|
+
#
|
225
|
+
# @example Basic example
|
226
|
+
# require "google/cloud/gsuite_add_ons/v1"
|
227
|
+
#
|
228
|
+
# # Create a client object. The client can be reused for multiple calls.
|
229
|
+
# client = Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Rest::Client.new
|
230
|
+
#
|
231
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
232
|
+
# request = Google::Cloud::GSuiteAddOns::V1::GetAuthorizationRequest.new
|
233
|
+
#
|
234
|
+
# # Call the get_authorization method.
|
235
|
+
# result = client.get_authorization request
|
236
|
+
#
|
237
|
+
# # The returned object is of type Google::Cloud::GSuiteAddOns::V1::Authorization.
|
238
|
+
# p result
|
239
|
+
#
|
206
240
|
def get_authorization request, options = nil
|
207
241
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
208
242
|
|
@@ -272,6 +306,22 @@ module Google
|
|
272
306
|
# @return [::Google::Cloud::GSuiteAddOns::V1::Deployment]
|
273
307
|
#
|
274
308
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
309
|
+
#
|
310
|
+
# @example Basic example
|
311
|
+
# require "google/cloud/gsuite_add_ons/v1"
|
312
|
+
#
|
313
|
+
# # Create a client object. The client can be reused for multiple calls.
|
314
|
+
# client = Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Rest::Client.new
|
315
|
+
#
|
316
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
317
|
+
# request = Google::Cloud::GSuiteAddOns::V1::CreateDeploymentRequest.new
|
318
|
+
#
|
319
|
+
# # Call the create_deployment method.
|
320
|
+
# result = client.create_deployment request
|
321
|
+
#
|
322
|
+
# # The returned object is of type Google::Cloud::GSuiteAddOns::V1::Deployment.
|
323
|
+
# p result
|
324
|
+
#
|
275
325
|
def create_deployment request, options = nil
|
276
326
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
277
327
|
|
@@ -334,6 +384,22 @@ module Google
|
|
334
384
|
# @return [::Google::Cloud::GSuiteAddOns::V1::Deployment]
|
335
385
|
#
|
336
386
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
387
|
+
#
|
388
|
+
# @example Basic example
|
389
|
+
# require "google/cloud/gsuite_add_ons/v1"
|
390
|
+
#
|
391
|
+
# # Create a client object. The client can be reused for multiple calls.
|
392
|
+
# client = Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Rest::Client.new
|
393
|
+
#
|
394
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
395
|
+
# request = Google::Cloud::GSuiteAddOns::V1::ReplaceDeploymentRequest.new
|
396
|
+
#
|
397
|
+
# # Call the replace_deployment method.
|
398
|
+
# result = client.replace_deployment request
|
399
|
+
#
|
400
|
+
# # The returned object is of type Google::Cloud::GSuiteAddOns::V1::Deployment.
|
401
|
+
# p result
|
402
|
+
#
|
337
403
|
def replace_deployment request, options = nil
|
338
404
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
339
405
|
|
@@ -398,6 +464,22 @@ module Google
|
|
398
464
|
# @return [::Google::Cloud::GSuiteAddOns::V1::Deployment]
|
399
465
|
#
|
400
466
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
467
|
+
#
|
468
|
+
# @example Basic example
|
469
|
+
# require "google/cloud/gsuite_add_ons/v1"
|
470
|
+
#
|
471
|
+
# # Create a client object. The client can be reused for multiple calls.
|
472
|
+
# client = Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Rest::Client.new
|
473
|
+
#
|
474
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
475
|
+
# request = Google::Cloud::GSuiteAddOns::V1::GetDeploymentRequest.new
|
476
|
+
#
|
477
|
+
# # Call the get_deployment method.
|
478
|
+
# result = client.get_deployment request
|
479
|
+
#
|
480
|
+
# # The returned object is of type Google::Cloud::GSuiteAddOns::V1::Deployment.
|
481
|
+
# p result
|
482
|
+
#
|
401
483
|
def get_deployment request, options = nil
|
402
484
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
403
485
|
|
@@ -473,6 +555,26 @@ module Google
|
|
473
555
|
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GSuiteAddOns::V1::Deployment>]
|
474
556
|
#
|
475
557
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
558
|
+
#
|
559
|
+
# @example Basic example
|
560
|
+
# require "google/cloud/gsuite_add_ons/v1"
|
561
|
+
#
|
562
|
+
# # Create a client object. The client can be reused for multiple calls.
|
563
|
+
# client = Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Rest::Client.new
|
564
|
+
#
|
565
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
566
|
+
# request = Google::Cloud::GSuiteAddOns::V1::ListDeploymentsRequest.new
|
567
|
+
#
|
568
|
+
# # Call the list_deployments method.
|
569
|
+
# result = client.list_deployments request
|
570
|
+
#
|
571
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
572
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
573
|
+
# result.each do |item|
|
574
|
+
# # Each element is of type ::Google::Cloud::GSuiteAddOns::V1::Deployment.
|
575
|
+
# p item
|
576
|
+
# end
|
577
|
+
#
|
476
578
|
def list_deployments request, options = nil
|
477
579
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
478
580
|
|
@@ -541,6 +643,22 @@ module Google
|
|
541
643
|
# @return [::Google::Protobuf::Empty]
|
542
644
|
#
|
543
645
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
646
|
+
#
|
647
|
+
# @example Basic example
|
648
|
+
# require "google/cloud/gsuite_add_ons/v1"
|
649
|
+
#
|
650
|
+
# # Create a client object. The client can be reused for multiple calls.
|
651
|
+
# client = Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Rest::Client.new
|
652
|
+
#
|
653
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
654
|
+
# request = Google::Cloud::GSuiteAddOns::V1::DeleteDeploymentRequest.new
|
655
|
+
#
|
656
|
+
# # Call the delete_deployment method.
|
657
|
+
# result = client.delete_deployment request
|
658
|
+
#
|
659
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
660
|
+
# p result
|
661
|
+
#
|
544
662
|
def delete_deployment request, options = nil
|
545
663
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
546
664
|
|
@@ -607,6 +725,22 @@ module Google
|
|
607
725
|
# @return [::Google::Protobuf::Empty]
|
608
726
|
#
|
609
727
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
728
|
+
#
|
729
|
+
# @example Basic example
|
730
|
+
# require "google/cloud/gsuite_add_ons/v1"
|
731
|
+
#
|
732
|
+
# # Create a client object. The client can be reused for multiple calls.
|
733
|
+
# client = Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Rest::Client.new
|
734
|
+
#
|
735
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
736
|
+
# request = Google::Cloud::GSuiteAddOns::V1::InstallDeploymentRequest.new
|
737
|
+
#
|
738
|
+
# # Call the install_deployment method.
|
739
|
+
# result = client.install_deployment request
|
740
|
+
#
|
741
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
742
|
+
# p result
|
743
|
+
#
|
610
744
|
def install_deployment request, options = nil
|
611
745
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
612
746
|
|
@@ -673,6 +807,22 @@ module Google
|
|
673
807
|
# @return [::Google::Protobuf::Empty]
|
674
808
|
#
|
675
809
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
810
|
+
#
|
811
|
+
# @example Basic example
|
812
|
+
# require "google/cloud/gsuite_add_ons/v1"
|
813
|
+
#
|
814
|
+
# # Create a client object. The client can be reused for multiple calls.
|
815
|
+
# client = Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Rest::Client.new
|
816
|
+
#
|
817
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
818
|
+
# request = Google::Cloud::GSuiteAddOns::V1::UninstallDeploymentRequest.new
|
819
|
+
#
|
820
|
+
# # Call the uninstall_deployment method.
|
821
|
+
# result = client.uninstall_deployment request
|
822
|
+
#
|
823
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
824
|
+
# p result
|
825
|
+
#
|
676
826
|
def uninstall_deployment request, options = nil
|
677
827
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
678
828
|
|
@@ -737,6 +887,22 @@ module Google
|
|
737
887
|
# @return [::Google::Cloud::GSuiteAddOns::V1::InstallStatus]
|
738
888
|
#
|
739
889
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
890
|
+
#
|
891
|
+
# @example Basic example
|
892
|
+
# require "google/cloud/gsuite_add_ons/v1"
|
893
|
+
#
|
894
|
+
# # Create a client object. The client can be reused for multiple calls.
|
895
|
+
# client = Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Rest::Client.new
|
896
|
+
#
|
897
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
898
|
+
# request = Google::Cloud::GSuiteAddOns::V1::GetInstallStatusRequest.new
|
899
|
+
#
|
900
|
+
# # Call the get_install_status method.
|
901
|
+
# result = client.get_install_status request
|
902
|
+
#
|
903
|
+
# # The returned object is of type Google::Cloud::GSuiteAddOns::V1::InstallStatus.
|
904
|
+
# p result
|
905
|
+
#
|
740
906
|
def get_install_status request, options = nil
|
741
907
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
742
908
|
|
@@ -802,9 +968,9 @@ module Google
|
|
802
968
|
# end
|
803
969
|
#
|
804
970
|
# @!attribute [rw] endpoint
|
805
|
-
#
|
806
|
-
#
|
807
|
-
# @return [::String]
|
971
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
972
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
973
|
+
# @return [::String,nil]
|
808
974
|
# @!attribute [rw] credentials
|
809
975
|
# Credentials to send with calls. You may provide any of the following types:
|
810
976
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -841,13 +1007,20 @@ module Google
|
|
841
1007
|
# @!attribute [rw] quota_project
|
842
1008
|
# A separate project against which to charge quota.
|
843
1009
|
# @return [::String]
|
1010
|
+
# @!attribute [rw] universe_domain
|
1011
|
+
# The universe domain within which to make requests. This determines the
|
1012
|
+
# default endpoint URL. The default value of nil uses the environment
|
1013
|
+
# universe (usually the default "googleapis.com" universe).
|
1014
|
+
# @return [::String,nil]
|
844
1015
|
#
|
845
1016
|
class Configuration
|
846
1017
|
extend ::Gapic::Config
|
847
1018
|
|
1019
|
+
# @private
|
1020
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
848
1021
|
DEFAULT_ENDPOINT = "gsuiteaddons.googleapis.com"
|
849
1022
|
|
850
|
-
config_attr :endpoint,
|
1023
|
+
config_attr :endpoint, nil, ::String, nil
|
851
1024
|
config_attr :credentials, nil do |value|
|
852
1025
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
853
1026
|
allowed.any? { |klass| klass === value }
|
@@ -859,6 +1032,7 @@ module Google
|
|
859
1032
|
config_attr :metadata, nil, ::Hash, nil
|
860
1033
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
861
1034
|
config_attr :quota_project, nil, ::String, nil
|
1035
|
+
config_attr :universe_domain, nil, ::String, nil
|
862
1036
|
|
863
1037
|
# @private
|
864
1038
|
def initialize parent_config = nil
|
@@ -30,16 +30,28 @@ module Google
|
|
30
30
|
# including transcoding, making the REST call, and deserialing the response.
|
31
31
|
#
|
32
32
|
class ServiceStub
|
33
|
-
def initialize endpoint:, credentials:
|
33
|
+
def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
|
34
34
|
# These require statements are intentionally placed here to initialize
|
35
35
|
# the REST modules only when it's required.
|
36
36
|
require "gapic/rest"
|
37
37
|
|
38
|
-
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
|
38
|
+
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
|
39
|
+
endpoint_template: endpoint_template,
|
40
|
+
universe_domain: universe_domain,
|
41
|
+
credentials: credentials,
|
39
42
|
numeric_enums: true,
|
40
43
|
raise_faraday_errors: false
|
41
44
|
end
|
42
45
|
|
46
|
+
##
|
47
|
+
# The effective universe domain
|
48
|
+
#
|
49
|
+
# @return [String]
|
50
|
+
#
|
51
|
+
def universe_domain
|
52
|
+
@client_stub.universe_domain
|
53
|
+
end
|
54
|
+
|
43
55
|
##
|
44
56
|
# Baseline implementation for the get_authorization REST call
|
45
57
|
#
|
@@ -21,6 +21,7 @@ module Google
|
|
21
21
|
module Api
|
22
22
|
# Required information for every language.
|
23
23
|
# @!attribute [rw] reference_docs_uri
|
24
|
+
# @deprecated This field is deprecated and may be removed in the next major version update.
|
24
25
|
# @return [::String]
|
25
26
|
# Link to automatically generated reference documentation. Example:
|
26
27
|
# https://cloud.google.com/nodejs/docs/reference/asset/latest
|
@@ -304,6 +305,19 @@ module Google
|
|
304
305
|
# seconds: 360 # 6 minutes
|
305
306
|
# total_poll_timeout:
|
306
307
|
# seconds: 54000 # 90 minutes
|
308
|
+
# @!attribute [rw] auto_populated_fields
|
309
|
+
# @return [::Array<::String>]
|
310
|
+
# List of top-level fields of the request message, that should be
|
311
|
+
# automatically populated by the client libraries based on their
|
312
|
+
# (google.api.field_info).format. Currently supported format: UUID4.
|
313
|
+
#
|
314
|
+
# Example of a YAML configuration:
|
315
|
+
#
|
316
|
+
# publishing:
|
317
|
+
# method_settings:
|
318
|
+
# - selector: google.example.v1.ExampleService.CreateExample
|
319
|
+
# auto_populated_fields:
|
320
|
+
# - request_id
|
307
321
|
class MethodSettings
|
308
322
|
include ::Google::Protobuf::MessageExts
|
309
323
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -66,6 +66,20 @@ module Google
|
|
66
66
|
# a non-empty value will be returned. The user will not be aware of what
|
67
67
|
# non-empty value to expect.
|
68
68
|
NON_EMPTY_DEFAULT = 7
|
69
|
+
|
70
|
+
# Denotes that the field in a resource (a message annotated with
|
71
|
+
# google.api.resource) is used in the resource name to uniquely identify the
|
72
|
+
# resource. For AIP-compliant APIs, this should only be applied to the
|
73
|
+
# `name` field on the resource.
|
74
|
+
#
|
75
|
+
# This behavior should not be applied to references to other resources within
|
76
|
+
# the message.
|
77
|
+
#
|
78
|
+
# The identifier field of resources often have different field behavior
|
79
|
+
# depending on the request it is embedded in (e.g. for Create methods name
|
80
|
+
# is optional and unused, while for Update methods it is required). Instead
|
81
|
+
# of method-specific annotations, only `IDENTIFIER` is required.
|
82
|
+
IDENTIFIER = 8
|
69
83
|
end
|
70
84
|
end
|
71
85
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-gsuite_add_ons-v1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gapic-common
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.21.1
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: 2.a
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.
|
29
|
+
version: 0.21.1
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 2.a
|
@@ -240,7 +240,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
240
240
|
- !ruby/object:Gem::Version
|
241
241
|
version: '0'
|
242
242
|
requirements: []
|
243
|
-
rubygems_version: 3.
|
243
|
+
rubygems_version: 3.5.3
|
244
244
|
signing_key:
|
245
245
|
specification_version: 4
|
246
246
|
summary: API Client library for the Google Workspace Add-ons V1 API
|