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.
 
 
 

3371 lines
130 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 servicecontrol provides access to the Service Control API.
  6. //
  7. // For product documentation, see: https://cloud.google.com/service-control/
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/servicecontrol/v1"
  14. // ...
  15. // ctx := context.Background()
  16. // servicecontrolService, err := servicecontrol.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. // servicecontrolService, err := servicecontrol.NewService(ctx, option.WithScopes(servicecontrol.ServicecontrolScope))
  27. //
  28. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  29. //
  30. // servicecontrolService, err := servicecontrol.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. // servicecontrolService, err := servicecontrol.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 servicecontrol // import "google.golang.org/api/servicecontrol/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 = "servicecontrol:v1"
  71. const apiName = "servicecontrol"
  72. const apiVersion = "v1"
  73. const basePath = "https://servicecontrol.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 Service Control data
  79. ServicecontrolScope = "https://www.googleapis.com/auth/servicecontrol"
  80. )
  81. // NewService creates a new Service.
  82. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  83. scopesOption := option.WithScopes(
  84. "https://www.googleapis.com/auth/cloud-platform",
  85. "https://www.googleapis.com/auth/servicecontrol",
  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 Service. 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) (*Service, error) {
  108. if client == nil {
  109. return nil, errors.New("client is nil")
  110. }
  111. s := &Service{client: client, BasePath: basePath}
  112. s.Services = NewServicesService(s)
  113. return s, nil
  114. }
  115. type Service struct {
  116. client *http.Client
  117. BasePath string // API endpoint base URL
  118. UserAgent string // optional additional User-Agent fragment
  119. Services *ServicesService
  120. }
  121. func (s *Service) userAgent() string {
  122. if s.UserAgent == "" {
  123. return googleapi.UserAgent
  124. }
  125. return googleapi.UserAgent + " " + s.UserAgent
  126. }
  127. func NewServicesService(s *Service) *ServicesService {
  128. rs := &ServicesService{s: s}
  129. return rs
  130. }
  131. type ServicesService struct {
  132. s *Service
  133. }
  134. type AllocateInfo struct {
  135. // UnusedArguments: A list of label keys that were unused by the server
  136. // in processing the
  137. // request. Thus, for similar requests repeated in a certain future
  138. // time
  139. // window, the caller can choose to ignore these labels in the
  140. // requests
  141. // to achieve better client-side cache hits and quota aggregation.
  142. UnusedArguments []string `json:"unusedArguments,omitempty"`
  143. // ForceSendFields is a list of field names (e.g. "UnusedArguments") to
  144. // unconditionally include in API requests. By default, fields with
  145. // empty values are omitted from API requests. However, any non-pointer,
  146. // non-interface field appearing in ForceSendFields will be sent to the
  147. // server regardless of whether the field is empty or not. This may be
  148. // used to include empty fields in Patch requests.
  149. ForceSendFields []string `json:"-"`
  150. // NullFields is a list of field names (e.g. "UnusedArguments") to
  151. // include in API requests with the JSON null value. By default, fields
  152. // with empty values are omitted from API requests. However, any field
  153. // with an empty value appearing in NullFields will be sent to the
  154. // server as null. It is an error if a field in this list has a
  155. // non-empty value. This may be used to include null fields in Patch
  156. // requests.
  157. NullFields []string `json:"-"`
  158. }
  159. func (s *AllocateInfo) MarshalJSON() ([]byte, error) {
  160. type NoMethod AllocateInfo
  161. raw := NoMethod(*s)
  162. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  163. }
  164. // AllocateQuotaRequest: Request message for the AllocateQuota method.
  165. type AllocateQuotaRequest struct {
  166. // AllocateOperation: Operation that describes the quota allocation.
  167. AllocateOperation *QuotaOperation `json:"allocateOperation,omitempty"`
  168. // ServiceConfigId: Specifies which version of service configuration
  169. // should be used to process
  170. // the request. If unspecified or no matching version can be found, the
  171. // latest
  172. // one will be used.
  173. ServiceConfigId string `json:"serviceConfigId,omitempty"`
  174. // ForceSendFields is a list of field names (e.g. "AllocateOperation")
  175. // to unconditionally include in API requests. By default, fields with
  176. // empty values are omitted from API requests. However, any non-pointer,
  177. // non-interface field appearing in ForceSendFields will be sent to the
  178. // server regardless of whether the field is empty or not. This may be
  179. // used to include empty fields in Patch requests.
  180. ForceSendFields []string `json:"-"`
  181. // NullFields is a list of field names (e.g. "AllocateOperation") to
  182. // include in API requests with the JSON null value. By default, fields
  183. // with empty values are omitted from API requests. However, any field
  184. // with an empty value appearing in NullFields will be sent to the
  185. // server as null. It is an error if a field in this list has a
  186. // non-empty value. This may be used to include null fields in Patch
  187. // requests.
  188. NullFields []string `json:"-"`
  189. }
  190. func (s *AllocateQuotaRequest) MarshalJSON() ([]byte, error) {
  191. type NoMethod AllocateQuotaRequest
  192. raw := NoMethod(*s)
  193. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  194. }
  195. // AllocateQuotaResponse: Response message for the AllocateQuota method.
  196. type AllocateQuotaResponse struct {
  197. // AllocateErrors: Indicates the decision of the allocate.
  198. AllocateErrors []*QuotaError `json:"allocateErrors,omitempty"`
  199. // AllocateInfo: WARNING: DO NOT use this field until this warning
  200. // message is removed.
  201. AllocateInfo *AllocateInfo `json:"allocateInfo,omitempty"`
  202. // OperationId: The same operation_id value used in the
  203. // AllocateQuotaRequest. Used for
  204. // logging and diagnostics purposes.
  205. OperationId string `json:"operationId,omitempty"`
  206. // QuotaMetrics: Quota metrics to indicate the result of allocation.
  207. // Depending on the
  208. // request, one or more of the following metrics will be included:
  209. //
  210. // 1. Per quota group or per quota metric incremental usage will be
  211. // specified
  212. // using the following delta metric :
  213. // "serviceruntime.googleapis.com/api/consumer/quota_used_count"
  214. //
  215. // 2. The quota limit reached condition will be specified using the
  216. // following
  217. // boolean metric :
  218. // "serviceruntime.googleapis.com/quota/exceeded"
  219. QuotaMetrics []*MetricValueSet `json:"quotaMetrics,omitempty"`
  220. // ServiceConfigId: ID of the actual config used to process the request.
  221. ServiceConfigId string `json:"serviceConfigId,omitempty"`
  222. // ServerResponse contains the HTTP response code and headers from the
  223. // server.
  224. googleapi.ServerResponse `json:"-"`
  225. // ForceSendFields is a list of field names (e.g. "AllocateErrors") to
  226. // unconditionally include in API requests. By default, fields with
  227. // empty values are omitted from API requests. However, any non-pointer,
  228. // non-interface field appearing in ForceSendFields will be sent to the
  229. // server regardless of whether the field is empty or not. This may be
  230. // used to include empty fields in Patch requests.
  231. ForceSendFields []string `json:"-"`
  232. // NullFields is a list of field names (e.g. "AllocateErrors") to
  233. // include in API requests with the JSON null value. By default, fields
  234. // with empty values are omitted from API requests. However, any field
  235. // with an empty value appearing in NullFields will be sent to the
  236. // server as null. It is an error if a field in this list has a
  237. // non-empty value. This may be used to include null fields in Patch
  238. // requests.
  239. NullFields []string `json:"-"`
  240. }
  241. func (s *AllocateQuotaResponse) MarshalJSON() ([]byte, error) {
  242. type NoMethod AllocateQuotaResponse
  243. raw := NoMethod(*s)
  244. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  245. }
  246. // AuditLog: Common audit log format for Google Cloud Platform API
  247. // operations.
  248. //
  249. //
  250. //
  251. type AuditLog struct {
  252. // AuthenticationInfo: Authentication information.
  253. AuthenticationInfo *AuthenticationInfo `json:"authenticationInfo,omitempty"`
  254. // AuthorizationInfo: Authorization information. If there are
  255. // multiple
  256. // resources or permissions involved, then there is
  257. // one AuthorizationInfo element for each {resource, permission} tuple.
  258. AuthorizationInfo []*AuthorizationInfo `json:"authorizationInfo,omitempty"`
  259. // Metadata: Other service-specific data about the request, response,
  260. // and other
  261. // information associated with the current audited event.
  262. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  263. // MethodName: The name of the service method or operation.
  264. // For API calls, this should be the name of the API method.
  265. // For example,
  266. //
  267. // "google.datastore.v1.Datastore.RunQuery"
  268. // "google.logging.v1.LoggingService.DeleteLog"
  269. MethodName string `json:"methodName,omitempty"`
  270. // NumResponseItems: The number of items returned from a List or Query
  271. // API method,
  272. // if applicable.
  273. NumResponseItems int64 `json:"numResponseItems,omitempty,string"`
  274. // Request: The operation request. This may not include all request
  275. // parameters,
  276. // such as those that are too large, privacy-sensitive, or
  277. // duplicated
  278. // elsewhere in the log record.
  279. // It should never include user-generated data, such as file
  280. // contents.
  281. // When the JSON object represented here has a proto equivalent, the
  282. // proto
  283. // name will be indicated in the `@type` property.
  284. Request googleapi.RawMessage `json:"request,omitempty"`
  285. // RequestMetadata: Metadata about the operation.
  286. RequestMetadata *RequestMetadata `json:"requestMetadata,omitempty"`
  287. // ResourceLocation: The resource location information.
  288. ResourceLocation *ResourceLocation `json:"resourceLocation,omitempty"`
  289. // ResourceName: The resource or collection that is the target of the
  290. // operation.
  291. // The name is a scheme-less URI, not including the API service
  292. // name.
  293. // For example:
  294. //
  295. // "shelves/SHELF_ID/books"
  296. // "shelves/SHELF_ID/books/BOOK_ID"
  297. ResourceName string `json:"resourceName,omitempty"`
  298. // ResourceOriginalState: The resource's original state before mutation.
  299. // Present only for
  300. // operations which have successfully modified the targeted
  301. // resource(s).
  302. // In general, this field should contain all changed fields, except
  303. // those
  304. // that are already been included in `request`, `response`, `metadata`
  305. // or
  306. // `service_data` fields.
  307. // When the JSON object represented here has a proto equivalent,
  308. // the proto name will be indicated in the `@type` property.
  309. ResourceOriginalState googleapi.RawMessage `json:"resourceOriginalState,omitempty"`
  310. // Response: The operation response. This may not include all response
  311. // elements,
  312. // such as those that are too large, privacy-sensitive, or
  313. // duplicated
  314. // elsewhere in the log record.
  315. // It should never include user-generated data, such as file
  316. // contents.
  317. // When the JSON object represented here has a proto equivalent, the
  318. // proto
  319. // name will be indicated in the `@type` property.
  320. Response googleapi.RawMessage `json:"response,omitempty"`
  321. // ServiceData: Deprecated, use `metadata` field instead.
  322. // Other service-specific data about the request, response, and
  323. // other
  324. // activities.
  325. ServiceData googleapi.RawMessage `json:"serviceData,omitempty"`
  326. // ServiceName: The name of the API service performing the operation.
  327. // For example,
  328. // "datastore.googleapis.com".
  329. ServiceName string `json:"serviceName,omitempty"`
  330. // Status: The status of the overall operation.
  331. Status *Status `json:"status,omitempty"`
  332. // ForceSendFields is a list of field names (e.g. "AuthenticationInfo")
  333. // to unconditionally include in API requests. By default, fields with
  334. // empty values are omitted from API requests. However, any non-pointer,
  335. // non-interface field appearing in ForceSendFields will be sent to the
  336. // server regardless of whether the field is empty or not. This may be
  337. // used to include empty fields in Patch requests.
  338. ForceSendFields []string `json:"-"`
  339. // NullFields is a list of field names (e.g. "AuthenticationInfo") to
  340. // include in API requests with the JSON null value. By default, fields
  341. // with empty values are omitted from API requests. However, any field
  342. // with an empty value appearing in NullFields will be sent to the
  343. // server as null. It is an error if a field in this list has a
  344. // non-empty value. This may be used to include null fields in Patch
  345. // requests.
  346. NullFields []string `json:"-"`
  347. }
  348. func (s *AuditLog) MarshalJSON() ([]byte, error) {
  349. type NoMethod AuditLog
  350. raw := NoMethod(*s)
  351. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  352. }
  353. // Auth: This message defines request authentication attributes.
  354. // Terminology is
  355. // based on the JSON Web Token (JWT) standard, but the terms
  356. // also
  357. // correlate to concepts in other standards.
  358. type Auth struct {
  359. // AccessLevels: A list of access level resource names that allow
  360. // resources to be
  361. // accessed by authenticated requester. It is part of Secure GCP
  362. // processing
  363. // for the incoming request. An access level string has the
  364. // format:
  365. // "//{api_service_name}/accessPolicies/{policy_id}/accessLevels/
  366. // {short_name}"
  367. //
  368. // Example:
  369. // "//accesscontextmanager.googleapis.com/accessP
  370. // olicies/MY_POLICY_ID/accessLevels/MY_LEVEL"
  371. AccessLevels []string `json:"accessLevels,omitempty"`
  372. // Audiences: The intended audience(s) for this authentication
  373. // information. Reflects
  374. // the audience (`aud`) claim within a JWT. The audience
  375. // value(s) depends on the `issuer`, but typically include one or more
  376. // of
  377. // the following pieces of information:
  378. //
  379. // * The services intended to receive the credential such as
  380. // ["pubsub.googleapis.com", "storage.googleapis.com"]
  381. // * A set of service-based scopes. For example,
  382. // ["https://www.googleapis.com/auth/cloud-platform"]
  383. // * The client id of an app, such as the Firebase project id for JWTs
  384. // from Firebase Auth.
  385. //
  386. // Consult the documentation for the credential issuer to determine
  387. // the
  388. // information provided.
  389. Audiences []string `json:"audiences,omitempty"`
  390. // Claims: Structured claims presented with the credential. JWTs
  391. // include
  392. // `{key: value}` pairs for standard and private claims. The
  393. // following
  394. // is a subset of the standard required and optional claims that
  395. // would
  396. // typically be presented for a Google-based JWT:
  397. //
  398. // {'iss': 'accounts.google.com',
  399. // 'sub': '113289723416554971153',
  400. // 'aud': ['123456789012', 'pubsub.googleapis.com'],
  401. // 'azp': '123456789012.apps.googleusercontent.com',
  402. // 'email': 'jsmith@example.com',
  403. // 'iat': 1353601026,
  404. // 'exp': 1353604926}
  405. //
  406. // SAML assertions are similarly specified, but with an identity
  407. // provider
  408. // dependent structure.
  409. Claims googleapi.RawMessage `json:"claims,omitempty"`
  410. // Presenter: The authorized presenter of the credential. Reflects the
  411. // optional
  412. // Authorized Presenter (`azp`) claim within a JWT or the
  413. // OAuth client id. For example, a Google Cloud Platform client id
  414. // looks
  415. // as follows: "123456789012.apps.googleusercontent.com".
  416. Presenter string `json:"presenter,omitempty"`
  417. // Principal: The authenticated principal. Reflects the issuer (`iss`)
  418. // and subject
  419. // (`sub`) claims within a JWT. The issuer and subject should be
  420. // `/`
  421. // delimited, with `/` percent-encoded within the subject fragment.
  422. // For
  423. // Google accounts, the principal format
  424. // is:
  425. // "https://accounts.google.com/{id}"
  426. Principal string `json:"principal,omitempty"`
  427. // ForceSendFields is a list of field names (e.g. "AccessLevels") to
  428. // unconditionally include in API requests. By default, fields with
  429. // empty values are omitted from API requests. However, any non-pointer,
  430. // non-interface field appearing in ForceSendFields will be sent to the
  431. // server regardless of whether the field is empty or not. This may be
  432. // used to include empty fields in Patch requests.
  433. ForceSendFields []string `json:"-"`
  434. // NullFields is a list of field names (e.g. "AccessLevels") to include
  435. // in API requests with the JSON null value. By default, fields with
  436. // empty values are omitted from API requests. However, any field with
  437. // an empty value appearing in NullFields will be sent to the server as
  438. // null. It is an error if a field in this list has a non-empty value.
  439. // This may be used to include null fields in Patch requests.
  440. NullFields []string `json:"-"`
  441. }
  442. func (s *Auth) MarshalJSON() ([]byte, error) {
  443. type NoMethod Auth
  444. raw := NoMethod(*s)
  445. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  446. }
  447. // AuthenticationInfo: Authentication information for the operation.
  448. type AuthenticationInfo struct {
  449. // AuthoritySelector: The authority selector specified by the requestor,
  450. // if any.
  451. // It is not guaranteed that the principal was allowed to use this
  452. // authority.
  453. AuthoritySelector string `json:"authoritySelector,omitempty"`
  454. // PrincipalEmail: The email address of the authenticated user (or
  455. // service account on behalf
  456. // of third party principal) making the request. For privacy reasons,
  457. // the
  458. // principal email address is redacted for all read-only operations that
  459. // fail
  460. // with a "permission denied" error.
  461. PrincipalEmail string `json:"principalEmail,omitempty"`
  462. // ServiceAccountDelegationInfo: Identity delegation history of an
  463. // authenticated service account that makes
  464. // the request. It contains information on the real authorities that try
  465. // to
  466. // access GCP resources by delegating on a service account. When
  467. // multiple
  468. // authorities present, they are guaranteed to be sorted based on the
  469. // original
  470. // ordering of the identity delegation events.
  471. ServiceAccountDelegationInfo []*ServiceAccountDelegationInfo `json:"serviceAccountDelegationInfo,omitempty"`
  472. // ServiceAccountKeyName: The name of the service account key used to
  473. // create or exchange
  474. // credentials for authenticating the service account making the
  475. // request.
  476. // This is a scheme-less URI full resource name. For
  477. // example:
  478. //
  479. // "//iam.googleapis.com/projects/{PROJECT_ID}/serviceAccounts/
  480. // {ACCOUNT}/keys/{key}"
  481. ServiceAccountKeyName string `json:"serviceAccountKeyName,omitempty"`
  482. // ThirdPartyPrincipal: The third party identification (if any) of the
  483. // authenticated user making
  484. // the request.
  485. // When the JSON object represented here has a proto equivalent, the
  486. // proto
  487. // name will be indicated in the `@type` property.
  488. ThirdPartyPrincipal googleapi.RawMessage `json:"thirdPartyPrincipal,omitempty"`
  489. // ForceSendFields is a list of field names (e.g. "AuthoritySelector")
  490. // to unconditionally include in API requests. By default, fields with
  491. // empty values are omitted from API requests. However, any non-pointer,
  492. // non-interface field appearing in ForceSendFields will be sent to the
  493. // server regardless of whether the field is empty or not. This may be
  494. // used to include empty fields in Patch requests.
  495. ForceSendFields []string `json:"-"`
  496. // NullFields is a list of field names (e.g. "AuthoritySelector") to
  497. // include in API requests with the JSON null value. By default, fields
  498. // with empty values are omitted from API requests. However, any field
  499. // with an empty value appearing in NullFields will be sent to the
  500. // server as null. It is an error if a field in this list has a
  501. // non-empty value. This may be used to include null fields in Patch
  502. // requests.
  503. NullFields []string `json:"-"`
  504. }
  505. func (s *AuthenticationInfo) MarshalJSON() ([]byte, error) {
  506. type NoMethod AuthenticationInfo
  507. raw := NoMethod(*s)
  508. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  509. }
  510. // AuthorizationInfo: Authorization information for the operation.
  511. type AuthorizationInfo struct {
  512. // Granted: Whether or not authorization for `resource` and
  513. // `permission`
  514. // was granted.
  515. Granted bool `json:"granted,omitempty"`
  516. // Permission: The required IAM permission.
  517. Permission string `json:"permission,omitempty"`
  518. // Resource: The resource being accessed, as a REST-style string. For
  519. // example:
  520. //
  521. // bigquery.googleapis.com/projects/PROJECTID/datasets/DATASETID
  522. Resource string `json:"resource,omitempty"`
  523. // ResourceAttributes: Resource attributes used in IAM condition
  524. // evaluation. This field contains
  525. // resource attributes like resource type and resource name.
  526. //
  527. // To get the whole view of the attributes used in IAM
  528. // condition evaluation, the user must also look
  529. // into
  530. // `AuditLog.request_metadata.request_attributes`.
  531. ResourceAttributes *Resource `json:"resourceAttributes,omitempty"`
  532. // ForceSendFields is a list of field names (e.g. "Granted") to
  533. // unconditionally include in API requests. By default, fields with
  534. // empty values are omitted from API requests. However, any non-pointer,
  535. // non-interface field appearing in ForceSendFields will be sent to the
  536. // server regardless of whether the field is empty or not. This may be
  537. // used to include empty fields in Patch requests.
  538. ForceSendFields []string `json:"-"`
  539. // NullFields is a list of field names (e.g. "Granted") to include in
  540. // API requests with the JSON null value. By default, fields with empty
  541. // values are omitted from API requests. However, any field with an
  542. // empty value appearing in NullFields will be sent to the server as
  543. // null. It is an error if a field in this list has a non-empty value.
  544. // This may be used to include null fields in Patch requests.
  545. NullFields []string `json:"-"`
  546. }
  547. func (s *AuthorizationInfo) MarshalJSON() ([]byte, error) {
  548. type NoMethod AuthorizationInfo
  549. raw := NoMethod(*s)
  550. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  551. }
  552. // CheckError: Defines the errors to be returned
  553. // in
  554. // google.api.servicecontrol.v1.CheckResponse.check_errors.
  555. type CheckError struct {
  556. // Code: The error code.
  557. //
  558. // Possible values:
  559. // "ERROR_CODE_UNSPECIFIED" - This is never used in `CheckResponse`.
  560. // "NOT_FOUND" - The consumer's project id, network container, or
  561. // resource container was
  562. // not found. Same as google.rpc.Code.NOT_FOUND.
  563. // "PERMISSION_DENIED" - The consumer doesn't have access to the
  564. // specified resource.
  565. // Same as google.rpc.Code.PERMISSION_DENIED.
  566. // "RESOURCE_EXHAUSTED" - Quota check failed. Same as
  567. // google.rpc.Code.RESOURCE_EXHAUSTED.
  568. // "BUDGET_EXCEEDED" - Budget check failed.
  569. // "DENIAL_OF_SERVICE_DETECTED" - The consumer's request has been
  570. // flagged as a DoS attack.
  571. // "LOAD_SHEDDING" - The consumer's request should be rejected in
  572. // order to protect the service
  573. // from being overloaded.
  574. // "ABUSER_DETECTED" - The consumer has been flagged as an abuser.
  575. // "SERVICE_NOT_ACTIVATED" - The consumer hasn't activated the
  576. // service.
  577. // "VISIBILITY_DENIED" - The consumer cannot access the service due to
  578. // visibility configuration.
  579. // "BILLING_DISABLED" - The consumer cannot access the service because
  580. // billing is disabled.
  581. // "PROJECT_DELETED" - The consumer's project has been marked as
  582. // deleted (soft deletion).
  583. // "PROJECT_INVALID" - The consumer's project number or id does not
  584. // represent a valid project.
  585. // "CONSUMER_INVALID" - The input consumer info does not represent a
  586. // valid consumer folder or
  587. // organization.
  588. // "IP_ADDRESS_BLOCKED" - The IP address of the consumer is invalid
  589. // for the specific consumer
  590. // project.
  591. // "REFERER_BLOCKED" - The referer address of the consumer request is
  592. // invalid for the specific
  593. // consumer project.
  594. // "CLIENT_APP_BLOCKED" - The client application of the consumer
  595. // request is invalid for the
  596. // specific consumer project.
  597. // "API_TARGET_BLOCKED" - The API targeted by this request is invalid
  598. // for the specified consumer
  599. // project.
  600. // "API_KEY_INVALID" - The consumer's API key is invalid.
  601. // "API_KEY_EXPIRED" - The consumer's API Key has expired.
  602. // "API_KEY_NOT_FOUND" - The consumer's API Key was not found in
  603. // config record.
  604. // "SPATULA_HEADER_INVALID" - The consumer's spatula header is
  605. // invalid.
  606. // "LOAS_ROLE_INVALID" - The consumer's LOAS role is invalid.
  607. // "NO_LOAS_PROJECT" - The consumer's LOAS role has no associated
  608. // project.
  609. // "LOAS_PROJECT_DISABLED" - The consumer's LOAS project is not
  610. // `ACTIVE` in LoquatV2.
  611. // "SECURITY_POLICY_VIOLATED" - Request is not allowed as per security
  612. // policies defined in Org Policy.
  613. // "INVALID_CREDENTIAL" - The credential in the request can not be
  614. // verified.
  615. // "LOCATION_POLICY_VIOLATED" - Request is not allowed as per location
  616. // policies defined in Org Policy.
  617. // "NAMESPACE_LOOKUP_UNAVAILABLE" - The backend server for looking up
  618. // project id/number is unavailable.
  619. // "SERVICE_STATUS_UNAVAILABLE" - The backend server for checking
  620. // service status is unavailable.
  621. // "BILLING_STATUS_UNAVAILABLE" - The backend server for checking
  622. // billing status is unavailable.
  623. // "QUOTA_CHECK_UNAVAILABLE" - The backend server for checking quota
  624. // limits is unavailable.
  625. // "LOAS_PROJECT_LOOKUP_UNAVAILABLE" - The Spanner for looking up LOAS
  626. // project is unavailable.
  627. // "CLOUD_RESOURCE_MANAGER_BACKEND_UNAVAILABLE" - Cloud Resource
  628. // Manager backend server is unavailable.
  629. // "SECURITY_POLICY_BACKEND_UNAVAILABLE" - NOTE: for customers in the
  630. // scope of Beta/GA of
  631. // https://cloud.google.com/vpc-service-controls, this error
  632. // is no longer returned. If the security backend is unavailable,
  633. // rpc
  634. // UNAVAILABLE status will be returned instead. It should be ignored
  635. // and
  636. // should not be used to reject client requests.
  637. // "LOCATION_POLICY_BACKEND_UNAVAILABLE" - Backend server for
  638. // evaluating location policy is unavailable.
  639. Code string `json:"code,omitempty"`
  640. // Detail: Free-form text providing details on the error cause of the
  641. // error.
  642. Detail string `json:"detail,omitempty"`
  643. // Status: Contains public information about the check error. If
  644. // available,
  645. // `status.code` will be non zero and client can propagate it out as
  646. // public
  647. // error.
  648. Status *Status `json:"status,omitempty"`
  649. // Subject: Subject to whom this error applies. See the specific code
  650. // enum for more
  651. // details on this field. For example:
  652. // - “project:<project-id or project-number>”
  653. // - “folder:<folder-id>”
  654. // - “organization:<organization-id>”
  655. Subject string `json:"subject,omitempty"`
  656. // ForceSendFields is a list of field names (e.g. "Code") to
  657. // unconditionally include in API requests. By default, fields with
  658. // empty values are omitted from API requests. However, any non-pointer,
  659. // non-interface field appearing in ForceSendFields will be sent to the
  660. // server regardless of whether the field is empty or not. This may be
  661. // used to include empty fields in Patch requests.
  662. ForceSendFields []string `json:"-"`
  663. // NullFields is a list of field names (e.g. "Code") to include in API
  664. // requests with the JSON null value. By default, fields with empty
  665. // values are omitted from API requests. However, any field with an
  666. // empty value appearing in NullFields will be sent to the server as
  667. // null. It is an error if a field in this list has a non-empty value.
  668. // This may be used to include null fields in Patch requests.
  669. NullFields []string `json:"-"`
  670. }
  671. func (s *CheckError) MarshalJSON() ([]byte, error) {
  672. type NoMethod CheckError
  673. raw := NoMethod(*s)
  674. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  675. }
  676. // CheckInfo: Contains additional information about the check operation.
  677. type CheckInfo struct {
  678. // ConsumerInfo: Consumer info of this check.
  679. ConsumerInfo *ConsumerInfo `json:"consumerInfo,omitempty"`
  680. // UnusedArguments: A list of fields and label keys that are ignored by
  681. // the server.
  682. // The client doesn't need to send them for following requests to
  683. // improve
  684. // performance and allow better aggregation.
  685. UnusedArguments []string `json:"unusedArguments,omitempty"`
  686. // ForceSendFields is a list of field names (e.g. "ConsumerInfo") to
  687. // unconditionally include in API requests. By default, fields with
  688. // empty values are omitted from API requests. However, any non-pointer,
  689. // non-interface field appearing in ForceSendFields will be sent to the
  690. // server regardless of whether the field is empty or not. This may be
  691. // used to include empty fields in Patch requests.
  692. ForceSendFields []string `json:"-"`
  693. // NullFields is a list of field names (e.g. "ConsumerInfo") to include
  694. // in API requests with the JSON null value. By default, fields with
  695. // empty values are omitted from API requests. However, any field with
  696. // an empty value appearing in NullFields will be sent to the server as
  697. // null. It is an error if a field in this list has a non-empty value.
  698. // This may be used to include null fields in Patch requests.
  699. NullFields []string `json:"-"`
  700. }
  701. func (s *CheckInfo) MarshalJSON() ([]byte, error) {
  702. type NoMethod CheckInfo
  703. raw := NoMethod(*s)
  704. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  705. }
  706. // CheckRequest: Request message for the Check method.
  707. type CheckRequest struct {
  708. // Operation: The operation to be checked.
  709. Operation *Operation `json:"operation,omitempty"`
  710. // RequestProjectSettings: Requests the project settings to be returned
  711. // as part of the check response.
  712. RequestProjectSettings bool `json:"requestProjectSettings,omitempty"`
  713. // ServiceConfigId: Specifies which version of service configuration
  714. // should be used to process
  715. // the request.
  716. //
  717. // If unspecified or no matching version can be found, the
  718. // latest one will be used.
  719. ServiceConfigId string `json:"serviceConfigId,omitempty"`
  720. // SkipActivationCheck: Indicates if service activation check should be
  721. // skipped for this request.
  722. // Default behavior is to perform the check and apply relevant
  723. // quota.
  724. // WARNING: Setting this flag to "true" will disable quota enforcement.
  725. SkipActivationCheck bool `json:"skipActivationCheck,omitempty"`
  726. // ForceSendFields is a list of field names (e.g. "Operation") to
  727. // unconditionally include in API requests. By default, fields with
  728. // empty values are omitted from API requests. However, any non-pointer,
  729. // non-interface field appearing in ForceSendFields will be sent to the
  730. // server regardless of whether the field is empty or not. This may be
  731. // used to include empty fields in Patch requests.
  732. ForceSendFields []string `json:"-"`
  733. // NullFields is a list of field names (e.g. "Operation") to include in
  734. // API requests with the JSON null value. By default, fields with empty
  735. // values are omitted from API requests. However, any field with an
  736. // empty value appearing in NullFields will be sent to the server as
  737. // null. It is an error if a field in this list has a non-empty value.
  738. // This may be used to include null fields in Patch requests.
  739. NullFields []string `json:"-"`
  740. }
  741. func (s *CheckRequest) MarshalJSON() ([]byte, error) {
  742. type NoMethod CheckRequest
  743. raw := NoMethod(*s)
  744. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  745. }
  746. // CheckResponse: Response message for the Check method.
  747. type CheckResponse struct {
  748. // CheckErrors: Indicate the decision of the check.
  749. //
  750. // If no check errors are present, the service should process the
  751. // operation.
  752. // Otherwise the service should use the list of errors to determine
  753. // the
  754. // appropriate action.
  755. CheckErrors []*CheckError `json:"checkErrors,omitempty"`
  756. // CheckInfo: Feedback data returned from the server during processing a
  757. // Check request.
  758. CheckInfo *CheckInfo `json:"checkInfo,omitempty"`
  759. // OperationId: The same operation_id value used in the
  760. // CheckRequest.
  761. // Used for logging and diagnostics purposes.
  762. OperationId string `json:"operationId,omitempty"`
  763. // QuotaInfo: Quota information for the check request associated with
  764. // this response.
  765. //
  766. QuotaInfo *QuotaInfo `json:"quotaInfo,omitempty"`
  767. // ServiceConfigId: The actual config id used to process the request.
  768. ServiceConfigId string `json:"serviceConfigId,omitempty"`
  769. // ServerResponse contains the HTTP response code and headers from the
  770. // server.
  771. googleapi.ServerResponse `json:"-"`
  772. // ForceSendFields is a list of field names (e.g. "CheckErrors") to
  773. // unconditionally include in API requests. By default, fields with
  774. // empty values are omitted from API requests. However, any non-pointer,
  775. // non-interface field appearing in ForceSendFields will be sent to the
  776. // server regardless of whether the field is empty or not. This may be
  777. // used to include empty fields in Patch requests.
  778. ForceSendFields []string `json:"-"`
  779. // NullFields is a list of field names (e.g. "CheckErrors") to include
  780. // in API requests with the JSON null value. By default, fields with
  781. // empty values are omitted from API requests. However, any field with
  782. // an empty value appearing in NullFields will be sent to the server as
  783. // null. It is an error if a field in this list has a non-empty value.
  784. // This may be used to include null fields in Patch requests.
  785. NullFields []string `json:"-"`
  786. }
  787. func (s *CheckResponse) MarshalJSON() ([]byte, error) {
  788. type NoMethod CheckResponse
  789. raw := NoMethod(*s)
  790. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  791. }
  792. // ConsumerInfo: `ConsumerInfo` provides information about the consumer.
  793. type ConsumerInfo struct {
  794. // ConsumerNumber: The consumer identity number, can be Google cloud
  795. // project number, folder
  796. // number or organization number e.g. 1234567890. A value of 0 indicates
  797. // no
  798. // consumer number is found.
  799. ConsumerNumber int64 `json:"consumerNumber,omitempty,string"`
  800. // ProjectNumber: The Google cloud project number, e.g. 1234567890. A
  801. // value of 0 indicates
  802. // no project number is found.
  803. //
  804. // NOTE: This field is deprecated after Chemist support flexible
  805. // consumer
  806. // id. New code should not depend on this field anymore.
  807. ProjectNumber int64 `json:"projectNumber,omitempty,string"`
  808. // Possible values:
  809. // "CONSUMER_TYPE_UNSPECIFIED"
  810. // "PROJECT"
  811. // "FOLDER"
  812. // "ORGANIZATION"
  813. Type string `json:"type,omitempty"`
  814. // ForceSendFields is a list of field names (e.g. "ConsumerNumber") to
  815. // unconditionally include in API requests. By default, fields with
  816. // empty values are omitted from API requests. However, any non-pointer,
  817. // non-interface field appearing in ForceSendFields will be sent to the
  818. // server regardless of whether the field is empty or not. This may be
  819. // used to include empty fields in Patch requests.
  820. ForceSendFields []string `json:"-"`
  821. // NullFields is a list of field names (e.g. "ConsumerNumber") to
  822. // include in API requests with the JSON null value. By default, fields
  823. // with empty values are omitted from API requests. However, any field
  824. // with an empty value appearing in NullFields will be sent to the
  825. // server as null. It is an error if a field in this list has a
  826. // non-empty value. This may be used to include null fields in Patch
  827. // requests.
  828. NullFields []string `json:"-"`
  829. }
  830. func (s *ConsumerInfo) MarshalJSON() ([]byte, error) {
  831. type NoMethod ConsumerInfo
  832. raw := NoMethod(*s)
  833. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  834. }
  835. // Distribution: Distribution represents a frequency distribution of
  836. // double-valued sample
  837. // points. It contains the size of the population of sample points
  838. // plus
  839. // additional optional information:
  840. //
  841. // - the arithmetic mean of the samples
  842. // - the minimum and maximum of the samples
  843. // - the sum-squared-deviation of the samples, used to compute
  844. // variance
  845. // - a histogram of the values of the sample points
  846. type Distribution struct {
  847. // BucketCounts: The number of samples in each histogram bucket.
  848. // `bucket_counts` are
  849. // optional. If present, they must sum to the `count` value.
  850. //
  851. // The buckets are defined below in `bucket_option`. There are N
  852. // buckets.
  853. // `bucket_counts[0]` is the number of samples in the underflow
  854. // bucket.
  855. // `bucket_counts[1]` to `bucket_counts[N-1]` are the numbers of
  856. // samples
  857. // in each of the finite buckets. And `bucket_counts[N] is the number
  858. // of samples in the overflow bucket. See the comments of
  859. // `bucket_option`
  860. // below for more details.
  861. //
  862. // Any suffix of trailing zeros may be omitted.
  863. BucketCounts googleapi.Int64s `json:"bucketCounts,omitempty"`
  864. // Count: The total number of samples in the distribution. Must be >= 0.
  865. Count int64 `json:"count,omitempty,string"`
  866. // ExplicitBuckets: Buckets with arbitrary user-provided width.
  867. ExplicitBuckets *ExplicitBuckets `json:"explicitBuckets,omitempty"`
  868. // ExponentialBuckets: Buckets with exponentially growing width.
  869. ExponentialBuckets *ExponentialBuckets `json:"exponentialBuckets,omitempty"`
  870. // LinearBuckets: Buckets with constant width.
  871. LinearBuckets *LinearBuckets `json:"linearBuckets,omitempty"`
  872. // Maximum: The maximum of the population of values. Ignored if `count`
  873. // is zero.
  874. Maximum float64 `json:"maximum,omitempty"`
  875. // Mean: The arithmetic mean of the samples in the distribution. If
  876. // `count` is
  877. // zero then this field must be zero.
  878. Mean float64 `json:"mean,omitempty"`
  879. // Minimum: The minimum of the population of values. Ignored if `count`
  880. // is zero.
  881. Minimum float64 `json:"minimum,omitempty"`
  882. // SumOfSquaredDeviation: The sum of squared deviations from the mean:
  883. // Sum[i=1..count]((x_i - mean)^2)
  884. // where each x_i is a sample values. If `count` is zero then this
  885. // field
  886. // must be zero, otherwise validation of the request fails.
  887. SumOfSquaredDeviation float64 `json:"sumOfSquaredDeviation,omitempty"`
  888. // ForceSendFields is a list of field names (e.g. "BucketCounts") to
  889. // unconditionally include in API requests. By default, fields with
  890. // empty values are omitted from API requests. However, any non-pointer,
  891. // non-interface field appearing in ForceSendFields will be sent to the
  892. // server regardless of whether the field is empty or not. This may be
  893. // used to include empty fields in Patch requests.
  894. ForceSendFields []string `json:"-"`
  895. // NullFields is a list of field names (e.g. "BucketCounts") to include
  896. // in API requests with the JSON null value. By default, fields with
  897. // empty values are omitted from API requests. However, any field with
  898. // an empty value appearing in NullFields will be sent to the server as
  899. // null. It is an error if a field in this list has a non-empty value.
  900. // This may be used to include null fields in Patch requests.
  901. NullFields []string `json:"-"`
  902. }
  903. func (s *Distribution) MarshalJSON() ([]byte, error) {
  904. type NoMethod Distribution
  905. raw := NoMethod(*s)
  906. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  907. }
  908. func (s *Distribution) UnmarshalJSON(data []byte) error {
  909. type NoMethod Distribution
  910. var s1 struct {
  911. Maximum gensupport.JSONFloat64 `json:"maximum"`
  912. Mean gensupport.JSONFloat64 `json:"mean"`
  913. Minimum gensupport.JSONFloat64 `json:"minimum"`
  914. SumOfSquaredDeviation gensupport.JSONFloat64 `json:"sumOfSquaredDeviation"`
  915. *NoMethod
  916. }
  917. s1.NoMethod = (*NoMethod)(s)
  918. if err := json.Unmarshal(data, &s1); err != nil {
  919. return err
  920. }
  921. s.Maximum = float64(s1.Maximum)
  922. s.Mean = float64(s1.Mean)
  923. s.Minimum = float64(s1.Minimum)
  924. s.SumOfSquaredDeviation = float64(s1.SumOfSquaredDeviation)
  925. return nil
  926. }
  927. // ExplicitBuckets: Describing buckets with arbitrary user-provided
  928. // width.
  929. type ExplicitBuckets struct {
  930. // Bounds: 'bound' is a list of strictly increasing boundaries
  931. // between
  932. // buckets. Note that a list of length N-1 defines N buckets because
  933. // of fenceposting. See comments on `bucket_options` for details.
  934. //
  935. // The i'th finite bucket covers the interval
  936. // [bound[i-1], bound[i])
  937. // where i ranges from 1 to bound_size() - 1. Note that there are
  938. // no
  939. // finite buckets at all if 'bound' only contains a single element;
  940. // in
  941. // that special case the single bound defines the boundary between
  942. // the
  943. // underflow and overflow buckets.
  944. //
  945. // bucket number lower bound upper bound
  946. // i == 0 (underflow) -inf bound[i]
  947. // 0 < i < bound_size() bound[i-1] bound[i]
  948. // i == bound_size() (overflow) bound[i-1] +inf
  949. Bounds []float64 `json:"bounds,omitempty"`
  950. // ForceSendFields is a list of field names (e.g. "Bounds") to
  951. // unconditionally include in API requests. By default, fields with
  952. // empty values are omitted from API requests. However, any non-pointer,
  953. // non-interface field appearing in ForceSendFields will be sent to the
  954. // server regardless of whether the field is empty or not. This may be
  955. // used to include empty fields in Patch requests.
  956. ForceSendFields []string `json:"-"`
  957. // NullFields is a list of field names (e.g. "Bounds") to include in API
  958. // requests with the JSON null value. By default, fields with empty
  959. // values are omitted from API requests. However, any field with an
  960. // empty value appearing in NullFields will be sent to the server as
  961. // null. It is an error if a field in this list has a non-empty value.
  962. // This may be used to include null fields in Patch requests.
  963. NullFields []string `json:"-"`
  964. }
  965. func (s *ExplicitBuckets) MarshalJSON() ([]byte, error) {
  966. type NoMethod ExplicitBuckets
  967. raw := NoMethod(*s)
  968. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  969. }
  970. // ExponentialBuckets: Describing buckets with exponentially growing
  971. // width.
  972. type ExponentialBuckets struct {
  973. // GrowthFactor: The i'th exponential bucket covers the interval
  974. // [scale * growth_factor^(i-1), scale * growth_factor^i)
  975. // where i ranges from 1 to num_finite_buckets inclusive.
  976. // Must be larger than 1.0.
  977. GrowthFactor float64 `json:"growthFactor,omitempty"`
  978. // NumFiniteBuckets: The number of finite buckets. With the underflow
  979. // and overflow buckets,
  980. // the total number of buckets is `num_finite_buckets` + 2.
  981. // See comments on `bucket_options` for details.
  982. NumFiniteBuckets int64 `json:"numFiniteBuckets,omitempty"`
  983. // Scale: The i'th exponential bucket covers the interval
  984. // [scale * growth_factor^(i-1), scale * growth_factor^i)
  985. // where i ranges from 1 to num_finite_buckets inclusive.
  986. // Must be > 0.
  987. Scale float64 `json:"scale,omitempty"`
  988. // ForceSendFields is a list of field names (e.g. "GrowthFactor") to
  989. // unconditionally include in API requests. By default, fields with
  990. // empty values are omitted from API requests. However, any non-pointer,
  991. // non-interface field appearing in ForceSendFields will be sent to the
  992. // server regardless of whether the field is empty or not. This may be
  993. // used to include empty fields in Patch requests.
  994. ForceSendFields []string `json:"-"`
  995. // NullFields is a list of field names (e.g. "GrowthFactor") to include
  996. // in API requests with the JSON null value. By default, fields with
  997. // empty values are omitted from API requests. However, any field with
  998. // an empty value appearing in NullFields will be sent to the server as
  999. // null. It is an error if a field in this list has a non-empty value.
  1000. // This may be used to include null fields in Patch requests.
  1001. NullFields []string `json:"-"`
  1002. }
  1003. func (s *ExponentialBuckets) MarshalJSON() ([]byte, error) {
  1004. type NoMethod ExponentialBuckets
  1005. raw := NoMethod(*s)
  1006. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1007. }
  1008. func (s *ExponentialBuckets) UnmarshalJSON(data []byte) error {
  1009. type NoMethod ExponentialBuckets
  1010. var s1 struct {
  1011. GrowthFactor gensupport.JSONFloat64 `json:"growthFactor"`
  1012. Scale gensupport.JSONFloat64 `json:"scale"`
  1013. *NoMethod
  1014. }
  1015. s1.NoMethod = (*NoMethod)(s)
  1016. if err := json.Unmarshal(data, &s1); err != nil {
  1017. return err
  1018. }
  1019. s.GrowthFactor = float64(s1.GrowthFactor)
  1020. s.Scale = float64(s1.Scale)
  1021. return nil
  1022. }
  1023. // FirstPartyPrincipal: First party identity principal.
  1024. type FirstPartyPrincipal struct {
  1025. // PrincipalEmail: The email address of a Google account.
  1026. // .
  1027. PrincipalEmail string `json:"principalEmail,omitempty"`
  1028. // ServiceMetadata: Metadata about the service that uses the service
  1029. // account.
  1030. // .
  1031. ServiceMetadata googleapi.RawMessage `json:"serviceMetadata,omitempty"`
  1032. // ForceSendFields is a list of field names (e.g. "PrincipalEmail") to
  1033. // unconditionally include in API requests. By default, fields with
  1034. // empty values are omitted from API requests. However, any non-pointer,
  1035. // non-interface field appearing in ForceSendFields will be sent to the
  1036. // server regardless of whether the field is empty or not. This may be
  1037. // used to include empty fields in Patch requests.
  1038. ForceSendFields []string `json:"-"`
  1039. // NullFields is a list of field names (e.g. "PrincipalEmail") to
  1040. // include in API requests with the JSON null value. By default, fields
  1041. // with empty values are omitted from API requests. However, any field
  1042. // with an empty value appearing in NullFields will be sent to the
  1043. // server as null. It is an error if a field in this list has a
  1044. // non-empty value. This may be used to include null fields in Patch
  1045. // requests.
  1046. NullFields []string `json:"-"`
  1047. }
  1048. func (s *FirstPartyPrincipal) MarshalJSON() ([]byte, error) {
  1049. type NoMethod FirstPartyPrincipal
  1050. raw := NoMethod(*s)
  1051. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1052. }
  1053. // HttpRequest: A common proto for logging HTTP requests. Only contains
  1054. // semantics
  1055. // defined by the HTTP specification. Product-specific
  1056. // logging
  1057. // information MUST be defined in a separate message.
  1058. type HttpRequest struct {
  1059. // CacheFillBytes: The number of HTTP response bytes inserted into
  1060. // cache. Set only when a
  1061. // cache fill was attempted.
  1062. CacheFillBytes int64 `json:"cacheFillBytes,omitempty,string"`
  1063. // CacheHit: Whether or not an entity was served from cache
  1064. // (with or without validation).
  1065. CacheHit bool `json:"cacheHit,omitempty"`
  1066. // CacheLookup: Whether or not a cache lookup was attempted.
  1067. CacheLookup bool `json:"cacheLookup,omitempty"`
  1068. // CacheValidatedWithOriginServer: Whether or not the response was
  1069. // validated with the origin server before
  1070. // being served from cache. This field is only meaningful if `cache_hit`
  1071. // is
  1072. // True.
  1073. CacheValidatedWithOriginServer bool `json:"cacheValidatedWithOriginServer,omitempty"`
  1074. // Latency: The request processing latency on the server, from the time
  1075. // the request was
  1076. // received until the response was sent.
  1077. Latency string `json:"latency,omitempty"`
  1078. // Protocol: Protocol used for the request. Examples: "HTTP/1.1",
  1079. // "HTTP/2", "websocket"
  1080. Protocol string `json:"protocol,omitempty"`
  1081. // Referer: The referer URL of the request, as defined in
  1082. // [HTTP/1.1 Header
  1083. // Field
  1084. // Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.h
  1085. // tml).
  1086. Referer string `json:"referer,omitempty"`
  1087. // RemoteIp: The IP address (IPv4 or IPv6) of the client that issued the
  1088. // HTTP
  1089. // request. Examples: "192.168.1.1", "FE80::0202:B3FF:FE1E:8329".
  1090. RemoteIp string `json:"remoteIp,omitempty"`
  1091. // RequestMethod: The request method. Examples: "GET", "HEAD",
  1092. // "PUT", "POST".
  1093. RequestMethod string `json:"requestMethod,omitempty"`
  1094. // RequestSize: The size of the HTTP request message in bytes, including
  1095. // the request
  1096. // headers and the request body.
  1097. RequestSize int64 `json:"requestSize,omitempty,string"`
  1098. // RequestUrl: The scheme (http, https), the host name, the path, and
  1099. // the query
  1100. // portion of the URL that was requested.
  1101. // Example: "http://example.com/some/info?color=red".
  1102. RequestUrl string `json:"requestUrl,omitempty"`
  1103. // ResponseSize: The size of the HTTP response message sent back to the
  1104. // client, in bytes,
  1105. // including the response headers and the response body.
  1106. ResponseSize int64 `json:"responseSize,omitempty,string"`
  1107. // ServerIp: The IP address (IPv4 or IPv6) of the origin server that the
  1108. // request was
  1109. // sent to.
  1110. ServerIp string `json:"serverIp,omitempty"`
  1111. // Status: The response code indicating the status of the
  1112. // response.
  1113. // Examples: 200, 404.
  1114. Status int64 `json:"status,omitempty"`
  1115. // UserAgent: The user agent sent by the client. Example:
  1116. // "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET
  1117. // CLR 1.0.3705)".
  1118. UserAgent string `json:"userAgent,omitempty"`
  1119. // ForceSendFields is a list of field names (e.g. "CacheFillBytes") to
  1120. // unconditionally include in API requests. By default, fields with
  1121. // empty values are omitted from API requests. However, any non-pointer,
  1122. // non-interface field appearing in ForceSendFields will be sent to the
  1123. // server regardless of whether the field is empty or not. This may be
  1124. // used to include empty fields in Patch requests.
  1125. ForceSendFields []string `json:"-"`
  1126. // NullFields is a list of field names (e.g. "CacheFillBytes") to
  1127. // include in API requests with the JSON null value. By default, fields
  1128. // with empty values are omitted from API requests. However, any field
  1129. // with an empty value appearing in NullFields will be sent to the
  1130. // server as null. It is an error if a field in this list has a
  1131. // non-empty value. This may be used to include null fields in Patch
  1132. // requests.
  1133. NullFields []string `json:"-"`
  1134. }
  1135. func (s *HttpRequest) MarshalJSON() ([]byte, error) {
  1136. type NoMethod HttpRequest
  1137. raw := NoMethod(*s)
  1138. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1139. }
  1140. // LinearBuckets: Describing buckets with constant width.
  1141. type LinearBuckets struct {
  1142. // NumFiniteBuckets: The number of finite buckets. With the underflow
  1143. // and overflow buckets,
  1144. // the total number of buckets is `num_finite_buckets` + 2.
  1145. // See comments on `bucket_options` for details.
  1146. NumFiniteBuckets int64 `json:"numFiniteBuckets,omitempty"`
  1147. // Offset: The i'th linear bucket covers the interval
  1148. // [offset + (i-1) * width, offset + i * width)
  1149. // where i ranges from 1 to num_finite_buckets, inclusive.
  1150. Offset float64 `json:"offset,omitempty"`
  1151. // Width: The i'th linear bucket covers the interval
  1152. // [offset + (i-1) * width, offset + i * width)
  1153. // where i ranges from 1 to num_finite_buckets, inclusive.
  1154. // Must be strictly positive.
  1155. Width float64 `json:"width,omitempty"`
  1156. // ForceSendFields is a list of field names (e.g. "NumFiniteBuckets") to
  1157. // unconditionally include in API requests. By default, fields with
  1158. // empty values are omitted from API requests. However, any non-pointer,
  1159. // non-interface field appearing in ForceSendFields will be sent to the
  1160. // server regardless of whether the field is empty or not. This may be
  1161. // used to include empty fields in Patch requests.
  1162. ForceSendFields []string `json:"-"`
  1163. // NullFields is a list of field names (e.g. "NumFiniteBuckets") to
  1164. // include in API requests with the JSON null value. By default, fields
  1165. // with empty values are omitted from API requests. However, any field
  1166. // with an empty value appearing in NullFields will be sent to the
  1167. // server as null. It is an error if a field in this list has a
  1168. // non-empty value. This may be used to include null fields in Patch
  1169. // requests.
  1170. NullFields []string `json:"-"`
  1171. }
  1172. func (s *LinearBuckets) MarshalJSON() ([]byte, error) {
  1173. type NoMethod LinearBuckets
  1174. raw := NoMethod(*s)
  1175. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1176. }
  1177. func (s *LinearBuckets) UnmarshalJSON(data []byte) error {
  1178. type NoMethod LinearBuckets
  1179. var s1 struct {
  1180. Offset gensupport.JSONFloat64 `json:"offset"`
  1181. Width gensupport.JSONFloat64 `json:"width"`
  1182. *NoMethod
  1183. }
  1184. s1.NoMethod = (*NoMethod)(s)
  1185. if err := json.Unmarshal(data, &s1); err != nil {
  1186. return err
  1187. }
  1188. s.Offset = float64(s1.Offset)
  1189. s.Width = float64(s1.Width)
  1190. return nil
  1191. }
  1192. // LogEntry: An individual log entry.
  1193. type LogEntry struct {
  1194. // HttpRequest: Optional. Information about the HTTP request associated
  1195. // with this
  1196. // log entry, if applicable.
  1197. HttpRequest *HttpRequest `json:"httpRequest,omitempty"`
  1198. // InsertId: A unique ID for the log entry used for deduplication. If
  1199. // omitted,
  1200. // the implementation will generate one based on operation_id.
  1201. InsertId string `json:"insertId,omitempty"`
  1202. // Labels: A set of user-defined (key, value) data that provides
  1203. // additional
  1204. // information about the log entry.
  1205. Labels map[string]string `json:"labels,omitempty"`
  1206. // Name: Required. The log to which this log entry belongs. Examples:
  1207. // "syslog",
  1208. // "book_log".
  1209. Name string `json:"name,omitempty"`
  1210. // Operation: Optional. Information about an operation associated with
  1211. // the log entry, if
  1212. // applicable.
  1213. Operation *LogEntryOperation `json:"operation,omitempty"`
  1214. // ProtoPayload: The log entry payload, represented as a protocol buffer
  1215. // that is
  1216. // expressed as a JSON object. The only accepted type currently
  1217. // is
  1218. // AuditLog.
  1219. ProtoPayload googleapi.RawMessage `json:"protoPayload,omitempty"`
  1220. // Severity: The severity of the log entry. The default value
  1221. // is
  1222. // `LogSeverity.DEFAULT`.
  1223. //
  1224. // Possible values:
  1225. // "DEFAULT" - (0) The log entry has no assigned severity level.
  1226. // "DEBUG" - (100) Debug or trace information.
  1227. // "INFO" - (200) Routine information, such as ongoing status or
  1228. // performance.
  1229. // "NOTICE" - (300) Normal but significant events, such as start up,
  1230. // shut down, or
  1231. // a configuration change.
  1232. // "WARNING" - (400) Warning events might cause problems.
  1233. // "ERROR" - (500) Error events are likely to cause problems.
  1234. // "CRITICAL" - (600) Critical events cause more severe problems or
  1235. // outages.
  1236. // "ALERT" - (700) A person must take an action immediately.
  1237. // "EMERGENCY" - (800) One or more systems are unusable.
  1238. Severity string `json:"severity,omitempty"`
  1239. // StructPayload: The log entry payload, represented as a structure
  1240. // that
  1241. // is expressed as a JSON object.
  1242. StructPayload googleapi.RawMessage `json:"structPayload,omitempty"`
  1243. // TextPayload: The log entry payload, represented as a Unicode string
  1244. // (UTF-8).
  1245. TextPayload string `json:"textPayload,omitempty"`
  1246. // Timestamp: The time the event described by the log entry occurred.
  1247. // If
  1248. // omitted, defaults to operation start time.
  1249. Timestamp string `json:"timestamp,omitempty"`
  1250. // Trace: Optional. Resource name of the trace associated with the log
  1251. // entry, if any.
  1252. // If this field contains a relative resource name, you can assume the
  1253. // name is
  1254. // relative to `//tracing.googleapis.com`.
  1255. // Example:
  1256. // `projects/my-projectid/traces/06796866738c859f2f19b7cfb321482
  1257. // 4`
  1258. Trace string `json:"trace,omitempty"`
  1259. // ForceSendFields is a list of field names (e.g. "HttpRequest") to
  1260. // unconditionally include in API requests. By default, fields with
  1261. // empty values are omitted from API requests. However, any non-pointer,
  1262. // non-interface field appearing in ForceSendFields will be sent to the
  1263. // server regardless of whether the field is empty or not. This may be
  1264. // used to include empty fields in Patch requests.
  1265. ForceSendFields []string `json:"-"`
  1266. // NullFields is a list of field names (e.g. "HttpRequest") to include
  1267. // in API requests with the JSON null value. By default, fields with
  1268. // empty values are omitted from API requests. However, any field with
  1269. // an empty value appearing in NullFields will be sent to the server as
  1270. // null. It is an error if a field in this list has a non-empty value.
  1271. // This may be used to include null fields in Patch requests.
  1272. NullFields []string `json:"-"`
  1273. }
  1274. func (s *LogEntry) MarshalJSON() ([]byte, error) {
  1275. type NoMethod LogEntry
  1276. raw := NoMethod(*s)
  1277. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1278. }
  1279. // LogEntryOperation: Additional information about a potentially
  1280. // long-running operation with which
  1281. // a log entry is associated.
  1282. type LogEntryOperation struct {
  1283. // First: Optional. Set this to True if this is the first log entry in
  1284. // the operation.
  1285. First bool `json:"first,omitempty"`
  1286. // Id: Optional. An arbitrary operation identifier. Log entries with
  1287. // the
  1288. // same identifier are assumed to be part of the same operation.
  1289. Id string `json:"id,omitempty"`
  1290. // Last: Optional. Set this to True if this is the last log entry in the
  1291. // operation.
  1292. Last bool `json:"last,omitempty"`
  1293. // Producer: Optional. An arbitrary producer identifier. The combination
  1294. // of
  1295. // `id` and `producer` must be globally unique. Examples for
  1296. // `producer`:
  1297. // "MyDivision.MyBigCompany.com",
  1298. // "github.com/MyProject/MyApplication".
  1299. Producer string `json:"producer,omitempty"`
  1300. // ForceSendFields is a list of field names (e.g. "First") to
  1301. // unconditionally include in API requests. By default, fields with
  1302. // empty values are omitted from API requests. However, any non-pointer,
  1303. // non-interface field appearing in ForceSendFields will be sent to the
  1304. // server regardless of whether the field is empty or not. This may be
  1305. // used to include empty fields in Patch requests.
  1306. ForceSendFields []string `json:"-"`
  1307. // NullFields is a list of field names (e.g. "First") to include in API
  1308. // requests with the JSON null value. By default, fields with empty
  1309. // values are omitted from API requests. However, any field with an
  1310. // empty value appearing in NullFields will be sent to the server as
  1311. // null. It is an error if a field in this list has a non-empty value.
  1312. // This may be used to include null fields in Patch requests.
  1313. NullFields []string `json:"-"`
  1314. }
  1315. func (s *LogEntryOperation) MarshalJSON() ([]byte, error) {
  1316. type NoMethod LogEntryOperation
  1317. raw := NoMethod(*s)
  1318. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1319. }
  1320. // MetricValue: Represents a single metric value.
  1321. type MetricValue struct {
  1322. // BoolValue: A boolean value.
  1323. BoolValue *bool `json:"boolValue,omitempty"`
  1324. // DistributionValue: A distribution value.
  1325. DistributionValue *Distribution `json:"distributionValue,omitempty"`
  1326. // DoubleValue: A double precision floating point value.
  1327. DoubleValue *float64 `json:"doubleValue,omitempty"`
  1328. // EndTime: The end of the time period over which this metric value's
  1329. // measurement
  1330. // applies.
  1331. EndTime string `json:"endTime,omitempty"`
  1332. // Int64Value: A signed 64-bit integer value.
  1333. Int64Value *int64 `json:"int64Value,omitempty,string"`
  1334. // Labels: The labels describing the metric value.
  1335. // See comments on google.api.servicecontrol.v1.Operation.labels for
  1336. // the overriding relationship.
  1337. Labels map[string]string `json:"labels,omitempty"`
  1338. // MoneyValue: A money value.
  1339. MoneyValue *Money `json:"moneyValue,omitempty"`
  1340. // StartTime: The start of the time period over which this metric
  1341. // value's measurement
  1342. // applies. The time period has different semantics for different
  1343. // metric
  1344. // types (cumulative, delta, and gauge). See the metric
  1345. // definition
  1346. // documentation in the service configuration for details.
  1347. StartTime string `json:"startTime,omitempty"`
  1348. // StringValue: A text string value.
  1349. StringValue *string `json:"stringValue,omitempty"`
  1350. // ForceSendFields is a list of field names (e.g. "BoolValue") to
  1351. // unconditionally include in API requests. By default, fields with
  1352. // empty values are omitted from API requests. However, any non-pointer,
  1353. // non-interface field appearing in ForceSendFields will be sent to the
  1354. // server regardless of whether the field is empty or not. This may be
  1355. // used to include empty fields in Patch requests.
  1356. ForceSendFields []string `json:"-"`
  1357. // NullFields is a list of field names (e.g. "BoolValue") to include in
  1358. // API requests with the JSON null value. By default, fields with empty
  1359. // values are omitted from API requests. However, any field with an
  1360. // empty value appearing in NullFields will be sent to the server as
  1361. // null. It is an error if a field in this list has a non-empty value.
  1362. // This may be used to include null fields in Patch requests.
  1363. NullFields []string `json:"-"`
  1364. }
  1365. func (s *MetricValue) MarshalJSON() ([]byte, error) {
  1366. type NoMethod MetricValue
  1367. raw := NoMethod(*s)
  1368. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1369. }
  1370. func (s *MetricValue) UnmarshalJSON(data []byte) error {
  1371. type NoMethod MetricValue
  1372. var s1 struct {
  1373. DoubleValue *gensupport.JSONFloat64 `json:"doubleValue"`
  1374. *NoMethod
  1375. }
  1376. s1.NoMethod = (*NoMethod)(s)
  1377. if err := json.Unmarshal(data, &s1); err != nil {
  1378. return err
  1379. }
  1380. if s1.DoubleValue != nil {
  1381. s.DoubleValue = (*float64)(s1.DoubleValue)
  1382. }
  1383. return nil
  1384. }
  1385. // MetricValueSet: Represents a set of metric values in the same
  1386. // metric.
  1387. // Each metric value in the set should have a unique combination of
  1388. // start time,
  1389. // end time, and label values.
  1390. type MetricValueSet struct {
  1391. // MetricName: The metric name defined in the service configuration.
  1392. MetricName string `json:"metricName,omitempty"`
  1393. // MetricValues: The values in this metric.
  1394. MetricValues []*MetricValue `json:"metricValues,omitempty"`
  1395. // ForceSendFields is a list of field names (e.g. "MetricName") to
  1396. // unconditionally include in API requests. By default, fields with
  1397. // empty values are omitted from API requests. However, any non-pointer,
  1398. // non-interface field appearing in ForceSendFields will be sent to the
  1399. // server regardless of whether the field is empty or not. This may be
  1400. // used to include empty fields in Patch requests.
  1401. ForceSendFields []string `json:"-"`
  1402. // NullFields is a list of field names (e.g. "MetricName") to include in
  1403. // API requests with the JSON null value. By default, fields with empty
  1404. // values are omitted from API requests. However, any field with an
  1405. // empty value appearing in NullFields will be sent to the server as
  1406. // null. It is an error if a field in this list has a non-empty value.
  1407. // This may be used to include null fields in Patch requests.
  1408. NullFields []string `json:"-"`
  1409. }
  1410. func (s *MetricValueSet) MarshalJSON() ([]byte, error) {
  1411. type NoMethod MetricValueSet
  1412. raw := NoMethod(*s)
  1413. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1414. }
  1415. // Money: Represents an amount of money with its currency type.
  1416. type Money struct {
  1417. // CurrencyCode: The 3-letter currency code defined in ISO 4217.
  1418. CurrencyCode string `json:"currencyCode,omitempty"`
  1419. // Nanos: Number of nano (10^-9) units of the amount.
  1420. // The value must be between -999,999,999 and +999,999,999 inclusive.
  1421. // If `units` is positive, `nanos` must be positive or zero.
  1422. // If `units` is zero, `nanos` can be positive, zero, or negative.
  1423. // If `units` is negative, `nanos` must be negative or zero.
  1424. // For example $-1.75 is represented as `units`=-1 and
  1425. // `nanos`=-750,000,000.
  1426. Nanos int64 `json:"nanos,omitempty"`
  1427. // Units: The whole units of the amount.
  1428. // For example if `currencyCode` is "USD", then 1 unit is one US
  1429. // dollar.
  1430. Units int64 `json:"units,omitempty,string"`
  1431. // ForceSendFields is a list of field names (e.g. "CurrencyCode") to
  1432. // unconditionally include in API requests. By default, fields with
  1433. // empty values are omitted from API requests. However, any non-pointer,
  1434. // non-interface field appearing in ForceSendFields will be sent to the
  1435. // server regardless of whether the field is empty or not. This may be
  1436. // used to include empty fields in Patch requests.
  1437. ForceSendFields []string `json:"-"`
  1438. // NullFields is a list of field names (e.g. "CurrencyCode") to include
  1439. // in API requests with the JSON null value. By default, fields with
  1440. // empty values are omitted from API requests. However, any field with
  1441. // an empty value appearing in NullFields will be sent to the server as
  1442. // null. It is an error if a field in this list has a non-empty value.
  1443. // This may be used to include null fields in Patch requests.
  1444. NullFields []string `json:"-"`
  1445. }
  1446. func (s *Money) MarshalJSON() ([]byte, error) {
  1447. type NoMethod Money
  1448. raw := NoMethod(*s)
  1449. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1450. }
  1451. // Operation: Represents information regarding an operation.
  1452. type Operation struct {
  1453. // ConsumerId: Identity of the consumer who is using the service.
  1454. // This field should be filled in for the operations initiated by
  1455. // a
  1456. // consumer, but not for service-initiated operations that are
  1457. // not related to a specific consumer.
  1458. //
  1459. // - This can be in one of the following formats:
  1460. // - project:PROJECT_ID,
  1461. // - project`_`number:PROJECT_NUMBER,
  1462. // - projects/RPOJECT_ID or PROJECT_NUMBER,
  1463. // - folders/FOLDER_NUMBER,
  1464. // - organizations/ORGANIZATION_NUMBER,
  1465. // - api`_`key:API_KEY.
  1466. ConsumerId string `json:"consumerId,omitempty"`
  1467. // EndTime: End time of the operation.
  1468. // Required when the operation is used in ServiceController.Report,
  1469. // but optional when the operation is used in ServiceController.Check.
  1470. EndTime string `json:"endTime,omitempty"`
  1471. // Importance: DO NOT USE. This is an experimental field.
  1472. //
  1473. // Possible values:
  1474. // "LOW" - The API implementation may cache and aggregate the
  1475. // data.
  1476. // The data may be lost when rare and unexpected system failures occur.
  1477. // "HIGH" - The API implementation doesn't cache and aggregate the
  1478. // data.
  1479. // If the method returns successfully, it's guaranteed that the data
  1480. // has
  1481. // been persisted in durable storage.
  1482. // "DEBUG" - In addition to the behavior described in HIGH, DEBUG
  1483. // enables
  1484. // additional validation logic that is only useful during the
  1485. // onboarding
  1486. // process. This is only available to Google internal services and
  1487. // the service must be whitelisted by chemist-dev@google.com in order
  1488. // to use this level.
  1489. Importance string `json:"importance,omitempty"`
  1490. // Labels: Labels describing the operation. Only the following labels
  1491. // are allowed:
  1492. //
  1493. // - Labels describing monitored resources as defined in
  1494. // the service configuration.
  1495. // - Default labels of metric values. When specified, labels defined in
  1496. // the
  1497. // metric value override these default.
  1498. // - The following labels defined by Google Cloud Platform:
  1499. // - `cloud.googleapis.com/location` describing the location where
  1500. // the
  1501. // operation happened,
  1502. // - `servicecontrol.googleapis.com/user_agent` describing the user
  1503. // agent
  1504. // of the API request,
  1505. // - `servicecontrol.googleapis.com/service_agent` describing the
  1506. // service
  1507. // used to handle the API request (e.g. ESP),
  1508. // - `servicecontrol.googleapis.com/platform` describing the
  1509. // platform
  1510. // where the API is served, such as App Engine, Compute Engine,
  1511. // or
  1512. // Kubernetes Engine.
  1513. Labels map[string]string `json:"labels,omitempty"`
  1514. // LogEntries: Represents information to be logged.
  1515. LogEntries []*LogEntry `json:"logEntries,omitempty"`
  1516. // MetricValueSets: Represents information about this operation. Each
  1517. // MetricValueSet
  1518. // corresponds to a metric defined in the service configuration.
  1519. // The data type used in the MetricValueSet must agree with
  1520. // the data type specified in the metric definition.
  1521. //
  1522. // Within a single operation, it is not allowed to have more than
  1523. // one
  1524. // MetricValue instances that have the same metric names and
  1525. // identical
  1526. // label value combinations. If a request has such duplicated
  1527. // MetricValue
  1528. // instances, the entire request is rejected with
  1529. // an invalid argument error.
  1530. MetricValueSets []*MetricValueSet `json:"metricValueSets,omitempty"`
  1531. // OperationId: Identity of the operation. This must be unique within
  1532. // the scope of the
  1533. // service that generated the operation. If the service calls
  1534. // Check() and Report() on the same operation, the two calls should
  1535. // carry
  1536. // the same id.
  1537. //
  1538. // UUID version 4 is recommended, though not required.
  1539. // In scenarios where an operation is computed from existing
  1540. // information
  1541. // and an idempotent id is desirable for deduplication purpose, UUID
  1542. // version 5
  1543. // is recommended. See RFC 4122 for details.
  1544. OperationId string `json:"operationId,omitempty"`
  1545. // OperationName: Fully qualified name of the operation. Reserved for
  1546. // future use.
  1547. OperationName string `json:"operationName,omitempty"`
  1548. // QuotaProperties: Represents the properties needed for quota check.
  1549. // Applicable only if this
  1550. // operation is for a quota check request. If this is not specified, no
  1551. // quota
  1552. // check will be performed.
  1553. QuotaProperties *QuotaProperties `json:"quotaProperties,omitempty"`
  1554. // ResourceContainer: DO NOT USE. This field is deprecated, use
  1555. // "resources" field instead.
  1556. // The resource name of the parent of a resource in the resource
  1557. // hierarchy.
  1558. //
  1559. // This can be in one of the following formats:
  1560. // - “projects/<project-id or project-number>”
  1561. // - “folders/<folder-id>”
  1562. // - “organizations/<organization-id>”
  1563. ResourceContainer string `json:"resourceContainer,omitempty"`
  1564. // Resources: The resources that are involved in the operation.
  1565. // The maximum supported number of entries in this field is 100.
  1566. Resources []*ResourceInfo `json:"resources,omitempty"`
  1567. // StartTime: Required. Start time of the operation.
  1568. StartTime string `json:"startTime,omitempty"`
  1569. // UserLabels: User defined labels for the resource that this operation
  1570. // is associated
  1571. // with. Only a combination of 1000 user labels per consumer project
  1572. // are
  1573. // allowed.
  1574. UserLabels map[string]string `json:"userLabels,omitempty"`
  1575. // ForceSendFields is a list of field names (e.g. "ConsumerId") to
  1576. // unconditionally include in API requests. By default, fields with
  1577. // empty values are omitted from API requests. However, any non-pointer,
  1578. // non-interface field appearing in ForceSendFields will be sent to the
  1579. // server regardless of whether the field is empty or not. This may be
  1580. // used to include empty fields in Patch requests.
  1581. ForceSendFields []string `json:"-"`
  1582. // NullFields is a list of field names (e.g. "ConsumerId") to include in
  1583. // API requests with the JSON null value. By default, fields with empty
  1584. // values are omitted from API requests. However, any field with an
  1585. // empty value appearing in NullFields will be sent to the server as
  1586. // null. It is an error if a field in this list has a non-empty value.
  1587. // This may be used to include null fields in Patch requests.
  1588. NullFields []string `json:"-"`
  1589. }
  1590. func (s *Operation) MarshalJSON() ([]byte, error) {
  1591. type NoMethod Operation
  1592. raw := NoMethod(*s)
  1593. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1594. }
  1595. // Peer: This message defines attributes for a node that handles a
  1596. // network request.
  1597. // The node can be either a service or an application that sends,
  1598. // forwards,
  1599. // or receives the request. Service peers should fill in the
  1600. // `service`,
  1601. // `principal`, and `labels` as appropriate.
  1602. type Peer struct {
  1603. // Ip: The IP address of the peer.
  1604. Ip string `json:"ip,omitempty"`
  1605. // Labels: The labels associated with the peer.
  1606. Labels map[string]string `json:"labels,omitempty"`
  1607. // Port: The network port of the peer.
  1608. Port int64 `json:"port,omitempty,string"`
  1609. // Principal: The identity of this peer. Similar to
  1610. // `Request.auth.principal`, but
  1611. // relative to the peer instead of the request. For example, the
  1612. // idenity associated with a load balancer that forwared the request.
  1613. Principal string `json:"principal,omitempty"`
  1614. // RegionCode: The CLDR country/region code associated with the above IP
  1615. // address.
  1616. // If the IP address is private, the `region_code` should reflect
  1617. // the
  1618. // physical location where this peer is running.
  1619. RegionCode string `json:"regionCode,omitempty"`
  1620. // Service: The canonical service name of the peer.
  1621. //
  1622. // NOTE: different systems may have different service naming schemes.
  1623. Service string `json:"service,omitempty"`
  1624. // ForceSendFields is a list of field names (e.g. "Ip") to
  1625. // unconditionally include in API requests. By default, fields with
  1626. // empty values are omitted from API requests. However, any non-pointer,
  1627. // non-interface field appearing in ForceSendFields will be sent to the
  1628. // server regardless of whether the field is empty or not. This may be
  1629. // used to include empty fields in Patch requests.
  1630. ForceSendFields []string `json:"-"`
  1631. // NullFields is a list of field names (e.g. "Ip") to include in API
  1632. // requests with the JSON null value. By default, fields with empty
  1633. // values are omitted from API requests. However, any field with an
  1634. // empty value appearing in NullFields will be sent to the server as
  1635. // null. It is an error if a field in this list has a non-empty value.
  1636. // This may be used to include null fields in Patch requests.
  1637. NullFields []string `json:"-"`
  1638. }
  1639. func (s *Peer) MarshalJSON() ([]byte, error) {
  1640. type NoMethod Peer
  1641. raw := NoMethod(*s)
  1642. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1643. }
  1644. // QuotaError: Represents error information for QuotaOperation.
  1645. type QuotaError struct {
  1646. // Code: Error code.
  1647. //
  1648. // Possible values:
  1649. // "UNSPECIFIED" - This is never used.
  1650. // "RESOURCE_EXHAUSTED" - Quota allocation failed.
  1651. // Same as google.rpc.Code.RESOURCE_EXHAUSTED.
  1652. // "OUT_OF_RANGE" - Quota release failed. This error is ONLY returned
  1653. // on a NORMAL release.
  1654. // More formally: if a user requests a release of 10 tokens, but only
  1655. // 5 tokens were previously allocated, in a BEST_EFFORT release, this
  1656. // will
  1657. // be considered a success, 5 tokens will be released, and the result
  1658. // will
  1659. // be "Ok". If this is done in NORMAL mode, no tokens will be
  1660. // released,
  1661. // and an OUT_OF_RANGE error will be returned.
  1662. // Same as google.rpc.Code.OUT_OF_RANGE.
  1663. // "BILLING_NOT_ACTIVE" - Consumer cannot access the service because
  1664. // the service requires active
  1665. // billing.
  1666. // "PROJECT_DELETED" - Consumer's project has been marked as deleted
  1667. // (soft deletion).
  1668. // "API_KEY_INVALID" - Specified API key is invalid.
  1669. // "API_KEY_EXPIRED" - Specified API Key has expired.
  1670. // "SPATULA_HEADER_INVALID" - Consumer's spatula header is invalid.
  1671. // "LOAS_ROLE_INVALID" - The consumer's LOAS role is invalid.
  1672. // "NO_LOAS_PROJECT" - The consumer's LOAS role has no associated
  1673. // project.
  1674. // "PROJECT_STATUS_UNAVAILABLE" - The backend server for looking up
  1675. // project id/number is unavailable.
  1676. // "SERVICE_STATUS_UNAVAILABLE" - The backend server for checking
  1677. // service status is unavailable.
  1678. // "BILLING_STATUS_UNAVAILABLE" - The backend server for checking
  1679. // billing status is unavailable.
  1680. // "QUOTA_SYSTEM_UNAVAILABLE" - The backend server for checking quota
  1681. // limits is unavailable.
  1682. Code string `json:"code,omitempty"`
  1683. // Description: Free-form text that provides details on the cause of the
  1684. // error.
  1685. Description string `json:"description,omitempty"`
  1686. // Subject: Subject to whom this error applies. See the specific enum
  1687. // for more details
  1688. // on this field. For example, "clientip:<ip address of client>"
  1689. // or
  1690. // "project:<Google developer project id>".
  1691. Subject string `json:"subject,omitempty"`
  1692. // ForceSendFields is a list of field names (e.g. "Code") to
  1693. // unconditionally include in API requests. By default, fields with
  1694. // empty values are omitted from API requests. However, any non-pointer,
  1695. // non-interface field appearing in ForceSendFields will be sent to the
  1696. // server regardless of whether the field is empty or not. This may be
  1697. // used to include empty fields in Patch requests.
  1698. ForceSendFields []string `json:"-"`
  1699. // NullFields is a list of field names (e.g. "Code") to include in API
  1700. // requests with the JSON null value. By default, fields with empty
  1701. // values are omitted from API requests. However, any field with an
  1702. // empty value appearing in NullFields will be sent to the server as
  1703. // null. It is an error if a field in this list has a non-empty value.
  1704. // This may be used to include null fields in Patch requests.
  1705. NullFields []string `json:"-"`
  1706. }
  1707. func (s *QuotaError) MarshalJSON() ([]byte, error) {
  1708. type NoMethod QuotaError
  1709. raw := NoMethod(*s)
  1710. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1711. }
  1712. // QuotaInfo: Contains the quota information for a quota check response.
  1713. type QuotaInfo struct {
  1714. // LimitExceeded: Quota Metrics that have exceeded quota limits.
  1715. // For QuotaGroup-based quota, this is QuotaGroup.name
  1716. // For QuotaLimit-based quota, this is QuotaLimit.name
  1717. // See: google.api.Quota
  1718. // Deprecated: Use quota_metrics to get per quota group limit exceeded
  1719. // status.
  1720. LimitExceeded []string `json:"limitExceeded,omitempty"`
  1721. // QuotaConsumed: Map of quota group name to the actual number of tokens
  1722. // consumed. If the
  1723. // quota check was not successful, then this will not be populated due
  1724. // to no
  1725. // quota consumption.
  1726. //
  1727. // We are not merging this field with 'quota_metrics' field because of
  1728. // the
  1729. // complexity of scaling in Chemist client code base. For simplicity, we
  1730. // will
  1731. // keep this field for Castor (that scales quota usage) and
  1732. // 'quota_metrics'
  1733. // for SuperQuota (that doesn't scale quota usage).
  1734. //
  1735. QuotaConsumed map[string]int64 `json:"quotaConsumed,omitempty"`
  1736. // QuotaMetrics: Quota metrics to indicate the usage. Depending on the
  1737. // check request, one or
  1738. // more of the following metrics will be included:
  1739. //
  1740. // 1. For rate quota, per quota group or per quota metric incremental
  1741. // usage
  1742. // will be specified using the following delta metric:
  1743. // "serviceruntime.googleapis.com/api/consumer/quota_used_count"
  1744. //
  1745. // 2. For allocation quota, per quota metric total usage will be
  1746. // specified
  1747. // using the following gauge metric:
  1748. //
  1749. // "serviceruntime.googleapis.com/allocation/consumer/quota_used_count"
  1750. //
  1751. //
  1752. // 3. For both rate quota and allocation quota, the quota limit
  1753. // reached
  1754. // condition will be specified using the following boolean metric:
  1755. // "serviceruntime.googleapis.com/quota/exceeded"
  1756. QuotaMetrics []*MetricValueSet `json:"quotaMetrics,omitempty"`
  1757. // ForceSendFields is a list of field names (e.g. "LimitExceeded") to
  1758. // unconditionally include in API requests. By default, fields with
  1759. // empty values are omitted from API requests. However, any non-pointer,
  1760. // non-interface field appearing in ForceSendFields will be sent to the
  1761. // server regardless of whether the field is empty or not. This may be
  1762. // used to include empty fields in Patch requests.
  1763. ForceSendFields []string `json:"-"`
  1764. // NullFields is a list of field names (e.g. "LimitExceeded") to include
  1765. // in API requests with the JSON null value. By default, fields with
  1766. // empty values are omitted from API requests. However, any field with
  1767. // an empty value appearing in NullFields will be sent to the server as
  1768. // null. It is an error if a field in this list has a non-empty value.
  1769. // This may be used to include null fields in Patch requests.
  1770. NullFields []string `json:"-"`
  1771. }
  1772. func (s *QuotaInfo) MarshalJSON() ([]byte, error) {
  1773. type NoMethod QuotaInfo
  1774. raw := NoMethod(*s)
  1775. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1776. }
  1777. // QuotaOperation: Represents information regarding a quota operation.
  1778. type QuotaOperation struct {
  1779. // ConsumerId: Identity of the consumer for whom this quota operation is
  1780. // being performed.
  1781. //
  1782. // This can be in one of the following formats:
  1783. // project:<project_id>,
  1784. // project_number:<project_number>,
  1785. // api_key:<api_key>.
  1786. ConsumerId string `json:"consumerId,omitempty"`
  1787. // Labels: Labels describing the operation.
  1788. Labels map[string]string `json:"labels,omitempty"`
  1789. // MethodName: Fully qualified name of the API method for which this
  1790. // quota operation is
  1791. // requested. This name is used for matching quota rules or metric rules
  1792. // and
  1793. // billing status rules defined in service configuration.
  1794. //
  1795. // This field should not be set if any of the following is true:
  1796. // (1) the quota operation is performed on non-API resources.
  1797. // (2) quota_metrics is set because the caller is doing quota
  1798. // override.
  1799. //
  1800. // Example of an RPC method name:
  1801. // google.example.library.v1.LibraryService.CreateShelf
  1802. MethodName string `json:"methodName,omitempty"`
  1803. // OperationId: Identity of the operation. This is expected to be unique
  1804. // within the scope
  1805. // of the service that generated the operation, and guarantees
  1806. // idempotency in
  1807. // case of retries.
  1808. //
  1809. // UUID version 4 is recommended, though not required. In scenarios
  1810. // where an
  1811. // operation is computed from existing information and an idempotent id
  1812. // is
  1813. // desirable for deduplication purpose, UUID version 5 is recommended.
  1814. // See
  1815. // RFC 4122 for details.
  1816. OperationId string `json:"operationId,omitempty"`
  1817. // QuotaMetrics: Represents information about this operation. Each
  1818. // MetricValueSet
  1819. // corresponds to a metric defined in the service configuration.
  1820. // The data type used in the MetricValueSet must agree with
  1821. // the data type specified in the metric definition.
  1822. //
  1823. // Within a single operation, it is not allowed to have more than
  1824. // one
  1825. // MetricValue instances that have the same metric names and
  1826. // identical
  1827. // label value combinations. If a request has such duplicated
  1828. // MetricValue
  1829. // instances, the entire request is rejected with
  1830. // an invalid argument error.
  1831. //
  1832. // This field is mutually exclusive with method_name.
  1833. QuotaMetrics []*MetricValueSet `json:"quotaMetrics,omitempty"`
  1834. // QuotaMode: Quota mode for this operation.
  1835. //
  1836. // Possible values:
  1837. // "UNSPECIFIED" - Guard against implicit default. Must not be used.
  1838. // "NORMAL" - For AllocateQuota request, allocates quota for the
  1839. // amount specified in
  1840. // the service configuration or specified using the quota metrics. If
  1841. // the
  1842. // amount is higher than the available quota, allocation error will
  1843. // be
  1844. // returned and no quota will be allocated.
  1845. // If multiple quotas are part of the request, and one fails, none of
  1846. // the
  1847. // quotas are allocated or released.
  1848. // "BEST_EFFORT" - The operation allocates quota for the amount
  1849. // specified in the service
  1850. // configuration or specified using the quota metrics. If the amount
  1851. // is
  1852. // higher than the available quota, request does not fail but all
  1853. // available
  1854. // quota will be allocated.
  1855. // For rate quota, BEST_EFFORT will continue to deduct from other
  1856. // groups
  1857. // even if one does not have enough quota. For allocation, it will find
  1858. // the
  1859. // minimum available amount across all groups and deduct that amount
  1860. // from
  1861. // all the affected groups.
  1862. // "CHECK_ONLY" - For AllocateQuota request, only checks if there is
  1863. // enough quota
  1864. // available and does not change the available quota. No lock is placed
  1865. // on
  1866. // the available quota either.
  1867. QuotaMode string `json:"quotaMode,omitempty"`
  1868. // ForceSendFields is a list of field names (e.g. "ConsumerId") to
  1869. // unconditionally include in API requests. By default, fields with
  1870. // empty values are omitted from API requests. However, any non-pointer,
  1871. // non-interface field appearing in ForceSendFields will be sent to the
  1872. // server regardless of whether the field is empty or not. This may be
  1873. // used to include empty fields in Patch requests.
  1874. ForceSendFields []string `json:"-"`
  1875. // NullFields is a list of field names (e.g. "ConsumerId") to include in
  1876. // API requests with the JSON null value. By default, fields with empty
  1877. // values are omitted from API requests. However, any field with an
  1878. // empty value appearing in NullFields will be sent to the server as
  1879. // null. It is an error if a field in this list has a non-empty value.
  1880. // This may be used to include null fields in Patch requests.
  1881. NullFields []string `json:"-"`
  1882. }
  1883. func (s *QuotaOperation) MarshalJSON() ([]byte, error) {
  1884. type NoMethod QuotaOperation
  1885. raw := NoMethod(*s)
  1886. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1887. }
  1888. // QuotaProperties: Represents the properties needed for quota
  1889. // operations.
  1890. type QuotaProperties struct {
  1891. // QuotaMode: Quota mode for this operation.
  1892. //
  1893. // Possible values:
  1894. // "ACQUIRE" - Decreases available quota by the cost specified for the
  1895. // operation.
  1896. // If cost is higher than available quota, operation fails and
  1897. // returns
  1898. // error.
  1899. // "ACQUIRE_BEST_EFFORT" - Decreases available quota by the cost
  1900. // specified for the operation.
  1901. // If cost is higher than available quota, operation does not fail
  1902. // and
  1903. // available quota goes down to zero but it returns error.
  1904. // "CHECK" - Does not change any available quota. Only checks if there
  1905. // is enough
  1906. // quota.
  1907. // No lock is placed on the checked tokens neither.
  1908. // "RELEASE" - Increases available quota by the operation cost
  1909. // specified for the
  1910. // operation.
  1911. QuotaMode string `json:"quotaMode,omitempty"`
  1912. // ForceSendFields is a list of field names (e.g. "QuotaMode") to
  1913. // unconditionally include in API requests. By default, fields with
  1914. // empty values are omitted from API requests. However, any non-pointer,
  1915. // non-interface field appearing in ForceSendFields will be sent to the
  1916. // server regardless of whether the field is empty or not. This may be
  1917. // used to include empty fields in Patch requests.
  1918. ForceSendFields []string `json:"-"`
  1919. // NullFields is a list of field names (e.g. "QuotaMode") to include in
  1920. // API requests with the JSON null value. By default, fields with empty
  1921. // values are omitted from API requests. However, any field with an
  1922. // empty value appearing in NullFields will be sent to the server as
  1923. // null. It is an error if a field in this list has a non-empty value.
  1924. // This may be used to include null fields in Patch requests.
  1925. NullFields []string `json:"-"`
  1926. }
  1927. func (s *QuotaProperties) MarshalJSON() ([]byte, error) {
  1928. type NoMethod QuotaProperties
  1929. raw := NoMethod(*s)
  1930. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1931. }
  1932. // ReportError: Represents the processing error of one Operation in the
  1933. // request.
  1934. type ReportError struct {
  1935. // OperationId: The Operation.operation_id value from the request.
  1936. OperationId string `json:"operationId,omitempty"`
  1937. // Status: Details of the error when processing the Operation.
  1938. Status *Status `json:"status,omitempty"`
  1939. // ForceSendFields is a list of field names (e.g. "OperationId") to
  1940. // unconditionally include in API requests. By default, fields with
  1941. // empty values are omitted from API requests. However, any non-pointer,
  1942. // non-interface field appearing in ForceSendFields will be sent to the
  1943. // server regardless of whether the field is empty or not. This may be
  1944. // used to include empty fields in Patch requests.
  1945. ForceSendFields []string `json:"-"`
  1946. // NullFields is a list of field names (e.g. "OperationId") to include
  1947. // in API requests with the JSON null value. By default, fields with
  1948. // empty values are omitted from API requests. However, any field with
  1949. // an empty value appearing in NullFields will be sent to the server as
  1950. // null. It is an error if a field in this list has a non-empty value.
  1951. // This may be used to include null fields in Patch requests.
  1952. NullFields []string `json:"-"`
  1953. }
  1954. func (s *ReportError) MarshalJSON() ([]byte, error) {
  1955. type NoMethod ReportError
  1956. raw := NoMethod(*s)
  1957. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1958. }
  1959. // ReportInfo: Contains additional info about the report operation.
  1960. type ReportInfo struct {
  1961. // OperationId: The Operation.operation_id value from the request.
  1962. OperationId string `json:"operationId,omitempty"`
  1963. // QuotaInfo: Quota usage info when processing the `Operation`.
  1964. QuotaInfo *QuotaInfo `json:"quotaInfo,omitempty"`
  1965. // ForceSendFields is a list of field names (e.g. "OperationId") to
  1966. // unconditionally include in API requests. By default, fields with
  1967. // empty values are omitted from API requests. However, any non-pointer,
  1968. // non-interface field appearing in ForceSendFields will be sent to the
  1969. // server regardless of whether the field is empty or not. This may be
  1970. // used to include empty fields in Patch requests.
  1971. ForceSendFields []string `json:"-"`
  1972. // NullFields is a list of field names (e.g. "OperationId") to include
  1973. // in API requests with the JSON null value. By default, fields with
  1974. // empty values are omitted from API requests. However, any field with
  1975. // an empty value appearing in NullFields will be sent to the server as
  1976. // null. It is an error if a field in this list has a non-empty value.
  1977. // This may be used to include null fields in Patch requests.
  1978. NullFields []string `json:"-"`
  1979. }
  1980. func (s *ReportInfo) MarshalJSON() ([]byte, error) {
  1981. type NoMethod ReportInfo
  1982. raw := NoMethod(*s)
  1983. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1984. }
  1985. // ReportRequest: Request message for the Report method.
  1986. type ReportRequest struct {
  1987. // Operations: Operations to be reported.
  1988. //
  1989. // Typically the service should report one operation per
  1990. // request.
  1991. // Putting multiple operations into a single request is allowed, but
  1992. // should
  1993. // be used only when multiple operations are natually available at the
  1994. // time
  1995. // of the report.
  1996. //
  1997. // If multiple operations are in a single request, the total request
  1998. // size
  1999. // should be no larger than 1MB. See ReportResponse.report_errors
  2000. // for
  2001. // partial failure behavior.
  2002. Operations []*Operation `json:"operations,omitempty"`
  2003. // ServiceConfigId: Specifies which version of service config should be
  2004. // used to process the
  2005. // request.
  2006. //
  2007. // If unspecified or no matching version can be found, the
  2008. // latest one will be used.
  2009. ServiceConfigId string `json:"serviceConfigId,omitempty"`
  2010. // ForceSendFields is a list of field names (e.g. "Operations") to
  2011. // unconditionally include in API requests. By default, fields with
  2012. // empty values are omitted from API requests. However, any non-pointer,
  2013. // non-interface field appearing in ForceSendFields will be sent to the
  2014. // server regardless of whether the field is empty or not. This may be
  2015. // used to include empty fields in Patch requests.
  2016. ForceSendFields []string `json:"-"`
  2017. // NullFields is a list of field names (e.g. "Operations") to include in
  2018. // API requests with the JSON null value. By default, fields with empty
  2019. // values are omitted from API requests. However, any field with an
  2020. // empty value appearing in NullFields will be sent to the server as
  2021. // null. It is an error if a field in this list has a non-empty value.
  2022. // This may be used to include null fields in Patch requests.
  2023. NullFields []string `json:"-"`
  2024. }
  2025. func (s *ReportRequest) MarshalJSON() ([]byte, error) {
  2026. type NoMethod ReportRequest
  2027. raw := NoMethod(*s)
  2028. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2029. }
  2030. // ReportResponse: Response message for the Report method.
  2031. type ReportResponse struct {
  2032. // ReportErrors: Partial failures, one for each `Operation` in the
  2033. // request that failed
  2034. // processing. There are three possible combinations of the RPC
  2035. // status:
  2036. //
  2037. // 1. The combination of a successful RPC status and an empty
  2038. // `report_errors`
  2039. // list indicates a complete success where all `Operations` in the
  2040. // request are processed successfully.
  2041. // 2. The combination of a successful RPC status and a non-empty
  2042. // `report_errors` list indicates a partial success where some
  2043. // `Operations` in the request succeeded. Each
  2044. // `Operation` that failed processing has a corresponding item
  2045. // in this list.
  2046. // 3. A failed RPC status indicates a general non-deterministic
  2047. // failure.
  2048. // When this happens, it's impossible to know which of the
  2049. // 'Operations' in the request succeeded or failed.
  2050. ReportErrors []*ReportError `json:"reportErrors,omitempty"`
  2051. // ReportInfos: Quota usage for each quota release `Operation`
  2052. // request.
  2053. //
  2054. // Fully or partially failed quota release request may or may not be
  2055. // present
  2056. // in `report_quota_info`. For example, a failed quota release request
  2057. // will
  2058. // have the current quota usage info when precise quota library returns
  2059. // the
  2060. // info. A deadline exceeded quota request will not have quota usage
  2061. // info.
  2062. //
  2063. // If there is no quota release request, report_quota_info will be
  2064. // empty.
  2065. //
  2066. ReportInfos []*ReportInfo `json:"reportInfos,omitempty"`
  2067. // ServiceConfigId: The actual config id used to process the request.
  2068. ServiceConfigId string `json:"serviceConfigId,omitempty"`
  2069. // ServerResponse contains the HTTP response code and headers from the
  2070. // server.
  2071. googleapi.ServerResponse `json:"-"`
  2072. // ForceSendFields is a list of field names (e.g. "ReportErrors") to
  2073. // unconditionally include in API requests. By default, fields with
  2074. // empty values are omitted from API requests. However, any non-pointer,
  2075. // non-interface field appearing in ForceSendFields will be sent to the
  2076. // server regardless of whether the field is empty or not. This may be
  2077. // used to include empty fields in Patch requests.
  2078. ForceSendFields []string `json:"-"`
  2079. // NullFields is a list of field names (e.g. "ReportErrors") to include
  2080. // in API requests with the JSON null value. By default, fields with
  2081. // empty values are omitted from API requests. However, any field with
  2082. // an empty value appearing in NullFields will be sent to the server as
  2083. // null. It is an error if a field in this list has a non-empty value.
  2084. // This may be used to include null fields in Patch requests.
  2085. NullFields []string `json:"-"`
  2086. }
  2087. func (s *ReportResponse) MarshalJSON() ([]byte, error) {
  2088. type NoMethod ReportResponse
  2089. raw := NoMethod(*s)
  2090. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2091. }
  2092. // Request: This message defines attributes for an HTTP request. If the
  2093. // actual
  2094. // request is not an HTTP request, the runtime system should try to
  2095. // map
  2096. // the actual request to an equivalent HTTP request.
  2097. type Request struct {
  2098. // Auth: The request authentication. May be absent for unauthenticated
  2099. // requests.
  2100. // Derived from the HTTP request `Authorization` header or equivalent.
  2101. Auth *Auth `json:"auth,omitempty"`
  2102. // Fragment: The HTTP URL fragment. No URL decoding is performed.
  2103. Fragment string `json:"fragment,omitempty"`
  2104. // Headers: The HTTP request headers. If multiple headers share the same
  2105. // key, they
  2106. // must be merged according to the HTTP spec. All header keys must
  2107. // be
  2108. // lowercased, because HTTP header keys are case-insensitive.
  2109. Headers map[string]string `json:"headers,omitempty"`
  2110. // Host: The HTTP request `Host` header value.
  2111. Host string `json:"host,omitempty"`
  2112. // Id: The unique ID for a request, which can be propagated to
  2113. // downstream
  2114. // systems. The ID should have low probability of collision
  2115. // within a single day for a specific service.
  2116. Id string `json:"id,omitempty"`
  2117. // Method: The HTTP request method, such as `GET`, `POST`.
  2118. Method string `json:"method,omitempty"`
  2119. // Path: The HTTP URL path.
  2120. Path string `json:"path,omitempty"`
  2121. // Protocol: The network protocol used with the request, such as
  2122. // "http/1.1",
  2123. // "spdy/3", "h2", "h2c", "webrtc", "tcp", "udp", "quic".
  2124. // See
  2125. // https://www.iana.org/assignments/tls-extensiontype-values/tls-exte
  2126. // nsiontype-values.xhtml#alpn-protocol-ids
  2127. // for details.
  2128. Protocol string `json:"protocol,omitempty"`
  2129. // Query: The HTTP URL query in the format of
  2130. // `name1=value`&name2=value2`, as it
  2131. // appears in the first line of the HTTP request. No decoding is
  2132. // performed.
  2133. Query string `json:"query,omitempty"`
  2134. // Reason: A special parameter for request reason. It is used by
  2135. // security systems
  2136. // to associate auditing information with a request.
  2137. Reason string `json:"reason,omitempty"`
  2138. // Scheme: The HTTP URL scheme, such as `http` and `https`.
  2139. Scheme string `json:"scheme,omitempty"`
  2140. // Size: The HTTP request size in bytes. If unknown, it must be -1.
  2141. Size int64 `json:"size,omitempty,string"`
  2142. // Time: The timestamp when the `destination` service receives the first
  2143. // byte of
  2144. // the request.
  2145. Time string `json:"time,omitempty"`
  2146. // ForceSendFields is a list of field names (e.g. "Auth") to
  2147. // unconditionally include in API requests. By default, fields with
  2148. // empty values are omitted from API requests. However, any non-pointer,
  2149. // non-interface field appearing in ForceSendFields will be sent to the
  2150. // server regardless of whether the field is empty or not. This may be
  2151. // used to include empty fields in Patch requests.
  2152. ForceSendFields []string `json:"-"`
  2153. // NullFields is a list of field names (e.g. "Auth") to include in API
  2154. // requests with the JSON null value. By default, fields with empty
  2155. // values are omitted from API requests. However, any field with an
  2156. // empty value appearing in NullFields will be sent to the server as
  2157. // null. It is an error if a field in this list has a non-empty value.
  2158. // This may be used to include null fields in Patch requests.
  2159. NullFields []string `json:"-"`
  2160. }
  2161. func (s *Request) MarshalJSON() ([]byte, error) {
  2162. type NoMethod Request
  2163. raw := NoMethod(*s)
  2164. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2165. }
  2166. // RequestMetadata: Metadata about the request.
  2167. type RequestMetadata struct {
  2168. // CallerIp: The IP address of the caller.
  2169. // For caller from internet, this will be public IPv4 or IPv6
  2170. // address.
  2171. // For caller from a Compute Engine VM with external IP address,
  2172. // this
  2173. // will be the VM's external IP address. For caller from a
  2174. // Compute
  2175. // Engine VM without external IP address, if the VM is in the
  2176. // same
  2177. // organization (or project) as the accessed resource, `caller_ip`
  2178. // will
  2179. // be the VM's internal IPv4 address, otherwise the `caller_ip` will
  2180. // be
  2181. // redacted to "gce-internal-ip".
  2182. // See https://cloud.google.com/compute/docs/vpc/ for more information.
  2183. CallerIp string `json:"callerIp,omitempty"`
  2184. // CallerNetwork: The network of the caller.
  2185. // Set only if the network host project is part of the same GCP
  2186. // organization
  2187. // (or project) as the accessed resource.
  2188. // See https://cloud.google.com/compute/docs/vpc/ for more
  2189. // information.
  2190. // This is a scheme-less URI full resource name. For example:
  2191. //
  2192. //
  2193. // "//compute.googleapis.com/projects/PROJECT_ID/global/networks/NETWORK_
  2194. // ID"
  2195. CallerNetwork string `json:"callerNetwork,omitempty"`
  2196. // CallerSuppliedUserAgent: The user agent of the caller.
  2197. // This information is not authenticated and should be treated
  2198. // accordingly.
  2199. // For example:
  2200. //
  2201. // + `google-api-python-client/1.4.0`:
  2202. // The request was made by the Google API client for Python.
  2203. // + `Cloud SDK Command Line Tool apitools-client/1.0 gcloud/0.9.62`:
  2204. // The request was made by the Google Cloud SDK CLI (gcloud).
  2205. // + `AppEngine-Google; (+http://code.google.com/appengine;
  2206. // appid:
  2207. // s~my-project`:
  2208. // The request was made from the `my-project` App Engine app.
  2209. // NOLINT
  2210. CallerSuppliedUserAgent string `json:"callerSuppliedUserAgent,omitempty"`
  2211. // DestinationAttributes: The destination of a network activity, such as
  2212. // accepting a TCP connection.
  2213. // In a multi hop network activity, the destination represents the
  2214. // receiver of
  2215. // the last hop. Only two fields are used in this message, Peer.port
  2216. // and
  2217. // Peer.ip. These fields are optionally populated by those services
  2218. // utilizing
  2219. // the IAM condition feature.
  2220. DestinationAttributes *Peer `json:"destinationAttributes,omitempty"`
  2221. // RequestAttributes: Request attributes used in IAM condition
  2222. // evaluation. This field contains
  2223. // request attributes like request time and access levels associated
  2224. // with
  2225. // the request.
  2226. //
  2227. //
  2228. // To get the whole view of the attributes used in IAM
  2229. // condition evaluation, the user must also look
  2230. // into
  2231. // `AuditLog.authentication_info.resource_attributes`.
  2232. RequestAttributes *Request `json:"requestAttributes,omitempty"`
  2233. // ForceSendFields is a list of field names (e.g. "CallerIp") to
  2234. // unconditionally include in API requests. By default, fields with
  2235. // empty values are omitted from API requests. However, any non-pointer,
  2236. // non-interface field appearing in ForceSendFields will be sent to the
  2237. // server regardless of whether the field is empty or not. This may be
  2238. // used to include empty fields in Patch requests.
  2239. ForceSendFields []string `json:"-"`
  2240. // NullFields is a list of field names (e.g. "CallerIp") to include in
  2241. // API requests with the JSON null value. By default, fields with empty
  2242. // values are omitted from API requests. However, any field with an
  2243. // empty value appearing in NullFields will be sent to the server as
  2244. // null. It is an error if a field in this list has a non-empty value.
  2245. // This may be used to include null fields in Patch requests.
  2246. NullFields []string `json:"-"`
  2247. }
  2248. func (s *RequestMetadata) MarshalJSON() ([]byte, error) {
  2249. type NoMethod RequestMetadata
  2250. raw := NoMethod(*s)
  2251. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2252. }
  2253. // Resource: This message defines core attributes for a resource. A
  2254. // resource is an
  2255. // addressable (named) entity provided by the destination service.
  2256. // For
  2257. // example, a file stored on a network storage service.
  2258. type Resource struct {
  2259. // Labels: The labels or tags on the resource, such as AWS resource tags
  2260. // and
  2261. // Kubernetes resource labels.
  2262. Labels map[string]string `json:"labels,omitempty"`
  2263. // Name: The stable identifier (name) of a resource on the `service`. A
  2264. // resource
  2265. // can be logically identified as
  2266. // "//{resource.service}/{resource.name}".
  2267. // The differences between a resource name and a URI are:
  2268. //
  2269. // * Resource name is a logical identifier, independent of network
  2270. // protocol and API version. For example,
  2271. // `//pubsub.googleapis.com/projects/123/topics/news-feed`.
  2272. // * URI often includes protocol and version information, so it can
  2273. // be used directly by applications. For example,
  2274. //
  2275. // `https://pubsub.googleapis.com/v1/projects/123/topics/news-feed`.
  2276. //
  2277. // See
  2278. // https://cloud.google.com/apis/design/resource_names for details.
  2279. Name string `json:"name,omitempty"`
  2280. // Service: The name of the service that this resource belongs to, such
  2281. // as
  2282. // `pubsub.googleapis.com`. The service may be different from the
  2283. // DNS
  2284. // hostname that actually serves the request.
  2285. Service string `json:"service,omitempty"`
  2286. // Type: The type of the resource. The scheme is platform-specific
  2287. // because
  2288. // different platforms define their resources differently.
  2289. Type string `json:"type,omitempty"`
  2290. // ForceSendFields is a list of field names (e.g. "Labels") to
  2291. // unconditionally include in API requests. By default, fields with
  2292. // empty values are omitted from API requests. However, any non-pointer,
  2293. // non-interface field appearing in ForceSendFields will be sent to the
  2294. // server regardless of whether the field is empty or not. This may be
  2295. // used to include empty fields in Patch requests.
  2296. ForceSendFields []string `json:"-"`
  2297. // NullFields is a list of field names (e.g. "Labels") to include in API
  2298. // requests with the JSON null value. By default, fields with empty
  2299. // values are omitted from API requests. However, any field with an
  2300. // empty value appearing in NullFields will be sent to the server as
  2301. // null. It is an error if a field in this list has a non-empty value.
  2302. // This may be used to include null fields in Patch requests.
  2303. NullFields []string `json:"-"`
  2304. }
  2305. func (s *Resource) MarshalJSON() ([]byte, error) {
  2306. type NoMethod Resource
  2307. raw := NoMethod(*s)
  2308. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2309. }
  2310. // ResourceInfo: Describes a resource associated with this operation.
  2311. type ResourceInfo struct {
  2312. // ResourceContainer: The identifier of the parent of this resource
  2313. // instance.
  2314. // Must be in one of the following formats:
  2315. // - “projects/<project-id or project-number>”
  2316. // - “folders/<folder-id>”
  2317. // - “organizations/<organization-id>”
  2318. ResourceContainer string `json:"resourceContainer,omitempty"`
  2319. // ResourceLocation: The location of the resource. If not empty, the
  2320. // resource will be checked
  2321. // against location policy. The value must be a valid zone, region
  2322. // or
  2323. // multiregion. For example: "europe-west4" or
  2324. // "northamerica-northeast1-a"
  2325. ResourceLocation string `json:"resourceLocation,omitempty"`
  2326. // ResourceName: Name of the resource. This is used for auditing
  2327. // purposes.
  2328. ResourceName string `json:"resourceName,omitempty"`
  2329. // ForceSendFields is a list of field names (e.g. "ResourceContainer")
  2330. // to unconditionally include in API requests. By default, fields with
  2331. // empty values are omitted from API requests. However, any non-pointer,
  2332. // non-interface field appearing in ForceSendFields will be sent to the
  2333. // server regardless of whether the field is empty or not. This may be
  2334. // used to include empty fields in Patch requests.
  2335. ForceSendFields []string `json:"-"`
  2336. // NullFields is a list of field names (e.g. "ResourceContainer") to
  2337. // include in API requests with the JSON null value. By default, fields
  2338. // with empty values are omitted from API requests. However, any field
  2339. // with an empty value appearing in NullFields will be sent to the
  2340. // server as null. It is an error if a field in this list has a
  2341. // non-empty value. This may be used to include null fields in Patch
  2342. // requests.
  2343. NullFields []string `json:"-"`
  2344. }
  2345. func (s *ResourceInfo) MarshalJSON() ([]byte, error) {
  2346. type NoMethod ResourceInfo
  2347. raw := NoMethod(*s)
  2348. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2349. }
  2350. // ResourceLocation: Location information about a resource.
  2351. type ResourceLocation struct {
  2352. // CurrentLocations: The locations of a resource after the execution of
  2353. // the operation.
  2354. // Requests to create or delete a location based resource must
  2355. // populate
  2356. // the 'current_locations' field and not the 'original_locations'
  2357. // field.
  2358. // For example:
  2359. //
  2360. // "europe-west1-a"
  2361. // "us-east1"
  2362. // "nam3"
  2363. CurrentLocations []string `json:"currentLocations,omitempty"`
  2364. // OriginalLocations: The locations of a resource prior to the execution
  2365. // of the operation.
  2366. // Requests that mutate the resource's location must populate both
  2367. // the
  2368. // 'original_locations' as well as the 'current_locations' fields.
  2369. // For example:
  2370. //
  2371. // "europe-west1-a"
  2372. // "us-east1"
  2373. // "nam3"
  2374. OriginalLocations []string `json:"originalLocations,omitempty"`
  2375. // ForceSendFields is a list of field names (e.g. "CurrentLocations") to
  2376. // unconditionally include in API requests. By default, fields with
  2377. // empty values are omitted from API requests. However, any non-pointer,
  2378. // non-interface field appearing in ForceSendFields will be sent to the
  2379. // server regardless of whether the field is empty or not. This may be
  2380. // used to include empty fields in Patch requests.
  2381. ForceSendFields []string `json:"-"`
  2382. // NullFields is a list of field names (e.g. "CurrentLocations") to
  2383. // include in API requests with the JSON null value. By default, fields
  2384. // with empty values are omitted from API requests. However, any field
  2385. // with an empty value appearing in NullFields will be sent to the
  2386. // server as null. It is an error if a field in this list has a
  2387. // non-empty value. This may be used to include null fields in Patch
  2388. // requests.
  2389. NullFields []string `json:"-"`
  2390. }
  2391. func (s *ResourceLocation) MarshalJSON() ([]byte, error) {
  2392. type NoMethod ResourceLocation
  2393. raw := NoMethod(*s)
  2394. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2395. }
  2396. // ServiceAccountDelegationInfo: Identity delegation history of an
  2397. // authenticated service account.
  2398. type ServiceAccountDelegationInfo struct {
  2399. // FirstPartyPrincipal: First party (Google) identity as the real
  2400. // authority.
  2401. FirstPartyPrincipal *FirstPartyPrincipal `json:"firstPartyPrincipal,omitempty"`
  2402. // ThirdPartyPrincipal: Third party identity as the real authority.
  2403. ThirdPartyPrincipal *ThirdPartyPrincipal `json:"thirdPartyPrincipal,omitempty"`
  2404. // ForceSendFields is a list of field names (e.g. "FirstPartyPrincipal")
  2405. // to unconditionally include in API requests. By default, fields with
  2406. // empty values are omitted from API requests. However, any non-pointer,
  2407. // non-interface field appearing in ForceSendFields will be sent to the
  2408. // server regardless of whether the field is empty or not. This may be
  2409. // used to include empty fields in Patch requests.
  2410. ForceSendFields []string `json:"-"`
  2411. // NullFields is a list of field names (e.g. "FirstPartyPrincipal") to
  2412. // include in API requests with the JSON null value. By default, fields
  2413. // with empty values are omitted from API requests. However, any field
  2414. // with an empty value appearing in NullFields will be sent to the
  2415. // server as null. It is an error if a field in this list has a
  2416. // non-empty value. This may be used to include null fields in Patch
  2417. // requests.
  2418. NullFields []string `json:"-"`
  2419. }
  2420. func (s *ServiceAccountDelegationInfo) MarshalJSON() ([]byte, error) {
  2421. type NoMethod ServiceAccountDelegationInfo
  2422. raw := NoMethod(*s)
  2423. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2424. }
  2425. // Status: The `Status` type defines a logical error model that is
  2426. // suitable for
  2427. // different programming environments, including REST APIs and RPC APIs.
  2428. // It is
  2429. // used by [gRPC](https://github.com/grpc). The error model is designed
  2430. // to be:
  2431. //
  2432. // - Simple to use and understand for most users
  2433. // - Flexible enough to meet unexpected needs
  2434. //
  2435. // # Overview
  2436. //
  2437. // The `Status` message contains three pieces of data: error code,
  2438. // error
  2439. // message, and error details. The error code should be an enum value
  2440. // of
  2441. // google.rpc.Code, but it may accept additional error codes if needed.
  2442. // The
  2443. // error message should be a developer-facing English message that
  2444. // helps
  2445. // developers *understand* and *resolve* the error. If a localized
  2446. // user-facing
  2447. // error message is needed, put the localized message in the error
  2448. // details or
  2449. // localize it in the client. The optional error details may contain
  2450. // arbitrary
  2451. // information about the error. There is a predefined set of error
  2452. // detail types
  2453. // in the package `google.rpc` that can be used for common error
  2454. // conditions.
  2455. //
  2456. // # Language mapping
  2457. //
  2458. // The `Status` message is the logical representation of the error
  2459. // model, but it
  2460. // is not necessarily the actual wire format. When the `Status` message
  2461. // is
  2462. // exposed in different client libraries and different wire protocols,
  2463. // it can be
  2464. // mapped differently. For example, it will likely be mapped to some
  2465. // exceptions
  2466. // in Java, but more likely mapped to some error codes in C.
  2467. //
  2468. // # Other uses
  2469. //
  2470. // The error model and the `Status` message can be used in a variety
  2471. // of
  2472. // environments, either with or without APIs, to provide a
  2473. // consistent developer experience across different
  2474. // environments.
  2475. //
  2476. // Example uses of this error model include:
  2477. //
  2478. // - Partial errors. If a service needs to return partial errors to the
  2479. // client,
  2480. // it may embed the `Status` in the normal response to indicate the
  2481. // partial
  2482. // errors.
  2483. //
  2484. // - Workflow errors. A typical workflow has multiple steps. Each step
  2485. // may
  2486. // have a `Status` message for error reporting.
  2487. //
  2488. // - Batch operations. If a client uses batch request and batch
  2489. // response, the
  2490. // `Status` message should be used directly inside batch response,
  2491. // one for
  2492. // each error sub-response.
  2493. //
  2494. // - Asynchronous operations. If an API call embeds asynchronous
  2495. // operation
  2496. // results in its response, the status of those operations should
  2497. // be
  2498. // represented directly using the `Status` message.
  2499. //
  2500. // - Logging. If some API errors are stored in logs, the message
  2501. // `Status` could
  2502. // be used directly after any stripping needed for security/privacy
  2503. // reasons.
  2504. type Status struct {
  2505. // Code: The status code, which should be an enum value of
  2506. // google.rpc.Code.
  2507. Code int64 `json:"code,omitempty"`
  2508. // Details: A list of messages that carry the error details. There is a
  2509. // common set of
  2510. // message types for APIs to use.
  2511. Details []googleapi.RawMessage `json:"details,omitempty"`
  2512. // Message: A developer-facing error message, which should be in
  2513. // English. Any
  2514. // user-facing error message should be localized and sent in
  2515. // the
  2516. // google.rpc.Status.details field, or localized by the client.
  2517. Message string `json:"message,omitempty"`
  2518. // ForceSendFields is a list of field names (e.g. "Code") to
  2519. // unconditionally include in API requests. By default, fields with
  2520. // empty values are omitted from API requests. However, any non-pointer,
  2521. // non-interface field appearing in ForceSendFields will be sent to the
  2522. // server regardless of whether the field is empty or not. This may be
  2523. // used to include empty fields in Patch requests.
  2524. ForceSendFields []string `json:"-"`
  2525. // NullFields is a list of field names (e.g. "Code") to include in API
  2526. // requests with the JSON null value. By default, fields with empty
  2527. // values are omitted from API requests. However, any field with an
  2528. // empty value appearing in NullFields will be sent to the server as
  2529. // null. It is an error if a field in this list has a non-empty value.
  2530. // This may be used to include null fields in Patch requests.
  2531. NullFields []string `json:"-"`
  2532. }
  2533. func (s *Status) MarshalJSON() ([]byte, error) {
  2534. type NoMethod Status
  2535. raw := NoMethod(*s)
  2536. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2537. }
  2538. // ThirdPartyPrincipal: Third party identity principal.
  2539. type ThirdPartyPrincipal struct {
  2540. // ThirdPartyClaims: Metadata about third party identity.
  2541. ThirdPartyClaims googleapi.RawMessage `json:"thirdPartyClaims,omitempty"`
  2542. // ForceSendFields is a list of field names (e.g. "ThirdPartyClaims") to
  2543. // unconditionally include in API requests. By default, fields with
  2544. // empty values are omitted from API requests. However, any non-pointer,
  2545. // non-interface field appearing in ForceSendFields will be sent to the
  2546. // server regardless of whether the field is empty or not. This may be
  2547. // used to include empty fields in Patch requests.
  2548. ForceSendFields []string `json:"-"`
  2549. // NullFields is a list of field names (e.g. "ThirdPartyClaims") to
  2550. // include in API requests with the JSON null value. By default, fields
  2551. // with empty values are omitted from API requests. However, any field
  2552. // with an empty value appearing in NullFields will be sent to the
  2553. // server as null. It is an error if a field in this list has a
  2554. // non-empty value. This may be used to include null fields in Patch
  2555. // requests.
  2556. NullFields []string `json:"-"`
  2557. }
  2558. func (s *ThirdPartyPrincipal) MarshalJSON() ([]byte, error) {
  2559. type NoMethod ThirdPartyPrincipal
  2560. raw := NoMethod(*s)
  2561. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2562. }
  2563. // method id "servicecontrol.services.allocateQuota":
  2564. type ServicesAllocateQuotaCall struct {
  2565. s *Service
  2566. serviceName string
  2567. allocatequotarequest *AllocateQuotaRequest
  2568. urlParams_ gensupport.URLParams
  2569. ctx_ context.Context
  2570. header_ http.Header
  2571. }
  2572. // AllocateQuota: Attempts to allocate quota for the specified consumer.
  2573. // It should be called
  2574. // before the operation is executed.
  2575. //
  2576. // This method requires the
  2577. // `servicemanagement.services.quota`
  2578. // permission on the specified service. For more information, see
  2579. // [Cloud IAM](https://cloud.google.com/iam).
  2580. //
  2581. // **NOTE:** The client **must** fail-open on server errors
  2582. // `INTERNAL`,
  2583. // `UNKNOWN`, `DEADLINE_EXCEEDED`, and `UNAVAILABLE`. To ensure
  2584. // system
  2585. // reliability, the server may inject these errors to prohibit any
  2586. // hard
  2587. // dependency on the quota functionality.
  2588. func (r *ServicesService) AllocateQuota(serviceName string, allocatequotarequest *AllocateQuotaRequest) *ServicesAllocateQuotaCall {
  2589. c := &ServicesAllocateQuotaCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2590. c.serviceName = serviceName
  2591. c.allocatequotarequest = allocatequotarequest
  2592. return c
  2593. }
  2594. // Fields allows partial responses to be retrieved. See
  2595. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2596. // for more information.
  2597. func (c *ServicesAllocateQuotaCall) Fields(s ...googleapi.Field) *ServicesAllocateQuotaCall {
  2598. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2599. return c
  2600. }
  2601. // Context sets the context to be used in this call's Do method. Any
  2602. // pending HTTP request will be aborted if the provided context is
  2603. // canceled.
  2604. func (c *ServicesAllocateQuotaCall) Context(ctx context.Context) *ServicesAllocateQuotaCall {
  2605. c.ctx_ = ctx
  2606. return c
  2607. }
  2608. // Header returns an http.Header that can be modified by the caller to
  2609. // add HTTP headers to the request.
  2610. func (c *ServicesAllocateQuotaCall) Header() http.Header {
  2611. if c.header_ == nil {
  2612. c.header_ = make(http.Header)
  2613. }
  2614. return c.header_
  2615. }
  2616. func (c *ServicesAllocateQuotaCall) doRequest(alt string) (*http.Response, error) {
  2617. reqHeaders := make(http.Header)
  2618. for k, v := range c.header_ {
  2619. reqHeaders[k] = v
  2620. }
  2621. reqHeaders.Set("User-Agent", c.s.userAgent())
  2622. var body io.Reader = nil
  2623. body, err := googleapi.WithoutDataWrapper.JSONReader(c.allocatequotarequest)
  2624. if err != nil {
  2625. return nil, err
  2626. }
  2627. reqHeaders.Set("Content-Type", "application/json")
  2628. c.urlParams_.Set("alt", alt)
  2629. c.urlParams_.Set("prettyPrint", "false")
  2630. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}:allocateQuota")
  2631. urls += "?" + c.urlParams_.Encode()
  2632. req, err := http.NewRequest("POST", urls, body)
  2633. if err != nil {
  2634. return nil, err
  2635. }
  2636. req.Header = reqHeaders
  2637. googleapi.Expand(req.URL, map[string]string{
  2638. "serviceName": c.serviceName,
  2639. })
  2640. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2641. }
  2642. // Do executes the "servicecontrol.services.allocateQuota" call.
  2643. // Exactly one of *AllocateQuotaResponse or error will be non-nil. Any
  2644. // non-2xx status code is an error. Response headers are in either
  2645. // *AllocateQuotaResponse.ServerResponse.Header or (if a response was
  2646. // returned at all) in error.(*googleapi.Error).Header. Use
  2647. // googleapi.IsNotModified to check whether the returned error was
  2648. // because http.StatusNotModified was returned.
  2649. func (c *ServicesAllocateQuotaCall) Do(opts ...googleapi.CallOption) (*AllocateQuotaResponse, error) {
  2650. gensupport.SetOptions(c.urlParams_, opts...)
  2651. res, err := c.doRequest("json")
  2652. if res != nil && res.StatusCode == http.StatusNotModified {
  2653. if res.Body != nil {
  2654. res.Body.Close()
  2655. }
  2656. return nil, &googleapi.Error{
  2657. Code: res.StatusCode,
  2658. Header: res.Header,
  2659. }
  2660. }
  2661. if err != nil {
  2662. return nil, err
  2663. }
  2664. defer googleapi.CloseBody(res)
  2665. if err := googleapi.CheckResponse(res); err != nil {
  2666. return nil, err
  2667. }
  2668. ret := &AllocateQuotaResponse{
  2669. ServerResponse: googleapi.ServerResponse{
  2670. Header: res.Header,
  2671. HTTPStatusCode: res.StatusCode,
  2672. },
  2673. }
  2674. target := &ret
  2675. if err := gensupport.DecodeResponse(target, res); err != nil {
  2676. return nil, err
  2677. }
  2678. return ret, nil
  2679. // {
  2680. // "description": "Attempts to allocate quota for the specified consumer. It should be called\nbefore the operation is executed.\n\nThis method requires the `servicemanagement.services.quota`\npermission on the specified service. For more information, see\n[Cloud IAM](https://cloud.google.com/iam).\n\n**NOTE:** The client **must** fail-open on server errors `INTERNAL`,\n`UNKNOWN`, `DEADLINE_EXCEEDED`, and `UNAVAILABLE`. To ensure system\nreliability, the server may inject these errors to prohibit any hard\ndependency on the quota functionality.",
  2681. // "flatPath": "v1/services/{serviceName}:allocateQuota",
  2682. // "httpMethod": "POST",
  2683. // "id": "servicecontrol.services.allocateQuota",
  2684. // "parameterOrder": [
  2685. // "serviceName"
  2686. // ],
  2687. // "parameters": {
  2688. // "serviceName": {
  2689. // "description": "Name of the service as specified in the service configuration. For example,\n`\"pubsub.googleapis.com\"`.\n\nSee google.api.Service for the definition of a service name.",
  2690. // "location": "path",
  2691. // "required": true,
  2692. // "type": "string"
  2693. // }
  2694. // },
  2695. // "path": "v1/services/{serviceName}:allocateQuota",
  2696. // "request": {
  2697. // "$ref": "AllocateQuotaRequest"
  2698. // },
  2699. // "response": {
  2700. // "$ref": "AllocateQuotaResponse"
  2701. // },
  2702. // "scopes": [
  2703. // "https://www.googleapis.com/auth/cloud-platform",
  2704. // "https://www.googleapis.com/auth/servicecontrol"
  2705. // ]
  2706. // }
  2707. }
  2708. // method id "servicecontrol.services.check":
  2709. type ServicesCheckCall struct {
  2710. s *Service
  2711. serviceName string
  2712. checkrequest *CheckRequest
  2713. urlParams_ gensupport.URLParams
  2714. ctx_ context.Context
  2715. header_ http.Header
  2716. }
  2717. // Check: Checks whether an operation on a service should be allowed to
  2718. // proceed
  2719. // based on the configuration of the service and related policies. It
  2720. // must be
  2721. // called before the operation is executed.
  2722. //
  2723. // If feasible, the client should cache the check results and reuse them
  2724. // for
  2725. // 60 seconds. In case of any server errors, the client should rely on
  2726. // the
  2727. // cached results for much longer time to avoid outage.
  2728. // WARNING: There is general 60s delay for the configuration and
  2729. // policy
  2730. // propagation, therefore callers MUST NOT depend on the `Check` method
  2731. // having
  2732. // the latest policy information.
  2733. //
  2734. // NOTE: the CheckRequest has the size limit of 64KB.
  2735. //
  2736. // This method requires the `servicemanagement.services.check`
  2737. // permission
  2738. // on the specified service. For more information, see
  2739. // [Cloud IAM](https://cloud.google.com/iam).
  2740. func (r *ServicesService) Check(serviceName string, checkrequest *CheckRequest) *ServicesCheckCall {
  2741. c := &ServicesCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2742. c.serviceName = serviceName
  2743. c.checkrequest = checkrequest
  2744. return c
  2745. }
  2746. // Fields allows partial responses to be retrieved. See
  2747. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2748. // for more information.
  2749. func (c *ServicesCheckCall) Fields(s ...googleapi.Field) *ServicesCheckCall {
  2750. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2751. return c
  2752. }
  2753. // Context sets the context to be used in this call's Do method. Any
  2754. // pending HTTP request will be aborted if the provided context is
  2755. // canceled.
  2756. func (c *ServicesCheckCall) Context(ctx context.Context) *ServicesCheckCall {
  2757. c.ctx_ = ctx
  2758. return c
  2759. }
  2760. // Header returns an http.Header that can be modified by the caller to
  2761. // add HTTP headers to the request.
  2762. func (c *ServicesCheckCall) Header() http.Header {
  2763. if c.header_ == nil {
  2764. c.header_ = make(http.Header)
  2765. }
  2766. return c.header_
  2767. }
  2768. func (c *ServicesCheckCall) doRequest(alt string) (*http.Response, error) {
  2769. reqHeaders := make(http.Header)
  2770. for k, v := range c.header_ {
  2771. reqHeaders[k] = v
  2772. }
  2773. reqHeaders.Set("User-Agent", c.s.userAgent())
  2774. var body io.Reader = nil
  2775. body, err := googleapi.WithoutDataWrapper.JSONReader(c.checkrequest)
  2776. if err != nil {
  2777. return nil, err
  2778. }
  2779. reqHeaders.Set("Content-Type", "application/json")
  2780. c.urlParams_.Set("alt", alt)
  2781. c.urlParams_.Set("prettyPrint", "false")
  2782. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}:check")
  2783. urls += "?" + c.urlParams_.Encode()
  2784. req, err := http.NewRequest("POST", urls, body)
  2785. if err != nil {
  2786. return nil, err
  2787. }
  2788. req.Header = reqHeaders
  2789. googleapi.Expand(req.URL, map[string]string{
  2790. "serviceName": c.serviceName,
  2791. })
  2792. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2793. }
  2794. // Do executes the "servicecontrol.services.check" call.
  2795. // Exactly one of *CheckResponse or error will be non-nil. Any non-2xx
  2796. // status code is an error. Response headers are in either
  2797. // *CheckResponse.ServerResponse.Header or (if a response was returned
  2798. // at all) in error.(*googleapi.Error).Header. Use
  2799. // googleapi.IsNotModified to check whether the returned error was
  2800. // because http.StatusNotModified was returned.
  2801. func (c *ServicesCheckCall) Do(opts ...googleapi.CallOption) (*CheckResponse, error) {
  2802. gensupport.SetOptions(c.urlParams_, opts...)
  2803. res, err := c.doRequest("json")
  2804. if res != nil && res.StatusCode == http.StatusNotModified {
  2805. if res.Body != nil {
  2806. res.Body.Close()
  2807. }
  2808. return nil, &googleapi.Error{
  2809. Code: res.StatusCode,
  2810. Header: res.Header,
  2811. }
  2812. }
  2813. if err != nil {
  2814. return nil, err
  2815. }
  2816. defer googleapi.CloseBody(res)
  2817. if err := googleapi.CheckResponse(res); err != nil {
  2818. return nil, err
  2819. }
  2820. ret := &CheckResponse{
  2821. ServerResponse: googleapi.ServerResponse{
  2822. Header: res.Header,
  2823. HTTPStatusCode: res.StatusCode,
  2824. },
  2825. }
  2826. target := &ret
  2827. if err := gensupport.DecodeResponse(target, res); err != nil {
  2828. return nil, err
  2829. }
  2830. return ret, nil
  2831. // {
  2832. // "description": "Checks whether an operation on a service should be allowed to proceed\nbased on the configuration of the service and related policies. It must be\ncalled before the operation is executed.\n\nIf feasible, the client should cache the check results and reuse them for\n60 seconds. In case of any server errors, the client should rely on the\ncached results for much longer time to avoid outage.\nWARNING: There is general 60s delay for the configuration and policy\npropagation, therefore callers MUST NOT depend on the `Check` method having\nthe latest policy information.\n\nNOTE: the CheckRequest has the size limit of 64KB.\n\nThis method requires the `servicemanagement.services.check` permission\non the specified service. For more information, see\n[Cloud IAM](https://cloud.google.com/iam).",
  2833. // "flatPath": "v1/services/{serviceName}:check",
  2834. // "httpMethod": "POST",
  2835. // "id": "servicecontrol.services.check",
  2836. // "parameterOrder": [
  2837. // "serviceName"
  2838. // ],
  2839. // "parameters": {
  2840. // "serviceName": {
  2841. // "description": "The service name as specified in its service configuration. For example,\n`\"pubsub.googleapis.com\"`.\n\nSee\n[google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service)\nfor the definition of a service name.",
  2842. // "location": "path",
  2843. // "required": true,
  2844. // "type": "string"
  2845. // }
  2846. // },
  2847. // "path": "v1/services/{serviceName}:check",
  2848. // "request": {
  2849. // "$ref": "CheckRequest"
  2850. // },
  2851. // "response": {
  2852. // "$ref": "CheckResponse"
  2853. // },
  2854. // "scopes": [
  2855. // "https://www.googleapis.com/auth/cloud-platform",
  2856. // "https://www.googleapis.com/auth/servicecontrol"
  2857. // ]
  2858. // }
  2859. }
  2860. // method id "servicecontrol.services.report":
  2861. type ServicesReportCall struct {
  2862. s *Service
  2863. serviceName string
  2864. reportrequest *ReportRequest
  2865. urlParams_ gensupport.URLParams
  2866. ctx_ context.Context
  2867. header_ http.Header
  2868. }
  2869. // Report: Reports operation results to Google Service Control, such as
  2870. // logs and
  2871. // metrics. It should be called after an operation is completed.
  2872. //
  2873. // If feasible, the client should aggregate reporting data for up to
  2874. // 5
  2875. // seconds to reduce API traffic. Limiting aggregation to 5 seconds is
  2876. // to
  2877. // reduce data loss during client crashes. Clients should carefully
  2878. // choose
  2879. // the aggregation time window to avoid data loss risk more than
  2880. // 0.01%
  2881. // for business and compliance reasons.
  2882. //
  2883. // NOTE: the ReportRequest has the size limit of 1MB.
  2884. //
  2885. // This method requires the `servicemanagement.services.report`
  2886. // permission
  2887. // on the specified service. For more information, see
  2888. // [Google Cloud IAM](https://cloud.google.com/iam).
  2889. func (r *ServicesService) Report(serviceName string, reportrequest *ReportRequest) *ServicesReportCall {
  2890. c := &ServicesReportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2891. c.serviceName = serviceName
  2892. c.reportrequest = reportrequest
  2893. return c
  2894. }
  2895. // Fields allows partial responses to be retrieved. See
  2896. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2897. // for more information.
  2898. func (c *ServicesReportCall) Fields(s ...googleapi.Field) *ServicesReportCall {
  2899. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2900. return c
  2901. }
  2902. // Context sets the context to be used in this call's Do method. Any
  2903. // pending HTTP request will be aborted if the provided context is
  2904. // canceled.
  2905. func (c *ServicesReportCall) Context(ctx context.Context) *ServicesReportCall {
  2906. c.ctx_ = ctx
  2907. return c
  2908. }
  2909. // Header returns an http.Header that can be modified by the caller to
  2910. // add HTTP headers to the request.
  2911. func (c *ServicesReportCall) Header() http.Header {
  2912. if c.header_ == nil {
  2913. c.header_ = make(http.Header)
  2914. }
  2915. return c.header_
  2916. }
  2917. func (c *ServicesReportCall) doRequest(alt string) (*http.Response, error) {
  2918. reqHeaders := make(http.Header)
  2919. for k, v := range c.header_ {
  2920. reqHeaders[k] = v
  2921. }
  2922. reqHeaders.Set("User-Agent", c.s.userAgent())
  2923. var body io.Reader = nil
  2924. body, err := googleapi.WithoutDataWrapper.JSONReader(c.reportrequest)
  2925. if err != nil {
  2926. return nil, err
  2927. }
  2928. reqHeaders.Set("Content-Type", "application/json")
  2929. c.urlParams_.Set("alt", alt)
  2930. c.urlParams_.Set("prettyPrint", "false")
  2931. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}:report")
  2932. urls += "?" + c.urlParams_.Encode()
  2933. req, err := http.NewRequest("POST", urls, body)
  2934. if err != nil {
  2935. return nil, err
  2936. }
  2937. req.Header = reqHeaders
  2938. googleapi.Expand(req.URL, map[string]string{
  2939. "serviceName": c.serviceName,
  2940. })
  2941. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2942. }
  2943. // Do executes the "servicecontrol.services.report" call.
  2944. // Exactly one of *ReportResponse or error will be non-nil. Any non-2xx
  2945. // status code is an error. Response headers are in either
  2946. // *ReportResponse.ServerResponse.Header or (if a response was returned
  2947. // at all) in error.(*googleapi.Error).Header. Use
  2948. // googleapi.IsNotModified to check whether the returned error was
  2949. // because http.StatusNotModified was returned.
  2950. func (c *ServicesReportCall) Do(opts ...googleapi.CallOption) (*ReportResponse, error) {
  2951. gensupport.SetOptions(c.urlParams_, opts...)
  2952. res, err := c.doRequest("json")
  2953. if res != nil && res.StatusCode == http.StatusNotModified {
  2954. if res.Body != nil {
  2955. res.Body.Close()
  2956. }
  2957. return nil, &googleapi.Error{
  2958. Code: res.StatusCode,
  2959. Header: res.Header,
  2960. }
  2961. }
  2962. if err != nil {
  2963. return nil, err
  2964. }
  2965. defer googleapi.CloseBody(res)
  2966. if err := googleapi.CheckResponse(res); err != nil {
  2967. return nil, err
  2968. }
  2969. ret := &ReportResponse{
  2970. ServerResponse: googleapi.ServerResponse{
  2971. Header: res.Header,
  2972. HTTPStatusCode: res.StatusCode,
  2973. },
  2974. }
  2975. target := &ret
  2976. if err := gensupport.DecodeResponse(target, res); err != nil {
  2977. return nil, err
  2978. }
  2979. return ret, nil
  2980. // {
  2981. // "description": "Reports operation results to Google Service Control, such as logs and\nmetrics. It should be called after an operation is completed.\n\nIf feasible, the client should aggregate reporting data for up to 5\nseconds to reduce API traffic. Limiting aggregation to 5 seconds is to\nreduce data loss during client crashes. Clients should carefully choose\nthe aggregation time window to avoid data loss risk more than 0.01%\nfor business and compliance reasons.\n\nNOTE: the ReportRequest has the size limit of 1MB.\n\nThis method requires the `servicemanagement.services.report` permission\non the specified service. For more information, see\n[Google Cloud IAM](https://cloud.google.com/iam).",
  2982. // "flatPath": "v1/services/{serviceName}:report",
  2983. // "httpMethod": "POST",
  2984. // "id": "servicecontrol.services.report",
  2985. // "parameterOrder": [
  2986. // "serviceName"
  2987. // ],
  2988. // "parameters": {
  2989. // "serviceName": {
  2990. // "description": "The service name as specified in its service configuration. For example,\n`\"pubsub.googleapis.com\"`.\n\nSee\n[google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service)\nfor the definition of a service name.",
  2991. // "location": "path",
  2992. // "required": true,
  2993. // "type": "string"
  2994. // }
  2995. // },
  2996. // "path": "v1/services/{serviceName}:report",
  2997. // "request": {
  2998. // "$ref": "ReportRequest"
  2999. // },
  3000. // "response": {
  3001. // "$ref": "ReportResponse"
  3002. // },
  3003. // "scopes": [
  3004. // "https://www.googleapis.com/auth/cloud-platform",
  3005. // "https://www.googleapis.com/auth/servicecontrol"
  3006. // ]
  3007. // }
  3008. }