-
Notifications
You must be signed in to change notification settings - Fork 867
/
classes.rb
2959 lines (2509 loc) · 133 KB
/
classes.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
require 'date'
require 'google/apis/core/base_service'
require 'google/apis/core/json_representation'
require 'google/apis/core/hashable'
require 'google/apis/errors'
module Google
module Apis
module ServicecontrolV1
#
class AllocateInfo
include Google::Apis::Core::Hashable
# A list of label keys that were unused by the server in processing the request.
# Thus, for similar requests repeated in a certain future time window, the
# caller can choose to ignore these labels in the requests to achieve better
# client-side cache hits and quota aggregation for rate quota. This field is not
# populated for allocation quota checks.
# Corresponds to the JSON property `unusedArguments`
# @return [Array<String>]
attr_accessor :unused_arguments
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@unused_arguments = args[:unused_arguments] if args.key?(:unused_arguments)
end
end
# Request message for the AllocateQuota method.
class AllocateQuotaRequest
include Google::Apis::Core::Hashable
# Represents information regarding a quota operation.
# Corresponds to the JSON property `allocateOperation`
# @return [Google::Apis::ServicecontrolV1::QuotaOperation]
attr_accessor :allocate_operation
# Specifies which version of service configuration should be used to process the
# request. If unspecified or no matching version can be found, the latest one
# will be used.
# Corresponds to the JSON property `serviceConfigId`
# @return [String]
attr_accessor :service_config_id
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@allocate_operation = args[:allocate_operation] if args.key?(:allocate_operation)
@service_config_id = args[:service_config_id] if args.key?(:service_config_id)
end
end
# Response message for the AllocateQuota method.
class AllocateQuotaResponse
include Google::Apis::Core::Hashable
# Indicates the decision of the allocate.
# Corresponds to the JSON property `allocateErrors`
# @return [Array<Google::Apis::ServicecontrolV1::QuotaError>]
attr_accessor :allocate_errors
# WARNING: DO NOT use this field until this warning message is removed.
# Corresponds to the JSON property `allocateInfo`
# @return [Google::Apis::ServicecontrolV1::AllocateInfo]
attr_accessor :allocate_info
# The same operation_id value used in the AllocateQuotaRequest. Used for logging
# and diagnostics purposes.
# Corresponds to the JSON property `operationId`
# @return [String]
attr_accessor :operation_id
# Quota metrics to indicate the result of allocation. Depending on the request,
# one or more of the following metrics will be included: 1. Per quota group or
# per quota metric incremental usage will be specified using the following delta
# metric : "serviceruntime.googleapis.com/api/consumer/quota_used_count" 2. The
# quota limit reached condition will be specified using the following boolean
# metric : "serviceruntime.googleapis.com/quota/exceeded"
# Corresponds to the JSON property `quotaMetrics`
# @return [Array<Google::Apis::ServicecontrolV1::MetricValueSet>]
attr_accessor :quota_metrics
# ID of the actual config used to process the request.
# Corresponds to the JSON property `serviceConfigId`
# @return [String]
attr_accessor :service_config_id
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@allocate_errors = args[:allocate_errors] if args.key?(:allocate_errors)
@allocate_info = args[:allocate_info] if args.key?(:allocate_info)
@operation_id = args[:operation_id] if args.key?(:operation_id)
@quota_metrics = args[:quota_metrics] if args.key?(:quota_metrics)
@service_config_id = args[:service_config_id] if args.key?(:service_config_id)
end
end
# The allowed types for [VALUE] in a `[KEY]:[VALUE]` attribute.
class AttributeValue
include Google::Apis::Core::Hashable
# A Boolean value represented by `true` or `false`.
# Corresponds to the JSON property `boolValue`
# @return [Boolean]
attr_accessor :bool_value
alias_method :bool_value?, :bool_value
# A 64-bit signed integer.
# Corresponds to the JSON property `intValue`
# @return [Fixnum]
attr_accessor :int_value
# Represents a string that might be shortened to a specified length.
# Corresponds to the JSON property `stringValue`
# @return [Google::Apis::ServicecontrolV1::TruncatableString]
attr_accessor :string_value
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@bool_value = args[:bool_value] if args.key?(:bool_value)
@int_value = args[:int_value] if args.key?(:int_value)
@string_value = args[:string_value] if args.key?(:string_value)
end
end
# A set of attributes, each in the format `[KEY]:[VALUE]`.
class Attributes
include Google::Apis::Core::Hashable
# The set of attributes. Each attribute's key can be up to 128 bytes long. The
# value can be a string up to 256 bytes, a signed 64-bit integer, or the Boolean
# values `true` and `false`. For example: "/instance_id": "my-instance" "/http/
# user_agent": "" "/http/request_bytes": 300 "abc.com/myattribute": true
# Corresponds to the JSON property `attributeMap`
# @return [Hash<String,Google::Apis::ServicecontrolV1::AttributeValue>]
attr_accessor :attribute_map
# The number of attributes that were discarded. Attributes can be discarded
# because their keys are too long or because there are too many attributes. If
# this value is 0 then all attributes are valid.
# Corresponds to the JSON property `droppedAttributesCount`
# @return [Fixnum]
attr_accessor :dropped_attributes_count
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@attribute_map = args[:attribute_map] if args.key?(:attribute_map)
@dropped_attributes_count = args[:dropped_attributes_count] if args.key?(:dropped_attributes_count)
end
end
# Common audit log format for Google Cloud Platform API operations.
class AuditLog
include Google::Apis::Core::Hashable
# Authentication information for the operation.
# Corresponds to the JSON property `authenticationInfo`
# @return [Google::Apis::ServicecontrolV1::AuthenticationInfo]
attr_accessor :authentication_info
# Authorization information. If there are multiple resources or permissions
# involved, then there is one AuthorizationInfo element for each `resource,
# permission` tuple.
# Corresponds to the JSON property `authorizationInfo`
# @return [Array<Google::Apis::ServicecontrolV1::AuthorizationInfo>]
attr_accessor :authorization_info
# Other service-specific data about the request, response, and other information
# associated with the current audited event.
# Corresponds to the JSON property `metadata`
# @return [Hash<String,Object>]
attr_accessor :metadata
# The name of the service method or operation. For API calls, this should be the
# name of the API method. For example, "google.cloud.bigquery.v2.TableService.
# InsertTable" "google.logging.v2.ConfigServiceV2.CreateSink"
# Corresponds to the JSON property `methodName`
# @return [String]
attr_accessor :method_name
# The number of items returned from a List or Query API method, if applicable.
# Corresponds to the JSON property `numResponseItems`
# @return [Fixnum]
attr_accessor :num_response_items
# Information related to policy violations for this request.
# Corresponds to the JSON property `policyViolationInfo`
# @return [Google::Apis::ServicecontrolV1::PolicyViolationInfo]
attr_accessor :policy_violation_info
# The operation request. This may not include all request parameters, such as
# those that are too large, privacy-sensitive, or duplicated elsewhere in the
# log record. It should never include user-generated data, such as file contents.
# When the JSON object represented here has a proto equivalent, the proto name
# will be indicated in the `@type` property.
# Corresponds to the JSON property `request`
# @return [Hash<String,Object>]
attr_accessor :request
# Metadata about the request.
# Corresponds to the JSON property `requestMetadata`
# @return [Google::Apis::ServicecontrolV1::RequestMetadata]
attr_accessor :request_metadata
# Location information about a resource.
# Corresponds to the JSON property `resourceLocation`
# @return [Google::Apis::ServicecontrolV1::ResourceLocation]
attr_accessor :resource_location
# The resource or collection that is the target of the operation. The name is a
# scheme-less URI, not including the API service name. For example: "projects/
# PROJECT_ID/zones/us-central1-a/instances" "projects/PROJECT_ID/datasets/
# DATASET_ID"
# Corresponds to the JSON property `resourceName`
# @return [String]
attr_accessor :resource_name
# The resource's original state before mutation. Present only for operations
# which have successfully modified the targeted resource(s). In general, this
# field should contain all changed fields, except those that are already been
# included in `request`, `response`, `metadata` or `service_data` fields. When
# the JSON object represented here has a proto equivalent, the proto name will
# be indicated in the `@type` property.
# Corresponds to the JSON property `resourceOriginalState`
# @return [Hash<String,Object>]
attr_accessor :resource_original_state
# The operation response. This may not include all response elements, such as
# those that are too large, privacy-sensitive, or duplicated elsewhere in the
# log record. It should never include user-generated data, such as file contents.
# When the JSON object represented here has a proto equivalent, the proto name
# will be indicated in the `@type` property.
# Corresponds to the JSON property `response`
# @return [Hash<String,Object>]
attr_accessor :response
# Deprecated. Use the `metadata` field instead. Other service-specific data
# about the request, response, and other activities.
# Corresponds to the JSON property `serviceData`
# @return [Hash<String,Object>]
attr_accessor :service_data
# The name of the API service performing the operation. For example, `"compute.
# googleapis.com"`.
# Corresponds to the JSON property `serviceName`
# @return [String]
attr_accessor :service_name
# The `Status` type defines a logical error model that is suitable for different
# programming environments, including REST APIs and RPC APIs. It is used by [
# gRPC](https://github.com/grpc). Each `Status` message contains three pieces of
# data: error code, error message, and error details. You can find out more
# about this error model and how to work with it in the [API Design Guide](https:
# //cloud.google.com/apis/design/errors).
# Corresponds to the JSON property `status`
# @return [Google::Apis::ServicecontrolV1::Status]
attr_accessor :status
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@authentication_info = args[:authentication_info] if args.key?(:authentication_info)
@authorization_info = args[:authorization_info] if args.key?(:authorization_info)
@metadata = args[:metadata] if args.key?(:metadata)
@method_name = args[:method_name] if args.key?(:method_name)
@num_response_items = args[:num_response_items] if args.key?(:num_response_items)
@policy_violation_info = args[:policy_violation_info] if args.key?(:policy_violation_info)
@request = args[:request] if args.key?(:request)
@request_metadata = args[:request_metadata] if args.key?(:request_metadata)
@resource_location = args[:resource_location] if args.key?(:resource_location)
@resource_name = args[:resource_name] if args.key?(:resource_name)
@resource_original_state = args[:resource_original_state] if args.key?(:resource_original_state)
@response = args[:response] if args.key?(:response)
@service_data = args[:service_data] if args.key?(:service_data)
@service_name = args[:service_name] if args.key?(:service_name)
@status = args[:status] if args.key?(:status)
end
end
# This message defines request authentication attributes. Terminology is based
# on the JSON Web Token (JWT) standard, but the terms also correlate to concepts
# in other standards.
class Auth
include Google::Apis::Core::Hashable
# A list of access level resource names that allow resources to be accessed by
# authenticated requester. It is part of Secure GCP processing for the incoming
# request. An access level string has the format: "//`api_service_name`/
# accessPolicies/`policy_id`/accessLevels/`short_name`" Example: "//
# accesscontextmanager.googleapis.com/accessPolicies/MY_POLICY_ID/accessLevels/
# MY_LEVEL"
# Corresponds to the JSON property `accessLevels`
# @return [Array<String>]
attr_accessor :access_levels
# The intended audience(s) for this authentication information. Reflects the
# audience (`aud`) claim within a JWT. The audience value(s) depends on the `
# issuer`, but typically include one or more of the following pieces of
# information: * The services intended to receive the credential. For example, ["
# https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. * A set
# of service-based scopes. For example, ["https://www.googleapis.com/auth/cloud-
# platform"]. * The client id of an app, such as the Firebase project id for
# JWTs from Firebase Auth. Consult the documentation for the credential issuer
# to determine the information provided.
# Corresponds to the JSON property `audiences`
# @return [Array<String>]
attr_accessor :audiences
# Structured claims presented with the credential. JWTs include ``key: value``
# pairs for standard and private claims. The following is a subset of the
# standard required and optional claims that would typically be presented for a
# Google-based JWT: `'iss': 'accounts.google.com', 'sub': '113289723416554971153'
# , 'aud': ['123456789012', 'pubsub.googleapis.com'], 'azp': '123456789012.apps.
# googleusercontent.com', 'email': 'jsmith@example.com', 'iat': 1353601026, 'exp'
# : 1353604926` SAML assertions are similarly specified, but with an identity
# provider dependent structure.
# Corresponds to the JSON property `claims`
# @return [Hash<String,Object>]
attr_accessor :claims
# Identifies the client credential id used for authentication. credential_id is
# in the format of AUTH_METHOD:IDENTIFIER, e.g. "serviceaccount:XXXXX, apikey:
# XXXXX" where the format of the IDENTIFIER can vary for different AUTH_METHODs.
# Corresponds to the JSON property `credentialId`
# @return [String]
attr_accessor :credential_id
# The authorized presenter of the credential. Reflects the optional Authorized
# Presenter (`azp`) claim within a JWT or the OAuth client id. For example, a
# Google Cloud Platform client id looks as follows: "123456789012.apps.
# googleusercontent.com".
# Corresponds to the JSON property `presenter`
# @return [String]
attr_accessor :presenter
# The authenticated principal. Reflects the issuer (`iss`) and subject (`sub`)
# claims within a JWT. The issuer and subject should be `/` delimited, with `/`
# percent-encoded within the subject fragment. For Google accounts, the
# principal format is: "https://accounts.google.com/`id`"
# Corresponds to the JSON property `principal`
# @return [String]
attr_accessor :principal
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@access_levels = args[:access_levels] if args.key?(:access_levels)
@audiences = args[:audiences] if args.key?(:audiences)
@claims = args[:claims] if args.key?(:claims)
@credential_id = args[:credential_id] if args.key?(:credential_id)
@presenter = args[:presenter] if args.key?(:presenter)
@principal = args[:principal] if args.key?(:principal)
end
end
# Authentication information for the operation.
class AuthenticationInfo
include Google::Apis::Core::Hashable
# The authority selector specified by the requestor, if any. It is not
# guaranteed that the principal was allowed to use this authority.
# Corresponds to the JSON property `authoritySelector`
# @return [String]
attr_accessor :authority_selector
# The email address of the authenticated user (or service account on behalf of
# third party principal) making the request. For third party identity callers,
# the `principal_subject` field is populated instead of this field. For privacy
# reasons, the principal email address is sometimes redacted. For more
# information, see [Caller identities in audit logs](https://cloud.google.com/
# logging/docs/audit#user-id).
# Corresponds to the JSON property `principalEmail`
# @return [String]
attr_accessor :principal_email
# String representation of identity of requesting party. Populated for both
# first and third party identities.
# Corresponds to the JSON property `principalSubject`
# @return [String]
attr_accessor :principal_subject
# Identity delegation history of an authenticated service account that makes the
# request. It contains information on the real authorities that try to access
# GCP resources by delegating on a service account. When multiple authorities
# present, they are guaranteed to be sorted based on the original ordering of
# the identity delegation events.
# Corresponds to the JSON property `serviceAccountDelegationInfo`
# @return [Array<Google::Apis::ServicecontrolV1::ServiceAccountDelegationInfo>]
attr_accessor :service_account_delegation_info
# The name of the service account key used to create or exchange credentials for
# authenticating the service account making the request. This is a scheme-less
# URI full resource name. For example: "//iam.googleapis.com/projects/`
# PROJECT_ID`/serviceAccounts/`ACCOUNT`/keys/`key`"
# Corresponds to the JSON property `serviceAccountKeyName`
# @return [String]
attr_accessor :service_account_key_name
# The history of delegation across multiple services as the result of the
# original user's action. Such as "service A uses its own account to do
# something for user B". This differs from ServiceAccountDelegationInfo, which
# only tracks the history of direct token exchanges (impersonation).
# Corresponds to the JSON property `serviceDelegationHistory`
# @return [Google::Apis::ServicecontrolV1::ServiceDelegationHistory]
attr_accessor :service_delegation_history
# The third party identification (if any) of the authenticated user making the
# request. When the JSON object represented here has a proto equivalent, the
# proto name will be indicated in the `@type` property.
# Corresponds to the JSON property `thirdPartyPrincipal`
# @return [Hash<String,Object>]
attr_accessor :third_party_principal
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@authority_selector = args[:authority_selector] if args.key?(:authority_selector)
@principal_email = args[:principal_email] if args.key?(:principal_email)
@principal_subject = args[:principal_subject] if args.key?(:principal_subject)
@service_account_delegation_info = args[:service_account_delegation_info] if args.key?(:service_account_delegation_info)
@service_account_key_name = args[:service_account_key_name] if args.key?(:service_account_key_name)
@service_delegation_history = args[:service_delegation_history] if args.key?(:service_delegation_history)
@third_party_principal = args[:third_party_principal] if args.key?(:third_party_principal)
end
end
# Authorization information for the operation.
class AuthorizationInfo
include Google::Apis::Core::Hashable
# Whether or not authorization for `resource` and `permission` was granted.
# Corresponds to the JSON property `granted`
# @return [Boolean]
attr_accessor :granted
alias_method :granted?, :granted
# The required IAM permission.
# Corresponds to the JSON property `permission`
# @return [String]
attr_accessor :permission
# The type of the permission that was checked. For data access audit logs this
# corresponds with the permission type that must be enabled in the project/
# folder/organization IAM policy in order for the log to be written.
# Corresponds to the JSON property `permissionType`
# @return [String]
attr_accessor :permission_type
# The resource being accessed, as a REST-style or cloud resource string. For
# example: bigquery.googleapis.com/projects/PROJECTID/datasets/DATASETID or
# projects/PROJECTID/datasets/DATASETID
# Corresponds to the JSON property `resource`
# @return [String]
attr_accessor :resource
# This message defines core attributes for a resource. A resource is an
# addressable (named) entity provided by the destination service. For example, a
# file stored on a network storage service.
# Corresponds to the JSON property `resourceAttributes`
# @return [Google::Apis::ServicecontrolV1::Resource]
attr_accessor :resource_attributes
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@granted = args[:granted] if args.key?(:granted)
@permission = args[:permission] if args.key?(:permission)
@permission_type = args[:permission_type] if args.key?(:permission_type)
@resource = args[:resource] if args.key?(:resource)
@resource_attributes = args[:resource_attributes] if args.key?(:resource_attributes)
end
end
# Defines the errors to be returned in google.api.servicecontrol.v1.
# CheckResponse.check_errors.
class CheckError
include Google::Apis::Core::Hashable
# The error code.
# Corresponds to the JSON property `code`
# @return [String]
attr_accessor :code
# Free-form text providing details on the error cause of the error.
# Corresponds to the JSON property `detail`
# @return [String]
attr_accessor :detail
# The `Status` type defines a logical error model that is suitable for different
# programming environments, including REST APIs and RPC APIs. It is used by [
# gRPC](https://github.com/grpc). Each `Status` message contains three pieces of
# data: error code, error message, and error details. You can find out more
# about this error model and how to work with it in the [API Design Guide](https:
# //cloud.google.com/apis/design/errors).
# Corresponds to the JSON property `status`
# @return [Google::Apis::ServicecontrolV1::Status]
attr_accessor :status
# Subject to whom this error applies. See the specific code enum for more
# details on this field. For example: - "project:" - "folder:" - "organization:"
# Corresponds to the JSON property `subject`
# @return [String]
attr_accessor :subject
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@code = args[:code] if args.key?(:code)
@detail = args[:detail] if args.key?(:detail)
@status = args[:status] if args.key?(:status)
@subject = args[:subject] if args.key?(:subject)
end
end
# Contains additional information about the check operation.
class CheckInfo
include Google::Apis::Core::Hashable
# The unique id of the api key in the format of "apikey:". This field will be
# populated when the consumer passed to Chemist is an API key and all the API
# key related validations are successful.
# Corresponds to the JSON property `apiKeyUid`
# @return [String]
attr_accessor :api_key_uid
# `ConsumerInfo` provides information about the consumer.
# Corresponds to the JSON property `consumerInfo`
# @return [Google::Apis::ServicecontrolV1::ConsumerInfo]
attr_accessor :consumer_info
# A list of fields and label keys that are ignored by the server. The client
# doesn't need to send them for following requests to improve performance and
# allow better aggregation.
# Corresponds to the JSON property `unusedArguments`
# @return [Array<String>]
attr_accessor :unused_arguments
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@api_key_uid = args[:api_key_uid] if args.key?(:api_key_uid)
@consumer_info = args[:consumer_info] if args.key?(:consumer_info)
@unused_arguments = args[:unused_arguments] if args.key?(:unused_arguments)
end
end
# Request message for the Check method.
class CheckRequest
include Google::Apis::Core::Hashable
# Represents information regarding an operation.
# Corresponds to the JSON property `operation`
# @return [Google::Apis::ServicecontrolV1::Operation]
attr_accessor :operation
# Requests the project settings to be returned as part of the check response.
# Corresponds to the JSON property `requestProjectSettings`
# @return [Boolean]
attr_accessor :request_project_settings
alias_method :request_project_settings?, :request_project_settings
# Specifies which version of service configuration should be used to process the
# request. If unspecified or no matching version can be found, the latest one
# will be used.
# Corresponds to the JSON property `serviceConfigId`
# @return [String]
attr_accessor :service_config_id
# Indicates if service activation check should be skipped for this request.
# Default behavior is to perform the check and apply relevant quota. WARNING:
# Setting this flag to "true" will disable quota enforcement.
# Corresponds to the JSON property `skipActivationCheck`
# @return [Boolean]
attr_accessor :skip_activation_check
alias_method :skip_activation_check?, :skip_activation_check
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@operation = args[:operation] if args.key?(:operation)
@request_project_settings = args[:request_project_settings] if args.key?(:request_project_settings)
@service_config_id = args[:service_config_id] if args.key?(:service_config_id)
@skip_activation_check = args[:skip_activation_check] if args.key?(:skip_activation_check)
end
end
# Response message for the Check method.
class CheckResponse
include Google::Apis::Core::Hashable
# Indicate the decision of the check. If no check errors are present, the
# service should process the operation. Otherwise the service should use the
# list of errors to determine the appropriate action.
# Corresponds to the JSON property `checkErrors`
# @return [Array<Google::Apis::ServicecontrolV1::CheckError>]
attr_accessor :check_errors
# Contains additional information about the check operation.
# Corresponds to the JSON property `checkInfo`
# @return [Google::Apis::ServicecontrolV1::CheckInfo]
attr_accessor :check_info
# The same operation_id value used in the CheckRequest. Used for logging and
# diagnostics purposes.
# Corresponds to the JSON property `operationId`
# @return [String]
attr_accessor :operation_id
# Contains the quota information for a quota check response.
# Corresponds to the JSON property `quotaInfo`
# @return [Google::Apis::ServicecontrolV1::QuotaInfo]
attr_accessor :quota_info
# The actual config id used to process the request.
# Corresponds to the JSON property `serviceConfigId`
# @return [String]
attr_accessor :service_config_id
# The current service rollout id used to process the request.
# Corresponds to the JSON property `serviceRolloutId`
# @return [String]
attr_accessor :service_rollout_id
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@check_errors = args[:check_errors] if args.key?(:check_errors)
@check_info = args[:check_info] if args.key?(:check_info)
@operation_id = args[:operation_id] if args.key?(:operation_id)
@quota_info = args[:quota_info] if args.key?(:quota_info)
@service_config_id = args[:service_config_id] if args.key?(:service_config_id)
@service_rollout_id = args[:service_rollout_id] if args.key?(:service_rollout_id)
end
end
# `ConsumerInfo` provides information about the consumer.
class ConsumerInfo
include Google::Apis::Core::Hashable
# The consumer identity number, can be Google cloud project number, folder
# number or organization number e.g. 1234567890. A value of 0 indicates no
# consumer number is found.
# Corresponds to the JSON property `consumerNumber`
# @return [Fixnum]
attr_accessor :consumer_number
# The Google cloud project number, e.g. 1234567890. A value of 0 indicates no
# project number is found. NOTE: This field is deprecated after Chemist support
# flexible consumer id. New code should not depend on this field anymore.
# Corresponds to the JSON property `projectNumber`
# @return [Fixnum]
attr_accessor :project_number
# The type of the consumer which should have been defined in [Google Resource
# Manager](https://cloud.google.com/resource-manager/).
# Corresponds to the JSON property `type`
# @return [String]
attr_accessor :type
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@consumer_number = args[:consumer_number] if args.key?(:consumer_number)
@project_number = args[:project_number] if args.key?(:project_number)
@type = args[:type] if args.key?(:type)
end
end
# Distribution represents a frequency distribution of double-valued sample
# points. It contains the size of the population of sample points plus
# additional optional information: * the arithmetic mean of the samples * the
# minimum and maximum of the samples * the sum-squared-deviation of the samples,
# used to compute variance * a histogram of the values of the sample points
class Distribution
include Google::Apis::Core::Hashable
# The number of samples in each histogram bucket. `bucket_counts` are optional.
# If present, they must sum to the `count` value. The buckets are defined below
# in `bucket_option`. There are N buckets. `bucket_counts[0]` is the number of
# samples in the underflow bucket. `bucket_counts[1]` to `bucket_counts[N-1]`
# are the numbers of samples in each of the finite buckets. And `bucket_counts[N]
# is the number of samples in the overflow bucket. See the comments of `
# bucket_option` below for more details. Any suffix of trailing zeros may be
# omitted.
# Corresponds to the JSON property `bucketCounts`
# @return [Array<Fixnum>]
attr_accessor :bucket_counts
# The total number of samples in the distribution. Must be >= 0.
# Corresponds to the JSON property `count`
# @return [Fixnum]
attr_accessor :count
# Example points. Must be in increasing order of `value` field.
# Corresponds to the JSON property `exemplars`
# @return [Array<Google::Apis::ServicecontrolV1::Exemplar>]
attr_accessor :exemplars
# Describing buckets with arbitrary user-provided width.
# Corresponds to the JSON property `explicitBuckets`
# @return [Google::Apis::ServicecontrolV1::ExplicitBuckets]
attr_accessor :explicit_buckets
# Describing buckets with exponentially growing width.
# Corresponds to the JSON property `exponentialBuckets`
# @return [Google::Apis::ServicecontrolV1::ExponentialBuckets]
attr_accessor :exponential_buckets
# Describing buckets with constant width.
# Corresponds to the JSON property `linearBuckets`
# @return [Google::Apis::ServicecontrolV1::LinearBuckets]
attr_accessor :linear_buckets
# The maximum of the population of values. Ignored if `count` is zero.
# Corresponds to the JSON property `maximum`
# @return [Float]
attr_accessor :maximum
# The arithmetic mean of the samples in the distribution. If `count` is zero
# then this field must be zero.
# Corresponds to the JSON property `mean`
# @return [Float]
attr_accessor :mean
# The minimum of the population of values. Ignored if `count` is zero.
# Corresponds to the JSON property `minimum`
# @return [Float]
attr_accessor :minimum
# The sum of squared deviations from the mean: Sum[i=1..count]((x_i - mean)^2)
# where each x_i is a sample values. If `count` is zero then this field must be
# zero, otherwise validation of the request fails.
# Corresponds to the JSON property `sumOfSquaredDeviation`
# @return [Float]
attr_accessor :sum_of_squared_deviation
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@bucket_counts = args[:bucket_counts] if args.key?(:bucket_counts)
@count = args[:count] if args.key?(:count)
@exemplars = args[:exemplars] if args.key?(:exemplars)
@explicit_buckets = args[:explicit_buckets] if args.key?(:explicit_buckets)
@exponential_buckets = args[:exponential_buckets] if args.key?(:exponential_buckets)
@linear_buckets = args[:linear_buckets] if args.key?(:linear_buckets)
@maximum = args[:maximum] if args.key?(:maximum)
@mean = args[:mean] if args.key?(:mean)
@minimum = args[:minimum] if args.key?(:minimum)
@sum_of_squared_deviation = args[:sum_of_squared_deviation] if args.key?(:sum_of_squared_deviation)
end
end
# Exemplars are example points that may be used to annotate aggregated
# distribution values. They are metadata that gives information about a
# particular value added to a Distribution bucket, such as a trace ID that was
# active when a value was added. They may contain further information, such as a
# example values and timestamps, origin, etc.
class Exemplar
include Google::Apis::Core::Hashable
# Contextual information about the example value. Examples are: Trace: type.
# googleapis.com/google.monitoring.v3.SpanContext Literal string: type.
# googleapis.com/google.protobuf.StringValue Labels dropped during aggregation:
# type.googleapis.com/google.monitoring.v3.DroppedLabels There may be only a
# single attachment of any given message type in a single exemplar, and this is
# enforced by the system.
# Corresponds to the JSON property `attachments`
# @return [Array<Hash<String,Object>>]
attr_accessor :attachments
# The observation (sampling) time of the above value.
# Corresponds to the JSON property `timestamp`
# @return [String]
attr_accessor :timestamp
# Value of the exemplar point. This value determines to which bucket the
# exemplar belongs.
# Corresponds to the JSON property `value`
# @return [Float]
attr_accessor :value
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@attachments = args[:attachments] if args.key?(:attachments)
@timestamp = args[:timestamp] if args.key?(:timestamp)
@value = args[:value] if args.key?(:value)
end
end
# Describing buckets with arbitrary user-provided width.
class ExplicitBuckets
include Google::Apis::Core::Hashable
# 'bound' is a list of strictly increasing boundaries between buckets. Note that
# a list of length N-1 defines N buckets because of fenceposting. See comments
# on `bucket_options` for details. The i'th finite bucket covers the interval [
# bound[i-1], bound[i]) where i ranges from 1 to bound_size() - 1. Note that
# there are no finite buckets at all if 'bound' only contains a single element;
# in that special case the single bound defines the boundary between the
# underflow and overflow buckets. bucket number lower bound upper bound i == 0 (
# underflow) -inf bound[i] 0 < i < bound_size() bound[i-1] bound[i] i ==
# bound_size() (overflow) bound[i-1] +inf
# Corresponds to the JSON property `bounds`
# @return [Array<Float>]
attr_accessor :bounds
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@bounds = args[:bounds] if args.key?(:bounds)
end
end
# Describing buckets with exponentially growing width.
class ExponentialBuckets
include Google::Apis::Core::Hashable
# The i'th exponential bucket covers the interval [scale * growth_factor^(i-1),
# scale * growth_factor^i) where i ranges from 1 to num_finite_buckets inclusive.
# Must be larger than 1.0.
# Corresponds to the JSON property `growthFactor`
# @return [Float]
attr_accessor :growth_factor
# The number of finite buckets. With the underflow and overflow buckets, the
# total number of buckets is `num_finite_buckets` + 2. See comments on `
# bucket_options` for details.
# Corresponds to the JSON property `numFiniteBuckets`
# @return [Fixnum]
attr_accessor :num_finite_buckets
# The i'th exponential bucket covers the interval [scale * growth_factor^(i-1),
# scale * growth_factor^i) where i ranges from 1 to num_finite_buckets inclusive.
# Must be > 0.
# Corresponds to the JSON property `scale`
# @return [Float]
attr_accessor :scale
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@growth_factor = args[:growth_factor] if args.key?(:growth_factor)
@num_finite_buckets = args[:num_finite_buckets] if args.key?(:num_finite_buckets)
@scale = args[:scale] if args.key?(:scale)
end
end
# First party identity principal.
class FirstPartyPrincipal
include Google::Apis::Core::Hashable
# The email address of a Google account. .
# Corresponds to the JSON property `principalEmail`
# @return [String]
attr_accessor :principal_email
# Metadata about the service that uses the service account. .
# Corresponds to the JSON property `serviceMetadata`
# @return [Hash<String,Object>]
attr_accessor :service_metadata
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@principal_email = args[:principal_email] if args.key?(:principal_email)
@service_metadata = args[:service_metadata] if args.key?(:service_metadata)
end
end
# A common proto for logging HTTP requests. Only contains semantics defined by
# the HTTP specification. Product-specific logging information MUST be defined
# in a separate message.
class HttpRequest
include Google::Apis::Core::Hashable
# The number of HTTP response bytes inserted into cache. Set only when a cache
# fill was attempted.
# Corresponds to the JSON property `cacheFillBytes`
# @return [Fixnum]
attr_accessor :cache_fill_bytes
# Whether or not an entity was served from cache (with or without validation).
# Corresponds to the JSON property `cacheHit`
# @return [Boolean]
attr_accessor :cache_hit
alias_method :cache_hit?, :cache_hit
# Whether or not a cache lookup was attempted.
# Corresponds to the JSON property `cacheLookup`
# @return [Boolean]
attr_accessor :cache_lookup
alias_method :cache_lookup?, :cache_lookup
# Whether or not the response was validated with the origin server before being
# served from cache. This field is only meaningful if `cache_hit` is True.
# Corresponds to the JSON property `cacheValidatedWithOriginServer`
# @return [Boolean]
attr_accessor :cache_validated_with_origin_server
alias_method :cache_validated_with_origin_server?, :cache_validated_with_origin_server
# The request processing latency on the server, from the time the request was
# received until the response was sent.
# Corresponds to the JSON property `latency`
# @return [String]
attr_accessor :latency
# Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket"
# Corresponds to the JSON property `protocol`
# @return [String]
attr_accessor :protocol
# The referer URL of the request, as defined in [HTTP/1.1 Header Field
# Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).
# Corresponds to the JSON property `referer`
# @return [String]
attr_accessor :referer
# The IP address (IPv4 or IPv6) of the client that issued the HTTP request.
# Examples: `"192.168.1.1"`, `"FE80::0202:B3FF:FE1E:8329"`.
# Corresponds to the JSON property `remoteIp`
# @return [String]
attr_accessor :remote_ip