You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

6028 lines
218 KiB

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