25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

9158 lines
327 KiB

  1. // Package servicemanagement provides access to the Service Management API.
  2. //
  3. // See https://cloud.google.com/service-management/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/servicemanagement/v1"
  8. // ...
  9. // servicemanagementService, err := servicemanagement.New(oauthHttpClient)
  10. package servicemanagement // import "google.golang.org/api/servicemanagement/v1"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "servicemanagement:v1"
  41. const apiName = "servicemanagement"
  42. const apiVersion = "v1"
  43. const basePath = "https://servicemanagement.googleapis.com/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // View and manage your data across Google Cloud Platform services
  47. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  48. // View your data across Google Cloud Platform services
  49. CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only"
  50. // Manage your Google API service configuration
  51. ServiceManagementScope = "https://www.googleapis.com/auth/service.management"
  52. // View your Google API service configuration
  53. ServiceManagementReadonlyScope = "https://www.googleapis.com/auth/service.management.readonly"
  54. )
  55. func New(client *http.Client) (*APIService, error) {
  56. if client == nil {
  57. return nil, errors.New("client is nil")
  58. }
  59. s := &APIService{client: client, BasePath: basePath}
  60. s.Operations = NewOperationsService(s)
  61. s.Services = NewServicesService(s)
  62. return s, nil
  63. }
  64. type APIService struct {
  65. client *http.Client
  66. BasePath string // API endpoint base URL
  67. UserAgent string // optional additional User-Agent fragment
  68. Operations *OperationsService
  69. Services *ServicesService
  70. }
  71. func (s *APIService) userAgent() string {
  72. if s.UserAgent == "" {
  73. return googleapi.UserAgent
  74. }
  75. return googleapi.UserAgent + " " + s.UserAgent
  76. }
  77. func NewOperationsService(s *APIService) *OperationsService {
  78. rs := &OperationsService{s: s}
  79. return rs
  80. }
  81. type OperationsService struct {
  82. s *APIService
  83. }
  84. func NewServicesService(s *APIService) *ServicesService {
  85. rs := &ServicesService{s: s}
  86. rs.Configs = NewServicesConfigsService(s)
  87. rs.Consumers = NewServicesConsumersService(s)
  88. rs.Rollouts = NewServicesRolloutsService(s)
  89. return rs
  90. }
  91. type ServicesService struct {
  92. s *APIService
  93. Configs *ServicesConfigsService
  94. Consumers *ServicesConsumersService
  95. Rollouts *ServicesRolloutsService
  96. }
  97. func NewServicesConfigsService(s *APIService) *ServicesConfigsService {
  98. rs := &ServicesConfigsService{s: s}
  99. return rs
  100. }
  101. type ServicesConfigsService struct {
  102. s *APIService
  103. }
  104. func NewServicesConsumersService(s *APIService) *ServicesConsumersService {
  105. rs := &ServicesConsumersService{s: s}
  106. return rs
  107. }
  108. type ServicesConsumersService struct {
  109. s *APIService
  110. }
  111. func NewServicesRolloutsService(s *APIService) *ServicesRolloutsService {
  112. rs := &ServicesRolloutsService{s: s}
  113. return rs
  114. }
  115. type ServicesRolloutsService struct {
  116. s *APIService
  117. }
  118. // Advice: Generated advice about this change, used for providing
  119. // more
  120. // information about how a change will affect the existing service.
  121. type Advice struct {
  122. // Description: Useful description for why this advice was applied and
  123. // what actions should
  124. // be taken to mitigate any implied risks.
  125. Description string `json:"description,omitempty"`
  126. // ForceSendFields is a list of field names (e.g. "Description") to
  127. // unconditionally include in API requests. By default, fields with
  128. // empty values are omitted from API requests. However, any non-pointer,
  129. // non-interface field appearing in ForceSendFields will be sent to the
  130. // server regardless of whether the field is empty or not. This may be
  131. // used to include empty fields in Patch requests.
  132. ForceSendFields []string `json:"-"`
  133. // NullFields is a list of field names (e.g. "Description") to include
  134. // in API requests with the JSON null value. By default, fields with
  135. // empty values are omitted from API requests. However, any field with
  136. // an empty value appearing in NullFields will be sent to the server as
  137. // null. It is an error if a field in this list has a non-empty value.
  138. // This may be used to include null fields in Patch requests.
  139. NullFields []string `json:"-"`
  140. }
  141. func (s *Advice) MarshalJSON() ([]byte, error) {
  142. type NoMethod Advice
  143. raw := NoMethod(*s)
  144. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  145. }
  146. // Api: Api is a light-weight descriptor for an API
  147. // Interface.
  148. //
  149. // Interfaces are also described as "protocol buffer services" in some
  150. // contexts,
  151. // such as by the "service" keyword in a .proto file, but they are
  152. // different
  153. // from API Services, which represent a concrete implementation of an
  154. // interface
  155. // as opposed to simply a description of methods and bindings. They are
  156. // also
  157. // sometimes simply referred to as "APIs" in other contexts, such as the
  158. // name of
  159. // this message itself. See
  160. // https://cloud.google.com/apis/design/glossary for
  161. // detailed terminology.
  162. type Api struct {
  163. // Methods: The methods of this interface, in unspecified order.
  164. Methods []*Method `json:"methods,omitempty"`
  165. // Mixins: Included interfaces. See Mixin.
  166. Mixins []*Mixin `json:"mixins,omitempty"`
  167. // Name: The fully qualified name of this interface, including package
  168. // name
  169. // followed by the interface's simple name.
  170. Name string `json:"name,omitempty"`
  171. // Options: Any metadata attached to the interface.
  172. Options []*Option `json:"options,omitempty"`
  173. // SourceContext: Source context for the protocol buffer service
  174. // represented by this
  175. // message.
  176. SourceContext *SourceContext `json:"sourceContext,omitempty"`
  177. // Syntax: The source syntax of the service.
  178. //
  179. // Possible values:
  180. // "SYNTAX_PROTO2" - Syntax `proto2`.
  181. // "SYNTAX_PROTO3" - Syntax `proto3`.
  182. Syntax string `json:"syntax,omitempty"`
  183. // Version: A version string for this interface. If specified, must have
  184. // the form
  185. // `major-version.minor-version`, as in `1.10`. If the minor version
  186. // is
  187. // omitted, it defaults to zero. If the entire version field is empty,
  188. // the
  189. // major version is derived from the package name, as outlined below. If
  190. // the
  191. // field is not empty, the version in the package name will be verified
  192. // to be
  193. // consistent with what is provided here.
  194. //
  195. // The versioning schema uses [semantic
  196. // versioning](http://semver.org) where the major version
  197. // number
  198. // indicates a breaking change and the minor version an
  199. // additive,
  200. // non-breaking change. Both version numbers are signals to users
  201. // what to expect from different versions, and should be
  202. // carefully
  203. // chosen based on the product plan.
  204. //
  205. // The major version is also reflected in the package name of
  206. // the
  207. // interface, which must end in `v<major-version>`, as
  208. // in
  209. // `google.feature.v1`. For major versions 0 and 1, the suffix can
  210. // be omitted. Zero major versions must only be used for
  211. // experimental, non-GA interfaces.
  212. //
  213. Version string `json:"version,omitempty"`
  214. // ForceSendFields is a list of field names (e.g. "Methods") to
  215. // unconditionally include in API requests. By default, fields with
  216. // empty values are omitted from API requests. However, any non-pointer,
  217. // non-interface field appearing in ForceSendFields will be sent to the
  218. // server regardless of whether the field is empty or not. This may be
  219. // used to include empty fields in Patch requests.
  220. ForceSendFields []string `json:"-"`
  221. // NullFields is a list of field names (e.g. "Methods") to include in
  222. // API requests with the JSON null value. By default, fields with empty
  223. // values are omitted from API requests. However, any field with an
  224. // empty value appearing in NullFields will be sent to the server as
  225. // null. It is an error if a field in this list has a non-empty value.
  226. // This may be used to include null fields in Patch requests.
  227. NullFields []string `json:"-"`
  228. }
  229. func (s *Api) MarshalJSON() ([]byte, error) {
  230. type NoMethod Api
  231. raw := NoMethod(*s)
  232. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  233. }
  234. // AuditConfig: Specifies the audit configuration for a service.
  235. // The configuration determines which permission types are logged, and
  236. // what
  237. // identities, if any, are exempted from logging.
  238. // An AuditConfig must have one or more AuditLogConfigs.
  239. //
  240. // If there are AuditConfigs for both `allServices` and a specific
  241. // service,
  242. // the union of the two AuditConfigs is used for that service: the
  243. // log_types
  244. // specified in each AuditConfig are enabled, and the exempted_members
  245. // in each
  246. // AuditLogConfig are exempted.
  247. //
  248. // Example Policy with multiple AuditConfigs:
  249. //
  250. // {
  251. // "audit_configs": [
  252. // {
  253. // "service": "allServices"
  254. // "audit_log_configs": [
  255. // {
  256. // "log_type": "DATA_READ",
  257. // "exempted_members": [
  258. // "user:foo@gmail.com"
  259. // ]
  260. // },
  261. // {
  262. // "log_type": "DATA_WRITE",
  263. // },
  264. // {
  265. // "log_type": "ADMIN_READ",
  266. // }
  267. // ]
  268. // },
  269. // {
  270. // "service": "fooservice.googleapis.com"
  271. // "audit_log_configs": [
  272. // {
  273. // "log_type": "DATA_READ",
  274. // },
  275. // {
  276. // "log_type": "DATA_WRITE",
  277. // "exempted_members": [
  278. // "user:bar@gmail.com"
  279. // ]
  280. // }
  281. // ]
  282. // }
  283. // ]
  284. // }
  285. //
  286. // For fooservice, this policy enables DATA_READ, DATA_WRITE and
  287. // ADMIN_READ
  288. // logging. It also exempts foo@gmail.com from DATA_READ logging,
  289. // and
  290. // bar@gmail.com from DATA_WRITE logging.
  291. type AuditConfig struct {
  292. // AuditLogConfigs: The configuration for logging of each type of
  293. // permission.
  294. AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
  295. // Service: Specifies a service that will be enabled for audit
  296. // logging.
  297. // For example, `storage.googleapis.com`,
  298. // `cloudsql.googleapis.com`.
  299. // `allServices` is a special value that covers all services.
  300. Service string `json:"service,omitempty"`
  301. // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to
  302. // unconditionally include in API requests. By default, fields with
  303. // empty values are omitted from API requests. However, any non-pointer,
  304. // non-interface field appearing in ForceSendFields will be sent to the
  305. // server regardless of whether the field is empty or not. This may be
  306. // used to include empty fields in Patch requests.
  307. ForceSendFields []string `json:"-"`
  308. // NullFields is a list of field names (e.g. "AuditLogConfigs") to
  309. // include in API requests with the JSON null value. By default, fields
  310. // with empty values are omitted from API requests. However, any field
  311. // with an empty value appearing in NullFields will be sent to the
  312. // server as null. It is an error if a field in this list has a
  313. // non-empty value. This may be used to include null fields in Patch
  314. // requests.
  315. NullFields []string `json:"-"`
  316. }
  317. func (s *AuditConfig) MarshalJSON() ([]byte, error) {
  318. type NoMethod AuditConfig
  319. raw := NoMethod(*s)
  320. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  321. }
  322. // AuditLogConfig: Provides the configuration for logging a type of
  323. // permissions.
  324. // Example:
  325. //
  326. // {
  327. // "audit_log_configs": [
  328. // {
  329. // "log_type": "DATA_READ",
  330. // "exempted_members": [
  331. // "user:foo@gmail.com"
  332. // ]
  333. // },
  334. // {
  335. // "log_type": "DATA_WRITE",
  336. // }
  337. // ]
  338. // }
  339. //
  340. // This enables 'DATA_READ' and 'DATA_WRITE' logging, while
  341. // exempting
  342. // foo@gmail.com from DATA_READ logging.
  343. type AuditLogConfig struct {
  344. // ExemptedMembers: Specifies the identities that do not cause logging
  345. // for this type of
  346. // permission.
  347. // Follows the same format of Binding.members.
  348. ExemptedMembers []string `json:"exemptedMembers,omitempty"`
  349. // LogType: The log type that this config enables.
  350. //
  351. // Possible values:
  352. // "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this.
  353. // "ADMIN_READ" - Admin reads. Example: CloudIAM getIamPolicy
  354. // "DATA_WRITE" - Data writes. Example: CloudSQL Users create
  355. // "DATA_READ" - Data reads. Example: CloudSQL Users list
  356. LogType string `json:"logType,omitempty"`
  357. // ForceSendFields is a list of field names (e.g. "ExemptedMembers") to
  358. // unconditionally include in API requests. By default, fields with
  359. // empty values are omitted from API requests. However, any non-pointer,
  360. // non-interface field appearing in ForceSendFields will be sent to the
  361. // server regardless of whether the field is empty or not. This may be
  362. // used to include empty fields in Patch requests.
  363. ForceSendFields []string `json:"-"`
  364. // NullFields is a list of field names (e.g. "ExemptedMembers") to
  365. // include in API requests with the JSON null value. By default, fields
  366. // with empty values are omitted from API requests. However, any field
  367. // with an empty value appearing in NullFields will be sent to the
  368. // server as null. It is an error if a field in this list has a
  369. // non-empty value. This may be used to include null fields in Patch
  370. // requests.
  371. NullFields []string `json:"-"`
  372. }
  373. func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
  374. type NoMethod AuditLogConfig
  375. raw := NoMethod(*s)
  376. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  377. }
  378. // AuthProvider: Configuration for an anthentication provider, including
  379. // support for
  380. // [JSON Web Token
  381. // (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32)
  382. // .
  383. type AuthProvider struct {
  384. // Audiences: The list of
  385. // JWT
  386. // [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-
  387. // token-32#section-4.1.3).
  388. // that are allowed to access. A JWT containing any of these audiences
  389. // will
  390. // be accepted. When this setting is absent, only JWTs with
  391. // audience
  392. // "https://Service_name/API_name"
  393. // will be accepted. For example, if no audiences are in the
  394. // setting,
  395. // LibraryService API will only accept JWTs with the following
  396. // audience
  397. // "https://library-example.googleapis.com/google.example.librar
  398. // y.v1.LibraryService".
  399. //
  400. // Example:
  401. //
  402. // audiences: bookstore_android.apps.googleusercontent.com,
  403. // bookstore_web.apps.googleusercontent.com
  404. Audiences string `json:"audiences,omitempty"`
  405. // AuthorizationUrl: Redirect URL if JWT token is required but no
  406. // present or is expired.
  407. // Implement authorizationUrl of securityDefinitions in OpenAPI spec.
  408. AuthorizationUrl string `json:"authorizationUrl,omitempty"`
  409. // Id: The unique identifier of the auth provider. It will be referred
  410. // to by
  411. // `AuthRequirement.provider_id`.
  412. //
  413. // Example: "bookstore_auth".
  414. Id string `json:"id,omitempty"`
  415. // Issuer: Identifies the principal that issued the JWT.
  416. // See
  417. // https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#sec
  418. // tion-4.1.1
  419. // Usually a URL or an email address.
  420. //
  421. // Example: https://securetoken.google.com
  422. // Example: 1234567-compute@developer.gserviceaccount.com
  423. Issuer string `json:"issuer,omitempty"`
  424. // JwksUri: URL of the provider's public key set to validate signature
  425. // of the JWT. See
  426. // [OpenID
  427. // Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#
  428. // ProviderMetadata).
  429. // Optional if the key set document:
  430. // - can be retrieved from
  431. // [OpenID
  432. // Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html
  433. //
  434. // of the issuer.
  435. // - can be inferred from the email domain of the issuer (e.g. a Google
  436. // service account).
  437. //
  438. // Example: https://www.googleapis.com/oauth2/v1/certs
  439. JwksUri string `json:"jwksUri,omitempty"`
  440. // ForceSendFields is a list of field names (e.g. "Audiences") to
  441. // unconditionally include in API requests. By default, fields with
  442. // empty values are omitted from API requests. However, any non-pointer,
  443. // non-interface field appearing in ForceSendFields will be sent to the
  444. // server regardless of whether the field is empty or not. This may be
  445. // used to include empty fields in Patch requests.
  446. ForceSendFields []string `json:"-"`
  447. // NullFields is a list of field names (e.g. "Audiences") to include in
  448. // API requests with the JSON null value. By default, fields with empty
  449. // values are omitted from API requests. However, any field with an
  450. // empty value appearing in NullFields will be sent to the server as
  451. // null. It is an error if a field in this list has a non-empty value.
  452. // This may be used to include null fields in Patch requests.
  453. NullFields []string `json:"-"`
  454. }
  455. func (s *AuthProvider) MarshalJSON() ([]byte, error) {
  456. type NoMethod AuthProvider
  457. raw := NoMethod(*s)
  458. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  459. }
  460. // AuthRequirement: User-defined authentication requirements, including
  461. // support for
  462. // [JSON Web Token
  463. // (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32)
  464. // .
  465. type AuthRequirement struct {
  466. // Audiences: NOTE: This will be deprecated soon, once
  467. // AuthProvider.audiences is
  468. // implemented and accepted in all the runtime components.
  469. //
  470. // The list of
  471. // JWT
  472. // [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-
  473. // token-32#section-4.1.3).
  474. // that are allowed to access. A JWT containing any of these audiences
  475. // will
  476. // be accepted. When this setting is absent, only JWTs with
  477. // audience
  478. // "https://Service_name/API_name"
  479. // will be accepted. For example, if no audiences are in the
  480. // setting,
  481. // LibraryService API will only accept JWTs with the following
  482. // audience
  483. // "https://library-example.googleapis.com/google.example.librar
  484. // y.v1.LibraryService".
  485. //
  486. // Example:
  487. //
  488. // audiences: bookstore_android.apps.googleusercontent.com,
  489. // bookstore_web.apps.googleusercontent.com
  490. Audiences string `json:"audiences,omitempty"`
  491. // ProviderId: id from authentication provider.
  492. //
  493. // Example:
  494. //
  495. // provider_id: bookstore_auth
  496. ProviderId string `json:"providerId,omitempty"`
  497. // ForceSendFields is a list of field names (e.g. "Audiences") to
  498. // unconditionally include in API requests. By default, fields with
  499. // empty values are omitted from API requests. However, any non-pointer,
  500. // non-interface field appearing in ForceSendFields will be sent to the
  501. // server regardless of whether the field is empty or not. This may be
  502. // used to include empty fields in Patch requests.
  503. ForceSendFields []string `json:"-"`
  504. // NullFields is a list of field names (e.g. "Audiences") to include in
  505. // API requests with the JSON null value. By default, fields with empty
  506. // values are omitted from API requests. However, any field with an
  507. // empty value appearing in NullFields will be sent to the server as
  508. // null. It is an error if a field in this list has a non-empty value.
  509. // This may be used to include null fields in Patch requests.
  510. NullFields []string `json:"-"`
  511. }
  512. func (s *AuthRequirement) MarshalJSON() ([]byte, error) {
  513. type NoMethod AuthRequirement
  514. raw := NoMethod(*s)
  515. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  516. }
  517. // Authentication: `Authentication` defines the authentication
  518. // configuration for an API.
  519. //
  520. // Example for an API targeted for external use:
  521. //
  522. // name: calendar.googleapis.com
  523. // authentication:
  524. // providers:
  525. // - id: google_calendar_auth
  526. // jwks_uri: https://www.googleapis.com/oauth2/v1/certs
  527. // issuer: https://securetoken.google.com
  528. // rules:
  529. // - selector: "*"
  530. // requirements:
  531. // provider_id: google_calendar_auth
  532. type Authentication struct {
  533. // Providers: Defines a set of authentication providers that a service
  534. // supports.
  535. Providers []*AuthProvider `json:"providers,omitempty"`
  536. // Rules: A list of authentication rules that apply to individual API
  537. // methods.
  538. //
  539. // **NOTE:** All service configuration rules follow "last one wins"
  540. // order.
  541. Rules []*AuthenticationRule `json:"rules,omitempty"`
  542. // ForceSendFields is a list of field names (e.g. "Providers") to
  543. // unconditionally include in API requests. By default, fields with
  544. // empty values are omitted from API requests. However, any non-pointer,
  545. // non-interface field appearing in ForceSendFields will be sent to the
  546. // server regardless of whether the field is empty or not. This may be
  547. // used to include empty fields in Patch requests.
  548. ForceSendFields []string `json:"-"`
  549. // NullFields is a list of field names (e.g. "Providers") to include in
  550. // API requests with the JSON null value. By default, fields with empty
  551. // values are omitted from API requests. However, any field with an
  552. // empty value appearing in NullFields will be sent to the server as
  553. // null. It is an error if a field in this list has a non-empty value.
  554. // This may be used to include null fields in Patch requests.
  555. NullFields []string `json:"-"`
  556. }
  557. func (s *Authentication) MarshalJSON() ([]byte, error) {
  558. type NoMethod Authentication
  559. raw := NoMethod(*s)
  560. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  561. }
  562. // AuthenticationRule: Authentication rules for the service.
  563. //
  564. // By default, if a method has any authentication requirements, every
  565. // request
  566. // must include a valid credential matching one of the
  567. // requirements.
  568. // It's an error to include more than one kind of credential in a
  569. // single
  570. // request.
  571. //
  572. // If a method doesn't have any auth requirements, request credentials
  573. // will be
  574. // ignored.
  575. type AuthenticationRule struct {
  576. // AllowWithoutCredential: If true, the service accepts API keys without
  577. // any other credential.
  578. AllowWithoutCredential bool `json:"allowWithoutCredential,omitempty"`
  579. // Oauth: The requirements for OAuth credentials.
  580. Oauth *OAuthRequirements `json:"oauth,omitempty"`
  581. // Requirements: Requirements for additional authentication providers.
  582. Requirements []*AuthRequirement `json:"requirements,omitempty"`
  583. // Selector: Selects the methods to which this rule applies.
  584. //
  585. // Refer to selector for syntax details.
  586. Selector string `json:"selector,omitempty"`
  587. // ForceSendFields is a list of field names (e.g.
  588. // "AllowWithoutCredential") to unconditionally include in API requests.
  589. // By default, fields with empty values are omitted from API requests.
  590. // However, any non-pointer, non-interface field appearing in
  591. // ForceSendFields will be sent to the server regardless of whether the
  592. // field is empty or not. This may be used to include empty fields in
  593. // Patch requests.
  594. ForceSendFields []string `json:"-"`
  595. // NullFields is a list of field names (e.g. "AllowWithoutCredential")
  596. // to include in API requests with the JSON null value. By default,
  597. // fields with empty values are omitted from API requests. However, any
  598. // field with an empty value appearing in NullFields will be sent to the
  599. // server as null. It is an error if a field in this list has a
  600. // non-empty value. This may be used to include null fields in Patch
  601. // requests.
  602. NullFields []string `json:"-"`
  603. }
  604. func (s *AuthenticationRule) MarshalJSON() ([]byte, error) {
  605. type NoMethod AuthenticationRule
  606. raw := NoMethod(*s)
  607. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  608. }
  609. // AuthorizationConfig: Configuration of authorization.
  610. //
  611. // This section determines the authorization provider, if unspecified,
  612. // then no
  613. // authorization check will be done.
  614. //
  615. // Example:
  616. //
  617. // experimental:
  618. // authorization:
  619. // provider: firebaserules.googleapis.com
  620. type AuthorizationConfig struct {
  621. // Provider: The name of the authorization provider, such
  622. // as
  623. // firebaserules.googleapis.com.
  624. Provider string `json:"provider,omitempty"`
  625. // ForceSendFields is a list of field names (e.g. "Provider") to
  626. // unconditionally include in API requests. By default, fields with
  627. // empty values are omitted from API requests. However, any non-pointer,
  628. // non-interface field appearing in ForceSendFields will be sent to the
  629. // server regardless of whether the field is empty or not. This may be
  630. // used to include empty fields in Patch requests.
  631. ForceSendFields []string `json:"-"`
  632. // NullFields is a list of field names (e.g. "Provider") to include in
  633. // API requests with the JSON null value. By default, fields with empty
  634. // values are omitted from API requests. However, any field with an
  635. // empty value appearing in NullFields will be sent to the server as
  636. // null. It is an error if a field in this list has a non-empty value.
  637. // This may be used to include null fields in Patch requests.
  638. NullFields []string `json:"-"`
  639. }
  640. func (s *AuthorizationConfig) MarshalJSON() ([]byte, error) {
  641. type NoMethod AuthorizationConfig
  642. raw := NoMethod(*s)
  643. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  644. }
  645. // Backend: `Backend` defines the backend configuration for a service.
  646. type Backend struct {
  647. // Rules: A list of API backend rules that apply to individual API
  648. // methods.
  649. //
  650. // **NOTE:** All service configuration rules follow "last one wins"
  651. // order.
  652. Rules []*BackendRule `json:"rules,omitempty"`
  653. // ForceSendFields is a list of field names (e.g. "Rules") to
  654. // unconditionally include in API requests. By default, fields with
  655. // empty values are omitted from API requests. However, any non-pointer,
  656. // non-interface field appearing in ForceSendFields will be sent to the
  657. // server regardless of whether the field is empty or not. This may be
  658. // used to include empty fields in Patch requests.
  659. ForceSendFields []string `json:"-"`
  660. // NullFields is a list of field names (e.g. "Rules") to include in API
  661. // requests with the JSON null value. By default, fields with empty
  662. // values are omitted from API requests. However, any field with an
  663. // empty value appearing in NullFields will be sent to the server as
  664. // null. It is an error if a field in this list has a non-empty value.
  665. // This may be used to include null fields in Patch requests.
  666. NullFields []string `json:"-"`
  667. }
  668. func (s *Backend) MarshalJSON() ([]byte, error) {
  669. type NoMethod Backend
  670. raw := NoMethod(*s)
  671. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  672. }
  673. // BackendRule: A backend rule provides configuration for an individual
  674. // API element.
  675. type BackendRule struct {
  676. // Address: The address of the API backend.
  677. Address string `json:"address,omitempty"`
  678. // Deadline: The number of seconds to wait for a response from a
  679. // request. The default
  680. // deadline for gRPC is infinite (no deadline) and HTTP requests is 5
  681. // seconds.
  682. Deadline float64 `json:"deadline,omitempty"`
  683. // MinDeadline: Minimum deadline in seconds needed for this method.
  684. // Calls having deadline
  685. // value lower than this will be rejected.
  686. MinDeadline float64 `json:"minDeadline,omitempty"`
  687. // Selector: Selects the methods to which this rule applies.
  688. //
  689. // Refer to selector for syntax details.
  690. Selector string `json:"selector,omitempty"`
  691. // ForceSendFields is a list of field names (e.g. "Address") to
  692. // unconditionally include in API requests. By default, fields with
  693. // empty values are omitted from API requests. However, any non-pointer,
  694. // non-interface field appearing in ForceSendFields will be sent to the
  695. // server regardless of whether the field is empty or not. This may be
  696. // used to include empty fields in Patch requests.
  697. ForceSendFields []string `json:"-"`
  698. // NullFields is a list of field names (e.g. "Address") to include in
  699. // API requests with the JSON null value. By default, fields with empty
  700. // values are omitted from API requests. However, any field with an
  701. // empty value appearing in NullFields will be sent to the server as
  702. // null. It is an error if a field in this list has a non-empty value.
  703. // This may be used to include null fields in Patch requests.
  704. NullFields []string `json:"-"`
  705. }
  706. func (s *BackendRule) MarshalJSON() ([]byte, error) {
  707. type NoMethod BackendRule
  708. raw := NoMethod(*s)
  709. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  710. }
  711. func (s *BackendRule) UnmarshalJSON(data []byte) error {
  712. type NoMethod BackendRule
  713. var s1 struct {
  714. Deadline gensupport.JSONFloat64 `json:"deadline"`
  715. MinDeadline gensupport.JSONFloat64 `json:"minDeadline"`
  716. *NoMethod
  717. }
  718. s1.NoMethod = (*NoMethod)(s)
  719. if err := json.Unmarshal(data, &s1); err != nil {
  720. return err
  721. }
  722. s.Deadline = float64(s1.Deadline)
  723. s.MinDeadline = float64(s1.MinDeadline)
  724. return nil
  725. }
  726. // Billing: Billing related configuration of the service.
  727. //
  728. // The following example shows how to configure monitored resources and
  729. // metrics
  730. // for billing:
  731. //
  732. // monitored_resources:
  733. // - type: library.googleapis.com/branch
  734. // labels:
  735. // - key: /city
  736. // description: The city where the library branch is located
  737. // in.
  738. // - key: /name
  739. // description: The name of the branch.
  740. // metrics:
  741. // - name: library.googleapis.com/book/borrowed_count
  742. // metric_kind: DELTA
  743. // value_type: INT64
  744. // billing:
  745. // consumer_destinations:
  746. // - monitored_resource: library.googleapis.com/branch
  747. // metrics:
  748. // - library.googleapis.com/book/borrowed_count
  749. type Billing struct {
  750. // ConsumerDestinations: Billing configurations for sending metrics to
  751. // the consumer project.
  752. // There can be multiple consumer destinations per service, each one
  753. // must have
  754. // a different monitored resource type. A metric can be used in at
  755. // most
  756. // one consumer destination.
  757. ConsumerDestinations []*BillingDestination `json:"consumerDestinations,omitempty"`
  758. // ForceSendFields is a list of field names (e.g.
  759. // "ConsumerDestinations") to unconditionally include in API requests.
  760. // By default, fields with empty values are omitted from API requests.
  761. // However, any non-pointer, non-interface field appearing in
  762. // ForceSendFields will be sent to the server regardless of whether the
  763. // field is empty or not. This may be used to include empty fields in
  764. // Patch requests.
  765. ForceSendFields []string `json:"-"`
  766. // NullFields is a list of field names (e.g. "ConsumerDestinations") to
  767. // include in API requests with the JSON null value. By default, fields
  768. // with empty values are omitted from API requests. However, any field
  769. // with an empty value appearing in NullFields will be sent to the
  770. // server as null. It is an error if a field in this list has a
  771. // non-empty value. This may be used to include null fields in Patch
  772. // requests.
  773. NullFields []string `json:"-"`
  774. }
  775. func (s *Billing) MarshalJSON() ([]byte, error) {
  776. type NoMethod Billing
  777. raw := NoMethod(*s)
  778. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  779. }
  780. // BillingDestination: Configuration of a specific billing destination
  781. // (Currently only support
  782. // bill against consumer project).
  783. type BillingDestination struct {
  784. // Metrics: Names of the metrics to report to this billing
  785. // destination.
  786. // Each name must be defined in Service.metrics section.
  787. Metrics []string `json:"metrics,omitempty"`
  788. // MonitoredResource: The monitored resource type. The type must be
  789. // defined in
  790. // Service.monitored_resources section.
  791. MonitoredResource string `json:"monitoredResource,omitempty"`
  792. // ForceSendFields is a list of field names (e.g. "Metrics") to
  793. // unconditionally include in API requests. By default, fields with
  794. // empty values are omitted from API requests. However, any non-pointer,
  795. // non-interface field appearing in ForceSendFields will be sent to the
  796. // server regardless of whether the field is empty or not. This may be
  797. // used to include empty fields in Patch requests.
  798. ForceSendFields []string `json:"-"`
  799. // NullFields is a list of field names (e.g. "Metrics") to include in
  800. // API requests with the JSON null value. By default, fields with empty
  801. // values are omitted from API requests. However, any field with an
  802. // empty value appearing in NullFields will be sent to the server as
  803. // null. It is an error if a field in this list has a non-empty value.
  804. // This may be used to include null fields in Patch requests.
  805. NullFields []string `json:"-"`
  806. }
  807. func (s *BillingDestination) MarshalJSON() ([]byte, error) {
  808. type NoMethod BillingDestination
  809. raw := NoMethod(*s)
  810. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  811. }
  812. // Binding: Associates `members` with a `role`.
  813. type Binding struct {
  814. // Members: Specifies the identities requesting access for a Cloud
  815. // Platform resource.
  816. // `members` can have the following values:
  817. //
  818. // * `allUsers`: A special identifier that represents anyone who is
  819. // on the internet; with or without a Google account.
  820. //
  821. // * `allAuthenticatedUsers`: A special identifier that represents
  822. // anyone
  823. // who is authenticated with a Google account or a service
  824. // account.
  825. //
  826. // * `user:{emailid}`: An email address that represents a specific
  827. // Google
  828. // account. For example, `alice@gmail.com` .
  829. //
  830. //
  831. // * `serviceAccount:{emailid}`: An email address that represents a
  832. // service
  833. // account. For example,
  834. // `my-other-app@appspot.gserviceaccount.com`.
  835. //
  836. // * `group:{emailid}`: An email address that represents a Google
  837. // group.
  838. // For example, `admins@example.com`.
  839. //
  840. //
  841. // * `domain:{domain}`: A Google Apps domain name that represents all
  842. // the
  843. // users of that domain. For example, `google.com` or
  844. // `example.com`.
  845. //
  846. //
  847. Members []string `json:"members,omitempty"`
  848. // Role: Role that is assigned to `members`.
  849. // For example, `roles/viewer`, `roles/editor`, or
  850. // `roles/owner`.
  851. // Required
  852. Role string `json:"role,omitempty"`
  853. // ForceSendFields is a list of field names (e.g. "Members") to
  854. // unconditionally include in API requests. By default, fields with
  855. // empty values are omitted from API requests. However, any non-pointer,
  856. // non-interface field appearing in ForceSendFields will be sent to the
  857. // server regardless of whether the field is empty or not. This may be
  858. // used to include empty fields in Patch requests.
  859. ForceSendFields []string `json:"-"`
  860. // NullFields is a list of field names (e.g. "Members") to include in
  861. // API requests with the JSON null value. By default, fields with empty
  862. // values are omitted from API requests. However, any field with an
  863. // empty value appearing in NullFields will be sent to the server as
  864. // null. It is an error if a field in this list has a non-empty value.
  865. // This may be used to include null fields in Patch requests.
  866. NullFields []string `json:"-"`
  867. }
  868. func (s *Binding) MarshalJSON() ([]byte, error) {
  869. type NoMethod Binding
  870. raw := NoMethod(*s)
  871. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  872. }
  873. // ChangeReport: Change report associated with a particular service
  874. // configuration.
  875. //
  876. // It contains a list of ConfigChanges based on the comparison
  877. // between
  878. // two service configurations.
  879. type ChangeReport struct {
  880. // ConfigChanges: List of changes between two service
  881. // configurations.
  882. // The changes will be alphabetically sorted based on the identifier
  883. // of each change.
  884. // A ConfigChange identifier is a dot separated path to the
  885. // configuration.
  886. // Example:
  887. // visibility.rules[selector='LibraryService.CreateBook'].restriction
  888. ConfigChanges []*ConfigChange `json:"configChanges,omitempty"`
  889. // ForceSendFields is a list of field names (e.g. "ConfigChanges") to
  890. // unconditionally include in API requests. By default, fields with
  891. // empty values are omitted from API requests. However, any non-pointer,
  892. // non-interface field appearing in ForceSendFields will be sent to the
  893. // server regardless of whether the field is empty or not. This may be
  894. // used to include empty fields in Patch requests.
  895. ForceSendFields []string `json:"-"`
  896. // NullFields is a list of field names (e.g. "ConfigChanges") to include
  897. // in API requests with the JSON null value. By default, fields with
  898. // empty values are omitted from API requests. However, any field with
  899. // an empty value appearing in NullFields will be sent to the server as
  900. // null. It is an error if a field in this list has a non-empty value.
  901. // This may be used to include null fields in Patch requests.
  902. NullFields []string `json:"-"`
  903. }
  904. func (s *ChangeReport) MarshalJSON() ([]byte, error) {
  905. type NoMethod ChangeReport
  906. raw := NoMethod(*s)
  907. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  908. }
  909. // ConfigChange: Output generated from semantically comparing two
  910. // versions of a service
  911. // configuration.
  912. //
  913. // Includes detailed information about a field that have changed
  914. // with
  915. // applicable advice about potential consequences for the change, such
  916. // as
  917. // backwards-incompatibility.
  918. type ConfigChange struct {
  919. // Advices: Collection of advice provided for this change, useful for
  920. // determining the
  921. // possible impact of this change.
  922. Advices []*Advice `json:"advices,omitempty"`
  923. // ChangeType: The type for this change, either ADDED, REMOVED, or
  924. // MODIFIED.
  925. //
  926. // Possible values:
  927. // "CHANGE_TYPE_UNSPECIFIED" - No value was provided.
  928. // "ADDED" - The changed object exists in the 'new' service
  929. // configuration, but not
  930. // in the 'old' service configuration.
  931. // "REMOVED" - The changed object exists in the 'old' service
  932. // configuration, but not
  933. // in the 'new' service configuration.
  934. // "MODIFIED" - The changed object exists in both service
  935. // configurations, but its value
  936. // is different.
  937. ChangeType string `json:"changeType,omitempty"`
  938. // Element: Object hierarchy path to the change, with levels separated
  939. // by a '.'
  940. // character. For repeated fields, an applicable unique identifier field
  941. // is
  942. // used for the index (usually selector, name, or id). For maps, the
  943. // term
  944. // 'key' is used. If the field has no unique identifier, the numeric
  945. // index
  946. // is used.
  947. // Examples:
  948. // -
  949. // visibility.rules[selector=="google.LibraryService.CreateBook"].restric
  950. // tion
  951. // -
  952. // quota.metric_rules[selector=="google"].metric_costs[key=="reads"].valu
  953. // e
  954. // - logging.producer_destinations[0]
  955. Element string `json:"element,omitempty"`
  956. // NewValue: Value of the changed object in the new Service
  957. // configuration,
  958. // in JSON format. This field will not be populated if ChangeType ==
  959. // REMOVED.
  960. NewValue string `json:"newValue,omitempty"`
  961. // OldValue: Value of the changed object in the old Service
  962. // configuration,
  963. // in JSON format. This field will not be populated if ChangeType ==
  964. // ADDED.
  965. OldValue string `json:"oldValue,omitempty"`
  966. // ForceSendFields is a list of field names (e.g. "Advices") to
  967. // unconditionally include in API requests. By default, fields with
  968. // empty values are omitted from API requests. However, any non-pointer,
  969. // non-interface field appearing in ForceSendFields will be sent to the
  970. // server regardless of whether the field is empty or not. This may be
  971. // used to include empty fields in Patch requests.
  972. ForceSendFields []string `json:"-"`
  973. // NullFields is a list of field names (e.g. "Advices") to include in
  974. // API requests with the JSON null value. By default, fields with empty
  975. // values are omitted from API requests. However, any field with an
  976. // empty value appearing in NullFields will be sent to the server as
  977. // null. It is an error if a field in this list has a non-empty value.
  978. // This may be used to include null fields in Patch requests.
  979. NullFields []string `json:"-"`
  980. }
  981. func (s *ConfigChange) MarshalJSON() ([]byte, error) {
  982. type NoMethod ConfigChange
  983. raw := NoMethod(*s)
  984. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  985. }
  986. // ConfigFile: Generic specification of a source configuration file
  987. type ConfigFile struct {
  988. // FileContents: The bytes that constitute the file.
  989. FileContents string `json:"fileContents,omitempty"`
  990. // FilePath: The file name of the configuration file (full or relative
  991. // path).
  992. FilePath string `json:"filePath,omitempty"`
  993. // FileType: The type of configuration file this represents.
  994. //
  995. // Possible values:
  996. // "FILE_TYPE_UNSPECIFIED" - Unknown file type.
  997. // "SERVICE_CONFIG_YAML" - YAML-specification of service.
  998. // "OPEN_API_JSON" - OpenAPI specification, serialized in JSON.
  999. // "OPEN_API_YAML" - OpenAPI specification, serialized in YAML.
  1000. // "FILE_DESCRIPTOR_SET_PROTO" - FileDescriptorSet, generated by
  1001. // protoc.
  1002. //
  1003. // To generate, use protoc with imports and source info included.
  1004. // For an example test.proto file, the following command would put the
  1005. // value
  1006. // in a new file named out.pb.
  1007. //
  1008. // $protoc --include_imports --include_source_info test.proto -o out.pb
  1009. // "PROTO_FILE" - Uncompiled Proto file. Used for storage and display
  1010. // purposes only,
  1011. // currently server-side compilation is not supported. Should match
  1012. // the
  1013. // inputs to 'protoc' command used to generated
  1014. // FILE_DESCRIPTOR_SET_PROTO. A
  1015. // file of this type can only be included if at least one file of
  1016. // type
  1017. // FILE_DESCRIPTOR_SET_PROTO is included.
  1018. FileType string `json:"fileType,omitempty"`
  1019. // ForceSendFields is a list of field names (e.g. "FileContents") to
  1020. // unconditionally include in API requests. By default, fields with
  1021. // empty values are omitted from API requests. However, any non-pointer,
  1022. // non-interface field appearing in ForceSendFields will be sent to the
  1023. // server regardless of whether the field is empty or not. This may be
  1024. // used to include empty fields in Patch requests.
  1025. ForceSendFields []string `json:"-"`
  1026. // NullFields is a list of field names (e.g. "FileContents") to include
  1027. // in API requests with the JSON null value. By default, fields with
  1028. // empty values are omitted from API requests. However, any field with
  1029. // an empty value appearing in NullFields will be sent to the server as
  1030. // null. It is an error if a field in this list has a non-empty value.
  1031. // This may be used to include null fields in Patch requests.
  1032. NullFields []string `json:"-"`
  1033. }
  1034. func (s *ConfigFile) MarshalJSON() ([]byte, error) {
  1035. type NoMethod ConfigFile
  1036. raw := NoMethod(*s)
  1037. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1038. }
  1039. // ConfigRef: Represents a service configuration with its name and id.
  1040. type ConfigRef struct {
  1041. // Name: Resource name of a service config. It must have the
  1042. // following
  1043. // format: "services/{service name}/configs/{config id}".
  1044. Name string `json:"name,omitempty"`
  1045. // ForceSendFields is a list of field names (e.g. "Name") to
  1046. // unconditionally include in API requests. By default, fields with
  1047. // empty values are omitted from API requests. However, any non-pointer,
  1048. // non-interface field appearing in ForceSendFields will be sent to the
  1049. // server regardless of whether the field is empty or not. This may be
  1050. // used to include empty fields in Patch requests.
  1051. ForceSendFields []string `json:"-"`
  1052. // NullFields is a list of field names (e.g. "Name") to include in API
  1053. // requests with the JSON null value. By default, fields with empty
  1054. // values are omitted from API requests. However, any field with an
  1055. // empty value appearing in NullFields will be sent to the server as
  1056. // null. It is an error if a field in this list has a non-empty value.
  1057. // This may be used to include null fields in Patch requests.
  1058. NullFields []string `json:"-"`
  1059. }
  1060. func (s *ConfigRef) MarshalJSON() ([]byte, error) {
  1061. type NoMethod ConfigRef
  1062. raw := NoMethod(*s)
  1063. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1064. }
  1065. // ConfigSource: Represents a source file which is used to generate the
  1066. // service configuration
  1067. // defined by `google.api.Service`.
  1068. type ConfigSource struct {
  1069. // Files: Set of source configuration files that are used to generate a
  1070. // service
  1071. // configuration (`google.api.Service`).
  1072. Files []*ConfigFile `json:"files,omitempty"`
  1073. // Id: A unique ID for a specific instance of this message, typically
  1074. // assigned
  1075. // by the client for tracking purpose. If empty, the server may choose
  1076. // to
  1077. // generate one instead.
  1078. Id string `json:"id,omitempty"`
  1079. // ForceSendFields is a list of field names (e.g. "Files") to
  1080. // unconditionally include in API requests. By default, fields with
  1081. // empty values are omitted from API requests. However, any non-pointer,
  1082. // non-interface field appearing in ForceSendFields will be sent to the
  1083. // server regardless of whether the field is empty or not. This may be
  1084. // used to include empty fields in Patch requests.
  1085. ForceSendFields []string `json:"-"`
  1086. // NullFields is a list of field names (e.g. "Files") to include in API
  1087. // requests with the JSON null value. By default, fields with empty
  1088. // values are omitted from API requests. However, any field with an
  1089. // empty value appearing in NullFields will be sent to the server as
  1090. // null. It is an error if a field in this list has a non-empty value.
  1091. // This may be used to include null fields in Patch requests.
  1092. NullFields []string `json:"-"`
  1093. }
  1094. func (s *ConfigSource) MarshalJSON() ([]byte, error) {
  1095. type NoMethod ConfigSource
  1096. raw := NoMethod(*s)
  1097. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1098. }
  1099. // Context: `Context` defines which contexts an API
  1100. // requests.
  1101. //
  1102. // Example:
  1103. //
  1104. // context:
  1105. // rules:
  1106. // - selector: "*"
  1107. // requested:
  1108. // - google.rpc.context.ProjectContext
  1109. // - google.rpc.context.OriginContext
  1110. //
  1111. // The above specifies that all methods in the API
  1112. // request
  1113. // `google.rpc.context.ProjectContext`
  1114. // and
  1115. // `google.rpc.context.OriginContext`.
  1116. //
  1117. // Available context types are defined in
  1118. // package
  1119. // `google.rpc.context`.
  1120. //
  1121. // This also provides mechanism to whitelist any protobuf message
  1122. // extension that
  1123. // can be sent in grpc metadata using
  1124. // “x-goog-ext-<extension_id>-bin”
  1125. // and
  1126. // “x-goog-ext-<extension_id>-jspb” format. For example, list any
  1127. // service
  1128. // specific protobuf types that can appear in grpc metadata as follows
  1129. // in your
  1130. // yaml file:
  1131. //
  1132. // Example:
  1133. //
  1134. // context:
  1135. // rules:
  1136. // - selector:
  1137. // "google.example.library.v1.LibraryService.CreateBook"
  1138. // allowed_request_extensions:
  1139. // - google.foo.v1.NewExtension
  1140. // allowed_response_extensions:
  1141. // - google.foo.v1.NewExtension
  1142. //
  1143. // You can also specify extension ID instead of fully qualified
  1144. // extension name
  1145. // here.
  1146. type Context struct {
  1147. // Rules: A list of RPC context rules that apply to individual API
  1148. // methods.
  1149. //
  1150. // **NOTE:** All service configuration rules follow "last one wins"
  1151. // order.
  1152. Rules []*ContextRule `json:"rules,omitempty"`
  1153. // ForceSendFields is a list of field names (e.g. "Rules") to
  1154. // unconditionally include in API requests. By default, fields with
  1155. // empty values are omitted from API requests. However, any non-pointer,
  1156. // non-interface field appearing in ForceSendFields will be sent to the
  1157. // server regardless of whether the field is empty or not. This may be
  1158. // used to include empty fields in Patch requests.
  1159. ForceSendFields []string `json:"-"`
  1160. // NullFields is a list of field names (e.g. "Rules") to include in API
  1161. // requests with the JSON null value. By default, fields with empty
  1162. // values are omitted from API requests. However, any field with an
  1163. // empty value appearing in NullFields will be sent to the server as
  1164. // null. It is an error if a field in this list has a non-empty value.
  1165. // This may be used to include null fields in Patch requests.
  1166. NullFields []string `json:"-"`
  1167. }
  1168. func (s *Context) MarshalJSON() ([]byte, error) {
  1169. type NoMethod Context
  1170. raw := NoMethod(*s)
  1171. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1172. }
  1173. // ContextRule: A context rule provides information about the context
  1174. // for an individual API
  1175. // element.
  1176. type ContextRule struct {
  1177. // AllowedRequestExtensions: A list of full type names or extension IDs
  1178. // of extensions allowed in grpc
  1179. // side channel from client to backend.
  1180. AllowedRequestExtensions []string `json:"allowedRequestExtensions,omitempty"`
  1181. // AllowedResponseExtensions: A list of full type names or extension IDs
  1182. // of extensions allowed in grpc
  1183. // side channel from backend to client.
  1184. AllowedResponseExtensions []string `json:"allowedResponseExtensions,omitempty"`
  1185. // Provided: A list of full type names of provided contexts.
  1186. Provided []string `json:"provided,omitempty"`
  1187. // Requested: A list of full type names of requested contexts.
  1188. Requested []string `json:"requested,omitempty"`
  1189. // Selector: Selects the methods to which this rule applies.
  1190. //
  1191. // Refer to selector for syntax details.
  1192. Selector string `json:"selector,omitempty"`
  1193. // ForceSendFields is a list of field names (e.g.
  1194. // "AllowedRequestExtensions") to unconditionally include in API
  1195. // requests. By default, fields with empty values are omitted from API
  1196. // requests. However, any non-pointer, non-interface field appearing in
  1197. // ForceSendFields will be sent to the server regardless of whether the
  1198. // field is empty or not. This may be used to include empty fields in
  1199. // Patch requests.
  1200. ForceSendFields []string `json:"-"`
  1201. // NullFields is a list of field names (e.g. "AllowedRequestExtensions")
  1202. // to include in API requests with the JSON null value. By default,
  1203. // fields with empty values are omitted from API requests. However, any
  1204. // field with an empty value appearing in NullFields will be sent to the
  1205. // server as null. It is an error if a field in this list has a
  1206. // non-empty value. This may be used to include null fields in Patch
  1207. // requests.
  1208. NullFields []string `json:"-"`
  1209. }
  1210. func (s *ContextRule) MarshalJSON() ([]byte, error) {
  1211. type NoMethod ContextRule
  1212. raw := NoMethod(*s)
  1213. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1214. }
  1215. // Control: Selects and configures the service controller used by the
  1216. // service. The
  1217. // service controller handles features like abuse, quota, billing,
  1218. // logging,
  1219. // monitoring, etc.
  1220. type Control struct {
  1221. // Environment: The service control environment to use. If empty, no
  1222. // control plane
  1223. // feature (like quota and billing) will be enabled.
  1224. Environment string `json:"environment,omitempty"`
  1225. // ForceSendFields is a list of field names (e.g. "Environment") to
  1226. // unconditionally include in API requests. By default, fields with
  1227. // empty values are omitted from API requests. However, any non-pointer,
  1228. // non-interface field appearing in ForceSendFields will be sent to the
  1229. // server regardless of whether the field is empty or not. This may be
  1230. // used to include empty fields in Patch requests.
  1231. ForceSendFields []string `json:"-"`
  1232. // NullFields is a list of field names (e.g. "Environment") to include
  1233. // in API requests with the JSON null value. By default, fields with
  1234. // empty values are omitted from API requests. However, any field with
  1235. // an empty value appearing in NullFields will be sent to the server as
  1236. // null. It is an error if a field in this list has a non-empty value.
  1237. // This may be used to include null fields in Patch requests.
  1238. NullFields []string `json:"-"`
  1239. }
  1240. func (s *Control) MarshalJSON() ([]byte, error) {
  1241. type NoMethod Control
  1242. raw := NoMethod(*s)
  1243. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1244. }
  1245. // CustomError: Customize service error responses. For example, list
  1246. // any service
  1247. // specific protobuf types that can appear in error detail lists
  1248. // of
  1249. // error responses.
  1250. //
  1251. // Example:
  1252. //
  1253. // custom_error:
  1254. // types:
  1255. // - google.foo.v1.CustomError
  1256. // - google.foo.v1.AnotherError
  1257. type CustomError struct {
  1258. // Rules: The list of custom error rules that apply to individual API
  1259. // messages.
  1260. //
  1261. // **NOTE:** All service configuration rules follow "last one wins"
  1262. // order.
  1263. Rules []*CustomErrorRule `json:"rules,omitempty"`
  1264. // Types: The list of custom error detail types, e.g.
  1265. // 'google.foo.v1.CustomError'.
  1266. Types []string `json:"types,omitempty"`
  1267. // ForceSendFields is a list of field names (e.g. "Rules") to
  1268. // unconditionally include in API requests. By default, fields with
  1269. // empty values are omitted from API requests. However, any non-pointer,
  1270. // non-interface field appearing in ForceSendFields will be sent to the
  1271. // server regardless of whether the field is empty or not. This may be
  1272. // used to include empty fields in Patch requests.
  1273. ForceSendFields []string `json:"-"`
  1274. // NullFields is a list of field names (e.g. "Rules") to include in API
  1275. // requests with the JSON null value. By default, fields with empty
  1276. // values are omitted from API requests. However, any field with an
  1277. // empty value appearing in NullFields will be sent to the server as
  1278. // null. It is an error if a field in this list has a non-empty value.
  1279. // This may be used to include null fields in Patch requests.
  1280. NullFields []string `json:"-"`
  1281. }
  1282. func (s *CustomError) MarshalJSON() ([]byte, error) {
  1283. type NoMethod CustomError
  1284. raw := NoMethod(*s)
  1285. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1286. }
  1287. // CustomErrorRule: A custom error rule.
  1288. type CustomErrorRule struct {
  1289. // IsErrorType: Mark this message as possible payload in error response.
  1290. // Otherwise,
  1291. // objects of this type will be filtered when they appear in error
  1292. // payload.
  1293. IsErrorType bool `json:"isErrorType,omitempty"`
  1294. // Selector: Selects messages to which this rule applies.
  1295. //
  1296. // Refer to selector for syntax details.
  1297. Selector string `json:"selector,omitempty"`
  1298. // ForceSendFields is a list of field names (e.g. "IsErrorType") to
  1299. // unconditionally include in API requests. By default, fields with
  1300. // empty values are omitted from API requests. However, any non-pointer,
  1301. // non-interface field appearing in ForceSendFields will be sent to the
  1302. // server regardless of whether the field is empty or not. This may be
  1303. // used to include empty fields in Patch requests.
  1304. ForceSendFields []string `json:"-"`
  1305. // NullFields is a list of field names (e.g. "IsErrorType") to include
  1306. // in API requests with the JSON null value. By default, fields with
  1307. // empty values are omitted from API requests. However, any field with
  1308. // an empty value appearing in NullFields will be sent to the server as
  1309. // null. It is an error if a field in this list has a non-empty value.
  1310. // This may be used to include null fields in Patch requests.
  1311. NullFields []string `json:"-"`
  1312. }
  1313. func (s *CustomErrorRule) MarshalJSON() ([]byte, error) {
  1314. type NoMethod CustomErrorRule
  1315. raw := NoMethod(*s)
  1316. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1317. }
  1318. // CustomHttpPattern: A custom pattern is used for defining custom HTTP
  1319. // verb.
  1320. type CustomHttpPattern struct {
  1321. // Kind: The name of this custom HTTP verb.
  1322. Kind string `json:"kind,omitempty"`
  1323. // Path: The path matched by this custom verb.
  1324. Path string `json:"path,omitempty"`
  1325. // ForceSendFields is a list of field names (e.g. "Kind") to
  1326. // unconditionally include in API requests. By default, fields with
  1327. // empty values are omitted from API requests. However, any non-pointer,
  1328. // non-interface field appearing in ForceSendFields will be sent to the
  1329. // server regardless of whether the field is empty or not. This may be
  1330. // used to include empty fields in Patch requests.
  1331. ForceSendFields []string `json:"-"`
  1332. // NullFields is a list of field names (e.g. "Kind") to include in API
  1333. // requests with the JSON null value. By default, fields with empty
  1334. // values are omitted from API requests. However, any field with an
  1335. // empty value appearing in NullFields will be sent to the server as
  1336. // null. It is an error if a field in this list has a non-empty value.
  1337. // This may be used to include null fields in Patch requests.
  1338. NullFields []string `json:"-"`
  1339. }
  1340. func (s *CustomHttpPattern) MarshalJSON() ([]byte, error) {
  1341. type NoMethod CustomHttpPattern
  1342. raw := NoMethod(*s)
  1343. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1344. }
  1345. // DeleteServiceStrategy: Strategy used to delete a service. This
  1346. // strategy is a placeholder only
  1347. // used by the system generated rollout to delete a service.
  1348. type DeleteServiceStrategy struct {
  1349. }
  1350. // Diagnostic: Represents a diagnostic message (error or warning)
  1351. type Diagnostic struct {
  1352. // Kind: The kind of diagnostic information provided.
  1353. //
  1354. // Possible values:
  1355. // "WARNING" - Warnings and errors
  1356. // "ERROR" - Only errors
  1357. Kind string `json:"kind,omitempty"`
  1358. // Location: File name and line number of the error or warning.
  1359. Location string `json:"location,omitempty"`
  1360. // Message: Message describing the error or warning.
  1361. Message string `json:"message,omitempty"`
  1362. // ForceSendFields is a list of field names (e.g. "Kind") to
  1363. // unconditionally include in API requests. By default, fields with
  1364. // empty values are omitted from API requests. However, any non-pointer,
  1365. // non-interface field appearing in ForceSendFields will be sent to the
  1366. // server regardless of whether the field is empty or not. This may be
  1367. // used to include empty fields in Patch requests.
  1368. ForceSendFields []string `json:"-"`
  1369. // NullFields is a list of field names (e.g. "Kind") to include in API
  1370. // requests with the JSON null value. By default, fields with empty
  1371. // values are omitted from API requests. However, any field with an
  1372. // empty value appearing in NullFields will be sent to the server as
  1373. // null. It is an error if a field in this list has a non-empty value.
  1374. // This may be used to include null fields in Patch requests.
  1375. NullFields []string `json:"-"`
  1376. }
  1377. func (s *Diagnostic) MarshalJSON() ([]byte, error) {
  1378. type NoMethod Diagnostic
  1379. raw := NoMethod(*s)
  1380. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1381. }
  1382. // DisableServiceRequest: Request message for DisableService method.
  1383. type DisableServiceRequest struct {
  1384. // ConsumerId: The identity of consumer resource which service
  1385. // disablement will be
  1386. // applied to.
  1387. //
  1388. // The Google Service Management implementation accepts the
  1389. // following
  1390. // forms:
  1391. // - "project:<project_id>"
  1392. //
  1393. // Note: this is made compatible
  1394. // with
  1395. // google.api.servicecontrol.v1.Operation.consumer_id.
  1396. ConsumerId string `json:"consumerId,omitempty"`
  1397. // ForceSendFields is a list of field names (e.g. "ConsumerId") to
  1398. // unconditionally include in API requests. By default, fields with
  1399. // empty values are omitted from API requests. However, any non-pointer,
  1400. // non-interface field appearing in ForceSendFields will be sent to the
  1401. // server regardless of whether the field is empty or not. This may be
  1402. // used to include empty fields in Patch requests.
  1403. ForceSendFields []string `json:"-"`
  1404. // NullFields is a list of field names (e.g. "ConsumerId") to include in
  1405. // API requests with the JSON null value. By default, fields with empty
  1406. // values are omitted from API requests. However, any field with an
  1407. // empty value appearing in NullFields will be sent to the server as
  1408. // null. It is an error if a field in this list has a non-empty value.
  1409. // This may be used to include null fields in Patch requests.
  1410. NullFields []string `json:"-"`
  1411. }
  1412. func (s *DisableServiceRequest) MarshalJSON() ([]byte, error) {
  1413. type NoMethod DisableServiceRequest
  1414. raw := NoMethod(*s)
  1415. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1416. }
  1417. // Documentation: `Documentation` provides the information for
  1418. // describing a service.
  1419. //
  1420. // Example:
  1421. // <pre><code>documentation:
  1422. // summary: >
  1423. // The Google Calendar API gives access
  1424. // to most calendar features.
  1425. // pages:
  1426. // - name: Overview
  1427. // content: &#40;== include google/foo/overview.md ==&#41;
  1428. // - name: Tutorial
  1429. // content: &#40;== include google/foo/tutorial.md ==&#41;
  1430. // subpages;
  1431. // - name: Java
  1432. // content: &#40;== include google/foo/tutorial_java.md ==&#41;
  1433. // rules:
  1434. // - selector: google.calendar.Calendar.Get
  1435. // description: >
  1436. // ...
  1437. // - selector: google.calendar.Calendar.Put
  1438. // description: >
  1439. // ...
  1440. // </code></pre>
  1441. // Documentation is provided in markdown syntax. In addition to
  1442. // standard markdown features, definition lists, tables and fenced
  1443. // code blocks are supported. Section headers can be provided and
  1444. // are
  1445. // interpreted relative to the section nesting of the context where
  1446. // a documentation fragment is embedded.
  1447. //
  1448. // Documentation from the IDL is merged with documentation defined
  1449. // via the config at normalization time, where documentation provided
  1450. // by config rules overrides IDL provided.
  1451. //
  1452. // A number of constructs specific to the API platform are supported
  1453. // in documentation text.
  1454. //
  1455. // In order to reference a proto element, the following
  1456. // notation can be
  1457. // used:
  1458. // <pre><code>&#91;fully.qualified.proto.name]&#91;]</code></pre>
  1459. // T
  1460. // o override the display text used for the link, this can be
  1461. // used:
  1462. // <pre><code>&#91;display
  1463. // text]&#91;fully.qualified.proto.name]</code></pre>
  1464. // Text can be excluded from doc using the following
  1465. // notation:
  1466. // <pre><code>&#40;-- internal comment --&#41;</code></pre>
  1467. //
  1468. // A few directives are available in documentation. Note that
  1469. // directives must appear on a single line to be properly
  1470. // identified. The `include` directive includes a markdown file from
  1471. // an external source:
  1472. // <pre><code>&#40;== include path/to/file ==&#41;</code></pre>
  1473. // The `resource_for` directive marks a message to be the resource of
  1474. // a collection in REST view. If it is not specified, tools attempt
  1475. // to infer the resource from the operations in a
  1476. // collection:
  1477. // <pre><code>&#40;== resource_for v1.shelves.books
  1478. // ==&#41;</code></pre>
  1479. // The directive `suppress_warning` does not directly affect
  1480. // documentation
  1481. // and is documented together with service config validation.
  1482. type Documentation struct {
  1483. // DocumentationRootUrl: The URL to the root of documentation.
  1484. DocumentationRootUrl string `json:"documentationRootUrl,omitempty"`
  1485. // Overview: Declares a single overview page. For
  1486. // example:
  1487. // <pre><code>documentation:
  1488. // summary: ...
  1489. // overview: &#40;== include overview.md ==&#41;
  1490. // </code></pre>
  1491. // This is a shortcut for the following declaration (using pages
  1492. // style):
  1493. // <pre><code>documentation:
  1494. // summary: ...
  1495. // pages:
  1496. // - name: Overview
  1497. // content: &#40;== include overview.md ==&#41;
  1498. // </code></pre>
  1499. // Note: you cannot specify both `overview` field and `pages` field.
  1500. Overview string `json:"overview,omitempty"`
  1501. // Pages: The top level pages for the documentation set.
  1502. Pages []*Page `json:"pages,omitempty"`
  1503. // Rules: A list of documentation rules that apply to individual API
  1504. // elements.
  1505. //
  1506. // **NOTE:** All service configuration rules follow "last one wins"
  1507. // order.
  1508. Rules []*DocumentationRule `json:"rules,omitempty"`
  1509. // Summary: A short summary of what the service does. Can only be
  1510. // provided by
  1511. // plain text.
  1512. Summary string `json:"summary,omitempty"`
  1513. // ForceSendFields is a list of field names (e.g.
  1514. // "DocumentationRootUrl") to unconditionally include in API requests.
  1515. // By default, fields with empty values are omitted from API requests.
  1516. // However, any non-pointer, non-interface field appearing in
  1517. // ForceSendFields will be sent to the server regardless of whether the
  1518. // field is empty or not. This may be used to include empty fields in
  1519. // Patch requests.
  1520. ForceSendFields []string `json:"-"`
  1521. // NullFields is a list of field names (e.g. "DocumentationRootUrl") to
  1522. // include in API requests with the JSON null value. By default, fields
  1523. // with empty values are omitted from API requests. However, any field
  1524. // with an empty value appearing in NullFields will be sent to the
  1525. // server as null. It is an error if a field in this list has a
  1526. // non-empty value. This may be used to include null fields in Patch
  1527. // requests.
  1528. NullFields []string `json:"-"`
  1529. }
  1530. func (s *Documentation) MarshalJSON() ([]byte, error) {
  1531. type NoMethod Documentation
  1532. raw := NoMethod(*s)
  1533. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1534. }
  1535. // DocumentationRule: A documentation rule provides information about
  1536. // individual API elements.
  1537. type DocumentationRule struct {
  1538. // DeprecationDescription: Deprecation description of the selected
  1539. // element(s). It can be provided if an
  1540. // element is marked as `deprecated`.
  1541. DeprecationDescription string `json:"deprecationDescription,omitempty"`
  1542. // Description: Description of the selected API(s).
  1543. Description string `json:"description,omitempty"`
  1544. // Selector: The selector is a comma-separated list of patterns. Each
  1545. // pattern is a
  1546. // qualified name of the element which may end in "*", indicating a
  1547. // wildcard.
  1548. // Wildcards are only allowed at the end and for a whole component of
  1549. // the
  1550. // qualified name, i.e. "foo.*" is ok, but not "foo.b*" or "foo.*.bar".
  1551. // To
  1552. // specify a default for all applicable elements, the whole pattern
  1553. // "*"
  1554. // is used.
  1555. Selector string `json:"selector,omitempty"`
  1556. // ForceSendFields is a list of field names (e.g.
  1557. // "DeprecationDescription") to unconditionally include in API requests.
  1558. // By default, fields with empty values are omitted from API requests.
  1559. // However, any non-pointer, non-interface field appearing in
  1560. // ForceSendFields will be sent to the server regardless of whether the
  1561. // field is empty or not. This may be used to include empty fields in
  1562. // Patch requests.
  1563. ForceSendFields []string `json:"-"`
  1564. // NullFields is a list of field names (e.g. "DeprecationDescription")
  1565. // to include in API requests with the JSON null value. By default,
  1566. // fields with empty values are omitted from API requests. However, any
  1567. // field with an empty value appearing in NullFields will be sent to the
  1568. // server as null. It is an error if a field in this list has a
  1569. // non-empty value. This may be used to include null fields in Patch
  1570. // requests.
  1571. NullFields []string `json:"-"`
  1572. }
  1573. func (s *DocumentationRule) MarshalJSON() ([]byte, error) {
  1574. type NoMethod DocumentationRule
  1575. raw := NoMethod(*s)
  1576. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1577. }
  1578. // EnableServiceRequest: Request message for EnableService method.
  1579. type EnableServiceRequest struct {
  1580. // ConsumerId: The identity of consumer resource which service
  1581. // enablement will be
  1582. // applied to.
  1583. //
  1584. // The Google Service Management implementation accepts the
  1585. // following
  1586. // forms:
  1587. // - "project:<project_id>"
  1588. //
  1589. // Note: this is made compatible
  1590. // with
  1591. // google.api.servicecontrol.v1.Operation.consumer_id.
  1592. ConsumerId string `json:"consumerId,omitempty"`
  1593. // ForceSendFields is a list of field names (e.g. "ConsumerId") to
  1594. // unconditionally include in API requests. By default, fields with
  1595. // empty values are omitted from API requests. However, any non-pointer,
  1596. // non-interface field appearing in ForceSendFields will be sent to the
  1597. // server regardless of whether the field is empty or not. This may be
  1598. // used to include empty fields in Patch requests.
  1599. ForceSendFields []string `json:"-"`
  1600. // NullFields is a list of field names (e.g. "ConsumerId") to include in
  1601. // API requests with the JSON null value. By default, fields with empty
  1602. // values are omitted from API requests. However, any field with an
  1603. // empty value appearing in NullFields will be sent to the server as
  1604. // null. It is an error if a field in this list has a non-empty value.
  1605. // This may be used to include null fields in Patch requests.
  1606. NullFields []string `json:"-"`
  1607. }
  1608. func (s *EnableServiceRequest) MarshalJSON() ([]byte, error) {
  1609. type NoMethod EnableServiceRequest
  1610. raw := NoMethod(*s)
  1611. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1612. }
  1613. // Endpoint: `Endpoint` describes a network endpoint that serves a set
  1614. // of APIs.
  1615. // A service may expose any number of endpoints, and all endpoints share
  1616. // the
  1617. // same service configuration, such as quota configuration and
  1618. // monitoring
  1619. // configuration.
  1620. //
  1621. // Example service configuration:
  1622. //
  1623. // name: library-example.googleapis.com
  1624. // endpoints:
  1625. // # Below entry makes 'google.example.library.v1.Library'
  1626. // # API be served from endpoint address
  1627. // library-example.googleapis.com.
  1628. // # It also allows HTTP OPTIONS calls to be passed to the
  1629. // backend, for
  1630. // # it to decide whether the subsequent cross-origin request is
  1631. // # allowed to proceed.
  1632. // - name: library-example.googleapis.com
  1633. // allow_cors: true
  1634. type Endpoint struct {
  1635. // Aliases: DEPRECATED: This field is no longer supported. Instead of
  1636. // using aliases,
  1637. // please specify multiple google.api.Endpoint for each of the
  1638. // intended
  1639. // aliases.
  1640. //
  1641. // Additional names that this endpoint will be hosted on.
  1642. Aliases []string `json:"aliases,omitempty"`
  1643. // AllowCors:
  1644. // Allowing
  1645. // [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sh
  1646. // aring), aka
  1647. // cross-domain traffic, would allow the backends served from this
  1648. // endpoint to
  1649. // receive and respond to HTTP OPTIONS requests. The response will be
  1650. // used by
  1651. // the browser to determine whether the subsequent cross-origin request
  1652. // is
  1653. // allowed to proceed.
  1654. AllowCors bool `json:"allowCors,omitempty"`
  1655. // Features: The list of features enabled on this endpoint.
  1656. Features []string `json:"features,omitempty"`
  1657. // Name: The canonical name of this endpoint.
  1658. Name string `json:"name,omitempty"`
  1659. // Target: The specification of an Internet routable address of API
  1660. // frontend that will
  1661. // handle requests to this [API
  1662. // Endpoint](https://cloud.google.com/apis/design/glossary).
  1663. // It should be either a valid IPv4 address or a fully-qualified domain
  1664. // name.
  1665. // For example, "8.8.8.8" or "myservice.appspot.com".
  1666. Target string `json:"target,omitempty"`
  1667. // ForceSendFields is a list of field names (e.g. "Aliases") to
  1668. // unconditionally include in API requests. By default, fields with
  1669. // empty values are omitted from API requests. However, any non-pointer,
  1670. // non-interface field appearing in ForceSendFields will be sent to the
  1671. // server regardless of whether the field is empty or not. This may be
  1672. // used to include empty fields in Patch requests.
  1673. ForceSendFields []string `json:"-"`
  1674. // NullFields is a list of field names (e.g. "Aliases") to include in
  1675. // API requests with the JSON null value. By default, fields with empty
  1676. // values are omitted from API requests. However, any field with an
  1677. // empty value appearing in NullFields will be sent to the server as
  1678. // null. It is an error if a field in this list has a non-empty value.
  1679. // This may be used to include null fields in Patch requests.
  1680. NullFields []string `json:"-"`
  1681. }
  1682. func (s *Endpoint) MarshalJSON() ([]byte, error) {
  1683. type NoMethod Endpoint
  1684. raw := NoMethod(*s)
  1685. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1686. }
  1687. // Enum: Enum type definition.
  1688. type Enum struct {
  1689. // Enumvalue: Enum value definitions.
  1690. Enumvalue []*EnumValue `json:"enumvalue,omitempty"`
  1691. // Name: Enum type name.
  1692. Name string `json:"name,omitempty"`
  1693. // Options: Protocol buffer options.
  1694. Options []*Option `json:"options,omitempty"`
  1695. // SourceContext: The source context.
  1696. SourceContext *SourceContext `json:"sourceContext,omitempty"`
  1697. // Syntax: The source syntax.
  1698. //
  1699. // Possible values:
  1700. // "SYNTAX_PROTO2" - Syntax `proto2`.
  1701. // "SYNTAX_PROTO3" - Syntax `proto3`.
  1702. Syntax string `json:"syntax,omitempty"`
  1703. // ForceSendFields is a list of field names (e.g. "Enumvalue") to
  1704. // unconditionally include in API requests. By default, fields with
  1705. // empty values are omitted from API requests. However, any non-pointer,
  1706. // non-interface field appearing in ForceSendFields will be sent to the
  1707. // server regardless of whether the field is empty or not. This may be
  1708. // used to include empty fields in Patch requests.
  1709. ForceSendFields []string `json:"-"`
  1710. // NullFields is a list of field names (e.g. "Enumvalue") to include in
  1711. // API requests with the JSON null value. By default, fields with empty
  1712. // values are omitted from API requests. However, any field with an
  1713. // empty value appearing in NullFields will be sent to the server as
  1714. // null. It is an error if a field in this list has a non-empty value.
  1715. // This may be used to include null fields in Patch requests.
  1716. NullFields []string `json:"-"`
  1717. }
  1718. func (s *Enum) MarshalJSON() ([]byte, error) {
  1719. type NoMethod Enum
  1720. raw := NoMethod(*s)
  1721. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1722. }
  1723. // EnumValue: Enum value definition.
  1724. type EnumValue struct {
  1725. // Name: Enum value name.
  1726. Name string `json:"name,omitempty"`
  1727. // Number: Enum value number.
  1728. Number int64 `json:"number,omitempty"`
  1729. // Options: Protocol buffer options.
  1730. Options []*Option `json:"options,omitempty"`
  1731. // ForceSendFields is a list of field names (e.g. "Name") to
  1732. // unconditionally include in API requests. By default, fields with
  1733. // empty values are omitted from API requests. However, any non-pointer,
  1734. // non-interface field appearing in ForceSendFields will be sent to the
  1735. // server regardless of whether the field is empty or not. This may be
  1736. // used to include empty fields in Patch requests.
  1737. ForceSendFields []string `json:"-"`
  1738. // NullFields is a list of field names (e.g. "Name") to include in API
  1739. // requests with the JSON null value. By default, fields with empty
  1740. // values are omitted from API requests. However, any field with an
  1741. // empty value appearing in NullFields will be sent to the server as
  1742. // null. It is an error if a field in this list has a non-empty value.
  1743. // This may be used to include null fields in Patch requests.
  1744. NullFields []string `json:"-"`
  1745. }
  1746. func (s *EnumValue) MarshalJSON() ([]byte, error) {
  1747. type NoMethod EnumValue
  1748. raw := NoMethod(*s)
  1749. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1750. }
  1751. // Experimental: Experimental service configuration. These configuration
  1752. // options can
  1753. // only be used by whitelisted users.
  1754. type Experimental struct {
  1755. // Authorization: Authorization configuration.
  1756. Authorization *AuthorizationConfig `json:"authorization,omitempty"`
  1757. // ForceSendFields is a list of field names (e.g. "Authorization") to
  1758. // unconditionally include in API requests. By default, fields with
  1759. // empty values are omitted from API requests. However, any non-pointer,
  1760. // non-interface field appearing in ForceSendFields will be sent to the
  1761. // server regardless of whether the field is empty or not. This may be
  1762. // used to include empty fields in Patch requests.
  1763. ForceSendFields []string `json:"-"`
  1764. // NullFields is a list of field names (e.g. "Authorization") to include
  1765. // in API requests with the JSON null value. By default, fields with
  1766. // empty values are omitted from API requests. However, any field with
  1767. // an empty value appearing in NullFields will be sent to the server as
  1768. // null. It is an error if a field in this list has a non-empty value.
  1769. // This may be used to include null fields in Patch requests.
  1770. NullFields []string `json:"-"`
  1771. }
  1772. func (s *Experimental) MarshalJSON() ([]byte, error) {
  1773. type NoMethod Experimental
  1774. raw := NoMethod(*s)
  1775. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1776. }
  1777. // Field: A single field of a message type.
  1778. type Field struct {
  1779. // Cardinality: The field cardinality.
  1780. //
  1781. // Possible values:
  1782. // "CARDINALITY_UNKNOWN" - For fields with unknown cardinality.
  1783. // "CARDINALITY_OPTIONAL" - For optional fields.
  1784. // "CARDINALITY_REQUIRED" - For required fields. Proto2 syntax only.
  1785. // "CARDINALITY_REPEATED" - For repeated fields.
  1786. Cardinality string `json:"cardinality,omitempty"`
  1787. // DefaultValue: The string value of the default value of this field.
  1788. // Proto2 syntax only.
  1789. DefaultValue string `json:"defaultValue,omitempty"`
  1790. // JsonName: The field JSON name.
  1791. JsonName string `json:"jsonName,omitempty"`
  1792. // Kind: The field type.
  1793. //
  1794. // Possible values:
  1795. // "TYPE_UNKNOWN" - Field type unknown.
  1796. // "TYPE_DOUBLE" - Field type double.
  1797. // "TYPE_FLOAT" - Field type float.
  1798. // "TYPE_INT64" - Field type int64.
  1799. // "TYPE_UINT64" - Field type uint64.
  1800. // "TYPE_INT32" - Field type int32.
  1801. // "TYPE_FIXED64" - Field type fixed64.
  1802. // "TYPE_FIXED32" - Field type fixed32.
  1803. // "TYPE_BOOL" - Field type bool.
  1804. // "TYPE_STRING" - Field type string.
  1805. // "TYPE_GROUP" - Field type group. Proto2 syntax only, and
  1806. // deprecated.
  1807. // "TYPE_MESSAGE" - Field type message.
  1808. // "TYPE_BYTES" - Field type bytes.
  1809. // "TYPE_UINT32" - Field type uint32.
  1810. // "TYPE_ENUM" - Field type enum.
  1811. // "TYPE_SFIXED32" - Field type sfixed32.
  1812. // "TYPE_SFIXED64" - Field type sfixed64.
  1813. // "TYPE_SINT32" - Field type sint32.
  1814. // "TYPE_SINT64" - Field type sint64.
  1815. Kind string `json:"kind,omitempty"`
  1816. // Name: The field name.
  1817. Name string `json:"name,omitempty"`
  1818. // Number: The field number.
  1819. Number int64 `json:"number,omitempty"`
  1820. // OneofIndex: The index of the field type in `Type.oneofs`, for message
  1821. // or enumeration
  1822. // types. The first type has index 1; zero means the type is not in the
  1823. // list.
  1824. OneofIndex int64 `json:"oneofIndex,omitempty"`
  1825. // Options: The protocol buffer options.
  1826. Options []*Option `json:"options,omitempty"`
  1827. // Packed: Whether to use alternative packed wire representation.
  1828. Packed bool `json:"packed,omitempty"`
  1829. // TypeUrl: The field type URL, without the scheme, for message or
  1830. // enumeration
  1831. // types. Example: "type.googleapis.com/google.protobuf.Timestamp".
  1832. TypeUrl string `json:"typeUrl,omitempty"`
  1833. // ForceSendFields is a list of field names (e.g. "Cardinality") to
  1834. // unconditionally include in API requests. By default, fields with
  1835. // empty values are omitted from API requests. However, any non-pointer,
  1836. // non-interface field appearing in ForceSendFields will be sent to the
  1837. // server regardless of whether the field is empty or not. This may be
  1838. // used to include empty fields in Patch requests.
  1839. ForceSendFields []string `json:"-"`
  1840. // NullFields is a list of field names (e.g. "Cardinality") to include
  1841. // in API requests with the JSON null value. By default, fields with
  1842. // empty values are omitted from API requests. However, any field with
  1843. // an empty value appearing in NullFields will be sent to the server as
  1844. // null. It is an error if a field in this list has a non-empty value.
  1845. // This may be used to include null fields in Patch requests.
  1846. NullFields []string `json:"-"`
  1847. }
  1848. func (s *Field) MarshalJSON() ([]byte, error) {
  1849. type NoMethod Field
  1850. raw := NoMethod(*s)
  1851. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1852. }
  1853. // GenerateConfigReportRequest: Request message for GenerateConfigReport
  1854. // method.
  1855. type GenerateConfigReportRequest struct {
  1856. // NewConfig: Service configuration for which we want to generate the
  1857. // report.
  1858. // For this version of API, the supported types
  1859. // are
  1860. // google.api.servicemanagement.v1.ConfigRef,
  1861. // google.api.servicemanag
  1862. // ement.v1.ConfigSource,
  1863. // and google.api.Service
  1864. NewConfig googleapi.RawMessage `json:"newConfig,omitempty"`
  1865. // OldConfig: Service configuration against which the comparison will be
  1866. // done.
  1867. // For this version of API, the supported types
  1868. // are
  1869. // google.api.servicemanagement.v1.ConfigRef,
  1870. // google.api.servicemanag
  1871. // ement.v1.ConfigSource,
  1872. // and google.api.Service
  1873. OldConfig googleapi.RawMessage `json:"oldConfig,omitempty"`
  1874. // ForceSendFields is a list of field names (e.g. "NewConfig") to
  1875. // unconditionally include in API requests. By default, fields with
  1876. // empty values are omitted from API requests. However, any non-pointer,
  1877. // non-interface field appearing in ForceSendFields will be sent to the
  1878. // server regardless of whether the field is empty or not. This may be
  1879. // used to include empty fields in Patch requests.
  1880. ForceSendFields []string `json:"-"`
  1881. // NullFields is a list of field names (e.g. "NewConfig") to include in
  1882. // API requests with the JSON null value. By default, fields with empty
  1883. // values are omitted from API requests. However, any field with an
  1884. // empty value appearing in NullFields will be sent to the server as
  1885. // null. It is an error if a field in this list has a non-empty value.
  1886. // This may be used to include null fields in Patch requests.
  1887. NullFields []string `json:"-"`
  1888. }
  1889. func (s *GenerateConfigReportRequest) MarshalJSON() ([]byte, error) {
  1890. type NoMethod GenerateConfigReportRequest
  1891. raw := NoMethod(*s)
  1892. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1893. }
  1894. // GenerateConfigReportResponse: Response message for
  1895. // GenerateConfigReport method.
  1896. type GenerateConfigReportResponse struct {
  1897. // ChangeReports: list of ChangeReport, each corresponding to comparison
  1898. // between two
  1899. // service configurations.
  1900. ChangeReports []*ChangeReport `json:"changeReports,omitempty"`
  1901. // Diagnostics: Errors / Linter warnings associated with the service
  1902. // definition this
  1903. // report
  1904. // belongs to.
  1905. Diagnostics []*Diagnostic `json:"diagnostics,omitempty"`
  1906. // Id: ID of the service configuration this report belongs to.
  1907. Id string `json:"id,omitempty"`
  1908. // ServiceName: Name of the service this report belongs to.
  1909. ServiceName string `json:"serviceName,omitempty"`
  1910. // ServerResponse contains the HTTP response code and headers from the
  1911. // server.
  1912. googleapi.ServerResponse `json:"-"`
  1913. // ForceSendFields is a list of field names (e.g. "ChangeReports") to
  1914. // unconditionally include in API requests. By default, fields with
  1915. // empty values are omitted from API requests. However, any non-pointer,
  1916. // non-interface field appearing in ForceSendFields will be sent to the
  1917. // server regardless of whether the field is empty or not. This may be
  1918. // used to include empty fields in Patch requests.
  1919. ForceSendFields []string `json:"-"`
  1920. // NullFields is a list of field names (e.g. "ChangeReports") to include
  1921. // in API requests with the JSON null value. By default, fields with
  1922. // empty values are omitted from API requests. However, any field with
  1923. // an empty value appearing in NullFields will be sent to the server as
  1924. // null. It is an error if a field in this list has a non-empty value.
  1925. // This may be used to include null fields in Patch requests.
  1926. NullFields []string `json:"-"`
  1927. }
  1928. func (s *GenerateConfigReportResponse) MarshalJSON() ([]byte, error) {
  1929. type NoMethod GenerateConfigReportResponse
  1930. raw := NoMethod(*s)
  1931. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1932. }
  1933. // GetIamPolicyRequest: Request message for `GetIamPolicy` method.
  1934. type GetIamPolicyRequest struct {
  1935. }
  1936. // Http: Defines the HTTP configuration for an API service. It contains
  1937. // a list of
  1938. // HttpRule, each specifying the mapping of an RPC method
  1939. // to one or more HTTP REST API methods.
  1940. type Http struct {
  1941. // FullyDecodeReservedExpansion: When set to true, URL path parmeters
  1942. // will be fully URI-decoded except in
  1943. // cases of single segment matches in reserved expansion, where "%2F"
  1944. // will be
  1945. // left encoded.
  1946. //
  1947. // The default behavior is to not decode RFC 6570 reserved characters in
  1948. // multi
  1949. // segment matches.
  1950. FullyDecodeReservedExpansion bool `json:"fullyDecodeReservedExpansion,omitempty"`
  1951. // Rules: A list of HTTP configuration rules that apply to individual
  1952. // API methods.
  1953. //
  1954. // **NOTE:** All service configuration rules follow "last one wins"
  1955. // order.
  1956. Rules []*HttpRule `json:"rules,omitempty"`
  1957. // ForceSendFields is a list of field names (e.g.
  1958. // "FullyDecodeReservedExpansion") to unconditionally include in API
  1959. // requests. By default, fields with empty values are omitted from API
  1960. // requests. However, any non-pointer, non-interface field appearing in
  1961. // ForceSendFields will be sent to the server regardless of whether the
  1962. // field is empty or not. This may be used to include empty fields in
  1963. // Patch requests.
  1964. ForceSendFields []string `json:"-"`
  1965. // NullFields is a list of field names (e.g.
  1966. // "FullyDecodeReservedExpansion") to include in API requests with the
  1967. // JSON null value. By default, fields with empty values are omitted
  1968. // from API requests. However, any field with an empty value appearing
  1969. // in NullFields will be sent to the server as null. It is an error if a
  1970. // field in this list has a non-empty value. This may be used to include
  1971. // null fields in Patch requests.
  1972. NullFields []string `json:"-"`
  1973. }
  1974. func (s *Http) MarshalJSON() ([]byte, error) {
  1975. type NoMethod Http
  1976. raw := NoMethod(*s)
  1977. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1978. }
  1979. // HttpRule: `HttpRule` defines the mapping of an RPC method to one or
  1980. // more HTTP
  1981. // REST API methods. The mapping specifies how different portions of the
  1982. // RPC
  1983. // request message are mapped to URL path, URL query parameters,
  1984. // and
  1985. // HTTP request body. The mapping is typically specified as
  1986. // an
  1987. // `google.api.http` annotation on the RPC method,
  1988. // see "google/api/annotations.proto" for details.
  1989. //
  1990. // The mapping consists of a field specifying the path template
  1991. // and
  1992. // method kind. The path template can refer to fields in the
  1993. // request
  1994. // message, as in the example below which describes a REST GET
  1995. // operation on a resource collection of messages:
  1996. //
  1997. //
  1998. // service Messaging {
  1999. // rpc GetMessage(GetMessageRequest) returns (Message) {
  2000. // option (google.api.http).get =
  2001. // "/v1/messages/{message_id}/{sub.subfield}";
  2002. // }
  2003. // }
  2004. // message GetMessageRequest {
  2005. // message SubMessage {
  2006. // string subfield = 1;
  2007. // }
  2008. // string message_id = 1; // mapped to the URL
  2009. // SubMessage sub = 2; // `sub.subfield` is url-mapped
  2010. // }
  2011. // message Message {
  2012. // string text = 1; // content of the resource
  2013. // }
  2014. //
  2015. // The same http annotation can alternatively be expressed inside
  2016. // the
  2017. // `GRPC API Configuration` YAML file.
  2018. //
  2019. // http:
  2020. // rules:
  2021. // - selector: <proto_package_name>.Messaging.GetMessage
  2022. // get: /v1/messages/{message_id}/{sub.subfield}
  2023. //
  2024. // This definition enables an automatic, bidrectional mapping of
  2025. // HTTP
  2026. // JSON to RPC. Example:
  2027. //
  2028. // HTTP | RPC
  2029. // -----|-----
  2030. // `GET /v1/messages/123456/foo` | `GetMessage(message_id: "123456"
  2031. // sub: SubMessage(subfield: "foo"))`
  2032. //
  2033. // In general, not only fields but also field paths can be
  2034. // referenced
  2035. // from a path pattern. Fields mapped to the path pattern cannot
  2036. // be
  2037. // repeated and must have a primitive (non-message) type.
  2038. //
  2039. // Any fields in the request message which are not bound by the
  2040. // path
  2041. // pattern automatically become (optional) HTTP query
  2042. // parameters. Assume the following definition of the request
  2043. // message:
  2044. //
  2045. //
  2046. // service Messaging {
  2047. // rpc GetMessage(GetMessageRequest) returns (Message) {
  2048. // option (google.api.http).get = "/v1/messages/{message_id}";
  2049. // }
  2050. // }
  2051. // message GetMessageRequest {
  2052. // message SubMessage {
  2053. // string subfield = 1;
  2054. // }
  2055. // string message_id = 1; // mapped to the URL
  2056. // int64 revision = 2; // becomes a parameter
  2057. // SubMessage sub = 3; // `sub.subfield` becomes a parameter
  2058. // }
  2059. //
  2060. //
  2061. // This enables a HTTP JSON to RPC mapping as below:
  2062. //
  2063. // HTTP | RPC
  2064. // -----|-----
  2065. // `GET /v1/messages/123456?revision=2&sub.subfield=foo` |
  2066. // `GetMessage(message_id: "123456" revision: 2 sub:
  2067. // SubMessage(subfield: "foo"))`
  2068. //
  2069. // Note that fields which are mapped to HTTP parameters must have
  2070. // a
  2071. // primitive type or a repeated primitive type. Message types are
  2072. // not
  2073. // allowed. In the case of a repeated type, the parameter can
  2074. // be
  2075. // repeated in the URL, as in `...?param=A&param=B`.
  2076. //
  2077. // For HTTP method kinds which allow a request body, the `body`
  2078. // field
  2079. // specifies the mapping. Consider a REST update method on the
  2080. // message resource collection:
  2081. //
  2082. //
  2083. // service Messaging {
  2084. // rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
  2085. // option (google.api.http) = {
  2086. // put: "/v1/messages/{message_id}"
  2087. // body: "message"
  2088. // };
  2089. // }
  2090. // }
  2091. // message UpdateMessageRequest {
  2092. // string message_id = 1; // mapped to the URL
  2093. // Message message = 2; // mapped to the body
  2094. // }
  2095. //
  2096. //
  2097. // The following HTTP JSON to RPC mapping is enabled, where
  2098. // the
  2099. // representation of the JSON in the request body is determined
  2100. // by
  2101. // protos JSON encoding:
  2102. //
  2103. // HTTP | RPC
  2104. // -----|-----
  2105. // `PUT /v1/messages/123456 { "text": "Hi!" }` |
  2106. // `UpdateMessage(message_id: "123456" message { text: "Hi!" })`
  2107. //
  2108. // The special name `*` can be used in the body mapping to define
  2109. // that
  2110. // every field not bound by the path template should be mapped to
  2111. // the
  2112. // request body. This enables the following alternative definition
  2113. // of
  2114. // the update method:
  2115. //
  2116. // service Messaging {
  2117. // rpc UpdateMessage(Message) returns (Message) {
  2118. // option (google.api.http) = {
  2119. // put: "/v1/messages/{message_id}"
  2120. // body: "*"
  2121. // };
  2122. // }
  2123. // }
  2124. // message Message {
  2125. // string message_id = 1;
  2126. // string text = 2;
  2127. // }
  2128. //
  2129. //
  2130. // The following HTTP JSON to RPC mapping is enabled:
  2131. //
  2132. // HTTP | RPC
  2133. // -----|-----
  2134. // `PUT /v1/messages/123456 { "text": "Hi!" }` |
  2135. // `UpdateMessage(message_id: "123456" text: "Hi!")`
  2136. //
  2137. // Note that when using `*` in the body mapping, it is not possible
  2138. // to
  2139. // have HTTP parameters, as all fields not bound by the path end in
  2140. // the body. This makes this option more rarely used in practice
  2141. // of
  2142. // defining REST APIs. The common usage of `*` is in custom
  2143. // methods
  2144. // which don't use the URL at all for transferring data.
  2145. //
  2146. // It is possible to define multiple HTTP methods for one RPC by
  2147. // using
  2148. // the `additional_bindings` option. Example:
  2149. //
  2150. // service Messaging {
  2151. // rpc GetMessage(GetMessageRequest) returns (Message) {
  2152. // option (google.api.http) = {
  2153. // get: "/v1/messages/{message_id}"
  2154. // additional_bindings {
  2155. // get: "/v1/users/{user_id}/messages/{message_id}"
  2156. // }
  2157. // };
  2158. // }
  2159. // }
  2160. // message GetMessageRequest {
  2161. // string message_id = 1;
  2162. // string user_id = 2;
  2163. // }
  2164. //
  2165. //
  2166. // This enables the following two alternative HTTP JSON to
  2167. // RPC
  2168. // mappings:
  2169. //
  2170. // HTTP | RPC
  2171. // -----|-----
  2172. // `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
  2173. // `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me"
  2174. // message_id: "123456")`
  2175. //
  2176. // # Rules for HTTP mapping
  2177. //
  2178. // The rules for mapping HTTP path, query parameters, and body fields
  2179. // to the request message are as follows:
  2180. //
  2181. // 1. The `body` field specifies either `*` or a field path, or is
  2182. // omitted. If omitted, it indicates there is no HTTP request
  2183. // body.
  2184. // 2. Leaf fields (recursive expansion of nested messages in the
  2185. // request) can be classified into three types:
  2186. // (a) Matched in the URL template.
  2187. // (b) Covered by body (if body is `*`, everything except (a)
  2188. // fields;
  2189. // else everything under the body field)
  2190. // (c) All other fields.
  2191. // 3. URL query parameters found in the HTTP request are mapped to (c)
  2192. // fields.
  2193. // 4. Any body sent with an HTTP request can contain only (b)
  2194. // fields.
  2195. //
  2196. // The syntax of the path template is as follows:
  2197. //
  2198. // Template = "/" Segments [ Verb ] ;
  2199. // Segments = Segment { "/" Segment } ;
  2200. // Segment = "*" | "**" | LITERAL | Variable ;
  2201. // Variable = "{" FieldPath [ "=" Segments ] "}" ;
  2202. // FieldPath = IDENT { "." IDENT } ;
  2203. // Verb = ":" LITERAL ;
  2204. //
  2205. // The syntax `*` matches a single path segment. The syntax `**` matches
  2206. // zero
  2207. // or more path segments, which must be the last part of the path except
  2208. // the
  2209. // `Verb`. The syntax `LITERAL` matches literal text in the path.
  2210. //
  2211. // The syntax `Variable` matches part of the URL path as specified by
  2212. // its
  2213. // template. A variable template must not contain other variables. If a
  2214. // variable
  2215. // matches a single path segment, its template may be omitted, e.g.
  2216. // `{var}`
  2217. // is equivalent to `{var=*}`.
  2218. //
  2219. // If a variable contains exactly one path segment, such as "{var}"
  2220. // or
  2221. // "{var=*}", when such a variable is expanded into a URL path, all
  2222. // characters
  2223. // except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables show up
  2224. // in the
  2225. // Discovery Document as `{var}`.
  2226. //
  2227. // If a variable contains one or more path segments, such as
  2228. // "{var=foo/*}"
  2229. // or "{var=**}", when such a variable is expanded into a URL path,
  2230. // all
  2231. // characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such
  2232. // variables
  2233. // show up in the Discovery Document as `{+var}`.
  2234. //
  2235. // NOTE: While the single segment variable matches the semantics of
  2236. // [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2
  2237. // Simple String Expansion, the multi segment variable **does not**
  2238. // match
  2239. // RFC 6570 Reserved Expansion. The reason is that the Reserved
  2240. // Expansion
  2241. // does not expand special characters like `?` and `#`, which would
  2242. // lead
  2243. // to invalid URLs.
  2244. //
  2245. // NOTE: the field paths in variables and in the `body` must not refer
  2246. // to
  2247. // repeated fields or map fields.
  2248. type HttpRule struct {
  2249. // AdditionalBindings: Additional HTTP bindings for the selector. Nested
  2250. // bindings must
  2251. // not contain an `additional_bindings` field themselves (that is,
  2252. // the nesting may only be one level deep).
  2253. AdditionalBindings []*HttpRule `json:"additionalBindings,omitempty"`
  2254. // Body: The name of the request field whose value is mapped to the HTTP
  2255. // body, or
  2256. // `*` for mapping all fields not captured by the path pattern to the
  2257. // HTTP
  2258. // body. NOTE: the referred field must not be a repeated field and must
  2259. // be
  2260. // present at the top-level of request message type.
  2261. Body string `json:"body,omitempty"`
  2262. // Custom: The custom pattern is used for specifying an HTTP method that
  2263. // is not
  2264. // included in the `pattern` field, such as HEAD, or "*" to leave
  2265. // the
  2266. // HTTP method unspecified for this rule. The wild-card rule is
  2267. // useful
  2268. // for services that provide content to Web (HTML) clients.
  2269. Custom *CustomHttpPattern `json:"custom,omitempty"`
  2270. // Delete: Used for deleting a resource.
  2271. Delete string `json:"delete,omitempty"`
  2272. // Get: Used for listing and getting information about resources.
  2273. Get string `json:"get,omitempty"`
  2274. // MediaDownload: Use this only for Scotty Requests. Do not use this for
  2275. // bytestream methods.
  2276. // For media support, add instead [][google.bytestream.RestByteStream]
  2277. // as an
  2278. // API to your configuration.
  2279. MediaDownload *MediaDownload `json:"mediaDownload,omitempty"`
  2280. // MediaUpload: Use this only for Scotty Requests. Do not use this for
  2281. // media support using
  2282. // Bytestream, add instead
  2283. // [][google.bytestream.RestByteStream] as an API to your
  2284. // configuration for Bytestream methods.
  2285. MediaUpload *MediaUpload `json:"mediaUpload,omitempty"`
  2286. // Patch: Used for updating a resource.
  2287. Patch string `json:"patch,omitempty"`
  2288. // Post: Used for creating a resource.
  2289. Post string `json:"post,omitempty"`
  2290. // Put: Used for updating a resource.
  2291. Put string `json:"put,omitempty"`
  2292. // Selector: Selects methods to which this rule applies.
  2293. //
  2294. // Refer to selector for syntax details.
  2295. Selector string `json:"selector,omitempty"`
  2296. // ForceSendFields is a list of field names (e.g. "AdditionalBindings")
  2297. // to unconditionally include in API requests. By default, fields with
  2298. // empty values are omitted from API requests. However, any non-pointer,
  2299. // non-interface field appearing in ForceSendFields will be sent to the
  2300. // server regardless of whether the field is empty or not. This may be
  2301. // used to include empty fields in Patch requests.
  2302. ForceSendFields []string `json:"-"`
  2303. // NullFields is a list of field names (e.g. "AdditionalBindings") to
  2304. // include in API requests with the JSON null value. By default, fields
  2305. // with empty values are omitted from API requests. However, any field
  2306. // with an empty value appearing in NullFields will be sent to the
  2307. // server as null. It is an error if a field in this list has a
  2308. // non-empty value. This may be used to include null fields in Patch
  2309. // requests.
  2310. NullFields []string `json:"-"`
  2311. }
  2312. func (s *HttpRule) MarshalJSON() ([]byte, error) {
  2313. type NoMethod HttpRule
  2314. raw := NoMethod(*s)
  2315. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2316. }
  2317. // LabelDescriptor: A description of a label.
  2318. type LabelDescriptor struct {
  2319. // Description: A human-readable description for the label.
  2320. Description string `json:"description,omitempty"`
  2321. // Key: The label key.
  2322. Key string `json:"key,omitempty"`
  2323. // ValueType: The type of data that can be assigned to the label.
  2324. //
  2325. // Possible values:
  2326. // "STRING" - A variable-length string. This is the default.
  2327. // "BOOL" - Boolean; true or false.
  2328. // "INT64" - A 64-bit signed integer.
  2329. ValueType string `json:"valueType,omitempty"`
  2330. // ForceSendFields is a list of field names (e.g. "Description") to
  2331. // unconditionally include in API requests. By default, fields with
  2332. // empty values are omitted from API requests. However, any non-pointer,
  2333. // non-interface field appearing in ForceSendFields will be sent to the
  2334. // server regardless of whether the field is empty or not. This may be
  2335. // used to include empty fields in Patch requests.
  2336. ForceSendFields []string `json:"-"`
  2337. // NullFields is a list of field names (e.g. "Description") to include
  2338. // in API requests with the JSON null value. By default, fields with
  2339. // empty values are omitted from API requests. However, any field with
  2340. // an empty value appearing in NullFields will be sent to the server as
  2341. // null. It is an error if a field in this list has a non-empty value.
  2342. // This may be used to include null fields in Patch requests.
  2343. NullFields []string `json:"-"`
  2344. }
  2345. func (s *LabelDescriptor) MarshalJSON() ([]byte, error) {
  2346. type NoMethod LabelDescriptor
  2347. raw := NoMethod(*s)
  2348. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2349. }
  2350. // ListOperationsResponse: The response message for
  2351. // Operations.ListOperations.
  2352. type ListOperationsResponse struct {
  2353. // NextPageToken: The standard List next-page token.
  2354. NextPageToken string `json:"nextPageToken,omitempty"`
  2355. // Operations: A list of operations that matches the specified filter in
  2356. // the request.
  2357. Operations []*Operation `json:"operations,omitempty"`
  2358. // ServerResponse contains the HTTP response code and headers from the
  2359. // server.
  2360. googleapi.ServerResponse `json:"-"`
  2361. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  2362. // unconditionally include in API requests. By default, fields with
  2363. // empty values are omitted from API requests. However, any non-pointer,
  2364. // non-interface field appearing in ForceSendFields will be sent to the
  2365. // server regardless of whether the field is empty or not. This may be
  2366. // used to include empty fields in Patch requests.
  2367. ForceSendFields []string `json:"-"`
  2368. // NullFields is a list of field names (e.g. "NextPageToken") to include
  2369. // in API requests with the JSON null value. By default, fields with
  2370. // empty values are omitted from API requests. However, any field with
  2371. // an empty value appearing in NullFields will be sent to the server as
  2372. // null. It is an error if a field in this list has a non-empty value.
  2373. // This may be used to include null fields in Patch requests.
  2374. NullFields []string `json:"-"`
  2375. }
  2376. func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
  2377. type NoMethod ListOperationsResponse
  2378. raw := NoMethod(*s)
  2379. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2380. }
  2381. // ListServiceConfigsResponse: Response message for ListServiceConfigs
  2382. // method.
  2383. type ListServiceConfigsResponse struct {
  2384. // NextPageToken: The token of the next page of results.
  2385. NextPageToken string `json:"nextPageToken,omitempty"`
  2386. // ServiceConfigs: The list of service configuration resources.
  2387. ServiceConfigs []*Service `json:"serviceConfigs,omitempty"`
  2388. // ServerResponse contains the HTTP response code and headers from the
  2389. // server.
  2390. googleapi.ServerResponse `json:"-"`
  2391. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  2392. // unconditionally include in API requests. By default, fields with
  2393. // empty values are omitted from API requests. However, any non-pointer,
  2394. // non-interface field appearing in ForceSendFields will be sent to the
  2395. // server regardless of whether the field is empty or not. This may be
  2396. // used to include empty fields in Patch requests.
  2397. ForceSendFields []string `json:"-"`
  2398. // NullFields is a list of field names (e.g. "NextPageToken") to include
  2399. // in API requests with the JSON null value. By default, fields with
  2400. // empty values are omitted from API requests. However, any field with
  2401. // an empty value appearing in NullFields will be sent to the server as
  2402. // null. It is an error if a field in this list has a non-empty value.
  2403. // This may be used to include null fields in Patch requests.
  2404. NullFields []string `json:"-"`
  2405. }
  2406. func (s *ListServiceConfigsResponse) MarshalJSON() ([]byte, error) {
  2407. type NoMethod ListServiceConfigsResponse
  2408. raw := NoMethod(*s)
  2409. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2410. }
  2411. // ListServiceRolloutsResponse: Response message for ListServiceRollouts
  2412. // method.
  2413. type ListServiceRolloutsResponse struct {
  2414. // NextPageToken: The token of the next page of results.
  2415. NextPageToken string `json:"nextPageToken,omitempty"`
  2416. // Rollouts: The list of rollout resources.
  2417. Rollouts []*Rollout `json:"rollouts,omitempty"`
  2418. // ServerResponse contains the HTTP response code and headers from the
  2419. // server.
  2420. googleapi.ServerResponse `json:"-"`
  2421. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  2422. // unconditionally include in API requests. By default, fields with
  2423. // empty values are omitted from API requests. However, any non-pointer,
  2424. // non-interface field appearing in ForceSendFields will be sent to the
  2425. // server regardless of whether the field is empty or not. This may be
  2426. // used to include empty fields in Patch requests.
  2427. ForceSendFields []string `json:"-"`
  2428. // NullFields is a list of field names (e.g. "NextPageToken") to include
  2429. // in API requests with the JSON null value. By default, fields with
  2430. // empty values are omitted from API requests. However, any field with
  2431. // an empty value appearing in NullFields will be sent to the server as
  2432. // null. It is an error if a field in this list has a non-empty value.
  2433. // This may be used to include null fields in Patch requests.
  2434. NullFields []string `json:"-"`
  2435. }
  2436. func (s *ListServiceRolloutsResponse) MarshalJSON() ([]byte, error) {
  2437. type NoMethod ListServiceRolloutsResponse
  2438. raw := NoMethod(*s)
  2439. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2440. }
  2441. // ListServicesResponse: Response message for `ListServices` method.
  2442. type ListServicesResponse struct {
  2443. // NextPageToken: Token that can be passed to `ListServices` to resume a
  2444. // paginated query.
  2445. NextPageToken string `json:"nextPageToken,omitempty"`
  2446. // Services: The returned services will only have the name field set.
  2447. Services []*ManagedService `json:"services,omitempty"`
  2448. // ServerResponse contains the HTTP response code and headers from the
  2449. // server.
  2450. googleapi.ServerResponse `json:"-"`
  2451. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  2452. // unconditionally include in API requests. By default, fields with
  2453. // empty values are omitted from API requests. However, any non-pointer,
  2454. // non-interface field appearing in ForceSendFields will be sent to the
  2455. // server regardless of whether the field is empty or not. This may be
  2456. // used to include empty fields in Patch requests.
  2457. ForceSendFields []string `json:"-"`
  2458. // NullFields is a list of field names (e.g. "NextPageToken") to include
  2459. // in API requests with the JSON null value. By default, fields with
  2460. // empty values are omitted from API requests. However, any field with
  2461. // an empty value appearing in NullFields will be sent to the server as
  2462. // null. It is an error if a field in this list has a non-empty value.
  2463. // This may be used to include null fields in Patch requests.
  2464. NullFields []string `json:"-"`
  2465. }
  2466. func (s *ListServicesResponse) MarshalJSON() ([]byte, error) {
  2467. type NoMethod ListServicesResponse
  2468. raw := NoMethod(*s)
  2469. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2470. }
  2471. // LogDescriptor: A description of a log type. Example in YAML format:
  2472. //
  2473. // - name: library.googleapis.com/activity_history
  2474. // description: The history of borrowing and returning library
  2475. // items.
  2476. // display_name: Activity
  2477. // labels:
  2478. // - key: /customer_id
  2479. // description: Identifier of a library customer
  2480. type LogDescriptor struct {
  2481. // Description: A human-readable description of this log. This
  2482. // information appears in
  2483. // the documentation and can contain details.
  2484. Description string `json:"description,omitempty"`
  2485. // DisplayName: The human-readable name for this log. This information
  2486. // appears on
  2487. // the user interface and should be concise.
  2488. DisplayName string `json:"displayName,omitempty"`
  2489. // Labels: The set of labels that are available to describe a specific
  2490. // log entry.
  2491. // Runtime requests that contain labels not specified here
  2492. // are
  2493. // considered invalid.
  2494. Labels []*LabelDescriptor `json:"labels,omitempty"`
  2495. // Name: The name of the log. It must be less than 512 characters long
  2496. // and can
  2497. // include the following characters: upper- and lower-case
  2498. // alphanumeric
  2499. // characters [A-Za-z0-9], and punctuation characters including
  2500. // slash, underscore, hyphen, period [/_-.].
  2501. Name string `json:"name,omitempty"`
  2502. // ForceSendFields is a list of field names (e.g. "Description") to
  2503. // unconditionally include in API requests. By default, fields with
  2504. // empty values are omitted from API requests. However, any non-pointer,
  2505. // non-interface field appearing in ForceSendFields will be sent to the
  2506. // server regardless of whether the field is empty or not. This may be
  2507. // used to include empty fields in Patch requests.
  2508. ForceSendFields []string `json:"-"`
  2509. // NullFields is a list of field names (e.g. "Description") to include
  2510. // in API requests with the JSON null value. By default, fields with
  2511. // empty values are omitted from API requests. However, any field with
  2512. // an empty value appearing in NullFields will be sent to the server as
  2513. // null. It is an error if a field in this list has a non-empty value.
  2514. // This may be used to include null fields in Patch requests.
  2515. NullFields []string `json:"-"`
  2516. }
  2517. func (s *LogDescriptor) MarshalJSON() ([]byte, error) {
  2518. type NoMethod LogDescriptor
  2519. raw := NoMethod(*s)
  2520. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2521. }
  2522. // Logging: Logging configuration of the service.
  2523. //
  2524. // The following example shows how to configure logs to be sent to
  2525. // the
  2526. // producer and consumer projects. In the example, the
  2527. // `activity_history`
  2528. // log is sent to both the producer and consumer projects, whereas
  2529. // the
  2530. // `purchase_history` log is only sent to the producer project.
  2531. //
  2532. // monitored_resources:
  2533. // - type: library.googleapis.com/branch
  2534. // labels:
  2535. // - key: /city
  2536. // description: The city where the library branch is located
  2537. // in.
  2538. // - key: /name
  2539. // description: The name of the branch.
  2540. // logs:
  2541. // - name: activity_history
  2542. // labels:
  2543. // - key: /customer_id
  2544. // - name: purchase_history
  2545. // logging:
  2546. // producer_destinations:
  2547. // - monitored_resource: library.googleapis.com/branch
  2548. // logs:
  2549. // - activity_history
  2550. // - purchase_history
  2551. // consumer_destinations:
  2552. // - monitored_resource: library.googleapis.com/branch
  2553. // logs:
  2554. // - activity_history
  2555. type Logging struct {
  2556. // ConsumerDestinations: Logging configurations for sending logs to the
  2557. // consumer project.
  2558. // There can be multiple consumer destinations, each one must have
  2559. // a
  2560. // different monitored resource type. A log can be used in at most
  2561. // one consumer destination.
  2562. ConsumerDestinations []*LoggingDestination `json:"consumerDestinations,omitempty"`
  2563. // ProducerDestinations: Logging configurations for sending logs to the
  2564. // producer project.
  2565. // There can be multiple producer destinations, each one must have
  2566. // a
  2567. // different monitored resource type. A log can be used in at most
  2568. // one producer destination.
  2569. ProducerDestinations []*LoggingDestination `json:"producerDestinations,omitempty"`
  2570. // ForceSendFields is a list of field names (e.g.
  2571. // "ConsumerDestinations") to unconditionally include in API requests.
  2572. // By default, fields with empty values are omitted from API requests.
  2573. // However, any non-pointer, non-interface field appearing in
  2574. // ForceSendFields will be sent to the server regardless of whether the
  2575. // field is empty or not. This may be used to include empty fields in
  2576. // Patch requests.
  2577. ForceSendFields []string `json:"-"`
  2578. // NullFields is a list of field names (e.g. "ConsumerDestinations") to
  2579. // include in API requests with the JSON null value. By default, fields
  2580. // with empty values are omitted from API requests. However, any field
  2581. // with an empty value appearing in NullFields will be sent to the
  2582. // server as null. It is an error if a field in this list has a
  2583. // non-empty value. This may be used to include null fields in Patch
  2584. // requests.
  2585. NullFields []string `json:"-"`
  2586. }
  2587. func (s *Logging) MarshalJSON() ([]byte, error) {
  2588. type NoMethod Logging
  2589. raw := NoMethod(*s)
  2590. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2591. }
  2592. // LoggingDestination: Configuration of a specific logging destination
  2593. // (the producer project
  2594. // or the consumer project).
  2595. type LoggingDestination struct {
  2596. // Logs: Names of the logs to be sent to this destination. Each name
  2597. // must
  2598. // be defined in the Service.logs section. If the log name is
  2599. // not a domain scoped name, it will be automatically prefixed with
  2600. // the service name followed by "/".
  2601. Logs []string `json:"logs,omitempty"`
  2602. // MonitoredResource: The monitored resource type. The type must be
  2603. // defined in the
  2604. // Service.monitored_resources section.
  2605. MonitoredResource string `json:"monitoredResource,omitempty"`
  2606. // ForceSendFields is a list of field names (e.g. "Logs") to
  2607. // unconditionally include in API requests. By default, fields with
  2608. // empty values are omitted from API requests. However, any non-pointer,
  2609. // non-interface field appearing in ForceSendFields will be sent to the
  2610. // server regardless of whether the field is empty or not. This may be
  2611. // used to include empty fields in Patch requests.
  2612. ForceSendFields []string `json:"-"`
  2613. // NullFields is a list of field names (e.g. "Logs") to include in API
  2614. // requests with the JSON null value. By default, fields with empty
  2615. // values are omitted from API requests. However, any field with an
  2616. // empty value appearing in NullFields will be sent to the server as
  2617. // null. It is an error if a field in this list has a non-empty value.
  2618. // This may be used to include null fields in Patch requests.
  2619. NullFields []string `json:"-"`
  2620. }
  2621. func (s *LoggingDestination) MarshalJSON() ([]byte, error) {
  2622. type NoMethod LoggingDestination
  2623. raw := NoMethod(*s)
  2624. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2625. }
  2626. // ManagedService: The full representation of a Service that is managed
  2627. // by
  2628. // Google Service Management.
  2629. type ManagedService struct {
  2630. // ProducerProjectId: ID of the project that produces and owns this
  2631. // service.
  2632. ProducerProjectId string `json:"producerProjectId,omitempty"`
  2633. // ServiceName: The name of the service. See the
  2634. // [overview](/service-management/overview)
  2635. // for naming requirements.
  2636. ServiceName string `json:"serviceName,omitempty"`
  2637. // ServerResponse contains the HTTP response code and headers from the
  2638. // server.
  2639. googleapi.ServerResponse `json:"-"`
  2640. // ForceSendFields is a list of field names (e.g. "ProducerProjectId")
  2641. // to unconditionally include in API requests. By default, fields with
  2642. // empty values are omitted from API requests. However, any non-pointer,
  2643. // non-interface field appearing in ForceSendFields will be sent to the
  2644. // server regardless of whether the field is empty or not. This may be
  2645. // used to include empty fields in Patch requests.
  2646. ForceSendFields []string `json:"-"`
  2647. // NullFields is a list of field names (e.g. "ProducerProjectId") to
  2648. // include in API requests with the JSON null value. By default, fields
  2649. // with empty values are omitted from API requests. However, any field
  2650. // with an empty value appearing in NullFields will be sent to the
  2651. // server as null. It is an error if a field in this list has a
  2652. // non-empty value. This may be used to include null fields in Patch
  2653. // requests.
  2654. NullFields []string `json:"-"`
  2655. }
  2656. func (s *ManagedService) MarshalJSON() ([]byte, error) {
  2657. type NoMethod ManagedService
  2658. raw := NoMethod(*s)
  2659. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2660. }
  2661. // MediaDownload: Defines the Media configuration for a service in case
  2662. // of a download.
  2663. // Use this only for Scotty Requests. Do not use this for media support
  2664. // using
  2665. // Bytestream, add instead [][google.bytestream.RestByteStream] as an
  2666. // API to
  2667. // your configuration for Bytestream methods.
  2668. type MediaDownload struct {
  2669. // CompleteNotification: A boolean that determines whether a
  2670. // notification for the completion of a
  2671. // download should be sent to the backend.
  2672. CompleteNotification bool `json:"completeNotification,omitempty"`
  2673. // DownloadService: DO NOT USE FIELDS BELOW THIS LINE UNTIL THIS WARNING
  2674. // IS REMOVED.
  2675. //
  2676. // Specify name of the download service if one is used for download.
  2677. DownloadService string `json:"downloadService,omitempty"`
  2678. // Dropzone: Name of the Scotty dropzone to use for the current API.
  2679. Dropzone string `json:"dropzone,omitempty"`
  2680. // Enabled: Whether download is enabled.
  2681. Enabled bool `json:"enabled,omitempty"`
  2682. // MaxDirectDownloadSize: Optional maximum acceptable size for direct
  2683. // download.
  2684. // The size is specified in bytes.
  2685. MaxDirectDownloadSize int64 `json:"maxDirectDownloadSize,omitempty,string"`
  2686. // UseDirectDownload: A boolean that determines if direct download from
  2687. // ESF should be used for
  2688. // download of this media.
  2689. UseDirectDownload bool `json:"useDirectDownload,omitempty"`
  2690. // ForceSendFields is a list of field names (e.g.
  2691. // "CompleteNotification") to unconditionally include in API requests.
  2692. // By default, fields with empty values are omitted from API requests.
  2693. // However, any non-pointer, non-interface field appearing in
  2694. // ForceSendFields will be sent to the server regardless of whether the
  2695. // field is empty or not. This may be used to include empty fields in
  2696. // Patch requests.
  2697. ForceSendFields []string `json:"-"`
  2698. // NullFields is a list of field names (e.g. "CompleteNotification") to
  2699. // include in API requests with the JSON null value. By default, fields
  2700. // with empty values are omitted from API requests. However, any field
  2701. // with an empty value appearing in NullFields will be sent to the
  2702. // server as null. It is an error if a field in this list has a
  2703. // non-empty value. This may be used to include null fields in Patch
  2704. // requests.
  2705. NullFields []string `json:"-"`
  2706. }
  2707. func (s *MediaDownload) MarshalJSON() ([]byte, error) {
  2708. type NoMethod MediaDownload
  2709. raw := NoMethod(*s)
  2710. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2711. }
  2712. // MediaUpload: Defines the Media configuration for a service in case of
  2713. // an upload.
  2714. // Use this only for Scotty Requests. Do not use this for media support
  2715. // using
  2716. // Bytestream, add instead [][google.bytestream.RestByteStream] as an
  2717. // API to
  2718. // your configuration for Bytestream methods.
  2719. type MediaUpload struct {
  2720. // CompleteNotification: A boolean that determines whether a
  2721. // notification for the completion of an
  2722. // upload should be sent to the backend. These notifications will not be
  2723. // seen
  2724. // by the client and will not consume quota.
  2725. CompleteNotification bool `json:"completeNotification,omitempty"`
  2726. // Dropzone: Name of the Scotty dropzone to use for the current API.
  2727. Dropzone string `json:"dropzone,omitempty"`
  2728. // Enabled: Whether upload is enabled.
  2729. Enabled bool `json:"enabled,omitempty"`
  2730. // MaxSize: Optional maximum acceptable size for an upload.
  2731. // The size is specified in bytes.
  2732. MaxSize int64 `json:"maxSize,omitempty,string"`
  2733. // MimeTypes: An array of mimetype patterns. Esf will only accept
  2734. // uploads that match one
  2735. // of the given patterns.
  2736. MimeTypes []string `json:"mimeTypes,omitempty"`
  2737. // ProgressNotification: Whether to receive a notification for progress
  2738. // changes of media upload.
  2739. ProgressNotification bool `json:"progressNotification,omitempty"`
  2740. // StartNotification: Whether to receive a notification on the start of
  2741. // media upload.
  2742. StartNotification bool `json:"startNotification,omitempty"`
  2743. // UploadService: DO NOT USE FIELDS BELOW THIS LINE UNTIL THIS WARNING
  2744. // IS REMOVED.
  2745. //
  2746. // Specify name of the upload service if one is used for upload.
  2747. UploadService string `json:"uploadService,omitempty"`
  2748. // ForceSendFields is a list of field names (e.g.
  2749. // "CompleteNotification") to unconditionally include in API requests.
  2750. // By default, fields with empty values are omitted from API requests.
  2751. // However, any non-pointer, non-interface field appearing in
  2752. // ForceSendFields will be sent to the server regardless of whether the
  2753. // field is empty or not. This may be used to include empty fields in
  2754. // Patch requests.
  2755. ForceSendFields []string `json:"-"`
  2756. // NullFields is a list of field names (e.g. "CompleteNotification") to
  2757. // include in API requests with the JSON null value. By default, fields
  2758. // with empty values are omitted from API requests. However, any field
  2759. // with an empty value appearing in NullFields will be sent to the
  2760. // server as null. It is an error if a field in this list has a
  2761. // non-empty value. This may be used to include null fields in Patch
  2762. // requests.
  2763. NullFields []string `json:"-"`
  2764. }
  2765. func (s *MediaUpload) MarshalJSON() ([]byte, error) {
  2766. type NoMethod MediaUpload
  2767. raw := NoMethod(*s)
  2768. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2769. }
  2770. // Method: Method represents a method of an API interface.
  2771. type Method struct {
  2772. // Name: The simple name of this method.
  2773. Name string `json:"name,omitempty"`
  2774. // Options: Any metadata attached to the method.
  2775. Options []*Option `json:"options,omitempty"`
  2776. // RequestStreaming: If true, the request is streamed.
  2777. RequestStreaming bool `json:"requestStreaming,omitempty"`
  2778. // RequestTypeUrl: A URL of the input message type.
  2779. RequestTypeUrl string `json:"requestTypeUrl,omitempty"`
  2780. // ResponseStreaming: If true, the response is streamed.
  2781. ResponseStreaming bool `json:"responseStreaming,omitempty"`
  2782. // ResponseTypeUrl: The URL of the output message type.
  2783. ResponseTypeUrl string `json:"responseTypeUrl,omitempty"`
  2784. // Syntax: The source syntax of this method.
  2785. //
  2786. // Possible values:
  2787. // "SYNTAX_PROTO2" - Syntax `proto2`.
  2788. // "SYNTAX_PROTO3" - Syntax `proto3`.
  2789. Syntax string `json:"syntax,omitempty"`
  2790. // ForceSendFields is a list of field names (e.g. "Name") to
  2791. // unconditionally include in API requests. By default, fields with
  2792. // empty values are omitted from API requests. However, any non-pointer,
  2793. // non-interface field appearing in ForceSendFields will be sent to the
  2794. // server regardless of whether the field is empty or not. This may be
  2795. // used to include empty fields in Patch requests.
  2796. ForceSendFields []string `json:"-"`
  2797. // NullFields is a list of field names (e.g. "Name") to include in API
  2798. // requests with the JSON null value. By default, fields with empty
  2799. // values are omitted from API requests. However, any field with an
  2800. // empty value appearing in NullFields will be sent to the server as
  2801. // null. It is an error if a field in this list has a non-empty value.
  2802. // This may be used to include null fields in Patch requests.
  2803. NullFields []string `json:"-"`
  2804. }
  2805. func (s *Method) MarshalJSON() ([]byte, error) {
  2806. type NoMethod Method
  2807. raw := NoMethod(*s)
  2808. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2809. }
  2810. // MetricDescriptor: Defines a metric type and its schema. Once a metric
  2811. // descriptor is created,
  2812. // deleting or altering it stops data collection and makes the metric
  2813. // type's
  2814. // existing data unusable.
  2815. type MetricDescriptor struct {
  2816. // Description: A detailed description of the metric, which can be used
  2817. // in documentation.
  2818. Description string `json:"description,omitempty"`
  2819. // DisplayName: A concise name for the metric, which can be displayed in
  2820. // user interfaces.
  2821. // Use sentence case without an ending period, for example "Request
  2822. // count".
  2823. // This field is optional but it is recommended to be set for any
  2824. // metrics
  2825. // associated with user-visible concepts, such as Quota.
  2826. DisplayName string `json:"displayName,omitempty"`
  2827. // Labels: The set of labels that can be used to describe a
  2828. // specific
  2829. // instance of this metric type. For example,
  2830. // the
  2831. // `appengine.googleapis.com/http/server/response_latencies` metric
  2832. // type has a label for the HTTP response code, `response_code`, so
  2833. // you can look at latencies for successful responses or just
  2834. // for responses that failed.
  2835. Labels []*LabelDescriptor `json:"labels,omitempty"`
  2836. // MetricKind: Whether the metric records instantaneous values, changes
  2837. // to a value, etc.
  2838. // Some combinations of `metric_kind` and `value_type` might not be
  2839. // supported.
  2840. //
  2841. // Possible values:
  2842. // "METRIC_KIND_UNSPECIFIED" - Do not use this default value.
  2843. // "GAUGE" - An instantaneous measurement of a value.
  2844. // "DELTA" - The change in a value during a time interval.
  2845. // "CUMULATIVE" - A value accumulated over a time interval.
  2846. // Cumulative
  2847. // measurements in a time series should have the same start time
  2848. // and increasing end times, until an event resets the cumulative
  2849. // value to zero and sets a new start time for the following
  2850. // points.
  2851. MetricKind string `json:"metricKind,omitempty"`
  2852. // Name: The resource name of the metric descriptor.
  2853. Name string `json:"name,omitempty"`
  2854. // Type: The metric type, including its DNS name prefix. The type is
  2855. // not
  2856. // URL-encoded. All user-defined custom metric types have the DNS
  2857. // name
  2858. // `custom.googleapis.com`. Metric types should use a natural
  2859. // hierarchical
  2860. // grouping. For example:
  2861. //
  2862. // "custom.googleapis.com/invoice/paid/amount"
  2863. // "appengine.googleapis.com/http/server/response_latencies"
  2864. Type string `json:"type,omitempty"`
  2865. // Unit: The unit in which the metric value is reported. It is only
  2866. // applicable
  2867. // if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`.
  2868. // The
  2869. // supported units are a subset of [The Unified Code for Units
  2870. // of
  2871. // Measure](http://unitsofmeasure.org/ucum.html) standard:
  2872. //
  2873. // **Basic units (UNIT)**
  2874. //
  2875. // * `bit` bit
  2876. // * `By` byte
  2877. // * `s` second
  2878. // * `min` minute
  2879. // * `h` hour
  2880. // * `d` day
  2881. //
  2882. // **Prefixes (PREFIX)**
  2883. //
  2884. // * `k` kilo (10**3)
  2885. // * `M` mega (10**6)
  2886. // * `G` giga (10**9)
  2887. // * `T` tera (10**12)
  2888. // * `P` peta (10**15)
  2889. // * `E` exa (10**18)
  2890. // * `Z` zetta (10**21)
  2891. // * `Y` yotta (10**24)
  2892. // * `m` milli (10**-3)
  2893. // * `u` micro (10**-6)
  2894. // * `n` nano (10**-9)
  2895. // * `p` pico (10**-12)
  2896. // * `f` femto (10**-15)
  2897. // * `a` atto (10**-18)
  2898. // * `z` zepto (10**-21)
  2899. // * `y` yocto (10**-24)
  2900. // * `Ki` kibi (2**10)
  2901. // * `Mi` mebi (2**20)
  2902. // * `Gi` gibi (2**30)
  2903. // * `Ti` tebi (2**40)
  2904. //
  2905. // **Grammar**
  2906. //
  2907. // The grammar also includes these connectors:
  2908. //
  2909. // * `/` division (as an infix operator, e.g. `1/s`).
  2910. // * `.` multiplication (as an infix operator, e.g. `GBy.d`)
  2911. //
  2912. // The grammar for a unit is as follows:
  2913. //
  2914. // Expression = Component { "." Component } { "/" Component } ;
  2915. //
  2916. // Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
  2917. // | Annotation
  2918. // | "1"
  2919. // ;
  2920. //
  2921. // Annotation = "{" NAME "}" ;
  2922. //
  2923. // Notes:
  2924. //
  2925. // * `Annotation` is just a comment if it follows a `UNIT` and is
  2926. // equivalent to `1` if it is used alone. For examples,
  2927. // `{requests}/s == 1/s`, `By{transmitted}/s == By/s`.
  2928. // * `NAME` is a sequence of non-blank printable ASCII characters not
  2929. // containing '{' or '}'.
  2930. // * `1` represents dimensionless value 1, such as in `1/s`.
  2931. // * `%` represents dimensionless value 1/100, and annotates values
  2932. // giving
  2933. // a percentage.
  2934. Unit string `json:"unit,omitempty"`
  2935. // ValueType: Whether the measurement is an integer, a floating-point
  2936. // number, etc.
  2937. // Some combinations of `metric_kind` and `value_type` might not be
  2938. // supported.
  2939. //
  2940. // Possible values:
  2941. // "VALUE_TYPE_UNSPECIFIED" - Do not use this default value.
  2942. // "BOOL" - The value is a boolean.
  2943. // This value type can be used only if the metric kind is `GAUGE`.
  2944. // "INT64" - The value is a signed 64-bit integer.
  2945. // "DOUBLE" - The value is a double precision floating point number.
  2946. // "STRING" - The value is a text string.
  2947. // This value type can be used only if the metric kind is `GAUGE`.
  2948. // "DISTRIBUTION" - The value is a `Distribution`.
  2949. // "MONEY" - The value is money.
  2950. ValueType string `json:"valueType,omitempty"`
  2951. // ForceSendFields is a list of field names (e.g. "Description") to
  2952. // unconditionally include in API requests. By default, fields with
  2953. // empty values are omitted from API requests. However, any non-pointer,
  2954. // non-interface field appearing in ForceSendFields will be sent to the
  2955. // server regardless of whether the field is empty or not. This may be
  2956. // used to include empty fields in Patch requests.
  2957. ForceSendFields []string `json:"-"`
  2958. // NullFields is a list of field names (e.g. "Description") to include
  2959. // in API requests with the JSON null value. By default, fields with
  2960. // empty values are omitted from API requests. However, any field with
  2961. // an empty value appearing in NullFields will be sent to the server as
  2962. // null. It is an error if a field in this list has a non-empty value.
  2963. // This may be used to include null fields in Patch requests.
  2964. NullFields []string `json:"-"`
  2965. }
  2966. func (s *MetricDescriptor) MarshalJSON() ([]byte, error) {
  2967. type NoMethod MetricDescriptor
  2968. raw := NoMethod(*s)
  2969. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2970. }
  2971. // MetricRule: Bind API methods to metrics. Binding a method to a metric
  2972. // causes that
  2973. // metric's configured quota behaviors to apply to the method call.
  2974. type MetricRule struct {
  2975. // MetricCosts: Metrics to update when the selected methods are called,
  2976. // and the associated
  2977. // cost applied to each metric.
  2978. //
  2979. // The key of the map is the metric name, and the values are the
  2980. // amount
  2981. // increased for the metric against which the quota limits are
  2982. // defined.
  2983. // The value must not be negative.
  2984. MetricCosts map[string]string `json:"metricCosts,omitempty"`
  2985. // Selector: Selects the methods to which this rule applies.
  2986. //
  2987. // Refer to selector for syntax details.
  2988. Selector string `json:"selector,omitempty"`
  2989. // ForceSendFields is a list of field names (e.g. "MetricCosts") to
  2990. // unconditionally include in API requests. By default, fields with
  2991. // empty values are omitted from API requests. However, any non-pointer,
  2992. // non-interface field appearing in ForceSendFields will be sent to the
  2993. // server regardless of whether the field is empty or not. This may be
  2994. // used to include empty fields in Patch requests.
  2995. ForceSendFields []string `json:"-"`
  2996. // NullFields is a list of field names (e.g. "MetricCosts") to include
  2997. // in API requests with the JSON null value. By default, fields with
  2998. // empty values are omitted from API requests. However, any field with
  2999. // an empty value appearing in NullFields will be sent to the server as
  3000. // null. It is an error if a field in this list has a non-empty value.
  3001. // This may be used to include null fields in Patch requests.
  3002. NullFields []string `json:"-"`
  3003. }
  3004. func (s *MetricRule) MarshalJSON() ([]byte, error) {
  3005. type NoMethod MetricRule
  3006. raw := NoMethod(*s)
  3007. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3008. }
  3009. // Mixin: Declares an API Interface to be included in this interface.
  3010. // The including
  3011. // interface must redeclare all the methods from the included interface,
  3012. // but
  3013. // documentation and options are inherited as follows:
  3014. //
  3015. // - If after comment and whitespace stripping, the documentation
  3016. // string of the redeclared method is empty, it will be inherited
  3017. // from the original method.
  3018. //
  3019. // - Each annotation belonging to the service config (http,
  3020. // visibility) which is not set in the redeclared method will be
  3021. // inherited.
  3022. //
  3023. // - If an http annotation is inherited, the path pattern will be
  3024. // modified as follows. Any version prefix will be replaced by the
  3025. // version of the including interface plus the root path if
  3026. // specified.
  3027. //
  3028. // Example of a simple mixin:
  3029. //
  3030. // package google.acl.v1;
  3031. // service AccessControl {
  3032. // // Get the underlying ACL object.
  3033. // rpc GetAcl(GetAclRequest) returns (Acl) {
  3034. // option (google.api.http).get = "/v1/{resource=**}:getAcl";
  3035. // }
  3036. // }
  3037. //
  3038. // package google.storage.v2;
  3039. // service Storage {
  3040. // // rpc GetAcl(GetAclRequest) returns (Acl);
  3041. //
  3042. // // Get a data record.
  3043. // rpc GetData(GetDataRequest) returns (Data) {
  3044. // option (google.api.http).get = "/v2/{resource=**}";
  3045. // }
  3046. // }
  3047. //
  3048. // Example of a mixin configuration:
  3049. //
  3050. // apis:
  3051. // - name: google.storage.v2.Storage
  3052. // mixins:
  3053. // - name: google.acl.v1.AccessControl
  3054. //
  3055. // The mixin construct implies that all methods in `AccessControl`
  3056. // are
  3057. // also declared with same name and request/response types in
  3058. // `Storage`. A documentation generator or annotation processor will
  3059. // see the effective `Storage.GetAcl` method after
  3060. // inherting
  3061. // documentation and annotations as follows:
  3062. //
  3063. // service Storage {
  3064. // // Get the underlying ACL object.
  3065. // rpc GetAcl(GetAclRequest) returns (Acl) {
  3066. // option (google.api.http).get = "/v2/{resource=**}:getAcl";
  3067. // }
  3068. // ...
  3069. // }
  3070. //
  3071. // Note how the version in the path pattern changed from `v1` to
  3072. // `v2`.
  3073. //
  3074. // If the `root` field in the mixin is specified, it should be
  3075. // a
  3076. // relative path under which inherited HTTP paths are placed. Example:
  3077. //
  3078. // apis:
  3079. // - name: google.storage.v2.Storage
  3080. // mixins:
  3081. // - name: google.acl.v1.AccessControl
  3082. // root: acls
  3083. //
  3084. // This implies the following inherited HTTP annotation:
  3085. //
  3086. // service Storage {
  3087. // // Get the underlying ACL object.
  3088. // rpc GetAcl(GetAclRequest) returns (Acl) {
  3089. // option (google.api.http).get =
  3090. // "/v2/acls/{resource=**}:getAcl";
  3091. // }
  3092. // ...
  3093. // }
  3094. type Mixin struct {
  3095. // Name: The fully qualified name of the interface which is included.
  3096. Name string `json:"name,omitempty"`
  3097. // Root: If non-empty specifies a path under which inherited HTTP
  3098. // paths
  3099. // are rooted.
  3100. Root string `json:"root,omitempty"`
  3101. // ForceSendFields is a list of field names (e.g. "Name") to
  3102. // unconditionally include in API requests. By default, fields with
  3103. // empty values are omitted from API requests. However, any non-pointer,
  3104. // non-interface field appearing in ForceSendFields will be sent to the
  3105. // server regardless of whether the field is empty or not. This may be
  3106. // used to include empty fields in Patch requests.
  3107. ForceSendFields []string `json:"-"`
  3108. // NullFields is a list of field names (e.g. "Name") to include in API
  3109. // requests with the JSON null value. By default, fields with empty
  3110. // values are omitted from API requests. However, any field with an
  3111. // empty value appearing in NullFields will be sent to the server as
  3112. // null. It is an error if a field in this list has a non-empty value.
  3113. // This may be used to include null fields in Patch requests.
  3114. NullFields []string `json:"-"`
  3115. }
  3116. func (s *Mixin) MarshalJSON() ([]byte, error) {
  3117. type NoMethod Mixin
  3118. raw := NoMethod(*s)
  3119. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3120. }
  3121. // MonitoredResourceDescriptor: An object that describes the schema of a
  3122. // MonitoredResource object using a
  3123. // type name and a set of labels. For example, the monitored
  3124. // resource
  3125. // descriptor for Google Compute Engine VM instances has a type
  3126. // of
  3127. // "gce_instance" and specifies the use of the labels "instance_id"
  3128. // and
  3129. // "zone" to identify particular VM instances.
  3130. //
  3131. // Different APIs can support different monitored resource types. APIs
  3132. // generally
  3133. // provide a `list` method that returns the monitored resource
  3134. // descriptors used
  3135. // by the API.
  3136. type MonitoredResourceDescriptor struct {
  3137. // Description: Optional. A detailed description of the monitored
  3138. // resource type that might
  3139. // be used in documentation.
  3140. Description string `json:"description,omitempty"`
  3141. // DisplayName: Optional. A concise name for the monitored resource type
  3142. // that might be
  3143. // displayed in user interfaces. It should be a Title Cased Noun
  3144. // Phrase,
  3145. // without any article or other determiners. For example,
  3146. // "Google Cloud SQL Database".
  3147. DisplayName string `json:"displayName,omitempty"`
  3148. // Labels: Required. A set of labels used to describe instances of this
  3149. // monitored
  3150. // resource type. For example, an individual Google Cloud SQL database
  3151. // is
  3152. // identified by values for the labels "database_id" and "zone".
  3153. Labels []*LabelDescriptor `json:"labels,omitempty"`
  3154. // Name: Optional. The resource name of the monitored resource
  3155. // descriptor:
  3156. // "projects/{project_id}/monitoredResourceDescriptors/{type
  3157. // }" where
  3158. // {type} is the value of the `type` field in this object
  3159. // and
  3160. // {project_id} is a project ID that provides API-specific context
  3161. // for
  3162. // accessing the type. APIs that do not use project information can use
  3163. // the
  3164. // resource name format "monitoredResourceDescriptors/{type}".
  3165. Name string `json:"name,omitempty"`
  3166. // Type: Required. The monitored resource type. For example, the
  3167. // type
  3168. // "cloudsql_database" represents databases in Google Cloud SQL.
  3169. // The maximum length of this value is 256 characters.
  3170. Type string `json:"type,omitempty"`
  3171. // ForceSendFields is a list of field names (e.g. "Description") to
  3172. // unconditionally include in API requests. By default, fields with
  3173. // empty values are omitted from API requests. However, any non-pointer,
  3174. // non-interface field appearing in ForceSendFields will be sent to the
  3175. // server regardless of whether the field is empty or not. This may be
  3176. // used to include empty fields in Patch requests.
  3177. ForceSendFields []string `json:"-"`
  3178. // NullFields is a list of field names (e.g. "Description") to include
  3179. // in API requests with the JSON null value. By default, fields with
  3180. // empty values are omitted from API requests. However, any field with
  3181. // an empty value appearing in NullFields will be sent to the server as
  3182. // null. It is an error if a field in this list has a non-empty value.
  3183. // This may be used to include null fields in Patch requests.
  3184. NullFields []string `json:"-"`
  3185. }
  3186. func (s *MonitoredResourceDescriptor) MarshalJSON() ([]byte, error) {
  3187. type NoMethod MonitoredResourceDescriptor
  3188. raw := NoMethod(*s)
  3189. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3190. }
  3191. // Monitoring: Monitoring configuration of the service.
  3192. //
  3193. // The example below shows how to configure monitored resources and
  3194. // metrics
  3195. // for monitoring. In the example, a monitored resource and two metrics
  3196. // are
  3197. // defined. The `library.googleapis.com/book/returned_count` metric is
  3198. // sent
  3199. // to both producer and consumer projects, whereas
  3200. // the
  3201. // `library.googleapis.com/book/overdue_count` metric is only sent to
  3202. // the
  3203. // consumer project.
  3204. //
  3205. // monitored_resources:
  3206. // - type: library.googleapis.com/branch
  3207. // labels:
  3208. // - key: /city
  3209. // description: The city where the library branch is located
  3210. // in.
  3211. // - key: /name
  3212. // description: The name of the branch.
  3213. // metrics:
  3214. // - name: library.googleapis.com/book/returned_count
  3215. // metric_kind: DELTA
  3216. // value_type: INT64
  3217. // labels:
  3218. // - key: /customer_id
  3219. // - name: library.googleapis.com/book/overdue_count
  3220. // metric_kind: GAUGE
  3221. // value_type: INT64
  3222. // labels:
  3223. // - key: /customer_id
  3224. // monitoring:
  3225. // producer_destinations:
  3226. // - monitored_resource: library.googleapis.com/branch
  3227. // metrics:
  3228. // - library.googleapis.com/book/returned_count
  3229. // consumer_destinations:
  3230. // - monitored_resource: library.googleapis.com/branch
  3231. // metrics:
  3232. // - library.googleapis.com/book/returned_count
  3233. // - library.googleapis.com/book/overdue_count
  3234. type Monitoring struct {
  3235. // ConsumerDestinations: Monitoring configurations for sending metrics
  3236. // to the consumer project.
  3237. // There can be multiple consumer destinations, each one must have
  3238. // a
  3239. // different monitored resource type. A metric can be used in at
  3240. // most
  3241. // one consumer destination.
  3242. ConsumerDestinations []*MonitoringDestination `json:"consumerDestinations,omitempty"`
  3243. // ProducerDestinations: Monitoring configurations for sending metrics
  3244. // to the producer project.
  3245. // There can be multiple producer destinations, each one must have
  3246. // a
  3247. // different monitored resource type. A metric can be used in at
  3248. // most
  3249. // one producer destination.
  3250. ProducerDestinations []*MonitoringDestination `json:"producerDestinations,omitempty"`
  3251. // ForceSendFields is a list of field names (e.g.
  3252. // "ConsumerDestinations") to unconditionally include in API requests.
  3253. // By default, fields with empty values are omitted from API requests.
  3254. // However, any non-pointer, non-interface field appearing in
  3255. // ForceSendFields will be sent to the server regardless of whether the
  3256. // field is empty or not. This may be used to include empty fields in
  3257. // Patch requests.
  3258. ForceSendFields []string `json:"-"`
  3259. // NullFields is a list of field names (e.g. "ConsumerDestinations") to
  3260. // include in API requests with the JSON null value. By default, fields
  3261. // with empty values are omitted from API requests. However, any field
  3262. // with an empty value appearing in NullFields will be sent to the
  3263. // server as null. It is an error if a field in this list has a
  3264. // non-empty value. This may be used to include null fields in Patch
  3265. // requests.
  3266. NullFields []string `json:"-"`
  3267. }
  3268. func (s *Monitoring) MarshalJSON() ([]byte, error) {
  3269. type NoMethod Monitoring
  3270. raw := NoMethod(*s)
  3271. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3272. }
  3273. // MonitoringDestination: Configuration of a specific monitoring
  3274. // destination (the producer project
  3275. // or the consumer project).
  3276. type MonitoringDestination struct {
  3277. // Metrics: Names of the metrics to report to this monitoring
  3278. // destination.
  3279. // Each name must be defined in Service.metrics section.
  3280. Metrics []string `json:"metrics,omitempty"`
  3281. // MonitoredResource: The monitored resource type. The type must be
  3282. // defined in
  3283. // Service.monitored_resources section.
  3284. MonitoredResource string `json:"monitoredResource,omitempty"`
  3285. // ForceSendFields is a list of field names (e.g. "Metrics") to
  3286. // unconditionally include in API requests. By default, fields with
  3287. // empty values are omitted from API requests. However, any non-pointer,
  3288. // non-interface field appearing in ForceSendFields will be sent to the
  3289. // server regardless of whether the field is empty or not. This may be
  3290. // used to include empty fields in Patch requests.
  3291. ForceSendFields []string `json:"-"`
  3292. // NullFields is a list of field names (e.g. "Metrics") to include in
  3293. // API requests with the JSON null value. By default, fields with empty
  3294. // values are omitted from API requests. However, any field with an
  3295. // empty value appearing in NullFields will be sent to the server as
  3296. // null. It is an error if a field in this list has a non-empty value.
  3297. // This may be used to include null fields in Patch requests.
  3298. NullFields []string `json:"-"`
  3299. }
  3300. func (s *MonitoringDestination) MarshalJSON() ([]byte, error) {
  3301. type NoMethod MonitoringDestination
  3302. raw := NoMethod(*s)
  3303. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3304. }
  3305. // OAuthRequirements: OAuth scopes are a way to define data and
  3306. // permissions on data. For example,
  3307. // there are scopes defined for "Read-only access to Google Calendar"
  3308. // and
  3309. // "Access to Cloud Platform". Users can consent to a scope for an
  3310. // application,
  3311. // giving it permission to access that data on their behalf.
  3312. //
  3313. // OAuth scope specifications should be fairly coarse grained; a user
  3314. // will need
  3315. // to see and understand the text description of what your scope
  3316. // means.
  3317. //
  3318. // In most cases: use one or at most two OAuth scopes for an entire
  3319. // family of
  3320. // products. If your product has multiple APIs, you should probably be
  3321. // sharing
  3322. // the OAuth scope across all of those APIs.
  3323. //
  3324. // When you need finer grained OAuth consent screens: talk with your
  3325. // product
  3326. // management about how developers will use them in practice.
  3327. //
  3328. // Please note that even though each of the canonical scopes is enough
  3329. // for a
  3330. // request to be accepted and passed to the backend, a request can still
  3331. // fail
  3332. // due to the backend requiring additional scopes or permissions.
  3333. type OAuthRequirements struct {
  3334. // CanonicalScopes: The list of publicly documented OAuth scopes that
  3335. // are allowed access. An
  3336. // OAuth token containing any of these scopes will be
  3337. // accepted.
  3338. //
  3339. // Example:
  3340. //
  3341. // canonical_scopes: https://www.googleapis.com/auth/calendar,
  3342. // https://www.googleapis.com/auth/calendar.read
  3343. CanonicalScopes string `json:"canonicalScopes,omitempty"`
  3344. // ForceSendFields is a list of field names (e.g. "CanonicalScopes") to
  3345. // unconditionally include in API requests. By default, fields with
  3346. // empty values are omitted from API requests. However, any non-pointer,
  3347. // non-interface field appearing in ForceSendFields will be sent to the
  3348. // server regardless of whether the field is empty or not. This may be
  3349. // used to include empty fields in Patch requests.
  3350. ForceSendFields []string `json:"-"`
  3351. // NullFields is a list of field names (e.g. "CanonicalScopes") to
  3352. // include in API requests with the JSON null value. By default, fields
  3353. // with empty values are omitted from API requests. However, any field
  3354. // with an empty value appearing in NullFields will be sent to the
  3355. // server as null. It is an error if a field in this list has a
  3356. // non-empty value. This may be used to include null fields in Patch
  3357. // requests.
  3358. NullFields []string `json:"-"`
  3359. }
  3360. func (s *OAuthRequirements) MarshalJSON() ([]byte, error) {
  3361. type NoMethod OAuthRequirements
  3362. raw := NoMethod(*s)
  3363. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3364. }
  3365. // Operation: This resource represents a long-running operation that is
  3366. // the result of a
  3367. // network API call.
  3368. type Operation struct {
  3369. // Done: If the value is `false`, it means the operation is still in
  3370. // progress.
  3371. // If `true`, the operation is completed, and either `error` or
  3372. // `response` is
  3373. // available.
  3374. Done bool `json:"done,omitempty"`
  3375. // Error: The error result of the operation in case of failure or
  3376. // cancellation.
  3377. Error *Status `json:"error,omitempty"`
  3378. // Metadata: Service-specific metadata associated with the operation.
  3379. // It typically
  3380. // contains progress information and common metadata such as create
  3381. // time.
  3382. // Some services might not provide such metadata. Any method that
  3383. // returns a
  3384. // long-running operation should document the metadata type, if any.
  3385. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  3386. // Name: The server-assigned name, which is only unique within the same
  3387. // service that
  3388. // originally returns it. If you use the default HTTP mapping,
  3389. // the
  3390. // `name` should have the format of `operations/some/unique/name`.
  3391. Name string `json:"name,omitempty"`
  3392. // Response: The normal response of the operation in case of success.
  3393. // If the original
  3394. // method returns no data on success, such as `Delete`, the response
  3395. // is
  3396. // `google.protobuf.Empty`. If the original method is
  3397. // standard
  3398. // `Get`/`Create`/`Update`, the response should be the resource. For
  3399. // other
  3400. // methods, the response should have the type `XxxResponse`, where
  3401. // `Xxx`
  3402. // is the original method name. For example, if the original method
  3403. // name
  3404. // is `TakeSnapshot()`, the inferred response type
  3405. // is
  3406. // `TakeSnapshotResponse`.
  3407. Response googleapi.RawMessage `json:"response,omitempty"`
  3408. // ServerResponse contains the HTTP response code and headers from the
  3409. // server.
  3410. googleapi.ServerResponse `json:"-"`
  3411. // ForceSendFields is a list of field names (e.g. "Done") to
  3412. // unconditionally include in API requests. By default, fields with
  3413. // empty values are omitted from API requests. However, any non-pointer,
  3414. // non-interface field appearing in ForceSendFields will be sent to the
  3415. // server regardless of whether the field is empty or not. This may be
  3416. // used to include empty fields in Patch requests.
  3417. ForceSendFields []string `json:"-"`
  3418. // NullFields is a list of field names (e.g. "Done") to include in API
  3419. // requests with the JSON null value. By default, fields with empty
  3420. // values are omitted from API requests. However, any field with an
  3421. // empty value appearing in NullFields will be sent to the server as
  3422. // null. It is an error if a field in this list has a non-empty value.
  3423. // This may be used to include null fields in Patch requests.
  3424. NullFields []string `json:"-"`
  3425. }
  3426. func (s *Operation) MarshalJSON() ([]byte, error) {
  3427. type NoMethod Operation
  3428. raw := NoMethod(*s)
  3429. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3430. }
  3431. // OperationMetadata: The metadata associated with a long running
  3432. // operation resource.
  3433. type OperationMetadata struct {
  3434. // ProgressPercentage: Percentage of completion of this operation,
  3435. // ranging from 0 to 100.
  3436. ProgressPercentage int64 `json:"progressPercentage,omitempty"`
  3437. // ResourceNames: The full name of the resources that this operation is
  3438. // directly
  3439. // associated with.
  3440. ResourceNames []string `json:"resourceNames,omitempty"`
  3441. // StartTime: The start time of the operation.
  3442. StartTime string `json:"startTime,omitempty"`
  3443. // Steps: Detailed status information for each step. The order is
  3444. // undetermined.
  3445. Steps []*Step `json:"steps,omitempty"`
  3446. // ForceSendFields is a list of field names (e.g. "ProgressPercentage")
  3447. // to unconditionally include in API requests. By default, fields with
  3448. // empty values are omitted from API requests. However, any non-pointer,
  3449. // non-interface field appearing in ForceSendFields will be sent to the
  3450. // server regardless of whether the field is empty or not. This may be
  3451. // used to include empty fields in Patch requests.
  3452. ForceSendFields []string `json:"-"`
  3453. // NullFields is a list of field names (e.g. "ProgressPercentage") to
  3454. // include in API requests with the JSON null value. By default, fields
  3455. // with empty values are omitted from API requests. However, any field
  3456. // with an empty value appearing in NullFields will be sent to the
  3457. // server as null. It is an error if a field in this list has a
  3458. // non-empty value. This may be used to include null fields in Patch
  3459. // requests.
  3460. NullFields []string `json:"-"`
  3461. }
  3462. func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
  3463. type NoMethod OperationMetadata
  3464. raw := NoMethod(*s)
  3465. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3466. }
  3467. // Option: A protocol buffer option, which can be attached to a message,
  3468. // field,
  3469. // enumeration, etc.
  3470. type Option struct {
  3471. // Name: The option's name. For protobuf built-in options (options
  3472. // defined in
  3473. // descriptor.proto), this is the short name. For example,
  3474. // "map_entry".
  3475. // For custom options, it should be the fully-qualified name. For
  3476. // example,
  3477. // "google.api.http".
  3478. Name string `json:"name,omitempty"`
  3479. // Value: The option's value packed in an Any message. If the value is a
  3480. // primitive,
  3481. // the corresponding wrapper type defined in
  3482. // google/protobuf/wrappers.proto
  3483. // should be used. If the value is an enum, it should be stored as an
  3484. // int32
  3485. // value using the google.protobuf.Int32Value type.
  3486. Value googleapi.RawMessage `json:"value,omitempty"`
  3487. // ForceSendFields is a list of field names (e.g. "Name") to
  3488. // unconditionally include in API requests. By default, fields with
  3489. // empty values are omitted from API requests. However, any non-pointer,
  3490. // non-interface field appearing in ForceSendFields will be sent to the
  3491. // server regardless of whether the field is empty or not. This may be
  3492. // used to include empty fields in Patch requests.
  3493. ForceSendFields []string `json:"-"`
  3494. // NullFields is a list of field names (e.g. "Name") to include in API
  3495. // requests with the JSON null value. By default, fields with empty
  3496. // values are omitted from API requests. However, any field with an
  3497. // empty value appearing in NullFields will be sent to the server as
  3498. // null. It is an error if a field in this list has a non-empty value.
  3499. // This may be used to include null fields in Patch requests.
  3500. NullFields []string `json:"-"`
  3501. }
  3502. func (s *Option) MarshalJSON() ([]byte, error) {
  3503. type NoMethod Option
  3504. raw := NoMethod(*s)
  3505. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3506. }
  3507. // Page: Represents a documentation page. A page can contain subpages to
  3508. // represent
  3509. // nested documentation set structure.
  3510. type Page struct {
  3511. // Content: The Markdown content of the page. You can use <code>&#40;==
  3512. // include {path} ==&#41;</code>
  3513. // to include content from a Markdown file.
  3514. Content string `json:"content,omitempty"`
  3515. // Name: The name of the page. It will be used as an identity of the
  3516. // page to
  3517. // generate URI of the page, text of the link to this page in
  3518. // navigation,
  3519. // etc. The full page name (start from the root page name to this
  3520. // page
  3521. // concatenated with `.`) can be used as reference to the page in
  3522. // your
  3523. // documentation. For example:
  3524. // <pre><code>pages:
  3525. // - name: Tutorial
  3526. // content: &#40;== include tutorial.md ==&#41;
  3527. // subpages:
  3528. // - name: Java
  3529. // content: &#40;== include tutorial_java.md
  3530. // ==&#41;
  3531. // </code></pre>
  3532. // You can reference `Java` page using Markdown reference link
  3533. // syntax:
  3534. // `Java`.
  3535. Name string `json:"name,omitempty"`
  3536. // Subpages: Subpages of this page. The order of subpages specified here
  3537. // will be
  3538. // honored in the generated docset.
  3539. Subpages []*Page `json:"subpages,omitempty"`
  3540. // ForceSendFields is a list of field names (e.g. "Content") to
  3541. // unconditionally include in API requests. By default, fields with
  3542. // empty values are omitted from API requests. However, any non-pointer,
  3543. // non-interface field appearing in ForceSendFields will be sent to the
  3544. // server regardless of whether the field is empty or not. This may be
  3545. // used to include empty fields in Patch requests.
  3546. ForceSendFields []string `json:"-"`
  3547. // NullFields is a list of field names (e.g. "Content") to include in
  3548. // API requests with the JSON null value. By default, fields with empty
  3549. // values are omitted from API requests. However, any field with an
  3550. // empty value appearing in NullFields will be sent to the server as
  3551. // null. It is an error if a field in this list has a non-empty value.
  3552. // This may be used to include null fields in Patch requests.
  3553. NullFields []string `json:"-"`
  3554. }
  3555. func (s *Page) MarshalJSON() ([]byte, error) {
  3556. type NoMethod Page
  3557. raw := NoMethod(*s)
  3558. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3559. }
  3560. // Policy: Defines an Identity and Access Management (IAM) policy. It is
  3561. // used to
  3562. // specify access control policies for Cloud Platform resources.
  3563. //
  3564. //
  3565. // A `Policy` consists of a list of `bindings`. A `binding` binds a list
  3566. // of
  3567. // `members` to a `role`, where the members can be user accounts, Google
  3568. // groups,
  3569. // Google domains, and service accounts. A `role` is a named list of
  3570. // permissions
  3571. // defined by IAM.
  3572. //
  3573. // **JSON Example**
  3574. //
  3575. // {
  3576. // "bindings": [
  3577. // {
  3578. // "role": "roles/owner",
  3579. // "members": [
  3580. // "user:mike@example.com",
  3581. // "group:admins@example.com",
  3582. // "domain:google.com",
  3583. //
  3584. // "serviceAccount:my-other-app@appspot.gserviceaccount.com"
  3585. // ]
  3586. // },
  3587. // {
  3588. // "role": "roles/viewer",
  3589. // "members": ["user:sean@example.com"]
  3590. // }
  3591. // ]
  3592. // }
  3593. //
  3594. // **YAML Example**
  3595. //
  3596. // bindings:
  3597. // - members:
  3598. // - user:mike@example.com
  3599. // - group:admins@example.com
  3600. // - domain:google.com
  3601. // - serviceAccount:my-other-app@appspot.gserviceaccount.com
  3602. // role: roles/owner
  3603. // - members:
  3604. // - user:sean@example.com
  3605. // role: roles/viewer
  3606. //
  3607. //
  3608. // For a description of IAM and its features, see the
  3609. // [IAM developer's guide](https://cloud.google.com/iam/docs).
  3610. type Policy struct {
  3611. // AuditConfigs: Specifies cloud audit logging configuration for this
  3612. // policy.
  3613. AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
  3614. // Bindings: Associates a list of `members` to a `role`.
  3615. // `bindings` with no members will result in an error.
  3616. Bindings []*Binding `json:"bindings,omitempty"`
  3617. // Etag: `etag` is used for optimistic concurrency control as a way to
  3618. // help
  3619. // prevent simultaneous updates of a policy from overwriting each
  3620. // other.
  3621. // It is strongly suggested that systems make use of the `etag` in
  3622. // the
  3623. // read-modify-write cycle to perform policy updates in order to avoid
  3624. // race
  3625. // conditions: An `etag` is returned in the response to `getIamPolicy`,
  3626. // and
  3627. // systems are expected to put that etag in the request to
  3628. // `setIamPolicy` to
  3629. // ensure that their change will be applied to the same version of the
  3630. // policy.
  3631. //
  3632. // If no `etag` is provided in the call to `setIamPolicy`, then the
  3633. // existing
  3634. // policy is overwritten blindly.
  3635. Etag string `json:"etag,omitempty"`
  3636. // Version: Deprecated.
  3637. Version int64 `json:"version,omitempty"`
  3638. // ServerResponse contains the HTTP response code and headers from the
  3639. // server.
  3640. googleapi.ServerResponse `json:"-"`
  3641. // ForceSendFields is a list of field names (e.g. "AuditConfigs") to
  3642. // unconditionally include in API requests. By default, fields with
  3643. // empty values are omitted from API requests. However, any non-pointer,
  3644. // non-interface field appearing in ForceSendFields will be sent to the
  3645. // server regardless of whether the field is empty or not. This may be
  3646. // used to include empty fields in Patch requests.
  3647. ForceSendFields []string `json:"-"`
  3648. // NullFields is a list of field names (e.g. "AuditConfigs") to include
  3649. // in API requests with the JSON null value. By default, fields with
  3650. // empty values are omitted from API requests. However, any field with
  3651. // an empty value appearing in NullFields will be sent to the server as
  3652. // null. It is an error if a field in this list has a non-empty value.
  3653. // This may be used to include null fields in Patch requests.
  3654. NullFields []string `json:"-"`
  3655. }
  3656. func (s *Policy) MarshalJSON() ([]byte, error) {
  3657. type NoMethod Policy
  3658. raw := NoMethod(*s)
  3659. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3660. }
  3661. // Quota: Quota configuration helps to achieve fairness and budgeting in
  3662. // service
  3663. // usage.
  3664. //
  3665. // The quota configuration works this way:
  3666. // - The service configuration defines a set of metrics.
  3667. // - For API calls, the quota.metric_rules maps methods to metrics with
  3668. // corresponding costs.
  3669. // - The quota.limits defines limits on the metrics, which will be used
  3670. // for
  3671. // quota checks at runtime.
  3672. //
  3673. // An example quota configuration in yaml format:
  3674. //
  3675. // quota:
  3676. //
  3677. // - name: apiWriteQpsPerProject
  3678. // metric: library.googleapis.com/write_calls
  3679. // unit: "1/min/{project}" # rate limit for consumer projects
  3680. // values:
  3681. // STANDARD: 10000
  3682. //
  3683. //
  3684. // # The metric rules bind all methods to the read_calls metric,
  3685. // # except for the UpdateBook and DeleteBook methods. These two
  3686. // methods
  3687. // # are mapped to the write_calls metric, with the UpdateBook
  3688. // method
  3689. // # consuming at twice rate as the DeleteBook method.
  3690. // metric_rules:
  3691. // - selector: "*"
  3692. // metric_costs:
  3693. // library.googleapis.com/read_calls: 1
  3694. // - selector: google.example.library.v1.LibraryService.UpdateBook
  3695. // metric_costs:
  3696. // library.googleapis.com/write_calls: 2
  3697. // - selector: google.example.library.v1.LibraryService.DeleteBook
  3698. // metric_costs:
  3699. // library.googleapis.com/write_calls: 1
  3700. //
  3701. // Corresponding Metric definition:
  3702. //
  3703. // metrics:
  3704. // - name: library.googleapis.com/read_calls
  3705. // display_name: Read requests
  3706. // metric_kind: DELTA
  3707. // value_type: INT64
  3708. //
  3709. // - name: library.googleapis.com/write_calls
  3710. // display_name: Write requests
  3711. // metric_kind: DELTA
  3712. // value_type: INT64
  3713. type Quota struct {
  3714. // Limits: List of `QuotaLimit` definitions for the service.
  3715. Limits []*QuotaLimit `json:"limits,omitempty"`
  3716. // MetricRules: List of `MetricRule` definitions, each one mapping a
  3717. // selected method to one
  3718. // or more metrics.
  3719. MetricRules []*MetricRule `json:"metricRules,omitempty"`
  3720. // ForceSendFields is a list of field names (e.g. "Limits") to
  3721. // unconditionally include in API requests. By default, fields with
  3722. // empty values are omitted from API requests. However, any non-pointer,
  3723. // non-interface field appearing in ForceSendFields will be sent to the
  3724. // server regardless of whether the field is empty or not. This may be
  3725. // used to include empty fields in Patch requests.
  3726. ForceSendFields []string `json:"-"`
  3727. // NullFields is a list of field names (e.g. "Limits") to include in API
  3728. // requests with the JSON null value. By default, fields with empty
  3729. // values are omitted from API requests. However, any field with an
  3730. // empty value appearing in NullFields will be sent to the server as
  3731. // null. It is an error if a field in this list has a non-empty value.
  3732. // This may be used to include null fields in Patch requests.
  3733. NullFields []string `json:"-"`
  3734. }
  3735. func (s *Quota) MarshalJSON() ([]byte, error) {
  3736. type NoMethod Quota
  3737. raw := NoMethod(*s)
  3738. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3739. }
  3740. // QuotaLimit: `QuotaLimit` defines a specific limit that applies over a
  3741. // specified duration
  3742. // for a limit type. There can be at most one limit for a duration and
  3743. // limit
  3744. // type combination defined within a `QuotaGroup`.
  3745. type QuotaLimit struct {
  3746. // DefaultLimit: Default number of tokens that can be consumed during
  3747. // the specified
  3748. // duration. This is the number of tokens assigned when a
  3749. // client
  3750. // application developer activates the service for his/her
  3751. // project.
  3752. //
  3753. // Specifying a value of 0 will block all requests. This can be used if
  3754. // you
  3755. // are provisioning quota to selected consumers and blocking
  3756. // others.
  3757. // Similarly, a value of -1 will indicate an unlimited quota. No
  3758. // other
  3759. // negative values are allowed.
  3760. //
  3761. // Used by group-based quotas only.
  3762. DefaultLimit int64 `json:"defaultLimit,omitempty,string"`
  3763. // Description: Optional. User-visible, extended description for this
  3764. // quota limit.
  3765. // Should be used only when more context is needed to understand this
  3766. // limit
  3767. // than provided by the limit's display name (see: `display_name`).
  3768. Description string `json:"description,omitempty"`
  3769. // DisplayName: User-visible display name for this limit.
  3770. // Optional. If not set, the UI will provide a default display name
  3771. // based on
  3772. // the quota configuration. This field can be used to override the
  3773. // default
  3774. // display name generated from the configuration.
  3775. DisplayName string `json:"displayName,omitempty"`
  3776. // Duration: Duration of this limit in textual notation. Example:
  3777. // "100s", "24h", "1d".
  3778. // For duration longer than a day, only multiple of days is supported.
  3779. // We
  3780. // support only "100s" and "1d" for now. Additional support will be
  3781. // added in
  3782. // the future. "0" indicates indefinite duration.
  3783. //
  3784. // Used by group-based quotas only.
  3785. Duration string `json:"duration,omitempty"`
  3786. // FreeTier: Free tier value displayed in the Developers Console for
  3787. // this limit.
  3788. // The free tier is the number of tokens that will be subtracted from
  3789. // the
  3790. // billed amount when billing is enabled.
  3791. // This field can only be set on a limit with duration "1d", in a
  3792. // billable
  3793. // group; it is invalid on any other limit. If this field is not set,
  3794. // it
  3795. // defaults to 0, indicating that there is no free tier for this
  3796. // service.
  3797. //
  3798. // Used by group-based quotas only.
  3799. FreeTier int64 `json:"freeTier,omitempty,string"`
  3800. // MaxLimit: Maximum number of tokens that can be consumed during the
  3801. // specified
  3802. // duration. Client application developers can override the default
  3803. // limit up
  3804. // to this maximum. If specified, this value cannot be set to a value
  3805. // less
  3806. // than the default limit. If not specified, it is set to the default
  3807. // limit.
  3808. //
  3809. // To allow clients to apply overrides with no upper bound, set this to
  3810. // -1,
  3811. // indicating unlimited maximum quota.
  3812. //
  3813. // Used by group-based quotas only.
  3814. MaxLimit int64 `json:"maxLimit,omitempty,string"`
  3815. // Metric: The name of the metric this quota limit applies to. The quota
  3816. // limits with
  3817. // the same metric will be checked together during runtime. The metric
  3818. // must be
  3819. // defined within the service config.
  3820. Metric string `json:"metric,omitempty"`
  3821. // Name: Name of the quota limit.
  3822. //
  3823. // The name must be provided, and it must be unique within the service.
  3824. // The
  3825. // name can only include alphanumeric characters as well as '-'.
  3826. //
  3827. // The maximum length of the limit name is 64 characters.
  3828. Name string `json:"name,omitempty"`
  3829. // Unit: Specify the unit of the quota limit. It uses the same syntax
  3830. // as
  3831. // Metric.unit. The supported unit kinds are determined by the
  3832. // quota
  3833. // backend system.
  3834. //
  3835. // Here are some examples:
  3836. // * "1/min/{project}" for quota per minute per project.
  3837. //
  3838. // Note: the order of unit components is insignificant.
  3839. // The "1" at the beginning is required to follow the metric unit
  3840. // syntax.
  3841. Unit string `json:"unit,omitempty"`
  3842. // Values: Tiered limit values. You must specify this as a key:value
  3843. // pair, with an
  3844. // integer value that is the maximum number of requests allowed for
  3845. // the
  3846. // specified unit. Currently only STANDARD is supported.
  3847. Values map[string]string `json:"values,omitempty"`
  3848. // ForceSendFields is a list of field names (e.g. "DefaultLimit") to
  3849. // unconditionally include in API requests. By default, fields with
  3850. // empty values are omitted from API requests. However, any non-pointer,
  3851. // non-interface field appearing in ForceSendFields will be sent to the
  3852. // server regardless of whether the field is empty or not. This may be
  3853. // used to include empty fields in Patch requests.
  3854. ForceSendFields []string `json:"-"`
  3855. // NullFields is a list of field names (e.g. "DefaultLimit") to include
  3856. // in API requests with the JSON null value. By default, fields with
  3857. // empty values are omitted from API requests. However, any field with
  3858. // an empty value appearing in NullFields will be sent to the server as
  3859. // null. It is an error if a field in this list has a non-empty value.
  3860. // This may be used to include null fields in Patch requests.
  3861. NullFields []string `json:"-"`
  3862. }
  3863. func (s *QuotaLimit) MarshalJSON() ([]byte, error) {
  3864. type NoMethod QuotaLimit
  3865. raw := NoMethod(*s)
  3866. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3867. }
  3868. // Rollout: A rollout resource that defines how service configuration
  3869. // versions are pushed
  3870. // to control plane systems. Typically, you create a new version of
  3871. // the
  3872. // service config, and then create a Rollout to push the service config.
  3873. type Rollout struct {
  3874. // CreateTime: Creation time of the rollout. Readonly.
  3875. CreateTime string `json:"createTime,omitempty"`
  3876. // CreatedBy: The user who created the Rollout. Readonly.
  3877. CreatedBy string `json:"createdBy,omitempty"`
  3878. // DeleteServiceStrategy: The strategy associated with a rollout to
  3879. // delete a `ManagedService`.
  3880. // Readonly.
  3881. DeleteServiceStrategy *DeleteServiceStrategy `json:"deleteServiceStrategy,omitempty"`
  3882. // RolloutId: Optional unique identifier of this Rollout. Only lower
  3883. // case letters, digits
  3884. // and '-' are allowed.
  3885. //
  3886. // If not specified by client, the server will generate one. The
  3887. // generated id
  3888. // will have the form of <date><revision number>, where "date" is the
  3889. // create
  3890. // date in ISO 8601 format. "revision number" is a monotonically
  3891. // increasing
  3892. // positive number that is reset every day for each service.
  3893. // An example of the generated rollout_id is '2016-02-16r1'
  3894. RolloutId string `json:"rolloutId,omitempty"`
  3895. // ServiceName: The name of the service associated with this Rollout.
  3896. ServiceName string `json:"serviceName,omitempty"`
  3897. // Status: The status of this rollout. Readonly. In case of a failed
  3898. // rollout,
  3899. // the system will automatically rollback to the current
  3900. // Rollout
  3901. // version. Readonly.
  3902. //
  3903. // Possible values:
  3904. // "ROLLOUT_STATUS_UNSPECIFIED" - No status specified.
  3905. // "IN_PROGRESS" - The Rollout is in progress.
  3906. // "SUCCESS" - The Rollout has completed successfully.
  3907. // "CANCELLED" - The Rollout has been cancelled. This can happen if
  3908. // you have overlapping
  3909. // Rollout pushes, and the previous ones will be cancelled.
  3910. // "FAILED" - The Rollout has failed and the rollback attempt has
  3911. // failed too.
  3912. // "PENDING" - The Rollout has not started yet and is pending for
  3913. // execution.
  3914. // "FAILED_ROLLED_BACK" - The Rollout has failed and rolled back to
  3915. // the previous successful
  3916. // Rollout.
  3917. Status string `json:"status,omitempty"`
  3918. // TrafficPercentStrategy: Google Service Control selects service
  3919. // configurations based on
  3920. // traffic percentage.
  3921. TrafficPercentStrategy *TrafficPercentStrategy `json:"trafficPercentStrategy,omitempty"`
  3922. // ServerResponse contains the HTTP response code and headers from the
  3923. // server.
  3924. googleapi.ServerResponse `json:"-"`
  3925. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  3926. // unconditionally include in API requests. By default, fields with
  3927. // empty values are omitted from API requests. However, any non-pointer,
  3928. // non-interface field appearing in ForceSendFields will be sent to the
  3929. // server regardless of whether the field is empty or not. This may be
  3930. // used to include empty fields in Patch requests.
  3931. ForceSendFields []string `json:"-"`
  3932. // NullFields is a list of field names (e.g. "CreateTime") to include in
  3933. // API requests with the JSON null value. By default, fields with empty
  3934. // values are omitted from API requests. However, any field with an
  3935. // empty value appearing in NullFields will be sent to the server as
  3936. // null. It is an error if a field in this list has a non-empty value.
  3937. // This may be used to include null fields in Patch requests.
  3938. NullFields []string `json:"-"`
  3939. }
  3940. func (s *Rollout) MarshalJSON() ([]byte, error) {
  3941. type NoMethod Rollout
  3942. raw := NoMethod(*s)
  3943. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3944. }
  3945. // Service: `Service` is the root object of Google service configuration
  3946. // schema. It
  3947. // describes basic information about a service, such as the name and
  3948. // the
  3949. // title, and delegates other aspects to sub-sections. Each sub-section
  3950. // is
  3951. // either a proto message or a repeated proto message that configures
  3952. // a
  3953. // specific aspect, such as auth. See each proto message definition for
  3954. // details.
  3955. //
  3956. // Example:
  3957. //
  3958. // type: google.api.Service
  3959. // config_version: 3
  3960. // name: calendar.googleapis.com
  3961. // title: Google Calendar API
  3962. // apis:
  3963. // - name: google.calendar.v3.Calendar
  3964. // authentication:
  3965. // providers:
  3966. // - id: google_calendar_auth
  3967. // jwks_uri: https://www.googleapis.com/oauth2/v1/certs
  3968. // issuer: https://securetoken.google.com
  3969. // rules:
  3970. // - selector: "*"
  3971. // requirements:
  3972. // provider_id: google_calendar_auth
  3973. type Service struct {
  3974. // Apis: A list of API interfaces exported by this service. Only the
  3975. // `name` field
  3976. // of the google.protobuf.Api needs to be provided by the
  3977. // configuration
  3978. // author, as the remaining fields will be derived from the IDL during
  3979. // the
  3980. // normalization process. It is an error to specify an API interface
  3981. // here
  3982. // which cannot be resolved against the associated IDL files.
  3983. Apis []*Api `json:"apis,omitempty"`
  3984. // Authentication: Auth configuration.
  3985. Authentication *Authentication `json:"authentication,omitempty"`
  3986. // Backend: API backend configuration.
  3987. Backend *Backend `json:"backend,omitempty"`
  3988. // Billing: Billing configuration.
  3989. Billing *Billing `json:"billing,omitempty"`
  3990. // ConfigVersion: The semantic version of the service configuration. The
  3991. // config version
  3992. // affects the interpretation of the service configuration. For
  3993. // example,
  3994. // certain features are enabled by default for certain config
  3995. // versions.
  3996. // The latest config version is `3`.
  3997. ConfigVersion int64 `json:"configVersion,omitempty"`
  3998. // Context: Context configuration.
  3999. Context *Context `json:"context,omitempty"`
  4000. // Control: Configuration for the service control plane.
  4001. Control *Control `json:"control,omitempty"`
  4002. // CustomError: Custom error configuration.
  4003. CustomError *CustomError `json:"customError,omitempty"`
  4004. // Documentation: Additional API documentation.
  4005. Documentation *Documentation `json:"documentation,omitempty"`
  4006. // Endpoints: Configuration for network endpoints. If this is empty,
  4007. // then an endpoint
  4008. // with the same name as the service is automatically generated to
  4009. // service all
  4010. // defined APIs.
  4011. Endpoints []*Endpoint `json:"endpoints,omitempty"`
  4012. // Enums: A list of all enum types included in this API service.
  4013. // Enums
  4014. // referenced directly or indirectly by the `apis` are
  4015. // automatically
  4016. // included. Enums which are not referenced but shall be
  4017. // included
  4018. // should be listed here by name. Example:
  4019. //
  4020. // enums:
  4021. // - name: google.someapi.v1.SomeEnum
  4022. Enums []*Enum `json:"enums,omitempty"`
  4023. // Experimental: Experimental configuration.
  4024. Experimental *Experimental `json:"experimental,omitempty"`
  4025. // Http: HTTP configuration.
  4026. Http *Http `json:"http,omitempty"`
  4027. // Id: A unique ID for a specific instance of this message, typically
  4028. // assigned
  4029. // by the client for tracking purpose. If empty, the server may choose
  4030. // to
  4031. // generate one instead.
  4032. Id string `json:"id,omitempty"`
  4033. // Logging: Logging configuration.
  4034. Logging *Logging `json:"logging,omitempty"`
  4035. // Logs: Defines the logs used by this service.
  4036. Logs []*LogDescriptor `json:"logs,omitempty"`
  4037. // Metrics: Defines the metrics used by this service.
  4038. Metrics []*MetricDescriptor `json:"metrics,omitempty"`
  4039. // MonitoredResources: Defines the monitored resources used by this
  4040. // service. This is required
  4041. // by the Service.monitoring and Service.logging configurations.
  4042. MonitoredResources []*MonitoredResourceDescriptor `json:"monitoredResources,omitempty"`
  4043. // Monitoring: Monitoring configuration.
  4044. Monitoring *Monitoring `json:"monitoring,omitempty"`
  4045. // Name: The DNS address at which this service is available,
  4046. // e.g. `calendar.googleapis.com`.
  4047. Name string `json:"name,omitempty"`
  4048. // ProducerProjectId: The Google project that owns this service.
  4049. ProducerProjectId string `json:"producerProjectId,omitempty"`
  4050. // Quota: Quota configuration.
  4051. Quota *Quota `json:"quota,omitempty"`
  4052. // SourceInfo: Output only. The source information for this
  4053. // configuration if available.
  4054. SourceInfo *SourceInfo `json:"sourceInfo,omitempty"`
  4055. // SystemParameters: System parameter configuration.
  4056. SystemParameters *SystemParameters `json:"systemParameters,omitempty"`
  4057. // SystemTypes: A list of all proto message types included in this API
  4058. // service.
  4059. // It serves similar purpose as [google.api.Service.types], except
  4060. // that
  4061. // these types are not needed by user-defined APIs. Therefore, they will
  4062. // not
  4063. // show up in the generated discovery doc. This field should only be
  4064. // used
  4065. // to define system APIs in ESF.
  4066. SystemTypes []*Type `json:"systemTypes,omitempty"`
  4067. // Title: The product title for this service.
  4068. Title string `json:"title,omitempty"`
  4069. // Types: A list of all proto message types included in this API
  4070. // service.
  4071. // Types referenced directly or indirectly by the `apis`
  4072. // are
  4073. // automatically included. Messages which are not referenced but
  4074. // shall be included, such as types used by the `google.protobuf.Any`
  4075. // type,
  4076. // should be listed here by name. Example:
  4077. //
  4078. // types:
  4079. // - name: google.protobuf.Int32
  4080. Types []*Type `json:"types,omitempty"`
  4081. // Usage: Configuration controlling usage of this service.
  4082. Usage *Usage `json:"usage,omitempty"`
  4083. // ServerResponse contains the HTTP response code and headers from the
  4084. // server.
  4085. googleapi.ServerResponse `json:"-"`
  4086. // ForceSendFields is a list of field names (e.g. "Apis") to
  4087. // unconditionally include in API requests. By default, fields with
  4088. // empty values are omitted from API requests. However, any non-pointer,
  4089. // non-interface field appearing in ForceSendFields will be sent to the
  4090. // server regardless of whether the field is empty or not. This may be
  4091. // used to include empty fields in Patch requests.
  4092. ForceSendFields []string `json:"-"`
  4093. // NullFields is a list of field names (e.g. "Apis") to include in API
  4094. // requests with the JSON null value. By default, fields with empty
  4095. // values are omitted from API requests. However, any field with an
  4096. // empty value appearing in NullFields will be sent to the server as
  4097. // null. It is an error if a field in this list has a non-empty value.
  4098. // This may be used to include null fields in Patch requests.
  4099. NullFields []string `json:"-"`
  4100. }
  4101. func (s *Service) MarshalJSON() ([]byte, error) {
  4102. type NoMethod Service
  4103. raw := NoMethod(*s)
  4104. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4105. }
  4106. // SetIamPolicyRequest: Request message for `SetIamPolicy` method.
  4107. type SetIamPolicyRequest struct {
  4108. // Policy: REQUIRED: The complete policy to be applied to the
  4109. // `resource`. The size of
  4110. // the policy is limited to a few 10s of KB. An empty policy is a
  4111. // valid policy but certain Cloud Platform services (such as
  4112. // Projects)
  4113. // might reject them.
  4114. Policy *Policy `json:"policy,omitempty"`
  4115. // UpdateMask: OPTIONAL: A FieldMask specifying which fields of the
  4116. // policy to modify. Only
  4117. // the fields in the mask will be modified. If no mask is provided,
  4118. // the
  4119. // following default mask is used:
  4120. // paths: "bindings, etag"
  4121. // This field is only used by Cloud IAM.
  4122. UpdateMask string `json:"updateMask,omitempty"`
  4123. // ForceSendFields is a list of field names (e.g. "Policy") to
  4124. // unconditionally include in API requests. By default, fields with
  4125. // empty values are omitted from API requests. However, any non-pointer,
  4126. // non-interface field appearing in ForceSendFields will be sent to the
  4127. // server regardless of whether the field is empty or not. This may be
  4128. // used to include empty fields in Patch requests.
  4129. ForceSendFields []string `json:"-"`
  4130. // NullFields is a list of field names (e.g. "Policy") to include in API
  4131. // requests with the JSON null value. By default, fields with empty
  4132. // values are omitted from API requests. However, any field with an
  4133. // empty value appearing in NullFields will be sent to the server as
  4134. // null. It is an error if a field in this list has a non-empty value.
  4135. // This may be used to include null fields in Patch requests.
  4136. NullFields []string `json:"-"`
  4137. }
  4138. func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
  4139. type NoMethod SetIamPolicyRequest
  4140. raw := NoMethod(*s)
  4141. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4142. }
  4143. // SourceContext: `SourceContext` represents information about the
  4144. // source of a
  4145. // protobuf element, like the file in which it is defined.
  4146. type SourceContext struct {
  4147. // FileName: The path-qualified name of the .proto file that contained
  4148. // the associated
  4149. // protobuf element. For example:
  4150. // "google/protobuf/source_context.proto".
  4151. FileName string `json:"fileName,omitempty"`
  4152. // ForceSendFields is a list of field names (e.g. "FileName") to
  4153. // unconditionally include in API requests. By default, fields with
  4154. // empty values are omitted from API requests. However, any non-pointer,
  4155. // non-interface field appearing in ForceSendFields will be sent to the
  4156. // server regardless of whether the field is empty or not. This may be
  4157. // used to include empty fields in Patch requests.
  4158. ForceSendFields []string `json:"-"`
  4159. // NullFields is a list of field names (e.g. "FileName") to include in
  4160. // API requests with the JSON null value. By default, fields with empty
  4161. // values are omitted from API requests. However, any field with an
  4162. // empty value appearing in NullFields will be sent to the server as
  4163. // null. It is an error if a field in this list has a non-empty value.
  4164. // This may be used to include null fields in Patch requests.
  4165. NullFields []string `json:"-"`
  4166. }
  4167. func (s *SourceContext) MarshalJSON() ([]byte, error) {
  4168. type NoMethod SourceContext
  4169. raw := NoMethod(*s)
  4170. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4171. }
  4172. // SourceInfo: Source information used to create a Service Config
  4173. type SourceInfo struct {
  4174. // SourceFiles: All files used during config generation.
  4175. SourceFiles []googleapi.RawMessage `json:"sourceFiles,omitempty"`
  4176. // ForceSendFields is a list of field names (e.g. "SourceFiles") to
  4177. // unconditionally include in API requests. By default, fields with
  4178. // empty values are omitted from API requests. However, any non-pointer,
  4179. // non-interface field appearing in ForceSendFields will be sent to the
  4180. // server regardless of whether the field is empty or not. This may be
  4181. // used to include empty fields in Patch requests.
  4182. ForceSendFields []string `json:"-"`
  4183. // NullFields is a list of field names (e.g. "SourceFiles") to include
  4184. // in API requests with the JSON null value. By default, fields with
  4185. // empty values are omitted from API requests. However, any field with
  4186. // an empty value appearing in NullFields will be sent to the server as
  4187. // null. It is an error if a field in this list has a non-empty value.
  4188. // This may be used to include null fields in Patch requests.
  4189. NullFields []string `json:"-"`
  4190. }
  4191. func (s *SourceInfo) MarshalJSON() ([]byte, error) {
  4192. type NoMethod SourceInfo
  4193. raw := NoMethod(*s)
  4194. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4195. }
  4196. // Status: The `Status` type defines a logical error model that is
  4197. // suitable for different
  4198. // programming environments, including REST APIs and RPC APIs. It is
  4199. // used by
  4200. // [gRPC](https://github.com/grpc). The error model is designed to
  4201. // be:
  4202. //
  4203. // - Simple to use and understand for most users
  4204. // - Flexible enough to meet unexpected needs
  4205. //
  4206. // # Overview
  4207. //
  4208. // The `Status` message contains three pieces of data: error code, error
  4209. // message,
  4210. // and error details. The error code should be an enum value
  4211. // of
  4212. // google.rpc.Code, but it may accept additional error codes if needed.
  4213. // The
  4214. // error message should be a developer-facing English message that
  4215. // helps
  4216. // developers *understand* and *resolve* the error. If a localized
  4217. // user-facing
  4218. // error message is needed, put the localized message in the error
  4219. // details or
  4220. // localize it in the client. The optional error details may contain
  4221. // arbitrary
  4222. // information about the error. There is a predefined set of error
  4223. // detail types
  4224. // in the package `google.rpc` that can be used for common error
  4225. // conditions.
  4226. //
  4227. // # Language mapping
  4228. //
  4229. // The `Status` message is the logical representation of the error
  4230. // model, but it
  4231. // is not necessarily the actual wire format. When the `Status` message
  4232. // is
  4233. // exposed in different client libraries and different wire protocols,
  4234. // it can be
  4235. // mapped differently. For example, it will likely be mapped to some
  4236. // exceptions
  4237. // in Java, but more likely mapped to some error codes in C.
  4238. //
  4239. // # Other uses
  4240. //
  4241. // The error model and the `Status` message can be used in a variety
  4242. // of
  4243. // environments, either with or without APIs, to provide a
  4244. // consistent developer experience across different
  4245. // environments.
  4246. //
  4247. // Example uses of this error model include:
  4248. //
  4249. // - Partial errors. If a service needs to return partial errors to the
  4250. // client,
  4251. // it may embed the `Status` in the normal response to indicate the
  4252. // partial
  4253. // errors.
  4254. //
  4255. // - Workflow errors. A typical workflow has multiple steps. Each step
  4256. // may
  4257. // have a `Status` message for error reporting.
  4258. //
  4259. // - Batch operations. If a client uses batch request and batch
  4260. // response, the
  4261. // `Status` message should be used directly inside batch response,
  4262. // one for
  4263. // each error sub-response.
  4264. //
  4265. // - Asynchronous operations. If an API call embeds asynchronous
  4266. // operation
  4267. // results in its response, the status of those operations should
  4268. // be
  4269. // represented directly using the `Status` message.
  4270. //
  4271. // - Logging. If some API errors are stored in logs, the message
  4272. // `Status` could
  4273. // be used directly after any stripping needed for security/privacy
  4274. // reasons.
  4275. type Status struct {
  4276. // Code: The status code, which should be an enum value of
  4277. // google.rpc.Code.
  4278. Code int64 `json:"code,omitempty"`
  4279. // Details: A list of messages that carry the error details. There is a
  4280. // common set of
  4281. // message types for APIs to use.
  4282. Details []googleapi.RawMessage `json:"details,omitempty"`
  4283. // Message: A developer-facing error message, which should be in
  4284. // English. Any
  4285. // user-facing error message should be localized and sent in
  4286. // the
  4287. // google.rpc.Status.details field, or localized by the client.
  4288. Message string `json:"message,omitempty"`
  4289. // ForceSendFields is a list of field names (e.g. "Code") to
  4290. // unconditionally include in API requests. By default, fields with
  4291. // empty values are omitted from API requests. However, any non-pointer,
  4292. // non-interface field appearing in ForceSendFields will be sent to the
  4293. // server regardless of whether the field is empty or not. This may be
  4294. // used to include empty fields in Patch requests.
  4295. ForceSendFields []string `json:"-"`
  4296. // NullFields is a list of field names (e.g. "Code") to include in API
  4297. // requests with the JSON null value. By default, fields with empty
  4298. // values are omitted from API requests. However, any field with an
  4299. // empty value appearing in NullFields will be sent to the server as
  4300. // null. It is an error if a field in this list has a non-empty value.
  4301. // This may be used to include null fields in Patch requests.
  4302. NullFields []string `json:"-"`
  4303. }
  4304. func (s *Status) MarshalJSON() ([]byte, error) {
  4305. type NoMethod Status
  4306. raw := NoMethod(*s)
  4307. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4308. }
  4309. // Step: Represents the status of one operation step.
  4310. type Step struct {
  4311. // Description: The short description of the step.
  4312. Description string `json:"description,omitempty"`
  4313. // Status: The status code.
  4314. //
  4315. // Possible values:
  4316. // "STATUS_UNSPECIFIED" - Unspecifed code.
  4317. // "DONE" - The operation or step has completed without errors.
  4318. // "NOT_STARTED" - The operation or step has not started yet.
  4319. // "IN_PROGRESS" - The operation or step is in progress.
  4320. // "FAILED" - The operation or step has completed with errors. If the
  4321. // operation is
  4322. // rollbackable, the rollback completed with errors too.
  4323. // "CANCELLED" - The operation or step has completed with
  4324. // cancellation.
  4325. Status string `json:"status,omitempty"`
  4326. // ForceSendFields is a list of field names (e.g. "Description") to
  4327. // unconditionally include in API requests. By default, fields with
  4328. // empty values are omitted from API requests. However, any non-pointer,
  4329. // non-interface field appearing in ForceSendFields will be sent to the
  4330. // server regardless of whether the field is empty or not. This may be
  4331. // used to include empty fields in Patch requests.
  4332. ForceSendFields []string `json:"-"`
  4333. // NullFields is a list of field names (e.g. "Description") to include
  4334. // in API requests with the JSON null value. By default, fields with
  4335. // empty values are omitted from API requests. However, any field with
  4336. // an empty value appearing in NullFields will be sent to the server as
  4337. // null. It is an error if a field in this list has a non-empty value.
  4338. // This may be used to include null fields in Patch requests.
  4339. NullFields []string `json:"-"`
  4340. }
  4341. func (s *Step) MarshalJSON() ([]byte, error) {
  4342. type NoMethod Step
  4343. raw := NoMethod(*s)
  4344. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4345. }
  4346. // SubmitConfigSourceRequest: Request message for SubmitConfigSource
  4347. // method.
  4348. type SubmitConfigSourceRequest struct {
  4349. // ConfigSource: The source configuration for the service.
  4350. ConfigSource *ConfigSource `json:"configSource,omitempty"`
  4351. // ValidateOnly: Optional. If set, this will result in the generation of
  4352. // a
  4353. // `google.api.Service` configuration based on the `ConfigSource`
  4354. // provided,
  4355. // but the generated config and the sources will NOT be persisted.
  4356. ValidateOnly bool `json:"validateOnly,omitempty"`
  4357. // ForceSendFields is a list of field names (e.g. "ConfigSource") to
  4358. // unconditionally include in API requests. By default, fields with
  4359. // empty values are omitted from API requests. However, any non-pointer,
  4360. // non-interface field appearing in ForceSendFields will be sent to the
  4361. // server regardless of whether the field is empty or not. This may be
  4362. // used to include empty fields in Patch requests.
  4363. ForceSendFields []string `json:"-"`
  4364. // NullFields is a list of field names (e.g. "ConfigSource") to include
  4365. // in API requests with the JSON null value. By default, fields with
  4366. // empty values are omitted from API requests. However, any field with
  4367. // an empty value appearing in NullFields will be sent to the server as
  4368. // null. It is an error if a field in this list has a non-empty value.
  4369. // This may be used to include null fields in Patch requests.
  4370. NullFields []string `json:"-"`
  4371. }
  4372. func (s *SubmitConfigSourceRequest) MarshalJSON() ([]byte, error) {
  4373. type NoMethod SubmitConfigSourceRequest
  4374. raw := NoMethod(*s)
  4375. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4376. }
  4377. // SubmitConfigSourceResponse: Response message for SubmitConfigSource
  4378. // method.
  4379. type SubmitConfigSourceResponse struct {
  4380. // ServiceConfig: The generated service configuration.
  4381. ServiceConfig *Service `json:"serviceConfig,omitempty"`
  4382. // ForceSendFields is a list of field names (e.g. "ServiceConfig") to
  4383. // unconditionally include in API requests. By default, fields with
  4384. // empty values are omitted from API requests. However, any non-pointer,
  4385. // non-interface field appearing in ForceSendFields will be sent to the
  4386. // server regardless of whether the field is empty or not. This may be
  4387. // used to include empty fields in Patch requests.
  4388. ForceSendFields []string `json:"-"`
  4389. // NullFields is a list of field names (e.g. "ServiceConfig") to include
  4390. // in API requests with the JSON null value. By default, fields with
  4391. // empty values are omitted from API requests. However, any field with
  4392. // an empty value appearing in NullFields will be sent to the server as
  4393. // null. It is an error if a field in this list has a non-empty value.
  4394. // This may be used to include null fields in Patch requests.
  4395. NullFields []string `json:"-"`
  4396. }
  4397. func (s *SubmitConfigSourceResponse) MarshalJSON() ([]byte, error) {
  4398. type NoMethod SubmitConfigSourceResponse
  4399. raw := NoMethod(*s)
  4400. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4401. }
  4402. // SystemParameter: Define a parameter's name and location. The
  4403. // parameter may be passed as either
  4404. // an HTTP header or a URL query parameter, and if both are passed the
  4405. // behavior
  4406. // is implementation-dependent.
  4407. type SystemParameter struct {
  4408. // HttpHeader: Define the HTTP header name to use for the parameter. It
  4409. // is case
  4410. // insensitive.
  4411. HttpHeader string `json:"httpHeader,omitempty"`
  4412. // Name: Define the name of the parameter, such as "api_key" . It is
  4413. // case sensitive.
  4414. Name string `json:"name,omitempty"`
  4415. // UrlQueryParameter: Define the URL query parameter name to use for the
  4416. // parameter. It is case
  4417. // sensitive.
  4418. UrlQueryParameter string `json:"urlQueryParameter,omitempty"`
  4419. // ForceSendFields is a list of field names (e.g. "HttpHeader") to
  4420. // unconditionally include in API requests. By default, fields with
  4421. // empty values are omitted from API requests. However, any non-pointer,
  4422. // non-interface field appearing in ForceSendFields will be sent to the
  4423. // server regardless of whether the field is empty or not. This may be
  4424. // used to include empty fields in Patch requests.
  4425. ForceSendFields []string `json:"-"`
  4426. // NullFields is a list of field names (e.g. "HttpHeader") to include in
  4427. // API requests with the JSON null value. By default, fields with empty
  4428. // values are omitted from API requests. However, any field with an
  4429. // empty value appearing in NullFields will be sent to the server as
  4430. // null. It is an error if a field in this list has a non-empty value.
  4431. // This may be used to include null fields in Patch requests.
  4432. NullFields []string `json:"-"`
  4433. }
  4434. func (s *SystemParameter) MarshalJSON() ([]byte, error) {
  4435. type NoMethod SystemParameter
  4436. raw := NoMethod(*s)
  4437. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4438. }
  4439. // SystemParameterRule: Define a system parameter rule mapping system
  4440. // parameter definitions to
  4441. // methods.
  4442. type SystemParameterRule struct {
  4443. // Parameters: Define parameters. Multiple names may be defined for a
  4444. // parameter.
  4445. // For a given method call, only one of them should be used. If
  4446. // multiple
  4447. // names are used the behavior is implementation-dependent.
  4448. // If none of the specified names are present the behavior
  4449. // is
  4450. // parameter-dependent.
  4451. Parameters []*SystemParameter `json:"parameters,omitempty"`
  4452. // Selector: Selects the methods to which this rule applies. Use '*' to
  4453. // indicate all
  4454. // methods in all APIs.
  4455. //
  4456. // Refer to selector for syntax details.
  4457. Selector string `json:"selector,omitempty"`
  4458. // ForceSendFields is a list of field names (e.g. "Parameters") to
  4459. // unconditionally include in API requests. By default, fields with
  4460. // empty values are omitted from API requests. However, any non-pointer,
  4461. // non-interface field appearing in ForceSendFields will be sent to the
  4462. // server regardless of whether the field is empty or not. This may be
  4463. // used to include empty fields in Patch requests.
  4464. ForceSendFields []string `json:"-"`
  4465. // NullFields is a list of field names (e.g. "Parameters") to include in
  4466. // API requests with the JSON null value. By default, fields with empty
  4467. // values are omitted from API requests. However, any field with an
  4468. // empty value appearing in NullFields will be sent to the server as
  4469. // null. It is an error if a field in this list has a non-empty value.
  4470. // This may be used to include null fields in Patch requests.
  4471. NullFields []string `json:"-"`
  4472. }
  4473. func (s *SystemParameterRule) MarshalJSON() ([]byte, error) {
  4474. type NoMethod SystemParameterRule
  4475. raw := NoMethod(*s)
  4476. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4477. }
  4478. // SystemParameters: ### System parameter configuration
  4479. //
  4480. // A system parameter is a special kind of parameter defined by the
  4481. // API
  4482. // system, not by an individual API. It is typically mapped to an HTTP
  4483. // header
  4484. // and/or a URL query parameter. This configuration specifies which
  4485. // methods
  4486. // change the names of the system parameters.
  4487. type SystemParameters struct {
  4488. // Rules: Define system parameters.
  4489. //
  4490. // The parameters defined here will override the default
  4491. // parameters
  4492. // implemented by the system. If this field is missing from the
  4493. // service
  4494. // config, default system parameters will be used. Default system
  4495. // parameters
  4496. // and names is implementation-dependent.
  4497. //
  4498. // Example: define api key for all methods
  4499. //
  4500. // system_parameters
  4501. // rules:
  4502. // - selector: "*"
  4503. // parameters:
  4504. // - name: api_key
  4505. // url_query_parameter: api_key
  4506. //
  4507. //
  4508. // Example: define 2 api key names for a specific method.
  4509. //
  4510. // system_parameters
  4511. // rules:
  4512. // - selector: "/ListShelves"
  4513. // parameters:
  4514. // - name: api_key
  4515. // http_header: Api-Key1
  4516. // - name: api_key
  4517. // http_header: Api-Key2
  4518. //
  4519. // **NOTE:** All service configuration rules follow "last one wins"
  4520. // order.
  4521. Rules []*SystemParameterRule `json:"rules,omitempty"`
  4522. // ForceSendFields is a list of field names (e.g. "Rules") to
  4523. // unconditionally include in API requests. By default, fields with
  4524. // empty values are omitted from API requests. However, any non-pointer,
  4525. // non-interface field appearing in ForceSendFields will be sent to the
  4526. // server regardless of whether the field is empty or not. This may be
  4527. // used to include empty fields in Patch requests.
  4528. ForceSendFields []string `json:"-"`
  4529. // NullFields is a list of field names (e.g. "Rules") to include in API
  4530. // requests with the JSON null value. By default, fields with empty
  4531. // values are omitted from API requests. However, any field with an
  4532. // empty value appearing in NullFields will be sent to the server as
  4533. // null. It is an error if a field in this list has a non-empty value.
  4534. // This may be used to include null fields in Patch requests.
  4535. NullFields []string `json:"-"`
  4536. }
  4537. func (s *SystemParameters) MarshalJSON() ([]byte, error) {
  4538. type NoMethod SystemParameters
  4539. raw := NoMethod(*s)
  4540. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4541. }
  4542. // TestIamPermissionsRequest: Request message for `TestIamPermissions`
  4543. // method.
  4544. type TestIamPermissionsRequest struct {
  4545. // Permissions: The set of permissions to check for the `resource`.
  4546. // Permissions with
  4547. // wildcards (such as '*' or 'storage.*') are not allowed. For
  4548. // more
  4549. // information see
  4550. // [IAM
  4551. // Overview](https://cloud.google.com/iam/docs/overview#permissions).
  4552. Permissions []string `json:"permissions,omitempty"`
  4553. // ForceSendFields is a list of field names (e.g. "Permissions") to
  4554. // unconditionally include in API requests. By default, fields with
  4555. // empty values are omitted from API requests. However, any non-pointer,
  4556. // non-interface field appearing in ForceSendFields will be sent to the
  4557. // server regardless of whether the field is empty or not. This may be
  4558. // used to include empty fields in Patch requests.
  4559. ForceSendFields []string `json:"-"`
  4560. // NullFields is a list of field names (e.g. "Permissions") to include
  4561. // in API requests with the JSON null value. By default, fields with
  4562. // empty values are omitted from API requests. However, any field with
  4563. // an empty value appearing in NullFields will be sent to the server as
  4564. // null. It is an error if a field in this list has a non-empty value.
  4565. // This may be used to include null fields in Patch requests.
  4566. NullFields []string `json:"-"`
  4567. }
  4568. func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
  4569. type NoMethod TestIamPermissionsRequest
  4570. raw := NoMethod(*s)
  4571. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4572. }
  4573. // TestIamPermissionsResponse: Response message for `TestIamPermissions`
  4574. // method.
  4575. type TestIamPermissionsResponse struct {
  4576. // Permissions: A subset of `TestPermissionsRequest.permissions` that
  4577. // the caller is
  4578. // allowed.
  4579. Permissions []string `json:"permissions,omitempty"`
  4580. // ServerResponse contains the HTTP response code and headers from the
  4581. // server.
  4582. googleapi.ServerResponse `json:"-"`
  4583. // ForceSendFields is a list of field names (e.g. "Permissions") to
  4584. // unconditionally include in API requests. By default, fields with
  4585. // empty values are omitted from API requests. However, any non-pointer,
  4586. // non-interface field appearing in ForceSendFields will be sent to the
  4587. // server regardless of whether the field is empty or not. This may be
  4588. // used to include empty fields in Patch requests.
  4589. ForceSendFields []string `json:"-"`
  4590. // NullFields is a list of field names (e.g. "Permissions") to include
  4591. // in API requests with the JSON null value. By default, fields with
  4592. // empty values are omitted from API requests. However, any field with
  4593. // an empty value appearing in NullFields will be sent to the server as
  4594. // null. It is an error if a field in this list has a non-empty value.
  4595. // This may be used to include null fields in Patch requests.
  4596. NullFields []string `json:"-"`
  4597. }
  4598. func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
  4599. type NoMethod TestIamPermissionsResponse
  4600. raw := NoMethod(*s)
  4601. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4602. }
  4603. // TrafficPercentStrategy: Strategy that specifies how clients of Google
  4604. // Service Controller want to
  4605. // send traffic to use different config versions. This is generally
  4606. // used by API proxy to split traffic based on your configured
  4607. // precentage for
  4608. // each config version.
  4609. //
  4610. // One example of how to gradually rollout a new service configuration
  4611. // using
  4612. // this
  4613. // strategy:
  4614. // Day 1
  4615. //
  4616. // Rollout {
  4617. // id: "example.googleapis.com/rollout_20160206"
  4618. // traffic_percent_strategy {
  4619. // percentages: {
  4620. // "example.googleapis.com/20160201": 70.00
  4621. // "example.googleapis.com/20160206": 30.00
  4622. // }
  4623. // }
  4624. // }
  4625. //
  4626. // Day 2
  4627. //
  4628. // Rollout {
  4629. // id: "example.googleapis.com/rollout_20160207"
  4630. // traffic_percent_strategy: {
  4631. // percentages: {
  4632. // "example.googleapis.com/20160206": 100.00
  4633. // }
  4634. // }
  4635. // }
  4636. type TrafficPercentStrategy struct {
  4637. // Percentages: Maps service configuration IDs to their corresponding
  4638. // traffic percentage.
  4639. // Key is the service configuration ID, Value is the traffic
  4640. // percentage
  4641. // which must be greater than 0.0 and the sum must equal to 100.0.
  4642. Percentages map[string]float64 `json:"percentages,omitempty"`
  4643. // ForceSendFields is a list of field names (e.g. "Percentages") to
  4644. // unconditionally include in API requests. By default, fields with
  4645. // empty values are omitted from API requests. However, any non-pointer,
  4646. // non-interface field appearing in ForceSendFields will be sent to the
  4647. // server regardless of whether the field is empty or not. This may be
  4648. // used to include empty fields in Patch requests.
  4649. ForceSendFields []string `json:"-"`
  4650. // NullFields is a list of field names (e.g. "Percentages") to include
  4651. // in API requests with the JSON null value. By default, fields with
  4652. // empty values are omitted from API requests. However, any field with
  4653. // an empty value appearing in NullFields will be sent to the server as
  4654. // null. It is an error if a field in this list has a non-empty value.
  4655. // This may be used to include null fields in Patch requests.
  4656. NullFields []string `json:"-"`
  4657. }
  4658. func (s *TrafficPercentStrategy) MarshalJSON() ([]byte, error) {
  4659. type NoMethod TrafficPercentStrategy
  4660. raw := NoMethod(*s)
  4661. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4662. }
  4663. // Type: A protocol buffer message type.
  4664. type Type struct {
  4665. // Fields: The list of fields.
  4666. Fields []*Field `json:"fields,omitempty"`
  4667. // Name: The fully qualified message name.
  4668. Name string `json:"name,omitempty"`
  4669. // Oneofs: The list of types appearing in `oneof` definitions in this
  4670. // type.
  4671. Oneofs []string `json:"oneofs,omitempty"`
  4672. // Options: The protocol buffer options.
  4673. Options []*Option `json:"options,omitempty"`
  4674. // SourceContext: The source context.
  4675. SourceContext *SourceContext `json:"sourceContext,omitempty"`
  4676. // Syntax: The source syntax.
  4677. //
  4678. // Possible values:
  4679. // "SYNTAX_PROTO2" - Syntax `proto2`.
  4680. // "SYNTAX_PROTO3" - Syntax `proto3`.
  4681. Syntax string `json:"syntax,omitempty"`
  4682. // ForceSendFields is a list of field names (e.g. "Fields") to
  4683. // unconditionally include in API requests. By default, fields with
  4684. // empty values are omitted from API requests. However, any non-pointer,
  4685. // non-interface field appearing in ForceSendFields will be sent to the
  4686. // server regardless of whether the field is empty or not. This may be
  4687. // used to include empty fields in Patch requests.
  4688. ForceSendFields []string `json:"-"`
  4689. // NullFields is a list of field names (e.g. "Fields") to include in API
  4690. // requests with the JSON null value. By default, fields with empty
  4691. // values are omitted from API requests. However, any field with an
  4692. // empty value appearing in NullFields will be sent to the server as
  4693. // null. It is an error if a field in this list has a non-empty value.
  4694. // This may be used to include null fields in Patch requests.
  4695. NullFields []string `json:"-"`
  4696. }
  4697. func (s *Type) MarshalJSON() ([]byte, error) {
  4698. type NoMethod Type
  4699. raw := NoMethod(*s)
  4700. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4701. }
  4702. // UndeleteServiceResponse: Response message for UndeleteService method.
  4703. type UndeleteServiceResponse struct {
  4704. // Service: Revived service resource.
  4705. Service *ManagedService `json:"service,omitempty"`
  4706. // ForceSendFields is a list of field names (e.g. "Service") to
  4707. // unconditionally include in API requests. By default, fields with
  4708. // empty values are omitted from API requests. However, any non-pointer,
  4709. // non-interface field appearing in ForceSendFields will be sent to the
  4710. // server regardless of whether the field is empty or not. This may be
  4711. // used to include empty fields in Patch requests.
  4712. ForceSendFields []string `json:"-"`
  4713. // NullFields is a list of field names (e.g. "Service") to include in
  4714. // API requests with the JSON null value. By default, fields with empty
  4715. // values are omitted from API requests. However, any field with an
  4716. // empty value appearing in NullFields will be sent to the server as
  4717. // null. It is an error if a field in this list has a non-empty value.
  4718. // This may be used to include null fields in Patch requests.
  4719. NullFields []string `json:"-"`
  4720. }
  4721. func (s *UndeleteServiceResponse) MarshalJSON() ([]byte, error) {
  4722. type NoMethod UndeleteServiceResponse
  4723. raw := NoMethod(*s)
  4724. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4725. }
  4726. // Usage: Configuration controlling usage of a service.
  4727. type Usage struct {
  4728. // ProducerNotificationChannel: The full resource name of a channel used
  4729. // for sending notifications to the
  4730. // service producer.
  4731. //
  4732. // Google Service Management currently only supports
  4733. // [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a
  4734. // notification
  4735. // channel. To use Google Cloud Pub/Sub as the channel, this must be the
  4736. // name
  4737. // of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name
  4738. // format
  4739. // documented in https://cloud.google.com/pubsub/docs/overview.
  4740. ProducerNotificationChannel string `json:"producerNotificationChannel,omitempty"`
  4741. // Requirements: Requirements that must be satisfied before a consumer
  4742. // project can use the
  4743. // service. Each requirement is of the form
  4744. // <service.name>/<requirement-id>;
  4745. // for example 'serviceusage.googleapis.com/billing-enabled'.
  4746. Requirements []string `json:"requirements,omitempty"`
  4747. // Rules: A list of usage rules that apply to individual API
  4748. // methods.
  4749. //
  4750. // **NOTE:** All service configuration rules follow "last one wins"
  4751. // order.
  4752. Rules []*UsageRule `json:"rules,omitempty"`
  4753. // ForceSendFields is a list of field names (e.g.
  4754. // "ProducerNotificationChannel") to unconditionally include in API
  4755. // requests. By default, fields with empty values are omitted from API
  4756. // requests. However, any non-pointer, non-interface field appearing in
  4757. // ForceSendFields will be sent to the server regardless of whether the
  4758. // field is empty or not. This may be used to include empty fields in
  4759. // Patch requests.
  4760. ForceSendFields []string `json:"-"`
  4761. // NullFields is a list of field names (e.g.
  4762. // "ProducerNotificationChannel") to include in API requests with the
  4763. // JSON null value. By default, fields with empty values are omitted
  4764. // from API requests. However, any field with an empty value appearing
  4765. // in NullFields will be sent to the server as null. It is an error if a
  4766. // field in this list has a non-empty value. This may be used to include
  4767. // null fields in Patch requests.
  4768. NullFields []string `json:"-"`
  4769. }
  4770. func (s *Usage) MarshalJSON() ([]byte, error) {
  4771. type NoMethod Usage
  4772. raw := NoMethod(*s)
  4773. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4774. }
  4775. // UsageRule: Usage configuration rules for the service.
  4776. //
  4777. // NOTE: Under development.
  4778. //
  4779. //
  4780. // Use this rule to configure unregistered calls for the service.
  4781. // Unregistered
  4782. // calls are calls that do not contain consumer project
  4783. // identity.
  4784. // (Example: calls that do not contain an API key).
  4785. // By default, API methods do not allow unregistered calls, and each
  4786. // method call
  4787. // must be identified by a consumer project identity. Use this rule
  4788. // to
  4789. // allow/disallow unregistered calls.
  4790. //
  4791. // Example of an API that wants to allow unregistered calls for entire
  4792. // service.
  4793. //
  4794. // usage:
  4795. // rules:
  4796. // - selector: "*"
  4797. // allow_unregistered_calls: true
  4798. //
  4799. // Example of a method that wants to allow unregistered calls.
  4800. //
  4801. // usage:
  4802. // rules:
  4803. // - selector:
  4804. // "google.example.library.v1.LibraryService.CreateBook"
  4805. // allow_unregistered_calls: true
  4806. type UsageRule struct {
  4807. // AllowUnregisteredCalls: If true, the selected method allows
  4808. // unregistered calls, e.g. calls
  4809. // that don't identify any user or application.
  4810. AllowUnregisteredCalls bool `json:"allowUnregisteredCalls,omitempty"`
  4811. // Selector: Selects the methods to which this rule applies. Use '*' to
  4812. // indicate all
  4813. // methods in all APIs.
  4814. //
  4815. // Refer to selector for syntax details.
  4816. Selector string `json:"selector,omitempty"`
  4817. // SkipServiceControl: If true, the selected method should skip service
  4818. // control and the control
  4819. // plane features, such as quota and billing, will not be
  4820. // available.
  4821. // This flag is used by Google Cloud Endpoints to bypass checks for
  4822. // internal
  4823. // methods, such as service health check methods.
  4824. SkipServiceControl bool `json:"skipServiceControl,omitempty"`
  4825. // ForceSendFields is a list of field names (e.g.
  4826. // "AllowUnregisteredCalls") to unconditionally include in API requests.
  4827. // By default, fields with empty values are omitted from API requests.
  4828. // However, any non-pointer, non-interface field appearing in
  4829. // ForceSendFields will be sent to the server regardless of whether the
  4830. // field is empty or not. This may be used to include empty fields in
  4831. // Patch requests.
  4832. ForceSendFields []string `json:"-"`
  4833. // NullFields is a list of field names (e.g. "AllowUnregisteredCalls")
  4834. // to include in API requests with the JSON null value. By default,
  4835. // fields with empty values are omitted from API requests. However, any
  4836. // field with an empty value appearing in NullFields will be sent to the
  4837. // server as null. It is an error if a field in this list has a
  4838. // non-empty value. This may be used to include null fields in Patch
  4839. // requests.
  4840. NullFields []string `json:"-"`
  4841. }
  4842. func (s *UsageRule) MarshalJSON() ([]byte, error) {
  4843. type NoMethod UsageRule
  4844. raw := NoMethod(*s)
  4845. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4846. }
  4847. // method id "servicemanagement.operations.get":
  4848. type OperationsGetCall struct {
  4849. s *APIService
  4850. name string
  4851. urlParams_ gensupport.URLParams
  4852. ifNoneMatch_ string
  4853. ctx_ context.Context
  4854. header_ http.Header
  4855. }
  4856. // Get: Gets the latest state of a long-running operation. Clients can
  4857. // use this
  4858. // method to poll the operation result at intervals as recommended by
  4859. // the API
  4860. // service.
  4861. func (r *OperationsService) Get(name string) *OperationsGetCall {
  4862. c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4863. c.name = name
  4864. return c
  4865. }
  4866. // Fields allows partial responses to be retrieved. See
  4867. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4868. // for more information.
  4869. func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall {
  4870. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4871. return c
  4872. }
  4873. // IfNoneMatch sets the optional parameter which makes the operation
  4874. // fail if the object's ETag matches the given value. This is useful for
  4875. // getting updates only after the object has changed since the last
  4876. // request. Use googleapi.IsNotModified to check whether the response
  4877. // error from Do is the result of In-None-Match.
  4878. func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall {
  4879. c.ifNoneMatch_ = entityTag
  4880. return c
  4881. }
  4882. // Context sets the context to be used in this call's Do method. Any
  4883. // pending HTTP request will be aborted if the provided context is
  4884. // canceled.
  4885. func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall {
  4886. c.ctx_ = ctx
  4887. return c
  4888. }
  4889. // Header returns an http.Header that can be modified by the caller to
  4890. // add HTTP headers to the request.
  4891. func (c *OperationsGetCall) Header() http.Header {
  4892. if c.header_ == nil {
  4893. c.header_ = make(http.Header)
  4894. }
  4895. return c.header_
  4896. }
  4897. func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) {
  4898. reqHeaders := make(http.Header)
  4899. for k, v := range c.header_ {
  4900. reqHeaders[k] = v
  4901. }
  4902. reqHeaders.Set("User-Agent", c.s.userAgent())
  4903. if c.ifNoneMatch_ != "" {
  4904. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4905. }
  4906. var body io.Reader = nil
  4907. c.urlParams_.Set("alt", alt)
  4908. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  4909. urls += "?" + c.urlParams_.Encode()
  4910. req, _ := http.NewRequest("GET", urls, body)
  4911. req.Header = reqHeaders
  4912. googleapi.Expand(req.URL, map[string]string{
  4913. "name": c.name,
  4914. })
  4915. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4916. }
  4917. // Do executes the "servicemanagement.operations.get" call.
  4918. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4919. // status code is an error. Response headers are in either
  4920. // *Operation.ServerResponse.Header or (if a response was returned at
  4921. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4922. // to check whether the returned error was because
  4923. // http.StatusNotModified was returned.
  4924. func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4925. gensupport.SetOptions(c.urlParams_, opts...)
  4926. res, err := c.doRequest("json")
  4927. if res != nil && res.StatusCode == http.StatusNotModified {
  4928. if res.Body != nil {
  4929. res.Body.Close()
  4930. }
  4931. return nil, &googleapi.Error{
  4932. Code: res.StatusCode,
  4933. Header: res.Header,
  4934. }
  4935. }
  4936. if err != nil {
  4937. return nil, err
  4938. }
  4939. defer googleapi.CloseBody(res)
  4940. if err := googleapi.CheckResponse(res); err != nil {
  4941. return nil, err
  4942. }
  4943. ret := &Operation{
  4944. ServerResponse: googleapi.ServerResponse{
  4945. Header: res.Header,
  4946. HTTPStatusCode: res.StatusCode,
  4947. },
  4948. }
  4949. target := &ret
  4950. if err := gensupport.DecodeResponse(target, res); err != nil {
  4951. return nil, err
  4952. }
  4953. return ret, nil
  4954. // {
  4955. // "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.",
  4956. // "flatPath": "v1/operations/{operationsId}",
  4957. // "httpMethod": "GET",
  4958. // "id": "servicemanagement.operations.get",
  4959. // "parameterOrder": [
  4960. // "name"
  4961. // ],
  4962. // "parameters": {
  4963. // "name": {
  4964. // "description": "The name of the operation resource.",
  4965. // "location": "path",
  4966. // "pattern": "^operations/.+$",
  4967. // "required": true,
  4968. // "type": "string"
  4969. // }
  4970. // },
  4971. // "path": "v1/{+name}",
  4972. // "response": {
  4973. // "$ref": "Operation"
  4974. // },
  4975. // "scopes": [
  4976. // "https://www.googleapis.com/auth/cloud-platform",
  4977. // "https://www.googleapis.com/auth/service.management"
  4978. // ]
  4979. // }
  4980. }
  4981. // method id "servicemanagement.operations.list":
  4982. type OperationsListCall struct {
  4983. s *APIService
  4984. urlParams_ gensupport.URLParams
  4985. ifNoneMatch_ string
  4986. ctx_ context.Context
  4987. header_ http.Header
  4988. }
  4989. // List: Lists service operations that match the specified filter in the
  4990. // request.
  4991. func (r *OperationsService) List() *OperationsListCall {
  4992. c := &OperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4993. return c
  4994. }
  4995. // Filter sets the optional parameter "filter": A string for filtering
  4996. // Operations.
  4997. // The following filter fields are supported&#58;
  4998. //
  4999. // * serviceName&#58; Required. Only `=` operator is allowed.
  5000. // * startTime&#58; The time this job was started, in ISO 8601
  5001. // format.
  5002. // Allowed operators are `>=`, `>`, `<=`, and `<`.
  5003. // * status&#58; Can be `done`, `in_progress`, or `failed`. Allowed
  5004. // operators are `=`, and `!=`.
  5005. //
  5006. // Filter expression supports conjunction (AND) and disjunction (OR)
  5007. // logical operators. However, the serviceName restriction must be at
  5008. // the
  5009. // top-level and can only be combined with other restrictions via the
  5010. // AND
  5011. // logical operator.
  5012. //
  5013. // Examples&#58;
  5014. //
  5015. // * `serviceName={some-service}.googleapis.com`
  5016. // * `serviceName={some-service}.googleapis.com AND
  5017. // startTime>="2017-02-01"
  5018. // * `serviceName={some-service}.googleapis.com AND status=done`
  5019. // * `serviceName={some-service}.googleapis.com AND (status=done OR
  5020. // startTime>="2017-02-01")`
  5021. func (c *OperationsListCall) Filter(filter string) *OperationsListCall {
  5022. c.urlParams_.Set("filter", filter)
  5023. return c
  5024. }
  5025. // Name sets the optional parameter "name": Not used.
  5026. func (c *OperationsListCall) Name(name string) *OperationsListCall {
  5027. c.urlParams_.Set("name", name)
  5028. return c
  5029. }
  5030. // PageSize sets the optional parameter "pageSize": The maximum number
  5031. // of operations to return. If unspecified, defaults to
  5032. // 50. The maximum value is 100.
  5033. func (c *OperationsListCall) PageSize(pageSize int64) *OperationsListCall {
  5034. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  5035. return c
  5036. }
  5037. // PageToken sets the optional parameter "pageToken": The standard list
  5038. // page token.
  5039. func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall {
  5040. c.urlParams_.Set("pageToken", pageToken)
  5041. return c
  5042. }
  5043. // Fields allows partial responses to be retrieved. See
  5044. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5045. // for more information.
  5046. func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall {
  5047. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5048. return c
  5049. }
  5050. // IfNoneMatch sets the optional parameter which makes the operation
  5051. // fail if the object's ETag matches the given value. This is useful for
  5052. // getting updates only after the object has changed since the last
  5053. // request. Use googleapi.IsNotModified to check whether the response
  5054. // error from Do is the result of In-None-Match.
  5055. func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall {
  5056. c.ifNoneMatch_ = entityTag
  5057. return c
  5058. }
  5059. // Context sets the context to be used in this call's Do method. Any
  5060. // pending HTTP request will be aborted if the provided context is
  5061. // canceled.
  5062. func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall {
  5063. c.ctx_ = ctx
  5064. return c
  5065. }
  5066. // Header returns an http.Header that can be modified by the caller to
  5067. // add HTTP headers to the request.
  5068. func (c *OperationsListCall) Header() http.Header {
  5069. if c.header_ == nil {
  5070. c.header_ = make(http.Header)
  5071. }
  5072. return c.header_
  5073. }
  5074. func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) {
  5075. reqHeaders := make(http.Header)
  5076. for k, v := range c.header_ {
  5077. reqHeaders[k] = v
  5078. }
  5079. reqHeaders.Set("User-Agent", c.s.userAgent())
  5080. if c.ifNoneMatch_ != "" {
  5081. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5082. }
  5083. var body io.Reader = nil
  5084. c.urlParams_.Set("alt", alt)
  5085. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/operations")
  5086. urls += "?" + c.urlParams_.Encode()
  5087. req, _ := http.NewRequest("GET", urls, body)
  5088. req.Header = reqHeaders
  5089. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5090. }
  5091. // Do executes the "servicemanagement.operations.list" call.
  5092. // Exactly one of *ListOperationsResponse or error will be non-nil. Any
  5093. // non-2xx status code is an error. Response headers are in either
  5094. // *ListOperationsResponse.ServerResponse.Header or (if a response was
  5095. // returned at all) in error.(*googleapi.Error).Header. Use
  5096. // googleapi.IsNotModified to check whether the returned error was
  5097. // because http.StatusNotModified was returned.
  5098. func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  5099. gensupport.SetOptions(c.urlParams_, opts...)
  5100. res, err := c.doRequest("json")
  5101. if res != nil && res.StatusCode == http.StatusNotModified {
  5102. if res.Body != nil {
  5103. res.Body.Close()
  5104. }
  5105. return nil, &googleapi.Error{
  5106. Code: res.StatusCode,
  5107. Header: res.Header,
  5108. }
  5109. }
  5110. if err != nil {
  5111. return nil, err
  5112. }
  5113. defer googleapi.CloseBody(res)
  5114. if err := googleapi.CheckResponse(res); err != nil {
  5115. return nil, err
  5116. }
  5117. ret := &ListOperationsResponse{
  5118. ServerResponse: googleapi.ServerResponse{
  5119. Header: res.Header,
  5120. HTTPStatusCode: res.StatusCode,
  5121. },
  5122. }
  5123. target := &ret
  5124. if err := gensupport.DecodeResponse(target, res); err != nil {
  5125. return nil, err
  5126. }
  5127. return ret, nil
  5128. // {
  5129. // "description": "Lists service operations that match the specified filter in the request.",
  5130. // "flatPath": "v1/operations",
  5131. // "httpMethod": "GET",
  5132. // "id": "servicemanagement.operations.list",
  5133. // "parameterOrder": [],
  5134. // "parameters": {
  5135. // "filter": {
  5136. // "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\")`",
  5137. // "location": "query",
  5138. // "type": "string"
  5139. // },
  5140. // "name": {
  5141. // "description": "Not used.",
  5142. // "location": "query",
  5143. // "type": "string"
  5144. // },
  5145. // "pageSize": {
  5146. // "description": "The maximum number of operations to return. If unspecified, defaults to\n50. The maximum value is 100.",
  5147. // "format": "int32",
  5148. // "location": "query",
  5149. // "type": "integer"
  5150. // },
  5151. // "pageToken": {
  5152. // "description": "The standard list page token.",
  5153. // "location": "query",
  5154. // "type": "string"
  5155. // }
  5156. // },
  5157. // "path": "v1/operations",
  5158. // "response": {
  5159. // "$ref": "ListOperationsResponse"
  5160. // },
  5161. // "scopes": [
  5162. // "https://www.googleapis.com/auth/cloud-platform",
  5163. // "https://www.googleapis.com/auth/service.management"
  5164. // ]
  5165. // }
  5166. }
  5167. // Pages invokes f for each page of results.
  5168. // A non-nil error returned from f will halt the iteration.
  5169. // The provided context supersedes any context provided to the Context method.
  5170. func (c *OperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
  5171. c.ctx_ = ctx
  5172. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5173. for {
  5174. x, err := c.Do()
  5175. if err != nil {
  5176. return err
  5177. }
  5178. if err := f(x); err != nil {
  5179. return err
  5180. }
  5181. if x.NextPageToken == "" {
  5182. return nil
  5183. }
  5184. c.PageToken(x.NextPageToken)
  5185. }
  5186. }
  5187. // method id "servicemanagement.services.create":
  5188. type ServicesCreateCall struct {
  5189. s *APIService
  5190. managedservice *ManagedService
  5191. urlParams_ gensupport.URLParams
  5192. ctx_ context.Context
  5193. header_ http.Header
  5194. }
  5195. // Create: Creates a new managed service.
  5196. // Please note one producer project can own no more than 20
  5197. // services.
  5198. //
  5199. // Operation<response: ManagedService>
  5200. func (r *ServicesService) Create(managedservice *ManagedService) *ServicesCreateCall {
  5201. c := &ServicesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5202. c.managedservice = managedservice
  5203. return c
  5204. }
  5205. // Fields allows partial responses to be retrieved. See
  5206. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5207. // for more information.
  5208. func (c *ServicesCreateCall) Fields(s ...googleapi.Field) *ServicesCreateCall {
  5209. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5210. return c
  5211. }
  5212. // Context sets the context to be used in this call's Do method. Any
  5213. // pending HTTP request will be aborted if the provided context is
  5214. // canceled.
  5215. func (c *ServicesCreateCall) Context(ctx context.Context) *ServicesCreateCall {
  5216. c.ctx_ = ctx
  5217. return c
  5218. }
  5219. // Header returns an http.Header that can be modified by the caller to
  5220. // add HTTP headers to the request.
  5221. func (c *ServicesCreateCall) Header() http.Header {
  5222. if c.header_ == nil {
  5223. c.header_ = make(http.Header)
  5224. }
  5225. return c.header_
  5226. }
  5227. func (c *ServicesCreateCall) doRequest(alt string) (*http.Response, error) {
  5228. reqHeaders := make(http.Header)
  5229. for k, v := range c.header_ {
  5230. reqHeaders[k] = v
  5231. }
  5232. reqHeaders.Set("User-Agent", c.s.userAgent())
  5233. var body io.Reader = nil
  5234. body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedservice)
  5235. if err != nil {
  5236. return nil, err
  5237. }
  5238. reqHeaders.Set("Content-Type", "application/json")
  5239. c.urlParams_.Set("alt", alt)
  5240. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services")
  5241. urls += "?" + c.urlParams_.Encode()
  5242. req, _ := http.NewRequest("POST", urls, body)
  5243. req.Header = reqHeaders
  5244. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5245. }
  5246. // Do executes the "servicemanagement.services.create" call.
  5247. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5248. // status code is an error. Response headers are in either
  5249. // *Operation.ServerResponse.Header or (if a response was returned at
  5250. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5251. // to check whether the returned error was because
  5252. // http.StatusNotModified was returned.
  5253. func (c *ServicesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5254. gensupport.SetOptions(c.urlParams_, opts...)
  5255. res, err := c.doRequest("json")
  5256. if res != nil && res.StatusCode == http.StatusNotModified {
  5257. if res.Body != nil {
  5258. res.Body.Close()
  5259. }
  5260. return nil, &googleapi.Error{
  5261. Code: res.StatusCode,
  5262. Header: res.Header,
  5263. }
  5264. }
  5265. if err != nil {
  5266. return nil, err
  5267. }
  5268. defer googleapi.CloseBody(res)
  5269. if err := googleapi.CheckResponse(res); err != nil {
  5270. return nil, err
  5271. }
  5272. ret := &Operation{
  5273. ServerResponse: googleapi.ServerResponse{
  5274. Header: res.Header,
  5275. HTTPStatusCode: res.StatusCode,
  5276. },
  5277. }
  5278. target := &ret
  5279. if err := gensupport.DecodeResponse(target, res); err != nil {
  5280. return nil, err
  5281. }
  5282. return ret, nil
  5283. // {
  5284. // "description": "Creates a new managed service.\nPlease note one producer project can own no more than 20 services.\n\nOperation\u003cresponse: ManagedService\u003e",
  5285. // "flatPath": "v1/services",
  5286. // "httpMethod": "POST",
  5287. // "id": "servicemanagement.services.create",
  5288. // "parameterOrder": [],
  5289. // "parameters": {},
  5290. // "path": "v1/services",
  5291. // "request": {
  5292. // "$ref": "ManagedService"
  5293. // },
  5294. // "response": {
  5295. // "$ref": "Operation"
  5296. // },
  5297. // "scopes": [
  5298. // "https://www.googleapis.com/auth/cloud-platform",
  5299. // "https://www.googleapis.com/auth/service.management"
  5300. // ]
  5301. // }
  5302. }
  5303. // method id "servicemanagement.services.delete":
  5304. type ServicesDeleteCall struct {
  5305. s *APIService
  5306. serviceName string
  5307. urlParams_ gensupport.URLParams
  5308. ctx_ context.Context
  5309. header_ http.Header
  5310. }
  5311. // Delete: Deletes a managed service. This method will change the
  5312. // service to the
  5313. // `Soft-Delete` state for 30 days. Within this period, service
  5314. // producers may
  5315. // call UndeleteService to restore the service.
  5316. // After 30 days, the service will be permanently
  5317. // deleted.
  5318. //
  5319. // Operation<response: google.protobuf.Empty>
  5320. func (r *ServicesService) Delete(serviceName string) *ServicesDeleteCall {
  5321. c := &ServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5322. c.serviceName = serviceName
  5323. return c
  5324. }
  5325. // Fields allows partial responses to be retrieved. See
  5326. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5327. // for more information.
  5328. func (c *ServicesDeleteCall) Fields(s ...googleapi.Field) *ServicesDeleteCall {
  5329. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5330. return c
  5331. }
  5332. // Context sets the context to be used in this call's Do method. Any
  5333. // pending HTTP request will be aborted if the provided context is
  5334. // canceled.
  5335. func (c *ServicesDeleteCall) Context(ctx context.Context) *ServicesDeleteCall {
  5336. c.ctx_ = ctx
  5337. return c
  5338. }
  5339. // Header returns an http.Header that can be modified by the caller to
  5340. // add HTTP headers to the request.
  5341. func (c *ServicesDeleteCall) Header() http.Header {
  5342. if c.header_ == nil {
  5343. c.header_ = make(http.Header)
  5344. }
  5345. return c.header_
  5346. }
  5347. func (c *ServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
  5348. reqHeaders := make(http.Header)
  5349. for k, v := range c.header_ {
  5350. reqHeaders[k] = v
  5351. }
  5352. reqHeaders.Set("User-Agent", c.s.userAgent())
  5353. var body io.Reader = nil
  5354. c.urlParams_.Set("alt", alt)
  5355. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}")
  5356. urls += "?" + c.urlParams_.Encode()
  5357. req, _ := http.NewRequest("DELETE", urls, body)
  5358. req.Header = reqHeaders
  5359. googleapi.Expand(req.URL, map[string]string{
  5360. "serviceName": c.serviceName,
  5361. })
  5362. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5363. }
  5364. // Do executes the "servicemanagement.services.delete" call.
  5365. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5366. // status code is an error. Response headers are in either
  5367. // *Operation.ServerResponse.Header or (if a response was returned at
  5368. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5369. // to check whether the returned error was because
  5370. // http.StatusNotModified was returned.
  5371. func (c *ServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5372. gensupport.SetOptions(c.urlParams_, opts...)
  5373. res, err := c.doRequest("json")
  5374. if res != nil && res.StatusCode == http.StatusNotModified {
  5375. if res.Body != nil {
  5376. res.Body.Close()
  5377. }
  5378. return nil, &googleapi.Error{
  5379. Code: res.StatusCode,
  5380. Header: res.Header,
  5381. }
  5382. }
  5383. if err != nil {
  5384. return nil, err
  5385. }
  5386. defer googleapi.CloseBody(res)
  5387. if err := googleapi.CheckResponse(res); err != nil {
  5388. return nil, err
  5389. }
  5390. ret := &Operation{
  5391. ServerResponse: googleapi.ServerResponse{
  5392. Header: res.Header,
  5393. HTTPStatusCode: res.StatusCode,
  5394. },
  5395. }
  5396. target := &ret
  5397. if err := gensupport.DecodeResponse(target, res); err != nil {
  5398. return nil, err
  5399. }
  5400. return ret, nil
  5401. // {
  5402. // "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",
  5403. // "flatPath": "v1/services/{serviceName}",
  5404. // "httpMethod": "DELETE",
  5405. // "id": "servicemanagement.services.delete",
  5406. // "parameterOrder": [
  5407. // "serviceName"
  5408. // ],
  5409. // "parameters": {
  5410. // "serviceName": {
  5411. // "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`.",
  5412. // "location": "path",
  5413. // "required": true,
  5414. // "type": "string"
  5415. // }
  5416. // },
  5417. // "path": "v1/services/{serviceName}",
  5418. // "response": {
  5419. // "$ref": "Operation"
  5420. // },
  5421. // "scopes": [
  5422. // "https://www.googleapis.com/auth/cloud-platform",
  5423. // "https://www.googleapis.com/auth/service.management"
  5424. // ]
  5425. // }
  5426. }
  5427. // method id "servicemanagement.services.disable":
  5428. type ServicesDisableCall struct {
  5429. s *APIService
  5430. serviceName string
  5431. disableservicerequest *DisableServiceRequest
  5432. urlParams_ gensupport.URLParams
  5433. ctx_ context.Context
  5434. header_ http.Header
  5435. }
  5436. // Disable: Disables a service for a project, so it can no longer be
  5437. // be used for the project. It prevents accidental usage that may
  5438. // cause
  5439. // unexpected billing charges or security leaks.
  5440. //
  5441. // Operation<response: DisableServiceResponse>
  5442. func (r *ServicesService) Disable(serviceName string, disableservicerequest *DisableServiceRequest) *ServicesDisableCall {
  5443. c := &ServicesDisableCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5444. c.serviceName = serviceName
  5445. c.disableservicerequest = disableservicerequest
  5446. return c
  5447. }
  5448. // Fields allows partial responses to be retrieved. See
  5449. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5450. // for more information.
  5451. func (c *ServicesDisableCall) Fields(s ...googleapi.Field) *ServicesDisableCall {
  5452. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5453. return c
  5454. }
  5455. // Context sets the context to be used in this call's Do method. Any
  5456. // pending HTTP request will be aborted if the provided context is
  5457. // canceled.
  5458. func (c *ServicesDisableCall) Context(ctx context.Context) *ServicesDisableCall {
  5459. c.ctx_ = ctx
  5460. return c
  5461. }
  5462. // Header returns an http.Header that can be modified by the caller to
  5463. // add HTTP headers to the request.
  5464. func (c *ServicesDisableCall) Header() http.Header {
  5465. if c.header_ == nil {
  5466. c.header_ = make(http.Header)
  5467. }
  5468. return c.header_
  5469. }
  5470. func (c *ServicesDisableCall) doRequest(alt string) (*http.Response, error) {
  5471. reqHeaders := make(http.Header)
  5472. for k, v := range c.header_ {
  5473. reqHeaders[k] = v
  5474. }
  5475. reqHeaders.Set("User-Agent", c.s.userAgent())
  5476. var body io.Reader = nil
  5477. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disableservicerequest)
  5478. if err != nil {
  5479. return nil, err
  5480. }
  5481. reqHeaders.Set("Content-Type", "application/json")
  5482. c.urlParams_.Set("alt", alt)
  5483. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}:disable")
  5484. urls += "?" + c.urlParams_.Encode()
  5485. req, _ := http.NewRequest("POST", urls, body)
  5486. req.Header = reqHeaders
  5487. googleapi.Expand(req.URL, map[string]string{
  5488. "serviceName": c.serviceName,
  5489. })
  5490. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5491. }
  5492. // Do executes the "servicemanagement.services.disable" call.
  5493. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5494. // status code is an error. Response headers are in either
  5495. // *Operation.ServerResponse.Header or (if a response was returned at
  5496. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5497. // to check whether the returned error was because
  5498. // http.StatusNotModified was returned.
  5499. func (c *ServicesDisableCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5500. gensupport.SetOptions(c.urlParams_, opts...)
  5501. res, err := c.doRequest("json")
  5502. if res != nil && res.StatusCode == http.StatusNotModified {
  5503. if res.Body != nil {
  5504. res.Body.Close()
  5505. }
  5506. return nil, &googleapi.Error{
  5507. Code: res.StatusCode,
  5508. Header: res.Header,
  5509. }
  5510. }
  5511. if err != nil {
  5512. return nil, err
  5513. }
  5514. defer googleapi.CloseBody(res)
  5515. if err := googleapi.CheckResponse(res); err != nil {
  5516. return nil, err
  5517. }
  5518. ret := &Operation{
  5519. ServerResponse: googleapi.ServerResponse{
  5520. Header: res.Header,
  5521. HTTPStatusCode: res.StatusCode,
  5522. },
  5523. }
  5524. target := &ret
  5525. if err := gensupport.DecodeResponse(target, res); err != nil {
  5526. return nil, err
  5527. }
  5528. return ret, nil
  5529. // {
  5530. // "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",
  5531. // "flatPath": "v1/services/{serviceName}:disable",
  5532. // "httpMethod": "POST",
  5533. // "id": "servicemanagement.services.disable",
  5534. // "parameterOrder": [
  5535. // "serviceName"
  5536. // ],
  5537. // "parameters": {
  5538. // "serviceName": {
  5539. // "description": "Name of the service to disable. Specifying an unknown service name\nwill cause the request to fail.",
  5540. // "location": "path",
  5541. // "required": true,
  5542. // "type": "string"
  5543. // }
  5544. // },
  5545. // "path": "v1/services/{serviceName}:disable",
  5546. // "request": {
  5547. // "$ref": "DisableServiceRequest"
  5548. // },
  5549. // "response": {
  5550. // "$ref": "Operation"
  5551. // },
  5552. // "scopes": [
  5553. // "https://www.googleapis.com/auth/cloud-platform",
  5554. // "https://www.googleapis.com/auth/service.management"
  5555. // ]
  5556. // }
  5557. }
  5558. // method id "servicemanagement.services.enable":
  5559. type ServicesEnableCall struct {
  5560. s *APIService
  5561. serviceName string
  5562. enableservicerequest *EnableServiceRequest
  5563. urlParams_ gensupport.URLParams
  5564. ctx_ context.Context
  5565. header_ http.Header
  5566. }
  5567. // Enable: Enables a service for a project, so it can be used
  5568. // for the project. See
  5569. // [Cloud Auth Guide](https://cloud.google.com/docs/authentication)
  5570. // for
  5571. // more information.
  5572. //
  5573. // Operation<response: EnableServiceResponse>
  5574. func (r *ServicesService) Enable(serviceName string, enableservicerequest *EnableServiceRequest) *ServicesEnableCall {
  5575. c := &ServicesEnableCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5576. c.serviceName = serviceName
  5577. c.enableservicerequest = enableservicerequest
  5578. return c
  5579. }
  5580. // Fields allows partial responses to be retrieved. See
  5581. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5582. // for more information.
  5583. func (c *ServicesEnableCall) Fields(s ...googleapi.Field) *ServicesEnableCall {
  5584. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5585. return c
  5586. }
  5587. // Context sets the context to be used in this call's Do method. Any
  5588. // pending HTTP request will be aborted if the provided context is
  5589. // canceled.
  5590. func (c *ServicesEnableCall) Context(ctx context.Context) *ServicesEnableCall {
  5591. c.ctx_ = ctx
  5592. return c
  5593. }
  5594. // Header returns an http.Header that can be modified by the caller to
  5595. // add HTTP headers to the request.
  5596. func (c *ServicesEnableCall) Header() http.Header {
  5597. if c.header_ == nil {
  5598. c.header_ = make(http.Header)
  5599. }
  5600. return c.header_
  5601. }
  5602. func (c *ServicesEnableCall) doRequest(alt string) (*http.Response, error) {
  5603. reqHeaders := make(http.Header)
  5604. for k, v := range c.header_ {
  5605. reqHeaders[k] = v
  5606. }
  5607. reqHeaders.Set("User-Agent", c.s.userAgent())
  5608. var body io.Reader = nil
  5609. body, err := googleapi.WithoutDataWrapper.JSONReader(c.enableservicerequest)
  5610. if err != nil {
  5611. return nil, err
  5612. }
  5613. reqHeaders.Set("Content-Type", "application/json")
  5614. c.urlParams_.Set("alt", alt)
  5615. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}:enable")
  5616. urls += "?" + c.urlParams_.Encode()
  5617. req, _ := http.NewRequest("POST", urls, body)
  5618. req.Header = reqHeaders
  5619. googleapi.Expand(req.URL, map[string]string{
  5620. "serviceName": c.serviceName,
  5621. })
  5622. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5623. }
  5624. // Do executes the "servicemanagement.services.enable" call.
  5625. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5626. // status code is an error. Response headers are in either
  5627. // *Operation.ServerResponse.Header or (if a response was returned at
  5628. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5629. // to check whether the returned error was because
  5630. // http.StatusNotModified was returned.
  5631. func (c *ServicesEnableCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5632. gensupport.SetOptions(c.urlParams_, opts...)
  5633. res, err := c.doRequest("json")
  5634. if res != nil && res.StatusCode == http.StatusNotModified {
  5635. if res.Body != nil {
  5636. res.Body.Close()
  5637. }
  5638. return nil, &googleapi.Error{
  5639. Code: res.StatusCode,
  5640. Header: res.Header,
  5641. }
  5642. }
  5643. if err != nil {
  5644. return nil, err
  5645. }
  5646. defer googleapi.CloseBody(res)
  5647. if err := googleapi.CheckResponse(res); err != nil {
  5648. return nil, err
  5649. }
  5650. ret := &Operation{
  5651. ServerResponse: googleapi.ServerResponse{
  5652. Header: res.Header,
  5653. HTTPStatusCode: res.StatusCode,
  5654. },
  5655. }
  5656. target := &ret
  5657. if err := gensupport.DecodeResponse(target, res); err != nil {
  5658. return nil, err
  5659. }
  5660. return ret, nil
  5661. // {
  5662. // "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",
  5663. // "flatPath": "v1/services/{serviceName}:enable",
  5664. // "httpMethod": "POST",
  5665. // "id": "servicemanagement.services.enable",
  5666. // "parameterOrder": [
  5667. // "serviceName"
  5668. // ],
  5669. // "parameters": {
  5670. // "serviceName": {
  5671. // "description": "Name of the service to enable. Specifying an unknown service name will\ncause the request to fail.",
  5672. // "location": "path",
  5673. // "required": true,
  5674. // "type": "string"
  5675. // }
  5676. // },
  5677. // "path": "v1/services/{serviceName}:enable",
  5678. // "request": {
  5679. // "$ref": "EnableServiceRequest"
  5680. // },
  5681. // "response": {
  5682. // "$ref": "Operation"
  5683. // },
  5684. // "scopes": [
  5685. // "https://www.googleapis.com/auth/cloud-platform",
  5686. // "https://www.googleapis.com/auth/service.management"
  5687. // ]
  5688. // }
  5689. }
  5690. // method id "servicemanagement.services.generateConfigReport":
  5691. type ServicesGenerateConfigReportCall struct {
  5692. s *APIService
  5693. generateconfigreportrequest *GenerateConfigReportRequest
  5694. urlParams_ gensupport.URLParams
  5695. ctx_ context.Context
  5696. header_ http.Header
  5697. }
  5698. // GenerateConfigReport: Generates and returns a report (errors,
  5699. // warnings and changes from
  5700. // existing configurations) associated
  5701. // with
  5702. // GenerateConfigReportRequest.new_value
  5703. //
  5704. // If GenerateConfigReportRequest.old_value is
  5705. // specified,
  5706. // GenerateConfigReportRequest will contain a single ChangeReport based
  5707. // on the
  5708. // comparison between GenerateConfigReportRequest.new_value
  5709. // and
  5710. // GenerateConfigReportRequest.old_value.
  5711. // If GenerateConfigReportRequest.old_value is not specified, this
  5712. // method
  5713. // will compare GenerateConfigReportRequest.new_value with the last
  5714. // pushed
  5715. // service configuration.
  5716. func (r *ServicesService) GenerateConfigReport(generateconfigreportrequest *GenerateConfigReportRequest) *ServicesGenerateConfigReportCall {
  5717. c := &ServicesGenerateConfigReportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5718. c.generateconfigreportrequest = generateconfigreportrequest
  5719. return c
  5720. }
  5721. // Fields allows partial responses to be retrieved. See
  5722. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5723. // for more information.
  5724. func (c *ServicesGenerateConfigReportCall) Fields(s ...googleapi.Field) *ServicesGenerateConfigReportCall {
  5725. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5726. return c
  5727. }
  5728. // Context sets the context to be used in this call's Do method. Any
  5729. // pending HTTP request will be aborted if the provided context is
  5730. // canceled.
  5731. func (c *ServicesGenerateConfigReportCall) Context(ctx context.Context) *ServicesGenerateConfigReportCall {
  5732. c.ctx_ = ctx
  5733. return c
  5734. }
  5735. // Header returns an http.Header that can be modified by the caller to
  5736. // add HTTP headers to the request.
  5737. func (c *ServicesGenerateConfigReportCall) Header() http.Header {
  5738. if c.header_ == nil {
  5739. c.header_ = make(http.Header)
  5740. }
  5741. return c.header_
  5742. }
  5743. func (c *ServicesGenerateConfigReportCall) doRequest(alt string) (*http.Response, error) {
  5744. reqHeaders := make(http.Header)
  5745. for k, v := range c.header_ {
  5746. reqHeaders[k] = v
  5747. }
  5748. reqHeaders.Set("User-Agent", c.s.userAgent())
  5749. var body io.Reader = nil
  5750. body, err := googleapi.WithoutDataWrapper.JSONReader(c.generateconfigreportrequest)
  5751. if err != nil {
  5752. return nil, err
  5753. }
  5754. reqHeaders.Set("Content-Type", "application/json")
  5755. c.urlParams_.Set("alt", alt)
  5756. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services:generateConfigReport")
  5757. urls += "?" + c.urlParams_.Encode()
  5758. req, _ := http.NewRequest("POST", urls, body)
  5759. req.Header = reqHeaders
  5760. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5761. }
  5762. // Do executes the "servicemanagement.services.generateConfigReport" call.
  5763. // Exactly one of *GenerateConfigReportResponse or error will be
  5764. // non-nil. Any non-2xx status code is an error. Response headers are in
  5765. // either *GenerateConfigReportResponse.ServerResponse.Header or (if a
  5766. // response was returned at all) in error.(*googleapi.Error).Header. Use
  5767. // googleapi.IsNotModified to check whether the returned error was
  5768. // because http.StatusNotModified was returned.
  5769. func (c *ServicesGenerateConfigReportCall) Do(opts ...googleapi.CallOption) (*GenerateConfigReportResponse, error) {
  5770. gensupport.SetOptions(c.urlParams_, opts...)
  5771. res, err := c.doRequest("json")
  5772. if res != nil && res.StatusCode == http.StatusNotModified {
  5773. if res.Body != nil {
  5774. res.Body.Close()
  5775. }
  5776. return nil, &googleapi.Error{
  5777. Code: res.StatusCode,
  5778. Header: res.Header,
  5779. }
  5780. }
  5781. if err != nil {
  5782. return nil, err
  5783. }
  5784. defer googleapi.CloseBody(res)
  5785. if err := googleapi.CheckResponse(res); err != nil {
  5786. return nil, err
  5787. }
  5788. ret := &GenerateConfigReportResponse{
  5789. ServerResponse: googleapi.ServerResponse{
  5790. Header: res.Header,
  5791. HTTPStatusCode: res.StatusCode,
  5792. },
  5793. }
  5794. target := &ret
  5795. if err := gensupport.DecodeResponse(target, res); err != nil {
  5796. return nil, err
  5797. }
  5798. return ret, nil
  5799. // {
  5800. // "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.",
  5801. // "flatPath": "v1/services:generateConfigReport",
  5802. // "httpMethod": "POST",
  5803. // "id": "servicemanagement.services.generateConfigReport",
  5804. // "parameterOrder": [],
  5805. // "parameters": {},
  5806. // "path": "v1/services:generateConfigReport",
  5807. // "request": {
  5808. // "$ref": "GenerateConfigReportRequest"
  5809. // },
  5810. // "response": {
  5811. // "$ref": "GenerateConfigReportResponse"
  5812. // },
  5813. // "scopes": [
  5814. // "https://www.googleapis.com/auth/cloud-platform",
  5815. // "https://www.googleapis.com/auth/service.management"
  5816. // ]
  5817. // }
  5818. }
  5819. // method id "servicemanagement.services.get":
  5820. type ServicesGetCall struct {
  5821. s *APIService
  5822. serviceName string
  5823. urlParams_ gensupport.URLParams
  5824. ifNoneMatch_ string
  5825. ctx_ context.Context
  5826. header_ http.Header
  5827. }
  5828. // Get: Gets a managed service. Authentication is required unless the
  5829. // service is
  5830. // public.
  5831. func (r *ServicesService) Get(serviceName string) *ServicesGetCall {
  5832. c := &ServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5833. c.serviceName = serviceName
  5834. return c
  5835. }
  5836. // Fields allows partial responses to be retrieved. See
  5837. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5838. // for more information.
  5839. func (c *ServicesGetCall) Fields(s ...googleapi.Field) *ServicesGetCall {
  5840. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5841. return c
  5842. }
  5843. // IfNoneMatch sets the optional parameter which makes the operation
  5844. // fail if the object's ETag matches the given value. This is useful for
  5845. // getting updates only after the object has changed since the last
  5846. // request. Use googleapi.IsNotModified to check whether the response
  5847. // error from Do is the result of In-None-Match.
  5848. func (c *ServicesGetCall) IfNoneMatch(entityTag string) *ServicesGetCall {
  5849. c.ifNoneMatch_ = entityTag
  5850. return c
  5851. }
  5852. // Context sets the context to be used in this call's Do method. Any
  5853. // pending HTTP request will be aborted if the provided context is
  5854. // canceled.
  5855. func (c *ServicesGetCall) Context(ctx context.Context) *ServicesGetCall {
  5856. c.ctx_ = ctx
  5857. return c
  5858. }
  5859. // Header returns an http.Header that can be modified by the caller to
  5860. // add HTTP headers to the request.
  5861. func (c *ServicesGetCall) Header() http.Header {
  5862. if c.header_ == nil {
  5863. c.header_ = make(http.Header)
  5864. }
  5865. return c.header_
  5866. }
  5867. func (c *ServicesGetCall) doRequest(alt string) (*http.Response, error) {
  5868. reqHeaders := make(http.Header)
  5869. for k, v := range c.header_ {
  5870. reqHeaders[k] = v
  5871. }
  5872. reqHeaders.Set("User-Agent", c.s.userAgent())
  5873. if c.ifNoneMatch_ != "" {
  5874. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5875. }
  5876. var body io.Reader = nil
  5877. c.urlParams_.Set("alt", alt)
  5878. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}")
  5879. urls += "?" + c.urlParams_.Encode()
  5880. req, _ := http.NewRequest("GET", urls, body)
  5881. req.Header = reqHeaders
  5882. googleapi.Expand(req.URL, map[string]string{
  5883. "serviceName": c.serviceName,
  5884. })
  5885. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5886. }
  5887. // Do executes the "servicemanagement.services.get" call.
  5888. // Exactly one of *ManagedService or error will be non-nil. Any non-2xx
  5889. // status code is an error. Response headers are in either
  5890. // *ManagedService.ServerResponse.Header or (if a response was returned
  5891. // at all) in error.(*googleapi.Error).Header. Use
  5892. // googleapi.IsNotModified to check whether the returned error was
  5893. // because http.StatusNotModified was returned.
  5894. func (c *ServicesGetCall) Do(opts ...googleapi.CallOption) (*ManagedService, error) {
  5895. gensupport.SetOptions(c.urlParams_, opts...)
  5896. res, err := c.doRequest("json")
  5897. if res != nil && res.StatusCode == http.StatusNotModified {
  5898. if res.Body != nil {
  5899. res.Body.Close()
  5900. }
  5901. return nil, &googleapi.Error{
  5902. Code: res.StatusCode,
  5903. Header: res.Header,
  5904. }
  5905. }
  5906. if err != nil {
  5907. return nil, err
  5908. }
  5909. defer googleapi.CloseBody(res)
  5910. if err := googleapi.CheckResponse(res); err != nil {
  5911. return nil, err
  5912. }
  5913. ret := &ManagedService{
  5914. ServerResponse: googleapi.ServerResponse{
  5915. Header: res.Header,
  5916. HTTPStatusCode: res.StatusCode,
  5917. },
  5918. }
  5919. target := &ret
  5920. if err := gensupport.DecodeResponse(target, res); err != nil {
  5921. return nil, err
  5922. }
  5923. return ret, nil
  5924. // {
  5925. // "description": "Gets a managed service. Authentication is required unless the service is\npublic.",
  5926. // "flatPath": "v1/services/{serviceName}",
  5927. // "httpMethod": "GET",
  5928. // "id": "servicemanagement.services.get",
  5929. // "parameterOrder": [
  5930. // "serviceName"
  5931. // ],
  5932. // "parameters": {
  5933. // "serviceName": {
  5934. // "description": "The name of the service. See the `ServiceManager` overview for naming\nrequirements. For example: `example.googleapis.com`.",
  5935. // "location": "path",
  5936. // "required": true,
  5937. // "type": "string"
  5938. // }
  5939. // },
  5940. // "path": "v1/services/{serviceName}",
  5941. // "response": {
  5942. // "$ref": "ManagedService"
  5943. // },
  5944. // "scopes": [
  5945. // "https://www.googleapis.com/auth/cloud-platform",
  5946. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  5947. // "https://www.googleapis.com/auth/service.management",
  5948. // "https://www.googleapis.com/auth/service.management.readonly"
  5949. // ]
  5950. // }
  5951. }
  5952. // method id "servicemanagement.services.getConfig":
  5953. type ServicesGetConfigCall struct {
  5954. s *APIService
  5955. serviceName string
  5956. urlParams_ gensupport.URLParams
  5957. ifNoneMatch_ string
  5958. ctx_ context.Context
  5959. header_ http.Header
  5960. }
  5961. // GetConfig: Gets a service configuration (version) for a managed
  5962. // service.
  5963. func (r *ServicesService) GetConfig(serviceName string) *ServicesGetConfigCall {
  5964. c := &ServicesGetConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5965. c.serviceName = serviceName
  5966. return c
  5967. }
  5968. // ConfigId sets the optional parameter "configId": The id of the
  5969. // service configuration resource.
  5970. func (c *ServicesGetConfigCall) ConfigId(configId string) *ServicesGetConfigCall {
  5971. c.urlParams_.Set("configId", configId)
  5972. return c
  5973. }
  5974. // View sets the optional parameter "view": Specifies which parts of the
  5975. // Service Config should be returned in the
  5976. // response.
  5977. //
  5978. // Possible values:
  5979. // "BASIC"
  5980. // "FULL"
  5981. func (c *ServicesGetConfigCall) View(view string) *ServicesGetConfigCall {
  5982. c.urlParams_.Set("view", view)
  5983. return c
  5984. }
  5985. // Fields allows partial responses to be retrieved. See
  5986. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5987. // for more information.
  5988. func (c *ServicesGetConfigCall) Fields(s ...googleapi.Field) *ServicesGetConfigCall {
  5989. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5990. return c
  5991. }
  5992. // IfNoneMatch sets the optional parameter which makes the operation
  5993. // fail if the object's ETag matches the given value. This is useful for
  5994. // getting updates only after the object has changed since the last
  5995. // request. Use googleapi.IsNotModified to check whether the response
  5996. // error from Do is the result of In-None-Match.
  5997. func (c *ServicesGetConfigCall) IfNoneMatch(entityTag string) *ServicesGetConfigCall {
  5998. c.ifNoneMatch_ = entityTag
  5999. return c
  6000. }
  6001. // Context sets the context to be used in this call's Do method. Any
  6002. // pending HTTP request will be aborted if the provided context is
  6003. // canceled.
  6004. func (c *ServicesGetConfigCall) Context(ctx context.Context) *ServicesGetConfigCall {
  6005. c.ctx_ = ctx
  6006. return c
  6007. }
  6008. // Header returns an http.Header that can be modified by the caller to
  6009. // add HTTP headers to the request.
  6010. func (c *ServicesGetConfigCall) Header() http.Header {
  6011. if c.header_ == nil {
  6012. c.header_ = make(http.Header)
  6013. }
  6014. return c.header_
  6015. }
  6016. func (c *ServicesGetConfigCall) doRequest(alt string) (*http.Response, error) {
  6017. reqHeaders := make(http.Header)
  6018. for k, v := range c.header_ {
  6019. reqHeaders[k] = v
  6020. }
  6021. reqHeaders.Set("User-Agent", c.s.userAgent())
  6022. if c.ifNoneMatch_ != "" {
  6023. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6024. }
  6025. var body io.Reader = nil
  6026. c.urlParams_.Set("alt", alt)
  6027. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}/config")
  6028. urls += "?" + c.urlParams_.Encode()
  6029. req, _ := http.NewRequest("GET", urls, body)
  6030. req.Header = reqHeaders
  6031. googleapi.Expand(req.URL, map[string]string{
  6032. "serviceName": c.serviceName,
  6033. })
  6034. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6035. }
  6036. // Do executes the "servicemanagement.services.getConfig" call.
  6037. // Exactly one of *Service or error will be non-nil. Any non-2xx status
  6038. // code is an error. Response headers are in either
  6039. // *Service.ServerResponse.Header or (if a response was returned at all)
  6040. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6041. // check whether the returned error was because http.StatusNotModified
  6042. // was returned.
  6043. func (c *ServicesGetConfigCall) Do(opts ...googleapi.CallOption) (*Service, error) {
  6044. gensupport.SetOptions(c.urlParams_, opts...)
  6045. res, err := c.doRequest("json")
  6046. if res != nil && res.StatusCode == http.StatusNotModified {
  6047. if res.Body != nil {
  6048. res.Body.Close()
  6049. }
  6050. return nil, &googleapi.Error{
  6051. Code: res.StatusCode,
  6052. Header: res.Header,
  6053. }
  6054. }
  6055. if err != nil {
  6056. return nil, err
  6057. }
  6058. defer googleapi.CloseBody(res)
  6059. if err := googleapi.CheckResponse(res); err != nil {
  6060. return nil, err
  6061. }
  6062. ret := &Service{
  6063. ServerResponse: googleapi.ServerResponse{
  6064. Header: res.Header,
  6065. HTTPStatusCode: res.StatusCode,
  6066. },
  6067. }
  6068. target := &ret
  6069. if err := gensupport.DecodeResponse(target, res); err != nil {
  6070. return nil, err
  6071. }
  6072. return ret, nil
  6073. // {
  6074. // "description": "Gets a service configuration (version) for a managed service.",
  6075. // "flatPath": "v1/services/{serviceName}/config",
  6076. // "httpMethod": "GET",
  6077. // "id": "servicemanagement.services.getConfig",
  6078. // "parameterOrder": [
  6079. // "serviceName"
  6080. // ],
  6081. // "parameters": {
  6082. // "configId": {
  6083. // "description": "The id of the service configuration resource.",
  6084. // "location": "query",
  6085. // "type": "string"
  6086. // },
  6087. // "serviceName": {
  6088. // "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`.",
  6089. // "location": "path",
  6090. // "required": true,
  6091. // "type": "string"
  6092. // },
  6093. // "view": {
  6094. // "description": "Specifies which parts of the Service Config should be returned in the\nresponse.",
  6095. // "enum": [
  6096. // "BASIC",
  6097. // "FULL"
  6098. // ],
  6099. // "location": "query",
  6100. // "type": "string"
  6101. // }
  6102. // },
  6103. // "path": "v1/services/{serviceName}/config",
  6104. // "response": {
  6105. // "$ref": "Service"
  6106. // },
  6107. // "scopes": [
  6108. // "https://www.googleapis.com/auth/cloud-platform",
  6109. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  6110. // "https://www.googleapis.com/auth/service.management",
  6111. // "https://www.googleapis.com/auth/service.management.readonly"
  6112. // ]
  6113. // }
  6114. }
  6115. // method id "servicemanagement.services.getIamPolicy":
  6116. type ServicesGetIamPolicyCall struct {
  6117. s *APIService
  6118. resource string
  6119. getiampolicyrequest *GetIamPolicyRequest
  6120. urlParams_ gensupport.URLParams
  6121. ctx_ context.Context
  6122. header_ http.Header
  6123. }
  6124. // GetIamPolicy: Gets the access control policy for a resource.
  6125. // Returns an empty policy if the resource exists and does not have a
  6126. // policy
  6127. // set.
  6128. func (r *ServicesService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ServicesGetIamPolicyCall {
  6129. c := &ServicesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6130. c.resource = resource
  6131. c.getiampolicyrequest = getiampolicyrequest
  6132. return c
  6133. }
  6134. // Fields allows partial responses to be retrieved. See
  6135. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6136. // for more information.
  6137. func (c *ServicesGetIamPolicyCall) Fields(s ...googleapi.Field) *ServicesGetIamPolicyCall {
  6138. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6139. return c
  6140. }
  6141. // Context sets the context to be used in this call's Do method. Any
  6142. // pending HTTP request will be aborted if the provided context is
  6143. // canceled.
  6144. func (c *ServicesGetIamPolicyCall) Context(ctx context.Context) *ServicesGetIamPolicyCall {
  6145. c.ctx_ = ctx
  6146. return c
  6147. }
  6148. // Header returns an http.Header that can be modified by the caller to
  6149. // add HTTP headers to the request.
  6150. func (c *ServicesGetIamPolicyCall) Header() http.Header {
  6151. if c.header_ == nil {
  6152. c.header_ = make(http.Header)
  6153. }
  6154. return c.header_
  6155. }
  6156. func (c *ServicesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  6157. reqHeaders := make(http.Header)
  6158. for k, v := range c.header_ {
  6159. reqHeaders[k] = v
  6160. }
  6161. reqHeaders.Set("User-Agent", c.s.userAgent())
  6162. var body io.Reader = nil
  6163. body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest)
  6164. if err != nil {
  6165. return nil, err
  6166. }
  6167. reqHeaders.Set("Content-Type", "application/json")
  6168. c.urlParams_.Set("alt", alt)
  6169. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
  6170. urls += "?" + c.urlParams_.Encode()
  6171. req, _ := http.NewRequest("POST", urls, body)
  6172. req.Header = reqHeaders
  6173. googleapi.Expand(req.URL, map[string]string{
  6174. "resource": c.resource,
  6175. })
  6176. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6177. }
  6178. // Do executes the "servicemanagement.services.getIamPolicy" call.
  6179. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  6180. // code is an error. Response headers are in either
  6181. // *Policy.ServerResponse.Header or (if a response was returned at all)
  6182. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6183. // check whether the returned error was because http.StatusNotModified
  6184. // was returned.
  6185. func (c *ServicesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  6186. gensupport.SetOptions(c.urlParams_, opts...)
  6187. res, err := c.doRequest("json")
  6188. if res != nil && res.StatusCode == http.StatusNotModified {
  6189. if res.Body != nil {
  6190. res.Body.Close()
  6191. }
  6192. return nil, &googleapi.Error{
  6193. Code: res.StatusCode,
  6194. Header: res.Header,
  6195. }
  6196. }
  6197. if err != nil {
  6198. return nil, err
  6199. }
  6200. defer googleapi.CloseBody(res)
  6201. if err := googleapi.CheckResponse(res); err != nil {
  6202. return nil, err
  6203. }
  6204. ret := &Policy{
  6205. ServerResponse: googleapi.ServerResponse{
  6206. Header: res.Header,
  6207. HTTPStatusCode: res.StatusCode,
  6208. },
  6209. }
  6210. target := &ret
  6211. if err := gensupport.DecodeResponse(target, res); err != nil {
  6212. return nil, err
  6213. }
  6214. return ret, nil
  6215. // {
  6216. // "description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset.",
  6217. // "flatPath": "v1/services/{servicesId}:getIamPolicy",
  6218. // "httpMethod": "POST",
  6219. // "id": "servicemanagement.services.getIamPolicy",
  6220. // "parameterOrder": [
  6221. // "resource"
  6222. // ],
  6223. // "parameters": {
  6224. // "resource": {
  6225. // "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.",
  6226. // "location": "path",
  6227. // "pattern": "^services/[^/]+$",
  6228. // "required": true,
  6229. // "type": "string"
  6230. // }
  6231. // },
  6232. // "path": "v1/{+resource}:getIamPolicy",
  6233. // "request": {
  6234. // "$ref": "GetIamPolicyRequest"
  6235. // },
  6236. // "response": {
  6237. // "$ref": "Policy"
  6238. // },
  6239. // "scopes": [
  6240. // "https://www.googleapis.com/auth/cloud-platform",
  6241. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  6242. // "https://www.googleapis.com/auth/service.management",
  6243. // "https://www.googleapis.com/auth/service.management.readonly"
  6244. // ]
  6245. // }
  6246. }
  6247. // method id "servicemanagement.services.list":
  6248. type ServicesListCall struct {
  6249. s *APIService
  6250. urlParams_ gensupport.URLParams
  6251. ifNoneMatch_ string
  6252. ctx_ context.Context
  6253. header_ http.Header
  6254. }
  6255. // List: Lists managed services.
  6256. //
  6257. // Returns all public services. For authenticated users, also returns
  6258. // all
  6259. // services the calling user has "servicemanagement.services.get"
  6260. // permission
  6261. // for.
  6262. //
  6263. // **BETA:** If the caller specifies the `consumer_id`, it returns only
  6264. // the
  6265. // services enabled on the consumer. The `consumer_id` must have the
  6266. // format
  6267. // of "project:{PROJECT-ID}".
  6268. func (r *ServicesService) List() *ServicesListCall {
  6269. c := &ServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6270. return c
  6271. }
  6272. // ConsumerId sets the optional parameter "consumerId": Include services
  6273. // consumed by the specified consumer.
  6274. //
  6275. // The Google Service Management implementation accepts the
  6276. // following
  6277. // forms:
  6278. // - project:<project_id>
  6279. func (c *ServicesListCall) ConsumerId(consumerId string) *ServicesListCall {
  6280. c.urlParams_.Set("consumerId", consumerId)
  6281. return c
  6282. }
  6283. // PageSize sets the optional parameter "pageSize": Requested size of
  6284. // the next page of data.
  6285. func (c *ServicesListCall) PageSize(pageSize int64) *ServicesListCall {
  6286. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  6287. return c
  6288. }
  6289. // PageToken sets the optional parameter "pageToken": Token identifying
  6290. // which result to start with; returned by a previous list
  6291. // call.
  6292. func (c *ServicesListCall) PageToken(pageToken string) *ServicesListCall {
  6293. c.urlParams_.Set("pageToken", pageToken)
  6294. return c
  6295. }
  6296. // ProducerProjectId sets the optional parameter "producerProjectId":
  6297. // Include services produced by the specified project.
  6298. func (c *ServicesListCall) ProducerProjectId(producerProjectId string) *ServicesListCall {
  6299. c.urlParams_.Set("producerProjectId", producerProjectId)
  6300. return c
  6301. }
  6302. // Fields allows partial responses to be retrieved. See
  6303. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6304. // for more information.
  6305. func (c *ServicesListCall) Fields(s ...googleapi.Field) *ServicesListCall {
  6306. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6307. return c
  6308. }
  6309. // IfNoneMatch sets the optional parameter which makes the operation
  6310. // fail if the object's ETag matches the given value. This is useful for
  6311. // getting updates only after the object has changed since the last
  6312. // request. Use googleapi.IsNotModified to check whether the response
  6313. // error from Do is the result of In-None-Match.
  6314. func (c *ServicesListCall) IfNoneMatch(entityTag string) *ServicesListCall {
  6315. c.ifNoneMatch_ = entityTag
  6316. return c
  6317. }
  6318. // Context sets the context to be used in this call's Do method. Any
  6319. // pending HTTP request will be aborted if the provided context is
  6320. // canceled.
  6321. func (c *ServicesListCall) Context(ctx context.Context) *ServicesListCall {
  6322. c.ctx_ = ctx
  6323. return c
  6324. }
  6325. // Header returns an http.Header that can be modified by the caller to
  6326. // add HTTP headers to the request.
  6327. func (c *ServicesListCall) Header() http.Header {
  6328. if c.header_ == nil {
  6329. c.header_ = make(http.Header)
  6330. }
  6331. return c.header_
  6332. }
  6333. func (c *ServicesListCall) doRequest(alt string) (*http.Response, error) {
  6334. reqHeaders := make(http.Header)
  6335. for k, v := range c.header_ {
  6336. reqHeaders[k] = v
  6337. }
  6338. reqHeaders.Set("User-Agent", c.s.userAgent())
  6339. if c.ifNoneMatch_ != "" {
  6340. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6341. }
  6342. var body io.Reader = nil
  6343. c.urlParams_.Set("alt", alt)
  6344. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services")
  6345. urls += "?" + c.urlParams_.Encode()
  6346. req, _ := http.NewRequest("GET", urls, body)
  6347. req.Header = reqHeaders
  6348. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6349. }
  6350. // Do executes the "servicemanagement.services.list" call.
  6351. // Exactly one of *ListServicesResponse or error will be non-nil. Any
  6352. // non-2xx status code is an error. Response headers are in either
  6353. // *ListServicesResponse.ServerResponse.Header or (if a response was
  6354. // returned at all) in error.(*googleapi.Error).Header. Use
  6355. // googleapi.IsNotModified to check whether the returned error was
  6356. // because http.StatusNotModified was returned.
  6357. func (c *ServicesListCall) Do(opts ...googleapi.CallOption) (*ListServicesResponse, error) {
  6358. gensupport.SetOptions(c.urlParams_, opts...)
  6359. res, err := c.doRequest("json")
  6360. if res != nil && res.StatusCode == http.StatusNotModified {
  6361. if res.Body != nil {
  6362. res.Body.Close()
  6363. }
  6364. return nil, &googleapi.Error{
  6365. Code: res.StatusCode,
  6366. Header: res.Header,
  6367. }
  6368. }
  6369. if err != nil {
  6370. return nil, err
  6371. }
  6372. defer googleapi.CloseBody(res)
  6373. if err := googleapi.CheckResponse(res); err != nil {
  6374. return nil, err
  6375. }
  6376. ret := &ListServicesResponse{
  6377. ServerResponse: googleapi.ServerResponse{
  6378. Header: res.Header,
  6379. HTTPStatusCode: res.StatusCode,
  6380. },
  6381. }
  6382. target := &ret
  6383. if err := gensupport.DecodeResponse(target, res); err != nil {
  6384. return nil, err
  6385. }
  6386. return ret, nil
  6387. // {
  6388. // "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}\".",
  6389. // "flatPath": "v1/services",
  6390. // "httpMethod": "GET",
  6391. // "id": "servicemanagement.services.list",
  6392. // "parameterOrder": [],
  6393. // "parameters": {
  6394. // "consumerId": {
  6395. // "description": "Include services consumed by the specified consumer.\n\nThe Google Service Management implementation accepts the following\nforms:\n- project:\u003cproject_id\u003e",
  6396. // "location": "query",
  6397. // "type": "string"
  6398. // },
  6399. // "pageSize": {
  6400. // "description": "Requested size of the next page of data.",
  6401. // "format": "int32",
  6402. // "location": "query",
  6403. // "type": "integer"
  6404. // },
  6405. // "pageToken": {
  6406. // "description": "Token identifying which result to start with; returned by a previous list\ncall.",
  6407. // "location": "query",
  6408. // "type": "string"
  6409. // },
  6410. // "producerProjectId": {
  6411. // "description": "Include services produced by the specified project.",
  6412. // "location": "query",
  6413. // "type": "string"
  6414. // }
  6415. // },
  6416. // "path": "v1/services",
  6417. // "response": {
  6418. // "$ref": "ListServicesResponse"
  6419. // },
  6420. // "scopes": [
  6421. // "https://www.googleapis.com/auth/cloud-platform",
  6422. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  6423. // "https://www.googleapis.com/auth/service.management",
  6424. // "https://www.googleapis.com/auth/service.management.readonly"
  6425. // ]
  6426. // }
  6427. }
  6428. // Pages invokes f for each page of results.
  6429. // A non-nil error returned from f will halt the iteration.
  6430. // The provided context supersedes any context provided to the Context method.
  6431. func (c *ServicesListCall) Pages(ctx context.Context, f func(*ListServicesResponse) error) error {
  6432. c.ctx_ = ctx
  6433. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6434. for {
  6435. x, err := c.Do()
  6436. if err != nil {
  6437. return err
  6438. }
  6439. if err := f(x); err != nil {
  6440. return err
  6441. }
  6442. if x.NextPageToken == "" {
  6443. return nil
  6444. }
  6445. c.PageToken(x.NextPageToken)
  6446. }
  6447. }
  6448. // method id "servicemanagement.services.setIamPolicy":
  6449. type ServicesSetIamPolicyCall struct {
  6450. s *APIService
  6451. resource string
  6452. setiampolicyrequest *SetIamPolicyRequest
  6453. urlParams_ gensupport.URLParams
  6454. ctx_ context.Context
  6455. header_ http.Header
  6456. }
  6457. // SetIamPolicy: Sets the access control policy on the specified
  6458. // resource. Replaces any
  6459. // existing policy.
  6460. func (r *ServicesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ServicesSetIamPolicyCall {
  6461. c := &ServicesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6462. c.resource = resource
  6463. c.setiampolicyrequest = setiampolicyrequest
  6464. return c
  6465. }
  6466. // Fields allows partial responses to be retrieved. See
  6467. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6468. // for more information.
  6469. func (c *ServicesSetIamPolicyCall) Fields(s ...googleapi.Field) *ServicesSetIamPolicyCall {
  6470. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6471. return c
  6472. }
  6473. // Context sets the context to be used in this call's Do method. Any
  6474. // pending HTTP request will be aborted if the provided context is
  6475. // canceled.
  6476. func (c *ServicesSetIamPolicyCall) Context(ctx context.Context) *ServicesSetIamPolicyCall {
  6477. c.ctx_ = ctx
  6478. return c
  6479. }
  6480. // Header returns an http.Header that can be modified by the caller to
  6481. // add HTTP headers to the request.
  6482. func (c *ServicesSetIamPolicyCall) Header() http.Header {
  6483. if c.header_ == nil {
  6484. c.header_ = make(http.Header)
  6485. }
  6486. return c.header_
  6487. }
  6488. func (c *ServicesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  6489. reqHeaders := make(http.Header)
  6490. for k, v := range c.header_ {
  6491. reqHeaders[k] = v
  6492. }
  6493. reqHeaders.Set("User-Agent", c.s.userAgent())
  6494. var body io.Reader = nil
  6495. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  6496. if err != nil {
  6497. return nil, err
  6498. }
  6499. reqHeaders.Set("Content-Type", "application/json")
  6500. c.urlParams_.Set("alt", alt)
  6501. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
  6502. urls += "?" + c.urlParams_.Encode()
  6503. req, _ := http.NewRequest("POST", urls, body)
  6504. req.Header = reqHeaders
  6505. googleapi.Expand(req.URL, map[string]string{
  6506. "resource": c.resource,
  6507. })
  6508. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6509. }
  6510. // Do executes the "servicemanagement.services.setIamPolicy" call.
  6511. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  6512. // code is an error. Response headers are in either
  6513. // *Policy.ServerResponse.Header or (if a response was returned at all)
  6514. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6515. // check whether the returned error was because http.StatusNotModified
  6516. // was returned.
  6517. func (c *ServicesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  6518. gensupport.SetOptions(c.urlParams_, opts...)
  6519. res, err := c.doRequest("json")
  6520. if res != nil && res.StatusCode == http.StatusNotModified {
  6521. if res.Body != nil {
  6522. res.Body.Close()
  6523. }
  6524. return nil, &googleapi.Error{
  6525. Code: res.StatusCode,
  6526. Header: res.Header,
  6527. }
  6528. }
  6529. if err != nil {
  6530. return nil, err
  6531. }
  6532. defer googleapi.CloseBody(res)
  6533. if err := googleapi.CheckResponse(res); err != nil {
  6534. return nil, err
  6535. }
  6536. ret := &Policy{
  6537. ServerResponse: googleapi.ServerResponse{
  6538. Header: res.Header,
  6539. HTTPStatusCode: res.StatusCode,
  6540. },
  6541. }
  6542. target := &ret
  6543. if err := gensupport.DecodeResponse(target, res); err != nil {
  6544. return nil, err
  6545. }
  6546. return ret, nil
  6547. // {
  6548. // "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.",
  6549. // "flatPath": "v1/services/{servicesId}:setIamPolicy",
  6550. // "httpMethod": "POST",
  6551. // "id": "servicemanagement.services.setIamPolicy",
  6552. // "parameterOrder": [
  6553. // "resource"
  6554. // ],
  6555. // "parameters": {
  6556. // "resource": {
  6557. // "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.",
  6558. // "location": "path",
  6559. // "pattern": "^services/[^/]+$",
  6560. // "required": true,
  6561. // "type": "string"
  6562. // }
  6563. // },
  6564. // "path": "v1/{+resource}:setIamPolicy",
  6565. // "request": {
  6566. // "$ref": "SetIamPolicyRequest"
  6567. // },
  6568. // "response": {
  6569. // "$ref": "Policy"
  6570. // },
  6571. // "scopes": [
  6572. // "https://www.googleapis.com/auth/cloud-platform",
  6573. // "https://www.googleapis.com/auth/service.management"
  6574. // ]
  6575. // }
  6576. }
  6577. // method id "servicemanagement.services.testIamPermissions":
  6578. type ServicesTestIamPermissionsCall struct {
  6579. s *APIService
  6580. resource string
  6581. testiampermissionsrequest *TestIamPermissionsRequest
  6582. urlParams_ gensupport.URLParams
  6583. ctx_ context.Context
  6584. header_ http.Header
  6585. }
  6586. // TestIamPermissions: Returns permissions that a caller has on the
  6587. // specified resource.
  6588. // If the resource does not exist, this will return an empty set
  6589. // of
  6590. // permissions, not a NOT_FOUND error.
  6591. //
  6592. // Note: This operation is designed to be used for building
  6593. // permission-aware
  6594. // UIs and command-line tools, not for authorization checking. This
  6595. // operation
  6596. // may "fail open" without warning.
  6597. func (r *ServicesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ServicesTestIamPermissionsCall {
  6598. c := &ServicesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6599. c.resource = resource
  6600. c.testiampermissionsrequest = testiampermissionsrequest
  6601. return c
  6602. }
  6603. // Fields allows partial responses to be retrieved. See
  6604. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6605. // for more information.
  6606. func (c *ServicesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ServicesTestIamPermissionsCall {
  6607. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6608. return c
  6609. }
  6610. // Context sets the context to be used in this call's Do method. Any
  6611. // pending HTTP request will be aborted if the provided context is
  6612. // canceled.
  6613. func (c *ServicesTestIamPermissionsCall) Context(ctx context.Context) *ServicesTestIamPermissionsCall {
  6614. c.ctx_ = ctx
  6615. return c
  6616. }
  6617. // Header returns an http.Header that can be modified by the caller to
  6618. // add HTTP headers to the request.
  6619. func (c *ServicesTestIamPermissionsCall) Header() http.Header {
  6620. if c.header_ == nil {
  6621. c.header_ = make(http.Header)
  6622. }
  6623. return c.header_
  6624. }
  6625. func (c *ServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  6626. reqHeaders := make(http.Header)
  6627. for k, v := range c.header_ {
  6628. reqHeaders[k] = v
  6629. }
  6630. reqHeaders.Set("User-Agent", c.s.userAgent())
  6631. var body io.Reader = nil
  6632. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  6633. if err != nil {
  6634. return nil, err
  6635. }
  6636. reqHeaders.Set("Content-Type", "application/json")
  6637. c.urlParams_.Set("alt", alt)
  6638. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
  6639. urls += "?" + c.urlParams_.Encode()
  6640. req, _ := http.NewRequest("POST", urls, body)
  6641. req.Header = reqHeaders
  6642. googleapi.Expand(req.URL, map[string]string{
  6643. "resource": c.resource,
  6644. })
  6645. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6646. }
  6647. // Do executes the "servicemanagement.services.testIamPermissions" call.
  6648. // Exactly one of *TestIamPermissionsResponse or error will be non-nil.
  6649. // Any non-2xx status code is an error. Response headers are in either
  6650. // *TestIamPermissionsResponse.ServerResponse.Header or (if a response
  6651. // was returned at all) in error.(*googleapi.Error).Header. Use
  6652. // googleapi.IsNotModified to check whether the returned error was
  6653. // because http.StatusNotModified was returned.
  6654. func (c *ServicesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  6655. gensupport.SetOptions(c.urlParams_, opts...)
  6656. res, err := c.doRequest("json")
  6657. if res != nil && res.StatusCode == http.StatusNotModified {
  6658. if res.Body != nil {
  6659. res.Body.Close()
  6660. }
  6661. return nil, &googleapi.Error{
  6662. Code: res.StatusCode,
  6663. Header: res.Header,
  6664. }
  6665. }
  6666. if err != nil {
  6667. return nil, err
  6668. }
  6669. defer googleapi.CloseBody(res)
  6670. if err := googleapi.CheckResponse(res); err != nil {
  6671. return nil, err
  6672. }
  6673. ret := &TestIamPermissionsResponse{
  6674. ServerResponse: googleapi.ServerResponse{
  6675. Header: res.Header,
  6676. HTTPStatusCode: res.StatusCode,
  6677. },
  6678. }
  6679. target := &ret
  6680. if err := gensupport.DecodeResponse(target, res); err != nil {
  6681. return nil, err
  6682. }
  6683. return ret, nil
  6684. // {
  6685. // "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.",
  6686. // "flatPath": "v1/services/{servicesId}:testIamPermissions",
  6687. // "httpMethod": "POST",
  6688. // "id": "servicemanagement.services.testIamPermissions",
  6689. // "parameterOrder": [
  6690. // "resource"
  6691. // ],
  6692. // "parameters": {
  6693. // "resource": {
  6694. // "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.",
  6695. // "location": "path",
  6696. // "pattern": "^services/[^/]+$",
  6697. // "required": true,
  6698. // "type": "string"
  6699. // }
  6700. // },
  6701. // "path": "v1/{+resource}:testIamPermissions",
  6702. // "request": {
  6703. // "$ref": "TestIamPermissionsRequest"
  6704. // },
  6705. // "response": {
  6706. // "$ref": "TestIamPermissionsResponse"
  6707. // },
  6708. // "scopes": [
  6709. // "https://www.googleapis.com/auth/cloud-platform",
  6710. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  6711. // "https://www.googleapis.com/auth/service.management",
  6712. // "https://www.googleapis.com/auth/service.management.readonly"
  6713. // ]
  6714. // }
  6715. }
  6716. // method id "servicemanagement.services.undelete":
  6717. type ServicesUndeleteCall struct {
  6718. s *APIService
  6719. serviceName string
  6720. urlParams_ gensupport.URLParams
  6721. ctx_ context.Context
  6722. header_ http.Header
  6723. }
  6724. // Undelete: Revives a previously deleted managed service. The method
  6725. // restores the
  6726. // service using the configuration at the time the service was
  6727. // deleted.
  6728. // The target service must exist and must have been deleted within
  6729. // the
  6730. // last 30 days.
  6731. //
  6732. // Operation<response: UndeleteServiceResponse>
  6733. func (r *ServicesService) Undelete(serviceName string) *ServicesUndeleteCall {
  6734. c := &ServicesUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6735. c.serviceName = serviceName
  6736. return c
  6737. }
  6738. // Fields allows partial responses to be retrieved. See
  6739. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6740. // for more information.
  6741. func (c *ServicesUndeleteCall) Fields(s ...googleapi.Field) *ServicesUndeleteCall {
  6742. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6743. return c
  6744. }
  6745. // Context sets the context to be used in this call's Do method. Any
  6746. // pending HTTP request will be aborted if the provided context is
  6747. // canceled.
  6748. func (c *ServicesUndeleteCall) Context(ctx context.Context) *ServicesUndeleteCall {
  6749. c.ctx_ = ctx
  6750. return c
  6751. }
  6752. // Header returns an http.Header that can be modified by the caller to
  6753. // add HTTP headers to the request.
  6754. func (c *ServicesUndeleteCall) Header() http.Header {
  6755. if c.header_ == nil {
  6756. c.header_ = make(http.Header)
  6757. }
  6758. return c.header_
  6759. }
  6760. func (c *ServicesUndeleteCall) doRequest(alt string) (*http.Response, error) {
  6761. reqHeaders := make(http.Header)
  6762. for k, v := range c.header_ {
  6763. reqHeaders[k] = v
  6764. }
  6765. reqHeaders.Set("User-Agent", c.s.userAgent())
  6766. var body io.Reader = nil
  6767. c.urlParams_.Set("alt", alt)
  6768. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}:undelete")
  6769. urls += "?" + c.urlParams_.Encode()
  6770. req, _ := http.NewRequest("POST", urls, body)
  6771. req.Header = reqHeaders
  6772. googleapi.Expand(req.URL, map[string]string{
  6773. "serviceName": c.serviceName,
  6774. })
  6775. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6776. }
  6777. // Do executes the "servicemanagement.services.undelete" call.
  6778. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  6779. // status code is an error. Response headers are in either
  6780. // *Operation.ServerResponse.Header or (if a response was returned at
  6781. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6782. // to check whether the returned error was because
  6783. // http.StatusNotModified was returned.
  6784. func (c *ServicesUndeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  6785. gensupport.SetOptions(c.urlParams_, opts...)
  6786. res, err := c.doRequest("json")
  6787. if res != nil && res.StatusCode == http.StatusNotModified {
  6788. if res.Body != nil {
  6789. res.Body.Close()
  6790. }
  6791. return nil, &googleapi.Error{
  6792. Code: res.StatusCode,
  6793. Header: res.Header,
  6794. }
  6795. }
  6796. if err != nil {
  6797. return nil, err
  6798. }
  6799. defer googleapi.CloseBody(res)
  6800. if err := googleapi.CheckResponse(res); err != nil {
  6801. return nil, err
  6802. }
  6803. ret := &Operation{
  6804. ServerResponse: googleapi.ServerResponse{
  6805. Header: res.Header,
  6806. HTTPStatusCode: res.StatusCode,
  6807. },
  6808. }
  6809. target := &ret
  6810. if err := gensupport.DecodeResponse(target, res); err != nil {
  6811. return nil, err
  6812. }
  6813. return ret, nil
  6814. // {
  6815. // "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",
  6816. // "flatPath": "v1/services/{serviceName}:undelete",
  6817. // "httpMethod": "POST",
  6818. // "id": "servicemanagement.services.undelete",
  6819. // "parameterOrder": [
  6820. // "serviceName"
  6821. // ],
  6822. // "parameters": {
  6823. // "serviceName": {
  6824. // "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`.",
  6825. // "location": "path",
  6826. // "required": true,
  6827. // "type": "string"
  6828. // }
  6829. // },
  6830. // "path": "v1/services/{serviceName}:undelete",
  6831. // "response": {
  6832. // "$ref": "Operation"
  6833. // },
  6834. // "scopes": [
  6835. // "https://www.googleapis.com/auth/cloud-platform",
  6836. // "https://www.googleapis.com/auth/service.management"
  6837. // ]
  6838. // }
  6839. }
  6840. // method id "servicemanagement.services.configs.create":
  6841. type ServicesConfigsCreateCall struct {
  6842. s *APIService
  6843. serviceName string
  6844. service *Service
  6845. urlParams_ gensupport.URLParams
  6846. ctx_ context.Context
  6847. header_ http.Header
  6848. }
  6849. // Create: Creates a new service configuration (version) for a managed
  6850. // service.
  6851. // This method only stores the service configuration. To roll out the
  6852. // service
  6853. // configuration to backend systems please
  6854. // call
  6855. // CreateServiceRollout.
  6856. //
  6857. // Only the 100 most recent service configurations and ones referenced
  6858. // by
  6859. // existing rollouts are kept for each service. The rest will be
  6860. // deleted
  6861. // eventually.
  6862. func (r *ServicesConfigsService) Create(serviceName string, service *Service) *ServicesConfigsCreateCall {
  6863. c := &ServicesConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6864. c.serviceName = serviceName
  6865. c.service = service
  6866. return c
  6867. }
  6868. // Fields allows partial responses to be retrieved. See
  6869. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6870. // for more information.
  6871. func (c *ServicesConfigsCreateCall) Fields(s ...googleapi.Field) *ServicesConfigsCreateCall {
  6872. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6873. return c
  6874. }
  6875. // Context sets the context to be used in this call's Do method. Any
  6876. // pending HTTP request will be aborted if the provided context is
  6877. // canceled.
  6878. func (c *ServicesConfigsCreateCall) Context(ctx context.Context) *ServicesConfigsCreateCall {
  6879. c.ctx_ = ctx
  6880. return c
  6881. }
  6882. // Header returns an http.Header that can be modified by the caller to
  6883. // add HTTP headers to the request.
  6884. func (c *ServicesConfigsCreateCall) Header() http.Header {
  6885. if c.header_ == nil {
  6886. c.header_ = make(http.Header)
  6887. }
  6888. return c.header_
  6889. }
  6890. func (c *ServicesConfigsCreateCall) doRequest(alt string) (*http.Response, error) {
  6891. reqHeaders := make(http.Header)
  6892. for k, v := range c.header_ {
  6893. reqHeaders[k] = v
  6894. }
  6895. reqHeaders.Set("User-Agent", c.s.userAgent())
  6896. var body io.Reader = nil
  6897. body, err := googleapi.WithoutDataWrapper.JSONReader(c.service)
  6898. if err != nil {
  6899. return nil, err
  6900. }
  6901. reqHeaders.Set("Content-Type", "application/json")
  6902. c.urlParams_.Set("alt", alt)
  6903. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}/configs")
  6904. urls += "?" + c.urlParams_.Encode()
  6905. req, _ := http.NewRequest("POST", urls, body)
  6906. req.Header = reqHeaders
  6907. googleapi.Expand(req.URL, map[string]string{
  6908. "serviceName": c.serviceName,
  6909. })
  6910. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6911. }
  6912. // Do executes the "servicemanagement.services.configs.create" call.
  6913. // Exactly one of *Service or error will be non-nil. Any non-2xx status
  6914. // code is an error. Response headers are in either
  6915. // *Service.ServerResponse.Header or (if a response was returned at all)
  6916. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6917. // check whether the returned error was because http.StatusNotModified
  6918. // was returned.
  6919. func (c *ServicesConfigsCreateCall) Do(opts ...googleapi.CallOption) (*Service, error) {
  6920. gensupport.SetOptions(c.urlParams_, opts...)
  6921. res, err := c.doRequest("json")
  6922. if res != nil && res.StatusCode == http.StatusNotModified {
  6923. if res.Body != nil {
  6924. res.Body.Close()
  6925. }
  6926. return nil, &googleapi.Error{
  6927. Code: res.StatusCode,
  6928. Header: res.Header,
  6929. }
  6930. }
  6931. if err != nil {
  6932. return nil, err
  6933. }
  6934. defer googleapi.CloseBody(res)
  6935. if err := googleapi.CheckResponse(res); err != nil {
  6936. return nil, err
  6937. }
  6938. ret := &Service{
  6939. ServerResponse: googleapi.ServerResponse{
  6940. Header: res.Header,
  6941. HTTPStatusCode: res.StatusCode,
  6942. },
  6943. }
  6944. target := &ret
  6945. if err := gensupport.DecodeResponse(target, res); err != nil {
  6946. return nil, err
  6947. }
  6948. return ret, nil
  6949. // {
  6950. // "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.",
  6951. // "flatPath": "v1/services/{serviceName}/configs",
  6952. // "httpMethod": "POST",
  6953. // "id": "servicemanagement.services.configs.create",
  6954. // "parameterOrder": [
  6955. // "serviceName"
  6956. // ],
  6957. // "parameters": {
  6958. // "serviceName": {
  6959. // "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`.",
  6960. // "location": "path",
  6961. // "required": true,
  6962. // "type": "string"
  6963. // }
  6964. // },
  6965. // "path": "v1/services/{serviceName}/configs",
  6966. // "request": {
  6967. // "$ref": "Service"
  6968. // },
  6969. // "response": {
  6970. // "$ref": "Service"
  6971. // },
  6972. // "scopes": [
  6973. // "https://www.googleapis.com/auth/cloud-platform",
  6974. // "https://www.googleapis.com/auth/service.management"
  6975. // ]
  6976. // }
  6977. }
  6978. // method id "servicemanagement.services.configs.get":
  6979. type ServicesConfigsGetCall struct {
  6980. s *APIService
  6981. serviceName string
  6982. configId string
  6983. urlParams_ gensupport.URLParams
  6984. ifNoneMatch_ string
  6985. ctx_ context.Context
  6986. header_ http.Header
  6987. }
  6988. // Get: Gets a service configuration (version) for a managed service.
  6989. func (r *ServicesConfigsService) Get(serviceName string, configId string) *ServicesConfigsGetCall {
  6990. c := &ServicesConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6991. c.serviceName = serviceName
  6992. c.configId = configId
  6993. return c
  6994. }
  6995. // View sets the optional parameter "view": Specifies which parts of the
  6996. // Service Config should be returned in the
  6997. // response.
  6998. //
  6999. // Possible values:
  7000. // "BASIC"
  7001. // "FULL"
  7002. func (c *ServicesConfigsGetCall) View(view string) *ServicesConfigsGetCall {
  7003. c.urlParams_.Set("view", view)
  7004. return c
  7005. }
  7006. // Fields allows partial responses to be retrieved. See
  7007. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7008. // for more information.
  7009. func (c *ServicesConfigsGetCall) Fields(s ...googleapi.Field) *ServicesConfigsGetCall {
  7010. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7011. return c
  7012. }
  7013. // IfNoneMatch sets the optional parameter which makes the operation
  7014. // fail if the object's ETag matches the given value. This is useful for
  7015. // getting updates only after the object has changed since the last
  7016. // request. Use googleapi.IsNotModified to check whether the response
  7017. // error from Do is the result of In-None-Match.
  7018. func (c *ServicesConfigsGetCall) IfNoneMatch(entityTag string) *ServicesConfigsGetCall {
  7019. c.ifNoneMatch_ = entityTag
  7020. return c
  7021. }
  7022. // Context sets the context to be used in this call's Do method. Any
  7023. // pending HTTP request will be aborted if the provided context is
  7024. // canceled.
  7025. func (c *ServicesConfigsGetCall) Context(ctx context.Context) *ServicesConfigsGetCall {
  7026. c.ctx_ = ctx
  7027. return c
  7028. }
  7029. // Header returns an http.Header that can be modified by the caller to
  7030. // add HTTP headers to the request.
  7031. func (c *ServicesConfigsGetCall) Header() http.Header {
  7032. if c.header_ == nil {
  7033. c.header_ = make(http.Header)
  7034. }
  7035. return c.header_
  7036. }
  7037. func (c *ServicesConfigsGetCall) doRequest(alt string) (*http.Response, error) {
  7038. reqHeaders := make(http.Header)
  7039. for k, v := range c.header_ {
  7040. reqHeaders[k] = v
  7041. }
  7042. reqHeaders.Set("User-Agent", c.s.userAgent())
  7043. if c.ifNoneMatch_ != "" {
  7044. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7045. }
  7046. var body io.Reader = nil
  7047. c.urlParams_.Set("alt", alt)
  7048. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}/configs/{configId}")
  7049. urls += "?" + c.urlParams_.Encode()
  7050. req, _ := http.NewRequest("GET", urls, body)
  7051. req.Header = reqHeaders
  7052. googleapi.Expand(req.URL, map[string]string{
  7053. "serviceName": c.serviceName,
  7054. "configId": c.configId,
  7055. })
  7056. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7057. }
  7058. // Do executes the "servicemanagement.services.configs.get" call.
  7059. // Exactly one of *Service or error will be non-nil. Any non-2xx status
  7060. // code is an error. Response headers are in either
  7061. // *Service.ServerResponse.Header or (if a response was returned at all)
  7062. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7063. // check whether the returned error was because http.StatusNotModified
  7064. // was returned.
  7065. func (c *ServicesConfigsGetCall) Do(opts ...googleapi.CallOption) (*Service, error) {
  7066. gensupport.SetOptions(c.urlParams_, opts...)
  7067. res, err := c.doRequest("json")
  7068. if res != nil && res.StatusCode == http.StatusNotModified {
  7069. if res.Body != nil {
  7070. res.Body.Close()
  7071. }
  7072. return nil, &googleapi.Error{
  7073. Code: res.StatusCode,
  7074. Header: res.Header,
  7075. }
  7076. }
  7077. if err != nil {
  7078. return nil, err
  7079. }
  7080. defer googleapi.CloseBody(res)
  7081. if err := googleapi.CheckResponse(res); err != nil {
  7082. return nil, err
  7083. }
  7084. ret := &Service{
  7085. ServerResponse: googleapi.ServerResponse{
  7086. Header: res.Header,
  7087. HTTPStatusCode: res.StatusCode,
  7088. },
  7089. }
  7090. target := &ret
  7091. if err := gensupport.DecodeResponse(target, res); err != nil {
  7092. return nil, err
  7093. }
  7094. return ret, nil
  7095. // {
  7096. // "description": "Gets a service configuration (version) for a managed service.",
  7097. // "flatPath": "v1/services/{serviceName}/configs/{configId}",
  7098. // "httpMethod": "GET",
  7099. // "id": "servicemanagement.services.configs.get",
  7100. // "parameterOrder": [
  7101. // "serviceName",
  7102. // "configId"
  7103. // ],
  7104. // "parameters": {
  7105. // "configId": {
  7106. // "description": "The id of the service configuration resource.",
  7107. // "location": "path",
  7108. // "required": true,
  7109. // "type": "string"
  7110. // },
  7111. // "serviceName": {
  7112. // "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`.",
  7113. // "location": "path",
  7114. // "required": true,
  7115. // "type": "string"
  7116. // },
  7117. // "view": {
  7118. // "description": "Specifies which parts of the Service Config should be returned in the\nresponse.",
  7119. // "enum": [
  7120. // "BASIC",
  7121. // "FULL"
  7122. // ],
  7123. // "location": "query",
  7124. // "type": "string"
  7125. // }
  7126. // },
  7127. // "path": "v1/services/{serviceName}/configs/{configId}",
  7128. // "response": {
  7129. // "$ref": "Service"
  7130. // },
  7131. // "scopes": [
  7132. // "https://www.googleapis.com/auth/cloud-platform",
  7133. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  7134. // "https://www.googleapis.com/auth/service.management",
  7135. // "https://www.googleapis.com/auth/service.management.readonly"
  7136. // ]
  7137. // }
  7138. }
  7139. // method id "servicemanagement.services.configs.list":
  7140. type ServicesConfigsListCall struct {
  7141. s *APIService
  7142. serviceName string
  7143. urlParams_ gensupport.URLParams
  7144. ifNoneMatch_ string
  7145. ctx_ context.Context
  7146. header_ http.Header
  7147. }
  7148. // List: Lists the history of the service configuration for a managed
  7149. // service,
  7150. // from the newest to the oldest.
  7151. func (r *ServicesConfigsService) List(serviceName string) *ServicesConfigsListCall {
  7152. c := &ServicesConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7153. c.serviceName = serviceName
  7154. return c
  7155. }
  7156. // PageSize sets the optional parameter "pageSize": The max number of
  7157. // items to include in the response list.
  7158. func (c *ServicesConfigsListCall) PageSize(pageSize int64) *ServicesConfigsListCall {
  7159. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  7160. return c
  7161. }
  7162. // PageToken sets the optional parameter "pageToken": The token of the
  7163. // page to retrieve.
  7164. func (c *ServicesConfigsListCall) PageToken(pageToken string) *ServicesConfigsListCall {
  7165. c.urlParams_.Set("pageToken", pageToken)
  7166. return c
  7167. }
  7168. // Fields allows partial responses to be retrieved. See
  7169. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7170. // for more information.
  7171. func (c *ServicesConfigsListCall) Fields(s ...googleapi.Field) *ServicesConfigsListCall {
  7172. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7173. return c
  7174. }
  7175. // IfNoneMatch sets the optional parameter which makes the operation
  7176. // fail if the object's ETag matches the given value. This is useful for
  7177. // getting updates only after the object has changed since the last
  7178. // request. Use googleapi.IsNotModified to check whether the response
  7179. // error from Do is the result of In-None-Match.
  7180. func (c *ServicesConfigsListCall) IfNoneMatch(entityTag string) *ServicesConfigsListCall {
  7181. c.ifNoneMatch_ = entityTag
  7182. return c
  7183. }
  7184. // Context sets the context to be used in this call's Do method. Any
  7185. // pending HTTP request will be aborted if the provided context is
  7186. // canceled.
  7187. func (c *ServicesConfigsListCall) Context(ctx context.Context) *ServicesConfigsListCall {
  7188. c.ctx_ = ctx
  7189. return c
  7190. }
  7191. // Header returns an http.Header that can be modified by the caller to
  7192. // add HTTP headers to the request.
  7193. func (c *ServicesConfigsListCall) Header() http.Header {
  7194. if c.header_ == nil {
  7195. c.header_ = make(http.Header)
  7196. }
  7197. return c.header_
  7198. }
  7199. func (c *ServicesConfigsListCall) doRequest(alt string) (*http.Response, error) {
  7200. reqHeaders := make(http.Header)
  7201. for k, v := range c.header_ {
  7202. reqHeaders[k] = v
  7203. }
  7204. reqHeaders.Set("User-Agent", c.s.userAgent())
  7205. if c.ifNoneMatch_ != "" {
  7206. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7207. }
  7208. var body io.Reader = nil
  7209. c.urlParams_.Set("alt", alt)
  7210. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}/configs")
  7211. urls += "?" + c.urlParams_.Encode()
  7212. req, _ := http.NewRequest("GET", urls, body)
  7213. req.Header = reqHeaders
  7214. googleapi.Expand(req.URL, map[string]string{
  7215. "serviceName": c.serviceName,
  7216. })
  7217. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7218. }
  7219. // Do executes the "servicemanagement.services.configs.list" call.
  7220. // Exactly one of *ListServiceConfigsResponse or error will be non-nil.
  7221. // Any non-2xx status code is an error. Response headers are in either
  7222. // *ListServiceConfigsResponse.ServerResponse.Header or (if a response
  7223. // was returned at all) in error.(*googleapi.Error).Header. Use
  7224. // googleapi.IsNotModified to check whether the returned error was
  7225. // because http.StatusNotModified was returned.
  7226. func (c *ServicesConfigsListCall) Do(opts ...googleapi.CallOption) (*ListServiceConfigsResponse, error) {
  7227. gensupport.SetOptions(c.urlParams_, opts...)
  7228. res, err := c.doRequest("json")
  7229. if res != nil && res.StatusCode == http.StatusNotModified {
  7230. if res.Body != nil {
  7231. res.Body.Close()
  7232. }
  7233. return nil, &googleapi.Error{
  7234. Code: res.StatusCode,
  7235. Header: res.Header,
  7236. }
  7237. }
  7238. if err != nil {
  7239. return nil, err
  7240. }
  7241. defer googleapi.CloseBody(res)
  7242. if err := googleapi.CheckResponse(res); err != nil {
  7243. return nil, err
  7244. }
  7245. ret := &ListServiceConfigsResponse{
  7246. ServerResponse: googleapi.ServerResponse{
  7247. Header: res.Header,
  7248. HTTPStatusCode: res.StatusCode,
  7249. },
  7250. }
  7251. target := &ret
  7252. if err := gensupport.DecodeResponse(target, res); err != nil {
  7253. return nil, err
  7254. }
  7255. return ret, nil
  7256. // {
  7257. // "description": "Lists the history of the service configuration for a managed service,\nfrom the newest to the oldest.",
  7258. // "flatPath": "v1/services/{serviceName}/configs",
  7259. // "httpMethod": "GET",
  7260. // "id": "servicemanagement.services.configs.list",
  7261. // "parameterOrder": [
  7262. // "serviceName"
  7263. // ],
  7264. // "parameters": {
  7265. // "pageSize": {
  7266. // "description": "The max number of items to include in the response list.",
  7267. // "format": "int32",
  7268. // "location": "query",
  7269. // "type": "integer"
  7270. // },
  7271. // "pageToken": {
  7272. // "description": "The token of the page to retrieve.",
  7273. // "location": "query",
  7274. // "type": "string"
  7275. // },
  7276. // "serviceName": {
  7277. // "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`.",
  7278. // "location": "path",
  7279. // "required": true,
  7280. // "type": "string"
  7281. // }
  7282. // },
  7283. // "path": "v1/services/{serviceName}/configs",
  7284. // "response": {
  7285. // "$ref": "ListServiceConfigsResponse"
  7286. // },
  7287. // "scopes": [
  7288. // "https://www.googleapis.com/auth/cloud-platform",
  7289. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  7290. // "https://www.googleapis.com/auth/service.management",
  7291. // "https://www.googleapis.com/auth/service.management.readonly"
  7292. // ]
  7293. // }
  7294. }
  7295. // Pages invokes f for each page of results.
  7296. // A non-nil error returned from f will halt the iteration.
  7297. // The provided context supersedes any context provided to the Context method.
  7298. func (c *ServicesConfigsListCall) Pages(ctx context.Context, f func(*ListServiceConfigsResponse) error) error {
  7299. c.ctx_ = ctx
  7300. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7301. for {
  7302. x, err := c.Do()
  7303. if err != nil {
  7304. return err
  7305. }
  7306. if err := f(x); err != nil {
  7307. return err
  7308. }
  7309. if x.NextPageToken == "" {
  7310. return nil
  7311. }
  7312. c.PageToken(x.NextPageToken)
  7313. }
  7314. }
  7315. // method id "servicemanagement.services.configs.submit":
  7316. type ServicesConfigsSubmitCall struct {
  7317. s *APIService
  7318. serviceName string
  7319. submitconfigsourcerequest *SubmitConfigSourceRequest
  7320. urlParams_ gensupport.URLParams
  7321. ctx_ context.Context
  7322. header_ http.Header
  7323. }
  7324. // Submit: Creates a new service configuration (version) for a managed
  7325. // service based
  7326. // on
  7327. // user-supplied configuration source files (for example:
  7328. // OpenAPI
  7329. // Specification). This method stores the source configurations as well
  7330. // as the
  7331. // generated service configuration. To rollout the service configuration
  7332. // to
  7333. // other services,
  7334. // please call CreateServiceRollout.
  7335. //
  7336. // Only the 100 most recent configuration sources and ones referenced
  7337. // by
  7338. // existing service configurtions are kept for each service. The rest
  7339. // will be
  7340. // deleted eventually.
  7341. //
  7342. // Operation<response: SubmitConfigSourceResponse>
  7343. func (r *ServicesConfigsService) Submit(serviceName string, submitconfigsourcerequest *SubmitConfigSourceRequest) *ServicesConfigsSubmitCall {
  7344. c := &ServicesConfigsSubmitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7345. c.serviceName = serviceName
  7346. c.submitconfigsourcerequest = submitconfigsourcerequest
  7347. return c
  7348. }
  7349. // Fields allows partial responses to be retrieved. See
  7350. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7351. // for more information.
  7352. func (c *ServicesConfigsSubmitCall) Fields(s ...googleapi.Field) *ServicesConfigsSubmitCall {
  7353. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7354. return c
  7355. }
  7356. // Context sets the context to be used in this call's Do method. Any
  7357. // pending HTTP request will be aborted if the provided context is
  7358. // canceled.
  7359. func (c *ServicesConfigsSubmitCall) Context(ctx context.Context) *ServicesConfigsSubmitCall {
  7360. c.ctx_ = ctx
  7361. return c
  7362. }
  7363. // Header returns an http.Header that can be modified by the caller to
  7364. // add HTTP headers to the request.
  7365. func (c *ServicesConfigsSubmitCall) Header() http.Header {
  7366. if c.header_ == nil {
  7367. c.header_ = make(http.Header)
  7368. }
  7369. return c.header_
  7370. }
  7371. func (c *ServicesConfigsSubmitCall) doRequest(alt string) (*http.Response, error) {
  7372. reqHeaders := make(http.Header)
  7373. for k, v := range c.header_ {
  7374. reqHeaders[k] = v
  7375. }
  7376. reqHeaders.Set("User-Agent", c.s.userAgent())
  7377. var body io.Reader = nil
  7378. body, err := googleapi.WithoutDataWrapper.JSONReader(c.submitconfigsourcerequest)
  7379. if err != nil {
  7380. return nil, err
  7381. }
  7382. reqHeaders.Set("Content-Type", "application/json")
  7383. c.urlParams_.Set("alt", alt)
  7384. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}/configs:submit")
  7385. urls += "?" + c.urlParams_.Encode()
  7386. req, _ := http.NewRequest("POST", urls, body)
  7387. req.Header = reqHeaders
  7388. googleapi.Expand(req.URL, map[string]string{
  7389. "serviceName": c.serviceName,
  7390. })
  7391. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7392. }
  7393. // Do executes the "servicemanagement.services.configs.submit" call.
  7394. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7395. // status code is an error. Response headers are in either
  7396. // *Operation.ServerResponse.Header or (if a response was returned at
  7397. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7398. // to check whether the returned error was because
  7399. // http.StatusNotModified was returned.
  7400. func (c *ServicesConfigsSubmitCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7401. gensupport.SetOptions(c.urlParams_, opts...)
  7402. res, err := c.doRequest("json")
  7403. if res != nil && res.StatusCode == http.StatusNotModified {
  7404. if res.Body != nil {
  7405. res.Body.Close()
  7406. }
  7407. return nil, &googleapi.Error{
  7408. Code: res.StatusCode,
  7409. Header: res.Header,
  7410. }
  7411. }
  7412. if err != nil {
  7413. return nil, err
  7414. }
  7415. defer googleapi.CloseBody(res)
  7416. if err := googleapi.CheckResponse(res); err != nil {
  7417. return nil, err
  7418. }
  7419. ret := &Operation{
  7420. ServerResponse: googleapi.ServerResponse{
  7421. Header: res.Header,
  7422. HTTPStatusCode: res.StatusCode,
  7423. },
  7424. }
  7425. target := &ret
  7426. if err := gensupport.DecodeResponse(target, res); err != nil {
  7427. return nil, err
  7428. }
  7429. return ret, nil
  7430. // {
  7431. // "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",
  7432. // "flatPath": "v1/services/{serviceName}/configs:submit",
  7433. // "httpMethod": "POST",
  7434. // "id": "servicemanagement.services.configs.submit",
  7435. // "parameterOrder": [
  7436. // "serviceName"
  7437. // ],
  7438. // "parameters": {
  7439. // "serviceName": {
  7440. // "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`.",
  7441. // "location": "path",
  7442. // "required": true,
  7443. // "type": "string"
  7444. // }
  7445. // },
  7446. // "path": "v1/services/{serviceName}/configs:submit",
  7447. // "request": {
  7448. // "$ref": "SubmitConfigSourceRequest"
  7449. // },
  7450. // "response": {
  7451. // "$ref": "Operation"
  7452. // },
  7453. // "scopes": [
  7454. // "https://www.googleapis.com/auth/cloud-platform",
  7455. // "https://www.googleapis.com/auth/service.management"
  7456. // ]
  7457. // }
  7458. }
  7459. // method id "servicemanagement.services.consumers.getIamPolicy":
  7460. type ServicesConsumersGetIamPolicyCall struct {
  7461. s *APIService
  7462. resource string
  7463. getiampolicyrequest *GetIamPolicyRequest
  7464. urlParams_ gensupport.URLParams
  7465. ctx_ context.Context
  7466. header_ http.Header
  7467. }
  7468. // GetIamPolicy: Gets the access control policy for a resource.
  7469. // Returns an empty policy if the resource exists and does not have a
  7470. // policy
  7471. // set.
  7472. func (r *ServicesConsumersService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ServicesConsumersGetIamPolicyCall {
  7473. c := &ServicesConsumersGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7474. c.resource = resource
  7475. c.getiampolicyrequest = getiampolicyrequest
  7476. return c
  7477. }
  7478. // Fields allows partial responses to be retrieved. See
  7479. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7480. // for more information.
  7481. func (c *ServicesConsumersGetIamPolicyCall) Fields(s ...googleapi.Field) *ServicesConsumersGetIamPolicyCall {
  7482. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7483. return c
  7484. }
  7485. // Context sets the context to be used in this call's Do method. Any
  7486. // pending HTTP request will be aborted if the provided context is
  7487. // canceled.
  7488. func (c *ServicesConsumersGetIamPolicyCall) Context(ctx context.Context) *ServicesConsumersGetIamPolicyCall {
  7489. c.ctx_ = ctx
  7490. return c
  7491. }
  7492. // Header returns an http.Header that can be modified by the caller to
  7493. // add HTTP headers to the request.
  7494. func (c *ServicesConsumersGetIamPolicyCall) Header() http.Header {
  7495. if c.header_ == nil {
  7496. c.header_ = make(http.Header)
  7497. }
  7498. return c.header_
  7499. }
  7500. func (c *ServicesConsumersGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  7501. reqHeaders := make(http.Header)
  7502. for k, v := range c.header_ {
  7503. reqHeaders[k] = v
  7504. }
  7505. reqHeaders.Set("User-Agent", c.s.userAgent())
  7506. var body io.Reader = nil
  7507. body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest)
  7508. if err != nil {
  7509. return nil, err
  7510. }
  7511. reqHeaders.Set("Content-Type", "application/json")
  7512. c.urlParams_.Set("alt", alt)
  7513. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
  7514. urls += "?" + c.urlParams_.Encode()
  7515. req, _ := http.NewRequest("POST", urls, body)
  7516. req.Header = reqHeaders
  7517. googleapi.Expand(req.URL, map[string]string{
  7518. "resource": c.resource,
  7519. })
  7520. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7521. }
  7522. // Do executes the "servicemanagement.services.consumers.getIamPolicy" call.
  7523. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  7524. // code is an error. Response headers are in either
  7525. // *Policy.ServerResponse.Header or (if a response was returned at all)
  7526. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7527. // check whether the returned error was because http.StatusNotModified
  7528. // was returned.
  7529. func (c *ServicesConsumersGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  7530. gensupport.SetOptions(c.urlParams_, opts...)
  7531. res, err := c.doRequest("json")
  7532. if res != nil && res.StatusCode == http.StatusNotModified {
  7533. if res.Body != nil {
  7534. res.Body.Close()
  7535. }
  7536. return nil, &googleapi.Error{
  7537. Code: res.StatusCode,
  7538. Header: res.Header,
  7539. }
  7540. }
  7541. if err != nil {
  7542. return nil, err
  7543. }
  7544. defer googleapi.CloseBody(res)
  7545. if err := googleapi.CheckResponse(res); err != nil {
  7546. return nil, err
  7547. }
  7548. ret := &Policy{
  7549. ServerResponse: googleapi.ServerResponse{
  7550. Header: res.Header,
  7551. HTTPStatusCode: res.StatusCode,
  7552. },
  7553. }
  7554. target := &ret
  7555. if err := gensupport.DecodeResponse(target, res); err != nil {
  7556. return nil, err
  7557. }
  7558. return ret, nil
  7559. // {
  7560. // "description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset.",
  7561. // "flatPath": "v1/services/{servicesId}/consumers/{consumersId}:getIamPolicy",
  7562. // "httpMethod": "POST",
  7563. // "id": "servicemanagement.services.consumers.getIamPolicy",
  7564. // "parameterOrder": [
  7565. // "resource"
  7566. // ],
  7567. // "parameters": {
  7568. // "resource": {
  7569. // "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.",
  7570. // "location": "path",
  7571. // "pattern": "^services/[^/]+/consumers/[^/]+$",
  7572. // "required": true,
  7573. // "type": "string"
  7574. // }
  7575. // },
  7576. // "path": "v1/{+resource}:getIamPolicy",
  7577. // "request": {
  7578. // "$ref": "GetIamPolicyRequest"
  7579. // },
  7580. // "response": {
  7581. // "$ref": "Policy"
  7582. // },
  7583. // "scopes": [
  7584. // "https://www.googleapis.com/auth/cloud-platform",
  7585. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  7586. // "https://www.googleapis.com/auth/service.management",
  7587. // "https://www.googleapis.com/auth/service.management.readonly"
  7588. // ]
  7589. // }
  7590. }
  7591. // method id "servicemanagement.services.consumers.setIamPolicy":
  7592. type ServicesConsumersSetIamPolicyCall struct {
  7593. s *APIService
  7594. resource string
  7595. setiampolicyrequest *SetIamPolicyRequest
  7596. urlParams_ gensupport.URLParams
  7597. ctx_ context.Context
  7598. header_ http.Header
  7599. }
  7600. // SetIamPolicy: Sets the access control policy on the specified
  7601. // resource. Replaces any
  7602. // existing policy.
  7603. func (r *ServicesConsumersService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ServicesConsumersSetIamPolicyCall {
  7604. c := &ServicesConsumersSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7605. c.resource = resource
  7606. c.setiampolicyrequest = setiampolicyrequest
  7607. return c
  7608. }
  7609. // Fields allows partial responses to be retrieved. See
  7610. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7611. // for more information.
  7612. func (c *ServicesConsumersSetIamPolicyCall) Fields(s ...googleapi.Field) *ServicesConsumersSetIamPolicyCall {
  7613. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7614. return c
  7615. }
  7616. // Context sets the context to be used in this call's Do method. Any
  7617. // pending HTTP request will be aborted if the provided context is
  7618. // canceled.
  7619. func (c *ServicesConsumersSetIamPolicyCall) Context(ctx context.Context) *ServicesConsumersSetIamPolicyCall {
  7620. c.ctx_ = ctx
  7621. return c
  7622. }
  7623. // Header returns an http.Header that can be modified by the caller to
  7624. // add HTTP headers to the request.
  7625. func (c *ServicesConsumersSetIamPolicyCall) Header() http.Header {
  7626. if c.header_ == nil {
  7627. c.header_ = make(http.Header)
  7628. }
  7629. return c.header_
  7630. }
  7631. func (c *ServicesConsumersSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  7632. reqHeaders := make(http.Header)
  7633. for k, v := range c.header_ {
  7634. reqHeaders[k] = v
  7635. }
  7636. reqHeaders.Set("User-Agent", c.s.userAgent())
  7637. var body io.Reader = nil
  7638. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  7639. if err != nil {
  7640. return nil, err
  7641. }
  7642. reqHeaders.Set("Content-Type", "application/json")
  7643. c.urlParams_.Set("alt", alt)
  7644. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
  7645. urls += "?" + c.urlParams_.Encode()
  7646. req, _ := http.NewRequest("POST", urls, body)
  7647. req.Header = reqHeaders
  7648. googleapi.Expand(req.URL, map[string]string{
  7649. "resource": c.resource,
  7650. })
  7651. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7652. }
  7653. // Do executes the "servicemanagement.services.consumers.setIamPolicy" call.
  7654. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  7655. // code is an error. Response headers are in either
  7656. // *Policy.ServerResponse.Header or (if a response was returned at all)
  7657. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7658. // check whether the returned error was because http.StatusNotModified
  7659. // was returned.
  7660. func (c *ServicesConsumersSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  7661. gensupport.SetOptions(c.urlParams_, opts...)
  7662. res, err := c.doRequest("json")
  7663. if res != nil && res.StatusCode == http.StatusNotModified {
  7664. if res.Body != nil {
  7665. res.Body.Close()
  7666. }
  7667. return nil, &googleapi.Error{
  7668. Code: res.StatusCode,
  7669. Header: res.Header,
  7670. }
  7671. }
  7672. if err != nil {
  7673. return nil, err
  7674. }
  7675. defer googleapi.CloseBody(res)
  7676. if err := googleapi.CheckResponse(res); err != nil {
  7677. return nil, err
  7678. }
  7679. ret := &Policy{
  7680. ServerResponse: googleapi.ServerResponse{
  7681. Header: res.Header,
  7682. HTTPStatusCode: res.StatusCode,
  7683. },
  7684. }
  7685. target := &ret
  7686. if err := gensupport.DecodeResponse(target, res); err != nil {
  7687. return nil, err
  7688. }
  7689. return ret, nil
  7690. // {
  7691. // "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.",
  7692. // "flatPath": "v1/services/{servicesId}/consumers/{consumersId}:setIamPolicy",
  7693. // "httpMethod": "POST",
  7694. // "id": "servicemanagement.services.consumers.setIamPolicy",
  7695. // "parameterOrder": [
  7696. // "resource"
  7697. // ],
  7698. // "parameters": {
  7699. // "resource": {
  7700. // "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.",
  7701. // "location": "path",
  7702. // "pattern": "^services/[^/]+/consumers/[^/]+$",
  7703. // "required": true,
  7704. // "type": "string"
  7705. // }
  7706. // },
  7707. // "path": "v1/{+resource}:setIamPolicy",
  7708. // "request": {
  7709. // "$ref": "SetIamPolicyRequest"
  7710. // },
  7711. // "response": {
  7712. // "$ref": "Policy"
  7713. // },
  7714. // "scopes": [
  7715. // "https://www.googleapis.com/auth/cloud-platform",
  7716. // "https://www.googleapis.com/auth/service.management"
  7717. // ]
  7718. // }
  7719. }
  7720. // method id "servicemanagement.services.consumers.testIamPermissions":
  7721. type ServicesConsumersTestIamPermissionsCall struct {
  7722. s *APIService
  7723. resource string
  7724. testiampermissionsrequest *TestIamPermissionsRequest
  7725. urlParams_ gensupport.URLParams
  7726. ctx_ context.Context
  7727. header_ http.Header
  7728. }
  7729. // TestIamPermissions: Returns permissions that a caller has on the
  7730. // specified resource.
  7731. // If the resource does not exist, this will return an empty set
  7732. // of
  7733. // permissions, not a NOT_FOUND error.
  7734. //
  7735. // Note: This operation is designed to be used for building
  7736. // permission-aware
  7737. // UIs and command-line tools, not for authorization checking. This
  7738. // operation
  7739. // may "fail open" without warning.
  7740. func (r *ServicesConsumersService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ServicesConsumersTestIamPermissionsCall {
  7741. c := &ServicesConsumersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7742. c.resource = resource
  7743. c.testiampermissionsrequest = testiampermissionsrequest
  7744. return c
  7745. }
  7746. // Fields allows partial responses to be retrieved. See
  7747. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7748. // for more information.
  7749. func (c *ServicesConsumersTestIamPermissionsCall) Fields(s ...googleapi.Field) *ServicesConsumersTestIamPermissionsCall {
  7750. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7751. return c
  7752. }
  7753. // Context sets the context to be used in this call's Do method. Any
  7754. // pending HTTP request will be aborted if the provided context is
  7755. // canceled.
  7756. func (c *ServicesConsumersTestIamPermissionsCall) Context(ctx context.Context) *ServicesConsumersTestIamPermissionsCall {
  7757. c.ctx_ = ctx
  7758. return c
  7759. }
  7760. // Header returns an http.Header that can be modified by the caller to
  7761. // add HTTP headers to the request.
  7762. func (c *ServicesConsumersTestIamPermissionsCall) Header() http.Header {
  7763. if c.header_ == nil {
  7764. c.header_ = make(http.Header)
  7765. }
  7766. return c.header_
  7767. }
  7768. func (c *ServicesConsumersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  7769. reqHeaders := make(http.Header)
  7770. for k, v := range c.header_ {
  7771. reqHeaders[k] = v
  7772. }
  7773. reqHeaders.Set("User-Agent", c.s.userAgent())
  7774. var body io.Reader = nil
  7775. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  7776. if err != nil {
  7777. return nil, err
  7778. }
  7779. reqHeaders.Set("Content-Type", "application/json")
  7780. c.urlParams_.Set("alt", alt)
  7781. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
  7782. urls += "?" + c.urlParams_.Encode()
  7783. req, _ := http.NewRequest("POST", urls, body)
  7784. req.Header = reqHeaders
  7785. googleapi.Expand(req.URL, map[string]string{
  7786. "resource": c.resource,
  7787. })
  7788. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7789. }
  7790. // Do executes the "servicemanagement.services.consumers.testIamPermissions" call.
  7791. // Exactly one of *TestIamPermissionsResponse or error will be non-nil.
  7792. // Any non-2xx status code is an error. Response headers are in either
  7793. // *TestIamPermissionsResponse.ServerResponse.Header or (if a response
  7794. // was returned at all) in error.(*googleapi.Error).Header. Use
  7795. // googleapi.IsNotModified to check whether the returned error was
  7796. // because http.StatusNotModified was returned.
  7797. func (c *ServicesConsumersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  7798. gensupport.SetOptions(c.urlParams_, opts...)
  7799. res, err := c.doRequest("json")
  7800. if res != nil && res.StatusCode == http.StatusNotModified {
  7801. if res.Body != nil {
  7802. res.Body.Close()
  7803. }
  7804. return nil, &googleapi.Error{
  7805. Code: res.StatusCode,
  7806. Header: res.Header,
  7807. }
  7808. }
  7809. if err != nil {
  7810. return nil, err
  7811. }
  7812. defer googleapi.CloseBody(res)
  7813. if err := googleapi.CheckResponse(res); err != nil {
  7814. return nil, err
  7815. }
  7816. ret := &TestIamPermissionsResponse{
  7817. ServerResponse: googleapi.ServerResponse{
  7818. Header: res.Header,
  7819. HTTPStatusCode: res.StatusCode,
  7820. },
  7821. }
  7822. target := &ret
  7823. if err := gensupport.DecodeResponse(target, res); err != nil {
  7824. return nil, err
  7825. }
  7826. return ret, nil
  7827. // {
  7828. // "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.",
  7829. // "flatPath": "v1/services/{servicesId}/consumers/{consumersId}:testIamPermissions",
  7830. // "httpMethod": "POST",
  7831. // "id": "servicemanagement.services.consumers.testIamPermissions",
  7832. // "parameterOrder": [
  7833. // "resource"
  7834. // ],
  7835. // "parameters": {
  7836. // "resource": {
  7837. // "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.",
  7838. // "location": "path",
  7839. // "pattern": "^services/[^/]+/consumers/[^/]+$",
  7840. // "required": true,
  7841. // "type": "string"
  7842. // }
  7843. // },
  7844. // "path": "v1/{+resource}:testIamPermissions",
  7845. // "request": {
  7846. // "$ref": "TestIamPermissionsRequest"
  7847. // },
  7848. // "response": {
  7849. // "$ref": "TestIamPermissionsResponse"
  7850. // },
  7851. // "scopes": [
  7852. // "https://www.googleapis.com/auth/cloud-platform",
  7853. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  7854. // "https://www.googleapis.com/auth/service.management",
  7855. // "https://www.googleapis.com/auth/service.management.readonly"
  7856. // ]
  7857. // }
  7858. }
  7859. // method id "servicemanagement.services.rollouts.create":
  7860. type ServicesRolloutsCreateCall struct {
  7861. s *APIService
  7862. serviceName string
  7863. rollout *Rollout
  7864. urlParams_ gensupport.URLParams
  7865. ctx_ context.Context
  7866. header_ http.Header
  7867. }
  7868. // Create: Creates a new service configuration rollout. Based on
  7869. // rollout, the
  7870. // Google Service Management will roll out the service configurations
  7871. // to
  7872. // different backend services. For example, the logging configuration
  7873. // will be
  7874. // pushed to Google Cloud Logging.
  7875. //
  7876. // Please note that any previous pending and running Rollouts and
  7877. // associated
  7878. // Operations will be automatically cancelled so that the latest Rollout
  7879. // will
  7880. // not be blocked by previous Rollouts.
  7881. //
  7882. // Only the 100 most recent (in any state) and the last 10 successful
  7883. // (if not
  7884. // already part of the set of 100 most recent) rollouts are kept for
  7885. // each
  7886. // service. The rest will be deleted eventually.
  7887. //
  7888. // Operation<response: Rollout>
  7889. func (r *ServicesRolloutsService) Create(serviceName string, rollout *Rollout) *ServicesRolloutsCreateCall {
  7890. c := &ServicesRolloutsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7891. c.serviceName = serviceName
  7892. c.rollout = rollout
  7893. return c
  7894. }
  7895. // Fields allows partial responses to be retrieved. See
  7896. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7897. // for more information.
  7898. func (c *ServicesRolloutsCreateCall) Fields(s ...googleapi.Field) *ServicesRolloutsCreateCall {
  7899. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7900. return c
  7901. }
  7902. // Context sets the context to be used in this call's Do method. Any
  7903. // pending HTTP request will be aborted if the provided context is
  7904. // canceled.
  7905. func (c *ServicesRolloutsCreateCall) Context(ctx context.Context) *ServicesRolloutsCreateCall {
  7906. c.ctx_ = ctx
  7907. return c
  7908. }
  7909. // Header returns an http.Header that can be modified by the caller to
  7910. // add HTTP headers to the request.
  7911. func (c *ServicesRolloutsCreateCall) Header() http.Header {
  7912. if c.header_ == nil {
  7913. c.header_ = make(http.Header)
  7914. }
  7915. return c.header_
  7916. }
  7917. func (c *ServicesRolloutsCreateCall) doRequest(alt string) (*http.Response, error) {
  7918. reqHeaders := make(http.Header)
  7919. for k, v := range c.header_ {
  7920. reqHeaders[k] = v
  7921. }
  7922. reqHeaders.Set("User-Agent", c.s.userAgent())
  7923. var body io.Reader = nil
  7924. body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollout)
  7925. if err != nil {
  7926. return nil, err
  7927. }
  7928. reqHeaders.Set("Content-Type", "application/json")
  7929. c.urlParams_.Set("alt", alt)
  7930. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}/rollouts")
  7931. urls += "?" + c.urlParams_.Encode()
  7932. req, _ := http.NewRequest("POST", urls, body)
  7933. req.Header = reqHeaders
  7934. googleapi.Expand(req.URL, map[string]string{
  7935. "serviceName": c.serviceName,
  7936. })
  7937. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7938. }
  7939. // Do executes the "servicemanagement.services.rollouts.create" call.
  7940. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7941. // status code is an error. Response headers are in either
  7942. // *Operation.ServerResponse.Header or (if a response was returned at
  7943. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7944. // to check whether the returned error was because
  7945. // http.StatusNotModified was returned.
  7946. func (c *ServicesRolloutsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7947. gensupport.SetOptions(c.urlParams_, opts...)
  7948. res, err := c.doRequest("json")
  7949. if res != nil && res.StatusCode == http.StatusNotModified {
  7950. if res.Body != nil {
  7951. res.Body.Close()
  7952. }
  7953. return nil, &googleapi.Error{
  7954. Code: res.StatusCode,
  7955. Header: res.Header,
  7956. }
  7957. }
  7958. if err != nil {
  7959. return nil, err
  7960. }
  7961. defer googleapi.CloseBody(res)
  7962. if err := googleapi.CheckResponse(res); err != nil {
  7963. return nil, err
  7964. }
  7965. ret := &Operation{
  7966. ServerResponse: googleapi.ServerResponse{
  7967. Header: res.Header,
  7968. HTTPStatusCode: res.StatusCode,
  7969. },
  7970. }
  7971. target := &ret
  7972. if err := gensupport.DecodeResponse(target, res); err != nil {
  7973. return nil, err
  7974. }
  7975. return ret, nil
  7976. // {
  7977. // "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",
  7978. // "flatPath": "v1/services/{serviceName}/rollouts",
  7979. // "httpMethod": "POST",
  7980. // "id": "servicemanagement.services.rollouts.create",
  7981. // "parameterOrder": [
  7982. // "serviceName"
  7983. // ],
  7984. // "parameters": {
  7985. // "serviceName": {
  7986. // "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`.",
  7987. // "location": "path",
  7988. // "required": true,
  7989. // "type": "string"
  7990. // }
  7991. // },
  7992. // "path": "v1/services/{serviceName}/rollouts",
  7993. // "request": {
  7994. // "$ref": "Rollout"
  7995. // },
  7996. // "response": {
  7997. // "$ref": "Operation"
  7998. // },
  7999. // "scopes": [
  8000. // "https://www.googleapis.com/auth/cloud-platform",
  8001. // "https://www.googleapis.com/auth/service.management"
  8002. // ]
  8003. // }
  8004. }
  8005. // method id "servicemanagement.services.rollouts.get":
  8006. type ServicesRolloutsGetCall struct {
  8007. s *APIService
  8008. serviceName string
  8009. rolloutId string
  8010. urlParams_ gensupport.URLParams
  8011. ifNoneMatch_ string
  8012. ctx_ context.Context
  8013. header_ http.Header
  8014. }
  8015. // Get: Gets a service configuration rollout.
  8016. func (r *ServicesRolloutsService) Get(serviceName string, rolloutId string) *ServicesRolloutsGetCall {
  8017. c := &ServicesRolloutsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8018. c.serviceName = serviceName
  8019. c.rolloutId = rolloutId
  8020. return c
  8021. }
  8022. // Fields allows partial responses to be retrieved. See
  8023. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8024. // for more information.
  8025. func (c *ServicesRolloutsGetCall) Fields(s ...googleapi.Field) *ServicesRolloutsGetCall {
  8026. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8027. return c
  8028. }
  8029. // IfNoneMatch sets the optional parameter which makes the operation
  8030. // fail if the object's ETag matches the given value. This is useful for
  8031. // getting updates only after the object has changed since the last
  8032. // request. Use googleapi.IsNotModified to check whether the response
  8033. // error from Do is the result of In-None-Match.
  8034. func (c *ServicesRolloutsGetCall) IfNoneMatch(entityTag string) *ServicesRolloutsGetCall {
  8035. c.ifNoneMatch_ = entityTag
  8036. return c
  8037. }
  8038. // Context sets the context to be used in this call's Do method. Any
  8039. // pending HTTP request will be aborted if the provided context is
  8040. // canceled.
  8041. func (c *ServicesRolloutsGetCall) Context(ctx context.Context) *ServicesRolloutsGetCall {
  8042. c.ctx_ = ctx
  8043. return c
  8044. }
  8045. // Header returns an http.Header that can be modified by the caller to
  8046. // add HTTP headers to the request.
  8047. func (c *ServicesRolloutsGetCall) Header() http.Header {
  8048. if c.header_ == nil {
  8049. c.header_ = make(http.Header)
  8050. }
  8051. return c.header_
  8052. }
  8053. func (c *ServicesRolloutsGetCall) doRequest(alt string) (*http.Response, error) {
  8054. reqHeaders := make(http.Header)
  8055. for k, v := range c.header_ {
  8056. reqHeaders[k] = v
  8057. }
  8058. reqHeaders.Set("User-Agent", c.s.userAgent())
  8059. if c.ifNoneMatch_ != "" {
  8060. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8061. }
  8062. var body io.Reader = nil
  8063. c.urlParams_.Set("alt", alt)
  8064. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}/rollouts/{rolloutId}")
  8065. urls += "?" + c.urlParams_.Encode()
  8066. req, _ := http.NewRequest("GET", urls, body)
  8067. req.Header = reqHeaders
  8068. googleapi.Expand(req.URL, map[string]string{
  8069. "serviceName": c.serviceName,
  8070. "rolloutId": c.rolloutId,
  8071. })
  8072. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8073. }
  8074. // Do executes the "servicemanagement.services.rollouts.get" call.
  8075. // Exactly one of *Rollout or error will be non-nil. Any non-2xx status
  8076. // code is an error. Response headers are in either
  8077. // *Rollout.ServerResponse.Header or (if a response was returned at all)
  8078. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8079. // check whether the returned error was because http.StatusNotModified
  8080. // was returned.
  8081. func (c *ServicesRolloutsGetCall) Do(opts ...googleapi.CallOption) (*Rollout, error) {
  8082. gensupport.SetOptions(c.urlParams_, opts...)
  8083. res, err := c.doRequest("json")
  8084. if res != nil && res.StatusCode == http.StatusNotModified {
  8085. if res.Body != nil {
  8086. res.Body.Close()
  8087. }
  8088. return nil, &googleapi.Error{
  8089. Code: res.StatusCode,
  8090. Header: res.Header,
  8091. }
  8092. }
  8093. if err != nil {
  8094. return nil, err
  8095. }
  8096. defer googleapi.CloseBody(res)
  8097. if err := googleapi.CheckResponse(res); err != nil {
  8098. return nil, err
  8099. }
  8100. ret := &Rollout{
  8101. ServerResponse: googleapi.ServerResponse{
  8102. Header: res.Header,
  8103. HTTPStatusCode: res.StatusCode,
  8104. },
  8105. }
  8106. target := &ret
  8107. if err := gensupport.DecodeResponse(target, res); err != nil {
  8108. return nil, err
  8109. }
  8110. return ret, nil
  8111. // {
  8112. // "description": "Gets a service configuration rollout.",
  8113. // "flatPath": "v1/services/{serviceName}/rollouts/{rolloutId}",
  8114. // "httpMethod": "GET",
  8115. // "id": "servicemanagement.services.rollouts.get",
  8116. // "parameterOrder": [
  8117. // "serviceName",
  8118. // "rolloutId"
  8119. // ],
  8120. // "parameters": {
  8121. // "rolloutId": {
  8122. // "description": "The id of the rollout resource.",
  8123. // "location": "path",
  8124. // "required": true,
  8125. // "type": "string"
  8126. // },
  8127. // "serviceName": {
  8128. // "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`.",
  8129. // "location": "path",
  8130. // "required": true,
  8131. // "type": "string"
  8132. // }
  8133. // },
  8134. // "path": "v1/services/{serviceName}/rollouts/{rolloutId}",
  8135. // "response": {
  8136. // "$ref": "Rollout"
  8137. // },
  8138. // "scopes": [
  8139. // "https://www.googleapis.com/auth/cloud-platform",
  8140. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  8141. // "https://www.googleapis.com/auth/service.management",
  8142. // "https://www.googleapis.com/auth/service.management.readonly"
  8143. // ]
  8144. // }
  8145. }
  8146. // method id "servicemanagement.services.rollouts.list":
  8147. type ServicesRolloutsListCall struct {
  8148. s *APIService
  8149. serviceName string
  8150. urlParams_ gensupport.URLParams
  8151. ifNoneMatch_ string
  8152. ctx_ context.Context
  8153. header_ http.Header
  8154. }
  8155. // List: Lists the history of the service configuration rollouts for a
  8156. // managed
  8157. // service, from the newest to the oldest.
  8158. func (r *ServicesRolloutsService) List(serviceName string) *ServicesRolloutsListCall {
  8159. c := &ServicesRolloutsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8160. c.serviceName = serviceName
  8161. return c
  8162. }
  8163. // Filter sets the optional parameter "filter": Use `filter` to return
  8164. // subset of rollouts.
  8165. // The following filters are supported:
  8166. // -- To limit the results to only those in
  8167. // [status](google.api.servicemanagement.v1.RolloutStatus)
  8168. // 'SUCCESS',
  8169. // use filter='status=SUCCESS'
  8170. // -- To limit the results to those in
  8171. // [status](google.api.servicemanagement.v1.RolloutStatus)
  8172. // 'CANCELLED'
  8173. // or 'FAILED', use filter='status=CANCELLED OR status=FAILED'
  8174. func (c *ServicesRolloutsListCall) Filter(filter string) *ServicesRolloutsListCall {
  8175. c.urlParams_.Set("filter", filter)
  8176. return c
  8177. }
  8178. // PageSize sets the optional parameter "pageSize": The max number of
  8179. // items to include in the response list.
  8180. func (c *ServicesRolloutsListCall) PageSize(pageSize int64) *ServicesRolloutsListCall {
  8181. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  8182. return c
  8183. }
  8184. // PageToken sets the optional parameter "pageToken": The token of the
  8185. // page to retrieve.
  8186. func (c *ServicesRolloutsListCall) PageToken(pageToken string) *ServicesRolloutsListCall {
  8187. c.urlParams_.Set("pageToken", pageToken)
  8188. return c
  8189. }
  8190. // Fields allows partial responses to be retrieved. See
  8191. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8192. // for more information.
  8193. func (c *ServicesRolloutsListCall) Fields(s ...googleapi.Field) *ServicesRolloutsListCall {
  8194. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8195. return c
  8196. }
  8197. // IfNoneMatch sets the optional parameter which makes the operation
  8198. // fail if the object's ETag matches the given value. This is useful for
  8199. // getting updates only after the object has changed since the last
  8200. // request. Use googleapi.IsNotModified to check whether the response
  8201. // error from Do is the result of In-None-Match.
  8202. func (c *ServicesRolloutsListCall) IfNoneMatch(entityTag string) *ServicesRolloutsListCall {
  8203. c.ifNoneMatch_ = entityTag
  8204. return c
  8205. }
  8206. // Context sets the context to be used in this call's Do method. Any
  8207. // pending HTTP request will be aborted if the provided context is
  8208. // canceled.
  8209. func (c *ServicesRolloutsListCall) Context(ctx context.Context) *ServicesRolloutsListCall {
  8210. c.ctx_ = ctx
  8211. return c
  8212. }
  8213. // Header returns an http.Header that can be modified by the caller to
  8214. // add HTTP headers to the request.
  8215. func (c *ServicesRolloutsListCall) Header() http.Header {
  8216. if c.header_ == nil {
  8217. c.header_ = make(http.Header)
  8218. }
  8219. return c.header_
  8220. }
  8221. func (c *ServicesRolloutsListCall) doRequest(alt string) (*http.Response, error) {
  8222. reqHeaders := make(http.Header)
  8223. for k, v := range c.header_ {
  8224. reqHeaders[k] = v
  8225. }
  8226. reqHeaders.Set("User-Agent", c.s.userAgent())
  8227. if c.ifNoneMatch_ != "" {
  8228. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8229. }
  8230. var body io.Reader = nil
  8231. c.urlParams_.Set("alt", alt)
  8232. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}/rollouts")
  8233. urls += "?" + c.urlParams_.Encode()
  8234. req, _ := http.NewRequest("GET", urls, body)
  8235. req.Header = reqHeaders
  8236. googleapi.Expand(req.URL, map[string]string{
  8237. "serviceName": c.serviceName,
  8238. })
  8239. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8240. }
  8241. // Do executes the "servicemanagement.services.rollouts.list" call.
  8242. // Exactly one of *ListServiceRolloutsResponse or error will be non-nil.
  8243. // Any non-2xx status code is an error. Response headers are in either
  8244. // *ListServiceRolloutsResponse.ServerResponse.Header or (if a response
  8245. // was returned at all) in error.(*googleapi.Error).Header. Use
  8246. // googleapi.IsNotModified to check whether the returned error was
  8247. // because http.StatusNotModified was returned.
  8248. func (c *ServicesRolloutsListCall) Do(opts ...googleapi.CallOption) (*ListServiceRolloutsResponse, error) {
  8249. gensupport.SetOptions(c.urlParams_, opts...)
  8250. res, err := c.doRequest("json")
  8251. if res != nil && res.StatusCode == http.StatusNotModified {
  8252. if res.Body != nil {
  8253. res.Body.Close()
  8254. }
  8255. return nil, &googleapi.Error{
  8256. Code: res.StatusCode,
  8257. Header: res.Header,
  8258. }
  8259. }
  8260. if err != nil {
  8261. return nil, err
  8262. }
  8263. defer googleapi.CloseBody(res)
  8264. if err := googleapi.CheckResponse(res); err != nil {
  8265. return nil, err
  8266. }
  8267. ret := &ListServiceRolloutsResponse{
  8268. ServerResponse: googleapi.ServerResponse{
  8269. Header: res.Header,
  8270. HTTPStatusCode: res.StatusCode,
  8271. },
  8272. }
  8273. target := &ret
  8274. if err := gensupport.DecodeResponse(target, res); err != nil {
  8275. return nil, err
  8276. }
  8277. return ret, nil
  8278. // {
  8279. // "description": "Lists the history of the service configuration rollouts for a managed\nservice, from the newest to the oldest.",
  8280. // "flatPath": "v1/services/{serviceName}/rollouts",
  8281. // "httpMethod": "GET",
  8282. // "id": "servicemanagement.services.rollouts.list",
  8283. // "parameterOrder": [
  8284. // "serviceName"
  8285. // ],
  8286. // "parameters": {
  8287. // "filter": {
  8288. // "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'",
  8289. // "location": "query",
  8290. // "type": "string"
  8291. // },
  8292. // "pageSize": {
  8293. // "description": "The max number of items to include in the response list.",
  8294. // "format": "int32",
  8295. // "location": "query",
  8296. // "type": "integer"
  8297. // },
  8298. // "pageToken": {
  8299. // "description": "The token of the page to retrieve.",
  8300. // "location": "query",
  8301. // "type": "string"
  8302. // },
  8303. // "serviceName": {
  8304. // "description": "The name of the service. See the [overview](/service-management/overview)\nfor naming requirements. For example: `example.googleapis.com`.",
  8305. // "location": "path",
  8306. // "required": true,
  8307. // "type": "string"
  8308. // }
  8309. // },
  8310. // "path": "v1/services/{serviceName}/rollouts",
  8311. // "response": {
  8312. // "$ref": "ListServiceRolloutsResponse"
  8313. // },
  8314. // "scopes": [
  8315. // "https://www.googleapis.com/auth/cloud-platform",
  8316. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  8317. // "https://www.googleapis.com/auth/service.management",
  8318. // "https://www.googleapis.com/auth/service.management.readonly"
  8319. // ]
  8320. // }
  8321. }
  8322. // Pages invokes f for each page of results.
  8323. // A non-nil error returned from f will halt the iteration.
  8324. // The provided context supersedes any context provided to the Context method.
  8325. func (c *ServicesRolloutsListCall) Pages(ctx context.Context, f func(*ListServiceRolloutsResponse) error) error {
  8326. c.ctx_ = ctx
  8327. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8328. for {
  8329. x, err := c.Do()
  8330. if err != nil {
  8331. return err
  8332. }
  8333. if err := f(x); err != nil {
  8334. return err
  8335. }
  8336. if x.NextPageToken == "" {
  8337. return nil
  8338. }
  8339. c.PageToken(x.NextPageToken)
  8340. }
  8341. }