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.
 
 
 

5959 lines
216 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/v1"
  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/v1"
  41. import (
  42. "bytes"
  43. "context"
  44. "encoding/json"
  45. "errors"
  46. "fmt"
  47. "io"
  48. "net/http"
  49. "net/url"
  50. "strconv"
  51. "strings"
  52. gensupport "google.golang.org/api/gensupport"
  53. googleapi "google.golang.org/api/googleapi"
  54. option "google.golang.org/api/option"
  55. htransport "google.golang.org/api/transport/http"
  56. )
  57. // Always reference these packages, just in case the auto-generated code
  58. // below doesn't.
  59. var _ = bytes.NewBuffer
  60. var _ = strconv.Itoa
  61. var _ = fmt.Sprintf
  62. var _ = json.NewDecoder
  63. var _ = io.Copy
  64. var _ = url.Parse
  65. var _ = gensupport.MarshalJSON
  66. var _ = googleapi.Version
  67. var _ = errors.New
  68. var _ = strings.Replace
  69. var _ = context.Canceled
  70. const apiId = "servicenetworking:v1"
  71. const apiName = "servicenetworking"
  72. const apiVersion = "v1"
  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. // CancelOperationRequest: The request message for
  821. // Operations.CancelOperation.
  822. type CancelOperationRequest struct {
  823. }
  824. // Connection: Represents a private connection resource. A private
  825. // connection is implemented
  826. // as a VPC Network Peering connection between a service producer's VPC
  827. // network
  828. // and a service consumer's VPC network.
  829. type Connection struct {
  830. // Network: The name of service consumer's VPC network that's connected
  831. // with service
  832. // producer network, in the following
  833. // format:
  834. // `projects/{project}/global/networks/{network}`.
  835. // `{project}` is a project number, such as in `12345` that includes
  836. // the VPC service consumer's VPC network. `{network}` is the name of
  837. // the
  838. // service consumer's VPC network.
  839. Network string `json:"network,omitempty"`
  840. // Peering: Output only.
  841. // The name of the VPC Network Peering connection that was created by
  842. // the
  843. // service producer.
  844. Peering string `json:"peering,omitempty"`
  845. // ReservedPeeringRanges: The name of one or more allocated IP address
  846. // ranges for this service
  847. // producer of type `PEERING`.
  848. // Note that invoking CreateConnection method with a different range
  849. // when
  850. // connection is already established will not modify already
  851. // provisioned
  852. // service producer subnetworks.
  853. // If CreateConnection method is invoked repeatedly to reconnect when
  854. // peering
  855. // connection had been disconnected on the consumer side, leaving this
  856. // field
  857. // empty will restore previously allocated IP ranges.
  858. ReservedPeeringRanges []string `json:"reservedPeeringRanges,omitempty"`
  859. // Service: Output only.
  860. // The name of the peering service that's associated with this
  861. // connection, in
  862. // the following format: `services/{service name}`.
  863. Service string `json:"service,omitempty"`
  864. // ForceSendFields is a list of field names (e.g. "Network") to
  865. // unconditionally include in API requests. By default, fields with
  866. // empty values are omitted from API requests. However, any non-pointer,
  867. // non-interface field appearing in ForceSendFields will be sent to the
  868. // server regardless of whether the field is empty or not. This may be
  869. // used to include empty fields in Patch requests.
  870. ForceSendFields []string `json:"-"`
  871. // NullFields is a list of field names (e.g. "Network") to include in
  872. // API requests with the JSON null value. By default, fields with empty
  873. // values are omitted from API requests. However, any field with an
  874. // empty value appearing in NullFields will be sent to the server as
  875. // null. It is an error if a field in this list has a non-empty value.
  876. // This may be used to include null fields in Patch requests.
  877. NullFields []string `json:"-"`
  878. }
  879. func (s *Connection) MarshalJSON() ([]byte, error) {
  880. type NoMethod Connection
  881. raw := NoMethod(*s)
  882. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  883. }
  884. // Context: `Context` defines which contexts an API
  885. // requests.
  886. //
  887. // Example:
  888. //
  889. // context:
  890. // rules:
  891. // - selector: "*"
  892. // requested:
  893. // - google.rpc.context.ProjectContext
  894. // - google.rpc.context.OriginContext
  895. //
  896. // The above specifies that all methods in the API
  897. // request
  898. // `google.rpc.context.ProjectContext`
  899. // and
  900. // `google.rpc.context.OriginContext`.
  901. //
  902. // Available context types are defined in
  903. // package
  904. // `google.rpc.context`.
  905. //
  906. // This also provides mechanism to whitelist any protobuf message
  907. // extension that
  908. // can be sent in grpc metadata using
  909. // “x-goog-ext-<extension_id>-bin”
  910. // and
  911. // “x-goog-ext-<extension_id>-jspb” format. For example, list any
  912. // service
  913. // specific protobuf types that can appear in grpc metadata as follows
  914. // in your
  915. // yaml file:
  916. //
  917. // Example:
  918. //
  919. // context:
  920. // rules:
  921. // - selector:
  922. // "google.example.library.v1.LibraryService.CreateBook"
  923. // allowed_request_extensions:
  924. // - google.foo.v1.NewExtension
  925. // allowed_response_extensions:
  926. // - google.foo.v1.NewExtension
  927. //
  928. // You can also specify extension ID instead of fully qualified
  929. // extension name
  930. // here.
  931. type Context struct {
  932. // Rules: A list of RPC context rules that apply to individual API
  933. // methods.
  934. //
  935. // **NOTE:** All service configuration rules follow "last one wins"
  936. // order.
  937. Rules []*ContextRule `json:"rules,omitempty"`
  938. // ForceSendFields is a list of field names (e.g. "Rules") to
  939. // unconditionally include in API requests. By default, fields with
  940. // empty values are omitted from API requests. However, any non-pointer,
  941. // non-interface field appearing in ForceSendFields will be sent to the
  942. // server regardless of whether the field is empty or not. This may be
  943. // used to include empty fields in Patch requests.
  944. ForceSendFields []string `json:"-"`
  945. // NullFields is a list of field names (e.g. "Rules") to include in API
  946. // requests with the JSON null value. By default, fields with empty
  947. // values are omitted from API requests. However, any field with an
  948. // empty value appearing in NullFields will be sent to the server as
  949. // null. It is an error if a field in this list has a non-empty value.
  950. // This may be used to include null fields in Patch requests.
  951. NullFields []string `json:"-"`
  952. }
  953. func (s *Context) MarshalJSON() ([]byte, error) {
  954. type NoMethod Context
  955. raw := NoMethod(*s)
  956. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  957. }
  958. // ContextRule: A context rule provides information about the context
  959. // for an individual API
  960. // element.
  961. type ContextRule struct {
  962. // AllowedRequestExtensions: A list of full type names or extension IDs
  963. // of extensions allowed in grpc
  964. // side channel from client to backend.
  965. AllowedRequestExtensions []string `json:"allowedRequestExtensions,omitempty"`
  966. // AllowedResponseExtensions: A list of full type names or extension IDs
  967. // of extensions allowed in grpc
  968. // side channel from backend to client.
  969. AllowedResponseExtensions []string `json:"allowedResponseExtensions,omitempty"`
  970. // Provided: A list of full type names of provided contexts.
  971. Provided []string `json:"provided,omitempty"`
  972. // Requested: A list of full type names of requested contexts.
  973. Requested []string `json:"requested,omitempty"`
  974. // Selector: Selects the methods to which this rule applies.
  975. //
  976. // Refer to selector for syntax details.
  977. Selector string `json:"selector,omitempty"`
  978. // ForceSendFields is a list of field names (e.g.
  979. // "AllowedRequestExtensions") to unconditionally include in API
  980. // requests. By default, fields with empty values are omitted from API
  981. // requests. However, any non-pointer, non-interface field appearing in
  982. // ForceSendFields will be sent to the server regardless of whether the
  983. // field is empty or not. This may be used to include empty fields in
  984. // Patch requests.
  985. ForceSendFields []string `json:"-"`
  986. // NullFields is a list of field names (e.g. "AllowedRequestExtensions")
  987. // to include in API requests with the JSON null value. By default,
  988. // fields with empty values are omitted from API requests. However, any
  989. // field with an empty value appearing in NullFields will be sent to the
  990. // server as null. It is an error if a field in this list has a
  991. // non-empty value. This may be used to include null fields in Patch
  992. // requests.
  993. NullFields []string `json:"-"`
  994. }
  995. func (s *ContextRule) MarshalJSON() ([]byte, error) {
  996. type NoMethod ContextRule
  997. raw := NoMethod(*s)
  998. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  999. }
  1000. // Control: Selects and configures the service controller used by the
  1001. // service. The
  1002. // service controller handles features like abuse, quota, billing,
  1003. // logging,
  1004. // monitoring, etc.
  1005. type Control struct {
  1006. // Environment: The service control environment to use. If empty, no
  1007. // control plane
  1008. // feature (like quota and billing) will be enabled.
  1009. Environment string `json:"environment,omitempty"`
  1010. // ForceSendFields is a list of field names (e.g. "Environment") to
  1011. // unconditionally include in API requests. By default, fields with
  1012. // empty values are omitted from API requests. However, any non-pointer,
  1013. // non-interface field appearing in ForceSendFields will be sent to the
  1014. // server regardless of whether the field is empty or not. This may be
  1015. // used to include empty fields in Patch requests.
  1016. ForceSendFields []string `json:"-"`
  1017. // NullFields is a list of field names (e.g. "Environment") to include
  1018. // in API requests with the JSON null value. By default, fields with
  1019. // empty values are omitted from API requests. However, any field with
  1020. // an empty value appearing in NullFields will be sent to the server as
  1021. // null. It is an error if a field in this list has a non-empty value.
  1022. // This may be used to include null fields in Patch requests.
  1023. NullFields []string `json:"-"`
  1024. }
  1025. func (s *Control) MarshalJSON() ([]byte, error) {
  1026. type NoMethod Control
  1027. raw := NoMethod(*s)
  1028. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1029. }
  1030. // CustomError: Customize service error responses. For example, list
  1031. // any service
  1032. // specific protobuf types that can appear in error detail lists
  1033. // of
  1034. // error responses.
  1035. //
  1036. // Example:
  1037. //
  1038. // custom_error:
  1039. // types:
  1040. // - google.foo.v1.CustomError
  1041. // - google.foo.v1.AnotherError
  1042. type CustomError struct {
  1043. // Rules: The list of custom error rules that apply to individual API
  1044. // messages.
  1045. //
  1046. // **NOTE:** All service configuration rules follow "last one wins"
  1047. // order.
  1048. Rules []*CustomErrorRule `json:"rules,omitempty"`
  1049. // Types: The list of custom error detail types, e.g.
  1050. // 'google.foo.v1.CustomError'.
  1051. Types []string `json:"types,omitempty"`
  1052. // ForceSendFields is a list of field names (e.g. "Rules") to
  1053. // unconditionally include in API requests. By default, fields with
  1054. // empty values are omitted from API requests. However, any non-pointer,
  1055. // non-interface field appearing in ForceSendFields will be sent to the
  1056. // server regardless of whether the field is empty or not. This may be
  1057. // used to include empty fields in Patch requests.
  1058. ForceSendFields []string `json:"-"`
  1059. // NullFields is a list of field names (e.g. "Rules") to include in API
  1060. // requests with the JSON null value. By default, fields with empty
  1061. // values are omitted from API requests. However, any field with an
  1062. // empty value appearing in NullFields will be sent to the server as
  1063. // null. It is an error if a field in this list has a non-empty value.
  1064. // This may be used to include null fields in Patch requests.
  1065. NullFields []string `json:"-"`
  1066. }
  1067. func (s *CustomError) MarshalJSON() ([]byte, error) {
  1068. type NoMethod CustomError
  1069. raw := NoMethod(*s)
  1070. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1071. }
  1072. // CustomErrorRule: A custom error rule.
  1073. type CustomErrorRule struct {
  1074. // IsErrorType: Mark this message as possible payload in error response.
  1075. // Otherwise,
  1076. // objects of this type will be filtered when they appear in error
  1077. // payload.
  1078. IsErrorType bool `json:"isErrorType,omitempty"`
  1079. // Selector: Selects messages to which this rule applies.
  1080. //
  1081. // Refer to selector for syntax details.
  1082. Selector string `json:"selector,omitempty"`
  1083. // ForceSendFields is a list of field names (e.g. "IsErrorType") to
  1084. // unconditionally include in API requests. By default, fields with
  1085. // empty values are omitted from API requests. However, any non-pointer,
  1086. // non-interface field appearing in ForceSendFields will be sent to the
  1087. // server regardless of whether the field is empty or not. This may be
  1088. // used to include empty fields in Patch requests.
  1089. ForceSendFields []string `json:"-"`
  1090. // NullFields is a list of field names (e.g. "IsErrorType") to include
  1091. // in API requests with the JSON null value. By default, fields with
  1092. // empty values are omitted from API requests. However, any field with
  1093. // an empty value appearing in NullFields will be sent to the server as
  1094. // null. It is an error if a field in this list has a non-empty value.
  1095. // This may be used to include null fields in Patch requests.
  1096. NullFields []string `json:"-"`
  1097. }
  1098. func (s *CustomErrorRule) MarshalJSON() ([]byte, error) {
  1099. type NoMethod CustomErrorRule
  1100. raw := NoMethod(*s)
  1101. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1102. }
  1103. // CustomHttpPattern: A custom pattern is used for defining custom HTTP
  1104. // verb.
  1105. type CustomHttpPattern struct {
  1106. // Kind: The name of this custom HTTP verb.
  1107. Kind string `json:"kind,omitempty"`
  1108. // Path: The path matched by this custom verb.
  1109. Path string `json:"path,omitempty"`
  1110. // ForceSendFields is a list of field names (e.g. "Kind") to
  1111. // unconditionally include in API requests. By default, fields with
  1112. // empty values are omitted from API requests. However, any non-pointer,
  1113. // non-interface field appearing in ForceSendFields will be sent to the
  1114. // server regardless of whether the field is empty or not. This may be
  1115. // used to include empty fields in Patch requests.
  1116. ForceSendFields []string `json:"-"`
  1117. // NullFields is a list of field names (e.g. "Kind") to include in API
  1118. // requests with the JSON null value. By default, fields with empty
  1119. // values are omitted from API requests. However, any field with an
  1120. // empty value appearing in NullFields will be sent to the server as
  1121. // null. It is an error if a field in this list has a non-empty value.
  1122. // This may be used to include null fields in Patch requests.
  1123. NullFields []string `json:"-"`
  1124. }
  1125. func (s *CustomHttpPattern) MarshalJSON() ([]byte, error) {
  1126. type NoMethod CustomHttpPattern
  1127. raw := NoMethod(*s)
  1128. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1129. }
  1130. // Documentation: `Documentation` provides the information for
  1131. // describing a service.
  1132. //
  1133. // Example:
  1134. // <pre><code>documentation:
  1135. // summary: >
  1136. // The Google Calendar API gives access
  1137. // to most calendar features.
  1138. // pages:
  1139. // - name: Overview
  1140. // content: &#40;== include google/foo/overview.md ==&#41;
  1141. // - name: Tutorial
  1142. // content: &#40;== include google/foo/tutorial.md ==&#41;
  1143. // subpages;
  1144. // - name: Java
  1145. // content: &#40;== include google/foo/tutorial_java.md ==&#41;
  1146. // rules:
  1147. // - selector: google.calendar.Calendar.Get
  1148. // description: >
  1149. // ...
  1150. // - selector: google.calendar.Calendar.Put
  1151. // description: >
  1152. // ...
  1153. // </code></pre>
  1154. // Documentation is provided in markdown syntax. In addition to
  1155. // standard markdown features, definition lists, tables and fenced
  1156. // code blocks are supported. Section headers can be provided and
  1157. // are
  1158. // interpreted relative to the section nesting of the context where
  1159. // a documentation fragment is embedded.
  1160. //
  1161. // Documentation from the IDL is merged with documentation defined
  1162. // via the config at normalization time, where documentation provided
  1163. // by config rules overrides IDL provided.
  1164. //
  1165. // A number of constructs specific to the API platform are supported
  1166. // in documentation text.
  1167. //
  1168. // In order to reference a proto element, the following
  1169. // notation can be
  1170. // used:
  1171. // <pre><code>&#91;fully.qualified.proto.name]&#91;]</code></pre>
  1172. // T
  1173. // o override the display text used for the link, this can be
  1174. // used:
  1175. // <pre><code>&#91;display
  1176. // text]&#91;fully.qualified.proto.name]</code></pre>
  1177. // Text can be excluded from doc using the following
  1178. // notation:
  1179. // <pre><code>&#40;-- internal comment --&#41;</code></pre>
  1180. //
  1181. // A few directives are available in documentation. Note that
  1182. // directives must appear on a single line to be properly
  1183. // identified. The `include` directive includes a markdown file from
  1184. // an external source:
  1185. // <pre><code>&#40;== include path/to/file ==&#41;</code></pre>
  1186. // The `resource_for` directive marks a message to be the resource of
  1187. // a collection in REST view. If it is not specified, tools attempt
  1188. // to infer the resource from the operations in a
  1189. // collection:
  1190. // <pre><code>&#40;== resource_for v1.shelves.books
  1191. // ==&#41;</code></pre>
  1192. // The directive `suppress_warning` does not directly affect
  1193. // documentation
  1194. // and is documented together with service config validation.
  1195. type Documentation struct {
  1196. // DocumentationRootUrl: The URL to the root of documentation.
  1197. DocumentationRootUrl string `json:"documentationRootUrl,omitempty"`
  1198. // Overview: Declares a single overview page. For
  1199. // example:
  1200. // <pre><code>documentation:
  1201. // summary: ...
  1202. // overview: &#40;== include overview.md ==&#41;
  1203. // </code></pre>
  1204. // This is a shortcut for the following declaration (using pages
  1205. // style):
  1206. // <pre><code>documentation:
  1207. // summary: ...
  1208. // pages:
  1209. // - name: Overview
  1210. // content: &#40;== include overview.md ==&#41;
  1211. // </code></pre>
  1212. // Note: you cannot specify both `overview` field and `pages` field.
  1213. Overview string `json:"overview,omitempty"`
  1214. // Pages: The top level pages for the documentation set.
  1215. Pages []*Page `json:"pages,omitempty"`
  1216. // Rules: A list of documentation rules that apply to individual API
  1217. // elements.
  1218. //
  1219. // **NOTE:** All service configuration rules follow "last one wins"
  1220. // order.
  1221. Rules []*DocumentationRule `json:"rules,omitempty"`
  1222. // Summary: A short summary of what the service does. Can only be
  1223. // provided by
  1224. // plain text.
  1225. Summary string `json:"summary,omitempty"`
  1226. // ForceSendFields is a list of field names (e.g.
  1227. // "DocumentationRootUrl") to unconditionally include in API requests.
  1228. // By default, fields with empty values are omitted from API requests.
  1229. // However, any non-pointer, non-interface field appearing in
  1230. // ForceSendFields will be sent to the server regardless of whether the
  1231. // field is empty or not. This may be used to include empty fields in
  1232. // Patch requests.
  1233. ForceSendFields []string `json:"-"`
  1234. // NullFields is a list of field names (e.g. "DocumentationRootUrl") to
  1235. // include in API requests with the JSON null value. By default, fields
  1236. // with empty values are omitted from API requests. However, any field
  1237. // with an empty value appearing in NullFields will be sent to the
  1238. // server as null. It is an error if a field in this list has a
  1239. // non-empty value. This may be used to include null fields in Patch
  1240. // requests.
  1241. NullFields []string `json:"-"`
  1242. }
  1243. func (s *Documentation) MarshalJSON() ([]byte, error) {
  1244. type NoMethod Documentation
  1245. raw := NoMethod(*s)
  1246. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1247. }
  1248. // DocumentationRule: A documentation rule provides information about
  1249. // individual API elements.
  1250. type DocumentationRule struct {
  1251. // DeprecationDescription: Deprecation description of the selected
  1252. // element(s). It can be provided if
  1253. // an element is marked as `deprecated`.
  1254. DeprecationDescription string `json:"deprecationDescription,omitempty"`
  1255. // Description: Description of the selected API(s).
  1256. Description string `json:"description,omitempty"`
  1257. // Selector: The selector is a comma-separated list of patterns. Each
  1258. // pattern is a
  1259. // qualified name of the element which may end in "*", indicating a
  1260. // wildcard.
  1261. // Wildcards are only allowed at the end and for a whole component of
  1262. // the
  1263. // qualified name, i.e. "foo.*" is ok, but not "foo.b*" or "foo.*.bar".
  1264. // To
  1265. // specify a default for all applicable elements, the whole pattern
  1266. // "*"
  1267. // is used.
  1268. Selector string `json:"selector,omitempty"`
  1269. // ForceSendFields is a list of field names (e.g.
  1270. // "DeprecationDescription") to unconditionally include in API requests.
  1271. // By default, fields with empty values are omitted from API requests.
  1272. // However, any non-pointer, non-interface field appearing in
  1273. // ForceSendFields will be sent to the server regardless of whether the
  1274. // field is empty or not. This may be used to include empty fields in
  1275. // Patch requests.
  1276. ForceSendFields []string `json:"-"`
  1277. // NullFields is a list of field names (e.g. "DeprecationDescription")
  1278. // to include in API requests with the JSON null value. By default,
  1279. // fields with empty values are omitted from API requests. However, any
  1280. // field with an empty value appearing in NullFields will be sent to the
  1281. // server as null. It is an error if a field in this list has a
  1282. // non-empty value. This may be used to include null fields in Patch
  1283. // requests.
  1284. NullFields []string `json:"-"`
  1285. }
  1286. func (s *DocumentationRule) MarshalJSON() ([]byte, error) {
  1287. type NoMethod DocumentationRule
  1288. raw := NoMethod(*s)
  1289. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1290. }
  1291. // Empty: A generic empty message that you can re-use to avoid defining
  1292. // duplicated
  1293. // empty messages in your APIs. A typical example is to use it as the
  1294. // request
  1295. // or the response type of an API method. For instance:
  1296. //
  1297. // service Foo {
  1298. // rpc Bar(google.protobuf.Empty) returns
  1299. // (google.protobuf.Empty);
  1300. // }
  1301. //
  1302. // The JSON representation for `Empty` is empty JSON object `{}`.
  1303. type Empty struct {
  1304. // ServerResponse contains the HTTP response code and headers from the
  1305. // server.
  1306. googleapi.ServerResponse `json:"-"`
  1307. }
  1308. // Endpoint: `Endpoint` describes a network endpoint that serves a set
  1309. // of APIs.
  1310. // A service may expose any number of endpoints, and all endpoints share
  1311. // the
  1312. // same service configuration, such as quota configuration and
  1313. // monitoring
  1314. // configuration.
  1315. //
  1316. // Example service configuration:
  1317. //
  1318. // name: library-example.googleapis.com
  1319. // endpoints:
  1320. // # Below entry makes 'google.example.library.v1.Library'
  1321. // # API be served from endpoint address
  1322. // library-example.googleapis.com.
  1323. // # It also allows HTTP OPTIONS calls to be passed to the
  1324. // backend, for
  1325. // # it to decide whether the subsequent cross-origin request is
  1326. // # allowed to proceed.
  1327. // - name: library-example.googleapis.com
  1328. // allow_cors: true
  1329. type Endpoint struct {
  1330. // Aliases: DEPRECATED: This field is no longer supported. Instead of
  1331. // using aliases,
  1332. // please specify multiple google.api.Endpoint for each of the
  1333. // intended
  1334. // aliases.
  1335. //
  1336. // Additional names that this endpoint will be hosted on.
  1337. Aliases []string `json:"aliases,omitempty"`
  1338. // AllowCors:
  1339. // Allowing
  1340. // [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sh
  1341. // aring), aka
  1342. // cross-domain traffic, would allow the backends served from this
  1343. // endpoint to
  1344. // receive and respond to HTTP OPTIONS requests. The response will be
  1345. // used by
  1346. // the browser to determine whether the subsequent cross-origin request
  1347. // is
  1348. // allowed to proceed.
  1349. AllowCors bool `json:"allowCors,omitempty"`
  1350. // Features: The list of features enabled on this endpoint.
  1351. Features []string `json:"features,omitempty"`
  1352. // Name: The canonical name of this endpoint.
  1353. Name string `json:"name,omitempty"`
  1354. // Target: The specification of an Internet routable address of API
  1355. // frontend that will
  1356. // handle requests to this
  1357. // [API
  1358. // Endpoint](https://cloud.google.com/apis/design/glossary). It should
  1359. // be
  1360. // either a valid IPv4 address or a fully-qualified domain name. For
  1361. // example,
  1362. // "8.8.8.8" or "myservice.appspot.com".
  1363. Target string `json:"target,omitempty"`
  1364. // ForceSendFields is a list of field names (e.g. "Aliases") to
  1365. // unconditionally include in API requests. By default, fields with
  1366. // empty values are omitted from API requests. However, any non-pointer,
  1367. // non-interface field appearing in ForceSendFields will be sent to the
  1368. // server regardless of whether the field is empty or not. This may be
  1369. // used to include empty fields in Patch requests.
  1370. ForceSendFields []string `json:"-"`
  1371. // NullFields is a list of field names (e.g. "Aliases") to include in
  1372. // API requests with the JSON null value. By default, fields with empty
  1373. // values are omitted from API requests. However, any field with an
  1374. // empty value appearing in NullFields will be sent to the server as
  1375. // null. It is an error if a field in this list has a non-empty value.
  1376. // This may be used to include null fields in Patch requests.
  1377. NullFields []string `json:"-"`
  1378. }
  1379. func (s *Endpoint) MarshalJSON() ([]byte, error) {
  1380. type NoMethod Endpoint
  1381. raw := NoMethod(*s)
  1382. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1383. }
  1384. // Enum: Enum type definition.
  1385. type Enum struct {
  1386. // Enumvalue: Enum value definitions.
  1387. Enumvalue []*EnumValue `json:"enumvalue,omitempty"`
  1388. // Name: Enum type name.
  1389. Name string `json:"name,omitempty"`
  1390. // Options: Protocol buffer options.
  1391. Options []*Option `json:"options,omitempty"`
  1392. // SourceContext: The source context.
  1393. SourceContext *SourceContext `json:"sourceContext,omitempty"`
  1394. // Syntax: The source syntax.
  1395. //
  1396. // Possible values:
  1397. // "SYNTAX_PROTO2" - Syntax `proto2`.
  1398. // "SYNTAX_PROTO3" - Syntax `proto3`.
  1399. Syntax string `json:"syntax,omitempty"`
  1400. // ForceSendFields is a list of field names (e.g. "Enumvalue") to
  1401. // unconditionally include in API requests. By default, fields with
  1402. // empty values are omitted from API requests. However, any non-pointer,
  1403. // non-interface field appearing in ForceSendFields will be sent to the
  1404. // server regardless of whether the field is empty or not. This may be
  1405. // used to include empty fields in Patch requests.
  1406. ForceSendFields []string `json:"-"`
  1407. // NullFields is a list of field names (e.g. "Enumvalue") to include in
  1408. // API requests with the JSON null value. By default, fields with empty
  1409. // values are omitted from API requests. However, any field with an
  1410. // empty value appearing in NullFields will be sent to the server as
  1411. // null. It is an error if a field in this list has a non-empty value.
  1412. // This may be used to include null fields in Patch requests.
  1413. NullFields []string `json:"-"`
  1414. }
  1415. func (s *Enum) MarshalJSON() ([]byte, error) {
  1416. type NoMethod Enum
  1417. raw := NoMethod(*s)
  1418. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1419. }
  1420. // EnumValue: Enum value definition.
  1421. type EnumValue struct {
  1422. // Name: Enum value name.
  1423. Name string `json:"name,omitempty"`
  1424. // Number: Enum value number.
  1425. Number int64 `json:"number,omitempty"`
  1426. // Options: Protocol buffer options.
  1427. Options []*Option `json:"options,omitempty"`
  1428. // ForceSendFields is a list of field names (e.g. "Name") 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. "Name") to include in API
  1436. // requests with the JSON null value. By default, fields with empty
  1437. // values are omitted from API requests. However, any field with an
  1438. // 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 *EnumValue) MarshalJSON() ([]byte, error) {
  1444. type NoMethod EnumValue
  1445. raw := NoMethod(*s)
  1446. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1447. }
  1448. // Experimental: Experimental service configuration. These configuration
  1449. // options can
  1450. // only be used by whitelisted users.
  1451. type Experimental struct {
  1452. // Authorization: Authorization configuration.
  1453. Authorization *AuthorizationConfig `json:"authorization,omitempty"`
  1454. // ForceSendFields is a list of field names (e.g. "Authorization") to
  1455. // unconditionally include in API requests. By default, fields with
  1456. // empty values are omitted from API requests. However, any non-pointer,
  1457. // non-interface field appearing in ForceSendFields will be sent to the
  1458. // server regardless of whether the field is empty or not. This may be
  1459. // used to include empty fields in Patch requests.
  1460. ForceSendFields []string `json:"-"`
  1461. // NullFields is a list of field names (e.g. "Authorization") to include
  1462. // in API requests with the JSON null value. By default, fields with
  1463. // empty values are omitted from API requests. However, any field with
  1464. // an empty value appearing in NullFields will be sent to the server as
  1465. // null. It is an error if a field in this list has a non-empty value.
  1466. // This may be used to include null fields in Patch requests.
  1467. NullFields []string `json:"-"`
  1468. }
  1469. func (s *Experimental) MarshalJSON() ([]byte, error) {
  1470. type NoMethod Experimental
  1471. raw := NoMethod(*s)
  1472. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1473. }
  1474. // Field: A single field of a message type.
  1475. type Field struct {
  1476. // Cardinality: The field cardinality.
  1477. //
  1478. // Possible values:
  1479. // "CARDINALITY_UNKNOWN" - For fields with unknown cardinality.
  1480. // "CARDINALITY_OPTIONAL" - For optional fields.
  1481. // "CARDINALITY_REQUIRED" - For required fields. Proto2 syntax only.
  1482. // "CARDINALITY_REPEATED" - For repeated fields.
  1483. Cardinality string `json:"cardinality,omitempty"`
  1484. // DefaultValue: The string value of the default value of this field.
  1485. // Proto2 syntax only.
  1486. DefaultValue string `json:"defaultValue,omitempty"`
  1487. // JsonName: The field JSON name.
  1488. JsonName string `json:"jsonName,omitempty"`
  1489. // Kind: The field type.
  1490. //
  1491. // Possible values:
  1492. // "TYPE_UNKNOWN" - Field type unknown.
  1493. // "TYPE_DOUBLE" - Field type double.
  1494. // "TYPE_FLOAT" - Field type float.
  1495. // "TYPE_INT64" - Field type int64.
  1496. // "TYPE_UINT64" - Field type uint64.
  1497. // "TYPE_INT32" - Field type int32.
  1498. // "TYPE_FIXED64" - Field type fixed64.
  1499. // "TYPE_FIXED32" - Field type fixed32.
  1500. // "TYPE_BOOL" - Field type bool.
  1501. // "TYPE_STRING" - Field type string.
  1502. // "TYPE_GROUP" - Field type group. Proto2 syntax only, and
  1503. // deprecated.
  1504. // "TYPE_MESSAGE" - Field type message.
  1505. // "TYPE_BYTES" - Field type bytes.
  1506. // "TYPE_UINT32" - Field type uint32.
  1507. // "TYPE_ENUM" - Field type enum.
  1508. // "TYPE_SFIXED32" - Field type sfixed32.
  1509. // "TYPE_SFIXED64" - Field type sfixed64.
  1510. // "TYPE_SINT32" - Field type sint32.
  1511. // "TYPE_SINT64" - Field type sint64.
  1512. Kind string `json:"kind,omitempty"`
  1513. // Name: The field name.
  1514. Name string `json:"name,omitempty"`
  1515. // Number: The field number.
  1516. Number int64 `json:"number,omitempty"`
  1517. // OneofIndex: The index of the field type in `Type.oneofs`, for message
  1518. // or enumeration
  1519. // types. The first type has index 1; zero means the type is not in the
  1520. // list.
  1521. OneofIndex int64 `json:"oneofIndex,omitempty"`
  1522. // Options: The protocol buffer options.
  1523. Options []*Option `json:"options,omitempty"`
  1524. // Packed: Whether to use alternative packed wire representation.
  1525. Packed bool `json:"packed,omitempty"`
  1526. // TypeUrl: The field type URL, without the scheme, for message or
  1527. // enumeration
  1528. // types. Example: "type.googleapis.com/google.protobuf.Timestamp".
  1529. TypeUrl string `json:"typeUrl,omitempty"`
  1530. // ForceSendFields is a list of field names (e.g. "Cardinality") to
  1531. // unconditionally include in API requests. By default, fields with
  1532. // empty values are omitted from API requests. However, any non-pointer,
  1533. // non-interface field appearing in ForceSendFields will be sent to the
  1534. // server regardless of whether the field is empty or not. This may be
  1535. // used to include empty fields in Patch requests.
  1536. ForceSendFields []string `json:"-"`
  1537. // NullFields is a list of field names (e.g. "Cardinality") to include
  1538. // in API requests with the JSON null value. By default, fields with
  1539. // empty values are omitted from API requests. However, any field with
  1540. // an empty value appearing in NullFields will be sent to the server as
  1541. // null. It is an error if a field in this list has a non-empty value.
  1542. // This may be used to include null fields in Patch requests.
  1543. NullFields []string `json:"-"`
  1544. }
  1545. func (s *Field) MarshalJSON() ([]byte, error) {
  1546. type NoMethod Field
  1547. raw := NoMethod(*s)
  1548. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1549. }
  1550. // GoogleCloudServicenetworkingV1betaSubnetwork: Represents a subnet
  1551. // that was created or discovered by a private access
  1552. // management service.
  1553. type GoogleCloudServicenetworkingV1betaSubnetwork struct {
  1554. // IpCidrRange: Subnetwork CIDR range in `10.x.x.x/y` format.
  1555. IpCidrRange string `json:"ipCidrRange,omitempty"`
  1556. // Name: Subnetwork name.
  1557. // See https://cloud.google.com/compute/docs/vpc/
  1558. Name string `json:"name,omitempty"`
  1559. // Network: In the Shared VPC host project, the VPC network that's
  1560. // peered with the
  1561. // consumer network. For
  1562. // example:
  1563. // `projects/1234321/global/networks/host-network`
  1564. Network string `json:"network,omitempty"`
  1565. // OutsideAllocation: This is a discovered subnet that is not within the
  1566. // current consumer
  1567. // allocated ranges.
  1568. OutsideAllocation bool `json:"outsideAllocation,omitempty"`
  1569. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  1570. // unconditionally include in API requests. By default, fields with
  1571. // empty values are omitted from API requests. However, any non-pointer,
  1572. // non-interface field appearing in ForceSendFields will be sent to the
  1573. // server regardless of whether the field is empty or not. This may be
  1574. // used to include empty fields in Patch requests.
  1575. ForceSendFields []string `json:"-"`
  1576. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  1577. // in API requests with the JSON null value. By default, fields with
  1578. // empty values are omitted from API requests. However, any field with
  1579. // an empty value appearing in NullFields will be sent to the server as
  1580. // null. It is an error if a field in this list has a non-empty value.
  1581. // This may be used to include null fields in Patch requests.
  1582. NullFields []string `json:"-"`
  1583. }
  1584. func (s *GoogleCloudServicenetworkingV1betaSubnetwork) MarshalJSON() ([]byte, error) {
  1585. type NoMethod GoogleCloudServicenetworkingV1betaSubnetwork
  1586. raw := NoMethod(*s)
  1587. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1588. }
  1589. // Http: Defines the HTTP configuration for an API service. It contains
  1590. // a list of
  1591. // HttpRule, each specifying the mapping of an RPC method
  1592. // to one or more HTTP REST API methods.
  1593. type Http struct {
  1594. // FullyDecodeReservedExpansion: When set to true, URL path parameters
  1595. // will be fully URI-decoded except in
  1596. // cases of single segment matches in reserved expansion, where "%2F"
  1597. // will be
  1598. // left encoded.
  1599. //
  1600. // The default behavior is to not decode RFC 6570 reserved characters in
  1601. // multi
  1602. // segment matches.
  1603. FullyDecodeReservedExpansion bool `json:"fullyDecodeReservedExpansion,omitempty"`
  1604. // Rules: A list of HTTP configuration rules that apply to individual
  1605. // API methods.
  1606. //
  1607. // **NOTE:** All service configuration rules follow "last one wins"
  1608. // order.
  1609. Rules []*HttpRule `json:"rules,omitempty"`
  1610. // ForceSendFields is a list of field names (e.g.
  1611. // "FullyDecodeReservedExpansion") to unconditionally include in API
  1612. // requests. By default, fields with empty values are omitted from API
  1613. // requests. However, any non-pointer, non-interface field appearing in
  1614. // ForceSendFields will be sent to the server regardless of whether the
  1615. // field is empty or not. This may be used to include empty fields in
  1616. // Patch requests.
  1617. ForceSendFields []string `json:"-"`
  1618. // NullFields is a list of field names (e.g.
  1619. // "FullyDecodeReservedExpansion") to include in API requests with the
  1620. // JSON null value. By default, fields with empty values are omitted
  1621. // from API requests. However, any field with an empty value appearing
  1622. // in NullFields will be sent to the server as null. It is an error if a
  1623. // field in this list has a non-empty value. This may be used to include
  1624. // null fields in Patch requests.
  1625. NullFields []string `json:"-"`
  1626. }
  1627. func (s *Http) MarshalJSON() ([]byte, error) {
  1628. type NoMethod Http
  1629. raw := NoMethod(*s)
  1630. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1631. }
  1632. // HttpRule: # gRPC Transcoding
  1633. //
  1634. // gRPC Transcoding is a feature for mapping between a gRPC method and
  1635. // one or
  1636. // more HTTP REST endpoints. It allows developers to build a single API
  1637. // service
  1638. // that supports both gRPC APIs and REST APIs. Many systems, including
  1639. // [Google
  1640. // APIs](https://github.com/googleapis/googleapis),
  1641. // [Cloud Endpoints](https://cloud.google.com/endpoints),
  1642. // [gRPC
  1643. // Gateway](https://github.com/grpc-ecosystem/grpc-gateway),
  1644. // and [Envoy](https://github.com/envoyproxy/envoy) proxy support this
  1645. // feature
  1646. // and use it for large scale production services.
  1647. //
  1648. // `HttpRule` defines the schema of the gRPC/REST mapping. The mapping
  1649. // specifies
  1650. // how different portions of the gRPC request message are mapped to the
  1651. // URL
  1652. // path, URL query parameters, and HTTP request body. It also controls
  1653. // how the
  1654. // gRPC response message is mapped to the HTTP response body. `HttpRule`
  1655. // is
  1656. // typically specified as an `google.api.http` annotation on the gRPC
  1657. // method.
  1658. //
  1659. // Each mapping specifies a URL path template and an HTTP method. The
  1660. // path
  1661. // template may refer to one or more fields in the gRPC request message,
  1662. // as long
  1663. // as each field is a non-repeated field with a primitive (non-message)
  1664. // type.
  1665. // The path template controls how fields of the request message are
  1666. // mapped to
  1667. // the URL path.
  1668. //
  1669. // Example:
  1670. //
  1671. // service Messaging {
  1672. // rpc GetMessage(GetMessageRequest) returns (Message) {
  1673. // option (google.api.http) = {
  1674. // get: "/v1/{name=messages/*}"
  1675. // };
  1676. // }
  1677. // }
  1678. // message GetMessageRequest {
  1679. // string name = 1; // Mapped to URL path.
  1680. // }
  1681. // message Message {
  1682. // string text = 1; // The resource content.
  1683. // }
  1684. //
  1685. // This enables an HTTP REST to gRPC mapping as below:
  1686. //
  1687. // HTTP | gRPC
  1688. // -----|-----
  1689. // `GET /v1/messages/123456` | `GetMessage(name:
  1690. // "messages/123456")`
  1691. //
  1692. // Any fields in the request message which are not bound by the path
  1693. // template
  1694. // automatically become HTTP query parameters if there is no HTTP
  1695. // request body.
  1696. // For example:
  1697. //
  1698. // service Messaging {
  1699. // rpc GetMessage(GetMessageRequest) returns (Message) {
  1700. // option (google.api.http) = {
  1701. // get:"/v1/messages/{message_id}"
  1702. // };
  1703. // }
  1704. // }
  1705. // message GetMessageRequest {
  1706. // message SubMessage {
  1707. // string subfield = 1;
  1708. // }
  1709. // string message_id = 1; // Mapped to URL path.
  1710. // int64 revision = 2; // Mapped to URL query parameter
  1711. // `revision`.
  1712. // SubMessage sub = 3; // Mapped to URL query parameter
  1713. // `sub.subfield`.
  1714. // }
  1715. //
  1716. // This enables a HTTP JSON to RPC mapping as below:
  1717. //
  1718. // HTTP | gRPC
  1719. // -----|-----
  1720. // `GET /v1/messages/123456?revision=2&sub.subfield=foo` |
  1721. // `GetMessage(message_id: "123456" revision: 2 sub:
  1722. // SubMessage(subfield: "foo"))`
  1723. //
  1724. // Note that fields which are mapped to URL query parameters must have
  1725. // a
  1726. // primitive type or a repeated primitive type or a non-repeated message
  1727. // type.
  1728. // In the case of a repeated type, the parameter can be repeated in the
  1729. // URL
  1730. // as `...?param=A&param=B`. In the case of a message type, each field
  1731. // of the
  1732. // message is mapped to a separate parameter, such
  1733. // as
  1734. // `...?foo.a=A&foo.b=B&foo.c=C`.
  1735. //
  1736. // For HTTP methods that allow a request body, the `body`
  1737. // field
  1738. // specifies the mapping. Consider a REST update method on the
  1739. // message resource collection:
  1740. //
  1741. // service Messaging {
  1742. // rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
  1743. // option (google.api.http) = {
  1744. // patch: "/v1/messages/{message_id}"
  1745. // body: "message"
  1746. // };
  1747. // }
  1748. // }
  1749. // message UpdateMessageRequest {
  1750. // string message_id = 1; // mapped to the URL
  1751. // Message message = 2; // mapped to the body
  1752. // }
  1753. //
  1754. // The following HTTP JSON to RPC mapping is enabled, where
  1755. // the
  1756. // representation of the JSON in the request body is determined
  1757. // by
  1758. // protos JSON encoding:
  1759. //
  1760. // HTTP | gRPC
  1761. // -----|-----
  1762. // `PATCH /v1/messages/123456 { "text": "Hi!" }` |
  1763. // `UpdateMessage(message_id: "123456" message { text: "Hi!" })`
  1764. //
  1765. // The special name `*` can be used in the body mapping to define
  1766. // that
  1767. // every field not bound by the path template should be mapped to
  1768. // the
  1769. // request body. This enables the following alternative definition
  1770. // of
  1771. // the update method:
  1772. //
  1773. // service Messaging {
  1774. // rpc UpdateMessage(Message) returns (Message) {
  1775. // option (google.api.http) = {
  1776. // patch: "/v1/messages/{message_id}"
  1777. // body: "*"
  1778. // };
  1779. // }
  1780. // }
  1781. // message Message {
  1782. // string message_id = 1;
  1783. // string text = 2;
  1784. // }
  1785. //
  1786. //
  1787. // The following HTTP JSON to RPC mapping is enabled:
  1788. //
  1789. // HTTP | gRPC
  1790. // -----|-----
  1791. // `PATCH /v1/messages/123456 { "text": "Hi!" }` |
  1792. // `UpdateMessage(message_id: "123456" text: "Hi!")`
  1793. //
  1794. // Note that when using `*` in the body mapping, it is not possible
  1795. // to
  1796. // have HTTP parameters, as all fields not bound by the path end in
  1797. // the body. This makes this option more rarely used in practice
  1798. // when
  1799. // defining REST APIs. The common usage of `*` is in custom
  1800. // methods
  1801. // which don't use the URL at all for transferring data.
  1802. //
  1803. // It is possible to define multiple HTTP methods for one RPC by
  1804. // using
  1805. // the `additional_bindings` option. Example:
  1806. //
  1807. // service Messaging {
  1808. // rpc GetMessage(GetMessageRequest) returns (Message) {
  1809. // option (google.api.http) = {
  1810. // get: "/v1/messages/{message_id}"
  1811. // additional_bindings {
  1812. // get: "/v1/users/{user_id}/messages/{message_id}"
  1813. // }
  1814. // };
  1815. // }
  1816. // }
  1817. // message GetMessageRequest {
  1818. // string message_id = 1;
  1819. // string user_id = 2;
  1820. // }
  1821. //
  1822. // This enables the following two alternative HTTP JSON to RPC
  1823. // mappings:
  1824. //
  1825. // HTTP | gRPC
  1826. // -----|-----
  1827. // `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
  1828. // `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me"
  1829. // message_id: "123456")`
  1830. //
  1831. // ## Rules for HTTP mapping
  1832. //
  1833. // 1. Leaf request fields (recursive expansion nested messages in the
  1834. // request
  1835. // message) are classified into three categories:
  1836. // - Fields referred by the path template. They are passed via the
  1837. // URL path.
  1838. // - Fields referred by the HttpRule.body. They are passed via the
  1839. // HTTP
  1840. // request body.
  1841. // - All other fields are passed via the URL query parameters, and
  1842. // the
  1843. // parameter name is the field path in the request message. A
  1844. // repeated
  1845. // field can be represented as multiple query parameters under the
  1846. // same
  1847. // name.
  1848. // 2. If HttpRule.body is "*", there is no URL query parameter, all
  1849. // fields
  1850. // are passed via URL path and HTTP request body.
  1851. // 3. If HttpRule.body is omitted, there is no HTTP request body, all
  1852. // fields are passed via URL path and URL query parameters.
  1853. //
  1854. // ### Path template syntax
  1855. //
  1856. // Template = "/" Segments [ Verb ] ;
  1857. // Segments = Segment { "/" Segment } ;
  1858. // Segment = "*" | "**" | LITERAL | Variable ;
  1859. // Variable = "{" FieldPath [ "=" Segments ] "}" ;
  1860. // FieldPath = IDENT { "." IDENT } ;
  1861. // Verb = ":" LITERAL ;
  1862. //
  1863. // The syntax `*` matches a single URL path segment. The syntax `**`
  1864. // matches
  1865. // zero or more URL path segments, which must be the last part of the
  1866. // URL path
  1867. // except the `Verb`.
  1868. //
  1869. // The syntax `Variable` matches part of the URL path as specified by
  1870. // its
  1871. // template. A variable template must not contain other variables. If a
  1872. // variable
  1873. // matches a single path segment, its template may be omitted, e.g.
  1874. // `{var}`
  1875. // is equivalent to `{var=*}`.
  1876. //
  1877. // The syntax `LITERAL` matches literal text in the URL path. If the
  1878. // `LITERAL`
  1879. // contains any reserved character, such characters should be
  1880. // percent-encoded
  1881. // before the matching.
  1882. //
  1883. // If a variable contains exactly one path segment, such as "{var}"
  1884. // or
  1885. // "{var=*}", when such a variable is expanded into a URL path on the
  1886. // client
  1887. // side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded.
  1888. // The
  1889. // server side does the reverse decoding. Such variables show up in
  1890. // the
  1891. // [Discovery
  1892. // Document](https://developers.google.com/discovery/v1/reference/apis)
  1893. // a
  1894. // s `{var}`.
  1895. //
  1896. // If a variable contains multiple path segments, such as
  1897. // "{var=foo/*}"
  1898. // or "{var=**}", when such a variable is expanded into a URL path on
  1899. // the
  1900. // client side, all characters except `[-_.~/0-9a-zA-Z]` are
  1901. // percent-encoded.
  1902. // The server side does the reverse decoding, except "%2F" and "%2f" are
  1903. // left
  1904. // unchanged. Such variables show up in the
  1905. // [Discovery
  1906. // Document](https://developers.google.com/discovery/v1/reference/apis)
  1907. // a
  1908. // s `{+var}`.
  1909. //
  1910. // ## Using gRPC API Service Configuration
  1911. //
  1912. // gRPC API Service Configuration (service config) is a configuration
  1913. // language
  1914. // for configuring a gRPC service to become a user-facing product.
  1915. // The
  1916. // service config is simply the YAML representation of the
  1917. // `google.api.Service`
  1918. // proto message.
  1919. //
  1920. // As an alternative to annotating your proto file, you can configure
  1921. // gRPC
  1922. // transcoding in your service config YAML files. You do this by
  1923. // specifying a
  1924. // `HttpRule` that maps the gRPC method to a REST endpoint, achieving
  1925. // the same
  1926. // effect as the proto annotation. This can be particularly useful if
  1927. // you
  1928. // have a proto that is reused in multiple services. Note that any
  1929. // transcoding
  1930. // specified in the service config will override any matching
  1931. // transcoding
  1932. // configuration in the proto.
  1933. //
  1934. // Example:
  1935. //
  1936. // http:
  1937. // rules:
  1938. // # Selects a gRPC method and applies HttpRule to it.
  1939. // - selector: example.v1.Messaging.GetMessage
  1940. // get: /v1/messages/{message_id}/{sub.subfield}
  1941. //
  1942. // ## Special notes
  1943. //
  1944. // When gRPC Transcoding is used to map a gRPC to JSON REST endpoints,
  1945. // the
  1946. // proto to JSON conversion must follow the
  1947. // [proto3
  1948. // specification](https://developers.google.com/protocol-buffers/
  1949. // docs/proto3#json).
  1950. //
  1951. // While the single segment variable follows the semantics of
  1952. // [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple
  1953. // String
  1954. // Expansion, the multi segment variable **does not** follow RFC 6570
  1955. // Section
  1956. // 3.2.3 Reserved Expansion. The reason is that the Reserved
  1957. // Expansion
  1958. // does not expand special characters like `?` and `#`, which would
  1959. // lead
  1960. // to invalid URLs. As the result, gRPC Transcoding uses a custom
  1961. // encoding
  1962. // for multi segment variables.
  1963. //
  1964. // The path variables **must not** refer to any repeated or mapped
  1965. // field,
  1966. // because client libraries are not capable of handling such variable
  1967. // expansion.
  1968. //
  1969. // The path variables **must not** capture the leading "/" character.
  1970. // The reason
  1971. // is that the most common use case "{var}" does not capture the leading
  1972. // "/"
  1973. // character. For consistency, all path variables must share the same
  1974. // behavior.
  1975. //
  1976. // Repeated message fields must not be mapped to URL query parameters,
  1977. // because
  1978. // no client library can support such complicated mapping.
  1979. //
  1980. // If an API needs to use a JSON array for request or response body, it
  1981. // can map
  1982. // the request or response body to a repeated field. However, some
  1983. // gRPC
  1984. // Transcoding implementations may not support this feature.
  1985. type HttpRule struct {
  1986. // AdditionalBindings: Additional HTTP bindings for the selector. Nested
  1987. // bindings must
  1988. // not contain an `additional_bindings` field themselves (that is,
  1989. // the nesting may only be one level deep).
  1990. AdditionalBindings []*HttpRule `json:"additionalBindings,omitempty"`
  1991. // Body: The name of the request field whose value is mapped to the HTTP
  1992. // request
  1993. // body, or `*` for mapping all request fields not captured by the
  1994. // path
  1995. // pattern to the HTTP body, or omitted for not having any HTTP request
  1996. // body.
  1997. //
  1998. // NOTE: the referred field must be present at the top-level of the
  1999. // request
  2000. // message type.
  2001. Body string `json:"body,omitempty"`
  2002. // Custom: The custom pattern is used for specifying an HTTP method that
  2003. // is not
  2004. // included in the `pattern` field, such as HEAD, or "*" to leave
  2005. // the
  2006. // HTTP method unspecified for this rule. The wild-card rule is
  2007. // useful
  2008. // for services that provide content to Web (HTML) clients.
  2009. Custom *CustomHttpPattern `json:"custom,omitempty"`
  2010. // Delete: Maps to HTTP DELETE. Used for deleting a resource.
  2011. Delete string `json:"delete,omitempty"`
  2012. // Get: Maps to HTTP GET. Used for listing and getting information
  2013. // about
  2014. // resources.
  2015. Get string `json:"get,omitempty"`
  2016. // Patch: Maps to HTTP PATCH. Used for updating a resource.
  2017. Patch string `json:"patch,omitempty"`
  2018. // Post: Maps to HTTP POST. Used for creating a resource or performing
  2019. // an action.
  2020. Post string `json:"post,omitempty"`
  2021. // Put: Maps to HTTP PUT. Used for replacing a resource.
  2022. Put string `json:"put,omitempty"`
  2023. // ResponseBody: Optional. The name of the response field whose value is
  2024. // mapped to the HTTP
  2025. // response body. When omitted, the entire response message will be
  2026. // used
  2027. // as the HTTP response body.
  2028. //
  2029. // NOTE: The referred field must be present at the top-level of the
  2030. // response
  2031. // message type.
  2032. ResponseBody string `json:"responseBody,omitempty"`
  2033. // Selector: Selects a method to which this rule applies.
  2034. //
  2035. // Refer to selector for syntax details.
  2036. Selector string `json:"selector,omitempty"`
  2037. // ForceSendFields is a list of field names (e.g. "AdditionalBindings")
  2038. // to unconditionally include in API requests. By default, fields with
  2039. // empty values are omitted from API requests. However, any non-pointer,
  2040. // non-interface field appearing in ForceSendFields will be sent to the
  2041. // server regardless of whether the field is empty or not. This may be
  2042. // used to include empty fields in Patch requests.
  2043. ForceSendFields []string `json:"-"`
  2044. // NullFields is a list of field names (e.g. "AdditionalBindings") to
  2045. // include in API requests with the JSON null value. By default, fields
  2046. // with empty values are omitted from API requests. However, any field
  2047. // with an empty value appearing in NullFields will be sent to the
  2048. // server as null. It is an error if a field in this list has a
  2049. // non-empty value. This may be used to include null fields in Patch
  2050. // requests.
  2051. NullFields []string `json:"-"`
  2052. }
  2053. func (s *HttpRule) MarshalJSON() ([]byte, error) {
  2054. type NoMethod HttpRule
  2055. raw := NoMethod(*s)
  2056. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2057. }
  2058. // LabelDescriptor: A description of a label.
  2059. type LabelDescriptor struct {
  2060. // Description: A human-readable description for the label.
  2061. Description string `json:"description,omitempty"`
  2062. // Key: The label key.
  2063. Key string `json:"key,omitempty"`
  2064. // ValueType: The type of data that can be assigned to the label.
  2065. //
  2066. // Possible values:
  2067. // "STRING" - A variable-length string. This is the default.
  2068. // "BOOL" - Boolean; true or false.
  2069. // "INT64" - A 64-bit signed integer.
  2070. ValueType string `json:"valueType,omitempty"`
  2071. // ForceSendFields is a list of field names (e.g. "Description") to
  2072. // unconditionally include in API requests. By default, fields with
  2073. // empty values are omitted from API requests. However, any non-pointer,
  2074. // non-interface field appearing in ForceSendFields will be sent to the
  2075. // server regardless of whether the field is empty or not. This may be
  2076. // used to include empty fields in Patch requests.
  2077. ForceSendFields []string `json:"-"`
  2078. // NullFields is a list of field names (e.g. "Description") to include
  2079. // in API requests with the JSON null value. By default, fields with
  2080. // empty values are omitted from API requests. However, any field with
  2081. // an empty value appearing in NullFields will be sent to the server as
  2082. // null. It is an error if a field in this list has a non-empty value.
  2083. // This may be used to include null fields in Patch requests.
  2084. NullFields []string `json:"-"`
  2085. }
  2086. func (s *LabelDescriptor) MarshalJSON() ([]byte, error) {
  2087. type NoMethod LabelDescriptor
  2088. raw := NoMethod(*s)
  2089. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2090. }
  2091. // ListConnectionsResponse: ListConnectionsResponse is the response to
  2092. // list peering states for the
  2093. // given service and consumer project.
  2094. type ListConnectionsResponse struct {
  2095. // Connections: The list of Connections.
  2096. Connections []*Connection `json:"connections,omitempty"`
  2097. // ServerResponse contains the HTTP response code and headers from the
  2098. // server.
  2099. googleapi.ServerResponse `json:"-"`
  2100. // ForceSendFields is a list of field names (e.g. "Connections") to
  2101. // unconditionally include in API requests. By default, fields with
  2102. // empty values are omitted from API requests. However, any non-pointer,
  2103. // non-interface field appearing in ForceSendFields will be sent to the
  2104. // server regardless of whether the field is empty or not. This may be
  2105. // used to include empty fields in Patch requests.
  2106. ForceSendFields []string `json:"-"`
  2107. // NullFields is a list of field names (e.g. "Connections") to include
  2108. // in API requests with the JSON null value. By default, fields with
  2109. // empty values are omitted from API requests. However, any field with
  2110. // an empty value appearing in NullFields will be sent to the server as
  2111. // null. It is an error if a field in this list has a non-empty value.
  2112. // This may be used to include null fields in Patch requests.
  2113. NullFields []string `json:"-"`
  2114. }
  2115. func (s *ListConnectionsResponse) MarshalJSON() ([]byte, error) {
  2116. type NoMethod ListConnectionsResponse
  2117. raw := NoMethod(*s)
  2118. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2119. }
  2120. // ListOperationsResponse: The response message for
  2121. // Operations.ListOperations.
  2122. type ListOperationsResponse struct {
  2123. // NextPageToken: The standard List next-page token.
  2124. NextPageToken string `json:"nextPageToken,omitempty"`
  2125. // Operations: A list of operations that matches the specified filter in
  2126. // the request.
  2127. Operations []*Operation `json:"operations,omitempty"`
  2128. // ServerResponse contains the HTTP response code and headers from the
  2129. // server.
  2130. googleapi.ServerResponse `json:"-"`
  2131. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  2132. // unconditionally include in API requests. By default, fields with
  2133. // empty values are omitted from API requests. However, any non-pointer,
  2134. // non-interface field appearing in ForceSendFields will be sent to the
  2135. // server regardless of whether the field is empty or not. This may be
  2136. // used to include empty fields in Patch requests.
  2137. ForceSendFields []string `json:"-"`
  2138. // NullFields is a list of field names (e.g. "NextPageToken") to include
  2139. // in API requests with the JSON null value. By default, fields with
  2140. // empty values are omitted from API requests. However, any field with
  2141. // an empty value appearing in NullFields will be sent to the server as
  2142. // null. It is an error if a field in this list has a non-empty value.
  2143. // This may be used to include null fields in Patch requests.
  2144. NullFields []string `json:"-"`
  2145. }
  2146. func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
  2147. type NoMethod ListOperationsResponse
  2148. raw := NoMethod(*s)
  2149. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2150. }
  2151. // LogDescriptor: A description of a log type. Example in YAML format:
  2152. //
  2153. // - name: library.googleapis.com/activity_history
  2154. // description: The history of borrowing and returning library
  2155. // items.
  2156. // display_name: Activity
  2157. // labels:
  2158. // - key: /customer_id
  2159. // description: Identifier of a library customer
  2160. type LogDescriptor struct {
  2161. // Description: A human-readable description of this log. This
  2162. // information appears in
  2163. // the documentation and can contain details.
  2164. Description string `json:"description,omitempty"`
  2165. // DisplayName: The human-readable name for this log. This information
  2166. // appears on
  2167. // the user interface and should be concise.
  2168. DisplayName string `json:"displayName,omitempty"`
  2169. // Labels: The set of labels that are available to describe a specific
  2170. // log entry.
  2171. // Runtime requests that contain labels not specified here
  2172. // are
  2173. // considered invalid.
  2174. Labels []*LabelDescriptor `json:"labels,omitempty"`
  2175. // Name: The name of the log. It must be less than 512 characters long
  2176. // and can
  2177. // include the following characters: upper- and lower-case
  2178. // alphanumeric
  2179. // characters [A-Za-z0-9], and punctuation characters including
  2180. // slash, underscore, hyphen, period [/_-.].
  2181. Name string `json:"name,omitempty"`
  2182. // ForceSendFields is a list of field names (e.g. "Description") to
  2183. // unconditionally include in API requests. By default, fields with
  2184. // empty values are omitted from API requests. However, any non-pointer,
  2185. // non-interface field appearing in ForceSendFields will be sent to the
  2186. // server regardless of whether the field is empty or not. This may be
  2187. // used to include empty fields in Patch requests.
  2188. ForceSendFields []string `json:"-"`
  2189. // NullFields is a list of field names (e.g. "Description") to include
  2190. // in API requests with the JSON null value. By default, fields with
  2191. // empty values are omitted from API requests. However, any field with
  2192. // an empty value appearing in NullFields will be sent to the server as
  2193. // null. It is an error if a field in this list has a non-empty value.
  2194. // This may be used to include null fields in Patch requests.
  2195. NullFields []string `json:"-"`
  2196. }
  2197. func (s *LogDescriptor) MarshalJSON() ([]byte, error) {
  2198. type NoMethod LogDescriptor
  2199. raw := NoMethod(*s)
  2200. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2201. }
  2202. // Logging: Logging configuration of the service.
  2203. //
  2204. // The following example shows how to configure logs to be sent to
  2205. // the
  2206. // producer and consumer projects. In the example, the
  2207. // `activity_history`
  2208. // log is sent to both the producer and consumer projects, whereas
  2209. // the
  2210. // `purchase_history` log is only sent to the producer project.
  2211. //
  2212. // monitored_resources:
  2213. // - type: library.googleapis.com/branch
  2214. // labels:
  2215. // - key: /city
  2216. // description: The city where the library branch is located
  2217. // in.
  2218. // - key: /name
  2219. // description: The name of the branch.
  2220. // logs:
  2221. // - name: activity_history
  2222. // labels:
  2223. // - key: /customer_id
  2224. // - name: purchase_history
  2225. // logging:
  2226. // producer_destinations:
  2227. // - monitored_resource: library.googleapis.com/branch
  2228. // logs:
  2229. // - activity_history
  2230. // - purchase_history
  2231. // consumer_destinations:
  2232. // - monitored_resource: library.googleapis.com/branch
  2233. // logs:
  2234. // - activity_history
  2235. type Logging struct {
  2236. // ConsumerDestinations: Logging configurations for sending logs to the
  2237. // consumer project.
  2238. // There can be multiple consumer destinations, each one must have
  2239. // a
  2240. // different monitored resource type. A log can be used in at most
  2241. // one consumer destination.
  2242. ConsumerDestinations []*LoggingDestination `json:"consumerDestinations,omitempty"`
  2243. // ProducerDestinations: Logging configurations for sending logs to the
  2244. // producer project.
  2245. // There can be multiple producer destinations, each one must have
  2246. // a
  2247. // different monitored resource type. A log can be used in at most
  2248. // one producer destination.
  2249. ProducerDestinations []*LoggingDestination `json:"producerDestinations,omitempty"`
  2250. // ForceSendFields is a list of field names (e.g.
  2251. // "ConsumerDestinations") to unconditionally include in API requests.
  2252. // By default, fields with empty values are omitted from API requests.
  2253. // However, any non-pointer, non-interface field appearing in
  2254. // ForceSendFields will be sent to the server regardless of whether the
  2255. // field is empty or not. This may be used to include empty fields in
  2256. // Patch requests.
  2257. ForceSendFields []string `json:"-"`
  2258. // NullFields is a list of field names (e.g. "ConsumerDestinations") to
  2259. // include in API requests with the JSON null value. By default, fields
  2260. // with empty values are omitted from API requests. However, any field
  2261. // with an empty value appearing in NullFields will be sent to the
  2262. // server as null. It is an error if a field in this list has a
  2263. // non-empty value. This may be used to include null fields in Patch
  2264. // requests.
  2265. NullFields []string `json:"-"`
  2266. }
  2267. func (s *Logging) MarshalJSON() ([]byte, error) {
  2268. type NoMethod Logging
  2269. raw := NoMethod(*s)
  2270. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2271. }
  2272. // LoggingDestination: Configuration of a specific logging destination
  2273. // (the producer project
  2274. // or the consumer project).
  2275. type LoggingDestination struct {
  2276. // Logs: Names of the logs to be sent to this destination. Each name
  2277. // must
  2278. // be defined in the Service.logs section. If the log name is
  2279. // not a domain scoped name, it will be automatically prefixed with
  2280. // the service name followed by "/".
  2281. Logs []string `json:"logs,omitempty"`
  2282. // MonitoredResource: The monitored resource type. The type must be
  2283. // defined in the
  2284. // Service.monitored_resources section.
  2285. MonitoredResource string `json:"monitoredResource,omitempty"`
  2286. // ForceSendFields is a list of field names (e.g. "Logs") to
  2287. // unconditionally include in API requests. By default, fields with
  2288. // empty values are omitted from API requests. However, any non-pointer,
  2289. // non-interface field appearing in ForceSendFields will be sent to the
  2290. // server regardless of whether the field is empty or not. This may be
  2291. // used to include empty fields in Patch requests.
  2292. ForceSendFields []string `json:"-"`
  2293. // NullFields is a list of field names (e.g. "Logs") to include in API
  2294. // requests with the JSON null value. By default, fields with empty
  2295. // values are omitted from API requests. However, any field with an
  2296. // empty value appearing in NullFields will be sent to the server as
  2297. // null. It is an error if a field in this list has a non-empty value.
  2298. // This may be used to include null fields in Patch requests.
  2299. NullFields []string `json:"-"`
  2300. }
  2301. func (s *LoggingDestination) MarshalJSON() ([]byte, error) {
  2302. type NoMethod LoggingDestination
  2303. raw := NoMethod(*s)
  2304. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2305. }
  2306. // Method: Method represents a method of an API interface.
  2307. type Method struct {
  2308. // Name: The simple name of this method.
  2309. Name string `json:"name,omitempty"`
  2310. // Options: Any metadata attached to the method.
  2311. Options []*Option `json:"options,omitempty"`
  2312. // RequestStreaming: If true, the request is streamed.
  2313. RequestStreaming bool `json:"requestStreaming,omitempty"`
  2314. // RequestTypeUrl: A URL of the input message type.
  2315. RequestTypeUrl string `json:"requestTypeUrl,omitempty"`
  2316. // ResponseStreaming: If true, the response is streamed.
  2317. ResponseStreaming bool `json:"responseStreaming,omitempty"`
  2318. // ResponseTypeUrl: The URL of the output message type.
  2319. ResponseTypeUrl string `json:"responseTypeUrl,omitempty"`
  2320. // Syntax: The source syntax of this method.
  2321. //
  2322. // Possible values:
  2323. // "SYNTAX_PROTO2" - Syntax `proto2`.
  2324. // "SYNTAX_PROTO3" - Syntax `proto3`.
  2325. Syntax string `json:"syntax,omitempty"`
  2326. // ForceSendFields is a list of field names (e.g. "Name") to
  2327. // unconditionally include in API requests. By default, fields with
  2328. // empty values are omitted from API requests. However, any non-pointer,
  2329. // non-interface field appearing in ForceSendFields will be sent to the
  2330. // server regardless of whether the field is empty or not. This may be
  2331. // used to include empty fields in Patch requests.
  2332. ForceSendFields []string `json:"-"`
  2333. // NullFields is a list of field names (e.g. "Name") to include in API
  2334. // requests with the JSON null value. By default, fields with empty
  2335. // values are omitted from API requests. However, any field with an
  2336. // empty value appearing in NullFields will be sent to the server as
  2337. // null. It is an error if a field in this list has a non-empty value.
  2338. // This may be used to include null fields in Patch requests.
  2339. NullFields []string `json:"-"`
  2340. }
  2341. func (s *Method) MarshalJSON() ([]byte, error) {
  2342. type NoMethod Method
  2343. raw := NoMethod(*s)
  2344. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2345. }
  2346. // MetricDescriptor: Defines a metric type and its schema. Once a metric
  2347. // descriptor is created,
  2348. // deleting or altering it stops data collection and makes the metric
  2349. // type's
  2350. // existing data unusable.
  2351. type MetricDescriptor struct {
  2352. // Description: A detailed description of the metric, which can be used
  2353. // in documentation.
  2354. Description string `json:"description,omitempty"`
  2355. // DisplayName: A concise name for the metric, which can be displayed in
  2356. // user interfaces.
  2357. // Use sentence case without an ending period, for example "Request
  2358. // count".
  2359. // This field is optional but it is recommended to be set for any
  2360. // metrics
  2361. // associated with user-visible concepts, such as Quota.
  2362. DisplayName string `json:"displayName,omitempty"`
  2363. // Labels: The set of labels that can be used to describe a
  2364. // specific
  2365. // instance of this metric type. For example,
  2366. // the
  2367. // `appengine.googleapis.com/http/server/response_latencies` metric
  2368. // type has a label for the HTTP response code, `response_code`, so
  2369. // you can look at latencies for successful responses or just
  2370. // for responses that failed.
  2371. Labels []*LabelDescriptor `json:"labels,omitempty"`
  2372. // Metadata: Optional. Metadata which can be used to guide usage of the
  2373. // metric.
  2374. Metadata *MetricDescriptorMetadata `json:"metadata,omitempty"`
  2375. // MetricKind: Whether the metric records instantaneous values, changes
  2376. // to a value, etc.
  2377. // Some combinations of `metric_kind` and `value_type` might not be
  2378. // supported.
  2379. //
  2380. // Possible values:
  2381. // "METRIC_KIND_UNSPECIFIED" - Do not use this default value.
  2382. // "GAUGE" - An instantaneous measurement of a value.
  2383. // "DELTA" - The change in a value during a time interval.
  2384. // "CUMULATIVE" - A value accumulated over a time interval.
  2385. // Cumulative
  2386. // measurements in a time series should have the same start time
  2387. // and increasing end times, until an event resets the cumulative
  2388. // value to zero and sets a new start time for the following
  2389. // points.
  2390. MetricKind string `json:"metricKind,omitempty"`
  2391. // Name: The resource name of the metric descriptor.
  2392. Name string `json:"name,omitempty"`
  2393. // Type: The metric type, including its DNS name prefix. The type is
  2394. // not
  2395. // URL-encoded. All user-defined metric types have the DNS
  2396. // name
  2397. // `custom.googleapis.com` or `external.googleapis.com`. Metric types
  2398. // should
  2399. // use a natural hierarchical grouping. For example:
  2400. //
  2401. // "custom.googleapis.com/invoice/paid/amount"
  2402. // "external.googleapis.com/prometheus/up"
  2403. // "appengine.googleapis.com/http/server/response_latencies"
  2404. Type string `json:"type,omitempty"`
  2405. // Unit: The unit in which the metric value is reported. It is only
  2406. // applicable
  2407. // if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`.
  2408. // The
  2409. // supported units are a subset of [The Unified Code for Units
  2410. // of
  2411. // Measure](http://unitsofmeasure.org/ucum.html) standard:
  2412. //
  2413. // **Basic units (UNIT)**
  2414. //
  2415. // * `bit` bit
  2416. // * `By` byte
  2417. // * `s` second
  2418. // * `min` minute
  2419. // * `h` hour
  2420. // * `d` day
  2421. //
  2422. // **Prefixes (PREFIX)**
  2423. //
  2424. // * `k` kilo (10**3)
  2425. // * `M` mega (10**6)
  2426. // * `G` giga (10**9)
  2427. // * `T` tera (10**12)
  2428. // * `P` peta (10**15)
  2429. // * `E` exa (10**18)
  2430. // * `Z` zetta (10**21)
  2431. // * `Y` yotta (10**24)
  2432. // * `m` milli (10**-3)
  2433. // * `u` micro (10**-6)
  2434. // * `n` nano (10**-9)
  2435. // * `p` pico (10**-12)
  2436. // * `f` femto (10**-15)
  2437. // * `a` atto (10**-18)
  2438. // * `z` zepto (10**-21)
  2439. // * `y` yocto (10**-24)
  2440. // * `Ki` kibi (2**10)
  2441. // * `Mi` mebi (2**20)
  2442. // * `Gi` gibi (2**30)
  2443. // * `Ti` tebi (2**40)
  2444. //
  2445. // **Grammar**
  2446. //
  2447. // The grammar also includes these connectors:
  2448. //
  2449. // * `/` division (as an infix operator, e.g. `1/s`).
  2450. // * `.` multiplication (as an infix operator, e.g. `GBy.d`)
  2451. //
  2452. // The grammar for a unit is as follows:
  2453. //
  2454. // Expression = Component { "." Component } { "/" Component } ;
  2455. //
  2456. // Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
  2457. // | Annotation
  2458. // | "1"
  2459. // ;
  2460. //
  2461. // Annotation = "{" NAME "}" ;
  2462. //
  2463. // Notes:
  2464. //
  2465. // * `Annotation` is just a comment if it follows a `UNIT` and is
  2466. // equivalent to `1` if it is used alone. For examples,
  2467. // `{requests}/s == 1/s`, `By{transmitted}/s == By/s`.
  2468. // * `NAME` is a sequence of non-blank printable ASCII characters not
  2469. // containing '{' or '}'.
  2470. // * `1` represents dimensionless value 1, such as in `1/s`.
  2471. // * `%` represents dimensionless value 1/100, and annotates values
  2472. // giving
  2473. // a percentage.
  2474. Unit string `json:"unit,omitempty"`
  2475. // ValueType: Whether the measurement is an integer, a floating-point
  2476. // number, etc.
  2477. // Some combinations of `metric_kind` and `value_type` might not be
  2478. // supported.
  2479. //
  2480. // Possible values:
  2481. // "VALUE_TYPE_UNSPECIFIED" - Do not use this default value.
  2482. // "BOOL" - The value is a boolean.
  2483. // This value type can be used only if the metric kind is `GAUGE`.
  2484. // "INT64" - The value is a signed 64-bit integer.
  2485. // "DOUBLE" - The value is a double precision floating point number.
  2486. // "STRING" - The value is a text string.
  2487. // This value type can be used only if the metric kind is `GAUGE`.
  2488. // "DISTRIBUTION" - The value is a `Distribution`.
  2489. // "MONEY" - The value is money.
  2490. ValueType string `json:"valueType,omitempty"`
  2491. // ForceSendFields is a list of field names (e.g. "Description") to
  2492. // unconditionally include in API requests. By default, fields with
  2493. // empty values are omitted from API requests. However, any non-pointer,
  2494. // non-interface field appearing in ForceSendFields will be sent to the
  2495. // server regardless of whether the field is empty or not. This may be
  2496. // used to include empty fields in Patch requests.
  2497. ForceSendFields []string `json:"-"`
  2498. // NullFields is a list of field names (e.g. "Description") to include
  2499. // in API requests with the JSON null value. By default, fields with
  2500. // empty values are omitted from API requests. However, any field with
  2501. // an empty value appearing in NullFields will be sent to the server as
  2502. // null. It is an error if a field in this list has a non-empty value.
  2503. // This may be used to include null fields in Patch requests.
  2504. NullFields []string `json:"-"`
  2505. }
  2506. func (s *MetricDescriptor) MarshalJSON() ([]byte, error) {
  2507. type NoMethod MetricDescriptor
  2508. raw := NoMethod(*s)
  2509. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2510. }
  2511. // MetricDescriptorMetadata: Additional annotations that can be used to
  2512. // guide the usage of a metric.
  2513. type MetricDescriptorMetadata struct {
  2514. // IngestDelay: The delay of data points caused by ingestion. Data
  2515. // points older than this
  2516. // age are guaranteed to be ingested and available to be read,
  2517. // excluding
  2518. // data loss due to errors.
  2519. IngestDelay string `json:"ingestDelay,omitempty"`
  2520. // LaunchStage: The launch stage of the metric definition.
  2521. //
  2522. // Possible values:
  2523. // "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value.
  2524. // "EARLY_ACCESS" - Early Access features are limited to a closed
  2525. // group of testers. To use
  2526. // these features, you must sign up in advance and sign a Trusted
  2527. // Tester
  2528. // agreement (which includes confidentiality provisions). These features
  2529. // may
  2530. // be unstable, changed in backward-incompatible ways, and are
  2531. // not
  2532. // guaranteed to be released.
  2533. // "ALPHA" - Alpha is a limited availability test for releases before
  2534. // they are cleared
  2535. // for widespread use. By Alpha, all significant design issues are
  2536. // resolved
  2537. // and we are in the process of verifying functionality. Alpha
  2538. // customers
  2539. // need to apply for access, agree to applicable terms, and have
  2540. // their
  2541. // projects whitelisted. Alpha releases don’t have to be feature
  2542. // complete,
  2543. // no SLAs are provided, and there are no technical support obligations,
  2544. // but
  2545. // they will be far enough along that customers can actually use them
  2546. // in
  2547. // test environments or for limited-use tests -- just like they would
  2548. // in
  2549. // normal production cases.
  2550. // "BETA" - Beta is the point at which we are ready to open a release
  2551. // for any
  2552. // customer to use. There are no SLA or technical support obligations in
  2553. // a
  2554. // Beta release. Products will be complete from a feature perspective,
  2555. // but
  2556. // may have some open outstanding issues. Beta releases are suitable
  2557. // for
  2558. // limited production use cases.
  2559. // "GA" - GA features are open to all developers and are considered
  2560. // stable and
  2561. // fully qualified for production use.
  2562. // "DEPRECATED" - Deprecated features are scheduled to be shut down
  2563. // and removed. For more
  2564. // information, see the “Deprecation Policy” section of our [Terms
  2565. // of
  2566. // Service](https://cloud.google.com/terms/)
  2567. // and the [Google Cloud Platform Subject to the
  2568. // Deprecation
  2569. // Policy](https://cloud.google.com/terms/deprecation) documentation.
  2570. LaunchStage string `json:"launchStage,omitempty"`
  2571. // SamplePeriod: The sampling period of metric data points. For metrics
  2572. // which are written
  2573. // periodically, consecutive data points are stored at this time
  2574. // interval,
  2575. // excluding data loss due to errors. Metrics with a higher granularity
  2576. // have
  2577. // a smaller sampling period.
  2578. SamplePeriod string `json:"samplePeriod,omitempty"`
  2579. // ForceSendFields is a list of field names (e.g. "IngestDelay") to
  2580. // unconditionally include in API requests. By default, fields with
  2581. // empty values are omitted from API requests. However, any non-pointer,
  2582. // non-interface field appearing in ForceSendFields will be sent to the
  2583. // server regardless of whether the field is empty or not. This may be
  2584. // used to include empty fields in Patch requests.
  2585. ForceSendFields []string `json:"-"`
  2586. // NullFields is a list of field names (e.g. "IngestDelay") to include
  2587. // in API requests with the JSON null value. By default, fields with
  2588. // empty values are omitted from API requests. However, any field with
  2589. // an empty value appearing in NullFields will be sent to the server as
  2590. // null. It is an error if a field in this list has a non-empty value.
  2591. // This may be used to include null fields in Patch requests.
  2592. NullFields []string `json:"-"`
  2593. }
  2594. func (s *MetricDescriptorMetadata) MarshalJSON() ([]byte, error) {
  2595. type NoMethod MetricDescriptorMetadata
  2596. raw := NoMethod(*s)
  2597. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2598. }
  2599. // MetricRule: Bind API methods to metrics. Binding a method to a metric
  2600. // causes that
  2601. // metric's configured quota behaviors to apply to the method call.
  2602. type MetricRule struct {
  2603. // MetricCosts: Metrics to update when the selected methods are called,
  2604. // and the associated
  2605. // cost applied to each metric.
  2606. //
  2607. // The key of the map is the metric name, and the values are the
  2608. // amount
  2609. // increased for the metric against which the quota limits are
  2610. // defined.
  2611. // The value must not be negative.
  2612. MetricCosts map[string]string `json:"metricCosts,omitempty"`
  2613. // Selector: Selects the methods to which this rule applies.
  2614. //
  2615. // Refer to selector for syntax details.
  2616. Selector string `json:"selector,omitempty"`
  2617. // ForceSendFields is a list of field names (e.g. "MetricCosts") to
  2618. // unconditionally include in API requests. By default, fields with
  2619. // empty values are omitted from API requests. However, any non-pointer,
  2620. // non-interface field appearing in ForceSendFields will be sent to the
  2621. // server regardless of whether the field is empty or not. This may be
  2622. // used to include empty fields in Patch requests.
  2623. ForceSendFields []string `json:"-"`
  2624. // NullFields is a list of field names (e.g. "MetricCosts") to include
  2625. // in API requests with the JSON null value. By default, fields with
  2626. // empty values are omitted from API requests. However, any field with
  2627. // an empty value appearing in NullFields will be sent to the server as
  2628. // null. It is an error if a field in this list has a non-empty value.
  2629. // This may be used to include null fields in Patch requests.
  2630. NullFields []string `json:"-"`
  2631. }
  2632. func (s *MetricRule) MarshalJSON() ([]byte, error) {
  2633. type NoMethod MetricRule
  2634. raw := NoMethod(*s)
  2635. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2636. }
  2637. // Mixin: Declares an API Interface to be included in this interface.
  2638. // The including
  2639. // interface must redeclare all the methods from the included interface,
  2640. // but
  2641. // documentation and options are inherited as follows:
  2642. //
  2643. // - If after comment and whitespace stripping, the documentation
  2644. // string of the redeclared method is empty, it will be inherited
  2645. // from the original method.
  2646. //
  2647. // - Each annotation belonging to the service config (http,
  2648. // visibility) which is not set in the redeclared method will be
  2649. // inherited.
  2650. //
  2651. // - If an http annotation is inherited, the path pattern will be
  2652. // modified as follows. Any version prefix will be replaced by the
  2653. // version of the including interface plus the root path if
  2654. // specified.
  2655. //
  2656. // Example of a simple mixin:
  2657. //
  2658. // package google.acl.v1;
  2659. // service AccessControl {
  2660. // // Get the underlying ACL object.
  2661. // rpc GetAcl(GetAclRequest) returns (Acl) {
  2662. // option (google.api.http).get = "/v1/{resource=**}:getAcl";
  2663. // }
  2664. // }
  2665. //
  2666. // package google.storage.v2;
  2667. // service Storage {
  2668. // // rpc GetAcl(GetAclRequest) returns (Acl);
  2669. //
  2670. // // Get a data record.
  2671. // rpc GetData(GetDataRequest) returns (Data) {
  2672. // option (google.api.http).get = "/v2/{resource=**}";
  2673. // }
  2674. // }
  2675. //
  2676. // Example of a mixin configuration:
  2677. //
  2678. // apis:
  2679. // - name: google.storage.v2.Storage
  2680. // mixins:
  2681. // - name: google.acl.v1.AccessControl
  2682. //
  2683. // The mixin construct implies that all methods in `AccessControl`
  2684. // are
  2685. // also declared with same name and request/response types in
  2686. // `Storage`. A documentation generator or annotation processor will
  2687. // see the effective `Storage.GetAcl` method after
  2688. // inherting
  2689. // documentation and annotations as follows:
  2690. //
  2691. // service Storage {
  2692. // // Get the underlying ACL object.
  2693. // rpc GetAcl(GetAclRequest) returns (Acl) {
  2694. // option (google.api.http).get = "/v2/{resource=**}:getAcl";
  2695. // }
  2696. // ...
  2697. // }
  2698. //
  2699. // Note how the version in the path pattern changed from `v1` to
  2700. // `v2`.
  2701. //
  2702. // If the `root` field in the mixin is specified, it should be
  2703. // a
  2704. // relative path under which inherited HTTP paths are placed. Example:
  2705. //
  2706. // apis:
  2707. // - name: google.storage.v2.Storage
  2708. // mixins:
  2709. // - name: google.acl.v1.AccessControl
  2710. // root: acls
  2711. //
  2712. // This implies the following inherited HTTP annotation:
  2713. //
  2714. // service Storage {
  2715. // // Get the underlying ACL object.
  2716. // rpc GetAcl(GetAclRequest) returns (Acl) {
  2717. // option (google.api.http).get =
  2718. // "/v2/acls/{resource=**}:getAcl";
  2719. // }
  2720. // ...
  2721. // }
  2722. type Mixin struct {
  2723. // Name: The fully qualified name of the interface which is included.
  2724. Name string `json:"name,omitempty"`
  2725. // Root: If non-empty specifies a path under which inherited HTTP
  2726. // paths
  2727. // are rooted.
  2728. Root string `json:"root,omitempty"`
  2729. // ForceSendFields is a list of field names (e.g. "Name") to
  2730. // unconditionally include in API requests. By default, fields with
  2731. // empty values are omitted from API requests. However, any non-pointer,
  2732. // non-interface field appearing in ForceSendFields will be sent to the
  2733. // server regardless of whether the field is empty or not. This may be
  2734. // used to include empty fields in Patch requests.
  2735. ForceSendFields []string `json:"-"`
  2736. // NullFields is a list of field names (e.g. "Name") to include in API
  2737. // requests with the JSON null value. By default, fields with empty
  2738. // values are omitted from API requests. However, any field with an
  2739. // empty value appearing in NullFields will be sent to the server as
  2740. // null. It is an error if a field in this list has a non-empty value.
  2741. // This may be used to include null fields in Patch requests.
  2742. NullFields []string `json:"-"`
  2743. }
  2744. func (s *Mixin) MarshalJSON() ([]byte, error) {
  2745. type NoMethod Mixin
  2746. raw := NoMethod(*s)
  2747. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2748. }
  2749. // MonitoredResourceDescriptor: An object that describes the schema of a
  2750. // MonitoredResource object using a
  2751. // type name and a set of labels. For example, the monitored
  2752. // resource
  2753. // descriptor for Google Compute Engine VM instances has a type
  2754. // of
  2755. // "gce_instance" and specifies the use of the labels "instance_id"
  2756. // and
  2757. // "zone" to identify particular VM instances.
  2758. //
  2759. // Different APIs can support different monitored resource types. APIs
  2760. // generally
  2761. // provide a `list` method that returns the monitored resource
  2762. // descriptors used
  2763. // by the API.
  2764. type MonitoredResourceDescriptor struct {
  2765. // Description: Optional. A detailed description of the monitored
  2766. // resource type that might
  2767. // be used in documentation.
  2768. Description string `json:"description,omitempty"`
  2769. // DisplayName: Optional. A concise name for the monitored resource type
  2770. // that might be
  2771. // displayed in user interfaces. It should be a Title Cased Noun
  2772. // Phrase,
  2773. // without any article or other determiners. For example,
  2774. // "Google Cloud SQL Database".
  2775. DisplayName string `json:"displayName,omitempty"`
  2776. // Labels: Required. A set of labels used to describe instances of this
  2777. // monitored
  2778. // resource type. For example, an individual Google Cloud SQL database
  2779. // is
  2780. // identified by values for the labels "database_id" and "zone".
  2781. Labels []*LabelDescriptor `json:"labels,omitempty"`
  2782. // Name: Optional. The resource name of the monitored resource
  2783. // descriptor:
  2784. // "projects/{project_id}/monitoredResourceDescriptors/{type
  2785. // }" where
  2786. // {type} is the value of the `type` field in this object
  2787. // and
  2788. // {project_id} is a project ID that provides API-specific context
  2789. // for
  2790. // accessing the type. APIs that do not use project information can use
  2791. // the
  2792. // resource name format "monitoredResourceDescriptors/{type}".
  2793. Name string `json:"name,omitempty"`
  2794. // Type: Required. The monitored resource type. For example, the
  2795. // type
  2796. // "cloudsql_database" represents databases in Google Cloud SQL.
  2797. // The maximum length of this value is 256 characters.
  2798. Type string `json:"type,omitempty"`
  2799. // ForceSendFields is a list of field names (e.g. "Description") to
  2800. // unconditionally include in API requests. By default, fields with
  2801. // empty values are omitted from API requests. However, any non-pointer,
  2802. // non-interface field appearing in ForceSendFields will be sent to the
  2803. // server regardless of whether the field is empty or not. This may be
  2804. // used to include empty fields in Patch requests.
  2805. ForceSendFields []string `json:"-"`
  2806. // NullFields is a list of field names (e.g. "Description") to include
  2807. // in API requests with the JSON null value. By default, fields with
  2808. // empty values are omitted from API requests. However, any field with
  2809. // an empty value appearing in NullFields will be sent to the server as
  2810. // null. It is an error if a field in this list has a non-empty value.
  2811. // This may be used to include null fields in Patch requests.
  2812. NullFields []string `json:"-"`
  2813. }
  2814. func (s *MonitoredResourceDescriptor) MarshalJSON() ([]byte, error) {
  2815. type NoMethod MonitoredResourceDescriptor
  2816. raw := NoMethod(*s)
  2817. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2818. }
  2819. // Monitoring: Monitoring configuration of the service.
  2820. //
  2821. // The example below shows how to configure monitored resources and
  2822. // metrics
  2823. // for monitoring. In the example, a monitored resource and two metrics
  2824. // are
  2825. // defined. The `library.googleapis.com/book/returned_count` metric is
  2826. // sent
  2827. // to both producer and consumer projects, whereas
  2828. // the
  2829. // `library.googleapis.com/book/overdue_count` metric is only sent to
  2830. // the
  2831. // consumer project.
  2832. //
  2833. // monitored_resources:
  2834. // - type: library.googleapis.com/branch
  2835. // labels:
  2836. // - key: /city
  2837. // description: The city where the library branch is located
  2838. // in.
  2839. // - key: /name
  2840. // description: The name of the branch.
  2841. // metrics:
  2842. // - name: library.googleapis.com/book/returned_count
  2843. // metric_kind: DELTA
  2844. // value_type: INT64
  2845. // labels:
  2846. // - key: /customer_id
  2847. // - name: library.googleapis.com/book/overdue_count
  2848. // metric_kind: GAUGE
  2849. // value_type: INT64
  2850. // labels:
  2851. // - key: /customer_id
  2852. // monitoring:
  2853. // producer_destinations:
  2854. // - monitored_resource: library.googleapis.com/branch
  2855. // metrics:
  2856. // - library.googleapis.com/book/returned_count
  2857. // consumer_destinations:
  2858. // - monitored_resource: library.googleapis.com/branch
  2859. // metrics:
  2860. // - library.googleapis.com/book/returned_count
  2861. // - library.googleapis.com/book/overdue_count
  2862. type Monitoring struct {
  2863. // ConsumerDestinations: Monitoring configurations for sending metrics
  2864. // to the consumer project.
  2865. // There can be multiple consumer destinations. A monitored resouce type
  2866. // may
  2867. // appear in multiple monitoring destinations if different aggregations
  2868. // are
  2869. // needed for different sets of metrics associated with that
  2870. // monitored
  2871. // resource type. A monitored resource and metric pair may only be used
  2872. // once
  2873. // in the Monitoring configuration.
  2874. ConsumerDestinations []*MonitoringDestination `json:"consumerDestinations,omitempty"`
  2875. // ProducerDestinations: Monitoring configurations for sending metrics
  2876. // to the producer project.
  2877. // There can be multiple producer destinations. A monitored resouce type
  2878. // may
  2879. // appear in multiple monitoring destinations if different aggregations
  2880. // are
  2881. // needed for different sets of metrics associated with that
  2882. // monitored
  2883. // resource type. A monitored resource and metric pair may only be used
  2884. // once
  2885. // in the Monitoring configuration.
  2886. ProducerDestinations []*MonitoringDestination `json:"producerDestinations,omitempty"`
  2887. // ForceSendFields is a list of field names (e.g.
  2888. // "ConsumerDestinations") to unconditionally include in API requests.
  2889. // By default, fields with empty values are omitted from API requests.
  2890. // However, any non-pointer, non-interface field appearing in
  2891. // ForceSendFields will be sent to the server regardless of whether the
  2892. // field is empty or not. This may be used to include empty fields in
  2893. // Patch requests.
  2894. ForceSendFields []string `json:"-"`
  2895. // NullFields is a list of field names (e.g. "ConsumerDestinations") to
  2896. // include in API requests with the JSON null value. By default, fields
  2897. // with empty values are omitted from API requests. However, any field
  2898. // with an empty value appearing in NullFields will be sent to the
  2899. // server as null. It is an error if a field in this list has a
  2900. // non-empty value. This may be used to include null fields in Patch
  2901. // requests.
  2902. NullFields []string `json:"-"`
  2903. }
  2904. func (s *Monitoring) MarshalJSON() ([]byte, error) {
  2905. type NoMethod Monitoring
  2906. raw := NoMethod(*s)
  2907. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2908. }
  2909. // MonitoringDestination: Configuration of a specific monitoring
  2910. // destination (the producer project
  2911. // or the consumer project).
  2912. type MonitoringDestination struct {
  2913. // Metrics: Types of the metrics to report to this monitoring
  2914. // destination.
  2915. // Each type must be defined in Service.metrics section.
  2916. Metrics []string `json:"metrics,omitempty"`
  2917. // MonitoredResource: The monitored resource type. The type must be
  2918. // defined in
  2919. // Service.monitored_resources section.
  2920. MonitoredResource string `json:"monitoredResource,omitempty"`
  2921. // ForceSendFields is a list of field names (e.g. "Metrics") to
  2922. // unconditionally include in API requests. By default, fields with
  2923. // empty values are omitted from API requests. However, any non-pointer,
  2924. // non-interface field appearing in ForceSendFields will be sent to the
  2925. // server regardless of whether the field is empty or not. This may be
  2926. // used to include empty fields in Patch requests.
  2927. ForceSendFields []string `json:"-"`
  2928. // NullFields is a list of field names (e.g. "Metrics") to include in
  2929. // API requests with the JSON null value. By default, fields with empty
  2930. // values are omitted from API requests. However, any field with an
  2931. // empty value appearing in NullFields will be sent to the server as
  2932. // null. It is an error if a field in this list has a non-empty value.
  2933. // This may be used to include null fields in Patch requests.
  2934. NullFields []string `json:"-"`
  2935. }
  2936. func (s *MonitoringDestination) MarshalJSON() ([]byte, error) {
  2937. type NoMethod MonitoringDestination
  2938. raw := NoMethod(*s)
  2939. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2940. }
  2941. // OAuthRequirements: OAuth scopes are a way to define data and
  2942. // permissions on data. For example,
  2943. // there are scopes defined for "Read-only access to Google Calendar"
  2944. // and
  2945. // "Access to Cloud Platform". Users can consent to a scope for an
  2946. // application,
  2947. // giving it permission to access that data on their behalf.
  2948. //
  2949. // OAuth scope specifications should be fairly coarse grained; a user
  2950. // will need
  2951. // to see and understand the text description of what your scope
  2952. // means.
  2953. //
  2954. // In most cases: use one or at most two OAuth scopes for an entire
  2955. // family of
  2956. // products. If your product has multiple APIs, you should probably be
  2957. // sharing
  2958. // the OAuth scope across all of those APIs.
  2959. //
  2960. // When you need finer grained OAuth consent screens: talk with your
  2961. // product
  2962. // management about how developers will use them in practice.
  2963. //
  2964. // Please note that even though each of the canonical scopes is enough
  2965. // for a
  2966. // request to be accepted and passed to the backend, a request can still
  2967. // fail
  2968. // due to the backend requiring additional scopes or permissions.
  2969. type OAuthRequirements struct {
  2970. // CanonicalScopes: The list of publicly documented OAuth scopes that
  2971. // are allowed access. An
  2972. // OAuth token containing any of these scopes will be
  2973. // accepted.
  2974. //
  2975. // Example:
  2976. //
  2977. // canonical_scopes: https://www.googleapis.com/auth/calendar,
  2978. // https://www.googleapis.com/auth/calendar.read
  2979. CanonicalScopes string `json:"canonicalScopes,omitempty"`
  2980. // ForceSendFields is a list of field names (e.g. "CanonicalScopes") to
  2981. // unconditionally include in API requests. By default, fields with
  2982. // empty values are omitted from API requests. However, any non-pointer,
  2983. // non-interface field appearing in ForceSendFields will be sent to the
  2984. // server regardless of whether the field is empty or not. This may be
  2985. // used to include empty fields in Patch requests.
  2986. ForceSendFields []string `json:"-"`
  2987. // NullFields is a list of field names (e.g. "CanonicalScopes") to
  2988. // include in API requests with the JSON null value. By default, fields
  2989. // with empty values are omitted from API requests. However, any field
  2990. // with an empty value appearing in NullFields will be sent to the
  2991. // server as null. It is an error if a field in this list has a
  2992. // non-empty value. This may be used to include null fields in Patch
  2993. // requests.
  2994. NullFields []string `json:"-"`
  2995. }
  2996. func (s *OAuthRequirements) MarshalJSON() ([]byte, error) {
  2997. type NoMethod OAuthRequirements
  2998. raw := NoMethod(*s)
  2999. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3000. }
  3001. // Operation: This resource represents a long-running operation that is
  3002. // the result of a
  3003. // network API call.
  3004. type Operation struct {
  3005. // Done: If the value is `false`, it means the operation is still in
  3006. // progress.
  3007. // If `true`, the operation is completed, and either `error` or
  3008. // `response` is
  3009. // available.
  3010. Done bool `json:"done,omitempty"`
  3011. // Error: The error result of the operation in case of failure or
  3012. // cancellation.
  3013. Error *Status `json:"error,omitempty"`
  3014. // Metadata: Service-specific metadata associated with the operation.
  3015. // It typically
  3016. // contains progress information and common metadata such as create
  3017. // time.
  3018. // Some services might not provide such metadata. Any method that
  3019. // returns a
  3020. // long-running operation should document the metadata type, if any.
  3021. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  3022. // Name: The server-assigned name, which is only unique within the same
  3023. // service that
  3024. // originally returns it. If you use the default HTTP mapping,
  3025. // the
  3026. // `name` should have the format of `operations/some/unique/name`.
  3027. Name string `json:"name,omitempty"`
  3028. // Response: The normal response of the operation in case of success.
  3029. // If the original
  3030. // method returns no data on success, such as `Delete`, the response
  3031. // is
  3032. // `google.protobuf.Empty`. If the original method is
  3033. // standard
  3034. // `Get`/`Create`/`Update`, the response should be the resource. For
  3035. // other
  3036. // methods, the response should have the type `XxxResponse`, where
  3037. // `Xxx`
  3038. // is the original method name. For example, if the original method
  3039. // name
  3040. // is `TakeSnapshot()`, the inferred response type
  3041. // is
  3042. // `TakeSnapshotResponse`.
  3043. Response googleapi.RawMessage `json:"response,omitempty"`
  3044. // ServerResponse contains the HTTP response code and headers from the
  3045. // server.
  3046. googleapi.ServerResponse `json:"-"`
  3047. // ForceSendFields is a list of field names (e.g. "Done") to
  3048. // unconditionally include in API requests. By default, fields with
  3049. // empty values are omitted from API requests. However, any non-pointer,
  3050. // non-interface field appearing in ForceSendFields will be sent to the
  3051. // server regardless of whether the field is empty or not. This may be
  3052. // used to include empty fields in Patch requests.
  3053. ForceSendFields []string `json:"-"`
  3054. // NullFields is a list of field names (e.g. "Done") to include in API
  3055. // requests with the JSON null value. By default, fields with empty
  3056. // values are omitted from API requests. However, any field with an
  3057. // empty value appearing in NullFields will be sent to the server as
  3058. // null. It is an error if a field in this list has a non-empty value.
  3059. // This may be used to include null fields in Patch requests.
  3060. NullFields []string `json:"-"`
  3061. }
  3062. func (s *Operation) MarshalJSON() ([]byte, error) {
  3063. type NoMethod Operation
  3064. raw := NoMethod(*s)
  3065. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3066. }
  3067. // Option: A protocol buffer option, which can be attached to a message,
  3068. // field,
  3069. // enumeration, etc.
  3070. type Option struct {
  3071. // Name: The option's name. For protobuf built-in options (options
  3072. // defined in
  3073. // descriptor.proto), this is the short name. For example,
  3074. // "map_entry".
  3075. // For custom options, it should be the fully-qualified name. For
  3076. // example,
  3077. // "google.api.http".
  3078. Name string `json:"name,omitempty"`
  3079. // Value: The option's value packed in an Any message. If the value is a
  3080. // primitive,
  3081. // the corresponding wrapper type defined in
  3082. // google/protobuf/wrappers.proto
  3083. // should be used. If the value is an enum, it should be stored as an
  3084. // int32
  3085. // value using the google.protobuf.Int32Value type.
  3086. Value googleapi.RawMessage `json:"value,omitempty"`
  3087. // ForceSendFields is a list of field names (e.g. "Name") to
  3088. // unconditionally include in API requests. By default, fields with
  3089. // empty values are omitted from API requests. However, any non-pointer,
  3090. // non-interface field appearing in ForceSendFields will be sent to the
  3091. // server regardless of whether the field is empty or not. This may be
  3092. // used to include empty fields in Patch requests.
  3093. ForceSendFields []string `json:"-"`
  3094. // NullFields is a list of field names (e.g. "Name") to include in API
  3095. // requests with the JSON null value. By default, fields with empty
  3096. // values are omitted from API requests. However, any field with an
  3097. // empty value appearing in NullFields will be sent to the server as
  3098. // null. It is an error if a field in this list has a non-empty value.
  3099. // This may be used to include null fields in Patch requests.
  3100. NullFields []string `json:"-"`
  3101. }
  3102. func (s *Option) MarshalJSON() ([]byte, error) {
  3103. type NoMethod Option
  3104. raw := NoMethod(*s)
  3105. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3106. }
  3107. // Page: Represents a documentation page. A page can contain subpages to
  3108. // represent
  3109. // nested documentation set structure.
  3110. type Page struct {
  3111. // Content: The Markdown content of the page. You can use <code>&#40;==
  3112. // include {path}
  3113. // ==&#41;</code> to include content from a Markdown file.
  3114. Content string `json:"content,omitempty"`
  3115. // Name: The name of the page. It will be used as an identity of the
  3116. // page to
  3117. // generate URI of the page, text of the link to this page in
  3118. // navigation,
  3119. // etc. The full page name (start from the root page name to this
  3120. // page
  3121. // concatenated with `.`) can be used as reference to the page in
  3122. // your
  3123. // documentation. For example:
  3124. // <pre><code>pages:
  3125. // - name: Tutorial
  3126. // content: &#40;== include tutorial.md ==&#41;
  3127. // subpages:
  3128. // - name: Java
  3129. // content: &#40;== include tutorial_java.md
  3130. // ==&#41;
  3131. // </code></pre>
  3132. // You can reference `Java` page using Markdown reference link
  3133. // syntax:
  3134. // `Java`.
  3135. Name string `json:"name,omitempty"`
  3136. // Subpages: Subpages of this page. The order of subpages specified here
  3137. // will be
  3138. // honored in the generated docset.
  3139. Subpages []*Page `json:"subpages,omitempty"`
  3140. // ForceSendFields is a list of field names (e.g. "Content") to
  3141. // unconditionally include in API requests. By default, fields with
  3142. // empty values are omitted from API requests. However, any non-pointer,
  3143. // non-interface field appearing in ForceSendFields will be sent to the
  3144. // server regardless of whether the field is empty or not. This may be
  3145. // used to include empty fields in Patch requests.
  3146. ForceSendFields []string `json:"-"`
  3147. // NullFields is a list of field names (e.g. "Content") to include in
  3148. // API requests with the JSON null value. By default, fields with empty
  3149. // values are omitted from API requests. However, any field with an
  3150. // empty value appearing in NullFields will be sent to the server as
  3151. // null. It is an error if a field in this list has a non-empty value.
  3152. // This may be used to include null fields in Patch requests.
  3153. NullFields []string `json:"-"`
  3154. }
  3155. func (s *Page) MarshalJSON() ([]byte, error) {
  3156. type NoMethod Page
  3157. raw := NoMethod(*s)
  3158. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3159. }
  3160. type Quota struct {
  3161. // Limits: List of `QuotaLimit` definitions for the service.
  3162. Limits []*QuotaLimit `json:"limits,omitempty"`
  3163. // MetricRules: List of `MetricRule` definitions, each one mapping a
  3164. // selected method to one
  3165. // or more metrics.
  3166. MetricRules []*MetricRule `json:"metricRules,omitempty"`
  3167. // ForceSendFields is a list of field names (e.g. "Limits") to
  3168. // unconditionally include in API requests. By default, fields with
  3169. // empty values are omitted from API requests. However, any non-pointer,
  3170. // non-interface field appearing in ForceSendFields will be sent to the
  3171. // server regardless of whether the field is empty or not. This may be
  3172. // used to include empty fields in Patch requests.
  3173. ForceSendFields []string `json:"-"`
  3174. // NullFields is a list of field names (e.g. "Limits") to include in API
  3175. // requests with the JSON null value. By default, fields with empty
  3176. // values are omitted from API requests. However, any field with an
  3177. // empty value appearing in NullFields will be sent to the server as
  3178. // null. It is an error if a field in this list has a non-empty value.
  3179. // This may be used to include null fields in Patch requests.
  3180. NullFields []string `json:"-"`
  3181. }
  3182. func (s *Quota) MarshalJSON() ([]byte, error) {
  3183. type NoMethod Quota
  3184. raw := NoMethod(*s)
  3185. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3186. }
  3187. // QuotaLimit: `QuotaLimit` defines a specific limit that applies over a
  3188. // specified duration
  3189. // for a limit type. There can be at most one limit for a duration and
  3190. // limit
  3191. // type combination defined within a `QuotaGroup`.
  3192. type QuotaLimit struct {
  3193. // DefaultLimit: Default number of tokens that can be consumed during
  3194. // the specified
  3195. // duration. This is the number of tokens assigned when a
  3196. // client
  3197. // application developer activates the service for his/her
  3198. // project.
  3199. //
  3200. // Specifying a value of 0 will block all requests. This can be used if
  3201. // you
  3202. // are provisioning quota to selected consumers and blocking
  3203. // others.
  3204. // Similarly, a value of -1 will indicate an unlimited quota. No
  3205. // other
  3206. // negative values are allowed.
  3207. //
  3208. // Used by group-based quotas only.
  3209. DefaultLimit int64 `json:"defaultLimit,omitempty,string"`
  3210. // Description: Optional. User-visible, extended description for this
  3211. // quota limit.
  3212. // Should be used only when more context is needed to understand this
  3213. // limit
  3214. // than provided by the limit's display name (see: `display_name`).
  3215. Description string `json:"description,omitempty"`
  3216. // DisplayName: User-visible display name for this limit.
  3217. // Optional. If not set, the UI will provide a default display name
  3218. // based on
  3219. // the quota configuration. This field can be used to override the
  3220. // default
  3221. // display name generated from the configuration.
  3222. DisplayName string `json:"displayName,omitempty"`
  3223. // Duration: Duration of this limit in textual notation. Example:
  3224. // "100s", "24h", "1d".
  3225. // For duration longer than a day, only multiple of days is supported.
  3226. // We
  3227. // support only "100s" and "1d" for now. Additional support will be
  3228. // added in
  3229. // the future. "0" indicates indefinite duration.
  3230. //
  3231. // Used by group-based quotas only.
  3232. Duration string `json:"duration,omitempty"`
  3233. // FreeTier: Free tier value displayed in the Developers Console for
  3234. // this limit.
  3235. // The free tier is the number of tokens that will be subtracted from
  3236. // the
  3237. // billed amount when billing is enabled.
  3238. // This field can only be set on a limit with duration "1d", in a
  3239. // billable
  3240. // group; it is invalid on any other limit. If this field is not set,
  3241. // it
  3242. // defaults to 0, indicating that there is no free tier for this
  3243. // service.
  3244. //
  3245. // Used by group-based quotas only.
  3246. FreeTier int64 `json:"freeTier,omitempty,string"`
  3247. // MaxLimit: Maximum number of tokens that can be consumed during the
  3248. // specified
  3249. // duration. Client application developers can override the default
  3250. // limit up
  3251. // to this maximum. If specified, this value cannot be set to a value
  3252. // less
  3253. // than the default limit. If not specified, it is set to the default
  3254. // limit.
  3255. //
  3256. // To allow clients to apply overrides with no upper bound, set this to
  3257. // -1,
  3258. // indicating unlimited maximum quota.
  3259. //
  3260. // Used by group-based quotas only.
  3261. MaxLimit int64 `json:"maxLimit,omitempty,string"`
  3262. // Metric: The name of the metric this quota limit applies to. The quota
  3263. // limits with
  3264. // the same metric will be checked together during runtime. The metric
  3265. // must be
  3266. // defined within the service config.
  3267. Metric string `json:"metric,omitempty"`
  3268. // Name: Name of the quota limit.
  3269. //
  3270. // The name must be provided, and it must be unique within the service.
  3271. // The
  3272. // name can only include alphanumeric characters as well as '-'.
  3273. //
  3274. // The maximum length of the limit name is 64 characters.
  3275. Name string `json:"name,omitempty"`
  3276. // Unit: Specify the unit of the quota limit. It uses the same syntax
  3277. // as
  3278. // Metric.unit. The supported unit kinds are determined by the
  3279. // quota
  3280. // backend system.
  3281. //
  3282. // Here are some examples:
  3283. // * "1/min/{project}" for quota per minute per project.
  3284. //
  3285. // Note: the order of unit components is insignificant.
  3286. // The "1" at the beginning is required to follow the metric unit
  3287. // syntax.
  3288. Unit string `json:"unit,omitempty"`
  3289. // Values: Tiered limit values. You must specify this as a key:value
  3290. // pair, with an
  3291. // integer value that is the maximum number of requests allowed for
  3292. // the
  3293. // specified unit. Currently only STANDARD is supported.
  3294. Values map[string]string `json:"values,omitempty"`
  3295. // ForceSendFields is a list of field names (e.g. "DefaultLimit") to
  3296. // unconditionally include in API requests. By default, fields with
  3297. // empty values are omitted from API requests. However, any non-pointer,
  3298. // non-interface field appearing in ForceSendFields will be sent to the
  3299. // server regardless of whether the field is empty or not. This may be
  3300. // used to include empty fields in Patch requests.
  3301. ForceSendFields []string `json:"-"`
  3302. // NullFields is a list of field names (e.g. "DefaultLimit") to include
  3303. // in API requests with the JSON null value. By default, fields with
  3304. // empty values are omitted from API requests. However, any field with
  3305. // an empty value appearing in NullFields will be sent to the server as
  3306. // null. It is an error if a field in this list has a non-empty value.
  3307. // This may be used to include null fields in Patch requests.
  3308. NullFields []string `json:"-"`
  3309. }
  3310. func (s *QuotaLimit) MarshalJSON() ([]byte, error) {
  3311. type NoMethod QuotaLimit
  3312. raw := NoMethod(*s)
  3313. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3314. }
  3315. // Range: Represents a found unused range.
  3316. type Range struct {
  3317. // IpCidrRange: CIDR range in "10.x.x.x/y" format that is within
  3318. // the
  3319. // allocated ranges and currently unused.
  3320. IpCidrRange string `json:"ipCidrRange,omitempty"`
  3321. // Network: In the Shared VPC host project, the VPC network that's
  3322. // peered with the
  3323. // consumer network. For
  3324. // example:
  3325. // `projects/1234321/global/networks/host-network`
  3326. Network string `json:"network,omitempty"`
  3327. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  3328. // unconditionally include in API requests. By default, fields with
  3329. // empty values are omitted from API requests. However, any non-pointer,
  3330. // non-interface field appearing in ForceSendFields will be sent to the
  3331. // server regardless of whether the field is empty or not. This may be
  3332. // used to include empty fields in Patch requests.
  3333. ForceSendFields []string `json:"-"`
  3334. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  3335. // in API requests with the JSON null value. By default, fields with
  3336. // empty values are omitted from API requests. However, any field with
  3337. // an empty value appearing in NullFields will be sent to the server as
  3338. // null. It is an error if a field in this list has a non-empty value.
  3339. // This may be used to include null fields in Patch requests.
  3340. NullFields []string `json:"-"`
  3341. }
  3342. func (s *Range) MarshalJSON() ([]byte, error) {
  3343. type NoMethod Range
  3344. raw := NoMethod(*s)
  3345. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3346. }
  3347. // SearchRangeRequest: Request to search for an unused range within
  3348. // allocated ranges.
  3349. type SearchRangeRequest struct {
  3350. // IpPrefixLength: Required. The prefix length of the IP range.
  3351. // Use usual CIDR range notation.
  3352. // For example, '30' to find unused x.x.x.x/30 CIDR range.
  3353. // Actual range will be determined using allocated range for the
  3354. // consumer
  3355. // peered network and returned in the result.
  3356. IpPrefixLength int64 `json:"ipPrefixLength,omitempty"`
  3357. // Network: Network name in the consumer project. This network must
  3358. // have been
  3359. // already peered with a shared VPC network using
  3360. // CreateConnection
  3361. // method.
  3362. // Must be in a form
  3363. // 'projects/{project}/global/networks/{network}'.
  3364. // {project} is a project number, as in '12345'
  3365. // {network} is network name.
  3366. Network string `json:"network,omitempty"`
  3367. // ForceSendFields is a list of field names (e.g. "IpPrefixLength") to
  3368. // unconditionally include in API requests. By default, fields with
  3369. // empty values are omitted from API requests. However, any non-pointer,
  3370. // non-interface field appearing in ForceSendFields will be sent to the
  3371. // server regardless of whether the field is empty or not. This may be
  3372. // used to include empty fields in Patch requests.
  3373. ForceSendFields []string `json:"-"`
  3374. // NullFields is a list of field names (e.g. "IpPrefixLength") to
  3375. // include in API requests with the JSON null value. By default, fields
  3376. // with empty values are omitted from API requests. However, any field
  3377. // with an empty value appearing in NullFields will be sent to the
  3378. // server as null. It is an error if a field in this list has a
  3379. // non-empty value. This may be used to include null fields in Patch
  3380. // requests.
  3381. NullFields []string `json:"-"`
  3382. }
  3383. func (s *SearchRangeRequest) MarshalJSON() ([]byte, error) {
  3384. type NoMethod SearchRangeRequest
  3385. raw := NoMethod(*s)
  3386. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3387. }
  3388. // Service: `Service` is the root object of Google service configuration
  3389. // schema. It
  3390. // describes basic information about a service, such as the name and
  3391. // the
  3392. // title, and delegates other aspects to sub-sections. Each sub-section
  3393. // is
  3394. // either a proto message or a repeated proto message that configures
  3395. // a
  3396. // specific aspect, such as auth. See each proto message definition for
  3397. // details.
  3398. //
  3399. // Example:
  3400. //
  3401. // type: google.api.Service
  3402. // config_version: 3
  3403. // name: calendar.googleapis.com
  3404. // title: Google Calendar API
  3405. // apis:
  3406. // - name: google.calendar.v3.Calendar
  3407. // authentication:
  3408. // providers:
  3409. // - id: google_calendar_auth
  3410. // jwks_uri: https://www.googleapis.com/oauth2/v1/certs
  3411. // issuer: https://securetoken.google.com
  3412. // rules:
  3413. // - selector: "*"
  3414. // requirements:
  3415. // provider_id: google_calendar_auth
  3416. type Service struct {
  3417. // Apis: A list of API interfaces exported by this service. Only the
  3418. // `name` field
  3419. // of the google.protobuf.Api needs to be provided by the
  3420. // configuration
  3421. // author, as the remaining fields will be derived from the IDL during
  3422. // the
  3423. // normalization process. It is an error to specify an API interface
  3424. // here
  3425. // which cannot be resolved against the associated IDL files.
  3426. Apis []*Api `json:"apis,omitempty"`
  3427. // Authentication: Auth configuration.
  3428. Authentication *Authentication `json:"authentication,omitempty"`
  3429. // Backend: API backend configuration.
  3430. Backend *Backend `json:"backend,omitempty"`
  3431. // Billing: Billing configuration.
  3432. Billing *Billing `json:"billing,omitempty"`
  3433. // ConfigVersion: The semantic version of the service configuration. The
  3434. // config version
  3435. // affects the interpretation of the service configuration. For
  3436. // example,
  3437. // certain features are enabled by default for certain config
  3438. // versions.
  3439. // The latest config version is `3`.
  3440. ConfigVersion int64 `json:"configVersion,omitempty"`
  3441. // Context: Context configuration.
  3442. Context *Context `json:"context,omitempty"`
  3443. // Control: Configuration for the service control plane.
  3444. Control *Control `json:"control,omitempty"`
  3445. // CustomError: Custom error configuration.
  3446. CustomError *CustomError `json:"customError,omitempty"`
  3447. // Documentation: Additional API documentation.
  3448. Documentation *Documentation `json:"documentation,omitempty"`
  3449. // Endpoints: Configuration for network endpoints. If this is empty,
  3450. // then an endpoint
  3451. // with the same name as the service is automatically generated to
  3452. // service all
  3453. // defined APIs.
  3454. Endpoints []*Endpoint `json:"endpoints,omitempty"`
  3455. // Enums: A list of all enum types included in this API service.
  3456. // Enums
  3457. // referenced directly or indirectly by the `apis` are
  3458. // automatically
  3459. // included. Enums which are not referenced but shall be
  3460. // included
  3461. // should be listed here by name. Example:
  3462. //
  3463. // enums:
  3464. // - name: google.someapi.v1.SomeEnum
  3465. Enums []*Enum `json:"enums,omitempty"`
  3466. // Experimental: Experimental configuration.
  3467. Experimental *Experimental `json:"experimental,omitempty"`
  3468. // Http: HTTP configuration.
  3469. Http *Http `json:"http,omitempty"`
  3470. // Id: A unique ID for a specific instance of this message, typically
  3471. // assigned
  3472. // by the client for tracking purpose. If empty, the server may choose
  3473. // to
  3474. // generate one instead. Must be no longer than 60 characters.
  3475. Id string `json:"id,omitempty"`
  3476. // Logging: Logging configuration.
  3477. Logging *Logging `json:"logging,omitempty"`
  3478. // Logs: Defines the logs used by this service.
  3479. Logs []*LogDescriptor `json:"logs,omitempty"`
  3480. // Metrics: Defines the metrics used by this service.
  3481. Metrics []*MetricDescriptor `json:"metrics,omitempty"`
  3482. // MonitoredResources: Defines the monitored resources used by this
  3483. // service. This is required
  3484. // by the Service.monitoring and Service.logging configurations.
  3485. MonitoredResources []*MonitoredResourceDescriptor `json:"monitoredResources,omitempty"`
  3486. // Monitoring: Monitoring configuration.
  3487. Monitoring *Monitoring `json:"monitoring,omitempty"`
  3488. // Name: The service name, which is a DNS-like logical identifier for
  3489. // the
  3490. // service, such as `calendar.googleapis.com`. The service
  3491. // name
  3492. // typically goes through DNS verification to make sure the owner
  3493. // of the service also owns the DNS name.
  3494. Name string `json:"name,omitempty"`
  3495. // ProducerProjectId: The Google project that owns this service.
  3496. ProducerProjectId string `json:"producerProjectId,omitempty"`
  3497. // Quota: Quota configuration.
  3498. Quota *Quota `json:"quota,omitempty"`
  3499. // SourceInfo: Output only. The source information for this
  3500. // configuration if available.
  3501. SourceInfo *SourceInfo `json:"sourceInfo,omitempty"`
  3502. // SystemParameters: System parameter configuration.
  3503. SystemParameters *SystemParameters `json:"systemParameters,omitempty"`
  3504. // SystemTypes: A list of all proto message types included in this API
  3505. // service.
  3506. // It serves similar purpose as [google.api.Service.types], except
  3507. // that
  3508. // these types are not needed by user-defined APIs. Therefore, they will
  3509. // not
  3510. // show up in the generated discovery doc. This field should only be
  3511. // used
  3512. // to define system APIs in ESF.
  3513. SystemTypes []*Type `json:"systemTypes,omitempty"`
  3514. // Title: The product title for this service.
  3515. Title string `json:"title,omitempty"`
  3516. // Types: A list of all proto message types included in this API
  3517. // service.
  3518. // Types referenced directly or indirectly by the `apis`
  3519. // are
  3520. // automatically included. Messages which are not referenced but
  3521. // shall be included, such as types used by the `google.protobuf.Any`
  3522. // type,
  3523. // should be listed here by name. Example:
  3524. //
  3525. // types:
  3526. // - name: google.protobuf.Int32
  3527. Types []*Type `json:"types,omitempty"`
  3528. // Usage: Configuration controlling usage of this service.
  3529. Usage *Usage `json:"usage,omitempty"`
  3530. // ForceSendFields is a list of field names (e.g. "Apis") to
  3531. // unconditionally include in API requests. By default, fields with
  3532. // empty values are omitted from API requests. However, any non-pointer,
  3533. // non-interface field appearing in ForceSendFields will be sent to the
  3534. // server regardless of whether the field is empty or not. This may be
  3535. // used to include empty fields in Patch requests.
  3536. ForceSendFields []string `json:"-"`
  3537. // NullFields is a list of field names (e.g. "Apis") to include in API
  3538. // requests with the JSON null value. By default, fields with empty
  3539. // values are omitted from API requests. However, any field with an
  3540. // empty value appearing in NullFields will be sent to the server as
  3541. // null. It is an error if a field in this list has a non-empty value.
  3542. // This may be used to include null fields in Patch requests.
  3543. NullFields []string `json:"-"`
  3544. }
  3545. func (s *Service) MarshalJSON() ([]byte, error) {
  3546. type NoMethod Service
  3547. raw := NoMethod(*s)
  3548. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3549. }
  3550. // SourceContext: `SourceContext` represents information about the
  3551. // source of a
  3552. // protobuf element, like the file in which it is defined.
  3553. type SourceContext struct {
  3554. // FileName: The path-qualified name of the .proto file that contained
  3555. // the associated
  3556. // protobuf element. For example:
  3557. // "google/protobuf/source_context.proto".
  3558. FileName string `json:"fileName,omitempty"`
  3559. // ForceSendFields is a list of field names (e.g. "FileName") to
  3560. // unconditionally include in API requests. By default, fields with
  3561. // empty values are omitted from API requests. However, any non-pointer,
  3562. // non-interface field appearing in ForceSendFields will be sent to the
  3563. // server regardless of whether the field is empty or not. This may be
  3564. // used to include empty fields in Patch requests.
  3565. ForceSendFields []string `json:"-"`
  3566. // NullFields is a list of field names (e.g. "FileName") to include in
  3567. // API requests with the JSON null value. By default, fields with empty
  3568. // values are omitted from API requests. However, any field with an
  3569. // empty value appearing in NullFields will be sent to the server as
  3570. // null. It is an error if a field in this list has a non-empty value.
  3571. // This may be used to include null fields in Patch requests.
  3572. NullFields []string `json:"-"`
  3573. }
  3574. func (s *SourceContext) MarshalJSON() ([]byte, error) {
  3575. type NoMethod SourceContext
  3576. raw := NoMethod(*s)
  3577. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3578. }
  3579. // SourceInfo: Source information used to create a Service Config
  3580. type SourceInfo struct {
  3581. // SourceFiles: All files used during config generation.
  3582. SourceFiles []googleapi.RawMessage `json:"sourceFiles,omitempty"`
  3583. // ForceSendFields is a list of field names (e.g. "SourceFiles") to
  3584. // unconditionally include in API requests. By default, fields with
  3585. // empty values are omitted from API requests. However, any non-pointer,
  3586. // non-interface field appearing in ForceSendFields will be sent to the
  3587. // server regardless of whether the field is empty or not. This may be
  3588. // used to include empty fields in Patch requests.
  3589. ForceSendFields []string `json:"-"`
  3590. // NullFields is a list of field names (e.g. "SourceFiles") to include
  3591. // in API requests with the JSON null value. By default, fields with
  3592. // empty values are omitted from API requests. However, any field with
  3593. // an empty value appearing in NullFields will be sent to the server as
  3594. // null. It is an error if a field in this list has a non-empty value.
  3595. // This may be used to include null fields in Patch requests.
  3596. NullFields []string `json:"-"`
  3597. }
  3598. func (s *SourceInfo) MarshalJSON() ([]byte, error) {
  3599. type NoMethod SourceInfo
  3600. raw := NoMethod(*s)
  3601. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3602. }
  3603. // Status: The `Status` type defines a logical error model that is
  3604. // suitable for
  3605. // different programming environments, including REST APIs and RPC APIs.
  3606. // It is
  3607. // used by [gRPC](https://github.com/grpc). The error model is designed
  3608. // to be:
  3609. //
  3610. // - Simple to use and understand for most users
  3611. // - Flexible enough to meet unexpected needs
  3612. //
  3613. // # Overview
  3614. //
  3615. // The `Status` message contains three pieces of data: error code,
  3616. // error
  3617. // message, and error details. The error code should be an enum value
  3618. // of
  3619. // google.rpc.Code, but it may accept additional error codes if needed.
  3620. // The
  3621. // error message should be a developer-facing English message that
  3622. // helps
  3623. // developers *understand* and *resolve* the error. If a localized
  3624. // user-facing
  3625. // error message is needed, put the localized message in the error
  3626. // details or
  3627. // localize it in the client. The optional error details may contain
  3628. // arbitrary
  3629. // information about the error. There is a predefined set of error
  3630. // detail types
  3631. // in the package `google.rpc` that can be used for common error
  3632. // conditions.
  3633. //
  3634. // # Language mapping
  3635. //
  3636. // The `Status` message is the logical representation of the error
  3637. // model, but it
  3638. // is not necessarily the actual wire format. When the `Status` message
  3639. // is
  3640. // exposed in different client libraries and different wire protocols,
  3641. // it can be
  3642. // mapped differently. For example, it will likely be mapped to some
  3643. // exceptions
  3644. // in Java, but more likely mapped to some error codes in C.
  3645. //
  3646. // # Other uses
  3647. //
  3648. // The error model and the `Status` message can be used in a variety
  3649. // of
  3650. // environments, either with or without APIs, to provide a
  3651. // consistent developer experience across different
  3652. // environments.
  3653. //
  3654. // Example uses of this error model include:
  3655. //
  3656. // - Partial errors. If a service needs to return partial errors to the
  3657. // client,
  3658. // it may embed the `Status` in the normal response to indicate the
  3659. // partial
  3660. // errors.
  3661. //
  3662. // - Workflow errors. A typical workflow has multiple steps. Each step
  3663. // may
  3664. // have a `Status` message for error reporting.
  3665. //
  3666. // - Batch operations. If a client uses batch request and batch
  3667. // response, the
  3668. // `Status` message should be used directly inside batch response,
  3669. // one for
  3670. // each error sub-response.
  3671. //
  3672. // - Asynchronous operations. If an API call embeds asynchronous
  3673. // operation
  3674. // results in its response, the status of those operations should
  3675. // be
  3676. // represented directly using the `Status` message.
  3677. //
  3678. // - Logging. If some API errors are stored in logs, the message
  3679. // `Status` could
  3680. // be used directly after any stripping needed for security/privacy
  3681. // reasons.
  3682. type Status struct {
  3683. // Code: The status code, which should be an enum value of
  3684. // google.rpc.Code.
  3685. Code int64 `json:"code,omitempty"`
  3686. // Details: A list of messages that carry the error details. There is a
  3687. // common set of
  3688. // message types for APIs to use.
  3689. Details []googleapi.RawMessage `json:"details,omitempty"`
  3690. // Message: A developer-facing error message, which should be in
  3691. // English. Any
  3692. // user-facing error message should be localized and sent in
  3693. // the
  3694. // google.rpc.Status.details field, or localized by the client.
  3695. Message string `json:"message,omitempty"`
  3696. // ForceSendFields is a list of field names (e.g. "Code") to
  3697. // unconditionally include in API requests. By default, fields with
  3698. // empty values are omitted from API requests. However, any non-pointer,
  3699. // non-interface field appearing in ForceSendFields will be sent to the
  3700. // server regardless of whether the field is empty or not. This may be
  3701. // used to include empty fields in Patch requests.
  3702. ForceSendFields []string `json:"-"`
  3703. // NullFields is a list of field names (e.g. "Code") to include in API
  3704. // requests with the JSON null value. By default, fields with empty
  3705. // values are omitted from API requests. However, any field with an
  3706. // empty value appearing in NullFields will be sent to the server as
  3707. // null. It is an error if a field in this list has a non-empty value.
  3708. // This may be used to include null fields in Patch requests.
  3709. NullFields []string `json:"-"`
  3710. }
  3711. func (s *Status) MarshalJSON() ([]byte, error) {
  3712. type NoMethod Status
  3713. raw := NoMethod(*s)
  3714. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3715. }
  3716. // Subnetwork: Represents a subnet that was created or discovered by a
  3717. // private access
  3718. // management service.
  3719. type Subnetwork struct {
  3720. // IpCidrRange: Subnetwork CIDR range in `10.x.x.x/y` format.
  3721. IpCidrRange string `json:"ipCidrRange,omitempty"`
  3722. // Name: Subnetwork name.
  3723. // See https://cloud.google.com/compute/docs/vpc/
  3724. Name string `json:"name,omitempty"`
  3725. // Network: In the Shared VPC host project, the VPC network that's
  3726. // peered with the
  3727. // consumer network. For
  3728. // example:
  3729. // `projects/1234321/global/networks/host-network`
  3730. Network string `json:"network,omitempty"`
  3731. // OutsideAllocation: This is a discovered subnet that is not within the
  3732. // current consumer
  3733. // allocated ranges.
  3734. OutsideAllocation bool `json:"outsideAllocation,omitempty"`
  3735. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  3736. // unconditionally include in API requests. By default, fields with
  3737. // empty values are omitted from API requests. However, any non-pointer,
  3738. // non-interface field appearing in ForceSendFields will be sent to the
  3739. // server regardless of whether the field is empty or not. This may be
  3740. // used to include empty fields in Patch requests.
  3741. ForceSendFields []string `json:"-"`
  3742. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  3743. // in API requests with the JSON null value. By default, fields with
  3744. // empty values are omitted from API requests. However, any field with
  3745. // an empty value appearing in NullFields will be sent to the server as
  3746. // null. It is an error if a field in this list has a non-empty value.
  3747. // This may be used to include null fields in Patch requests.
  3748. NullFields []string `json:"-"`
  3749. }
  3750. func (s *Subnetwork) MarshalJSON() ([]byte, error) {
  3751. type NoMethod Subnetwork
  3752. raw := NoMethod(*s)
  3753. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3754. }
  3755. // SystemParameter: Define a parameter's name and location. The
  3756. // parameter may be passed as either
  3757. // an HTTP header or a URL query parameter, and if both are passed the
  3758. // behavior
  3759. // is implementation-dependent.
  3760. type SystemParameter struct {
  3761. // HttpHeader: Define the HTTP header name to use for the parameter. It
  3762. // is case
  3763. // insensitive.
  3764. HttpHeader string `json:"httpHeader,omitempty"`
  3765. // Name: Define the name of the parameter, such as "api_key" . It is
  3766. // case sensitive.
  3767. Name string `json:"name,omitempty"`
  3768. // UrlQueryParameter: Define the URL query parameter name to use for the
  3769. // parameter. It is case
  3770. // sensitive.
  3771. UrlQueryParameter string `json:"urlQueryParameter,omitempty"`
  3772. // ForceSendFields is a list of field names (e.g. "HttpHeader") to
  3773. // unconditionally include in API requests. By default, fields with
  3774. // empty values are omitted from API requests. However, any non-pointer,
  3775. // non-interface field appearing in ForceSendFields will be sent to the
  3776. // server regardless of whether the field is empty or not. This may be
  3777. // used to include empty fields in Patch requests.
  3778. ForceSendFields []string `json:"-"`
  3779. // NullFields is a list of field names (e.g. "HttpHeader") to include in
  3780. // API requests with the JSON null value. By default, fields with empty
  3781. // values are omitted from API requests. However, any field with an
  3782. // empty value appearing in NullFields will be sent to the server as
  3783. // null. It is an error if a field in this list has a non-empty value.
  3784. // This may be used to include null fields in Patch requests.
  3785. NullFields []string `json:"-"`
  3786. }
  3787. func (s *SystemParameter) MarshalJSON() ([]byte, error) {
  3788. type NoMethod SystemParameter
  3789. raw := NoMethod(*s)
  3790. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3791. }
  3792. // SystemParameterRule: Define a system parameter rule mapping system
  3793. // parameter definitions to
  3794. // methods.
  3795. type SystemParameterRule struct {
  3796. // Parameters: Define parameters. Multiple names may be defined for a
  3797. // parameter.
  3798. // For a given method call, only one of them should be used. If
  3799. // multiple
  3800. // names are used the behavior is implementation-dependent.
  3801. // If none of the specified names are present the behavior
  3802. // is
  3803. // parameter-dependent.
  3804. Parameters []*SystemParameter `json:"parameters,omitempty"`
  3805. // Selector: Selects the methods to which this rule applies. Use '*' to
  3806. // indicate all
  3807. // methods in all APIs.
  3808. //
  3809. // Refer to selector for syntax details.
  3810. Selector string `json:"selector,omitempty"`
  3811. // ForceSendFields is a list of field names (e.g. "Parameters") to
  3812. // unconditionally include in API requests. By default, fields with
  3813. // empty values are omitted from API requests. However, any non-pointer,
  3814. // non-interface field appearing in ForceSendFields will be sent to the
  3815. // server regardless of whether the field is empty or not. This may be
  3816. // used to include empty fields in Patch requests.
  3817. ForceSendFields []string `json:"-"`
  3818. // NullFields is a list of field names (e.g. "Parameters") to include in
  3819. // API requests with the JSON null value. By default, fields with empty
  3820. // values are omitted from API requests. However, any field with an
  3821. // empty value appearing in NullFields will be sent to the server as
  3822. // null. It is an error if a field in this list has a non-empty value.
  3823. // This may be used to include null fields in Patch requests.
  3824. NullFields []string `json:"-"`
  3825. }
  3826. func (s *SystemParameterRule) MarshalJSON() ([]byte, error) {
  3827. type NoMethod SystemParameterRule
  3828. raw := NoMethod(*s)
  3829. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3830. }
  3831. // SystemParameters: ### System parameter configuration
  3832. //
  3833. // A system parameter is a special kind of parameter defined by the
  3834. // API
  3835. // system, not by an individual API. It is typically mapped to an HTTP
  3836. // header
  3837. // and/or a URL query parameter. This configuration specifies which
  3838. // methods
  3839. // change the names of the system parameters.
  3840. type SystemParameters struct {
  3841. // Rules: Define system parameters.
  3842. //
  3843. // The parameters defined here will override the default
  3844. // parameters
  3845. // implemented by the system. If this field is missing from the
  3846. // service
  3847. // config, default system parameters will be used. Default system
  3848. // parameters
  3849. // and names is implementation-dependent.
  3850. //
  3851. // Example: define api key for all methods
  3852. //
  3853. // system_parameters
  3854. // rules:
  3855. // - selector: "*"
  3856. // parameters:
  3857. // - name: api_key
  3858. // url_query_parameter: api_key
  3859. //
  3860. //
  3861. // Example: define 2 api key names for a specific method.
  3862. //
  3863. // system_parameters
  3864. // rules:
  3865. // - selector: "/ListShelves"
  3866. // parameters:
  3867. // - name: api_key
  3868. // http_header: Api-Key1
  3869. // - name: api_key
  3870. // http_header: Api-Key2
  3871. //
  3872. // **NOTE:** All service configuration rules follow "last one wins"
  3873. // order.
  3874. Rules []*SystemParameterRule `json:"rules,omitempty"`
  3875. // ForceSendFields is a list of field names (e.g. "Rules") to
  3876. // unconditionally include in API requests. By default, fields with
  3877. // empty values are omitted from API requests. However, any non-pointer,
  3878. // non-interface field appearing in ForceSendFields will be sent to the
  3879. // server regardless of whether the field is empty or not. This may be
  3880. // used to include empty fields in Patch requests.
  3881. ForceSendFields []string `json:"-"`
  3882. // NullFields is a list of field names (e.g. "Rules") to include in API
  3883. // requests with the JSON null value. By default, fields with empty
  3884. // values are omitted from API requests. However, any field with an
  3885. // empty value appearing in NullFields will be sent to the server as
  3886. // null. It is an error if a field in this list has a non-empty value.
  3887. // This may be used to include null fields in Patch requests.
  3888. NullFields []string `json:"-"`
  3889. }
  3890. func (s *SystemParameters) MarshalJSON() ([]byte, error) {
  3891. type NoMethod SystemParameters
  3892. raw := NoMethod(*s)
  3893. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3894. }
  3895. // Type: A protocol buffer message type.
  3896. type Type struct {
  3897. // Fields: The list of fields.
  3898. Fields []*Field `json:"fields,omitempty"`
  3899. // Name: The fully qualified message name.
  3900. Name string `json:"name,omitempty"`
  3901. // Oneofs: The list of types appearing in `oneof` definitions in this
  3902. // type.
  3903. Oneofs []string `json:"oneofs,omitempty"`
  3904. // Options: The protocol buffer options.
  3905. Options []*Option `json:"options,omitempty"`
  3906. // SourceContext: The source context.
  3907. SourceContext *SourceContext `json:"sourceContext,omitempty"`
  3908. // Syntax: The source syntax.
  3909. //
  3910. // Possible values:
  3911. // "SYNTAX_PROTO2" - Syntax `proto2`.
  3912. // "SYNTAX_PROTO3" - Syntax `proto3`.
  3913. Syntax string `json:"syntax,omitempty"`
  3914. // ForceSendFields is a list of field names (e.g. "Fields") to
  3915. // unconditionally include in API requests. By default, fields with
  3916. // empty values are omitted from API requests. However, any non-pointer,
  3917. // non-interface field appearing in ForceSendFields will be sent to the
  3918. // server regardless of whether the field is empty or not. This may be
  3919. // used to include empty fields in Patch requests.
  3920. ForceSendFields []string `json:"-"`
  3921. // NullFields is a list of field names (e.g. "Fields") to include in API
  3922. // requests with the JSON null value. By default, fields with empty
  3923. // values are omitted from API requests. However, any field with an
  3924. // empty value appearing in NullFields will be sent to the server as
  3925. // null. It is an error if a field in this list has a non-empty value.
  3926. // This may be used to include null fields in Patch requests.
  3927. NullFields []string `json:"-"`
  3928. }
  3929. func (s *Type) MarshalJSON() ([]byte, error) {
  3930. type NoMethod Type
  3931. raw := NoMethod(*s)
  3932. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3933. }
  3934. // Usage: Configuration controlling usage of a service.
  3935. type Usage struct {
  3936. // ProducerNotificationChannel: The full resource name of a channel used
  3937. // for sending notifications to the
  3938. // service producer.
  3939. //
  3940. // Google Service Management currently only supports
  3941. // [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a
  3942. // notification
  3943. // channel. To use Google Cloud Pub/Sub as the channel, this must be the
  3944. // name
  3945. // of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name
  3946. // format
  3947. // documented in https://cloud.google.com/pubsub/docs/overview.
  3948. ProducerNotificationChannel string `json:"producerNotificationChannel,omitempty"`
  3949. // Requirements: Requirements that must be satisfied before a consumer
  3950. // project can use the
  3951. // service. Each requirement is of the form
  3952. // <service.name>/<requirement-id>;
  3953. // for example 'serviceusage.googleapis.com/billing-enabled'.
  3954. Requirements []string `json:"requirements,omitempty"`
  3955. // Rules: A list of usage rules that apply to individual API
  3956. // methods.
  3957. //
  3958. // **NOTE:** All service configuration rules follow "last one wins"
  3959. // order.
  3960. Rules []*UsageRule `json:"rules,omitempty"`
  3961. // ForceSendFields is a list of field names (e.g.
  3962. // "ProducerNotificationChannel") to unconditionally include in API
  3963. // requests. By default, fields with empty values are omitted from API
  3964. // requests. However, any non-pointer, non-interface field appearing in
  3965. // ForceSendFields will be sent to the server regardless of whether the
  3966. // field is empty or not. This may be used to include empty fields in
  3967. // Patch requests.
  3968. ForceSendFields []string `json:"-"`
  3969. // NullFields is a list of field names (e.g.
  3970. // "ProducerNotificationChannel") to include in API requests with the
  3971. // JSON null value. By default, fields with empty values are omitted
  3972. // from API requests. However, any field with an empty value appearing
  3973. // in NullFields will be sent to the server as null. It is an error if a
  3974. // field in this list has a non-empty value. This may be used to include
  3975. // null fields in Patch requests.
  3976. NullFields []string `json:"-"`
  3977. }
  3978. func (s *Usage) MarshalJSON() ([]byte, error) {
  3979. type NoMethod Usage
  3980. raw := NoMethod(*s)
  3981. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3982. }
  3983. // UsageRule: Usage configuration rules for the service.
  3984. //
  3985. // NOTE: Under development.
  3986. //
  3987. //
  3988. // Use this rule to configure unregistered calls for the service.
  3989. // Unregistered
  3990. // calls are calls that do not contain consumer project
  3991. // identity.
  3992. // (Example: calls that do not contain an API key).
  3993. // By default, API methods do not allow unregistered calls, and each
  3994. // method call
  3995. // must be identified by a consumer project identity. Use this rule
  3996. // to
  3997. // allow/disallow unregistered calls.
  3998. //
  3999. // Example of an API that wants to allow unregistered calls for entire
  4000. // service.
  4001. //
  4002. // usage:
  4003. // rules:
  4004. // - selector: "*"
  4005. // allow_unregistered_calls: true
  4006. //
  4007. // Example of a method that wants to allow unregistered calls.
  4008. //
  4009. // usage:
  4010. // rules:
  4011. // - selector:
  4012. // "google.example.library.v1.LibraryService.CreateBook"
  4013. // allow_unregistered_calls: true
  4014. type UsageRule struct {
  4015. // AllowUnregisteredCalls: If true, the selected method allows
  4016. // unregistered calls, e.g. calls
  4017. // that don't identify any user or application.
  4018. AllowUnregisteredCalls bool `json:"allowUnregisteredCalls,omitempty"`
  4019. // Selector: Selects the methods to which this rule applies. Use '*' to
  4020. // indicate all
  4021. // methods in all APIs.
  4022. //
  4023. // Refer to selector for syntax details.
  4024. Selector string `json:"selector,omitempty"`
  4025. // SkipServiceControl: If true, the selected method should skip service
  4026. // control and the control
  4027. // plane features, such as quota and billing, will not be
  4028. // available.
  4029. // This flag is used by Google Cloud Endpoints to bypass checks for
  4030. // internal
  4031. // methods, such as service health check methods.
  4032. SkipServiceControl bool `json:"skipServiceControl,omitempty"`
  4033. // ForceSendFields is a list of field names (e.g.
  4034. // "AllowUnregisteredCalls") to unconditionally include in API requests.
  4035. // By default, fields with empty values are omitted from API requests.
  4036. // However, any non-pointer, non-interface field appearing in
  4037. // ForceSendFields will be sent to the server regardless of whether the
  4038. // field is empty or not. This may be used to include empty fields in
  4039. // Patch requests.
  4040. ForceSendFields []string `json:"-"`
  4041. // NullFields is a list of field names (e.g. "AllowUnregisteredCalls")
  4042. // to include in API requests with the JSON null value. By default,
  4043. // fields with empty values are omitted from API requests. However, any
  4044. // field with an empty value appearing in NullFields will be sent to the
  4045. // server as null. It is an error if a field in this list has a
  4046. // non-empty value. This may be used to include null fields in Patch
  4047. // requests.
  4048. NullFields []string `json:"-"`
  4049. }
  4050. func (s *UsageRule) MarshalJSON() ([]byte, error) {
  4051. type NoMethod UsageRule
  4052. raw := NoMethod(*s)
  4053. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4054. }
  4055. // method id "servicenetworking.operations.cancel":
  4056. type OperationsCancelCall struct {
  4057. s *APIService
  4058. name string
  4059. canceloperationrequest *CancelOperationRequest
  4060. urlParams_ gensupport.URLParams
  4061. ctx_ context.Context
  4062. header_ http.Header
  4063. }
  4064. // Cancel: Starts asynchronous cancellation on a long-running operation.
  4065. // The server
  4066. // makes a best effort to cancel the operation, but success is
  4067. // not
  4068. // guaranteed. If the server doesn't support this method, it
  4069. // returns
  4070. // `google.rpc.Code.UNIMPLEMENTED`. Clients can
  4071. // use
  4072. // Operations.GetOperation or
  4073. // other methods to check whether the cancellation succeeded or whether
  4074. // the
  4075. // operation completed despite cancellation. On successful
  4076. // cancellation,
  4077. // the operation is not deleted; instead, it becomes an operation
  4078. // with
  4079. // an Operation.error value with a google.rpc.Status.code of
  4080. // 1,
  4081. // corresponding to `Code.CANCELLED`.
  4082. func (r *OperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *OperationsCancelCall {
  4083. c := &OperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4084. c.name = name
  4085. c.canceloperationrequest = canceloperationrequest
  4086. return c
  4087. }
  4088. // Fields allows partial responses to be retrieved. See
  4089. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4090. // for more information.
  4091. func (c *OperationsCancelCall) Fields(s ...googleapi.Field) *OperationsCancelCall {
  4092. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4093. return c
  4094. }
  4095. // Context sets the context to be used in this call's Do method. Any
  4096. // pending HTTP request will be aborted if the provided context is
  4097. // canceled.
  4098. func (c *OperationsCancelCall) Context(ctx context.Context) *OperationsCancelCall {
  4099. c.ctx_ = ctx
  4100. return c
  4101. }
  4102. // Header returns an http.Header that can be modified by the caller to
  4103. // add HTTP headers to the request.
  4104. func (c *OperationsCancelCall) Header() http.Header {
  4105. if c.header_ == nil {
  4106. c.header_ = make(http.Header)
  4107. }
  4108. return c.header_
  4109. }
  4110. func (c *OperationsCancelCall) doRequest(alt string) (*http.Response, error) {
  4111. reqHeaders := make(http.Header)
  4112. for k, v := range c.header_ {
  4113. reqHeaders[k] = v
  4114. }
  4115. reqHeaders.Set("User-Agent", c.s.userAgent())
  4116. var body io.Reader = nil
  4117. body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
  4118. if err != nil {
  4119. return nil, err
  4120. }
  4121. reqHeaders.Set("Content-Type", "application/json")
  4122. c.urlParams_.Set("alt", alt)
  4123. c.urlParams_.Set("prettyPrint", "false")
  4124. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel")
  4125. urls += "?" + c.urlParams_.Encode()
  4126. req, err := http.NewRequest("POST", urls, body)
  4127. if err != nil {
  4128. return nil, err
  4129. }
  4130. req.Header = reqHeaders
  4131. googleapi.Expand(req.URL, map[string]string{
  4132. "name": c.name,
  4133. })
  4134. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4135. }
  4136. // Do executes the "servicenetworking.operations.cancel" call.
  4137. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  4138. // code is an error. Response headers are in either
  4139. // *Empty.ServerResponse.Header or (if a response was returned at all)
  4140. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4141. // check whether the returned error was because http.StatusNotModified
  4142. // was returned.
  4143. func (c *OperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  4144. gensupport.SetOptions(c.urlParams_, opts...)
  4145. res, err := c.doRequest("json")
  4146. if res != nil && res.StatusCode == http.StatusNotModified {
  4147. if res.Body != nil {
  4148. res.Body.Close()
  4149. }
  4150. return nil, &googleapi.Error{
  4151. Code: res.StatusCode,
  4152. Header: res.Header,
  4153. }
  4154. }
  4155. if err != nil {
  4156. return nil, err
  4157. }
  4158. defer googleapi.CloseBody(res)
  4159. if err := googleapi.CheckResponse(res); err != nil {
  4160. return nil, err
  4161. }
  4162. ret := &Empty{
  4163. ServerResponse: googleapi.ServerResponse{
  4164. Header: res.Header,
  4165. HTTPStatusCode: res.StatusCode,
  4166. },
  4167. }
  4168. target := &ret
  4169. if err := gensupport.DecodeResponse(target, res); err != nil {
  4170. return nil, err
  4171. }
  4172. return ret, nil
  4173. // {
  4174. // "description": "Starts asynchronous cancellation on a long-running operation. The server\nmakes a best effort to cancel the operation, but success is not\nguaranteed. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`. Clients can use\nOperations.GetOperation or\nother methods to check whether the cancellation succeeded or whether the\noperation completed despite cancellation. On successful cancellation,\nthe operation is not deleted; instead, it becomes an operation with\nan Operation.error value with a google.rpc.Status.code of 1,\ncorresponding to `Code.CANCELLED`.",
  4175. // "flatPath": "v1/operations/{operationsId}:cancel",
  4176. // "httpMethod": "POST",
  4177. // "id": "servicenetworking.operations.cancel",
  4178. // "parameterOrder": [
  4179. // "name"
  4180. // ],
  4181. // "parameters": {
  4182. // "name": {
  4183. // "description": "The name of the operation resource to be cancelled.",
  4184. // "location": "path",
  4185. // "pattern": "^operations/.+$",
  4186. // "required": true,
  4187. // "type": "string"
  4188. // }
  4189. // },
  4190. // "path": "v1/{+name}:cancel",
  4191. // "request": {
  4192. // "$ref": "CancelOperationRequest"
  4193. // },
  4194. // "response": {
  4195. // "$ref": "Empty"
  4196. // },
  4197. // "scopes": [
  4198. // "https://www.googleapis.com/auth/cloud-platform",
  4199. // "https://www.googleapis.com/auth/service.management"
  4200. // ]
  4201. // }
  4202. }
  4203. // method id "servicenetworking.operations.delete":
  4204. type OperationsDeleteCall struct {
  4205. s *APIService
  4206. name string
  4207. urlParams_ gensupport.URLParams
  4208. ctx_ context.Context
  4209. header_ http.Header
  4210. }
  4211. // Delete: Deletes a long-running operation. This method indicates that
  4212. // the client is
  4213. // no longer interested in the operation result. It does not cancel
  4214. // the
  4215. // operation. If the server doesn't support this method, it
  4216. // returns
  4217. // `google.rpc.Code.UNIMPLEMENTED`.
  4218. func (r *OperationsService) Delete(name string) *OperationsDeleteCall {
  4219. c := &OperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4220. c.name = name
  4221. return c
  4222. }
  4223. // Fields allows partial responses to be retrieved. See
  4224. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4225. // for more information.
  4226. func (c *OperationsDeleteCall) Fields(s ...googleapi.Field) *OperationsDeleteCall {
  4227. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4228. return c
  4229. }
  4230. // Context sets the context to be used in this call's Do method. Any
  4231. // pending HTTP request will be aborted if the provided context is
  4232. // canceled.
  4233. func (c *OperationsDeleteCall) Context(ctx context.Context) *OperationsDeleteCall {
  4234. c.ctx_ = ctx
  4235. return c
  4236. }
  4237. // Header returns an http.Header that can be modified by the caller to
  4238. // add HTTP headers to the request.
  4239. func (c *OperationsDeleteCall) Header() http.Header {
  4240. if c.header_ == nil {
  4241. c.header_ = make(http.Header)
  4242. }
  4243. return c.header_
  4244. }
  4245. func (c *OperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  4246. reqHeaders := make(http.Header)
  4247. for k, v := range c.header_ {
  4248. reqHeaders[k] = v
  4249. }
  4250. reqHeaders.Set("User-Agent", c.s.userAgent())
  4251. var body io.Reader = nil
  4252. c.urlParams_.Set("alt", alt)
  4253. c.urlParams_.Set("prettyPrint", "false")
  4254. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  4255. urls += "?" + c.urlParams_.Encode()
  4256. req, err := http.NewRequest("DELETE", urls, body)
  4257. if err != nil {
  4258. return nil, err
  4259. }
  4260. req.Header = reqHeaders
  4261. googleapi.Expand(req.URL, map[string]string{
  4262. "name": c.name,
  4263. })
  4264. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4265. }
  4266. // Do executes the "servicenetworking.operations.delete" call.
  4267. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  4268. // code is an error. Response headers are in either
  4269. // *Empty.ServerResponse.Header or (if a response was returned at all)
  4270. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4271. // check whether the returned error was because http.StatusNotModified
  4272. // was returned.
  4273. func (c *OperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  4274. gensupport.SetOptions(c.urlParams_, opts...)
  4275. res, err := c.doRequest("json")
  4276. if res != nil && res.StatusCode == http.StatusNotModified {
  4277. if res.Body != nil {
  4278. res.Body.Close()
  4279. }
  4280. return nil, &googleapi.Error{
  4281. Code: res.StatusCode,
  4282. Header: res.Header,
  4283. }
  4284. }
  4285. if err != nil {
  4286. return nil, err
  4287. }
  4288. defer googleapi.CloseBody(res)
  4289. if err := googleapi.CheckResponse(res); err != nil {
  4290. return nil, err
  4291. }
  4292. ret := &Empty{
  4293. ServerResponse: googleapi.ServerResponse{
  4294. Header: res.Header,
  4295. HTTPStatusCode: res.StatusCode,
  4296. },
  4297. }
  4298. target := &ret
  4299. if err := gensupport.DecodeResponse(target, res); err != nil {
  4300. return nil, err
  4301. }
  4302. return ret, nil
  4303. // {
  4304. // "description": "Deletes a long-running operation. This method indicates that the client is\nno longer interested in the operation result. It does not cancel the\noperation. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`.",
  4305. // "flatPath": "v1/operations/{operationsId}",
  4306. // "httpMethod": "DELETE",
  4307. // "id": "servicenetworking.operations.delete",
  4308. // "parameterOrder": [
  4309. // "name"
  4310. // ],
  4311. // "parameters": {
  4312. // "name": {
  4313. // "description": "The name of the operation resource to be deleted.",
  4314. // "location": "path",
  4315. // "pattern": "^operations/.+$",
  4316. // "required": true,
  4317. // "type": "string"
  4318. // }
  4319. // },
  4320. // "path": "v1/{+name}",
  4321. // "response": {
  4322. // "$ref": "Empty"
  4323. // },
  4324. // "scopes": [
  4325. // "https://www.googleapis.com/auth/cloud-platform",
  4326. // "https://www.googleapis.com/auth/service.management"
  4327. // ]
  4328. // }
  4329. }
  4330. // method id "servicenetworking.operations.get":
  4331. type OperationsGetCall struct {
  4332. s *APIService
  4333. name string
  4334. urlParams_ gensupport.URLParams
  4335. ifNoneMatch_ string
  4336. ctx_ context.Context
  4337. header_ http.Header
  4338. }
  4339. // Get: Gets the latest state of a long-running operation. Clients can
  4340. // use this
  4341. // method to poll the operation result at intervals as recommended by
  4342. // the API
  4343. // service.
  4344. func (r *OperationsService) Get(name string) *OperationsGetCall {
  4345. c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4346. c.name = name
  4347. return c
  4348. }
  4349. // Fields allows partial responses to be retrieved. See
  4350. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4351. // for more information.
  4352. func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall {
  4353. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4354. return c
  4355. }
  4356. // IfNoneMatch sets the optional parameter which makes the operation
  4357. // fail if the object's ETag matches the given value. This is useful for
  4358. // getting updates only after the object has changed since the last
  4359. // request. Use googleapi.IsNotModified to check whether the response
  4360. // error from Do is the result of In-None-Match.
  4361. func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall {
  4362. c.ifNoneMatch_ = entityTag
  4363. return c
  4364. }
  4365. // Context sets the context to be used in this call's Do method. Any
  4366. // pending HTTP request will be aborted if the provided context is
  4367. // canceled.
  4368. func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall {
  4369. c.ctx_ = ctx
  4370. return c
  4371. }
  4372. // Header returns an http.Header that can be modified by the caller to
  4373. // add HTTP headers to the request.
  4374. func (c *OperationsGetCall) Header() http.Header {
  4375. if c.header_ == nil {
  4376. c.header_ = make(http.Header)
  4377. }
  4378. return c.header_
  4379. }
  4380. func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) {
  4381. reqHeaders := make(http.Header)
  4382. for k, v := range c.header_ {
  4383. reqHeaders[k] = v
  4384. }
  4385. reqHeaders.Set("User-Agent", c.s.userAgent())
  4386. if c.ifNoneMatch_ != "" {
  4387. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4388. }
  4389. var body io.Reader = nil
  4390. c.urlParams_.Set("alt", alt)
  4391. c.urlParams_.Set("prettyPrint", "false")
  4392. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  4393. urls += "?" + c.urlParams_.Encode()
  4394. req, err := http.NewRequest("GET", urls, body)
  4395. if err != nil {
  4396. return nil, err
  4397. }
  4398. req.Header = reqHeaders
  4399. googleapi.Expand(req.URL, map[string]string{
  4400. "name": c.name,
  4401. })
  4402. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4403. }
  4404. // Do executes the "servicenetworking.operations.get" call.
  4405. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4406. // status code is an error. Response headers are in either
  4407. // *Operation.ServerResponse.Header or (if a response was returned at
  4408. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4409. // to check whether the returned error was because
  4410. // http.StatusNotModified was returned.
  4411. func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4412. gensupport.SetOptions(c.urlParams_, opts...)
  4413. res, err := c.doRequest("json")
  4414. if res != nil && res.StatusCode == http.StatusNotModified {
  4415. if res.Body != nil {
  4416. res.Body.Close()
  4417. }
  4418. return nil, &googleapi.Error{
  4419. Code: res.StatusCode,
  4420. Header: res.Header,
  4421. }
  4422. }
  4423. if err != nil {
  4424. return nil, err
  4425. }
  4426. defer googleapi.CloseBody(res)
  4427. if err := googleapi.CheckResponse(res); err != nil {
  4428. return nil, err
  4429. }
  4430. ret := &Operation{
  4431. ServerResponse: googleapi.ServerResponse{
  4432. Header: res.Header,
  4433. HTTPStatusCode: res.StatusCode,
  4434. },
  4435. }
  4436. target := &ret
  4437. if err := gensupport.DecodeResponse(target, res); err != nil {
  4438. return nil, err
  4439. }
  4440. return ret, nil
  4441. // {
  4442. // "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.",
  4443. // "flatPath": "v1/operations/{operationsId}",
  4444. // "httpMethod": "GET",
  4445. // "id": "servicenetworking.operations.get",
  4446. // "parameterOrder": [
  4447. // "name"
  4448. // ],
  4449. // "parameters": {
  4450. // "name": {
  4451. // "description": "The name of the operation resource.",
  4452. // "location": "path",
  4453. // "pattern": "^operations/[^/]+$",
  4454. // "required": true,
  4455. // "type": "string"
  4456. // }
  4457. // },
  4458. // "path": "v1/{+name}",
  4459. // "response": {
  4460. // "$ref": "Operation"
  4461. // },
  4462. // "scopes": [
  4463. // "https://www.googleapis.com/auth/cloud-platform",
  4464. // "https://www.googleapis.com/auth/service.management"
  4465. // ]
  4466. // }
  4467. }
  4468. // method id "servicenetworking.operations.list":
  4469. type OperationsListCall struct {
  4470. s *APIService
  4471. name string
  4472. urlParams_ gensupport.URLParams
  4473. ifNoneMatch_ string
  4474. ctx_ context.Context
  4475. header_ http.Header
  4476. }
  4477. // List: Lists operations that match the specified filter in the
  4478. // request. If the
  4479. // server doesn't support this method, it returns
  4480. // `UNIMPLEMENTED`.
  4481. //
  4482. // NOTE: the `name` binding allows API services to override the
  4483. // binding
  4484. // to use different resource name schemes, such as `users/*/operations`.
  4485. // To
  4486. // override the binding, API services can add a binding such
  4487. // as
  4488. // "/v1/{name=users/*}/operations" to their service configuration.
  4489. // For backwards compatibility, the default name includes the
  4490. // operations
  4491. // collection id, however overriding users must ensure the name
  4492. // binding
  4493. // is the parent resource, without the operations collection id.
  4494. func (r *OperationsService) List(name string) *OperationsListCall {
  4495. c := &OperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4496. c.name = name
  4497. return c
  4498. }
  4499. // Filter sets the optional parameter "filter": The standard list
  4500. // filter.
  4501. func (c *OperationsListCall) Filter(filter string) *OperationsListCall {
  4502. c.urlParams_.Set("filter", filter)
  4503. return c
  4504. }
  4505. // PageSize sets the optional parameter "pageSize": The standard list
  4506. // page size.
  4507. func (c *OperationsListCall) PageSize(pageSize int64) *OperationsListCall {
  4508. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  4509. return c
  4510. }
  4511. // PageToken sets the optional parameter "pageToken": The standard list
  4512. // page token.
  4513. func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall {
  4514. c.urlParams_.Set("pageToken", pageToken)
  4515. return c
  4516. }
  4517. // Fields allows partial responses to be retrieved. See
  4518. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4519. // for more information.
  4520. func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall {
  4521. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4522. return c
  4523. }
  4524. // IfNoneMatch sets the optional parameter which makes the operation
  4525. // fail if the object's ETag matches the given value. This is useful for
  4526. // getting updates only after the object has changed since the last
  4527. // request. Use googleapi.IsNotModified to check whether the response
  4528. // error from Do is the result of In-None-Match.
  4529. func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall {
  4530. c.ifNoneMatch_ = entityTag
  4531. return c
  4532. }
  4533. // Context sets the context to be used in this call's Do method. Any
  4534. // pending HTTP request will be aborted if the provided context is
  4535. // canceled.
  4536. func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall {
  4537. c.ctx_ = ctx
  4538. return c
  4539. }
  4540. // Header returns an http.Header that can be modified by the caller to
  4541. // add HTTP headers to the request.
  4542. func (c *OperationsListCall) Header() http.Header {
  4543. if c.header_ == nil {
  4544. c.header_ = make(http.Header)
  4545. }
  4546. return c.header_
  4547. }
  4548. func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) {
  4549. reqHeaders := make(http.Header)
  4550. for k, v := range c.header_ {
  4551. reqHeaders[k] = v
  4552. }
  4553. reqHeaders.Set("User-Agent", c.s.userAgent())
  4554. if c.ifNoneMatch_ != "" {
  4555. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4556. }
  4557. var body io.Reader = nil
  4558. c.urlParams_.Set("alt", alt)
  4559. c.urlParams_.Set("prettyPrint", "false")
  4560. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  4561. urls += "?" + c.urlParams_.Encode()
  4562. req, err := http.NewRequest("GET", urls, body)
  4563. if err != nil {
  4564. return nil, err
  4565. }
  4566. req.Header = reqHeaders
  4567. googleapi.Expand(req.URL, map[string]string{
  4568. "name": c.name,
  4569. })
  4570. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4571. }
  4572. // Do executes the "servicenetworking.operations.list" call.
  4573. // Exactly one of *ListOperationsResponse or error will be non-nil. Any
  4574. // non-2xx status code is an error. Response headers are in either
  4575. // *ListOperationsResponse.ServerResponse.Header or (if a response was
  4576. // returned at all) in error.(*googleapi.Error).Header. Use
  4577. // googleapi.IsNotModified to check whether the returned error was
  4578. // because http.StatusNotModified was returned.
  4579. func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  4580. gensupport.SetOptions(c.urlParams_, opts...)
  4581. res, err := c.doRequest("json")
  4582. if res != nil && res.StatusCode == http.StatusNotModified {
  4583. if res.Body != nil {
  4584. res.Body.Close()
  4585. }
  4586. return nil, &googleapi.Error{
  4587. Code: res.StatusCode,
  4588. Header: res.Header,
  4589. }
  4590. }
  4591. if err != nil {
  4592. return nil, err
  4593. }
  4594. defer googleapi.CloseBody(res)
  4595. if err := googleapi.CheckResponse(res); err != nil {
  4596. return nil, err
  4597. }
  4598. ret := &ListOperationsResponse{
  4599. ServerResponse: googleapi.ServerResponse{
  4600. Header: res.Header,
  4601. HTTPStatusCode: res.StatusCode,
  4602. },
  4603. }
  4604. target := &ret
  4605. if err := gensupport.DecodeResponse(target, res); err != nil {
  4606. return nil, err
  4607. }
  4608. return ret, nil
  4609. // {
  4610. // "description": "Lists operations that match the specified filter in the request. If the\nserver doesn't support this method, it returns `UNIMPLEMENTED`.\n\nNOTE: the `name` binding allows API services to override the binding\nto use different resource name schemes, such as `users/*/operations`. To\noverride the binding, API services can add a binding such as\n`\"/v1/{name=users/*}/operations\"` to their service configuration.\nFor backwards compatibility, the default name includes the operations\ncollection id, however overriding users must ensure the name binding\nis the parent resource, without the operations collection id.",
  4611. // "flatPath": "v1/operations",
  4612. // "httpMethod": "GET",
  4613. // "id": "servicenetworking.operations.list",
  4614. // "parameterOrder": [
  4615. // "name"
  4616. // ],
  4617. // "parameters": {
  4618. // "filter": {
  4619. // "description": "The standard list filter.",
  4620. // "location": "query",
  4621. // "type": "string"
  4622. // },
  4623. // "name": {
  4624. // "description": "The name of the operation's parent resource.",
  4625. // "location": "path",
  4626. // "pattern": "^operations$",
  4627. // "required": true,
  4628. // "type": "string"
  4629. // },
  4630. // "pageSize": {
  4631. // "description": "The standard list page size.",
  4632. // "format": "int32",
  4633. // "location": "query",
  4634. // "type": "integer"
  4635. // },
  4636. // "pageToken": {
  4637. // "description": "The standard list page token.",
  4638. // "location": "query",
  4639. // "type": "string"
  4640. // }
  4641. // },
  4642. // "path": "v1/{+name}",
  4643. // "response": {
  4644. // "$ref": "ListOperationsResponse"
  4645. // },
  4646. // "scopes": [
  4647. // "https://www.googleapis.com/auth/cloud-platform",
  4648. // "https://www.googleapis.com/auth/service.management"
  4649. // ]
  4650. // }
  4651. }
  4652. // Pages invokes f for each page of results.
  4653. // A non-nil error returned from f will halt the iteration.
  4654. // The provided context supersedes any context provided to the Context method.
  4655. func (c *OperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
  4656. c.ctx_ = ctx
  4657. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4658. for {
  4659. x, err := c.Do()
  4660. if err != nil {
  4661. return err
  4662. }
  4663. if err := f(x); err != nil {
  4664. return err
  4665. }
  4666. if x.NextPageToken == "" {
  4667. return nil
  4668. }
  4669. c.PageToken(x.NextPageToken)
  4670. }
  4671. }
  4672. // method id "servicenetworking.services.addSubnetwork":
  4673. type ServicesAddSubnetworkCall struct {
  4674. s *APIService
  4675. parent string
  4676. addsubnetworkrequest *AddSubnetworkRequest
  4677. urlParams_ gensupport.URLParams
  4678. ctx_ context.Context
  4679. header_ http.Header
  4680. }
  4681. // AddSubnetwork: For service producers, provisions a new subnet in
  4682. // a
  4683. // peered service's shared VPC network in the requested region and with
  4684. // the
  4685. // requested size that's expressed as a CIDR range (number of leading
  4686. // bits of
  4687. // ipV4 network mask). The method checks against the assigned allocated
  4688. // ranges
  4689. // to find a non-conflicting IP address range. The method will reuse a
  4690. // subnet
  4691. // if subsequent calls contain the same subnet name, region, and
  4692. // prefix
  4693. // length. This method will make producer's tenant project to be a
  4694. // shared VPC
  4695. // service project as needed. The response from the `get` operation will
  4696. // be of
  4697. // type `Subnetwork` if the operation successfully completes.
  4698. func (r *ServicesService) AddSubnetwork(parent string, addsubnetworkrequest *AddSubnetworkRequest) *ServicesAddSubnetworkCall {
  4699. c := &ServicesAddSubnetworkCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4700. c.parent = parent
  4701. c.addsubnetworkrequest = addsubnetworkrequest
  4702. return c
  4703. }
  4704. // Fields allows partial responses to be retrieved. See
  4705. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4706. // for more information.
  4707. func (c *ServicesAddSubnetworkCall) Fields(s ...googleapi.Field) *ServicesAddSubnetworkCall {
  4708. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4709. return c
  4710. }
  4711. // Context sets the context to be used in this call's Do method. Any
  4712. // pending HTTP request will be aborted if the provided context is
  4713. // canceled.
  4714. func (c *ServicesAddSubnetworkCall) Context(ctx context.Context) *ServicesAddSubnetworkCall {
  4715. c.ctx_ = ctx
  4716. return c
  4717. }
  4718. // Header returns an http.Header that can be modified by the caller to
  4719. // add HTTP headers to the request.
  4720. func (c *ServicesAddSubnetworkCall) Header() http.Header {
  4721. if c.header_ == nil {
  4722. c.header_ = make(http.Header)
  4723. }
  4724. return c.header_
  4725. }
  4726. func (c *ServicesAddSubnetworkCall) doRequest(alt string) (*http.Response, error) {
  4727. reqHeaders := make(http.Header)
  4728. for k, v := range c.header_ {
  4729. reqHeaders[k] = v
  4730. }
  4731. reqHeaders.Set("User-Agent", c.s.userAgent())
  4732. var body io.Reader = nil
  4733. body, err := googleapi.WithoutDataWrapper.JSONReader(c.addsubnetworkrequest)
  4734. if err != nil {
  4735. return nil, err
  4736. }
  4737. reqHeaders.Set("Content-Type", "application/json")
  4738. c.urlParams_.Set("alt", alt)
  4739. c.urlParams_.Set("prettyPrint", "false")
  4740. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}:addSubnetwork")
  4741. urls += "?" + c.urlParams_.Encode()
  4742. req, err := http.NewRequest("POST", urls, body)
  4743. if err != nil {
  4744. return nil, err
  4745. }
  4746. req.Header = reqHeaders
  4747. googleapi.Expand(req.URL, map[string]string{
  4748. "parent": c.parent,
  4749. })
  4750. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4751. }
  4752. // Do executes the "servicenetworking.services.addSubnetwork" call.
  4753. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4754. // status code is an error. Response headers are in either
  4755. // *Operation.ServerResponse.Header or (if a response was returned at
  4756. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4757. // to check whether the returned error was because
  4758. // http.StatusNotModified was returned.
  4759. func (c *ServicesAddSubnetworkCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4760. gensupport.SetOptions(c.urlParams_, opts...)
  4761. res, err := c.doRequest("json")
  4762. if res != nil && res.StatusCode == http.StatusNotModified {
  4763. if res.Body != nil {
  4764. res.Body.Close()
  4765. }
  4766. return nil, &googleapi.Error{
  4767. Code: res.StatusCode,
  4768. Header: res.Header,
  4769. }
  4770. }
  4771. if err != nil {
  4772. return nil, err
  4773. }
  4774. defer googleapi.CloseBody(res)
  4775. if err := googleapi.CheckResponse(res); err != nil {
  4776. return nil, err
  4777. }
  4778. ret := &Operation{
  4779. ServerResponse: googleapi.ServerResponse{
  4780. Header: res.Header,
  4781. HTTPStatusCode: res.StatusCode,
  4782. },
  4783. }
  4784. target := &ret
  4785. if err := gensupport.DecodeResponse(target, res); err != nil {
  4786. return nil, err
  4787. }
  4788. return ret, nil
  4789. // {
  4790. // "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.",
  4791. // "flatPath": "v1/services/{servicesId}/{servicesId1}/{servicesId2}:addSubnetwork",
  4792. // "httpMethod": "POST",
  4793. // "id": "servicenetworking.services.addSubnetwork",
  4794. // "parameterOrder": [
  4795. // "parent"
  4796. // ],
  4797. // "parameters": {
  4798. // "parent": {
  4799. // "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.",
  4800. // "location": "path",
  4801. // "pattern": "^services/[^/]+/[^/]+/[^/]+$",
  4802. // "required": true,
  4803. // "type": "string"
  4804. // }
  4805. // },
  4806. // "path": "v1/{+parent}:addSubnetwork",
  4807. // "request": {
  4808. // "$ref": "AddSubnetworkRequest"
  4809. // },
  4810. // "response": {
  4811. // "$ref": "Operation"
  4812. // },
  4813. // "scopes": [
  4814. // "https://www.googleapis.com/auth/cloud-platform",
  4815. // "https://www.googleapis.com/auth/service.management"
  4816. // ]
  4817. // }
  4818. }
  4819. // method id "servicenetworking.services.searchRange":
  4820. type ServicesSearchRangeCall struct {
  4821. s *APIService
  4822. parent string
  4823. searchrangerequest *SearchRangeRequest
  4824. urlParams_ gensupport.URLParams
  4825. ctx_ context.Context
  4826. header_ http.Header
  4827. }
  4828. // SearchRange: Service producers can use this method to find a
  4829. // currently unused range
  4830. // within consumer allocated ranges. This returned range is not
  4831. // reserved,
  4832. // and not guaranteed to remain unused.
  4833. // It will validate previously provided allocated ranges,
  4834. // find
  4835. // non-conflicting sub-range of requested size (expressed in
  4836. // number of leading bits of ipv4 network mask, as in CIDR
  4837. // range
  4838. // notation).
  4839. // Operation<response: Range>
  4840. func (r *ServicesService) SearchRange(parent string, searchrangerequest *SearchRangeRequest) *ServicesSearchRangeCall {
  4841. c := &ServicesSearchRangeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4842. c.parent = parent
  4843. c.searchrangerequest = searchrangerequest
  4844. return c
  4845. }
  4846. // Fields allows partial responses to be retrieved. See
  4847. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4848. // for more information.
  4849. func (c *ServicesSearchRangeCall) Fields(s ...googleapi.Field) *ServicesSearchRangeCall {
  4850. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4851. return c
  4852. }
  4853. // Context sets the context to be used in this call's Do method. Any
  4854. // pending HTTP request will be aborted if the provided context is
  4855. // canceled.
  4856. func (c *ServicesSearchRangeCall) Context(ctx context.Context) *ServicesSearchRangeCall {
  4857. c.ctx_ = ctx
  4858. return c
  4859. }
  4860. // Header returns an http.Header that can be modified by the caller to
  4861. // add HTTP headers to the request.
  4862. func (c *ServicesSearchRangeCall) Header() http.Header {
  4863. if c.header_ == nil {
  4864. c.header_ = make(http.Header)
  4865. }
  4866. return c.header_
  4867. }
  4868. func (c *ServicesSearchRangeCall) doRequest(alt string) (*http.Response, error) {
  4869. reqHeaders := make(http.Header)
  4870. for k, v := range c.header_ {
  4871. reqHeaders[k] = v
  4872. }
  4873. reqHeaders.Set("User-Agent", c.s.userAgent())
  4874. var body io.Reader = nil
  4875. body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchrangerequest)
  4876. if err != nil {
  4877. return nil, err
  4878. }
  4879. reqHeaders.Set("Content-Type", "application/json")
  4880. c.urlParams_.Set("alt", alt)
  4881. c.urlParams_.Set("prettyPrint", "false")
  4882. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}:searchRange")
  4883. urls += "?" + c.urlParams_.Encode()
  4884. req, err := http.NewRequest("POST", urls, body)
  4885. if err != nil {
  4886. return nil, err
  4887. }
  4888. req.Header = reqHeaders
  4889. googleapi.Expand(req.URL, map[string]string{
  4890. "parent": c.parent,
  4891. })
  4892. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4893. }
  4894. // Do executes the "servicenetworking.services.searchRange" call.
  4895. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4896. // status code is an error. Response headers are in either
  4897. // *Operation.ServerResponse.Header or (if a response was returned at
  4898. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4899. // to check whether the returned error was because
  4900. // http.StatusNotModified was returned.
  4901. func (c *ServicesSearchRangeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4902. gensupport.SetOptions(c.urlParams_, opts...)
  4903. res, err := c.doRequest("json")
  4904. if res != nil && res.StatusCode == http.StatusNotModified {
  4905. if res.Body != nil {
  4906. res.Body.Close()
  4907. }
  4908. return nil, &googleapi.Error{
  4909. Code: res.StatusCode,
  4910. Header: res.Header,
  4911. }
  4912. }
  4913. if err != nil {
  4914. return nil, err
  4915. }
  4916. defer googleapi.CloseBody(res)
  4917. if err := googleapi.CheckResponse(res); err != nil {
  4918. return nil, err
  4919. }
  4920. ret := &Operation{
  4921. ServerResponse: googleapi.ServerResponse{
  4922. Header: res.Header,
  4923. HTTPStatusCode: res.StatusCode,
  4924. },
  4925. }
  4926. target := &ret
  4927. if err := gensupport.DecodeResponse(target, res); err != nil {
  4928. return nil, err
  4929. }
  4930. return ret, nil
  4931. // {
  4932. // "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",
  4933. // "flatPath": "v1/services/{servicesId}:searchRange",
  4934. // "httpMethod": "POST",
  4935. // "id": "servicenetworking.services.searchRange",
  4936. // "parameterOrder": [
  4937. // "parent"
  4938. // ],
  4939. // "parameters": {
  4940. // "parent": {
  4941. // "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'.",
  4942. // "location": "path",
  4943. // "pattern": "^services/[^/]+$",
  4944. // "required": true,
  4945. // "type": "string"
  4946. // }
  4947. // },
  4948. // "path": "v1/{+parent}:searchRange",
  4949. // "request": {
  4950. // "$ref": "SearchRangeRequest"
  4951. // },
  4952. // "response": {
  4953. // "$ref": "Operation"
  4954. // },
  4955. // "scopes": [
  4956. // "https://www.googleapis.com/auth/cloud-platform",
  4957. // "https://www.googleapis.com/auth/service.management"
  4958. // ]
  4959. // }
  4960. }
  4961. // method id "servicenetworking.services.connections.create":
  4962. type ServicesConnectionsCreateCall struct {
  4963. s *APIService
  4964. parent string
  4965. connection *Connection
  4966. urlParams_ gensupport.URLParams
  4967. ctx_ context.Context
  4968. header_ http.Header
  4969. }
  4970. // Create: Creates a private connection that establishes a VPC Network
  4971. // Peering
  4972. // connection to a VPC network in the service producer's
  4973. // organization.
  4974. // The administrator of the service consumer's VPC network invokes
  4975. // this
  4976. // method. The administrator must assign one or more allocated IP ranges
  4977. // for
  4978. // provisioning subnetworks in the service producer's VPC network.
  4979. // This
  4980. // connection is used for all supported services in the service
  4981. // producer's
  4982. // organization, so it only needs to be invoked once. The response from
  4983. // the
  4984. // `get` operation will be of type `Connection` if the operation
  4985. // successfully
  4986. // completes.
  4987. func (r *ServicesConnectionsService) Create(parent string, connection *Connection) *ServicesConnectionsCreateCall {
  4988. c := &ServicesConnectionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4989. c.parent = parent
  4990. c.connection = connection
  4991. return c
  4992. }
  4993. // Fields allows partial responses to be retrieved. See
  4994. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4995. // for more information.
  4996. func (c *ServicesConnectionsCreateCall) Fields(s ...googleapi.Field) *ServicesConnectionsCreateCall {
  4997. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4998. return c
  4999. }
  5000. // Context sets the context to be used in this call's Do method. Any
  5001. // pending HTTP request will be aborted if the provided context is
  5002. // canceled.
  5003. func (c *ServicesConnectionsCreateCall) Context(ctx context.Context) *ServicesConnectionsCreateCall {
  5004. c.ctx_ = ctx
  5005. return c
  5006. }
  5007. // Header returns an http.Header that can be modified by the caller to
  5008. // add HTTP headers to the request.
  5009. func (c *ServicesConnectionsCreateCall) Header() http.Header {
  5010. if c.header_ == nil {
  5011. c.header_ = make(http.Header)
  5012. }
  5013. return c.header_
  5014. }
  5015. func (c *ServicesConnectionsCreateCall) doRequest(alt string) (*http.Response, error) {
  5016. reqHeaders := make(http.Header)
  5017. for k, v := range c.header_ {
  5018. reqHeaders[k] = v
  5019. }
  5020. reqHeaders.Set("User-Agent", c.s.userAgent())
  5021. var body io.Reader = nil
  5022. body, err := googleapi.WithoutDataWrapper.JSONReader(c.connection)
  5023. if err != nil {
  5024. return nil, err
  5025. }
  5026. reqHeaders.Set("Content-Type", "application/json")
  5027. c.urlParams_.Set("alt", alt)
  5028. c.urlParams_.Set("prettyPrint", "false")
  5029. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/connections")
  5030. urls += "?" + c.urlParams_.Encode()
  5031. req, err := http.NewRequest("POST", urls, body)
  5032. if err != nil {
  5033. return nil, err
  5034. }
  5035. req.Header = reqHeaders
  5036. googleapi.Expand(req.URL, map[string]string{
  5037. "parent": c.parent,
  5038. })
  5039. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5040. }
  5041. // Do executes the "servicenetworking.services.connections.create" call.
  5042. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5043. // status code is an error. Response headers are in either
  5044. // *Operation.ServerResponse.Header or (if a response was returned at
  5045. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5046. // to check whether the returned error was because
  5047. // http.StatusNotModified was returned.
  5048. func (c *ServicesConnectionsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5049. gensupport.SetOptions(c.urlParams_, opts...)
  5050. res, err := c.doRequest("json")
  5051. if res != nil && res.StatusCode == http.StatusNotModified {
  5052. if res.Body != nil {
  5053. res.Body.Close()
  5054. }
  5055. return nil, &googleapi.Error{
  5056. Code: res.StatusCode,
  5057. Header: res.Header,
  5058. }
  5059. }
  5060. if err != nil {
  5061. return nil, err
  5062. }
  5063. defer googleapi.CloseBody(res)
  5064. if err := googleapi.CheckResponse(res); err != nil {
  5065. return nil, err
  5066. }
  5067. ret := &Operation{
  5068. ServerResponse: googleapi.ServerResponse{
  5069. Header: res.Header,
  5070. HTTPStatusCode: res.StatusCode,
  5071. },
  5072. }
  5073. target := &ret
  5074. if err := gensupport.DecodeResponse(target, res); err != nil {
  5075. return nil, err
  5076. }
  5077. return ret, nil
  5078. // {
  5079. // "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.",
  5080. // "flatPath": "v1/services/{servicesId}/connections",
  5081. // "httpMethod": "POST",
  5082. // "id": "servicenetworking.services.connections.create",
  5083. // "parameterOrder": [
  5084. // "parent"
  5085. // ],
  5086. // "parameters": {
  5087. // "parent": {
  5088. // "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`.",
  5089. // "location": "path",
  5090. // "pattern": "^services/[^/]+$",
  5091. // "required": true,
  5092. // "type": "string"
  5093. // }
  5094. // },
  5095. // "path": "v1/{+parent}/connections",
  5096. // "request": {
  5097. // "$ref": "Connection"
  5098. // },
  5099. // "response": {
  5100. // "$ref": "Operation"
  5101. // },
  5102. // "scopes": [
  5103. // "https://www.googleapis.com/auth/cloud-platform",
  5104. // "https://www.googleapis.com/auth/service.management"
  5105. // ]
  5106. // }
  5107. }
  5108. // method id "servicenetworking.services.connections.list":
  5109. type ServicesConnectionsListCall struct {
  5110. s *APIService
  5111. parent string
  5112. urlParams_ gensupport.URLParams
  5113. ifNoneMatch_ string
  5114. ctx_ context.Context
  5115. header_ http.Header
  5116. }
  5117. // List: List the private connections that are configured in a service
  5118. // consumer's
  5119. // VPC network.
  5120. func (r *ServicesConnectionsService) List(parent string) *ServicesConnectionsListCall {
  5121. c := &ServicesConnectionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5122. c.parent = parent
  5123. return c
  5124. }
  5125. // Network sets the optional parameter "network": The name of service
  5126. // consumer's VPC network that's connected with service
  5127. // producer network through a private connection. The network name must
  5128. // be in
  5129. // the following format:
  5130. // `projects/{project}/global/networks/{network}`. {project} is
  5131. // a
  5132. // project number, such as in `12345` that includes the VPC
  5133. // service
  5134. // consumer's VPC network. {network} is the name of the service
  5135. // consumer's VPC
  5136. // network.
  5137. func (c *ServicesConnectionsListCall) Network(network string) *ServicesConnectionsListCall {
  5138. c.urlParams_.Set("network", network)
  5139. return c
  5140. }
  5141. // Fields allows partial responses to be retrieved. See
  5142. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5143. // for more information.
  5144. func (c *ServicesConnectionsListCall) Fields(s ...googleapi.Field) *ServicesConnectionsListCall {
  5145. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5146. return c
  5147. }
  5148. // IfNoneMatch sets the optional parameter which makes the operation
  5149. // fail if the object's ETag matches the given value. This is useful for
  5150. // getting updates only after the object has changed since the last
  5151. // request. Use googleapi.IsNotModified to check whether the response
  5152. // error from Do is the result of In-None-Match.
  5153. func (c *ServicesConnectionsListCall) IfNoneMatch(entityTag string) *ServicesConnectionsListCall {
  5154. c.ifNoneMatch_ = entityTag
  5155. return c
  5156. }
  5157. // Context sets the context to be used in this call's Do method. Any
  5158. // pending HTTP request will be aborted if the provided context is
  5159. // canceled.
  5160. func (c *ServicesConnectionsListCall) Context(ctx context.Context) *ServicesConnectionsListCall {
  5161. c.ctx_ = ctx
  5162. return c
  5163. }
  5164. // Header returns an http.Header that can be modified by the caller to
  5165. // add HTTP headers to the request.
  5166. func (c *ServicesConnectionsListCall) Header() http.Header {
  5167. if c.header_ == nil {
  5168. c.header_ = make(http.Header)
  5169. }
  5170. return c.header_
  5171. }
  5172. func (c *ServicesConnectionsListCall) doRequest(alt string) (*http.Response, error) {
  5173. reqHeaders := make(http.Header)
  5174. for k, v := range c.header_ {
  5175. reqHeaders[k] = v
  5176. }
  5177. reqHeaders.Set("User-Agent", c.s.userAgent())
  5178. if c.ifNoneMatch_ != "" {
  5179. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5180. }
  5181. var body io.Reader = nil
  5182. c.urlParams_.Set("alt", alt)
  5183. c.urlParams_.Set("prettyPrint", "false")
  5184. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/connections")
  5185. urls += "?" + c.urlParams_.Encode()
  5186. req, err := http.NewRequest("GET", urls, body)
  5187. if err != nil {
  5188. return nil, err
  5189. }
  5190. req.Header = reqHeaders
  5191. googleapi.Expand(req.URL, map[string]string{
  5192. "parent": c.parent,
  5193. })
  5194. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5195. }
  5196. // Do executes the "servicenetworking.services.connections.list" call.
  5197. // Exactly one of *ListConnectionsResponse or error will be non-nil. Any
  5198. // non-2xx status code is an error. Response headers are in either
  5199. // *ListConnectionsResponse.ServerResponse.Header or (if a response was
  5200. // returned at all) in error.(*googleapi.Error).Header. Use
  5201. // googleapi.IsNotModified to check whether the returned error was
  5202. // because http.StatusNotModified was returned.
  5203. func (c *ServicesConnectionsListCall) Do(opts ...googleapi.CallOption) (*ListConnectionsResponse, error) {
  5204. gensupport.SetOptions(c.urlParams_, opts...)
  5205. res, err := c.doRequest("json")
  5206. if res != nil && res.StatusCode == http.StatusNotModified {
  5207. if res.Body != nil {
  5208. res.Body.Close()
  5209. }
  5210. return nil, &googleapi.Error{
  5211. Code: res.StatusCode,
  5212. Header: res.Header,
  5213. }
  5214. }
  5215. if err != nil {
  5216. return nil, err
  5217. }
  5218. defer googleapi.CloseBody(res)
  5219. if err := googleapi.CheckResponse(res); err != nil {
  5220. return nil, err
  5221. }
  5222. ret := &ListConnectionsResponse{
  5223. ServerResponse: googleapi.ServerResponse{
  5224. Header: res.Header,
  5225. HTTPStatusCode: res.StatusCode,
  5226. },
  5227. }
  5228. target := &ret
  5229. if err := gensupport.DecodeResponse(target, res); err != nil {
  5230. return nil, err
  5231. }
  5232. return ret, nil
  5233. // {
  5234. // "description": "List the private connections that are configured in a service consumer's\nVPC network.",
  5235. // "flatPath": "v1/services/{servicesId}/connections",
  5236. // "httpMethod": "GET",
  5237. // "id": "servicenetworking.services.connections.list",
  5238. // "parameterOrder": [
  5239. // "parent"
  5240. // ],
  5241. // "parameters": {
  5242. // "network": {
  5243. // "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.",
  5244. // "location": "query",
  5245. // "type": "string"
  5246. // },
  5247. // "parent": {
  5248. // "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 `services/-` as the parameter value, all configured peering\nservices are listed.",
  5249. // "location": "path",
  5250. // "pattern": "^services/[^/]+$",
  5251. // "required": true,
  5252. // "type": "string"
  5253. // }
  5254. // },
  5255. // "path": "v1/{+parent}/connections",
  5256. // "response": {
  5257. // "$ref": "ListConnectionsResponse"
  5258. // },
  5259. // "scopes": [
  5260. // "https://www.googleapis.com/auth/cloud-platform",
  5261. // "https://www.googleapis.com/auth/service.management"
  5262. // ]
  5263. // }
  5264. }
  5265. // method id "servicenetworking.services.connections.patch":
  5266. type ServicesConnectionsPatchCall struct {
  5267. s *APIService
  5268. name string
  5269. connection *Connection
  5270. urlParams_ gensupport.URLParams
  5271. ctx_ context.Context
  5272. header_ http.Header
  5273. }
  5274. // Patch: Updates the allocated ranges that are assigned to a
  5275. // connection.
  5276. // The response from the `get` operation will be of type `Connection` if
  5277. // the
  5278. // operation successfully completes.
  5279. func (r *ServicesConnectionsService) Patch(name string, connection *Connection) *ServicesConnectionsPatchCall {
  5280. c := &ServicesConnectionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5281. c.name = name
  5282. c.connection = connection
  5283. return c
  5284. }
  5285. // Force sets the optional parameter "force": If a previously defined
  5286. // allocated range is removed, force flag must be
  5287. // set to true.
  5288. func (c *ServicesConnectionsPatchCall) Force(force bool) *ServicesConnectionsPatchCall {
  5289. c.urlParams_.Set("force", fmt.Sprint(force))
  5290. return c
  5291. }
  5292. // UpdateMask sets the optional parameter "updateMask": The update mask.
  5293. // If this is omitted, it defaults to "*". You can only
  5294. // update the listed peering ranges.
  5295. func (c *ServicesConnectionsPatchCall) UpdateMask(updateMask string) *ServicesConnectionsPatchCall {
  5296. c.urlParams_.Set("updateMask", updateMask)
  5297. return c
  5298. }
  5299. // Fields allows partial responses to be retrieved. See
  5300. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5301. // for more information.
  5302. func (c *ServicesConnectionsPatchCall) Fields(s ...googleapi.Field) *ServicesConnectionsPatchCall {
  5303. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5304. return c
  5305. }
  5306. // Context sets the context to be used in this call's Do method. Any
  5307. // pending HTTP request will be aborted if the provided context is
  5308. // canceled.
  5309. func (c *ServicesConnectionsPatchCall) Context(ctx context.Context) *ServicesConnectionsPatchCall {
  5310. c.ctx_ = ctx
  5311. return c
  5312. }
  5313. // Header returns an http.Header that can be modified by the caller to
  5314. // add HTTP headers to the request.
  5315. func (c *ServicesConnectionsPatchCall) Header() http.Header {
  5316. if c.header_ == nil {
  5317. c.header_ = make(http.Header)
  5318. }
  5319. return c.header_
  5320. }
  5321. func (c *ServicesConnectionsPatchCall) doRequest(alt string) (*http.Response, error) {
  5322. reqHeaders := make(http.Header)
  5323. for k, v := range c.header_ {
  5324. reqHeaders[k] = v
  5325. }
  5326. reqHeaders.Set("User-Agent", c.s.userAgent())
  5327. var body io.Reader = nil
  5328. body, err := googleapi.WithoutDataWrapper.JSONReader(c.connection)
  5329. if err != nil {
  5330. return nil, err
  5331. }
  5332. reqHeaders.Set("Content-Type", "application/json")
  5333. c.urlParams_.Set("alt", alt)
  5334. c.urlParams_.Set("prettyPrint", "false")
  5335. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  5336. urls += "?" + c.urlParams_.Encode()
  5337. req, err := http.NewRequest("PATCH", urls, body)
  5338. if err != nil {
  5339. return nil, err
  5340. }
  5341. req.Header = reqHeaders
  5342. googleapi.Expand(req.URL, map[string]string{
  5343. "name": c.name,
  5344. })
  5345. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5346. }
  5347. // Do executes the "servicenetworking.services.connections.patch" call.
  5348. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5349. // status code is an error. Response headers are in either
  5350. // *Operation.ServerResponse.Header or (if a response was returned at
  5351. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5352. // to check whether the returned error was because
  5353. // http.StatusNotModified was returned.
  5354. func (c *ServicesConnectionsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5355. gensupport.SetOptions(c.urlParams_, opts...)
  5356. res, err := c.doRequest("json")
  5357. if res != nil && res.StatusCode == http.StatusNotModified {
  5358. if res.Body != nil {
  5359. res.Body.Close()
  5360. }
  5361. return nil, &googleapi.Error{
  5362. Code: res.StatusCode,
  5363. Header: res.Header,
  5364. }
  5365. }
  5366. if err != nil {
  5367. return nil, err
  5368. }
  5369. defer googleapi.CloseBody(res)
  5370. if err := googleapi.CheckResponse(res); err != nil {
  5371. return nil, err
  5372. }
  5373. ret := &Operation{
  5374. ServerResponse: googleapi.ServerResponse{
  5375. Header: res.Header,
  5376. HTTPStatusCode: res.StatusCode,
  5377. },
  5378. }
  5379. target := &ret
  5380. if err := gensupport.DecodeResponse(target, res); err != nil {
  5381. return nil, err
  5382. }
  5383. return ret, nil
  5384. // {
  5385. // "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.",
  5386. // "flatPath": "v1/services/{servicesId}/connections/{connectionsId}",
  5387. // "httpMethod": "PATCH",
  5388. // "id": "servicenetworking.services.connections.patch",
  5389. // "parameterOrder": [
  5390. // "name"
  5391. // ],
  5392. // "parameters": {
  5393. // "force": {
  5394. // "description": "If a previously defined allocated range is removed, force flag must be\nset to true.",
  5395. // "location": "query",
  5396. // "type": "boolean"
  5397. // },
  5398. // "name": {
  5399. // "description": "The private service connection that connects to a service producer\norganization. The name includes both the private service name and the VPC\nnetwork peering name in the format of\n`services/{peering_service_name}/connections/{vpc_peering_name}`. For\nGoogle services that support this functionality, this is\n`services/servicenetworking.googleapis.com/connections/servicenetworking-googleapis-com`.",
  5400. // "location": "path",
  5401. // "pattern": "^services/[^/]+/connections/[^/]+$",
  5402. // "required": true,
  5403. // "type": "string"
  5404. // },
  5405. // "updateMask": {
  5406. // "description": "The update mask. If this is omitted, it defaults to \"*\". You can only\nupdate the listed peering ranges.",
  5407. // "format": "google-fieldmask",
  5408. // "location": "query",
  5409. // "type": "string"
  5410. // }
  5411. // },
  5412. // "path": "v1/{+name}",
  5413. // "request": {
  5414. // "$ref": "Connection"
  5415. // },
  5416. // "response": {
  5417. // "$ref": "Operation"
  5418. // },
  5419. // "scopes": [
  5420. // "https://www.googleapis.com/auth/cloud-platform",
  5421. // "https://www.googleapis.com/auth/service.management"
  5422. // ]
  5423. // }
  5424. }