google-apis-apim_v1alpha 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,818 @@
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 ApimV1alpha
23
+ # API Management API
24
+ #
25
+ # Enables users to discover shadow APIs in existing Google Cloud infrastructure.
26
+ #
27
+ # @example
28
+ # require 'google/apis/apim_v1alpha'
29
+ #
30
+ # Apim = Google::Apis::ApimV1alpha # Alias the module
31
+ # service = Apim::APIManagementService.new
32
+ #
33
+ # @see https://cloud.google.com/apigee/
34
+ class APIManagementService < Google::Apis::Core::BaseService
35
+ DEFAULT_ENDPOINT_TEMPLATE = "https://apim.$UNIVERSE_DOMAIN$/"
36
+
37
+ # @return [String]
38
+ # API key. Your API key identifies your project and provides you with API access,
39
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
40
+ attr_accessor :key
41
+
42
+ # @return [String]
43
+ # Available to use for quota purposes for server-side applications. Can be any
44
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
45
+ attr_accessor :quota_user
46
+
47
+ def initialize
48
+ super(DEFAULT_ENDPOINT_TEMPLATE, '',
49
+ client_name: 'google-apis-apim_v1alpha',
50
+ client_version: Google::Apis::ApimV1alpha::GEM_VERSION)
51
+ @batch_path = 'batch'
52
+ end
53
+
54
+ # Gets information about a location.
55
+ # @param [String] name
56
+ # Resource name for the location.
57
+ # @param [String] fields
58
+ # Selector specifying which fields to include in a partial response.
59
+ # @param [String] quota_user
60
+ # Available to use for quota purposes for server-side applications. Can be any
61
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
62
+ # @param [Google::Apis::RequestOptions] options
63
+ # Request-specific options
64
+ #
65
+ # @yield [result, err] Result & error if block supplied
66
+ # @yieldparam result [Google::Apis::ApimV1alpha::Location] parsed result object
67
+ # @yieldparam err [StandardError] error object if request failed
68
+ #
69
+ # @return [Google::Apis::ApimV1alpha::Location]
70
+ #
71
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
72
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
73
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
74
+ def get_project_location(name, fields: nil, quota_user: nil, options: nil, &block)
75
+ command = make_simple_command(:get, 'v1alpha/{+name}', options)
76
+ command.response_representation = Google::Apis::ApimV1alpha::Location::Representation
77
+ command.response_class = Google::Apis::ApimV1alpha::Location
78
+ command.params['name'] = name unless name.nil?
79
+ command.query['fields'] = fields unless fields.nil?
80
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
81
+ execute_or_queue_command(command, &block)
82
+ end
83
+
84
+ # Lists information about the supported locations for this service.
85
+ # @param [String] name
86
+ # The resource that owns the locations collection, if applicable.
87
+ # @param [String] filter
88
+ # A filter to narrow down results to a preferred subset. The filtering language
89
+ # accepts strings like `"displayName=tokyo"`, and is documented in more detail
90
+ # in [AIP-160](https://google.aip.dev/160).
91
+ # @param [Fixnum] page_size
92
+ # The maximum number of results to return. If not set, the service selects a
93
+ # default.
94
+ # @param [String] page_token
95
+ # A page token received from the `next_page_token` field in the response. Send
96
+ # that page token to receive the subsequent page.
97
+ # @param [String] fields
98
+ # Selector specifying which fields to include in a partial response.
99
+ # @param [String] quota_user
100
+ # Available to use for quota purposes for server-side applications. Can be any
101
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
102
+ # @param [Google::Apis::RequestOptions] options
103
+ # Request-specific options
104
+ #
105
+ # @yield [result, err] Result & error if block supplied
106
+ # @yieldparam result [Google::Apis::ApimV1alpha::ListLocationsResponse] parsed result object
107
+ # @yieldparam err [StandardError] error object if request failed
108
+ #
109
+ # @return [Google::Apis::ApimV1alpha::ListLocationsResponse]
110
+ #
111
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
112
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
113
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
114
+ def list_project_locations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
115
+ command = make_simple_command(:get, 'v1alpha/{+name}/locations', options)
116
+ command.response_representation = Google::Apis::ApimV1alpha::ListLocationsResponse::Representation
117
+ command.response_class = Google::Apis::ApimV1alpha::ListLocationsResponse
118
+ command.params['name'] = name unless name.nil?
119
+ command.query['filter'] = filter unless filter.nil?
120
+ command.query['pageSize'] = page_size unless page_size.nil?
121
+ command.query['pageToken'] = page_token unless page_token.nil?
122
+ command.query['fields'] = fields unless fields.nil?
123
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
124
+ execute_or_queue_command(command, &block)
125
+ end
126
+
127
+ # CreateObservationJob creates a new ObservationJob but does not have any
128
+ # effecton its own. It is a configuration that can be used in an Observation Job
129
+ # to collect data about existing APIs.
130
+ # @param [String] parent
131
+ # Required. The parent resource where this ObservationJob will be created.
132
+ # Format: projects/`project`/locations/`location`
133
+ # @param [Google::Apis::ApimV1alpha::ObservationJob] observation_job_object
134
+ # @param [String] observation_job_id
135
+ # Required. The ID to use for the Observation Job. This value should be 4-63
136
+ # characters, and valid characters are /a-z-/.
137
+ # @param [String] request_id
138
+ # Optional. An optional request ID to identify requests. Specify a unique
139
+ # request ID so that if you must retry your request, the server will know to
140
+ # ignore the request if it has already been completed. The server will guarantee
141
+ # that for at least 60 minutes since the first request. For example, consider a
142
+ # situation where you make an initial request and the request times out. If you
143
+ # make the request again with the same request ID, the server can check if
144
+ # original operation with the same request ID was received, and if so, will
145
+ # ignore the second request. This prevents clients from accidentally creating
146
+ # duplicate commitments. The request ID must be a valid UUID with the exception
147
+ # that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
148
+ # @param [String] fields
149
+ # Selector specifying which fields to include in a partial response.
150
+ # @param [String] quota_user
151
+ # Available to use for quota purposes for server-side applications. Can be any
152
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
153
+ # @param [Google::Apis::RequestOptions] options
154
+ # Request-specific options
155
+ #
156
+ # @yield [result, err] Result & error if block supplied
157
+ # @yieldparam result [Google::Apis::ApimV1alpha::Operation] parsed result object
158
+ # @yieldparam err [StandardError] error object if request failed
159
+ #
160
+ # @return [Google::Apis::ApimV1alpha::Operation]
161
+ #
162
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
163
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
164
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
165
+ def create_project_location_observation_job(parent, observation_job_object = nil, observation_job_id: nil, request_id: nil, fields: nil, quota_user: nil, options: nil, &block)
166
+ command = make_simple_command(:post, 'v1alpha/{+parent}/observationJobs', options)
167
+ command.request_representation = Google::Apis::ApimV1alpha::ObservationJob::Representation
168
+ command.request_object = observation_job_object
169
+ command.response_representation = Google::Apis::ApimV1alpha::Operation::Representation
170
+ command.response_class = Google::Apis::ApimV1alpha::Operation
171
+ command.params['parent'] = parent unless parent.nil?
172
+ command.query['observationJobId'] = observation_job_id unless observation_job_id.nil?
173
+ command.query['requestId'] = request_id unless request_id.nil?
174
+ command.query['fields'] = fields unless fields.nil?
175
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
176
+ execute_or_queue_command(command, &block)
177
+ end
178
+
179
+ # DeleteObservationJob deletes an ObservationJob. This method will fail if the
180
+ # observation job is currently being used by any ObservationSource, even if not
181
+ # enabled.
182
+ # @param [String] name
183
+ # Required. Name of the resource Format: projects/`project`/locations/`location`/
184
+ # observationJobs/`observation_job`
185
+ # @param [String] fields
186
+ # Selector specifying which fields to include in a partial response.
187
+ # @param [String] quota_user
188
+ # Available to use for quota purposes for server-side applications. Can be any
189
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
190
+ # @param [Google::Apis::RequestOptions] options
191
+ # Request-specific options
192
+ #
193
+ # @yield [result, err] Result & error if block supplied
194
+ # @yieldparam result [Google::Apis::ApimV1alpha::Operation] parsed result object
195
+ # @yieldparam err [StandardError] error object if request failed
196
+ #
197
+ # @return [Google::Apis::ApimV1alpha::Operation]
198
+ #
199
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
200
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
201
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
202
+ def delete_project_location_observation_job(name, fields: nil, quota_user: nil, options: nil, &block)
203
+ command = make_simple_command(:delete, 'v1alpha/{+name}', options)
204
+ command.response_representation = Google::Apis::ApimV1alpha::Operation::Representation
205
+ command.response_class = Google::Apis::ApimV1alpha::Operation
206
+ command.params['name'] = name unless name.nil?
207
+ command.query['fields'] = fields unless fields.nil?
208
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
209
+ execute_or_queue_command(command, &block)
210
+ end
211
+
212
+ # Disables the given ObservationJob.
213
+ # @param [String] name
214
+ # Required. The name of the ObservationJob to disable. Format: projects/`project`
215
+ # /locations/`location`/observationJobs/`job`
216
+ # @param [Google::Apis::ApimV1alpha::DisableObservationJobRequest] disable_observation_job_request_object
217
+ # @param [String] fields
218
+ # Selector specifying which fields to include in a partial response.
219
+ # @param [String] quota_user
220
+ # Available to use for quota purposes for server-side applications. Can be any
221
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
222
+ # @param [Google::Apis::RequestOptions] options
223
+ # Request-specific options
224
+ #
225
+ # @yield [result, err] Result & error if block supplied
226
+ # @yieldparam result [Google::Apis::ApimV1alpha::Operation] parsed result object
227
+ # @yieldparam err [StandardError] error object if request failed
228
+ #
229
+ # @return [Google::Apis::ApimV1alpha::Operation]
230
+ #
231
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
232
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
233
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
234
+ def disable_observation_job(name, disable_observation_job_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
235
+ command = make_simple_command(:post, 'v1alpha/{+name}:disable', options)
236
+ command.request_representation = Google::Apis::ApimV1alpha::DisableObservationJobRequest::Representation
237
+ command.request_object = disable_observation_job_request_object
238
+ command.response_representation = Google::Apis::ApimV1alpha::Operation::Representation
239
+ command.response_class = Google::Apis::ApimV1alpha::Operation
240
+ command.params['name'] = name unless name.nil?
241
+ command.query['fields'] = fields unless fields.nil?
242
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
243
+ execute_or_queue_command(command, &block)
244
+ end
245
+
246
+ # Enables the given ObservationJob.
247
+ # @param [String] name
248
+ # Required. The name of the ObservationJob to enable. Format: projects/`project`/
249
+ # locations/`location`/observationJobs/`job`
250
+ # @param [Google::Apis::ApimV1alpha::EnableObservationJobRequest] enable_observation_job_request_object
251
+ # @param [String] fields
252
+ # Selector specifying which fields to include in a partial response.
253
+ # @param [String] quota_user
254
+ # Available to use for quota purposes for server-side applications. Can be any
255
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
256
+ # @param [Google::Apis::RequestOptions] options
257
+ # Request-specific options
258
+ #
259
+ # @yield [result, err] Result & error if block supplied
260
+ # @yieldparam result [Google::Apis::ApimV1alpha::Operation] parsed result object
261
+ # @yieldparam err [StandardError] error object if request failed
262
+ #
263
+ # @return [Google::Apis::ApimV1alpha::Operation]
264
+ #
265
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
266
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
267
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
268
+ def enable_observation_job(name, enable_observation_job_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
269
+ command = make_simple_command(:post, 'v1alpha/{+name}:enable', options)
270
+ command.request_representation = Google::Apis::ApimV1alpha::EnableObservationJobRequest::Representation
271
+ command.request_object = enable_observation_job_request_object
272
+ command.response_representation = Google::Apis::ApimV1alpha::Operation::Representation
273
+ command.response_class = Google::Apis::ApimV1alpha::Operation
274
+ command.params['name'] = name unless name.nil?
275
+ command.query['fields'] = fields unless fields.nil?
276
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
277
+ execute_or_queue_command(command, &block)
278
+ end
279
+
280
+ # GetObservationJob retrieves a single ObservationJob by name.
281
+ # @param [String] name
282
+ # Required. The name of the ObservationJob to retrieve. Format: projects/`
283
+ # project`/locations/`location`/observationJobs/`job`
284
+ # @param [String] fields
285
+ # Selector specifying which fields to include in a partial response.
286
+ # @param [String] quota_user
287
+ # Available to use for quota purposes for server-side applications. Can be any
288
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
289
+ # @param [Google::Apis::RequestOptions] options
290
+ # Request-specific options
291
+ #
292
+ # @yield [result, err] Result & error if block supplied
293
+ # @yieldparam result [Google::Apis::ApimV1alpha::ObservationJob] parsed result object
294
+ # @yieldparam err [StandardError] error object if request failed
295
+ #
296
+ # @return [Google::Apis::ApimV1alpha::ObservationJob]
297
+ #
298
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
299
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
300
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
301
+ def get_project_location_observation_job(name, fields: nil, quota_user: nil, options: nil, &block)
302
+ command = make_simple_command(:get, 'v1alpha/{+name}', options)
303
+ command.response_representation = Google::Apis::ApimV1alpha::ObservationJob::Representation
304
+ command.response_class = Google::Apis::ApimV1alpha::ObservationJob
305
+ command.params['name'] = name unless name.nil?
306
+ command.query['fields'] = fields unless fields.nil?
307
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
308
+ execute_or_queue_command(command, &block)
309
+ end
310
+
311
+ # ListObservationJobs gets all ObservationJobs for a given project and location
312
+ # @param [String] parent
313
+ # Required. The parent, which owns this collection of ObservationJobs. Format:
314
+ # projects/`project`/locations/`location`
315
+ # @param [Fixnum] page_size
316
+ # Optional. The maximum number of ObservationJobs to return. The service may
317
+ # return fewer than this value. If unspecified, at most 10 ObservationJobs will
318
+ # be returned. The maximum value is 1000; values above 1000 will be coerced to
319
+ # 1000.
320
+ # @param [String] page_token
321
+ # Optional. A page token, received from a previous `ListObservationJobs` call.
322
+ # Provide this to retrieve the subsequent page. When paginating, all other
323
+ # parameters provided to `ListObservationJobs` must match the call that provided
324
+ # the page token.
325
+ # @param [String] fields
326
+ # Selector specifying which fields to include in a partial response.
327
+ # @param [String] quota_user
328
+ # Available to use for quota purposes for server-side applications. Can be any
329
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
330
+ # @param [Google::Apis::RequestOptions] options
331
+ # Request-specific options
332
+ #
333
+ # @yield [result, err] Result & error if block supplied
334
+ # @yieldparam result [Google::Apis::ApimV1alpha::ListObservationJobsResponse] parsed result object
335
+ # @yieldparam err [StandardError] error object if request failed
336
+ #
337
+ # @return [Google::Apis::ApimV1alpha::ListObservationJobsResponse]
338
+ #
339
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
340
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
341
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
342
+ def list_project_location_observation_jobs(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
343
+ command = make_simple_command(:get, 'v1alpha/{+parent}/observationJobs', options)
344
+ command.response_representation = Google::Apis::ApimV1alpha::ListObservationJobsResponse::Representation
345
+ command.response_class = Google::Apis::ApimV1alpha::ListObservationJobsResponse
346
+ command.params['parent'] = parent unless parent.nil?
347
+ command.query['pageSize'] = page_size unless page_size.nil?
348
+ command.query['pageToken'] = page_token unless page_token.nil?
349
+ command.query['fields'] = fields unless fields.nil?
350
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
351
+ execute_or_queue_command(command, &block)
352
+ end
353
+
354
+ # GetApiObservation retrieves a single ApiObservation by name.
355
+ # @param [String] name
356
+ # Required. The name of the ApiObservation to retrieve. Format: projects/`
357
+ # project`/locations/`location`/observationJobs/`observation_job`/
358
+ # apiObservations/`api_observation`
359
+ # @param [String] fields
360
+ # Selector specifying which fields to include in a partial response.
361
+ # @param [String] quota_user
362
+ # Available to use for quota purposes for server-side applications. Can be any
363
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
364
+ # @param [Google::Apis::RequestOptions] options
365
+ # Request-specific options
366
+ #
367
+ # @yield [result, err] Result & error if block supplied
368
+ # @yieldparam result [Google::Apis::ApimV1alpha::ApiObservation] parsed result object
369
+ # @yieldparam err [StandardError] error object if request failed
370
+ #
371
+ # @return [Google::Apis::ApimV1alpha::ApiObservation]
372
+ #
373
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
374
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
375
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
376
+ def get_project_location_observation_job_api_observation(name, fields: nil, quota_user: nil, options: nil, &block)
377
+ command = make_simple_command(:get, 'v1alpha/{+name}', options)
378
+ command.response_representation = Google::Apis::ApimV1alpha::ApiObservation::Representation
379
+ command.response_class = Google::Apis::ApimV1alpha::ApiObservation
380
+ command.params['name'] = name unless name.nil?
381
+ command.query['fields'] = fields unless fields.nil?
382
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
383
+ execute_or_queue_command(command, &block)
384
+ end
385
+
386
+ # ListApiObservations gets all ApiObservations for a given project and location
387
+ # and ObservationJob
388
+ # @param [String] parent
389
+ # Required. The parent, which owns this collection of ApiObservations. Format:
390
+ # projects/`project`/locations/`location`/observationJobs/`observation_job`
391
+ # @param [Fixnum] page_size
392
+ # Optional. The maximum number of ApiObservations to return. The service may
393
+ # return fewer than this value. If unspecified, at most 10 ApiObservations will
394
+ # be returned. The maximum value is 1000; values above 1000 will be coerced to
395
+ # 1000.
396
+ # @param [String] page_token
397
+ # Optional. A page token, received from a previous `ListApiObservations` call.
398
+ # Provide this to retrieve the subsequent page. When paginating, all other
399
+ # parameters provided to `ListApiObservations` must match the call that provided
400
+ # the page token.
401
+ # @param [String] fields
402
+ # Selector specifying which fields to include in a partial response.
403
+ # @param [String] quota_user
404
+ # Available to use for quota purposes for server-side applications. Can be any
405
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
406
+ # @param [Google::Apis::RequestOptions] options
407
+ # Request-specific options
408
+ #
409
+ # @yield [result, err] Result & error if block supplied
410
+ # @yieldparam result [Google::Apis::ApimV1alpha::ListApiObservationsResponse] parsed result object
411
+ # @yieldparam err [StandardError] error object if request failed
412
+ #
413
+ # @return [Google::Apis::ApimV1alpha::ListApiObservationsResponse]
414
+ #
415
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
416
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
417
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
418
+ def list_project_location_observation_job_api_observations(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
419
+ command = make_simple_command(:get, 'v1alpha/{+parent}/apiObservations', options)
420
+ command.response_representation = Google::Apis::ApimV1alpha::ListApiObservationsResponse::Representation
421
+ command.response_class = Google::Apis::ApimV1alpha::ListApiObservationsResponse
422
+ command.params['parent'] = parent unless parent.nil?
423
+ command.query['pageSize'] = page_size unless page_size.nil?
424
+ command.query['pageToken'] = page_token unless page_token.nil?
425
+ command.query['fields'] = fields unless fields.nil?
426
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
427
+ execute_or_queue_command(command, &block)
428
+ end
429
+
430
+ # GetApiOperation retrieves a single ApiOperation by name.
431
+ # @param [String] name
432
+ # Required. The name of the ApiOperation to retrieve. Format: projects/`project`/
433
+ # locations/`location`/observationJobs/`observation_job`/apiObservations/`
434
+ # api_observation`/apiOperation/`api_operation`
435
+ # @param [String] fields
436
+ # Selector specifying which fields to include in a partial response.
437
+ # @param [String] quota_user
438
+ # Available to use for quota purposes for server-side applications. Can be any
439
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
440
+ # @param [Google::Apis::RequestOptions] options
441
+ # Request-specific options
442
+ #
443
+ # @yield [result, err] Result & error if block supplied
444
+ # @yieldparam result [Google::Apis::ApimV1alpha::ApiOperation] parsed result object
445
+ # @yieldparam err [StandardError] error object if request failed
446
+ #
447
+ # @return [Google::Apis::ApimV1alpha::ApiOperation]
448
+ #
449
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
450
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
451
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
452
+ def get_project_location_observation_job_api_observation_api_operation(name, fields: nil, quota_user: nil, options: nil, &block)
453
+ command = make_simple_command(:get, 'v1alpha/{+name}', options)
454
+ command.response_representation = Google::Apis::ApimV1alpha::ApiOperation::Representation
455
+ command.response_class = Google::Apis::ApimV1alpha::ApiOperation
456
+ command.params['name'] = name unless name.nil?
457
+ command.query['fields'] = fields unless fields.nil?
458
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
459
+ execute_or_queue_command(command, &block)
460
+ end
461
+
462
+ # ListApiOperations gets all ApiOperations for a given project and location and
463
+ # ObservationJob and ApiObservation
464
+ # @param [String] parent
465
+ # Required. The parent, which owns this collection of ApiOperations. Format:
466
+ # projects/`project`/locations/`location`/observationJobs/`observation_job`/
467
+ # apiObservations/`api_observation`
468
+ # @param [Fixnum] page_size
469
+ # Optional. The maximum number of ApiOperations to return. The service may
470
+ # return fewer than this value. If unspecified, at most 10 ApiOperations will be
471
+ # returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
472
+ # @param [String] page_token
473
+ # Optional. A page token, received from a previous `ListApiApiOperations` call.
474
+ # Provide this to retrieve the subsequent page. When paginating, all other
475
+ # parameters provided to `ListApiApiOperations` must match the call that
476
+ # provided the page token.
477
+ # @param [String] fields
478
+ # Selector specifying which fields to include in a partial response.
479
+ # @param [String] quota_user
480
+ # Available to use for quota purposes for server-side applications. Can be any
481
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
482
+ # @param [Google::Apis::RequestOptions] options
483
+ # Request-specific options
484
+ #
485
+ # @yield [result, err] Result & error if block supplied
486
+ # @yieldparam result [Google::Apis::ApimV1alpha::ListApiOperationsResponse] parsed result object
487
+ # @yieldparam err [StandardError] error object if request failed
488
+ #
489
+ # @return [Google::Apis::ApimV1alpha::ListApiOperationsResponse]
490
+ #
491
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
492
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
493
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
494
+ def list_project_location_observation_job_api_observation_api_operations(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
495
+ command = make_simple_command(:get, 'v1alpha/{+parent}/apiOperations', options)
496
+ command.response_representation = Google::Apis::ApimV1alpha::ListApiOperationsResponse::Representation
497
+ command.response_class = Google::Apis::ApimV1alpha::ListApiOperationsResponse
498
+ command.params['parent'] = parent unless parent.nil?
499
+ command.query['pageSize'] = page_size unless page_size.nil?
500
+ command.query['pageToken'] = page_token unless page_token.nil?
501
+ command.query['fields'] = fields unless fields.nil?
502
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
503
+ execute_or_queue_command(command, &block)
504
+ end
505
+
506
+ # CreateObservationSource creates a new ObservationSource but does not affect
507
+ # any deployed infrastructure. It is a configuration that can be used in an
508
+ # Observation Job to collect data about APIs running in user's dataplane.
509
+ # @param [String] parent
510
+ # Required. Value for parent.
511
+ # @param [Google::Apis::ApimV1alpha::ObservationSource] observation_source_object
512
+ # @param [String] observation_source_id
513
+ # Required. The ID to use for the Observation Source. This value should be 4-63
514
+ # characters, and valid characters are /a-z-/.
515
+ # @param [String] request_id
516
+ # Optional. An optional request ID to identify requests. Specify a unique
517
+ # request ID so that if you must retry your request, the server will know to
518
+ # ignore the request if it has already been completed. The server will guarantee
519
+ # that for at least 60 minutes since the first request. For example, consider a
520
+ # situation where you make an initial request and the request times out. If you
521
+ # make the request again with the same request ID, the server can check if
522
+ # original operation with the same request ID was received, and if so, will
523
+ # ignore the second request. This prevents clients from accidentally creating
524
+ # duplicate commitments. The request ID must be a valid UUID with the exception
525
+ # that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
526
+ # @param [String] fields
527
+ # Selector specifying which fields to include in a partial response.
528
+ # @param [String] quota_user
529
+ # Available to use for quota purposes for server-side applications. Can be any
530
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
531
+ # @param [Google::Apis::RequestOptions] options
532
+ # Request-specific options
533
+ #
534
+ # @yield [result, err] Result & error if block supplied
535
+ # @yieldparam result [Google::Apis::ApimV1alpha::Operation] parsed result object
536
+ # @yieldparam err [StandardError] error object if request failed
537
+ #
538
+ # @return [Google::Apis::ApimV1alpha::Operation]
539
+ #
540
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
541
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
542
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
543
+ def create_project_location_observation_source(parent, observation_source_object = nil, observation_source_id: nil, request_id: nil, fields: nil, quota_user: nil, options: nil, &block)
544
+ command = make_simple_command(:post, 'v1alpha/{+parent}/observationSources', options)
545
+ command.request_representation = Google::Apis::ApimV1alpha::ObservationSource::Representation
546
+ command.request_object = observation_source_object
547
+ command.response_representation = Google::Apis::ApimV1alpha::Operation::Representation
548
+ command.response_class = Google::Apis::ApimV1alpha::Operation
549
+ command.params['parent'] = parent unless parent.nil?
550
+ command.query['observationSourceId'] = observation_source_id unless observation_source_id.nil?
551
+ command.query['requestId'] = request_id unless request_id.nil?
552
+ command.query['fields'] = fields unless fields.nil?
553
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
554
+ execute_or_queue_command(command, &block)
555
+ end
556
+
557
+ # DeleteObservationSource deletes an observation source. This method will fail
558
+ # if the observation source is currently being used by any ObservationJob, even
559
+ # if not enabled.
560
+ # @param [String] name
561
+ # Required. Name of the resource Format: projects/`project`/locations/`location`/
562
+ # observationSources/`source`
563
+ # @param [String] fields
564
+ # Selector specifying which fields to include in a partial response.
565
+ # @param [String] quota_user
566
+ # Available to use for quota purposes for server-side applications. Can be any
567
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
568
+ # @param [Google::Apis::RequestOptions] options
569
+ # Request-specific options
570
+ #
571
+ # @yield [result, err] Result & error if block supplied
572
+ # @yieldparam result [Google::Apis::ApimV1alpha::Operation] parsed result object
573
+ # @yieldparam err [StandardError] error object if request failed
574
+ #
575
+ # @return [Google::Apis::ApimV1alpha::Operation]
576
+ #
577
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
578
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
579
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
580
+ def delete_project_location_observation_source(name, fields: nil, quota_user: nil, options: nil, &block)
581
+ command = make_simple_command(:delete, 'v1alpha/{+name}', options)
582
+ command.response_representation = Google::Apis::ApimV1alpha::Operation::Representation
583
+ command.response_class = Google::Apis::ApimV1alpha::Operation
584
+ command.params['name'] = name unless name.nil?
585
+ command.query['fields'] = fields unless fields.nil?
586
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
587
+ execute_or_queue_command(command, &block)
588
+ end
589
+
590
+ # GetObservationSource retrieves a single ObservationSource by name.
591
+ # @param [String] name
592
+ # Required. The name of the ObservationSource to retrieve. Format: projects/`
593
+ # project`/locations/`location`/observationSources/`source`
594
+ # @param [String] fields
595
+ # Selector specifying which fields to include in a partial response.
596
+ # @param [String] quota_user
597
+ # Available to use for quota purposes for server-side applications. Can be any
598
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
599
+ # @param [Google::Apis::RequestOptions] options
600
+ # Request-specific options
601
+ #
602
+ # @yield [result, err] Result & error if block supplied
603
+ # @yieldparam result [Google::Apis::ApimV1alpha::ObservationSource] parsed result object
604
+ # @yieldparam err [StandardError] error object if request failed
605
+ #
606
+ # @return [Google::Apis::ApimV1alpha::ObservationSource]
607
+ #
608
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
609
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
610
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
611
+ def get_project_location_observation_source(name, fields: nil, quota_user: nil, options: nil, &block)
612
+ command = make_simple_command(:get, 'v1alpha/{+name}', options)
613
+ command.response_representation = Google::Apis::ApimV1alpha::ObservationSource::Representation
614
+ command.response_class = Google::Apis::ApimV1alpha::ObservationSource
615
+ command.params['name'] = name unless name.nil?
616
+ command.query['fields'] = fields unless fields.nil?
617
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
618
+ execute_or_queue_command(command, &block)
619
+ end
620
+
621
+ # ListObservationSources gets all ObservationSources for a given project and
622
+ # location
623
+ # @param [String] parent
624
+ # Required. The parent, which owns this collection of ObservationSources. Format:
625
+ # projects/`project`/locations/`location`
626
+ # @param [Fixnum] page_size
627
+ # Optional. The maximum number of ObservationSources to return. The service may
628
+ # return fewer than this value. If unspecified, at most 10 ObservationSources
629
+ # will be returned. The maximum value is 1000; values above 1000 will be coerced
630
+ # to 1000.
631
+ # @param [String] page_token
632
+ # Optional. A page token, received from a previous `ListObservationSources` call.
633
+ # Provide this to retrieve the subsequent page. When paginating, all other
634
+ # parameters provided to `ListObservationSources` must match the call that
635
+ # provided the page token.
636
+ # @param [String] fields
637
+ # Selector specifying which fields to include in a partial response.
638
+ # @param [String] quota_user
639
+ # Available to use for quota purposes for server-side applications. Can be any
640
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
641
+ # @param [Google::Apis::RequestOptions] options
642
+ # Request-specific options
643
+ #
644
+ # @yield [result, err] Result & error if block supplied
645
+ # @yieldparam result [Google::Apis::ApimV1alpha::ListObservationSourcesResponse] parsed result object
646
+ # @yieldparam err [StandardError] error object if request failed
647
+ #
648
+ # @return [Google::Apis::ApimV1alpha::ListObservationSourcesResponse]
649
+ #
650
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
651
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
652
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
653
+ def list_project_location_observation_sources(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
654
+ command = make_simple_command(:get, 'v1alpha/{+parent}/observationSources', options)
655
+ command.response_representation = Google::Apis::ApimV1alpha::ListObservationSourcesResponse::Representation
656
+ command.response_class = Google::Apis::ApimV1alpha::ListObservationSourcesResponse
657
+ command.params['parent'] = parent unless parent.nil?
658
+ command.query['pageSize'] = page_size unless page_size.nil?
659
+ command.query['pageToken'] = page_token unless page_token.nil?
660
+ command.query['fields'] = fields unless fields.nil?
661
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
662
+ execute_or_queue_command(command, &block)
663
+ end
664
+
665
+ # Starts asynchronous cancellation on a long-running operation. The server makes
666
+ # a best effort to cancel the operation, but success is not guaranteed. If the
667
+ # server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
668
+ # Clients can use Operations.GetOperation or other methods to check whether the
669
+ # cancellation succeeded or whether the operation completed despite cancellation.
670
+ # On successful cancellation, the operation is not deleted; instead, it becomes
671
+ # an operation with an Operation.error value with a google.rpc.Status.code of 1,
672
+ # corresponding to `Code.CANCELLED`.
673
+ # @param [String] name
674
+ # The name of the operation resource to be cancelled.
675
+ # @param [Google::Apis::ApimV1alpha::CancelOperationRequest] cancel_operation_request_object
676
+ # @param [String] fields
677
+ # Selector specifying which fields to include in a partial response.
678
+ # @param [String] quota_user
679
+ # Available to use for quota purposes for server-side applications. Can be any
680
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
681
+ # @param [Google::Apis::RequestOptions] options
682
+ # Request-specific options
683
+ #
684
+ # @yield [result, err] Result & error if block supplied
685
+ # @yieldparam result [Google::Apis::ApimV1alpha::Empty] parsed result object
686
+ # @yieldparam err [StandardError] error object if request failed
687
+ #
688
+ # @return [Google::Apis::ApimV1alpha::Empty]
689
+ #
690
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
691
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
692
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
693
+ def cancel_operation(name, cancel_operation_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
694
+ command = make_simple_command(:post, 'v1alpha/{+name}:cancel', options)
695
+ command.request_representation = Google::Apis::ApimV1alpha::CancelOperationRequest::Representation
696
+ command.request_object = cancel_operation_request_object
697
+ command.response_representation = Google::Apis::ApimV1alpha::Empty::Representation
698
+ command.response_class = Google::Apis::ApimV1alpha::Empty
699
+ command.params['name'] = name unless name.nil?
700
+ command.query['fields'] = fields unless fields.nil?
701
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
702
+ execute_or_queue_command(command, &block)
703
+ end
704
+
705
+ # Deletes a long-running operation. This method indicates that the client is no
706
+ # longer interested in the operation result. It does not cancel the operation.
707
+ # If the server doesn't support this method, it returns `google.rpc.Code.
708
+ # UNIMPLEMENTED`.
709
+ # @param [String] name
710
+ # The name of the operation resource to be deleted.
711
+ # @param [String] fields
712
+ # Selector specifying which fields to include in a partial response.
713
+ # @param [String] quota_user
714
+ # Available to use for quota purposes for server-side applications. Can be any
715
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
716
+ # @param [Google::Apis::RequestOptions] options
717
+ # Request-specific options
718
+ #
719
+ # @yield [result, err] Result & error if block supplied
720
+ # @yieldparam result [Google::Apis::ApimV1alpha::Empty] parsed result object
721
+ # @yieldparam err [StandardError] error object if request failed
722
+ #
723
+ # @return [Google::Apis::ApimV1alpha::Empty]
724
+ #
725
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
726
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
727
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
728
+ def delete_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
729
+ command = make_simple_command(:delete, 'v1alpha/{+name}', options)
730
+ command.response_representation = Google::Apis::ApimV1alpha::Empty::Representation
731
+ command.response_class = Google::Apis::ApimV1alpha::Empty
732
+ command.params['name'] = name unless name.nil?
733
+ command.query['fields'] = fields unless fields.nil?
734
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
735
+ execute_or_queue_command(command, &block)
736
+ end
737
+
738
+ # Gets the latest state of a long-running operation. Clients can use this method
739
+ # to poll the operation result at intervals as recommended by the API service.
740
+ # @param [String] name
741
+ # The name of the operation resource.
742
+ # @param [String] fields
743
+ # Selector specifying which fields to include in a partial response.
744
+ # @param [String] quota_user
745
+ # Available to use for quota purposes for server-side applications. Can be any
746
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
747
+ # @param [Google::Apis::RequestOptions] options
748
+ # Request-specific options
749
+ #
750
+ # @yield [result, err] Result & error if block supplied
751
+ # @yieldparam result [Google::Apis::ApimV1alpha::Operation] parsed result object
752
+ # @yieldparam err [StandardError] error object if request failed
753
+ #
754
+ # @return [Google::Apis::ApimV1alpha::Operation]
755
+ #
756
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
757
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
758
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
759
+ def get_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
760
+ command = make_simple_command(:get, 'v1alpha/{+name}', options)
761
+ command.response_representation = Google::Apis::ApimV1alpha::Operation::Representation
762
+ command.response_class = Google::Apis::ApimV1alpha::Operation
763
+ command.params['name'] = name unless name.nil?
764
+ command.query['fields'] = fields unless fields.nil?
765
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
766
+ execute_or_queue_command(command, &block)
767
+ end
768
+
769
+ # Lists operations that match the specified filter in the request. If the server
770
+ # doesn't support this method, it returns `UNIMPLEMENTED`.
771
+ # @param [String] name
772
+ # The name of the operation's parent resource.
773
+ # @param [String] filter
774
+ # The standard list filter.
775
+ # @param [Fixnum] page_size
776
+ # The standard list page size.
777
+ # @param [String] page_token
778
+ # The standard list page token.
779
+ # @param [String] fields
780
+ # Selector specifying which fields to include in a partial response.
781
+ # @param [String] quota_user
782
+ # Available to use for quota purposes for server-side applications. Can be any
783
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
784
+ # @param [Google::Apis::RequestOptions] options
785
+ # Request-specific options
786
+ #
787
+ # @yield [result, err] Result & error if block supplied
788
+ # @yieldparam result [Google::Apis::ApimV1alpha::ListOperationsResponse] parsed result object
789
+ # @yieldparam err [StandardError] error object if request failed
790
+ #
791
+ # @return [Google::Apis::ApimV1alpha::ListOperationsResponse]
792
+ #
793
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
794
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
795
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
796
+ def list_project_location_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
797
+ command = make_simple_command(:get, 'v1alpha/{+name}/operations', options)
798
+ command.response_representation = Google::Apis::ApimV1alpha::ListOperationsResponse::Representation
799
+ command.response_class = Google::Apis::ApimV1alpha::ListOperationsResponse
800
+ command.params['name'] = name unless name.nil?
801
+ command.query['filter'] = filter unless filter.nil?
802
+ command.query['pageSize'] = page_size unless page_size.nil?
803
+ command.query['pageToken'] = page_token unless page_token.nil?
804
+ command.query['fields'] = fields unless fields.nil?
805
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
806
+ execute_or_queue_command(command, &block)
807
+ end
808
+
809
+ protected
810
+
811
+ def apply_command_defaults(command)
812
+ command.query['key'] = key unless key.nil?
813
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
814
+ end
815
+ end
816
+ end
817
+ end
818
+ end