Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 

5779 řádky
210 KiB

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