...

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

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

     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/v1"
    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/v1"
    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:v1"
    90  const apiName = "eventarc"
    91  const apiVersion = "v1"
    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.ChannelConnections = NewProjectsLocationsChannelConnectionsService(s)
   172  	rs.Channels = NewProjectsLocationsChannelsService(s)
   173  	rs.Operations = NewProjectsLocationsOperationsService(s)
   174  	rs.Providers = NewProjectsLocationsProvidersService(s)
   175  	rs.Triggers = NewProjectsLocationsTriggersService(s)
   176  	return rs
   177  }
   178  
   179  type ProjectsLocationsService struct {
   180  	s *Service
   181  
   182  	ChannelConnections *ProjectsLocationsChannelConnectionsService
   183  
   184  	Channels *ProjectsLocationsChannelsService
   185  
   186  	Operations *ProjectsLocationsOperationsService
   187  
   188  	Providers *ProjectsLocationsProvidersService
   189  
   190  	Triggers *ProjectsLocationsTriggersService
   191  }
   192  
   193  func NewProjectsLocationsChannelConnectionsService(s *Service) *ProjectsLocationsChannelConnectionsService {
   194  	rs := &ProjectsLocationsChannelConnectionsService{s: s}
   195  	return rs
   196  }
   197  
   198  type ProjectsLocationsChannelConnectionsService struct {
   199  	s *Service
   200  }
   201  
   202  func NewProjectsLocationsChannelsService(s *Service) *ProjectsLocationsChannelsService {
   203  	rs := &ProjectsLocationsChannelsService{s: s}
   204  	return rs
   205  }
   206  
   207  type ProjectsLocationsChannelsService struct {
   208  	s *Service
   209  }
   210  
   211  func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
   212  	rs := &ProjectsLocationsOperationsService{s: s}
   213  	return rs
   214  }
   215  
   216  type ProjectsLocationsOperationsService struct {
   217  	s *Service
   218  }
   219  
   220  func NewProjectsLocationsProvidersService(s *Service) *ProjectsLocationsProvidersService {
   221  	rs := &ProjectsLocationsProvidersService{s: s}
   222  	return rs
   223  }
   224  
   225  type ProjectsLocationsProvidersService struct {
   226  	s *Service
   227  }
   228  
   229  func NewProjectsLocationsTriggersService(s *Service) *ProjectsLocationsTriggersService {
   230  	rs := &ProjectsLocationsTriggersService{s: s}
   231  	return rs
   232  }
   233  
   234  type ProjectsLocationsTriggersService struct {
   235  	s *Service
   236  }
   237  
   238  // AuditConfig: Specifies the audit configuration for a service. The
   239  // configuration determines which permission types are logged, and what
   240  // identities, if any, are exempted from logging. An AuditConfig must have one
   241  // or more AuditLogConfigs. If there are AuditConfigs for both `allServices`
   242  // and a specific service, the union of the two AuditConfigs is used for that
   243  // service: the log_types specified in each AuditConfig are enabled, and the
   244  // exempted_members in each AuditLogConfig are exempted. Example Policy with
   245  // multiple AuditConfigs: { "audit_configs": [ { "service": "allServices",
   246  // "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [
   247  // "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { "log_type":
   248  // "ADMIN_READ" } ] }, { "service": "sampleservice.googleapis.com",
   249  // "audit_log_configs": [ { "log_type": "DATA_READ" }, { "log_type":
   250  // "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] } For
   251  // sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ
   252  // logging. It also exempts `jose@example.com` from DATA_READ logging, and
   253  // `aliya@example.com` from DATA_WRITE logging.
   254  type AuditConfig struct {
   255  	// AuditLogConfigs: The configuration for logging of each type of permission.
   256  	AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
   257  	// Service: Specifies a service that will be enabled for audit logging. For
   258  	// example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices`
   259  	// is a special value that covers all services.
   260  	Service string `json:"service,omitempty"`
   261  	// ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to
   262  	// unconditionally include in API requests. By default, fields with empty or
   263  	// default values are omitted from API requests. See
   264  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   265  	// details.
   266  	ForceSendFields []string `json:"-"`
   267  	// NullFields is a list of field names (e.g. "AuditLogConfigs") to include in
   268  	// API requests with the JSON null value. By default, fields with empty values
   269  	// are omitted from API requests. See
   270  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   271  	NullFields []string `json:"-"`
   272  }
   273  
   274  func (s *AuditConfig) MarshalJSON() ([]byte, error) {
   275  	type NoMethod AuditConfig
   276  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   277  }
   278  
   279  // AuditLogConfig: Provides the configuration for logging a type of
   280  // permissions. Example: { "audit_log_configs": [ { "log_type": "DATA_READ",
   281  // "exempted_members": [ "user:jose@example.com" ] }, { "log_type":
   282  // "DATA_WRITE" } ] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while
   283  // exempting jose@example.com from DATA_READ logging.
   284  type AuditLogConfig struct {
   285  	// ExemptedMembers: Specifies the identities that do not cause logging for this
   286  	// type of permission. Follows the same format of Binding.members.
   287  	ExemptedMembers []string `json:"exemptedMembers,omitempty"`
   288  	// LogType: The log type that this config enables.
   289  	//
   290  	// Possible values:
   291  	//   "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this.
   292  	//   "ADMIN_READ" - Admin reads. Example: CloudIAM getIamPolicy
   293  	//   "DATA_WRITE" - Data writes. Example: CloudSQL Users create
   294  	//   "DATA_READ" - Data reads. Example: CloudSQL Users list
   295  	LogType string `json:"logType,omitempty"`
   296  	// ForceSendFields is a list of field names (e.g. "ExemptedMembers") to
   297  	// unconditionally include in API requests. By default, fields with empty or
   298  	// default values are omitted from API requests. See
   299  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   300  	// details.
   301  	ForceSendFields []string `json:"-"`
   302  	// NullFields is a list of field names (e.g. "ExemptedMembers") to include in
   303  	// API requests with the JSON null value. By default, fields with empty values
   304  	// are omitted from API requests. See
   305  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   306  	NullFields []string `json:"-"`
   307  }
   308  
   309  func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
   310  	type NoMethod AuditLogConfig
   311  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   312  }
   313  
   314  // Binding: Associates `members`, or principals, with a `role`.
   315  type Binding struct {
   316  	// Condition: The condition that is associated with this binding. If the
   317  	// condition evaluates to `true`, then this binding applies to the current
   318  	// request. If the condition evaluates to `false`, then this binding does not
   319  	// apply to the current request. However, a different role binding might grant
   320  	// the same role to one or more of the principals in this binding. To learn
   321  	// which resources support conditions in their IAM policies, see the IAM
   322  	// documentation
   323  	// (https://cloud.google.com/iam/help/conditions/resource-policies).
   324  	Condition *Expr `json:"condition,omitempty"`
   325  	// Members: Specifies the principals requesting access for a Google Cloud
   326  	// resource. `members` can have the following values: * `allUsers`: A special
   327  	// identifier that represents anyone who is on the internet; with or without a
   328  	// Google account. * `allAuthenticatedUsers`: A special identifier that
   329  	// represents anyone who is authenticated with a Google account or a service
   330  	// account. Does not include identities that come from external identity
   331  	// providers (IdPs) through identity federation. * `user:{emailid}`: An email
   332  	// address that represents a specific Google account. For example,
   333  	// `alice@example.com` . * `serviceAccount:{emailid}`: An email address that
   334  	// represents a Google service account. For example,
   335  	// `my-other-app@appspot.gserviceaccount.com`. *
   336  	// `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An
   337  	// identifier for a Kubernetes service account
   338  	// (https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts).
   339  	// For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. *
   340  	// `group:{emailid}`: An email address that represents a Google group. For
   341  	// example, `admins@example.com`. * `domain:{domain}`: The G Suite domain
   342  	// (primary) that represents all the users of that domain. For example,
   343  	// `google.com` or `example.com`. *
   344  	// `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/sub
   345  	// ject/{subject_attribute_value}`: A single identity in a workforce identity
   346  	// pool. *
   347  	// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
   348  	// group/{group_id}`: All workforce identities in a group. *
   349  	// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
   350  	// attribute.{attribute_name}/{attribute_value}`: All workforce identities with
   351  	// a specific attribute value. *
   352  	// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
   353  	// *`: All identities in a workforce identity pool. *
   354  	// `principal://iam.googleapis.com/projects/{project_number}/locations/global/wo
   355  	// rkloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: A single
   356  	// identity in a workload identity pool. *
   357  	// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
   358  	// /workloadIdentityPools/{pool_id}/group/{group_id}`: A workload identity pool
   359  	// group. *
   360  	// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
   361  	// /workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}
   362  	// `: All identities in a workload identity pool with a certain attribute. *
   363  	// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
   364  	// /workloadIdentityPools/{pool_id}/*`: All identities in a workload identity
   365  	// pool. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus
   366  	// unique identifier) representing a user that has been recently deleted. For
   367  	// example, `alice@example.com?uid=123456789012345678901`. If the user is
   368  	// recovered, this value reverts to `user:{emailid}` and the recovered user
   369  	// retains the role in the binding. *
   370  	// `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
   371  	// unique identifier) representing a service account that has been recently
   372  	// deleted. For example,
   373  	// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the
   374  	// service account is undeleted, this value reverts to
   375  	// `serviceAccount:{emailid}` and the undeleted service account retains the
   376  	// role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email
   377  	// address (plus unique identifier) representing a Google group that has been
   378  	// recently deleted. For example,
   379  	// `admins@example.com?uid=123456789012345678901`. If the group is recovered,
   380  	// this value reverts to `group:{emailid}` and the recovered group retains the
   381  	// role in the binding. *
   382  	// `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool
   383  	// _id}/subject/{subject_attribute_value}`: Deleted single identity in a
   384  	// workforce identity pool. For example,
   385  	// `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-po
   386  	// ol-id/subject/my-subject-attribute-value`.
   387  	Members []string `json:"members,omitempty"`
   388  	// Role: Role that is assigned to the list of `members`, or principals. For
   389  	// example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview
   390  	// of the IAM roles and permissions, see the IAM documentation
   391  	// (https://cloud.google.com/iam/docs/roles-overview). For a list of the
   392  	// available pre-defined roles, see here
   393  	// (https://cloud.google.com/iam/docs/understanding-roles).
   394  	Role string `json:"role,omitempty"`
   395  	// ForceSendFields is a list of field names (e.g. "Condition") to
   396  	// unconditionally include in API requests. By default, fields with empty or
   397  	// default values are omitted from API requests. See
   398  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   399  	// details.
   400  	ForceSendFields []string `json:"-"`
   401  	// NullFields is a list of field names (e.g. "Condition") to include in API
   402  	// requests with the JSON null value. By default, fields with empty values are
   403  	// omitted from API requests. See
   404  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   405  	NullFields []string `json:"-"`
   406  }
   407  
   408  func (s *Binding) MarshalJSON() ([]byte, error) {
   409  	type NoMethod Binding
   410  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   411  }
   412  
   413  // Channel: A representation of the Channel resource. A Channel is a resource
   414  // on which event providers publish their events. The published events are
   415  // delivered through the transport associated with the channel. Note that a
   416  // channel is associated with exactly one event provider.
   417  type Channel struct {
   418  	// ActivationToken: Output only. The activation token for the channel. The
   419  	// token must be used by the provider to register the channel for publishing.
   420  	ActivationToken string `json:"activationToken,omitempty"`
   421  	// CreateTime: Output only. The creation time.
   422  	CreateTime string `json:"createTime,omitempty"`
   423  	// CryptoKeyName: Resource name of a KMS crypto key (managed by the user) used
   424  	// to encrypt/decrypt their event data. It must match the pattern
   425  	// `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
   426  	CryptoKeyName string `json:"cryptoKeyName,omitempty"`
   427  	// Name: Required. The resource name of the channel. Must be unique within the
   428  	// location on the project and must be in
   429  	// `projects/{project}/locations/{location}/channels/{channel_id}` format.
   430  	Name string `json:"name,omitempty"`
   431  	// Provider: The name of the event provider (e.g. Eventarc SaaS partner)
   432  	// associated with the channel. This provider will be granted permissions to
   433  	// publish events to the channel. Format:
   434  	// `projects/{project}/locations/{location}/providers/{provider_id}`.
   435  	Provider string `json:"provider,omitempty"`
   436  	// PubsubTopic: Output only. The name of the Pub/Sub topic created and managed
   437  	// by Eventarc system as a transport for the event delivery. Format:
   438  	// `projects/{project}/topics/{topic_id}`.
   439  	PubsubTopic string `json:"pubsubTopic,omitempty"`
   440  	// SatisfiesPzs: Output only. Whether or not this Channel satisfies the
   441  	// requirements of physical zone separation
   442  	SatisfiesPzs bool `json:"satisfiesPzs,omitempty"`
   443  	// State: Output only. The state of a Channel.
   444  	//
   445  	// Possible values:
   446  	//   "STATE_UNSPECIFIED" - Default value. This value is unused.
   447  	//   "PENDING" - The PENDING state indicates that a Channel has been created
   448  	// successfully and there is a new activation token available for the
   449  	// subscriber to use to convey the Channel to the provider in order to create a
   450  	// Connection.
   451  	//   "ACTIVE" - The ACTIVE state indicates that a Channel has been successfully
   452  	// connected with the event provider. An ACTIVE Channel is ready to receive and
   453  	// route events from the event provider.
   454  	//   "INACTIVE" - The INACTIVE state indicates that the Channel cannot receive
   455  	// events permanently. There are two possible cases this state can happen: 1.
   456  	// The SaaS provider disconnected from this Channel. 2. The Channel activation
   457  	// token has expired but the SaaS provider wasn't connected. To re-establish a
   458  	// Connection with a provider, the subscriber should create a new Channel and
   459  	// give it to the provider.
   460  	State string `json:"state,omitempty"`
   461  	// Uid: Output only. Server assigned unique identifier for the channel. The
   462  	// value is a UUID4 string and guaranteed to remain unchanged until the
   463  	// resource is deleted.
   464  	Uid string `json:"uid,omitempty"`
   465  	// UpdateTime: Output only. The last-modified time.
   466  	UpdateTime string `json:"updateTime,omitempty"`
   467  
   468  	// ServerResponse contains the HTTP response code and headers from the server.
   469  	googleapi.ServerResponse `json:"-"`
   470  	// ForceSendFields is a list of field names (e.g. "ActivationToken") to
   471  	// unconditionally include in API requests. By default, fields with empty or
   472  	// default values are omitted from API requests. See
   473  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   474  	// details.
   475  	ForceSendFields []string `json:"-"`
   476  	// NullFields is a list of field names (e.g. "ActivationToken") to include in
   477  	// API requests with the JSON null value. By default, fields with empty values
   478  	// are omitted from API requests. See
   479  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   480  	NullFields []string `json:"-"`
   481  }
   482  
   483  func (s *Channel) MarshalJSON() ([]byte, error) {
   484  	type NoMethod Channel
   485  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   486  }
   487  
   488  // ChannelConnection: A representation of the ChannelConnection resource. A
   489  // ChannelConnection is a resource which event providers create during the
   490  // activation process to establish a connection between the provider and the
   491  // subscriber channel.
   492  type ChannelConnection struct {
   493  	// ActivationToken: Input only. Activation token for the channel. The token
   494  	// will be used during the creation of ChannelConnection to bind the channel
   495  	// with the provider project. This field will not be stored in the provider
   496  	// resource.
   497  	ActivationToken string `json:"activationToken,omitempty"`
   498  	// Channel: Required. The name of the connected subscriber Channel. This is a
   499  	// weak reference to avoid cross project and cross accounts references. This
   500  	// must be in `projects/{project}/location/{location}/channels/{channel_id}`
   501  	// format.
   502  	Channel string `json:"channel,omitempty"`
   503  	// CreateTime: Output only. The creation time.
   504  	CreateTime string `json:"createTime,omitempty"`
   505  	// Name: Required. The name of the connection.
   506  	Name string `json:"name,omitempty"`
   507  	// Uid: Output only. Server assigned ID of the resource. The server guarantees
   508  	// uniqueness and immutability until deleted.
   509  	Uid string `json:"uid,omitempty"`
   510  	// UpdateTime: Output only. The last-modified time.
   511  	UpdateTime string `json:"updateTime,omitempty"`
   512  
   513  	// ServerResponse contains the HTTP response code and headers from the server.
   514  	googleapi.ServerResponse `json:"-"`
   515  	// ForceSendFields is a list of field names (e.g. "ActivationToken") to
   516  	// unconditionally include in API requests. By default, fields with empty or
   517  	// default values are omitted from API requests. See
   518  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   519  	// details.
   520  	ForceSendFields []string `json:"-"`
   521  	// NullFields is a list of field names (e.g. "ActivationToken") to include in
   522  	// API requests with the JSON null value. By default, fields with empty values
   523  	// are omitted from API requests. See
   524  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   525  	NullFields []string `json:"-"`
   526  }
   527  
   528  func (s *ChannelConnection) MarshalJSON() ([]byte, error) {
   529  	type NoMethod ChannelConnection
   530  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   531  }
   532  
   533  // CloudRun: Represents a Cloud Run destination.
   534  type CloudRun struct {
   535  	// Path: Optional. The relative path on the Cloud Run service the events should
   536  	// be sent to. The value must conform to the definition of a URI path segment
   537  	// (section 3.3 of RFC2396). Examples: "/route", "route", "route/subroute".
   538  	Path string `json:"path,omitempty"`
   539  	// Region: Required. The region the Cloud Run service is deployed in.
   540  	Region string `json:"region,omitempty"`
   541  	// Service: Required. The name of the Cloud Run service being addressed. See
   542  	// https://cloud.google.com/run/docs/reference/rest/v1/namespaces.services.
   543  	// Only services located in the same project as the trigger object can be
   544  	// addressed.
   545  	Service string `json:"service,omitempty"`
   546  	// ForceSendFields is a list of field names (e.g. "Path") to unconditionally
   547  	// include in API requests. By default, fields with empty or default values are
   548  	// omitted from API requests. See
   549  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   550  	// details.
   551  	ForceSendFields []string `json:"-"`
   552  	// NullFields is a list of field names (e.g. "Path") to include in API requests
   553  	// with the JSON null value. By default, fields with empty values are omitted
   554  	// from API requests. See
   555  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   556  	NullFields []string `json:"-"`
   557  }
   558  
   559  func (s *CloudRun) MarshalJSON() ([]byte, error) {
   560  	type NoMethod CloudRun
   561  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   562  }
   563  
   564  // Destination: Represents a target of an invocation over HTTP.
   565  type Destination struct {
   566  	// CloudFunction: The Cloud Function resource name. Cloud Functions V1 and V2
   567  	// are supported. Format:
   568  	// `projects/{project}/locations/{location}/functions/{function}` This is a
   569  	// read-only field. Creating Cloud Functions V1/V2 triggers is only supported
   570  	// via the Cloud Functions product. An error will be returned if the user sets
   571  	// this value.
   572  	CloudFunction string `json:"cloudFunction,omitempty"`
   573  	// CloudRun: Cloud Run fully-managed resource that receives the events. The
   574  	// resource should be in the same project as the trigger.
   575  	CloudRun *CloudRun `json:"cloudRun,omitempty"`
   576  	// Gke: A GKE service capable of receiving events. The service should be
   577  	// running in the same project as the trigger.
   578  	Gke *GKE `json:"gke,omitempty"`
   579  	// HttpEndpoint: An HTTP endpoint destination described by an URI.
   580  	HttpEndpoint *HttpEndpoint `json:"httpEndpoint,omitempty"`
   581  	// NetworkConfig: Optional. Network config is used to configure how Eventarc
   582  	// resolves and connect to a destination. This should only be used with
   583  	// HttpEndpoint destination type.
   584  	NetworkConfig *NetworkConfig `json:"networkConfig,omitempty"`
   585  	// Workflow: The resource name of the Workflow whose Executions are triggered
   586  	// by the events. The Workflow resource should be deployed in the same project
   587  	// as the trigger. Format:
   588  	// `projects/{project}/locations/{location}/workflows/{workflow}`
   589  	Workflow string `json:"workflow,omitempty"`
   590  	// ForceSendFields is a list of field names (e.g. "CloudFunction") to
   591  	// unconditionally include in API requests. By default, fields with empty or
   592  	// default values are omitted from API requests. See
   593  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   594  	// details.
   595  	ForceSendFields []string `json:"-"`
   596  	// NullFields is a list of field names (e.g. "CloudFunction") to include in API
   597  	// requests with the JSON null value. By default, fields with empty values are
   598  	// omitted from API requests. See
   599  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   600  	NullFields []string `json:"-"`
   601  }
   602  
   603  func (s *Destination) MarshalJSON() ([]byte, error) {
   604  	type NoMethod Destination
   605  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   606  }
   607  
   608  // Empty: A generic empty message that you can re-use to avoid defining
   609  // duplicated empty messages in your APIs. A typical example is to use it as
   610  // the request or the response type of an API method. For instance: service Foo
   611  // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
   612  type Empty struct {
   613  	// ServerResponse contains the HTTP response code and headers from the server.
   614  	googleapi.ServerResponse `json:"-"`
   615  }
   616  
   617  // EventFilter: Filters events based on exact matches on the CloudEvents
   618  // attributes.
   619  type EventFilter struct {
   620  	// Attribute: Required. The name of a CloudEvents attribute. Currently, only a
   621  	// subset of attributes are supported for filtering. You can retrieve a
   622  	// specific provider's supported event types
   623  	// (/eventarc/docs/list-providers#describe-provider). All triggers MUST provide
   624  	// a filter for the 'type' attribute.
   625  	Attribute string `json:"attribute,omitempty"`
   626  	// Operator: Optional. The operator used for matching the events with the value
   627  	// of the filter. If not specified, only events that have an exact key-value
   628  	// pair specified in the filter are matched. The allowed values are
   629  	// `path_pattern` and `match-path-pattern`. `path_pattern` is only allowed for
   630  	// GCFv1 triggers.
   631  	Operator string `json:"operator,omitempty"`
   632  	// Value: Required. The value for the attribute.
   633  	Value string `json:"value,omitempty"`
   634  	// ForceSendFields is a list of field names (e.g. "Attribute") to
   635  	// unconditionally include in API requests. By default, fields with empty or
   636  	// default values are omitted from API requests. See
   637  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   638  	// details.
   639  	ForceSendFields []string `json:"-"`
   640  	// NullFields is a list of field names (e.g. "Attribute") to include in API
   641  	// requests with the JSON null value. By default, fields with empty values are
   642  	// omitted from API requests. See
   643  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   644  	NullFields []string `json:"-"`
   645  }
   646  
   647  func (s *EventFilter) MarshalJSON() ([]byte, error) {
   648  	type NoMethod EventFilter
   649  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   650  }
   651  
   652  // EventType: A representation of the event type resource.
   653  type EventType struct {
   654  	// Description: Output only. Human friendly description of what the event type
   655  	// is about. For example "Bucket created in Cloud Storage".
   656  	Description string `json:"description,omitempty"`
   657  	// EventSchemaUri: Output only. URI for the event schema. For example
   658  	// "https://github.com/googleapis/google-cloudevents/blob/master/proto/google/ev
   659  	// ents/cloud/storage/v1/events.proto"
   660  	EventSchemaUri string `json:"eventSchemaUri,omitempty"`
   661  	// FilteringAttributes: Output only. Filtering attributes for the event type.
   662  	FilteringAttributes []*FilteringAttribute `json:"filteringAttributes,omitempty"`
   663  	// Type: Output only. The full name of the event type (for example,
   664  	// "google.cloud.storage.object.v1.finalized"). In the form of
   665  	// {provider-specific-prefix}.{resource}.{version}.{verb}. Types MUST be
   666  	// versioned and event schemas are guaranteed to remain backward compatible
   667  	// within one version. Note that event type versions and API versions do not
   668  	// need to match.
   669  	Type string `json:"type,omitempty"`
   670  	// ForceSendFields is a list of field names (e.g. "Description") to
   671  	// unconditionally include in API requests. By default, fields with empty or
   672  	// default values are omitted from API requests. See
   673  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   674  	// details.
   675  	ForceSendFields []string `json:"-"`
   676  	// NullFields is a list of field names (e.g. "Description") to include in API
   677  	// requests with the JSON null value. By default, fields with empty values are
   678  	// omitted from API requests. See
   679  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   680  	NullFields []string `json:"-"`
   681  }
   682  
   683  func (s *EventType) MarshalJSON() ([]byte, error) {
   684  	type NoMethod EventType
   685  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   686  }
   687  
   688  // Expr: Represents a textual expression in the Common Expression Language
   689  // (CEL) syntax. CEL is a C-like expression language. The syntax and semantics
   690  // of CEL are documented at https://github.com/google/cel-spec. Example
   691  // (Comparison): title: "Summary size limit" description: "Determines if a
   692  // summary is less than 100 chars" expression: "document.summary.size() < 100"
   693  // Example (Equality): title: "Requestor is owner" description: "Determines if
   694  // requestor is the document owner" expression: "document.owner ==
   695  // request.auth.claims.email" Example (Logic): title: "Public documents"
   696  // description: "Determine whether the document should be publicly visible"
   697  // expression: "document.type != 'private' && document.type != 'internal'"
   698  // Example (Data Manipulation): title: "Notification string" description:
   699  // "Create a notification string with a timestamp." expression: "'New message
   700  // received at ' + string(document.create_time)" The exact variables and
   701  // functions that may be referenced within an expression are determined by the
   702  // service that evaluates it. See the service documentation for additional
   703  // information.
   704  type Expr struct {
   705  	// Description: Optional. Description of the expression. This is a longer text
   706  	// which describes the expression, e.g. when hovered over it in a UI.
   707  	Description string `json:"description,omitempty"`
   708  	// Expression: Textual representation of an expression in Common Expression
   709  	// Language syntax.
   710  	Expression string `json:"expression,omitempty"`
   711  	// Location: Optional. String indicating the location of the expression for
   712  	// error reporting, e.g. a file name and a position in the file.
   713  	Location string `json:"location,omitempty"`
   714  	// Title: Optional. Title for the expression, i.e. a short string describing
   715  	// its purpose. This can be used e.g. in UIs which allow to enter the
   716  	// expression.
   717  	Title string `json:"title,omitempty"`
   718  	// ForceSendFields is a list of field names (e.g. "Description") to
   719  	// unconditionally include in API requests. By default, fields with empty or
   720  	// default values are omitted from API requests. See
   721  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   722  	// details.
   723  	ForceSendFields []string `json:"-"`
   724  	// NullFields is a list of field names (e.g. "Description") to include in API
   725  	// requests with the JSON null value. By default, fields with empty values are
   726  	// omitted from API requests. See
   727  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   728  	NullFields []string `json:"-"`
   729  }
   730  
   731  func (s *Expr) MarshalJSON() ([]byte, error) {
   732  	type NoMethod Expr
   733  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   734  }
   735  
   736  // FilteringAttribute: A representation of the FilteringAttribute resource.
   737  // Filtering attributes are per event type.
   738  type FilteringAttribute struct {
   739  	// Attribute: Output only. Attribute used for filtering the event type.
   740  	Attribute string `json:"attribute,omitempty"`
   741  	// Description: Output only. Description of the purpose of the attribute.
   742  	Description string `json:"description,omitempty"`
   743  	// PathPatternSupported: Output only. If true, the attribute accepts matching
   744  	// expressions in the Eventarc PathPattern format.
   745  	PathPatternSupported bool `json:"pathPatternSupported,omitempty"`
   746  	// Required: Output only. If true, the triggers for this provider should always
   747  	// specify a filter on these attributes. Trigger creation will fail otherwise.
   748  	Required bool `json:"required,omitempty"`
   749  	// ForceSendFields is a list of field names (e.g. "Attribute") to
   750  	// unconditionally include in API requests. By default, fields with empty or
   751  	// default values are omitted from API requests. See
   752  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   753  	// details.
   754  	ForceSendFields []string `json:"-"`
   755  	// NullFields is a list of field names (e.g. "Attribute") to include in API
   756  	// requests with the JSON null value. By default, fields with empty values are
   757  	// omitted from API requests. See
   758  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   759  	NullFields []string `json:"-"`
   760  }
   761  
   762  func (s *FilteringAttribute) MarshalJSON() ([]byte, error) {
   763  	type NoMethod FilteringAttribute
   764  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   765  }
   766  
   767  // GKE: Represents a GKE destination.
   768  type GKE struct {
   769  	// Cluster: Required. The name of the cluster the GKE service is running in.
   770  	// The cluster must be running in the same project as the trigger being
   771  	// created.
   772  	Cluster string `json:"cluster,omitempty"`
   773  	// Location: Required. The name of the Google Compute Engine in which the
   774  	// cluster resides, which can either be compute zone (for example,
   775  	// us-central1-a) for the zonal clusters or region (for example, us-central1)
   776  	// for regional clusters.
   777  	Location string `json:"location,omitempty"`
   778  	// Namespace: Required. The namespace the GKE service is running in.
   779  	Namespace string `json:"namespace,omitempty"`
   780  	// Path: Optional. The relative path on the GKE service the events should be
   781  	// sent to. The value must conform to the definition of a URI path segment
   782  	// (section 3.3 of RFC2396). Examples: "/route", "route", "route/subroute".
   783  	Path string `json:"path,omitempty"`
   784  	// Service: Required. Name of the GKE service.
   785  	Service string `json:"service,omitempty"`
   786  	// ForceSendFields is a list of field names (e.g. "Cluster") to unconditionally
   787  	// include in API requests. By default, fields with empty or default values are
   788  	// omitted from API requests. See
   789  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   790  	// details.
   791  	ForceSendFields []string `json:"-"`
   792  	// NullFields is a list of field names (e.g. "Cluster") to include in API
   793  	// requests with the JSON null value. By default, fields with empty values are
   794  	// omitted from API requests. See
   795  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   796  	NullFields []string `json:"-"`
   797  }
   798  
   799  func (s *GKE) MarshalJSON() ([]byte, error) {
   800  	type NoMethod GKE
   801  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   802  }
   803  
   804  // GoogleChannelConfig: A GoogleChannelConfig is a resource that stores the
   805  // custom settings respected by Eventarc first-party triggers in the matching
   806  // region. Once configured, first-party event data will be protected using the
   807  // specified custom managed encryption key instead of Google-managed encryption
   808  // keys.
   809  type GoogleChannelConfig struct {
   810  	// CryptoKeyName: Optional. Resource name of a KMS crypto key (managed by the
   811  	// user) used to encrypt/decrypt their event data. It must match the pattern
   812  	// `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
   813  	CryptoKeyName string `json:"cryptoKeyName,omitempty"`
   814  	// Name: Required. The resource name of the config. Must be in the format of,
   815  	// `projects/{project}/locations/{location}/googleChannelConfig`.
   816  	Name string `json:"name,omitempty"`
   817  	// UpdateTime: Output only. The last-modified time.
   818  	UpdateTime string `json:"updateTime,omitempty"`
   819  
   820  	// ServerResponse contains the HTTP response code and headers from the server.
   821  	googleapi.ServerResponse `json:"-"`
   822  	// ForceSendFields is a list of field names (e.g. "CryptoKeyName") to
   823  	// unconditionally include in API requests. By default, fields with empty or
   824  	// default values are omitted from API requests. See
   825  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   826  	// details.
   827  	ForceSendFields []string `json:"-"`
   828  	// NullFields is a list of field names (e.g. "CryptoKeyName") to include in API
   829  	// requests with the JSON null value. By default, fields with empty values are
   830  	// omitted from API requests. See
   831  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   832  	NullFields []string `json:"-"`
   833  }
   834  
   835  func (s *GoogleChannelConfig) MarshalJSON() ([]byte, error) {
   836  	type NoMethod GoogleChannelConfig
   837  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   838  }
   839  
   840  // GoogleLongrunningCancelOperationRequest: The request message for
   841  // Operations.CancelOperation.
   842  type GoogleLongrunningCancelOperationRequest struct {
   843  }
   844  
   845  // GoogleLongrunningListOperationsResponse: The response message for
   846  // Operations.ListOperations.
   847  type GoogleLongrunningListOperationsResponse struct {
   848  	// NextPageToken: The standard List next-page token.
   849  	NextPageToken string `json:"nextPageToken,omitempty"`
   850  	// Operations: A list of operations that matches the specified filter in the
   851  	// request.
   852  	Operations []*GoogleLongrunningOperation `json:"operations,omitempty"`
   853  
   854  	// ServerResponse contains the HTTP response code and headers from the server.
   855  	googleapi.ServerResponse `json:"-"`
   856  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   857  	// unconditionally include in API requests. By default, fields with empty or
   858  	// default values are omitted from API requests. See
   859  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   860  	// details.
   861  	ForceSendFields []string `json:"-"`
   862  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   863  	// requests with the JSON null value. By default, fields with empty values are
   864  	// omitted from API requests. See
   865  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   866  	NullFields []string `json:"-"`
   867  }
   868  
   869  func (s *GoogleLongrunningListOperationsResponse) MarshalJSON() ([]byte, error) {
   870  	type NoMethod GoogleLongrunningListOperationsResponse
   871  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   872  }
   873  
   874  // GoogleLongrunningOperation: This resource represents a long-running
   875  // operation that is the result of a network API call.
   876  type GoogleLongrunningOperation struct {
   877  	// Done: If the value is `false`, it means the operation is still in progress.
   878  	// If `true`, the operation is completed, and either `error` or `response` is
   879  	// available.
   880  	Done bool `json:"done,omitempty"`
   881  	// Error: The error result of the operation in case of failure or cancellation.
   882  	Error *GoogleRpcStatus `json:"error,omitempty"`
   883  	// Metadata: Service-specific metadata associated with the operation. It
   884  	// typically contains progress information and common metadata such as create
   885  	// time. Some services might not provide such metadata. Any method that returns
   886  	// a long-running operation should document the metadata type, if any.
   887  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
   888  	// Name: The server-assigned name, which is only unique within the same service
   889  	// that originally returns it. If you use the default HTTP mapping, the `name`
   890  	// should be a resource name ending with `operations/{unique_id}`.
   891  	Name string `json:"name,omitempty"`
   892  	// Response: The normal, successful response of the operation. If the original
   893  	// method returns no data on success, such as `Delete`, the response is
   894  	// `google.protobuf.Empty`. If the original method is standard
   895  	// `Get`/`Create`/`Update`, the response should be the resource. For other
   896  	// methods, the response should have the type `XxxResponse`, where `Xxx` is the
   897  	// original method name. For example, if the original method name is
   898  	// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
   899  	Response googleapi.RawMessage `json:"response,omitempty"`
   900  
   901  	// ServerResponse contains the HTTP response code and headers from the server.
   902  	googleapi.ServerResponse `json:"-"`
   903  	// ForceSendFields is a list of field names (e.g. "Done") to unconditionally
   904  	// include in API requests. By default, fields with empty or default values are
   905  	// omitted from API requests. See
   906  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   907  	// details.
   908  	ForceSendFields []string `json:"-"`
   909  	// NullFields is a list of field names (e.g. "Done") to include in API requests
   910  	// with the JSON null value. By default, fields with empty values are omitted
   911  	// from API requests. See
   912  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   913  	NullFields []string `json:"-"`
   914  }
   915  
   916  func (s *GoogleLongrunningOperation) MarshalJSON() ([]byte, error) {
   917  	type NoMethod GoogleLongrunningOperation
   918  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   919  }
   920  
   921  // GoogleRpcStatus: The `Status` type defines a logical error model that is
   922  // suitable for different programming environments, including REST APIs and RPC
   923  // APIs. It is used by gRPC (https://github.com/grpc). Each `Status` message
   924  // contains three pieces of data: error code, error message, and error details.
   925  // You can find out more about this error model and how to work with it in the
   926  // API Design Guide (https://cloud.google.com/apis/design/errors).
   927  type GoogleRpcStatus struct {
   928  	// Code: The status code, which should be an enum value of google.rpc.Code.
   929  	Code int64 `json:"code,omitempty"`
   930  	// Details: A list of messages that carry the error details. There is a common
   931  	// set of message types for APIs to use.
   932  	Details []googleapi.RawMessage `json:"details,omitempty"`
   933  	// Message: A developer-facing error message, which should be in English. Any
   934  	// user-facing error message should be localized and sent in the
   935  	// google.rpc.Status.details field, or localized by the client.
   936  	Message string `json:"message,omitempty"`
   937  	// ForceSendFields is a list of field names (e.g. "Code") to unconditionally
   938  	// include in API requests. By default, fields with empty or default values are
   939  	// omitted from API requests. See
   940  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   941  	// details.
   942  	ForceSendFields []string `json:"-"`
   943  	// NullFields is a list of field names (e.g. "Code") to include in API requests
   944  	// with the JSON null value. By default, fields with empty values are omitted
   945  	// from API requests. See
   946  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   947  	NullFields []string `json:"-"`
   948  }
   949  
   950  func (s *GoogleRpcStatus) MarshalJSON() ([]byte, error) {
   951  	type NoMethod GoogleRpcStatus
   952  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   953  }
   954  
   955  // HttpEndpoint: Represents a HTTP endpoint destination.
   956  type HttpEndpoint struct {
   957  	// Uri: Required. The URI of the HTTP enpdoint. The value must be a RFC2396 URI
   958  	// string. Examples: `http://10.10.10.8:80/route`,
   959  	// `http://svc.us-central1.p.local:8080/`. Only HTTP and HTTPS protocols are
   960  	// supported. The host can be either a static IP addressable from the VPC
   961  	// specified by the network config, or an internal DNS hostname of the service
   962  	// resolvable via Cloud DNS.
   963  	Uri string `json:"uri,omitempty"`
   964  	// ForceSendFields is a list of field names (e.g. "Uri") to unconditionally
   965  	// include in API requests. By default, fields with empty or default values are
   966  	// omitted from API requests. See
   967  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   968  	// details.
   969  	ForceSendFields []string `json:"-"`
   970  	// NullFields is a list of field names (e.g. "Uri") to include in API requests
   971  	// with the JSON null value. By default, fields with empty values are omitted
   972  	// from API requests. See
   973  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   974  	NullFields []string `json:"-"`
   975  }
   976  
   977  func (s *HttpEndpoint) MarshalJSON() ([]byte, error) {
   978  	type NoMethod HttpEndpoint
   979  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   980  }
   981  
   982  // ListChannelConnectionsResponse: The response message for the
   983  // `ListChannelConnections` method.
   984  type ListChannelConnectionsResponse struct {
   985  	// ChannelConnections: The requested channel connections, up to the number
   986  	// specified in `page_size`.
   987  	ChannelConnections []*ChannelConnection `json:"channelConnections,omitempty"`
   988  	// NextPageToken: A page token that can be sent to `ListChannelConnections` to
   989  	// request the next page. If this is empty, then there are no more pages.
   990  	NextPageToken string `json:"nextPageToken,omitempty"`
   991  	// Unreachable: Unreachable resources, if any.
   992  	Unreachable []string `json:"unreachable,omitempty"`
   993  
   994  	// ServerResponse contains the HTTP response code and headers from the server.
   995  	googleapi.ServerResponse `json:"-"`
   996  	// ForceSendFields is a list of field names (e.g. "ChannelConnections") to
   997  	// unconditionally include in API requests. By default, fields with empty or
   998  	// default values are omitted from API requests. See
   999  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1000  	// details.
  1001  	ForceSendFields []string `json:"-"`
  1002  	// NullFields is a list of field names (e.g. "ChannelConnections") to include
  1003  	// in API requests with the JSON null value. By default, fields with empty
  1004  	// values are omitted from API requests. See
  1005  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1006  	NullFields []string `json:"-"`
  1007  }
  1008  
  1009  func (s *ListChannelConnectionsResponse) MarshalJSON() ([]byte, error) {
  1010  	type NoMethod ListChannelConnectionsResponse
  1011  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1012  }
  1013  
  1014  // ListChannelsResponse: The response message for the `ListChannels` method.
  1015  type ListChannelsResponse struct {
  1016  	// Channels: The requested channels, up to the number specified in `page_size`.
  1017  	Channels []*Channel `json:"channels,omitempty"`
  1018  	// NextPageToken: A page token that can be sent to `ListChannels` to request
  1019  	// the next page. If this is empty, then there are no more pages.
  1020  	NextPageToken string `json:"nextPageToken,omitempty"`
  1021  	// Unreachable: Unreachable resources, if any.
  1022  	Unreachable []string `json:"unreachable,omitempty"`
  1023  
  1024  	// ServerResponse contains the HTTP response code and headers from the server.
  1025  	googleapi.ServerResponse `json:"-"`
  1026  	// ForceSendFields is a list of field names (e.g. "Channels") to
  1027  	// unconditionally include in API requests. By default, fields with empty or
  1028  	// default values are omitted from API requests. See
  1029  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1030  	// details.
  1031  	ForceSendFields []string `json:"-"`
  1032  	// NullFields is a list of field names (e.g. "Channels") to include in API
  1033  	// requests with the JSON null value. By default, fields with empty values are
  1034  	// omitted from API requests. See
  1035  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1036  	NullFields []string `json:"-"`
  1037  }
  1038  
  1039  func (s *ListChannelsResponse) MarshalJSON() ([]byte, error) {
  1040  	type NoMethod ListChannelsResponse
  1041  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1042  }
  1043  
  1044  // ListLocationsResponse: The response message for Locations.ListLocations.
  1045  type ListLocationsResponse struct {
  1046  	// Locations: A list of locations that matches the specified filter in the
  1047  	// request.
  1048  	Locations []*Location `json:"locations,omitempty"`
  1049  	// NextPageToken: The standard List next-page token.
  1050  	NextPageToken string `json:"nextPageToken,omitempty"`
  1051  
  1052  	// ServerResponse contains the HTTP response code and headers from the server.
  1053  	googleapi.ServerResponse `json:"-"`
  1054  	// ForceSendFields is a list of field names (e.g. "Locations") to
  1055  	// unconditionally include in API requests. By default, fields with empty or
  1056  	// default values are omitted from API requests. See
  1057  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1058  	// details.
  1059  	ForceSendFields []string `json:"-"`
  1060  	// NullFields is a list of field names (e.g. "Locations") to include in API
  1061  	// requests with the JSON null value. By default, fields with empty values are
  1062  	// omitted from API requests. See
  1063  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1064  	NullFields []string `json:"-"`
  1065  }
  1066  
  1067  func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
  1068  	type NoMethod ListLocationsResponse
  1069  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1070  }
  1071  
  1072  // ListProvidersResponse: The response message for the `ListProviders` method.
  1073  type ListProvidersResponse struct {
  1074  	// NextPageToken: A page token that can be sent to `ListProviders` to request
  1075  	// the next page. If this is empty, then there are no more pages.
  1076  	NextPageToken string `json:"nextPageToken,omitempty"`
  1077  	// Providers: The requested providers, up to the number specified in
  1078  	// `page_size`.
  1079  	Providers []*Provider `json:"providers,omitempty"`
  1080  	// Unreachable: Unreachable resources, if any.
  1081  	Unreachable []string `json:"unreachable,omitempty"`
  1082  
  1083  	// ServerResponse contains the HTTP response code and headers from the server.
  1084  	googleapi.ServerResponse `json:"-"`
  1085  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1086  	// unconditionally include in API requests. By default, fields with empty or
  1087  	// default values are omitted from API requests. See
  1088  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1089  	// details.
  1090  	ForceSendFields []string `json:"-"`
  1091  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
  1092  	// requests with the JSON null value. By default, fields with empty values are
  1093  	// omitted from API requests. See
  1094  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1095  	NullFields []string `json:"-"`
  1096  }
  1097  
  1098  func (s *ListProvidersResponse) MarshalJSON() ([]byte, error) {
  1099  	type NoMethod ListProvidersResponse
  1100  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1101  }
  1102  
  1103  // ListTriggersResponse: The response message for the `ListTriggers` method.
  1104  type ListTriggersResponse struct {
  1105  	// NextPageToken: A page token that can be sent to `ListTriggers` to request
  1106  	// the next page. If this is empty, then there are no more pages.
  1107  	NextPageToken string `json:"nextPageToken,omitempty"`
  1108  	// Triggers: The requested triggers, up to the number specified in `page_size`.
  1109  	Triggers []*Trigger `json:"triggers,omitempty"`
  1110  	// Unreachable: Unreachable resources, if any.
  1111  	Unreachable []string `json:"unreachable,omitempty"`
  1112  
  1113  	// ServerResponse contains the HTTP response code and headers from the server.
  1114  	googleapi.ServerResponse `json:"-"`
  1115  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1116  	// unconditionally include in API requests. By default, fields with empty or
  1117  	// default values are omitted from API requests. See
  1118  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1119  	// details.
  1120  	ForceSendFields []string `json:"-"`
  1121  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
  1122  	// requests with the JSON null value. By default, fields with empty values are
  1123  	// omitted from API requests. See
  1124  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1125  	NullFields []string `json:"-"`
  1126  }
  1127  
  1128  func (s *ListTriggersResponse) MarshalJSON() ([]byte, error) {
  1129  	type NoMethod ListTriggersResponse
  1130  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1131  }
  1132  
  1133  // Location: A resource that represents a Google Cloud location.
  1134  type Location struct {
  1135  	// DisplayName: The friendly name for this location, typically a nearby city
  1136  	// name. For example, "Tokyo".
  1137  	DisplayName string `json:"displayName,omitempty"`
  1138  	// Labels: Cross-service attributes for the location. For example
  1139  	// {"cloud.googleapis.com/region": "us-east1"}
  1140  	Labels map[string]string `json:"labels,omitempty"`
  1141  	// LocationId: The canonical id for this location. For example: "us-east1".
  1142  	LocationId string `json:"locationId,omitempty"`
  1143  	// Metadata: Service-specific metadata. For example the available capacity at
  1144  	// the given location.
  1145  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  1146  	// Name: Resource name for the location, which may vary between
  1147  	// implementations. For example:
  1148  	// "projects/example-project/locations/us-east1"
  1149  	Name string `json:"name,omitempty"`
  1150  
  1151  	// ServerResponse contains the HTTP response code and headers from the server.
  1152  	googleapi.ServerResponse `json:"-"`
  1153  	// ForceSendFields is a list of field names (e.g. "DisplayName") to
  1154  	// unconditionally include in API requests. By default, fields with empty or
  1155  	// default values are omitted from API requests. See
  1156  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1157  	// details.
  1158  	ForceSendFields []string `json:"-"`
  1159  	// NullFields is a list of field names (e.g. "DisplayName") to include in API
  1160  	// requests with the JSON null value. By default, fields with empty values are
  1161  	// omitted from API requests. See
  1162  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1163  	NullFields []string `json:"-"`
  1164  }
  1165  
  1166  func (s *Location) MarshalJSON() ([]byte, error) {
  1167  	type NoMethod Location
  1168  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1169  }
  1170  
  1171  // NetworkConfig: Represents a network config to be used for destination
  1172  // resolution and connectivity.
  1173  type NetworkConfig struct {
  1174  	// NetworkAttachment: Required. Name of the NetworkAttachment that allows
  1175  	// access to the destination VPC. Format:
  1176  	// `projects/{PROJECT_ID}/regions/{REGION}/networkAttachments/{NETWORK_ATTACHMEN
  1177  	// T_NAME}`
  1178  	NetworkAttachment string `json:"networkAttachment,omitempty"`
  1179  	// ForceSendFields is a list of field names (e.g. "NetworkAttachment") to
  1180  	// unconditionally include in API requests. By default, fields with empty or
  1181  	// default values are omitted from API requests. See
  1182  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1183  	// details.
  1184  	ForceSendFields []string `json:"-"`
  1185  	// NullFields is a list of field names (e.g. "NetworkAttachment") to include in
  1186  	// API requests with the JSON null value. By default, fields with empty values
  1187  	// are omitted from API requests. See
  1188  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1189  	NullFields []string `json:"-"`
  1190  }
  1191  
  1192  func (s *NetworkConfig) MarshalJSON() ([]byte, error) {
  1193  	type NoMethod NetworkConfig
  1194  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1195  }
  1196  
  1197  // OperationMetadata: Represents the metadata of the long-running operation.
  1198  type OperationMetadata struct {
  1199  	// ApiVersion: Output only. API version used to start the operation.
  1200  	ApiVersion string `json:"apiVersion,omitempty"`
  1201  	// CreateTime: Output only. The time the operation was created.
  1202  	CreateTime string `json:"createTime,omitempty"`
  1203  	// EndTime: Output only. The time the operation finished running.
  1204  	EndTime string `json:"endTime,omitempty"`
  1205  	// RequestedCancellation: Output only. Identifies whether the user has
  1206  	// requested cancellation of the operation. Operations that have successfully
  1207  	// been cancelled have Operation.error value with a google.rpc.Status.code of
  1208  	// 1, corresponding to `Code.CANCELLED`.
  1209  	RequestedCancellation bool `json:"requestedCancellation,omitempty"`
  1210  	// StatusMessage: Output only. Human-readable status of the operation, if any.
  1211  	StatusMessage string `json:"statusMessage,omitempty"`
  1212  	// Target: Output only. Server-defined resource path for the target of the
  1213  	// operation.
  1214  	Target string `json:"target,omitempty"`
  1215  	// Verb: Output only. Name of the verb executed by the operation.
  1216  	Verb string `json:"verb,omitempty"`
  1217  	// ForceSendFields is a list of field names (e.g. "ApiVersion") to
  1218  	// unconditionally include in API requests. By default, fields with empty or
  1219  	// default values are omitted from API requests. See
  1220  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1221  	// details.
  1222  	ForceSendFields []string `json:"-"`
  1223  	// NullFields is a list of field names (e.g. "ApiVersion") to include in API
  1224  	// requests with the JSON null value. By default, fields with empty values are
  1225  	// omitted from API requests. See
  1226  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1227  	NullFields []string `json:"-"`
  1228  }
  1229  
  1230  func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
  1231  	type NoMethod OperationMetadata
  1232  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1233  }
  1234  
  1235  // Policy: An Identity and Access Management (IAM) policy, which specifies
  1236  // access controls for Google Cloud resources. A `Policy` is a collection of
  1237  // `bindings`. A `binding` binds one or more `members`, or principals, to a
  1238  // single `role`. Principals can be user accounts, service accounts, Google
  1239  // groups, and domains (such as G Suite). A `role` is a named list of
  1240  // permissions; each `role` can be an IAM predefined role or a user-created
  1241  // custom role. For some types of Google Cloud resources, a `binding` can also
  1242  // specify a `condition`, which is a logical expression that allows access to a
  1243  // resource only if the expression evaluates to `true`. A condition can add
  1244  // constraints based on attributes of the request, the resource, or both. To
  1245  // learn which resources support conditions in their IAM policies, see the IAM
  1246  // documentation
  1247  // (https://cloud.google.com/iam/help/conditions/resource-policies). **JSON
  1248  // example:** ``` { "bindings": [ { "role":
  1249  // "roles/resourcemanager.organizationAdmin", "members": [
  1250  // "user:mike@example.com", "group:admins@example.com", "domain:google.com",
  1251  // "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role":
  1252  // "roles/resourcemanager.organizationViewer", "members": [
  1253  // "user:eve@example.com" ], "condition": { "title": "expirable access",
  1254  // "description": "Does not grant access after Sep 2020", "expression":
  1255  // "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag":
  1256  // "BwWWja0YfJA=", "version": 3 } ``` **YAML example:** ``` bindings: -
  1257  // members: - user:mike@example.com - group:admins@example.com -
  1258  // domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com
  1259  // role: roles/resourcemanager.organizationAdmin - members: -
  1260  // user:eve@example.com role: roles/resourcemanager.organizationViewer
  1261  // condition: title: expirable access description: Does not grant access after
  1262  // Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z')
  1263  // etag: BwWWja0YfJA= version: 3 ``` For a description of IAM and its features,
  1264  // see the IAM documentation (https://cloud.google.com/iam/docs/).
  1265  type Policy struct {
  1266  	// AuditConfigs: Specifies cloud audit logging configuration for this policy.
  1267  	AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
  1268  	// Bindings: Associates a list of `members`, or principals, with a `role`.
  1269  	// Optionally, may specify a `condition` that determines how and when the
  1270  	// `bindings` are applied. Each of the `bindings` must contain at least one
  1271  	// principal. The `bindings` in a `Policy` can refer to up to 1,500 principals;
  1272  	// up to 250 of these principals can be Google groups. Each occurrence of a
  1273  	// principal counts towards these limits. For example, if the `bindings` grant
  1274  	// 50 different roles to `user:alice@example.com`, and not to any other
  1275  	// principal, then you can add another 1,450 principals to the `bindings` in
  1276  	// the `Policy`.
  1277  	Bindings []*Binding `json:"bindings,omitempty"`
  1278  	// Etag: `etag` is used for optimistic concurrency control as a way to help
  1279  	// prevent simultaneous updates of a policy from overwriting each other. It is
  1280  	// strongly suggested that systems make use of the `etag` in the
  1281  	// read-modify-write cycle to perform policy updates in order to avoid race
  1282  	// conditions: An `etag` is returned in the response to `getIamPolicy`, and
  1283  	// systems are expected to put that etag in the request to `setIamPolicy` to
  1284  	// ensure that their change will be applied to the same version of the policy.
  1285  	// **Important:** If you use IAM Conditions, you must include the `etag` field
  1286  	// whenever you call `setIamPolicy`. If you omit this field, then IAM allows
  1287  	// you to overwrite a version `3` policy with a version `1` policy, and all of
  1288  	// the conditions in the version `3` policy are lost.
  1289  	Etag string `json:"etag,omitempty"`
  1290  	// Version: Specifies the format of the policy. Valid values are `0`, `1`, and
  1291  	// `3`. Requests that specify an invalid value are rejected. Any operation that
  1292  	// affects conditional role bindings must specify version `3`. This requirement
  1293  	// applies to the following operations: * Getting a policy that includes a
  1294  	// conditional role binding * Adding a conditional role binding to a policy *
  1295  	// Changing a conditional role binding in a policy * Removing any role binding,
  1296  	// with or without a condition, from a policy that includes conditions
  1297  	// **Important:** If you use IAM Conditions, you must include the `etag` field
  1298  	// whenever you call `setIamPolicy`. If you omit this field, then IAM allows
  1299  	// you to overwrite a version `3` policy with a version `1` policy, and all of
  1300  	// the conditions in the version `3` policy are lost. If a policy does not
  1301  	// include any conditions, operations on that policy may specify any valid
  1302  	// version or leave the field unset. To learn which resources support
  1303  	// conditions in their IAM policies, see the IAM documentation
  1304  	// (https://cloud.google.com/iam/help/conditions/resource-policies).
  1305  	Version int64 `json:"version,omitempty"`
  1306  
  1307  	// ServerResponse contains the HTTP response code and headers from the server.
  1308  	googleapi.ServerResponse `json:"-"`
  1309  	// ForceSendFields is a list of field names (e.g. "AuditConfigs") to
  1310  	// unconditionally include in API requests. By default, fields with empty or
  1311  	// default values are omitted from API requests. See
  1312  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1313  	// details.
  1314  	ForceSendFields []string `json:"-"`
  1315  	// NullFields is a list of field names (e.g. "AuditConfigs") to include in API
  1316  	// requests with the JSON null value. By default, fields with empty values are
  1317  	// omitted from API requests. See
  1318  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1319  	NullFields []string `json:"-"`
  1320  }
  1321  
  1322  func (s *Policy) MarshalJSON() ([]byte, error) {
  1323  	type NoMethod Policy
  1324  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1325  }
  1326  
  1327  // Provider: A representation of the Provider resource.
  1328  type Provider struct {
  1329  	// DisplayName: Output only. Human friendly name for the Provider. For example
  1330  	// "Cloud Storage".
  1331  	DisplayName string `json:"displayName,omitempty"`
  1332  	// EventTypes: Output only. Event types for this provider.
  1333  	EventTypes []*EventType `json:"eventTypes,omitempty"`
  1334  	// Name: Output only. In
  1335  	// `projects/{project}/locations/{location}/providers/{provider_id}` format.
  1336  	Name string `json:"name,omitempty"`
  1337  
  1338  	// ServerResponse contains the HTTP response code and headers from the server.
  1339  	googleapi.ServerResponse `json:"-"`
  1340  	// ForceSendFields is a list of field names (e.g. "DisplayName") to
  1341  	// unconditionally include in API requests. By default, fields with empty or
  1342  	// default values are omitted from API requests. See
  1343  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1344  	// details.
  1345  	ForceSendFields []string `json:"-"`
  1346  	// NullFields is a list of field names (e.g. "DisplayName") to include in API
  1347  	// requests with the JSON null value. By default, fields with empty values are
  1348  	// omitted from API requests. See
  1349  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1350  	NullFields []string `json:"-"`
  1351  }
  1352  
  1353  func (s *Provider) MarshalJSON() ([]byte, error) {
  1354  	type NoMethod Provider
  1355  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1356  }
  1357  
  1358  // Pubsub: Represents a Pub/Sub transport.
  1359  type Pubsub struct {
  1360  	// Subscription: Output only. The name of the Pub/Sub subscription created and
  1361  	// managed by Eventarc as a transport for the event delivery. Format:
  1362  	// `projects/{PROJECT_ID}/subscriptions/{SUBSCRIPTION_NAME}`.
  1363  	Subscription string `json:"subscription,omitempty"`
  1364  	// Topic: Optional. The name of the Pub/Sub topic created and managed by
  1365  	// Eventarc as a transport for the event delivery. Format:
  1366  	// `projects/{PROJECT_ID}/topics/{TOPIC_NAME}`. You can set an existing topic
  1367  	// for triggers of the type `google.cloud.pubsub.topic.v1.messagePublished`.
  1368  	// The topic you provide here is not deleted by Eventarc at trigger deletion.
  1369  	Topic string `json:"topic,omitempty"`
  1370  	// ForceSendFields is a list of field names (e.g. "Subscription") to
  1371  	// unconditionally include in API requests. By default, fields with empty or
  1372  	// default values are omitted from API requests. See
  1373  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1374  	// details.
  1375  	ForceSendFields []string `json:"-"`
  1376  	// NullFields is a list of field names (e.g. "Subscription") to include in API
  1377  	// requests with the JSON null value. By default, fields with empty values are
  1378  	// omitted from API requests. See
  1379  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1380  	NullFields []string `json:"-"`
  1381  }
  1382  
  1383  func (s *Pubsub) MarshalJSON() ([]byte, error) {
  1384  	type NoMethod Pubsub
  1385  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1386  }
  1387  
  1388  // SetIamPolicyRequest: Request message for `SetIamPolicy` method.
  1389  type SetIamPolicyRequest struct {
  1390  	// Policy: REQUIRED: The complete policy to be applied to the `resource`. The
  1391  	// size of the policy is limited to a few 10s of KB. An empty policy is a valid
  1392  	// policy but certain Google Cloud services (such as Projects) might reject
  1393  	// them.
  1394  	Policy *Policy `json:"policy,omitempty"`
  1395  	// UpdateMask: OPTIONAL: A FieldMask specifying which fields of the policy to
  1396  	// modify. Only the fields in the mask will be modified. If no mask is
  1397  	// provided, the following default mask is used: `paths: "bindings, etag"
  1398  	UpdateMask string `json:"updateMask,omitempty"`
  1399  	// ForceSendFields is a list of field names (e.g. "Policy") to unconditionally
  1400  	// include in API requests. By default, fields with empty or default values are
  1401  	// omitted from API requests. See
  1402  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1403  	// details.
  1404  	ForceSendFields []string `json:"-"`
  1405  	// NullFields is a list of field names (e.g. "Policy") to include in API
  1406  	// requests with the JSON null value. By default, fields with empty values are
  1407  	// omitted from API requests. See
  1408  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1409  	NullFields []string `json:"-"`
  1410  }
  1411  
  1412  func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
  1413  	type NoMethod SetIamPolicyRequest
  1414  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1415  }
  1416  
  1417  // StateCondition: A condition that is part of the trigger state computation.
  1418  type StateCondition struct {
  1419  	// Code: The canonical code of the condition.
  1420  	//
  1421  	// Possible values:
  1422  	//   "OK" - Not an error; returned on success. HTTP Mapping: 200 OK
  1423  	//   "CANCELLED" - The operation was cancelled, typically by the caller. HTTP
  1424  	// Mapping: 499 Client Closed Request
  1425  	//   "UNKNOWN" - Unknown error. For example, this error may be returned when a
  1426  	// `Status` value received from another address space belongs to an error space
  1427  	// that is not known in this address space. Also errors raised by APIs that do
  1428  	// not return enough error information may be converted to this error. HTTP
  1429  	// Mapping: 500 Internal Server Error
  1430  	//   "INVALID_ARGUMENT" - The client specified an invalid argument. Note that
  1431  	// this differs from `FAILED_PRECONDITION`. `INVALID_ARGUMENT` indicates
  1432  	// arguments that are problematic regardless of the state of the system (e.g.,
  1433  	// a malformed file name). HTTP Mapping: 400 Bad Request
  1434  	//   "DEADLINE_EXCEEDED" - The deadline expired before the operation could
  1435  	// complete. For operations that change the state of the system, this error may
  1436  	// be returned even if the operation has completed successfully. For example, a
  1437  	// successful response from a server could have been delayed long enough for
  1438  	// the deadline to expire. HTTP Mapping: 504 Gateway Timeout
  1439  	//   "NOT_FOUND" - Some requested entity (e.g., file or directory) was not
  1440  	// found. Note to server developers: if a request is denied for an entire class
  1441  	// of users, such as gradual feature rollout or undocumented allowlist,
  1442  	// `NOT_FOUND` may be used. If a request is denied for some users within a
  1443  	// class of users, such as user-based access control, `PERMISSION_DENIED` must
  1444  	// be used. HTTP Mapping: 404 Not Found
  1445  	//   "ALREADY_EXISTS" - The entity that a client attempted to create (e.g.,
  1446  	// file or directory) already exists. HTTP Mapping: 409 Conflict
  1447  	//   "PERMISSION_DENIED" - The caller does not have permission to execute the
  1448  	// specified operation. `PERMISSION_DENIED` must not be used for rejections
  1449  	// caused by exhausting some resource (use `RESOURCE_EXHAUSTED` instead for
  1450  	// those errors). `PERMISSION_DENIED` must not be used if the caller can not be
  1451  	// identified (use `UNAUTHENTICATED` instead for those errors). This error code
  1452  	// does not imply the request is valid or the requested entity exists or
  1453  	// satisfies other pre-conditions. HTTP Mapping: 403 Forbidden
  1454  	//   "UNAUTHENTICATED" - The request does not have valid authentication
  1455  	// credentials for the operation. HTTP Mapping: 401 Unauthorized
  1456  	//   "RESOURCE_EXHAUSTED" - Some resource has been exhausted, perhaps a
  1457  	// per-user quota, or perhaps the entire file system is out of space. HTTP
  1458  	// Mapping: 429 Too Many Requests
  1459  	//   "FAILED_PRECONDITION" - The operation was rejected because the system is
  1460  	// not in a state required for the operation's execution. For example, the
  1461  	// directory to be deleted is non-empty, an rmdir operation is applied to a
  1462  	// non-directory, etc. Service implementors can use the following guidelines to
  1463  	// decide between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`: (a) Use
  1464  	// `UNAVAILABLE` if the client can retry just the failing call. (b) Use
  1465  	// `ABORTED` if the client should retry at a higher level. For example, when a
  1466  	// client-specified test-and-set fails, indicating the client should restart a
  1467  	// read-modify-write sequence. (c) Use `FAILED_PRECONDITION` if the client
  1468  	// should not retry until the system state has been explicitly fixed. For
  1469  	// example, if an "rmdir" fails because the directory is non-empty,
  1470  	// `FAILED_PRECONDITION` should be returned since the client should not retry
  1471  	// unless the files are deleted from the directory. HTTP Mapping: 400 Bad
  1472  	// Request
  1473  	//   "ABORTED" - The operation was aborted, typically due to a concurrency
  1474  	// issue such as a sequencer check failure or transaction abort. See the
  1475  	// guidelines above for deciding between `FAILED_PRECONDITION`, `ABORTED`, and
  1476  	// `UNAVAILABLE`. HTTP Mapping: 409 Conflict
  1477  	//   "OUT_OF_RANGE" - The operation was attempted past the valid range. E.g.,
  1478  	// seeking or reading past end-of-file. Unlike `INVALID_ARGUMENT`, this error
  1479  	// indicates a problem that may be fixed if the system state changes. For
  1480  	// example, a 32-bit file system will generate `INVALID_ARGUMENT` if asked to
  1481  	// read at an offset that is not in the range [0,2^32-1], but it will generate
  1482  	// `OUT_OF_RANGE` if asked to read from an offset past the current file size.
  1483  	// There is a fair bit of overlap between `FAILED_PRECONDITION` and
  1484  	// `OUT_OF_RANGE`. We recommend using `OUT_OF_RANGE` (the more specific error)
  1485  	// when it applies so that callers who are iterating through a space can easily
  1486  	// look for an `OUT_OF_RANGE` error to detect when they are done. HTTP Mapping:
  1487  	// 400 Bad Request
  1488  	//   "UNIMPLEMENTED" - The operation is not implemented or is not
  1489  	// supported/enabled in this service. HTTP Mapping: 501 Not Implemented
  1490  	//   "INTERNAL" - Internal errors. This means that some invariants expected by
  1491  	// the underlying system have been broken. This error code is reserved for
  1492  	// serious errors. HTTP Mapping: 500 Internal Server Error
  1493  	//   "UNAVAILABLE" - The service is currently unavailable. This is most likely
  1494  	// a transient condition, which can be corrected by retrying with a backoff.
  1495  	// Note that it is not always safe to retry non-idempotent operations. See the
  1496  	// guidelines above for deciding between `FAILED_PRECONDITION`, `ABORTED`, and
  1497  	// `UNAVAILABLE`. HTTP Mapping: 503 Service Unavailable
  1498  	//   "DATA_LOSS" - Unrecoverable data loss or corruption. HTTP Mapping: 500
  1499  	// Internal Server Error
  1500  	Code string `json:"code,omitempty"`
  1501  	// Message: Human-readable message.
  1502  	Message string `json:"message,omitempty"`
  1503  	// ForceSendFields is a list of field names (e.g. "Code") to unconditionally
  1504  	// include in API requests. By default, fields with empty or default values are
  1505  	// omitted from API requests. See
  1506  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1507  	// details.
  1508  	ForceSendFields []string `json:"-"`
  1509  	// NullFields is a list of field names (e.g. "Code") to include in API requests
  1510  	// with the JSON null value. By default, fields with empty values are omitted
  1511  	// from API requests. See
  1512  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1513  	NullFields []string `json:"-"`
  1514  }
  1515  
  1516  func (s *StateCondition) MarshalJSON() ([]byte, error) {
  1517  	type NoMethod StateCondition
  1518  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1519  }
  1520  
  1521  // TestIamPermissionsRequest: Request message for `TestIamPermissions` method.
  1522  type TestIamPermissionsRequest struct {
  1523  	// Permissions: The set of permissions to check for the `resource`. Permissions
  1524  	// with wildcards (such as `*` or `storage.*`) are not allowed. For more
  1525  	// information see IAM Overview
  1526  	// (https://cloud.google.com/iam/docs/overview#permissions).
  1527  	Permissions []string `json:"permissions,omitempty"`
  1528  	// ForceSendFields is a list of field names (e.g. "Permissions") to
  1529  	// unconditionally include in API requests. By default, fields with empty or
  1530  	// default values are omitted from API requests. See
  1531  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1532  	// details.
  1533  	ForceSendFields []string `json:"-"`
  1534  	// NullFields is a list of field names (e.g. "Permissions") to include in API
  1535  	// requests with the JSON null value. By default, fields with empty values are
  1536  	// omitted from API requests. See
  1537  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1538  	NullFields []string `json:"-"`
  1539  }
  1540  
  1541  func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
  1542  	type NoMethod TestIamPermissionsRequest
  1543  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1544  }
  1545  
  1546  // TestIamPermissionsResponse: Response message for `TestIamPermissions`
  1547  // method.
  1548  type TestIamPermissionsResponse struct {
  1549  	// Permissions: A subset of `TestPermissionsRequest.permissions` that the
  1550  	// caller is allowed.
  1551  	Permissions []string `json:"permissions,omitempty"`
  1552  
  1553  	// ServerResponse contains the HTTP response code and headers from the server.
  1554  	googleapi.ServerResponse `json:"-"`
  1555  	// ForceSendFields is a list of field names (e.g. "Permissions") to
  1556  	// unconditionally include in API requests. By default, fields with empty or
  1557  	// default values are omitted from API requests. See
  1558  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1559  	// details.
  1560  	ForceSendFields []string `json:"-"`
  1561  	// NullFields is a list of field names (e.g. "Permissions") to include in API
  1562  	// requests with the JSON null value. By default, fields with empty values are
  1563  	// omitted from API requests. See
  1564  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1565  	NullFields []string `json:"-"`
  1566  }
  1567  
  1568  func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
  1569  	type NoMethod TestIamPermissionsResponse
  1570  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1571  }
  1572  
  1573  // Transport: Represents the transport intermediaries created for the trigger
  1574  // to deliver events.
  1575  type Transport struct {
  1576  	// Pubsub: The Pub/Sub topic and subscription used by Eventarc as a transport
  1577  	// intermediary.
  1578  	Pubsub *Pubsub `json:"pubsub,omitempty"`
  1579  	// ForceSendFields is a list of field names (e.g. "Pubsub") to unconditionally
  1580  	// include in API requests. By default, fields with empty or default values are
  1581  	// omitted from API requests. See
  1582  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1583  	// details.
  1584  	ForceSendFields []string `json:"-"`
  1585  	// NullFields is a list of field names (e.g. "Pubsub") to include in API
  1586  	// requests with the JSON null value. By default, fields with empty values are
  1587  	// omitted from API requests. See
  1588  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1589  	NullFields []string `json:"-"`
  1590  }
  1591  
  1592  func (s *Transport) MarshalJSON() ([]byte, error) {
  1593  	type NoMethod Transport
  1594  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1595  }
  1596  
  1597  // Trigger: A representation of the trigger resource.
  1598  type Trigger struct {
  1599  	// Channel: Optional. The name of the channel associated with the trigger in
  1600  	// `projects/{project}/locations/{location}/channels/{channel}` format. You
  1601  	// must provide a channel to receive events from Eventarc SaaS partners.
  1602  	Channel string `json:"channel,omitempty"`
  1603  	// Conditions: Output only. The reason(s) why a trigger is in FAILED state.
  1604  	Conditions map[string]StateCondition `json:"conditions,omitempty"`
  1605  	// CreateTime: Output only. The creation time.
  1606  	CreateTime string `json:"createTime,omitempty"`
  1607  	// Destination: Required. Destination specifies where the events should be sent
  1608  	// to.
  1609  	Destination *Destination `json:"destination,omitempty"`
  1610  	// Etag: Output only. This checksum is computed by the server based on the
  1611  	// value of other fields, and might be sent only on create requests to ensure
  1612  	// that the client has an up-to-date value before proceeding.
  1613  	Etag string `json:"etag,omitempty"`
  1614  	// EventDataContentType: Optional. EventDataContentType specifies the type of
  1615  	// payload in MIME format that is expected from the CloudEvent data field. This
  1616  	// is set to `application/json` if the value is not defined.
  1617  	EventDataContentType string `json:"eventDataContentType,omitempty"`
  1618  	// EventFilters: Required. Unordered list. The list of filters that applies to
  1619  	// event attributes. Only events that match all the provided filters are sent
  1620  	// to the destination.
  1621  	EventFilters []*EventFilter `json:"eventFilters,omitempty"`
  1622  	// Labels: Optional. User labels attached to the triggers that can be used to
  1623  	// group resources.
  1624  	Labels map[string]string `json:"labels,omitempty"`
  1625  	// Name: Required. The resource name of the trigger. Must be unique within the
  1626  	// location of the project and must be in
  1627  	// `projects/{project}/locations/{location}/triggers/{trigger}` format.
  1628  	Name string `json:"name,omitempty"`
  1629  	// SatisfiesPzs: Output only. Whether or not this Trigger satisfies the
  1630  	// requirements of physical zone separation
  1631  	SatisfiesPzs bool `json:"satisfiesPzs,omitempty"`
  1632  	// ServiceAccount: Optional. The IAM service account email associated with the
  1633  	// trigger. The service account represents the identity of the trigger. The
  1634  	// `iam.serviceAccounts.actAs` permission must be granted on the service
  1635  	// account to allow a principal to impersonate the service account. For more
  1636  	// information, see the Roles and permissions
  1637  	// (/eventarc/docs/all-roles-permissions) page specific to the trigger
  1638  	// destination.
  1639  	ServiceAccount string `json:"serviceAccount,omitempty"`
  1640  	// Transport: Optional. To deliver messages, Eventarc might use other Google
  1641  	// Cloud products as a transport intermediary. This field contains a reference
  1642  	// to that transport intermediary. This information can be used for debugging
  1643  	// purposes.
  1644  	Transport *Transport `json:"transport,omitempty"`
  1645  	// Uid: Output only. Server-assigned unique identifier for the trigger. The
  1646  	// value is a UUID4 string and guaranteed to remain unchanged until the
  1647  	// resource is deleted.
  1648  	Uid string `json:"uid,omitempty"`
  1649  	// UpdateTime: Output only. The last-modified time.
  1650  	UpdateTime string `json:"updateTime,omitempty"`
  1651  
  1652  	// ServerResponse contains the HTTP response code and headers from the server.
  1653  	googleapi.ServerResponse `json:"-"`
  1654  	// ForceSendFields is a list of field names (e.g. "Channel") to unconditionally
  1655  	// include in API requests. By default, fields with empty or default values are
  1656  	// omitted from API requests. See
  1657  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1658  	// details.
  1659  	ForceSendFields []string `json:"-"`
  1660  	// NullFields is a list of field names (e.g. "Channel") to include in API
  1661  	// requests with the JSON null value. By default, fields with empty values are
  1662  	// omitted from API requests. See
  1663  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1664  	NullFields []string `json:"-"`
  1665  }
  1666  
  1667  func (s *Trigger) MarshalJSON() ([]byte, error) {
  1668  	type NoMethod Trigger
  1669  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1670  }
  1671  
  1672  type ProjectsLocationsGetCall struct {
  1673  	s            *Service
  1674  	name         string
  1675  	urlParams_   gensupport.URLParams
  1676  	ifNoneMatch_ string
  1677  	ctx_         context.Context
  1678  	header_      http.Header
  1679  }
  1680  
  1681  // Get: Gets information about a location.
  1682  //
  1683  // - name: Resource name for the location.
  1684  func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
  1685  	c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1686  	c.name = name
  1687  	return c
  1688  }
  1689  
  1690  // Fields allows partial responses to be retrieved. See
  1691  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1692  // details.
  1693  func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
  1694  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1695  	return c
  1696  }
  1697  
  1698  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1699  // object's ETag matches the given value. This is useful for getting updates
  1700  // only after the object has changed since the last request.
  1701  func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
  1702  	c.ifNoneMatch_ = entityTag
  1703  	return c
  1704  }
  1705  
  1706  // Context sets the context to be used in this call's Do method.
  1707  func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
  1708  	c.ctx_ = ctx
  1709  	return c
  1710  }
  1711  
  1712  // Header returns a http.Header that can be modified by the caller to add
  1713  // headers to the request.
  1714  func (c *ProjectsLocationsGetCall) Header() http.Header {
  1715  	if c.header_ == nil {
  1716  		c.header_ = make(http.Header)
  1717  	}
  1718  	return c.header_
  1719  }
  1720  
  1721  func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
  1722  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1723  	if c.ifNoneMatch_ != "" {
  1724  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1725  	}
  1726  	var body io.Reader = nil
  1727  	c.urlParams_.Set("alt", alt)
  1728  	c.urlParams_.Set("prettyPrint", "false")
  1729  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  1730  	urls += "?" + c.urlParams_.Encode()
  1731  	req, err := http.NewRequest("GET", urls, body)
  1732  	if err != nil {
  1733  		return nil, err
  1734  	}
  1735  	req.Header = reqHeaders
  1736  	googleapi.Expand(req.URL, map[string]string{
  1737  		"name": c.name,
  1738  	})
  1739  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1740  }
  1741  
  1742  // Do executes the "eventarc.projects.locations.get" call.
  1743  // Any non-2xx status code is an error. Response headers are in either
  1744  // *Location.ServerResponse.Header or (if a response was returned at all) in
  1745  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1746  // whether the returned error was because http.StatusNotModified was returned.
  1747  func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
  1748  	gensupport.SetOptions(c.urlParams_, opts...)
  1749  	res, err := c.doRequest("json")
  1750  	if res != nil && res.StatusCode == http.StatusNotModified {
  1751  		if res.Body != nil {
  1752  			res.Body.Close()
  1753  		}
  1754  		return nil, gensupport.WrapError(&googleapi.Error{
  1755  			Code:   res.StatusCode,
  1756  			Header: res.Header,
  1757  		})
  1758  	}
  1759  	if err != nil {
  1760  		return nil, err
  1761  	}
  1762  	defer googleapi.CloseBody(res)
  1763  	if err := googleapi.CheckResponse(res); err != nil {
  1764  		return nil, gensupport.WrapError(err)
  1765  	}
  1766  	ret := &Location{
  1767  		ServerResponse: googleapi.ServerResponse{
  1768  			Header:         res.Header,
  1769  			HTTPStatusCode: res.StatusCode,
  1770  		},
  1771  	}
  1772  	target := &ret
  1773  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1774  		return nil, err
  1775  	}
  1776  	return ret, nil
  1777  }
  1778  
  1779  type ProjectsLocationsGetGoogleChannelConfigCall struct {
  1780  	s            *Service
  1781  	name         string
  1782  	urlParams_   gensupport.URLParams
  1783  	ifNoneMatch_ string
  1784  	ctx_         context.Context
  1785  	header_      http.Header
  1786  }
  1787  
  1788  // GetGoogleChannelConfig: Get a GoogleChannelConfig
  1789  //
  1790  // - name: The name of the config to get.
  1791  func (r *ProjectsLocationsService) GetGoogleChannelConfig(name string) *ProjectsLocationsGetGoogleChannelConfigCall {
  1792  	c := &ProjectsLocationsGetGoogleChannelConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1793  	c.name = name
  1794  	return c
  1795  }
  1796  
  1797  // Fields allows partial responses to be retrieved. See
  1798  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1799  // details.
  1800  func (c *ProjectsLocationsGetGoogleChannelConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetGoogleChannelConfigCall {
  1801  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1802  	return c
  1803  }
  1804  
  1805  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1806  // object's ETag matches the given value. This is useful for getting updates
  1807  // only after the object has changed since the last request.
  1808  func (c *ProjectsLocationsGetGoogleChannelConfigCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetGoogleChannelConfigCall {
  1809  	c.ifNoneMatch_ = entityTag
  1810  	return c
  1811  }
  1812  
  1813  // Context sets the context to be used in this call's Do method.
  1814  func (c *ProjectsLocationsGetGoogleChannelConfigCall) Context(ctx context.Context) *ProjectsLocationsGetGoogleChannelConfigCall {
  1815  	c.ctx_ = ctx
  1816  	return c
  1817  }
  1818  
  1819  // Header returns a http.Header that can be modified by the caller to add
  1820  // headers to the request.
  1821  func (c *ProjectsLocationsGetGoogleChannelConfigCall) Header() http.Header {
  1822  	if c.header_ == nil {
  1823  		c.header_ = make(http.Header)
  1824  	}
  1825  	return c.header_
  1826  }
  1827  
  1828  func (c *ProjectsLocationsGetGoogleChannelConfigCall) doRequest(alt string) (*http.Response, error) {
  1829  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1830  	if c.ifNoneMatch_ != "" {
  1831  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1832  	}
  1833  	var body io.Reader = nil
  1834  	c.urlParams_.Set("alt", alt)
  1835  	c.urlParams_.Set("prettyPrint", "false")
  1836  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  1837  	urls += "?" + c.urlParams_.Encode()
  1838  	req, err := http.NewRequest("GET", urls, body)
  1839  	if err != nil {
  1840  		return nil, err
  1841  	}
  1842  	req.Header = reqHeaders
  1843  	googleapi.Expand(req.URL, map[string]string{
  1844  		"name": c.name,
  1845  	})
  1846  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1847  }
  1848  
  1849  // Do executes the "eventarc.projects.locations.getGoogleChannelConfig" call.
  1850  // Any non-2xx status code is an error. Response headers are in either
  1851  // *GoogleChannelConfig.ServerResponse.Header or (if a response was returned at
  1852  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1853  // check whether the returned error was because http.StatusNotModified was
  1854  // returned.
  1855  func (c *ProjectsLocationsGetGoogleChannelConfigCall) Do(opts ...googleapi.CallOption) (*GoogleChannelConfig, error) {
  1856  	gensupport.SetOptions(c.urlParams_, opts...)
  1857  	res, err := c.doRequest("json")
  1858  	if res != nil && res.StatusCode == http.StatusNotModified {
  1859  		if res.Body != nil {
  1860  			res.Body.Close()
  1861  		}
  1862  		return nil, gensupport.WrapError(&googleapi.Error{
  1863  			Code:   res.StatusCode,
  1864  			Header: res.Header,
  1865  		})
  1866  	}
  1867  	if err != nil {
  1868  		return nil, err
  1869  	}
  1870  	defer googleapi.CloseBody(res)
  1871  	if err := googleapi.CheckResponse(res); err != nil {
  1872  		return nil, gensupport.WrapError(err)
  1873  	}
  1874  	ret := &GoogleChannelConfig{
  1875  		ServerResponse: googleapi.ServerResponse{
  1876  			Header:         res.Header,
  1877  			HTTPStatusCode: res.StatusCode,
  1878  		},
  1879  	}
  1880  	target := &ret
  1881  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1882  		return nil, err
  1883  	}
  1884  	return ret, nil
  1885  }
  1886  
  1887  type ProjectsLocationsListCall struct {
  1888  	s            *Service
  1889  	name         string
  1890  	urlParams_   gensupport.URLParams
  1891  	ifNoneMatch_ string
  1892  	ctx_         context.Context
  1893  	header_      http.Header
  1894  }
  1895  
  1896  // List: Lists information about the supported locations for this service.
  1897  //
  1898  // - name: The resource that owns the locations collection, if applicable.
  1899  func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
  1900  	c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1901  	c.name = name
  1902  	return c
  1903  }
  1904  
  1905  // Filter sets the optional parameter "filter": A filter to narrow down results
  1906  // to a preferred subset. The filtering language accepts strings like
  1907  // "displayName=tokyo", and is documented in more detail in AIP-160
  1908  // (https://google.aip.dev/160).
  1909  func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
  1910  	c.urlParams_.Set("filter", filter)
  1911  	return c
  1912  }
  1913  
  1914  // PageSize sets the optional parameter "pageSize": The maximum number of
  1915  // results to return. If not set, the service selects a default.
  1916  func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
  1917  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1918  	return c
  1919  }
  1920  
  1921  // PageToken sets the optional parameter "pageToken": A page token received
  1922  // from the `next_page_token` field in the response. Send that page token to
  1923  // receive the subsequent page.
  1924  func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
  1925  	c.urlParams_.Set("pageToken", pageToken)
  1926  	return c
  1927  }
  1928  
  1929  // Fields allows partial responses to be retrieved. See
  1930  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1931  // details.
  1932  func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
  1933  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1934  	return c
  1935  }
  1936  
  1937  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1938  // object's ETag matches the given value. This is useful for getting updates
  1939  // only after the object has changed since the last request.
  1940  func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
  1941  	c.ifNoneMatch_ = entityTag
  1942  	return c
  1943  }
  1944  
  1945  // Context sets the context to be used in this call's Do method.
  1946  func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
  1947  	c.ctx_ = ctx
  1948  	return c
  1949  }
  1950  
  1951  // Header returns a http.Header that can be modified by the caller to add
  1952  // headers to the request.
  1953  func (c *ProjectsLocationsListCall) Header() http.Header {
  1954  	if c.header_ == nil {
  1955  		c.header_ = make(http.Header)
  1956  	}
  1957  	return c.header_
  1958  }
  1959  
  1960  func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
  1961  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1962  	if c.ifNoneMatch_ != "" {
  1963  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1964  	}
  1965  	var body io.Reader = nil
  1966  	c.urlParams_.Set("alt", alt)
  1967  	c.urlParams_.Set("prettyPrint", "false")
  1968  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations")
  1969  	urls += "?" + c.urlParams_.Encode()
  1970  	req, err := http.NewRequest("GET", urls, body)
  1971  	if err != nil {
  1972  		return nil, err
  1973  	}
  1974  	req.Header = reqHeaders
  1975  	googleapi.Expand(req.URL, map[string]string{
  1976  		"name": c.name,
  1977  	})
  1978  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1979  }
  1980  
  1981  // Do executes the "eventarc.projects.locations.list" call.
  1982  // Any non-2xx status code is an error. Response headers are in either
  1983  // *ListLocationsResponse.ServerResponse.Header or (if a response was returned
  1984  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1985  // check whether the returned error was because http.StatusNotModified was
  1986  // returned.
  1987  func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
  1988  	gensupport.SetOptions(c.urlParams_, opts...)
  1989  	res, err := c.doRequest("json")
  1990  	if res != nil && res.StatusCode == http.StatusNotModified {
  1991  		if res.Body != nil {
  1992  			res.Body.Close()
  1993  		}
  1994  		return nil, gensupport.WrapError(&googleapi.Error{
  1995  			Code:   res.StatusCode,
  1996  			Header: res.Header,
  1997  		})
  1998  	}
  1999  	if err != nil {
  2000  		return nil, err
  2001  	}
  2002  	defer googleapi.CloseBody(res)
  2003  	if err := googleapi.CheckResponse(res); err != nil {
  2004  		return nil, gensupport.WrapError(err)
  2005  	}
  2006  	ret := &ListLocationsResponse{
  2007  		ServerResponse: googleapi.ServerResponse{
  2008  			Header:         res.Header,
  2009  			HTTPStatusCode: res.StatusCode,
  2010  		},
  2011  	}
  2012  	target := &ret
  2013  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2014  		return nil, err
  2015  	}
  2016  	return ret, nil
  2017  }
  2018  
  2019  // Pages invokes f for each page of results.
  2020  // A non-nil error returned from f will halt the iteration.
  2021  // The provided context supersedes any context provided to the Context method.
  2022  func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
  2023  	c.ctx_ = ctx
  2024  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  2025  	for {
  2026  		x, err := c.Do()
  2027  		if err != nil {
  2028  			return err
  2029  		}
  2030  		if err := f(x); err != nil {
  2031  			return err
  2032  		}
  2033  		if x.NextPageToken == "" {
  2034  			return nil
  2035  		}
  2036  		c.PageToken(x.NextPageToken)
  2037  	}
  2038  }
  2039  
  2040  type ProjectsLocationsUpdateGoogleChannelConfigCall struct {
  2041  	s                   *Service
  2042  	name                string
  2043  	googlechannelconfig *GoogleChannelConfig
  2044  	urlParams_          gensupport.URLParams
  2045  	ctx_                context.Context
  2046  	header_             http.Header
  2047  }
  2048  
  2049  // UpdateGoogleChannelConfig: Update a single GoogleChannelConfig
  2050  //
  2051  //   - name: The resource name of the config. Must be in the format of,
  2052  //     `projects/{project}/locations/{location}/googleChannelConfig`.
  2053  func (r *ProjectsLocationsService) UpdateGoogleChannelConfig(name string, googlechannelconfig *GoogleChannelConfig) *ProjectsLocationsUpdateGoogleChannelConfigCall {
  2054  	c := &ProjectsLocationsUpdateGoogleChannelConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2055  	c.name = name
  2056  	c.googlechannelconfig = googlechannelconfig
  2057  	return c
  2058  }
  2059  
  2060  // UpdateMask sets the optional parameter "updateMask": The fields to be
  2061  // updated; only fields explicitly provided are updated. If no field mask is
  2062  // provided, all provided fields in the request are updated. To update all
  2063  // fields, provide a field mask of "*".
  2064  func (c *ProjectsLocationsUpdateGoogleChannelConfigCall) UpdateMask(updateMask string) *ProjectsLocationsUpdateGoogleChannelConfigCall {
  2065  	c.urlParams_.Set("updateMask", updateMask)
  2066  	return c
  2067  }
  2068  
  2069  // Fields allows partial responses to be retrieved. See
  2070  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2071  // details.
  2072  func (c *ProjectsLocationsUpdateGoogleChannelConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsUpdateGoogleChannelConfigCall {
  2073  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2074  	return c
  2075  }
  2076  
  2077  // Context sets the context to be used in this call's Do method.
  2078  func (c *ProjectsLocationsUpdateGoogleChannelConfigCall) Context(ctx context.Context) *ProjectsLocationsUpdateGoogleChannelConfigCall {
  2079  	c.ctx_ = ctx
  2080  	return c
  2081  }
  2082  
  2083  // Header returns a http.Header that can be modified by the caller to add
  2084  // headers to the request.
  2085  func (c *ProjectsLocationsUpdateGoogleChannelConfigCall) Header() http.Header {
  2086  	if c.header_ == nil {
  2087  		c.header_ = make(http.Header)
  2088  	}
  2089  	return c.header_
  2090  }
  2091  
  2092  func (c *ProjectsLocationsUpdateGoogleChannelConfigCall) doRequest(alt string) (*http.Response, error) {
  2093  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2094  	var body io.Reader = nil
  2095  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlechannelconfig)
  2096  	if err != nil {
  2097  		return nil, err
  2098  	}
  2099  	c.urlParams_.Set("alt", alt)
  2100  	c.urlParams_.Set("prettyPrint", "false")
  2101  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  2102  	urls += "?" + c.urlParams_.Encode()
  2103  	req, err := http.NewRequest("PATCH", urls, body)
  2104  	if err != nil {
  2105  		return nil, err
  2106  	}
  2107  	req.Header = reqHeaders
  2108  	googleapi.Expand(req.URL, map[string]string{
  2109  		"name": c.name,
  2110  	})
  2111  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2112  }
  2113  
  2114  // Do executes the "eventarc.projects.locations.updateGoogleChannelConfig" call.
  2115  // Any non-2xx status code is an error. Response headers are in either
  2116  // *GoogleChannelConfig.ServerResponse.Header or (if a response was returned at
  2117  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2118  // check whether the returned error was because http.StatusNotModified was
  2119  // returned.
  2120  func (c *ProjectsLocationsUpdateGoogleChannelConfigCall) Do(opts ...googleapi.CallOption) (*GoogleChannelConfig, error) {
  2121  	gensupport.SetOptions(c.urlParams_, opts...)
  2122  	res, err := c.doRequest("json")
  2123  	if res != nil && res.StatusCode == http.StatusNotModified {
  2124  		if res.Body != nil {
  2125  			res.Body.Close()
  2126  		}
  2127  		return nil, gensupport.WrapError(&googleapi.Error{
  2128  			Code:   res.StatusCode,
  2129  			Header: res.Header,
  2130  		})
  2131  	}
  2132  	if err != nil {
  2133  		return nil, err
  2134  	}
  2135  	defer googleapi.CloseBody(res)
  2136  	if err := googleapi.CheckResponse(res); err != nil {
  2137  		return nil, gensupport.WrapError(err)
  2138  	}
  2139  	ret := &GoogleChannelConfig{
  2140  		ServerResponse: googleapi.ServerResponse{
  2141  			Header:         res.Header,
  2142  			HTTPStatusCode: res.StatusCode,
  2143  		},
  2144  	}
  2145  	target := &ret
  2146  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2147  		return nil, err
  2148  	}
  2149  	return ret, nil
  2150  }
  2151  
  2152  type ProjectsLocationsChannelConnectionsCreateCall struct {
  2153  	s                 *Service
  2154  	parent            string
  2155  	channelconnection *ChannelConnection
  2156  	urlParams_        gensupport.URLParams
  2157  	ctx_              context.Context
  2158  	header_           http.Header
  2159  }
  2160  
  2161  // Create: Create a new ChannelConnection in a particular project and location.
  2162  //
  2163  // - parent: The parent collection in which to add this channel connection.
  2164  func (r *ProjectsLocationsChannelConnectionsService) Create(parent string, channelconnection *ChannelConnection) *ProjectsLocationsChannelConnectionsCreateCall {
  2165  	c := &ProjectsLocationsChannelConnectionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2166  	c.parent = parent
  2167  	c.channelconnection = channelconnection
  2168  	return c
  2169  }
  2170  
  2171  // ChannelConnectionId sets the optional parameter "channelConnectionId":
  2172  // Required. The user-provided ID to be assigned to the channel connection.
  2173  func (c *ProjectsLocationsChannelConnectionsCreateCall) ChannelConnectionId(channelConnectionId string) *ProjectsLocationsChannelConnectionsCreateCall {
  2174  	c.urlParams_.Set("channelConnectionId", channelConnectionId)
  2175  	return c
  2176  }
  2177  
  2178  // Fields allows partial responses to be retrieved. See
  2179  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2180  // details.
  2181  func (c *ProjectsLocationsChannelConnectionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsChannelConnectionsCreateCall {
  2182  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2183  	return c
  2184  }
  2185  
  2186  // Context sets the context to be used in this call's Do method.
  2187  func (c *ProjectsLocationsChannelConnectionsCreateCall) Context(ctx context.Context) *ProjectsLocationsChannelConnectionsCreateCall {
  2188  	c.ctx_ = ctx
  2189  	return c
  2190  }
  2191  
  2192  // Header returns a http.Header that can be modified by the caller to add
  2193  // headers to the request.
  2194  func (c *ProjectsLocationsChannelConnectionsCreateCall) Header() http.Header {
  2195  	if c.header_ == nil {
  2196  		c.header_ = make(http.Header)
  2197  	}
  2198  	return c.header_
  2199  }
  2200  
  2201  func (c *ProjectsLocationsChannelConnectionsCreateCall) doRequest(alt string) (*http.Response, error) {
  2202  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2203  	var body io.Reader = nil
  2204  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.channelconnection)
  2205  	if err != nil {
  2206  		return nil, err
  2207  	}
  2208  	c.urlParams_.Set("alt", alt)
  2209  	c.urlParams_.Set("prettyPrint", "false")
  2210  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/channelConnections")
  2211  	urls += "?" + c.urlParams_.Encode()
  2212  	req, err := http.NewRequest("POST", urls, body)
  2213  	if err != nil {
  2214  		return nil, err
  2215  	}
  2216  	req.Header = reqHeaders
  2217  	googleapi.Expand(req.URL, map[string]string{
  2218  		"parent": c.parent,
  2219  	})
  2220  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2221  }
  2222  
  2223  // Do executes the "eventarc.projects.locations.channelConnections.create" call.
  2224  // Any non-2xx status code is an error. Response headers are in either
  2225  // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
  2226  // returned at all) in error.(*googleapi.Error).Header. Use
  2227  // googleapi.IsNotModified to check whether the returned error was because
  2228  // http.StatusNotModified was returned.
  2229  func (c *ProjectsLocationsChannelConnectionsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  2230  	gensupport.SetOptions(c.urlParams_, opts...)
  2231  	res, err := c.doRequest("json")
  2232  	if res != nil && res.StatusCode == http.StatusNotModified {
  2233  		if res.Body != nil {
  2234  			res.Body.Close()
  2235  		}
  2236  		return nil, gensupport.WrapError(&googleapi.Error{
  2237  			Code:   res.StatusCode,
  2238  			Header: res.Header,
  2239  		})
  2240  	}
  2241  	if err != nil {
  2242  		return nil, err
  2243  	}
  2244  	defer googleapi.CloseBody(res)
  2245  	if err := googleapi.CheckResponse(res); err != nil {
  2246  		return nil, gensupport.WrapError(err)
  2247  	}
  2248  	ret := &GoogleLongrunningOperation{
  2249  		ServerResponse: googleapi.ServerResponse{
  2250  			Header:         res.Header,
  2251  			HTTPStatusCode: res.StatusCode,
  2252  		},
  2253  	}
  2254  	target := &ret
  2255  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2256  		return nil, err
  2257  	}
  2258  	return ret, nil
  2259  }
  2260  
  2261  type ProjectsLocationsChannelConnectionsDeleteCall struct {
  2262  	s          *Service
  2263  	name       string
  2264  	urlParams_ gensupport.URLParams
  2265  	ctx_       context.Context
  2266  	header_    http.Header
  2267  }
  2268  
  2269  // Delete: Delete a single ChannelConnection.
  2270  //
  2271  // - name: The name of the channel connection to delete.
  2272  func (r *ProjectsLocationsChannelConnectionsService) Delete(name string) *ProjectsLocationsChannelConnectionsDeleteCall {
  2273  	c := &ProjectsLocationsChannelConnectionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2274  	c.name = name
  2275  	return c
  2276  }
  2277  
  2278  // Fields allows partial responses to be retrieved. See
  2279  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2280  // details.
  2281  func (c *ProjectsLocationsChannelConnectionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsChannelConnectionsDeleteCall {
  2282  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2283  	return c
  2284  }
  2285  
  2286  // Context sets the context to be used in this call's Do method.
  2287  func (c *ProjectsLocationsChannelConnectionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsChannelConnectionsDeleteCall {
  2288  	c.ctx_ = ctx
  2289  	return c
  2290  }
  2291  
  2292  // Header returns a http.Header that can be modified by the caller to add
  2293  // headers to the request.
  2294  func (c *ProjectsLocationsChannelConnectionsDeleteCall) Header() http.Header {
  2295  	if c.header_ == nil {
  2296  		c.header_ = make(http.Header)
  2297  	}
  2298  	return c.header_
  2299  }
  2300  
  2301  func (c *ProjectsLocationsChannelConnectionsDeleteCall) doRequest(alt string) (*http.Response, error) {
  2302  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2303  	var body io.Reader = nil
  2304  	c.urlParams_.Set("alt", alt)
  2305  	c.urlParams_.Set("prettyPrint", "false")
  2306  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  2307  	urls += "?" + c.urlParams_.Encode()
  2308  	req, err := http.NewRequest("DELETE", urls, body)
  2309  	if err != nil {
  2310  		return nil, err
  2311  	}
  2312  	req.Header = reqHeaders
  2313  	googleapi.Expand(req.URL, map[string]string{
  2314  		"name": c.name,
  2315  	})
  2316  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2317  }
  2318  
  2319  // Do executes the "eventarc.projects.locations.channelConnections.delete" call.
  2320  // Any non-2xx status code is an error. Response headers are in either
  2321  // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
  2322  // returned at all) in error.(*googleapi.Error).Header. Use
  2323  // googleapi.IsNotModified to check whether the returned error was because
  2324  // http.StatusNotModified was returned.
  2325  func (c *ProjectsLocationsChannelConnectionsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  2326  	gensupport.SetOptions(c.urlParams_, opts...)
  2327  	res, err := c.doRequest("json")
  2328  	if res != nil && res.StatusCode == http.StatusNotModified {
  2329  		if res.Body != nil {
  2330  			res.Body.Close()
  2331  		}
  2332  		return nil, gensupport.WrapError(&googleapi.Error{
  2333  			Code:   res.StatusCode,
  2334  			Header: res.Header,
  2335  		})
  2336  	}
  2337  	if err != nil {
  2338  		return nil, err
  2339  	}
  2340  	defer googleapi.CloseBody(res)
  2341  	if err := googleapi.CheckResponse(res); err != nil {
  2342  		return nil, gensupport.WrapError(err)
  2343  	}
  2344  	ret := &GoogleLongrunningOperation{
  2345  		ServerResponse: googleapi.ServerResponse{
  2346  			Header:         res.Header,
  2347  			HTTPStatusCode: res.StatusCode,
  2348  		},
  2349  	}
  2350  	target := &ret
  2351  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2352  		return nil, err
  2353  	}
  2354  	return ret, nil
  2355  }
  2356  
  2357  type ProjectsLocationsChannelConnectionsGetCall struct {
  2358  	s            *Service
  2359  	name         string
  2360  	urlParams_   gensupport.URLParams
  2361  	ifNoneMatch_ string
  2362  	ctx_         context.Context
  2363  	header_      http.Header
  2364  }
  2365  
  2366  // Get: Get a single ChannelConnection.
  2367  //
  2368  // - name: The name of the channel connection to get.
  2369  func (r *ProjectsLocationsChannelConnectionsService) Get(name string) *ProjectsLocationsChannelConnectionsGetCall {
  2370  	c := &ProjectsLocationsChannelConnectionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2371  	c.name = name
  2372  	return c
  2373  }
  2374  
  2375  // Fields allows partial responses to be retrieved. See
  2376  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2377  // details.
  2378  func (c *ProjectsLocationsChannelConnectionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsChannelConnectionsGetCall {
  2379  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2380  	return c
  2381  }
  2382  
  2383  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2384  // object's ETag matches the given value. This is useful for getting updates
  2385  // only after the object has changed since the last request.
  2386  func (c *ProjectsLocationsChannelConnectionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsChannelConnectionsGetCall {
  2387  	c.ifNoneMatch_ = entityTag
  2388  	return c
  2389  }
  2390  
  2391  // Context sets the context to be used in this call's Do method.
  2392  func (c *ProjectsLocationsChannelConnectionsGetCall) Context(ctx context.Context) *ProjectsLocationsChannelConnectionsGetCall {
  2393  	c.ctx_ = ctx
  2394  	return c
  2395  }
  2396  
  2397  // Header returns a http.Header that can be modified by the caller to add
  2398  // headers to the request.
  2399  func (c *ProjectsLocationsChannelConnectionsGetCall) Header() http.Header {
  2400  	if c.header_ == nil {
  2401  		c.header_ = make(http.Header)
  2402  	}
  2403  	return c.header_
  2404  }
  2405  
  2406  func (c *ProjectsLocationsChannelConnectionsGetCall) doRequest(alt string) (*http.Response, error) {
  2407  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2408  	if c.ifNoneMatch_ != "" {
  2409  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2410  	}
  2411  	var body io.Reader = nil
  2412  	c.urlParams_.Set("alt", alt)
  2413  	c.urlParams_.Set("prettyPrint", "false")
  2414  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  2415  	urls += "?" + c.urlParams_.Encode()
  2416  	req, err := http.NewRequest("GET", urls, body)
  2417  	if err != nil {
  2418  		return nil, err
  2419  	}
  2420  	req.Header = reqHeaders
  2421  	googleapi.Expand(req.URL, map[string]string{
  2422  		"name": c.name,
  2423  	})
  2424  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2425  }
  2426  
  2427  // Do executes the "eventarc.projects.locations.channelConnections.get" call.
  2428  // Any non-2xx status code is an error. Response headers are in either
  2429  // *ChannelConnection.ServerResponse.Header or (if a response was returned at
  2430  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2431  // check whether the returned error was because http.StatusNotModified was
  2432  // returned.
  2433  func (c *ProjectsLocationsChannelConnectionsGetCall) Do(opts ...googleapi.CallOption) (*ChannelConnection, error) {
  2434  	gensupport.SetOptions(c.urlParams_, opts...)
  2435  	res, err := c.doRequest("json")
  2436  	if res != nil && res.StatusCode == http.StatusNotModified {
  2437  		if res.Body != nil {
  2438  			res.Body.Close()
  2439  		}
  2440  		return nil, gensupport.WrapError(&googleapi.Error{
  2441  			Code:   res.StatusCode,
  2442  			Header: res.Header,
  2443  		})
  2444  	}
  2445  	if err != nil {
  2446  		return nil, err
  2447  	}
  2448  	defer googleapi.CloseBody(res)
  2449  	if err := googleapi.CheckResponse(res); err != nil {
  2450  		return nil, gensupport.WrapError(err)
  2451  	}
  2452  	ret := &ChannelConnection{
  2453  		ServerResponse: googleapi.ServerResponse{
  2454  			Header:         res.Header,
  2455  			HTTPStatusCode: res.StatusCode,
  2456  		},
  2457  	}
  2458  	target := &ret
  2459  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2460  		return nil, err
  2461  	}
  2462  	return ret, nil
  2463  }
  2464  
  2465  type ProjectsLocationsChannelConnectionsGetIamPolicyCall struct {
  2466  	s            *Service
  2467  	resource     string
  2468  	urlParams_   gensupport.URLParams
  2469  	ifNoneMatch_ string
  2470  	ctx_         context.Context
  2471  	header_      http.Header
  2472  }
  2473  
  2474  // GetIamPolicy: Gets the access control policy for a resource. Returns an
  2475  // empty policy if the resource exists and does not have a policy set.
  2476  //
  2477  //   - resource: REQUIRED: The resource for which the policy is being requested.
  2478  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  2479  //     for the appropriate value for this field.
  2480  func (r *ProjectsLocationsChannelConnectionsService) GetIamPolicy(resource string) *ProjectsLocationsChannelConnectionsGetIamPolicyCall {
  2481  	c := &ProjectsLocationsChannelConnectionsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2482  	c.resource = resource
  2483  	return c
  2484  }
  2485  
  2486  // OptionsRequestedPolicyVersion sets the optional parameter
  2487  // "options.requestedPolicyVersion": The maximum policy version that will be
  2488  // used to format the policy. Valid values are 0, 1, and 3. Requests specifying
  2489  // an invalid value will be rejected. Requests for policies with any
  2490  // conditional role bindings must specify version 3. Policies with no
  2491  // conditional role bindings may specify any valid value or leave the field
  2492  // unset. The policy in the response might use the policy version that you
  2493  // specified, or it might use a lower policy version. For example, if you
  2494  // specify version 3, but the policy has no conditional role bindings, the
  2495  // response uses version 1. To learn which resources support conditions in
  2496  // their IAM policies, see the IAM documentation
  2497  // (https://cloud.google.com/iam/help/conditions/resource-policies).
  2498  func (c *ProjectsLocationsChannelConnectionsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsChannelConnectionsGetIamPolicyCall {
  2499  	c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
  2500  	return c
  2501  }
  2502  
  2503  // Fields allows partial responses to be retrieved. See
  2504  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2505  // details.
  2506  func (c *ProjectsLocationsChannelConnectionsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsChannelConnectionsGetIamPolicyCall {
  2507  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2508  	return c
  2509  }
  2510  
  2511  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2512  // object's ETag matches the given value. This is useful for getting updates
  2513  // only after the object has changed since the last request.
  2514  func (c *ProjectsLocationsChannelConnectionsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsChannelConnectionsGetIamPolicyCall {
  2515  	c.ifNoneMatch_ = entityTag
  2516  	return c
  2517  }
  2518  
  2519  // Context sets the context to be used in this call's Do method.
  2520  func (c *ProjectsLocationsChannelConnectionsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsChannelConnectionsGetIamPolicyCall {
  2521  	c.ctx_ = ctx
  2522  	return c
  2523  }
  2524  
  2525  // Header returns a http.Header that can be modified by the caller to add
  2526  // headers to the request.
  2527  func (c *ProjectsLocationsChannelConnectionsGetIamPolicyCall) Header() http.Header {
  2528  	if c.header_ == nil {
  2529  		c.header_ = make(http.Header)
  2530  	}
  2531  	return c.header_
  2532  }
  2533  
  2534  func (c *ProjectsLocationsChannelConnectionsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  2535  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2536  	if c.ifNoneMatch_ != "" {
  2537  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2538  	}
  2539  	var body io.Reader = nil
  2540  	c.urlParams_.Set("alt", alt)
  2541  	c.urlParams_.Set("prettyPrint", "false")
  2542  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
  2543  	urls += "?" + c.urlParams_.Encode()
  2544  	req, err := http.NewRequest("GET", urls, body)
  2545  	if err != nil {
  2546  		return nil, err
  2547  	}
  2548  	req.Header = reqHeaders
  2549  	googleapi.Expand(req.URL, map[string]string{
  2550  		"resource": c.resource,
  2551  	})
  2552  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2553  }
  2554  
  2555  // Do executes the "eventarc.projects.locations.channelConnections.getIamPolicy" call.
  2556  // Any non-2xx status code is an error. Response headers are in either
  2557  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  2558  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2559  // whether the returned error was because http.StatusNotModified was returned.
  2560  func (c *ProjectsLocationsChannelConnectionsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  2561  	gensupport.SetOptions(c.urlParams_, opts...)
  2562  	res, err := c.doRequest("json")
  2563  	if res != nil && res.StatusCode == http.StatusNotModified {
  2564  		if res.Body != nil {
  2565  			res.Body.Close()
  2566  		}
  2567  		return nil, gensupport.WrapError(&googleapi.Error{
  2568  			Code:   res.StatusCode,
  2569  			Header: res.Header,
  2570  		})
  2571  	}
  2572  	if err != nil {
  2573  		return nil, err
  2574  	}
  2575  	defer googleapi.CloseBody(res)
  2576  	if err := googleapi.CheckResponse(res); err != nil {
  2577  		return nil, gensupport.WrapError(err)
  2578  	}
  2579  	ret := &Policy{
  2580  		ServerResponse: googleapi.ServerResponse{
  2581  			Header:         res.Header,
  2582  			HTTPStatusCode: res.StatusCode,
  2583  		},
  2584  	}
  2585  	target := &ret
  2586  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2587  		return nil, err
  2588  	}
  2589  	return ret, nil
  2590  }
  2591  
  2592  type ProjectsLocationsChannelConnectionsListCall struct {
  2593  	s            *Service
  2594  	parent       string
  2595  	urlParams_   gensupport.URLParams
  2596  	ifNoneMatch_ string
  2597  	ctx_         context.Context
  2598  	header_      http.Header
  2599  }
  2600  
  2601  // List: List channel connections.
  2602  //
  2603  // - parent: The parent collection from which to list channel connections.
  2604  func (r *ProjectsLocationsChannelConnectionsService) List(parent string) *ProjectsLocationsChannelConnectionsListCall {
  2605  	c := &ProjectsLocationsChannelConnectionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2606  	c.parent = parent
  2607  	return c
  2608  }
  2609  
  2610  // PageSize sets the optional parameter "pageSize": The maximum number of
  2611  // channel connections to return on each page. Note: The service may send fewer
  2612  // responses.
  2613  func (c *ProjectsLocationsChannelConnectionsListCall) PageSize(pageSize int64) *ProjectsLocationsChannelConnectionsListCall {
  2614  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2615  	return c
  2616  }
  2617  
  2618  // PageToken sets the optional parameter "pageToken": The page token; provide
  2619  // the value from the `next_page_token` field in a previous
  2620  // `ListChannelConnections` call to retrieve the subsequent page. When
  2621  // paginating, all other parameters provided to `ListChannelConnetions` match
  2622  // the call that provided the page token.
  2623  func (c *ProjectsLocationsChannelConnectionsListCall) PageToken(pageToken string) *ProjectsLocationsChannelConnectionsListCall {
  2624  	c.urlParams_.Set("pageToken", pageToken)
  2625  	return c
  2626  }
  2627  
  2628  // Fields allows partial responses to be retrieved. See
  2629  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2630  // details.
  2631  func (c *ProjectsLocationsChannelConnectionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsChannelConnectionsListCall {
  2632  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2633  	return c
  2634  }
  2635  
  2636  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2637  // object's ETag matches the given value. This is useful for getting updates
  2638  // only after the object has changed since the last request.
  2639  func (c *ProjectsLocationsChannelConnectionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsChannelConnectionsListCall {
  2640  	c.ifNoneMatch_ = entityTag
  2641  	return c
  2642  }
  2643  
  2644  // Context sets the context to be used in this call's Do method.
  2645  func (c *ProjectsLocationsChannelConnectionsListCall) Context(ctx context.Context) *ProjectsLocationsChannelConnectionsListCall {
  2646  	c.ctx_ = ctx
  2647  	return c
  2648  }
  2649  
  2650  // Header returns a http.Header that can be modified by the caller to add
  2651  // headers to the request.
  2652  func (c *ProjectsLocationsChannelConnectionsListCall) Header() http.Header {
  2653  	if c.header_ == nil {
  2654  		c.header_ = make(http.Header)
  2655  	}
  2656  	return c.header_
  2657  }
  2658  
  2659  func (c *ProjectsLocationsChannelConnectionsListCall) doRequest(alt string) (*http.Response, error) {
  2660  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2661  	if c.ifNoneMatch_ != "" {
  2662  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2663  	}
  2664  	var body io.Reader = nil
  2665  	c.urlParams_.Set("alt", alt)
  2666  	c.urlParams_.Set("prettyPrint", "false")
  2667  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/channelConnections")
  2668  	urls += "?" + c.urlParams_.Encode()
  2669  	req, err := http.NewRequest("GET", urls, body)
  2670  	if err != nil {
  2671  		return nil, err
  2672  	}
  2673  	req.Header = reqHeaders
  2674  	googleapi.Expand(req.URL, map[string]string{
  2675  		"parent": c.parent,
  2676  	})
  2677  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2678  }
  2679  
  2680  // Do executes the "eventarc.projects.locations.channelConnections.list" call.
  2681  // Any non-2xx status code is an error. Response headers are in either
  2682  // *ListChannelConnectionsResponse.ServerResponse.Header or (if a response was
  2683  // returned at all) in error.(*googleapi.Error).Header. Use
  2684  // googleapi.IsNotModified to check whether the returned error was because
  2685  // http.StatusNotModified was returned.
  2686  func (c *ProjectsLocationsChannelConnectionsListCall) Do(opts ...googleapi.CallOption) (*ListChannelConnectionsResponse, error) {
  2687  	gensupport.SetOptions(c.urlParams_, opts...)
  2688  	res, err := c.doRequest("json")
  2689  	if res != nil && res.StatusCode == http.StatusNotModified {
  2690  		if res.Body != nil {
  2691  			res.Body.Close()
  2692  		}
  2693  		return nil, gensupport.WrapError(&googleapi.Error{
  2694  			Code:   res.StatusCode,
  2695  			Header: res.Header,
  2696  		})
  2697  	}
  2698  	if err != nil {
  2699  		return nil, err
  2700  	}
  2701  	defer googleapi.CloseBody(res)
  2702  	if err := googleapi.CheckResponse(res); err != nil {
  2703  		return nil, gensupport.WrapError(err)
  2704  	}
  2705  	ret := &ListChannelConnectionsResponse{
  2706  		ServerResponse: googleapi.ServerResponse{
  2707  			Header:         res.Header,
  2708  			HTTPStatusCode: res.StatusCode,
  2709  		},
  2710  	}
  2711  	target := &ret
  2712  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2713  		return nil, err
  2714  	}
  2715  	return ret, nil
  2716  }
  2717  
  2718  // Pages invokes f for each page of results.
  2719  // A non-nil error returned from f will halt the iteration.
  2720  // The provided context supersedes any context provided to the Context method.
  2721  func (c *ProjectsLocationsChannelConnectionsListCall) Pages(ctx context.Context, f func(*ListChannelConnectionsResponse) error) error {
  2722  	c.ctx_ = ctx
  2723  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  2724  	for {
  2725  		x, err := c.Do()
  2726  		if err != nil {
  2727  			return err
  2728  		}
  2729  		if err := f(x); err != nil {
  2730  			return err
  2731  		}
  2732  		if x.NextPageToken == "" {
  2733  			return nil
  2734  		}
  2735  		c.PageToken(x.NextPageToken)
  2736  	}
  2737  }
  2738  
  2739  type ProjectsLocationsChannelConnectionsSetIamPolicyCall struct {
  2740  	s                   *Service
  2741  	resource            string
  2742  	setiampolicyrequest *SetIamPolicyRequest
  2743  	urlParams_          gensupport.URLParams
  2744  	ctx_                context.Context
  2745  	header_             http.Header
  2746  }
  2747  
  2748  // SetIamPolicy: Sets the access control policy on the specified resource.
  2749  // Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
  2750  // and `PERMISSION_DENIED` errors.
  2751  //
  2752  //   - resource: REQUIRED: The resource for which the policy is being specified.
  2753  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  2754  //     for the appropriate value for this field.
  2755  func (r *ProjectsLocationsChannelConnectionsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsChannelConnectionsSetIamPolicyCall {
  2756  	c := &ProjectsLocationsChannelConnectionsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2757  	c.resource = resource
  2758  	c.setiampolicyrequest = setiampolicyrequest
  2759  	return c
  2760  }
  2761  
  2762  // Fields allows partial responses to be retrieved. See
  2763  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2764  // details.
  2765  func (c *ProjectsLocationsChannelConnectionsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsChannelConnectionsSetIamPolicyCall {
  2766  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2767  	return c
  2768  }
  2769  
  2770  // Context sets the context to be used in this call's Do method.
  2771  func (c *ProjectsLocationsChannelConnectionsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsChannelConnectionsSetIamPolicyCall {
  2772  	c.ctx_ = ctx
  2773  	return c
  2774  }
  2775  
  2776  // Header returns a http.Header that can be modified by the caller to add
  2777  // headers to the request.
  2778  func (c *ProjectsLocationsChannelConnectionsSetIamPolicyCall) Header() http.Header {
  2779  	if c.header_ == nil {
  2780  		c.header_ = make(http.Header)
  2781  	}
  2782  	return c.header_
  2783  }
  2784  
  2785  func (c *ProjectsLocationsChannelConnectionsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  2786  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2787  	var body io.Reader = nil
  2788  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  2789  	if err != nil {
  2790  		return nil, err
  2791  	}
  2792  	c.urlParams_.Set("alt", alt)
  2793  	c.urlParams_.Set("prettyPrint", "false")
  2794  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
  2795  	urls += "?" + c.urlParams_.Encode()
  2796  	req, err := http.NewRequest("POST", urls, body)
  2797  	if err != nil {
  2798  		return nil, err
  2799  	}
  2800  	req.Header = reqHeaders
  2801  	googleapi.Expand(req.URL, map[string]string{
  2802  		"resource": c.resource,
  2803  	})
  2804  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2805  }
  2806  
  2807  // Do executes the "eventarc.projects.locations.channelConnections.setIamPolicy" call.
  2808  // Any non-2xx status code is an error. Response headers are in either
  2809  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  2810  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2811  // whether the returned error was because http.StatusNotModified was returned.
  2812  func (c *ProjectsLocationsChannelConnectionsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  2813  	gensupport.SetOptions(c.urlParams_, opts...)
  2814  	res, err := c.doRequest("json")
  2815  	if res != nil && res.StatusCode == http.StatusNotModified {
  2816  		if res.Body != nil {
  2817  			res.Body.Close()
  2818  		}
  2819  		return nil, gensupport.WrapError(&googleapi.Error{
  2820  			Code:   res.StatusCode,
  2821  			Header: res.Header,
  2822  		})
  2823  	}
  2824  	if err != nil {
  2825  		return nil, err
  2826  	}
  2827  	defer googleapi.CloseBody(res)
  2828  	if err := googleapi.CheckResponse(res); err != nil {
  2829  		return nil, gensupport.WrapError(err)
  2830  	}
  2831  	ret := &Policy{
  2832  		ServerResponse: googleapi.ServerResponse{
  2833  			Header:         res.Header,
  2834  			HTTPStatusCode: res.StatusCode,
  2835  		},
  2836  	}
  2837  	target := &ret
  2838  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2839  		return nil, err
  2840  	}
  2841  	return ret, nil
  2842  }
  2843  
  2844  type ProjectsLocationsChannelConnectionsTestIamPermissionsCall struct {
  2845  	s                         *Service
  2846  	resource                  string
  2847  	testiampermissionsrequest *TestIamPermissionsRequest
  2848  	urlParams_                gensupport.URLParams
  2849  	ctx_                      context.Context
  2850  	header_                   http.Header
  2851  }
  2852  
  2853  // TestIamPermissions: Returns permissions that a caller has on the specified
  2854  // resource. If the resource does not exist, this will return an empty set of
  2855  // permissions, not a `NOT_FOUND` error. Note: This operation is designed to be
  2856  // used for building permission-aware UIs and command-line tools, not for
  2857  // authorization checking. This operation may "fail open" without warning.
  2858  //
  2859  //   - resource: REQUIRED: The resource for which the policy detail is being
  2860  //     requested. See Resource names
  2861  //     (https://cloud.google.com/apis/design/resource_names) for the appropriate
  2862  //     value for this field.
  2863  func (r *ProjectsLocationsChannelConnectionsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsChannelConnectionsTestIamPermissionsCall {
  2864  	c := &ProjectsLocationsChannelConnectionsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2865  	c.resource = resource
  2866  	c.testiampermissionsrequest = testiampermissionsrequest
  2867  	return c
  2868  }
  2869  
  2870  // Fields allows partial responses to be retrieved. See
  2871  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2872  // details.
  2873  func (c *ProjectsLocationsChannelConnectionsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsChannelConnectionsTestIamPermissionsCall {
  2874  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2875  	return c
  2876  }
  2877  
  2878  // Context sets the context to be used in this call's Do method.
  2879  func (c *ProjectsLocationsChannelConnectionsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsChannelConnectionsTestIamPermissionsCall {
  2880  	c.ctx_ = ctx
  2881  	return c
  2882  }
  2883  
  2884  // Header returns a http.Header that can be modified by the caller to add
  2885  // headers to the request.
  2886  func (c *ProjectsLocationsChannelConnectionsTestIamPermissionsCall) Header() http.Header {
  2887  	if c.header_ == nil {
  2888  		c.header_ = make(http.Header)
  2889  	}
  2890  	return c.header_
  2891  }
  2892  
  2893  func (c *ProjectsLocationsChannelConnectionsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  2894  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2895  	var body io.Reader = nil
  2896  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  2897  	if err != nil {
  2898  		return nil, err
  2899  	}
  2900  	c.urlParams_.Set("alt", alt)
  2901  	c.urlParams_.Set("prettyPrint", "false")
  2902  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
  2903  	urls += "?" + c.urlParams_.Encode()
  2904  	req, err := http.NewRequest("POST", urls, body)
  2905  	if err != nil {
  2906  		return nil, err
  2907  	}
  2908  	req.Header = reqHeaders
  2909  	googleapi.Expand(req.URL, map[string]string{
  2910  		"resource": c.resource,
  2911  	})
  2912  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2913  }
  2914  
  2915  // Do executes the "eventarc.projects.locations.channelConnections.testIamPermissions" call.
  2916  // Any non-2xx status code is an error. Response headers are in either
  2917  // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
  2918  // returned at all) in error.(*googleapi.Error).Header. Use
  2919  // googleapi.IsNotModified to check whether the returned error was because
  2920  // http.StatusNotModified was returned.
  2921  func (c *ProjectsLocationsChannelConnectionsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  2922  	gensupport.SetOptions(c.urlParams_, opts...)
  2923  	res, err := c.doRequest("json")
  2924  	if res != nil && res.StatusCode == http.StatusNotModified {
  2925  		if res.Body != nil {
  2926  			res.Body.Close()
  2927  		}
  2928  		return nil, gensupport.WrapError(&googleapi.Error{
  2929  			Code:   res.StatusCode,
  2930  			Header: res.Header,
  2931  		})
  2932  	}
  2933  	if err != nil {
  2934  		return nil, err
  2935  	}
  2936  	defer googleapi.CloseBody(res)
  2937  	if err := googleapi.CheckResponse(res); err != nil {
  2938  		return nil, gensupport.WrapError(err)
  2939  	}
  2940  	ret := &TestIamPermissionsResponse{
  2941  		ServerResponse: googleapi.ServerResponse{
  2942  			Header:         res.Header,
  2943  			HTTPStatusCode: res.StatusCode,
  2944  		},
  2945  	}
  2946  	target := &ret
  2947  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2948  		return nil, err
  2949  	}
  2950  	return ret, nil
  2951  }
  2952  
  2953  type ProjectsLocationsChannelsCreateCall struct {
  2954  	s          *Service
  2955  	parent     string
  2956  	channel    *Channel
  2957  	urlParams_ gensupport.URLParams
  2958  	ctx_       context.Context
  2959  	header_    http.Header
  2960  }
  2961  
  2962  // Create: Create a new channel in a particular project and location.
  2963  //
  2964  // - parent: The parent collection in which to add this channel.
  2965  func (r *ProjectsLocationsChannelsService) Create(parent string, channel *Channel) *ProjectsLocationsChannelsCreateCall {
  2966  	c := &ProjectsLocationsChannelsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2967  	c.parent = parent
  2968  	c.channel = channel
  2969  	return c
  2970  }
  2971  
  2972  // ChannelId sets the optional parameter "channelId": Required. The
  2973  // user-provided ID to be assigned to the channel.
  2974  func (c *ProjectsLocationsChannelsCreateCall) ChannelId(channelId string) *ProjectsLocationsChannelsCreateCall {
  2975  	c.urlParams_.Set("channelId", channelId)
  2976  	return c
  2977  }
  2978  
  2979  // ValidateOnly sets the optional parameter "validateOnly": If set, validate
  2980  // the request and preview the review, but do not post it.
  2981  func (c *ProjectsLocationsChannelsCreateCall) ValidateOnly(validateOnly bool) *ProjectsLocationsChannelsCreateCall {
  2982  	c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  2983  	return c
  2984  }
  2985  
  2986  // Fields allows partial responses to be retrieved. See
  2987  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2988  // details.
  2989  func (c *ProjectsLocationsChannelsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsChannelsCreateCall {
  2990  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2991  	return c
  2992  }
  2993  
  2994  // Context sets the context to be used in this call's Do method.
  2995  func (c *ProjectsLocationsChannelsCreateCall) Context(ctx context.Context) *ProjectsLocationsChannelsCreateCall {
  2996  	c.ctx_ = ctx
  2997  	return c
  2998  }
  2999  
  3000  // Header returns a http.Header that can be modified by the caller to add
  3001  // headers to the request.
  3002  func (c *ProjectsLocationsChannelsCreateCall) Header() http.Header {
  3003  	if c.header_ == nil {
  3004  		c.header_ = make(http.Header)
  3005  	}
  3006  	return c.header_
  3007  }
  3008  
  3009  func (c *ProjectsLocationsChannelsCreateCall) doRequest(alt string) (*http.Response, error) {
  3010  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3011  	var body io.Reader = nil
  3012  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
  3013  	if err != nil {
  3014  		return nil, err
  3015  	}
  3016  	c.urlParams_.Set("alt", alt)
  3017  	c.urlParams_.Set("prettyPrint", "false")
  3018  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/channels")
  3019  	urls += "?" + c.urlParams_.Encode()
  3020  	req, err := http.NewRequest("POST", urls, body)
  3021  	if err != nil {
  3022  		return nil, err
  3023  	}
  3024  	req.Header = reqHeaders
  3025  	googleapi.Expand(req.URL, map[string]string{
  3026  		"parent": c.parent,
  3027  	})
  3028  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3029  }
  3030  
  3031  // Do executes the "eventarc.projects.locations.channels.create" call.
  3032  // Any non-2xx status code is an error. Response headers are in either
  3033  // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
  3034  // returned at all) in error.(*googleapi.Error).Header. Use
  3035  // googleapi.IsNotModified to check whether the returned error was because
  3036  // http.StatusNotModified was returned.
  3037  func (c *ProjectsLocationsChannelsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  3038  	gensupport.SetOptions(c.urlParams_, opts...)
  3039  	res, err := c.doRequest("json")
  3040  	if res != nil && res.StatusCode == http.StatusNotModified {
  3041  		if res.Body != nil {
  3042  			res.Body.Close()
  3043  		}
  3044  		return nil, gensupport.WrapError(&googleapi.Error{
  3045  			Code:   res.StatusCode,
  3046  			Header: res.Header,
  3047  		})
  3048  	}
  3049  	if err != nil {
  3050  		return nil, err
  3051  	}
  3052  	defer googleapi.CloseBody(res)
  3053  	if err := googleapi.CheckResponse(res); err != nil {
  3054  		return nil, gensupport.WrapError(err)
  3055  	}
  3056  	ret := &GoogleLongrunningOperation{
  3057  		ServerResponse: googleapi.ServerResponse{
  3058  			Header:         res.Header,
  3059  			HTTPStatusCode: res.StatusCode,
  3060  		},
  3061  	}
  3062  	target := &ret
  3063  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3064  		return nil, err
  3065  	}
  3066  	return ret, nil
  3067  }
  3068  
  3069  type ProjectsLocationsChannelsDeleteCall struct {
  3070  	s          *Service
  3071  	name       string
  3072  	urlParams_ gensupport.URLParams
  3073  	ctx_       context.Context
  3074  	header_    http.Header
  3075  }
  3076  
  3077  // Delete: Delete a single channel.
  3078  //
  3079  // - name: The name of the channel to be deleted.
  3080  func (r *ProjectsLocationsChannelsService) Delete(name string) *ProjectsLocationsChannelsDeleteCall {
  3081  	c := &ProjectsLocationsChannelsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3082  	c.name = name
  3083  	return c
  3084  }
  3085  
  3086  // ValidateOnly sets the optional parameter "validateOnly": If set, validate
  3087  // the request and preview the review, but do not post it.
  3088  func (c *ProjectsLocationsChannelsDeleteCall) ValidateOnly(validateOnly bool) *ProjectsLocationsChannelsDeleteCall {
  3089  	c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  3090  	return c
  3091  }
  3092  
  3093  // Fields allows partial responses to be retrieved. See
  3094  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3095  // details.
  3096  func (c *ProjectsLocationsChannelsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsChannelsDeleteCall {
  3097  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3098  	return c
  3099  }
  3100  
  3101  // Context sets the context to be used in this call's Do method.
  3102  func (c *ProjectsLocationsChannelsDeleteCall) Context(ctx context.Context) *ProjectsLocationsChannelsDeleteCall {
  3103  	c.ctx_ = ctx
  3104  	return c
  3105  }
  3106  
  3107  // Header returns a http.Header that can be modified by the caller to add
  3108  // headers to the request.
  3109  func (c *ProjectsLocationsChannelsDeleteCall) Header() http.Header {
  3110  	if c.header_ == nil {
  3111  		c.header_ = make(http.Header)
  3112  	}
  3113  	return c.header_
  3114  }
  3115  
  3116  func (c *ProjectsLocationsChannelsDeleteCall) doRequest(alt string) (*http.Response, error) {
  3117  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3118  	var body io.Reader = nil
  3119  	c.urlParams_.Set("alt", alt)
  3120  	c.urlParams_.Set("prettyPrint", "false")
  3121  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  3122  	urls += "?" + c.urlParams_.Encode()
  3123  	req, err := http.NewRequest("DELETE", urls, body)
  3124  	if err != nil {
  3125  		return nil, err
  3126  	}
  3127  	req.Header = reqHeaders
  3128  	googleapi.Expand(req.URL, map[string]string{
  3129  		"name": c.name,
  3130  	})
  3131  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3132  }
  3133  
  3134  // Do executes the "eventarc.projects.locations.channels.delete" call.
  3135  // Any non-2xx status code is an error. Response headers are in either
  3136  // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
  3137  // returned at all) in error.(*googleapi.Error).Header. Use
  3138  // googleapi.IsNotModified to check whether the returned error was because
  3139  // http.StatusNotModified was returned.
  3140  func (c *ProjectsLocationsChannelsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  3141  	gensupport.SetOptions(c.urlParams_, opts...)
  3142  	res, err := c.doRequest("json")
  3143  	if res != nil && res.StatusCode == http.StatusNotModified {
  3144  		if res.Body != nil {
  3145  			res.Body.Close()
  3146  		}
  3147  		return nil, gensupport.WrapError(&googleapi.Error{
  3148  			Code:   res.StatusCode,
  3149  			Header: res.Header,
  3150  		})
  3151  	}
  3152  	if err != nil {
  3153  		return nil, err
  3154  	}
  3155  	defer googleapi.CloseBody(res)
  3156  	if err := googleapi.CheckResponse(res); err != nil {
  3157  		return nil, gensupport.WrapError(err)
  3158  	}
  3159  	ret := &GoogleLongrunningOperation{
  3160  		ServerResponse: googleapi.ServerResponse{
  3161  			Header:         res.Header,
  3162  			HTTPStatusCode: res.StatusCode,
  3163  		},
  3164  	}
  3165  	target := &ret
  3166  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3167  		return nil, err
  3168  	}
  3169  	return ret, nil
  3170  }
  3171  
  3172  type ProjectsLocationsChannelsGetCall struct {
  3173  	s            *Service
  3174  	name         string
  3175  	urlParams_   gensupport.URLParams
  3176  	ifNoneMatch_ string
  3177  	ctx_         context.Context
  3178  	header_      http.Header
  3179  }
  3180  
  3181  // Get: Get a single Channel.
  3182  //
  3183  // - name: The name of the channel to get.
  3184  func (r *ProjectsLocationsChannelsService) Get(name string) *ProjectsLocationsChannelsGetCall {
  3185  	c := &ProjectsLocationsChannelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3186  	c.name = name
  3187  	return c
  3188  }
  3189  
  3190  // Fields allows partial responses to be retrieved. See
  3191  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3192  // details.
  3193  func (c *ProjectsLocationsChannelsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsChannelsGetCall {
  3194  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3195  	return c
  3196  }
  3197  
  3198  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3199  // object's ETag matches the given value. This is useful for getting updates
  3200  // only after the object has changed since the last request.
  3201  func (c *ProjectsLocationsChannelsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsChannelsGetCall {
  3202  	c.ifNoneMatch_ = entityTag
  3203  	return c
  3204  }
  3205  
  3206  // Context sets the context to be used in this call's Do method.
  3207  func (c *ProjectsLocationsChannelsGetCall) Context(ctx context.Context) *ProjectsLocationsChannelsGetCall {
  3208  	c.ctx_ = ctx
  3209  	return c
  3210  }
  3211  
  3212  // Header returns a http.Header that can be modified by the caller to add
  3213  // headers to the request.
  3214  func (c *ProjectsLocationsChannelsGetCall) Header() http.Header {
  3215  	if c.header_ == nil {
  3216  		c.header_ = make(http.Header)
  3217  	}
  3218  	return c.header_
  3219  }
  3220  
  3221  func (c *ProjectsLocationsChannelsGetCall) doRequest(alt string) (*http.Response, error) {
  3222  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3223  	if c.ifNoneMatch_ != "" {
  3224  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3225  	}
  3226  	var body io.Reader = nil
  3227  	c.urlParams_.Set("alt", alt)
  3228  	c.urlParams_.Set("prettyPrint", "false")
  3229  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  3230  	urls += "?" + c.urlParams_.Encode()
  3231  	req, err := http.NewRequest("GET", urls, body)
  3232  	if err != nil {
  3233  		return nil, err
  3234  	}
  3235  	req.Header = reqHeaders
  3236  	googleapi.Expand(req.URL, map[string]string{
  3237  		"name": c.name,
  3238  	})
  3239  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3240  }
  3241  
  3242  // Do executes the "eventarc.projects.locations.channels.get" call.
  3243  // Any non-2xx status code is an error. Response headers are in either
  3244  // *Channel.ServerResponse.Header or (if a response was returned at all) in
  3245  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3246  // whether the returned error was because http.StatusNotModified was returned.
  3247  func (c *ProjectsLocationsChannelsGetCall) Do(opts ...googleapi.CallOption) (*Channel, error) {
  3248  	gensupport.SetOptions(c.urlParams_, opts...)
  3249  	res, err := c.doRequest("json")
  3250  	if res != nil && res.StatusCode == http.StatusNotModified {
  3251  		if res.Body != nil {
  3252  			res.Body.Close()
  3253  		}
  3254  		return nil, gensupport.WrapError(&googleapi.Error{
  3255  			Code:   res.StatusCode,
  3256  			Header: res.Header,
  3257  		})
  3258  	}
  3259  	if err != nil {
  3260  		return nil, err
  3261  	}
  3262  	defer googleapi.CloseBody(res)
  3263  	if err := googleapi.CheckResponse(res); err != nil {
  3264  		return nil, gensupport.WrapError(err)
  3265  	}
  3266  	ret := &Channel{
  3267  		ServerResponse: googleapi.ServerResponse{
  3268  			Header:         res.Header,
  3269  			HTTPStatusCode: res.StatusCode,
  3270  		},
  3271  	}
  3272  	target := &ret
  3273  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3274  		return nil, err
  3275  	}
  3276  	return ret, nil
  3277  }
  3278  
  3279  type ProjectsLocationsChannelsGetIamPolicyCall struct {
  3280  	s            *Service
  3281  	resource     string
  3282  	urlParams_   gensupport.URLParams
  3283  	ifNoneMatch_ string
  3284  	ctx_         context.Context
  3285  	header_      http.Header
  3286  }
  3287  
  3288  // GetIamPolicy: Gets the access control policy for a resource. Returns an
  3289  // empty policy if the resource exists and does not have a policy set.
  3290  //
  3291  //   - resource: REQUIRED: The resource for which the policy is being requested.
  3292  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  3293  //     for the appropriate value for this field.
  3294  func (r *ProjectsLocationsChannelsService) GetIamPolicy(resource string) *ProjectsLocationsChannelsGetIamPolicyCall {
  3295  	c := &ProjectsLocationsChannelsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3296  	c.resource = resource
  3297  	return c
  3298  }
  3299  
  3300  // OptionsRequestedPolicyVersion sets the optional parameter
  3301  // "options.requestedPolicyVersion": The maximum policy version that will be
  3302  // used to format the policy. Valid values are 0, 1, and 3. Requests specifying
  3303  // an invalid value will be rejected. Requests for policies with any
  3304  // conditional role bindings must specify version 3. Policies with no
  3305  // conditional role bindings may specify any valid value or leave the field
  3306  // unset. The policy in the response might use the policy version that you
  3307  // specified, or it might use a lower policy version. For example, if you
  3308  // specify version 3, but the policy has no conditional role bindings, the
  3309  // response uses version 1. To learn which resources support conditions in
  3310  // their IAM policies, see the IAM documentation
  3311  // (https://cloud.google.com/iam/help/conditions/resource-policies).
  3312  func (c *ProjectsLocationsChannelsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsChannelsGetIamPolicyCall {
  3313  	c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
  3314  	return c
  3315  }
  3316  
  3317  // Fields allows partial responses to be retrieved. See
  3318  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3319  // details.
  3320  func (c *ProjectsLocationsChannelsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsChannelsGetIamPolicyCall {
  3321  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3322  	return c
  3323  }
  3324  
  3325  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3326  // object's ETag matches the given value. This is useful for getting updates
  3327  // only after the object has changed since the last request.
  3328  func (c *ProjectsLocationsChannelsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsChannelsGetIamPolicyCall {
  3329  	c.ifNoneMatch_ = entityTag
  3330  	return c
  3331  }
  3332  
  3333  // Context sets the context to be used in this call's Do method.
  3334  func (c *ProjectsLocationsChannelsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsChannelsGetIamPolicyCall {
  3335  	c.ctx_ = ctx
  3336  	return c
  3337  }
  3338  
  3339  // Header returns a http.Header that can be modified by the caller to add
  3340  // headers to the request.
  3341  func (c *ProjectsLocationsChannelsGetIamPolicyCall) Header() http.Header {
  3342  	if c.header_ == nil {
  3343  		c.header_ = make(http.Header)
  3344  	}
  3345  	return c.header_
  3346  }
  3347  
  3348  func (c *ProjectsLocationsChannelsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  3349  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3350  	if c.ifNoneMatch_ != "" {
  3351  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3352  	}
  3353  	var body io.Reader = nil
  3354  	c.urlParams_.Set("alt", alt)
  3355  	c.urlParams_.Set("prettyPrint", "false")
  3356  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
  3357  	urls += "?" + c.urlParams_.Encode()
  3358  	req, err := http.NewRequest("GET", urls, body)
  3359  	if err != nil {
  3360  		return nil, err
  3361  	}
  3362  	req.Header = reqHeaders
  3363  	googleapi.Expand(req.URL, map[string]string{
  3364  		"resource": c.resource,
  3365  	})
  3366  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3367  }
  3368  
  3369  // Do executes the "eventarc.projects.locations.channels.getIamPolicy" call.
  3370  // Any non-2xx status code is an error. Response headers are in either
  3371  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  3372  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3373  // whether the returned error was because http.StatusNotModified was returned.
  3374  func (c *ProjectsLocationsChannelsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  3375  	gensupport.SetOptions(c.urlParams_, opts...)
  3376  	res, err := c.doRequest("json")
  3377  	if res != nil && res.StatusCode == http.StatusNotModified {
  3378  		if res.Body != nil {
  3379  			res.Body.Close()
  3380  		}
  3381  		return nil, gensupport.WrapError(&googleapi.Error{
  3382  			Code:   res.StatusCode,
  3383  			Header: res.Header,
  3384  		})
  3385  	}
  3386  	if err != nil {
  3387  		return nil, err
  3388  	}
  3389  	defer googleapi.CloseBody(res)
  3390  	if err := googleapi.CheckResponse(res); err != nil {
  3391  		return nil, gensupport.WrapError(err)
  3392  	}
  3393  	ret := &Policy{
  3394  		ServerResponse: googleapi.ServerResponse{
  3395  			Header:         res.Header,
  3396  			HTTPStatusCode: res.StatusCode,
  3397  		},
  3398  	}
  3399  	target := &ret
  3400  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3401  		return nil, err
  3402  	}
  3403  	return ret, nil
  3404  }
  3405  
  3406  type ProjectsLocationsChannelsListCall struct {
  3407  	s            *Service
  3408  	parent       string
  3409  	urlParams_   gensupport.URLParams
  3410  	ifNoneMatch_ string
  3411  	ctx_         context.Context
  3412  	header_      http.Header
  3413  }
  3414  
  3415  // List: List channels.
  3416  //
  3417  // - parent: The parent collection to list channels on.
  3418  func (r *ProjectsLocationsChannelsService) List(parent string) *ProjectsLocationsChannelsListCall {
  3419  	c := &ProjectsLocationsChannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3420  	c.parent = parent
  3421  	return c
  3422  }
  3423  
  3424  // OrderBy sets the optional parameter "orderBy": The sorting order of the
  3425  // resources returned. Value should be a comma-separated list of fields. The
  3426  // default sorting order is ascending. To specify descending order for a field,
  3427  // append a `desc` suffix; for example: `name desc, channel_id`.
  3428  func (c *ProjectsLocationsChannelsListCall) OrderBy(orderBy string) *ProjectsLocationsChannelsListCall {
  3429  	c.urlParams_.Set("orderBy", orderBy)
  3430  	return c
  3431  }
  3432  
  3433  // PageSize sets the optional parameter "pageSize": The maximum number of
  3434  // channels to return on each page. Note: The service may send fewer.
  3435  func (c *ProjectsLocationsChannelsListCall) PageSize(pageSize int64) *ProjectsLocationsChannelsListCall {
  3436  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3437  	return c
  3438  }
  3439  
  3440  // PageToken sets the optional parameter "pageToken": The page token; provide
  3441  // the value from the `next_page_token` field in a previous `ListChannels` call
  3442  // to retrieve the subsequent page. When paginating, all other parameters
  3443  // provided to `ListChannels` must match the call that provided the page token.
  3444  func (c *ProjectsLocationsChannelsListCall) PageToken(pageToken string) *ProjectsLocationsChannelsListCall {
  3445  	c.urlParams_.Set("pageToken", pageToken)
  3446  	return c
  3447  }
  3448  
  3449  // Fields allows partial responses to be retrieved. See
  3450  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3451  // details.
  3452  func (c *ProjectsLocationsChannelsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsChannelsListCall {
  3453  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3454  	return c
  3455  }
  3456  
  3457  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3458  // object's ETag matches the given value. This is useful for getting updates
  3459  // only after the object has changed since the last request.
  3460  func (c *ProjectsLocationsChannelsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsChannelsListCall {
  3461  	c.ifNoneMatch_ = entityTag
  3462  	return c
  3463  }
  3464  
  3465  // Context sets the context to be used in this call's Do method.
  3466  func (c *ProjectsLocationsChannelsListCall) Context(ctx context.Context) *ProjectsLocationsChannelsListCall {
  3467  	c.ctx_ = ctx
  3468  	return c
  3469  }
  3470  
  3471  // Header returns a http.Header that can be modified by the caller to add
  3472  // headers to the request.
  3473  func (c *ProjectsLocationsChannelsListCall) Header() http.Header {
  3474  	if c.header_ == nil {
  3475  		c.header_ = make(http.Header)
  3476  	}
  3477  	return c.header_
  3478  }
  3479  
  3480  func (c *ProjectsLocationsChannelsListCall) doRequest(alt string) (*http.Response, error) {
  3481  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3482  	if c.ifNoneMatch_ != "" {
  3483  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3484  	}
  3485  	var body io.Reader = nil
  3486  	c.urlParams_.Set("alt", alt)
  3487  	c.urlParams_.Set("prettyPrint", "false")
  3488  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/channels")
  3489  	urls += "?" + c.urlParams_.Encode()
  3490  	req, err := http.NewRequest("GET", urls, body)
  3491  	if err != nil {
  3492  		return nil, err
  3493  	}
  3494  	req.Header = reqHeaders
  3495  	googleapi.Expand(req.URL, map[string]string{
  3496  		"parent": c.parent,
  3497  	})
  3498  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3499  }
  3500  
  3501  // Do executes the "eventarc.projects.locations.channels.list" call.
  3502  // Any non-2xx status code is an error. Response headers are in either
  3503  // *ListChannelsResponse.ServerResponse.Header or (if a response was returned
  3504  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3505  // check whether the returned error was because http.StatusNotModified was
  3506  // returned.
  3507  func (c *ProjectsLocationsChannelsListCall) Do(opts ...googleapi.CallOption) (*ListChannelsResponse, error) {
  3508  	gensupport.SetOptions(c.urlParams_, opts...)
  3509  	res, err := c.doRequest("json")
  3510  	if res != nil && res.StatusCode == http.StatusNotModified {
  3511  		if res.Body != nil {
  3512  			res.Body.Close()
  3513  		}
  3514  		return nil, gensupport.WrapError(&googleapi.Error{
  3515  			Code:   res.StatusCode,
  3516  			Header: res.Header,
  3517  		})
  3518  	}
  3519  	if err != nil {
  3520  		return nil, err
  3521  	}
  3522  	defer googleapi.CloseBody(res)
  3523  	if err := googleapi.CheckResponse(res); err != nil {
  3524  		return nil, gensupport.WrapError(err)
  3525  	}
  3526  	ret := &ListChannelsResponse{
  3527  		ServerResponse: googleapi.ServerResponse{
  3528  			Header:         res.Header,
  3529  			HTTPStatusCode: res.StatusCode,
  3530  		},
  3531  	}
  3532  	target := &ret
  3533  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3534  		return nil, err
  3535  	}
  3536  	return ret, nil
  3537  }
  3538  
  3539  // Pages invokes f for each page of results.
  3540  // A non-nil error returned from f will halt the iteration.
  3541  // The provided context supersedes any context provided to the Context method.
  3542  func (c *ProjectsLocationsChannelsListCall) Pages(ctx context.Context, f func(*ListChannelsResponse) error) error {
  3543  	c.ctx_ = ctx
  3544  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  3545  	for {
  3546  		x, err := c.Do()
  3547  		if err != nil {
  3548  			return err
  3549  		}
  3550  		if err := f(x); err != nil {
  3551  			return err
  3552  		}
  3553  		if x.NextPageToken == "" {
  3554  			return nil
  3555  		}
  3556  		c.PageToken(x.NextPageToken)
  3557  	}
  3558  }
  3559  
  3560  type ProjectsLocationsChannelsPatchCall struct {
  3561  	s          *Service
  3562  	name       string
  3563  	channel    *Channel
  3564  	urlParams_ gensupport.URLParams
  3565  	ctx_       context.Context
  3566  	header_    http.Header
  3567  }
  3568  
  3569  // Patch: Update a single channel.
  3570  //
  3571  //   - name: The resource name of the channel. Must be unique within the location
  3572  //     on the project and must be in
  3573  //     `projects/{project}/locations/{location}/channels/{channel_id}` format.
  3574  func (r *ProjectsLocationsChannelsService) Patch(name string, channel *Channel) *ProjectsLocationsChannelsPatchCall {
  3575  	c := &ProjectsLocationsChannelsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3576  	c.name = name
  3577  	c.channel = channel
  3578  	return c
  3579  }
  3580  
  3581  // UpdateMask sets the optional parameter "updateMask": The fields to be
  3582  // updated; only fields explicitly provided are updated. If no field mask is
  3583  // provided, all provided fields in the request are updated. To update all
  3584  // fields, provide a field mask of "*".
  3585  func (c *ProjectsLocationsChannelsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsChannelsPatchCall {
  3586  	c.urlParams_.Set("updateMask", updateMask)
  3587  	return c
  3588  }
  3589  
  3590  // ValidateOnly sets the optional parameter "validateOnly": If set, validate
  3591  // the request and preview the review, but do not post it.
  3592  func (c *ProjectsLocationsChannelsPatchCall) ValidateOnly(validateOnly bool) *ProjectsLocationsChannelsPatchCall {
  3593  	c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  3594  	return c
  3595  }
  3596  
  3597  // Fields allows partial responses to be retrieved. See
  3598  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3599  // details.
  3600  func (c *ProjectsLocationsChannelsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsChannelsPatchCall {
  3601  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3602  	return c
  3603  }
  3604  
  3605  // Context sets the context to be used in this call's Do method.
  3606  func (c *ProjectsLocationsChannelsPatchCall) Context(ctx context.Context) *ProjectsLocationsChannelsPatchCall {
  3607  	c.ctx_ = ctx
  3608  	return c
  3609  }
  3610  
  3611  // Header returns a http.Header that can be modified by the caller to add
  3612  // headers to the request.
  3613  func (c *ProjectsLocationsChannelsPatchCall) Header() http.Header {
  3614  	if c.header_ == nil {
  3615  		c.header_ = make(http.Header)
  3616  	}
  3617  	return c.header_
  3618  }
  3619  
  3620  func (c *ProjectsLocationsChannelsPatchCall) doRequest(alt string) (*http.Response, error) {
  3621  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3622  	var body io.Reader = nil
  3623  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
  3624  	if err != nil {
  3625  		return nil, err
  3626  	}
  3627  	c.urlParams_.Set("alt", alt)
  3628  	c.urlParams_.Set("prettyPrint", "false")
  3629  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  3630  	urls += "?" + c.urlParams_.Encode()
  3631  	req, err := http.NewRequest("PATCH", urls, body)
  3632  	if err != nil {
  3633  		return nil, err
  3634  	}
  3635  	req.Header = reqHeaders
  3636  	googleapi.Expand(req.URL, map[string]string{
  3637  		"name": c.name,
  3638  	})
  3639  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3640  }
  3641  
  3642  // Do executes the "eventarc.projects.locations.channels.patch" call.
  3643  // Any non-2xx status code is an error. Response headers are in either
  3644  // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
  3645  // returned at all) in error.(*googleapi.Error).Header. Use
  3646  // googleapi.IsNotModified to check whether the returned error was because
  3647  // http.StatusNotModified was returned.
  3648  func (c *ProjectsLocationsChannelsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  3649  	gensupport.SetOptions(c.urlParams_, opts...)
  3650  	res, err := c.doRequest("json")
  3651  	if res != nil && res.StatusCode == http.StatusNotModified {
  3652  		if res.Body != nil {
  3653  			res.Body.Close()
  3654  		}
  3655  		return nil, gensupport.WrapError(&googleapi.Error{
  3656  			Code:   res.StatusCode,
  3657  			Header: res.Header,
  3658  		})
  3659  	}
  3660  	if err != nil {
  3661  		return nil, err
  3662  	}
  3663  	defer googleapi.CloseBody(res)
  3664  	if err := googleapi.CheckResponse(res); err != nil {
  3665  		return nil, gensupport.WrapError(err)
  3666  	}
  3667  	ret := &GoogleLongrunningOperation{
  3668  		ServerResponse: googleapi.ServerResponse{
  3669  			Header:         res.Header,
  3670  			HTTPStatusCode: res.StatusCode,
  3671  		},
  3672  	}
  3673  	target := &ret
  3674  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3675  		return nil, err
  3676  	}
  3677  	return ret, nil
  3678  }
  3679  
  3680  type ProjectsLocationsChannelsSetIamPolicyCall struct {
  3681  	s                   *Service
  3682  	resource            string
  3683  	setiampolicyrequest *SetIamPolicyRequest
  3684  	urlParams_          gensupport.URLParams
  3685  	ctx_                context.Context
  3686  	header_             http.Header
  3687  }
  3688  
  3689  // SetIamPolicy: Sets the access control policy on the specified resource.
  3690  // Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
  3691  // and `PERMISSION_DENIED` errors.
  3692  //
  3693  //   - resource: REQUIRED: The resource for which the policy is being specified.
  3694  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  3695  //     for the appropriate value for this field.
  3696  func (r *ProjectsLocationsChannelsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsChannelsSetIamPolicyCall {
  3697  	c := &ProjectsLocationsChannelsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3698  	c.resource = resource
  3699  	c.setiampolicyrequest = setiampolicyrequest
  3700  	return c
  3701  }
  3702  
  3703  // Fields allows partial responses to be retrieved. See
  3704  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3705  // details.
  3706  func (c *ProjectsLocationsChannelsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsChannelsSetIamPolicyCall {
  3707  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3708  	return c
  3709  }
  3710  
  3711  // Context sets the context to be used in this call's Do method.
  3712  func (c *ProjectsLocationsChannelsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsChannelsSetIamPolicyCall {
  3713  	c.ctx_ = ctx
  3714  	return c
  3715  }
  3716  
  3717  // Header returns a http.Header that can be modified by the caller to add
  3718  // headers to the request.
  3719  func (c *ProjectsLocationsChannelsSetIamPolicyCall) Header() http.Header {
  3720  	if c.header_ == nil {
  3721  		c.header_ = make(http.Header)
  3722  	}
  3723  	return c.header_
  3724  }
  3725  
  3726  func (c *ProjectsLocationsChannelsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  3727  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3728  	var body io.Reader = nil
  3729  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  3730  	if err != nil {
  3731  		return nil, err
  3732  	}
  3733  	c.urlParams_.Set("alt", alt)
  3734  	c.urlParams_.Set("prettyPrint", "false")
  3735  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
  3736  	urls += "?" + c.urlParams_.Encode()
  3737  	req, err := http.NewRequest("POST", urls, body)
  3738  	if err != nil {
  3739  		return nil, err
  3740  	}
  3741  	req.Header = reqHeaders
  3742  	googleapi.Expand(req.URL, map[string]string{
  3743  		"resource": c.resource,
  3744  	})
  3745  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3746  }
  3747  
  3748  // Do executes the "eventarc.projects.locations.channels.setIamPolicy" call.
  3749  // Any non-2xx status code is an error. Response headers are in either
  3750  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  3751  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3752  // whether the returned error was because http.StatusNotModified was returned.
  3753  func (c *ProjectsLocationsChannelsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  3754  	gensupport.SetOptions(c.urlParams_, opts...)
  3755  	res, err := c.doRequest("json")
  3756  	if res != nil && res.StatusCode == http.StatusNotModified {
  3757  		if res.Body != nil {
  3758  			res.Body.Close()
  3759  		}
  3760  		return nil, gensupport.WrapError(&googleapi.Error{
  3761  			Code:   res.StatusCode,
  3762  			Header: res.Header,
  3763  		})
  3764  	}
  3765  	if err != nil {
  3766  		return nil, err
  3767  	}
  3768  	defer googleapi.CloseBody(res)
  3769  	if err := googleapi.CheckResponse(res); err != nil {
  3770  		return nil, gensupport.WrapError(err)
  3771  	}
  3772  	ret := &Policy{
  3773  		ServerResponse: googleapi.ServerResponse{
  3774  			Header:         res.Header,
  3775  			HTTPStatusCode: res.StatusCode,
  3776  		},
  3777  	}
  3778  	target := &ret
  3779  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3780  		return nil, err
  3781  	}
  3782  	return ret, nil
  3783  }
  3784  
  3785  type ProjectsLocationsChannelsTestIamPermissionsCall struct {
  3786  	s                         *Service
  3787  	resource                  string
  3788  	testiampermissionsrequest *TestIamPermissionsRequest
  3789  	urlParams_                gensupport.URLParams
  3790  	ctx_                      context.Context
  3791  	header_                   http.Header
  3792  }
  3793  
  3794  // TestIamPermissions: Returns permissions that a caller has on the specified
  3795  // resource. If the resource does not exist, this will return an empty set of
  3796  // permissions, not a `NOT_FOUND` error. Note: This operation is designed to be
  3797  // used for building permission-aware UIs and command-line tools, not for
  3798  // authorization checking. This operation may "fail open" without warning.
  3799  //
  3800  //   - resource: REQUIRED: The resource for which the policy detail is being
  3801  //     requested. See Resource names
  3802  //     (https://cloud.google.com/apis/design/resource_names) for the appropriate
  3803  //     value for this field.
  3804  func (r *ProjectsLocationsChannelsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsChannelsTestIamPermissionsCall {
  3805  	c := &ProjectsLocationsChannelsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3806  	c.resource = resource
  3807  	c.testiampermissionsrequest = testiampermissionsrequest
  3808  	return c
  3809  }
  3810  
  3811  // Fields allows partial responses to be retrieved. See
  3812  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3813  // details.
  3814  func (c *ProjectsLocationsChannelsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsChannelsTestIamPermissionsCall {
  3815  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3816  	return c
  3817  }
  3818  
  3819  // Context sets the context to be used in this call's Do method.
  3820  func (c *ProjectsLocationsChannelsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsChannelsTestIamPermissionsCall {
  3821  	c.ctx_ = ctx
  3822  	return c
  3823  }
  3824  
  3825  // Header returns a http.Header that can be modified by the caller to add
  3826  // headers to the request.
  3827  func (c *ProjectsLocationsChannelsTestIamPermissionsCall) Header() http.Header {
  3828  	if c.header_ == nil {
  3829  		c.header_ = make(http.Header)
  3830  	}
  3831  	return c.header_
  3832  }
  3833  
  3834  func (c *ProjectsLocationsChannelsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  3835  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3836  	var body io.Reader = nil
  3837  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  3838  	if err != nil {
  3839  		return nil, err
  3840  	}
  3841  	c.urlParams_.Set("alt", alt)
  3842  	c.urlParams_.Set("prettyPrint", "false")
  3843  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
  3844  	urls += "?" + c.urlParams_.Encode()
  3845  	req, err := http.NewRequest("POST", urls, body)
  3846  	if err != nil {
  3847  		return nil, err
  3848  	}
  3849  	req.Header = reqHeaders
  3850  	googleapi.Expand(req.URL, map[string]string{
  3851  		"resource": c.resource,
  3852  	})
  3853  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3854  }
  3855  
  3856  // Do executes the "eventarc.projects.locations.channels.testIamPermissions" call.
  3857  // Any non-2xx status code is an error. Response headers are in either
  3858  // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
  3859  // returned at all) in error.(*googleapi.Error).Header. Use
  3860  // googleapi.IsNotModified to check whether the returned error was because
  3861  // http.StatusNotModified was returned.
  3862  func (c *ProjectsLocationsChannelsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  3863  	gensupport.SetOptions(c.urlParams_, opts...)
  3864  	res, err := c.doRequest("json")
  3865  	if res != nil && res.StatusCode == http.StatusNotModified {
  3866  		if res.Body != nil {
  3867  			res.Body.Close()
  3868  		}
  3869  		return nil, gensupport.WrapError(&googleapi.Error{
  3870  			Code:   res.StatusCode,
  3871  			Header: res.Header,
  3872  		})
  3873  	}
  3874  	if err != nil {
  3875  		return nil, err
  3876  	}
  3877  	defer googleapi.CloseBody(res)
  3878  	if err := googleapi.CheckResponse(res); err != nil {
  3879  		return nil, gensupport.WrapError(err)
  3880  	}
  3881  	ret := &TestIamPermissionsResponse{
  3882  		ServerResponse: googleapi.ServerResponse{
  3883  			Header:         res.Header,
  3884  			HTTPStatusCode: res.StatusCode,
  3885  		},
  3886  	}
  3887  	target := &ret
  3888  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3889  		return nil, err
  3890  	}
  3891  	return ret, nil
  3892  }
  3893  
  3894  type ProjectsLocationsOperationsCancelCall struct {
  3895  	s                                       *Service
  3896  	name                                    string
  3897  	googlelongrunningcanceloperationrequest *GoogleLongrunningCancelOperationRequest
  3898  	urlParams_                              gensupport.URLParams
  3899  	ctx_                                    context.Context
  3900  	header_                                 http.Header
  3901  }
  3902  
  3903  // Cancel: Starts asynchronous cancellation on a long-running operation. The
  3904  // server makes a best effort to cancel the operation, but success is not
  3905  // guaranteed. If the server doesn't support this method, it returns
  3906  // `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or
  3907  // other methods to check whether the cancellation succeeded or whether the
  3908  // operation completed despite cancellation. On successful cancellation, the
  3909  // operation is not deleted; instead, it becomes an operation with an
  3910  // Operation.error value with a google.rpc.Status.code of 1, corresponding to
  3911  // `Code.CANCELLED`.
  3912  //
  3913  // - name: The name of the operation resource to be cancelled.
  3914  func (r *ProjectsLocationsOperationsService) Cancel(name string, googlelongrunningcanceloperationrequest *GoogleLongrunningCancelOperationRequest) *ProjectsLocationsOperationsCancelCall {
  3915  	c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3916  	c.name = name
  3917  	c.googlelongrunningcanceloperationrequest = googlelongrunningcanceloperationrequest
  3918  	return c
  3919  }
  3920  
  3921  // Fields allows partial responses to be retrieved. See
  3922  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3923  // details.
  3924  func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall {
  3925  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3926  	return c
  3927  }
  3928  
  3929  // Context sets the context to be used in this call's Do method.
  3930  func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall {
  3931  	c.ctx_ = ctx
  3932  	return c
  3933  }
  3934  
  3935  // Header returns a http.Header that can be modified by the caller to add
  3936  // headers to the request.
  3937  func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header {
  3938  	if c.header_ == nil {
  3939  		c.header_ = make(http.Header)
  3940  	}
  3941  	return c.header_
  3942  }
  3943  
  3944  func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
  3945  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3946  	var body io.Reader = nil
  3947  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlelongrunningcanceloperationrequest)
  3948  	if err != nil {
  3949  		return nil, err
  3950  	}
  3951  	c.urlParams_.Set("alt", alt)
  3952  	c.urlParams_.Set("prettyPrint", "false")
  3953  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel")
  3954  	urls += "?" + c.urlParams_.Encode()
  3955  	req, err := http.NewRequest("POST", urls, body)
  3956  	if err != nil {
  3957  		return nil, err
  3958  	}
  3959  	req.Header = reqHeaders
  3960  	googleapi.Expand(req.URL, map[string]string{
  3961  		"name": c.name,
  3962  	})
  3963  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3964  }
  3965  
  3966  // Do executes the "eventarc.projects.locations.operations.cancel" call.
  3967  // Any non-2xx status code is an error. Response headers are in either
  3968  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  3969  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3970  // whether the returned error was because http.StatusNotModified was returned.
  3971  func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  3972  	gensupport.SetOptions(c.urlParams_, opts...)
  3973  	res, err := c.doRequest("json")
  3974  	if res != nil && res.StatusCode == http.StatusNotModified {
  3975  		if res.Body != nil {
  3976  			res.Body.Close()
  3977  		}
  3978  		return nil, gensupport.WrapError(&googleapi.Error{
  3979  			Code:   res.StatusCode,
  3980  			Header: res.Header,
  3981  		})
  3982  	}
  3983  	if err != nil {
  3984  		return nil, err
  3985  	}
  3986  	defer googleapi.CloseBody(res)
  3987  	if err := googleapi.CheckResponse(res); err != nil {
  3988  		return nil, gensupport.WrapError(err)
  3989  	}
  3990  	ret := &Empty{
  3991  		ServerResponse: googleapi.ServerResponse{
  3992  			Header:         res.Header,
  3993  			HTTPStatusCode: res.StatusCode,
  3994  		},
  3995  	}
  3996  	target := &ret
  3997  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3998  		return nil, err
  3999  	}
  4000  	return ret, nil
  4001  }
  4002  
  4003  type ProjectsLocationsOperationsDeleteCall struct {
  4004  	s          *Service
  4005  	name       string
  4006  	urlParams_ gensupport.URLParams
  4007  	ctx_       context.Context
  4008  	header_    http.Header
  4009  }
  4010  
  4011  // Delete: Deletes a long-running operation. This method indicates that the
  4012  // client is no longer interested in the operation result. It does not cancel
  4013  // the operation. If the server doesn't support this method, it returns
  4014  // `google.rpc.Code.UNIMPLEMENTED`.
  4015  //
  4016  // - name: The name of the operation resource to be deleted.
  4017  func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall {
  4018  	c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4019  	c.name = name
  4020  	return c
  4021  }
  4022  
  4023  // Fields allows partial responses to be retrieved. See
  4024  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4025  // details.
  4026  func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall {
  4027  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4028  	return c
  4029  }
  4030  
  4031  // Context sets the context to be used in this call's Do method.
  4032  func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall {
  4033  	c.ctx_ = ctx
  4034  	return c
  4035  }
  4036  
  4037  // Header returns a http.Header that can be modified by the caller to add
  4038  // headers to the request.
  4039  func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header {
  4040  	if c.header_ == nil {
  4041  		c.header_ = make(http.Header)
  4042  	}
  4043  	return c.header_
  4044  }
  4045  
  4046  func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  4047  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4048  	var body io.Reader = nil
  4049  	c.urlParams_.Set("alt", alt)
  4050  	c.urlParams_.Set("prettyPrint", "false")
  4051  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  4052  	urls += "?" + c.urlParams_.Encode()
  4053  	req, err := http.NewRequest("DELETE", urls, body)
  4054  	if err != nil {
  4055  		return nil, err
  4056  	}
  4057  	req.Header = reqHeaders
  4058  	googleapi.Expand(req.URL, map[string]string{
  4059  		"name": c.name,
  4060  	})
  4061  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4062  }
  4063  
  4064  // Do executes the "eventarc.projects.locations.operations.delete" call.
  4065  // Any non-2xx status code is an error. Response headers are in either
  4066  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  4067  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4068  // whether the returned error was because http.StatusNotModified was returned.
  4069  func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  4070  	gensupport.SetOptions(c.urlParams_, opts...)
  4071  	res, err := c.doRequest("json")
  4072  	if res != nil && res.StatusCode == http.StatusNotModified {
  4073  		if res.Body != nil {
  4074  			res.Body.Close()
  4075  		}
  4076  		return nil, gensupport.WrapError(&googleapi.Error{
  4077  			Code:   res.StatusCode,
  4078  			Header: res.Header,
  4079  		})
  4080  	}
  4081  	if err != nil {
  4082  		return nil, err
  4083  	}
  4084  	defer googleapi.CloseBody(res)
  4085  	if err := googleapi.CheckResponse(res); err != nil {
  4086  		return nil, gensupport.WrapError(err)
  4087  	}
  4088  	ret := &Empty{
  4089  		ServerResponse: googleapi.ServerResponse{
  4090  			Header:         res.Header,
  4091  			HTTPStatusCode: res.StatusCode,
  4092  		},
  4093  	}
  4094  	target := &ret
  4095  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4096  		return nil, err
  4097  	}
  4098  	return ret, nil
  4099  }
  4100  
  4101  type ProjectsLocationsOperationsGetCall struct {
  4102  	s            *Service
  4103  	name         string
  4104  	urlParams_   gensupport.URLParams
  4105  	ifNoneMatch_ string
  4106  	ctx_         context.Context
  4107  	header_      http.Header
  4108  }
  4109  
  4110  // Get: Gets the latest state of a long-running operation. Clients can use this
  4111  // method to poll the operation result at intervals as recommended by the API
  4112  // service.
  4113  //
  4114  // - name: The name of the operation resource.
  4115  func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
  4116  	c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4117  	c.name = name
  4118  	return c
  4119  }
  4120  
  4121  // Fields allows partial responses to be retrieved. See
  4122  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4123  // details.
  4124  func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
  4125  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4126  	return c
  4127  }
  4128  
  4129  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4130  // object's ETag matches the given value. This is useful for getting updates
  4131  // only after the object has changed since the last request.
  4132  func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
  4133  	c.ifNoneMatch_ = entityTag
  4134  	return c
  4135  }
  4136  
  4137  // Context sets the context to be used in this call's Do method.
  4138  func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
  4139  	c.ctx_ = ctx
  4140  	return c
  4141  }
  4142  
  4143  // Header returns a http.Header that can be modified by the caller to add
  4144  // headers to the request.
  4145  func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
  4146  	if c.header_ == nil {
  4147  		c.header_ = make(http.Header)
  4148  	}
  4149  	return c.header_
  4150  }
  4151  
  4152  func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  4153  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4154  	if c.ifNoneMatch_ != "" {
  4155  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4156  	}
  4157  	var body io.Reader = nil
  4158  	c.urlParams_.Set("alt", alt)
  4159  	c.urlParams_.Set("prettyPrint", "false")
  4160  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  4161  	urls += "?" + c.urlParams_.Encode()
  4162  	req, err := http.NewRequest("GET", urls, body)
  4163  	if err != nil {
  4164  		return nil, err
  4165  	}
  4166  	req.Header = reqHeaders
  4167  	googleapi.Expand(req.URL, map[string]string{
  4168  		"name": c.name,
  4169  	})
  4170  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4171  }
  4172  
  4173  // Do executes the "eventarc.projects.locations.operations.get" call.
  4174  // Any non-2xx status code is an error. Response headers are in either
  4175  // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
  4176  // returned at all) in error.(*googleapi.Error).Header. Use
  4177  // googleapi.IsNotModified to check whether the returned error was because
  4178  // http.StatusNotModified was returned.
  4179  func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  4180  	gensupport.SetOptions(c.urlParams_, opts...)
  4181  	res, err := c.doRequest("json")
  4182  	if res != nil && res.StatusCode == http.StatusNotModified {
  4183  		if res.Body != nil {
  4184  			res.Body.Close()
  4185  		}
  4186  		return nil, gensupport.WrapError(&googleapi.Error{
  4187  			Code:   res.StatusCode,
  4188  			Header: res.Header,
  4189  		})
  4190  	}
  4191  	if err != nil {
  4192  		return nil, err
  4193  	}
  4194  	defer googleapi.CloseBody(res)
  4195  	if err := googleapi.CheckResponse(res); err != nil {
  4196  		return nil, gensupport.WrapError(err)
  4197  	}
  4198  	ret := &GoogleLongrunningOperation{
  4199  		ServerResponse: googleapi.ServerResponse{
  4200  			Header:         res.Header,
  4201  			HTTPStatusCode: res.StatusCode,
  4202  		},
  4203  	}
  4204  	target := &ret
  4205  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4206  		return nil, err
  4207  	}
  4208  	return ret, nil
  4209  }
  4210  
  4211  type ProjectsLocationsOperationsListCall struct {
  4212  	s            *Service
  4213  	name         string
  4214  	urlParams_   gensupport.URLParams
  4215  	ifNoneMatch_ string
  4216  	ctx_         context.Context
  4217  	header_      http.Header
  4218  }
  4219  
  4220  // List: Lists operations that match the specified filter in the request. If
  4221  // the server doesn't support this method, it returns `UNIMPLEMENTED`.
  4222  //
  4223  // - name: The name of the operation's parent resource.
  4224  func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall {
  4225  	c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4226  	c.name = name
  4227  	return c
  4228  }
  4229  
  4230  // Filter sets the optional parameter "filter": The standard list filter.
  4231  func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall {
  4232  	c.urlParams_.Set("filter", filter)
  4233  	return c
  4234  }
  4235  
  4236  // PageSize sets the optional parameter "pageSize": The standard list page
  4237  // size.
  4238  func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall {
  4239  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  4240  	return c
  4241  }
  4242  
  4243  // PageToken sets the optional parameter "pageToken": The standard list page
  4244  // token.
  4245  func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall {
  4246  	c.urlParams_.Set("pageToken", pageToken)
  4247  	return c
  4248  }
  4249  
  4250  // Fields allows partial responses to be retrieved. See
  4251  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4252  // details.
  4253  func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
  4254  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4255  	return c
  4256  }
  4257  
  4258  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4259  // object's ETag matches the given value. This is useful for getting updates
  4260  // only after the object has changed since the last request.
  4261  func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
  4262  	c.ifNoneMatch_ = entityTag
  4263  	return c
  4264  }
  4265  
  4266  // Context sets the context to be used in this call's Do method.
  4267  func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
  4268  	c.ctx_ = ctx
  4269  	return c
  4270  }
  4271  
  4272  // Header returns a http.Header that can be modified by the caller to add
  4273  // headers to the request.
  4274  func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
  4275  	if c.header_ == nil {
  4276  		c.header_ = make(http.Header)
  4277  	}
  4278  	return c.header_
  4279  }
  4280  
  4281  func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
  4282  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4283  	if c.ifNoneMatch_ != "" {
  4284  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4285  	}
  4286  	var body io.Reader = nil
  4287  	c.urlParams_.Set("alt", alt)
  4288  	c.urlParams_.Set("prettyPrint", "false")
  4289  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations")
  4290  	urls += "?" + c.urlParams_.Encode()
  4291  	req, err := http.NewRequest("GET", urls, body)
  4292  	if err != nil {
  4293  		return nil, err
  4294  	}
  4295  	req.Header = reqHeaders
  4296  	googleapi.Expand(req.URL, map[string]string{
  4297  		"name": c.name,
  4298  	})
  4299  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4300  }
  4301  
  4302  // Do executes the "eventarc.projects.locations.operations.list" call.
  4303  // Any non-2xx status code is an error. Response headers are in either
  4304  // *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if a
  4305  // response was returned at all) in error.(*googleapi.Error).Header. Use
  4306  // googleapi.IsNotModified to check whether the returned error was because
  4307  // http.StatusNotModified was returned.
  4308  func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) {
  4309  	gensupport.SetOptions(c.urlParams_, opts...)
  4310  	res, err := c.doRequest("json")
  4311  	if res != nil && res.StatusCode == http.StatusNotModified {
  4312  		if res.Body != nil {
  4313  			res.Body.Close()
  4314  		}
  4315  		return nil, gensupport.WrapError(&googleapi.Error{
  4316  			Code:   res.StatusCode,
  4317  			Header: res.Header,
  4318  		})
  4319  	}
  4320  	if err != nil {
  4321  		return nil, err
  4322  	}
  4323  	defer googleapi.CloseBody(res)
  4324  	if err := googleapi.CheckResponse(res); err != nil {
  4325  		return nil, gensupport.WrapError(err)
  4326  	}
  4327  	ret := &GoogleLongrunningListOperationsResponse{
  4328  		ServerResponse: googleapi.ServerResponse{
  4329  			Header:         res.Header,
  4330  			HTTPStatusCode: res.StatusCode,
  4331  		},
  4332  	}
  4333  	target := &ret
  4334  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4335  		return nil, err
  4336  	}
  4337  	return ret, nil
  4338  }
  4339  
  4340  // Pages invokes f for each page of results.
  4341  // A non-nil error returned from f will halt the iteration.
  4342  // The provided context supersedes any context provided to the Context method.
  4343  func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error {
  4344  	c.ctx_ = ctx
  4345  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  4346  	for {
  4347  		x, err := c.Do()
  4348  		if err != nil {
  4349  			return err
  4350  		}
  4351  		if err := f(x); err != nil {
  4352  			return err
  4353  		}
  4354  		if x.NextPageToken == "" {
  4355  			return nil
  4356  		}
  4357  		c.PageToken(x.NextPageToken)
  4358  	}
  4359  }
  4360  
  4361  type ProjectsLocationsProvidersGetCall struct {
  4362  	s            *Service
  4363  	name         string
  4364  	urlParams_   gensupport.URLParams
  4365  	ifNoneMatch_ string
  4366  	ctx_         context.Context
  4367  	header_      http.Header
  4368  }
  4369  
  4370  // Get: Get a single Provider.
  4371  //
  4372  // - name: The name of the provider to get.
  4373  func (r *ProjectsLocationsProvidersService) Get(name string) *ProjectsLocationsProvidersGetCall {
  4374  	c := &ProjectsLocationsProvidersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4375  	c.name = name
  4376  	return c
  4377  }
  4378  
  4379  // Fields allows partial responses to be retrieved. See
  4380  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4381  // details.
  4382  func (c *ProjectsLocationsProvidersGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsProvidersGetCall {
  4383  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4384  	return c
  4385  }
  4386  
  4387  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4388  // object's ETag matches the given value. This is useful for getting updates
  4389  // only after the object has changed since the last request.
  4390  func (c *ProjectsLocationsProvidersGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsProvidersGetCall {
  4391  	c.ifNoneMatch_ = entityTag
  4392  	return c
  4393  }
  4394  
  4395  // Context sets the context to be used in this call's Do method.
  4396  func (c *ProjectsLocationsProvidersGetCall) Context(ctx context.Context) *ProjectsLocationsProvidersGetCall {
  4397  	c.ctx_ = ctx
  4398  	return c
  4399  }
  4400  
  4401  // Header returns a http.Header that can be modified by the caller to add
  4402  // headers to the request.
  4403  func (c *ProjectsLocationsProvidersGetCall) Header() http.Header {
  4404  	if c.header_ == nil {
  4405  		c.header_ = make(http.Header)
  4406  	}
  4407  	return c.header_
  4408  }
  4409  
  4410  func (c *ProjectsLocationsProvidersGetCall) doRequest(alt string) (*http.Response, error) {
  4411  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4412  	if c.ifNoneMatch_ != "" {
  4413  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4414  	}
  4415  	var body io.Reader = nil
  4416  	c.urlParams_.Set("alt", alt)
  4417  	c.urlParams_.Set("prettyPrint", "false")
  4418  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  4419  	urls += "?" + c.urlParams_.Encode()
  4420  	req, err := http.NewRequest("GET", urls, body)
  4421  	if err != nil {
  4422  		return nil, err
  4423  	}
  4424  	req.Header = reqHeaders
  4425  	googleapi.Expand(req.URL, map[string]string{
  4426  		"name": c.name,
  4427  	})
  4428  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4429  }
  4430  
  4431  // Do executes the "eventarc.projects.locations.providers.get" call.
  4432  // Any non-2xx status code is an error. Response headers are in either
  4433  // *Provider.ServerResponse.Header or (if a response was returned at all) in
  4434  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4435  // whether the returned error was because http.StatusNotModified was returned.
  4436  func (c *ProjectsLocationsProvidersGetCall) Do(opts ...googleapi.CallOption) (*Provider, error) {
  4437  	gensupport.SetOptions(c.urlParams_, opts...)
  4438  	res, err := c.doRequest("json")
  4439  	if res != nil && res.StatusCode == http.StatusNotModified {
  4440  		if res.Body != nil {
  4441  			res.Body.Close()
  4442  		}
  4443  		return nil, gensupport.WrapError(&googleapi.Error{
  4444  			Code:   res.StatusCode,
  4445  			Header: res.Header,
  4446  		})
  4447  	}
  4448  	if err != nil {
  4449  		return nil, err
  4450  	}
  4451  	defer googleapi.CloseBody(res)
  4452  	if err := googleapi.CheckResponse(res); err != nil {
  4453  		return nil, gensupport.WrapError(err)
  4454  	}
  4455  	ret := &Provider{
  4456  		ServerResponse: googleapi.ServerResponse{
  4457  			Header:         res.Header,
  4458  			HTTPStatusCode: res.StatusCode,
  4459  		},
  4460  	}
  4461  	target := &ret
  4462  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4463  		return nil, err
  4464  	}
  4465  	return ret, nil
  4466  }
  4467  
  4468  type ProjectsLocationsProvidersListCall struct {
  4469  	s            *Service
  4470  	parent       string
  4471  	urlParams_   gensupport.URLParams
  4472  	ifNoneMatch_ string
  4473  	ctx_         context.Context
  4474  	header_      http.Header
  4475  }
  4476  
  4477  // List: List providers.
  4478  //
  4479  // - parent: The parent of the provider to get.
  4480  func (r *ProjectsLocationsProvidersService) List(parent string) *ProjectsLocationsProvidersListCall {
  4481  	c := &ProjectsLocationsProvidersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4482  	c.parent = parent
  4483  	return c
  4484  }
  4485  
  4486  // Filter sets the optional parameter "filter": The filter field that the list
  4487  // request will filter on.
  4488  func (c *ProjectsLocationsProvidersListCall) Filter(filter string) *ProjectsLocationsProvidersListCall {
  4489  	c.urlParams_.Set("filter", filter)
  4490  	return c
  4491  }
  4492  
  4493  // OrderBy sets the optional parameter "orderBy": The sorting order of the
  4494  // resources returned. Value should be a comma-separated list of fields. The
  4495  // default sorting oder is ascending. To specify descending order for a field,
  4496  // append a `desc` suffix; for example: `name desc, _id`.
  4497  func (c *ProjectsLocationsProvidersListCall) OrderBy(orderBy string) *ProjectsLocationsProvidersListCall {
  4498  	c.urlParams_.Set("orderBy", orderBy)
  4499  	return c
  4500  }
  4501  
  4502  // PageSize sets the optional parameter "pageSize": The maximum number of
  4503  // providers to return on each page.
  4504  func (c *ProjectsLocationsProvidersListCall) PageSize(pageSize int64) *ProjectsLocationsProvidersListCall {
  4505  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  4506  	return c
  4507  }
  4508  
  4509  // PageToken sets the optional parameter "pageToken": The page token; provide
  4510  // the value from the `next_page_token` field in a previous `ListProviders`
  4511  // call to retrieve the subsequent page. When paginating, all other parameters
  4512  // provided to `ListProviders` must match the call that provided the page
  4513  // token.
  4514  func (c *ProjectsLocationsProvidersListCall) PageToken(pageToken string) *ProjectsLocationsProvidersListCall {
  4515  	c.urlParams_.Set("pageToken", pageToken)
  4516  	return c
  4517  }
  4518  
  4519  // Fields allows partial responses to be retrieved. See
  4520  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4521  // details.
  4522  func (c *ProjectsLocationsProvidersListCall) Fields(s ...googleapi.Field) *ProjectsLocationsProvidersListCall {
  4523  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4524  	return c
  4525  }
  4526  
  4527  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4528  // object's ETag matches the given value. This is useful for getting updates
  4529  // only after the object has changed since the last request.
  4530  func (c *ProjectsLocationsProvidersListCall) IfNoneMatch(entityTag string) *ProjectsLocationsProvidersListCall {
  4531  	c.ifNoneMatch_ = entityTag
  4532  	return c
  4533  }
  4534  
  4535  // Context sets the context to be used in this call's Do method.
  4536  func (c *ProjectsLocationsProvidersListCall) Context(ctx context.Context) *ProjectsLocationsProvidersListCall {
  4537  	c.ctx_ = ctx
  4538  	return c
  4539  }
  4540  
  4541  // Header returns a http.Header that can be modified by the caller to add
  4542  // headers to the request.
  4543  func (c *ProjectsLocationsProvidersListCall) Header() http.Header {
  4544  	if c.header_ == nil {
  4545  		c.header_ = make(http.Header)
  4546  	}
  4547  	return c.header_
  4548  }
  4549  
  4550  func (c *ProjectsLocationsProvidersListCall) doRequest(alt string) (*http.Response, error) {
  4551  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4552  	if c.ifNoneMatch_ != "" {
  4553  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4554  	}
  4555  	var body io.Reader = nil
  4556  	c.urlParams_.Set("alt", alt)
  4557  	c.urlParams_.Set("prettyPrint", "false")
  4558  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/providers")
  4559  	urls += "?" + c.urlParams_.Encode()
  4560  	req, err := http.NewRequest("GET", urls, body)
  4561  	if err != nil {
  4562  		return nil, err
  4563  	}
  4564  	req.Header = reqHeaders
  4565  	googleapi.Expand(req.URL, map[string]string{
  4566  		"parent": c.parent,
  4567  	})
  4568  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4569  }
  4570  
  4571  // Do executes the "eventarc.projects.locations.providers.list" call.
  4572  // Any non-2xx status code is an error. Response headers are in either
  4573  // *ListProvidersResponse.ServerResponse.Header or (if a response was returned
  4574  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4575  // check whether the returned error was because http.StatusNotModified was
  4576  // returned.
  4577  func (c *ProjectsLocationsProvidersListCall) Do(opts ...googleapi.CallOption) (*ListProvidersResponse, error) {
  4578  	gensupport.SetOptions(c.urlParams_, opts...)
  4579  	res, err := c.doRequest("json")
  4580  	if res != nil && res.StatusCode == http.StatusNotModified {
  4581  		if res.Body != nil {
  4582  			res.Body.Close()
  4583  		}
  4584  		return nil, gensupport.WrapError(&googleapi.Error{
  4585  			Code:   res.StatusCode,
  4586  			Header: res.Header,
  4587  		})
  4588  	}
  4589  	if err != nil {
  4590  		return nil, err
  4591  	}
  4592  	defer googleapi.CloseBody(res)
  4593  	if err := googleapi.CheckResponse(res); err != nil {
  4594  		return nil, gensupport.WrapError(err)
  4595  	}
  4596  	ret := &ListProvidersResponse{
  4597  		ServerResponse: googleapi.ServerResponse{
  4598  			Header:         res.Header,
  4599  			HTTPStatusCode: res.StatusCode,
  4600  		},
  4601  	}
  4602  	target := &ret
  4603  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4604  		return nil, err
  4605  	}
  4606  	return ret, nil
  4607  }
  4608  
  4609  // Pages invokes f for each page of results.
  4610  // A non-nil error returned from f will halt the iteration.
  4611  // The provided context supersedes any context provided to the Context method.
  4612  func (c *ProjectsLocationsProvidersListCall) Pages(ctx context.Context, f func(*ListProvidersResponse) error) error {
  4613  	c.ctx_ = ctx
  4614  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  4615  	for {
  4616  		x, err := c.Do()
  4617  		if err != nil {
  4618  			return err
  4619  		}
  4620  		if err := f(x); err != nil {
  4621  			return err
  4622  		}
  4623  		if x.NextPageToken == "" {
  4624  			return nil
  4625  		}
  4626  		c.PageToken(x.NextPageToken)
  4627  	}
  4628  }
  4629  
  4630  type ProjectsLocationsTriggersCreateCall struct {
  4631  	s          *Service
  4632  	parent     string
  4633  	trigger    *Trigger
  4634  	urlParams_ gensupport.URLParams
  4635  	ctx_       context.Context
  4636  	header_    http.Header
  4637  }
  4638  
  4639  // Create: Create a new trigger in a particular project and location.
  4640  //
  4641  // - parent: The parent collection in which to add this trigger.
  4642  func (r *ProjectsLocationsTriggersService) Create(parent string, trigger *Trigger) *ProjectsLocationsTriggersCreateCall {
  4643  	c := &ProjectsLocationsTriggersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4644  	c.parent = parent
  4645  	c.trigger = trigger
  4646  	return c
  4647  }
  4648  
  4649  // TriggerId sets the optional parameter "triggerId": Required. The
  4650  // user-provided ID to be assigned to the trigger.
  4651  func (c *ProjectsLocationsTriggersCreateCall) TriggerId(triggerId string) *ProjectsLocationsTriggersCreateCall {
  4652  	c.urlParams_.Set("triggerId", triggerId)
  4653  	return c
  4654  }
  4655  
  4656  // ValidateOnly sets the optional parameter "validateOnly": If set, validate
  4657  // the request and preview the review, but do not post it.
  4658  func (c *ProjectsLocationsTriggersCreateCall) ValidateOnly(validateOnly bool) *ProjectsLocationsTriggersCreateCall {
  4659  	c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  4660  	return c
  4661  }
  4662  
  4663  // Fields allows partial responses to be retrieved. See
  4664  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4665  // details.
  4666  func (c *ProjectsLocationsTriggersCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsTriggersCreateCall {
  4667  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4668  	return c
  4669  }
  4670  
  4671  // Context sets the context to be used in this call's Do method.
  4672  func (c *ProjectsLocationsTriggersCreateCall) Context(ctx context.Context) *ProjectsLocationsTriggersCreateCall {
  4673  	c.ctx_ = ctx
  4674  	return c
  4675  }
  4676  
  4677  // Header returns a http.Header that can be modified by the caller to add
  4678  // headers to the request.
  4679  func (c *ProjectsLocationsTriggersCreateCall) Header() http.Header {
  4680  	if c.header_ == nil {
  4681  		c.header_ = make(http.Header)
  4682  	}
  4683  	return c.header_
  4684  }
  4685  
  4686  func (c *ProjectsLocationsTriggersCreateCall) doRequest(alt string) (*http.Response, error) {
  4687  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4688  	var body io.Reader = nil
  4689  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.trigger)
  4690  	if err != nil {
  4691  		return nil, err
  4692  	}
  4693  	c.urlParams_.Set("alt", alt)
  4694  	c.urlParams_.Set("prettyPrint", "false")
  4695  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/triggers")
  4696  	urls += "?" + c.urlParams_.Encode()
  4697  	req, err := http.NewRequest("POST", urls, body)
  4698  	if err != nil {
  4699  		return nil, err
  4700  	}
  4701  	req.Header = reqHeaders
  4702  	googleapi.Expand(req.URL, map[string]string{
  4703  		"parent": c.parent,
  4704  	})
  4705  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4706  }
  4707  
  4708  // Do executes the "eventarc.projects.locations.triggers.create" call.
  4709  // Any non-2xx status code is an error. Response headers are in either
  4710  // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
  4711  // returned at all) in error.(*googleapi.Error).Header. Use
  4712  // googleapi.IsNotModified to check whether the returned error was because
  4713  // http.StatusNotModified was returned.
  4714  func (c *ProjectsLocationsTriggersCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  4715  	gensupport.SetOptions(c.urlParams_, opts...)
  4716  	res, err := c.doRequest("json")
  4717  	if res != nil && res.StatusCode == http.StatusNotModified {
  4718  		if res.Body != nil {
  4719  			res.Body.Close()
  4720  		}
  4721  		return nil, gensupport.WrapError(&googleapi.Error{
  4722  			Code:   res.StatusCode,
  4723  			Header: res.Header,
  4724  		})
  4725  	}
  4726  	if err != nil {
  4727  		return nil, err
  4728  	}
  4729  	defer googleapi.CloseBody(res)
  4730  	if err := googleapi.CheckResponse(res); err != nil {
  4731  		return nil, gensupport.WrapError(err)
  4732  	}
  4733  	ret := &GoogleLongrunningOperation{
  4734  		ServerResponse: googleapi.ServerResponse{
  4735  			Header:         res.Header,
  4736  			HTTPStatusCode: res.StatusCode,
  4737  		},
  4738  	}
  4739  	target := &ret
  4740  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4741  		return nil, err
  4742  	}
  4743  	return ret, nil
  4744  }
  4745  
  4746  type ProjectsLocationsTriggersDeleteCall struct {
  4747  	s          *Service
  4748  	name       string
  4749  	urlParams_ gensupport.URLParams
  4750  	ctx_       context.Context
  4751  	header_    http.Header
  4752  }
  4753  
  4754  // Delete: Delete a single trigger.
  4755  //
  4756  // - name: The name of the trigger to be deleted.
  4757  func (r *ProjectsLocationsTriggersService) Delete(name string) *ProjectsLocationsTriggersDeleteCall {
  4758  	c := &ProjectsLocationsTriggersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4759  	c.name = name
  4760  	return c
  4761  }
  4762  
  4763  // AllowMissing sets the optional parameter "allowMissing": If set to true, and
  4764  // the trigger is not found, the request will succeed but no action will be
  4765  // taken on the server.
  4766  func (c *ProjectsLocationsTriggersDeleteCall) AllowMissing(allowMissing bool) *ProjectsLocationsTriggersDeleteCall {
  4767  	c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing))
  4768  	return c
  4769  }
  4770  
  4771  // Etag sets the optional parameter "etag": If provided, the trigger will only
  4772  // be deleted if the etag matches the current etag on the resource.
  4773  func (c *ProjectsLocationsTriggersDeleteCall) Etag(etag string) *ProjectsLocationsTriggersDeleteCall {
  4774  	c.urlParams_.Set("etag", etag)
  4775  	return c
  4776  }
  4777  
  4778  // ValidateOnly sets the optional parameter "validateOnly": If set, validate
  4779  // the request and preview the review, but do not post it.
  4780  func (c *ProjectsLocationsTriggersDeleteCall) ValidateOnly(validateOnly bool) *ProjectsLocationsTriggersDeleteCall {
  4781  	c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  4782  	return c
  4783  }
  4784  
  4785  // Fields allows partial responses to be retrieved. See
  4786  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4787  // details.
  4788  func (c *ProjectsLocationsTriggersDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsTriggersDeleteCall {
  4789  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4790  	return c
  4791  }
  4792  
  4793  // Context sets the context to be used in this call's Do method.
  4794  func (c *ProjectsLocationsTriggersDeleteCall) Context(ctx context.Context) *ProjectsLocationsTriggersDeleteCall {
  4795  	c.ctx_ = ctx
  4796  	return c
  4797  }
  4798  
  4799  // Header returns a http.Header that can be modified by the caller to add
  4800  // headers to the request.
  4801  func (c *ProjectsLocationsTriggersDeleteCall) Header() http.Header {
  4802  	if c.header_ == nil {
  4803  		c.header_ = make(http.Header)
  4804  	}
  4805  	return c.header_
  4806  }
  4807  
  4808  func (c *ProjectsLocationsTriggersDeleteCall) doRequest(alt string) (*http.Response, error) {
  4809  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4810  	var body io.Reader = nil
  4811  	c.urlParams_.Set("alt", alt)
  4812  	c.urlParams_.Set("prettyPrint", "false")
  4813  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  4814  	urls += "?" + c.urlParams_.Encode()
  4815  	req, err := http.NewRequest("DELETE", urls, body)
  4816  	if err != nil {
  4817  		return nil, err
  4818  	}
  4819  	req.Header = reqHeaders
  4820  	googleapi.Expand(req.URL, map[string]string{
  4821  		"name": c.name,
  4822  	})
  4823  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4824  }
  4825  
  4826  // Do executes the "eventarc.projects.locations.triggers.delete" call.
  4827  // Any non-2xx status code is an error. Response headers are in either
  4828  // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
  4829  // returned at all) in error.(*googleapi.Error).Header. Use
  4830  // googleapi.IsNotModified to check whether the returned error was because
  4831  // http.StatusNotModified was returned.
  4832  func (c *ProjectsLocationsTriggersDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  4833  	gensupport.SetOptions(c.urlParams_, opts...)
  4834  	res, err := c.doRequest("json")
  4835  	if res != nil && res.StatusCode == http.StatusNotModified {
  4836  		if res.Body != nil {
  4837  			res.Body.Close()
  4838  		}
  4839  		return nil, gensupport.WrapError(&googleapi.Error{
  4840  			Code:   res.StatusCode,
  4841  			Header: res.Header,
  4842  		})
  4843  	}
  4844  	if err != nil {
  4845  		return nil, err
  4846  	}
  4847  	defer googleapi.CloseBody(res)
  4848  	if err := googleapi.CheckResponse(res); err != nil {
  4849  		return nil, gensupport.WrapError(err)
  4850  	}
  4851  	ret := &GoogleLongrunningOperation{
  4852  		ServerResponse: googleapi.ServerResponse{
  4853  			Header:         res.Header,
  4854  			HTTPStatusCode: res.StatusCode,
  4855  		},
  4856  	}
  4857  	target := &ret
  4858  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4859  		return nil, err
  4860  	}
  4861  	return ret, nil
  4862  }
  4863  
  4864  type ProjectsLocationsTriggersGetCall struct {
  4865  	s            *Service
  4866  	name         string
  4867  	urlParams_   gensupport.URLParams
  4868  	ifNoneMatch_ string
  4869  	ctx_         context.Context
  4870  	header_      http.Header
  4871  }
  4872  
  4873  // Get: Get a single trigger.
  4874  //
  4875  // - name: The name of the trigger to get.
  4876  func (r *ProjectsLocationsTriggersService) Get(name string) *ProjectsLocationsTriggersGetCall {
  4877  	c := &ProjectsLocationsTriggersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4878  	c.name = name
  4879  	return c
  4880  }
  4881  
  4882  // Fields allows partial responses to be retrieved. See
  4883  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4884  // details.
  4885  func (c *ProjectsLocationsTriggersGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsTriggersGetCall {
  4886  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4887  	return c
  4888  }
  4889  
  4890  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4891  // object's ETag matches the given value. This is useful for getting updates
  4892  // only after the object has changed since the last request.
  4893  func (c *ProjectsLocationsTriggersGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsTriggersGetCall {
  4894  	c.ifNoneMatch_ = entityTag
  4895  	return c
  4896  }
  4897  
  4898  // Context sets the context to be used in this call's Do method.
  4899  func (c *ProjectsLocationsTriggersGetCall) Context(ctx context.Context) *ProjectsLocationsTriggersGetCall {
  4900  	c.ctx_ = ctx
  4901  	return c
  4902  }
  4903  
  4904  // Header returns a http.Header that can be modified by the caller to add
  4905  // headers to the request.
  4906  func (c *ProjectsLocationsTriggersGetCall) Header() http.Header {
  4907  	if c.header_ == nil {
  4908  		c.header_ = make(http.Header)
  4909  	}
  4910  	return c.header_
  4911  }
  4912  
  4913  func (c *ProjectsLocationsTriggersGetCall) doRequest(alt string) (*http.Response, error) {
  4914  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4915  	if c.ifNoneMatch_ != "" {
  4916  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4917  	}
  4918  	var body io.Reader = nil
  4919  	c.urlParams_.Set("alt", alt)
  4920  	c.urlParams_.Set("prettyPrint", "false")
  4921  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  4922  	urls += "?" + c.urlParams_.Encode()
  4923  	req, err := http.NewRequest("GET", urls, body)
  4924  	if err != nil {
  4925  		return nil, err
  4926  	}
  4927  	req.Header = reqHeaders
  4928  	googleapi.Expand(req.URL, map[string]string{
  4929  		"name": c.name,
  4930  	})
  4931  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4932  }
  4933  
  4934  // Do executes the "eventarc.projects.locations.triggers.get" call.
  4935  // Any non-2xx status code is an error. Response headers are in either
  4936  // *Trigger.ServerResponse.Header or (if a response was returned at all) in
  4937  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4938  // whether the returned error was because http.StatusNotModified was returned.
  4939  func (c *ProjectsLocationsTriggersGetCall) Do(opts ...googleapi.CallOption) (*Trigger, error) {
  4940  	gensupport.SetOptions(c.urlParams_, opts...)
  4941  	res, err := c.doRequest("json")
  4942  	if res != nil && res.StatusCode == http.StatusNotModified {
  4943  		if res.Body != nil {
  4944  			res.Body.Close()
  4945  		}
  4946  		return nil, gensupport.WrapError(&googleapi.Error{
  4947  			Code:   res.StatusCode,
  4948  			Header: res.Header,
  4949  		})
  4950  	}
  4951  	if err != nil {
  4952  		return nil, err
  4953  	}
  4954  	defer googleapi.CloseBody(res)
  4955  	if err := googleapi.CheckResponse(res); err != nil {
  4956  		return nil, gensupport.WrapError(err)
  4957  	}
  4958  	ret := &Trigger{
  4959  		ServerResponse: googleapi.ServerResponse{
  4960  			Header:         res.Header,
  4961  			HTTPStatusCode: res.StatusCode,
  4962  		},
  4963  	}
  4964  	target := &ret
  4965  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4966  		return nil, err
  4967  	}
  4968  	return ret, nil
  4969  }
  4970  
  4971  type ProjectsLocationsTriggersGetIamPolicyCall struct {
  4972  	s            *Service
  4973  	resource     string
  4974  	urlParams_   gensupport.URLParams
  4975  	ifNoneMatch_ string
  4976  	ctx_         context.Context
  4977  	header_      http.Header
  4978  }
  4979  
  4980  // GetIamPolicy: Gets the access control policy for a resource. Returns an
  4981  // empty policy if the resource exists and does not have a policy set.
  4982  //
  4983  //   - resource: REQUIRED: The resource for which the policy is being requested.
  4984  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  4985  //     for the appropriate value for this field.
  4986  func (r *ProjectsLocationsTriggersService) GetIamPolicy(resource string) *ProjectsLocationsTriggersGetIamPolicyCall {
  4987  	c := &ProjectsLocationsTriggersGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4988  	c.resource = resource
  4989  	return c
  4990  }
  4991  
  4992  // OptionsRequestedPolicyVersion sets the optional parameter
  4993  // "options.requestedPolicyVersion": The maximum policy version that will be
  4994  // used to format the policy. Valid values are 0, 1, and 3. Requests specifying
  4995  // an invalid value will be rejected. Requests for policies with any
  4996  // conditional role bindings must specify version 3. Policies with no
  4997  // conditional role bindings may specify any valid value or leave the field
  4998  // unset. The policy in the response might use the policy version that you
  4999  // specified, or it might use a lower policy version. For example, if you
  5000  // specify version 3, but the policy has no conditional role bindings, the
  5001  // response uses version 1. To learn which resources support conditions in
  5002  // their IAM policies, see the IAM documentation
  5003  // (https://cloud.google.com/iam/help/conditions/resource-policies).
  5004  func (c *ProjectsLocationsTriggersGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsTriggersGetIamPolicyCall {
  5005  	c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
  5006  	return c
  5007  }
  5008  
  5009  // Fields allows partial responses to be retrieved. See
  5010  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5011  // details.
  5012  func (c *ProjectsLocationsTriggersGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsTriggersGetIamPolicyCall {
  5013  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5014  	return c
  5015  }
  5016  
  5017  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  5018  // object's ETag matches the given value. This is useful for getting updates
  5019  // only after the object has changed since the last request.
  5020  func (c *ProjectsLocationsTriggersGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsTriggersGetIamPolicyCall {
  5021  	c.ifNoneMatch_ = entityTag
  5022  	return c
  5023  }
  5024  
  5025  // Context sets the context to be used in this call's Do method.
  5026  func (c *ProjectsLocationsTriggersGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsTriggersGetIamPolicyCall {
  5027  	c.ctx_ = ctx
  5028  	return c
  5029  }
  5030  
  5031  // Header returns a http.Header that can be modified by the caller to add
  5032  // headers to the request.
  5033  func (c *ProjectsLocationsTriggersGetIamPolicyCall) Header() http.Header {
  5034  	if c.header_ == nil {
  5035  		c.header_ = make(http.Header)
  5036  	}
  5037  	return c.header_
  5038  }
  5039  
  5040  func (c *ProjectsLocationsTriggersGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  5041  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  5042  	if c.ifNoneMatch_ != "" {
  5043  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5044  	}
  5045  	var body io.Reader = nil
  5046  	c.urlParams_.Set("alt", alt)
  5047  	c.urlParams_.Set("prettyPrint", "false")
  5048  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
  5049  	urls += "?" + c.urlParams_.Encode()
  5050  	req, err := http.NewRequest("GET", urls, body)
  5051  	if err != nil {
  5052  		return nil, err
  5053  	}
  5054  	req.Header = reqHeaders
  5055  	googleapi.Expand(req.URL, map[string]string{
  5056  		"resource": c.resource,
  5057  	})
  5058  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5059  }
  5060  
  5061  // Do executes the "eventarc.projects.locations.triggers.getIamPolicy" call.
  5062  // Any non-2xx status code is an error. Response headers are in either
  5063  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  5064  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5065  // whether the returned error was because http.StatusNotModified was returned.
  5066  func (c *ProjectsLocationsTriggersGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  5067  	gensupport.SetOptions(c.urlParams_, opts...)
  5068  	res, err := c.doRequest("json")
  5069  	if res != nil && res.StatusCode == http.StatusNotModified {
  5070  		if res.Body != nil {
  5071  			res.Body.Close()
  5072  		}
  5073  		return nil, gensupport.WrapError(&googleapi.Error{
  5074  			Code:   res.StatusCode,
  5075  			Header: res.Header,
  5076  		})
  5077  	}
  5078  	if err != nil {
  5079  		return nil, err
  5080  	}
  5081  	defer googleapi.CloseBody(res)
  5082  	if err := googleapi.CheckResponse(res); err != nil {
  5083  		return nil, gensupport.WrapError(err)
  5084  	}
  5085  	ret := &Policy{
  5086  		ServerResponse: googleapi.ServerResponse{
  5087  			Header:         res.Header,
  5088  			HTTPStatusCode: res.StatusCode,
  5089  		},
  5090  	}
  5091  	target := &ret
  5092  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5093  		return nil, err
  5094  	}
  5095  	return ret, nil
  5096  }
  5097  
  5098  type ProjectsLocationsTriggersListCall struct {
  5099  	s            *Service
  5100  	parent       string
  5101  	urlParams_   gensupport.URLParams
  5102  	ifNoneMatch_ string
  5103  	ctx_         context.Context
  5104  	header_      http.Header
  5105  }
  5106  
  5107  // List: List triggers.
  5108  //
  5109  // - parent: The parent collection to list triggers on.
  5110  func (r *ProjectsLocationsTriggersService) List(parent string) *ProjectsLocationsTriggersListCall {
  5111  	c := &ProjectsLocationsTriggersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5112  	c.parent = parent
  5113  	return c
  5114  }
  5115  
  5116  // Filter sets the optional parameter "filter": Filter field. Used to filter
  5117  // the Triggers to be listed. Possible filters are described in
  5118  // https://google.aip.dev/160. For example, using "?filter=destination:gke"
  5119  // would list only Triggers with a gke destination.
  5120  func (c *ProjectsLocationsTriggersListCall) Filter(filter string) *ProjectsLocationsTriggersListCall {
  5121  	c.urlParams_.Set("filter", filter)
  5122  	return c
  5123  }
  5124  
  5125  // OrderBy sets the optional parameter "orderBy": The sorting order of the
  5126  // resources returned. Value should be a comma-separated list of fields. The
  5127  // default sorting order is ascending. To specify descending order for a field,
  5128  // append a `desc` suffix; for example: `name desc, trigger_id`.
  5129  func (c *ProjectsLocationsTriggersListCall) OrderBy(orderBy string) *ProjectsLocationsTriggersListCall {
  5130  	c.urlParams_.Set("orderBy", orderBy)
  5131  	return c
  5132  }
  5133  
  5134  // PageSize sets the optional parameter "pageSize": The maximum number of
  5135  // triggers to return on each page. Note: The service may send fewer.
  5136  func (c *ProjectsLocationsTriggersListCall) PageSize(pageSize int64) *ProjectsLocationsTriggersListCall {
  5137  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  5138  	return c
  5139  }
  5140  
  5141  // PageToken sets the optional parameter "pageToken": The page token; provide
  5142  // the value from the `next_page_token` field in a previous `ListTriggers` call
  5143  // to retrieve the subsequent page. When paginating, all other parameters
  5144  // provided to `ListTriggers` must match the call that provided the page token.
  5145  func (c *ProjectsLocationsTriggersListCall) PageToken(pageToken string) *ProjectsLocationsTriggersListCall {
  5146  	c.urlParams_.Set("pageToken", pageToken)
  5147  	return c
  5148  }
  5149  
  5150  // Fields allows partial responses to be retrieved. See
  5151  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5152  // details.
  5153  func (c *ProjectsLocationsTriggersListCall) Fields(s ...googleapi.Field) *ProjectsLocationsTriggersListCall {
  5154  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5155  	return c
  5156  }
  5157  
  5158  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  5159  // object's ETag matches the given value. This is useful for getting updates
  5160  // only after the object has changed since the last request.
  5161  func (c *ProjectsLocationsTriggersListCall) IfNoneMatch(entityTag string) *ProjectsLocationsTriggersListCall {
  5162  	c.ifNoneMatch_ = entityTag
  5163  	return c
  5164  }
  5165  
  5166  // Context sets the context to be used in this call's Do method.
  5167  func (c *ProjectsLocationsTriggersListCall) Context(ctx context.Context) *ProjectsLocationsTriggersListCall {
  5168  	c.ctx_ = ctx
  5169  	return c
  5170  }
  5171  
  5172  // Header returns a http.Header that can be modified by the caller to add
  5173  // headers to the request.
  5174  func (c *ProjectsLocationsTriggersListCall) Header() http.Header {
  5175  	if c.header_ == nil {
  5176  		c.header_ = make(http.Header)
  5177  	}
  5178  	return c.header_
  5179  }
  5180  
  5181  func (c *ProjectsLocationsTriggersListCall) doRequest(alt string) (*http.Response, error) {
  5182  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  5183  	if c.ifNoneMatch_ != "" {
  5184  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5185  	}
  5186  	var body io.Reader = nil
  5187  	c.urlParams_.Set("alt", alt)
  5188  	c.urlParams_.Set("prettyPrint", "false")
  5189  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/triggers")
  5190  	urls += "?" + c.urlParams_.Encode()
  5191  	req, err := http.NewRequest("GET", urls, body)
  5192  	if err != nil {
  5193  		return nil, err
  5194  	}
  5195  	req.Header = reqHeaders
  5196  	googleapi.Expand(req.URL, map[string]string{
  5197  		"parent": c.parent,
  5198  	})
  5199  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5200  }
  5201  
  5202  // Do executes the "eventarc.projects.locations.triggers.list" call.
  5203  // Any non-2xx status code is an error. Response headers are in either
  5204  // *ListTriggersResponse.ServerResponse.Header or (if a response was returned
  5205  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5206  // check whether the returned error was because http.StatusNotModified was
  5207  // returned.
  5208  func (c *ProjectsLocationsTriggersListCall) Do(opts ...googleapi.CallOption) (*ListTriggersResponse, error) {
  5209  	gensupport.SetOptions(c.urlParams_, opts...)
  5210  	res, err := c.doRequest("json")
  5211  	if res != nil && res.StatusCode == http.StatusNotModified {
  5212  		if res.Body != nil {
  5213  			res.Body.Close()
  5214  		}
  5215  		return nil, gensupport.WrapError(&googleapi.Error{
  5216  			Code:   res.StatusCode,
  5217  			Header: res.Header,
  5218  		})
  5219  	}
  5220  	if err != nil {
  5221  		return nil, err
  5222  	}
  5223  	defer googleapi.CloseBody(res)
  5224  	if err := googleapi.CheckResponse(res); err != nil {
  5225  		return nil, gensupport.WrapError(err)
  5226  	}
  5227  	ret := &ListTriggersResponse{
  5228  		ServerResponse: googleapi.ServerResponse{
  5229  			Header:         res.Header,
  5230  			HTTPStatusCode: res.StatusCode,
  5231  		},
  5232  	}
  5233  	target := &ret
  5234  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5235  		return nil, err
  5236  	}
  5237  	return ret, nil
  5238  }
  5239  
  5240  // Pages invokes f for each page of results.
  5241  // A non-nil error returned from f will halt the iteration.
  5242  // The provided context supersedes any context provided to the Context method.
  5243  func (c *ProjectsLocationsTriggersListCall) Pages(ctx context.Context, f func(*ListTriggersResponse) error) error {
  5244  	c.ctx_ = ctx
  5245  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  5246  	for {
  5247  		x, err := c.Do()
  5248  		if err != nil {
  5249  			return err
  5250  		}
  5251  		if err := f(x); err != nil {
  5252  			return err
  5253  		}
  5254  		if x.NextPageToken == "" {
  5255  			return nil
  5256  		}
  5257  		c.PageToken(x.NextPageToken)
  5258  	}
  5259  }
  5260  
  5261  type ProjectsLocationsTriggersPatchCall struct {
  5262  	s          *Service
  5263  	name       string
  5264  	trigger    *Trigger
  5265  	urlParams_ gensupport.URLParams
  5266  	ctx_       context.Context
  5267  	header_    http.Header
  5268  }
  5269  
  5270  // Patch: Update a single trigger.
  5271  //
  5272  //   - name: The resource name of the trigger. Must be unique within the location
  5273  //     of the project and must be in
  5274  //     `projects/{project}/locations/{location}/triggers/{trigger}` format.
  5275  func (r *ProjectsLocationsTriggersService) Patch(name string, trigger *Trigger) *ProjectsLocationsTriggersPatchCall {
  5276  	c := &ProjectsLocationsTriggersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5277  	c.name = name
  5278  	c.trigger = trigger
  5279  	return c
  5280  }
  5281  
  5282  // AllowMissing sets the optional parameter "allowMissing": If set to true, and
  5283  // the trigger is not found, a new trigger will be created. In this situation,
  5284  // `update_mask` is ignored.
  5285  func (c *ProjectsLocationsTriggersPatchCall) AllowMissing(allowMissing bool) *ProjectsLocationsTriggersPatchCall {
  5286  	c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing))
  5287  	return c
  5288  }
  5289  
  5290  // UpdateMask sets the optional parameter "updateMask": The fields to be
  5291  // updated; only fields explicitly provided are updated. If no field mask is
  5292  // provided, all provided fields in the request are updated. To update all
  5293  // fields, provide a field mask of "*".
  5294  func (c *ProjectsLocationsTriggersPatchCall) UpdateMask(updateMask string) *ProjectsLocationsTriggersPatchCall {
  5295  	c.urlParams_.Set("updateMask", updateMask)
  5296  	return c
  5297  }
  5298  
  5299  // ValidateOnly sets the optional parameter "validateOnly": If set, validate
  5300  // the request and preview the review, but do not post it.
  5301  func (c *ProjectsLocationsTriggersPatchCall) ValidateOnly(validateOnly bool) *ProjectsLocationsTriggersPatchCall {
  5302  	c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  5303  	return c
  5304  }
  5305  
  5306  // Fields allows partial responses to be retrieved. See
  5307  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5308  // details.
  5309  func (c *ProjectsLocationsTriggersPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsTriggersPatchCall {
  5310  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5311  	return c
  5312  }
  5313  
  5314  // Context sets the context to be used in this call's Do method.
  5315  func (c *ProjectsLocationsTriggersPatchCall) Context(ctx context.Context) *ProjectsLocationsTriggersPatchCall {
  5316  	c.ctx_ = ctx
  5317  	return c
  5318  }
  5319  
  5320  // Header returns a http.Header that can be modified by the caller to add
  5321  // headers to the request.
  5322  func (c *ProjectsLocationsTriggersPatchCall) Header() http.Header {
  5323  	if c.header_ == nil {
  5324  		c.header_ = make(http.Header)
  5325  	}
  5326  	return c.header_
  5327  }
  5328  
  5329  func (c *ProjectsLocationsTriggersPatchCall) doRequest(alt string) (*http.Response, error) {
  5330  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  5331  	var body io.Reader = nil
  5332  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.trigger)
  5333  	if err != nil {
  5334  		return nil, err
  5335  	}
  5336  	c.urlParams_.Set("alt", alt)
  5337  	c.urlParams_.Set("prettyPrint", "false")
  5338  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  5339  	urls += "?" + c.urlParams_.Encode()
  5340  	req, err := http.NewRequest("PATCH", urls, body)
  5341  	if err != nil {
  5342  		return nil, err
  5343  	}
  5344  	req.Header = reqHeaders
  5345  	googleapi.Expand(req.URL, map[string]string{
  5346  		"name": c.name,
  5347  	})
  5348  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5349  }
  5350  
  5351  // Do executes the "eventarc.projects.locations.triggers.patch" call.
  5352  // Any non-2xx status code is an error. Response headers are in either
  5353  // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
  5354  // returned at all) in error.(*googleapi.Error).Header. Use
  5355  // googleapi.IsNotModified to check whether the returned error was because
  5356  // http.StatusNotModified was returned.
  5357  func (c *ProjectsLocationsTriggersPatchCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  5358  	gensupport.SetOptions(c.urlParams_, opts...)
  5359  	res, err := c.doRequest("json")
  5360  	if res != nil && res.StatusCode == http.StatusNotModified {
  5361  		if res.Body != nil {
  5362  			res.Body.Close()
  5363  		}
  5364  		return nil, gensupport.WrapError(&googleapi.Error{
  5365  			Code:   res.StatusCode,
  5366  			Header: res.Header,
  5367  		})
  5368  	}
  5369  	if err != nil {
  5370  		return nil, err
  5371  	}
  5372  	defer googleapi.CloseBody(res)
  5373  	if err := googleapi.CheckResponse(res); err != nil {
  5374  		return nil, gensupport.WrapError(err)
  5375  	}
  5376  	ret := &GoogleLongrunningOperation{
  5377  		ServerResponse: googleapi.ServerResponse{
  5378  			Header:         res.Header,
  5379  			HTTPStatusCode: res.StatusCode,
  5380  		},
  5381  	}
  5382  	target := &ret
  5383  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5384  		return nil, err
  5385  	}
  5386  	return ret, nil
  5387  }
  5388  
  5389  type ProjectsLocationsTriggersSetIamPolicyCall struct {
  5390  	s                   *Service
  5391  	resource            string
  5392  	setiampolicyrequest *SetIamPolicyRequest
  5393  	urlParams_          gensupport.URLParams
  5394  	ctx_                context.Context
  5395  	header_             http.Header
  5396  }
  5397  
  5398  // SetIamPolicy: Sets the access control policy on the specified resource.
  5399  // Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
  5400  // and `PERMISSION_DENIED` errors.
  5401  //
  5402  //   - resource: REQUIRED: The resource for which the policy is being specified.
  5403  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  5404  //     for the appropriate value for this field.
  5405  func (r *ProjectsLocationsTriggersService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsTriggersSetIamPolicyCall {
  5406  	c := &ProjectsLocationsTriggersSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5407  	c.resource = resource
  5408  	c.setiampolicyrequest = setiampolicyrequest
  5409  	return c
  5410  }
  5411  
  5412  // Fields allows partial responses to be retrieved. See
  5413  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5414  // details.
  5415  func (c *ProjectsLocationsTriggersSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsTriggersSetIamPolicyCall {
  5416  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5417  	return c
  5418  }
  5419  
  5420  // Context sets the context to be used in this call's Do method.
  5421  func (c *ProjectsLocationsTriggersSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsTriggersSetIamPolicyCall {
  5422  	c.ctx_ = ctx
  5423  	return c
  5424  }
  5425  
  5426  // Header returns a http.Header that can be modified by the caller to add
  5427  // headers to the request.
  5428  func (c *ProjectsLocationsTriggersSetIamPolicyCall) Header() http.Header {
  5429  	if c.header_ == nil {
  5430  		c.header_ = make(http.Header)
  5431  	}
  5432  	return c.header_
  5433  }
  5434  
  5435  func (c *ProjectsLocationsTriggersSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  5436  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  5437  	var body io.Reader = nil
  5438  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  5439  	if err != nil {
  5440  		return nil, err
  5441  	}
  5442  	c.urlParams_.Set("alt", alt)
  5443  	c.urlParams_.Set("prettyPrint", "false")
  5444  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
  5445  	urls += "?" + c.urlParams_.Encode()
  5446  	req, err := http.NewRequest("POST", urls, body)
  5447  	if err != nil {
  5448  		return nil, err
  5449  	}
  5450  	req.Header = reqHeaders
  5451  	googleapi.Expand(req.URL, map[string]string{
  5452  		"resource": c.resource,
  5453  	})
  5454  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5455  }
  5456  
  5457  // Do executes the "eventarc.projects.locations.triggers.setIamPolicy" call.
  5458  // Any non-2xx status code is an error. Response headers are in either
  5459  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  5460  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5461  // whether the returned error was because http.StatusNotModified was returned.
  5462  func (c *ProjectsLocationsTriggersSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  5463  	gensupport.SetOptions(c.urlParams_, opts...)
  5464  	res, err := c.doRequest("json")
  5465  	if res != nil && res.StatusCode == http.StatusNotModified {
  5466  		if res.Body != nil {
  5467  			res.Body.Close()
  5468  		}
  5469  		return nil, gensupport.WrapError(&googleapi.Error{
  5470  			Code:   res.StatusCode,
  5471  			Header: res.Header,
  5472  		})
  5473  	}
  5474  	if err != nil {
  5475  		return nil, err
  5476  	}
  5477  	defer googleapi.CloseBody(res)
  5478  	if err := googleapi.CheckResponse(res); err != nil {
  5479  		return nil, gensupport.WrapError(err)
  5480  	}
  5481  	ret := &Policy{
  5482  		ServerResponse: googleapi.ServerResponse{
  5483  			Header:         res.Header,
  5484  			HTTPStatusCode: res.StatusCode,
  5485  		},
  5486  	}
  5487  	target := &ret
  5488  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5489  		return nil, err
  5490  	}
  5491  	return ret, nil
  5492  }
  5493  
  5494  type ProjectsLocationsTriggersTestIamPermissionsCall struct {
  5495  	s                         *Service
  5496  	resource                  string
  5497  	testiampermissionsrequest *TestIamPermissionsRequest
  5498  	urlParams_                gensupport.URLParams
  5499  	ctx_                      context.Context
  5500  	header_                   http.Header
  5501  }
  5502  
  5503  // TestIamPermissions: Returns permissions that a caller has on the specified
  5504  // resource. If the resource does not exist, this will return an empty set of
  5505  // permissions, not a `NOT_FOUND` error. Note: This operation is designed to be
  5506  // used for building permission-aware UIs and command-line tools, not for
  5507  // authorization checking. This operation may "fail open" without warning.
  5508  //
  5509  //   - resource: REQUIRED: The resource for which the policy detail is being
  5510  //     requested. See Resource names
  5511  //     (https://cloud.google.com/apis/design/resource_names) for the appropriate
  5512  //     value for this field.
  5513  func (r *ProjectsLocationsTriggersService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsTriggersTestIamPermissionsCall {
  5514  	c := &ProjectsLocationsTriggersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5515  	c.resource = resource
  5516  	c.testiampermissionsrequest = testiampermissionsrequest
  5517  	return c
  5518  }
  5519  
  5520  // Fields allows partial responses to be retrieved. See
  5521  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5522  // details.
  5523  func (c *ProjectsLocationsTriggersTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsTriggersTestIamPermissionsCall {
  5524  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5525  	return c
  5526  }
  5527  
  5528  // Context sets the context to be used in this call's Do method.
  5529  func (c *ProjectsLocationsTriggersTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsTriggersTestIamPermissionsCall {
  5530  	c.ctx_ = ctx
  5531  	return c
  5532  }
  5533  
  5534  // Header returns a http.Header that can be modified by the caller to add
  5535  // headers to the request.
  5536  func (c *ProjectsLocationsTriggersTestIamPermissionsCall) Header() http.Header {
  5537  	if c.header_ == nil {
  5538  		c.header_ = make(http.Header)
  5539  	}
  5540  	return c.header_
  5541  }
  5542  
  5543  func (c *ProjectsLocationsTriggersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  5544  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  5545  	var body io.Reader = nil
  5546  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  5547  	if err != nil {
  5548  		return nil, err
  5549  	}
  5550  	c.urlParams_.Set("alt", alt)
  5551  	c.urlParams_.Set("prettyPrint", "false")
  5552  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
  5553  	urls += "?" + c.urlParams_.Encode()
  5554  	req, err := http.NewRequest("POST", urls, body)
  5555  	if err != nil {
  5556  		return nil, err
  5557  	}
  5558  	req.Header = reqHeaders
  5559  	googleapi.Expand(req.URL, map[string]string{
  5560  		"resource": c.resource,
  5561  	})
  5562  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5563  }
  5564  
  5565  // Do executes the "eventarc.projects.locations.triggers.testIamPermissions" call.
  5566  // Any non-2xx status code is an error. Response headers are in either
  5567  // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
  5568  // returned at all) in error.(*googleapi.Error).Header. Use
  5569  // googleapi.IsNotModified to check whether the returned error was because
  5570  // http.StatusNotModified was returned.
  5571  func (c *ProjectsLocationsTriggersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  5572  	gensupport.SetOptions(c.urlParams_, opts...)
  5573  	res, err := c.doRequest("json")
  5574  	if res != nil && res.StatusCode == http.StatusNotModified {
  5575  		if res.Body != nil {
  5576  			res.Body.Close()
  5577  		}
  5578  		return nil, gensupport.WrapError(&googleapi.Error{
  5579  			Code:   res.StatusCode,
  5580  			Header: res.Header,
  5581  		})
  5582  	}
  5583  	if err != nil {
  5584  		return nil, err
  5585  	}
  5586  	defer googleapi.CloseBody(res)
  5587  	if err := googleapi.CheckResponse(res); err != nil {
  5588  		return nil, gensupport.WrapError(err)
  5589  	}
  5590  	ret := &TestIamPermissionsResponse{
  5591  		ServerResponse: googleapi.ServerResponse{
  5592  			Header:         res.Header,
  5593  			HTTPStatusCode: res.StatusCode,
  5594  		},
  5595  	}
  5596  	target := &ret
  5597  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5598  		return nil, err
  5599  	}
  5600  	return ret, nil
  5601  }
  5602  

View as plain text