...

Source file src/google.golang.org/api/eventarc/v1beta1/eventarc-gen.go

Documentation: google.golang.org/api/eventarc/v1beta1

     1  // Copyright 2024 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 eventarc provides access to the Eventarc API.
     8  //
     9  // For product documentation, see: https://cloud.google.com/eventarc
    10  //
    11  // # Library status
    12  //
    13  // These client libraries are officially supported by Google. However, this
    14  // library is considered complete and is in maintenance mode. This means
    15  // that we will address critical bugs and security issues but will not add
    16  // any new features.
    17  //
    18  // When possible, we recommend using our newer
    19  // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
    20  // that are still actively being worked and iterated on.
    21  //
    22  // # Creating a client
    23  //
    24  // Usage example:
    25  //
    26  //	import "google.golang.org/api/eventarc/v1beta1"
    27  //	...
    28  //	ctx := context.Background()
    29  //	eventarcService, err := eventarc.NewService(ctx)
    30  //
    31  // In this example, Google Application Default Credentials are used for
    32  // authentication. For information on how to create and obtain Application
    33  // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
    34  //
    35  // # Other authentication options
    36  //
    37  // To use an API key for authentication (note: some APIs do not support API
    38  // keys), use [google.golang.org/api/option.WithAPIKey]:
    39  //
    40  //	eventarcService, err := eventarc.NewService(ctx, option.WithAPIKey("AIza..."))
    41  //
    42  // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
    43  // flow, use [google.golang.org/api/option.WithTokenSource]:
    44  //
    45  //	config := &oauth2.Config{...}
    46  //	// ...
    47  //	token, err := config.Exchange(ctx, ...)
    48  //	eventarcService, err := eventarc.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    49  //
    50  // See [google.golang.org/api/option.ClientOption] for details on options.
    51  package eventarc // import "google.golang.org/api/eventarc/v1beta1"
    52  
    53  import (
    54  	"bytes"
    55  	"context"
    56  	"encoding/json"
    57  	"errors"
    58  	"fmt"
    59  	"io"
    60  	"net/http"
    61  	"net/url"
    62  	"strconv"
    63  	"strings"
    64  
    65  	googleapi "google.golang.org/api/googleapi"
    66  	internal "google.golang.org/api/internal"
    67  	gensupport "google.golang.org/api/internal/gensupport"
    68  	option "google.golang.org/api/option"
    69  	internaloption "google.golang.org/api/option/internaloption"
    70  	htransport "google.golang.org/api/transport/http"
    71  )
    72  
    73  // Always reference these packages, just in case the auto-generated code
    74  // below doesn't.
    75  var _ = bytes.NewBuffer
    76  var _ = strconv.Itoa
    77  var _ = fmt.Sprintf
    78  var _ = json.NewDecoder
    79  var _ = io.Copy
    80  var _ = url.Parse
    81  var _ = gensupport.MarshalJSON
    82  var _ = googleapi.Version
    83  var _ = errors.New
    84  var _ = strings.Replace
    85  var _ = context.Canceled
    86  var _ = internaloption.WithDefaultEndpoint
    87  var _ = internal.Version
    88  
    89  const apiId = "eventarc:v1beta1"
    90  const apiName = "eventarc"
    91  const apiVersion = "v1beta1"
    92  const basePath = "https://eventarc.googleapis.com/"
    93  const basePathTemplate = "https://eventarc.UNIVERSE_DOMAIN/"
    94  const mtlsBasePath = "https://eventarc.mtls.googleapis.com/"
    95  
    96  // OAuth2 scopes used by this API.
    97  const (
    98  	// See, edit, configure, and delete your Google Cloud data and see the email
    99  	// address for your Google Account.
   100  	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
   101  )
   102  
   103  // NewService creates a new Service.
   104  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
   105  	scopesOption := internaloption.WithDefaultScopes(
   106  		"https://www.googleapis.com/auth/cloud-platform",
   107  	)
   108  	// NOTE: prepend, so we don't override user-specified scopes.
   109  	opts = append([]option.ClientOption{scopesOption}, opts...)
   110  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
   111  	opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
   112  	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
   113  	opts = append(opts, internaloption.EnableNewAuthLibrary())
   114  	client, endpoint, err := htransport.NewClient(ctx, opts...)
   115  	if err != nil {
   116  		return nil, err
   117  	}
   118  	s, err := New(client)
   119  	if err != nil {
   120  		return nil, err
   121  	}
   122  	if endpoint != "" {
   123  		s.BasePath = endpoint
   124  	}
   125  	return s, nil
   126  }
   127  
   128  // New creates a new Service. It uses the provided http.Client for requests.
   129  //
   130  // Deprecated: please use NewService instead.
   131  // To provide a custom HTTP client, use option.WithHTTPClient.
   132  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   133  func New(client *http.Client) (*Service, error) {
   134  	if client == nil {
   135  		return nil, errors.New("client is nil")
   136  	}
   137  	s := &Service{client: client, BasePath: basePath}
   138  	s.Projects = NewProjectsService(s)
   139  	return s, nil
   140  }
   141  
   142  type Service struct {
   143  	client    *http.Client
   144  	BasePath  string // API endpoint base URL
   145  	UserAgent string // optional additional User-Agent fragment
   146  
   147  	Projects *ProjectsService
   148  }
   149  
   150  func (s *Service) userAgent() string {
   151  	if s.UserAgent == "" {
   152  		return googleapi.UserAgent
   153  	}
   154  	return googleapi.UserAgent + " " + s.UserAgent
   155  }
   156  
   157  func NewProjectsService(s *Service) *ProjectsService {
   158  	rs := &ProjectsService{s: s}
   159  	rs.Locations = NewProjectsLocationsService(s)
   160  	return rs
   161  }
   162  
   163  type ProjectsService struct {
   164  	s *Service
   165  
   166  	Locations *ProjectsLocationsService
   167  }
   168  
   169  func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
   170  	rs := &ProjectsLocationsService{s: s}
   171  	rs.Operations = NewProjectsLocationsOperationsService(s)
   172  	rs.Triggers = NewProjectsLocationsTriggersService(s)
   173  	return rs
   174  }
   175  
   176  type ProjectsLocationsService struct {
   177  	s *Service
   178  
   179  	Operations *ProjectsLocationsOperationsService
   180  
   181  	Triggers *ProjectsLocationsTriggersService
   182  }
   183  
   184  func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
   185  	rs := &ProjectsLocationsOperationsService{s: s}
   186  	return rs
   187  }
   188  
   189  type ProjectsLocationsOperationsService struct {
   190  	s *Service
   191  }
   192  
   193  func NewProjectsLocationsTriggersService(s *Service) *ProjectsLocationsTriggersService {
   194  	rs := &ProjectsLocationsTriggersService{s: s}
   195  	return rs
   196  }
   197  
   198  type ProjectsLocationsTriggersService struct {
   199  	s *Service
   200  }
   201  
   202  // AuditConfig: Specifies the audit configuration for a service. The
   203  // configuration determines which permission types are logged, and what
   204  // identities, if any, are exempted from logging. An AuditConfig must have one
   205  // or more AuditLogConfigs. If there are AuditConfigs for both `allServices`
   206  // and a specific service, the union of the two AuditConfigs is used for that
   207  // service: the log_types specified in each AuditConfig are enabled, and the
   208  // exempted_members in each AuditLogConfig are exempted. Example Policy with
   209  // multiple AuditConfigs: { "audit_configs": [ { "service": "allServices",
   210  // "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [
   211  // "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { "log_type":
   212  // "ADMIN_READ" } ] }, { "service": "sampleservice.googleapis.com",
   213  // "audit_log_configs": [ { "log_type": "DATA_READ" }, { "log_type":
   214  // "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] } For
   215  // sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ
   216  // logging. It also exempts `jose@example.com` from DATA_READ logging, and
   217  // `aliya@example.com` from DATA_WRITE logging.
   218  type AuditConfig struct {
   219  	// AuditLogConfigs: The configuration for logging of each type of permission.
   220  	AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
   221  	// Service: Specifies a service that will be enabled for audit logging. For
   222  	// example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices`
   223  	// is a special value that covers all services.
   224  	Service string `json:"service,omitempty"`
   225  	// ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to
   226  	// unconditionally include in API requests. By default, fields with empty or
   227  	// default values are omitted from API requests. See
   228  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   229  	// details.
   230  	ForceSendFields []string `json:"-"`
   231  	// NullFields is a list of field names (e.g. "AuditLogConfigs") to include in
   232  	// API requests with the JSON null value. By default, fields with empty values
   233  	// are omitted from API requests. See
   234  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   235  	NullFields []string `json:"-"`
   236  }
   237  
   238  func (s *AuditConfig) MarshalJSON() ([]byte, error) {
   239  	type NoMethod AuditConfig
   240  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   241  }
   242  
   243  // AuditLogConfig: Provides the configuration for logging a type of
   244  // permissions. Example: { "audit_log_configs": [ { "log_type": "DATA_READ",
   245  // "exempted_members": [ "user:jose@example.com" ] }, { "log_type":
   246  // "DATA_WRITE" } ] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while
   247  // exempting jose@example.com from DATA_READ logging.
   248  type AuditLogConfig struct {
   249  	// ExemptedMembers: Specifies the identities that do not cause logging for this
   250  	// type of permission. Follows the same format of Binding.members.
   251  	ExemptedMembers []string `json:"exemptedMembers,omitempty"`
   252  	// LogType: The log type that this config enables.
   253  	//
   254  	// Possible values:
   255  	//   "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this.
   256  	//   "ADMIN_READ" - Admin reads. Example: CloudIAM getIamPolicy
   257  	//   "DATA_WRITE" - Data writes. Example: CloudSQL Users create
   258  	//   "DATA_READ" - Data reads. Example: CloudSQL Users list
   259  	LogType string `json:"logType,omitempty"`
   260  	// ForceSendFields is a list of field names (e.g. "ExemptedMembers") to
   261  	// unconditionally include in API requests. By default, fields with empty or
   262  	// default values are omitted from API requests. See
   263  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   264  	// details.
   265  	ForceSendFields []string `json:"-"`
   266  	// NullFields is a list of field names (e.g. "ExemptedMembers") to include in
   267  	// API requests with the JSON null value. By default, fields with empty values
   268  	// are omitted from API requests. See
   269  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   270  	NullFields []string `json:"-"`
   271  }
   272  
   273  func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
   274  	type NoMethod AuditLogConfig
   275  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   276  }
   277  
   278  // Binding: Associates `members`, or principals, with a `role`.
   279  type Binding struct {
   280  	// Condition: The condition that is associated with this binding. If the
   281  	// condition evaluates to `true`, then this binding applies to the current
   282  	// request. If the condition evaluates to `false`, then this binding does not
   283  	// apply to the current request. However, a different role binding might grant
   284  	// the same role to one or more of the principals in this binding. To learn
   285  	// which resources support conditions in their IAM policies, see the IAM
   286  	// documentation
   287  	// (https://cloud.google.com/iam/help/conditions/resource-policies).
   288  	Condition *Expr `json:"condition,omitempty"`
   289  	// Members: Specifies the principals requesting access for a Google Cloud
   290  	// resource. `members` can have the following values: * `allUsers`: A special
   291  	// identifier that represents anyone who is on the internet; with or without a
   292  	// Google account. * `allAuthenticatedUsers`: A special identifier that
   293  	// represents anyone who is authenticated with a Google account or a service
   294  	// account. Does not include identities that come from external identity
   295  	// providers (IdPs) through identity federation. * `user:{emailid}`: An email
   296  	// address that represents a specific Google account. For example,
   297  	// `alice@example.com` . * `serviceAccount:{emailid}`: An email address that
   298  	// represents a Google service account. For example,
   299  	// `my-other-app@appspot.gserviceaccount.com`. *
   300  	// `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An
   301  	// identifier for a Kubernetes service account
   302  	// (https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts).
   303  	// For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. *
   304  	// `group:{emailid}`: An email address that represents a Google group. For
   305  	// example, `admins@example.com`. * `domain:{domain}`: The G Suite domain
   306  	// (primary) that represents all the users of that domain. For example,
   307  	// `google.com` or `example.com`. *
   308  	// `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/sub
   309  	// ject/{subject_attribute_value}`: A single identity in a workforce identity
   310  	// pool. *
   311  	// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
   312  	// group/{group_id}`: All workforce identities in a group. *
   313  	// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
   314  	// attribute.{attribute_name}/{attribute_value}`: All workforce identities with
   315  	// a specific attribute value. *
   316  	// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
   317  	// *`: All identities in a workforce identity pool. *
   318  	// `principal://iam.googleapis.com/projects/{project_number}/locations/global/wo
   319  	// rkloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: A single
   320  	// identity in a workload identity pool. *
   321  	// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
   322  	// /workloadIdentityPools/{pool_id}/group/{group_id}`: A workload identity pool
   323  	// group. *
   324  	// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
   325  	// /workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}
   326  	// `: All identities in a workload identity pool with a certain attribute. *
   327  	// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
   328  	// /workloadIdentityPools/{pool_id}/*`: All identities in a workload identity
   329  	// pool. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus
   330  	// unique identifier) representing a user that has been recently deleted. For
   331  	// example, `alice@example.com?uid=123456789012345678901`. If the user is
   332  	// recovered, this value reverts to `user:{emailid}` and the recovered user
   333  	// retains the role in the binding. *
   334  	// `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
   335  	// unique identifier) representing a service account that has been recently
   336  	// deleted. For example,
   337  	// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the
   338  	// service account is undeleted, this value reverts to
   339  	// `serviceAccount:{emailid}` and the undeleted service account retains the
   340  	// role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email
   341  	// address (plus unique identifier) representing a Google group that has been
   342  	// recently deleted. For example,
   343  	// `admins@example.com?uid=123456789012345678901`. If the group is recovered,
   344  	// this value reverts to `group:{emailid}` and the recovered group retains the
   345  	// role in the binding. *
   346  	// `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool
   347  	// _id}/subject/{subject_attribute_value}`: Deleted single identity in a
   348  	// workforce identity pool. For example,
   349  	// `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-po
   350  	// ol-id/subject/my-subject-attribute-value`.
   351  	Members []string `json:"members,omitempty"`
   352  	// Role: Role that is assigned to the list of `members`, or principals. For
   353  	// example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview
   354  	// of the IAM roles and permissions, see the IAM documentation
   355  	// (https://cloud.google.com/iam/docs/roles-overview). For a list of the
   356  	// available pre-defined roles, see here
   357  	// (https://cloud.google.com/iam/docs/understanding-roles).
   358  	Role string `json:"role,omitempty"`
   359  	// ForceSendFields is a list of field names (e.g. "Condition") to
   360  	// unconditionally include in API requests. By default, fields with empty or
   361  	// default values are omitted from API requests. See
   362  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   363  	// details.
   364  	ForceSendFields []string `json:"-"`
   365  	// NullFields is a list of field names (e.g. "Condition") to include in API
   366  	// requests with the JSON null value. By default, fields with empty values are
   367  	// omitted from API requests. See
   368  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   369  	NullFields []string `json:"-"`
   370  }
   371  
   372  func (s *Binding) MarshalJSON() ([]byte, error) {
   373  	type NoMethod Binding
   374  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   375  }
   376  
   377  // CancelOperationRequest: The request message for Operations.CancelOperation.
   378  type CancelOperationRequest struct {
   379  }
   380  
   381  // CloudRunService: Represents a Cloud Run service destination.
   382  type CloudRunService struct {
   383  	// Path: Optional. The relative path on the Cloud Run service the events should
   384  	// be sent to. The value must conform to the definition of URI path segment
   385  	// (section 3.3 of RFC2396). Examples: "/route", "route", "route/subroute".
   386  	Path string `json:"path,omitempty"`
   387  	// Region: Required. The region the Cloud Run service is deployed in.
   388  	Region string `json:"region,omitempty"`
   389  	// Service: Required. The name of the Cloud run service being addressed. See
   390  	// https://cloud.google.com/run/docs/reference/rest/v1/namespaces.services.
   391  	// Only services located in the same project of the trigger object can be
   392  	// addressed.
   393  	Service string `json:"service,omitempty"`
   394  	// ForceSendFields is a list of field names (e.g. "Path") to unconditionally
   395  	// include in API requests. By default, fields with empty or default values are
   396  	// omitted from API requests. See
   397  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   398  	// details.
   399  	ForceSendFields []string `json:"-"`
   400  	// NullFields is a list of field names (e.g. "Path") to include in API requests
   401  	// with the JSON null value. By default, fields with empty values are omitted
   402  	// from API requests. See
   403  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   404  	NullFields []string `json:"-"`
   405  }
   406  
   407  func (s *CloudRunService) MarshalJSON() ([]byte, error) {
   408  	type NoMethod CloudRunService
   409  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   410  }
   411  
   412  // Destination: Represents a target of an invocation over HTTP.
   413  type Destination struct {
   414  	// CloudRunService: Cloud Run fully-managed service that receives the events.
   415  	// The service should be running in the same project as the trigger.
   416  	CloudRunService *CloudRunService `json:"cloudRunService,omitempty"`
   417  	// ForceSendFields is a list of field names (e.g. "CloudRunService") to
   418  	// unconditionally include in API requests. By default, fields with empty or
   419  	// default values are omitted from API requests. See
   420  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   421  	// details.
   422  	ForceSendFields []string `json:"-"`
   423  	// NullFields is a list of field names (e.g. "CloudRunService") to include in
   424  	// API requests with the JSON null value. By default, fields with empty values
   425  	// are omitted from API requests. See
   426  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   427  	NullFields []string `json:"-"`
   428  }
   429  
   430  func (s *Destination) MarshalJSON() ([]byte, error) {
   431  	type NoMethod Destination
   432  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   433  }
   434  
   435  // Empty: A generic empty message that you can re-use to avoid defining
   436  // duplicated empty messages in your APIs. A typical example is to use it as
   437  // the request or the response type of an API method. For instance: service Foo
   438  // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
   439  type Empty struct {
   440  	// ServerResponse contains the HTTP response code and headers from the server.
   441  	googleapi.ServerResponse `json:"-"`
   442  }
   443  
   444  // Expr: Represents a textual expression in the Common Expression Language
   445  // (CEL) syntax. CEL is a C-like expression language. The syntax and semantics
   446  // of CEL are documented at https://github.com/google/cel-spec. Example
   447  // (Comparison): title: "Summary size limit" description: "Determines if a
   448  // summary is less than 100 chars" expression: "document.summary.size() < 100"
   449  // Example (Equality): title: "Requestor is owner" description: "Determines if
   450  // requestor is the document owner" expression: "document.owner ==
   451  // request.auth.claims.email" Example (Logic): title: "Public documents"
   452  // description: "Determine whether the document should be publicly visible"
   453  // expression: "document.type != 'private' && document.type != 'internal'"
   454  // Example (Data Manipulation): title: "Notification string" description:
   455  // "Create a notification string with a timestamp." expression: "'New message
   456  // received at ' + string(document.create_time)" The exact variables and
   457  // functions that may be referenced within an expression are determined by the
   458  // service that evaluates it. See the service documentation for additional
   459  // information.
   460  type Expr struct {
   461  	// Description: Optional. Description of the expression. This is a longer text
   462  	// which describes the expression, e.g. when hovered over it in a UI.
   463  	Description string `json:"description,omitempty"`
   464  	// Expression: Textual representation of an expression in Common Expression
   465  	// Language syntax.
   466  	Expression string `json:"expression,omitempty"`
   467  	// Location: Optional. String indicating the location of the expression for
   468  	// error reporting, e.g. a file name and a position in the file.
   469  	Location string `json:"location,omitempty"`
   470  	// Title: Optional. Title for the expression, i.e. a short string describing
   471  	// its purpose. This can be used e.g. in UIs which allow to enter the
   472  	// expression.
   473  	Title string `json:"title,omitempty"`
   474  	// ForceSendFields is a list of field names (e.g. "Description") to
   475  	// unconditionally include in API requests. By default, fields with empty or
   476  	// default values are omitted from API requests. See
   477  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   478  	// details.
   479  	ForceSendFields []string `json:"-"`
   480  	// NullFields is a list of field names (e.g. "Description") to include in API
   481  	// requests with the JSON null value. By default, fields with empty values are
   482  	// omitted from API requests. See
   483  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   484  	NullFields []string `json:"-"`
   485  }
   486  
   487  func (s *Expr) MarshalJSON() ([]byte, error) {
   488  	type NoMethod Expr
   489  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   490  }
   491  
   492  // ListLocationsResponse: The response message for Locations.ListLocations.
   493  type ListLocationsResponse struct {
   494  	// Locations: A list of locations that matches the specified filter in the
   495  	// request.
   496  	Locations []*Location `json:"locations,omitempty"`
   497  	// NextPageToken: The standard List next-page token.
   498  	NextPageToken string `json:"nextPageToken,omitempty"`
   499  
   500  	// ServerResponse contains the HTTP response code and headers from the server.
   501  	googleapi.ServerResponse `json:"-"`
   502  	// ForceSendFields is a list of field names (e.g. "Locations") to
   503  	// unconditionally include in API requests. By default, fields with empty or
   504  	// default values are omitted from API requests. See
   505  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   506  	// details.
   507  	ForceSendFields []string `json:"-"`
   508  	// NullFields is a list of field names (e.g. "Locations") to include in API
   509  	// requests with the JSON null value. By default, fields with empty values are
   510  	// omitted from API requests. See
   511  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   512  	NullFields []string `json:"-"`
   513  }
   514  
   515  func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
   516  	type NoMethod ListLocationsResponse
   517  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   518  }
   519  
   520  // ListOperationsResponse: The response message for Operations.ListOperations.
   521  type ListOperationsResponse struct {
   522  	// NextPageToken: The standard List next-page token.
   523  	NextPageToken string `json:"nextPageToken,omitempty"`
   524  	// Operations: A list of operations that matches the specified filter in the
   525  	// request.
   526  	Operations []*Operation `json:"operations,omitempty"`
   527  
   528  	// ServerResponse contains the HTTP response code and headers from the server.
   529  	googleapi.ServerResponse `json:"-"`
   530  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   531  	// unconditionally include in API requests. By default, fields with empty or
   532  	// default values are omitted from API requests. See
   533  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   534  	// details.
   535  	ForceSendFields []string `json:"-"`
   536  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   537  	// requests with the JSON null value. By default, fields with empty values are
   538  	// omitted from API requests. See
   539  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   540  	NullFields []string `json:"-"`
   541  }
   542  
   543  func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
   544  	type NoMethod ListOperationsResponse
   545  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   546  }
   547  
   548  // ListTriggersResponse: The response message for the ListTriggers method.
   549  type ListTriggersResponse struct {
   550  	// NextPageToken: A page token that can be sent to ListTriggers to request the
   551  	// next page. If this is empty, then there are no more pages.
   552  	NextPageToken string `json:"nextPageToken,omitempty"`
   553  	// Triggers: The requested triggers, up to the number specified in `page_size`.
   554  	Triggers []*Trigger `json:"triggers,omitempty"`
   555  	// Unreachable: Unreachable resources, if any.
   556  	Unreachable []string `json:"unreachable,omitempty"`
   557  
   558  	// ServerResponse contains the HTTP response code and headers from the server.
   559  	googleapi.ServerResponse `json:"-"`
   560  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   561  	// unconditionally include in API requests. By default, fields with empty or
   562  	// default values are omitted from API requests. See
   563  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   564  	// details.
   565  	ForceSendFields []string `json:"-"`
   566  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   567  	// requests with the JSON null value. By default, fields with empty values are
   568  	// omitted from API requests. See
   569  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   570  	NullFields []string `json:"-"`
   571  }
   572  
   573  func (s *ListTriggersResponse) MarshalJSON() ([]byte, error) {
   574  	type NoMethod ListTriggersResponse
   575  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   576  }
   577  
   578  // Location: A resource that represents a Google Cloud location.
   579  type Location struct {
   580  	// DisplayName: The friendly name for this location, typically a nearby city
   581  	// name. For example, "Tokyo".
   582  	DisplayName string `json:"displayName,omitempty"`
   583  	// Labels: Cross-service attributes for the location. For example
   584  	// {"cloud.googleapis.com/region": "us-east1"}
   585  	Labels map[string]string `json:"labels,omitempty"`
   586  	// LocationId: The canonical id for this location. For example: "us-east1".
   587  	LocationId string `json:"locationId,omitempty"`
   588  	// Metadata: Service-specific metadata. For example the available capacity at
   589  	// the given location.
   590  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
   591  	// Name: Resource name for the location, which may vary between
   592  	// implementations. For example:
   593  	// "projects/example-project/locations/us-east1"
   594  	Name string `json:"name,omitempty"`
   595  
   596  	// ServerResponse contains the HTTP response code and headers from the server.
   597  	googleapi.ServerResponse `json:"-"`
   598  	// ForceSendFields is a list of field names (e.g. "DisplayName") to
   599  	// unconditionally include in API requests. By default, fields with empty or
   600  	// default values are omitted from API requests. See
   601  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   602  	// details.
   603  	ForceSendFields []string `json:"-"`
   604  	// NullFields is a list of field names (e.g. "DisplayName") to include in API
   605  	// requests with the JSON null value. By default, fields with empty values are
   606  	// omitted from API requests. See
   607  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   608  	NullFields []string `json:"-"`
   609  }
   610  
   611  func (s *Location) MarshalJSON() ([]byte, error) {
   612  	type NoMethod Location
   613  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   614  }
   615  
   616  // MatchingCriteria: Matches events based on exact matches on the CloudEvents
   617  // attributes.
   618  type MatchingCriteria struct {
   619  	// Attribute: Required. The name of a CloudEvents attribute. Currently, only a
   620  	// subset of attributes can be specified. All triggers MUST provide a matching
   621  	// criteria for the 'type' attribute.
   622  	Attribute string `json:"attribute,omitempty"`
   623  	// Value: Required. The value for the attribute.
   624  	Value string `json:"value,omitempty"`
   625  	// ForceSendFields is a list of field names (e.g. "Attribute") to
   626  	// unconditionally include in API requests. By default, fields with empty or
   627  	// default values are omitted from API requests. See
   628  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   629  	// details.
   630  	ForceSendFields []string `json:"-"`
   631  	// NullFields is a list of field names (e.g. "Attribute") to include in API
   632  	// requests with the JSON null value. By default, fields with empty values are
   633  	// omitted from API requests. See
   634  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   635  	NullFields []string `json:"-"`
   636  }
   637  
   638  func (s *MatchingCriteria) MarshalJSON() ([]byte, error) {
   639  	type NoMethod MatchingCriteria
   640  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   641  }
   642  
   643  // Operation: This resource represents a long-running operation that is the
   644  // result of a network API call.
   645  type Operation struct {
   646  	// Done: If the value is `false`, it means the operation is still in progress.
   647  	// If `true`, the operation is completed, and either `error` or `response` is
   648  	// available.
   649  	Done bool `json:"done,omitempty"`
   650  	// Error: The error result of the operation in case of failure or cancellation.
   651  	Error *Status `json:"error,omitempty"`
   652  	// Metadata: Service-specific metadata associated with the operation. It
   653  	// typically contains progress information and common metadata such as create
   654  	// time. Some services might not provide such metadata. Any method that returns
   655  	// a long-running operation should document the metadata type, if any.
   656  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
   657  	// Name: The server-assigned name, which is only unique within the same service
   658  	// that originally returns it. If you use the default HTTP mapping, the `name`
   659  	// should be a resource name ending with `operations/{unique_id}`.
   660  	Name string `json:"name,omitempty"`
   661  	// Response: The normal, successful response of the operation. If the original
   662  	// method returns no data on success, such as `Delete`, the response is
   663  	// `google.protobuf.Empty`. If the original method is standard
   664  	// `Get`/`Create`/`Update`, the response should be the resource. For other
   665  	// methods, the response should have the type `XxxResponse`, where `Xxx` is the
   666  	// original method name. For example, if the original method name is
   667  	// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
   668  	Response googleapi.RawMessage `json:"response,omitempty"`
   669  
   670  	// ServerResponse contains the HTTP response code and headers from the server.
   671  	googleapi.ServerResponse `json:"-"`
   672  	// ForceSendFields is a list of field names (e.g. "Done") to unconditionally
   673  	// include in API requests. By default, fields with empty or default values are
   674  	// omitted from API requests. See
   675  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   676  	// details.
   677  	ForceSendFields []string `json:"-"`
   678  	// NullFields is a list of field names (e.g. "Done") to include in API requests
   679  	// with the JSON null value. By default, fields with empty values are omitted
   680  	// from API requests. See
   681  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   682  	NullFields []string `json:"-"`
   683  }
   684  
   685  func (s *Operation) MarshalJSON() ([]byte, error) {
   686  	type NoMethod Operation
   687  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   688  }
   689  
   690  // OperationMetadata: Represents the metadata of the long-running operation.
   691  type OperationMetadata struct {
   692  	// ApiVersion: Output only. API version used to start the operation.
   693  	ApiVersion string `json:"apiVersion,omitempty"`
   694  	// CreateTime: Output only. The time the operation was created.
   695  	CreateTime string `json:"createTime,omitempty"`
   696  	// EndTime: Output only. The time the operation finished running.
   697  	EndTime string `json:"endTime,omitempty"`
   698  	// RequestedCancellation: Output only. Identifies whether the user has
   699  	// requested cancellation of the operation. Operations that have successfully
   700  	// been cancelled have Operation.error value with a google.rpc.Status.code of
   701  	// 1, corresponding to `Code.CANCELLED`.
   702  	RequestedCancellation bool `json:"requestedCancellation,omitempty"`
   703  	// StatusMessage: Output only. Human-readable status of the operation, if any.
   704  	StatusMessage string `json:"statusMessage,omitempty"`
   705  	// Target: Output only. Server-defined resource path for the target of the
   706  	// operation.
   707  	Target string `json:"target,omitempty"`
   708  	// Verb: Output only. Name of the verb executed by the operation.
   709  	Verb string `json:"verb,omitempty"`
   710  	// ForceSendFields is a list of field names (e.g. "ApiVersion") to
   711  	// unconditionally include in API requests. By default, fields with empty or
   712  	// default values are omitted from API requests. See
   713  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   714  	// details.
   715  	ForceSendFields []string `json:"-"`
   716  	// NullFields is a list of field names (e.g. "ApiVersion") to include in API
   717  	// requests with the JSON null value. By default, fields with empty values are
   718  	// omitted from API requests. See
   719  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   720  	NullFields []string `json:"-"`
   721  }
   722  
   723  func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
   724  	type NoMethod OperationMetadata
   725  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   726  }
   727  
   728  // Policy: An Identity and Access Management (IAM) policy, which specifies
   729  // access controls for Google Cloud resources. A `Policy` is a collection of
   730  // `bindings`. A `binding` binds one or more `members`, or principals, to a
   731  // single `role`. Principals can be user accounts, service accounts, Google
   732  // groups, and domains (such as G Suite). A `role` is a named list of
   733  // permissions; each `role` can be an IAM predefined role or a user-created
   734  // custom role. For some types of Google Cloud resources, a `binding` can also
   735  // specify a `condition`, which is a logical expression that allows access to a
   736  // resource only if the expression evaluates to `true`. A condition can add
   737  // constraints based on attributes of the request, the resource, or both. To
   738  // learn which resources support conditions in their IAM policies, see the IAM
   739  // documentation
   740  // (https://cloud.google.com/iam/help/conditions/resource-policies). **JSON
   741  // example:** ``` { "bindings": [ { "role":
   742  // "roles/resourcemanager.organizationAdmin", "members": [
   743  // "user:mike@example.com", "group:admins@example.com", "domain:google.com",
   744  // "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role":
   745  // "roles/resourcemanager.organizationViewer", "members": [
   746  // "user:eve@example.com" ], "condition": { "title": "expirable access",
   747  // "description": "Does not grant access after Sep 2020", "expression":
   748  // "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag":
   749  // "BwWWja0YfJA=", "version": 3 } ``` **YAML example:** ``` bindings: -
   750  // members: - user:mike@example.com - group:admins@example.com -
   751  // domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com
   752  // role: roles/resourcemanager.organizationAdmin - members: -
   753  // user:eve@example.com role: roles/resourcemanager.organizationViewer
   754  // condition: title: expirable access description: Does not grant access after
   755  // Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z')
   756  // etag: BwWWja0YfJA= version: 3 ``` For a description of IAM and its features,
   757  // see the IAM documentation (https://cloud.google.com/iam/docs/).
   758  type Policy struct {
   759  	// AuditConfigs: Specifies cloud audit logging configuration for this policy.
   760  	AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
   761  	// Bindings: Associates a list of `members`, or principals, with a `role`.
   762  	// Optionally, may specify a `condition` that determines how and when the
   763  	// `bindings` are applied. Each of the `bindings` must contain at least one
   764  	// principal. The `bindings` in a `Policy` can refer to up to 1,500 principals;
   765  	// up to 250 of these principals can be Google groups. Each occurrence of a
   766  	// principal counts towards these limits. For example, if the `bindings` grant
   767  	// 50 different roles to `user:alice@example.com`, and not to any other
   768  	// principal, then you can add another 1,450 principals to the `bindings` in
   769  	// the `Policy`.
   770  	Bindings []*Binding `json:"bindings,omitempty"`
   771  	// Etag: `etag` is used for optimistic concurrency control as a way to help
   772  	// prevent simultaneous updates of a policy from overwriting each other. It is
   773  	// strongly suggested that systems make use of the `etag` in the
   774  	// read-modify-write cycle to perform policy updates in order to avoid race
   775  	// conditions: An `etag` is returned in the response to `getIamPolicy`, and
   776  	// systems are expected to put that etag in the request to `setIamPolicy` to
   777  	// ensure that their change will be applied to the same version of the policy.
   778  	// **Important:** If you use IAM Conditions, you must include the `etag` field
   779  	// whenever you call `setIamPolicy`. If you omit this field, then IAM allows
   780  	// you to overwrite a version `3` policy with a version `1` policy, and all of
   781  	// the conditions in the version `3` policy are lost.
   782  	Etag string `json:"etag,omitempty"`
   783  	// Version: Specifies the format of the policy. Valid values are `0`, `1`, and
   784  	// `3`. Requests that specify an invalid value are rejected. Any operation that
   785  	// affects conditional role bindings must specify version `3`. This requirement
   786  	// applies to the following operations: * Getting a policy that includes a
   787  	// conditional role binding * Adding a conditional role binding to a policy *
   788  	// Changing a conditional role binding in a policy * Removing any role binding,
   789  	// with or without a condition, from a policy that includes conditions
   790  	// **Important:** If you use IAM Conditions, you must include the `etag` field
   791  	// whenever you call `setIamPolicy`. If you omit this field, then IAM allows
   792  	// you to overwrite a version `3` policy with a version `1` policy, and all of
   793  	// the conditions in the version `3` policy are lost. If a policy does not
   794  	// include any conditions, operations on that policy may specify any valid
   795  	// version or leave the field unset. To learn which resources support
   796  	// conditions in their IAM policies, see the IAM documentation
   797  	// (https://cloud.google.com/iam/help/conditions/resource-policies).
   798  	Version int64 `json:"version,omitempty"`
   799  
   800  	// ServerResponse contains the HTTP response code and headers from the server.
   801  	googleapi.ServerResponse `json:"-"`
   802  	// ForceSendFields is a list of field names (e.g. "AuditConfigs") to
   803  	// unconditionally include in API requests. By default, fields with empty or
   804  	// default values are omitted from API requests. See
   805  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   806  	// details.
   807  	ForceSendFields []string `json:"-"`
   808  	// NullFields is a list of field names (e.g. "AuditConfigs") to include in API
   809  	// requests with the JSON null value. By default, fields with empty values are
   810  	// omitted from API requests. See
   811  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   812  	NullFields []string `json:"-"`
   813  }
   814  
   815  func (s *Policy) MarshalJSON() ([]byte, error) {
   816  	type NoMethod Policy
   817  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   818  }
   819  
   820  // Pubsub: Represents a Pub/Sub transport.
   821  type Pubsub struct {
   822  	// Subscription: Output only. The name of the Pub/Sub subscription created and
   823  	// managed by Eventarc system as a transport for the event delivery. Format:
   824  	// `projects/{PROJECT_ID}/subscriptions/{SUBSCRIPTION_NAME}`.
   825  	Subscription string `json:"subscription,omitempty"`
   826  	// Topic: Optional. The name of the Pub/Sub topic created and managed by
   827  	// Eventarc system as a transport for the event delivery. Format:
   828  	// `projects/{PROJECT_ID}/topics/{TOPIC_NAME}`. You may set an existing topic
   829  	// for triggers of the type `google.cloud.pubsub.topic.v1.messagePublished`
   830  	// only. The topic you provide here will not be deleted by Eventarc at trigger
   831  	// deletion.
   832  	Topic string `json:"topic,omitempty"`
   833  	// ForceSendFields is a list of field names (e.g. "Subscription") to
   834  	// unconditionally include in API requests. By default, fields with empty or
   835  	// default values are omitted from API requests. See
   836  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   837  	// details.
   838  	ForceSendFields []string `json:"-"`
   839  	// NullFields is a list of field names (e.g. "Subscription") to include in API
   840  	// requests with the JSON null value. By default, fields with empty values are
   841  	// omitted from API requests. See
   842  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   843  	NullFields []string `json:"-"`
   844  }
   845  
   846  func (s *Pubsub) MarshalJSON() ([]byte, error) {
   847  	type NoMethod Pubsub
   848  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   849  }
   850  
   851  // SetIamPolicyRequest: Request message for `SetIamPolicy` method.
   852  type SetIamPolicyRequest struct {
   853  	// Policy: REQUIRED: The complete policy to be applied to the `resource`. The
   854  	// size of the policy is limited to a few 10s of KB. An empty policy is a valid
   855  	// policy but certain Google Cloud services (such as Projects) might reject
   856  	// them.
   857  	Policy *Policy `json:"policy,omitempty"`
   858  	// UpdateMask: OPTIONAL: A FieldMask specifying which fields of the policy to
   859  	// modify. Only the fields in the mask will be modified. If no mask is
   860  	// provided, the following default mask is used: `paths: "bindings, etag"
   861  	UpdateMask string `json:"updateMask,omitempty"`
   862  	// ForceSendFields is a list of field names (e.g. "Policy") to unconditionally
   863  	// include in API requests. By default, fields with empty or default values are
   864  	// omitted from API requests. See
   865  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   866  	// details.
   867  	ForceSendFields []string `json:"-"`
   868  	// NullFields is a list of field names (e.g. "Policy") to include in API
   869  	// requests with the JSON null value. By default, fields with empty values are
   870  	// omitted from API requests. See
   871  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   872  	NullFields []string `json:"-"`
   873  }
   874  
   875  func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
   876  	type NoMethod SetIamPolicyRequest
   877  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   878  }
   879  
   880  // Status: The `Status` type defines a logical error model that is suitable for
   881  // different programming environments, including REST APIs and RPC APIs. It is
   882  // used by gRPC (https://github.com/grpc). Each `Status` message contains three
   883  // pieces of data: error code, error message, and error details. You can find
   884  // out more about this error model and how to work with it in the API Design
   885  // Guide (https://cloud.google.com/apis/design/errors).
   886  type Status struct {
   887  	// Code: The status code, which should be an enum value of google.rpc.Code.
   888  	Code int64 `json:"code,omitempty"`
   889  	// Details: A list of messages that carry the error details. There is a common
   890  	// set of message types for APIs to use.
   891  	Details []googleapi.RawMessage `json:"details,omitempty"`
   892  	// Message: A developer-facing error message, which should be in English. Any
   893  	// user-facing error message should be localized and sent in the
   894  	// google.rpc.Status.details field, or localized by the client.
   895  	Message string `json:"message,omitempty"`
   896  	// ForceSendFields is a list of field names (e.g. "Code") to unconditionally
   897  	// include in API requests. By default, fields with empty or default values are
   898  	// omitted from API requests. See
   899  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   900  	// details.
   901  	ForceSendFields []string `json:"-"`
   902  	// NullFields is a list of field names (e.g. "Code") to include in API requests
   903  	// with the JSON null value. By default, fields with empty values are omitted
   904  	// from API requests. See
   905  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   906  	NullFields []string `json:"-"`
   907  }
   908  
   909  func (s *Status) MarshalJSON() ([]byte, error) {
   910  	type NoMethod Status
   911  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   912  }
   913  
   914  // TestIamPermissionsRequest: Request message for `TestIamPermissions` method.
   915  type TestIamPermissionsRequest struct {
   916  	// Permissions: The set of permissions to check for the `resource`. Permissions
   917  	// with wildcards (such as `*` or `storage.*`) are not allowed. For more
   918  	// information see IAM Overview
   919  	// (https://cloud.google.com/iam/docs/overview#permissions).
   920  	Permissions []string `json:"permissions,omitempty"`
   921  	// ForceSendFields is a list of field names (e.g. "Permissions") to
   922  	// unconditionally include in API requests. By default, fields with empty or
   923  	// default values are omitted from API requests. See
   924  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   925  	// details.
   926  	ForceSendFields []string `json:"-"`
   927  	// NullFields is a list of field names (e.g. "Permissions") to include in API
   928  	// requests with the JSON null value. By default, fields with empty values are
   929  	// omitted from API requests. See
   930  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   931  	NullFields []string `json:"-"`
   932  }
   933  
   934  func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
   935  	type NoMethod TestIamPermissionsRequest
   936  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   937  }
   938  
   939  // TestIamPermissionsResponse: Response message for `TestIamPermissions`
   940  // method.
   941  type TestIamPermissionsResponse struct {
   942  	// Permissions: A subset of `TestPermissionsRequest.permissions` that the
   943  	// caller is allowed.
   944  	Permissions []string `json:"permissions,omitempty"`
   945  
   946  	// ServerResponse contains the HTTP response code and headers from the server.
   947  	googleapi.ServerResponse `json:"-"`
   948  	// ForceSendFields is a list of field names (e.g. "Permissions") to
   949  	// unconditionally include in API requests. By default, fields with empty or
   950  	// default values are omitted from API requests. See
   951  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   952  	// details.
   953  	ForceSendFields []string `json:"-"`
   954  	// NullFields is a list of field names (e.g. "Permissions") to include in API
   955  	// requests with the JSON null value. By default, fields with empty values are
   956  	// omitted from API requests. See
   957  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   958  	NullFields []string `json:"-"`
   959  }
   960  
   961  func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
   962  	type NoMethod TestIamPermissionsResponse
   963  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   964  }
   965  
   966  // Transport: Represents the transport intermediaries created for the trigger
   967  // in order to deliver events.
   968  type Transport struct {
   969  	// Pubsub: The Pub/Sub topic and subscription used by Eventarc as delivery
   970  	// intermediary.
   971  	Pubsub *Pubsub `json:"pubsub,omitempty"`
   972  	// ForceSendFields is a list of field names (e.g. "Pubsub") to unconditionally
   973  	// include in API requests. By default, fields with empty or default values are
   974  	// omitted from API requests. See
   975  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   976  	// details.
   977  	ForceSendFields []string `json:"-"`
   978  	// NullFields is a list of field names (e.g. "Pubsub") to include in API
   979  	// requests with the JSON null value. By default, fields with empty values are
   980  	// omitted from API requests. See
   981  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   982  	NullFields []string `json:"-"`
   983  }
   984  
   985  func (s *Transport) MarshalJSON() ([]byte, error) {
   986  	type NoMethod Transport
   987  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   988  }
   989  
   990  // Trigger: A representation of the trigger resource.
   991  type Trigger struct {
   992  	// CreateTime: Output only. The creation time.
   993  	CreateTime string `json:"createTime,omitempty"`
   994  	// Destination: Required. Destination specifies where the events should be sent
   995  	// to.
   996  	Destination *Destination `json:"destination,omitempty"`
   997  	// Etag: Output only. This checksum is computed by the server based on the
   998  	// value of other fields, and may be sent only on create requests to ensure the
   999  	// client has an up-to-date value before proceeding.
  1000  	Etag string `json:"etag,omitempty"`
  1001  	// Labels: Optional. User labels attached to the triggers that can be used to
  1002  	// group resources.
  1003  	Labels map[string]string `json:"labels,omitempty"`
  1004  	// MatchingCriteria: Required. Unordered list. The criteria by which events are
  1005  	// filtered. Only events that match with this criteria will be sent to the
  1006  	// destination.
  1007  	MatchingCriteria []*MatchingCriteria `json:"matchingCriteria,omitempty"`
  1008  	// Name: Required. The resource name of the trigger. Must be unique within the
  1009  	// location on the project and must in
  1010  	// `projects/{project}/locations/{location}/triggers/{trigger}` format.
  1011  	Name string `json:"name,omitempty"`
  1012  	// ServiceAccount: Optional. The IAM service account email associated with the
  1013  	// trigger. The service account represents the identity of the trigger. The
  1014  	// principal who calls this API must have `iam.serviceAccounts.actAs`
  1015  	// permission in the service account. See
  1016  	// https://cloud.google.com/iam/docs/understanding-service-accounts?hl=en#sa_common
  1017  	// for more information. For Cloud Run destinations, this service account is
  1018  	// used to generate identity tokens when invoking the service. See
  1019  	// https://cloud.google.com/run/docs/triggering/pubsub-push#create-service-account
  1020  	// for information on how to invoke authenticated Cloud Run services. In order
  1021  	// to create Audit Log triggers, the service account should also have
  1022  	// 'eventarc.events.receiveAuditLogV1Written' permission.
  1023  	ServiceAccount string `json:"serviceAccount,omitempty"`
  1024  	// Transport: Output only. In order to deliver messages, Eventarc may use other
  1025  	// Google Cloud products as transport intermediary. This field contains a
  1026  	// reference to that transport intermediary. This information can be used for
  1027  	// debugging purposes.
  1028  	Transport *Transport `json:"transport,omitempty"`
  1029  	// UpdateTime: Output only. The last-modified time.
  1030  	UpdateTime string `json:"updateTime,omitempty"`
  1031  
  1032  	// ServerResponse contains the HTTP response code and headers from the server.
  1033  	googleapi.ServerResponse `json:"-"`
  1034  	// ForceSendFields is a list of field names (e.g. "CreateTime") to
  1035  	// unconditionally include in API requests. By default, fields with empty or
  1036  	// default values are omitted from API requests. See
  1037  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1038  	// details.
  1039  	ForceSendFields []string `json:"-"`
  1040  	// NullFields is a list of field names (e.g. "CreateTime") to include in API
  1041  	// requests with the JSON null value. By default, fields with empty values are
  1042  	// omitted from API requests. See
  1043  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1044  	NullFields []string `json:"-"`
  1045  }
  1046  
  1047  func (s *Trigger) MarshalJSON() ([]byte, error) {
  1048  	type NoMethod Trigger
  1049  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1050  }
  1051  
  1052  type ProjectsLocationsGetCall struct {
  1053  	s            *Service
  1054  	name         string
  1055  	urlParams_   gensupport.URLParams
  1056  	ifNoneMatch_ string
  1057  	ctx_         context.Context
  1058  	header_      http.Header
  1059  }
  1060  
  1061  // Get: Gets information about a location.
  1062  //
  1063  // - name: Resource name for the location.
  1064  func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
  1065  	c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1066  	c.name = name
  1067  	return c
  1068  }
  1069  
  1070  // Fields allows partial responses to be retrieved. See
  1071  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1072  // details.
  1073  func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
  1074  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1075  	return c
  1076  }
  1077  
  1078  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1079  // object's ETag matches the given value. This is useful for getting updates
  1080  // only after the object has changed since the last request.
  1081  func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
  1082  	c.ifNoneMatch_ = entityTag
  1083  	return c
  1084  }
  1085  
  1086  // Context sets the context to be used in this call's Do method.
  1087  func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
  1088  	c.ctx_ = ctx
  1089  	return c
  1090  }
  1091  
  1092  // Header returns a http.Header that can be modified by the caller to add
  1093  // headers to the request.
  1094  func (c *ProjectsLocationsGetCall) Header() http.Header {
  1095  	if c.header_ == nil {
  1096  		c.header_ = make(http.Header)
  1097  	}
  1098  	return c.header_
  1099  }
  1100  
  1101  func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
  1102  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1103  	if c.ifNoneMatch_ != "" {
  1104  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1105  	}
  1106  	var body io.Reader = nil
  1107  	c.urlParams_.Set("alt", alt)
  1108  	c.urlParams_.Set("prettyPrint", "false")
  1109  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1110  	urls += "?" + c.urlParams_.Encode()
  1111  	req, err := http.NewRequest("GET", urls, body)
  1112  	if err != nil {
  1113  		return nil, err
  1114  	}
  1115  	req.Header = reqHeaders
  1116  	googleapi.Expand(req.URL, map[string]string{
  1117  		"name": c.name,
  1118  	})
  1119  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1120  }
  1121  
  1122  // Do executes the "eventarc.projects.locations.get" call.
  1123  // Any non-2xx status code is an error. Response headers are in either
  1124  // *Location.ServerResponse.Header or (if a response was returned at all) in
  1125  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1126  // whether the returned error was because http.StatusNotModified was returned.
  1127  func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
  1128  	gensupport.SetOptions(c.urlParams_, opts...)
  1129  	res, err := c.doRequest("json")
  1130  	if res != nil && res.StatusCode == http.StatusNotModified {
  1131  		if res.Body != nil {
  1132  			res.Body.Close()
  1133  		}
  1134  		return nil, gensupport.WrapError(&googleapi.Error{
  1135  			Code:   res.StatusCode,
  1136  			Header: res.Header,
  1137  		})
  1138  	}
  1139  	if err != nil {
  1140  		return nil, err
  1141  	}
  1142  	defer googleapi.CloseBody(res)
  1143  	if err := googleapi.CheckResponse(res); err != nil {
  1144  		return nil, gensupport.WrapError(err)
  1145  	}
  1146  	ret := &Location{
  1147  		ServerResponse: googleapi.ServerResponse{
  1148  			Header:         res.Header,
  1149  			HTTPStatusCode: res.StatusCode,
  1150  		},
  1151  	}
  1152  	target := &ret
  1153  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1154  		return nil, err
  1155  	}
  1156  	return ret, nil
  1157  }
  1158  
  1159  type ProjectsLocationsListCall struct {
  1160  	s            *Service
  1161  	name         string
  1162  	urlParams_   gensupport.URLParams
  1163  	ifNoneMatch_ string
  1164  	ctx_         context.Context
  1165  	header_      http.Header
  1166  }
  1167  
  1168  // List: Lists information about the supported locations for this service.
  1169  //
  1170  // - name: The resource that owns the locations collection, if applicable.
  1171  func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
  1172  	c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1173  	c.name = name
  1174  	return c
  1175  }
  1176  
  1177  // Filter sets the optional parameter "filter": A filter to narrow down results
  1178  // to a preferred subset. The filtering language accepts strings like
  1179  // "displayName=tokyo", and is documented in more detail in AIP-160
  1180  // (https://google.aip.dev/160).
  1181  func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
  1182  	c.urlParams_.Set("filter", filter)
  1183  	return c
  1184  }
  1185  
  1186  // PageSize sets the optional parameter "pageSize": The maximum number of
  1187  // results to return. If not set, the service selects a default.
  1188  func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
  1189  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1190  	return c
  1191  }
  1192  
  1193  // PageToken sets the optional parameter "pageToken": A page token received
  1194  // from the `next_page_token` field in the response. Send that page token to
  1195  // receive the subsequent page.
  1196  func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
  1197  	c.urlParams_.Set("pageToken", pageToken)
  1198  	return c
  1199  }
  1200  
  1201  // Fields allows partial responses to be retrieved. See
  1202  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1203  // details.
  1204  func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
  1205  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1206  	return c
  1207  }
  1208  
  1209  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1210  // object's ETag matches the given value. This is useful for getting updates
  1211  // only after the object has changed since the last request.
  1212  func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
  1213  	c.ifNoneMatch_ = entityTag
  1214  	return c
  1215  }
  1216  
  1217  // Context sets the context to be used in this call's Do method.
  1218  func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
  1219  	c.ctx_ = ctx
  1220  	return c
  1221  }
  1222  
  1223  // Header returns a http.Header that can be modified by the caller to add
  1224  // headers to the request.
  1225  func (c *ProjectsLocationsListCall) Header() http.Header {
  1226  	if c.header_ == nil {
  1227  		c.header_ = make(http.Header)
  1228  	}
  1229  	return c.header_
  1230  }
  1231  
  1232  func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
  1233  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1234  	if c.ifNoneMatch_ != "" {
  1235  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1236  	}
  1237  	var body io.Reader = nil
  1238  	c.urlParams_.Set("alt", alt)
  1239  	c.urlParams_.Set("prettyPrint", "false")
  1240  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations")
  1241  	urls += "?" + c.urlParams_.Encode()
  1242  	req, err := http.NewRequest("GET", urls, body)
  1243  	if err != nil {
  1244  		return nil, err
  1245  	}
  1246  	req.Header = reqHeaders
  1247  	googleapi.Expand(req.URL, map[string]string{
  1248  		"name": c.name,
  1249  	})
  1250  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1251  }
  1252  
  1253  // Do executes the "eventarc.projects.locations.list" call.
  1254  // Any non-2xx status code is an error. Response headers are in either
  1255  // *ListLocationsResponse.ServerResponse.Header or (if a response was returned
  1256  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1257  // check whether the returned error was because http.StatusNotModified was
  1258  // returned.
  1259  func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
  1260  	gensupport.SetOptions(c.urlParams_, opts...)
  1261  	res, err := c.doRequest("json")
  1262  	if res != nil && res.StatusCode == http.StatusNotModified {
  1263  		if res.Body != nil {
  1264  			res.Body.Close()
  1265  		}
  1266  		return nil, gensupport.WrapError(&googleapi.Error{
  1267  			Code:   res.StatusCode,
  1268  			Header: res.Header,
  1269  		})
  1270  	}
  1271  	if err != nil {
  1272  		return nil, err
  1273  	}
  1274  	defer googleapi.CloseBody(res)
  1275  	if err := googleapi.CheckResponse(res); err != nil {
  1276  		return nil, gensupport.WrapError(err)
  1277  	}
  1278  	ret := &ListLocationsResponse{
  1279  		ServerResponse: googleapi.ServerResponse{
  1280  			Header:         res.Header,
  1281  			HTTPStatusCode: res.StatusCode,
  1282  		},
  1283  	}
  1284  	target := &ret
  1285  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1286  		return nil, err
  1287  	}
  1288  	return ret, nil
  1289  }
  1290  
  1291  // Pages invokes f for each page of results.
  1292  // A non-nil error returned from f will halt the iteration.
  1293  // The provided context supersedes any context provided to the Context method.
  1294  func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
  1295  	c.ctx_ = ctx
  1296  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1297  	for {
  1298  		x, err := c.Do()
  1299  		if err != nil {
  1300  			return err
  1301  		}
  1302  		if err := f(x); err != nil {
  1303  			return err
  1304  		}
  1305  		if x.NextPageToken == "" {
  1306  			return nil
  1307  		}
  1308  		c.PageToken(x.NextPageToken)
  1309  	}
  1310  }
  1311  
  1312  type ProjectsLocationsOperationsCancelCall struct {
  1313  	s                      *Service
  1314  	name                   string
  1315  	canceloperationrequest *CancelOperationRequest
  1316  	urlParams_             gensupport.URLParams
  1317  	ctx_                   context.Context
  1318  	header_                http.Header
  1319  }
  1320  
  1321  // Cancel: Starts asynchronous cancellation on a long-running operation. The
  1322  // server makes a best effort to cancel the operation, but success is not
  1323  // guaranteed. If the server doesn't support this method, it returns
  1324  // `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or
  1325  // other methods to check whether the cancellation succeeded or whether the
  1326  // operation completed despite cancellation. On successful cancellation, the
  1327  // operation is not deleted; instead, it becomes an operation with an
  1328  // Operation.error value with a google.rpc.Status.code of 1, corresponding to
  1329  // `Code.CANCELLED`.
  1330  //
  1331  // - name: The name of the operation resource to be cancelled.
  1332  func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall {
  1333  	c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1334  	c.name = name
  1335  	c.canceloperationrequest = canceloperationrequest
  1336  	return c
  1337  }
  1338  
  1339  // Fields allows partial responses to be retrieved. See
  1340  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1341  // details.
  1342  func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall {
  1343  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1344  	return c
  1345  }
  1346  
  1347  // Context sets the context to be used in this call's Do method.
  1348  func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall {
  1349  	c.ctx_ = ctx
  1350  	return c
  1351  }
  1352  
  1353  // Header returns a http.Header that can be modified by the caller to add
  1354  // headers to the request.
  1355  func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header {
  1356  	if c.header_ == nil {
  1357  		c.header_ = make(http.Header)
  1358  	}
  1359  	return c.header_
  1360  }
  1361  
  1362  func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
  1363  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1364  	var body io.Reader = nil
  1365  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
  1366  	if err != nil {
  1367  		return nil, err
  1368  	}
  1369  	c.urlParams_.Set("alt", alt)
  1370  	c.urlParams_.Set("prettyPrint", "false")
  1371  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel")
  1372  	urls += "?" + c.urlParams_.Encode()
  1373  	req, err := http.NewRequest("POST", urls, body)
  1374  	if err != nil {
  1375  		return nil, err
  1376  	}
  1377  	req.Header = reqHeaders
  1378  	googleapi.Expand(req.URL, map[string]string{
  1379  		"name": c.name,
  1380  	})
  1381  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1382  }
  1383  
  1384  // Do executes the "eventarc.projects.locations.operations.cancel" call.
  1385  // Any non-2xx status code is an error. Response headers are in either
  1386  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  1387  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1388  // whether the returned error was because http.StatusNotModified was returned.
  1389  func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  1390  	gensupport.SetOptions(c.urlParams_, opts...)
  1391  	res, err := c.doRequest("json")
  1392  	if res != nil && res.StatusCode == http.StatusNotModified {
  1393  		if res.Body != nil {
  1394  			res.Body.Close()
  1395  		}
  1396  		return nil, gensupport.WrapError(&googleapi.Error{
  1397  			Code:   res.StatusCode,
  1398  			Header: res.Header,
  1399  		})
  1400  	}
  1401  	if err != nil {
  1402  		return nil, err
  1403  	}
  1404  	defer googleapi.CloseBody(res)
  1405  	if err := googleapi.CheckResponse(res); err != nil {
  1406  		return nil, gensupport.WrapError(err)
  1407  	}
  1408  	ret := &Empty{
  1409  		ServerResponse: googleapi.ServerResponse{
  1410  			Header:         res.Header,
  1411  			HTTPStatusCode: res.StatusCode,
  1412  		},
  1413  	}
  1414  	target := &ret
  1415  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1416  		return nil, err
  1417  	}
  1418  	return ret, nil
  1419  }
  1420  
  1421  type ProjectsLocationsOperationsDeleteCall struct {
  1422  	s          *Service
  1423  	name       string
  1424  	urlParams_ gensupport.URLParams
  1425  	ctx_       context.Context
  1426  	header_    http.Header
  1427  }
  1428  
  1429  // Delete: Deletes a long-running operation. This method indicates that the
  1430  // client is no longer interested in the operation result. It does not cancel
  1431  // the operation. If the server doesn't support this method, it returns
  1432  // `google.rpc.Code.UNIMPLEMENTED`.
  1433  //
  1434  // - name: The name of the operation resource to be deleted.
  1435  func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall {
  1436  	c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1437  	c.name = name
  1438  	return c
  1439  }
  1440  
  1441  // Fields allows partial responses to be retrieved. See
  1442  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1443  // details.
  1444  func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall {
  1445  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1446  	return c
  1447  }
  1448  
  1449  // Context sets the context to be used in this call's Do method.
  1450  func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall {
  1451  	c.ctx_ = ctx
  1452  	return c
  1453  }
  1454  
  1455  // Header returns a http.Header that can be modified by the caller to add
  1456  // headers to the request.
  1457  func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header {
  1458  	if c.header_ == nil {
  1459  		c.header_ = make(http.Header)
  1460  	}
  1461  	return c.header_
  1462  }
  1463  
  1464  func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1465  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1466  	var body io.Reader = nil
  1467  	c.urlParams_.Set("alt", alt)
  1468  	c.urlParams_.Set("prettyPrint", "false")
  1469  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1470  	urls += "?" + c.urlParams_.Encode()
  1471  	req, err := http.NewRequest("DELETE", urls, body)
  1472  	if err != nil {
  1473  		return nil, err
  1474  	}
  1475  	req.Header = reqHeaders
  1476  	googleapi.Expand(req.URL, map[string]string{
  1477  		"name": c.name,
  1478  	})
  1479  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1480  }
  1481  
  1482  // Do executes the "eventarc.projects.locations.operations.delete" call.
  1483  // Any non-2xx status code is an error. Response headers are in either
  1484  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  1485  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1486  // whether the returned error was because http.StatusNotModified was returned.
  1487  func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  1488  	gensupport.SetOptions(c.urlParams_, opts...)
  1489  	res, err := c.doRequest("json")
  1490  	if res != nil && res.StatusCode == http.StatusNotModified {
  1491  		if res.Body != nil {
  1492  			res.Body.Close()
  1493  		}
  1494  		return nil, gensupport.WrapError(&googleapi.Error{
  1495  			Code:   res.StatusCode,
  1496  			Header: res.Header,
  1497  		})
  1498  	}
  1499  	if err != nil {
  1500  		return nil, err
  1501  	}
  1502  	defer googleapi.CloseBody(res)
  1503  	if err := googleapi.CheckResponse(res); err != nil {
  1504  		return nil, gensupport.WrapError(err)
  1505  	}
  1506  	ret := &Empty{
  1507  		ServerResponse: googleapi.ServerResponse{
  1508  			Header:         res.Header,
  1509  			HTTPStatusCode: res.StatusCode,
  1510  		},
  1511  	}
  1512  	target := &ret
  1513  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1514  		return nil, err
  1515  	}
  1516  	return ret, nil
  1517  }
  1518  
  1519  type ProjectsLocationsOperationsGetCall struct {
  1520  	s            *Service
  1521  	name         string
  1522  	urlParams_   gensupport.URLParams
  1523  	ifNoneMatch_ string
  1524  	ctx_         context.Context
  1525  	header_      http.Header
  1526  }
  1527  
  1528  // Get: Gets the latest state of a long-running operation. Clients can use this
  1529  // method to poll the operation result at intervals as recommended by the API
  1530  // service.
  1531  //
  1532  // - name: The name of the operation resource.
  1533  func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
  1534  	c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1535  	c.name = name
  1536  	return c
  1537  }
  1538  
  1539  // Fields allows partial responses to be retrieved. See
  1540  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1541  // details.
  1542  func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
  1543  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1544  	return c
  1545  }
  1546  
  1547  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1548  // object's ETag matches the given value. This is useful for getting updates
  1549  // only after the object has changed since the last request.
  1550  func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
  1551  	c.ifNoneMatch_ = entityTag
  1552  	return c
  1553  }
  1554  
  1555  // Context sets the context to be used in this call's Do method.
  1556  func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
  1557  	c.ctx_ = ctx
  1558  	return c
  1559  }
  1560  
  1561  // Header returns a http.Header that can be modified by the caller to add
  1562  // headers to the request.
  1563  func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
  1564  	if c.header_ == nil {
  1565  		c.header_ = make(http.Header)
  1566  	}
  1567  	return c.header_
  1568  }
  1569  
  1570  func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  1571  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1572  	if c.ifNoneMatch_ != "" {
  1573  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1574  	}
  1575  	var body io.Reader = nil
  1576  	c.urlParams_.Set("alt", alt)
  1577  	c.urlParams_.Set("prettyPrint", "false")
  1578  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1579  	urls += "?" + c.urlParams_.Encode()
  1580  	req, err := http.NewRequest("GET", urls, body)
  1581  	if err != nil {
  1582  		return nil, err
  1583  	}
  1584  	req.Header = reqHeaders
  1585  	googleapi.Expand(req.URL, map[string]string{
  1586  		"name": c.name,
  1587  	})
  1588  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1589  }
  1590  
  1591  // Do executes the "eventarc.projects.locations.operations.get" call.
  1592  // Any non-2xx status code is an error. Response headers are in either
  1593  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  1594  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1595  // whether the returned error was because http.StatusNotModified was returned.
  1596  func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1597  	gensupport.SetOptions(c.urlParams_, opts...)
  1598  	res, err := c.doRequest("json")
  1599  	if res != nil && res.StatusCode == http.StatusNotModified {
  1600  		if res.Body != nil {
  1601  			res.Body.Close()
  1602  		}
  1603  		return nil, gensupport.WrapError(&googleapi.Error{
  1604  			Code:   res.StatusCode,
  1605  			Header: res.Header,
  1606  		})
  1607  	}
  1608  	if err != nil {
  1609  		return nil, err
  1610  	}
  1611  	defer googleapi.CloseBody(res)
  1612  	if err := googleapi.CheckResponse(res); err != nil {
  1613  		return nil, gensupport.WrapError(err)
  1614  	}
  1615  	ret := &Operation{
  1616  		ServerResponse: googleapi.ServerResponse{
  1617  			Header:         res.Header,
  1618  			HTTPStatusCode: res.StatusCode,
  1619  		},
  1620  	}
  1621  	target := &ret
  1622  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1623  		return nil, err
  1624  	}
  1625  	return ret, nil
  1626  }
  1627  
  1628  type ProjectsLocationsOperationsListCall struct {
  1629  	s            *Service
  1630  	name         string
  1631  	urlParams_   gensupport.URLParams
  1632  	ifNoneMatch_ string
  1633  	ctx_         context.Context
  1634  	header_      http.Header
  1635  }
  1636  
  1637  // List: Lists operations that match the specified filter in the request. If
  1638  // the server doesn't support this method, it returns `UNIMPLEMENTED`.
  1639  //
  1640  // - name: The name of the operation's parent resource.
  1641  func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall {
  1642  	c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1643  	c.name = name
  1644  	return c
  1645  }
  1646  
  1647  // Filter sets the optional parameter "filter": The standard list filter.
  1648  func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall {
  1649  	c.urlParams_.Set("filter", filter)
  1650  	return c
  1651  }
  1652  
  1653  // PageSize sets the optional parameter "pageSize": The standard list page
  1654  // size.
  1655  func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall {
  1656  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1657  	return c
  1658  }
  1659  
  1660  // PageToken sets the optional parameter "pageToken": The standard list page
  1661  // token.
  1662  func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall {
  1663  	c.urlParams_.Set("pageToken", pageToken)
  1664  	return c
  1665  }
  1666  
  1667  // Fields allows partial responses to be retrieved. See
  1668  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1669  // details.
  1670  func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
  1671  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1672  	return c
  1673  }
  1674  
  1675  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1676  // object's ETag matches the given value. This is useful for getting updates
  1677  // only after the object has changed since the last request.
  1678  func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
  1679  	c.ifNoneMatch_ = entityTag
  1680  	return c
  1681  }
  1682  
  1683  // Context sets the context to be used in this call's Do method.
  1684  func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
  1685  	c.ctx_ = ctx
  1686  	return c
  1687  }
  1688  
  1689  // Header returns a http.Header that can be modified by the caller to add
  1690  // headers to the request.
  1691  func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
  1692  	if c.header_ == nil {
  1693  		c.header_ = make(http.Header)
  1694  	}
  1695  	return c.header_
  1696  }
  1697  
  1698  func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
  1699  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1700  	if c.ifNoneMatch_ != "" {
  1701  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1702  	}
  1703  	var body io.Reader = nil
  1704  	c.urlParams_.Set("alt", alt)
  1705  	c.urlParams_.Set("prettyPrint", "false")
  1706  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations")
  1707  	urls += "?" + c.urlParams_.Encode()
  1708  	req, err := http.NewRequest("GET", urls, body)
  1709  	if err != nil {
  1710  		return nil, err
  1711  	}
  1712  	req.Header = reqHeaders
  1713  	googleapi.Expand(req.URL, map[string]string{
  1714  		"name": c.name,
  1715  	})
  1716  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1717  }
  1718  
  1719  // Do executes the "eventarc.projects.locations.operations.list" call.
  1720  // Any non-2xx status code is an error. Response headers are in either
  1721  // *ListOperationsResponse.ServerResponse.Header or (if a response was returned
  1722  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1723  // check whether the returned error was because http.StatusNotModified was
  1724  // returned.
  1725  func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  1726  	gensupport.SetOptions(c.urlParams_, opts...)
  1727  	res, err := c.doRequest("json")
  1728  	if res != nil && res.StatusCode == http.StatusNotModified {
  1729  		if res.Body != nil {
  1730  			res.Body.Close()
  1731  		}
  1732  		return nil, gensupport.WrapError(&googleapi.Error{
  1733  			Code:   res.StatusCode,
  1734  			Header: res.Header,
  1735  		})
  1736  	}
  1737  	if err != nil {
  1738  		return nil, err
  1739  	}
  1740  	defer googleapi.CloseBody(res)
  1741  	if err := googleapi.CheckResponse(res); err != nil {
  1742  		return nil, gensupport.WrapError(err)
  1743  	}
  1744  	ret := &ListOperationsResponse{
  1745  		ServerResponse: googleapi.ServerResponse{
  1746  			Header:         res.Header,
  1747  			HTTPStatusCode: res.StatusCode,
  1748  		},
  1749  	}
  1750  	target := &ret
  1751  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1752  		return nil, err
  1753  	}
  1754  	return ret, nil
  1755  }
  1756  
  1757  // Pages invokes f for each page of results.
  1758  // A non-nil error returned from f will halt the iteration.
  1759  // The provided context supersedes any context provided to the Context method.
  1760  func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
  1761  	c.ctx_ = ctx
  1762  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1763  	for {
  1764  		x, err := c.Do()
  1765  		if err != nil {
  1766  			return err
  1767  		}
  1768  		if err := f(x); err != nil {
  1769  			return err
  1770  		}
  1771  		if x.NextPageToken == "" {
  1772  			return nil
  1773  		}
  1774  		c.PageToken(x.NextPageToken)
  1775  	}
  1776  }
  1777  
  1778  type ProjectsLocationsTriggersCreateCall struct {
  1779  	s          *Service
  1780  	parent     string
  1781  	trigger    *Trigger
  1782  	urlParams_ gensupport.URLParams
  1783  	ctx_       context.Context
  1784  	header_    http.Header
  1785  }
  1786  
  1787  // Create: Create a new trigger in a particular project and location.
  1788  //
  1789  // - parent: The parent collection in which to add this trigger.
  1790  func (r *ProjectsLocationsTriggersService) Create(parent string, trigger *Trigger) *ProjectsLocationsTriggersCreateCall {
  1791  	c := &ProjectsLocationsTriggersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1792  	c.parent = parent
  1793  	c.trigger = trigger
  1794  	return c
  1795  }
  1796  
  1797  // TriggerId sets the optional parameter "triggerId": Required. The
  1798  // user-provided ID to be assigned to the trigger.
  1799  func (c *ProjectsLocationsTriggersCreateCall) TriggerId(triggerId string) *ProjectsLocationsTriggersCreateCall {
  1800  	c.urlParams_.Set("triggerId", triggerId)
  1801  	return c
  1802  }
  1803  
  1804  // ValidateOnly sets the optional parameter "validateOnly": Required. If set,
  1805  // validate the request and preview the review, but do not actually post it.
  1806  func (c *ProjectsLocationsTriggersCreateCall) ValidateOnly(validateOnly bool) *ProjectsLocationsTriggersCreateCall {
  1807  	c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  1808  	return c
  1809  }
  1810  
  1811  // Fields allows partial responses to be retrieved. See
  1812  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1813  // details.
  1814  func (c *ProjectsLocationsTriggersCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsTriggersCreateCall {
  1815  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1816  	return c
  1817  }
  1818  
  1819  // Context sets the context to be used in this call's Do method.
  1820  func (c *ProjectsLocationsTriggersCreateCall) Context(ctx context.Context) *ProjectsLocationsTriggersCreateCall {
  1821  	c.ctx_ = ctx
  1822  	return c
  1823  }
  1824  
  1825  // Header returns a http.Header that can be modified by the caller to add
  1826  // headers to the request.
  1827  func (c *ProjectsLocationsTriggersCreateCall) Header() http.Header {
  1828  	if c.header_ == nil {
  1829  		c.header_ = make(http.Header)
  1830  	}
  1831  	return c.header_
  1832  }
  1833  
  1834  func (c *ProjectsLocationsTriggersCreateCall) doRequest(alt string) (*http.Response, error) {
  1835  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1836  	var body io.Reader = nil
  1837  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.trigger)
  1838  	if err != nil {
  1839  		return nil, err
  1840  	}
  1841  	c.urlParams_.Set("alt", alt)
  1842  	c.urlParams_.Set("prettyPrint", "false")
  1843  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/triggers")
  1844  	urls += "?" + c.urlParams_.Encode()
  1845  	req, err := http.NewRequest("POST", urls, body)
  1846  	if err != nil {
  1847  		return nil, err
  1848  	}
  1849  	req.Header = reqHeaders
  1850  	googleapi.Expand(req.URL, map[string]string{
  1851  		"parent": c.parent,
  1852  	})
  1853  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1854  }
  1855  
  1856  // Do executes the "eventarc.projects.locations.triggers.create" call.
  1857  // Any non-2xx status code is an error. Response headers are in either
  1858  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  1859  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1860  // whether the returned error was because http.StatusNotModified was returned.
  1861  func (c *ProjectsLocationsTriggersCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1862  	gensupport.SetOptions(c.urlParams_, opts...)
  1863  	res, err := c.doRequest("json")
  1864  	if res != nil && res.StatusCode == http.StatusNotModified {
  1865  		if res.Body != nil {
  1866  			res.Body.Close()
  1867  		}
  1868  		return nil, gensupport.WrapError(&googleapi.Error{
  1869  			Code:   res.StatusCode,
  1870  			Header: res.Header,
  1871  		})
  1872  	}
  1873  	if err != nil {
  1874  		return nil, err
  1875  	}
  1876  	defer googleapi.CloseBody(res)
  1877  	if err := googleapi.CheckResponse(res); err != nil {
  1878  		return nil, gensupport.WrapError(err)
  1879  	}
  1880  	ret := &Operation{
  1881  		ServerResponse: googleapi.ServerResponse{
  1882  			Header:         res.Header,
  1883  			HTTPStatusCode: res.StatusCode,
  1884  		},
  1885  	}
  1886  	target := &ret
  1887  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1888  		return nil, err
  1889  	}
  1890  	return ret, nil
  1891  }
  1892  
  1893  type ProjectsLocationsTriggersDeleteCall struct {
  1894  	s          *Service
  1895  	name       string
  1896  	urlParams_ gensupport.URLParams
  1897  	ctx_       context.Context
  1898  	header_    http.Header
  1899  }
  1900  
  1901  // Delete: Delete a single trigger.
  1902  //
  1903  // - name: The name of the trigger to be deleted.
  1904  func (r *ProjectsLocationsTriggersService) Delete(name string) *ProjectsLocationsTriggersDeleteCall {
  1905  	c := &ProjectsLocationsTriggersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1906  	c.name = name
  1907  	return c
  1908  }
  1909  
  1910  // AllowMissing sets the optional parameter "allowMissing": If set to true, and
  1911  // the trigger is not found, the request will succeed but no action will be
  1912  // taken on the server.
  1913  func (c *ProjectsLocationsTriggersDeleteCall) AllowMissing(allowMissing bool) *ProjectsLocationsTriggersDeleteCall {
  1914  	c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing))
  1915  	return c
  1916  }
  1917  
  1918  // Etag sets the optional parameter "etag": If provided, the trigger will only
  1919  // be deleted if the etag matches the current etag on the resource.
  1920  func (c *ProjectsLocationsTriggersDeleteCall) Etag(etag string) *ProjectsLocationsTriggersDeleteCall {
  1921  	c.urlParams_.Set("etag", etag)
  1922  	return c
  1923  }
  1924  
  1925  // ValidateOnly sets the optional parameter "validateOnly": Required. If set,
  1926  // validate the request and preview the review, but do not actually post it.
  1927  func (c *ProjectsLocationsTriggersDeleteCall) ValidateOnly(validateOnly bool) *ProjectsLocationsTriggersDeleteCall {
  1928  	c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  1929  	return c
  1930  }
  1931  
  1932  // Fields allows partial responses to be retrieved. See
  1933  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1934  // details.
  1935  func (c *ProjectsLocationsTriggersDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsTriggersDeleteCall {
  1936  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1937  	return c
  1938  }
  1939  
  1940  // Context sets the context to be used in this call's Do method.
  1941  func (c *ProjectsLocationsTriggersDeleteCall) Context(ctx context.Context) *ProjectsLocationsTriggersDeleteCall {
  1942  	c.ctx_ = ctx
  1943  	return c
  1944  }
  1945  
  1946  // Header returns a http.Header that can be modified by the caller to add
  1947  // headers to the request.
  1948  func (c *ProjectsLocationsTriggersDeleteCall) Header() http.Header {
  1949  	if c.header_ == nil {
  1950  		c.header_ = make(http.Header)
  1951  	}
  1952  	return c.header_
  1953  }
  1954  
  1955  func (c *ProjectsLocationsTriggersDeleteCall) doRequest(alt string) (*http.Response, error) {
  1956  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1957  	var body io.Reader = nil
  1958  	c.urlParams_.Set("alt", alt)
  1959  	c.urlParams_.Set("prettyPrint", "false")
  1960  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1961  	urls += "?" + c.urlParams_.Encode()
  1962  	req, err := http.NewRequest("DELETE", urls, body)
  1963  	if err != nil {
  1964  		return nil, err
  1965  	}
  1966  	req.Header = reqHeaders
  1967  	googleapi.Expand(req.URL, map[string]string{
  1968  		"name": c.name,
  1969  	})
  1970  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1971  }
  1972  
  1973  // Do executes the "eventarc.projects.locations.triggers.delete" call.
  1974  // Any non-2xx status code is an error. Response headers are in either
  1975  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  1976  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1977  // whether the returned error was because http.StatusNotModified was returned.
  1978  func (c *ProjectsLocationsTriggersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1979  	gensupport.SetOptions(c.urlParams_, opts...)
  1980  	res, err := c.doRequest("json")
  1981  	if res != nil && res.StatusCode == http.StatusNotModified {
  1982  		if res.Body != nil {
  1983  			res.Body.Close()
  1984  		}
  1985  		return nil, gensupport.WrapError(&googleapi.Error{
  1986  			Code:   res.StatusCode,
  1987  			Header: res.Header,
  1988  		})
  1989  	}
  1990  	if err != nil {
  1991  		return nil, err
  1992  	}
  1993  	defer googleapi.CloseBody(res)
  1994  	if err := googleapi.CheckResponse(res); err != nil {
  1995  		return nil, gensupport.WrapError(err)
  1996  	}
  1997  	ret := &Operation{
  1998  		ServerResponse: googleapi.ServerResponse{
  1999  			Header:         res.Header,
  2000  			HTTPStatusCode: res.StatusCode,
  2001  		},
  2002  	}
  2003  	target := &ret
  2004  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2005  		return nil, err
  2006  	}
  2007  	return ret, nil
  2008  }
  2009  
  2010  type ProjectsLocationsTriggersGetCall struct {
  2011  	s            *Service
  2012  	name         string
  2013  	urlParams_   gensupport.URLParams
  2014  	ifNoneMatch_ string
  2015  	ctx_         context.Context
  2016  	header_      http.Header
  2017  }
  2018  
  2019  // Get: Get a single trigger.
  2020  //
  2021  // - name: The name of the trigger to get.
  2022  func (r *ProjectsLocationsTriggersService) Get(name string) *ProjectsLocationsTriggersGetCall {
  2023  	c := &ProjectsLocationsTriggersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2024  	c.name = name
  2025  	return c
  2026  }
  2027  
  2028  // Fields allows partial responses to be retrieved. See
  2029  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2030  // details.
  2031  func (c *ProjectsLocationsTriggersGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsTriggersGetCall {
  2032  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2033  	return c
  2034  }
  2035  
  2036  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2037  // object's ETag matches the given value. This is useful for getting updates
  2038  // only after the object has changed since the last request.
  2039  func (c *ProjectsLocationsTriggersGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsTriggersGetCall {
  2040  	c.ifNoneMatch_ = entityTag
  2041  	return c
  2042  }
  2043  
  2044  // Context sets the context to be used in this call's Do method.
  2045  func (c *ProjectsLocationsTriggersGetCall) Context(ctx context.Context) *ProjectsLocationsTriggersGetCall {
  2046  	c.ctx_ = ctx
  2047  	return c
  2048  }
  2049  
  2050  // Header returns a http.Header that can be modified by the caller to add
  2051  // headers to the request.
  2052  func (c *ProjectsLocationsTriggersGetCall) Header() http.Header {
  2053  	if c.header_ == nil {
  2054  		c.header_ = make(http.Header)
  2055  	}
  2056  	return c.header_
  2057  }
  2058  
  2059  func (c *ProjectsLocationsTriggersGetCall) doRequest(alt string) (*http.Response, error) {
  2060  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2061  	if c.ifNoneMatch_ != "" {
  2062  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2063  	}
  2064  	var body io.Reader = nil
  2065  	c.urlParams_.Set("alt", alt)
  2066  	c.urlParams_.Set("prettyPrint", "false")
  2067  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  2068  	urls += "?" + c.urlParams_.Encode()
  2069  	req, err := http.NewRequest("GET", urls, body)
  2070  	if err != nil {
  2071  		return nil, err
  2072  	}
  2073  	req.Header = reqHeaders
  2074  	googleapi.Expand(req.URL, map[string]string{
  2075  		"name": c.name,
  2076  	})
  2077  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2078  }
  2079  
  2080  // Do executes the "eventarc.projects.locations.triggers.get" call.
  2081  // Any non-2xx status code is an error. Response headers are in either
  2082  // *Trigger.ServerResponse.Header or (if a response was returned at all) in
  2083  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2084  // whether the returned error was because http.StatusNotModified was returned.
  2085  func (c *ProjectsLocationsTriggersGetCall) Do(opts ...googleapi.CallOption) (*Trigger, error) {
  2086  	gensupport.SetOptions(c.urlParams_, opts...)
  2087  	res, err := c.doRequest("json")
  2088  	if res != nil && res.StatusCode == http.StatusNotModified {
  2089  		if res.Body != nil {
  2090  			res.Body.Close()
  2091  		}
  2092  		return nil, gensupport.WrapError(&googleapi.Error{
  2093  			Code:   res.StatusCode,
  2094  			Header: res.Header,
  2095  		})
  2096  	}
  2097  	if err != nil {
  2098  		return nil, err
  2099  	}
  2100  	defer googleapi.CloseBody(res)
  2101  	if err := googleapi.CheckResponse(res); err != nil {
  2102  		return nil, gensupport.WrapError(err)
  2103  	}
  2104  	ret := &Trigger{
  2105  		ServerResponse: googleapi.ServerResponse{
  2106  			Header:         res.Header,
  2107  			HTTPStatusCode: res.StatusCode,
  2108  		},
  2109  	}
  2110  	target := &ret
  2111  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2112  		return nil, err
  2113  	}
  2114  	return ret, nil
  2115  }
  2116  
  2117  type ProjectsLocationsTriggersGetIamPolicyCall struct {
  2118  	s            *Service
  2119  	resource     string
  2120  	urlParams_   gensupport.URLParams
  2121  	ifNoneMatch_ string
  2122  	ctx_         context.Context
  2123  	header_      http.Header
  2124  }
  2125  
  2126  // GetIamPolicy: Gets the access control policy for a resource. Returns an
  2127  // empty policy if the resource exists and does not have a policy set.
  2128  //
  2129  //   - resource: REQUIRED: The resource for which the policy is being requested.
  2130  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  2131  //     for the appropriate value for this field.
  2132  func (r *ProjectsLocationsTriggersService) GetIamPolicy(resource string) *ProjectsLocationsTriggersGetIamPolicyCall {
  2133  	c := &ProjectsLocationsTriggersGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2134  	c.resource = resource
  2135  	return c
  2136  }
  2137  
  2138  // OptionsRequestedPolicyVersion sets the optional parameter
  2139  // "options.requestedPolicyVersion": The maximum policy version that will be
  2140  // used to format the policy. Valid values are 0, 1, and 3. Requests specifying
  2141  // an invalid value will be rejected. Requests for policies with any
  2142  // conditional role bindings must specify version 3. Policies with no
  2143  // conditional role bindings may specify any valid value or leave the field
  2144  // unset. The policy in the response might use the policy version that you
  2145  // specified, or it might use a lower policy version. For example, if you
  2146  // specify version 3, but the policy has no conditional role bindings, the
  2147  // response uses version 1. To learn which resources support conditions in
  2148  // their IAM policies, see the IAM documentation
  2149  // (https://cloud.google.com/iam/help/conditions/resource-policies).
  2150  func (c *ProjectsLocationsTriggersGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsTriggersGetIamPolicyCall {
  2151  	c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
  2152  	return c
  2153  }
  2154  
  2155  // Fields allows partial responses to be retrieved. See
  2156  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2157  // details.
  2158  func (c *ProjectsLocationsTriggersGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsTriggersGetIamPolicyCall {
  2159  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2160  	return c
  2161  }
  2162  
  2163  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2164  // object's ETag matches the given value. This is useful for getting updates
  2165  // only after the object has changed since the last request.
  2166  func (c *ProjectsLocationsTriggersGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsTriggersGetIamPolicyCall {
  2167  	c.ifNoneMatch_ = entityTag
  2168  	return c
  2169  }
  2170  
  2171  // Context sets the context to be used in this call's Do method.
  2172  func (c *ProjectsLocationsTriggersGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsTriggersGetIamPolicyCall {
  2173  	c.ctx_ = ctx
  2174  	return c
  2175  }
  2176  
  2177  // Header returns a http.Header that can be modified by the caller to add
  2178  // headers to the request.
  2179  func (c *ProjectsLocationsTriggersGetIamPolicyCall) Header() http.Header {
  2180  	if c.header_ == nil {
  2181  		c.header_ = make(http.Header)
  2182  	}
  2183  	return c.header_
  2184  }
  2185  
  2186  func (c *ProjectsLocationsTriggersGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  2187  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2188  	if c.ifNoneMatch_ != "" {
  2189  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2190  	}
  2191  	var body io.Reader = nil
  2192  	c.urlParams_.Set("alt", alt)
  2193  	c.urlParams_.Set("prettyPrint", "false")
  2194  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy")
  2195  	urls += "?" + c.urlParams_.Encode()
  2196  	req, err := http.NewRequest("GET", urls, body)
  2197  	if err != nil {
  2198  		return nil, err
  2199  	}
  2200  	req.Header = reqHeaders
  2201  	googleapi.Expand(req.URL, map[string]string{
  2202  		"resource": c.resource,
  2203  	})
  2204  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2205  }
  2206  
  2207  // Do executes the "eventarc.projects.locations.triggers.getIamPolicy" call.
  2208  // Any non-2xx status code is an error. Response headers are in either
  2209  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  2210  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2211  // whether the returned error was because http.StatusNotModified was returned.
  2212  func (c *ProjectsLocationsTriggersGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  2213  	gensupport.SetOptions(c.urlParams_, opts...)
  2214  	res, err := c.doRequest("json")
  2215  	if res != nil && res.StatusCode == http.StatusNotModified {
  2216  		if res.Body != nil {
  2217  			res.Body.Close()
  2218  		}
  2219  		return nil, gensupport.WrapError(&googleapi.Error{
  2220  			Code:   res.StatusCode,
  2221  			Header: res.Header,
  2222  		})
  2223  	}
  2224  	if err != nil {
  2225  		return nil, err
  2226  	}
  2227  	defer googleapi.CloseBody(res)
  2228  	if err := googleapi.CheckResponse(res); err != nil {
  2229  		return nil, gensupport.WrapError(err)
  2230  	}
  2231  	ret := &Policy{
  2232  		ServerResponse: googleapi.ServerResponse{
  2233  			Header:         res.Header,
  2234  			HTTPStatusCode: res.StatusCode,
  2235  		},
  2236  	}
  2237  	target := &ret
  2238  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2239  		return nil, err
  2240  	}
  2241  	return ret, nil
  2242  }
  2243  
  2244  type ProjectsLocationsTriggersListCall struct {
  2245  	s            *Service
  2246  	parent       string
  2247  	urlParams_   gensupport.URLParams
  2248  	ifNoneMatch_ string
  2249  	ctx_         context.Context
  2250  	header_      http.Header
  2251  }
  2252  
  2253  // List: List triggers.
  2254  //
  2255  // - parent: The parent collection to list triggers on.
  2256  func (r *ProjectsLocationsTriggersService) List(parent string) *ProjectsLocationsTriggersListCall {
  2257  	c := &ProjectsLocationsTriggersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2258  	c.parent = parent
  2259  	return c
  2260  }
  2261  
  2262  // OrderBy sets the optional parameter "orderBy": The sorting order of the
  2263  // resources returned. Value should be a comma separated list of fields. The
  2264  // default sorting oder is ascending. To specify descending order for a field,
  2265  // append a ` desc` suffix; for example: `name desc, trigger_id`.
  2266  func (c *ProjectsLocationsTriggersListCall) OrderBy(orderBy string) *ProjectsLocationsTriggersListCall {
  2267  	c.urlParams_.Set("orderBy", orderBy)
  2268  	return c
  2269  }
  2270  
  2271  // PageSize sets the optional parameter "pageSize": The maximum number of
  2272  // triggers to return on each page. Note: The service may send fewer.
  2273  func (c *ProjectsLocationsTriggersListCall) PageSize(pageSize int64) *ProjectsLocationsTriggersListCall {
  2274  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2275  	return c
  2276  }
  2277  
  2278  // PageToken sets the optional parameter "pageToken": The page token; provide
  2279  // the value from the `next_page_token` field in a previous `ListTriggers` call
  2280  // to retrieve the subsequent page. When paginating, all other parameters
  2281  // provided to `ListTriggers` must match the call that provided the page token.
  2282  func (c *ProjectsLocationsTriggersListCall) PageToken(pageToken string) *ProjectsLocationsTriggersListCall {
  2283  	c.urlParams_.Set("pageToken", pageToken)
  2284  	return c
  2285  }
  2286  
  2287  // Fields allows partial responses to be retrieved. See
  2288  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2289  // details.
  2290  func (c *ProjectsLocationsTriggersListCall) Fields(s ...googleapi.Field) *ProjectsLocationsTriggersListCall {
  2291  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2292  	return c
  2293  }
  2294  
  2295  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2296  // object's ETag matches the given value. This is useful for getting updates
  2297  // only after the object has changed since the last request.
  2298  func (c *ProjectsLocationsTriggersListCall) IfNoneMatch(entityTag string) *ProjectsLocationsTriggersListCall {
  2299  	c.ifNoneMatch_ = entityTag
  2300  	return c
  2301  }
  2302  
  2303  // Context sets the context to be used in this call's Do method.
  2304  func (c *ProjectsLocationsTriggersListCall) Context(ctx context.Context) *ProjectsLocationsTriggersListCall {
  2305  	c.ctx_ = ctx
  2306  	return c
  2307  }
  2308  
  2309  // Header returns a http.Header that can be modified by the caller to add
  2310  // headers to the request.
  2311  func (c *ProjectsLocationsTriggersListCall) Header() http.Header {
  2312  	if c.header_ == nil {
  2313  		c.header_ = make(http.Header)
  2314  	}
  2315  	return c.header_
  2316  }
  2317  
  2318  func (c *ProjectsLocationsTriggersListCall) doRequest(alt string) (*http.Response, error) {
  2319  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2320  	if c.ifNoneMatch_ != "" {
  2321  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2322  	}
  2323  	var body io.Reader = nil
  2324  	c.urlParams_.Set("alt", alt)
  2325  	c.urlParams_.Set("prettyPrint", "false")
  2326  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/triggers")
  2327  	urls += "?" + c.urlParams_.Encode()
  2328  	req, err := http.NewRequest("GET", urls, body)
  2329  	if err != nil {
  2330  		return nil, err
  2331  	}
  2332  	req.Header = reqHeaders
  2333  	googleapi.Expand(req.URL, map[string]string{
  2334  		"parent": c.parent,
  2335  	})
  2336  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2337  }
  2338  
  2339  // Do executes the "eventarc.projects.locations.triggers.list" call.
  2340  // Any non-2xx status code is an error. Response headers are in either
  2341  // *ListTriggersResponse.ServerResponse.Header or (if a response was returned
  2342  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2343  // check whether the returned error was because http.StatusNotModified was
  2344  // returned.
  2345  func (c *ProjectsLocationsTriggersListCall) Do(opts ...googleapi.CallOption) (*ListTriggersResponse, error) {
  2346  	gensupport.SetOptions(c.urlParams_, opts...)
  2347  	res, err := c.doRequest("json")
  2348  	if res != nil && res.StatusCode == http.StatusNotModified {
  2349  		if res.Body != nil {
  2350  			res.Body.Close()
  2351  		}
  2352  		return nil, gensupport.WrapError(&googleapi.Error{
  2353  			Code:   res.StatusCode,
  2354  			Header: res.Header,
  2355  		})
  2356  	}
  2357  	if err != nil {
  2358  		return nil, err
  2359  	}
  2360  	defer googleapi.CloseBody(res)
  2361  	if err := googleapi.CheckResponse(res); err != nil {
  2362  		return nil, gensupport.WrapError(err)
  2363  	}
  2364  	ret := &ListTriggersResponse{
  2365  		ServerResponse: googleapi.ServerResponse{
  2366  			Header:         res.Header,
  2367  			HTTPStatusCode: res.StatusCode,
  2368  		},
  2369  	}
  2370  	target := &ret
  2371  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2372  		return nil, err
  2373  	}
  2374  	return ret, nil
  2375  }
  2376  
  2377  // Pages invokes f for each page of results.
  2378  // A non-nil error returned from f will halt the iteration.
  2379  // The provided context supersedes any context provided to the Context method.
  2380  func (c *ProjectsLocationsTriggersListCall) Pages(ctx context.Context, f func(*ListTriggersResponse) error) error {
  2381  	c.ctx_ = ctx
  2382  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  2383  	for {
  2384  		x, err := c.Do()
  2385  		if err != nil {
  2386  			return err
  2387  		}
  2388  		if err := f(x); err != nil {
  2389  			return err
  2390  		}
  2391  		if x.NextPageToken == "" {
  2392  			return nil
  2393  		}
  2394  		c.PageToken(x.NextPageToken)
  2395  	}
  2396  }
  2397  
  2398  type ProjectsLocationsTriggersPatchCall struct {
  2399  	s          *Service
  2400  	name       string
  2401  	trigger    *Trigger
  2402  	urlParams_ gensupport.URLParams
  2403  	ctx_       context.Context
  2404  	header_    http.Header
  2405  }
  2406  
  2407  // Patch: Update a single trigger.
  2408  //
  2409  //   - name: The resource name of the trigger. Must be unique within the location
  2410  //     on the project and must in
  2411  //     `projects/{project}/locations/{location}/triggers/{trigger}` format.
  2412  func (r *ProjectsLocationsTriggersService) Patch(name string, trigger *Trigger) *ProjectsLocationsTriggersPatchCall {
  2413  	c := &ProjectsLocationsTriggersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2414  	c.name = name
  2415  	c.trigger = trigger
  2416  	return c
  2417  }
  2418  
  2419  // AllowMissing sets the optional parameter "allowMissing": If set to true, and
  2420  // the trigger is not found, a new trigger will be created. In this situation,
  2421  // `update_mask` is ignored.
  2422  func (c *ProjectsLocationsTriggersPatchCall) AllowMissing(allowMissing bool) *ProjectsLocationsTriggersPatchCall {
  2423  	c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing))
  2424  	return c
  2425  }
  2426  
  2427  // UpdateMask sets the optional parameter "updateMask": The fields to be
  2428  // updated; only fields explicitly provided will be updated. If no field mask
  2429  // is provided, all provided fields in the request will be updated. To update
  2430  // all fields, provide a field mask of "*".
  2431  func (c *ProjectsLocationsTriggersPatchCall) UpdateMask(updateMask string) *ProjectsLocationsTriggersPatchCall {
  2432  	c.urlParams_.Set("updateMask", updateMask)
  2433  	return c
  2434  }
  2435  
  2436  // ValidateOnly sets the optional parameter "validateOnly": Required. If set,
  2437  // validate the request and preview the review, but do not actually post it.
  2438  func (c *ProjectsLocationsTriggersPatchCall) ValidateOnly(validateOnly bool) *ProjectsLocationsTriggersPatchCall {
  2439  	c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  2440  	return c
  2441  }
  2442  
  2443  // Fields allows partial responses to be retrieved. See
  2444  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2445  // details.
  2446  func (c *ProjectsLocationsTriggersPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsTriggersPatchCall {
  2447  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2448  	return c
  2449  }
  2450  
  2451  // Context sets the context to be used in this call's Do method.
  2452  func (c *ProjectsLocationsTriggersPatchCall) Context(ctx context.Context) *ProjectsLocationsTriggersPatchCall {
  2453  	c.ctx_ = ctx
  2454  	return c
  2455  }
  2456  
  2457  // Header returns a http.Header that can be modified by the caller to add
  2458  // headers to the request.
  2459  func (c *ProjectsLocationsTriggersPatchCall) Header() http.Header {
  2460  	if c.header_ == nil {
  2461  		c.header_ = make(http.Header)
  2462  	}
  2463  	return c.header_
  2464  }
  2465  
  2466  func (c *ProjectsLocationsTriggersPatchCall) doRequest(alt string) (*http.Response, error) {
  2467  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2468  	var body io.Reader = nil
  2469  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.trigger)
  2470  	if err != nil {
  2471  		return nil, err
  2472  	}
  2473  	c.urlParams_.Set("alt", alt)
  2474  	c.urlParams_.Set("prettyPrint", "false")
  2475  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  2476  	urls += "?" + c.urlParams_.Encode()
  2477  	req, err := http.NewRequest("PATCH", urls, body)
  2478  	if err != nil {
  2479  		return nil, err
  2480  	}
  2481  	req.Header = reqHeaders
  2482  	googleapi.Expand(req.URL, map[string]string{
  2483  		"name": c.name,
  2484  	})
  2485  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2486  }
  2487  
  2488  // Do executes the "eventarc.projects.locations.triggers.patch" call.
  2489  // Any non-2xx status code is an error. Response headers are in either
  2490  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  2491  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2492  // whether the returned error was because http.StatusNotModified was returned.
  2493  func (c *ProjectsLocationsTriggersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2494  	gensupport.SetOptions(c.urlParams_, opts...)
  2495  	res, err := c.doRequest("json")
  2496  	if res != nil && res.StatusCode == http.StatusNotModified {
  2497  		if res.Body != nil {
  2498  			res.Body.Close()
  2499  		}
  2500  		return nil, gensupport.WrapError(&googleapi.Error{
  2501  			Code:   res.StatusCode,
  2502  			Header: res.Header,
  2503  		})
  2504  	}
  2505  	if err != nil {
  2506  		return nil, err
  2507  	}
  2508  	defer googleapi.CloseBody(res)
  2509  	if err := googleapi.CheckResponse(res); err != nil {
  2510  		return nil, gensupport.WrapError(err)
  2511  	}
  2512  	ret := &Operation{
  2513  		ServerResponse: googleapi.ServerResponse{
  2514  			Header:         res.Header,
  2515  			HTTPStatusCode: res.StatusCode,
  2516  		},
  2517  	}
  2518  	target := &ret
  2519  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2520  		return nil, err
  2521  	}
  2522  	return ret, nil
  2523  }
  2524  
  2525  type ProjectsLocationsTriggersSetIamPolicyCall struct {
  2526  	s                   *Service
  2527  	resource            string
  2528  	setiampolicyrequest *SetIamPolicyRequest
  2529  	urlParams_          gensupport.URLParams
  2530  	ctx_                context.Context
  2531  	header_             http.Header
  2532  }
  2533  
  2534  // SetIamPolicy: Sets the access control policy on the specified resource.
  2535  // Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
  2536  // and `PERMISSION_DENIED` errors.
  2537  //
  2538  //   - resource: REQUIRED: The resource for which the policy is being specified.
  2539  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  2540  //     for the appropriate value for this field.
  2541  func (r *ProjectsLocationsTriggersService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsTriggersSetIamPolicyCall {
  2542  	c := &ProjectsLocationsTriggersSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2543  	c.resource = resource
  2544  	c.setiampolicyrequest = setiampolicyrequest
  2545  	return c
  2546  }
  2547  
  2548  // Fields allows partial responses to be retrieved. See
  2549  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2550  // details.
  2551  func (c *ProjectsLocationsTriggersSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsTriggersSetIamPolicyCall {
  2552  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2553  	return c
  2554  }
  2555  
  2556  // Context sets the context to be used in this call's Do method.
  2557  func (c *ProjectsLocationsTriggersSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsTriggersSetIamPolicyCall {
  2558  	c.ctx_ = ctx
  2559  	return c
  2560  }
  2561  
  2562  // Header returns a http.Header that can be modified by the caller to add
  2563  // headers to the request.
  2564  func (c *ProjectsLocationsTriggersSetIamPolicyCall) Header() http.Header {
  2565  	if c.header_ == nil {
  2566  		c.header_ = make(http.Header)
  2567  	}
  2568  	return c.header_
  2569  }
  2570  
  2571  func (c *ProjectsLocationsTriggersSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  2572  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2573  	var body io.Reader = nil
  2574  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  2575  	if err != nil {
  2576  		return nil, err
  2577  	}
  2578  	c.urlParams_.Set("alt", alt)
  2579  	c.urlParams_.Set("prettyPrint", "false")
  2580  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:setIamPolicy")
  2581  	urls += "?" + c.urlParams_.Encode()
  2582  	req, err := http.NewRequest("POST", urls, body)
  2583  	if err != nil {
  2584  		return nil, err
  2585  	}
  2586  	req.Header = reqHeaders
  2587  	googleapi.Expand(req.URL, map[string]string{
  2588  		"resource": c.resource,
  2589  	})
  2590  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2591  }
  2592  
  2593  // Do executes the "eventarc.projects.locations.triggers.setIamPolicy" call.
  2594  // Any non-2xx status code is an error. Response headers are in either
  2595  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  2596  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2597  // whether the returned error was because http.StatusNotModified was returned.
  2598  func (c *ProjectsLocationsTriggersSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  2599  	gensupport.SetOptions(c.urlParams_, opts...)
  2600  	res, err := c.doRequest("json")
  2601  	if res != nil && res.StatusCode == http.StatusNotModified {
  2602  		if res.Body != nil {
  2603  			res.Body.Close()
  2604  		}
  2605  		return nil, gensupport.WrapError(&googleapi.Error{
  2606  			Code:   res.StatusCode,
  2607  			Header: res.Header,
  2608  		})
  2609  	}
  2610  	if err != nil {
  2611  		return nil, err
  2612  	}
  2613  	defer googleapi.CloseBody(res)
  2614  	if err := googleapi.CheckResponse(res); err != nil {
  2615  		return nil, gensupport.WrapError(err)
  2616  	}
  2617  	ret := &Policy{
  2618  		ServerResponse: googleapi.ServerResponse{
  2619  			Header:         res.Header,
  2620  			HTTPStatusCode: res.StatusCode,
  2621  		},
  2622  	}
  2623  	target := &ret
  2624  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2625  		return nil, err
  2626  	}
  2627  	return ret, nil
  2628  }
  2629  
  2630  type ProjectsLocationsTriggersTestIamPermissionsCall struct {
  2631  	s                         *Service
  2632  	resource                  string
  2633  	testiampermissionsrequest *TestIamPermissionsRequest
  2634  	urlParams_                gensupport.URLParams
  2635  	ctx_                      context.Context
  2636  	header_                   http.Header
  2637  }
  2638  
  2639  // TestIamPermissions: Returns permissions that a caller has on the specified
  2640  // resource. If the resource does not exist, this will return an empty set of
  2641  // permissions, not a `NOT_FOUND` error. Note: This operation is designed to be
  2642  // used for building permission-aware UIs and command-line tools, not for
  2643  // authorization checking. This operation may "fail open" without warning.
  2644  //
  2645  //   - resource: REQUIRED: The resource for which the policy detail is being
  2646  //     requested. See Resource names
  2647  //     (https://cloud.google.com/apis/design/resource_names) for the appropriate
  2648  //     value for this field.
  2649  func (r *ProjectsLocationsTriggersService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsTriggersTestIamPermissionsCall {
  2650  	c := &ProjectsLocationsTriggersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2651  	c.resource = resource
  2652  	c.testiampermissionsrequest = testiampermissionsrequest
  2653  	return c
  2654  }
  2655  
  2656  // Fields allows partial responses to be retrieved. See
  2657  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2658  // details.
  2659  func (c *ProjectsLocationsTriggersTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsTriggersTestIamPermissionsCall {
  2660  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2661  	return c
  2662  }
  2663  
  2664  // Context sets the context to be used in this call's Do method.
  2665  func (c *ProjectsLocationsTriggersTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsTriggersTestIamPermissionsCall {
  2666  	c.ctx_ = ctx
  2667  	return c
  2668  }
  2669  
  2670  // Header returns a http.Header that can be modified by the caller to add
  2671  // headers to the request.
  2672  func (c *ProjectsLocationsTriggersTestIamPermissionsCall) Header() http.Header {
  2673  	if c.header_ == nil {
  2674  		c.header_ = make(http.Header)
  2675  	}
  2676  	return c.header_
  2677  }
  2678  
  2679  func (c *ProjectsLocationsTriggersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  2680  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2681  	var body io.Reader = nil
  2682  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  2683  	if err != nil {
  2684  		return nil, err
  2685  	}
  2686  	c.urlParams_.Set("alt", alt)
  2687  	c.urlParams_.Set("prettyPrint", "false")
  2688  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions")
  2689  	urls += "?" + c.urlParams_.Encode()
  2690  	req, err := http.NewRequest("POST", urls, body)
  2691  	if err != nil {
  2692  		return nil, err
  2693  	}
  2694  	req.Header = reqHeaders
  2695  	googleapi.Expand(req.URL, map[string]string{
  2696  		"resource": c.resource,
  2697  	})
  2698  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2699  }
  2700  
  2701  // Do executes the "eventarc.projects.locations.triggers.testIamPermissions" call.
  2702  // Any non-2xx status code is an error. Response headers are in either
  2703  // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
  2704  // returned at all) in error.(*googleapi.Error).Header. Use
  2705  // googleapi.IsNotModified to check whether the returned error was because
  2706  // http.StatusNotModified was returned.
  2707  func (c *ProjectsLocationsTriggersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  2708  	gensupport.SetOptions(c.urlParams_, opts...)
  2709  	res, err := c.doRequest("json")
  2710  	if res != nil && res.StatusCode == http.StatusNotModified {
  2711  		if res.Body != nil {
  2712  			res.Body.Close()
  2713  		}
  2714  		return nil, gensupport.WrapError(&googleapi.Error{
  2715  			Code:   res.StatusCode,
  2716  			Header: res.Header,
  2717  		})
  2718  	}
  2719  	if err != nil {
  2720  		return nil, err
  2721  	}
  2722  	defer googleapi.CloseBody(res)
  2723  	if err := googleapi.CheckResponse(res); err != nil {
  2724  		return nil, gensupport.WrapError(err)
  2725  	}
  2726  	ret := &TestIamPermissionsResponse{
  2727  		ServerResponse: googleapi.ServerResponse{
  2728  			Header:         res.Header,
  2729  			HTTPStatusCode: res.StatusCode,
  2730  		},
  2731  	}
  2732  	target := &ret
  2733  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2734  		return nil, err
  2735  	}
  2736  	return ret, nil
  2737  }
  2738  

View as plain text