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

6676 lines
244 KiB

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