google-apis-cloudshell_v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,28 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module Google
16
+ module Apis
17
+ module CloudshellV1
18
+ # Version of the google-apis-cloudshell_v1 gem
19
+ GEM_VERSION = "0.1.0"
20
+
21
+ # Version of the code generator used to generate this client
22
+ GENERATOR_VERSION = "0.1.1"
23
+
24
+ # Revision of the discovery document this client was generated from
25
+ REVISION = "20201003"
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,298 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'date'
16
+ require 'google/apis/core/base_service'
17
+ require 'google/apis/core/json_representation'
18
+ require 'google/apis/core/hashable'
19
+ require 'google/apis/errors'
20
+
21
+ module Google
22
+ module Apis
23
+ module CloudshellV1
24
+
25
+ class AddPublicKeyMetadata
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ include Google::Apis::Core::JsonObjectSupport
29
+ end
30
+
31
+ class AddPublicKeyRequest
32
+ class Representation < Google::Apis::Core::JsonRepresentation; end
33
+
34
+ include Google::Apis::Core::JsonObjectSupport
35
+ end
36
+
37
+ class AddPublicKeyResponse
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
43
+ class AuthorizeEnvironmentMetadata
44
+ class Representation < Google::Apis::Core::JsonRepresentation; end
45
+
46
+ include Google::Apis::Core::JsonObjectSupport
47
+ end
48
+
49
+ class AuthorizeEnvironmentRequest
50
+ class Representation < Google::Apis::Core::JsonRepresentation; end
51
+
52
+ include Google::Apis::Core::JsonObjectSupport
53
+ end
54
+
55
+ class AuthorizeEnvironmentResponse
56
+ class Representation < Google::Apis::Core::JsonRepresentation; end
57
+
58
+ include Google::Apis::Core::JsonObjectSupport
59
+ end
60
+
61
+ class CancelOperationRequest
62
+ class Representation < Google::Apis::Core::JsonRepresentation; end
63
+
64
+ include Google::Apis::Core::JsonObjectSupport
65
+ end
66
+
67
+ class CreateEnvironmentMetadata
68
+ class Representation < Google::Apis::Core::JsonRepresentation; end
69
+
70
+ include Google::Apis::Core::JsonObjectSupport
71
+ end
72
+
73
+ class DeleteEnvironmentMetadata
74
+ class Representation < Google::Apis::Core::JsonRepresentation; end
75
+
76
+ include Google::Apis::Core::JsonObjectSupport
77
+ end
78
+
79
+ class Empty
80
+ class Representation < Google::Apis::Core::JsonRepresentation; end
81
+
82
+ include Google::Apis::Core::JsonObjectSupport
83
+ end
84
+
85
+ class Environment
86
+ class Representation < Google::Apis::Core::JsonRepresentation; end
87
+
88
+ include Google::Apis::Core::JsonObjectSupport
89
+ end
90
+
91
+ class ListOperationsResponse
92
+ class Representation < Google::Apis::Core::JsonRepresentation; end
93
+
94
+ include Google::Apis::Core::JsonObjectSupport
95
+ end
96
+
97
+ class Operation
98
+ class Representation < Google::Apis::Core::JsonRepresentation; end
99
+
100
+ include Google::Apis::Core::JsonObjectSupport
101
+ end
102
+
103
+ class RemovePublicKeyMetadata
104
+ class Representation < Google::Apis::Core::JsonRepresentation; end
105
+
106
+ include Google::Apis::Core::JsonObjectSupport
107
+ end
108
+
109
+ class RemovePublicKeyRequest
110
+ class Representation < Google::Apis::Core::JsonRepresentation; end
111
+
112
+ include Google::Apis::Core::JsonObjectSupport
113
+ end
114
+
115
+ class RemovePublicKeyResponse
116
+ class Representation < Google::Apis::Core::JsonRepresentation; end
117
+
118
+ include Google::Apis::Core::JsonObjectSupport
119
+ end
120
+
121
+ class StartEnvironmentMetadata
122
+ class Representation < Google::Apis::Core::JsonRepresentation; end
123
+
124
+ include Google::Apis::Core::JsonObjectSupport
125
+ end
126
+
127
+ class StartEnvironmentRequest
128
+ class Representation < Google::Apis::Core::JsonRepresentation; end
129
+
130
+ include Google::Apis::Core::JsonObjectSupport
131
+ end
132
+
133
+ class StartEnvironmentResponse
134
+ class Representation < Google::Apis::Core::JsonRepresentation; end
135
+
136
+ include Google::Apis::Core::JsonObjectSupport
137
+ end
138
+
139
+ class Status
140
+ class Representation < Google::Apis::Core::JsonRepresentation; end
141
+
142
+ include Google::Apis::Core::JsonObjectSupport
143
+ end
144
+
145
+ class AddPublicKeyMetadata
146
+ # @private
147
+ class Representation < Google::Apis::Core::JsonRepresentation
148
+ end
149
+ end
150
+
151
+ class AddPublicKeyRequest
152
+ # @private
153
+ class Representation < Google::Apis::Core::JsonRepresentation
154
+ property :key, as: 'key'
155
+ end
156
+ end
157
+
158
+ class AddPublicKeyResponse
159
+ # @private
160
+ class Representation < Google::Apis::Core::JsonRepresentation
161
+ property :key, as: 'key'
162
+ end
163
+ end
164
+
165
+ class AuthorizeEnvironmentMetadata
166
+ # @private
167
+ class Representation < Google::Apis::Core::JsonRepresentation
168
+ end
169
+ end
170
+
171
+ class AuthorizeEnvironmentRequest
172
+ # @private
173
+ class Representation < Google::Apis::Core::JsonRepresentation
174
+ property :access_token, as: 'accessToken'
175
+ property :expire_time, as: 'expireTime'
176
+ property :id_token, as: 'idToken'
177
+ end
178
+ end
179
+
180
+ class AuthorizeEnvironmentResponse
181
+ # @private
182
+ class Representation < Google::Apis::Core::JsonRepresentation
183
+ end
184
+ end
185
+
186
+ class CancelOperationRequest
187
+ # @private
188
+ class Representation < Google::Apis::Core::JsonRepresentation
189
+ end
190
+ end
191
+
192
+ class CreateEnvironmentMetadata
193
+ # @private
194
+ class Representation < Google::Apis::Core::JsonRepresentation
195
+ end
196
+ end
197
+
198
+ class DeleteEnvironmentMetadata
199
+ # @private
200
+ class Representation < Google::Apis::Core::JsonRepresentation
201
+ end
202
+ end
203
+
204
+ class Empty
205
+ # @private
206
+ class Representation < Google::Apis::Core::JsonRepresentation
207
+ end
208
+ end
209
+
210
+ class Environment
211
+ # @private
212
+ class Representation < Google::Apis::Core::JsonRepresentation
213
+ property :docker_image, as: 'dockerImage'
214
+ property :id, as: 'id'
215
+ property :name, as: 'name'
216
+ collection :public_keys, as: 'publicKeys'
217
+ property :ssh_host, as: 'sshHost'
218
+ property :ssh_port, as: 'sshPort'
219
+ property :ssh_username, as: 'sshUsername'
220
+ property :state, as: 'state'
221
+ property :web_host, as: 'webHost'
222
+ end
223
+ end
224
+
225
+ class ListOperationsResponse
226
+ # @private
227
+ class Representation < Google::Apis::Core::JsonRepresentation
228
+ property :next_page_token, as: 'nextPageToken'
229
+ collection :operations, as: 'operations', class: Google::Apis::CloudshellV1::Operation, decorator: Google::Apis::CloudshellV1::Operation::Representation
230
+
231
+ end
232
+ end
233
+
234
+ class Operation
235
+ # @private
236
+ class Representation < Google::Apis::Core::JsonRepresentation
237
+ property :done, as: 'done'
238
+ property :error, as: 'error', class: Google::Apis::CloudshellV1::Status, decorator: Google::Apis::CloudshellV1::Status::Representation
239
+
240
+ hash :metadata, as: 'metadata'
241
+ property :name, as: 'name'
242
+ hash :response, as: 'response'
243
+ end
244
+ end
245
+
246
+ class RemovePublicKeyMetadata
247
+ # @private
248
+ class Representation < Google::Apis::Core::JsonRepresentation
249
+ end
250
+ end
251
+
252
+ class RemovePublicKeyRequest
253
+ # @private
254
+ class Representation < Google::Apis::Core::JsonRepresentation
255
+ property :key, as: 'key'
256
+ end
257
+ end
258
+
259
+ class RemovePublicKeyResponse
260
+ # @private
261
+ class Representation < Google::Apis::Core::JsonRepresentation
262
+ end
263
+ end
264
+
265
+ class StartEnvironmentMetadata
266
+ # @private
267
+ class Representation < Google::Apis::Core::JsonRepresentation
268
+ property :state, as: 'state'
269
+ end
270
+ end
271
+
272
+ class StartEnvironmentRequest
273
+ # @private
274
+ class Representation < Google::Apis::Core::JsonRepresentation
275
+ property :access_token, as: 'accessToken'
276
+ collection :public_keys, as: 'publicKeys'
277
+ end
278
+ end
279
+
280
+ class StartEnvironmentResponse
281
+ # @private
282
+ class Representation < Google::Apis::Core::JsonRepresentation
283
+ property :environment, as: 'environment', class: Google::Apis::CloudshellV1::Environment, decorator: Google::Apis::CloudshellV1::Environment::Representation
284
+
285
+ end
286
+ end
287
+
288
+ class Status
289
+ # @private
290
+ class Representation < Google::Apis::Core::JsonRepresentation
291
+ property :code, as: 'code'
292
+ collection :details, as: 'details'
293
+ property :message, as: 'message'
294
+ end
295
+ end
296
+ end
297
+ end
298
+ end
@@ -0,0 +1,389 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module CloudshellV1
23
+ # Cloud Shell API
24
+ #
25
+ # Allows users to start, configure, and connect to interactive shell sessions
26
+ # running in the cloud.
27
+ #
28
+ # @example
29
+ # require 'google/apis/cloudshell_v1'
30
+ #
31
+ # Cloudshell = Google::Apis::CloudshellV1 # Alias the module
32
+ # service = Cloudshell::CloudShellService.new
33
+ #
34
+ # @see https://cloud.google.com/shell/docs/
35
+ class CloudShellService < Google::Apis::Core::BaseService
36
+ # @return [String]
37
+ # API key. Your API key identifies your project and provides you with API access,
38
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
39
+ attr_accessor :key
40
+
41
+ # @return [String]
42
+ # Available to use for quota purposes for server-side applications. Can be any
43
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
44
+ attr_accessor :quota_user
45
+
46
+ def initialize
47
+ super('https://cloudshell.googleapis.com/', '',
48
+ client_name: 'google-apis-cloudshell_v1',
49
+ client_version: Google::Apis::CloudshellV1::GEM_VERSION)
50
+ @batch_path = 'batch'
51
+ end
52
+
53
+ # Starts asynchronous cancellation on a long-running operation. The server makes
54
+ # a best effort to cancel the operation, but success is not guaranteed. If the
55
+ # server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
56
+ # Clients can use Operations.GetOperation or other methods to check whether the
57
+ # cancellation succeeded or whether the operation completed despite cancellation.
58
+ # On successful cancellation, the operation is not deleted; instead, it becomes
59
+ # an operation with an Operation.error value with a google.rpc.Status.code of 1,
60
+ # corresponding to `Code.CANCELLED`.
61
+ # @param [String] name
62
+ # The name of the operation resource to be cancelled.
63
+ # @param [Google::Apis::CloudshellV1::CancelOperationRequest] cancel_operation_request_object
64
+ # @param [String] fields
65
+ # Selector specifying which fields to include in a partial response.
66
+ # @param [String] quota_user
67
+ # Available to use for quota purposes for server-side applications. Can be any
68
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
69
+ # @param [Google::Apis::RequestOptions] options
70
+ # Request-specific options
71
+ #
72
+ # @yield [result, err] Result & error if block supplied
73
+ # @yieldparam result [Google::Apis::CloudshellV1::Empty] parsed result object
74
+ # @yieldparam err [StandardError] error object if request failed
75
+ #
76
+ # @return [Google::Apis::CloudshellV1::Empty]
77
+ #
78
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
79
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
80
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
81
+ def cancel_operation(name, cancel_operation_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
82
+ command = make_simple_command(:post, 'v1/{+name}:cancel', options)
83
+ command.request_representation = Google::Apis::CloudshellV1::CancelOperationRequest::Representation
84
+ command.request_object = cancel_operation_request_object
85
+ command.response_representation = Google::Apis::CloudshellV1::Empty::Representation
86
+ command.response_class = Google::Apis::CloudshellV1::Empty
87
+ command.params['name'] = name unless name.nil?
88
+ command.query['fields'] = fields unless fields.nil?
89
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
90
+ execute_or_queue_command(command, &block)
91
+ end
92
+
93
+ # Deletes a long-running operation. This method indicates that the client is no
94
+ # longer interested in the operation result. It does not cancel the operation.
95
+ # If the server doesn't support this method, it returns `google.rpc.Code.
96
+ # UNIMPLEMENTED`.
97
+ # @param [String] name
98
+ # The name of the operation resource to be deleted.
99
+ # @param [String] fields
100
+ # Selector specifying which fields to include in a partial response.
101
+ # @param [String] quota_user
102
+ # Available to use for quota purposes for server-side applications. Can be any
103
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
104
+ # @param [Google::Apis::RequestOptions] options
105
+ # Request-specific options
106
+ #
107
+ # @yield [result, err] Result & error if block supplied
108
+ # @yieldparam result [Google::Apis::CloudshellV1::Empty] parsed result object
109
+ # @yieldparam err [StandardError] error object if request failed
110
+ #
111
+ # @return [Google::Apis::CloudshellV1::Empty]
112
+ #
113
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
114
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
115
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
116
+ def delete_operation(name, fields: nil, quota_user: nil, options: nil, &block)
117
+ command = make_simple_command(:delete, 'v1/{+name}', options)
118
+ command.response_representation = Google::Apis::CloudshellV1::Empty::Representation
119
+ command.response_class = Google::Apis::CloudshellV1::Empty
120
+ command.params['name'] = name unless name.nil?
121
+ command.query['fields'] = fields unless fields.nil?
122
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
123
+ execute_or_queue_command(command, &block)
124
+ end
125
+
126
+ # Gets the latest state of a long-running operation. Clients can use this method
127
+ # to poll the operation result at intervals as recommended by the API service.
128
+ # @param [String] name
129
+ # The name of the operation resource.
130
+ # @param [String] fields
131
+ # Selector specifying which fields to include in a partial response.
132
+ # @param [String] quota_user
133
+ # Available to use for quota purposes for server-side applications. Can be any
134
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
135
+ # @param [Google::Apis::RequestOptions] options
136
+ # Request-specific options
137
+ #
138
+ # @yield [result, err] Result & error if block supplied
139
+ # @yieldparam result [Google::Apis::CloudshellV1::Operation] parsed result object
140
+ # @yieldparam err [StandardError] error object if request failed
141
+ #
142
+ # @return [Google::Apis::CloudshellV1::Operation]
143
+ #
144
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
145
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
146
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
147
+ def get_operation(name, fields: nil, quota_user: nil, options: nil, &block)
148
+ command = make_simple_command(:get, 'v1/{+name}', options)
149
+ command.response_representation = Google::Apis::CloudshellV1::Operation::Representation
150
+ command.response_class = Google::Apis::CloudshellV1::Operation
151
+ command.params['name'] = name unless name.nil?
152
+ command.query['fields'] = fields unless fields.nil?
153
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
154
+ execute_or_queue_command(command, &block)
155
+ end
156
+
157
+ # Lists operations that match the specified filter in the request. If the server
158
+ # doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name`
159
+ # binding allows API services to override the binding to use different resource
160
+ # name schemes, such as `users/*/operations`. To override the binding, API
161
+ # services can add a binding such as `"/v1/`name=users/*`/operations"` to their
162
+ # service configuration. For backwards compatibility, the default name includes
163
+ # the operations collection id, however overriding users must ensure the name
164
+ # binding is the parent resource, without the operations collection id.
165
+ # @param [String] name
166
+ # The name of the operation's parent resource.
167
+ # @param [String] filter
168
+ # The standard list filter.
169
+ # @param [Fixnum] page_size
170
+ # The standard list page size.
171
+ # @param [String] page_token
172
+ # The standard list page token.
173
+ # @param [String] fields
174
+ # Selector specifying which fields to include in a partial response.
175
+ # @param [String] quota_user
176
+ # Available to use for quota purposes for server-side applications. Can be any
177
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
178
+ # @param [Google::Apis::RequestOptions] options
179
+ # Request-specific options
180
+ #
181
+ # @yield [result, err] Result & error if block supplied
182
+ # @yieldparam result [Google::Apis::CloudshellV1::ListOperationsResponse] parsed result object
183
+ # @yieldparam err [StandardError] error object if request failed
184
+ #
185
+ # @return [Google::Apis::CloudshellV1::ListOperationsResponse]
186
+ #
187
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
188
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
189
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
190
+ def list_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
191
+ command = make_simple_command(:get, 'v1/{+name}', options)
192
+ command.response_representation = Google::Apis::CloudshellV1::ListOperationsResponse::Representation
193
+ command.response_class = Google::Apis::CloudshellV1::ListOperationsResponse
194
+ command.params['name'] = name unless name.nil?
195
+ command.query['filter'] = filter unless filter.nil?
196
+ command.query['pageSize'] = page_size unless page_size.nil?
197
+ command.query['pageToken'] = page_token unless page_token.nil?
198
+ command.query['fields'] = fields unless fields.nil?
199
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
200
+ execute_or_queue_command(command, &block)
201
+ end
202
+
203
+ # Adds a public SSH key to an environment, allowing clients with the
204
+ # corresponding private key to connect to that environment via SSH. If a key
205
+ # with the same content already exists, this will error with ALREADY_EXISTS.
206
+ # @param [String] environment
207
+ # Environment this key should be added to, e.g. `users/me/environments/default`.
208
+ # @param [Google::Apis::CloudshellV1::AddPublicKeyRequest] add_public_key_request_object
209
+ # @param [String] fields
210
+ # Selector specifying which fields to include in a partial response.
211
+ # @param [String] quota_user
212
+ # Available to use for quota purposes for server-side applications. Can be any
213
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
214
+ # @param [Google::Apis::RequestOptions] options
215
+ # Request-specific options
216
+ #
217
+ # @yield [result, err] Result & error if block supplied
218
+ # @yieldparam result [Google::Apis::CloudshellV1::Operation] parsed result object
219
+ # @yieldparam err [StandardError] error object if request failed
220
+ #
221
+ # @return [Google::Apis::CloudshellV1::Operation]
222
+ #
223
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
224
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
225
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
226
+ def add_environment_public_key(environment, add_public_key_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
227
+ command = make_simple_command(:post, 'v1/{+environment}:addPublicKey', options)
228
+ command.request_representation = Google::Apis::CloudshellV1::AddPublicKeyRequest::Representation
229
+ command.request_object = add_public_key_request_object
230
+ command.response_representation = Google::Apis::CloudshellV1::Operation::Representation
231
+ command.response_class = Google::Apis::CloudshellV1::Operation
232
+ command.params['environment'] = environment unless environment.nil?
233
+ command.query['fields'] = fields unless fields.nil?
234
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
235
+ execute_or_queue_command(command, &block)
236
+ end
237
+
238
+ # Sends OAuth credentials to a running environment on behalf of a user. When
239
+ # this completes, the environment will be authorized to run various Google Cloud
240
+ # command line tools without requiring the user to manually authenticate.
241
+ # @param [String] name
242
+ # Name of the resource that should receive the credentials, for example `users/
243
+ # me/environments/default` or `users/someone@example.com/environments/default`.
244
+ # @param [Google::Apis::CloudshellV1::AuthorizeEnvironmentRequest] authorize_environment_request_object
245
+ # @param [String] fields
246
+ # Selector specifying which fields to include in a partial response.
247
+ # @param [String] quota_user
248
+ # Available to use for quota purposes for server-side applications. Can be any
249
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
250
+ # @param [Google::Apis::RequestOptions] options
251
+ # Request-specific options
252
+ #
253
+ # @yield [result, err] Result & error if block supplied
254
+ # @yieldparam result [Google::Apis::CloudshellV1::Operation] parsed result object
255
+ # @yieldparam err [StandardError] error object if request failed
256
+ #
257
+ # @return [Google::Apis::CloudshellV1::Operation]
258
+ #
259
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
260
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
261
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
262
+ def authorize_environment(name, authorize_environment_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
263
+ command = make_simple_command(:post, 'v1/{+name}:authorize', options)
264
+ command.request_representation = Google::Apis::CloudshellV1::AuthorizeEnvironmentRequest::Representation
265
+ command.request_object = authorize_environment_request_object
266
+ command.response_representation = Google::Apis::CloudshellV1::Operation::Representation
267
+ command.response_class = Google::Apis::CloudshellV1::Operation
268
+ command.params['name'] = name unless name.nil?
269
+ command.query['fields'] = fields unless fields.nil?
270
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
271
+ execute_or_queue_command(command, &block)
272
+ end
273
+
274
+ # Gets an environment. Returns NOT_FOUND if the environment does not exist.
275
+ # @param [String] name
276
+ # Required. Name of the requested resource, for example `users/me/environments/
277
+ # default` or `users/someone@example.com/environments/default`.
278
+ # @param [String] fields
279
+ # Selector specifying which fields to include in a partial response.
280
+ # @param [String] quota_user
281
+ # Available to use for quota purposes for server-side applications. Can be any
282
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
283
+ # @param [Google::Apis::RequestOptions] options
284
+ # Request-specific options
285
+ #
286
+ # @yield [result, err] Result & error if block supplied
287
+ # @yieldparam result [Google::Apis::CloudshellV1::Environment] parsed result object
288
+ # @yieldparam err [StandardError] error object if request failed
289
+ #
290
+ # @return [Google::Apis::CloudshellV1::Environment]
291
+ #
292
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
293
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
294
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
295
+ def get_user_environment(name, fields: nil, quota_user: nil, options: nil, &block)
296
+ command = make_simple_command(:get, 'v1/{+name}', options)
297
+ command.response_representation = Google::Apis::CloudshellV1::Environment::Representation
298
+ command.response_class = Google::Apis::CloudshellV1::Environment
299
+ command.params['name'] = name unless name.nil?
300
+ command.query['fields'] = fields unless fields.nil?
301
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
302
+ execute_or_queue_command(command, &block)
303
+ end
304
+
305
+ # Removes a public SSH key from an environment. Clients will no longer be able
306
+ # to connect to the environment using the corresponding private key. If a key
307
+ # with the same content is not present, this will error with NOT_FOUND.
308
+ # @param [String] environment
309
+ # Environment this key should be removed from, e.g. `users/me/environments/
310
+ # default`.
311
+ # @param [Google::Apis::CloudshellV1::RemovePublicKeyRequest] remove_public_key_request_object
312
+ # @param [String] fields
313
+ # Selector specifying which fields to include in a partial response.
314
+ # @param [String] quota_user
315
+ # Available to use for quota purposes for server-side applications. Can be any
316
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
317
+ # @param [Google::Apis::RequestOptions] options
318
+ # Request-specific options
319
+ #
320
+ # @yield [result, err] Result & error if block supplied
321
+ # @yieldparam result [Google::Apis::CloudshellV1::Operation] parsed result object
322
+ # @yieldparam err [StandardError] error object if request failed
323
+ #
324
+ # @return [Google::Apis::CloudshellV1::Operation]
325
+ #
326
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
327
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
328
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
329
+ def remove_environment_public_key(environment, remove_public_key_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
330
+ command = make_simple_command(:post, 'v1/{+environment}:removePublicKey', options)
331
+ command.request_representation = Google::Apis::CloudshellV1::RemovePublicKeyRequest::Representation
332
+ command.request_object = remove_public_key_request_object
333
+ command.response_representation = Google::Apis::CloudshellV1::Operation::Representation
334
+ command.response_class = Google::Apis::CloudshellV1::Operation
335
+ command.params['environment'] = environment unless environment.nil?
336
+ command.query['fields'] = fields unless fields.nil?
337
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
338
+ execute_or_queue_command(command, &block)
339
+ end
340
+
341
+ # Starts an existing environment, allowing clients to connect to it. The
342
+ # returned operation will contain an instance of StartEnvironmentMetadata in its
343
+ # metadata field. Users can wait for the environment to start by polling this
344
+ # operation via GetOperation. Once the environment has finished starting and is
345
+ # ready to accept connections, the operation will contain a
346
+ # StartEnvironmentResponse in its response field.
347
+ # @param [String] name
348
+ # Name of the resource that should be started, for example `users/me/
349
+ # environments/default` or `users/someone@example.com/environments/default`.
350
+ # @param [Google::Apis::CloudshellV1::StartEnvironmentRequest] start_environment_request_object
351
+ # @param [String] fields
352
+ # Selector specifying which fields to include in a partial response.
353
+ # @param [String] quota_user
354
+ # Available to use for quota purposes for server-side applications. Can be any
355
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
356
+ # @param [Google::Apis::RequestOptions] options
357
+ # Request-specific options
358
+ #
359
+ # @yield [result, err] Result & error if block supplied
360
+ # @yieldparam result [Google::Apis::CloudshellV1::Operation] parsed result object
361
+ # @yieldparam err [StandardError] error object if request failed
362
+ #
363
+ # @return [Google::Apis::CloudshellV1::Operation]
364
+ #
365
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
366
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
367
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
368
+ def start_environment(name, start_environment_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
369
+ command = make_simple_command(:post, 'v1/{+name}:start', options)
370
+ command.request_representation = Google::Apis::CloudshellV1::StartEnvironmentRequest::Representation
371
+ command.request_object = start_environment_request_object
372
+ command.response_representation = Google::Apis::CloudshellV1::Operation::Representation
373
+ command.response_class = Google::Apis::CloudshellV1::Operation
374
+ command.params['name'] = name unless name.nil?
375
+ command.query['fields'] = fields unless fields.nil?
376
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
377
+ execute_or_queue_command(command, &block)
378
+ end
379
+
380
+ protected
381
+
382
+ def apply_command_defaults(command)
383
+ command.query['key'] = key unless key.nil?
384
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
385
+ end
386
+ end
387
+ end
388
+ end
389
+ end