...

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

Documentation: google.golang.org/api/bigquerydatatransfer/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 bigquerydatatransfer provides access to the BigQuery Data Transfer API.
     8  //
     9  // For product documentation, see: https://cloud.google.com/bigquery-transfer/
    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/bigquerydatatransfer/v1"
    27  //	...
    28  //	ctx := context.Background()
    29  //	bigquerydatatransferService, err := bigquerydatatransfer.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  //	bigquerydatatransferService, err := bigquerydatatransfer.NewService(ctx, option.WithScopes(bigquerydatatransfer.CloudPlatformReadOnlyScope))
    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  //	bigquerydatatransferService, err := bigquerydatatransfer.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  //	bigquerydatatransferService, err := bigquerydatatransfer.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    54  //
    55  // See [google.golang.org/api/option.ClientOption] for details on options.
    56  package bigquerydatatransfer // import "google.golang.org/api/bigquerydatatransfer/v1"
    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 = "bigquerydatatransfer:v1"
    95  const apiName = "bigquerydatatransfer"
    96  const apiVersion = "v1"
    97  const basePath = "https://bigquerydatatransfer.googleapis.com/"
    98  const basePathTemplate = "https://bigquerydatatransfer.UNIVERSE_DOMAIN/"
    99  const mtlsBasePath = "https://bigquerydatatransfer.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  	// View your data across Google Cloud services and see the email address of
   112  	// your Google Account
   113  	CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only"
   114  )
   115  
   116  // NewService creates a new Service.
   117  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
   118  	scopesOption := internaloption.WithDefaultScopes(
   119  		"https://www.googleapis.com/auth/bigquery",
   120  		"https://www.googleapis.com/auth/cloud-platform",
   121  		"https://www.googleapis.com/auth/cloud-platform.read-only",
   122  	)
   123  	// NOTE: prepend, so we don't override user-specified scopes.
   124  	opts = append([]option.ClientOption{scopesOption}, opts...)
   125  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
   126  	opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
   127  	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
   128  	opts = append(opts, internaloption.EnableNewAuthLibrary())
   129  	client, endpoint, err := htransport.NewClient(ctx, opts...)
   130  	if err != nil {
   131  		return nil, err
   132  	}
   133  	s, err := New(client)
   134  	if err != nil {
   135  		return nil, err
   136  	}
   137  	if endpoint != "" {
   138  		s.BasePath = endpoint
   139  	}
   140  	return s, nil
   141  }
   142  
   143  // New creates a new Service. It uses the provided http.Client for requests.
   144  //
   145  // Deprecated: please use NewService instead.
   146  // To provide a custom HTTP client, use option.WithHTTPClient.
   147  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   148  func New(client *http.Client) (*Service, error) {
   149  	if client == nil {
   150  		return nil, errors.New("client is nil")
   151  	}
   152  	s := &Service{client: client, BasePath: basePath}
   153  	s.Projects = NewProjectsService(s)
   154  	return s, nil
   155  }
   156  
   157  type Service struct {
   158  	client    *http.Client
   159  	BasePath  string // API endpoint base URL
   160  	UserAgent string // optional additional User-Agent fragment
   161  
   162  	Projects *ProjectsService
   163  }
   164  
   165  func (s *Service) userAgent() string {
   166  	if s.UserAgent == "" {
   167  		return googleapi.UserAgent
   168  	}
   169  	return googleapi.UserAgent + " " + s.UserAgent
   170  }
   171  
   172  func NewProjectsService(s *Service) *ProjectsService {
   173  	rs := &ProjectsService{s: s}
   174  	rs.DataSources = NewProjectsDataSourcesService(s)
   175  	rs.Locations = NewProjectsLocationsService(s)
   176  	rs.TransferConfigs = NewProjectsTransferConfigsService(s)
   177  	return rs
   178  }
   179  
   180  type ProjectsService struct {
   181  	s *Service
   182  
   183  	DataSources *ProjectsDataSourcesService
   184  
   185  	Locations *ProjectsLocationsService
   186  
   187  	TransferConfigs *ProjectsTransferConfigsService
   188  }
   189  
   190  func NewProjectsDataSourcesService(s *Service) *ProjectsDataSourcesService {
   191  	rs := &ProjectsDataSourcesService{s: s}
   192  	return rs
   193  }
   194  
   195  type ProjectsDataSourcesService struct {
   196  	s *Service
   197  }
   198  
   199  func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
   200  	rs := &ProjectsLocationsService{s: s}
   201  	rs.DataSources = NewProjectsLocationsDataSourcesService(s)
   202  	rs.TransferConfigs = NewProjectsLocationsTransferConfigsService(s)
   203  	return rs
   204  }
   205  
   206  type ProjectsLocationsService struct {
   207  	s *Service
   208  
   209  	DataSources *ProjectsLocationsDataSourcesService
   210  
   211  	TransferConfigs *ProjectsLocationsTransferConfigsService
   212  }
   213  
   214  func NewProjectsLocationsDataSourcesService(s *Service) *ProjectsLocationsDataSourcesService {
   215  	rs := &ProjectsLocationsDataSourcesService{s: s}
   216  	return rs
   217  }
   218  
   219  type ProjectsLocationsDataSourcesService struct {
   220  	s *Service
   221  }
   222  
   223  func NewProjectsLocationsTransferConfigsService(s *Service) *ProjectsLocationsTransferConfigsService {
   224  	rs := &ProjectsLocationsTransferConfigsService{s: s}
   225  	rs.Runs = NewProjectsLocationsTransferConfigsRunsService(s)
   226  	return rs
   227  }
   228  
   229  type ProjectsLocationsTransferConfigsService struct {
   230  	s *Service
   231  
   232  	Runs *ProjectsLocationsTransferConfigsRunsService
   233  }
   234  
   235  func NewProjectsLocationsTransferConfigsRunsService(s *Service) *ProjectsLocationsTransferConfigsRunsService {
   236  	rs := &ProjectsLocationsTransferConfigsRunsService{s: s}
   237  	rs.TransferLogs = NewProjectsLocationsTransferConfigsRunsTransferLogsService(s)
   238  	return rs
   239  }
   240  
   241  type ProjectsLocationsTransferConfigsRunsService struct {
   242  	s *Service
   243  
   244  	TransferLogs *ProjectsLocationsTransferConfigsRunsTransferLogsService
   245  }
   246  
   247  func NewProjectsLocationsTransferConfigsRunsTransferLogsService(s *Service) *ProjectsLocationsTransferConfigsRunsTransferLogsService {
   248  	rs := &ProjectsLocationsTransferConfigsRunsTransferLogsService{s: s}
   249  	return rs
   250  }
   251  
   252  type ProjectsLocationsTransferConfigsRunsTransferLogsService struct {
   253  	s *Service
   254  }
   255  
   256  func NewProjectsTransferConfigsService(s *Service) *ProjectsTransferConfigsService {
   257  	rs := &ProjectsTransferConfigsService{s: s}
   258  	rs.Runs = NewProjectsTransferConfigsRunsService(s)
   259  	return rs
   260  }
   261  
   262  type ProjectsTransferConfigsService struct {
   263  	s *Service
   264  
   265  	Runs *ProjectsTransferConfigsRunsService
   266  }
   267  
   268  func NewProjectsTransferConfigsRunsService(s *Service) *ProjectsTransferConfigsRunsService {
   269  	rs := &ProjectsTransferConfigsRunsService{s: s}
   270  	rs.TransferLogs = NewProjectsTransferConfigsRunsTransferLogsService(s)
   271  	return rs
   272  }
   273  
   274  type ProjectsTransferConfigsRunsService struct {
   275  	s *Service
   276  
   277  	TransferLogs *ProjectsTransferConfigsRunsTransferLogsService
   278  }
   279  
   280  func NewProjectsTransferConfigsRunsTransferLogsService(s *Service) *ProjectsTransferConfigsRunsTransferLogsService {
   281  	rs := &ProjectsTransferConfigsRunsTransferLogsService{s: s}
   282  	return rs
   283  }
   284  
   285  type ProjectsTransferConfigsRunsTransferLogsService struct {
   286  	s *Service
   287  }
   288  
   289  // CheckValidCredsRequest: A request to determine whether the user has valid
   290  // credentials. This method is used to limit the number of OAuth popups in the
   291  // user interface. The user id is inferred from the API call context. If the
   292  // data source has the Google+ authorization type, this method returns false,
   293  // as it cannot be determined whether the credentials are already valid merely
   294  // based on the user id.
   295  type CheckValidCredsRequest struct {
   296  }
   297  
   298  // CheckValidCredsResponse: A response indicating whether the credentials exist
   299  // and are valid.
   300  type CheckValidCredsResponse struct {
   301  	// HasValidCreds: If set to `true`, the credentials exist and are valid.
   302  	HasValidCreds bool `json:"hasValidCreds,omitempty"`
   303  
   304  	// ServerResponse contains the HTTP response code and headers from the server.
   305  	googleapi.ServerResponse `json:"-"`
   306  	// ForceSendFields is a list of field names (e.g. "HasValidCreds") to
   307  	// unconditionally include in API requests. By default, fields with empty or
   308  	// default values are omitted from API requests. See
   309  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   310  	// details.
   311  	ForceSendFields []string `json:"-"`
   312  	// NullFields is a list of field names (e.g. "HasValidCreds") to include in API
   313  	// requests with the JSON null value. By default, fields with empty values are
   314  	// omitted from API requests. See
   315  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   316  	NullFields []string `json:"-"`
   317  }
   318  
   319  func (s *CheckValidCredsResponse) MarshalJSON() ([]byte, error) {
   320  	type NoMethod CheckValidCredsResponse
   321  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   322  }
   323  
   324  // DataSource: Defines the properties and custom parameters for a data source.
   325  type DataSource struct {
   326  	// AuthorizationType: Indicates the type of authorization.
   327  	//
   328  	// Possible values:
   329  	//   "AUTHORIZATION_TYPE_UNSPECIFIED" - Type unspecified.
   330  	//   "AUTHORIZATION_CODE" - Use OAuth 2 authorization codes that can be
   331  	// exchanged for a refresh token on the backend.
   332  	//   "GOOGLE_PLUS_AUTHORIZATION_CODE" - Return an authorization code for a
   333  	// given Google+ page that can then be exchanged for a refresh token on the
   334  	// backend.
   335  	//   "FIRST_PARTY_OAUTH" - Use First Party OAuth.
   336  	AuthorizationType string `json:"authorizationType,omitempty"`
   337  	// ClientId: Data source client id which should be used to receive refresh
   338  	// token.
   339  	ClientId string `json:"clientId,omitempty"`
   340  	// DataRefreshType: Specifies whether the data source supports automatic data
   341  	// refresh for the past few days, and how it's supported. For some data
   342  	// sources, data might not be complete until a few days later, so it's useful
   343  	// to refresh data automatically.
   344  	//
   345  	// Possible values:
   346  	//   "DATA_REFRESH_TYPE_UNSPECIFIED" - The data source won't support data auto
   347  	// refresh, which is default value.
   348  	//   "SLIDING_WINDOW" - The data source supports data auto refresh, and runs
   349  	// will be scheduled for the past few days. Does not allow custom values to be
   350  	// set for each transfer config.
   351  	//   "CUSTOM_SLIDING_WINDOW" - The data source supports data auto refresh, and
   352  	// runs will be scheduled for the past few days. Allows custom values to be set
   353  	// for each transfer config.
   354  	DataRefreshType string `json:"dataRefreshType,omitempty"`
   355  	// DataSourceId: Data source id.
   356  	DataSourceId string `json:"dataSourceId,omitempty"`
   357  	// DefaultDataRefreshWindowDays: Default data refresh window on days. Only
   358  	// meaningful when `data_refresh_type` = `SLIDING_WINDOW`.
   359  	DefaultDataRefreshWindowDays int64 `json:"defaultDataRefreshWindowDays,omitempty"`
   360  	// DefaultSchedule: Default data transfer schedule. Examples of valid schedules
   361  	// include: `1st,3rd monday of month 15:30`, `every wed,fri of jan,jun 13:15`,
   362  	// and `first sunday of quarter 00:00`.
   363  	DefaultSchedule string `json:"defaultSchedule,omitempty"`
   364  	// Description: User friendly data source description string.
   365  	Description string `json:"description,omitempty"`
   366  	// DisplayName: User friendly data source name.
   367  	DisplayName string `json:"displayName,omitempty"`
   368  	// HelpUrl: Url for the help document for this data source.
   369  	HelpUrl string `json:"helpUrl,omitempty"`
   370  	// ManualRunsDisabled: Disables backfilling and manual run scheduling for the
   371  	// data source.
   372  	ManualRunsDisabled bool `json:"manualRunsDisabled,omitempty"`
   373  	// MinimumScheduleInterval: The minimum interval for scheduler to schedule
   374  	// runs.
   375  	MinimumScheduleInterval string `json:"minimumScheduleInterval,omitempty"`
   376  	// Name: Output only. Data source resource name.
   377  	Name string `json:"name,omitempty"`
   378  	// Parameters: Data source parameters.
   379  	Parameters []*DataSourceParameter `json:"parameters,omitempty"`
   380  	// Scopes: Api auth scopes for which refresh token needs to be obtained. These
   381  	// are scopes needed by a data source to prepare data and ingest them into
   382  	// BigQuery, e.g., https://www.googleapis.com/auth/bigquery
   383  	Scopes []string `json:"scopes,omitempty"`
   384  	// SupportsCustomSchedule: Specifies whether the data source supports a user
   385  	// defined schedule, or operates on the default schedule. When set to `true`,
   386  	// user can override default schedule.
   387  	SupportsCustomSchedule bool `json:"supportsCustomSchedule,omitempty"`
   388  	// SupportsMultipleTransfers: Deprecated. This field has no effect.
   389  	SupportsMultipleTransfers bool `json:"supportsMultipleTransfers,omitempty"`
   390  	// TransferType: Deprecated. This field has no effect.
   391  	//
   392  	// Possible values:
   393  	//   "TRANSFER_TYPE_UNSPECIFIED" - Invalid or Unknown transfer type
   394  	// placeholder.
   395  	//   "BATCH" - Batch data transfer.
   396  	//   "STREAMING" - Streaming data transfer. Streaming data source currently
   397  	// doesn't support multiple transfer configs per project.
   398  	TransferType string `json:"transferType,omitempty"`
   399  	// UpdateDeadlineSeconds: The number of seconds to wait for an update from the
   400  	// data source before the Data Transfer Service marks the transfer as FAILED.
   401  	UpdateDeadlineSeconds int64 `json:"updateDeadlineSeconds,omitempty"`
   402  
   403  	// ServerResponse contains the HTTP response code and headers from the server.
   404  	googleapi.ServerResponse `json:"-"`
   405  	// ForceSendFields is a list of field names (e.g. "AuthorizationType") to
   406  	// unconditionally include in API requests. By default, fields with empty or
   407  	// default values are omitted from API requests. See
   408  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   409  	// details.
   410  	ForceSendFields []string `json:"-"`
   411  	// NullFields is a list of field names (e.g. "AuthorizationType") to include in
   412  	// API requests with the JSON null value. By default, fields with empty values
   413  	// are omitted from API requests. See
   414  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   415  	NullFields []string `json:"-"`
   416  }
   417  
   418  func (s *DataSource) MarshalJSON() ([]byte, error) {
   419  	type NoMethod DataSource
   420  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   421  }
   422  
   423  // DataSourceParameter: A parameter used to define custom fields in a data
   424  // source definition.
   425  type DataSourceParameter struct {
   426  	// AllowedValues: All possible values for the parameter.
   427  	AllowedValues []string `json:"allowedValues,omitempty"`
   428  	// Deprecated -- If true, it should not be used in new transfers, and it should
   429  	// not be visible to users.
   430  	Deprecated bool `json:"deprecated,omitempty"`
   431  	// Description: Parameter description.
   432  	Description string `json:"description,omitempty"`
   433  	// DisplayName: Parameter display name in the user interface.
   434  	DisplayName string `json:"displayName,omitempty"`
   435  	// Fields: Deprecated. This field has no effect.
   436  	Fields []*DataSourceParameter `json:"fields,omitempty"`
   437  	// Immutable: Cannot be changed after initial creation.
   438  	Immutable bool `json:"immutable,omitempty"`
   439  	// MaxValue: For integer and double values specifies maximum allowed value.
   440  	MaxValue float64 `json:"maxValue,omitempty"`
   441  	// MinValue: For integer and double values specifies minimum allowed value.
   442  	MinValue float64 `json:"minValue,omitempty"`
   443  	// ParamId: Parameter identifier.
   444  	ParamId string `json:"paramId,omitempty"`
   445  	// Recurse: Deprecated. This field has no effect.
   446  	Recurse bool `json:"recurse,omitempty"`
   447  	// Repeated: Deprecated. This field has no effect.
   448  	Repeated bool `json:"repeated,omitempty"`
   449  	// Required: Is parameter required.
   450  	Required bool `json:"required,omitempty"`
   451  	// Type: Parameter type.
   452  	//
   453  	// Possible values:
   454  	//   "TYPE_UNSPECIFIED" - Type unspecified.
   455  	//   "STRING" - String parameter.
   456  	//   "INTEGER" - Integer parameter (64-bits). Will be serialized to json as
   457  	// string.
   458  	//   "DOUBLE" - Double precision floating point parameter.
   459  	//   "BOOLEAN" - Boolean parameter.
   460  	//   "RECORD" - Deprecated. This field has no effect.
   461  	//   "PLUS_PAGE" - Page ID for a Google+ Page.
   462  	//   "LIST" - List of strings parameter.
   463  	Type string `json:"type,omitempty"`
   464  	// ValidationDescription: Description of the requirements for this field, in
   465  	// case the user input does not fulfill the regex pattern or min/max values.
   466  	ValidationDescription string `json:"validationDescription,omitempty"`
   467  	// ValidationHelpUrl: URL to a help document to further explain the naming
   468  	// requirements.
   469  	ValidationHelpUrl string `json:"validationHelpUrl,omitempty"`
   470  	// ValidationRegex: Regular expression which can be used for parameter
   471  	// validation.
   472  	ValidationRegex string `json:"validationRegex,omitempty"`
   473  	// ForceSendFields is a list of field names (e.g. "AllowedValues") to
   474  	// unconditionally include in API requests. By default, fields with empty or
   475  	// default values are omitted from API requests. See
   476  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   477  	// details.
   478  	ForceSendFields []string `json:"-"`
   479  	// NullFields is a list of field names (e.g. "AllowedValues") to include in API
   480  	// requests with the JSON null value. By default, fields with empty values are
   481  	// omitted from API requests. See
   482  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   483  	NullFields []string `json:"-"`
   484  }
   485  
   486  func (s *DataSourceParameter) MarshalJSON() ([]byte, error) {
   487  	type NoMethod DataSourceParameter
   488  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   489  }
   490  
   491  func (s *DataSourceParameter) UnmarshalJSON(data []byte) error {
   492  	type NoMethod DataSourceParameter
   493  	var s1 struct {
   494  		MaxValue gensupport.JSONFloat64 `json:"maxValue"`
   495  		MinValue gensupport.JSONFloat64 `json:"minValue"`
   496  		*NoMethod
   497  	}
   498  	s1.NoMethod = (*NoMethod)(s)
   499  	if err := json.Unmarshal(data, &s1); err != nil {
   500  		return err
   501  	}
   502  	s.MaxValue = float64(s1.MaxValue)
   503  	s.MinValue = float64(s1.MinValue)
   504  	return nil
   505  }
   506  
   507  // EmailPreferences: Represents preferences for sending email notifications for
   508  // transfer run events.
   509  type EmailPreferences struct {
   510  	// EnableFailureEmail: If true, email notifications will be sent on transfer
   511  	// run failures.
   512  	EnableFailureEmail bool `json:"enableFailureEmail,omitempty"`
   513  	// ForceSendFields is a list of field names (e.g. "EnableFailureEmail") to
   514  	// unconditionally include in API requests. By default, fields with empty or
   515  	// default values are omitted from API requests. See
   516  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   517  	// details.
   518  	ForceSendFields []string `json:"-"`
   519  	// NullFields is a list of field names (e.g. "EnableFailureEmail") to include
   520  	// in API requests with the JSON null value. By default, fields with empty
   521  	// values are omitted from API requests. See
   522  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   523  	NullFields []string `json:"-"`
   524  }
   525  
   526  func (s *EmailPreferences) MarshalJSON() ([]byte, error) {
   527  	type NoMethod EmailPreferences
   528  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   529  }
   530  
   531  // Empty: A generic empty message that you can re-use to avoid defining
   532  // duplicated empty messages in your APIs. A typical example is to use it as
   533  // the request or the response type of an API method. For instance: service Foo
   534  // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
   535  type Empty struct {
   536  	// ServerResponse contains the HTTP response code and headers from the server.
   537  	googleapi.ServerResponse `json:"-"`
   538  }
   539  
   540  // EncryptionConfiguration: Represents the encryption configuration for a
   541  // transfer.
   542  type EncryptionConfiguration struct {
   543  	// KmsKeyName: The name of the KMS key used for encrypting BigQuery data.
   544  	KmsKeyName string `json:"kmsKeyName,omitempty"`
   545  	// ForceSendFields is a list of field names (e.g. "KmsKeyName") to
   546  	// unconditionally include in API requests. By default, fields with empty or
   547  	// default values are omitted from API requests. See
   548  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   549  	// details.
   550  	ForceSendFields []string `json:"-"`
   551  	// NullFields is a list of field names (e.g. "KmsKeyName") to include in API
   552  	// requests with the JSON null value. By default, fields with empty values are
   553  	// omitted from API requests. See
   554  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   555  	NullFields []string `json:"-"`
   556  }
   557  
   558  func (s *EncryptionConfiguration) MarshalJSON() ([]byte, error) {
   559  	type NoMethod EncryptionConfiguration
   560  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   561  }
   562  
   563  // EnrollDataSourcesRequest: A request to enroll a set of data sources so they
   564  // are visible in the BigQuery UI's `Transfer` tab.
   565  type EnrollDataSourcesRequest struct {
   566  	// DataSourceIds: Data sources that are enrolled. It is required to provide at
   567  	// least one data source id.
   568  	DataSourceIds []string `json:"dataSourceIds,omitempty"`
   569  	// ForceSendFields is a list of field names (e.g. "DataSourceIds") to
   570  	// unconditionally include in API requests. By default, fields with empty or
   571  	// default values are omitted from API requests. See
   572  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   573  	// details.
   574  	ForceSendFields []string `json:"-"`
   575  	// NullFields is a list of field names (e.g. "DataSourceIds") to include in API
   576  	// requests with the JSON null value. By default, fields with empty values are
   577  	// omitted from API requests. See
   578  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   579  	NullFields []string `json:"-"`
   580  }
   581  
   582  func (s *EnrollDataSourcesRequest) MarshalJSON() ([]byte, error) {
   583  	type NoMethod EnrollDataSourcesRequest
   584  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   585  }
   586  
   587  // ListDataSourcesResponse: Returns list of supported data sources and their
   588  // metadata.
   589  type ListDataSourcesResponse struct {
   590  	// DataSources: List of supported data sources and their transfer settings.
   591  	DataSources []*DataSource `json:"dataSources,omitempty"`
   592  	// NextPageToken: Output only. The next-pagination token. For multiple-page
   593  	// list results, this token can be used as the
   594  	// `ListDataSourcesRequest.page_token` to request the next page of list
   595  	// results.
   596  	NextPageToken string `json:"nextPageToken,omitempty"`
   597  
   598  	// ServerResponse contains the HTTP response code and headers from the server.
   599  	googleapi.ServerResponse `json:"-"`
   600  	// ForceSendFields is a list of field names (e.g. "DataSources") to
   601  	// unconditionally include in API requests. By default, fields with empty or
   602  	// default values are omitted from API requests. See
   603  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   604  	// details.
   605  	ForceSendFields []string `json:"-"`
   606  	// NullFields is a list of field names (e.g. "DataSources") to include in API
   607  	// requests with the JSON null value. By default, fields with empty values are
   608  	// omitted from API requests. See
   609  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   610  	NullFields []string `json:"-"`
   611  }
   612  
   613  func (s *ListDataSourcesResponse) MarshalJSON() ([]byte, error) {
   614  	type NoMethod ListDataSourcesResponse
   615  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   616  }
   617  
   618  // ListLocationsResponse: The response message for Locations.ListLocations.
   619  type ListLocationsResponse struct {
   620  	// Locations: A list of locations that matches the specified filter in the
   621  	// request.
   622  	Locations []*Location `json:"locations,omitempty"`
   623  	// NextPageToken: The standard List next-page token.
   624  	NextPageToken string `json:"nextPageToken,omitempty"`
   625  
   626  	// ServerResponse contains the HTTP response code and headers from the server.
   627  	googleapi.ServerResponse `json:"-"`
   628  	// ForceSendFields is a list of field names (e.g. "Locations") to
   629  	// unconditionally include in API requests. By default, fields with empty or
   630  	// default values are omitted from API requests. See
   631  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   632  	// details.
   633  	ForceSendFields []string `json:"-"`
   634  	// NullFields is a list of field names (e.g. "Locations") to include in API
   635  	// requests with the JSON null value. By default, fields with empty values are
   636  	// omitted from API requests. See
   637  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   638  	NullFields []string `json:"-"`
   639  }
   640  
   641  func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
   642  	type NoMethod ListLocationsResponse
   643  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   644  }
   645  
   646  // ListTransferConfigsResponse: The returned list of pipelines in the project.
   647  type ListTransferConfigsResponse struct {
   648  	// NextPageToken: Output only. The next-pagination token. For multiple-page
   649  	// list results, this token can be used as the
   650  	// `ListTransferConfigsRequest.page_token` to request the next page of list
   651  	// results.
   652  	NextPageToken string `json:"nextPageToken,omitempty"`
   653  	// TransferConfigs: Output only. The stored pipeline transfer configurations.
   654  	TransferConfigs []*TransferConfig `json:"transferConfigs,omitempty"`
   655  
   656  	// ServerResponse contains the HTTP response code and headers from the server.
   657  	googleapi.ServerResponse `json:"-"`
   658  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   659  	// unconditionally include in API requests. By default, fields with empty or
   660  	// default values are omitted from API requests. See
   661  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   662  	// details.
   663  	ForceSendFields []string `json:"-"`
   664  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   665  	// requests with the JSON null value. By default, fields with empty values are
   666  	// omitted from API requests. See
   667  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   668  	NullFields []string `json:"-"`
   669  }
   670  
   671  func (s *ListTransferConfigsResponse) MarshalJSON() ([]byte, error) {
   672  	type NoMethod ListTransferConfigsResponse
   673  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   674  }
   675  
   676  // ListTransferLogsResponse: The returned list transfer run messages.
   677  type ListTransferLogsResponse struct {
   678  	// NextPageToken: Output only. The next-pagination token. For multiple-page
   679  	// list results, this token can be used as the
   680  	// `GetTransferRunLogRequest.page_token` to request the next page of list
   681  	// results.
   682  	NextPageToken string `json:"nextPageToken,omitempty"`
   683  	// TransferMessages: Output only. The stored pipeline transfer messages.
   684  	TransferMessages []*TransferMessage `json:"transferMessages,omitempty"`
   685  
   686  	// ServerResponse contains the HTTP response code and headers from the server.
   687  	googleapi.ServerResponse `json:"-"`
   688  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   689  	// unconditionally include in API requests. By default, fields with empty or
   690  	// default values are omitted from API requests. See
   691  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   692  	// details.
   693  	ForceSendFields []string `json:"-"`
   694  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   695  	// requests with the JSON null value. By default, fields with empty values are
   696  	// omitted from API requests. See
   697  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   698  	NullFields []string `json:"-"`
   699  }
   700  
   701  func (s *ListTransferLogsResponse) MarshalJSON() ([]byte, error) {
   702  	type NoMethod ListTransferLogsResponse
   703  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   704  }
   705  
   706  // ListTransferRunsResponse: The returned list of pipelines in the project.
   707  type ListTransferRunsResponse struct {
   708  	// NextPageToken: Output only. The next-pagination token. For multiple-page
   709  	// list results, this token can be used as the
   710  	// `ListTransferRunsRequest.page_token` to request the next page of list
   711  	// results.
   712  	NextPageToken string `json:"nextPageToken,omitempty"`
   713  	// TransferRuns: Output only. The stored pipeline transfer runs.
   714  	TransferRuns []*TransferRun `json:"transferRuns,omitempty"`
   715  
   716  	// ServerResponse contains the HTTP response code and headers from the server.
   717  	googleapi.ServerResponse `json:"-"`
   718  	// ForceSendFields is a list of field names (e.g. "NextPageToken") 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. "NextPageToken") 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 *ListTransferRunsResponse) MarshalJSON() ([]byte, error) {
   732  	type NoMethod ListTransferRunsResponse
   733  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   734  }
   735  
   736  // Location: A resource that represents a Google Cloud location.
   737  type Location struct {
   738  	// DisplayName: The friendly name for this location, typically a nearby city
   739  	// name. For example, "Tokyo".
   740  	DisplayName string `json:"displayName,omitempty"`
   741  	// Labels: Cross-service attributes for the location. For example
   742  	// {"cloud.googleapis.com/region": "us-east1"}
   743  	Labels map[string]string `json:"labels,omitempty"`
   744  	// LocationId: The canonical id for this location. For example: "us-east1".
   745  	LocationId string `json:"locationId,omitempty"`
   746  	// Metadata: Service-specific metadata. For example the available capacity at
   747  	// the given location.
   748  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
   749  	// Name: Resource name for the location, which may vary between
   750  	// implementations. For example:
   751  	// "projects/example-project/locations/us-east1"
   752  	Name string `json:"name,omitempty"`
   753  
   754  	// ServerResponse contains the HTTP response code and headers from the server.
   755  	googleapi.ServerResponse `json:"-"`
   756  	// ForceSendFields is a list of field names (e.g. "DisplayName") to
   757  	// unconditionally include in API requests. By default, fields with empty or
   758  	// default values are omitted from API requests. See
   759  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   760  	// details.
   761  	ForceSendFields []string `json:"-"`
   762  	// NullFields is a list of field names (e.g. "DisplayName") to include in API
   763  	// requests with the JSON null value. By default, fields with empty values are
   764  	// omitted from API requests. See
   765  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   766  	NullFields []string `json:"-"`
   767  }
   768  
   769  func (s *Location) MarshalJSON() ([]byte, error) {
   770  	type NoMethod Location
   771  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   772  }
   773  
   774  // ScheduleOptions: Options customizing the data transfer schedule.
   775  type ScheduleOptions struct {
   776  	// DisableAutoScheduling: If true, automatic scheduling of data transfer runs
   777  	// for this configuration will be disabled. The runs can be started on ad-hoc
   778  	// basis using StartManualTransferRuns API. When automatic scheduling is
   779  	// disabled, the TransferConfig.schedule field will be ignored.
   780  	DisableAutoScheduling bool `json:"disableAutoScheduling,omitempty"`
   781  	// EndTime: Defines time to stop scheduling transfer runs. A transfer run
   782  	// cannot be scheduled at or after the end time. The end time can be changed at
   783  	// any moment. The time when a data transfer can be triggered manually is not
   784  	// limited by this option.
   785  	EndTime string `json:"endTime,omitempty"`
   786  	// StartTime: Specifies time to start scheduling transfer runs. The first run
   787  	// will be scheduled at or after the start time according to a recurrence
   788  	// pattern defined in the schedule string. The start time can be changed at any
   789  	// moment. The time when a data transfer can be triggered manually is not
   790  	// limited by this option.
   791  	StartTime string `json:"startTime,omitempty"`
   792  	// ForceSendFields is a list of field names (e.g. "DisableAutoScheduling") to
   793  	// unconditionally include in API requests. By default, fields with empty or
   794  	// default values are omitted from API requests. See
   795  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   796  	// details.
   797  	ForceSendFields []string `json:"-"`
   798  	// NullFields is a list of field names (e.g. "DisableAutoScheduling") to
   799  	// include in API requests with the JSON null value. By default, fields with
   800  	// empty values are omitted from API requests. See
   801  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   802  	NullFields []string `json:"-"`
   803  }
   804  
   805  func (s *ScheduleOptions) MarshalJSON() ([]byte, error) {
   806  	type NoMethod ScheduleOptions
   807  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   808  }
   809  
   810  // ScheduleTransferRunsRequest: A request to schedule transfer runs for a time
   811  // range.
   812  type ScheduleTransferRunsRequest struct {
   813  	// EndTime: Required. End time of the range of transfer runs. For example,
   814  	// "2017-05-30T00:00:00+00:00".
   815  	EndTime string `json:"endTime,omitempty"`
   816  	// StartTime: Required. Start time of the range of transfer runs. For example,
   817  	// "2017-05-25T00:00:00+00:00".
   818  	StartTime string `json:"startTime,omitempty"`
   819  	// ForceSendFields is a list of field names (e.g. "EndTime") to unconditionally
   820  	// include in API requests. By default, fields with empty or default values are
   821  	// omitted from API requests. See
   822  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   823  	// details.
   824  	ForceSendFields []string `json:"-"`
   825  	// NullFields is a list of field names (e.g. "EndTime") to include in API
   826  	// requests with the JSON null value. By default, fields with empty values are
   827  	// omitted from API requests. See
   828  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   829  	NullFields []string `json:"-"`
   830  }
   831  
   832  func (s *ScheduleTransferRunsRequest) MarshalJSON() ([]byte, error) {
   833  	type NoMethod ScheduleTransferRunsRequest
   834  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   835  }
   836  
   837  // ScheduleTransferRunsResponse: A response to schedule transfer runs for a
   838  // time range.
   839  type ScheduleTransferRunsResponse struct {
   840  	// Runs: The transfer runs that were scheduled.
   841  	Runs []*TransferRun `json:"runs,omitempty"`
   842  
   843  	// ServerResponse contains the HTTP response code and headers from the server.
   844  	googleapi.ServerResponse `json:"-"`
   845  	// ForceSendFields is a list of field names (e.g. "Runs") to unconditionally
   846  	// include in API requests. By default, fields with empty or default values are
   847  	// omitted from API requests. See
   848  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   849  	// details.
   850  	ForceSendFields []string `json:"-"`
   851  	// NullFields is a list of field names (e.g. "Runs") to include in API requests
   852  	// with the JSON null value. By default, fields with empty values are omitted
   853  	// from API requests. See
   854  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   855  	NullFields []string `json:"-"`
   856  }
   857  
   858  func (s *ScheduleTransferRunsResponse) MarshalJSON() ([]byte, error) {
   859  	type NoMethod ScheduleTransferRunsResponse
   860  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   861  }
   862  
   863  // StartManualTransferRunsRequest: A request to start manual transfer runs.
   864  type StartManualTransferRunsRequest struct {
   865  	// RequestedRunTime: A run_time timestamp for historical data files or reports
   866  	// that are scheduled to be transferred by the scheduled transfer run.
   867  	// requested_run_time must be a past time and cannot include future time
   868  	// values.
   869  	RequestedRunTime string `json:"requestedRunTime,omitempty"`
   870  	// RequestedTimeRange: A time_range start and end timestamp for historical data
   871  	// files or reports that are scheduled to be transferred by the scheduled
   872  	// transfer run. requested_time_range must be a past time and cannot include
   873  	// future time values.
   874  	RequestedTimeRange *TimeRange `json:"requestedTimeRange,omitempty"`
   875  	// ForceSendFields is a list of field names (e.g. "RequestedRunTime") to
   876  	// unconditionally include in API requests. By default, fields with empty or
   877  	// default values are omitted from API requests. See
   878  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   879  	// details.
   880  	ForceSendFields []string `json:"-"`
   881  	// NullFields is a list of field names (e.g. "RequestedRunTime") to include in
   882  	// API requests with the JSON null value. By default, fields with empty values
   883  	// are omitted from API requests. See
   884  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   885  	NullFields []string `json:"-"`
   886  }
   887  
   888  func (s *StartManualTransferRunsRequest) MarshalJSON() ([]byte, error) {
   889  	type NoMethod StartManualTransferRunsRequest
   890  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   891  }
   892  
   893  // StartManualTransferRunsResponse: A response to start manual transfer runs.
   894  type StartManualTransferRunsResponse struct {
   895  	// Runs: The transfer runs that were created.
   896  	Runs []*TransferRun `json:"runs,omitempty"`
   897  
   898  	// ServerResponse contains the HTTP response code and headers from the server.
   899  	googleapi.ServerResponse `json:"-"`
   900  	// ForceSendFields is a list of field names (e.g. "Runs") to unconditionally
   901  	// include in API requests. By default, fields with empty or default values are
   902  	// omitted from API requests. See
   903  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   904  	// details.
   905  	ForceSendFields []string `json:"-"`
   906  	// NullFields is a list of field names (e.g. "Runs") to include in API requests
   907  	// with the JSON null value. By default, fields with empty values are omitted
   908  	// from API requests. See
   909  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   910  	NullFields []string `json:"-"`
   911  }
   912  
   913  func (s *StartManualTransferRunsResponse) MarshalJSON() ([]byte, error) {
   914  	type NoMethod StartManualTransferRunsResponse
   915  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   916  }
   917  
   918  // Status: The `Status` type defines a logical error model that is suitable for
   919  // different programming environments, including REST APIs and RPC APIs. It is
   920  // used by gRPC (https://github.com/grpc). Each `Status` message contains three
   921  // pieces of data: error code, error message, and error details. You can find
   922  // out more about this error model and how to work with it in the API Design
   923  // Guide (https://cloud.google.com/apis/design/errors).
   924  type Status struct {
   925  	// Code: The status code, which should be an enum value of google.rpc.Code.
   926  	Code int64 `json:"code,omitempty"`
   927  	// Details: A list of messages that carry the error details. There is a common
   928  	// set of message types for APIs to use.
   929  	Details []googleapi.RawMessage `json:"details,omitempty"`
   930  	// Message: A developer-facing error message, which should be in English. Any
   931  	// user-facing error message should be localized and sent in the
   932  	// google.rpc.Status.details field, or localized by the client.
   933  	Message string `json:"message,omitempty"`
   934  	// ForceSendFields is a list of field names (e.g. "Code") to unconditionally
   935  	// include in API requests. By default, fields with empty or default values are
   936  	// omitted from API requests. See
   937  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   938  	// details.
   939  	ForceSendFields []string `json:"-"`
   940  	// NullFields is a list of field names (e.g. "Code") to include in API requests
   941  	// with the JSON null value. By default, fields with empty values are omitted
   942  	// from API requests. See
   943  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   944  	NullFields []string `json:"-"`
   945  }
   946  
   947  func (s *Status) MarshalJSON() ([]byte, error) {
   948  	type NoMethod Status
   949  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   950  }
   951  
   952  // TimeRange: A specification for a time range, this will request transfer runs
   953  // with run_time between start_time (inclusive) and end_time (exclusive).
   954  type TimeRange struct {
   955  	// EndTime: End time of the range of transfer runs. For example,
   956  	// "2017-05-30T00:00:00+00:00". The end_time must not be in the future.
   957  	// Creates transfer runs where run_time is in the range between start_time
   958  	// (inclusive) and end_time (exclusive).
   959  	EndTime string `json:"endTime,omitempty"`
   960  	// StartTime: Start time of the range of transfer runs. For example,
   961  	// "2017-05-25T00:00:00+00:00". The start_time must be strictly less than the
   962  	// end_time. Creates transfer runs where run_time is in the range between
   963  	// start_time (inclusive) and end_time (exclusive).
   964  	StartTime string `json:"startTime,omitempty"`
   965  	// ForceSendFields is a list of field names (e.g. "EndTime") to unconditionally
   966  	// include in API requests. By default, fields with empty or default values are
   967  	// omitted from API requests. See
   968  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   969  	// details.
   970  	ForceSendFields []string `json:"-"`
   971  	// NullFields is a list of field names (e.g. "EndTime") to include in API
   972  	// requests with the JSON null value. By default, fields with empty values are
   973  	// omitted from API requests. See
   974  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   975  	NullFields []string `json:"-"`
   976  }
   977  
   978  func (s *TimeRange) MarshalJSON() ([]byte, error) {
   979  	type NoMethod TimeRange
   980  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   981  }
   982  
   983  // TransferConfig: Represents a data transfer configuration. A transfer
   984  // configuration contains all metadata needed to perform a data transfer. For
   985  // example, `destination_dataset_id` specifies where data should be stored.
   986  // When a new transfer configuration is created, the specified
   987  // `destination_dataset_id` is created when needed and shared with the
   988  // appropriate data source service account.
   989  type TransferConfig struct {
   990  	// DataRefreshWindowDays: The number of days to look back to automatically
   991  	// refresh the data. For example, if `data_refresh_window_days = 10`, then
   992  	// every day BigQuery reingests data for [today-10, today-1], rather than
   993  	// ingesting data for just [today-1]. Only valid if the data source supports
   994  	// the feature. Set the value to 0 to use the default value.
   995  	DataRefreshWindowDays int64 `json:"dataRefreshWindowDays,omitempty"`
   996  	// DataSourceId: Data source ID. This cannot be changed once data transfer is
   997  	// created. The full list of available data source IDs can be returned through
   998  	// an API call:
   999  	// https://cloud.google.com/bigquery-transfer/docs/reference/datatransfer/rest/v1/projects.locations.dataSources/list
  1000  	DataSourceId string `json:"dataSourceId,omitempty"`
  1001  	// DatasetRegion: Output only. Region in which BigQuery dataset is located.
  1002  	DatasetRegion string `json:"datasetRegion,omitempty"`
  1003  	// DestinationDatasetId: The BigQuery target dataset id.
  1004  	DestinationDatasetId string `json:"destinationDatasetId,omitempty"`
  1005  	// Disabled: Is this config disabled. When set to true, no runs will be
  1006  	// scheduled for this transfer config.
  1007  	Disabled bool `json:"disabled,omitempty"`
  1008  	// DisplayName: User specified display name for the data transfer.
  1009  	DisplayName string `json:"displayName,omitempty"`
  1010  	// EmailPreferences: Email notifications will be sent according to these
  1011  	// preferences to the email address of the user who owns this transfer config.
  1012  	EmailPreferences *EmailPreferences `json:"emailPreferences,omitempty"`
  1013  	// EncryptionConfiguration: The encryption configuration part. Currently, it is
  1014  	// only used for the optional KMS key name. The BigQuery service account of
  1015  	// your project must be granted permissions to use the key. Read methods will
  1016  	// return the key name applied in effect. Write methods will apply the key if
  1017  	// it is present, or otherwise try to apply project default keys if it is
  1018  	// absent.
  1019  	EncryptionConfiguration *EncryptionConfiguration `json:"encryptionConfiguration,omitempty"`
  1020  	// Name: Identifier. The resource name of the transfer config. Transfer config
  1021  	// names have the form either
  1022  	// `projects/{project_id}/locations/{region}/transferConfigs/{config_id}` or
  1023  	// `projects/{project_id}/transferConfigs/{config_id}`, where `config_id` is
  1024  	// usually a UUID, even though it is not guaranteed or required. The name is
  1025  	// ignored when creating a transfer config.
  1026  	Name string `json:"name,omitempty"`
  1027  	// NextRunTime: Output only. Next time when data transfer will run.
  1028  	NextRunTime string `json:"nextRunTime,omitempty"`
  1029  	// NotificationPubsubTopic: Pub/Sub topic where notifications will be sent
  1030  	// after transfer runs associated with this transfer config finish. The format
  1031  	// for specifying a pubsub topic is: `projects/{project_id}/topics/{topic_id}`
  1032  	NotificationPubsubTopic string `json:"notificationPubsubTopic,omitempty"`
  1033  	// OwnerInfo: Output only. Information about the user whose credentials are
  1034  	// used to transfer data. Populated only for `transferConfigs.get` requests. In
  1035  	// case the user information is not available, this field will not be
  1036  	// populated.
  1037  	OwnerInfo *UserInfo `json:"ownerInfo,omitempty"`
  1038  	// Params: Parameters specific to each data source. For more information see
  1039  	// the bq tab in the 'Setting up a data transfer' section for each data source.
  1040  	// For example the parameters for Cloud Storage transfers are listed here:
  1041  	// https://cloud.google.com/bigquery-transfer/docs/cloud-storage-transfer#bq
  1042  	Params googleapi.RawMessage `json:"params,omitempty"`
  1043  	// Schedule: Data transfer schedule. If the data source does not support a
  1044  	// custom schedule, this should be empty. If it is empty, the default value for
  1045  	// the data source will be used. The specified times are in UTC. Examples of
  1046  	// valid format: `1st,3rd monday of month 15:30`, `every wed,fri of jan,jun
  1047  	// 13:15`, and `first sunday of quarter 00:00`. See more explanation about the
  1048  	// format here:
  1049  	// https://cloud.google.com/appengine/docs/flexible/python/scheduling-jobs-with-cron-yaml#the_schedule_format
  1050  	// NOTE: The minimum interval time between recurring transfers depends on the
  1051  	// data source; refer to the documentation for your data source.
  1052  	Schedule string `json:"schedule,omitempty"`
  1053  	// ScheduleOptions: Options customizing the data transfer schedule.
  1054  	ScheduleOptions *ScheduleOptions `json:"scheduleOptions,omitempty"`
  1055  	// State: Output only. State of the most recently updated transfer run.
  1056  	//
  1057  	// Possible values:
  1058  	//   "TRANSFER_STATE_UNSPECIFIED" - State placeholder (0).
  1059  	//   "PENDING" - Data transfer is scheduled and is waiting to be picked up by
  1060  	// data transfer backend (2).
  1061  	//   "RUNNING" - Data transfer is in progress (3).
  1062  	//   "SUCCEEDED" - Data transfer completed successfully (4).
  1063  	//   "FAILED" - Data transfer failed (5).
  1064  	//   "CANCELLED" - Data transfer is cancelled (6).
  1065  	State string `json:"state,omitempty"`
  1066  	// UpdateTime: Output only. Data transfer modification time. Ignored by server
  1067  	// on input.
  1068  	UpdateTime string `json:"updateTime,omitempty"`
  1069  	// UserId: Deprecated. Unique ID of the user on whose behalf transfer is done.
  1070  	UserId int64 `json:"userId,omitempty,string"`
  1071  
  1072  	// ServerResponse contains the HTTP response code and headers from the server.
  1073  	googleapi.ServerResponse `json:"-"`
  1074  	// ForceSendFields is a list of field names (e.g. "DataRefreshWindowDays") to
  1075  	// unconditionally include in API requests. By default, fields with empty or
  1076  	// default values are omitted from API requests. See
  1077  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1078  	// details.
  1079  	ForceSendFields []string `json:"-"`
  1080  	// NullFields is a list of field names (e.g. "DataRefreshWindowDays") to
  1081  	// include in API requests with the JSON null value. By default, fields with
  1082  	// empty values are omitted from API requests. See
  1083  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1084  	NullFields []string `json:"-"`
  1085  }
  1086  
  1087  func (s *TransferConfig) MarshalJSON() ([]byte, error) {
  1088  	type NoMethod TransferConfig
  1089  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1090  }
  1091  
  1092  // TransferMessage: Represents a user facing message for a particular data
  1093  // transfer run.
  1094  type TransferMessage struct {
  1095  	// MessageText: Message text.
  1096  	MessageText string `json:"messageText,omitempty"`
  1097  	// MessageTime: Time when message was logged.
  1098  	MessageTime string `json:"messageTime,omitempty"`
  1099  	// Severity: Message severity.
  1100  	//
  1101  	// Possible values:
  1102  	//   "MESSAGE_SEVERITY_UNSPECIFIED" - No severity specified.
  1103  	//   "INFO" - Informational message.
  1104  	//   "WARNING" - Warning message.
  1105  	//   "ERROR" - Error message.
  1106  	Severity string `json:"severity,omitempty"`
  1107  	// ForceSendFields is a list of field names (e.g. "MessageText") to
  1108  	// unconditionally include in API requests. By default, fields with empty or
  1109  	// default values are omitted from API requests. See
  1110  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1111  	// details.
  1112  	ForceSendFields []string `json:"-"`
  1113  	// NullFields is a list of field names (e.g. "MessageText") to include in API
  1114  	// requests with the JSON null value. By default, fields with empty values are
  1115  	// omitted from API requests. See
  1116  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1117  	NullFields []string `json:"-"`
  1118  }
  1119  
  1120  func (s *TransferMessage) MarshalJSON() ([]byte, error) {
  1121  	type NoMethod TransferMessage
  1122  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1123  }
  1124  
  1125  // TransferRun: Represents a data transfer run.
  1126  type TransferRun struct {
  1127  	// DataSourceId: Output only. Data source id.
  1128  	DataSourceId string `json:"dataSourceId,omitempty"`
  1129  	// DestinationDatasetId: Output only. The BigQuery target dataset id.
  1130  	DestinationDatasetId string `json:"destinationDatasetId,omitempty"`
  1131  	// EmailPreferences: Output only. Email notifications will be sent according to
  1132  	// these preferences to the email address of the user who owns the transfer
  1133  	// config this run was derived from.
  1134  	EmailPreferences *EmailPreferences `json:"emailPreferences,omitempty"`
  1135  	// EndTime: Output only. Time when transfer run ended. Parameter ignored by
  1136  	// server for input requests.
  1137  	EndTime string `json:"endTime,omitempty"`
  1138  	// ErrorStatus: Status of the transfer run.
  1139  	ErrorStatus *Status `json:"errorStatus,omitempty"`
  1140  	// Name: Identifier. The resource name of the transfer run. Transfer run names
  1141  	// have the form
  1142  	// `projects/{project_id}/locations/{location}/transferConfigs/{config_id}/runs/
  1143  	// {run_id}`. The name is ignored when creating a transfer run.
  1144  	Name string `json:"name,omitempty"`
  1145  	// NotificationPubsubTopic: Output only. Pub/Sub topic where a notification
  1146  	// will be sent after this transfer run finishes. The format for specifying a
  1147  	// pubsub topic is: `projects/{project_id}/topics/{topic_id}`
  1148  	NotificationPubsubTopic string `json:"notificationPubsubTopic,omitempty"`
  1149  	// Params: Output only. Parameters specific to each data source. For more
  1150  	// information see the bq tab in the 'Setting up a data transfer' section for
  1151  	// each data source. For example the parameters for Cloud Storage transfers are
  1152  	// listed here:
  1153  	// https://cloud.google.com/bigquery-transfer/docs/cloud-storage-transfer#bq
  1154  	Params googleapi.RawMessage `json:"params,omitempty"`
  1155  	// RunTime: For batch transfer runs, specifies the date and time of the data
  1156  	// should be ingested.
  1157  	RunTime string `json:"runTime,omitempty"`
  1158  	// Schedule: Output only. Describes the schedule of this transfer run if it was
  1159  	// created as part of a regular schedule. For batch transfer runs that are
  1160  	// scheduled manually, this is empty. NOTE: the system might choose to delay
  1161  	// the schedule depending on the current load, so `schedule_time` doesn't
  1162  	// always match this.
  1163  	Schedule string `json:"schedule,omitempty"`
  1164  	// ScheduleTime: Minimum time after which a transfer run can be started.
  1165  	ScheduleTime string `json:"scheduleTime,omitempty"`
  1166  	// StartTime: Output only. Time when transfer run was started. Parameter
  1167  	// ignored by server for input requests.
  1168  	StartTime string `json:"startTime,omitempty"`
  1169  	// State: Data transfer run state. Ignored for input requests.
  1170  	//
  1171  	// Possible values:
  1172  	//   "TRANSFER_STATE_UNSPECIFIED" - State placeholder (0).
  1173  	//   "PENDING" - Data transfer is scheduled and is waiting to be picked up by
  1174  	// data transfer backend (2).
  1175  	//   "RUNNING" - Data transfer is in progress (3).
  1176  	//   "SUCCEEDED" - Data transfer completed successfully (4).
  1177  	//   "FAILED" - Data transfer failed (5).
  1178  	//   "CANCELLED" - Data transfer is cancelled (6).
  1179  	State string `json:"state,omitempty"`
  1180  	// UpdateTime: Output only. Last time the data transfer run state was updated.
  1181  	UpdateTime string `json:"updateTime,omitempty"`
  1182  	// UserId: Deprecated. Unique ID of the user on whose behalf transfer is done.
  1183  	UserId int64 `json:"userId,omitempty,string"`
  1184  
  1185  	// ServerResponse contains the HTTP response code and headers from the server.
  1186  	googleapi.ServerResponse `json:"-"`
  1187  	// ForceSendFields is a list of field names (e.g. "DataSourceId") to
  1188  	// unconditionally include in API requests. By default, fields with empty or
  1189  	// default values are omitted from API requests. See
  1190  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1191  	// details.
  1192  	ForceSendFields []string `json:"-"`
  1193  	// NullFields is a list of field names (e.g. "DataSourceId") to include in API
  1194  	// requests with the JSON null value. By default, fields with empty values are
  1195  	// omitted from API requests. See
  1196  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1197  	NullFields []string `json:"-"`
  1198  }
  1199  
  1200  func (s *TransferRun) MarshalJSON() ([]byte, error) {
  1201  	type NoMethod TransferRun
  1202  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1203  }
  1204  
  1205  // UnenrollDataSourcesRequest: A request to unenroll a set of data sources so
  1206  // they are no longer visible in the BigQuery UI's `Transfer` tab.
  1207  type UnenrollDataSourcesRequest struct {
  1208  	// DataSourceIds: Data sources that are unenrolled. It is required to provide
  1209  	// at least one data source id.
  1210  	DataSourceIds []string `json:"dataSourceIds,omitempty"`
  1211  	// ForceSendFields is a list of field names (e.g. "DataSourceIds") to
  1212  	// unconditionally include in API requests. By default, fields with empty or
  1213  	// default values are omitted from API requests. See
  1214  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1215  	// details.
  1216  	ForceSendFields []string `json:"-"`
  1217  	// NullFields is a list of field names (e.g. "DataSourceIds") to include in API
  1218  	// requests with the JSON null value. By default, fields with empty values are
  1219  	// omitted from API requests. See
  1220  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1221  	NullFields []string `json:"-"`
  1222  }
  1223  
  1224  func (s *UnenrollDataSourcesRequest) MarshalJSON() ([]byte, error) {
  1225  	type NoMethod UnenrollDataSourcesRequest
  1226  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1227  }
  1228  
  1229  // UserInfo: Information about a user.
  1230  type UserInfo struct {
  1231  	// Email: E-mail address of the user.
  1232  	Email string `json:"email,omitempty"`
  1233  	// ForceSendFields is a list of field names (e.g. "Email") to unconditionally
  1234  	// include in API requests. By default, fields with empty or default values are
  1235  	// omitted from API requests. See
  1236  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1237  	// details.
  1238  	ForceSendFields []string `json:"-"`
  1239  	// NullFields is a list of field names (e.g. "Email") to include in API
  1240  	// requests with the JSON null value. By default, fields with empty values are
  1241  	// omitted from API requests. See
  1242  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1243  	NullFields []string `json:"-"`
  1244  }
  1245  
  1246  func (s *UserInfo) MarshalJSON() ([]byte, error) {
  1247  	type NoMethod UserInfo
  1248  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1249  }
  1250  
  1251  type ProjectsEnrollDataSourcesCall struct {
  1252  	s                        *Service
  1253  	name                     string
  1254  	enrolldatasourcesrequest *EnrollDataSourcesRequest
  1255  	urlParams_               gensupport.URLParams
  1256  	ctx_                     context.Context
  1257  	header_                  http.Header
  1258  }
  1259  
  1260  // EnrollDataSources: Enroll data sources in a user project. This allows users
  1261  // to create transfer configurations for these data sources. They will also
  1262  // appear in the ListDataSources RPC and as such, will appear in the BigQuery
  1263  // UI (https://console.cloud.google.com/bigquery), and the documents can be
  1264  // found in the public guide for BigQuery Web UI
  1265  // (https://cloud.google.com/bigquery/bigquery-web-ui) and Data Transfer
  1266  // Service (https://cloud.google.com/bigquery/docs/working-with-transfers).
  1267  //
  1268  //   - name: The name of the project resource in the form:
  1269  //     `projects/{project_id}`.
  1270  func (r *ProjectsService) EnrollDataSources(name string, enrolldatasourcesrequest *EnrollDataSourcesRequest) *ProjectsEnrollDataSourcesCall {
  1271  	c := &ProjectsEnrollDataSourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1272  	c.name = name
  1273  	c.enrolldatasourcesrequest = enrolldatasourcesrequest
  1274  	return c
  1275  }
  1276  
  1277  // Fields allows partial responses to be retrieved. See
  1278  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1279  // details.
  1280  func (c *ProjectsEnrollDataSourcesCall) Fields(s ...googleapi.Field) *ProjectsEnrollDataSourcesCall {
  1281  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1282  	return c
  1283  }
  1284  
  1285  // Context sets the context to be used in this call's Do method.
  1286  func (c *ProjectsEnrollDataSourcesCall) Context(ctx context.Context) *ProjectsEnrollDataSourcesCall {
  1287  	c.ctx_ = ctx
  1288  	return c
  1289  }
  1290  
  1291  // Header returns a http.Header that can be modified by the caller to add
  1292  // headers to the request.
  1293  func (c *ProjectsEnrollDataSourcesCall) Header() http.Header {
  1294  	if c.header_ == nil {
  1295  		c.header_ = make(http.Header)
  1296  	}
  1297  	return c.header_
  1298  }
  1299  
  1300  func (c *ProjectsEnrollDataSourcesCall) doRequest(alt string) (*http.Response, error) {
  1301  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1302  	var body io.Reader = nil
  1303  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.enrolldatasourcesrequest)
  1304  	if err != nil {
  1305  		return nil, err
  1306  	}
  1307  	c.urlParams_.Set("alt", alt)
  1308  	c.urlParams_.Set("prettyPrint", "false")
  1309  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:enrollDataSources")
  1310  	urls += "?" + c.urlParams_.Encode()
  1311  	req, err := http.NewRequest("POST", urls, body)
  1312  	if err != nil {
  1313  		return nil, err
  1314  	}
  1315  	req.Header = reqHeaders
  1316  	googleapi.Expand(req.URL, map[string]string{
  1317  		"name": c.name,
  1318  	})
  1319  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1320  }
  1321  
  1322  // Do executes the "bigquerydatatransfer.projects.enrollDataSources" call.
  1323  // Any non-2xx status code is an error. Response headers are in either
  1324  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  1325  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1326  // whether the returned error was because http.StatusNotModified was returned.
  1327  func (c *ProjectsEnrollDataSourcesCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  1328  	gensupport.SetOptions(c.urlParams_, opts...)
  1329  	res, err := c.doRequest("json")
  1330  	if res != nil && res.StatusCode == http.StatusNotModified {
  1331  		if res.Body != nil {
  1332  			res.Body.Close()
  1333  		}
  1334  		return nil, gensupport.WrapError(&googleapi.Error{
  1335  			Code:   res.StatusCode,
  1336  			Header: res.Header,
  1337  		})
  1338  	}
  1339  	if err != nil {
  1340  		return nil, err
  1341  	}
  1342  	defer googleapi.CloseBody(res)
  1343  	if err := googleapi.CheckResponse(res); err != nil {
  1344  		return nil, gensupport.WrapError(err)
  1345  	}
  1346  	ret := &Empty{
  1347  		ServerResponse: googleapi.ServerResponse{
  1348  			Header:         res.Header,
  1349  			HTTPStatusCode: res.StatusCode,
  1350  		},
  1351  	}
  1352  	target := &ret
  1353  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1354  		return nil, err
  1355  	}
  1356  	return ret, nil
  1357  }
  1358  
  1359  type ProjectsDataSourcesCheckValidCredsCall struct {
  1360  	s                      *Service
  1361  	name                   string
  1362  	checkvalidcredsrequest *CheckValidCredsRequest
  1363  	urlParams_             gensupport.URLParams
  1364  	ctx_                   context.Context
  1365  	header_                http.Header
  1366  }
  1367  
  1368  // CheckValidCreds: Returns true if valid credentials exist for the given data
  1369  // source and requesting user.
  1370  //
  1371  //   - name: The data source in the form:
  1372  //     `projects/{project_id}/dataSources/{data_source_id}` or
  1373  //     `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}
  1374  //     `.
  1375  func (r *ProjectsDataSourcesService) CheckValidCreds(name string, checkvalidcredsrequest *CheckValidCredsRequest) *ProjectsDataSourcesCheckValidCredsCall {
  1376  	c := &ProjectsDataSourcesCheckValidCredsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1377  	c.name = name
  1378  	c.checkvalidcredsrequest = checkvalidcredsrequest
  1379  	return c
  1380  }
  1381  
  1382  // Fields allows partial responses to be retrieved. See
  1383  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1384  // details.
  1385  func (c *ProjectsDataSourcesCheckValidCredsCall) Fields(s ...googleapi.Field) *ProjectsDataSourcesCheckValidCredsCall {
  1386  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1387  	return c
  1388  }
  1389  
  1390  // Context sets the context to be used in this call's Do method.
  1391  func (c *ProjectsDataSourcesCheckValidCredsCall) Context(ctx context.Context) *ProjectsDataSourcesCheckValidCredsCall {
  1392  	c.ctx_ = ctx
  1393  	return c
  1394  }
  1395  
  1396  // Header returns a http.Header that can be modified by the caller to add
  1397  // headers to the request.
  1398  func (c *ProjectsDataSourcesCheckValidCredsCall) Header() http.Header {
  1399  	if c.header_ == nil {
  1400  		c.header_ = make(http.Header)
  1401  	}
  1402  	return c.header_
  1403  }
  1404  
  1405  func (c *ProjectsDataSourcesCheckValidCredsCall) doRequest(alt string) (*http.Response, error) {
  1406  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1407  	var body io.Reader = nil
  1408  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.checkvalidcredsrequest)
  1409  	if err != nil {
  1410  		return nil, err
  1411  	}
  1412  	c.urlParams_.Set("alt", alt)
  1413  	c.urlParams_.Set("prettyPrint", "false")
  1414  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:checkValidCreds")
  1415  	urls += "?" + c.urlParams_.Encode()
  1416  	req, err := http.NewRequest("POST", urls, body)
  1417  	if err != nil {
  1418  		return nil, err
  1419  	}
  1420  	req.Header = reqHeaders
  1421  	googleapi.Expand(req.URL, map[string]string{
  1422  		"name": c.name,
  1423  	})
  1424  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1425  }
  1426  
  1427  // Do executes the "bigquerydatatransfer.projects.dataSources.checkValidCreds" call.
  1428  // Any non-2xx status code is an error. Response headers are in either
  1429  // *CheckValidCredsResponse.ServerResponse.Header or (if a response was
  1430  // returned at all) in error.(*googleapi.Error).Header. Use
  1431  // googleapi.IsNotModified to check whether the returned error was because
  1432  // http.StatusNotModified was returned.
  1433  func (c *ProjectsDataSourcesCheckValidCredsCall) Do(opts ...googleapi.CallOption) (*CheckValidCredsResponse, error) {
  1434  	gensupport.SetOptions(c.urlParams_, opts...)
  1435  	res, err := c.doRequest("json")
  1436  	if res != nil && res.StatusCode == http.StatusNotModified {
  1437  		if res.Body != nil {
  1438  			res.Body.Close()
  1439  		}
  1440  		return nil, gensupport.WrapError(&googleapi.Error{
  1441  			Code:   res.StatusCode,
  1442  			Header: res.Header,
  1443  		})
  1444  	}
  1445  	if err != nil {
  1446  		return nil, err
  1447  	}
  1448  	defer googleapi.CloseBody(res)
  1449  	if err := googleapi.CheckResponse(res); err != nil {
  1450  		return nil, gensupport.WrapError(err)
  1451  	}
  1452  	ret := &CheckValidCredsResponse{
  1453  		ServerResponse: googleapi.ServerResponse{
  1454  			Header:         res.Header,
  1455  			HTTPStatusCode: res.StatusCode,
  1456  		},
  1457  	}
  1458  	target := &ret
  1459  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1460  		return nil, err
  1461  	}
  1462  	return ret, nil
  1463  }
  1464  
  1465  type ProjectsDataSourcesGetCall struct {
  1466  	s            *Service
  1467  	name         string
  1468  	urlParams_   gensupport.URLParams
  1469  	ifNoneMatch_ string
  1470  	ctx_         context.Context
  1471  	header_      http.Header
  1472  }
  1473  
  1474  // Get: Retrieves a supported data source and returns its settings.
  1475  //
  1476  //   - name: The field will contain name of the resource requested, for example:
  1477  //     `projects/{project_id}/dataSources/{data_source_id}` or
  1478  //     `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}
  1479  //     `.
  1480  func (r *ProjectsDataSourcesService) Get(name string) *ProjectsDataSourcesGetCall {
  1481  	c := &ProjectsDataSourcesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1482  	c.name = name
  1483  	return c
  1484  }
  1485  
  1486  // Fields allows partial responses to be retrieved. See
  1487  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1488  // details.
  1489  func (c *ProjectsDataSourcesGetCall) Fields(s ...googleapi.Field) *ProjectsDataSourcesGetCall {
  1490  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1491  	return c
  1492  }
  1493  
  1494  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1495  // object's ETag matches the given value. This is useful for getting updates
  1496  // only after the object has changed since the last request.
  1497  func (c *ProjectsDataSourcesGetCall) IfNoneMatch(entityTag string) *ProjectsDataSourcesGetCall {
  1498  	c.ifNoneMatch_ = entityTag
  1499  	return c
  1500  }
  1501  
  1502  // Context sets the context to be used in this call's Do method.
  1503  func (c *ProjectsDataSourcesGetCall) Context(ctx context.Context) *ProjectsDataSourcesGetCall {
  1504  	c.ctx_ = ctx
  1505  	return c
  1506  }
  1507  
  1508  // Header returns a http.Header that can be modified by the caller to add
  1509  // headers to the request.
  1510  func (c *ProjectsDataSourcesGetCall) Header() http.Header {
  1511  	if c.header_ == nil {
  1512  		c.header_ = make(http.Header)
  1513  	}
  1514  	return c.header_
  1515  }
  1516  
  1517  func (c *ProjectsDataSourcesGetCall) doRequest(alt string) (*http.Response, error) {
  1518  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1519  	if c.ifNoneMatch_ != "" {
  1520  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1521  	}
  1522  	var body io.Reader = nil
  1523  	c.urlParams_.Set("alt", alt)
  1524  	c.urlParams_.Set("prettyPrint", "false")
  1525  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  1526  	urls += "?" + c.urlParams_.Encode()
  1527  	req, err := http.NewRequest("GET", urls, body)
  1528  	if err != nil {
  1529  		return nil, err
  1530  	}
  1531  	req.Header = reqHeaders
  1532  	googleapi.Expand(req.URL, map[string]string{
  1533  		"name": c.name,
  1534  	})
  1535  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1536  }
  1537  
  1538  // Do executes the "bigquerydatatransfer.projects.dataSources.get" call.
  1539  // Any non-2xx status code is an error. Response headers are in either
  1540  // *DataSource.ServerResponse.Header or (if a response was returned at all) in
  1541  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1542  // whether the returned error was because http.StatusNotModified was returned.
  1543  func (c *ProjectsDataSourcesGetCall) Do(opts ...googleapi.CallOption) (*DataSource, error) {
  1544  	gensupport.SetOptions(c.urlParams_, opts...)
  1545  	res, err := c.doRequest("json")
  1546  	if res != nil && res.StatusCode == http.StatusNotModified {
  1547  		if res.Body != nil {
  1548  			res.Body.Close()
  1549  		}
  1550  		return nil, gensupport.WrapError(&googleapi.Error{
  1551  			Code:   res.StatusCode,
  1552  			Header: res.Header,
  1553  		})
  1554  	}
  1555  	if err != nil {
  1556  		return nil, err
  1557  	}
  1558  	defer googleapi.CloseBody(res)
  1559  	if err := googleapi.CheckResponse(res); err != nil {
  1560  		return nil, gensupport.WrapError(err)
  1561  	}
  1562  	ret := &DataSource{
  1563  		ServerResponse: googleapi.ServerResponse{
  1564  			Header:         res.Header,
  1565  			HTTPStatusCode: res.StatusCode,
  1566  		},
  1567  	}
  1568  	target := &ret
  1569  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1570  		return nil, err
  1571  	}
  1572  	return ret, nil
  1573  }
  1574  
  1575  type ProjectsDataSourcesListCall struct {
  1576  	s            *Service
  1577  	parent       string
  1578  	urlParams_   gensupport.URLParams
  1579  	ifNoneMatch_ string
  1580  	ctx_         context.Context
  1581  	header_      http.Header
  1582  }
  1583  
  1584  // List: Lists supported data sources and returns their settings.
  1585  //
  1586  //   - parent: The BigQuery project id for which data sources should be returned.
  1587  //     Must be in the form: `projects/{project_id}` or
  1588  //     `projects/{project_id}/locations/{location_id}`.
  1589  func (r *ProjectsDataSourcesService) List(parent string) *ProjectsDataSourcesListCall {
  1590  	c := &ProjectsDataSourcesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1591  	c.parent = parent
  1592  	return c
  1593  }
  1594  
  1595  // PageSize sets the optional parameter "pageSize": Page size. The default page
  1596  // size is the maximum value of 1000 results.
  1597  func (c *ProjectsDataSourcesListCall) PageSize(pageSize int64) *ProjectsDataSourcesListCall {
  1598  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1599  	return c
  1600  }
  1601  
  1602  // PageToken sets the optional parameter "pageToken": Pagination token, which
  1603  // can be used to request a specific page of `ListDataSourcesRequest` list
  1604  // results. For multiple-page results, `ListDataSourcesResponse` outputs a
  1605  // `next_page` token, which can be used as the `page_token` value to request
  1606  // the next page of list results.
  1607  func (c *ProjectsDataSourcesListCall) PageToken(pageToken string) *ProjectsDataSourcesListCall {
  1608  	c.urlParams_.Set("pageToken", pageToken)
  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 *ProjectsDataSourcesListCall) Fields(s ...googleapi.Field) *ProjectsDataSourcesListCall {
  1616  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1617  	return c
  1618  }
  1619  
  1620  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1621  // object's ETag matches the given value. This is useful for getting updates
  1622  // only after the object has changed since the last request.
  1623  func (c *ProjectsDataSourcesListCall) IfNoneMatch(entityTag string) *ProjectsDataSourcesListCall {
  1624  	c.ifNoneMatch_ = entityTag
  1625  	return c
  1626  }
  1627  
  1628  // Context sets the context to be used in this call's Do method.
  1629  func (c *ProjectsDataSourcesListCall) Context(ctx context.Context) *ProjectsDataSourcesListCall {
  1630  	c.ctx_ = ctx
  1631  	return c
  1632  }
  1633  
  1634  // Header returns a http.Header that can be modified by the caller to add
  1635  // headers to the request.
  1636  func (c *ProjectsDataSourcesListCall) Header() http.Header {
  1637  	if c.header_ == nil {
  1638  		c.header_ = make(http.Header)
  1639  	}
  1640  	return c.header_
  1641  }
  1642  
  1643  func (c *ProjectsDataSourcesListCall) doRequest(alt string) (*http.Response, error) {
  1644  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1645  	if c.ifNoneMatch_ != "" {
  1646  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1647  	}
  1648  	var body io.Reader = nil
  1649  	c.urlParams_.Set("alt", alt)
  1650  	c.urlParams_.Set("prettyPrint", "false")
  1651  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dataSources")
  1652  	urls += "?" + c.urlParams_.Encode()
  1653  	req, err := http.NewRequest("GET", urls, body)
  1654  	if err != nil {
  1655  		return nil, err
  1656  	}
  1657  	req.Header = reqHeaders
  1658  	googleapi.Expand(req.URL, map[string]string{
  1659  		"parent": c.parent,
  1660  	})
  1661  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1662  }
  1663  
  1664  // Do executes the "bigquerydatatransfer.projects.dataSources.list" call.
  1665  // Any non-2xx status code is an error. Response headers are in either
  1666  // *ListDataSourcesResponse.ServerResponse.Header or (if a response was
  1667  // returned at all) in error.(*googleapi.Error).Header. Use
  1668  // googleapi.IsNotModified to check whether the returned error was because
  1669  // http.StatusNotModified was returned.
  1670  func (c *ProjectsDataSourcesListCall) Do(opts ...googleapi.CallOption) (*ListDataSourcesResponse, error) {
  1671  	gensupport.SetOptions(c.urlParams_, opts...)
  1672  	res, err := c.doRequest("json")
  1673  	if res != nil && res.StatusCode == http.StatusNotModified {
  1674  		if res.Body != nil {
  1675  			res.Body.Close()
  1676  		}
  1677  		return nil, gensupport.WrapError(&googleapi.Error{
  1678  			Code:   res.StatusCode,
  1679  			Header: res.Header,
  1680  		})
  1681  	}
  1682  	if err != nil {
  1683  		return nil, err
  1684  	}
  1685  	defer googleapi.CloseBody(res)
  1686  	if err := googleapi.CheckResponse(res); err != nil {
  1687  		return nil, gensupport.WrapError(err)
  1688  	}
  1689  	ret := &ListDataSourcesResponse{
  1690  		ServerResponse: googleapi.ServerResponse{
  1691  			Header:         res.Header,
  1692  			HTTPStatusCode: res.StatusCode,
  1693  		},
  1694  	}
  1695  	target := &ret
  1696  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1697  		return nil, err
  1698  	}
  1699  	return ret, nil
  1700  }
  1701  
  1702  // Pages invokes f for each page of results.
  1703  // A non-nil error returned from f will halt the iteration.
  1704  // The provided context supersedes any context provided to the Context method.
  1705  func (c *ProjectsDataSourcesListCall) Pages(ctx context.Context, f func(*ListDataSourcesResponse) error) error {
  1706  	c.ctx_ = ctx
  1707  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1708  	for {
  1709  		x, err := c.Do()
  1710  		if err != nil {
  1711  			return err
  1712  		}
  1713  		if err := f(x); err != nil {
  1714  			return err
  1715  		}
  1716  		if x.NextPageToken == "" {
  1717  			return nil
  1718  		}
  1719  		c.PageToken(x.NextPageToken)
  1720  	}
  1721  }
  1722  
  1723  type ProjectsLocationsEnrollDataSourcesCall struct {
  1724  	s                        *Service
  1725  	name                     string
  1726  	enrolldatasourcesrequest *EnrollDataSourcesRequest
  1727  	urlParams_               gensupport.URLParams
  1728  	ctx_                     context.Context
  1729  	header_                  http.Header
  1730  }
  1731  
  1732  // EnrollDataSources: Enroll data sources in a user project. This allows users
  1733  // to create transfer configurations for these data sources. They will also
  1734  // appear in the ListDataSources RPC and as such, will appear in the BigQuery
  1735  // UI (https://console.cloud.google.com/bigquery), and the documents can be
  1736  // found in the public guide for BigQuery Web UI
  1737  // (https://cloud.google.com/bigquery/bigquery-web-ui) and Data Transfer
  1738  // Service (https://cloud.google.com/bigquery/docs/working-with-transfers).
  1739  //
  1740  //   - name: The name of the project resource in the form:
  1741  //     `projects/{project_id}`.
  1742  func (r *ProjectsLocationsService) EnrollDataSources(name string, enrolldatasourcesrequest *EnrollDataSourcesRequest) *ProjectsLocationsEnrollDataSourcesCall {
  1743  	c := &ProjectsLocationsEnrollDataSourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1744  	c.name = name
  1745  	c.enrolldatasourcesrequest = enrolldatasourcesrequest
  1746  	return c
  1747  }
  1748  
  1749  // Fields allows partial responses to be retrieved. See
  1750  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1751  // details.
  1752  func (c *ProjectsLocationsEnrollDataSourcesCall) Fields(s ...googleapi.Field) *ProjectsLocationsEnrollDataSourcesCall {
  1753  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1754  	return c
  1755  }
  1756  
  1757  // Context sets the context to be used in this call's Do method.
  1758  func (c *ProjectsLocationsEnrollDataSourcesCall) Context(ctx context.Context) *ProjectsLocationsEnrollDataSourcesCall {
  1759  	c.ctx_ = ctx
  1760  	return c
  1761  }
  1762  
  1763  // Header returns a http.Header that can be modified by the caller to add
  1764  // headers to the request.
  1765  func (c *ProjectsLocationsEnrollDataSourcesCall) Header() http.Header {
  1766  	if c.header_ == nil {
  1767  		c.header_ = make(http.Header)
  1768  	}
  1769  	return c.header_
  1770  }
  1771  
  1772  func (c *ProjectsLocationsEnrollDataSourcesCall) doRequest(alt string) (*http.Response, error) {
  1773  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1774  	var body io.Reader = nil
  1775  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.enrolldatasourcesrequest)
  1776  	if err != nil {
  1777  		return nil, err
  1778  	}
  1779  	c.urlParams_.Set("alt", alt)
  1780  	c.urlParams_.Set("prettyPrint", "false")
  1781  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:enrollDataSources")
  1782  	urls += "?" + c.urlParams_.Encode()
  1783  	req, err := http.NewRequest("POST", urls, body)
  1784  	if err != nil {
  1785  		return nil, err
  1786  	}
  1787  	req.Header = reqHeaders
  1788  	googleapi.Expand(req.URL, map[string]string{
  1789  		"name": c.name,
  1790  	})
  1791  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1792  }
  1793  
  1794  // Do executes the "bigquerydatatransfer.projects.locations.enrollDataSources" call.
  1795  // Any non-2xx status code is an error. Response headers are in either
  1796  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  1797  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1798  // whether the returned error was because http.StatusNotModified was returned.
  1799  func (c *ProjectsLocationsEnrollDataSourcesCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  1800  	gensupport.SetOptions(c.urlParams_, opts...)
  1801  	res, err := c.doRequest("json")
  1802  	if res != nil && res.StatusCode == http.StatusNotModified {
  1803  		if res.Body != nil {
  1804  			res.Body.Close()
  1805  		}
  1806  		return nil, gensupport.WrapError(&googleapi.Error{
  1807  			Code:   res.StatusCode,
  1808  			Header: res.Header,
  1809  		})
  1810  	}
  1811  	if err != nil {
  1812  		return nil, err
  1813  	}
  1814  	defer googleapi.CloseBody(res)
  1815  	if err := googleapi.CheckResponse(res); err != nil {
  1816  		return nil, gensupport.WrapError(err)
  1817  	}
  1818  	ret := &Empty{
  1819  		ServerResponse: googleapi.ServerResponse{
  1820  			Header:         res.Header,
  1821  			HTTPStatusCode: res.StatusCode,
  1822  		},
  1823  	}
  1824  	target := &ret
  1825  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1826  		return nil, err
  1827  	}
  1828  	return ret, nil
  1829  }
  1830  
  1831  type ProjectsLocationsGetCall struct {
  1832  	s            *Service
  1833  	name         string
  1834  	urlParams_   gensupport.URLParams
  1835  	ifNoneMatch_ string
  1836  	ctx_         context.Context
  1837  	header_      http.Header
  1838  }
  1839  
  1840  // Get: Gets information about a location.
  1841  //
  1842  // - name: Resource name for the location.
  1843  func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
  1844  	c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1845  	c.name = name
  1846  	return c
  1847  }
  1848  
  1849  // Fields allows partial responses to be retrieved. See
  1850  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1851  // details.
  1852  func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
  1853  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1854  	return c
  1855  }
  1856  
  1857  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1858  // object's ETag matches the given value. This is useful for getting updates
  1859  // only after the object has changed since the last request.
  1860  func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
  1861  	c.ifNoneMatch_ = entityTag
  1862  	return c
  1863  }
  1864  
  1865  // Context sets the context to be used in this call's Do method.
  1866  func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
  1867  	c.ctx_ = ctx
  1868  	return c
  1869  }
  1870  
  1871  // Header returns a http.Header that can be modified by the caller to add
  1872  // headers to the request.
  1873  func (c *ProjectsLocationsGetCall) Header() http.Header {
  1874  	if c.header_ == nil {
  1875  		c.header_ = make(http.Header)
  1876  	}
  1877  	return c.header_
  1878  }
  1879  
  1880  func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
  1881  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1882  	if c.ifNoneMatch_ != "" {
  1883  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1884  	}
  1885  	var body io.Reader = nil
  1886  	c.urlParams_.Set("alt", alt)
  1887  	c.urlParams_.Set("prettyPrint", "false")
  1888  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  1889  	urls += "?" + c.urlParams_.Encode()
  1890  	req, err := http.NewRequest("GET", urls, body)
  1891  	if err != nil {
  1892  		return nil, err
  1893  	}
  1894  	req.Header = reqHeaders
  1895  	googleapi.Expand(req.URL, map[string]string{
  1896  		"name": c.name,
  1897  	})
  1898  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1899  }
  1900  
  1901  // Do executes the "bigquerydatatransfer.projects.locations.get" call.
  1902  // Any non-2xx status code is an error. Response headers are in either
  1903  // *Location.ServerResponse.Header or (if a response was returned at all) in
  1904  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1905  // whether the returned error was because http.StatusNotModified was returned.
  1906  func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
  1907  	gensupport.SetOptions(c.urlParams_, opts...)
  1908  	res, err := c.doRequest("json")
  1909  	if res != nil && res.StatusCode == http.StatusNotModified {
  1910  		if res.Body != nil {
  1911  			res.Body.Close()
  1912  		}
  1913  		return nil, gensupport.WrapError(&googleapi.Error{
  1914  			Code:   res.StatusCode,
  1915  			Header: res.Header,
  1916  		})
  1917  	}
  1918  	if err != nil {
  1919  		return nil, err
  1920  	}
  1921  	defer googleapi.CloseBody(res)
  1922  	if err := googleapi.CheckResponse(res); err != nil {
  1923  		return nil, gensupport.WrapError(err)
  1924  	}
  1925  	ret := &Location{
  1926  		ServerResponse: googleapi.ServerResponse{
  1927  			Header:         res.Header,
  1928  			HTTPStatusCode: res.StatusCode,
  1929  		},
  1930  	}
  1931  	target := &ret
  1932  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1933  		return nil, err
  1934  	}
  1935  	return ret, nil
  1936  }
  1937  
  1938  type ProjectsLocationsListCall struct {
  1939  	s            *Service
  1940  	name         string
  1941  	urlParams_   gensupport.URLParams
  1942  	ifNoneMatch_ string
  1943  	ctx_         context.Context
  1944  	header_      http.Header
  1945  }
  1946  
  1947  // List: Lists information about the supported locations for this service.
  1948  //
  1949  // - name: The resource that owns the locations collection, if applicable.
  1950  func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
  1951  	c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1952  	c.name = name
  1953  	return c
  1954  }
  1955  
  1956  // Filter sets the optional parameter "filter": A filter to narrow down results
  1957  // to a preferred subset. The filtering language accepts strings like
  1958  // "displayName=tokyo", and is documented in more detail in AIP-160
  1959  // (https://google.aip.dev/160).
  1960  func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
  1961  	c.urlParams_.Set("filter", filter)
  1962  	return c
  1963  }
  1964  
  1965  // PageSize sets the optional parameter "pageSize": The maximum number of
  1966  // results to return. If not set, the service selects a default.
  1967  func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
  1968  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1969  	return c
  1970  }
  1971  
  1972  // PageToken sets the optional parameter "pageToken": A page token received
  1973  // from the `next_page_token` field in the response. Send that page token to
  1974  // receive the subsequent page.
  1975  func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
  1976  	c.urlParams_.Set("pageToken", pageToken)
  1977  	return c
  1978  }
  1979  
  1980  // Fields allows partial responses to be retrieved. See
  1981  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1982  // details.
  1983  func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
  1984  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1985  	return c
  1986  }
  1987  
  1988  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1989  // object's ETag matches the given value. This is useful for getting updates
  1990  // only after the object has changed since the last request.
  1991  func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
  1992  	c.ifNoneMatch_ = entityTag
  1993  	return c
  1994  }
  1995  
  1996  // Context sets the context to be used in this call's Do method.
  1997  func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
  1998  	c.ctx_ = ctx
  1999  	return c
  2000  }
  2001  
  2002  // Header returns a http.Header that can be modified by the caller to add
  2003  // headers to the request.
  2004  func (c *ProjectsLocationsListCall) Header() http.Header {
  2005  	if c.header_ == nil {
  2006  		c.header_ = make(http.Header)
  2007  	}
  2008  	return c.header_
  2009  }
  2010  
  2011  func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
  2012  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2013  	if c.ifNoneMatch_ != "" {
  2014  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2015  	}
  2016  	var body io.Reader = nil
  2017  	c.urlParams_.Set("alt", alt)
  2018  	c.urlParams_.Set("prettyPrint", "false")
  2019  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations")
  2020  	urls += "?" + c.urlParams_.Encode()
  2021  	req, err := http.NewRequest("GET", urls, body)
  2022  	if err != nil {
  2023  		return nil, err
  2024  	}
  2025  	req.Header = reqHeaders
  2026  	googleapi.Expand(req.URL, map[string]string{
  2027  		"name": c.name,
  2028  	})
  2029  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2030  }
  2031  
  2032  // Do executes the "bigquerydatatransfer.projects.locations.list" call.
  2033  // Any non-2xx status code is an error. Response headers are in either
  2034  // *ListLocationsResponse.ServerResponse.Header or (if a response was returned
  2035  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2036  // check whether the returned error was because http.StatusNotModified was
  2037  // returned.
  2038  func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
  2039  	gensupport.SetOptions(c.urlParams_, opts...)
  2040  	res, err := c.doRequest("json")
  2041  	if res != nil && res.StatusCode == http.StatusNotModified {
  2042  		if res.Body != nil {
  2043  			res.Body.Close()
  2044  		}
  2045  		return nil, gensupport.WrapError(&googleapi.Error{
  2046  			Code:   res.StatusCode,
  2047  			Header: res.Header,
  2048  		})
  2049  	}
  2050  	if err != nil {
  2051  		return nil, err
  2052  	}
  2053  	defer googleapi.CloseBody(res)
  2054  	if err := googleapi.CheckResponse(res); err != nil {
  2055  		return nil, gensupport.WrapError(err)
  2056  	}
  2057  	ret := &ListLocationsResponse{
  2058  		ServerResponse: googleapi.ServerResponse{
  2059  			Header:         res.Header,
  2060  			HTTPStatusCode: res.StatusCode,
  2061  		},
  2062  	}
  2063  	target := &ret
  2064  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2065  		return nil, err
  2066  	}
  2067  	return ret, nil
  2068  }
  2069  
  2070  // Pages invokes f for each page of results.
  2071  // A non-nil error returned from f will halt the iteration.
  2072  // The provided context supersedes any context provided to the Context method.
  2073  func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
  2074  	c.ctx_ = ctx
  2075  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  2076  	for {
  2077  		x, err := c.Do()
  2078  		if err != nil {
  2079  			return err
  2080  		}
  2081  		if err := f(x); err != nil {
  2082  			return err
  2083  		}
  2084  		if x.NextPageToken == "" {
  2085  			return nil
  2086  		}
  2087  		c.PageToken(x.NextPageToken)
  2088  	}
  2089  }
  2090  
  2091  type ProjectsLocationsUnenrollDataSourcesCall struct {
  2092  	s                          *Service
  2093  	name                       string
  2094  	unenrolldatasourcesrequest *UnenrollDataSourcesRequest
  2095  	urlParams_                 gensupport.URLParams
  2096  	ctx_                       context.Context
  2097  	header_                    http.Header
  2098  }
  2099  
  2100  // UnenrollDataSources: Unenroll data sources in a user project. This allows
  2101  // users to remove transfer configurations for these data sources. They will no
  2102  // longer appear in the ListDataSources RPC and will also no longer appear in
  2103  // the BigQuery UI (https://console.cloud.google.com/bigquery). Data transfers
  2104  // configurations of unenrolled data sources will not be scheduled.
  2105  //
  2106  //   - name: The name of the project resource in the form:
  2107  //     `projects/{project_id}`.
  2108  func (r *ProjectsLocationsService) UnenrollDataSources(name string, unenrolldatasourcesrequest *UnenrollDataSourcesRequest) *ProjectsLocationsUnenrollDataSourcesCall {
  2109  	c := &ProjectsLocationsUnenrollDataSourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2110  	c.name = name
  2111  	c.unenrolldatasourcesrequest = unenrolldatasourcesrequest
  2112  	return c
  2113  }
  2114  
  2115  // Fields allows partial responses to be retrieved. See
  2116  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2117  // details.
  2118  func (c *ProjectsLocationsUnenrollDataSourcesCall) Fields(s ...googleapi.Field) *ProjectsLocationsUnenrollDataSourcesCall {
  2119  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2120  	return c
  2121  }
  2122  
  2123  // Context sets the context to be used in this call's Do method.
  2124  func (c *ProjectsLocationsUnenrollDataSourcesCall) Context(ctx context.Context) *ProjectsLocationsUnenrollDataSourcesCall {
  2125  	c.ctx_ = ctx
  2126  	return c
  2127  }
  2128  
  2129  // Header returns a http.Header that can be modified by the caller to add
  2130  // headers to the request.
  2131  func (c *ProjectsLocationsUnenrollDataSourcesCall) Header() http.Header {
  2132  	if c.header_ == nil {
  2133  		c.header_ = make(http.Header)
  2134  	}
  2135  	return c.header_
  2136  }
  2137  
  2138  func (c *ProjectsLocationsUnenrollDataSourcesCall) doRequest(alt string) (*http.Response, error) {
  2139  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2140  	var body io.Reader = nil
  2141  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.unenrolldatasourcesrequest)
  2142  	if err != nil {
  2143  		return nil, err
  2144  	}
  2145  	c.urlParams_.Set("alt", alt)
  2146  	c.urlParams_.Set("prettyPrint", "false")
  2147  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:unenrollDataSources")
  2148  	urls += "?" + c.urlParams_.Encode()
  2149  	req, err := http.NewRequest("POST", urls, body)
  2150  	if err != nil {
  2151  		return nil, err
  2152  	}
  2153  	req.Header = reqHeaders
  2154  	googleapi.Expand(req.URL, map[string]string{
  2155  		"name": c.name,
  2156  	})
  2157  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2158  }
  2159  
  2160  // Do executes the "bigquerydatatransfer.projects.locations.unenrollDataSources" call.
  2161  // Any non-2xx status code is an error. Response headers are in either
  2162  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  2163  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2164  // whether the returned error was because http.StatusNotModified was returned.
  2165  func (c *ProjectsLocationsUnenrollDataSourcesCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2166  	gensupport.SetOptions(c.urlParams_, opts...)
  2167  	res, err := c.doRequest("json")
  2168  	if res != nil && res.StatusCode == http.StatusNotModified {
  2169  		if res.Body != nil {
  2170  			res.Body.Close()
  2171  		}
  2172  		return nil, gensupport.WrapError(&googleapi.Error{
  2173  			Code:   res.StatusCode,
  2174  			Header: res.Header,
  2175  		})
  2176  	}
  2177  	if err != nil {
  2178  		return nil, err
  2179  	}
  2180  	defer googleapi.CloseBody(res)
  2181  	if err := googleapi.CheckResponse(res); err != nil {
  2182  		return nil, gensupport.WrapError(err)
  2183  	}
  2184  	ret := &Empty{
  2185  		ServerResponse: googleapi.ServerResponse{
  2186  			Header:         res.Header,
  2187  			HTTPStatusCode: res.StatusCode,
  2188  		},
  2189  	}
  2190  	target := &ret
  2191  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2192  		return nil, err
  2193  	}
  2194  	return ret, nil
  2195  }
  2196  
  2197  type ProjectsLocationsDataSourcesCheckValidCredsCall struct {
  2198  	s                      *Service
  2199  	name                   string
  2200  	checkvalidcredsrequest *CheckValidCredsRequest
  2201  	urlParams_             gensupport.URLParams
  2202  	ctx_                   context.Context
  2203  	header_                http.Header
  2204  }
  2205  
  2206  // CheckValidCreds: Returns true if valid credentials exist for the given data
  2207  // source and requesting user.
  2208  //
  2209  //   - name: The data source in the form:
  2210  //     `projects/{project_id}/dataSources/{data_source_id}` or
  2211  //     `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}
  2212  //     `.
  2213  func (r *ProjectsLocationsDataSourcesService) CheckValidCreds(name string, checkvalidcredsrequest *CheckValidCredsRequest) *ProjectsLocationsDataSourcesCheckValidCredsCall {
  2214  	c := &ProjectsLocationsDataSourcesCheckValidCredsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2215  	c.name = name
  2216  	c.checkvalidcredsrequest = checkvalidcredsrequest
  2217  	return c
  2218  }
  2219  
  2220  // Fields allows partial responses to be retrieved. See
  2221  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2222  // details.
  2223  func (c *ProjectsLocationsDataSourcesCheckValidCredsCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataSourcesCheckValidCredsCall {
  2224  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2225  	return c
  2226  }
  2227  
  2228  // Context sets the context to be used in this call's Do method.
  2229  func (c *ProjectsLocationsDataSourcesCheckValidCredsCall) Context(ctx context.Context) *ProjectsLocationsDataSourcesCheckValidCredsCall {
  2230  	c.ctx_ = ctx
  2231  	return c
  2232  }
  2233  
  2234  // Header returns a http.Header that can be modified by the caller to add
  2235  // headers to the request.
  2236  func (c *ProjectsLocationsDataSourcesCheckValidCredsCall) Header() http.Header {
  2237  	if c.header_ == nil {
  2238  		c.header_ = make(http.Header)
  2239  	}
  2240  	return c.header_
  2241  }
  2242  
  2243  func (c *ProjectsLocationsDataSourcesCheckValidCredsCall) doRequest(alt string) (*http.Response, error) {
  2244  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2245  	var body io.Reader = nil
  2246  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.checkvalidcredsrequest)
  2247  	if err != nil {
  2248  		return nil, err
  2249  	}
  2250  	c.urlParams_.Set("alt", alt)
  2251  	c.urlParams_.Set("prettyPrint", "false")
  2252  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:checkValidCreds")
  2253  	urls += "?" + c.urlParams_.Encode()
  2254  	req, err := http.NewRequest("POST", urls, body)
  2255  	if err != nil {
  2256  		return nil, err
  2257  	}
  2258  	req.Header = reqHeaders
  2259  	googleapi.Expand(req.URL, map[string]string{
  2260  		"name": c.name,
  2261  	})
  2262  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2263  }
  2264  
  2265  // Do executes the "bigquerydatatransfer.projects.locations.dataSources.checkValidCreds" call.
  2266  // Any non-2xx status code is an error. Response headers are in either
  2267  // *CheckValidCredsResponse.ServerResponse.Header or (if a response was
  2268  // returned at all) in error.(*googleapi.Error).Header. Use
  2269  // googleapi.IsNotModified to check whether the returned error was because
  2270  // http.StatusNotModified was returned.
  2271  func (c *ProjectsLocationsDataSourcesCheckValidCredsCall) Do(opts ...googleapi.CallOption) (*CheckValidCredsResponse, error) {
  2272  	gensupport.SetOptions(c.urlParams_, opts...)
  2273  	res, err := c.doRequest("json")
  2274  	if res != nil && res.StatusCode == http.StatusNotModified {
  2275  		if res.Body != nil {
  2276  			res.Body.Close()
  2277  		}
  2278  		return nil, gensupport.WrapError(&googleapi.Error{
  2279  			Code:   res.StatusCode,
  2280  			Header: res.Header,
  2281  		})
  2282  	}
  2283  	if err != nil {
  2284  		return nil, err
  2285  	}
  2286  	defer googleapi.CloseBody(res)
  2287  	if err := googleapi.CheckResponse(res); err != nil {
  2288  		return nil, gensupport.WrapError(err)
  2289  	}
  2290  	ret := &CheckValidCredsResponse{
  2291  		ServerResponse: googleapi.ServerResponse{
  2292  			Header:         res.Header,
  2293  			HTTPStatusCode: res.StatusCode,
  2294  		},
  2295  	}
  2296  	target := &ret
  2297  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2298  		return nil, err
  2299  	}
  2300  	return ret, nil
  2301  }
  2302  
  2303  type ProjectsLocationsDataSourcesGetCall struct {
  2304  	s            *Service
  2305  	name         string
  2306  	urlParams_   gensupport.URLParams
  2307  	ifNoneMatch_ string
  2308  	ctx_         context.Context
  2309  	header_      http.Header
  2310  }
  2311  
  2312  // Get: Retrieves a supported data source and returns its settings.
  2313  //
  2314  //   - name: The field will contain name of the resource requested, for example:
  2315  //     `projects/{project_id}/dataSources/{data_source_id}` or
  2316  //     `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}
  2317  //     `.
  2318  func (r *ProjectsLocationsDataSourcesService) Get(name string) *ProjectsLocationsDataSourcesGetCall {
  2319  	c := &ProjectsLocationsDataSourcesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2320  	c.name = name
  2321  	return c
  2322  }
  2323  
  2324  // Fields allows partial responses to be retrieved. See
  2325  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2326  // details.
  2327  func (c *ProjectsLocationsDataSourcesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataSourcesGetCall {
  2328  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2329  	return c
  2330  }
  2331  
  2332  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2333  // object's ETag matches the given value. This is useful for getting updates
  2334  // only after the object has changed since the last request.
  2335  func (c *ProjectsLocationsDataSourcesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataSourcesGetCall {
  2336  	c.ifNoneMatch_ = entityTag
  2337  	return c
  2338  }
  2339  
  2340  // Context sets the context to be used in this call's Do method.
  2341  func (c *ProjectsLocationsDataSourcesGetCall) Context(ctx context.Context) *ProjectsLocationsDataSourcesGetCall {
  2342  	c.ctx_ = ctx
  2343  	return c
  2344  }
  2345  
  2346  // Header returns a http.Header that can be modified by the caller to add
  2347  // headers to the request.
  2348  func (c *ProjectsLocationsDataSourcesGetCall) Header() http.Header {
  2349  	if c.header_ == nil {
  2350  		c.header_ = make(http.Header)
  2351  	}
  2352  	return c.header_
  2353  }
  2354  
  2355  func (c *ProjectsLocationsDataSourcesGetCall) doRequest(alt string) (*http.Response, error) {
  2356  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2357  	if c.ifNoneMatch_ != "" {
  2358  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2359  	}
  2360  	var body io.Reader = nil
  2361  	c.urlParams_.Set("alt", alt)
  2362  	c.urlParams_.Set("prettyPrint", "false")
  2363  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  2364  	urls += "?" + c.urlParams_.Encode()
  2365  	req, err := http.NewRequest("GET", urls, body)
  2366  	if err != nil {
  2367  		return nil, err
  2368  	}
  2369  	req.Header = reqHeaders
  2370  	googleapi.Expand(req.URL, map[string]string{
  2371  		"name": c.name,
  2372  	})
  2373  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2374  }
  2375  
  2376  // Do executes the "bigquerydatatransfer.projects.locations.dataSources.get" call.
  2377  // Any non-2xx status code is an error. Response headers are in either
  2378  // *DataSource.ServerResponse.Header or (if a response was returned at all) in
  2379  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2380  // whether the returned error was because http.StatusNotModified was returned.
  2381  func (c *ProjectsLocationsDataSourcesGetCall) Do(opts ...googleapi.CallOption) (*DataSource, error) {
  2382  	gensupport.SetOptions(c.urlParams_, opts...)
  2383  	res, err := c.doRequest("json")
  2384  	if res != nil && res.StatusCode == http.StatusNotModified {
  2385  		if res.Body != nil {
  2386  			res.Body.Close()
  2387  		}
  2388  		return nil, gensupport.WrapError(&googleapi.Error{
  2389  			Code:   res.StatusCode,
  2390  			Header: res.Header,
  2391  		})
  2392  	}
  2393  	if err != nil {
  2394  		return nil, err
  2395  	}
  2396  	defer googleapi.CloseBody(res)
  2397  	if err := googleapi.CheckResponse(res); err != nil {
  2398  		return nil, gensupport.WrapError(err)
  2399  	}
  2400  	ret := &DataSource{
  2401  		ServerResponse: googleapi.ServerResponse{
  2402  			Header:         res.Header,
  2403  			HTTPStatusCode: res.StatusCode,
  2404  		},
  2405  	}
  2406  	target := &ret
  2407  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2408  		return nil, err
  2409  	}
  2410  	return ret, nil
  2411  }
  2412  
  2413  type ProjectsLocationsDataSourcesListCall struct {
  2414  	s            *Service
  2415  	parent       string
  2416  	urlParams_   gensupport.URLParams
  2417  	ifNoneMatch_ string
  2418  	ctx_         context.Context
  2419  	header_      http.Header
  2420  }
  2421  
  2422  // List: Lists supported data sources and returns their settings.
  2423  //
  2424  //   - parent: The BigQuery project id for which data sources should be returned.
  2425  //     Must be in the form: `projects/{project_id}` or
  2426  //     `projects/{project_id}/locations/{location_id}`.
  2427  func (r *ProjectsLocationsDataSourcesService) List(parent string) *ProjectsLocationsDataSourcesListCall {
  2428  	c := &ProjectsLocationsDataSourcesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2429  	c.parent = parent
  2430  	return c
  2431  }
  2432  
  2433  // PageSize sets the optional parameter "pageSize": Page size. The default page
  2434  // size is the maximum value of 1000 results.
  2435  func (c *ProjectsLocationsDataSourcesListCall) PageSize(pageSize int64) *ProjectsLocationsDataSourcesListCall {
  2436  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2437  	return c
  2438  }
  2439  
  2440  // PageToken sets the optional parameter "pageToken": Pagination token, which
  2441  // can be used to request a specific page of `ListDataSourcesRequest` list
  2442  // results. For multiple-page results, `ListDataSourcesResponse` outputs a
  2443  // `next_page` token, which can be used as the `page_token` value to request
  2444  // the next page of list results.
  2445  func (c *ProjectsLocationsDataSourcesListCall) PageToken(pageToken string) *ProjectsLocationsDataSourcesListCall {
  2446  	c.urlParams_.Set("pageToken", pageToken)
  2447  	return c
  2448  }
  2449  
  2450  // Fields allows partial responses to be retrieved. See
  2451  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2452  // details.
  2453  func (c *ProjectsLocationsDataSourcesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataSourcesListCall {
  2454  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2455  	return c
  2456  }
  2457  
  2458  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2459  // object's ETag matches the given value. This is useful for getting updates
  2460  // only after the object has changed since the last request.
  2461  func (c *ProjectsLocationsDataSourcesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataSourcesListCall {
  2462  	c.ifNoneMatch_ = entityTag
  2463  	return c
  2464  }
  2465  
  2466  // Context sets the context to be used in this call's Do method.
  2467  func (c *ProjectsLocationsDataSourcesListCall) Context(ctx context.Context) *ProjectsLocationsDataSourcesListCall {
  2468  	c.ctx_ = ctx
  2469  	return c
  2470  }
  2471  
  2472  // Header returns a http.Header that can be modified by the caller to add
  2473  // headers to the request.
  2474  func (c *ProjectsLocationsDataSourcesListCall) Header() http.Header {
  2475  	if c.header_ == nil {
  2476  		c.header_ = make(http.Header)
  2477  	}
  2478  	return c.header_
  2479  }
  2480  
  2481  func (c *ProjectsLocationsDataSourcesListCall) doRequest(alt string) (*http.Response, error) {
  2482  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2483  	if c.ifNoneMatch_ != "" {
  2484  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2485  	}
  2486  	var body io.Reader = nil
  2487  	c.urlParams_.Set("alt", alt)
  2488  	c.urlParams_.Set("prettyPrint", "false")
  2489  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dataSources")
  2490  	urls += "?" + c.urlParams_.Encode()
  2491  	req, err := http.NewRequest("GET", urls, body)
  2492  	if err != nil {
  2493  		return nil, err
  2494  	}
  2495  	req.Header = reqHeaders
  2496  	googleapi.Expand(req.URL, map[string]string{
  2497  		"parent": c.parent,
  2498  	})
  2499  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2500  }
  2501  
  2502  // Do executes the "bigquerydatatransfer.projects.locations.dataSources.list" call.
  2503  // Any non-2xx status code is an error. Response headers are in either
  2504  // *ListDataSourcesResponse.ServerResponse.Header or (if a response was
  2505  // returned at all) in error.(*googleapi.Error).Header. Use
  2506  // googleapi.IsNotModified to check whether the returned error was because
  2507  // http.StatusNotModified was returned.
  2508  func (c *ProjectsLocationsDataSourcesListCall) Do(opts ...googleapi.CallOption) (*ListDataSourcesResponse, error) {
  2509  	gensupport.SetOptions(c.urlParams_, opts...)
  2510  	res, err := c.doRequest("json")
  2511  	if res != nil && res.StatusCode == http.StatusNotModified {
  2512  		if res.Body != nil {
  2513  			res.Body.Close()
  2514  		}
  2515  		return nil, gensupport.WrapError(&googleapi.Error{
  2516  			Code:   res.StatusCode,
  2517  			Header: res.Header,
  2518  		})
  2519  	}
  2520  	if err != nil {
  2521  		return nil, err
  2522  	}
  2523  	defer googleapi.CloseBody(res)
  2524  	if err := googleapi.CheckResponse(res); err != nil {
  2525  		return nil, gensupport.WrapError(err)
  2526  	}
  2527  	ret := &ListDataSourcesResponse{
  2528  		ServerResponse: googleapi.ServerResponse{
  2529  			Header:         res.Header,
  2530  			HTTPStatusCode: res.StatusCode,
  2531  		},
  2532  	}
  2533  	target := &ret
  2534  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2535  		return nil, err
  2536  	}
  2537  	return ret, nil
  2538  }
  2539  
  2540  // Pages invokes f for each page of results.
  2541  // A non-nil error returned from f will halt the iteration.
  2542  // The provided context supersedes any context provided to the Context method.
  2543  func (c *ProjectsLocationsDataSourcesListCall) Pages(ctx context.Context, f func(*ListDataSourcesResponse) error) error {
  2544  	c.ctx_ = ctx
  2545  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  2546  	for {
  2547  		x, err := c.Do()
  2548  		if err != nil {
  2549  			return err
  2550  		}
  2551  		if err := f(x); err != nil {
  2552  			return err
  2553  		}
  2554  		if x.NextPageToken == "" {
  2555  			return nil
  2556  		}
  2557  		c.PageToken(x.NextPageToken)
  2558  	}
  2559  }
  2560  
  2561  type ProjectsLocationsTransferConfigsCreateCall struct {
  2562  	s              *Service
  2563  	parent         string
  2564  	transferconfig *TransferConfig
  2565  	urlParams_     gensupport.URLParams
  2566  	ctx_           context.Context
  2567  	header_        http.Header
  2568  }
  2569  
  2570  // Create: Creates a new data transfer configuration.
  2571  //
  2572  //   - parent: The BigQuery project id where the transfer configuration should be
  2573  //     created. Must be in the format
  2574  //     projects/{project_id}/locations/{location_id} or projects/{project_id}. If
  2575  //     specified location and location of the destination bigquery dataset do not
  2576  //     match - the request will fail.
  2577  func (r *ProjectsLocationsTransferConfigsService) Create(parent string, transferconfig *TransferConfig) *ProjectsLocationsTransferConfigsCreateCall {
  2578  	c := &ProjectsLocationsTransferConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2579  	c.parent = parent
  2580  	c.transferconfig = transferconfig
  2581  	return c
  2582  }
  2583  
  2584  // AuthorizationCode sets the optional parameter "authorizationCode": Optional
  2585  // OAuth2 authorization code to use with this transfer configuration. This is
  2586  // required only if `transferConfig.dataSourceId` is 'youtube_channel' and new
  2587  // credentials are needed, as indicated by `CheckValidCreds`. In order to
  2588  // obtain authorization_code, make a request to the following URL:
  2589  // https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
  2590  // * The client_id is the OAuth client_id of the a data source as returned by
  2591  // ListDataSources method. * data_source_scopes are the scopes returned by
  2592  // ListDataSources method. Note that this should not be set when
  2593  // `service_account_name` is used to create the transfer config.
  2594  func (c *ProjectsLocationsTransferConfigsCreateCall) AuthorizationCode(authorizationCode string) *ProjectsLocationsTransferConfigsCreateCall {
  2595  	c.urlParams_.Set("authorizationCode", authorizationCode)
  2596  	return c
  2597  }
  2598  
  2599  // ServiceAccountName sets the optional parameter "serviceAccountName":
  2600  // Optional service account email. If this field is set, the transfer config
  2601  // will be created with this service account's credentials. It requires that
  2602  // the requesting user calling this API has permissions to act as this service
  2603  // account. Note that not all data sources support service account credentials
  2604  // when creating a transfer config. For the latest list of data sources, read
  2605  // about using service accounts
  2606  // (https://cloud.google.com/bigquery-transfer/docs/use-service-accounts).
  2607  func (c *ProjectsLocationsTransferConfigsCreateCall) ServiceAccountName(serviceAccountName string) *ProjectsLocationsTransferConfigsCreateCall {
  2608  	c.urlParams_.Set("serviceAccountName", serviceAccountName)
  2609  	return c
  2610  }
  2611  
  2612  // VersionInfo sets the optional parameter "versionInfo": Optional version
  2613  // info. This is required only if `transferConfig.dataSourceId` is not
  2614  // 'youtube_channel' and new credentials are needed, as indicated by
  2615  // `CheckValidCreds`. In order to obtain version info, make a request to the
  2616  // following URL:
  2617  // https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
  2618  // * The client_id is the OAuth client_id of the a data source as returned by
  2619  // ListDataSources method. * data_source_scopes are the scopes returned by
  2620  // ListDataSources method. Note that this should not be set when
  2621  // `service_account_name` is used to create the transfer config.
  2622  func (c *ProjectsLocationsTransferConfigsCreateCall) VersionInfo(versionInfo string) *ProjectsLocationsTransferConfigsCreateCall {
  2623  	c.urlParams_.Set("versionInfo", versionInfo)
  2624  	return c
  2625  }
  2626  
  2627  // Fields allows partial responses to be retrieved. See
  2628  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2629  // details.
  2630  func (c *ProjectsLocationsTransferConfigsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsTransferConfigsCreateCall {
  2631  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2632  	return c
  2633  }
  2634  
  2635  // Context sets the context to be used in this call's Do method.
  2636  func (c *ProjectsLocationsTransferConfigsCreateCall) Context(ctx context.Context) *ProjectsLocationsTransferConfigsCreateCall {
  2637  	c.ctx_ = ctx
  2638  	return c
  2639  }
  2640  
  2641  // Header returns a http.Header that can be modified by the caller to add
  2642  // headers to the request.
  2643  func (c *ProjectsLocationsTransferConfigsCreateCall) Header() http.Header {
  2644  	if c.header_ == nil {
  2645  		c.header_ = make(http.Header)
  2646  	}
  2647  	return c.header_
  2648  }
  2649  
  2650  func (c *ProjectsLocationsTransferConfigsCreateCall) doRequest(alt string) (*http.Response, error) {
  2651  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2652  	var body io.Reader = nil
  2653  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.transferconfig)
  2654  	if err != nil {
  2655  		return nil, err
  2656  	}
  2657  	c.urlParams_.Set("alt", alt)
  2658  	c.urlParams_.Set("prettyPrint", "false")
  2659  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/transferConfigs")
  2660  	urls += "?" + c.urlParams_.Encode()
  2661  	req, err := http.NewRequest("POST", urls, body)
  2662  	if err != nil {
  2663  		return nil, err
  2664  	}
  2665  	req.Header = reqHeaders
  2666  	googleapi.Expand(req.URL, map[string]string{
  2667  		"parent": c.parent,
  2668  	})
  2669  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2670  }
  2671  
  2672  // Do executes the "bigquerydatatransfer.projects.locations.transferConfigs.create" call.
  2673  // Any non-2xx status code is an error. Response headers are in either
  2674  // *TransferConfig.ServerResponse.Header or (if a response was returned at all)
  2675  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2676  // whether the returned error was because http.StatusNotModified was returned.
  2677  func (c *ProjectsLocationsTransferConfigsCreateCall) Do(opts ...googleapi.CallOption) (*TransferConfig, error) {
  2678  	gensupport.SetOptions(c.urlParams_, opts...)
  2679  	res, err := c.doRequest("json")
  2680  	if res != nil && res.StatusCode == http.StatusNotModified {
  2681  		if res.Body != nil {
  2682  			res.Body.Close()
  2683  		}
  2684  		return nil, gensupport.WrapError(&googleapi.Error{
  2685  			Code:   res.StatusCode,
  2686  			Header: res.Header,
  2687  		})
  2688  	}
  2689  	if err != nil {
  2690  		return nil, err
  2691  	}
  2692  	defer googleapi.CloseBody(res)
  2693  	if err := googleapi.CheckResponse(res); err != nil {
  2694  		return nil, gensupport.WrapError(err)
  2695  	}
  2696  	ret := &TransferConfig{
  2697  		ServerResponse: googleapi.ServerResponse{
  2698  			Header:         res.Header,
  2699  			HTTPStatusCode: res.StatusCode,
  2700  		},
  2701  	}
  2702  	target := &ret
  2703  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2704  		return nil, err
  2705  	}
  2706  	return ret, nil
  2707  }
  2708  
  2709  type ProjectsLocationsTransferConfigsDeleteCall struct {
  2710  	s          *Service
  2711  	name       string
  2712  	urlParams_ gensupport.URLParams
  2713  	ctx_       context.Context
  2714  	header_    http.Header
  2715  }
  2716  
  2717  // Delete: Deletes a data transfer configuration, including any associated
  2718  // transfer runs and logs.
  2719  //
  2720  //   - name: The field will contain name of the resource requested, for example:
  2721  //     `projects/{project_id}/transferConfigs/{config_id}` or
  2722  //     `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
  2723  func (r *ProjectsLocationsTransferConfigsService) Delete(name string) *ProjectsLocationsTransferConfigsDeleteCall {
  2724  	c := &ProjectsLocationsTransferConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2725  	c.name = name
  2726  	return c
  2727  }
  2728  
  2729  // Fields allows partial responses to be retrieved. See
  2730  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2731  // details.
  2732  func (c *ProjectsLocationsTransferConfigsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsTransferConfigsDeleteCall {
  2733  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2734  	return c
  2735  }
  2736  
  2737  // Context sets the context to be used in this call's Do method.
  2738  func (c *ProjectsLocationsTransferConfigsDeleteCall) Context(ctx context.Context) *ProjectsLocationsTransferConfigsDeleteCall {
  2739  	c.ctx_ = ctx
  2740  	return c
  2741  }
  2742  
  2743  // Header returns a http.Header that can be modified by the caller to add
  2744  // headers to the request.
  2745  func (c *ProjectsLocationsTransferConfigsDeleteCall) Header() http.Header {
  2746  	if c.header_ == nil {
  2747  		c.header_ = make(http.Header)
  2748  	}
  2749  	return c.header_
  2750  }
  2751  
  2752  func (c *ProjectsLocationsTransferConfigsDeleteCall) doRequest(alt string) (*http.Response, error) {
  2753  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2754  	var body io.Reader = nil
  2755  	c.urlParams_.Set("alt", alt)
  2756  	c.urlParams_.Set("prettyPrint", "false")
  2757  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  2758  	urls += "?" + c.urlParams_.Encode()
  2759  	req, err := http.NewRequest("DELETE", urls, body)
  2760  	if err != nil {
  2761  		return nil, err
  2762  	}
  2763  	req.Header = reqHeaders
  2764  	googleapi.Expand(req.URL, map[string]string{
  2765  		"name": c.name,
  2766  	})
  2767  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2768  }
  2769  
  2770  // Do executes the "bigquerydatatransfer.projects.locations.transferConfigs.delete" call.
  2771  // Any non-2xx status code is an error. Response headers are in either
  2772  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  2773  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2774  // whether the returned error was because http.StatusNotModified was returned.
  2775  func (c *ProjectsLocationsTransferConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2776  	gensupport.SetOptions(c.urlParams_, opts...)
  2777  	res, err := c.doRequest("json")
  2778  	if res != nil && res.StatusCode == http.StatusNotModified {
  2779  		if res.Body != nil {
  2780  			res.Body.Close()
  2781  		}
  2782  		return nil, gensupport.WrapError(&googleapi.Error{
  2783  			Code:   res.StatusCode,
  2784  			Header: res.Header,
  2785  		})
  2786  	}
  2787  	if err != nil {
  2788  		return nil, err
  2789  	}
  2790  	defer googleapi.CloseBody(res)
  2791  	if err := googleapi.CheckResponse(res); err != nil {
  2792  		return nil, gensupport.WrapError(err)
  2793  	}
  2794  	ret := &Empty{
  2795  		ServerResponse: googleapi.ServerResponse{
  2796  			Header:         res.Header,
  2797  			HTTPStatusCode: res.StatusCode,
  2798  		},
  2799  	}
  2800  	target := &ret
  2801  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2802  		return nil, err
  2803  	}
  2804  	return ret, nil
  2805  }
  2806  
  2807  type ProjectsLocationsTransferConfigsGetCall struct {
  2808  	s            *Service
  2809  	name         string
  2810  	urlParams_   gensupport.URLParams
  2811  	ifNoneMatch_ string
  2812  	ctx_         context.Context
  2813  	header_      http.Header
  2814  }
  2815  
  2816  // Get: Returns information about a data transfer config.
  2817  //
  2818  //   - name: The field will contain name of the resource requested, for example:
  2819  //     `projects/{project_id}/transferConfigs/{config_id}` or
  2820  //     `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
  2821  func (r *ProjectsLocationsTransferConfigsService) Get(name string) *ProjectsLocationsTransferConfigsGetCall {
  2822  	c := &ProjectsLocationsTransferConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2823  	c.name = name
  2824  	return c
  2825  }
  2826  
  2827  // Fields allows partial responses to be retrieved. See
  2828  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2829  // details.
  2830  func (c *ProjectsLocationsTransferConfigsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsTransferConfigsGetCall {
  2831  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2832  	return c
  2833  }
  2834  
  2835  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2836  // object's ETag matches the given value. This is useful for getting updates
  2837  // only after the object has changed since the last request.
  2838  func (c *ProjectsLocationsTransferConfigsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsTransferConfigsGetCall {
  2839  	c.ifNoneMatch_ = entityTag
  2840  	return c
  2841  }
  2842  
  2843  // Context sets the context to be used in this call's Do method.
  2844  func (c *ProjectsLocationsTransferConfigsGetCall) Context(ctx context.Context) *ProjectsLocationsTransferConfigsGetCall {
  2845  	c.ctx_ = ctx
  2846  	return c
  2847  }
  2848  
  2849  // Header returns a http.Header that can be modified by the caller to add
  2850  // headers to the request.
  2851  func (c *ProjectsLocationsTransferConfigsGetCall) Header() http.Header {
  2852  	if c.header_ == nil {
  2853  		c.header_ = make(http.Header)
  2854  	}
  2855  	return c.header_
  2856  }
  2857  
  2858  func (c *ProjectsLocationsTransferConfigsGetCall) doRequest(alt string) (*http.Response, error) {
  2859  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2860  	if c.ifNoneMatch_ != "" {
  2861  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2862  	}
  2863  	var body io.Reader = nil
  2864  	c.urlParams_.Set("alt", alt)
  2865  	c.urlParams_.Set("prettyPrint", "false")
  2866  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  2867  	urls += "?" + c.urlParams_.Encode()
  2868  	req, err := http.NewRequest("GET", urls, body)
  2869  	if err != nil {
  2870  		return nil, err
  2871  	}
  2872  	req.Header = reqHeaders
  2873  	googleapi.Expand(req.URL, map[string]string{
  2874  		"name": c.name,
  2875  	})
  2876  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2877  }
  2878  
  2879  // Do executes the "bigquerydatatransfer.projects.locations.transferConfigs.get" call.
  2880  // Any non-2xx status code is an error. Response headers are in either
  2881  // *TransferConfig.ServerResponse.Header or (if a response was returned at all)
  2882  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2883  // whether the returned error was because http.StatusNotModified was returned.
  2884  func (c *ProjectsLocationsTransferConfigsGetCall) Do(opts ...googleapi.CallOption) (*TransferConfig, error) {
  2885  	gensupport.SetOptions(c.urlParams_, opts...)
  2886  	res, err := c.doRequest("json")
  2887  	if res != nil && res.StatusCode == http.StatusNotModified {
  2888  		if res.Body != nil {
  2889  			res.Body.Close()
  2890  		}
  2891  		return nil, gensupport.WrapError(&googleapi.Error{
  2892  			Code:   res.StatusCode,
  2893  			Header: res.Header,
  2894  		})
  2895  	}
  2896  	if err != nil {
  2897  		return nil, err
  2898  	}
  2899  	defer googleapi.CloseBody(res)
  2900  	if err := googleapi.CheckResponse(res); err != nil {
  2901  		return nil, gensupport.WrapError(err)
  2902  	}
  2903  	ret := &TransferConfig{
  2904  		ServerResponse: googleapi.ServerResponse{
  2905  			Header:         res.Header,
  2906  			HTTPStatusCode: res.StatusCode,
  2907  		},
  2908  	}
  2909  	target := &ret
  2910  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2911  		return nil, err
  2912  	}
  2913  	return ret, nil
  2914  }
  2915  
  2916  type ProjectsLocationsTransferConfigsListCall struct {
  2917  	s            *Service
  2918  	parent       string
  2919  	urlParams_   gensupport.URLParams
  2920  	ifNoneMatch_ string
  2921  	ctx_         context.Context
  2922  	header_      http.Header
  2923  }
  2924  
  2925  // List: Returns information about all transfer configs owned by a project in
  2926  // the specified location.
  2927  //
  2928  //   - parent: The BigQuery project id for which transfer configs should be
  2929  //     returned: `projects/{project_id}` or
  2930  //     `projects/{project_id}/locations/{location_id}`.
  2931  func (r *ProjectsLocationsTransferConfigsService) List(parent string) *ProjectsLocationsTransferConfigsListCall {
  2932  	c := &ProjectsLocationsTransferConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2933  	c.parent = parent
  2934  	return c
  2935  }
  2936  
  2937  // DataSourceIds sets the optional parameter "dataSourceIds": When specified,
  2938  // only configurations of requested data sources are returned.
  2939  func (c *ProjectsLocationsTransferConfigsListCall) DataSourceIds(dataSourceIds ...string) *ProjectsLocationsTransferConfigsListCall {
  2940  	c.urlParams_.SetMulti("dataSourceIds", append([]string{}, dataSourceIds...))
  2941  	return c
  2942  }
  2943  
  2944  // PageSize sets the optional parameter "pageSize": Page size. The default page
  2945  // size is the maximum value of 1000 results.
  2946  func (c *ProjectsLocationsTransferConfigsListCall) PageSize(pageSize int64) *ProjectsLocationsTransferConfigsListCall {
  2947  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2948  	return c
  2949  }
  2950  
  2951  // PageToken sets the optional parameter "pageToken": Pagination token, which
  2952  // can be used to request a specific page of `ListTransfersRequest` list
  2953  // results. For multiple-page results, `ListTransfersResponse` outputs a
  2954  // `next_page` token, which can be used as the `page_token` value to request
  2955  // the next page of list results.
  2956  func (c *ProjectsLocationsTransferConfigsListCall) PageToken(pageToken string) *ProjectsLocationsTransferConfigsListCall {
  2957  	c.urlParams_.Set("pageToken", pageToken)
  2958  	return c
  2959  }
  2960  
  2961  // Fields allows partial responses to be retrieved. See
  2962  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2963  // details.
  2964  func (c *ProjectsLocationsTransferConfigsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsTransferConfigsListCall {
  2965  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2966  	return c
  2967  }
  2968  
  2969  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2970  // object's ETag matches the given value. This is useful for getting updates
  2971  // only after the object has changed since the last request.
  2972  func (c *ProjectsLocationsTransferConfigsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsTransferConfigsListCall {
  2973  	c.ifNoneMatch_ = entityTag
  2974  	return c
  2975  }
  2976  
  2977  // Context sets the context to be used in this call's Do method.
  2978  func (c *ProjectsLocationsTransferConfigsListCall) Context(ctx context.Context) *ProjectsLocationsTransferConfigsListCall {
  2979  	c.ctx_ = ctx
  2980  	return c
  2981  }
  2982  
  2983  // Header returns a http.Header that can be modified by the caller to add
  2984  // headers to the request.
  2985  func (c *ProjectsLocationsTransferConfigsListCall) Header() http.Header {
  2986  	if c.header_ == nil {
  2987  		c.header_ = make(http.Header)
  2988  	}
  2989  	return c.header_
  2990  }
  2991  
  2992  func (c *ProjectsLocationsTransferConfigsListCall) doRequest(alt string) (*http.Response, error) {
  2993  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2994  	if c.ifNoneMatch_ != "" {
  2995  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2996  	}
  2997  	var body io.Reader = nil
  2998  	c.urlParams_.Set("alt", alt)
  2999  	c.urlParams_.Set("prettyPrint", "false")
  3000  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/transferConfigs")
  3001  	urls += "?" + c.urlParams_.Encode()
  3002  	req, err := http.NewRequest("GET", urls, body)
  3003  	if err != nil {
  3004  		return nil, err
  3005  	}
  3006  	req.Header = reqHeaders
  3007  	googleapi.Expand(req.URL, map[string]string{
  3008  		"parent": c.parent,
  3009  	})
  3010  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3011  }
  3012  
  3013  // Do executes the "bigquerydatatransfer.projects.locations.transferConfigs.list" call.
  3014  // Any non-2xx status code is an error. Response headers are in either
  3015  // *ListTransferConfigsResponse.ServerResponse.Header or (if a response was
  3016  // returned at all) in error.(*googleapi.Error).Header. Use
  3017  // googleapi.IsNotModified to check whether the returned error was because
  3018  // http.StatusNotModified was returned.
  3019  func (c *ProjectsLocationsTransferConfigsListCall) Do(opts ...googleapi.CallOption) (*ListTransferConfigsResponse, error) {
  3020  	gensupport.SetOptions(c.urlParams_, opts...)
  3021  	res, err := c.doRequest("json")
  3022  	if res != nil && res.StatusCode == http.StatusNotModified {
  3023  		if res.Body != nil {
  3024  			res.Body.Close()
  3025  		}
  3026  		return nil, gensupport.WrapError(&googleapi.Error{
  3027  			Code:   res.StatusCode,
  3028  			Header: res.Header,
  3029  		})
  3030  	}
  3031  	if err != nil {
  3032  		return nil, err
  3033  	}
  3034  	defer googleapi.CloseBody(res)
  3035  	if err := googleapi.CheckResponse(res); err != nil {
  3036  		return nil, gensupport.WrapError(err)
  3037  	}
  3038  	ret := &ListTransferConfigsResponse{
  3039  		ServerResponse: googleapi.ServerResponse{
  3040  			Header:         res.Header,
  3041  			HTTPStatusCode: res.StatusCode,
  3042  		},
  3043  	}
  3044  	target := &ret
  3045  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3046  		return nil, err
  3047  	}
  3048  	return ret, nil
  3049  }
  3050  
  3051  // Pages invokes f for each page of results.
  3052  // A non-nil error returned from f will halt the iteration.
  3053  // The provided context supersedes any context provided to the Context method.
  3054  func (c *ProjectsLocationsTransferConfigsListCall) Pages(ctx context.Context, f func(*ListTransferConfigsResponse) error) error {
  3055  	c.ctx_ = ctx
  3056  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  3057  	for {
  3058  		x, err := c.Do()
  3059  		if err != nil {
  3060  			return err
  3061  		}
  3062  		if err := f(x); err != nil {
  3063  			return err
  3064  		}
  3065  		if x.NextPageToken == "" {
  3066  			return nil
  3067  		}
  3068  		c.PageToken(x.NextPageToken)
  3069  	}
  3070  }
  3071  
  3072  type ProjectsLocationsTransferConfigsPatchCall struct {
  3073  	s              *Service
  3074  	name           string
  3075  	transferconfig *TransferConfig
  3076  	urlParams_     gensupport.URLParams
  3077  	ctx_           context.Context
  3078  	header_        http.Header
  3079  }
  3080  
  3081  // Patch: Updates a data transfer configuration. All fields must be set, even
  3082  // if they are not updated.
  3083  //
  3084  //   - name: Identifier. The resource name of the transfer config. Transfer
  3085  //     config names have the form either
  3086  //     `projects/{project_id}/locations/{region}/transferConfigs/{config_id}` or
  3087  //     `projects/{project_id}/transferConfigs/{config_id}`, where `config_id` is
  3088  //     usually a UUID, even though it is not guaranteed or required. The name is
  3089  //     ignored when creating a transfer config.
  3090  func (r *ProjectsLocationsTransferConfigsService) Patch(name string, transferconfig *TransferConfig) *ProjectsLocationsTransferConfigsPatchCall {
  3091  	c := &ProjectsLocationsTransferConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3092  	c.name = name
  3093  	c.transferconfig = transferconfig
  3094  	return c
  3095  }
  3096  
  3097  // AuthorizationCode sets the optional parameter "authorizationCode": Optional
  3098  // OAuth2 authorization code to use with this transfer configuration. This is
  3099  // required only if `transferConfig.dataSourceId` is 'youtube_channel' and new
  3100  // credentials are needed, as indicated by `CheckValidCreds`. In order to
  3101  // obtain authorization_code, make a request to the following URL:
  3102  // https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
  3103  // * The client_id is the OAuth client_id of the a data source as returned by
  3104  // ListDataSources method. * data_source_scopes are the scopes returned by
  3105  // ListDataSources method. Note that this should not be set when
  3106  // `service_account_name` is used to update the transfer config.
  3107  func (c *ProjectsLocationsTransferConfigsPatchCall) AuthorizationCode(authorizationCode string) *ProjectsLocationsTransferConfigsPatchCall {
  3108  	c.urlParams_.Set("authorizationCode", authorizationCode)
  3109  	return c
  3110  }
  3111  
  3112  // ServiceAccountName sets the optional parameter "serviceAccountName":
  3113  // Optional service account email. If this field is set, the transfer config
  3114  // will be created with this service account's credentials. It requires that
  3115  // the requesting user calling this API has permissions to act as this service
  3116  // account. Note that not all data sources support service account credentials
  3117  // when creating a transfer config. For the latest list of data sources, read
  3118  // about using service accounts
  3119  // (https://cloud.google.com/bigquery-transfer/docs/use-service-accounts).
  3120  func (c *ProjectsLocationsTransferConfigsPatchCall) ServiceAccountName(serviceAccountName string) *ProjectsLocationsTransferConfigsPatchCall {
  3121  	c.urlParams_.Set("serviceAccountName", serviceAccountName)
  3122  	return c
  3123  }
  3124  
  3125  // UpdateMask sets the optional parameter "updateMask": Required. Required list
  3126  // of fields to be updated in this request.
  3127  func (c *ProjectsLocationsTransferConfigsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsTransferConfigsPatchCall {
  3128  	c.urlParams_.Set("updateMask", updateMask)
  3129  	return c
  3130  }
  3131  
  3132  // VersionInfo sets the optional parameter "versionInfo": Optional version
  3133  // info. This is required only if `transferConfig.dataSourceId` is not
  3134  // 'youtube_channel' and new credentials are needed, as indicated by
  3135  // `CheckValidCreds`. In order to obtain version info, make a request to the
  3136  // following URL:
  3137  // https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
  3138  // * The client_id is the OAuth client_id of the a data source as returned by
  3139  // ListDataSources method. * data_source_scopes are the scopes returned by
  3140  // ListDataSources method. Note that this should not be set when
  3141  // `service_account_name` is used to update the transfer config.
  3142  func (c *ProjectsLocationsTransferConfigsPatchCall) VersionInfo(versionInfo string) *ProjectsLocationsTransferConfigsPatchCall {
  3143  	c.urlParams_.Set("versionInfo", versionInfo)
  3144  	return c
  3145  }
  3146  
  3147  // Fields allows partial responses to be retrieved. See
  3148  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3149  // details.
  3150  func (c *ProjectsLocationsTransferConfigsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsTransferConfigsPatchCall {
  3151  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3152  	return c
  3153  }
  3154  
  3155  // Context sets the context to be used in this call's Do method.
  3156  func (c *ProjectsLocationsTransferConfigsPatchCall) Context(ctx context.Context) *ProjectsLocationsTransferConfigsPatchCall {
  3157  	c.ctx_ = ctx
  3158  	return c
  3159  }
  3160  
  3161  // Header returns a http.Header that can be modified by the caller to add
  3162  // headers to the request.
  3163  func (c *ProjectsLocationsTransferConfigsPatchCall) Header() http.Header {
  3164  	if c.header_ == nil {
  3165  		c.header_ = make(http.Header)
  3166  	}
  3167  	return c.header_
  3168  }
  3169  
  3170  func (c *ProjectsLocationsTransferConfigsPatchCall) doRequest(alt string) (*http.Response, error) {
  3171  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3172  	var body io.Reader = nil
  3173  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.transferconfig)
  3174  	if err != nil {
  3175  		return nil, err
  3176  	}
  3177  	c.urlParams_.Set("alt", alt)
  3178  	c.urlParams_.Set("prettyPrint", "false")
  3179  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  3180  	urls += "?" + c.urlParams_.Encode()
  3181  	req, err := http.NewRequest("PATCH", urls, body)
  3182  	if err != nil {
  3183  		return nil, err
  3184  	}
  3185  	req.Header = reqHeaders
  3186  	googleapi.Expand(req.URL, map[string]string{
  3187  		"name": c.name,
  3188  	})
  3189  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3190  }
  3191  
  3192  // Do executes the "bigquerydatatransfer.projects.locations.transferConfigs.patch" call.
  3193  // Any non-2xx status code is an error. Response headers are in either
  3194  // *TransferConfig.ServerResponse.Header or (if a response was returned at all)
  3195  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3196  // whether the returned error was because http.StatusNotModified was returned.
  3197  func (c *ProjectsLocationsTransferConfigsPatchCall) Do(opts ...googleapi.CallOption) (*TransferConfig, error) {
  3198  	gensupport.SetOptions(c.urlParams_, opts...)
  3199  	res, err := c.doRequest("json")
  3200  	if res != nil && res.StatusCode == http.StatusNotModified {
  3201  		if res.Body != nil {
  3202  			res.Body.Close()
  3203  		}
  3204  		return nil, gensupport.WrapError(&googleapi.Error{
  3205  			Code:   res.StatusCode,
  3206  			Header: res.Header,
  3207  		})
  3208  	}
  3209  	if err != nil {
  3210  		return nil, err
  3211  	}
  3212  	defer googleapi.CloseBody(res)
  3213  	if err := googleapi.CheckResponse(res); err != nil {
  3214  		return nil, gensupport.WrapError(err)
  3215  	}
  3216  	ret := &TransferConfig{
  3217  		ServerResponse: googleapi.ServerResponse{
  3218  			Header:         res.Header,
  3219  			HTTPStatusCode: res.StatusCode,
  3220  		},
  3221  	}
  3222  	target := &ret
  3223  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3224  		return nil, err
  3225  	}
  3226  	return ret, nil
  3227  }
  3228  
  3229  type ProjectsLocationsTransferConfigsScheduleRunsCall struct {
  3230  	s                           *Service
  3231  	parent                      string
  3232  	scheduletransferrunsrequest *ScheduleTransferRunsRequest
  3233  	urlParams_                  gensupport.URLParams
  3234  	ctx_                        context.Context
  3235  	header_                     http.Header
  3236  }
  3237  
  3238  // ScheduleRuns: Creates transfer runs for a time range [start_time, end_time].
  3239  // For each date - or whatever granularity the data source supports - in the
  3240  // range, one transfer run is created. Note that runs are created per UTC time
  3241  // in the time range. DEPRECATED: use StartManualTransferRuns instead.
  3242  //
  3243  //   - parent: Transfer configuration name in the form:
  3244  //     `projects/{project_id}/transferConfigs/{config_id}` or
  3245  //     `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
  3246  //     .
  3247  func (r *ProjectsLocationsTransferConfigsService) ScheduleRuns(parent string, scheduletransferrunsrequest *ScheduleTransferRunsRequest) *ProjectsLocationsTransferConfigsScheduleRunsCall {
  3248  	c := &ProjectsLocationsTransferConfigsScheduleRunsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3249  	c.parent = parent
  3250  	c.scheduletransferrunsrequest = scheduletransferrunsrequest
  3251  	return c
  3252  }
  3253  
  3254  // Fields allows partial responses to be retrieved. See
  3255  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3256  // details.
  3257  func (c *ProjectsLocationsTransferConfigsScheduleRunsCall) Fields(s ...googleapi.Field) *ProjectsLocationsTransferConfigsScheduleRunsCall {
  3258  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3259  	return c
  3260  }
  3261  
  3262  // Context sets the context to be used in this call's Do method.
  3263  func (c *ProjectsLocationsTransferConfigsScheduleRunsCall) Context(ctx context.Context) *ProjectsLocationsTransferConfigsScheduleRunsCall {
  3264  	c.ctx_ = ctx
  3265  	return c
  3266  }
  3267  
  3268  // Header returns a http.Header that can be modified by the caller to add
  3269  // headers to the request.
  3270  func (c *ProjectsLocationsTransferConfigsScheduleRunsCall) Header() http.Header {
  3271  	if c.header_ == nil {
  3272  		c.header_ = make(http.Header)
  3273  	}
  3274  	return c.header_
  3275  }
  3276  
  3277  func (c *ProjectsLocationsTransferConfigsScheduleRunsCall) doRequest(alt string) (*http.Response, error) {
  3278  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3279  	var body io.Reader = nil
  3280  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.scheduletransferrunsrequest)
  3281  	if err != nil {
  3282  		return nil, err
  3283  	}
  3284  	c.urlParams_.Set("alt", alt)
  3285  	c.urlParams_.Set("prettyPrint", "false")
  3286  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}:scheduleRuns")
  3287  	urls += "?" + c.urlParams_.Encode()
  3288  	req, err := http.NewRequest("POST", urls, body)
  3289  	if err != nil {
  3290  		return nil, err
  3291  	}
  3292  	req.Header = reqHeaders
  3293  	googleapi.Expand(req.URL, map[string]string{
  3294  		"parent": c.parent,
  3295  	})
  3296  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3297  }
  3298  
  3299  // Do executes the "bigquerydatatransfer.projects.locations.transferConfigs.scheduleRuns" call.
  3300  // Any non-2xx status code is an error. Response headers are in either
  3301  // *ScheduleTransferRunsResponse.ServerResponse.Header or (if a response was
  3302  // returned at all) in error.(*googleapi.Error).Header. Use
  3303  // googleapi.IsNotModified to check whether the returned error was because
  3304  // http.StatusNotModified was returned.
  3305  func (c *ProjectsLocationsTransferConfigsScheduleRunsCall) Do(opts ...googleapi.CallOption) (*ScheduleTransferRunsResponse, error) {
  3306  	gensupport.SetOptions(c.urlParams_, opts...)
  3307  	res, err := c.doRequest("json")
  3308  	if res != nil && res.StatusCode == http.StatusNotModified {
  3309  		if res.Body != nil {
  3310  			res.Body.Close()
  3311  		}
  3312  		return nil, gensupport.WrapError(&googleapi.Error{
  3313  			Code:   res.StatusCode,
  3314  			Header: res.Header,
  3315  		})
  3316  	}
  3317  	if err != nil {
  3318  		return nil, err
  3319  	}
  3320  	defer googleapi.CloseBody(res)
  3321  	if err := googleapi.CheckResponse(res); err != nil {
  3322  		return nil, gensupport.WrapError(err)
  3323  	}
  3324  	ret := &ScheduleTransferRunsResponse{
  3325  		ServerResponse: googleapi.ServerResponse{
  3326  			Header:         res.Header,
  3327  			HTTPStatusCode: res.StatusCode,
  3328  		},
  3329  	}
  3330  	target := &ret
  3331  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3332  		return nil, err
  3333  	}
  3334  	return ret, nil
  3335  }
  3336  
  3337  type ProjectsLocationsTransferConfigsStartManualRunsCall struct {
  3338  	s                              *Service
  3339  	parent                         string
  3340  	startmanualtransferrunsrequest *StartManualTransferRunsRequest
  3341  	urlParams_                     gensupport.URLParams
  3342  	ctx_                           context.Context
  3343  	header_                        http.Header
  3344  }
  3345  
  3346  // StartManualRuns: Start manual transfer runs to be executed now with
  3347  // schedule_time equal to current time. The transfer runs can be created for a
  3348  // time range where the run_time is between start_time (inclusive) and end_time
  3349  // (exclusive), or for a specific run_time.
  3350  //
  3351  //   - parent: Transfer configuration name in the form:
  3352  //     `projects/{project_id}/transferConfigs/{config_id}` or
  3353  //     `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
  3354  //     .
  3355  func (r *ProjectsLocationsTransferConfigsService) StartManualRuns(parent string, startmanualtransferrunsrequest *StartManualTransferRunsRequest) *ProjectsLocationsTransferConfigsStartManualRunsCall {
  3356  	c := &ProjectsLocationsTransferConfigsStartManualRunsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3357  	c.parent = parent
  3358  	c.startmanualtransferrunsrequest = startmanualtransferrunsrequest
  3359  	return c
  3360  }
  3361  
  3362  // Fields allows partial responses to be retrieved. See
  3363  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3364  // details.
  3365  func (c *ProjectsLocationsTransferConfigsStartManualRunsCall) Fields(s ...googleapi.Field) *ProjectsLocationsTransferConfigsStartManualRunsCall {
  3366  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3367  	return c
  3368  }
  3369  
  3370  // Context sets the context to be used in this call's Do method.
  3371  func (c *ProjectsLocationsTransferConfigsStartManualRunsCall) Context(ctx context.Context) *ProjectsLocationsTransferConfigsStartManualRunsCall {
  3372  	c.ctx_ = ctx
  3373  	return c
  3374  }
  3375  
  3376  // Header returns a http.Header that can be modified by the caller to add
  3377  // headers to the request.
  3378  func (c *ProjectsLocationsTransferConfigsStartManualRunsCall) Header() http.Header {
  3379  	if c.header_ == nil {
  3380  		c.header_ = make(http.Header)
  3381  	}
  3382  	return c.header_
  3383  }
  3384  
  3385  func (c *ProjectsLocationsTransferConfigsStartManualRunsCall) doRequest(alt string) (*http.Response, error) {
  3386  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3387  	var body io.Reader = nil
  3388  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.startmanualtransferrunsrequest)
  3389  	if err != nil {
  3390  		return nil, err
  3391  	}
  3392  	c.urlParams_.Set("alt", alt)
  3393  	c.urlParams_.Set("prettyPrint", "false")
  3394  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}:startManualRuns")
  3395  	urls += "?" + c.urlParams_.Encode()
  3396  	req, err := http.NewRequest("POST", urls, body)
  3397  	if err != nil {
  3398  		return nil, err
  3399  	}
  3400  	req.Header = reqHeaders
  3401  	googleapi.Expand(req.URL, map[string]string{
  3402  		"parent": c.parent,
  3403  	})
  3404  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3405  }
  3406  
  3407  // Do executes the "bigquerydatatransfer.projects.locations.transferConfigs.startManualRuns" call.
  3408  // Any non-2xx status code is an error. Response headers are in either
  3409  // *StartManualTransferRunsResponse.ServerResponse.Header or (if a response was
  3410  // returned at all) in error.(*googleapi.Error).Header. Use
  3411  // googleapi.IsNotModified to check whether the returned error was because
  3412  // http.StatusNotModified was returned.
  3413  func (c *ProjectsLocationsTransferConfigsStartManualRunsCall) Do(opts ...googleapi.CallOption) (*StartManualTransferRunsResponse, error) {
  3414  	gensupport.SetOptions(c.urlParams_, opts...)
  3415  	res, err := c.doRequest("json")
  3416  	if res != nil && res.StatusCode == http.StatusNotModified {
  3417  		if res.Body != nil {
  3418  			res.Body.Close()
  3419  		}
  3420  		return nil, gensupport.WrapError(&googleapi.Error{
  3421  			Code:   res.StatusCode,
  3422  			Header: res.Header,
  3423  		})
  3424  	}
  3425  	if err != nil {
  3426  		return nil, err
  3427  	}
  3428  	defer googleapi.CloseBody(res)
  3429  	if err := googleapi.CheckResponse(res); err != nil {
  3430  		return nil, gensupport.WrapError(err)
  3431  	}
  3432  	ret := &StartManualTransferRunsResponse{
  3433  		ServerResponse: googleapi.ServerResponse{
  3434  			Header:         res.Header,
  3435  			HTTPStatusCode: res.StatusCode,
  3436  		},
  3437  	}
  3438  	target := &ret
  3439  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3440  		return nil, err
  3441  	}
  3442  	return ret, nil
  3443  }
  3444  
  3445  type ProjectsLocationsTransferConfigsRunsDeleteCall struct {
  3446  	s          *Service
  3447  	name       string
  3448  	urlParams_ gensupport.URLParams
  3449  	ctx_       context.Context
  3450  	header_    http.Header
  3451  }
  3452  
  3453  // Delete: Deletes the specified transfer run.
  3454  //
  3455  //   - name: The field will contain name of the resource requested, for example:
  3456  //     `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
  3457  //     `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/
  3458  //     runs/{run_id}`.
  3459  func (r *ProjectsLocationsTransferConfigsRunsService) Delete(name string) *ProjectsLocationsTransferConfigsRunsDeleteCall {
  3460  	c := &ProjectsLocationsTransferConfigsRunsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3461  	c.name = name
  3462  	return c
  3463  }
  3464  
  3465  // Fields allows partial responses to be retrieved. See
  3466  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3467  // details.
  3468  func (c *ProjectsLocationsTransferConfigsRunsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsTransferConfigsRunsDeleteCall {
  3469  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3470  	return c
  3471  }
  3472  
  3473  // Context sets the context to be used in this call's Do method.
  3474  func (c *ProjectsLocationsTransferConfigsRunsDeleteCall) Context(ctx context.Context) *ProjectsLocationsTransferConfigsRunsDeleteCall {
  3475  	c.ctx_ = ctx
  3476  	return c
  3477  }
  3478  
  3479  // Header returns a http.Header that can be modified by the caller to add
  3480  // headers to the request.
  3481  func (c *ProjectsLocationsTransferConfigsRunsDeleteCall) Header() http.Header {
  3482  	if c.header_ == nil {
  3483  		c.header_ = make(http.Header)
  3484  	}
  3485  	return c.header_
  3486  }
  3487  
  3488  func (c *ProjectsLocationsTransferConfigsRunsDeleteCall) doRequest(alt string) (*http.Response, error) {
  3489  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3490  	var body io.Reader = nil
  3491  	c.urlParams_.Set("alt", alt)
  3492  	c.urlParams_.Set("prettyPrint", "false")
  3493  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  3494  	urls += "?" + c.urlParams_.Encode()
  3495  	req, err := http.NewRequest("DELETE", urls, body)
  3496  	if err != nil {
  3497  		return nil, err
  3498  	}
  3499  	req.Header = reqHeaders
  3500  	googleapi.Expand(req.URL, map[string]string{
  3501  		"name": c.name,
  3502  	})
  3503  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3504  }
  3505  
  3506  // Do executes the "bigquerydatatransfer.projects.locations.transferConfigs.runs.delete" call.
  3507  // Any non-2xx status code is an error. Response headers are in either
  3508  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  3509  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3510  // whether the returned error was because http.StatusNotModified was returned.
  3511  func (c *ProjectsLocationsTransferConfigsRunsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  3512  	gensupport.SetOptions(c.urlParams_, opts...)
  3513  	res, err := c.doRequest("json")
  3514  	if res != nil && res.StatusCode == http.StatusNotModified {
  3515  		if res.Body != nil {
  3516  			res.Body.Close()
  3517  		}
  3518  		return nil, gensupport.WrapError(&googleapi.Error{
  3519  			Code:   res.StatusCode,
  3520  			Header: res.Header,
  3521  		})
  3522  	}
  3523  	if err != nil {
  3524  		return nil, err
  3525  	}
  3526  	defer googleapi.CloseBody(res)
  3527  	if err := googleapi.CheckResponse(res); err != nil {
  3528  		return nil, gensupport.WrapError(err)
  3529  	}
  3530  	ret := &Empty{
  3531  		ServerResponse: googleapi.ServerResponse{
  3532  			Header:         res.Header,
  3533  			HTTPStatusCode: res.StatusCode,
  3534  		},
  3535  	}
  3536  	target := &ret
  3537  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3538  		return nil, err
  3539  	}
  3540  	return ret, nil
  3541  }
  3542  
  3543  type ProjectsLocationsTransferConfigsRunsGetCall struct {
  3544  	s            *Service
  3545  	name         string
  3546  	urlParams_   gensupport.URLParams
  3547  	ifNoneMatch_ string
  3548  	ctx_         context.Context
  3549  	header_      http.Header
  3550  }
  3551  
  3552  // Get: Returns information about the particular transfer run.
  3553  //
  3554  //   - name: The field will contain name of the resource requested, for example:
  3555  //     `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
  3556  //     `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/
  3557  //     runs/{run_id}`.
  3558  func (r *ProjectsLocationsTransferConfigsRunsService) Get(name string) *ProjectsLocationsTransferConfigsRunsGetCall {
  3559  	c := &ProjectsLocationsTransferConfigsRunsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3560  	c.name = name
  3561  	return c
  3562  }
  3563  
  3564  // Fields allows partial responses to be retrieved. See
  3565  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3566  // details.
  3567  func (c *ProjectsLocationsTransferConfigsRunsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsTransferConfigsRunsGetCall {
  3568  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3569  	return c
  3570  }
  3571  
  3572  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3573  // object's ETag matches the given value. This is useful for getting updates
  3574  // only after the object has changed since the last request.
  3575  func (c *ProjectsLocationsTransferConfigsRunsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsTransferConfigsRunsGetCall {
  3576  	c.ifNoneMatch_ = entityTag
  3577  	return c
  3578  }
  3579  
  3580  // Context sets the context to be used in this call's Do method.
  3581  func (c *ProjectsLocationsTransferConfigsRunsGetCall) Context(ctx context.Context) *ProjectsLocationsTransferConfigsRunsGetCall {
  3582  	c.ctx_ = ctx
  3583  	return c
  3584  }
  3585  
  3586  // Header returns a http.Header that can be modified by the caller to add
  3587  // headers to the request.
  3588  func (c *ProjectsLocationsTransferConfigsRunsGetCall) Header() http.Header {
  3589  	if c.header_ == nil {
  3590  		c.header_ = make(http.Header)
  3591  	}
  3592  	return c.header_
  3593  }
  3594  
  3595  func (c *ProjectsLocationsTransferConfigsRunsGetCall) doRequest(alt string) (*http.Response, error) {
  3596  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3597  	if c.ifNoneMatch_ != "" {
  3598  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3599  	}
  3600  	var body io.Reader = nil
  3601  	c.urlParams_.Set("alt", alt)
  3602  	c.urlParams_.Set("prettyPrint", "false")
  3603  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  3604  	urls += "?" + c.urlParams_.Encode()
  3605  	req, err := http.NewRequest("GET", urls, body)
  3606  	if err != nil {
  3607  		return nil, err
  3608  	}
  3609  	req.Header = reqHeaders
  3610  	googleapi.Expand(req.URL, map[string]string{
  3611  		"name": c.name,
  3612  	})
  3613  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3614  }
  3615  
  3616  // Do executes the "bigquerydatatransfer.projects.locations.transferConfigs.runs.get" call.
  3617  // Any non-2xx status code is an error. Response headers are in either
  3618  // *TransferRun.ServerResponse.Header or (if a response was returned at all) in
  3619  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3620  // whether the returned error was because http.StatusNotModified was returned.
  3621  func (c *ProjectsLocationsTransferConfigsRunsGetCall) Do(opts ...googleapi.CallOption) (*TransferRun, error) {
  3622  	gensupport.SetOptions(c.urlParams_, opts...)
  3623  	res, err := c.doRequest("json")
  3624  	if res != nil && res.StatusCode == http.StatusNotModified {
  3625  		if res.Body != nil {
  3626  			res.Body.Close()
  3627  		}
  3628  		return nil, gensupport.WrapError(&googleapi.Error{
  3629  			Code:   res.StatusCode,
  3630  			Header: res.Header,
  3631  		})
  3632  	}
  3633  	if err != nil {
  3634  		return nil, err
  3635  	}
  3636  	defer googleapi.CloseBody(res)
  3637  	if err := googleapi.CheckResponse(res); err != nil {
  3638  		return nil, gensupport.WrapError(err)
  3639  	}
  3640  	ret := &TransferRun{
  3641  		ServerResponse: googleapi.ServerResponse{
  3642  			Header:         res.Header,
  3643  			HTTPStatusCode: res.StatusCode,
  3644  		},
  3645  	}
  3646  	target := &ret
  3647  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3648  		return nil, err
  3649  	}
  3650  	return ret, nil
  3651  }
  3652  
  3653  type ProjectsLocationsTransferConfigsRunsListCall struct {
  3654  	s            *Service
  3655  	parent       string
  3656  	urlParams_   gensupport.URLParams
  3657  	ifNoneMatch_ string
  3658  	ctx_         context.Context
  3659  	header_      http.Header
  3660  }
  3661  
  3662  // List: Returns information about running and completed transfer runs.
  3663  //
  3664  //   - parent: Name of transfer configuration for which transfer runs should be
  3665  //     retrieved. Format of transfer configuration resource name is:
  3666  //     `projects/{project_id}/transferConfigs/{config_id}` or
  3667  //     `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
  3668  //     .
  3669  func (r *ProjectsLocationsTransferConfigsRunsService) List(parent string) *ProjectsLocationsTransferConfigsRunsListCall {
  3670  	c := &ProjectsLocationsTransferConfigsRunsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3671  	c.parent = parent
  3672  	return c
  3673  }
  3674  
  3675  // PageSize sets the optional parameter "pageSize": Page size. The default page
  3676  // size is the maximum value of 1000 results.
  3677  func (c *ProjectsLocationsTransferConfigsRunsListCall) PageSize(pageSize int64) *ProjectsLocationsTransferConfigsRunsListCall {
  3678  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3679  	return c
  3680  }
  3681  
  3682  // PageToken sets the optional parameter "pageToken": Pagination token, which
  3683  // can be used to request a specific page of `ListTransferRunsRequest` list
  3684  // results. For multiple-page results, `ListTransferRunsResponse` outputs a
  3685  // `next_page` token, which can be used as the `page_token` value to request
  3686  // the next page of list results.
  3687  func (c *ProjectsLocationsTransferConfigsRunsListCall) PageToken(pageToken string) *ProjectsLocationsTransferConfigsRunsListCall {
  3688  	c.urlParams_.Set("pageToken", pageToken)
  3689  	return c
  3690  }
  3691  
  3692  // RunAttempt sets the optional parameter "runAttempt": Indicates how run
  3693  // attempts are to be pulled.
  3694  //
  3695  // Possible values:
  3696  //
  3697  //	"RUN_ATTEMPT_UNSPECIFIED" - All runs should be returned.
  3698  //	"LATEST" - Only latest run per day should be returned.
  3699  func (c *ProjectsLocationsTransferConfigsRunsListCall) RunAttempt(runAttempt string) *ProjectsLocationsTransferConfigsRunsListCall {
  3700  	c.urlParams_.Set("runAttempt", runAttempt)
  3701  	return c
  3702  }
  3703  
  3704  // States sets the optional parameter "states": When specified, only transfer
  3705  // runs with requested states are returned.
  3706  //
  3707  // Possible values:
  3708  //
  3709  //	"TRANSFER_STATE_UNSPECIFIED" - State placeholder (0).
  3710  //	"PENDING" - Data transfer is scheduled and is waiting to be picked up by
  3711  //
  3712  // data transfer backend (2).
  3713  //
  3714  //	"RUNNING" - Data transfer is in progress (3).
  3715  //	"SUCCEEDED" - Data transfer completed successfully (4).
  3716  //	"FAILED" - Data transfer failed (5).
  3717  //	"CANCELLED" - Data transfer is cancelled (6).
  3718  func (c *ProjectsLocationsTransferConfigsRunsListCall) States(states ...string) *ProjectsLocationsTransferConfigsRunsListCall {
  3719  	c.urlParams_.SetMulti("states", append([]string{}, states...))
  3720  	return c
  3721  }
  3722  
  3723  // Fields allows partial responses to be retrieved. See
  3724  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3725  // details.
  3726  func (c *ProjectsLocationsTransferConfigsRunsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsTransferConfigsRunsListCall {
  3727  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3728  	return c
  3729  }
  3730  
  3731  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3732  // object's ETag matches the given value. This is useful for getting updates
  3733  // only after the object has changed since the last request.
  3734  func (c *ProjectsLocationsTransferConfigsRunsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsTransferConfigsRunsListCall {
  3735  	c.ifNoneMatch_ = entityTag
  3736  	return c
  3737  }
  3738  
  3739  // Context sets the context to be used in this call's Do method.
  3740  func (c *ProjectsLocationsTransferConfigsRunsListCall) Context(ctx context.Context) *ProjectsLocationsTransferConfigsRunsListCall {
  3741  	c.ctx_ = ctx
  3742  	return c
  3743  }
  3744  
  3745  // Header returns a http.Header that can be modified by the caller to add
  3746  // headers to the request.
  3747  func (c *ProjectsLocationsTransferConfigsRunsListCall) Header() http.Header {
  3748  	if c.header_ == nil {
  3749  		c.header_ = make(http.Header)
  3750  	}
  3751  	return c.header_
  3752  }
  3753  
  3754  func (c *ProjectsLocationsTransferConfigsRunsListCall) doRequest(alt string) (*http.Response, error) {
  3755  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3756  	if c.ifNoneMatch_ != "" {
  3757  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3758  	}
  3759  	var body io.Reader = nil
  3760  	c.urlParams_.Set("alt", alt)
  3761  	c.urlParams_.Set("prettyPrint", "false")
  3762  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/runs")
  3763  	urls += "?" + c.urlParams_.Encode()
  3764  	req, err := http.NewRequest("GET", urls, body)
  3765  	if err != nil {
  3766  		return nil, err
  3767  	}
  3768  	req.Header = reqHeaders
  3769  	googleapi.Expand(req.URL, map[string]string{
  3770  		"parent": c.parent,
  3771  	})
  3772  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3773  }
  3774  
  3775  // Do executes the "bigquerydatatransfer.projects.locations.transferConfigs.runs.list" call.
  3776  // Any non-2xx status code is an error. Response headers are in either
  3777  // *ListTransferRunsResponse.ServerResponse.Header or (if a response was
  3778  // returned at all) in error.(*googleapi.Error).Header. Use
  3779  // googleapi.IsNotModified to check whether the returned error was because
  3780  // http.StatusNotModified was returned.
  3781  func (c *ProjectsLocationsTransferConfigsRunsListCall) Do(opts ...googleapi.CallOption) (*ListTransferRunsResponse, error) {
  3782  	gensupport.SetOptions(c.urlParams_, opts...)
  3783  	res, err := c.doRequest("json")
  3784  	if res != nil && res.StatusCode == http.StatusNotModified {
  3785  		if res.Body != nil {
  3786  			res.Body.Close()
  3787  		}
  3788  		return nil, gensupport.WrapError(&googleapi.Error{
  3789  			Code:   res.StatusCode,
  3790  			Header: res.Header,
  3791  		})
  3792  	}
  3793  	if err != nil {
  3794  		return nil, err
  3795  	}
  3796  	defer googleapi.CloseBody(res)
  3797  	if err := googleapi.CheckResponse(res); err != nil {
  3798  		return nil, gensupport.WrapError(err)
  3799  	}
  3800  	ret := &ListTransferRunsResponse{
  3801  		ServerResponse: googleapi.ServerResponse{
  3802  			Header:         res.Header,
  3803  			HTTPStatusCode: res.StatusCode,
  3804  		},
  3805  	}
  3806  	target := &ret
  3807  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3808  		return nil, err
  3809  	}
  3810  	return ret, nil
  3811  }
  3812  
  3813  // Pages invokes f for each page of results.
  3814  // A non-nil error returned from f will halt the iteration.
  3815  // The provided context supersedes any context provided to the Context method.
  3816  func (c *ProjectsLocationsTransferConfigsRunsListCall) Pages(ctx context.Context, f func(*ListTransferRunsResponse) error) error {
  3817  	c.ctx_ = ctx
  3818  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  3819  	for {
  3820  		x, err := c.Do()
  3821  		if err != nil {
  3822  			return err
  3823  		}
  3824  		if err := f(x); err != nil {
  3825  			return err
  3826  		}
  3827  		if x.NextPageToken == "" {
  3828  			return nil
  3829  		}
  3830  		c.PageToken(x.NextPageToken)
  3831  	}
  3832  }
  3833  
  3834  type ProjectsLocationsTransferConfigsRunsTransferLogsListCall struct {
  3835  	s            *Service
  3836  	parent       string
  3837  	urlParams_   gensupport.URLParams
  3838  	ifNoneMatch_ string
  3839  	ctx_         context.Context
  3840  	header_      http.Header
  3841  }
  3842  
  3843  // List: Returns log messages for the transfer run.
  3844  //
  3845  //   - parent: Transfer run name in the form:
  3846  //     `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
  3847  //     `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/
  3848  //     runs/{run_id}`.
  3849  func (r *ProjectsLocationsTransferConfigsRunsTransferLogsService) List(parent string) *ProjectsLocationsTransferConfigsRunsTransferLogsListCall {
  3850  	c := &ProjectsLocationsTransferConfigsRunsTransferLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3851  	c.parent = parent
  3852  	return c
  3853  }
  3854  
  3855  // MessageTypes sets the optional parameter "messageTypes": Message types to
  3856  // return. If not populated - INFO, WARNING and ERROR messages are returned.
  3857  //
  3858  // Possible values:
  3859  //
  3860  //	"MESSAGE_SEVERITY_UNSPECIFIED" - No severity specified.
  3861  //	"INFO" - Informational message.
  3862  //	"WARNING" - Warning message.
  3863  //	"ERROR" - Error message.
  3864  func (c *ProjectsLocationsTransferConfigsRunsTransferLogsListCall) MessageTypes(messageTypes ...string) *ProjectsLocationsTransferConfigsRunsTransferLogsListCall {
  3865  	c.urlParams_.SetMulti("messageTypes", append([]string{}, messageTypes...))
  3866  	return c
  3867  }
  3868  
  3869  // PageSize sets the optional parameter "pageSize": Page size. The default page
  3870  // size is the maximum value of 1000 results.
  3871  func (c *ProjectsLocationsTransferConfigsRunsTransferLogsListCall) PageSize(pageSize int64) *ProjectsLocationsTransferConfigsRunsTransferLogsListCall {
  3872  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3873  	return c
  3874  }
  3875  
  3876  // PageToken sets the optional parameter "pageToken": Pagination token, which
  3877  // can be used to request a specific page of `ListTransferLogsRequest` list
  3878  // results. For multiple-page results, `ListTransferLogsResponse` outputs a
  3879  // `next_page` token, which can be used as the `page_token` value to request
  3880  // the next page of list results.
  3881  func (c *ProjectsLocationsTransferConfigsRunsTransferLogsListCall) PageToken(pageToken string) *ProjectsLocationsTransferConfigsRunsTransferLogsListCall {
  3882  	c.urlParams_.Set("pageToken", pageToken)
  3883  	return c
  3884  }
  3885  
  3886  // Fields allows partial responses to be retrieved. See
  3887  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3888  // details.
  3889  func (c *ProjectsLocationsTransferConfigsRunsTransferLogsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsTransferConfigsRunsTransferLogsListCall {
  3890  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3891  	return c
  3892  }
  3893  
  3894  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3895  // object's ETag matches the given value. This is useful for getting updates
  3896  // only after the object has changed since the last request.
  3897  func (c *ProjectsLocationsTransferConfigsRunsTransferLogsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsTransferConfigsRunsTransferLogsListCall {
  3898  	c.ifNoneMatch_ = entityTag
  3899  	return c
  3900  }
  3901  
  3902  // Context sets the context to be used in this call's Do method.
  3903  func (c *ProjectsLocationsTransferConfigsRunsTransferLogsListCall) Context(ctx context.Context) *ProjectsLocationsTransferConfigsRunsTransferLogsListCall {
  3904  	c.ctx_ = ctx
  3905  	return c
  3906  }
  3907  
  3908  // Header returns a http.Header that can be modified by the caller to add
  3909  // headers to the request.
  3910  func (c *ProjectsLocationsTransferConfigsRunsTransferLogsListCall) Header() http.Header {
  3911  	if c.header_ == nil {
  3912  		c.header_ = make(http.Header)
  3913  	}
  3914  	return c.header_
  3915  }
  3916  
  3917  func (c *ProjectsLocationsTransferConfigsRunsTransferLogsListCall) doRequest(alt string) (*http.Response, error) {
  3918  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3919  	if c.ifNoneMatch_ != "" {
  3920  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3921  	}
  3922  	var body io.Reader = nil
  3923  	c.urlParams_.Set("alt", alt)
  3924  	c.urlParams_.Set("prettyPrint", "false")
  3925  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/transferLogs")
  3926  	urls += "?" + c.urlParams_.Encode()
  3927  	req, err := http.NewRequest("GET", urls, body)
  3928  	if err != nil {
  3929  		return nil, err
  3930  	}
  3931  	req.Header = reqHeaders
  3932  	googleapi.Expand(req.URL, map[string]string{
  3933  		"parent": c.parent,
  3934  	})
  3935  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3936  }
  3937  
  3938  // Do executes the "bigquerydatatransfer.projects.locations.transferConfigs.runs.transferLogs.list" call.
  3939  // Any non-2xx status code is an error. Response headers are in either
  3940  // *ListTransferLogsResponse.ServerResponse.Header or (if a response was
  3941  // returned at all) in error.(*googleapi.Error).Header. Use
  3942  // googleapi.IsNotModified to check whether the returned error was because
  3943  // http.StatusNotModified was returned.
  3944  func (c *ProjectsLocationsTransferConfigsRunsTransferLogsListCall) Do(opts ...googleapi.CallOption) (*ListTransferLogsResponse, error) {
  3945  	gensupport.SetOptions(c.urlParams_, opts...)
  3946  	res, err := c.doRequest("json")
  3947  	if res != nil && res.StatusCode == http.StatusNotModified {
  3948  		if res.Body != nil {
  3949  			res.Body.Close()
  3950  		}
  3951  		return nil, gensupport.WrapError(&googleapi.Error{
  3952  			Code:   res.StatusCode,
  3953  			Header: res.Header,
  3954  		})
  3955  	}
  3956  	if err != nil {
  3957  		return nil, err
  3958  	}
  3959  	defer googleapi.CloseBody(res)
  3960  	if err := googleapi.CheckResponse(res); err != nil {
  3961  		return nil, gensupport.WrapError(err)
  3962  	}
  3963  	ret := &ListTransferLogsResponse{
  3964  		ServerResponse: googleapi.ServerResponse{
  3965  			Header:         res.Header,
  3966  			HTTPStatusCode: res.StatusCode,
  3967  		},
  3968  	}
  3969  	target := &ret
  3970  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3971  		return nil, err
  3972  	}
  3973  	return ret, nil
  3974  }
  3975  
  3976  // Pages invokes f for each page of results.
  3977  // A non-nil error returned from f will halt the iteration.
  3978  // The provided context supersedes any context provided to the Context method.
  3979  func (c *ProjectsLocationsTransferConfigsRunsTransferLogsListCall) Pages(ctx context.Context, f func(*ListTransferLogsResponse) error) error {
  3980  	c.ctx_ = ctx
  3981  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  3982  	for {
  3983  		x, err := c.Do()
  3984  		if err != nil {
  3985  			return err
  3986  		}
  3987  		if err := f(x); err != nil {
  3988  			return err
  3989  		}
  3990  		if x.NextPageToken == "" {
  3991  			return nil
  3992  		}
  3993  		c.PageToken(x.NextPageToken)
  3994  	}
  3995  }
  3996  
  3997  type ProjectsTransferConfigsCreateCall struct {
  3998  	s              *Service
  3999  	parent         string
  4000  	transferconfig *TransferConfig
  4001  	urlParams_     gensupport.URLParams
  4002  	ctx_           context.Context
  4003  	header_        http.Header
  4004  }
  4005  
  4006  // Create: Creates a new data transfer configuration.
  4007  //
  4008  //   - parent: The BigQuery project id where the transfer configuration should be
  4009  //     created. Must be in the format
  4010  //     projects/{project_id}/locations/{location_id} or projects/{project_id}. If
  4011  //     specified location and location of the destination bigquery dataset do not
  4012  //     match - the request will fail.
  4013  func (r *ProjectsTransferConfigsService) Create(parent string, transferconfig *TransferConfig) *ProjectsTransferConfigsCreateCall {
  4014  	c := &ProjectsTransferConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4015  	c.parent = parent
  4016  	c.transferconfig = transferconfig
  4017  	return c
  4018  }
  4019  
  4020  // AuthorizationCode sets the optional parameter "authorizationCode": Optional
  4021  // OAuth2 authorization code to use with this transfer configuration. This is
  4022  // required only if `transferConfig.dataSourceId` is 'youtube_channel' and new
  4023  // credentials are needed, as indicated by `CheckValidCreds`. In order to
  4024  // obtain authorization_code, make a request to the following URL:
  4025  // https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
  4026  // * The client_id is the OAuth client_id of the a data source as returned by
  4027  // ListDataSources method. * data_source_scopes are the scopes returned by
  4028  // ListDataSources method. Note that this should not be set when
  4029  // `service_account_name` is used to create the transfer config.
  4030  func (c *ProjectsTransferConfigsCreateCall) AuthorizationCode(authorizationCode string) *ProjectsTransferConfigsCreateCall {
  4031  	c.urlParams_.Set("authorizationCode", authorizationCode)
  4032  	return c
  4033  }
  4034  
  4035  // ServiceAccountName sets the optional parameter "serviceAccountName":
  4036  // Optional service account email. If this field is set, the transfer config
  4037  // will be created with this service account's credentials. It requires that
  4038  // the requesting user calling this API has permissions to act as this service
  4039  // account. Note that not all data sources support service account credentials
  4040  // when creating a transfer config. For the latest list of data sources, read
  4041  // about using service accounts
  4042  // (https://cloud.google.com/bigquery-transfer/docs/use-service-accounts).
  4043  func (c *ProjectsTransferConfigsCreateCall) ServiceAccountName(serviceAccountName string) *ProjectsTransferConfigsCreateCall {
  4044  	c.urlParams_.Set("serviceAccountName", serviceAccountName)
  4045  	return c
  4046  }
  4047  
  4048  // VersionInfo sets the optional parameter "versionInfo": Optional version
  4049  // info. This is required only if `transferConfig.dataSourceId` is not
  4050  // 'youtube_channel' and new credentials are needed, as indicated by
  4051  // `CheckValidCreds`. In order to obtain version info, make a request to the
  4052  // following URL:
  4053  // https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
  4054  // * The client_id is the OAuth client_id of the a data source as returned by
  4055  // ListDataSources method. * data_source_scopes are the scopes returned by
  4056  // ListDataSources method. Note that this should not be set when
  4057  // `service_account_name` is used to create the transfer config.
  4058  func (c *ProjectsTransferConfigsCreateCall) VersionInfo(versionInfo string) *ProjectsTransferConfigsCreateCall {
  4059  	c.urlParams_.Set("versionInfo", versionInfo)
  4060  	return c
  4061  }
  4062  
  4063  // Fields allows partial responses to be retrieved. See
  4064  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4065  // details.
  4066  func (c *ProjectsTransferConfigsCreateCall) Fields(s ...googleapi.Field) *ProjectsTransferConfigsCreateCall {
  4067  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4068  	return c
  4069  }
  4070  
  4071  // Context sets the context to be used in this call's Do method.
  4072  func (c *ProjectsTransferConfigsCreateCall) Context(ctx context.Context) *ProjectsTransferConfigsCreateCall {
  4073  	c.ctx_ = ctx
  4074  	return c
  4075  }
  4076  
  4077  // Header returns a http.Header that can be modified by the caller to add
  4078  // headers to the request.
  4079  func (c *ProjectsTransferConfigsCreateCall) Header() http.Header {
  4080  	if c.header_ == nil {
  4081  		c.header_ = make(http.Header)
  4082  	}
  4083  	return c.header_
  4084  }
  4085  
  4086  func (c *ProjectsTransferConfigsCreateCall) doRequest(alt string) (*http.Response, error) {
  4087  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4088  	var body io.Reader = nil
  4089  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.transferconfig)
  4090  	if err != nil {
  4091  		return nil, err
  4092  	}
  4093  	c.urlParams_.Set("alt", alt)
  4094  	c.urlParams_.Set("prettyPrint", "false")
  4095  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/transferConfigs")
  4096  	urls += "?" + c.urlParams_.Encode()
  4097  	req, err := http.NewRequest("POST", urls, body)
  4098  	if err != nil {
  4099  		return nil, err
  4100  	}
  4101  	req.Header = reqHeaders
  4102  	googleapi.Expand(req.URL, map[string]string{
  4103  		"parent": c.parent,
  4104  	})
  4105  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4106  }
  4107  
  4108  // Do executes the "bigquerydatatransfer.projects.transferConfigs.create" call.
  4109  // Any non-2xx status code is an error. Response headers are in either
  4110  // *TransferConfig.ServerResponse.Header or (if a response was returned at all)
  4111  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4112  // whether the returned error was because http.StatusNotModified was returned.
  4113  func (c *ProjectsTransferConfigsCreateCall) Do(opts ...googleapi.CallOption) (*TransferConfig, error) {
  4114  	gensupport.SetOptions(c.urlParams_, opts...)
  4115  	res, err := c.doRequest("json")
  4116  	if res != nil && res.StatusCode == http.StatusNotModified {
  4117  		if res.Body != nil {
  4118  			res.Body.Close()
  4119  		}
  4120  		return nil, gensupport.WrapError(&googleapi.Error{
  4121  			Code:   res.StatusCode,
  4122  			Header: res.Header,
  4123  		})
  4124  	}
  4125  	if err != nil {
  4126  		return nil, err
  4127  	}
  4128  	defer googleapi.CloseBody(res)
  4129  	if err := googleapi.CheckResponse(res); err != nil {
  4130  		return nil, gensupport.WrapError(err)
  4131  	}
  4132  	ret := &TransferConfig{
  4133  		ServerResponse: googleapi.ServerResponse{
  4134  			Header:         res.Header,
  4135  			HTTPStatusCode: res.StatusCode,
  4136  		},
  4137  	}
  4138  	target := &ret
  4139  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4140  		return nil, err
  4141  	}
  4142  	return ret, nil
  4143  }
  4144  
  4145  type ProjectsTransferConfigsDeleteCall struct {
  4146  	s          *Service
  4147  	name       string
  4148  	urlParams_ gensupport.URLParams
  4149  	ctx_       context.Context
  4150  	header_    http.Header
  4151  }
  4152  
  4153  // Delete: Deletes a data transfer configuration, including any associated
  4154  // transfer runs and logs.
  4155  //
  4156  //   - name: The field will contain name of the resource requested, for example:
  4157  //     `projects/{project_id}/transferConfigs/{config_id}` or
  4158  //     `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
  4159  func (r *ProjectsTransferConfigsService) Delete(name string) *ProjectsTransferConfigsDeleteCall {
  4160  	c := &ProjectsTransferConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4161  	c.name = name
  4162  	return c
  4163  }
  4164  
  4165  // Fields allows partial responses to be retrieved. See
  4166  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4167  // details.
  4168  func (c *ProjectsTransferConfigsDeleteCall) Fields(s ...googleapi.Field) *ProjectsTransferConfigsDeleteCall {
  4169  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4170  	return c
  4171  }
  4172  
  4173  // Context sets the context to be used in this call's Do method.
  4174  func (c *ProjectsTransferConfigsDeleteCall) Context(ctx context.Context) *ProjectsTransferConfigsDeleteCall {
  4175  	c.ctx_ = ctx
  4176  	return c
  4177  }
  4178  
  4179  // Header returns a http.Header that can be modified by the caller to add
  4180  // headers to the request.
  4181  func (c *ProjectsTransferConfigsDeleteCall) Header() http.Header {
  4182  	if c.header_ == nil {
  4183  		c.header_ = make(http.Header)
  4184  	}
  4185  	return c.header_
  4186  }
  4187  
  4188  func (c *ProjectsTransferConfigsDeleteCall) doRequest(alt string) (*http.Response, error) {
  4189  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4190  	var body io.Reader = nil
  4191  	c.urlParams_.Set("alt", alt)
  4192  	c.urlParams_.Set("prettyPrint", "false")
  4193  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  4194  	urls += "?" + c.urlParams_.Encode()
  4195  	req, err := http.NewRequest("DELETE", urls, body)
  4196  	if err != nil {
  4197  		return nil, err
  4198  	}
  4199  	req.Header = reqHeaders
  4200  	googleapi.Expand(req.URL, map[string]string{
  4201  		"name": c.name,
  4202  	})
  4203  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4204  }
  4205  
  4206  // Do executes the "bigquerydatatransfer.projects.transferConfigs.delete" call.
  4207  // Any non-2xx status code is an error. Response headers are in either
  4208  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  4209  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4210  // whether the returned error was because http.StatusNotModified was returned.
  4211  func (c *ProjectsTransferConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  4212  	gensupport.SetOptions(c.urlParams_, opts...)
  4213  	res, err := c.doRequest("json")
  4214  	if res != nil && res.StatusCode == http.StatusNotModified {
  4215  		if res.Body != nil {
  4216  			res.Body.Close()
  4217  		}
  4218  		return nil, gensupport.WrapError(&googleapi.Error{
  4219  			Code:   res.StatusCode,
  4220  			Header: res.Header,
  4221  		})
  4222  	}
  4223  	if err != nil {
  4224  		return nil, err
  4225  	}
  4226  	defer googleapi.CloseBody(res)
  4227  	if err := googleapi.CheckResponse(res); err != nil {
  4228  		return nil, gensupport.WrapError(err)
  4229  	}
  4230  	ret := &Empty{
  4231  		ServerResponse: googleapi.ServerResponse{
  4232  			Header:         res.Header,
  4233  			HTTPStatusCode: res.StatusCode,
  4234  		},
  4235  	}
  4236  	target := &ret
  4237  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4238  		return nil, err
  4239  	}
  4240  	return ret, nil
  4241  }
  4242  
  4243  type ProjectsTransferConfigsGetCall struct {
  4244  	s            *Service
  4245  	name         string
  4246  	urlParams_   gensupport.URLParams
  4247  	ifNoneMatch_ string
  4248  	ctx_         context.Context
  4249  	header_      http.Header
  4250  }
  4251  
  4252  // Get: Returns information about a data transfer config.
  4253  //
  4254  //   - name: The field will contain name of the resource requested, for example:
  4255  //     `projects/{project_id}/transferConfigs/{config_id}` or
  4256  //     `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
  4257  func (r *ProjectsTransferConfigsService) Get(name string) *ProjectsTransferConfigsGetCall {
  4258  	c := &ProjectsTransferConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4259  	c.name = name
  4260  	return c
  4261  }
  4262  
  4263  // Fields allows partial responses to be retrieved. See
  4264  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4265  // details.
  4266  func (c *ProjectsTransferConfigsGetCall) Fields(s ...googleapi.Field) *ProjectsTransferConfigsGetCall {
  4267  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4268  	return c
  4269  }
  4270  
  4271  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4272  // object's ETag matches the given value. This is useful for getting updates
  4273  // only after the object has changed since the last request.
  4274  func (c *ProjectsTransferConfigsGetCall) IfNoneMatch(entityTag string) *ProjectsTransferConfigsGetCall {
  4275  	c.ifNoneMatch_ = entityTag
  4276  	return c
  4277  }
  4278  
  4279  // Context sets the context to be used in this call's Do method.
  4280  func (c *ProjectsTransferConfigsGetCall) Context(ctx context.Context) *ProjectsTransferConfigsGetCall {
  4281  	c.ctx_ = ctx
  4282  	return c
  4283  }
  4284  
  4285  // Header returns a http.Header that can be modified by the caller to add
  4286  // headers to the request.
  4287  func (c *ProjectsTransferConfigsGetCall) Header() http.Header {
  4288  	if c.header_ == nil {
  4289  		c.header_ = make(http.Header)
  4290  	}
  4291  	return c.header_
  4292  }
  4293  
  4294  func (c *ProjectsTransferConfigsGetCall) doRequest(alt string) (*http.Response, error) {
  4295  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4296  	if c.ifNoneMatch_ != "" {
  4297  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4298  	}
  4299  	var body io.Reader = nil
  4300  	c.urlParams_.Set("alt", alt)
  4301  	c.urlParams_.Set("prettyPrint", "false")
  4302  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  4303  	urls += "?" + c.urlParams_.Encode()
  4304  	req, err := http.NewRequest("GET", urls, body)
  4305  	if err != nil {
  4306  		return nil, err
  4307  	}
  4308  	req.Header = reqHeaders
  4309  	googleapi.Expand(req.URL, map[string]string{
  4310  		"name": c.name,
  4311  	})
  4312  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4313  }
  4314  
  4315  // Do executes the "bigquerydatatransfer.projects.transferConfigs.get" call.
  4316  // Any non-2xx status code is an error. Response headers are in either
  4317  // *TransferConfig.ServerResponse.Header or (if a response was returned at all)
  4318  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4319  // whether the returned error was because http.StatusNotModified was returned.
  4320  func (c *ProjectsTransferConfigsGetCall) Do(opts ...googleapi.CallOption) (*TransferConfig, error) {
  4321  	gensupport.SetOptions(c.urlParams_, opts...)
  4322  	res, err := c.doRequest("json")
  4323  	if res != nil && res.StatusCode == http.StatusNotModified {
  4324  		if res.Body != nil {
  4325  			res.Body.Close()
  4326  		}
  4327  		return nil, gensupport.WrapError(&googleapi.Error{
  4328  			Code:   res.StatusCode,
  4329  			Header: res.Header,
  4330  		})
  4331  	}
  4332  	if err != nil {
  4333  		return nil, err
  4334  	}
  4335  	defer googleapi.CloseBody(res)
  4336  	if err := googleapi.CheckResponse(res); err != nil {
  4337  		return nil, gensupport.WrapError(err)
  4338  	}
  4339  	ret := &TransferConfig{
  4340  		ServerResponse: googleapi.ServerResponse{
  4341  			Header:         res.Header,
  4342  			HTTPStatusCode: res.StatusCode,
  4343  		},
  4344  	}
  4345  	target := &ret
  4346  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4347  		return nil, err
  4348  	}
  4349  	return ret, nil
  4350  }
  4351  
  4352  type ProjectsTransferConfigsListCall struct {
  4353  	s            *Service
  4354  	parent       string
  4355  	urlParams_   gensupport.URLParams
  4356  	ifNoneMatch_ string
  4357  	ctx_         context.Context
  4358  	header_      http.Header
  4359  }
  4360  
  4361  // List: Returns information about all transfer configs owned by a project in
  4362  // the specified location.
  4363  //
  4364  //   - parent: The BigQuery project id for which transfer configs should be
  4365  //     returned: `projects/{project_id}` or
  4366  //     `projects/{project_id}/locations/{location_id}`.
  4367  func (r *ProjectsTransferConfigsService) List(parent string) *ProjectsTransferConfigsListCall {
  4368  	c := &ProjectsTransferConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4369  	c.parent = parent
  4370  	return c
  4371  }
  4372  
  4373  // DataSourceIds sets the optional parameter "dataSourceIds": When specified,
  4374  // only configurations of requested data sources are returned.
  4375  func (c *ProjectsTransferConfigsListCall) DataSourceIds(dataSourceIds ...string) *ProjectsTransferConfigsListCall {
  4376  	c.urlParams_.SetMulti("dataSourceIds", append([]string{}, dataSourceIds...))
  4377  	return c
  4378  }
  4379  
  4380  // PageSize sets the optional parameter "pageSize": Page size. The default page
  4381  // size is the maximum value of 1000 results.
  4382  func (c *ProjectsTransferConfigsListCall) PageSize(pageSize int64) *ProjectsTransferConfigsListCall {
  4383  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  4384  	return c
  4385  }
  4386  
  4387  // PageToken sets the optional parameter "pageToken": Pagination token, which
  4388  // can be used to request a specific page of `ListTransfersRequest` list
  4389  // results. For multiple-page results, `ListTransfersResponse` outputs a
  4390  // `next_page` token, which can be used as the `page_token` value to request
  4391  // the next page of list results.
  4392  func (c *ProjectsTransferConfigsListCall) PageToken(pageToken string) *ProjectsTransferConfigsListCall {
  4393  	c.urlParams_.Set("pageToken", pageToken)
  4394  	return c
  4395  }
  4396  
  4397  // Fields allows partial responses to be retrieved. See
  4398  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4399  // details.
  4400  func (c *ProjectsTransferConfigsListCall) Fields(s ...googleapi.Field) *ProjectsTransferConfigsListCall {
  4401  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4402  	return c
  4403  }
  4404  
  4405  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4406  // object's ETag matches the given value. This is useful for getting updates
  4407  // only after the object has changed since the last request.
  4408  func (c *ProjectsTransferConfigsListCall) IfNoneMatch(entityTag string) *ProjectsTransferConfigsListCall {
  4409  	c.ifNoneMatch_ = entityTag
  4410  	return c
  4411  }
  4412  
  4413  // Context sets the context to be used in this call's Do method.
  4414  func (c *ProjectsTransferConfigsListCall) Context(ctx context.Context) *ProjectsTransferConfigsListCall {
  4415  	c.ctx_ = ctx
  4416  	return c
  4417  }
  4418  
  4419  // Header returns a http.Header that can be modified by the caller to add
  4420  // headers to the request.
  4421  func (c *ProjectsTransferConfigsListCall) Header() http.Header {
  4422  	if c.header_ == nil {
  4423  		c.header_ = make(http.Header)
  4424  	}
  4425  	return c.header_
  4426  }
  4427  
  4428  func (c *ProjectsTransferConfigsListCall) doRequest(alt string) (*http.Response, error) {
  4429  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4430  	if c.ifNoneMatch_ != "" {
  4431  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4432  	}
  4433  	var body io.Reader = nil
  4434  	c.urlParams_.Set("alt", alt)
  4435  	c.urlParams_.Set("prettyPrint", "false")
  4436  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/transferConfigs")
  4437  	urls += "?" + c.urlParams_.Encode()
  4438  	req, err := http.NewRequest("GET", urls, body)
  4439  	if err != nil {
  4440  		return nil, err
  4441  	}
  4442  	req.Header = reqHeaders
  4443  	googleapi.Expand(req.URL, map[string]string{
  4444  		"parent": c.parent,
  4445  	})
  4446  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4447  }
  4448  
  4449  // Do executes the "bigquerydatatransfer.projects.transferConfigs.list" call.
  4450  // Any non-2xx status code is an error. Response headers are in either
  4451  // *ListTransferConfigsResponse.ServerResponse.Header or (if a response was
  4452  // returned at all) in error.(*googleapi.Error).Header. Use
  4453  // googleapi.IsNotModified to check whether the returned error was because
  4454  // http.StatusNotModified was returned.
  4455  func (c *ProjectsTransferConfigsListCall) Do(opts ...googleapi.CallOption) (*ListTransferConfigsResponse, error) {
  4456  	gensupport.SetOptions(c.urlParams_, opts...)
  4457  	res, err := c.doRequest("json")
  4458  	if res != nil && res.StatusCode == http.StatusNotModified {
  4459  		if res.Body != nil {
  4460  			res.Body.Close()
  4461  		}
  4462  		return nil, gensupport.WrapError(&googleapi.Error{
  4463  			Code:   res.StatusCode,
  4464  			Header: res.Header,
  4465  		})
  4466  	}
  4467  	if err != nil {
  4468  		return nil, err
  4469  	}
  4470  	defer googleapi.CloseBody(res)
  4471  	if err := googleapi.CheckResponse(res); err != nil {
  4472  		return nil, gensupport.WrapError(err)
  4473  	}
  4474  	ret := &ListTransferConfigsResponse{
  4475  		ServerResponse: googleapi.ServerResponse{
  4476  			Header:         res.Header,
  4477  			HTTPStatusCode: res.StatusCode,
  4478  		},
  4479  	}
  4480  	target := &ret
  4481  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4482  		return nil, err
  4483  	}
  4484  	return ret, nil
  4485  }
  4486  
  4487  // Pages invokes f for each page of results.
  4488  // A non-nil error returned from f will halt the iteration.
  4489  // The provided context supersedes any context provided to the Context method.
  4490  func (c *ProjectsTransferConfigsListCall) Pages(ctx context.Context, f func(*ListTransferConfigsResponse) error) error {
  4491  	c.ctx_ = ctx
  4492  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  4493  	for {
  4494  		x, err := c.Do()
  4495  		if err != nil {
  4496  			return err
  4497  		}
  4498  		if err := f(x); err != nil {
  4499  			return err
  4500  		}
  4501  		if x.NextPageToken == "" {
  4502  			return nil
  4503  		}
  4504  		c.PageToken(x.NextPageToken)
  4505  	}
  4506  }
  4507  
  4508  type ProjectsTransferConfigsPatchCall struct {
  4509  	s              *Service
  4510  	name           string
  4511  	transferconfig *TransferConfig
  4512  	urlParams_     gensupport.URLParams
  4513  	ctx_           context.Context
  4514  	header_        http.Header
  4515  }
  4516  
  4517  // Patch: Updates a data transfer configuration. All fields must be set, even
  4518  // if they are not updated.
  4519  //
  4520  //   - name: Identifier. The resource name of the transfer config. Transfer
  4521  //     config names have the form either
  4522  //     `projects/{project_id}/locations/{region}/transferConfigs/{config_id}` or
  4523  //     `projects/{project_id}/transferConfigs/{config_id}`, where `config_id` is
  4524  //     usually a UUID, even though it is not guaranteed or required. The name is
  4525  //     ignored when creating a transfer config.
  4526  func (r *ProjectsTransferConfigsService) Patch(name string, transferconfig *TransferConfig) *ProjectsTransferConfigsPatchCall {
  4527  	c := &ProjectsTransferConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4528  	c.name = name
  4529  	c.transferconfig = transferconfig
  4530  	return c
  4531  }
  4532  
  4533  // AuthorizationCode sets the optional parameter "authorizationCode": Optional
  4534  // OAuth2 authorization code to use with this transfer configuration. This is
  4535  // required only if `transferConfig.dataSourceId` is 'youtube_channel' and new
  4536  // credentials are needed, as indicated by `CheckValidCreds`. In order to
  4537  // obtain authorization_code, make a request to the following URL:
  4538  // https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
  4539  // * The client_id is the OAuth client_id of the a data source as returned by
  4540  // ListDataSources method. * data_source_scopes are the scopes returned by
  4541  // ListDataSources method. Note that this should not be set when
  4542  // `service_account_name` is used to update the transfer config.
  4543  func (c *ProjectsTransferConfigsPatchCall) AuthorizationCode(authorizationCode string) *ProjectsTransferConfigsPatchCall {
  4544  	c.urlParams_.Set("authorizationCode", authorizationCode)
  4545  	return c
  4546  }
  4547  
  4548  // ServiceAccountName sets the optional parameter "serviceAccountName":
  4549  // Optional service account email. If this field is set, the transfer config
  4550  // will be created with this service account's credentials. It requires that
  4551  // the requesting user calling this API has permissions to act as this service
  4552  // account. Note that not all data sources support service account credentials
  4553  // when creating a transfer config. For the latest list of data sources, read
  4554  // about using service accounts
  4555  // (https://cloud.google.com/bigquery-transfer/docs/use-service-accounts).
  4556  func (c *ProjectsTransferConfigsPatchCall) ServiceAccountName(serviceAccountName string) *ProjectsTransferConfigsPatchCall {
  4557  	c.urlParams_.Set("serviceAccountName", serviceAccountName)
  4558  	return c
  4559  }
  4560  
  4561  // UpdateMask sets the optional parameter "updateMask": Required. Required list
  4562  // of fields to be updated in this request.
  4563  func (c *ProjectsTransferConfigsPatchCall) UpdateMask(updateMask string) *ProjectsTransferConfigsPatchCall {
  4564  	c.urlParams_.Set("updateMask", updateMask)
  4565  	return c
  4566  }
  4567  
  4568  // VersionInfo sets the optional parameter "versionInfo": Optional version
  4569  // info. This is required only if `transferConfig.dataSourceId` is not
  4570  // 'youtube_channel' and new credentials are needed, as indicated by
  4571  // `CheckValidCreds`. In order to obtain version info, make a request to the
  4572  // following URL:
  4573  // https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
  4574  // * The client_id is the OAuth client_id of the a data source as returned by
  4575  // ListDataSources method. * data_source_scopes are the scopes returned by
  4576  // ListDataSources method. Note that this should not be set when
  4577  // `service_account_name` is used to update the transfer config.
  4578  func (c *ProjectsTransferConfigsPatchCall) VersionInfo(versionInfo string) *ProjectsTransferConfigsPatchCall {
  4579  	c.urlParams_.Set("versionInfo", versionInfo)
  4580  	return c
  4581  }
  4582  
  4583  // Fields allows partial responses to be retrieved. See
  4584  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4585  // details.
  4586  func (c *ProjectsTransferConfigsPatchCall) Fields(s ...googleapi.Field) *ProjectsTransferConfigsPatchCall {
  4587  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4588  	return c
  4589  }
  4590  
  4591  // Context sets the context to be used in this call's Do method.
  4592  func (c *ProjectsTransferConfigsPatchCall) Context(ctx context.Context) *ProjectsTransferConfigsPatchCall {
  4593  	c.ctx_ = ctx
  4594  	return c
  4595  }
  4596  
  4597  // Header returns a http.Header that can be modified by the caller to add
  4598  // headers to the request.
  4599  func (c *ProjectsTransferConfigsPatchCall) Header() http.Header {
  4600  	if c.header_ == nil {
  4601  		c.header_ = make(http.Header)
  4602  	}
  4603  	return c.header_
  4604  }
  4605  
  4606  func (c *ProjectsTransferConfigsPatchCall) doRequest(alt string) (*http.Response, error) {
  4607  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4608  	var body io.Reader = nil
  4609  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.transferconfig)
  4610  	if err != nil {
  4611  		return nil, err
  4612  	}
  4613  	c.urlParams_.Set("alt", alt)
  4614  	c.urlParams_.Set("prettyPrint", "false")
  4615  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  4616  	urls += "?" + c.urlParams_.Encode()
  4617  	req, err := http.NewRequest("PATCH", urls, body)
  4618  	if err != nil {
  4619  		return nil, err
  4620  	}
  4621  	req.Header = reqHeaders
  4622  	googleapi.Expand(req.URL, map[string]string{
  4623  		"name": c.name,
  4624  	})
  4625  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4626  }
  4627  
  4628  // Do executes the "bigquerydatatransfer.projects.transferConfigs.patch" call.
  4629  // Any non-2xx status code is an error. Response headers are in either
  4630  // *TransferConfig.ServerResponse.Header or (if a response was returned at all)
  4631  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4632  // whether the returned error was because http.StatusNotModified was returned.
  4633  func (c *ProjectsTransferConfigsPatchCall) Do(opts ...googleapi.CallOption) (*TransferConfig, error) {
  4634  	gensupport.SetOptions(c.urlParams_, opts...)
  4635  	res, err := c.doRequest("json")
  4636  	if res != nil && res.StatusCode == http.StatusNotModified {
  4637  		if res.Body != nil {
  4638  			res.Body.Close()
  4639  		}
  4640  		return nil, gensupport.WrapError(&googleapi.Error{
  4641  			Code:   res.StatusCode,
  4642  			Header: res.Header,
  4643  		})
  4644  	}
  4645  	if err != nil {
  4646  		return nil, err
  4647  	}
  4648  	defer googleapi.CloseBody(res)
  4649  	if err := googleapi.CheckResponse(res); err != nil {
  4650  		return nil, gensupport.WrapError(err)
  4651  	}
  4652  	ret := &TransferConfig{
  4653  		ServerResponse: googleapi.ServerResponse{
  4654  			Header:         res.Header,
  4655  			HTTPStatusCode: res.StatusCode,
  4656  		},
  4657  	}
  4658  	target := &ret
  4659  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4660  		return nil, err
  4661  	}
  4662  	return ret, nil
  4663  }
  4664  
  4665  type ProjectsTransferConfigsScheduleRunsCall struct {
  4666  	s                           *Service
  4667  	parent                      string
  4668  	scheduletransferrunsrequest *ScheduleTransferRunsRequest
  4669  	urlParams_                  gensupport.URLParams
  4670  	ctx_                        context.Context
  4671  	header_                     http.Header
  4672  }
  4673  
  4674  // ScheduleRuns: Creates transfer runs for a time range [start_time, end_time].
  4675  // For each date - or whatever granularity the data source supports - in the
  4676  // range, one transfer run is created. Note that runs are created per UTC time
  4677  // in the time range. DEPRECATED: use StartManualTransferRuns instead.
  4678  //
  4679  //   - parent: Transfer configuration name in the form:
  4680  //     `projects/{project_id}/transferConfigs/{config_id}` or
  4681  //     `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
  4682  //     .
  4683  func (r *ProjectsTransferConfigsService) ScheduleRuns(parent string, scheduletransferrunsrequest *ScheduleTransferRunsRequest) *ProjectsTransferConfigsScheduleRunsCall {
  4684  	c := &ProjectsTransferConfigsScheduleRunsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4685  	c.parent = parent
  4686  	c.scheduletransferrunsrequest = scheduletransferrunsrequest
  4687  	return c
  4688  }
  4689  
  4690  // Fields allows partial responses to be retrieved. See
  4691  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4692  // details.
  4693  func (c *ProjectsTransferConfigsScheduleRunsCall) Fields(s ...googleapi.Field) *ProjectsTransferConfigsScheduleRunsCall {
  4694  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4695  	return c
  4696  }
  4697  
  4698  // Context sets the context to be used in this call's Do method.
  4699  func (c *ProjectsTransferConfigsScheduleRunsCall) Context(ctx context.Context) *ProjectsTransferConfigsScheduleRunsCall {
  4700  	c.ctx_ = ctx
  4701  	return c
  4702  }
  4703  
  4704  // Header returns a http.Header that can be modified by the caller to add
  4705  // headers to the request.
  4706  func (c *ProjectsTransferConfigsScheduleRunsCall) Header() http.Header {
  4707  	if c.header_ == nil {
  4708  		c.header_ = make(http.Header)
  4709  	}
  4710  	return c.header_
  4711  }
  4712  
  4713  func (c *ProjectsTransferConfigsScheduleRunsCall) doRequest(alt string) (*http.Response, error) {
  4714  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4715  	var body io.Reader = nil
  4716  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.scheduletransferrunsrequest)
  4717  	if err != nil {
  4718  		return nil, err
  4719  	}
  4720  	c.urlParams_.Set("alt", alt)
  4721  	c.urlParams_.Set("prettyPrint", "false")
  4722  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}:scheduleRuns")
  4723  	urls += "?" + c.urlParams_.Encode()
  4724  	req, err := http.NewRequest("POST", urls, body)
  4725  	if err != nil {
  4726  		return nil, err
  4727  	}
  4728  	req.Header = reqHeaders
  4729  	googleapi.Expand(req.URL, map[string]string{
  4730  		"parent": c.parent,
  4731  	})
  4732  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4733  }
  4734  
  4735  // Do executes the "bigquerydatatransfer.projects.transferConfigs.scheduleRuns" call.
  4736  // Any non-2xx status code is an error. Response headers are in either
  4737  // *ScheduleTransferRunsResponse.ServerResponse.Header or (if a response was
  4738  // returned at all) in error.(*googleapi.Error).Header. Use
  4739  // googleapi.IsNotModified to check whether the returned error was because
  4740  // http.StatusNotModified was returned.
  4741  func (c *ProjectsTransferConfigsScheduleRunsCall) Do(opts ...googleapi.CallOption) (*ScheduleTransferRunsResponse, error) {
  4742  	gensupport.SetOptions(c.urlParams_, opts...)
  4743  	res, err := c.doRequest("json")
  4744  	if res != nil && res.StatusCode == http.StatusNotModified {
  4745  		if res.Body != nil {
  4746  			res.Body.Close()
  4747  		}
  4748  		return nil, gensupport.WrapError(&googleapi.Error{
  4749  			Code:   res.StatusCode,
  4750  			Header: res.Header,
  4751  		})
  4752  	}
  4753  	if err != nil {
  4754  		return nil, err
  4755  	}
  4756  	defer googleapi.CloseBody(res)
  4757  	if err := googleapi.CheckResponse(res); err != nil {
  4758  		return nil, gensupport.WrapError(err)
  4759  	}
  4760  	ret := &ScheduleTransferRunsResponse{
  4761  		ServerResponse: googleapi.ServerResponse{
  4762  			Header:         res.Header,
  4763  			HTTPStatusCode: res.StatusCode,
  4764  		},
  4765  	}
  4766  	target := &ret
  4767  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4768  		return nil, err
  4769  	}
  4770  	return ret, nil
  4771  }
  4772  
  4773  type ProjectsTransferConfigsStartManualRunsCall struct {
  4774  	s                              *Service
  4775  	parent                         string
  4776  	startmanualtransferrunsrequest *StartManualTransferRunsRequest
  4777  	urlParams_                     gensupport.URLParams
  4778  	ctx_                           context.Context
  4779  	header_                        http.Header
  4780  }
  4781  
  4782  // StartManualRuns: Start manual transfer runs to be executed now with
  4783  // schedule_time equal to current time. The transfer runs can be created for a
  4784  // time range where the run_time is between start_time (inclusive) and end_time
  4785  // (exclusive), or for a specific run_time.
  4786  //
  4787  //   - parent: Transfer configuration name in the form:
  4788  //     `projects/{project_id}/transferConfigs/{config_id}` or
  4789  //     `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
  4790  //     .
  4791  func (r *ProjectsTransferConfigsService) StartManualRuns(parent string, startmanualtransferrunsrequest *StartManualTransferRunsRequest) *ProjectsTransferConfigsStartManualRunsCall {
  4792  	c := &ProjectsTransferConfigsStartManualRunsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4793  	c.parent = parent
  4794  	c.startmanualtransferrunsrequest = startmanualtransferrunsrequest
  4795  	return c
  4796  }
  4797  
  4798  // Fields allows partial responses to be retrieved. See
  4799  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4800  // details.
  4801  func (c *ProjectsTransferConfigsStartManualRunsCall) Fields(s ...googleapi.Field) *ProjectsTransferConfigsStartManualRunsCall {
  4802  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4803  	return c
  4804  }
  4805  
  4806  // Context sets the context to be used in this call's Do method.
  4807  func (c *ProjectsTransferConfigsStartManualRunsCall) Context(ctx context.Context) *ProjectsTransferConfigsStartManualRunsCall {
  4808  	c.ctx_ = ctx
  4809  	return c
  4810  }
  4811  
  4812  // Header returns a http.Header that can be modified by the caller to add
  4813  // headers to the request.
  4814  func (c *ProjectsTransferConfigsStartManualRunsCall) Header() http.Header {
  4815  	if c.header_ == nil {
  4816  		c.header_ = make(http.Header)
  4817  	}
  4818  	return c.header_
  4819  }
  4820  
  4821  func (c *ProjectsTransferConfigsStartManualRunsCall) doRequest(alt string) (*http.Response, error) {
  4822  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4823  	var body io.Reader = nil
  4824  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.startmanualtransferrunsrequest)
  4825  	if err != nil {
  4826  		return nil, err
  4827  	}
  4828  	c.urlParams_.Set("alt", alt)
  4829  	c.urlParams_.Set("prettyPrint", "false")
  4830  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}:startManualRuns")
  4831  	urls += "?" + c.urlParams_.Encode()
  4832  	req, err := http.NewRequest("POST", urls, body)
  4833  	if err != nil {
  4834  		return nil, err
  4835  	}
  4836  	req.Header = reqHeaders
  4837  	googleapi.Expand(req.URL, map[string]string{
  4838  		"parent": c.parent,
  4839  	})
  4840  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4841  }
  4842  
  4843  // Do executes the "bigquerydatatransfer.projects.transferConfigs.startManualRuns" call.
  4844  // Any non-2xx status code is an error. Response headers are in either
  4845  // *StartManualTransferRunsResponse.ServerResponse.Header or (if a response was
  4846  // returned at all) in error.(*googleapi.Error).Header. Use
  4847  // googleapi.IsNotModified to check whether the returned error was because
  4848  // http.StatusNotModified was returned.
  4849  func (c *ProjectsTransferConfigsStartManualRunsCall) Do(opts ...googleapi.CallOption) (*StartManualTransferRunsResponse, error) {
  4850  	gensupport.SetOptions(c.urlParams_, opts...)
  4851  	res, err := c.doRequest("json")
  4852  	if res != nil && res.StatusCode == http.StatusNotModified {
  4853  		if res.Body != nil {
  4854  			res.Body.Close()
  4855  		}
  4856  		return nil, gensupport.WrapError(&googleapi.Error{
  4857  			Code:   res.StatusCode,
  4858  			Header: res.Header,
  4859  		})
  4860  	}
  4861  	if err != nil {
  4862  		return nil, err
  4863  	}
  4864  	defer googleapi.CloseBody(res)
  4865  	if err := googleapi.CheckResponse(res); err != nil {
  4866  		return nil, gensupport.WrapError(err)
  4867  	}
  4868  	ret := &StartManualTransferRunsResponse{
  4869  		ServerResponse: googleapi.ServerResponse{
  4870  			Header:         res.Header,
  4871  			HTTPStatusCode: res.StatusCode,
  4872  		},
  4873  	}
  4874  	target := &ret
  4875  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4876  		return nil, err
  4877  	}
  4878  	return ret, nil
  4879  }
  4880  
  4881  type ProjectsTransferConfigsRunsDeleteCall struct {
  4882  	s          *Service
  4883  	name       string
  4884  	urlParams_ gensupport.URLParams
  4885  	ctx_       context.Context
  4886  	header_    http.Header
  4887  }
  4888  
  4889  // Delete: Deletes the specified transfer run.
  4890  //
  4891  //   - name: The field will contain name of the resource requested, for example:
  4892  //     `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
  4893  //     `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/
  4894  //     runs/{run_id}`.
  4895  func (r *ProjectsTransferConfigsRunsService) Delete(name string) *ProjectsTransferConfigsRunsDeleteCall {
  4896  	c := &ProjectsTransferConfigsRunsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4897  	c.name = name
  4898  	return c
  4899  }
  4900  
  4901  // Fields allows partial responses to be retrieved. See
  4902  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4903  // details.
  4904  func (c *ProjectsTransferConfigsRunsDeleteCall) Fields(s ...googleapi.Field) *ProjectsTransferConfigsRunsDeleteCall {
  4905  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4906  	return c
  4907  }
  4908  
  4909  // Context sets the context to be used in this call's Do method.
  4910  func (c *ProjectsTransferConfigsRunsDeleteCall) Context(ctx context.Context) *ProjectsTransferConfigsRunsDeleteCall {
  4911  	c.ctx_ = ctx
  4912  	return c
  4913  }
  4914  
  4915  // Header returns a http.Header that can be modified by the caller to add
  4916  // headers to the request.
  4917  func (c *ProjectsTransferConfigsRunsDeleteCall) Header() http.Header {
  4918  	if c.header_ == nil {
  4919  		c.header_ = make(http.Header)
  4920  	}
  4921  	return c.header_
  4922  }
  4923  
  4924  func (c *ProjectsTransferConfigsRunsDeleteCall) doRequest(alt string) (*http.Response, error) {
  4925  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4926  	var body io.Reader = nil
  4927  	c.urlParams_.Set("alt", alt)
  4928  	c.urlParams_.Set("prettyPrint", "false")
  4929  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  4930  	urls += "?" + c.urlParams_.Encode()
  4931  	req, err := http.NewRequest("DELETE", urls, body)
  4932  	if err != nil {
  4933  		return nil, err
  4934  	}
  4935  	req.Header = reqHeaders
  4936  	googleapi.Expand(req.URL, map[string]string{
  4937  		"name": c.name,
  4938  	})
  4939  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4940  }
  4941  
  4942  // Do executes the "bigquerydatatransfer.projects.transferConfigs.runs.delete" call.
  4943  // Any non-2xx status code is an error. Response headers are in either
  4944  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  4945  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4946  // whether the returned error was because http.StatusNotModified was returned.
  4947  func (c *ProjectsTransferConfigsRunsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  4948  	gensupport.SetOptions(c.urlParams_, opts...)
  4949  	res, err := c.doRequest("json")
  4950  	if res != nil && res.StatusCode == http.StatusNotModified {
  4951  		if res.Body != nil {
  4952  			res.Body.Close()
  4953  		}
  4954  		return nil, gensupport.WrapError(&googleapi.Error{
  4955  			Code:   res.StatusCode,
  4956  			Header: res.Header,
  4957  		})
  4958  	}
  4959  	if err != nil {
  4960  		return nil, err
  4961  	}
  4962  	defer googleapi.CloseBody(res)
  4963  	if err := googleapi.CheckResponse(res); err != nil {
  4964  		return nil, gensupport.WrapError(err)
  4965  	}
  4966  	ret := &Empty{
  4967  		ServerResponse: googleapi.ServerResponse{
  4968  			Header:         res.Header,
  4969  			HTTPStatusCode: res.StatusCode,
  4970  		},
  4971  	}
  4972  	target := &ret
  4973  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4974  		return nil, err
  4975  	}
  4976  	return ret, nil
  4977  }
  4978  
  4979  type ProjectsTransferConfigsRunsGetCall struct {
  4980  	s            *Service
  4981  	name         string
  4982  	urlParams_   gensupport.URLParams
  4983  	ifNoneMatch_ string
  4984  	ctx_         context.Context
  4985  	header_      http.Header
  4986  }
  4987  
  4988  // Get: Returns information about the particular transfer run.
  4989  //
  4990  //   - name: The field will contain name of the resource requested, for example:
  4991  //     `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
  4992  //     `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/
  4993  //     runs/{run_id}`.
  4994  func (r *ProjectsTransferConfigsRunsService) Get(name string) *ProjectsTransferConfigsRunsGetCall {
  4995  	c := &ProjectsTransferConfigsRunsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4996  	c.name = name
  4997  	return c
  4998  }
  4999  
  5000  // Fields allows partial responses to be retrieved. See
  5001  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5002  // details.
  5003  func (c *ProjectsTransferConfigsRunsGetCall) Fields(s ...googleapi.Field) *ProjectsTransferConfigsRunsGetCall {
  5004  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5005  	return c
  5006  }
  5007  
  5008  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  5009  // object's ETag matches the given value. This is useful for getting updates
  5010  // only after the object has changed since the last request.
  5011  func (c *ProjectsTransferConfigsRunsGetCall) IfNoneMatch(entityTag string) *ProjectsTransferConfigsRunsGetCall {
  5012  	c.ifNoneMatch_ = entityTag
  5013  	return c
  5014  }
  5015  
  5016  // Context sets the context to be used in this call's Do method.
  5017  func (c *ProjectsTransferConfigsRunsGetCall) Context(ctx context.Context) *ProjectsTransferConfigsRunsGetCall {
  5018  	c.ctx_ = ctx
  5019  	return c
  5020  }
  5021  
  5022  // Header returns a http.Header that can be modified by the caller to add
  5023  // headers to the request.
  5024  func (c *ProjectsTransferConfigsRunsGetCall) Header() http.Header {
  5025  	if c.header_ == nil {
  5026  		c.header_ = make(http.Header)
  5027  	}
  5028  	return c.header_
  5029  }
  5030  
  5031  func (c *ProjectsTransferConfigsRunsGetCall) doRequest(alt string) (*http.Response, error) {
  5032  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  5033  	if c.ifNoneMatch_ != "" {
  5034  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5035  	}
  5036  	var body io.Reader = nil
  5037  	c.urlParams_.Set("alt", alt)
  5038  	c.urlParams_.Set("prettyPrint", "false")
  5039  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  5040  	urls += "?" + c.urlParams_.Encode()
  5041  	req, err := http.NewRequest("GET", urls, body)
  5042  	if err != nil {
  5043  		return nil, err
  5044  	}
  5045  	req.Header = reqHeaders
  5046  	googleapi.Expand(req.URL, map[string]string{
  5047  		"name": c.name,
  5048  	})
  5049  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5050  }
  5051  
  5052  // Do executes the "bigquerydatatransfer.projects.transferConfigs.runs.get" call.
  5053  // Any non-2xx status code is an error. Response headers are in either
  5054  // *TransferRun.ServerResponse.Header or (if a response was returned at all) in
  5055  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5056  // whether the returned error was because http.StatusNotModified was returned.
  5057  func (c *ProjectsTransferConfigsRunsGetCall) Do(opts ...googleapi.CallOption) (*TransferRun, error) {
  5058  	gensupport.SetOptions(c.urlParams_, opts...)
  5059  	res, err := c.doRequest("json")
  5060  	if res != nil && res.StatusCode == http.StatusNotModified {
  5061  		if res.Body != nil {
  5062  			res.Body.Close()
  5063  		}
  5064  		return nil, gensupport.WrapError(&googleapi.Error{
  5065  			Code:   res.StatusCode,
  5066  			Header: res.Header,
  5067  		})
  5068  	}
  5069  	if err != nil {
  5070  		return nil, err
  5071  	}
  5072  	defer googleapi.CloseBody(res)
  5073  	if err := googleapi.CheckResponse(res); err != nil {
  5074  		return nil, gensupport.WrapError(err)
  5075  	}
  5076  	ret := &TransferRun{
  5077  		ServerResponse: googleapi.ServerResponse{
  5078  			Header:         res.Header,
  5079  			HTTPStatusCode: res.StatusCode,
  5080  		},
  5081  	}
  5082  	target := &ret
  5083  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5084  		return nil, err
  5085  	}
  5086  	return ret, nil
  5087  }
  5088  
  5089  type ProjectsTransferConfigsRunsListCall struct {
  5090  	s            *Service
  5091  	parent       string
  5092  	urlParams_   gensupport.URLParams
  5093  	ifNoneMatch_ string
  5094  	ctx_         context.Context
  5095  	header_      http.Header
  5096  }
  5097  
  5098  // List: Returns information about running and completed transfer runs.
  5099  //
  5100  //   - parent: Name of transfer configuration for which transfer runs should be
  5101  //     retrieved. Format of transfer configuration resource name is:
  5102  //     `projects/{project_id}/transferConfigs/{config_id}` or
  5103  //     `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
  5104  //     .
  5105  func (r *ProjectsTransferConfigsRunsService) List(parent string) *ProjectsTransferConfigsRunsListCall {
  5106  	c := &ProjectsTransferConfigsRunsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5107  	c.parent = parent
  5108  	return c
  5109  }
  5110  
  5111  // PageSize sets the optional parameter "pageSize": Page size. The default page
  5112  // size is the maximum value of 1000 results.
  5113  func (c *ProjectsTransferConfigsRunsListCall) PageSize(pageSize int64) *ProjectsTransferConfigsRunsListCall {
  5114  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  5115  	return c
  5116  }
  5117  
  5118  // PageToken sets the optional parameter "pageToken": Pagination token, which
  5119  // can be used to request a specific page of `ListTransferRunsRequest` list
  5120  // results. For multiple-page results, `ListTransferRunsResponse` outputs a
  5121  // `next_page` token, which can be used as the `page_token` value to request
  5122  // the next page of list results.
  5123  func (c *ProjectsTransferConfigsRunsListCall) PageToken(pageToken string) *ProjectsTransferConfigsRunsListCall {
  5124  	c.urlParams_.Set("pageToken", pageToken)
  5125  	return c
  5126  }
  5127  
  5128  // RunAttempt sets the optional parameter "runAttempt": Indicates how run
  5129  // attempts are to be pulled.
  5130  //
  5131  // Possible values:
  5132  //
  5133  //	"RUN_ATTEMPT_UNSPECIFIED" - All runs should be returned.
  5134  //	"LATEST" - Only latest run per day should be returned.
  5135  func (c *ProjectsTransferConfigsRunsListCall) RunAttempt(runAttempt string) *ProjectsTransferConfigsRunsListCall {
  5136  	c.urlParams_.Set("runAttempt", runAttempt)
  5137  	return c
  5138  }
  5139  
  5140  // States sets the optional parameter "states": When specified, only transfer
  5141  // runs with requested states are returned.
  5142  //
  5143  // Possible values:
  5144  //
  5145  //	"TRANSFER_STATE_UNSPECIFIED" - State placeholder (0).
  5146  //	"PENDING" - Data transfer is scheduled and is waiting to be picked up by
  5147  //
  5148  // data transfer backend (2).
  5149  //
  5150  //	"RUNNING" - Data transfer is in progress (3).
  5151  //	"SUCCEEDED" - Data transfer completed successfully (4).
  5152  //	"FAILED" - Data transfer failed (5).
  5153  //	"CANCELLED" - Data transfer is cancelled (6).
  5154  func (c *ProjectsTransferConfigsRunsListCall) States(states ...string) *ProjectsTransferConfigsRunsListCall {
  5155  	c.urlParams_.SetMulti("states", append([]string{}, states...))
  5156  	return c
  5157  }
  5158  
  5159  // Fields allows partial responses to be retrieved. See
  5160  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5161  // details.
  5162  func (c *ProjectsTransferConfigsRunsListCall) Fields(s ...googleapi.Field) *ProjectsTransferConfigsRunsListCall {
  5163  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5164  	return c
  5165  }
  5166  
  5167  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  5168  // object's ETag matches the given value. This is useful for getting updates
  5169  // only after the object has changed since the last request.
  5170  func (c *ProjectsTransferConfigsRunsListCall) IfNoneMatch(entityTag string) *ProjectsTransferConfigsRunsListCall {
  5171  	c.ifNoneMatch_ = entityTag
  5172  	return c
  5173  }
  5174  
  5175  // Context sets the context to be used in this call's Do method.
  5176  func (c *ProjectsTransferConfigsRunsListCall) Context(ctx context.Context) *ProjectsTransferConfigsRunsListCall {
  5177  	c.ctx_ = ctx
  5178  	return c
  5179  }
  5180  
  5181  // Header returns a http.Header that can be modified by the caller to add
  5182  // headers to the request.
  5183  func (c *ProjectsTransferConfigsRunsListCall) Header() http.Header {
  5184  	if c.header_ == nil {
  5185  		c.header_ = make(http.Header)
  5186  	}
  5187  	return c.header_
  5188  }
  5189  
  5190  func (c *ProjectsTransferConfigsRunsListCall) doRequest(alt string) (*http.Response, error) {
  5191  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  5192  	if c.ifNoneMatch_ != "" {
  5193  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5194  	}
  5195  	var body io.Reader = nil
  5196  	c.urlParams_.Set("alt", alt)
  5197  	c.urlParams_.Set("prettyPrint", "false")
  5198  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/runs")
  5199  	urls += "?" + c.urlParams_.Encode()
  5200  	req, err := http.NewRequest("GET", urls, body)
  5201  	if err != nil {
  5202  		return nil, err
  5203  	}
  5204  	req.Header = reqHeaders
  5205  	googleapi.Expand(req.URL, map[string]string{
  5206  		"parent": c.parent,
  5207  	})
  5208  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5209  }
  5210  
  5211  // Do executes the "bigquerydatatransfer.projects.transferConfigs.runs.list" call.
  5212  // Any non-2xx status code is an error. Response headers are in either
  5213  // *ListTransferRunsResponse.ServerResponse.Header or (if a response was
  5214  // returned at all) in error.(*googleapi.Error).Header. Use
  5215  // googleapi.IsNotModified to check whether the returned error was because
  5216  // http.StatusNotModified was returned.
  5217  func (c *ProjectsTransferConfigsRunsListCall) Do(opts ...googleapi.CallOption) (*ListTransferRunsResponse, error) {
  5218  	gensupport.SetOptions(c.urlParams_, opts...)
  5219  	res, err := c.doRequest("json")
  5220  	if res != nil && res.StatusCode == http.StatusNotModified {
  5221  		if res.Body != nil {
  5222  			res.Body.Close()
  5223  		}
  5224  		return nil, gensupport.WrapError(&googleapi.Error{
  5225  			Code:   res.StatusCode,
  5226  			Header: res.Header,
  5227  		})
  5228  	}
  5229  	if err != nil {
  5230  		return nil, err
  5231  	}
  5232  	defer googleapi.CloseBody(res)
  5233  	if err := googleapi.CheckResponse(res); err != nil {
  5234  		return nil, gensupport.WrapError(err)
  5235  	}
  5236  	ret := &ListTransferRunsResponse{
  5237  		ServerResponse: googleapi.ServerResponse{
  5238  			Header:         res.Header,
  5239  			HTTPStatusCode: res.StatusCode,
  5240  		},
  5241  	}
  5242  	target := &ret
  5243  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5244  		return nil, err
  5245  	}
  5246  	return ret, nil
  5247  }
  5248  
  5249  // Pages invokes f for each page of results.
  5250  // A non-nil error returned from f will halt the iteration.
  5251  // The provided context supersedes any context provided to the Context method.
  5252  func (c *ProjectsTransferConfigsRunsListCall) Pages(ctx context.Context, f func(*ListTransferRunsResponse) error) error {
  5253  	c.ctx_ = ctx
  5254  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  5255  	for {
  5256  		x, err := c.Do()
  5257  		if err != nil {
  5258  			return err
  5259  		}
  5260  		if err := f(x); err != nil {
  5261  			return err
  5262  		}
  5263  		if x.NextPageToken == "" {
  5264  			return nil
  5265  		}
  5266  		c.PageToken(x.NextPageToken)
  5267  	}
  5268  }
  5269  
  5270  type ProjectsTransferConfigsRunsTransferLogsListCall struct {
  5271  	s            *Service
  5272  	parent       string
  5273  	urlParams_   gensupport.URLParams
  5274  	ifNoneMatch_ string
  5275  	ctx_         context.Context
  5276  	header_      http.Header
  5277  }
  5278  
  5279  // List: Returns log messages for the transfer run.
  5280  //
  5281  //   - parent: Transfer run name in the form:
  5282  //     `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
  5283  //     `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/
  5284  //     runs/{run_id}`.
  5285  func (r *ProjectsTransferConfigsRunsTransferLogsService) List(parent string) *ProjectsTransferConfigsRunsTransferLogsListCall {
  5286  	c := &ProjectsTransferConfigsRunsTransferLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5287  	c.parent = parent
  5288  	return c
  5289  }
  5290  
  5291  // MessageTypes sets the optional parameter "messageTypes": Message types to
  5292  // return. If not populated - INFO, WARNING and ERROR messages are returned.
  5293  //
  5294  // Possible values:
  5295  //
  5296  //	"MESSAGE_SEVERITY_UNSPECIFIED" - No severity specified.
  5297  //	"INFO" - Informational message.
  5298  //	"WARNING" - Warning message.
  5299  //	"ERROR" - Error message.
  5300  func (c *ProjectsTransferConfigsRunsTransferLogsListCall) MessageTypes(messageTypes ...string) *ProjectsTransferConfigsRunsTransferLogsListCall {
  5301  	c.urlParams_.SetMulti("messageTypes", append([]string{}, messageTypes...))
  5302  	return c
  5303  }
  5304  
  5305  // PageSize sets the optional parameter "pageSize": Page size. The default page
  5306  // size is the maximum value of 1000 results.
  5307  func (c *ProjectsTransferConfigsRunsTransferLogsListCall) PageSize(pageSize int64) *ProjectsTransferConfigsRunsTransferLogsListCall {
  5308  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  5309  	return c
  5310  }
  5311  
  5312  // PageToken sets the optional parameter "pageToken": Pagination token, which
  5313  // can be used to request a specific page of `ListTransferLogsRequest` list
  5314  // results. For multiple-page results, `ListTransferLogsResponse` outputs a
  5315  // `next_page` token, which can be used as the `page_token` value to request
  5316  // the next page of list results.
  5317  func (c *ProjectsTransferConfigsRunsTransferLogsListCall) PageToken(pageToken string) *ProjectsTransferConfigsRunsTransferLogsListCall {
  5318  	c.urlParams_.Set("pageToken", pageToken)
  5319  	return c
  5320  }
  5321  
  5322  // Fields allows partial responses to be retrieved. See
  5323  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5324  // details.
  5325  func (c *ProjectsTransferConfigsRunsTransferLogsListCall) Fields(s ...googleapi.Field) *ProjectsTransferConfigsRunsTransferLogsListCall {
  5326  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5327  	return c
  5328  }
  5329  
  5330  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  5331  // object's ETag matches the given value. This is useful for getting updates
  5332  // only after the object has changed since the last request.
  5333  func (c *ProjectsTransferConfigsRunsTransferLogsListCall) IfNoneMatch(entityTag string) *ProjectsTransferConfigsRunsTransferLogsListCall {
  5334  	c.ifNoneMatch_ = entityTag
  5335  	return c
  5336  }
  5337  
  5338  // Context sets the context to be used in this call's Do method.
  5339  func (c *ProjectsTransferConfigsRunsTransferLogsListCall) Context(ctx context.Context) *ProjectsTransferConfigsRunsTransferLogsListCall {
  5340  	c.ctx_ = ctx
  5341  	return c
  5342  }
  5343  
  5344  // Header returns a http.Header that can be modified by the caller to add
  5345  // headers to the request.
  5346  func (c *ProjectsTransferConfigsRunsTransferLogsListCall) Header() http.Header {
  5347  	if c.header_ == nil {
  5348  		c.header_ = make(http.Header)
  5349  	}
  5350  	return c.header_
  5351  }
  5352  
  5353  func (c *ProjectsTransferConfigsRunsTransferLogsListCall) doRequest(alt string) (*http.Response, error) {
  5354  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  5355  	if c.ifNoneMatch_ != "" {
  5356  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5357  	}
  5358  	var body io.Reader = nil
  5359  	c.urlParams_.Set("alt", alt)
  5360  	c.urlParams_.Set("prettyPrint", "false")
  5361  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/transferLogs")
  5362  	urls += "?" + c.urlParams_.Encode()
  5363  	req, err := http.NewRequest("GET", urls, body)
  5364  	if err != nil {
  5365  		return nil, err
  5366  	}
  5367  	req.Header = reqHeaders
  5368  	googleapi.Expand(req.URL, map[string]string{
  5369  		"parent": c.parent,
  5370  	})
  5371  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5372  }
  5373  
  5374  // Do executes the "bigquerydatatransfer.projects.transferConfigs.runs.transferLogs.list" call.
  5375  // Any non-2xx status code is an error. Response headers are in either
  5376  // *ListTransferLogsResponse.ServerResponse.Header or (if a response was
  5377  // returned at all) in error.(*googleapi.Error).Header. Use
  5378  // googleapi.IsNotModified to check whether the returned error was because
  5379  // http.StatusNotModified was returned.
  5380  func (c *ProjectsTransferConfigsRunsTransferLogsListCall) Do(opts ...googleapi.CallOption) (*ListTransferLogsResponse, error) {
  5381  	gensupport.SetOptions(c.urlParams_, opts...)
  5382  	res, err := c.doRequest("json")
  5383  	if res != nil && res.StatusCode == http.StatusNotModified {
  5384  		if res.Body != nil {
  5385  			res.Body.Close()
  5386  		}
  5387  		return nil, gensupport.WrapError(&googleapi.Error{
  5388  			Code:   res.StatusCode,
  5389  			Header: res.Header,
  5390  		})
  5391  	}
  5392  	if err != nil {
  5393  		return nil, err
  5394  	}
  5395  	defer googleapi.CloseBody(res)
  5396  	if err := googleapi.CheckResponse(res); err != nil {
  5397  		return nil, gensupport.WrapError(err)
  5398  	}
  5399  	ret := &ListTransferLogsResponse{
  5400  		ServerResponse: googleapi.ServerResponse{
  5401  			Header:         res.Header,
  5402  			HTTPStatusCode: res.StatusCode,
  5403  		},
  5404  	}
  5405  	target := &ret
  5406  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5407  		return nil, err
  5408  	}
  5409  	return ret, nil
  5410  }
  5411  
  5412  // Pages invokes f for each page of results.
  5413  // A non-nil error returned from f will halt the iteration.
  5414  // The provided context supersedes any context provided to the Context method.
  5415  func (c *ProjectsTransferConfigsRunsTransferLogsListCall) Pages(ctx context.Context, f func(*ListTransferLogsResponse) error) error {
  5416  	c.ctx_ = ctx
  5417  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  5418  	for {
  5419  		x, err := c.Do()
  5420  		if err != nil {
  5421  			return err
  5422  		}
  5423  		if err := f(x); err != nil {
  5424  			return err
  5425  		}
  5426  		if x.NextPageToken == "" {
  5427  			return nil
  5428  		}
  5429  		c.PageToken(x.NextPageToken)
  5430  	}
  5431  }
  5432  

View as plain text