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.
 
 
 

5383 lines
197 KiB

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