google-cloud-notebooks-v2 0.1.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6603839dc6c5ae9e8f63be2fb2bed148b4f4b806ec7ae6bec95f5e4be24d8333
4
- data.tar.gz: c86a63739a0c1e37db99da248c7856b523fa11b7ecd4bd7cbbc0f61cd60262b5
3
+ metadata.gz: 29226206c005072f296ebc31670aff1bef706670f7a970c606f2f149cf8652b6
4
+ data.tar.gz: 528ed70f600596bde0505adf303dc965fe9e8876de862b885cb334ccb91a4e8b
5
5
  SHA512:
6
- metadata.gz: e78f9869568fa647b059f986895f6e52b019bbba9958498763e640ef60754a050a0349180e1ba0d89867d8062ee0ffee74d53f6431f8158789948cb9af5d7fe0
7
- data.tar.gz: 624a84c41572a2c2e2ecdc1c3d08aaf27328c4f79ba34fc2f030516b6edea8038cbb15235d355ed902841d97f5b7be47c35ed8fb7799bd55971694e94a9db479
6
+ metadata.gz: 8b27b5d398c8b05af24fd83b95b98929f0de6dd7c7037304db64665d2c2fae47d20d27098938026d2fb578aa4533c9807750694ce70d41fd49690d9c0cde6961
7
+ data.tar.gz: c7e175901e5822359751a0f838a0fad6be2e32b72301aa80a0f346f50d4e90a49c0929e51f872d12b394dda0f6520d6df8e97a6b4553bd6ec5bc235fcc382242
data/AUTHENTICATION.md CHANGED
@@ -1,149 +1,122 @@
1
1
  # Authentication
2
2
 
3
- In general, the google-cloud-notebooks-v2 library uses
4
- [Service Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts)
5
- credentials to connect to Google Cloud services. When running within
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-notebooks-v2 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
- 1. [Create a service account and credentials](#creating-a-service-account).
19
- 2. Set the [environment variable](#environment-variables).
9
+ The following example shows how to set up authentication for a local development
10
+ environment with your user credentials.
20
11
 
21
- ```sh
22
- export GOOGLE_CLOUD_CREDENTIALS=path/to/keyfile.json
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
- ```ruby
28
- require "google/cloud/notebooks/v2"
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
- client = ::Google::Cloud::Notebooks::V2::NotebookService::Client.new
18
+ ```sh
19
+ gcloud auth application-default login
31
20
  ```
32
21
 
33
- ## Credential Lookup
34
-
35
- The google-cloud-notebooks-v2 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
- When running on Google Cloud Platform (GCP), including Google Compute Engine
51
- (GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud
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
- ### Environment Variables
27
+ ## Credential Lookup
56
28
 
57
- The **Credentials JSON** can be placed in environment variables instead of
58
- declaring them directly in code. Each service has its own environment variable,
59
- allowing for different service accounts to be used for different services. (See
60
- the READMEs for the individual service gems for details.) The path to the
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-notebooks-v2 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
- The environment variables that google-cloud-notebooks-v2
66
- checks for credentials are configured on the service Credentials class (such as
67
- {::Google::Cloud::Notebooks::V2::NotebookService::Credentials}):
34
+ Credentials are accepted in the following ways, in the following order or precedence:
68
35
 
69
- * `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
70
- * `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
71
- * `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
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
- ```ruby
74
- require "google/cloud/notebooks/v2"
75
-
76
- ENV["GOOGLE_CLOUD_CREDENTIALS"] = "path/to/keyfile.json"
42
+ ### Configuration
77
43
 
78
- client = ::Google::Cloud::Notebooks::V2::NotebookService::Client.new
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
- ### Configuration
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
- The path to the **Credentials JSON** file can be configured instead of storing
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/notebooks/v2"
88
58
 
89
59
  client = ::Google::Cloud::Notebooks::V2::NotebookService::Client.new do |config|
90
- config.credentials = "path/to/keyfile.json"
60
+ config.credentials = "path/to/credentialfile.json"
91
61
  end
92
62
  ```
93
63
 
94
- Or globally for all clients:
64
+ To configure a credentials file globally for all clients:
95
65
 
96
66
  ```ruby
97
67
  require "google/cloud/notebooks/v2"
98
68
 
99
69
  ::Google::Cloud::Notebooks::V2::NotebookService::Client.configure do |config|
100
- config.credentials = "path/to/keyfile.json"
70
+ config.credentials = "path/to/credentialfile.json"
101
71
  end
102
72
 
103
73
  client = ::Google::Cloud::Notebooks::V2::NotebookService::Client.new
104
74
  ```
105
75
 
106
- ### Cloud SDK
76
+ ### Environment Variables
107
77
 
108
- This option allows for an easy way to authenticate during development. If
109
- credentials are not provided in code or in environment variables, then Cloud SDK
110
- credentials are discovered.
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
- To configure your system for this, simply:
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
- 1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
115
- 2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login`
116
- 3. Write code as if already authenticated.
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-notebooks-v2
93
+ checks for credentials are:
117
94
 
118
- **NOTE:** This is _not_ recommended for running in production. The Cloud SDK
119
- *should* only be used during development.
95
+ * `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
96
+ * `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
120
97
 
121
- ## Creating a Service Account
98
+ ```ruby
99
+ require "google/cloud/notebooks/v2"
122
100
 
123
- Google Cloud requires **Service Account Credentials** to
124
- connect to the APIs. You will use the **JSON key file** to
125
- connect to most services with google-cloud-notebooks-v2.
101
+ ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json"
126
102
 
127
- If you are not running this client within
128
- [Google Cloud Platform environments](#google-cloud-platform-environments), you
129
- need a Google Developers service account.
103
+ client = ::Google::Cloud::Notebooks::V2::NotebookService::Client.new
104
+ ```
130
105
 
131
- 1. Visit the [Google Cloud Console](https://console.cloud.google.com/project).
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
- *Note: You may need to enable billing in order to use these services.*
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
- 4. Select **Credentials** from the side navigation.
112
+ Follow the steps in [Quickstart](#quickstart) to set up a local ADC file.
139
113
 
140
- Find the "Create credentials" drop down near the top of the page, and select
141
- "Service account" to be guided through downloading a new JSON key file.
114
+ ### Google Cloud Platform environments
142
115
 
143
- If you want to re-use an existing service account, you can easily generate a
144
- new key file. Just select the account you wish to re-use, click the pencil
145
- tool on the right side to edit the service account, select the **Keys** tab,
146
- and then select **Add Key**.
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
- The key file you download will be used by this library to authenticate API
149
- requests and should be stored in a secure location.
121
+ For more information, see
122
+ [Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa).
@@ -32,6 +32,9 @@ module Google
32
32
  # API v2 service for Workbench Notebooks Instances.
33
33
  #
34
34
  class Client
35
+ # @private
36
+ DEFAULT_ENDPOINT_TEMPLATE = "notebooks.$UNIVERSE_DOMAIN$"
37
+
35
38
  include Paths
36
39
 
37
40
  # @private
@@ -115,6 +118,15 @@ module Google
115
118
  @config
116
119
  end
117
120
 
121
+ ##
122
+ # The effective universe domain
123
+ #
124
+ # @return [String]
125
+ #
126
+ def universe_domain
127
+ @notebook_service_stub.universe_domain
128
+ end
129
+
118
130
  ##
119
131
  # Create a new NotebookService client object.
120
132
  #
@@ -148,8 +160,9 @@ module Google
148
160
  credentials = @config.credentials
149
161
  # Use self-signed JWT if the endpoint is unchanged from default,
150
162
  # but only if the default endpoint does not have a region prefix.
151
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
152
- !@config.endpoint.split(".").first.include?("-")
163
+ enable_self_signed_jwt = @config.endpoint.nil? ||
164
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
165
+ !@config.endpoint.split(".").first.include?("-"))
153
166
  credentials ||= Credentials.default scope: @config.scope,
154
167
  enable_self_signed_jwt: enable_self_signed_jwt
155
168
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -162,26 +175,32 @@ module Google
162
175
  config.credentials = credentials
163
176
  config.quota_project = @quota_project_id
164
177
  config.endpoint = @config.endpoint
178
+ config.universe_domain = @config.universe_domain
165
179
  end
166
180
 
167
181
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
168
182
  config.credentials = credentials
169
183
  config.quota_project = @quota_project_id
170
184
  config.endpoint = @config.endpoint
185
+ config.universe_domain = @config.universe_domain
171
186
  end
172
187
 
173
188
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
174
189
  config.credentials = credentials
175
190
  config.quota_project = @quota_project_id
176
191
  config.endpoint = @config.endpoint
192
+ config.universe_domain = @config.universe_domain
177
193
  end
178
194
 
179
195
  @notebook_service_stub = ::Gapic::ServiceStub.new(
180
196
  ::Google::Cloud::Notebooks::V2::NotebookService::Stub,
181
- credentials: credentials,
182
- endpoint: @config.endpoint,
197
+ credentials: credentials,
198
+ endpoint: @config.endpoint,
199
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
200
+ universe_domain: @config.universe_domain,
183
201
  channel_args: @config.channel_args,
184
- interceptors: @config.interceptors
202
+ interceptors: @config.interceptors,
203
+ channel_pool_config: @config.channel_pool
185
204
  )
186
205
  end
187
206
 
@@ -1375,9 +1394,9 @@ module Google
1375
1394
  # end
1376
1395
  #
1377
1396
  # @!attribute [rw] endpoint
1378
- # The hostname or hostname:port of the service endpoint.
1379
- # Defaults to `"notebooks.googleapis.com"`.
1380
- # @return [::String]
1397
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1398
+ # nil, indicating to use the default endpoint in the current universe domain.
1399
+ # @return [::String,nil]
1381
1400
  # @!attribute [rw] credentials
1382
1401
  # Credentials to send with calls. You may provide any of the following types:
1383
1402
  # * (`String`) The path to a service account key file in JSON format
@@ -1423,13 +1442,20 @@ module Google
1423
1442
  # @!attribute [rw] quota_project
1424
1443
  # A separate project against which to charge quota.
1425
1444
  # @return [::String]
1445
+ # @!attribute [rw] universe_domain
1446
+ # The universe domain within which to make requests. This determines the
1447
+ # default endpoint URL. The default value of nil uses the environment
1448
+ # universe (usually the default "googleapis.com" universe).
1449
+ # @return [::String,nil]
1426
1450
  #
1427
1451
  class Configuration
1428
1452
  extend ::Gapic::Config
1429
1453
 
1454
+ # @private
1455
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1430
1456
  DEFAULT_ENDPOINT = "notebooks.googleapis.com"
1431
1457
 
1432
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1458
+ config_attr :endpoint, nil, ::String, nil
1433
1459
  config_attr :credentials, nil do |value|
1434
1460
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1435
1461
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -1444,6 +1470,7 @@ module Google
1444
1470
  config_attr :metadata, nil, ::Hash, nil
1445
1471
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1446
1472
  config_attr :quota_project, nil, ::String, nil
1473
+ config_attr :universe_domain, nil, ::String, nil
1447
1474
 
1448
1475
  # @private
1449
1476
  def initialize parent_config = nil
@@ -1464,6 +1491,14 @@ module Google
1464
1491
  end
1465
1492
  end
1466
1493
 
1494
+ ##
1495
+ # Configuration for the channel pool
1496
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
1497
+ #
1498
+ def channel_pool
1499
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
1500
+ end
1501
+
1467
1502
  ##
1468
1503
  # Configuration RPC class for the NotebookService API.
1469
1504
  #
@@ -26,6 +26,9 @@ module Google
26
26
  module NotebookService
27
27
  # Service that implements Longrunning Operations API.
28
28
  class Operations
29
+ # @private
30
+ DEFAULT_ENDPOINT_TEMPLATE = "notebooks.$UNIVERSE_DOMAIN$"
31
+
29
32
  # @private
30
33
  attr_reader :operations_stub
31
34
 
@@ -60,6 +63,15 @@ module Google
60
63
  @config
61
64
  end
62
65
 
66
+ ##
67
+ # The effective universe domain
68
+ #
69
+ # @return [String]
70
+ #
71
+ def universe_domain
72
+ @operations_stub.universe_domain
73
+ end
74
+
63
75
  ##
64
76
  # Create a new Operations client object.
65
77
  #
@@ -90,10 +102,13 @@ module Google
90
102
 
91
103
  @operations_stub = ::Gapic::ServiceStub.new(
92
104
  ::Google::Longrunning::Operations::Stub,
93
- credentials: credentials,
94
- endpoint: @config.endpoint,
105
+ credentials: credentials,
106
+ endpoint: @config.endpoint,
107
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
108
+ universe_domain: @config.universe_domain,
95
109
  channel_args: @config.channel_args,
96
- interceptors: @config.interceptors
110
+ interceptors: @config.interceptors,
111
+ channel_pool_config: @config.channel_pool
97
112
  )
98
113
 
99
114
  # Used by an LRO wrapper for some methods of this service
@@ -612,9 +627,9 @@ module Google
612
627
  # end
613
628
  #
614
629
  # @!attribute [rw] endpoint
615
- # The hostname or hostname:port of the service endpoint.
616
- # Defaults to `"notebooks.googleapis.com"`.
617
- # @return [::String]
630
+ # A custom service endpoint, as a hostname or hostname:port. The default is
631
+ # nil, indicating to use the default endpoint in the current universe domain.
632
+ # @return [::String,nil]
618
633
  # @!attribute [rw] credentials
619
634
  # Credentials to send with calls. You may provide any of the following types:
620
635
  # * (`String`) The path to a service account key file in JSON format
@@ -660,13 +675,20 @@ module Google
660
675
  # @!attribute [rw] quota_project
661
676
  # A separate project against which to charge quota.
662
677
  # @return [::String]
678
+ # @!attribute [rw] universe_domain
679
+ # The universe domain within which to make requests. This determines the
680
+ # default endpoint URL. The default value of nil uses the environment
681
+ # universe (usually the default "googleapis.com" universe).
682
+ # @return [::String,nil]
663
683
  #
664
684
  class Configuration
665
685
  extend ::Gapic::Config
666
686
 
687
+ # @private
688
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
667
689
  DEFAULT_ENDPOINT = "notebooks.googleapis.com"
668
690
 
669
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
691
+ config_attr :endpoint, nil, ::String, nil
670
692
  config_attr :credentials, nil do |value|
671
693
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
672
694
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -681,6 +703,7 @@ module Google
681
703
  config_attr :metadata, nil, ::Hash, nil
682
704
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
683
705
  config_attr :quota_project, nil, ::String, nil
706
+ config_attr :universe_domain, nil, ::String, nil
684
707
 
685
708
  # @private
686
709
  def initialize parent_config = nil
@@ -701,6 +724,14 @@ module Google
701
724
  end
702
725
  end
703
726
 
727
+ ##
728
+ # Configuration for the channel pool
729
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
730
+ #
731
+ def channel_pool
732
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
733
+ end
734
+
704
735
  ##
705
736
  # Configuration RPC class for the Operations API.
706
737
  #
@@ -34,6 +34,9 @@ module Google
34
34
  # API v2 service for Workbench Notebooks Instances.
35
35
  #
36
36
  class Client
37
+ # @private
38
+ DEFAULT_ENDPOINT_TEMPLATE = "notebooks.$UNIVERSE_DOMAIN$"
39
+
37
40
  include Paths
38
41
 
39
42
  # @private
@@ -117,6 +120,15 @@ module Google
117
120
  @config
118
121
  end
119
122
 
123
+ ##
124
+ # The effective universe domain
125
+ #
126
+ # @return [String]
127
+ #
128
+ def universe_domain
129
+ @notebook_service_stub.universe_domain
130
+ end
131
+
120
132
  ##
121
133
  # Create a new NotebookService REST client object.
122
134
  #
@@ -144,8 +156,9 @@ module Google
144
156
  credentials = @config.credentials
145
157
  # Use self-signed JWT if the endpoint is unchanged from default,
146
158
  # but only if the default endpoint does not have a region prefix.
147
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
148
- !@config.endpoint.split(".").first.include?("-")
159
+ enable_self_signed_jwt = @config.endpoint.nil? ||
160
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
161
+ !@config.endpoint.split(".").first.include?("-"))
149
162
  credentials ||= Credentials.default scope: @config.scope,
150
163
  enable_self_signed_jwt: enable_self_signed_jwt
151
164
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -159,12 +172,14 @@ module Google
159
172
  config.credentials = credentials
160
173
  config.quota_project = @quota_project_id
161
174
  config.endpoint = @config.endpoint
175
+ config.universe_domain = @config.universe_domain
162
176
  end
163
177
 
164
178
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
165
179
  config.credentials = credentials
166
180
  config.quota_project = @quota_project_id
167
181
  config.endpoint = @config.endpoint
182
+ config.universe_domain = @config.universe_domain
168
183
  config.bindings_override = @config.bindings_override
169
184
  end
170
185
 
@@ -172,10 +187,16 @@ module Google
172
187
  config.credentials = credentials
173
188
  config.quota_project = @quota_project_id
174
189
  config.endpoint = @config.endpoint
190
+ config.universe_domain = @config.universe_domain
175
191
  config.bindings_override = @config.bindings_override
176
192
  end
177
193
 
178
- @notebook_service_stub = ::Google::Cloud::Notebooks::V2::NotebookService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
194
+ @notebook_service_stub = ::Google::Cloud::Notebooks::V2::NotebookService::Rest::ServiceStub.new(
195
+ endpoint: @config.endpoint,
196
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
197
+ universe_domain: @config.universe_domain,
198
+ credentials: credentials
199
+ )
179
200
  end
180
201
 
181
202
  ##
@@ -239,6 +260,26 @@ module Google
239
260
  # @return [::Google::Cloud::Notebooks::V2::ListInstancesResponse]
240
261
  #
241
262
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
263
+ #
264
+ # @example Basic example
265
+ # require "google/cloud/notebooks/v2"
266
+ #
267
+ # # Create a client object. The client can be reused for multiple calls.
268
+ # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new
269
+ #
270
+ # # Create a request. To set request fields, pass in keyword arguments.
271
+ # request = Google::Cloud::Notebooks::V2::ListInstancesRequest.new
272
+ #
273
+ # # Call the list_instances method.
274
+ # result = client.list_instances request
275
+ #
276
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
277
+ # # over elements, and API calls will be issued to fetch pages as needed.
278
+ # result.each do |item|
279
+ # # Each element is of type ::Google::Cloud::Notebooks::V2::Instance.
280
+ # p item
281
+ # end
282
+ #
242
283
  def list_instances request, options = nil
243
284
  raise ::ArgumentError, "request must be provided" if request.nil?
244
285
 
@@ -302,6 +343,22 @@ module Google
302
343
  # @return [::Google::Cloud::Notebooks::V2::Instance]
303
344
  #
304
345
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
346
+ #
347
+ # @example Basic example
348
+ # require "google/cloud/notebooks/v2"
349
+ #
350
+ # # Create a client object. The client can be reused for multiple calls.
351
+ # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new
352
+ #
353
+ # # Create a request. To set request fields, pass in keyword arguments.
354
+ # request = Google::Cloud::Notebooks::V2::GetInstanceRequest.new
355
+ #
356
+ # # Call the get_instance method.
357
+ # result = client.get_instance request
358
+ #
359
+ # # The returned object is of type Google::Cloud::Notebooks::V2::Instance.
360
+ # p result
361
+ #
305
362
  def get_instance request, options = nil
306
363
  raise ::ArgumentError, "request must be provided" if request.nil?
307
364
 
@@ -371,6 +428,29 @@ module Google
371
428
  # @return [::Gapic::Operation]
372
429
  #
373
430
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
431
+ #
432
+ # @example Basic example
433
+ # require "google/cloud/notebooks/v2"
434
+ #
435
+ # # Create a client object. The client can be reused for multiple calls.
436
+ # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new
437
+ #
438
+ # # Create a request. To set request fields, pass in keyword arguments.
439
+ # request = Google::Cloud::Notebooks::V2::CreateInstanceRequest.new
440
+ #
441
+ # # Call the create_instance method.
442
+ # result = client.create_instance request
443
+ #
444
+ # # The returned object is of type Gapic::Operation. You can use it to
445
+ # # check the status of an operation, cancel it, or wait for results.
446
+ # # Here is how to wait for a response.
447
+ # result.wait_until_done! timeout: 60
448
+ # if result.response?
449
+ # p result.response
450
+ # else
451
+ # puts "No response received."
452
+ # end
453
+ #
374
454
  def create_instance request, options = nil
375
455
  raise ::ArgumentError, "request must be provided" if request.nil?
376
456
 
@@ -438,6 +518,29 @@ module Google
438
518
  # @return [::Gapic::Operation]
439
519
  #
440
520
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
521
+ #
522
+ # @example Basic example
523
+ # require "google/cloud/notebooks/v2"
524
+ #
525
+ # # Create a client object. The client can be reused for multiple calls.
526
+ # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new
527
+ #
528
+ # # Create a request. To set request fields, pass in keyword arguments.
529
+ # request = Google::Cloud::Notebooks::V2::UpdateInstanceRequest.new
530
+ #
531
+ # # Call the update_instance method.
532
+ # result = client.update_instance request
533
+ #
534
+ # # The returned object is of type Gapic::Operation. You can use it to
535
+ # # check the status of an operation, cancel it, or wait for results.
536
+ # # Here is how to wait for a response.
537
+ # result.wait_until_done! timeout: 60
538
+ # if result.response?
539
+ # p result.response
540
+ # else
541
+ # puts "No response received."
542
+ # end
543
+ #
441
544
  def update_instance request, options = nil
442
545
  raise ::ArgumentError, "request must be provided" if request.nil?
443
546
 
@@ -504,6 +607,29 @@ module Google
504
607
  # @return [::Gapic::Operation]
505
608
  #
506
609
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
610
+ #
611
+ # @example Basic example
612
+ # require "google/cloud/notebooks/v2"
613
+ #
614
+ # # Create a client object. The client can be reused for multiple calls.
615
+ # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new
616
+ #
617
+ # # Create a request. To set request fields, pass in keyword arguments.
618
+ # request = Google::Cloud::Notebooks::V2::DeleteInstanceRequest.new
619
+ #
620
+ # # Call the delete_instance method.
621
+ # result = client.delete_instance request
622
+ #
623
+ # # The returned object is of type Gapic::Operation. You can use it to
624
+ # # check the status of an operation, cancel it, or wait for results.
625
+ # # Here is how to wait for a response.
626
+ # result.wait_until_done! timeout: 60
627
+ # if result.response?
628
+ # p result.response
629
+ # else
630
+ # puts "No response received."
631
+ # end
632
+ #
507
633
  def delete_instance request, options = nil
508
634
  raise ::ArgumentError, "request must be provided" if request.nil?
509
635
 
@@ -568,6 +694,29 @@ module Google
568
694
  # @return [::Gapic::Operation]
569
695
  #
570
696
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
697
+ #
698
+ # @example Basic example
699
+ # require "google/cloud/notebooks/v2"
700
+ #
701
+ # # Create a client object. The client can be reused for multiple calls.
702
+ # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new
703
+ #
704
+ # # Create a request. To set request fields, pass in keyword arguments.
705
+ # request = Google::Cloud::Notebooks::V2::StartInstanceRequest.new
706
+ #
707
+ # # Call the start_instance method.
708
+ # result = client.start_instance request
709
+ #
710
+ # # The returned object is of type Gapic::Operation. You can use it to
711
+ # # check the status of an operation, cancel it, or wait for results.
712
+ # # Here is how to wait for a response.
713
+ # result.wait_until_done! timeout: 60
714
+ # if result.response?
715
+ # p result.response
716
+ # else
717
+ # puts "No response received."
718
+ # end
719
+ #
571
720
  def start_instance request, options = nil
572
721
  raise ::ArgumentError, "request must be provided" if request.nil?
573
722
 
@@ -632,6 +781,29 @@ module Google
632
781
  # @return [::Gapic::Operation]
633
782
  #
634
783
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
784
+ #
785
+ # @example Basic example
786
+ # require "google/cloud/notebooks/v2"
787
+ #
788
+ # # Create a client object. The client can be reused for multiple calls.
789
+ # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new
790
+ #
791
+ # # Create a request. To set request fields, pass in keyword arguments.
792
+ # request = Google::Cloud::Notebooks::V2::StopInstanceRequest.new
793
+ #
794
+ # # Call the stop_instance method.
795
+ # result = client.stop_instance request
796
+ #
797
+ # # The returned object is of type Gapic::Operation. You can use it to
798
+ # # check the status of an operation, cancel it, or wait for results.
799
+ # # Here is how to wait for a response.
800
+ # result.wait_until_done! timeout: 60
801
+ # if result.response?
802
+ # p result.response
803
+ # else
804
+ # puts "No response received."
805
+ # end
806
+ #
635
807
  def stop_instance request, options = nil
636
808
  raise ::ArgumentError, "request must be provided" if request.nil?
637
809
 
@@ -696,6 +868,29 @@ module Google
696
868
  # @return [::Gapic::Operation]
697
869
  #
698
870
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
871
+ #
872
+ # @example Basic example
873
+ # require "google/cloud/notebooks/v2"
874
+ #
875
+ # # Create a client object. The client can be reused for multiple calls.
876
+ # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new
877
+ #
878
+ # # Create a request. To set request fields, pass in keyword arguments.
879
+ # request = Google::Cloud::Notebooks::V2::ResetInstanceRequest.new
880
+ #
881
+ # # Call the reset_instance method.
882
+ # result = client.reset_instance request
883
+ #
884
+ # # The returned object is of type Gapic::Operation. You can use it to
885
+ # # check the status of an operation, cancel it, or wait for results.
886
+ # # Here is how to wait for a response.
887
+ # result.wait_until_done! timeout: 60
888
+ # if result.response?
889
+ # p result.response
890
+ # else
891
+ # puts "No response received."
892
+ # end
893
+ #
699
894
  def reset_instance request, options = nil
700
895
  raise ::ArgumentError, "request must be provided" if request.nil?
701
896
 
@@ -760,6 +955,22 @@ module Google
760
955
  # @return [::Google::Cloud::Notebooks::V2::CheckInstanceUpgradabilityResponse]
761
956
  #
762
957
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
958
+ #
959
+ # @example Basic example
960
+ # require "google/cloud/notebooks/v2"
961
+ #
962
+ # # Create a client object. The client can be reused for multiple calls.
963
+ # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new
964
+ #
965
+ # # Create a request. To set request fields, pass in keyword arguments.
966
+ # request = Google::Cloud::Notebooks::V2::CheckInstanceUpgradabilityRequest.new
967
+ #
968
+ # # Call the check_instance_upgradability method.
969
+ # result = client.check_instance_upgradability request
970
+ #
971
+ # # The returned object is of type Google::Cloud::Notebooks::V2::CheckInstanceUpgradabilityResponse.
972
+ # p result
973
+ #
763
974
  def check_instance_upgradability request, options = nil
764
975
  raise ::ArgumentError, "request must be provided" if request.nil?
765
976
 
@@ -823,6 +1034,29 @@ module Google
823
1034
  # @return [::Gapic::Operation]
824
1035
  #
825
1036
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1037
+ #
1038
+ # @example Basic example
1039
+ # require "google/cloud/notebooks/v2"
1040
+ #
1041
+ # # Create a client object. The client can be reused for multiple calls.
1042
+ # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new
1043
+ #
1044
+ # # Create a request. To set request fields, pass in keyword arguments.
1045
+ # request = Google::Cloud::Notebooks::V2::UpgradeInstanceRequest.new
1046
+ #
1047
+ # # Call the upgrade_instance method.
1048
+ # result = client.upgrade_instance request
1049
+ #
1050
+ # # The returned object is of type Gapic::Operation. You can use it to
1051
+ # # check the status of an operation, cancel it, or wait for results.
1052
+ # # Here is how to wait for a response.
1053
+ # result.wait_until_done! timeout: 60
1054
+ # if result.response?
1055
+ # p result.response
1056
+ # else
1057
+ # puts "No response received."
1058
+ # end
1059
+ #
826
1060
  def upgrade_instance request, options = nil
827
1061
  raise ::ArgumentError, "request must be provided" if request.nil?
828
1062
 
@@ -890,6 +1124,29 @@ module Google
890
1124
  # @return [::Gapic::Operation]
891
1125
  #
892
1126
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1127
+ #
1128
+ # @example Basic example
1129
+ # require "google/cloud/notebooks/v2"
1130
+ #
1131
+ # # Create a client object. The client can be reused for multiple calls.
1132
+ # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new
1133
+ #
1134
+ # # Create a request. To set request fields, pass in keyword arguments.
1135
+ # request = Google::Cloud::Notebooks::V2::RollbackInstanceRequest.new
1136
+ #
1137
+ # # Call the rollback_instance method.
1138
+ # result = client.rollback_instance request
1139
+ #
1140
+ # # The returned object is of type Gapic::Operation. You can use it to
1141
+ # # check the status of an operation, cancel it, or wait for results.
1142
+ # # Here is how to wait for a response.
1143
+ # result.wait_until_done! timeout: 60
1144
+ # if result.response?
1145
+ # p result.response
1146
+ # else
1147
+ # puts "No response received."
1148
+ # end
1149
+ #
893
1150
  def rollback_instance request, options = nil
894
1151
  raise ::ArgumentError, "request must be provided" if request.nil?
895
1152
 
@@ -958,6 +1215,29 @@ module Google
958
1215
  # @return [::Gapic::Operation]
959
1216
  #
960
1217
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1218
+ #
1219
+ # @example Basic example
1220
+ # require "google/cloud/notebooks/v2"
1221
+ #
1222
+ # # Create a client object. The client can be reused for multiple calls.
1223
+ # client = Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new
1224
+ #
1225
+ # # Create a request. To set request fields, pass in keyword arguments.
1226
+ # request = Google::Cloud::Notebooks::V2::DiagnoseInstanceRequest.new
1227
+ #
1228
+ # # Call the diagnose_instance method.
1229
+ # result = client.diagnose_instance request
1230
+ #
1231
+ # # The returned object is of type Gapic::Operation. You can use it to
1232
+ # # check the status of an operation, cancel it, or wait for results.
1233
+ # # Here is how to wait for a response.
1234
+ # result.wait_until_done! timeout: 60
1235
+ # if result.response?
1236
+ # p result.response
1237
+ # else
1238
+ # puts "No response received."
1239
+ # end
1240
+ #
961
1241
  def diagnose_instance request, options = nil
962
1242
  raise ::ArgumentError, "request must be provided" if request.nil?
963
1243
 
@@ -1024,9 +1304,9 @@ module Google
1024
1304
  # end
1025
1305
  #
1026
1306
  # @!attribute [rw] endpoint
1027
- # The hostname or hostname:port of the service endpoint.
1028
- # Defaults to `"notebooks.googleapis.com"`.
1029
- # @return [::String]
1307
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1308
+ # nil, indicating to use the default endpoint in the current universe domain.
1309
+ # @return [::String,nil]
1030
1310
  # @!attribute [rw] credentials
1031
1311
  # Credentials to send with calls. You may provide any of the following types:
1032
1312
  # * (`String`) The path to a service account key file in JSON format
@@ -1063,13 +1343,20 @@ module Google
1063
1343
  # @!attribute [rw] quota_project
1064
1344
  # A separate project against which to charge quota.
1065
1345
  # @return [::String]
1346
+ # @!attribute [rw] universe_domain
1347
+ # The universe domain within which to make requests. This determines the
1348
+ # default endpoint URL. The default value of nil uses the environment
1349
+ # universe (usually the default "googleapis.com" universe).
1350
+ # @return [::String,nil]
1066
1351
  #
1067
1352
  class Configuration
1068
1353
  extend ::Gapic::Config
1069
1354
 
1355
+ # @private
1356
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1070
1357
  DEFAULT_ENDPOINT = "notebooks.googleapis.com"
1071
1358
 
1072
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1359
+ config_attr :endpoint, nil, ::String, nil
1073
1360
  config_attr :credentials, nil do |value|
1074
1361
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1075
1362
  allowed.any? { |klass| klass === value }
@@ -1081,6 +1368,7 @@ module Google
1081
1368
  config_attr :metadata, nil, ::Hash, nil
1082
1369
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1083
1370
  config_attr :quota_project, nil, ::String, nil
1371
+ config_attr :universe_domain, nil, ::String, nil
1084
1372
 
1085
1373
  # @private
1086
1374
  # Overrides for http bindings for the RPCs of this service
@@ -26,6 +26,9 @@ module Google
26
26
  module Rest
27
27
  # Service that implements Longrunning Operations API.
28
28
  class Operations
29
+ # @private
30
+ DEFAULT_ENDPOINT_TEMPLATE = "notebooks.$UNIVERSE_DOMAIN$"
31
+
29
32
  # @private
30
33
  attr_reader :operations_stub
31
34
 
@@ -60,6 +63,15 @@ module Google
60
63
  @config
61
64
  end
62
65
 
66
+ ##
67
+ # The effective universe domain
68
+ #
69
+ # @return [String]
70
+ #
71
+ def universe_domain
72
+ @operations_stub.universe_domain
73
+ end
74
+
63
75
  ##
64
76
  # Create a new Operations client object.
65
77
  #
@@ -84,8 +96,10 @@ module Google
84
96
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
85
97
 
86
98
  @operations_stub = OperationsServiceStub.new(
87
- endpoint: @config.endpoint,
88
- credentials: credentials
99
+ endpoint: @config.endpoint,
100
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
101
+ universe_domain: @config.universe_domain,
102
+ credentials: credentials
89
103
  )
90
104
 
91
105
  # Used by an LRO wrapper for some methods of this service
@@ -136,6 +150,26 @@ module Google
136
150
  # @return [::Gapic::Operation]
137
151
  #
138
152
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
153
+ #
154
+ # @example Basic example
155
+ # require "google/longrunning"
156
+ #
157
+ # # Create a client object. The client can be reused for multiple calls.
158
+ # client = Google::Longrunning::Operations::Rest::Client.new
159
+ #
160
+ # # Create a request. To set request fields, pass in keyword arguments.
161
+ # request = Google::Longrunning::ListOperationsRequest.new
162
+ #
163
+ # # Call the list_operations method.
164
+ # result = client.list_operations request
165
+ #
166
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
167
+ # # over elements, and API calls will be issued to fetch pages as needed.
168
+ # result.each do |item|
169
+ # # Each element is of type ::Google::Longrunning::Operation.
170
+ # p item
171
+ # end
172
+ #
139
173
  def list_operations request, options = nil
140
174
  raise ::ArgumentError, "request must be provided" if request.nil?
141
175
 
@@ -201,6 +235,29 @@ module Google
201
235
  # @return [::Gapic::Operation]
202
236
  #
203
237
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
238
+ #
239
+ # @example Basic example
240
+ # require "google/longrunning"
241
+ #
242
+ # # Create a client object. The client can be reused for multiple calls.
243
+ # client = Google::Longrunning::Operations::Rest::Client.new
244
+ #
245
+ # # Create a request. To set request fields, pass in keyword arguments.
246
+ # request = Google::Longrunning::GetOperationRequest.new
247
+ #
248
+ # # Call the get_operation method.
249
+ # result = client.get_operation request
250
+ #
251
+ # # The returned object is of type Gapic::Operation. You can use it to
252
+ # # check the status of an operation, cancel it, or wait for results.
253
+ # # Here is how to wait for a response.
254
+ # result.wait_until_done! timeout: 60
255
+ # if result.response?
256
+ # p result.response
257
+ # else
258
+ # puts "No response received."
259
+ # end
260
+ #
204
261
  def get_operation request, options = nil
205
262
  raise ::ArgumentError, "request must be provided" if request.nil?
206
263
 
@@ -267,6 +324,22 @@ module Google
267
324
  # @return [::Google::Protobuf::Empty]
268
325
  #
269
326
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
327
+ #
328
+ # @example Basic example
329
+ # require "google/longrunning"
330
+ #
331
+ # # Create a client object. The client can be reused for multiple calls.
332
+ # client = Google::Longrunning::Operations::Rest::Client.new
333
+ #
334
+ # # Create a request. To set request fields, pass in keyword arguments.
335
+ # request = Google::Longrunning::DeleteOperationRequest.new
336
+ #
337
+ # # Call the delete_operation method.
338
+ # result = client.delete_operation request
339
+ #
340
+ # # The returned object is of type Google::Protobuf::Empty.
341
+ # p result
342
+ #
270
343
  def delete_operation request, options = nil
271
344
  raise ::ArgumentError, "request must be provided" if request.nil?
272
345
 
@@ -338,6 +411,22 @@ module Google
338
411
  # @return [::Google::Protobuf::Empty]
339
412
  #
340
413
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
414
+ #
415
+ # @example Basic example
416
+ # require "google/longrunning"
417
+ #
418
+ # # Create a client object. The client can be reused for multiple calls.
419
+ # client = Google::Longrunning::Operations::Rest::Client.new
420
+ #
421
+ # # Create a request. To set request fields, pass in keyword arguments.
422
+ # request = Google::Longrunning::CancelOperationRequest.new
423
+ #
424
+ # # Call the cancel_operation method.
425
+ # result = client.cancel_operation request
426
+ #
427
+ # # The returned object is of type Google::Protobuf::Empty.
428
+ # p result
429
+ #
341
430
  def cancel_operation request, options = nil
342
431
  raise ::ArgumentError, "request must be provided" if request.nil?
343
432
 
@@ -403,9 +492,9 @@ module Google
403
492
  # end
404
493
  #
405
494
  # @!attribute [rw] endpoint
406
- # The hostname or hostname:port of the service endpoint.
407
- # Defaults to `"notebooks.googleapis.com"`.
408
- # @return [::String]
495
+ # A custom service endpoint, as a hostname or hostname:port. The default is
496
+ # nil, indicating to use the default endpoint in the current universe domain.
497
+ # @return [::String,nil]
409
498
  # @!attribute [rw] credentials
410
499
  # Credentials to send with calls. You may provide any of the following types:
411
500
  # * (`String`) The path to a service account key file in JSON format
@@ -442,13 +531,20 @@ module Google
442
531
  # @!attribute [rw] quota_project
443
532
  # A separate project against which to charge quota.
444
533
  # @return [::String]
534
+ # @!attribute [rw] universe_domain
535
+ # The universe domain within which to make requests. This determines the
536
+ # default endpoint URL. The default value of nil uses the environment
537
+ # universe (usually the default "googleapis.com" universe).
538
+ # @return [::String,nil]
445
539
  #
446
540
  class Configuration
447
541
  extend ::Gapic::Config
448
542
 
543
+ # @private
544
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
449
545
  DEFAULT_ENDPOINT = "notebooks.googleapis.com"
450
546
 
451
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
547
+ config_attr :endpoint, nil, ::String, nil
452
548
  config_attr :credentials, nil do |value|
453
549
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
454
550
  allowed.any? { |klass| klass === value }
@@ -460,6 +556,7 @@ module Google
460
556
  config_attr :metadata, nil, ::Hash, nil
461
557
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
462
558
  config_attr :quota_project, nil, ::String, nil
559
+ config_attr :universe_domain, nil, ::String, nil
463
560
 
464
561
  # @private
465
562
  def initialize parent_config = nil
@@ -542,12 +639,15 @@ module Google
542
639
  # Service stub contains baseline method implementations
543
640
  # including transcoding, making the REST call, and deserialing the response.
544
641
  class OperationsServiceStub
545
- def initialize endpoint:, credentials:
642
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
546
643
  # These require statements are intentionally placed here to initialize
547
644
  # the REST modules only when it's required.
548
645
  require "gapic/rest"
549
646
 
550
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials
647
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
648
+ endpoint_template: endpoint_template,
649
+ universe_domain: universe_domain,
650
+ credentials: credentials
551
651
  end
552
652
 
553
653
  ##
@@ -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, credentials: credentials,
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 list_instances REST call
45
57
  #
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Notebooks
23
23
  module V2
24
- VERSION = "0.1.0"
24
+ VERSION = "0.3.0"
25
25
  end
26
26
  end
27
27
  end
@@ -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
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-notebooks-v2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.3.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: 2023-08-23 00:00:00.000000000 Z
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.1
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.19.1
29
+ version: 0.21.1
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.a
@@ -50,7 +50,7 @@ dependencies:
50
50
  requirements:
51
51
  - - ">="
52
52
  - !ruby/object:Gem::Version
53
- version: '0.4'
53
+ version: '0.7'
54
54
  - - "<"
55
55
  - !ruby/object:Gem::Version
56
56
  version: 2.a
@@ -60,7 +60,7 @@ dependencies:
60
60
  requirements:
61
61
  - - ">="
62
62
  - !ruby/object:Gem::Version
63
- version: '0.4'
63
+ version: '0.7'
64
64
  - - "<"
65
65
  - !ruby/object:Gem::Version
66
66
  version: 2.a
@@ -70,7 +70,7 @@ dependencies:
70
70
  requirements:
71
71
  - - ">="
72
72
  - !ruby/object:Gem::Version
73
- version: '0.4'
73
+ version: '0.7'
74
74
  - - "<"
75
75
  - !ruby/object:Gem::Version
76
76
  version: 2.a
@@ -80,7 +80,7 @@ dependencies:
80
80
  requirements:
81
81
  - - ">="
82
82
  - !ruby/object:Gem::Version
83
- version: '0.4'
83
+ version: '0.7'
84
84
  - - "<"
85
85
  - !ruby/object:Gem::Version
86
86
  version: 2.a
@@ -266,7 +266,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
266
266
  - !ruby/object:Gem::Version
267
267
  version: '0'
268
268
  requirements: []
269
- rubygems_version: 3.4.19
269
+ rubygems_version: 3.5.3
270
270
  signing_key:
271
271
  specification_version: 4
272
272
  summary: Notebooks API is used to manage notebook resources in Google Cloud.