1// Copyright 2019 Google LLC. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5// Code generated file. DO NOT EDIT. 6 7// Package servicenetworking provides access to the Service Networking API. 8// 9// For product documentation, see: https://cloud.google.com/service-infrastructure/docs/service-networking/getting-started 10// 11// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/servicenetworking/v1beta" 16// ... 17// ctx := context.Background() 18// servicenetworkingService, err := servicenetworking.NewService(ctx) 19// 20// In this example, Google Application Default Credentials are used for authentication. 21// 22// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 23// 24// Other authentication options 25// 26// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes: 27// 28// servicenetworkingService, err := servicenetworking.NewService(ctx, option.WithScopes(servicenetworking.ServiceManagementScope)) 29// 30// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 31// 32// servicenetworkingService, err := servicenetworking.NewService(ctx, option.WithAPIKey("AIza...")) 33// 34// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 35// 36// config := &oauth2.Config{...} 37// // ... 38// token, err := config.Exchange(ctx, ...) 39// servicenetworkingService, err := servicenetworking.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 40// 41// See https://godoc.org/google.golang.org/api/option/ for details on options. 42package servicenetworking // import "google.golang.org/api/servicenetworking/v1beta" 43 44import ( 45 "bytes" 46 "context" 47 "encoding/json" 48 "errors" 49 "fmt" 50 "io" 51 "net/http" 52 "net/url" 53 "strconv" 54 "strings" 55 56 gensupport "google.golang.org/api/gensupport" 57 googleapi "google.golang.org/api/googleapi" 58 option "google.golang.org/api/option" 59 htransport "google.golang.org/api/transport/http" 60) 61 62// Always reference these packages, just in case the auto-generated code 63// below doesn't. 64var _ = bytes.NewBuffer 65var _ = strconv.Itoa 66var _ = fmt.Sprintf 67var _ = json.NewDecoder 68var _ = io.Copy 69var _ = url.Parse 70var _ = gensupport.MarshalJSON 71var _ = googleapi.Version 72var _ = errors.New 73var _ = strings.Replace 74var _ = context.Canceled 75 76const apiId = "servicenetworking:v1beta" 77const apiName = "servicenetworking" 78const apiVersion = "v1beta" 79const basePath = "https://servicenetworking.googleapis.com/" 80 81// OAuth2 scopes used by this API. 82const ( 83 // View and manage your data across Google Cloud Platform services 84 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 85 86 // Manage your Google API service configuration 87 ServiceManagementScope = "https://www.googleapis.com/auth/service.management" 88) 89 90// NewService creates a new APIService. 91func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, error) { 92 scopesOption := option.WithScopes( 93 "https://www.googleapis.com/auth/cloud-platform", 94 "https://www.googleapis.com/auth/service.management", 95 ) 96 // NOTE: prepend, so we don't override user-specified scopes. 97 opts = append([]option.ClientOption{scopesOption}, opts...) 98 client, endpoint, err := htransport.NewClient(ctx, opts...) 99 if err != nil { 100 return nil, err 101 } 102 s, err := New(client) 103 if err != nil { 104 return nil, err 105 } 106 if endpoint != "" { 107 s.BasePath = endpoint 108 } 109 return s, nil 110} 111 112// New creates a new APIService. It uses the provided http.Client for requests. 113// 114// Deprecated: please use NewService instead. 115// To provide a custom HTTP client, use option.WithHTTPClient. 116// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 117func New(client *http.Client) (*APIService, error) { 118 if client == nil { 119 return nil, errors.New("client is nil") 120 } 121 s := &APIService{client: client, BasePath: basePath} 122 s.Operations = NewOperationsService(s) 123 s.Services = NewServicesService(s) 124 return s, nil 125} 126 127type APIService struct { 128 client *http.Client 129 BasePath string // API endpoint base URL 130 UserAgent string // optional additional User-Agent fragment 131 132 Operations *OperationsService 133 134 Services *ServicesService 135} 136 137func (s *APIService) userAgent() string { 138 if s.UserAgent == "" { 139 return googleapi.UserAgent 140 } 141 return googleapi.UserAgent + " " + s.UserAgent 142} 143 144func NewOperationsService(s *APIService) *OperationsService { 145 rs := &OperationsService{s: s} 146 return rs 147} 148 149type OperationsService struct { 150 s *APIService 151} 152 153func NewServicesService(s *APIService) *ServicesService { 154 rs := &ServicesService{s: s} 155 rs.Connections = NewServicesConnectionsService(s) 156 return rs 157} 158 159type ServicesService struct { 160 s *APIService 161 162 Connections *ServicesConnectionsService 163} 164 165func NewServicesConnectionsService(s *APIService) *ServicesConnectionsService { 166 rs := &ServicesConnectionsService{s: s} 167 return rs 168} 169 170type ServicesConnectionsService struct { 171 s *APIService 172} 173 174// AddSubnetworkRequest: Request to create a subnetwork in a previously 175// peered service network. 176type AddSubnetworkRequest struct { 177 // Consumer: Required. A resource that represents the service consumer, 178 // such as 179 // `projects/123456`. The project number can be different from the 180 // value in the consumer network parameter. For example, the network 181 // might be 182 // part of a Shared VPC network. In those cases, Service Networking 183 // validates 184 // that this resource belongs to that Shared VPC. 185 Consumer string `json:"consumer,omitempty"` 186 187 // ConsumerNetwork: Required. The name of the service consumer's VPC 188 // network. The network 189 // must have an existing private connection that was provisioned through 190 // the 191 // connections.create method. The name must be in the following 192 // format: 193 // `projects/{project}/global/networks/{network}`, where {project} 194 // is a project number, such as `12345`. {network} is the name of a 195 // VPC network in the project. 196 ConsumerNetwork string `json:"consumerNetwork,omitempty"` 197 198 // Description: An optional description of the subnet. 199 Description string `json:"description,omitempty"` 200 201 // IpPrefixLength: Required. The prefix length of the subnet's IP 202 // address range. Use CIDR 203 // range notation, such as `30` to provision a subnet with 204 // an 205 // `x.x.x.x/30` CIDR range. The IP address range is drawn from a 206 // pool of available ranges in the service consumer's allocated range. 207 IpPrefixLength int64 `json:"ipPrefixLength,omitempty"` 208 209 // Region: Required. The name of a 210 // [region](/compute/docs/regions-zones) 211 // for the subnet, such `europe-west1`. 212 Region string `json:"region,omitempty"` 213 214 // RequestedAddress: Optional. The starting address of a range. The 215 // address must be a valid 216 // IPv4 address in the x.x.x.x format. This value combined with the IP 217 // prefix 218 // range is the CIDR range for the subnet. The range must be within 219 // the 220 // allocated range that is assigned to the private connection. If the 221 // CIDR 222 // range isn't available, the call fails. 223 RequestedAddress string `json:"requestedAddress,omitempty"` 224 225 // Subnetwork: Required. A name for the new subnet. For information 226 // about the naming 227 // requirements, see 228 // [subnetwork](/compute/docs/reference/rest/v1/subnetworks) 229 // in the Compute API documentation. 230 Subnetwork string `json:"subnetwork,omitempty"` 231 232 // SubnetworkUsers: A list of members that are granted the 233 // `compute.networkUser` 234 // role on the subnet. 235 SubnetworkUsers []string `json:"subnetworkUsers,omitempty"` 236 237 // ForceSendFields is a list of field names (e.g. "Consumer") to 238 // unconditionally include in API requests. By default, fields with 239 // empty values are omitted from API requests. However, any non-pointer, 240 // non-interface field appearing in ForceSendFields will be sent to the 241 // server regardless of whether the field is empty or not. This may be 242 // used to include empty fields in Patch requests. 243 ForceSendFields []string `json:"-"` 244 245 // NullFields is a list of field names (e.g. "Consumer") to include in 246 // API requests with the JSON null value. By default, fields with empty 247 // values are omitted from API requests. However, any field with an 248 // empty value appearing in NullFields will be sent to the server as 249 // null. It is an error if a field in this list has a non-empty value. 250 // This may be used to include null fields in Patch requests. 251 NullFields []string `json:"-"` 252} 253 254func (s *AddSubnetworkRequest) MarshalJSON() ([]byte, error) { 255 type NoMethod AddSubnetworkRequest 256 raw := NoMethod(*s) 257 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 258} 259 260// Api: Api is a light-weight descriptor for an API 261// Interface. 262// 263// Interfaces are also described as "protocol buffer services" in some 264// contexts, 265// such as by the "service" keyword in a .proto file, but they are 266// different 267// from API Services, which represent a concrete implementation of an 268// interface 269// as opposed to simply a description of methods and bindings. They are 270// also 271// sometimes simply referred to as "APIs" in other contexts, such as the 272// name of 273// this message itself. See 274// https://cloud.google.com/apis/design/glossary for 275// detailed terminology. 276type Api struct { 277 // Methods: The methods of this interface, in unspecified order. 278 Methods []*Method `json:"methods,omitempty"` 279 280 // Mixins: Included interfaces. See Mixin. 281 Mixins []*Mixin `json:"mixins,omitempty"` 282 283 // Name: The fully qualified name of this interface, including package 284 // name 285 // followed by the interface's simple name. 286 Name string `json:"name,omitempty"` 287 288 // Options: Any metadata attached to the interface. 289 Options []*Option `json:"options,omitempty"` 290 291 // SourceContext: Source context for the protocol buffer service 292 // represented by this 293 // message. 294 SourceContext *SourceContext `json:"sourceContext,omitempty"` 295 296 // Syntax: The source syntax of the service. 297 // 298 // Possible values: 299 // "SYNTAX_PROTO2" - Syntax `proto2`. 300 // "SYNTAX_PROTO3" - Syntax `proto3`. 301 Syntax string `json:"syntax,omitempty"` 302 303 // Version: A version string for this interface. If specified, must have 304 // the form 305 // `major-version.minor-version`, as in `1.10`. If the minor version 306 // is 307 // omitted, it defaults to zero. If the entire version field is empty, 308 // the 309 // major version is derived from the package name, as outlined below. If 310 // the 311 // field is not empty, the version in the package name will be verified 312 // to be 313 // consistent with what is provided here. 314 // 315 // The versioning schema uses [semantic 316 // versioning](http://semver.org) where the major version 317 // number 318 // indicates a breaking change and the minor version an 319 // additive, 320 // non-breaking change. Both version numbers are signals to users 321 // what to expect from different versions, and should be 322 // carefully 323 // chosen based on the product plan. 324 // 325 // The major version is also reflected in the package name of 326 // the 327 // interface, which must end in `v<major-version>`, as 328 // in 329 // `google.feature.v1`. For major versions 0 and 1, the suffix can 330 // be omitted. Zero major versions must only be used for 331 // experimental, non-GA interfaces. 332 // 333 Version string `json:"version,omitempty"` 334 335 // ForceSendFields is a list of field names (e.g. "Methods") to 336 // unconditionally include in API requests. By default, fields with 337 // empty values are omitted from API requests. However, any non-pointer, 338 // non-interface field appearing in ForceSendFields will be sent to the 339 // server regardless of whether the field is empty or not. This may be 340 // used to include empty fields in Patch requests. 341 ForceSendFields []string `json:"-"` 342 343 // NullFields is a list of field names (e.g. "Methods") to include in 344 // API requests with the JSON null value. By default, fields with empty 345 // values are omitted from API requests. However, any field with an 346 // empty value appearing in NullFields will be sent to the server as 347 // null. It is an error if a field in this list has a non-empty value. 348 // This may be used to include null fields in Patch requests. 349 NullFields []string `json:"-"` 350} 351 352func (s *Api) MarshalJSON() ([]byte, error) { 353 type NoMethod Api 354 raw := NoMethod(*s) 355 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 356} 357 358// AuthProvider: Configuration for an authentication provider, including 359// support for 360// [JSON Web 361// Token 362// (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-tok 363// en-32). 364type AuthProvider struct { 365 // Audiences: The list of 366 // JWT 367 // [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web- 368 // token-32#section-4.1.3). 369 // that are allowed to access. A JWT containing any of these audiences 370 // will 371 // be accepted. When this setting is absent, only JWTs with 372 // audience 373 // "https://Service_name/API_name" 374 // will be accepted. For example, if no audiences are in the 375 // setting, 376 // LibraryService API will only accept JWTs with the following 377 // audience 378 // "https://library-example.googleapis.com/google.example.librar 379 // y.v1.LibraryService". 380 // 381 // Example: 382 // 383 // audiences: bookstore_android.apps.googleusercontent.com, 384 // bookstore_web.apps.googleusercontent.com 385 Audiences string `json:"audiences,omitempty"` 386 387 // AuthorizationUrl: Redirect URL if JWT token is required but not 388 // present or is expired. 389 // Implement authorizationUrl of securityDefinitions in OpenAPI spec. 390 AuthorizationUrl string `json:"authorizationUrl,omitempty"` 391 392 // Id: The unique identifier of the auth provider. It will be referred 393 // to by 394 // `AuthRequirement.provider_id`. 395 // 396 // Example: "bookstore_auth". 397 Id string `json:"id,omitempty"` 398 399 // Issuer: Identifies the principal that issued the JWT. 400 // See 401 // https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#sec 402 // tion-4.1.1 403 // Usually a URL or an email address. 404 // 405 // Example: https://securetoken.google.com 406 // Example: 1234567-compute@developer.gserviceaccount.com 407 Issuer string `json:"issuer,omitempty"` 408 409 // JwksUri: URL of the provider's public key set to validate signature 410 // of the JWT. 411 // See 412 // [OpenID 413 // Discovery](https://openid.net/specs/openid-connect-discove 414 // ry-1_0.html#ProviderMetadata). 415 // Optional if the key set document: 416 // - can be retrieved from 417 // [OpenID 418 // 419 // Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html 420 // of 421 // the issuer. 422 // - can be inferred from the email domain of the issuer (e.g. a 423 // Google 424 // service account). 425 // 426 // Example: https://www.googleapis.com/oauth2/v1/certs 427 JwksUri string `json:"jwksUri,omitempty"` 428 429 // ForceSendFields is a list of field names (e.g. "Audiences") to 430 // unconditionally include in API requests. By default, fields with 431 // empty values are omitted from API requests. However, any non-pointer, 432 // non-interface field appearing in ForceSendFields will be sent to the 433 // server regardless of whether the field is empty or not. This may be 434 // used to include empty fields in Patch requests. 435 ForceSendFields []string `json:"-"` 436 437 // NullFields is a list of field names (e.g. "Audiences") to include in 438 // API requests with the JSON null value. By default, fields with empty 439 // values are omitted from API requests. However, any field with an 440 // empty value appearing in NullFields will be sent to the server as 441 // null. It is an error if a field in this list has a non-empty value. 442 // This may be used to include null fields in Patch requests. 443 NullFields []string `json:"-"` 444} 445 446func (s *AuthProvider) MarshalJSON() ([]byte, error) { 447 type NoMethod AuthProvider 448 raw := NoMethod(*s) 449 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 450} 451 452// AuthRequirement: User-defined authentication requirements, including 453// support for 454// [JSON Web 455// Token 456// (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-tok 457// en-32). 458type AuthRequirement struct { 459 // Audiences: NOTE: This will be deprecated soon, once 460 // AuthProvider.audiences is 461 // implemented and accepted in all the runtime components. 462 // 463 // The list of 464 // JWT 465 // [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web- 466 // token-32#section-4.1.3). 467 // that are allowed to access. A JWT containing any of these audiences 468 // will 469 // be accepted. When this setting is absent, only JWTs with 470 // audience 471 // "https://Service_name/API_name" 472 // will be accepted. For example, if no audiences are in the 473 // setting, 474 // LibraryService API will only accept JWTs with the following 475 // audience 476 // "https://library-example.googleapis.com/google.example.librar 477 // y.v1.LibraryService". 478 // 479 // Example: 480 // 481 // audiences: bookstore_android.apps.googleusercontent.com, 482 // bookstore_web.apps.googleusercontent.com 483 Audiences string `json:"audiences,omitempty"` 484 485 // ProviderId: id from authentication provider. 486 // 487 // Example: 488 // 489 // provider_id: bookstore_auth 490 ProviderId string `json:"providerId,omitempty"` 491 492 // ForceSendFields is a list of field names (e.g. "Audiences") to 493 // unconditionally include in API requests. By default, fields with 494 // empty values are omitted from API requests. However, any non-pointer, 495 // non-interface field appearing in ForceSendFields will be sent to the 496 // server regardless of whether the field is empty or not. This may be 497 // used to include empty fields in Patch requests. 498 ForceSendFields []string `json:"-"` 499 500 // NullFields is a list of field names (e.g. "Audiences") to include in 501 // API requests with the JSON null value. By default, fields with empty 502 // values are omitted from API requests. However, any field with an 503 // empty value appearing in NullFields will be sent to the server as 504 // null. It is an error if a field in this list has a non-empty value. 505 // This may be used to include null fields in Patch requests. 506 NullFields []string `json:"-"` 507} 508 509func (s *AuthRequirement) MarshalJSON() ([]byte, error) { 510 type NoMethod AuthRequirement 511 raw := NoMethod(*s) 512 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 513} 514 515// Authentication: `Authentication` defines the authentication 516// configuration for an API. 517// 518// Example for an API targeted for external use: 519// 520// name: calendar.googleapis.com 521// authentication: 522// providers: 523// - id: google_calendar_auth 524// jwks_uri: https://www.googleapis.com/oauth2/v1/certs 525// issuer: https://securetoken.google.com 526// rules: 527// - selector: "*" 528// requirements: 529// provider_id: google_calendar_auth 530type Authentication struct { 531 // Providers: Defines a set of authentication providers that a service 532 // supports. 533 Providers []*AuthProvider `json:"providers,omitempty"` 534 535 // Rules: A list of authentication rules that apply to individual API 536 // methods. 537 // 538 // **NOTE:** All service configuration rules follow "last one wins" 539 // order. 540 Rules []*AuthenticationRule `json:"rules,omitempty"` 541 542 // ForceSendFields is a list of field names (e.g. "Providers") to 543 // unconditionally include in API requests. By default, fields with 544 // empty values are omitted from API requests. However, any non-pointer, 545 // non-interface field appearing in ForceSendFields will be sent to the 546 // server regardless of whether the field is empty or not. This may be 547 // used to include empty fields in Patch requests. 548 ForceSendFields []string `json:"-"` 549 550 // NullFields is a list of field names (e.g. "Providers") to include in 551 // API requests with the JSON null value. By default, fields with empty 552 // values are omitted from API requests. However, any field with an 553 // empty value appearing in NullFields will be sent to the server as 554 // null. It is an error if a field in this list has a non-empty value. 555 // This may be used to include null fields in Patch requests. 556 NullFields []string `json:"-"` 557} 558 559func (s *Authentication) MarshalJSON() ([]byte, error) { 560 type NoMethod Authentication 561 raw := NoMethod(*s) 562 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 563} 564 565// AuthenticationRule: Authentication rules for the service. 566// 567// By default, if a method has any authentication requirements, every 568// request 569// must include a valid credential matching one of the 570// requirements. 571// It's an error to include more than one kind of credential in a 572// single 573// request. 574// 575// If a method doesn't have any auth requirements, request credentials 576// will be 577// ignored. 578type AuthenticationRule struct { 579 // AllowWithoutCredential: If true, the service accepts API keys without 580 // any other credential. 581 AllowWithoutCredential bool `json:"allowWithoutCredential,omitempty"` 582 583 // Oauth: The requirements for OAuth credentials. 584 Oauth *OAuthRequirements `json:"oauth,omitempty"` 585 586 // Requirements: Requirements for additional authentication providers. 587 Requirements []*AuthRequirement `json:"requirements,omitempty"` 588 589 // Selector: Selects the methods to which this rule applies. 590 // 591 // Refer to selector for syntax details. 592 Selector string `json:"selector,omitempty"` 593 594 // ForceSendFields is a list of field names (e.g. 595 // "AllowWithoutCredential") to unconditionally include in API requests. 596 // By default, fields with empty values are omitted from API requests. 597 // However, any non-pointer, non-interface field appearing in 598 // ForceSendFields will be sent to the server regardless of whether the 599 // field is empty or not. This may be used to include empty fields in 600 // Patch requests. 601 ForceSendFields []string `json:"-"` 602 603 // NullFields is a list of field names (e.g. "AllowWithoutCredential") 604 // to include in API requests with the JSON null value. By default, 605 // fields with empty values are omitted from API requests. However, any 606 // field with an empty value appearing in NullFields will be sent to the 607 // server as null. It is an error if a field in this list has a 608 // non-empty value. This may be used to include null fields in Patch 609 // requests. 610 NullFields []string `json:"-"` 611} 612 613func (s *AuthenticationRule) MarshalJSON() ([]byte, error) { 614 type NoMethod AuthenticationRule 615 raw := NoMethod(*s) 616 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 617} 618 619// Backend: `Backend` defines the backend configuration for a service. 620type Backend struct { 621 // Rules: A list of API backend rules that apply to individual API 622 // methods. 623 // 624 // **NOTE:** All service configuration rules follow "last one wins" 625 // order. 626 Rules []*BackendRule `json:"rules,omitempty"` 627 628 // ForceSendFields is a list of field names (e.g. "Rules") to 629 // unconditionally include in API requests. By default, fields with 630 // empty values are omitted from API requests. However, any non-pointer, 631 // non-interface field appearing in ForceSendFields will be sent to the 632 // server regardless of whether the field is empty or not. This may be 633 // used to include empty fields in Patch requests. 634 ForceSendFields []string `json:"-"` 635 636 // NullFields is a list of field names (e.g. "Rules") to include in API 637 // requests with the JSON null value. By default, fields with empty 638 // values are omitted from API requests. However, any field with an 639 // empty value appearing in NullFields will be sent to the server as 640 // null. It is an error if a field in this list has a non-empty value. 641 // This may be used to include null fields in Patch requests. 642 NullFields []string `json:"-"` 643} 644 645func (s *Backend) MarshalJSON() ([]byte, error) { 646 type NoMethod Backend 647 raw := NoMethod(*s) 648 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 649} 650 651// BackendRule: A backend rule provides configuration for an individual 652// API element. 653type BackendRule struct { 654 // Address: The address of the API backend. 655 Address string `json:"address,omitempty"` 656 657 // Deadline: The number of seconds to wait for a response from a 658 // request. The default 659 // deadline for gRPC is infinite (no deadline) and HTTP requests is 5 660 // seconds. 661 Deadline float64 `json:"deadline,omitempty"` 662 663 // JwtAudience: The JWT audience is used when generating a JWT id token 664 // for the backend. 665 JwtAudience string `json:"jwtAudience,omitempty"` 666 667 // MinDeadline: Minimum deadline in seconds needed for this method. 668 // Calls having deadline 669 // value lower than this will be rejected. 670 MinDeadline float64 `json:"minDeadline,omitempty"` 671 672 // OperationDeadline: The number of seconds to wait for the completion 673 // of a long running 674 // operation. The default is no deadline. 675 OperationDeadline float64 `json:"operationDeadline,omitempty"` 676 677 // Possible values: 678 // "PATH_TRANSLATION_UNSPECIFIED" 679 // "CONSTANT_ADDRESS" - Use the backend address as-is, with no 680 // modification to the path. If the 681 // URL pattern contains variables, the variable names and values will 682 // be 683 // appended to the query string. If a query string parameter and a 684 // URL 685 // pattern variable have the same name, this may result in duplicate 686 // keys in 687 // the query string. 688 // 689 // # Examples 690 // 691 // Given the following operation config: 692 // 693 // Method path: /api/company/{cid}/user/{uid} 694 // Backend address: 695 // https://example.cloudfunctions.net/getUser 696 // 697 // Requests to the following request paths will call the backend at 698 // the 699 // translated path: 700 // 701 // Request path: /api/company/widgetworks/user/johndoe 702 // Translated: 703 // 704 // https://example.cloudfunctions.net/getUser?cid=widgetworks&uid=johndoe 705 // 706 // Request path: /api/company/widgetworks/user/johndoe?timezone=EST 707 // Translated: 708 // 709 // https://example.cloudfunctions.net/getUser?timezone=EST&cid=widgetworks&uid=johndoe 710 // "APPEND_PATH_TO_ADDRESS" - The request path will be appended to the 711 // backend address. 712 // 713 // # Examples 714 // 715 // Given the following operation config: 716 // 717 // Method path: /api/company/{cid}/user/{uid} 718 // Backend address: https://example.appspot.com 719 // 720 // Requests to the following request paths will call the backend at 721 // the 722 // translated path: 723 // 724 // Request path: /api/company/widgetworks/user/johndoe 725 // Translated: 726 // 727 // https://example.appspot.com/api/company/widgetworks/user/johndoe 728 // 729 // Request path: /api/company/widgetworks/user/johndoe?timezone=EST 730 // Translated: 731 // 732 // https://example.appspot.com/api/company/widgetworks/user/johndoe?timezone=EST 733 PathTranslation string `json:"pathTranslation,omitempty"` 734 735 // Selector: Selects the methods to which this rule applies. 736 // 737 // Refer to selector for syntax details. 738 Selector string `json:"selector,omitempty"` 739 740 // ForceSendFields is a list of field names (e.g. "Address") to 741 // unconditionally include in API requests. By default, fields with 742 // empty values are omitted from API requests. However, any non-pointer, 743 // non-interface field appearing in ForceSendFields will be sent to the 744 // server regardless of whether the field is empty or not. This may be 745 // used to include empty fields in Patch requests. 746 ForceSendFields []string `json:"-"` 747 748 // NullFields is a list of field names (e.g. "Address") to include in 749 // API requests with the JSON null value. By default, fields with empty 750 // values are omitted from API requests. However, any field with an 751 // empty value appearing in NullFields will be sent to the server as 752 // null. It is an error if a field in this list has a non-empty value. 753 // This may be used to include null fields in Patch requests. 754 NullFields []string `json:"-"` 755} 756 757func (s *BackendRule) MarshalJSON() ([]byte, error) { 758 type NoMethod BackendRule 759 raw := NoMethod(*s) 760 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 761} 762 763func (s *BackendRule) UnmarshalJSON(data []byte) error { 764 type NoMethod BackendRule 765 var s1 struct { 766 Deadline gensupport.JSONFloat64 `json:"deadline"` 767 MinDeadline gensupport.JSONFloat64 `json:"minDeadline"` 768 OperationDeadline gensupport.JSONFloat64 `json:"operationDeadline"` 769 *NoMethod 770 } 771 s1.NoMethod = (*NoMethod)(s) 772 if err := json.Unmarshal(data, &s1); err != nil { 773 return err 774 } 775 s.Deadline = float64(s1.Deadline) 776 s.MinDeadline = float64(s1.MinDeadline) 777 s.OperationDeadline = float64(s1.OperationDeadline) 778 return nil 779} 780 781// Billing: Billing related configuration of the service. 782// 783// The following example shows how to configure monitored resources and 784// metrics 785// for billing: 786// 787// monitored_resources: 788// - type: library.googleapis.com/branch 789// labels: 790// - key: /city 791// description: The city where the library branch is located 792// in. 793// - key: /name 794// description: The name of the branch. 795// metrics: 796// - name: library.googleapis.com/book/borrowed_count 797// metric_kind: DELTA 798// value_type: INT64 799// billing: 800// consumer_destinations: 801// - monitored_resource: library.googleapis.com/branch 802// metrics: 803// - library.googleapis.com/book/borrowed_count 804type Billing struct { 805 // ConsumerDestinations: Billing configurations for sending metrics to 806 // the consumer project. 807 // There can be multiple consumer destinations per service, each one 808 // must have 809 // a different monitored resource type. A metric can be used in at 810 // most 811 // one consumer destination. 812 ConsumerDestinations []*BillingDestination `json:"consumerDestinations,omitempty"` 813 814 // ForceSendFields is a list of field names (e.g. 815 // "ConsumerDestinations") to unconditionally include in API requests. 816 // By default, fields with empty values are omitted from API requests. 817 // However, any non-pointer, non-interface field appearing in 818 // ForceSendFields will be sent to the server regardless of whether the 819 // field is empty or not. This may be used to include empty fields in 820 // Patch requests. 821 ForceSendFields []string `json:"-"` 822 823 // NullFields is a list of field names (e.g. "ConsumerDestinations") to 824 // include in API requests with the JSON null value. By default, fields 825 // with empty values are omitted from API requests. However, any field 826 // with an empty value appearing in NullFields will be sent to the 827 // server as null. It is an error if a field in this list has a 828 // non-empty value. This may be used to include null fields in Patch 829 // requests. 830 NullFields []string `json:"-"` 831} 832 833func (s *Billing) MarshalJSON() ([]byte, error) { 834 type NoMethod Billing 835 raw := NoMethod(*s) 836 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 837} 838 839// BillingDestination: Configuration of a specific billing destination 840// (Currently only support 841// bill against consumer project). 842type BillingDestination struct { 843 // Metrics: Names of the metrics to report to this billing 844 // destination. 845 // Each name must be defined in Service.metrics section. 846 Metrics []string `json:"metrics,omitempty"` 847 848 // MonitoredResource: The monitored resource type. The type must be 849 // defined in 850 // Service.monitored_resources section. 851 MonitoredResource string `json:"monitoredResource,omitempty"` 852 853 // ForceSendFields is a list of field names (e.g. "Metrics") to 854 // unconditionally include in API requests. By default, fields with 855 // empty values are omitted from API requests. However, any non-pointer, 856 // non-interface field appearing in ForceSendFields will be sent to the 857 // server regardless of whether the field is empty or not. This may be 858 // used to include empty fields in Patch requests. 859 ForceSendFields []string `json:"-"` 860 861 // NullFields is a list of field names (e.g. "Metrics") to include in 862 // API requests with the JSON null value. By default, fields with empty 863 // values are omitted from API requests. However, any field with an 864 // empty value appearing in NullFields will be sent to the server as 865 // null. It is an error if a field in this list has a non-empty value. 866 // This may be used to include null fields in Patch requests. 867 NullFields []string `json:"-"` 868} 869 870func (s *BillingDestination) MarshalJSON() ([]byte, error) { 871 type NoMethod BillingDestination 872 raw := NoMethod(*s) 873 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 874} 875 876// Connection: Represents a private connection resource. A private 877// connection is implemented 878// as a VPC Network Peering connection between a service producer's VPC 879// network 880// and a service consumer's VPC network. 881type Connection struct { 882 // Network: The name of service consumer's VPC network that's connected 883 // with service 884 // producer network, in the following 885 // format: 886 // `projects/{project}/global/networks/{network}`. 887 // `{project}` is a project number, such as in `12345` that includes 888 // the VPC service consumer's VPC network. `{network}` is the name of 889 // the 890 // service consumer's VPC network. 891 Network string `json:"network,omitempty"` 892 893 // Peering: Output only. 894 // The name of the VPC Network Peering connection that was created by 895 // the 896 // service producer. 897 Peering string `json:"peering,omitempty"` 898 899 // ReservedPeeringRanges: The name of one or more allocated IP address 900 // ranges for this service 901 // producer of type `PEERING`. 902 // Note that invoking this method with a different range when connection 903 // is 904 // already established will not modify already provisioned 905 // service 906 // producer subnetworks. 907 ReservedPeeringRanges []string `json:"reservedPeeringRanges,omitempty"` 908 909 // Service: Output only. 910 // The name of the peering service that's associated with this 911 // connection, in 912 // the following format: `services/{service name}`. 913 Service string `json:"service,omitempty"` 914 915 // ForceSendFields is a list of field names (e.g. "Network") to 916 // unconditionally include in API requests. By default, fields with 917 // empty values are omitted from API requests. However, any non-pointer, 918 // non-interface field appearing in ForceSendFields will be sent to the 919 // server regardless of whether the field is empty or not. This may be 920 // used to include empty fields in Patch requests. 921 ForceSendFields []string `json:"-"` 922 923 // NullFields is a list of field names (e.g. "Network") to include in 924 // API requests with the JSON null value. By default, fields with empty 925 // values are omitted from API requests. However, any field with an 926 // empty value appearing in NullFields will be sent to the server as 927 // null. It is an error if a field in this list has a non-empty value. 928 // This may be used to include null fields in Patch requests. 929 NullFields []string `json:"-"` 930} 931 932func (s *Connection) MarshalJSON() ([]byte, error) { 933 type NoMethod Connection 934 raw := NoMethod(*s) 935 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 936} 937 938// Context: `Context` defines which contexts an API 939// requests. 940// 941// Example: 942// 943// context: 944// rules: 945// - selector: "*" 946// requested: 947// - google.rpc.context.ProjectContext 948// - google.rpc.context.OriginContext 949// 950// The above specifies that all methods in the API 951// request 952// `google.rpc.context.ProjectContext` 953// and 954// `google.rpc.context.OriginContext`. 955// 956// Available context types are defined in 957// package 958// `google.rpc.context`. 959// 960// This also provides mechanism to whitelist any protobuf message 961// extension that 962// can be sent in grpc metadata using 963// “x-goog-ext-<extension_id>-bin” 964// and 965// “x-goog-ext-<extension_id>-jspb” format. For example, list any 966// service 967// specific protobuf types that can appear in grpc metadata as follows 968// in your 969// yaml file: 970// 971// Example: 972// 973// context: 974// rules: 975// - selector: 976// "google.example.library.v1.LibraryService.CreateBook" 977// allowed_request_extensions: 978// - google.foo.v1.NewExtension 979// allowed_response_extensions: 980// - google.foo.v1.NewExtension 981// 982// You can also specify extension ID instead of fully qualified 983// extension name 984// here. 985type Context struct { 986 // Rules: A list of RPC context rules that apply to individual API 987 // methods. 988 // 989 // **NOTE:** All service configuration rules follow "last one wins" 990 // order. 991 Rules []*ContextRule `json:"rules,omitempty"` 992 993 // ForceSendFields is a list of field names (e.g. "Rules") to 994 // unconditionally include in API requests. By default, fields with 995 // empty values are omitted from API requests. However, any non-pointer, 996 // non-interface field appearing in ForceSendFields will be sent to the 997 // server regardless of whether the field is empty or not. This may be 998 // used to include empty fields in Patch requests. 999 ForceSendFields []string `json:"-"` 1000 1001 // NullFields is a list of field names (e.g. "Rules") to include in API 1002 // requests with the JSON null value. By default, fields with empty 1003 // values are omitted from API requests. However, any field with an 1004 // empty value appearing in NullFields will be sent to the server as 1005 // null. It is an error if a field in this list has a non-empty value. 1006 // This may be used to include null fields in Patch requests. 1007 NullFields []string `json:"-"` 1008} 1009 1010func (s *Context) MarshalJSON() ([]byte, error) { 1011 type NoMethod Context 1012 raw := NoMethod(*s) 1013 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1014} 1015 1016// ContextRule: A context rule provides information about the context 1017// for an individual API 1018// element. 1019type ContextRule struct { 1020 // AllowedRequestExtensions: A list of full type names or extension IDs 1021 // of extensions allowed in grpc 1022 // side channel from client to backend. 1023 AllowedRequestExtensions []string `json:"allowedRequestExtensions,omitempty"` 1024 1025 // AllowedResponseExtensions: A list of full type names or extension IDs 1026 // of extensions allowed in grpc 1027 // side channel from backend to client. 1028 AllowedResponseExtensions []string `json:"allowedResponseExtensions,omitempty"` 1029 1030 // Provided: A list of full type names of provided contexts. 1031 Provided []string `json:"provided,omitempty"` 1032 1033 // Requested: A list of full type names of requested contexts. 1034 Requested []string `json:"requested,omitempty"` 1035 1036 // Selector: Selects the methods to which this rule applies. 1037 // 1038 // Refer to selector for syntax details. 1039 Selector string `json:"selector,omitempty"` 1040 1041 // ForceSendFields is a list of field names (e.g. 1042 // "AllowedRequestExtensions") to unconditionally include in API 1043 // requests. By default, fields with empty values are omitted from API 1044 // requests. However, any non-pointer, non-interface field appearing in 1045 // ForceSendFields will be sent to the server regardless of whether the 1046 // field is empty or not. This may be used to include empty fields in 1047 // Patch requests. 1048 ForceSendFields []string `json:"-"` 1049 1050 // NullFields is a list of field names (e.g. "AllowedRequestExtensions") 1051 // to include in API requests with the JSON null value. By default, 1052 // fields with empty values are omitted from API requests. However, any 1053 // field with an empty value appearing in NullFields will be sent to the 1054 // server as null. It is an error if a field in this list has a 1055 // non-empty value. This may be used to include null fields in Patch 1056 // requests. 1057 NullFields []string `json:"-"` 1058} 1059 1060func (s *ContextRule) MarshalJSON() ([]byte, error) { 1061 type NoMethod ContextRule 1062 raw := NoMethod(*s) 1063 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1064} 1065 1066// Control: Selects and configures the service controller used by the 1067// service. The 1068// service controller handles features like abuse, quota, billing, 1069// logging, 1070// monitoring, etc. 1071type Control struct { 1072 // Environment: The service control environment to use. If empty, no 1073 // control plane 1074 // feature (like quota and billing) will be enabled. 1075 Environment string `json:"environment,omitempty"` 1076 1077 // ForceSendFields is a list of field names (e.g. "Environment") to 1078 // unconditionally include in API requests. By default, fields with 1079 // empty values are omitted from API requests. However, any non-pointer, 1080 // non-interface field appearing in ForceSendFields will be sent to the 1081 // server regardless of whether the field is empty or not. This may be 1082 // used to include empty fields in Patch requests. 1083 ForceSendFields []string `json:"-"` 1084 1085 // NullFields is a list of field names (e.g. "Environment") to include 1086 // in API requests with the JSON null value. By default, fields with 1087 // empty values are omitted from API requests. However, any field with 1088 // an empty value appearing in NullFields will be sent to the server as 1089 // null. It is an error if a field in this list has a non-empty value. 1090 // This may be used to include null fields in Patch requests. 1091 NullFields []string `json:"-"` 1092} 1093 1094func (s *Control) MarshalJSON() ([]byte, error) { 1095 type NoMethod Control 1096 raw := NoMethod(*s) 1097 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1098} 1099 1100// CustomError: Customize service error responses. For example, list 1101// any service 1102// specific protobuf types that can appear in error detail lists 1103// of 1104// error responses. 1105// 1106// Example: 1107// 1108// custom_error: 1109// types: 1110// - google.foo.v1.CustomError 1111// - google.foo.v1.AnotherError 1112type CustomError struct { 1113 // Rules: The list of custom error rules that apply to individual API 1114 // messages. 1115 // 1116 // **NOTE:** All service configuration rules follow "last one wins" 1117 // order. 1118 Rules []*CustomErrorRule `json:"rules,omitempty"` 1119 1120 // Types: The list of custom error detail types, e.g. 1121 // 'google.foo.v1.CustomError'. 1122 Types []string `json:"types,omitempty"` 1123 1124 // ForceSendFields is a list of field names (e.g. "Rules") to 1125 // unconditionally include in API requests. By default, fields with 1126 // empty values are omitted from API requests. However, any non-pointer, 1127 // non-interface field appearing in ForceSendFields will be sent to the 1128 // server regardless of whether the field is empty or not. This may be 1129 // used to include empty fields in Patch requests. 1130 ForceSendFields []string `json:"-"` 1131 1132 // NullFields is a list of field names (e.g. "Rules") to include in API 1133 // requests with the JSON null value. By default, fields with empty 1134 // values are omitted from API requests. However, any field with an 1135 // empty value appearing in NullFields will be sent to the server as 1136 // null. It is an error if a field in this list has a non-empty value. 1137 // This may be used to include null fields in Patch requests. 1138 NullFields []string `json:"-"` 1139} 1140 1141func (s *CustomError) MarshalJSON() ([]byte, error) { 1142 type NoMethod CustomError 1143 raw := NoMethod(*s) 1144 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1145} 1146 1147// CustomErrorRule: A custom error rule. 1148type CustomErrorRule struct { 1149 // IsErrorType: Mark this message as possible payload in error response. 1150 // Otherwise, 1151 // objects of this type will be filtered when they appear in error 1152 // payload. 1153 IsErrorType bool `json:"isErrorType,omitempty"` 1154 1155 // Selector: Selects messages to which this rule applies. 1156 // 1157 // Refer to selector for syntax details. 1158 Selector string `json:"selector,omitempty"` 1159 1160 // ForceSendFields is a list of field names (e.g. "IsErrorType") to 1161 // unconditionally include in API requests. By default, fields with 1162 // empty values are omitted from API requests. However, any non-pointer, 1163 // non-interface field appearing in ForceSendFields will be sent to the 1164 // server regardless of whether the field is empty or not. This may be 1165 // used to include empty fields in Patch requests. 1166 ForceSendFields []string `json:"-"` 1167 1168 // NullFields is a list of field names (e.g. "IsErrorType") to include 1169 // in API requests with the JSON null value. By default, fields with 1170 // empty values are omitted from API requests. However, any field with 1171 // an empty value appearing in NullFields will be sent to the server as 1172 // null. It is an error if a field in this list has a non-empty value. 1173 // This may be used to include null fields in Patch requests. 1174 NullFields []string `json:"-"` 1175} 1176 1177func (s *CustomErrorRule) MarshalJSON() ([]byte, error) { 1178 type NoMethod CustomErrorRule 1179 raw := NoMethod(*s) 1180 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1181} 1182 1183// CustomHttpPattern: A custom pattern is used for defining custom HTTP 1184// verb. 1185type CustomHttpPattern struct { 1186 // Kind: The name of this custom HTTP verb. 1187 Kind string `json:"kind,omitempty"` 1188 1189 // Path: The path matched by this custom verb. 1190 Path string `json:"path,omitempty"` 1191 1192 // ForceSendFields is a list of field names (e.g. "Kind") to 1193 // unconditionally include in API requests. By default, fields with 1194 // empty values are omitted from API requests. However, any non-pointer, 1195 // non-interface field appearing in ForceSendFields will be sent to the 1196 // server regardless of whether the field is empty or not. This may be 1197 // used to include empty fields in Patch requests. 1198 ForceSendFields []string `json:"-"` 1199 1200 // NullFields is a list of field names (e.g. "Kind") to include in API 1201 // requests with the JSON null value. By default, fields with empty 1202 // values are omitted from API requests. However, any field with an 1203 // empty value appearing in NullFields will be sent to the server as 1204 // null. It is an error if a field in this list has a non-empty value. 1205 // This may be used to include null fields in Patch requests. 1206 NullFields []string `json:"-"` 1207} 1208 1209func (s *CustomHttpPattern) MarshalJSON() ([]byte, error) { 1210 type NoMethod CustomHttpPattern 1211 raw := NoMethod(*s) 1212 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1213} 1214 1215// Documentation: `Documentation` provides the information for 1216// describing a service. 1217// 1218// Example: 1219// <pre><code>documentation: 1220// summary: > 1221// The Google Calendar API gives access 1222// to most calendar features. 1223// pages: 1224// - name: Overview 1225// content: (== include google/foo/overview.md ==) 1226// - name: Tutorial 1227// content: (== include google/foo/tutorial.md ==) 1228// subpages; 1229// - name: Java 1230// content: (== include google/foo/tutorial_java.md ==) 1231// rules: 1232// - selector: google.calendar.Calendar.Get 1233// description: > 1234// ... 1235// - selector: google.calendar.Calendar.Put 1236// description: > 1237// ... 1238// </code></pre> 1239// Documentation is provided in markdown syntax. In addition to 1240// standard markdown features, definition lists, tables and fenced 1241// code blocks are supported. Section headers can be provided and 1242// are 1243// interpreted relative to the section nesting of the context where 1244// a documentation fragment is embedded. 1245// 1246// Documentation from the IDL is merged with documentation defined 1247// via the config at normalization time, where documentation provided 1248// by config rules overrides IDL provided. 1249// 1250// A number of constructs specific to the API platform are supported 1251// in documentation text. 1252// 1253// In order to reference a proto element, the following 1254// notation can be 1255// used: 1256// <pre><code>[fully.qualified.proto.name][]</code></pre> 1257// T 1258// o override the display text used for the link, this can be 1259// used: 1260// <pre><code>[display 1261// text][fully.qualified.proto.name]</code></pre> 1262// Text can be excluded from doc using the following 1263// notation: 1264// <pre><code>(-- internal comment --)</code></pre> 1265// 1266// A few directives are available in documentation. Note that 1267// directives must appear on a single line to be properly 1268// identified. The `include` directive includes a markdown file from 1269// an external source: 1270// <pre><code>(== include path/to/file ==)</code></pre> 1271// The `resource_for` directive marks a message to be the resource of 1272// a collection in REST view. If it is not specified, tools attempt 1273// to infer the resource from the operations in a 1274// collection: 1275// <pre><code>(== resource_for v1.shelves.books 1276// ==)</code></pre> 1277// The directive `suppress_warning` does not directly affect 1278// documentation 1279// and is documented together with service config validation. 1280type Documentation struct { 1281 // DocumentationRootUrl: The URL to the root of documentation. 1282 DocumentationRootUrl string `json:"documentationRootUrl,omitempty"` 1283 1284 // Overview: Declares a single overview page. For 1285 // example: 1286 // <pre><code>documentation: 1287 // summary: ... 1288 // overview: (== include overview.md ==) 1289 // </code></pre> 1290 // This is a shortcut for the following declaration (using pages 1291 // style): 1292 // <pre><code>documentation: 1293 // summary: ... 1294 // pages: 1295 // - name: Overview 1296 // content: (== include overview.md ==) 1297 // </code></pre> 1298 // Note: you cannot specify both `overview` field and `pages` field. 1299 Overview string `json:"overview,omitempty"` 1300 1301 // Pages: The top level pages for the documentation set. 1302 Pages []*Page `json:"pages,omitempty"` 1303 1304 // Rules: A list of documentation rules that apply to individual API 1305 // elements. 1306 // 1307 // **NOTE:** All service configuration rules follow "last one wins" 1308 // order. 1309 Rules []*DocumentationRule `json:"rules,omitempty"` 1310 1311 // Summary: A short summary of what the service does. Can only be 1312 // provided by 1313 // plain text. 1314 Summary string `json:"summary,omitempty"` 1315 1316 // ForceSendFields is a list of field names (e.g. 1317 // "DocumentationRootUrl") to unconditionally include in API requests. 1318 // By default, fields with empty values are omitted from API requests. 1319 // However, any non-pointer, non-interface field appearing in 1320 // ForceSendFields will be sent to the server regardless of whether the 1321 // field is empty or not. This may be used to include empty fields in 1322 // Patch requests. 1323 ForceSendFields []string `json:"-"` 1324 1325 // NullFields is a list of field names (e.g. "DocumentationRootUrl") to 1326 // include in API requests with the JSON null value. By default, fields 1327 // with empty values are omitted from API requests. However, any field 1328 // with an empty value appearing in NullFields will be sent to the 1329 // server as null. It is an error if a field in this list has a 1330 // non-empty value. This may be used to include null fields in Patch 1331 // requests. 1332 NullFields []string `json:"-"` 1333} 1334 1335func (s *Documentation) MarshalJSON() ([]byte, error) { 1336 type NoMethod Documentation 1337 raw := NoMethod(*s) 1338 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1339} 1340 1341// DocumentationRule: A documentation rule provides information about 1342// individual API elements. 1343type DocumentationRule struct { 1344 // DeprecationDescription: Deprecation description of the selected 1345 // element(s). It can be provided if 1346 // an element is marked as `deprecated`. 1347 DeprecationDescription string `json:"deprecationDescription,omitempty"` 1348 1349 // Description: Description of the selected API(s). 1350 Description string `json:"description,omitempty"` 1351 1352 // Selector: The selector is a comma-separated list of patterns. Each 1353 // pattern is a 1354 // qualified name of the element which may end in "*", indicating a 1355 // wildcard. 1356 // Wildcards are only allowed at the end and for a whole component of 1357 // the 1358 // qualified name, i.e. "foo.*" is ok, but not "foo.b*" or "foo.*.bar". 1359 // A 1360 // wildcard will match one or more components. To specify a default for 1361 // all 1362 // applicable elements, the whole pattern "*" is used. 1363 Selector string `json:"selector,omitempty"` 1364 1365 // ForceSendFields is a list of field names (e.g. 1366 // "DeprecationDescription") to unconditionally include in API requests. 1367 // By default, fields with empty values are omitted from API requests. 1368 // However, any non-pointer, non-interface field appearing in 1369 // ForceSendFields will be sent to the server regardless of whether the 1370 // field is empty or not. This may be used to include empty fields in 1371 // Patch requests. 1372 ForceSendFields []string `json:"-"` 1373 1374 // NullFields is a list of field names (e.g. "DeprecationDescription") 1375 // to include in API requests with the JSON null value. By default, 1376 // fields with empty values are omitted from API requests. However, any 1377 // field with an empty value appearing in NullFields will be sent to the 1378 // server as null. It is an error if a field in this list has a 1379 // non-empty value. This may be used to include null fields in Patch 1380 // requests. 1381 NullFields []string `json:"-"` 1382} 1383 1384func (s *DocumentationRule) MarshalJSON() ([]byte, error) { 1385 type NoMethod DocumentationRule 1386 raw := NoMethod(*s) 1387 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1388} 1389 1390// Endpoint: `Endpoint` describes a network endpoint that serves a set 1391// of APIs. 1392// A service may expose any number of endpoints, and all endpoints share 1393// the 1394// same service configuration, such as quota configuration and 1395// monitoring 1396// configuration. 1397// 1398// Example service configuration: 1399// 1400// name: library-example.googleapis.com 1401// endpoints: 1402// # Below entry makes 'google.example.library.v1.Library' 1403// # API be served from endpoint address 1404// library-example.googleapis.com. 1405// # It also allows HTTP OPTIONS calls to be passed to the 1406// backend, for 1407// # it to decide whether the subsequent cross-origin request is 1408// # allowed to proceed. 1409// - name: library-example.googleapis.com 1410// allow_cors: true 1411type Endpoint struct { 1412 // Aliases: DEPRECATED: This field is no longer supported. Instead of 1413 // using aliases, 1414 // please specify multiple google.api.Endpoint for each of the 1415 // intended 1416 // aliases. 1417 // 1418 // Additional names that this endpoint will be hosted on. 1419 Aliases []string `json:"aliases,omitempty"` 1420 1421 // AllowCors: 1422 // Allowing 1423 // [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sh 1424 // aring), aka 1425 // cross-domain traffic, would allow the backends served from this 1426 // endpoint to 1427 // receive and respond to HTTP OPTIONS requests. The response will be 1428 // used by 1429 // the browser to determine whether the subsequent cross-origin request 1430 // is 1431 // allowed to proceed. 1432 AllowCors bool `json:"allowCors,omitempty"` 1433 1434 // Features: The list of features enabled on this endpoint. 1435 Features []string `json:"features,omitempty"` 1436 1437 // Name: The canonical name of this endpoint. 1438 Name string `json:"name,omitempty"` 1439 1440 // Target: The specification of an Internet routable address of API 1441 // frontend that will 1442 // handle requests to this 1443 // [API 1444 // Endpoint](https://cloud.google.com/apis/design/glossary). It should 1445 // be 1446 // either a valid IPv4 address or a fully-qualified domain name. For 1447 // example, 1448 // "8.8.8.8" or "myservice.appspot.com". 1449 Target string `json:"target,omitempty"` 1450 1451 // ForceSendFields is a list of field names (e.g. "Aliases") to 1452 // unconditionally include in API requests. By default, fields with 1453 // empty values are omitted from API requests. However, any non-pointer, 1454 // non-interface field appearing in ForceSendFields will be sent to the 1455 // server regardless of whether the field is empty or not. This may be 1456 // used to include empty fields in Patch requests. 1457 ForceSendFields []string `json:"-"` 1458 1459 // NullFields is a list of field names (e.g. "Aliases") to include in 1460 // API requests with the JSON null value. By default, fields with empty 1461 // values are omitted from API requests. However, any field with an 1462 // empty value appearing in NullFields will be sent to the server as 1463 // null. It is an error if a field in this list has a non-empty value. 1464 // This may be used to include null fields in Patch requests. 1465 NullFields []string `json:"-"` 1466} 1467 1468func (s *Endpoint) MarshalJSON() ([]byte, error) { 1469 type NoMethod Endpoint 1470 raw := NoMethod(*s) 1471 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1472} 1473 1474// Enum: Enum type definition. 1475type Enum struct { 1476 // Enumvalue: Enum value definitions. 1477 Enumvalue []*EnumValue `json:"enumvalue,omitempty"` 1478 1479 // Name: Enum type name. 1480 Name string `json:"name,omitempty"` 1481 1482 // Options: Protocol buffer options. 1483 Options []*Option `json:"options,omitempty"` 1484 1485 // SourceContext: The source context. 1486 SourceContext *SourceContext `json:"sourceContext,omitempty"` 1487 1488 // Syntax: The source syntax. 1489 // 1490 // Possible values: 1491 // "SYNTAX_PROTO2" - Syntax `proto2`. 1492 // "SYNTAX_PROTO3" - Syntax `proto3`. 1493 Syntax string `json:"syntax,omitempty"` 1494 1495 // ForceSendFields is a list of field names (e.g. "Enumvalue") to 1496 // unconditionally include in API requests. By default, fields with 1497 // empty values are omitted from API requests. However, any non-pointer, 1498 // non-interface field appearing in ForceSendFields will be sent to the 1499 // server regardless of whether the field is empty or not. This may be 1500 // used to include empty fields in Patch requests. 1501 ForceSendFields []string `json:"-"` 1502 1503 // NullFields is a list of field names (e.g. "Enumvalue") to include in 1504 // API requests with the JSON null value. By default, fields with empty 1505 // values are omitted from API requests. However, any field with an 1506 // empty value appearing in NullFields will be sent to the server as 1507 // null. It is an error if a field in this list has a non-empty value. 1508 // This may be used to include null fields in Patch requests. 1509 NullFields []string `json:"-"` 1510} 1511 1512func (s *Enum) MarshalJSON() ([]byte, error) { 1513 type NoMethod Enum 1514 raw := NoMethod(*s) 1515 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1516} 1517 1518// EnumValue: Enum value definition. 1519type EnumValue struct { 1520 // Name: Enum value name. 1521 Name string `json:"name,omitempty"` 1522 1523 // Number: Enum value number. 1524 Number int64 `json:"number,omitempty"` 1525 1526 // Options: Protocol buffer options. 1527 Options []*Option `json:"options,omitempty"` 1528 1529 // ForceSendFields is a list of field names (e.g. "Name") to 1530 // unconditionally include in API requests. By default, fields with 1531 // empty values are omitted from API requests. However, any non-pointer, 1532 // non-interface field appearing in ForceSendFields will be sent to the 1533 // server regardless of whether the field is empty or not. This may be 1534 // used to include empty fields in Patch requests. 1535 ForceSendFields []string `json:"-"` 1536 1537 // NullFields is a list of field names (e.g. "Name") to include in API 1538 // requests with the JSON null value. By default, fields with empty 1539 // values are omitted from API requests. However, any field with an 1540 // empty value appearing in NullFields will be sent to the server as 1541 // null. It is an error if a field in this list has a non-empty value. 1542 // This may be used to include null fields in Patch requests. 1543 NullFields []string `json:"-"` 1544} 1545 1546func (s *EnumValue) MarshalJSON() ([]byte, error) { 1547 type NoMethod EnumValue 1548 raw := NoMethod(*s) 1549 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1550} 1551 1552// Field: A single field of a message type. 1553type Field struct { 1554 // Cardinality: The field cardinality. 1555 // 1556 // Possible values: 1557 // "CARDINALITY_UNKNOWN" - For fields with unknown cardinality. 1558 // "CARDINALITY_OPTIONAL" - For optional fields. 1559 // "CARDINALITY_REQUIRED" - For required fields. Proto2 syntax only. 1560 // "CARDINALITY_REPEATED" - For repeated fields. 1561 Cardinality string `json:"cardinality,omitempty"` 1562 1563 // DefaultValue: The string value of the default value of this field. 1564 // Proto2 syntax only. 1565 DefaultValue string `json:"defaultValue,omitempty"` 1566 1567 // JsonName: The field JSON name. 1568 JsonName string `json:"jsonName,omitempty"` 1569 1570 // Kind: The field type. 1571 // 1572 // Possible values: 1573 // "TYPE_UNKNOWN" - Field type unknown. 1574 // "TYPE_DOUBLE" - Field type double. 1575 // "TYPE_FLOAT" - Field type float. 1576 // "TYPE_INT64" - Field type int64. 1577 // "TYPE_UINT64" - Field type uint64. 1578 // "TYPE_INT32" - Field type int32. 1579 // "TYPE_FIXED64" - Field type fixed64. 1580 // "TYPE_FIXED32" - Field type fixed32. 1581 // "TYPE_BOOL" - Field type bool. 1582 // "TYPE_STRING" - Field type string. 1583 // "TYPE_GROUP" - Field type group. Proto2 syntax only, and 1584 // deprecated. 1585 // "TYPE_MESSAGE" - Field type message. 1586 // "TYPE_BYTES" - Field type bytes. 1587 // "TYPE_UINT32" - Field type uint32. 1588 // "TYPE_ENUM" - Field type enum. 1589 // "TYPE_SFIXED32" - Field type sfixed32. 1590 // "TYPE_SFIXED64" - Field type sfixed64. 1591 // "TYPE_SINT32" - Field type sint32. 1592 // "TYPE_SINT64" - Field type sint64. 1593 Kind string `json:"kind,omitempty"` 1594 1595 // Name: The field name. 1596 Name string `json:"name,omitempty"` 1597 1598 // Number: The field number. 1599 Number int64 `json:"number,omitempty"` 1600 1601 // OneofIndex: The index of the field type in `Type.oneofs`, for message 1602 // or enumeration 1603 // types. The first type has index 1; zero means the type is not in the 1604 // list. 1605 OneofIndex int64 `json:"oneofIndex,omitempty"` 1606 1607 // Options: The protocol buffer options. 1608 Options []*Option `json:"options,omitempty"` 1609 1610 // Packed: Whether to use alternative packed wire representation. 1611 Packed bool `json:"packed,omitempty"` 1612 1613 // TypeUrl: The field type URL, without the scheme, for message or 1614 // enumeration 1615 // types. Example: "type.googleapis.com/google.protobuf.Timestamp". 1616 TypeUrl string `json:"typeUrl,omitempty"` 1617 1618 // ForceSendFields is a list of field names (e.g. "Cardinality") to 1619 // unconditionally include in API requests. By default, fields with 1620 // empty values are omitted from API requests. However, any non-pointer, 1621 // non-interface field appearing in ForceSendFields will be sent to the 1622 // server regardless of whether the field is empty or not. This may be 1623 // used to include empty fields in Patch requests. 1624 ForceSendFields []string `json:"-"` 1625 1626 // NullFields is a list of field names (e.g. "Cardinality") to include 1627 // in API requests with the JSON null value. By default, fields with 1628 // empty values are omitted from API requests. However, any field with 1629 // an empty value appearing in NullFields will be sent to the server as 1630 // null. It is an error if a field in this list has a non-empty value. 1631 // This may be used to include null fields in Patch requests. 1632 NullFields []string `json:"-"` 1633} 1634 1635func (s *Field) MarshalJSON() ([]byte, error) { 1636 type NoMethod Field 1637 raw := NoMethod(*s) 1638 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1639} 1640 1641// GoogleCloudServicenetworkingV1betaSubnetwork: Represents a subnet 1642// that was created or discovered by a private access 1643// management service. 1644type GoogleCloudServicenetworkingV1betaSubnetwork struct { 1645 // IpCidrRange: Subnetwork CIDR range in `10.x.x.x/y` format. 1646 IpCidrRange string `json:"ipCidrRange,omitempty"` 1647 1648 // Name: Subnetwork name. 1649 // See https://cloud.google.com/compute/docs/vpc/ 1650 Name string `json:"name,omitempty"` 1651 1652 // Network: In the Shared VPC host project, the VPC network that's 1653 // peered with the 1654 // consumer network. For 1655 // example: 1656 // `projects/1234321/global/networks/host-network` 1657 Network string `json:"network,omitempty"` 1658 1659 // OutsideAllocation: This is a discovered subnet that is not within the 1660 // current consumer 1661 // allocated ranges. 1662 OutsideAllocation bool `json:"outsideAllocation,omitempty"` 1663 1664 // ForceSendFields is a list of field names (e.g. "IpCidrRange") to 1665 // unconditionally include in API requests. By default, fields with 1666 // empty values are omitted from API requests. However, any non-pointer, 1667 // non-interface field appearing in ForceSendFields will be sent to the 1668 // server regardless of whether the field is empty or not. This may be 1669 // used to include empty fields in Patch requests. 1670 ForceSendFields []string `json:"-"` 1671 1672 // NullFields is a list of field names (e.g. "IpCidrRange") to include 1673 // in API requests with the JSON null value. By default, fields with 1674 // empty values are omitted from API requests. However, any field with 1675 // an empty value appearing in NullFields will be sent to the server as 1676 // null. It is an error if a field in this list has a non-empty value. 1677 // This may be used to include null fields in Patch requests. 1678 NullFields []string `json:"-"` 1679} 1680 1681func (s *GoogleCloudServicenetworkingV1betaSubnetwork) MarshalJSON() ([]byte, error) { 1682 type NoMethod GoogleCloudServicenetworkingV1betaSubnetwork 1683 raw := NoMethod(*s) 1684 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1685} 1686 1687// Http: Defines the HTTP configuration for an API service. It contains 1688// a list of 1689// HttpRule, each specifying the mapping of an RPC method 1690// to one or more HTTP REST API methods. 1691type Http struct { 1692 // FullyDecodeReservedExpansion: When set to true, URL path parameters 1693 // will be fully URI-decoded except in 1694 // cases of single segment matches in reserved expansion, where "%2F" 1695 // will be 1696 // left encoded. 1697 // 1698 // The default behavior is to not decode RFC 6570 reserved characters in 1699 // multi 1700 // segment matches. 1701 FullyDecodeReservedExpansion bool `json:"fullyDecodeReservedExpansion,omitempty"` 1702 1703 // Rules: A list of HTTP configuration rules that apply to individual 1704 // API methods. 1705 // 1706 // **NOTE:** All service configuration rules follow "last one wins" 1707 // order. 1708 Rules []*HttpRule `json:"rules,omitempty"` 1709 1710 // ForceSendFields is a list of field names (e.g. 1711 // "FullyDecodeReservedExpansion") to unconditionally include in API 1712 // requests. By default, fields with empty values are omitted from API 1713 // requests. However, any non-pointer, non-interface field appearing in 1714 // ForceSendFields will be sent to the server regardless of whether the 1715 // field is empty or not. This may be used to include empty fields in 1716 // Patch requests. 1717 ForceSendFields []string `json:"-"` 1718 1719 // NullFields is a list of field names (e.g. 1720 // "FullyDecodeReservedExpansion") to include in API requests with the 1721 // JSON null value. By default, fields with empty values are omitted 1722 // from API requests. However, any field with an empty value appearing 1723 // in NullFields will be sent to the server as null. It is an error if a 1724 // field in this list has a non-empty value. This may be used to include 1725 // null fields in Patch requests. 1726 NullFields []string `json:"-"` 1727} 1728 1729func (s *Http) MarshalJSON() ([]byte, error) { 1730 type NoMethod Http 1731 raw := NoMethod(*s) 1732 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1733} 1734 1735// HttpRule: # gRPC Transcoding 1736// 1737// gRPC Transcoding is a feature for mapping between a gRPC method and 1738// one or 1739// more HTTP REST endpoints. It allows developers to build a single API 1740// service 1741// that supports both gRPC APIs and REST APIs. Many systems, including 1742// [Google 1743// APIs](https://github.com/googleapis/googleapis), 1744// [Cloud Endpoints](https://cloud.google.com/endpoints), 1745// [gRPC 1746// Gateway](https://github.com/grpc-ecosystem/grpc-gateway), 1747// and [Envoy](https://github.com/envoyproxy/envoy) proxy support this 1748// feature 1749// and use it for large scale production services. 1750// 1751// `HttpRule` defines the schema of the gRPC/REST mapping. The mapping 1752// specifies 1753// how different portions of the gRPC request message are mapped to the 1754// URL 1755// path, URL query parameters, and HTTP request body. It also controls 1756// how the 1757// gRPC response message is mapped to the HTTP response body. `HttpRule` 1758// is 1759// typically specified as an `google.api.http` annotation on the gRPC 1760// method. 1761// 1762// Each mapping specifies a URL path template and an HTTP method. The 1763// path 1764// template may refer to one or more fields in the gRPC request message, 1765// as long 1766// as each field is a non-repeated field with a primitive (non-message) 1767// type. 1768// The path template controls how fields of the request message are 1769// mapped to 1770// the URL path. 1771// 1772// Example: 1773// 1774// service Messaging { 1775// rpc GetMessage(GetMessageRequest) returns (Message) { 1776// option (google.api.http) = { 1777// get: "/v1/{name=messages/*}" 1778// }; 1779// } 1780// } 1781// message GetMessageRequest { 1782// string name = 1; // Mapped to URL path. 1783// } 1784// message Message { 1785// string text = 1; // The resource content. 1786// } 1787// 1788// This enables an HTTP REST to gRPC mapping as below: 1789// 1790// HTTP | gRPC 1791// -----|----- 1792// `GET /v1/messages/123456` | `GetMessage(name: 1793// "messages/123456")` 1794// 1795// Any fields in the request message which are not bound by the path 1796// template 1797// automatically become HTTP query parameters if there is no HTTP 1798// request body. 1799// For example: 1800// 1801// service Messaging { 1802// rpc GetMessage(GetMessageRequest) returns (Message) { 1803// option (google.api.http) = { 1804// get:"/v1/messages/{message_id}" 1805// }; 1806// } 1807// } 1808// message GetMessageRequest { 1809// message SubMessage { 1810// string subfield = 1; 1811// } 1812// string message_id = 1; // Mapped to URL path. 1813// int64 revision = 2; // Mapped to URL query parameter 1814// `revision`. 1815// SubMessage sub = 3; // Mapped to URL query parameter 1816// `sub.subfield`. 1817// } 1818// 1819// This enables a HTTP JSON to RPC mapping as below: 1820// 1821// HTTP | gRPC 1822// -----|----- 1823// `GET /v1/messages/123456?revision=2&sub.subfield=foo` 1824// | 1825// `GetMessage(message_id: "123456" revision: 2 sub: 1826// SubMessage(subfield: 1827// "foo"))` 1828// 1829// Note that fields which are mapped to URL query parameters must have 1830// a 1831// primitive type or a repeated primitive type or a non-repeated message 1832// type. 1833// In the case of a repeated type, the parameter can be repeated in the 1834// URL 1835// as `...?param=A¶m=B`. In the case of a message type, each field 1836// of the 1837// message is mapped to a separate parameter, such 1838// as 1839// `...?foo.a=A&foo.b=B&foo.c=C`. 1840// 1841// For HTTP methods that allow a request body, the `body` 1842// field 1843// specifies the mapping. Consider a REST update method on the 1844// message resource collection: 1845// 1846// service Messaging { 1847// rpc UpdateMessage(UpdateMessageRequest) returns (Message) { 1848// option (google.api.http) = { 1849// patch: "/v1/messages/{message_id}" 1850// body: "message" 1851// }; 1852// } 1853// } 1854// message UpdateMessageRequest { 1855// string message_id = 1; // mapped to the URL 1856// Message message = 2; // mapped to the body 1857// } 1858// 1859// The following HTTP JSON to RPC mapping is enabled, where 1860// the 1861// representation of the JSON in the request body is determined 1862// by 1863// protos JSON encoding: 1864// 1865// HTTP | gRPC 1866// -----|----- 1867// `PATCH /v1/messages/123456 { "text": "Hi!" }` | 1868// `UpdateMessage(message_id: 1869// "123456" message { text: "Hi!" })` 1870// 1871// The special name `*` can be used in the body mapping to define 1872// that 1873// every field not bound by the path template should be mapped to 1874// the 1875// request body. This enables the following alternative definition 1876// of 1877// the update method: 1878// 1879// service Messaging { 1880// rpc UpdateMessage(Message) returns (Message) { 1881// option (google.api.http) = { 1882// patch: "/v1/messages/{message_id}" 1883// body: "*" 1884// }; 1885// } 1886// } 1887// message Message { 1888// string message_id = 1; 1889// string text = 2; 1890// } 1891// 1892// 1893// The following HTTP JSON to RPC mapping is enabled: 1894// 1895// HTTP | gRPC 1896// -----|----- 1897// `PATCH /v1/messages/123456 { "text": "Hi!" }` | 1898// `UpdateMessage(message_id: 1899// "123456" text: "Hi!")` 1900// 1901// Note that when using `*` in the body mapping, it is not possible 1902// to 1903// have HTTP parameters, as all fields not bound by the path end in 1904// the body. This makes this option more rarely used in practice 1905// when 1906// defining REST APIs. The common usage of `*` is in custom 1907// methods 1908// which don't use the URL at all for transferring data. 1909// 1910// It is possible to define multiple HTTP methods for one RPC by 1911// using 1912// the `additional_bindings` option. Example: 1913// 1914// service Messaging { 1915// rpc GetMessage(GetMessageRequest) returns (Message) { 1916// option (google.api.http) = { 1917// get: "/v1/messages/{message_id}" 1918// additional_bindings { 1919// get: "/v1/users/{user_id}/messages/{message_id}" 1920// } 1921// }; 1922// } 1923// } 1924// message GetMessageRequest { 1925// string message_id = 1; 1926// string user_id = 2; 1927// } 1928// 1929// This enables the following two alternative HTTP JSON to RPC 1930// mappings: 1931// 1932// HTTP | gRPC 1933// -----|----- 1934// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` 1935// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" 1936// message_id: 1937// "123456")` 1938// 1939// ## Rules for HTTP mapping 1940// 1941// 1. Leaf request fields (recursive expansion nested messages in the 1942// request 1943// message) are classified into three categories: 1944// - Fields referred by the path template. They are passed via the 1945// URL path. 1946// - Fields referred by the HttpRule.body. They are passed via the 1947// HTTP 1948// request body. 1949// - All other fields are passed via the URL query parameters, and 1950// the 1951// parameter name is the field path in the request message. A 1952// repeated 1953// field can be represented as multiple query parameters under the 1954// same 1955// name. 1956// 2. If HttpRule.body is "*", there is no URL query parameter, all 1957// fields 1958// are passed via URL path and HTTP request body. 1959// 3. If HttpRule.body is omitted, there is no HTTP request body, all 1960// fields are passed via URL path and URL query parameters. 1961// 1962// ### Path template syntax 1963// 1964// Template = "/" Segments [ Verb ] ; 1965// Segments = Segment { "/" Segment } ; 1966// Segment = "*" | "**" | LITERAL | Variable ; 1967// Variable = "{" FieldPath [ "=" Segments ] "}" ; 1968// FieldPath = IDENT { "." IDENT } ; 1969// Verb = ":" LITERAL ; 1970// 1971// The syntax `*` matches a single URL path segment. The syntax `**` 1972// matches 1973// zero or more URL path segments, which must be the last part of the 1974// URL path 1975// except the `Verb`. 1976// 1977// The syntax `Variable` matches part of the URL path as specified by 1978// its 1979// template. A variable template must not contain other variables. If a 1980// variable 1981// matches a single path segment, its template may be omitted, e.g. 1982// `{var}` 1983// is equivalent to `{var=*}`. 1984// 1985// The syntax `LITERAL` matches literal text in the URL path. If the 1986// `LITERAL` 1987// contains any reserved character, such characters should be 1988// percent-encoded 1989// before the matching. 1990// 1991// If a variable contains exactly one path segment, such as "{var}" 1992// or 1993// "{var=*}", when such a variable is expanded into a URL path on the 1994// client 1995// side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. 1996// The 1997// server side does the reverse decoding. Such variables show up in 1998// the 1999// [Discovery 2000// Document](https://developers.google.com/discovery/v1/re 2001// ference/apis) as 2002// `{var}`. 2003// 2004// If a variable contains multiple path segments, such as 2005// "{var=foo/*}" 2006// or "{var=**}", when such a variable is expanded into a URL path on 2007// the 2008// client side, all characters except `[-_.~/0-9a-zA-Z]` are 2009// percent-encoded. 2010// The server side does the reverse decoding, except "%2F" and "%2f" are 2011// left 2012// unchanged. Such variables show up in 2013// the 2014// [Discovery 2015// Document](https://developers.google.com/discovery/v1/re 2016// ference/apis) as 2017// `{+var}`. 2018// 2019// ## Using gRPC API Service Configuration 2020// 2021// gRPC API Service Configuration (service config) is a configuration 2022// language 2023// for configuring a gRPC service to become a user-facing product. 2024// The 2025// service config is simply the YAML representation of the 2026// `google.api.Service` 2027// proto message. 2028// 2029// As an alternative to annotating your proto file, you can configure 2030// gRPC 2031// transcoding in your service config YAML files. You do this by 2032// specifying a 2033// `HttpRule` that maps the gRPC method to a REST endpoint, achieving 2034// the same 2035// effect as the proto annotation. This can be particularly useful if 2036// you 2037// have a proto that is reused in multiple services. Note that any 2038// transcoding 2039// specified in the service config will override any matching 2040// transcoding 2041// configuration in the proto. 2042// 2043// Example: 2044// 2045// http: 2046// rules: 2047// # Selects a gRPC method and applies HttpRule to it. 2048// - selector: example.v1.Messaging.GetMessage 2049// get: /v1/messages/{message_id}/{sub.subfield} 2050// 2051// ## Special notes 2052// 2053// When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, 2054// the 2055// proto to JSON conversion must follow the 2056// [proto3 2057// specification](https://developers.google.com/protocol-buffers/ 2058// docs/proto3#json). 2059// 2060// While the single segment variable follows the semantics of 2061// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple 2062// String 2063// Expansion, the multi segment variable **does not** follow RFC 6570 2064// Section 2065// 3.2.3 Reserved Expansion. The reason is that the Reserved 2066// Expansion 2067// does not expand special characters like `?` and `#`, which would 2068// lead 2069// to invalid URLs. As the result, gRPC Transcoding uses a custom 2070// encoding 2071// for multi segment variables. 2072// 2073// The path variables **must not** refer to any repeated or mapped 2074// field, 2075// because client libraries are not capable of handling such variable 2076// expansion. 2077// 2078// The path variables **must not** capture the leading "/" character. 2079// The reason 2080// is that the most common use case "{var}" does not capture the leading 2081// "/" 2082// character. For consistency, all path variables must share the same 2083// behavior. 2084// 2085// Repeated message fields must not be mapped to URL query parameters, 2086// because 2087// no client library can support such complicated mapping. 2088// 2089// If an API needs to use a JSON array for request or response body, it 2090// can map 2091// the request or response body to a repeated field. However, some 2092// gRPC 2093// Transcoding implementations may not support this feature. 2094type HttpRule struct { 2095 // AdditionalBindings: Additional HTTP bindings for the selector. Nested 2096 // bindings must 2097 // not contain an `additional_bindings` field themselves (that is, 2098 // the nesting may only be one level deep). 2099 AdditionalBindings []*HttpRule `json:"additionalBindings,omitempty"` 2100 2101 // Body: The name of the request field whose value is mapped to the HTTP 2102 // request 2103 // body, or `*` for mapping all request fields not captured by the 2104 // path 2105 // pattern to the HTTP body, or omitted for not having any HTTP request 2106 // body. 2107 // 2108 // NOTE: the referred field must be present at the top-level of the 2109 // request 2110 // message type. 2111 Body string `json:"body,omitempty"` 2112 2113 // Custom: The custom pattern is used for specifying an HTTP method that 2114 // is not 2115 // included in the `pattern` field, such as HEAD, or "*" to leave 2116 // the 2117 // HTTP method unspecified for this rule. The wild-card rule is 2118 // useful 2119 // for services that provide content to Web (HTML) clients. 2120 Custom *CustomHttpPattern `json:"custom,omitempty"` 2121 2122 // Delete: Maps to HTTP DELETE. Used for deleting a resource. 2123 Delete string `json:"delete,omitempty"` 2124 2125 // Get: Maps to HTTP GET. Used for listing and getting information 2126 // about 2127 // resources. 2128 Get string `json:"get,omitempty"` 2129 2130 // Patch: Maps to HTTP PATCH. Used for updating a resource. 2131 Patch string `json:"patch,omitempty"` 2132 2133 // Post: Maps to HTTP POST. Used for creating a resource or performing 2134 // an action. 2135 Post string `json:"post,omitempty"` 2136 2137 // Put: Maps to HTTP PUT. Used for replacing a resource. 2138 Put string `json:"put,omitempty"` 2139 2140 // ResponseBody: Optional. The name of the response field whose value is 2141 // mapped to the HTTP 2142 // response body. When omitted, the entire response message will be 2143 // used 2144 // as the HTTP response body. 2145 // 2146 // NOTE: The referred field must be present at the top-level of the 2147 // response 2148 // message type. 2149 ResponseBody string `json:"responseBody,omitempty"` 2150 2151 // Selector: Selects a method to which this rule applies. 2152 // 2153 // Refer to selector for syntax details. 2154 Selector string `json:"selector,omitempty"` 2155 2156 // ForceSendFields is a list of field names (e.g. "AdditionalBindings") 2157 // to unconditionally include in API requests. By default, fields with 2158 // empty values are omitted from API requests. However, any non-pointer, 2159 // non-interface field appearing in ForceSendFields will be sent to the 2160 // server regardless of whether the field is empty or not. This may be 2161 // used to include empty fields in Patch requests. 2162 ForceSendFields []string `json:"-"` 2163 2164 // NullFields is a list of field names (e.g. "AdditionalBindings") to 2165 // include in API requests with the JSON null value. By default, fields 2166 // with empty values are omitted from API requests. However, any field 2167 // with an empty value appearing in NullFields will be sent to the 2168 // server as null. It is an error if a field in this list has a 2169 // non-empty value. This may be used to include null fields in Patch 2170 // requests. 2171 NullFields []string `json:"-"` 2172} 2173 2174func (s *HttpRule) MarshalJSON() ([]byte, error) { 2175 type NoMethod HttpRule 2176 raw := NoMethod(*s) 2177 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2178} 2179 2180// LabelDescriptor: A description of a label. 2181type LabelDescriptor struct { 2182 // Description: A human-readable description for the label. 2183 Description string `json:"description,omitempty"` 2184 2185 // Key: The label key. 2186 Key string `json:"key,omitempty"` 2187 2188 // ValueType: The type of data that can be assigned to the label. 2189 // 2190 // Possible values: 2191 // "STRING" - A variable-length string. This is the default. 2192 // "BOOL" - Boolean; true or false. 2193 // "INT64" - A 64-bit signed integer. 2194 ValueType string `json:"valueType,omitempty"` 2195 2196 // ForceSendFields is a list of field names (e.g. "Description") to 2197 // unconditionally include in API requests. By default, fields with 2198 // empty values are omitted from API requests. However, any non-pointer, 2199 // non-interface field appearing in ForceSendFields will be sent to the 2200 // server regardless of whether the field is empty or not. This may be 2201 // used to include empty fields in Patch requests. 2202 ForceSendFields []string `json:"-"` 2203 2204 // NullFields is a list of field names (e.g. "Description") to include 2205 // in API requests with the JSON null value. By default, fields with 2206 // empty values are omitted from API requests. However, any field with 2207 // an empty value appearing in NullFields will be sent to the server as 2208 // null. It is an error if a field in this list has a non-empty value. 2209 // This may be used to include null fields in Patch requests. 2210 NullFields []string `json:"-"` 2211} 2212 2213func (s *LabelDescriptor) MarshalJSON() ([]byte, error) { 2214 type NoMethod LabelDescriptor 2215 raw := NoMethod(*s) 2216 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2217} 2218 2219// ListConnectionsResponse: ListConnectionsResponse is the response to 2220// list peering states for the 2221// given service and consumer project. 2222type ListConnectionsResponse struct { 2223 // Connections: The list of Connections. 2224 Connections []*Connection `json:"connections,omitempty"` 2225 2226 // ServerResponse contains the HTTP response code and headers from the 2227 // server. 2228 googleapi.ServerResponse `json:"-"` 2229 2230 // ForceSendFields is a list of field names (e.g. "Connections") to 2231 // unconditionally include in API requests. By default, fields with 2232 // empty values are omitted from API requests. However, any non-pointer, 2233 // non-interface field appearing in ForceSendFields will be sent to the 2234 // server regardless of whether the field is empty or not. This may be 2235 // used to include empty fields in Patch requests. 2236 ForceSendFields []string `json:"-"` 2237 2238 // NullFields is a list of field names (e.g. "Connections") to include 2239 // in API requests with the JSON null value. By default, fields with 2240 // empty values are omitted from API requests. However, any field with 2241 // an empty value appearing in NullFields will be sent to the server as 2242 // null. It is an error if a field in this list has a non-empty value. 2243 // This may be used to include null fields in Patch requests. 2244 NullFields []string `json:"-"` 2245} 2246 2247func (s *ListConnectionsResponse) MarshalJSON() ([]byte, error) { 2248 type NoMethod ListConnectionsResponse 2249 raw := NoMethod(*s) 2250 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2251} 2252 2253// LogDescriptor: A description of a log type. Example in YAML format: 2254// 2255// - name: library.googleapis.com/activity_history 2256// description: The history of borrowing and returning library 2257// items. 2258// display_name: Activity 2259// labels: 2260// - key: /customer_id 2261// description: Identifier of a library customer 2262type LogDescriptor struct { 2263 // Description: A human-readable description of this log. This 2264 // information appears in 2265 // the documentation and can contain details. 2266 Description string `json:"description,omitempty"` 2267 2268 // DisplayName: The human-readable name for this log. This information 2269 // appears on 2270 // the user interface and should be concise. 2271 DisplayName string `json:"displayName,omitempty"` 2272 2273 // Labels: The set of labels that are available to describe a specific 2274 // log entry. 2275 // Runtime requests that contain labels not specified here 2276 // are 2277 // considered invalid. 2278 Labels []*LabelDescriptor `json:"labels,omitempty"` 2279 2280 // Name: The name of the log. It must be less than 512 characters long 2281 // and can 2282 // include the following characters: upper- and lower-case 2283 // alphanumeric 2284 // characters [A-Za-z0-9], and punctuation characters including 2285 // slash, underscore, hyphen, period [/_-.]. 2286 Name string `json:"name,omitempty"` 2287 2288 // ForceSendFields is a list of field names (e.g. "Description") to 2289 // unconditionally include in API requests. By default, fields with 2290 // empty values are omitted from API requests. However, any non-pointer, 2291 // non-interface field appearing in ForceSendFields will be sent to the 2292 // server regardless of whether the field is empty or not. This may be 2293 // used to include empty fields in Patch requests. 2294 ForceSendFields []string `json:"-"` 2295 2296 // NullFields is a list of field names (e.g. "Description") to include 2297 // in API requests with the JSON null value. By default, fields with 2298 // empty values are omitted from API requests. However, any field with 2299 // an empty value appearing in NullFields will be sent to the server as 2300 // null. It is an error if a field in this list has a non-empty value. 2301 // This may be used to include null fields in Patch requests. 2302 NullFields []string `json:"-"` 2303} 2304 2305func (s *LogDescriptor) MarshalJSON() ([]byte, error) { 2306 type NoMethod LogDescriptor 2307 raw := NoMethod(*s) 2308 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2309} 2310 2311// Logging: Logging configuration of the service. 2312// 2313// The following example shows how to configure logs to be sent to 2314// the 2315// producer and consumer projects. In the example, the 2316// `activity_history` 2317// log is sent to both the producer and consumer projects, whereas 2318// the 2319// `purchase_history` log is only sent to the producer project. 2320// 2321// monitored_resources: 2322// - type: library.googleapis.com/branch 2323// labels: 2324// - key: /city 2325// description: The city where the library branch is located 2326// in. 2327// - key: /name 2328// description: The name of the branch. 2329// logs: 2330// - name: activity_history 2331// labels: 2332// - key: /customer_id 2333// - name: purchase_history 2334// logging: 2335// producer_destinations: 2336// - monitored_resource: library.googleapis.com/branch 2337// logs: 2338// - activity_history 2339// - purchase_history 2340// consumer_destinations: 2341// - monitored_resource: library.googleapis.com/branch 2342// logs: 2343// - activity_history 2344type Logging struct { 2345 // ConsumerDestinations: Logging configurations for sending logs to the 2346 // consumer project. 2347 // There can be multiple consumer destinations, each one must have 2348 // a 2349 // different monitored resource type. A log can be used in at most 2350 // one consumer destination. 2351 ConsumerDestinations []*LoggingDestination `json:"consumerDestinations,omitempty"` 2352 2353 // ProducerDestinations: Logging configurations for sending logs to the 2354 // producer project. 2355 // There can be multiple producer destinations, each one must have 2356 // a 2357 // different monitored resource type. A log can be used in at most 2358 // one producer destination. 2359 ProducerDestinations []*LoggingDestination `json:"producerDestinations,omitempty"` 2360 2361 // ForceSendFields is a list of field names (e.g. 2362 // "ConsumerDestinations") to unconditionally include in API requests. 2363 // By default, fields with empty values are omitted from API requests. 2364 // However, any non-pointer, non-interface field appearing in 2365 // ForceSendFields will be sent to the server regardless of whether the 2366 // field is empty or not. This may be used to include empty fields in 2367 // Patch requests. 2368 ForceSendFields []string `json:"-"` 2369 2370 // NullFields is a list of field names (e.g. "ConsumerDestinations") to 2371 // include in API requests with the JSON null value. By default, fields 2372 // with empty values are omitted from API requests. However, any field 2373 // with an empty value appearing in NullFields will be sent to the 2374 // server as null. It is an error if a field in this list has a 2375 // non-empty value. This may be used to include null fields in Patch 2376 // requests. 2377 NullFields []string `json:"-"` 2378} 2379 2380func (s *Logging) MarshalJSON() ([]byte, error) { 2381 type NoMethod Logging 2382 raw := NoMethod(*s) 2383 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2384} 2385 2386// LoggingDestination: Configuration of a specific logging destination 2387// (the producer project 2388// or the consumer project). 2389type LoggingDestination struct { 2390 // Logs: Names of the logs to be sent to this destination. Each name 2391 // must 2392 // be defined in the Service.logs section. If the log name is 2393 // not a domain scoped name, it will be automatically prefixed with 2394 // the service name followed by "/". 2395 Logs []string `json:"logs,omitempty"` 2396 2397 // MonitoredResource: The monitored resource type. The type must be 2398 // defined in the 2399 // Service.monitored_resources section. 2400 MonitoredResource string `json:"monitoredResource,omitempty"` 2401 2402 // ForceSendFields is a list of field names (e.g. "Logs") to 2403 // unconditionally include in API requests. By default, fields with 2404 // empty values are omitted from API requests. However, any non-pointer, 2405 // non-interface field appearing in ForceSendFields will be sent to the 2406 // server regardless of whether the field is empty or not. This may be 2407 // used to include empty fields in Patch requests. 2408 ForceSendFields []string `json:"-"` 2409 2410 // NullFields is a list of field names (e.g. "Logs") to include in API 2411 // requests with the JSON null value. By default, fields with empty 2412 // values are omitted from API requests. However, any field with an 2413 // empty value appearing in NullFields will be sent to the server as 2414 // null. It is an error if a field in this list has a non-empty value. 2415 // This may be used to include null fields in Patch requests. 2416 NullFields []string `json:"-"` 2417} 2418 2419func (s *LoggingDestination) MarshalJSON() ([]byte, error) { 2420 type NoMethod LoggingDestination 2421 raw := NoMethod(*s) 2422 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2423} 2424 2425// Method: Method represents a method of an API interface. 2426type Method struct { 2427 // Name: The simple name of this method. 2428 Name string `json:"name,omitempty"` 2429 2430 // Options: Any metadata attached to the method. 2431 Options []*Option `json:"options,omitempty"` 2432 2433 // RequestStreaming: If true, the request is streamed. 2434 RequestStreaming bool `json:"requestStreaming,omitempty"` 2435 2436 // RequestTypeUrl: A URL of the input message type. 2437 RequestTypeUrl string `json:"requestTypeUrl,omitempty"` 2438 2439 // ResponseStreaming: If true, the response is streamed. 2440 ResponseStreaming bool `json:"responseStreaming,omitempty"` 2441 2442 // ResponseTypeUrl: The URL of the output message type. 2443 ResponseTypeUrl string `json:"responseTypeUrl,omitempty"` 2444 2445 // Syntax: The source syntax of this method. 2446 // 2447 // Possible values: 2448 // "SYNTAX_PROTO2" - Syntax `proto2`. 2449 // "SYNTAX_PROTO3" - Syntax `proto3`. 2450 Syntax string `json:"syntax,omitempty"` 2451 2452 // ForceSendFields is a list of field names (e.g. "Name") to 2453 // unconditionally include in API requests. By default, fields with 2454 // empty values are omitted from API requests. However, any non-pointer, 2455 // non-interface field appearing in ForceSendFields will be sent to the 2456 // server regardless of whether the field is empty or not. This may be 2457 // used to include empty fields in Patch requests. 2458 ForceSendFields []string `json:"-"` 2459 2460 // NullFields is a list of field names (e.g. "Name") to include in API 2461 // requests with the JSON null value. By default, fields with empty 2462 // values are omitted from API requests. However, any field with an 2463 // empty value appearing in NullFields will be sent to the server as 2464 // null. It is an error if a field in this list has a non-empty value. 2465 // This may be used to include null fields in Patch requests. 2466 NullFields []string `json:"-"` 2467} 2468 2469func (s *Method) MarshalJSON() ([]byte, error) { 2470 type NoMethod Method 2471 raw := NoMethod(*s) 2472 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2473} 2474 2475// MetricDescriptor: Defines a metric type and its schema. Once a metric 2476// descriptor is created, 2477// deleting or altering it stops data collection and makes the metric 2478// type's 2479// existing data unusable. 2480type MetricDescriptor struct { 2481 // Description: A detailed description of the metric, which can be used 2482 // in documentation. 2483 Description string `json:"description,omitempty"` 2484 2485 // DisplayName: A concise name for the metric, which can be displayed in 2486 // user interfaces. 2487 // Use sentence case without an ending period, for example "Request 2488 // count". 2489 // This field is optional but it is recommended to be set for any 2490 // metrics 2491 // associated with user-visible concepts, such as Quota. 2492 DisplayName string `json:"displayName,omitempty"` 2493 2494 // Labels: The set of labels that can be used to describe a 2495 // specific 2496 // instance of this metric type. For example, 2497 // the 2498 // `appengine.googleapis.com/http/server/response_latencies` metric 2499 // type has a label for the HTTP response code, `response_code`, so 2500 // you can look at latencies for successful responses or just 2501 // for responses that failed. 2502 Labels []*LabelDescriptor `json:"labels,omitempty"` 2503 2504 // LaunchStage: Optional. The launch stage of the metric definition. 2505 // 2506 // Possible values: 2507 // "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value. 2508 // "EARLY_ACCESS" - Early Access features are limited to a closed 2509 // group of testers. To use 2510 // these features, you must sign up in advance and sign a Trusted 2511 // Tester 2512 // agreement (which includes confidentiality provisions). These features 2513 // may 2514 // be unstable, changed in backward-incompatible ways, and are 2515 // not 2516 // guaranteed to be released. 2517 // "ALPHA" - Alpha is a limited availability test for releases before 2518 // they are cleared 2519 // for widespread use. By Alpha, all significant design issues are 2520 // resolved 2521 // and we are in the process of verifying functionality. Alpha 2522 // customers 2523 // need to apply for access, agree to applicable terms, and have 2524 // their 2525 // projects whitelisted. Alpha releases don’t have to be feature 2526 // complete, 2527 // no SLAs are provided, and there are no technical support obligations, 2528 // but 2529 // they will be far enough along that customers can actually use them 2530 // in 2531 // test environments or for limited-use tests -- just like they would 2532 // in 2533 // normal production cases. 2534 // "BETA" - Beta is the point at which we are ready to open a release 2535 // for any 2536 // customer to use. There are no SLA or technical support obligations in 2537 // a 2538 // Beta release. Products will be complete from a feature perspective, 2539 // but 2540 // may have some open outstanding issues. Beta releases are suitable 2541 // for 2542 // limited production use cases. 2543 // "GA" - GA features are open to all developers and are considered 2544 // stable and 2545 // fully qualified for production use. 2546 // "DEPRECATED" - Deprecated features are scheduled to be shut down 2547 // and removed. For more 2548 // information, see the “Deprecation Policy” section of our [Terms 2549 // of 2550 // Service](https://cloud.google.com/terms/) 2551 // and the [Google Cloud Platform Subject to the 2552 // Deprecation 2553 // Policy](https://cloud.google.com/terms/deprecation) documentation. 2554 LaunchStage string `json:"launchStage,omitempty"` 2555 2556 // Metadata: Optional. Metadata which can be used to guide usage of the 2557 // metric. 2558 Metadata *MetricDescriptorMetadata `json:"metadata,omitempty"` 2559 2560 // MetricKind: Whether the metric records instantaneous values, changes 2561 // to a value, etc. 2562 // Some combinations of `metric_kind` and `value_type` might not be 2563 // supported. 2564 // 2565 // Possible values: 2566 // "METRIC_KIND_UNSPECIFIED" - Do not use this default value. 2567 // "GAUGE" - An instantaneous measurement of a value. 2568 // "DELTA" - The change in a value during a time interval. 2569 // "CUMULATIVE" - A value accumulated over a time interval. 2570 // Cumulative 2571 // measurements in a time series should have the same start time 2572 // and increasing end times, until an event resets the cumulative 2573 // value to zero and sets a new start time for the following 2574 // points. 2575 MetricKind string `json:"metricKind,omitempty"` 2576 2577 // Name: The resource name of the metric descriptor. 2578 Name string `json:"name,omitempty"` 2579 2580 // Type: The metric type, including its DNS name prefix. The type is 2581 // not 2582 // URL-encoded. All user-defined metric types have the DNS 2583 // name 2584 // `custom.googleapis.com` or `external.googleapis.com`. Metric types 2585 // should 2586 // use a natural hierarchical grouping. For example: 2587 // 2588 // "custom.googleapis.com/invoice/paid/amount" 2589 // "external.googleapis.com/prometheus/up" 2590 // "appengine.googleapis.com/http/server/response_latencies" 2591 Type string `json:"type,omitempty"` 2592 2593 // Unit: The unit in which the metric value is reported. It is only 2594 // applicable 2595 // if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. 2596 // The 2597 // supported units are a subset of [The Unified Code for Units 2598 // of 2599 // Measure](http://unitsofmeasure.org/ucum.html) standard: 2600 // 2601 // **Basic units (UNIT)** 2602 // 2603 // * `bit` bit 2604 // * `By` byte 2605 // * `s` second 2606 // * `min` minute 2607 // * `h` hour 2608 // * `d` day 2609 // 2610 // **Prefixes (PREFIX)** 2611 // 2612 // * `k` kilo (10**3) 2613 // * `M` mega (10**6) 2614 // * `G` giga (10**9) 2615 // * `T` tera (10**12) 2616 // * `P` peta (10**15) 2617 // * `E` exa (10**18) 2618 // * `Z` zetta (10**21) 2619 // * `Y` yotta (10**24) 2620 // * `m` milli (10**-3) 2621 // * `u` micro (10**-6) 2622 // * `n` nano (10**-9) 2623 // * `p` pico (10**-12) 2624 // * `f` femto (10**-15) 2625 // * `a` atto (10**-18) 2626 // * `z` zepto (10**-21) 2627 // * `y` yocto (10**-24) 2628 // * `Ki` kibi (2**10) 2629 // * `Mi` mebi (2**20) 2630 // * `Gi` gibi (2**30) 2631 // * `Ti` tebi (2**40) 2632 // 2633 // **Grammar** 2634 // 2635 // The grammar also includes these connectors: 2636 // 2637 // * `/` division (as an infix operator, e.g. `1/s`). 2638 // * `.` multiplication (as an infix operator, e.g. `GBy.d`) 2639 // 2640 // The grammar for a unit is as follows: 2641 // 2642 // Expression = Component { "." Component } { "/" Component } ; 2643 // 2644 // Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] 2645 // | Annotation 2646 // | "1" 2647 // ; 2648 // 2649 // Annotation = "{" NAME "}" ; 2650 // 2651 // Notes: 2652 // 2653 // * `Annotation` is just a comment if it follows a `UNIT` and is 2654 // equivalent to `1` if it is used alone. For examples, 2655 // `{requests}/s == 1/s`, `By{transmitted}/s == By/s`. 2656 // * `NAME` is a sequence of non-blank printable ASCII characters not 2657 // containing '{' or '}'. 2658 // * `1` represents dimensionless value 1, such as in `1/s`. 2659 // * `%` represents dimensionless value 1/100, and annotates values 2660 // giving 2661 // a percentage. 2662 Unit string `json:"unit,omitempty"` 2663 2664 // ValueType: Whether the measurement is an integer, a floating-point 2665 // number, etc. 2666 // Some combinations of `metric_kind` and `value_type` might not be 2667 // supported. 2668 // 2669 // Possible values: 2670 // "VALUE_TYPE_UNSPECIFIED" - Do not use this default value. 2671 // "BOOL" - The value is a boolean. 2672 // This value type can be used only if the metric kind is `GAUGE`. 2673 // "INT64" - The value is a signed 64-bit integer. 2674 // "DOUBLE" - The value is a double precision floating point number. 2675 // "STRING" - The value is a text string. 2676 // This value type can be used only if the metric kind is `GAUGE`. 2677 // "DISTRIBUTION" - The value is a `Distribution`. 2678 // "MONEY" - The value is money. 2679 ValueType string `json:"valueType,omitempty"` 2680 2681 // ForceSendFields is a list of field names (e.g. "Description") to 2682 // unconditionally include in API requests. By default, fields with 2683 // empty values are omitted from API requests. However, any non-pointer, 2684 // non-interface field appearing in ForceSendFields will be sent to the 2685 // server regardless of whether the field is empty or not. This may be 2686 // used to include empty fields in Patch requests. 2687 ForceSendFields []string `json:"-"` 2688 2689 // NullFields is a list of field names (e.g. "Description") to include 2690 // in API requests with the JSON null value. By default, fields with 2691 // empty values are omitted from API requests. However, any field with 2692 // an empty value appearing in NullFields will be sent to the server as 2693 // null. It is an error if a field in this list has a non-empty value. 2694 // This may be used to include null fields in Patch requests. 2695 NullFields []string `json:"-"` 2696} 2697 2698func (s *MetricDescriptor) MarshalJSON() ([]byte, error) { 2699 type NoMethod MetricDescriptor 2700 raw := NoMethod(*s) 2701 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2702} 2703 2704// MetricDescriptorMetadata: Additional annotations that can be used to 2705// guide the usage of a metric. 2706type MetricDescriptorMetadata struct { 2707 // IngestDelay: The delay of data points caused by ingestion. Data 2708 // points older than this 2709 // age are guaranteed to be ingested and available to be read, 2710 // excluding 2711 // data loss due to errors. 2712 IngestDelay string `json:"ingestDelay,omitempty"` 2713 2714 // LaunchStage: Deprecated. Please use the MetricDescriptor.launch_stage 2715 // instead. 2716 // The launch stage of the metric definition. 2717 // 2718 // Possible values: 2719 // "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value. 2720 // "EARLY_ACCESS" - Early Access features are limited to a closed 2721 // group of testers. To use 2722 // these features, you must sign up in advance and sign a Trusted 2723 // Tester 2724 // agreement (which includes confidentiality provisions). These features 2725 // may 2726 // be unstable, changed in backward-incompatible ways, and are 2727 // not 2728 // guaranteed to be released. 2729 // "ALPHA" - Alpha is a limited availability test for releases before 2730 // they are cleared 2731 // for widespread use. By Alpha, all significant design issues are 2732 // resolved 2733 // and we are in the process of verifying functionality. Alpha 2734 // customers 2735 // need to apply for access, agree to applicable terms, and have 2736 // their 2737 // projects whitelisted. Alpha releases don’t have to be feature 2738 // complete, 2739 // no SLAs are provided, and there are no technical support obligations, 2740 // but 2741 // they will be far enough along that customers can actually use them 2742 // in 2743 // test environments or for limited-use tests -- just like they would 2744 // in 2745 // normal production cases. 2746 // "BETA" - Beta is the point at which we are ready to open a release 2747 // for any 2748 // customer to use. There are no SLA or technical support obligations in 2749 // a 2750 // Beta release. Products will be complete from a feature perspective, 2751 // but 2752 // may have some open outstanding issues. Beta releases are suitable 2753 // for 2754 // limited production use cases. 2755 // "GA" - GA features are open to all developers and are considered 2756 // stable and 2757 // fully qualified for production use. 2758 // "DEPRECATED" - Deprecated features are scheduled to be shut down 2759 // and removed. For more 2760 // information, see the “Deprecation Policy” section of our [Terms 2761 // of 2762 // Service](https://cloud.google.com/terms/) 2763 // and the [Google Cloud Platform Subject to the 2764 // Deprecation 2765 // Policy](https://cloud.google.com/terms/deprecation) documentation. 2766 LaunchStage string `json:"launchStage,omitempty"` 2767 2768 // SamplePeriod: The sampling period of metric data points. For metrics 2769 // which are written 2770 // periodically, consecutive data points are stored at this time 2771 // interval, 2772 // excluding data loss due to errors. Metrics with a higher granularity 2773 // have 2774 // a smaller sampling period. 2775 SamplePeriod string `json:"samplePeriod,omitempty"` 2776 2777 // ForceSendFields is a list of field names (e.g. "IngestDelay") to 2778 // unconditionally include in API requests. By default, fields with 2779 // empty values are omitted from API requests. However, any non-pointer, 2780 // non-interface field appearing in ForceSendFields will be sent to the 2781 // server regardless of whether the field is empty or not. This may be 2782 // used to include empty fields in Patch requests. 2783 ForceSendFields []string `json:"-"` 2784 2785 // NullFields is a list of field names (e.g. "IngestDelay") to include 2786 // in API requests with the JSON null value. By default, fields with 2787 // empty values are omitted from API requests. However, any field with 2788 // an empty value appearing in NullFields will be sent to the server as 2789 // null. It is an error if a field in this list has a non-empty value. 2790 // This may be used to include null fields in Patch requests. 2791 NullFields []string `json:"-"` 2792} 2793 2794func (s *MetricDescriptorMetadata) MarshalJSON() ([]byte, error) { 2795 type NoMethod MetricDescriptorMetadata 2796 raw := NoMethod(*s) 2797 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2798} 2799 2800// MetricRule: Bind API methods to metrics. Binding a method to a metric 2801// causes that 2802// metric's configured quota behaviors to apply to the method call. 2803type MetricRule struct { 2804 // MetricCosts: Metrics to update when the selected methods are called, 2805 // and the associated 2806 // cost applied to each metric. 2807 // 2808 // The key of the map is the metric name, and the values are the 2809 // amount 2810 // increased for the metric against which the quota limits are 2811 // defined. 2812 // The value must not be negative. 2813 MetricCosts map[string]string `json:"metricCosts,omitempty"` 2814 2815 // Selector: Selects the methods to which this rule applies. 2816 // 2817 // Refer to selector for syntax details. 2818 Selector string `json:"selector,omitempty"` 2819 2820 // ForceSendFields is a list of field names (e.g. "MetricCosts") to 2821 // unconditionally include in API requests. By default, fields with 2822 // empty values are omitted from API requests. However, any non-pointer, 2823 // non-interface field appearing in ForceSendFields will be sent to the 2824 // server regardless of whether the field is empty or not. This may be 2825 // used to include empty fields in Patch requests. 2826 ForceSendFields []string `json:"-"` 2827 2828 // NullFields is a list of field names (e.g. "MetricCosts") to include 2829 // in API requests with the JSON null value. By default, fields with 2830 // empty values are omitted from API requests. However, any field with 2831 // an empty value appearing in NullFields will be sent to the server as 2832 // null. It is an error if a field in this list has a non-empty value. 2833 // This may be used to include null fields in Patch requests. 2834 NullFields []string `json:"-"` 2835} 2836 2837func (s *MetricRule) MarshalJSON() ([]byte, error) { 2838 type NoMethod MetricRule 2839 raw := NoMethod(*s) 2840 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2841} 2842 2843// Mixin: Declares an API Interface to be included in this interface. 2844// The including 2845// interface must redeclare all the methods from the included interface, 2846// but 2847// documentation and options are inherited as follows: 2848// 2849// - If after comment and whitespace stripping, the documentation 2850// string of the redeclared method is empty, it will be inherited 2851// from the original method. 2852// 2853// - Each annotation belonging to the service config (http, 2854// visibility) which is not set in the redeclared method will be 2855// inherited. 2856// 2857// - If an http annotation is inherited, the path pattern will be 2858// modified as follows. Any version prefix will be replaced by the 2859// version of the including interface plus the root path if 2860// specified. 2861// 2862// Example of a simple mixin: 2863// 2864// package google.acl.v1; 2865// service AccessControl { 2866// // Get the underlying ACL object. 2867// rpc GetAcl(GetAclRequest) returns (Acl) { 2868// option (google.api.http).get = "/v1/{resource=**}:getAcl"; 2869// } 2870// } 2871// 2872// package google.storage.v2; 2873// service Storage { 2874// // rpc GetAcl(GetAclRequest) returns (Acl); 2875// 2876// // Get a data record. 2877// rpc GetData(GetDataRequest) returns (Data) { 2878// option (google.api.http).get = "/v2/{resource=**}"; 2879// } 2880// } 2881// 2882// Example of a mixin configuration: 2883// 2884// apis: 2885// - name: google.storage.v2.Storage 2886// mixins: 2887// - name: google.acl.v1.AccessControl 2888// 2889// The mixin construct implies that all methods in `AccessControl` 2890// are 2891// also declared with same name and request/response types in 2892// `Storage`. A documentation generator or annotation processor will 2893// see the effective `Storage.GetAcl` method after 2894// inherting 2895// documentation and annotations as follows: 2896// 2897// service Storage { 2898// // Get the underlying ACL object. 2899// rpc GetAcl(GetAclRequest) returns (Acl) { 2900// option (google.api.http).get = "/v2/{resource=**}:getAcl"; 2901// } 2902// ... 2903// } 2904// 2905// Note how the version in the path pattern changed from `v1` to 2906// `v2`. 2907// 2908// If the `root` field in the mixin is specified, it should be 2909// a 2910// relative path under which inherited HTTP paths are placed. Example: 2911// 2912// apis: 2913// - name: google.storage.v2.Storage 2914// mixins: 2915// - name: google.acl.v1.AccessControl 2916// root: acls 2917// 2918// This implies the following inherited HTTP annotation: 2919// 2920// service Storage { 2921// // Get the underlying ACL object. 2922// rpc GetAcl(GetAclRequest) returns (Acl) { 2923// option (google.api.http).get = 2924// "/v2/acls/{resource=**}:getAcl"; 2925// } 2926// ... 2927// } 2928type Mixin struct { 2929 // Name: The fully qualified name of the interface which is included. 2930 Name string `json:"name,omitempty"` 2931 2932 // Root: If non-empty specifies a path under which inherited HTTP 2933 // paths 2934 // are rooted. 2935 Root string `json:"root,omitempty"` 2936 2937 // ForceSendFields is a list of field names (e.g. "Name") to 2938 // unconditionally include in API requests. By default, fields with 2939 // empty values are omitted from API requests. However, any non-pointer, 2940 // non-interface field appearing in ForceSendFields will be sent to the 2941 // server regardless of whether the field is empty or not. This may be 2942 // used to include empty fields in Patch requests. 2943 ForceSendFields []string `json:"-"` 2944 2945 // NullFields is a list of field names (e.g. "Name") to include in API 2946 // requests with the JSON null value. By default, fields with empty 2947 // values are omitted from API requests. However, any field with an 2948 // empty value appearing in NullFields will be sent to the server as 2949 // null. It is an error if a field in this list has a non-empty value. 2950 // This may be used to include null fields in Patch requests. 2951 NullFields []string `json:"-"` 2952} 2953 2954func (s *Mixin) MarshalJSON() ([]byte, error) { 2955 type NoMethod Mixin 2956 raw := NoMethod(*s) 2957 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2958} 2959 2960// MonitoredResourceDescriptor: An object that describes the schema of a 2961// MonitoredResource object using a 2962// type name and a set of labels. For example, the monitored 2963// resource 2964// descriptor for Google Compute Engine VM instances has a type 2965// of 2966// "gce_instance" and specifies the use of the labels "instance_id" 2967// and 2968// "zone" to identify particular VM instances. 2969// 2970// Different APIs can support different monitored resource types. APIs 2971// generally 2972// provide a `list` method that returns the monitored resource 2973// descriptors used 2974// by the API. 2975type MonitoredResourceDescriptor struct { 2976 // Description: Optional. A detailed description of the monitored 2977 // resource type that might 2978 // be used in documentation. 2979 Description string `json:"description,omitempty"` 2980 2981 // DisplayName: Optional. A concise name for the monitored resource type 2982 // that might be 2983 // displayed in user interfaces. It should be a Title Cased Noun 2984 // Phrase, 2985 // without any article or other determiners. For example, 2986 // "Google Cloud SQL Database". 2987 DisplayName string `json:"displayName,omitempty"` 2988 2989 // Labels: Required. A set of labels used to describe instances of this 2990 // monitored 2991 // resource type. For example, an individual Google Cloud SQL database 2992 // is 2993 // identified by values for the labels "database_id" and "zone". 2994 Labels []*LabelDescriptor `json:"labels,omitempty"` 2995 2996 // LaunchStage: Optional. The launch stage of the monitored resource 2997 // definition. 2998 // 2999 // Possible values: 3000 // "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value. 3001 // "EARLY_ACCESS" - Early Access features are limited to a closed 3002 // group of testers. To use 3003 // these features, you must sign up in advance and sign a Trusted 3004 // Tester 3005 // agreement (which includes confidentiality provisions). These features 3006 // may 3007 // be unstable, changed in backward-incompatible ways, and are 3008 // not 3009 // guaranteed to be released. 3010 // "ALPHA" - Alpha is a limited availability test for releases before 3011 // they are cleared 3012 // for widespread use. By Alpha, all significant design issues are 3013 // resolved 3014 // and we are in the process of verifying functionality. Alpha 3015 // customers 3016 // need to apply for access, agree to applicable terms, and have 3017 // their 3018 // projects whitelisted. Alpha releases don’t have to be feature 3019 // complete, 3020 // no SLAs are provided, and there are no technical support obligations, 3021 // but 3022 // they will be far enough along that customers can actually use them 3023 // in 3024 // test environments or for limited-use tests -- just like they would 3025 // in 3026 // normal production cases. 3027 // "BETA" - Beta is the point at which we are ready to open a release 3028 // for any 3029 // customer to use. There are no SLA or technical support obligations in 3030 // a 3031 // Beta release. Products will be complete from a feature perspective, 3032 // but 3033 // may have some open outstanding issues. Beta releases are suitable 3034 // for 3035 // limited production use cases. 3036 // "GA" - GA features are open to all developers and are considered 3037 // stable and 3038 // fully qualified for production use. 3039 // "DEPRECATED" - Deprecated features are scheduled to be shut down 3040 // and removed. For more 3041 // information, see the “Deprecation Policy” section of our [Terms 3042 // of 3043 // Service](https://cloud.google.com/terms/) 3044 // and the [Google Cloud Platform Subject to the 3045 // Deprecation 3046 // Policy](https://cloud.google.com/terms/deprecation) documentation. 3047 LaunchStage string `json:"launchStage,omitempty"` 3048 3049 // Name: Optional. The resource name of the monitored resource 3050 // descriptor: 3051 // "projects/{project_id}/monitoredResourceDescriptors/{type 3052 // }" where 3053 // {type} is the value of the `type` field in this object 3054 // and 3055 // {project_id} is a project ID that provides API-specific context 3056 // for 3057 // accessing the type. APIs that do not use project information can use 3058 // the 3059 // resource name format "monitoredResourceDescriptors/{type}". 3060 Name string `json:"name,omitempty"` 3061 3062 // Type: Required. The monitored resource type. For example, the 3063 // type 3064 // "cloudsql_database" represents databases in Google Cloud SQL. 3065 // The maximum length of this value is 256 characters. 3066 Type string `json:"type,omitempty"` 3067 3068 // ForceSendFields is a list of field names (e.g. "Description") to 3069 // unconditionally include in API requests. By default, fields with 3070 // empty values are omitted from API requests. However, any non-pointer, 3071 // non-interface field appearing in ForceSendFields will be sent to the 3072 // server regardless of whether the field is empty or not. This may be 3073 // used to include empty fields in Patch requests. 3074 ForceSendFields []string `json:"-"` 3075 3076 // NullFields is a list of field names (e.g. "Description") to include 3077 // in API requests with the JSON null value. By default, fields with 3078 // empty values are omitted from API requests. However, any field with 3079 // an empty value appearing in NullFields will be sent to the server as 3080 // null. It is an error if a field in this list has a non-empty value. 3081 // This may be used to include null fields in Patch requests. 3082 NullFields []string `json:"-"` 3083} 3084 3085func (s *MonitoredResourceDescriptor) MarshalJSON() ([]byte, error) { 3086 type NoMethod MonitoredResourceDescriptor 3087 raw := NoMethod(*s) 3088 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3089} 3090 3091// Monitoring: Monitoring configuration of the service. 3092// 3093// The example below shows how to configure monitored resources and 3094// metrics 3095// for monitoring. In the example, a monitored resource and two metrics 3096// are 3097// defined. The `library.googleapis.com/book/returned_count` metric is 3098// sent 3099// to both producer and consumer projects, whereas 3100// the 3101// `library.googleapis.com/book/overdue_count` metric is only sent to 3102// the 3103// consumer project. 3104// 3105// monitored_resources: 3106// - type: library.googleapis.com/branch 3107// labels: 3108// - key: /city 3109// description: The city where the library branch is located 3110// in. 3111// - key: /name 3112// description: The name of the branch. 3113// metrics: 3114// - name: library.googleapis.com/book/returned_count 3115// metric_kind: DELTA 3116// value_type: INT64 3117// labels: 3118// - key: /customer_id 3119// - name: library.googleapis.com/book/overdue_count 3120// metric_kind: GAUGE 3121// value_type: INT64 3122// labels: 3123// - key: /customer_id 3124// monitoring: 3125// producer_destinations: 3126// - monitored_resource: library.googleapis.com/branch 3127// metrics: 3128// - library.googleapis.com/book/returned_count 3129// consumer_destinations: 3130// - monitored_resource: library.googleapis.com/branch 3131// metrics: 3132// - library.googleapis.com/book/returned_count 3133// - library.googleapis.com/book/overdue_count 3134type Monitoring struct { 3135 // ConsumerDestinations: Monitoring configurations for sending metrics 3136 // to the consumer project. 3137 // There can be multiple consumer destinations. A monitored resouce type 3138 // may 3139 // appear in multiple monitoring destinations if different aggregations 3140 // are 3141 // needed for different sets of metrics associated with that 3142 // monitored 3143 // resource type. A monitored resource and metric pair may only be used 3144 // once 3145 // in the Monitoring configuration. 3146 ConsumerDestinations []*MonitoringDestination `json:"consumerDestinations,omitempty"` 3147 3148 // ProducerDestinations: Monitoring configurations for sending metrics 3149 // to the producer project. 3150 // There can be multiple producer destinations. A monitored resouce type 3151 // may 3152 // appear in multiple monitoring destinations if different aggregations 3153 // are 3154 // needed for different sets of metrics associated with that 3155 // monitored 3156 // resource type. A monitored resource and metric pair may only be used 3157 // once 3158 // in the Monitoring configuration. 3159 ProducerDestinations []*MonitoringDestination `json:"producerDestinations,omitempty"` 3160 3161 // ForceSendFields is a list of field names (e.g. 3162 // "ConsumerDestinations") to unconditionally include in API requests. 3163 // By default, fields with empty values are omitted from API requests. 3164 // However, any non-pointer, non-interface field appearing in 3165 // ForceSendFields will be sent to the server regardless of whether the 3166 // field is empty or not. This may be used to include empty fields in 3167 // Patch requests. 3168 ForceSendFields []string `json:"-"` 3169 3170 // NullFields is a list of field names (e.g. "ConsumerDestinations") to 3171 // include in API requests with the JSON null value. By default, fields 3172 // with empty values are omitted from API requests. However, any field 3173 // with an empty value appearing in NullFields will be sent to the 3174 // server as null. It is an error if a field in this list has a 3175 // non-empty value. This may be used to include null fields in Patch 3176 // requests. 3177 NullFields []string `json:"-"` 3178} 3179 3180func (s *Monitoring) MarshalJSON() ([]byte, error) { 3181 type NoMethod Monitoring 3182 raw := NoMethod(*s) 3183 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3184} 3185 3186// MonitoringDestination: Configuration of a specific monitoring 3187// destination (the producer project 3188// or the consumer project). 3189type MonitoringDestination struct { 3190 // Metrics: Types of the metrics to report to this monitoring 3191 // destination. 3192 // Each type must be defined in Service.metrics section. 3193 Metrics []string `json:"metrics,omitempty"` 3194 3195 // MonitoredResource: The monitored resource type. The type must be 3196 // defined in 3197 // Service.monitored_resources section. 3198 MonitoredResource string `json:"monitoredResource,omitempty"` 3199 3200 // ForceSendFields is a list of field names (e.g. "Metrics") to 3201 // unconditionally include in API requests. By default, fields with 3202 // empty values are omitted from API requests. However, any non-pointer, 3203 // non-interface field appearing in ForceSendFields will be sent to the 3204 // server regardless of whether the field is empty or not. This may be 3205 // used to include empty fields in Patch requests. 3206 ForceSendFields []string `json:"-"` 3207 3208 // NullFields is a list of field names (e.g. "Metrics") to include in 3209 // API requests with the JSON null value. By default, fields with empty 3210 // values are omitted from API requests. However, any field with an 3211 // empty value appearing in NullFields will be sent to the server as 3212 // null. It is an error if a field in this list has a non-empty value. 3213 // This may be used to include null fields in Patch requests. 3214 NullFields []string `json:"-"` 3215} 3216 3217func (s *MonitoringDestination) MarshalJSON() ([]byte, error) { 3218 type NoMethod MonitoringDestination 3219 raw := NoMethod(*s) 3220 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3221} 3222 3223// OAuthRequirements: OAuth scopes are a way to define data and 3224// permissions on data. For example, 3225// there are scopes defined for "Read-only access to Google Calendar" 3226// and 3227// "Access to Cloud Platform". Users can consent to a scope for an 3228// application, 3229// giving it permission to access that data on their behalf. 3230// 3231// OAuth scope specifications should be fairly coarse grained; a user 3232// will need 3233// to see and understand the text description of what your scope 3234// means. 3235// 3236// In most cases: use one or at most two OAuth scopes for an entire 3237// family of 3238// products. If your product has multiple APIs, you should probably be 3239// sharing 3240// the OAuth scope across all of those APIs. 3241// 3242// When you need finer grained OAuth consent screens: talk with your 3243// product 3244// management about how developers will use them in practice. 3245// 3246// Please note that even though each of the canonical scopes is enough 3247// for a 3248// request to be accepted and passed to the backend, a request can still 3249// fail 3250// due to the backend requiring additional scopes or permissions. 3251type OAuthRequirements struct { 3252 // CanonicalScopes: The list of publicly documented OAuth scopes that 3253 // are allowed access. An 3254 // OAuth token containing any of these scopes will be 3255 // accepted. 3256 // 3257 // Example: 3258 // 3259 // canonical_scopes: https://www.googleapis.com/auth/calendar, 3260 // https://www.googleapis.com/auth/calendar.read 3261 CanonicalScopes string `json:"canonicalScopes,omitempty"` 3262 3263 // ForceSendFields is a list of field names (e.g. "CanonicalScopes") to 3264 // unconditionally include in API requests. By default, fields with 3265 // empty values are omitted from API requests. However, any non-pointer, 3266 // non-interface field appearing in ForceSendFields will be sent to the 3267 // server regardless of whether the field is empty or not. This may be 3268 // used to include empty fields in Patch requests. 3269 ForceSendFields []string `json:"-"` 3270 3271 // NullFields is a list of field names (e.g. "CanonicalScopes") to 3272 // include in API requests with the JSON null value. By default, fields 3273 // with empty values are omitted from API requests. However, any field 3274 // with an empty value appearing in NullFields will be sent to the 3275 // server as null. It is an error if a field in this list has a 3276 // non-empty value. This may be used to include null fields in Patch 3277 // requests. 3278 NullFields []string `json:"-"` 3279} 3280 3281func (s *OAuthRequirements) MarshalJSON() ([]byte, error) { 3282 type NoMethod OAuthRequirements 3283 raw := NoMethod(*s) 3284 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3285} 3286 3287// Operation: This resource represents a long-running operation that is 3288// the result of a 3289// network API call. 3290type Operation struct { 3291 // Done: If the value is `false`, it means the operation is still in 3292 // progress. 3293 // If `true`, the operation is completed, and either `error` or 3294 // `response` is 3295 // available. 3296 Done bool `json:"done,omitempty"` 3297 3298 // Error: The error result of the operation in case of failure or 3299 // cancellation. 3300 Error *Status `json:"error,omitempty"` 3301 3302 // Metadata: Service-specific metadata associated with the operation. 3303 // It typically 3304 // contains progress information and common metadata such as create 3305 // time. 3306 // Some services might not provide such metadata. Any method that 3307 // returns a 3308 // long-running operation should document the metadata type, if any. 3309 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 3310 3311 // Name: The server-assigned name, which is only unique within the same 3312 // service that 3313 // originally returns it. If you use the default HTTP mapping, 3314 // the 3315 // `name` should be a resource name ending with 3316 // `operations/{unique_id}`. 3317 Name string `json:"name,omitempty"` 3318 3319 // Response: The normal response of the operation in case of success. 3320 // If the original 3321 // method returns no data on success, such as `Delete`, the response 3322 // is 3323 // `google.protobuf.Empty`. If the original method is 3324 // standard 3325 // `Get`/`Create`/`Update`, the response should be the resource. For 3326 // other 3327 // methods, the response should have the type `XxxResponse`, where 3328 // `Xxx` 3329 // is the original method name. For example, if the original method 3330 // name 3331 // is `TakeSnapshot()`, the inferred response type 3332 // is 3333 // `TakeSnapshotResponse`. 3334 Response googleapi.RawMessage `json:"response,omitempty"` 3335 3336 // ServerResponse contains the HTTP response code and headers from the 3337 // server. 3338 googleapi.ServerResponse `json:"-"` 3339 3340 // ForceSendFields is a list of field names (e.g. "Done") to 3341 // unconditionally include in API requests. By default, fields with 3342 // empty values are omitted from API requests. However, any non-pointer, 3343 // non-interface field appearing in ForceSendFields will be sent to the 3344 // server regardless of whether the field is empty or not. This may be 3345 // used to include empty fields in Patch requests. 3346 ForceSendFields []string `json:"-"` 3347 3348 // NullFields is a list of field names (e.g. "Done") to include in API 3349 // requests with the JSON null value. By default, fields with empty 3350 // values are omitted from API requests. However, any field with an 3351 // empty value appearing in NullFields will be sent to the server as 3352 // null. It is an error if a field in this list has a non-empty value. 3353 // This may be used to include null fields in Patch requests. 3354 NullFields []string `json:"-"` 3355} 3356 3357func (s *Operation) MarshalJSON() ([]byte, error) { 3358 type NoMethod Operation 3359 raw := NoMethod(*s) 3360 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3361} 3362 3363// Option: A protocol buffer option, which can be attached to a message, 3364// field, 3365// enumeration, etc. 3366type Option struct { 3367 // Name: The option's name. For protobuf built-in options (options 3368 // defined in 3369 // descriptor.proto), this is the short name. For example, 3370 // "map_entry". 3371 // For custom options, it should be the fully-qualified name. For 3372 // example, 3373 // "google.api.http". 3374 Name string `json:"name,omitempty"` 3375 3376 // Value: The option's value packed in an Any message. If the value is a 3377 // primitive, 3378 // the corresponding wrapper type defined in 3379 // google/protobuf/wrappers.proto 3380 // should be used. If the value is an enum, it should be stored as an 3381 // int32 3382 // value using the google.protobuf.Int32Value type. 3383 Value googleapi.RawMessage `json:"value,omitempty"` 3384 3385 // ForceSendFields is a list of field names (e.g. "Name") to 3386 // unconditionally include in API requests. By default, fields with 3387 // empty values are omitted from API requests. However, any non-pointer, 3388 // non-interface field appearing in ForceSendFields will be sent to the 3389 // server regardless of whether the field is empty or not. This may be 3390 // used to include empty fields in Patch requests. 3391 ForceSendFields []string `json:"-"` 3392 3393 // NullFields is a list of field names (e.g. "Name") to include in API 3394 // requests with the JSON null value. By default, fields with empty 3395 // values are omitted from API requests. However, any field with an 3396 // empty value appearing in NullFields will be sent to the server as 3397 // null. It is an error if a field in this list has a non-empty value. 3398 // This may be used to include null fields in Patch requests. 3399 NullFields []string `json:"-"` 3400} 3401 3402func (s *Option) MarshalJSON() ([]byte, error) { 3403 type NoMethod Option 3404 raw := NoMethod(*s) 3405 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3406} 3407 3408// Page: Represents a documentation page. A page can contain subpages to 3409// represent 3410// nested documentation set structure. 3411type Page struct { 3412 // Content: The Markdown content of the page. You can use <code>(== 3413 // include {path} 3414 // ==)</code> to include content from a Markdown file. 3415 Content string `json:"content,omitempty"` 3416 3417 // Name: The name of the page. It will be used as an identity of the 3418 // page to 3419 // generate URI of the page, text of the link to this page in 3420 // navigation, 3421 // etc. The full page name (start from the root page name to this 3422 // page 3423 // concatenated with `.`) can be used as reference to the page in 3424 // your 3425 // documentation. For example: 3426 // <pre><code>pages: 3427 // - name: Tutorial 3428 // content: (== include tutorial.md ==) 3429 // subpages: 3430 // - name: Java 3431 // content: (== include tutorial_java.md 3432 // ==) 3433 // </code></pre> 3434 // You can reference `Java` page using Markdown reference link 3435 // syntax: 3436 // `Java`. 3437 Name string `json:"name,omitempty"` 3438 3439 // Subpages: Subpages of this page. The order of subpages specified here 3440 // will be 3441 // honored in the generated docset. 3442 Subpages []*Page `json:"subpages,omitempty"` 3443 3444 // ForceSendFields is a list of field names (e.g. "Content") to 3445 // unconditionally include in API requests. By default, fields with 3446 // empty values are omitted from API requests. However, any non-pointer, 3447 // non-interface field appearing in ForceSendFields will be sent to the 3448 // server regardless of whether the field is empty or not. This may be 3449 // used to include empty fields in Patch requests. 3450 ForceSendFields []string `json:"-"` 3451 3452 // NullFields is a list of field names (e.g. "Content") to include in 3453 // API requests with the JSON null value. By default, fields with empty 3454 // values are omitted from API requests. However, any field with an 3455 // empty value appearing in NullFields will be sent to the server as 3456 // null. It is an error if a field in this list has a non-empty value. 3457 // This may be used to include null fields in Patch requests. 3458 NullFields []string `json:"-"` 3459} 3460 3461func (s *Page) MarshalJSON() ([]byte, error) { 3462 type NoMethod Page 3463 raw := NoMethod(*s) 3464 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3465} 3466 3467// Quota: Quota configuration helps to achieve fairness and budgeting in 3468// service 3469// usage. 3470// 3471// The metric based quota configuration works this way: 3472// - The service configuration defines a set of metrics. 3473// - For API calls, the quota.metric_rules maps methods to metrics with 3474// corresponding costs. 3475// - The quota.limits defines limits on the metrics, which will be used 3476// for 3477// quota checks at runtime. 3478// 3479// An example quota configuration in yaml format: 3480// 3481// quota: 3482// limits: 3483// 3484// - name: apiWriteQpsPerProject 3485// metric: library.googleapis.com/write_calls 3486// unit: "1/min/{project}" # rate limit for consumer projects 3487// values: 3488// STANDARD: 10000 3489// 3490// 3491// # The metric rules bind all methods to the read_calls metric, 3492// # except for the UpdateBook and DeleteBook methods. These two 3493// methods 3494// # are mapped to the write_calls metric, with the UpdateBook 3495// method 3496// # consuming at twice rate as the DeleteBook method. 3497// metric_rules: 3498// - selector: "*" 3499// metric_costs: 3500// library.googleapis.com/read_calls: 1 3501// - selector: google.example.library.v1.LibraryService.UpdateBook 3502// metric_costs: 3503// library.googleapis.com/write_calls: 2 3504// - selector: google.example.library.v1.LibraryService.DeleteBook 3505// metric_costs: 3506// library.googleapis.com/write_calls: 1 3507// 3508// Corresponding Metric definition: 3509// 3510// metrics: 3511// - name: library.googleapis.com/read_calls 3512// display_name: Read requests 3513// metric_kind: DELTA 3514// value_type: INT64 3515// 3516// - name: library.googleapis.com/write_calls 3517// display_name: Write requests 3518// metric_kind: DELTA 3519// value_type: INT64 3520// 3521// 3522type Quota struct { 3523 // Limits: List of `QuotaLimit` definitions for the service. 3524 Limits []*QuotaLimit `json:"limits,omitempty"` 3525 3526 // MetricRules: List of `MetricRule` definitions, each one mapping a 3527 // selected method to one 3528 // or more metrics. 3529 MetricRules []*MetricRule `json:"metricRules,omitempty"` 3530 3531 // ForceSendFields is a list of field names (e.g. "Limits") to 3532 // unconditionally include in API requests. By default, fields with 3533 // empty values are omitted from API requests. However, any non-pointer, 3534 // non-interface field appearing in ForceSendFields will be sent to the 3535 // server regardless of whether the field is empty or not. This may be 3536 // used to include empty fields in Patch requests. 3537 ForceSendFields []string `json:"-"` 3538 3539 // NullFields is a list of field names (e.g. "Limits") to include in API 3540 // requests with the JSON null value. By default, fields with empty 3541 // values are omitted from API requests. However, any field with an 3542 // empty value appearing in NullFields will be sent to the server as 3543 // null. It is an error if a field in this list has a non-empty value. 3544 // This may be used to include null fields in Patch requests. 3545 NullFields []string `json:"-"` 3546} 3547 3548func (s *Quota) MarshalJSON() ([]byte, error) { 3549 type NoMethod Quota 3550 raw := NoMethod(*s) 3551 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3552} 3553 3554// QuotaLimit: `QuotaLimit` defines a specific limit that applies over a 3555// specified duration 3556// for a limit type. There can be at most one limit for a duration and 3557// limit 3558// type combination defined within a `QuotaGroup`. 3559type QuotaLimit struct { 3560 // DefaultLimit: Default number of tokens that can be consumed during 3561 // the specified 3562 // duration. This is the number of tokens assigned when a 3563 // client 3564 // application developer activates the service for his/her 3565 // project. 3566 // 3567 // Specifying a value of 0 will block all requests. This can be used if 3568 // you 3569 // are provisioning quota to selected consumers and blocking 3570 // others. 3571 // Similarly, a value of -1 will indicate an unlimited quota. No 3572 // other 3573 // negative values are allowed. 3574 // 3575 // Used by group-based quotas only. 3576 DefaultLimit int64 `json:"defaultLimit,omitempty,string"` 3577 3578 // Description: Optional. User-visible, extended description for this 3579 // quota limit. 3580 // Should be used only when more context is needed to understand this 3581 // limit 3582 // than provided by the limit's display name (see: `display_name`). 3583 Description string `json:"description,omitempty"` 3584 3585 // DisplayName: User-visible display name for this limit. 3586 // Optional. If not set, the UI will provide a default display name 3587 // based on 3588 // the quota configuration. This field can be used to override the 3589 // default 3590 // display name generated from the configuration. 3591 DisplayName string `json:"displayName,omitempty"` 3592 3593 // Duration: Duration of this limit in textual notation. Example: 3594 // "100s", "24h", "1d". 3595 // For duration longer than a day, only multiple of days is supported. 3596 // We 3597 // support only "100s" and "1d" for now. Additional support will be 3598 // added in 3599 // the future. "0" indicates indefinite duration. 3600 // 3601 // Used by group-based quotas only. 3602 Duration string `json:"duration,omitempty"` 3603 3604 // FreeTier: Free tier value displayed in the Developers Console for 3605 // this limit. 3606 // The free tier is the number of tokens that will be subtracted from 3607 // the 3608 // billed amount when billing is enabled. 3609 // This field can only be set on a limit with duration "1d", in a 3610 // billable 3611 // group; it is invalid on any other limit. If this field is not set, 3612 // it 3613 // defaults to 0, indicating that there is no free tier for this 3614 // service. 3615 // 3616 // Used by group-based quotas only. 3617 FreeTier int64 `json:"freeTier,omitempty,string"` 3618 3619 // MaxLimit: Maximum number of tokens that can be consumed during the 3620 // specified 3621 // duration. Client application developers can override the default 3622 // limit up 3623 // to this maximum. If specified, this value cannot be set to a value 3624 // less 3625 // than the default limit. If not specified, it is set to the default 3626 // limit. 3627 // 3628 // To allow clients to apply overrides with no upper bound, set this to 3629 // -1, 3630 // indicating unlimited maximum quota. 3631 // 3632 // Used by group-based quotas only. 3633 MaxLimit int64 `json:"maxLimit,omitempty,string"` 3634 3635 // Metric: The name of the metric this quota limit applies to. The quota 3636 // limits with 3637 // the same metric will be checked together during runtime. The metric 3638 // must be 3639 // defined within the service config. 3640 Metric string `json:"metric,omitempty"` 3641 3642 // Name: Name of the quota limit. 3643 // 3644 // The name must be provided, and it must be unique within the service. 3645 // The 3646 // name can only include alphanumeric characters as well as '-'. 3647 // 3648 // The maximum length of the limit name is 64 characters. 3649 Name string `json:"name,omitempty"` 3650 3651 // Unit: Specify the unit of the quota limit. It uses the same syntax 3652 // as 3653 // Metric.unit. The supported unit kinds are determined by the 3654 // quota 3655 // backend system. 3656 // 3657 // Here are some examples: 3658 // * "1/min/{project}" for quota per minute per project. 3659 // 3660 // Note: the order of unit components is insignificant. 3661 // The "1" at the beginning is required to follow the metric unit 3662 // syntax. 3663 Unit string `json:"unit,omitempty"` 3664 3665 // Values: Tiered limit values. You must specify this as a key:value 3666 // pair, with an 3667 // integer value that is the maximum number of requests allowed for 3668 // the 3669 // specified unit. Currently only STANDARD is supported. 3670 Values map[string]string `json:"values,omitempty"` 3671 3672 // ForceSendFields is a list of field names (e.g. "DefaultLimit") to 3673 // unconditionally include in API requests. By default, fields with 3674 // empty values are omitted from API requests. However, any non-pointer, 3675 // non-interface field appearing in ForceSendFields will be sent to the 3676 // server regardless of whether the field is empty or not. This may be 3677 // used to include empty fields in Patch requests. 3678 ForceSendFields []string `json:"-"` 3679 3680 // NullFields is a list of field names (e.g. "DefaultLimit") to include 3681 // in API requests with the JSON null value. By default, fields with 3682 // empty values are omitted from API requests. However, any field with 3683 // an empty value appearing in NullFields will be sent to the server as 3684 // null. It is an error if a field in this list has a non-empty value. 3685 // This may be used to include null fields in Patch requests. 3686 NullFields []string `json:"-"` 3687} 3688 3689func (s *QuotaLimit) MarshalJSON() ([]byte, error) { 3690 type NoMethod QuotaLimit 3691 raw := NoMethod(*s) 3692 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3693} 3694 3695// Range: Represents a found unused range. 3696type Range struct { 3697 // IpCidrRange: CIDR range in "10.x.x.x/y" format that is within 3698 // the 3699 // allocated ranges and currently unused. 3700 IpCidrRange string `json:"ipCidrRange,omitempty"` 3701 3702 // Network: In the Shared VPC host project, the VPC network that's 3703 // peered with the 3704 // consumer network. For 3705 // example: 3706 // `projects/1234321/global/networks/host-network` 3707 Network string `json:"network,omitempty"` 3708 3709 // ForceSendFields is a list of field names (e.g. "IpCidrRange") to 3710 // unconditionally include in API requests. By default, fields with 3711 // empty values are omitted from API requests. However, any non-pointer, 3712 // non-interface field appearing in ForceSendFields will be sent to the 3713 // server regardless of whether the field is empty or not. This may be 3714 // used to include empty fields in Patch requests. 3715 ForceSendFields []string `json:"-"` 3716 3717 // NullFields is a list of field names (e.g. "IpCidrRange") to include 3718 // in API requests with the JSON null value. By default, fields with 3719 // empty values are omitted from API requests. However, any field with 3720 // an empty value appearing in NullFields will be sent to the server as 3721 // null. It is an error if a field in this list has a non-empty value. 3722 // This may be used to include null fields in Patch requests. 3723 NullFields []string `json:"-"` 3724} 3725 3726func (s *Range) MarshalJSON() ([]byte, error) { 3727 type NoMethod Range 3728 raw := NoMethod(*s) 3729 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3730} 3731 3732// SearchRangeRequest: Request to search for an unused range within 3733// allocated ranges. 3734type SearchRangeRequest struct { 3735 // IpPrefixLength: Required. The prefix length of the IP range. 3736 // Use usual CIDR range notation. 3737 // For example, '30' to find unused x.x.x.x/30 CIDR range. 3738 // Actual range will be determined using allocated range for the 3739 // consumer 3740 // peered network and returned in the result. 3741 IpPrefixLength int64 `json:"ipPrefixLength,omitempty"` 3742 3743 // Network: Network name in the consumer project. This network must 3744 // have been 3745 // already peered with a shared VPC network using 3746 // CreateConnection 3747 // method. 3748 // Must be in a form 3749 // 'projects/{project}/global/networks/{network}'. 3750 // {project} is a project number, as in '12345' 3751 // {network} is network name. 3752 Network string `json:"network,omitempty"` 3753 3754 // ForceSendFields is a list of field names (e.g. "IpPrefixLength") to 3755 // unconditionally include in API requests. By default, fields with 3756 // empty values are omitted from API requests. However, any non-pointer, 3757 // non-interface field appearing in ForceSendFields will be sent to the 3758 // server regardless of whether the field is empty or not. This may be 3759 // used to include empty fields in Patch requests. 3760 ForceSendFields []string `json:"-"` 3761 3762 // NullFields is a list of field names (e.g. "IpPrefixLength") to 3763 // include in API requests with the JSON null value. By default, fields 3764 // with empty values are omitted from API requests. However, any field 3765 // with an empty value appearing in NullFields will be sent to the 3766 // server as null. It is an error if a field in this list has a 3767 // non-empty value. This may be used to include null fields in Patch 3768 // requests. 3769 NullFields []string `json:"-"` 3770} 3771 3772func (s *SearchRangeRequest) MarshalJSON() ([]byte, error) { 3773 type NoMethod SearchRangeRequest 3774 raw := NoMethod(*s) 3775 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3776} 3777 3778// Service: `Service` is the root object of Google service configuration 3779// schema. It 3780// describes basic information about a service, such as the name and 3781// the 3782// title, and delegates other aspects to sub-sections. Each sub-section 3783// is 3784// either a proto message or a repeated proto message that configures 3785// a 3786// specific aspect, such as auth. See each proto message definition for 3787// details. 3788// 3789// Example: 3790// 3791// type: google.api.Service 3792// config_version: 3 3793// name: calendar.googleapis.com 3794// title: Google Calendar API 3795// apis: 3796// - name: google.calendar.v3.Calendar 3797// authentication: 3798// providers: 3799// - id: google_calendar_auth 3800// jwks_uri: https://www.googleapis.com/oauth2/v1/certs 3801// issuer: https://securetoken.google.com 3802// rules: 3803// - selector: "*" 3804// requirements: 3805// provider_id: google_calendar_auth 3806type Service struct { 3807 // Apis: A list of API interfaces exported by this service. Only the 3808 // `name` field 3809 // of the google.protobuf.Api needs to be provided by the 3810 // configuration 3811 // author, as the remaining fields will be derived from the IDL during 3812 // the 3813 // normalization process. It is an error to specify an API interface 3814 // here 3815 // which cannot be resolved against the associated IDL files. 3816 Apis []*Api `json:"apis,omitempty"` 3817 3818 // Authentication: Auth configuration. 3819 Authentication *Authentication `json:"authentication,omitempty"` 3820 3821 // Backend: API backend configuration. 3822 Backend *Backend `json:"backend,omitempty"` 3823 3824 // Billing: Billing configuration. 3825 Billing *Billing `json:"billing,omitempty"` 3826 3827 // ConfigVersion: The semantic version of the service configuration. The 3828 // config version 3829 // affects the interpretation of the service configuration. For 3830 // example, 3831 // certain features are enabled by default for certain config 3832 // versions. 3833 // The latest config version is `3`. 3834 ConfigVersion int64 `json:"configVersion,omitempty"` 3835 3836 // Context: Context configuration. 3837 Context *Context `json:"context,omitempty"` 3838 3839 // Control: Configuration for the service control plane. 3840 Control *Control `json:"control,omitempty"` 3841 3842 // CustomError: Custom error configuration. 3843 CustomError *CustomError `json:"customError,omitempty"` 3844 3845 // Documentation: Additional API documentation. 3846 Documentation *Documentation `json:"documentation,omitempty"` 3847 3848 // Endpoints: Configuration for network endpoints. If this is empty, 3849 // then an endpoint 3850 // with the same name as the service is automatically generated to 3851 // service all 3852 // defined APIs. 3853 Endpoints []*Endpoint `json:"endpoints,omitempty"` 3854 3855 // Enums: A list of all enum types included in this API service. 3856 // Enums 3857 // referenced directly or indirectly by the `apis` are 3858 // automatically 3859 // included. Enums which are not referenced but shall be 3860 // included 3861 // should be listed here by name. Example: 3862 // 3863 // enums: 3864 // - name: google.someapi.v1.SomeEnum 3865 Enums []*Enum `json:"enums,omitempty"` 3866 3867 // Http: HTTP configuration. 3868 Http *Http `json:"http,omitempty"` 3869 3870 // Id: A unique ID for a specific instance of this message, typically 3871 // assigned 3872 // by the client for tracking purpose. If empty, the server may choose 3873 // to 3874 // generate one instead. Must be no longer than 60 characters. 3875 Id string `json:"id,omitempty"` 3876 3877 // Logging: Logging configuration. 3878 Logging *Logging `json:"logging,omitempty"` 3879 3880 // Logs: Defines the logs used by this service. 3881 Logs []*LogDescriptor `json:"logs,omitempty"` 3882 3883 // Metrics: Defines the metrics used by this service. 3884 Metrics []*MetricDescriptor `json:"metrics,omitempty"` 3885 3886 // MonitoredResources: Defines the monitored resources used by this 3887 // service. This is required 3888 // by the Service.monitoring and Service.logging configurations. 3889 MonitoredResources []*MonitoredResourceDescriptor `json:"monitoredResources,omitempty"` 3890 3891 // Monitoring: Monitoring configuration. 3892 Monitoring *Monitoring `json:"monitoring,omitempty"` 3893 3894 // Name: The service name, which is a DNS-like logical identifier for 3895 // the 3896 // service, such as `calendar.googleapis.com`. The service 3897 // name 3898 // typically goes through DNS verification to make sure the owner 3899 // of the service also owns the DNS name. 3900 Name string `json:"name,omitempty"` 3901 3902 // ProducerProjectId: The Google project that owns this service. 3903 ProducerProjectId string `json:"producerProjectId,omitempty"` 3904 3905 // Quota: Quota configuration. 3906 Quota *Quota `json:"quota,omitempty"` 3907 3908 // SourceInfo: Output only. The source information for this 3909 // configuration if available. 3910 SourceInfo *SourceInfo `json:"sourceInfo,omitempty"` 3911 3912 // SystemParameters: System parameter configuration. 3913 SystemParameters *SystemParameters `json:"systemParameters,omitempty"` 3914 3915 // SystemTypes: A list of all proto message types included in this API 3916 // service. 3917 // It serves similar purpose as [google.api.Service.types], except 3918 // that 3919 // these types are not needed by user-defined APIs. Therefore, they will 3920 // not 3921 // show up in the generated discovery doc. This field should only be 3922 // used 3923 // to define system APIs in ESF. 3924 SystemTypes []*Type `json:"systemTypes,omitempty"` 3925 3926 // Title: The product title for this service. 3927 Title string `json:"title,omitempty"` 3928 3929 // Types: A list of all proto message types included in this API 3930 // service. 3931 // Types referenced directly or indirectly by the `apis` 3932 // are 3933 // automatically included. Messages which are not referenced but 3934 // shall be included, such as types used by the `google.protobuf.Any` 3935 // type, 3936 // should be listed here by name. Example: 3937 // 3938 // types: 3939 // - name: google.protobuf.Int32 3940 Types []*Type `json:"types,omitempty"` 3941 3942 // Usage: Configuration controlling usage of this service. 3943 Usage *Usage `json:"usage,omitempty"` 3944 3945 // ForceSendFields is a list of field names (e.g. "Apis") to 3946 // unconditionally include in API requests. By default, fields with 3947 // empty values are omitted from API requests. However, any non-pointer, 3948 // non-interface field appearing in ForceSendFields will be sent to the 3949 // server regardless of whether the field is empty or not. This may be 3950 // used to include empty fields in Patch requests. 3951 ForceSendFields []string `json:"-"` 3952 3953 // NullFields is a list of field names (e.g. "Apis") to include in API 3954 // requests with the JSON null value. By default, fields with empty 3955 // values are omitted from API requests. However, any field with an 3956 // empty value appearing in NullFields will be sent to the server as 3957 // null. It is an error if a field in this list has a non-empty value. 3958 // This may be used to include null fields in Patch requests. 3959 NullFields []string `json:"-"` 3960} 3961 3962func (s *Service) MarshalJSON() ([]byte, error) { 3963 type NoMethod Service 3964 raw := NoMethod(*s) 3965 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3966} 3967 3968// SourceContext: `SourceContext` represents information about the 3969// source of a 3970// protobuf element, like the file in which it is defined. 3971type SourceContext struct { 3972 // FileName: The path-qualified name of the .proto file that contained 3973 // the associated 3974 // protobuf element. For example: 3975 // "google/protobuf/source_context.proto". 3976 FileName string `json:"fileName,omitempty"` 3977 3978 // ForceSendFields is a list of field names (e.g. "FileName") to 3979 // unconditionally include in API requests. By default, fields with 3980 // empty values are omitted from API requests. However, any non-pointer, 3981 // non-interface field appearing in ForceSendFields will be sent to the 3982 // server regardless of whether the field is empty or not. This may be 3983 // used to include empty fields in Patch requests. 3984 ForceSendFields []string `json:"-"` 3985 3986 // NullFields is a list of field names (e.g. "FileName") to include in 3987 // API requests with the JSON null value. By default, fields with empty 3988 // values are omitted from API requests. However, any field with an 3989 // empty value appearing in NullFields will be sent to the server as 3990 // null. It is an error if a field in this list has a non-empty value. 3991 // This may be used to include null fields in Patch requests. 3992 NullFields []string `json:"-"` 3993} 3994 3995func (s *SourceContext) MarshalJSON() ([]byte, error) { 3996 type NoMethod SourceContext 3997 raw := NoMethod(*s) 3998 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3999} 4000 4001// SourceInfo: Source information used to create a Service Config 4002type SourceInfo struct { 4003 // SourceFiles: All files used during config generation. 4004 SourceFiles []googleapi.RawMessage `json:"sourceFiles,omitempty"` 4005 4006 // ForceSendFields is a list of field names (e.g. "SourceFiles") to 4007 // unconditionally include in API requests. By default, fields with 4008 // empty values are omitted from API requests. However, any non-pointer, 4009 // non-interface field appearing in ForceSendFields will be sent to the 4010 // server regardless of whether the field is empty or not. This may be 4011 // used to include empty fields in Patch requests. 4012 ForceSendFields []string `json:"-"` 4013 4014 // NullFields is a list of field names (e.g. "SourceFiles") to include 4015 // in API requests with the JSON null value. By default, fields with 4016 // empty values are omitted from API requests. However, any field with 4017 // an empty value appearing in NullFields will be sent to the server as 4018 // null. It is an error if a field in this list has a non-empty value. 4019 // This may be used to include null fields in Patch requests. 4020 NullFields []string `json:"-"` 4021} 4022 4023func (s *SourceInfo) MarshalJSON() ([]byte, error) { 4024 type NoMethod SourceInfo 4025 raw := NoMethod(*s) 4026 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4027} 4028 4029// Status: The `Status` type defines a logical error model that is 4030// suitable for 4031// different programming environments, including REST APIs and RPC APIs. 4032// It is 4033// used by [gRPC](https://github.com/grpc). Each `Status` message 4034// contains 4035// three pieces of data: error code, error message, and error 4036// details. 4037// 4038// You can find out more about this error model and how to work with it 4039// in the 4040// [API Design Guide](https://cloud.google.com/apis/design/errors). 4041type Status struct { 4042 // Code: The status code, which should be an enum value of 4043 // google.rpc.Code. 4044 Code int64 `json:"code,omitempty"` 4045 4046 // Details: A list of messages that carry the error details. There is a 4047 // common set of 4048 // message types for APIs to use. 4049 Details []googleapi.RawMessage `json:"details,omitempty"` 4050 4051 // Message: A developer-facing error message, which should be in 4052 // English. Any 4053 // user-facing error message should be localized and sent in 4054 // the 4055 // google.rpc.Status.details field, or localized by the client. 4056 Message string `json:"message,omitempty"` 4057 4058 // ForceSendFields is a list of field names (e.g. "Code") to 4059 // unconditionally include in API requests. By default, fields with 4060 // empty values are omitted from API requests. However, any non-pointer, 4061 // non-interface field appearing in ForceSendFields will be sent to the 4062 // server regardless of whether the field is empty or not. This may be 4063 // used to include empty fields in Patch requests. 4064 ForceSendFields []string `json:"-"` 4065 4066 // NullFields is a list of field names (e.g. "Code") to include in API 4067 // requests with the JSON null value. By default, fields with empty 4068 // values are omitted from API requests. However, any field with an 4069 // empty value appearing in NullFields will be sent to the server as 4070 // null. It is an error if a field in this list has a non-empty value. 4071 // This may be used to include null fields in Patch requests. 4072 NullFields []string `json:"-"` 4073} 4074 4075func (s *Status) MarshalJSON() ([]byte, error) { 4076 type NoMethod Status 4077 raw := NoMethod(*s) 4078 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4079} 4080 4081// Subnetwork: Represents a subnet that was created or discovered by a 4082// private access 4083// management service. 4084type Subnetwork struct { 4085 // IpCidrRange: Subnetwork CIDR range in `10.x.x.x/y` format. 4086 IpCidrRange string `json:"ipCidrRange,omitempty"` 4087 4088 // Name: Subnetwork name. 4089 // See https://cloud.google.com/compute/docs/vpc/ 4090 Name string `json:"name,omitempty"` 4091 4092 // Network: In the Shared VPC host project, the VPC network that's 4093 // peered with the 4094 // consumer network. For 4095 // example: 4096 // `projects/1234321/global/networks/host-network` 4097 Network string `json:"network,omitempty"` 4098 4099 // OutsideAllocation: This is a discovered subnet that is not within the 4100 // current consumer 4101 // allocated ranges. 4102 OutsideAllocation bool `json:"outsideAllocation,omitempty"` 4103 4104 // ForceSendFields is a list of field names (e.g. "IpCidrRange") to 4105 // unconditionally include in API requests. By default, fields with 4106 // empty values are omitted from API requests. However, any non-pointer, 4107 // non-interface field appearing in ForceSendFields will be sent to the 4108 // server regardless of whether the field is empty or not. This may be 4109 // used to include empty fields in Patch requests. 4110 ForceSendFields []string `json:"-"` 4111 4112 // NullFields is a list of field names (e.g. "IpCidrRange") to include 4113 // in API requests with the JSON null value. By default, fields with 4114 // empty values are omitted from API requests. However, any field with 4115 // an empty value appearing in NullFields will be sent to the server as 4116 // null. It is an error if a field in this list has a non-empty value. 4117 // This may be used to include null fields in Patch requests. 4118 NullFields []string `json:"-"` 4119} 4120 4121func (s *Subnetwork) MarshalJSON() ([]byte, error) { 4122 type NoMethod Subnetwork 4123 raw := NoMethod(*s) 4124 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4125} 4126 4127// SystemParameter: Define a parameter's name and location. The 4128// parameter may be passed as either 4129// an HTTP header or a URL query parameter, and if both are passed the 4130// behavior 4131// is implementation-dependent. 4132type SystemParameter struct { 4133 // HttpHeader: Define the HTTP header name to use for the parameter. It 4134 // is case 4135 // insensitive. 4136 HttpHeader string `json:"httpHeader,omitempty"` 4137 4138 // Name: Define the name of the parameter, such as "api_key" . It is 4139 // case sensitive. 4140 Name string `json:"name,omitempty"` 4141 4142 // UrlQueryParameter: Define the URL query parameter name to use for the 4143 // parameter. It is case 4144 // sensitive. 4145 UrlQueryParameter string `json:"urlQueryParameter,omitempty"` 4146 4147 // ForceSendFields is a list of field names (e.g. "HttpHeader") to 4148 // unconditionally include in API requests. By default, fields with 4149 // empty values are omitted from API requests. However, any non-pointer, 4150 // non-interface field appearing in ForceSendFields will be sent to the 4151 // server regardless of whether the field is empty or not. This may be 4152 // used to include empty fields in Patch requests. 4153 ForceSendFields []string `json:"-"` 4154 4155 // NullFields is a list of field names (e.g. "HttpHeader") to include in 4156 // API requests with the JSON null value. By default, fields with empty 4157 // values are omitted from API requests. However, any field with an 4158 // empty value appearing in NullFields will be sent to the server as 4159 // null. It is an error if a field in this list has a non-empty value. 4160 // This may be used to include null fields in Patch requests. 4161 NullFields []string `json:"-"` 4162} 4163 4164func (s *SystemParameter) MarshalJSON() ([]byte, error) { 4165 type NoMethod SystemParameter 4166 raw := NoMethod(*s) 4167 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4168} 4169 4170// SystemParameterRule: Define a system parameter rule mapping system 4171// parameter definitions to 4172// methods. 4173type SystemParameterRule struct { 4174 // Parameters: Define parameters. Multiple names may be defined for a 4175 // parameter. 4176 // For a given method call, only one of them should be used. If 4177 // multiple 4178 // names are used the behavior is implementation-dependent. 4179 // If none of the specified names are present the behavior 4180 // is 4181 // parameter-dependent. 4182 Parameters []*SystemParameter `json:"parameters,omitempty"` 4183 4184 // Selector: Selects the methods to which this rule applies. Use '*' to 4185 // indicate all 4186 // methods in all APIs. 4187 // 4188 // Refer to selector for syntax details. 4189 Selector string `json:"selector,omitempty"` 4190 4191 // ForceSendFields is a list of field names (e.g. "Parameters") to 4192 // unconditionally include in API requests. By default, fields with 4193 // empty values are omitted from API requests. However, any non-pointer, 4194 // non-interface field appearing in ForceSendFields will be sent to the 4195 // server regardless of whether the field is empty or not. This may be 4196 // used to include empty fields in Patch requests. 4197 ForceSendFields []string `json:"-"` 4198 4199 // NullFields is a list of field names (e.g. "Parameters") to include in 4200 // API requests with the JSON null value. By default, fields with empty 4201 // values are omitted from API requests. However, any field with an 4202 // empty value appearing in NullFields will be sent to the server as 4203 // null. It is an error if a field in this list has a non-empty value. 4204 // This may be used to include null fields in Patch requests. 4205 NullFields []string `json:"-"` 4206} 4207 4208func (s *SystemParameterRule) MarshalJSON() ([]byte, error) { 4209 type NoMethod SystemParameterRule 4210 raw := NoMethod(*s) 4211 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4212} 4213 4214// SystemParameters: ### System parameter configuration 4215// 4216// A system parameter is a special kind of parameter defined by the 4217// API 4218// system, not by an individual API. It is typically mapped to an HTTP 4219// header 4220// and/or a URL query parameter. This configuration specifies which 4221// methods 4222// change the names of the system parameters. 4223type SystemParameters struct { 4224 // Rules: Define system parameters. 4225 // 4226 // The parameters defined here will override the default 4227 // parameters 4228 // implemented by the system. If this field is missing from the 4229 // service 4230 // config, default system parameters will be used. Default system 4231 // parameters 4232 // and names is implementation-dependent. 4233 // 4234 // Example: define api key for all methods 4235 // 4236 // system_parameters 4237 // rules: 4238 // - selector: "*" 4239 // parameters: 4240 // - name: api_key 4241 // url_query_parameter: api_key 4242 // 4243 // 4244 // Example: define 2 api key names for a specific method. 4245 // 4246 // system_parameters 4247 // rules: 4248 // - selector: "/ListShelves" 4249 // parameters: 4250 // - name: api_key 4251 // http_header: Api-Key1 4252 // - name: api_key 4253 // http_header: Api-Key2 4254 // 4255 // **NOTE:** All service configuration rules follow "last one wins" 4256 // order. 4257 Rules []*SystemParameterRule `json:"rules,omitempty"` 4258 4259 // ForceSendFields is a list of field names (e.g. "Rules") to 4260 // unconditionally include in API requests. By default, fields with 4261 // empty values are omitted from API requests. However, any non-pointer, 4262 // non-interface field appearing in ForceSendFields will be sent to the 4263 // server regardless of whether the field is empty or not. This may be 4264 // used to include empty fields in Patch requests. 4265 ForceSendFields []string `json:"-"` 4266 4267 // NullFields is a list of field names (e.g. "Rules") to include in API 4268 // requests with the JSON null value. By default, fields with empty 4269 // values are omitted from API requests. However, any field with an 4270 // empty value appearing in NullFields will be sent to the server as 4271 // null. It is an error if a field in this list has a non-empty value. 4272 // This may be used to include null fields in Patch requests. 4273 NullFields []string `json:"-"` 4274} 4275 4276func (s *SystemParameters) MarshalJSON() ([]byte, error) { 4277 type NoMethod SystemParameters 4278 raw := NoMethod(*s) 4279 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4280} 4281 4282// Type: A protocol buffer message type. 4283type Type struct { 4284 // Fields: The list of fields. 4285 Fields []*Field `json:"fields,omitempty"` 4286 4287 // Name: The fully qualified message name. 4288 Name string `json:"name,omitempty"` 4289 4290 // Oneofs: The list of types appearing in `oneof` definitions in this 4291 // type. 4292 Oneofs []string `json:"oneofs,omitempty"` 4293 4294 // Options: The protocol buffer options. 4295 Options []*Option `json:"options,omitempty"` 4296 4297 // SourceContext: The source context. 4298 SourceContext *SourceContext `json:"sourceContext,omitempty"` 4299 4300 // Syntax: The source syntax. 4301 // 4302 // Possible values: 4303 // "SYNTAX_PROTO2" - Syntax `proto2`. 4304 // "SYNTAX_PROTO3" - Syntax `proto3`. 4305 Syntax string `json:"syntax,omitempty"` 4306 4307 // ForceSendFields is a list of field names (e.g. "Fields") to 4308 // unconditionally include in API requests. By default, fields with 4309 // empty values are omitted from API requests. However, any non-pointer, 4310 // non-interface field appearing in ForceSendFields will be sent to the 4311 // server regardless of whether the field is empty or not. This may be 4312 // used to include empty fields in Patch requests. 4313 ForceSendFields []string `json:"-"` 4314 4315 // NullFields is a list of field names (e.g. "Fields") to include in API 4316 // requests with the JSON null value. By default, fields with empty 4317 // values are omitted from API requests. However, any field with an 4318 // empty value appearing in NullFields will be sent to the server as 4319 // null. It is an error if a field in this list has a non-empty value. 4320 // This may be used to include null fields in Patch requests. 4321 NullFields []string `json:"-"` 4322} 4323 4324func (s *Type) MarshalJSON() ([]byte, error) { 4325 type NoMethod Type 4326 raw := NoMethod(*s) 4327 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4328} 4329 4330// Usage: Configuration controlling usage of a service. 4331type Usage struct { 4332 // ProducerNotificationChannel: The full resource name of a channel used 4333 // for sending notifications to the 4334 // service producer. 4335 // 4336 // Google Service Management currently only supports 4337 // [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a 4338 // notification 4339 // channel. To use Google Cloud Pub/Sub as the channel, this must be the 4340 // name 4341 // of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name 4342 // format 4343 // documented in https://cloud.google.com/pubsub/docs/overview. 4344 ProducerNotificationChannel string `json:"producerNotificationChannel,omitempty"` 4345 4346 // Requirements: Requirements that must be satisfied before a consumer 4347 // project can use the 4348 // service. Each requirement is of the form 4349 // <service.name>/<requirement-id>; 4350 // for example 'serviceusage.googleapis.com/billing-enabled'. 4351 Requirements []string `json:"requirements,omitempty"` 4352 4353 // Rules: A list of usage rules that apply to individual API 4354 // methods. 4355 // 4356 // **NOTE:** All service configuration rules follow "last one wins" 4357 // order. 4358 Rules []*UsageRule `json:"rules,omitempty"` 4359 4360 // ForceSendFields is a list of field names (e.g. 4361 // "ProducerNotificationChannel") to unconditionally include in API 4362 // requests. By default, fields with empty values are omitted from API 4363 // requests. However, any non-pointer, non-interface field appearing in 4364 // ForceSendFields will be sent to the server regardless of whether the 4365 // field is empty or not. This may be used to include empty fields in 4366 // Patch requests. 4367 ForceSendFields []string `json:"-"` 4368 4369 // NullFields is a list of field names (e.g. 4370 // "ProducerNotificationChannel") to include in API requests with the 4371 // JSON null value. By default, fields with empty values are omitted 4372 // from API requests. However, any field with an empty value appearing 4373 // in NullFields will be sent to the server as null. It is an error if a 4374 // field in this list has a non-empty value. This may be used to include 4375 // null fields in Patch requests. 4376 NullFields []string `json:"-"` 4377} 4378 4379func (s *Usage) MarshalJSON() ([]byte, error) { 4380 type NoMethod Usage 4381 raw := NoMethod(*s) 4382 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4383} 4384 4385// UsageRule: Usage configuration rules for the service. 4386// 4387// NOTE: Under development. 4388// 4389// 4390// Use this rule to configure unregistered calls for the service. 4391// Unregistered 4392// calls are calls that do not contain consumer project 4393// identity. 4394// (Example: calls that do not contain an API key). 4395// By default, API methods do not allow unregistered calls, and each 4396// method call 4397// must be identified by a consumer project identity. Use this rule 4398// to 4399// allow/disallow unregistered calls. 4400// 4401// Example of an API that wants to allow unregistered calls for entire 4402// service. 4403// 4404// usage: 4405// rules: 4406// - selector: "*" 4407// allow_unregistered_calls: true 4408// 4409// Example of a method that wants to allow unregistered calls. 4410// 4411// usage: 4412// rules: 4413// - selector: 4414// "google.example.library.v1.LibraryService.CreateBook" 4415// allow_unregistered_calls: true 4416type UsageRule struct { 4417 // AllowUnregisteredCalls: If true, the selected method allows 4418 // unregistered calls, e.g. calls 4419 // that don't identify any user or application. 4420 AllowUnregisteredCalls bool `json:"allowUnregisteredCalls,omitempty"` 4421 4422 // Selector: Selects the methods to which this rule applies. Use '*' to 4423 // indicate all 4424 // methods in all APIs. 4425 // 4426 // Refer to selector for syntax details. 4427 Selector string `json:"selector,omitempty"` 4428 4429 // SkipServiceControl: If true, the selected method should skip service 4430 // control and the control 4431 // plane features, such as quota and billing, will not be 4432 // available. 4433 // This flag is used by Google Cloud Endpoints to bypass checks for 4434 // internal 4435 // methods, such as service health check methods. 4436 SkipServiceControl bool `json:"skipServiceControl,omitempty"` 4437 4438 // ForceSendFields is a list of field names (e.g. 4439 // "AllowUnregisteredCalls") to unconditionally include in API requests. 4440 // By default, fields with empty values are omitted from API requests. 4441 // However, any non-pointer, non-interface field appearing in 4442 // ForceSendFields will be sent to the server regardless of whether the 4443 // field is empty or not. This may be used to include empty fields in 4444 // Patch requests. 4445 ForceSendFields []string `json:"-"` 4446 4447 // NullFields is a list of field names (e.g. "AllowUnregisteredCalls") 4448 // to include in API requests with the JSON null value. By default, 4449 // fields with empty values are omitted from API requests. However, any 4450 // field with an empty value appearing in NullFields will be sent to the 4451 // server as null. It is an error if a field in this list has a 4452 // non-empty value. This may be used to include null fields in Patch 4453 // requests. 4454 NullFields []string `json:"-"` 4455} 4456 4457func (s *UsageRule) MarshalJSON() ([]byte, error) { 4458 type NoMethod UsageRule 4459 raw := NoMethod(*s) 4460 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4461} 4462 4463// method id "servicenetworking.operations.get": 4464 4465type OperationsGetCall struct { 4466 s *APIService 4467 name string 4468 urlParams_ gensupport.URLParams 4469 ifNoneMatch_ string 4470 ctx_ context.Context 4471 header_ http.Header 4472} 4473 4474// Get: Gets the latest state of a long-running operation. Clients can 4475// use this 4476// method to poll the operation result at intervals as recommended by 4477// the API 4478// service. 4479func (r *OperationsService) Get(name string) *OperationsGetCall { 4480 c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4481 c.name = name 4482 return c 4483} 4484 4485// Fields allows partial responses to be retrieved. See 4486// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4487// for more information. 4488func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall { 4489 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4490 return c 4491} 4492 4493// IfNoneMatch sets the optional parameter which makes the operation 4494// fail if the object's ETag matches the given value. This is useful for 4495// getting updates only after the object has changed since the last 4496// request. Use googleapi.IsNotModified to check whether the response 4497// error from Do is the result of In-None-Match. 4498func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall { 4499 c.ifNoneMatch_ = entityTag 4500 return c 4501} 4502 4503// Context sets the context to be used in this call's Do method. Any 4504// pending HTTP request will be aborted if the provided context is 4505// canceled. 4506func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall { 4507 c.ctx_ = ctx 4508 return c 4509} 4510 4511// Header returns an http.Header that can be modified by the caller to 4512// add HTTP headers to the request. 4513func (c *OperationsGetCall) Header() http.Header { 4514 if c.header_ == nil { 4515 c.header_ = make(http.Header) 4516 } 4517 return c.header_ 4518} 4519 4520func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { 4521 reqHeaders := make(http.Header) 4522 for k, v := range c.header_ { 4523 reqHeaders[k] = v 4524 } 4525 reqHeaders.Set("User-Agent", c.s.userAgent()) 4526 if c.ifNoneMatch_ != "" { 4527 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4528 } 4529 var body io.Reader = nil 4530 c.urlParams_.Set("alt", alt) 4531 c.urlParams_.Set("prettyPrint", "false") 4532 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") 4533 urls += "?" + c.urlParams_.Encode() 4534 req, err := http.NewRequest("GET", urls, body) 4535 if err != nil { 4536 return nil, err 4537 } 4538 req.Header = reqHeaders 4539 googleapi.Expand(req.URL, map[string]string{ 4540 "name": c.name, 4541 }) 4542 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4543} 4544 4545// Do executes the "servicenetworking.operations.get" call. 4546// Exactly one of *Operation or error will be non-nil. Any non-2xx 4547// status code is an error. Response headers are in either 4548// *Operation.ServerResponse.Header or (if a response was returned at 4549// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4550// to check whether the returned error was because 4551// http.StatusNotModified was returned. 4552func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4553 gensupport.SetOptions(c.urlParams_, opts...) 4554 res, err := c.doRequest("json") 4555 if res != nil && res.StatusCode == http.StatusNotModified { 4556 if res.Body != nil { 4557 res.Body.Close() 4558 } 4559 return nil, &googleapi.Error{ 4560 Code: res.StatusCode, 4561 Header: res.Header, 4562 } 4563 } 4564 if err != nil { 4565 return nil, err 4566 } 4567 defer googleapi.CloseBody(res) 4568 if err := googleapi.CheckResponse(res); err != nil { 4569 return nil, err 4570 } 4571 ret := &Operation{ 4572 ServerResponse: googleapi.ServerResponse{ 4573 Header: res.Header, 4574 HTTPStatusCode: res.StatusCode, 4575 }, 4576 } 4577 target := &ret 4578 if err := gensupport.DecodeResponse(target, res); err != nil { 4579 return nil, err 4580 } 4581 return ret, nil 4582 // { 4583 // "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.", 4584 // "flatPath": "v1beta/operations/{operationsId}", 4585 // "httpMethod": "GET", 4586 // "id": "servicenetworking.operations.get", 4587 // "parameterOrder": [ 4588 // "name" 4589 // ], 4590 // "parameters": { 4591 // "name": { 4592 // "description": "The name of the operation resource.", 4593 // "location": "path", 4594 // "pattern": "^operations/[^/]+$", 4595 // "required": true, 4596 // "type": "string" 4597 // } 4598 // }, 4599 // "path": "v1beta/{+name}", 4600 // "response": { 4601 // "$ref": "Operation" 4602 // }, 4603 // "scopes": [ 4604 // "https://www.googleapis.com/auth/cloud-platform", 4605 // "https://www.googleapis.com/auth/service.management" 4606 // ] 4607 // } 4608 4609} 4610 4611// method id "servicenetworking.services.addSubnetwork": 4612 4613type ServicesAddSubnetworkCall struct { 4614 s *APIService 4615 parent string 4616 addsubnetworkrequest *AddSubnetworkRequest 4617 urlParams_ gensupport.URLParams 4618 ctx_ context.Context 4619 header_ http.Header 4620} 4621 4622// AddSubnetwork: For service producers, provisions a new subnet in 4623// a 4624// peered service's shared VPC network in the requested region and with 4625// the 4626// requested size that's expressed as a CIDR range (number of leading 4627// bits of 4628// ipV4 network mask). The method checks against the assigned allocated 4629// ranges 4630// to find a non-conflicting IP address range. The method will reuse a 4631// subnet 4632// if subsequent calls contain the same subnet name, region, and 4633// prefix 4634// length. This method will make producer's tenant project to be a 4635// shared VPC 4636// service project as needed. The response from the `get` operation will 4637// be of 4638// type `Subnetwork` if the operation successfully completes. 4639func (r *ServicesService) AddSubnetwork(parent string, addsubnetworkrequest *AddSubnetworkRequest) *ServicesAddSubnetworkCall { 4640 c := &ServicesAddSubnetworkCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4641 c.parent = parent 4642 c.addsubnetworkrequest = addsubnetworkrequest 4643 return c 4644} 4645 4646// Fields allows partial responses to be retrieved. See 4647// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4648// for more information. 4649func (c *ServicesAddSubnetworkCall) Fields(s ...googleapi.Field) *ServicesAddSubnetworkCall { 4650 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4651 return c 4652} 4653 4654// Context sets the context to be used in this call's Do method. Any 4655// pending HTTP request will be aborted if the provided context is 4656// canceled. 4657func (c *ServicesAddSubnetworkCall) Context(ctx context.Context) *ServicesAddSubnetworkCall { 4658 c.ctx_ = ctx 4659 return c 4660} 4661 4662// Header returns an http.Header that can be modified by the caller to 4663// add HTTP headers to the request. 4664func (c *ServicesAddSubnetworkCall) Header() http.Header { 4665 if c.header_ == nil { 4666 c.header_ = make(http.Header) 4667 } 4668 return c.header_ 4669} 4670 4671func (c *ServicesAddSubnetworkCall) doRequest(alt string) (*http.Response, error) { 4672 reqHeaders := make(http.Header) 4673 for k, v := range c.header_ { 4674 reqHeaders[k] = v 4675 } 4676 reqHeaders.Set("User-Agent", c.s.userAgent()) 4677 var body io.Reader = nil 4678 body, err := googleapi.WithoutDataWrapper.JSONReader(c.addsubnetworkrequest) 4679 if err != nil { 4680 return nil, err 4681 } 4682 reqHeaders.Set("Content-Type", "application/json") 4683 c.urlParams_.Set("alt", alt) 4684 c.urlParams_.Set("prettyPrint", "false") 4685 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}:addSubnetwork") 4686 urls += "?" + c.urlParams_.Encode() 4687 req, err := http.NewRequest("POST", urls, body) 4688 if err != nil { 4689 return nil, err 4690 } 4691 req.Header = reqHeaders 4692 googleapi.Expand(req.URL, map[string]string{ 4693 "parent": c.parent, 4694 }) 4695 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4696} 4697 4698// Do executes the "servicenetworking.services.addSubnetwork" call. 4699// Exactly one of *Operation or error will be non-nil. Any non-2xx 4700// status code is an error. Response headers are in either 4701// *Operation.ServerResponse.Header or (if a response was returned at 4702// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4703// to check whether the returned error was because 4704// http.StatusNotModified was returned. 4705func (c *ServicesAddSubnetworkCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4706 gensupport.SetOptions(c.urlParams_, opts...) 4707 res, err := c.doRequest("json") 4708 if res != nil && res.StatusCode == http.StatusNotModified { 4709 if res.Body != nil { 4710 res.Body.Close() 4711 } 4712 return nil, &googleapi.Error{ 4713 Code: res.StatusCode, 4714 Header: res.Header, 4715 } 4716 } 4717 if err != nil { 4718 return nil, err 4719 } 4720 defer googleapi.CloseBody(res) 4721 if err := googleapi.CheckResponse(res); err != nil { 4722 return nil, err 4723 } 4724 ret := &Operation{ 4725 ServerResponse: googleapi.ServerResponse{ 4726 Header: res.Header, 4727 HTTPStatusCode: res.StatusCode, 4728 }, 4729 } 4730 target := &ret 4731 if err := gensupport.DecodeResponse(target, res); err != nil { 4732 return nil, err 4733 } 4734 return ret, nil 4735 // { 4736 // "description": "For service producers, provisions a new subnet in a\npeered service's shared VPC network in the requested region and with the\nrequested size that's expressed as a CIDR range (number of leading bits of\nipV4 network mask). The method checks against the assigned allocated ranges\nto find a non-conflicting IP address range. The method will reuse a subnet\nif subsequent calls contain the same subnet name, region, and prefix\nlength. This method will make producer's tenant project to be a shared VPC\nservice project as needed. The response from the `get` operation will be of\ntype `Subnetwork` if the operation successfully completes.", 4737 // "flatPath": "v1beta/services/{servicesId}/{servicesId1}/{servicesId2}:addSubnetwork", 4738 // "httpMethod": "POST", 4739 // "id": "servicenetworking.services.addSubnetwork", 4740 // "parameterOrder": [ 4741 // "parent" 4742 // ], 4743 // "parameters": { 4744 // "parent": { 4745 // "description": "Required. A tenant project in the service producer organization, in the\nfollowing format: services/{service}/{collection-id}/{resource-id}.\n{collection-id} is the cloud resource collection type that represents the\ntenant project. Only `projects` are supported.\n{resource-id} is the tenant project numeric id, such as\n`123456`. {service} the name of the peering service, such as\n`service-peering.example.com`. This service must already be\nenabled in the service consumer's project.", 4746 // "location": "path", 4747 // "pattern": "^services/[^/]+/[^/]+/[^/]+$", 4748 // "required": true, 4749 // "type": "string" 4750 // } 4751 // }, 4752 // "path": "v1beta/{+parent}:addSubnetwork", 4753 // "request": { 4754 // "$ref": "AddSubnetworkRequest" 4755 // }, 4756 // "response": { 4757 // "$ref": "Operation" 4758 // }, 4759 // "scopes": [ 4760 // "https://www.googleapis.com/auth/cloud-platform", 4761 // "https://www.googleapis.com/auth/service.management" 4762 // ] 4763 // } 4764 4765} 4766 4767// method id "servicenetworking.services.searchRange": 4768 4769type ServicesSearchRangeCall struct { 4770 s *APIService 4771 parent string 4772 searchrangerequest *SearchRangeRequest 4773 urlParams_ gensupport.URLParams 4774 ctx_ context.Context 4775 header_ http.Header 4776} 4777 4778// SearchRange: Service producers can use this method to find a 4779// currently unused range 4780// within consumer allocated ranges. This returned range is not 4781// reserved, 4782// and not guaranteed to remain unused. 4783// It will validate previously provided allocated ranges, 4784// find 4785// non-conflicting sub-range of requested size (expressed in 4786// number of leading bits of ipv4 network mask, as in CIDR 4787// range 4788// notation). 4789// Operation<response: Range> 4790func (r *ServicesService) SearchRange(parent string, searchrangerequest *SearchRangeRequest) *ServicesSearchRangeCall { 4791 c := &ServicesSearchRangeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4792 c.parent = parent 4793 c.searchrangerequest = searchrangerequest 4794 return c 4795} 4796 4797// Fields allows partial responses to be retrieved. See 4798// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4799// for more information. 4800func (c *ServicesSearchRangeCall) Fields(s ...googleapi.Field) *ServicesSearchRangeCall { 4801 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4802 return c 4803} 4804 4805// Context sets the context to be used in this call's Do method. Any 4806// pending HTTP request will be aborted if the provided context is 4807// canceled. 4808func (c *ServicesSearchRangeCall) Context(ctx context.Context) *ServicesSearchRangeCall { 4809 c.ctx_ = ctx 4810 return c 4811} 4812 4813// Header returns an http.Header that can be modified by the caller to 4814// add HTTP headers to the request. 4815func (c *ServicesSearchRangeCall) Header() http.Header { 4816 if c.header_ == nil { 4817 c.header_ = make(http.Header) 4818 } 4819 return c.header_ 4820} 4821 4822func (c *ServicesSearchRangeCall) doRequest(alt string) (*http.Response, error) { 4823 reqHeaders := make(http.Header) 4824 for k, v := range c.header_ { 4825 reqHeaders[k] = v 4826 } 4827 reqHeaders.Set("User-Agent", c.s.userAgent()) 4828 var body io.Reader = nil 4829 body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchrangerequest) 4830 if err != nil { 4831 return nil, err 4832 } 4833 reqHeaders.Set("Content-Type", "application/json") 4834 c.urlParams_.Set("alt", alt) 4835 c.urlParams_.Set("prettyPrint", "false") 4836 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}:searchRange") 4837 urls += "?" + c.urlParams_.Encode() 4838 req, err := http.NewRequest("POST", urls, body) 4839 if err != nil { 4840 return nil, err 4841 } 4842 req.Header = reqHeaders 4843 googleapi.Expand(req.URL, map[string]string{ 4844 "parent": c.parent, 4845 }) 4846 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4847} 4848 4849// Do executes the "servicenetworking.services.searchRange" call. 4850// Exactly one of *Operation or error will be non-nil. Any non-2xx 4851// status code is an error. Response headers are in either 4852// *Operation.ServerResponse.Header or (if a response was returned at 4853// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4854// to check whether the returned error was because 4855// http.StatusNotModified was returned. 4856func (c *ServicesSearchRangeCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4857 gensupport.SetOptions(c.urlParams_, opts...) 4858 res, err := c.doRequest("json") 4859 if res != nil && res.StatusCode == http.StatusNotModified { 4860 if res.Body != nil { 4861 res.Body.Close() 4862 } 4863 return nil, &googleapi.Error{ 4864 Code: res.StatusCode, 4865 Header: res.Header, 4866 } 4867 } 4868 if err != nil { 4869 return nil, err 4870 } 4871 defer googleapi.CloseBody(res) 4872 if err := googleapi.CheckResponse(res); err != nil { 4873 return nil, err 4874 } 4875 ret := &Operation{ 4876 ServerResponse: googleapi.ServerResponse{ 4877 Header: res.Header, 4878 HTTPStatusCode: res.StatusCode, 4879 }, 4880 } 4881 target := &ret 4882 if err := gensupport.DecodeResponse(target, res); err != nil { 4883 return nil, err 4884 } 4885 return ret, nil 4886 // { 4887 // "description": "Service producers can use this method to find a currently unused range\nwithin consumer allocated ranges. This returned range is not reserved,\nand not guaranteed to remain unused.\nIt will validate previously provided allocated ranges, find\nnon-conflicting sub-range of requested size (expressed in\nnumber of leading bits of ipv4 network mask, as in CIDR range\nnotation).\nOperation\u003cresponse: Range\u003e", 4888 // "flatPath": "v1beta/services/{servicesId}:searchRange", 4889 // "httpMethod": "POST", 4890 // "id": "servicenetworking.services.searchRange", 4891 // "parameterOrder": [ 4892 // "parent" 4893 // ], 4894 // "parameters": { 4895 // "parent": { 4896 // "description": "Required. This is in a form services/{service}.\n{service} the name of the private access management service, for example\n'service-peering.example.com'.", 4897 // "location": "path", 4898 // "pattern": "^services/[^/]+$", 4899 // "required": true, 4900 // "type": "string" 4901 // } 4902 // }, 4903 // "path": "v1beta/{+parent}:searchRange", 4904 // "request": { 4905 // "$ref": "SearchRangeRequest" 4906 // }, 4907 // "response": { 4908 // "$ref": "Operation" 4909 // }, 4910 // "scopes": [ 4911 // "https://www.googleapis.com/auth/cloud-platform", 4912 // "https://www.googleapis.com/auth/service.management" 4913 // ] 4914 // } 4915 4916} 4917 4918// method id "servicenetworking.services.updateConnections": 4919 4920type ServicesUpdateConnectionsCall struct { 4921 s *APIService 4922 name string 4923 connection *Connection 4924 urlParams_ gensupport.URLParams 4925 ctx_ context.Context 4926 header_ http.Header 4927} 4928 4929// UpdateConnections: Updates the allocated ranges that are assigned to 4930// a connection. 4931// The response from the `get` operation will be of type `Connection` if 4932// the 4933// operation successfully completes. 4934func (r *ServicesService) UpdateConnections(name string, connection *Connection) *ServicesUpdateConnectionsCall { 4935 c := &ServicesUpdateConnectionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4936 c.name = name 4937 c.connection = connection 4938 return c 4939} 4940 4941// Force sets the optional parameter "force": If a previously defined 4942// allocated range is removed, force flag must be 4943// set to true. 4944func (c *ServicesUpdateConnectionsCall) Force(force bool) *ServicesUpdateConnectionsCall { 4945 c.urlParams_.Set("force", fmt.Sprint(force)) 4946 return c 4947} 4948 4949// UpdateMask sets the optional parameter "updateMask": The update mask. 4950// If this is omitted, it defaults to "*". You can only 4951// update the listed peering ranges. 4952func (c *ServicesUpdateConnectionsCall) UpdateMask(updateMask string) *ServicesUpdateConnectionsCall { 4953 c.urlParams_.Set("updateMask", updateMask) 4954 return c 4955} 4956 4957// Fields allows partial responses to be retrieved. See 4958// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4959// for more information. 4960func (c *ServicesUpdateConnectionsCall) Fields(s ...googleapi.Field) *ServicesUpdateConnectionsCall { 4961 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4962 return c 4963} 4964 4965// Context sets the context to be used in this call's Do method. Any 4966// pending HTTP request will be aborted if the provided context is 4967// canceled. 4968func (c *ServicesUpdateConnectionsCall) Context(ctx context.Context) *ServicesUpdateConnectionsCall { 4969 c.ctx_ = ctx 4970 return c 4971} 4972 4973// Header returns an http.Header that can be modified by the caller to 4974// add HTTP headers to the request. 4975func (c *ServicesUpdateConnectionsCall) Header() http.Header { 4976 if c.header_ == nil { 4977 c.header_ = make(http.Header) 4978 } 4979 return c.header_ 4980} 4981 4982func (c *ServicesUpdateConnectionsCall) doRequest(alt string) (*http.Response, error) { 4983 reqHeaders := make(http.Header) 4984 for k, v := range c.header_ { 4985 reqHeaders[k] = v 4986 } 4987 reqHeaders.Set("User-Agent", c.s.userAgent()) 4988 var body io.Reader = nil 4989 body, err := googleapi.WithoutDataWrapper.JSONReader(c.connection) 4990 if err != nil { 4991 return nil, err 4992 } 4993 reqHeaders.Set("Content-Type", "application/json") 4994 c.urlParams_.Set("alt", alt) 4995 c.urlParams_.Set("prettyPrint", "false") 4996 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/connections") 4997 urls += "?" + c.urlParams_.Encode() 4998 req, err := http.NewRequest("PATCH", urls, body) 4999 if err != nil { 5000 return nil, err 5001 } 5002 req.Header = reqHeaders 5003 googleapi.Expand(req.URL, map[string]string{ 5004 "name": c.name, 5005 }) 5006 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5007} 5008 5009// Do executes the "servicenetworking.services.updateConnections" call. 5010// Exactly one of *Operation or error will be non-nil. Any non-2xx 5011// status code is an error. Response headers are in either 5012// *Operation.ServerResponse.Header or (if a response was returned at 5013// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5014// to check whether the returned error was because 5015// http.StatusNotModified was returned. 5016func (c *ServicesUpdateConnectionsCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5017 gensupport.SetOptions(c.urlParams_, opts...) 5018 res, err := c.doRequest("json") 5019 if res != nil && res.StatusCode == http.StatusNotModified { 5020 if res.Body != nil { 5021 res.Body.Close() 5022 } 5023 return nil, &googleapi.Error{ 5024 Code: res.StatusCode, 5025 Header: res.Header, 5026 } 5027 } 5028 if err != nil { 5029 return nil, err 5030 } 5031 defer googleapi.CloseBody(res) 5032 if err := googleapi.CheckResponse(res); err != nil { 5033 return nil, err 5034 } 5035 ret := &Operation{ 5036 ServerResponse: googleapi.ServerResponse{ 5037 Header: res.Header, 5038 HTTPStatusCode: res.StatusCode, 5039 }, 5040 } 5041 target := &ret 5042 if err := gensupport.DecodeResponse(target, res); err != nil { 5043 return nil, err 5044 } 5045 return ret, nil 5046 // { 5047 // "description": "Updates the allocated ranges that are assigned to a connection.\nThe response from the `get` operation will be of type `Connection` if the\noperation successfully completes.", 5048 // "flatPath": "v1beta/services/{servicesId}/connections", 5049 // "httpMethod": "PATCH", 5050 // "id": "servicenetworking.services.updateConnections", 5051 // "parameterOrder": [ 5052 // "name" 5053 // ], 5054 // "parameters": { 5055 // "force": { 5056 // "description": "If a previously defined allocated range is removed, force flag must be\nset to true.", 5057 // "location": "query", 5058 // "type": "boolean" 5059 // }, 5060 // "name": { 5061 // "description": "The service producer peering service that is managing peering connectivity\nfor a service producer organization.\nFor Google services that support this functionality, this is\n`services/servicenetworking.googleapis.com`.", 5062 // "location": "path", 5063 // "pattern": "^services/[^/]+$", 5064 // "required": true, 5065 // "type": "string" 5066 // }, 5067 // "updateMask": { 5068 // "description": "The update mask. If this is omitted, it defaults to \"*\". You can only\nupdate the listed peering ranges.", 5069 // "format": "google-fieldmask", 5070 // "location": "query", 5071 // "type": "string" 5072 // } 5073 // }, 5074 // "path": "v1beta/{+name}/connections", 5075 // "request": { 5076 // "$ref": "Connection" 5077 // }, 5078 // "response": { 5079 // "$ref": "Operation" 5080 // }, 5081 // "scopes": [ 5082 // "https://www.googleapis.com/auth/cloud-platform", 5083 // "https://www.googleapis.com/auth/service.management" 5084 // ] 5085 // } 5086 5087} 5088 5089// method id "servicenetworking.services.connections.create": 5090 5091type ServicesConnectionsCreateCall struct { 5092 s *APIService 5093 parent string 5094 connection *Connection 5095 urlParams_ gensupport.URLParams 5096 ctx_ context.Context 5097 header_ http.Header 5098} 5099 5100// Create: Creates a private connection that establishes a VPC Network 5101// Peering 5102// connection to a VPC network in the service producer's 5103// organization. 5104// The administrator of the service consumer's VPC network invokes 5105// this 5106// method. The administrator must assign one or more allocated IP ranges 5107// for 5108// provisioning subnetworks in the service producer's VPC network. 5109// This 5110// connection is used for all supported services in the service 5111// producer's 5112// organization, so it only needs to be invoked once. The response from 5113// the 5114// `get` operation will be of type `Connection` if the operation 5115// successfully 5116// completes. 5117func (r *ServicesConnectionsService) Create(parent string, connection *Connection) *ServicesConnectionsCreateCall { 5118 c := &ServicesConnectionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5119 c.parent = parent 5120 c.connection = connection 5121 return c 5122} 5123 5124// Fields allows partial responses to be retrieved. See 5125// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5126// for more information. 5127func (c *ServicesConnectionsCreateCall) Fields(s ...googleapi.Field) *ServicesConnectionsCreateCall { 5128 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5129 return c 5130} 5131 5132// Context sets the context to be used in this call's Do method. Any 5133// pending HTTP request will be aborted if the provided context is 5134// canceled. 5135func (c *ServicesConnectionsCreateCall) Context(ctx context.Context) *ServicesConnectionsCreateCall { 5136 c.ctx_ = ctx 5137 return c 5138} 5139 5140// Header returns an http.Header that can be modified by the caller to 5141// add HTTP headers to the request. 5142func (c *ServicesConnectionsCreateCall) Header() http.Header { 5143 if c.header_ == nil { 5144 c.header_ = make(http.Header) 5145 } 5146 return c.header_ 5147} 5148 5149func (c *ServicesConnectionsCreateCall) doRequest(alt string) (*http.Response, error) { 5150 reqHeaders := make(http.Header) 5151 for k, v := range c.header_ { 5152 reqHeaders[k] = v 5153 } 5154 reqHeaders.Set("User-Agent", c.s.userAgent()) 5155 var body io.Reader = nil 5156 body, err := googleapi.WithoutDataWrapper.JSONReader(c.connection) 5157 if err != nil { 5158 return nil, err 5159 } 5160 reqHeaders.Set("Content-Type", "application/json") 5161 c.urlParams_.Set("alt", alt) 5162 c.urlParams_.Set("prettyPrint", "false") 5163 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/connections") 5164 urls += "?" + c.urlParams_.Encode() 5165 req, err := http.NewRequest("POST", urls, body) 5166 if err != nil { 5167 return nil, err 5168 } 5169 req.Header = reqHeaders 5170 googleapi.Expand(req.URL, map[string]string{ 5171 "parent": c.parent, 5172 }) 5173 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5174} 5175 5176// Do executes the "servicenetworking.services.connections.create" call. 5177// Exactly one of *Operation or error will be non-nil. Any non-2xx 5178// status code is an error. Response headers are in either 5179// *Operation.ServerResponse.Header or (if a response was returned at 5180// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5181// to check whether the returned error was because 5182// http.StatusNotModified was returned. 5183func (c *ServicesConnectionsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5184 gensupport.SetOptions(c.urlParams_, opts...) 5185 res, err := c.doRequest("json") 5186 if res != nil && res.StatusCode == http.StatusNotModified { 5187 if res.Body != nil { 5188 res.Body.Close() 5189 } 5190 return nil, &googleapi.Error{ 5191 Code: res.StatusCode, 5192 Header: res.Header, 5193 } 5194 } 5195 if err != nil { 5196 return nil, err 5197 } 5198 defer googleapi.CloseBody(res) 5199 if err := googleapi.CheckResponse(res); err != nil { 5200 return nil, err 5201 } 5202 ret := &Operation{ 5203 ServerResponse: googleapi.ServerResponse{ 5204 Header: res.Header, 5205 HTTPStatusCode: res.StatusCode, 5206 }, 5207 } 5208 target := &ret 5209 if err := gensupport.DecodeResponse(target, res); err != nil { 5210 return nil, err 5211 } 5212 return ret, nil 5213 // { 5214 // "description": "Creates a private connection that establishes a VPC Network Peering\nconnection to a VPC network in the service producer's organization.\nThe administrator of the service consumer's VPC network invokes this\nmethod. The administrator must assign one or more allocated IP ranges for\nprovisioning subnetworks in the service producer's VPC network. This\nconnection is used for all supported services in the service producer's\norganization, so it only needs to be invoked once. The response from the\n`get` operation will be of type `Connection` if the operation successfully\ncompletes.", 5215 // "flatPath": "v1beta/services/{servicesId}/connections", 5216 // "httpMethod": "POST", 5217 // "id": "servicenetworking.services.connections.create", 5218 // "parameterOrder": [ 5219 // "parent" 5220 // ], 5221 // "parameters": { 5222 // "parent": { 5223 // "description": "The service that is managing peering connectivity for a service producer's\norganization. For Google services that support this functionality, this\nvalue is `services/servicenetworking.googleapis.com`.", 5224 // "location": "path", 5225 // "pattern": "^services/[^/]+$", 5226 // "required": true, 5227 // "type": "string" 5228 // } 5229 // }, 5230 // "path": "v1beta/{+parent}/connections", 5231 // "request": { 5232 // "$ref": "Connection" 5233 // }, 5234 // "response": { 5235 // "$ref": "Operation" 5236 // }, 5237 // "scopes": [ 5238 // "https://www.googleapis.com/auth/cloud-platform", 5239 // "https://www.googleapis.com/auth/service.management" 5240 // ] 5241 // } 5242 5243} 5244 5245// method id "servicenetworking.services.connections.list": 5246 5247type ServicesConnectionsListCall struct { 5248 s *APIService 5249 parent string 5250 urlParams_ gensupport.URLParams 5251 ifNoneMatch_ string 5252 ctx_ context.Context 5253 header_ http.Header 5254} 5255 5256// List: List the private connections that are configured in a service 5257// consumer's 5258// VPC network. 5259func (r *ServicesConnectionsService) List(parent string) *ServicesConnectionsListCall { 5260 c := &ServicesConnectionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5261 c.parent = parent 5262 return c 5263} 5264 5265// Network sets the optional parameter "network": The name of service 5266// consumer's VPC network that's connected with service 5267// producer network through a private connection. The network name must 5268// be in 5269// the following format: 5270// `projects/{project}/global/networks/{network}`. {project} is 5271// a 5272// project number, such as in `12345` that includes the VPC 5273// service 5274// consumer's VPC network. {network} is the name of the service 5275// consumer's VPC 5276// network. 5277func (c *ServicesConnectionsListCall) Network(network string) *ServicesConnectionsListCall { 5278 c.urlParams_.Set("network", network) 5279 return c 5280} 5281 5282// Fields allows partial responses to be retrieved. See 5283// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5284// for more information. 5285func (c *ServicesConnectionsListCall) Fields(s ...googleapi.Field) *ServicesConnectionsListCall { 5286 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5287 return c 5288} 5289 5290// IfNoneMatch sets the optional parameter which makes the operation 5291// fail if the object's ETag matches the given value. This is useful for 5292// getting updates only after the object has changed since the last 5293// request. Use googleapi.IsNotModified to check whether the response 5294// error from Do is the result of In-None-Match. 5295func (c *ServicesConnectionsListCall) IfNoneMatch(entityTag string) *ServicesConnectionsListCall { 5296 c.ifNoneMatch_ = entityTag 5297 return c 5298} 5299 5300// Context sets the context to be used in this call's Do method. Any 5301// pending HTTP request will be aborted if the provided context is 5302// canceled. 5303func (c *ServicesConnectionsListCall) Context(ctx context.Context) *ServicesConnectionsListCall { 5304 c.ctx_ = ctx 5305 return c 5306} 5307 5308// Header returns an http.Header that can be modified by the caller to 5309// add HTTP headers to the request. 5310func (c *ServicesConnectionsListCall) Header() http.Header { 5311 if c.header_ == nil { 5312 c.header_ = make(http.Header) 5313 } 5314 return c.header_ 5315} 5316 5317func (c *ServicesConnectionsListCall) doRequest(alt string) (*http.Response, error) { 5318 reqHeaders := make(http.Header) 5319 for k, v := range c.header_ { 5320 reqHeaders[k] = v 5321 } 5322 reqHeaders.Set("User-Agent", c.s.userAgent()) 5323 if c.ifNoneMatch_ != "" { 5324 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5325 } 5326 var body io.Reader = nil 5327 c.urlParams_.Set("alt", alt) 5328 c.urlParams_.Set("prettyPrint", "false") 5329 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/connections") 5330 urls += "?" + c.urlParams_.Encode() 5331 req, err := http.NewRequest("GET", urls, body) 5332 if err != nil { 5333 return nil, err 5334 } 5335 req.Header = reqHeaders 5336 googleapi.Expand(req.URL, map[string]string{ 5337 "parent": c.parent, 5338 }) 5339 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5340} 5341 5342// Do executes the "servicenetworking.services.connections.list" call. 5343// Exactly one of *ListConnectionsResponse or error will be non-nil. Any 5344// non-2xx status code is an error. Response headers are in either 5345// *ListConnectionsResponse.ServerResponse.Header or (if a response was 5346// returned at all) in error.(*googleapi.Error).Header. Use 5347// googleapi.IsNotModified to check whether the returned error was 5348// because http.StatusNotModified was returned. 5349func (c *ServicesConnectionsListCall) Do(opts ...googleapi.CallOption) (*ListConnectionsResponse, error) { 5350 gensupport.SetOptions(c.urlParams_, opts...) 5351 res, err := c.doRequest("json") 5352 if res != nil && res.StatusCode == http.StatusNotModified { 5353 if res.Body != nil { 5354 res.Body.Close() 5355 } 5356 return nil, &googleapi.Error{ 5357 Code: res.StatusCode, 5358 Header: res.Header, 5359 } 5360 } 5361 if err != nil { 5362 return nil, err 5363 } 5364 defer googleapi.CloseBody(res) 5365 if err := googleapi.CheckResponse(res); err != nil { 5366 return nil, err 5367 } 5368 ret := &ListConnectionsResponse{ 5369 ServerResponse: googleapi.ServerResponse{ 5370 Header: res.Header, 5371 HTTPStatusCode: res.StatusCode, 5372 }, 5373 } 5374 target := &ret 5375 if err := gensupport.DecodeResponse(target, res); err != nil { 5376 return nil, err 5377 } 5378 return ret, nil 5379 // { 5380 // "description": "List the private connections that are configured in a service consumer's\nVPC network.", 5381 // "flatPath": "v1beta/services/{servicesId}/connections", 5382 // "httpMethod": "GET", 5383 // "id": "servicenetworking.services.connections.list", 5384 // "parameterOrder": [ 5385 // "parent" 5386 // ], 5387 // "parameters": { 5388 // "network": { 5389 // "description": "The name of service consumer's VPC network that's connected with service\nproducer network through a private connection. The network name must be in\nthe following format:\n`projects/{project}/global/networks/{network}`. {project} is a\nproject number, such as in `12345` that includes the VPC service\nconsumer's VPC network. {network} is the name of the service consumer's VPC\nnetwork.", 5390 // "location": "query", 5391 // "type": "string" 5392 // }, 5393 // "parent": { 5394 // "description": "The service that is managing peering connectivity for a service producer's\norganization. For Google services that support this functionality, this\nvalue is `services/servicenetworking.googleapis.com`.\nIf you specify `-` as the parameter value, all configured public peering\nservices are listed.", 5395 // "location": "path", 5396 // "pattern": "^services/[^/]+$", 5397 // "required": true, 5398 // "type": "string" 5399 // } 5400 // }, 5401 // "path": "v1beta/{+parent}/connections", 5402 // "response": { 5403 // "$ref": "ListConnectionsResponse" 5404 // }, 5405 // "scopes": [ 5406 // "https://www.googleapis.com/auth/cloud-platform", 5407 // "https://www.googleapis.com/auth/service.management" 5408 // ] 5409 // } 5410 5411} 5412