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

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