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