-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
serviceusage-gen.go
8552 lines (7704 loc) · 366 KB
/
serviceusage-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 2022 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 serviceusage provides access to the Service Usage API.
//
// For product documentation, see: https://cloud.google.com/service-usage/
//
// Creating a client
//
// Usage example:
//
// import "google.golang.org/api/serviceusage/v1beta1"
// ...
// ctx := context.Background()
// serviceusageService, err := serviceusage.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:
//
// serviceusageService, err := serviceusage.NewService(ctx, option.WithScopes(serviceusage.ServiceManagementScope))
//
// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
//
// serviceusageService, err := serviceusage.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, ...)
// serviceusageService, err := serviceusage.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package serviceusage // import "google.golang.org/api/serviceusage/v1beta1"
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"strings"
googleapi "google.golang.org/api/googleapi"
internal "google.golang.org/api/internal"
gensupport "google.golang.org/api/internal/gensupport"
option "google.golang.org/api/option"
internaloption "google.golang.org/api/option/internaloption"
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
var _ = internaloption.WithDefaultEndpoint
const apiId = "serviceusage:v1beta1"
const apiName = "serviceusage"
const apiVersion = "v1beta1"
const basePath = "https://serviceusage.googleapis.com/"
const mtlsBasePath = "https://serviceusage.mtls.googleapis.com/"
// OAuth2 scopes used by this API.
const (
// See, edit, configure, and delete your Google Cloud data and see the
// email address for your Google Account.
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
// View your data across Google Cloud services and see the email address
// of your Google Account
CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only"
// Manage your Google API service configuration
ServiceManagementScope = "https://www.googleapis.com/auth/service.management"
)
// NewService creates a new APIService.
func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, error) {
scopesOption := internaloption.WithDefaultScopes(
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloud-platform.read-only",
"https://www.googleapis.com/auth/service.management",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
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 APIService. 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) (*APIService, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &APIService{client: client, BasePath: basePath}
s.Operations = NewOperationsService(s)
s.Services = NewServicesService(s)
return s, nil
}
type APIService struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Operations *OperationsService
Services *ServicesService
}
func (s *APIService) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewOperationsService(s *APIService) *OperationsService {
rs := &OperationsService{s: s}
return rs
}
type OperationsService struct {
s *APIService
}
func NewServicesService(s *APIService) *ServicesService {
rs := &ServicesService{s: s}
rs.ConsumerQuotaMetrics = NewServicesConsumerQuotaMetricsService(s)
return rs
}
type ServicesService struct {
s *APIService
ConsumerQuotaMetrics *ServicesConsumerQuotaMetricsService
}
func NewServicesConsumerQuotaMetricsService(s *APIService) *ServicesConsumerQuotaMetricsService {
rs := &ServicesConsumerQuotaMetricsService{s: s}
rs.Limits = NewServicesConsumerQuotaMetricsLimitsService(s)
return rs
}
type ServicesConsumerQuotaMetricsService struct {
s *APIService
Limits *ServicesConsumerQuotaMetricsLimitsService
}
func NewServicesConsumerQuotaMetricsLimitsService(s *APIService) *ServicesConsumerQuotaMetricsLimitsService {
rs := &ServicesConsumerQuotaMetricsLimitsService{s: s}
rs.AdminOverrides = NewServicesConsumerQuotaMetricsLimitsAdminOverridesService(s)
rs.ConsumerOverrides = NewServicesConsumerQuotaMetricsLimitsConsumerOverridesService(s)
return rs
}
type ServicesConsumerQuotaMetricsLimitsService struct {
s *APIService
AdminOverrides *ServicesConsumerQuotaMetricsLimitsAdminOverridesService
ConsumerOverrides *ServicesConsumerQuotaMetricsLimitsConsumerOverridesService
}
func NewServicesConsumerQuotaMetricsLimitsAdminOverridesService(s *APIService) *ServicesConsumerQuotaMetricsLimitsAdminOverridesService {
rs := &ServicesConsumerQuotaMetricsLimitsAdminOverridesService{s: s}
return rs
}
type ServicesConsumerQuotaMetricsLimitsAdminOverridesService struct {
s *APIService
}
func NewServicesConsumerQuotaMetricsLimitsConsumerOverridesService(s *APIService) *ServicesConsumerQuotaMetricsLimitsConsumerOverridesService {
rs := &ServicesConsumerQuotaMetricsLimitsConsumerOverridesService{s: s}
return rs
}
type ServicesConsumerQuotaMetricsLimitsConsumerOverridesService struct {
s *APIService
}
// AdminQuotaPolicy: Quota policy created by quota administrator.
type AdminQuotaPolicy struct {
// Container: The cloud resource container at which the quota policy is
// created. The format is `{container_type}/{container_number}`
Container string `json:"container,omitempty"`
// Dimensions: If this map is nonempty, then this policy applies only
// to specific values for dimensions defined in the limit unit. For
// example, an policy on a limit with the unit `1/{project}/{region}`
// could contain an entry with the key `region` and the value
// `us-east-1`; the policy is only applied to quota consumed in that
// region. This map has the following restrictions: * If `region`
// appears as a key, its value must be a valid Cloud region. * If `zone`
// appears as a key, its value must be a valid Cloud zone. * Keys other
// than `region` or `zone` are not valid.
Dimensions map[string]string `json:"dimensions,omitempty"`
// Metric: The name of the metric to which this policy applies. An
// example name would be: `compute.googleapis.com/cpus`
Metric string `json:"metric,omitempty"`
// Name: The resource name of the policy. This name is generated by the
// server when the policy is created. Example names would be:
// `organizations/123/services/compute.googleapis.com/consumerQuotaMetric
// s/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/adminQuotaP
// olicies/4a3f2c1d`
Name string `json:"name,omitempty"`
// PolicyValue: The quota policy value. Can be any nonnegative integer,
// or -1 (unlimited quota).
PolicyValue int64 `json:"policyValue,omitempty,string"`
// Unit: The limit unit of the limit to which this policy applies. An
// example unit would be: `1/{project}/{region}` Note that `{project}`
// and `{region}` are not placeholders in this example; the literal
// characters `{` and `}` occur in the string.
Unit string `json:"unit,omitempty"`
// ForceSendFields is a list of field names (e.g. "Container") to
// unconditionally include in API requests. By default, fields with
// empty or default 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. "Container") 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 *AdminQuotaPolicy) MarshalJSON() ([]byte, error) {
type NoMethod AdminQuotaPolicy
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Api: Api is a light-weight descriptor for an API Interface.
// Interfaces are also described as "protocol buffer services" in some
// contexts, such as by the "service" keyword in a .proto file, but they
// are different from API Services, which represent a concrete
// implementation of an interface as opposed to simply a description of
// methods and bindings. They are also sometimes simply referred to as
// "APIs" in other contexts, such as the name of this message itself.
// See https://cloud.google.com/apis/design/glossary for detailed
// terminology.
type Api struct {
// Methods: The methods of this interface, in unspecified order.
Methods []*Method `json:"methods,omitempty"`
// Mixins: Included interfaces. See Mixin.
Mixins []*Mixin `json:"mixins,omitempty"`
// Name: The fully qualified name of this interface, including package
// name followed by the interface's simple name.
Name string `json:"name,omitempty"`
// Options: Any metadata attached to the interface.
Options []*Option `json:"options,omitempty"`
// SourceContext: Source context for the protocol buffer service
// represented by this message.
SourceContext *SourceContext `json:"sourceContext,omitempty"`
// Syntax: The source syntax of the service.
//
// Possible values:
// "SYNTAX_PROTO2" - Syntax `proto2`.
// "SYNTAX_PROTO3" - Syntax `proto3`.
Syntax string `json:"syntax,omitempty"`
// Version: A version string for this interface. If specified, must have
// the form `major-version.minor-version`, as in `1.10`. If the minor
// version is omitted, it defaults to zero. If the entire version field
// is empty, the major version is derived from the package name, as
// outlined below. If the field is not empty, the version in the package
// name will be verified to be consistent with what is provided here.
// The versioning schema uses semantic versioning (http://semver.org)
// where the major version number indicates a breaking change and the
// minor version an additive, non-breaking change. Both version numbers
// are signals to users what to expect from different versions, and
// should be carefully chosen based on the product plan. The major
// version is also reflected in the package name of the interface, which
// must end in `v`, as in `google.feature.v1`. For major versions 0 and
// 1, the suffix can be omitted. Zero major versions must only be used
// for experimental, non-GA interfaces.
Version string `json:"version,omitempty"`
// ForceSendFields is a list of field names (e.g. "Methods") to
// unconditionally include in API requests. By default, fields with
// empty or default 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. "Methods") 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 *Api) MarshalJSON() ([]byte, error) {
type NoMethod Api
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// AuthProvider: Configuration for an authentication provider, including
// support for JSON Web Token (JWT)
// (https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32).
type AuthProvider struct {
// Audiences: The list of JWT audiences
// (https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3).
// that are allowed to access. A JWT containing any of these audiences
// will be accepted. When this setting is absent, JWTs with audiences: -
// "https://[service.name]/[google.protobuf.Api.name]" -
// "https://[service.name]/" will be accepted. For example, if no
// audiences are in the setting, LibraryService API will accept JWTs
// with the following audiences: -
// https://library-example.googleapis.com/google.example.library.v1.LibraryService
// - https://library-example.googleapis.com/ Example: audiences:
// bookstore_android.apps.googleusercontent.com,
// bookstore_web.apps.googleusercontent.com
Audiences string `json:"audiences,omitempty"`
// AuthorizationUrl: Redirect URL if JWT token is required but not
// present or is expired. Implement authorizationUrl of
// securityDefinitions in OpenAPI spec.
AuthorizationUrl string `json:"authorizationUrl,omitempty"`
// Id: The unique identifier of the auth provider. It will be referred
// to by `AuthRequirement.provider_id`. Example: "bookstore_auth".
Id string `json:"id,omitempty"`
// Issuer: Identifies the principal that issued the JWT. See
// https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1
// Usually a URL or an email address. Example:
// https://securetoken.google.com Example:
// 1234567-compute@developer.gserviceaccount.com
Issuer string `json:"issuer,omitempty"`
// JwksUri: URL of the provider's public key set to validate signature
// of the JWT. See OpenID Discovery
// (https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata).
// Optional if the key set document: - can be retrieved from OpenID
// Discovery
// (https://openid.net/specs/openid-connect-discovery-1_0.html) of the
// issuer. - can be inferred from the email domain of the issuer (e.g. a
// Google service account). Example:
// https://www.googleapis.com/oauth2/v1/certs
JwksUri string `json:"jwksUri,omitempty"`
// JwtLocations: Defines the locations to extract the JWT. For now it is
// only used by the Cloud Endpoints to store the OpenAPI extension
// [x-google-jwt-locations]
// (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations)
// JWT locations can be one of HTTP headers, URL query parameters or
// cookies. The rule is that the first match wins. If not specified,
// default to use following 3 locations: 1) Authorization: Bearer 2)
// x-goog-iap-jwt-assertion 3) access_token query parameter Default
// locations can be specified as followings: jwt_locations: - header:
// Authorization value_prefix: "Bearer " - header:
// x-goog-iap-jwt-assertion - query: access_token
JwtLocations []*JwtLocation `json:"jwtLocations,omitempty"`
// ForceSendFields is a list of field names (e.g. "Audiences") to
// unconditionally include in API requests. By default, fields with
// empty or default 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. "Audiences") 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 *AuthProvider) MarshalJSON() ([]byte, error) {
type NoMethod AuthProvider
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// AuthRequirement: User-defined authentication requirements, including
// support for JSON Web Token (JWT)
// (https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32).
type AuthRequirement struct {
// Audiences: NOTE: This will be deprecated soon, once
// AuthProvider.audiences is implemented and accepted in all the runtime
// components. The list of JWT audiences
// (https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3).
// that are allowed to access. A JWT containing any of these audiences
// will be accepted. When this setting is absent, only JWTs with
// audience "https://Service_name/API_name" will be accepted. For
// example, if no audiences are in the setting, LibraryService API will
// only accept JWTs with the following audience
// "https://library-example.googleapis.com/google.example.library.v1.Libr
// aryService". Example: audiences:
// bookstore_android.apps.googleusercontent.com,
// bookstore_web.apps.googleusercontent.com
Audiences string `json:"audiences,omitempty"`
// ProviderId: id from authentication provider. Example: provider_id:
// bookstore_auth
ProviderId string `json:"providerId,omitempty"`
// ForceSendFields is a list of field names (e.g. "Audiences") to
// unconditionally include in API requests. By default, fields with
// empty or default 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. "Audiences") 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 *AuthRequirement) MarshalJSON() ([]byte, error) {
type NoMethod AuthRequirement
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Authentication: `Authentication` defines the authentication
// configuration for API methods provided by an API service. Example:
// name: calendar.googleapis.com authentication: providers: - id:
// google_calendar_auth jwks_uri:
// https://www.googleapis.com/oauth2/v1/certs issuer:
// https://securetoken.google.com rules: - selector: "*" requirements:
// provider_id: google_calendar_auth - selector:
// google.calendar.Delegate oauth: canonical_scopes:
// https://www.googleapis.com/auth/calendar.read
type Authentication struct {
// Providers: Defines a set of authentication providers that a service
// supports.
Providers []*AuthProvider `json:"providers,omitempty"`
// Rules: A list of authentication rules that apply to individual API
// methods. **NOTE:** All service configuration rules follow "last one
// wins" order.
Rules []*AuthenticationRule `json:"rules,omitempty"`
// ForceSendFields is a list of field names (e.g. "Providers") to
// unconditionally include in API requests. By default, fields with
// empty or default 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. "Providers") 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 *Authentication) MarshalJSON() ([]byte, error) {
type NoMethod Authentication
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// AuthenticationRule: Authentication rules for the service. By default,
// if a method has any authentication requirements, every request must
// include a valid credential matching one of the requirements. It's an
// error to include more than one kind of credential in a single
// request. If a method doesn't have any auth requirements, request
// credentials will be ignored.
type AuthenticationRule struct {
// AllowWithoutCredential: If true, the service accepts API keys without
// any other credential. This flag only applies to HTTP and gRPC
// requests.
AllowWithoutCredential bool `json:"allowWithoutCredential,omitempty"`
// Oauth: The requirements for OAuth credentials.
Oauth *OAuthRequirements `json:"oauth,omitempty"`
// Requirements: Requirements for additional authentication providers.
Requirements []*AuthRequirement `json:"requirements,omitempty"`
// Selector: Selects the methods to which this rule applies. Refer to
// selector for syntax details.
Selector string `json:"selector,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "AllowWithoutCredential") to unconditionally include in API requests.
// By default, fields with empty or default 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. "AllowWithoutCredential")
// 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 *AuthenticationRule) MarshalJSON() ([]byte, error) {
type NoMethod AuthenticationRule
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Backend: `Backend` defines the backend configuration for a service.
type Backend struct {
// Rules: A list of API backend rules that apply to individual API
// methods. **NOTE:** All service configuration rules follow "last one
// wins" order.
Rules []*BackendRule `json:"rules,omitempty"`
// ForceSendFields is a list of field names (e.g. "Rules") to
// unconditionally include in API requests. By default, fields with
// empty or default 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. "Rules") 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 *Backend) MarshalJSON() ([]byte, error) {
type NoMethod Backend
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BackendRule: A backend rule provides configuration for an individual
// API element.
type BackendRule struct {
// Address: The address of the API backend. The scheme is used to
// determine the backend protocol and security. The following schemes
// are accepted: SCHEME PROTOCOL SECURITY http:// HTTP None https://
// HTTP TLS grpc:// gRPC None grpcs:// gRPC TLS It is recommended to
// explicitly include a scheme. Leaving out the scheme may cause
// constrasting behaviors across platforms. If the port is unspecified,
// the default is: - 80 for schemes without TLS - 443 for schemes with
// TLS For HTTP backends, use protocol to specify the protocol version.
Address string `json:"address,omitempty"`
// Deadline: The number of seconds to wait for a response from a
// request. The default varies based on the request protocol and
// deployment environment.
Deadline float64 `json:"deadline,omitempty"`
// DisableAuth: When disable_auth is true, a JWT ID token won't be
// generated and the original "Authorization" HTTP header will be
// preserved. If the header is used to carry the original token and is
// expected by the backend, this field must be set to true to preserve
// the header.
DisableAuth bool `json:"disableAuth,omitempty"`
// JwtAudience: The JWT audience is used when generating a JWT ID token
// for the backend. This ID token will be added in the HTTP
// "authorization" header, and sent to the backend.
JwtAudience string `json:"jwtAudience,omitempty"`
// OperationDeadline: The number of seconds to wait for the completion
// of a long running operation. The default is no deadline.
OperationDeadline float64 `json:"operationDeadline,omitempty"`
// Possible values:
// "PATH_TRANSLATION_UNSPECIFIED"
// "CONSTANT_ADDRESS" - Use the backend address as-is, with no
// modification to the path. If the URL pattern contains variables, the
// variable names and values will be appended to the query string. If a
// query string parameter and a URL pattern variable have the same name,
// this may result in duplicate keys in the query string. # Examples
// Given the following operation config: Method path:
// /api/company/{cid}/user/{uid} Backend address:
// https://example.cloudfunctions.net/getUser Requests to the following
// request paths will call the backend at the translated path: Request
// path: /api/company/widgetworks/user/johndoe Translated:
// https://example.cloudfunctions.net/getUser?cid=widgetworks&uid=johndoe
// Request path: /api/company/widgetworks/user/johndoe?timezone=EST
// Translated:
// https://example.cloudfunctions.net/getUser?timezone=EST&cid=widgetworks&uid=johndoe
// "APPEND_PATH_TO_ADDRESS" - The request path will be appended to the
// backend address. # Examples Given the following operation config:
// Method path: /api/company/{cid}/user/{uid} Backend address:
// https://example.appspot.com Requests to the following request paths
// will call the backend at the translated path: Request path:
// /api/company/widgetworks/user/johndoe Translated:
// https://example.appspot.com/api/company/widgetworks/user/johndoe
// Request path: /api/company/widgetworks/user/johndoe?timezone=EST
// Translated:
// https://example.appspot.com/api/company/widgetworks/user/johndoe?timezone=EST
PathTranslation string `json:"pathTranslation,omitempty"`
// Protocol: The protocol used for sending a request to the backend. The
// supported values are "http/1.1" and "h2". The default value is
// inferred from the scheme in the address field: SCHEME PROTOCOL
// http:// http/1.1 https:// http/1.1 grpc:// h2 grpcs:// h2 For secure
// HTTP backends (https://) that support HTTP/2, set this field to "h2"
// for improved performance. Configuring this field to non-default
// values is only supported for secure HTTP backends. This field will be
// ignored for all other backends. See
// https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids
// for more details on the supported values.
Protocol string `json:"protocol,omitempty"`
// Selector: Selects the methods to which this rule applies. Refer to
// selector for syntax details.
Selector string `json:"selector,omitempty"`
// ForceSendFields is a list of field names (e.g. "Address") to
// unconditionally include in API requests. By default, fields with
// empty or default 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. "Address") 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 *BackendRule) MarshalJSON() ([]byte, error) {
type NoMethod BackendRule
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *BackendRule) UnmarshalJSON(data []byte) error {
type NoMethod BackendRule
var s1 struct {
Deadline gensupport.JSONFloat64 `json:"deadline"`
OperationDeadline gensupport.JSONFloat64 `json:"operationDeadline"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.Deadline = float64(s1.Deadline)
s.OperationDeadline = float64(s1.OperationDeadline)
return nil
}
// BatchCreateAdminOverridesResponse: Response message for
// BatchCreateAdminOverrides
type BatchCreateAdminOverridesResponse struct {
// Overrides: The overrides that were created.
Overrides []*QuotaOverride `json:"overrides,omitempty"`
// ForceSendFields is a list of field names (e.g. "Overrides") to
// unconditionally include in API requests. By default, fields with
// empty or default 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. "Overrides") 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 *BatchCreateAdminOverridesResponse) MarshalJSON() ([]byte, error) {
type NoMethod BatchCreateAdminOverridesResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BatchCreateConsumerOverridesResponse: Response message for
// BatchCreateConsumerOverrides
type BatchCreateConsumerOverridesResponse struct {
// Overrides: The overrides that were created.
Overrides []*QuotaOverride `json:"overrides,omitempty"`
// ForceSendFields is a list of field names (e.g. "Overrides") to
// unconditionally include in API requests. By default, fields with
// empty or default 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. "Overrides") 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 *BatchCreateConsumerOverridesResponse) MarshalJSON() ([]byte, error) {
type NoMethod BatchCreateConsumerOverridesResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BatchEnableServicesRequest: Request message for the
// `BatchEnableServices` method.
type BatchEnableServicesRequest struct {
// ServiceIds: The identifiers of the services to enable on the project.
// A valid identifier would be: serviceusage.googleapis.com Enabling
// services requires that each service is public or is shared with the
// user enabling the service. Two or more services must be specified. To
// enable a single service, use the `EnableService` method instead. A
// single request can enable a maximum of 20 services at a time. If more
// than 20 services are specified, the request will fail, and no state
// changes will occur.
ServiceIds []string `json:"serviceIds,omitempty"`
// ForceSendFields is a list of field names (e.g. "ServiceIds") to
// unconditionally include in API requests. By default, fields with
// empty or default 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. "ServiceIds") 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 *BatchEnableServicesRequest) MarshalJSON() ([]byte, error) {
type NoMethod BatchEnableServicesRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BatchEnableServicesResponse: Response message for the
// `BatchEnableServices` method. This response message is assigned to
// the `response` field of the returned Operation when that operation is
// done.
type BatchEnableServicesResponse struct {
// Failures: If allow_partial_success is true, and one or more services
// could not be enabled, this field contains the details about each
// failure.
Failures []*EnableFailure `json:"failures,omitempty"`
// Services: The new state of the services after enabling.
Services []*GoogleApiServiceusageV1Service `json:"services,omitempty"`
// ForceSendFields is a list of field names (e.g. "Failures") to
// unconditionally include in API requests. By default, fields with
// empty or default 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. "Failures") 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 *BatchEnableServicesResponse) MarshalJSON() ([]byte, error) {
type NoMethod BatchEnableServicesResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Billing: Billing related configuration of the service. The following
// example shows how to configure monitored resources and metrics for
// billing, `consumer_destinations` is the only supported destination
// and the monitored resources need at least one label key
// `cloud.googleapis.com/location` to indicate the location of the
// billing usage, using different monitored resources between monitoring
// and billing is recommended so they can be evolved independently:
// monitored_resources: - type: library.googleapis.com/billing_branch
// labels: - key: cloud.googleapis.com/location description: |
// Predefined label to support billing location restriction. - key: city
// description: | Custom label to define the city where the library
// branch is located in. - key: name description: Custom label to define
// the name of the library branch. metrics: - name:
// library.googleapis.com/book/borrowed_count metric_kind: DELTA
// value_type: INT64 unit: "1" billing: consumer_destinations: -
// monitored_resource: library.googleapis.com/billing_branch metrics: -
// library.googleapis.com/book/borrowed_count
type Billing struct {
// ConsumerDestinations: Billing configurations for sending metrics to
// the consumer project. There can be multiple consumer destinations per
// service, each one must have a different monitored resource type. A
// metric can be used in at most one consumer destination.
ConsumerDestinations []*BillingDestination `json:"consumerDestinations,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "ConsumerDestinations") to unconditionally include in API requests.
// By default, fields with empty or default 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. "ConsumerDestinations") 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 *Billing) MarshalJSON() ([]byte, error) {
type NoMethod Billing
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BillingDestination: Configuration of a specific billing destination
// (Currently only support bill against consumer project).
type BillingDestination struct {
// Metrics: Names of the metrics to report to this billing destination.
// Each name must be defined in Service.metrics section.
Metrics []string `json:"metrics,omitempty"`
// MonitoredResource: The monitored resource type. The type must be
// defined in Service.monitored_resources section.
MonitoredResource string `json:"monitoredResource,omitempty"`
// ForceSendFields is a list of field names (e.g. "Metrics") to
// unconditionally include in API requests. By default, fields with
// empty or default 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. "Metrics") 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 *BillingDestination) MarshalJSON() ([]byte, error) {
type NoMethod BillingDestination
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ConsumerQuotaLimit: Consumer quota settings for a quota limit.
type ConsumerQuotaLimit struct {
// AllowsAdminOverrides: Whether admin overrides are allowed on this
// limit
AllowsAdminOverrides bool `json:"allowsAdminOverrides,omitempty"`
// IsPrecise: Whether this limit is precise or imprecise.
IsPrecise bool `json:"isPrecise,omitempty"`
// Metric: The name of the parent metric of this limit. An example name
// would be: `compute.googleapis.com/cpus`
Metric string `json:"metric,omitempty"`
// Name: The resource name of the quota limit. An example name would be:
// `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/com
// pute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion` The resource
// name is intended to be opaque and should not be parsed for its
// component strings, since its representation could change in the
// future.
Name string `json:"name,omitempty"`
// QuotaBuckets: Summary of the enforced quota buckets, organized by
// quota dimension, ordered from least specific to most specific (for
// example, the global default bucket, with no quota dimensions, will
// always appear first).
QuotaBuckets []*QuotaBucket `json:"quotaBuckets,omitempty"`
// SupportedLocations: List of all supported locations. This field is
// present only if the limit has a {region} or {zone} dimension.
SupportedLocations []string `json:"supportedLocations,omitempty"`
// Unit: The limit unit. An example unit would be `1/{project}/{region}`
// Note that `{project}` and `{region}` are not placeholders in this
// example; the literal characters `{` and `}` occur in the string.
Unit string `json:"unit,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g.
// "AllowsAdminOverrides") to unconditionally include in API requests.
// By default, fields with empty or default 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. "AllowsAdminOverrides") 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 *ConsumerQuotaLimit) MarshalJSON() ([]byte, error) {
type NoMethod ConsumerQuotaLimit
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ConsumerQuotaMetric: Consumer quota settings for a quota metric.
type ConsumerQuotaMetric struct {
// ConsumerQuotaLimits: The consumer quota for each quota limit defined