1// Copyright 2020 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
5// Code generated file. DO NOT EDIT.
6
7// Package servicecontrol provides access to the Service Control API.
8//
9// For product documentation, see: https://cloud.google.com/service-control/
10//
11// Creating a client
12//
13// Usage example:
14//
15//   import "google.golang.org/api/servicecontrol/v2"
16//   ...
17//   ctx := context.Background()
18//   servicecontrolService, err := servicecontrol.NewService(ctx)
19//
20// In this example, Google Application Default Credentials are used for authentication.
21//
22// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
23//
24// Other authentication options
25//
26// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
27//
28//   servicecontrolService, err := servicecontrol.NewService(ctx, option.WithScopes(servicecontrol.ServicecontrolScope))
29//
30// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
31//
32//   servicecontrolService, err := servicecontrol.NewService(ctx, option.WithAPIKey("AIza..."))
33//
34// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
35//
36//   config := &oauth2.Config{...}
37//   // ...
38//   token, err := config.Exchange(ctx, ...)
39//   servicecontrolService, err := servicecontrol.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
40//
41// See https://godoc.org/google.golang.org/api/option/ for details on options.
42package servicecontrol // import "google.golang.org/api/servicecontrol/v2"
43
44import (
45	"bytes"
46	"context"
47	"encoding/json"
48	"errors"
49	"fmt"
50	"io"
51	"net/http"
52	"net/url"
53	"strconv"
54	"strings"
55
56	googleapi "google.golang.org/api/googleapi"
57	gensupport "google.golang.org/api/internal/gensupport"
58	option "google.golang.org/api/option"
59	internaloption "google.golang.org/api/option/internaloption"
60	htransport "google.golang.org/api/transport/http"
61)
62
63// Always reference these packages, just in case the auto-generated code
64// below doesn't.
65var _ = bytes.NewBuffer
66var _ = strconv.Itoa
67var _ = fmt.Sprintf
68var _ = json.NewDecoder
69var _ = io.Copy
70var _ = url.Parse
71var _ = gensupport.MarshalJSON
72var _ = googleapi.Version
73var _ = errors.New
74var _ = strings.Replace
75var _ = context.Canceled
76var _ = internaloption.WithDefaultEndpoint
77
78const apiId = "servicecontrol:v2"
79const apiName = "servicecontrol"
80const apiVersion = "v2"
81const basePath = "https://servicecontrol.googleapis.com/"
82const mtlsBasePath = "https://servicecontrol.mtls.googleapis.com/"
83
84// OAuth2 scopes used by this API.
85const (
86	// View and manage your data across Google Cloud Platform services
87	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
88
89	// Manage your Google Service Control data
90	ServicecontrolScope = "https://www.googleapis.com/auth/servicecontrol"
91)
92
93// NewService creates a new Service.
94func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
95	scopesOption := option.WithScopes(
96		"https://www.googleapis.com/auth/cloud-platform",
97		"https://www.googleapis.com/auth/servicecontrol",
98	)
99	// NOTE: prepend, so we don't override user-specified scopes.
100	opts = append([]option.ClientOption{scopesOption}, opts...)
101	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
102	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
103	client, endpoint, err := htransport.NewClient(ctx, opts...)
104	if err != nil {
105		return nil, err
106	}
107	s, err := New(client)
108	if err != nil {
109		return nil, err
110	}
111	if endpoint != "" {
112		s.BasePath = endpoint
113	}
114	return s, nil
115}
116
117// New creates a new Service. It uses the provided http.Client for requests.
118//
119// Deprecated: please use NewService instead.
120// To provide a custom HTTP client, use option.WithHTTPClient.
121// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
122func New(client *http.Client) (*Service, error) {
123	if client == nil {
124		return nil, errors.New("client is nil")
125	}
126	s := &Service{client: client, BasePath: basePath}
127	s.Services = NewServicesService(s)
128	return s, nil
129}
130
131type Service struct {
132	client    *http.Client
133	BasePath  string // API endpoint base URL
134	UserAgent string // optional additional User-Agent fragment
135
136	Services *ServicesService
137}
138
139func (s *Service) userAgent() string {
140	if s.UserAgent == "" {
141		return googleapi.UserAgent
142	}
143	return googleapi.UserAgent + " " + s.UserAgent
144}
145
146func NewServicesService(s *Service) *ServicesService {
147	rs := &ServicesService{s: s}
148	return rs
149}
150
151type ServicesService struct {
152	s *Service
153}
154
155// Api: This message defines attributes associated with API operations,
156// such as a network API request. The terminology is based on the
157// conventions used by Google APIs, Istio, and OpenAPI.
158type Api struct {
159	// Operation: The API operation name. For gRPC requests, it is the fully
160	// qualified API method name, such as
161	// "google.pubsub.v1.Publisher.Publish". For OpenAPI requests, it is the
162	// `operationId`, such as "getPet".
163	Operation string `json:"operation,omitempty"`
164
165	// Protocol: The API protocol used for sending the request, such as
166	// "http", "https", "grpc", or "internal".
167	Protocol string `json:"protocol,omitempty"`
168
169	// Service: The API service name. It is a logical identifier for a
170	// networked API, such as "pubsub.googleapis.com". The naming syntax
171	// depends on the API management system being used for handling the
172	// request.
173	Service string `json:"service,omitempty"`
174
175	// Version: The API version associated with the API operation above,
176	// such as "v1" or "v1alpha1".
177	Version string `json:"version,omitempty"`
178
179	// ForceSendFields is a list of field names (e.g. "Operation") to
180	// unconditionally include in API requests. By default, fields with
181	// empty values are omitted from API requests. However, any non-pointer,
182	// non-interface field appearing in ForceSendFields will be sent to the
183	// server regardless of whether the field is empty or not. This may be
184	// used to include empty fields in Patch requests.
185	ForceSendFields []string `json:"-"`
186
187	// NullFields is a list of field names (e.g. "Operation") to include in
188	// API requests with the JSON null value. By default, fields with empty
189	// values are omitted from API requests. However, any field with an
190	// empty value appearing in NullFields will be sent to the server as
191	// null. It is an error if a field in this list has a non-empty value.
192	// This may be used to include null fields in Patch requests.
193	NullFields []string `json:"-"`
194}
195
196func (s *Api) MarshalJSON() ([]byte, error) {
197	type NoMethod Api
198	raw := NoMethod(*s)
199	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
200}
201
202// AttributeContext: This message defines the standard attribute
203// vocabulary for Google APIs. An attribute is a piece of metadata that
204// describes an activity on a network service. For example, the size of
205// an HTTP request, or the status code of an HTTP response. Each
206// attribute has a type and a name, which is logically defined as a
207// proto message field in `AttributeContext`. The field type becomes the
208// attribute type, and the field path becomes the attribute name. For
209// example, the attribute `source.ip` maps to field
210// `AttributeContext.source.ip`. This message definition is guaranteed
211// not to have any wire breaking change. So you can use it directly for
212// passing attributes across different systems. NOTE: Different system
213// may generate different subset of attributes. Please verify the system
214// specification before relying on an attribute generated a system.
215type AttributeContext struct {
216	// Api: Represents an API operation that is involved to a network
217	// activity.
218	Api *Api `json:"api,omitempty"`
219
220	// Destination: The destination of a network activity, such as accepting
221	// a TCP connection. In a multi hop network activity, the destination
222	// represents the receiver of the last hop.
223	Destination *Peer `json:"destination,omitempty"`
224
225	// Extensions: Supports extensions for advanced use cases, such as logs
226	// and metrics.
227	Extensions []googleapi.RawMessage `json:"extensions,omitempty"`
228
229	// Origin: The origin of a network activity. In a multi hop network
230	// activity, the origin represents the sender of the first hop. For the
231	// first hop, the `source` and the `origin` must have the same content.
232	Origin *Peer `json:"origin,omitempty"`
233
234	// Request: Represents a network request, such as an HTTP request.
235	Request *Request `json:"request,omitempty"`
236
237	// Resource: Represents a target resource that is involved with a
238	// network activity. If multiple resources are involved with an
239	// activity, this must be the primary one.
240	Resource *Resource `json:"resource,omitempty"`
241
242	// Response: Represents a network response, such as an HTTP response.
243	Response *Response `json:"response,omitempty"`
244
245	// Source: The source of a network activity, such as starting a TCP
246	// connection. In a multi hop network activity, the source represents
247	// the sender of the last hop.
248	Source *Peer `json:"source,omitempty"`
249
250	// ForceSendFields is a list of field names (e.g. "Api") to
251	// unconditionally include in API requests. By default, fields with
252	// empty values are omitted from API requests. However, any non-pointer,
253	// non-interface field appearing in ForceSendFields will be sent to the
254	// server regardless of whether the field is empty or not. This may be
255	// used to include empty fields in Patch requests.
256	ForceSendFields []string `json:"-"`
257
258	// NullFields is a list of field names (e.g. "Api") to include in API
259	// requests with the JSON null value. By default, fields with empty
260	// values are omitted from API requests. However, any field with an
261	// empty value appearing in NullFields will be sent to the server as
262	// null. It is an error if a field in this list has a non-empty value.
263	// This may be used to include null fields in Patch requests.
264	NullFields []string `json:"-"`
265}
266
267func (s *AttributeContext) MarshalJSON() ([]byte, error) {
268	type NoMethod AttributeContext
269	raw := NoMethod(*s)
270	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
271}
272
273// AuditLog: Common audit log format for Google Cloud Platform API
274// operations.
275type AuditLog struct {
276	// AuthenticationInfo: Authentication information.
277	AuthenticationInfo *AuthenticationInfo `json:"authenticationInfo,omitempty"`
278
279	// AuthorizationInfo: Authorization information. If there are multiple
280	// resources or permissions involved, then there is one
281	// AuthorizationInfo element for each {resource, permission} tuple.
282	AuthorizationInfo []*AuthorizationInfo `json:"authorizationInfo,omitempty"`
283
284	// Metadata: Other service-specific data about the request, response,
285	// and other information associated with the current audited event.
286	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
287
288	// MethodName: The name of the service method or operation. For API
289	// calls, this should be the name of the API method. For example,
290	// "google.cloud.bigquery.v2.TableService.InsertTable"
291	// "google.logging.v2.ConfigServiceV2.CreateSink"
292	MethodName string `json:"methodName,omitempty"`
293
294	// NumResponseItems: The number of items returned from a List or Query
295	// API method, if applicable.
296	NumResponseItems int64 `json:"numResponseItems,omitempty,string"`
297
298	// Request: The operation request. This may not include all request
299	// parameters, such as those that are too large, privacy-sensitive, or
300	// duplicated elsewhere in the log record. It should never include
301	// user-generated data, such as file contents. When the JSON object
302	// represented here has a proto equivalent, the proto name will be
303	// indicated in the `@type` property.
304	Request googleapi.RawMessage `json:"request,omitempty"`
305
306	// RequestMetadata: Metadata about the operation.
307	RequestMetadata *RequestMetadata `json:"requestMetadata,omitempty"`
308
309	// ResourceLocation: The resource location information.
310	ResourceLocation *ResourceLocation `json:"resourceLocation,omitempty"`
311
312	// ResourceName: The resource or collection that is the target of the
313	// operation. The name is a scheme-less URI, not including the API
314	// service name. For example:
315	// "projects/PROJECT_ID/zones/us-central1-a/instances"
316	// "projects/PROJECT_ID/datasets/DATASET_ID"
317	ResourceName string `json:"resourceName,omitempty"`
318
319	// ResourceOriginalState: The resource's original state before mutation.
320	// Present only for operations which have successfully modified the
321	// targeted resource(s). In general, this field should contain all
322	// changed fields, except those that are already been included in
323	// `request`, `response`, `metadata` or `service_data` fields. When the
324	// JSON object represented here has a proto equivalent, the proto name
325	// will be indicated in the `@type` property.
326	ResourceOriginalState googleapi.RawMessage `json:"resourceOriginalState,omitempty"`
327
328	// Response: The operation response. This may not include all response
329	// elements, such as those that are too large, privacy-sensitive, or
330	// duplicated elsewhere in the log record. It should never include
331	// user-generated data, such as file contents. When the JSON object
332	// represented here has a proto equivalent, the proto name will be
333	// indicated in the `@type` property.
334	Response googleapi.RawMessage `json:"response,omitempty"`
335
336	// ServiceData: Deprecated. Use the `metadata` field instead. Other
337	// service-specific data about the request, response, and other
338	// activities.
339	ServiceData googleapi.RawMessage `json:"serviceData,omitempty"`
340
341	// ServiceName: The name of the API service performing the operation.
342	// For example, "compute.googleapis.com".
343	ServiceName string `json:"serviceName,omitempty"`
344
345	// Status: The status of the overall operation.
346	Status *Status `json:"status,omitempty"`
347
348	// ForceSendFields is a list of field names (e.g. "AuthenticationInfo")
349	// to unconditionally include in API requests. By default, fields with
350	// empty values are omitted from API requests. However, any non-pointer,
351	// non-interface field appearing in ForceSendFields will be sent to the
352	// server regardless of whether the field is empty or not. This may be
353	// used to include empty fields in Patch requests.
354	ForceSendFields []string `json:"-"`
355
356	// NullFields is a list of field names (e.g. "AuthenticationInfo") to
357	// include in API requests with the JSON null value. By default, fields
358	// with empty values are omitted from API requests. However, any field
359	// with an empty value appearing in NullFields will be sent to the
360	// server as null. It is an error if a field in this list has a
361	// non-empty value. This may be used to include null fields in Patch
362	// requests.
363	NullFields []string `json:"-"`
364}
365
366func (s *AuditLog) MarshalJSON() ([]byte, error) {
367	type NoMethod AuditLog
368	raw := NoMethod(*s)
369	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
370}
371
372// Auth: This message defines request authentication attributes.
373// Terminology is based on the JSON Web Token (JWT) standard, but the
374// terms also correlate to concepts in other standards.
375type Auth struct {
376	// AccessLevels: A list of access level resource names that allow
377	// resources to be accessed by authenticated requester. It is part of
378	// Secure GCP processing for the incoming request. An access level
379	// string has the format:
380	// "//{api_service_name}/accessPolicies/{policy_id}/accessLevels/{short_n
381	// ame}" Example:
382	// "//accesscontextmanager.googleapis.com/accessPolicies/MY_POLICY_ID/acc
383	// essLevels/MY_LEVEL"
384	AccessLevels []string `json:"accessLevels,omitempty"`
385
386	// Audiences: The intended audience(s) for this authentication
387	// information. Reflects the audience (`aud`) claim within a JWT. The
388	// audience value(s) depends on the `issuer`, but typically include one
389	// or more of the following pieces of information: * The services
390	// intended to receive the credential. For example,
391	// ["https://pubsub.googleapis.com/",
392	// "https://storage.googleapis.com/"]. * A set of service-based scopes.
393	// For example, ["https://www.googleapis.com/auth/cloud-platform"]. *
394	// The client id of an app, such as the Firebase project id for JWTs
395	// from Firebase Auth. Consult the documentation for the credential
396	// issuer to determine the information provided.
397	Audiences []string `json:"audiences,omitempty"`
398
399	// Claims: Structured claims presented with the credential. JWTs include
400	// `{key: value}` pairs for standard and private claims. The following
401	// is a subset of the standard required and optional claims that would
402	// typically be presented for a Google-based JWT: {'iss':
403	// 'accounts.google.com', 'sub': '113289723416554971153', 'aud':
404	// ['123456789012', 'pubsub.googleapis.com'], 'azp':
405	// '123456789012.apps.googleusercontent.com', 'email':
406	// 'jsmith@example.com', 'iat': 1353601026, 'exp': 1353604926} SAML
407	// assertions are similarly specified, but with an identity provider
408	// dependent structure.
409	Claims googleapi.RawMessage `json:"claims,omitempty"`
410
411	// Presenter: The authorized presenter of the credential. Reflects the
412	// optional Authorized Presenter (`azp`) claim within a JWT or the OAuth
413	// client id. For example, a Google Cloud Platform client id looks as
414	// follows: "123456789012.apps.googleusercontent.com".
415	Presenter string `json:"presenter,omitempty"`
416
417	// Principal: The authenticated principal. Reflects the issuer (`iss`)
418	// and subject (`sub`) claims within a JWT. The issuer and subject
419	// should be `/` delimited, with `/` percent-encoded within the subject
420	// fragment. For Google accounts, the principal format is:
421	// "https://accounts.google.com/{id}"
422	Principal string `json:"principal,omitempty"`
423
424	// ForceSendFields is a list of field names (e.g. "AccessLevels") to
425	// unconditionally include in API requests. By default, fields with
426	// empty values are omitted from API requests. However, any non-pointer,
427	// non-interface field appearing in ForceSendFields will be sent to the
428	// server regardless of whether the field is empty or not. This may be
429	// used to include empty fields in Patch requests.
430	ForceSendFields []string `json:"-"`
431
432	// NullFields is a list of field names (e.g. "AccessLevels") to include
433	// in API requests with the JSON null value. By default, fields with
434	// empty values are omitted from API requests. However, any field with
435	// an empty value appearing in NullFields will be sent to the server as
436	// null. It is an error if a field in this list has a non-empty value.
437	// This may be used to include null fields in Patch requests.
438	NullFields []string `json:"-"`
439}
440
441func (s *Auth) MarshalJSON() ([]byte, error) {
442	type NoMethod Auth
443	raw := NoMethod(*s)
444	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
445}
446
447// AuthenticationInfo: Authentication information for the operation.
448type AuthenticationInfo struct {
449	// AuthoritySelector: The authority selector specified by the requestor,
450	// if any. It is not guaranteed that the principal was allowed to use
451	// this authority.
452	AuthoritySelector string `json:"authoritySelector,omitempty"`
453
454	// PrincipalEmail: The email address of the authenticated user (or
455	// service account on behalf of third party principal) making the
456	// request. For third party identity callers, the `principal_subject`
457	// field is populated instead of this field. For privacy reasons, the
458	// principal email address is sometimes redacted. For more information,
459	// see [Caller identities in audit
460	// logs](https://cloud.google.com/logging/docs/audit#user-id).
461	PrincipalEmail string `json:"principalEmail,omitempty"`
462
463	// PrincipalSubject: String representation of identity of requesting
464	// party. Populated for both first and third party identities.
465	PrincipalSubject string `json:"principalSubject,omitempty"`
466
467	// ServiceAccountDelegationInfo: Identity delegation history of an
468	// authenticated service account that makes the request. It contains
469	// information on the real authorities that try to access GCP resources
470	// by delegating on a service account. When multiple authorities
471	// present, they are guaranteed to be sorted based on the original
472	// ordering of the identity delegation events.
473	ServiceAccountDelegationInfo []*ServiceAccountDelegationInfo `json:"serviceAccountDelegationInfo,omitempty"`
474
475	// ServiceAccountKeyName: The name of the service account key used to
476	// create or exchange credentials for authenticating the service account
477	// making the request. This is a scheme-less URI full resource name. For
478	// example:
479	// "//iam.googleapis.com/projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/
480	// keys/{key}"
481	ServiceAccountKeyName string `json:"serviceAccountKeyName,omitempty"`
482
483	// ThirdPartyPrincipal: The third party identification (if any) of the
484	// authenticated user making the request. When the JSON object
485	// represented here has a proto equivalent, the proto name will be
486	// indicated in the `@type` property.
487	ThirdPartyPrincipal googleapi.RawMessage `json:"thirdPartyPrincipal,omitempty"`
488
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
497	// NullFields is a list of field names (e.g. "AuthoritySelector") to
498	// include in API requests with the JSON null value. By default, fields
499	// with empty values are omitted from API requests. However, any field
500	// with an empty value appearing in NullFields will be sent to the
501	// server as null. It is an error if a field in this list has a
502	// non-empty value. This may be used to include null fields in Patch
503	// requests.
504	NullFields []string `json:"-"`
505}
506
507func (s *AuthenticationInfo) MarshalJSON() ([]byte, error) {
508	type NoMethod AuthenticationInfo
509	raw := NoMethod(*s)
510	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
511}
512
513// AuthorizationInfo: Authorization information for the operation.
514type AuthorizationInfo struct {
515	// Granted: Whether or not authorization for `resource` and `permission`
516	// was granted.
517	Granted bool `json:"granted,omitempty"`
518
519	// Permission: The required IAM permission.
520	Permission string `json:"permission,omitempty"`
521
522	// Resource: The resource being accessed, as a REST-style string. For
523	// example:
524	// bigquery.googleapis.com/projects/PROJECTID/datasets/DATASETID
525	Resource string `json:"resource,omitempty"`
526
527	// ResourceAttributes: Resource attributes used in IAM condition
528	// evaluation. This field contains resource attributes like resource
529	// type and resource name. To get the whole view of the attributes used
530	// in IAM condition evaluation, the user must also look into
531	// `AuditLog.request_metadata.request_attributes`.
532	ResourceAttributes *Resource `json:"resourceAttributes,omitempty"`
533
534	// ForceSendFields is a list of field names (e.g. "Granted") to
535	// unconditionally include in API requests. By default, fields with
536	// empty values are omitted from API requests. However, any non-pointer,
537	// non-interface field appearing in ForceSendFields will be sent to the
538	// server regardless of whether the field is empty or not. This may be
539	// used to include empty fields in Patch requests.
540	ForceSendFields []string `json:"-"`
541
542	// NullFields is a list of field names (e.g. "Granted") to include in
543	// API requests with the JSON null value. By default, fields with empty
544	// values are omitted from API requests. However, any field with an
545	// empty value appearing in NullFields will be sent to the server as
546	// null. It is an error if a field in this list has a non-empty value.
547	// This may be used to include null fields in Patch requests.
548	NullFields []string `json:"-"`
549}
550
551func (s *AuthorizationInfo) MarshalJSON() ([]byte, error) {
552	type NoMethod AuthorizationInfo
553	raw := NoMethod(*s)
554	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
555}
556
557// CheckRequest: Request message for the Check method.
558type CheckRequest struct {
559	// Attributes: Describes attributes about the operation being executed
560	// by the service.
561	Attributes *AttributeContext `json:"attributes,omitempty"`
562
563	// Resources: Describes the resources and the policies applied to each
564	// resource.
565	Resources []*ResourceInfo `json:"resources,omitempty"`
566
567	// ServiceConfigId: Specifies the version of the service configuration
568	// that should be used to process the request. Must not be empty. Set
569	// this field to 'latest' to specify using the latest configuration.
570	ServiceConfigId string `json:"serviceConfigId,omitempty"`
571
572	// ForceSendFields is a list of field names (e.g. "Attributes") to
573	// unconditionally include in API requests. By default, fields with
574	// empty values are omitted from API requests. However, any non-pointer,
575	// non-interface field appearing in ForceSendFields will be sent to the
576	// server regardless of whether the field is empty or not. This may be
577	// used to include empty fields in Patch requests.
578	ForceSendFields []string `json:"-"`
579
580	// NullFields is a list of field names (e.g. "Attributes") to include in
581	// API requests with the JSON null value. By default, fields with empty
582	// values are omitted from API requests. However, any field with an
583	// empty value appearing in NullFields will be sent to the server as
584	// null. It is an error if a field in this list has a non-empty value.
585	// This may be used to include null fields in Patch requests.
586	NullFields []string `json:"-"`
587}
588
589func (s *CheckRequest) MarshalJSON() ([]byte, error) {
590	type NoMethod CheckRequest
591	raw := NoMethod(*s)
592	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
593}
594
595// CheckResponse: Response message for the Check method.
596type CheckResponse struct {
597	// Headers: Returns a set of request contexts generated from the
598	// `CheckRequest`.
599	Headers map[string]string `json:"headers,omitempty"`
600
601	// Status: An 'OK' status allows the operation. Any other status
602	// indicates a denial; [google.rpc.Status.details]() would contain
603	// additional details about the denial.
604	Status *Status `json:"status,omitempty"`
605
606	// ServerResponse contains the HTTP response code and headers from the
607	// server.
608	googleapi.ServerResponse `json:"-"`
609
610	// ForceSendFields is a list of field names (e.g. "Headers") to
611	// unconditionally include in API requests. By default, fields with
612	// empty values are omitted from API requests. However, any non-pointer,
613	// non-interface field appearing in ForceSendFields will be sent to the
614	// server regardless of whether the field is empty or not. This may be
615	// used to include empty fields in Patch requests.
616	ForceSendFields []string `json:"-"`
617
618	// NullFields is a list of field names (e.g. "Headers") to include in
619	// API requests with the JSON null value. By default, fields with empty
620	// values are omitted from API requests. However, any field with an
621	// empty value appearing in NullFields will be sent to the server as
622	// null. It is an error if a field in this list has a non-empty value.
623	// This may be used to include null fields in Patch requests.
624	NullFields []string `json:"-"`
625}
626
627func (s *CheckResponse) MarshalJSON() ([]byte, error) {
628	type NoMethod CheckResponse
629	raw := NoMethod(*s)
630	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
631}
632
633// FirstPartyPrincipal: First party identity principal.
634type FirstPartyPrincipal struct {
635	// PrincipalEmail: The email address of a Google account. .
636	PrincipalEmail string `json:"principalEmail,omitempty"`
637
638	// ServiceMetadata: Metadata about the service that uses the service
639	// account. .
640	ServiceMetadata googleapi.RawMessage `json:"serviceMetadata,omitempty"`
641
642	// ForceSendFields is a list of field names (e.g. "PrincipalEmail") to
643	// unconditionally include in API requests. By default, fields with
644	// empty values are omitted from API requests. However, any non-pointer,
645	// non-interface field appearing in ForceSendFields will be sent to the
646	// server regardless of whether the field is empty or not. This may be
647	// used to include empty fields in Patch requests.
648	ForceSendFields []string `json:"-"`
649
650	// NullFields is a list of field names (e.g. "PrincipalEmail") to
651	// include in API requests with the JSON null value. By default, fields
652	// with empty values are omitted from API requests. However, any field
653	// with an empty value appearing in NullFields will be sent to the
654	// server as null. It is an error if a field in this list has a
655	// non-empty value. This may be used to include null fields in Patch
656	// requests.
657	NullFields []string `json:"-"`
658}
659
660func (s *FirstPartyPrincipal) MarshalJSON() ([]byte, error) {
661	type NoMethod FirstPartyPrincipal
662	raw := NoMethod(*s)
663	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
664}
665
666// Peer: This message defines attributes for a node that handles a
667// network request. The node can be either a service or an application
668// that sends, forwards, or receives the request. Service peers should
669// fill in `principal` and `labels` as appropriate.
670type Peer struct {
671	// Ip: The IP address of the peer.
672	Ip string `json:"ip,omitempty"`
673
674	// Labels: The labels associated with the peer.
675	Labels map[string]string `json:"labels,omitempty"`
676
677	// Port: The network port of the peer.
678	Port int64 `json:"port,omitempty,string"`
679
680	// Principal: The identity of this peer. Similar to
681	// `Request.auth.principal`, but relative to the peer instead of the
682	// request. For example, the idenity associated with a load balancer
683	// that forwared the request.
684	Principal string `json:"principal,omitempty"`
685
686	// RegionCode: The CLDR country/region code associated with the above IP
687	// address. If the IP address is private, the `region_code` should
688	// reflect the physical location where this peer is running.
689	RegionCode string `json:"regionCode,omitempty"`
690
691	// ForceSendFields is a list of field names (e.g. "Ip") to
692	// unconditionally include in API requests. By default, fields with
693	// empty values are omitted from API requests. However, any non-pointer,
694	// non-interface field appearing in ForceSendFields will be sent to the
695	// server regardless of whether the field is empty or not. This may be
696	// used to include empty fields in Patch requests.
697	ForceSendFields []string `json:"-"`
698
699	// NullFields is a list of field names (e.g. "Ip") to include in API
700	// requests with the JSON null value. By default, fields with empty
701	// values are omitted from API requests. However, any field with an
702	// empty value appearing in NullFields will be sent to the server as
703	// null. It is an error if a field in this list has a non-empty value.
704	// This may be used to include null fields in Patch requests.
705	NullFields []string `json:"-"`
706}
707
708func (s *Peer) MarshalJSON() ([]byte, error) {
709	type NoMethod Peer
710	raw := NoMethod(*s)
711	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
712}
713
714// ReportRequest: Request message for the Report method.
715type ReportRequest struct {
716	// Operations: Describes the list of operations to be reported. Each
717	// operation is represented as an AttributeContext, and contains all
718	// attributes around an API access.
719	Operations []*AttributeContext `json:"operations,omitempty"`
720
721	// ServiceConfigId: Specifies the version of the service configuration
722	// that should be used to process the request. Must not be empty. Set
723	// this field to 'latest' to specify using the latest configuration.
724	ServiceConfigId string `json:"serviceConfigId,omitempty"`
725
726	// ForceSendFields is a list of field names (e.g. "Operations") 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
734	// NullFields is a list of field names (e.g. "Operations") to include in
735	// API requests with the JSON null value. By default, fields with empty
736	// values are omitted from API requests. However, any field with an
737	// empty value appearing in NullFields will be sent to the server as
738	// null. It is an error if a field in this list has a non-empty value.
739	// This may be used to include null fields in Patch requests.
740	NullFields []string `json:"-"`
741}
742
743func (s *ReportRequest) MarshalJSON() ([]byte, error) {
744	type NoMethod ReportRequest
745	raw := NoMethod(*s)
746	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
747}
748
749// ReportResponse: Response message for the Report method. If the
750// request contains any invalid data, the server returns an RPC error.
751type ReportResponse struct {
752	// ServerResponse contains the HTTP response code and headers from the
753	// server.
754	googleapi.ServerResponse `json:"-"`
755}
756
757// Request: This message defines attributes for an HTTP request. If the
758// actual request is not an HTTP request, the runtime system should try
759// to map the actual request to an equivalent HTTP request.
760type Request struct {
761	// Auth: The request authentication. May be absent for unauthenticated
762	// requests. Derived from the HTTP request `Authorization` header or
763	// equivalent.
764	Auth *Auth `json:"auth,omitempty"`
765
766	// Headers: The HTTP request headers. If multiple headers share the same
767	// key, they must be merged according to the HTTP spec. All header keys
768	// must be lowercased, because HTTP header keys are case-insensitive.
769	Headers map[string]string `json:"headers,omitempty"`
770
771	// Host: The HTTP request `Host` header value.
772	Host string `json:"host,omitempty"`
773
774	// Id: The unique ID for a request, which can be propagated to
775	// downstream systems. The ID should have low probability of collision
776	// within a single day for a specific service.
777	Id string `json:"id,omitempty"`
778
779	// Method: The HTTP request method, such as `GET`, `POST`.
780	Method string `json:"method,omitempty"`
781
782	// Path: The HTTP URL path.
783	Path string `json:"path,omitempty"`
784
785	// Protocol: The network protocol used with the request, such as
786	// "http/1.1", "spdy/3", "h2", "h2c", "webrtc", "tcp", "udp", "quic".
787	// See
788	// https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids for
789	// details.
790	Protocol string `json:"protocol,omitempty"`
791
792	// Query: The HTTP URL query in the format of
793	// `name1=value1&name2=value2`, as it appears in the first line of the
794	// HTTP request. No decoding is performed.
795	Query string `json:"query,omitempty"`
796
797	// Reason: A special parameter for request reason. It is used by
798	// security systems to associate auditing information with a request.
799	Reason string `json:"reason,omitempty"`
800
801	// Scheme: The HTTP URL scheme, such as `http` and `https`.
802	Scheme string `json:"scheme,omitempty"`
803
804	// Size: The HTTP request size in bytes. If unknown, it must be -1.
805	Size int64 `json:"size,omitempty,string"`
806
807	// Time: The timestamp when the `destination` service receives the first
808	// byte of the request.
809	Time string `json:"time,omitempty"`
810
811	// ForceSendFields is a list of field names (e.g. "Auth") to
812	// unconditionally include in API requests. By default, fields with
813	// empty values are omitted from API requests. However, any non-pointer,
814	// non-interface field appearing in ForceSendFields will be sent to the
815	// server regardless of whether the field is empty or not. This may be
816	// used to include empty fields in Patch requests.
817	ForceSendFields []string `json:"-"`
818
819	// NullFields is a list of field names (e.g. "Auth") to include in API
820	// requests with the JSON null value. By default, fields with empty
821	// values are omitted from API requests. However, any field with an
822	// empty value appearing in NullFields will be sent to the server as
823	// null. It is an error if a field in this list has a non-empty value.
824	// This may be used to include null fields in Patch requests.
825	NullFields []string `json:"-"`
826}
827
828func (s *Request) MarshalJSON() ([]byte, error) {
829	type NoMethod Request
830	raw := NoMethod(*s)
831	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
832}
833
834// RequestMetadata: Metadata about the request.
835type RequestMetadata struct {
836	// CallerIp: The IP address of the caller. For caller from internet,
837	// this will be public IPv4 or IPv6 address. For caller from a Compute
838	// Engine VM with external IP address, this will be the VM's external IP
839	// address. For caller from a Compute Engine VM without external IP
840	// address, if the VM is in the same organization (or project) as the
841	// accessed resource, `caller_ip` will be the VM's internal IPv4
842	// address, otherwise the `caller_ip` will be redacted to
843	// "gce-internal-ip". See https://cloud.google.com/compute/docs/vpc/ for
844	// more information.
845	CallerIp string `json:"callerIp,omitempty"`
846
847	// CallerNetwork: The network of the caller. Set only if the network
848	// host project is part of the same GCP organization (or project) as the
849	// accessed resource. See https://cloud.google.com/compute/docs/vpc/ for
850	// more information. This is a scheme-less URI full resource name. For
851	// example:
852	// "//compute.googleapis.com/projects/PROJECT_ID/global/networks/NETWORK_
853	// ID"
854	CallerNetwork string `json:"callerNetwork,omitempty"`
855
856	// CallerSuppliedUserAgent: The user agent of the caller. This
857	// information is not authenticated and should be treated accordingly.
858	// For example: + `google-api-python-client/1.4.0`: The request was made
859	// by the Google API client for Python. + `Cloud SDK Command Line Tool
860	// apitools-client/1.0 gcloud/0.9.62`: The request was made by the
861	// Google Cloud SDK CLI (gcloud). + `AppEngine-Google;
862	// (+http://code.google.com/appengine; appid: s~my-project`: The request
863	// was made from the `my-project` App Engine app. NOLINT
864	CallerSuppliedUserAgent string `json:"callerSuppliedUserAgent,omitempty"`
865
866	// DestinationAttributes: The destination of a network activity, such as
867	// accepting a TCP connection. In a multi hop network activity, the
868	// destination represents the receiver of the last hop. Only two fields
869	// are used in this message, Peer.port and Peer.ip. These fields are
870	// optionally populated by those services utilizing the IAM condition
871	// feature.
872	DestinationAttributes *Peer `json:"destinationAttributes,omitempty"`
873
874	// RequestAttributes: Request attributes used in IAM condition
875	// evaluation. This field contains request attributes like request time
876	// and access levels associated with the request. To get the whole view
877	// of the attributes used in IAM condition evaluation, the user must
878	// also look into `AuditLog.authentication_info.resource_attributes`.
879	RequestAttributes *Request `json:"requestAttributes,omitempty"`
880
881	// ForceSendFields is a list of field names (e.g. "CallerIp") to
882	// unconditionally include in API requests. By default, fields with
883	// empty values are omitted from API requests. However, any non-pointer,
884	// non-interface field appearing in ForceSendFields will be sent to the
885	// server regardless of whether the field is empty or not. This may be
886	// used to include empty fields in Patch requests.
887	ForceSendFields []string `json:"-"`
888
889	// NullFields is a list of field names (e.g. "CallerIp") to include in
890	// API requests with the JSON null value. By default, fields with empty
891	// values are omitted from API requests. However, any field with an
892	// empty value appearing in NullFields will be sent to the server as
893	// null. It is an error if a field in this list has a non-empty value.
894	// This may be used to include null fields in Patch requests.
895	NullFields []string `json:"-"`
896}
897
898func (s *RequestMetadata) MarshalJSON() ([]byte, error) {
899	type NoMethod RequestMetadata
900	raw := NoMethod(*s)
901	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
902}
903
904// Resource: This message defines core attributes for a resource. A
905// resource is an addressable (named) entity provided by the destination
906// service. For example, a file stored on a network storage service.
907type Resource struct {
908	// Annotations: Annotations is an unstructured key-value map stored with
909	// a resource that may be set by external tools to store and retrieve
910	// arbitrary metadata. They are not queryable and should be preserved
911	// when modifying objects. More info:
912	// http://kubernetes.io/docs/user-guide/annotations
913	Annotations map[string]string `json:"annotations,omitempty"`
914
915	// CreateTime: Output only. The timestamp when the resource was created.
916	// This may be either the time creation was initiated or when it was
917	// completed.
918	CreateTime string `json:"createTime,omitempty"`
919
920	// DeleteTime: Output only. The timestamp when the resource was deleted.
921	// If the resource is not deleted, this must be empty.
922	DeleteTime string `json:"deleteTime,omitempty"`
923
924	// DisplayName: Mutable. The display name set by clients. Must be <= 63
925	// characters.
926	DisplayName string `json:"displayName,omitempty"`
927
928	// Etag: Output only. An opaque value that uniquely identifies a version
929	// or generation of a resource. It can be used to confirm that the
930	// client and server agree on the ordering of a resource being written.
931	Etag string `json:"etag,omitempty"`
932
933	// Labels: The labels or tags on the resource, such as AWS resource tags
934	// and Kubernetes resource labels.
935	Labels map[string]string `json:"labels,omitempty"`
936
937	// Name: The stable identifier (name) of a resource on the `service`. A
938	// resource can be logically identified as
939	// "//{resource.service}/{resource.name}". The differences between a
940	// resource name and a URI are: * Resource name is a logical identifier,
941	// independent of network protocol and API version. For example,
942	// `//pubsub.googleapis.com/projects/123/topics/news-feed`. * URI often
943	// includes protocol and version information, so it can be used directly
944	// by applications. For example,
945	// `https://pubsub.googleapis.com/v1/projects/123/topics/news-feed`. See
946	// https://cloud.google.com/apis/design/resource_names for details.
947	Name string `json:"name,omitempty"`
948
949	// Service: The name of the service that this resource belongs to, such
950	// as `pubsub.googleapis.com`. The service may be different from the DNS
951	// hostname that actually serves the request.
952	Service string `json:"service,omitempty"`
953
954	// Type: The type of the resource. The syntax is platform-specific
955	// because different platforms define their resources differently. For
956	// Google APIs, the type format must be "{service}/{kind}".
957	Type string `json:"type,omitempty"`
958
959	// Uid: The unique identifier of the resource. UID is unique in the time
960	// and space for this resource within the scope of the service. It is
961	// typically generated by the server on successful creation of a
962	// resource and must not be changed. UID is used to uniquely identify
963	// resources with resource name reuses. This should be a UUID4.
964	Uid string `json:"uid,omitempty"`
965
966	// UpdateTime: Output only. The timestamp when the resource was last
967	// updated. Any change to the resource made by users must refresh this
968	// value. Changes to a resource made by the service should refresh this
969	// value.
970	UpdateTime string `json:"updateTime,omitempty"`
971
972	// ForceSendFields is a list of field names (e.g. "Annotations") to
973	// unconditionally include in API requests. By default, fields with
974	// empty values are omitted from API requests. However, any non-pointer,
975	// non-interface field appearing in ForceSendFields will be sent to the
976	// server regardless of whether the field is empty or not. This may be
977	// used to include empty fields in Patch requests.
978	ForceSendFields []string `json:"-"`
979
980	// NullFields is a list of field names (e.g. "Annotations") to include
981	// in API requests with the JSON null value. By default, fields with
982	// empty values are omitted from API requests. However, any field with
983	// an empty value appearing in NullFields will be sent to the server as
984	// null. It is an error if a field in this list has a non-empty value.
985	// This may be used to include null fields in Patch requests.
986	NullFields []string `json:"-"`
987}
988
989func (s *Resource) MarshalJSON() ([]byte, error) {
990	type NoMethod Resource
991	raw := NoMethod(*s)
992	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
993}
994
995// ResourceInfo: Describes a resource referenced in the request.
996type ResourceInfo struct {
997	// Name: The name of the resource referenced in the request.
998	Name string `json:"name,omitempty"`
999
1000	// Permission: The resource permission needed for this request. The
1001	// format must be "{service}/{plural}.{verb}".
1002	Permission string `json:"permission,omitempty"`
1003
1004	// Type: The resource type in the format of "{service}/{kind}".
1005	Type string `json:"type,omitempty"`
1006
1007	// ForceSendFields is a list of field names (e.g. "Name") to
1008	// unconditionally include in API requests. By default, fields with
1009	// empty values are omitted from API requests. However, any non-pointer,
1010	// non-interface field appearing in ForceSendFields will be sent to the
1011	// server regardless of whether the field is empty or not. This may be
1012	// used to include empty fields in Patch requests.
1013	ForceSendFields []string `json:"-"`
1014
1015	// NullFields is a list of field names (e.g. "Name") to include in API
1016	// requests with the JSON null value. By default, fields with empty
1017	// values are omitted from API requests. However, any field with an
1018	// empty value appearing in NullFields will be sent to the server as
1019	// null. It is an error if a field in this list has a non-empty value.
1020	// This may be used to include null fields in Patch requests.
1021	NullFields []string `json:"-"`
1022}
1023
1024func (s *ResourceInfo) MarshalJSON() ([]byte, error) {
1025	type NoMethod ResourceInfo
1026	raw := NoMethod(*s)
1027	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1028}
1029
1030// ResourceLocation: Location information about a resource.
1031type ResourceLocation struct {
1032	// CurrentLocations: The locations of a resource after the execution of
1033	// the operation. Requests to create or delete a location based resource
1034	// must populate the 'current_locations' field and not the
1035	// 'original_locations' field. For example: "europe-west1-a" "us-east1"
1036	// "nam3"
1037	CurrentLocations []string `json:"currentLocations,omitempty"`
1038
1039	// OriginalLocations: The locations of a resource prior to the execution
1040	// of the operation. Requests that mutate the resource's location must
1041	// populate both the 'original_locations' as well as the
1042	// 'current_locations' fields. For example: "europe-west1-a" "us-east1"
1043	// "nam3"
1044	OriginalLocations []string `json:"originalLocations,omitempty"`
1045
1046	// ForceSendFields is a list of field names (e.g. "CurrentLocations") to
1047	// unconditionally include in API requests. By default, fields with
1048	// empty values are omitted from API requests. However, any non-pointer,
1049	// non-interface field appearing in ForceSendFields will be sent to the
1050	// server regardless of whether the field is empty or not. This may be
1051	// used to include empty fields in Patch requests.
1052	ForceSendFields []string `json:"-"`
1053
1054	// NullFields is a list of field names (e.g. "CurrentLocations") to
1055	// include in API requests with the JSON null value. By default, fields
1056	// with empty values are omitted from API requests. However, any field
1057	// with an empty value appearing in NullFields will be sent to the
1058	// server as null. It is an error if a field in this list has a
1059	// non-empty value. This may be used to include null fields in Patch
1060	// requests.
1061	NullFields []string `json:"-"`
1062}
1063
1064func (s *ResourceLocation) MarshalJSON() ([]byte, error) {
1065	type NoMethod ResourceLocation
1066	raw := NoMethod(*s)
1067	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1068}
1069
1070// Response: This message defines attributes for a typical network
1071// response. It generally models semantics of an HTTP response.
1072type Response struct {
1073	// Code: The HTTP response status code, such as `200` and `404`.
1074	Code int64 `json:"code,omitempty,string"`
1075
1076	// Headers: The HTTP response headers. If multiple headers share the
1077	// same key, they must be merged according to HTTP spec. All header keys
1078	// must be lowercased, because HTTP header keys are case-insensitive.
1079	Headers map[string]string `json:"headers,omitempty"`
1080
1081	// Size: The HTTP response size in bytes. If unknown, it must be -1.
1082	Size int64 `json:"size,omitempty,string"`
1083
1084	// Time: The timestamp when the `destination` service generates the
1085	// first byte of the response.
1086	Time string `json:"time,omitempty"`
1087
1088	// ForceSendFields is a list of field names (e.g. "Code") to
1089	// unconditionally include in API requests. By default, fields with
1090	// empty values are omitted from API requests. However, any non-pointer,
1091	// non-interface field appearing in ForceSendFields will be sent to the
1092	// server regardless of whether the field is empty or not. This may be
1093	// used to include empty fields in Patch requests.
1094	ForceSendFields []string `json:"-"`
1095
1096	// NullFields is a list of field names (e.g. "Code") to include in API
1097	// requests with the JSON null value. By default, fields with empty
1098	// values are omitted from API requests. However, any field with an
1099	// empty value appearing in NullFields will be sent to the server as
1100	// null. It is an error if a field in this list has a non-empty value.
1101	// This may be used to include null fields in Patch requests.
1102	NullFields []string `json:"-"`
1103}
1104
1105func (s *Response) MarshalJSON() ([]byte, error) {
1106	type NoMethod Response
1107	raw := NoMethod(*s)
1108	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1109}
1110
1111// ServiceAccountDelegationInfo: Identity delegation history of an
1112// authenticated service account.
1113type ServiceAccountDelegationInfo struct {
1114	// FirstPartyPrincipal: First party (Google) identity as the real
1115	// authority.
1116	FirstPartyPrincipal *FirstPartyPrincipal `json:"firstPartyPrincipal,omitempty"`
1117
1118	// PrincipalSubject: A string representing the principal_subject
1119	// associated with the identity. See go/3pical for more info on how
1120	// principal_subject is formatted.
1121	PrincipalSubject string `json:"principalSubject,omitempty"`
1122
1123	// ThirdPartyPrincipal: Third party identity as the real authority.
1124	ThirdPartyPrincipal *ThirdPartyPrincipal `json:"thirdPartyPrincipal,omitempty"`
1125
1126	// ForceSendFields is a list of field names (e.g. "FirstPartyPrincipal")
1127	// to unconditionally include in API requests. By default, fields with
1128	// empty values are omitted from API requests. However, any non-pointer,
1129	// non-interface field appearing in ForceSendFields will be sent to the
1130	// server regardless of whether the field is empty or not. This may be
1131	// used to include empty fields in Patch requests.
1132	ForceSendFields []string `json:"-"`
1133
1134	// NullFields is a list of field names (e.g. "FirstPartyPrincipal") to
1135	// include in API requests with the JSON null value. By default, fields
1136	// with empty values are omitted from API requests. However, any field
1137	// with an empty value appearing in NullFields will be sent to the
1138	// server as null. It is an error if a field in this list has a
1139	// non-empty value. This may be used to include null fields in Patch
1140	// requests.
1141	NullFields []string `json:"-"`
1142}
1143
1144func (s *ServiceAccountDelegationInfo) MarshalJSON() ([]byte, error) {
1145	type NoMethod ServiceAccountDelegationInfo
1146	raw := NoMethod(*s)
1147	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1148}
1149
1150// SpanContext: The context of a span, attached to Exemplars in
1151// Distribution values during aggregation. It contains the name of a
1152// span with format:
1153// projects/[PROJECT_ID_OR_NUMBER]/traces/[TRACE_ID]/spans/[SPAN_ID]
1154type SpanContext struct {
1155	// SpanName: The resource name of the span. The format is:
1156	// projects/[PROJECT_ID_OR_NUMBER]/traces/[TRACE_ID]/spans/[SPAN_ID]
1157	// `[TRACE_ID]` is a unique identifier for a trace within a project; it
1158	// is a 32-character hexadecimal encoding of a 16-byte array.
1159	// `[SPAN_ID]` is a unique identifier for a span within a trace; it is a
1160	// 16-character hexadecimal encoding of an 8-byte array.
1161	SpanName string `json:"spanName,omitempty"`
1162
1163	// ForceSendFields is a list of field names (e.g. "SpanName") to
1164	// unconditionally include in API requests. By default, fields with
1165	// empty values are omitted from API requests. However, any non-pointer,
1166	// non-interface field appearing in ForceSendFields will be sent to the
1167	// server regardless of whether the field is empty or not. This may be
1168	// used to include empty fields in Patch requests.
1169	ForceSendFields []string `json:"-"`
1170
1171	// NullFields is a list of field names (e.g. "SpanName") to include in
1172	// API requests with the JSON null value. By default, fields with empty
1173	// values are omitted from API requests. However, any field with an
1174	// empty value appearing in NullFields will be sent to the server as
1175	// null. It is an error if a field in this list has a non-empty value.
1176	// This may be used to include null fields in Patch requests.
1177	NullFields []string `json:"-"`
1178}
1179
1180func (s *SpanContext) MarshalJSON() ([]byte, error) {
1181	type NoMethod SpanContext
1182	raw := NoMethod(*s)
1183	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1184}
1185
1186// Status: The `Status` type defines a logical error model that is
1187// suitable for different programming environments, including REST APIs
1188// and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each
1189// `Status` message contains three pieces of data: error code, error
1190// message, and error details. You can find out more about this error
1191// model and how to work with it in the [API Design
1192// Guide](https://cloud.google.com/apis/design/errors).
1193type Status struct {
1194	// Code: The status code, which should be an enum value of
1195	// google.rpc.Code.
1196	Code int64 `json:"code,omitempty"`
1197
1198	// Details: A list of messages that carry the error details. There is a
1199	// common set of message types for APIs to use.
1200	Details []googleapi.RawMessage `json:"details,omitempty"`
1201
1202	// Message: A developer-facing error message, which should be in
1203	// English. Any user-facing error message should be localized and sent
1204	// in the google.rpc.Status.details field, or localized by the client.
1205	Message string `json:"message,omitempty"`
1206
1207	// ForceSendFields is a list of field names (e.g. "Code") to
1208	// unconditionally include in API requests. By default, fields with
1209	// empty values are omitted from API requests. However, any non-pointer,
1210	// non-interface field appearing in ForceSendFields will be sent to the
1211	// server regardless of whether the field is empty or not. This may be
1212	// used to include empty fields in Patch requests.
1213	ForceSendFields []string `json:"-"`
1214
1215	// NullFields is a list of field names (e.g. "Code") to include in API
1216	// requests with the JSON null value. By default, fields with empty
1217	// values are omitted from API requests. However, any field with an
1218	// empty value appearing in NullFields will be sent to the server as
1219	// null. It is an error if a field in this list has a non-empty value.
1220	// This may be used to include null fields in Patch requests.
1221	NullFields []string `json:"-"`
1222}
1223
1224func (s *Status) MarshalJSON() ([]byte, error) {
1225	type NoMethod Status
1226	raw := NoMethod(*s)
1227	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1228}
1229
1230// ThirdPartyPrincipal: Third party identity principal.
1231type ThirdPartyPrincipal struct {
1232	// ThirdPartyClaims: Metadata about third party identity.
1233	ThirdPartyClaims googleapi.RawMessage `json:"thirdPartyClaims,omitempty"`
1234
1235	// ForceSendFields is a list of field names (e.g. "ThirdPartyClaims") to
1236	// unconditionally include in API requests. By default, fields with
1237	// empty values are omitted from API requests. However, any non-pointer,
1238	// non-interface field appearing in ForceSendFields will be sent to the
1239	// server regardless of whether the field is empty or not. This may be
1240	// used to include empty fields in Patch requests.
1241	ForceSendFields []string `json:"-"`
1242
1243	// NullFields is a list of field names (e.g. "ThirdPartyClaims") to
1244	// include in API requests with the JSON null value. By default, fields
1245	// with empty values are omitted from API requests. However, any field
1246	// with an empty value appearing in NullFields will be sent to the
1247	// server as null. It is an error if a field in this list has a
1248	// non-empty value. This may be used to include null fields in Patch
1249	// requests.
1250	NullFields []string `json:"-"`
1251}
1252
1253func (s *ThirdPartyPrincipal) MarshalJSON() ([]byte, error) {
1254	type NoMethod ThirdPartyPrincipal
1255	raw := NoMethod(*s)
1256	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1257}
1258
1259// method id "servicecontrol.services.check":
1260
1261type ServicesCheckCall struct {
1262	s            *Service
1263	serviceName  string
1264	checkrequest *CheckRequest
1265	urlParams_   gensupport.URLParams
1266	ctx_         context.Context
1267	header_      http.Header
1268}
1269
1270// Check: Private Preview. This feature is only available for approved
1271// services. This method provides admission control for services that
1272// are integrated with [Service
1273// Infrastructure](/service-infrastructure). It checks whether an
1274// operation should be allowed based on the service configuration and
1275// relevant policies. It must be called before the operation is
1276// executed. For more information, see [Admission
1277// Control](/service-infrastructure/docs/admission-control). NOTE: The
1278// admission control has an expected policy propagation delay of 60s.
1279// The caller **must** not depend on the most recent policy changes.
1280// NOTE: The admission control has a hard limit of 1 referenced
1281// resources per call. If an operation refers to more than 1 resources,
1282// the caller must call the Check method multiple times. This method
1283// requires the `servicemanagement.services.check` permission on the
1284// specified service. For more information, see [Service Control API
1285// Access
1286// Control](https://cloud.google.com/service-infrastructure/docs/service-
1287// control/access-control).
1288func (r *ServicesService) Check(serviceName string, checkrequest *CheckRequest) *ServicesCheckCall {
1289	c := &ServicesCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1290	c.serviceName = serviceName
1291	c.checkrequest = checkrequest
1292	return c
1293}
1294
1295// Fields allows partial responses to be retrieved. See
1296// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1297// for more information.
1298func (c *ServicesCheckCall) Fields(s ...googleapi.Field) *ServicesCheckCall {
1299	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1300	return c
1301}
1302
1303// Context sets the context to be used in this call's Do method. Any
1304// pending HTTP request will be aborted if the provided context is
1305// canceled.
1306func (c *ServicesCheckCall) Context(ctx context.Context) *ServicesCheckCall {
1307	c.ctx_ = ctx
1308	return c
1309}
1310
1311// Header returns an http.Header that can be modified by the caller to
1312// add HTTP headers to the request.
1313func (c *ServicesCheckCall) Header() http.Header {
1314	if c.header_ == nil {
1315		c.header_ = make(http.Header)
1316	}
1317	return c.header_
1318}
1319
1320func (c *ServicesCheckCall) doRequest(alt string) (*http.Response, error) {
1321	reqHeaders := make(http.Header)
1322	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
1323	for k, v := range c.header_ {
1324		reqHeaders[k] = v
1325	}
1326	reqHeaders.Set("User-Agent", c.s.userAgent())
1327	var body io.Reader = nil
1328	body, err := googleapi.WithoutDataWrapper.JSONReader(c.checkrequest)
1329	if err != nil {
1330		return nil, err
1331	}
1332	reqHeaders.Set("Content-Type", "application/json")
1333	c.urlParams_.Set("alt", alt)
1334	c.urlParams_.Set("prettyPrint", "false")
1335	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/services/{serviceName}:check")
1336	urls += "?" + c.urlParams_.Encode()
1337	req, err := http.NewRequest("POST", urls, body)
1338	if err != nil {
1339		return nil, err
1340	}
1341	req.Header = reqHeaders
1342	googleapi.Expand(req.URL, map[string]string{
1343		"serviceName": c.serviceName,
1344	})
1345	return gensupport.SendRequest(c.ctx_, c.s.client, req)
1346}
1347
1348// Do executes the "servicecontrol.services.check" call.
1349// Exactly one of *CheckResponse or error will be non-nil. Any non-2xx
1350// status code is an error. Response headers are in either
1351// *CheckResponse.ServerResponse.Header or (if a response was returned
1352// at all) in error.(*googleapi.Error).Header. Use
1353// googleapi.IsNotModified to check whether the returned error was
1354// because http.StatusNotModified was returned.
1355func (c *ServicesCheckCall) Do(opts ...googleapi.CallOption) (*CheckResponse, error) {
1356	gensupport.SetOptions(c.urlParams_, opts...)
1357	res, err := c.doRequest("json")
1358	if res != nil && res.StatusCode == http.StatusNotModified {
1359		if res.Body != nil {
1360			res.Body.Close()
1361		}
1362		return nil, &googleapi.Error{
1363			Code:   res.StatusCode,
1364			Header: res.Header,
1365		}
1366	}
1367	if err != nil {
1368		return nil, err
1369	}
1370	defer googleapi.CloseBody(res)
1371	if err := googleapi.CheckResponse(res); err != nil {
1372		return nil, err
1373	}
1374	ret := &CheckResponse{
1375		ServerResponse: googleapi.ServerResponse{
1376			Header:         res.Header,
1377			HTTPStatusCode: res.StatusCode,
1378		},
1379	}
1380	target := &ret
1381	if err := gensupport.DecodeResponse(target, res); err != nil {
1382		return nil, err
1383	}
1384	return ret, nil
1385	// {
1386	//   "description": "Private Preview. This feature is only available for approved services. This method provides admission control for services that are integrated with [Service Infrastructure](/service-infrastructure). It checks whether an operation should be allowed based on the service configuration and relevant policies. It must be called before the operation is executed. For more information, see [Admission Control](/service-infrastructure/docs/admission-control). NOTE: The admission control has an expected policy propagation delay of 60s. The caller **must** not depend on the most recent policy changes. NOTE: The admission control has a hard limit of 1 referenced resources per call. If an operation refers to more than 1 resources, the caller must call the Check method multiple times. This method requires the `servicemanagement.services.check` permission on the specified service. For more information, see [Service Control API Access Control](https://cloud.google.com/service-infrastructure/docs/service-control/access-control).",
1387	//   "flatPath": "v2/services/{serviceName}:check",
1388	//   "httpMethod": "POST",
1389	//   "id": "servicecontrol.services.check",
1390	//   "parameterOrder": [
1391	//     "serviceName"
1392	//   ],
1393	//   "parameters": {
1394	//     "serviceName": {
1395	//       "description": "The service name as specified in its service configuration. For example, `\"pubsub.googleapis.com\"`. See [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) for the definition of a service name.",
1396	//       "location": "path",
1397	//       "required": true,
1398	//       "type": "string"
1399	//     }
1400	//   },
1401	//   "path": "v2/services/{serviceName}:check",
1402	//   "request": {
1403	//     "$ref": "CheckRequest"
1404	//   },
1405	//   "response": {
1406	//     "$ref": "CheckResponse"
1407	//   },
1408	//   "scopes": [
1409	//     "https://www.googleapis.com/auth/cloud-platform",
1410	//     "https://www.googleapis.com/auth/servicecontrol"
1411	//   ]
1412	// }
1413
1414}
1415
1416// method id "servicecontrol.services.report":
1417
1418type ServicesReportCall struct {
1419	s             *Service
1420	serviceName   string
1421	reportrequest *ReportRequest
1422	urlParams_    gensupport.URLParams
1423	ctx_          context.Context
1424	header_       http.Header
1425}
1426
1427// Report: Private Preview. This feature is only available for approved
1428// services. This method provides telemetry reporting for services that
1429// are integrated with [Service
1430// Infrastructure](/service-infrastructure). It reports a list of
1431// operations that have occurred on a service. It must be called after
1432// the operations have been executed. For more information, see
1433// [Telemetry
1434// Reporting](/service-infrastructure/docs/telemetry-reporting). NOTE:
1435// The telemetry reporting has a hard limit of 1000 operations and 1MB
1436// per Report call. It is recommended to have no more than 100
1437// operations per call. This method requires the
1438// `servicemanagement.services.report` permission on the specified
1439// service. For more information, see [Service Control API Access
1440// Control](https://cloud.google.com/service-infrastructure/docs/service-
1441// control/access-control).
1442func (r *ServicesService) Report(serviceName string, reportrequest *ReportRequest) *ServicesReportCall {
1443	c := &ServicesReportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1444	c.serviceName = serviceName
1445	c.reportrequest = reportrequest
1446	return c
1447}
1448
1449// Fields allows partial responses to be retrieved. See
1450// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1451// for more information.
1452func (c *ServicesReportCall) Fields(s ...googleapi.Field) *ServicesReportCall {
1453	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1454	return c
1455}
1456
1457// Context sets the context to be used in this call's Do method. Any
1458// pending HTTP request will be aborted if the provided context is
1459// canceled.
1460func (c *ServicesReportCall) Context(ctx context.Context) *ServicesReportCall {
1461	c.ctx_ = ctx
1462	return c
1463}
1464
1465// Header returns an http.Header that can be modified by the caller to
1466// add HTTP headers to the request.
1467func (c *ServicesReportCall) Header() http.Header {
1468	if c.header_ == nil {
1469		c.header_ = make(http.Header)
1470	}
1471	return c.header_
1472}
1473
1474func (c *ServicesReportCall) doRequest(alt string) (*http.Response, error) {
1475	reqHeaders := make(http.Header)
1476	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
1477	for k, v := range c.header_ {
1478		reqHeaders[k] = v
1479	}
1480	reqHeaders.Set("User-Agent", c.s.userAgent())
1481	var body io.Reader = nil
1482	body, err := googleapi.WithoutDataWrapper.JSONReader(c.reportrequest)
1483	if err != nil {
1484		return nil, err
1485	}
1486	reqHeaders.Set("Content-Type", "application/json")
1487	c.urlParams_.Set("alt", alt)
1488	c.urlParams_.Set("prettyPrint", "false")
1489	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/services/{serviceName}:report")
1490	urls += "?" + c.urlParams_.Encode()
1491	req, err := http.NewRequest("POST", urls, body)
1492	if err != nil {
1493		return nil, err
1494	}
1495	req.Header = reqHeaders
1496	googleapi.Expand(req.URL, map[string]string{
1497		"serviceName": c.serviceName,
1498	})
1499	return gensupport.SendRequest(c.ctx_, c.s.client, req)
1500}
1501
1502// Do executes the "servicecontrol.services.report" call.
1503// Exactly one of *ReportResponse or error will be non-nil. Any non-2xx
1504// status code is an error. Response headers are in either
1505// *ReportResponse.ServerResponse.Header or (if a response was returned
1506// at all) in error.(*googleapi.Error).Header. Use
1507// googleapi.IsNotModified to check whether the returned error was
1508// because http.StatusNotModified was returned.
1509func (c *ServicesReportCall) Do(opts ...googleapi.CallOption) (*ReportResponse, error) {
1510	gensupport.SetOptions(c.urlParams_, opts...)
1511	res, err := c.doRequest("json")
1512	if res != nil && res.StatusCode == http.StatusNotModified {
1513		if res.Body != nil {
1514			res.Body.Close()
1515		}
1516		return nil, &googleapi.Error{
1517			Code:   res.StatusCode,
1518			Header: res.Header,
1519		}
1520	}
1521	if err != nil {
1522		return nil, err
1523	}
1524	defer googleapi.CloseBody(res)
1525	if err := googleapi.CheckResponse(res); err != nil {
1526		return nil, err
1527	}
1528	ret := &ReportResponse{
1529		ServerResponse: googleapi.ServerResponse{
1530			Header:         res.Header,
1531			HTTPStatusCode: res.StatusCode,
1532		},
1533	}
1534	target := &ret
1535	if err := gensupport.DecodeResponse(target, res); err != nil {
1536		return nil, err
1537	}
1538	return ret, nil
1539	// {
1540	//   "description": "Private Preview. This feature is only available for approved services. This method provides telemetry reporting for services that are integrated with [Service Infrastructure](/service-infrastructure). It reports a list of operations that have occurred on a service. It must be called after the operations have been executed. For more information, see [Telemetry Reporting](/service-infrastructure/docs/telemetry-reporting). NOTE: The telemetry reporting has a hard limit of 1000 operations and 1MB per Report call. It is recommended to have no more than 100 operations per call. This method requires the `servicemanagement.services.report` permission on the specified service. For more information, see [Service Control API Access Control](https://cloud.google.com/service-infrastructure/docs/service-control/access-control).",
1541	//   "flatPath": "v2/services/{serviceName}:report",
1542	//   "httpMethod": "POST",
1543	//   "id": "servicecontrol.services.report",
1544	//   "parameterOrder": [
1545	//     "serviceName"
1546	//   ],
1547	//   "parameters": {
1548	//     "serviceName": {
1549	//       "description": "The service name as specified in its service configuration. For example, `\"pubsub.googleapis.com\"`. See [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) for the definition of a service name.",
1550	//       "location": "path",
1551	//       "required": true,
1552	//       "type": "string"
1553	//     }
1554	//   },
1555	//   "path": "v2/services/{serviceName}:report",
1556	//   "request": {
1557	//     "$ref": "ReportRequest"
1558	//   },
1559	//   "response": {
1560	//     "$ref": "ReportResponse"
1561	//   },
1562	//   "scopes": [
1563	//     "https://www.googleapis.com/auth/cloud-platform",
1564	//     "https://www.googleapis.com/auth/servicecontrol"
1565	//   ]
1566	// }
1567
1568}
1569