-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathservicecontrol-gen.go
3450 lines (3073 loc) · 134 KB
/
servicecontrol-gen.go
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 2019 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated file. DO NOT EDIT.
// Package servicecontrol provides access to the Service Control API.
//
// For product documentation, see: https://cloud.google.com/service-control/
//
// Creating a client
//
// Usage example:
//
// import "google.golang.org/api/servicecontrol/v1"
// ...
// ctx := context.Background()
// servicecontrolService, err := servicecontrol.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for authentication.
//
// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// Other authentication options
//
// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
//
// servicecontrolService, err := servicecontrol.NewService(ctx, option.WithScopes(servicecontrol.ServicecontrolScope))
//
// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
//
// servicecontrolService, err := servicecontrol.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// servicecontrolService, err := servicecontrol.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package servicecontrol // import "google.golang.org/api/servicecontrol/v1"
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"strings"
googleapi "google.golang.org/api/googleapi"
gensupport "google.golang.org/api/internal/gensupport"
option "google.golang.org/api/option"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = gensupport.MarshalJSON
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Canceled
const apiId = "servicecontrol:v1"
const apiName = "servicecontrol"
const apiVersion = "v1"
const basePath = "https://servicecontrol.googleapis.com/"
// OAuth2 scopes used by this API.
const (
// View and manage your data across Google Cloud Platform services
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
// Manage your Google Service Control data
ServicecontrolScope = "https://www.googleapis.com/auth/servicecontrol"
)
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
scopesOption := option.WithScopes(
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/servicecontrol",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.Services = NewServicesService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Services *ServicesService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewServicesService(s *Service) *ServicesService {
rs := &ServicesService{s: s}
return rs
}
type ServicesService struct {
s *Service
}
type AllocateInfo struct {
// UnusedArguments: 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.
UnusedArguments []string `json:"unusedArguments,omitempty"`
// ForceSendFields is a list of field names (e.g. "UnusedArguments") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "UnusedArguments") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *AllocateInfo) MarshalJSON() ([]byte, error) {
type NoMethod AllocateInfo
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// AllocateQuotaRequest: Request message for the AllocateQuota method.
type AllocateQuotaRequest struct {
// AllocateOperation: Operation that describes the quota allocation.
AllocateOperation *QuotaOperation `json:"allocateOperation,omitempty"`
// ServiceConfigId: 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.
ServiceConfigId string `json:"serviceConfigId,omitempty"`
// ForceSendFields is a list of field names (e.g. "AllocateOperation")
// to unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AllocateOperation") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *AllocateQuotaRequest) MarshalJSON() ([]byte, error) {
type NoMethod AllocateQuotaRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// AllocateQuotaResponse: Response message for the AllocateQuota method.
type AllocateQuotaResponse struct {
// AllocateErrors: Indicates the decision of the allocate.
AllocateErrors []*QuotaError `json:"allocateErrors,omitempty"`
// AllocateInfo: WARNING: DO NOT use this field until this warning
// message is removed.
AllocateInfo *AllocateInfo `json:"allocateInfo,omitempty"`
// OperationId: The same operation_id value used in the
// AllocateQuotaRequest. Used for
// logging and diagnostics purposes.
OperationId string `json:"operationId,omitempty"`
// QuotaMetrics: 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"
QuotaMetrics []*MetricValueSet `json:"quotaMetrics,omitempty"`
// ServiceConfigId: ID of the actual config used to process the request.
ServiceConfigId string `json:"serviceConfigId,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "AllocateErrors") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AllocateErrors") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *AllocateQuotaResponse) MarshalJSON() ([]byte, error) {
type NoMethod AllocateQuotaResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// AuditLog: Common audit log format for Google Cloud Platform API
// operations.
//
//
//
type AuditLog struct {
// AuthenticationInfo: Authentication information.
AuthenticationInfo *AuthenticationInfo `json:"authenticationInfo,omitempty"`
// AuthorizationInfo: Authorization information. If there are
// multiple
// resources or permissions involved, then there is
// one AuthorizationInfo element for each {resource, permission} tuple.
AuthorizationInfo []*AuthorizationInfo `json:"authorizationInfo,omitempty"`
// Metadata: Other service-specific data about the request, response,
// and other
// information associated with the current audited event.
Metadata googleapi.RawMessage `json:"metadata,omitempty"`
// MethodName: The name of the service method or operation.
// For API calls, this should be the name of the API method.
// For example,
//
// "google.datastore.v1.Datastore.RunQuery"
// "google.logging.v1.LoggingService.DeleteLog"
MethodName string `json:"methodName,omitempty"`
// NumResponseItems: The number of items returned from a List or Query
// API method,
// if applicable.
NumResponseItems int64 `json:"numResponseItems,omitempty,string"`
// Request: 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.
Request googleapi.RawMessage `json:"request,omitempty"`
// RequestMetadata: Metadata about the operation.
RequestMetadata *RequestMetadata `json:"requestMetadata,omitempty"`
// ResourceLocation: The resource location information.
ResourceLocation *ResourceLocation `json:"resourceLocation,omitempty"`
// ResourceName: 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:
//
// "shelves/SHELF_ID/books"
// "shelves/SHELF_ID/books/BOOK_ID"
ResourceName string `json:"resourceName,omitempty"`
// ResourceOriginalState: 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.
ResourceOriginalState googleapi.RawMessage `json:"resourceOriginalState,omitempty"`
// Response: 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.
Response googleapi.RawMessage `json:"response,omitempty"`
// ServiceData: Deprecated, use `metadata` field instead.
// Other service-specific data about the request, response, and
// other
// activities.
ServiceData googleapi.RawMessage `json:"serviceData,omitempty"`
// ServiceName: The name of the API service performing the operation.
// For example,
// "datastore.googleapis.com".
ServiceName string `json:"serviceName,omitempty"`
// Status: The status of the overall operation.
Status *Status `json:"status,omitempty"`
// ForceSendFields is a list of field names (e.g. "AuthenticationInfo")
// to unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AuthenticationInfo") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *AuditLog) MarshalJSON() ([]byte, error) {
type NoMethod AuditLog
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Auth: 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.
type Auth struct {
// AccessLevels: 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/accessP
// olicies/MY_POLICY_ID/accessLevels/MY_LEVEL"
AccessLevels []string `json:"accessLevels,omitempty"`
// Audiences: 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 such as
// ["pubsub.googleapis.com", "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.
Audiences []string `json:"audiences,omitempty"`
// Claims: 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.
Claims googleapi.RawMessage `json:"claims,omitempty"`
// Presenter: 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".
Presenter string `json:"presenter,omitempty"`
// Principal: 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}"
Principal string `json:"principal,omitempty"`
// ForceSendFields is a list of field names (e.g. "AccessLevels") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AccessLevels") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Auth) MarshalJSON() ([]byte, error) {
type NoMethod Auth
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// AuthenticationInfo: Authentication information for the operation.
type AuthenticationInfo struct {
// AuthoritySelector: The authority selector specified by the requestor,
// if any.
// It is not guaranteed that the principal was allowed to use this
// authority.
AuthoritySelector string `json:"authoritySelector,omitempty"`
// PrincipalEmail: The email address of the authenticated user (or
// service account on behalf
// of third party principal) making the request. For privacy reasons,
// the
// principal email address is redacted for all read-only operations that
// fail
// with a "permission denied" error.
PrincipalEmail string `json:"principalEmail,omitempty"`
// ServiceAccountDelegationInfo: 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.
ServiceAccountDelegationInfo []*ServiceAccountDelegationInfo `json:"serviceAccountDelegationInfo,omitempty"`
// ServiceAccountKeyName: 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}"
ServiceAccountKeyName string `json:"serviceAccountKeyName,omitempty"`
// ThirdPartyPrincipal: 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.
ThirdPartyPrincipal googleapi.RawMessage `json:"thirdPartyPrincipal,omitempty"`
// ForceSendFields is a list of field names (e.g. "AuthoritySelector")
// to unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AuthoritySelector") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *AuthenticationInfo) MarshalJSON() ([]byte, error) {
type NoMethod AuthenticationInfo
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// AuthorizationInfo: Authorization information for the operation.
type AuthorizationInfo struct {
// Granted: Whether or not authorization for `resource` and
// `permission`
// was granted.
Granted bool `json:"granted,omitempty"`
// Permission: The required IAM permission.
Permission string `json:"permission,omitempty"`
// Resource: The resource being accessed, as a REST-style string. For
// example:
//
// bigquery.googleapis.com/projects/PROJECTID/datasets/DATASETID
Resource string `json:"resource,omitempty"`
// ResourceAttributes: Resource attributes used in IAM condition
// evaluation. This field contains
// resource attributes like resource type and resource name.
//
// To get the whole view of the attributes used in IAM
// condition evaluation, the user must also look
// into
// `AuditLog.request_metadata.request_attributes`.
ResourceAttributes *Resource `json:"resourceAttributes,omitempty"`
// ForceSendFields is a list of field names (e.g. "Granted") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Granted") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *AuthorizationInfo) MarshalJSON() ([]byte, error) {
type NoMethod AuthorizationInfo
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CheckError: Defines the errors to be returned
// in
// google.api.servicecontrol.v1.CheckResponse.check_errors.
type CheckError struct {
// Code: The error code.
//
// Possible values:
// "ERROR_CODE_UNSPECIFIED" - This is never used in `CheckResponse`.
// "NOT_FOUND" - The consumer's project id, network container, or
// resource container was
// not found. Same as google.rpc.Code.NOT_FOUND.
// "PERMISSION_DENIED" - The consumer doesn't have access to the
// specified resource.
// Same as google.rpc.Code.PERMISSION_DENIED.
// "RESOURCE_EXHAUSTED" - Quota check failed. Same as
// google.rpc.Code.RESOURCE_EXHAUSTED.
// "BUDGET_EXCEEDED" - Budget check failed.
// "DENIAL_OF_SERVICE_DETECTED" - The consumer's request has been
// flagged as a DoS attack.
// "LOAD_SHEDDING" - The consumer's request should be rejected in
// order to protect the service
// from being overloaded.
// "ABUSER_DETECTED" - The consumer has been flagged as an abuser.
// "SERVICE_NOT_ACTIVATED" - The consumer hasn't activated the
// service.
// "VISIBILITY_DENIED" - The consumer cannot access the service due to
// visibility configuration.
// "BILLING_DISABLED" - The consumer cannot access the service because
// billing is disabled.
// "PROJECT_DELETED" - The consumer's project has been marked as
// deleted (soft deletion).
// "PROJECT_INVALID" - The consumer's project number or id does not
// represent a valid project.
// "CONSUMER_INVALID" - The input consumer info does not represent a
// valid consumer folder or
// organization.
// "IP_ADDRESS_BLOCKED" - The IP address of the consumer is invalid
// for the specific consumer
// project.
// "REFERER_BLOCKED" - The referer address of the consumer request is
// invalid for the specific
// consumer project.
// "CLIENT_APP_BLOCKED" - The client application of the consumer
// request is invalid for the
// specific consumer project.
// "API_TARGET_BLOCKED" - The API targeted by this request is invalid
// for the specified consumer
// project.
// "API_KEY_INVALID" - The consumer's API key is invalid.
// "API_KEY_EXPIRED" - The consumer's API Key has expired.
// "API_KEY_NOT_FOUND" - The consumer's API Key was not found in
// config record.
// "SPATULA_HEADER_INVALID" - The consumer's spatula header is
// invalid.
// "LOAS_ROLE_INVALID" - The consumer's LOAS role is invalid.
// "NO_LOAS_PROJECT" - The consumer's LOAS role has no associated
// project.
// "LOAS_PROJECT_DISABLED" - The consumer's LOAS project is not
// `ACTIVE` in LoquatV2.
// "SECURITY_POLICY_VIOLATED" - Request is not allowed as per security
// policies defined in Org Policy.
// "INVALID_CREDENTIAL" - The credential in the request can not be
// verified.
// "LOCATION_POLICY_VIOLATED" - Request is not allowed as per location
// policies defined in Org Policy.
// "NAMESPACE_LOOKUP_UNAVAILABLE" - The backend server for looking up
// project id/number is unavailable.
// "SERVICE_STATUS_UNAVAILABLE" - The backend server for checking
// service status is unavailable.
// "BILLING_STATUS_UNAVAILABLE" - The backend server for checking
// billing status is unavailable.
// "QUOTA_CHECK_UNAVAILABLE" - The backend server for checking quota
// limits is unavailable.
// "LOAS_PROJECT_LOOKUP_UNAVAILABLE" - The Spanner for looking up LOAS
// project is unavailable.
// "CLOUD_RESOURCE_MANAGER_BACKEND_UNAVAILABLE" - Cloud Resource
// Manager backend server is unavailable.
// "SECURITY_POLICY_BACKEND_UNAVAILABLE" - NOTE: for customers in the
// scope of Beta/GA of
// https://cloud.google.com/vpc-service-controls, this error
// is no longer returned. If the security backend is unavailable,
// rpc
// UNAVAILABLE status will be returned instead. It should be ignored
// and
// should not be used to reject client requests.
// "LOCATION_POLICY_BACKEND_UNAVAILABLE" - Backend server for
// evaluating location policy is unavailable.
Code string `json:"code,omitempty"`
// Detail: Free-form text providing details on the error cause of the
// error.
Detail string `json:"detail,omitempty"`
// Status: Contains public information about the check error. If
// available,
// `status.code` will be non zero and client can propagate it out as
// public
// error.
Status *Status `json:"status,omitempty"`
// Subject: Subject to whom this error applies. See the specific code
// enum for more
// details on this field. For example:
// - “project:<project-id or project-number>”
// - “folder:<folder-id>”
// - “organization:<organization-id>”
Subject string `json:"subject,omitempty"`
// ForceSendFields is a list of field names (e.g. "Code") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Code") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *CheckError) MarshalJSON() ([]byte, error) {
type NoMethod CheckError
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CheckInfo: Contains additional information about the check operation.
type CheckInfo struct {
// ConsumerInfo: Consumer info of this check.
ConsumerInfo *ConsumerInfo `json:"consumerInfo,omitempty"`
// UnusedArguments: 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.
UnusedArguments []string `json:"unusedArguments,omitempty"`
// ForceSendFields is a list of field names (e.g. "ConsumerInfo") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ConsumerInfo") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *CheckInfo) MarshalJSON() ([]byte, error) {
type NoMethod CheckInfo
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CheckRequest: Request message for the Check method.
type CheckRequest struct {
// Operation: The operation to be checked.
Operation *Operation `json:"operation,omitempty"`
// RequestProjectSettings: Requests the project settings to be returned
// as part of the check response.
RequestProjectSettings bool `json:"requestProjectSettings,omitempty"`
// ServiceConfigId: 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.
ServiceConfigId string `json:"serviceConfigId,omitempty"`
// SkipActivationCheck: 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.
SkipActivationCheck bool `json:"skipActivationCheck,omitempty"`
// ForceSendFields is a list of field names (e.g. "Operation") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Operation") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *CheckRequest) MarshalJSON() ([]byte, error) {
type NoMethod CheckRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CheckResponse: Response message for the Check method.
type CheckResponse struct {
// CheckErrors: 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.
CheckErrors []*CheckError `json:"checkErrors,omitempty"`
// CheckInfo: Feedback data returned from the server during processing a
// Check request.
CheckInfo *CheckInfo `json:"checkInfo,omitempty"`
// OperationId: The same operation_id value used in the
// CheckRequest.
// Used for logging and diagnostics purposes.
OperationId string `json:"operationId,omitempty"`
// QuotaInfo: Quota information for the check request associated with
// this response.
//
QuotaInfo *QuotaInfo `json:"quotaInfo,omitempty"`
// ServiceConfigId: The actual config id used to process the request.
ServiceConfigId string `json:"serviceConfigId,omitempty"`
// ServiceRolloutId: Unimplemented. The current service rollout id used
// to process the request.
ServiceRolloutId string `json:"serviceRolloutId,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "CheckErrors") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "CheckErrors") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *CheckResponse) MarshalJSON() ([]byte, error) {
type NoMethod CheckResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ConsumerInfo: `ConsumerInfo` provides information about the consumer.
type ConsumerInfo struct {
// ConsumerNumber: 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.
ConsumerNumber int64 `json:"consumerNumber,omitempty,string"`
// ProjectNumber: 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.
ProjectNumber int64 `json:"projectNumber,omitempty,string"`
// Type: The type of the consumer which should have been defined
// in
// [Google Resource
// Manager](https://cloud.google.com/resource-manager/).
//
// Possible values:
// "CONSUMER_TYPE_UNSPECIFIED" - This is never used.
// "PROJECT" - The consumer is a Google Cloud Project.
// "FOLDER" - The consumer is a Google Cloud Folder.
// "ORGANIZATION" - The consumer is a Google Cloud Organization.
// "SERVICE_SPECIFIC" - Service-specific resource container which is
// defined by the service
// producer to offer their users the ability to manage service
// control
// functionalities at a finer level of granularity than the PROJECT.
Type string `json:"type,omitempty"`
// ForceSendFields is a list of field names (e.g. "ConsumerNumber") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ConsumerNumber") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *ConsumerInfo) MarshalJSON() ([]byte, error) {
type NoMethod ConsumerInfo
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Distribution: 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
type Distribution struct {
// BucketCounts: 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.
BucketCounts googleapi.Int64s `json:"bucketCounts,omitempty"`
// Count: The total number of samples in the distribution. Must be >= 0.
Count int64 `json:"count,omitempty,string"`
// Exemplars: Example points. Must be in increasing order of `value`
// field.
Exemplars []*Exemplar `json:"exemplars,omitempty"`
// ExplicitBuckets: Buckets with arbitrary user-provided width.
ExplicitBuckets *ExplicitBuckets `json:"explicitBuckets,omitempty"`
// ExponentialBuckets: Buckets with exponentially growing width.
ExponentialBuckets *ExponentialBuckets `json:"exponentialBuckets,omitempty"`