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.
 
 
 

6211 regels
227 KiB

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