...

Source file src/google.golang.org/api/securitycenter/v1p1alpha1/securitycenter-gen.go

Documentation: google.golang.org/api/securitycenter/v1p1alpha1

     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 securitycenter provides access to the Security Command Center API.
     8  //
     9  // For product documentation, see: https://console.cloud.google.com/apis/api/securitycenter.googleapis.com/overview
    10  //
    11  // # Creating a client
    12  //
    13  // Usage example:
    14  //
    15  //	import "google.golang.org/api/securitycenter/v1p1alpha1"
    16  //	...
    17  //	ctx := context.Background()
    18  //	securitycenterService, err := securitycenter.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  // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
    27  //
    28  //	securitycenterService, err := securitycenter.NewService(ctx, option.WithAPIKey("AIza..."))
    29  //
    30  // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
    31  //
    32  //	config := &oauth2.Config{...}
    33  //	// ...
    34  //	token, err := config.Exchange(ctx, ...)
    35  //	securitycenterService, err := securitycenter.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    36  //
    37  // See https://godoc.org/google.golang.org/api/option/ for details on options.
    38  package securitycenter // import "google.golang.org/api/securitycenter/v1p1alpha1"
    39  
    40  import (
    41  	"bytes"
    42  	"context"
    43  	"encoding/json"
    44  	"errors"
    45  	"fmt"
    46  	"io"
    47  	"net/http"
    48  	"net/url"
    49  	"strconv"
    50  	"strings"
    51  
    52  	googleapi "google.golang.org/api/googleapi"
    53  	gensupport "google.golang.org/api/internal/gensupport"
    54  	option "google.golang.org/api/option"
    55  	internaloption "google.golang.org/api/option/internaloption"
    56  	htransport "google.golang.org/api/transport/http"
    57  )
    58  
    59  // Always reference these packages, just in case the auto-generated code
    60  // below doesn't.
    61  var _ = bytes.NewBuffer
    62  var _ = strconv.Itoa
    63  var _ = fmt.Sprintf
    64  var _ = json.NewDecoder
    65  var _ = io.Copy
    66  var _ = url.Parse
    67  var _ = gensupport.MarshalJSON
    68  var _ = googleapi.Version
    69  var _ = errors.New
    70  var _ = strings.Replace
    71  var _ = context.Canceled
    72  var _ = internaloption.WithDefaultEndpoint
    73  
    74  const apiId = "securitycenter:v1p1alpha1"
    75  const apiName = "securitycenter"
    76  const apiVersion = "v1p1alpha1"
    77  const basePath = "https://securitycenter.googleapis.com/"
    78  const mtlsBasePath = "https://securitycenter.mtls.googleapis.com/"
    79  
    80  // OAuth2 scopes used by this API.
    81  const (
    82  	// View and manage your data across Google Cloud Platform services
    83  	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
    84  )
    85  
    86  // NewService creates a new Service.
    87  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
    88  	scopesOption := option.WithScopes(
    89  		"https://www.googleapis.com/auth/cloud-platform",
    90  	)
    91  	// NOTE: prepend, so we don't override user-specified scopes.
    92  	opts = append([]option.ClientOption{scopesOption}, opts...)
    93  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
    94  	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
    95  	client, endpoint, err := htransport.NewClient(ctx, opts...)
    96  	if err != nil {
    97  		return nil, err
    98  	}
    99  	s, err := New(client)
   100  	if err != nil {
   101  		return nil, err
   102  	}
   103  	if endpoint != "" {
   104  		s.BasePath = endpoint
   105  	}
   106  	return s, nil
   107  }
   108  
   109  // New creates a new Service. It uses the provided http.Client for requests.
   110  //
   111  // Deprecated: please use NewService instead.
   112  // To provide a custom HTTP client, use option.WithHTTPClient.
   113  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   114  func New(client *http.Client) (*Service, error) {
   115  	if client == nil {
   116  		return nil, errors.New("client is nil")
   117  	}
   118  	s := &Service{client: client, BasePath: basePath}
   119  	s.Organizations = NewOrganizationsService(s)
   120  	return s, nil
   121  }
   122  
   123  type Service struct {
   124  	client    *http.Client
   125  	BasePath  string // API endpoint base URL
   126  	UserAgent string // optional additional User-Agent fragment
   127  
   128  	Organizations *OrganizationsService
   129  }
   130  
   131  func (s *Service) userAgent() string {
   132  	if s.UserAgent == "" {
   133  		return googleapi.UserAgent
   134  	}
   135  	return googleapi.UserAgent + " " + s.UserAgent
   136  }
   137  
   138  func NewOrganizationsService(s *Service) *OrganizationsService {
   139  	rs := &OrganizationsService{s: s}
   140  	rs.Operations = NewOrganizationsOperationsService(s)
   141  	return rs
   142  }
   143  
   144  type OrganizationsService struct {
   145  	s *Service
   146  
   147  	Operations *OrganizationsOperationsService
   148  }
   149  
   150  func NewOrganizationsOperationsService(s *Service) *OrganizationsOperationsService {
   151  	rs := &OrganizationsOperationsService{s: s}
   152  	return rs
   153  }
   154  
   155  type OrganizationsOperationsService struct {
   156  	s *Service
   157  }
   158  
   159  // Empty: A generic empty message that you can re-use to avoid defining
   160  // duplicated empty messages in your APIs. A typical example is to use
   161  // it as the request or the response type of an API method. For
   162  // instance: service Foo { rpc Bar(google.protobuf.Empty) returns
   163  // (google.protobuf.Empty); } The JSON representation for `Empty` is
   164  // empty JSON object `{}`.
   165  type Empty struct {
   166  	// ServerResponse contains the HTTP response code and headers from the
   167  	// server.
   168  	googleapi.ServerResponse `json:"-"`
   169  }
   170  
   171  // Finding: Security Command Center finding. A finding is a record of
   172  // assessment data like security, risk, health, or privacy, that is
   173  // ingested into Security Command Center for presentation, notification,
   174  // analysis, policy testing, and enforcement. For example, a cross-site
   175  // scripting (XSS) vulnerability in an App Engine application is a
   176  // finding.
   177  type Finding struct {
   178  	// Category: The additional taxonomy group within findings from a given
   179  	// source. This field is immutable after creation time. Example:
   180  	// "XSS_FLASH_INJECTION"
   181  	Category string `json:"category,omitempty"`
   182  
   183  	// CreateTime: The time at which the finding was created in Security
   184  	// Command Center.
   185  	CreateTime string `json:"createTime,omitempty"`
   186  
   187  	// EventTime: The time at which the event took place, or when an update
   188  	// to the finding occurred. For example, if the finding represents an
   189  	// open firewall it would capture the time the detector believes the
   190  	// firewall became open. The accuracy is determined by the detector. If
   191  	// the finding were to be resolved afterward, this time would reflect
   192  	// when the finding was resolved.
   193  	EventTime string `json:"eventTime,omitempty"`
   194  
   195  	// ExternalUri: The URI that, if available, points to a web page outside
   196  	// of Security Command Center where additional information about the
   197  	// finding can be found. This field is guaranteed to be either empty or
   198  	// a well formed URL.
   199  	ExternalUri string `json:"externalUri,omitempty"`
   200  
   201  	// Name: The relative resource name of this finding. See:
   202  	// https://cloud.google.com/apis/design/resource_names#relative_resource_name Example:
   203  	// "organizations/{organization_id}/sources/{source_id}/findings/{finding
   204  	// _id}"
   205  	Name string `json:"name,omitempty"`
   206  
   207  	// Parent: The relative resource name of the source the finding belongs
   208  	// to. See:
   209  	// https://cloud.google.com/apis/design/resource_names#relative_resource_name This field is immutable after creation time. For example:
   210  	// "organizations/{organization_id}/sources/{source_id}"
   211  	Parent string `json:"parent,omitempty"`
   212  
   213  	// ResourceName: For findings on Google Cloud resources, the full
   214  	// resource name of the Google Cloud resource this finding is for. See:
   215  	// https://cloud.google.com/apis/design/resource_names#full_resource_name When the finding is for a non-Google Cloud resource, the resourceName can be a customer or partner defined string. This field is immutable after creation
   216  	// time.
   217  	ResourceName string `json:"resourceName,omitempty"`
   218  
   219  	// SecurityMarks: Output only. User specified security marks. These
   220  	// marks are entirely managed by the user and come from the
   221  	// SecurityMarks resource that belongs to the finding.
   222  	SecurityMarks *SecurityMarks `json:"securityMarks,omitempty"`
   223  
   224  	// SourceProperties: Source specific properties. These properties are
   225  	// managed by the source that writes the finding. The key names in the
   226  	// source_properties map must be between 1 and 255 characters, and must
   227  	// start with a letter and contain alphanumeric characters or
   228  	// underscores only.
   229  	SourceProperties googleapi.RawMessage `json:"sourceProperties,omitempty"`
   230  
   231  	// State: The state of the finding.
   232  	//
   233  	// Possible values:
   234  	//   "STATE_UNSPECIFIED" - Unspecified state.
   235  	//   "ACTIVE" - The finding requires attention and has not been
   236  	// addressed yet.
   237  	//   "INACTIVE" - The finding has been fixed, triaged as a non-issue or
   238  	// otherwise addressed and is no longer active.
   239  	State string `json:"state,omitempty"`
   240  
   241  	// ForceSendFields is a list of field names (e.g. "Category") to
   242  	// unconditionally include in API requests. By default, fields with
   243  	// empty values are omitted from API requests. However, any non-pointer,
   244  	// non-interface field appearing in ForceSendFields will be sent to the
   245  	// server regardless of whether the field is empty or not. This may be
   246  	// used to include empty fields in Patch requests.
   247  	ForceSendFields []string `json:"-"`
   248  
   249  	// NullFields is a list of field names (e.g. "Category") to include in
   250  	// API requests with the JSON null value. By default, fields with empty
   251  	// values are omitted from API requests. However, any field with an
   252  	// empty value appearing in NullFields will be sent to the server as
   253  	// null. It is an error if a field in this list has a non-empty value.
   254  	// This may be used to include null fields in Patch requests.
   255  	NullFields []string `json:"-"`
   256  }
   257  
   258  func (s *Finding) MarshalJSON() ([]byte, error) {
   259  	type NoMethod Finding
   260  	raw := NoMethod(*s)
   261  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   262  }
   263  
   264  // GoogleCloudSecuritycenterV1NotificationMessage: Cloud SCC's
   265  // Notification
   266  type GoogleCloudSecuritycenterV1NotificationMessage struct {
   267  	// Finding: If it's a Finding based notification config, this field will
   268  	// be populated.
   269  	Finding *Finding `json:"finding,omitempty"`
   270  
   271  	// NotificationConfigName: Name of the notification config that
   272  	// generated current notification.
   273  	NotificationConfigName string `json:"notificationConfigName,omitempty"`
   274  
   275  	// Resource: The Cloud resource tied to this notification's Finding.
   276  	Resource *GoogleCloudSecuritycenterV1Resource `json:"resource,omitempty"`
   277  
   278  	// ForceSendFields is a list of field names (e.g. "Finding") to
   279  	// unconditionally include in API requests. By default, fields with
   280  	// empty values are omitted from API requests. However, any non-pointer,
   281  	// non-interface field appearing in ForceSendFields will be sent to the
   282  	// server regardless of whether the field is empty or not. This may be
   283  	// used to include empty fields in Patch requests.
   284  	ForceSendFields []string `json:"-"`
   285  
   286  	// NullFields is a list of field names (e.g. "Finding") to include in
   287  	// API requests with the JSON null value. By default, fields with empty
   288  	// values are omitted from API requests. However, any field with an
   289  	// empty value appearing in NullFields will be sent to the server as
   290  	// null. It is an error if a field in this list has a non-empty value.
   291  	// This may be used to include null fields in Patch requests.
   292  	NullFields []string `json:"-"`
   293  }
   294  
   295  func (s *GoogleCloudSecuritycenterV1NotificationMessage) MarshalJSON() ([]byte, error) {
   296  	type NoMethod GoogleCloudSecuritycenterV1NotificationMessage
   297  	raw := NoMethod(*s)
   298  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   299  }
   300  
   301  // GoogleCloudSecuritycenterV1Resource:  Information related to the
   302  // Google Cloud resource.
   303  type GoogleCloudSecuritycenterV1Resource struct {
   304  	// Name: The full resource name of the resource. See:
   305  	// https://cloud.google.com/apis/design/resource_names#full_resource_name
   306  	Name string `json:"name,omitempty"`
   307  
   308  	// Parent: The full resource name of resource's parent.
   309  	Parent string `json:"parent,omitempty"`
   310  
   311  	// ParentDisplayName:  The human readable name of resource's parent.
   312  	ParentDisplayName string `json:"parentDisplayName,omitempty"`
   313  
   314  	// Project: The full resource name of project that the resource belongs
   315  	// to.
   316  	Project string `json:"project,omitempty"`
   317  
   318  	// ProjectDisplayName:  The human readable name of project that the
   319  	// resource belongs to.
   320  	ProjectDisplayName string `json:"projectDisplayName,omitempty"`
   321  
   322  	// ForceSendFields is a list of field names (e.g. "Name") to
   323  	// unconditionally include in API requests. By default, fields with
   324  	// empty values are omitted from API requests. However, any non-pointer,
   325  	// non-interface field appearing in ForceSendFields will be sent to the
   326  	// server regardless of whether the field is empty or not. This may be
   327  	// used to include empty fields in Patch requests.
   328  	ForceSendFields []string `json:"-"`
   329  
   330  	// NullFields is a list of field names (e.g. "Name") to include in API
   331  	// requests with the JSON null value. By default, fields with empty
   332  	// values are omitted from API requests. However, any field with an
   333  	// empty value appearing in NullFields will be sent to the server as
   334  	// null. It is an error if a field in this list has a non-empty value.
   335  	// This may be used to include null fields in Patch requests.
   336  	NullFields []string `json:"-"`
   337  }
   338  
   339  func (s *GoogleCloudSecuritycenterV1Resource) MarshalJSON() ([]byte, error) {
   340  	type NoMethod GoogleCloudSecuritycenterV1Resource
   341  	raw := NoMethod(*s)
   342  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   343  }
   344  
   345  // GoogleCloudSecuritycenterV1RunAssetDiscoveryResponse: Response of
   346  // asset discovery run
   347  type GoogleCloudSecuritycenterV1RunAssetDiscoveryResponse struct {
   348  	// Duration: The duration between asset discovery run start and end
   349  	Duration string `json:"duration,omitempty"`
   350  
   351  	// State: The state of an asset discovery run.
   352  	//
   353  	// Possible values:
   354  	//   "STATE_UNSPECIFIED" - Asset discovery run state was unspecified.
   355  	//   "COMPLETED" - Asset discovery run completed successfully.
   356  	//   "SUPERSEDED" - Asset discovery run was cancelled with tasks still
   357  	// pending, as another run for the same organization was started with a
   358  	// higher priority.
   359  	//   "TERMINATED" - Asset discovery run was killed and terminated.
   360  	State string `json:"state,omitempty"`
   361  
   362  	// ForceSendFields is a list of field names (e.g. "Duration") to
   363  	// unconditionally include in API requests. By default, fields with
   364  	// empty values are omitted from API requests. However, any non-pointer,
   365  	// non-interface field appearing in ForceSendFields will be sent to the
   366  	// server regardless of whether the field is empty or not. This may be
   367  	// used to include empty fields in Patch requests.
   368  	ForceSendFields []string `json:"-"`
   369  
   370  	// NullFields is a list of field names (e.g. "Duration") to include in
   371  	// API requests with the JSON null value. By default, fields with empty
   372  	// values are omitted from API requests. However, any field with an
   373  	// empty value appearing in NullFields will be sent to the server as
   374  	// null. It is an error if a field in this list has a non-empty value.
   375  	// This may be used to include null fields in Patch requests.
   376  	NullFields []string `json:"-"`
   377  }
   378  
   379  func (s *GoogleCloudSecuritycenterV1RunAssetDiscoveryResponse) MarshalJSON() ([]byte, error) {
   380  	type NoMethod GoogleCloudSecuritycenterV1RunAssetDiscoveryResponse
   381  	raw := NoMethod(*s)
   382  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   383  }
   384  
   385  // GoogleCloudSecuritycenterV1beta1RunAssetDiscoveryResponse: Response
   386  // of asset discovery run
   387  type GoogleCloudSecuritycenterV1beta1RunAssetDiscoveryResponse struct {
   388  	// Duration: The duration between asset discovery run start and end
   389  	Duration string `json:"duration,omitempty"`
   390  
   391  	// State: The state of an asset discovery run.
   392  	//
   393  	// Possible values:
   394  	//   "STATE_UNSPECIFIED" - Asset discovery run state was unspecified.
   395  	//   "COMPLETED" - Asset discovery run completed successfully.
   396  	//   "SUPERSEDED" - Asset discovery run was cancelled with tasks still
   397  	// pending, as another run for the same organization was started with a
   398  	// higher priority.
   399  	//   "TERMINATED" - Asset discovery run was killed and terminated.
   400  	State string `json:"state,omitempty"`
   401  
   402  	// ForceSendFields is a list of field names (e.g. "Duration") to
   403  	// unconditionally include in API requests. By default, fields with
   404  	// empty values are omitted from API requests. However, any non-pointer,
   405  	// non-interface field appearing in ForceSendFields will be sent to the
   406  	// server regardless of whether the field is empty or not. This may be
   407  	// used to include empty fields in Patch requests.
   408  	ForceSendFields []string `json:"-"`
   409  
   410  	// NullFields is a list of field names (e.g. "Duration") to include in
   411  	// API requests with the JSON null value. By default, fields with empty
   412  	// values are omitted from API requests. However, any field with an
   413  	// empty value appearing in NullFields will be sent to the server as
   414  	// null. It is an error if a field in this list has a non-empty value.
   415  	// This may be used to include null fields in Patch requests.
   416  	NullFields []string `json:"-"`
   417  }
   418  
   419  func (s *GoogleCloudSecuritycenterV1beta1RunAssetDiscoveryResponse) MarshalJSON() ([]byte, error) {
   420  	type NoMethod GoogleCloudSecuritycenterV1beta1RunAssetDiscoveryResponse
   421  	raw := NoMethod(*s)
   422  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   423  }
   424  
   425  // GoogleCloudSecuritycenterV1p1beta1Asset: Security Command Center
   426  // representation of a Google Cloud resource. The Asset is a Security
   427  // Command Center resource that captures information about a single
   428  // Google Cloud resource. All modifications to an Asset are only within
   429  // the context of Security Command Center and don't affect the
   430  // referenced Google Cloud resource.
   431  type GoogleCloudSecuritycenterV1p1beta1Asset struct {
   432  	// CreateTime: The time at which the asset was created in Security
   433  	// Command Center.
   434  	CreateTime string `json:"createTime,omitempty"`
   435  
   436  	// IamPolicy: Cloud IAM Policy information associated with the Google
   437  	// Cloud resource described by the Security Command Center asset. This
   438  	// information is managed and defined by the Google Cloud resource and
   439  	// cannot be modified by the user.
   440  	IamPolicy *GoogleCloudSecuritycenterV1p1beta1IamPolicy `json:"iamPolicy,omitempty"`
   441  
   442  	// Name: The relative resource name of this asset. See:
   443  	// https://cloud.google.com/apis/design/resource_names#relative_resource_name Example:
   444  	// "organizations/{organization_id}/assets/{asset_id}".
   445  	Name string `json:"name,omitempty"`
   446  
   447  	// ResourceProperties: Resource managed properties. These properties are
   448  	// managed and defined by the Google Cloud resource and cannot be
   449  	// modified by the user.
   450  	ResourceProperties googleapi.RawMessage `json:"resourceProperties,omitempty"`
   451  
   452  	// SecurityCenterProperties: Security Command Center managed properties.
   453  	// These properties are managed by Security Command Center and cannot be
   454  	// modified by the user.
   455  	SecurityCenterProperties *GoogleCloudSecuritycenterV1p1beta1SecurityCenterProperties `json:"securityCenterProperties,omitempty"`
   456  
   457  	// SecurityMarks: User specified security marks. These marks are
   458  	// entirely managed by the user and come from the SecurityMarks resource
   459  	// that belongs to the asset.
   460  	SecurityMarks *GoogleCloudSecuritycenterV1p1beta1SecurityMarks `json:"securityMarks,omitempty"`
   461  
   462  	// UpdateTime: The time at which the asset was last updated, added, or
   463  	// deleted in Cloud SCC.
   464  	UpdateTime string `json:"updateTime,omitempty"`
   465  
   466  	// ForceSendFields is a list of field names (e.g. "CreateTime") to
   467  	// unconditionally include in API requests. By default, fields with
   468  	// empty values are omitted from API requests. However, any non-pointer,
   469  	// non-interface field appearing in ForceSendFields will be sent to the
   470  	// server regardless of whether the field is empty or not. This may be
   471  	// used to include empty fields in Patch requests.
   472  	ForceSendFields []string `json:"-"`
   473  
   474  	// NullFields is a list of field names (e.g. "CreateTime") to include in
   475  	// API requests with the JSON null value. By default, fields with empty
   476  	// values are omitted from API requests. However, any field with an
   477  	// empty value appearing in NullFields will be sent to the server as
   478  	// null. It is an error if a field in this list has a non-empty value.
   479  	// This may be used to include null fields in Patch requests.
   480  	NullFields []string `json:"-"`
   481  }
   482  
   483  func (s *GoogleCloudSecuritycenterV1p1beta1Asset) MarshalJSON() ([]byte, error) {
   484  	type NoMethod GoogleCloudSecuritycenterV1p1beta1Asset
   485  	raw := NoMethod(*s)
   486  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   487  }
   488  
   489  // GoogleCloudSecuritycenterV1p1beta1Finding: Security Command Center
   490  // finding. A finding is a record of assessment data (security, risk,
   491  // health or privacy) ingested into Security Command Center for
   492  // presentation, notification, analysis, policy testing, and
   493  // enforcement. For example, an XSS vulnerability in an App Engine
   494  // application is a finding.
   495  type GoogleCloudSecuritycenterV1p1beta1Finding struct {
   496  	// Category: The additional taxonomy group within findings from a given
   497  	// source. This field is immutable after creation time. Example:
   498  	// "XSS_FLASH_INJECTION"
   499  	Category string `json:"category,omitempty"`
   500  
   501  	// CreateTime: The time at which the finding was created in Security
   502  	// Command Center.
   503  	CreateTime string `json:"createTime,omitempty"`
   504  
   505  	// EventTime: The time at which the event took place, or when an update
   506  	// to the finding occurred. For example, if the finding represents an
   507  	// open firewall it would capture the time the detector believes the
   508  	// firewall became open. The accuracy is determined by the detector. If
   509  	// the finding were to be resolved afterward, this time would reflect
   510  	// when the finding was resolved.
   511  	EventTime string `json:"eventTime,omitempty"`
   512  
   513  	// ExternalUri: The URI that, if available, points to a web page outside
   514  	// of Security Command Center where additional information about the
   515  	// finding can be found. This field is guaranteed to be either empty or
   516  	// a well formed URL.
   517  	ExternalUri string `json:"externalUri,omitempty"`
   518  
   519  	// Name: The relative resource name of this finding. See:
   520  	// https://cloud.google.com/apis/design/resource_names#relative_resource_name Example:
   521  	// "organizations/{organization_id}/sources/{source_id}/findings/{finding
   522  	// _id}"
   523  	Name string `json:"name,omitempty"`
   524  
   525  	// Parent: The relative resource name of the source the finding belongs
   526  	// to. See:
   527  	// https://cloud.google.com/apis/design/resource_names#relative_resource_name This field is immutable after creation time. For example:
   528  	// "organizations/{organization_id}/sources/{source_id}"
   529  	Parent string `json:"parent,omitempty"`
   530  
   531  	// ResourceName: For findings on Google Cloud resources, the full
   532  	// resource name of the Google Cloud resource this finding is for. See:
   533  	// https://cloud.google.com/apis/design/resource_names#full_resource_name When the finding is for a non-Google Cloud resource, the resourceName can be a customer or partner defined string. This field is immutable after creation
   534  	// time.
   535  	ResourceName string `json:"resourceName,omitempty"`
   536  
   537  	// SecurityMarks: Output only. User specified security marks. These
   538  	// marks are entirely managed by the user and come from the
   539  	// SecurityMarks resource that belongs to the finding.
   540  	SecurityMarks *GoogleCloudSecuritycenterV1p1beta1SecurityMarks `json:"securityMarks,omitempty"`
   541  
   542  	// Severity: The severity of the finding.
   543  	//
   544  	// Possible values:
   545  	//   "SEVERITY_UNSPECIFIED" - No severity specified. The default value.
   546  	//   "CRITICAL" - Critical severity.
   547  	//   "HIGH" - High severity.
   548  	//   "MEDIUM" - Medium severity.
   549  	//   "LOW" - Low severity.
   550  	Severity string `json:"severity,omitempty"`
   551  
   552  	// SourceProperties: Source specific properties. These properties are
   553  	// managed by the source that writes the finding. The key names in the
   554  	// source_properties map must be between 1 and 255 characters, and must
   555  	// start with a letter and contain alphanumeric characters or
   556  	// underscores only.
   557  	SourceProperties googleapi.RawMessage `json:"sourceProperties,omitempty"`
   558  
   559  	// State: The state of the finding.
   560  	//
   561  	// Possible values:
   562  	//   "STATE_UNSPECIFIED" - Unspecified state.
   563  	//   "ACTIVE" - The finding requires attention and has not been
   564  	// addressed yet.
   565  	//   "INACTIVE" - The finding has been fixed, triaged as a non-issue or
   566  	// otherwise addressed and is no longer active.
   567  	State string `json:"state,omitempty"`
   568  
   569  	// ForceSendFields is a list of field names (e.g. "Category") to
   570  	// unconditionally include in API requests. By default, fields with
   571  	// empty values are omitted from API requests. However, any non-pointer,
   572  	// non-interface field appearing in ForceSendFields will be sent to the
   573  	// server regardless of whether the field is empty or not. This may be
   574  	// used to include empty fields in Patch requests.
   575  	ForceSendFields []string `json:"-"`
   576  
   577  	// NullFields is a list of field names (e.g. "Category") to include in
   578  	// API requests with the JSON null value. By default, fields with empty
   579  	// values are omitted from API requests. However, any field with an
   580  	// empty value appearing in NullFields will be sent to the server as
   581  	// null. It is an error if a field in this list has a non-empty value.
   582  	// This may be used to include null fields in Patch requests.
   583  	NullFields []string `json:"-"`
   584  }
   585  
   586  func (s *GoogleCloudSecuritycenterV1p1beta1Finding) MarshalJSON() ([]byte, error) {
   587  	type NoMethod GoogleCloudSecuritycenterV1p1beta1Finding
   588  	raw := NoMethod(*s)
   589  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   590  }
   591  
   592  // GoogleCloudSecuritycenterV1p1beta1IamPolicy: Cloud IAM Policy
   593  // information associated with the Google Cloud resource described by
   594  // the Security Command Center asset. This information is managed and
   595  // defined by the Google Cloud resource and cannot be modified by the
   596  // user.
   597  type GoogleCloudSecuritycenterV1p1beta1IamPolicy struct {
   598  	// PolicyBlob: The JSON representation of the Policy associated with the
   599  	// asset. See https://cloud.google.com/iam/docs/reference/rest/v1/Policy
   600  	// for format details.
   601  	PolicyBlob string `json:"policyBlob,omitempty"`
   602  
   603  	// ForceSendFields is a list of field names (e.g. "PolicyBlob") to
   604  	// unconditionally include in API requests. By default, fields with
   605  	// empty values are omitted from API requests. However, any non-pointer,
   606  	// non-interface field appearing in ForceSendFields will be sent to the
   607  	// server regardless of whether the field is empty or not. This may be
   608  	// used to include empty fields in Patch requests.
   609  	ForceSendFields []string `json:"-"`
   610  
   611  	// NullFields is a list of field names (e.g. "PolicyBlob") to include in
   612  	// API requests with the JSON null value. By default, fields with empty
   613  	// values are omitted from API requests. However, any field with an
   614  	// empty value appearing in NullFields will be sent to the server as
   615  	// null. It is an error if a field in this list has a non-empty value.
   616  	// This may be used to include null fields in Patch requests.
   617  	NullFields []string `json:"-"`
   618  }
   619  
   620  func (s *GoogleCloudSecuritycenterV1p1beta1IamPolicy) MarshalJSON() ([]byte, error) {
   621  	type NoMethod GoogleCloudSecuritycenterV1p1beta1IamPolicy
   622  	raw := NoMethod(*s)
   623  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   624  }
   625  
   626  // GoogleCloudSecuritycenterV1p1beta1NotificationMessage: Security
   627  // Command Center's Notification
   628  type GoogleCloudSecuritycenterV1p1beta1NotificationMessage struct {
   629  	// Finding: If it's a Finding based notification config, this field will
   630  	// be populated.
   631  	Finding *GoogleCloudSecuritycenterV1p1beta1Finding `json:"finding,omitempty"`
   632  
   633  	// NotificationConfigName: Name of the notification config that
   634  	// generated current notification.
   635  	NotificationConfigName string `json:"notificationConfigName,omitempty"`
   636  
   637  	// Resource: The Cloud resource tied to the notification.
   638  	Resource *GoogleCloudSecuritycenterV1p1beta1Resource `json:"resource,omitempty"`
   639  
   640  	// TemporalAsset: If it's an asset based notification config, this field
   641  	// will be populated.
   642  	TemporalAsset *GoogleCloudSecuritycenterV1p1beta1TemporalAsset `json:"temporalAsset,omitempty"`
   643  
   644  	// ForceSendFields is a list of field names (e.g. "Finding") to
   645  	// unconditionally include in API requests. By default, fields with
   646  	// empty values are omitted from API requests. However, any non-pointer,
   647  	// non-interface field appearing in ForceSendFields will be sent to the
   648  	// server regardless of whether the field is empty or not. This may be
   649  	// used to include empty fields in Patch requests.
   650  	ForceSendFields []string `json:"-"`
   651  
   652  	// NullFields is a list of field names (e.g. "Finding") to include in
   653  	// API requests with the JSON null value. By default, fields with empty
   654  	// values are omitted from API requests. However, any field with an
   655  	// empty value appearing in NullFields will be sent to the server as
   656  	// null. It is an error if a field in this list has a non-empty value.
   657  	// This may be used to include null fields in Patch requests.
   658  	NullFields []string `json:"-"`
   659  }
   660  
   661  func (s *GoogleCloudSecuritycenterV1p1beta1NotificationMessage) MarshalJSON() ([]byte, error) {
   662  	type NoMethod GoogleCloudSecuritycenterV1p1beta1NotificationMessage
   663  	raw := NoMethod(*s)
   664  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   665  }
   666  
   667  // GoogleCloudSecuritycenterV1p1beta1Resource:  Information related to
   668  // the Google Cloud resource.
   669  type GoogleCloudSecuritycenterV1p1beta1Resource struct {
   670  	// Name: The full resource name of the resource. See:
   671  	// https://cloud.google.com/apis/design/resource_names#full_resource_name
   672  	Name string `json:"name,omitempty"`
   673  
   674  	// Parent: The full resource name of resource's parent.
   675  	Parent string `json:"parent,omitempty"`
   676  
   677  	// ParentDisplayName:  The human readable name of resource's parent.
   678  	ParentDisplayName string `json:"parentDisplayName,omitempty"`
   679  
   680  	// Project: The full resource name of project that the resource belongs
   681  	// to.
   682  	Project string `json:"project,omitempty"`
   683  
   684  	// ProjectDisplayName:  The human readable name of project that the
   685  	// resource belongs to.
   686  	ProjectDisplayName string `json:"projectDisplayName,omitempty"`
   687  
   688  	// ForceSendFields is a list of field names (e.g. "Name") to
   689  	// unconditionally include in API requests. By default, fields with
   690  	// empty values are omitted from API requests. However, any non-pointer,
   691  	// non-interface field appearing in ForceSendFields will be sent to the
   692  	// server regardless of whether the field is empty or not. This may be
   693  	// used to include empty fields in Patch requests.
   694  	ForceSendFields []string `json:"-"`
   695  
   696  	// NullFields is a list of field names (e.g. "Name") to include in API
   697  	// requests with the JSON null value. By default, fields with empty
   698  	// values are omitted from API requests. However, any field with an
   699  	// empty value appearing in NullFields will be sent to the server as
   700  	// null. It is an error if a field in this list has a non-empty value.
   701  	// This may be used to include null fields in Patch requests.
   702  	NullFields []string `json:"-"`
   703  }
   704  
   705  func (s *GoogleCloudSecuritycenterV1p1beta1Resource) MarshalJSON() ([]byte, error) {
   706  	type NoMethod GoogleCloudSecuritycenterV1p1beta1Resource
   707  	raw := NoMethod(*s)
   708  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   709  }
   710  
   711  // GoogleCloudSecuritycenterV1p1beta1RunAssetDiscoveryResponse: Response
   712  // of asset discovery run
   713  type GoogleCloudSecuritycenterV1p1beta1RunAssetDiscoveryResponse struct {
   714  	// Duration: The duration between asset discovery run start and end
   715  	Duration string `json:"duration,omitempty"`
   716  
   717  	// State: The state of an asset discovery run.
   718  	//
   719  	// Possible values:
   720  	//   "STATE_UNSPECIFIED" - Asset discovery run state was unspecified.
   721  	//   "COMPLETED" - Asset discovery run completed successfully.
   722  	//   "SUPERSEDED" - Asset discovery run was cancelled with tasks still
   723  	// pending, as another run for the same organization was started with a
   724  	// higher priority.
   725  	//   "TERMINATED" - Asset discovery run was killed and terminated.
   726  	State string `json:"state,omitempty"`
   727  
   728  	// ForceSendFields is a list of field names (e.g. "Duration") to
   729  	// unconditionally include in API requests. By default, fields with
   730  	// empty values are omitted from API requests. However, any non-pointer,
   731  	// non-interface field appearing in ForceSendFields will be sent to the
   732  	// server regardless of whether the field is empty or not. This may be
   733  	// used to include empty fields in Patch requests.
   734  	ForceSendFields []string `json:"-"`
   735  
   736  	// NullFields is a list of field names (e.g. "Duration") to include in
   737  	// API requests with the JSON null value. By default, fields with empty
   738  	// values are omitted from API requests. However, any field with an
   739  	// empty value appearing in NullFields will be sent to the server as
   740  	// null. It is an error if a field in this list has a non-empty value.
   741  	// This may be used to include null fields in Patch requests.
   742  	NullFields []string `json:"-"`
   743  }
   744  
   745  func (s *GoogleCloudSecuritycenterV1p1beta1RunAssetDiscoveryResponse) MarshalJSON() ([]byte, error) {
   746  	type NoMethod GoogleCloudSecuritycenterV1p1beta1RunAssetDiscoveryResponse
   747  	raw := NoMethod(*s)
   748  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   749  }
   750  
   751  // GoogleCloudSecuritycenterV1p1beta1SecurityCenterProperties: Security
   752  // Command Center managed properties. These properties are managed by
   753  // Security Command Center and cannot be modified by the user.
   754  type GoogleCloudSecuritycenterV1p1beta1SecurityCenterProperties struct {
   755  	// ResourceDisplayName: The user defined display name for this resource.
   756  	ResourceDisplayName string `json:"resourceDisplayName,omitempty"`
   757  
   758  	// ResourceName: The full resource name of the Google Cloud resource
   759  	// this asset represents. This field is immutable after create time.
   760  	// See:
   761  	// https://cloud.google.com/apis/design/resource_names#full_resource_name
   762  	ResourceName string `json:"resourceName,omitempty"`
   763  
   764  	// ResourceOwners: Owners of the Google Cloud resource.
   765  	ResourceOwners []string `json:"resourceOwners,omitempty"`
   766  
   767  	// ResourceParent: The full resource name of the immediate parent of the
   768  	// resource. See:
   769  	// https://cloud.google.com/apis/design/resource_names#full_resource_name
   770  	ResourceParent string `json:"resourceParent,omitempty"`
   771  
   772  	// ResourceParentDisplayName: The user defined display name for the
   773  	// parent of this resource.
   774  	ResourceParentDisplayName string `json:"resourceParentDisplayName,omitempty"`
   775  
   776  	// ResourceProject: The full resource name of the project the resource
   777  	// belongs to. See:
   778  	// https://cloud.google.com/apis/design/resource_names#full_resource_name
   779  	ResourceProject string `json:"resourceProject,omitempty"`
   780  
   781  	// ResourceProjectDisplayName: The user defined display name for the
   782  	// project of this resource.
   783  	ResourceProjectDisplayName string `json:"resourceProjectDisplayName,omitempty"`
   784  
   785  	// ResourceType: The type of the Google Cloud resource. Examples
   786  	// include: APPLICATION, PROJECT, and ORGANIZATION. This is a case
   787  	// insensitive field defined by Security Command Center and/or the
   788  	// producer of the resource and is immutable after create time.
   789  	ResourceType string `json:"resourceType,omitempty"`
   790  
   791  	// ForceSendFields is a list of field names (e.g. "ResourceDisplayName")
   792  	// to unconditionally include in API requests. By default, fields with
   793  	// empty values are omitted from API requests. However, any non-pointer,
   794  	// non-interface field appearing in ForceSendFields will be sent to the
   795  	// server regardless of whether the field is empty or not. This may be
   796  	// used to include empty fields in Patch requests.
   797  	ForceSendFields []string `json:"-"`
   798  
   799  	// NullFields is a list of field names (e.g. "ResourceDisplayName") to
   800  	// include in API requests with the JSON null value. By default, fields
   801  	// with empty values are omitted from API requests. However, any field
   802  	// with an empty value appearing in NullFields will be sent to the
   803  	// server as null. It is an error if a field in this list has a
   804  	// non-empty value. This may be used to include null fields in Patch
   805  	// requests.
   806  	NullFields []string `json:"-"`
   807  }
   808  
   809  func (s *GoogleCloudSecuritycenterV1p1beta1SecurityCenterProperties) MarshalJSON() ([]byte, error) {
   810  	type NoMethod GoogleCloudSecuritycenterV1p1beta1SecurityCenterProperties
   811  	raw := NoMethod(*s)
   812  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   813  }
   814  
   815  // GoogleCloudSecuritycenterV1p1beta1SecurityMarks: User specified
   816  // security marks that are attached to the parent Security Command
   817  // Center resource. Security marks are scoped within a Security Command
   818  // Center organization -- they can be modified and viewed by all users
   819  // who have proper permissions on the organization.
   820  type GoogleCloudSecuritycenterV1p1beta1SecurityMarks struct {
   821  	// Marks: Mutable user specified security marks belonging to the parent
   822  	// resource. Constraints are as follows: * Keys and values are treated
   823  	// as case insensitive * Keys must be between 1 - 256 characters
   824  	// (inclusive) * Keys must be letters, numbers, underscores, or dashes *
   825  	// Values have leading and trailing whitespace trimmed, remaining
   826  	// characters must be between 1 - 4096 characters (inclusive)
   827  	Marks map[string]string `json:"marks,omitempty"`
   828  
   829  	// Name: The relative resource name of the SecurityMarks. See:
   830  	// https://cloud.google.com/apis/design/resource_names#relative_resource_name Examples: "organizations/{organization_id}/assets/{asset_id}/securityMarks"
   831  	// "organizations/{organization_id}/sources/{source_id}/findings/{finding
   832  	// _id}/securityMarks".
   833  	Name string `json:"name,omitempty"`
   834  
   835  	// ForceSendFields is a list of field names (e.g. "Marks") to
   836  	// unconditionally include in API requests. By default, fields with
   837  	// empty values are omitted from API requests. However, any non-pointer,
   838  	// non-interface field appearing in ForceSendFields will be sent to the
   839  	// server regardless of whether the field is empty or not. This may be
   840  	// used to include empty fields in Patch requests.
   841  	ForceSendFields []string `json:"-"`
   842  
   843  	// NullFields is a list of field names (e.g. "Marks") to include in API
   844  	// requests with the JSON null value. By default, fields with empty
   845  	// values are omitted from API requests. However, any field with an
   846  	// empty value appearing in NullFields will be sent to the server as
   847  	// null. It is an error if a field in this list has a non-empty value.
   848  	// This may be used to include null fields in Patch requests.
   849  	NullFields []string `json:"-"`
   850  }
   851  
   852  func (s *GoogleCloudSecuritycenterV1p1beta1SecurityMarks) MarshalJSON() ([]byte, error) {
   853  	type NoMethod GoogleCloudSecuritycenterV1p1beta1SecurityMarks
   854  	raw := NoMethod(*s)
   855  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   856  }
   857  
   858  // GoogleCloudSecuritycenterV1p1beta1TemporalAsset: Wrapper over asset
   859  // object that also captures the state change for the asset e.g. if it
   860  // was a newly created asset vs updated or deleted asset.
   861  type GoogleCloudSecuritycenterV1p1beta1TemporalAsset struct {
   862  	// Asset: Asset data that includes attributes, properties and marks
   863  	// about the asset.
   864  	Asset *GoogleCloudSecuritycenterV1p1beta1Asset `json:"asset,omitempty"`
   865  
   866  	// ChangeType: Represents if the asset was created/updated/deleted.
   867  	//
   868  	// Possible values:
   869  	//   "CHANGE_TYPE_UNSPECIFIED" - Unspecified or default.
   870  	//   "CREATED" - Newly created Asset
   871  	//   "UPDATED" - Asset was updated.
   872  	//   "DELETED" - Asset was deleted.
   873  	ChangeType string `json:"changeType,omitempty"`
   874  
   875  	// ForceSendFields is a list of field names (e.g. "Asset") to
   876  	// unconditionally include in API requests. By default, fields with
   877  	// empty values are omitted from API requests. However, any non-pointer,
   878  	// non-interface field appearing in ForceSendFields will be sent to the
   879  	// server regardless of whether the field is empty or not. This may be
   880  	// used to include empty fields in Patch requests.
   881  	ForceSendFields []string `json:"-"`
   882  
   883  	// NullFields is a list of field names (e.g. "Asset") to include in API
   884  	// requests with the JSON null value. By default, fields with empty
   885  	// values are omitted from API requests. However, any field with an
   886  	// empty value appearing in NullFields will be sent to the server as
   887  	// null. It is an error if a field in this list has a non-empty value.
   888  	// This may be used to include null fields in Patch requests.
   889  	NullFields []string `json:"-"`
   890  }
   891  
   892  func (s *GoogleCloudSecuritycenterV1p1beta1TemporalAsset) MarshalJSON() ([]byte, error) {
   893  	type NoMethod GoogleCloudSecuritycenterV1p1beta1TemporalAsset
   894  	raw := NoMethod(*s)
   895  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   896  }
   897  
   898  // ListOperationsResponse: The response message for
   899  // Operations.ListOperations.
   900  type ListOperationsResponse struct {
   901  	// NextPageToken: The standard List next-page token.
   902  	NextPageToken string `json:"nextPageToken,omitempty"`
   903  
   904  	// Operations: A list of operations that matches the specified filter in
   905  	// the request.
   906  	Operations []*Operation `json:"operations,omitempty"`
   907  
   908  	// ServerResponse contains the HTTP response code and headers from the
   909  	// server.
   910  	googleapi.ServerResponse `json:"-"`
   911  
   912  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   913  	// unconditionally include in API requests. By default, fields with
   914  	// empty values are omitted from API requests. However, any non-pointer,
   915  	// non-interface field appearing in ForceSendFields will be sent to the
   916  	// server regardless of whether the field is empty or not. This may be
   917  	// used to include empty fields in Patch requests.
   918  	ForceSendFields []string `json:"-"`
   919  
   920  	// NullFields is a list of field names (e.g. "NextPageToken") to include
   921  	// in API requests with the JSON null value. By default, fields with
   922  	// empty values are omitted from API requests. However, any field with
   923  	// an empty value appearing in NullFields will be sent to the server as
   924  	// null. It is an error if a field in this list has a non-empty value.
   925  	// This may be used to include null fields in Patch requests.
   926  	NullFields []string `json:"-"`
   927  }
   928  
   929  func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
   930  	type NoMethod ListOperationsResponse
   931  	raw := NoMethod(*s)
   932  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   933  }
   934  
   935  // Operation: This resource represents a long-running operation that is
   936  // the result of a network API call.
   937  type Operation struct {
   938  	// Done: If the value is `false`, it means the operation is still in
   939  	// progress. If `true`, the operation is completed, and either `error`
   940  	// or `response` is available.
   941  	Done bool `json:"done,omitempty"`
   942  
   943  	// Error: The error result of the operation in case of failure or
   944  	// cancellation.
   945  	Error *Status `json:"error,omitempty"`
   946  
   947  	// Metadata: Service-specific metadata associated with the operation. It
   948  	// typically contains progress information and common metadata such as
   949  	// create time. Some services might not provide such metadata. Any
   950  	// method that returns a long-running operation should document the
   951  	// metadata type, if any.
   952  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
   953  
   954  	// Name: The server-assigned name, which is only unique within the same
   955  	// service that originally returns it. If you use the default HTTP
   956  	// mapping, the `name` should be a resource name ending with
   957  	// `operations/{unique_id}`.
   958  	Name string `json:"name,omitempty"`
   959  
   960  	// Response: The normal response of the operation in case of success. If
   961  	// the original method returns no data on success, such as `Delete`, the
   962  	// response is `google.protobuf.Empty`. If the original method is
   963  	// standard `Get`/`Create`/`Update`, the response should be the
   964  	// resource. For other methods, the response should have the type
   965  	// `XxxResponse`, where `Xxx` is the original method name. For example,
   966  	// if the original method name is `TakeSnapshot()`, the inferred
   967  	// response type is `TakeSnapshotResponse`.
   968  	Response googleapi.RawMessage `json:"response,omitempty"`
   969  
   970  	// ServerResponse contains the HTTP response code and headers from the
   971  	// server.
   972  	googleapi.ServerResponse `json:"-"`
   973  
   974  	// ForceSendFields is a list of field names (e.g. "Done") to
   975  	// unconditionally include in API requests. By default, fields with
   976  	// empty values are omitted from API requests. However, any non-pointer,
   977  	// non-interface field appearing in ForceSendFields will be sent to the
   978  	// server regardless of whether the field is empty or not. This may be
   979  	// used to include empty fields in Patch requests.
   980  	ForceSendFields []string `json:"-"`
   981  
   982  	// NullFields is a list of field names (e.g. "Done") to include in API
   983  	// requests with the JSON null value. By default, fields with empty
   984  	// values are omitted from API requests. However, any field with an
   985  	// empty value appearing in NullFields will be sent to the server as
   986  	// null. It is an error if a field in this list has a non-empty value.
   987  	// This may be used to include null fields in Patch requests.
   988  	NullFields []string `json:"-"`
   989  }
   990  
   991  func (s *Operation) MarshalJSON() ([]byte, error) {
   992  	type NoMethod Operation
   993  	raw := NoMethod(*s)
   994  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   995  }
   996  
   997  // SecurityMarks: User specified security marks that are attached to the
   998  // parent Security Command Center resource. Security marks are scoped
   999  // within a Security Command Center organization -- they can be modified
  1000  // and viewed by all users who have proper permissions on the
  1001  // organization.
  1002  type SecurityMarks struct {
  1003  	// Marks: Mutable user specified security marks belonging to the parent
  1004  	// resource. Constraints are as follows: * Keys and values are treated
  1005  	// as case insensitive * Keys must be between 1 - 256 characters
  1006  	// (inclusive) * Keys must be letters, numbers, underscores, or dashes *
  1007  	// Values have leading and trailing whitespace trimmed, remaining
  1008  	// characters must be between 1 - 4096 characters (inclusive)
  1009  	Marks map[string]string `json:"marks,omitempty"`
  1010  
  1011  	// Name: The relative resource name of the SecurityMarks. See:
  1012  	// https://cloud.google.com/apis/design/resource_names#relative_resource_name Examples: "organizations/{organization_id}/assets/{asset_id}/securityMarks"
  1013  	// "organizations/{organization_id}/sources/{source_id}/findings/{finding
  1014  	// _id}/securityMarks".
  1015  	Name string `json:"name,omitempty"`
  1016  
  1017  	// ForceSendFields is a list of field names (e.g. "Marks") to
  1018  	// unconditionally include in API requests. By default, fields with
  1019  	// empty values are omitted from API requests. However, any non-pointer,
  1020  	// non-interface field appearing in ForceSendFields will be sent to the
  1021  	// server regardless of whether the field is empty or not. This may be
  1022  	// used to include empty fields in Patch requests.
  1023  	ForceSendFields []string `json:"-"`
  1024  
  1025  	// NullFields is a list of field names (e.g. "Marks") to include in API
  1026  	// requests with the JSON null value. By default, fields with empty
  1027  	// values are omitted from API requests. However, any field with an
  1028  	// empty value appearing in NullFields will be sent to the server as
  1029  	// null. It is an error if a field in this list has a non-empty value.
  1030  	// This may be used to include null fields in Patch requests.
  1031  	NullFields []string `json:"-"`
  1032  }
  1033  
  1034  func (s *SecurityMarks) MarshalJSON() ([]byte, error) {
  1035  	type NoMethod SecurityMarks
  1036  	raw := NoMethod(*s)
  1037  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1038  }
  1039  
  1040  // Status: The `Status` type defines a logical error model that is
  1041  // suitable for different programming environments, including REST APIs
  1042  // and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each
  1043  // `Status` message contains three pieces of data: error code, error
  1044  // message, and error details. You can find out more about this error
  1045  // model and how to work with it in the [API Design
  1046  // Guide](https://cloud.google.com/apis/design/errors).
  1047  type Status struct {
  1048  	// Code: The status code, which should be an enum value of
  1049  	// google.rpc.Code.
  1050  	Code int64 `json:"code,omitempty"`
  1051  
  1052  	// Details: A list of messages that carry the error details. There is a
  1053  	// common set of message types for APIs to use.
  1054  	Details []googleapi.RawMessage `json:"details,omitempty"`
  1055  
  1056  	// Message: A developer-facing error message, which should be in
  1057  	// English. Any user-facing error message should be localized and sent
  1058  	// in the google.rpc.Status.details field, or localized by the client.
  1059  	Message string `json:"message,omitempty"`
  1060  
  1061  	// ForceSendFields is a list of field names (e.g. "Code") to
  1062  	// unconditionally include in API requests. By default, fields with
  1063  	// empty values are omitted from API requests. However, any non-pointer,
  1064  	// non-interface field appearing in ForceSendFields will be sent to the
  1065  	// server regardless of whether the field is empty or not. This may be
  1066  	// used to include empty fields in Patch requests.
  1067  	ForceSendFields []string `json:"-"`
  1068  
  1069  	// NullFields is a list of field names (e.g. "Code") to include in API
  1070  	// requests with the JSON null value. By default, fields with empty
  1071  	// values are omitted from API requests. However, any field with an
  1072  	// empty value appearing in NullFields will be sent to the server as
  1073  	// null. It is an error if a field in this list has a non-empty value.
  1074  	// This may be used to include null fields in Patch requests.
  1075  	NullFields []string `json:"-"`
  1076  }
  1077  
  1078  func (s *Status) MarshalJSON() ([]byte, error) {
  1079  	type NoMethod Status
  1080  	raw := NoMethod(*s)
  1081  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1082  }
  1083  
  1084  // method id "securitycenter.organizations.operations.cancel":
  1085  
  1086  type OrganizationsOperationsCancelCall struct {
  1087  	s          *Service
  1088  	name       string
  1089  	urlParams_ gensupport.URLParams
  1090  	ctx_       context.Context
  1091  	header_    http.Header
  1092  }
  1093  
  1094  // Cancel: Starts asynchronous cancellation on a long-running operation.
  1095  // The server makes a best effort to cancel the operation, but success
  1096  // is not guaranteed. If the server doesn't support this method, it
  1097  // returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use
  1098  // Operations.GetOperation or other methods to check whether the
  1099  // cancellation succeeded or whether the operation completed despite
  1100  // cancellation. On successful cancellation, the operation is not
  1101  // deleted; instead, it becomes an operation with an Operation.error
  1102  // value with a google.rpc.Status.code of 1, corresponding to
  1103  // `Code.CANCELLED`.
  1104  func (r *OrganizationsOperationsService) Cancel(name string) *OrganizationsOperationsCancelCall {
  1105  	c := &OrganizationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1106  	c.name = name
  1107  	return c
  1108  }
  1109  
  1110  // Fields allows partial responses to be retrieved. See
  1111  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1112  // for more information.
  1113  func (c *OrganizationsOperationsCancelCall) Fields(s ...googleapi.Field) *OrganizationsOperationsCancelCall {
  1114  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1115  	return c
  1116  }
  1117  
  1118  // Context sets the context to be used in this call's Do method. Any
  1119  // pending HTTP request will be aborted if the provided context is
  1120  // canceled.
  1121  func (c *OrganizationsOperationsCancelCall) Context(ctx context.Context) *OrganizationsOperationsCancelCall {
  1122  	c.ctx_ = ctx
  1123  	return c
  1124  }
  1125  
  1126  // Header returns an http.Header that can be modified by the caller to
  1127  // add HTTP headers to the request.
  1128  func (c *OrganizationsOperationsCancelCall) Header() http.Header {
  1129  	if c.header_ == nil {
  1130  		c.header_ = make(http.Header)
  1131  	}
  1132  	return c.header_
  1133  }
  1134  
  1135  func (c *OrganizationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
  1136  	reqHeaders := make(http.Header)
  1137  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200825")
  1138  	for k, v := range c.header_ {
  1139  		reqHeaders[k] = v
  1140  	}
  1141  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1142  	var body io.Reader = nil
  1143  	c.urlParams_.Set("alt", alt)
  1144  	c.urlParams_.Set("prettyPrint", "false")
  1145  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1p1alpha1/{+name}:cancel")
  1146  	urls += "?" + c.urlParams_.Encode()
  1147  	req, err := http.NewRequest("POST", urls, body)
  1148  	if err != nil {
  1149  		return nil, err
  1150  	}
  1151  	req.Header = reqHeaders
  1152  	googleapi.Expand(req.URL, map[string]string{
  1153  		"name": c.name,
  1154  	})
  1155  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1156  }
  1157  
  1158  // Do executes the "securitycenter.organizations.operations.cancel" call.
  1159  // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  1160  // code is an error. Response headers are in either
  1161  // *Empty.ServerResponse.Header or (if a response was returned at all)
  1162  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1163  // check whether the returned error was because http.StatusNotModified
  1164  // was returned.
  1165  func (c *OrganizationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  1166  	gensupport.SetOptions(c.urlParams_, opts...)
  1167  	res, err := c.doRequest("json")
  1168  	if res != nil && res.StatusCode == http.StatusNotModified {
  1169  		if res.Body != nil {
  1170  			res.Body.Close()
  1171  		}
  1172  		return nil, &googleapi.Error{
  1173  			Code:   res.StatusCode,
  1174  			Header: res.Header,
  1175  		}
  1176  	}
  1177  	if err != nil {
  1178  		return nil, err
  1179  	}
  1180  	defer googleapi.CloseBody(res)
  1181  	if err := googleapi.CheckResponse(res); err != nil {
  1182  		return nil, err
  1183  	}
  1184  	ret := &Empty{
  1185  		ServerResponse: googleapi.ServerResponse{
  1186  			Header:         res.Header,
  1187  			HTTPStatusCode: res.StatusCode,
  1188  		},
  1189  	}
  1190  	target := &ret
  1191  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1192  		return nil, err
  1193  	}
  1194  	return ret, nil
  1195  	// {
  1196  	//   "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.",
  1197  	//   "flatPath": "v1p1alpha1/organizations/{organizationsId}/operations/{operationsId}:cancel",
  1198  	//   "httpMethod": "POST",
  1199  	//   "id": "securitycenter.organizations.operations.cancel",
  1200  	//   "parameterOrder": [
  1201  	//     "name"
  1202  	//   ],
  1203  	//   "parameters": {
  1204  	//     "name": {
  1205  	//       "description": "The name of the operation resource to be cancelled.",
  1206  	//       "location": "path",
  1207  	//       "pattern": "^organizations/[^/]+/operations/[^/]+$",
  1208  	//       "required": true,
  1209  	//       "type": "string"
  1210  	//     }
  1211  	//   },
  1212  	//   "path": "v1p1alpha1/{+name}:cancel",
  1213  	//   "response": {
  1214  	//     "$ref": "Empty"
  1215  	//   },
  1216  	//   "scopes": [
  1217  	//     "https://www.googleapis.com/auth/cloud-platform"
  1218  	//   ]
  1219  	// }
  1220  
  1221  }
  1222  
  1223  // method id "securitycenter.organizations.operations.delete":
  1224  
  1225  type OrganizationsOperationsDeleteCall struct {
  1226  	s          *Service
  1227  	name       string
  1228  	urlParams_ gensupport.URLParams
  1229  	ctx_       context.Context
  1230  	header_    http.Header
  1231  }
  1232  
  1233  // Delete: Deletes a long-running operation. This method indicates that
  1234  // the client is no longer interested in the operation result. It does
  1235  // not cancel the operation. If the server doesn't support this method,
  1236  // it returns `google.rpc.Code.UNIMPLEMENTED`.
  1237  func (r *OrganizationsOperationsService) Delete(name string) *OrganizationsOperationsDeleteCall {
  1238  	c := &OrganizationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1239  	c.name = name
  1240  	return c
  1241  }
  1242  
  1243  // Fields allows partial responses to be retrieved. See
  1244  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1245  // for more information.
  1246  func (c *OrganizationsOperationsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsOperationsDeleteCall {
  1247  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1248  	return c
  1249  }
  1250  
  1251  // Context sets the context to be used in this call's Do method. Any
  1252  // pending HTTP request will be aborted if the provided context is
  1253  // canceled.
  1254  func (c *OrganizationsOperationsDeleteCall) Context(ctx context.Context) *OrganizationsOperationsDeleteCall {
  1255  	c.ctx_ = ctx
  1256  	return c
  1257  }
  1258  
  1259  // Header returns an http.Header that can be modified by the caller to
  1260  // add HTTP headers to the request.
  1261  func (c *OrganizationsOperationsDeleteCall) Header() http.Header {
  1262  	if c.header_ == nil {
  1263  		c.header_ = make(http.Header)
  1264  	}
  1265  	return c.header_
  1266  }
  1267  
  1268  func (c *OrganizationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1269  	reqHeaders := make(http.Header)
  1270  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200825")
  1271  	for k, v := range c.header_ {
  1272  		reqHeaders[k] = v
  1273  	}
  1274  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1275  	var body io.Reader = nil
  1276  	c.urlParams_.Set("alt", alt)
  1277  	c.urlParams_.Set("prettyPrint", "false")
  1278  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1p1alpha1/{+name}")
  1279  	urls += "?" + c.urlParams_.Encode()
  1280  	req, err := http.NewRequest("DELETE", urls, body)
  1281  	if err != nil {
  1282  		return nil, err
  1283  	}
  1284  	req.Header = reqHeaders
  1285  	googleapi.Expand(req.URL, map[string]string{
  1286  		"name": c.name,
  1287  	})
  1288  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1289  }
  1290  
  1291  // Do executes the "securitycenter.organizations.operations.delete" call.
  1292  // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  1293  // code is an error. Response headers are in either
  1294  // *Empty.ServerResponse.Header or (if a response was returned at all)
  1295  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1296  // check whether the returned error was because http.StatusNotModified
  1297  // was returned.
  1298  func (c *OrganizationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  1299  	gensupport.SetOptions(c.urlParams_, opts...)
  1300  	res, err := c.doRequest("json")
  1301  	if res != nil && res.StatusCode == http.StatusNotModified {
  1302  		if res.Body != nil {
  1303  			res.Body.Close()
  1304  		}
  1305  		return nil, &googleapi.Error{
  1306  			Code:   res.StatusCode,
  1307  			Header: res.Header,
  1308  		}
  1309  	}
  1310  	if err != nil {
  1311  		return nil, err
  1312  	}
  1313  	defer googleapi.CloseBody(res)
  1314  	if err := googleapi.CheckResponse(res); err != nil {
  1315  		return nil, err
  1316  	}
  1317  	ret := &Empty{
  1318  		ServerResponse: googleapi.ServerResponse{
  1319  			Header:         res.Header,
  1320  			HTTPStatusCode: res.StatusCode,
  1321  		},
  1322  	}
  1323  	target := &ret
  1324  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1325  		return nil, err
  1326  	}
  1327  	return ret, nil
  1328  	// {
  1329  	//   "description": "Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.",
  1330  	//   "flatPath": "v1p1alpha1/organizations/{organizationsId}/operations/{operationsId}",
  1331  	//   "httpMethod": "DELETE",
  1332  	//   "id": "securitycenter.organizations.operations.delete",
  1333  	//   "parameterOrder": [
  1334  	//     "name"
  1335  	//   ],
  1336  	//   "parameters": {
  1337  	//     "name": {
  1338  	//       "description": "The name of the operation resource to be deleted.",
  1339  	//       "location": "path",
  1340  	//       "pattern": "^organizations/[^/]+/operations/[^/]+$",
  1341  	//       "required": true,
  1342  	//       "type": "string"
  1343  	//     }
  1344  	//   },
  1345  	//   "path": "v1p1alpha1/{+name}",
  1346  	//   "response": {
  1347  	//     "$ref": "Empty"
  1348  	//   },
  1349  	//   "scopes": [
  1350  	//     "https://www.googleapis.com/auth/cloud-platform"
  1351  	//   ]
  1352  	// }
  1353  
  1354  }
  1355  
  1356  // method id "securitycenter.organizations.operations.get":
  1357  
  1358  type OrganizationsOperationsGetCall struct {
  1359  	s            *Service
  1360  	name         string
  1361  	urlParams_   gensupport.URLParams
  1362  	ifNoneMatch_ string
  1363  	ctx_         context.Context
  1364  	header_      http.Header
  1365  }
  1366  
  1367  // Get: Gets the latest state of a long-running operation. Clients can
  1368  // use this method to poll the operation result at intervals as
  1369  // recommended by the API service.
  1370  func (r *OrganizationsOperationsService) Get(name string) *OrganizationsOperationsGetCall {
  1371  	c := &OrganizationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1372  	c.name = name
  1373  	return c
  1374  }
  1375  
  1376  // Fields allows partial responses to be retrieved. See
  1377  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1378  // for more information.
  1379  func (c *OrganizationsOperationsGetCall) Fields(s ...googleapi.Field) *OrganizationsOperationsGetCall {
  1380  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1381  	return c
  1382  }
  1383  
  1384  // IfNoneMatch sets the optional parameter which makes the operation
  1385  // fail if the object's ETag matches the given value. This is useful for
  1386  // getting updates only after the object has changed since the last
  1387  // request. Use googleapi.IsNotModified to check whether the response
  1388  // error from Do is the result of In-None-Match.
  1389  func (c *OrganizationsOperationsGetCall) IfNoneMatch(entityTag string) *OrganizationsOperationsGetCall {
  1390  	c.ifNoneMatch_ = entityTag
  1391  	return c
  1392  }
  1393  
  1394  // Context sets the context to be used in this call's Do method. Any
  1395  // pending HTTP request will be aborted if the provided context is
  1396  // canceled.
  1397  func (c *OrganizationsOperationsGetCall) Context(ctx context.Context) *OrganizationsOperationsGetCall {
  1398  	c.ctx_ = ctx
  1399  	return c
  1400  }
  1401  
  1402  // Header returns an http.Header that can be modified by the caller to
  1403  // add HTTP headers to the request.
  1404  func (c *OrganizationsOperationsGetCall) Header() http.Header {
  1405  	if c.header_ == nil {
  1406  		c.header_ = make(http.Header)
  1407  	}
  1408  	return c.header_
  1409  }
  1410  
  1411  func (c *OrganizationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  1412  	reqHeaders := make(http.Header)
  1413  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200825")
  1414  	for k, v := range c.header_ {
  1415  		reqHeaders[k] = v
  1416  	}
  1417  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1418  	if c.ifNoneMatch_ != "" {
  1419  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1420  	}
  1421  	var body io.Reader = nil
  1422  	c.urlParams_.Set("alt", alt)
  1423  	c.urlParams_.Set("prettyPrint", "false")
  1424  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1p1alpha1/{+name}")
  1425  	urls += "?" + c.urlParams_.Encode()
  1426  	req, err := http.NewRequest("GET", urls, body)
  1427  	if err != nil {
  1428  		return nil, err
  1429  	}
  1430  	req.Header = reqHeaders
  1431  	googleapi.Expand(req.URL, map[string]string{
  1432  		"name": c.name,
  1433  	})
  1434  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1435  }
  1436  
  1437  // Do executes the "securitycenter.organizations.operations.get" call.
  1438  // Exactly one of *Operation or error will be non-nil. Any non-2xx
  1439  // status code is an error. Response headers are in either
  1440  // *Operation.ServerResponse.Header or (if a response was returned at
  1441  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1442  // to check whether the returned error was because
  1443  // http.StatusNotModified was returned.
  1444  func (c *OrganizationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1445  	gensupport.SetOptions(c.urlParams_, opts...)
  1446  	res, err := c.doRequest("json")
  1447  	if res != nil && res.StatusCode == http.StatusNotModified {
  1448  		if res.Body != nil {
  1449  			res.Body.Close()
  1450  		}
  1451  		return nil, &googleapi.Error{
  1452  			Code:   res.StatusCode,
  1453  			Header: res.Header,
  1454  		}
  1455  	}
  1456  	if err != nil {
  1457  		return nil, err
  1458  	}
  1459  	defer googleapi.CloseBody(res)
  1460  	if err := googleapi.CheckResponse(res); err != nil {
  1461  		return nil, err
  1462  	}
  1463  	ret := &Operation{
  1464  		ServerResponse: googleapi.ServerResponse{
  1465  			Header:         res.Header,
  1466  			HTTPStatusCode: res.StatusCode,
  1467  		},
  1468  	}
  1469  	target := &ret
  1470  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1471  		return nil, err
  1472  	}
  1473  	return ret, nil
  1474  	// {
  1475  	//   "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.",
  1476  	//   "flatPath": "v1p1alpha1/organizations/{organizationsId}/operations/{operationsId}",
  1477  	//   "httpMethod": "GET",
  1478  	//   "id": "securitycenter.organizations.operations.get",
  1479  	//   "parameterOrder": [
  1480  	//     "name"
  1481  	//   ],
  1482  	//   "parameters": {
  1483  	//     "name": {
  1484  	//       "description": "The name of the operation resource.",
  1485  	//       "location": "path",
  1486  	//       "pattern": "^organizations/[^/]+/operations/[^/]+$",
  1487  	//       "required": true,
  1488  	//       "type": "string"
  1489  	//     }
  1490  	//   },
  1491  	//   "path": "v1p1alpha1/{+name}",
  1492  	//   "response": {
  1493  	//     "$ref": "Operation"
  1494  	//   },
  1495  	//   "scopes": [
  1496  	//     "https://www.googleapis.com/auth/cloud-platform"
  1497  	//   ]
  1498  	// }
  1499  
  1500  }
  1501  
  1502  // method id "securitycenter.organizations.operations.list":
  1503  
  1504  type OrganizationsOperationsListCall struct {
  1505  	s            *Service
  1506  	name         string
  1507  	urlParams_   gensupport.URLParams
  1508  	ifNoneMatch_ string
  1509  	ctx_         context.Context
  1510  	header_      http.Header
  1511  }
  1512  
  1513  // List: Lists operations that match the specified filter in the
  1514  // request. If the server doesn't support this method, it returns
  1515  // `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to
  1516  // override the binding to use different resource name schemes, such as
  1517  // `users/*/operations`. To override the binding, API services can add a
  1518  // binding such as "/v1/{name=users/*}/operations" to their service
  1519  // configuration. For backwards compatibility, the default name includes
  1520  // the operations collection id, however overriding users must ensure
  1521  // the name binding is the parent resource, without the operations
  1522  // collection id.
  1523  func (r *OrganizationsOperationsService) List(name string) *OrganizationsOperationsListCall {
  1524  	c := &OrganizationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1525  	c.name = name
  1526  	return c
  1527  }
  1528  
  1529  // Filter sets the optional parameter "filter": The standard list
  1530  // filter.
  1531  func (c *OrganizationsOperationsListCall) Filter(filter string) *OrganizationsOperationsListCall {
  1532  	c.urlParams_.Set("filter", filter)
  1533  	return c
  1534  }
  1535  
  1536  // PageSize sets the optional parameter "pageSize": The standard list
  1537  // page size.
  1538  func (c *OrganizationsOperationsListCall) PageSize(pageSize int64) *OrganizationsOperationsListCall {
  1539  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1540  	return c
  1541  }
  1542  
  1543  // PageToken sets the optional parameter "pageToken": The standard list
  1544  // page token.
  1545  func (c *OrganizationsOperationsListCall) PageToken(pageToken string) *OrganizationsOperationsListCall {
  1546  	c.urlParams_.Set("pageToken", pageToken)
  1547  	return c
  1548  }
  1549  
  1550  // Fields allows partial responses to be retrieved. See
  1551  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1552  // for more information.
  1553  func (c *OrganizationsOperationsListCall) Fields(s ...googleapi.Field) *OrganizationsOperationsListCall {
  1554  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1555  	return c
  1556  }
  1557  
  1558  // IfNoneMatch sets the optional parameter which makes the operation
  1559  // fail if the object's ETag matches the given value. This is useful for
  1560  // getting updates only after the object has changed since the last
  1561  // request. Use googleapi.IsNotModified to check whether the response
  1562  // error from Do is the result of In-None-Match.
  1563  func (c *OrganizationsOperationsListCall) IfNoneMatch(entityTag string) *OrganizationsOperationsListCall {
  1564  	c.ifNoneMatch_ = entityTag
  1565  	return c
  1566  }
  1567  
  1568  // Context sets the context to be used in this call's Do method. Any
  1569  // pending HTTP request will be aborted if the provided context is
  1570  // canceled.
  1571  func (c *OrganizationsOperationsListCall) Context(ctx context.Context) *OrganizationsOperationsListCall {
  1572  	c.ctx_ = ctx
  1573  	return c
  1574  }
  1575  
  1576  // Header returns an http.Header that can be modified by the caller to
  1577  // add HTTP headers to the request.
  1578  func (c *OrganizationsOperationsListCall) Header() http.Header {
  1579  	if c.header_ == nil {
  1580  		c.header_ = make(http.Header)
  1581  	}
  1582  	return c.header_
  1583  }
  1584  
  1585  func (c *OrganizationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
  1586  	reqHeaders := make(http.Header)
  1587  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200825")
  1588  	for k, v := range c.header_ {
  1589  		reqHeaders[k] = v
  1590  	}
  1591  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1592  	if c.ifNoneMatch_ != "" {
  1593  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1594  	}
  1595  	var body io.Reader = nil
  1596  	c.urlParams_.Set("alt", alt)
  1597  	c.urlParams_.Set("prettyPrint", "false")
  1598  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1p1alpha1/{+name}")
  1599  	urls += "?" + c.urlParams_.Encode()
  1600  	req, err := http.NewRequest("GET", urls, body)
  1601  	if err != nil {
  1602  		return nil, err
  1603  	}
  1604  	req.Header = reqHeaders
  1605  	googleapi.Expand(req.URL, map[string]string{
  1606  		"name": c.name,
  1607  	})
  1608  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1609  }
  1610  
  1611  // Do executes the "securitycenter.organizations.operations.list" call.
  1612  // Exactly one of *ListOperationsResponse or error will be non-nil. Any
  1613  // non-2xx status code is an error. Response headers are in either
  1614  // *ListOperationsResponse.ServerResponse.Header or (if a response was
  1615  // returned at all) in error.(*googleapi.Error).Header. Use
  1616  // googleapi.IsNotModified to check whether the returned error was
  1617  // because http.StatusNotModified was returned.
  1618  func (c *OrganizationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  1619  	gensupport.SetOptions(c.urlParams_, opts...)
  1620  	res, err := c.doRequest("json")
  1621  	if res != nil && res.StatusCode == http.StatusNotModified {
  1622  		if res.Body != nil {
  1623  			res.Body.Close()
  1624  		}
  1625  		return nil, &googleapi.Error{
  1626  			Code:   res.StatusCode,
  1627  			Header: res.Header,
  1628  		}
  1629  	}
  1630  	if err != nil {
  1631  		return nil, err
  1632  	}
  1633  	defer googleapi.CloseBody(res)
  1634  	if err := googleapi.CheckResponse(res); err != nil {
  1635  		return nil, err
  1636  	}
  1637  	ret := &ListOperationsResponse{
  1638  		ServerResponse: googleapi.ServerResponse{
  1639  			Header:         res.Header,
  1640  			HTTPStatusCode: res.StatusCode,
  1641  		},
  1642  	}
  1643  	target := &ret
  1644  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1645  		return nil, err
  1646  	}
  1647  	return ret, nil
  1648  	// {
  1649  	//   "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as `\"/v1/{name=users/*}/operations\"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.",
  1650  	//   "flatPath": "v1p1alpha1/organizations/{organizationsId}/operations",
  1651  	//   "httpMethod": "GET",
  1652  	//   "id": "securitycenter.organizations.operations.list",
  1653  	//   "parameterOrder": [
  1654  	//     "name"
  1655  	//   ],
  1656  	//   "parameters": {
  1657  	//     "filter": {
  1658  	//       "description": "The standard list filter.",
  1659  	//       "location": "query",
  1660  	//       "type": "string"
  1661  	//     },
  1662  	//     "name": {
  1663  	//       "description": "The name of the operation's parent resource.",
  1664  	//       "location": "path",
  1665  	//       "pattern": "^organizations/[^/]+/operations$",
  1666  	//       "required": true,
  1667  	//       "type": "string"
  1668  	//     },
  1669  	//     "pageSize": {
  1670  	//       "description": "The standard list page size.",
  1671  	//       "format": "int32",
  1672  	//       "location": "query",
  1673  	//       "type": "integer"
  1674  	//     },
  1675  	//     "pageToken": {
  1676  	//       "description": "The standard list page token.",
  1677  	//       "location": "query",
  1678  	//       "type": "string"
  1679  	//     }
  1680  	//   },
  1681  	//   "path": "v1p1alpha1/{+name}",
  1682  	//   "response": {
  1683  	//     "$ref": "ListOperationsResponse"
  1684  	//   },
  1685  	//   "scopes": [
  1686  	//     "https://www.googleapis.com/auth/cloud-platform"
  1687  	//   ]
  1688  	// }
  1689  
  1690  }
  1691  
  1692  // Pages invokes f for each page of results.
  1693  // A non-nil error returned from f will halt the iteration.
  1694  // The provided context supersedes any context provided to the Context method.
  1695  func (c *OrganizationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
  1696  	c.ctx_ = ctx
  1697  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1698  	for {
  1699  		x, err := c.Do()
  1700  		if err != nil {
  1701  			return err
  1702  		}
  1703  		if err := f(x); err != nil {
  1704  			return err
  1705  		}
  1706  		if x.NextPageToken == "" {
  1707  			return nil
  1708  		}
  1709  		c.PageToken(x.NextPageToken)
  1710  	}
  1711  }
  1712  

View as plain text