Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 

9478 lignes
338 KiB

  1. // Copyright 2019 Google LLC.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package servicemanagement provides access to the Service Management API.
  6. //
  7. // For product documentation, see: https://cloud.google.com/service-management/
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/servicemanagement/v1"
  14. // ...
  15. // ctx := context.Background()
  16. // servicemanagementService, err := servicemanagement.NewService(ctx)
  17. //
  18. // In this example, Google Application Default Credentials are used for authentication.
  19. //
  20. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  21. //
  22. // Other authentication options
  23. //
  24. // By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
  25. //
  26. // servicemanagementService, err := servicemanagement.NewService(ctx, option.WithScopes(servicemanagement.ServiceManagementReadonlyScope))
  27. //
  28. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  29. //
  30. // servicemanagementService, err := servicemanagement.NewService(ctx, option.WithAPIKey("AIza..."))
  31. //
  32. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  33. //
  34. // config := &oauth2.Config{...}
  35. // // ...
  36. // token, err := config.Exchange(ctx, ...)
  37. // servicemanagementService, err := servicemanagement.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  38. //
  39. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  40. package servicemanagement // import "google.golang.org/api/servicemanagement/v1"
  41. import (
  42. "bytes"
  43. "context"
  44. "encoding/json"
  45. "errors"
  46. "fmt"
  47. "io"
  48. "net/http"
  49. "net/url"
  50. "strconv"
  51. "strings"
  52. gensupport "google.golang.org/api/gensupport"
  53. googleapi "google.golang.org/api/googleapi"
  54. option "google.golang.org/api/option"
  55. htransport "google.golang.org/api/transport/http"
  56. )
  57. // Always reference these packages, just in case the auto-generated code
  58. // below doesn't.
  59. var _ = bytes.NewBuffer
  60. var _ = strconv.Itoa
  61. var _ = fmt.Sprintf
  62. var _ = json.NewDecoder
  63. var _ = io.Copy
  64. var _ = url.Parse
  65. var _ = gensupport.MarshalJSON
  66. var _ = googleapi.Version
  67. var _ = errors.New
  68. var _ = strings.Replace
  69. var _ = context.Canceled
  70. const apiId = "servicemanagement:v1"
  71. const apiName = "servicemanagement"
  72. const apiVersion = "v1"
  73. const basePath = "https://servicemanagement.googleapis.com/"
  74. // OAuth2 scopes used by this API.
  75. const (
  76. // View and manage your data across Google Cloud Platform services
  77. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  78. // View your data across Google Cloud Platform services
  79. CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only"
  80. // Manage your Google API service configuration
  81. ServiceManagementScope = "https://www.googleapis.com/auth/service.management"
  82. // View your Google API service configuration
  83. ServiceManagementReadonlyScope = "https://www.googleapis.com/auth/service.management.readonly"
  84. )
  85. // NewService creates a new APIService.
  86. func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, error) {
  87. scopesOption := option.WithScopes(
  88. "https://www.googleapis.com/auth/cloud-platform",
  89. "https://www.googleapis.com/auth/cloud-platform.read-only",
  90. "https://www.googleapis.com/auth/service.management",
  91. "https://www.googleapis.com/auth/service.management.readonly",
  92. )
  93. // NOTE: prepend, so we don't override user-specified scopes.
  94. opts = append([]option.ClientOption{scopesOption}, opts...)
  95. client, endpoint, err := htransport.NewClient(ctx, opts...)
  96. if err != nil {
  97. return nil, err
  98. }
  99. s, err := New(client)
  100. if err != nil {
  101. return nil, err
  102. }
  103. if endpoint != "" {
  104. s.BasePath = endpoint
  105. }
  106. return s, nil
  107. }
  108. // New creates a new APIService. It uses the provided http.Client for requests.
  109. //
  110. // Deprecated: please use NewService instead.
  111. // To provide a custom HTTP client, use option.WithHTTPClient.
  112. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  113. func New(client *http.Client) (*APIService, error) {
  114. if client == nil {
  115. return nil, errors.New("client is nil")
  116. }
  117. s := &APIService{client: client, BasePath: basePath}
  118. s.Operations = NewOperationsService(s)
  119. s.Services = NewServicesService(s)
  120. return s, nil
  121. }
  122. type APIService struct {
  123. client *http.Client
  124. BasePath string // API endpoint base URL
  125. UserAgent string // optional additional User-Agent fragment
  126. Operations *OperationsService
  127. Services *ServicesService
  128. }
  129. func (s *APIService) userAgent() string {
  130. if s.UserAgent == "" {
  131. return googleapi.UserAgent
  132. }
  133. return googleapi.UserAgent + " " + s.UserAgent
  134. }
  135. func NewOperationsService(s *APIService) *OperationsService {
  136. rs := &OperationsService{s: s}
  137. return rs
  138. }
  139. type OperationsService struct {
  140. s *APIService
  141. }
  142. func NewServicesService(s *APIService) *ServicesService {
  143. rs := &ServicesService{s: s}
  144. rs.Configs = NewServicesConfigsService(s)
  145. rs.Consumers = NewServicesConsumersService(s)
  146. rs.Rollouts = NewServicesRolloutsService(s)
  147. return rs
  148. }
  149. type ServicesService struct {
  150. s *APIService
  151. Configs *ServicesConfigsService
  152. Consumers *ServicesConsumersService
  153. Rollouts *ServicesRolloutsService
  154. }
  155. func NewServicesConfigsService(s *APIService) *ServicesConfigsService {
  156. rs := &ServicesConfigsService{s: s}
  157. return rs
  158. }
  159. type ServicesConfigsService struct {
  160. s *APIService
  161. }
  162. func NewServicesConsumersService(s *APIService) *ServicesConsumersService {
  163. rs := &ServicesConsumersService{s: s}
  164. return rs
  165. }
  166. type ServicesConsumersService struct {
  167. s *APIService
  168. }
  169. func NewServicesRolloutsService(s *APIService) *ServicesRolloutsService {
  170. rs := &ServicesRolloutsService{s: s}
  171. return rs
  172. }
  173. type ServicesRolloutsService struct {
  174. s *APIService
  175. }
  176. // Advice: Generated advice about this change, used for providing
  177. // more
  178. // information about how a change will affect the existing service.
  179. type Advice struct {
  180. // Description: Useful description for why this advice was applied and
  181. // what actions should
  182. // be taken to mitigate any implied risks.
  183. Description string `json:"description,omitempty"`
  184. // ForceSendFields is a list of field names (e.g. "Description") to
  185. // unconditionally include in API requests. By default, fields with
  186. // empty values are omitted from API requests. However, any non-pointer,
  187. // non-interface field appearing in ForceSendFields will be sent to the
  188. // server regardless of whether the field is empty or not. This may be
  189. // used to include empty fields in Patch requests.
  190. ForceSendFields []string `json:"-"`
  191. // NullFields is a list of field names (e.g. "Description") to include
  192. // in API requests with the JSON null value. By default, fields with
  193. // empty values are omitted from API requests. However, any field with
  194. // an empty value appearing in NullFields will be sent to the server as
  195. // null. It is an error if a field in this list has a non-empty value.
  196. // This may be used to include null fields in Patch requests.
  197. NullFields []string `json:"-"`
  198. }
  199. func (s *Advice) MarshalJSON() ([]byte, error) {
  200. type NoMethod Advice
  201. raw := NoMethod(*s)
  202. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  203. }
  204. // Api: Api is a light-weight descriptor for an API
  205. // Interface.
  206. //
  207. // Interfaces are also described as "protocol buffer services" in some
  208. // contexts,
  209. // such as by the "service" keyword in a .proto file, but they are
  210. // different
  211. // from API Services, which represent a concrete implementation of an
  212. // interface
  213. // as opposed to simply a description of methods and bindings. They are
  214. // also
  215. // sometimes simply referred to as "APIs" in other contexts, such as the
  216. // name of
  217. // this message itself. See
  218. // https://cloud.google.com/apis/design/glossary for
  219. // detailed terminology.
  220. type Api struct {
  221. // Methods: The methods of this interface, in unspecified order.
  222. Methods []*Method `json:"methods,omitempty"`
  223. // Mixins: Included interfaces. See Mixin.
  224. Mixins []*Mixin `json:"mixins,omitempty"`
  225. // Name: The fully qualified name of this interface, including package
  226. // name
  227. // followed by the interface's simple name.
  228. Name string `json:"name,omitempty"`
  229. // Options: Any metadata attached to the interface.
  230. Options []*Option `json:"options,omitempty"`
  231. // SourceContext: Source context for the protocol buffer service
  232. // represented by this
  233. // message.
  234. SourceContext *SourceContext `json:"sourceContext,omitempty"`
  235. // Syntax: The source syntax of the service.
  236. //
  237. // Possible values:
  238. // "SYNTAX_PROTO2" - Syntax `proto2`.
  239. // "SYNTAX_PROTO3" - Syntax `proto3`.
  240. Syntax string `json:"syntax,omitempty"`
  241. // Version: A version string for this interface. If specified, must have
  242. // the form
  243. // `major-version.minor-version`, as in `1.10`. If the minor version
  244. // is
  245. // omitted, it defaults to zero. If the entire version field is empty,
  246. // the
  247. // major version is derived from the package name, as outlined below. If
  248. // the
  249. // field is not empty, the version in the package name will be verified
  250. // to be
  251. // consistent with what is provided here.
  252. //
  253. // The versioning schema uses [semantic
  254. // versioning](http://semver.org) where the major version
  255. // number
  256. // indicates a breaking change and the minor version an
  257. // additive,
  258. // non-breaking change. Both version numbers are signals to users
  259. // what to expect from different versions, and should be
  260. // carefully
  261. // chosen based on the product plan.
  262. //
  263. // The major version is also reflected in the package name of
  264. // the
  265. // interface, which must end in `v<major-version>`, as
  266. // in
  267. // `google.feature.v1`. For major versions 0 and 1, the suffix can
  268. // be omitted. Zero major versions must only be used for
  269. // experimental, non-GA interfaces.
  270. //
  271. Version string `json:"version,omitempty"`
  272. // ForceSendFields is a list of field names (e.g. "Methods") to
  273. // unconditionally include in API requests. By default, fields with
  274. // empty values are omitted from API requests. However, any non-pointer,
  275. // non-interface field appearing in ForceSendFields will be sent to the
  276. // server regardless of whether the field is empty or not. This may be
  277. // used to include empty fields in Patch requests.
  278. ForceSendFields []string `json:"-"`
  279. // NullFields is a list of field names (e.g. "Methods") to include in
  280. // API requests with the JSON null value. By default, fields with empty
  281. // values are omitted from API requests. However, any field with an
  282. // empty value appearing in NullFields will be sent to the server as
  283. // null. It is an error if a field in this list has a non-empty value.
  284. // This may be used to include null fields in Patch requests.
  285. NullFields []string `json:"-"`
  286. }
  287. func (s *Api) MarshalJSON() ([]byte, error) {
  288. type NoMethod Api
  289. raw := NoMethod(*s)
  290. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  291. }
  292. // AuditConfig: Specifies the audit configuration for a service.
  293. // The configuration determines which permission types are logged, and
  294. // what
  295. // identities, if any, are exempted from logging.
  296. // An AuditConfig must have one or more AuditLogConfigs.
  297. //
  298. // If there are AuditConfigs for both `allServices` and a specific
  299. // service,
  300. // the union of the two AuditConfigs is used for that service: the
  301. // log_types
  302. // specified in each AuditConfig are enabled, and the exempted_members
  303. // in each
  304. // AuditLogConfig are exempted.
  305. //
  306. // Example Policy with multiple AuditConfigs:
  307. //
  308. // {
  309. // "audit_configs": [
  310. // {
  311. // "service": "allServices"
  312. // "audit_log_configs": [
  313. // {
  314. // "log_type": "DATA_READ",
  315. // "exempted_members": [
  316. // "user:foo@gmail.com"
  317. // ]
  318. // },
  319. // {
  320. // "log_type": "DATA_WRITE",
  321. // },
  322. // {
  323. // "log_type": "ADMIN_READ",
  324. // }
  325. // ]
  326. // },
  327. // {
  328. // "service": "fooservice.googleapis.com"
  329. // "audit_log_configs": [
  330. // {
  331. // "log_type": "DATA_READ",
  332. // },
  333. // {
  334. // "log_type": "DATA_WRITE",
  335. // "exempted_members": [
  336. // "user:bar@gmail.com"
  337. // ]
  338. // }
  339. // ]
  340. // }
  341. // ]
  342. // }
  343. //
  344. // For fooservice, this policy enables DATA_READ, DATA_WRITE and
  345. // ADMIN_READ
  346. // logging. It also exempts foo@gmail.com from DATA_READ logging,
  347. // and
  348. // bar@gmail.com from DATA_WRITE logging.
  349. type AuditConfig struct {
  350. // AuditLogConfigs: The configuration for logging of each type of
  351. // permission.
  352. AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
  353. // Service: Specifies a service that will be enabled for audit
  354. // logging.
  355. // For example, `storage.googleapis.com`,
  356. // `cloudsql.googleapis.com`.
  357. // `allServices` is a special value that covers all services.
  358. Service string `json:"service,omitempty"`
  359. // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to
  360. // unconditionally include in API requests. By default, fields with
  361. // empty values are omitted from API requests. However, any non-pointer,
  362. // non-interface field appearing in ForceSendFields will be sent to the
  363. // server regardless of whether the field is empty or not. This may be
  364. // used to include empty fields in Patch requests.
  365. ForceSendFields []string `json:"-"`
  366. // NullFields is a list of field names (e.g. "AuditLogConfigs") to
  367. // include in API requests with the JSON null value. By default, fields
  368. // with empty values are omitted from API requests. However, any field
  369. // with an empty value appearing in NullFields will be sent to the
  370. // server as null. It is an error if a field in this list has a
  371. // non-empty value. This may be used to include null fields in Patch
  372. // requests.
  373. NullFields []string `json:"-"`
  374. }
  375. func (s *AuditConfig) MarshalJSON() ([]byte, error) {
  376. type NoMethod AuditConfig
  377. raw := NoMethod(*s)
  378. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  379. }
  380. // AuditLogConfig: Provides the configuration for logging a type of
  381. // permissions.
  382. // Example:
  383. //
  384. // {
  385. // "audit_log_configs": [
  386. // {
  387. // "log_type": "DATA_READ",
  388. // "exempted_members": [
  389. // "user:foo@gmail.com"
  390. // ]
  391. // },
  392. // {
  393. // "log_type": "DATA_WRITE",
  394. // }
  395. // ]
  396. // }
  397. //
  398. // This enables 'DATA_READ' and 'DATA_WRITE' logging, while
  399. // exempting
  400. // foo@gmail.com from DATA_READ logging.
  401. type AuditLogConfig struct {
  402. // ExemptedMembers: Specifies the identities that do not cause logging
  403. // for this type of
  404. // permission.
  405. // Follows the same format of Binding.members.
  406. ExemptedMembers []string `json:"exemptedMembers,omitempty"`
  407. // LogType: The log type that this config enables.
  408. //
  409. // Possible values:
  410. // "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this.
  411. // "ADMIN_READ" - Admin reads. Example: CloudIAM getIamPolicy
  412. // "DATA_WRITE" - Data writes. Example: CloudSQL Users create
  413. // "DATA_READ" - Data reads. Example: CloudSQL Users list
  414. LogType string `json:"logType,omitempty"`
  415. // ForceSendFields is a list of field names (e.g. "ExemptedMembers") to
  416. // unconditionally include in API requests. By default, fields with
  417. // empty values are omitted from API requests. However, any non-pointer,
  418. // non-interface field appearing in ForceSendFields will be sent to the
  419. // server regardless of whether the field is empty or not. This may be
  420. // used to include empty fields in Patch requests.
  421. ForceSendFields []string `json:"-"`
  422. // NullFields is a list of field names (e.g. "ExemptedMembers") to
  423. // include in API requests with the JSON null value. By default, fields
  424. // with empty values are omitted from API requests. However, any field
  425. // with an empty value appearing in NullFields will be sent to the
  426. // server as null. It is an error if a field in this list has a
  427. // non-empty value. This may be used to include null fields in Patch
  428. // requests.
  429. NullFields []string `json:"-"`
  430. }
  431. func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
  432. type NoMethod AuditLogConfig
  433. raw := NoMethod(*s)
  434. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  435. }
  436. // AuthProvider: Configuration for an anthentication provider, including
  437. // support for
  438. // [JSON Web
  439. // Token
  440. // (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-tok
  441. // en-32).
  442. type AuthProvider struct {
  443. // Audiences: The list of
  444. // JWT
  445. // [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-
  446. // token-32#section-4.1.3).
  447. // that are allowed to access. A JWT containing any of these audiences
  448. // will
  449. // be accepted. When this setting is absent, only JWTs with
  450. // audience
  451. // "https://Service_name/API_name"
  452. // will be accepted. For example, if no audiences are in the
  453. // setting,
  454. // LibraryService API will only accept JWTs with the following
  455. // audience
  456. // "https://library-example.googleapis.com/google.example.librar
  457. // y.v1.LibraryService".
  458. //
  459. // Example:
  460. //
  461. // audiences: bookstore_android.apps.googleusercontent.com,
  462. // bookstore_web.apps.googleusercontent.com
  463. Audiences string `json:"audiences,omitempty"`
  464. // AuthorizationUrl: Redirect URL if JWT token is required but not
  465. // present or is expired.
  466. // Implement authorizationUrl of securityDefinitions in OpenAPI spec.
  467. AuthorizationUrl string `json:"authorizationUrl,omitempty"`
  468. // Id: The unique identifier of the auth provider. It will be referred
  469. // to by
  470. // `AuthRequirement.provider_id`.
  471. //
  472. // Example: "bookstore_auth".
  473. Id string `json:"id,omitempty"`
  474. // Issuer: Identifies the principal that issued the JWT.
  475. // See
  476. // https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#sec
  477. // tion-4.1.1
  478. // Usually a URL or an email address.
  479. //
  480. // Example: https://securetoken.google.com
  481. // Example: 1234567-compute@developer.gserviceaccount.com
  482. Issuer string `json:"issuer,omitempty"`
  483. // JwksUri: URL of the provider's public key set to validate signature
  484. // of the JWT.
  485. // See
  486. // [OpenID
  487. // Discovery](https://openid.net/specs/openid-connect-discove
  488. // ry-1_0.html#ProviderMetadata).
  489. // Optional if the key set document:
  490. // - can be retrieved from
  491. // [OpenID
  492. //
  493. // Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html
  494. // of
  495. // the issuer.
  496. // - can be inferred from the email domain of the issuer (e.g. a
  497. // Google
  498. // service account).
  499. //
  500. // Example: https://www.googleapis.com/oauth2/v1/certs
  501. JwksUri string `json:"jwksUri,omitempty"`
  502. // ForceSendFields is a list of field names (e.g. "Audiences") to
  503. // unconditionally include in API requests. By default, fields with
  504. // empty values are omitted from API requests. However, any non-pointer,
  505. // non-interface field appearing in ForceSendFields will be sent to the
  506. // server regardless of whether the field is empty or not. This may be
  507. // used to include empty fields in Patch requests.
  508. ForceSendFields []string `json:"-"`
  509. // NullFields is a list of field names (e.g. "Audiences") to include in
  510. // API requests with the JSON null value. By default, fields with empty
  511. // values are omitted from API requests. However, any field with an
  512. // empty value appearing in NullFields will be sent to the server as
  513. // null. It is an error if a field in this list has a non-empty value.
  514. // This may be used to include null fields in Patch requests.
  515. NullFields []string `json:"-"`
  516. }
  517. func (s *AuthProvider) MarshalJSON() ([]byte, error) {
  518. type NoMethod AuthProvider
  519. raw := NoMethod(*s)
  520. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  521. }
  522. // AuthRequirement: User-defined authentication requirements, including
  523. // support for
  524. // [JSON Web
  525. // Token
  526. // (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-tok
  527. // en-32).
  528. type AuthRequirement struct {
  529. // Audiences: NOTE: This will be deprecated soon, once
  530. // AuthProvider.audiences is
  531. // implemented and accepted in all the runtime components.
  532. //
  533. // The list of
  534. // JWT
  535. // [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-
  536. // token-32#section-4.1.3).
  537. // that are allowed to access. A JWT containing any of these audiences
  538. // will
  539. // be accepted. When this setting is absent, only JWTs with
  540. // audience
  541. // "https://Service_name/API_name"
  542. // will be accepted. For example, if no audiences are in the
  543. // setting,
  544. // LibraryService API will only accept JWTs with the following
  545. // audience
  546. // "https://library-example.googleapis.com/google.example.librar
  547. // y.v1.LibraryService".
  548. //
  549. // Example:
  550. //
  551. // audiences: bookstore_android.apps.googleusercontent.com,
  552. // bookstore_web.apps.googleusercontent.com
  553. Audiences string `json:"audiences,omitempty"`
  554. // ProviderId: id from authentication provider.
  555. //
  556. // Example:
  557. //
  558. // provider_id: bookstore_auth
  559. ProviderId string `json:"providerId,omitempty"`
  560. // ForceSendFields is a list of field names (e.g. "Audiences") to
  561. // unconditionally include in API requests. By default, fields with
  562. // empty values are omitted from API requests. However, any non-pointer,
  563. // non-interface field appearing in ForceSendFields will be sent to the
  564. // server regardless of whether the field is empty or not. This may be
  565. // used to include empty fields in Patch requests.
  566. ForceSendFields []string `json:"-"`
  567. // NullFields is a list of field names (e.g. "Audiences") to include in
  568. // API requests with the JSON null value. By default, fields with empty
  569. // values are omitted from API requests. However, any field with an
  570. // empty value appearing in NullFields will be sent to the server as
  571. // null. It is an error if a field in this list has a non-empty value.
  572. // This may be used to include null fields in Patch requests.
  573. NullFields []string `json:"-"`
  574. }
  575. func (s *AuthRequirement) MarshalJSON() ([]byte, error) {
  576. type NoMethod AuthRequirement
  577. raw := NoMethod(*s)
  578. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  579. }
  580. // Authentication: `Authentication` defines the authentication
  581. // configuration for an API.
  582. //
  583. // Example for an API targeted for external use:
  584. //
  585. // name: calendar.googleapis.com
  586. // authentication:
  587. // providers:
  588. // - id: google_calendar_auth
  589. // jwks_uri: https://www.googleapis.com/oauth2/v1/certs
  590. // issuer: https://securetoken.google.com
  591. // rules:
  592. // - selector: "*"
  593. // requirements:
  594. // provider_id: google_calendar_auth
  595. type Authentication struct {
  596. // Providers: Defines a set of authentication providers that a service
  597. // supports.
  598. Providers []*AuthProvider `json:"providers,omitempty"`
  599. // Rules: A list of authentication rules that apply to individual API
  600. // methods.
  601. //
  602. // **NOTE:** All service configuration rules follow "last one wins"
  603. // order.
  604. Rules []*AuthenticationRule `json:"rules,omitempty"`
  605. // ForceSendFields is a list of field names (e.g. "Providers") to
  606. // unconditionally include in API requests. By default, fields with
  607. // empty values are omitted from API requests. However, any non-pointer,
  608. // non-interface field appearing in ForceSendFields will be sent to the
  609. // server regardless of whether the field is empty or not. This may be
  610. // used to include empty fields in Patch requests.
  611. ForceSendFields []string `json:"-"`
  612. // NullFields is a list of field names (e.g. "Providers") to include in
  613. // API requests with the JSON null value. By default, fields with empty
  614. // values are omitted from API requests. However, any field with an
  615. // empty value appearing in NullFields will be sent to the server as
  616. // null. It is an error if a field in this list has a non-empty value.
  617. // This may be used to include null fields in Patch requests.
  618. NullFields []string `json:"-"`
  619. }
  620. func (s *Authentication) MarshalJSON() ([]byte, error) {
  621. type NoMethod Authentication
  622. raw := NoMethod(*s)
  623. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  624. }
  625. // AuthenticationRule: Authentication rules for the service.
  626. //
  627. // By default, if a method has any authentication requirements, every
  628. // request
  629. // must include a valid credential matching one of the
  630. // requirements.
  631. // It's an error to include more than one kind of credential in a
  632. // single
  633. // request.
  634. //
  635. // If a method doesn't have any auth requirements, request credentials
  636. // will be
  637. // ignored.
  638. type AuthenticationRule struct {
  639. // AllowWithoutCredential: If true, the service accepts API keys without
  640. // any other credential.
  641. AllowWithoutCredential bool `json:"allowWithoutCredential,omitempty"`
  642. // Oauth: The requirements for OAuth credentials.
  643. Oauth *OAuthRequirements `json:"oauth,omitempty"`
  644. // Requirements: Requirements for additional authentication providers.
  645. Requirements []*AuthRequirement `json:"requirements,omitempty"`
  646. // Selector: Selects the methods to which this rule applies.
  647. //
  648. // Refer to selector for syntax details.
  649. Selector string `json:"selector,omitempty"`
  650. // ForceSendFields is a list of field names (e.g.
  651. // "AllowWithoutCredential") to unconditionally include in API requests.
  652. // By default, fields with empty values are omitted from API requests.
  653. // However, any non-pointer, non-interface field appearing in
  654. // ForceSendFields will be sent to the server regardless of whether the
  655. // field is empty or not. This may be used to include empty fields in
  656. // Patch requests.
  657. ForceSendFields []string `json:"-"`
  658. // NullFields is a list of field names (e.g. "AllowWithoutCredential")
  659. // to include in API requests with the JSON null value. By default,
  660. // fields with empty values are omitted from API requests. However, any
  661. // field with an empty value appearing in NullFields will be sent to the
  662. // server as null. It is an error if a field in this list has a
  663. // non-empty value. This may be used to include null fields in Patch
  664. // requests.
  665. NullFields []string `json:"-"`
  666. }
  667. func (s *AuthenticationRule) MarshalJSON() ([]byte, error) {
  668. type NoMethod AuthenticationRule
  669. raw := NoMethod(*s)
  670. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  671. }
  672. // AuthorizationConfig: Configuration of authorization.
  673. //
  674. // This section determines the authorization provider, if unspecified,
  675. // then no
  676. // authorization check will be done.
  677. //
  678. // Example:
  679. //
  680. // experimental:
  681. // authorization:
  682. // provider: firebaserules.googleapis.com
  683. type AuthorizationConfig struct {
  684. // Provider: The name of the authorization provider, such
  685. // as
  686. // firebaserules.googleapis.com.
  687. Provider string `json:"provider,omitempty"`
  688. // ForceSendFields is a list of field names (e.g. "Provider") to
  689. // unconditionally include in API requests. By default, fields with
  690. // empty values are omitted from API requests. However, any non-pointer,
  691. // non-interface field appearing in ForceSendFields will be sent to the
  692. // server regardless of whether the field is empty or not. This may be
  693. // used to include empty fields in Patch requests.
  694. ForceSendFields []string `json:"-"`
  695. // NullFields is a list of field names (e.g. "Provider") to include in
  696. // API requests with the JSON null value. By default, fields with empty
  697. // values are omitted from API requests. However, any field with an
  698. // empty value appearing in NullFields will be sent to the server as
  699. // null. It is an error if a field in this list has a non-empty value.
  700. // This may be used to include null fields in Patch requests.
  701. NullFields []string `json:"-"`
  702. }
  703. func (s *AuthorizationConfig) MarshalJSON() ([]byte, error) {
  704. type NoMethod AuthorizationConfig
  705. raw := NoMethod(*s)
  706. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  707. }
  708. // Backend: `Backend` defines the backend configuration for a service.
  709. type Backend struct {
  710. // Rules: A list of API backend rules that apply to individual API
  711. // methods.
  712. //
  713. // **NOTE:** All service configuration rules follow "last one wins"
  714. // order.
  715. Rules []*BackendRule `json:"rules,omitempty"`
  716. // ForceSendFields is a list of field names (e.g. "Rules") to
  717. // unconditionally include in API requests. By default, fields with
  718. // empty values are omitted from API requests. However, any non-pointer,
  719. // non-interface field appearing in ForceSendFields will be sent to the
  720. // server regardless of whether the field is empty or not. This may be
  721. // used to include empty fields in Patch requests.
  722. ForceSendFields []string `json:"-"`
  723. // NullFields is a list of field names (e.g. "Rules") to include in API
  724. // requests with the JSON null value. By default, fields with empty
  725. // values are omitted from API requests. However, any field with an
  726. // empty value appearing in NullFields will be sent to the server as
  727. // null. It is an error if a field in this list has a non-empty value.
  728. // This may be used to include null fields in Patch requests.
  729. NullFields []string `json:"-"`
  730. }
  731. func (s *Backend) MarshalJSON() ([]byte, error) {
  732. type NoMethod Backend
  733. raw := NoMethod(*s)
  734. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  735. }
  736. // BackendRule: A backend rule provides configuration for an individual
  737. // API element.
  738. type BackendRule struct {
  739. // Address: The address of the API backend.
  740. Address string `json:"address,omitempty"`
  741. // Deadline: The number of seconds to wait for a response from a
  742. // request. The default
  743. // deadline for gRPC is infinite (no deadline) and HTTP requests is 5
  744. // seconds.
  745. Deadline float64 `json:"deadline,omitempty"`
  746. // JwtAudience: The JWT audience is used when generating a JWT id token
  747. // for the backend.
  748. JwtAudience string `json:"jwtAudience,omitempty"`
  749. // MinDeadline: Minimum deadline in seconds needed for this method.
  750. // Calls having deadline
  751. // value lower than this will be rejected.
  752. MinDeadline float64 `json:"minDeadline,omitempty"`
  753. // OperationDeadline: The number of seconds to wait for the completion
  754. // of a long running
  755. // operation. The default is no deadline.
  756. OperationDeadline float64 `json:"operationDeadline,omitempty"`
  757. // Possible values:
  758. // "PATH_TRANSLATION_UNSPECIFIED"
  759. // "CONSTANT_ADDRESS" - Use the backend address as-is, with no
  760. // modification to the path. If the
  761. // URL pattern contains variables, the variable names and values will
  762. // be
  763. // appended to the query string. If a query string parameter and a
  764. // URL
  765. // pattern variable have the same name, this may result in duplicate
  766. // keys in
  767. // the query string.
  768. //
  769. // # Examples
  770. //
  771. // Given the following operation config:
  772. //
  773. // Method path: /api/company/{cid}/user/{uid}
  774. // Backend address:
  775. // https://example.cloudfunctions.net/getUser
  776. //
  777. // Requests to the following request paths will call the backend at
  778. // the
  779. // translated path:
  780. //
  781. // Request path: /api/company/widgetworks/user/johndoe
  782. // Translated:
  783. //
  784. // https://example.cloudfunctions.net/getUser?cid=widgetworks&uid=johndoe
  785. //
  786. // Request path: /api/company/widgetworks/user/johndoe?timezone=EST
  787. // Translated:
  788. //
  789. // https://example.cloudfunctions.net/getUser?timezone=EST&cid=widgetworks&uid=johndoe
  790. // "APPEND_PATH_TO_ADDRESS" - The request path will be appended to the
  791. // backend address.
  792. //
  793. // # Examples
  794. //
  795. // Given the following operation config:
  796. //
  797. // Method path: /api/company/{cid}/user/{uid}
  798. // Backend address: https://example.appspot.com
  799. //
  800. // Requests to the following request paths will call the backend at
  801. // the
  802. // translated path:
  803. //
  804. // Request path: /api/company/widgetworks/user/johndoe
  805. // Translated:
  806. //
  807. // https://example.appspot.com/api/company/widgetworks/user/johndoe
  808. //
  809. // Request path: /api/company/widgetworks/user/johndoe?timezone=EST
  810. // Translated:
  811. //
  812. // https://example.appspot.com/api/company/widgetworks/user/johndoe?timezone=EST
  813. PathTranslation string `json:"pathTranslation,omitempty"`
  814. // Selector: Selects the methods to which this rule applies.
  815. //
  816. // Refer to selector for syntax details.
  817. Selector string `json:"selector,omitempty"`
  818. // ForceSendFields is a list of field names (e.g. "Address") to
  819. // unconditionally include in API requests. By default, fields with
  820. // empty values are omitted from API requests. However, any non-pointer,
  821. // non-interface field appearing in ForceSendFields will be sent to the
  822. // server regardless of whether the field is empty or not. This may be
  823. // used to include empty fields in Patch requests.
  824. ForceSendFields []string `json:"-"`
  825. // NullFields is a list of field names (e.g. "Address") to include in
  826. // API requests with the JSON null value. By default, fields with empty
  827. // values are omitted from API requests. However, any field with an
  828. // empty value appearing in NullFields will be sent to the server as
  829. // null. It is an error if a field in this list has a non-empty value.
  830. // This may be used to include null fields in Patch requests.
  831. NullFields []string `json:"-"`
  832. }
  833. func (s *BackendRule) MarshalJSON() ([]byte, error) {
  834. type NoMethod BackendRule
  835. raw := NoMethod(*s)
  836. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  837. }
  838. func (s *BackendRule) UnmarshalJSON(data []byte) error {
  839. type NoMethod BackendRule
  840. var s1 struct {
  841. Deadline gensupport.JSONFloat64 `json:"deadline"`
  842. MinDeadline gensupport.JSONFloat64 `json:"minDeadline"`
  843. OperationDeadline gensupport.JSONFloat64 `json:"operationDeadline"`
  844. *NoMethod
  845. }
  846. s1.NoMethod = (*NoMethod)(s)
  847. if err := json.Unmarshal(data, &s1); err != nil {
  848. return err
  849. }
  850. s.Deadline = float64(s1.Deadline)
  851. s.MinDeadline = float64(s1.MinDeadline)
  852. s.OperationDeadline = float64(s1.OperationDeadline)
  853. return nil
  854. }
  855. // Billing: Billing related configuration of the service.
  856. //
  857. // The following example shows how to configure monitored resources and
  858. // metrics
  859. // for billing:
  860. //
  861. // monitored_resources:
  862. // - type: library.googleapis.com/branch
  863. // labels:
  864. // - key: /city
  865. // description: The city where the library branch is located
  866. // in.
  867. // - key: /name
  868. // description: The name of the branch.
  869. // metrics:
  870. // - name: library.googleapis.com/book/borrowed_count
  871. // metric_kind: DELTA
  872. // value_type: INT64
  873. // billing:
  874. // consumer_destinations:
  875. // - monitored_resource: library.googleapis.com/branch
  876. // metrics:
  877. // - library.googleapis.com/book/borrowed_count
  878. type Billing struct {
  879. // ConsumerDestinations: Billing configurations for sending metrics to
  880. // the consumer project.
  881. // There can be multiple consumer destinations per service, each one
  882. // must have
  883. // a different monitored resource type. A metric can be used in at
  884. // most
  885. // one consumer destination.
  886. ConsumerDestinations []*BillingDestination `json:"consumerDestinations,omitempty"`
  887. // ForceSendFields is a list of field names (e.g.
  888. // "ConsumerDestinations") to unconditionally include in API requests.
  889. // By default, fields with empty values are omitted from API requests.
  890. // However, any non-pointer, non-interface field appearing in
  891. // ForceSendFields will be sent to the server regardless of whether the
  892. // field is empty or not. This may be used to include empty fields in
  893. // Patch requests.
  894. ForceSendFields []string `json:"-"`
  895. // NullFields is a list of field names (e.g. "ConsumerDestinations") to
  896. // include in API requests with the JSON null value. By default, fields
  897. // with empty values are omitted from API requests. However, any field
  898. // with an empty value appearing in NullFields will be sent to the
  899. // server as null. It is an error if a field in this list has a
  900. // non-empty value. This may be used to include null fields in Patch
  901. // requests.
  902. NullFields []string `json:"-"`
  903. }
  904. func (s *Billing) MarshalJSON() ([]byte, error) {
  905. type NoMethod Billing
  906. raw := NoMethod(*s)
  907. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  908. }
  909. // BillingDestination: Configuration of a specific billing destination
  910. // (Currently only support
  911. // bill against consumer project).
  912. type BillingDestination struct {
  913. // Metrics: Names of the metrics to report to this billing
  914. // destination.
  915. // Each name must be defined in Service.metrics section.
  916. Metrics []string `json:"metrics,omitempty"`
  917. // MonitoredResource: The monitored resource type. The type must be
  918. // defined in
  919. // Service.monitored_resources section.
  920. MonitoredResource string `json:"monitoredResource,omitempty"`
  921. // ForceSendFields is a list of field names (e.g. "Metrics") to
  922. // unconditionally include in API requests. By default, fields with
  923. // empty values are omitted from API requests. However, any non-pointer,
  924. // non-interface field appearing in ForceSendFields will be sent to the
  925. // server regardless of whether the field is empty or not. This may be
  926. // used to include empty fields in Patch requests.
  927. ForceSendFields []string `json:"-"`
  928. // NullFields is a list of field names (e.g. "Metrics") to include in
  929. // API requests with the JSON null value. By default, fields with empty
  930. // values are omitted from API requests. However, any field with an
  931. // empty value appearing in NullFields will be sent to the server as
  932. // null. It is an error if a field in this list has a non-empty value.
  933. // This may be used to include null fields in Patch requests.
  934. NullFields []string `json:"-"`
  935. }
  936. func (s *BillingDestination) MarshalJSON() ([]byte, error) {
  937. type NoMethod BillingDestination
  938. raw := NoMethod(*s)
  939. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  940. }
  941. // Binding: Associates `members` with a `role`.
  942. type Binding struct {
  943. // Condition: Unimplemented. The condition that is associated with this
  944. // binding.
  945. // NOTE: an unsatisfied condition will not allow user access via
  946. // current
  947. // binding. Different bindings, including their conditions, are
  948. // examined
  949. // independently.
  950. Condition *Expr `json:"condition,omitempty"`
  951. // Members: Specifies the identities requesting access for a Cloud
  952. // Platform resource.
  953. // `members` can have the following values:
  954. //
  955. // * `allUsers`: A special identifier that represents anyone who is
  956. // on the internet; with or without a Google account.
  957. //
  958. // * `allAuthenticatedUsers`: A special identifier that represents
  959. // anyone
  960. // who is authenticated with a Google account or a service
  961. // account.
  962. //
  963. // * `user:{emailid}`: An email address that represents a specific
  964. // Google
  965. // account. For example, `alice@gmail.com` .
  966. //
  967. //
  968. // * `serviceAccount:{emailid}`: An email address that represents a
  969. // service
  970. // account. For example,
  971. // `my-other-app@appspot.gserviceaccount.com`.
  972. //
  973. // * `group:{emailid}`: An email address that represents a Google
  974. // group.
  975. // For example, `admins@example.com`.
  976. //
  977. //
  978. // * `domain:{domain}`: The G Suite domain (primary) that represents all
  979. // the
  980. // users of that domain. For example, `google.com` or
  981. // `example.com`.
  982. //
  983. //
  984. Members []string `json:"members,omitempty"`
  985. // Role: Role that is assigned to `members`.
  986. // For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
  987. Role string `json:"role,omitempty"`
  988. // ForceSendFields is a list of field names (e.g. "Condition") to
  989. // unconditionally include in API requests. By default, fields with
  990. // empty values are omitted from API requests. However, any non-pointer,
  991. // non-interface field appearing in ForceSendFields will be sent to the
  992. // server regardless of whether the field is empty or not. This may be
  993. // used to include empty fields in Patch requests.
  994. ForceSendFields []string `json:"-"`
  995. // NullFields is a list of field names (e.g. "Condition") to include in
  996. // API requests with the JSON null value. By default, fields with empty
  997. // values are omitted from API requests. However, any field with an
  998. // empty value appearing in NullFields will be sent to the server as
  999. // null. It is an error if a field in this list has a non-empty value.
  1000. // This may be used to include null fields in Patch requests.
  1001. NullFields []string `json:"-"`
  1002. }
  1003. func (s *Binding) MarshalJSON() ([]byte, error) {
  1004. type NoMethod Binding
  1005. raw := NoMethod(*s)
  1006. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1007. }
  1008. // ChangeReport: Change report associated with a particular service
  1009. // configuration.
  1010. //
  1011. // It contains a list of ConfigChanges based on the comparison
  1012. // between
  1013. // two service configurations.
  1014. type ChangeReport struct {
  1015. // ConfigChanges: List of changes between two service
  1016. // configurations.
  1017. // The changes will be alphabetically sorted based on the identifier
  1018. // of each change.
  1019. // A ConfigChange identifier is a dot separated path to the
  1020. // configuration.
  1021. // Example:
  1022. // visibility.rules[selector='LibraryService.CreateBook'].restriction
  1023. ConfigChanges []*ConfigChange `json:"configChanges,omitempty"`
  1024. // ForceSendFields is a list of field names (e.g. "ConfigChanges") to
  1025. // unconditionally include in API requests. By default, fields with
  1026. // empty values are omitted from API requests. However, any non-pointer,
  1027. // non-interface field appearing in ForceSendFields will be sent to the
  1028. // server regardless of whether the field is empty or not. This may be
  1029. // used to include empty fields in Patch requests.
  1030. ForceSendFields []string `json:"-"`
  1031. // NullFields is a list of field names (e.g. "ConfigChanges") to include
  1032. // in API requests with the JSON null value. By default, fields with
  1033. // empty values are omitted from API requests. However, any field with
  1034. // an empty value appearing in NullFields will be sent to the server as
  1035. // null. It is an error if a field in this list has a non-empty value.
  1036. // This may be used to include null fields in Patch requests.
  1037. NullFields []string `json:"-"`
  1038. }
  1039. func (s *ChangeReport) MarshalJSON() ([]byte, error) {
  1040. type NoMethod ChangeReport
  1041. raw := NoMethod(*s)
  1042. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1043. }
  1044. // ConfigChange: Output generated from semantically comparing two
  1045. // versions of a service
  1046. // configuration.
  1047. //
  1048. // Includes detailed information about a field that have changed
  1049. // with
  1050. // applicable advice about potential consequences for the change, such
  1051. // as
  1052. // backwards-incompatibility.
  1053. type ConfigChange struct {
  1054. // Advices: Collection of advice provided for this change, useful for
  1055. // determining the
  1056. // possible impact of this change.
  1057. Advices []*Advice `json:"advices,omitempty"`
  1058. // ChangeType: The type for this change, either ADDED, REMOVED, or
  1059. // MODIFIED.
  1060. //
  1061. // Possible values:
  1062. // "CHANGE_TYPE_UNSPECIFIED" - No value was provided.
  1063. // "ADDED" - The changed object exists in the 'new' service
  1064. // configuration, but not
  1065. // in the 'old' service configuration.
  1066. // "REMOVED" - The changed object exists in the 'old' service
  1067. // configuration, but not
  1068. // in the 'new' service configuration.
  1069. // "MODIFIED" - The changed object exists in both service
  1070. // configurations, but its value
  1071. // is different.
  1072. ChangeType string `json:"changeType,omitempty"`
  1073. // Element: Object hierarchy path to the change, with levels separated
  1074. // by a '.'
  1075. // character. For repeated fields, an applicable unique identifier field
  1076. // is
  1077. // used for the index (usually selector, name, or id). For maps, the
  1078. // term
  1079. // 'key' is used. If the field has no unique identifier, the numeric
  1080. // index
  1081. // is used.
  1082. // ##
  1083. // Examples:
  1084. //
  1085. // visibility.rules[selector=="google.LibraryService.CreateBoo
  1086. // k"].restriction
  1087. // -
  1088. // quota.metric_rules[selector=="google"].metric_costs[key=="reads"].valu
  1089. // e
  1090. // - logging.producer_destinations[0]
  1091. Element string `json:"element,omitempty"`
  1092. // NewValue: Value of the changed object in the new Service
  1093. // configuration,
  1094. // in JSON format. This field will not be populated if ChangeType ==
  1095. // REMOVED.
  1096. NewValue string `json:"newValue,omitempty"`
  1097. // OldValue: Value of the changed object in the old Service
  1098. // configuration,
  1099. // in JSON format. This field will not be populated if ChangeType ==
  1100. // ADDED.
  1101. OldValue string `json:"oldValue,omitempty"`
  1102. // ForceSendFields is a list of field names (e.g. "Advices") to
  1103. // unconditionally include in API requests. By default, fields with
  1104. // empty values are omitted from API requests. However, any non-pointer,
  1105. // non-interface field appearing in ForceSendFields will be sent to the
  1106. // server regardless of whether the field is empty or not. This may be
  1107. // used to include empty fields in Patch requests.
  1108. ForceSendFields []string `json:"-"`
  1109. // NullFields is a list of field names (e.g. "Advices") to include in
  1110. // API requests with the JSON null value. By default, fields with empty
  1111. // values are omitted from API requests. However, any field with an
  1112. // empty value appearing in NullFields will be sent to the server as
  1113. // null. It is an error if a field in this list has a non-empty value.
  1114. // This may be used to include null fields in Patch requests.
  1115. NullFields []string `json:"-"`
  1116. }
  1117. func (s *ConfigChange) MarshalJSON() ([]byte, error) {
  1118. type NoMethod ConfigChange
  1119. raw := NoMethod(*s)
  1120. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1121. }
  1122. // ConfigFile: Generic specification of a source configuration file
  1123. type ConfigFile struct {
  1124. // FileContents: The bytes that constitute the file.
  1125. FileContents string `json:"fileContents,omitempty"`
  1126. // FilePath: The file name of the configuration file (full or relative
  1127. // path).
  1128. FilePath string `json:"filePath,omitempty"`
  1129. // FileType: The type of configuration file this represents.
  1130. //
  1131. // Possible values:
  1132. // "FILE_TYPE_UNSPECIFIED" - Unknown file type.
  1133. // "SERVICE_CONFIG_YAML" - YAML-specification of service.
  1134. // "OPEN_API_JSON" - OpenAPI specification, serialized in JSON.
  1135. // "OPEN_API_YAML" - OpenAPI specification, serialized in YAML.
  1136. // "FILE_DESCRIPTOR_SET_PROTO" - FileDescriptorSet, generated by
  1137. // protoc.
  1138. //
  1139. // To generate, use protoc with imports and source info included.
  1140. // For an example test.proto file, the following command would put the
  1141. // value
  1142. // in a new file named out.pb.
  1143. //
  1144. // $protoc --include_imports --include_source_info test.proto -o out.pb
  1145. // "PROTO_FILE" - Uncompiled Proto file. Used for storage and display
  1146. // purposes only,
  1147. // currently server-side compilation is not supported. Should match
  1148. // the
  1149. // inputs to 'protoc' command used to generated
  1150. // FILE_DESCRIPTOR_SET_PROTO. A
  1151. // file of this type can only be included if at least one file of
  1152. // type
  1153. // FILE_DESCRIPTOR_SET_PROTO is included.
  1154. FileType string `json:"fileType,omitempty"`
  1155. // ForceSendFields is a list of field names (e.g. "FileContents") to
  1156. // unconditionally include in API requests. By default, fields with
  1157. // empty values are omitted from API requests. However, any non-pointer,
  1158. // non-interface field appearing in ForceSendFields will be sent to the
  1159. // server regardless of whether the field is empty or not. This may be
  1160. // used to include empty fields in Patch requests.
  1161. ForceSendFields []string `json:"-"`
  1162. // NullFields is a list of field names (e.g. "FileContents") to include
  1163. // in API requests with the JSON null value. By default, fields with
  1164. // empty values are omitted from API requests. However, any field with
  1165. // an empty value appearing in NullFields will be sent to the server as
  1166. // null. It is an error if a field in this list has a non-empty value.
  1167. // This may be used to include null fields in Patch requests.
  1168. NullFields []string `json:"-"`
  1169. }
  1170. func (s *ConfigFile) MarshalJSON() ([]byte, error) {
  1171. type NoMethod ConfigFile
  1172. raw := NoMethod(*s)
  1173. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1174. }
  1175. // ConfigRef: Represents a service configuration with its name and id.
  1176. type ConfigRef struct {
  1177. // Name: Resource name of a service config. It must have the
  1178. // following
  1179. // format: "services/{service name}/configs/{config id}".
  1180. Name string `json:"name,omitempty"`
  1181. // ForceSendFields is a list of field names (e.g. "Name") to
  1182. // unconditionally include in API requests. By default, fields with
  1183. // empty values are omitted from API requests. However, any non-pointer,
  1184. // non-interface field appearing in ForceSendFields will be sent to the
  1185. // server regardless of whether the field is empty or not. This may be
  1186. // used to include empty fields in Patch requests.
  1187. ForceSendFields []string `json:"-"`
  1188. // NullFields is a list of field names (e.g. "Name") to include in API
  1189. // requests with the JSON null value. By default, fields with empty
  1190. // values are omitted from API requests. However, any field with an
  1191. // empty value appearing in NullFields will be sent to the server as
  1192. // null. It is an error if a field in this list has a non-empty value.
  1193. // This may be used to include null fields in Patch requests.
  1194. NullFields []string `json:"-"`
  1195. }
  1196. func (s *ConfigRef) MarshalJSON() ([]byte, error) {
  1197. type NoMethod ConfigRef
  1198. raw := NoMethod(*s)
  1199. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1200. }
  1201. // ConfigSource: Represents a source file which is used to generate the
  1202. // service configuration
  1203. // defined by `google.api.Service`.
  1204. type ConfigSource struct {
  1205. // Files: Set of source configuration files that are used to generate a
  1206. // service
  1207. // configuration (`google.api.Service`).
  1208. Files []*ConfigFile `json:"files,omitempty"`
  1209. // Id: A unique ID for a specific instance of this message, typically
  1210. // assigned
  1211. // by the client for tracking purpose. If empty, the server may choose
  1212. // to
  1213. // generate one instead.
  1214. Id string `json:"id,omitempty"`
  1215. // ForceSendFields is a list of field names (e.g. "Files") to
  1216. // unconditionally include in API requests. By default, fields with
  1217. // empty values are omitted from API requests. However, any non-pointer,
  1218. // non-interface field appearing in ForceSendFields will be sent to the
  1219. // server regardless of whether the field is empty or not. This may be
  1220. // used to include empty fields in Patch requests.
  1221. ForceSendFields []string `json:"-"`
  1222. // NullFields is a list of field names (e.g. "Files") to include in API
  1223. // requests with the JSON null value. By default, fields with empty
  1224. // values are omitted from API requests. However, any field with an
  1225. // empty value appearing in NullFields will be sent to the server as
  1226. // null. It is an error if a field in this list has a non-empty value.
  1227. // This may be used to include null fields in Patch requests.
  1228. NullFields []string `json:"-"`
  1229. }
  1230. func (s *ConfigSource) MarshalJSON() ([]byte, error) {
  1231. type NoMethod ConfigSource
  1232. raw := NoMethod(*s)
  1233. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1234. }
  1235. // Context: `Context` defines which contexts an API
  1236. // requests.
  1237. //
  1238. // Example:
  1239. //
  1240. // context:
  1241. // rules:
  1242. // - selector: "*"
  1243. // requested:
  1244. // - google.rpc.context.ProjectContext
  1245. // - google.rpc.context.OriginContext
  1246. //
  1247. // The above specifies that all methods in the API
  1248. // request
  1249. // `google.rpc.context.ProjectContext`
  1250. // and
  1251. // `google.rpc.context.OriginContext`.
  1252. //
  1253. // Available context types are defined in
  1254. // package
  1255. // `google.rpc.context`.
  1256. //
  1257. // This also provides mechanism to whitelist any protobuf message
  1258. // extension that
  1259. // can be sent in grpc metadata using
  1260. // “x-goog-ext-<extension_id>-bin”
  1261. // and
  1262. // “x-goog-ext-<extension_id>-jspb” format. For example, list any
  1263. // service
  1264. // specific protobuf types that can appear in grpc metadata as follows
  1265. // in your
  1266. // yaml file:
  1267. //
  1268. // Example:
  1269. //
  1270. // context:
  1271. // rules:
  1272. // - selector:
  1273. // "google.example.library.v1.LibraryService.CreateBook"
  1274. // allowed_request_extensions:
  1275. // - google.foo.v1.NewExtension
  1276. // allowed_response_extensions:
  1277. // - google.foo.v1.NewExtension
  1278. //
  1279. // You can also specify extension ID instead of fully qualified
  1280. // extension name
  1281. // here.
  1282. type Context struct {
  1283. // Rules: A list of RPC context rules that apply to individual API
  1284. // methods.
  1285. //
  1286. // **NOTE:** All service configuration rules follow "last one wins"
  1287. // order.
  1288. Rules []*ContextRule `json:"rules,omitempty"`
  1289. // ForceSendFields is a list of field names (e.g. "Rules") to
  1290. // unconditionally include in API requests. By default, fields with
  1291. // empty values are omitted from API requests. However, any non-pointer,
  1292. // non-interface field appearing in ForceSendFields will be sent to the
  1293. // server regardless of whether the field is empty or not. This may be
  1294. // used to include empty fields in Patch requests.
  1295. ForceSendFields []string `json:"-"`
  1296. // NullFields is a list of field names (e.g. "Rules") to include in API
  1297. // requests with the JSON null value. By default, fields with empty
  1298. // values are omitted from API requests. However, any field with an
  1299. // empty value appearing in NullFields will be sent to the server as
  1300. // null. It is an error if a field in this list has a non-empty value.
  1301. // This may be used to include null fields in Patch requests.
  1302. NullFields []string `json:"-"`
  1303. }
  1304. func (s *Context) MarshalJSON() ([]byte, error) {
  1305. type NoMethod Context
  1306. raw := NoMethod(*s)
  1307. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1308. }
  1309. // ContextRule: A context rule provides information about the context
  1310. // for an individual API
  1311. // element.
  1312. type ContextRule struct {
  1313. // AllowedRequestExtensions: A list of full type names or extension IDs
  1314. // of extensions allowed in grpc
  1315. // side channel from client to backend.
  1316. AllowedRequestExtensions []string `json:"allowedRequestExtensions,omitempty"`
  1317. // AllowedResponseExtensions: A list of full type names or extension IDs
  1318. // of extensions allowed in grpc
  1319. // side channel from backend to client.
  1320. AllowedResponseExtensions []string `json:"allowedResponseExtensions,omitempty"`
  1321. // Provided: A list of full type names of provided contexts.
  1322. Provided []string `json:"provided,omitempty"`
  1323. // Requested: A list of full type names of requested contexts.
  1324. Requested []string `json:"requested,omitempty"`
  1325. // Selector: Selects the methods to which this rule applies.
  1326. //
  1327. // Refer to selector for syntax details.
  1328. Selector string `json:"selector,omitempty"`
  1329. // ForceSendFields is a list of field names (e.g.
  1330. // "AllowedRequestExtensions") to unconditionally include in API
  1331. // requests. By default, fields with empty values are omitted from API
  1332. // requests. However, any non-pointer, non-interface field appearing in
  1333. // ForceSendFields will be sent to the server regardless of whether the
  1334. // field is empty or not. This may be used to include empty fields in
  1335. // Patch requests.
  1336. ForceSendFields []string `json:"-"`
  1337. // NullFields is a list of field names (e.g. "AllowedRequestExtensions")
  1338. // to include in API requests with the JSON null value. By default,
  1339. // fields with empty values are omitted from API requests. However, any
  1340. // field with an empty value appearing in NullFields will be sent to the
  1341. // server as null. It is an error if a field in this list has a
  1342. // non-empty value. This may be used to include null fields in Patch
  1343. // requests.
  1344. NullFields []string `json:"-"`
  1345. }
  1346. func (s *ContextRule) MarshalJSON() ([]byte, error) {
  1347. type NoMethod ContextRule
  1348. raw := NoMethod(*s)
  1349. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1350. }
  1351. // Control: Selects and configures the service controller used by the
  1352. // service. The
  1353. // service controller handles features like abuse, quota, billing,
  1354. // logging,
  1355. // monitoring, etc.
  1356. type Control struct {
  1357. // Environment: The service control environment to use. If empty, no
  1358. // control plane
  1359. // feature (like quota and billing) will be enabled.
  1360. Environment string `json:"environment,omitempty"`
  1361. // ForceSendFields is a list of field names (e.g. "Environment") to
  1362. // unconditionally include in API requests. By default, fields with
  1363. // empty values are omitted from API requests. However, any non-pointer,
  1364. // non-interface field appearing in ForceSendFields will be sent to the
  1365. // server regardless of whether the field is empty or not. This may be
  1366. // used to include empty fields in Patch requests.
  1367. ForceSendFields []string `json:"-"`
  1368. // NullFields is a list of field names (e.g. "Environment") to include
  1369. // in API requests with the JSON null value. By default, fields with
  1370. // empty values are omitted from API requests. However, any field with
  1371. // an empty value appearing in NullFields will be sent to the server as
  1372. // null. It is an error if a field in this list has a non-empty value.
  1373. // This may be used to include null fields in Patch requests.
  1374. NullFields []string `json:"-"`
  1375. }
  1376. func (s *Control) MarshalJSON() ([]byte, error) {
  1377. type NoMethod Control
  1378. raw := NoMethod(*s)
  1379. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1380. }
  1381. // CustomError: Customize service error responses. For example, list
  1382. // any service
  1383. // specific protobuf types that can appear in error detail lists
  1384. // of
  1385. // error responses.
  1386. //
  1387. // Example:
  1388. //
  1389. // custom_error:
  1390. // types:
  1391. // - google.foo.v1.CustomError
  1392. // - google.foo.v1.AnotherError
  1393. type CustomError struct {
  1394. // Rules: The list of custom error rules that apply to individual API
  1395. // messages.
  1396. //
  1397. // **NOTE:** All service configuration rules follow "last one wins"
  1398. // order.
  1399. Rules []*CustomErrorRule `json:"rules,omitempty"`
  1400. // Types: The list of custom error detail types, e.g.
  1401. // 'google.foo.v1.CustomError'.
  1402. Types []string `json:"types,omitempty"`
  1403. // ForceSendFields is a list of field names (e.g. "Rules") to
  1404. // unconditionally include in API requests. By default, fields with
  1405. // empty values are omitted from API requests. However, any non-pointer,
  1406. // non-interface field appearing in ForceSendFields will be sent to the
  1407. // server regardless of whether the field is empty or not. This may be
  1408. // used to include empty fields in Patch requests.
  1409. ForceSendFields []string `json:"-"`
  1410. // NullFields is a list of field names (e.g. "Rules") to include in API
  1411. // requests with the JSON null value. By default, fields with empty
  1412. // values are omitted from API requests. However, any field with an
  1413. // empty value appearing in NullFields will be sent to the server as
  1414. // null. It is an error if a field in this list has a non-empty value.
  1415. // This may be used to include null fields in Patch requests.
  1416. NullFields []string `json:"-"`
  1417. }
  1418. func (s *CustomError) MarshalJSON() ([]byte, error) {
  1419. type NoMethod CustomError
  1420. raw := NoMethod(*s)
  1421. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1422. }
  1423. // CustomErrorRule: A custom error rule.
  1424. type CustomErrorRule struct {
  1425. // IsErrorType: Mark this message as possible payload in error response.
  1426. // Otherwise,
  1427. // objects of this type will be filtered when they appear in error
  1428. // payload.
  1429. IsErrorType bool `json:"isErrorType,omitempty"`
  1430. // Selector: Selects messages to which this rule applies.
  1431. //
  1432. // Refer to selector for syntax details.
  1433. Selector string `json:"selector,omitempty"`
  1434. // ForceSendFields is a list of field names (e.g. "IsErrorType") to
  1435. // unconditionally include in API requests. By default, fields with
  1436. // empty values are omitted from API requests. However, any non-pointer,
  1437. // non-interface field appearing in ForceSendFields will be sent to the
  1438. // server regardless of whether the field is empty or not. This may be
  1439. // used to include empty fields in Patch requests.
  1440. ForceSendFields []string `json:"-"`
  1441. // NullFields is a list of field names (e.g. "IsErrorType") to include
  1442. // in API requests with the JSON null value. By default, fields with
  1443. // empty values are omitted from API requests. However, any field with
  1444. // an empty value appearing in NullFields will be sent to the server as
  1445. // null. It is an error if a field in this list has a non-empty value.
  1446. // This may be used to include null fields in Patch requests.
  1447. NullFields []string `json:"-"`
  1448. }
  1449. func (s *CustomErrorRule) MarshalJSON() ([]byte, error) {
  1450. type NoMethod CustomErrorRule
  1451. raw := NoMethod(*s)
  1452. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1453. }
  1454. // CustomHttpPattern: A custom pattern is used for defining custom HTTP
  1455. // verb.
  1456. type CustomHttpPattern struct {
  1457. // Kind: The name of this custom HTTP verb.
  1458. Kind string `json:"kind,omitempty"`
  1459. // Path: The path matched by this custom verb.
  1460. Path string `json:"path,omitempty"`
  1461. // ForceSendFields is a list of field names (e.g. "Kind") to
  1462. // unconditionally include in API requests. By default, fields with
  1463. // empty values are omitted from API requests. However, any non-pointer,
  1464. // non-interface field appearing in ForceSendFields will be sent to the
  1465. // server regardless of whether the field is empty or not. This may be
  1466. // used to include empty fields in Patch requests.
  1467. ForceSendFields []string `json:"-"`
  1468. // NullFields is a list of field names (e.g. "Kind") to include in API
  1469. // requests with the JSON null value. By default, fields with empty
  1470. // values are omitted from API requests. However, any field with an
  1471. // empty value appearing in NullFields will be sent to the server as
  1472. // null. It is an error if a field in this list has a non-empty value.
  1473. // This may be used to include null fields in Patch requests.
  1474. NullFields []string `json:"-"`
  1475. }
  1476. func (s *CustomHttpPattern) MarshalJSON() ([]byte, error) {
  1477. type NoMethod CustomHttpPattern
  1478. raw := NoMethod(*s)
  1479. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1480. }
  1481. // DeleteServiceStrategy: Strategy used to delete a service. This
  1482. // strategy is a placeholder only
  1483. // used by the system generated rollout to delete a service.
  1484. type DeleteServiceStrategy struct {
  1485. }
  1486. // Diagnostic: Represents a diagnostic message (error or warning)
  1487. type Diagnostic struct {
  1488. // Kind: The kind of diagnostic information provided.
  1489. //
  1490. // Possible values:
  1491. // "WARNING" - Warnings and errors
  1492. // "ERROR" - Only errors
  1493. Kind string `json:"kind,omitempty"`
  1494. // Location: File name and line number of the error or warning.
  1495. Location string `json:"location,omitempty"`
  1496. // Message: Message describing the error or warning.
  1497. Message string `json:"message,omitempty"`
  1498. // ForceSendFields is a list of field names (e.g. "Kind") to
  1499. // unconditionally include in API requests. By default, fields with
  1500. // empty values are omitted from API requests. However, any non-pointer,
  1501. // non-interface field appearing in ForceSendFields will be sent to the
  1502. // server regardless of whether the field is empty or not. This may be
  1503. // used to include empty fields in Patch requests.
  1504. ForceSendFields []string `json:"-"`
  1505. // NullFields is a list of field names (e.g. "Kind") to include in API
  1506. // requests with the JSON null value. By default, fields with empty
  1507. // values are omitted from API requests. However, any field with an
  1508. // empty value appearing in NullFields will be sent to the server as
  1509. // null. It is an error if a field in this list has a non-empty value.
  1510. // This may be used to include null fields in Patch requests.
  1511. NullFields []string `json:"-"`
  1512. }
  1513. func (s *Diagnostic) MarshalJSON() ([]byte, error) {
  1514. type NoMethod Diagnostic
  1515. raw := NoMethod(*s)
  1516. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1517. }
  1518. // DisableServiceRequest: Request message for DisableService method.
  1519. type DisableServiceRequest struct {
  1520. // ConsumerId: The identity of consumer resource which service
  1521. // disablement will be
  1522. // applied to.
  1523. //
  1524. // The Google Service Management implementation accepts the
  1525. // following
  1526. // forms:
  1527. // - "project:<project_id>"
  1528. //
  1529. // Note: this is made compatible
  1530. // with
  1531. // google.api.servicecontrol.v1.Operation.consumer_id.
  1532. ConsumerId string `json:"consumerId,omitempty"`
  1533. // ForceSendFields is a list of field names (e.g. "ConsumerId") to
  1534. // unconditionally include in API requests. By default, fields with
  1535. // empty values are omitted from API requests. However, any non-pointer,
  1536. // non-interface field appearing in ForceSendFields will be sent to the
  1537. // server regardless of whether the field is empty or not. This may be
  1538. // used to include empty fields in Patch requests.
  1539. ForceSendFields []string `json:"-"`
  1540. // NullFields is a list of field names (e.g. "ConsumerId") to include in
  1541. // API requests with the JSON null value. By default, fields with empty
  1542. // values are omitted from API requests. However, any field with an
  1543. // empty value appearing in NullFields will be sent to the server as
  1544. // null. It is an error if a field in this list has a non-empty value.
  1545. // This may be used to include null fields in Patch requests.
  1546. NullFields []string `json:"-"`
  1547. }
  1548. func (s *DisableServiceRequest) MarshalJSON() ([]byte, error) {
  1549. type NoMethod DisableServiceRequest
  1550. raw := NoMethod(*s)
  1551. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1552. }
  1553. // Documentation: `Documentation` provides the information for
  1554. // describing a service.
  1555. //
  1556. // Example:
  1557. // <pre><code>documentation:
  1558. // summary: >
  1559. // The Google Calendar API gives access
  1560. // to most calendar features.
  1561. // pages:
  1562. // - name: Overview
  1563. // content: &#40;== include google/foo/overview.md ==&#41;
  1564. // - name: Tutorial
  1565. // content: &#40;== include google/foo/tutorial.md ==&#41;
  1566. // subpages;
  1567. // - name: Java
  1568. // content: &#40;== include google/foo/tutorial_java.md ==&#41;
  1569. // rules:
  1570. // - selector: google.calendar.Calendar.Get
  1571. // description: >
  1572. // ...
  1573. // - selector: google.calendar.Calendar.Put
  1574. // description: >
  1575. // ...
  1576. // </code></pre>
  1577. // Documentation is provided in markdown syntax. In addition to
  1578. // standard markdown features, definition lists, tables and fenced
  1579. // code blocks are supported. Section headers can be provided and
  1580. // are
  1581. // interpreted relative to the section nesting of the context where
  1582. // a documentation fragment is embedded.
  1583. //
  1584. // Documentation from the IDL is merged with documentation defined
  1585. // via the config at normalization time, where documentation provided
  1586. // by config rules overrides IDL provided.
  1587. //
  1588. // A number of constructs specific to the API platform are supported
  1589. // in documentation text.
  1590. //
  1591. // In order to reference a proto element, the following
  1592. // notation can be
  1593. // used:
  1594. // <pre><code>&#91;fully.qualified.proto.name]&#91;]</code></pre>
  1595. // T
  1596. // o override the display text used for the link, this can be
  1597. // used:
  1598. // <pre><code>&#91;display
  1599. // text]&#91;fully.qualified.proto.name]</code></pre>
  1600. // Text can be excluded from doc using the following
  1601. // notation:
  1602. // <pre><code>&#40;-- internal comment --&#41;</code></pre>
  1603. //
  1604. // A few directives are available in documentation. Note that
  1605. // directives must appear on a single line to be properly
  1606. // identified. The `include` directive includes a markdown file from
  1607. // an external source:
  1608. // <pre><code>&#40;== include path/to/file ==&#41;</code></pre>
  1609. // The `resource_for` directive marks a message to be the resource of
  1610. // a collection in REST view. If it is not specified, tools attempt
  1611. // to infer the resource from the operations in a
  1612. // collection:
  1613. // <pre><code>&#40;== resource_for v1.shelves.books
  1614. // ==&#41;</code></pre>
  1615. // The directive `suppress_warning` does not directly affect
  1616. // documentation
  1617. // and is documented together with service config validation.
  1618. type Documentation struct {
  1619. // DocumentationRootUrl: The URL to the root of documentation.
  1620. DocumentationRootUrl string `json:"documentationRootUrl,omitempty"`
  1621. // Overview: Declares a single overview page. For
  1622. // example:
  1623. // <pre><code>documentation:
  1624. // summary: ...
  1625. // overview: &#40;== include overview.md ==&#41;
  1626. // </code></pre>
  1627. // This is a shortcut for the following declaration (using pages
  1628. // style):
  1629. // <pre><code>documentation:
  1630. // summary: ...
  1631. // pages:
  1632. // - name: Overview
  1633. // content: &#40;== include overview.md ==&#41;
  1634. // </code></pre>
  1635. // Note: you cannot specify both `overview` field and `pages` field.
  1636. Overview string `json:"overview,omitempty"`
  1637. // Pages: The top level pages for the documentation set.
  1638. Pages []*Page `json:"pages,omitempty"`
  1639. // Rules: A list of documentation rules that apply to individual API
  1640. // elements.
  1641. //
  1642. // **NOTE:** All service configuration rules follow "last one wins"
  1643. // order.
  1644. Rules []*DocumentationRule `json:"rules,omitempty"`
  1645. // Summary: A short summary of what the service does. Can only be
  1646. // provided by
  1647. // plain text.
  1648. Summary string `json:"summary,omitempty"`
  1649. // ForceSendFields is a list of field names (e.g.
  1650. // "DocumentationRootUrl") to unconditionally include in API requests.
  1651. // By default, fields with empty values are omitted from API requests.
  1652. // However, any non-pointer, non-interface field appearing in
  1653. // ForceSendFields will be sent to the server regardless of whether the
  1654. // field is empty or not. This may be used to include empty fields in
  1655. // Patch requests.
  1656. ForceSendFields []string `json:"-"`
  1657. // NullFields is a list of field names (e.g. "DocumentationRootUrl") to
  1658. // include in API requests with the JSON null value. By default, fields
  1659. // with empty values are omitted from API requests. However, any field
  1660. // with an empty value appearing in NullFields will be sent to the
  1661. // server as null. It is an error if a field in this list has a
  1662. // non-empty value. This may be used to include null fields in Patch
  1663. // requests.
  1664. NullFields []string `json:"-"`
  1665. }
  1666. func (s *Documentation) MarshalJSON() ([]byte, error) {
  1667. type NoMethod Documentation
  1668. raw := NoMethod(*s)
  1669. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1670. }
  1671. // DocumentationRule: A documentation rule provides information about
  1672. // individual API elements.
  1673. type DocumentationRule struct {
  1674. // DeprecationDescription: Deprecation description of the selected
  1675. // element(s). It can be provided if
  1676. // an element is marked as `deprecated`.
  1677. DeprecationDescription string `json:"deprecationDescription,omitempty"`
  1678. // Description: Description of the selected API(s).
  1679. Description string `json:"description,omitempty"`
  1680. // Selector: The selector is a comma-separated list of patterns. Each
  1681. // pattern is a
  1682. // qualified name of the element which may end in "*", indicating a
  1683. // wildcard.
  1684. // Wildcards are only allowed at the end and for a whole component of
  1685. // the
  1686. // qualified name, i.e. "foo.*" is ok, but not "foo.b*" or "foo.*.bar".
  1687. // To
  1688. // specify a default for all applicable elements, the whole pattern
  1689. // "*"
  1690. // is used.
  1691. Selector string `json:"selector,omitempty"`
  1692. // ForceSendFields is a list of field names (e.g.
  1693. // "DeprecationDescription") to unconditionally include in API requests.
  1694. // By default, fields with empty values are omitted from API requests.
  1695. // However, any non-pointer, non-interface field appearing in
  1696. // ForceSendFields will be sent to the server regardless of whether the
  1697. // field is empty or not. This may be used to include empty fields in
  1698. // Patch requests.
  1699. ForceSendFields []string `json:"-"`
  1700. // NullFields is a list of field names (e.g. "DeprecationDescription")
  1701. // to include in API requests with the JSON null value. By default,
  1702. // fields with empty values are omitted from API requests. However, any
  1703. // field with an empty value appearing in NullFields will be sent to the
  1704. // server as null. It is an error if a field in this list has a
  1705. // non-empty value. This may be used to include null fields in Patch
  1706. // requests.
  1707. NullFields []string `json:"-"`
  1708. }
  1709. func (s *DocumentationRule) MarshalJSON() ([]byte, error) {
  1710. type NoMethod DocumentationRule
  1711. raw := NoMethod(*s)
  1712. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1713. }
  1714. // EnableServiceRequest: Request message for EnableService method.
  1715. type EnableServiceRequest struct {
  1716. // ConsumerId: The identity of consumer resource which service
  1717. // enablement will be
  1718. // applied to.
  1719. //
  1720. // The Google Service Management implementation accepts the
  1721. // following
  1722. // forms:
  1723. // - "project:<project_id>"
  1724. //
  1725. // Note: this is made compatible
  1726. // with
  1727. // google.api.servicecontrol.v1.Operation.consumer_id.
  1728. ConsumerId string `json:"consumerId,omitempty"`
  1729. // ForceSendFields is a list of field names (e.g. "ConsumerId") to
  1730. // unconditionally include in API requests. By default, fields with
  1731. // empty values are omitted from API requests. However, any non-pointer,
  1732. // non-interface field appearing in ForceSendFields will be sent to the
  1733. // server regardless of whether the field is empty or not. This may be
  1734. // used to include empty fields in Patch requests.
  1735. ForceSendFields []string `json:"-"`
  1736. // NullFields is a list of field names (e.g. "ConsumerId") to include in
  1737. // API requests with the JSON null value. By default, fields with empty
  1738. // values are omitted from API requests. However, any field with an
  1739. // empty value appearing in NullFields will be sent to the server as
  1740. // null. It is an error if a field in this list has a non-empty value.
  1741. // This may be used to include null fields in Patch requests.
  1742. NullFields []string `json:"-"`
  1743. }
  1744. func (s *EnableServiceRequest) MarshalJSON() ([]byte, error) {
  1745. type NoMethod EnableServiceRequest
  1746. raw := NoMethod(*s)
  1747. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1748. }
  1749. // Endpoint: `Endpoint` describes a network endpoint that serves a set
  1750. // of APIs.
  1751. // A service may expose any number of endpoints, and all endpoints share
  1752. // the
  1753. // same service configuration, such as quota configuration and
  1754. // monitoring
  1755. // configuration.
  1756. //
  1757. // Example service configuration:
  1758. //
  1759. // name: library-example.googleapis.com
  1760. // endpoints:
  1761. // # Below entry makes 'google.example.library.v1.Library'
  1762. // # API be served from endpoint address
  1763. // library-example.googleapis.com.
  1764. // # It also allows HTTP OPTIONS calls to be passed to the
  1765. // backend, for
  1766. // # it to decide whether the subsequent cross-origin request is
  1767. // # allowed to proceed.
  1768. // - name: library-example.googleapis.com
  1769. // allow_cors: true
  1770. type Endpoint struct {
  1771. // Aliases: DEPRECATED: This field is no longer supported. Instead of
  1772. // using aliases,
  1773. // please specify multiple google.api.Endpoint for each of the
  1774. // intended
  1775. // aliases.
  1776. //
  1777. // Additional names that this endpoint will be hosted on.
  1778. Aliases []string `json:"aliases,omitempty"`
  1779. // AllowCors:
  1780. // Allowing
  1781. // [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sh
  1782. // aring), aka
  1783. // cross-domain traffic, would allow the backends served from this
  1784. // endpoint to
  1785. // receive and respond to HTTP OPTIONS requests. The response will be
  1786. // used by
  1787. // the browser to determine whether the subsequent cross-origin request
  1788. // is
  1789. // allowed to proceed.
  1790. AllowCors bool `json:"allowCors,omitempty"`
  1791. // Features: The list of features enabled on this endpoint.
  1792. Features []string `json:"features,omitempty"`
  1793. // Name: The canonical name of this endpoint.
  1794. Name string `json:"name,omitempty"`
  1795. // Target: The specification of an Internet routable address of API
  1796. // frontend that will
  1797. // handle requests to this
  1798. // [API
  1799. // Endpoint](https://cloud.google.com/apis/design/glossary). It should
  1800. // be
  1801. // either a valid IPv4 address or a fully-qualified domain name. For
  1802. // example,
  1803. // "8.8.8.8" or "myservice.appspot.com".
  1804. Target string `json:"target,omitempty"`
  1805. // ForceSendFields is a list of field names (e.g. "Aliases") to
  1806. // unconditionally include in API requests. By default, fields with
  1807. // empty values are omitted from API requests. However, any non-pointer,
  1808. // non-interface field appearing in ForceSendFields will be sent to the
  1809. // server regardless of whether the field is empty or not. This may be
  1810. // used to include empty fields in Patch requests.
  1811. ForceSendFields []string `json:"-"`
  1812. // NullFields is a list of field names (e.g. "Aliases") to include in
  1813. // API requests with the JSON null value. By default, fields with empty
  1814. // values are omitted from API requests. However, any field with an
  1815. // empty value appearing in NullFields will be sent to the server as
  1816. // null. It is an error if a field in this list has a non-empty value.
  1817. // This may be used to include null fields in Patch requests.
  1818. NullFields []string `json:"-"`
  1819. }
  1820. func (s *Endpoint) MarshalJSON() ([]byte, error) {
  1821. type NoMethod Endpoint
  1822. raw := NoMethod(*s)
  1823. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1824. }
  1825. // Enum: Enum type definition.
  1826. type Enum struct {
  1827. // Enumvalue: Enum value definitions.
  1828. Enumvalue []*EnumValue `json:"enumvalue,omitempty"`
  1829. // Name: Enum type name.
  1830. Name string `json:"name,omitempty"`
  1831. // Options: Protocol buffer options.
  1832. Options []*Option `json:"options,omitempty"`
  1833. // SourceContext: The source context.
  1834. SourceContext *SourceContext `json:"sourceContext,omitempty"`
  1835. // Syntax: The source syntax.
  1836. //
  1837. // Possible values:
  1838. // "SYNTAX_PROTO2" - Syntax `proto2`.
  1839. // "SYNTAX_PROTO3" - Syntax `proto3`.
  1840. Syntax string `json:"syntax,omitempty"`
  1841. // ForceSendFields is a list of field names (e.g. "Enumvalue") to
  1842. // unconditionally include in API requests. By default, fields with
  1843. // empty values are omitted from API requests. However, any non-pointer,
  1844. // non-interface field appearing in ForceSendFields will be sent to the
  1845. // server regardless of whether the field is empty or not. This may be
  1846. // used to include empty fields in Patch requests.
  1847. ForceSendFields []string `json:"-"`
  1848. // NullFields is a list of field names (e.g. "Enumvalue") to include in
  1849. // API requests with the JSON null value. By default, fields with empty
  1850. // values are omitted from API requests. However, any field with an
  1851. // empty value appearing in NullFields will be sent to the server as
  1852. // null. It is an error if a field in this list has a non-empty value.
  1853. // This may be used to include null fields in Patch requests.
  1854. NullFields []string `json:"-"`
  1855. }
  1856. func (s *Enum) MarshalJSON() ([]byte, error) {
  1857. type NoMethod Enum
  1858. raw := NoMethod(*s)
  1859. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1860. }
  1861. // EnumValue: Enum value definition.
  1862. type EnumValue struct {
  1863. // Name: Enum value name.
  1864. Name string `json:"name,omitempty"`
  1865. // Number: Enum value number.
  1866. Number int64 `json:"number,omitempty"`
  1867. // Options: Protocol buffer options.
  1868. Options []*Option `json:"options,omitempty"`
  1869. // ForceSendFields is a list of field names (e.g. "Name") to
  1870. // unconditionally include in API requests. By default, fields with
  1871. // empty values are omitted from API requests. However, any non-pointer,
  1872. // non-interface field appearing in ForceSendFields will be sent to the
  1873. // server regardless of whether the field is empty or not. This may be
  1874. // used to include empty fields in Patch requests.
  1875. ForceSendFields []string `json:"-"`
  1876. // NullFields is a list of field names (e.g. "Name") to include in API
  1877. // requests with the JSON null value. By default, fields with empty
  1878. // values are omitted from API requests. However, any field with an
  1879. // empty value appearing in NullFields will be sent to the server as
  1880. // null. It is an error if a field in this list has a non-empty value.
  1881. // This may be used to include null fields in Patch requests.
  1882. NullFields []string `json:"-"`
  1883. }
  1884. func (s *EnumValue) MarshalJSON() ([]byte, error) {
  1885. type NoMethod EnumValue
  1886. raw := NoMethod(*s)
  1887. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1888. }
  1889. // Experimental: Experimental service configuration. These configuration
  1890. // options can
  1891. // only be used by whitelisted users.
  1892. type Experimental struct {
  1893. // Authorization: Authorization configuration.
  1894. Authorization *AuthorizationConfig `json:"authorization,omitempty"`
  1895. // ForceSendFields is a list of field names (e.g. "Authorization") to
  1896. // unconditionally include in API requests. By default, fields with
  1897. // empty values are omitted from API requests. However, any non-pointer,
  1898. // non-interface field appearing in ForceSendFields will be sent to the
  1899. // server regardless of whether the field is empty or not. This may be
  1900. // used to include empty fields in Patch requests.
  1901. ForceSendFields []string `json:"-"`
  1902. // NullFields is a list of field names (e.g. "Authorization") to include
  1903. // in API requests with the JSON null value. By default, fields with
  1904. // empty values are omitted from API requests. However, any field with
  1905. // an empty value appearing in NullFields will be sent to the server as
  1906. // null. It is an error if a field in this list has a non-empty value.
  1907. // This may be used to include null fields in Patch requests.
  1908. NullFields []string `json:"-"`
  1909. }
  1910. func (s *Experimental) MarshalJSON() ([]byte, error) {
  1911. type NoMethod Experimental
  1912. raw := NoMethod(*s)
  1913. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1914. }
  1915. // Expr: Represents an expression text. Example:
  1916. //
  1917. // title: "User account presence"
  1918. // description: "Determines whether the request has a user account"
  1919. // expression: "size(request.user) > 0"
  1920. type Expr struct {
  1921. // Description: An optional description of the expression. This is a
  1922. // longer text which
  1923. // describes the expression, e.g. when hovered over it in a UI.
  1924. Description string `json:"description,omitempty"`
  1925. // Expression: Textual representation of an expression in
  1926. // Common Expression Language syntax.
  1927. //
  1928. // The application context of the containing message determines
  1929. // which
  1930. // well-known feature set of CEL is supported.
  1931. Expression string `json:"expression,omitempty"`
  1932. // Location: An optional string indicating the location of the
  1933. // expression for error
  1934. // reporting, e.g. a file name and a position in the file.
  1935. Location string `json:"location,omitempty"`
  1936. // Title: An optional title for the expression, i.e. a short string
  1937. // describing
  1938. // its purpose. This can be used e.g. in UIs which allow to enter
  1939. // the
  1940. // expression.
  1941. Title string `json:"title,omitempty"`
  1942. // ForceSendFields is a list of field names (e.g. "Description") to
  1943. // unconditionally include in API requests. By default, fields with
  1944. // empty values are omitted from API requests. However, any non-pointer,
  1945. // non-interface field appearing in ForceSendFields will be sent to the
  1946. // server regardless of whether the field is empty or not. This may be
  1947. // used to include empty fields in Patch requests.
  1948. ForceSendFields []string `json:"-"`
  1949. // NullFields is a list of field names (e.g. "Description") to include
  1950. // in API requests with the JSON null value. By default, fields with
  1951. // empty values are omitted from API requests. However, any field with
  1952. // an empty value appearing in NullFields will be sent to the server as
  1953. // null. It is an error if a field in this list has a non-empty value.
  1954. // This may be used to include null fields in Patch requests.
  1955. NullFields []string `json:"-"`
  1956. }
  1957. func (s *Expr) MarshalJSON() ([]byte, error) {
  1958. type NoMethod Expr
  1959. raw := NoMethod(*s)
  1960. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1961. }
  1962. // Field: A single field of a message type.
  1963. type Field struct {
  1964. // Cardinality: The field cardinality.
  1965. //
  1966. // Possible values:
  1967. // "CARDINALITY_UNKNOWN" - For fields with unknown cardinality.
  1968. // "CARDINALITY_OPTIONAL" - For optional fields.
  1969. // "CARDINALITY_REQUIRED" - For required fields. Proto2 syntax only.
  1970. // "CARDINALITY_REPEATED" - For repeated fields.
  1971. Cardinality string `json:"cardinality,omitempty"`
  1972. // DefaultValue: The string value of the default value of this field.
  1973. // Proto2 syntax only.
  1974. DefaultValue string `json:"defaultValue,omitempty"`
  1975. // JsonName: The field JSON name.
  1976. JsonName string `json:"jsonName,omitempty"`
  1977. // Kind: The field type.
  1978. //
  1979. // Possible values:
  1980. // "TYPE_UNKNOWN" - Field type unknown.
  1981. // "TYPE_DOUBLE" - Field type double.
  1982. // "TYPE_FLOAT" - Field type float.
  1983. // "TYPE_INT64" - Field type int64.
  1984. // "TYPE_UINT64" - Field type uint64.
  1985. // "TYPE_INT32" - Field type int32.
  1986. // "TYPE_FIXED64" - Field type fixed64.
  1987. // "TYPE_FIXED32" - Field type fixed32.
  1988. // "TYPE_BOOL" - Field type bool.
  1989. // "TYPE_STRING" - Field type string.
  1990. // "TYPE_GROUP" - Field type group. Proto2 syntax only, and
  1991. // deprecated.
  1992. // "TYPE_MESSAGE" - Field type message.
  1993. // "TYPE_BYTES" - Field type bytes.
  1994. // "TYPE_UINT32" - Field type uint32.
  1995. // "TYPE_ENUM" - Field type enum.
  1996. // "TYPE_SFIXED32" - Field type sfixed32.
  1997. // "TYPE_SFIXED64" - Field type sfixed64.
  1998. // "TYPE_SINT32" - Field type sint32.
  1999. // "TYPE_SINT64" - Field type sint64.
  2000. Kind string `json:"kind,omitempty"`
  2001. // Name: The field name.
  2002. Name string `json:"name,omitempty"`
  2003. // Number: The field number.
  2004. Number int64 `json:"number,omitempty"`
  2005. // OneofIndex: The index of the field type in `Type.oneofs`, for message
  2006. // or enumeration
  2007. // types. The first type has index 1; zero means the type is not in the
  2008. // list.
  2009. OneofIndex int64 `json:"oneofIndex,omitempty"`
  2010. // Options: The protocol buffer options.
  2011. Options []*Option `json:"options,omitempty"`
  2012. // Packed: Whether to use alternative packed wire representation.
  2013. Packed bool `json:"packed,omitempty"`
  2014. // TypeUrl: The field type URL, without the scheme, for message or
  2015. // enumeration
  2016. // types. Example: "type.googleapis.com/google.protobuf.Timestamp".
  2017. TypeUrl string `json:"typeUrl,omitempty"`
  2018. // ForceSendFields is a list of field names (e.g. "Cardinality") to
  2019. // unconditionally include in API requests. By default, fields with
  2020. // empty values are omitted from API requests. However, any non-pointer,
  2021. // non-interface field appearing in ForceSendFields will be sent to the
  2022. // server regardless of whether the field is empty or not. This may be
  2023. // used to include empty fields in Patch requests.
  2024. ForceSendFields []string `json:"-"`
  2025. // NullFields is a list of field names (e.g. "Cardinality") to include
  2026. // in API requests with the JSON null value. By default, fields with
  2027. // empty values are omitted from API requests. However, any field with
  2028. // an empty value appearing in NullFields will be sent to the server as
  2029. // null. It is an error if a field in this list has a non-empty value.
  2030. // This may be used to include null fields in Patch requests.
  2031. NullFields []string `json:"-"`
  2032. }
  2033. func (s *Field) MarshalJSON() ([]byte, error) {
  2034. type NoMethod Field
  2035. raw := NoMethod(*s)
  2036. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2037. }
  2038. // GenerateConfigReportRequest: Request message for GenerateConfigReport
  2039. // method.
  2040. type GenerateConfigReportRequest struct {
  2041. // NewConfig: Service configuration for which we want to generate the
  2042. // report.
  2043. // For this version of API, the supported types
  2044. // are
  2045. // google.api.servicemanagement.v1.ConfigRef,
  2046. // google.api.servicemanag
  2047. // ement.v1.ConfigSource,
  2048. // and google.api.Service
  2049. NewConfig googleapi.RawMessage `json:"newConfig,omitempty"`
  2050. // OldConfig: Service configuration against which the comparison will be
  2051. // done.
  2052. // For this version of API, the supported types
  2053. // are
  2054. // google.api.servicemanagement.v1.ConfigRef,
  2055. // google.api.servicemanag
  2056. // ement.v1.ConfigSource,
  2057. // and google.api.Service
  2058. OldConfig googleapi.RawMessage `json:"oldConfig,omitempty"`
  2059. // ForceSendFields is a list of field names (e.g. "NewConfig") to
  2060. // unconditionally include in API requests. By default, fields with
  2061. // empty values are omitted from API requests. However, any non-pointer,
  2062. // non-interface field appearing in ForceSendFields will be sent to the
  2063. // server regardless of whether the field is empty or not. This may be
  2064. // used to include empty fields in Patch requests.
  2065. ForceSendFields []string `json:"-"`
  2066. // NullFields is a list of field names (e.g. "NewConfig") to include in
  2067. // API requests with the JSON null value. By default, fields with empty
  2068. // values are omitted from API requests. However, any field with an
  2069. // empty value appearing in NullFields will be sent to the server as
  2070. // null. It is an error if a field in this list has a non-empty value.
  2071. // This may be used to include null fields in Patch requests.
  2072. NullFields []string `json:"-"`
  2073. }
  2074. func (s *GenerateConfigReportRequest) MarshalJSON() ([]byte, error) {
  2075. type NoMethod GenerateConfigReportRequest
  2076. raw := NoMethod(*s)
  2077. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2078. }
  2079. // GenerateConfigReportResponse: Response message for
  2080. // GenerateConfigReport method.
  2081. type GenerateConfigReportResponse struct {
  2082. // ChangeReports: list of ChangeReport, each corresponding to comparison
  2083. // between two
  2084. // service configurations.
  2085. ChangeReports []*ChangeReport `json:"changeReports,omitempty"`
  2086. // Diagnostics: Errors / Linter warnings associated with the service
  2087. // definition this
  2088. // report
  2089. // belongs to.
  2090. Diagnostics []*Diagnostic `json:"diagnostics,omitempty"`
  2091. // Id: ID of the service configuration this report belongs to.
  2092. Id string `json:"id,omitempty"`
  2093. // ServiceName: Name of the service this report belongs to.
  2094. ServiceName string `json:"serviceName,omitempty"`
  2095. // ServerResponse contains the HTTP response code and headers from the
  2096. // server.
  2097. googleapi.ServerResponse `json:"-"`
  2098. // ForceSendFields is a list of field names (e.g. "ChangeReports") to
  2099. // unconditionally include in API requests. By default, fields with
  2100. // empty values are omitted from API requests. However, any non-pointer,
  2101. // non-interface field appearing in ForceSendFields will be sent to the
  2102. // server regardless of whether the field is empty or not. This may be
  2103. // used to include empty fields in Patch requests.
  2104. ForceSendFields []string `json:"-"`
  2105. // NullFields is a list of field names (e.g. "ChangeReports") to include
  2106. // in API requests with the JSON null value. By default, fields with
  2107. // empty values are omitted from API requests. However, any field with
  2108. // an empty value appearing in NullFields will be sent to the server as
  2109. // null. It is an error if a field in this list has a non-empty value.
  2110. // This may be used to include null fields in Patch requests.
  2111. NullFields []string `json:"-"`
  2112. }
  2113. func (s *GenerateConfigReportResponse) MarshalJSON() ([]byte, error) {
  2114. type NoMethod GenerateConfigReportResponse
  2115. raw := NoMethod(*s)
  2116. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2117. }
  2118. // GetIamPolicyRequest: Request message for `GetIamPolicy` method.
  2119. type GetIamPolicyRequest struct {
  2120. }
  2121. // Http: Defines the HTTP configuration for an API service. It contains
  2122. // a list of
  2123. // HttpRule, each specifying the mapping of an RPC method
  2124. // to one or more HTTP REST API methods.
  2125. type Http struct {
  2126. // FullyDecodeReservedExpansion: When set to true, URL path parameters
  2127. // will be fully URI-decoded except in
  2128. // cases of single segment matches in reserved expansion, where "%2F"
  2129. // will be
  2130. // left encoded.
  2131. //
  2132. // The default behavior is to not decode RFC 6570 reserved characters in
  2133. // multi
  2134. // segment matches.
  2135. FullyDecodeReservedExpansion bool `json:"fullyDecodeReservedExpansion,omitempty"`
  2136. // Rules: A list of HTTP configuration rules that apply to individual
  2137. // API methods.
  2138. //
  2139. // **NOTE:** All service configuration rules follow "last one wins"
  2140. // order.
  2141. Rules []*HttpRule `json:"rules,omitempty"`
  2142. // ForceSendFields is a list of field names (e.g.
  2143. // "FullyDecodeReservedExpansion") to unconditionally include in API
  2144. // requests. By default, fields with empty values are omitted from API
  2145. // requests. However, any non-pointer, non-interface field appearing in
  2146. // ForceSendFields will be sent to the server regardless of whether the
  2147. // field is empty or not. This may be used to include empty fields in
  2148. // Patch requests.
  2149. ForceSendFields []string `json:"-"`
  2150. // NullFields is a list of field names (e.g.
  2151. // "FullyDecodeReservedExpansion") to include in API requests with the
  2152. // JSON null value. By default, fields with empty values are omitted
  2153. // from API requests. However, any field with an empty value appearing
  2154. // in NullFields will be sent to the server as null. It is an error if a
  2155. // field in this list has a non-empty value. This may be used to include
  2156. // null fields in Patch requests.
  2157. NullFields []string `json:"-"`
  2158. }
  2159. func (s *Http) MarshalJSON() ([]byte, error) {
  2160. type NoMethod Http
  2161. raw := NoMethod(*s)
  2162. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2163. }
  2164. // HttpRule: # gRPC Transcoding
  2165. //
  2166. // gRPC Transcoding is a feature for mapping between a gRPC method and
  2167. // one or
  2168. // more HTTP REST endpoints. It allows developers to build a single API
  2169. // service
  2170. // that supports both gRPC APIs and REST APIs. Many systems, including
  2171. // [Google
  2172. // APIs](https://github.com/googleapis/googleapis),
  2173. // [Cloud Endpoints](https://cloud.google.com/endpoints),
  2174. // [gRPC
  2175. // Gateway](https://github.com/grpc-ecosystem/grpc-gateway),
  2176. // and [Envoy](https://github.com/envoyproxy/envoy) proxy support this
  2177. // feature
  2178. // and use it for large scale production services.
  2179. //
  2180. // `HttpRule` defines the schema of the gRPC/REST mapping. The mapping
  2181. // specifies
  2182. // how different portions of the gRPC request message are mapped to the
  2183. // URL
  2184. // path, URL query parameters, and HTTP request body. It also controls
  2185. // how the
  2186. // gRPC response message is mapped to the HTTP response body. `HttpRule`
  2187. // is
  2188. // typically specified as an `google.api.http` annotation on the gRPC
  2189. // method.
  2190. //
  2191. // Each mapping specifies a URL path template and an HTTP method. The
  2192. // path
  2193. // template may refer to one or more fields in the gRPC request message,
  2194. // as long
  2195. // as each field is a non-repeated field with a primitive (non-message)
  2196. // type.
  2197. // The path template controls how fields of the request message are
  2198. // mapped to
  2199. // the URL path.
  2200. //
  2201. // Example:
  2202. //
  2203. // service Messaging {
  2204. // rpc GetMessage(GetMessageRequest) returns (Message) {
  2205. // option (google.api.http) = {
  2206. // get: "/v1/{name=messages/*}"
  2207. // };
  2208. // }
  2209. // }
  2210. // message GetMessageRequest {
  2211. // string name = 1; // Mapped to URL path.
  2212. // }
  2213. // message Message {
  2214. // string text = 1; // The resource content.
  2215. // }
  2216. //
  2217. // This enables an HTTP REST to gRPC mapping as below:
  2218. //
  2219. // HTTP | gRPC
  2220. // -----|-----
  2221. // `GET /v1/messages/123456` | `GetMessage(name:
  2222. // "messages/123456")`
  2223. //
  2224. // Any fields in the request message which are not bound by the path
  2225. // template
  2226. // automatically become HTTP query parameters if there is no HTTP
  2227. // request body.
  2228. // For example:
  2229. //
  2230. // service Messaging {
  2231. // rpc GetMessage(GetMessageRequest) returns (Message) {
  2232. // option (google.api.http) = {
  2233. // get:"/v1/messages/{message_id}"
  2234. // };
  2235. // }
  2236. // }
  2237. // message GetMessageRequest {
  2238. // message SubMessage {
  2239. // string subfield = 1;
  2240. // }
  2241. // string message_id = 1; // Mapped to URL path.
  2242. // int64 revision = 2; // Mapped to URL query parameter
  2243. // `revision`.
  2244. // SubMessage sub = 3; // Mapped to URL query parameter
  2245. // `sub.subfield`.
  2246. // }
  2247. //
  2248. // This enables a HTTP JSON to RPC mapping as below:
  2249. //
  2250. // HTTP | gRPC
  2251. // -----|-----
  2252. // `GET /v1/messages/123456?revision=2&sub.subfield=foo` |
  2253. // `GetMessage(message_id: "123456" revision: 2 sub:
  2254. // SubMessage(subfield: "foo"))`
  2255. //
  2256. // Note that fields which are mapped to URL query parameters must have
  2257. // a
  2258. // primitive type or a repeated primitive type or a non-repeated message
  2259. // type.
  2260. // In the case of a repeated type, the parameter can be repeated in the
  2261. // URL
  2262. // as `...?param=A&param=B`. In the case of a message type, each field
  2263. // of the
  2264. // message is mapped to a separate parameter, such
  2265. // as
  2266. // `...?foo.a=A&foo.b=B&foo.c=C`.
  2267. //
  2268. // For HTTP methods that allow a request body, the `body`
  2269. // field
  2270. // specifies the mapping. Consider a REST update method on the
  2271. // message resource collection:
  2272. //
  2273. // service Messaging {
  2274. // rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
  2275. // option (google.api.http) = {
  2276. // patch: "/v1/messages/{message_id}"
  2277. // body: "message"
  2278. // };
  2279. // }
  2280. // }
  2281. // message UpdateMessageRequest {
  2282. // string message_id = 1; // mapped to the URL
  2283. // Message message = 2; // mapped to the body
  2284. // }
  2285. //
  2286. // The following HTTP JSON to RPC mapping is enabled, where
  2287. // the
  2288. // representation of the JSON in the request body is determined
  2289. // by
  2290. // protos JSON encoding:
  2291. //
  2292. // HTTP | gRPC
  2293. // -----|-----
  2294. // `PATCH /v1/messages/123456 { "text": "Hi!" }` |
  2295. // `UpdateMessage(message_id: "123456" message { text: "Hi!" })`
  2296. //
  2297. // The special name `*` can be used in the body mapping to define
  2298. // that
  2299. // every field not bound by the path template should be mapped to
  2300. // the
  2301. // request body. This enables the following alternative definition
  2302. // of
  2303. // the update method:
  2304. //
  2305. // service Messaging {
  2306. // rpc UpdateMessage(Message) returns (Message) {
  2307. // option (google.api.http) = {
  2308. // patch: "/v1/messages/{message_id}"
  2309. // body: "*"
  2310. // };
  2311. // }
  2312. // }
  2313. // message Message {
  2314. // string message_id = 1;
  2315. // string text = 2;
  2316. // }
  2317. //
  2318. //
  2319. // The following HTTP JSON to RPC mapping is enabled:
  2320. //
  2321. // HTTP | gRPC
  2322. // -----|-----
  2323. // `PATCH /v1/messages/123456 { "text": "Hi!" }` |
  2324. // `UpdateMessage(message_id: "123456" text: "Hi!")`
  2325. //
  2326. // Note that when using `*` in the body mapping, it is not possible
  2327. // to
  2328. // have HTTP parameters, as all fields not bound by the path end in
  2329. // the body. This makes this option more rarely used in practice
  2330. // when
  2331. // defining REST APIs. The common usage of `*` is in custom
  2332. // methods
  2333. // which don't use the URL at all for transferring data.
  2334. //
  2335. // It is possible to define multiple HTTP methods for one RPC by
  2336. // using
  2337. // the `additional_bindings` option. Example:
  2338. //
  2339. // service Messaging {
  2340. // rpc GetMessage(GetMessageRequest) returns (Message) {
  2341. // option (google.api.http) = {
  2342. // get: "/v1/messages/{message_id}"
  2343. // additional_bindings {
  2344. // get: "/v1/users/{user_id}/messages/{message_id}"
  2345. // }
  2346. // };
  2347. // }
  2348. // }
  2349. // message GetMessageRequest {
  2350. // string message_id = 1;
  2351. // string user_id = 2;
  2352. // }
  2353. //
  2354. // This enables the following two alternative HTTP JSON to RPC
  2355. // mappings:
  2356. //
  2357. // HTTP | gRPC
  2358. // -----|-----
  2359. // `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
  2360. // `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me"
  2361. // message_id: "123456")`
  2362. //
  2363. // ## Rules for HTTP mapping
  2364. //
  2365. // 1. Leaf request fields (recursive expansion nested messages in the
  2366. // request
  2367. // message) are classified into three categories:
  2368. // - Fields referred by the path template. They are passed via the
  2369. // URL path.
  2370. // - Fields referred by the HttpRule.body. They are passed via the
  2371. // HTTP
  2372. // request body.
  2373. // - All other fields are passed via the URL query parameters, and
  2374. // the
  2375. // parameter name is the field path in the request message. A
  2376. // repeated
  2377. // field can be represented as multiple query parameters under the
  2378. // same
  2379. // name.
  2380. // 2. If HttpRule.body is "*", there is no URL query parameter, all
  2381. // fields
  2382. // are passed via URL path and HTTP request body.
  2383. // 3. If HttpRule.body is omitted, there is no HTTP request body, all
  2384. // fields are passed via URL path and URL query parameters.
  2385. //
  2386. // ### Path template syntax
  2387. //
  2388. // Template = "/" Segments [ Verb ] ;
  2389. // Segments = Segment { "/" Segment } ;
  2390. // Segment = "*" | "**" | LITERAL | Variable ;
  2391. // Variable = "{" FieldPath [ "=" Segments ] "}" ;
  2392. // FieldPath = IDENT { "." IDENT } ;
  2393. // Verb = ":" LITERAL ;
  2394. //
  2395. // The syntax `*` matches a single URL path segment. The syntax `**`
  2396. // matches
  2397. // zero or more URL path segments, which must be the last part of the
  2398. // URL path
  2399. // except the `Verb`.
  2400. //
  2401. // The syntax `Variable` matches part of the URL path as specified by
  2402. // its
  2403. // template. A variable template must not contain other variables. If a
  2404. // variable
  2405. // matches a single path segment, its template may be omitted, e.g.
  2406. // `{var}`
  2407. // is equivalent to `{var=*}`.
  2408. //
  2409. // The syntax `LITERAL` matches literal text in the URL path. If the
  2410. // `LITERAL`
  2411. // contains any reserved character, such characters should be
  2412. // percent-encoded
  2413. // before the matching.
  2414. //
  2415. // If a variable contains exactly one path segment, such as "{var}"
  2416. // or
  2417. // "{var=*}", when such a variable is expanded into a URL path on the
  2418. // client
  2419. // side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded.
  2420. // The
  2421. // server side does the reverse decoding. Such variables show up in
  2422. // the
  2423. // [Discovery
  2424. // Document](https://developers.google.com/discovery/v1/reference/apis)
  2425. // a
  2426. // s `{var}`.
  2427. //
  2428. // If a variable contains multiple path segments, such as
  2429. // "{var=foo/*}"
  2430. // or "{var=**}", when such a variable is expanded into a URL path on
  2431. // the
  2432. // client side, all characters except `[-_.~/0-9a-zA-Z]` are
  2433. // percent-encoded.
  2434. // The server side does the reverse decoding, except "%2F" and "%2f" are
  2435. // left
  2436. // unchanged. Such variables show up in the
  2437. // [Discovery
  2438. // Document](https://developers.google.com/discovery/v1/reference/apis)
  2439. // a
  2440. // s `{+var}`.
  2441. //
  2442. // ## Using gRPC API Service Configuration
  2443. //
  2444. // gRPC API Service Configuration (service config) is a configuration
  2445. // language
  2446. // for configuring a gRPC service to become a user-facing product.
  2447. // The
  2448. // service config is simply the YAML representation of the
  2449. // `google.api.Service`
  2450. // proto message.
  2451. //
  2452. // As an alternative to annotating your proto file, you can configure
  2453. // gRPC
  2454. // transcoding in your service config YAML files. You do this by
  2455. // specifying a
  2456. // `HttpRule` that maps the gRPC method to a REST endpoint, achieving
  2457. // the same
  2458. // effect as the proto annotation. This can be particularly useful if
  2459. // you
  2460. // have a proto that is reused in multiple services. Note that any
  2461. // transcoding
  2462. // specified in the service config will override any matching
  2463. // transcoding
  2464. // configuration in the proto.
  2465. //
  2466. // Example:
  2467. //
  2468. // http:
  2469. // rules:
  2470. // # Selects a gRPC method and applies HttpRule to it.
  2471. // - selector: example.v1.Messaging.GetMessage
  2472. // get: /v1/messages/{message_id}/{sub.subfield}
  2473. //
  2474. // ## Special notes
  2475. //
  2476. // When gRPC Transcoding is used to map a gRPC to JSON REST endpoints,
  2477. // the
  2478. // proto to JSON conversion must follow the
  2479. // [proto3
  2480. // specification](https://developers.google.com/protocol-buffers/
  2481. // docs/proto3#json).
  2482. //
  2483. // While the single segment variable follows the semantics of
  2484. // [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple
  2485. // String
  2486. // Expansion, the multi segment variable **does not** follow RFC 6570
  2487. // Section
  2488. // 3.2.3 Reserved Expansion. The reason is that the Reserved
  2489. // Expansion
  2490. // does not expand special characters like `?` and `#`, which would
  2491. // lead
  2492. // to invalid URLs. As the result, gRPC Transcoding uses a custom
  2493. // encoding
  2494. // for multi segment variables.
  2495. //
  2496. // The path variables **must not** refer to any repeated or mapped
  2497. // field,
  2498. // because client libraries are not capable of handling such variable
  2499. // expansion.
  2500. //
  2501. // The path variables **must not** capture the leading "/" character.
  2502. // The reason
  2503. // is that the most common use case "{var}" does not capture the leading
  2504. // "/"
  2505. // character. For consistency, all path variables must share the same
  2506. // behavior.
  2507. //
  2508. // Repeated message fields must not be mapped to URL query parameters,
  2509. // because
  2510. // no client library can support such complicated mapping.
  2511. //
  2512. // If an API needs to use a JSON array for request or response body, it
  2513. // can map
  2514. // the request or response body to a repeated field. However, some
  2515. // gRPC
  2516. // Transcoding implementations may not support this feature.
  2517. type HttpRule struct {
  2518. // AdditionalBindings: Additional HTTP bindings for the selector. Nested
  2519. // bindings must
  2520. // not contain an `additional_bindings` field themselves (that is,
  2521. // the nesting may only be one level deep).
  2522. AdditionalBindings []*HttpRule `json:"additionalBindings,omitempty"`
  2523. // Body: The name of the request field whose value is mapped to the HTTP
  2524. // request
  2525. // body, or `*` for mapping all request fields not captured by the
  2526. // path
  2527. // pattern to the HTTP body, or omitted for not having any HTTP request
  2528. // body.
  2529. //
  2530. // NOTE: the referred field must be present at the top-level of the
  2531. // request
  2532. // message type.
  2533. Body string `json:"body,omitempty"`
  2534. // Custom: The custom pattern is used for specifying an HTTP method that
  2535. // is not
  2536. // included in the `pattern` field, such as HEAD, or "*" to leave
  2537. // the
  2538. // HTTP method unspecified for this rule. The wild-card rule is
  2539. // useful
  2540. // for services that provide content to Web (HTML) clients.
  2541. Custom *CustomHttpPattern `json:"custom,omitempty"`
  2542. // Delete: Maps to HTTP DELETE. Used for deleting a resource.
  2543. Delete string `json:"delete,omitempty"`
  2544. // Get: Maps to HTTP GET. Used for listing and getting information
  2545. // about
  2546. // resources.
  2547. Get string `json:"get,omitempty"`
  2548. // Patch: Maps to HTTP PATCH. Used for updating a resource.
  2549. Patch string `json:"patch,omitempty"`
  2550. // Post: Maps to HTTP POST. Used for creating a resource or performing
  2551. // an action.
  2552. Post string `json:"post,omitempty"`
  2553. // Put: Maps to HTTP PUT. Used for replacing a resource.
  2554. Put string `json:"put,omitempty"`
  2555. // ResponseBody: Optional. The name of the response field whose value is
  2556. // mapped to the HTTP
  2557. // response body. When omitted, the entire response message will be
  2558. // used
  2559. // as the HTTP response body.
  2560. //
  2561. // NOTE: The referred field must be present at the top-level of the
  2562. // response
  2563. // message type.
  2564. ResponseBody string `json:"responseBody,omitempty"`
  2565. // Selector: Selects a method to which this rule applies.
  2566. //
  2567. // Refer to selector for syntax details.
  2568. Selector string `json:"selector,omitempty"`
  2569. // ForceSendFields is a list of field names (e.g. "AdditionalBindings")
  2570. // to unconditionally include in API requests. By default, fields with
  2571. // empty values are omitted from API requests. However, any non-pointer,
  2572. // non-interface field appearing in ForceSendFields will be sent to the
  2573. // server regardless of whether the field is empty or not. This may be
  2574. // used to include empty fields in Patch requests.
  2575. ForceSendFields []string `json:"-"`
  2576. // NullFields is a list of field names (e.g. "AdditionalBindings") to
  2577. // include in API requests with the JSON null value. By default, fields
  2578. // with empty values are omitted from API requests. However, any field
  2579. // with an empty value appearing in NullFields will be sent to the
  2580. // server as null. It is an error if a field in this list has a
  2581. // non-empty value. This may be used to include null fields in Patch
  2582. // requests.
  2583. NullFields []string `json:"-"`
  2584. }
  2585. func (s *HttpRule) MarshalJSON() ([]byte, error) {
  2586. type NoMethod HttpRule
  2587. raw := NoMethod(*s)
  2588. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2589. }
  2590. // LabelDescriptor: A description of a label.
  2591. type LabelDescriptor struct {
  2592. // Description: A human-readable description for the label.
  2593. Description string `json:"description,omitempty"`
  2594. // Key: The label key.
  2595. Key string `json:"key,omitempty"`
  2596. // ValueType: The type of data that can be assigned to the label.
  2597. //
  2598. // Possible values:
  2599. // "STRING" - A variable-length string. This is the default.
  2600. // "BOOL" - Boolean; true or false.
  2601. // "INT64" - A 64-bit signed integer.
  2602. ValueType string `json:"valueType,omitempty"`
  2603. // ForceSendFields is a list of field names (e.g. "Description") to
  2604. // unconditionally include in API requests. By default, fields with
  2605. // empty values are omitted from API requests. However, any non-pointer,
  2606. // non-interface field appearing in ForceSendFields will be sent to the
  2607. // server regardless of whether the field is empty or not. This may be
  2608. // used to include empty fields in Patch requests.
  2609. ForceSendFields []string `json:"-"`
  2610. // NullFields is a list of field names (e.g. "Description") to include
  2611. // in API requests with the JSON null value. By default, fields with
  2612. // empty values are omitted from API requests. However, any field with
  2613. // an empty value appearing in NullFields will be sent to the server as
  2614. // null. It is an error if a field in this list has a non-empty value.
  2615. // This may be used to include null fields in Patch requests.
  2616. NullFields []string `json:"-"`
  2617. }
  2618. func (s *LabelDescriptor) MarshalJSON() ([]byte, error) {
  2619. type NoMethod LabelDescriptor
  2620. raw := NoMethod(*s)
  2621. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2622. }
  2623. // ListOperationsResponse: The response message for
  2624. // Operations.ListOperations.
  2625. type ListOperationsResponse struct {
  2626. // NextPageToken: The standard List next-page token.
  2627. NextPageToken string `json:"nextPageToken,omitempty"`
  2628. // Operations: A list of operations that matches the specified filter in
  2629. // the request.
  2630. Operations []*Operation `json:"operations,omitempty"`
  2631. // ServerResponse contains the HTTP response code and headers from the
  2632. // server.
  2633. googleapi.ServerResponse `json:"-"`
  2634. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  2635. // unconditionally include in API requests. By default, fields with
  2636. // empty values are omitted from API requests. However, any non-pointer,
  2637. // non-interface field appearing in ForceSendFields will be sent to the
  2638. // server regardless of whether the field is empty or not. This may be
  2639. // used to include empty fields in Patch requests.
  2640. ForceSendFields []string `json:"-"`
  2641. // NullFields is a list of field names (e.g. "NextPageToken") to include
  2642. // in API requests with the JSON null value. By default, fields with
  2643. // empty values are omitted from API requests. However, any field with
  2644. // an empty value appearing in NullFields will be sent to the server as
  2645. // null. It is an error if a field in this list has a non-empty value.
  2646. // This may be used to include null fields in Patch requests.
  2647. NullFields []string `json:"-"`
  2648. }
  2649. func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
  2650. type NoMethod ListOperationsResponse
  2651. raw := NoMethod(*s)
  2652. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2653. }
  2654. // ListServiceConfigsResponse: Response message for ListServiceConfigs
  2655. // method.
  2656. type ListServiceConfigsResponse struct {
  2657. // NextPageToken: The token of the next page of results.
  2658. NextPageToken string `json:"nextPageToken,omitempty"`
  2659. // ServiceConfigs: The list of service configuration resources.
  2660. ServiceConfigs []*Service `json:"serviceConfigs,omitempty"`
  2661. // ServerResponse contains the HTTP response code and headers from the
  2662. // server.
  2663. googleapi.ServerResponse `json:"-"`
  2664. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  2665. // unconditionally include in API requests. By default, fields with
  2666. // empty values are omitted from API requests. However, any non-pointer,
  2667. // non-interface field appearing in ForceSendFields will be sent to the
  2668. // server regardless of whether the field is empty or not. This may be
  2669. // used to include empty fields in Patch requests.
  2670. ForceSendFields []string `json:"-"`
  2671. // NullFields is a list of field names (e.g. "NextPageToken") to include
  2672. // in API requests with the JSON null value. By default, fields with
  2673. // empty values are omitted from API requests. However, any field with
  2674. // an empty value appearing in NullFields will be sent to the server as
  2675. // null. It is an error if a field in this list has a non-empty value.
  2676. // This may be used to include null fields in Patch requests.
  2677. NullFields []string `json:"-"`
  2678. }
  2679. func (s *ListServiceConfigsResponse) MarshalJSON() ([]byte, error) {
  2680. type NoMethod ListServiceConfigsResponse
  2681. raw := NoMethod(*s)
  2682. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2683. }
  2684. // ListServiceRolloutsResponse: Response message for ListServiceRollouts
  2685. // method.
  2686. type ListServiceRolloutsResponse struct {
  2687. // NextPageToken: The token of the next page of results.
  2688. NextPageToken string `json:"nextPageToken,omitempty"`
  2689. // Rollouts: The list of rollout resources.
  2690. Rollouts []*Rollout `json:"rollouts,omitempty"`
  2691. // ServerResponse contains the HTTP response code and headers from the
  2692. // server.
  2693. googleapi.ServerResponse `json:"-"`
  2694. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  2695. // unconditionally include in API requests. By default, fields with
  2696. // empty values are omitted from API requests. However, any non-pointer,
  2697. // non-interface field appearing in ForceSendFields will be sent to the
  2698. // server regardless of whether the field is empty or not. This may be
  2699. // used to include empty fields in Patch requests.
  2700. ForceSendFields []string `json:"-"`
  2701. // NullFields is a list of field names (e.g. "NextPageToken") to include
  2702. // in API requests with the JSON null value. By default, fields with
  2703. // empty values are omitted from API requests. However, any field with
  2704. // an empty value appearing in NullFields will be sent to the server as
  2705. // null. It is an error if a field in this list has a non-empty value.
  2706. // This may be used to include null fields in Patch requests.
  2707. NullFields []string `json:"-"`
  2708. }
  2709. func (s *ListServiceRolloutsResponse) MarshalJSON() ([]byte, error) {
  2710. type NoMethod ListServiceRolloutsResponse
  2711. raw := NoMethod(*s)
  2712. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2713. }
  2714. // ListServicesResponse: Response message for `ListServices` method.
  2715. type ListServicesResponse struct {
  2716. // NextPageToken: Token that can be passed to `ListServices` to resume a
  2717. // paginated query.
  2718. NextPageToken string `json:"nextPageToken,omitempty"`
  2719. // Services: The returned services will only have the name field set.
  2720. Services []*ManagedService `json:"services,omitempty"`
  2721. // ServerResponse contains the HTTP response code and headers from the
  2722. // server.
  2723. googleapi.ServerResponse `json:"-"`
  2724. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  2725. // unconditionally include in API requests. By default, fields with
  2726. // empty values are omitted from API requests. However, any non-pointer,
  2727. // non-interface field appearing in ForceSendFields will be sent to the
  2728. // server regardless of whether the field is empty or not. This may be
  2729. // used to include empty fields in Patch requests.
  2730. ForceSendFields []string `json:"-"`
  2731. // NullFields is a list of field names (e.g. "NextPageToken") to include
  2732. // in API requests with the JSON null value. By default, fields with
  2733. // empty values are omitted from API requests. However, any field with
  2734. // an empty value appearing in NullFields will be sent to the server as
  2735. // null. It is an error if a field in this list has a non-empty value.
  2736. // This may be used to include null fields in Patch requests.
  2737. NullFields []string `json:"-"`
  2738. }
  2739. func (s *ListServicesResponse) MarshalJSON() ([]byte, error) {
  2740. type NoMethod ListServicesResponse
  2741. raw := NoMethod(*s)
  2742. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2743. }
  2744. // LogDescriptor: A description of a log type. Example in YAML format:
  2745. //
  2746. // - name: library.googleapis.com/activity_history
  2747. // description: The history of borrowing and returning library
  2748. // items.
  2749. // display_name: Activity
  2750. // labels:
  2751. // - key: /customer_id
  2752. // description: Identifier of a library customer
  2753. type LogDescriptor struct {
  2754. // Description: A human-readable description of this log. This
  2755. // information appears in
  2756. // the documentation and can contain details.
  2757. Description string `json:"description,omitempty"`
  2758. // DisplayName: The human-readable name for this log. This information
  2759. // appears on
  2760. // the user interface and should be concise.
  2761. DisplayName string `json:"displayName,omitempty"`
  2762. // Labels: The set of labels that are available to describe a specific
  2763. // log entry.
  2764. // Runtime requests that contain labels not specified here
  2765. // are
  2766. // considered invalid.
  2767. Labels []*LabelDescriptor `json:"labels,omitempty"`
  2768. // Name: The name of the log. It must be less than 512 characters long
  2769. // and can
  2770. // include the following characters: upper- and lower-case
  2771. // alphanumeric
  2772. // characters [A-Za-z0-9], and punctuation characters including
  2773. // slash, underscore, hyphen, period [/_-.].
  2774. Name string `json:"name,omitempty"`
  2775. // ForceSendFields is a list of field names (e.g. "Description") to
  2776. // unconditionally include in API requests. By default, fields with
  2777. // empty values are omitted from API requests. However, any non-pointer,
  2778. // non-interface field appearing in ForceSendFields will be sent to the
  2779. // server regardless of whether the field is empty or not. This may be
  2780. // used to include empty fields in Patch requests.
  2781. ForceSendFields []string `json:"-"`
  2782. // NullFields is a list of field names (e.g. "Description") to include
  2783. // in API requests with the JSON null value. By default, fields with
  2784. // empty values are omitted from API requests. However, any field with
  2785. // an empty value appearing in NullFields will be sent to the server as
  2786. // null. It is an error if a field in this list has a non-empty value.
  2787. // This may be used to include null fields in Patch requests.
  2788. NullFields []string `json:"-"`
  2789. }
  2790. func (s *LogDescriptor) MarshalJSON() ([]byte, error) {
  2791. type NoMethod LogDescriptor
  2792. raw := NoMethod(*s)
  2793. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2794. }
  2795. // Logging: Logging configuration of the service.
  2796. //
  2797. // The following example shows how to configure logs to be sent to
  2798. // the
  2799. // producer and consumer projects. In the example, the
  2800. // `activity_history`
  2801. // log is sent to both the producer and consumer projects, whereas
  2802. // the
  2803. // `purchase_history` log is only sent to the producer project.
  2804. //
  2805. // monitored_resources:
  2806. // - type: library.googleapis.com/branch
  2807. // labels:
  2808. // - key: /city
  2809. // description: The city where the library branch is located
  2810. // in.
  2811. // - key: /name
  2812. // description: The name of the branch.
  2813. // logs:
  2814. // - name: activity_history
  2815. // labels:
  2816. // - key: /customer_id
  2817. // - name: purchase_history
  2818. // logging:
  2819. // producer_destinations:
  2820. // - monitored_resource: library.googleapis.com/branch
  2821. // logs:
  2822. // - activity_history
  2823. // - purchase_history
  2824. // consumer_destinations:
  2825. // - monitored_resource: library.googleapis.com/branch
  2826. // logs:
  2827. // - activity_history
  2828. type Logging struct {
  2829. // ConsumerDestinations: Logging configurations for sending logs to the
  2830. // consumer project.
  2831. // There can be multiple consumer destinations, each one must have
  2832. // a
  2833. // different monitored resource type. A log can be used in at most
  2834. // one consumer destination.
  2835. ConsumerDestinations []*LoggingDestination `json:"consumerDestinations,omitempty"`
  2836. // ProducerDestinations: Logging configurations for sending logs to the
  2837. // producer project.
  2838. // There can be multiple producer destinations, each one must have
  2839. // a
  2840. // different monitored resource type. A log can be used in at most
  2841. // one producer destination.
  2842. ProducerDestinations []*LoggingDestination `json:"producerDestinations,omitempty"`
  2843. // ForceSendFields is a list of field names (e.g.
  2844. // "ConsumerDestinations") to unconditionally include in API requests.
  2845. // By default, fields with empty values are omitted from API requests.
  2846. // However, any non-pointer, non-interface field appearing in
  2847. // ForceSendFields will be sent to the server regardless of whether the
  2848. // field is empty or not. This may be used to include empty fields in
  2849. // Patch requests.
  2850. ForceSendFields []string `json:"-"`
  2851. // NullFields is a list of field names (e.g. "ConsumerDestinations") to
  2852. // include in API requests with the JSON null value. By default, fields
  2853. // with empty values are omitted from API requests. However, any field
  2854. // with an empty value appearing in NullFields will be sent to the
  2855. // server as null. It is an error if a field in this list has a
  2856. // non-empty value. This may be used to include null fields in Patch
  2857. // requests.
  2858. NullFields []string `json:"-"`
  2859. }
  2860. func (s *Logging) MarshalJSON() ([]byte, error) {
  2861. type NoMethod Logging
  2862. raw := NoMethod(*s)
  2863. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2864. }
  2865. // LoggingDestination: Configuration of a specific logging destination
  2866. // (the producer project
  2867. // or the consumer project).
  2868. type LoggingDestination struct {
  2869. // Logs: Names of the logs to be sent to this destination. Each name
  2870. // must
  2871. // be defined in the Service.logs section. If the log name is
  2872. // not a domain scoped name, it will be automatically prefixed with
  2873. // the service name followed by "/".
  2874. Logs []string `json:"logs,omitempty"`
  2875. // MonitoredResource: The monitored resource type. The type must be
  2876. // defined in the
  2877. // Service.monitored_resources section.
  2878. MonitoredResource string `json:"monitoredResource,omitempty"`
  2879. // ForceSendFields is a list of field names (e.g. "Logs") to
  2880. // unconditionally include in API requests. By default, fields with
  2881. // empty values are omitted from API requests. However, any non-pointer,
  2882. // non-interface field appearing in ForceSendFields will be sent to the
  2883. // server regardless of whether the field is empty or not. This may be
  2884. // used to include empty fields in Patch requests.
  2885. ForceSendFields []string `json:"-"`
  2886. // NullFields is a list of field names (e.g. "Logs") to include in API
  2887. // requests with the JSON null value. By default, fields with empty
  2888. // values are omitted from API requests. However, any field with an
  2889. // empty value appearing in NullFields will be sent to the server as
  2890. // null. It is an error if a field in this list has a non-empty value.
  2891. // This may be used to include null fields in Patch requests.
  2892. NullFields []string `json:"-"`
  2893. }
  2894. func (s *LoggingDestination) MarshalJSON() ([]byte, error) {
  2895. type NoMethod LoggingDestination
  2896. raw := NoMethod(*s)
  2897. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2898. }
  2899. // ManagedService: The full representation of a Service that is managed
  2900. // by
  2901. // Google Service Management.
  2902. type ManagedService struct {
  2903. // ProducerProjectId: ID of the project that produces and owns this
  2904. // service.
  2905. ProducerProjectId string `json:"producerProjectId,omitempty"`
  2906. // ServiceName: The name of the service. See the
  2907. // [overview](/service-management/overview)
  2908. // for naming requirements.
  2909. ServiceName string `json:"serviceName,omitempty"`
  2910. // ServerResponse contains the HTTP response code and headers from the
  2911. // server.
  2912. googleapi.ServerResponse `json:"-"`
  2913. // ForceSendFields is a list of field names (e.g. "ProducerProjectId")
  2914. // to unconditionally include in API requests. By default, fields with
  2915. // empty values are omitted from API requests. However, any non-pointer,
  2916. // non-interface field appearing in ForceSendFields will be sent to the
  2917. // server regardless of whether the field is empty or not. This may be
  2918. // used to include empty fields in Patch requests.
  2919. ForceSendFields []string `json:"-"`
  2920. // NullFields is a list of field names (e.g. "ProducerProjectId") to
  2921. // include in API requests with the JSON null value. By default, fields
  2922. // with empty values are omitted from API requests. However, any field
  2923. // with an empty value appearing in NullFields will be sent to the
  2924. // server as null. It is an error if a field in this list has a
  2925. // non-empty value. This may be used to include null fields in Patch
  2926. // requests.
  2927. NullFields []string `json:"-"`
  2928. }
  2929. func (s *ManagedService) MarshalJSON() ([]byte, error) {
  2930. type NoMethod ManagedService
  2931. raw := NoMethod(*s)
  2932. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2933. }
  2934. // Method: Method represents a method of an API interface.
  2935. type Method struct {
  2936. // Name: The simple name of this method.
  2937. Name string `json:"name,omitempty"`
  2938. // Options: Any metadata attached to the method.
  2939. Options []*Option `json:"options,omitempty"`
  2940. // RequestStreaming: If true, the request is streamed.
  2941. RequestStreaming bool `json:"requestStreaming,omitempty"`
  2942. // RequestTypeUrl: A URL of the input message type.
  2943. RequestTypeUrl string `json:"requestTypeUrl,omitempty"`
  2944. // ResponseStreaming: If true, the response is streamed.
  2945. ResponseStreaming bool `json:"responseStreaming,omitempty"`
  2946. // ResponseTypeUrl: The URL of the output message type.
  2947. ResponseTypeUrl string `json:"responseTypeUrl,omitempty"`
  2948. // Syntax: The source syntax of this method.
  2949. //
  2950. // Possible values:
  2951. // "SYNTAX_PROTO2" - Syntax `proto2`.
  2952. // "SYNTAX_PROTO3" - Syntax `proto3`.
  2953. Syntax string `json:"syntax,omitempty"`
  2954. // ForceSendFields is a list of field names (e.g. "Name") to
  2955. // unconditionally include in API requests. By default, fields with
  2956. // empty values are omitted from API requests. However, any non-pointer,
  2957. // non-interface field appearing in ForceSendFields will be sent to the
  2958. // server regardless of whether the field is empty or not. This may be
  2959. // used to include empty fields in Patch requests.
  2960. ForceSendFields []string `json:"-"`
  2961. // NullFields is a list of field names (e.g. "Name") to include in API
  2962. // requests with the JSON null value. By default, fields with empty
  2963. // values are omitted from API requests. However, any field with an
  2964. // empty value appearing in NullFields will be sent to the server as
  2965. // null. It is an error if a field in this list has a non-empty value.
  2966. // This may be used to include null fields in Patch requests.
  2967. NullFields []string `json:"-"`
  2968. }
  2969. func (s *Method) MarshalJSON() ([]byte, error) {
  2970. type NoMethod Method
  2971. raw := NoMethod(*s)
  2972. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2973. }
  2974. // MetricDescriptor: Defines a metric type and its schema. Once a metric
  2975. // descriptor is created,
  2976. // deleting or altering it stops data collection and makes the metric
  2977. // type's
  2978. // existing data unusable.
  2979. type MetricDescriptor struct {
  2980. // Description: A detailed description of the metric, which can be used
  2981. // in documentation.
  2982. Description string `json:"description,omitempty"`
  2983. // DisplayName: A concise name for the metric, which can be displayed in
  2984. // user interfaces.
  2985. // Use sentence case without an ending period, for example "Request
  2986. // count".
  2987. // This field is optional but it is recommended to be set for any
  2988. // metrics
  2989. // associated with user-visible concepts, such as Quota.
  2990. DisplayName string `json:"displayName,omitempty"`
  2991. // Labels: The set of labels that can be used to describe a
  2992. // specific
  2993. // instance of this metric type. For example,
  2994. // the
  2995. // `appengine.googleapis.com/http/server/response_latencies` metric
  2996. // type has a label for the HTTP response code, `response_code`, so
  2997. // you can look at latencies for successful responses or just
  2998. // for responses that failed.
  2999. Labels []*LabelDescriptor `json:"labels,omitempty"`
  3000. // Metadata: Optional. Metadata which can be used to guide usage of the
  3001. // metric.
  3002. Metadata *MetricDescriptorMetadata `json:"metadata,omitempty"`
  3003. // MetricKind: Whether the metric records instantaneous values, changes
  3004. // to a value, etc.
  3005. // Some combinations of `metric_kind` and `value_type` might not be
  3006. // supported.
  3007. //
  3008. // Possible values:
  3009. // "METRIC_KIND_UNSPECIFIED" - Do not use this default value.
  3010. // "GAUGE" - An instantaneous measurement of a value.
  3011. // "DELTA" - The change in a value during a time interval.
  3012. // "CUMULATIVE" - A value accumulated over a time interval.
  3013. // Cumulative
  3014. // measurements in a time series should have the same start time
  3015. // and increasing end times, until an event resets the cumulative
  3016. // value to zero and sets a new start time for the following
  3017. // points.
  3018. MetricKind string `json:"metricKind,omitempty"`
  3019. // Name: The resource name of the metric descriptor.
  3020. Name string `json:"name,omitempty"`
  3021. // Type: The metric type, including its DNS name prefix. The type is
  3022. // not
  3023. // URL-encoded. All user-defined metric types have the DNS
  3024. // name
  3025. // `custom.googleapis.com` or `external.googleapis.com`. Metric types
  3026. // should
  3027. // use a natural hierarchical grouping. For example:
  3028. //
  3029. // "custom.googleapis.com/invoice/paid/amount"
  3030. // "external.googleapis.com/prometheus/up"
  3031. // "appengine.googleapis.com/http/server/response_latencies"
  3032. Type string `json:"type,omitempty"`
  3033. // Unit: The unit in which the metric value is reported. It is only
  3034. // applicable
  3035. // if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`.
  3036. // The
  3037. // supported units are a subset of [The Unified Code for Units
  3038. // of
  3039. // Measure](http://unitsofmeasure.org/ucum.html) standard:
  3040. //
  3041. // **Basic units (UNIT)**
  3042. //
  3043. // * `bit` bit
  3044. // * `By` byte
  3045. // * `s` second
  3046. // * `min` minute
  3047. // * `h` hour
  3048. // * `d` day
  3049. //
  3050. // **Prefixes (PREFIX)**
  3051. //
  3052. // * `k` kilo (10**3)
  3053. // * `M` mega (10**6)
  3054. // * `G` giga (10**9)
  3055. // * `T` tera (10**12)
  3056. // * `P` peta (10**15)
  3057. // * `E` exa (10**18)
  3058. // * `Z` zetta (10**21)
  3059. // * `Y` yotta (10**24)
  3060. // * `m` milli (10**-3)
  3061. // * `u` micro (10**-6)
  3062. // * `n` nano (10**-9)
  3063. // * `p` pico (10**-12)
  3064. // * `f` femto (10**-15)
  3065. // * `a` atto (10**-18)
  3066. // * `z` zepto (10**-21)
  3067. // * `y` yocto (10**-24)
  3068. // * `Ki` kibi (2**10)
  3069. // * `Mi` mebi (2**20)
  3070. // * `Gi` gibi (2**30)
  3071. // * `Ti` tebi (2**40)
  3072. //
  3073. // **Grammar**
  3074. //
  3075. // The grammar also includes these connectors:
  3076. //
  3077. // * `/` division (as an infix operator, e.g. `1/s`).
  3078. // * `.` multiplication (as an infix operator, e.g. `GBy.d`)
  3079. //
  3080. // The grammar for a unit is as follows:
  3081. //
  3082. // Expression = Component { "." Component } { "/" Component } ;
  3083. //
  3084. // Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
  3085. // | Annotation
  3086. // | "1"
  3087. // ;
  3088. //
  3089. // Annotation = "{" NAME "}" ;
  3090. //
  3091. // Notes:
  3092. //
  3093. // * `Annotation` is just a comment if it follows a `UNIT` and is
  3094. // equivalent to `1` if it is used alone. For examples,
  3095. // `{requests}/s == 1/s`, `By{transmitted}/s == By/s`.
  3096. // * `NAME` is a sequence of non-blank printable ASCII characters not
  3097. // containing '{' or '}'.
  3098. // * `1` represents dimensionless value 1, such as in `1/s`.
  3099. // * `%` represents dimensionless value 1/100, and annotates values
  3100. // giving
  3101. // a percentage.
  3102. Unit string `json:"unit,omitempty"`
  3103. // ValueType: Whether the measurement is an integer, a floating-point
  3104. // number, etc.
  3105. // Some combinations of `metric_kind` and `value_type` might not be
  3106. // supported.
  3107. //
  3108. // Possible values:
  3109. // "VALUE_TYPE_UNSPECIFIED" - Do not use this default value.
  3110. // "BOOL" - The value is a boolean.
  3111. // This value type can be used only if the metric kind is `GAUGE`.
  3112. // "INT64" - The value is a signed 64-bit integer.
  3113. // "DOUBLE" - The value is a double precision floating point number.
  3114. // "STRING" - The value is a text string.
  3115. // This value type can be used only if the metric kind is `GAUGE`.
  3116. // "DISTRIBUTION" - The value is a `Distribution`.
  3117. // "MONEY" - The value is money.
  3118. ValueType string `json:"valueType,omitempty"`
  3119. // ForceSendFields is a list of field names (e.g. "Description") to
  3120. // unconditionally include in API requests. By default, fields with
  3121. // empty values are omitted from API requests. However, any non-pointer,
  3122. // non-interface field appearing in ForceSendFields will be sent to the
  3123. // server regardless of whether the field is empty or not. This may be
  3124. // used to include empty fields in Patch requests.
  3125. ForceSendFields []string `json:"-"`
  3126. // NullFields is a list of field names (e.g. "Description") to include
  3127. // in API requests with the JSON null value. By default, fields with
  3128. // empty values are omitted from API requests. However, any field with
  3129. // an empty value appearing in NullFields will be sent to the server as
  3130. // null. It is an error if a field in this list has a non-empty value.
  3131. // This may be used to include null fields in Patch requests.
  3132. NullFields []string `json:"-"`
  3133. }
  3134. func (s *MetricDescriptor) MarshalJSON() ([]byte, error) {
  3135. type NoMethod MetricDescriptor
  3136. raw := NoMethod(*s)
  3137. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3138. }
  3139. // MetricDescriptorMetadata: Additional annotations that can be used to
  3140. // guide the usage of a metric.
  3141. type MetricDescriptorMetadata struct {
  3142. // IngestDelay: The delay of data points caused by ingestion. Data
  3143. // points older than this
  3144. // age are guaranteed to be ingested and available to be read,
  3145. // excluding
  3146. // data loss due to errors.
  3147. IngestDelay string `json:"ingestDelay,omitempty"`
  3148. // LaunchStage: The launch stage of the metric definition.
  3149. //
  3150. // Possible values:
  3151. // "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value.
  3152. // "EARLY_ACCESS" - Early Access features are limited to a closed
  3153. // group of testers. To use
  3154. // these features, you must sign up in advance and sign a Trusted
  3155. // Tester
  3156. // agreement (which includes confidentiality provisions). These features
  3157. // may
  3158. // be unstable, changed in backward-incompatible ways, and are
  3159. // not
  3160. // guaranteed to be released.
  3161. // "ALPHA" - Alpha is a limited availability test for releases before
  3162. // they are cleared
  3163. // for widespread use. By Alpha, all significant design issues are
  3164. // resolved
  3165. // and we are in the process of verifying functionality. Alpha
  3166. // customers
  3167. // need to apply for access, agree to applicable terms, and have
  3168. // their
  3169. // projects whitelisted. Alpha releases don’t have to be feature
  3170. // complete,
  3171. // no SLAs are provided, and there are no technical support obligations,
  3172. // but
  3173. // they will be far enough along that customers can actually use them
  3174. // in
  3175. // test environments or for limited-use tests -- just like they would
  3176. // in
  3177. // normal production cases.
  3178. // "BETA" - Beta is the point at which we are ready to open a release
  3179. // for any
  3180. // customer to use. There are no SLA or technical support obligations in
  3181. // a
  3182. // Beta release. Products will be complete from a feature perspective,
  3183. // but
  3184. // may have some open outstanding issues. Beta releases are suitable
  3185. // for
  3186. // limited production use cases.
  3187. // "GA" - GA features are open to all developers and are considered
  3188. // stable and
  3189. // fully qualified for production use.
  3190. // "DEPRECATED" - Deprecated features are scheduled to be shut down
  3191. // and removed. For more
  3192. // information, see the “Deprecation Policy” section of our [Terms
  3193. // of
  3194. // Service](https://cloud.google.com/terms/)
  3195. // and the [Google Cloud Platform Subject to the
  3196. // Deprecation
  3197. // Policy](https://cloud.google.com/terms/deprecation) documentation.
  3198. LaunchStage string `json:"launchStage,omitempty"`
  3199. // SamplePeriod: The sampling period of metric data points. For metrics
  3200. // which are written
  3201. // periodically, consecutive data points are stored at this time
  3202. // interval,
  3203. // excluding data loss due to errors. Metrics with a higher granularity
  3204. // have
  3205. // a smaller sampling period.
  3206. SamplePeriod string `json:"samplePeriod,omitempty"`
  3207. // ForceSendFields is a list of field names (e.g. "IngestDelay") to
  3208. // unconditionally include in API requests. By default, fields with
  3209. // empty values are omitted from API requests. However, any non-pointer,
  3210. // non-interface field appearing in ForceSendFields will be sent to the
  3211. // server regardless of whether the field is empty or not. This may be
  3212. // used to include empty fields in Patch requests.
  3213. ForceSendFields []string `json:"-"`
  3214. // NullFields is a list of field names (e.g. "IngestDelay") to include
  3215. // in API requests with the JSON null value. By default, fields with
  3216. // empty values are omitted from API requests. However, any field with
  3217. // an empty value appearing in NullFields will be sent to the server as
  3218. // null. It is an error if a field in this list has a non-empty value.
  3219. // This may be used to include null fields in Patch requests.
  3220. NullFields []string `json:"-"`
  3221. }
  3222. func (s *MetricDescriptorMetadata) MarshalJSON() ([]byte, error) {
  3223. type NoMethod MetricDescriptorMetadata
  3224. raw := NoMethod(*s)
  3225. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3226. }
  3227. // MetricRule: Bind API methods to metrics. Binding a method to a metric
  3228. // causes that
  3229. // metric's configured quota behaviors to apply to the method call.
  3230. type MetricRule struct {
  3231. // MetricCosts: Metrics to update when the selected methods are called,
  3232. // and the associated
  3233. // cost applied to each metric.
  3234. //
  3235. // The key of the map is the metric name, and the values are the
  3236. // amount
  3237. // increased for the metric against which the quota limits are
  3238. // defined.
  3239. // The value must not be negative.
  3240. MetricCosts map[string]string `json:"metricCosts,omitempty"`
  3241. // Selector: Selects the methods to which this rule applies.
  3242. //
  3243. // Refer to selector for syntax details.
  3244. Selector string `json:"selector,omitempty"`
  3245. // ForceSendFields is a list of field names (e.g. "MetricCosts") to
  3246. // unconditionally include in API requests. By default, fields with
  3247. // empty values are omitted from API requests. However, any non-pointer,
  3248. // non-interface field appearing in ForceSendFields will be sent to the
  3249. // server regardless of whether the field is empty or not. This may be
  3250. // used to include empty fields in Patch requests.
  3251. ForceSendFields []string `json:"-"`
  3252. // NullFields is a list of field names (e.g. "MetricCosts") to include
  3253. // in API requests with the JSON null value. By default, fields with
  3254. // empty values are omitted from API requests. However, any field with
  3255. // an empty value appearing in NullFields will be sent to the server as
  3256. // null. It is an error if a field in this list has a non-empty value.
  3257. // This may be used to include null fields in Patch requests.
  3258. NullFields []string `json:"-"`
  3259. }
  3260. func (s *MetricRule) MarshalJSON() ([]byte, error) {
  3261. type NoMethod MetricRule
  3262. raw := NoMethod(*s)
  3263. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3264. }
  3265. // Mixin: Declares an API Interface to be included in this interface.
  3266. // The including
  3267. // interface must redeclare all the methods from the included interface,
  3268. // but
  3269. // documentation and options are inherited as follows:
  3270. //
  3271. // - If after comment and whitespace stripping, the documentation
  3272. // string of the redeclared method is empty, it will be inherited
  3273. // from the original method.
  3274. //
  3275. // - Each annotation belonging to the service config (http,
  3276. // visibility) which is not set in the redeclared method will be
  3277. // inherited.
  3278. //
  3279. // - If an http annotation is inherited, the path pattern will be
  3280. // modified as follows. Any version prefix will be replaced by the
  3281. // version of the including interface plus the root path if
  3282. // specified.
  3283. //
  3284. // Example of a simple mixin:
  3285. //
  3286. // package google.acl.v1;
  3287. // service AccessControl {
  3288. // // Get the underlying ACL object.
  3289. // rpc GetAcl(GetAclRequest) returns (Acl) {
  3290. // option (google.api.http).get = "/v1/{resource=**}:getAcl";
  3291. // }
  3292. // }
  3293. //
  3294. // package google.storage.v2;
  3295. // service Storage {
  3296. // // rpc GetAcl(GetAclRequest) returns (Acl);
  3297. //
  3298. // // Get a data record.
  3299. // rpc GetData(GetDataRequest) returns (Data) {
  3300. // option (google.api.http).get = "/v2/{resource=**}";
  3301. // }
  3302. // }
  3303. //
  3304. // Example of a mixin configuration:
  3305. //
  3306. // apis:
  3307. // - name: google.storage.v2.Storage
  3308. // mixins:
  3309. // - name: google.acl.v1.AccessControl
  3310. //
  3311. // The mixin construct implies that all methods in `AccessControl`
  3312. // are
  3313. // also declared with same name and request/response types in
  3314. // `Storage`. A documentation generator or annotation processor will
  3315. // see the effective `Storage.GetAcl` method after
  3316. // inherting
  3317. // documentation and annotations as follows:
  3318. //
  3319. // service Storage {
  3320. // // Get the underlying ACL object.
  3321. // rpc GetAcl(GetAclRequest) returns (Acl) {
  3322. // option (google.api.http).get = "/v2/{resource=**}:getAcl";
  3323. // }
  3324. // ...
  3325. // }
  3326. //
  3327. // Note how the version in the path pattern changed from `v1` to
  3328. // `v2`.
  3329. //
  3330. // If the `root` field in the mixin is specified, it should be
  3331. // a
  3332. // relative path under which inherited HTTP paths are placed. Example:
  3333. //
  3334. // apis:
  3335. // - name: google.storage.v2.Storage
  3336. // mixins:
  3337. // - name: google.acl.v1.AccessControl
  3338. // root: acls
  3339. //
  3340. // This implies the following inherited HTTP annotation:
  3341. //
  3342. // service Storage {
  3343. // // Get the underlying ACL object.
  3344. // rpc GetAcl(GetAclRequest) returns (Acl) {
  3345. // option (google.api.http).get =
  3346. // "/v2/acls/{resource=**}:getAcl";
  3347. // }
  3348. // ...
  3349. // }
  3350. type Mixin struct {
  3351. // Name: The fully qualified name of the interface which is included.
  3352. Name string `json:"name,omitempty"`
  3353. // Root: If non-empty specifies a path under which inherited HTTP
  3354. // paths
  3355. // are rooted.
  3356. Root string `json:"root,omitempty"`
  3357. // ForceSendFields is a list of field names (e.g. "Name") to
  3358. // unconditionally include in API requests. By default, fields with
  3359. // empty values are omitted from API requests. However, any non-pointer,
  3360. // non-interface field appearing in ForceSendFields will be sent to the
  3361. // server regardless of whether the field is empty or not. This may be
  3362. // used to include empty fields in Patch requests.
  3363. ForceSendFields []string `json:"-"`
  3364. // NullFields is a list of field names (e.g. "Name") to include in API
  3365. // requests with the JSON null value. By default, fields with empty
  3366. // values are omitted from API requests. However, any field with an
  3367. // empty value appearing in NullFields will be sent to the server as
  3368. // null. It is an error if a field in this list has a non-empty value.
  3369. // This may be used to include null fields in Patch requests.
  3370. NullFields []string `json:"-"`
  3371. }
  3372. func (s *Mixin) MarshalJSON() ([]byte, error) {
  3373. type NoMethod Mixin
  3374. raw := NoMethod(*s)
  3375. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3376. }
  3377. // MonitoredResourceDescriptor: An object that describes the schema of a
  3378. // MonitoredResource object using a
  3379. // type name and a set of labels. For example, the monitored
  3380. // resource
  3381. // descriptor for Google Compute Engine VM instances has a type
  3382. // of
  3383. // "gce_instance" and specifies the use of the labels "instance_id"
  3384. // and
  3385. // "zone" to identify particular VM instances.
  3386. //
  3387. // Different APIs can support different monitored resource types. APIs
  3388. // generally
  3389. // provide a `list` method that returns the monitored resource
  3390. // descriptors used
  3391. // by the API.
  3392. type MonitoredResourceDescriptor struct {
  3393. // Description: Optional. A detailed description of the monitored
  3394. // resource type that might
  3395. // be used in documentation.
  3396. Description string `json:"description,omitempty"`
  3397. // DisplayName: Optional. A concise name for the monitored resource type
  3398. // that might be
  3399. // displayed in user interfaces. It should be a Title Cased Noun
  3400. // Phrase,
  3401. // without any article or other determiners. For example,
  3402. // "Google Cloud SQL Database".
  3403. DisplayName string `json:"displayName,omitempty"`
  3404. // Labels: Required. A set of labels used to describe instances of this
  3405. // monitored
  3406. // resource type. For example, an individual Google Cloud SQL database
  3407. // is
  3408. // identified by values for the labels "database_id" and "zone".
  3409. Labels []*LabelDescriptor `json:"labels,omitempty"`
  3410. // Name: Optional. The resource name of the monitored resource
  3411. // descriptor:
  3412. // "projects/{project_id}/monitoredResourceDescriptors/{type
  3413. // }" where
  3414. // {type} is the value of the `type` field in this object
  3415. // and
  3416. // {project_id} is a project ID that provides API-specific context
  3417. // for
  3418. // accessing the type. APIs that do not use project information can use
  3419. // the
  3420. // resource name format "monitoredResourceDescriptors/{type}".
  3421. Name string `json:"name,omitempty"`
  3422. // Type: Required. The monitored resource type. For example, the
  3423. // type
  3424. // "cloudsql_database" represents databases in Google Cloud SQL.
  3425. // The maximum length of this value is 256 characters.
  3426. Type string `json:"type,omitempty"`
  3427. // ForceSendFields is a list of field names (e.g. "Description") to
  3428. // unconditionally include in API requests. By default, fields with
  3429. // empty values are omitted from API requests. However, any non-pointer,
  3430. // non-interface field appearing in ForceSendFields will be sent to the
  3431. // server regardless of whether the field is empty or not. This may be
  3432. // used to include empty fields in Patch requests.
  3433. ForceSendFields []string `json:"-"`
  3434. // NullFields is a list of field names (e.g. "Description") to include
  3435. // in API requests with the JSON null value. By default, fields with
  3436. // empty values are omitted from API requests. However, any field with
  3437. // an empty value appearing in NullFields will be sent to the server as
  3438. // null. It is an error if a field in this list has a non-empty value.
  3439. // This may be used to include null fields in Patch requests.
  3440. NullFields []string `json:"-"`
  3441. }
  3442. func (s *MonitoredResourceDescriptor) MarshalJSON() ([]byte, error) {
  3443. type NoMethod MonitoredResourceDescriptor
  3444. raw := NoMethod(*s)
  3445. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3446. }
  3447. // Monitoring: Monitoring configuration of the service.
  3448. //
  3449. // The example below shows how to configure monitored resources and
  3450. // metrics
  3451. // for monitoring. In the example, a monitored resource and two metrics
  3452. // are
  3453. // defined. The `library.googleapis.com/book/returned_count` metric is
  3454. // sent
  3455. // to both producer and consumer projects, whereas
  3456. // the
  3457. // `library.googleapis.com/book/overdue_count` metric is only sent to
  3458. // the
  3459. // consumer project.
  3460. //
  3461. // monitored_resources:
  3462. // - type: library.googleapis.com/branch
  3463. // labels:
  3464. // - key: /city
  3465. // description: The city where the library branch is located
  3466. // in.
  3467. // - key: /name
  3468. // description: The name of the branch.
  3469. // metrics:
  3470. // - name: library.googleapis.com/book/returned_count
  3471. // metric_kind: DELTA
  3472. // value_type: INT64
  3473. // labels:
  3474. // - key: /customer_id
  3475. // - name: library.googleapis.com/book/overdue_count
  3476. // metric_kind: GAUGE
  3477. // value_type: INT64
  3478. // labels:
  3479. // - key: /customer_id
  3480. // monitoring:
  3481. // producer_destinations:
  3482. // - monitored_resource: library.googleapis.com/branch
  3483. // metrics:
  3484. // - library.googleapis.com/book/returned_count
  3485. // consumer_destinations:
  3486. // - monitored_resource: library.googleapis.com/branch
  3487. // metrics:
  3488. // - library.googleapis.com/book/returned_count
  3489. // - library.googleapis.com/book/overdue_count
  3490. type Monitoring struct {
  3491. // ConsumerDestinations: Monitoring configurations for sending metrics
  3492. // to the consumer project.
  3493. // There can be multiple consumer destinations. A monitored resouce type
  3494. // may
  3495. // appear in multiple monitoring destinations if different aggregations
  3496. // are
  3497. // needed for different sets of metrics associated with that
  3498. // monitored
  3499. // resource type. A monitored resource and metric pair may only be used
  3500. // once
  3501. // in the Monitoring configuration.
  3502. ConsumerDestinations []*MonitoringDestination `json:"consumerDestinations,omitempty"`
  3503. // ProducerDestinations: Monitoring configurations for sending metrics
  3504. // to the producer project.
  3505. // There can be multiple producer destinations. A monitored resouce type
  3506. // may
  3507. // appear in multiple monitoring destinations if different aggregations
  3508. // are
  3509. // needed for different sets of metrics associated with that
  3510. // monitored
  3511. // resource type. A monitored resource and metric pair may only be used
  3512. // once
  3513. // in the Monitoring configuration.
  3514. ProducerDestinations []*MonitoringDestination `json:"producerDestinations,omitempty"`
  3515. // ForceSendFields is a list of field names (e.g.
  3516. // "ConsumerDestinations") to unconditionally include in API requests.
  3517. // By default, fields with empty values are omitted from API requests.
  3518. // However, any non-pointer, non-interface field appearing in
  3519. // ForceSendFields will be sent to the server regardless of whether the
  3520. // field is empty or not. This may be used to include empty fields in
  3521. // Patch requests.
  3522. ForceSendFields []string `json:"-"`
  3523. // NullFields is a list of field names (e.g. "ConsumerDestinations") to
  3524. // include in API requests with the JSON null value. By default, fields
  3525. // with empty values are omitted from API requests. However, any field
  3526. // with an empty value appearing in NullFields will be sent to the
  3527. // server as null. It is an error if a field in this list has a
  3528. // non-empty value. This may be used to include null fields in Patch
  3529. // requests.
  3530. NullFields []string `json:"-"`
  3531. }
  3532. func (s *Monitoring) MarshalJSON() ([]byte, error) {
  3533. type NoMethod Monitoring
  3534. raw := NoMethod(*s)
  3535. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3536. }
  3537. // MonitoringDestination: Configuration of a specific monitoring
  3538. // destination (the producer project
  3539. // or the consumer project).
  3540. type MonitoringDestination struct {
  3541. // Metrics: Types of the metrics to report to this monitoring
  3542. // destination.
  3543. // Each type must be defined in Service.metrics section.
  3544. Metrics []string `json:"metrics,omitempty"`
  3545. // MonitoredResource: The monitored resource type. The type must be
  3546. // defined in
  3547. // Service.monitored_resources section.
  3548. MonitoredResource string `json:"monitoredResource,omitempty"`
  3549. // ForceSendFields is a list of field names (e.g. "Metrics") to
  3550. // unconditionally include in API requests. By default, fields with
  3551. // empty values are omitted from API requests. However, any non-pointer,
  3552. // non-interface field appearing in ForceSendFields will be sent to the
  3553. // server regardless of whether the field is empty or not. This may be
  3554. // used to include empty fields in Patch requests.
  3555. ForceSendFields []string `json:"-"`
  3556. // NullFields is a list of field names (e.g. "Metrics") to include in
  3557. // API requests with the JSON null value. By default, fields with empty
  3558. // values are omitted from API requests. However, any field with an
  3559. // empty value appearing in NullFields will be sent to the server as
  3560. // null. It is an error if a field in this list has a non-empty value.
  3561. // This may be used to include null fields in Patch requests.
  3562. NullFields []string `json:"-"`
  3563. }
  3564. func (s *MonitoringDestination) MarshalJSON() ([]byte, error) {
  3565. type NoMethod MonitoringDestination
  3566. raw := NoMethod(*s)
  3567. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3568. }
  3569. // OAuthRequirements: OAuth scopes are a way to define data and
  3570. // permissions on data. For example,
  3571. // there are scopes defined for "Read-only access to Google Calendar"
  3572. // and
  3573. // "Access to Cloud Platform". Users can consent to a scope for an
  3574. // application,
  3575. // giving it permission to access that data on their behalf.
  3576. //
  3577. // OAuth scope specifications should be fairly coarse grained; a user
  3578. // will need
  3579. // to see and understand the text description of what your scope
  3580. // means.
  3581. //
  3582. // In most cases: use one or at most two OAuth scopes for an entire
  3583. // family of
  3584. // products. If your product has multiple APIs, you should probably be
  3585. // sharing
  3586. // the OAuth scope across all of those APIs.
  3587. //
  3588. // When you need finer grained OAuth consent screens: talk with your
  3589. // product
  3590. // management about how developers will use them in practice.
  3591. //
  3592. // Please note that even though each of the canonical scopes is enough
  3593. // for a
  3594. // request to be accepted and passed to the backend, a request can still
  3595. // fail
  3596. // due to the backend requiring additional scopes or permissions.
  3597. type OAuthRequirements struct {
  3598. // CanonicalScopes: The list of publicly documented OAuth scopes that
  3599. // are allowed access. An
  3600. // OAuth token containing any of these scopes will be
  3601. // accepted.
  3602. //
  3603. // Example:
  3604. //
  3605. // canonical_scopes: https://www.googleapis.com/auth/calendar,
  3606. // https://www.googleapis.com/auth/calendar.read
  3607. CanonicalScopes string `json:"canonicalScopes,omitempty"`
  3608. // ForceSendFields is a list of field names (e.g. "CanonicalScopes") to
  3609. // unconditionally include in API requests. By default, fields with
  3610. // empty values are omitted from API requests. However, any non-pointer,
  3611. // non-interface field appearing in ForceSendFields will be sent to the
  3612. // server regardless of whether the field is empty or not. This may be
  3613. // used to include empty fields in Patch requests.
  3614. ForceSendFields []string `json:"-"`
  3615. // NullFields is a list of field names (e.g. "CanonicalScopes") to
  3616. // include in API requests with the JSON null value. By default, fields
  3617. // with empty values are omitted from API requests. However, any field
  3618. // with an empty value appearing in NullFields will be sent to the
  3619. // server as null. It is an error if a field in this list has a
  3620. // non-empty value. This may be used to include null fields in Patch
  3621. // requests.
  3622. NullFields []string `json:"-"`
  3623. }
  3624. func (s *OAuthRequirements) MarshalJSON() ([]byte, error) {
  3625. type NoMethod OAuthRequirements
  3626. raw := NoMethod(*s)
  3627. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3628. }
  3629. // Operation: This resource represents a long-running operation that is
  3630. // the result of a
  3631. // network API call.
  3632. type Operation struct {
  3633. // Done: If the value is `false`, it means the operation is still in
  3634. // progress.
  3635. // If `true`, the operation is completed, and either `error` or
  3636. // `response` is
  3637. // available.
  3638. Done bool `json:"done,omitempty"`
  3639. // Error: The error result of the operation in case of failure or
  3640. // cancellation.
  3641. Error *Status `json:"error,omitempty"`
  3642. // Metadata: Service-specific metadata associated with the operation.
  3643. // It typically
  3644. // contains progress information and common metadata such as create
  3645. // time.
  3646. // Some services might not provide such metadata. Any method that
  3647. // returns a
  3648. // long-running operation should document the metadata type, if any.
  3649. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  3650. // Name: The server-assigned name, which is only unique within the same
  3651. // service that
  3652. // originally returns it. If you use the default HTTP mapping,
  3653. // the
  3654. // `name` should have the format of `operations/some/unique/name`.
  3655. Name string `json:"name,omitempty"`
  3656. // Response: The normal response of the operation in case of success.
  3657. // If the original
  3658. // method returns no data on success, such as `Delete`, the response
  3659. // is
  3660. // `google.protobuf.Empty`. If the original method is
  3661. // standard
  3662. // `Get`/`Create`/`Update`, the response should be the resource. For
  3663. // other
  3664. // methods, the response should have the type `XxxResponse`, where
  3665. // `Xxx`
  3666. // is the original method name. For example, if the original method
  3667. // name
  3668. // is `TakeSnapshot()`, the inferred response type
  3669. // is
  3670. // `TakeSnapshotResponse`.
  3671. Response googleapi.RawMessage `json:"response,omitempty"`
  3672. // ServerResponse contains the HTTP response code and headers from the
  3673. // server.
  3674. googleapi.ServerResponse `json:"-"`
  3675. // ForceSendFields is a list of field names (e.g. "Done") to
  3676. // unconditionally include in API requests. By default, fields with
  3677. // empty values are omitted from API requests. However, any non-pointer,
  3678. // non-interface field appearing in ForceSendFields will be sent to the
  3679. // server regardless of whether the field is empty or not. This may be
  3680. // used to include empty fields in Patch requests.
  3681. ForceSendFields []string `json:"-"`
  3682. // NullFields is a list of field names (e.g. "Done") to include in API
  3683. // requests with the JSON null value. By default, fields with empty
  3684. // values are omitted from API requests. However, any field with an
  3685. // empty value appearing in NullFields will be sent to the server as
  3686. // null. It is an error if a field in this list has a non-empty value.
  3687. // This may be used to include null fields in Patch requests.
  3688. NullFields []string `json:"-"`
  3689. }
  3690. func (s *Operation) MarshalJSON() ([]byte, error) {
  3691. type NoMethod Operation
  3692. raw := NoMethod(*s)
  3693. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3694. }
  3695. // OperationMetadata: The metadata associated with a long running
  3696. // operation resource.
  3697. type OperationMetadata struct {
  3698. // ProgressPercentage: Percentage of completion of this operation,
  3699. // ranging from 0 to 100.
  3700. ProgressPercentage int64 `json:"progressPercentage,omitempty"`
  3701. // ResourceNames: The full name of the resources that this operation is
  3702. // directly
  3703. // associated with.
  3704. ResourceNames []string `json:"resourceNames,omitempty"`
  3705. // StartTime: The start time of the operation.
  3706. StartTime string `json:"startTime,omitempty"`
  3707. // Steps: Detailed status information for each step. The order is
  3708. // undetermined.
  3709. Steps []*Step `json:"steps,omitempty"`
  3710. // ForceSendFields is a list of field names (e.g. "ProgressPercentage")
  3711. // to unconditionally include in API requests. By default, fields with
  3712. // empty values are omitted from API requests. However, any non-pointer,
  3713. // non-interface field appearing in ForceSendFields will be sent to the
  3714. // server regardless of whether the field is empty or not. This may be
  3715. // used to include empty fields in Patch requests.
  3716. ForceSendFields []string `json:"-"`
  3717. // NullFields is a list of field names (e.g. "ProgressPercentage") to
  3718. // include in API requests with the JSON null value. By default, fields
  3719. // with empty values are omitted from API requests. However, any field
  3720. // with an empty value appearing in NullFields will be sent to the
  3721. // server as null. It is an error if a field in this list has a
  3722. // non-empty value. This may be used to include null fields in Patch
  3723. // requests.
  3724. NullFields []string `json:"-"`
  3725. }
  3726. func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
  3727. type NoMethod OperationMetadata
  3728. raw := NoMethod(*s)
  3729. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3730. }
  3731. // Option: A protocol buffer option, which can be attached to a message,
  3732. // field,
  3733. // enumeration, etc.
  3734. type Option struct {
  3735. // Name: The option's name. For protobuf built-in options (options
  3736. // defined in
  3737. // descriptor.proto), this is the short name. For example,
  3738. // "map_entry".
  3739. // For custom options, it should be the fully-qualified name. For
  3740. // example,
  3741. // "google.api.http".
  3742. Name string `json:"name,omitempty"`
  3743. // Value: The option's value packed in an Any message. If the value is a
  3744. // primitive,
  3745. // the corresponding wrapper type defined in
  3746. // google/protobuf/wrappers.proto
  3747. // should be used. If the value is an enum, it should be stored as an
  3748. // int32
  3749. // value using the google.protobuf.Int32Value type.
  3750. Value googleapi.RawMessage `json:"value,omitempty"`
  3751. // ForceSendFields is a list of field names (e.g. "Name") to
  3752. // unconditionally include in API requests. By default, fields with
  3753. // empty values are omitted from API requests. However, any non-pointer,
  3754. // non-interface field appearing in ForceSendFields will be sent to the
  3755. // server regardless of whether the field is empty or not. This may be
  3756. // used to include empty fields in Patch requests.
  3757. ForceSendFields []string `json:"-"`
  3758. // NullFields is a list of field names (e.g. "Name") to include in API
  3759. // requests with the JSON null value. By default, fields with empty
  3760. // values are omitted from API requests. However, any field with an
  3761. // empty value appearing in NullFields will be sent to the server as
  3762. // null. It is an error if a field in this list has a non-empty value.
  3763. // This may be used to include null fields in Patch requests.
  3764. NullFields []string `json:"-"`
  3765. }
  3766. func (s *Option) MarshalJSON() ([]byte, error) {
  3767. type NoMethod Option
  3768. raw := NoMethod(*s)
  3769. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3770. }
  3771. // Page: Represents a documentation page. A page can contain subpages to
  3772. // represent
  3773. // nested documentation set structure.
  3774. type Page struct {
  3775. // Content: The Markdown content of the page. You can use <code>&#40;==
  3776. // include {path}
  3777. // ==&#41;</code> to include content from a Markdown file.
  3778. Content string `json:"content,omitempty"`
  3779. // Name: The name of the page. It will be used as an identity of the
  3780. // page to
  3781. // generate URI of the page, text of the link to this page in
  3782. // navigation,
  3783. // etc. The full page name (start from the root page name to this
  3784. // page
  3785. // concatenated with `.`) can be used as reference to the page in
  3786. // your
  3787. // documentation. For example:
  3788. // <pre><code>pages:
  3789. // - name: Tutorial
  3790. // content: &#40;== include tutorial.md ==&#41;
  3791. // subpages:
  3792. // - name: Java
  3793. // content: &#40;== include tutorial_java.md
  3794. // ==&#41;
  3795. // </code></pre>
  3796. // You can reference `Java` page using Markdown reference link
  3797. // syntax:
  3798. // `Java`.
  3799. Name string `json:"name,omitempty"`
  3800. // Subpages: Subpages of this page. The order of subpages specified here
  3801. // will be
  3802. // honored in the generated docset.
  3803. Subpages []*Page `json:"subpages,omitempty"`
  3804. // ForceSendFields is a list of field names (e.g. "Content") to
  3805. // unconditionally include in API requests. By default, fields with
  3806. // empty values are omitted from API requests. However, any non-pointer,
  3807. // non-interface field appearing in ForceSendFields will be sent to the
  3808. // server regardless of whether the field is empty or not. This may be
  3809. // used to include empty fields in Patch requests.
  3810. ForceSendFields []string `json:"-"`
  3811. // NullFields is a list of field names (e.g. "Content") to include in
  3812. // API requests with the JSON null value. By default, fields with empty
  3813. // values are omitted from API requests. However, any field with an
  3814. // empty value appearing in NullFields will be sent to the server as
  3815. // null. It is an error if a field in this list has a non-empty value.
  3816. // This may be used to include null fields in Patch requests.
  3817. NullFields []string `json:"-"`
  3818. }
  3819. func (s *Page) MarshalJSON() ([]byte, error) {
  3820. type NoMethod Page
  3821. raw := NoMethod(*s)
  3822. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3823. }
  3824. // Policy: Defines an Identity and Access Management (IAM) policy. It is
  3825. // used to
  3826. // specify access control policies for Cloud Platform resources.
  3827. //
  3828. //
  3829. // A `Policy` consists of a list of `bindings`. A `binding` binds a list
  3830. // of
  3831. // `members` to a `role`, where the members can be user accounts, Google
  3832. // groups,
  3833. // Google domains, and service accounts. A `role` is a named list of
  3834. // permissions
  3835. // defined by IAM.
  3836. //
  3837. // **JSON Example**
  3838. //
  3839. // {
  3840. // "bindings": [
  3841. // {
  3842. // "role": "roles/owner",
  3843. // "members": [
  3844. // "user:mike@example.com",
  3845. // "group:admins@example.com",
  3846. // "domain:google.com",
  3847. //
  3848. // "serviceAccount:my-other-app@appspot.gserviceaccount.com"
  3849. // ]
  3850. // },
  3851. // {
  3852. // "role": "roles/viewer",
  3853. // "members": ["user:sean@example.com"]
  3854. // }
  3855. // ]
  3856. // }
  3857. //
  3858. // **YAML Example**
  3859. //
  3860. // bindings:
  3861. // - members:
  3862. // - user:mike@example.com
  3863. // - group:admins@example.com
  3864. // - domain:google.com
  3865. // - serviceAccount:my-other-app@appspot.gserviceaccount.com
  3866. // role: roles/owner
  3867. // - members:
  3868. // - user:sean@example.com
  3869. // role: roles/viewer
  3870. //
  3871. //
  3872. // For a description of IAM and its features, see the
  3873. // [IAM developer's guide](https://cloud.google.com/iam/docs).
  3874. type Policy struct {
  3875. // AuditConfigs: Specifies cloud audit logging configuration for this
  3876. // policy.
  3877. AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
  3878. // Bindings: Associates a list of `members` to a `role`.
  3879. // `bindings` with no members will result in an error.
  3880. Bindings []*Binding `json:"bindings,omitempty"`
  3881. // Etag: `etag` is used for optimistic concurrency control as a way to
  3882. // help
  3883. // prevent simultaneous updates of a policy from overwriting each
  3884. // other.
  3885. // It is strongly suggested that systems make use of the `etag` in
  3886. // the
  3887. // read-modify-write cycle to perform policy updates in order to avoid
  3888. // race
  3889. // conditions: An `etag` is returned in the response to `getIamPolicy`,
  3890. // and
  3891. // systems are expected to put that etag in the request to
  3892. // `setIamPolicy` to
  3893. // ensure that their change will be applied to the same version of the
  3894. // policy.
  3895. //
  3896. // If no `etag` is provided in the call to `setIamPolicy`, then the
  3897. // existing
  3898. // policy is overwritten blindly.
  3899. Etag string `json:"etag,omitempty"`
  3900. // Version: Deprecated.
  3901. Version int64 `json:"version,omitempty"`
  3902. // ServerResponse contains the HTTP response code and headers from the
  3903. // server.
  3904. googleapi.ServerResponse `json:"-"`
  3905. // ForceSendFields is a list of field names (e.g. "AuditConfigs") to
  3906. // unconditionally include in API requests. By default, fields with
  3907. // empty values are omitted from API requests. However, any non-pointer,
  3908. // non-interface field appearing in ForceSendFields will be sent to the
  3909. // server regardless of whether the field is empty or not. This may be
  3910. // used to include empty fields in Patch requests.
  3911. ForceSendFields []string `json:"-"`
  3912. // NullFields is a list of field names (e.g. "AuditConfigs") to include
  3913. // in API requests with the JSON null value. By default, fields with
  3914. // empty values are omitted from API requests. However, any field with
  3915. // an empty value appearing in NullFields will be sent to the server as
  3916. // null. It is an error if a field in this list has a non-empty value.
  3917. // This may be used to include null fields in Patch requests.
  3918. NullFields []string `json:"-"`
  3919. }
  3920. func (s *Policy) MarshalJSON() ([]byte, error) {
  3921. type NoMethod Policy
  3922. raw := NoMethod(*s)
  3923. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3924. }
  3925. type Quota struct {
  3926. // Limits: List of `QuotaLimit` definitions for the service.
  3927. Limits []*QuotaLimit `json:"limits,omitempty"`
  3928. // MetricRules: List of `MetricRule` definitions, each one mapping a
  3929. // selected method to one
  3930. // or more metrics.
  3931. MetricRules []*MetricRule `json:"metricRules,omitempty"`
  3932. // ForceSendFields is a list of field names (e.g. "Limits") to
  3933. // unconditionally include in API requests. By default, fields with
  3934. // empty values are omitted from API requests. However, any non-pointer,
  3935. // non-interface field appearing in ForceSendFields will be sent to the
  3936. // server regardless of whether the field is empty or not. This may be
  3937. // used to include empty fields in Patch requests.
  3938. ForceSendFields []string `json:"-"`
  3939. // NullFields is a list of field names (e.g. "Limits") to include in API
  3940. // requests with the JSON null value. By default, fields with empty
  3941. // values are omitted from API requests. However, any field with an
  3942. // empty value appearing in NullFields will be sent to the server as
  3943. // null. It is an error if a field in this list has a non-empty value.
  3944. // This may be used to include null fields in Patch requests.
  3945. NullFields []string `json:"-"`
  3946. }
  3947. func (s *Quota) MarshalJSON() ([]byte, error) {
  3948. type NoMethod Quota
  3949. raw := NoMethod(*s)
  3950. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3951. }
  3952. // QuotaLimit: `QuotaLimit` defines a specific limit that applies over a
  3953. // specified duration
  3954. // for a limit type. There can be at most one limit for a duration and
  3955. // limit
  3956. // type combination defined within a `QuotaGroup`.
  3957. type QuotaLimit struct {
  3958. // DefaultLimit: Default number of tokens that can be consumed during
  3959. // the specified
  3960. // duration. This is the number of tokens assigned when a
  3961. // client
  3962. // application developer activates the service for his/her
  3963. // project.
  3964. //
  3965. // Specifying a value of 0 will block all requests. This can be used if
  3966. // you
  3967. // are provisioning quota to selected consumers and blocking
  3968. // others.
  3969. // Similarly, a value of -1 will indicate an unlimited quota. No
  3970. // other
  3971. // negative values are allowed.
  3972. //
  3973. // Used by group-based quotas only.
  3974. DefaultLimit int64 `json:"defaultLimit,omitempty,string"`
  3975. // Description: Optional. User-visible, extended description for this
  3976. // quota limit.
  3977. // Should be used only when more context is needed to understand this
  3978. // limit
  3979. // than provided by the limit's display name (see: `display_name`).
  3980. Description string `json:"description,omitempty"`
  3981. // DisplayName: User-visible display name for this limit.
  3982. // Optional. If not set, the UI will provide a default display name
  3983. // based on
  3984. // the quota configuration. This field can be used to override the
  3985. // default
  3986. // display name generated from the configuration.
  3987. DisplayName string `json:"displayName,omitempty"`
  3988. // Duration: Duration of this limit in textual notation. Example:
  3989. // "100s", "24h", "1d".
  3990. // For duration longer than a day, only multiple of days is supported.
  3991. // We
  3992. // support only "100s" and "1d" for now. Additional support will be
  3993. // added in
  3994. // the future. "0" indicates indefinite duration.
  3995. //
  3996. // Used by group-based quotas only.
  3997. Duration string `json:"duration,omitempty"`
  3998. // FreeTier: Free tier value displayed in the Developers Console for
  3999. // this limit.
  4000. // The free tier is the number of tokens that will be subtracted from
  4001. // the
  4002. // billed amount when billing is enabled.
  4003. // This field can only be set on a limit with duration "1d", in a
  4004. // billable
  4005. // group; it is invalid on any other limit. If this field is not set,
  4006. // it
  4007. // defaults to 0, indicating that there is no free tier for this
  4008. // service.
  4009. //
  4010. // Used by group-based quotas only.
  4011. FreeTier int64 `json:"freeTier,omitempty,string"`
  4012. // MaxLimit: Maximum number of tokens that can be consumed during the
  4013. // specified
  4014. // duration. Client application developers can override the default
  4015. // limit up
  4016. // to this maximum. If specified, this value cannot be set to a value
  4017. // less
  4018. // than the default limit. If not specified, it is set to the default
  4019. // limit.
  4020. //
  4021. // To allow clients to apply overrides with no upper bound, set this to
  4022. // -1,
  4023. // indicating unlimited maximum quota.
  4024. //
  4025. // Used by group-based quotas only.
  4026. MaxLimit int64 `json:"maxLimit,omitempty,string"`
  4027. // Metric: The name of the metric this quota limit applies to. The quota
  4028. // limits with
  4029. // the same metric will be checked together during runtime. The metric
  4030. // must be
  4031. // defined within the service config.
  4032. Metric string `json:"metric,omitempty"`
  4033. // Name: Name of the quota limit.
  4034. //
  4035. // The name must be provided, and it must be unique within the service.
  4036. // The
  4037. // name can only include alphanumeric characters as well as '-'.
  4038. //
  4039. // The maximum length of the limit name is 64 characters.
  4040. Name string `json:"name,omitempty"`
  4041. // Unit: Specify the unit of the quota limit. It uses the same syntax
  4042. // as
  4043. // Metric.unit. The supported unit kinds are determined by the
  4044. // quota
  4045. // backend system.
  4046. //
  4047. // Here are some examples:
  4048. // * "1/min/{project}" for quota per minute per project.
  4049. //
  4050. // Note: the order of unit components is insignificant.
  4051. // The "1" at the beginning is required to follow the metric unit
  4052. // syntax.
  4053. Unit string `json:"unit,omitempty"`
  4054. // Values: Tiered limit values. You must specify this as a key:value
  4055. // pair, with an
  4056. // integer value that is the maximum number of requests allowed for
  4057. // the
  4058. // specified unit. Currently only STANDARD is supported.
  4059. Values map[string]string `json:"values,omitempty"`
  4060. // ForceSendFields is a list of field names (e.g. "DefaultLimit") to
  4061. // unconditionally include in API requests. By default, fields with
  4062. // empty values are omitted from API requests. However, any non-pointer,
  4063. // non-interface field appearing in ForceSendFields will be sent to the
  4064. // server regardless of whether the field is empty or not. This may be
  4065. // used to include empty fields in Patch requests.
  4066. ForceSendFields []string `json:"-"`
  4067. // NullFields is a list of field names (e.g. "DefaultLimit") to include
  4068. // in API requests with the JSON null value. By default, fields with
  4069. // empty values are omitted from API requests. However, any field with
  4070. // an empty value appearing in NullFields will be sent to the server as
  4071. // null. It is an error if a field in this list has a non-empty value.
  4072. // This may be used to include null fields in Patch requests.
  4073. NullFields []string `json:"-"`
  4074. }
  4075. func (s *QuotaLimit) MarshalJSON() ([]byte, error) {
  4076. type NoMethod QuotaLimit
  4077. raw := NoMethod(*s)
  4078. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4079. }
  4080. // Rollout: A rollout resource that defines how service configuration
  4081. // versions are pushed
  4082. // to control plane systems. Typically, you create a new version of
  4083. // the
  4084. // service config, and then create a Rollout to push the service config.
  4085. type Rollout struct {
  4086. // CreateTime: Creation time of the rollout. Readonly.
  4087. CreateTime string `json:"createTime,omitempty"`
  4088. // CreatedBy: The user who created the Rollout. Readonly.
  4089. CreatedBy string `json:"createdBy,omitempty"`
  4090. // DeleteServiceStrategy: The strategy associated with a rollout to
  4091. // delete a `ManagedService`.
  4092. // Readonly.
  4093. DeleteServiceStrategy *DeleteServiceStrategy `json:"deleteServiceStrategy,omitempty"`
  4094. // RolloutId: Optional unique identifier of this Rollout. Only lower
  4095. // case letters, digits
  4096. // and '-' are allowed.
  4097. //
  4098. // If not specified by client, the server will generate one. The
  4099. // generated id
  4100. // will have the form of <date><revision number>, where "date" is the
  4101. // create
  4102. // date in ISO 8601 format. "revision number" is a monotonically
  4103. // increasing
  4104. // positive number that is reset every day for each service.
  4105. // An example of the generated rollout_id is '2016-02-16r1'
  4106. RolloutId string `json:"rolloutId,omitempty"`
  4107. // ServiceName: The name of the service associated with this Rollout.
  4108. ServiceName string `json:"serviceName,omitempty"`
  4109. // Status: The status of this rollout. Readonly. In case of a failed
  4110. // rollout,
  4111. // the system will automatically rollback to the current
  4112. // Rollout
  4113. // version. Readonly.
  4114. //
  4115. // Possible values:
  4116. // "ROLLOUT_STATUS_UNSPECIFIED" - No status specified.
  4117. // "IN_PROGRESS" - The Rollout is in progress.
  4118. // "SUCCESS" - The Rollout has completed successfully.
  4119. // "CANCELLED" - The Rollout has been cancelled. This can happen if
  4120. // you have overlapping
  4121. // Rollout pushes, and the previous ones will be cancelled.
  4122. // "FAILED" - The Rollout has failed and the rollback attempt has
  4123. // failed too.
  4124. // "PENDING" - The Rollout has not started yet and is pending for
  4125. // execution.
  4126. // "FAILED_ROLLED_BACK" - The Rollout has failed and rolled back to
  4127. // the previous successful
  4128. // Rollout.
  4129. Status string `json:"status,omitempty"`
  4130. // TrafficPercentStrategy: Google Service Control selects service
  4131. // configurations based on
  4132. // traffic percentage.
  4133. TrafficPercentStrategy *TrafficPercentStrategy `json:"trafficPercentStrategy,omitempty"`
  4134. // ServerResponse contains the HTTP response code and headers from the
  4135. // server.
  4136. googleapi.ServerResponse `json:"-"`
  4137. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  4138. // unconditionally include in API requests. By default, fields with
  4139. // empty values are omitted from API requests. However, any non-pointer,
  4140. // non-interface field appearing in ForceSendFields will be sent to the
  4141. // server regardless of whether the field is empty or not. This may be
  4142. // used to include empty fields in Patch requests.
  4143. ForceSendFields []string `json:"-"`
  4144. // NullFields is a list of field names (e.g. "CreateTime") to include in
  4145. // API requests with the JSON null value. By default, fields with empty
  4146. // values are omitted from API requests. However, any field with an
  4147. // empty value appearing in NullFields will be sent to the server as
  4148. // null. It is an error if a field in this list has a non-empty value.
  4149. // This may be used to include null fields in Patch requests.
  4150. NullFields []string `json:"-"`
  4151. }
  4152. func (s *Rollout) MarshalJSON() ([]byte, error) {
  4153. type NoMethod Rollout
  4154. raw := NoMethod(*s)
  4155. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4156. }
  4157. // Service: `Service` is the root object of Google service configuration
  4158. // schema. It
  4159. // describes basic information about a service, such as the name and
  4160. // the
  4161. // title, and delegates other aspects to sub-sections. Each sub-section
  4162. // is
  4163. // either a proto message or a repeated proto message that configures
  4164. // a
  4165. // specific aspect, such as auth. See each proto message definition for
  4166. // details.
  4167. //
  4168. // Example:
  4169. //
  4170. // type: google.api.Service
  4171. // config_version: 3
  4172. // name: calendar.googleapis.com
  4173. // title: Google Calendar API
  4174. // apis:
  4175. // - name: google.calendar.v3.Calendar
  4176. // authentication:
  4177. // providers:
  4178. // - id: google_calendar_auth
  4179. // jwks_uri: https://www.googleapis.com/oauth2/v1/certs
  4180. // issuer: https://securetoken.google.com
  4181. // rules:
  4182. // - selector: "*"
  4183. // requirements:
  4184. // provider_id: google_calendar_auth
  4185. type Service struct {
  4186. // Apis: A list of API interfaces exported by this service. Only the
  4187. // `name` field
  4188. // of the google.protobuf.Api needs to be provided by the
  4189. // configuration
  4190. // author, as the remaining fields will be derived from the IDL during
  4191. // the
  4192. // normalization process. It is an error to specify an API interface
  4193. // here
  4194. // which cannot be resolved against the associated IDL files.
  4195. Apis []*Api `json:"apis,omitempty"`
  4196. // Authentication: Auth configuration.
  4197. Authentication *Authentication `json:"authentication,omitempty"`
  4198. // Backend: API backend configuration.
  4199. Backend *Backend `json:"backend,omitempty"`
  4200. // Billing: Billing configuration.
  4201. Billing *Billing `json:"billing,omitempty"`
  4202. // ConfigVersion: The semantic version of the service configuration. The
  4203. // config version
  4204. // affects the interpretation of the service configuration. For
  4205. // example,
  4206. // certain features are enabled by default for certain config
  4207. // versions.
  4208. // The latest config version is `3`.
  4209. ConfigVersion int64 `json:"configVersion,omitempty"`
  4210. // Context: Context configuration.
  4211. Context *Context `json:"context,omitempty"`
  4212. // Control: Configuration for the service control plane.
  4213. Control *Control `json:"control,omitempty"`
  4214. // CustomError: Custom error configuration.
  4215. CustomError *CustomError `json:"customError,omitempty"`
  4216. // Documentation: Additional API documentation.
  4217. Documentation *Documentation `json:"documentation,omitempty"`
  4218. // Endpoints: Configuration for network endpoints. If this is empty,
  4219. // then an endpoint
  4220. // with the same name as the service is automatically generated to
  4221. // service all
  4222. // defined APIs.
  4223. Endpoints []*Endpoint `json:"endpoints,omitempty"`
  4224. // Enums: A list of all enum types included in this API service.
  4225. // Enums
  4226. // referenced directly or indirectly by the `apis` are
  4227. // automatically
  4228. // included. Enums which are not referenced but shall be
  4229. // included
  4230. // should be listed here by name. Example:
  4231. //
  4232. // enums:
  4233. // - name: google.someapi.v1.SomeEnum
  4234. Enums []*Enum `json:"enums,omitempty"`
  4235. // Experimental: Experimental configuration.
  4236. Experimental *Experimental `json:"experimental,omitempty"`
  4237. // Http: HTTP configuration.
  4238. Http *Http `json:"http,omitempty"`
  4239. // Id: A unique ID for a specific instance of this message, typically
  4240. // assigned
  4241. // by the client for tracking purpose. If empty, the server may choose
  4242. // to
  4243. // generate one instead. Must be no longer than 60 characters.
  4244. Id string `json:"id,omitempty"`
  4245. // Logging: Logging configuration.
  4246. Logging *Logging `json:"logging,omitempty"`
  4247. // Logs: Defines the logs used by this service.
  4248. Logs []*LogDescriptor `json:"logs,omitempty"`
  4249. // Metrics: Defines the metrics used by this service.
  4250. Metrics []*MetricDescriptor `json:"metrics,omitempty"`
  4251. // MonitoredResources: Defines the monitored resources used by this
  4252. // service. This is required
  4253. // by the Service.monitoring and Service.logging configurations.
  4254. MonitoredResources []*MonitoredResourceDescriptor `json:"monitoredResources,omitempty"`
  4255. // Monitoring: Monitoring configuration.
  4256. Monitoring *Monitoring `json:"monitoring,omitempty"`
  4257. // Name: The service name, which is a DNS-like logical identifier for
  4258. // the
  4259. // service, such as `calendar.googleapis.com`. The service
  4260. // name
  4261. // typically goes through DNS verification to make sure the owner
  4262. // of the service also owns the DNS name.
  4263. Name string `json:"name,omitempty"`
  4264. // ProducerProjectId: The Google project that owns this service.
  4265. ProducerProjectId string `json:"producerProjectId,omitempty"`
  4266. // Quota: Quota configuration.
  4267. Quota *Quota `json:"quota,omitempty"`
  4268. // SourceInfo: Output only. The source information for this
  4269. // configuration if available.
  4270. SourceInfo *SourceInfo `json:"sourceInfo,omitempty"`
  4271. // SystemParameters: System parameter configuration.
  4272. SystemParameters *SystemParameters `json:"systemParameters,omitempty"`
  4273. // SystemTypes: A list of all proto message types included in this API
  4274. // service.
  4275. // It serves similar purpose as [google.api.Service.types], except
  4276. // that
  4277. // these types are not needed by user-defined APIs. Therefore, they will
  4278. // not
  4279. // show up in the generated discovery doc. This field should only be
  4280. // used
  4281. // to define system APIs in ESF.
  4282. SystemTypes []*Type `json:"systemTypes,omitempty"`
  4283. // Title: The product title for this service.
  4284. Title string `json:"title,omitempty"`
  4285. // Types: A list of all proto message types included in this API
  4286. // service.
  4287. // Types referenced directly or indirectly by the `apis`
  4288. // are
  4289. // automatically included. Messages which are not referenced but
  4290. // shall be included, such as types used by the `google.protobuf.Any`
  4291. // type,
  4292. // should be listed here by name. Example:
  4293. //
  4294. // types:
  4295. // - name: google.protobuf.Int32
  4296. Types []*Type `json:"types,omitempty"`
  4297. // Usage: Configuration controlling usage of this service.
  4298. Usage *Usage `json:"usage,omitempty"`
  4299. // ServerResponse contains the HTTP response code and headers from the
  4300. // server.
  4301. googleapi.ServerResponse `json:"-"`
  4302. // ForceSendFields is a list of field names (e.g. "Apis") to
  4303. // unconditionally include in API requests. By default, fields with
  4304. // empty values are omitted from API requests. However, any non-pointer,
  4305. // non-interface field appearing in ForceSendFields will be sent to the
  4306. // server regardless of whether the field is empty or not. This may be
  4307. // used to include empty fields in Patch requests.
  4308. ForceSendFields []string `json:"-"`
  4309. // NullFields is a list of field names (e.g. "Apis") to include in API
  4310. // requests with the JSON null value. By default, fields with empty
  4311. // values are omitted from API requests. However, any field with an
  4312. // empty value appearing in NullFields will be sent to the server as
  4313. // null. It is an error if a field in this list has a non-empty value.
  4314. // This may be used to include null fields in Patch requests.
  4315. NullFields []string `json:"-"`
  4316. }
  4317. func (s *Service) MarshalJSON() ([]byte, error) {
  4318. type NoMethod Service
  4319. raw := NoMethod(*s)
  4320. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4321. }
  4322. // SetIamPolicyRequest: Request message for `SetIamPolicy` method.
  4323. type SetIamPolicyRequest struct {
  4324. // Policy: REQUIRED: The complete policy to be applied to the
  4325. // `resource`. The size of
  4326. // the policy is limited to a few 10s of KB. An empty policy is a
  4327. // valid policy but certain Cloud Platform services (such as
  4328. // Projects)
  4329. // might reject them.
  4330. Policy *Policy `json:"policy,omitempty"`
  4331. // UpdateMask: OPTIONAL: A FieldMask specifying which fields of the
  4332. // policy to modify. Only
  4333. // the fields in the mask will be modified. If no mask is provided,
  4334. // the
  4335. // following default mask is used:
  4336. // paths: "bindings, etag"
  4337. // This field is only used by Cloud IAM.
  4338. UpdateMask string `json:"updateMask,omitempty"`
  4339. // ForceSendFields is a list of field names (e.g. "Policy") to
  4340. // unconditionally include in API requests. By default, fields with
  4341. // empty values are omitted from API requests. However, any non-pointer,
  4342. // non-interface field appearing in ForceSendFields will be sent to the
  4343. // server regardless of whether the field is empty or not. This may be
  4344. // used to include empty fields in Patch requests.
  4345. ForceSendFields []string `json:"-"`
  4346. // NullFields is a list of field names (e.g. "Policy") to include in API
  4347. // requests with the JSON null value. By default, fields with empty
  4348. // values are omitted from API requests. However, any field with an
  4349. // empty value appearing in NullFields will be sent to the server as
  4350. // null. It is an error if a field in this list has a non-empty value.
  4351. // This may be used to include null fields in Patch requests.
  4352. NullFields []string `json:"-"`
  4353. }
  4354. func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
  4355. type NoMethod SetIamPolicyRequest
  4356. raw := NoMethod(*s)
  4357. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4358. }
  4359. // SourceContext: `SourceContext` represents information about the
  4360. // source of a
  4361. // protobuf element, like the file in which it is defined.
  4362. type SourceContext struct {
  4363. // FileName: The path-qualified name of the .proto file that contained
  4364. // the associated
  4365. // protobuf element. For example:
  4366. // "google/protobuf/source_context.proto".
  4367. FileName string `json:"fileName,omitempty"`
  4368. // ForceSendFields is a list of field names (e.g. "FileName") to
  4369. // unconditionally include in API requests. By default, fields with
  4370. // empty values are omitted from API requests. However, any non-pointer,
  4371. // non-interface field appearing in ForceSendFields will be sent to the
  4372. // server regardless of whether the field is empty or not. This may be
  4373. // used to include empty fields in Patch requests.
  4374. ForceSendFields []string `json:"-"`
  4375. // NullFields is a list of field names (e.g. "FileName") to include in
  4376. // API requests with the JSON null value. By default, fields with empty
  4377. // values are omitted from API requests. However, any field with an
  4378. // empty value appearing in NullFields will be sent to the server as
  4379. // null. It is an error if a field in this list has a non-empty value.
  4380. // This may be used to include null fields in Patch requests.
  4381. NullFields []string `json:"-"`
  4382. }
  4383. func (s *SourceContext) MarshalJSON() ([]byte, error) {
  4384. type NoMethod SourceContext
  4385. raw := NoMethod(*s)
  4386. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4387. }
  4388. // SourceInfo: Source information used to create a Service Config
  4389. type SourceInfo struct {
  4390. // SourceFiles: All files used during config generation.
  4391. SourceFiles []googleapi.RawMessage `json:"sourceFiles,omitempty"`
  4392. // ForceSendFields is a list of field names (e.g. "SourceFiles") to
  4393. // unconditionally include in API requests. By default, fields with
  4394. // empty values are omitted from API requests. However, any non-pointer,
  4395. // non-interface field appearing in ForceSendFields will be sent to the
  4396. // server regardless of whether the field is empty or not. This may be
  4397. // used to include empty fields in Patch requests.
  4398. ForceSendFields []string `json:"-"`
  4399. // NullFields is a list of field names (e.g. "SourceFiles") to include
  4400. // in API requests with the JSON null value. By default, fields with
  4401. // empty values are omitted from API requests. However, any field with
  4402. // an empty value appearing in NullFields will be sent to the server as
  4403. // null. It is an error if a field in this list has a non-empty value.
  4404. // This may be used to include null fields in Patch requests.
  4405. NullFields []string `json:"-"`
  4406. }
  4407. func (s *SourceInfo) MarshalJSON() ([]byte, error) {
  4408. type NoMethod SourceInfo
  4409. raw := NoMethod(*s)
  4410. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4411. }
  4412. // Status: The `Status` type defines a logical error model that is
  4413. // suitable for
  4414. // different programming environments, including REST APIs and RPC APIs.
  4415. // It is
  4416. // used by [gRPC](https://github.com/grpc). The error model is designed
  4417. // to be:
  4418. //
  4419. // - Simple to use and understand for most users
  4420. // - Flexible enough to meet unexpected needs
  4421. //
  4422. // # Overview
  4423. //
  4424. // The `Status` message contains three pieces of data: error code,
  4425. // error
  4426. // message, and error details. The error code should be an enum value
  4427. // of
  4428. // google.rpc.Code, but it may accept additional error codes if needed.
  4429. // The
  4430. // error message should be a developer-facing English message that
  4431. // helps
  4432. // developers *understand* and *resolve* the error. If a localized
  4433. // user-facing
  4434. // error message is needed, put the localized message in the error
  4435. // details or
  4436. // localize it in the client. The optional error details may contain
  4437. // arbitrary
  4438. // information about the error. There is a predefined set of error
  4439. // detail types
  4440. // in the package `google.rpc` that can be used for common error
  4441. // conditions.
  4442. //
  4443. // # Language mapping
  4444. //
  4445. // The `Status` message is the logical representation of the error
  4446. // model, but it
  4447. // is not necessarily the actual wire format. When the `Status` message
  4448. // is
  4449. // exposed in different client libraries and different wire protocols,
  4450. // it can be
  4451. // mapped differently. For example, it will likely be mapped to some
  4452. // exceptions
  4453. // in Java, but more likely mapped to some error codes in C.
  4454. //
  4455. // # Other uses
  4456. //
  4457. // The error model and the `Status` message can be used in a variety
  4458. // of
  4459. // environments, either with or without APIs, to provide a
  4460. // consistent developer experience across different
  4461. // environments.
  4462. //
  4463. // Example uses of this error model include:
  4464. //
  4465. // - Partial errors. If a service needs to return partial errors to the
  4466. // client,
  4467. // it may embed the `Status` in the normal response to indicate the
  4468. // partial
  4469. // errors.
  4470. //
  4471. // - Workflow errors. A typical workflow has multiple steps. Each step
  4472. // may
  4473. // have a `Status` message for error reporting.
  4474. //
  4475. // - Batch operations. If a client uses batch request and batch
  4476. // response, the
  4477. // `Status` message should be used directly inside batch response,
  4478. // one for
  4479. // each error sub-response.
  4480. //
  4481. // - Asynchronous operations. If an API call embeds asynchronous
  4482. // operation
  4483. // results in its response, the status of those operations should
  4484. // be
  4485. // represented directly using the `Status` message.
  4486. //
  4487. // - Logging. If some API errors are stored in logs, the message
  4488. // `Status` could
  4489. // be used directly after any stripping needed for security/privacy
  4490. // reasons.
  4491. type Status struct {
  4492. // Code: The status code, which should be an enum value of
  4493. // google.rpc.Code.
  4494. Code int64 `json:"code,omitempty"`
  4495. // Details: A list of messages that carry the error details. There is a
  4496. // common set of
  4497. // message types for APIs to use.
  4498. Details []googleapi.RawMessage `json:"details,omitempty"`
  4499. // Message: A developer-facing error message, which should be in
  4500. // English. Any
  4501. // user-facing error message should be localized and sent in
  4502. // the
  4503. // google.rpc.Status.details field, or localized by the client.
  4504. Message string `json:"message,omitempty"`
  4505. // ForceSendFields is a list of field names (e.g. "Code") to
  4506. // unconditionally include in API requests. By default, fields with
  4507. // empty values are omitted from API requests. However, any non-pointer,
  4508. // non-interface field appearing in ForceSendFields will be sent to the
  4509. // server regardless of whether the field is empty or not. This may be
  4510. // used to include empty fields in Patch requests.
  4511. ForceSendFields []string `json:"-"`
  4512. // NullFields is a list of field names (e.g. "Code") to include in API
  4513. // requests with the JSON null value. By default, fields with empty
  4514. // values are omitted from API requests. However, any field with an
  4515. // empty value appearing in NullFields will be sent to the server as
  4516. // null. It is an error if a field in this list has a non-empty value.
  4517. // This may be used to include null fields in Patch requests.
  4518. NullFields []string `json:"-"`
  4519. }
  4520. func (s *Status) MarshalJSON() ([]byte, error) {
  4521. type NoMethod Status
  4522. raw := NoMethod(*s)
  4523. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4524. }
  4525. // Step: Represents the status of one operation step.
  4526. type Step struct {
  4527. // Description: The short description of the step.
  4528. Description string `json:"description,omitempty"`
  4529. // Status: The status code.
  4530. //
  4531. // Possible values:
  4532. // "STATUS_UNSPECIFIED" - Unspecifed code.
  4533. // "DONE" - The operation or step has completed without errors.
  4534. // "NOT_STARTED" - The operation or step has not started yet.
  4535. // "IN_PROGRESS" - The operation or step is in progress.
  4536. // "FAILED" - The operation or step has completed with errors. If the
  4537. // operation is
  4538. // rollbackable, the rollback completed with errors too.
  4539. // "CANCELLED" - The operation or step has completed with
  4540. // cancellation.
  4541. Status string `json:"status,omitempty"`
  4542. // ForceSendFields is a list of field names (e.g. "Description") to
  4543. // unconditionally include in API requests. By default, fields with
  4544. // empty values are omitted from API requests. However, any non-pointer,
  4545. // non-interface field appearing in ForceSendFields will be sent to the
  4546. // server regardless of whether the field is empty or not. This may be
  4547. // used to include empty fields in Patch requests.
  4548. ForceSendFields []string `json:"-"`
  4549. // NullFields is a list of field names (e.g. "Description") to include
  4550. // in API requests with the JSON null value. By default, fields with
  4551. // empty values are omitted from API requests. However, any field with
  4552. // an empty value appearing in NullFields will be sent to the server as
  4553. // null. It is an error if a field in this list has a non-empty value.
  4554. // This may be used to include null fields in Patch requests.
  4555. NullFields []string `json:"-"`
  4556. }
  4557. func (s *Step) MarshalJSON() ([]byte, error) {
  4558. type NoMethod Step
  4559. raw := NoMethod(*s)
  4560. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4561. }
  4562. // SubmitConfigSourceRequest: Request message for SubmitConfigSource
  4563. // method.
  4564. type SubmitConfigSourceRequest struct {
  4565. // ConfigSource: The source configuration for the service.
  4566. ConfigSource *ConfigSource `json:"configSource,omitempty"`
  4567. // ValidateOnly: Optional. If set, this will result in the generation of
  4568. // a
  4569. // `google.api.Service` configuration based on the `ConfigSource`
  4570. // provided,
  4571. // but the generated config and the sources will NOT be persisted.
  4572. ValidateOnly bool `json:"validateOnly,omitempty"`
  4573. // ForceSendFields is a list of field names (e.g. "ConfigSource") to
  4574. // unconditionally include in API requests. By default, fields with
  4575. // empty values are omitted from API requests. However, any non-pointer,
  4576. // non-interface field appearing in ForceSendFields will be sent to the
  4577. // server regardless of whether the field is empty or not. This may be
  4578. // used to include empty fields in Patch requests.
  4579. ForceSendFields []string `json:"-"`
  4580. // NullFields is a list of field names (e.g. "ConfigSource") to include
  4581. // in API requests with the JSON null value. By default, fields with
  4582. // empty values are omitted from API requests. However, any field with
  4583. // an empty value appearing in NullFields will be sent to the server as
  4584. // null. It is an error if a field in this list has a non-empty value.
  4585. // This may be used to include null fields in Patch requests.
  4586. NullFields []string `json:"-"`
  4587. }
  4588. func (s *SubmitConfigSourceRequest) MarshalJSON() ([]byte, error) {
  4589. type NoMethod SubmitConfigSourceRequest
  4590. raw := NoMethod(*s)
  4591. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4592. }
  4593. // SubmitConfigSourceResponse: Response message for SubmitConfigSource
  4594. // method.
  4595. type SubmitConfigSourceResponse struct {
  4596. // ServiceConfig: The generated service configuration.
  4597. ServiceConfig *Service `json:"serviceConfig,omitempty"`
  4598. // ForceSendFields is a list of field names (e.g. "ServiceConfig") to
  4599. // unconditionally include in API requests. By default, fields with
  4600. // empty values are omitted from API requests. However, any non-pointer,
  4601. // non-interface field appearing in ForceSendFields will be sent to the
  4602. // server regardless of whether the field is empty or not. This may be
  4603. // used to include empty fields in Patch requests.
  4604. ForceSendFields []string `json:"-"`
  4605. // NullFields is a list of field names (e.g. "ServiceConfig") to include
  4606. // in API requests with the JSON null value. By default, fields with
  4607. // empty values are omitted from API requests. However, any field with
  4608. // an empty value appearing in NullFields will be sent to the server as
  4609. // null. It is an error if a field in this list has a non-empty value.
  4610. // This may be used to include null fields in Patch requests.
  4611. NullFields []string `json:"-"`
  4612. }
  4613. func (s *SubmitConfigSourceResponse) MarshalJSON() ([]byte, error) {
  4614. type NoMethod SubmitConfigSourceResponse
  4615. raw := NoMethod(*s)
  4616. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4617. }
  4618. // SystemParameter: Define a parameter's name and location. The
  4619. // parameter may be passed as either
  4620. // an HTTP header or a URL query parameter, and if both are passed the
  4621. // behavior
  4622. // is implementation-dependent.
  4623. type SystemParameter struct {
  4624. // HttpHeader: Define the HTTP header name to use for the parameter. It
  4625. // is case
  4626. // insensitive.
  4627. HttpHeader string `json:"httpHeader,omitempty"`
  4628. // Name: Define the name of the parameter, such as "api_key" . It is
  4629. // case sensitive.
  4630. Name string `json:"name,omitempty"`
  4631. // UrlQueryParameter: Define the URL query parameter name to use for the
  4632. // parameter. It is case
  4633. // sensitive.
  4634. UrlQueryParameter string `json:"urlQueryParameter,omitempty"`
  4635. // ForceSendFields is a list of field names (e.g. "HttpHeader") to
  4636. // unconditionally include in API requests. By default, fields with
  4637. // empty values are omitted from API requests. However, any non-pointer,
  4638. // non-interface field appearing in ForceSendFields will be sent to the
  4639. // server regardless of whether the field is empty or not. This may be
  4640. // used to include empty fields in Patch requests.
  4641. ForceSendFields []string `json:"-"`
  4642. // NullFields is a list of field names (e.g. "HttpHeader") to include in
  4643. // API requests with the JSON null value. By default, fields with empty
  4644. // values are omitted from API requests. However, any field with an
  4645. // empty value appearing in NullFields will be sent to the server as
  4646. // null. It is an error if a field in this list has a non-empty value.
  4647. // This may be used to include null fields in Patch requests.
  4648. NullFields []string `json:"-"`
  4649. }
  4650. func (s *SystemParameter) MarshalJSON() ([]byte, error) {
  4651. type NoMethod SystemParameter
  4652. raw := NoMethod(*s)
  4653. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4654. }
  4655. // SystemParameterRule: Define a system parameter rule mapping system
  4656. // parameter definitions to
  4657. // methods.
  4658. type SystemParameterRule struct {
  4659. // Parameters: Define parameters. Multiple names may be defined for a
  4660. // parameter.
  4661. // For a given method call, only one of them should be used. If
  4662. // multiple
  4663. // names are used the behavior is implementation-dependent.
  4664. // If none of the specified names are present the behavior
  4665. // is
  4666. // parameter-dependent.
  4667. Parameters []*SystemParameter `json:"parameters,omitempty"`
  4668. // Selector: Selects the methods to which this rule applies. Use '*' to
  4669. // indicate all
  4670. // methods in all APIs.
  4671. //
  4672. // Refer to selector for syntax details.
  4673. Selector string `json:"selector,omitempty"`
  4674. // ForceSendFields is a list of field names (e.g. "Parameters") to
  4675. // unconditionally include in API requests. By default, fields with
  4676. // empty values are omitted from API requests. However, any non-pointer,
  4677. // non-interface field appearing in ForceSendFields will be sent to the
  4678. // server regardless of whether the field is empty or not. This may be
  4679. // used to include empty fields in Patch requests.
  4680. ForceSendFields []string `json:"-"`
  4681. // NullFields is a list of field names (e.g. "Parameters") to include in
  4682. // API requests with the JSON null value. By default, fields with empty
  4683. // values are omitted from API requests. However, any field with an
  4684. // empty value appearing in NullFields will be sent to the server as
  4685. // null. It is an error if a field in this list has a non-empty value.
  4686. // This may be used to include null fields in Patch requests.
  4687. NullFields []string `json:"-"`
  4688. }
  4689. func (s *SystemParameterRule) MarshalJSON() ([]byte, error) {
  4690. type NoMethod SystemParameterRule
  4691. raw := NoMethod(*s)
  4692. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4693. }
  4694. // SystemParameters: ### System parameter configuration
  4695. //
  4696. // A system parameter is a special kind of parameter defined by the
  4697. // API
  4698. // system, not by an individual API. It is typically mapped to an HTTP
  4699. // header
  4700. // and/or a URL query parameter. This configuration specifies which
  4701. // methods
  4702. // change the names of the system parameters.
  4703. type SystemParameters struct {
  4704. // Rules: Define system parameters.
  4705. //
  4706. // The parameters defined here will override the default
  4707. // parameters
  4708. // implemented by the system. If this field is missing from the
  4709. // service
  4710. // config, default system parameters will be used. Default system
  4711. // parameters
  4712. // and names is implementation-dependent.
  4713. //
  4714. // Example: define api key for all methods
  4715. //
  4716. // system_parameters
  4717. // rules:
  4718. // - selector: "*"
  4719. // parameters:
  4720. // - name: api_key
  4721. // url_query_parameter: api_key
  4722. //
  4723. //
  4724. // Example: define 2 api key names for a specific method.
  4725. //
  4726. // system_parameters
  4727. // rules:
  4728. // - selector: "/ListShelves"
  4729. // parameters:
  4730. // - name: api_key
  4731. // http_header: Api-Key1
  4732. // - name: api_key
  4733. // http_header: Api-Key2
  4734. //
  4735. // **NOTE:** All service configuration rules follow "last one wins"
  4736. // order.
  4737. Rules []*SystemParameterRule `json:"rules,omitempty"`
  4738. // ForceSendFields is a list of field names (e.g. "Rules") to
  4739. // unconditionally include in API requests. By default, fields with
  4740. // empty values are omitted from API requests. However, any non-pointer,
  4741. // non-interface field appearing in ForceSendFields will be sent to the
  4742. // server regardless of whether the field is empty or not. This may be
  4743. // used to include empty fields in Patch requests.
  4744. ForceSendFields []string `json:"-"`
  4745. // NullFields is a list of field names (e.g. "Rules") to include in API
  4746. // requests with the JSON null value. By default, fields with empty
  4747. // values are omitted from API requests. However, any field with an
  4748. // empty value appearing in NullFields will be sent to the server as
  4749. // null. It is an error if a field in this list has a non-empty value.
  4750. // This may be used to include null fields in Patch requests.
  4751. NullFields []string `json:"-"`
  4752. }
  4753. func (s *SystemParameters) MarshalJSON() ([]byte, error) {
  4754. type NoMethod SystemParameters
  4755. raw := NoMethod(*s)
  4756. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4757. }
  4758. // TestIamPermissionsRequest: Request message for `TestIamPermissions`
  4759. // method.
  4760. type TestIamPermissionsRequest struct {
  4761. // Permissions: The set of permissions to check for the `resource`.
  4762. // Permissions with
  4763. // wildcards (such as '*' or 'storage.*') are not allowed. For
  4764. // more
  4765. // information see
  4766. // [IAM
  4767. // Overview](https://cloud.google.com/iam/docs/overview#permissions).
  4768. Permissions []string `json:"permissions,omitempty"`
  4769. // ForceSendFields is a list of field names (e.g. "Permissions") to
  4770. // unconditionally include in API requests. By default, fields with
  4771. // empty values are omitted from API requests. However, any non-pointer,
  4772. // non-interface field appearing in ForceSendFields will be sent to the
  4773. // server regardless of whether the field is empty or not. This may be
  4774. // used to include empty fields in Patch requests.
  4775. ForceSendFields []string `json:"-"`
  4776. // NullFields is a list of field names (e.g. "Permissions") to include
  4777. // in API requests with the JSON null value. By default, fields with
  4778. // empty values are omitted from API requests. However, any field with
  4779. // an empty value appearing in NullFields will be sent to the server as
  4780. // null. It is an error if a field in this list has a non-empty value.
  4781. // This may be used to include null fields in Patch requests.
  4782. NullFields []string `json:"-"`
  4783. }
  4784. func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
  4785. type NoMethod TestIamPermissionsRequest
  4786. raw := NoMethod(*s)
  4787. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4788. }
  4789. // TestIamPermissionsResponse: Response message for `TestIamPermissions`
  4790. // method.
  4791. type TestIamPermissionsResponse struct {
  4792. // Permissions: A subset of `TestPermissionsRequest.permissions` that
  4793. // the caller is
  4794. // allowed.
  4795. Permissions []string `json:"permissions,omitempty"`
  4796. // ServerResponse contains the HTTP response code and headers from the
  4797. // server.
  4798. googleapi.ServerResponse `json:"-"`
  4799. // ForceSendFields is a list of field names (e.g. "Permissions") to
  4800. // unconditionally include in API requests. By default, fields with
  4801. // empty values are omitted from API requests. However, any non-pointer,
  4802. // non-interface field appearing in ForceSendFields will be sent to the
  4803. // server regardless of whether the field is empty or not. This may be
  4804. // used to include empty fields in Patch requests.
  4805. ForceSendFields []string `json:"-"`
  4806. // NullFields is a list of field names (e.g. "Permissions") to include
  4807. // in API requests with the JSON null value. By default, fields with
  4808. // empty values are omitted from API requests. However, any field with
  4809. // an empty value appearing in NullFields will be sent to the server as
  4810. // null. It is an error if a field in this list has a non-empty value.
  4811. // This may be used to include null fields in Patch requests.
  4812. NullFields []string `json:"-"`
  4813. }
  4814. func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
  4815. type NoMethod TestIamPermissionsResponse
  4816. raw := NoMethod(*s)
  4817. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4818. }
  4819. // TrafficPercentStrategy: Strategy that specifies how clients of Google
  4820. // Service Controller want to
  4821. // send traffic to use different config versions. This is generally
  4822. // used by API proxy to split traffic based on your configured
  4823. // precentage for
  4824. // each config version.
  4825. //
  4826. // One example of how to gradually rollout a new service configuration
  4827. // using
  4828. // this
  4829. // strategy:
  4830. // Day 1
  4831. //
  4832. // Rollout {
  4833. // id: "example.googleapis.com/rollout_20160206"
  4834. // traffic_percent_strategy {
  4835. // percentages: {
  4836. // "example.googleapis.com/20160201": 70.00
  4837. // "example.googleapis.com/20160206": 30.00
  4838. // }
  4839. // }
  4840. // }
  4841. //
  4842. // Day 2
  4843. //
  4844. // Rollout {
  4845. // id: "example.googleapis.com/rollout_20160207"
  4846. // traffic_percent_strategy: {
  4847. // percentages: {
  4848. // "example.googleapis.com/20160206": 100.00
  4849. // }
  4850. // }
  4851. // }
  4852. type TrafficPercentStrategy struct {
  4853. // Percentages: Maps service configuration IDs to their corresponding
  4854. // traffic percentage.
  4855. // Key is the service configuration ID, Value is the traffic
  4856. // percentage
  4857. // which must be greater than 0.0 and the sum must equal to 100.0.
  4858. Percentages map[string]float64 `json:"percentages,omitempty"`
  4859. // ForceSendFields is a list of field names (e.g. "Percentages") to
  4860. // unconditionally include in API requests. By default, fields with
  4861. // empty values are omitted from API requests. However, any non-pointer,
  4862. // non-interface field appearing in ForceSendFields will be sent to the
  4863. // server regardless of whether the field is empty or not. This may be
  4864. // used to include empty fields in Patch requests.
  4865. ForceSendFields []string `json:"-"`
  4866. // NullFields is a list of field names (e.g. "Percentages") to include
  4867. // in API requests with the JSON null value. By default, fields with
  4868. // empty values are omitted from API requests. However, any field with
  4869. // an empty value appearing in NullFields will be sent to the server as
  4870. // null. It is an error if a field in this list has a non-empty value.
  4871. // This may be used to include null fields in Patch requests.
  4872. NullFields []string `json:"-"`
  4873. }
  4874. func (s *TrafficPercentStrategy) MarshalJSON() ([]byte, error) {
  4875. type NoMethod TrafficPercentStrategy
  4876. raw := NoMethod(*s)
  4877. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4878. }
  4879. // Type: A protocol buffer message type.
  4880. type Type struct {
  4881. // Fields: The list of fields.
  4882. Fields []*Field `json:"fields,omitempty"`
  4883. // Name: The fully qualified message name.
  4884. Name string `json:"name,omitempty"`
  4885. // Oneofs: The list of types appearing in `oneof` definitions in this
  4886. // type.
  4887. Oneofs []string `json:"oneofs,omitempty"`
  4888. // Options: The protocol buffer options.
  4889. Options []*Option `json:"options,omitempty"`
  4890. // SourceContext: The source context.
  4891. SourceContext *SourceContext `json:"sourceContext,omitempty"`
  4892. // Syntax: The source syntax.
  4893. //
  4894. // Possible values:
  4895. // "SYNTAX_PROTO2" - Syntax `proto2`.
  4896. // "SYNTAX_PROTO3" - Syntax `proto3`.
  4897. Syntax string `json:"syntax,omitempty"`
  4898. // ForceSendFields is a list of field names (e.g. "Fields") to
  4899. // unconditionally include in API requests. By default, fields with
  4900. // empty values are omitted from API requests. However, any non-pointer,
  4901. // non-interface field appearing in ForceSendFields will be sent to the
  4902. // server regardless of whether the field is empty or not. This may be
  4903. // used to include empty fields in Patch requests.
  4904. ForceSendFields []string `json:"-"`
  4905. // NullFields is a list of field names (e.g. "Fields") to include in API
  4906. // requests with the JSON null value. By default, fields with empty
  4907. // values are omitted from API requests. However, any field with an
  4908. // empty value appearing in NullFields will be sent to the server as
  4909. // null. It is an error if a field in this list has a non-empty value.
  4910. // This may be used to include null fields in Patch requests.
  4911. NullFields []string `json:"-"`
  4912. }
  4913. func (s *Type) MarshalJSON() ([]byte, error) {
  4914. type NoMethod Type
  4915. raw := NoMethod(*s)
  4916. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4917. }
  4918. // UndeleteServiceResponse: Response message for UndeleteService method.
  4919. type UndeleteServiceResponse struct {
  4920. // Service: Revived service resource.
  4921. Service *ManagedService `json:"service,omitempty"`
  4922. // ForceSendFields is a list of field names (e.g. "Service") to
  4923. // unconditionally include in API requests. By default, fields with
  4924. // empty values are omitted from API requests. However, any non-pointer,
  4925. // non-interface field appearing in ForceSendFields will be sent to the
  4926. // server regardless of whether the field is empty or not. This may be
  4927. // used to include empty fields in Patch requests.
  4928. ForceSendFields []string `json:"-"`
  4929. // NullFields is a list of field names (e.g. "Service") to include in
  4930. // API requests with the JSON null value. By default, fields with empty
  4931. // values are omitted from API requests. However, any field with an
  4932. // empty value appearing in NullFields will be sent to the server as
  4933. // null. It is an error if a field in this list has a non-empty value.
  4934. // This may be used to include null fields in Patch requests.
  4935. NullFields []string `json:"-"`
  4936. }
  4937. func (s *UndeleteServiceResponse) MarshalJSON() ([]byte, error) {
  4938. type NoMethod UndeleteServiceResponse
  4939. raw := NoMethod(*s)
  4940. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4941. }
  4942. // Usage: Configuration controlling usage of a service.
  4943. type Usage struct {
  4944. // ProducerNotificationChannel: The full resource name of a channel used
  4945. // for sending notifications to the
  4946. // service producer.
  4947. //
  4948. // Google Service Management currently only supports
  4949. // [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a
  4950. // notification
  4951. // channel. To use Google Cloud Pub/Sub as the channel, this must be the
  4952. // name
  4953. // of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name
  4954. // format
  4955. // documented in https://cloud.google.com/pubsub/docs/overview.
  4956. ProducerNotificationChannel string `json:"producerNotificationChannel,omitempty"`
  4957. // Requirements: Requirements that must be satisfied before a consumer
  4958. // project can use the
  4959. // service. Each requirement is of the form
  4960. // <service.name>/<requirement-id>;
  4961. // for example 'serviceusage.googleapis.com/billing-enabled'.
  4962. Requirements []string `json:"requirements,omitempty"`
  4963. // Rules: A list of usage rules that apply to individual API
  4964. // methods.
  4965. //
  4966. // **NOTE:** All service configuration rules follow "last one wins"
  4967. // order.
  4968. Rules []*UsageRule `json:"rules,omitempty"`
  4969. // ForceSendFields is a list of field names (e.g.
  4970. // "ProducerNotificationChannel") to unconditionally include in API
  4971. // requests. By default, fields with empty values are omitted from API
  4972. // requests. However, any non-pointer, non-interface field appearing in
  4973. // ForceSendFields will be sent to the server regardless of whether the
  4974. // field is empty or not. This may be used to include empty fields in
  4975. // Patch requests.
  4976. ForceSendFields []string `json:"-"`
  4977. // NullFields is a list of field names (e.g.
  4978. // "ProducerNotificationChannel") to include in API requests with the
  4979. // JSON null value. By default, fields with empty values are omitted
  4980. // from API requests. However, any field with an empty value appearing
  4981. // in NullFields will be sent to the server as null. It is an error if a
  4982. // field in this list has a non-empty value. This may be used to include
  4983. // null fields in Patch requests.
  4984. NullFields []string `json:"-"`
  4985. }
  4986. func (s *Usage) MarshalJSON() ([]byte, error) {
  4987. type NoMethod Usage
  4988. raw := NoMethod(*s)
  4989. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4990. }
  4991. // UsageRule: Usage configuration rules for the service.
  4992. //
  4993. // NOTE: Under development.
  4994. //
  4995. //
  4996. // Use this rule to configure unregistered calls for the service.
  4997. // Unregistered
  4998. // calls are calls that do not contain consumer project
  4999. // identity.
  5000. // (Example: calls that do not contain an API key).
  5001. // By default, API methods do not allow unregistered calls, and each
  5002. // method call
  5003. // must be identified by a consumer project identity. Use this rule
  5004. // to
  5005. // allow/disallow unregistered calls.
  5006. //
  5007. // Example of an API that wants to allow unregistered calls for entire
  5008. // service.
  5009. //
  5010. // usage:
  5011. // rules:
  5012. // - selector: "*"
  5013. // allow_unregistered_calls: true
  5014. //
  5015. // Example of a method that wants to allow unregistered calls.
  5016. //
  5017. // usage:
  5018. // rules:
  5019. // - selector:
  5020. // "google.example.library.v1.LibraryService.CreateBook"
  5021. // allow_unregistered_calls: true
  5022. type UsageRule struct {
  5023. // AllowUnregisteredCalls: If true, the selected method allows
  5024. // unregistered calls, e.g. calls
  5025. // that don't identify any user or application.
  5026. AllowUnregisteredCalls bool `json:"allowUnregisteredCalls,omitempty"`
  5027. // Selector: Selects the methods to which this rule applies. Use '*' to
  5028. // indicate all
  5029. // methods in all APIs.
  5030. //
  5031. // Refer to selector for syntax details.
  5032. Selector string `json:"selector,omitempty"`
  5033. // SkipServiceControl: If true, the selected method should skip service
  5034. // control and the control
  5035. // plane features, such as quota and billing, will not be
  5036. // available.
  5037. // This flag is used by Google Cloud Endpoints to bypass checks for
  5038. // internal
  5039. // methods, such as service health check methods.
  5040. SkipServiceControl bool `json:"skipServiceControl,omitempty"`
  5041. // ForceSendFields is a list of field names (e.g.
  5042. // "AllowUnregisteredCalls") to unconditionally include in API requests.
  5043. // By default, fields with empty values are omitted from API requests.
  5044. // However, any non-pointer, non-interface field appearing in
  5045. // ForceSendFields will be sent to the server regardless of whether the
  5046. // field is empty or not. This may be used to include empty fields in
  5047. // Patch requests.
  5048. ForceSendFields []string `json:"-"`
  5049. // NullFields is a list of field names (e.g. "AllowUnregisteredCalls")
  5050. // to include in API requests with the JSON null value. By default,
  5051. // fields with empty values are omitted from API requests. However, any
  5052. // field with an empty value appearing in NullFields will be sent to the
  5053. // server as null. It is an error if a field in this list has a
  5054. // non-empty value. This may be used to include null fields in Patch
  5055. // requests.
  5056. NullFields []string `json:"-"`
  5057. }
  5058. func (s *UsageRule) MarshalJSON() ([]byte, error) {
  5059. type NoMethod UsageRule
  5060. raw := NoMethod(*s)
  5061. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5062. }
  5063. // method id "servicemanagement.operations.get":
  5064. type OperationsGetCall struct {
  5065. s *APIService
  5066. name string
  5067. urlParams_ gensupport.URLParams
  5068. ifNoneMatch_ string
  5069. ctx_ context.Context
  5070. header_ http.Header
  5071. }
  5072. // Get: Gets the latest state of a long-running operation. Clients can
  5073. // use this
  5074. // method to poll the operation result at intervals as recommended by
  5075. // the API
  5076. // service.
  5077. func (r *OperationsService) Get(name string) *OperationsGetCall {
  5078. c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5079. c.name = name
  5080. return c
  5081. }
  5082. // Fields allows partial responses to be retrieved. See
  5083. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5084. // for more information.
  5085. func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall {
  5086. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5087. return c
  5088. }
  5089. // IfNoneMatch sets the optional parameter which makes the operation
  5090. // fail if the object's ETag matches the given value. This is useful for
  5091. // getting updates only after the object has changed since the last
  5092. // request. Use googleapi.IsNotModified to check whether the response
  5093. // error from Do is the result of In-None-Match.
  5094. func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall {
  5095. c.ifNoneMatch_ = entityTag
  5096. return c
  5097. }
  5098. // Context sets the context to be used in this call's Do method. Any
  5099. // pending HTTP request will be aborted if the provided context is
  5100. // canceled.
  5101. func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall {
  5102. c.ctx_ = ctx
  5103. return c
  5104. }
  5105. // Header returns an http.Header that can be modified by the caller to
  5106. // add HTTP headers to the request.
  5107. func (c *OperationsGetCall) Header() http.Header {
  5108. if c.header_ == nil {
  5109. c.header_ = make(http.Header)
  5110. }
  5111. return c.header_
  5112. }
  5113. func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) {
  5114. reqHeaders := make(http.Header)
  5115. for k, v := range c.header_ {
  5116. reqHeaders[k] = v
  5117. }
  5118. reqHeaders.Set("User-Agent", c.s.userAgent())
  5119. if c.ifNoneMatch_ != "" {
  5120. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5121. }
  5122. var body io.Reader = nil
  5123. c.urlParams_.Set("alt", alt)
  5124. c.urlParams_.Set("prettyPrint", "false")
  5125. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  5126. urls += "?" + c.urlParams_.Encode()
  5127. req, err := http.NewRequest("GET", urls, body)
  5128. if err != nil {
  5129. return nil, err
  5130. }
  5131. req.Header = reqHeaders
  5132. googleapi.Expand(req.URL, map[string]string{
  5133. "name": c.name,
  5134. })
  5135. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5136. }
  5137. // Do executes the "servicemanagement.operations.get" call.
  5138. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5139. // status code is an error. Response headers are in either
  5140. // *Operation.ServerResponse.Header or (if a response was returned at
  5141. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5142. // to check whether the returned error was because
  5143. // http.StatusNotModified was returned.
  5144. func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5145. gensupport.SetOptions(c.urlParams_, opts...)
  5146. res, err := c.doRequest("json")
  5147. if res != nil && res.StatusCode == http.StatusNotModified {
  5148. if res.Body != nil {
  5149. res.Body.Close()
  5150. }
  5151. return nil, &googleapi.Error{
  5152. Code: res.StatusCode,
  5153. Header: res.Header,
  5154. }
  5155. }
  5156. if err != nil {
  5157. return nil, err
  5158. }
  5159. defer googleapi.CloseBody(res)
  5160. if err := googleapi.CheckResponse(res); err != nil {
  5161. return nil, err
  5162. }
  5163. ret := &Operation{
  5164. ServerResponse: googleapi.ServerResponse{
  5165. Header: res.Header,
  5166. HTTPStatusCode: res.StatusCode,
  5167. },
  5168. }
  5169. target := &ret
  5170. if err := gensupport.DecodeResponse(target, res); err != nil {
  5171. return nil, err
  5172. }
  5173. return ret, nil
  5174. // {
  5175. // "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.",
  5176. // "flatPath": "v1/operations/{operationsId}",
  5177. // "httpMethod": "GET",
  5178. // "id": "servicemanagement.operations.get",
  5179. // "parameterOrder": [
  5180. // "name"
  5181. // ],
  5182. // "parameters": {
  5183. // "name": {
  5184. // "description": "The name of the operation resource.",
  5185. // "location": "path",
  5186. // "pattern": "^operations/.+$",
  5187. // "required": true,
  5188. // "type": "string"
  5189. // }
  5190. // },
  5191. // "path": "v1/{+name}",
  5192. // "response": {
  5193. // "$ref": "Operation"
  5194. // },
  5195. // "scopes": [
  5196. // "https://www.googleapis.com/auth/cloud-platform",
  5197. // "https://www.googleapis.com/auth/service.management"
  5198. // ]
  5199. // }
  5200. }
  5201. // method id "servicemanagement.operations.list":
  5202. type OperationsListCall struct {
  5203. s *APIService
  5204. urlParams_ gensupport.URLParams
  5205. ifNoneMatch_ string
  5206. ctx_ context.Context
  5207. header_ http.Header
  5208. }
  5209. // List: Lists service operations that match the specified filter in the
  5210. // request.
  5211. func (r *OperationsService) List() *OperationsListCall {
  5212. c := &OperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5213. return c
  5214. }
  5215. // Filter sets the optional parameter "filter": A string for filtering
  5216. // Operations.
  5217. // The following filter fields are supported&#58;
  5218. //
  5219. // * serviceName&#58; Required. Only `=` operator is allowed.
  5220. // * startTime&#58; The time this job was started, in ISO 8601
  5221. // format.
  5222. // Allowed operators are `>=`, `>`, `<=`, and `<`.
  5223. // * status&#58; Can be `done`, `in_progress`, or `failed`. Allowed
  5224. // operators are `=`, and `!=`.
  5225. //
  5226. // Filter expression supports conjunction (AND) and disjunction (OR)
  5227. // logical operators. However, the serviceName restriction must be at
  5228. // the
  5229. // top-level and can only be combined with other restrictions via the
  5230. // AND
  5231. // logical operator.
  5232. //
  5233. // Examples&#58;
  5234. //
  5235. // * `serviceName={some-service}.googleapis.com`
  5236. // * `serviceName={some-service}.googleapis.com AND
  5237. // startTime>="2017-02-01"
  5238. // * `serviceName={some-service}.googleapis.com AND status=done`
  5239. // * `serviceName={some-service}.googleapis.com AND (status=done OR
  5240. // startTime>="2017-02-01")`
  5241. func (c *OperationsListCall) Filter(filter string) *OperationsListCall {
  5242. c.urlParams_.Set("filter", filter)
  5243. return c
  5244. }
  5245. // Name sets the optional parameter "name": Not used.
  5246. func (c *OperationsListCall) Name(name string) *OperationsListCall {
  5247. c.urlParams_.Set("name", name)
  5248. return c
  5249. }
  5250. // PageSize sets the optional parameter "pageSize": The maximum number
  5251. // of operations to return. If unspecified, defaults to
  5252. // 50. The maximum value is 100.
  5253. func (c *OperationsListCall) PageSize(pageSize int64) *OperationsListCall {
  5254. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  5255. return c
  5256. }
  5257. // PageToken sets the optional parameter "pageToken": The standard list
  5258. // page token.
  5259. func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall {
  5260. c.urlParams_.Set("pageToken", pageToken)
  5261. return c
  5262. }
  5263. // Fields allows partial responses to be retrieved. See
  5264. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5265. // for more information.
  5266. func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall {
  5267. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5268. return c
  5269. }
  5270. // IfNoneMatch sets the optional parameter which makes the operation
  5271. // fail if the object's ETag matches the given value. This is useful for
  5272. // getting updates only after the object has changed since the last
  5273. // request. Use googleapi.IsNotModified to check whether the response
  5274. // error from Do is the result of In-None-Match.
  5275. func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall {
  5276. c.ifNoneMatch_ = entityTag
  5277. return c
  5278. }
  5279. // Context sets the context to be used in this call's Do method. Any
  5280. // pending HTTP request will be aborted if the provided context is
  5281. // canceled.
  5282. func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall {
  5283. c.ctx_ = ctx
  5284. return c
  5285. }
  5286. // Header returns an http.Header that can be modified by the caller to
  5287. // add HTTP headers to the request.
  5288. func (c *OperationsListCall) Header() http.Header {
  5289. if c.header_ == nil {
  5290. c.header_ = make(http.Header)
  5291. }
  5292. return c.header_
  5293. }
  5294. func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) {
  5295. reqHeaders := make(http.Header)
  5296. for k, v := range c.header_ {
  5297. reqHeaders[k] = v
  5298. }
  5299. reqHeaders.Set("User-Agent", c.s.userAgent())
  5300. if c.ifNoneMatch_ != "" {
  5301. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5302. }
  5303. var body io.Reader = nil
  5304. c.urlParams_.Set("alt", alt)
  5305. c.urlParams_.Set("prettyPrint", "false")
  5306. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/operations")
  5307. urls += "?" + c.urlParams_.Encode()
  5308. req, err := http.NewRequest("GET", urls, body)
  5309. if err != nil {
  5310. return nil, err
  5311. }
  5312. req.Header = reqHeaders
  5313. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5314. }
  5315. // Do executes the "servicemanagement.operations.list" call.
  5316. // Exactly one of *ListOperationsResponse or error will be non-nil. Any
  5317. // non-2xx status code is an error. Response headers are in either
  5318. // *ListOperationsResponse.ServerResponse.Header or (if a response was
  5319. // returned at all) in error.(*googleapi.Error).Header. Use
  5320. // googleapi.IsNotModified to check whether the returned error was
  5321. // because http.StatusNotModified was returned.
  5322. func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  5323. gensupport.SetOptions(c.urlParams_, opts...)
  5324. res, err := c.doRequest("json")
  5325. if res != nil && res.StatusCode == http.StatusNotModified {
  5326. if res.Body != nil {
  5327. res.Body.Close()
  5328. }
  5329. return nil, &googleapi.Error{
  5330. Code: res.StatusCode,
  5331. Header: res.Header,
  5332. }
  5333. }
  5334. if err != nil {
  5335. return nil, err
  5336. }
  5337. defer googleapi.CloseBody(res)
  5338. if err := googleapi.CheckResponse(res); err != nil {
  5339. return nil, err
  5340. }
  5341. ret := &ListOperationsResponse{
  5342. ServerResponse: googleapi.ServerResponse{
  5343. Header: res.Header,
  5344. HTTPStatusCode: res.StatusCode,
  5345. },
  5346. }
  5347. target := &ret
  5348. if err := gensupport.DecodeResponse(target, res); err != nil {
  5349. return nil, err
  5350. }
  5351. return ret, nil
  5352. // {
  5353. // "description": "Lists service operations that match the specified filter in the request.",
  5354. // "flatPath": "v1/operations",
  5355. // "httpMethod": "GET",
  5356. // "id": "servicemanagement.operations.list",
  5357. // "parameterOrder": [],
  5358. // "parameters": {
  5359. // "filter": {
  5360. // "description": "A string for filtering Operations.\n The following filter fields are supported\u0026#58;\n\n * serviceName\u0026#58; Required. Only `=` operator is allowed.\n * startTime\u0026#58; The time this job was started, in ISO 8601 format.\n Allowed operators are `\u003e=`, `\u003e`, `\u003c=`, and `\u003c`.\n * status\u0026#58; Can be `done`, `in_progress`, or `failed`. Allowed\n operators are `=`, and `!=`.\n\n Filter expression supports conjunction (AND) and disjunction (OR)\n logical operators. However, the serviceName restriction must be at the\n top-level and can only be combined with other restrictions via the AND\n logical operator.\n\n Examples\u0026#58;\n\n * `serviceName={some-service}.googleapis.com`\n * `serviceName={some-service}.googleapis.com AND startTime\u003e=\"2017-02-01\"`\n * `serviceName={some-service}.googleapis.com AND status=done`\n * `serviceName={some-service}.googleapis.com AND (status=done OR startTime\u003e=\"2017-02-01\")`",
  5361. // "location": "query",
  5362. // "type": "string"
  5363. // },
  5364. // "name": {
  5365. // "description": "Not used.",
  5366. // "location": "query",
  5367. // "type": "string"
  5368. // },
  5369. // "pageSize": {
  5370. // "description": "The maximum number of operations to return. If unspecified, defaults to\n50. The maximum value is 100.",
  5371. // "format": "int32",
  5372. // "location": "query",
  5373. // "type": "integer"
  5374. // },
  5375. // "pageToken": {
  5376. // "description": "The standard list page token.",
  5377. // "location": "query",
  5378. // "type": "string"
  5379. // }
  5380. // },
  5381. // "path": "v1/operations",
  5382. // "response": {
  5383. // "$ref": "ListOperationsResponse"
  5384. // },
  5385. // "scopes": [
  5386. // "https://www.googleapis.com/auth/cloud-platform",
  5387. // "https://www.googleapis.com/auth/service.management"
  5388. // ]
  5389. // }
  5390. }
  5391. // Pages invokes f for each page of results.
  5392. // A non-nil error returned from f will halt the iteration.
  5393. // The provided context supersedes any context provided to the Context method.
  5394. func (c *OperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
  5395. c.ctx_ = ctx
  5396. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5397. for {
  5398. x, err := c.Do()
  5399. if err != nil {
  5400. return err
  5401. }
  5402. if err := f(x); err != nil {
  5403. return err
  5404. }
  5405. if x.NextPageToken == "" {
  5406. return nil
  5407. }
  5408. c.PageToken(x.NextPageToken)
  5409. }
  5410. }
  5411. // method id "servicemanagement.services.create":
  5412. type ServicesCreateCall struct {
  5413. s *APIService
  5414. managedservice *ManagedService
  5415. urlParams_ gensupport.URLParams
  5416. ctx_ context.Context
  5417. header_ http.Header
  5418. }
  5419. // Create: Creates a new managed service.
  5420. // Please note one producer project can own no more than 20
  5421. // services.
  5422. //
  5423. // Operation<response: ManagedService>
  5424. func (r *ServicesService) Create(managedservice *ManagedService) *ServicesCreateCall {
  5425. c := &ServicesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5426. c.managedservice = managedservice
  5427. return c
  5428. }
  5429. // Fields allows partial responses to be retrieved. See
  5430. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5431. // for more information.
  5432. func (c *ServicesCreateCall) Fields(s ...googleapi.Field) *ServicesCreateCall {
  5433. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5434. return c
  5435. }
  5436. // Context sets the context to be used in this call's Do method. Any
  5437. // pending HTTP request will be aborted if the provided context is
  5438. // canceled.
  5439. func (c *ServicesCreateCall) Context(ctx context.Context) *ServicesCreateCall {
  5440. c.ctx_ = ctx
  5441. return c
  5442. }
  5443. // Header returns an http.Header that can be modified by the caller to
  5444. // add HTTP headers to the request.
  5445. func (c *ServicesCreateCall) Header() http.Header {
  5446. if c.header_ == nil {
  5447. c.header_ = make(http.Header)
  5448. }
  5449. return c.header_
  5450. }
  5451. func (c *ServicesCreateCall) doRequest(alt string) (*http.Response, error) {
  5452. reqHeaders := make(http.Header)
  5453. for k, v := range c.header_ {
  5454. reqHeaders[k] = v
  5455. }
  5456. reqHeaders.Set("User-Agent", c.s.userAgent())
  5457. var body io.Reader = nil
  5458. body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedservice)
  5459. if err != nil {
  5460. return nil, err
  5461. }
  5462. reqHeaders.Set("Content-Type", "application/json")
  5463. c.urlParams_.Set("alt", alt)
  5464. c.urlParams_.Set("prettyPrint", "false")
  5465. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services")
  5466. urls += "?" + c.urlParams_.Encode()
  5467. req, err := http.NewRequest("POST", urls, body)
  5468. if err != nil {
  5469. return nil, err
  5470. }
  5471. req.Header = reqHeaders
  5472. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5473. }
  5474. // Do executes the "servicemanagement.services.create" call.
  5475. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5476. // status code is an error. Response headers are in either
  5477. // *Operation.ServerResponse.Header or (if a response was returned at
  5478. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5479. // to check whether the returned error was because
  5480. // http.StatusNotModified was returned.
  5481. func (c *ServicesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5482. gensupport.SetOptions(c.urlParams_, opts...)
  5483. res, err := c.doRequest("json")
  5484. if res != nil && res.StatusCode == http.StatusNotModified {
  5485. if res.Body != nil {
  5486. res.Body.Close()
  5487. }
  5488. return nil, &googleapi.Error{
  5489. Code: res.StatusCode,
  5490. Header: res.Header,
  5491. }
  5492. }
  5493. if err != nil {
  5494. return nil, err
  5495. }
  5496. defer googleapi.CloseBody(res)
  5497. if err := googleapi.CheckResponse(res); err != nil {
  5498. return nil, err
  5499. }
  5500. ret := &Operation{
  5501. ServerResponse: googleapi.ServerResponse{
  5502. Header: res.Header,
  5503. HTTPStatusCode: res.StatusCode,
  5504. },
  5505. }
  5506. target := &ret
  5507. if err := gensupport.DecodeResponse(target, res); err != nil {
  5508. return nil, err
  5509. }
  5510. return ret, nil
  5511. // {
  5512. // "description": "Creates a new managed service.\nPlease note one producer project can own no more than 20 services.\n\nOperation\u003cresponse: ManagedService\u003e",
  5513. // "flatPath": "v1/services",
  5514. // "httpMethod": "POST",
  5515. // "id": "servicemanagement.services.create",
  5516. // "parameterOrder": [],
  5517. // "parameters": {},
  5518. // "path": "v1/services",
  5519. // "request": {
  5520. // "$ref": "ManagedService"
  5521. // },
  5522. // "response": {
  5523. // "$ref": "Operation"
  5524. // },
  5525. // "scopes": [
  5526. // "https://www.googleapis.com/auth/cloud-platform",
  5527. // "https://www.googleapis.com/auth/service.management"
  5528. // ]
  5529. // }
  5530. }
  5531. // method id "servicemanagement.services.delete":
  5532. type ServicesDeleteCall struct {
  5533. s *APIService
  5534. serviceName string
  5535. urlParams_ gensupport.URLParams
  5536. ctx_ context.Context
  5537. header_ http.Header
  5538. }
  5539. // Delete: Deletes a managed service. This method will change the
  5540. // service to the
  5541. // `Soft-Delete` state for 30 days. Within this period, service
  5542. // producers may
  5543. // call UndeleteService to restore the service.
  5544. // After 30 days, the service will be permanently
  5545. // deleted.
  5546. //
  5547. // Operation<response: google.protobuf.Empty>
  5548. func (r *ServicesService) Delete(serviceName string) *ServicesDeleteCall {
  5549. c := &ServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5550. c.serviceName = serviceName
  5551. return c
  5552. }
  5553. // Fields allows partial responses to be retrieved. See
  5554. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5555. // for more information.
  5556. func (c *ServicesDeleteCall) Fields(s ...googleapi.Field) *ServicesDeleteCall {
  5557. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5558. return c
  5559. }
  5560. // Context sets the context to be used in this call's Do method. Any
  5561. // pending HTTP request will be aborted if the provided context is
  5562. // canceled.
  5563. func (c *ServicesDeleteCall) Context(ctx context.Context) *ServicesDeleteCall {
  5564. c.ctx_ = ctx
  5565. return c
  5566. }
  5567. // Header returns an http.Header that can be modified by the caller to
  5568. // add HTTP headers to the request.
  5569. func (c *ServicesDeleteCall) Header() http.Header {
  5570. if c.header_ == nil {
  5571. c.header_ = make(http.Header)
  5572. }
  5573. return c.header_
  5574. }
  5575. func (c *ServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
  5576. reqHeaders := make(http.Header)
  5577. for k, v := range c.header_ {
  5578. reqHeaders[k] = v
  5579. }
  5580. reqHeaders.Set("User-Agent", c.s.userAgent())
  5581. var body io.Reader = nil
  5582. c.urlParams_.Set("alt", alt)
  5583. c.urlParams_.Set("prettyPrint", "false")
  5584. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}")
  5585. urls += "?" + c.urlParams_.Encode()
  5586. req, err := http.NewRequest("DELETE", urls, body)
  5587. if err != nil {
  5588. return nil, err
  5589. }
  5590. req.Header = reqHeaders
  5591. googleapi.Expand(req.URL, map[string]string{
  5592. "serviceName": c.serviceName,
  5593. })
  5594. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5595. }
  5596. // Do executes the "servicemanagement.services.delete" call.
  5597. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5598. // status code is an error. Response headers are in either
  5599. // *Operation.ServerResponse.Header or (if a response was returned at
  5600. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5601. // to check whether the returned error was because
  5602. // http.StatusNotModified was returned.
  5603. func (c *ServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5604. gensupport.SetOptions(c.urlParams_, opts...)
  5605. res, err := c.doRequest("json")
  5606. if res != nil && res.StatusCode == http.StatusNotModified {
  5607. if res.Body != nil {
  5608. res.Body.Close()
  5609. }
  5610. return nil, &googleapi.Error{
  5611. Code: res.StatusCode,
  5612. Header: res.Header,
  5613. }
  5614. }
  5615. if err != nil {
  5616. return nil, err
  5617. }
  5618. defer googleapi.CloseBody(res)
  5619. if err := googleapi.CheckResponse(res); err != nil {
  5620. return nil, err
  5621. }
  5622. ret := &Operation{
  5623. ServerResponse: googleapi.ServerResponse{
  5624. Header: res.Header,
  5625. HTTPStatusCode: res.StatusCode,
  5626. },
  5627. }
  5628. target := &ret
  5629. if err := gensupport.DecodeResponse(target, res); err != nil {
  5630. return nil, err
  5631. }
  5632. return ret, nil
  5633. // {
  5634. // "description": "Deletes a managed service. This method will change the service to the\n`Soft-Delete` state for 30 days. Within this period, service producers may\ncall UndeleteService to restore the service.\nAfter 30 days, the service will be permanently deleted.\n\nOperation\u003cresponse: google.protobuf.Empty\u003e",
  5635. // "flatPath": "v1/services/{serviceName}",
  5636. // "httpMethod": "DELETE",
  5637. // "id": "servicemanagement.services.delete",
  5638. // "parameterOrder": [
  5639. // "serviceName"
  5640. // ],
  5641. // "parameters": {
  5642. // "serviceName": {
  5643. // "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`.",
  5644. // "location": "path",
  5645. // "required": true,
  5646. // "type": "string"
  5647. // }
  5648. // },
  5649. // "path": "v1/services/{serviceName}",
  5650. // "response": {
  5651. // "$ref": "Operation"
  5652. // },
  5653. // "scopes": [
  5654. // "https://www.googleapis.com/auth/cloud-platform",
  5655. // "https://www.googleapis.com/auth/service.management"
  5656. // ]
  5657. // }
  5658. }
  5659. // method id "servicemanagement.services.disable":
  5660. type ServicesDisableCall struct {
  5661. s *APIService
  5662. serviceName string
  5663. disableservicerequest *DisableServiceRequest
  5664. urlParams_ gensupport.URLParams
  5665. ctx_ context.Context
  5666. header_ http.Header
  5667. }
  5668. // Disable: Disables a service for a project, so it can no longer be
  5669. // be used for the project. It prevents accidental usage that may
  5670. // cause
  5671. // unexpected billing charges or security leaks.
  5672. //
  5673. // Operation<response: DisableServiceResponse>
  5674. func (r *ServicesService) Disable(serviceName string, disableservicerequest *DisableServiceRequest) *ServicesDisableCall {
  5675. c := &ServicesDisableCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5676. c.serviceName = serviceName
  5677. c.disableservicerequest = disableservicerequest
  5678. return c
  5679. }
  5680. // Fields allows partial responses to be retrieved. See
  5681. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5682. // for more information.
  5683. func (c *ServicesDisableCall) Fields(s ...googleapi.Field) *ServicesDisableCall {
  5684. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5685. return c
  5686. }
  5687. // Context sets the context to be used in this call's Do method. Any
  5688. // pending HTTP request will be aborted if the provided context is
  5689. // canceled.
  5690. func (c *ServicesDisableCall) Context(ctx context.Context) *ServicesDisableCall {
  5691. c.ctx_ = ctx
  5692. return c
  5693. }
  5694. // Header returns an http.Header that can be modified by the caller to
  5695. // add HTTP headers to the request.
  5696. func (c *ServicesDisableCall) Header() http.Header {
  5697. if c.header_ == nil {
  5698. c.header_ = make(http.Header)
  5699. }
  5700. return c.header_
  5701. }
  5702. func (c *ServicesDisableCall) doRequest(alt string) (*http.Response, error) {
  5703. reqHeaders := make(http.Header)
  5704. for k, v := range c.header_ {
  5705. reqHeaders[k] = v
  5706. }
  5707. reqHeaders.Set("User-Agent", c.s.userAgent())
  5708. var body io.Reader = nil
  5709. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disableservicerequest)
  5710. if err != nil {
  5711. return nil, err
  5712. }
  5713. reqHeaders.Set("Content-Type", "application/json")
  5714. c.urlParams_.Set("alt", alt)
  5715. c.urlParams_.Set("prettyPrint", "false")
  5716. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}:disable")
  5717. urls += "?" + c.urlParams_.Encode()
  5718. req, err := http.NewRequest("POST", urls, body)
  5719. if err != nil {
  5720. return nil, err
  5721. }
  5722. req.Header = reqHeaders
  5723. googleapi.Expand(req.URL, map[string]string{
  5724. "serviceName": c.serviceName,
  5725. })
  5726. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5727. }
  5728. // Do executes the "servicemanagement.services.disable" call.
  5729. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5730. // status code is an error. Response headers are in either
  5731. // *Operation.ServerResponse.Header or (if a response was returned at
  5732. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5733. // to check whether the returned error was because
  5734. // http.StatusNotModified was returned.
  5735. func (c *ServicesDisableCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5736. gensupport.SetOptions(c.urlParams_, opts...)
  5737. res, err := c.doRequest("json")
  5738. if res != nil && res.StatusCode == http.StatusNotModified {
  5739. if res.Body != nil {
  5740. res.Body.Close()
  5741. }
  5742. return nil, &googleapi.Error{
  5743. Code: res.StatusCode,
  5744. Header: res.Header,
  5745. }
  5746. }
  5747. if err != nil {
  5748. return nil, err
  5749. }
  5750. defer googleapi.CloseBody(res)
  5751. if err := googleapi.CheckResponse(res); err != nil {
  5752. return nil, err
  5753. }
  5754. ret := &Operation{
  5755. ServerResponse: googleapi.ServerResponse{
  5756. Header: res.Header,
  5757. HTTPStatusCode: res.StatusCode,
  5758. },
  5759. }
  5760. target := &ret
  5761. if err := gensupport.DecodeResponse(target, res); err != nil {
  5762. return nil, err
  5763. }
  5764. return ret, nil
  5765. // {
  5766. // "description": "Disables a service for a project, so it can no longer be\nbe used for the project. It prevents accidental usage that may cause\nunexpected billing charges or security leaks.\n\nOperation\u003cresponse: DisableServiceResponse\u003e",
  5767. // "flatPath": "v1/services/{serviceName}:disable",
  5768. // "httpMethod": "POST",
  5769. // "id": "servicemanagement.services.disable",
  5770. // "parameterOrder": [
  5771. // "serviceName"
  5772. // ],
  5773. // "parameters": {
  5774. // "serviceName": {
  5775. // "description": "Name of the service to disable. Specifying an unknown service name\nwill cause the request to fail.",
  5776. // "location": "path",
  5777. // "required": true,
  5778. // "type": "string"
  5779. // }
  5780. // },
  5781. // "path": "v1/services/{serviceName}:disable",
  5782. // "request": {
  5783. // "$ref": "DisableServiceRequest"
  5784. // },
  5785. // "response": {
  5786. // "$ref": "Operation"
  5787. // },
  5788. // "scopes": [
  5789. // "https://www.googleapis.com/auth/cloud-platform",
  5790. // "https://www.googleapis.com/auth/service.management"
  5791. // ]
  5792. // }
  5793. }
  5794. // method id "servicemanagement.services.enable":
  5795. type ServicesEnableCall struct {
  5796. s *APIService
  5797. serviceName string
  5798. enableservicerequest *EnableServiceRequest
  5799. urlParams_ gensupport.URLParams
  5800. ctx_ context.Context
  5801. header_ http.Header
  5802. }
  5803. // Enable: Enables a service for a project, so it can be used
  5804. // for the project. See
  5805. // [Cloud Auth Guide](https://cloud.google.com/docs/authentication)
  5806. // for
  5807. // more information.
  5808. //
  5809. // Operation<response: EnableServiceResponse>
  5810. func (r *ServicesService) Enable(serviceName string, enableservicerequest *EnableServiceRequest) *ServicesEnableCall {
  5811. c := &ServicesEnableCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5812. c.serviceName = serviceName
  5813. c.enableservicerequest = enableservicerequest
  5814. return c
  5815. }
  5816. // Fields allows partial responses to be retrieved. See
  5817. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5818. // for more information.
  5819. func (c *ServicesEnableCall) Fields(s ...googleapi.Field) *ServicesEnableCall {
  5820. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5821. return c
  5822. }
  5823. // Context sets the context to be used in this call's Do method. Any
  5824. // pending HTTP request will be aborted if the provided context is
  5825. // canceled.
  5826. func (c *ServicesEnableCall) Context(ctx context.Context) *ServicesEnableCall {
  5827. c.ctx_ = ctx
  5828. return c
  5829. }
  5830. // Header returns an http.Header that can be modified by the caller to
  5831. // add HTTP headers to the request.
  5832. func (c *ServicesEnableCall) Header() http.Header {
  5833. if c.header_ == nil {
  5834. c.header_ = make(http.Header)
  5835. }
  5836. return c.header_
  5837. }
  5838. func (c *ServicesEnableCall) doRequest(alt string) (*http.Response, error) {
  5839. reqHeaders := make(http.Header)
  5840. for k, v := range c.header_ {
  5841. reqHeaders[k] = v
  5842. }
  5843. reqHeaders.Set("User-Agent", c.s.userAgent())
  5844. var body io.Reader = nil
  5845. body, err := googleapi.WithoutDataWrapper.JSONReader(c.enableservicerequest)
  5846. if err != nil {
  5847. return nil, err
  5848. }
  5849. reqHeaders.Set("Content-Type", "application/json")
  5850. c.urlParams_.Set("alt", alt)
  5851. c.urlParams_.Set("prettyPrint", "false")
  5852. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}:enable")
  5853. urls += "?" + c.urlParams_.Encode()
  5854. req, err := http.NewRequest("POST", urls, body)
  5855. if err != nil {
  5856. return nil, err
  5857. }
  5858. req.Header = reqHeaders
  5859. googleapi.Expand(req.URL, map[string]string{
  5860. "serviceName": c.serviceName,
  5861. })
  5862. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5863. }
  5864. // Do executes the "servicemanagement.services.enable" call.
  5865. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5866. // status code is an error. Response headers are in either
  5867. // *Operation.ServerResponse.Header or (if a response was returned at
  5868. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5869. // to check whether the returned error was because
  5870. // http.StatusNotModified was returned.
  5871. func (c *ServicesEnableCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5872. gensupport.SetOptions(c.urlParams_, opts...)
  5873. res, err := c.doRequest("json")
  5874. if res != nil && res.StatusCode == http.StatusNotModified {
  5875. if res.Body != nil {
  5876. res.Body.Close()
  5877. }
  5878. return nil, &googleapi.Error{
  5879. Code: res.StatusCode,
  5880. Header: res.Header,
  5881. }
  5882. }
  5883. if err != nil {
  5884. return nil, err
  5885. }
  5886. defer googleapi.CloseBody(res)
  5887. if err := googleapi.CheckResponse(res); err != nil {
  5888. return nil, err
  5889. }
  5890. ret := &Operation{
  5891. ServerResponse: googleapi.ServerResponse{
  5892. Header: res.Header,
  5893. HTTPStatusCode: res.StatusCode,
  5894. },
  5895. }
  5896. target := &ret
  5897. if err := gensupport.DecodeResponse(target, res); err != nil {
  5898. return nil, err
  5899. }
  5900. return ret, nil
  5901. // {
  5902. // "description": "Enables a service for a project, so it can be used\nfor the project. See\n[Cloud Auth Guide](https://cloud.google.com/docs/authentication) for\nmore information.\n\nOperation\u003cresponse: EnableServiceResponse\u003e",
  5903. // "flatPath": "v1/services/{serviceName}:enable",
  5904. // "httpMethod": "POST",
  5905. // "id": "servicemanagement.services.enable",
  5906. // "parameterOrder": [
  5907. // "serviceName"
  5908. // ],
  5909. // "parameters": {
  5910. // "serviceName": {
  5911. // "description": "Name of the service to enable. Specifying an unknown service name will\ncause the request to fail.",
  5912. // "location": "path",
  5913. // "required": true,
  5914. // "type": "string"
  5915. // }
  5916. // },
  5917. // "path": "v1/services/{serviceName}:enable",
  5918. // "request": {
  5919. // "$ref": "EnableServiceRequest"
  5920. // },
  5921. // "response": {
  5922. // "$ref": "Operation"
  5923. // },
  5924. // "scopes": [
  5925. // "https://www.googleapis.com/auth/cloud-platform",
  5926. // "https://www.googleapis.com/auth/service.management"
  5927. // ]
  5928. // }
  5929. }
  5930. // method id "servicemanagement.services.generateConfigReport":
  5931. type ServicesGenerateConfigReportCall struct {
  5932. s *APIService
  5933. generateconfigreportrequest *GenerateConfigReportRequest
  5934. urlParams_ gensupport.URLParams
  5935. ctx_ context.Context
  5936. header_ http.Header
  5937. }
  5938. // GenerateConfigReport: Generates and returns a report (errors,
  5939. // warnings and changes from
  5940. // existing configurations) associated
  5941. // with
  5942. // GenerateConfigReportRequest.new_value
  5943. //
  5944. // If GenerateConfigReportRequest.old_value is
  5945. // specified,
  5946. // GenerateConfigReportRequest will contain a single ChangeReport based
  5947. // on the
  5948. // comparison between GenerateConfigReportRequest.new_value
  5949. // and
  5950. // GenerateConfigReportRequest.old_value.
  5951. // If GenerateConfigReportRequest.old_value is not specified, this
  5952. // method
  5953. // will compare GenerateConfigReportRequest.new_value with the last
  5954. // pushed
  5955. // service configuration.
  5956. func (r *ServicesService) GenerateConfigReport(generateconfigreportrequest *GenerateConfigReportRequest) *ServicesGenerateConfigReportCall {
  5957. c := &ServicesGenerateConfigReportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5958. c.generateconfigreportrequest = generateconfigreportrequest
  5959. return c
  5960. }
  5961. // Fields allows partial responses to be retrieved. See
  5962. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5963. // for more information.
  5964. func (c *ServicesGenerateConfigReportCall) Fields(s ...googleapi.Field) *ServicesGenerateConfigReportCall {
  5965. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5966. return c
  5967. }
  5968. // Context sets the context to be used in this call's Do method. Any
  5969. // pending HTTP request will be aborted if the provided context is
  5970. // canceled.
  5971. func (c *ServicesGenerateConfigReportCall) Context(ctx context.Context) *ServicesGenerateConfigReportCall {
  5972. c.ctx_ = ctx
  5973. return c
  5974. }
  5975. // Header returns an http.Header that can be modified by the caller to
  5976. // add HTTP headers to the request.
  5977. func (c *ServicesGenerateConfigReportCall) Header() http.Header {
  5978. if c.header_ == nil {
  5979. c.header_ = make(http.Header)
  5980. }
  5981. return c.header_
  5982. }
  5983. func (c *ServicesGenerateConfigReportCall) doRequest(alt string) (*http.Response, error) {
  5984. reqHeaders := make(http.Header)
  5985. for k, v := range c.header_ {
  5986. reqHeaders[k] = v
  5987. }
  5988. reqHeaders.Set("User-Agent", c.s.userAgent())
  5989. var body io.Reader = nil
  5990. body, err := googleapi.WithoutDataWrapper.JSONReader(c.generateconfigreportrequest)
  5991. if err != nil {
  5992. return nil, err
  5993. }
  5994. reqHeaders.Set("Content-Type", "application/json")
  5995. c.urlParams_.Set("alt", alt)
  5996. c.urlParams_.Set("prettyPrint", "false")
  5997. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services:generateConfigReport")
  5998. urls += "?" + c.urlParams_.Encode()
  5999. req, err := http.NewRequest("POST", urls, body)
  6000. if err != nil {
  6001. return nil, err
  6002. }
  6003. req.Header = reqHeaders
  6004. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6005. }
  6006. // Do executes the "servicemanagement.services.generateConfigReport" call.
  6007. // Exactly one of *GenerateConfigReportResponse or error will be
  6008. // non-nil. Any non-2xx status code is an error. Response headers are in
  6009. // either *GenerateConfigReportResponse.ServerResponse.Header or (if a
  6010. // response was returned at all) in error.(*googleapi.Error).Header. Use
  6011. // googleapi.IsNotModified to check whether the returned error was
  6012. // because http.StatusNotModified was returned.
  6013. func (c *ServicesGenerateConfigReportCall) Do(opts ...googleapi.CallOption) (*GenerateConfigReportResponse, error) {
  6014. gensupport.SetOptions(c.urlParams_, opts...)
  6015. res, err := c.doRequest("json")
  6016. if res != nil && res.StatusCode == http.StatusNotModified {
  6017. if res.Body != nil {
  6018. res.Body.Close()
  6019. }
  6020. return nil, &googleapi.Error{
  6021. Code: res.StatusCode,
  6022. Header: res.Header,
  6023. }
  6024. }
  6025. if err != nil {
  6026. return nil, err
  6027. }
  6028. defer googleapi.CloseBody(res)
  6029. if err := googleapi.CheckResponse(res); err != nil {
  6030. return nil, err
  6031. }
  6032. ret := &GenerateConfigReportResponse{
  6033. ServerResponse: googleapi.ServerResponse{
  6034. Header: res.Header,
  6035. HTTPStatusCode: res.StatusCode,
  6036. },
  6037. }
  6038. target := &ret
  6039. if err := gensupport.DecodeResponse(target, res); err != nil {
  6040. return nil, err
  6041. }
  6042. return ret, nil
  6043. // {
  6044. // "description": "Generates and returns a report (errors, warnings and changes from\nexisting configurations) associated with\nGenerateConfigReportRequest.new_value\n\nIf GenerateConfigReportRequest.old_value is specified,\nGenerateConfigReportRequest will contain a single ChangeReport based on the\ncomparison between GenerateConfigReportRequest.new_value and\nGenerateConfigReportRequest.old_value.\nIf GenerateConfigReportRequest.old_value is not specified, this method\nwill compare GenerateConfigReportRequest.new_value with the last pushed\nservice configuration.",
  6045. // "flatPath": "v1/services:generateConfigReport",
  6046. // "httpMethod": "POST",
  6047. // "id": "servicemanagement.services.generateConfigReport",
  6048. // "parameterOrder": [],
  6049. // "parameters": {},
  6050. // "path": "v1/services:generateConfigReport",
  6051. // "request": {
  6052. // "$ref": "GenerateConfigReportRequest"
  6053. // },
  6054. // "response": {
  6055. // "$ref": "GenerateConfigReportResponse"
  6056. // },
  6057. // "scopes": [
  6058. // "https://www.googleapis.com/auth/cloud-platform",
  6059. // "https://www.googleapis.com/auth/service.management"
  6060. // ]
  6061. // }
  6062. }
  6063. // method id "servicemanagement.services.get":
  6064. type ServicesGetCall struct {
  6065. s *APIService
  6066. serviceName string
  6067. urlParams_ gensupport.URLParams
  6068. ifNoneMatch_ string
  6069. ctx_ context.Context
  6070. header_ http.Header
  6071. }
  6072. // Get: Gets a managed service. Authentication is required unless the
  6073. // service is
  6074. // public.
  6075. func (r *ServicesService) Get(serviceName string) *ServicesGetCall {
  6076. c := &ServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6077. c.serviceName = serviceName
  6078. return c
  6079. }
  6080. // Fields allows partial responses to be retrieved. See
  6081. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6082. // for more information.
  6083. func (c *ServicesGetCall) Fields(s ...googleapi.Field) *ServicesGetCall {
  6084. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6085. return c
  6086. }
  6087. // IfNoneMatch sets the optional parameter which makes the operation
  6088. // fail if the object's ETag matches the given value. This is useful for
  6089. // getting updates only after the object has changed since the last
  6090. // request. Use googleapi.IsNotModified to check whether the response
  6091. // error from Do is the result of In-None-Match.
  6092. func (c *ServicesGetCall) IfNoneMatch(entityTag string) *ServicesGetCall {
  6093. c.ifNoneMatch_ = entityTag
  6094. return c
  6095. }
  6096. // Context sets the context to be used in this call's Do method. Any
  6097. // pending HTTP request will be aborted if the provided context is
  6098. // canceled.
  6099. func (c *ServicesGetCall) Context(ctx context.Context) *ServicesGetCall {
  6100. c.ctx_ = ctx
  6101. return c
  6102. }
  6103. // Header returns an http.Header that can be modified by the caller to
  6104. // add HTTP headers to the request.
  6105. func (c *ServicesGetCall) Header() http.Header {
  6106. if c.header_ == nil {
  6107. c.header_ = make(http.Header)
  6108. }
  6109. return c.header_
  6110. }
  6111. func (c *ServicesGetCall) doRequest(alt string) (*http.Response, error) {
  6112. reqHeaders := make(http.Header)
  6113. for k, v := range c.header_ {
  6114. reqHeaders[k] = v
  6115. }
  6116. reqHeaders.Set("User-Agent", c.s.userAgent())
  6117. if c.ifNoneMatch_ != "" {
  6118. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6119. }
  6120. var body io.Reader = nil
  6121. c.urlParams_.Set("alt", alt)
  6122. c.urlParams_.Set("prettyPrint", "false")
  6123. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}")
  6124. urls += "?" + c.urlParams_.Encode()
  6125. req, err := http.NewRequest("GET", urls, body)
  6126. if err != nil {
  6127. return nil, err
  6128. }
  6129. req.Header = reqHeaders
  6130. googleapi.Expand(req.URL, map[string]string{
  6131. "serviceName": c.serviceName,
  6132. })
  6133. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6134. }
  6135. // Do executes the "servicemanagement.services.get" call.
  6136. // Exactly one of *ManagedService or error will be non-nil. Any non-2xx
  6137. // status code is an error. Response headers are in either
  6138. // *ManagedService.ServerResponse.Header or (if a response was returned
  6139. // at all) in error.(*googleapi.Error).Header. Use
  6140. // googleapi.IsNotModified to check whether the returned error was
  6141. // because http.StatusNotModified was returned.
  6142. func (c *ServicesGetCall) Do(opts ...googleapi.CallOption) (*ManagedService, error) {
  6143. gensupport.SetOptions(c.urlParams_, opts...)
  6144. res, err := c.doRequest("json")
  6145. if res != nil && res.StatusCode == http.StatusNotModified {
  6146. if res.Body != nil {
  6147. res.Body.Close()
  6148. }
  6149. return nil, &googleapi.Error{
  6150. Code: res.StatusCode,
  6151. Header: res.Header,
  6152. }
  6153. }
  6154. if err != nil {
  6155. return nil, err
  6156. }
  6157. defer googleapi.CloseBody(res)
  6158. if err := googleapi.CheckResponse(res); err != nil {
  6159. return nil, err
  6160. }
  6161. ret := &ManagedService{
  6162. ServerResponse: googleapi.ServerResponse{
  6163. Header: res.Header,
  6164. HTTPStatusCode: res.StatusCode,
  6165. },
  6166. }
  6167. target := &ret
  6168. if err := gensupport.DecodeResponse(target, res); err != nil {
  6169. return nil, err
  6170. }
  6171. return ret, nil
  6172. // {
  6173. // "description": "Gets a managed service. Authentication is required unless the service is\npublic.",
  6174. // "flatPath": "v1/services/{serviceName}",
  6175. // "httpMethod": "GET",
  6176. // "id": "servicemanagement.services.get",
  6177. // "parameterOrder": [
  6178. // "serviceName"
  6179. // ],
  6180. // "parameters": {
  6181. // "serviceName": {
  6182. // "description": "The name of the service. See the `ServiceManager` overview for naming\nrequirements. For example: `example.googleapis.com`.",
  6183. // "location": "path",
  6184. // "required": true,
  6185. // "type": "string"
  6186. // }
  6187. // },
  6188. // "path": "v1/services/{serviceName}",
  6189. // "response": {
  6190. // "$ref": "ManagedService"
  6191. // },
  6192. // "scopes": [
  6193. // "https://www.googleapis.com/auth/cloud-platform",
  6194. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  6195. // "https://www.googleapis.com/auth/service.management",
  6196. // "https://www.googleapis.com/auth/service.management.readonly"
  6197. // ]
  6198. // }
  6199. }
  6200. // method id "servicemanagement.services.getConfig":
  6201. type ServicesGetConfigCall struct {
  6202. s *APIService
  6203. serviceName string
  6204. urlParams_ gensupport.URLParams
  6205. ifNoneMatch_ string
  6206. ctx_ context.Context
  6207. header_ http.Header
  6208. }
  6209. // GetConfig: Gets a service configuration (version) for a managed
  6210. // service.
  6211. func (r *ServicesService) GetConfig(serviceName string) *ServicesGetConfigCall {
  6212. c := &ServicesGetConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6213. c.serviceName = serviceName
  6214. return c
  6215. }
  6216. // ConfigId sets the optional parameter "configId": The id of the
  6217. // service configuration resource.
  6218. //
  6219. // This field must be specified for the server to return all fields,
  6220. // including
  6221. // `SourceInfo`.
  6222. func (c *ServicesGetConfigCall) ConfigId(configId string) *ServicesGetConfigCall {
  6223. c.urlParams_.Set("configId", configId)
  6224. return c
  6225. }
  6226. // View sets the optional parameter "view": Specifies which parts of the
  6227. // Service Config should be returned in the
  6228. // response.
  6229. //
  6230. // Possible values:
  6231. // "BASIC"
  6232. // "FULL"
  6233. func (c *ServicesGetConfigCall) View(view string) *ServicesGetConfigCall {
  6234. c.urlParams_.Set("view", view)
  6235. return c
  6236. }
  6237. // Fields allows partial responses to be retrieved. See
  6238. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6239. // for more information.
  6240. func (c *ServicesGetConfigCall) Fields(s ...googleapi.Field) *ServicesGetConfigCall {
  6241. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6242. return c
  6243. }
  6244. // IfNoneMatch sets the optional parameter which makes the operation
  6245. // fail if the object's ETag matches the given value. This is useful for
  6246. // getting updates only after the object has changed since the last
  6247. // request. Use googleapi.IsNotModified to check whether the response
  6248. // error from Do is the result of In-None-Match.
  6249. func (c *ServicesGetConfigCall) IfNoneMatch(entityTag string) *ServicesGetConfigCall {
  6250. c.ifNoneMatch_ = entityTag
  6251. return c
  6252. }
  6253. // Context sets the context to be used in this call's Do method. Any
  6254. // pending HTTP request will be aborted if the provided context is
  6255. // canceled.
  6256. func (c *ServicesGetConfigCall) Context(ctx context.Context) *ServicesGetConfigCall {
  6257. c.ctx_ = ctx
  6258. return c
  6259. }
  6260. // Header returns an http.Header that can be modified by the caller to
  6261. // add HTTP headers to the request.
  6262. func (c *ServicesGetConfigCall) Header() http.Header {
  6263. if c.header_ == nil {
  6264. c.header_ = make(http.Header)
  6265. }
  6266. return c.header_
  6267. }
  6268. func (c *ServicesGetConfigCall) doRequest(alt string) (*http.Response, error) {
  6269. reqHeaders := make(http.Header)
  6270. for k, v := range c.header_ {
  6271. reqHeaders[k] = v
  6272. }
  6273. reqHeaders.Set("User-Agent", c.s.userAgent())
  6274. if c.ifNoneMatch_ != "" {
  6275. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6276. }
  6277. var body io.Reader = nil
  6278. c.urlParams_.Set("alt", alt)
  6279. c.urlParams_.Set("prettyPrint", "false")
  6280. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}/config")
  6281. urls += "?" + c.urlParams_.Encode()
  6282. req, err := http.NewRequest("GET", urls, body)
  6283. if err != nil {
  6284. return nil, err
  6285. }
  6286. req.Header = reqHeaders
  6287. googleapi.Expand(req.URL, map[string]string{
  6288. "serviceName": c.serviceName,
  6289. })
  6290. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6291. }
  6292. // Do executes the "servicemanagement.services.getConfig" call.
  6293. // Exactly one of *Service or error will be non-nil. Any non-2xx status
  6294. // code is an error. Response headers are in either
  6295. // *Service.ServerResponse.Header or (if a response was returned at all)
  6296. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6297. // check whether the returned error was because http.StatusNotModified
  6298. // was returned.
  6299. func (c *ServicesGetConfigCall) Do(opts ...googleapi.CallOption) (*Service, error) {
  6300. gensupport.SetOptions(c.urlParams_, opts...)
  6301. res, err := c.doRequest("json")
  6302. if res != nil && res.StatusCode == http.StatusNotModified {
  6303. if res.Body != nil {
  6304. res.Body.Close()
  6305. }
  6306. return nil, &googleapi.Error{
  6307. Code: res.StatusCode,
  6308. Header: res.Header,
  6309. }
  6310. }
  6311. if err != nil {
  6312. return nil, err
  6313. }
  6314. defer googleapi.CloseBody(res)
  6315. if err := googleapi.CheckResponse(res); err != nil {
  6316. return nil, err
  6317. }
  6318. ret := &Service{
  6319. ServerResponse: googleapi.ServerResponse{
  6320. Header: res.Header,
  6321. HTTPStatusCode: res.StatusCode,
  6322. },
  6323. }
  6324. target := &ret
  6325. if err := gensupport.DecodeResponse(target, res); err != nil {
  6326. return nil, err
  6327. }
  6328. return ret, nil
  6329. // {
  6330. // "description": "Gets a service configuration (version) for a managed service.",
  6331. // "flatPath": "v1/services/{serviceName}/config",
  6332. // "httpMethod": "GET",
  6333. // "id": "servicemanagement.services.getConfig",
  6334. // "parameterOrder": [
  6335. // "serviceName"
  6336. // ],
  6337. // "parameters": {
  6338. // "configId": {
  6339. // "description": "The id of the service configuration resource.\n\nThis field must be specified for the server to return all fields, including\n`SourceInfo`.",
  6340. // "location": "query",
  6341. // "type": "string"
  6342. // },
  6343. // "serviceName": {
  6344. // "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`.",
  6345. // "location": "path",
  6346. // "required": true,
  6347. // "type": "string"
  6348. // },
  6349. // "view": {
  6350. // "description": "Specifies which parts of the Service Config should be returned in the\nresponse.",
  6351. // "enum": [
  6352. // "BASIC",
  6353. // "FULL"
  6354. // ],
  6355. // "location": "query",
  6356. // "type": "string"
  6357. // }
  6358. // },
  6359. // "path": "v1/services/{serviceName}/config",
  6360. // "response": {
  6361. // "$ref": "Service"
  6362. // },
  6363. // "scopes": [
  6364. // "https://www.googleapis.com/auth/cloud-platform",
  6365. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  6366. // "https://www.googleapis.com/auth/service.management",
  6367. // "https://www.googleapis.com/auth/service.management.readonly"
  6368. // ]
  6369. // }
  6370. }
  6371. // method id "servicemanagement.services.getIamPolicy":
  6372. type ServicesGetIamPolicyCall struct {
  6373. s *APIService
  6374. resource string
  6375. getiampolicyrequest *GetIamPolicyRequest
  6376. urlParams_ gensupport.URLParams
  6377. ctx_ context.Context
  6378. header_ http.Header
  6379. }
  6380. // GetIamPolicy: Gets the access control policy for a resource.
  6381. // Returns an empty policy if the resource exists and does not have a
  6382. // policy
  6383. // set.
  6384. func (r *ServicesService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ServicesGetIamPolicyCall {
  6385. c := &ServicesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6386. c.resource = resource
  6387. c.getiampolicyrequest = getiampolicyrequest
  6388. return c
  6389. }
  6390. // Fields allows partial responses to be retrieved. See
  6391. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6392. // for more information.
  6393. func (c *ServicesGetIamPolicyCall) Fields(s ...googleapi.Field) *ServicesGetIamPolicyCall {
  6394. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6395. return c
  6396. }
  6397. // Context sets the context to be used in this call's Do method. Any
  6398. // pending HTTP request will be aborted if the provided context is
  6399. // canceled.
  6400. func (c *ServicesGetIamPolicyCall) Context(ctx context.Context) *ServicesGetIamPolicyCall {
  6401. c.ctx_ = ctx
  6402. return c
  6403. }
  6404. // Header returns an http.Header that can be modified by the caller to
  6405. // add HTTP headers to the request.
  6406. func (c *ServicesGetIamPolicyCall) Header() http.Header {
  6407. if c.header_ == nil {
  6408. c.header_ = make(http.Header)
  6409. }
  6410. return c.header_
  6411. }
  6412. func (c *ServicesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  6413. reqHeaders := make(http.Header)
  6414. for k, v := range c.header_ {
  6415. reqHeaders[k] = v
  6416. }
  6417. reqHeaders.Set("User-Agent", c.s.userAgent())
  6418. var body io.Reader = nil
  6419. body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest)
  6420. if err != nil {
  6421. return nil, err
  6422. }
  6423. reqHeaders.Set("Content-Type", "application/json")
  6424. c.urlParams_.Set("alt", alt)
  6425. c.urlParams_.Set("prettyPrint", "false")
  6426. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
  6427. urls += "?" + c.urlParams_.Encode()
  6428. req, err := http.NewRequest("POST", urls, body)
  6429. if err != nil {
  6430. return nil, err
  6431. }
  6432. req.Header = reqHeaders
  6433. googleapi.Expand(req.URL, map[string]string{
  6434. "resource": c.resource,
  6435. })
  6436. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6437. }
  6438. // Do executes the "servicemanagement.services.getIamPolicy" call.
  6439. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  6440. // code is an error. Response headers are in either
  6441. // *Policy.ServerResponse.Header or (if a response was returned at all)
  6442. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6443. // check whether the returned error was because http.StatusNotModified
  6444. // was returned.
  6445. func (c *ServicesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  6446. gensupport.SetOptions(c.urlParams_, opts...)
  6447. res, err := c.doRequest("json")
  6448. if res != nil && res.StatusCode == http.StatusNotModified {
  6449. if res.Body != nil {
  6450. res.Body.Close()
  6451. }
  6452. return nil, &googleapi.Error{
  6453. Code: res.StatusCode,
  6454. Header: res.Header,
  6455. }
  6456. }
  6457. if err != nil {
  6458. return nil, err
  6459. }
  6460. defer googleapi.CloseBody(res)
  6461. if err := googleapi.CheckResponse(res); err != nil {
  6462. return nil, err
  6463. }
  6464. ret := &Policy{
  6465. ServerResponse: googleapi.ServerResponse{
  6466. Header: res.Header,
  6467. HTTPStatusCode: res.StatusCode,
  6468. },
  6469. }
  6470. target := &ret
  6471. if err := gensupport.DecodeResponse(target, res); err != nil {
  6472. return nil, err
  6473. }
  6474. return ret, nil
  6475. // {
  6476. // "description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset.",
  6477. // "flatPath": "v1/services/{servicesId}:getIamPolicy",
  6478. // "httpMethod": "POST",
  6479. // "id": "servicemanagement.services.getIamPolicy",
  6480. // "parameterOrder": [
  6481. // "resource"
  6482. // ],
  6483. // "parameters": {
  6484. // "resource": {
  6485. // "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.",
  6486. // "location": "path",
  6487. // "pattern": "^services/[^/]+$",
  6488. // "required": true,
  6489. // "type": "string"
  6490. // }
  6491. // },
  6492. // "path": "v1/{+resource}:getIamPolicy",
  6493. // "request": {
  6494. // "$ref": "GetIamPolicyRequest"
  6495. // },
  6496. // "response": {
  6497. // "$ref": "Policy"
  6498. // },
  6499. // "scopes": [
  6500. // "https://www.googleapis.com/auth/cloud-platform",
  6501. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  6502. // "https://www.googleapis.com/auth/service.management",
  6503. // "https://www.googleapis.com/auth/service.management.readonly"
  6504. // ]
  6505. // }
  6506. }
  6507. // method id "servicemanagement.services.list":
  6508. type ServicesListCall struct {
  6509. s *APIService
  6510. urlParams_ gensupport.URLParams
  6511. ifNoneMatch_ string
  6512. ctx_ context.Context
  6513. header_ http.Header
  6514. }
  6515. // List: Lists managed services.
  6516. //
  6517. // Returns all public services. For authenticated users, also returns
  6518. // all
  6519. // services the calling user has "servicemanagement.services.get"
  6520. // permission
  6521. // for.
  6522. //
  6523. // **BETA:** If the caller specifies the `consumer_id`, it returns only
  6524. // the
  6525. // services enabled on the consumer. The `consumer_id` must have the
  6526. // format
  6527. // of "project:{PROJECT-ID}".
  6528. func (r *ServicesService) List() *ServicesListCall {
  6529. c := &ServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6530. return c
  6531. }
  6532. // ConsumerId sets the optional parameter "consumerId": Include services
  6533. // consumed by the specified consumer.
  6534. //
  6535. // The Google Service Management implementation accepts the
  6536. // following
  6537. // forms:
  6538. // - project:<project_id>
  6539. func (c *ServicesListCall) ConsumerId(consumerId string) *ServicesListCall {
  6540. c.urlParams_.Set("consumerId", consumerId)
  6541. return c
  6542. }
  6543. // PageSize sets the optional parameter "pageSize": The max number of
  6544. // items to include in the response list. Page size is 50
  6545. // if not specified. Maximum value is 100.
  6546. func (c *ServicesListCall) PageSize(pageSize int64) *ServicesListCall {
  6547. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  6548. return c
  6549. }
  6550. // PageToken sets the optional parameter "pageToken": Token identifying
  6551. // which result to start with; returned by a previous list
  6552. // call.
  6553. func (c *ServicesListCall) PageToken(pageToken string) *ServicesListCall {
  6554. c.urlParams_.Set("pageToken", pageToken)
  6555. return c
  6556. }
  6557. // ProducerProjectId sets the optional parameter "producerProjectId":
  6558. // Include services produced by the specified project.
  6559. func (c *ServicesListCall) ProducerProjectId(producerProjectId string) *ServicesListCall {
  6560. c.urlParams_.Set("producerProjectId", producerProjectId)
  6561. return c
  6562. }
  6563. // Fields allows partial responses to be retrieved. See
  6564. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6565. // for more information.
  6566. func (c *ServicesListCall) Fields(s ...googleapi.Field) *ServicesListCall {
  6567. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6568. return c
  6569. }
  6570. // IfNoneMatch sets the optional parameter which makes the operation
  6571. // fail if the object's ETag matches the given value. This is useful for
  6572. // getting updates only after the object has changed since the last
  6573. // request. Use googleapi.IsNotModified to check whether the response
  6574. // error from Do is the result of In-None-Match.
  6575. func (c *ServicesListCall) IfNoneMatch(entityTag string) *ServicesListCall {
  6576. c.ifNoneMatch_ = entityTag
  6577. return c
  6578. }
  6579. // Context sets the context to be used in this call's Do method. Any
  6580. // pending HTTP request will be aborted if the provided context is
  6581. // canceled.
  6582. func (c *ServicesListCall) Context(ctx context.Context) *ServicesListCall {
  6583. c.ctx_ = ctx
  6584. return c
  6585. }
  6586. // Header returns an http.Header that can be modified by the caller to
  6587. // add HTTP headers to the request.
  6588. func (c *ServicesListCall) Header() http.Header {
  6589. if c.header_ == nil {
  6590. c.header_ = make(http.Header)
  6591. }
  6592. return c.header_
  6593. }
  6594. func (c *ServicesListCall) doRequest(alt string) (*http.Response, error) {
  6595. reqHeaders := make(http.Header)
  6596. for k, v := range c.header_ {
  6597. reqHeaders[k] = v
  6598. }
  6599. reqHeaders.Set("User-Agent", c.s.userAgent())
  6600. if c.ifNoneMatch_ != "" {
  6601. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6602. }
  6603. var body io.Reader = nil
  6604. c.urlParams_.Set("alt", alt)
  6605. c.urlParams_.Set("prettyPrint", "false")
  6606. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services")
  6607. urls += "?" + c.urlParams_.Encode()
  6608. req, err := http.NewRequest("GET", urls, body)
  6609. if err != nil {
  6610. return nil, err
  6611. }
  6612. req.Header = reqHeaders
  6613. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6614. }
  6615. // Do executes the "servicemanagement.services.list" call.
  6616. // Exactly one of *ListServicesResponse or error will be non-nil. Any
  6617. // non-2xx status code is an error. Response headers are in either
  6618. // *ListServicesResponse.ServerResponse.Header or (if a response was
  6619. // returned at all) in error.(*googleapi.Error).Header. Use
  6620. // googleapi.IsNotModified to check whether the returned error was
  6621. // because http.StatusNotModified was returned.
  6622. func (c *ServicesListCall) Do(opts ...googleapi.CallOption) (*ListServicesResponse, error) {
  6623. gensupport.SetOptions(c.urlParams_, opts...)
  6624. res, err := c.doRequest("json")
  6625. if res != nil && res.StatusCode == http.StatusNotModified {
  6626. if res.Body != nil {
  6627. res.Body.Close()
  6628. }
  6629. return nil, &googleapi.Error{
  6630. Code: res.StatusCode,
  6631. Header: res.Header,
  6632. }
  6633. }
  6634. if err != nil {
  6635. return nil, err
  6636. }
  6637. defer googleapi.CloseBody(res)
  6638. if err := googleapi.CheckResponse(res); err != nil {
  6639. return nil, err
  6640. }
  6641. ret := &ListServicesResponse{
  6642. ServerResponse: googleapi.ServerResponse{
  6643. Header: res.Header,
  6644. HTTPStatusCode: res.StatusCode,
  6645. },
  6646. }
  6647. target := &ret
  6648. if err := gensupport.DecodeResponse(target, res); err != nil {
  6649. return nil, err
  6650. }
  6651. return ret, nil
  6652. // {
  6653. // "description": "Lists managed services.\n\nReturns all public services. For authenticated users, also returns all\nservices the calling user has \"servicemanagement.services.get\" permission\nfor.\n\n**BETA:** If the caller specifies the `consumer_id`, it returns only the\nservices enabled on the consumer. The `consumer_id` must have the format\nof \"project:{PROJECT-ID}\".",
  6654. // "flatPath": "v1/services",
  6655. // "httpMethod": "GET",
  6656. // "id": "servicemanagement.services.list",
  6657. // "parameterOrder": [],
  6658. // "parameters": {
  6659. // "consumerId": {
  6660. // "description": "Include services consumed by the specified consumer.\n\nThe Google Service Management implementation accepts the following\nforms:\n- project:\u003cproject_id\u003e",
  6661. // "location": "query",
  6662. // "type": "string"
  6663. // },
  6664. // "pageSize": {
  6665. // "description": "The max number of items to include in the response list. Page size is 50\nif not specified. Maximum value is 100.",
  6666. // "format": "int32",
  6667. // "location": "query",
  6668. // "type": "integer"
  6669. // },
  6670. // "pageToken": {
  6671. // "description": "Token identifying which result to start with; returned by a previous list\ncall.",
  6672. // "location": "query",
  6673. // "type": "string"
  6674. // },
  6675. // "producerProjectId": {
  6676. // "description": "Include services produced by the specified project.",
  6677. // "location": "query",
  6678. // "type": "string"
  6679. // }
  6680. // },
  6681. // "path": "v1/services",
  6682. // "response": {
  6683. // "$ref": "ListServicesResponse"
  6684. // },
  6685. // "scopes": [
  6686. // "https://www.googleapis.com/auth/cloud-platform",
  6687. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  6688. // "https://www.googleapis.com/auth/service.management",
  6689. // "https://www.googleapis.com/auth/service.management.readonly"
  6690. // ]
  6691. // }
  6692. }
  6693. // Pages invokes f for each page of results.
  6694. // A non-nil error returned from f will halt the iteration.
  6695. // The provided context supersedes any context provided to the Context method.
  6696. func (c *ServicesListCall) Pages(ctx context.Context, f func(*ListServicesResponse) error) error {
  6697. c.ctx_ = ctx
  6698. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6699. for {
  6700. x, err := c.Do()
  6701. if err != nil {
  6702. return err
  6703. }
  6704. if err := f(x); err != nil {
  6705. return err
  6706. }
  6707. if x.NextPageToken == "" {
  6708. return nil
  6709. }
  6710. c.PageToken(x.NextPageToken)
  6711. }
  6712. }
  6713. // method id "servicemanagement.services.setIamPolicy":
  6714. type ServicesSetIamPolicyCall struct {
  6715. s *APIService
  6716. resource string
  6717. setiampolicyrequest *SetIamPolicyRequest
  6718. urlParams_ gensupport.URLParams
  6719. ctx_ context.Context
  6720. header_ http.Header
  6721. }
  6722. // SetIamPolicy: Sets the access control policy on the specified
  6723. // resource. Replaces any
  6724. // existing policy.
  6725. func (r *ServicesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ServicesSetIamPolicyCall {
  6726. c := &ServicesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6727. c.resource = resource
  6728. c.setiampolicyrequest = setiampolicyrequest
  6729. return c
  6730. }
  6731. // Fields allows partial responses to be retrieved. See
  6732. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6733. // for more information.
  6734. func (c *ServicesSetIamPolicyCall) Fields(s ...googleapi.Field) *ServicesSetIamPolicyCall {
  6735. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6736. return c
  6737. }
  6738. // Context sets the context to be used in this call's Do method. Any
  6739. // pending HTTP request will be aborted if the provided context is
  6740. // canceled.
  6741. func (c *ServicesSetIamPolicyCall) Context(ctx context.Context) *ServicesSetIamPolicyCall {
  6742. c.ctx_ = ctx
  6743. return c
  6744. }
  6745. // Header returns an http.Header that can be modified by the caller to
  6746. // add HTTP headers to the request.
  6747. func (c *ServicesSetIamPolicyCall) Header() http.Header {
  6748. if c.header_ == nil {
  6749. c.header_ = make(http.Header)
  6750. }
  6751. return c.header_
  6752. }
  6753. func (c *ServicesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  6754. reqHeaders := make(http.Header)
  6755. for k, v := range c.header_ {
  6756. reqHeaders[k] = v
  6757. }
  6758. reqHeaders.Set("User-Agent", c.s.userAgent())
  6759. var body io.Reader = nil
  6760. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  6761. if err != nil {
  6762. return nil, err
  6763. }
  6764. reqHeaders.Set("Content-Type", "application/json")
  6765. c.urlParams_.Set("alt", alt)
  6766. c.urlParams_.Set("prettyPrint", "false")
  6767. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
  6768. urls += "?" + c.urlParams_.Encode()
  6769. req, err := http.NewRequest("POST", urls, body)
  6770. if err != nil {
  6771. return nil, err
  6772. }
  6773. req.Header = reqHeaders
  6774. googleapi.Expand(req.URL, map[string]string{
  6775. "resource": c.resource,
  6776. })
  6777. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6778. }
  6779. // Do executes the "servicemanagement.services.setIamPolicy" call.
  6780. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  6781. // code is an error. Response headers are in either
  6782. // *Policy.ServerResponse.Header or (if a response was returned at all)
  6783. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6784. // check whether the returned error was because http.StatusNotModified
  6785. // was returned.
  6786. func (c *ServicesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  6787. gensupport.SetOptions(c.urlParams_, opts...)
  6788. res, err := c.doRequest("json")
  6789. if res != nil && res.StatusCode == http.StatusNotModified {
  6790. if res.Body != nil {
  6791. res.Body.Close()
  6792. }
  6793. return nil, &googleapi.Error{
  6794. Code: res.StatusCode,
  6795. Header: res.Header,
  6796. }
  6797. }
  6798. if err != nil {
  6799. return nil, err
  6800. }
  6801. defer googleapi.CloseBody(res)
  6802. if err := googleapi.CheckResponse(res); err != nil {
  6803. return nil, err
  6804. }
  6805. ret := &Policy{
  6806. ServerResponse: googleapi.ServerResponse{
  6807. Header: res.Header,
  6808. HTTPStatusCode: res.StatusCode,
  6809. },
  6810. }
  6811. target := &ret
  6812. if err := gensupport.DecodeResponse(target, res); err != nil {
  6813. return nil, err
  6814. }
  6815. return ret, nil
  6816. // {
  6817. // "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.",
  6818. // "flatPath": "v1/services/{servicesId}:setIamPolicy",
  6819. // "httpMethod": "POST",
  6820. // "id": "servicemanagement.services.setIamPolicy",
  6821. // "parameterOrder": [
  6822. // "resource"
  6823. // ],
  6824. // "parameters": {
  6825. // "resource": {
  6826. // "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.",
  6827. // "location": "path",
  6828. // "pattern": "^services/[^/]+$",
  6829. // "required": true,
  6830. // "type": "string"
  6831. // }
  6832. // },
  6833. // "path": "v1/{+resource}:setIamPolicy",
  6834. // "request": {
  6835. // "$ref": "SetIamPolicyRequest"
  6836. // },
  6837. // "response": {
  6838. // "$ref": "Policy"
  6839. // },
  6840. // "scopes": [
  6841. // "https://www.googleapis.com/auth/cloud-platform",
  6842. // "https://www.googleapis.com/auth/service.management"
  6843. // ]
  6844. // }
  6845. }
  6846. // method id "servicemanagement.services.testIamPermissions":
  6847. type ServicesTestIamPermissionsCall struct {
  6848. s *APIService
  6849. resource string
  6850. testiampermissionsrequest *TestIamPermissionsRequest
  6851. urlParams_ gensupport.URLParams
  6852. ctx_ context.Context
  6853. header_ http.Header
  6854. }
  6855. // TestIamPermissions: Returns permissions that a caller has on the
  6856. // specified resource.
  6857. // If the resource does not exist, this will return an empty set
  6858. // of
  6859. // permissions, not a NOT_FOUND error.
  6860. //
  6861. // Note: This operation is designed to be used for building
  6862. // permission-aware
  6863. // UIs and command-line tools, not for authorization checking. This
  6864. // operation
  6865. // may "fail open" without warning.
  6866. func (r *ServicesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ServicesTestIamPermissionsCall {
  6867. c := &ServicesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6868. c.resource = resource
  6869. c.testiampermissionsrequest = testiampermissionsrequest
  6870. return c
  6871. }
  6872. // Fields allows partial responses to be retrieved. See
  6873. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6874. // for more information.
  6875. func (c *ServicesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ServicesTestIamPermissionsCall {
  6876. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6877. return c
  6878. }
  6879. // Context sets the context to be used in this call's Do method. Any
  6880. // pending HTTP request will be aborted if the provided context is
  6881. // canceled.
  6882. func (c *ServicesTestIamPermissionsCall) Context(ctx context.Context) *ServicesTestIamPermissionsCall {
  6883. c.ctx_ = ctx
  6884. return c
  6885. }
  6886. // Header returns an http.Header that can be modified by the caller to
  6887. // add HTTP headers to the request.
  6888. func (c *ServicesTestIamPermissionsCall) Header() http.Header {
  6889. if c.header_ == nil {
  6890. c.header_ = make(http.Header)
  6891. }
  6892. return c.header_
  6893. }
  6894. func (c *ServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  6895. reqHeaders := make(http.Header)
  6896. for k, v := range c.header_ {
  6897. reqHeaders[k] = v
  6898. }
  6899. reqHeaders.Set("User-Agent", c.s.userAgent())
  6900. var body io.Reader = nil
  6901. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  6902. if err != nil {
  6903. return nil, err
  6904. }
  6905. reqHeaders.Set("Content-Type", "application/json")
  6906. c.urlParams_.Set("alt", alt)
  6907. c.urlParams_.Set("prettyPrint", "false")
  6908. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
  6909. urls += "?" + c.urlParams_.Encode()
  6910. req, err := http.NewRequest("POST", urls, body)
  6911. if err != nil {
  6912. return nil, err
  6913. }
  6914. req.Header = reqHeaders
  6915. googleapi.Expand(req.URL, map[string]string{
  6916. "resource": c.resource,
  6917. })
  6918. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6919. }
  6920. // Do executes the "servicemanagement.services.testIamPermissions" call.
  6921. // Exactly one of *TestIamPermissionsResponse or error will be non-nil.
  6922. // Any non-2xx status code is an error. Response headers are in either
  6923. // *TestIamPermissionsResponse.ServerResponse.Header or (if a response
  6924. // was returned at all) in error.(*googleapi.Error).Header. Use
  6925. // googleapi.IsNotModified to check whether the returned error was
  6926. // because http.StatusNotModified was returned.
  6927. func (c *ServicesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  6928. gensupport.SetOptions(c.urlParams_, opts...)
  6929. res, err := c.doRequest("json")
  6930. if res != nil && res.StatusCode == http.StatusNotModified {
  6931. if res.Body != nil {
  6932. res.Body.Close()
  6933. }
  6934. return nil, &googleapi.Error{
  6935. Code: res.StatusCode,
  6936. Header: res.Header,
  6937. }
  6938. }
  6939. if err != nil {
  6940. return nil, err
  6941. }
  6942. defer googleapi.CloseBody(res)
  6943. if err := googleapi.CheckResponse(res); err != nil {
  6944. return nil, err
  6945. }
  6946. ret := &TestIamPermissionsResponse{
  6947. ServerResponse: googleapi.ServerResponse{
  6948. Header: res.Header,
  6949. HTTPStatusCode: res.StatusCode,
  6950. },
  6951. }
  6952. target := &ret
  6953. if err := gensupport.DecodeResponse(target, res); err != nil {
  6954. return nil, err
  6955. }
  6956. return ret, nil
  6957. // {
  6958. // "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.",
  6959. // "flatPath": "v1/services/{servicesId}:testIamPermissions",
  6960. // "httpMethod": "POST",
  6961. // "id": "servicemanagement.services.testIamPermissions",
  6962. // "parameterOrder": [
  6963. // "resource"
  6964. // ],
  6965. // "parameters": {
  6966. // "resource": {
  6967. // "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.",
  6968. // "location": "path",
  6969. // "pattern": "^services/[^/]+$",
  6970. // "required": true,
  6971. // "type": "string"
  6972. // }
  6973. // },
  6974. // "path": "v1/{+resource}:testIamPermissions",
  6975. // "request": {
  6976. // "$ref": "TestIamPermissionsRequest"
  6977. // },
  6978. // "response": {
  6979. // "$ref": "TestIamPermissionsResponse"
  6980. // },
  6981. // "scopes": [
  6982. // "https://www.googleapis.com/auth/cloud-platform",
  6983. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  6984. // "https://www.googleapis.com/auth/service.management",
  6985. // "https://www.googleapis.com/auth/service.management.readonly"
  6986. // ]
  6987. // }
  6988. }
  6989. // method id "servicemanagement.services.undelete":
  6990. type ServicesUndeleteCall struct {
  6991. s *APIService
  6992. serviceName string
  6993. urlParams_ gensupport.URLParams
  6994. ctx_ context.Context
  6995. header_ http.Header
  6996. }
  6997. // Undelete: Revives a previously deleted managed service. The method
  6998. // restores the
  6999. // service using the configuration at the time the service was
  7000. // deleted.
  7001. // The target service must exist and must have been deleted within
  7002. // the
  7003. // last 30 days.
  7004. //
  7005. // Operation<response: UndeleteServiceResponse>
  7006. func (r *ServicesService) Undelete(serviceName string) *ServicesUndeleteCall {
  7007. c := &ServicesUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7008. c.serviceName = serviceName
  7009. return c
  7010. }
  7011. // Fields allows partial responses to be retrieved. See
  7012. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7013. // for more information.
  7014. func (c *ServicesUndeleteCall) Fields(s ...googleapi.Field) *ServicesUndeleteCall {
  7015. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7016. return c
  7017. }
  7018. // Context sets the context to be used in this call's Do method. Any
  7019. // pending HTTP request will be aborted if the provided context is
  7020. // canceled.
  7021. func (c *ServicesUndeleteCall) Context(ctx context.Context) *ServicesUndeleteCall {
  7022. c.ctx_ = ctx
  7023. return c
  7024. }
  7025. // Header returns an http.Header that can be modified by the caller to
  7026. // add HTTP headers to the request.
  7027. func (c *ServicesUndeleteCall) Header() http.Header {
  7028. if c.header_ == nil {
  7029. c.header_ = make(http.Header)
  7030. }
  7031. return c.header_
  7032. }
  7033. func (c *ServicesUndeleteCall) doRequest(alt string) (*http.Response, error) {
  7034. reqHeaders := make(http.Header)
  7035. for k, v := range c.header_ {
  7036. reqHeaders[k] = v
  7037. }
  7038. reqHeaders.Set("User-Agent", c.s.userAgent())
  7039. var body io.Reader = nil
  7040. c.urlParams_.Set("alt", alt)
  7041. c.urlParams_.Set("prettyPrint", "false")
  7042. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}:undelete")
  7043. urls += "?" + c.urlParams_.Encode()
  7044. req, err := http.NewRequest("POST", urls, body)
  7045. if err != nil {
  7046. return nil, err
  7047. }
  7048. req.Header = reqHeaders
  7049. googleapi.Expand(req.URL, map[string]string{
  7050. "serviceName": c.serviceName,
  7051. })
  7052. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7053. }
  7054. // Do executes the "servicemanagement.services.undelete" call.
  7055. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7056. // status code is an error. Response headers are in either
  7057. // *Operation.ServerResponse.Header or (if a response was returned at
  7058. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7059. // to check whether the returned error was because
  7060. // http.StatusNotModified was returned.
  7061. func (c *ServicesUndeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7062. gensupport.SetOptions(c.urlParams_, opts...)
  7063. res, err := c.doRequest("json")
  7064. if res != nil && res.StatusCode == http.StatusNotModified {
  7065. if res.Body != nil {
  7066. res.Body.Close()
  7067. }
  7068. return nil, &googleapi.Error{
  7069. Code: res.StatusCode,
  7070. Header: res.Header,
  7071. }
  7072. }
  7073. if err != nil {
  7074. return nil, err
  7075. }
  7076. defer googleapi.CloseBody(res)
  7077. if err := googleapi.CheckResponse(res); err != nil {
  7078. return nil, err
  7079. }
  7080. ret := &Operation{
  7081. ServerResponse: googleapi.ServerResponse{
  7082. Header: res.Header,
  7083. HTTPStatusCode: res.StatusCode,
  7084. },
  7085. }
  7086. target := &ret
  7087. if err := gensupport.DecodeResponse(target, res); err != nil {
  7088. return nil, err
  7089. }
  7090. return ret, nil
  7091. // {
  7092. // "description": "Revives a previously deleted managed service. The method restores the\nservice using the configuration at the time the service was deleted.\nThe target service must exist and must have been deleted within the\nlast 30 days.\n\nOperation\u003cresponse: UndeleteServiceResponse\u003e",
  7093. // "flatPath": "v1/services/{serviceName}:undelete",
  7094. // "httpMethod": "POST",
  7095. // "id": "servicemanagement.services.undelete",
  7096. // "parameterOrder": [
  7097. // "serviceName"
  7098. // ],
  7099. // "parameters": {
  7100. // "serviceName": {
  7101. // "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`.",
  7102. // "location": "path",
  7103. // "required": true,
  7104. // "type": "string"
  7105. // }
  7106. // },
  7107. // "path": "v1/services/{serviceName}:undelete",
  7108. // "response": {
  7109. // "$ref": "Operation"
  7110. // },
  7111. // "scopes": [
  7112. // "https://www.googleapis.com/auth/cloud-platform",
  7113. // "https://www.googleapis.com/auth/service.management"
  7114. // ]
  7115. // }
  7116. }
  7117. // method id "servicemanagement.services.configs.create":
  7118. type ServicesConfigsCreateCall struct {
  7119. s *APIService
  7120. serviceName string
  7121. service *Service
  7122. urlParams_ gensupport.URLParams
  7123. ctx_ context.Context
  7124. header_ http.Header
  7125. }
  7126. // Create: Creates a new service configuration (version) for a managed
  7127. // service.
  7128. // This method only stores the service configuration. To roll out the
  7129. // service
  7130. // configuration to backend systems please
  7131. // call
  7132. // CreateServiceRollout.
  7133. //
  7134. // Only the 100 most recent service configurations and ones referenced
  7135. // by
  7136. // existing rollouts are kept for each service. The rest will be
  7137. // deleted
  7138. // eventually.
  7139. func (r *ServicesConfigsService) Create(serviceName string, service *Service) *ServicesConfigsCreateCall {
  7140. c := &ServicesConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7141. c.serviceName = serviceName
  7142. c.service = service
  7143. return c
  7144. }
  7145. // Fields allows partial responses to be retrieved. See
  7146. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7147. // for more information.
  7148. func (c *ServicesConfigsCreateCall) Fields(s ...googleapi.Field) *ServicesConfigsCreateCall {
  7149. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7150. return c
  7151. }
  7152. // Context sets the context to be used in this call's Do method. Any
  7153. // pending HTTP request will be aborted if the provided context is
  7154. // canceled.
  7155. func (c *ServicesConfigsCreateCall) Context(ctx context.Context) *ServicesConfigsCreateCall {
  7156. c.ctx_ = ctx
  7157. return c
  7158. }
  7159. // Header returns an http.Header that can be modified by the caller to
  7160. // add HTTP headers to the request.
  7161. func (c *ServicesConfigsCreateCall) Header() http.Header {
  7162. if c.header_ == nil {
  7163. c.header_ = make(http.Header)
  7164. }
  7165. return c.header_
  7166. }
  7167. func (c *ServicesConfigsCreateCall) doRequest(alt string) (*http.Response, error) {
  7168. reqHeaders := make(http.Header)
  7169. for k, v := range c.header_ {
  7170. reqHeaders[k] = v
  7171. }
  7172. reqHeaders.Set("User-Agent", c.s.userAgent())
  7173. var body io.Reader = nil
  7174. body, err := googleapi.WithoutDataWrapper.JSONReader(c.service)
  7175. if err != nil {
  7176. return nil, err
  7177. }
  7178. reqHeaders.Set("Content-Type", "application/json")
  7179. c.urlParams_.Set("alt", alt)
  7180. c.urlParams_.Set("prettyPrint", "false")
  7181. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}/configs")
  7182. urls += "?" + c.urlParams_.Encode()
  7183. req, err := http.NewRequest("POST", urls, body)
  7184. if err != nil {
  7185. return nil, err
  7186. }
  7187. req.Header = reqHeaders
  7188. googleapi.Expand(req.URL, map[string]string{
  7189. "serviceName": c.serviceName,
  7190. })
  7191. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7192. }
  7193. // Do executes the "servicemanagement.services.configs.create" call.
  7194. // Exactly one of *Service or error will be non-nil. Any non-2xx status
  7195. // code is an error. Response headers are in either
  7196. // *Service.ServerResponse.Header or (if a response was returned at all)
  7197. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7198. // check whether the returned error was because http.StatusNotModified
  7199. // was returned.
  7200. func (c *ServicesConfigsCreateCall) Do(opts ...googleapi.CallOption) (*Service, error) {
  7201. gensupport.SetOptions(c.urlParams_, opts...)
  7202. res, err := c.doRequest("json")
  7203. if res != nil && res.StatusCode == http.StatusNotModified {
  7204. if res.Body != nil {
  7205. res.Body.Close()
  7206. }
  7207. return nil, &googleapi.Error{
  7208. Code: res.StatusCode,
  7209. Header: res.Header,
  7210. }
  7211. }
  7212. if err != nil {
  7213. return nil, err
  7214. }
  7215. defer googleapi.CloseBody(res)
  7216. if err := googleapi.CheckResponse(res); err != nil {
  7217. return nil, err
  7218. }
  7219. ret := &Service{
  7220. ServerResponse: googleapi.ServerResponse{
  7221. Header: res.Header,
  7222. HTTPStatusCode: res.StatusCode,
  7223. },
  7224. }
  7225. target := &ret
  7226. if err := gensupport.DecodeResponse(target, res); err != nil {
  7227. return nil, err
  7228. }
  7229. return ret, nil
  7230. // {
  7231. // "description": "Creates a new service configuration (version) for a managed service.\nThis method only stores the service configuration. To roll out the service\nconfiguration to backend systems please call\nCreateServiceRollout.\n\nOnly the 100 most recent service configurations and ones referenced by\nexisting rollouts are kept for each service. The rest will be deleted\neventually.",
  7232. // "flatPath": "v1/services/{serviceName}/configs",
  7233. // "httpMethod": "POST",
  7234. // "id": "servicemanagement.services.configs.create",
  7235. // "parameterOrder": [
  7236. // "serviceName"
  7237. // ],
  7238. // "parameters": {
  7239. // "serviceName": {
  7240. // "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`.",
  7241. // "location": "path",
  7242. // "required": true,
  7243. // "type": "string"
  7244. // }
  7245. // },
  7246. // "path": "v1/services/{serviceName}/configs",
  7247. // "request": {
  7248. // "$ref": "Service"
  7249. // },
  7250. // "response": {
  7251. // "$ref": "Service"
  7252. // },
  7253. // "scopes": [
  7254. // "https://www.googleapis.com/auth/cloud-platform",
  7255. // "https://www.googleapis.com/auth/service.management"
  7256. // ]
  7257. // }
  7258. }
  7259. // method id "servicemanagement.services.configs.get":
  7260. type ServicesConfigsGetCall struct {
  7261. s *APIService
  7262. serviceName string
  7263. configId string
  7264. urlParams_ gensupport.URLParams
  7265. ifNoneMatch_ string
  7266. ctx_ context.Context
  7267. header_ http.Header
  7268. }
  7269. // Get: Gets a service configuration (version) for a managed service.
  7270. func (r *ServicesConfigsService) Get(serviceName string, configId string) *ServicesConfigsGetCall {
  7271. c := &ServicesConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7272. c.serviceName = serviceName
  7273. c.configId = configId
  7274. return c
  7275. }
  7276. // View sets the optional parameter "view": Specifies which parts of the
  7277. // Service Config should be returned in the
  7278. // response.
  7279. //
  7280. // Possible values:
  7281. // "BASIC"
  7282. // "FULL"
  7283. func (c *ServicesConfigsGetCall) View(view string) *ServicesConfigsGetCall {
  7284. c.urlParams_.Set("view", view)
  7285. return c
  7286. }
  7287. // Fields allows partial responses to be retrieved. See
  7288. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7289. // for more information.
  7290. func (c *ServicesConfigsGetCall) Fields(s ...googleapi.Field) *ServicesConfigsGetCall {
  7291. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7292. return c
  7293. }
  7294. // IfNoneMatch sets the optional parameter which makes the operation
  7295. // fail if the object's ETag matches the given value. This is useful for
  7296. // getting updates only after the object has changed since the last
  7297. // request. Use googleapi.IsNotModified to check whether the response
  7298. // error from Do is the result of In-None-Match.
  7299. func (c *ServicesConfigsGetCall) IfNoneMatch(entityTag string) *ServicesConfigsGetCall {
  7300. c.ifNoneMatch_ = entityTag
  7301. return c
  7302. }
  7303. // Context sets the context to be used in this call's Do method. Any
  7304. // pending HTTP request will be aborted if the provided context is
  7305. // canceled.
  7306. func (c *ServicesConfigsGetCall) Context(ctx context.Context) *ServicesConfigsGetCall {
  7307. c.ctx_ = ctx
  7308. return c
  7309. }
  7310. // Header returns an http.Header that can be modified by the caller to
  7311. // add HTTP headers to the request.
  7312. func (c *ServicesConfigsGetCall) Header() http.Header {
  7313. if c.header_ == nil {
  7314. c.header_ = make(http.Header)
  7315. }
  7316. return c.header_
  7317. }
  7318. func (c *ServicesConfigsGetCall) doRequest(alt string) (*http.Response, error) {
  7319. reqHeaders := make(http.Header)
  7320. for k, v := range c.header_ {
  7321. reqHeaders[k] = v
  7322. }
  7323. reqHeaders.Set("User-Agent", c.s.userAgent())
  7324. if c.ifNoneMatch_ != "" {
  7325. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7326. }
  7327. var body io.Reader = nil
  7328. c.urlParams_.Set("alt", alt)
  7329. c.urlParams_.Set("prettyPrint", "false")
  7330. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}/configs/{configId}")
  7331. urls += "?" + c.urlParams_.Encode()
  7332. req, err := http.NewRequest("GET", urls, body)
  7333. if err != nil {
  7334. return nil, err
  7335. }
  7336. req.Header = reqHeaders
  7337. googleapi.Expand(req.URL, map[string]string{
  7338. "serviceName": c.serviceName,
  7339. "configId": c.configId,
  7340. })
  7341. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7342. }
  7343. // Do executes the "servicemanagement.services.configs.get" call.
  7344. // Exactly one of *Service or error will be non-nil. Any non-2xx status
  7345. // code is an error. Response headers are in either
  7346. // *Service.ServerResponse.Header or (if a response was returned at all)
  7347. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7348. // check whether the returned error was because http.StatusNotModified
  7349. // was returned.
  7350. func (c *ServicesConfigsGetCall) Do(opts ...googleapi.CallOption) (*Service, error) {
  7351. gensupport.SetOptions(c.urlParams_, opts...)
  7352. res, err := c.doRequest("json")
  7353. if res != nil && res.StatusCode == http.StatusNotModified {
  7354. if res.Body != nil {
  7355. res.Body.Close()
  7356. }
  7357. return nil, &googleapi.Error{
  7358. Code: res.StatusCode,
  7359. Header: res.Header,
  7360. }
  7361. }
  7362. if err != nil {
  7363. return nil, err
  7364. }
  7365. defer googleapi.CloseBody(res)
  7366. if err := googleapi.CheckResponse(res); err != nil {
  7367. return nil, err
  7368. }
  7369. ret := &Service{
  7370. ServerResponse: googleapi.ServerResponse{
  7371. Header: res.Header,
  7372. HTTPStatusCode: res.StatusCode,
  7373. },
  7374. }
  7375. target := &ret
  7376. if err := gensupport.DecodeResponse(target, res); err != nil {
  7377. return nil, err
  7378. }
  7379. return ret, nil
  7380. // {
  7381. // "description": "Gets a service configuration (version) for a managed service.",
  7382. // "flatPath": "v1/services/{serviceName}/configs/{configId}",
  7383. // "httpMethod": "GET",
  7384. // "id": "servicemanagement.services.configs.get",
  7385. // "parameterOrder": [
  7386. // "serviceName",
  7387. // "configId"
  7388. // ],
  7389. // "parameters": {
  7390. // "configId": {
  7391. // "description": "The id of the service configuration resource.\n\nThis field must be specified for the server to return all fields, including\n`SourceInfo`.",
  7392. // "location": "path",
  7393. // "required": true,
  7394. // "type": "string"
  7395. // },
  7396. // "serviceName": {
  7397. // "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`.",
  7398. // "location": "path",
  7399. // "required": true,
  7400. // "type": "string"
  7401. // },
  7402. // "view": {
  7403. // "description": "Specifies which parts of the Service Config should be returned in the\nresponse.",
  7404. // "enum": [
  7405. // "BASIC",
  7406. // "FULL"
  7407. // ],
  7408. // "location": "query",
  7409. // "type": "string"
  7410. // }
  7411. // },
  7412. // "path": "v1/services/{serviceName}/configs/{configId}",
  7413. // "response": {
  7414. // "$ref": "Service"
  7415. // },
  7416. // "scopes": [
  7417. // "https://www.googleapis.com/auth/cloud-platform",
  7418. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  7419. // "https://www.googleapis.com/auth/service.management",
  7420. // "https://www.googleapis.com/auth/service.management.readonly"
  7421. // ]
  7422. // }
  7423. }
  7424. // method id "servicemanagement.services.configs.list":
  7425. type ServicesConfigsListCall struct {
  7426. s *APIService
  7427. serviceName string
  7428. urlParams_ gensupport.URLParams
  7429. ifNoneMatch_ string
  7430. ctx_ context.Context
  7431. header_ http.Header
  7432. }
  7433. // List: Lists the history of the service configuration for a managed
  7434. // service,
  7435. // from the newest to the oldest.
  7436. func (r *ServicesConfigsService) List(serviceName string) *ServicesConfigsListCall {
  7437. c := &ServicesConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7438. c.serviceName = serviceName
  7439. return c
  7440. }
  7441. // PageSize sets the optional parameter "pageSize": The max number of
  7442. // items to include in the response list. Page size is 50
  7443. // if not specified. Maximum value is 100.
  7444. func (c *ServicesConfigsListCall) PageSize(pageSize int64) *ServicesConfigsListCall {
  7445. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  7446. return c
  7447. }
  7448. // PageToken sets the optional parameter "pageToken": The token of the
  7449. // page to retrieve.
  7450. func (c *ServicesConfigsListCall) PageToken(pageToken string) *ServicesConfigsListCall {
  7451. c.urlParams_.Set("pageToken", pageToken)
  7452. return c
  7453. }
  7454. // Fields allows partial responses to be retrieved. See
  7455. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7456. // for more information.
  7457. func (c *ServicesConfigsListCall) Fields(s ...googleapi.Field) *ServicesConfigsListCall {
  7458. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7459. return c
  7460. }
  7461. // IfNoneMatch sets the optional parameter which makes the operation
  7462. // fail if the object's ETag matches the given value. This is useful for
  7463. // getting updates only after the object has changed since the last
  7464. // request. Use googleapi.IsNotModified to check whether the response
  7465. // error from Do is the result of In-None-Match.
  7466. func (c *ServicesConfigsListCall) IfNoneMatch(entityTag string) *ServicesConfigsListCall {
  7467. c.ifNoneMatch_ = entityTag
  7468. return c
  7469. }
  7470. // Context sets the context to be used in this call's Do method. Any
  7471. // pending HTTP request will be aborted if the provided context is
  7472. // canceled.
  7473. func (c *ServicesConfigsListCall) Context(ctx context.Context) *ServicesConfigsListCall {
  7474. c.ctx_ = ctx
  7475. return c
  7476. }
  7477. // Header returns an http.Header that can be modified by the caller to
  7478. // add HTTP headers to the request.
  7479. func (c *ServicesConfigsListCall) Header() http.Header {
  7480. if c.header_ == nil {
  7481. c.header_ = make(http.Header)
  7482. }
  7483. return c.header_
  7484. }
  7485. func (c *ServicesConfigsListCall) doRequest(alt string) (*http.Response, error) {
  7486. reqHeaders := make(http.Header)
  7487. for k, v := range c.header_ {
  7488. reqHeaders[k] = v
  7489. }
  7490. reqHeaders.Set("User-Agent", c.s.userAgent())
  7491. if c.ifNoneMatch_ != "" {
  7492. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7493. }
  7494. var body io.Reader = nil
  7495. c.urlParams_.Set("alt", alt)
  7496. c.urlParams_.Set("prettyPrint", "false")
  7497. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}/configs")
  7498. urls += "?" + c.urlParams_.Encode()
  7499. req, err := http.NewRequest("GET", urls, body)
  7500. if err != nil {
  7501. return nil, err
  7502. }
  7503. req.Header = reqHeaders
  7504. googleapi.Expand(req.URL, map[string]string{
  7505. "serviceName": c.serviceName,
  7506. })
  7507. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7508. }
  7509. // Do executes the "servicemanagement.services.configs.list" call.
  7510. // Exactly one of *ListServiceConfigsResponse or error will be non-nil.
  7511. // Any non-2xx status code is an error. Response headers are in either
  7512. // *ListServiceConfigsResponse.ServerResponse.Header or (if a response
  7513. // was returned at all) in error.(*googleapi.Error).Header. Use
  7514. // googleapi.IsNotModified to check whether the returned error was
  7515. // because http.StatusNotModified was returned.
  7516. func (c *ServicesConfigsListCall) Do(opts ...googleapi.CallOption) (*ListServiceConfigsResponse, error) {
  7517. gensupport.SetOptions(c.urlParams_, opts...)
  7518. res, err := c.doRequest("json")
  7519. if res != nil && res.StatusCode == http.StatusNotModified {
  7520. if res.Body != nil {
  7521. res.Body.Close()
  7522. }
  7523. return nil, &googleapi.Error{
  7524. Code: res.StatusCode,
  7525. Header: res.Header,
  7526. }
  7527. }
  7528. if err != nil {
  7529. return nil, err
  7530. }
  7531. defer googleapi.CloseBody(res)
  7532. if err := googleapi.CheckResponse(res); err != nil {
  7533. return nil, err
  7534. }
  7535. ret := &ListServiceConfigsResponse{
  7536. ServerResponse: googleapi.ServerResponse{
  7537. Header: res.Header,
  7538. HTTPStatusCode: res.StatusCode,
  7539. },
  7540. }
  7541. target := &ret
  7542. if err := gensupport.DecodeResponse(target, res); err != nil {
  7543. return nil, err
  7544. }
  7545. return ret, nil
  7546. // {
  7547. // "description": "Lists the history of the service configuration for a managed service,\nfrom the newest to the oldest.",
  7548. // "flatPath": "v1/services/{serviceName}/configs",
  7549. // "httpMethod": "GET",
  7550. // "id": "servicemanagement.services.configs.list",
  7551. // "parameterOrder": [
  7552. // "serviceName"
  7553. // ],
  7554. // "parameters": {
  7555. // "pageSize": {
  7556. // "description": "The max number of items to include in the response list. Page size is 50\nif not specified. Maximum value is 100.",
  7557. // "format": "int32",
  7558. // "location": "query",
  7559. // "type": "integer"
  7560. // },
  7561. // "pageToken": {
  7562. // "description": "The token of the page to retrieve.",
  7563. // "location": "query",
  7564. // "type": "string"
  7565. // },
  7566. // "serviceName": {
  7567. // "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`.",
  7568. // "location": "path",
  7569. // "required": true,
  7570. // "type": "string"
  7571. // }
  7572. // },
  7573. // "path": "v1/services/{serviceName}/configs",
  7574. // "response": {
  7575. // "$ref": "ListServiceConfigsResponse"
  7576. // },
  7577. // "scopes": [
  7578. // "https://www.googleapis.com/auth/cloud-platform",
  7579. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  7580. // "https://www.googleapis.com/auth/service.management",
  7581. // "https://www.googleapis.com/auth/service.management.readonly"
  7582. // ]
  7583. // }
  7584. }
  7585. // Pages invokes f for each page of results.
  7586. // A non-nil error returned from f will halt the iteration.
  7587. // The provided context supersedes any context provided to the Context method.
  7588. func (c *ServicesConfigsListCall) Pages(ctx context.Context, f func(*ListServiceConfigsResponse) error) error {
  7589. c.ctx_ = ctx
  7590. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7591. for {
  7592. x, err := c.Do()
  7593. if err != nil {
  7594. return err
  7595. }
  7596. if err := f(x); err != nil {
  7597. return err
  7598. }
  7599. if x.NextPageToken == "" {
  7600. return nil
  7601. }
  7602. c.PageToken(x.NextPageToken)
  7603. }
  7604. }
  7605. // method id "servicemanagement.services.configs.submit":
  7606. type ServicesConfigsSubmitCall struct {
  7607. s *APIService
  7608. serviceName string
  7609. submitconfigsourcerequest *SubmitConfigSourceRequest
  7610. urlParams_ gensupport.URLParams
  7611. ctx_ context.Context
  7612. header_ http.Header
  7613. }
  7614. // Submit: Creates a new service configuration (version) for a managed
  7615. // service based
  7616. // on
  7617. // user-supplied configuration source files (for example:
  7618. // OpenAPI
  7619. // Specification). This method stores the source configurations as well
  7620. // as the
  7621. // generated service configuration. To rollout the service configuration
  7622. // to
  7623. // other services,
  7624. // please call CreateServiceRollout.
  7625. //
  7626. // Only the 100 most recent configuration sources and ones referenced
  7627. // by
  7628. // existing service configurtions are kept for each service. The rest
  7629. // will be
  7630. // deleted eventually.
  7631. //
  7632. // Operation<response: SubmitConfigSourceResponse>
  7633. func (r *ServicesConfigsService) Submit(serviceName string, submitconfigsourcerequest *SubmitConfigSourceRequest) *ServicesConfigsSubmitCall {
  7634. c := &ServicesConfigsSubmitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7635. c.serviceName = serviceName
  7636. c.submitconfigsourcerequest = submitconfigsourcerequest
  7637. return c
  7638. }
  7639. // Fields allows partial responses to be retrieved. See
  7640. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7641. // for more information.
  7642. func (c *ServicesConfigsSubmitCall) Fields(s ...googleapi.Field) *ServicesConfigsSubmitCall {
  7643. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7644. return c
  7645. }
  7646. // Context sets the context to be used in this call's Do method. Any
  7647. // pending HTTP request will be aborted if the provided context is
  7648. // canceled.
  7649. func (c *ServicesConfigsSubmitCall) Context(ctx context.Context) *ServicesConfigsSubmitCall {
  7650. c.ctx_ = ctx
  7651. return c
  7652. }
  7653. // Header returns an http.Header that can be modified by the caller to
  7654. // add HTTP headers to the request.
  7655. func (c *ServicesConfigsSubmitCall) Header() http.Header {
  7656. if c.header_ == nil {
  7657. c.header_ = make(http.Header)
  7658. }
  7659. return c.header_
  7660. }
  7661. func (c *ServicesConfigsSubmitCall) doRequest(alt string) (*http.Response, error) {
  7662. reqHeaders := make(http.Header)
  7663. for k, v := range c.header_ {
  7664. reqHeaders[k] = v
  7665. }
  7666. reqHeaders.Set("User-Agent", c.s.userAgent())
  7667. var body io.Reader = nil
  7668. body, err := googleapi.WithoutDataWrapper.JSONReader(c.submitconfigsourcerequest)
  7669. if err != nil {
  7670. return nil, err
  7671. }
  7672. reqHeaders.Set("Content-Type", "application/json")
  7673. c.urlParams_.Set("alt", alt)
  7674. c.urlParams_.Set("prettyPrint", "false")
  7675. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}/configs:submit")
  7676. urls += "?" + c.urlParams_.Encode()
  7677. req, err := http.NewRequest("POST", urls, body)
  7678. if err != nil {
  7679. return nil, err
  7680. }
  7681. req.Header = reqHeaders
  7682. googleapi.Expand(req.URL, map[string]string{
  7683. "serviceName": c.serviceName,
  7684. })
  7685. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7686. }
  7687. // Do executes the "servicemanagement.services.configs.submit" call.
  7688. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7689. // status code is an error. Response headers are in either
  7690. // *Operation.ServerResponse.Header or (if a response was returned at
  7691. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7692. // to check whether the returned error was because
  7693. // http.StatusNotModified was returned.
  7694. func (c *ServicesConfigsSubmitCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7695. gensupport.SetOptions(c.urlParams_, opts...)
  7696. res, err := c.doRequest("json")
  7697. if res != nil && res.StatusCode == http.StatusNotModified {
  7698. if res.Body != nil {
  7699. res.Body.Close()
  7700. }
  7701. return nil, &googleapi.Error{
  7702. Code: res.StatusCode,
  7703. Header: res.Header,
  7704. }
  7705. }
  7706. if err != nil {
  7707. return nil, err
  7708. }
  7709. defer googleapi.CloseBody(res)
  7710. if err := googleapi.CheckResponse(res); err != nil {
  7711. return nil, err
  7712. }
  7713. ret := &Operation{
  7714. ServerResponse: googleapi.ServerResponse{
  7715. Header: res.Header,
  7716. HTTPStatusCode: res.StatusCode,
  7717. },
  7718. }
  7719. target := &ret
  7720. if err := gensupport.DecodeResponse(target, res); err != nil {
  7721. return nil, err
  7722. }
  7723. return ret, nil
  7724. // {
  7725. // "description": "Creates a new service configuration (version) for a managed service based\non\nuser-supplied configuration source files (for example: OpenAPI\nSpecification). This method stores the source configurations as well as the\ngenerated service configuration. To rollout the service configuration to\nother services,\nplease call CreateServiceRollout.\n\nOnly the 100 most recent configuration sources and ones referenced by\nexisting service configurtions are kept for each service. The rest will be\ndeleted eventually.\n\nOperation\u003cresponse: SubmitConfigSourceResponse\u003e",
  7726. // "flatPath": "v1/services/{serviceName}/configs:submit",
  7727. // "httpMethod": "POST",
  7728. // "id": "servicemanagement.services.configs.submit",
  7729. // "parameterOrder": [
  7730. // "serviceName"
  7731. // ],
  7732. // "parameters": {
  7733. // "serviceName": {
  7734. // "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`.",
  7735. // "location": "path",
  7736. // "required": true,
  7737. // "type": "string"
  7738. // }
  7739. // },
  7740. // "path": "v1/services/{serviceName}/configs:submit",
  7741. // "request": {
  7742. // "$ref": "SubmitConfigSourceRequest"
  7743. // },
  7744. // "response": {
  7745. // "$ref": "Operation"
  7746. // },
  7747. // "scopes": [
  7748. // "https://www.googleapis.com/auth/cloud-platform",
  7749. // "https://www.googleapis.com/auth/service.management"
  7750. // ]
  7751. // }
  7752. }
  7753. // method id "servicemanagement.services.consumers.getIamPolicy":
  7754. type ServicesConsumersGetIamPolicyCall struct {
  7755. s *APIService
  7756. resource string
  7757. getiampolicyrequest *GetIamPolicyRequest
  7758. urlParams_ gensupport.URLParams
  7759. ctx_ context.Context
  7760. header_ http.Header
  7761. }
  7762. // GetIamPolicy: Gets the access control policy for a resource.
  7763. // Returns an empty policy if the resource exists and does not have a
  7764. // policy
  7765. // set.
  7766. func (r *ServicesConsumersService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ServicesConsumersGetIamPolicyCall {
  7767. c := &ServicesConsumersGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7768. c.resource = resource
  7769. c.getiampolicyrequest = getiampolicyrequest
  7770. return c
  7771. }
  7772. // Fields allows partial responses to be retrieved. See
  7773. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7774. // for more information.
  7775. func (c *ServicesConsumersGetIamPolicyCall) Fields(s ...googleapi.Field) *ServicesConsumersGetIamPolicyCall {
  7776. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7777. return c
  7778. }
  7779. // Context sets the context to be used in this call's Do method. Any
  7780. // pending HTTP request will be aborted if the provided context is
  7781. // canceled.
  7782. func (c *ServicesConsumersGetIamPolicyCall) Context(ctx context.Context) *ServicesConsumersGetIamPolicyCall {
  7783. c.ctx_ = ctx
  7784. return c
  7785. }
  7786. // Header returns an http.Header that can be modified by the caller to
  7787. // add HTTP headers to the request.
  7788. func (c *ServicesConsumersGetIamPolicyCall) Header() http.Header {
  7789. if c.header_ == nil {
  7790. c.header_ = make(http.Header)
  7791. }
  7792. return c.header_
  7793. }
  7794. func (c *ServicesConsumersGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  7795. reqHeaders := make(http.Header)
  7796. for k, v := range c.header_ {
  7797. reqHeaders[k] = v
  7798. }
  7799. reqHeaders.Set("User-Agent", c.s.userAgent())
  7800. var body io.Reader = nil
  7801. body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest)
  7802. if err != nil {
  7803. return nil, err
  7804. }
  7805. reqHeaders.Set("Content-Type", "application/json")
  7806. c.urlParams_.Set("alt", alt)
  7807. c.urlParams_.Set("prettyPrint", "false")
  7808. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
  7809. urls += "?" + c.urlParams_.Encode()
  7810. req, err := http.NewRequest("POST", urls, body)
  7811. if err != nil {
  7812. return nil, err
  7813. }
  7814. req.Header = reqHeaders
  7815. googleapi.Expand(req.URL, map[string]string{
  7816. "resource": c.resource,
  7817. })
  7818. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7819. }
  7820. // Do executes the "servicemanagement.services.consumers.getIamPolicy" call.
  7821. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  7822. // code is an error. Response headers are in either
  7823. // *Policy.ServerResponse.Header or (if a response was returned at all)
  7824. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7825. // check whether the returned error was because http.StatusNotModified
  7826. // was returned.
  7827. func (c *ServicesConsumersGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  7828. gensupport.SetOptions(c.urlParams_, opts...)
  7829. res, err := c.doRequest("json")
  7830. if res != nil && res.StatusCode == http.StatusNotModified {
  7831. if res.Body != nil {
  7832. res.Body.Close()
  7833. }
  7834. return nil, &googleapi.Error{
  7835. Code: res.StatusCode,
  7836. Header: res.Header,
  7837. }
  7838. }
  7839. if err != nil {
  7840. return nil, err
  7841. }
  7842. defer googleapi.CloseBody(res)
  7843. if err := googleapi.CheckResponse(res); err != nil {
  7844. return nil, err
  7845. }
  7846. ret := &Policy{
  7847. ServerResponse: googleapi.ServerResponse{
  7848. Header: res.Header,
  7849. HTTPStatusCode: res.StatusCode,
  7850. },
  7851. }
  7852. target := &ret
  7853. if err := gensupport.DecodeResponse(target, res); err != nil {
  7854. return nil, err
  7855. }
  7856. return ret, nil
  7857. // {
  7858. // "description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset.",
  7859. // "flatPath": "v1/services/{servicesId}/consumers/{consumersId}:getIamPolicy",
  7860. // "httpMethod": "POST",
  7861. // "id": "servicemanagement.services.consumers.getIamPolicy",
  7862. // "parameterOrder": [
  7863. // "resource"
  7864. // ],
  7865. // "parameters": {
  7866. // "resource": {
  7867. // "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.",
  7868. // "location": "path",
  7869. // "pattern": "^services/[^/]+/consumers/[^/]+$",
  7870. // "required": true,
  7871. // "type": "string"
  7872. // }
  7873. // },
  7874. // "path": "v1/{+resource}:getIamPolicy",
  7875. // "request": {
  7876. // "$ref": "GetIamPolicyRequest"
  7877. // },
  7878. // "response": {
  7879. // "$ref": "Policy"
  7880. // },
  7881. // "scopes": [
  7882. // "https://www.googleapis.com/auth/cloud-platform",
  7883. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  7884. // "https://www.googleapis.com/auth/service.management",
  7885. // "https://www.googleapis.com/auth/service.management.readonly"
  7886. // ]
  7887. // }
  7888. }
  7889. // method id "servicemanagement.services.consumers.setIamPolicy":
  7890. type ServicesConsumersSetIamPolicyCall struct {
  7891. s *APIService
  7892. resource string
  7893. setiampolicyrequest *SetIamPolicyRequest
  7894. urlParams_ gensupport.URLParams
  7895. ctx_ context.Context
  7896. header_ http.Header
  7897. }
  7898. // SetIamPolicy: Sets the access control policy on the specified
  7899. // resource. Replaces any
  7900. // existing policy.
  7901. func (r *ServicesConsumersService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ServicesConsumersSetIamPolicyCall {
  7902. c := &ServicesConsumersSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7903. c.resource = resource
  7904. c.setiampolicyrequest = setiampolicyrequest
  7905. return c
  7906. }
  7907. // Fields allows partial responses to be retrieved. See
  7908. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7909. // for more information.
  7910. func (c *ServicesConsumersSetIamPolicyCall) Fields(s ...googleapi.Field) *ServicesConsumersSetIamPolicyCall {
  7911. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7912. return c
  7913. }
  7914. // Context sets the context to be used in this call's Do method. Any
  7915. // pending HTTP request will be aborted if the provided context is
  7916. // canceled.
  7917. func (c *ServicesConsumersSetIamPolicyCall) Context(ctx context.Context) *ServicesConsumersSetIamPolicyCall {
  7918. c.ctx_ = ctx
  7919. return c
  7920. }
  7921. // Header returns an http.Header that can be modified by the caller to
  7922. // add HTTP headers to the request.
  7923. func (c *ServicesConsumersSetIamPolicyCall) Header() http.Header {
  7924. if c.header_ == nil {
  7925. c.header_ = make(http.Header)
  7926. }
  7927. return c.header_
  7928. }
  7929. func (c *ServicesConsumersSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  7930. reqHeaders := make(http.Header)
  7931. for k, v := range c.header_ {
  7932. reqHeaders[k] = v
  7933. }
  7934. reqHeaders.Set("User-Agent", c.s.userAgent())
  7935. var body io.Reader = nil
  7936. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  7937. if err != nil {
  7938. return nil, err
  7939. }
  7940. reqHeaders.Set("Content-Type", "application/json")
  7941. c.urlParams_.Set("alt", alt)
  7942. c.urlParams_.Set("prettyPrint", "false")
  7943. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
  7944. urls += "?" + c.urlParams_.Encode()
  7945. req, err := http.NewRequest("POST", urls, body)
  7946. if err != nil {
  7947. return nil, err
  7948. }
  7949. req.Header = reqHeaders
  7950. googleapi.Expand(req.URL, map[string]string{
  7951. "resource": c.resource,
  7952. })
  7953. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7954. }
  7955. // Do executes the "servicemanagement.services.consumers.setIamPolicy" call.
  7956. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  7957. // code is an error. Response headers are in either
  7958. // *Policy.ServerResponse.Header or (if a response was returned at all)
  7959. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7960. // check whether the returned error was because http.StatusNotModified
  7961. // was returned.
  7962. func (c *ServicesConsumersSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  7963. gensupport.SetOptions(c.urlParams_, opts...)
  7964. res, err := c.doRequest("json")
  7965. if res != nil && res.StatusCode == http.StatusNotModified {
  7966. if res.Body != nil {
  7967. res.Body.Close()
  7968. }
  7969. return nil, &googleapi.Error{
  7970. Code: res.StatusCode,
  7971. Header: res.Header,
  7972. }
  7973. }
  7974. if err != nil {
  7975. return nil, err
  7976. }
  7977. defer googleapi.CloseBody(res)
  7978. if err := googleapi.CheckResponse(res); err != nil {
  7979. return nil, err
  7980. }
  7981. ret := &Policy{
  7982. ServerResponse: googleapi.ServerResponse{
  7983. Header: res.Header,
  7984. HTTPStatusCode: res.StatusCode,
  7985. },
  7986. }
  7987. target := &ret
  7988. if err := gensupport.DecodeResponse(target, res); err != nil {
  7989. return nil, err
  7990. }
  7991. return ret, nil
  7992. // {
  7993. // "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.",
  7994. // "flatPath": "v1/services/{servicesId}/consumers/{consumersId}:setIamPolicy",
  7995. // "httpMethod": "POST",
  7996. // "id": "servicemanagement.services.consumers.setIamPolicy",
  7997. // "parameterOrder": [
  7998. // "resource"
  7999. // ],
  8000. // "parameters": {
  8001. // "resource": {
  8002. // "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.",
  8003. // "location": "path",
  8004. // "pattern": "^services/[^/]+/consumers/[^/]+$",
  8005. // "required": true,
  8006. // "type": "string"
  8007. // }
  8008. // },
  8009. // "path": "v1/{+resource}:setIamPolicy",
  8010. // "request": {
  8011. // "$ref": "SetIamPolicyRequest"
  8012. // },
  8013. // "response": {
  8014. // "$ref": "Policy"
  8015. // },
  8016. // "scopes": [
  8017. // "https://www.googleapis.com/auth/cloud-platform",
  8018. // "https://www.googleapis.com/auth/service.management"
  8019. // ]
  8020. // }
  8021. }
  8022. // method id "servicemanagement.services.consumers.testIamPermissions":
  8023. type ServicesConsumersTestIamPermissionsCall struct {
  8024. s *APIService
  8025. resource string
  8026. testiampermissionsrequest *TestIamPermissionsRequest
  8027. urlParams_ gensupport.URLParams
  8028. ctx_ context.Context
  8029. header_ http.Header
  8030. }
  8031. // TestIamPermissions: Returns permissions that a caller has on the
  8032. // specified resource.
  8033. // If the resource does not exist, this will return an empty set
  8034. // of
  8035. // permissions, not a NOT_FOUND error.
  8036. //
  8037. // Note: This operation is designed to be used for building
  8038. // permission-aware
  8039. // UIs and command-line tools, not for authorization checking. This
  8040. // operation
  8041. // may "fail open" without warning.
  8042. func (r *ServicesConsumersService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ServicesConsumersTestIamPermissionsCall {
  8043. c := &ServicesConsumersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8044. c.resource = resource
  8045. c.testiampermissionsrequest = testiampermissionsrequest
  8046. return c
  8047. }
  8048. // Fields allows partial responses to be retrieved. See
  8049. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8050. // for more information.
  8051. func (c *ServicesConsumersTestIamPermissionsCall) Fields(s ...googleapi.Field) *ServicesConsumersTestIamPermissionsCall {
  8052. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8053. return c
  8054. }
  8055. // Context sets the context to be used in this call's Do method. Any
  8056. // pending HTTP request will be aborted if the provided context is
  8057. // canceled.
  8058. func (c *ServicesConsumersTestIamPermissionsCall) Context(ctx context.Context) *ServicesConsumersTestIamPermissionsCall {
  8059. c.ctx_ = ctx
  8060. return c
  8061. }
  8062. // Header returns an http.Header that can be modified by the caller to
  8063. // add HTTP headers to the request.
  8064. func (c *ServicesConsumersTestIamPermissionsCall) Header() http.Header {
  8065. if c.header_ == nil {
  8066. c.header_ = make(http.Header)
  8067. }
  8068. return c.header_
  8069. }
  8070. func (c *ServicesConsumersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  8071. reqHeaders := make(http.Header)
  8072. for k, v := range c.header_ {
  8073. reqHeaders[k] = v
  8074. }
  8075. reqHeaders.Set("User-Agent", c.s.userAgent())
  8076. var body io.Reader = nil
  8077. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  8078. if err != nil {
  8079. return nil, err
  8080. }
  8081. reqHeaders.Set("Content-Type", "application/json")
  8082. c.urlParams_.Set("alt", alt)
  8083. c.urlParams_.Set("prettyPrint", "false")
  8084. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
  8085. urls += "?" + c.urlParams_.Encode()
  8086. req, err := http.NewRequest("POST", urls, body)
  8087. if err != nil {
  8088. return nil, err
  8089. }
  8090. req.Header = reqHeaders
  8091. googleapi.Expand(req.URL, map[string]string{
  8092. "resource": c.resource,
  8093. })
  8094. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8095. }
  8096. // Do executes the "servicemanagement.services.consumers.testIamPermissions" call.
  8097. // Exactly one of *TestIamPermissionsResponse or error will be non-nil.
  8098. // Any non-2xx status code is an error. Response headers are in either
  8099. // *TestIamPermissionsResponse.ServerResponse.Header or (if a response
  8100. // was returned at all) in error.(*googleapi.Error).Header. Use
  8101. // googleapi.IsNotModified to check whether the returned error was
  8102. // because http.StatusNotModified was returned.
  8103. func (c *ServicesConsumersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  8104. gensupport.SetOptions(c.urlParams_, opts...)
  8105. res, err := c.doRequest("json")
  8106. if res != nil && res.StatusCode == http.StatusNotModified {
  8107. if res.Body != nil {
  8108. res.Body.Close()
  8109. }
  8110. return nil, &googleapi.Error{
  8111. Code: res.StatusCode,
  8112. Header: res.Header,
  8113. }
  8114. }
  8115. if err != nil {
  8116. return nil, err
  8117. }
  8118. defer googleapi.CloseBody(res)
  8119. if err := googleapi.CheckResponse(res); err != nil {
  8120. return nil, err
  8121. }
  8122. ret := &TestIamPermissionsResponse{
  8123. ServerResponse: googleapi.ServerResponse{
  8124. Header: res.Header,
  8125. HTTPStatusCode: res.StatusCode,
  8126. },
  8127. }
  8128. target := &ret
  8129. if err := gensupport.DecodeResponse(target, res); err != nil {
  8130. return nil, err
  8131. }
  8132. return ret, nil
  8133. // {
  8134. // "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.",
  8135. // "flatPath": "v1/services/{servicesId}/consumers/{consumersId}:testIamPermissions",
  8136. // "httpMethod": "POST",
  8137. // "id": "servicemanagement.services.consumers.testIamPermissions",
  8138. // "parameterOrder": [
  8139. // "resource"
  8140. // ],
  8141. // "parameters": {
  8142. // "resource": {
  8143. // "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.",
  8144. // "location": "path",
  8145. // "pattern": "^services/[^/]+/consumers/[^/]+$",
  8146. // "required": true,
  8147. // "type": "string"
  8148. // }
  8149. // },
  8150. // "path": "v1/{+resource}:testIamPermissions",
  8151. // "request": {
  8152. // "$ref": "TestIamPermissionsRequest"
  8153. // },
  8154. // "response": {
  8155. // "$ref": "TestIamPermissionsResponse"
  8156. // },
  8157. // "scopes": [
  8158. // "https://www.googleapis.com/auth/cloud-platform",
  8159. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  8160. // "https://www.googleapis.com/auth/service.management",
  8161. // "https://www.googleapis.com/auth/service.management.readonly"
  8162. // ]
  8163. // }
  8164. }
  8165. // method id "servicemanagement.services.rollouts.create":
  8166. type ServicesRolloutsCreateCall struct {
  8167. s *APIService
  8168. serviceName string
  8169. rollout *Rollout
  8170. urlParams_ gensupport.URLParams
  8171. ctx_ context.Context
  8172. header_ http.Header
  8173. }
  8174. // Create: Creates a new service configuration rollout. Based on
  8175. // rollout, the
  8176. // Google Service Management will roll out the service configurations
  8177. // to
  8178. // different backend services. For example, the logging configuration
  8179. // will be
  8180. // pushed to Google Cloud Logging.
  8181. //
  8182. // Please note that any previous pending and running Rollouts and
  8183. // associated
  8184. // Operations will be automatically cancelled so that the latest Rollout
  8185. // will
  8186. // not be blocked by previous Rollouts.
  8187. //
  8188. // Only the 100 most recent (in any state) and the last 10 successful
  8189. // (if not
  8190. // already part of the set of 100 most recent) rollouts are kept for
  8191. // each
  8192. // service. The rest will be deleted eventually.
  8193. //
  8194. // Operation<response: Rollout>
  8195. func (r *ServicesRolloutsService) Create(serviceName string, rollout *Rollout) *ServicesRolloutsCreateCall {
  8196. c := &ServicesRolloutsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8197. c.serviceName = serviceName
  8198. c.rollout = rollout
  8199. return c
  8200. }
  8201. // Fields allows partial responses to be retrieved. See
  8202. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8203. // for more information.
  8204. func (c *ServicesRolloutsCreateCall) Fields(s ...googleapi.Field) *ServicesRolloutsCreateCall {
  8205. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8206. return c
  8207. }
  8208. // Context sets the context to be used in this call's Do method. Any
  8209. // pending HTTP request will be aborted if the provided context is
  8210. // canceled.
  8211. func (c *ServicesRolloutsCreateCall) Context(ctx context.Context) *ServicesRolloutsCreateCall {
  8212. c.ctx_ = ctx
  8213. return c
  8214. }
  8215. // Header returns an http.Header that can be modified by the caller to
  8216. // add HTTP headers to the request.
  8217. func (c *ServicesRolloutsCreateCall) Header() http.Header {
  8218. if c.header_ == nil {
  8219. c.header_ = make(http.Header)
  8220. }
  8221. return c.header_
  8222. }
  8223. func (c *ServicesRolloutsCreateCall) doRequest(alt string) (*http.Response, error) {
  8224. reqHeaders := make(http.Header)
  8225. for k, v := range c.header_ {
  8226. reqHeaders[k] = v
  8227. }
  8228. reqHeaders.Set("User-Agent", c.s.userAgent())
  8229. var body io.Reader = nil
  8230. body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollout)
  8231. if err != nil {
  8232. return nil, err
  8233. }
  8234. reqHeaders.Set("Content-Type", "application/json")
  8235. c.urlParams_.Set("alt", alt)
  8236. c.urlParams_.Set("prettyPrint", "false")
  8237. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}/rollouts")
  8238. urls += "?" + c.urlParams_.Encode()
  8239. req, err := http.NewRequest("POST", urls, body)
  8240. if err != nil {
  8241. return nil, err
  8242. }
  8243. req.Header = reqHeaders
  8244. googleapi.Expand(req.URL, map[string]string{
  8245. "serviceName": c.serviceName,
  8246. })
  8247. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8248. }
  8249. // Do executes the "servicemanagement.services.rollouts.create" call.
  8250. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8251. // status code is an error. Response headers are in either
  8252. // *Operation.ServerResponse.Header or (if a response was returned at
  8253. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8254. // to check whether the returned error was because
  8255. // http.StatusNotModified was returned.
  8256. func (c *ServicesRolloutsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8257. gensupport.SetOptions(c.urlParams_, opts...)
  8258. res, err := c.doRequest("json")
  8259. if res != nil && res.StatusCode == http.StatusNotModified {
  8260. if res.Body != nil {
  8261. res.Body.Close()
  8262. }
  8263. return nil, &googleapi.Error{
  8264. Code: res.StatusCode,
  8265. Header: res.Header,
  8266. }
  8267. }
  8268. if err != nil {
  8269. return nil, err
  8270. }
  8271. defer googleapi.CloseBody(res)
  8272. if err := googleapi.CheckResponse(res); err != nil {
  8273. return nil, err
  8274. }
  8275. ret := &Operation{
  8276. ServerResponse: googleapi.ServerResponse{
  8277. Header: res.Header,
  8278. HTTPStatusCode: res.StatusCode,
  8279. },
  8280. }
  8281. target := &ret
  8282. if err := gensupport.DecodeResponse(target, res); err != nil {
  8283. return nil, err
  8284. }
  8285. return ret, nil
  8286. // {
  8287. // "description": "Creates a new service configuration rollout. Based on rollout, the\nGoogle Service Management will roll out the service configurations to\ndifferent backend services. For example, the logging configuration will be\npushed to Google Cloud Logging.\n\nPlease note that any previous pending and running Rollouts and associated\nOperations will be automatically cancelled so that the latest Rollout will\nnot be blocked by previous Rollouts.\n\nOnly the 100 most recent (in any state) and the last 10 successful (if not\nalready part of the set of 100 most recent) rollouts are kept for each\nservice. The rest will be deleted eventually.\n\nOperation\u003cresponse: Rollout\u003e",
  8288. // "flatPath": "v1/services/{serviceName}/rollouts",
  8289. // "httpMethod": "POST",
  8290. // "id": "servicemanagement.services.rollouts.create",
  8291. // "parameterOrder": [
  8292. // "serviceName"
  8293. // ],
  8294. // "parameters": {
  8295. // "serviceName": {
  8296. // "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`.",
  8297. // "location": "path",
  8298. // "required": true,
  8299. // "type": "string"
  8300. // }
  8301. // },
  8302. // "path": "v1/services/{serviceName}/rollouts",
  8303. // "request": {
  8304. // "$ref": "Rollout"
  8305. // },
  8306. // "response": {
  8307. // "$ref": "Operation"
  8308. // },
  8309. // "scopes": [
  8310. // "https://www.googleapis.com/auth/cloud-platform",
  8311. // "https://www.googleapis.com/auth/service.management"
  8312. // ]
  8313. // }
  8314. }
  8315. // method id "servicemanagement.services.rollouts.get":
  8316. type ServicesRolloutsGetCall struct {
  8317. s *APIService
  8318. serviceName string
  8319. rolloutId string
  8320. urlParams_ gensupport.URLParams
  8321. ifNoneMatch_ string
  8322. ctx_ context.Context
  8323. header_ http.Header
  8324. }
  8325. // Get: Gets a service configuration rollout.
  8326. func (r *ServicesRolloutsService) Get(serviceName string, rolloutId string) *ServicesRolloutsGetCall {
  8327. c := &ServicesRolloutsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8328. c.serviceName = serviceName
  8329. c.rolloutId = rolloutId
  8330. return c
  8331. }
  8332. // Fields allows partial responses to be retrieved. See
  8333. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8334. // for more information.
  8335. func (c *ServicesRolloutsGetCall) Fields(s ...googleapi.Field) *ServicesRolloutsGetCall {
  8336. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8337. return c
  8338. }
  8339. // IfNoneMatch sets the optional parameter which makes the operation
  8340. // fail if the object's ETag matches the given value. This is useful for
  8341. // getting updates only after the object has changed since the last
  8342. // request. Use googleapi.IsNotModified to check whether the response
  8343. // error from Do is the result of In-None-Match.
  8344. func (c *ServicesRolloutsGetCall) IfNoneMatch(entityTag string) *ServicesRolloutsGetCall {
  8345. c.ifNoneMatch_ = entityTag
  8346. return c
  8347. }
  8348. // Context sets the context to be used in this call's Do method. Any
  8349. // pending HTTP request will be aborted if the provided context is
  8350. // canceled.
  8351. func (c *ServicesRolloutsGetCall) Context(ctx context.Context) *ServicesRolloutsGetCall {
  8352. c.ctx_ = ctx
  8353. return c
  8354. }
  8355. // Header returns an http.Header that can be modified by the caller to
  8356. // add HTTP headers to the request.
  8357. func (c *ServicesRolloutsGetCall) Header() http.Header {
  8358. if c.header_ == nil {
  8359. c.header_ = make(http.Header)
  8360. }
  8361. return c.header_
  8362. }
  8363. func (c *ServicesRolloutsGetCall) doRequest(alt string) (*http.Response, error) {
  8364. reqHeaders := make(http.Header)
  8365. for k, v := range c.header_ {
  8366. reqHeaders[k] = v
  8367. }
  8368. reqHeaders.Set("User-Agent", c.s.userAgent())
  8369. if c.ifNoneMatch_ != "" {
  8370. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8371. }
  8372. var body io.Reader = nil
  8373. c.urlParams_.Set("alt", alt)
  8374. c.urlParams_.Set("prettyPrint", "false")
  8375. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}/rollouts/{rolloutId}")
  8376. urls += "?" + c.urlParams_.Encode()
  8377. req, err := http.NewRequest("GET", urls, body)
  8378. if err != nil {
  8379. return nil, err
  8380. }
  8381. req.Header = reqHeaders
  8382. googleapi.Expand(req.URL, map[string]string{
  8383. "serviceName": c.serviceName,
  8384. "rolloutId": c.rolloutId,
  8385. })
  8386. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8387. }
  8388. // Do executes the "servicemanagement.services.rollouts.get" call.
  8389. // Exactly one of *Rollout or error will be non-nil. Any non-2xx status
  8390. // code is an error. Response headers are in either
  8391. // *Rollout.ServerResponse.Header or (if a response was returned at all)
  8392. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8393. // check whether the returned error was because http.StatusNotModified
  8394. // was returned.
  8395. func (c *ServicesRolloutsGetCall) Do(opts ...googleapi.CallOption) (*Rollout, error) {
  8396. gensupport.SetOptions(c.urlParams_, opts...)
  8397. res, err := c.doRequest("json")
  8398. if res != nil && res.StatusCode == http.StatusNotModified {
  8399. if res.Body != nil {
  8400. res.Body.Close()
  8401. }
  8402. return nil, &googleapi.Error{
  8403. Code: res.StatusCode,
  8404. Header: res.Header,
  8405. }
  8406. }
  8407. if err != nil {
  8408. return nil, err
  8409. }
  8410. defer googleapi.CloseBody(res)
  8411. if err := googleapi.CheckResponse(res); err != nil {
  8412. return nil, err
  8413. }
  8414. ret := &Rollout{
  8415. ServerResponse: googleapi.ServerResponse{
  8416. Header: res.Header,
  8417. HTTPStatusCode: res.StatusCode,
  8418. },
  8419. }
  8420. target := &ret
  8421. if err := gensupport.DecodeResponse(target, res); err != nil {
  8422. return nil, err
  8423. }
  8424. return ret, nil
  8425. // {
  8426. // "description": "Gets a service configuration rollout.",
  8427. // "flatPath": "v1/services/{serviceName}/rollouts/{rolloutId}",
  8428. // "httpMethod": "GET",
  8429. // "id": "servicemanagement.services.rollouts.get",
  8430. // "parameterOrder": [
  8431. // "serviceName",
  8432. // "rolloutId"
  8433. // ],
  8434. // "parameters": {
  8435. // "rolloutId": {
  8436. // "description": "The id of the rollout resource.",
  8437. // "location": "path",
  8438. // "required": true,
  8439. // "type": "string"
  8440. // },
  8441. // "serviceName": {
  8442. // "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`.",
  8443. // "location": "path",
  8444. // "required": true,
  8445. // "type": "string"
  8446. // }
  8447. // },
  8448. // "path": "v1/services/{serviceName}/rollouts/{rolloutId}",
  8449. // "response": {
  8450. // "$ref": "Rollout"
  8451. // },
  8452. // "scopes": [
  8453. // "https://www.googleapis.com/auth/cloud-platform",
  8454. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  8455. // "https://www.googleapis.com/auth/service.management",
  8456. // "https://www.googleapis.com/auth/service.management.readonly"
  8457. // ]
  8458. // }
  8459. }
  8460. // method id "servicemanagement.services.rollouts.list":
  8461. type ServicesRolloutsListCall struct {
  8462. s *APIService
  8463. serviceName string
  8464. urlParams_ gensupport.URLParams
  8465. ifNoneMatch_ string
  8466. ctx_ context.Context
  8467. header_ http.Header
  8468. }
  8469. // List: Lists the history of the service configuration rollouts for a
  8470. // managed
  8471. // service, from the newest to the oldest.
  8472. func (r *ServicesRolloutsService) List(serviceName string) *ServicesRolloutsListCall {
  8473. c := &ServicesRolloutsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8474. c.serviceName = serviceName
  8475. return c
  8476. }
  8477. // Filter sets the optional parameter "filter": Use `filter` to return
  8478. // subset of rollouts.
  8479. // The following filters are supported:
  8480. // -- To limit the results to only those in
  8481. // [status](google.api.servicemanagement.v1.RolloutStatus)
  8482. // 'SUCCESS',
  8483. // use filter='status=SUCCESS'
  8484. // -- To limit the results to those in
  8485. // [status](google.api.servicemanagement.v1.RolloutStatus)
  8486. // 'CANCELLED'
  8487. // or 'FAILED', use filter='status=CANCELLED OR status=FAILED'
  8488. func (c *ServicesRolloutsListCall) Filter(filter string) *ServicesRolloutsListCall {
  8489. c.urlParams_.Set("filter", filter)
  8490. return c
  8491. }
  8492. // PageSize sets the optional parameter "pageSize": The max number of
  8493. // items to include in the response list. Page size is 50
  8494. // if not specified. Maximum value is 100.
  8495. func (c *ServicesRolloutsListCall) PageSize(pageSize int64) *ServicesRolloutsListCall {
  8496. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  8497. return c
  8498. }
  8499. // PageToken sets the optional parameter "pageToken": The token of the
  8500. // page to retrieve.
  8501. func (c *ServicesRolloutsListCall) PageToken(pageToken string) *ServicesRolloutsListCall {
  8502. c.urlParams_.Set("pageToken", pageToken)
  8503. return c
  8504. }
  8505. // Fields allows partial responses to be retrieved. See
  8506. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8507. // for more information.
  8508. func (c *ServicesRolloutsListCall) Fields(s ...googleapi.Field) *ServicesRolloutsListCall {
  8509. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8510. return c
  8511. }
  8512. // IfNoneMatch sets the optional parameter which makes the operation
  8513. // fail if the object's ETag matches the given value. This is useful for
  8514. // getting updates only after the object has changed since the last
  8515. // request. Use googleapi.IsNotModified to check whether the response
  8516. // error from Do is the result of In-None-Match.
  8517. func (c *ServicesRolloutsListCall) IfNoneMatch(entityTag string) *ServicesRolloutsListCall {
  8518. c.ifNoneMatch_ = entityTag
  8519. return c
  8520. }
  8521. // Context sets the context to be used in this call's Do method. Any
  8522. // pending HTTP request will be aborted if the provided context is
  8523. // canceled.
  8524. func (c *ServicesRolloutsListCall) Context(ctx context.Context) *ServicesRolloutsListCall {
  8525. c.ctx_ = ctx
  8526. return c
  8527. }
  8528. // Header returns an http.Header that can be modified by the caller to
  8529. // add HTTP headers to the request.
  8530. func (c *ServicesRolloutsListCall) Header() http.Header {
  8531. if c.header_ == nil {
  8532. c.header_ = make(http.Header)
  8533. }
  8534. return c.header_
  8535. }
  8536. func (c *ServicesRolloutsListCall) doRequest(alt string) (*http.Response, error) {
  8537. reqHeaders := make(http.Header)
  8538. for k, v := range c.header_ {
  8539. reqHeaders[k] = v
  8540. }
  8541. reqHeaders.Set("User-Agent", c.s.userAgent())
  8542. if c.ifNoneMatch_ != "" {
  8543. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8544. }
  8545. var body io.Reader = nil
  8546. c.urlParams_.Set("alt", alt)
  8547. c.urlParams_.Set("prettyPrint", "false")
  8548. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}/rollouts")
  8549. urls += "?" + c.urlParams_.Encode()
  8550. req, err := http.NewRequest("GET", urls, body)
  8551. if err != nil {
  8552. return nil, err
  8553. }
  8554. req.Header = reqHeaders
  8555. googleapi.Expand(req.URL, map[string]string{
  8556. "serviceName": c.serviceName,
  8557. })
  8558. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8559. }
  8560. // Do executes the "servicemanagement.services.rollouts.list" call.
  8561. // Exactly one of *ListServiceRolloutsResponse or error will be non-nil.
  8562. // Any non-2xx status code is an error. Response headers are in either
  8563. // *ListServiceRolloutsResponse.ServerResponse.Header or (if a response
  8564. // was returned at all) in error.(*googleapi.Error).Header. Use
  8565. // googleapi.IsNotModified to check whether the returned error was
  8566. // because http.StatusNotModified was returned.
  8567. func (c *ServicesRolloutsListCall) Do(opts ...googleapi.CallOption) (*ListServiceRolloutsResponse, error) {
  8568. gensupport.SetOptions(c.urlParams_, opts...)
  8569. res, err := c.doRequest("json")
  8570. if res != nil && res.StatusCode == http.StatusNotModified {
  8571. if res.Body != nil {
  8572. res.Body.Close()
  8573. }
  8574. return nil, &googleapi.Error{
  8575. Code: res.StatusCode,
  8576. Header: res.Header,
  8577. }
  8578. }
  8579. if err != nil {
  8580. return nil, err
  8581. }
  8582. defer googleapi.CloseBody(res)
  8583. if err := googleapi.CheckResponse(res); err != nil {
  8584. return nil, err
  8585. }
  8586. ret := &ListServiceRolloutsResponse{
  8587. ServerResponse: googleapi.ServerResponse{
  8588. Header: res.Header,
  8589. HTTPStatusCode: res.StatusCode,
  8590. },
  8591. }
  8592. target := &ret
  8593. if err := gensupport.DecodeResponse(target, res); err != nil {
  8594. return nil, err
  8595. }
  8596. return ret, nil
  8597. // {
  8598. // "description": "Lists the history of the service configuration rollouts for a managed\nservice, from the newest to the oldest.",
  8599. // "flatPath": "v1/services/{serviceName}/rollouts",
  8600. // "httpMethod": "GET",
  8601. // "id": "servicemanagement.services.rollouts.list",
  8602. // "parameterOrder": [
  8603. // "serviceName"
  8604. // ],
  8605. // "parameters": {
  8606. // "filter": {
  8607. // "description": "Use `filter` to return subset of rollouts.\nThe following filters are supported:\n -- To limit the results to only those in\n [status](google.api.servicemanagement.v1.RolloutStatus) 'SUCCESS',\n use filter='status=SUCCESS'\n -- To limit the results to those in\n [status](google.api.servicemanagement.v1.RolloutStatus) 'CANCELLED'\n or 'FAILED', use filter='status=CANCELLED OR status=FAILED'",
  8608. // "location": "query",
  8609. // "type": "string"
  8610. // },
  8611. // "pageSize": {
  8612. // "description": "The max number of items to include in the response list. Page size is 50\nif not specified. Maximum value is 100.",
  8613. // "format": "int32",
  8614. // "location": "query",
  8615. // "type": "integer"
  8616. // },
  8617. // "pageToken": {
  8618. // "description": "The token of the page to retrieve.",
  8619. // "location": "query",
  8620. // "type": "string"
  8621. // },
  8622. // "serviceName": {
  8623. // "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`.",
  8624. // "location": "path",
  8625. // "required": true,
  8626. // "type": "string"
  8627. // }
  8628. // },
  8629. // "path": "v1/services/{serviceName}/rollouts",
  8630. // "response": {
  8631. // "$ref": "ListServiceRolloutsResponse"
  8632. // },
  8633. // "scopes": [
  8634. // "https://www.googleapis.com/auth/cloud-platform",
  8635. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  8636. // "https://www.googleapis.com/auth/service.management",
  8637. // "https://www.googleapis.com/auth/service.management.readonly"
  8638. // ]
  8639. // }
  8640. }
  8641. // Pages invokes f for each page of results.
  8642. // A non-nil error returned from f will halt the iteration.
  8643. // The provided context supersedes any context provided to the Context method.
  8644. func (c *ServicesRolloutsListCall) Pages(ctx context.Context, f func(*ListServiceRolloutsResponse) error) error {
  8645. c.ctx_ = ctx
  8646. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8647. for {
  8648. x, err := c.Do()
  8649. if err != nil {
  8650. return err
  8651. }
  8652. if err := f(x); err != nil {
  8653. return err
  8654. }
  8655. if x.NextPageToken == "" {
  8656. return nil
  8657. }
  8658. c.PageToken(x.NextPageToken)
  8659. }
  8660. }