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.
 
 
 

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