1// Copyright 2020 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 servicemanagement provides access to the Service Management API. 8// 9// For product documentation, see: https://cloud.google.com/service-management/ 10// 11// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/servicemanagement/v1" 16// ... 17// ctx := context.Background() 18// servicemanagementService, err := servicemanagement.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// servicemanagementService, err := servicemanagement.NewService(ctx, option.WithScopes(servicemanagement.ServiceManagementReadonlyScope)) 29// 30// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 31// 32// servicemanagementService, err := servicemanagement.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// servicemanagementService, err := servicemanagement.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 40// 41// See https://godoc.org/google.golang.org/api/option/ for details on options. 42package servicemanagement // import "google.golang.org/api/servicemanagement/v1" 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 googleapi "google.golang.org/api/googleapi" 57 gensupport "google.golang.org/api/internal/gensupport" 58 option "google.golang.org/api/option" 59 internaloption "google.golang.org/api/option/internaloption" 60 htransport "google.golang.org/api/transport/http" 61) 62 63// Always reference these packages, just in case the auto-generated code 64// below doesn't. 65var _ = bytes.NewBuffer 66var _ = strconv.Itoa 67var _ = fmt.Sprintf 68var _ = json.NewDecoder 69var _ = io.Copy 70var _ = url.Parse 71var _ = gensupport.MarshalJSON 72var _ = googleapi.Version 73var _ = errors.New 74var _ = strings.Replace 75var _ = context.Canceled 76var _ = internaloption.WithDefaultEndpoint 77 78const apiId = "servicemanagement:v1" 79const apiName = "servicemanagement" 80const apiVersion = "v1" 81const basePath = "https://servicemanagement.googleapis.com/" 82const mtlsBasePath = "https://servicemanagement.mtls.googleapis.com/" 83 84// OAuth2 scopes used by this API. 85const ( 86 // View and manage your data across Google Cloud Platform services 87 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 88 89 // View your data across Google Cloud Platform services 90 CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only" 91 92 // Manage your Google API service configuration 93 ServiceManagementScope = "https://www.googleapis.com/auth/service.management" 94 95 // View your Google API service configuration 96 ServiceManagementReadonlyScope = "https://www.googleapis.com/auth/service.management.readonly" 97) 98 99// NewService creates a new APIService. 100func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, error) { 101 scopesOption := option.WithScopes( 102 "https://www.googleapis.com/auth/cloud-platform", 103 "https://www.googleapis.com/auth/cloud-platform.read-only", 104 "https://www.googleapis.com/auth/service.management", 105 "https://www.googleapis.com/auth/service.management.readonly", 106 ) 107 // NOTE: prepend, so we don't override user-specified scopes. 108 opts = append([]option.ClientOption{scopesOption}, opts...) 109 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 110 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 111 client, endpoint, err := htransport.NewClient(ctx, opts...) 112 if err != nil { 113 return nil, err 114 } 115 s, err := New(client) 116 if err != nil { 117 return nil, err 118 } 119 if endpoint != "" { 120 s.BasePath = endpoint 121 } 122 return s, nil 123} 124 125// New creates a new APIService. It uses the provided http.Client for requests. 126// 127// Deprecated: please use NewService instead. 128// To provide a custom HTTP client, use option.WithHTTPClient. 129// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 130func New(client *http.Client) (*APIService, error) { 131 if client == nil { 132 return nil, errors.New("client is nil") 133 } 134 s := &APIService{client: client, BasePath: basePath} 135 s.Operations = NewOperationsService(s) 136 s.Services = NewServicesService(s) 137 return s, nil 138} 139 140type APIService struct { 141 client *http.Client 142 BasePath string // API endpoint base URL 143 UserAgent string // optional additional User-Agent fragment 144 145 Operations *OperationsService 146 147 Services *ServicesService 148} 149 150func (s *APIService) userAgent() string { 151 if s.UserAgent == "" { 152 return googleapi.UserAgent 153 } 154 return googleapi.UserAgent + " " + s.UserAgent 155} 156 157func NewOperationsService(s *APIService) *OperationsService { 158 rs := &OperationsService{s: s} 159 return rs 160} 161 162type OperationsService struct { 163 s *APIService 164} 165 166func NewServicesService(s *APIService) *ServicesService { 167 rs := &ServicesService{s: s} 168 rs.Configs = NewServicesConfigsService(s) 169 rs.Consumers = NewServicesConsumersService(s) 170 rs.Rollouts = NewServicesRolloutsService(s) 171 return rs 172} 173 174type ServicesService struct { 175 s *APIService 176 177 Configs *ServicesConfigsService 178 179 Consumers *ServicesConsumersService 180 181 Rollouts *ServicesRolloutsService 182} 183 184func NewServicesConfigsService(s *APIService) *ServicesConfigsService { 185 rs := &ServicesConfigsService{s: s} 186 return rs 187} 188 189type ServicesConfigsService struct { 190 s *APIService 191} 192 193func NewServicesConsumersService(s *APIService) *ServicesConsumersService { 194 rs := &ServicesConsumersService{s: s} 195 return rs 196} 197 198type ServicesConsumersService struct { 199 s *APIService 200} 201 202func NewServicesRolloutsService(s *APIService) *ServicesRolloutsService { 203 rs := &ServicesRolloutsService{s: s} 204 return rs 205} 206 207type ServicesRolloutsService struct { 208 s *APIService 209} 210 211// Advice: Generated advice about this change, used for providing more 212// information about how a change will affect the existing service. 213type Advice struct { 214 // Description: Useful description for why this advice was applied and 215 // what actions should be taken to mitigate any implied risks. 216 Description string `json:"description,omitempty"` 217 218 // ForceSendFields is a list of field names (e.g. "Description") to 219 // unconditionally include in API requests. By default, fields with 220 // empty values are omitted from API requests. However, any non-pointer, 221 // non-interface field appearing in ForceSendFields will be sent to the 222 // server regardless of whether the field is empty or not. This may be 223 // used to include empty fields in Patch requests. 224 ForceSendFields []string `json:"-"` 225 226 // NullFields is a list of field names (e.g. "Description") to include 227 // in API requests with the JSON null value. By default, fields with 228 // empty values are omitted from API requests. However, any field with 229 // an empty value appearing in NullFields will be sent to the server as 230 // null. It is an error if a field in this list has a non-empty value. 231 // This may be used to include null fields in Patch requests. 232 NullFields []string `json:"-"` 233} 234 235func (s *Advice) MarshalJSON() ([]byte, error) { 236 type NoMethod Advice 237 raw := NoMethod(*s) 238 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 239} 240 241// Api: Api is a light-weight descriptor for an API Interface. 242// Interfaces are also described as "protocol buffer services" in some 243// contexts, such as by the "service" keyword in a .proto file, but they 244// are different from API Services, which represent a concrete 245// implementation of an interface as opposed to simply a description of 246// methods and bindings. They are also sometimes simply referred to as 247// "APIs" in other contexts, such as the name of this message itself. 248// See https://cloud.google.com/apis/design/glossary for detailed 249// terminology. 250type Api struct { 251 // Methods: The methods of this interface, in unspecified order. 252 Methods []*Method `json:"methods,omitempty"` 253 254 // Mixins: Included interfaces. See Mixin. 255 Mixins []*Mixin `json:"mixins,omitempty"` 256 257 // Name: The fully qualified name of this interface, including package 258 // name followed by the interface's simple name. 259 Name string `json:"name,omitempty"` 260 261 // Options: Any metadata attached to the interface. 262 Options []*Option `json:"options,omitempty"` 263 264 // SourceContext: Source context for the protocol buffer service 265 // represented by this message. 266 SourceContext *SourceContext `json:"sourceContext,omitempty"` 267 268 // Syntax: The source syntax of the service. 269 // 270 // Possible values: 271 // "SYNTAX_PROTO2" - Syntax `proto2`. 272 // "SYNTAX_PROTO3" - Syntax `proto3`. 273 Syntax string `json:"syntax,omitempty"` 274 275 // Version: A version string for this interface. If specified, must have 276 // the form `major-version.minor-version`, as in `1.10`. If the minor 277 // version is omitted, it defaults to zero. If the entire version field 278 // is empty, the major version is derived from the package name, as 279 // outlined below. If the field is not empty, the version in the package 280 // name will be verified to be consistent with what is provided here. 281 // The versioning schema uses [semantic versioning](http://semver.org) 282 // where the major version number indicates a breaking change and the 283 // minor version an additive, non-breaking change. Both version numbers 284 // are signals to users what to expect from different versions, and 285 // should be carefully chosen based on the product plan. The major 286 // version is also reflected in the package name of the interface, which 287 // must end in `v`, as in `google.feature.v1`. For major versions 0 and 288 // 1, the suffix can be omitted. Zero major versions must only be used 289 // for experimental, non-GA interfaces. 290 Version string `json:"version,omitempty"` 291 292 // ForceSendFields is a list of field names (e.g. "Methods") to 293 // unconditionally include in API requests. By default, fields with 294 // empty values are omitted from API requests. However, any non-pointer, 295 // non-interface field appearing in ForceSendFields will be sent to the 296 // server regardless of whether the field is empty or not. This may be 297 // used to include empty fields in Patch requests. 298 ForceSendFields []string `json:"-"` 299 300 // NullFields is a list of field names (e.g. "Methods") to include in 301 // API requests with the JSON null value. By default, fields with empty 302 // values are omitted from API requests. However, any field with an 303 // empty value appearing in NullFields will be sent to the server as 304 // null. It is an error if a field in this list has a non-empty value. 305 // This may be used to include null fields in Patch requests. 306 NullFields []string `json:"-"` 307} 308 309func (s *Api) MarshalJSON() ([]byte, error) { 310 type NoMethod Api 311 raw := NoMethod(*s) 312 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 313} 314 315// AuditConfig: Specifies the audit configuration for a service. The 316// configuration determines which permission types are logged, and what 317// identities, if any, are exempted from logging. An AuditConfig must 318// have one or more AuditLogConfigs. If there are AuditConfigs for both 319// `allServices` and a specific service, the union of the two 320// AuditConfigs is used for that service: the log_types specified in 321// each AuditConfig are enabled, and the exempted_members in each 322// AuditLogConfig are exempted. Example Policy with multiple 323// AuditConfigs: { "audit_configs": [ { "service": "allServices", 324// "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": 325// [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { 326// "log_type": "ADMIN_READ" } ] }, { "service": 327// "sampleservice.googleapis.com", "audit_log_configs": [ { "log_type": 328// "DATA_READ" }, { "log_type": "DATA_WRITE", "exempted_members": [ 329// "user:aliya@example.com" ] } ] } ] } For sampleservice, this policy 330// enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts 331// jose@example.com from DATA_READ logging, and aliya@example.com from 332// DATA_WRITE logging. 333type AuditConfig struct { 334 // AuditLogConfigs: The configuration for logging of each type of 335 // permission. 336 AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"` 337 338 // Service: Specifies a service that will be enabled for audit logging. 339 // For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. 340 // `allServices` is a special value that covers all services. 341 Service string `json:"service,omitempty"` 342 343 // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to 344 // unconditionally include in API requests. By default, fields with 345 // empty values are omitted from API requests. However, any non-pointer, 346 // non-interface field appearing in ForceSendFields will be sent to the 347 // server regardless of whether the field is empty or not. This may be 348 // used to include empty fields in Patch requests. 349 ForceSendFields []string `json:"-"` 350 351 // NullFields is a list of field names (e.g. "AuditLogConfigs") to 352 // include in API requests with the JSON null value. By default, fields 353 // with empty values are omitted from API requests. However, any field 354 // with an empty value appearing in NullFields will be sent to the 355 // server as null. It is an error if a field in this list has a 356 // non-empty value. This may be used to include null fields in Patch 357 // requests. 358 NullFields []string `json:"-"` 359} 360 361func (s *AuditConfig) MarshalJSON() ([]byte, error) { 362 type NoMethod AuditConfig 363 raw := NoMethod(*s) 364 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 365} 366 367// AuditLogConfig: Provides the configuration for logging a type of 368// permissions. Example: { "audit_log_configs": [ { "log_type": 369// "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { 370// "log_type": "DATA_WRITE" } ] } This enables 'DATA_READ' and 371// 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ 372// logging. 373type AuditLogConfig struct { 374 // ExemptedMembers: Specifies the identities that do not cause logging 375 // for this type of permission. Follows the same format of 376 // Binding.members. 377 ExemptedMembers []string `json:"exemptedMembers,omitempty"` 378 379 // LogType: The log type that this config enables. 380 // 381 // Possible values: 382 // "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this. 383 // "ADMIN_READ" - Admin reads. Example: CloudIAM getIamPolicy 384 // "DATA_WRITE" - Data writes. Example: CloudSQL Users create 385 // "DATA_READ" - Data reads. Example: CloudSQL Users list 386 LogType string `json:"logType,omitempty"` 387 388 // ForceSendFields is a list of field names (e.g. "ExemptedMembers") to 389 // unconditionally include in API requests. By default, fields with 390 // empty values are omitted from API requests. However, any non-pointer, 391 // non-interface field appearing in ForceSendFields will be sent to the 392 // server regardless of whether the field is empty or not. This may be 393 // used to include empty fields in Patch requests. 394 ForceSendFields []string `json:"-"` 395 396 // NullFields is a list of field names (e.g. "ExemptedMembers") to 397 // include in API requests with the JSON null value. By default, fields 398 // with empty values are omitted from API requests. However, any field 399 // with an empty value appearing in NullFields will be sent to the 400 // server as null. It is an error if a field in this list has a 401 // non-empty value. This may be used to include null fields in Patch 402 // requests. 403 NullFields []string `json:"-"` 404} 405 406func (s *AuditLogConfig) MarshalJSON() ([]byte, error) { 407 type NoMethod AuditLogConfig 408 raw := NoMethod(*s) 409 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 410} 411 412// AuthProvider: Configuration for an authentication provider, including 413// support for [JSON Web Token 414// (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32) 415// . 416type AuthProvider struct { 417 // Audiences: The list of JWT 418 // [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-toke 419 // n-32#section-4.1.3). that are allowed to access. A JWT containing any 420 // of these audiences will be accepted. When this setting is absent, 421 // JWTs with audiences: - 422 // "https://[service.name]/[google.protobuf.Api.name]" - 423 // "https://[service.name]/" will be accepted. For example, if no 424 // audiences are in the setting, LibraryService API will accept JWTs 425 // with the following audiences: - 426 // https://library-example.googleapis.com/google.example.library.v1.LibraryService - https://library-example.googleapis.com/ Example: audiences: bookstore_android.apps.googleusercontent.com, 427 // bookstore_web.apps.googleusercontent.com 428 Audiences string `json:"audiences,omitempty"` 429 430 // AuthorizationUrl: Redirect URL if JWT token is required but not 431 // present or is expired. Implement authorizationUrl of 432 // securityDefinitions in OpenAPI spec. 433 AuthorizationUrl string `json:"authorizationUrl,omitempty"` 434 435 // Id: The unique identifier of the auth provider. It will be referred 436 // to by `AuthRequirement.provider_id`. Example: "bookstore_auth". 437 Id string `json:"id,omitempty"` 438 439 // Issuer: Identifies the principal that issued the JWT. See 440 // https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1 Usually a URL or an email address. Example: https://securetoken.google.com Example: 441 // 1234567-compute@developer.gserviceaccount.com 442 Issuer string `json:"issuer,omitempty"` 443 444 // JwksUri: URL of the provider's public key set to validate signature 445 // of the JWT. See [OpenID 446 // Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html# 447 // ProviderMetadata). Optional if the key set document: - can be 448 // retrieved from [OpenID 449 // Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) 450 // of the issuer. - can be inferred from the email domain of the issuer 451 // (e.g. a Google service account). Example: 452 // https://www.googleapis.com/oauth2/v1/certs 453 JwksUri string `json:"jwksUri,omitempty"` 454 455 // JwtLocations: Defines the locations to extract the JWT. JWT locations 456 // can be either from HTTP headers or URL query parameters. The rule is 457 // that the first match wins. The checking order is: checking all 458 // headers first, then URL query parameters. If not specified, default 459 // to use following 3 locations: 1) Authorization: Bearer 2) 460 // x-goog-iap-jwt-assertion 3) access_token query parameter Default 461 // locations can be specified as followings: jwt_locations: - header: 462 // Authorization value_prefix: "Bearer " - header: 463 // x-goog-iap-jwt-assertion - query: access_token 464 JwtLocations []*JwtLocation `json:"jwtLocations,omitempty"` 465 466 // ForceSendFields is a list of field names (e.g. "Audiences") to 467 // unconditionally include in API requests. By default, fields with 468 // empty values are omitted from API requests. However, any non-pointer, 469 // non-interface field appearing in ForceSendFields will be sent to the 470 // server regardless of whether the field is empty or not. This may be 471 // used to include empty fields in Patch requests. 472 ForceSendFields []string `json:"-"` 473 474 // NullFields is a list of field names (e.g. "Audiences") to include in 475 // API requests with the JSON null value. By default, fields with empty 476 // values are omitted from API requests. However, any field with an 477 // empty value appearing in NullFields will be sent to the server as 478 // null. It is an error if a field in this list has a non-empty value. 479 // This may be used to include null fields in Patch requests. 480 NullFields []string `json:"-"` 481} 482 483func (s *AuthProvider) MarshalJSON() ([]byte, error) { 484 type NoMethod AuthProvider 485 raw := NoMethod(*s) 486 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 487} 488 489// AuthRequirement: User-defined authentication requirements, including 490// support for [JSON Web Token 491// (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32) 492// . 493type AuthRequirement struct { 494 // Audiences: NOTE: This will be deprecated soon, once 495 // AuthProvider.audiences is implemented and accepted in all the runtime 496 // components. The list of JWT 497 // [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-toke 498 // n-32#section-4.1.3). that are allowed to access. A JWT containing any 499 // of these audiences will be accepted. When this setting is absent, 500 // only JWTs with audience "https://Service_name/API_name" will be 501 // accepted. For example, if no audiences are in the setting, 502 // LibraryService API will only accept JWTs with the following audience 503 // "https://library-example.googleapis.com/google.example.library.v1.Libr 504 // aryService". Example: audiences: 505 // bookstore_android.apps.googleusercontent.com, 506 // bookstore_web.apps.googleusercontent.com 507 Audiences string `json:"audiences,omitempty"` 508 509 // ProviderId: id from authentication provider. Example: provider_id: 510 // bookstore_auth 511 ProviderId string `json:"providerId,omitempty"` 512 513 // ForceSendFields is a list of field names (e.g. "Audiences") to 514 // unconditionally include in API requests. By default, fields with 515 // empty values are omitted from API requests. However, any non-pointer, 516 // non-interface field appearing in ForceSendFields will be sent to the 517 // server regardless of whether the field is empty or not. This may be 518 // used to include empty fields in Patch requests. 519 ForceSendFields []string `json:"-"` 520 521 // NullFields is a list of field names (e.g. "Audiences") to include in 522 // API requests with the JSON null value. By default, fields with empty 523 // values are omitted from API requests. However, any field with an 524 // empty value appearing in NullFields will be sent to the server as 525 // null. It is an error if a field in this list has a non-empty value. 526 // This may be used to include null fields in Patch requests. 527 NullFields []string `json:"-"` 528} 529 530func (s *AuthRequirement) MarshalJSON() ([]byte, error) { 531 type NoMethod AuthRequirement 532 raw := NoMethod(*s) 533 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 534} 535 536// Authentication: `Authentication` defines the authentication 537// configuration for an API. Example for an API targeted for external 538// use: name: calendar.googleapis.com authentication: providers: - id: 539// google_calendar_auth jwks_uri: 540// https://www.googleapis.com/oauth2/v1/certs issuer: 541// https://securetoken.google.com rules: - selector: "*" requirements: 542// provider_id: google_calendar_auth 543type Authentication struct { 544 // Providers: Defines a set of authentication providers that a service 545 // supports. 546 Providers []*AuthProvider `json:"providers,omitempty"` 547 548 // Rules: A list of authentication rules that apply to individual API 549 // methods. **NOTE:** All service configuration rules follow "last one 550 // wins" order. 551 Rules []*AuthenticationRule `json:"rules,omitempty"` 552 553 // ForceSendFields is a list of field names (e.g. "Providers") to 554 // unconditionally include in API requests. By default, fields with 555 // empty values are omitted from API requests. However, any non-pointer, 556 // non-interface field appearing in ForceSendFields will be sent to the 557 // server regardless of whether the field is empty or not. This may be 558 // used to include empty fields in Patch requests. 559 ForceSendFields []string `json:"-"` 560 561 // NullFields is a list of field names (e.g. "Providers") to include in 562 // API requests with the JSON null value. By default, fields with empty 563 // values are omitted from API requests. However, any field with an 564 // empty value appearing in NullFields will be sent to the server as 565 // null. It is an error if a field in this list has a non-empty value. 566 // This may be used to include null fields in Patch requests. 567 NullFields []string `json:"-"` 568} 569 570func (s *Authentication) MarshalJSON() ([]byte, error) { 571 type NoMethod Authentication 572 raw := NoMethod(*s) 573 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 574} 575 576// AuthenticationRule: Authentication rules for the service. By default, 577// if a method has any authentication requirements, every request must 578// include a valid credential matching one of the requirements. It's an 579// error to include more than one kind of credential in a single 580// request. If a method doesn't have any auth requirements, request 581// credentials will be ignored. 582type AuthenticationRule struct { 583 // AllowWithoutCredential: If true, the service accepts API keys without 584 // any other credential. This flag only applies to HTTP and gRPC 585 // requests. 586 AllowWithoutCredential bool `json:"allowWithoutCredential,omitempty"` 587 588 // Oauth: The requirements for OAuth credentials. 589 Oauth *OAuthRequirements `json:"oauth,omitempty"` 590 591 // Requirements: Requirements for additional authentication providers. 592 Requirements []*AuthRequirement `json:"requirements,omitempty"` 593 594 // Selector: Selects the methods to which this rule applies. Refer to 595 // selector for syntax details. 596 Selector string `json:"selector,omitempty"` 597 598 // ForceSendFields is a list of field names (e.g. 599 // "AllowWithoutCredential") to unconditionally include in API requests. 600 // By default, fields with empty values are omitted from API requests. 601 // However, any non-pointer, non-interface field appearing in 602 // ForceSendFields will be sent to the server regardless of whether the 603 // field is empty or not. This may be used to include empty fields in 604 // Patch requests. 605 ForceSendFields []string `json:"-"` 606 607 // NullFields is a list of field names (e.g. "AllowWithoutCredential") 608 // to include in API requests with the JSON null value. By default, 609 // fields with empty values are omitted from API requests. However, any 610 // field with an empty value appearing in NullFields will be sent to the 611 // server as null. It is an error if a field in this list has a 612 // non-empty value. This may be used to include null fields in Patch 613 // requests. 614 NullFields []string `json:"-"` 615} 616 617func (s *AuthenticationRule) MarshalJSON() ([]byte, error) { 618 type NoMethod AuthenticationRule 619 raw := NoMethod(*s) 620 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 621} 622 623// Backend: `Backend` defines the backend configuration for a service. 624type Backend struct { 625 // Rules: A list of API backend rules that apply to individual API 626 // methods. **NOTE:** All service configuration rules follow "last one 627 // wins" order. 628 Rules []*BackendRule `json:"rules,omitempty"` 629 630 // ForceSendFields is a list of field names (e.g. "Rules") to 631 // unconditionally include in API requests. By default, fields with 632 // empty values are omitted from API requests. However, any non-pointer, 633 // non-interface field appearing in ForceSendFields will be sent to the 634 // server regardless of whether the field is empty or not. This may be 635 // used to include empty fields in Patch requests. 636 ForceSendFields []string `json:"-"` 637 638 // NullFields is a list of field names (e.g. "Rules") to include in API 639 // requests with the JSON null value. By default, fields with empty 640 // values are omitted from API requests. However, any field with an 641 // empty value appearing in NullFields will be sent to the server as 642 // null. It is an error if a field in this list has a non-empty value. 643 // This may be used to include null fields in Patch requests. 644 NullFields []string `json:"-"` 645} 646 647func (s *Backend) MarshalJSON() ([]byte, error) { 648 type NoMethod Backend 649 raw := NoMethod(*s) 650 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 651} 652 653// BackendRule: A backend rule provides configuration for an individual 654// API element. 655type BackendRule struct { 656 // Address: The address of the API backend. The scheme is used to 657 // determine the backend protocol and security. The following schemes 658 // are accepted: SCHEME PROTOCOL SECURITY http:// HTTP None https:// 659 // HTTP TLS grpc:// gRPC None grpcs:// gRPC TLS It is recommended to 660 // explicitly include a scheme. Leaving out the scheme may cause 661 // constrasting behaviors across platforms. If the port is unspecified, 662 // the default is: - 80 for schemes without TLS - 443 for schemes with 663 // TLS For HTTP backends, use protocol to specify the protocol version. 664 Address string `json:"address,omitempty"` 665 666 // Deadline: The number of seconds to wait for a response from a 667 // request. The default varies based on the request protocol and 668 // deployment environment. 669 Deadline float64 `json:"deadline,omitempty"` 670 671 // DisableAuth: When disable_auth is true, a JWT ID token won't be 672 // generated and the original "Authorization" HTTP header will be 673 // preserved. If the header is used to carry the original token and is 674 // expected by the backend, this field must be set to true to preserve 675 // the header. 676 DisableAuth bool `json:"disableAuth,omitempty"` 677 678 // JwtAudience: The JWT audience is used when generating a JWT ID token 679 // for the backend. This ID token will be added in the HTTP 680 // "authorization" header, and sent to the backend. 681 JwtAudience string `json:"jwtAudience,omitempty"` 682 683 // MinDeadline: Minimum deadline in seconds needed for this method. 684 // Calls having deadline value lower than this will be rejected. 685 MinDeadline float64 `json:"minDeadline,omitempty"` 686 687 // OperationDeadline: The number of seconds to wait for the completion 688 // of a long running operation. The default is no deadline. 689 OperationDeadline float64 `json:"operationDeadline,omitempty"` 690 691 // Possible values: 692 // "PATH_TRANSLATION_UNSPECIFIED" 693 // "CONSTANT_ADDRESS" - Use the backend address as-is, with no 694 // modification to the path. If the URL pattern contains variables, the 695 // variable names and values will be appended to the query string. If a 696 // query string parameter and a URL pattern variable have the same name, 697 // this may result in duplicate keys in the query string. # Examples 698 // Given the following operation config: Method path: 699 // /api/company/{cid}/user/{uid} Backend address: 700 // https://example.cloudfunctions.net/getUser Requests to the following 701 // request paths will call the backend at the translated path: Request 702 // path: /api/company/widgetworks/user/johndoe Translated: 703 // https://example.cloudfunctions.net/getUser?cid=widgetworks&uid=johndoe Request path: /api/company/widgetworks/user/johndoe?timezone=EST Translated: 704 // https://example.cloudfunctions.net/getUser?timezone=EST&cid=widgetworks&uid=johndoe 705 // "APPEND_PATH_TO_ADDRESS" - The request path will be appended to the 706 // backend address. # Examples Given the following operation config: 707 // Method path: /api/company/{cid}/user/{uid} Backend address: 708 // https://example.appspot.com Requests to the following request paths 709 // will call the backend at the translated path: Request path: 710 // /api/company/widgetworks/user/johndoe Translated: 711 // https://example.appspot.com/api/company/widgetworks/user/johndoe 712 // Request path: /api/company/widgetworks/user/johndoe?timezone=EST 713 // Translated: 714 // https://example.appspot.com/api/company/widgetworks/user/johndoe?timezone=EST 715 PathTranslation string `json:"pathTranslation,omitempty"` 716 717 // Protocol: The protocol used for sending a request to the backend. The 718 // supported values are "http/1.1" and "h2". The default value is 719 // inferred from the scheme in the address field: SCHEME PROTOCOL 720 // http:// http/1.1 https:// http/1.1 grpc:// h2 grpcs:// h2 For secure 721 // HTTP backends (https://) that support HTTP/2, set this field to "h2" 722 // for improved performance. Configuring this field to non-default 723 // values is only supported for secure HTTP backends. This field will be 724 // ignored for all other backends. See 725 // https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids for more details on the supported 726 // values. 727 Protocol string `json:"protocol,omitempty"` 728 729 // Selector: Selects the methods to which this rule applies. Refer to 730 // selector for syntax details. 731 Selector string `json:"selector,omitempty"` 732 733 // ForceSendFields is a list of field names (e.g. "Address") to 734 // unconditionally include in API requests. By default, fields with 735 // empty values are omitted from API requests. However, any non-pointer, 736 // non-interface field appearing in ForceSendFields will be sent to the 737 // server regardless of whether the field is empty or not. This may be 738 // used to include empty fields in Patch requests. 739 ForceSendFields []string `json:"-"` 740 741 // NullFields is a list of field names (e.g. "Address") to include in 742 // API requests with the JSON null value. By default, fields with empty 743 // values are omitted from API requests. However, any field with an 744 // empty value appearing in NullFields will be sent to the server as 745 // null. It is an error if a field in this list has a non-empty value. 746 // This may be used to include null fields in Patch requests. 747 NullFields []string `json:"-"` 748} 749 750func (s *BackendRule) MarshalJSON() ([]byte, error) { 751 type NoMethod BackendRule 752 raw := NoMethod(*s) 753 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 754} 755 756func (s *BackendRule) UnmarshalJSON(data []byte) error { 757 type NoMethod BackendRule 758 var s1 struct { 759 Deadline gensupport.JSONFloat64 `json:"deadline"` 760 MinDeadline gensupport.JSONFloat64 `json:"minDeadline"` 761 OperationDeadline gensupport.JSONFloat64 `json:"operationDeadline"` 762 *NoMethod 763 } 764 s1.NoMethod = (*NoMethod)(s) 765 if err := json.Unmarshal(data, &s1); err != nil { 766 return err 767 } 768 s.Deadline = float64(s1.Deadline) 769 s.MinDeadline = float64(s1.MinDeadline) 770 s.OperationDeadline = float64(s1.OperationDeadline) 771 return nil 772} 773 774// Billing: Billing related configuration of the service. The following 775// example shows how to configure monitored resources and metrics for 776// billing, `consumer_destinations` is the only supported destination 777// and the monitored resources need at least one label key 778// `cloud.googleapis.com/location` to indicate the location of the 779// billing usage, using different monitored resources between monitoring 780// and billing is recommended so they can be evolved independently: 781// monitored_resources: - type: library.googleapis.com/billing_branch 782// labels: - key: cloud.googleapis.com/location description: | 783// Predefined label to support billing location restriction. - key: city 784// description: | Custom label to define the city where the library 785// branch is located in. - key: name description: Custom label to define 786// the name of the library branch. metrics: - name: 787// library.googleapis.com/book/borrowed_count metric_kind: DELTA 788// value_type: INT64 unit: "1" billing: consumer_destinations: - 789// monitored_resource: library.googleapis.com/billing_branch metrics: - 790// library.googleapis.com/book/borrowed_count 791type Billing struct { 792 // ConsumerDestinations: Billing configurations for sending metrics to 793 // the consumer project. There can be multiple consumer destinations per 794 // service, each one must have a different monitored resource type. A 795 // metric can be used in at most one consumer destination. 796 ConsumerDestinations []*BillingDestination `json:"consumerDestinations,omitempty"` 797 798 // ForceSendFields is a list of field names (e.g. 799 // "ConsumerDestinations") to unconditionally include in API requests. 800 // By default, fields with empty values are omitted from API requests. 801 // However, any non-pointer, non-interface field appearing in 802 // ForceSendFields will be sent to the server regardless of whether the 803 // field is empty or not. This may be used to include empty fields in 804 // Patch requests. 805 ForceSendFields []string `json:"-"` 806 807 // NullFields is a list of field names (e.g. "ConsumerDestinations") to 808 // include in API requests with the JSON null value. By default, fields 809 // with empty values are omitted from API requests. However, any field 810 // with an empty value appearing in NullFields will be sent to the 811 // server as null. It is an error if a field in this list has a 812 // non-empty value. This may be used to include null fields in Patch 813 // requests. 814 NullFields []string `json:"-"` 815} 816 817func (s *Billing) MarshalJSON() ([]byte, error) { 818 type NoMethod Billing 819 raw := NoMethod(*s) 820 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 821} 822 823// BillingDestination: Configuration of a specific billing destination 824// (Currently only support bill against consumer project). 825type BillingDestination struct { 826 // Metrics: Names of the metrics to report to this billing destination. 827 // Each name must be defined in Service.metrics section. 828 Metrics []string `json:"metrics,omitempty"` 829 830 // MonitoredResource: The monitored resource type. The type must be 831 // defined in Service.monitored_resources section. 832 MonitoredResource string `json:"monitoredResource,omitempty"` 833 834 // ForceSendFields is a list of field names (e.g. "Metrics") to 835 // unconditionally include in API requests. By default, fields with 836 // empty values are omitted from API requests. However, any non-pointer, 837 // non-interface field appearing in ForceSendFields will be sent to the 838 // server regardless of whether the field is empty or not. This may be 839 // used to include empty fields in Patch requests. 840 ForceSendFields []string `json:"-"` 841 842 // NullFields is a list of field names (e.g. "Metrics") to include in 843 // API requests with the JSON null value. By default, fields with empty 844 // values are omitted from API requests. However, any field with an 845 // empty value appearing in NullFields will be sent to the server as 846 // null. It is an error if a field in this list has a non-empty value. 847 // This may be used to include null fields in Patch requests. 848 NullFields []string `json:"-"` 849} 850 851func (s *BillingDestination) MarshalJSON() ([]byte, error) { 852 type NoMethod BillingDestination 853 raw := NoMethod(*s) 854 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 855} 856 857// Binding: Associates `members` with a `role`. 858type Binding struct { 859 // Condition: The condition that is associated with this binding. If the 860 // condition evaluates to `true`, then this binding applies to the 861 // current request. If the condition evaluates to `false`, then this 862 // binding does not apply to the current request. However, a different 863 // role binding might grant the same role to one or more of the members 864 // in this binding. To learn which resources support conditions in their 865 // IAM policies, see the [IAM 866 // documentation](https://cloud.google.com/iam/help/conditions/resource-p 867 // olicies). 868 Condition *Expr `json:"condition,omitempty"` 869 870 // Members: Specifies the identities requesting access for a Cloud 871 // Platform resource. `members` can have the following values: * 872 // `allUsers`: A special identifier that represents anyone who is on the 873 // internet; with or without a Google account. * 874 // `allAuthenticatedUsers`: A special identifier that represents anyone 875 // who is authenticated with a Google account or a service account. * 876 // `user:{emailid}`: An email address that represents a specific Google 877 // account. For example, `alice@example.com` . * 878 // `serviceAccount:{emailid}`: An email address that represents a 879 // service account. For example, 880 // `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An 881 // email address that represents a Google group. For example, 882 // `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An 883 // email address (plus unique identifier) representing a user that has 884 // been recently deleted. For example, 885 // `alice@example.com?uid=123456789012345678901`. If the user is 886 // recovered, this value reverts to `user:{emailid}` and the recovered 887 // user retains the role in the binding. * 888 // `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address 889 // (plus unique identifier) representing a service account that has been 890 // recently deleted. For example, 891 // `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. 892 // If the service account is undeleted, this value reverts to 893 // `serviceAccount:{emailid}` and the undeleted service account retains 894 // the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: 895 // An email address (plus unique identifier) representing a Google group 896 // that has been recently deleted. For example, 897 // `admins@example.com?uid=123456789012345678901`. If the group is 898 // recovered, this value reverts to `group:{emailid}` and the recovered 899 // group retains the role in the binding. * `domain:{domain}`: The G 900 // Suite domain (primary) that represents all the users of that domain. 901 // For example, `google.com` or `example.com`. 902 Members []string `json:"members,omitempty"` 903 904 // Role: Role that is assigned to `members`. For example, 905 // `roles/viewer`, `roles/editor`, or `roles/owner`. 906 Role string `json:"role,omitempty"` 907 908 // ForceSendFields is a list of field names (e.g. "Condition") to 909 // unconditionally include in API requests. By default, fields with 910 // empty values are omitted from API requests. However, any non-pointer, 911 // non-interface field appearing in ForceSendFields will be sent to the 912 // server regardless of whether the field is empty or not. This may be 913 // used to include empty fields in Patch requests. 914 ForceSendFields []string `json:"-"` 915 916 // NullFields is a list of field names (e.g. "Condition") to include in 917 // API requests with the JSON null value. By default, fields with empty 918 // values are omitted from API requests. However, any field with an 919 // empty value appearing in NullFields will be sent to the server as 920 // null. It is an error if a field in this list has a non-empty value. 921 // This may be used to include null fields in Patch requests. 922 NullFields []string `json:"-"` 923} 924 925func (s *Binding) MarshalJSON() ([]byte, error) { 926 type NoMethod Binding 927 raw := NoMethod(*s) 928 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 929} 930 931// ChangeReport: Change report associated with a particular service 932// configuration. It contains a list of ConfigChanges based on the 933// comparison between two service configurations. 934type ChangeReport struct { 935 // ConfigChanges: List of changes between two service configurations. 936 // The changes will be alphabetically sorted based on the identifier of 937 // each change. A ConfigChange identifier is a dot separated path to the 938 // configuration. Example: 939 // visibility.rules[selector='LibraryService.CreateBook'].restriction 940 ConfigChanges []*ConfigChange `json:"configChanges,omitempty"` 941 942 // ForceSendFields is a list of field names (e.g. "ConfigChanges") to 943 // unconditionally include in API requests. By default, fields with 944 // empty values are omitted from API requests. However, any non-pointer, 945 // non-interface field appearing in ForceSendFields will be sent to the 946 // server regardless of whether the field is empty or not. This may be 947 // used to include empty fields in Patch requests. 948 ForceSendFields []string `json:"-"` 949 950 // NullFields is a list of field names (e.g. "ConfigChanges") to include 951 // in API requests with the JSON null value. By default, fields with 952 // empty values are omitted from API requests. However, any field with 953 // an empty value appearing in NullFields will be sent to the server as 954 // null. It is an error if a field in this list has a non-empty value. 955 // This may be used to include null fields in Patch requests. 956 NullFields []string `json:"-"` 957} 958 959func (s *ChangeReport) MarshalJSON() ([]byte, error) { 960 type NoMethod ChangeReport 961 raw := NoMethod(*s) 962 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 963} 964 965// ConfigChange: Output generated from semantically comparing two 966// versions of a service configuration. Includes detailed information 967// about a field that have changed with applicable advice about 968// potential consequences for the change, such as 969// backwards-incompatibility. 970type ConfigChange struct { 971 // Advices: Collection of advice provided for this change, useful for 972 // determining the possible impact of this change. 973 Advices []*Advice `json:"advices,omitempty"` 974 975 // ChangeType: The type for this change, either ADDED, REMOVED, or 976 // MODIFIED. 977 // 978 // Possible values: 979 // "CHANGE_TYPE_UNSPECIFIED" - No value was provided. 980 // "ADDED" - The changed object exists in the 'new' service 981 // configuration, but not in the 'old' service configuration. 982 // "REMOVED" - The changed object exists in the 'old' service 983 // configuration, but not in the 'new' service configuration. 984 // "MODIFIED" - The changed object exists in both service 985 // configurations, but its value is different. 986 ChangeType string `json:"changeType,omitempty"` 987 988 // Element: Object hierarchy path to the change, with levels separated 989 // by a '.' character. For repeated fields, an applicable unique 990 // identifier field is used for the index (usually selector, name, or 991 // id). For maps, the term 'key' is used. If the field has no unique 992 // identifier, the numeric index is used. Examples: - 993 // visibility.rules[selector=="google.LibraryService.ListBooks"].restrict 994 // ion - 995 // quota.metric_rules[selector=="google"].metric_costs[key=="reads"].valu 996 // e - logging.producer_destinations[0] 997 Element string `json:"element,omitempty"` 998 999 // NewValue: Value of the changed object in the new Service 1000 // configuration, in JSON format. This field will not be populated if 1001 // ChangeType == REMOVED. 1002 NewValue string `json:"newValue,omitempty"` 1003 1004 // OldValue: Value of the changed object in the old Service 1005 // configuration, in JSON format. This field will not be populated if 1006 // ChangeType == ADDED. 1007 OldValue string `json:"oldValue,omitempty"` 1008 1009 // ForceSendFields is a list of field names (e.g. "Advices") to 1010 // unconditionally include in API requests. By default, fields with 1011 // empty values are omitted from API requests. However, any non-pointer, 1012 // non-interface field appearing in ForceSendFields will be sent to the 1013 // server regardless of whether the field is empty or not. This may be 1014 // used to include empty fields in Patch requests. 1015 ForceSendFields []string `json:"-"` 1016 1017 // NullFields is a list of field names (e.g. "Advices") to include in 1018 // API requests with the JSON null value. By default, fields with empty 1019 // values are omitted from API requests. However, any field with an 1020 // empty value appearing in NullFields will be sent to the server as 1021 // null. It is an error if a field in this list has a non-empty value. 1022 // This may be used to include null fields in Patch requests. 1023 NullFields []string `json:"-"` 1024} 1025 1026func (s *ConfigChange) MarshalJSON() ([]byte, error) { 1027 type NoMethod ConfigChange 1028 raw := NoMethod(*s) 1029 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1030} 1031 1032// ConfigFile: Generic specification of a source configuration file 1033type ConfigFile struct { 1034 // FileContents: The bytes that constitute the file. 1035 FileContents string `json:"fileContents,omitempty"` 1036 1037 // FilePath: The file name of the configuration file (full or relative 1038 // path). 1039 FilePath string `json:"filePath,omitempty"` 1040 1041 // FileType: The type of configuration file this represents. 1042 // 1043 // Possible values: 1044 // "FILE_TYPE_UNSPECIFIED" - Unknown file type. 1045 // "SERVICE_CONFIG_YAML" - YAML-specification of service. 1046 // "OPEN_API_JSON" - OpenAPI specification, serialized in JSON. 1047 // "OPEN_API_YAML" - OpenAPI specification, serialized in YAML. 1048 // "FILE_DESCRIPTOR_SET_PROTO" - FileDescriptorSet, generated by 1049 // protoc. To generate, use protoc with imports and source info 1050 // included. For an example test.proto file, the following command would 1051 // put the value in a new file named out.pb. $protoc --include_imports 1052 // --include_source_info test.proto -o out.pb 1053 // "PROTO_FILE" - Uncompiled Proto file. Used for storage and display 1054 // purposes only, currently server-side compilation is not supported. 1055 // Should match the inputs to 'protoc' command used to generated 1056 // FILE_DESCRIPTOR_SET_PROTO. A file of this type can only be included 1057 // if at least one file of type FILE_DESCRIPTOR_SET_PROTO is included. 1058 FileType string `json:"fileType,omitempty"` 1059 1060 // ForceSendFields is a list of field names (e.g. "FileContents") to 1061 // unconditionally include in API requests. By default, fields with 1062 // empty values are omitted from API requests. However, any non-pointer, 1063 // non-interface field appearing in ForceSendFields will be sent to the 1064 // server regardless of whether the field is empty or not. This may be 1065 // used to include empty fields in Patch requests. 1066 ForceSendFields []string `json:"-"` 1067 1068 // NullFields is a list of field names (e.g. "FileContents") to include 1069 // in API requests with the JSON null value. By default, fields with 1070 // empty values are omitted from API requests. However, any field with 1071 // an empty value appearing in NullFields will be sent to the server as 1072 // null. It is an error if a field in this list has a non-empty value. 1073 // This may be used to include null fields in Patch requests. 1074 NullFields []string `json:"-"` 1075} 1076 1077func (s *ConfigFile) MarshalJSON() ([]byte, error) { 1078 type NoMethod ConfigFile 1079 raw := NoMethod(*s) 1080 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1081} 1082 1083// ConfigRef: Represents a service configuration with its name and id. 1084type ConfigRef struct { 1085 // Name: Resource name of a service config. It must have the following 1086 // format: "services/{service name}/configs/{config id}". 1087 Name string `json:"name,omitempty"` 1088 1089 // ForceSendFields is a list of field names (e.g. "Name") to 1090 // unconditionally include in API requests. By default, fields with 1091 // empty values are omitted from API requests. However, any non-pointer, 1092 // non-interface field appearing in ForceSendFields will be sent to the 1093 // server regardless of whether the field is empty or not. This may be 1094 // used to include empty fields in Patch requests. 1095 ForceSendFields []string `json:"-"` 1096 1097 // NullFields is a list of field names (e.g. "Name") to include in API 1098 // requests with the JSON null value. By default, fields with empty 1099 // values are omitted from API requests. However, any field with an 1100 // empty value appearing in NullFields will be sent to the server as 1101 // null. It is an error if a field in this list has a non-empty value. 1102 // This may be used to include null fields in Patch requests. 1103 NullFields []string `json:"-"` 1104} 1105 1106func (s *ConfigRef) MarshalJSON() ([]byte, error) { 1107 type NoMethod ConfigRef 1108 raw := NoMethod(*s) 1109 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1110} 1111 1112// ConfigSource: Represents a source file which is used to generate the 1113// service configuration defined by `google.api.Service`. 1114type ConfigSource struct { 1115 // Files: Set of source configuration files that are used to generate a 1116 // service configuration (`google.api.Service`). 1117 Files []*ConfigFile `json:"files,omitempty"` 1118 1119 // Id: A unique ID for a specific instance of this message, typically 1120 // assigned by the client for tracking purpose. If empty, the server may 1121 // choose to generate one instead. 1122 Id string `json:"id,omitempty"` 1123 1124 // ForceSendFields is a list of field names (e.g. "Files") 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. "Files") 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 *ConfigSource) MarshalJSON() ([]byte, error) { 1142 type NoMethod ConfigSource 1143 raw := NoMethod(*s) 1144 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1145} 1146 1147// Context: `Context` defines which contexts an API requests. Example: 1148// context: rules: - selector: "*" requested: - 1149// google.rpc.context.ProjectContext - google.rpc.context.OriginContext 1150// The above specifies that all methods in the API request 1151// `google.rpc.context.ProjectContext` and 1152// `google.rpc.context.OriginContext`. Available context types are 1153// defined in package `google.rpc.context`. This also provides mechanism 1154// to allowlist any protobuf message extension that can be sent in grpc 1155// metadata using “x-goog-ext--bin” and “x-goog-ext--jspb” 1156// format. For example, list any service specific protobuf types that 1157// can appear in grpc metadata as follows in your yaml file: Example: 1158// context: rules: - selector: 1159// "google.example.library.v1.LibraryService.CreateBook" 1160// allowed_request_extensions: - google.foo.v1.NewExtension 1161// allowed_response_extensions: - google.foo.v1.NewExtension You can 1162// also specify extension ID instead of fully qualified extension name 1163// here. 1164type Context struct { 1165 // Rules: A list of RPC context rules that apply to individual API 1166 // methods. **NOTE:** All service configuration rules follow "last one 1167 // wins" order. 1168 Rules []*ContextRule `json:"rules,omitempty"` 1169 1170 // ForceSendFields is a list of field names (e.g. "Rules") to 1171 // unconditionally include in API requests. By default, fields with 1172 // empty values are omitted from API requests. However, any non-pointer, 1173 // non-interface field appearing in ForceSendFields will be sent to the 1174 // server regardless of whether the field is empty or not. This may be 1175 // used to include empty fields in Patch requests. 1176 ForceSendFields []string `json:"-"` 1177 1178 // NullFields is a list of field names (e.g. "Rules") to include in API 1179 // requests with the JSON null value. By default, fields with empty 1180 // values are omitted from API requests. However, any field with an 1181 // empty value appearing in NullFields will be sent to the server as 1182 // null. It is an error if a field in this list has a non-empty value. 1183 // This may be used to include null fields in Patch requests. 1184 NullFields []string `json:"-"` 1185} 1186 1187func (s *Context) MarshalJSON() ([]byte, error) { 1188 type NoMethod Context 1189 raw := NoMethod(*s) 1190 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1191} 1192 1193// ContextRule: A context rule provides information about the context 1194// for an individual API element. 1195type ContextRule struct { 1196 // AllowedRequestExtensions: A list of full type names or extension IDs 1197 // of extensions allowed in grpc side channel from client to backend. 1198 AllowedRequestExtensions []string `json:"allowedRequestExtensions,omitempty"` 1199 1200 // AllowedResponseExtensions: A list of full type names or extension IDs 1201 // of extensions allowed in grpc side channel from backend to client. 1202 AllowedResponseExtensions []string `json:"allowedResponseExtensions,omitempty"` 1203 1204 // Provided: A list of full type names of provided contexts. 1205 Provided []string `json:"provided,omitempty"` 1206 1207 // Requested: A list of full type names of requested contexts. 1208 Requested []string `json:"requested,omitempty"` 1209 1210 // Selector: Selects the methods to which this rule applies. Refer to 1211 // selector for syntax details. 1212 Selector string `json:"selector,omitempty"` 1213 1214 // ForceSendFields is a list of field names (e.g. 1215 // "AllowedRequestExtensions") to unconditionally include in API 1216 // requests. By default, fields with empty values are omitted from API 1217 // requests. However, any non-pointer, non-interface field appearing in 1218 // ForceSendFields will be sent to the server regardless of whether the 1219 // field is empty or not. This may be used to include empty fields in 1220 // Patch requests. 1221 ForceSendFields []string `json:"-"` 1222 1223 // NullFields is a list of field names (e.g. "AllowedRequestExtensions") 1224 // to include in API requests with the JSON null value. By default, 1225 // fields with empty values are omitted from API requests. However, any 1226 // field with an empty value appearing in NullFields will be sent to the 1227 // server as null. It is an error if a field in this list has a 1228 // non-empty value. This may be used to include null fields in Patch 1229 // requests. 1230 NullFields []string `json:"-"` 1231} 1232 1233func (s *ContextRule) MarshalJSON() ([]byte, error) { 1234 type NoMethod ContextRule 1235 raw := NoMethod(*s) 1236 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1237} 1238 1239// Control: Selects and configures the service controller used by the 1240// service. The service controller handles features like abuse, quota, 1241// billing, logging, monitoring, etc. 1242type Control struct { 1243 // Environment: The service control environment to use. If empty, no 1244 // control plane feature (like quota and billing) will be enabled. 1245 Environment string `json:"environment,omitempty"` 1246 1247 // ForceSendFields is a list of field names (e.g. "Environment") to 1248 // unconditionally include in API requests. By default, fields with 1249 // empty values are omitted from API requests. However, any non-pointer, 1250 // non-interface field appearing in ForceSendFields will be sent to the 1251 // server regardless of whether the field is empty or not. This may be 1252 // used to include empty fields in Patch requests. 1253 ForceSendFields []string `json:"-"` 1254 1255 // NullFields is a list of field names (e.g. "Environment") to include 1256 // in API requests with the JSON null value. By default, fields with 1257 // empty values are omitted from API requests. However, any field with 1258 // an empty value appearing in NullFields will be sent to the server as 1259 // null. It is an error if a field in this list has a non-empty value. 1260 // This may be used to include null fields in Patch requests. 1261 NullFields []string `json:"-"` 1262} 1263 1264func (s *Control) MarshalJSON() ([]byte, error) { 1265 type NoMethod Control 1266 raw := NoMethod(*s) 1267 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1268} 1269 1270// CustomError: Customize service error responses. For example, list any 1271// service specific protobuf types that can appear in error detail lists 1272// of error responses. Example: custom_error: types: - 1273// google.foo.v1.CustomError - google.foo.v1.AnotherError 1274type CustomError struct { 1275 // Rules: The list of custom error rules that apply to individual API 1276 // messages. **NOTE:** All service configuration rules follow "last one 1277 // wins" order. 1278 Rules []*CustomErrorRule `json:"rules,omitempty"` 1279 1280 // Types: The list of custom error detail types, e.g. 1281 // 'google.foo.v1.CustomError'. 1282 Types []string `json:"types,omitempty"` 1283 1284 // ForceSendFields is a list of field names (e.g. "Rules") to 1285 // unconditionally include in API requests. By default, fields with 1286 // empty values are omitted from API requests. However, any non-pointer, 1287 // non-interface field appearing in ForceSendFields will be sent to the 1288 // server regardless of whether the field is empty or not. This may be 1289 // used to include empty fields in Patch requests. 1290 ForceSendFields []string `json:"-"` 1291 1292 // NullFields is a list of field names (e.g. "Rules") to include in API 1293 // requests with the JSON null value. By default, fields with empty 1294 // values are omitted from API requests. However, any field with an 1295 // empty value appearing in NullFields will be sent to the server as 1296 // null. It is an error if a field in this list has a non-empty value. 1297 // This may be used to include null fields in Patch requests. 1298 NullFields []string `json:"-"` 1299} 1300 1301func (s *CustomError) MarshalJSON() ([]byte, error) { 1302 type NoMethod CustomError 1303 raw := NoMethod(*s) 1304 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1305} 1306 1307// CustomErrorRule: A custom error rule. 1308type CustomErrorRule struct { 1309 // IsErrorType: Mark this message as possible payload in error response. 1310 // Otherwise, objects of this type will be filtered when they appear in 1311 // error payload. 1312 IsErrorType bool `json:"isErrorType,omitempty"` 1313 1314 // Selector: Selects messages to which this rule applies. Refer to 1315 // selector for syntax details. 1316 Selector string `json:"selector,omitempty"` 1317 1318 // ForceSendFields is a list of field names (e.g. "IsErrorType") to 1319 // unconditionally include in API requests. By default, fields with 1320 // empty values are omitted from API requests. However, any non-pointer, 1321 // non-interface field appearing in ForceSendFields will be sent to the 1322 // server regardless of whether the field is empty or not. This may be 1323 // used to include empty fields in Patch requests. 1324 ForceSendFields []string `json:"-"` 1325 1326 // NullFields is a list of field names (e.g. "IsErrorType") to include 1327 // in API requests with the JSON null value. By default, fields with 1328 // empty values are omitted from API requests. However, any field with 1329 // an empty value appearing in NullFields will be sent to the server as 1330 // null. It is an error if a field in this list has a non-empty value. 1331 // This may be used to include null fields in Patch requests. 1332 NullFields []string `json:"-"` 1333} 1334 1335func (s *CustomErrorRule) MarshalJSON() ([]byte, error) { 1336 type NoMethod CustomErrorRule 1337 raw := NoMethod(*s) 1338 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1339} 1340 1341// CustomHttpPattern: A custom pattern is used for defining custom HTTP 1342// verb. 1343type CustomHttpPattern struct { 1344 // Kind: The name of this custom HTTP verb. 1345 Kind string `json:"kind,omitempty"` 1346 1347 // Path: The path matched by this custom verb. 1348 Path string `json:"path,omitempty"` 1349 1350 // ForceSendFields is a list of field names (e.g. "Kind") to 1351 // unconditionally include in API requests. By default, fields with 1352 // empty values are omitted from API requests. However, any non-pointer, 1353 // non-interface field appearing in ForceSendFields will be sent to the 1354 // server regardless of whether the field is empty or not. This may be 1355 // used to include empty fields in Patch requests. 1356 ForceSendFields []string `json:"-"` 1357 1358 // NullFields is a list of field names (e.g. "Kind") to include in API 1359 // requests with the JSON null value. By default, fields with empty 1360 // values are omitted from API requests. However, any field with an 1361 // empty value appearing in NullFields will be sent to the server as 1362 // null. It is an error if a field in this list has a non-empty value. 1363 // This may be used to include null fields in Patch requests. 1364 NullFields []string `json:"-"` 1365} 1366 1367func (s *CustomHttpPattern) MarshalJSON() ([]byte, error) { 1368 type NoMethod CustomHttpPattern 1369 raw := NoMethod(*s) 1370 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1371} 1372 1373// DeleteServiceStrategy: Strategy used to delete a service. This 1374// strategy is a placeholder only used by the system generated rollout 1375// to delete a service. 1376type DeleteServiceStrategy struct { 1377} 1378 1379// Diagnostic: Represents a diagnostic message (error or warning) 1380type Diagnostic struct { 1381 // Kind: The kind of diagnostic information provided. 1382 // 1383 // Possible values: 1384 // "WARNING" - Warnings and errors 1385 // "ERROR" - Only errors 1386 Kind string `json:"kind,omitempty"` 1387 1388 // Location: File name and line number of the error or warning. 1389 Location string `json:"location,omitempty"` 1390 1391 // Message: Message describing the error or warning. 1392 Message string `json:"message,omitempty"` 1393 1394 // ForceSendFields is a list of field names (e.g. "Kind") to 1395 // unconditionally include in API requests. By default, fields with 1396 // empty values are omitted from API requests. However, any non-pointer, 1397 // non-interface field appearing in ForceSendFields will be sent to the 1398 // server regardless of whether the field is empty or not. This may be 1399 // used to include empty fields in Patch requests. 1400 ForceSendFields []string `json:"-"` 1401 1402 // NullFields is a list of field names (e.g. "Kind") to include in API 1403 // requests with the JSON null value. By default, fields with empty 1404 // values are omitted from API requests. However, any field with an 1405 // empty value appearing in NullFields will be sent to the server as 1406 // null. It is an error if a field in this list has a non-empty value. 1407 // This may be used to include null fields in Patch requests. 1408 NullFields []string `json:"-"` 1409} 1410 1411func (s *Diagnostic) MarshalJSON() ([]byte, error) { 1412 type NoMethod Diagnostic 1413 raw := NoMethod(*s) 1414 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1415} 1416 1417// DisableServiceResponse: Operation payload for DisableService method. 1418type DisableServiceResponse struct { 1419} 1420 1421// Documentation: `Documentation` provides the information for 1422// describing a service. Example: documentation: summary: > The Google 1423// Calendar API gives access to most calendar features. pages: - name: 1424// Overview content: (== include google/foo/overview.md ==) - name: 1425// Tutorial content: (== include google/foo/tutorial.md ==) subpages; - 1426// name: Java content: (== include google/foo/tutorial_java.md ==) 1427// rules: - selector: google.calendar.Calendar.Get description: > ... - 1428// selector: google.calendar.Calendar.Put description: > ... 1429// Documentation is provided in markdown syntax. In addition to standard 1430// markdown features, definition lists, tables and fenced code blocks 1431// are supported. Section headers can be provided and are interpreted 1432// relative to the section nesting of the context where a documentation 1433// fragment is embedded. Documentation from the IDL is merged with 1434// documentation defined via the config at normalization time, where 1435// documentation provided by config rules overrides IDL provided. A 1436// number of constructs specific to the API platform are supported in 1437// documentation text. In order to reference a proto element, the 1438// following notation can be used: [fully.qualified.proto.name][] To 1439// override the display text used for the link, this can be used: 1440// [display text][fully.qualified.proto.name] Text can be excluded from 1441// doc using the following notation: (-- internal comment --) A few 1442// directives are available in documentation. Note that directives must 1443// appear on a single line to be properly identified. The `include` 1444// directive includes a markdown file from an external source: (== 1445// include path/to/file ==) The `resource_for` directive marks a message 1446// to be the resource of a collection in REST view. If it is not 1447// specified, tools attempt to infer the resource from the operations in 1448// a collection: (== resource_for v1.shelves.books ==) The directive 1449// `suppress_warning` does not directly affect documentation and is 1450// documented together with service config validation. 1451type Documentation struct { 1452 // DocumentationRootUrl: The URL to the root of documentation. 1453 DocumentationRootUrl string `json:"documentationRootUrl,omitempty"` 1454 1455 // Overview: Declares a single overview page. For example: 1456 // documentation: summary: ... overview: (== include overview.md ==) 1457 // This is a shortcut for the following declaration (using pages style): 1458 // documentation: summary: ... pages: - name: Overview content: (== 1459 // include overview.md ==) Note: you cannot specify both `overview` 1460 // field and `pages` field. 1461 Overview string `json:"overview,omitempty"` 1462 1463 // Pages: The top level pages for the documentation set. 1464 Pages []*Page `json:"pages,omitempty"` 1465 1466 // Rules: A list of documentation rules that apply to individual API 1467 // elements. **NOTE:** All service configuration rules follow "last one 1468 // wins" order. 1469 Rules []*DocumentationRule `json:"rules,omitempty"` 1470 1471 // ServiceRootUrl: Specifies the service root url if the default one 1472 // (the service name from the yaml file) is not suitable. This can be 1473 // seen in any fully specified service urls as well as sections that 1474 // show a base that other urls are relative to. 1475 ServiceRootUrl string `json:"serviceRootUrl,omitempty"` 1476 1477 // Summary: A short summary of what the service does. Can only be 1478 // provided by plain text. 1479 Summary string `json:"summary,omitempty"` 1480 1481 // ForceSendFields is a list of field names (e.g. 1482 // "DocumentationRootUrl") to unconditionally include in API requests. 1483 // By default, fields with empty values are omitted from API requests. 1484 // However, any non-pointer, non-interface field appearing in 1485 // ForceSendFields will be sent to the server regardless of whether the 1486 // field is empty or not. This may be used to include empty fields in 1487 // Patch requests. 1488 ForceSendFields []string `json:"-"` 1489 1490 // NullFields is a list of field names (e.g. "DocumentationRootUrl") to 1491 // include in API requests with the JSON null value. By default, fields 1492 // with empty values are omitted from API requests. However, any field 1493 // with an empty value appearing in NullFields will be sent to the 1494 // server as null. It is an error if a field in this list has a 1495 // non-empty value. This may be used to include null fields in Patch 1496 // requests. 1497 NullFields []string `json:"-"` 1498} 1499 1500func (s *Documentation) MarshalJSON() ([]byte, error) { 1501 type NoMethod Documentation 1502 raw := NoMethod(*s) 1503 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1504} 1505 1506// DocumentationRule: A documentation rule provides information about 1507// individual API elements. 1508type DocumentationRule struct { 1509 // DeprecationDescription: Deprecation description of the selected 1510 // element(s). It can be provided if an element is marked as 1511 // `deprecated`. 1512 DeprecationDescription string `json:"deprecationDescription,omitempty"` 1513 1514 // Description: Description of the selected API(s). 1515 Description string `json:"description,omitempty"` 1516 1517 // Selector: The selector is a comma-separated list of patterns. Each 1518 // pattern is a qualified name of the element which may end in "*", 1519 // indicating a wildcard. Wildcards are only allowed at the end and for 1520 // a whole component of the qualified name, i.e. "foo.*" is ok, but not 1521 // "foo.b*" or "foo.*.bar". A wildcard will match one or more 1522 // components. To specify a default for all applicable elements, the 1523 // whole pattern "*" is used. 1524 Selector string `json:"selector,omitempty"` 1525 1526 // ForceSendFields is a list of field names (e.g. 1527 // "DeprecationDescription") to unconditionally include in API requests. 1528 // By default, fields with empty values are omitted from API requests. 1529 // However, any non-pointer, non-interface field appearing in 1530 // ForceSendFields will be sent to the server regardless of whether the 1531 // field is empty or not. This may be used to include empty fields in 1532 // Patch requests. 1533 ForceSendFields []string `json:"-"` 1534 1535 // NullFields is a list of field names (e.g. "DeprecationDescription") 1536 // to include in API requests with the JSON null value. By default, 1537 // fields with empty values are omitted from API requests. However, any 1538 // field with an empty value appearing in NullFields will be sent to the 1539 // server as null. It is an error if a field in this list has a 1540 // non-empty value. This may be used to include null fields in Patch 1541 // requests. 1542 NullFields []string `json:"-"` 1543} 1544 1545func (s *DocumentationRule) MarshalJSON() ([]byte, error) { 1546 type NoMethod DocumentationRule 1547 raw := NoMethod(*s) 1548 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1549} 1550 1551// EnableServiceRequest: Request message for EnableService method. 1552type EnableServiceRequest struct { 1553 // ConsumerId: Required. The identity of consumer resource which service 1554 // enablement will be applied to. The Google Service Management 1555 // implementation accepts the following forms: - "project:" Note: this 1556 // is made compatible with 1557 // google.api.servicecontrol.v1.Operation.consumer_id. 1558 ConsumerId string `json:"consumerId,omitempty"` 1559 1560 // ForceSendFields is a list of field names (e.g. "ConsumerId") to 1561 // unconditionally include in API requests. By default, fields with 1562 // empty values are omitted from API requests. However, any non-pointer, 1563 // non-interface field appearing in ForceSendFields will be sent to the 1564 // server regardless of whether the field is empty or not. This may be 1565 // used to include empty fields in Patch requests. 1566 ForceSendFields []string `json:"-"` 1567 1568 // NullFields is a list of field names (e.g. "ConsumerId") to include in 1569 // API requests with the JSON null value. By default, fields with empty 1570 // values are omitted from API requests. However, any field with an 1571 // empty value appearing in NullFields will be sent to the server as 1572 // null. It is an error if a field in this list has a non-empty value. 1573 // This may be used to include null fields in Patch requests. 1574 NullFields []string `json:"-"` 1575} 1576 1577func (s *EnableServiceRequest) MarshalJSON() ([]byte, error) { 1578 type NoMethod EnableServiceRequest 1579 raw := NoMethod(*s) 1580 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1581} 1582 1583// EnableServiceResponse: Operation payload for EnableService method. 1584type EnableServiceResponse struct { 1585} 1586 1587// Endpoint: `Endpoint` describes a network endpoint that serves a set 1588// of APIs. A service may expose any number of endpoints, and all 1589// endpoints share the same service configuration, such as quota 1590// configuration and monitoring configuration. Example service 1591// configuration: name: library-example.googleapis.com endpoints: # 1592// Below entry makes 'google.example.library.v1.Library' # API be served 1593// from endpoint address library-example.googleapis.com. # It also 1594// allows HTTP OPTIONS calls to be passed to the backend, for # it to 1595// decide whether the subsequent cross-origin request is # allowed to 1596// proceed. - name: library-example.googleapis.com allow_cors: true 1597type Endpoint struct { 1598 // Aliases: DEPRECATED: This field is no longer supported. Instead of 1599 // using aliases, please specify multiple google.api.Endpoint for each 1600 // of the intended aliases. Additional names that this endpoint will be 1601 // hosted on. 1602 Aliases []string `json:"aliases,omitempty"` 1603 1604 // AllowCors: Allowing 1605 // [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing), 1606 // aka cross-domain traffic, would allow the backends served from this 1607 // endpoint to receive and respond to HTTP OPTIONS requests. The 1608 // response will be used by the browser to determine whether the 1609 // subsequent cross-origin request is allowed to proceed. 1610 AllowCors bool `json:"allowCors,omitempty"` 1611 1612 // Name: The canonical name of this endpoint. 1613 Name string `json:"name,omitempty"` 1614 1615 // Target: The specification of an Internet routable address of API 1616 // frontend that will handle requests to this [API 1617 // Endpoint](https://cloud.google.com/apis/design/glossary). It should 1618 // be either a valid IPv4 address or a fully-qualified domain name. For 1619 // example, "8.8.8.8" or "myservice.appspot.com". 1620 Target string `json:"target,omitempty"` 1621 1622 // ForceSendFields is a list of field names (e.g. "Aliases") to 1623 // unconditionally include in API requests. By default, fields with 1624 // empty values are omitted from API requests. However, any non-pointer, 1625 // non-interface field appearing in ForceSendFields will be sent to the 1626 // server regardless of whether the field is empty or not. This may be 1627 // used to include empty fields in Patch requests. 1628 ForceSendFields []string `json:"-"` 1629 1630 // NullFields is a list of field names (e.g. "Aliases") to include in 1631 // API requests with the JSON null value. By default, fields with empty 1632 // values are omitted from API requests. However, any field with an 1633 // empty value appearing in NullFields will be sent to the server as 1634 // null. It is an error if a field in this list has a non-empty value. 1635 // This may be used to include null fields in Patch requests. 1636 NullFields []string `json:"-"` 1637} 1638 1639func (s *Endpoint) MarshalJSON() ([]byte, error) { 1640 type NoMethod Endpoint 1641 raw := NoMethod(*s) 1642 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1643} 1644 1645// Enum: Enum type definition. 1646type Enum struct { 1647 // Enumvalue: Enum value definitions. 1648 Enumvalue []*EnumValue `json:"enumvalue,omitempty"` 1649 1650 // Name: Enum type name. 1651 Name string `json:"name,omitempty"` 1652 1653 // Options: Protocol buffer options. 1654 Options []*Option `json:"options,omitempty"` 1655 1656 // SourceContext: The source context. 1657 SourceContext *SourceContext `json:"sourceContext,omitempty"` 1658 1659 // Syntax: The source syntax. 1660 // 1661 // Possible values: 1662 // "SYNTAX_PROTO2" - Syntax `proto2`. 1663 // "SYNTAX_PROTO3" - Syntax `proto3`. 1664 Syntax string `json:"syntax,omitempty"` 1665 1666 // ForceSendFields is a list of field names (e.g. "Enumvalue") to 1667 // unconditionally include in API requests. By default, fields with 1668 // empty values are omitted from API requests. However, any non-pointer, 1669 // non-interface field appearing in ForceSendFields will be sent to the 1670 // server regardless of whether the field is empty or not. This may be 1671 // used to include empty fields in Patch requests. 1672 ForceSendFields []string `json:"-"` 1673 1674 // NullFields is a list of field names (e.g. "Enumvalue") to include in 1675 // API requests with the JSON null value. By default, fields with empty 1676 // values are omitted from API requests. However, any field with an 1677 // empty value appearing in NullFields will be sent to the server as 1678 // null. It is an error if a field in this list has a non-empty value. 1679 // This may be used to include null fields in Patch requests. 1680 NullFields []string `json:"-"` 1681} 1682 1683func (s *Enum) MarshalJSON() ([]byte, error) { 1684 type NoMethod Enum 1685 raw := NoMethod(*s) 1686 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1687} 1688 1689// EnumValue: Enum value definition. 1690type EnumValue struct { 1691 // Name: Enum value name. 1692 Name string `json:"name,omitempty"` 1693 1694 // Number: Enum value number. 1695 Number int64 `json:"number,omitempty"` 1696 1697 // Options: Protocol buffer options. 1698 Options []*Option `json:"options,omitempty"` 1699 1700 // ForceSendFields is a list of field names (e.g. "Name") to 1701 // unconditionally include in API requests. By default, fields with 1702 // empty values are omitted from API requests. However, any non-pointer, 1703 // non-interface field appearing in ForceSendFields will be sent to the 1704 // server regardless of whether the field is empty or not. This may be 1705 // used to include empty fields in Patch requests. 1706 ForceSendFields []string `json:"-"` 1707 1708 // NullFields is a list of field names (e.g. "Name") to include in API 1709 // requests with the JSON null value. By default, fields with empty 1710 // values are omitted from API requests. However, any field with an 1711 // empty value appearing in NullFields will be sent to the server as 1712 // null. It is an error if a field in this list has a non-empty value. 1713 // This may be used to include null fields in Patch requests. 1714 NullFields []string `json:"-"` 1715} 1716 1717func (s *EnumValue) MarshalJSON() ([]byte, error) { 1718 type NoMethod EnumValue 1719 raw := NoMethod(*s) 1720 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1721} 1722 1723// Expr: Represents a textual expression in the Common Expression 1724// Language (CEL) syntax. CEL is a C-like expression language. The 1725// syntax and semantics of CEL are documented at 1726// https://github.com/google/cel-spec. Example (Comparison): title: 1727// "Summary size limit" description: "Determines if a summary is less 1728// than 100 chars" expression: "document.summary.size() < 100" Example 1729// (Equality): title: "Requestor is owner" description: "Determines if 1730// requestor is the document owner" expression: "document.owner == 1731// request.auth.claims.email" Example (Logic): title: "Public documents" 1732// description: "Determine whether the document should be publicly 1733// visible" expression: "document.type != 'private' && document.type != 1734// 'internal'" Example (Data Manipulation): title: "Notification string" 1735// description: "Create a notification string with a timestamp." 1736// expression: "'New message received at ' + 1737// string(document.create_time)" The exact variables and functions that 1738// may be referenced within an expression are determined by the service 1739// that evaluates it. See the service documentation for additional 1740// information. 1741type Expr struct { 1742 // Description: Optional. Description of the expression. This is a 1743 // longer text which describes the expression, e.g. when hovered over it 1744 // in a UI. 1745 Description string `json:"description,omitempty"` 1746 1747 // Expression: Textual representation of an expression in Common 1748 // Expression Language syntax. 1749 Expression string `json:"expression,omitempty"` 1750 1751 // Location: Optional. String indicating the location of the expression 1752 // for error reporting, e.g. a file name and a position in the file. 1753 Location string `json:"location,omitempty"` 1754 1755 // Title: Optional. Title for the expression, i.e. a short string 1756 // describing its purpose. This can be used e.g. in UIs which allow to 1757 // enter the expression. 1758 Title string `json:"title,omitempty"` 1759 1760 // ForceSendFields is a list of field names (e.g. "Description") to 1761 // unconditionally include in API requests. By default, fields with 1762 // empty values are omitted from API requests. However, any non-pointer, 1763 // non-interface field appearing in ForceSendFields will be sent to the 1764 // server regardless of whether the field is empty or not. This may be 1765 // used to include empty fields in Patch requests. 1766 ForceSendFields []string `json:"-"` 1767 1768 // NullFields is a list of field names (e.g. "Description") to include 1769 // in API requests with the JSON null value. By default, fields with 1770 // empty values are omitted from API requests. However, any field with 1771 // an empty value appearing in NullFields will be sent to the server as 1772 // null. It is an error if a field in this list has a non-empty value. 1773 // This may be used to include null fields in Patch requests. 1774 NullFields []string `json:"-"` 1775} 1776 1777func (s *Expr) MarshalJSON() ([]byte, error) { 1778 type NoMethod Expr 1779 raw := NoMethod(*s) 1780 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1781} 1782 1783// Field: A single field of a message type. 1784type Field struct { 1785 // Cardinality: The field cardinality. 1786 // 1787 // Possible values: 1788 // "CARDINALITY_UNKNOWN" - For fields with unknown cardinality. 1789 // "CARDINALITY_OPTIONAL" - For optional fields. 1790 // "CARDINALITY_REQUIRED" - For required fields. Proto2 syntax only. 1791 // "CARDINALITY_REPEATED" - For repeated fields. 1792 Cardinality string `json:"cardinality,omitempty"` 1793 1794 // DefaultValue: The string value of the default value of this field. 1795 // Proto2 syntax only. 1796 DefaultValue string `json:"defaultValue,omitempty"` 1797 1798 // JsonName: The field JSON name. 1799 JsonName string `json:"jsonName,omitempty"` 1800 1801 // Kind: The field type. 1802 // 1803 // Possible values: 1804 // "TYPE_UNKNOWN" - Field type unknown. 1805 // "TYPE_DOUBLE" - Field type double. 1806 // "TYPE_FLOAT" - Field type float. 1807 // "TYPE_INT64" - Field type int64. 1808 // "TYPE_UINT64" - Field type uint64. 1809 // "TYPE_INT32" - Field type int32. 1810 // "TYPE_FIXED64" - Field type fixed64. 1811 // "TYPE_FIXED32" - Field type fixed32. 1812 // "TYPE_BOOL" - Field type bool. 1813 // "TYPE_STRING" - Field type string. 1814 // "TYPE_GROUP" - Field type group. Proto2 syntax only, and 1815 // deprecated. 1816 // "TYPE_MESSAGE" - Field type message. 1817 // "TYPE_BYTES" - Field type bytes. 1818 // "TYPE_UINT32" - Field type uint32. 1819 // "TYPE_ENUM" - Field type enum. 1820 // "TYPE_SFIXED32" - Field type sfixed32. 1821 // "TYPE_SFIXED64" - Field type sfixed64. 1822 // "TYPE_SINT32" - Field type sint32. 1823 // "TYPE_SINT64" - Field type sint64. 1824 Kind string `json:"kind,omitempty"` 1825 1826 // Name: The field name. 1827 Name string `json:"name,omitempty"` 1828 1829 // Number: The field number. 1830 Number int64 `json:"number,omitempty"` 1831 1832 // OneofIndex: The index of the field type in `Type.oneofs`, for message 1833 // or enumeration types. The first type has index 1; zero means the type 1834 // is not in the list. 1835 OneofIndex int64 `json:"oneofIndex,omitempty"` 1836 1837 // Options: The protocol buffer options. 1838 Options []*Option `json:"options,omitempty"` 1839 1840 // Packed: Whether to use alternative packed wire representation. 1841 Packed bool `json:"packed,omitempty"` 1842 1843 // TypeUrl: The field type URL, without the scheme, for message or 1844 // enumeration types. Example: 1845 // "type.googleapis.com/google.protobuf.Timestamp". 1846 TypeUrl string `json:"typeUrl,omitempty"` 1847 1848 // ForceSendFields is a list of field names (e.g. "Cardinality") to 1849 // unconditionally include in API requests. By default, fields with 1850 // empty values are omitted from API requests. However, any non-pointer, 1851 // non-interface field appearing in ForceSendFields will be sent to the 1852 // server regardless of whether the field is empty or not. This may be 1853 // used to include empty fields in Patch requests. 1854 ForceSendFields []string `json:"-"` 1855 1856 // NullFields is a list of field names (e.g. "Cardinality") to include 1857 // in API requests with the JSON null value. By default, fields with 1858 // empty values are omitted from API requests. However, any field with 1859 // an empty value appearing in NullFields will be sent to the server as 1860 // null. It is an error if a field in this list has a non-empty value. 1861 // This may be used to include null fields in Patch requests. 1862 NullFields []string `json:"-"` 1863} 1864 1865func (s *Field) MarshalJSON() ([]byte, error) { 1866 type NoMethod Field 1867 raw := NoMethod(*s) 1868 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1869} 1870 1871// FlowErrorDetails: Encapsulation of flow-specific error details for 1872// debugging. Used as a details field on an error Status, not intended 1873// for external use. 1874type FlowErrorDetails struct { 1875 // ExceptionType: The type of exception (as a class name). 1876 ExceptionType string `json:"exceptionType,omitempty"` 1877 1878 // FlowStepId: The step that failed. 1879 FlowStepId string `json:"flowStepId,omitempty"` 1880 1881 // ForceSendFields is a list of field names (e.g. "ExceptionType") to 1882 // unconditionally include in API requests. By default, fields with 1883 // empty values are omitted from API requests. However, any non-pointer, 1884 // non-interface field appearing in ForceSendFields will be sent to the 1885 // server regardless of whether the field is empty or not. This may be 1886 // used to include empty fields in Patch requests. 1887 ForceSendFields []string `json:"-"` 1888 1889 // NullFields is a list of field names (e.g. "ExceptionType") to include 1890 // in API requests with the JSON null value. By default, fields with 1891 // empty values are omitted from API requests. However, any field with 1892 // an empty value appearing in NullFields will be sent to the server as 1893 // null. It is an error if a field in this list has a non-empty value. 1894 // This may be used to include null fields in Patch requests. 1895 NullFields []string `json:"-"` 1896} 1897 1898func (s *FlowErrorDetails) MarshalJSON() ([]byte, error) { 1899 type NoMethod FlowErrorDetails 1900 raw := NoMethod(*s) 1901 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1902} 1903 1904// GenerateConfigReportRequest: Request message for GenerateConfigReport 1905// method. 1906type GenerateConfigReportRequest struct { 1907 // NewConfig: Required. Service configuration for which we want to 1908 // generate the report. For this version of API, the supported types are 1909 // google.api.servicemanagement.v1.ConfigRef, 1910 // google.api.servicemanagement.v1.ConfigSource, and google.api.Service 1911 NewConfig googleapi.RawMessage `json:"newConfig,omitempty"` 1912 1913 // OldConfig: Optional. Service configuration against which the 1914 // comparison will be done. For this version of API, the supported types 1915 // are google.api.servicemanagement.v1.ConfigRef, 1916 // google.api.servicemanagement.v1.ConfigSource, and google.api.Service 1917 OldConfig googleapi.RawMessage `json:"oldConfig,omitempty"` 1918 1919 // ForceSendFields is a list of field names (e.g. "NewConfig") to 1920 // unconditionally include in API requests. By default, fields with 1921 // empty values are omitted from API requests. However, any non-pointer, 1922 // non-interface field appearing in ForceSendFields will be sent to the 1923 // server regardless of whether the field is empty or not. This may be 1924 // used to include empty fields in Patch requests. 1925 ForceSendFields []string `json:"-"` 1926 1927 // NullFields is a list of field names (e.g. "NewConfig") to include in 1928 // API requests with the JSON null value. By default, fields with empty 1929 // values are omitted from API requests. However, any field with an 1930 // empty value appearing in NullFields will be sent to the server as 1931 // null. It is an error if a field in this list has a non-empty value. 1932 // This may be used to include null fields in Patch requests. 1933 NullFields []string `json:"-"` 1934} 1935 1936func (s *GenerateConfigReportRequest) MarshalJSON() ([]byte, error) { 1937 type NoMethod GenerateConfigReportRequest 1938 raw := NoMethod(*s) 1939 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1940} 1941 1942// GenerateConfigReportResponse: Response message for 1943// GenerateConfigReport method. 1944type GenerateConfigReportResponse struct { 1945 // ChangeReports: list of ChangeReport, each corresponding to comparison 1946 // between two service configurations. 1947 ChangeReports []*ChangeReport `json:"changeReports,omitempty"` 1948 1949 // Diagnostics: Errors / Linter warnings associated with the service 1950 // definition this report belongs to. 1951 Diagnostics []*Diagnostic `json:"diagnostics,omitempty"` 1952 1953 // Id: ID of the service configuration this report belongs to. 1954 Id string `json:"id,omitempty"` 1955 1956 // ServiceName: Name of the service this report belongs to. 1957 ServiceName string `json:"serviceName,omitempty"` 1958 1959 // ServerResponse contains the HTTP response code and headers from the 1960 // server. 1961 googleapi.ServerResponse `json:"-"` 1962 1963 // ForceSendFields is a list of field names (e.g. "ChangeReports") to 1964 // unconditionally include in API requests. By default, fields with 1965 // empty values are omitted from API requests. However, any non-pointer, 1966 // non-interface field appearing in ForceSendFields will be sent to the 1967 // server regardless of whether the field is empty or not. This may be 1968 // used to include empty fields in Patch requests. 1969 ForceSendFields []string `json:"-"` 1970 1971 // NullFields is a list of field names (e.g. "ChangeReports") to include 1972 // in API requests with the JSON null value. By default, fields with 1973 // empty values are omitted from API requests. However, any field with 1974 // an empty value appearing in NullFields will be sent to the server as 1975 // null. It is an error if a field in this list has a non-empty value. 1976 // This may be used to include null fields in Patch requests. 1977 NullFields []string `json:"-"` 1978} 1979 1980func (s *GenerateConfigReportResponse) MarshalJSON() ([]byte, error) { 1981 type NoMethod GenerateConfigReportResponse 1982 raw := NoMethod(*s) 1983 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1984} 1985 1986// GetIamPolicyRequest: Request message for `GetIamPolicy` method. 1987type GetIamPolicyRequest struct { 1988 // Options: OPTIONAL: A `GetPolicyOptions` object for specifying options 1989 // to `GetIamPolicy`. 1990 Options *GetPolicyOptions `json:"options,omitempty"` 1991 1992 // ForceSendFields is a list of field names (e.g. "Options") to 1993 // unconditionally include in API requests. By default, fields with 1994 // empty values are omitted from API requests. However, any non-pointer, 1995 // non-interface field appearing in ForceSendFields will be sent to the 1996 // server regardless of whether the field is empty or not. This may be 1997 // used to include empty fields in Patch requests. 1998 ForceSendFields []string `json:"-"` 1999 2000 // NullFields is a list of field names (e.g. "Options") to include in 2001 // API requests with the JSON null value. By default, fields with empty 2002 // values are omitted from API requests. However, any field with an 2003 // empty value appearing in NullFields will be sent to the server as 2004 // null. It is an error if a field in this list has a non-empty value. 2005 // This may be used to include null fields in Patch requests. 2006 NullFields []string `json:"-"` 2007} 2008 2009func (s *GetIamPolicyRequest) MarshalJSON() ([]byte, error) { 2010 type NoMethod GetIamPolicyRequest 2011 raw := NoMethod(*s) 2012 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2013} 2014 2015// GetPolicyOptions: Encapsulates settings provided to GetIamPolicy. 2016type GetPolicyOptions struct { 2017 // RequestedPolicyVersion: Optional. The policy format version to be 2018 // returned. Valid values are 0, 1, and 3. Requests specifying an 2019 // invalid value will be rejected. Requests for policies with any 2020 // conditional bindings must specify version 3. Policies without any 2021 // conditional bindings may specify any valid value or leave the field 2022 // unset. To learn which resources support conditions in their IAM 2023 // policies, see the [IAM 2024 // documentation](https://cloud.google.com/iam/help/conditions/resource-p 2025 // olicies). 2026 RequestedPolicyVersion int64 `json:"requestedPolicyVersion,omitempty"` 2027 2028 // ForceSendFields is a list of field names (e.g. 2029 // "RequestedPolicyVersion") to unconditionally include in API requests. 2030 // By default, fields with empty values are omitted from API requests. 2031 // However, any non-pointer, non-interface field appearing in 2032 // ForceSendFields will be sent to the server regardless of whether the 2033 // field is empty or not. This may be used to include empty fields in 2034 // Patch requests. 2035 ForceSendFields []string `json:"-"` 2036 2037 // NullFields is a list of field names (e.g. "RequestedPolicyVersion") 2038 // to include in API requests with the JSON null value. By default, 2039 // fields with empty values are omitted from API requests. However, any 2040 // field with an empty value appearing in NullFields will be sent to the 2041 // server as null. It is an error if a field in this list has a 2042 // non-empty value. This may be used to include null fields in Patch 2043 // requests. 2044 NullFields []string `json:"-"` 2045} 2046 2047func (s *GetPolicyOptions) MarshalJSON() ([]byte, error) { 2048 type NoMethod GetPolicyOptions 2049 raw := NoMethod(*s) 2050 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2051} 2052 2053// Http: Defines the HTTP configuration for an API service. It contains 2054// a list of HttpRule, each specifying the mapping of an RPC method to 2055// one or more HTTP REST API methods. 2056type Http struct { 2057 // FullyDecodeReservedExpansion: When set to true, URL path parameters 2058 // will be fully URI-decoded except in cases of single segment matches 2059 // in reserved expansion, where "%2F" will be left encoded. The default 2060 // behavior is to not decode RFC 6570 reserved characters in multi 2061 // segment matches. 2062 FullyDecodeReservedExpansion bool `json:"fullyDecodeReservedExpansion,omitempty"` 2063 2064 // Rules: A list of HTTP configuration rules that apply to individual 2065 // API methods. **NOTE:** All service configuration rules follow "last 2066 // one wins" order. 2067 Rules []*HttpRule `json:"rules,omitempty"` 2068 2069 // ForceSendFields is a list of field names (e.g. 2070 // "FullyDecodeReservedExpansion") to unconditionally include in API 2071 // requests. By default, fields with empty values are omitted from API 2072 // requests. However, any non-pointer, non-interface field appearing in 2073 // ForceSendFields will be sent to the server regardless of whether the 2074 // field is empty or not. This may be used to include empty fields in 2075 // Patch requests. 2076 ForceSendFields []string `json:"-"` 2077 2078 // NullFields is a list of field names (e.g. 2079 // "FullyDecodeReservedExpansion") to include in API requests with the 2080 // JSON null value. By default, fields with empty values are omitted 2081 // from API requests. However, any field with an empty value appearing 2082 // in NullFields will be sent to the server as null. It is an error if a 2083 // field in this list has a non-empty value. This may be used to include 2084 // null fields in Patch requests. 2085 NullFields []string `json:"-"` 2086} 2087 2088func (s *Http) MarshalJSON() ([]byte, error) { 2089 type NoMethod Http 2090 raw := NoMethod(*s) 2091 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2092} 2093 2094// HttpRule: # gRPC Transcoding gRPC Transcoding is a feature for 2095// mapping between a gRPC method and one or more HTTP REST endpoints. It 2096// allows developers to build a single API service that supports both 2097// gRPC APIs and REST APIs. Many systems, including [Google 2098// APIs](https://github.com/googleapis/googleapis), [Cloud 2099// Endpoints](https://cloud.google.com/endpoints), [gRPC 2100// Gateway](https://github.com/grpc-ecosystem/grpc-gateway), and 2101// [Envoy](https://github.com/envoyproxy/envoy) proxy support this 2102// feature and use it for large scale production services. `HttpRule` 2103// defines the schema of the gRPC/REST mapping. The mapping specifies 2104// how different portions of the gRPC request message are mapped to the 2105// URL path, URL query parameters, and HTTP request body. It also 2106// controls how the gRPC response message is mapped to the HTTP response 2107// body. `HttpRule` is typically specified as an `google.api.http` 2108// annotation on the gRPC method. Each mapping specifies a URL path 2109// template and an HTTP method. The path template may refer to one or 2110// more fields in the gRPC request message, as long as each field is a 2111// non-repeated field with a primitive (non-message) type. The path 2112// template controls how fields of the request message are mapped to the 2113// URL path. Example: service Messaging { rpc 2114// GetMessage(GetMessageRequest) returns (Message) { option 2115// (google.api.http) = { get: "/v1/{name=messages/*}" }; } } message 2116// GetMessageRequest { string name = 1; // Mapped to URL path. } message 2117// Message { string text = 1; // The resource content. } This enables an 2118// HTTP REST to gRPC mapping as below: HTTP | gRPC -----|----- `GET 2119// /v1/messages/123456` | `GetMessage(name: "messages/123456")` Any 2120// fields in the request message which are not bound by the path 2121// template automatically become HTTP query parameters if there is no 2122// HTTP request body. For example: service Messaging { rpc 2123// GetMessage(GetMessageRequest) returns (Message) { option 2124// (google.api.http) = { get:"/v1/messages/{message_id}" }; } } message 2125// GetMessageRequest { message SubMessage { string subfield = 1; } 2126// string message_id = 1; // Mapped to URL path. int64 revision = 2; // 2127// Mapped to URL query parameter `revision`. SubMessage sub = 3; // 2128// Mapped to URL query parameter `sub.subfield`. } This enables a HTTP 2129// JSON to RPC mapping as below: HTTP | gRPC -----|----- `GET 2130// /v1/messages/123456?revision=2&sub.subfield=foo` | 2131// `GetMessage(message_id: "123456" revision: 2 sub: 2132// SubMessage(subfield: "foo"))` Note that fields which are mapped to 2133// URL query parameters must have a primitive type or a repeated 2134// primitive type or a non-repeated message type. In the case of a 2135// repeated type, the parameter can be repeated in the URL as 2136// `...?param=A¶m=B`. In the case of a message type, each field of 2137// the message is mapped to a separate parameter, such as 2138// `...?foo.a=A&foo.b=B&foo.c=C`. For HTTP methods that allow a request 2139// body, the `body` field specifies the mapping. Consider a REST update 2140// method on the message resource collection: service Messaging { rpc 2141// UpdateMessage(UpdateMessageRequest) returns (Message) { option 2142// (google.api.http) = { patch: "/v1/messages/{message_id}" body: 2143// "message" }; } } message UpdateMessageRequest { string message_id = 2144// 1; // mapped to the URL Message message = 2; // mapped to the body } 2145// The following HTTP JSON to RPC mapping is enabled, where the 2146// representation of the JSON in the request body is determined by 2147// protos JSON encoding: HTTP | gRPC -----|----- `PATCH 2148// /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: 2149// "123456" message { text: "Hi!" })` The special name `*` can be used 2150// in the body mapping to define that every field not bound by the path 2151// template should be mapped to the request body. This enables the 2152// following alternative definition of the update method: service 2153// Messaging { rpc UpdateMessage(Message) returns (Message) { option 2154// (google.api.http) = { patch: "/v1/messages/{message_id}" body: "*" }; 2155// } } message Message { string message_id = 1; string text = 2; } The 2156// following HTTP JSON to RPC mapping is enabled: HTTP | gRPC 2157// -----|----- `PATCH /v1/messages/123456 { "text": "Hi!" }` | 2158// `UpdateMessage(message_id: "123456" text: "Hi!")` Note that when 2159// using `*` in the body mapping, it is not possible to have HTTP 2160// parameters, as all fields not bound by the path end in the body. This 2161// makes this option more rarely used in practice when defining REST 2162// APIs. The common usage of `*` is in custom methods which don't use 2163// the URL at all for transferring data. It is possible to define 2164// multiple HTTP methods for one RPC by using the `additional_bindings` 2165// option. Example: service Messaging { rpc 2166// GetMessage(GetMessageRequest) returns (Message) { option 2167// (google.api.http) = { get: "/v1/messages/{message_id}" 2168// additional_bindings { get: 2169// "/v1/users/{user_id}/messages/{message_id}" } }; } } message 2170// GetMessageRequest { string message_id = 1; string user_id = 2; } This 2171// enables the following two alternative HTTP JSON to RPC mappings: HTTP 2172// | gRPC -----|----- `GET /v1/messages/123456` | 2173// `GetMessage(message_id: "123456")` `GET /v1/users/me/messages/123456` 2174// | `GetMessage(user_id: "me" message_id: "123456")` ## Rules for HTTP 2175// mapping 1. Leaf request fields (recursive expansion nested messages 2176// in the request message) are classified into three categories: - 2177// Fields referred by the path template. They are passed via the URL 2178// path. - Fields referred by the HttpRule.body. They are passed via the 2179// HTTP request body. - All other fields are passed via the URL query 2180// parameters, and the parameter name is the field path in the request 2181// message. A repeated field can be represented as multiple query 2182// parameters under the same name. 2. If HttpRule.body is "*", there is 2183// no URL query parameter, all fields are passed via URL path and HTTP 2184// request body. 3. If HttpRule.body is omitted, there is no HTTP 2185// request body, all fields are passed via URL path and URL query 2186// parameters. ### Path template syntax Template = "/" Segments [ Verb ] 2187// ; Segments = Segment { "/" Segment } ; Segment = "*" | "**" | LITERAL 2188// | Variable ; Variable = "{" FieldPath [ "=" Segments ] "}" ; 2189// FieldPath = IDENT { "." IDENT } ; Verb = ":" LITERAL ; The syntax `*` 2190// matches a single URL path segment. The syntax `**` matches zero or 2191// more URL path segments, which must be the last part of the URL path 2192// except the `Verb`. The syntax `Variable` matches part of the URL path 2193// as specified by its template. A variable template must not contain 2194// other variables. If a variable matches a single path segment, its 2195// template may be omitted, e.g. `{var}` is equivalent to `{var=*}`. The 2196// syntax `LITERAL` matches literal text in the URL path. If the 2197// `LITERAL` contains any reserved character, such characters should be 2198// percent-encoded before the matching. If a variable contains exactly 2199// one path segment, such as "{var}" or "{var=*}", when such a 2200// variable is expanded into a URL path on the client side, all 2201// characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The server 2202// side does the reverse decoding. Such variables show up in the 2203// [Discovery 2204// Document](https://developers.google.com/discovery/v1/reference/apis) 2205// as `{var}`. If a variable contains multiple path segments, such as 2206// "{var=foo/*}" or "{var=**}", when such a variable is expanded 2207// into a URL path on the client side, all characters except 2208// `[-_.~/0-9a-zA-Z]` are percent-encoded. The server side does the 2209// reverse decoding, except "%2F" and "%2f" are left unchanged. Such 2210// variables show up in the [Discovery 2211// Document](https://developers.google.com/discovery/v1/reference/apis) 2212// as `{+var}`. ## Using gRPC API Service Configuration gRPC API Service 2213// Configuration (service config) is a configuration language for 2214// configuring a gRPC service to become a user-facing product. The 2215// service config is simply the YAML representation of the 2216// `google.api.Service` proto message. As an alternative to annotating 2217// your proto file, you can configure gRPC transcoding in your service 2218// config YAML files. You do this by specifying a `HttpRule` that maps 2219// the gRPC method to a REST endpoint, achieving the same effect as the 2220// proto annotation. This can be particularly useful if you have a proto 2221// that is reused in multiple services. Note that any transcoding 2222// specified in the service config will override any matching 2223// transcoding configuration in the proto. Example: http: rules: # 2224// Selects a gRPC method and applies HttpRule to it. - selector: 2225// example.v1.Messaging.GetMessage get: 2226// /v1/messages/{message_id}/{sub.subfield} ## Special notes When gRPC 2227// Transcoding is used to map a gRPC to JSON REST endpoints, the proto 2228// to JSON conversion must follow the [proto3 2229// specification](https://developers.google.com/protocol-buffers/docs/pro 2230// to3#json). While the single segment variable follows the semantics of 2231// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple 2232// String Expansion, the multi segment variable **does not** follow RFC 2233// 6570 Section 3.2.3 Reserved Expansion. The reason is that the 2234// Reserved Expansion does not expand special characters like `?` and 2235// `#`, which would lead to invalid URLs. As the result, gRPC 2236// Transcoding uses a custom encoding for multi segment variables. The 2237// path variables **must not** refer to any repeated or mapped field, 2238// because client libraries are not capable of handling such variable 2239// expansion. The path variables **must not** capture the leading "/" 2240// character. The reason is that the most common use case "{var}" does 2241// not capture the leading "/" character. For consistency, all path 2242// variables must share the same behavior. Repeated message fields must 2243// not be mapped to URL query parameters, because no client library can 2244// support such complicated mapping. If an API needs to use a JSON array 2245// for request or response body, it can map the request or response body 2246// to a repeated field. However, some gRPC Transcoding implementations 2247// may not support this feature. 2248type HttpRule struct { 2249 // AdditionalBindings: Additional HTTP bindings for the selector. Nested 2250 // bindings must not contain an `additional_bindings` field themselves 2251 // (that is, the nesting may only be one level deep). 2252 AdditionalBindings []*HttpRule `json:"additionalBindings,omitempty"` 2253 2254 // Body: The name of the request field whose value is mapped to the HTTP 2255 // request body, or `*` for mapping all request fields not captured by 2256 // the path pattern to the HTTP body, or omitted for not having any HTTP 2257 // request body. NOTE: the referred field must be present at the 2258 // top-level of the request message type. 2259 Body string `json:"body,omitempty"` 2260 2261 // Custom: The custom pattern is used for specifying an HTTP method that 2262 // is not included in the `pattern` field, such as HEAD, or "*" to leave 2263 // the HTTP method unspecified for this rule. The wild-card rule is 2264 // useful for services that provide content to Web (HTML) clients. 2265 Custom *CustomHttpPattern `json:"custom,omitempty"` 2266 2267 // Delete: Maps to HTTP DELETE. Used for deleting a resource. 2268 Delete string `json:"delete,omitempty"` 2269 2270 // Get: Maps to HTTP GET. Used for listing and getting information about 2271 // resources. 2272 Get string `json:"get,omitempty"` 2273 2274 // Patch: Maps to HTTP PATCH. Used for updating a resource. 2275 Patch string `json:"patch,omitempty"` 2276 2277 // Post: Maps to HTTP POST. Used for creating a resource or performing 2278 // an action. 2279 Post string `json:"post,omitempty"` 2280 2281 // Put: Maps to HTTP PUT. Used for replacing a resource. 2282 Put string `json:"put,omitempty"` 2283 2284 // ResponseBody: Optional. The name of the response field whose value is 2285 // mapped to the HTTP response body. When omitted, the entire response 2286 // message will be used as the HTTP response body. NOTE: The referred 2287 // field must be present at the top-level of the response message type. 2288 ResponseBody string `json:"responseBody,omitempty"` 2289 2290 // Selector: Selects a method to which this rule applies. Refer to 2291 // selector for syntax details. 2292 Selector string `json:"selector,omitempty"` 2293 2294 // ForceSendFields is a list of field names (e.g. "AdditionalBindings") 2295 // to unconditionally include in API requests. By default, fields with 2296 // empty values are omitted from API requests. However, any non-pointer, 2297 // non-interface field appearing in ForceSendFields will be sent to the 2298 // server regardless of whether the field is empty or not. This may be 2299 // used to include empty fields in Patch requests. 2300 ForceSendFields []string `json:"-"` 2301 2302 // NullFields is a list of field names (e.g. "AdditionalBindings") to 2303 // include in API requests with the JSON null value. By default, fields 2304 // with empty values are omitted from API requests. However, any field 2305 // with an empty value appearing in NullFields will be sent to the 2306 // server as null. It is an error if a field in this list has a 2307 // non-empty value. This may be used to include null fields in Patch 2308 // requests. 2309 NullFields []string `json:"-"` 2310} 2311 2312func (s *HttpRule) MarshalJSON() ([]byte, error) { 2313 type NoMethod HttpRule 2314 raw := NoMethod(*s) 2315 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2316} 2317 2318// JwtLocation: Specifies a location to extract JWT from an API request. 2319type JwtLocation struct { 2320 // Header: Specifies HTTP header name to extract JWT token. 2321 Header string `json:"header,omitempty"` 2322 2323 // Query: Specifies URL query parameter name to extract JWT token. 2324 Query string `json:"query,omitempty"` 2325 2326 // ValuePrefix: The value prefix. The value format is 2327 // "value_prefix{token}" Only applies to "in" header type. Must be empty 2328 // for "in" query type. If not empty, the header value has to match 2329 // (case sensitive) this prefix. If not matched, JWT will not be 2330 // extracted. If matched, JWT will be extracted after the prefix is 2331 // removed. For example, for "Authorization: Bearer {JWT}", 2332 // value_prefix="Bearer " with a space at the end. 2333 ValuePrefix string `json:"valuePrefix,omitempty"` 2334 2335 // ForceSendFields is a list of field names (e.g. "Header") to 2336 // unconditionally include in API requests. By default, fields with 2337 // empty values are omitted from API requests. However, any non-pointer, 2338 // non-interface field appearing in ForceSendFields will be sent to the 2339 // server regardless of whether the field is empty or not. This may be 2340 // used to include empty fields in Patch requests. 2341 ForceSendFields []string `json:"-"` 2342 2343 // NullFields is a list of field names (e.g. "Header") to include in API 2344 // requests with the JSON null value. By default, fields with empty 2345 // values are omitted from API requests. However, any field with an 2346 // empty value appearing in NullFields will be sent to the server as 2347 // null. It is an error if a field in this list has a non-empty value. 2348 // This may be used to include null fields in Patch requests. 2349 NullFields []string `json:"-"` 2350} 2351 2352func (s *JwtLocation) MarshalJSON() ([]byte, error) { 2353 type NoMethod JwtLocation 2354 raw := NoMethod(*s) 2355 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2356} 2357 2358// LabelDescriptor: A description of a label. 2359type LabelDescriptor struct { 2360 // Description: A human-readable description for the label. 2361 Description string `json:"description,omitempty"` 2362 2363 // Key: The label key. 2364 Key string `json:"key,omitempty"` 2365 2366 // ValueType: The type of data that can be assigned to the label. 2367 // 2368 // Possible values: 2369 // "STRING" - A variable-length string. This is the default. 2370 // "BOOL" - Boolean; true or false. 2371 // "INT64" - A 64-bit signed integer. 2372 ValueType string `json:"valueType,omitempty"` 2373 2374 // ForceSendFields is a list of field names (e.g. "Description") to 2375 // unconditionally include in API requests. By default, fields with 2376 // empty values are omitted from API requests. However, any non-pointer, 2377 // non-interface field appearing in ForceSendFields will be sent to the 2378 // server regardless of whether the field is empty or not. This may be 2379 // used to include empty fields in Patch requests. 2380 ForceSendFields []string `json:"-"` 2381 2382 // NullFields is a list of field names (e.g. "Description") to include 2383 // in API requests with the JSON null value. By default, fields with 2384 // empty values are omitted from API requests. However, any field with 2385 // an empty value appearing in NullFields will be sent to the server as 2386 // null. It is an error if a field in this list has a non-empty value. 2387 // This may be used to include null fields in Patch requests. 2388 NullFields []string `json:"-"` 2389} 2390 2391func (s *LabelDescriptor) MarshalJSON() ([]byte, error) { 2392 type NoMethod LabelDescriptor 2393 raw := NoMethod(*s) 2394 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2395} 2396 2397// ListOperationsResponse: The response message for 2398// Operations.ListOperations. 2399type ListOperationsResponse struct { 2400 // NextPageToken: The standard List next-page token. 2401 NextPageToken string `json:"nextPageToken,omitempty"` 2402 2403 // Operations: A list of operations that matches the specified filter in 2404 // the request. 2405 Operations []*Operation `json:"operations,omitempty"` 2406 2407 // ServerResponse contains the HTTP response code and headers from the 2408 // server. 2409 googleapi.ServerResponse `json:"-"` 2410 2411 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2412 // unconditionally include in API requests. By default, fields with 2413 // empty values are omitted from API requests. However, any non-pointer, 2414 // non-interface field appearing in ForceSendFields will be sent to the 2415 // server regardless of whether the field is empty or not. This may be 2416 // used to include empty fields in Patch requests. 2417 ForceSendFields []string `json:"-"` 2418 2419 // NullFields is a list of field names (e.g. "NextPageToken") to include 2420 // in API requests with the JSON null value. By default, fields with 2421 // empty values are omitted from API requests. However, any field with 2422 // an empty value appearing in NullFields will be sent to the server as 2423 // null. It is an error if a field in this list has a non-empty value. 2424 // This may be used to include null fields in Patch requests. 2425 NullFields []string `json:"-"` 2426} 2427 2428func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) { 2429 type NoMethod ListOperationsResponse 2430 raw := NoMethod(*s) 2431 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2432} 2433 2434// ListServiceConfigsResponse: Response message for ListServiceConfigs 2435// method. 2436type ListServiceConfigsResponse struct { 2437 // NextPageToken: The token of the next page of results. 2438 NextPageToken string `json:"nextPageToken,omitempty"` 2439 2440 // ServiceConfigs: The list of service configuration resources. 2441 ServiceConfigs []*Service `json:"serviceConfigs,omitempty"` 2442 2443 // ServerResponse contains the HTTP response code and headers from the 2444 // server. 2445 googleapi.ServerResponse `json:"-"` 2446 2447 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2448 // unconditionally include in API requests. By default, fields with 2449 // empty values are omitted from API requests. However, any non-pointer, 2450 // non-interface field appearing in ForceSendFields will be sent to the 2451 // server regardless of whether the field is empty or not. This may be 2452 // used to include empty fields in Patch requests. 2453 ForceSendFields []string `json:"-"` 2454 2455 // NullFields is a list of field names (e.g. "NextPageToken") to include 2456 // in API requests with the JSON null value. By default, fields with 2457 // empty values are omitted from API requests. However, any field with 2458 // an empty value appearing in NullFields will be sent to the server as 2459 // null. It is an error if a field in this list has a non-empty value. 2460 // This may be used to include null fields in Patch requests. 2461 NullFields []string `json:"-"` 2462} 2463 2464func (s *ListServiceConfigsResponse) MarshalJSON() ([]byte, error) { 2465 type NoMethod ListServiceConfigsResponse 2466 raw := NoMethod(*s) 2467 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2468} 2469 2470// ListServiceRolloutsResponse: Response message for ListServiceRollouts 2471// method. 2472type ListServiceRolloutsResponse struct { 2473 // NextPageToken: The token of the next page of results. 2474 NextPageToken string `json:"nextPageToken,omitempty"` 2475 2476 // Rollouts: The list of rollout resources. 2477 Rollouts []*Rollout `json:"rollouts,omitempty"` 2478 2479 // ServerResponse contains the HTTP response code and headers from the 2480 // server. 2481 googleapi.ServerResponse `json:"-"` 2482 2483 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2484 // unconditionally include in API requests. By default, fields with 2485 // empty values are omitted from API requests. However, any non-pointer, 2486 // non-interface field appearing in ForceSendFields will be sent to the 2487 // server regardless of whether the field is empty or not. This may be 2488 // used to include empty fields in Patch requests. 2489 ForceSendFields []string `json:"-"` 2490 2491 // NullFields is a list of field names (e.g. "NextPageToken") to include 2492 // in API requests with the JSON null value. By default, fields with 2493 // empty values are omitted from API requests. However, any field with 2494 // an empty value appearing in NullFields will be sent to the server as 2495 // null. It is an error if a field in this list has a non-empty value. 2496 // This may be used to include null fields in Patch requests. 2497 NullFields []string `json:"-"` 2498} 2499 2500func (s *ListServiceRolloutsResponse) MarshalJSON() ([]byte, error) { 2501 type NoMethod ListServiceRolloutsResponse 2502 raw := NoMethod(*s) 2503 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2504} 2505 2506// ListServicesResponse: Response message for `ListServices` method. 2507type ListServicesResponse struct { 2508 // NextPageToken: Token that can be passed to `ListServices` to resume a 2509 // paginated query. 2510 NextPageToken string `json:"nextPageToken,omitempty"` 2511 2512 // Services: The returned services will only have the name field set. 2513 Services []*ManagedService `json:"services,omitempty"` 2514 2515 // ServerResponse contains the HTTP response code and headers from the 2516 // server. 2517 googleapi.ServerResponse `json:"-"` 2518 2519 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2520 // unconditionally include in API requests. By default, fields with 2521 // empty values are omitted from API requests. However, any non-pointer, 2522 // non-interface field appearing in ForceSendFields will be sent to the 2523 // server regardless of whether the field is empty or not. This may be 2524 // used to include empty fields in Patch requests. 2525 ForceSendFields []string `json:"-"` 2526 2527 // NullFields is a list of field names (e.g. "NextPageToken") to include 2528 // in API requests with the JSON null value. By default, fields with 2529 // empty values are omitted from API requests. However, any field with 2530 // an empty value appearing in NullFields will be sent to the server as 2531 // null. It is an error if a field in this list has a non-empty value. 2532 // This may be used to include null fields in Patch requests. 2533 NullFields []string `json:"-"` 2534} 2535 2536func (s *ListServicesResponse) MarshalJSON() ([]byte, error) { 2537 type NoMethod ListServicesResponse 2538 raw := NoMethod(*s) 2539 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2540} 2541 2542// LogDescriptor: A description of a log type. Example in YAML format: - 2543// name: library.googleapis.com/activity_history description: The 2544// history of borrowing and returning library items. display_name: 2545// Activity labels: - key: /customer_id description: Identifier of a 2546// library customer 2547type LogDescriptor struct { 2548 // Description: A human-readable description of this log. This 2549 // information appears in the documentation and can contain details. 2550 Description string `json:"description,omitempty"` 2551 2552 // DisplayName: The human-readable name for this log. This information 2553 // appears on the user interface and should be concise. 2554 DisplayName string `json:"displayName,omitempty"` 2555 2556 // Labels: The set of labels that are available to describe a specific 2557 // log entry. Runtime requests that contain labels not specified here 2558 // are considered invalid. 2559 Labels []*LabelDescriptor `json:"labels,omitempty"` 2560 2561 // Name: The name of the log. It must be less than 512 characters long 2562 // and can include the following characters: upper- and lower-case 2563 // alphanumeric characters [A-Za-z0-9], and punctuation characters 2564 // including slash, underscore, hyphen, period [/_-.]. 2565 Name string `json:"name,omitempty"` 2566 2567 // ForceSendFields is a list of field names (e.g. "Description") to 2568 // unconditionally include in API requests. By default, fields with 2569 // empty values are omitted from API requests. However, any non-pointer, 2570 // non-interface field appearing in ForceSendFields will be sent to the 2571 // server regardless of whether the field is empty or not. This may be 2572 // used to include empty fields in Patch requests. 2573 ForceSendFields []string `json:"-"` 2574 2575 // NullFields is a list of field names (e.g. "Description") to include 2576 // in API requests with the JSON null value. By default, fields with 2577 // empty values are omitted from API requests. However, any field with 2578 // an empty value appearing in NullFields will be sent to the server as 2579 // null. It is an error if a field in this list has a non-empty value. 2580 // This may be used to include null fields in Patch requests. 2581 NullFields []string `json:"-"` 2582} 2583 2584func (s *LogDescriptor) MarshalJSON() ([]byte, error) { 2585 type NoMethod LogDescriptor 2586 raw := NoMethod(*s) 2587 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2588} 2589 2590// Logging: Logging configuration of the service. The following example 2591// shows how to configure logs to be sent to the producer and consumer 2592// projects. In the example, the `activity_history` log is sent to both 2593// the producer and consumer projects, whereas the `purchase_history` 2594// log is only sent to the producer project. monitored_resources: - 2595// type: library.googleapis.com/branch labels: - key: /city description: 2596// The city where the library branch is located in. - key: /name 2597// description: The name of the branch. logs: - name: activity_history 2598// labels: - key: /customer_id - name: purchase_history logging: 2599// producer_destinations: - monitored_resource: 2600// library.googleapis.com/branch logs: - activity_history - 2601// purchase_history consumer_destinations: - monitored_resource: 2602// library.googleapis.com/branch logs: - activity_history 2603type Logging struct { 2604 // ConsumerDestinations: Logging configurations for sending logs to the 2605 // consumer project. There can be multiple consumer destinations, each 2606 // one must have a different monitored resource type. A log can be used 2607 // in at most one consumer destination. 2608 ConsumerDestinations []*LoggingDestination `json:"consumerDestinations,omitempty"` 2609 2610 // ProducerDestinations: Logging configurations for sending logs to the 2611 // producer project. There can be multiple producer destinations, each 2612 // one must have a different monitored resource type. A log can be used 2613 // in at most one producer destination. 2614 ProducerDestinations []*LoggingDestination `json:"producerDestinations,omitempty"` 2615 2616 // ForceSendFields is a list of field names (e.g. 2617 // "ConsumerDestinations") to unconditionally include in API requests. 2618 // By default, fields with empty values are omitted from API requests. 2619 // However, any non-pointer, non-interface field appearing in 2620 // ForceSendFields will be sent to the server regardless of whether the 2621 // field is empty or not. This may be used to include empty fields in 2622 // Patch requests. 2623 ForceSendFields []string `json:"-"` 2624 2625 // NullFields is a list of field names (e.g. "ConsumerDestinations") to 2626 // include in API requests with the JSON null value. By default, fields 2627 // with empty values are omitted from API requests. However, any field 2628 // with an empty value appearing in NullFields will be sent to the 2629 // server as null. It is an error if a field in this list has a 2630 // non-empty value. This may be used to include null fields in Patch 2631 // requests. 2632 NullFields []string `json:"-"` 2633} 2634 2635func (s *Logging) MarshalJSON() ([]byte, error) { 2636 type NoMethod Logging 2637 raw := NoMethod(*s) 2638 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2639} 2640 2641// LoggingDestination: Configuration of a specific logging destination 2642// (the producer project or the consumer project). 2643type LoggingDestination struct { 2644 // Logs: Names of the logs to be sent to this destination. Each name 2645 // must be defined in the Service.logs section. If the log name is not a 2646 // domain scoped name, it will be automatically prefixed with the 2647 // service name followed by "/". 2648 Logs []string `json:"logs,omitempty"` 2649 2650 // MonitoredResource: The monitored resource type. The type must be 2651 // defined in the Service.monitored_resources section. 2652 MonitoredResource string `json:"monitoredResource,omitempty"` 2653 2654 // ForceSendFields is a list of field names (e.g. "Logs") to 2655 // unconditionally include in API requests. By default, fields with 2656 // empty values are omitted from API requests. However, any non-pointer, 2657 // non-interface field appearing in ForceSendFields will be sent to the 2658 // server regardless of whether the field is empty or not. This may be 2659 // used to include empty fields in Patch requests. 2660 ForceSendFields []string `json:"-"` 2661 2662 // NullFields is a list of field names (e.g. "Logs") to include in API 2663 // requests with the JSON null value. By default, fields with empty 2664 // values are omitted from API requests. However, any field with an 2665 // empty value appearing in NullFields will be sent to the server as 2666 // null. It is an error if a field in this list has a non-empty value. 2667 // This may be used to include null fields in Patch requests. 2668 NullFields []string `json:"-"` 2669} 2670 2671func (s *LoggingDestination) MarshalJSON() ([]byte, error) { 2672 type NoMethod LoggingDestination 2673 raw := NoMethod(*s) 2674 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2675} 2676 2677// ManagedService: The full representation of a Service that is managed 2678// by Google Service Management. 2679type ManagedService struct { 2680 // ProducerProjectId: ID of the project that produces and owns this 2681 // service. 2682 ProducerProjectId string `json:"producerProjectId,omitempty"` 2683 2684 // ServiceName: The name of the service. See the 2685 // [overview](/service-management/overview) for naming requirements. 2686 ServiceName string `json:"serviceName,omitempty"` 2687 2688 // ServerResponse contains the HTTP response code and headers from the 2689 // server. 2690 googleapi.ServerResponse `json:"-"` 2691 2692 // ForceSendFields is a list of field names (e.g. "ProducerProjectId") 2693 // to unconditionally include in API requests. By default, fields with 2694 // empty values are omitted from API requests. However, any non-pointer, 2695 // non-interface field appearing in ForceSendFields will be sent to the 2696 // server regardless of whether the field is empty or not. This may be 2697 // used to include empty fields in Patch requests. 2698 ForceSendFields []string `json:"-"` 2699 2700 // NullFields is a list of field names (e.g. "ProducerProjectId") to 2701 // include in API requests with the JSON null value. By default, fields 2702 // with empty values are omitted from API requests. However, any field 2703 // with an empty value appearing in NullFields will be sent to the 2704 // server as null. It is an error if a field in this list has a 2705 // non-empty value. This may be used to include null fields in Patch 2706 // requests. 2707 NullFields []string `json:"-"` 2708} 2709 2710func (s *ManagedService) MarshalJSON() ([]byte, error) { 2711 type NoMethod ManagedService 2712 raw := NoMethod(*s) 2713 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2714} 2715 2716// Method: Method represents a method of an API interface. 2717type Method struct { 2718 // Name: The simple name of this method. 2719 Name string `json:"name,omitempty"` 2720 2721 // Options: Any metadata attached to the method. 2722 Options []*Option `json:"options,omitempty"` 2723 2724 // RequestStreaming: If true, the request is streamed. 2725 RequestStreaming bool `json:"requestStreaming,omitempty"` 2726 2727 // RequestTypeUrl: A URL of the input message type. 2728 RequestTypeUrl string `json:"requestTypeUrl,omitempty"` 2729 2730 // ResponseStreaming: If true, the response is streamed. 2731 ResponseStreaming bool `json:"responseStreaming,omitempty"` 2732 2733 // ResponseTypeUrl: The URL of the output message type. 2734 ResponseTypeUrl string `json:"responseTypeUrl,omitempty"` 2735 2736 // Syntax: The source syntax of this method. 2737 // 2738 // Possible values: 2739 // "SYNTAX_PROTO2" - Syntax `proto2`. 2740 // "SYNTAX_PROTO3" - Syntax `proto3`. 2741 Syntax string `json:"syntax,omitempty"` 2742 2743 // ForceSendFields is a list of field names (e.g. "Name") to 2744 // unconditionally include in API requests. By default, fields with 2745 // empty values are omitted from API requests. However, any non-pointer, 2746 // non-interface field appearing in ForceSendFields will be sent to the 2747 // server regardless of whether the field is empty or not. This may be 2748 // used to include empty fields in Patch requests. 2749 ForceSendFields []string `json:"-"` 2750 2751 // NullFields is a list of field names (e.g. "Name") to include in API 2752 // requests with the JSON null value. By default, fields with empty 2753 // values are omitted from API requests. However, any field with an 2754 // empty value appearing in NullFields will be sent to the server as 2755 // null. It is an error if a field in this list has a non-empty value. 2756 // This may be used to include null fields in Patch requests. 2757 NullFields []string `json:"-"` 2758} 2759 2760func (s *Method) MarshalJSON() ([]byte, error) { 2761 type NoMethod Method 2762 raw := NoMethod(*s) 2763 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2764} 2765 2766// MetricDescriptor: Defines a metric type and its schema. Once a metric 2767// descriptor is created, deleting or altering it stops data collection 2768// and makes the metric type's existing data unusable. 2769type MetricDescriptor struct { 2770 // Description: A detailed description of the metric, which can be used 2771 // in documentation. 2772 Description string `json:"description,omitempty"` 2773 2774 // DisplayName: A concise name for the metric, which can be displayed in 2775 // user interfaces. Use sentence case without an ending period, for 2776 // example "Request count". This field is optional but it is recommended 2777 // to be set for any metrics associated with user-visible concepts, such 2778 // as Quota. 2779 DisplayName string `json:"displayName,omitempty"` 2780 2781 // Labels: The set of labels that can be used to describe a specific 2782 // instance of this metric type. For example, the 2783 // `appengine.googleapis.com/http/server/response_latencies` metric type 2784 // has a label for the HTTP response code, `response_code`, so you can 2785 // look at latencies for successful responses or just for responses that 2786 // failed. 2787 Labels []*LabelDescriptor `json:"labels,omitempty"` 2788 2789 // LaunchStage: Optional. The launch stage of the metric definition. 2790 // 2791 // Possible values: 2792 // "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value. 2793 // "UNIMPLEMENTED" - The feature is not yet implemented. Users can not 2794 // use it. 2795 // "PRELAUNCH" - Prelaunch features are hidden from users and are only 2796 // visible internally. 2797 // "EARLY_ACCESS" - Early Access features are limited to a closed 2798 // group of testers. To use these features, you must sign up in advance 2799 // and sign a Trusted Tester agreement (which includes confidentiality 2800 // provisions). These features may be unstable, changed in 2801 // backward-incompatible ways, and are not guaranteed to be released. 2802 // "ALPHA" - Alpha is a limited availability test for releases before 2803 // they are cleared for widespread use. By Alpha, all significant design 2804 // issues are resolved and we are in the process of verifying 2805 // functionality. Alpha customers need to apply for access, agree to 2806 // applicable terms, and have their projects allowlisted. Alpha releases 2807 // don’t have to be feature complete, no SLAs are provided, and there 2808 // are no technical support obligations, but they will be far enough 2809 // along that customers can actually use them in test environments or 2810 // for limited-use tests -- just like they would in normal production 2811 // cases. 2812 // "BETA" - Beta is the point at which we are ready to open a release 2813 // for any customer to use. There are no SLA or technical support 2814 // obligations in a Beta release. Products will be complete from a 2815 // feature perspective, but may have some open outstanding issues. Beta 2816 // releases are suitable for limited production use cases. 2817 // "GA" - GA features are open to all developers and are considered 2818 // stable and fully qualified for production use. 2819 // "DEPRECATED" - Deprecated features are scheduled to be shut down 2820 // and removed. For more information, see the “Deprecation Policy” 2821 // section of our [Terms of Service](https://cloud.google.com/terms/) 2822 // and the [Google Cloud Platform Subject to the Deprecation 2823 // Policy](https://cloud.google.com/terms/deprecation) documentation. 2824 LaunchStage string `json:"launchStage,omitempty"` 2825 2826 // Metadata: Optional. Metadata which can be used to guide usage of the 2827 // metric. 2828 Metadata *MetricDescriptorMetadata `json:"metadata,omitempty"` 2829 2830 // MetricKind: Whether the metric records instantaneous values, changes 2831 // to a value, etc. Some combinations of `metric_kind` and `value_type` 2832 // might not be supported. 2833 // 2834 // Possible values: 2835 // "METRIC_KIND_UNSPECIFIED" - Do not use this default value. 2836 // "GAUGE" - An instantaneous measurement of a value. 2837 // "DELTA" - The change in a value during a time interval. 2838 // "CUMULATIVE" - A value accumulated over a time interval. Cumulative 2839 // measurements in a time series should have the same start time and 2840 // increasing end times, until an event resets the cumulative value to 2841 // zero and sets a new start time for the following points. 2842 MetricKind string `json:"metricKind,omitempty"` 2843 2844 // MonitoredResourceTypes: Read-only. If present, then a time series, 2845 // which is identified partially by a metric type and a 2846 // MonitoredResourceDescriptor, that is associated with this metric type 2847 // can only be associated with one of the monitored resource types 2848 // listed here. 2849 MonitoredResourceTypes []string `json:"monitoredResourceTypes,omitempty"` 2850 2851 // Name: The resource name of the metric descriptor. 2852 Name string `json:"name,omitempty"` 2853 2854 // Type: The metric type, including its DNS name prefix. The type is not 2855 // URL-encoded. All user-defined metric types have the DNS name 2856 // `custom.googleapis.com` or `external.googleapis.com`. Metric types 2857 // should use a natural hierarchical grouping. For example: 2858 // "custom.googleapis.com/invoice/paid/amount" 2859 // "external.googleapis.com/prometheus/up" 2860 // "appengine.googleapis.com/http/server/response_latencies" 2861 Type string `json:"type,omitempty"` 2862 2863 // Unit: The units in which the metric value is reported. It is only 2864 // applicable if the `value_type` is `INT64`, `DOUBLE`, or 2865 // `DISTRIBUTION`. The `unit` defines the representation of the stored 2866 // metric values. Different systems may scale the values to be more 2867 // easily displayed (so a value of `0.02KBy` _might_ be displayed as 2868 // `20By`, and a value of `3523KBy` _might_ be displayed as `3.5MBy`). 2869 // However, if the `unit` is `KBy`, then the value of the metric is 2870 // always in thousands of bytes, no matter how it may be displayed.. If 2871 // you want a custom metric to record the exact number of CPU-seconds 2872 // used by a job, you can create an `INT64 CUMULATIVE` metric whose 2873 // `unit` is `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the 2874 // job uses 12,005 CPU-seconds, then the value is written as `12005`. 2875 // Alternatively, if you want a custom metric to record data in a more 2876 // granular way, you can create a `DOUBLE CUMULATIVE` metric whose 2877 // `unit` is `ks{CPU}`, and then write the value `12.005` (which is 2878 // `12005/1000`), or use `Kis{CPU}` and write `11.723` (which is 2879 // `12005/1024`). The supported units are a subset of [The Unified Code 2880 // for Units of Measure](http://unitsofmeasure.org/ucum.html) standard: 2881 // **Basic units (UNIT)** * `bit` bit * `By` byte * `s` second * `min` 2882 // minute * `h` hour * `d` day * `1` dimensionless **Prefixes (PREFIX)** 2883 // * `k` kilo (10^3) * `M` mega (10^6) * `G` giga (10^9) * `T` tera 2884 // (10^12) * `P` peta (10^15) * `E` exa (10^18) * `Z` zetta (10^21) * 2885 // `Y` yotta (10^24) * `m` milli (10^-3) * `u` micro (10^-6) * `n` nano 2886 // (10^-9) * `p` pico (10^-12) * `f` femto (10^-15) * `a` atto (10^-18) 2887 // * `z` zepto (10^-21) * `y` yocto (10^-24) * `Ki` kibi (2^10) * `Mi` 2888 // mebi (2^20) * `Gi` gibi (2^30) * `Ti` tebi (2^40) * `Pi` pebi (2^50) 2889 // **Grammar** The grammar also includes these connectors: * `/` 2890 // division or ratio (as an infix operator). For examples, `kBy/{email}` 2891 // or `MiBy/10ms` (although you should almost never have `/s` in a 2892 // metric `unit`; rates should always be computed at query time from the 2893 // underlying cumulative or delta value). * `.` multiplication or 2894 // composition (as an infix operator). For examples, `GBy.d` or 2895 // `k{watt}.h`. The grammar for a unit is as follows: Expression = 2896 // Component { "." Component } { "/" Component } ; Component = ( [ 2897 // PREFIX ] UNIT | "%" ) [ Annotation ] | Annotation | "1" ; Annotation 2898 // = "{" NAME "}" ; Notes: * `Annotation` is just a comment if it 2899 // follows a `UNIT`. If the annotation is used alone, then the unit is 2900 // equivalent to `1`. For examples, `{request}/s == 1/s`, 2901 // `By{transmitted}/s == By/s`. * `NAME` is a sequence of non-blank 2902 // printable ASCII characters not containing `{` or `}`. * `1` 2903 // represents a unitary [dimensionless 2904 // unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, 2905 // such as in `1/s`. It is typically used when none of the basic units 2906 // are appropriate. For example, "new users per day" can be represented 2907 // as `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new 2908 // users). Alternatively, "thousands of page views per day" would be 2909 // represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric 2910 // value of `5.3` would mean "5300 page views per day"). * `%` 2911 // represents dimensionless value of 1/100, and annotates values giving 2912 // a percentage (so the metric values are typically in the range of 2913 // 0..100, and a metric value `3` means "3 percent"). * `10^2.%` 2914 // indicates a metric contains a ratio, typically in the range 0..1, 2915 // that will be multiplied by 100 and displayed as a percentage (so a 2916 // metric value `0.03` means "3 percent"). 2917 Unit string `json:"unit,omitempty"` 2918 2919 // ValueType: Whether the measurement is an integer, a floating-point 2920 // number, etc. Some combinations of `metric_kind` and `value_type` 2921 // might not be supported. 2922 // 2923 // Possible values: 2924 // "VALUE_TYPE_UNSPECIFIED" - Do not use this default value. 2925 // "BOOL" - The value is a boolean. This value type can be used only 2926 // if the metric kind is `GAUGE`. 2927 // "INT64" - The value is a signed 64-bit integer. 2928 // "DOUBLE" - The value is a double precision floating point number. 2929 // "STRING" - The value is a text string. This value type can be used 2930 // only if the metric kind is `GAUGE`. 2931 // "DISTRIBUTION" - The value is a `Distribution`. 2932 // "MONEY" - The value is money. 2933 ValueType string `json:"valueType,omitempty"` 2934 2935 // ForceSendFields is a list of field names (e.g. "Description") to 2936 // unconditionally include in API requests. By default, fields with 2937 // empty values are omitted from API requests. However, any non-pointer, 2938 // non-interface field appearing in ForceSendFields will be sent to the 2939 // server regardless of whether the field is empty or not. This may be 2940 // used to include empty fields in Patch requests. 2941 ForceSendFields []string `json:"-"` 2942 2943 // NullFields is a list of field names (e.g. "Description") to include 2944 // in API requests with the JSON null value. By default, fields with 2945 // empty values are omitted from API requests. However, any field with 2946 // an empty value appearing in NullFields will be sent to the server as 2947 // null. It is an error if a field in this list has a non-empty value. 2948 // This may be used to include null fields in Patch requests. 2949 NullFields []string `json:"-"` 2950} 2951 2952func (s *MetricDescriptor) MarshalJSON() ([]byte, error) { 2953 type NoMethod MetricDescriptor 2954 raw := NoMethod(*s) 2955 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2956} 2957 2958// MetricDescriptorMetadata: Additional annotations that can be used to 2959// guide the usage of a metric. 2960type MetricDescriptorMetadata struct { 2961 // IngestDelay: The delay of data points caused by ingestion. Data 2962 // points older than this age are guaranteed to be ingested and 2963 // available to be read, excluding data loss due to errors. 2964 IngestDelay string `json:"ingestDelay,omitempty"` 2965 2966 // LaunchStage: Deprecated. Must use the MetricDescriptor.launch_stage 2967 // instead. 2968 // 2969 // Possible values: 2970 // "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value. 2971 // "UNIMPLEMENTED" - The feature is not yet implemented. Users can not 2972 // use it. 2973 // "PRELAUNCH" - Prelaunch features are hidden from users and are only 2974 // visible internally. 2975 // "EARLY_ACCESS" - Early Access features are limited to a closed 2976 // group of testers. To use these features, you must sign up in advance 2977 // and sign a Trusted Tester agreement (which includes confidentiality 2978 // provisions). These features may be unstable, changed in 2979 // backward-incompatible ways, and are not guaranteed to be released. 2980 // "ALPHA" - Alpha is a limited availability test for releases before 2981 // they are cleared for widespread use. By Alpha, all significant design 2982 // issues are resolved and we are in the process of verifying 2983 // functionality. Alpha customers need to apply for access, agree to 2984 // applicable terms, and have their projects allowlisted. Alpha releases 2985 // don’t have to be feature complete, no SLAs are provided, and there 2986 // are no technical support obligations, but they will be far enough 2987 // along that customers can actually use them in test environments or 2988 // for limited-use tests -- just like they would in normal production 2989 // cases. 2990 // "BETA" - Beta is the point at which we are ready to open a release 2991 // for any customer to use. There are no SLA or technical support 2992 // obligations in a Beta release. Products will be complete from a 2993 // feature perspective, but may have some open outstanding issues. Beta 2994 // releases are suitable for limited production use cases. 2995 // "GA" - GA features are open to all developers and are considered 2996 // stable and fully qualified for production use. 2997 // "DEPRECATED" - Deprecated features are scheduled to be shut down 2998 // and removed. For more information, see the “Deprecation Policy” 2999 // section of our [Terms of Service](https://cloud.google.com/terms/) 3000 // and the [Google Cloud Platform Subject to the Deprecation 3001 // Policy](https://cloud.google.com/terms/deprecation) documentation. 3002 LaunchStage string `json:"launchStage,omitempty"` 3003 3004 // SamplePeriod: The sampling period of metric data points. For metrics 3005 // which are written periodically, consecutive data points are stored at 3006 // this time interval, excluding data loss due to errors. Metrics with a 3007 // higher granularity have a smaller sampling period. 3008 SamplePeriod string `json:"samplePeriod,omitempty"` 3009 3010 // ForceSendFields is a list of field names (e.g. "IngestDelay") to 3011 // unconditionally include in API requests. By default, fields with 3012 // empty values are omitted from API requests. However, any non-pointer, 3013 // non-interface field appearing in ForceSendFields will be sent to the 3014 // server regardless of whether the field is empty or not. This may be 3015 // used to include empty fields in Patch requests. 3016 ForceSendFields []string `json:"-"` 3017 3018 // NullFields is a list of field names (e.g. "IngestDelay") to include 3019 // in API requests with the JSON null value. By default, fields with 3020 // empty values are omitted from API requests. However, any field with 3021 // an empty value appearing in NullFields will be sent to the server as 3022 // null. It is an error if a field in this list has a non-empty value. 3023 // This may be used to include null fields in Patch requests. 3024 NullFields []string `json:"-"` 3025} 3026 3027func (s *MetricDescriptorMetadata) MarshalJSON() ([]byte, error) { 3028 type NoMethod MetricDescriptorMetadata 3029 raw := NoMethod(*s) 3030 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3031} 3032 3033// MetricRule: Bind API methods to metrics. Binding a method to a metric 3034// causes that metric's configured quota behaviors to apply to the 3035// method call. 3036type MetricRule struct { 3037 // MetricCosts: Metrics to update when the selected methods are called, 3038 // and the associated cost applied to each metric. The key of the map is 3039 // the metric name, and the values are the amount increased for the 3040 // metric against which the quota limits are defined. The value must not 3041 // be negative. 3042 MetricCosts map[string]string `json:"metricCosts,omitempty"` 3043 3044 // Selector: Selects the methods to which this rule applies. Refer to 3045 // selector for syntax details. 3046 Selector string `json:"selector,omitempty"` 3047 3048 // ForceSendFields is a list of field names (e.g. "MetricCosts") to 3049 // unconditionally include in API requests. By default, fields with 3050 // empty values are omitted from API requests. However, any non-pointer, 3051 // non-interface field appearing in ForceSendFields will be sent to the 3052 // server regardless of whether the field is empty or not. This may be 3053 // used to include empty fields in Patch requests. 3054 ForceSendFields []string `json:"-"` 3055 3056 // NullFields is a list of field names (e.g. "MetricCosts") to include 3057 // in API requests with the JSON null value. By default, fields with 3058 // empty values are omitted from API requests. However, any field with 3059 // an empty value appearing in NullFields will be sent to the server as 3060 // null. It is an error if a field in this list has a non-empty value. 3061 // This may be used to include null fields in Patch requests. 3062 NullFields []string `json:"-"` 3063} 3064 3065func (s *MetricRule) MarshalJSON() ([]byte, error) { 3066 type NoMethod MetricRule 3067 raw := NoMethod(*s) 3068 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3069} 3070 3071// Mixin: Declares an API Interface to be included in this interface. 3072// The including interface must redeclare all the methods from the 3073// included interface, but documentation and options are inherited as 3074// follows: - If after comment and whitespace stripping, the 3075// documentation string of the redeclared method is empty, it will be 3076// inherited from the original method. - Each annotation belonging to 3077// the service config (http, visibility) which is not set in the 3078// redeclared method will be inherited. - If an http annotation is 3079// inherited, the path pattern will be modified as follows. Any version 3080// prefix will be replaced by the version of the including interface 3081// plus the root path if specified. Example of a simple mixin: package 3082// google.acl.v1; service AccessControl { // Get the underlying ACL 3083// object. rpc GetAcl(GetAclRequest) returns (Acl) { option 3084// (google.api.http).get = "/v1/{resource=**}:getAcl"; } } package 3085// google.storage.v2; service Storage { // rpc GetAcl(GetAclRequest) 3086// returns (Acl); // Get a data record. rpc GetData(GetDataRequest) 3087// returns (Data) { option (google.api.http).get = "/v2/{resource=**}"; 3088// } } Example of a mixin configuration: apis: - name: 3089// google.storage.v2.Storage mixins: - name: google.acl.v1.AccessControl 3090// The mixin construct implies that all methods in `AccessControl` are 3091// also declared with same name and request/response types in `Storage`. 3092// A documentation generator or annotation processor will see the 3093// effective `Storage.GetAcl` method after inheriting documentation and 3094// annotations as follows: service Storage { // Get the underlying ACL 3095// object. rpc GetAcl(GetAclRequest) returns (Acl) { option 3096// (google.api.http).get = "/v2/{resource=**}:getAcl"; } ... } Note how 3097// the version in the path pattern changed from `v1` to `v2`. If the 3098// `root` field in the mixin is specified, it should be a relative path 3099// under which inherited HTTP paths are placed. Example: apis: - name: 3100// google.storage.v2.Storage mixins: - name: google.acl.v1.AccessControl 3101// root: acls This implies the following inherited HTTP annotation: 3102// service Storage { // Get the underlying ACL object. rpc 3103// GetAcl(GetAclRequest) returns (Acl) { option (google.api.http).get = 3104// "/v2/acls/{resource=**}:getAcl"; } ... } 3105type Mixin struct { 3106 // Name: The fully qualified name of the interface which is included. 3107 Name string `json:"name,omitempty"` 3108 3109 // Root: If non-empty specifies a path under which inherited HTTP paths 3110 // are rooted. 3111 Root string `json:"root,omitempty"` 3112 3113 // ForceSendFields is a list of field names (e.g. "Name") to 3114 // unconditionally include in API requests. By default, fields with 3115 // empty values are omitted from API requests. However, any non-pointer, 3116 // non-interface field appearing in ForceSendFields will be sent to the 3117 // server regardless of whether the field is empty or not. This may be 3118 // used to include empty fields in Patch requests. 3119 ForceSendFields []string `json:"-"` 3120 3121 // NullFields is a list of field names (e.g. "Name") to include in API 3122 // requests with the JSON null value. By default, fields with empty 3123 // values are omitted from API requests. However, any field with an 3124 // empty value appearing in NullFields will be sent to the server as 3125 // null. It is an error if a field in this list has a non-empty value. 3126 // This may be used to include null fields in Patch requests. 3127 NullFields []string `json:"-"` 3128} 3129 3130func (s *Mixin) MarshalJSON() ([]byte, error) { 3131 type NoMethod Mixin 3132 raw := NoMethod(*s) 3133 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3134} 3135 3136// MonitoredResourceDescriptor: An object that describes the schema of a 3137// MonitoredResource object using a type name and a set of labels. For 3138// example, the monitored resource descriptor for Google Compute Engine 3139// VM instances has a type of "gce_instance" and specifies the use of 3140// the labels "instance_id" and "zone" to identify particular VM 3141// instances. Different APIs can support different monitored resource 3142// types. APIs generally provide a `list` method that returns the 3143// monitored resource descriptors used by the API. 3144type MonitoredResourceDescriptor struct { 3145 // Description: Optional. A detailed description of the monitored 3146 // resource type that might be used in documentation. 3147 Description string `json:"description,omitempty"` 3148 3149 // DisplayName: Optional. A concise name for the monitored resource type 3150 // that might be displayed in user interfaces. It should be a Title 3151 // Cased Noun Phrase, without any article or other determiners. For 3152 // example, "Google Cloud SQL Database". 3153 DisplayName string `json:"displayName,omitempty"` 3154 3155 // Labels: Required. A set of labels used to describe instances of this 3156 // monitored resource type. For example, an individual Google Cloud SQL 3157 // database is identified by values for the labels "database_id" and 3158 // "zone". 3159 Labels []*LabelDescriptor `json:"labels,omitempty"` 3160 3161 // LaunchStage: Optional. The launch stage of the monitored resource 3162 // definition. 3163 // 3164 // Possible values: 3165 // "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value. 3166 // "UNIMPLEMENTED" - The feature is not yet implemented. Users can not 3167 // use it. 3168 // "PRELAUNCH" - Prelaunch features are hidden from users and are only 3169 // visible internally. 3170 // "EARLY_ACCESS" - Early Access features are limited to a closed 3171 // group of testers. To use these features, you must sign up in advance 3172 // and sign a Trusted Tester agreement (which includes confidentiality 3173 // provisions). These features may be unstable, changed in 3174 // backward-incompatible ways, and are not guaranteed to be released. 3175 // "ALPHA" - Alpha is a limited availability test for releases before 3176 // they are cleared for widespread use. By Alpha, all significant design 3177 // issues are resolved and we are in the process of verifying 3178 // functionality. Alpha customers need to apply for access, agree to 3179 // applicable terms, and have their projects allowlisted. Alpha releases 3180 // don’t have to be feature complete, no SLAs are provided, and there 3181 // are no technical support obligations, but they will be far enough 3182 // along that customers can actually use them in test environments or 3183 // for limited-use tests -- just like they would in normal production 3184 // cases. 3185 // "BETA" - Beta is the point at which we are ready to open a release 3186 // for any customer to use. There are no SLA or technical support 3187 // obligations in a Beta release. Products will be complete from a 3188 // feature perspective, but may have some open outstanding issues. Beta 3189 // releases are suitable for limited production use cases. 3190 // "GA" - GA features are open to all developers and are considered 3191 // stable and fully qualified for production use. 3192 // "DEPRECATED" - Deprecated features are scheduled to be shut down 3193 // and removed. For more information, see the “Deprecation Policy” 3194 // section of our [Terms of Service](https://cloud.google.com/terms/) 3195 // and the [Google Cloud Platform Subject to the Deprecation 3196 // Policy](https://cloud.google.com/terms/deprecation) documentation. 3197 LaunchStage string `json:"launchStage,omitempty"` 3198 3199 // Name: Optional. The resource name of the monitored resource 3200 // descriptor: 3201 // "projects/{project_id}/monitoredResourceDescriptors/{type}" where 3202 // {type} is the value of the `type` field in this object and 3203 // {project_id} is a project ID that provides API-specific context for 3204 // accessing the type. APIs that do not use project information can use 3205 // the resource name format "monitoredResourceDescriptors/{type}". 3206 Name string `json:"name,omitempty"` 3207 3208 // Type: Required. The monitored resource type. For example, the type 3209 // "cloudsql_database" represents databases in Google Cloud SQL. 3210 Type string `json:"type,omitempty"` 3211 3212 // ForceSendFields is a list of field names (e.g. "Description") to 3213 // unconditionally include in API requests. By default, fields with 3214 // empty values are omitted from API requests. However, any non-pointer, 3215 // non-interface field appearing in ForceSendFields will be sent to the 3216 // server regardless of whether the field is empty or not. This may be 3217 // used to include empty fields in Patch requests. 3218 ForceSendFields []string `json:"-"` 3219 3220 // NullFields is a list of field names (e.g. "Description") to include 3221 // in API requests with the JSON null value. By default, fields with 3222 // empty values are omitted from API requests. However, any field with 3223 // an empty value appearing in NullFields will be sent to the server as 3224 // null. It is an error if a field in this list has a non-empty value. 3225 // This may be used to include null fields in Patch requests. 3226 NullFields []string `json:"-"` 3227} 3228 3229func (s *MonitoredResourceDescriptor) MarshalJSON() ([]byte, error) { 3230 type NoMethod MonitoredResourceDescriptor 3231 raw := NoMethod(*s) 3232 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3233} 3234 3235// Monitoring: Monitoring configuration of the service. The example 3236// below shows how to configure monitored resources and metrics for 3237// monitoring. In the example, a monitored resource and two metrics are 3238// defined. The `library.googleapis.com/book/returned_count` metric is 3239// sent to both producer and consumer projects, whereas the 3240// `library.googleapis.com/book/num_overdue` metric is only sent to the 3241// consumer project. monitored_resources: - type: 3242// library.googleapis.com/Branch display_name: "Library Branch" 3243// description: "A branch of a library." launch_stage: GA labels: - key: 3244// resource_container description: "The Cloud container (ie. project id) 3245// for the Branch." - key: location description: "The location of the 3246// library branch." - key: branch_id description: "The id of the 3247// branch." metrics: - name: library.googleapis.com/book/returned_count 3248// display_name: "Books Returned" description: "The count of books that 3249// have been returned." launch_stage: GA metric_kind: DELTA value_type: 3250// INT64 unit: "1" labels: - key: customer_id description: "The id of 3251// the customer." - name: library.googleapis.com/book/num_overdue 3252// display_name: "Books Overdue" description: "The current number of 3253// overdue books." launch_stage: GA metric_kind: GAUGE value_type: INT64 3254// unit: "1" labels: - key: customer_id description: "The id of the 3255// customer." monitoring: producer_destinations: - monitored_resource: 3256// library.googleapis.com/Branch metrics: - 3257// library.googleapis.com/book/returned_count consumer_destinations: - 3258// monitored_resource: library.googleapis.com/Branch metrics: - 3259// library.googleapis.com/book/returned_count - 3260// library.googleapis.com/book/num_overdue 3261type Monitoring struct { 3262 // ConsumerDestinations: Monitoring configurations for sending metrics 3263 // to the consumer project. There can be multiple consumer destinations. 3264 // A monitored resource type may appear in multiple monitoring 3265 // destinations if different aggregations are needed for different sets 3266 // of metrics associated with that monitored resource type. A monitored 3267 // resource and metric pair may only be used once in the Monitoring 3268 // configuration. 3269 ConsumerDestinations []*MonitoringDestination `json:"consumerDestinations,omitempty"` 3270 3271 // ProducerDestinations: Monitoring configurations for sending metrics 3272 // to the producer project. There can be multiple producer destinations. 3273 // A monitored resource type may appear in multiple monitoring 3274 // destinations if different aggregations are needed for different sets 3275 // of metrics associated with that monitored resource type. A monitored 3276 // resource and metric pair may only be used once in the Monitoring 3277 // configuration. 3278 ProducerDestinations []*MonitoringDestination `json:"producerDestinations,omitempty"` 3279 3280 // ForceSendFields is a list of field names (e.g. 3281 // "ConsumerDestinations") to unconditionally include in API requests. 3282 // By default, fields with empty values are omitted from API requests. 3283 // However, any non-pointer, non-interface field appearing in 3284 // ForceSendFields will be sent to the server regardless of whether the 3285 // field is empty or not. This may be used to include empty fields in 3286 // Patch requests. 3287 ForceSendFields []string `json:"-"` 3288 3289 // NullFields is a list of field names (e.g. "ConsumerDestinations") to 3290 // include in API requests with the JSON null value. By default, fields 3291 // with empty values are omitted from API requests. However, any field 3292 // with an empty value appearing in NullFields will be sent to the 3293 // server as null. It is an error if a field in this list has a 3294 // non-empty value. This may be used to include null fields in Patch 3295 // requests. 3296 NullFields []string `json:"-"` 3297} 3298 3299func (s *Monitoring) MarshalJSON() ([]byte, error) { 3300 type NoMethod Monitoring 3301 raw := NoMethod(*s) 3302 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3303} 3304 3305// MonitoringDestination: Configuration of a specific monitoring 3306// destination (the producer project or the consumer project). 3307type MonitoringDestination struct { 3308 // Metrics: Types of the metrics to report to this monitoring 3309 // destination. Each type must be defined in Service.metrics section. 3310 Metrics []string `json:"metrics,omitempty"` 3311 3312 // MonitoredResource: The monitored resource type. The type must be 3313 // defined in Service.monitored_resources section. 3314 MonitoredResource string `json:"monitoredResource,omitempty"` 3315 3316 // ForceSendFields is a list of field names (e.g. "Metrics") to 3317 // unconditionally include in API requests. By default, fields with 3318 // empty values are omitted from API requests. However, any non-pointer, 3319 // non-interface field appearing in ForceSendFields will be sent to the 3320 // server regardless of whether the field is empty or not. This may be 3321 // used to include empty fields in Patch requests. 3322 ForceSendFields []string `json:"-"` 3323 3324 // NullFields is a list of field names (e.g. "Metrics") to include in 3325 // API requests with the JSON null value. By default, fields with empty 3326 // values are omitted from API requests. However, any field with an 3327 // empty value appearing in NullFields will be sent to the server as 3328 // null. It is an error if a field in this list has a non-empty value. 3329 // This may be used to include null fields in Patch requests. 3330 NullFields []string `json:"-"` 3331} 3332 3333func (s *MonitoringDestination) MarshalJSON() ([]byte, error) { 3334 type NoMethod MonitoringDestination 3335 raw := NoMethod(*s) 3336 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3337} 3338 3339// OAuthRequirements: OAuth scopes are a way to define data and 3340// permissions on data. For example, there are scopes defined for 3341// "Read-only access to Google Calendar" and "Access to Cloud Platform". 3342// Users can consent to a scope for an application, giving it permission 3343// to access that data on their behalf. OAuth scope specifications 3344// should be fairly coarse grained; a user will need to see and 3345// understand the text description of what your scope means. In most 3346// cases: use one or at most two OAuth scopes for an entire family of 3347// products. If your product has multiple APIs, you should probably be 3348// sharing the OAuth scope across all of those APIs. When you need finer 3349// grained OAuth consent screens: talk with your product management 3350// about how developers will use them in practice. Please note that even 3351// though each of the canonical scopes is enough for a request to be 3352// accepted and passed to the backend, a request can still fail due to 3353// the backend requiring additional scopes or permissions. 3354type OAuthRequirements struct { 3355 // CanonicalScopes: The list of publicly documented OAuth scopes that 3356 // are allowed access. An OAuth token containing any of these scopes 3357 // will be accepted. Example: canonical_scopes: 3358 // https://www.googleapis.com/auth/calendar, 3359 // https://www.googleapis.com/auth/calendar.read 3360 CanonicalScopes string `json:"canonicalScopes,omitempty"` 3361 3362 // ForceSendFields is a list of field names (e.g. "CanonicalScopes") to 3363 // unconditionally include in API requests. By default, fields with 3364 // empty values are omitted from API requests. However, any non-pointer, 3365 // non-interface field appearing in ForceSendFields will be sent to the 3366 // server regardless of whether the field is empty or not. This may be 3367 // used to include empty fields in Patch requests. 3368 ForceSendFields []string `json:"-"` 3369 3370 // NullFields is a list of field names (e.g. "CanonicalScopes") to 3371 // include in API requests with the JSON null value. By default, fields 3372 // with empty values are omitted from API requests. However, any field 3373 // with an empty value appearing in NullFields will be sent to the 3374 // server as null. It is an error if a field in this list has a 3375 // non-empty value. This may be used to include null fields in Patch 3376 // requests. 3377 NullFields []string `json:"-"` 3378} 3379 3380func (s *OAuthRequirements) MarshalJSON() ([]byte, error) { 3381 type NoMethod OAuthRequirements 3382 raw := NoMethod(*s) 3383 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3384} 3385 3386// Operation: This resource represents a long-running operation that is 3387// the result of a network API call. 3388type Operation struct { 3389 // Done: If the value is `false`, it means the operation is still in 3390 // progress. If `true`, the operation is completed, and either `error` 3391 // or `response` is available. 3392 Done bool `json:"done,omitempty"` 3393 3394 // Error: The error result of the operation in case of failure or 3395 // cancellation. 3396 Error *Status `json:"error,omitempty"` 3397 3398 // Metadata: Service-specific metadata associated with the operation. It 3399 // typically contains progress information and common metadata such as 3400 // create time. Some services might not provide such metadata. Any 3401 // method that returns a long-running operation should document the 3402 // metadata type, if any. 3403 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 3404 3405 // Name: The server-assigned name, which is only unique within the same 3406 // service that originally returns it. If you use the default HTTP 3407 // mapping, the `name` should be a resource name ending with 3408 // `operations/{unique_id}`. 3409 Name string `json:"name,omitempty"` 3410 3411 // Response: The normal response of the operation in case of success. If 3412 // the original method returns no data on success, such as `Delete`, the 3413 // response is `google.protobuf.Empty`. If the original method is 3414 // standard `Get`/`Create`/`Update`, the response should be the 3415 // resource. For other methods, the response should have the type 3416 // `XxxResponse`, where `Xxx` is the original method name. For example, 3417 // if the original method name is `TakeSnapshot()`, the inferred 3418 // response type is `TakeSnapshotResponse`. 3419 Response googleapi.RawMessage `json:"response,omitempty"` 3420 3421 // ServerResponse contains the HTTP response code and headers from the 3422 // server. 3423 googleapi.ServerResponse `json:"-"` 3424 3425 // ForceSendFields is a list of field names (e.g. "Done") to 3426 // unconditionally include in API requests. By default, fields with 3427 // empty values are omitted from API requests. However, any non-pointer, 3428 // non-interface field appearing in ForceSendFields will be sent to the 3429 // server regardless of whether the field is empty or not. This may be 3430 // used to include empty fields in Patch requests. 3431 ForceSendFields []string `json:"-"` 3432 3433 // NullFields is a list of field names (e.g. "Done") to include in API 3434 // requests with the JSON null value. By default, fields with empty 3435 // values are omitted from API requests. However, any field with an 3436 // empty value appearing in NullFields will be sent to the server as 3437 // null. It is an error if a field in this list has a non-empty value. 3438 // This may be used to include null fields in Patch requests. 3439 NullFields []string `json:"-"` 3440} 3441 3442func (s *Operation) MarshalJSON() ([]byte, error) { 3443 type NoMethod Operation 3444 raw := NoMethod(*s) 3445 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3446} 3447 3448// OperationMetadata: The metadata associated with a long running 3449// operation resource. 3450type OperationMetadata struct { 3451 // ProgressPercentage: Percentage of completion of this operation, 3452 // ranging from 0 to 100. 3453 ProgressPercentage int64 `json:"progressPercentage,omitempty"` 3454 3455 // ResourceNames: The full name of the resources that this operation is 3456 // directly associated with. 3457 ResourceNames []string `json:"resourceNames,omitempty"` 3458 3459 // StartTime: The start time of the operation. 3460 StartTime string `json:"startTime,omitempty"` 3461 3462 // Steps: Detailed status information for each step. The order is 3463 // undetermined. 3464 Steps []*Step `json:"steps,omitempty"` 3465 3466 // ForceSendFields is a list of field names (e.g. "ProgressPercentage") 3467 // to unconditionally include in API requests. By default, fields with 3468 // empty values are omitted from API requests. However, any non-pointer, 3469 // non-interface field appearing in ForceSendFields will be sent to the 3470 // server regardless of whether the field is empty or not. This may be 3471 // used to include empty fields in Patch requests. 3472 ForceSendFields []string `json:"-"` 3473 3474 // NullFields is a list of field names (e.g. "ProgressPercentage") to 3475 // include in API requests with the JSON null value. By default, fields 3476 // with empty values are omitted from API requests. However, any field 3477 // with an empty value appearing in NullFields will be sent to the 3478 // server as null. It is an error if a field in this list has a 3479 // non-empty value. This may be used to include null fields in Patch 3480 // requests. 3481 NullFields []string `json:"-"` 3482} 3483 3484func (s *OperationMetadata) MarshalJSON() ([]byte, error) { 3485 type NoMethod OperationMetadata 3486 raw := NoMethod(*s) 3487 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3488} 3489 3490// Option: A protocol buffer option, which can be attached to a message, 3491// field, enumeration, etc. 3492type Option struct { 3493 // Name: The option's name. For protobuf built-in options (options 3494 // defined in descriptor.proto), this is the short name. For example, 3495 // "map_entry". For custom options, it should be the fully-qualified 3496 // name. For example, "google.api.http". 3497 Name string `json:"name,omitempty"` 3498 3499 // Value: The option's value packed in an Any message. If the value is a 3500 // primitive, the corresponding wrapper type defined in 3501 // google/protobuf/wrappers.proto should be used. If the value is an 3502 // enum, it should be stored as an int32 value using the 3503 // google.protobuf.Int32Value type. 3504 Value googleapi.RawMessage `json:"value,omitempty"` 3505 3506 // ForceSendFields is a list of field names (e.g. "Name") to 3507 // unconditionally include in API requests. By default, fields with 3508 // empty values are omitted from API requests. However, any non-pointer, 3509 // non-interface field appearing in ForceSendFields will be sent to the 3510 // server regardless of whether the field is empty or not. This may be 3511 // used to include empty fields in Patch requests. 3512 ForceSendFields []string `json:"-"` 3513 3514 // NullFields is a list of field names (e.g. "Name") to include in API 3515 // requests with the JSON null value. By default, fields with empty 3516 // values are omitted from API requests. However, any field with an 3517 // empty value appearing in NullFields will be sent to the server as 3518 // null. It is an error if a field in this list has a non-empty value. 3519 // This may be used to include null fields in Patch requests. 3520 NullFields []string `json:"-"` 3521} 3522 3523func (s *Option) MarshalJSON() ([]byte, error) { 3524 type NoMethod Option 3525 raw := NoMethod(*s) 3526 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3527} 3528 3529// Page: Represents a documentation page. A page can contain subpages to 3530// represent nested documentation set structure. 3531type Page struct { 3532 // Content: The Markdown content of the page. You can use (== include 3533 // {path} ==) to include content from a Markdown file. 3534 Content string `json:"content,omitempty"` 3535 3536 // Name: The name of the page. It will be used as an identity of the 3537 // page to generate URI of the page, text of the link to this page in 3538 // navigation, etc. The full page name (start from the root page name to 3539 // this page concatenated with `.`) can be used as reference to the page 3540 // in your documentation. For example: pages: - name: Tutorial content: 3541 // (== include tutorial.md ==) subpages: - name: Java content: (== 3542 // include tutorial_java.md ==) You can reference `Java` page using 3543 // Markdown reference link syntax: `Java`. 3544 Name string `json:"name,omitempty"` 3545 3546 // Subpages: Subpages of this page. The order of subpages specified here 3547 // will be honored in the generated docset. 3548 Subpages []*Page `json:"subpages,omitempty"` 3549 3550 // ForceSendFields is a list of field names (e.g. "Content") to 3551 // unconditionally include in API requests. By default, fields with 3552 // empty values are omitted from API requests. However, any non-pointer, 3553 // non-interface field appearing in ForceSendFields will be sent to the 3554 // server regardless of whether the field is empty or not. This may be 3555 // used to include empty fields in Patch requests. 3556 ForceSendFields []string `json:"-"` 3557 3558 // NullFields is a list of field names (e.g. "Content") to include in 3559 // API requests with the JSON null value. By default, fields with empty 3560 // values are omitted from API requests. However, any field with an 3561 // empty value appearing in NullFields will be sent to the server as 3562 // null. It is an error if a field in this list has a non-empty value. 3563 // This may be used to include null fields in Patch requests. 3564 NullFields []string `json:"-"` 3565} 3566 3567func (s *Page) MarshalJSON() ([]byte, error) { 3568 type NoMethod Page 3569 raw := NoMethod(*s) 3570 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3571} 3572 3573// Policy: An Identity and Access Management (IAM) policy, which 3574// specifies access controls for Google Cloud resources. A `Policy` is a 3575// collection of `bindings`. A `binding` binds one or more `members` to 3576// a single `role`. Members can be user accounts, service accounts, 3577// Google groups, and domains (such as G Suite). A `role` is a named 3578// list of permissions; each `role` can be an IAM predefined role or a 3579// user-created custom role. For some types of Google Cloud resources, a 3580// `binding` can also specify a `condition`, which is a logical 3581// expression that allows access to a resource only if the expression 3582// evaluates to `true`. A condition can add constraints based on 3583// attributes of the request, the resource, or both. To learn which 3584// resources support conditions in their IAM policies, see the [IAM 3585// documentation](https://cloud.google.com/iam/help/conditions/resource-p 3586// olicies). **JSON example:** { "bindings": [ { "role": 3587// "roles/resourcemanager.organizationAdmin", "members": [ 3588// "user:mike@example.com", "group:admins@example.com", 3589// "domain:google.com", 3590// "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { 3591// "role": "roles/resourcemanager.organizationViewer", "members": [ 3592// "user:eve@example.com" ], "condition": { "title": "expirable access", 3593// "description": "Does not grant access after Sep 2020", "expression": 3594// "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], 3595// "etag": "BwWWja0YfJA=", "version": 3 } **YAML example:** bindings: - 3596// members: - user:mike@example.com - group:admins@example.com - 3597// domain:google.com - 3598// serviceAccount:my-project-id@appspot.gserviceaccount.com role: 3599// roles/resourcemanager.organizationAdmin - members: - 3600// user:eve@example.com role: roles/resourcemanager.organizationViewer 3601// condition: title: expirable access description: Does not grant access 3602// after Sep 2020 expression: request.time < 3603// timestamp('2020-10-01T00:00:00.000Z') - etag: BwWWja0YfJA= - version: 3604// 3 For a description of IAM and its features, see the [IAM 3605// documentation](https://cloud.google.com/iam/docs/). 3606type Policy struct { 3607 // AuditConfigs: Specifies cloud audit logging configuration for this 3608 // policy. 3609 AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"` 3610 3611 // Bindings: Associates a list of `members` to a `role`. Optionally, may 3612 // specify a `condition` that determines how and when the `bindings` are 3613 // applied. Each of the `bindings` must contain at least one member. 3614 Bindings []*Binding `json:"bindings,omitempty"` 3615 3616 // Etag: `etag` is used for optimistic concurrency control as a way to 3617 // help prevent simultaneous updates of a policy from overwriting each 3618 // other. It is strongly suggested that systems make use of the `etag` 3619 // in the read-modify-write cycle to perform policy updates in order to 3620 // avoid race conditions: An `etag` is returned in the response to 3621 // `getIamPolicy`, and systems are expected to put that etag in the 3622 // request to `setIamPolicy` to ensure that their change will be applied 3623 // to the same version of the policy. **Important:** If you use IAM 3624 // Conditions, you must include the `etag` field whenever you call 3625 // `setIamPolicy`. If you omit this field, then IAM allows you to 3626 // overwrite a version `3` policy with a version `1` policy, and all of 3627 // the conditions in the version `3` policy are lost. 3628 Etag string `json:"etag,omitempty"` 3629 3630 // Version: Specifies the format of the policy. Valid values are `0`, 3631 // `1`, and `3`. Requests that specify an invalid value are rejected. 3632 // Any operation that affects conditional role bindings must specify 3633 // version `3`. This requirement applies to the following operations: * 3634 // Getting a policy that includes a conditional role binding * Adding a 3635 // conditional role binding to a policy * Changing a conditional role 3636 // binding in a policy * Removing any role binding, with or without a 3637 // condition, from a policy that includes conditions **Important:** If 3638 // you use IAM Conditions, you must include the `etag` field whenever 3639 // you call `setIamPolicy`. If you omit this field, then IAM allows you 3640 // to overwrite a version `3` policy with a version `1` policy, and all 3641 // of the conditions in the version `3` policy are lost. If a policy 3642 // does not include any conditions, operations on that policy may 3643 // specify any valid version or leave the field unset. To learn which 3644 // resources support conditions in their IAM policies, see the [IAM 3645 // documentation](https://cloud.google.com/iam/help/conditions/resource-p 3646 // olicies). 3647 Version int64 `json:"version,omitempty"` 3648 3649 // ServerResponse contains the HTTP response code and headers from the 3650 // server. 3651 googleapi.ServerResponse `json:"-"` 3652 3653 // ForceSendFields is a list of field names (e.g. "AuditConfigs") to 3654 // unconditionally include in API requests. By default, fields with 3655 // empty values are omitted from API requests. However, any non-pointer, 3656 // non-interface field appearing in ForceSendFields will be sent to the 3657 // server regardless of whether the field is empty or not. This may be 3658 // used to include empty fields in Patch requests. 3659 ForceSendFields []string `json:"-"` 3660 3661 // NullFields is a list of field names (e.g. "AuditConfigs") to include 3662 // in API requests with the JSON null value. By default, fields with 3663 // empty values are omitted from API requests. However, any field with 3664 // an empty value appearing in NullFields will be sent to the server as 3665 // null. It is an error if a field in this list has a non-empty value. 3666 // This may be used to include null fields in Patch requests. 3667 NullFields []string `json:"-"` 3668} 3669 3670func (s *Policy) MarshalJSON() ([]byte, error) { 3671 type NoMethod Policy 3672 raw := NoMethod(*s) 3673 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3674} 3675 3676// Quota: Quota configuration helps to achieve fairness and budgeting in 3677// service usage. The metric based quota configuration works this way: - 3678// The service configuration defines a set of metrics. - For API calls, 3679// the quota.metric_rules maps methods to metrics with corresponding 3680// costs. - The quota.limits defines limits on the metrics, which will 3681// be used for quota checks at runtime. An example quota configuration 3682// in yaml format: quota: limits: - name: apiWriteQpsPerProject metric: 3683// library.googleapis.com/write_calls unit: "1/min/{project}" # rate 3684// limit for consumer projects values: STANDARD: 10000 # The metric 3685// rules bind all methods to the read_calls metric, # except for the 3686// UpdateBook and DeleteBook methods. These two methods # are mapped to 3687// the write_calls metric, with the UpdateBook method # consuming at 3688// twice rate as the DeleteBook method. metric_rules: - selector: "*" 3689// metric_costs: library.googleapis.com/read_calls: 1 - selector: 3690// google.example.library.v1.LibraryService.UpdateBook metric_costs: 3691// library.googleapis.com/write_calls: 2 - selector: 3692// google.example.library.v1.LibraryService.DeleteBook metric_costs: 3693// library.googleapis.com/write_calls: 1 Corresponding Metric 3694// definition: metrics: - name: library.googleapis.com/read_calls 3695// display_name: Read requests metric_kind: DELTA value_type: INT64 - 3696// name: library.googleapis.com/write_calls display_name: Write requests 3697// metric_kind: DELTA value_type: INT64 3698type Quota struct { 3699 // Limits: List of `QuotaLimit` definitions for the service. 3700 Limits []*QuotaLimit `json:"limits,omitempty"` 3701 3702 // MetricRules: List of `MetricRule` definitions, each one mapping a 3703 // selected method to one or more metrics. 3704 MetricRules []*MetricRule `json:"metricRules,omitempty"` 3705 3706 // ForceSendFields is a list of field names (e.g. "Limits") to 3707 // unconditionally include in API requests. By default, fields with 3708 // empty values are omitted from API requests. However, any non-pointer, 3709 // non-interface field appearing in ForceSendFields will be sent to the 3710 // server regardless of whether the field is empty or not. This may be 3711 // used to include empty fields in Patch requests. 3712 ForceSendFields []string `json:"-"` 3713 3714 // NullFields is a list of field names (e.g. "Limits") to include in API 3715 // requests with the JSON null value. By default, fields with empty 3716 // values are omitted from API requests. However, any field with an 3717 // empty value appearing in NullFields will be sent to the server as 3718 // null. It is an error if a field in this list has a non-empty value. 3719 // This may be used to include null fields in Patch requests. 3720 NullFields []string `json:"-"` 3721} 3722 3723func (s *Quota) MarshalJSON() ([]byte, error) { 3724 type NoMethod Quota 3725 raw := NoMethod(*s) 3726 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3727} 3728 3729// QuotaLimit: `QuotaLimit` defines a specific limit that applies over a 3730// specified duration for a limit type. There can be at most one limit 3731// for a duration and limit type combination defined within a 3732// `QuotaGroup`. 3733type QuotaLimit struct { 3734 // DefaultLimit: Default number of tokens that can be consumed during 3735 // the specified duration. This is the number of tokens assigned when a 3736 // client application developer activates the service for his/her 3737 // project. Specifying a value of 0 will block all requests. This can be 3738 // used if you are provisioning quota to selected consumers and blocking 3739 // others. Similarly, a value of -1 will indicate an unlimited quota. No 3740 // other negative values are allowed. Used by group-based quotas only. 3741 DefaultLimit int64 `json:"defaultLimit,omitempty,string"` 3742 3743 // Description: Optional. User-visible, extended description for this 3744 // quota limit. Should be used only when more context is needed to 3745 // understand this limit than provided by the limit's display name (see: 3746 // `display_name`). 3747 Description string `json:"description,omitempty"` 3748 3749 // DisplayName: User-visible display name for this limit. Optional. If 3750 // not set, the UI will provide a default display name based on the 3751 // quota configuration. This field can be used to override the default 3752 // display name generated from the configuration. 3753 DisplayName string `json:"displayName,omitempty"` 3754 3755 // Duration: Duration of this limit in textual notation. Must be "100s" 3756 // or "1d". Used by group-based quotas only. 3757 Duration string `json:"duration,omitempty"` 3758 3759 // FreeTier: Free tier value displayed in the Developers Console for 3760 // this limit. The free tier is the number of tokens that will be 3761 // subtracted from the billed amount when billing is enabled. This field 3762 // can only be set on a limit with duration "1d", in a billable group; 3763 // it is invalid on any other limit. If this field is not set, it 3764 // defaults to 0, indicating that there is no free tier for this 3765 // service. Used by group-based quotas only. 3766 FreeTier int64 `json:"freeTier,omitempty,string"` 3767 3768 // MaxLimit: Maximum number of tokens that can be consumed during the 3769 // specified duration. Client application developers can override the 3770 // default limit up to this maximum. If specified, this value cannot be 3771 // set to a value less than the default limit. If not specified, it is 3772 // set to the default limit. To allow clients to apply overrides with no 3773 // upper bound, set this to -1, indicating unlimited maximum quota. Used 3774 // by group-based quotas only. 3775 MaxLimit int64 `json:"maxLimit,omitempty,string"` 3776 3777 // Metric: The name of the metric this quota limit applies to. The quota 3778 // limits with the same metric will be checked together during runtime. 3779 // The metric must be defined within the service config. 3780 Metric string `json:"metric,omitempty"` 3781 3782 // Name: Name of the quota limit. The name must be provided, and it must 3783 // be unique within the service. The name can only include alphanumeric 3784 // characters as well as '-'. The maximum length of the limit name is 64 3785 // characters. 3786 Name string `json:"name,omitempty"` 3787 3788 // Unit: Specify the unit of the quota limit. It uses the same syntax as 3789 // Metric.unit. The supported unit kinds are determined by the quota 3790 // backend system. Here are some examples: * "1/min/{project}" for quota 3791 // per minute per project. Note: the order of unit components is 3792 // insignificant. The "1" at the beginning is required to follow the 3793 // metric unit syntax. 3794 Unit string `json:"unit,omitempty"` 3795 3796 // Values: Tiered limit values. You must specify this as a key:value 3797 // pair, with an integer value that is the maximum number of requests 3798 // allowed for the specified unit. Currently only STANDARD is supported. 3799 Values map[string]string `json:"values,omitempty"` 3800 3801 // ForceSendFields is a list of field names (e.g. "DefaultLimit") to 3802 // unconditionally include in API requests. By default, fields with 3803 // empty values are omitted from API requests. However, any non-pointer, 3804 // non-interface field appearing in ForceSendFields will be sent to the 3805 // server regardless of whether the field is empty or not. This may be 3806 // used to include empty fields in Patch requests. 3807 ForceSendFields []string `json:"-"` 3808 3809 // NullFields is a list of field names (e.g. "DefaultLimit") to include 3810 // in API requests with the JSON null value. By default, fields with 3811 // empty values are omitted from API requests. However, any field with 3812 // an empty value appearing in NullFields will be sent to the server as 3813 // null. It is an error if a field in this list has a non-empty value. 3814 // This may be used to include null fields in Patch requests. 3815 NullFields []string `json:"-"` 3816} 3817 3818func (s *QuotaLimit) MarshalJSON() ([]byte, error) { 3819 type NoMethod QuotaLimit 3820 raw := NoMethod(*s) 3821 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3822} 3823 3824// ResourceReference: Defines a proto annotation that describes a string 3825// field that refers to an API resource. 3826type ResourceReference struct { 3827 // ChildType: The resource type of a child collection that the annotated 3828 // field references. This is useful for annotating the `parent` field 3829 // that doesn't have a fixed resource type. Example: message 3830 // ListLogEntriesRequest { string parent = 1 3831 // [(google.api.resource_reference) = { child_type: 3832 // "logging.googleapis.com/LogEntry" }; } 3833 ChildType string `json:"childType,omitempty"` 3834 3835 // Type: The resource type that the annotated field references. Example: 3836 // message Subscription { string topic = 2 3837 // [(google.api.resource_reference) = { type: 3838 // "pubsub.googleapis.com/Topic" }]; } Occasionally, a field may 3839 // reference an arbitrary resource. In this case, APIs use the special 3840 // value * in their resource reference. Example: message 3841 // GetIamPolicyRequest { string resource = 2 3842 // [(google.api.resource_reference) = { type: "*" }]; } 3843 Type string `json:"type,omitempty"` 3844 3845 // ForceSendFields is a list of field names (e.g. "ChildType") to 3846 // unconditionally include in API requests. By default, fields with 3847 // empty values are omitted from API requests. However, any non-pointer, 3848 // non-interface field appearing in ForceSendFields will be sent to the 3849 // server regardless of whether the field is empty or not. This may be 3850 // used to include empty fields in Patch requests. 3851 ForceSendFields []string `json:"-"` 3852 3853 // NullFields is a list of field names (e.g. "ChildType") to include in 3854 // API requests with the JSON null value. By default, fields with empty 3855 // values are omitted from API requests. However, any field with an 3856 // empty value appearing in NullFields will be sent to the server as 3857 // null. It is an error if a field in this list has a non-empty value. 3858 // This may be used to include null fields in Patch requests. 3859 NullFields []string `json:"-"` 3860} 3861 3862func (s *ResourceReference) MarshalJSON() ([]byte, error) { 3863 type NoMethod ResourceReference 3864 raw := NoMethod(*s) 3865 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3866} 3867 3868// Rollout: A rollout resource that defines how service configuration 3869// versions are pushed to control plane systems. Typically, you create a 3870// new version of the service config, and then create a Rollout to push 3871// the service config. 3872type Rollout struct { 3873 // CreateTime: Creation time of the rollout. Readonly. 3874 CreateTime string `json:"createTime,omitempty"` 3875 3876 // CreatedBy: This field is deprecated and will be deleted. Please 3877 // remove usage of this field. 3878 CreatedBy string `json:"createdBy,omitempty"` 3879 3880 // DeleteServiceStrategy: The strategy associated with a rollout to 3881 // delete a `ManagedService`. Readonly. 3882 DeleteServiceStrategy *DeleteServiceStrategy `json:"deleteServiceStrategy,omitempty"` 3883 3884 // RolloutId: Optional. Unique identifier of this Rollout. Must be no 3885 // longer than 63 characters and only lower case letters, digits, '.', 3886 // '_' and '-' are allowed. If not specified by client, the server will 3887 // generate one. The generated id will have the form of , where "date" 3888 // is the create date in ISO 8601 format. "revision number" is a 3889 // monotonically increasing positive number that is reset every day for 3890 // each service. An example of the generated rollout_id is 3891 // '2016-02-16r1' 3892 RolloutId string `json:"rolloutId,omitempty"` 3893 3894 // ServiceName: The name of the service associated with this Rollout. 3895 ServiceName string `json:"serviceName,omitempty"` 3896 3897 // Status: The status of this rollout. Readonly. In case of a failed 3898 // rollout, the system will automatically rollback to the current 3899 // Rollout version. Readonly. 3900 // 3901 // Possible values: 3902 // "ROLLOUT_STATUS_UNSPECIFIED" - No status specified. 3903 // "IN_PROGRESS" - The Rollout is in progress. 3904 // "SUCCESS" - The Rollout has completed successfully. 3905 // "CANCELLED" - The Rollout has been cancelled. This can happen if 3906 // you have overlapping Rollout pushes, and the previous ones will be 3907 // cancelled. 3908 // "FAILED" - The Rollout has failed and the rollback attempt has 3909 // failed too. 3910 // "PENDING" - The Rollout has not started yet and is pending for 3911 // execution. 3912 // "FAILED_ROLLED_BACK" - The Rollout has failed and rolled back to 3913 // the previous successful Rollout. 3914 Status string `json:"status,omitempty"` 3915 3916 // TrafficPercentStrategy: Google Service Control selects service 3917 // configurations based on traffic percentage. 3918 TrafficPercentStrategy *TrafficPercentStrategy `json:"trafficPercentStrategy,omitempty"` 3919 3920 // ServerResponse contains the HTTP response code and headers from the 3921 // server. 3922 googleapi.ServerResponse `json:"-"` 3923 3924 // ForceSendFields is a list of field names (e.g. "CreateTime") to 3925 // unconditionally include in API requests. By default, fields with 3926 // empty values are omitted from API requests. However, any non-pointer, 3927 // non-interface field appearing in ForceSendFields will be sent to the 3928 // server regardless of whether the field is empty or not. This may be 3929 // used to include empty fields in Patch requests. 3930 ForceSendFields []string `json:"-"` 3931 3932 // NullFields is a list of field names (e.g. "CreateTime") to include in 3933 // API requests with the JSON null value. By default, fields with empty 3934 // values are omitted from API requests. However, any field with an 3935 // empty value appearing in NullFields will be sent to the server as 3936 // null. It is an error if a field in this list has a non-empty value. 3937 // This may be used to include null fields in Patch requests. 3938 NullFields []string `json:"-"` 3939} 3940 3941func (s *Rollout) MarshalJSON() ([]byte, error) { 3942 type NoMethod Rollout 3943 raw := NoMethod(*s) 3944 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3945} 3946 3947// Service: `Service` is the root object of Google service configuration 3948// schema. It describes basic information about a service, such as the 3949// name and the title, and delegates other aspects to sub-sections. Each 3950// sub-section is either a proto message or a repeated proto message 3951// that configures a specific aspect, such as auth. See each proto 3952// message definition for details. Example: type: google.api.Service 3953// config_version: 3 name: calendar.googleapis.com title: Google 3954// Calendar API apis: - name: google.calendar.v3.Calendar 3955// authentication: providers: - id: google_calendar_auth jwks_uri: 3956// https://www.googleapis.com/oauth2/v1/certs issuer: 3957// https://securetoken.google.com rules: - selector: "*" requirements: 3958// provider_id: google_calendar_auth 3959type Service struct { 3960 // Apis: A list of API interfaces exported by this service. Only the 3961 // `name` field of the google.protobuf.Api needs to be provided by the 3962 // configuration author, as the remaining fields will be derived from 3963 // the IDL during the normalization process. It is an error to specify 3964 // an API interface here which cannot be resolved against the associated 3965 // IDL files. 3966 Apis []*Api `json:"apis,omitempty"` 3967 3968 // Authentication: Auth configuration. 3969 Authentication *Authentication `json:"authentication,omitempty"` 3970 3971 // Backend: API backend configuration. 3972 Backend *Backend `json:"backend,omitempty"` 3973 3974 // Billing: Billing configuration. 3975 Billing *Billing `json:"billing,omitempty"` 3976 3977 // ConfigVersion: This field is obsolete. Its value must be set to `3`. 3978 ConfigVersion int64 `json:"configVersion,omitempty"` 3979 3980 // Context: Context configuration. 3981 Context *Context `json:"context,omitempty"` 3982 3983 // Control: Configuration for the service control plane. 3984 Control *Control `json:"control,omitempty"` 3985 3986 // CustomError: Custom error configuration. 3987 CustomError *CustomError `json:"customError,omitempty"` 3988 3989 // Documentation: Additional API documentation. 3990 Documentation *Documentation `json:"documentation,omitempty"` 3991 3992 // Endpoints: Configuration for network endpoints. If this is empty, 3993 // then an endpoint with the same name as the service is automatically 3994 // generated to service all defined APIs. 3995 Endpoints []*Endpoint `json:"endpoints,omitempty"` 3996 3997 // Enums: A list of all enum types included in this API service. Enums 3998 // referenced directly or indirectly by the `apis` are automatically 3999 // included. Enums which are not referenced but shall be included should 4000 // be listed here by name. Example: enums: - name: 4001 // google.someapi.v1.SomeEnum 4002 Enums []*Enum `json:"enums,omitempty"` 4003 4004 // Http: HTTP configuration. 4005 Http *Http `json:"http,omitempty"` 4006 4007 // Id: A unique ID for a specific instance of this message, typically 4008 // assigned by the client for tracking purpose. Must be no longer than 4009 // 63 characters and only lower case letters, digits, '.', '_' and '-' 4010 // are allowed. If empty, the server may choose to generate one instead. 4011 Id string `json:"id,omitempty"` 4012 4013 // Logging: Logging configuration. 4014 Logging *Logging `json:"logging,omitempty"` 4015 4016 // Logs: Defines the logs used by this service. 4017 Logs []*LogDescriptor `json:"logs,omitempty"` 4018 4019 // Metrics: Defines the metrics used by this service. 4020 Metrics []*MetricDescriptor `json:"metrics,omitempty"` 4021 4022 // MonitoredResources: Defines the monitored resources used by this 4023 // service. This is required by the Service.monitoring and 4024 // Service.logging configurations. 4025 MonitoredResources []*MonitoredResourceDescriptor `json:"monitoredResources,omitempty"` 4026 4027 // Monitoring: Monitoring configuration. 4028 Monitoring *Monitoring `json:"monitoring,omitempty"` 4029 4030 // Name: The service name, which is a DNS-like logical identifier for 4031 // the service, such as `calendar.googleapis.com`. The service name 4032 // typically goes through DNS verification to make sure the owner of the 4033 // service also owns the DNS name. 4034 Name string `json:"name,omitempty"` 4035 4036 // ProducerProjectId: The Google project that owns this service. 4037 ProducerProjectId string `json:"producerProjectId,omitempty"` 4038 4039 // Quota: Quota configuration. 4040 Quota *Quota `json:"quota,omitempty"` 4041 4042 // SourceInfo: Output only. The source information for this 4043 // configuration if available. 4044 SourceInfo *SourceInfo `json:"sourceInfo,omitempty"` 4045 4046 // SystemParameters: System parameter configuration. 4047 SystemParameters *SystemParameters `json:"systemParameters,omitempty"` 4048 4049 // SystemTypes: A list of all proto message types included in this API 4050 // service. It serves similar purpose as [google.api.Service.types], 4051 // except that these types are not needed by user-defined APIs. 4052 // Therefore, they will not show up in the generated discovery doc. This 4053 // field should only be used to define system APIs in ESF. 4054 SystemTypes []*Type `json:"systemTypes,omitempty"` 4055 4056 // Title: The product title for this service. 4057 Title string `json:"title,omitempty"` 4058 4059 // Types: A list of all proto message types included in this API 4060 // service. Types referenced directly or indirectly by the `apis` are 4061 // automatically included. Messages which are not referenced but shall 4062 // be included, such as types used by the `google.protobuf.Any` type, 4063 // should be listed here by name. Example: types: - name: 4064 // google.protobuf.Int32 4065 Types []*Type `json:"types,omitempty"` 4066 4067 // Usage: Configuration controlling usage of this service. 4068 Usage *Usage `json:"usage,omitempty"` 4069 4070 // ServerResponse contains the HTTP response code and headers from the 4071 // server. 4072 googleapi.ServerResponse `json:"-"` 4073 4074 // ForceSendFields is a list of field names (e.g. "Apis") to 4075 // unconditionally include in API requests. By default, fields with 4076 // empty values are omitted from API requests. However, any non-pointer, 4077 // non-interface field appearing in ForceSendFields will be sent to the 4078 // server regardless of whether the field is empty or not. This may be 4079 // used to include empty fields in Patch requests. 4080 ForceSendFields []string `json:"-"` 4081 4082 // NullFields is a list of field names (e.g. "Apis") to include in API 4083 // requests with the JSON null value. By default, fields with empty 4084 // values are omitted from API requests. However, any field with an 4085 // empty value appearing in NullFields will be sent to the server as 4086 // null. It is an error if a field in this list has a non-empty value. 4087 // This may be used to include null fields in Patch requests. 4088 NullFields []string `json:"-"` 4089} 4090 4091func (s *Service) MarshalJSON() ([]byte, error) { 4092 type NoMethod Service 4093 raw := NoMethod(*s) 4094 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4095} 4096 4097// SetIamPolicyRequest: Request message for `SetIamPolicy` method. 4098type SetIamPolicyRequest struct { 4099 // Policy: REQUIRED: The complete policy to be applied to the 4100 // `resource`. The size of the policy is limited to a few 10s of KB. An 4101 // empty policy is a valid policy but certain Cloud Platform services 4102 // (such as Projects) might reject them. 4103 Policy *Policy `json:"policy,omitempty"` 4104 4105 // UpdateMask: OPTIONAL: A FieldMask specifying which fields of the 4106 // policy to modify. Only the fields in the mask will be modified. If no 4107 // mask is provided, the following default mask is used: `paths: 4108 // "bindings, etag" 4109 UpdateMask string `json:"updateMask,omitempty"` 4110 4111 // ForceSendFields is a list of field names (e.g. "Policy") to 4112 // unconditionally include in API requests. By default, fields with 4113 // empty values are omitted from API requests. However, any non-pointer, 4114 // non-interface field appearing in ForceSendFields will be sent to the 4115 // server regardless of whether the field is empty or not. This may be 4116 // used to include empty fields in Patch requests. 4117 ForceSendFields []string `json:"-"` 4118 4119 // NullFields is a list of field names (e.g. "Policy") to include in API 4120 // requests with the JSON null value. By default, fields with empty 4121 // values are omitted from API requests. However, any field with an 4122 // empty value appearing in NullFields will be sent to the server as 4123 // null. It is an error if a field in this list has a non-empty value. 4124 // This may be used to include null fields in Patch requests. 4125 NullFields []string `json:"-"` 4126} 4127 4128func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) { 4129 type NoMethod SetIamPolicyRequest 4130 raw := NoMethod(*s) 4131 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4132} 4133 4134// SourceContext: `SourceContext` represents information about the 4135// source of a protobuf element, like the file in which it is defined. 4136type SourceContext struct { 4137 // FileName: The path-qualified name of the .proto file that contained 4138 // the associated protobuf element. For example: 4139 // "google/protobuf/source_context.proto". 4140 FileName string `json:"fileName,omitempty"` 4141 4142 // ForceSendFields is a list of field names (e.g. "FileName") to 4143 // unconditionally include in API requests. By default, fields with 4144 // empty values are omitted from API requests. However, any non-pointer, 4145 // non-interface field appearing in ForceSendFields will be sent to the 4146 // server regardless of whether the field is empty or not. This may be 4147 // used to include empty fields in Patch requests. 4148 ForceSendFields []string `json:"-"` 4149 4150 // NullFields is a list of field names (e.g. "FileName") to include in 4151 // API requests with the JSON null value. By default, fields with empty 4152 // values are omitted from API requests. However, any field with an 4153 // empty value appearing in NullFields will be sent to the server as 4154 // null. It is an error if a field in this list has a non-empty value. 4155 // This may be used to include null fields in Patch requests. 4156 NullFields []string `json:"-"` 4157} 4158 4159func (s *SourceContext) MarshalJSON() ([]byte, error) { 4160 type NoMethod SourceContext 4161 raw := NoMethod(*s) 4162 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4163} 4164 4165// SourceInfo: Source information used to create a Service Config 4166type SourceInfo struct { 4167 // SourceFiles: All files used during config generation. 4168 SourceFiles []googleapi.RawMessage `json:"sourceFiles,omitempty"` 4169 4170 // ForceSendFields is a list of field names (e.g. "SourceFiles") to 4171 // unconditionally include in API requests. By default, fields with 4172 // empty values are omitted from API requests. However, any non-pointer, 4173 // non-interface field appearing in ForceSendFields will be sent to the 4174 // server regardless of whether the field is empty or not. This may be 4175 // used to include empty fields in Patch requests. 4176 ForceSendFields []string `json:"-"` 4177 4178 // NullFields is a list of field names (e.g. "SourceFiles") to include 4179 // in API requests with the JSON null value. By default, fields with 4180 // empty values are omitted from API requests. However, any field with 4181 // an empty value appearing in NullFields will be sent to the server as 4182 // null. It is an error if a field in this list has a non-empty value. 4183 // This may be used to include null fields in Patch requests. 4184 NullFields []string `json:"-"` 4185} 4186 4187func (s *SourceInfo) MarshalJSON() ([]byte, error) { 4188 type NoMethod SourceInfo 4189 raw := NoMethod(*s) 4190 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4191} 4192 4193// Status: The `Status` type defines a logical error model that is 4194// suitable for different programming environments, including REST APIs 4195// and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each 4196// `Status` message contains three pieces of data: error code, error 4197// message, and error details. You can find out more about this error 4198// model and how to work with it in the [API Design 4199// Guide](https://cloud.google.com/apis/design/errors). 4200type Status struct { 4201 // Code: The status code, which should be an enum value of 4202 // google.rpc.Code. 4203 Code int64 `json:"code,omitempty"` 4204 4205 // Details: A list of messages that carry the error details. There is a 4206 // common set of message types for APIs to use. 4207 Details []googleapi.RawMessage `json:"details,omitempty"` 4208 4209 // Message: A developer-facing error message, which should be in 4210 // English. Any user-facing error message should be localized and sent 4211 // in the google.rpc.Status.details field, or localized by the client. 4212 Message string `json:"message,omitempty"` 4213 4214 // ForceSendFields is a list of field names (e.g. "Code") to 4215 // unconditionally include in API requests. By default, fields with 4216 // empty values are omitted from API requests. However, any non-pointer, 4217 // non-interface field appearing in ForceSendFields will be sent to the 4218 // server regardless of whether the field is empty or not. This may be 4219 // used to include empty fields in Patch requests. 4220 ForceSendFields []string `json:"-"` 4221 4222 // NullFields is a list of field names (e.g. "Code") to include in API 4223 // requests with the JSON null value. By default, fields with empty 4224 // values are omitted from API requests. However, any field with an 4225 // empty value appearing in NullFields will be sent to the server as 4226 // null. It is an error if a field in this list has a non-empty value. 4227 // This may be used to include null fields in Patch requests. 4228 NullFields []string `json:"-"` 4229} 4230 4231func (s *Status) MarshalJSON() ([]byte, error) { 4232 type NoMethod Status 4233 raw := NoMethod(*s) 4234 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4235} 4236 4237// Step: Represents the status of one operation step. 4238type Step struct { 4239 // Description: The short description of the step. 4240 Description string `json:"description,omitempty"` 4241 4242 // Status: The status code. 4243 // 4244 // Possible values: 4245 // "STATUS_UNSPECIFIED" - Unspecifed code. 4246 // "DONE" - The operation or step has completed without errors. 4247 // "NOT_STARTED" - The operation or step has not started yet. 4248 // "IN_PROGRESS" - The operation or step is in progress. 4249 // "FAILED" - The operation or step has completed with errors. If the 4250 // operation is rollbackable, the rollback completed with errors too. 4251 // "CANCELLED" - The operation or step has completed with 4252 // cancellation. 4253 Status string `json:"status,omitempty"` 4254 4255 // ForceSendFields is a list of field names (e.g. "Description") to 4256 // unconditionally include in API requests. By default, fields with 4257 // empty values are omitted from API requests. However, any non-pointer, 4258 // non-interface field appearing in ForceSendFields will be sent to the 4259 // server regardless of whether the field is empty or not. This may be 4260 // used to include empty fields in Patch requests. 4261 ForceSendFields []string `json:"-"` 4262 4263 // NullFields is a list of field names (e.g. "Description") to include 4264 // in API requests with the JSON null value. By default, fields with 4265 // empty values are omitted from API requests. However, any field with 4266 // an empty value appearing in NullFields will be sent to the server as 4267 // null. It is an error if a field in this list has a non-empty value. 4268 // This may be used to include null fields in Patch requests. 4269 NullFields []string `json:"-"` 4270} 4271 4272func (s *Step) MarshalJSON() ([]byte, error) { 4273 type NoMethod Step 4274 raw := NoMethod(*s) 4275 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4276} 4277 4278// SubmitConfigSourceRequest: Request message for SubmitConfigSource 4279// method. 4280type SubmitConfigSourceRequest struct { 4281 // ConfigSource: Required. The source configuration for the service. 4282 ConfigSource *ConfigSource `json:"configSource,omitempty"` 4283 4284 // ValidateOnly: Optional. If set, this will result in the generation of 4285 // a `google.api.Service` configuration based on the `ConfigSource` 4286 // provided, but the generated config and the sources will NOT be 4287 // persisted. 4288 ValidateOnly bool `json:"validateOnly,omitempty"` 4289 4290 // ForceSendFields is a list of field names (e.g. "ConfigSource") to 4291 // unconditionally include in API requests. By default, fields with 4292 // empty values are omitted from API requests. However, any non-pointer, 4293 // non-interface field appearing in ForceSendFields will be sent to the 4294 // server regardless of whether the field is empty or not. This may be 4295 // used to include empty fields in Patch requests. 4296 ForceSendFields []string `json:"-"` 4297 4298 // NullFields is a list of field names (e.g. "ConfigSource") to include 4299 // in API requests with the JSON null value. By default, fields with 4300 // empty values are omitted from API requests. However, any field with 4301 // an empty value appearing in NullFields will be sent to the server as 4302 // null. It is an error if a field in this list has a non-empty value. 4303 // This may be used to include null fields in Patch requests. 4304 NullFields []string `json:"-"` 4305} 4306 4307func (s *SubmitConfigSourceRequest) MarshalJSON() ([]byte, error) { 4308 type NoMethod SubmitConfigSourceRequest 4309 raw := NoMethod(*s) 4310 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4311} 4312 4313// SubmitConfigSourceResponse: Response message for SubmitConfigSource 4314// method. 4315type SubmitConfigSourceResponse struct { 4316 // ServiceConfig: The generated service configuration. 4317 ServiceConfig *Service `json:"serviceConfig,omitempty"` 4318 4319 // ForceSendFields is a list of field names (e.g. "ServiceConfig") to 4320 // unconditionally include in API requests. By default, fields with 4321 // empty values are omitted from API requests. However, any non-pointer, 4322 // non-interface field appearing in ForceSendFields will be sent to the 4323 // server regardless of whether the field is empty or not. This may be 4324 // used to include empty fields in Patch requests. 4325 ForceSendFields []string `json:"-"` 4326 4327 // NullFields is a list of field names (e.g. "ServiceConfig") to include 4328 // in API requests with the JSON null value. By default, fields with 4329 // empty values are omitted from API requests. However, any field with 4330 // an empty value appearing in NullFields will be sent to the server as 4331 // null. It is an error if a field in this list has a non-empty value. 4332 // This may be used to include null fields in Patch requests. 4333 NullFields []string `json:"-"` 4334} 4335 4336func (s *SubmitConfigSourceResponse) MarshalJSON() ([]byte, error) { 4337 type NoMethod SubmitConfigSourceResponse 4338 raw := NoMethod(*s) 4339 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4340} 4341 4342// SystemParameter: Define a parameter's name and location. The 4343// parameter may be passed as either an HTTP header or a URL query 4344// parameter, and if both are passed the behavior is 4345// implementation-dependent. 4346type SystemParameter struct { 4347 // HttpHeader: Define the HTTP header name to use for the parameter. It 4348 // is case insensitive. 4349 HttpHeader string `json:"httpHeader,omitempty"` 4350 4351 // Name: Define the name of the parameter, such as "api_key" . It is 4352 // case sensitive. 4353 Name string `json:"name,omitempty"` 4354 4355 // UrlQueryParameter: Define the URL query parameter name to use for the 4356 // parameter. It is case sensitive. 4357 UrlQueryParameter string `json:"urlQueryParameter,omitempty"` 4358 4359 // ForceSendFields is a list of field names (e.g. "HttpHeader") to 4360 // unconditionally include in API requests. By default, fields with 4361 // empty values are omitted from API requests. However, any non-pointer, 4362 // non-interface field appearing in ForceSendFields will be sent to the 4363 // server regardless of whether the field is empty or not. This may be 4364 // used to include empty fields in Patch requests. 4365 ForceSendFields []string `json:"-"` 4366 4367 // NullFields is a list of field names (e.g. "HttpHeader") to include in 4368 // API requests with the JSON null value. By default, fields with empty 4369 // values are omitted from API requests. However, any field with an 4370 // empty value appearing in NullFields will be sent to the server as 4371 // null. It is an error if a field in this list has a non-empty value. 4372 // This may be used to include null fields in Patch requests. 4373 NullFields []string `json:"-"` 4374} 4375 4376func (s *SystemParameter) MarshalJSON() ([]byte, error) { 4377 type NoMethod SystemParameter 4378 raw := NoMethod(*s) 4379 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4380} 4381 4382// SystemParameterRule: Define a system parameter rule mapping system 4383// parameter definitions to methods. 4384type SystemParameterRule struct { 4385 // Parameters: Define parameters. Multiple names may be defined for a 4386 // parameter. For a given method call, only one of them should be used. 4387 // If multiple names are used the behavior is implementation-dependent. 4388 // If none of the specified names are present the behavior is 4389 // parameter-dependent. 4390 Parameters []*SystemParameter `json:"parameters,omitempty"` 4391 4392 // Selector: Selects the methods to which this rule applies. Use '*' to 4393 // indicate all methods in all APIs. Refer to selector for syntax 4394 // details. 4395 Selector string `json:"selector,omitempty"` 4396 4397 // ForceSendFields is a list of field names (e.g. "Parameters") to 4398 // unconditionally include in API requests. By default, fields with 4399 // empty values are omitted from API requests. However, any non-pointer, 4400 // non-interface field appearing in ForceSendFields will be sent to the 4401 // server regardless of whether the field is empty or not. This may be 4402 // used to include empty fields in Patch requests. 4403 ForceSendFields []string `json:"-"` 4404 4405 // NullFields is a list of field names (e.g. "Parameters") to include in 4406 // API requests with the JSON null value. By default, fields with empty 4407 // values are omitted from API requests. However, any field with an 4408 // empty value appearing in NullFields will be sent to the server as 4409 // null. It is an error if a field in this list has a non-empty value. 4410 // This may be used to include null fields in Patch requests. 4411 NullFields []string `json:"-"` 4412} 4413 4414func (s *SystemParameterRule) MarshalJSON() ([]byte, error) { 4415 type NoMethod SystemParameterRule 4416 raw := NoMethod(*s) 4417 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4418} 4419 4420// SystemParameters: ### System parameter configuration A system 4421// parameter is a special kind of parameter defined by the API system, 4422// not by an individual API. It is typically mapped to an HTTP header 4423// and/or a URL query parameter. This configuration specifies which 4424// methods change the names of the system parameters. 4425type SystemParameters struct { 4426 // Rules: Define system parameters. The parameters defined here will 4427 // override the default parameters implemented by the system. If this 4428 // field is missing from the service config, default system parameters 4429 // will be used. Default system parameters and names is 4430 // implementation-dependent. Example: define api key for all methods 4431 // system_parameters rules: - selector: "*" parameters: - name: api_key 4432 // url_query_parameter: api_key Example: define 2 api key names for a 4433 // specific method. system_parameters rules: - selector: "/ListShelves" 4434 // parameters: - name: api_key http_header: Api-Key1 - name: api_key 4435 // http_header: Api-Key2 **NOTE:** All service configuration rules 4436 // follow "last one wins" order. 4437 Rules []*SystemParameterRule `json:"rules,omitempty"` 4438 4439 // ForceSendFields is a list of field names (e.g. "Rules") to 4440 // unconditionally include in API requests. By default, fields with 4441 // empty values are omitted from API requests. However, any non-pointer, 4442 // non-interface field appearing in ForceSendFields will be sent to the 4443 // server regardless of whether the field is empty or not. This may be 4444 // used to include empty fields in Patch requests. 4445 ForceSendFields []string `json:"-"` 4446 4447 // NullFields is a list of field names (e.g. "Rules") to include in API 4448 // requests with the JSON null value. By default, fields with empty 4449 // values are omitted from API requests. However, any field with an 4450 // empty value appearing in NullFields will be sent to the server as 4451 // null. It is an error if a field in this list has a non-empty value. 4452 // This may be used to include null fields in Patch requests. 4453 NullFields []string `json:"-"` 4454} 4455 4456func (s *SystemParameters) MarshalJSON() ([]byte, error) { 4457 type NoMethod SystemParameters 4458 raw := NoMethod(*s) 4459 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4460} 4461 4462// TestIamPermissionsRequest: Request message for `TestIamPermissions` 4463// method. 4464type TestIamPermissionsRequest struct { 4465 // Permissions: The set of permissions to check for the `resource`. 4466 // Permissions with wildcards (such as '*' or 'storage.*') are not 4467 // allowed. For more information see [IAM 4468 // Overview](https://cloud.google.com/iam/docs/overview#permissions). 4469 Permissions []string `json:"permissions,omitempty"` 4470 4471 // ForceSendFields is a list of field names (e.g. "Permissions") to 4472 // unconditionally include in API requests. By default, fields with 4473 // empty values are omitted from API requests. However, any non-pointer, 4474 // non-interface field appearing in ForceSendFields will be sent to the 4475 // server regardless of whether the field is empty or not. This may be 4476 // used to include empty fields in Patch requests. 4477 ForceSendFields []string `json:"-"` 4478 4479 // NullFields is a list of field names (e.g. "Permissions") to include 4480 // in API requests with the JSON null value. By default, fields with 4481 // empty values are omitted from API requests. However, any field with 4482 // an empty value appearing in NullFields will be sent to the server as 4483 // null. It is an error if a field in this list has a non-empty value. 4484 // This may be used to include null fields in Patch requests. 4485 NullFields []string `json:"-"` 4486} 4487 4488func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) { 4489 type NoMethod TestIamPermissionsRequest 4490 raw := NoMethod(*s) 4491 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4492} 4493 4494// TestIamPermissionsResponse: Response message for `TestIamPermissions` 4495// method. 4496type TestIamPermissionsResponse struct { 4497 // Permissions: A subset of `TestPermissionsRequest.permissions` that 4498 // the caller is allowed. 4499 Permissions []string `json:"permissions,omitempty"` 4500 4501 // ServerResponse contains the HTTP response code and headers from the 4502 // server. 4503 googleapi.ServerResponse `json:"-"` 4504 4505 // ForceSendFields is a list of field names (e.g. "Permissions") to 4506 // unconditionally include in API requests. By default, fields with 4507 // empty values are omitted from API requests. However, any non-pointer, 4508 // non-interface field appearing in ForceSendFields will be sent to the 4509 // server regardless of whether the field is empty or not. This may be 4510 // used to include empty fields in Patch requests. 4511 ForceSendFields []string `json:"-"` 4512 4513 // NullFields is a list of field names (e.g. "Permissions") to include 4514 // in API requests with the JSON null value. By default, fields with 4515 // empty values are omitted from API requests. However, any field with 4516 // an empty value appearing in NullFields will be sent to the server as 4517 // null. It is an error if a field in this list has a non-empty value. 4518 // This may be used to include null fields in Patch requests. 4519 NullFields []string `json:"-"` 4520} 4521 4522func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) { 4523 type NoMethod TestIamPermissionsResponse 4524 raw := NoMethod(*s) 4525 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4526} 4527 4528// TrafficPercentStrategy: Strategy that specifies how clients of Google 4529// Service Controller want to send traffic to use different config 4530// versions. This is generally used by API proxy to split traffic based 4531// on your configured percentage for each config version. One example of 4532// how to gradually rollout a new service configuration using this 4533// strategy: Day 1 Rollout { id: 4534// "example.googleapis.com/rollout_20160206" traffic_percent_strategy { 4535// percentages: { "example.googleapis.com/20160201": 70.00 4536// "example.googleapis.com/20160206": 30.00 } } } Day 2 Rollout { id: 4537// "example.googleapis.com/rollout_20160207" traffic_percent_strategy: { 4538// percentages: { "example.googleapis.com/20160206": 100.00 } } } 4539type TrafficPercentStrategy struct { 4540 // Percentages: Maps service configuration IDs to their corresponding 4541 // traffic percentage. Key is the service configuration ID, Value is the 4542 // traffic percentage which must be greater than 0.0 and the sum must 4543 // equal to 100.0. 4544 Percentages map[string]float64 `json:"percentages,omitempty"` 4545 4546 // ForceSendFields is a list of field names (e.g. "Percentages") to 4547 // unconditionally include in API requests. By default, fields with 4548 // empty values are omitted from API requests. However, any non-pointer, 4549 // non-interface field appearing in ForceSendFields will be sent to the 4550 // server regardless of whether the field is empty or not. This may be 4551 // used to include empty fields in Patch requests. 4552 ForceSendFields []string `json:"-"` 4553 4554 // NullFields is a list of field names (e.g. "Percentages") to include 4555 // in API requests with the JSON null value. By default, fields with 4556 // empty values are omitted from API requests. However, any field with 4557 // an empty value appearing in NullFields will be sent to the server as 4558 // null. It is an error if a field in this list has a non-empty value. 4559 // This may be used to include null fields in Patch requests. 4560 NullFields []string `json:"-"` 4561} 4562 4563func (s *TrafficPercentStrategy) MarshalJSON() ([]byte, error) { 4564 type NoMethod TrafficPercentStrategy 4565 raw := NoMethod(*s) 4566 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4567} 4568 4569// Type: A protocol buffer message type. 4570type Type struct { 4571 // Fields: The list of fields. 4572 Fields []*Field `json:"fields,omitempty"` 4573 4574 // Name: The fully qualified message name. 4575 Name string `json:"name,omitempty"` 4576 4577 // Oneofs: The list of types appearing in `oneof` definitions in this 4578 // type. 4579 Oneofs []string `json:"oneofs,omitempty"` 4580 4581 // Options: The protocol buffer options. 4582 Options []*Option `json:"options,omitempty"` 4583 4584 // SourceContext: The source context. 4585 SourceContext *SourceContext `json:"sourceContext,omitempty"` 4586 4587 // Syntax: The source syntax. 4588 // 4589 // Possible values: 4590 // "SYNTAX_PROTO2" - Syntax `proto2`. 4591 // "SYNTAX_PROTO3" - Syntax `proto3`. 4592 Syntax string `json:"syntax,omitempty"` 4593 4594 // ForceSendFields is a list of field names (e.g. "Fields") to 4595 // unconditionally include in API requests. By default, fields with 4596 // empty values are omitted from API requests. However, any non-pointer, 4597 // non-interface field appearing in ForceSendFields will be sent to the 4598 // server regardless of whether the field is empty or not. This may be 4599 // used to include empty fields in Patch requests. 4600 ForceSendFields []string `json:"-"` 4601 4602 // NullFields is a list of field names (e.g. "Fields") to include in API 4603 // requests with the JSON null value. By default, fields with empty 4604 // values are omitted from API requests. However, any field with an 4605 // empty value appearing in NullFields will be sent to the server as 4606 // null. It is an error if a field in this list has a non-empty value. 4607 // This may be used to include null fields in Patch requests. 4608 NullFields []string `json:"-"` 4609} 4610 4611func (s *Type) MarshalJSON() ([]byte, error) { 4612 type NoMethod Type 4613 raw := NoMethod(*s) 4614 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4615} 4616 4617// UndeleteServiceResponse: Response message for UndeleteService method. 4618type UndeleteServiceResponse struct { 4619 // Service: Revived service resource. 4620 Service *ManagedService `json:"service,omitempty"` 4621 4622 // ForceSendFields is a list of field names (e.g. "Service") to 4623 // unconditionally include in API requests. By default, fields with 4624 // empty values are omitted from API requests. However, any non-pointer, 4625 // non-interface field appearing in ForceSendFields will be sent to the 4626 // server regardless of whether the field is empty or not. This may be 4627 // used to include empty fields in Patch requests. 4628 ForceSendFields []string `json:"-"` 4629 4630 // NullFields is a list of field names (e.g. "Service") to include in 4631 // API requests with the JSON null value. By default, fields with empty 4632 // values are omitted from API requests. However, any field with an 4633 // empty value appearing in NullFields will be sent to the server as 4634 // null. It is an error if a field in this list has a non-empty value. 4635 // This may be used to include null fields in Patch requests. 4636 NullFields []string `json:"-"` 4637} 4638 4639func (s *UndeleteServiceResponse) MarshalJSON() ([]byte, error) { 4640 type NoMethod UndeleteServiceResponse 4641 raw := NoMethod(*s) 4642 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4643} 4644 4645// Usage: Configuration controlling usage of a service. 4646type Usage struct { 4647 // ProducerNotificationChannel: The full resource name of a channel used 4648 // for sending notifications to the service producer. Google Service 4649 // Management currently only supports [Google Cloud 4650 // Pub/Sub](https://cloud.google.com/pubsub) as a notification channel. 4651 // To use Google Cloud Pub/Sub as the channel, this must be the name of 4652 // a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name format 4653 // documented in https://cloud.google.com/pubsub/docs/overview. 4654 ProducerNotificationChannel string `json:"producerNotificationChannel,omitempty"` 4655 4656 // Requirements: Requirements that must be satisfied before a consumer 4657 // project can use the service. Each requirement is of the form /; for 4658 // example 'serviceusage.googleapis.com/billing-enabled'. 4659 Requirements []string `json:"requirements,omitempty"` 4660 4661 // Rules: A list of usage rules that apply to individual API methods. 4662 // **NOTE:** All service configuration rules follow "last one wins" 4663 // order. 4664 Rules []*UsageRule `json:"rules,omitempty"` 4665 4666 // ForceSendFields is a list of field names (e.g. 4667 // "ProducerNotificationChannel") to unconditionally include in API 4668 // requests. By default, fields with empty values are omitted from API 4669 // requests. However, any non-pointer, non-interface field appearing in 4670 // ForceSendFields will be sent to the server regardless of whether the 4671 // field is empty or not. This may be used to include empty fields in 4672 // Patch requests. 4673 ForceSendFields []string `json:"-"` 4674 4675 // NullFields is a list of field names (e.g. 4676 // "ProducerNotificationChannel") to include in API requests with the 4677 // JSON null value. By default, fields with empty values are omitted 4678 // from API requests. However, any field with an empty value appearing 4679 // in NullFields will be sent to the server as null. It is an error if a 4680 // field in this list has a non-empty value. This may be used to include 4681 // null fields in Patch requests. 4682 NullFields []string `json:"-"` 4683} 4684 4685func (s *Usage) MarshalJSON() ([]byte, error) { 4686 type NoMethod Usage 4687 raw := NoMethod(*s) 4688 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4689} 4690 4691// UsageRule: Usage configuration rules for the service. NOTE: Under 4692// development. Use this rule to configure unregistered calls for the 4693// service. Unregistered calls are calls that do not contain consumer 4694// project identity. (Example: calls that do not contain an API key). By 4695// default, API methods do not allow unregistered calls, and each method 4696// call must be identified by a consumer project identity. Use this rule 4697// to allow/disallow unregistered calls. Example of an API that wants to 4698// allow unregistered calls for entire service. usage: rules: - 4699// selector: "*" allow_unregistered_calls: true Example of a method that 4700// wants to allow unregistered calls. usage: rules: - selector: 4701// "google.example.library.v1.LibraryService.CreateBook" 4702// allow_unregistered_calls: true 4703type UsageRule struct { 4704 // AllowUnregisteredCalls: If true, the selected method allows 4705 // unregistered calls, e.g. calls that don't identify any user or 4706 // application. 4707 AllowUnregisteredCalls bool `json:"allowUnregisteredCalls,omitempty"` 4708 4709 // Selector: Selects the methods to which this rule applies. Use '*' to 4710 // indicate all methods in all APIs. Refer to selector for syntax 4711 // details. 4712 Selector string `json:"selector,omitempty"` 4713 4714 // SkipServiceControl: If true, the selected method should skip service 4715 // control and the control plane features, such as quota and billing, 4716 // will not be available. This flag is used by Google Cloud Endpoints to 4717 // bypass checks for internal methods, such as service health check 4718 // methods. 4719 SkipServiceControl bool `json:"skipServiceControl,omitempty"` 4720 4721 // ForceSendFields is a list of field names (e.g. 4722 // "AllowUnregisteredCalls") to unconditionally include in API requests. 4723 // By default, fields with empty values are omitted from API requests. 4724 // However, any non-pointer, non-interface field appearing in 4725 // ForceSendFields will be sent to the server regardless of whether the 4726 // field is empty or not. This may be used to include empty fields in 4727 // Patch requests. 4728 ForceSendFields []string `json:"-"` 4729 4730 // NullFields is a list of field names (e.g. "AllowUnregisteredCalls") 4731 // to include in API requests with the JSON null value. By default, 4732 // fields with empty values are omitted from API requests. However, any 4733 // field with an empty value appearing in NullFields will be sent to the 4734 // server as null. It is an error if a field in this list has a 4735 // non-empty value. This may be used to include null fields in Patch 4736 // requests. 4737 NullFields []string `json:"-"` 4738} 4739 4740func (s *UsageRule) MarshalJSON() ([]byte, error) { 4741 type NoMethod UsageRule 4742 raw := NoMethod(*s) 4743 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4744} 4745 4746// method id "servicemanagement.operations.get": 4747 4748type OperationsGetCall struct { 4749 s *APIService 4750 name string 4751 urlParams_ gensupport.URLParams 4752 ifNoneMatch_ string 4753 ctx_ context.Context 4754 header_ http.Header 4755} 4756 4757// Get: Gets the latest state of a long-running operation. Clients can 4758// use this method to poll the operation result at intervals as 4759// recommended by the API service. 4760func (r *OperationsService) Get(name string) *OperationsGetCall { 4761 c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4762 c.name = name 4763 return c 4764} 4765 4766// Fields allows partial responses to be retrieved. See 4767// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4768// for more information. 4769func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall { 4770 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4771 return c 4772} 4773 4774// IfNoneMatch sets the optional parameter which makes the operation 4775// fail if the object's ETag matches the given value. This is useful for 4776// getting updates only after the object has changed since the last 4777// request. Use googleapi.IsNotModified to check whether the response 4778// error from Do is the result of In-None-Match. 4779func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall { 4780 c.ifNoneMatch_ = entityTag 4781 return c 4782} 4783 4784// Context sets the context to be used in this call's Do method. Any 4785// pending HTTP request will be aborted if the provided context is 4786// canceled. 4787func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall { 4788 c.ctx_ = ctx 4789 return c 4790} 4791 4792// Header returns an http.Header that can be modified by the caller to 4793// add HTTP headers to the request. 4794func (c *OperationsGetCall) Header() http.Header { 4795 if c.header_ == nil { 4796 c.header_ = make(http.Header) 4797 } 4798 return c.header_ 4799} 4800 4801func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { 4802 reqHeaders := make(http.Header) 4803 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 4804 for k, v := range c.header_ { 4805 reqHeaders[k] = v 4806 } 4807 reqHeaders.Set("User-Agent", c.s.userAgent()) 4808 if c.ifNoneMatch_ != "" { 4809 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4810 } 4811 var body io.Reader = nil 4812 c.urlParams_.Set("alt", alt) 4813 c.urlParams_.Set("prettyPrint", "false") 4814 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 4815 urls += "?" + c.urlParams_.Encode() 4816 req, err := http.NewRequest("GET", urls, body) 4817 if err != nil { 4818 return nil, err 4819 } 4820 req.Header = reqHeaders 4821 googleapi.Expand(req.URL, map[string]string{ 4822 "name": c.name, 4823 }) 4824 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4825} 4826 4827// Do executes the "servicemanagement.operations.get" call. 4828// Exactly one of *Operation or error will be non-nil. Any non-2xx 4829// status code is an error. Response headers are in either 4830// *Operation.ServerResponse.Header or (if a response was returned at 4831// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4832// to check whether the returned error was because 4833// http.StatusNotModified was returned. 4834func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4835 gensupport.SetOptions(c.urlParams_, opts...) 4836 res, err := c.doRequest("json") 4837 if res != nil && res.StatusCode == http.StatusNotModified { 4838 if res.Body != nil { 4839 res.Body.Close() 4840 } 4841 return nil, &googleapi.Error{ 4842 Code: res.StatusCode, 4843 Header: res.Header, 4844 } 4845 } 4846 if err != nil { 4847 return nil, err 4848 } 4849 defer googleapi.CloseBody(res) 4850 if err := googleapi.CheckResponse(res); err != nil { 4851 return nil, err 4852 } 4853 ret := &Operation{ 4854 ServerResponse: googleapi.ServerResponse{ 4855 Header: res.Header, 4856 HTTPStatusCode: res.StatusCode, 4857 }, 4858 } 4859 target := &ret 4860 if err := gensupport.DecodeResponse(target, res); err != nil { 4861 return nil, err 4862 } 4863 return ret, nil 4864 // { 4865 // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", 4866 // "flatPath": "v1/operations/{operationsId}", 4867 // "httpMethod": "GET", 4868 // "id": "servicemanagement.operations.get", 4869 // "parameterOrder": [ 4870 // "name" 4871 // ], 4872 // "parameters": { 4873 // "name": { 4874 // "description": "The name of the operation resource.", 4875 // "location": "path", 4876 // "pattern": "^operations/.*$", 4877 // "required": true, 4878 // "type": "string" 4879 // } 4880 // }, 4881 // "path": "v1/{+name}", 4882 // "response": { 4883 // "$ref": "Operation" 4884 // }, 4885 // "scopes": [ 4886 // "https://www.googleapis.com/auth/cloud-platform", 4887 // "https://www.googleapis.com/auth/service.management" 4888 // ] 4889 // } 4890 4891} 4892 4893// method id "servicemanagement.operations.list": 4894 4895type OperationsListCall struct { 4896 s *APIService 4897 urlParams_ gensupport.URLParams 4898 ifNoneMatch_ string 4899 ctx_ context.Context 4900 header_ http.Header 4901} 4902 4903// List: Lists service operations that match the specified filter in the 4904// request. 4905func (r *OperationsService) List() *OperationsListCall { 4906 c := &OperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4907 return c 4908} 4909 4910// Filter sets the optional parameter "filter": A string for filtering 4911// Operations. The following filter fields are supported: * serviceName: 4912// Required. Only `=` operator is allowed. * startTime: The time this 4913// job was started, in ISO 8601 format. Allowed operators are `>=`, `>`, 4914// `<=`, and `<`. * status: Can be `done`, `in_progress`, or `failed`. 4915// Allowed operators are `=`, and `!=`. Filter expression supports 4916// conjunction (AND) and disjunction (OR) logical operators. However, 4917// the serviceName restriction must be at the top-level and can only be 4918// combined with other restrictions via the AND logical operator. 4919// Examples: * `serviceName={some-service}.googleapis.com` * 4920// `serviceName={some-service}.googleapis.com AND 4921// startTime>="2017-02-01" * `serviceName={some-service}.googleapis.com 4922// AND status=done` * `serviceName={some-service}.googleapis.com AND 4923// (status=done OR startTime>="2017-02-01")` 4924func (c *OperationsListCall) Filter(filter string) *OperationsListCall { 4925 c.urlParams_.Set("filter", filter) 4926 return c 4927} 4928 4929// Name sets the optional parameter "name": Not used. 4930func (c *OperationsListCall) Name(name string) *OperationsListCall { 4931 c.urlParams_.Set("name", name) 4932 return c 4933} 4934 4935// PageSize sets the optional parameter "pageSize": The maximum number 4936// of operations to return. If unspecified, defaults to 50. The maximum 4937// value is 100. 4938func (c *OperationsListCall) PageSize(pageSize int64) *OperationsListCall { 4939 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 4940 return c 4941} 4942 4943// PageToken sets the optional parameter "pageToken": The standard list 4944// page token. 4945func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall { 4946 c.urlParams_.Set("pageToken", pageToken) 4947 return c 4948} 4949 4950// Fields allows partial responses to be retrieved. See 4951// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4952// for more information. 4953func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall { 4954 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4955 return c 4956} 4957 4958// IfNoneMatch sets the optional parameter which makes the operation 4959// fail if the object's ETag matches the given value. This is useful for 4960// getting updates only after the object has changed since the last 4961// request. Use googleapi.IsNotModified to check whether the response 4962// error from Do is the result of In-None-Match. 4963func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall { 4964 c.ifNoneMatch_ = entityTag 4965 return c 4966} 4967 4968// Context sets the context to be used in this call's Do method. Any 4969// pending HTTP request will be aborted if the provided context is 4970// canceled. 4971func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall { 4972 c.ctx_ = ctx 4973 return c 4974} 4975 4976// Header returns an http.Header that can be modified by the caller to 4977// add HTTP headers to the request. 4978func (c *OperationsListCall) Header() http.Header { 4979 if c.header_ == nil { 4980 c.header_ = make(http.Header) 4981 } 4982 return c.header_ 4983} 4984 4985func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { 4986 reqHeaders := make(http.Header) 4987 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 4988 for k, v := range c.header_ { 4989 reqHeaders[k] = v 4990 } 4991 reqHeaders.Set("User-Agent", c.s.userAgent()) 4992 if c.ifNoneMatch_ != "" { 4993 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4994 } 4995 var body io.Reader = nil 4996 c.urlParams_.Set("alt", alt) 4997 c.urlParams_.Set("prettyPrint", "false") 4998 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/operations") 4999 urls += "?" + c.urlParams_.Encode() 5000 req, err := http.NewRequest("GET", urls, body) 5001 if err != nil { 5002 return nil, err 5003 } 5004 req.Header = reqHeaders 5005 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5006} 5007 5008// Do executes the "servicemanagement.operations.list" call. 5009// Exactly one of *ListOperationsResponse or error will be non-nil. Any 5010// non-2xx status code is an error. Response headers are in either 5011// *ListOperationsResponse.ServerResponse.Header or (if a response was 5012// returned at all) in error.(*googleapi.Error).Header. Use 5013// googleapi.IsNotModified to check whether the returned error was 5014// because http.StatusNotModified was returned. 5015func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { 5016 gensupport.SetOptions(c.urlParams_, opts...) 5017 res, err := c.doRequest("json") 5018 if res != nil && res.StatusCode == http.StatusNotModified { 5019 if res.Body != nil { 5020 res.Body.Close() 5021 } 5022 return nil, &googleapi.Error{ 5023 Code: res.StatusCode, 5024 Header: res.Header, 5025 } 5026 } 5027 if err != nil { 5028 return nil, err 5029 } 5030 defer googleapi.CloseBody(res) 5031 if err := googleapi.CheckResponse(res); err != nil { 5032 return nil, err 5033 } 5034 ret := &ListOperationsResponse{ 5035 ServerResponse: googleapi.ServerResponse{ 5036 Header: res.Header, 5037 HTTPStatusCode: res.StatusCode, 5038 }, 5039 } 5040 target := &ret 5041 if err := gensupport.DecodeResponse(target, res); err != nil { 5042 return nil, err 5043 } 5044 return ret, nil 5045 // { 5046 // "description": "Lists service operations that match the specified filter in the request.", 5047 // "flatPath": "v1/operations", 5048 // "httpMethod": "GET", 5049 // "id": "servicemanagement.operations.list", 5050 // "parameterOrder": [], 5051 // "parameters": { 5052 // "filter": { 5053 // "description": "A string for filtering Operations. The following filter fields are supported: * serviceName: Required. Only `=` operator is allowed. * startTime: The time this job was started, in ISO 8601 format. Allowed operators are `\u003e=`, `\u003e`, `\u003c=`, and `\u003c`. * status: Can be `done`, `in_progress`, or `failed`. Allowed operators are `=`, and `!=`. Filter expression supports conjunction (AND) and disjunction (OR) logical operators. However, the serviceName restriction must be at the top-level and can only be combined with other restrictions via the AND logical operator. Examples: * `serviceName={some-service}.googleapis.com` * `serviceName={some-service}.googleapis.com AND startTime\u003e=\"2017-02-01\"` * `serviceName={some-service}.googleapis.com AND status=done` * `serviceName={some-service}.googleapis.com AND (status=done OR startTime\u003e=\"2017-02-01\")`", 5054 // "location": "query", 5055 // "type": "string" 5056 // }, 5057 // "name": { 5058 // "description": "Not used.", 5059 // "location": "query", 5060 // "type": "string" 5061 // }, 5062 // "pageSize": { 5063 // "description": "The maximum number of operations to return. If unspecified, defaults to 50. The maximum value is 100.", 5064 // "format": "int32", 5065 // "location": "query", 5066 // "type": "integer" 5067 // }, 5068 // "pageToken": { 5069 // "description": "The standard list page token.", 5070 // "location": "query", 5071 // "type": "string" 5072 // } 5073 // }, 5074 // "path": "v1/operations", 5075 // "response": { 5076 // "$ref": "ListOperationsResponse" 5077 // }, 5078 // "scopes": [ 5079 // "https://www.googleapis.com/auth/cloud-platform", 5080 // "https://www.googleapis.com/auth/service.management" 5081 // ] 5082 // } 5083 5084} 5085 5086// Pages invokes f for each page of results. 5087// A non-nil error returned from f will halt the iteration. 5088// The provided context supersedes any context provided to the Context method. 5089func (c *OperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { 5090 c.ctx_ = ctx 5091 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 5092 for { 5093 x, err := c.Do() 5094 if err != nil { 5095 return err 5096 } 5097 if err := f(x); err != nil { 5098 return err 5099 } 5100 if x.NextPageToken == "" { 5101 return nil 5102 } 5103 c.PageToken(x.NextPageToken) 5104 } 5105} 5106 5107// method id "servicemanagement.services.create": 5108 5109type ServicesCreateCall struct { 5110 s *APIService 5111 managedservice *ManagedService 5112 urlParams_ gensupport.URLParams 5113 ctx_ context.Context 5114 header_ http.Header 5115} 5116 5117// Create: Creates a new managed service. A managed service is 5118// immutable, and is subject to mandatory 30-day data retention. You 5119// cannot move a service or recreate it within 30 days after deletion. 5120// One producer project can own no more than 500 services. For security 5121// and reliability purposes, a production service should be hosted in a 5122// dedicated producer project. Operation 5123func (r *ServicesService) Create(managedservice *ManagedService) *ServicesCreateCall { 5124 c := &ServicesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5125 c.managedservice = managedservice 5126 return c 5127} 5128 5129// Fields allows partial responses to be retrieved. See 5130// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5131// for more information. 5132func (c *ServicesCreateCall) Fields(s ...googleapi.Field) *ServicesCreateCall { 5133 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5134 return c 5135} 5136 5137// Context sets the context to be used in this call's Do method. Any 5138// pending HTTP request will be aborted if the provided context is 5139// canceled. 5140func (c *ServicesCreateCall) Context(ctx context.Context) *ServicesCreateCall { 5141 c.ctx_ = ctx 5142 return c 5143} 5144 5145// Header returns an http.Header that can be modified by the caller to 5146// add HTTP headers to the request. 5147func (c *ServicesCreateCall) Header() http.Header { 5148 if c.header_ == nil { 5149 c.header_ = make(http.Header) 5150 } 5151 return c.header_ 5152} 5153 5154func (c *ServicesCreateCall) doRequest(alt string) (*http.Response, error) { 5155 reqHeaders := make(http.Header) 5156 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 5157 for k, v := range c.header_ { 5158 reqHeaders[k] = v 5159 } 5160 reqHeaders.Set("User-Agent", c.s.userAgent()) 5161 var body io.Reader = nil 5162 body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedservice) 5163 if err != nil { 5164 return nil, err 5165 } 5166 reqHeaders.Set("Content-Type", "application/json") 5167 c.urlParams_.Set("alt", alt) 5168 c.urlParams_.Set("prettyPrint", "false") 5169 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services") 5170 urls += "?" + c.urlParams_.Encode() 5171 req, err := http.NewRequest("POST", urls, body) 5172 if err != nil { 5173 return nil, err 5174 } 5175 req.Header = reqHeaders 5176 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5177} 5178 5179// Do executes the "servicemanagement.services.create" call. 5180// Exactly one of *Operation or error will be non-nil. Any non-2xx 5181// status code is an error. Response headers are in either 5182// *Operation.ServerResponse.Header or (if a response was returned at 5183// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5184// to check whether the returned error was because 5185// http.StatusNotModified was returned. 5186func (c *ServicesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5187 gensupport.SetOptions(c.urlParams_, opts...) 5188 res, err := c.doRequest("json") 5189 if res != nil && res.StatusCode == http.StatusNotModified { 5190 if res.Body != nil { 5191 res.Body.Close() 5192 } 5193 return nil, &googleapi.Error{ 5194 Code: res.StatusCode, 5195 Header: res.Header, 5196 } 5197 } 5198 if err != nil { 5199 return nil, err 5200 } 5201 defer googleapi.CloseBody(res) 5202 if err := googleapi.CheckResponse(res); err != nil { 5203 return nil, err 5204 } 5205 ret := &Operation{ 5206 ServerResponse: googleapi.ServerResponse{ 5207 Header: res.Header, 5208 HTTPStatusCode: res.StatusCode, 5209 }, 5210 } 5211 target := &ret 5212 if err := gensupport.DecodeResponse(target, res); err != nil { 5213 return nil, err 5214 } 5215 return ret, nil 5216 // { 5217 // "description": "Creates a new managed service. A managed service is immutable, and is subject to mandatory 30-day data retention. You cannot move a service or recreate it within 30 days after deletion. One producer project can own no more than 500 services. For security and reliability purposes, a production service should be hosted in a dedicated producer project. Operation", 5218 // "flatPath": "v1/services", 5219 // "httpMethod": "POST", 5220 // "id": "servicemanagement.services.create", 5221 // "parameterOrder": [], 5222 // "parameters": {}, 5223 // "path": "v1/services", 5224 // "request": { 5225 // "$ref": "ManagedService" 5226 // }, 5227 // "response": { 5228 // "$ref": "Operation" 5229 // }, 5230 // "scopes": [ 5231 // "https://www.googleapis.com/auth/cloud-platform", 5232 // "https://www.googleapis.com/auth/service.management" 5233 // ] 5234 // } 5235 5236} 5237 5238// method id "servicemanagement.services.delete": 5239 5240type ServicesDeleteCall struct { 5241 s *APIService 5242 serviceName string 5243 urlParams_ gensupport.URLParams 5244 ctx_ context.Context 5245 header_ http.Header 5246} 5247 5248// Delete: Deletes a managed service. This method will change the 5249// service to the `Soft-Delete` state for 30 days. Within this period, 5250// service producers may call UndeleteService to restore the service. 5251// After 30 days, the service will be permanently deleted. Operation 5252func (r *ServicesService) Delete(serviceName string) *ServicesDeleteCall { 5253 c := &ServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5254 c.serviceName = serviceName 5255 return c 5256} 5257 5258// Fields allows partial responses to be retrieved. See 5259// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5260// for more information. 5261func (c *ServicesDeleteCall) Fields(s ...googleapi.Field) *ServicesDeleteCall { 5262 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5263 return c 5264} 5265 5266// Context sets the context to be used in this call's Do method. Any 5267// pending HTTP request will be aborted if the provided context is 5268// canceled. 5269func (c *ServicesDeleteCall) Context(ctx context.Context) *ServicesDeleteCall { 5270 c.ctx_ = ctx 5271 return c 5272} 5273 5274// Header returns an http.Header that can be modified by the caller to 5275// add HTTP headers to the request. 5276func (c *ServicesDeleteCall) Header() http.Header { 5277 if c.header_ == nil { 5278 c.header_ = make(http.Header) 5279 } 5280 return c.header_ 5281} 5282 5283func (c *ServicesDeleteCall) doRequest(alt string) (*http.Response, error) { 5284 reqHeaders := make(http.Header) 5285 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 5286 for k, v := range c.header_ { 5287 reqHeaders[k] = v 5288 } 5289 reqHeaders.Set("User-Agent", c.s.userAgent()) 5290 var body io.Reader = nil 5291 c.urlParams_.Set("alt", alt) 5292 c.urlParams_.Set("prettyPrint", "false") 5293 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}") 5294 urls += "?" + c.urlParams_.Encode() 5295 req, err := http.NewRequest("DELETE", urls, body) 5296 if err != nil { 5297 return nil, err 5298 } 5299 req.Header = reqHeaders 5300 googleapi.Expand(req.URL, map[string]string{ 5301 "serviceName": c.serviceName, 5302 }) 5303 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5304} 5305 5306// Do executes the "servicemanagement.services.delete" call. 5307// Exactly one of *Operation or error will be non-nil. Any non-2xx 5308// status code is an error. Response headers are in either 5309// *Operation.ServerResponse.Header or (if a response was returned at 5310// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5311// to check whether the returned error was because 5312// http.StatusNotModified was returned. 5313func (c *ServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5314 gensupport.SetOptions(c.urlParams_, opts...) 5315 res, err := c.doRequest("json") 5316 if res != nil && res.StatusCode == http.StatusNotModified { 5317 if res.Body != nil { 5318 res.Body.Close() 5319 } 5320 return nil, &googleapi.Error{ 5321 Code: res.StatusCode, 5322 Header: res.Header, 5323 } 5324 } 5325 if err != nil { 5326 return nil, err 5327 } 5328 defer googleapi.CloseBody(res) 5329 if err := googleapi.CheckResponse(res); err != nil { 5330 return nil, err 5331 } 5332 ret := &Operation{ 5333 ServerResponse: googleapi.ServerResponse{ 5334 Header: res.Header, 5335 HTTPStatusCode: res.StatusCode, 5336 }, 5337 } 5338 target := &ret 5339 if err := gensupport.DecodeResponse(target, res); err != nil { 5340 return nil, err 5341 } 5342 return ret, nil 5343 // { 5344 // "description": "Deletes a managed service. This method will change the service to the `Soft-Delete` state for 30 days. Within this period, service producers may call UndeleteService to restore the service. After 30 days, the service will be permanently deleted. Operation", 5345 // "flatPath": "v1/services/{serviceName}", 5346 // "httpMethod": "DELETE", 5347 // "id": "servicemanagement.services.delete", 5348 // "parameterOrder": [ 5349 // "serviceName" 5350 // ], 5351 // "parameters": { 5352 // "serviceName": { 5353 // "description": "Required. The name of the service. See the [overview](/service-management/overview) for naming requirements. For example: `example.googleapis.com`.", 5354 // "location": "path", 5355 // "required": true, 5356 // "type": "string" 5357 // } 5358 // }, 5359 // "path": "v1/services/{serviceName}", 5360 // "response": { 5361 // "$ref": "Operation" 5362 // }, 5363 // "scopes": [ 5364 // "https://www.googleapis.com/auth/cloud-platform", 5365 // "https://www.googleapis.com/auth/service.management" 5366 // ] 5367 // } 5368 5369} 5370 5371// method id "servicemanagement.services.enable": 5372 5373type ServicesEnableCall struct { 5374 s *APIService 5375 serviceName string 5376 enableservicerequest *EnableServiceRequest 5377 urlParams_ gensupport.URLParams 5378 ctx_ context.Context 5379 header_ http.Header 5380} 5381 5382// Enable: Enables a service for a project, so it can be used for the 5383// project. See [Cloud Auth 5384// Guide](https://cloud.google.com/docs/authentication) for more 5385// information. Operation 5386func (r *ServicesService) Enable(serviceName string, enableservicerequest *EnableServiceRequest) *ServicesEnableCall { 5387 c := &ServicesEnableCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5388 c.serviceName = serviceName 5389 c.enableservicerequest = enableservicerequest 5390 return c 5391} 5392 5393// Fields allows partial responses to be retrieved. See 5394// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5395// for more information. 5396func (c *ServicesEnableCall) Fields(s ...googleapi.Field) *ServicesEnableCall { 5397 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5398 return c 5399} 5400 5401// Context sets the context to be used in this call's Do method. Any 5402// pending HTTP request will be aborted if the provided context is 5403// canceled. 5404func (c *ServicesEnableCall) Context(ctx context.Context) *ServicesEnableCall { 5405 c.ctx_ = ctx 5406 return c 5407} 5408 5409// Header returns an http.Header that can be modified by the caller to 5410// add HTTP headers to the request. 5411func (c *ServicesEnableCall) Header() http.Header { 5412 if c.header_ == nil { 5413 c.header_ = make(http.Header) 5414 } 5415 return c.header_ 5416} 5417 5418func (c *ServicesEnableCall) doRequest(alt string) (*http.Response, error) { 5419 reqHeaders := make(http.Header) 5420 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 5421 for k, v := range c.header_ { 5422 reqHeaders[k] = v 5423 } 5424 reqHeaders.Set("User-Agent", c.s.userAgent()) 5425 var body io.Reader = nil 5426 body, err := googleapi.WithoutDataWrapper.JSONReader(c.enableservicerequest) 5427 if err != nil { 5428 return nil, err 5429 } 5430 reqHeaders.Set("Content-Type", "application/json") 5431 c.urlParams_.Set("alt", alt) 5432 c.urlParams_.Set("prettyPrint", "false") 5433 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}:enable") 5434 urls += "?" + c.urlParams_.Encode() 5435 req, err := http.NewRequest("POST", urls, body) 5436 if err != nil { 5437 return nil, err 5438 } 5439 req.Header = reqHeaders 5440 googleapi.Expand(req.URL, map[string]string{ 5441 "serviceName": c.serviceName, 5442 }) 5443 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5444} 5445 5446// Do executes the "servicemanagement.services.enable" call. 5447// Exactly one of *Operation or error will be non-nil. Any non-2xx 5448// status code is an error. Response headers are in either 5449// *Operation.ServerResponse.Header or (if a response was returned at 5450// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5451// to check whether the returned error was because 5452// http.StatusNotModified was returned. 5453func (c *ServicesEnableCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5454 gensupport.SetOptions(c.urlParams_, opts...) 5455 res, err := c.doRequest("json") 5456 if res != nil && res.StatusCode == http.StatusNotModified { 5457 if res.Body != nil { 5458 res.Body.Close() 5459 } 5460 return nil, &googleapi.Error{ 5461 Code: res.StatusCode, 5462 Header: res.Header, 5463 } 5464 } 5465 if err != nil { 5466 return nil, err 5467 } 5468 defer googleapi.CloseBody(res) 5469 if err := googleapi.CheckResponse(res); err != nil { 5470 return nil, err 5471 } 5472 ret := &Operation{ 5473 ServerResponse: googleapi.ServerResponse{ 5474 Header: res.Header, 5475 HTTPStatusCode: res.StatusCode, 5476 }, 5477 } 5478 target := &ret 5479 if err := gensupport.DecodeResponse(target, res); err != nil { 5480 return nil, err 5481 } 5482 return ret, nil 5483 // { 5484 // "description": "Enables a service for a project, so it can be used for the project. See [Cloud Auth Guide](https://cloud.google.com/docs/authentication) for more information. Operation", 5485 // "flatPath": "v1/services/{serviceName}:enable", 5486 // "httpMethod": "POST", 5487 // "id": "servicemanagement.services.enable", 5488 // "parameterOrder": [ 5489 // "serviceName" 5490 // ], 5491 // "parameters": { 5492 // "serviceName": { 5493 // "description": "Required. Name of the service to enable. Specifying an unknown service name will cause the request to fail.", 5494 // "location": "path", 5495 // "required": true, 5496 // "type": "string" 5497 // } 5498 // }, 5499 // "path": "v1/services/{serviceName}:enable", 5500 // "request": { 5501 // "$ref": "EnableServiceRequest" 5502 // }, 5503 // "response": { 5504 // "$ref": "Operation" 5505 // }, 5506 // "scopes": [ 5507 // "https://www.googleapis.com/auth/cloud-platform", 5508 // "https://www.googleapis.com/auth/service.management" 5509 // ] 5510 // } 5511 5512} 5513 5514// method id "servicemanagement.services.generateConfigReport": 5515 5516type ServicesGenerateConfigReportCall struct { 5517 s *APIService 5518 generateconfigreportrequest *GenerateConfigReportRequest 5519 urlParams_ gensupport.URLParams 5520 ctx_ context.Context 5521 header_ http.Header 5522} 5523 5524// GenerateConfigReport: Generates and returns a report (errors, 5525// warnings and changes from existing configurations) associated with 5526// GenerateConfigReportRequest.new_value If 5527// GenerateConfigReportRequest.old_value is specified, 5528// GenerateConfigReportRequest will contain a single ChangeReport based 5529// on the comparison between GenerateConfigReportRequest.new_value and 5530// GenerateConfigReportRequest.old_value. If 5531// GenerateConfigReportRequest.old_value is not specified, this method 5532// will compare GenerateConfigReportRequest.new_value with the last 5533// pushed service configuration. 5534func (r *ServicesService) GenerateConfigReport(generateconfigreportrequest *GenerateConfigReportRequest) *ServicesGenerateConfigReportCall { 5535 c := &ServicesGenerateConfigReportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5536 c.generateconfigreportrequest = generateconfigreportrequest 5537 return c 5538} 5539 5540// Fields allows partial responses to be retrieved. See 5541// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5542// for more information. 5543func (c *ServicesGenerateConfigReportCall) Fields(s ...googleapi.Field) *ServicesGenerateConfigReportCall { 5544 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5545 return c 5546} 5547 5548// Context sets the context to be used in this call's Do method. Any 5549// pending HTTP request will be aborted if the provided context is 5550// canceled. 5551func (c *ServicesGenerateConfigReportCall) Context(ctx context.Context) *ServicesGenerateConfigReportCall { 5552 c.ctx_ = ctx 5553 return c 5554} 5555 5556// Header returns an http.Header that can be modified by the caller to 5557// add HTTP headers to the request. 5558func (c *ServicesGenerateConfigReportCall) Header() http.Header { 5559 if c.header_ == nil { 5560 c.header_ = make(http.Header) 5561 } 5562 return c.header_ 5563} 5564 5565func (c *ServicesGenerateConfigReportCall) doRequest(alt string) (*http.Response, error) { 5566 reqHeaders := make(http.Header) 5567 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 5568 for k, v := range c.header_ { 5569 reqHeaders[k] = v 5570 } 5571 reqHeaders.Set("User-Agent", c.s.userAgent()) 5572 var body io.Reader = nil 5573 body, err := googleapi.WithoutDataWrapper.JSONReader(c.generateconfigreportrequest) 5574 if err != nil { 5575 return nil, err 5576 } 5577 reqHeaders.Set("Content-Type", "application/json") 5578 c.urlParams_.Set("alt", alt) 5579 c.urlParams_.Set("prettyPrint", "false") 5580 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services:generateConfigReport") 5581 urls += "?" + c.urlParams_.Encode() 5582 req, err := http.NewRequest("POST", urls, body) 5583 if err != nil { 5584 return nil, err 5585 } 5586 req.Header = reqHeaders 5587 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5588} 5589 5590// Do executes the "servicemanagement.services.generateConfigReport" call. 5591// Exactly one of *GenerateConfigReportResponse or error will be 5592// non-nil. Any non-2xx status code is an error. Response headers are in 5593// either *GenerateConfigReportResponse.ServerResponse.Header or (if a 5594// response was returned at all) in error.(*googleapi.Error).Header. Use 5595// googleapi.IsNotModified to check whether the returned error was 5596// because http.StatusNotModified was returned. 5597func (c *ServicesGenerateConfigReportCall) Do(opts ...googleapi.CallOption) (*GenerateConfigReportResponse, error) { 5598 gensupport.SetOptions(c.urlParams_, opts...) 5599 res, err := c.doRequest("json") 5600 if res != nil && res.StatusCode == http.StatusNotModified { 5601 if res.Body != nil { 5602 res.Body.Close() 5603 } 5604 return nil, &googleapi.Error{ 5605 Code: res.StatusCode, 5606 Header: res.Header, 5607 } 5608 } 5609 if err != nil { 5610 return nil, err 5611 } 5612 defer googleapi.CloseBody(res) 5613 if err := googleapi.CheckResponse(res); err != nil { 5614 return nil, err 5615 } 5616 ret := &GenerateConfigReportResponse{ 5617 ServerResponse: googleapi.ServerResponse{ 5618 Header: res.Header, 5619 HTTPStatusCode: res.StatusCode, 5620 }, 5621 } 5622 target := &ret 5623 if err := gensupport.DecodeResponse(target, res); err != nil { 5624 return nil, err 5625 } 5626 return ret, nil 5627 // { 5628 // "description": "Generates and returns a report (errors, warnings and changes from existing configurations) associated with GenerateConfigReportRequest.new_value If GenerateConfigReportRequest.old_value is specified, GenerateConfigReportRequest will contain a single ChangeReport based on the comparison between GenerateConfigReportRequest.new_value and GenerateConfigReportRequest.old_value. If GenerateConfigReportRequest.old_value is not specified, this method will compare GenerateConfigReportRequest.new_value with the last pushed service configuration.", 5629 // "flatPath": "v1/services:generateConfigReport", 5630 // "httpMethod": "POST", 5631 // "id": "servicemanagement.services.generateConfigReport", 5632 // "parameterOrder": [], 5633 // "parameters": {}, 5634 // "path": "v1/services:generateConfigReport", 5635 // "request": { 5636 // "$ref": "GenerateConfigReportRequest" 5637 // }, 5638 // "response": { 5639 // "$ref": "GenerateConfigReportResponse" 5640 // }, 5641 // "scopes": [ 5642 // "https://www.googleapis.com/auth/cloud-platform", 5643 // "https://www.googleapis.com/auth/service.management" 5644 // ] 5645 // } 5646 5647} 5648 5649// method id "servicemanagement.services.get": 5650 5651type ServicesGetCall struct { 5652 s *APIService 5653 serviceName string 5654 urlParams_ gensupport.URLParams 5655 ifNoneMatch_ string 5656 ctx_ context.Context 5657 header_ http.Header 5658} 5659 5660// Get: Gets a managed service. Authentication is required unless the 5661// service is public. 5662func (r *ServicesService) Get(serviceName string) *ServicesGetCall { 5663 c := &ServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5664 c.serviceName = serviceName 5665 return c 5666} 5667 5668// Fields allows partial responses to be retrieved. See 5669// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5670// for more information. 5671func (c *ServicesGetCall) Fields(s ...googleapi.Field) *ServicesGetCall { 5672 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5673 return c 5674} 5675 5676// IfNoneMatch sets the optional parameter which makes the operation 5677// fail if the object's ETag matches the given value. This is useful for 5678// getting updates only after the object has changed since the last 5679// request. Use googleapi.IsNotModified to check whether the response 5680// error from Do is the result of In-None-Match. 5681func (c *ServicesGetCall) IfNoneMatch(entityTag string) *ServicesGetCall { 5682 c.ifNoneMatch_ = entityTag 5683 return c 5684} 5685 5686// Context sets the context to be used in this call's Do method. Any 5687// pending HTTP request will be aborted if the provided context is 5688// canceled. 5689func (c *ServicesGetCall) Context(ctx context.Context) *ServicesGetCall { 5690 c.ctx_ = ctx 5691 return c 5692} 5693 5694// Header returns an http.Header that can be modified by the caller to 5695// add HTTP headers to the request. 5696func (c *ServicesGetCall) Header() http.Header { 5697 if c.header_ == nil { 5698 c.header_ = make(http.Header) 5699 } 5700 return c.header_ 5701} 5702 5703func (c *ServicesGetCall) doRequest(alt string) (*http.Response, error) { 5704 reqHeaders := make(http.Header) 5705 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 5706 for k, v := range c.header_ { 5707 reqHeaders[k] = v 5708 } 5709 reqHeaders.Set("User-Agent", c.s.userAgent()) 5710 if c.ifNoneMatch_ != "" { 5711 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5712 } 5713 var body io.Reader = nil 5714 c.urlParams_.Set("alt", alt) 5715 c.urlParams_.Set("prettyPrint", "false") 5716 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}") 5717 urls += "?" + c.urlParams_.Encode() 5718 req, err := http.NewRequest("GET", urls, body) 5719 if err != nil { 5720 return nil, err 5721 } 5722 req.Header = reqHeaders 5723 googleapi.Expand(req.URL, map[string]string{ 5724 "serviceName": c.serviceName, 5725 }) 5726 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5727} 5728 5729// Do executes the "servicemanagement.services.get" call. 5730// Exactly one of *ManagedService or error will be non-nil. Any non-2xx 5731// status code is an error. Response headers are in either 5732// *ManagedService.ServerResponse.Header or (if a response was returned 5733// at all) in error.(*googleapi.Error).Header. Use 5734// googleapi.IsNotModified to check whether the returned error was 5735// because http.StatusNotModified was returned. 5736func (c *ServicesGetCall) Do(opts ...googleapi.CallOption) (*ManagedService, error) { 5737 gensupport.SetOptions(c.urlParams_, opts...) 5738 res, err := c.doRequest("json") 5739 if res != nil && res.StatusCode == http.StatusNotModified { 5740 if res.Body != nil { 5741 res.Body.Close() 5742 } 5743 return nil, &googleapi.Error{ 5744 Code: res.StatusCode, 5745 Header: res.Header, 5746 } 5747 } 5748 if err != nil { 5749 return nil, err 5750 } 5751 defer googleapi.CloseBody(res) 5752 if err := googleapi.CheckResponse(res); err != nil { 5753 return nil, err 5754 } 5755 ret := &ManagedService{ 5756 ServerResponse: googleapi.ServerResponse{ 5757 Header: res.Header, 5758 HTTPStatusCode: res.StatusCode, 5759 }, 5760 } 5761 target := &ret 5762 if err := gensupport.DecodeResponse(target, res); err != nil { 5763 return nil, err 5764 } 5765 return ret, nil 5766 // { 5767 // "description": "Gets a managed service. Authentication is required unless the service is public.", 5768 // "flatPath": "v1/services/{serviceName}", 5769 // "httpMethod": "GET", 5770 // "id": "servicemanagement.services.get", 5771 // "parameterOrder": [ 5772 // "serviceName" 5773 // ], 5774 // "parameters": { 5775 // "serviceName": { 5776 // "description": "Required. The name of the service. See the `ServiceManager` overview for naming requirements. For example: `example.googleapis.com`.", 5777 // "location": "path", 5778 // "required": true, 5779 // "type": "string" 5780 // } 5781 // }, 5782 // "path": "v1/services/{serviceName}", 5783 // "response": { 5784 // "$ref": "ManagedService" 5785 // }, 5786 // "scopes": [ 5787 // "https://www.googleapis.com/auth/cloud-platform", 5788 // "https://www.googleapis.com/auth/cloud-platform.read-only", 5789 // "https://www.googleapis.com/auth/service.management", 5790 // "https://www.googleapis.com/auth/service.management.readonly" 5791 // ] 5792 // } 5793 5794} 5795 5796// method id "servicemanagement.services.getConfig": 5797 5798type ServicesGetConfigCall struct { 5799 s *APIService 5800 serviceName string 5801 urlParams_ gensupport.URLParams 5802 ifNoneMatch_ string 5803 ctx_ context.Context 5804 header_ http.Header 5805} 5806 5807// GetConfig: Gets a service configuration (version) for a managed 5808// service. 5809func (r *ServicesService) GetConfig(serviceName string) *ServicesGetConfigCall { 5810 c := &ServicesGetConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5811 c.serviceName = serviceName 5812 return c 5813} 5814 5815// ConfigId sets the optional parameter "configId": Required. The id of 5816// the service configuration resource. This field must be specified for 5817// the server to return all fields, including `SourceInfo`. 5818func (c *ServicesGetConfigCall) ConfigId(configId string) *ServicesGetConfigCall { 5819 c.urlParams_.Set("configId", configId) 5820 return c 5821} 5822 5823// View sets the optional parameter "view": Specifies which parts of the 5824// Service Config should be returned in the response. 5825// 5826// Possible values: 5827// "BASIC" - Server response includes all fields except SourceInfo. 5828// "FULL" - Server response includes all fields including SourceInfo. 5829// SourceFiles are of type 'google.api.servicemanagement.v1.ConfigFile' 5830// and are only available for configs created using the 5831// SubmitConfigSource method. 5832func (c *ServicesGetConfigCall) View(view string) *ServicesGetConfigCall { 5833 c.urlParams_.Set("view", view) 5834 return c 5835} 5836 5837// Fields allows partial responses to be retrieved. See 5838// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5839// for more information. 5840func (c *ServicesGetConfigCall) Fields(s ...googleapi.Field) *ServicesGetConfigCall { 5841 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5842 return c 5843} 5844 5845// IfNoneMatch sets the optional parameter which makes the operation 5846// fail if the object's ETag matches the given value. This is useful for 5847// getting updates only after the object has changed since the last 5848// request. Use googleapi.IsNotModified to check whether the response 5849// error from Do is the result of In-None-Match. 5850func (c *ServicesGetConfigCall) IfNoneMatch(entityTag string) *ServicesGetConfigCall { 5851 c.ifNoneMatch_ = entityTag 5852 return c 5853} 5854 5855// Context sets the context to be used in this call's Do method. Any 5856// pending HTTP request will be aborted if the provided context is 5857// canceled. 5858func (c *ServicesGetConfigCall) Context(ctx context.Context) *ServicesGetConfigCall { 5859 c.ctx_ = ctx 5860 return c 5861} 5862 5863// Header returns an http.Header that can be modified by the caller to 5864// add HTTP headers to the request. 5865func (c *ServicesGetConfigCall) Header() http.Header { 5866 if c.header_ == nil { 5867 c.header_ = make(http.Header) 5868 } 5869 return c.header_ 5870} 5871 5872func (c *ServicesGetConfigCall) doRequest(alt string) (*http.Response, error) { 5873 reqHeaders := make(http.Header) 5874 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 5875 for k, v := range c.header_ { 5876 reqHeaders[k] = v 5877 } 5878 reqHeaders.Set("User-Agent", c.s.userAgent()) 5879 if c.ifNoneMatch_ != "" { 5880 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5881 } 5882 var body io.Reader = nil 5883 c.urlParams_.Set("alt", alt) 5884 c.urlParams_.Set("prettyPrint", "false") 5885 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}/config") 5886 urls += "?" + c.urlParams_.Encode() 5887 req, err := http.NewRequest("GET", urls, body) 5888 if err != nil { 5889 return nil, err 5890 } 5891 req.Header = reqHeaders 5892 googleapi.Expand(req.URL, map[string]string{ 5893 "serviceName": c.serviceName, 5894 }) 5895 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5896} 5897 5898// Do executes the "servicemanagement.services.getConfig" call. 5899// Exactly one of *Service or error will be non-nil. Any non-2xx status 5900// code is an error. Response headers are in either 5901// *Service.ServerResponse.Header or (if a response was returned at all) 5902// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5903// check whether the returned error was because http.StatusNotModified 5904// was returned. 5905func (c *ServicesGetConfigCall) Do(opts ...googleapi.CallOption) (*Service, error) { 5906 gensupport.SetOptions(c.urlParams_, opts...) 5907 res, err := c.doRequest("json") 5908 if res != nil && res.StatusCode == http.StatusNotModified { 5909 if res.Body != nil { 5910 res.Body.Close() 5911 } 5912 return nil, &googleapi.Error{ 5913 Code: res.StatusCode, 5914 Header: res.Header, 5915 } 5916 } 5917 if err != nil { 5918 return nil, err 5919 } 5920 defer googleapi.CloseBody(res) 5921 if err := googleapi.CheckResponse(res); err != nil { 5922 return nil, err 5923 } 5924 ret := &Service{ 5925 ServerResponse: googleapi.ServerResponse{ 5926 Header: res.Header, 5927 HTTPStatusCode: res.StatusCode, 5928 }, 5929 } 5930 target := &ret 5931 if err := gensupport.DecodeResponse(target, res); err != nil { 5932 return nil, err 5933 } 5934 return ret, nil 5935 // { 5936 // "description": "Gets a service configuration (version) for a managed service.", 5937 // "flatPath": "v1/services/{serviceName}/config", 5938 // "httpMethod": "GET", 5939 // "id": "servicemanagement.services.getConfig", 5940 // "parameterOrder": [ 5941 // "serviceName" 5942 // ], 5943 // "parameters": { 5944 // "configId": { 5945 // "description": "Required. The id of the service configuration resource. This field must be specified for the server to return all fields, including `SourceInfo`.", 5946 // "location": "query", 5947 // "type": "string" 5948 // }, 5949 // "serviceName": { 5950 // "description": "Required. The name of the service. See the [overview](/service-management/overview) for naming requirements. For example: `example.googleapis.com`.", 5951 // "location": "path", 5952 // "required": true, 5953 // "type": "string" 5954 // }, 5955 // "view": { 5956 // "description": "Specifies which parts of the Service Config should be returned in the response.", 5957 // "enum": [ 5958 // "BASIC", 5959 // "FULL" 5960 // ], 5961 // "enumDescriptions": [ 5962 // "Server response includes all fields except SourceInfo.", 5963 // "Server response includes all fields including SourceInfo. SourceFiles are of type 'google.api.servicemanagement.v1.ConfigFile' and are only available for configs created using the SubmitConfigSource method." 5964 // ], 5965 // "location": "query", 5966 // "type": "string" 5967 // } 5968 // }, 5969 // "path": "v1/services/{serviceName}/config", 5970 // "response": { 5971 // "$ref": "Service" 5972 // }, 5973 // "scopes": [ 5974 // "https://www.googleapis.com/auth/cloud-platform", 5975 // "https://www.googleapis.com/auth/cloud-platform.read-only", 5976 // "https://www.googleapis.com/auth/service.management", 5977 // "https://www.googleapis.com/auth/service.management.readonly" 5978 // ] 5979 // } 5980 5981} 5982 5983// method id "servicemanagement.services.getIamPolicy": 5984 5985type ServicesGetIamPolicyCall struct { 5986 s *APIService 5987 resource string 5988 getiampolicyrequest *GetIamPolicyRequest 5989 urlParams_ gensupport.URLParams 5990 ctx_ context.Context 5991 header_ http.Header 5992} 5993 5994// GetIamPolicy: Gets the access control policy for a resource. Returns 5995// an empty policy if the resource exists and does not have a policy 5996// set. 5997func (r *ServicesService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ServicesGetIamPolicyCall { 5998 c := &ServicesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5999 c.resource = resource 6000 c.getiampolicyrequest = getiampolicyrequest 6001 return c 6002} 6003 6004// Fields allows partial responses to be retrieved. See 6005// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6006// for more information. 6007func (c *ServicesGetIamPolicyCall) Fields(s ...googleapi.Field) *ServicesGetIamPolicyCall { 6008 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6009 return c 6010} 6011 6012// Context sets the context to be used in this call's Do method. Any 6013// pending HTTP request will be aborted if the provided context is 6014// canceled. 6015func (c *ServicesGetIamPolicyCall) Context(ctx context.Context) *ServicesGetIamPolicyCall { 6016 c.ctx_ = ctx 6017 return c 6018} 6019 6020// Header returns an http.Header that can be modified by the caller to 6021// add HTTP headers to the request. 6022func (c *ServicesGetIamPolicyCall) Header() http.Header { 6023 if c.header_ == nil { 6024 c.header_ = make(http.Header) 6025 } 6026 return c.header_ 6027} 6028 6029func (c *ServicesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 6030 reqHeaders := make(http.Header) 6031 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 6032 for k, v := range c.header_ { 6033 reqHeaders[k] = v 6034 } 6035 reqHeaders.Set("User-Agent", c.s.userAgent()) 6036 var body io.Reader = nil 6037 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) 6038 if err != nil { 6039 return nil, err 6040 } 6041 reqHeaders.Set("Content-Type", "application/json") 6042 c.urlParams_.Set("alt", alt) 6043 c.urlParams_.Set("prettyPrint", "false") 6044 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") 6045 urls += "?" + c.urlParams_.Encode() 6046 req, err := http.NewRequest("POST", urls, body) 6047 if err != nil { 6048 return nil, err 6049 } 6050 req.Header = reqHeaders 6051 googleapi.Expand(req.URL, map[string]string{ 6052 "resource": c.resource, 6053 }) 6054 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6055} 6056 6057// Do executes the "servicemanagement.services.getIamPolicy" call. 6058// Exactly one of *Policy or error will be non-nil. Any non-2xx status 6059// code is an error. Response headers are in either 6060// *Policy.ServerResponse.Header or (if a response was returned at all) 6061// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 6062// check whether the returned error was because http.StatusNotModified 6063// was returned. 6064func (c *ServicesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 6065 gensupport.SetOptions(c.urlParams_, opts...) 6066 res, err := c.doRequest("json") 6067 if res != nil && res.StatusCode == http.StatusNotModified { 6068 if res.Body != nil { 6069 res.Body.Close() 6070 } 6071 return nil, &googleapi.Error{ 6072 Code: res.StatusCode, 6073 Header: res.Header, 6074 } 6075 } 6076 if err != nil { 6077 return nil, err 6078 } 6079 defer googleapi.CloseBody(res) 6080 if err := googleapi.CheckResponse(res); err != nil { 6081 return nil, err 6082 } 6083 ret := &Policy{ 6084 ServerResponse: googleapi.ServerResponse{ 6085 Header: res.Header, 6086 HTTPStatusCode: res.StatusCode, 6087 }, 6088 } 6089 target := &ret 6090 if err := gensupport.DecodeResponse(target, res); err != nil { 6091 return nil, err 6092 } 6093 return ret, nil 6094 // { 6095 // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", 6096 // "flatPath": "v1/services/{servicesId}:getIamPolicy", 6097 // "httpMethod": "POST", 6098 // "id": "servicemanagement.services.getIamPolicy", 6099 // "parameterOrder": [ 6100 // "resource" 6101 // ], 6102 // "parameters": { 6103 // "resource": { 6104 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 6105 // "location": "path", 6106 // "pattern": "^services/[^/]+$", 6107 // "required": true, 6108 // "type": "string" 6109 // } 6110 // }, 6111 // "path": "v1/{+resource}:getIamPolicy", 6112 // "request": { 6113 // "$ref": "GetIamPolicyRequest" 6114 // }, 6115 // "response": { 6116 // "$ref": "Policy" 6117 // }, 6118 // "scopes": [ 6119 // "https://www.googleapis.com/auth/cloud-platform", 6120 // "https://www.googleapis.com/auth/cloud-platform.read-only", 6121 // "https://www.googleapis.com/auth/service.management", 6122 // "https://www.googleapis.com/auth/service.management.readonly" 6123 // ] 6124 // } 6125 6126} 6127 6128// method id "servicemanagement.services.list": 6129 6130type ServicesListCall struct { 6131 s *APIService 6132 urlParams_ gensupport.URLParams 6133 ifNoneMatch_ string 6134 ctx_ context.Context 6135 header_ http.Header 6136} 6137 6138// List: Lists managed services. Returns all public services. For 6139// authenticated users, also returns all services the calling user has 6140// "servicemanagement.services.get" permission for. **BETA:** If the 6141// caller specifies the `consumer_id`, it returns only the services 6142// enabled on the consumer. The `consumer_id` must have the format of 6143// "project:{PROJECT-ID}". 6144func (r *ServicesService) List() *ServicesListCall { 6145 c := &ServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6146 return c 6147} 6148 6149// ConsumerId sets the optional parameter "consumerId": Include services 6150// consumed by the specified consumer. The Google Service Management 6151// implementation accepts the following forms: - project: 6152func (c *ServicesListCall) ConsumerId(consumerId string) *ServicesListCall { 6153 c.urlParams_.Set("consumerId", consumerId) 6154 return c 6155} 6156 6157// PageSize sets the optional parameter "pageSize": The max number of 6158// items to include in the response list. Page size is 50 if not 6159// specified. Maximum value is 100. 6160func (c *ServicesListCall) PageSize(pageSize int64) *ServicesListCall { 6161 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 6162 return c 6163} 6164 6165// PageToken sets the optional parameter "pageToken": Token identifying 6166// which result to start with; returned by a previous list call. 6167func (c *ServicesListCall) PageToken(pageToken string) *ServicesListCall { 6168 c.urlParams_.Set("pageToken", pageToken) 6169 return c 6170} 6171 6172// ProducerProjectId sets the optional parameter "producerProjectId": 6173// Include services produced by the specified project. 6174func (c *ServicesListCall) ProducerProjectId(producerProjectId string) *ServicesListCall { 6175 c.urlParams_.Set("producerProjectId", producerProjectId) 6176 return c 6177} 6178 6179// Fields allows partial responses to be retrieved. See 6180// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6181// for more information. 6182func (c *ServicesListCall) Fields(s ...googleapi.Field) *ServicesListCall { 6183 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6184 return c 6185} 6186 6187// IfNoneMatch sets the optional parameter which makes the operation 6188// fail if the object's ETag matches the given value. This is useful for 6189// getting updates only after the object has changed since the last 6190// request. Use googleapi.IsNotModified to check whether the response 6191// error from Do is the result of In-None-Match. 6192func (c *ServicesListCall) IfNoneMatch(entityTag string) *ServicesListCall { 6193 c.ifNoneMatch_ = entityTag 6194 return c 6195} 6196 6197// Context sets the context to be used in this call's Do method. Any 6198// pending HTTP request will be aborted if the provided context is 6199// canceled. 6200func (c *ServicesListCall) Context(ctx context.Context) *ServicesListCall { 6201 c.ctx_ = ctx 6202 return c 6203} 6204 6205// Header returns an http.Header that can be modified by the caller to 6206// add HTTP headers to the request. 6207func (c *ServicesListCall) Header() http.Header { 6208 if c.header_ == nil { 6209 c.header_ = make(http.Header) 6210 } 6211 return c.header_ 6212} 6213 6214func (c *ServicesListCall) doRequest(alt string) (*http.Response, error) { 6215 reqHeaders := make(http.Header) 6216 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 6217 for k, v := range c.header_ { 6218 reqHeaders[k] = v 6219 } 6220 reqHeaders.Set("User-Agent", c.s.userAgent()) 6221 if c.ifNoneMatch_ != "" { 6222 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6223 } 6224 var body io.Reader = nil 6225 c.urlParams_.Set("alt", alt) 6226 c.urlParams_.Set("prettyPrint", "false") 6227 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services") 6228 urls += "?" + c.urlParams_.Encode() 6229 req, err := http.NewRequest("GET", urls, body) 6230 if err != nil { 6231 return nil, err 6232 } 6233 req.Header = reqHeaders 6234 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6235} 6236 6237// Do executes the "servicemanagement.services.list" call. 6238// Exactly one of *ListServicesResponse or error will be non-nil. Any 6239// non-2xx status code is an error. Response headers are in either 6240// *ListServicesResponse.ServerResponse.Header or (if a response was 6241// returned at all) in error.(*googleapi.Error).Header. Use 6242// googleapi.IsNotModified to check whether the returned error was 6243// because http.StatusNotModified was returned. 6244func (c *ServicesListCall) Do(opts ...googleapi.CallOption) (*ListServicesResponse, error) { 6245 gensupport.SetOptions(c.urlParams_, opts...) 6246 res, err := c.doRequest("json") 6247 if res != nil && res.StatusCode == http.StatusNotModified { 6248 if res.Body != nil { 6249 res.Body.Close() 6250 } 6251 return nil, &googleapi.Error{ 6252 Code: res.StatusCode, 6253 Header: res.Header, 6254 } 6255 } 6256 if err != nil { 6257 return nil, err 6258 } 6259 defer googleapi.CloseBody(res) 6260 if err := googleapi.CheckResponse(res); err != nil { 6261 return nil, err 6262 } 6263 ret := &ListServicesResponse{ 6264 ServerResponse: googleapi.ServerResponse{ 6265 Header: res.Header, 6266 HTTPStatusCode: res.StatusCode, 6267 }, 6268 } 6269 target := &ret 6270 if err := gensupport.DecodeResponse(target, res); err != nil { 6271 return nil, err 6272 } 6273 return ret, nil 6274 // { 6275 // "description": "Lists managed services. Returns all public services. For authenticated users, also returns all services the calling user has \"servicemanagement.services.get\" permission for. **BETA:** If the caller specifies the `consumer_id`, it returns only the services enabled on the consumer. The `consumer_id` must have the format of \"project:{PROJECT-ID}\".", 6276 // "flatPath": "v1/services", 6277 // "httpMethod": "GET", 6278 // "id": "servicemanagement.services.list", 6279 // "parameterOrder": [], 6280 // "parameters": { 6281 // "consumerId": { 6282 // "description": "Include services consumed by the specified consumer. The Google Service Management implementation accepts the following forms: - project:", 6283 // "location": "query", 6284 // "type": "string" 6285 // }, 6286 // "pageSize": { 6287 // "description": "The max number of items to include in the response list. Page size is 50 if not specified. Maximum value is 100.", 6288 // "format": "int32", 6289 // "location": "query", 6290 // "type": "integer" 6291 // }, 6292 // "pageToken": { 6293 // "description": "Token identifying which result to start with; returned by a previous list call.", 6294 // "location": "query", 6295 // "type": "string" 6296 // }, 6297 // "producerProjectId": { 6298 // "description": "Include services produced by the specified project.", 6299 // "location": "query", 6300 // "type": "string" 6301 // } 6302 // }, 6303 // "path": "v1/services", 6304 // "response": { 6305 // "$ref": "ListServicesResponse" 6306 // }, 6307 // "scopes": [ 6308 // "https://www.googleapis.com/auth/cloud-platform", 6309 // "https://www.googleapis.com/auth/cloud-platform.read-only", 6310 // "https://www.googleapis.com/auth/service.management", 6311 // "https://www.googleapis.com/auth/service.management.readonly" 6312 // ] 6313 // } 6314 6315} 6316 6317// Pages invokes f for each page of results. 6318// A non-nil error returned from f will halt the iteration. 6319// The provided context supersedes any context provided to the Context method. 6320func (c *ServicesListCall) Pages(ctx context.Context, f func(*ListServicesResponse) error) error { 6321 c.ctx_ = ctx 6322 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 6323 for { 6324 x, err := c.Do() 6325 if err != nil { 6326 return err 6327 } 6328 if err := f(x); err != nil { 6329 return err 6330 } 6331 if x.NextPageToken == "" { 6332 return nil 6333 } 6334 c.PageToken(x.NextPageToken) 6335 } 6336} 6337 6338// method id "servicemanagement.services.setIamPolicy": 6339 6340type ServicesSetIamPolicyCall struct { 6341 s *APIService 6342 resource string 6343 setiampolicyrequest *SetIamPolicyRequest 6344 urlParams_ gensupport.URLParams 6345 ctx_ context.Context 6346 header_ http.Header 6347} 6348 6349// SetIamPolicy: Sets the access control policy on the specified 6350// resource. Replaces any existing policy. Can return `NOT_FOUND`, 6351// `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. 6352func (r *ServicesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ServicesSetIamPolicyCall { 6353 c := &ServicesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6354 c.resource = resource 6355 c.setiampolicyrequest = setiampolicyrequest 6356 return c 6357} 6358 6359// Fields allows partial responses to be retrieved. See 6360// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6361// for more information. 6362func (c *ServicesSetIamPolicyCall) Fields(s ...googleapi.Field) *ServicesSetIamPolicyCall { 6363 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6364 return c 6365} 6366 6367// Context sets the context to be used in this call's Do method. Any 6368// pending HTTP request will be aborted if the provided context is 6369// canceled. 6370func (c *ServicesSetIamPolicyCall) Context(ctx context.Context) *ServicesSetIamPolicyCall { 6371 c.ctx_ = ctx 6372 return c 6373} 6374 6375// Header returns an http.Header that can be modified by the caller to 6376// add HTTP headers to the request. 6377func (c *ServicesSetIamPolicyCall) Header() http.Header { 6378 if c.header_ == nil { 6379 c.header_ = make(http.Header) 6380 } 6381 return c.header_ 6382} 6383 6384func (c *ServicesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 6385 reqHeaders := make(http.Header) 6386 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 6387 for k, v := range c.header_ { 6388 reqHeaders[k] = v 6389 } 6390 reqHeaders.Set("User-Agent", c.s.userAgent()) 6391 var body io.Reader = nil 6392 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 6393 if err != nil { 6394 return nil, err 6395 } 6396 reqHeaders.Set("Content-Type", "application/json") 6397 c.urlParams_.Set("alt", alt) 6398 c.urlParams_.Set("prettyPrint", "false") 6399 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy") 6400 urls += "?" + c.urlParams_.Encode() 6401 req, err := http.NewRequest("POST", urls, body) 6402 if err != nil { 6403 return nil, err 6404 } 6405 req.Header = reqHeaders 6406 googleapi.Expand(req.URL, map[string]string{ 6407 "resource": c.resource, 6408 }) 6409 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6410} 6411 6412// Do executes the "servicemanagement.services.setIamPolicy" call. 6413// Exactly one of *Policy or error will be non-nil. Any non-2xx status 6414// code is an error. Response headers are in either 6415// *Policy.ServerResponse.Header or (if a response was returned at all) 6416// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 6417// check whether the returned error was because http.StatusNotModified 6418// was returned. 6419func (c *ServicesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 6420 gensupport.SetOptions(c.urlParams_, opts...) 6421 res, err := c.doRequest("json") 6422 if res != nil && res.StatusCode == http.StatusNotModified { 6423 if res.Body != nil { 6424 res.Body.Close() 6425 } 6426 return nil, &googleapi.Error{ 6427 Code: res.StatusCode, 6428 Header: res.Header, 6429 } 6430 } 6431 if err != nil { 6432 return nil, err 6433 } 6434 defer googleapi.CloseBody(res) 6435 if err := googleapi.CheckResponse(res); err != nil { 6436 return nil, err 6437 } 6438 ret := &Policy{ 6439 ServerResponse: googleapi.ServerResponse{ 6440 Header: res.Header, 6441 HTTPStatusCode: res.StatusCode, 6442 }, 6443 } 6444 target := &ret 6445 if err := gensupport.DecodeResponse(target, res); err != nil { 6446 return nil, err 6447 } 6448 return ret, nil 6449 // { 6450 // "description": "Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.", 6451 // "flatPath": "v1/services/{servicesId}:setIamPolicy", 6452 // "httpMethod": "POST", 6453 // "id": "servicemanagement.services.setIamPolicy", 6454 // "parameterOrder": [ 6455 // "resource" 6456 // ], 6457 // "parameters": { 6458 // "resource": { 6459 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 6460 // "location": "path", 6461 // "pattern": "^services/[^/]+$", 6462 // "required": true, 6463 // "type": "string" 6464 // } 6465 // }, 6466 // "path": "v1/{+resource}:setIamPolicy", 6467 // "request": { 6468 // "$ref": "SetIamPolicyRequest" 6469 // }, 6470 // "response": { 6471 // "$ref": "Policy" 6472 // }, 6473 // "scopes": [ 6474 // "https://www.googleapis.com/auth/cloud-platform", 6475 // "https://www.googleapis.com/auth/service.management" 6476 // ] 6477 // } 6478 6479} 6480 6481// method id "servicemanagement.services.testIamPermissions": 6482 6483type ServicesTestIamPermissionsCall struct { 6484 s *APIService 6485 resource string 6486 testiampermissionsrequest *TestIamPermissionsRequest 6487 urlParams_ gensupport.URLParams 6488 ctx_ context.Context 6489 header_ http.Header 6490} 6491 6492// TestIamPermissions: Returns permissions that a caller has on the 6493// specified resource. If the resource does not exist, this will return 6494// an empty set of permissions, not a `NOT_FOUND` error. Note: This 6495// operation is designed to be used for building permission-aware UIs 6496// and command-line tools, not for authorization checking. This 6497// operation may "fail open" without warning. 6498func (r *ServicesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ServicesTestIamPermissionsCall { 6499 c := &ServicesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6500 c.resource = resource 6501 c.testiampermissionsrequest = testiampermissionsrequest 6502 return c 6503} 6504 6505// Fields allows partial responses to be retrieved. See 6506// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6507// for more information. 6508func (c *ServicesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ServicesTestIamPermissionsCall { 6509 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6510 return c 6511} 6512 6513// Context sets the context to be used in this call's Do method. Any 6514// pending HTTP request will be aborted if the provided context is 6515// canceled. 6516func (c *ServicesTestIamPermissionsCall) Context(ctx context.Context) *ServicesTestIamPermissionsCall { 6517 c.ctx_ = ctx 6518 return c 6519} 6520 6521// Header returns an http.Header that can be modified by the caller to 6522// add HTTP headers to the request. 6523func (c *ServicesTestIamPermissionsCall) Header() http.Header { 6524 if c.header_ == nil { 6525 c.header_ = make(http.Header) 6526 } 6527 return c.header_ 6528} 6529 6530func (c *ServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 6531 reqHeaders := make(http.Header) 6532 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 6533 for k, v := range c.header_ { 6534 reqHeaders[k] = v 6535 } 6536 reqHeaders.Set("User-Agent", c.s.userAgent()) 6537 var body io.Reader = nil 6538 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 6539 if err != nil { 6540 return nil, err 6541 } 6542 reqHeaders.Set("Content-Type", "application/json") 6543 c.urlParams_.Set("alt", alt) 6544 c.urlParams_.Set("prettyPrint", "false") 6545 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions") 6546 urls += "?" + c.urlParams_.Encode() 6547 req, err := http.NewRequest("POST", urls, body) 6548 if err != nil { 6549 return nil, err 6550 } 6551 req.Header = reqHeaders 6552 googleapi.Expand(req.URL, map[string]string{ 6553 "resource": c.resource, 6554 }) 6555 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6556} 6557 6558// Do executes the "servicemanagement.services.testIamPermissions" call. 6559// Exactly one of *TestIamPermissionsResponse or error will be non-nil. 6560// Any non-2xx status code is an error. Response headers are in either 6561// *TestIamPermissionsResponse.ServerResponse.Header or (if a response 6562// was returned at all) in error.(*googleapi.Error).Header. Use 6563// googleapi.IsNotModified to check whether the returned error was 6564// because http.StatusNotModified was returned. 6565func (c *ServicesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 6566 gensupport.SetOptions(c.urlParams_, opts...) 6567 res, err := c.doRequest("json") 6568 if res != nil && res.StatusCode == http.StatusNotModified { 6569 if res.Body != nil { 6570 res.Body.Close() 6571 } 6572 return nil, &googleapi.Error{ 6573 Code: res.StatusCode, 6574 Header: res.Header, 6575 } 6576 } 6577 if err != nil { 6578 return nil, err 6579 } 6580 defer googleapi.CloseBody(res) 6581 if err := googleapi.CheckResponse(res); err != nil { 6582 return nil, err 6583 } 6584 ret := &TestIamPermissionsResponse{ 6585 ServerResponse: googleapi.ServerResponse{ 6586 Header: res.Header, 6587 HTTPStatusCode: res.StatusCode, 6588 }, 6589 } 6590 target := &ret 6591 if err := gensupport.DecodeResponse(target, res); err != nil { 6592 return nil, err 6593 } 6594 return ret, nil 6595 // { 6596 // "description": "Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.", 6597 // "flatPath": "v1/services/{servicesId}:testIamPermissions", 6598 // "httpMethod": "POST", 6599 // "id": "servicemanagement.services.testIamPermissions", 6600 // "parameterOrder": [ 6601 // "resource" 6602 // ], 6603 // "parameters": { 6604 // "resource": { 6605 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 6606 // "location": "path", 6607 // "pattern": "^services/[^/]+$", 6608 // "required": true, 6609 // "type": "string" 6610 // } 6611 // }, 6612 // "path": "v1/{+resource}:testIamPermissions", 6613 // "request": { 6614 // "$ref": "TestIamPermissionsRequest" 6615 // }, 6616 // "response": { 6617 // "$ref": "TestIamPermissionsResponse" 6618 // }, 6619 // "scopes": [ 6620 // "https://www.googleapis.com/auth/cloud-platform", 6621 // "https://www.googleapis.com/auth/cloud-platform.read-only", 6622 // "https://www.googleapis.com/auth/service.management", 6623 // "https://www.googleapis.com/auth/service.management.readonly" 6624 // ] 6625 // } 6626 6627} 6628 6629// method id "servicemanagement.services.undelete": 6630 6631type ServicesUndeleteCall struct { 6632 s *APIService 6633 serviceName string 6634 urlParams_ gensupport.URLParams 6635 ctx_ context.Context 6636 header_ http.Header 6637} 6638 6639// Undelete: Revives a previously deleted managed service. The method 6640// restores the service using the configuration at the time the service 6641// was deleted. The target service must exist and must have been deleted 6642// within the last 30 days. Operation 6643func (r *ServicesService) Undelete(serviceName string) *ServicesUndeleteCall { 6644 c := &ServicesUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6645 c.serviceName = serviceName 6646 return c 6647} 6648 6649// Fields allows partial responses to be retrieved. See 6650// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6651// for more information. 6652func (c *ServicesUndeleteCall) Fields(s ...googleapi.Field) *ServicesUndeleteCall { 6653 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6654 return c 6655} 6656 6657// Context sets the context to be used in this call's Do method. Any 6658// pending HTTP request will be aborted if the provided context is 6659// canceled. 6660func (c *ServicesUndeleteCall) Context(ctx context.Context) *ServicesUndeleteCall { 6661 c.ctx_ = ctx 6662 return c 6663} 6664 6665// Header returns an http.Header that can be modified by the caller to 6666// add HTTP headers to the request. 6667func (c *ServicesUndeleteCall) Header() http.Header { 6668 if c.header_ == nil { 6669 c.header_ = make(http.Header) 6670 } 6671 return c.header_ 6672} 6673 6674func (c *ServicesUndeleteCall) doRequest(alt string) (*http.Response, error) { 6675 reqHeaders := make(http.Header) 6676 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 6677 for k, v := range c.header_ { 6678 reqHeaders[k] = v 6679 } 6680 reqHeaders.Set("User-Agent", c.s.userAgent()) 6681 var body io.Reader = nil 6682 c.urlParams_.Set("alt", alt) 6683 c.urlParams_.Set("prettyPrint", "false") 6684 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}:undelete") 6685 urls += "?" + c.urlParams_.Encode() 6686 req, err := http.NewRequest("POST", urls, body) 6687 if err != nil { 6688 return nil, err 6689 } 6690 req.Header = reqHeaders 6691 googleapi.Expand(req.URL, map[string]string{ 6692 "serviceName": c.serviceName, 6693 }) 6694 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6695} 6696 6697// Do executes the "servicemanagement.services.undelete" call. 6698// Exactly one of *Operation or error will be non-nil. Any non-2xx 6699// status code is an error. Response headers are in either 6700// *Operation.ServerResponse.Header or (if a response was returned at 6701// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6702// to check whether the returned error was because 6703// http.StatusNotModified was returned. 6704func (c *ServicesUndeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6705 gensupport.SetOptions(c.urlParams_, opts...) 6706 res, err := c.doRequest("json") 6707 if res != nil && res.StatusCode == http.StatusNotModified { 6708 if res.Body != nil { 6709 res.Body.Close() 6710 } 6711 return nil, &googleapi.Error{ 6712 Code: res.StatusCode, 6713 Header: res.Header, 6714 } 6715 } 6716 if err != nil { 6717 return nil, err 6718 } 6719 defer googleapi.CloseBody(res) 6720 if err := googleapi.CheckResponse(res); err != nil { 6721 return nil, err 6722 } 6723 ret := &Operation{ 6724 ServerResponse: googleapi.ServerResponse{ 6725 Header: res.Header, 6726 HTTPStatusCode: res.StatusCode, 6727 }, 6728 } 6729 target := &ret 6730 if err := gensupport.DecodeResponse(target, res); err != nil { 6731 return nil, err 6732 } 6733 return ret, nil 6734 // { 6735 // "description": "Revives a previously deleted managed service. The method restores the service using the configuration at the time the service was deleted. The target service must exist and must have been deleted within the last 30 days. Operation", 6736 // "flatPath": "v1/services/{serviceName}:undelete", 6737 // "httpMethod": "POST", 6738 // "id": "servicemanagement.services.undelete", 6739 // "parameterOrder": [ 6740 // "serviceName" 6741 // ], 6742 // "parameters": { 6743 // "serviceName": { 6744 // "description": "Required. The name of the service. See the [overview](/service-management/overview) for naming requirements. For example: `example.googleapis.com`.", 6745 // "location": "path", 6746 // "required": true, 6747 // "type": "string" 6748 // } 6749 // }, 6750 // "path": "v1/services/{serviceName}:undelete", 6751 // "response": { 6752 // "$ref": "Operation" 6753 // }, 6754 // "scopes": [ 6755 // "https://www.googleapis.com/auth/cloud-platform", 6756 // "https://www.googleapis.com/auth/service.management" 6757 // ] 6758 // } 6759 6760} 6761 6762// method id "servicemanagement.services.configs.create": 6763 6764type ServicesConfigsCreateCall struct { 6765 s *APIService 6766 serviceName string 6767 service *Service 6768 urlParams_ gensupport.URLParams 6769 ctx_ context.Context 6770 header_ http.Header 6771} 6772 6773// Create: Creates a new service configuration (version) for a managed 6774// service. This method only stores the service configuration. To roll 6775// out the service configuration to backend systems please call 6776// CreateServiceRollout. Only the 100 most recent service configurations 6777// and ones referenced by existing rollouts are kept for each service. 6778// The rest will be deleted eventually. 6779func (r *ServicesConfigsService) Create(serviceName string, service *Service) *ServicesConfigsCreateCall { 6780 c := &ServicesConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6781 c.serviceName = serviceName 6782 c.service = service 6783 return c 6784} 6785 6786// Fields allows partial responses to be retrieved. See 6787// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6788// for more information. 6789func (c *ServicesConfigsCreateCall) Fields(s ...googleapi.Field) *ServicesConfigsCreateCall { 6790 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6791 return c 6792} 6793 6794// Context sets the context to be used in this call's Do method. Any 6795// pending HTTP request will be aborted if the provided context is 6796// canceled. 6797func (c *ServicesConfigsCreateCall) Context(ctx context.Context) *ServicesConfigsCreateCall { 6798 c.ctx_ = ctx 6799 return c 6800} 6801 6802// Header returns an http.Header that can be modified by the caller to 6803// add HTTP headers to the request. 6804func (c *ServicesConfigsCreateCall) Header() http.Header { 6805 if c.header_ == nil { 6806 c.header_ = make(http.Header) 6807 } 6808 return c.header_ 6809} 6810 6811func (c *ServicesConfigsCreateCall) doRequest(alt string) (*http.Response, error) { 6812 reqHeaders := make(http.Header) 6813 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 6814 for k, v := range c.header_ { 6815 reqHeaders[k] = v 6816 } 6817 reqHeaders.Set("User-Agent", c.s.userAgent()) 6818 var body io.Reader = nil 6819 body, err := googleapi.WithoutDataWrapper.JSONReader(c.service) 6820 if err != nil { 6821 return nil, err 6822 } 6823 reqHeaders.Set("Content-Type", "application/json") 6824 c.urlParams_.Set("alt", alt) 6825 c.urlParams_.Set("prettyPrint", "false") 6826 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}/configs") 6827 urls += "?" + c.urlParams_.Encode() 6828 req, err := http.NewRequest("POST", urls, body) 6829 if err != nil { 6830 return nil, err 6831 } 6832 req.Header = reqHeaders 6833 googleapi.Expand(req.URL, map[string]string{ 6834 "serviceName": c.serviceName, 6835 }) 6836 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6837} 6838 6839// Do executes the "servicemanagement.services.configs.create" call. 6840// Exactly one of *Service or error will be non-nil. Any non-2xx status 6841// code is an error. Response headers are in either 6842// *Service.ServerResponse.Header or (if a response was returned at all) 6843// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 6844// check whether the returned error was because http.StatusNotModified 6845// was returned. 6846func (c *ServicesConfigsCreateCall) Do(opts ...googleapi.CallOption) (*Service, error) { 6847 gensupport.SetOptions(c.urlParams_, opts...) 6848 res, err := c.doRequest("json") 6849 if res != nil && res.StatusCode == http.StatusNotModified { 6850 if res.Body != nil { 6851 res.Body.Close() 6852 } 6853 return nil, &googleapi.Error{ 6854 Code: res.StatusCode, 6855 Header: res.Header, 6856 } 6857 } 6858 if err != nil { 6859 return nil, err 6860 } 6861 defer googleapi.CloseBody(res) 6862 if err := googleapi.CheckResponse(res); err != nil { 6863 return nil, err 6864 } 6865 ret := &Service{ 6866 ServerResponse: googleapi.ServerResponse{ 6867 Header: res.Header, 6868 HTTPStatusCode: res.StatusCode, 6869 }, 6870 } 6871 target := &ret 6872 if err := gensupport.DecodeResponse(target, res); err != nil { 6873 return nil, err 6874 } 6875 return ret, nil 6876 // { 6877 // "description": "Creates a new service configuration (version) for a managed service. This method only stores the service configuration. To roll out the service configuration to backend systems please call CreateServiceRollout. Only the 100 most recent service configurations and ones referenced by existing rollouts are kept for each service. The rest will be deleted eventually.", 6878 // "flatPath": "v1/services/{serviceName}/configs", 6879 // "httpMethod": "POST", 6880 // "id": "servicemanagement.services.configs.create", 6881 // "parameterOrder": [ 6882 // "serviceName" 6883 // ], 6884 // "parameters": { 6885 // "serviceName": { 6886 // "description": "Required. The name of the service. See the [overview](/service-management/overview) for naming requirements. For example: `example.googleapis.com`.", 6887 // "location": "path", 6888 // "required": true, 6889 // "type": "string" 6890 // } 6891 // }, 6892 // "path": "v1/services/{serviceName}/configs", 6893 // "request": { 6894 // "$ref": "Service" 6895 // }, 6896 // "response": { 6897 // "$ref": "Service" 6898 // }, 6899 // "scopes": [ 6900 // "https://www.googleapis.com/auth/cloud-platform", 6901 // "https://www.googleapis.com/auth/service.management" 6902 // ] 6903 // } 6904 6905} 6906 6907// method id "servicemanagement.services.configs.get": 6908 6909type ServicesConfigsGetCall struct { 6910 s *APIService 6911 serviceName string 6912 configId string 6913 urlParams_ gensupport.URLParams 6914 ifNoneMatch_ string 6915 ctx_ context.Context 6916 header_ http.Header 6917} 6918 6919// Get: Gets a service configuration (version) for a managed service. 6920func (r *ServicesConfigsService) Get(serviceName string, configId string) *ServicesConfigsGetCall { 6921 c := &ServicesConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6922 c.serviceName = serviceName 6923 c.configId = configId 6924 return c 6925} 6926 6927// View sets the optional parameter "view": Specifies which parts of the 6928// Service Config should be returned in the response. 6929// 6930// Possible values: 6931// "BASIC" - Server response includes all fields except SourceInfo. 6932// "FULL" - Server response includes all fields including SourceInfo. 6933// SourceFiles are of type 'google.api.servicemanagement.v1.ConfigFile' 6934// and are only available for configs created using the 6935// SubmitConfigSource method. 6936func (c *ServicesConfigsGetCall) View(view string) *ServicesConfigsGetCall { 6937 c.urlParams_.Set("view", view) 6938 return c 6939} 6940 6941// Fields allows partial responses to be retrieved. See 6942// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6943// for more information. 6944func (c *ServicesConfigsGetCall) Fields(s ...googleapi.Field) *ServicesConfigsGetCall { 6945 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6946 return c 6947} 6948 6949// IfNoneMatch sets the optional parameter which makes the operation 6950// fail if the object's ETag matches the given value. This is useful for 6951// getting updates only after the object has changed since the last 6952// request. Use googleapi.IsNotModified to check whether the response 6953// error from Do is the result of In-None-Match. 6954func (c *ServicesConfigsGetCall) IfNoneMatch(entityTag string) *ServicesConfigsGetCall { 6955 c.ifNoneMatch_ = entityTag 6956 return c 6957} 6958 6959// Context sets the context to be used in this call's Do method. Any 6960// pending HTTP request will be aborted if the provided context is 6961// canceled. 6962func (c *ServicesConfigsGetCall) Context(ctx context.Context) *ServicesConfigsGetCall { 6963 c.ctx_ = ctx 6964 return c 6965} 6966 6967// Header returns an http.Header that can be modified by the caller to 6968// add HTTP headers to the request. 6969func (c *ServicesConfigsGetCall) Header() http.Header { 6970 if c.header_ == nil { 6971 c.header_ = make(http.Header) 6972 } 6973 return c.header_ 6974} 6975 6976func (c *ServicesConfigsGetCall) doRequest(alt string) (*http.Response, error) { 6977 reqHeaders := make(http.Header) 6978 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 6979 for k, v := range c.header_ { 6980 reqHeaders[k] = v 6981 } 6982 reqHeaders.Set("User-Agent", c.s.userAgent()) 6983 if c.ifNoneMatch_ != "" { 6984 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6985 } 6986 var body io.Reader = nil 6987 c.urlParams_.Set("alt", alt) 6988 c.urlParams_.Set("prettyPrint", "false") 6989 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}/configs/{configId}") 6990 urls += "?" + c.urlParams_.Encode() 6991 req, err := http.NewRequest("GET", urls, body) 6992 if err != nil { 6993 return nil, err 6994 } 6995 req.Header = reqHeaders 6996 googleapi.Expand(req.URL, map[string]string{ 6997 "serviceName": c.serviceName, 6998 "configId": c.configId, 6999 }) 7000 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7001} 7002 7003// Do executes the "servicemanagement.services.configs.get" call. 7004// Exactly one of *Service or error will be non-nil. Any non-2xx status 7005// code is an error. Response headers are in either 7006// *Service.ServerResponse.Header or (if a response was returned at all) 7007// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 7008// check whether the returned error was because http.StatusNotModified 7009// was returned. 7010func (c *ServicesConfigsGetCall) Do(opts ...googleapi.CallOption) (*Service, error) { 7011 gensupport.SetOptions(c.urlParams_, opts...) 7012 res, err := c.doRequest("json") 7013 if res != nil && res.StatusCode == http.StatusNotModified { 7014 if res.Body != nil { 7015 res.Body.Close() 7016 } 7017 return nil, &googleapi.Error{ 7018 Code: res.StatusCode, 7019 Header: res.Header, 7020 } 7021 } 7022 if err != nil { 7023 return nil, err 7024 } 7025 defer googleapi.CloseBody(res) 7026 if err := googleapi.CheckResponse(res); err != nil { 7027 return nil, err 7028 } 7029 ret := &Service{ 7030 ServerResponse: googleapi.ServerResponse{ 7031 Header: res.Header, 7032 HTTPStatusCode: res.StatusCode, 7033 }, 7034 } 7035 target := &ret 7036 if err := gensupport.DecodeResponse(target, res); err != nil { 7037 return nil, err 7038 } 7039 return ret, nil 7040 // { 7041 // "description": "Gets a service configuration (version) for a managed service.", 7042 // "flatPath": "v1/services/{serviceName}/configs/{configId}", 7043 // "httpMethod": "GET", 7044 // "id": "servicemanagement.services.configs.get", 7045 // "parameterOrder": [ 7046 // "serviceName", 7047 // "configId" 7048 // ], 7049 // "parameters": { 7050 // "configId": { 7051 // "description": "Required. The id of the service configuration resource. This field must be specified for the server to return all fields, including `SourceInfo`.", 7052 // "location": "path", 7053 // "required": true, 7054 // "type": "string" 7055 // }, 7056 // "serviceName": { 7057 // "description": "Required. The name of the service. See the [overview](/service-management/overview) for naming requirements. For example: `example.googleapis.com`.", 7058 // "location": "path", 7059 // "required": true, 7060 // "type": "string" 7061 // }, 7062 // "view": { 7063 // "description": "Specifies which parts of the Service Config should be returned in the response.", 7064 // "enum": [ 7065 // "BASIC", 7066 // "FULL" 7067 // ], 7068 // "enumDescriptions": [ 7069 // "Server response includes all fields except SourceInfo.", 7070 // "Server response includes all fields including SourceInfo. SourceFiles are of type 'google.api.servicemanagement.v1.ConfigFile' and are only available for configs created using the SubmitConfigSource method." 7071 // ], 7072 // "location": "query", 7073 // "type": "string" 7074 // } 7075 // }, 7076 // "path": "v1/services/{serviceName}/configs/{configId}", 7077 // "response": { 7078 // "$ref": "Service" 7079 // }, 7080 // "scopes": [ 7081 // "https://www.googleapis.com/auth/cloud-platform", 7082 // "https://www.googleapis.com/auth/cloud-platform.read-only", 7083 // "https://www.googleapis.com/auth/service.management", 7084 // "https://www.googleapis.com/auth/service.management.readonly" 7085 // ] 7086 // } 7087 7088} 7089 7090// method id "servicemanagement.services.configs.list": 7091 7092type ServicesConfigsListCall struct { 7093 s *APIService 7094 serviceName string 7095 urlParams_ gensupport.URLParams 7096 ifNoneMatch_ string 7097 ctx_ context.Context 7098 header_ http.Header 7099} 7100 7101// List: Lists the history of the service configuration for a managed 7102// service, from the newest to the oldest. 7103func (r *ServicesConfigsService) List(serviceName string) *ServicesConfigsListCall { 7104 c := &ServicesConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7105 c.serviceName = serviceName 7106 return c 7107} 7108 7109// PageSize sets the optional parameter "pageSize": The max number of 7110// items to include in the response list. Page size is 50 if not 7111// specified. Maximum value is 100. 7112func (c *ServicesConfigsListCall) PageSize(pageSize int64) *ServicesConfigsListCall { 7113 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 7114 return c 7115} 7116 7117// PageToken sets the optional parameter "pageToken": The token of the 7118// page to retrieve. 7119func (c *ServicesConfigsListCall) PageToken(pageToken string) *ServicesConfigsListCall { 7120 c.urlParams_.Set("pageToken", pageToken) 7121 return c 7122} 7123 7124// Fields allows partial responses to be retrieved. See 7125// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7126// for more information. 7127func (c *ServicesConfigsListCall) Fields(s ...googleapi.Field) *ServicesConfigsListCall { 7128 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7129 return c 7130} 7131 7132// IfNoneMatch sets the optional parameter which makes the operation 7133// fail if the object's ETag matches the given value. This is useful for 7134// getting updates only after the object has changed since the last 7135// request. Use googleapi.IsNotModified to check whether the response 7136// error from Do is the result of In-None-Match. 7137func (c *ServicesConfigsListCall) IfNoneMatch(entityTag string) *ServicesConfigsListCall { 7138 c.ifNoneMatch_ = entityTag 7139 return c 7140} 7141 7142// Context sets the context to be used in this call's Do method. Any 7143// pending HTTP request will be aborted if the provided context is 7144// canceled. 7145func (c *ServicesConfigsListCall) Context(ctx context.Context) *ServicesConfigsListCall { 7146 c.ctx_ = ctx 7147 return c 7148} 7149 7150// Header returns an http.Header that can be modified by the caller to 7151// add HTTP headers to the request. 7152func (c *ServicesConfigsListCall) Header() http.Header { 7153 if c.header_ == nil { 7154 c.header_ = make(http.Header) 7155 } 7156 return c.header_ 7157} 7158 7159func (c *ServicesConfigsListCall) doRequest(alt string) (*http.Response, error) { 7160 reqHeaders := make(http.Header) 7161 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 7162 for k, v := range c.header_ { 7163 reqHeaders[k] = v 7164 } 7165 reqHeaders.Set("User-Agent", c.s.userAgent()) 7166 if c.ifNoneMatch_ != "" { 7167 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7168 } 7169 var body io.Reader = nil 7170 c.urlParams_.Set("alt", alt) 7171 c.urlParams_.Set("prettyPrint", "false") 7172 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}/configs") 7173 urls += "?" + c.urlParams_.Encode() 7174 req, err := http.NewRequest("GET", urls, body) 7175 if err != nil { 7176 return nil, err 7177 } 7178 req.Header = reqHeaders 7179 googleapi.Expand(req.URL, map[string]string{ 7180 "serviceName": c.serviceName, 7181 }) 7182 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7183} 7184 7185// Do executes the "servicemanagement.services.configs.list" call. 7186// Exactly one of *ListServiceConfigsResponse or error will be non-nil. 7187// Any non-2xx status code is an error. Response headers are in either 7188// *ListServiceConfigsResponse.ServerResponse.Header or (if a response 7189// was returned at all) in error.(*googleapi.Error).Header. Use 7190// googleapi.IsNotModified to check whether the returned error was 7191// because http.StatusNotModified was returned. 7192func (c *ServicesConfigsListCall) Do(opts ...googleapi.CallOption) (*ListServiceConfigsResponse, error) { 7193 gensupport.SetOptions(c.urlParams_, opts...) 7194 res, err := c.doRequest("json") 7195 if res != nil && res.StatusCode == http.StatusNotModified { 7196 if res.Body != nil { 7197 res.Body.Close() 7198 } 7199 return nil, &googleapi.Error{ 7200 Code: res.StatusCode, 7201 Header: res.Header, 7202 } 7203 } 7204 if err != nil { 7205 return nil, err 7206 } 7207 defer googleapi.CloseBody(res) 7208 if err := googleapi.CheckResponse(res); err != nil { 7209 return nil, err 7210 } 7211 ret := &ListServiceConfigsResponse{ 7212 ServerResponse: googleapi.ServerResponse{ 7213 Header: res.Header, 7214 HTTPStatusCode: res.StatusCode, 7215 }, 7216 } 7217 target := &ret 7218 if err := gensupport.DecodeResponse(target, res); err != nil { 7219 return nil, err 7220 } 7221 return ret, nil 7222 // { 7223 // "description": "Lists the history of the service configuration for a managed service, from the newest to the oldest.", 7224 // "flatPath": "v1/services/{serviceName}/configs", 7225 // "httpMethod": "GET", 7226 // "id": "servicemanagement.services.configs.list", 7227 // "parameterOrder": [ 7228 // "serviceName" 7229 // ], 7230 // "parameters": { 7231 // "pageSize": { 7232 // "description": "The max number of items to include in the response list. Page size is 50 if not specified. Maximum value is 100.", 7233 // "format": "int32", 7234 // "location": "query", 7235 // "type": "integer" 7236 // }, 7237 // "pageToken": { 7238 // "description": "The token of the page to retrieve.", 7239 // "location": "query", 7240 // "type": "string" 7241 // }, 7242 // "serviceName": { 7243 // "description": "Required. The name of the service. See the [overview](/service-management/overview) for naming requirements. For example: `example.googleapis.com`.", 7244 // "location": "path", 7245 // "required": true, 7246 // "type": "string" 7247 // } 7248 // }, 7249 // "path": "v1/services/{serviceName}/configs", 7250 // "response": { 7251 // "$ref": "ListServiceConfigsResponse" 7252 // }, 7253 // "scopes": [ 7254 // "https://www.googleapis.com/auth/cloud-platform", 7255 // "https://www.googleapis.com/auth/cloud-platform.read-only", 7256 // "https://www.googleapis.com/auth/service.management", 7257 // "https://www.googleapis.com/auth/service.management.readonly" 7258 // ] 7259 // } 7260 7261} 7262 7263// Pages invokes f for each page of results. 7264// A non-nil error returned from f will halt the iteration. 7265// The provided context supersedes any context provided to the Context method. 7266func (c *ServicesConfigsListCall) Pages(ctx context.Context, f func(*ListServiceConfigsResponse) error) error { 7267 c.ctx_ = ctx 7268 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 7269 for { 7270 x, err := c.Do() 7271 if err != nil { 7272 return err 7273 } 7274 if err := f(x); err != nil { 7275 return err 7276 } 7277 if x.NextPageToken == "" { 7278 return nil 7279 } 7280 c.PageToken(x.NextPageToken) 7281 } 7282} 7283 7284// method id "servicemanagement.services.configs.submit": 7285 7286type ServicesConfigsSubmitCall struct { 7287 s *APIService 7288 serviceName string 7289 submitconfigsourcerequest *SubmitConfigSourceRequest 7290 urlParams_ gensupport.URLParams 7291 ctx_ context.Context 7292 header_ http.Header 7293} 7294 7295// Submit: Creates a new service configuration (version) for a managed 7296// service based on user-supplied configuration source files (for 7297// example: OpenAPI Specification). This method stores the source 7298// configurations as well as the generated service configuration. To 7299// rollout the service configuration to other services, please call 7300// CreateServiceRollout. Only the 100 most recent configuration sources 7301// and ones referenced by existing service configurtions are kept for 7302// each service. The rest will be deleted eventually. Operation 7303func (r *ServicesConfigsService) Submit(serviceName string, submitconfigsourcerequest *SubmitConfigSourceRequest) *ServicesConfigsSubmitCall { 7304 c := &ServicesConfigsSubmitCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7305 c.serviceName = serviceName 7306 c.submitconfigsourcerequest = submitconfigsourcerequest 7307 return c 7308} 7309 7310// Fields allows partial responses to be retrieved. See 7311// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7312// for more information. 7313func (c *ServicesConfigsSubmitCall) Fields(s ...googleapi.Field) *ServicesConfigsSubmitCall { 7314 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7315 return c 7316} 7317 7318// Context sets the context to be used in this call's Do method. Any 7319// pending HTTP request will be aborted if the provided context is 7320// canceled. 7321func (c *ServicesConfigsSubmitCall) Context(ctx context.Context) *ServicesConfigsSubmitCall { 7322 c.ctx_ = ctx 7323 return c 7324} 7325 7326// Header returns an http.Header that can be modified by the caller to 7327// add HTTP headers to the request. 7328func (c *ServicesConfigsSubmitCall) Header() http.Header { 7329 if c.header_ == nil { 7330 c.header_ = make(http.Header) 7331 } 7332 return c.header_ 7333} 7334 7335func (c *ServicesConfigsSubmitCall) doRequest(alt string) (*http.Response, error) { 7336 reqHeaders := make(http.Header) 7337 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 7338 for k, v := range c.header_ { 7339 reqHeaders[k] = v 7340 } 7341 reqHeaders.Set("User-Agent", c.s.userAgent()) 7342 var body io.Reader = nil 7343 body, err := googleapi.WithoutDataWrapper.JSONReader(c.submitconfigsourcerequest) 7344 if err != nil { 7345 return nil, err 7346 } 7347 reqHeaders.Set("Content-Type", "application/json") 7348 c.urlParams_.Set("alt", alt) 7349 c.urlParams_.Set("prettyPrint", "false") 7350 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}/configs:submit") 7351 urls += "?" + c.urlParams_.Encode() 7352 req, err := http.NewRequest("POST", urls, body) 7353 if err != nil { 7354 return nil, err 7355 } 7356 req.Header = reqHeaders 7357 googleapi.Expand(req.URL, map[string]string{ 7358 "serviceName": c.serviceName, 7359 }) 7360 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7361} 7362 7363// Do executes the "servicemanagement.services.configs.submit" call. 7364// Exactly one of *Operation or error will be non-nil. Any non-2xx 7365// status code is an error. Response headers are in either 7366// *Operation.ServerResponse.Header or (if a response was returned at 7367// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7368// to check whether the returned error was because 7369// http.StatusNotModified was returned. 7370func (c *ServicesConfigsSubmitCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 7371 gensupport.SetOptions(c.urlParams_, opts...) 7372 res, err := c.doRequest("json") 7373 if res != nil && res.StatusCode == http.StatusNotModified { 7374 if res.Body != nil { 7375 res.Body.Close() 7376 } 7377 return nil, &googleapi.Error{ 7378 Code: res.StatusCode, 7379 Header: res.Header, 7380 } 7381 } 7382 if err != nil { 7383 return nil, err 7384 } 7385 defer googleapi.CloseBody(res) 7386 if err := googleapi.CheckResponse(res); err != nil { 7387 return nil, err 7388 } 7389 ret := &Operation{ 7390 ServerResponse: googleapi.ServerResponse{ 7391 Header: res.Header, 7392 HTTPStatusCode: res.StatusCode, 7393 }, 7394 } 7395 target := &ret 7396 if err := gensupport.DecodeResponse(target, res); err != nil { 7397 return nil, err 7398 } 7399 return ret, nil 7400 // { 7401 // "description": "Creates a new service configuration (version) for a managed service based on user-supplied configuration source files (for example: OpenAPI Specification). This method stores the source configurations as well as the generated service configuration. To rollout the service configuration to other services, please call CreateServiceRollout. Only the 100 most recent configuration sources and ones referenced by existing service configurtions are kept for each service. The rest will be deleted eventually. Operation", 7402 // "flatPath": "v1/services/{serviceName}/configs:submit", 7403 // "httpMethod": "POST", 7404 // "id": "servicemanagement.services.configs.submit", 7405 // "parameterOrder": [ 7406 // "serviceName" 7407 // ], 7408 // "parameters": { 7409 // "serviceName": { 7410 // "description": "Required. The name of the service. See the [overview](/service-management/overview) for naming requirements. For example: `example.googleapis.com`.", 7411 // "location": "path", 7412 // "required": true, 7413 // "type": "string" 7414 // } 7415 // }, 7416 // "path": "v1/services/{serviceName}/configs:submit", 7417 // "request": { 7418 // "$ref": "SubmitConfigSourceRequest" 7419 // }, 7420 // "response": { 7421 // "$ref": "Operation" 7422 // }, 7423 // "scopes": [ 7424 // "https://www.googleapis.com/auth/cloud-platform", 7425 // "https://www.googleapis.com/auth/service.management" 7426 // ] 7427 // } 7428 7429} 7430 7431// method id "servicemanagement.services.consumers.getIamPolicy": 7432 7433type ServicesConsumersGetIamPolicyCall struct { 7434 s *APIService 7435 resource string 7436 getiampolicyrequest *GetIamPolicyRequest 7437 urlParams_ gensupport.URLParams 7438 ctx_ context.Context 7439 header_ http.Header 7440} 7441 7442// GetIamPolicy: Gets the access control policy for a resource. Returns 7443// an empty policy if the resource exists and does not have a policy 7444// set. 7445func (r *ServicesConsumersService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ServicesConsumersGetIamPolicyCall { 7446 c := &ServicesConsumersGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7447 c.resource = resource 7448 c.getiampolicyrequest = getiampolicyrequest 7449 return c 7450} 7451 7452// Fields allows partial responses to be retrieved. See 7453// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7454// for more information. 7455func (c *ServicesConsumersGetIamPolicyCall) Fields(s ...googleapi.Field) *ServicesConsumersGetIamPolicyCall { 7456 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7457 return c 7458} 7459 7460// Context sets the context to be used in this call's Do method. Any 7461// pending HTTP request will be aborted if the provided context is 7462// canceled. 7463func (c *ServicesConsumersGetIamPolicyCall) Context(ctx context.Context) *ServicesConsumersGetIamPolicyCall { 7464 c.ctx_ = ctx 7465 return c 7466} 7467 7468// Header returns an http.Header that can be modified by the caller to 7469// add HTTP headers to the request. 7470func (c *ServicesConsumersGetIamPolicyCall) Header() http.Header { 7471 if c.header_ == nil { 7472 c.header_ = make(http.Header) 7473 } 7474 return c.header_ 7475} 7476 7477func (c *ServicesConsumersGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 7478 reqHeaders := make(http.Header) 7479 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 7480 for k, v := range c.header_ { 7481 reqHeaders[k] = v 7482 } 7483 reqHeaders.Set("User-Agent", c.s.userAgent()) 7484 var body io.Reader = nil 7485 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) 7486 if err != nil { 7487 return nil, err 7488 } 7489 reqHeaders.Set("Content-Type", "application/json") 7490 c.urlParams_.Set("alt", alt) 7491 c.urlParams_.Set("prettyPrint", "false") 7492 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") 7493 urls += "?" + c.urlParams_.Encode() 7494 req, err := http.NewRequest("POST", urls, body) 7495 if err != nil { 7496 return nil, err 7497 } 7498 req.Header = reqHeaders 7499 googleapi.Expand(req.URL, map[string]string{ 7500 "resource": c.resource, 7501 }) 7502 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7503} 7504 7505// Do executes the "servicemanagement.services.consumers.getIamPolicy" call. 7506// Exactly one of *Policy or error will be non-nil. Any non-2xx status 7507// code is an error. Response headers are in either 7508// *Policy.ServerResponse.Header or (if a response was returned at all) 7509// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 7510// check whether the returned error was because http.StatusNotModified 7511// was returned. 7512func (c *ServicesConsumersGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 7513 gensupport.SetOptions(c.urlParams_, opts...) 7514 res, err := c.doRequest("json") 7515 if res != nil && res.StatusCode == http.StatusNotModified { 7516 if res.Body != nil { 7517 res.Body.Close() 7518 } 7519 return nil, &googleapi.Error{ 7520 Code: res.StatusCode, 7521 Header: res.Header, 7522 } 7523 } 7524 if err != nil { 7525 return nil, err 7526 } 7527 defer googleapi.CloseBody(res) 7528 if err := googleapi.CheckResponse(res); err != nil { 7529 return nil, err 7530 } 7531 ret := &Policy{ 7532 ServerResponse: googleapi.ServerResponse{ 7533 Header: res.Header, 7534 HTTPStatusCode: res.StatusCode, 7535 }, 7536 } 7537 target := &ret 7538 if err := gensupport.DecodeResponse(target, res); err != nil { 7539 return nil, err 7540 } 7541 return ret, nil 7542 // { 7543 // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", 7544 // "flatPath": "v1/services/{servicesId}/consumers/{consumersId}:getIamPolicy", 7545 // "httpMethod": "POST", 7546 // "id": "servicemanagement.services.consumers.getIamPolicy", 7547 // "parameterOrder": [ 7548 // "resource" 7549 // ], 7550 // "parameters": { 7551 // "resource": { 7552 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 7553 // "location": "path", 7554 // "pattern": "^services/[^/]+/consumers/[^/]+$", 7555 // "required": true, 7556 // "type": "string" 7557 // } 7558 // }, 7559 // "path": "v1/{+resource}:getIamPolicy", 7560 // "request": { 7561 // "$ref": "GetIamPolicyRequest" 7562 // }, 7563 // "response": { 7564 // "$ref": "Policy" 7565 // }, 7566 // "scopes": [ 7567 // "https://www.googleapis.com/auth/cloud-platform", 7568 // "https://www.googleapis.com/auth/cloud-platform.read-only", 7569 // "https://www.googleapis.com/auth/service.management", 7570 // "https://www.googleapis.com/auth/service.management.readonly" 7571 // ] 7572 // } 7573 7574} 7575 7576// method id "servicemanagement.services.consumers.setIamPolicy": 7577 7578type ServicesConsumersSetIamPolicyCall struct { 7579 s *APIService 7580 resource string 7581 setiampolicyrequest *SetIamPolicyRequest 7582 urlParams_ gensupport.URLParams 7583 ctx_ context.Context 7584 header_ http.Header 7585} 7586 7587// SetIamPolicy: Sets the access control policy on the specified 7588// resource. Replaces any existing policy. Can return `NOT_FOUND`, 7589// `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. 7590func (r *ServicesConsumersService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ServicesConsumersSetIamPolicyCall { 7591 c := &ServicesConsumersSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7592 c.resource = resource 7593 c.setiampolicyrequest = setiampolicyrequest 7594 return c 7595} 7596 7597// Fields allows partial responses to be retrieved. See 7598// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7599// for more information. 7600func (c *ServicesConsumersSetIamPolicyCall) Fields(s ...googleapi.Field) *ServicesConsumersSetIamPolicyCall { 7601 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7602 return c 7603} 7604 7605// Context sets the context to be used in this call's Do method. Any 7606// pending HTTP request will be aborted if the provided context is 7607// canceled. 7608func (c *ServicesConsumersSetIamPolicyCall) Context(ctx context.Context) *ServicesConsumersSetIamPolicyCall { 7609 c.ctx_ = ctx 7610 return c 7611} 7612 7613// Header returns an http.Header that can be modified by the caller to 7614// add HTTP headers to the request. 7615func (c *ServicesConsumersSetIamPolicyCall) Header() http.Header { 7616 if c.header_ == nil { 7617 c.header_ = make(http.Header) 7618 } 7619 return c.header_ 7620} 7621 7622func (c *ServicesConsumersSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 7623 reqHeaders := make(http.Header) 7624 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 7625 for k, v := range c.header_ { 7626 reqHeaders[k] = v 7627 } 7628 reqHeaders.Set("User-Agent", c.s.userAgent()) 7629 var body io.Reader = nil 7630 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 7631 if err != nil { 7632 return nil, err 7633 } 7634 reqHeaders.Set("Content-Type", "application/json") 7635 c.urlParams_.Set("alt", alt) 7636 c.urlParams_.Set("prettyPrint", "false") 7637 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy") 7638 urls += "?" + c.urlParams_.Encode() 7639 req, err := http.NewRequest("POST", urls, body) 7640 if err != nil { 7641 return nil, err 7642 } 7643 req.Header = reqHeaders 7644 googleapi.Expand(req.URL, map[string]string{ 7645 "resource": c.resource, 7646 }) 7647 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7648} 7649 7650// Do executes the "servicemanagement.services.consumers.setIamPolicy" call. 7651// Exactly one of *Policy or error will be non-nil. Any non-2xx status 7652// code is an error. Response headers are in either 7653// *Policy.ServerResponse.Header or (if a response was returned at all) 7654// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 7655// check whether the returned error was because http.StatusNotModified 7656// was returned. 7657func (c *ServicesConsumersSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 7658 gensupport.SetOptions(c.urlParams_, opts...) 7659 res, err := c.doRequest("json") 7660 if res != nil && res.StatusCode == http.StatusNotModified { 7661 if res.Body != nil { 7662 res.Body.Close() 7663 } 7664 return nil, &googleapi.Error{ 7665 Code: res.StatusCode, 7666 Header: res.Header, 7667 } 7668 } 7669 if err != nil { 7670 return nil, err 7671 } 7672 defer googleapi.CloseBody(res) 7673 if err := googleapi.CheckResponse(res); err != nil { 7674 return nil, err 7675 } 7676 ret := &Policy{ 7677 ServerResponse: googleapi.ServerResponse{ 7678 Header: res.Header, 7679 HTTPStatusCode: res.StatusCode, 7680 }, 7681 } 7682 target := &ret 7683 if err := gensupport.DecodeResponse(target, res); err != nil { 7684 return nil, err 7685 } 7686 return ret, nil 7687 // { 7688 // "description": "Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.", 7689 // "flatPath": "v1/services/{servicesId}/consumers/{consumersId}:setIamPolicy", 7690 // "httpMethod": "POST", 7691 // "id": "servicemanagement.services.consumers.setIamPolicy", 7692 // "parameterOrder": [ 7693 // "resource" 7694 // ], 7695 // "parameters": { 7696 // "resource": { 7697 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 7698 // "location": "path", 7699 // "pattern": "^services/[^/]+/consumers/[^/]+$", 7700 // "required": true, 7701 // "type": "string" 7702 // } 7703 // }, 7704 // "path": "v1/{+resource}:setIamPolicy", 7705 // "request": { 7706 // "$ref": "SetIamPolicyRequest" 7707 // }, 7708 // "response": { 7709 // "$ref": "Policy" 7710 // }, 7711 // "scopes": [ 7712 // "https://www.googleapis.com/auth/cloud-platform", 7713 // "https://www.googleapis.com/auth/service.management" 7714 // ] 7715 // } 7716 7717} 7718 7719// method id "servicemanagement.services.consumers.testIamPermissions": 7720 7721type ServicesConsumersTestIamPermissionsCall struct { 7722 s *APIService 7723 resource string 7724 testiampermissionsrequest *TestIamPermissionsRequest 7725 urlParams_ gensupport.URLParams 7726 ctx_ context.Context 7727 header_ http.Header 7728} 7729 7730// TestIamPermissions: Returns permissions that a caller has on the 7731// specified resource. If the resource does not exist, this will return 7732// an empty set of permissions, not a `NOT_FOUND` error. Note: This 7733// operation is designed to be used for building permission-aware UIs 7734// and command-line tools, not for authorization checking. This 7735// operation may "fail open" without warning. 7736func (r *ServicesConsumersService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ServicesConsumersTestIamPermissionsCall { 7737 c := &ServicesConsumersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7738 c.resource = resource 7739 c.testiampermissionsrequest = testiampermissionsrequest 7740 return c 7741} 7742 7743// Fields allows partial responses to be retrieved. See 7744// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7745// for more information. 7746func (c *ServicesConsumersTestIamPermissionsCall) Fields(s ...googleapi.Field) *ServicesConsumersTestIamPermissionsCall { 7747 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7748 return c 7749} 7750 7751// Context sets the context to be used in this call's Do method. Any 7752// pending HTTP request will be aborted if the provided context is 7753// canceled. 7754func (c *ServicesConsumersTestIamPermissionsCall) Context(ctx context.Context) *ServicesConsumersTestIamPermissionsCall { 7755 c.ctx_ = ctx 7756 return c 7757} 7758 7759// Header returns an http.Header that can be modified by the caller to 7760// add HTTP headers to the request. 7761func (c *ServicesConsumersTestIamPermissionsCall) Header() http.Header { 7762 if c.header_ == nil { 7763 c.header_ = make(http.Header) 7764 } 7765 return c.header_ 7766} 7767 7768func (c *ServicesConsumersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 7769 reqHeaders := make(http.Header) 7770 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 7771 for k, v := range c.header_ { 7772 reqHeaders[k] = v 7773 } 7774 reqHeaders.Set("User-Agent", c.s.userAgent()) 7775 var body io.Reader = nil 7776 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 7777 if err != nil { 7778 return nil, err 7779 } 7780 reqHeaders.Set("Content-Type", "application/json") 7781 c.urlParams_.Set("alt", alt) 7782 c.urlParams_.Set("prettyPrint", "false") 7783 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions") 7784 urls += "?" + c.urlParams_.Encode() 7785 req, err := http.NewRequest("POST", urls, body) 7786 if err != nil { 7787 return nil, err 7788 } 7789 req.Header = reqHeaders 7790 googleapi.Expand(req.URL, map[string]string{ 7791 "resource": c.resource, 7792 }) 7793 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7794} 7795 7796// Do executes the "servicemanagement.services.consumers.testIamPermissions" call. 7797// Exactly one of *TestIamPermissionsResponse or error will be non-nil. 7798// Any non-2xx status code is an error. Response headers are in either 7799// *TestIamPermissionsResponse.ServerResponse.Header or (if a response 7800// was returned at all) in error.(*googleapi.Error).Header. Use 7801// googleapi.IsNotModified to check whether the returned error was 7802// because http.StatusNotModified was returned. 7803func (c *ServicesConsumersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 7804 gensupport.SetOptions(c.urlParams_, opts...) 7805 res, err := c.doRequest("json") 7806 if res != nil && res.StatusCode == http.StatusNotModified { 7807 if res.Body != nil { 7808 res.Body.Close() 7809 } 7810 return nil, &googleapi.Error{ 7811 Code: res.StatusCode, 7812 Header: res.Header, 7813 } 7814 } 7815 if err != nil { 7816 return nil, err 7817 } 7818 defer googleapi.CloseBody(res) 7819 if err := googleapi.CheckResponse(res); err != nil { 7820 return nil, err 7821 } 7822 ret := &TestIamPermissionsResponse{ 7823 ServerResponse: googleapi.ServerResponse{ 7824 Header: res.Header, 7825 HTTPStatusCode: res.StatusCode, 7826 }, 7827 } 7828 target := &ret 7829 if err := gensupport.DecodeResponse(target, res); err != nil { 7830 return nil, err 7831 } 7832 return ret, nil 7833 // { 7834 // "description": "Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.", 7835 // "flatPath": "v1/services/{servicesId}/consumers/{consumersId}:testIamPermissions", 7836 // "httpMethod": "POST", 7837 // "id": "servicemanagement.services.consumers.testIamPermissions", 7838 // "parameterOrder": [ 7839 // "resource" 7840 // ], 7841 // "parameters": { 7842 // "resource": { 7843 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 7844 // "location": "path", 7845 // "pattern": "^services/[^/]+/consumers/[^/]+$", 7846 // "required": true, 7847 // "type": "string" 7848 // } 7849 // }, 7850 // "path": "v1/{+resource}:testIamPermissions", 7851 // "request": { 7852 // "$ref": "TestIamPermissionsRequest" 7853 // }, 7854 // "response": { 7855 // "$ref": "TestIamPermissionsResponse" 7856 // }, 7857 // "scopes": [ 7858 // "https://www.googleapis.com/auth/cloud-platform", 7859 // "https://www.googleapis.com/auth/cloud-platform.read-only", 7860 // "https://www.googleapis.com/auth/service.management", 7861 // "https://www.googleapis.com/auth/service.management.readonly" 7862 // ] 7863 // } 7864 7865} 7866 7867// method id "servicemanagement.services.rollouts.create": 7868 7869type ServicesRolloutsCreateCall struct { 7870 s *APIService 7871 serviceName string 7872 rollout *Rollout 7873 urlParams_ gensupport.URLParams 7874 ctx_ context.Context 7875 header_ http.Header 7876} 7877 7878// Create: Creates a new service configuration rollout. Based on 7879// rollout, the Google Service Management will roll out the service 7880// configurations to different backend services. For example, the 7881// logging configuration will be pushed to Google Cloud Logging. Please 7882// note that any previous pending and running Rollouts and associated 7883// Operations will be automatically cancelled so that the latest Rollout 7884// will not be blocked by previous Rollouts. Only the 100 most recent 7885// (in any state) and the last 10 successful (if not already part of the 7886// set of 100 most recent) rollouts are kept for each service. The rest 7887// will be deleted eventually. Operation 7888func (r *ServicesRolloutsService) Create(serviceName string, rollout *Rollout) *ServicesRolloutsCreateCall { 7889 c := &ServicesRolloutsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7890 c.serviceName = serviceName 7891 c.rollout = rollout 7892 return c 7893} 7894 7895// Fields allows partial responses to be retrieved. See 7896// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7897// for more information. 7898func (c *ServicesRolloutsCreateCall) Fields(s ...googleapi.Field) *ServicesRolloutsCreateCall { 7899 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7900 return c 7901} 7902 7903// Context sets the context to be used in this call's Do method. Any 7904// pending HTTP request will be aborted if the provided context is 7905// canceled. 7906func (c *ServicesRolloutsCreateCall) Context(ctx context.Context) *ServicesRolloutsCreateCall { 7907 c.ctx_ = ctx 7908 return c 7909} 7910 7911// Header returns an http.Header that can be modified by the caller to 7912// add HTTP headers to the request. 7913func (c *ServicesRolloutsCreateCall) Header() http.Header { 7914 if c.header_ == nil { 7915 c.header_ = make(http.Header) 7916 } 7917 return c.header_ 7918} 7919 7920func (c *ServicesRolloutsCreateCall) doRequest(alt string) (*http.Response, error) { 7921 reqHeaders := make(http.Header) 7922 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 7923 for k, v := range c.header_ { 7924 reqHeaders[k] = v 7925 } 7926 reqHeaders.Set("User-Agent", c.s.userAgent()) 7927 var body io.Reader = nil 7928 body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollout) 7929 if err != nil { 7930 return nil, err 7931 } 7932 reqHeaders.Set("Content-Type", "application/json") 7933 c.urlParams_.Set("alt", alt) 7934 c.urlParams_.Set("prettyPrint", "false") 7935 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}/rollouts") 7936 urls += "?" + c.urlParams_.Encode() 7937 req, err := http.NewRequest("POST", urls, body) 7938 if err != nil { 7939 return nil, err 7940 } 7941 req.Header = reqHeaders 7942 googleapi.Expand(req.URL, map[string]string{ 7943 "serviceName": c.serviceName, 7944 }) 7945 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7946} 7947 7948// Do executes the "servicemanagement.services.rollouts.create" call. 7949// Exactly one of *Operation or error will be non-nil. Any non-2xx 7950// status code is an error. Response headers are in either 7951// *Operation.ServerResponse.Header or (if a response was returned at 7952// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7953// to check whether the returned error was because 7954// http.StatusNotModified was returned. 7955func (c *ServicesRolloutsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 7956 gensupport.SetOptions(c.urlParams_, opts...) 7957 res, err := c.doRequest("json") 7958 if res != nil && res.StatusCode == http.StatusNotModified { 7959 if res.Body != nil { 7960 res.Body.Close() 7961 } 7962 return nil, &googleapi.Error{ 7963 Code: res.StatusCode, 7964 Header: res.Header, 7965 } 7966 } 7967 if err != nil { 7968 return nil, err 7969 } 7970 defer googleapi.CloseBody(res) 7971 if err := googleapi.CheckResponse(res); err != nil { 7972 return nil, err 7973 } 7974 ret := &Operation{ 7975 ServerResponse: googleapi.ServerResponse{ 7976 Header: res.Header, 7977 HTTPStatusCode: res.StatusCode, 7978 }, 7979 } 7980 target := &ret 7981 if err := gensupport.DecodeResponse(target, res); err != nil { 7982 return nil, err 7983 } 7984 return ret, nil 7985 // { 7986 // "description": "Creates a new service configuration rollout. Based on rollout, the Google Service Management will roll out the service configurations to different backend services. For example, the logging configuration will be pushed to Google Cloud Logging. Please note that any previous pending and running Rollouts and associated Operations will be automatically cancelled so that the latest Rollout will not be blocked by previous Rollouts. Only the 100 most recent (in any state) and the last 10 successful (if not already part of the set of 100 most recent) rollouts are kept for each service. The rest will be deleted eventually. Operation", 7987 // "flatPath": "v1/services/{serviceName}/rollouts", 7988 // "httpMethod": "POST", 7989 // "id": "servicemanagement.services.rollouts.create", 7990 // "parameterOrder": [ 7991 // "serviceName" 7992 // ], 7993 // "parameters": { 7994 // "serviceName": { 7995 // "description": "Required. The name of the service. See the [overview](/service-management/overview) for naming requirements. For example: `example.googleapis.com`.", 7996 // "location": "path", 7997 // "required": true, 7998 // "type": "string" 7999 // } 8000 // }, 8001 // "path": "v1/services/{serviceName}/rollouts", 8002 // "request": { 8003 // "$ref": "Rollout" 8004 // }, 8005 // "response": { 8006 // "$ref": "Operation" 8007 // }, 8008 // "scopes": [ 8009 // "https://www.googleapis.com/auth/cloud-platform", 8010 // "https://www.googleapis.com/auth/service.management" 8011 // ] 8012 // } 8013 8014} 8015 8016// method id "servicemanagement.services.rollouts.get": 8017 8018type ServicesRolloutsGetCall struct { 8019 s *APIService 8020 serviceName string 8021 rolloutId string 8022 urlParams_ gensupport.URLParams 8023 ifNoneMatch_ string 8024 ctx_ context.Context 8025 header_ http.Header 8026} 8027 8028// Get: Gets a service configuration rollout. 8029func (r *ServicesRolloutsService) Get(serviceName string, rolloutId string) *ServicesRolloutsGetCall { 8030 c := &ServicesRolloutsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8031 c.serviceName = serviceName 8032 c.rolloutId = rolloutId 8033 return c 8034} 8035 8036// Fields allows partial responses to be retrieved. See 8037// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8038// for more information. 8039func (c *ServicesRolloutsGetCall) Fields(s ...googleapi.Field) *ServicesRolloutsGetCall { 8040 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8041 return c 8042} 8043 8044// IfNoneMatch sets the optional parameter which makes the operation 8045// fail if the object's ETag matches the given value. This is useful for 8046// getting updates only after the object has changed since the last 8047// request. Use googleapi.IsNotModified to check whether the response 8048// error from Do is the result of In-None-Match. 8049func (c *ServicesRolloutsGetCall) IfNoneMatch(entityTag string) *ServicesRolloutsGetCall { 8050 c.ifNoneMatch_ = entityTag 8051 return c 8052} 8053 8054// Context sets the context to be used in this call's Do method. Any 8055// pending HTTP request will be aborted if the provided context is 8056// canceled. 8057func (c *ServicesRolloutsGetCall) Context(ctx context.Context) *ServicesRolloutsGetCall { 8058 c.ctx_ = ctx 8059 return c 8060} 8061 8062// Header returns an http.Header that can be modified by the caller to 8063// add HTTP headers to the request. 8064func (c *ServicesRolloutsGetCall) Header() http.Header { 8065 if c.header_ == nil { 8066 c.header_ = make(http.Header) 8067 } 8068 return c.header_ 8069} 8070 8071func (c *ServicesRolloutsGetCall) doRequest(alt string) (*http.Response, error) { 8072 reqHeaders := make(http.Header) 8073 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 8074 for k, v := range c.header_ { 8075 reqHeaders[k] = v 8076 } 8077 reqHeaders.Set("User-Agent", c.s.userAgent()) 8078 if c.ifNoneMatch_ != "" { 8079 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8080 } 8081 var body io.Reader = nil 8082 c.urlParams_.Set("alt", alt) 8083 c.urlParams_.Set("prettyPrint", "false") 8084 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}/rollouts/{rolloutId}") 8085 urls += "?" + c.urlParams_.Encode() 8086 req, err := http.NewRequest("GET", urls, body) 8087 if err != nil { 8088 return nil, err 8089 } 8090 req.Header = reqHeaders 8091 googleapi.Expand(req.URL, map[string]string{ 8092 "serviceName": c.serviceName, 8093 "rolloutId": c.rolloutId, 8094 }) 8095 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8096} 8097 8098// Do executes the "servicemanagement.services.rollouts.get" call. 8099// Exactly one of *Rollout or error will be non-nil. Any non-2xx status 8100// code is an error. Response headers are in either 8101// *Rollout.ServerResponse.Header or (if a response was returned at all) 8102// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8103// check whether the returned error was because http.StatusNotModified 8104// was returned. 8105func (c *ServicesRolloutsGetCall) Do(opts ...googleapi.CallOption) (*Rollout, error) { 8106 gensupport.SetOptions(c.urlParams_, opts...) 8107 res, err := c.doRequest("json") 8108 if res != nil && res.StatusCode == http.StatusNotModified { 8109 if res.Body != nil { 8110 res.Body.Close() 8111 } 8112 return nil, &googleapi.Error{ 8113 Code: res.StatusCode, 8114 Header: res.Header, 8115 } 8116 } 8117 if err != nil { 8118 return nil, err 8119 } 8120 defer googleapi.CloseBody(res) 8121 if err := googleapi.CheckResponse(res); err != nil { 8122 return nil, err 8123 } 8124 ret := &Rollout{ 8125 ServerResponse: googleapi.ServerResponse{ 8126 Header: res.Header, 8127 HTTPStatusCode: res.StatusCode, 8128 }, 8129 } 8130 target := &ret 8131 if err := gensupport.DecodeResponse(target, res); err != nil { 8132 return nil, err 8133 } 8134 return ret, nil 8135 // { 8136 // "description": "Gets a service configuration rollout.", 8137 // "flatPath": "v1/services/{serviceName}/rollouts/{rolloutId}", 8138 // "httpMethod": "GET", 8139 // "id": "servicemanagement.services.rollouts.get", 8140 // "parameterOrder": [ 8141 // "serviceName", 8142 // "rolloutId" 8143 // ], 8144 // "parameters": { 8145 // "rolloutId": { 8146 // "description": "Required. The id of the rollout resource.", 8147 // "location": "path", 8148 // "required": true, 8149 // "type": "string" 8150 // }, 8151 // "serviceName": { 8152 // "description": "Required. The name of the service. See the [overview](/service-management/overview) for naming requirements. For example: `example.googleapis.com`.", 8153 // "location": "path", 8154 // "required": true, 8155 // "type": "string" 8156 // } 8157 // }, 8158 // "path": "v1/services/{serviceName}/rollouts/{rolloutId}", 8159 // "response": { 8160 // "$ref": "Rollout" 8161 // }, 8162 // "scopes": [ 8163 // "https://www.googleapis.com/auth/cloud-platform", 8164 // "https://www.googleapis.com/auth/cloud-platform.read-only", 8165 // "https://www.googleapis.com/auth/service.management", 8166 // "https://www.googleapis.com/auth/service.management.readonly" 8167 // ] 8168 // } 8169 8170} 8171 8172// method id "servicemanagement.services.rollouts.list": 8173 8174type ServicesRolloutsListCall struct { 8175 s *APIService 8176 serviceName string 8177 urlParams_ gensupport.URLParams 8178 ifNoneMatch_ string 8179 ctx_ context.Context 8180 header_ http.Header 8181} 8182 8183// List: Lists the history of the service configuration rollouts for a 8184// managed service, from the newest to the oldest. 8185func (r *ServicesRolloutsService) List(serviceName string) *ServicesRolloutsListCall { 8186 c := &ServicesRolloutsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8187 c.serviceName = serviceName 8188 return c 8189} 8190 8191// Filter sets the optional parameter "filter": Required. Use `filter` 8192// to return subset of rollouts. The following filters are supported: -- 8193// To limit the results to only those in 8194// [status](google.api.servicemanagement.v1.RolloutStatus) 'SUCCESS', 8195// use filter='status=SUCCESS' -- To limit the results to those in 8196// [status](google.api.servicemanagement.v1.RolloutStatus) 'CANCELLED' 8197// or 'FAILED', use filter='status=CANCELLED OR status=FAILED' 8198func (c *ServicesRolloutsListCall) Filter(filter string) *ServicesRolloutsListCall { 8199 c.urlParams_.Set("filter", filter) 8200 return c 8201} 8202 8203// PageSize sets the optional parameter "pageSize": The max number of 8204// items to include in the response list. Page size is 50 if not 8205// specified. Maximum value is 100. 8206func (c *ServicesRolloutsListCall) PageSize(pageSize int64) *ServicesRolloutsListCall { 8207 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 8208 return c 8209} 8210 8211// PageToken sets the optional parameter "pageToken": The token of the 8212// page to retrieve. 8213func (c *ServicesRolloutsListCall) PageToken(pageToken string) *ServicesRolloutsListCall { 8214 c.urlParams_.Set("pageToken", pageToken) 8215 return c 8216} 8217 8218// Fields allows partial responses to be retrieved. See 8219// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8220// for more information. 8221func (c *ServicesRolloutsListCall) Fields(s ...googleapi.Field) *ServicesRolloutsListCall { 8222 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8223 return c 8224} 8225 8226// IfNoneMatch sets the optional parameter which makes the operation 8227// fail if the object's ETag matches the given value. This is useful for 8228// getting updates only after the object has changed since the last 8229// request. Use googleapi.IsNotModified to check whether the response 8230// error from Do is the result of In-None-Match. 8231func (c *ServicesRolloutsListCall) IfNoneMatch(entityTag string) *ServicesRolloutsListCall { 8232 c.ifNoneMatch_ = entityTag 8233 return c 8234} 8235 8236// Context sets the context to be used in this call's Do method. Any 8237// pending HTTP request will be aborted if the provided context is 8238// canceled. 8239func (c *ServicesRolloutsListCall) Context(ctx context.Context) *ServicesRolloutsListCall { 8240 c.ctx_ = ctx 8241 return c 8242} 8243 8244// Header returns an http.Header that can be modified by the caller to 8245// add HTTP headers to the request. 8246func (c *ServicesRolloutsListCall) Header() http.Header { 8247 if c.header_ == nil { 8248 c.header_ = make(http.Header) 8249 } 8250 return c.header_ 8251} 8252 8253func (c *ServicesRolloutsListCall) doRequest(alt string) (*http.Response, error) { 8254 reqHeaders := make(http.Header) 8255 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 8256 for k, v := range c.header_ { 8257 reqHeaders[k] = v 8258 } 8259 reqHeaders.Set("User-Agent", c.s.userAgent()) 8260 if c.ifNoneMatch_ != "" { 8261 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8262 } 8263 var body io.Reader = nil 8264 c.urlParams_.Set("alt", alt) 8265 c.urlParams_.Set("prettyPrint", "false") 8266 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}/rollouts") 8267 urls += "?" + c.urlParams_.Encode() 8268 req, err := http.NewRequest("GET", urls, body) 8269 if err != nil { 8270 return nil, err 8271 } 8272 req.Header = reqHeaders 8273 googleapi.Expand(req.URL, map[string]string{ 8274 "serviceName": c.serviceName, 8275 }) 8276 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8277} 8278 8279// Do executes the "servicemanagement.services.rollouts.list" call. 8280// Exactly one of *ListServiceRolloutsResponse or error will be non-nil. 8281// Any non-2xx status code is an error. Response headers are in either 8282// *ListServiceRolloutsResponse.ServerResponse.Header or (if a response 8283// was returned at all) in error.(*googleapi.Error).Header. Use 8284// googleapi.IsNotModified to check whether the returned error was 8285// because http.StatusNotModified was returned. 8286func (c *ServicesRolloutsListCall) Do(opts ...googleapi.CallOption) (*ListServiceRolloutsResponse, error) { 8287 gensupport.SetOptions(c.urlParams_, opts...) 8288 res, err := c.doRequest("json") 8289 if res != nil && res.StatusCode == http.StatusNotModified { 8290 if res.Body != nil { 8291 res.Body.Close() 8292 } 8293 return nil, &googleapi.Error{ 8294 Code: res.StatusCode, 8295 Header: res.Header, 8296 } 8297 } 8298 if err != nil { 8299 return nil, err 8300 } 8301 defer googleapi.CloseBody(res) 8302 if err := googleapi.CheckResponse(res); err != nil { 8303 return nil, err 8304 } 8305 ret := &ListServiceRolloutsResponse{ 8306 ServerResponse: googleapi.ServerResponse{ 8307 Header: res.Header, 8308 HTTPStatusCode: res.StatusCode, 8309 }, 8310 } 8311 target := &ret 8312 if err := gensupport.DecodeResponse(target, res); err != nil { 8313 return nil, err 8314 } 8315 return ret, nil 8316 // { 8317 // "description": "Lists the history of the service configuration rollouts for a managed service, from the newest to the oldest.", 8318 // "flatPath": "v1/services/{serviceName}/rollouts", 8319 // "httpMethod": "GET", 8320 // "id": "servicemanagement.services.rollouts.list", 8321 // "parameterOrder": [ 8322 // "serviceName" 8323 // ], 8324 // "parameters": { 8325 // "filter": { 8326 // "description": "Required. Use `filter` to return subset of rollouts. The following filters are supported: -- To limit the results to only those in [status](google.api.servicemanagement.v1.RolloutStatus) 'SUCCESS', use filter='status=SUCCESS' -- To limit the results to those in [status](google.api.servicemanagement.v1.RolloutStatus) 'CANCELLED' or 'FAILED', use filter='status=CANCELLED OR status=FAILED'", 8327 // "location": "query", 8328 // "type": "string" 8329 // }, 8330 // "pageSize": { 8331 // "description": "The max number of items to include in the response list. Page size is 50 if not specified. Maximum value is 100.", 8332 // "format": "int32", 8333 // "location": "query", 8334 // "type": "integer" 8335 // }, 8336 // "pageToken": { 8337 // "description": "The token of the page to retrieve.", 8338 // "location": "query", 8339 // "type": "string" 8340 // }, 8341 // "serviceName": { 8342 // "description": "Required. The name of the service. See the [overview](/service-management/overview) for naming requirements. For example: `example.googleapis.com`.", 8343 // "location": "path", 8344 // "required": true, 8345 // "type": "string" 8346 // } 8347 // }, 8348 // "path": "v1/services/{serviceName}/rollouts", 8349 // "response": { 8350 // "$ref": "ListServiceRolloutsResponse" 8351 // }, 8352 // "scopes": [ 8353 // "https://www.googleapis.com/auth/cloud-platform", 8354 // "https://www.googleapis.com/auth/cloud-platform.read-only", 8355 // "https://www.googleapis.com/auth/service.management", 8356 // "https://www.googleapis.com/auth/service.management.readonly" 8357 // ] 8358 // } 8359 8360} 8361 8362// Pages invokes f for each page of results. 8363// A non-nil error returned from f will halt the iteration. 8364// The provided context supersedes any context provided to the Context method. 8365func (c *ServicesRolloutsListCall) Pages(ctx context.Context, f func(*ListServiceRolloutsResponse) error) error { 8366 c.ctx_ = ctx 8367 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 8368 for { 8369 x, err := c.Do() 8370 if err != nil { 8371 return err 8372 } 8373 if err := f(x); err != nil { 8374 return err 8375 } 8376 if x.NextPageToken == "" { 8377 return nil 8378 } 8379 c.PageToken(x.NextPageToken) 8380 } 8381} 8382