google-apis-servicecontrol_v2 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.yardopts +13 -0
- data/CHANGELOG.md +7 -0
- data/LICENSE.md +202 -0
- data/OVERVIEW.md +96 -0
- data/lib/google-apis-servicecontrol_v2.rb +15 -0
- data/lib/google/apis/servicecontrol_v2.rb +40 -0
- data/lib/google/apis/servicecontrol_v2/classes.rb +1139 -0
- data/lib/google/apis/servicecontrol_v2/gem_version.rb +28 -0
- data/lib/google/apis/servicecontrol_v2/representations.rb +413 -0
- data/lib/google/apis/servicecontrol_v2/service.rb +157 -0
- metadata +76 -0
@@ -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 ServicecontrolV2
|
18
|
+
# Version of the google-apis-servicecontrol_v2 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 = "20201207"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,413 @@
|
|
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 ServicecontrolV2
|
24
|
+
|
25
|
+
class Api
|
26
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
27
|
+
|
28
|
+
include Google::Apis::Core::JsonObjectSupport
|
29
|
+
end
|
30
|
+
|
31
|
+
class AttributeContext
|
32
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
33
|
+
|
34
|
+
include Google::Apis::Core::JsonObjectSupport
|
35
|
+
end
|
36
|
+
|
37
|
+
class AuditLog
|
38
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
39
|
+
|
40
|
+
include Google::Apis::Core::JsonObjectSupport
|
41
|
+
end
|
42
|
+
|
43
|
+
class Auth
|
44
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
45
|
+
|
46
|
+
include Google::Apis::Core::JsonObjectSupport
|
47
|
+
end
|
48
|
+
|
49
|
+
class AuthenticationInfo
|
50
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
51
|
+
|
52
|
+
include Google::Apis::Core::JsonObjectSupport
|
53
|
+
end
|
54
|
+
|
55
|
+
class AuthorizationInfo
|
56
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
57
|
+
|
58
|
+
include Google::Apis::Core::JsonObjectSupport
|
59
|
+
end
|
60
|
+
|
61
|
+
class CheckRequest
|
62
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
63
|
+
|
64
|
+
include Google::Apis::Core::JsonObjectSupport
|
65
|
+
end
|
66
|
+
|
67
|
+
class CheckResponse
|
68
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
69
|
+
|
70
|
+
include Google::Apis::Core::JsonObjectSupport
|
71
|
+
end
|
72
|
+
|
73
|
+
class FirstPartyPrincipal
|
74
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
75
|
+
|
76
|
+
include Google::Apis::Core::JsonObjectSupport
|
77
|
+
end
|
78
|
+
|
79
|
+
class Peer
|
80
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
81
|
+
|
82
|
+
include Google::Apis::Core::JsonObjectSupport
|
83
|
+
end
|
84
|
+
|
85
|
+
class ReportRequest
|
86
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
87
|
+
|
88
|
+
include Google::Apis::Core::JsonObjectSupport
|
89
|
+
end
|
90
|
+
|
91
|
+
class ReportResponse
|
92
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
93
|
+
|
94
|
+
include Google::Apis::Core::JsonObjectSupport
|
95
|
+
end
|
96
|
+
|
97
|
+
class Request
|
98
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
99
|
+
|
100
|
+
include Google::Apis::Core::JsonObjectSupport
|
101
|
+
end
|
102
|
+
|
103
|
+
class RequestMetadata
|
104
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
105
|
+
|
106
|
+
include Google::Apis::Core::JsonObjectSupport
|
107
|
+
end
|
108
|
+
|
109
|
+
class Resource
|
110
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
111
|
+
|
112
|
+
include Google::Apis::Core::JsonObjectSupport
|
113
|
+
end
|
114
|
+
|
115
|
+
class ResourceInfo
|
116
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
117
|
+
|
118
|
+
include Google::Apis::Core::JsonObjectSupport
|
119
|
+
end
|
120
|
+
|
121
|
+
class ResourceLocation
|
122
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
123
|
+
|
124
|
+
include Google::Apis::Core::JsonObjectSupport
|
125
|
+
end
|
126
|
+
|
127
|
+
class Response
|
128
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
129
|
+
|
130
|
+
include Google::Apis::Core::JsonObjectSupport
|
131
|
+
end
|
132
|
+
|
133
|
+
class ServiceAccountDelegationInfo
|
134
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
135
|
+
|
136
|
+
include Google::Apis::Core::JsonObjectSupport
|
137
|
+
end
|
138
|
+
|
139
|
+
class SpanContext
|
140
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
141
|
+
|
142
|
+
include Google::Apis::Core::JsonObjectSupport
|
143
|
+
end
|
144
|
+
|
145
|
+
class Status
|
146
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
147
|
+
|
148
|
+
include Google::Apis::Core::JsonObjectSupport
|
149
|
+
end
|
150
|
+
|
151
|
+
class ThirdPartyPrincipal
|
152
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
153
|
+
|
154
|
+
include Google::Apis::Core::JsonObjectSupport
|
155
|
+
end
|
156
|
+
|
157
|
+
class Api
|
158
|
+
# @private
|
159
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
160
|
+
property :operation, as: 'operation'
|
161
|
+
property :protocol, as: 'protocol'
|
162
|
+
property :service, as: 'service'
|
163
|
+
property :version, as: 'version'
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
class AttributeContext
|
168
|
+
# @private
|
169
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
170
|
+
property :api, as: 'api', class: Google::Apis::ServicecontrolV2::Api, decorator: Google::Apis::ServicecontrolV2::Api::Representation
|
171
|
+
|
172
|
+
property :destination, as: 'destination', class: Google::Apis::ServicecontrolV2::Peer, decorator: Google::Apis::ServicecontrolV2::Peer::Representation
|
173
|
+
|
174
|
+
collection :extensions, as: 'extensions'
|
175
|
+
property :origin, as: 'origin', class: Google::Apis::ServicecontrolV2::Peer, decorator: Google::Apis::ServicecontrolV2::Peer::Representation
|
176
|
+
|
177
|
+
property :request, as: 'request', class: Google::Apis::ServicecontrolV2::Request, decorator: Google::Apis::ServicecontrolV2::Request::Representation
|
178
|
+
|
179
|
+
property :resource, as: 'resource', class: Google::Apis::ServicecontrolV2::Resource, decorator: Google::Apis::ServicecontrolV2::Resource::Representation
|
180
|
+
|
181
|
+
property :response, as: 'response', class: Google::Apis::ServicecontrolV2::Response, decorator: Google::Apis::ServicecontrolV2::Response::Representation
|
182
|
+
|
183
|
+
property :source, as: 'source', class: Google::Apis::ServicecontrolV2::Peer, decorator: Google::Apis::ServicecontrolV2::Peer::Representation
|
184
|
+
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
class AuditLog
|
189
|
+
# @private
|
190
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
191
|
+
property :authentication_info, as: 'authenticationInfo', class: Google::Apis::ServicecontrolV2::AuthenticationInfo, decorator: Google::Apis::ServicecontrolV2::AuthenticationInfo::Representation
|
192
|
+
|
193
|
+
collection :authorization_info, as: 'authorizationInfo', class: Google::Apis::ServicecontrolV2::AuthorizationInfo, decorator: Google::Apis::ServicecontrolV2::AuthorizationInfo::Representation
|
194
|
+
|
195
|
+
hash :metadata, as: 'metadata'
|
196
|
+
property :method_name, as: 'methodName'
|
197
|
+
property :num_response_items, :numeric_string => true, as: 'numResponseItems'
|
198
|
+
hash :request, as: 'request'
|
199
|
+
property :request_metadata, as: 'requestMetadata', class: Google::Apis::ServicecontrolV2::RequestMetadata, decorator: Google::Apis::ServicecontrolV2::RequestMetadata::Representation
|
200
|
+
|
201
|
+
property :resource_location, as: 'resourceLocation', class: Google::Apis::ServicecontrolV2::ResourceLocation, decorator: Google::Apis::ServicecontrolV2::ResourceLocation::Representation
|
202
|
+
|
203
|
+
property :resource_name, as: 'resourceName'
|
204
|
+
hash :resource_original_state, as: 'resourceOriginalState'
|
205
|
+
hash :response, as: 'response'
|
206
|
+
hash :service_data, as: 'serviceData'
|
207
|
+
property :service_name, as: 'serviceName'
|
208
|
+
property :status, as: 'status', class: Google::Apis::ServicecontrolV2::Status, decorator: Google::Apis::ServicecontrolV2::Status::Representation
|
209
|
+
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
213
|
+
class Auth
|
214
|
+
# @private
|
215
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
216
|
+
collection :access_levels, as: 'accessLevels'
|
217
|
+
collection :audiences, as: 'audiences'
|
218
|
+
hash :claims, as: 'claims'
|
219
|
+
property :presenter, as: 'presenter'
|
220
|
+
property :principal, as: 'principal'
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
224
|
+
class AuthenticationInfo
|
225
|
+
# @private
|
226
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
227
|
+
property :authority_selector, as: 'authoritySelector'
|
228
|
+
property :principal_email, as: 'principalEmail'
|
229
|
+
property :principal_subject, as: 'principalSubject'
|
230
|
+
collection :service_account_delegation_info, as: 'serviceAccountDelegationInfo', class: Google::Apis::ServicecontrolV2::ServiceAccountDelegationInfo, decorator: Google::Apis::ServicecontrolV2::ServiceAccountDelegationInfo::Representation
|
231
|
+
|
232
|
+
property :service_account_key_name, as: 'serviceAccountKeyName'
|
233
|
+
hash :third_party_principal, as: 'thirdPartyPrincipal'
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
237
|
+
class AuthorizationInfo
|
238
|
+
# @private
|
239
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
240
|
+
property :granted, as: 'granted'
|
241
|
+
property :permission, as: 'permission'
|
242
|
+
property :resource, as: 'resource'
|
243
|
+
property :resource_attributes, as: 'resourceAttributes', class: Google::Apis::ServicecontrolV2::Resource, decorator: Google::Apis::ServicecontrolV2::Resource::Representation
|
244
|
+
|
245
|
+
end
|
246
|
+
end
|
247
|
+
|
248
|
+
class CheckRequest
|
249
|
+
# @private
|
250
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
251
|
+
property :attributes, as: 'attributes', class: Google::Apis::ServicecontrolV2::AttributeContext, decorator: Google::Apis::ServicecontrolV2::AttributeContext::Representation
|
252
|
+
|
253
|
+
collection :resources, as: 'resources', class: Google::Apis::ServicecontrolV2::ResourceInfo, decorator: Google::Apis::ServicecontrolV2::ResourceInfo::Representation
|
254
|
+
|
255
|
+
property :service_config_id, as: 'serviceConfigId'
|
256
|
+
end
|
257
|
+
end
|
258
|
+
|
259
|
+
class CheckResponse
|
260
|
+
# @private
|
261
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
262
|
+
hash :headers, as: 'headers'
|
263
|
+
property :status, as: 'status', class: Google::Apis::ServicecontrolV2::Status, decorator: Google::Apis::ServicecontrolV2::Status::Representation
|
264
|
+
|
265
|
+
end
|
266
|
+
end
|
267
|
+
|
268
|
+
class FirstPartyPrincipal
|
269
|
+
# @private
|
270
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
271
|
+
property :principal_email, as: 'principalEmail'
|
272
|
+
hash :service_metadata, as: 'serviceMetadata'
|
273
|
+
end
|
274
|
+
end
|
275
|
+
|
276
|
+
class Peer
|
277
|
+
# @private
|
278
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
279
|
+
property :ip, as: 'ip'
|
280
|
+
hash :labels, as: 'labels'
|
281
|
+
property :port, :numeric_string => true, as: 'port'
|
282
|
+
property :principal, as: 'principal'
|
283
|
+
property :region_code, as: 'regionCode'
|
284
|
+
end
|
285
|
+
end
|
286
|
+
|
287
|
+
class ReportRequest
|
288
|
+
# @private
|
289
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
290
|
+
collection :operations, as: 'operations', class: Google::Apis::ServicecontrolV2::AttributeContext, decorator: Google::Apis::ServicecontrolV2::AttributeContext::Representation
|
291
|
+
|
292
|
+
property :service_config_id, as: 'serviceConfigId'
|
293
|
+
end
|
294
|
+
end
|
295
|
+
|
296
|
+
class ReportResponse
|
297
|
+
# @private
|
298
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
299
|
+
end
|
300
|
+
end
|
301
|
+
|
302
|
+
class Request
|
303
|
+
# @private
|
304
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
305
|
+
property :auth, as: 'auth', class: Google::Apis::ServicecontrolV2::Auth, decorator: Google::Apis::ServicecontrolV2::Auth::Representation
|
306
|
+
|
307
|
+
hash :headers, as: 'headers'
|
308
|
+
property :host, as: 'host'
|
309
|
+
property :id, as: 'id'
|
310
|
+
property :method_prop, as: 'method'
|
311
|
+
property :path, as: 'path'
|
312
|
+
property :protocol, as: 'protocol'
|
313
|
+
property :query, as: 'query'
|
314
|
+
property :reason, as: 'reason'
|
315
|
+
property :scheme, as: 'scheme'
|
316
|
+
property :size, :numeric_string => true, as: 'size'
|
317
|
+
property :time, as: 'time'
|
318
|
+
end
|
319
|
+
end
|
320
|
+
|
321
|
+
class RequestMetadata
|
322
|
+
# @private
|
323
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
324
|
+
property :caller_ip, as: 'callerIp'
|
325
|
+
property :caller_network, as: 'callerNetwork'
|
326
|
+
property :caller_supplied_user_agent, as: 'callerSuppliedUserAgent'
|
327
|
+
property :destination_attributes, as: 'destinationAttributes', class: Google::Apis::ServicecontrolV2::Peer, decorator: Google::Apis::ServicecontrolV2::Peer::Representation
|
328
|
+
|
329
|
+
property :request_attributes, as: 'requestAttributes', class: Google::Apis::ServicecontrolV2::Request, decorator: Google::Apis::ServicecontrolV2::Request::Representation
|
330
|
+
|
331
|
+
end
|
332
|
+
end
|
333
|
+
|
334
|
+
class Resource
|
335
|
+
# @private
|
336
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
337
|
+
hash :annotations, as: 'annotations'
|
338
|
+
property :create_time, as: 'createTime'
|
339
|
+
property :delete_time, as: 'deleteTime'
|
340
|
+
property :display_name, as: 'displayName'
|
341
|
+
property :etag, as: 'etag'
|
342
|
+
hash :labels, as: 'labels'
|
343
|
+
property :name, as: 'name'
|
344
|
+
property :service, as: 'service'
|
345
|
+
property :type, as: 'type'
|
346
|
+
property :uid, as: 'uid'
|
347
|
+
property :update_time, as: 'updateTime'
|
348
|
+
end
|
349
|
+
end
|
350
|
+
|
351
|
+
class ResourceInfo
|
352
|
+
# @private
|
353
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
354
|
+
property :name, as: 'name'
|
355
|
+
property :permission, as: 'permission'
|
356
|
+
property :type, as: 'type'
|
357
|
+
end
|
358
|
+
end
|
359
|
+
|
360
|
+
class ResourceLocation
|
361
|
+
# @private
|
362
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
363
|
+
collection :current_locations, as: 'currentLocations'
|
364
|
+
collection :original_locations, as: 'originalLocations'
|
365
|
+
end
|
366
|
+
end
|
367
|
+
|
368
|
+
class Response
|
369
|
+
# @private
|
370
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
371
|
+
property :code, :numeric_string => true, as: 'code'
|
372
|
+
hash :headers, as: 'headers'
|
373
|
+
property :size, :numeric_string => true, as: 'size'
|
374
|
+
property :time, as: 'time'
|
375
|
+
end
|
376
|
+
end
|
377
|
+
|
378
|
+
class ServiceAccountDelegationInfo
|
379
|
+
# @private
|
380
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
381
|
+
property :first_party_principal, as: 'firstPartyPrincipal', class: Google::Apis::ServicecontrolV2::FirstPartyPrincipal, decorator: Google::Apis::ServicecontrolV2::FirstPartyPrincipal::Representation
|
382
|
+
|
383
|
+
property :principal_subject, as: 'principalSubject'
|
384
|
+
property :third_party_principal, as: 'thirdPartyPrincipal', class: Google::Apis::ServicecontrolV2::ThirdPartyPrincipal, decorator: Google::Apis::ServicecontrolV2::ThirdPartyPrincipal::Representation
|
385
|
+
|
386
|
+
end
|
387
|
+
end
|
388
|
+
|
389
|
+
class SpanContext
|
390
|
+
# @private
|
391
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
392
|
+
property :span_name, as: 'spanName'
|
393
|
+
end
|
394
|
+
end
|
395
|
+
|
396
|
+
class Status
|
397
|
+
# @private
|
398
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
399
|
+
property :code, as: 'code'
|
400
|
+
collection :details, as: 'details'
|
401
|
+
property :message, as: 'message'
|
402
|
+
end
|
403
|
+
end
|
404
|
+
|
405
|
+
class ThirdPartyPrincipal
|
406
|
+
# @private
|
407
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
408
|
+
hash :third_party_claims, as: 'thirdPartyClaims'
|
409
|
+
end
|
410
|
+
end
|
411
|
+
end
|
412
|
+
end
|
413
|
+
end
|
@@ -0,0 +1,157 @@
|
|
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 ServicecontrolV2
|
23
|
+
# Service Control API
|
24
|
+
#
|
25
|
+
# Provides admission control and telemetry reporting for services integrated
|
26
|
+
# with Service Infrastructure.
|
27
|
+
#
|
28
|
+
# @example
|
29
|
+
# require 'google/apis/servicecontrol_v2'
|
30
|
+
#
|
31
|
+
# Servicecontrol = Google::Apis::ServicecontrolV2 # Alias the module
|
32
|
+
# service = Servicecontrol::ServiceControlService.new
|
33
|
+
#
|
34
|
+
# @see https://cloud.google.com/service-control/
|
35
|
+
class ServiceControlService < 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://servicecontrol.googleapis.com/', '',
|
48
|
+
client_name: 'google-apis-servicecontrol_v2',
|
49
|
+
client_version: Google::Apis::ServicecontrolV2::GEM_VERSION)
|
50
|
+
@batch_path = 'batch'
|
51
|
+
end
|
52
|
+
|
53
|
+
# Private Preview. This feature is only available for approved services. This
|
54
|
+
# method provides admission control for services that are integrated with [
|
55
|
+
# Service Infrastructure](/service-infrastructure). It checks whether an
|
56
|
+
# operation should be allowed based on the service configuration and relevant
|
57
|
+
# policies. It must be called before the operation is executed. For more
|
58
|
+
# information, see [Admission Control](/service-infrastructure/docs/admission-
|
59
|
+
# control). NOTE: The admission control has an expected policy propagation delay
|
60
|
+
# of 60s. The caller **must** not depend on the most recent policy changes. NOTE:
|
61
|
+
# The admission control has a hard limit of 1 referenced resources per call. If
|
62
|
+
# an operation refers to more than 1 resources, the caller must call the Check
|
63
|
+
# method multiple times. This method requires the `servicemanagement.services.
|
64
|
+
# check` permission on the specified service. For more information, see [Service
|
65
|
+
# Control API Access Control](https://cloud.google.com/service-infrastructure/
|
66
|
+
# docs/service-control/access-control).
|
67
|
+
# @param [String] service_name
|
68
|
+
# The service name as specified in its service configuration. For example, `"
|
69
|
+
# pubsub.googleapis.com"`. See [google.api.Service](https://cloud.google.com/
|
70
|
+
# service-management/reference/rpc/google.api#google.api.Service) for the
|
71
|
+
# definition of a service name.
|
72
|
+
# @param [Google::Apis::ServicecontrolV2::CheckRequest] check_request_object
|
73
|
+
# @param [String] fields
|
74
|
+
# Selector specifying which fields to include in a partial response.
|
75
|
+
# @param [String] quota_user
|
76
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
77
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
78
|
+
# @param [Google::Apis::RequestOptions] options
|
79
|
+
# Request-specific options
|
80
|
+
#
|
81
|
+
# @yield [result, err] Result & error if block supplied
|
82
|
+
# @yieldparam result [Google::Apis::ServicecontrolV2::CheckResponse] parsed result object
|
83
|
+
# @yieldparam err [StandardError] error object if request failed
|
84
|
+
#
|
85
|
+
# @return [Google::Apis::ServicecontrolV2::CheckResponse]
|
86
|
+
#
|
87
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
88
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
89
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
90
|
+
def check_service(service_name, check_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
91
|
+
command = make_simple_command(:post, 'v2/services/{serviceName}:check', options)
|
92
|
+
command.request_representation = Google::Apis::ServicecontrolV2::CheckRequest::Representation
|
93
|
+
command.request_object = check_request_object
|
94
|
+
command.response_representation = Google::Apis::ServicecontrolV2::CheckResponse::Representation
|
95
|
+
command.response_class = Google::Apis::ServicecontrolV2::CheckResponse
|
96
|
+
command.params['serviceName'] = service_name unless service_name.nil?
|
97
|
+
command.query['fields'] = fields unless fields.nil?
|
98
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
99
|
+
execute_or_queue_command(command, &block)
|
100
|
+
end
|
101
|
+
|
102
|
+
# Private Preview. This feature is only available for approved services. This
|
103
|
+
# method provides telemetry reporting for services that are integrated with [
|
104
|
+
# Service Infrastructure](/service-infrastructure). It reports a list of
|
105
|
+
# operations that have occurred on a service. It must be called after the
|
106
|
+
# operations have been executed. For more information, see [Telemetry Reporting](
|
107
|
+
# /service-infrastructure/docs/telemetry-reporting). NOTE: The telemetry
|
108
|
+
# reporting has a hard limit of 1000 operations and 1MB per Report call. It is
|
109
|
+
# recommended to have no more than 100 operations per call. This method requires
|
110
|
+
# the `servicemanagement.services.report` permission on the specified service.
|
111
|
+
# For more information, see [Service Control API Access Control](https://cloud.
|
112
|
+
# google.com/service-infrastructure/docs/service-control/access-control).
|
113
|
+
# @param [String] service_name
|
114
|
+
# The service name as specified in its service configuration. For example, `"
|
115
|
+
# pubsub.googleapis.com"`. See [google.api.Service](https://cloud.google.com/
|
116
|
+
# service-management/reference/rpc/google.api#google.api.Service) for the
|
117
|
+
# definition of a service name.
|
118
|
+
# @param [Google::Apis::ServicecontrolV2::ReportRequest] report_request_object
|
119
|
+
# @param [String] fields
|
120
|
+
# Selector specifying which fields to include in a partial response.
|
121
|
+
# @param [String] quota_user
|
122
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
123
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
124
|
+
# @param [Google::Apis::RequestOptions] options
|
125
|
+
# Request-specific options
|
126
|
+
#
|
127
|
+
# @yield [result, err] Result & error if block supplied
|
128
|
+
# @yieldparam result [Google::Apis::ServicecontrolV2::ReportResponse] parsed result object
|
129
|
+
# @yieldparam err [StandardError] error object if request failed
|
130
|
+
#
|
131
|
+
# @return [Google::Apis::ServicecontrolV2::ReportResponse]
|
132
|
+
#
|
133
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
134
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
135
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
136
|
+
def report_service(service_name, report_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
137
|
+
command = make_simple_command(:post, 'v2/services/{serviceName}:report', options)
|
138
|
+
command.request_representation = Google::Apis::ServicecontrolV2::ReportRequest::Representation
|
139
|
+
command.request_object = report_request_object
|
140
|
+
command.response_representation = Google::Apis::ServicecontrolV2::ReportResponse::Representation
|
141
|
+
command.response_class = Google::Apis::ServicecontrolV2::ReportResponse
|
142
|
+
command.params['serviceName'] = service_name unless service_name.nil?
|
143
|
+
command.query['fields'] = fields unless fields.nil?
|
144
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
145
|
+
execute_or_queue_command(command, &block)
|
146
|
+
end
|
147
|
+
|
148
|
+
protected
|
149
|
+
|
150
|
+
def apply_command_defaults(command)
|
151
|
+
command.query['key'] = key unless key.nil?
|
152
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|
156
|
+
end
|
157
|
+
end
|