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.
 
 
 

4780 lines
174 KiB

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