-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathservicenetworking-gen.go
6003 lines (5475 loc) · 218 KB
/
servicenetworking-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 servicenetworking provides access to the Service Networking API.
//
// For product documentation, see: https://cloud.google.com/service-infrastructure/docs/service-networking/getting-started
//
// Creating a client
//
// Usage example:
//
// import "google.golang.org/api/servicenetworking/v1"
// ...
// ctx := context.Background()
// servicenetworkingService, err := servicenetworking.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:
//
// servicenetworkingService, err := servicenetworking.NewService(ctx, option.WithScopes(servicenetworking.ServiceManagementScope))
//
// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
//
// servicenetworkingService, err := servicenetworking.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, ...)
// servicenetworkingService, err := servicenetworking.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package servicenetworking // import "google.golang.org/api/servicenetworking/v1"
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"strings"
gensupport "google.golang.org/api/gensupport"
googleapi "google.golang.org/api/googleapi"
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 = "servicenetworking:v1"
const apiName = "servicenetworking"
const apiVersion = "v1"
const basePath = "https://servicenetworking.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 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 := option.WithScopes(
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/service.management",
)
// 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 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.Connections = NewServicesConnectionsService(s)
return rs
}
type ServicesService struct {
s *APIService
Connections *ServicesConnectionsService
}
func NewServicesConnectionsService(s *APIService) *ServicesConnectionsService {
rs := &ServicesConnectionsService{s: s}
return rs
}
type ServicesConnectionsService struct {
s *APIService
}
// AddSubnetworkRequest: Request to create a subnetwork in a previously
// peered service network.
type AddSubnetworkRequest struct {
// Consumer: Required. A resource that represents the service consumer,
// such as
// `projects/123456`. The project number can be different from the
// value in the consumer network parameter. For example, the network
// might be
// part of a Shared VPC network. In those cases, Service Networking
// validates
// that this resource belongs to that Shared VPC.
Consumer string `json:"consumer,omitempty"`
// ConsumerNetwork: Required. The name of the service consumer's VPC
// network. The network
// must have an existing private connection that was provisioned through
// the
// connections.create method. The name must be in the following
// format:
// `projects/{project}/global/networks/{network}`, where {project}
// is a project number, such as `12345`. {network} is the name of a
// VPC network in the project.
ConsumerNetwork string `json:"consumerNetwork,omitempty"`
// Description: An optional description of the subnet.
Description string `json:"description,omitempty"`
// IpPrefixLength: Required. The prefix length of the subnet's IP
// address range. Use CIDR
// range notation, such as `30` to provision a subnet with
// an
// `x.x.x.x/30` CIDR range. The IP address range is drawn from a
// pool of available ranges in the service consumer's allocated range.
IpPrefixLength int64 `json:"ipPrefixLength,omitempty"`
// Region: Required. The name of a
// [region](/compute/docs/regions-zones)
// for the subnet, such `europe-west1`.
Region string `json:"region,omitempty"`
// RequestedAddress: Optional. The starting address of a range. The
// address must be a valid
// IPv4 address in the x.x.x.x format. This value combined with the IP
// prefix
// range is the CIDR range for the subnet. The range must be within
// the
// allocated range that is assigned to the private connection. If the
// CIDR
// range isn't available, the call fails.
RequestedAddress string `json:"requestedAddress,omitempty"`
// Subnetwork: Required. A name for the new subnet. For information
// about the naming
// requirements, see
// [subnetwork](/compute/docs/reference/rest/v1/subnetworks)
// in the Compute API documentation.
Subnetwork string `json:"subnetwork,omitempty"`
// SubnetworkUsers: A list of members that are granted the
// `compute.networkUser`
// role on the subnet.
SubnetworkUsers []string `json:"subnetworkUsers,omitempty"`
// ForceSendFields is a list of field names (e.g. "Consumer") 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. "Consumer") 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 *AddSubnetworkRequest) MarshalJSON() ([]byte, error) {
type NoMethod AddSubnetworkRequest
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<major-version>`, 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 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-tok
// en-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, 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.librar
// y.v1.LibraryService".
//
// 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#sec
// tion-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-discove
// ry-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"`
// ForceSendFields is a list of field names (e.g. "Audiences") 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. "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-tok
// en-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.librar
// y.v1.LibraryService".
//
// 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 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 an API.
//
// Example for an API targeted for external use:
//
// 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
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 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.
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 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 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.
Address string `json:"address,omitempty"`
// Deadline: The number of seconds to wait for a response from a
// request. The default
// deadline for gRPC is infinite (no deadline) and HTTP requests is 5
// seconds.
Deadline float64 `json:"deadline,omitempty"`
// JwtAudience: The JWT audience is used when generating a JWT id token
// for the backend.
JwtAudience string `json:"jwtAudience,omitempty"`
// MinDeadline: Minimum deadline in seconds needed for this method.
// Calls having deadline
// value lower than this will be rejected.
MinDeadline float64 `json:"minDeadline,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"`
// 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 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"`
MinDeadline gensupport.JSONFloat64 `json:"minDeadline"`
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.MinDeadline = float64(s1.MinDeadline)
s.OperationDeadline = float64(s1.OperationDeadline)
return nil
}
// Billing: Billing related configuration of the service.
//
// The following example shows how to configure monitored resources and
// metrics
// for billing:
//
// monitored_resources:
// - type: library.googleapis.com/branch
// labels:
// - key: /city
// description: The city where the library branch is located
// in.
// - key: /name
// description: The name of the branch.
// metrics:
// - name: library.googleapis.com/book/borrowed_count
// metric_kind: DELTA
// value_type: INT64
// billing:
// consumer_destinations:
// - monitored_resource: library.googleapis.com/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 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 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)
}
// CancelOperationRequest: The request message for
// Operations.CancelOperation.
type CancelOperationRequest struct {
}
// Connection: Represents a private connection resource. A private
// connection is implemented
// as a VPC Network Peering connection between a service producer's VPC
// network
// and a service consumer's VPC network.
type Connection struct {
// Network: The name of service consumer's VPC network that's connected
// with service
// producer network, in the following
// format:
// `projects/{project}/global/networks/{network}`.
// `{project}` is a project number, such as in `12345` that includes
// the VPC service consumer's VPC network. `{network}` is the name of
// the
// service consumer's VPC network.
Network string `json:"network,omitempty"`
// Peering: Output only. The name of the VPC Network Peering connection
// that was created by the
// service producer.
Peering string `json:"peering,omitempty"`
// ReservedPeeringRanges: The name of one or more allocated IP address
// ranges for this service
// producer of type `PEERING`.
// Note that invoking CreateConnection method with a different range
// when
// connection is already established will not modify already
// provisioned
// service producer subnetworks.
// If CreateConnection method is invoked repeatedly to reconnect when
// peering
// connection had been disconnected on the consumer side, leaving this
// field
// empty will restore previously allocated IP ranges.
ReservedPeeringRanges []string `json:"reservedPeeringRanges,omitempty"`
// Service: Output only. The name of the peering service that's
// associated with this connection, in
// the following format: `services/{service name}`.
Service string `json:"service,omitempty"`
// ForceSendFields is a list of field names (e.g. "Network") 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. "Network") 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 *Connection) MarshalJSON() ([]byte, error) {
type NoMethod Connection
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Context: `Context` defines which contexts an API
// requests.
//
// Example:
//
// context:
// rules:
// - selector: "*"
// requested:
// - google.rpc.context.ProjectContext
// - google.rpc.context.OriginContext
//
// The above specifies that all methods in the API
// request
// `google.rpc.context.ProjectContext`
// and
// `google.rpc.context.OriginContext`.
//
// Available context types are defined in
// package
// `google.rpc.context`.
//
// This also provides mechanism to whitelist any protobuf message
// extension that
// can be sent in grpc metadata using
// “x-goog-ext-<extension_id>-bin”
// and
// “x-goog-ext-<extension_id>-jspb” format. For example, list any
// service
// specific protobuf types that can appear in grpc metadata as follows
// in your
// yaml file:
//
// Example:
//
// context:
// rules:
// - selector:
// "google.example.library.v1.LibraryService.CreateBook"
// allowed_request_extensions:
// - google.foo.v1.NewExtension
// allowed_response_extensions:
// - google.foo.v1.NewExtension
//
// You can also specify extension ID instead of fully qualified
// extension name
// here.
type Context struct {
// Rules: A list of RPC context rules that apply to individual API
// methods.
//
// **NOTE:** All service configuration rules follow "last one wins"
// order.
Rules []*ContextRule `json:"rules,omitempty"`