...

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

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

     1  // Copyright 2024 Google LLC.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Code generated file. DO NOT EDIT.
     6  
     7  // Package bigqueryconnection provides access to the BigQuery Connection API.
     8  //
     9  // For product documentation, see: https://cloud.google.com/bigquery/docs/connections-api-intro
    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/bigqueryconnection/v1beta1"
    27  //	...
    28  //	ctx := context.Background()
    29  //	bigqueryconnectionService, err := bigqueryconnection.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  // By default, all available scopes (see "Constants") are used to authenticate.
    38  // To restrict scopes, use [google.golang.org/api/option.WithScopes]:
    39  //
    40  //	bigqueryconnectionService, err := bigqueryconnection.NewService(ctx, option.WithScopes(bigqueryconnection.CloudPlatformScope))
    41  //
    42  // To use an API key for authentication (note: some APIs do not support API
    43  // keys), use [google.golang.org/api/option.WithAPIKey]:
    44  //
    45  //	bigqueryconnectionService, err := bigqueryconnection.NewService(ctx, option.WithAPIKey("AIza..."))
    46  //
    47  // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
    48  // flow, use [google.golang.org/api/option.WithTokenSource]:
    49  //
    50  //	config := &oauth2.Config{...}
    51  //	// ...
    52  //	token, err := config.Exchange(ctx, ...)
    53  //	bigqueryconnectionService, err := bigqueryconnection.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    54  //
    55  // See [google.golang.org/api/option.ClientOption] for details on options.
    56  package bigqueryconnection // import "google.golang.org/api/bigqueryconnection/v1beta1"
    57  
    58  import (
    59  	"bytes"
    60  	"context"
    61  	"encoding/json"
    62  	"errors"
    63  	"fmt"
    64  	"io"
    65  	"net/http"
    66  	"net/url"
    67  	"strconv"
    68  	"strings"
    69  
    70  	googleapi "google.golang.org/api/googleapi"
    71  	internal "google.golang.org/api/internal"
    72  	gensupport "google.golang.org/api/internal/gensupport"
    73  	option "google.golang.org/api/option"
    74  	internaloption "google.golang.org/api/option/internaloption"
    75  	htransport "google.golang.org/api/transport/http"
    76  )
    77  
    78  // Always reference these packages, just in case the auto-generated code
    79  // below doesn't.
    80  var _ = bytes.NewBuffer
    81  var _ = strconv.Itoa
    82  var _ = fmt.Sprintf
    83  var _ = json.NewDecoder
    84  var _ = io.Copy
    85  var _ = url.Parse
    86  var _ = gensupport.MarshalJSON
    87  var _ = googleapi.Version
    88  var _ = errors.New
    89  var _ = strings.Replace
    90  var _ = context.Canceled
    91  var _ = internaloption.WithDefaultEndpoint
    92  var _ = internal.Version
    93  
    94  const apiId = "bigqueryconnection:v1beta1"
    95  const apiName = "bigqueryconnection"
    96  const apiVersion = "v1beta1"
    97  const basePath = "https://bigqueryconnection.googleapis.com/"
    98  const basePathTemplate = "https://bigqueryconnection.UNIVERSE_DOMAIN/"
    99  const mtlsBasePath = "https://bigqueryconnection.mtls.googleapis.com/"
   100  
   101  // OAuth2 scopes used by this API.
   102  const (
   103  	// View and manage your data in Google BigQuery and see the email address for
   104  	// your Google Account
   105  	BigqueryScope = "https://www.googleapis.com/auth/bigquery"
   106  
   107  	// See, edit, configure, and delete your Google Cloud data and see the email
   108  	// address for your Google Account.
   109  	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
   110  )
   111  
   112  // NewService creates a new Service.
   113  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
   114  	scopesOption := internaloption.WithDefaultScopes(
   115  		"https://www.googleapis.com/auth/bigquery",
   116  		"https://www.googleapis.com/auth/cloud-platform",
   117  	)
   118  	// NOTE: prepend, so we don't override user-specified scopes.
   119  	opts = append([]option.ClientOption{scopesOption}, opts...)
   120  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
   121  	opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
   122  	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
   123  	opts = append(opts, internaloption.EnableNewAuthLibrary())
   124  	client, endpoint, err := htransport.NewClient(ctx, opts...)
   125  	if err != nil {
   126  		return nil, err
   127  	}
   128  	s, err := New(client)
   129  	if err != nil {
   130  		return nil, err
   131  	}
   132  	if endpoint != "" {
   133  		s.BasePath = endpoint
   134  	}
   135  	return s, nil
   136  }
   137  
   138  // New creates a new Service. It uses the provided http.Client for requests.
   139  //
   140  // Deprecated: please use NewService instead.
   141  // To provide a custom HTTP client, use option.WithHTTPClient.
   142  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   143  func New(client *http.Client) (*Service, error) {
   144  	if client == nil {
   145  		return nil, errors.New("client is nil")
   146  	}
   147  	s := &Service{client: client, BasePath: basePath}
   148  	s.Projects = NewProjectsService(s)
   149  	return s, nil
   150  }
   151  
   152  type Service struct {
   153  	client    *http.Client
   154  	BasePath  string // API endpoint base URL
   155  	UserAgent string // optional additional User-Agent fragment
   156  
   157  	Projects *ProjectsService
   158  }
   159  
   160  func (s *Service) userAgent() string {
   161  	if s.UserAgent == "" {
   162  		return googleapi.UserAgent
   163  	}
   164  	return googleapi.UserAgent + " " + s.UserAgent
   165  }
   166  
   167  func NewProjectsService(s *Service) *ProjectsService {
   168  	rs := &ProjectsService{s: s}
   169  	rs.Locations = NewProjectsLocationsService(s)
   170  	return rs
   171  }
   172  
   173  type ProjectsService struct {
   174  	s *Service
   175  
   176  	Locations *ProjectsLocationsService
   177  }
   178  
   179  func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
   180  	rs := &ProjectsLocationsService{s: s}
   181  	rs.Connections = NewProjectsLocationsConnectionsService(s)
   182  	return rs
   183  }
   184  
   185  type ProjectsLocationsService struct {
   186  	s *Service
   187  
   188  	Connections *ProjectsLocationsConnectionsService
   189  }
   190  
   191  func NewProjectsLocationsConnectionsService(s *Service) *ProjectsLocationsConnectionsService {
   192  	rs := &ProjectsLocationsConnectionsService{s: s}
   193  	return rs
   194  }
   195  
   196  type ProjectsLocationsConnectionsService struct {
   197  	s *Service
   198  }
   199  
   200  // AuditConfig: Specifies the audit configuration for a service. The
   201  // configuration determines which permission types are logged, and what
   202  // identities, if any, are exempted from logging. An AuditConfig must have one
   203  // or more AuditLogConfigs. If there are AuditConfigs for both `allServices`
   204  // and a specific service, the union of the two AuditConfigs is used for that
   205  // service: the log_types specified in each AuditConfig are enabled, and the
   206  // exempted_members in each AuditLogConfig are exempted. Example Policy with
   207  // multiple AuditConfigs: { "audit_configs": [ { "service": "allServices",
   208  // "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [
   209  // "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { "log_type":
   210  // "ADMIN_READ" } ] }, { "service": "sampleservice.googleapis.com",
   211  // "audit_log_configs": [ { "log_type": "DATA_READ" }, { "log_type":
   212  // "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] } For
   213  // sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ
   214  // logging. It also exempts `jose@example.com` from DATA_READ logging, and
   215  // `aliya@example.com` from DATA_WRITE logging.
   216  type AuditConfig struct {
   217  	// AuditLogConfigs: The configuration for logging of each type of permission.
   218  	AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
   219  	// Service: Specifies a service that will be enabled for audit logging. For
   220  	// example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices`
   221  	// is a special value that covers all services.
   222  	Service string `json:"service,omitempty"`
   223  	// ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to
   224  	// unconditionally include in API requests. By default, fields with empty or
   225  	// default values are omitted from API requests. See
   226  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   227  	// details.
   228  	ForceSendFields []string `json:"-"`
   229  	// NullFields is a list of field names (e.g. "AuditLogConfigs") to include in
   230  	// API requests with the JSON null value. By default, fields with empty values
   231  	// are omitted from API requests. See
   232  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   233  	NullFields []string `json:"-"`
   234  }
   235  
   236  func (s *AuditConfig) MarshalJSON() ([]byte, error) {
   237  	type NoMethod AuditConfig
   238  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   239  }
   240  
   241  // AuditLogConfig: Provides the configuration for logging a type of
   242  // permissions. Example: { "audit_log_configs": [ { "log_type": "DATA_READ",
   243  // "exempted_members": [ "user:jose@example.com" ] }, { "log_type":
   244  // "DATA_WRITE" } ] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while
   245  // exempting jose@example.com from DATA_READ logging.
   246  type AuditLogConfig struct {
   247  	// ExemptedMembers: Specifies the identities that do not cause logging for this
   248  	// type of permission. Follows the same format of Binding.members.
   249  	ExemptedMembers []string `json:"exemptedMembers,omitempty"`
   250  	// LogType: The log type that this config enables.
   251  	//
   252  	// Possible values:
   253  	//   "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this.
   254  	//   "ADMIN_READ" - Admin reads. Example: CloudIAM getIamPolicy
   255  	//   "DATA_WRITE" - Data writes. Example: CloudSQL Users create
   256  	//   "DATA_READ" - Data reads. Example: CloudSQL Users list
   257  	LogType string `json:"logType,omitempty"`
   258  	// ForceSendFields is a list of field names (e.g. "ExemptedMembers") to
   259  	// unconditionally include in API requests. By default, fields with empty or
   260  	// default values are omitted from API requests. See
   261  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   262  	// details.
   263  	ForceSendFields []string `json:"-"`
   264  	// NullFields is a list of field names (e.g. "ExemptedMembers") to include in
   265  	// API requests with the JSON null value. By default, fields with empty values
   266  	// are omitted from API requests. See
   267  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   268  	NullFields []string `json:"-"`
   269  }
   270  
   271  func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
   272  	type NoMethod AuditLogConfig
   273  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   274  }
   275  
   276  // Binding: Associates `members`, or principals, with a `role`.
   277  type Binding struct {
   278  	// Condition: The condition that is associated with this binding. If the
   279  	// condition evaluates to `true`, then this binding applies to the current
   280  	// request. If the condition evaluates to `false`, then this binding does not
   281  	// apply to the current request. However, a different role binding might grant
   282  	// the same role to one or more of the principals in this binding. To learn
   283  	// which resources support conditions in their IAM policies, see the IAM
   284  	// documentation
   285  	// (https://cloud.google.com/iam/help/conditions/resource-policies).
   286  	Condition *Expr `json:"condition,omitempty"`
   287  	// Members: Specifies the principals requesting access for a Google Cloud
   288  	// resource. `members` can have the following values: * `allUsers`: A special
   289  	// identifier that represents anyone who is on the internet; with or without a
   290  	// Google account. * `allAuthenticatedUsers`: A special identifier that
   291  	// represents anyone who is authenticated with a Google account or a service
   292  	// account. Does not include identities that come from external identity
   293  	// providers (IdPs) through identity federation. * `user:{emailid}`: An email
   294  	// address that represents a specific Google account. For example,
   295  	// `alice@example.com` . * `serviceAccount:{emailid}`: An email address that
   296  	// represents a Google service account. For example,
   297  	// `my-other-app@appspot.gserviceaccount.com`. *
   298  	// `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An
   299  	// identifier for a Kubernetes service account
   300  	// (https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts).
   301  	// For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. *
   302  	// `group:{emailid}`: An email address that represents a Google group. For
   303  	// example, `admins@example.com`. * `domain:{domain}`: The G Suite domain
   304  	// (primary) that represents all the users of that domain. For example,
   305  	// `google.com` or `example.com`. *
   306  	// `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/sub
   307  	// ject/{subject_attribute_value}`: A single identity in a workforce identity
   308  	// pool. *
   309  	// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
   310  	// group/{group_id}`: All workforce identities in a group. *
   311  	// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
   312  	// attribute.{attribute_name}/{attribute_value}`: All workforce identities with
   313  	// a specific attribute value. *
   314  	// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
   315  	// *`: All identities in a workforce identity pool. *
   316  	// `principal://iam.googleapis.com/projects/{project_number}/locations/global/wo
   317  	// rkloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: A single
   318  	// identity in a workload identity pool. *
   319  	// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
   320  	// /workloadIdentityPools/{pool_id}/group/{group_id}`: A workload identity pool
   321  	// group. *
   322  	// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
   323  	// /workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}
   324  	// `: All identities in a workload identity pool with a certain attribute. *
   325  	// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
   326  	// /workloadIdentityPools/{pool_id}/*`: All identities in a workload identity
   327  	// pool. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus
   328  	// unique identifier) representing a user that has been recently deleted. For
   329  	// example, `alice@example.com?uid=123456789012345678901`. If the user is
   330  	// recovered, this value reverts to `user:{emailid}` and the recovered user
   331  	// retains the role in the binding. *
   332  	// `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
   333  	// unique identifier) representing a service account that has been recently
   334  	// deleted. For example,
   335  	// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the
   336  	// service account is undeleted, this value reverts to
   337  	// `serviceAccount:{emailid}` and the undeleted service account retains the
   338  	// role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email
   339  	// address (plus unique identifier) representing a Google group that has been
   340  	// recently deleted. For example,
   341  	// `admins@example.com?uid=123456789012345678901`. If the group is recovered,
   342  	// this value reverts to `group:{emailid}` and the recovered group retains the
   343  	// role in the binding. *
   344  	// `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool
   345  	// _id}/subject/{subject_attribute_value}`: Deleted single identity in a
   346  	// workforce identity pool. For example,
   347  	// `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-po
   348  	// ol-id/subject/my-subject-attribute-value`.
   349  	Members []string `json:"members,omitempty"`
   350  	// Role: Role that is assigned to the list of `members`, or principals. For
   351  	// example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview
   352  	// of the IAM roles and permissions, see the IAM documentation
   353  	// (https://cloud.google.com/iam/docs/roles-overview). For a list of the
   354  	// available pre-defined roles, see here
   355  	// (https://cloud.google.com/iam/docs/understanding-roles).
   356  	Role string `json:"role,omitempty"`
   357  	// ForceSendFields is a list of field names (e.g. "Condition") to
   358  	// unconditionally include in API requests. By default, fields with empty or
   359  	// default values are omitted from API requests. See
   360  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   361  	// details.
   362  	ForceSendFields []string `json:"-"`
   363  	// NullFields is a list of field names (e.g. "Condition") to include in API
   364  	// requests with the JSON null value. By default, fields with empty values are
   365  	// omitted from API requests. See
   366  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   367  	NullFields []string `json:"-"`
   368  }
   369  
   370  func (s *Binding) MarshalJSON() ([]byte, error) {
   371  	type NoMethod Binding
   372  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   373  }
   374  
   375  // CloudSqlCredential: Credential info for the Cloud SQL.
   376  type CloudSqlCredential struct {
   377  	// Password: The password for the credential.
   378  	Password string `json:"password,omitempty"`
   379  	// Username: The username for the credential.
   380  	Username string `json:"username,omitempty"`
   381  	// ForceSendFields is a list of field names (e.g. "Password") to
   382  	// unconditionally include in API requests. By default, fields with empty or
   383  	// default values are omitted from API requests. See
   384  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   385  	// details.
   386  	ForceSendFields []string `json:"-"`
   387  	// NullFields is a list of field names (e.g. "Password") to include in API
   388  	// requests with the JSON null value. By default, fields with empty values are
   389  	// omitted from API requests. See
   390  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   391  	NullFields []string `json:"-"`
   392  }
   393  
   394  func (s *CloudSqlCredential) MarshalJSON() ([]byte, error) {
   395  	type NoMethod CloudSqlCredential
   396  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   397  }
   398  
   399  // CloudSqlProperties: Connection properties specific to the Cloud SQL.
   400  type CloudSqlProperties struct {
   401  	// Credential: Input only. Cloud SQL credential.
   402  	Credential *CloudSqlCredential `json:"credential,omitempty"`
   403  	// Database: Database name.
   404  	Database string `json:"database,omitempty"`
   405  	// InstanceId: Cloud SQL instance ID in the form `project:location:instance`.
   406  	InstanceId string `json:"instanceId,omitempty"`
   407  	// ServiceAccountId: Output only. The account ID of the service used for the
   408  	// purpose of this connection. When the connection is used in the context of an
   409  	// operation in BigQuery, this service account will serve as the identity being
   410  	// used for connecting to the CloudSQL instance specified in this connection.
   411  	ServiceAccountId string `json:"serviceAccountId,omitempty"`
   412  	// Type: Type of the Cloud SQL database.
   413  	//
   414  	// Possible values:
   415  	//   "DATABASE_TYPE_UNSPECIFIED" - Unspecified database type.
   416  	//   "POSTGRES" - Cloud SQL for PostgreSQL.
   417  	//   "MYSQL" - Cloud SQL for MySQL.
   418  	Type string `json:"type,omitempty"`
   419  	// ForceSendFields is a list of field names (e.g. "Credential") to
   420  	// unconditionally include in API requests. By default, fields with empty or
   421  	// default values are omitted from API requests. See
   422  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   423  	// details.
   424  	ForceSendFields []string `json:"-"`
   425  	// NullFields is a list of field names (e.g. "Credential") to include in API
   426  	// requests with the JSON null value. By default, fields with empty values are
   427  	// omitted from API requests. See
   428  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   429  	NullFields []string `json:"-"`
   430  }
   431  
   432  func (s *CloudSqlProperties) MarshalJSON() ([]byte, error) {
   433  	type NoMethod CloudSqlProperties
   434  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   435  }
   436  
   437  // Connection: Configuration parameters to establish connection with an
   438  // external data source, except the credential attributes.
   439  type Connection struct {
   440  	// CloudSql: Cloud SQL properties.
   441  	CloudSql *CloudSqlProperties `json:"cloudSql,omitempty"`
   442  	// CreationTime: Output only. The creation timestamp of the connection.
   443  	CreationTime int64 `json:"creationTime,omitempty,string"`
   444  	// Description: User provided description.
   445  	Description string `json:"description,omitempty"`
   446  	// FriendlyName: User provided display name for the connection.
   447  	FriendlyName string `json:"friendlyName,omitempty"`
   448  	// HasCredential: Output only. True, if credential is configured for this
   449  	// connection.
   450  	HasCredential bool `json:"hasCredential,omitempty"`
   451  	// LastModifiedTime: Output only. The last update timestamp of the connection.
   452  	LastModifiedTime int64 `json:"lastModifiedTime,omitempty,string"`
   453  	// Name: The resource name of the connection in the form of:
   454  	// `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
   455  	Name string `json:"name,omitempty"`
   456  
   457  	// ServerResponse contains the HTTP response code and headers from the server.
   458  	googleapi.ServerResponse `json:"-"`
   459  	// ForceSendFields is a list of field names (e.g. "CloudSql") to
   460  	// unconditionally include in API requests. By default, fields with empty or
   461  	// default values are omitted from API requests. See
   462  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   463  	// details.
   464  	ForceSendFields []string `json:"-"`
   465  	// NullFields is a list of field names (e.g. "CloudSql") to include in API
   466  	// requests with the JSON null value. By default, fields with empty values are
   467  	// omitted from API requests. See
   468  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   469  	NullFields []string `json:"-"`
   470  }
   471  
   472  func (s *Connection) MarshalJSON() ([]byte, error) {
   473  	type NoMethod Connection
   474  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   475  }
   476  
   477  // ConnectionCredential: Credential to use with a connection.
   478  type ConnectionCredential struct {
   479  	// CloudSql: Credential for Cloud SQL database.
   480  	CloudSql *CloudSqlCredential `json:"cloudSql,omitempty"`
   481  	// ForceSendFields is a list of field names (e.g. "CloudSql") to
   482  	// unconditionally include in API requests. By default, fields with empty or
   483  	// default values are omitted from API requests. See
   484  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   485  	// details.
   486  	ForceSendFields []string `json:"-"`
   487  	// NullFields is a list of field names (e.g. "CloudSql") to include in API
   488  	// requests with the JSON null value. By default, fields with empty values are
   489  	// omitted from API requests. See
   490  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   491  	NullFields []string `json:"-"`
   492  }
   493  
   494  func (s *ConnectionCredential) MarshalJSON() ([]byte, error) {
   495  	type NoMethod ConnectionCredential
   496  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   497  }
   498  
   499  // Empty: A generic empty message that you can re-use to avoid defining
   500  // duplicated empty messages in your APIs. A typical example is to use it as
   501  // the request or the response type of an API method. For instance: service Foo
   502  // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
   503  type Empty struct {
   504  	// ServerResponse contains the HTTP response code and headers from the server.
   505  	googleapi.ServerResponse `json:"-"`
   506  }
   507  
   508  // Expr: Represents a textual expression in the Common Expression Language
   509  // (CEL) syntax. CEL is a C-like expression language. The syntax and semantics
   510  // of CEL are documented at https://github.com/google/cel-spec. Example
   511  // (Comparison): title: "Summary size limit" description: "Determines if a
   512  // summary is less than 100 chars" expression: "document.summary.size() < 100"
   513  // Example (Equality): title: "Requestor is owner" description: "Determines if
   514  // requestor is the document owner" expression: "document.owner ==
   515  // request.auth.claims.email" Example (Logic): title: "Public documents"
   516  // description: "Determine whether the document should be publicly visible"
   517  // expression: "document.type != 'private' && document.type != 'internal'"
   518  // Example (Data Manipulation): title: "Notification string" description:
   519  // "Create a notification string with a timestamp." expression: "'New message
   520  // received at ' + string(document.create_time)" The exact variables and
   521  // functions that may be referenced within an expression are determined by the
   522  // service that evaluates it. See the service documentation for additional
   523  // information.
   524  type Expr struct {
   525  	// Description: Optional. Description of the expression. This is a longer text
   526  	// which describes the expression, e.g. when hovered over it in a UI.
   527  	Description string `json:"description,omitempty"`
   528  	// Expression: Textual representation of an expression in Common Expression
   529  	// Language syntax.
   530  	Expression string `json:"expression,omitempty"`
   531  	// Location: Optional. String indicating the location of the expression for
   532  	// error reporting, e.g. a file name and a position in the file.
   533  	Location string `json:"location,omitempty"`
   534  	// Title: Optional. Title for the expression, i.e. a short string describing
   535  	// its purpose. This can be used e.g. in UIs which allow to enter the
   536  	// expression.
   537  	Title string `json:"title,omitempty"`
   538  	// ForceSendFields is a list of field names (e.g. "Description") to
   539  	// unconditionally include in API requests. By default, fields with empty or
   540  	// default values are omitted from API requests. See
   541  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   542  	// details.
   543  	ForceSendFields []string `json:"-"`
   544  	// NullFields is a list of field names (e.g. "Description") to include in API
   545  	// requests with the JSON null value. By default, fields with empty values are
   546  	// omitted from API requests. See
   547  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   548  	NullFields []string `json:"-"`
   549  }
   550  
   551  func (s *Expr) MarshalJSON() ([]byte, error) {
   552  	type NoMethod Expr
   553  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   554  }
   555  
   556  // GetIamPolicyRequest: Request message for `GetIamPolicy` method.
   557  type GetIamPolicyRequest struct {
   558  	// Options: OPTIONAL: A `GetPolicyOptions` object for specifying options to
   559  	// `GetIamPolicy`.
   560  	Options *GetPolicyOptions `json:"options,omitempty"`
   561  	// ForceSendFields is a list of field names (e.g. "Options") to unconditionally
   562  	// include in API requests. By default, fields with empty or default values are
   563  	// omitted from API requests. See
   564  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   565  	// details.
   566  	ForceSendFields []string `json:"-"`
   567  	// NullFields is a list of field names (e.g. "Options") to include in API
   568  	// requests with the JSON null value. By default, fields with empty values are
   569  	// omitted from API requests. See
   570  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   571  	NullFields []string `json:"-"`
   572  }
   573  
   574  func (s *GetIamPolicyRequest) MarshalJSON() ([]byte, error) {
   575  	type NoMethod GetIamPolicyRequest
   576  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   577  }
   578  
   579  // GetPolicyOptions: Encapsulates settings provided to GetIamPolicy.
   580  type GetPolicyOptions struct {
   581  	// RequestedPolicyVersion: Optional. The maximum policy version that will be
   582  	// used to format the policy. Valid values are 0, 1, and 3. Requests specifying
   583  	// an invalid value will be rejected. Requests for policies with any
   584  	// conditional role bindings must specify version 3. Policies with no
   585  	// conditional role bindings may specify any valid value or leave the field
   586  	// unset. The policy in the response might use the policy version that you
   587  	// specified, or it might use a lower policy version. For example, if you
   588  	// specify version 3, but the policy has no conditional role bindings, the
   589  	// response uses version 1. To learn which resources support conditions in
   590  	// their IAM policies, see the IAM documentation
   591  	// (https://cloud.google.com/iam/help/conditions/resource-policies).
   592  	RequestedPolicyVersion int64 `json:"requestedPolicyVersion,omitempty"`
   593  	// ForceSendFields is a list of field names (e.g. "RequestedPolicyVersion") to
   594  	// unconditionally include in API requests. By default, fields with empty or
   595  	// default values are omitted from API requests. See
   596  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   597  	// details.
   598  	ForceSendFields []string `json:"-"`
   599  	// NullFields is a list of field names (e.g. "RequestedPolicyVersion") to
   600  	// include in API requests with the JSON null value. By default, fields with
   601  	// empty values are omitted from API requests. See
   602  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   603  	NullFields []string `json:"-"`
   604  }
   605  
   606  func (s *GetPolicyOptions) MarshalJSON() ([]byte, error) {
   607  	type NoMethod GetPolicyOptions
   608  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   609  }
   610  
   611  // ListConnectionsResponse: The response for ConnectionService.ListConnections.
   612  type ListConnectionsResponse struct {
   613  	// Connections: List of connections.
   614  	Connections []*Connection `json:"connections,omitempty"`
   615  	// NextPageToken: Next page token.
   616  	NextPageToken string `json:"nextPageToken,omitempty"`
   617  
   618  	// ServerResponse contains the HTTP response code and headers from the server.
   619  	googleapi.ServerResponse `json:"-"`
   620  	// ForceSendFields is a list of field names (e.g. "Connections") to
   621  	// unconditionally include in API requests. By default, fields with empty or
   622  	// default values are omitted from API requests. See
   623  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   624  	// details.
   625  	ForceSendFields []string `json:"-"`
   626  	// NullFields is a list of field names (e.g. "Connections") to include in API
   627  	// requests with the JSON null value. By default, fields with empty values are
   628  	// omitted from API requests. See
   629  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   630  	NullFields []string `json:"-"`
   631  }
   632  
   633  func (s *ListConnectionsResponse) MarshalJSON() ([]byte, error) {
   634  	type NoMethod ListConnectionsResponse
   635  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   636  }
   637  
   638  // Policy: An Identity and Access Management (IAM) policy, which specifies
   639  // access controls for Google Cloud resources. A `Policy` is a collection of
   640  // `bindings`. A `binding` binds one or more `members`, or principals, to a
   641  // single `role`. Principals can be user accounts, service accounts, Google
   642  // groups, and domains (such as G Suite). A `role` is a named list of
   643  // permissions; each `role` can be an IAM predefined role or a user-created
   644  // custom role. For some types of Google Cloud resources, a `binding` can also
   645  // specify a `condition`, which is a logical expression that allows access to a
   646  // resource only if the expression evaluates to `true`. A condition can add
   647  // constraints based on attributes of the request, the resource, or both. To
   648  // learn which resources support conditions in their IAM policies, see the IAM
   649  // documentation
   650  // (https://cloud.google.com/iam/help/conditions/resource-policies). **JSON
   651  // example:** ``` { "bindings": [ { "role":
   652  // "roles/resourcemanager.organizationAdmin", "members": [
   653  // "user:mike@example.com", "group:admins@example.com", "domain:google.com",
   654  // "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role":
   655  // "roles/resourcemanager.organizationViewer", "members": [
   656  // "user:eve@example.com" ], "condition": { "title": "expirable access",
   657  // "description": "Does not grant access after Sep 2020", "expression":
   658  // "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag":
   659  // "BwWWja0YfJA=", "version": 3 } ``` **YAML example:** ``` bindings: -
   660  // members: - user:mike@example.com - group:admins@example.com -
   661  // domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com
   662  // role: roles/resourcemanager.organizationAdmin - members: -
   663  // user:eve@example.com role: roles/resourcemanager.organizationViewer
   664  // condition: title: expirable access description: Does not grant access after
   665  // Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z')
   666  // etag: BwWWja0YfJA= version: 3 ``` For a description of IAM and its features,
   667  // see the IAM documentation (https://cloud.google.com/iam/docs/).
   668  type Policy struct {
   669  	// AuditConfigs: Specifies cloud audit logging configuration for this policy.
   670  	AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
   671  	// Bindings: Associates a list of `members`, or principals, with a `role`.
   672  	// Optionally, may specify a `condition` that determines how and when the
   673  	// `bindings` are applied. Each of the `bindings` must contain at least one
   674  	// principal. The `bindings` in a `Policy` can refer to up to 1,500 principals;
   675  	// up to 250 of these principals can be Google groups. Each occurrence of a
   676  	// principal counts towards these limits. For example, if the `bindings` grant
   677  	// 50 different roles to `user:alice@example.com`, and not to any other
   678  	// principal, then you can add another 1,450 principals to the `bindings` in
   679  	// the `Policy`.
   680  	Bindings []*Binding `json:"bindings,omitempty"`
   681  	// Etag: `etag` is used for optimistic concurrency control as a way to help
   682  	// prevent simultaneous updates of a policy from overwriting each other. It is
   683  	// strongly suggested that systems make use of the `etag` in the
   684  	// read-modify-write cycle to perform policy updates in order to avoid race
   685  	// conditions: An `etag` is returned in the response to `getIamPolicy`, and
   686  	// systems are expected to put that etag in the request to `setIamPolicy` to
   687  	// ensure that their change will be applied to the same version of the policy.
   688  	// **Important:** If you use IAM Conditions, you must include the `etag` field
   689  	// whenever you call `setIamPolicy`. If you omit this field, then IAM allows
   690  	// you to overwrite a version `3` policy with a version `1` policy, and all of
   691  	// the conditions in the version `3` policy are lost.
   692  	Etag string `json:"etag,omitempty"`
   693  	// Version: Specifies the format of the policy. Valid values are `0`, `1`, and
   694  	// `3`. Requests that specify an invalid value are rejected. Any operation that
   695  	// affects conditional role bindings must specify version `3`. This requirement
   696  	// applies to the following operations: * Getting a policy that includes a
   697  	// conditional role binding * Adding a conditional role binding to a policy *
   698  	// Changing a conditional role binding in a policy * Removing any role binding,
   699  	// with or without a condition, from a policy that includes conditions
   700  	// **Important:** If you use IAM Conditions, you must include the `etag` field
   701  	// whenever you call `setIamPolicy`. If you omit this field, then IAM allows
   702  	// you to overwrite a version `3` policy with a version `1` policy, and all of
   703  	// the conditions in the version `3` policy are lost. If a policy does not
   704  	// include any conditions, operations on that policy may specify any valid
   705  	// version or leave the field unset. To learn which resources support
   706  	// conditions in their IAM policies, see the IAM documentation
   707  	// (https://cloud.google.com/iam/help/conditions/resource-policies).
   708  	Version int64 `json:"version,omitempty"`
   709  
   710  	// ServerResponse contains the HTTP response code and headers from the server.
   711  	googleapi.ServerResponse `json:"-"`
   712  	// ForceSendFields is a list of field names (e.g. "AuditConfigs") to
   713  	// unconditionally include in API requests. By default, fields with empty or
   714  	// default values are omitted from API requests. See
   715  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   716  	// details.
   717  	ForceSendFields []string `json:"-"`
   718  	// NullFields is a list of field names (e.g. "AuditConfigs") to include in API
   719  	// requests with the JSON null value. By default, fields with empty values are
   720  	// omitted from API requests. See
   721  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   722  	NullFields []string `json:"-"`
   723  }
   724  
   725  func (s *Policy) MarshalJSON() ([]byte, error) {
   726  	type NoMethod Policy
   727  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   728  }
   729  
   730  // SetIamPolicyRequest: Request message for `SetIamPolicy` method.
   731  type SetIamPolicyRequest struct {
   732  	// Policy: REQUIRED: The complete policy to be applied to the `resource`. The
   733  	// size of the policy is limited to a few 10s of KB. An empty policy is a valid
   734  	// policy but certain Google Cloud services (such as Projects) might reject
   735  	// them.
   736  	Policy *Policy `json:"policy,omitempty"`
   737  	// UpdateMask: OPTIONAL: A FieldMask specifying which fields of the policy to
   738  	// modify. Only the fields in the mask will be modified. If no mask is
   739  	// provided, the following default mask is used: `paths: "bindings, etag"
   740  	UpdateMask string `json:"updateMask,omitempty"`
   741  	// ForceSendFields is a list of field names (e.g. "Policy") to unconditionally
   742  	// include in API requests. By default, fields with empty or default values are
   743  	// omitted from API requests. See
   744  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   745  	// details.
   746  	ForceSendFields []string `json:"-"`
   747  	// NullFields is a list of field names (e.g. "Policy") to include in API
   748  	// requests with the JSON null value. By default, fields with empty values are
   749  	// omitted from API requests. See
   750  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   751  	NullFields []string `json:"-"`
   752  }
   753  
   754  func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
   755  	type NoMethod SetIamPolicyRequest
   756  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   757  }
   758  
   759  // TestIamPermissionsRequest: Request message for `TestIamPermissions` method.
   760  type TestIamPermissionsRequest struct {
   761  	// Permissions: The set of permissions to check for the `resource`. Permissions
   762  	// with wildcards (such as `*` or `storage.*`) are not allowed. For more
   763  	// information see IAM Overview
   764  	// (https://cloud.google.com/iam/docs/overview#permissions).
   765  	Permissions []string `json:"permissions,omitempty"`
   766  	// ForceSendFields is a list of field names (e.g. "Permissions") to
   767  	// unconditionally include in API requests. By default, fields with empty or
   768  	// default values are omitted from API requests. See
   769  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   770  	// details.
   771  	ForceSendFields []string `json:"-"`
   772  	// NullFields is a list of field names (e.g. "Permissions") to include in API
   773  	// requests with the JSON null value. By default, fields with empty values are
   774  	// omitted from API requests. See
   775  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   776  	NullFields []string `json:"-"`
   777  }
   778  
   779  func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
   780  	type NoMethod TestIamPermissionsRequest
   781  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   782  }
   783  
   784  // TestIamPermissionsResponse: Response message for `TestIamPermissions`
   785  // method.
   786  type TestIamPermissionsResponse struct {
   787  	// Permissions: A subset of `TestPermissionsRequest.permissions` that the
   788  	// caller is allowed.
   789  	Permissions []string `json:"permissions,omitempty"`
   790  
   791  	// ServerResponse contains the HTTP response code and headers from the server.
   792  	googleapi.ServerResponse `json:"-"`
   793  	// ForceSendFields is a list of field names (e.g. "Permissions") to
   794  	// unconditionally include in API requests. By default, fields with empty or
   795  	// default values are omitted from API requests. See
   796  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   797  	// details.
   798  	ForceSendFields []string `json:"-"`
   799  	// NullFields is a list of field names (e.g. "Permissions") to include in API
   800  	// requests with the JSON null value. By default, fields with empty values are
   801  	// omitted from API requests. See
   802  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   803  	NullFields []string `json:"-"`
   804  }
   805  
   806  func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
   807  	type NoMethod TestIamPermissionsResponse
   808  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   809  }
   810  
   811  type ProjectsLocationsConnectionsCreateCall struct {
   812  	s          *Service
   813  	parent     string
   814  	connection *Connection
   815  	urlParams_ gensupport.URLParams
   816  	ctx_       context.Context
   817  	header_    http.Header
   818  }
   819  
   820  // Create: Creates a new connection.
   821  //
   822  //   - parent: Parent resource name. Must be in the format
   823  //     `projects/{project_id}/locations/{location_id}`.
   824  func (r *ProjectsLocationsConnectionsService) Create(parent string, connection *Connection) *ProjectsLocationsConnectionsCreateCall {
   825  	c := &ProjectsLocationsConnectionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   826  	c.parent = parent
   827  	c.connection = connection
   828  	return c
   829  }
   830  
   831  // ConnectionId sets the optional parameter "connectionId": Connection id that
   832  // should be assigned to the created connection.
   833  func (c *ProjectsLocationsConnectionsCreateCall) ConnectionId(connectionId string) *ProjectsLocationsConnectionsCreateCall {
   834  	c.urlParams_.Set("connectionId", connectionId)
   835  	return c
   836  }
   837  
   838  // Fields allows partial responses to be retrieved. See
   839  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   840  // details.
   841  func (c *ProjectsLocationsConnectionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsCreateCall {
   842  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   843  	return c
   844  }
   845  
   846  // Context sets the context to be used in this call's Do method.
   847  func (c *ProjectsLocationsConnectionsCreateCall) Context(ctx context.Context) *ProjectsLocationsConnectionsCreateCall {
   848  	c.ctx_ = ctx
   849  	return c
   850  }
   851  
   852  // Header returns a http.Header that can be modified by the caller to add
   853  // headers to the request.
   854  func (c *ProjectsLocationsConnectionsCreateCall) Header() http.Header {
   855  	if c.header_ == nil {
   856  		c.header_ = make(http.Header)
   857  	}
   858  	return c.header_
   859  }
   860  
   861  func (c *ProjectsLocationsConnectionsCreateCall) doRequest(alt string) (*http.Response, error) {
   862  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
   863  	var body io.Reader = nil
   864  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.connection)
   865  	if err != nil {
   866  		return nil, err
   867  	}
   868  	c.urlParams_.Set("alt", alt)
   869  	c.urlParams_.Set("prettyPrint", "false")
   870  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/connections")
   871  	urls += "?" + c.urlParams_.Encode()
   872  	req, err := http.NewRequest("POST", urls, body)
   873  	if err != nil {
   874  		return nil, err
   875  	}
   876  	req.Header = reqHeaders
   877  	googleapi.Expand(req.URL, map[string]string{
   878  		"parent": c.parent,
   879  	})
   880  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   881  }
   882  
   883  // Do executes the "bigqueryconnection.projects.locations.connections.create" call.
   884  // Any non-2xx status code is an error. Response headers are in either
   885  // *Connection.ServerResponse.Header or (if a response was returned at all) in
   886  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
   887  // whether the returned error was because http.StatusNotModified was returned.
   888  func (c *ProjectsLocationsConnectionsCreateCall) Do(opts ...googleapi.CallOption) (*Connection, error) {
   889  	gensupport.SetOptions(c.urlParams_, opts...)
   890  	res, err := c.doRequest("json")
   891  	if res != nil && res.StatusCode == http.StatusNotModified {
   892  		if res.Body != nil {
   893  			res.Body.Close()
   894  		}
   895  		return nil, gensupport.WrapError(&googleapi.Error{
   896  			Code:   res.StatusCode,
   897  			Header: res.Header,
   898  		})
   899  	}
   900  	if err != nil {
   901  		return nil, err
   902  	}
   903  	defer googleapi.CloseBody(res)
   904  	if err := googleapi.CheckResponse(res); err != nil {
   905  		return nil, gensupport.WrapError(err)
   906  	}
   907  	ret := &Connection{
   908  		ServerResponse: googleapi.ServerResponse{
   909  			Header:         res.Header,
   910  			HTTPStatusCode: res.StatusCode,
   911  		},
   912  	}
   913  	target := &ret
   914  	if err := gensupport.DecodeResponse(target, res); err != nil {
   915  		return nil, err
   916  	}
   917  	return ret, nil
   918  }
   919  
   920  type ProjectsLocationsConnectionsDeleteCall struct {
   921  	s          *Service
   922  	name       string
   923  	urlParams_ gensupport.URLParams
   924  	ctx_       context.Context
   925  	header_    http.Header
   926  }
   927  
   928  // Delete: Deletes connection and associated credential.
   929  //
   930  //   - name: Name of the deleted connection, for example:
   931  //     `projects/{project_id}/locations/{location_id}/connections/{connection_id}`.
   932  func (r *ProjectsLocationsConnectionsService) Delete(name string) *ProjectsLocationsConnectionsDeleteCall {
   933  	c := &ProjectsLocationsConnectionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   934  	c.name = name
   935  	return c
   936  }
   937  
   938  // Fields allows partial responses to be retrieved. See
   939  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   940  // details.
   941  func (c *ProjectsLocationsConnectionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsDeleteCall {
   942  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   943  	return c
   944  }
   945  
   946  // Context sets the context to be used in this call's Do method.
   947  func (c *ProjectsLocationsConnectionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsConnectionsDeleteCall {
   948  	c.ctx_ = ctx
   949  	return c
   950  }
   951  
   952  // Header returns a http.Header that can be modified by the caller to add
   953  // headers to the request.
   954  func (c *ProjectsLocationsConnectionsDeleteCall) Header() http.Header {
   955  	if c.header_ == nil {
   956  		c.header_ = make(http.Header)
   957  	}
   958  	return c.header_
   959  }
   960  
   961  func (c *ProjectsLocationsConnectionsDeleteCall) doRequest(alt string) (*http.Response, error) {
   962  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   963  	var body io.Reader = nil
   964  	c.urlParams_.Set("alt", alt)
   965  	c.urlParams_.Set("prettyPrint", "false")
   966  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
   967  	urls += "?" + c.urlParams_.Encode()
   968  	req, err := http.NewRequest("DELETE", urls, body)
   969  	if err != nil {
   970  		return nil, err
   971  	}
   972  	req.Header = reqHeaders
   973  	googleapi.Expand(req.URL, map[string]string{
   974  		"name": c.name,
   975  	})
   976  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   977  }
   978  
   979  // Do executes the "bigqueryconnection.projects.locations.connections.delete" call.
   980  // Any non-2xx status code is an error. Response headers are in either
   981  // *Empty.ServerResponse.Header or (if a response was returned at all) in
   982  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
   983  // whether the returned error was because http.StatusNotModified was returned.
   984  func (c *ProjectsLocationsConnectionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
   985  	gensupport.SetOptions(c.urlParams_, opts...)
   986  	res, err := c.doRequest("json")
   987  	if res != nil && res.StatusCode == http.StatusNotModified {
   988  		if res.Body != nil {
   989  			res.Body.Close()
   990  		}
   991  		return nil, gensupport.WrapError(&googleapi.Error{
   992  			Code:   res.StatusCode,
   993  			Header: res.Header,
   994  		})
   995  	}
   996  	if err != nil {
   997  		return nil, err
   998  	}
   999  	defer googleapi.CloseBody(res)
  1000  	if err := googleapi.CheckResponse(res); err != nil {
  1001  		return nil, gensupport.WrapError(err)
  1002  	}
  1003  	ret := &Empty{
  1004  		ServerResponse: googleapi.ServerResponse{
  1005  			Header:         res.Header,
  1006  			HTTPStatusCode: res.StatusCode,
  1007  		},
  1008  	}
  1009  	target := &ret
  1010  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1011  		return nil, err
  1012  	}
  1013  	return ret, nil
  1014  }
  1015  
  1016  type ProjectsLocationsConnectionsGetCall struct {
  1017  	s            *Service
  1018  	name         string
  1019  	urlParams_   gensupport.URLParams
  1020  	ifNoneMatch_ string
  1021  	ctx_         context.Context
  1022  	header_      http.Header
  1023  }
  1024  
  1025  // Get: Returns specified connection.
  1026  //
  1027  //   - name: Name of the requested connection, for example:
  1028  //     `projects/{project_id}/locations/{location_id}/connections/{connection_id}`.
  1029  func (r *ProjectsLocationsConnectionsService) Get(name string) *ProjectsLocationsConnectionsGetCall {
  1030  	c := &ProjectsLocationsConnectionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1031  	c.name = name
  1032  	return c
  1033  }
  1034  
  1035  // Fields allows partial responses to be retrieved. See
  1036  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1037  // details.
  1038  func (c *ProjectsLocationsConnectionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsGetCall {
  1039  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1040  	return c
  1041  }
  1042  
  1043  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1044  // object's ETag matches the given value. This is useful for getting updates
  1045  // only after the object has changed since the last request.
  1046  func (c *ProjectsLocationsConnectionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsConnectionsGetCall {
  1047  	c.ifNoneMatch_ = entityTag
  1048  	return c
  1049  }
  1050  
  1051  // Context sets the context to be used in this call's Do method.
  1052  func (c *ProjectsLocationsConnectionsGetCall) Context(ctx context.Context) *ProjectsLocationsConnectionsGetCall {
  1053  	c.ctx_ = ctx
  1054  	return c
  1055  }
  1056  
  1057  // Header returns a http.Header that can be modified by the caller to add
  1058  // headers to the request.
  1059  func (c *ProjectsLocationsConnectionsGetCall) Header() http.Header {
  1060  	if c.header_ == nil {
  1061  		c.header_ = make(http.Header)
  1062  	}
  1063  	return c.header_
  1064  }
  1065  
  1066  func (c *ProjectsLocationsConnectionsGetCall) doRequest(alt string) (*http.Response, error) {
  1067  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1068  	if c.ifNoneMatch_ != "" {
  1069  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1070  	}
  1071  	var body io.Reader = nil
  1072  	c.urlParams_.Set("alt", alt)
  1073  	c.urlParams_.Set("prettyPrint", "false")
  1074  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1075  	urls += "?" + c.urlParams_.Encode()
  1076  	req, err := http.NewRequest("GET", urls, body)
  1077  	if err != nil {
  1078  		return nil, err
  1079  	}
  1080  	req.Header = reqHeaders
  1081  	googleapi.Expand(req.URL, map[string]string{
  1082  		"name": c.name,
  1083  	})
  1084  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1085  }
  1086  
  1087  // Do executes the "bigqueryconnection.projects.locations.connections.get" call.
  1088  // Any non-2xx status code is an error. Response headers are in either
  1089  // *Connection.ServerResponse.Header or (if a response was returned at all) in
  1090  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1091  // whether the returned error was because http.StatusNotModified was returned.
  1092  func (c *ProjectsLocationsConnectionsGetCall) Do(opts ...googleapi.CallOption) (*Connection, error) {
  1093  	gensupport.SetOptions(c.urlParams_, opts...)
  1094  	res, err := c.doRequest("json")
  1095  	if res != nil && res.StatusCode == http.StatusNotModified {
  1096  		if res.Body != nil {
  1097  			res.Body.Close()
  1098  		}
  1099  		return nil, gensupport.WrapError(&googleapi.Error{
  1100  			Code:   res.StatusCode,
  1101  			Header: res.Header,
  1102  		})
  1103  	}
  1104  	if err != nil {
  1105  		return nil, err
  1106  	}
  1107  	defer googleapi.CloseBody(res)
  1108  	if err := googleapi.CheckResponse(res); err != nil {
  1109  		return nil, gensupport.WrapError(err)
  1110  	}
  1111  	ret := &Connection{
  1112  		ServerResponse: googleapi.ServerResponse{
  1113  			Header:         res.Header,
  1114  			HTTPStatusCode: res.StatusCode,
  1115  		},
  1116  	}
  1117  	target := &ret
  1118  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1119  		return nil, err
  1120  	}
  1121  	return ret, nil
  1122  }
  1123  
  1124  type ProjectsLocationsConnectionsGetIamPolicyCall struct {
  1125  	s                   *Service
  1126  	resource            string
  1127  	getiampolicyrequest *GetIamPolicyRequest
  1128  	urlParams_          gensupport.URLParams
  1129  	ctx_                context.Context
  1130  	header_             http.Header
  1131  }
  1132  
  1133  // GetIamPolicy: Gets the access control policy for a resource. Returns an
  1134  // empty policy if the resource exists and does not have a policy set.
  1135  //
  1136  //   - resource: REQUIRED: The resource for which the policy is being requested.
  1137  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  1138  //     for the appropriate value for this field.
  1139  func (r *ProjectsLocationsConnectionsService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ProjectsLocationsConnectionsGetIamPolicyCall {
  1140  	c := &ProjectsLocationsConnectionsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1141  	c.resource = resource
  1142  	c.getiampolicyrequest = getiampolicyrequest
  1143  	return c
  1144  }
  1145  
  1146  // Fields allows partial responses to be retrieved. See
  1147  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1148  // details.
  1149  func (c *ProjectsLocationsConnectionsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsGetIamPolicyCall {
  1150  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1151  	return c
  1152  }
  1153  
  1154  // Context sets the context to be used in this call's Do method.
  1155  func (c *ProjectsLocationsConnectionsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsConnectionsGetIamPolicyCall {
  1156  	c.ctx_ = ctx
  1157  	return c
  1158  }
  1159  
  1160  // Header returns a http.Header that can be modified by the caller to add
  1161  // headers to the request.
  1162  func (c *ProjectsLocationsConnectionsGetIamPolicyCall) Header() http.Header {
  1163  	if c.header_ == nil {
  1164  		c.header_ = make(http.Header)
  1165  	}
  1166  	return c.header_
  1167  }
  1168  
  1169  func (c *ProjectsLocationsConnectionsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  1170  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1171  	var body io.Reader = nil
  1172  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest)
  1173  	if err != nil {
  1174  		return nil, err
  1175  	}
  1176  	c.urlParams_.Set("alt", alt)
  1177  	c.urlParams_.Set("prettyPrint", "false")
  1178  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy")
  1179  	urls += "?" + c.urlParams_.Encode()
  1180  	req, err := http.NewRequest("POST", urls, body)
  1181  	if err != nil {
  1182  		return nil, err
  1183  	}
  1184  	req.Header = reqHeaders
  1185  	googleapi.Expand(req.URL, map[string]string{
  1186  		"resource": c.resource,
  1187  	})
  1188  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1189  }
  1190  
  1191  // Do executes the "bigqueryconnection.projects.locations.connections.getIamPolicy" call.
  1192  // Any non-2xx status code is an error. Response headers are in either
  1193  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  1194  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1195  // whether the returned error was because http.StatusNotModified was returned.
  1196  func (c *ProjectsLocationsConnectionsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  1197  	gensupport.SetOptions(c.urlParams_, opts...)
  1198  	res, err := c.doRequest("json")
  1199  	if res != nil && res.StatusCode == http.StatusNotModified {
  1200  		if res.Body != nil {
  1201  			res.Body.Close()
  1202  		}
  1203  		return nil, gensupport.WrapError(&googleapi.Error{
  1204  			Code:   res.StatusCode,
  1205  			Header: res.Header,
  1206  		})
  1207  	}
  1208  	if err != nil {
  1209  		return nil, err
  1210  	}
  1211  	defer googleapi.CloseBody(res)
  1212  	if err := googleapi.CheckResponse(res); err != nil {
  1213  		return nil, gensupport.WrapError(err)
  1214  	}
  1215  	ret := &Policy{
  1216  		ServerResponse: googleapi.ServerResponse{
  1217  			Header:         res.Header,
  1218  			HTTPStatusCode: res.StatusCode,
  1219  		},
  1220  	}
  1221  	target := &ret
  1222  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1223  		return nil, err
  1224  	}
  1225  	return ret, nil
  1226  }
  1227  
  1228  type ProjectsLocationsConnectionsListCall struct {
  1229  	s            *Service
  1230  	parent       string
  1231  	urlParams_   gensupport.URLParams
  1232  	ifNoneMatch_ string
  1233  	ctx_         context.Context
  1234  	header_      http.Header
  1235  }
  1236  
  1237  // List: Returns a list of connections in the given project.
  1238  //
  1239  //   - parent: Parent resource name. Must be in the form:
  1240  //     `projects/{project_id}/locations/{location_id}`.
  1241  func (r *ProjectsLocationsConnectionsService) List(parent string) *ProjectsLocationsConnectionsListCall {
  1242  	c := &ProjectsLocationsConnectionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1243  	c.parent = parent
  1244  	return c
  1245  }
  1246  
  1247  // MaxResults sets the optional parameter "maxResults": Required. Maximum
  1248  // number of results per page.
  1249  func (c *ProjectsLocationsConnectionsListCall) MaxResults(maxResults int64) *ProjectsLocationsConnectionsListCall {
  1250  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  1251  	return c
  1252  }
  1253  
  1254  // PageToken sets the optional parameter "pageToken": Page token.
  1255  func (c *ProjectsLocationsConnectionsListCall) PageToken(pageToken string) *ProjectsLocationsConnectionsListCall {
  1256  	c.urlParams_.Set("pageToken", pageToken)
  1257  	return c
  1258  }
  1259  
  1260  // Fields allows partial responses to be retrieved. See
  1261  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1262  // details.
  1263  func (c *ProjectsLocationsConnectionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsListCall {
  1264  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1265  	return c
  1266  }
  1267  
  1268  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1269  // object's ETag matches the given value. This is useful for getting updates
  1270  // only after the object has changed since the last request.
  1271  func (c *ProjectsLocationsConnectionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsConnectionsListCall {
  1272  	c.ifNoneMatch_ = entityTag
  1273  	return c
  1274  }
  1275  
  1276  // Context sets the context to be used in this call's Do method.
  1277  func (c *ProjectsLocationsConnectionsListCall) Context(ctx context.Context) *ProjectsLocationsConnectionsListCall {
  1278  	c.ctx_ = ctx
  1279  	return c
  1280  }
  1281  
  1282  // Header returns a http.Header that can be modified by the caller to add
  1283  // headers to the request.
  1284  func (c *ProjectsLocationsConnectionsListCall) Header() http.Header {
  1285  	if c.header_ == nil {
  1286  		c.header_ = make(http.Header)
  1287  	}
  1288  	return c.header_
  1289  }
  1290  
  1291  func (c *ProjectsLocationsConnectionsListCall) doRequest(alt string) (*http.Response, error) {
  1292  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1293  	if c.ifNoneMatch_ != "" {
  1294  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1295  	}
  1296  	var body io.Reader = nil
  1297  	c.urlParams_.Set("alt", alt)
  1298  	c.urlParams_.Set("prettyPrint", "false")
  1299  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/connections")
  1300  	urls += "?" + c.urlParams_.Encode()
  1301  	req, err := http.NewRequest("GET", urls, body)
  1302  	if err != nil {
  1303  		return nil, err
  1304  	}
  1305  	req.Header = reqHeaders
  1306  	googleapi.Expand(req.URL, map[string]string{
  1307  		"parent": c.parent,
  1308  	})
  1309  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1310  }
  1311  
  1312  // Do executes the "bigqueryconnection.projects.locations.connections.list" call.
  1313  // Any non-2xx status code is an error. Response headers are in either
  1314  // *ListConnectionsResponse.ServerResponse.Header or (if a response was
  1315  // returned at all) in error.(*googleapi.Error).Header. Use
  1316  // googleapi.IsNotModified to check whether the returned error was because
  1317  // http.StatusNotModified was returned.
  1318  func (c *ProjectsLocationsConnectionsListCall) Do(opts ...googleapi.CallOption) (*ListConnectionsResponse, error) {
  1319  	gensupport.SetOptions(c.urlParams_, opts...)
  1320  	res, err := c.doRequest("json")
  1321  	if res != nil && res.StatusCode == http.StatusNotModified {
  1322  		if res.Body != nil {
  1323  			res.Body.Close()
  1324  		}
  1325  		return nil, gensupport.WrapError(&googleapi.Error{
  1326  			Code:   res.StatusCode,
  1327  			Header: res.Header,
  1328  		})
  1329  	}
  1330  	if err != nil {
  1331  		return nil, err
  1332  	}
  1333  	defer googleapi.CloseBody(res)
  1334  	if err := googleapi.CheckResponse(res); err != nil {
  1335  		return nil, gensupport.WrapError(err)
  1336  	}
  1337  	ret := &ListConnectionsResponse{
  1338  		ServerResponse: googleapi.ServerResponse{
  1339  			Header:         res.Header,
  1340  			HTTPStatusCode: res.StatusCode,
  1341  		},
  1342  	}
  1343  	target := &ret
  1344  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1345  		return nil, err
  1346  	}
  1347  	return ret, nil
  1348  }
  1349  
  1350  // Pages invokes f for each page of results.
  1351  // A non-nil error returned from f will halt the iteration.
  1352  // The provided context supersedes any context provided to the Context method.
  1353  func (c *ProjectsLocationsConnectionsListCall) Pages(ctx context.Context, f func(*ListConnectionsResponse) error) error {
  1354  	c.ctx_ = ctx
  1355  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1356  	for {
  1357  		x, err := c.Do()
  1358  		if err != nil {
  1359  			return err
  1360  		}
  1361  		if err := f(x); err != nil {
  1362  			return err
  1363  		}
  1364  		if x.NextPageToken == "" {
  1365  			return nil
  1366  		}
  1367  		c.PageToken(x.NextPageToken)
  1368  	}
  1369  }
  1370  
  1371  type ProjectsLocationsConnectionsPatchCall struct {
  1372  	s          *Service
  1373  	name       string
  1374  	connection *Connection
  1375  	urlParams_ gensupport.URLParams
  1376  	ctx_       context.Context
  1377  	header_    http.Header
  1378  }
  1379  
  1380  // Patch: Updates the specified connection. For security reasons, also resets
  1381  // credential if connection properties are in the update field mask.
  1382  //
  1383  //   - name: Name of the connection to update, for example:
  1384  //     `projects/{project_id}/locations/{location_id}/connections/{connection_id}`.
  1385  func (r *ProjectsLocationsConnectionsService) Patch(name string, connection *Connection) *ProjectsLocationsConnectionsPatchCall {
  1386  	c := &ProjectsLocationsConnectionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1387  	c.name = name
  1388  	c.connection = connection
  1389  	return c
  1390  }
  1391  
  1392  // UpdateMask sets the optional parameter "updateMask": Required. Update mask
  1393  // for the connection fields to be updated.
  1394  func (c *ProjectsLocationsConnectionsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsConnectionsPatchCall {
  1395  	c.urlParams_.Set("updateMask", updateMask)
  1396  	return c
  1397  }
  1398  
  1399  // Fields allows partial responses to be retrieved. See
  1400  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1401  // details.
  1402  func (c *ProjectsLocationsConnectionsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsPatchCall {
  1403  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1404  	return c
  1405  }
  1406  
  1407  // Context sets the context to be used in this call's Do method.
  1408  func (c *ProjectsLocationsConnectionsPatchCall) Context(ctx context.Context) *ProjectsLocationsConnectionsPatchCall {
  1409  	c.ctx_ = ctx
  1410  	return c
  1411  }
  1412  
  1413  // Header returns a http.Header that can be modified by the caller to add
  1414  // headers to the request.
  1415  func (c *ProjectsLocationsConnectionsPatchCall) Header() http.Header {
  1416  	if c.header_ == nil {
  1417  		c.header_ = make(http.Header)
  1418  	}
  1419  	return c.header_
  1420  }
  1421  
  1422  func (c *ProjectsLocationsConnectionsPatchCall) doRequest(alt string) (*http.Response, error) {
  1423  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1424  	var body io.Reader = nil
  1425  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.connection)
  1426  	if err != nil {
  1427  		return nil, err
  1428  	}
  1429  	c.urlParams_.Set("alt", alt)
  1430  	c.urlParams_.Set("prettyPrint", "false")
  1431  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1432  	urls += "?" + c.urlParams_.Encode()
  1433  	req, err := http.NewRequest("PATCH", urls, body)
  1434  	if err != nil {
  1435  		return nil, err
  1436  	}
  1437  	req.Header = reqHeaders
  1438  	googleapi.Expand(req.URL, map[string]string{
  1439  		"name": c.name,
  1440  	})
  1441  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1442  }
  1443  
  1444  // Do executes the "bigqueryconnection.projects.locations.connections.patch" call.
  1445  // Any non-2xx status code is an error. Response headers are in either
  1446  // *Connection.ServerResponse.Header or (if a response was returned at all) in
  1447  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1448  // whether the returned error was because http.StatusNotModified was returned.
  1449  func (c *ProjectsLocationsConnectionsPatchCall) Do(opts ...googleapi.CallOption) (*Connection, error) {
  1450  	gensupport.SetOptions(c.urlParams_, opts...)
  1451  	res, err := c.doRequest("json")
  1452  	if res != nil && res.StatusCode == http.StatusNotModified {
  1453  		if res.Body != nil {
  1454  			res.Body.Close()
  1455  		}
  1456  		return nil, gensupport.WrapError(&googleapi.Error{
  1457  			Code:   res.StatusCode,
  1458  			Header: res.Header,
  1459  		})
  1460  	}
  1461  	if err != nil {
  1462  		return nil, err
  1463  	}
  1464  	defer googleapi.CloseBody(res)
  1465  	if err := googleapi.CheckResponse(res); err != nil {
  1466  		return nil, gensupport.WrapError(err)
  1467  	}
  1468  	ret := &Connection{
  1469  		ServerResponse: googleapi.ServerResponse{
  1470  			Header:         res.Header,
  1471  			HTTPStatusCode: res.StatusCode,
  1472  		},
  1473  	}
  1474  	target := &ret
  1475  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1476  		return nil, err
  1477  	}
  1478  	return ret, nil
  1479  }
  1480  
  1481  type ProjectsLocationsConnectionsSetIamPolicyCall struct {
  1482  	s                   *Service
  1483  	resource            string
  1484  	setiampolicyrequest *SetIamPolicyRequest
  1485  	urlParams_          gensupport.URLParams
  1486  	ctx_                context.Context
  1487  	header_             http.Header
  1488  }
  1489  
  1490  // SetIamPolicy: Sets the access control policy on the specified resource.
  1491  // Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
  1492  // and `PERMISSION_DENIED` errors.
  1493  //
  1494  //   - resource: REQUIRED: The resource for which the policy is being specified.
  1495  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  1496  //     for the appropriate value for this field.
  1497  func (r *ProjectsLocationsConnectionsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsConnectionsSetIamPolicyCall {
  1498  	c := &ProjectsLocationsConnectionsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1499  	c.resource = resource
  1500  	c.setiampolicyrequest = setiampolicyrequest
  1501  	return c
  1502  }
  1503  
  1504  // Fields allows partial responses to be retrieved. See
  1505  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1506  // details.
  1507  func (c *ProjectsLocationsConnectionsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsSetIamPolicyCall {
  1508  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1509  	return c
  1510  }
  1511  
  1512  // Context sets the context to be used in this call's Do method.
  1513  func (c *ProjectsLocationsConnectionsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsConnectionsSetIamPolicyCall {
  1514  	c.ctx_ = ctx
  1515  	return c
  1516  }
  1517  
  1518  // Header returns a http.Header that can be modified by the caller to add
  1519  // headers to the request.
  1520  func (c *ProjectsLocationsConnectionsSetIamPolicyCall) Header() http.Header {
  1521  	if c.header_ == nil {
  1522  		c.header_ = make(http.Header)
  1523  	}
  1524  	return c.header_
  1525  }
  1526  
  1527  func (c *ProjectsLocationsConnectionsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  1528  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1529  	var body io.Reader = nil
  1530  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  1531  	if err != nil {
  1532  		return nil, err
  1533  	}
  1534  	c.urlParams_.Set("alt", alt)
  1535  	c.urlParams_.Set("prettyPrint", "false")
  1536  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:setIamPolicy")
  1537  	urls += "?" + c.urlParams_.Encode()
  1538  	req, err := http.NewRequest("POST", urls, body)
  1539  	if err != nil {
  1540  		return nil, err
  1541  	}
  1542  	req.Header = reqHeaders
  1543  	googleapi.Expand(req.URL, map[string]string{
  1544  		"resource": c.resource,
  1545  	})
  1546  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1547  }
  1548  
  1549  // Do executes the "bigqueryconnection.projects.locations.connections.setIamPolicy" call.
  1550  // Any non-2xx status code is an error. Response headers are in either
  1551  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  1552  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1553  // whether the returned error was because http.StatusNotModified was returned.
  1554  func (c *ProjectsLocationsConnectionsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  1555  	gensupport.SetOptions(c.urlParams_, opts...)
  1556  	res, err := c.doRequest("json")
  1557  	if res != nil && res.StatusCode == http.StatusNotModified {
  1558  		if res.Body != nil {
  1559  			res.Body.Close()
  1560  		}
  1561  		return nil, gensupport.WrapError(&googleapi.Error{
  1562  			Code:   res.StatusCode,
  1563  			Header: res.Header,
  1564  		})
  1565  	}
  1566  	if err != nil {
  1567  		return nil, err
  1568  	}
  1569  	defer googleapi.CloseBody(res)
  1570  	if err := googleapi.CheckResponse(res); err != nil {
  1571  		return nil, gensupport.WrapError(err)
  1572  	}
  1573  	ret := &Policy{
  1574  		ServerResponse: googleapi.ServerResponse{
  1575  			Header:         res.Header,
  1576  			HTTPStatusCode: res.StatusCode,
  1577  		},
  1578  	}
  1579  	target := &ret
  1580  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1581  		return nil, err
  1582  	}
  1583  	return ret, nil
  1584  }
  1585  
  1586  type ProjectsLocationsConnectionsTestIamPermissionsCall struct {
  1587  	s                         *Service
  1588  	resource                  string
  1589  	testiampermissionsrequest *TestIamPermissionsRequest
  1590  	urlParams_                gensupport.URLParams
  1591  	ctx_                      context.Context
  1592  	header_                   http.Header
  1593  }
  1594  
  1595  // TestIamPermissions: Returns permissions that a caller has on the specified
  1596  // resource. If the resource does not exist, this will return an empty set of
  1597  // permissions, not a `NOT_FOUND` error. Note: This operation is designed to be
  1598  // used for building permission-aware UIs and command-line tools, not for
  1599  // authorization checking. This operation may "fail open" without warning.
  1600  //
  1601  //   - resource: REQUIRED: The resource for which the policy detail is being
  1602  //     requested. See Resource names
  1603  //     (https://cloud.google.com/apis/design/resource_names) for the appropriate
  1604  //     value for this field.
  1605  func (r *ProjectsLocationsConnectionsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsConnectionsTestIamPermissionsCall {
  1606  	c := &ProjectsLocationsConnectionsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1607  	c.resource = resource
  1608  	c.testiampermissionsrequest = testiampermissionsrequest
  1609  	return c
  1610  }
  1611  
  1612  // Fields allows partial responses to be retrieved. See
  1613  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1614  // details.
  1615  func (c *ProjectsLocationsConnectionsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsTestIamPermissionsCall {
  1616  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1617  	return c
  1618  }
  1619  
  1620  // Context sets the context to be used in this call's Do method.
  1621  func (c *ProjectsLocationsConnectionsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsConnectionsTestIamPermissionsCall {
  1622  	c.ctx_ = ctx
  1623  	return c
  1624  }
  1625  
  1626  // Header returns a http.Header that can be modified by the caller to add
  1627  // headers to the request.
  1628  func (c *ProjectsLocationsConnectionsTestIamPermissionsCall) Header() http.Header {
  1629  	if c.header_ == nil {
  1630  		c.header_ = make(http.Header)
  1631  	}
  1632  	return c.header_
  1633  }
  1634  
  1635  func (c *ProjectsLocationsConnectionsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  1636  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1637  	var body io.Reader = nil
  1638  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  1639  	if err != nil {
  1640  		return nil, err
  1641  	}
  1642  	c.urlParams_.Set("alt", alt)
  1643  	c.urlParams_.Set("prettyPrint", "false")
  1644  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions")
  1645  	urls += "?" + c.urlParams_.Encode()
  1646  	req, err := http.NewRequest("POST", urls, body)
  1647  	if err != nil {
  1648  		return nil, err
  1649  	}
  1650  	req.Header = reqHeaders
  1651  	googleapi.Expand(req.URL, map[string]string{
  1652  		"resource": c.resource,
  1653  	})
  1654  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1655  }
  1656  
  1657  // Do executes the "bigqueryconnection.projects.locations.connections.testIamPermissions" call.
  1658  // Any non-2xx status code is an error. Response headers are in either
  1659  // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
  1660  // returned at all) in error.(*googleapi.Error).Header. Use
  1661  // googleapi.IsNotModified to check whether the returned error was because
  1662  // http.StatusNotModified was returned.
  1663  func (c *ProjectsLocationsConnectionsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  1664  	gensupport.SetOptions(c.urlParams_, opts...)
  1665  	res, err := c.doRequest("json")
  1666  	if res != nil && res.StatusCode == http.StatusNotModified {
  1667  		if res.Body != nil {
  1668  			res.Body.Close()
  1669  		}
  1670  		return nil, gensupport.WrapError(&googleapi.Error{
  1671  			Code:   res.StatusCode,
  1672  			Header: res.Header,
  1673  		})
  1674  	}
  1675  	if err != nil {
  1676  		return nil, err
  1677  	}
  1678  	defer googleapi.CloseBody(res)
  1679  	if err := googleapi.CheckResponse(res); err != nil {
  1680  		return nil, gensupport.WrapError(err)
  1681  	}
  1682  	ret := &TestIamPermissionsResponse{
  1683  		ServerResponse: googleapi.ServerResponse{
  1684  			Header:         res.Header,
  1685  			HTTPStatusCode: res.StatusCode,
  1686  		},
  1687  	}
  1688  	target := &ret
  1689  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1690  		return nil, err
  1691  	}
  1692  	return ret, nil
  1693  }
  1694  
  1695  type ProjectsLocationsConnectionsUpdateCredentialCall struct {
  1696  	s                    *Service
  1697  	name                 string
  1698  	connectioncredential *ConnectionCredential
  1699  	urlParams_           gensupport.URLParams
  1700  	ctx_                 context.Context
  1701  	header_              http.Header
  1702  }
  1703  
  1704  // UpdateCredential: Sets the credential for the specified connection.
  1705  //
  1706  //   - name: Name of the connection, for example:
  1707  //     `projects/{project_id}/locations/{location_id}/connections/{connection_id}/
  1708  //     credential`.
  1709  func (r *ProjectsLocationsConnectionsService) UpdateCredential(name string, connectioncredential *ConnectionCredential) *ProjectsLocationsConnectionsUpdateCredentialCall {
  1710  	c := &ProjectsLocationsConnectionsUpdateCredentialCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1711  	c.name = name
  1712  	c.connectioncredential = connectioncredential
  1713  	return c
  1714  }
  1715  
  1716  // Fields allows partial responses to be retrieved. See
  1717  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1718  // details.
  1719  func (c *ProjectsLocationsConnectionsUpdateCredentialCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsUpdateCredentialCall {
  1720  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1721  	return c
  1722  }
  1723  
  1724  // Context sets the context to be used in this call's Do method.
  1725  func (c *ProjectsLocationsConnectionsUpdateCredentialCall) Context(ctx context.Context) *ProjectsLocationsConnectionsUpdateCredentialCall {
  1726  	c.ctx_ = ctx
  1727  	return c
  1728  }
  1729  
  1730  // Header returns a http.Header that can be modified by the caller to add
  1731  // headers to the request.
  1732  func (c *ProjectsLocationsConnectionsUpdateCredentialCall) Header() http.Header {
  1733  	if c.header_ == nil {
  1734  		c.header_ = make(http.Header)
  1735  	}
  1736  	return c.header_
  1737  }
  1738  
  1739  func (c *ProjectsLocationsConnectionsUpdateCredentialCall) doRequest(alt string) (*http.Response, error) {
  1740  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1741  	var body io.Reader = nil
  1742  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.connectioncredential)
  1743  	if err != nil {
  1744  		return nil, err
  1745  	}
  1746  	c.urlParams_.Set("alt", alt)
  1747  	c.urlParams_.Set("prettyPrint", "false")
  1748  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1749  	urls += "?" + c.urlParams_.Encode()
  1750  	req, err := http.NewRequest("PATCH", urls, body)
  1751  	if err != nil {
  1752  		return nil, err
  1753  	}
  1754  	req.Header = reqHeaders
  1755  	googleapi.Expand(req.URL, map[string]string{
  1756  		"name": c.name,
  1757  	})
  1758  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1759  }
  1760  
  1761  // Do executes the "bigqueryconnection.projects.locations.connections.updateCredential" call.
  1762  // Any non-2xx status code is an error. Response headers are in either
  1763  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  1764  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1765  // whether the returned error was because http.StatusNotModified was returned.
  1766  func (c *ProjectsLocationsConnectionsUpdateCredentialCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  1767  	gensupport.SetOptions(c.urlParams_, opts...)
  1768  	res, err := c.doRequest("json")
  1769  	if res != nil && res.StatusCode == http.StatusNotModified {
  1770  		if res.Body != nil {
  1771  			res.Body.Close()
  1772  		}
  1773  		return nil, gensupport.WrapError(&googleapi.Error{
  1774  			Code:   res.StatusCode,
  1775  			Header: res.Header,
  1776  		})
  1777  	}
  1778  	if err != nil {
  1779  		return nil, err
  1780  	}
  1781  	defer googleapi.CloseBody(res)
  1782  	if err := googleapi.CheckResponse(res); err != nil {
  1783  		return nil, gensupport.WrapError(err)
  1784  	}
  1785  	ret := &Empty{
  1786  		ServerResponse: googleapi.ServerResponse{
  1787  			Header:         res.Header,
  1788  			HTTPStatusCode: res.StatusCode,
  1789  		},
  1790  	}
  1791  	target := &ret
  1792  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1793  		return nil, err
  1794  	}
  1795  	return ret, nil
  1796  }
  1797  

View as plain text