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 bigquery provides access to the BigQuery API. 8// 9// This package is DEPRECATED. Use package cloud.google.com/go/bigquery instead. 10// 11// For product documentation, see: https://cloud.google.com/bigquery/ 12// 13// Creating a client 14// 15// Usage example: 16// 17// import "google.golang.org/api/bigquery/v2" 18// ... 19// ctx := context.Background() 20// bigqueryService, err := bigquery.NewService(ctx) 21// 22// In this example, Google Application Default Credentials are used for authentication. 23// 24// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 25// 26// Other authentication options 27// 28// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes: 29// 30// bigqueryService, err := bigquery.NewService(ctx, option.WithScopes(bigquery.DevstorageReadWriteScope)) 31// 32// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 33// 34// bigqueryService, err := bigquery.NewService(ctx, option.WithAPIKey("AIza...")) 35// 36// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 37// 38// config := &oauth2.Config{...} 39// // ... 40// token, err := config.Exchange(ctx, ...) 41// bigqueryService, err := bigquery.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 42// 43// See https://godoc.org/google.golang.org/api/option/ for details on options. 44package bigquery // import "google.golang.org/api/bigquery/v2" 45 46import ( 47 "bytes" 48 "context" 49 "encoding/json" 50 "errors" 51 "fmt" 52 "io" 53 "net/http" 54 "net/url" 55 "strconv" 56 "strings" 57 58 googleapi "google.golang.org/api/googleapi" 59 gensupport "google.golang.org/api/internal/gensupport" 60 option "google.golang.org/api/option" 61 internaloption "google.golang.org/api/option/internaloption" 62 htransport "google.golang.org/api/transport/http" 63) 64 65// Always reference these packages, just in case the auto-generated code 66// below doesn't. 67var _ = bytes.NewBuffer 68var _ = strconv.Itoa 69var _ = fmt.Sprintf 70var _ = json.NewDecoder 71var _ = io.Copy 72var _ = url.Parse 73var _ = gensupport.MarshalJSON 74var _ = googleapi.Version 75var _ = errors.New 76var _ = strings.Replace 77var _ = context.Canceled 78var _ = internaloption.WithDefaultEndpoint 79 80const apiId = "bigquery:v2" 81const apiName = "bigquery" 82const apiVersion = "v2" 83const basePath = "https://bigquery.googleapis.com/bigquery/v2/" 84 85// OAuth2 scopes used by this API. 86const ( 87 // View and manage your data in Google BigQuery 88 BigqueryScope = "https://www.googleapis.com/auth/bigquery" 89 90 // Insert data into Google BigQuery 91 BigqueryInsertdataScope = "https://www.googleapis.com/auth/bigquery.insertdata" 92 93 // View your data in Google BigQuery 94 BigqueryReadonlyScope = "https://www.googleapis.com/auth/bigquery.readonly" 95 96 // View and manage your data across Google Cloud Platform services 97 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 98 99 // View your data across Google Cloud Platform services 100 CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only" 101 102 // Manage your data and permissions in Google Cloud Storage 103 DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control" 104 105 // View your data in Google Cloud Storage 106 DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only" 107 108 // Manage your data in Google Cloud Storage 109 DevstorageReadWriteScope = "https://www.googleapis.com/auth/devstorage.read_write" 110) 111 112// NewService creates a new Service. 113func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 114 scopesOption := option.WithScopes( 115 "https://www.googleapis.com/auth/bigquery", 116 "https://www.googleapis.com/auth/bigquery.insertdata", 117 "https://www.googleapis.com/auth/bigquery.readonly", 118 "https://www.googleapis.com/auth/cloud-platform", 119 "https://www.googleapis.com/auth/cloud-platform.read-only", 120 "https://www.googleapis.com/auth/devstorage.full_control", 121 "https://www.googleapis.com/auth/devstorage.read_only", 122 "https://www.googleapis.com/auth/devstorage.read_write", 123 ) 124 // NOTE: prepend, so we don't override user-specified scopes. 125 opts = append([]option.ClientOption{scopesOption}, opts...) 126 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 127 client, endpoint, err := htransport.NewClient(ctx, opts...) 128 if err != nil { 129 return nil, err 130 } 131 s, err := New(client) 132 if err != nil { 133 return nil, err 134 } 135 if endpoint != "" { 136 s.BasePath = endpoint 137 } 138 return s, nil 139} 140 141// New creates a new Service. It uses the provided http.Client for requests. 142// 143// Deprecated: please use NewService instead. 144// To provide a custom HTTP client, use option.WithHTTPClient. 145// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 146func New(client *http.Client) (*Service, error) { 147 if client == nil { 148 return nil, errors.New("client is nil") 149 } 150 s := &Service{client: client, BasePath: basePath} 151 s.Datasets = NewDatasetsService(s) 152 s.Jobs = NewJobsService(s) 153 s.Models = NewModelsService(s) 154 s.Projects = NewProjectsService(s) 155 s.Routines = NewRoutinesService(s) 156 s.Tabledata = NewTabledataService(s) 157 s.Tables = NewTablesService(s) 158 return s, nil 159} 160 161type Service struct { 162 client *http.Client 163 BasePath string // API endpoint base URL 164 UserAgent string // optional additional User-Agent fragment 165 166 Datasets *DatasetsService 167 168 Jobs *JobsService 169 170 Models *ModelsService 171 172 Projects *ProjectsService 173 174 Routines *RoutinesService 175 176 Tabledata *TabledataService 177 178 Tables *TablesService 179} 180 181func (s *Service) userAgent() string { 182 if s.UserAgent == "" { 183 return googleapi.UserAgent 184 } 185 return googleapi.UserAgent + " " + s.UserAgent 186} 187 188func NewDatasetsService(s *Service) *DatasetsService { 189 rs := &DatasetsService{s: s} 190 return rs 191} 192 193type DatasetsService struct { 194 s *Service 195} 196 197func NewJobsService(s *Service) *JobsService { 198 rs := &JobsService{s: s} 199 return rs 200} 201 202type JobsService struct { 203 s *Service 204} 205 206func NewModelsService(s *Service) *ModelsService { 207 rs := &ModelsService{s: s} 208 return rs 209} 210 211type ModelsService struct { 212 s *Service 213} 214 215func NewProjectsService(s *Service) *ProjectsService { 216 rs := &ProjectsService{s: s} 217 return rs 218} 219 220type ProjectsService struct { 221 s *Service 222} 223 224func NewRoutinesService(s *Service) *RoutinesService { 225 rs := &RoutinesService{s: s} 226 return rs 227} 228 229type RoutinesService struct { 230 s *Service 231} 232 233func NewTabledataService(s *Service) *TabledataService { 234 rs := &TabledataService{s: s} 235 return rs 236} 237 238type TabledataService struct { 239 s *Service 240} 241 242func NewTablesService(s *Service) *TablesService { 243 rs := &TablesService{s: s} 244 return rs 245} 246 247type TablesService struct { 248 s *Service 249} 250 251// AggregateClassificationMetrics: Aggregate metrics for 252// classification/classifier models. For multi-class 253// models, the metrics are either macro-averaged or micro-averaged. 254// When 255// macro-averaged, the metrics are calculated for each label and then 256// an 257// unweighted average is taken of those values. When micro-averaged, 258// the 259// metric is calculated globally by counting the total number of 260// correctly 261// predicted rows. 262type AggregateClassificationMetrics struct { 263 // Accuracy: Accuracy is the fraction of predictions given the correct 264 // label. For 265 // multiclass this is a micro-averaged metric. 266 Accuracy float64 `json:"accuracy,omitempty"` 267 268 // F1Score: The F1 score is an average of recall and precision. For 269 // multiclass 270 // this is a macro-averaged metric. 271 F1Score float64 `json:"f1Score,omitempty"` 272 273 // LogLoss: Logarithmic Loss. For multiclass this is a macro-averaged 274 // metric. 275 LogLoss float64 `json:"logLoss,omitempty"` 276 277 // Precision: Precision is the fraction of actual positive predictions 278 // that had 279 // positive actual labels. For multiclass this is a 280 // macro-averaged 281 // metric treating each class as a binary classifier. 282 Precision float64 `json:"precision,omitempty"` 283 284 // Recall: Recall is the fraction of actual positive labels that were 285 // given a 286 // positive prediction. For multiclass this is a macro-averaged metric. 287 Recall float64 `json:"recall,omitempty"` 288 289 // RocAuc: Area Under a ROC Curve. For multiclass this is a 290 // macro-averaged 291 // metric. 292 RocAuc float64 `json:"rocAuc,omitempty"` 293 294 // Threshold: Threshold at which the metrics are computed. For 295 // binary 296 // classification models this is the positive class threshold. 297 // For multi-class classfication models this is the 298 // confidence 299 // threshold. 300 Threshold float64 `json:"threshold,omitempty"` 301 302 // ForceSendFields is a list of field names (e.g. "Accuracy") to 303 // unconditionally include in API requests. By default, fields with 304 // empty values are omitted from API requests. However, any non-pointer, 305 // non-interface field appearing in ForceSendFields will be sent to the 306 // server regardless of whether the field is empty or not. This may be 307 // used to include empty fields in Patch requests. 308 ForceSendFields []string `json:"-"` 309 310 // NullFields is a list of field names (e.g. "Accuracy") to include in 311 // API requests with the JSON null value. By default, fields with empty 312 // values are omitted from API requests. However, any field with an 313 // empty value appearing in NullFields will be sent to the server as 314 // null. It is an error if a field in this list has a non-empty value. 315 // This may be used to include null fields in Patch requests. 316 NullFields []string `json:"-"` 317} 318 319func (s *AggregateClassificationMetrics) MarshalJSON() ([]byte, error) { 320 type NoMethod AggregateClassificationMetrics 321 raw := NoMethod(*s) 322 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 323} 324 325func (s *AggregateClassificationMetrics) UnmarshalJSON(data []byte) error { 326 type NoMethod AggregateClassificationMetrics 327 var s1 struct { 328 Accuracy gensupport.JSONFloat64 `json:"accuracy"` 329 F1Score gensupport.JSONFloat64 `json:"f1Score"` 330 LogLoss gensupport.JSONFloat64 `json:"logLoss"` 331 Precision gensupport.JSONFloat64 `json:"precision"` 332 Recall gensupport.JSONFloat64 `json:"recall"` 333 RocAuc gensupport.JSONFloat64 `json:"rocAuc"` 334 Threshold gensupport.JSONFloat64 `json:"threshold"` 335 *NoMethod 336 } 337 s1.NoMethod = (*NoMethod)(s) 338 if err := json.Unmarshal(data, &s1); err != nil { 339 return err 340 } 341 s.Accuracy = float64(s1.Accuracy) 342 s.F1Score = float64(s1.F1Score) 343 s.LogLoss = float64(s1.LogLoss) 344 s.Precision = float64(s1.Precision) 345 s.Recall = float64(s1.Recall) 346 s.RocAuc = float64(s1.RocAuc) 347 s.Threshold = float64(s1.Threshold) 348 return nil 349} 350 351// Argument: Input/output argument of a function or a stored procedure. 352type Argument struct { 353 // ArgumentKind: Optional. Defaults to FIXED_TYPE. 354 // 355 // Possible values: 356 // "ARGUMENT_KIND_UNSPECIFIED" 357 // "FIXED_TYPE" - The argument is a variable with fully specified 358 // type, which can be a 359 // struct or an array, but not a table. 360 // "ANY_TYPE" - The argument is any type, including struct or array, 361 // but not a table. 362 // To be added: FIXED_TABLE, ANY_TABLE 363 ArgumentKind string `json:"argumentKind,omitempty"` 364 365 // DataType: Required unless argument_kind = ANY_TYPE. 366 DataType *StandardSqlDataType `json:"dataType,omitempty"` 367 368 // Mode: Optional. Specifies whether the argument is input or 369 // output. 370 // Can be set for procedures only. 371 // 372 // Possible values: 373 // "MODE_UNSPECIFIED" 374 // "IN" - The argument is input-only. 375 // "OUT" - The argument is output-only. 376 // "INOUT" - The argument is both an input and an output. 377 Mode string `json:"mode,omitempty"` 378 379 // Name: Optional. The name of this argument. Can be absent for function 380 // return argument. 381 Name string `json:"name,omitempty"` 382 383 // ForceSendFields is a list of field names (e.g. "ArgumentKind") to 384 // unconditionally include in API requests. By default, fields with 385 // empty values are omitted from API requests. However, any non-pointer, 386 // non-interface field appearing in ForceSendFields will be sent to the 387 // server regardless of whether the field is empty or not. This may be 388 // used to include empty fields in Patch requests. 389 ForceSendFields []string `json:"-"` 390 391 // NullFields is a list of field names (e.g. "ArgumentKind") to include 392 // in API requests with the JSON null value. By default, fields with 393 // empty values are omitted from API requests. However, any field with 394 // an empty value appearing in NullFields will be sent to the server as 395 // null. It is an error if a field in this list has a non-empty value. 396 // This may be used to include null fields in Patch requests. 397 NullFields []string `json:"-"` 398} 399 400func (s *Argument) MarshalJSON() ([]byte, error) { 401 type NoMethod Argument 402 raw := NoMethod(*s) 403 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 404} 405 406// ArimaCoefficients: Arima coefficients. 407type ArimaCoefficients struct { 408 // AutoRegressiveCoefficients: Auto-regressive coefficients, an array of 409 // double. 410 AutoRegressiveCoefficients []float64 `json:"autoRegressiveCoefficients,omitempty"` 411 412 // InterceptCoefficient: Intercept coefficient, just a double not an 413 // array. 414 InterceptCoefficient float64 `json:"interceptCoefficient,omitempty"` 415 416 // MovingAverageCoefficients: Moving-average coefficients, an array of 417 // double. 418 MovingAverageCoefficients []float64 `json:"movingAverageCoefficients,omitempty"` 419 420 // ForceSendFields is a list of field names (e.g. 421 // "AutoRegressiveCoefficients") to unconditionally include in API 422 // requests. By default, fields with empty values are omitted from API 423 // requests. However, any non-pointer, non-interface field appearing in 424 // ForceSendFields will be sent to the server regardless of whether the 425 // field is empty or not. This may be used to include empty fields in 426 // Patch requests. 427 ForceSendFields []string `json:"-"` 428 429 // NullFields is a list of field names (e.g. 430 // "AutoRegressiveCoefficients") to include in API requests with the 431 // JSON null value. By default, fields with empty values are omitted 432 // from API requests. However, any field with an empty value appearing 433 // in NullFields will be sent to the server as null. It is an error if a 434 // field in this list has a non-empty value. This may be used to include 435 // null fields in Patch requests. 436 NullFields []string `json:"-"` 437} 438 439func (s *ArimaCoefficients) MarshalJSON() ([]byte, error) { 440 type NoMethod ArimaCoefficients 441 raw := NoMethod(*s) 442 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 443} 444 445func (s *ArimaCoefficients) UnmarshalJSON(data []byte) error { 446 type NoMethod ArimaCoefficients 447 var s1 struct { 448 InterceptCoefficient gensupport.JSONFloat64 `json:"interceptCoefficient"` 449 *NoMethod 450 } 451 s1.NoMethod = (*NoMethod)(s) 452 if err := json.Unmarshal(data, &s1); err != nil { 453 return err 454 } 455 s.InterceptCoefficient = float64(s1.InterceptCoefficient) 456 return nil 457} 458 459// ArimaFittingMetrics: ARIMA model fitting metrics. 460type ArimaFittingMetrics struct { 461 // Aic: AIC. 462 Aic float64 `json:"aic,omitempty"` 463 464 // LogLikelihood: Log-likelihood. 465 LogLikelihood float64 `json:"logLikelihood,omitempty"` 466 467 // Variance: Variance. 468 Variance float64 `json:"variance,omitempty"` 469 470 // ForceSendFields is a list of field names (e.g. "Aic") to 471 // unconditionally include in API requests. By default, fields with 472 // empty values are omitted from API requests. However, any non-pointer, 473 // non-interface field appearing in ForceSendFields will be sent to the 474 // server regardless of whether the field is empty or not. This may be 475 // used to include empty fields in Patch requests. 476 ForceSendFields []string `json:"-"` 477 478 // NullFields is a list of field names (e.g. "Aic") to include in API 479 // requests with the JSON null value. By default, fields with empty 480 // values are omitted from API requests. However, any field with an 481 // empty value appearing in NullFields will be sent to the server as 482 // null. It is an error if a field in this list has a non-empty value. 483 // This may be used to include null fields in Patch requests. 484 NullFields []string `json:"-"` 485} 486 487func (s *ArimaFittingMetrics) MarshalJSON() ([]byte, error) { 488 type NoMethod ArimaFittingMetrics 489 raw := NoMethod(*s) 490 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 491} 492 493func (s *ArimaFittingMetrics) UnmarshalJSON(data []byte) error { 494 type NoMethod ArimaFittingMetrics 495 var s1 struct { 496 Aic gensupport.JSONFloat64 `json:"aic"` 497 LogLikelihood gensupport.JSONFloat64 `json:"logLikelihood"` 498 Variance gensupport.JSONFloat64 `json:"variance"` 499 *NoMethod 500 } 501 s1.NoMethod = (*NoMethod)(s) 502 if err := json.Unmarshal(data, &s1); err != nil { 503 return err 504 } 505 s.Aic = float64(s1.Aic) 506 s.LogLikelihood = float64(s1.LogLikelihood) 507 s.Variance = float64(s1.Variance) 508 return nil 509} 510 511// ArimaModelInfo: Arima model information. 512type ArimaModelInfo struct { 513 // ArimaCoefficients: Arima coefficients. 514 ArimaCoefficients *ArimaCoefficients `json:"arimaCoefficients,omitempty"` 515 516 // ArimaFittingMetrics: Arima fitting metrics. 517 ArimaFittingMetrics *ArimaFittingMetrics `json:"arimaFittingMetrics,omitempty"` 518 519 // HasDrift: Whether Arima model fitted with drift or not. It is always 520 // false 521 // when d is not 1. 522 HasDrift bool `json:"hasDrift,omitempty"` 523 524 // NonSeasonalOrder: Non-seasonal order. 525 NonSeasonalOrder *ArimaOrder `json:"nonSeasonalOrder,omitempty"` 526 527 // SeasonalPeriods: Seasonal periods. Repeated because multiple periods 528 // are supported 529 // for one time series. 530 // 531 // Possible values: 532 // "SEASONAL_PERIOD_TYPE_UNSPECIFIED" 533 // "NO_SEASONALITY" - No seasonality 534 // "DAILY" - Daily period, 24 hours. 535 // "WEEKLY" - Weekly period, 7 days. 536 // "MONTHLY" - Monthly period, 30 days or irregular. 537 // "QUARTERLY" - Quarterly period, 90 days or irregular. 538 // "YEARLY" - Yearly period, 365 days or irregular. 539 SeasonalPeriods []string `json:"seasonalPeriods,omitempty"` 540 541 // TimeSeriesId: The id to indicate different time series. 542 TimeSeriesId string `json:"timeSeriesId,omitempty"` 543 544 // ForceSendFields is a list of field names (e.g. "ArimaCoefficients") 545 // to unconditionally include in API requests. By default, fields with 546 // empty values are omitted from API requests. However, any non-pointer, 547 // non-interface field appearing in ForceSendFields will be sent to the 548 // server regardless of whether the field is empty or not. This may be 549 // used to include empty fields in Patch requests. 550 ForceSendFields []string `json:"-"` 551 552 // NullFields is a list of field names (e.g. "ArimaCoefficients") to 553 // include in API requests with the JSON null value. By default, fields 554 // with empty values are omitted from API requests. However, any field 555 // with an empty value appearing in NullFields will be sent to the 556 // server as null. It is an error if a field in this list has a 557 // non-empty value. This may be used to include null fields in Patch 558 // requests. 559 NullFields []string `json:"-"` 560} 561 562func (s *ArimaModelInfo) MarshalJSON() ([]byte, error) { 563 type NoMethod ArimaModelInfo 564 raw := NoMethod(*s) 565 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 566} 567 568// ArimaOrder: Arima order, can be used for both non-seasonal and 569// seasonal parts. 570type ArimaOrder struct { 571 // D: Order of the differencing part. 572 D int64 `json:"d,omitempty,string"` 573 574 // P: Order of the autoregressive part. 575 P int64 `json:"p,omitempty,string"` 576 577 // Q: Order of the moving-average part. 578 Q int64 `json:"q,omitempty,string"` 579 580 // ForceSendFields is a list of field names (e.g. "D") to 581 // unconditionally include in API requests. By default, fields with 582 // empty values are omitted from API requests. However, any non-pointer, 583 // non-interface field appearing in ForceSendFields will be sent to the 584 // server regardless of whether the field is empty or not. This may be 585 // used to include empty fields in Patch requests. 586 ForceSendFields []string `json:"-"` 587 588 // NullFields is a list of field names (e.g. "D") to include in API 589 // requests with the JSON null value. By default, fields with empty 590 // values are omitted from API requests. However, any field with an 591 // empty value appearing in NullFields will be sent to the server as 592 // null. It is an error if a field in this list has a non-empty value. 593 // This may be used to include null fields in Patch requests. 594 NullFields []string `json:"-"` 595} 596 597func (s *ArimaOrder) MarshalJSON() ([]byte, error) { 598 type NoMethod ArimaOrder 599 raw := NoMethod(*s) 600 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 601} 602 603// ArimaResult: (Auto-)arima fitting result. Wrap everything in 604// ArimaResult for easier 605// refactoring if we want to use model-specific iteration results. 606type ArimaResult struct { 607 // ArimaModelInfo: This message is repeated because there are multiple 608 // arima models 609 // fitted in auto-arima. For non-auto-arima model, its size is one. 610 ArimaModelInfo []*ArimaModelInfo `json:"arimaModelInfo,omitempty"` 611 612 // SeasonalPeriods: Seasonal periods. Repeated because multiple periods 613 // are supported for 614 // one time series. 615 // 616 // Possible values: 617 // "SEASONAL_PERIOD_TYPE_UNSPECIFIED" 618 // "NO_SEASONALITY" - No seasonality 619 // "DAILY" - Daily period, 24 hours. 620 // "WEEKLY" - Weekly period, 7 days. 621 // "MONTHLY" - Monthly period, 30 days or irregular. 622 // "QUARTERLY" - Quarterly period, 90 days or irregular. 623 // "YEARLY" - Yearly period, 365 days or irregular. 624 SeasonalPeriods []string `json:"seasonalPeriods,omitempty"` 625 626 // ForceSendFields is a list of field names (e.g. "ArimaModelInfo") to 627 // unconditionally include in API requests. By default, fields with 628 // empty values are omitted from API requests. However, any non-pointer, 629 // non-interface field appearing in ForceSendFields will be sent to the 630 // server regardless of whether the field is empty or not. This may be 631 // used to include empty fields in Patch requests. 632 ForceSendFields []string `json:"-"` 633 634 // NullFields is a list of field names (e.g. "ArimaModelInfo") to 635 // include in API requests with the JSON null value. By default, fields 636 // with empty values are omitted from API requests. However, any field 637 // with an empty value appearing in NullFields will be sent to the 638 // server as null. It is an error if a field in this list has a 639 // non-empty value. This may be used to include null fields in Patch 640 // requests. 641 NullFields []string `json:"-"` 642} 643 644func (s *ArimaResult) MarshalJSON() ([]byte, error) { 645 type NoMethod ArimaResult 646 raw := NoMethod(*s) 647 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 648} 649 650// AuditConfig: Specifies the audit configuration for a service. 651// The configuration determines which permission types are logged, and 652// what 653// identities, if any, are exempted from logging. 654// An AuditConfig must have one or more AuditLogConfigs. 655// 656// If there are AuditConfigs for both `allServices` and a specific 657// service, 658// the union of the two AuditConfigs is used for that service: the 659// log_types 660// specified in each AuditConfig are enabled, and the exempted_members 661// in each 662// AuditLogConfig are exempted. 663// 664// Example Policy with multiple AuditConfigs: 665// 666// { 667// "audit_configs": [ 668// { 669// "service": "allServices", 670// "audit_log_configs": [ 671// { 672// "log_type": "DATA_READ", 673// "exempted_members": [ 674// "user:jose@example.com" 675// ] 676// }, 677// { 678// "log_type": "DATA_WRITE" 679// }, 680// { 681// "log_type": "ADMIN_READ" 682// } 683// ] 684// }, 685// { 686// "service": "sampleservice.googleapis.com", 687// "audit_log_configs": [ 688// { 689// "log_type": "DATA_READ" 690// }, 691// { 692// "log_type": "DATA_WRITE", 693// "exempted_members": [ 694// "user:aliya@example.com" 695// ] 696// } 697// ] 698// } 699// ] 700// } 701// 702// For sampleservice, this policy enables DATA_READ, DATA_WRITE and 703// ADMIN_READ 704// logging. It also exempts jose@example.com from DATA_READ logging, 705// and 706// aliya@example.com from DATA_WRITE logging. 707type AuditConfig struct { 708 // AuditLogConfigs: The configuration for logging of each type of 709 // permission. 710 AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"` 711 712 // Service: Specifies a service that will be enabled for audit 713 // logging. 714 // For example, `storage.googleapis.com`, 715 // `cloudsql.googleapis.com`. 716 // `allServices` is a special value that covers all services. 717 Service string `json:"service,omitempty"` 718 719 // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to 720 // unconditionally include in API requests. By default, fields with 721 // empty values are omitted from API requests. However, any non-pointer, 722 // non-interface field appearing in ForceSendFields will be sent to the 723 // server regardless of whether the field is empty or not. This may be 724 // used to include empty fields in Patch requests. 725 ForceSendFields []string `json:"-"` 726 727 // NullFields is a list of field names (e.g. "AuditLogConfigs") to 728 // include in API requests with the JSON null value. By default, fields 729 // with empty values are omitted from API requests. However, any field 730 // with an empty value appearing in NullFields will be sent to the 731 // server as null. It is an error if a field in this list has a 732 // non-empty value. This may be used to include null fields in Patch 733 // requests. 734 NullFields []string `json:"-"` 735} 736 737func (s *AuditConfig) MarshalJSON() ([]byte, error) { 738 type NoMethod AuditConfig 739 raw := NoMethod(*s) 740 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 741} 742 743// AuditLogConfig: Provides the configuration for logging a type of 744// permissions. 745// Example: 746// 747// { 748// "audit_log_configs": [ 749// { 750// "log_type": "DATA_READ", 751// "exempted_members": [ 752// "user:jose@example.com" 753// ] 754// }, 755// { 756// "log_type": "DATA_WRITE" 757// } 758// ] 759// } 760// 761// This enables 'DATA_READ' and 'DATA_WRITE' logging, while 762// exempting 763// jose@example.com from DATA_READ logging. 764type AuditLogConfig struct { 765 // ExemptedMembers: Specifies the identities that do not cause logging 766 // for this type of 767 // permission. 768 // Follows the same format of Binding.members. 769 ExemptedMembers []string `json:"exemptedMembers,omitempty"` 770 771 // LogType: The log type that this config enables. 772 // 773 // Possible values: 774 // "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this. 775 // "ADMIN_READ" - Admin reads. Example: CloudIAM getIamPolicy 776 // "DATA_WRITE" - Data writes. Example: CloudSQL Users create 777 // "DATA_READ" - Data reads. Example: CloudSQL Users list 778 LogType string `json:"logType,omitempty"` 779 780 // ForceSendFields is a list of field names (e.g. "ExemptedMembers") to 781 // unconditionally include in API requests. By default, fields with 782 // empty values are omitted from API requests. However, any non-pointer, 783 // non-interface field appearing in ForceSendFields will be sent to the 784 // server regardless of whether the field is empty or not. This may be 785 // used to include empty fields in Patch requests. 786 ForceSendFields []string `json:"-"` 787 788 // NullFields is a list of field names (e.g. "ExemptedMembers") to 789 // include in API requests with the JSON null value. By default, fields 790 // with empty values are omitted from API requests. However, any field 791 // with an empty value appearing in NullFields will be sent to the 792 // server as null. It is an error if a field in this list has a 793 // non-empty value. This may be used to include null fields in Patch 794 // requests. 795 NullFields []string `json:"-"` 796} 797 798func (s *AuditLogConfig) MarshalJSON() ([]byte, error) { 799 type NoMethod AuditLogConfig 800 raw := NoMethod(*s) 801 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 802} 803 804type BigQueryModelTraining struct { 805 // CurrentIteration: [Output-only, Beta] Index of current ML training 806 // iteration. Updated during create model query job to show job 807 // progress. 808 CurrentIteration int64 `json:"currentIteration,omitempty"` 809 810 // ExpectedTotalIterations: [Output-only, Beta] Expected number of 811 // iterations for the create model query job specified as num_iterations 812 // in the input query. The actual total number of iterations may be less 813 // than this number due to early stop. 814 ExpectedTotalIterations int64 `json:"expectedTotalIterations,omitempty,string"` 815 816 // ForceSendFields is a list of field names (e.g. "CurrentIteration") to 817 // unconditionally include in API requests. By default, fields with 818 // empty values are omitted from API requests. However, any non-pointer, 819 // non-interface field appearing in ForceSendFields will be sent to the 820 // server regardless of whether the field is empty or not. This may be 821 // used to include empty fields in Patch requests. 822 ForceSendFields []string `json:"-"` 823 824 // NullFields is a list of field names (e.g. "CurrentIteration") to 825 // include in API requests with the JSON null value. By default, fields 826 // with empty values are omitted from API requests. However, any field 827 // with an empty value appearing in NullFields will be sent to the 828 // server as null. It is an error if a field in this list has a 829 // non-empty value. This may be used to include null fields in Patch 830 // requests. 831 NullFields []string `json:"-"` 832} 833 834func (s *BigQueryModelTraining) MarshalJSON() ([]byte, error) { 835 type NoMethod BigQueryModelTraining 836 raw := NoMethod(*s) 837 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 838} 839 840type BigtableColumn struct { 841 // Encoding: [Optional] The encoding of the values when the type is not 842 // STRING. Acceptable encoding values are: TEXT - indicates values are 843 // alphanumeric text strings. BINARY - indicates values are encoded 844 // using HBase Bytes.toBytes family of functions. 'encoding' can also be 845 // set at the column family level. However, the setting at this level 846 // takes precedence if 'encoding' is set at both levels. 847 Encoding string `json:"encoding,omitempty"` 848 849 // FieldName: [Optional] If the qualifier is not a valid BigQuery field 850 // identifier i.e. does not match [a-zA-Z][a-zA-Z0-9_]*, a valid 851 // identifier must be provided as the column field name and is used as 852 // field name in queries. 853 FieldName string `json:"fieldName,omitempty"` 854 855 // OnlyReadLatest: [Optional] If this is set, only the latest version of 856 // value in this column are exposed. 'onlyReadLatest' can also be set at 857 // the column family level. However, the setting at this level takes 858 // precedence if 'onlyReadLatest' is set at both levels. 859 OnlyReadLatest bool `json:"onlyReadLatest,omitempty"` 860 861 // QualifierEncoded: [Required] Qualifier of the column. Columns in the 862 // parent column family that has this exact qualifier are exposed as . 863 // field. If the qualifier is valid UTF-8 string, it can be specified in 864 // the qualifier_string field. Otherwise, a base-64 encoded value must 865 // be set to qualifier_encoded. The column field name is the same as the 866 // column qualifier. However, if the qualifier is not a valid BigQuery 867 // field identifier i.e. does not match [a-zA-Z][a-zA-Z0-9_]*, a valid 868 // identifier must be provided as field_name. 869 QualifierEncoded string `json:"qualifierEncoded,omitempty"` 870 871 QualifierString string `json:"qualifierString,omitempty"` 872 873 // Type: [Optional] The type to convert the value in cells of this 874 // column. The values are expected to be encoded using HBase 875 // Bytes.toBytes function when using the BINARY encoding value. 876 // Following BigQuery types are allowed (case-sensitive) - BYTES STRING 877 // INTEGER FLOAT BOOLEAN Default type is BYTES. 'type' can also be set 878 // at the column family level. However, the setting at this level takes 879 // precedence if 'type' is set at both levels. 880 Type string `json:"type,omitempty"` 881 882 // ForceSendFields is a list of field names (e.g. "Encoding") to 883 // unconditionally include in API requests. By default, fields with 884 // empty values are omitted from API requests. However, any non-pointer, 885 // non-interface field appearing in ForceSendFields will be sent to the 886 // server regardless of whether the field is empty or not. This may be 887 // used to include empty fields in Patch requests. 888 ForceSendFields []string `json:"-"` 889 890 // NullFields is a list of field names (e.g. "Encoding") to include in 891 // API requests with the JSON null value. By default, fields with empty 892 // values are omitted from API requests. However, any field with an 893 // empty value appearing in NullFields will be sent to the server as 894 // null. It is an error if a field in this list has a non-empty value. 895 // This may be used to include null fields in Patch requests. 896 NullFields []string `json:"-"` 897} 898 899func (s *BigtableColumn) MarshalJSON() ([]byte, error) { 900 type NoMethod BigtableColumn 901 raw := NoMethod(*s) 902 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 903} 904 905type BigtableColumnFamily struct { 906 // Columns: [Optional] Lists of columns that should be exposed as 907 // individual fields as opposed to a list of (column name, value) pairs. 908 // All columns whose qualifier matches a qualifier in this list can be 909 // accessed as .. Other columns can be accessed as a list through 910 // .Column field. 911 Columns []*BigtableColumn `json:"columns,omitempty"` 912 913 // Encoding: [Optional] The encoding of the values when the type is not 914 // STRING. Acceptable encoding values are: TEXT - indicates values are 915 // alphanumeric text strings. BINARY - indicates values are encoded 916 // using HBase Bytes.toBytes family of functions. This can be overridden 917 // for a specific column by listing that column in 'columns' and 918 // specifying an encoding for it. 919 Encoding string `json:"encoding,omitempty"` 920 921 // FamilyId: Identifier of the column family. 922 FamilyId string `json:"familyId,omitempty"` 923 924 // OnlyReadLatest: [Optional] If this is set only the latest version of 925 // value are exposed for all columns in this column family. This can be 926 // overridden for a specific column by listing that column in 'columns' 927 // and specifying a different setting for that column. 928 OnlyReadLatest bool `json:"onlyReadLatest,omitempty"` 929 930 // Type: [Optional] The type to convert the value in cells of this 931 // column family. The values are expected to be encoded using HBase 932 // Bytes.toBytes function when using the BINARY encoding value. 933 // Following BigQuery types are allowed (case-sensitive) - BYTES STRING 934 // INTEGER FLOAT BOOLEAN Default type is BYTES. This can be overridden 935 // for a specific column by listing that column in 'columns' and 936 // specifying a type for it. 937 Type string `json:"type,omitempty"` 938 939 // ForceSendFields is a list of field names (e.g. "Columns") to 940 // unconditionally include in API requests. By default, fields with 941 // empty values are omitted from API requests. However, any non-pointer, 942 // non-interface field appearing in ForceSendFields will be sent to the 943 // server regardless of whether the field is empty or not. This may be 944 // used to include empty fields in Patch requests. 945 ForceSendFields []string `json:"-"` 946 947 // NullFields is a list of field names (e.g. "Columns") to include in 948 // API requests with the JSON null value. By default, fields with empty 949 // values are omitted from API requests. However, any field with an 950 // empty value appearing in NullFields will be sent to the server as 951 // null. It is an error if a field in this list has a non-empty value. 952 // This may be used to include null fields in Patch requests. 953 NullFields []string `json:"-"` 954} 955 956func (s *BigtableColumnFamily) MarshalJSON() ([]byte, error) { 957 type NoMethod BigtableColumnFamily 958 raw := NoMethod(*s) 959 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 960} 961 962type BigtableOptions struct { 963 // ColumnFamilies: [Optional] List of column families to expose in the 964 // table schema along with their types. This list restricts the column 965 // families that can be referenced in queries and specifies their value 966 // types. You can use this list to do type conversions - see the 'type' 967 // field for more details. If you leave this list empty, all column 968 // families are present in the table schema and their values are read as 969 // BYTES. During a query only the column families referenced in that 970 // query are read from Bigtable. 971 ColumnFamilies []*BigtableColumnFamily `json:"columnFamilies,omitempty"` 972 973 // IgnoreUnspecifiedColumnFamilies: [Optional] If field is true, then 974 // the column families that are not specified in columnFamilies list are 975 // not exposed in the table schema. Otherwise, they are read with BYTES 976 // type values. The default value is false. 977 IgnoreUnspecifiedColumnFamilies bool `json:"ignoreUnspecifiedColumnFamilies,omitempty"` 978 979 // ReadRowkeyAsString: [Optional] If field is true, then the rowkey 980 // column families will be read and converted to string. Otherwise they 981 // are read with BYTES type values and users need to manually cast them 982 // with CAST if necessary. The default value is false. 983 ReadRowkeyAsString bool `json:"readRowkeyAsString,omitempty"` 984 985 // ForceSendFields is a list of field names (e.g. "ColumnFamilies") to 986 // unconditionally include in API requests. By default, fields with 987 // empty values are omitted from API requests. However, any non-pointer, 988 // non-interface field appearing in ForceSendFields will be sent to the 989 // server regardless of whether the field is empty or not. This may be 990 // used to include empty fields in Patch requests. 991 ForceSendFields []string `json:"-"` 992 993 // NullFields is a list of field names (e.g. "ColumnFamilies") to 994 // include in API requests with the JSON null value. By default, fields 995 // with empty values are omitted from API requests. However, any field 996 // with an empty value appearing in NullFields will be sent to the 997 // server as null. It is an error if a field in this list has a 998 // non-empty value. This may be used to include null fields in Patch 999 // requests. 1000 NullFields []string `json:"-"` 1001} 1002 1003func (s *BigtableOptions) MarshalJSON() ([]byte, error) { 1004 type NoMethod BigtableOptions 1005 raw := NoMethod(*s) 1006 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1007} 1008 1009// BinaryClassificationMetrics: Evaluation metrics for binary 1010// classification/classifier models. 1011type BinaryClassificationMetrics struct { 1012 // AggregateClassificationMetrics: Aggregate classification metrics. 1013 AggregateClassificationMetrics *AggregateClassificationMetrics `json:"aggregateClassificationMetrics,omitempty"` 1014 1015 // BinaryConfusionMatrixList: Binary confusion matrix at multiple 1016 // thresholds. 1017 BinaryConfusionMatrixList []*BinaryConfusionMatrix `json:"binaryConfusionMatrixList,omitempty"` 1018 1019 // NegativeLabel: Label representing the negative class. 1020 NegativeLabel string `json:"negativeLabel,omitempty"` 1021 1022 // PositiveLabel: Label representing the positive class. 1023 PositiveLabel string `json:"positiveLabel,omitempty"` 1024 1025 // ForceSendFields is a list of field names (e.g. 1026 // "AggregateClassificationMetrics") to unconditionally include in API 1027 // requests. By default, fields with empty values are omitted from API 1028 // requests. However, any non-pointer, non-interface field appearing in 1029 // ForceSendFields will be sent to the server regardless of whether the 1030 // field is empty or not. This may be used to include empty fields in 1031 // Patch requests. 1032 ForceSendFields []string `json:"-"` 1033 1034 // NullFields is a list of field names (e.g. 1035 // "AggregateClassificationMetrics") to include in API requests with the 1036 // JSON null value. By default, fields with empty values are omitted 1037 // from API requests. However, any field with an empty value appearing 1038 // in NullFields will be sent to the server as null. It is an error if a 1039 // field in this list has a non-empty value. This may be used to include 1040 // null fields in Patch requests. 1041 NullFields []string `json:"-"` 1042} 1043 1044func (s *BinaryClassificationMetrics) MarshalJSON() ([]byte, error) { 1045 type NoMethod BinaryClassificationMetrics 1046 raw := NoMethod(*s) 1047 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1048} 1049 1050// BinaryConfusionMatrix: Confusion matrix for binary classification 1051// models. 1052type BinaryConfusionMatrix struct { 1053 // Accuracy: The fraction of predictions given the correct label. 1054 Accuracy float64 `json:"accuracy,omitempty"` 1055 1056 // F1Score: The equally weighted average of recall and precision. 1057 F1Score float64 `json:"f1Score,omitempty"` 1058 1059 // FalseNegatives: Number of false samples predicted as false. 1060 FalseNegatives int64 `json:"falseNegatives,omitempty,string"` 1061 1062 // FalsePositives: Number of false samples predicted as true. 1063 FalsePositives int64 `json:"falsePositives,omitempty,string"` 1064 1065 // PositiveClassThreshold: Threshold value used when computing each of 1066 // the following metric. 1067 PositiveClassThreshold float64 `json:"positiveClassThreshold,omitempty"` 1068 1069 // Precision: The fraction of actual positive predictions that had 1070 // positive actual 1071 // labels. 1072 Precision float64 `json:"precision,omitempty"` 1073 1074 // Recall: The fraction of actual positive labels that were given a 1075 // positive 1076 // prediction. 1077 Recall float64 `json:"recall,omitempty"` 1078 1079 // TrueNegatives: Number of true samples predicted as false. 1080 TrueNegatives int64 `json:"trueNegatives,omitempty,string"` 1081 1082 // TruePositives: Number of true samples predicted as true. 1083 TruePositives int64 `json:"truePositives,omitempty,string"` 1084 1085 // ForceSendFields is a list of field names (e.g. "Accuracy") to 1086 // unconditionally include in API requests. By default, fields with 1087 // empty values are omitted from API requests. However, any non-pointer, 1088 // non-interface field appearing in ForceSendFields will be sent to the 1089 // server regardless of whether the field is empty or not. This may be 1090 // used to include empty fields in Patch requests. 1091 ForceSendFields []string `json:"-"` 1092 1093 // NullFields is a list of field names (e.g. "Accuracy") to include in 1094 // API requests with the JSON null value. By default, fields with empty 1095 // values are omitted from API requests. However, any field with an 1096 // empty value appearing in NullFields will be sent to the server as 1097 // null. It is an error if a field in this list has a non-empty value. 1098 // This may be used to include null fields in Patch requests. 1099 NullFields []string `json:"-"` 1100} 1101 1102func (s *BinaryConfusionMatrix) MarshalJSON() ([]byte, error) { 1103 type NoMethod BinaryConfusionMatrix 1104 raw := NoMethod(*s) 1105 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1106} 1107 1108func (s *BinaryConfusionMatrix) UnmarshalJSON(data []byte) error { 1109 type NoMethod BinaryConfusionMatrix 1110 var s1 struct { 1111 Accuracy gensupport.JSONFloat64 `json:"accuracy"` 1112 F1Score gensupport.JSONFloat64 `json:"f1Score"` 1113 PositiveClassThreshold gensupport.JSONFloat64 `json:"positiveClassThreshold"` 1114 Precision gensupport.JSONFloat64 `json:"precision"` 1115 Recall gensupport.JSONFloat64 `json:"recall"` 1116 *NoMethod 1117 } 1118 s1.NoMethod = (*NoMethod)(s) 1119 if err := json.Unmarshal(data, &s1); err != nil { 1120 return err 1121 } 1122 s.Accuracy = float64(s1.Accuracy) 1123 s.F1Score = float64(s1.F1Score) 1124 s.PositiveClassThreshold = float64(s1.PositiveClassThreshold) 1125 s.Precision = float64(s1.Precision) 1126 s.Recall = float64(s1.Recall) 1127 return nil 1128} 1129 1130// Binding: Associates `members` with a `role`. 1131type Binding struct { 1132 // Condition: The condition that is associated with this binding. 1133 // 1134 // If the condition evaluates to `true`, then this binding applies to 1135 // the 1136 // current request. 1137 // 1138 // If the condition evaluates to `false`, then this binding does not 1139 // apply to 1140 // the current request. However, a different role binding might grant 1141 // the same 1142 // role to one or more of the members in this binding. 1143 // 1144 // To learn which resources support conditions in their IAM policies, 1145 // see 1146 // the 1147 // [IAM 1148 // documentation](https://cloud.google.com/iam/help/conditions/r 1149 // esource-policies). 1150 Condition *Expr `json:"condition,omitempty"` 1151 1152 // Members: Specifies the identities requesting access for a Cloud 1153 // Platform resource. 1154 // `members` can have the following values: 1155 // 1156 // * `allUsers`: A special identifier that represents anyone who is 1157 // on the internet; with or without a Google account. 1158 // 1159 // * `allAuthenticatedUsers`: A special identifier that represents 1160 // anyone 1161 // who is authenticated with a Google account or a service 1162 // account. 1163 // 1164 // * `user:{emailid}`: An email address that represents a specific 1165 // Google 1166 // account. For example, `alice@example.com` . 1167 // 1168 // 1169 // * `serviceAccount:{emailid}`: An email address that represents a 1170 // service 1171 // account. For example, 1172 // `my-other-app@appspot.gserviceaccount.com`. 1173 // 1174 // * `group:{emailid}`: An email address that represents a Google 1175 // group. 1176 // For example, `admins@example.com`. 1177 // 1178 // * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus 1179 // unique 1180 // identifier) representing a user that has been recently deleted. 1181 // For 1182 // example, `alice@example.com?uid=123456789012345678901`. If the 1183 // user is 1184 // recovered, this value reverts to `user:{emailid}` and the 1185 // recovered user 1186 // retains the role in the binding. 1187 // 1188 // * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address 1189 // (plus 1190 // unique identifier) representing a service account that has been 1191 // recently 1192 // deleted. For example, 1193 // 1194 // `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. 1195 // 1196 // If the service account is undeleted, this value reverts to 1197 // `serviceAccount:{emailid}` and the undeleted service account 1198 // retains the 1199 // role in the binding. 1200 // 1201 // * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus 1202 // unique 1203 // identifier) representing a Google group that has been recently 1204 // deleted. For example, 1205 // `admins@example.com?uid=123456789012345678901`. If 1206 // the group is recovered, this value reverts to `group:{emailid}` 1207 // and the 1208 // recovered group retains the role in the binding. 1209 // 1210 // 1211 // * `domain:{domain}`: The G Suite domain (primary) that represents all 1212 // the 1213 // users of that domain. For example, `google.com` or 1214 // `example.com`. 1215 // 1216 // 1217 Members []string `json:"members,omitempty"` 1218 1219 // Role: Role that is assigned to `members`. 1220 // For example, `roles/viewer`, `roles/editor`, or `roles/owner`. 1221 Role string `json:"role,omitempty"` 1222 1223 // ForceSendFields is a list of field names (e.g. "Condition") to 1224 // unconditionally include in API requests. By default, fields with 1225 // empty values are omitted from API requests. However, any non-pointer, 1226 // non-interface field appearing in ForceSendFields will be sent to the 1227 // server regardless of whether the field is empty or not. This may be 1228 // used to include empty fields in Patch requests. 1229 ForceSendFields []string `json:"-"` 1230 1231 // NullFields is a list of field names (e.g. "Condition") to include in 1232 // API requests with the JSON null value. By default, fields with empty 1233 // values are omitted from API requests. However, any field with an 1234 // empty value appearing in NullFields will be sent to the server as 1235 // null. It is an error if a field in this list has a non-empty value. 1236 // This may be used to include null fields in Patch requests. 1237 NullFields []string `json:"-"` 1238} 1239 1240func (s *Binding) MarshalJSON() ([]byte, error) { 1241 type NoMethod Binding 1242 raw := NoMethod(*s) 1243 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1244} 1245 1246type BqmlIterationResult struct { 1247 // DurationMs: [Output-only, Beta] Time taken to run the training 1248 // iteration in milliseconds. 1249 DurationMs int64 `json:"durationMs,omitempty,string"` 1250 1251 // EvalLoss: [Output-only, Beta] Eval loss computed on the eval data at 1252 // the end of the iteration. The eval loss is used for early stopping to 1253 // avoid overfitting. No eval loss if eval_split_method option is 1254 // specified as no_split or auto_split with input data size less than 1255 // 500 rows. 1256 EvalLoss float64 `json:"evalLoss,omitempty"` 1257 1258 // Index: [Output-only, Beta] Index of the ML training iteration, 1259 // starting from zero for each training run. 1260 Index int64 `json:"index,omitempty"` 1261 1262 // LearnRate: [Output-only, Beta] Learning rate used for this iteration, 1263 // it varies for different training iterations if learn_rate_strategy 1264 // option is not constant. 1265 LearnRate float64 `json:"learnRate,omitempty"` 1266 1267 // TrainingLoss: [Output-only, Beta] Training loss computed on the 1268 // training data at the end of the iteration. The training loss function 1269 // is defined by model type. 1270 TrainingLoss float64 `json:"trainingLoss,omitempty"` 1271 1272 // ForceSendFields is a list of field names (e.g. "DurationMs") to 1273 // unconditionally include in API requests. By default, fields with 1274 // empty values are omitted from API requests. However, any non-pointer, 1275 // non-interface field appearing in ForceSendFields will be sent to the 1276 // server regardless of whether the field is empty or not. This may be 1277 // used to include empty fields in Patch requests. 1278 ForceSendFields []string `json:"-"` 1279 1280 // NullFields is a list of field names (e.g. "DurationMs") to include in 1281 // API requests with the JSON null value. By default, fields with empty 1282 // values are omitted from API requests. However, any field with an 1283 // empty value appearing in NullFields will be sent to the server as 1284 // null. It is an error if a field in this list has a non-empty value. 1285 // This may be used to include null fields in Patch requests. 1286 NullFields []string `json:"-"` 1287} 1288 1289func (s *BqmlIterationResult) MarshalJSON() ([]byte, error) { 1290 type NoMethod BqmlIterationResult 1291 raw := NoMethod(*s) 1292 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1293} 1294 1295func (s *BqmlIterationResult) UnmarshalJSON(data []byte) error { 1296 type NoMethod BqmlIterationResult 1297 var s1 struct { 1298 EvalLoss gensupport.JSONFloat64 `json:"evalLoss"` 1299 LearnRate gensupport.JSONFloat64 `json:"learnRate"` 1300 TrainingLoss gensupport.JSONFloat64 `json:"trainingLoss"` 1301 *NoMethod 1302 } 1303 s1.NoMethod = (*NoMethod)(s) 1304 if err := json.Unmarshal(data, &s1); err != nil { 1305 return err 1306 } 1307 s.EvalLoss = float64(s1.EvalLoss) 1308 s.LearnRate = float64(s1.LearnRate) 1309 s.TrainingLoss = float64(s1.TrainingLoss) 1310 return nil 1311} 1312 1313type BqmlTrainingRun struct { 1314 // IterationResults: [Output-only, Beta] List of each iteration results. 1315 IterationResults []*BqmlIterationResult `json:"iterationResults,omitempty"` 1316 1317 // StartTime: [Output-only, Beta] Training run start time in 1318 // milliseconds since the epoch. 1319 StartTime string `json:"startTime,omitempty"` 1320 1321 // State: [Output-only, Beta] Different state applicable for a training 1322 // run. IN PROGRESS: Training run is in progress. FAILED: Training run 1323 // ended due to a non-retryable failure. SUCCEEDED: Training run 1324 // successfully completed. CANCELLED: Training run cancelled by the 1325 // user. 1326 State string `json:"state,omitempty"` 1327 1328 // TrainingOptions: [Output-only, Beta] Training options used by this 1329 // training run. These options are mutable for subsequent training runs. 1330 // Default values are explicitly stored for options not specified in the 1331 // input query of the first training run. For subsequent training runs, 1332 // any option not explicitly specified in the input query will be copied 1333 // from the previous training run. 1334 TrainingOptions *BqmlTrainingRunTrainingOptions `json:"trainingOptions,omitempty"` 1335 1336 // ForceSendFields is a list of field names (e.g. "IterationResults") to 1337 // unconditionally include in API requests. By default, fields with 1338 // empty values are omitted from API requests. However, any non-pointer, 1339 // non-interface field appearing in ForceSendFields will be sent to the 1340 // server regardless of whether the field is empty or not. This may be 1341 // used to include empty fields in Patch requests. 1342 ForceSendFields []string `json:"-"` 1343 1344 // NullFields is a list of field names (e.g. "IterationResults") to 1345 // include in API requests with the JSON null value. By default, fields 1346 // with empty values are omitted from API requests. However, any field 1347 // with an empty value appearing in NullFields will be sent to the 1348 // server as null. It is an error if a field in this list has a 1349 // non-empty value. This may be used to include null fields in Patch 1350 // requests. 1351 NullFields []string `json:"-"` 1352} 1353 1354func (s *BqmlTrainingRun) MarshalJSON() ([]byte, error) { 1355 type NoMethod BqmlTrainingRun 1356 raw := NoMethod(*s) 1357 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1358} 1359 1360// BqmlTrainingRunTrainingOptions: [Output-only, Beta] Training options 1361// used by this training run. These options are mutable for subsequent 1362// training runs. Default values are explicitly stored for options not 1363// specified in the input query of the first training run. For 1364// subsequent training runs, any option not explicitly specified in the 1365// input query will be copied from the previous training run. 1366type BqmlTrainingRunTrainingOptions struct { 1367 EarlyStop bool `json:"earlyStop,omitempty"` 1368 1369 L1Reg float64 `json:"l1Reg,omitempty"` 1370 1371 L2Reg float64 `json:"l2Reg,omitempty"` 1372 1373 LearnRate float64 `json:"learnRate,omitempty"` 1374 1375 LearnRateStrategy string `json:"learnRateStrategy,omitempty"` 1376 1377 LineSearchInitLearnRate float64 `json:"lineSearchInitLearnRate,omitempty"` 1378 1379 MaxIteration int64 `json:"maxIteration,omitempty,string"` 1380 1381 MinRelProgress float64 `json:"minRelProgress,omitempty"` 1382 1383 WarmStart bool `json:"warmStart,omitempty"` 1384 1385 // ForceSendFields is a list of field names (e.g. "EarlyStop") to 1386 // unconditionally include in API requests. By default, fields with 1387 // empty values are omitted from API requests. However, any non-pointer, 1388 // non-interface field appearing in ForceSendFields will be sent to the 1389 // server regardless of whether the field is empty or not. This may be 1390 // used to include empty fields in Patch requests. 1391 ForceSendFields []string `json:"-"` 1392 1393 // NullFields is a list of field names (e.g. "EarlyStop") to include in 1394 // API requests with the JSON null value. By default, fields with empty 1395 // values are omitted from API requests. However, any field with an 1396 // empty value appearing in NullFields will be sent to the server as 1397 // null. It is an error if a field in this list has a non-empty value. 1398 // This may be used to include null fields in Patch requests. 1399 NullFields []string `json:"-"` 1400} 1401 1402func (s *BqmlTrainingRunTrainingOptions) MarshalJSON() ([]byte, error) { 1403 type NoMethod BqmlTrainingRunTrainingOptions 1404 raw := NoMethod(*s) 1405 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1406} 1407 1408func (s *BqmlTrainingRunTrainingOptions) UnmarshalJSON(data []byte) error { 1409 type NoMethod BqmlTrainingRunTrainingOptions 1410 var s1 struct { 1411 L1Reg gensupport.JSONFloat64 `json:"l1Reg"` 1412 L2Reg gensupport.JSONFloat64 `json:"l2Reg"` 1413 LearnRate gensupport.JSONFloat64 `json:"learnRate"` 1414 LineSearchInitLearnRate gensupport.JSONFloat64 `json:"lineSearchInitLearnRate"` 1415 MinRelProgress gensupport.JSONFloat64 `json:"minRelProgress"` 1416 *NoMethod 1417 } 1418 s1.NoMethod = (*NoMethod)(s) 1419 if err := json.Unmarshal(data, &s1); err != nil { 1420 return err 1421 } 1422 s.L1Reg = float64(s1.L1Reg) 1423 s.L2Reg = float64(s1.L2Reg) 1424 s.LearnRate = float64(s1.LearnRate) 1425 s.LineSearchInitLearnRate = float64(s1.LineSearchInitLearnRate) 1426 s.MinRelProgress = float64(s1.MinRelProgress) 1427 return nil 1428} 1429 1430// CategoricalValue: Representative value of a categorical feature. 1431type CategoricalValue struct { 1432 // CategoryCounts: Counts of all categories for the categorical feature. 1433 // If there are 1434 // more than ten categories, we return top ten (by count) and return 1435 // one more CategoryCount with category "_OTHER_" and count as 1436 // aggregate counts of remaining categories. 1437 CategoryCounts []*CategoryCount `json:"categoryCounts,omitempty"` 1438 1439 // ForceSendFields is a list of field names (e.g. "CategoryCounts") to 1440 // unconditionally include in API requests. By default, fields with 1441 // empty values are omitted from API requests. However, any non-pointer, 1442 // non-interface field appearing in ForceSendFields will be sent to the 1443 // server regardless of whether the field is empty or not. This may be 1444 // used to include empty fields in Patch requests. 1445 ForceSendFields []string `json:"-"` 1446 1447 // NullFields is a list of field names (e.g. "CategoryCounts") to 1448 // include in API requests with the JSON null value. By default, fields 1449 // with empty values are omitted from API requests. However, any field 1450 // with an empty value appearing in NullFields will be sent to the 1451 // server as null. It is an error if a field in this list has a 1452 // non-empty value. This may be used to include null fields in Patch 1453 // requests. 1454 NullFields []string `json:"-"` 1455} 1456 1457func (s *CategoricalValue) MarshalJSON() ([]byte, error) { 1458 type NoMethod CategoricalValue 1459 raw := NoMethod(*s) 1460 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1461} 1462 1463// CategoryCount: Represents the count of a single category within the 1464// cluster. 1465type CategoryCount struct { 1466 // Category: The name of category. 1467 Category string `json:"category,omitempty"` 1468 1469 // Count: The count of training samples matching the category within 1470 // the 1471 // cluster. 1472 Count int64 `json:"count,omitempty,string"` 1473 1474 // ForceSendFields is a list of field names (e.g. "Category") to 1475 // unconditionally include in API requests. By default, fields with 1476 // empty values are omitted from API requests. However, any non-pointer, 1477 // non-interface field appearing in ForceSendFields will be sent to the 1478 // server regardless of whether the field is empty or not. This may be 1479 // used to include empty fields in Patch requests. 1480 ForceSendFields []string `json:"-"` 1481 1482 // NullFields is a list of field names (e.g. "Category") to include in 1483 // API requests with the JSON null value. By default, fields with empty 1484 // values are omitted from API requests. However, any field with an 1485 // empty value appearing in NullFields will be sent to the server as 1486 // null. It is an error if a field in this list has a non-empty value. 1487 // This may be used to include null fields in Patch requests. 1488 NullFields []string `json:"-"` 1489} 1490 1491func (s *CategoryCount) MarshalJSON() ([]byte, error) { 1492 type NoMethod CategoryCount 1493 raw := NoMethod(*s) 1494 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1495} 1496 1497// Cluster: Message containing the information about one cluster. 1498type Cluster struct { 1499 // CentroidId: Centroid id. 1500 CentroidId int64 `json:"centroidId,omitempty,string"` 1501 1502 // Count: Count of training data rows that were assigned to this 1503 // cluster. 1504 Count int64 `json:"count,omitempty,string"` 1505 1506 // FeatureValues: Values of highly variant features for this cluster. 1507 FeatureValues []*FeatureValue `json:"featureValues,omitempty"` 1508 1509 // ForceSendFields is a list of field names (e.g. "CentroidId") to 1510 // unconditionally include in API requests. By default, fields with 1511 // empty values are omitted from API requests. However, any non-pointer, 1512 // non-interface field appearing in ForceSendFields will be sent to the 1513 // server regardless of whether the field is empty or not. This may be 1514 // used to include empty fields in Patch requests. 1515 ForceSendFields []string `json:"-"` 1516 1517 // NullFields is a list of field names (e.g. "CentroidId") to include in 1518 // API requests with the JSON null value. By default, fields with empty 1519 // values are omitted from API requests. However, any field with an 1520 // empty value appearing in NullFields will be sent to the server as 1521 // null. It is an error if a field in this list has a non-empty value. 1522 // This may be used to include null fields in Patch requests. 1523 NullFields []string `json:"-"` 1524} 1525 1526func (s *Cluster) MarshalJSON() ([]byte, error) { 1527 type NoMethod Cluster 1528 raw := NoMethod(*s) 1529 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1530} 1531 1532// ClusterInfo: Information about a single cluster for clustering model. 1533type ClusterInfo struct { 1534 // CentroidId: Centroid id. 1535 CentroidId int64 `json:"centroidId,omitempty,string"` 1536 1537 // ClusterRadius: Cluster radius, the average distance from centroid 1538 // to each point assigned to the cluster. 1539 ClusterRadius float64 `json:"clusterRadius,omitempty"` 1540 1541 // ClusterSize: Cluster size, the total number of points assigned to the 1542 // cluster. 1543 ClusterSize int64 `json:"clusterSize,omitempty,string"` 1544 1545 // ForceSendFields is a list of field names (e.g. "CentroidId") to 1546 // unconditionally include in API requests. By default, fields with 1547 // empty values are omitted from API requests. However, any non-pointer, 1548 // non-interface field appearing in ForceSendFields will be sent to the 1549 // server regardless of whether the field is empty or not. This may be 1550 // used to include empty fields in Patch requests. 1551 ForceSendFields []string `json:"-"` 1552 1553 // NullFields is a list of field names (e.g. "CentroidId") to include in 1554 // API requests with the JSON null value. By default, fields with empty 1555 // values are omitted from API requests. However, any field with an 1556 // empty value appearing in NullFields will be sent to the server as 1557 // null. It is an error if a field in this list has a non-empty value. 1558 // This may be used to include null fields in Patch requests. 1559 NullFields []string `json:"-"` 1560} 1561 1562func (s *ClusterInfo) MarshalJSON() ([]byte, error) { 1563 type NoMethod ClusterInfo 1564 raw := NoMethod(*s) 1565 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1566} 1567 1568func (s *ClusterInfo) UnmarshalJSON(data []byte) error { 1569 type NoMethod ClusterInfo 1570 var s1 struct { 1571 ClusterRadius gensupport.JSONFloat64 `json:"clusterRadius"` 1572 *NoMethod 1573 } 1574 s1.NoMethod = (*NoMethod)(s) 1575 if err := json.Unmarshal(data, &s1); err != nil { 1576 return err 1577 } 1578 s.ClusterRadius = float64(s1.ClusterRadius) 1579 return nil 1580} 1581 1582type Clustering struct { 1583 // Fields: [Repeated] One or more fields on which data should be 1584 // clustered. Only top-level, non-repeated, simple-type fields are 1585 // supported. When you cluster a table using multiple columns, the order 1586 // of columns you specify is important. The order of the specified 1587 // columns determines the sort order of the data. 1588 Fields []string `json:"fields,omitempty"` 1589 1590 // ForceSendFields is a list of field names (e.g. "Fields") to 1591 // unconditionally include in API requests. By default, fields with 1592 // empty values are omitted from API requests. However, any non-pointer, 1593 // non-interface field appearing in ForceSendFields will be sent to the 1594 // server regardless of whether the field is empty or not. This may be 1595 // used to include empty fields in Patch requests. 1596 ForceSendFields []string `json:"-"` 1597 1598 // NullFields is a list of field names (e.g. "Fields") to include in API 1599 // requests with the JSON null value. By default, fields with empty 1600 // values are omitted from API requests. However, any field with an 1601 // empty value appearing in NullFields will be sent to the server as 1602 // null. It is an error if a field in this list has a non-empty value. 1603 // This may be used to include null fields in Patch requests. 1604 NullFields []string `json:"-"` 1605} 1606 1607func (s *Clustering) MarshalJSON() ([]byte, error) { 1608 type NoMethod Clustering 1609 raw := NoMethod(*s) 1610 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1611} 1612 1613// ClusteringMetrics: Evaluation metrics for clustering models. 1614type ClusteringMetrics struct { 1615 // Clusters: [Beta] Information for all clusters. 1616 Clusters []*Cluster `json:"clusters,omitempty"` 1617 1618 // DaviesBouldinIndex: Davies-Bouldin index. 1619 DaviesBouldinIndex float64 `json:"daviesBouldinIndex,omitempty"` 1620 1621 // MeanSquaredDistance: Mean of squared distances between each sample to 1622 // its cluster centroid. 1623 MeanSquaredDistance float64 `json:"meanSquaredDistance,omitempty"` 1624 1625 // ForceSendFields is a list of field names (e.g. "Clusters") to 1626 // unconditionally include in API requests. By default, fields with 1627 // empty values are omitted from API requests. However, any non-pointer, 1628 // non-interface field appearing in ForceSendFields will be sent to the 1629 // server regardless of whether the field is empty or not. This may be 1630 // used to include empty fields in Patch requests. 1631 ForceSendFields []string `json:"-"` 1632 1633 // NullFields is a list of field names (e.g. "Clusters") to include in 1634 // API requests with the JSON null value. By default, fields with empty 1635 // values are omitted from API requests. However, any field with an 1636 // empty value appearing in NullFields will be sent to the server as 1637 // null. It is an error if a field in this list has a non-empty value. 1638 // This may be used to include null fields in Patch requests. 1639 NullFields []string `json:"-"` 1640} 1641 1642func (s *ClusteringMetrics) MarshalJSON() ([]byte, error) { 1643 type NoMethod ClusteringMetrics 1644 raw := NoMethod(*s) 1645 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1646} 1647 1648func (s *ClusteringMetrics) UnmarshalJSON(data []byte) error { 1649 type NoMethod ClusteringMetrics 1650 var s1 struct { 1651 DaviesBouldinIndex gensupport.JSONFloat64 `json:"daviesBouldinIndex"` 1652 MeanSquaredDistance gensupport.JSONFloat64 `json:"meanSquaredDistance"` 1653 *NoMethod 1654 } 1655 s1.NoMethod = (*NoMethod)(s) 1656 if err := json.Unmarshal(data, &s1); err != nil { 1657 return err 1658 } 1659 s.DaviesBouldinIndex = float64(s1.DaviesBouldinIndex) 1660 s.MeanSquaredDistance = float64(s1.MeanSquaredDistance) 1661 return nil 1662} 1663 1664// ConfusionMatrix: Confusion matrix for multi-class classification 1665// models. 1666type ConfusionMatrix struct { 1667 // ConfidenceThreshold: Confidence threshold used when computing the 1668 // entries of the 1669 // confusion matrix. 1670 ConfidenceThreshold float64 `json:"confidenceThreshold,omitempty"` 1671 1672 // Rows: One row per actual label. 1673 Rows []*Row `json:"rows,omitempty"` 1674 1675 // ForceSendFields is a list of field names (e.g. "ConfidenceThreshold") 1676 // to unconditionally include in API requests. By default, fields with 1677 // empty values are omitted from API requests. However, any non-pointer, 1678 // non-interface field appearing in ForceSendFields will be sent to the 1679 // server regardless of whether the field is empty or not. This may be 1680 // used to include empty fields in Patch requests. 1681 ForceSendFields []string `json:"-"` 1682 1683 // NullFields is a list of field names (e.g. "ConfidenceThreshold") to 1684 // include in API requests with the JSON null value. By default, fields 1685 // with empty values are omitted from API requests. However, any field 1686 // with an empty value appearing in NullFields will be sent to the 1687 // server as null. It is an error if a field in this list has a 1688 // non-empty value. This may be used to include null fields in Patch 1689 // requests. 1690 NullFields []string `json:"-"` 1691} 1692 1693func (s *ConfusionMatrix) MarshalJSON() ([]byte, error) { 1694 type NoMethod ConfusionMatrix 1695 raw := NoMethod(*s) 1696 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1697} 1698 1699func (s *ConfusionMatrix) UnmarshalJSON(data []byte) error { 1700 type NoMethod ConfusionMatrix 1701 var s1 struct { 1702 ConfidenceThreshold gensupport.JSONFloat64 `json:"confidenceThreshold"` 1703 *NoMethod 1704 } 1705 s1.NoMethod = (*NoMethod)(s) 1706 if err := json.Unmarshal(data, &s1); err != nil { 1707 return err 1708 } 1709 s.ConfidenceThreshold = float64(s1.ConfidenceThreshold) 1710 return nil 1711} 1712 1713type ConnectionProperty struct { 1714 // Key: [Required] Name of the connection property to set. 1715 Key string `json:"key,omitempty"` 1716 1717 // Value: [Required] Value of the connection property. 1718 Value string `json:"value,omitempty"` 1719 1720 // ForceSendFields is a list of field names (e.g. "Key") to 1721 // unconditionally include in API requests. By default, fields with 1722 // empty values are omitted from API requests. However, any non-pointer, 1723 // non-interface field appearing in ForceSendFields will be sent to the 1724 // server regardless of whether the field is empty or not. This may be 1725 // used to include empty fields in Patch requests. 1726 ForceSendFields []string `json:"-"` 1727 1728 // NullFields is a list of field names (e.g. "Key") to include in API 1729 // requests with the JSON null value. By default, fields with empty 1730 // values are omitted from API requests. However, any field with an 1731 // empty value appearing in NullFields will be sent to the server as 1732 // null. It is an error if a field in this list has a non-empty value. 1733 // This may be used to include null fields in Patch requests. 1734 NullFields []string `json:"-"` 1735} 1736 1737func (s *ConnectionProperty) MarshalJSON() ([]byte, error) { 1738 type NoMethod ConnectionProperty 1739 raw := NoMethod(*s) 1740 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1741} 1742 1743type CsvOptions struct { 1744 // AllowJaggedRows: [Optional] Indicates if BigQuery should accept rows 1745 // that are missing trailing optional columns. If true, BigQuery treats 1746 // missing trailing columns as null values. If false, records with 1747 // missing trailing columns are treated as bad records, and if there are 1748 // too many bad records, an invalid error is returned in the job result. 1749 // The default value is false. 1750 AllowJaggedRows bool `json:"allowJaggedRows,omitempty"` 1751 1752 // AllowQuotedNewlines: [Optional] Indicates if BigQuery should allow 1753 // quoted data sections that contain newline characters in a CSV file. 1754 // The default value is false. 1755 AllowQuotedNewlines bool `json:"allowQuotedNewlines,omitempty"` 1756 1757 // Encoding: [Optional] The character encoding of the data. The 1758 // supported values are UTF-8 or ISO-8859-1. The default value is UTF-8. 1759 // BigQuery decodes the data after the raw, binary data has been split 1760 // using the values of the quote and fieldDelimiter properties. 1761 Encoding string `json:"encoding,omitempty"` 1762 1763 // FieldDelimiter: [Optional] The separator for fields in a CSV file. 1764 // BigQuery converts the string to ISO-8859-1 encoding, and then uses 1765 // the first byte of the encoded string to split the data in its raw, 1766 // binary state. BigQuery also supports the escape sequence "\t" to 1767 // specify a tab separator. The default value is a comma (','). 1768 FieldDelimiter string `json:"fieldDelimiter,omitempty"` 1769 1770 // Quote: [Optional] The value that is used to quote data sections in a 1771 // CSV file. BigQuery converts the string to ISO-8859-1 encoding, and 1772 // then uses the first byte of the encoded string to split the data in 1773 // its raw, binary state. The default value is a double-quote ('"'). If 1774 // your data does not contain quoted sections, set the property value to 1775 // an empty string. If your data contains quoted newline characters, you 1776 // must also set the allowQuotedNewlines property to true. 1777 // 1778 // Default: " 1779 Quote *string `json:"quote,omitempty"` 1780 1781 // SkipLeadingRows: [Optional] The number of rows at the top of a CSV 1782 // file that BigQuery will skip when reading the data. The default value 1783 // is 0. This property is useful if you have header rows in the file 1784 // that should be skipped. When autodetect is on, the behavior is the 1785 // following: * skipLeadingRows unspecified - Autodetect tries to detect 1786 // headers in the first row. If they are not detected, the row is read 1787 // as data. Otherwise data is read starting from the second row. * 1788 // skipLeadingRows is 0 - Instructs autodetect that there are no headers 1789 // and data should be read starting from the first row. * 1790 // skipLeadingRows = N > 0 - Autodetect skips N-1 rows and tries to 1791 // detect headers in row N. If headers are not detected, row N is just 1792 // skipped. Otherwise row N is used to extract column names for the 1793 // detected schema. 1794 SkipLeadingRows int64 `json:"skipLeadingRows,omitempty,string"` 1795 1796 // ForceSendFields is a list of field names (e.g. "AllowJaggedRows") to 1797 // unconditionally include in API requests. By default, fields with 1798 // empty values are omitted from API requests. However, any non-pointer, 1799 // non-interface field appearing in ForceSendFields will be sent to the 1800 // server regardless of whether the field is empty or not. This may be 1801 // used to include empty fields in Patch requests. 1802 ForceSendFields []string `json:"-"` 1803 1804 // NullFields is a list of field names (e.g. "AllowJaggedRows") to 1805 // include in API requests with the JSON null value. By default, fields 1806 // with empty values are omitted from API requests. However, any field 1807 // with an empty value appearing in NullFields will be sent to the 1808 // server as null. It is an error if a field in this list has a 1809 // non-empty value. This may be used to include null fields in Patch 1810 // requests. 1811 NullFields []string `json:"-"` 1812} 1813 1814func (s *CsvOptions) MarshalJSON() ([]byte, error) { 1815 type NoMethod CsvOptions 1816 raw := NoMethod(*s) 1817 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1818} 1819 1820// DataSplitResult: Data split result. This contains references to the 1821// training and evaluation 1822// data tables that were used to train the model. 1823type DataSplitResult struct { 1824 // EvaluationTable: Table reference of the evaluation data after split. 1825 EvaluationTable *TableReference `json:"evaluationTable,omitempty"` 1826 1827 // TrainingTable: Table reference of the training data after split. 1828 TrainingTable *TableReference `json:"trainingTable,omitempty"` 1829 1830 // ForceSendFields is a list of field names (e.g. "EvaluationTable") to 1831 // unconditionally include in API requests. By default, fields with 1832 // empty values are omitted from API requests. However, any non-pointer, 1833 // non-interface field appearing in ForceSendFields will be sent to the 1834 // server regardless of whether the field is empty or not. This may be 1835 // used to include empty fields in Patch requests. 1836 ForceSendFields []string `json:"-"` 1837 1838 // NullFields is a list of field names (e.g. "EvaluationTable") to 1839 // include in API requests with the JSON null value. By default, fields 1840 // with empty values are omitted from API requests. However, any field 1841 // with an empty value appearing in NullFields will be sent to the 1842 // server as null. It is an error if a field in this list has a 1843 // non-empty value. This may be used to include null fields in Patch 1844 // requests. 1845 NullFields []string `json:"-"` 1846} 1847 1848func (s *DataSplitResult) MarshalJSON() ([]byte, error) { 1849 type NoMethod DataSplitResult 1850 raw := NoMethod(*s) 1851 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1852} 1853 1854type Dataset struct { 1855 // Access: [Optional] An array of objects that define dataset access for 1856 // one or more entities. You can set this property when inserting or 1857 // updating a dataset in order to control who is allowed to access the 1858 // data. If unspecified at dataset creation time, BigQuery adds default 1859 // dataset access for the following entities: access.specialGroup: 1860 // projectReaders; access.role: READER; access.specialGroup: 1861 // projectWriters; access.role: WRITER; access.specialGroup: 1862 // projectOwners; access.role: OWNER; access.userByEmail: [dataset 1863 // creator email]; access.role: OWNER; 1864 Access []*DatasetAccess `json:"access,omitempty"` 1865 1866 // CreationTime: [Output-only] The time when this dataset was created, 1867 // in milliseconds since the epoch. 1868 CreationTime int64 `json:"creationTime,omitempty,string"` 1869 1870 // DatasetReference: [Required] A reference that identifies the dataset. 1871 DatasetReference *DatasetReference `json:"datasetReference,omitempty"` 1872 1873 DefaultEncryptionConfiguration *EncryptionConfiguration `json:"defaultEncryptionConfiguration,omitempty"` 1874 1875 // DefaultPartitionExpirationMs: [Optional] The default partition 1876 // expiration for all partitioned tables in the dataset, in 1877 // milliseconds. Once this property is set, all newly-created 1878 // partitioned tables in the dataset will have an expirationMs property 1879 // in the timePartitioning settings set to this value, and changing the 1880 // value will only affect new tables, not existing ones. The storage in 1881 // a partition will have an expiration time of its partition time plus 1882 // this value. Setting this property overrides the use of 1883 // defaultTableExpirationMs for partitioned tables: only one of 1884 // defaultTableExpirationMs and defaultPartitionExpirationMs will be 1885 // used for any new partitioned table. If you provide an explicit 1886 // timePartitioning.expirationMs when creating or updating a partitioned 1887 // table, that value takes precedence over the default partition 1888 // expiration time indicated by this property. 1889 DefaultPartitionExpirationMs int64 `json:"defaultPartitionExpirationMs,omitempty,string"` 1890 1891 // DefaultTableExpirationMs: [Optional] The default lifetime of all 1892 // tables in the dataset, in milliseconds. The minimum value is 3600000 1893 // milliseconds (one hour). Once this property is set, all newly-created 1894 // tables in the dataset will have an expirationTime property set to the 1895 // creation time plus the value in this property, and changing the value 1896 // will only affect new tables, not existing ones. When the 1897 // expirationTime for a given table is reached, that table will be 1898 // deleted automatically. If a table's expirationTime is modified or 1899 // removed before the table expires, or if you provide an explicit 1900 // expirationTime when creating a table, that value takes precedence 1901 // over the default expiration time indicated by this property. 1902 DefaultTableExpirationMs int64 `json:"defaultTableExpirationMs,omitempty,string"` 1903 1904 // Description: [Optional] A user-friendly description of the dataset. 1905 Description string `json:"description,omitempty"` 1906 1907 // Etag: [Output-only] A hash of the resource. 1908 Etag string `json:"etag,omitempty"` 1909 1910 // FriendlyName: [Optional] A descriptive name for the dataset. 1911 FriendlyName string `json:"friendlyName,omitempty"` 1912 1913 // Id: [Output-only] The fully-qualified unique name of the dataset in 1914 // the format projectId:datasetId. The dataset name without the project 1915 // name is given in the datasetId field. When creating a new dataset, 1916 // leave this field blank, and instead specify the datasetId field. 1917 Id string `json:"id,omitempty"` 1918 1919 // Kind: [Output-only] The resource type. 1920 Kind string `json:"kind,omitempty"` 1921 1922 // Labels: The labels associated with this dataset. You can use these to 1923 // organize and group your datasets. You can set this property when 1924 // inserting or updating a dataset. See Creating and Updating Dataset 1925 // Labels for more information. 1926 Labels map[string]string `json:"labels,omitempty"` 1927 1928 // LastModifiedTime: [Output-only] The date when this dataset or any of 1929 // its tables was last modified, in milliseconds since the epoch. 1930 LastModifiedTime int64 `json:"lastModifiedTime,omitempty,string"` 1931 1932 // Location: The geographic location where the dataset should reside. 1933 // The default value is US. See details at 1934 // https://cloud.google.com/bigquery/docs/locations. 1935 Location string `json:"location,omitempty"` 1936 1937 // SelfLink: [Output-only] A URL that can be used to access the resource 1938 // again. You can use this URL in Get or Update requests to the 1939 // resource. 1940 SelfLink string `json:"selfLink,omitempty"` 1941 1942 // ServerResponse contains the HTTP response code and headers from the 1943 // server. 1944 googleapi.ServerResponse `json:"-"` 1945 1946 // ForceSendFields is a list of field names (e.g. "Access") to 1947 // unconditionally include in API requests. By default, fields with 1948 // empty values are omitted from API requests. However, any non-pointer, 1949 // non-interface field appearing in ForceSendFields will be sent to the 1950 // server regardless of whether the field is empty or not. This may be 1951 // used to include empty fields in Patch requests. 1952 ForceSendFields []string `json:"-"` 1953 1954 // NullFields is a list of field names (e.g. "Access") to include in API 1955 // requests with the JSON null value. By default, fields with empty 1956 // values are omitted from API requests. However, any field with an 1957 // empty value appearing in NullFields will be sent to the server as 1958 // null. It is an error if a field in this list has a non-empty value. 1959 // This may be used to include null fields in Patch requests. 1960 NullFields []string `json:"-"` 1961} 1962 1963func (s *Dataset) MarshalJSON() ([]byte, error) { 1964 type NoMethod Dataset 1965 raw := NoMethod(*s) 1966 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1967} 1968 1969type DatasetAccess struct { 1970 // Domain: [Pick one] A domain to grant access to. Any users signed in 1971 // with the domain specified will be granted the specified access. 1972 // Example: "example.com". Maps to IAM policy member "domain:DOMAIN". 1973 Domain string `json:"domain,omitempty"` 1974 1975 // GroupByEmail: [Pick one] An email address of a Google Group to grant 1976 // access to. Maps to IAM policy member "group:GROUP". 1977 GroupByEmail string `json:"groupByEmail,omitempty"` 1978 1979 // IamMember: [Pick one] Some other type of member that appears in the 1980 // IAM Policy but isn't a user, group, domain, or special group. 1981 IamMember string `json:"iamMember,omitempty"` 1982 1983 // Role: [Required] An IAM role ID that should be granted to the user, 1984 // group, or domain specified in this access entry. The following legacy 1985 // mappings will be applied: OWNER roles/bigquery.dataOwner WRITER 1986 // roles/bigquery.dataEditor READER roles/bigquery.dataViewer This 1987 // field will accept any of the above formats, but will return only the 1988 // legacy format. For example, if you set this field to 1989 // "roles/bigquery.dataOwner", it will be returned back as "OWNER". 1990 Role string `json:"role,omitempty"` 1991 1992 // SpecialGroup: [Pick one] A special group to grant access to. Possible 1993 // values include: projectOwners: Owners of the enclosing project. 1994 // projectReaders: Readers of the enclosing project. projectWriters: 1995 // Writers of the enclosing project. allAuthenticatedUsers: All 1996 // authenticated BigQuery users. Maps to similarly-named IAM members. 1997 SpecialGroup string `json:"specialGroup,omitempty"` 1998 1999 // UserByEmail: [Pick one] An email address of a user to grant access 2000 // to. For example: fred@example.com. Maps to IAM policy member 2001 // "user:EMAIL" or "serviceAccount:EMAIL". 2002 UserByEmail string `json:"userByEmail,omitempty"` 2003 2004 // View: [Pick one] A view from a different dataset to grant access to. 2005 // Queries executed against that view will have read access to tables in 2006 // this dataset. The role field is not required when this field is set. 2007 // If that view is updated by any user, access to the view needs to be 2008 // granted again via an update operation. 2009 View *TableReference `json:"view,omitempty"` 2010 2011 // ForceSendFields is a list of field names (e.g. "Domain") to 2012 // unconditionally include in API requests. By default, fields with 2013 // empty values are omitted from API requests. However, any non-pointer, 2014 // non-interface field appearing in ForceSendFields will be sent to the 2015 // server regardless of whether the field is empty or not. This may be 2016 // used to include empty fields in Patch requests. 2017 ForceSendFields []string `json:"-"` 2018 2019 // NullFields is a list of field names (e.g. "Domain") to include in API 2020 // requests with the JSON null value. By default, fields with empty 2021 // values are omitted from API requests. However, any field with an 2022 // empty value appearing in NullFields will be sent to the server as 2023 // null. It is an error if a field in this list has a non-empty value. 2024 // This may be used to include null fields in Patch requests. 2025 NullFields []string `json:"-"` 2026} 2027 2028func (s *DatasetAccess) MarshalJSON() ([]byte, error) { 2029 type NoMethod DatasetAccess 2030 raw := NoMethod(*s) 2031 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2032} 2033 2034type DatasetList struct { 2035 // Datasets: An array of the dataset resources in the project. Each 2036 // resource contains basic information. For full information about a 2037 // particular dataset resource, use the Datasets: get method. This 2038 // property is omitted when there are no datasets in the project. 2039 Datasets []*DatasetListDatasets `json:"datasets,omitempty"` 2040 2041 // Etag: A hash value of the results page. You can use this property to 2042 // determine if the page has changed since the last request. 2043 Etag string `json:"etag,omitempty"` 2044 2045 // Kind: The list type. This property always returns the value 2046 // "bigquery#datasetList". 2047 Kind string `json:"kind,omitempty"` 2048 2049 // NextPageToken: A token that can be used to request the next results 2050 // page. This property is omitted on the final results page. 2051 NextPageToken string `json:"nextPageToken,omitempty"` 2052 2053 // ServerResponse contains the HTTP response code and headers from the 2054 // server. 2055 googleapi.ServerResponse `json:"-"` 2056 2057 // ForceSendFields is a list of field names (e.g. "Datasets") to 2058 // unconditionally include in API requests. By default, fields with 2059 // empty values are omitted from API requests. However, any non-pointer, 2060 // non-interface field appearing in ForceSendFields will be sent to the 2061 // server regardless of whether the field is empty or not. This may be 2062 // used to include empty fields in Patch requests. 2063 ForceSendFields []string `json:"-"` 2064 2065 // NullFields is a list of field names (e.g. "Datasets") to include in 2066 // API requests with the JSON null value. By default, fields with empty 2067 // values are omitted from API requests. However, any field with an 2068 // empty value appearing in NullFields will be sent to the server as 2069 // null. It is an error if a field in this list has a non-empty value. 2070 // This may be used to include null fields in Patch requests. 2071 NullFields []string `json:"-"` 2072} 2073 2074func (s *DatasetList) MarshalJSON() ([]byte, error) { 2075 type NoMethod DatasetList 2076 raw := NoMethod(*s) 2077 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2078} 2079 2080type DatasetListDatasets struct { 2081 // DatasetReference: The dataset reference. Use this property to access 2082 // specific parts of the dataset's ID, such as project ID or dataset ID. 2083 DatasetReference *DatasetReference `json:"datasetReference,omitempty"` 2084 2085 // FriendlyName: A descriptive name for the dataset, if one exists. 2086 FriendlyName string `json:"friendlyName,omitempty"` 2087 2088 // Id: The fully-qualified, unique, opaque ID of the dataset. 2089 Id string `json:"id,omitempty"` 2090 2091 // Kind: The resource type. This property always returns the value 2092 // "bigquery#dataset". 2093 Kind string `json:"kind,omitempty"` 2094 2095 // Labels: The labels associated with this dataset. You can use these to 2096 // organize and group your datasets. 2097 Labels map[string]string `json:"labels,omitempty"` 2098 2099 // Location: The geographic location where the data resides. 2100 Location string `json:"location,omitempty"` 2101 2102 // ForceSendFields is a list of field names (e.g. "DatasetReference") to 2103 // unconditionally include in API requests. By default, fields with 2104 // empty values are omitted from API requests. However, any non-pointer, 2105 // non-interface field appearing in ForceSendFields will be sent to the 2106 // server regardless of whether the field is empty or not. This may be 2107 // used to include empty fields in Patch requests. 2108 ForceSendFields []string `json:"-"` 2109 2110 // NullFields is a list of field names (e.g. "DatasetReference") to 2111 // include in API requests with the JSON null value. By default, fields 2112 // with empty values are omitted from API requests. However, any field 2113 // with an empty value appearing in NullFields will be sent to the 2114 // server as null. It is an error if a field in this list has a 2115 // non-empty value. This may be used to include null fields in Patch 2116 // requests. 2117 NullFields []string `json:"-"` 2118} 2119 2120func (s *DatasetListDatasets) MarshalJSON() ([]byte, error) { 2121 type NoMethod DatasetListDatasets 2122 raw := NoMethod(*s) 2123 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2124} 2125 2126type DatasetReference struct { 2127 // DatasetId: [Required] A unique ID for this dataset, without the 2128 // project name. The ID must contain only letters (a-z, A-Z), numbers 2129 // (0-9), or underscores (_). The maximum length is 1,024 characters. 2130 DatasetId string `json:"datasetId,omitempty"` 2131 2132 // ProjectId: [Optional] The ID of the project containing this dataset. 2133 ProjectId string `json:"projectId,omitempty"` 2134 2135 // ForceSendFields is a list of field names (e.g. "DatasetId") to 2136 // unconditionally include in API requests. By default, fields with 2137 // empty values are omitted from API requests. However, any non-pointer, 2138 // non-interface field appearing in ForceSendFields will be sent to the 2139 // server regardless of whether the field is empty or not. This may be 2140 // used to include empty fields in Patch requests. 2141 ForceSendFields []string `json:"-"` 2142 2143 // NullFields is a list of field names (e.g. "DatasetId") to include in 2144 // API requests with the JSON null value. By default, fields with empty 2145 // values are omitted from API requests. However, any field with an 2146 // empty value appearing in NullFields will be sent to the server as 2147 // null. It is an error if a field in this list has a non-empty value. 2148 // This may be used to include null fields in Patch requests. 2149 NullFields []string `json:"-"` 2150} 2151 2152func (s *DatasetReference) MarshalJSON() ([]byte, error) { 2153 type NoMethod DatasetReference 2154 raw := NoMethod(*s) 2155 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2156} 2157 2158type DestinationTableProperties struct { 2159 // Description: [Optional] The description for the destination table. 2160 // This will only be used if the destination table is newly created. If 2161 // the table already exists and a value different than the current 2162 // description is provided, the job will fail. 2163 Description string `json:"description,omitempty"` 2164 2165 // FriendlyName: [Optional] The friendly name for the destination table. 2166 // This will only be used if the destination table is newly created. If 2167 // the table already exists and a value different than the current 2168 // friendly name is provided, the job will fail. 2169 FriendlyName string `json:"friendlyName,omitempty"` 2170 2171 // Labels: [Optional] The labels associated with this table. You can use 2172 // these to organize and group your tables. This will only be used if 2173 // the destination table is newly created. If the table already exists 2174 // and labels are different than the current labels are provided, the 2175 // job will fail. 2176 Labels map[string]string `json:"labels,omitempty"` 2177 2178 // ForceSendFields is a list of field names (e.g. "Description") to 2179 // unconditionally include in API requests. By default, fields with 2180 // empty values are omitted from API requests. However, any non-pointer, 2181 // non-interface field appearing in ForceSendFields will be sent to the 2182 // server regardless of whether the field is empty or not. This may be 2183 // used to include empty fields in Patch requests. 2184 ForceSendFields []string `json:"-"` 2185 2186 // NullFields is a list of field names (e.g. "Description") to include 2187 // in API requests with the JSON null value. By default, fields with 2188 // empty values are omitted from API requests. However, any field with 2189 // an empty value appearing in NullFields will be sent to the server as 2190 // null. It is an error if a field in this list has a non-empty value. 2191 // This may be used to include null fields in Patch requests. 2192 NullFields []string `json:"-"` 2193} 2194 2195func (s *DestinationTableProperties) MarshalJSON() ([]byte, error) { 2196 type NoMethod DestinationTableProperties 2197 raw := NoMethod(*s) 2198 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2199} 2200 2201type EncryptionConfiguration struct { 2202 // KmsKeyName: [Optional] Describes the Cloud KMS encryption key that 2203 // will be used to protect destination BigQuery table. The BigQuery 2204 // Service Account associated with your project requires access to this 2205 // encryption key. 2206 KmsKeyName string `json:"kmsKeyName,omitempty"` 2207 2208 // ForceSendFields is a list of field names (e.g. "KmsKeyName") to 2209 // unconditionally include in API requests. By default, fields with 2210 // empty values are omitted from API requests. However, any non-pointer, 2211 // non-interface field appearing in ForceSendFields will be sent to the 2212 // server regardless of whether the field is empty or not. This may be 2213 // used to include empty fields in Patch requests. 2214 ForceSendFields []string `json:"-"` 2215 2216 // NullFields is a list of field names (e.g. "KmsKeyName") to include in 2217 // API requests with the JSON null value. By default, fields with empty 2218 // values are omitted from API requests. However, any field with an 2219 // empty value appearing in NullFields will be sent to the server as 2220 // null. It is an error if a field in this list has a non-empty value. 2221 // This may be used to include null fields in Patch requests. 2222 NullFields []string `json:"-"` 2223} 2224 2225func (s *EncryptionConfiguration) MarshalJSON() ([]byte, error) { 2226 type NoMethod EncryptionConfiguration 2227 raw := NoMethod(*s) 2228 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2229} 2230 2231// Entry: A single entry in the confusion matrix. 2232type Entry struct { 2233 // ItemCount: Number of items being predicted as this label. 2234 ItemCount int64 `json:"itemCount,omitempty,string"` 2235 2236 // PredictedLabel: The predicted label. For confidence_threshold > 0, we 2237 // will 2238 // also add an entry indicating the number of items under the 2239 // confidence threshold. 2240 PredictedLabel string `json:"predictedLabel,omitempty"` 2241 2242 // ForceSendFields is a list of field names (e.g. "ItemCount") to 2243 // unconditionally include in API requests. By default, fields with 2244 // empty values are omitted from API requests. However, any non-pointer, 2245 // non-interface field appearing in ForceSendFields will be sent to the 2246 // server regardless of whether the field is empty or not. This may be 2247 // used to include empty fields in Patch requests. 2248 ForceSendFields []string `json:"-"` 2249 2250 // NullFields is a list of field names (e.g. "ItemCount") to include in 2251 // API requests with the JSON null value. By default, fields with empty 2252 // values are omitted from API requests. However, any field with an 2253 // empty value appearing in NullFields will be sent to the server as 2254 // null. It is an error if a field in this list has a non-empty value. 2255 // This may be used to include null fields in Patch requests. 2256 NullFields []string `json:"-"` 2257} 2258 2259func (s *Entry) MarshalJSON() ([]byte, error) { 2260 type NoMethod Entry 2261 raw := NoMethod(*s) 2262 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2263} 2264 2265type ErrorProto struct { 2266 // DebugInfo: Debugging information. This property is internal to Google 2267 // and should not be used. 2268 DebugInfo string `json:"debugInfo,omitempty"` 2269 2270 // Location: Specifies where the error occurred, if present. 2271 Location string `json:"location,omitempty"` 2272 2273 // Message: A human-readable description of the error. 2274 Message string `json:"message,omitempty"` 2275 2276 // Reason: A short error code that summarizes the error. 2277 Reason string `json:"reason,omitempty"` 2278 2279 // ForceSendFields is a list of field names (e.g. "DebugInfo") to 2280 // unconditionally include in API requests. By default, fields with 2281 // empty values are omitted from API requests. However, any non-pointer, 2282 // non-interface field appearing in ForceSendFields will be sent to the 2283 // server regardless of whether the field is empty or not. This may be 2284 // used to include empty fields in Patch requests. 2285 ForceSendFields []string `json:"-"` 2286 2287 // NullFields is a list of field names (e.g. "DebugInfo") to include in 2288 // API requests with the JSON null value. By default, fields with empty 2289 // values are omitted from API requests. However, any field with an 2290 // empty value appearing in NullFields will be sent to the server as 2291 // null. It is an error if a field in this list has a non-empty value. 2292 // This may be used to include null fields in Patch requests. 2293 NullFields []string `json:"-"` 2294} 2295 2296func (s *ErrorProto) MarshalJSON() ([]byte, error) { 2297 type NoMethod ErrorProto 2298 raw := NoMethod(*s) 2299 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2300} 2301 2302// EvaluationMetrics: Evaluation metrics of a model. These are either 2303// computed on all training 2304// data or just the eval data based on whether eval data was used 2305// during 2306// training. These are not present for imported models. 2307type EvaluationMetrics struct { 2308 // BinaryClassificationMetrics: Populated for binary 2309 // classification/classifier models. 2310 BinaryClassificationMetrics *BinaryClassificationMetrics `json:"binaryClassificationMetrics,omitempty"` 2311 2312 // ClusteringMetrics: Populated for clustering models. 2313 ClusteringMetrics *ClusteringMetrics `json:"clusteringMetrics,omitempty"` 2314 2315 // MultiClassClassificationMetrics: Populated for multi-class 2316 // classification/classifier models. 2317 MultiClassClassificationMetrics *MultiClassClassificationMetrics `json:"multiClassClassificationMetrics,omitempty"` 2318 2319 // RankingMetrics: [Alpha] Populated for implicit feedback type matrix 2320 // factorization 2321 // models. 2322 RankingMetrics *RankingMetrics `json:"rankingMetrics,omitempty"` 2323 2324 // RegressionMetrics: Populated for regression models and explicit 2325 // feedback type matrix 2326 // factorization models. 2327 RegressionMetrics *RegressionMetrics `json:"regressionMetrics,omitempty"` 2328 2329 // ForceSendFields is a list of field names (e.g. 2330 // "BinaryClassificationMetrics") to unconditionally include in API 2331 // requests. By default, fields with empty values are omitted from API 2332 // requests. However, any non-pointer, non-interface field appearing in 2333 // ForceSendFields will be sent to the server regardless of whether the 2334 // field is empty or not. This may be used to include empty fields in 2335 // Patch requests. 2336 ForceSendFields []string `json:"-"` 2337 2338 // NullFields is a list of field names (e.g. 2339 // "BinaryClassificationMetrics") to include in API requests with the 2340 // JSON null value. By default, fields with empty values are omitted 2341 // from API requests. However, any field with an empty value appearing 2342 // in NullFields will be sent to the server as null. It is an error if a 2343 // field in this list has a non-empty value. This may be used to include 2344 // null fields in Patch requests. 2345 NullFields []string `json:"-"` 2346} 2347 2348func (s *EvaluationMetrics) MarshalJSON() ([]byte, error) { 2349 type NoMethod EvaluationMetrics 2350 raw := NoMethod(*s) 2351 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2352} 2353 2354type ExplainQueryStage struct { 2355 // CompletedParallelInputs: Number of parallel input segments completed. 2356 CompletedParallelInputs int64 `json:"completedParallelInputs,omitempty,string"` 2357 2358 // ComputeMsAvg: Milliseconds the average shard spent on CPU-bound 2359 // tasks. 2360 ComputeMsAvg int64 `json:"computeMsAvg,omitempty,string"` 2361 2362 // ComputeMsMax: Milliseconds the slowest shard spent on CPU-bound 2363 // tasks. 2364 ComputeMsMax int64 `json:"computeMsMax,omitempty,string"` 2365 2366 // ComputeRatioAvg: Relative amount of time the average shard spent on 2367 // CPU-bound tasks. 2368 ComputeRatioAvg float64 `json:"computeRatioAvg,omitempty"` 2369 2370 // ComputeRatioMax: Relative amount of time the slowest shard spent on 2371 // CPU-bound tasks. 2372 ComputeRatioMax float64 `json:"computeRatioMax,omitempty"` 2373 2374 // EndMs: Stage end time represented as milliseconds since epoch. 2375 EndMs int64 `json:"endMs,omitempty,string"` 2376 2377 // Id: Unique ID for stage within plan. 2378 Id int64 `json:"id,omitempty,string"` 2379 2380 // InputStages: IDs for stages that are inputs to this stage. 2381 InputStages googleapi.Int64s `json:"inputStages,omitempty"` 2382 2383 // Name: Human-readable name for stage. 2384 Name string `json:"name,omitempty"` 2385 2386 // ParallelInputs: Number of parallel input segments to be processed. 2387 ParallelInputs int64 `json:"parallelInputs,omitempty,string"` 2388 2389 // ReadMsAvg: Milliseconds the average shard spent reading input. 2390 ReadMsAvg int64 `json:"readMsAvg,omitempty,string"` 2391 2392 // ReadMsMax: Milliseconds the slowest shard spent reading input. 2393 ReadMsMax int64 `json:"readMsMax,omitempty,string"` 2394 2395 // ReadRatioAvg: Relative amount of time the average shard spent reading 2396 // input. 2397 ReadRatioAvg float64 `json:"readRatioAvg,omitempty"` 2398 2399 // ReadRatioMax: Relative amount of time the slowest shard spent reading 2400 // input. 2401 ReadRatioMax float64 `json:"readRatioMax,omitempty"` 2402 2403 // RecordsRead: Number of records read into the stage. 2404 RecordsRead int64 `json:"recordsRead,omitempty,string"` 2405 2406 // RecordsWritten: Number of records written by the stage. 2407 RecordsWritten int64 `json:"recordsWritten,omitempty,string"` 2408 2409 // ShuffleOutputBytes: Total number of bytes written to shuffle. 2410 ShuffleOutputBytes int64 `json:"shuffleOutputBytes,omitempty,string"` 2411 2412 // ShuffleOutputBytesSpilled: Total number of bytes written to shuffle 2413 // and spilled to disk. 2414 ShuffleOutputBytesSpilled int64 `json:"shuffleOutputBytesSpilled,omitempty,string"` 2415 2416 // SlotMs: Slot-milliseconds used by the stage. 2417 SlotMs int64 `json:"slotMs,omitempty,string"` 2418 2419 // StartMs: Stage start time represented as milliseconds since epoch. 2420 StartMs int64 `json:"startMs,omitempty,string"` 2421 2422 // Status: Current status for the stage. 2423 Status string `json:"status,omitempty"` 2424 2425 // Steps: List of operations within the stage in dependency order 2426 // (approximately chronological). 2427 Steps []*ExplainQueryStep `json:"steps,omitempty"` 2428 2429 // WaitMsAvg: Milliseconds the average shard spent waiting to be 2430 // scheduled. 2431 WaitMsAvg int64 `json:"waitMsAvg,omitempty,string"` 2432 2433 // WaitMsMax: Milliseconds the slowest shard spent waiting to be 2434 // scheduled. 2435 WaitMsMax int64 `json:"waitMsMax,omitempty,string"` 2436 2437 // WaitRatioAvg: Relative amount of time the average shard spent waiting 2438 // to be scheduled. 2439 WaitRatioAvg float64 `json:"waitRatioAvg,omitempty"` 2440 2441 // WaitRatioMax: Relative amount of time the slowest shard spent waiting 2442 // to be scheduled. 2443 WaitRatioMax float64 `json:"waitRatioMax,omitempty"` 2444 2445 // WriteMsAvg: Milliseconds the average shard spent on writing output. 2446 WriteMsAvg int64 `json:"writeMsAvg,omitempty,string"` 2447 2448 // WriteMsMax: Milliseconds the slowest shard spent on writing output. 2449 WriteMsMax int64 `json:"writeMsMax,omitempty,string"` 2450 2451 // WriteRatioAvg: Relative amount of time the average shard spent on 2452 // writing output. 2453 WriteRatioAvg float64 `json:"writeRatioAvg,omitempty"` 2454 2455 // WriteRatioMax: Relative amount of time the slowest shard spent on 2456 // writing output. 2457 WriteRatioMax float64 `json:"writeRatioMax,omitempty"` 2458 2459 // ForceSendFields is a list of field names (e.g. 2460 // "CompletedParallelInputs") to unconditionally include in API 2461 // requests. By default, fields with empty values are omitted from API 2462 // requests. However, any non-pointer, non-interface field appearing in 2463 // ForceSendFields will be sent to the server regardless of whether the 2464 // field is empty or not. This may be used to include empty fields in 2465 // Patch requests. 2466 ForceSendFields []string `json:"-"` 2467 2468 // NullFields is a list of field names (e.g. "CompletedParallelInputs") 2469 // to include in API requests with the JSON null value. By default, 2470 // fields with empty values are omitted from API requests. However, any 2471 // field with an empty value appearing in NullFields will be sent to the 2472 // server as null. It is an error if a field in this list has a 2473 // non-empty value. This may be used to include null fields in Patch 2474 // requests. 2475 NullFields []string `json:"-"` 2476} 2477 2478func (s *ExplainQueryStage) MarshalJSON() ([]byte, error) { 2479 type NoMethod ExplainQueryStage 2480 raw := NoMethod(*s) 2481 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2482} 2483 2484func (s *ExplainQueryStage) UnmarshalJSON(data []byte) error { 2485 type NoMethod ExplainQueryStage 2486 var s1 struct { 2487 ComputeRatioAvg gensupport.JSONFloat64 `json:"computeRatioAvg"` 2488 ComputeRatioMax gensupport.JSONFloat64 `json:"computeRatioMax"` 2489 ReadRatioAvg gensupport.JSONFloat64 `json:"readRatioAvg"` 2490 ReadRatioMax gensupport.JSONFloat64 `json:"readRatioMax"` 2491 WaitRatioAvg gensupport.JSONFloat64 `json:"waitRatioAvg"` 2492 WaitRatioMax gensupport.JSONFloat64 `json:"waitRatioMax"` 2493 WriteRatioAvg gensupport.JSONFloat64 `json:"writeRatioAvg"` 2494 WriteRatioMax gensupport.JSONFloat64 `json:"writeRatioMax"` 2495 *NoMethod 2496 } 2497 s1.NoMethod = (*NoMethod)(s) 2498 if err := json.Unmarshal(data, &s1); err != nil { 2499 return err 2500 } 2501 s.ComputeRatioAvg = float64(s1.ComputeRatioAvg) 2502 s.ComputeRatioMax = float64(s1.ComputeRatioMax) 2503 s.ReadRatioAvg = float64(s1.ReadRatioAvg) 2504 s.ReadRatioMax = float64(s1.ReadRatioMax) 2505 s.WaitRatioAvg = float64(s1.WaitRatioAvg) 2506 s.WaitRatioMax = float64(s1.WaitRatioMax) 2507 s.WriteRatioAvg = float64(s1.WriteRatioAvg) 2508 s.WriteRatioMax = float64(s1.WriteRatioMax) 2509 return nil 2510} 2511 2512type ExplainQueryStep struct { 2513 // Kind: Machine-readable operation type. 2514 Kind string `json:"kind,omitempty"` 2515 2516 // Substeps: Human-readable stage descriptions. 2517 Substeps []string `json:"substeps,omitempty"` 2518 2519 // ForceSendFields is a list of field names (e.g. "Kind") to 2520 // unconditionally include in API requests. By default, fields with 2521 // empty values are omitted from API requests. However, any non-pointer, 2522 // non-interface field appearing in ForceSendFields will be sent to the 2523 // server regardless of whether the field is empty or not. This may be 2524 // used to include empty fields in Patch requests. 2525 ForceSendFields []string `json:"-"` 2526 2527 // NullFields is a list of field names (e.g. "Kind") to include in API 2528 // requests with the JSON null value. By default, fields with empty 2529 // values are omitted from API requests. However, any field with an 2530 // empty value appearing in NullFields will be sent to the server as 2531 // null. It is an error if a field in this list has a non-empty value. 2532 // This may be used to include null fields in Patch requests. 2533 NullFields []string `json:"-"` 2534} 2535 2536func (s *ExplainQueryStep) MarshalJSON() ([]byte, error) { 2537 type NoMethod ExplainQueryStep 2538 raw := NoMethod(*s) 2539 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2540} 2541 2542// Expr: Represents a textual expression in the Common Expression 2543// Language (CEL) 2544// syntax. CEL is a C-like expression language. The syntax and semantics 2545// of CEL 2546// are documented at https://github.com/google/cel-spec. 2547// 2548// Example (Comparison): 2549// 2550// title: "Summary size limit" 2551// description: "Determines if a summary is less than 100 chars" 2552// expression: "document.summary.size() < 100" 2553// 2554// Example (Equality): 2555// 2556// title: "Requestor is owner" 2557// description: "Determines if requestor is the document owner" 2558// expression: "document.owner == 2559// request.auth.claims.email" 2560// 2561// Example (Logic): 2562// 2563// title: "Public documents" 2564// description: "Determine whether the document should be publicly 2565// visible" 2566// expression: "document.type != 'private' && document.type != 2567// 'internal'" 2568// 2569// Example (Data Manipulation): 2570// 2571// title: "Notification string" 2572// description: "Create a notification string with a timestamp." 2573// expression: "'New message received at ' + 2574// string(document.create_time)" 2575// 2576// The exact variables and functions that may be referenced within an 2577// expression 2578// are determined by the service that evaluates it. See the 2579// service 2580// documentation for additional information. 2581type Expr struct { 2582 // Description: Optional. Description of the expression. This is a 2583 // longer text which 2584 // describes the expression, e.g. when hovered over it in a UI. 2585 Description string `json:"description,omitempty"` 2586 2587 // Expression: Textual representation of an expression in Common 2588 // Expression Language 2589 // syntax. 2590 Expression string `json:"expression,omitempty"` 2591 2592 // Location: Optional. String indicating the location of the expression 2593 // for error 2594 // reporting, e.g. a file name and a position in the file. 2595 Location string `json:"location,omitempty"` 2596 2597 // Title: Optional. Title for the expression, i.e. a short string 2598 // describing 2599 // its purpose. This can be used e.g. in UIs which allow to enter 2600 // the 2601 // expression. 2602 Title string `json:"title,omitempty"` 2603 2604 // ForceSendFields is a list of field names (e.g. "Description") to 2605 // unconditionally include in API requests. By default, fields with 2606 // empty values are omitted from API requests. However, any non-pointer, 2607 // non-interface field appearing in ForceSendFields will be sent to the 2608 // server regardless of whether the field is empty or not. This may be 2609 // used to include empty fields in Patch requests. 2610 ForceSendFields []string `json:"-"` 2611 2612 // NullFields is a list of field names (e.g. "Description") to include 2613 // in API requests with the JSON null value. By default, fields with 2614 // empty values are omitted from API requests. However, any field with 2615 // an empty value appearing in NullFields will be sent to the server as 2616 // null. It is an error if a field in this list has a non-empty value. 2617 // This may be used to include null fields in Patch requests. 2618 NullFields []string `json:"-"` 2619} 2620 2621func (s *Expr) MarshalJSON() ([]byte, error) { 2622 type NoMethod Expr 2623 raw := NoMethod(*s) 2624 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2625} 2626 2627type ExternalDataConfiguration struct { 2628 // Autodetect: Try to detect schema and format options automatically. 2629 // Any option specified explicitly will be honored. 2630 Autodetect bool `json:"autodetect,omitempty"` 2631 2632 // BigtableOptions: [Optional] Additional options if sourceFormat is set 2633 // to BIGTABLE. 2634 BigtableOptions *BigtableOptions `json:"bigtableOptions,omitempty"` 2635 2636 // Compression: [Optional] The compression type of the data source. 2637 // Possible values include GZIP and NONE. The default value is NONE. 2638 // This setting is ignored for Google Cloud Bigtable, Google Cloud 2639 // Datastore backups and Avro formats. 2640 Compression string `json:"compression,omitempty"` 2641 2642 // ConnectionId: [Optional, Trusted Tester] Connection for external data 2643 // source. 2644 ConnectionId string `json:"connectionId,omitempty"` 2645 2646 // CsvOptions: Additional properties to set if sourceFormat is set to 2647 // CSV. 2648 CsvOptions *CsvOptions `json:"csvOptions,omitempty"` 2649 2650 // GoogleSheetsOptions: [Optional] Additional options if sourceFormat is 2651 // set to GOOGLE_SHEETS. 2652 GoogleSheetsOptions *GoogleSheetsOptions `json:"googleSheetsOptions,omitempty"` 2653 2654 // HivePartitioningOptions: [Optional, Trusted Tester] Options to 2655 // configure hive partitioning support. 2656 HivePartitioningOptions *HivePartitioningOptions `json:"hivePartitioningOptions,omitempty"` 2657 2658 // IgnoreUnknownValues: [Optional] Indicates if BigQuery should allow 2659 // extra values that are not represented in the table schema. If true, 2660 // the extra values are ignored. If false, records with extra columns 2661 // are treated as bad records, and if there are too many bad records, an 2662 // invalid error is returned in the job result. The default value is 2663 // false. The sourceFormat property determines what BigQuery treats as 2664 // an extra value: CSV: Trailing columns JSON: Named values that don't 2665 // match any column names Google Cloud Bigtable: This setting is 2666 // ignored. Google Cloud Datastore backups: This setting is ignored. 2667 // Avro: This setting is ignored. 2668 IgnoreUnknownValues bool `json:"ignoreUnknownValues,omitempty"` 2669 2670 // MaxBadRecords: [Optional] The maximum number of bad records that 2671 // BigQuery can ignore when reading data. If the number of bad records 2672 // exceeds this value, an invalid error is returned in the job result. 2673 // This is only valid for CSV, JSON, and Google Sheets. The default 2674 // value is 0, which requires that all records are valid. This setting 2675 // is ignored for Google Cloud Bigtable, Google Cloud Datastore backups 2676 // and Avro formats. 2677 MaxBadRecords int64 `json:"maxBadRecords,omitempty"` 2678 2679 // Schema: [Optional] The schema for the data. Schema is required for 2680 // CSV and JSON formats. Schema is disallowed for Google Cloud Bigtable, 2681 // Cloud Datastore backups, and Avro formats. 2682 Schema *TableSchema `json:"schema,omitempty"` 2683 2684 // SourceFormat: [Required] The data format. For CSV files, specify 2685 // "CSV". For Google sheets, specify "GOOGLE_SHEETS". For 2686 // newline-delimited JSON, specify "NEWLINE_DELIMITED_JSON". For Avro 2687 // files, specify "AVRO". For Google Cloud Datastore backups, specify 2688 // "DATASTORE_BACKUP". [Beta] For Google Cloud Bigtable, specify 2689 // "BIGTABLE". 2690 SourceFormat string `json:"sourceFormat,omitempty"` 2691 2692 // SourceUris: [Required] The fully-qualified URIs that point to your 2693 // data in Google Cloud. For Google Cloud Storage URIs: Each URI can 2694 // contain one '*' wildcard character and it must come after the 2695 // 'bucket' name. Size limits related to load jobs apply to external 2696 // data sources. For Google Cloud Bigtable URIs: Exactly one URI can be 2697 // specified and it has be a fully specified and valid HTTPS URL for a 2698 // Google Cloud Bigtable table. For Google Cloud Datastore backups, 2699 // exactly one URI can be specified. Also, the '*' wildcard character is 2700 // not allowed. 2701 SourceUris []string `json:"sourceUris,omitempty"` 2702 2703 // ForceSendFields is a list of field names (e.g. "Autodetect") to 2704 // unconditionally include in API requests. By default, fields with 2705 // empty values are omitted from API requests. However, any non-pointer, 2706 // non-interface field appearing in ForceSendFields will be sent to the 2707 // server regardless of whether the field is empty or not. This may be 2708 // used to include empty fields in Patch requests. 2709 ForceSendFields []string `json:"-"` 2710 2711 // NullFields is a list of field names (e.g. "Autodetect") to include in 2712 // API requests with the JSON null value. By default, fields with empty 2713 // values are omitted from API requests. However, any field with an 2714 // empty value appearing in NullFields will be sent to the server as 2715 // null. It is an error if a field in this list has a non-empty value. 2716 // This may be used to include null fields in Patch requests. 2717 NullFields []string `json:"-"` 2718} 2719 2720func (s *ExternalDataConfiguration) MarshalJSON() ([]byte, error) { 2721 type NoMethod ExternalDataConfiguration 2722 raw := NoMethod(*s) 2723 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2724} 2725 2726// FeatureValue: Representative value of a single feature within the 2727// cluster. 2728type FeatureValue struct { 2729 // CategoricalValue: The categorical feature value. 2730 CategoricalValue *CategoricalValue `json:"categoricalValue,omitempty"` 2731 2732 // FeatureColumn: The feature column name. 2733 FeatureColumn string `json:"featureColumn,omitempty"` 2734 2735 // NumericalValue: The numerical feature value. This is the centroid 2736 // value for this 2737 // feature. 2738 NumericalValue float64 `json:"numericalValue,omitempty"` 2739 2740 // ForceSendFields is a list of field names (e.g. "CategoricalValue") to 2741 // unconditionally include in API requests. By default, fields with 2742 // empty values are omitted from API requests. However, any non-pointer, 2743 // non-interface field appearing in ForceSendFields will be sent to the 2744 // server regardless of whether the field is empty or not. This may be 2745 // used to include empty fields in Patch requests. 2746 ForceSendFields []string `json:"-"` 2747 2748 // NullFields is a list of field names (e.g. "CategoricalValue") to 2749 // include in API requests with the JSON null value. By default, fields 2750 // with empty values are omitted from API requests. However, any field 2751 // with an empty value appearing in NullFields will be sent to the 2752 // server as null. It is an error if a field in this list has a 2753 // non-empty value. This may be used to include null fields in Patch 2754 // requests. 2755 NullFields []string `json:"-"` 2756} 2757 2758func (s *FeatureValue) MarshalJSON() ([]byte, error) { 2759 type NoMethod FeatureValue 2760 raw := NoMethod(*s) 2761 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2762} 2763 2764func (s *FeatureValue) UnmarshalJSON(data []byte) error { 2765 type NoMethod FeatureValue 2766 var s1 struct { 2767 NumericalValue gensupport.JSONFloat64 `json:"numericalValue"` 2768 *NoMethod 2769 } 2770 s1.NoMethod = (*NoMethod)(s) 2771 if err := json.Unmarshal(data, &s1); err != nil { 2772 return err 2773 } 2774 s.NumericalValue = float64(s1.NumericalValue) 2775 return nil 2776} 2777 2778// GetIamPolicyRequest: Request message for `GetIamPolicy` method. 2779type GetIamPolicyRequest struct { 2780 // Options: OPTIONAL: A `GetPolicyOptions` object for specifying options 2781 // to 2782 // `GetIamPolicy`. 2783 Options *GetPolicyOptions `json:"options,omitempty"` 2784 2785 // ForceSendFields is a list of field names (e.g. "Options") to 2786 // unconditionally include in API requests. By default, fields with 2787 // empty values are omitted from API requests. However, any non-pointer, 2788 // non-interface field appearing in ForceSendFields will be sent to the 2789 // server regardless of whether the field is empty or not. This may be 2790 // used to include empty fields in Patch requests. 2791 ForceSendFields []string `json:"-"` 2792 2793 // NullFields is a list of field names (e.g. "Options") to include in 2794 // API requests with the JSON null value. By default, fields with empty 2795 // values are omitted from API requests. However, any field with an 2796 // empty value appearing in NullFields will be sent to the server as 2797 // null. It is an error if a field in this list has a non-empty value. 2798 // This may be used to include null fields in Patch requests. 2799 NullFields []string `json:"-"` 2800} 2801 2802func (s *GetIamPolicyRequest) MarshalJSON() ([]byte, error) { 2803 type NoMethod GetIamPolicyRequest 2804 raw := NoMethod(*s) 2805 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2806} 2807 2808// GetPolicyOptions: Encapsulates settings provided to GetIamPolicy. 2809type GetPolicyOptions struct { 2810 // RequestedPolicyVersion: Optional. The policy format version to be 2811 // returned. 2812 // 2813 // Valid values are 0, 1, and 3. Requests specifying an invalid value 2814 // will be 2815 // rejected. 2816 // 2817 // Requests for policies with any conditional bindings must specify 2818 // version 3. 2819 // Policies without any conditional bindings may specify any valid value 2820 // or 2821 // leave the field unset. 2822 // 2823 // To learn which resources support conditions in their IAM policies, 2824 // see 2825 // the 2826 // [IAM 2827 // documentation](https://cloud.google.com/iam/help/conditions/r 2828 // esource-policies). 2829 RequestedPolicyVersion int64 `json:"requestedPolicyVersion,omitempty"` 2830 2831 // ForceSendFields is a list of field names (e.g. 2832 // "RequestedPolicyVersion") to unconditionally include in API requests. 2833 // By default, fields with empty values are omitted from API requests. 2834 // However, any non-pointer, non-interface field appearing in 2835 // ForceSendFields will be sent to the server regardless of whether the 2836 // field is empty or not. This may be used to include empty fields in 2837 // Patch requests. 2838 ForceSendFields []string `json:"-"` 2839 2840 // NullFields is a list of field names (e.g. "RequestedPolicyVersion") 2841 // to include in API requests with the JSON null value. By default, 2842 // fields with empty values are omitted from API requests. However, any 2843 // field with an empty value appearing in NullFields will be sent to the 2844 // server as null. It is an error if a field in this list has a 2845 // non-empty value. This may be used to include null fields in Patch 2846 // requests. 2847 NullFields []string `json:"-"` 2848} 2849 2850func (s *GetPolicyOptions) MarshalJSON() ([]byte, error) { 2851 type NoMethod GetPolicyOptions 2852 raw := NoMethod(*s) 2853 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2854} 2855 2856type GetQueryResultsResponse struct { 2857 // CacheHit: Whether the query result was fetched from the query cache. 2858 CacheHit bool `json:"cacheHit,omitempty"` 2859 2860 // Errors: [Output-only] The first errors or warnings encountered during 2861 // the running of the job. The final message includes the number of 2862 // errors that caused the process to stop. Errors here do not 2863 // necessarily mean that the job has completed or was unsuccessful. 2864 Errors []*ErrorProto `json:"errors,omitempty"` 2865 2866 // Etag: A hash of this response. 2867 Etag string `json:"etag,omitempty"` 2868 2869 // JobComplete: Whether the query has completed or not. If rows or 2870 // totalRows are present, this will always be true. If this is false, 2871 // totalRows will not be available. 2872 JobComplete bool `json:"jobComplete,omitempty"` 2873 2874 // JobReference: Reference to the BigQuery Job that was created to run 2875 // the query. This field will be present even if the original request 2876 // timed out, in which case GetQueryResults can be used to read the 2877 // results once the query has completed. Since this API only returns the 2878 // first page of results, subsequent pages can be fetched via the same 2879 // mechanism (GetQueryResults). 2880 JobReference *JobReference `json:"jobReference,omitempty"` 2881 2882 // Kind: The resource type of the response. 2883 Kind string `json:"kind,omitempty"` 2884 2885 // NumDmlAffectedRows: [Output-only] The number of rows affected by a 2886 // DML statement. Present only for DML statements INSERT, UPDATE or 2887 // DELETE. 2888 NumDmlAffectedRows int64 `json:"numDmlAffectedRows,omitempty,string"` 2889 2890 // PageToken: A token used for paging results. 2891 PageToken string `json:"pageToken,omitempty"` 2892 2893 // Rows: An object with as many results as can be contained within the 2894 // maximum permitted reply size. To get any additional rows, you can 2895 // call GetQueryResults and specify the jobReference returned above. 2896 // Present only when the query completes successfully. 2897 Rows []*TableRow `json:"rows,omitempty"` 2898 2899 // Schema: The schema of the results. Present only when the query 2900 // completes successfully. 2901 Schema *TableSchema `json:"schema,omitempty"` 2902 2903 // TotalBytesProcessed: The total number of bytes processed for this 2904 // query. 2905 TotalBytesProcessed int64 `json:"totalBytesProcessed,omitempty,string"` 2906 2907 // TotalRows: The total number of rows in the complete query result set, 2908 // which can be more than the number of rows in this single page of 2909 // results. Present only when the query completes successfully. 2910 TotalRows uint64 `json:"totalRows,omitempty,string"` 2911 2912 // ServerResponse contains the HTTP response code and headers from the 2913 // server. 2914 googleapi.ServerResponse `json:"-"` 2915 2916 // ForceSendFields is a list of field names (e.g. "CacheHit") to 2917 // unconditionally include in API requests. By default, fields with 2918 // empty values are omitted from API requests. However, any non-pointer, 2919 // non-interface field appearing in ForceSendFields will be sent to the 2920 // server regardless of whether the field is empty or not. This may be 2921 // used to include empty fields in Patch requests. 2922 ForceSendFields []string `json:"-"` 2923 2924 // NullFields is a list of field names (e.g. "CacheHit") to include in 2925 // API requests with the JSON null value. By default, fields with empty 2926 // values are omitted from API requests. However, any field with an 2927 // empty value appearing in NullFields will be sent to the server as 2928 // null. It is an error if a field in this list has a non-empty value. 2929 // This may be used to include null fields in Patch requests. 2930 NullFields []string `json:"-"` 2931} 2932 2933func (s *GetQueryResultsResponse) MarshalJSON() ([]byte, error) { 2934 type NoMethod GetQueryResultsResponse 2935 raw := NoMethod(*s) 2936 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2937} 2938 2939type GetServiceAccountResponse struct { 2940 // Email: The service account email address. 2941 Email string `json:"email,omitempty"` 2942 2943 // Kind: The resource type of the response. 2944 Kind string `json:"kind,omitempty"` 2945 2946 // ServerResponse contains the HTTP response code and headers from the 2947 // server. 2948 googleapi.ServerResponse `json:"-"` 2949 2950 // ForceSendFields is a list of field names (e.g. "Email") to 2951 // unconditionally include in API requests. By default, fields with 2952 // empty values are omitted from API requests. However, any non-pointer, 2953 // non-interface field appearing in ForceSendFields will be sent to the 2954 // server regardless of whether the field is empty or not. This may be 2955 // used to include empty fields in Patch requests. 2956 ForceSendFields []string `json:"-"` 2957 2958 // NullFields is a list of field names (e.g. "Email") to include in API 2959 // requests with the JSON null value. By default, fields with empty 2960 // values are omitted from API requests. However, any field with an 2961 // empty value appearing in NullFields will be sent to the server as 2962 // null. It is an error if a field in this list has a non-empty value. 2963 // This may be used to include null fields in Patch requests. 2964 NullFields []string `json:"-"` 2965} 2966 2967func (s *GetServiceAccountResponse) MarshalJSON() ([]byte, error) { 2968 type NoMethod GetServiceAccountResponse 2969 raw := NoMethod(*s) 2970 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2971} 2972 2973type GoogleSheetsOptions struct { 2974 // Range: [Optional] Range of a sheet to query from. Only used when 2975 // non-empty. Typical format: 2976 // sheet_name!top_left_cell_id:bottom_right_cell_id For example: 2977 // sheet1!A1:B20 2978 Range string `json:"range,omitempty"` 2979 2980 // SkipLeadingRows: [Optional] The number of rows at the top of a sheet 2981 // that BigQuery will skip when reading the data. The default value is 2982 // 0. This property is useful if you have header rows that should be 2983 // skipped. When autodetect is on, behavior is the following: * 2984 // skipLeadingRows unspecified - Autodetect tries to detect headers in 2985 // the first row. If they are not detected, the row is read as data. 2986 // Otherwise data is read starting from the second row. * 2987 // skipLeadingRows is 0 - Instructs autodetect that there are no headers 2988 // and data should be read starting from the first row. * 2989 // skipLeadingRows = N > 0 - Autodetect skips N-1 rows and tries to 2990 // detect headers in row N. If headers are not detected, row N is just 2991 // skipped. Otherwise row N is used to extract column names for the 2992 // detected schema. 2993 SkipLeadingRows int64 `json:"skipLeadingRows,omitempty,string"` 2994 2995 // ForceSendFields is a list of field names (e.g. "Range") to 2996 // unconditionally include in API requests. By default, fields with 2997 // empty values are omitted from API requests. However, any non-pointer, 2998 // non-interface field appearing in ForceSendFields will be sent to the 2999 // server regardless of whether the field is empty or not. This may be 3000 // used to include empty fields in Patch requests. 3001 ForceSendFields []string `json:"-"` 3002 3003 // NullFields is a list of field names (e.g. "Range") to include in API 3004 // requests with the JSON null value. By default, fields with empty 3005 // values are omitted from API requests. However, any field with an 3006 // empty value appearing in NullFields will be sent to the server as 3007 // null. It is an error if a field in this list has a non-empty value. 3008 // This may be used to include null fields in Patch requests. 3009 NullFields []string `json:"-"` 3010} 3011 3012func (s *GoogleSheetsOptions) MarshalJSON() ([]byte, error) { 3013 type NoMethod GoogleSheetsOptions 3014 raw := NoMethod(*s) 3015 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3016} 3017 3018type HivePartitioningOptions struct { 3019 // Mode: [Optional, Trusted Tester] When set, what mode of hive 3020 // partitioning to use when reading data. Two modes are supported. (1) 3021 // AUTO: automatically infer partition key name(s) and type(s). (2) 3022 // STRINGS: automatically infer partition key name(s). All types are 3023 // interpreted as strings. Not all storage formats support hive 3024 // partitioning. Requesting hive partitioning on an unsupported format 3025 // will lead to an error. Currently supported types include: AVRO, CSV, 3026 // JSON, ORC and Parquet. 3027 Mode string `json:"mode,omitempty"` 3028 3029 // SourceUriPrefix: [Optional, Trusted Tester] When hive partition 3030 // detection is requested, a common prefix for all source uris should be 3031 // supplied. The prefix must end immediately before the partition key 3032 // encoding begins. For example, consider files following this data 3033 // layout. 3034 // gs://bucket/path_to_table/dt=2019-01-01/country=BR/id=7/file.avro 3035 // gs://bucket/path_to_table/dt=2018-12-31/country=CA/id=3/file.avro 3036 // When hive partitioning is requested with either AUTO or STRINGS 3037 // detection, the common prefix can be either of 3038 // gs://bucket/path_to_table or gs://bucket/path_to_table/ (trailing 3039 // slash does not matter). 3040 SourceUriPrefix string `json:"sourceUriPrefix,omitempty"` 3041 3042 // ForceSendFields is a list of field names (e.g. "Mode") to 3043 // unconditionally include in API requests. By default, fields with 3044 // empty values are omitted from API requests. However, any non-pointer, 3045 // non-interface field appearing in ForceSendFields will be sent to the 3046 // server regardless of whether the field is empty or not. This may be 3047 // used to include empty fields in Patch requests. 3048 ForceSendFields []string `json:"-"` 3049 3050 // NullFields is a list of field names (e.g. "Mode") to include in API 3051 // requests with the JSON null value. By default, fields with empty 3052 // values are omitted from API requests. However, any field with an 3053 // empty value appearing in NullFields will be sent to the server as 3054 // null. It is an error if a field in this list has a non-empty value. 3055 // This may be used to include null fields in Patch requests. 3056 NullFields []string `json:"-"` 3057} 3058 3059func (s *HivePartitioningOptions) MarshalJSON() ([]byte, error) { 3060 type NoMethod HivePartitioningOptions 3061 raw := NoMethod(*s) 3062 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3063} 3064 3065// IterationResult: Information about a single iteration of the training 3066// run. 3067type IterationResult struct { 3068 ArimaResult *ArimaResult `json:"arimaResult,omitempty"` 3069 3070 // ClusterInfos: Information about top clusters for clustering models. 3071 ClusterInfos []*ClusterInfo `json:"clusterInfos,omitempty"` 3072 3073 // DurationMs: Time taken to run the iteration in milliseconds. 3074 DurationMs int64 `json:"durationMs,omitempty,string"` 3075 3076 // EvalLoss: Loss computed on the eval data at the end of iteration. 3077 EvalLoss float64 `json:"evalLoss,omitempty"` 3078 3079 // Index: Index of the iteration, 0 based. 3080 Index int64 `json:"index,omitempty"` 3081 3082 // LearnRate: Learn rate used for this iteration. 3083 LearnRate float64 `json:"learnRate,omitempty"` 3084 3085 // TrainingLoss: Loss computed on the training data at the end of 3086 // iteration. 3087 TrainingLoss float64 `json:"trainingLoss,omitempty"` 3088 3089 // ForceSendFields is a list of field names (e.g. "ArimaResult") to 3090 // unconditionally include in API requests. By default, fields with 3091 // empty values are omitted from API requests. However, any non-pointer, 3092 // non-interface field appearing in ForceSendFields will be sent to the 3093 // server regardless of whether the field is empty or not. This may be 3094 // used to include empty fields in Patch requests. 3095 ForceSendFields []string `json:"-"` 3096 3097 // NullFields is a list of field names (e.g. "ArimaResult") to include 3098 // in API requests with the JSON null value. By default, fields with 3099 // empty values are omitted from API requests. However, any field with 3100 // an empty value appearing in NullFields will be sent to the server as 3101 // null. It is an error if a field in this list has a non-empty value. 3102 // This may be used to include null fields in Patch requests. 3103 NullFields []string `json:"-"` 3104} 3105 3106func (s *IterationResult) MarshalJSON() ([]byte, error) { 3107 type NoMethod IterationResult 3108 raw := NoMethod(*s) 3109 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3110} 3111 3112func (s *IterationResult) UnmarshalJSON(data []byte) error { 3113 type NoMethod IterationResult 3114 var s1 struct { 3115 EvalLoss gensupport.JSONFloat64 `json:"evalLoss"` 3116 LearnRate gensupport.JSONFloat64 `json:"learnRate"` 3117 TrainingLoss gensupport.JSONFloat64 `json:"trainingLoss"` 3118 *NoMethod 3119 } 3120 s1.NoMethod = (*NoMethod)(s) 3121 if err := json.Unmarshal(data, &s1); err != nil { 3122 return err 3123 } 3124 s.EvalLoss = float64(s1.EvalLoss) 3125 s.LearnRate = float64(s1.LearnRate) 3126 s.TrainingLoss = float64(s1.TrainingLoss) 3127 return nil 3128} 3129 3130type Job struct { 3131 // Configuration: [Required] Describes the job configuration. 3132 Configuration *JobConfiguration `json:"configuration,omitempty"` 3133 3134 // Etag: [Output-only] A hash of this resource. 3135 Etag string `json:"etag,omitempty"` 3136 3137 // Id: [Output-only] Opaque ID field of the job 3138 Id string `json:"id,omitempty"` 3139 3140 // JobReference: [Optional] Reference describing the unique-per-user 3141 // name of the job. 3142 JobReference *JobReference `json:"jobReference,omitempty"` 3143 3144 // Kind: [Output-only] The type of the resource. 3145 Kind string `json:"kind,omitempty"` 3146 3147 // SelfLink: [Output-only] A URL that can be used to access this 3148 // resource again. 3149 SelfLink string `json:"selfLink,omitempty"` 3150 3151 // Statistics: [Output-only] Information about the job, including 3152 // starting time and ending time of the job. 3153 Statistics *JobStatistics `json:"statistics,omitempty"` 3154 3155 // Status: [Output-only] The status of this job. Examine this value when 3156 // polling an asynchronous job to see if the job is complete. 3157 Status *JobStatus `json:"status,omitempty"` 3158 3159 // UserEmail: [Output-only] Email address of the user who ran the job. 3160 UserEmail string `json:"user_email,omitempty"` 3161 3162 // ServerResponse contains the HTTP response code and headers from the 3163 // server. 3164 googleapi.ServerResponse `json:"-"` 3165 3166 // ForceSendFields is a list of field names (e.g. "Configuration") to 3167 // unconditionally include in API requests. By default, fields with 3168 // empty values are omitted from API requests. However, any non-pointer, 3169 // non-interface field appearing in ForceSendFields will be sent to the 3170 // server regardless of whether the field is empty or not. This may be 3171 // used to include empty fields in Patch requests. 3172 ForceSendFields []string `json:"-"` 3173 3174 // NullFields is a list of field names (e.g. "Configuration") to include 3175 // in API requests with the JSON null value. By default, fields with 3176 // empty values are omitted from API requests. However, any field with 3177 // an empty value appearing in NullFields will be sent to the server as 3178 // null. It is an error if a field in this list has a non-empty value. 3179 // This may be used to include null fields in Patch requests. 3180 NullFields []string `json:"-"` 3181} 3182 3183func (s *Job) MarshalJSON() ([]byte, error) { 3184 type NoMethod Job 3185 raw := NoMethod(*s) 3186 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3187} 3188 3189type JobCancelResponse struct { 3190 // Job: The final state of the job. 3191 Job *Job `json:"job,omitempty"` 3192 3193 // Kind: The resource type of the response. 3194 Kind string `json:"kind,omitempty"` 3195 3196 // ServerResponse contains the HTTP response code and headers from the 3197 // server. 3198 googleapi.ServerResponse `json:"-"` 3199 3200 // ForceSendFields is a list of field names (e.g. "Job") to 3201 // unconditionally include in API requests. By default, fields with 3202 // empty values are omitted from API requests. However, any non-pointer, 3203 // non-interface field appearing in ForceSendFields will be sent to the 3204 // server regardless of whether the field is empty or not. This may be 3205 // used to include empty fields in Patch requests. 3206 ForceSendFields []string `json:"-"` 3207 3208 // NullFields is a list of field names (e.g. "Job") to include in API 3209 // requests with the JSON null value. By default, fields with empty 3210 // values are omitted from API requests. However, any field with an 3211 // empty value appearing in NullFields will be sent to the server as 3212 // null. It is an error if a field in this list has a non-empty value. 3213 // This may be used to include null fields in Patch requests. 3214 NullFields []string `json:"-"` 3215} 3216 3217func (s *JobCancelResponse) MarshalJSON() ([]byte, error) { 3218 type NoMethod JobCancelResponse 3219 raw := NoMethod(*s) 3220 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3221} 3222 3223type JobConfiguration struct { 3224 // Copy: [Pick one] Copies a table. 3225 Copy *JobConfigurationTableCopy `json:"copy,omitempty"` 3226 3227 // DryRun: [Optional] If set, don't actually run this job. A valid query 3228 // will return a mostly empty response with some processing statistics, 3229 // while an invalid query will return the same error it would if it 3230 // wasn't a dry run. Behavior of non-query jobs is undefined. 3231 DryRun bool `json:"dryRun,omitempty"` 3232 3233 // Extract: [Pick one] Configures an extract job. 3234 Extract *JobConfigurationExtract `json:"extract,omitempty"` 3235 3236 // JobTimeoutMs: [Optional] Job timeout in milliseconds. If this time 3237 // limit is exceeded, BigQuery may attempt to terminate the job. 3238 JobTimeoutMs int64 `json:"jobTimeoutMs,omitempty,string"` 3239 3240 // JobType: [Output-only] The type of the job. Can be QUERY, LOAD, 3241 // EXTRACT, COPY or UNKNOWN. 3242 JobType string `json:"jobType,omitempty"` 3243 3244 // Labels: The labels associated with this job. You can use these to 3245 // organize and group your jobs. Label keys and values can be no longer 3246 // than 63 characters, can only contain lowercase letters, numeric 3247 // characters, underscores and dashes. International characters are 3248 // allowed. Label values are optional. Label keys must start with a 3249 // letter and each label in the list must have a different key. 3250 Labels map[string]string `json:"labels,omitempty"` 3251 3252 // Load: [Pick one] Configures a load job. 3253 Load *JobConfigurationLoad `json:"load,omitempty"` 3254 3255 // Query: [Pick one] Configures a query job. 3256 Query *JobConfigurationQuery `json:"query,omitempty"` 3257 3258 // ForceSendFields is a list of field names (e.g. "Copy") to 3259 // unconditionally include in API requests. By default, fields with 3260 // empty values are omitted from API requests. However, any non-pointer, 3261 // non-interface field appearing in ForceSendFields will be sent to the 3262 // server regardless of whether the field is empty or not. This may be 3263 // used to include empty fields in Patch requests. 3264 ForceSendFields []string `json:"-"` 3265 3266 // NullFields is a list of field names (e.g. "Copy") to include in API 3267 // requests with the JSON null value. By default, fields with empty 3268 // values are omitted from API requests. However, any field with an 3269 // empty value appearing in NullFields will be sent to the server as 3270 // null. It is an error if a field in this list has a non-empty value. 3271 // This may be used to include null fields in Patch requests. 3272 NullFields []string `json:"-"` 3273} 3274 3275func (s *JobConfiguration) MarshalJSON() ([]byte, error) { 3276 type NoMethod JobConfiguration 3277 raw := NoMethod(*s) 3278 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3279} 3280 3281type JobConfigurationExtract struct { 3282 // Compression: [Optional] The compression type to use for exported 3283 // files. Possible values include GZIP, DEFLATE, SNAPPY, and NONE. The 3284 // default value is NONE. DEFLATE and SNAPPY are only supported for 3285 // Avro. Not applicable when extracting models. 3286 Compression string `json:"compression,omitempty"` 3287 3288 // DestinationFormat: [Optional] The exported file format. Possible 3289 // values include CSV, NEWLINE_DELIMITED_JSON or AVRO for tables and 3290 // ML_TF_SAVED_MODEL or ML_XGBOOST_BOOSTER for models. The default value 3291 // for tables is CSV. Tables with nested or repeated fields cannot be 3292 // exported as CSV. The default value for models is ML_TF_SAVED_MODEL. 3293 DestinationFormat string `json:"destinationFormat,omitempty"` 3294 3295 // DestinationUri: [Pick one] DEPRECATED: Use destinationUris instead, 3296 // passing only one URI as necessary. The fully-qualified Google Cloud 3297 // Storage URI where the extracted table should be written. 3298 DestinationUri string `json:"destinationUri,omitempty"` 3299 3300 // DestinationUris: [Pick one] A list of fully-qualified Google Cloud 3301 // Storage URIs where the extracted table should be written. 3302 DestinationUris []string `json:"destinationUris,omitempty"` 3303 3304 // FieldDelimiter: [Optional] Delimiter to use between fields in the 3305 // exported data. Default is ','. Not applicable when extracting models. 3306 FieldDelimiter string `json:"fieldDelimiter,omitempty"` 3307 3308 // PrintHeader: [Optional] Whether to print out a header row in the 3309 // results. Default is true. Not applicable when extracting models. 3310 // 3311 // Default: true 3312 PrintHeader *bool `json:"printHeader,omitempty"` 3313 3314 // SourceModel: A reference to the model being exported. 3315 SourceModel *ModelReference `json:"sourceModel,omitempty"` 3316 3317 // SourceTable: A reference to the table being exported. 3318 SourceTable *TableReference `json:"sourceTable,omitempty"` 3319 3320 // UseAvroLogicalTypes: [Optional] If destinationFormat is set to 3321 // "AVRO", this flag indicates whether to enable extracting applicable 3322 // column types (such as TIMESTAMP) to their corresponding AVRO logical 3323 // types (timestamp-micros), instead of only using their raw types 3324 // (avro-long). Not applicable when extracting models. 3325 UseAvroLogicalTypes bool `json:"useAvroLogicalTypes,omitempty"` 3326 3327 // ForceSendFields is a list of field names (e.g. "Compression") to 3328 // unconditionally include in API requests. By default, fields with 3329 // empty values are omitted from API requests. However, any non-pointer, 3330 // non-interface field appearing in ForceSendFields will be sent to the 3331 // server regardless of whether the field is empty or not. This may be 3332 // used to include empty fields in Patch requests. 3333 ForceSendFields []string `json:"-"` 3334 3335 // NullFields is a list of field names (e.g. "Compression") to include 3336 // in API requests with the JSON null value. By default, fields with 3337 // empty values are omitted from API requests. However, any field with 3338 // an empty value appearing in NullFields will be sent to the server as 3339 // null. It is an error if a field in this list has a non-empty value. 3340 // This may be used to include null fields in Patch requests. 3341 NullFields []string `json:"-"` 3342} 3343 3344func (s *JobConfigurationExtract) MarshalJSON() ([]byte, error) { 3345 type NoMethod JobConfigurationExtract 3346 raw := NoMethod(*s) 3347 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3348} 3349 3350type JobConfigurationLoad struct { 3351 // AllowJaggedRows: [Optional] Accept rows that are missing trailing 3352 // optional columns. The missing values are treated as nulls. If false, 3353 // records with missing trailing columns are treated as bad records, and 3354 // if there are too many bad records, an invalid error is returned in 3355 // the job result. The default value is false. Only applicable to CSV, 3356 // ignored for other formats. 3357 AllowJaggedRows bool `json:"allowJaggedRows,omitempty"` 3358 3359 // AllowQuotedNewlines: Indicates if BigQuery should allow quoted data 3360 // sections that contain newline characters in a CSV file. The default 3361 // value is false. 3362 AllowQuotedNewlines bool `json:"allowQuotedNewlines,omitempty"` 3363 3364 // Autodetect: [Optional] Indicates if we should automatically infer the 3365 // options and schema for CSV and JSON sources. 3366 Autodetect bool `json:"autodetect,omitempty"` 3367 3368 // Clustering: [Beta] Clustering specification for the destination 3369 // table. Must be specified with time-based partitioning, data in the 3370 // table will be first partitioned and subsequently clustered. 3371 Clustering *Clustering `json:"clustering,omitempty"` 3372 3373 // CreateDisposition: [Optional] Specifies whether the job is allowed to 3374 // create new tables. The following values are supported: 3375 // CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the 3376 // table. CREATE_NEVER: The table must already exist. If it does not, a 3377 // 'notFound' error is returned in the job result. The default value is 3378 // CREATE_IF_NEEDED. Creation, truncation and append actions occur as 3379 // one atomic update upon job completion. 3380 CreateDisposition string `json:"createDisposition,omitempty"` 3381 3382 // DestinationEncryptionConfiguration: Custom encryption configuration 3383 // (e.g., Cloud KMS keys). 3384 DestinationEncryptionConfiguration *EncryptionConfiguration `json:"destinationEncryptionConfiguration,omitempty"` 3385 3386 // DestinationTable: [Required] The destination table to load the data 3387 // into. 3388 DestinationTable *TableReference `json:"destinationTable,omitempty"` 3389 3390 // DestinationTableProperties: [Beta] [Optional] Properties with which 3391 // to create the destination table if it is new. 3392 DestinationTableProperties *DestinationTableProperties `json:"destinationTableProperties,omitempty"` 3393 3394 // Encoding: [Optional] The character encoding of the data. The 3395 // supported values are UTF-8 or ISO-8859-1. The default value is UTF-8. 3396 // BigQuery decodes the data after the raw, binary data has been split 3397 // using the values of the quote and fieldDelimiter properties. 3398 Encoding string `json:"encoding,omitempty"` 3399 3400 // FieldDelimiter: [Optional] The separator for fields in a CSV file. 3401 // The separator can be any ISO-8859-1 single-byte character. To use a 3402 // character in the range 128-255, you must encode the character as 3403 // UTF8. BigQuery converts the string to ISO-8859-1 encoding, and then 3404 // uses the first byte of the encoded string to split the data in its 3405 // raw, binary state. BigQuery also supports the escape sequence "\t" to 3406 // specify a tab separator. The default value is a comma (','). 3407 FieldDelimiter string `json:"fieldDelimiter,omitempty"` 3408 3409 // HivePartitioningOptions: [Optional, Trusted Tester] Options to 3410 // configure hive partitioning support. 3411 HivePartitioningOptions *HivePartitioningOptions `json:"hivePartitioningOptions,omitempty"` 3412 3413 // IgnoreUnknownValues: [Optional] Indicates if BigQuery should allow 3414 // extra values that are not represented in the table schema. If true, 3415 // the extra values are ignored. If false, records with extra columns 3416 // are treated as bad records, and if there are too many bad records, an 3417 // invalid error is returned in the job result. The default value is 3418 // false. The sourceFormat property determines what BigQuery treats as 3419 // an extra value: CSV: Trailing columns JSON: Named values that don't 3420 // match any column names 3421 IgnoreUnknownValues bool `json:"ignoreUnknownValues,omitempty"` 3422 3423 // MaxBadRecords: [Optional] The maximum number of bad records that 3424 // BigQuery can ignore when running the job. If the number of bad 3425 // records exceeds this value, an invalid error is returned in the job 3426 // result. This is only valid for CSV and JSON. The default value is 0, 3427 // which requires that all records are valid. 3428 MaxBadRecords int64 `json:"maxBadRecords,omitempty"` 3429 3430 // NullMarker: [Optional] Specifies a string that represents a null 3431 // value in a CSV file. For example, if you specify "\N", BigQuery 3432 // interprets "\N" as a null value when loading a CSV file. The default 3433 // value is the empty string. If you set this property to a custom 3434 // value, BigQuery throws an error if an empty string is present for all 3435 // data types except for STRING and BYTE. For STRING and BYTE columns, 3436 // BigQuery interprets the empty string as an empty value. 3437 NullMarker string `json:"nullMarker,omitempty"` 3438 3439 // ProjectionFields: If sourceFormat is set to "DATASTORE_BACKUP", 3440 // indicates which entity properties to load into BigQuery from a Cloud 3441 // Datastore backup. Property names are case sensitive and must be 3442 // top-level properties. If no properties are specified, BigQuery loads 3443 // all properties. If any named property isn't found in the Cloud 3444 // Datastore backup, an invalid error is returned in the job result. 3445 ProjectionFields []string `json:"projectionFields,omitempty"` 3446 3447 // Quote: [Optional] The value that is used to quote data sections in a 3448 // CSV file. BigQuery converts the string to ISO-8859-1 encoding, and 3449 // then uses the first byte of the encoded string to split the data in 3450 // its raw, binary state. The default value is a double-quote ('"'). If 3451 // your data does not contain quoted sections, set the property value to 3452 // an empty string. If your data contains quoted newline characters, you 3453 // must also set the allowQuotedNewlines property to true. 3454 // 3455 // Default: " 3456 Quote *string `json:"quote,omitempty"` 3457 3458 // RangePartitioning: [TrustedTester] Range partitioning specification 3459 // for this table. Only one of timePartitioning and rangePartitioning 3460 // should be specified. 3461 RangePartitioning *RangePartitioning `json:"rangePartitioning,omitempty"` 3462 3463 // Schema: [Optional] The schema for the destination table. The schema 3464 // can be omitted if the destination table already exists, or if you're 3465 // loading data from Google Cloud Datastore. 3466 Schema *TableSchema `json:"schema,omitempty"` 3467 3468 // SchemaInline: [Deprecated] The inline schema. For CSV schemas, 3469 // specify as "Field1:Type1[,Field2:Type2]*". For example, "foo:STRING, 3470 // bar:INTEGER, baz:FLOAT". 3471 SchemaInline string `json:"schemaInline,omitempty"` 3472 3473 // SchemaInlineFormat: [Deprecated] The format of the schemaInline 3474 // property. 3475 SchemaInlineFormat string `json:"schemaInlineFormat,omitempty"` 3476 3477 // SchemaUpdateOptions: Allows the schema of the destination table to be 3478 // updated as a side effect of the load job if a schema is autodetected 3479 // or supplied in the job configuration. Schema update options are 3480 // supported in two cases: when writeDisposition is WRITE_APPEND; when 3481 // writeDisposition is WRITE_TRUNCATE and the destination table is a 3482 // partition of a table, specified by partition decorators. For normal 3483 // tables, WRITE_TRUNCATE will always overwrite the schema. One or more 3484 // of the following values are specified: ALLOW_FIELD_ADDITION: allow 3485 // adding a nullable field to the schema. ALLOW_FIELD_RELAXATION: allow 3486 // relaxing a required field in the original schema to nullable. 3487 SchemaUpdateOptions []string `json:"schemaUpdateOptions,omitempty"` 3488 3489 // SkipLeadingRows: [Optional] The number of rows at the top of a CSV 3490 // file that BigQuery will skip when loading the data. The default value 3491 // is 0. This property is useful if you have header rows in the file 3492 // that should be skipped. 3493 SkipLeadingRows int64 `json:"skipLeadingRows,omitempty"` 3494 3495 // SourceFormat: [Optional] The format of the data files. For CSV files, 3496 // specify "CSV". For datastore backups, specify "DATASTORE_BACKUP". For 3497 // newline-delimited JSON, specify "NEWLINE_DELIMITED_JSON". For Avro, 3498 // specify "AVRO". For parquet, specify "PARQUET". For orc, specify 3499 // "ORC". The default value is CSV. 3500 SourceFormat string `json:"sourceFormat,omitempty"` 3501 3502 // SourceUris: [Required] The fully-qualified URIs that point to your 3503 // data in Google Cloud. For Google Cloud Storage URIs: Each URI can 3504 // contain one '*' wildcard character and it must come after the 3505 // 'bucket' name. Size limits related to load jobs apply to external 3506 // data sources. For Google Cloud Bigtable URIs: Exactly one URI can be 3507 // specified and it has be a fully specified and valid HTTPS URL for a 3508 // Google Cloud Bigtable table. For Google Cloud Datastore backups: 3509 // Exactly one URI can be specified. Also, the '*' wildcard character is 3510 // not allowed. 3511 SourceUris []string `json:"sourceUris,omitempty"` 3512 3513 // TimePartitioning: Time-based partitioning specification for the 3514 // destination table. Only one of timePartitioning and rangePartitioning 3515 // should be specified. 3516 TimePartitioning *TimePartitioning `json:"timePartitioning,omitempty"` 3517 3518 // UseAvroLogicalTypes: [Optional] If sourceFormat is set to "AVRO", 3519 // indicates whether to enable interpreting logical types into their 3520 // corresponding types (ie. TIMESTAMP), instead of only using their raw 3521 // types (ie. INTEGER). 3522 UseAvroLogicalTypes bool `json:"useAvroLogicalTypes,omitempty"` 3523 3524 // WriteDisposition: [Optional] Specifies the action that occurs if the 3525 // destination table already exists. The following values are supported: 3526 // WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the 3527 // table data. WRITE_APPEND: If the table already exists, BigQuery 3528 // appends the data to the table. WRITE_EMPTY: If the table already 3529 // exists and contains data, a 'duplicate' error is returned in the job 3530 // result. The default value is WRITE_APPEND. Each action is atomic and 3531 // only occurs if BigQuery is able to complete the job successfully. 3532 // Creation, truncation and append actions occur as one atomic update 3533 // upon job completion. 3534 WriteDisposition string `json:"writeDisposition,omitempty"` 3535 3536 // ForceSendFields is a list of field names (e.g. "AllowJaggedRows") to 3537 // unconditionally include in API requests. By default, fields with 3538 // empty values are omitted from API requests. However, any non-pointer, 3539 // non-interface field appearing in ForceSendFields will be sent to the 3540 // server regardless of whether the field is empty or not. This may be 3541 // used to include empty fields in Patch requests. 3542 ForceSendFields []string `json:"-"` 3543 3544 // NullFields is a list of field names (e.g. "AllowJaggedRows") to 3545 // include in API requests with the JSON null value. By default, fields 3546 // with empty values are omitted from API requests. However, any field 3547 // with an empty value appearing in NullFields will be sent to the 3548 // server as null. It is an error if a field in this list has a 3549 // non-empty value. This may be used to include null fields in Patch 3550 // requests. 3551 NullFields []string `json:"-"` 3552} 3553 3554func (s *JobConfigurationLoad) MarshalJSON() ([]byte, error) { 3555 type NoMethod JobConfigurationLoad 3556 raw := NoMethod(*s) 3557 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3558} 3559 3560type JobConfigurationQuery struct { 3561 // AllowLargeResults: [Optional] If true and query uses legacy SQL 3562 // dialect, allows the query to produce arbitrarily large result tables 3563 // at a slight cost in performance. Requires destinationTable to be set. 3564 // For standard SQL queries, this flag is ignored and large results are 3565 // always allowed. However, you must still set destinationTable when 3566 // result size exceeds the allowed maximum response size. 3567 AllowLargeResults bool `json:"allowLargeResults,omitempty"` 3568 3569 // Clustering: [Beta] Clustering specification for the destination 3570 // table. Must be specified with time-based partitioning, data in the 3571 // table will be first partitioned and subsequently clustered. 3572 Clustering *Clustering `json:"clustering,omitempty"` 3573 3574 // ConnectionProperties: Connection properties. 3575 ConnectionProperties []*ConnectionProperty `json:"connectionProperties,omitempty"` 3576 3577 // CreateDisposition: [Optional] Specifies whether the job is allowed to 3578 // create new tables. The following values are supported: 3579 // CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the 3580 // table. CREATE_NEVER: The table must already exist. If it does not, a 3581 // 'notFound' error is returned in the job result. The default value is 3582 // CREATE_IF_NEEDED. Creation, truncation and append actions occur as 3583 // one atomic update upon job completion. 3584 CreateDisposition string `json:"createDisposition,omitempty"` 3585 3586 // DefaultDataset: [Optional] Specifies the default dataset to use for 3587 // unqualified table names in the query. Note that this does not alter 3588 // behavior of unqualified dataset names. 3589 DefaultDataset *DatasetReference `json:"defaultDataset,omitempty"` 3590 3591 // DestinationEncryptionConfiguration: Custom encryption configuration 3592 // (e.g., Cloud KMS keys). 3593 DestinationEncryptionConfiguration *EncryptionConfiguration `json:"destinationEncryptionConfiguration,omitempty"` 3594 3595 // DestinationTable: [Optional] Describes the table where the query 3596 // results should be stored. If not present, a new table will be created 3597 // to store the results. This property must be set for large results 3598 // that exceed the maximum response size. 3599 DestinationTable *TableReference `json:"destinationTable,omitempty"` 3600 3601 // FlattenResults: [Optional] If true and query uses legacy SQL dialect, 3602 // flattens all nested and repeated fields in the query results. 3603 // allowLargeResults must be true if this is set to false. For standard 3604 // SQL queries, this flag is ignored and results are never flattened. 3605 // 3606 // Default: true 3607 FlattenResults *bool `json:"flattenResults,omitempty"` 3608 3609 // MaximumBillingTier: [Optional] Limits the billing tier for this job. 3610 // Queries that have resource usage beyond this tier will fail (without 3611 // incurring a charge). If unspecified, this will be set to your project 3612 // default. 3613 // 3614 // Default: 1 3615 MaximumBillingTier *int64 `json:"maximumBillingTier,omitempty"` 3616 3617 // MaximumBytesBilled: [Optional] Limits the bytes billed for this job. 3618 // Queries that will have bytes billed beyond this limit will fail 3619 // (without incurring a charge). If unspecified, this will be set to 3620 // your project default. 3621 MaximumBytesBilled int64 `json:"maximumBytesBilled,omitempty,string"` 3622 3623 // ParameterMode: Standard SQL only. Set to POSITIONAL to use positional 3624 // (?) query parameters or to NAMED to use named (@myparam) query 3625 // parameters in this query. 3626 ParameterMode string `json:"parameterMode,omitempty"` 3627 3628 // PreserveNulls: [Deprecated] This property is deprecated. 3629 PreserveNulls bool `json:"preserveNulls,omitempty"` 3630 3631 // Priority: [Optional] Specifies a priority for the query. Possible 3632 // values include INTERACTIVE and BATCH. The default value is 3633 // INTERACTIVE. 3634 Priority string `json:"priority,omitempty"` 3635 3636 // Query: [Required] SQL query text to execute. The useLegacySql field 3637 // can be used to indicate whether the query uses legacy SQL or standard 3638 // SQL. 3639 Query string `json:"query,omitempty"` 3640 3641 // QueryParameters: Query parameters for standard SQL queries. 3642 QueryParameters []*QueryParameter `json:"queryParameters,omitempty"` 3643 3644 // RangePartitioning: [TrustedTester] Range partitioning specification 3645 // for this table. Only one of timePartitioning and rangePartitioning 3646 // should be specified. 3647 RangePartitioning *RangePartitioning `json:"rangePartitioning,omitempty"` 3648 3649 // SchemaUpdateOptions: Allows the schema of the destination table to be 3650 // updated as a side effect of the query job. Schema update options are 3651 // supported in two cases: when writeDisposition is WRITE_APPEND; when 3652 // writeDisposition is WRITE_TRUNCATE and the destination table is a 3653 // partition of a table, specified by partition decorators. For normal 3654 // tables, WRITE_TRUNCATE will always overwrite the schema. One or more 3655 // of the following values are specified: ALLOW_FIELD_ADDITION: allow 3656 // adding a nullable field to the schema. ALLOW_FIELD_RELAXATION: allow 3657 // relaxing a required field in the original schema to nullable. 3658 SchemaUpdateOptions []string `json:"schemaUpdateOptions,omitempty"` 3659 3660 // TableDefinitions: [Optional] If querying an external data source 3661 // outside of BigQuery, describes the data format, location and other 3662 // properties of the data source. By defining these properties, the data 3663 // source can then be queried as if it were a standard BigQuery table. 3664 TableDefinitions map[string]ExternalDataConfiguration `json:"tableDefinitions,omitempty"` 3665 3666 // TimePartitioning: Time-based partitioning specification for the 3667 // destination table. Only one of timePartitioning and rangePartitioning 3668 // should be specified. 3669 TimePartitioning *TimePartitioning `json:"timePartitioning,omitempty"` 3670 3671 // UseLegacySql: Specifies whether to use BigQuery's legacy SQL dialect 3672 // for this query. The default value is true. If set to false, the query 3673 // will use BigQuery's standard SQL: 3674 // https://cloud.google.com/bigquery/sql-reference/ When useLegacySql is 3675 // set to false, the value of flattenResults is ignored; query will be 3676 // run as if flattenResults is false. 3677 // 3678 // Default: true 3679 UseLegacySql *bool `json:"useLegacySql,omitempty"` 3680 3681 // UseQueryCache: [Optional] Whether to look for the result in the query 3682 // cache. The query cache is a best-effort cache that will be flushed 3683 // whenever tables in the query are modified. Moreover, the query cache 3684 // is only available when a query does not have a destination table 3685 // specified. The default value is true. 3686 // 3687 // Default: true 3688 UseQueryCache *bool `json:"useQueryCache,omitempty"` 3689 3690 // UserDefinedFunctionResources: Describes user-defined function 3691 // resources used in the query. 3692 UserDefinedFunctionResources []*UserDefinedFunctionResource `json:"userDefinedFunctionResources,omitempty"` 3693 3694 // WriteDisposition: [Optional] Specifies the action that occurs if the 3695 // destination table already exists. The following values are supported: 3696 // WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the 3697 // table data and uses the schema from the query result. WRITE_APPEND: 3698 // If the table already exists, BigQuery appends the data to the table. 3699 // WRITE_EMPTY: If the table already exists and contains data, a 3700 // 'duplicate' error is returned in the job result. The default value is 3701 // WRITE_EMPTY. Each action is atomic and only occurs if BigQuery is 3702 // able to complete the job successfully. Creation, truncation and 3703 // append actions occur as one atomic update upon job completion. 3704 WriteDisposition string `json:"writeDisposition,omitempty"` 3705 3706 // ForceSendFields is a list of field names (e.g. "AllowLargeResults") 3707 // to unconditionally include in API requests. By default, fields with 3708 // empty values are omitted from API requests. However, any non-pointer, 3709 // non-interface field appearing in ForceSendFields will be sent to the 3710 // server regardless of whether the field is empty or not. This may be 3711 // used to include empty fields in Patch requests. 3712 ForceSendFields []string `json:"-"` 3713 3714 // NullFields is a list of field names (e.g. "AllowLargeResults") to 3715 // include in API requests with the JSON null value. By default, fields 3716 // with empty values are omitted from API requests. However, any field 3717 // with an empty value appearing in NullFields will be sent to the 3718 // server as null. It is an error if a field in this list has a 3719 // non-empty value. This may be used to include null fields in Patch 3720 // requests. 3721 NullFields []string `json:"-"` 3722} 3723 3724func (s *JobConfigurationQuery) MarshalJSON() ([]byte, error) { 3725 type NoMethod JobConfigurationQuery 3726 raw := NoMethod(*s) 3727 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3728} 3729 3730type JobConfigurationTableCopy struct { 3731 // CreateDisposition: [Optional] Specifies whether the job is allowed to 3732 // create new tables. The following values are supported: 3733 // CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the 3734 // table. CREATE_NEVER: The table must already exist. If it does not, a 3735 // 'notFound' error is returned in the job result. The default value is 3736 // CREATE_IF_NEEDED. Creation, truncation and append actions occur as 3737 // one atomic update upon job completion. 3738 CreateDisposition string `json:"createDisposition,omitempty"` 3739 3740 // DestinationEncryptionConfiguration: Custom encryption configuration 3741 // (e.g., Cloud KMS keys). 3742 DestinationEncryptionConfiguration *EncryptionConfiguration `json:"destinationEncryptionConfiguration,omitempty"` 3743 3744 // DestinationExpirationTime: [Optional] The time when the destination 3745 // table expires. Expired tables will be deleted and their storage 3746 // reclaimed. 3747 DestinationExpirationTime interface{} `json:"destinationExpirationTime,omitempty"` 3748 3749 // DestinationTable: [Required] The destination table 3750 DestinationTable *TableReference `json:"destinationTable,omitempty"` 3751 3752 // OperationType: [Optional] Supported operation types in table copy 3753 // job. 3754 OperationType string `json:"operationType,omitempty"` 3755 3756 // SourceTable: [Pick one] Source table to copy. 3757 SourceTable *TableReference `json:"sourceTable,omitempty"` 3758 3759 // SourceTables: [Pick one] Source tables to copy. 3760 SourceTables []*TableReference `json:"sourceTables,omitempty"` 3761 3762 // WriteDisposition: [Optional] Specifies the action that occurs if the 3763 // destination table already exists. The following values are supported: 3764 // WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the 3765 // table data. WRITE_APPEND: If the table already exists, BigQuery 3766 // appends the data to the table. WRITE_EMPTY: If the table already 3767 // exists and contains data, a 'duplicate' error is returned in the job 3768 // result. The default value is WRITE_EMPTY. Each action is atomic and 3769 // only occurs if BigQuery is able to complete the job successfully. 3770 // Creation, truncation and append actions occur as one atomic update 3771 // upon job completion. 3772 WriteDisposition string `json:"writeDisposition,omitempty"` 3773 3774 // ForceSendFields is a list of field names (e.g. "CreateDisposition") 3775 // to unconditionally include in API requests. By default, fields with 3776 // empty values are omitted from API requests. However, any non-pointer, 3777 // non-interface field appearing in ForceSendFields will be sent to the 3778 // server regardless of whether the field is empty or not. This may be 3779 // used to include empty fields in Patch requests. 3780 ForceSendFields []string `json:"-"` 3781 3782 // NullFields is a list of field names (e.g. "CreateDisposition") to 3783 // include in API requests with the JSON null value. By default, fields 3784 // with empty values are omitted from API requests. However, any field 3785 // with an empty value appearing in NullFields will be sent to the 3786 // server as null. It is an error if a field in this list has a 3787 // non-empty value. This may be used to include null fields in Patch 3788 // requests. 3789 NullFields []string `json:"-"` 3790} 3791 3792func (s *JobConfigurationTableCopy) MarshalJSON() ([]byte, error) { 3793 type NoMethod JobConfigurationTableCopy 3794 raw := NoMethod(*s) 3795 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3796} 3797 3798type JobList struct { 3799 // Etag: A hash of this page of results. 3800 Etag string `json:"etag,omitempty"` 3801 3802 // Jobs: List of jobs that were requested. 3803 Jobs []*JobListJobs `json:"jobs,omitempty"` 3804 3805 // Kind: The resource type of the response. 3806 Kind string `json:"kind,omitempty"` 3807 3808 // NextPageToken: A token to request the next page of results. 3809 NextPageToken string `json:"nextPageToken,omitempty"` 3810 3811 // ServerResponse contains the HTTP response code and headers from the 3812 // server. 3813 googleapi.ServerResponse `json:"-"` 3814 3815 // ForceSendFields is a list of field names (e.g. "Etag") to 3816 // unconditionally include in API requests. By default, fields with 3817 // empty values are omitted from API requests. However, any non-pointer, 3818 // non-interface field appearing in ForceSendFields will be sent to the 3819 // server regardless of whether the field is empty or not. This may be 3820 // used to include empty fields in Patch requests. 3821 ForceSendFields []string `json:"-"` 3822 3823 // NullFields is a list of field names (e.g. "Etag") to include in API 3824 // requests with the JSON null value. By default, fields with empty 3825 // values are omitted from API requests. However, any field with an 3826 // empty value appearing in NullFields will be sent to the server as 3827 // null. It is an error if a field in this list has a non-empty value. 3828 // This may be used to include null fields in Patch requests. 3829 NullFields []string `json:"-"` 3830} 3831 3832func (s *JobList) MarshalJSON() ([]byte, error) { 3833 type NoMethod JobList 3834 raw := NoMethod(*s) 3835 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3836} 3837 3838type JobListJobs struct { 3839 // Configuration: [Full-projection-only] Specifies the job 3840 // configuration. 3841 Configuration *JobConfiguration `json:"configuration,omitempty"` 3842 3843 // ErrorResult: A result object that will be present only if the job has 3844 // failed. 3845 ErrorResult *ErrorProto `json:"errorResult,omitempty"` 3846 3847 // Id: Unique opaque ID of the job. 3848 Id string `json:"id,omitempty"` 3849 3850 // JobReference: Job reference uniquely identifying the job. 3851 JobReference *JobReference `json:"jobReference,omitempty"` 3852 3853 // Kind: The resource type. 3854 Kind string `json:"kind,omitempty"` 3855 3856 // State: Running state of the job. When the state is DONE, errorResult 3857 // can be checked to determine whether the job succeeded or failed. 3858 State string `json:"state,omitempty"` 3859 3860 // Statistics: [Output-only] Information about the job, including 3861 // starting time and ending time of the job. 3862 Statistics *JobStatistics `json:"statistics,omitempty"` 3863 3864 // Status: [Full-projection-only] Describes the state of the job. 3865 Status *JobStatus `json:"status,omitempty"` 3866 3867 // UserEmail: [Full-projection-only] Email address of the user who ran 3868 // the job. 3869 UserEmail string `json:"user_email,omitempty"` 3870 3871 // ForceSendFields is a list of field names (e.g. "Configuration") to 3872 // unconditionally include in API requests. By default, fields with 3873 // empty values are omitted from API requests. However, any non-pointer, 3874 // non-interface field appearing in ForceSendFields will be sent to the 3875 // server regardless of whether the field is empty or not. This may be 3876 // used to include empty fields in Patch requests. 3877 ForceSendFields []string `json:"-"` 3878 3879 // NullFields is a list of field names (e.g. "Configuration") to include 3880 // in API requests with the JSON null value. By default, fields with 3881 // empty values are omitted from API requests. However, any field with 3882 // an empty value appearing in NullFields will be sent to the server as 3883 // null. It is an error if a field in this list has a non-empty value. 3884 // This may be used to include null fields in Patch requests. 3885 NullFields []string `json:"-"` 3886} 3887 3888func (s *JobListJobs) MarshalJSON() ([]byte, error) { 3889 type NoMethod JobListJobs 3890 raw := NoMethod(*s) 3891 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3892} 3893 3894type JobReference struct { 3895 // JobId: [Required] The ID of the job. The ID must contain only letters 3896 // (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-). The 3897 // maximum length is 1,024 characters. 3898 JobId string `json:"jobId,omitempty"` 3899 3900 // Location: The geographic location of the job. See details at 3901 // https://cloud.google.com/bigquery/docs/locations#specifying_your_location. 3902 Location string `json:"location,omitempty"` 3903 3904 // ProjectId: [Required] The ID of the project containing this job. 3905 ProjectId string `json:"projectId,omitempty"` 3906 3907 // ForceSendFields is a list of field names (e.g. "JobId") to 3908 // unconditionally include in API requests. By default, fields with 3909 // empty values are omitted from API requests. However, any non-pointer, 3910 // non-interface field appearing in ForceSendFields will be sent to the 3911 // server regardless of whether the field is empty or not. This may be 3912 // used to include empty fields in Patch requests. 3913 ForceSendFields []string `json:"-"` 3914 3915 // NullFields is a list of field names (e.g. "JobId") to include in API 3916 // requests with the JSON null value. By default, fields with empty 3917 // values are omitted from API requests. However, any field with an 3918 // empty value appearing in NullFields will be sent to the server as 3919 // null. It is an error if a field in this list has a non-empty value. 3920 // This may be used to include null fields in Patch requests. 3921 NullFields []string `json:"-"` 3922} 3923 3924func (s *JobReference) MarshalJSON() ([]byte, error) { 3925 type NoMethod JobReference 3926 raw := NoMethod(*s) 3927 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3928} 3929 3930type JobStatistics struct { 3931 // CompletionRatio: [TrustedTester] [Output-only] Job progress (0.0 -> 3932 // 1.0) for LOAD and EXTRACT jobs. 3933 CompletionRatio float64 `json:"completionRatio,omitempty"` 3934 3935 // CreationTime: [Output-only] Creation time of this job, in 3936 // milliseconds since the epoch. This field will be present on all jobs. 3937 CreationTime int64 `json:"creationTime,omitempty,string"` 3938 3939 // EndTime: [Output-only] End time of this job, in milliseconds since 3940 // the epoch. This field will be present whenever a job is in the DONE 3941 // state. 3942 EndTime int64 `json:"endTime,omitempty,string"` 3943 3944 // Extract: [Output-only] Statistics for an extract job. 3945 Extract *JobStatistics4 `json:"extract,omitempty"` 3946 3947 // Load: [Output-only] Statistics for a load job. 3948 Load *JobStatistics3 `json:"load,omitempty"` 3949 3950 // NumChildJobs: [Output-only] Number of child jobs executed. 3951 NumChildJobs int64 `json:"numChildJobs,omitempty,string"` 3952 3953 // ParentJobId: [Output-only] If this is a child job, the id of the 3954 // parent. 3955 ParentJobId string `json:"parentJobId,omitempty"` 3956 3957 // Query: [Output-only] Statistics for a query job. 3958 Query *JobStatistics2 `json:"query,omitempty"` 3959 3960 // QuotaDeferments: [Output-only] Quotas which delayed this job's start 3961 // time. 3962 QuotaDeferments []string `json:"quotaDeferments,omitempty"` 3963 3964 // ReservationUsage: [Output-only] Job resource usage breakdown by 3965 // reservation. 3966 ReservationUsage []*JobStatisticsReservationUsage `json:"reservationUsage,omitempty"` 3967 3968 // ReservationId: [Output-only] Name of the primary reservation assigned 3969 // to this job. Note that this could be different than reservations 3970 // reported in the reservation usage field if parent reservations were 3971 // used to execute this job. 3972 ReservationId string `json:"reservation_id,omitempty"` 3973 3974 // RowLevelSecurityStatistics: [Output-only] [Preview] Statistics for 3975 // row-level security. Present only for query and extract jobs. 3976 RowLevelSecurityStatistics *RowLevelSecurityStatistics `json:"rowLevelSecurityStatistics,omitempty"` 3977 3978 // ScriptStatistics: [Output-only] Statistics for a child job of a 3979 // script. 3980 ScriptStatistics *ScriptStatistics `json:"scriptStatistics,omitempty"` 3981 3982 // StartTime: [Output-only] Start time of this job, in milliseconds 3983 // since the epoch. This field will be present when the job transitions 3984 // from the PENDING state to either RUNNING or DONE. 3985 StartTime int64 `json:"startTime,omitempty,string"` 3986 3987 // TotalBytesProcessed: [Output-only] [Deprecated] Use the bytes 3988 // processed in the query statistics instead. 3989 TotalBytesProcessed int64 `json:"totalBytesProcessed,omitempty,string"` 3990 3991 // TotalSlotMs: [Output-only] Slot-milliseconds for the job. 3992 TotalSlotMs int64 `json:"totalSlotMs,omitempty,string"` 3993 3994 // ForceSendFields is a list of field names (e.g. "CompletionRatio") to 3995 // unconditionally include in API requests. By default, fields with 3996 // empty values are omitted from API requests. However, any non-pointer, 3997 // non-interface field appearing in ForceSendFields will be sent to the 3998 // server regardless of whether the field is empty or not. This may be 3999 // used to include empty fields in Patch requests. 4000 ForceSendFields []string `json:"-"` 4001 4002 // NullFields is a list of field names (e.g. "CompletionRatio") to 4003 // include in API requests with the JSON null value. By default, fields 4004 // with empty values are omitted from API requests. However, any field 4005 // with an empty value appearing in NullFields will be sent to the 4006 // server as null. It is an error if a field in this list has a 4007 // non-empty value. This may be used to include null fields in Patch 4008 // requests. 4009 NullFields []string `json:"-"` 4010} 4011 4012func (s *JobStatistics) MarshalJSON() ([]byte, error) { 4013 type NoMethod JobStatistics 4014 raw := NoMethod(*s) 4015 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4016} 4017 4018func (s *JobStatistics) UnmarshalJSON(data []byte) error { 4019 type NoMethod JobStatistics 4020 var s1 struct { 4021 CompletionRatio gensupport.JSONFloat64 `json:"completionRatio"` 4022 *NoMethod 4023 } 4024 s1.NoMethod = (*NoMethod)(s) 4025 if err := json.Unmarshal(data, &s1); err != nil { 4026 return err 4027 } 4028 s.CompletionRatio = float64(s1.CompletionRatio) 4029 return nil 4030} 4031 4032type JobStatisticsReservationUsage struct { 4033 // Name: [Output-only] Reservation name or "unreserved" for on-demand 4034 // resources usage. 4035 Name string `json:"name,omitempty"` 4036 4037 // SlotMs: [Output-only] Slot-milliseconds the job spent in the given 4038 // reservation. 4039 SlotMs int64 `json:"slotMs,omitempty,string"` 4040 4041 // ForceSendFields is a list of field names (e.g. "Name") to 4042 // unconditionally include in API requests. By default, fields with 4043 // empty values are omitted from API requests. However, any non-pointer, 4044 // non-interface field appearing in ForceSendFields will be sent to the 4045 // server regardless of whether the field is empty or not. This may be 4046 // used to include empty fields in Patch requests. 4047 ForceSendFields []string `json:"-"` 4048 4049 // NullFields is a list of field names (e.g. "Name") to include in API 4050 // requests with the JSON null value. By default, fields with empty 4051 // values are omitted from API requests. However, any field with an 4052 // empty value appearing in NullFields will be sent to the server as 4053 // null. It is an error if a field in this list has a non-empty value. 4054 // This may be used to include null fields in Patch requests. 4055 NullFields []string `json:"-"` 4056} 4057 4058func (s *JobStatisticsReservationUsage) MarshalJSON() ([]byte, error) { 4059 type NoMethod JobStatisticsReservationUsage 4060 raw := NoMethod(*s) 4061 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4062} 4063 4064type JobStatistics2 struct { 4065 // BillingTier: [Output-only] Billing tier for the job. 4066 BillingTier int64 `json:"billingTier,omitempty"` 4067 4068 // CacheHit: [Output-only] Whether the query result was fetched from the 4069 // query cache. 4070 CacheHit bool `json:"cacheHit,omitempty"` 4071 4072 // DdlAffectedRowAccessPolicyCount: [Output-only] [Preview] The number 4073 // of row access policies affected by a DDL statement. Present only for 4074 // DROP ALL ROW ACCESS POLICIES queries. 4075 DdlAffectedRowAccessPolicyCount int64 `json:"ddlAffectedRowAccessPolicyCount,omitempty,string"` 4076 4077 // DdlOperationPerformed: The DDL operation performed, possibly 4078 // dependent on the pre-existence of the DDL target. Possible values 4079 // (new values might be added in the future): "CREATE": The query 4080 // created the DDL target. "SKIP": No-op. Example cases: the query is 4081 // CREATE TABLE IF NOT EXISTS while the table already exists, or the 4082 // query is DROP TABLE IF EXISTS while the table does not exist. 4083 // "REPLACE": The query replaced the DDL target. Example case: the query 4084 // is CREATE OR REPLACE TABLE, and the table already exists. "DROP": The 4085 // query deleted the DDL target. 4086 DdlOperationPerformed string `json:"ddlOperationPerformed,omitempty"` 4087 4088 // DdlTargetRoutine: The DDL target routine. Present only for 4089 // CREATE/DROP FUNCTION/PROCEDURE queries. 4090 DdlTargetRoutine *RoutineReference `json:"ddlTargetRoutine,omitempty"` 4091 4092 // DdlTargetRowAccessPolicy: [Output-only] [Preview] The DDL target row 4093 // access policy. Present only for CREATE/DROP ROW ACCESS POLICY 4094 // queries. 4095 DdlTargetRowAccessPolicy *RowAccessPolicyReference `json:"ddlTargetRowAccessPolicy,omitempty"` 4096 4097 // DdlTargetTable: [Output-only] The DDL target table. Present only for 4098 // CREATE/DROP TABLE/VIEW and DROP ALL ROW ACCESS POLICIES queries. 4099 DdlTargetTable *TableReference `json:"ddlTargetTable,omitempty"` 4100 4101 // EstimatedBytesProcessed: [Output-only] The original estimate of bytes 4102 // processed for the job. 4103 EstimatedBytesProcessed int64 `json:"estimatedBytesProcessed,omitempty,string"` 4104 4105 // ModelTraining: [Output-only, Beta] Information about create model 4106 // query job progress. 4107 ModelTraining *BigQueryModelTraining `json:"modelTraining,omitempty"` 4108 4109 // ModelTrainingCurrentIteration: [Output-only, Beta] Deprecated; do not 4110 // use. 4111 ModelTrainingCurrentIteration int64 `json:"modelTrainingCurrentIteration,omitempty"` 4112 4113 // ModelTrainingExpectedTotalIteration: [Output-only, Beta] Deprecated; 4114 // do not use. 4115 ModelTrainingExpectedTotalIteration int64 `json:"modelTrainingExpectedTotalIteration,omitempty,string"` 4116 4117 // NumDmlAffectedRows: [Output-only] The number of rows affected by a 4118 // DML statement. Present only for DML statements INSERT, UPDATE or 4119 // DELETE. 4120 NumDmlAffectedRows int64 `json:"numDmlAffectedRows,omitempty,string"` 4121 4122 // QueryPlan: [Output-only] Describes execution plan for the query. 4123 QueryPlan []*ExplainQueryStage `json:"queryPlan,omitempty"` 4124 4125 // ReferencedRoutines: [Output-only] Referenced routines (persistent 4126 // user-defined functions and stored procedures) for the job. 4127 ReferencedRoutines []*RoutineReference `json:"referencedRoutines,omitempty"` 4128 4129 // ReferencedTables: [Output-only] Referenced tables for the job. 4130 // Queries that reference more than 50 tables will not have a complete 4131 // list. 4132 ReferencedTables []*TableReference `json:"referencedTables,omitempty"` 4133 4134 // ReservationUsage: [Output-only] Job resource usage breakdown by 4135 // reservation. 4136 ReservationUsage []*JobStatistics2ReservationUsage `json:"reservationUsage,omitempty"` 4137 4138 // Schema: [Output-only] The schema of the results. Present only for 4139 // successful dry run of non-legacy SQL queries. 4140 Schema *TableSchema `json:"schema,omitempty"` 4141 4142 // StatementType: The type of query statement, if valid. Possible values 4143 // (new values might be added in the future): "SELECT": SELECT query. 4144 // "INSERT": INSERT query; see 4145 // https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. "UPDATE": UPDATE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. "DELETE": DELETE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. "MERGE": MERGE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. "ALTER_TABLE": ALTER TABLE query. "ALTER_VIEW": ALTER VIEW query. "ASSERT": ASSERT condition AS 'description'. "CREATE_FUNCTION": CREATE FUNCTION query. "CREATE_MODEL": CREATE [OR REPLACE] MODEL ... AS SELECT ... . "CREATE_PROCEDURE": CREATE PROCEDURE query. "CREATE_TABLE": CREATE [OR REPLACE] TABLE without AS SELECT. "CREATE_TABLE_AS_SELECT": CREATE [OR REPLACE] TABLE ... AS SELECT ... . "CREATE_VIEW": CREATE [OR REPLACE] VIEW ... AS SELECT ... . "DROP_FUNCTION" : DROP FUNCTION query. "DROP_PROCEDURE": DROP PROCEDURE query. "DROP_TABLE": DROP TABLE query. "DROP_VIEW": DROP VIEW 4146 // query. 4147 StatementType string `json:"statementType,omitempty"` 4148 4149 // Timeline: [Output-only] [Beta] Describes a timeline of job execution. 4150 Timeline []*QueryTimelineSample `json:"timeline,omitempty"` 4151 4152 // TotalBytesBilled: [Output-only] Total bytes billed for the job. 4153 TotalBytesBilled int64 `json:"totalBytesBilled,omitempty,string"` 4154 4155 // TotalBytesProcessed: [Output-only] Total bytes processed for the job. 4156 TotalBytesProcessed int64 `json:"totalBytesProcessed,omitempty,string"` 4157 4158 // TotalBytesProcessedAccuracy: [Output-only] For dry-run jobs, 4159 // totalBytesProcessed is an estimate and this field specifies the 4160 // accuracy of the estimate. Possible values can be: UNKNOWN: accuracy 4161 // of the estimate is unknown. PRECISE: estimate is precise. 4162 // LOWER_BOUND: estimate is lower bound of what the query would cost. 4163 // UPPER_BOUND: estimate is upper bound of what the query would cost. 4164 TotalBytesProcessedAccuracy string `json:"totalBytesProcessedAccuracy,omitempty"` 4165 4166 // TotalPartitionsProcessed: [Output-only] Total number of partitions 4167 // processed from all partitioned tables referenced in the job. 4168 TotalPartitionsProcessed int64 `json:"totalPartitionsProcessed,omitempty,string"` 4169 4170 // TotalSlotMs: [Output-only] Slot-milliseconds for the job. 4171 TotalSlotMs int64 `json:"totalSlotMs,omitempty,string"` 4172 4173 // UndeclaredQueryParameters: Standard SQL only: list of undeclared 4174 // query parameters detected during a dry run validation. 4175 UndeclaredQueryParameters []*QueryParameter `json:"undeclaredQueryParameters,omitempty"` 4176 4177 // ForceSendFields is a list of field names (e.g. "BillingTier") to 4178 // unconditionally include in API requests. By default, fields with 4179 // empty values are omitted from API requests. However, any non-pointer, 4180 // non-interface field appearing in ForceSendFields will be sent to the 4181 // server regardless of whether the field is empty or not. This may be 4182 // used to include empty fields in Patch requests. 4183 ForceSendFields []string `json:"-"` 4184 4185 // NullFields is a list of field names (e.g. "BillingTier") to include 4186 // in API requests with the JSON null value. By default, fields with 4187 // empty values are omitted from API requests. However, any field with 4188 // an empty value appearing in NullFields will be sent to the server as 4189 // null. It is an error if a field in this list has a non-empty value. 4190 // This may be used to include null fields in Patch requests. 4191 NullFields []string `json:"-"` 4192} 4193 4194func (s *JobStatistics2) MarshalJSON() ([]byte, error) { 4195 type NoMethod JobStatistics2 4196 raw := NoMethod(*s) 4197 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4198} 4199 4200type JobStatistics2ReservationUsage struct { 4201 // Name: [Output-only] Reservation name or "unreserved" for on-demand 4202 // resources usage. 4203 Name string `json:"name,omitempty"` 4204 4205 // SlotMs: [Output-only] Slot-milliseconds the job spent in the given 4206 // reservation. 4207 SlotMs int64 `json:"slotMs,omitempty,string"` 4208 4209 // ForceSendFields is a list of field names (e.g. "Name") to 4210 // unconditionally include in API requests. By default, fields with 4211 // empty values are omitted from API requests. However, any non-pointer, 4212 // non-interface field appearing in ForceSendFields will be sent to the 4213 // server regardless of whether the field is empty or not. This may be 4214 // used to include empty fields in Patch requests. 4215 ForceSendFields []string `json:"-"` 4216 4217 // NullFields is a list of field names (e.g. "Name") to include in API 4218 // requests with the JSON null value. By default, fields with empty 4219 // values are omitted from API requests. However, any field with an 4220 // empty value appearing in NullFields will be sent to the server as 4221 // null. It is an error if a field in this list has a non-empty value. 4222 // This may be used to include null fields in Patch requests. 4223 NullFields []string `json:"-"` 4224} 4225 4226func (s *JobStatistics2ReservationUsage) MarshalJSON() ([]byte, error) { 4227 type NoMethod JobStatistics2ReservationUsage 4228 raw := NoMethod(*s) 4229 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4230} 4231 4232type JobStatistics3 struct { 4233 // BadRecords: [Output-only] The number of bad records encountered. Note 4234 // that if the job has failed because of more bad records encountered 4235 // than the maximum allowed in the load job configuration, then this 4236 // number can be less than the total number of bad records present in 4237 // the input data. 4238 BadRecords int64 `json:"badRecords,omitempty,string"` 4239 4240 // InputFileBytes: [Output-only] Number of bytes of source data in a 4241 // load job. 4242 InputFileBytes int64 `json:"inputFileBytes,omitempty,string"` 4243 4244 // InputFiles: [Output-only] Number of source files in a load job. 4245 InputFiles int64 `json:"inputFiles,omitempty,string"` 4246 4247 // OutputBytes: [Output-only] Size of the loaded data in bytes. Note 4248 // that while a load job is in the running state, this value may change. 4249 OutputBytes int64 `json:"outputBytes,omitempty,string"` 4250 4251 // OutputRows: [Output-only] Number of rows imported in a load job. Note 4252 // that while an import job is in the running state, this value may 4253 // change. 4254 OutputRows int64 `json:"outputRows,omitempty,string"` 4255 4256 // ForceSendFields is a list of field names (e.g. "BadRecords") to 4257 // unconditionally include in API requests. By default, fields with 4258 // empty values are omitted from API requests. However, any non-pointer, 4259 // non-interface field appearing in ForceSendFields will be sent to the 4260 // server regardless of whether the field is empty or not. This may be 4261 // used to include empty fields in Patch requests. 4262 ForceSendFields []string `json:"-"` 4263 4264 // NullFields is a list of field names (e.g. "BadRecords") to include in 4265 // API requests with the JSON null value. By default, fields with empty 4266 // values are omitted from API requests. However, any field with an 4267 // empty value appearing in NullFields will be sent to the server as 4268 // null. It is an error if a field in this list has a non-empty value. 4269 // This may be used to include null fields in Patch requests. 4270 NullFields []string `json:"-"` 4271} 4272 4273func (s *JobStatistics3) MarshalJSON() ([]byte, error) { 4274 type NoMethod JobStatistics3 4275 raw := NoMethod(*s) 4276 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4277} 4278 4279type JobStatistics4 struct { 4280 // DestinationUriFileCounts: [Output-only] Number of files per 4281 // destination URI or URI pattern specified in the extract 4282 // configuration. These values will be in the same order as the URIs 4283 // specified in the 'destinationUris' field. 4284 DestinationUriFileCounts googleapi.Int64s `json:"destinationUriFileCounts,omitempty"` 4285 4286 // InputBytes: [Output-only] Number of user bytes extracted into the 4287 // result. This is the byte count as computed by BigQuery for billing 4288 // purposes. 4289 InputBytes int64 `json:"inputBytes,omitempty,string"` 4290 4291 // ForceSendFields is a list of field names (e.g. 4292 // "DestinationUriFileCounts") to unconditionally include in API 4293 // requests. By default, fields with empty values are omitted from API 4294 // requests. However, any non-pointer, non-interface field appearing in 4295 // ForceSendFields will be sent to the server regardless of whether the 4296 // field is empty or not. This may be used to include empty fields in 4297 // Patch requests. 4298 ForceSendFields []string `json:"-"` 4299 4300 // NullFields is a list of field names (e.g. "DestinationUriFileCounts") 4301 // to include in API requests with the JSON null value. By default, 4302 // fields with empty values are omitted from API requests. However, any 4303 // field with an empty value appearing in NullFields will be sent to the 4304 // server as null. It is an error if a field in this list has a 4305 // non-empty value. This may be used to include null fields in Patch 4306 // requests. 4307 NullFields []string `json:"-"` 4308} 4309 4310func (s *JobStatistics4) MarshalJSON() ([]byte, error) { 4311 type NoMethod JobStatistics4 4312 raw := NoMethod(*s) 4313 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4314} 4315 4316type JobStatus struct { 4317 // ErrorResult: [Output-only] Final error result of the job. If present, 4318 // indicates that the job has completed and was unsuccessful. 4319 ErrorResult *ErrorProto `json:"errorResult,omitempty"` 4320 4321 // Errors: [Output-only] The first errors encountered during the running 4322 // of the job. The final message includes the number of errors that 4323 // caused the process to stop. Errors here do not necessarily mean that 4324 // the job has completed or was unsuccessful. 4325 Errors []*ErrorProto `json:"errors,omitempty"` 4326 4327 // State: [Output-only] Running state of the job. 4328 State string `json:"state,omitempty"` 4329 4330 // ForceSendFields is a list of field names (e.g. "ErrorResult") to 4331 // unconditionally include in API requests. By default, fields with 4332 // empty values are omitted from API requests. However, any non-pointer, 4333 // non-interface field appearing in ForceSendFields will be sent to the 4334 // server regardless of whether the field is empty or not. This may be 4335 // used to include empty fields in Patch requests. 4336 ForceSendFields []string `json:"-"` 4337 4338 // NullFields is a list of field names (e.g. "ErrorResult") to include 4339 // in API requests with the JSON null value. By default, fields with 4340 // empty values are omitted from API requests. However, any field with 4341 // an empty value appearing in NullFields will be sent to the server as 4342 // null. It is an error if a field in this list has a non-empty value. 4343 // This may be used to include null fields in Patch requests. 4344 NullFields []string `json:"-"` 4345} 4346 4347func (s *JobStatus) MarshalJSON() ([]byte, error) { 4348 type NoMethod JobStatus 4349 raw := NoMethod(*s) 4350 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4351} 4352 4353type JsonValue interface{} 4354 4355type ListModelsResponse struct { 4356 // Models: Models in the requested dataset. Only the following fields 4357 // are populated: 4358 // model_reference, model_type, creation_time, last_modified_time 4359 // and 4360 // labels. 4361 Models []*Model `json:"models,omitempty"` 4362 4363 // NextPageToken: A token to request the next page of results. 4364 NextPageToken string `json:"nextPageToken,omitempty"` 4365 4366 // ServerResponse contains the HTTP response code and headers from the 4367 // server. 4368 googleapi.ServerResponse `json:"-"` 4369 4370 // ForceSendFields is a list of field names (e.g. "Models") to 4371 // unconditionally include in API requests. By default, fields with 4372 // empty values are omitted from API requests. However, any non-pointer, 4373 // non-interface field appearing in ForceSendFields will be sent to the 4374 // server regardless of whether the field is empty or not. This may be 4375 // used to include empty fields in Patch requests. 4376 ForceSendFields []string `json:"-"` 4377 4378 // NullFields is a list of field names (e.g. "Models") to include in API 4379 // requests with the JSON null value. By default, fields with empty 4380 // values are omitted from API requests. However, any field with an 4381 // empty value appearing in NullFields will be sent to the server as 4382 // null. It is an error if a field in this list has a non-empty value. 4383 // This may be used to include null fields in Patch requests. 4384 NullFields []string `json:"-"` 4385} 4386 4387func (s *ListModelsResponse) MarshalJSON() ([]byte, error) { 4388 type NoMethod ListModelsResponse 4389 raw := NoMethod(*s) 4390 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4391} 4392 4393type ListRoutinesResponse struct { 4394 // NextPageToken: A token to request the next page of results. 4395 NextPageToken string `json:"nextPageToken,omitempty"` 4396 4397 // Routines: Routines in the requested dataset. Unless read_mask is set 4398 // in the request, 4399 // only the following fields are populated: 4400 // etag, project_id, dataset_id, routine_id, routine_type, 4401 // creation_time, 4402 // last_modified_time, and language. 4403 Routines []*Routine `json:"routines,omitempty"` 4404 4405 // ServerResponse contains the HTTP response code and headers from the 4406 // server. 4407 googleapi.ServerResponse `json:"-"` 4408 4409 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 4410 // unconditionally include in API requests. By default, fields with 4411 // empty values are omitted from API requests. However, any non-pointer, 4412 // non-interface field appearing in ForceSendFields will be sent to the 4413 // server regardless of whether the field is empty or not. This may be 4414 // used to include empty fields in Patch requests. 4415 ForceSendFields []string `json:"-"` 4416 4417 // NullFields is a list of field names (e.g. "NextPageToken") to include 4418 // in API requests with the JSON null value. By default, fields with 4419 // empty values are omitted from API requests. However, any field with 4420 // an empty value appearing in NullFields will be sent to the server as 4421 // null. It is an error if a field in this list has a non-empty value. 4422 // This may be used to include null fields in Patch requests. 4423 NullFields []string `json:"-"` 4424} 4425 4426func (s *ListRoutinesResponse) MarshalJSON() ([]byte, error) { 4427 type NoMethod ListRoutinesResponse 4428 raw := NoMethod(*s) 4429 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4430} 4431 4432// LocationMetadata: BigQuery-specific metadata about a location. This 4433// will be set on 4434// google.cloud.location.Location.metadata in Cloud Location 4435// API 4436// responses. 4437type LocationMetadata struct { 4438 // LegacyLocationId: The legacy BigQuery location ID, e.g. “EU” for 4439 // the “europe” location. 4440 // This is for any API consumers that need the legacy “US” and 4441 // “EU” locations. 4442 LegacyLocationId string `json:"legacyLocationId,omitempty"` 4443 4444 // ForceSendFields is a list of field names (e.g. "LegacyLocationId") to 4445 // unconditionally include in API requests. By default, fields with 4446 // empty values are omitted from API requests. However, any non-pointer, 4447 // non-interface field appearing in ForceSendFields will be sent to the 4448 // server regardless of whether the field is empty or not. This may be 4449 // used to include empty fields in Patch requests. 4450 ForceSendFields []string `json:"-"` 4451 4452 // NullFields is a list of field names (e.g. "LegacyLocationId") to 4453 // include in API requests with the JSON null value. By default, fields 4454 // with empty values are omitted from API requests. However, any field 4455 // with an empty value appearing in NullFields will be sent to the 4456 // server as null. It is an error if a field in this list has a 4457 // non-empty value. This may be used to include null fields in Patch 4458 // requests. 4459 NullFields []string `json:"-"` 4460} 4461 4462func (s *LocationMetadata) MarshalJSON() ([]byte, error) { 4463 type NoMethod LocationMetadata 4464 raw := NoMethod(*s) 4465 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4466} 4467 4468type MaterializedViewDefinition struct { 4469 // EnableRefresh: [Optional] [TrustedTester] Enable automatic refresh of 4470 // the materialized view when the base table is updated. The default 4471 // value is "true". 4472 EnableRefresh bool `json:"enableRefresh,omitempty"` 4473 4474 // LastRefreshTime: [Output-only] [TrustedTester] The time when this 4475 // materialized view was last modified, in milliseconds since the epoch. 4476 LastRefreshTime int64 `json:"lastRefreshTime,omitempty,string"` 4477 4478 // Query: [Required] A query whose result is persisted. 4479 Query string `json:"query,omitempty"` 4480 4481 // RefreshIntervalMs: [Optional] [TrustedTester] The maximum frequency 4482 // at which this materialized view will be refreshed. The default value 4483 // is "1800000" (30 minutes). 4484 RefreshIntervalMs int64 `json:"refreshIntervalMs,omitempty,string"` 4485 4486 // ForceSendFields is a list of field names (e.g. "EnableRefresh") to 4487 // unconditionally include in API requests. By default, fields with 4488 // empty values are omitted from API requests. However, any non-pointer, 4489 // non-interface field appearing in ForceSendFields will be sent to the 4490 // server regardless of whether the field is empty or not. This may be 4491 // used to include empty fields in Patch requests. 4492 ForceSendFields []string `json:"-"` 4493 4494 // NullFields is a list of field names (e.g. "EnableRefresh") to include 4495 // in API requests with the JSON null value. By default, fields with 4496 // empty values are omitted from API requests. However, any field with 4497 // an empty value appearing in NullFields will be sent to the server as 4498 // null. It is an error if a field in this list has a non-empty value. 4499 // This may be used to include null fields in Patch requests. 4500 NullFields []string `json:"-"` 4501} 4502 4503func (s *MaterializedViewDefinition) MarshalJSON() ([]byte, error) { 4504 type NoMethod MaterializedViewDefinition 4505 raw := NoMethod(*s) 4506 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4507} 4508 4509type Model struct { 4510 // CreationTime: Output only. The time when this model was created, in 4511 // millisecs since the epoch. 4512 CreationTime int64 `json:"creationTime,omitempty,string"` 4513 4514 // Description: Optional. A user-friendly description of this model. 4515 Description string `json:"description,omitempty"` 4516 4517 // EncryptionConfiguration: Custom encryption configuration (e.g., Cloud 4518 // KMS keys). This shows the 4519 // encryption configuration of the model data while stored in 4520 // BigQuery 4521 // storage. This field can be used with PatchModel to update encryption 4522 // key 4523 // for an already encrypted model. 4524 EncryptionConfiguration *EncryptionConfiguration `json:"encryptionConfiguration,omitempty"` 4525 4526 // Etag: Output only. A hash of this resource. 4527 Etag string `json:"etag,omitempty"` 4528 4529 // ExpirationTime: Optional. The time when this model expires, in 4530 // milliseconds since the epoch. 4531 // If not present, the model will persist indefinitely. Expired 4532 // models 4533 // will be deleted and their storage reclaimed. The 4534 // defaultTableExpirationMs 4535 // property of the encapsulating dataset can be used to set a 4536 // default 4537 // expirationTime on newly created models. 4538 ExpirationTime int64 `json:"expirationTime,omitempty,string"` 4539 4540 // FeatureColumns: Output only. Input feature columns that were used to 4541 // train this model. 4542 FeatureColumns []*StandardSqlField `json:"featureColumns,omitempty"` 4543 4544 // FriendlyName: Optional. A descriptive name for this model. 4545 FriendlyName string `json:"friendlyName,omitempty"` 4546 4547 // LabelColumns: Output only. Label columns that were used to train this 4548 // model. 4549 // The output of the model will have a "predicted_" prefix to these 4550 // columns. 4551 LabelColumns []*StandardSqlField `json:"labelColumns,omitempty"` 4552 4553 // Labels: The labels associated with this model. You can use these to 4554 // organize 4555 // and group your models. Label keys and values can be no longer 4556 // than 63 characters, can only contain lowercase letters, 4557 // numeric 4558 // characters, underscores and dashes. International characters are 4559 // allowed. 4560 // Label values are optional. Label keys must start with a letter and 4561 // each 4562 // label in the list must have a different key. 4563 Labels map[string]string `json:"labels,omitempty"` 4564 4565 // LastModifiedTime: Output only. The time when this model was last 4566 // modified, in millisecs since the epoch. 4567 LastModifiedTime int64 `json:"lastModifiedTime,omitempty,string"` 4568 4569 // Location: Output only. The geographic location where the model 4570 // resides. This value 4571 // is inherited from the dataset. 4572 Location string `json:"location,omitempty"` 4573 4574 // ModelReference: Required. Unique identifier for this model. 4575 ModelReference *ModelReference `json:"modelReference,omitempty"` 4576 4577 // ModelType: Output only. Type of the model resource. 4578 // 4579 // Possible values: 4580 // "MODEL_TYPE_UNSPECIFIED" 4581 // "LINEAR_REGRESSION" - Linear regression model. 4582 // "LOGISTIC_REGRESSION" - Logistic regression based classification 4583 // model. 4584 // "KMEANS" - K-means clustering model. 4585 // "MATRIX_FACTORIZATION" - Matrix factorization model. 4586 // "DNN_CLASSIFIER" - DNN classifier model. 4587 // "TENSORFLOW" - [Beta] An imported TensorFlow model. 4588 // "DNN_REGRESSOR" - DNN regressor model. 4589 // "BOOSTED_TREE_REGRESSOR" - Boosted tree regressor model. 4590 // "BOOSTED_TREE_CLASSIFIER" - Boosted tree classifier model. 4591 // "AUTOML_REGRESSOR" - AutoML Tables regression model. 4592 // "AUTOML_CLASSIFIER" - AutoML Tables classification model. 4593 ModelType string `json:"modelType,omitempty"` 4594 4595 // TrainingRuns: Output only. Information for all training runs in 4596 // increasing order of start_time. 4597 TrainingRuns []*TrainingRun `json:"trainingRuns,omitempty"` 4598 4599 // ServerResponse contains the HTTP response code and headers from the 4600 // server. 4601 googleapi.ServerResponse `json:"-"` 4602 4603 // ForceSendFields is a list of field names (e.g. "CreationTime") to 4604 // unconditionally include in API requests. By default, fields with 4605 // empty values are omitted from API requests. However, any non-pointer, 4606 // non-interface field appearing in ForceSendFields will be sent to the 4607 // server regardless of whether the field is empty or not. This may be 4608 // used to include empty fields in Patch requests. 4609 ForceSendFields []string `json:"-"` 4610 4611 // NullFields is a list of field names (e.g. "CreationTime") to include 4612 // in API requests with the JSON null value. By default, fields with 4613 // empty values are omitted from API requests. However, any field with 4614 // an empty value appearing in NullFields will be sent to the server as 4615 // null. It is an error if a field in this list has a non-empty value. 4616 // This may be used to include null fields in Patch requests. 4617 NullFields []string `json:"-"` 4618} 4619 4620func (s *Model) MarshalJSON() ([]byte, error) { 4621 type NoMethod Model 4622 raw := NoMethod(*s) 4623 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4624} 4625 4626type ModelDefinition struct { 4627 // ModelOptions: [Output-only, Beta] Model options used for the first 4628 // training run. These options are immutable for subsequent training 4629 // runs. Default values are used for any options not specified in the 4630 // input query. 4631 ModelOptions *ModelDefinitionModelOptions `json:"modelOptions,omitempty"` 4632 4633 // TrainingRuns: [Output-only, Beta] Information about ml training runs, 4634 // each training run comprises of multiple iterations and there may be 4635 // multiple training runs for the model if warm start is used or if a 4636 // user decides to continue a previously cancelled query. 4637 TrainingRuns []*BqmlTrainingRun `json:"trainingRuns,omitempty"` 4638 4639 // ForceSendFields is a list of field names (e.g. "ModelOptions") to 4640 // unconditionally include in API requests. By default, fields with 4641 // empty values are omitted from API requests. However, any non-pointer, 4642 // non-interface field appearing in ForceSendFields will be sent to the 4643 // server regardless of whether the field is empty or not. This may be 4644 // used to include empty fields in Patch requests. 4645 ForceSendFields []string `json:"-"` 4646 4647 // NullFields is a list of field names (e.g. "ModelOptions") to include 4648 // in API requests with the JSON null value. By default, fields with 4649 // empty values are omitted from API requests. However, any field with 4650 // an empty value appearing in NullFields will be sent to the server as 4651 // null. It is an error if a field in this list has a non-empty value. 4652 // This may be used to include null fields in Patch requests. 4653 NullFields []string `json:"-"` 4654} 4655 4656func (s *ModelDefinition) MarshalJSON() ([]byte, error) { 4657 type NoMethod ModelDefinition 4658 raw := NoMethod(*s) 4659 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4660} 4661 4662// ModelDefinitionModelOptions: [Output-only, Beta] Model options used 4663// for the first training run. These options are immutable for 4664// subsequent training runs. Default values are used for any options not 4665// specified in the input query. 4666type ModelDefinitionModelOptions struct { 4667 Labels []string `json:"labels,omitempty"` 4668 4669 LossType string `json:"lossType,omitempty"` 4670 4671 ModelType string `json:"modelType,omitempty"` 4672 4673 // ForceSendFields is a list of field names (e.g. "Labels") to 4674 // unconditionally include in API requests. By default, fields with 4675 // empty values are omitted from API requests. However, any non-pointer, 4676 // non-interface field appearing in ForceSendFields will be sent to the 4677 // server regardless of whether the field is empty or not. This may be 4678 // used to include empty fields in Patch requests. 4679 ForceSendFields []string `json:"-"` 4680 4681 // NullFields is a list of field names (e.g. "Labels") to include in API 4682 // requests with the JSON null value. By default, fields with empty 4683 // values are omitted from API requests. However, any field with an 4684 // empty value appearing in NullFields will be sent to the server as 4685 // null. It is an error if a field in this list has a non-empty value. 4686 // This may be used to include null fields in Patch requests. 4687 NullFields []string `json:"-"` 4688} 4689 4690func (s *ModelDefinitionModelOptions) MarshalJSON() ([]byte, error) { 4691 type NoMethod ModelDefinitionModelOptions 4692 raw := NoMethod(*s) 4693 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4694} 4695 4696type ModelReference struct { 4697 // DatasetId: [Required] The ID of the dataset containing this model. 4698 DatasetId string `json:"datasetId,omitempty"` 4699 4700 // ModelId: [Required] The ID of the model. The ID must contain only 4701 // letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum 4702 // length is 1,024 characters. 4703 ModelId string `json:"modelId,omitempty"` 4704 4705 // ProjectId: [Required] The ID of the project containing this model. 4706 ProjectId string `json:"projectId,omitempty"` 4707 4708 // ForceSendFields is a list of field names (e.g. "DatasetId") to 4709 // unconditionally include in API requests. By default, fields with 4710 // empty values are omitted from API requests. However, any non-pointer, 4711 // non-interface field appearing in ForceSendFields will be sent to the 4712 // server regardless of whether the field is empty or not. This may be 4713 // used to include empty fields in Patch requests. 4714 ForceSendFields []string `json:"-"` 4715 4716 // NullFields is a list of field names (e.g. "DatasetId") to include in 4717 // API requests with the JSON null value. By default, fields with empty 4718 // values are omitted from API requests. However, any field with an 4719 // empty value appearing in NullFields will be sent to the server as 4720 // null. It is an error if a field in this list has a non-empty value. 4721 // This may be used to include null fields in Patch requests. 4722 NullFields []string `json:"-"` 4723} 4724 4725func (s *ModelReference) MarshalJSON() ([]byte, error) { 4726 type NoMethod ModelReference 4727 raw := NoMethod(*s) 4728 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4729} 4730 4731// MultiClassClassificationMetrics: Evaluation metrics for multi-class 4732// classification/classifier models. 4733type MultiClassClassificationMetrics struct { 4734 // AggregateClassificationMetrics: Aggregate classification metrics. 4735 AggregateClassificationMetrics *AggregateClassificationMetrics `json:"aggregateClassificationMetrics,omitempty"` 4736 4737 // ConfusionMatrixList: Confusion matrix at different thresholds. 4738 ConfusionMatrixList []*ConfusionMatrix `json:"confusionMatrixList,omitempty"` 4739 4740 // ForceSendFields is a list of field names (e.g. 4741 // "AggregateClassificationMetrics") to unconditionally include in API 4742 // requests. By default, fields with empty values are omitted from API 4743 // requests. However, any non-pointer, non-interface field appearing in 4744 // ForceSendFields will be sent to the server regardless of whether the 4745 // field is empty or not. This may be used to include empty fields in 4746 // Patch requests. 4747 ForceSendFields []string `json:"-"` 4748 4749 // NullFields is a list of field names (e.g. 4750 // "AggregateClassificationMetrics") to include in API requests with the 4751 // JSON null value. By default, fields with empty values are omitted 4752 // from API requests. However, any field with an empty value appearing 4753 // in NullFields will be sent to the server as null. It is an error if a 4754 // field in this list has a non-empty value. This may be used to include 4755 // null fields in Patch requests. 4756 NullFields []string `json:"-"` 4757} 4758 4759func (s *MultiClassClassificationMetrics) MarshalJSON() ([]byte, error) { 4760 type NoMethod MultiClassClassificationMetrics 4761 raw := NoMethod(*s) 4762 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4763} 4764 4765// Policy: An Identity and Access Management (IAM) policy, which 4766// specifies access 4767// controls for Google Cloud resources. 4768// 4769// 4770// A `Policy` is a collection of `bindings`. A `binding` binds one or 4771// more 4772// `members` to a single `role`. Members can be user accounts, service 4773// accounts, 4774// Google groups, and domains (such as G Suite). A `role` is a named 4775// list of 4776// permissions; each `role` can be an IAM predefined role or a 4777// user-created 4778// custom role. 4779// 4780// For some types of Google Cloud resources, a `binding` can also 4781// specify a 4782// `condition`, which is a logical expression that allows access to a 4783// resource 4784// only if the expression evaluates to `true`. A condition can add 4785// constraints 4786// based on attributes of the request, the resource, or both. To learn 4787// which 4788// resources support conditions in their IAM policies, see the 4789// [IAM 4790// documentation](https://cloud.google.com/iam/help/conditions/resource-p 4791// olicies). 4792// 4793// **JSON example:** 4794// 4795// { 4796// "bindings": [ 4797// { 4798// "role": "roles/resourcemanager.organizationAdmin", 4799// "members": [ 4800// "user:mike@example.com", 4801// "group:admins@example.com", 4802// "domain:google.com", 4803// 4804// "serviceAccount:my-project-id@appspot.gserviceaccount.com" 4805// ] 4806// }, 4807// { 4808// "role": "roles/resourcemanager.organizationViewer", 4809// "members": [ 4810// "user:eve@example.com" 4811// ], 4812// "condition": { 4813// "title": "expirable access", 4814// "description": "Does not grant access after Sep 2020", 4815// "expression": "request.time < 4816// timestamp('2020-10-01T00:00:00.000Z')", 4817// } 4818// } 4819// ], 4820// "etag": "BwWWja0YfJA=", 4821// "version": 3 4822// } 4823// 4824// **YAML example:** 4825// 4826// bindings: 4827// - members: 4828// - user:mike@example.com 4829// - group:admins@example.com 4830// - domain:google.com 4831// - serviceAccount:my-project-id@appspot.gserviceaccount.com 4832// role: roles/resourcemanager.organizationAdmin 4833// - members: 4834// - user:eve@example.com 4835// role: roles/resourcemanager.organizationViewer 4836// condition: 4837// title: expirable access 4838// description: Does not grant access after Sep 2020 4839// expression: request.time < 4840// timestamp('2020-10-01T00:00:00.000Z') 4841// - etag: BwWWja0YfJA= 4842// - version: 3 4843// 4844// For a description of IAM and its features, see the 4845// [IAM documentation](https://cloud.google.com/iam/docs/). 4846type Policy struct { 4847 // AuditConfigs: Specifies cloud audit logging configuration for this 4848 // policy. 4849 AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"` 4850 4851 // Bindings: Associates a list of `members` to a `role`. Optionally, may 4852 // specify a 4853 // `condition` that determines how and when the `bindings` are applied. 4854 // Each 4855 // of the `bindings` must contain at least one member. 4856 Bindings []*Binding `json:"bindings,omitempty"` 4857 4858 // Etag: `etag` is used for optimistic concurrency control as a way to 4859 // help 4860 // prevent simultaneous updates of a policy from overwriting each 4861 // other. 4862 // It is strongly suggested that systems make use of the `etag` in 4863 // the 4864 // read-modify-write cycle to perform policy updates in order to avoid 4865 // race 4866 // conditions: An `etag` is returned in the response to `getIamPolicy`, 4867 // and 4868 // systems are expected to put that etag in the request to 4869 // `setIamPolicy` to 4870 // ensure that their change will be applied to the same version of the 4871 // policy. 4872 // 4873 // **Important:** If you use IAM Conditions, you must include the `etag` 4874 // field 4875 // whenever you call `setIamPolicy`. If you omit this field, then IAM 4876 // allows 4877 // you to overwrite a version `3` policy with a version `1` policy, and 4878 // all of 4879 // the conditions in the version `3` policy are lost. 4880 Etag string `json:"etag,omitempty"` 4881 4882 // Version: Specifies the format of the policy. 4883 // 4884 // Valid values are `0`, `1`, and `3`. Requests that specify an invalid 4885 // value 4886 // are rejected. 4887 // 4888 // Any operation that affects conditional role bindings must specify 4889 // version 4890 // `3`. This requirement applies to the following operations: 4891 // 4892 // * Getting a policy that includes a conditional role binding 4893 // * Adding a conditional role binding to a policy 4894 // * Changing a conditional role binding in a policy 4895 // * Removing any role binding, with or without a condition, from a 4896 // policy 4897 // that includes conditions 4898 // 4899 // **Important:** If you use IAM Conditions, you must include the `etag` 4900 // field 4901 // whenever you call `setIamPolicy`. If you omit this field, then IAM 4902 // allows 4903 // you to overwrite a version `3` policy with a version `1` policy, and 4904 // all of 4905 // the conditions in the version `3` policy are lost. 4906 // 4907 // If a policy does not include any conditions, operations on that 4908 // policy may 4909 // specify any valid version or leave the field unset. 4910 // 4911 // To learn which resources support conditions in their IAM policies, 4912 // see the 4913 // [IAM 4914 // documentation](https://cloud.google.com/iam/help/conditions/resource-p 4915 // olicies). 4916 Version int64 `json:"version,omitempty"` 4917 4918 // ServerResponse contains the HTTP response code and headers from the 4919 // server. 4920 googleapi.ServerResponse `json:"-"` 4921 4922 // ForceSendFields is a list of field names (e.g. "AuditConfigs") to 4923 // unconditionally include in API requests. By default, fields with 4924 // empty values are omitted from API requests. However, any non-pointer, 4925 // non-interface field appearing in ForceSendFields will be sent to the 4926 // server regardless of whether the field is empty or not. This may be 4927 // used to include empty fields in Patch requests. 4928 ForceSendFields []string `json:"-"` 4929 4930 // NullFields is a list of field names (e.g. "AuditConfigs") to include 4931 // in API requests with the JSON null value. By default, fields with 4932 // empty values are omitted from API requests. However, any field with 4933 // an empty value appearing in NullFields will be sent to the server as 4934 // null. It is an error if a field in this list has a non-empty value. 4935 // This may be used to include null fields in Patch requests. 4936 NullFields []string `json:"-"` 4937} 4938 4939func (s *Policy) MarshalJSON() ([]byte, error) { 4940 type NoMethod Policy 4941 raw := NoMethod(*s) 4942 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4943} 4944 4945type ProjectList struct { 4946 // Etag: A hash of the page of results 4947 Etag string `json:"etag,omitempty"` 4948 4949 // Kind: The type of list. 4950 Kind string `json:"kind,omitempty"` 4951 4952 // NextPageToken: A token to request the next page of results. 4953 NextPageToken string `json:"nextPageToken,omitempty"` 4954 4955 // Projects: Projects to which you have at least READ access. 4956 Projects []*ProjectListProjects `json:"projects,omitempty"` 4957 4958 // TotalItems: The total number of projects in the list. 4959 TotalItems int64 `json:"totalItems,omitempty"` 4960 4961 // ServerResponse contains the HTTP response code and headers from the 4962 // server. 4963 googleapi.ServerResponse `json:"-"` 4964 4965 // ForceSendFields is a list of field names (e.g. "Etag") to 4966 // unconditionally include in API requests. By default, fields with 4967 // empty values are omitted from API requests. However, any non-pointer, 4968 // non-interface field appearing in ForceSendFields will be sent to the 4969 // server regardless of whether the field is empty or not. This may be 4970 // used to include empty fields in Patch requests. 4971 ForceSendFields []string `json:"-"` 4972 4973 // NullFields is a list of field names (e.g. "Etag") to include in API 4974 // requests with the JSON null value. By default, fields with empty 4975 // values are omitted from API requests. However, any field with an 4976 // empty value appearing in NullFields will be sent to the server as 4977 // null. It is an error if a field in this list has a non-empty value. 4978 // This may be used to include null fields in Patch requests. 4979 NullFields []string `json:"-"` 4980} 4981 4982func (s *ProjectList) MarshalJSON() ([]byte, error) { 4983 type NoMethod ProjectList 4984 raw := NoMethod(*s) 4985 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4986} 4987 4988type ProjectListProjects struct { 4989 // FriendlyName: A descriptive name for this project. 4990 FriendlyName string `json:"friendlyName,omitempty"` 4991 4992 // Id: An opaque ID of this project. 4993 Id string `json:"id,omitempty"` 4994 4995 // Kind: The resource type. 4996 Kind string `json:"kind,omitempty"` 4997 4998 // NumericId: The numeric ID of this project. 4999 NumericId uint64 `json:"numericId,omitempty,string"` 5000 5001 // ProjectReference: A unique reference to this project. 5002 ProjectReference *ProjectReference `json:"projectReference,omitempty"` 5003 5004 // ForceSendFields is a list of field names (e.g. "FriendlyName") to 5005 // unconditionally include in API requests. By default, fields with 5006 // empty values are omitted from API requests. However, any non-pointer, 5007 // non-interface field appearing in ForceSendFields will be sent to the 5008 // server regardless of whether the field is empty or not. This may be 5009 // used to include empty fields in Patch requests. 5010 ForceSendFields []string `json:"-"` 5011 5012 // NullFields is a list of field names (e.g. "FriendlyName") to include 5013 // in API requests with the JSON null value. By default, fields with 5014 // empty values are omitted from API requests. However, any field with 5015 // an empty value appearing in NullFields will be sent to the server as 5016 // null. It is an error if a field in this list has a non-empty value. 5017 // This may be used to include null fields in Patch requests. 5018 NullFields []string `json:"-"` 5019} 5020 5021func (s *ProjectListProjects) MarshalJSON() ([]byte, error) { 5022 type NoMethod ProjectListProjects 5023 raw := NoMethod(*s) 5024 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5025} 5026 5027type ProjectReference struct { 5028 // ProjectId: [Required] ID of the project. Can be either the numeric ID 5029 // or the assigned ID of the project. 5030 ProjectId string `json:"projectId,omitempty"` 5031 5032 // ForceSendFields is a list of field names (e.g. "ProjectId") to 5033 // unconditionally include in API requests. By default, fields with 5034 // empty values are omitted from API requests. However, any non-pointer, 5035 // non-interface field appearing in ForceSendFields will be sent to the 5036 // server regardless of whether the field is empty or not. This may be 5037 // used to include empty fields in Patch requests. 5038 ForceSendFields []string `json:"-"` 5039 5040 // NullFields is a list of field names (e.g. "ProjectId") to include in 5041 // API requests with the JSON null value. By default, fields with empty 5042 // values are omitted from API requests. However, any field with an 5043 // empty value appearing in NullFields will be sent to the server as 5044 // null. It is an error if a field in this list has a non-empty value. 5045 // This may be used to include null fields in Patch requests. 5046 NullFields []string `json:"-"` 5047} 5048 5049func (s *ProjectReference) MarshalJSON() ([]byte, error) { 5050 type NoMethod ProjectReference 5051 raw := NoMethod(*s) 5052 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5053} 5054 5055type QueryParameter struct { 5056 // Name: [Optional] If unset, this is a positional parameter. Otherwise, 5057 // should be unique within a query. 5058 Name string `json:"name,omitempty"` 5059 5060 // ParameterType: [Required] The type of this parameter. 5061 ParameterType *QueryParameterType `json:"parameterType,omitempty"` 5062 5063 // ParameterValue: [Required] The value of this parameter. 5064 ParameterValue *QueryParameterValue `json:"parameterValue,omitempty"` 5065 5066 // ForceSendFields is a list of field names (e.g. "Name") to 5067 // unconditionally include in API requests. By default, fields with 5068 // empty values are omitted from API requests. However, any non-pointer, 5069 // non-interface field appearing in ForceSendFields will be sent to the 5070 // server regardless of whether the field is empty or not. This may be 5071 // used to include empty fields in Patch requests. 5072 ForceSendFields []string `json:"-"` 5073 5074 // NullFields is a list of field names (e.g. "Name") to include in API 5075 // requests with the JSON null value. By default, fields with empty 5076 // values are omitted from API requests. However, any field with an 5077 // empty value appearing in NullFields will be sent to the server as 5078 // null. It is an error if a field in this list has a non-empty value. 5079 // This may be used to include null fields in Patch requests. 5080 NullFields []string `json:"-"` 5081} 5082 5083func (s *QueryParameter) MarshalJSON() ([]byte, error) { 5084 type NoMethod QueryParameter 5085 raw := NoMethod(*s) 5086 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5087} 5088 5089type QueryParameterType struct { 5090 // ArrayType: [Optional] The type of the array's elements, if this is an 5091 // array. 5092 ArrayType *QueryParameterType `json:"arrayType,omitempty"` 5093 5094 // StructTypes: [Optional] The types of the fields of this struct, in 5095 // order, if this is a struct. 5096 StructTypes []*QueryParameterTypeStructTypes `json:"structTypes,omitempty"` 5097 5098 // Type: [Required] The top level type of this field. 5099 Type string `json:"type,omitempty"` 5100 5101 // ForceSendFields is a list of field names (e.g. "ArrayType") to 5102 // unconditionally include in API requests. By default, fields with 5103 // empty values are omitted from API requests. However, any non-pointer, 5104 // non-interface field appearing in ForceSendFields will be sent to the 5105 // server regardless of whether the field is empty or not. This may be 5106 // used to include empty fields in Patch requests. 5107 ForceSendFields []string `json:"-"` 5108 5109 // NullFields is a list of field names (e.g. "ArrayType") to include in 5110 // API requests with the JSON null value. By default, fields with empty 5111 // values are omitted from API requests. However, any field with an 5112 // empty value appearing in NullFields will be sent to the server as 5113 // null. It is an error if a field in this list has a non-empty value. 5114 // This may be used to include null fields in Patch requests. 5115 NullFields []string `json:"-"` 5116} 5117 5118func (s *QueryParameterType) MarshalJSON() ([]byte, error) { 5119 type NoMethod QueryParameterType 5120 raw := NoMethod(*s) 5121 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5122} 5123 5124type QueryParameterTypeStructTypes struct { 5125 // Description: [Optional] Human-oriented description of the field. 5126 Description string `json:"description,omitempty"` 5127 5128 // Name: [Optional] The name of this field. 5129 Name string `json:"name,omitempty"` 5130 5131 // Type: [Required] The type of this field. 5132 Type *QueryParameterType `json:"type,omitempty"` 5133 5134 // ForceSendFields is a list of field names (e.g. "Description") to 5135 // unconditionally include in API requests. By default, fields with 5136 // empty values are omitted from API requests. However, any non-pointer, 5137 // non-interface field appearing in ForceSendFields will be sent to the 5138 // server regardless of whether the field is empty or not. This may be 5139 // used to include empty fields in Patch requests. 5140 ForceSendFields []string `json:"-"` 5141 5142 // NullFields is a list of field names (e.g. "Description") to include 5143 // in API requests with the JSON null value. By default, fields with 5144 // empty values are omitted from API requests. However, any field with 5145 // an empty value appearing in NullFields will be sent to the server as 5146 // null. It is an error if a field in this list has a non-empty value. 5147 // This may be used to include null fields in Patch requests. 5148 NullFields []string `json:"-"` 5149} 5150 5151func (s *QueryParameterTypeStructTypes) MarshalJSON() ([]byte, error) { 5152 type NoMethod QueryParameterTypeStructTypes 5153 raw := NoMethod(*s) 5154 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5155} 5156 5157type QueryParameterValue struct { 5158 // ArrayValues: [Optional] The array values, if this is an array type. 5159 ArrayValues []*QueryParameterValue `json:"arrayValues,omitempty"` 5160 5161 // StructValues: [Optional] The struct field values, in order of the 5162 // struct type's declaration. 5163 StructValues map[string]QueryParameterValue `json:"structValues,omitempty"` 5164 5165 // Value: [Optional] The value of this value, if a simple scalar type. 5166 Value string `json:"value,omitempty"` 5167 5168 // ForceSendFields is a list of field names (e.g. "ArrayValues") to 5169 // unconditionally include in API requests. By default, fields with 5170 // empty values are omitted from API requests. However, any non-pointer, 5171 // non-interface field appearing in ForceSendFields will be sent to the 5172 // server regardless of whether the field is empty or not. This may be 5173 // used to include empty fields in Patch requests. 5174 ForceSendFields []string `json:"-"` 5175 5176 // NullFields is a list of field names (e.g. "ArrayValues") to include 5177 // in API requests with the JSON null value. By default, fields with 5178 // empty values are omitted from API requests. However, any field with 5179 // an empty value appearing in NullFields will be sent to the server as 5180 // null. It is an error if a field in this list has a non-empty value. 5181 // This may be used to include null fields in Patch requests. 5182 NullFields []string `json:"-"` 5183} 5184 5185func (s *QueryParameterValue) MarshalJSON() ([]byte, error) { 5186 type NoMethod QueryParameterValue 5187 raw := NoMethod(*s) 5188 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5189} 5190 5191type QueryRequest struct { 5192 // ConnectionProperties: Connection properties. 5193 ConnectionProperties []*ConnectionProperty `json:"connectionProperties,omitempty"` 5194 5195 // DefaultDataset: [Optional] Specifies the default datasetId and 5196 // projectId to assume for any unqualified table names in the query. If 5197 // not set, all table names in the query string must be qualified in the 5198 // format 'datasetId.tableId'. 5199 DefaultDataset *DatasetReference `json:"defaultDataset,omitempty"` 5200 5201 // DryRun: [Optional] If set to true, BigQuery doesn't run the job. 5202 // Instead, if the query is valid, BigQuery returns statistics about the 5203 // job such as how many bytes would be processed. If the query is 5204 // invalid, an error returns. The default value is false. 5205 DryRun bool `json:"dryRun,omitempty"` 5206 5207 // Kind: The resource type of the request. 5208 Kind string `json:"kind,omitempty"` 5209 5210 // Labels: The labels associated with this job. You can use these to 5211 // organize and group your jobs. Label keys and values can be no longer 5212 // than 63 characters, can only contain lowercase letters, numeric 5213 // characters, underscores and dashes. International characters are 5214 // allowed. Label values are optional. Label keys must start with a 5215 // letter and each label in the list must have a different key. 5216 Labels map[string]string `json:"labels,omitempty"` 5217 5218 // Location: The geographic location where the job should run. See 5219 // details at 5220 // https://cloud.google.com/bigquery/docs/locations#specifying_your_location. 5221 Location string `json:"location,omitempty"` 5222 5223 // MaxResults: [Optional] The maximum number of rows of data to return 5224 // per page of results. Setting this flag to a small value such as 1000 5225 // and then paging through results might improve reliability when the 5226 // query result set is large. In addition to this limit, responses are 5227 // also limited to 10 MB. By default, there is no maximum row count, and 5228 // only the byte limit applies. 5229 MaxResults int64 `json:"maxResults,omitempty"` 5230 5231 // MaximumBytesBilled: [Optional] Limits the bytes billed for this job. 5232 // Queries that will have bytes billed beyond this limit will fail 5233 // (without incurring a charge). If unspecified, this will be set to 5234 // your project default. 5235 MaximumBytesBilled int64 `json:"maximumBytesBilled,omitempty,string"` 5236 5237 // ParameterMode: Standard SQL only. Set to POSITIONAL to use positional 5238 // (?) query parameters or to NAMED to use named (@myparam) query 5239 // parameters in this query. 5240 ParameterMode string `json:"parameterMode,omitempty"` 5241 5242 // PreserveNulls: [Deprecated] This property is deprecated. 5243 PreserveNulls bool `json:"preserveNulls,omitempty"` 5244 5245 // Query: [Required] A query string, following the BigQuery query 5246 // syntax, of the query to execute. Example: "SELECT count(f1) FROM 5247 // [myProjectId:myDatasetId.myTableId]". 5248 Query string `json:"query,omitempty"` 5249 5250 // QueryParameters: Query parameters for Standard SQL queries. 5251 QueryParameters []*QueryParameter `json:"queryParameters,omitempty"` 5252 5253 // RequestId: A unique user provided identifier to ensure idempotent 5254 // behavior for queries. Note that this is different from the job_id. It 5255 // has the following properties: 1. It is case-sensitive, limited to up 5256 // to 36 ASCII characters. A UUID is recommended. 2. Read only queries 5257 // can ignore this token since they are nullipotent by definition. 3. 5258 // For the purposes of idempotency ensured by the request_id, a request 5259 // is considered duplicate of another only if they have the same 5260 // request_id and are actually duplicates. When determining whether a 5261 // request is a duplicate of the previous request, all parameters in the 5262 // request that may affect the behavior are considered. For example, 5263 // query, connection_properties, query_parameters, use_legacy_sql are 5264 // parameters that affect the result and are considered when determining 5265 // whether a request is a duplicate, but properties like timeout_ms 5266 // don't affect the result and are thus not considered. Dry run query 5267 // requests are never considered duplicate of another request. 4. When a 5268 // duplicate mutating query request is detected, it returns: a. the 5269 // results of the mutation if it completes successfully within the 5270 // timeout. b. the running operation if it is still in progress at the 5271 // end of the timeout. 5. Its lifetime is limited to 15 minutes. In 5272 // other words, if two requests are sent with the same request_id, but 5273 // more than 15 minutes apart, idempotency is not guaranteed. 5274 RequestId string `json:"requestId,omitempty"` 5275 5276 // TimeoutMs: [Optional] How long to wait for the query to complete, in 5277 // milliseconds, before the request times out and returns. Note that 5278 // this is only a timeout for the request, not the query. If the query 5279 // takes longer to run than the timeout value, the call returns without 5280 // any results and with the 'jobComplete' flag set to false. You can 5281 // call GetQueryResults() to wait for the query to complete and read the 5282 // results. The default value is 10000 milliseconds (10 seconds). 5283 TimeoutMs int64 `json:"timeoutMs,omitempty"` 5284 5285 // UseLegacySql: Specifies whether to use BigQuery's legacy SQL dialect 5286 // for this query. The default value is true. If set to false, the query 5287 // will use BigQuery's standard SQL: 5288 // https://cloud.google.com/bigquery/sql-reference/ When useLegacySql is 5289 // set to false, the value of flattenResults is ignored; query will be 5290 // run as if flattenResults is false. 5291 // 5292 // Default: true 5293 UseLegacySql *bool `json:"useLegacySql,omitempty"` 5294 5295 // UseQueryCache: [Optional] Whether to look for the result in the query 5296 // cache. The query cache is a best-effort cache that will be flushed 5297 // whenever tables in the query are modified. The default value is true. 5298 // 5299 // Default: true 5300 UseQueryCache *bool `json:"useQueryCache,omitempty"` 5301 5302 // ForceSendFields is a list of field names (e.g. 5303 // "ConnectionProperties") to unconditionally include in API requests. 5304 // By default, fields with empty values are omitted from API requests. 5305 // However, any non-pointer, non-interface field appearing in 5306 // ForceSendFields will be sent to the server regardless of whether the 5307 // field is empty or not. This may be used to include empty fields in 5308 // Patch requests. 5309 ForceSendFields []string `json:"-"` 5310 5311 // NullFields is a list of field names (e.g. "ConnectionProperties") to 5312 // include in API requests with the JSON null value. By default, fields 5313 // with empty values are omitted from API requests. However, any field 5314 // with an empty value appearing in NullFields will be sent to the 5315 // server as null. It is an error if a field in this list has a 5316 // non-empty value. This may be used to include null fields in Patch 5317 // requests. 5318 NullFields []string `json:"-"` 5319} 5320 5321func (s *QueryRequest) MarshalJSON() ([]byte, error) { 5322 type NoMethod QueryRequest 5323 raw := NoMethod(*s) 5324 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5325} 5326 5327type QueryResponse struct { 5328 // CacheHit: Whether the query result was fetched from the query cache. 5329 CacheHit bool `json:"cacheHit,omitempty"` 5330 5331 // Errors: [Output-only] The first errors or warnings encountered during 5332 // the running of the job. The final message includes the number of 5333 // errors that caused the process to stop. Errors here do not 5334 // necessarily mean that the job has completed or was unsuccessful. 5335 Errors []*ErrorProto `json:"errors,omitempty"` 5336 5337 // JobComplete: Whether the query has completed or not. If rows or 5338 // totalRows are present, this will always be true. If this is false, 5339 // totalRows will not be available. 5340 JobComplete bool `json:"jobComplete,omitempty"` 5341 5342 // JobReference: Reference to the Job that was created to run the query. 5343 // This field will be present even if the original request timed out, in 5344 // which case GetQueryResults can be used to read the results once the 5345 // query has completed. Since this API only returns the first page of 5346 // results, subsequent pages can be fetched via the same mechanism 5347 // (GetQueryResults). 5348 JobReference *JobReference `json:"jobReference,omitempty"` 5349 5350 // Kind: The resource type. 5351 Kind string `json:"kind,omitempty"` 5352 5353 // NumDmlAffectedRows: [Output-only] The number of rows affected by a 5354 // DML statement. Present only for DML statements INSERT, UPDATE or 5355 // DELETE. 5356 NumDmlAffectedRows int64 `json:"numDmlAffectedRows,omitempty,string"` 5357 5358 // PageToken: A token used for paging results. 5359 PageToken string `json:"pageToken,omitempty"` 5360 5361 // Rows: An object with as many results as can be contained within the 5362 // maximum permitted reply size. To get any additional rows, you can 5363 // call GetQueryResults and specify the jobReference returned above. 5364 Rows []*TableRow `json:"rows,omitempty"` 5365 5366 // Schema: The schema of the results. Present only when the query 5367 // completes successfully. 5368 Schema *TableSchema `json:"schema,omitempty"` 5369 5370 // TotalBytesProcessed: The total number of bytes processed for this 5371 // query. If this query was a dry run, this is the number of bytes that 5372 // would be processed if the query were run. 5373 TotalBytesProcessed int64 `json:"totalBytesProcessed,omitempty,string"` 5374 5375 // TotalRows: The total number of rows in the complete query result set, 5376 // which can be more than the number of rows in this single page of 5377 // results. 5378 TotalRows uint64 `json:"totalRows,omitempty,string"` 5379 5380 // ServerResponse contains the HTTP response code and headers from the 5381 // server. 5382 googleapi.ServerResponse `json:"-"` 5383 5384 // ForceSendFields is a list of field names (e.g. "CacheHit") to 5385 // unconditionally include in API requests. By default, fields with 5386 // empty values are omitted from API requests. However, any non-pointer, 5387 // non-interface field appearing in ForceSendFields will be sent to the 5388 // server regardless of whether the field is empty or not. This may be 5389 // used to include empty fields in Patch requests. 5390 ForceSendFields []string `json:"-"` 5391 5392 // NullFields is a list of field names (e.g. "CacheHit") to include in 5393 // API requests with the JSON null value. By default, fields with empty 5394 // values are omitted from API requests. However, any field with an 5395 // empty value appearing in NullFields will be sent to the server as 5396 // null. It is an error if a field in this list has a non-empty value. 5397 // This may be used to include null fields in Patch requests. 5398 NullFields []string `json:"-"` 5399} 5400 5401func (s *QueryResponse) MarshalJSON() ([]byte, error) { 5402 type NoMethod QueryResponse 5403 raw := NoMethod(*s) 5404 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5405} 5406 5407type QueryTimelineSample struct { 5408 // ActiveUnits: Total number of units currently being processed by 5409 // workers. This does not correspond directly to slot usage. This is the 5410 // largest value observed since the last sample. 5411 ActiveUnits int64 `json:"activeUnits,omitempty,string"` 5412 5413 // CompletedUnits: Total parallel units of work completed by this query. 5414 CompletedUnits int64 `json:"completedUnits,omitempty,string"` 5415 5416 // ElapsedMs: Milliseconds elapsed since the start of query execution. 5417 ElapsedMs int64 `json:"elapsedMs,omitempty,string"` 5418 5419 // PendingUnits: Total parallel units of work remaining for the active 5420 // stages. 5421 PendingUnits int64 `json:"pendingUnits,omitempty,string"` 5422 5423 // TotalSlotMs: Cumulative slot-ms consumed by the query. 5424 TotalSlotMs int64 `json:"totalSlotMs,omitempty,string"` 5425 5426 // ForceSendFields is a list of field names (e.g. "ActiveUnits") to 5427 // unconditionally include in API requests. By default, fields with 5428 // empty values are omitted from API requests. However, any non-pointer, 5429 // non-interface field appearing in ForceSendFields will be sent to the 5430 // server regardless of whether the field is empty or not. This may be 5431 // used to include empty fields in Patch requests. 5432 ForceSendFields []string `json:"-"` 5433 5434 // NullFields is a list of field names (e.g. "ActiveUnits") to include 5435 // in API requests with the JSON null value. By default, fields with 5436 // empty values are omitted from API requests. However, any field with 5437 // an empty value appearing in NullFields will be sent to the server as 5438 // null. It is an error if a field in this list has a non-empty value. 5439 // This may be used to include null fields in Patch requests. 5440 NullFields []string `json:"-"` 5441} 5442 5443func (s *QueryTimelineSample) MarshalJSON() ([]byte, error) { 5444 type NoMethod QueryTimelineSample 5445 raw := NoMethod(*s) 5446 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5447} 5448 5449type RangePartitioning struct { 5450 // Field: [TrustedTester] [Required] The table is partitioned by this 5451 // field. The field must be a top-level NULLABLE/REQUIRED field. The 5452 // only supported type is INTEGER/INT64. 5453 Field string `json:"field,omitempty"` 5454 5455 // Range: [TrustedTester] [Required] Defines the ranges for range 5456 // partitioning. 5457 Range *RangePartitioningRange `json:"range,omitempty"` 5458 5459 // ForceSendFields is a list of field names (e.g. "Field") to 5460 // unconditionally include in API requests. By default, fields with 5461 // empty values are omitted from API requests. However, any non-pointer, 5462 // non-interface field appearing in ForceSendFields will be sent to the 5463 // server regardless of whether the field is empty or not. This may be 5464 // used to include empty fields in Patch requests. 5465 ForceSendFields []string `json:"-"` 5466 5467 // NullFields is a list of field names (e.g. "Field") to include in API 5468 // requests with the JSON null value. By default, fields with empty 5469 // values are omitted from API requests. However, any field with an 5470 // empty value appearing in NullFields will be sent to the server as 5471 // null. It is an error if a field in this list has a non-empty value. 5472 // This may be used to include null fields in Patch requests. 5473 NullFields []string `json:"-"` 5474} 5475 5476func (s *RangePartitioning) MarshalJSON() ([]byte, error) { 5477 type NoMethod RangePartitioning 5478 raw := NoMethod(*s) 5479 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5480} 5481 5482// RangePartitioningRange: [TrustedTester] [Required] Defines the ranges 5483// for range partitioning. 5484type RangePartitioningRange struct { 5485 // End: [TrustedTester] [Required] The end of range partitioning, 5486 // exclusive. 5487 End int64 `json:"end,omitempty,string"` 5488 5489 // Interval: [TrustedTester] [Required] The width of each interval. 5490 Interval int64 `json:"interval,omitempty,string"` 5491 5492 // Start: [TrustedTester] [Required] The start of range partitioning, 5493 // inclusive. 5494 Start int64 `json:"start,omitempty,string"` 5495 5496 // ForceSendFields is a list of field names (e.g. "End") to 5497 // unconditionally include in API requests. By default, fields with 5498 // empty values are omitted from API requests. However, any non-pointer, 5499 // non-interface field appearing in ForceSendFields will be sent to the 5500 // server regardless of whether the field is empty or not. This may be 5501 // used to include empty fields in Patch requests. 5502 ForceSendFields []string `json:"-"` 5503 5504 // NullFields is a list of field names (e.g. "End") to include in API 5505 // requests with the JSON null value. By default, fields with empty 5506 // values are omitted from API requests. However, any field with an 5507 // empty value appearing in NullFields will be sent to the server as 5508 // null. It is an error if a field in this list has a non-empty value. 5509 // This may be used to include null fields in Patch requests. 5510 NullFields []string `json:"-"` 5511} 5512 5513func (s *RangePartitioningRange) MarshalJSON() ([]byte, error) { 5514 type NoMethod RangePartitioningRange 5515 raw := NoMethod(*s) 5516 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5517} 5518 5519// RankingMetrics: Evaluation metrics used by weighted-ALS models 5520// specified by 5521// feedback_type=implicit. 5522type RankingMetrics struct { 5523 // AverageRank: Determines the goodness of a ranking by computing the 5524 // percentile rank 5525 // from the predicted confidence and dividing it by the original rank. 5526 AverageRank float64 `json:"averageRank,omitempty"` 5527 5528 // MeanAveragePrecision: Calculates a precision per user for all the 5529 // items by ranking them and 5530 // then averages all the precisions across all the users. 5531 MeanAveragePrecision float64 `json:"meanAveragePrecision,omitempty"` 5532 5533 // MeanSquaredError: Similar to the mean squared error computed in 5534 // regression and explicit 5535 // recommendation models except instead of computing the rating 5536 // directly, 5537 // the output from evaluate is computed against a preference which is 1 5538 // or 0 5539 // depending on if the rating exists or not. 5540 MeanSquaredError float64 `json:"meanSquaredError,omitempty"` 5541 5542 // NormalizedDiscountedCumulativeGain: A metric to determine the 5543 // goodness of a ranking calculated from the 5544 // predicted confidence by comparing it to an ideal rank measured by 5545 // the 5546 // original ratings. 5547 NormalizedDiscountedCumulativeGain float64 `json:"normalizedDiscountedCumulativeGain,omitempty"` 5548 5549 // ForceSendFields is a list of field names (e.g. "AverageRank") to 5550 // unconditionally include in API requests. By default, fields with 5551 // empty values are omitted from API requests. However, any non-pointer, 5552 // non-interface field appearing in ForceSendFields will be sent to the 5553 // server regardless of whether the field is empty or not. This may be 5554 // used to include empty fields in Patch requests. 5555 ForceSendFields []string `json:"-"` 5556 5557 // NullFields is a list of field names (e.g. "AverageRank") to include 5558 // in API requests with the JSON null value. By default, fields with 5559 // empty values are omitted from API requests. However, any field with 5560 // an empty value appearing in NullFields will be sent to the server as 5561 // null. It is an error if a field in this list has a non-empty value. 5562 // This may be used to include null fields in Patch requests. 5563 NullFields []string `json:"-"` 5564} 5565 5566func (s *RankingMetrics) MarshalJSON() ([]byte, error) { 5567 type NoMethod RankingMetrics 5568 raw := NoMethod(*s) 5569 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5570} 5571 5572func (s *RankingMetrics) UnmarshalJSON(data []byte) error { 5573 type NoMethod RankingMetrics 5574 var s1 struct { 5575 AverageRank gensupport.JSONFloat64 `json:"averageRank"` 5576 MeanAveragePrecision gensupport.JSONFloat64 `json:"meanAveragePrecision"` 5577 MeanSquaredError gensupport.JSONFloat64 `json:"meanSquaredError"` 5578 NormalizedDiscountedCumulativeGain gensupport.JSONFloat64 `json:"normalizedDiscountedCumulativeGain"` 5579 *NoMethod 5580 } 5581 s1.NoMethod = (*NoMethod)(s) 5582 if err := json.Unmarshal(data, &s1); err != nil { 5583 return err 5584 } 5585 s.AverageRank = float64(s1.AverageRank) 5586 s.MeanAveragePrecision = float64(s1.MeanAveragePrecision) 5587 s.MeanSquaredError = float64(s1.MeanSquaredError) 5588 s.NormalizedDiscountedCumulativeGain = float64(s1.NormalizedDiscountedCumulativeGain) 5589 return nil 5590} 5591 5592// RegressionMetrics: Evaluation metrics for regression and explicit 5593// feedback type matrix 5594// factorization models. 5595type RegressionMetrics struct { 5596 // MeanAbsoluteError: Mean absolute error. 5597 MeanAbsoluteError float64 `json:"meanAbsoluteError,omitempty"` 5598 5599 // MeanSquaredError: Mean squared error. 5600 MeanSquaredError float64 `json:"meanSquaredError,omitempty"` 5601 5602 // MeanSquaredLogError: Mean squared log error. 5603 MeanSquaredLogError float64 `json:"meanSquaredLogError,omitempty"` 5604 5605 // MedianAbsoluteError: Median absolute error. 5606 MedianAbsoluteError float64 `json:"medianAbsoluteError,omitempty"` 5607 5608 // RSquared: R^2 score. 5609 RSquared float64 `json:"rSquared,omitempty"` 5610 5611 // ForceSendFields is a list of field names (e.g. "MeanAbsoluteError") 5612 // to unconditionally include in API requests. By default, fields with 5613 // empty values are omitted from API requests. However, any non-pointer, 5614 // non-interface field appearing in ForceSendFields will be sent to the 5615 // server regardless of whether the field is empty or not. This may be 5616 // used to include empty fields in Patch requests. 5617 ForceSendFields []string `json:"-"` 5618 5619 // NullFields is a list of field names (e.g. "MeanAbsoluteError") to 5620 // include in API requests with the JSON null value. By default, fields 5621 // with empty values are omitted from API requests. However, any field 5622 // with an empty value appearing in NullFields will be sent to the 5623 // server as null. It is an error if a field in this list has a 5624 // non-empty value. This may be used to include null fields in Patch 5625 // requests. 5626 NullFields []string `json:"-"` 5627} 5628 5629func (s *RegressionMetrics) MarshalJSON() ([]byte, error) { 5630 type NoMethod RegressionMetrics 5631 raw := NoMethod(*s) 5632 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5633} 5634 5635func (s *RegressionMetrics) UnmarshalJSON(data []byte) error { 5636 type NoMethod RegressionMetrics 5637 var s1 struct { 5638 MeanAbsoluteError gensupport.JSONFloat64 `json:"meanAbsoluteError"` 5639 MeanSquaredError gensupport.JSONFloat64 `json:"meanSquaredError"` 5640 MeanSquaredLogError gensupport.JSONFloat64 `json:"meanSquaredLogError"` 5641 MedianAbsoluteError gensupport.JSONFloat64 `json:"medianAbsoluteError"` 5642 RSquared gensupport.JSONFloat64 `json:"rSquared"` 5643 *NoMethod 5644 } 5645 s1.NoMethod = (*NoMethod)(s) 5646 if err := json.Unmarshal(data, &s1); err != nil { 5647 return err 5648 } 5649 s.MeanAbsoluteError = float64(s1.MeanAbsoluteError) 5650 s.MeanSquaredError = float64(s1.MeanSquaredError) 5651 s.MeanSquaredLogError = float64(s1.MeanSquaredLogError) 5652 s.MedianAbsoluteError = float64(s1.MedianAbsoluteError) 5653 s.RSquared = float64(s1.RSquared) 5654 return nil 5655} 5656 5657// Routine: A user-defined function or a stored procedure. 5658type Routine struct { 5659 // Arguments: Optional. 5660 Arguments []*Argument `json:"arguments,omitempty"` 5661 5662 // CreationTime: Output only. The time when this routine was created, in 5663 // milliseconds since 5664 // the epoch. 5665 CreationTime int64 `json:"creationTime,omitempty,string"` 5666 5667 // DefinitionBody: Required. The body of the routine. 5668 // 5669 // For functions, this is the expression in the AS clause. 5670 // 5671 // If language=SQL, it is the substring inside (but excluding) 5672 // the 5673 // parentheses. For example, for the function created with the 5674 // following 5675 // statement: 5676 // 5677 // `CREATE FUNCTION JoinLines(x string, y string) as (concat(x, "\n", 5678 // y))` 5679 // 5680 // The definition_body is `concat(x, "\n", y)` (\n is not replaced 5681 // with 5682 // linebreak). 5683 // 5684 // If language=JAVASCRIPT, it is the evaluated string in the AS 5685 // clause. 5686 // For example, for the function created with the following 5687 // statement: 5688 // 5689 // `CREATE FUNCTION f() RETURNS STRING LANGUAGE js AS 'return 5690 // "\n";\n'` 5691 // 5692 // The definition_body is 5693 // 5694 // `return "\n";\n` 5695 // 5696 // Note that both \n are replaced with linebreaks. 5697 DefinitionBody string `json:"definitionBody,omitempty"` 5698 5699 // Description: Optional. [Experimental] The description of the routine 5700 // if defined. 5701 Description string `json:"description,omitempty"` 5702 5703 // DeterminismLevel: Optional. [Experimental] The determinism level of 5704 // the JavaScript UDF if defined. 5705 // 5706 // Possible values: 5707 // "DETERMINISM_LEVEL_UNSPECIFIED" - The determinism of the UDF is 5708 // unspecified. 5709 // "DETERMINISTIC" - The UDF is deterministic, meaning that 2 function 5710 // calls with the same 5711 // inputs always produce the same result, even across 2 query runs. 5712 // "NOT_DETERMINISTIC" - The UDF is not deterministic. 5713 DeterminismLevel string `json:"determinismLevel,omitempty"` 5714 5715 // Etag: Output only. A hash of this resource. 5716 Etag string `json:"etag,omitempty"` 5717 5718 // ImportedLibraries: Optional. If language = "JAVASCRIPT", this field 5719 // stores the path of the 5720 // imported JAVASCRIPT libraries. 5721 ImportedLibraries []string `json:"importedLibraries,omitempty"` 5722 5723 // Language: Optional. Defaults to "SQL". 5724 // 5725 // Possible values: 5726 // "LANGUAGE_UNSPECIFIED" 5727 // "SQL" - SQL language. 5728 // "JAVASCRIPT" - JavaScript language. 5729 Language string `json:"language,omitempty"` 5730 5731 // LastModifiedTime: Output only. The time when this routine was last 5732 // modified, in milliseconds 5733 // since the epoch. 5734 LastModifiedTime int64 `json:"lastModifiedTime,omitempty,string"` 5735 5736 // ReturnType: Optional if language = "SQL"; required otherwise. 5737 // 5738 // If absent, the return type is inferred from definition_body at query 5739 // time 5740 // in each query that references this routine. If present, then the 5741 // evaluated 5742 // result will be cast to the specified returned type at query 5743 // time. 5744 // 5745 // For example, for the functions created with the following 5746 // statements: 5747 // 5748 // * `CREATE FUNCTION Add(x FLOAT64, y FLOAT64) RETURNS FLOAT64 AS (x + 5749 // y);` 5750 // 5751 // * `CREATE FUNCTION Increment(x FLOAT64) AS (Add(x, 1));` 5752 // 5753 // * `CREATE FUNCTION Decrement(x FLOAT64) RETURNS FLOAT64 AS (Add(x, 5754 // -1));` 5755 // 5756 // The return_type is `{type_kind: "FLOAT64"}` for `Add` and 5757 // `Decrement`, and 5758 // is absent for `Increment` (inferred as FLOAT64 at query 5759 // time). 5760 // 5761 // Suppose the function `Add` is replaced by 5762 // `CREATE OR REPLACE FUNCTION Add(x INT64, y INT64) AS (x + 5763 // y);` 5764 // 5765 // Then the inferred return type of `Increment` is automatically changed 5766 // to 5767 // INT64 at query time, while the return type of `Decrement` remains 5768 // FLOAT64. 5769 ReturnType *StandardSqlDataType `json:"returnType,omitempty"` 5770 5771 // RoutineReference: Required. Reference describing the ID of this 5772 // routine. 5773 RoutineReference *RoutineReference `json:"routineReference,omitempty"` 5774 5775 // RoutineType: Required. The type of routine. 5776 // 5777 // Possible values: 5778 // "ROUTINE_TYPE_UNSPECIFIED" 5779 // "SCALAR_FUNCTION" - Non-builtin permanent scalar function. 5780 // "PROCEDURE" - Stored procedure. 5781 RoutineType string `json:"routineType,omitempty"` 5782 5783 // ServerResponse contains the HTTP response code and headers from the 5784 // server. 5785 googleapi.ServerResponse `json:"-"` 5786 5787 // ForceSendFields is a list of field names (e.g. "Arguments") to 5788 // unconditionally include in API requests. By default, fields with 5789 // empty values are omitted from API requests. However, any non-pointer, 5790 // non-interface field appearing in ForceSendFields will be sent to the 5791 // server regardless of whether the field is empty or not. This may be 5792 // used to include empty fields in Patch requests. 5793 ForceSendFields []string `json:"-"` 5794 5795 // NullFields is a list of field names (e.g. "Arguments") to include in 5796 // API requests with the JSON null value. By default, fields with empty 5797 // values are omitted from API requests. However, any field with an 5798 // empty value appearing in NullFields will be sent to the server as 5799 // null. It is an error if a field in this list has a non-empty value. 5800 // This may be used to include null fields in Patch requests. 5801 NullFields []string `json:"-"` 5802} 5803 5804func (s *Routine) MarshalJSON() ([]byte, error) { 5805 type NoMethod Routine 5806 raw := NoMethod(*s) 5807 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5808} 5809 5810type RoutineReference struct { 5811 // DatasetId: [Required] The ID of the dataset containing this routine. 5812 DatasetId string `json:"datasetId,omitempty"` 5813 5814 // ProjectId: [Required] The ID of the project containing this routine. 5815 ProjectId string `json:"projectId,omitempty"` 5816 5817 // RoutineId: [Required] The ID of the routine. The ID must contain only 5818 // letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum 5819 // length is 256 characters. 5820 RoutineId string `json:"routineId,omitempty"` 5821 5822 // ForceSendFields is a list of field names (e.g. "DatasetId") to 5823 // unconditionally include in API requests. By default, fields with 5824 // empty values are omitted from API requests. However, any non-pointer, 5825 // non-interface field appearing in ForceSendFields will be sent to the 5826 // server regardless of whether the field is empty or not. This may be 5827 // used to include empty fields in Patch requests. 5828 ForceSendFields []string `json:"-"` 5829 5830 // NullFields is a list of field names (e.g. "DatasetId") to include in 5831 // API requests with the JSON null value. By default, fields with empty 5832 // values are omitted from API requests. However, any field with an 5833 // empty value appearing in NullFields will be sent to the server as 5834 // null. It is an error if a field in this list has a non-empty value. 5835 // This may be used to include null fields in Patch requests. 5836 NullFields []string `json:"-"` 5837} 5838 5839func (s *RoutineReference) MarshalJSON() ([]byte, error) { 5840 type NoMethod RoutineReference 5841 raw := NoMethod(*s) 5842 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5843} 5844 5845// Row: A single row in the confusion matrix. 5846type Row struct { 5847 // ActualLabel: The original label of this row. 5848 ActualLabel string `json:"actualLabel,omitempty"` 5849 5850 // Entries: Info describing predicted label distribution. 5851 Entries []*Entry `json:"entries,omitempty"` 5852 5853 // ForceSendFields is a list of field names (e.g. "ActualLabel") to 5854 // unconditionally include in API requests. By default, fields with 5855 // empty values are omitted from API requests. However, any non-pointer, 5856 // non-interface field appearing in ForceSendFields will be sent to the 5857 // server regardless of whether the field is empty or not. This may be 5858 // used to include empty fields in Patch requests. 5859 ForceSendFields []string `json:"-"` 5860 5861 // NullFields is a list of field names (e.g. "ActualLabel") to include 5862 // in API requests with the JSON null value. By default, fields with 5863 // empty values are omitted from API requests. However, any field with 5864 // an empty value appearing in NullFields will be sent to the server as 5865 // null. It is an error if a field in this list has a non-empty value. 5866 // This may be used to include null fields in Patch requests. 5867 NullFields []string `json:"-"` 5868} 5869 5870func (s *Row) MarshalJSON() ([]byte, error) { 5871 type NoMethod Row 5872 raw := NoMethod(*s) 5873 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5874} 5875 5876type RowAccessPolicyReference struct { 5877 // DatasetId: [Required] The ID of the dataset containing this row 5878 // access policy. 5879 DatasetId string `json:"datasetId,omitempty"` 5880 5881 // PolicyId: [Required] The ID of the row access policy. The ID must 5882 // contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). 5883 // The maximum length is 256 characters. 5884 PolicyId string `json:"policyId,omitempty"` 5885 5886 // ProjectId: [Required] The ID of the project containing this row 5887 // access policy. 5888 ProjectId string `json:"projectId,omitempty"` 5889 5890 // TableId: [Required] The ID of the table containing this row access 5891 // policy. 5892 TableId string `json:"tableId,omitempty"` 5893 5894 // ForceSendFields is a list of field names (e.g. "DatasetId") to 5895 // unconditionally include in API requests. By default, fields with 5896 // empty values are omitted from API requests. However, any non-pointer, 5897 // non-interface field appearing in ForceSendFields will be sent to the 5898 // server regardless of whether the field is empty or not. This may be 5899 // used to include empty fields in Patch requests. 5900 ForceSendFields []string `json:"-"` 5901 5902 // NullFields is a list of field names (e.g. "DatasetId") to include in 5903 // API requests with the JSON null value. By default, fields with empty 5904 // values are omitted from API requests. However, any field with an 5905 // empty value appearing in NullFields will be sent to the server as 5906 // null. It is an error if a field in this list has a non-empty value. 5907 // This may be used to include null fields in Patch requests. 5908 NullFields []string `json:"-"` 5909} 5910 5911func (s *RowAccessPolicyReference) MarshalJSON() ([]byte, error) { 5912 type NoMethod RowAccessPolicyReference 5913 raw := NoMethod(*s) 5914 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5915} 5916 5917type RowLevelSecurityStatistics struct { 5918 // RowLevelSecurityApplied: [Output-only] [Preview] Whether any accessed 5919 // data was protected by row access policies. 5920 RowLevelSecurityApplied bool `json:"rowLevelSecurityApplied,omitempty"` 5921 5922 // ForceSendFields is a list of field names (e.g. 5923 // "RowLevelSecurityApplied") to unconditionally include in API 5924 // requests. By default, fields with empty values are omitted from API 5925 // requests. However, any non-pointer, non-interface field appearing in 5926 // ForceSendFields will be sent to the server regardless of whether the 5927 // field is empty or not. This may be used to include empty fields in 5928 // Patch requests. 5929 ForceSendFields []string `json:"-"` 5930 5931 // NullFields is a list of field names (e.g. "RowLevelSecurityApplied") 5932 // to include in API requests with the JSON null value. By default, 5933 // fields with empty values are omitted from API requests. However, any 5934 // field with an empty value appearing in NullFields will be sent to the 5935 // server as null. It is an error if a field in this list has a 5936 // non-empty value. This may be used to include null fields in Patch 5937 // requests. 5938 NullFields []string `json:"-"` 5939} 5940 5941func (s *RowLevelSecurityStatistics) MarshalJSON() ([]byte, error) { 5942 type NoMethod RowLevelSecurityStatistics 5943 raw := NoMethod(*s) 5944 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5945} 5946 5947type ScriptStackFrame struct { 5948 // EndColumn: [Output-only] One-based end column. 5949 EndColumn int64 `json:"endColumn,omitempty"` 5950 5951 // EndLine: [Output-only] One-based end line. 5952 EndLine int64 `json:"endLine,omitempty"` 5953 5954 // ProcedureId: [Output-only] Name of the active procedure, empty if in 5955 // a top-level script. 5956 ProcedureId string `json:"procedureId,omitempty"` 5957 5958 // StartColumn: [Output-only] One-based start column. 5959 StartColumn int64 `json:"startColumn,omitempty"` 5960 5961 // StartLine: [Output-only] One-based start line. 5962 StartLine int64 `json:"startLine,omitempty"` 5963 5964 // Text: [Output-only] Text of the current statement/expression. 5965 Text string `json:"text,omitempty"` 5966 5967 // ForceSendFields is a list of field names (e.g. "EndColumn") to 5968 // unconditionally include in API requests. By default, fields with 5969 // empty values are omitted from API requests. However, any non-pointer, 5970 // non-interface field appearing in ForceSendFields will be sent to the 5971 // server regardless of whether the field is empty or not. This may be 5972 // used to include empty fields in Patch requests. 5973 ForceSendFields []string `json:"-"` 5974 5975 // NullFields is a list of field names (e.g. "EndColumn") to include in 5976 // API requests with the JSON null value. By default, fields with empty 5977 // values are omitted from API requests. However, any field with an 5978 // empty value appearing in NullFields will be sent to the server as 5979 // null. It is an error if a field in this list has a non-empty value. 5980 // This may be used to include null fields in Patch requests. 5981 NullFields []string `json:"-"` 5982} 5983 5984func (s *ScriptStackFrame) MarshalJSON() ([]byte, error) { 5985 type NoMethod ScriptStackFrame 5986 raw := NoMethod(*s) 5987 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5988} 5989 5990type ScriptStatistics struct { 5991 // EvaluationKind: [Output-only] Whether this child job was a statement 5992 // or expression. 5993 EvaluationKind string `json:"evaluationKind,omitempty"` 5994 5995 // StackFrames: Stack trace showing the line/column/procedure name of 5996 // each frame on the stack at the point where the current evaluation 5997 // happened. The leaf frame is first, the primary script is last. Never 5998 // empty. 5999 StackFrames []*ScriptStackFrame `json:"stackFrames,omitempty"` 6000 6001 // ForceSendFields is a list of field names (e.g. "EvaluationKind") to 6002 // unconditionally include in API requests. By default, fields with 6003 // empty values are omitted from API requests. However, any non-pointer, 6004 // non-interface field appearing in ForceSendFields will be sent to the 6005 // server regardless of whether the field is empty or not. This may be 6006 // used to include empty fields in Patch requests. 6007 ForceSendFields []string `json:"-"` 6008 6009 // NullFields is a list of field names (e.g. "EvaluationKind") to 6010 // include in API requests with the JSON null value. By default, fields 6011 // with empty values are omitted from API requests. However, any field 6012 // with an empty value appearing in NullFields will be sent to the 6013 // server as null. It is an error if a field in this list has a 6014 // non-empty value. This may be used to include null fields in Patch 6015 // requests. 6016 NullFields []string `json:"-"` 6017} 6018 6019func (s *ScriptStatistics) MarshalJSON() ([]byte, error) { 6020 type NoMethod ScriptStatistics 6021 raw := NoMethod(*s) 6022 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6023} 6024 6025// SetIamPolicyRequest: Request message for `SetIamPolicy` method. 6026type SetIamPolicyRequest struct { 6027 // Policy: REQUIRED: The complete policy to be applied to the 6028 // `resource`. The size of 6029 // the policy is limited to a few 10s of KB. An empty policy is a 6030 // valid policy but certain Cloud Platform services (such as 6031 // Projects) 6032 // might reject them. 6033 Policy *Policy `json:"policy,omitempty"` 6034 6035 // UpdateMask: OPTIONAL: A FieldMask specifying which fields of the 6036 // policy to modify. Only 6037 // the fields in the mask will be modified. If no mask is provided, 6038 // the 6039 // following default mask is used: 6040 // 6041 // `paths: "bindings, etag" 6042 UpdateMask string `json:"updateMask,omitempty"` 6043 6044 // ForceSendFields is a list of field names (e.g. "Policy") to 6045 // unconditionally include in API requests. By default, fields with 6046 // empty values are omitted from API requests. However, any non-pointer, 6047 // non-interface field appearing in ForceSendFields will be sent to the 6048 // server regardless of whether the field is empty or not. This may be 6049 // used to include empty fields in Patch requests. 6050 ForceSendFields []string `json:"-"` 6051 6052 // NullFields is a list of field names (e.g. "Policy") to include in API 6053 // requests with the JSON null value. By default, fields with empty 6054 // values are omitted from API requests. However, any field with an 6055 // empty value appearing in NullFields will be sent to the server as 6056 // null. It is an error if a field in this list has a non-empty value. 6057 // This may be used to include null fields in Patch requests. 6058 NullFields []string `json:"-"` 6059} 6060 6061func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) { 6062 type NoMethod SetIamPolicyRequest 6063 raw := NoMethod(*s) 6064 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6065} 6066 6067// StandardSqlDataType: The type of a variable, e.g., a function 6068// argument. 6069// Examples: 6070// INT64: {type_kind="INT64"} 6071// ARRAY<STRING>: {type_kind="ARRAY", 6072// array_element_type="STRING"} 6073// STRUCT<x STRING, y ARRAY<DATE>>: 6074// {type_kind="STRUCT", 6075// struct_type={fields=[ 6076// {name="x", type={type_kind="STRING"}}, 6077// {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} 6078// ]}} 6079type StandardSqlDataType struct { 6080 // ArrayElementType: The type of the array's elements, if type_kind = 6081 // "ARRAY". 6082 ArrayElementType *StandardSqlDataType `json:"arrayElementType,omitempty"` 6083 6084 // StructType: The fields of this struct, in order, if type_kind = 6085 // "STRUCT". 6086 StructType *StandardSqlStructType `json:"structType,omitempty"` 6087 6088 // TypeKind: Required. The top level type of this field. 6089 // Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY"). 6090 // 6091 // Possible values: 6092 // "TYPE_KIND_UNSPECIFIED" - Invalid type. 6093 // "INT64" - Encoded as a string in decimal format. 6094 // "BOOL" - Encoded as a boolean "false" or "true". 6095 // "FLOAT64" - Encoded as a number, or string "NaN", "Infinity" or 6096 // "-Infinity". 6097 // "STRING" - Encoded as a string value. 6098 // "BYTES" - Encoded as a base64 string per RFC 4648, section 4. 6099 // "TIMESTAMP" - Encoded as an RFC 3339 timestamp with mandatory "Z" 6100 // time zone string: 6101 // 1985-04-12T23:20:50.52Z 6102 // "DATE" - Encoded as RFC 3339 full-date format string: 1985-04-12 6103 // "TIME" - Encoded as RFC 3339 partial-time format string: 6104 // 23:20:50.52 6105 // "DATETIME" - Encoded as RFC 3339 full-date "T" partial-time: 6106 // 1985-04-12T23:20:50.52 6107 // "GEOGRAPHY" - Encoded as WKT 6108 // "NUMERIC" - Encoded as a decimal string. 6109 // "BIGNUMERIC" - Encoded as a decimal string. 6110 // "ARRAY" - Encoded as a list with types matching Type.array_type. 6111 // "STRUCT" - Encoded as a list with fields of type 6112 // Type.struct_type[i]. List is used 6113 // because a JSON object cannot have duplicate field names. 6114 TypeKind string `json:"typeKind,omitempty"` 6115 6116 // ForceSendFields is a list of field names (e.g. "ArrayElementType") to 6117 // unconditionally include in API requests. By default, fields with 6118 // empty values are omitted from API requests. However, any non-pointer, 6119 // non-interface field appearing in ForceSendFields will be sent to the 6120 // server regardless of whether the field is empty or not. This may be 6121 // used to include empty fields in Patch requests. 6122 ForceSendFields []string `json:"-"` 6123 6124 // NullFields is a list of field names (e.g. "ArrayElementType") to 6125 // include in API requests with the JSON null value. By default, fields 6126 // with empty values are omitted from API requests. However, any field 6127 // with an empty value appearing in NullFields will be sent to the 6128 // server as null. It is an error if a field in this list has a 6129 // non-empty value. This may be used to include null fields in Patch 6130 // requests. 6131 NullFields []string `json:"-"` 6132} 6133 6134func (s *StandardSqlDataType) MarshalJSON() ([]byte, error) { 6135 type NoMethod StandardSqlDataType 6136 raw := NoMethod(*s) 6137 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6138} 6139 6140// StandardSqlField: A field or a column. 6141type StandardSqlField struct { 6142 // Name: Optional. The name of this field. Can be absent for struct 6143 // fields. 6144 Name string `json:"name,omitempty"` 6145 6146 // Type: Optional. The type of this parameter. Absent if not 6147 // explicitly 6148 // specified (e.g., CREATE FUNCTION statement can omit the return 6149 // type; 6150 // in this case the output parameter does not have this "type" field). 6151 Type *StandardSqlDataType `json:"type,omitempty"` 6152 6153 // ForceSendFields is a list of field names (e.g. "Name") to 6154 // unconditionally include in API requests. By default, fields with 6155 // empty values are omitted from API requests. However, any non-pointer, 6156 // non-interface field appearing in ForceSendFields will be sent to the 6157 // server regardless of whether the field is empty or not. This may be 6158 // used to include empty fields in Patch requests. 6159 ForceSendFields []string `json:"-"` 6160 6161 // NullFields is a list of field names (e.g. "Name") to include in API 6162 // requests with the JSON null value. By default, fields with empty 6163 // values are omitted from API requests. However, any field with an 6164 // empty value appearing in NullFields will be sent to the server as 6165 // null. It is an error if a field in this list has a non-empty value. 6166 // This may be used to include null fields in Patch requests. 6167 NullFields []string `json:"-"` 6168} 6169 6170func (s *StandardSqlField) MarshalJSON() ([]byte, error) { 6171 type NoMethod StandardSqlField 6172 raw := NoMethod(*s) 6173 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6174} 6175 6176type StandardSqlStructType struct { 6177 Fields []*StandardSqlField `json:"fields,omitempty"` 6178 6179 // ForceSendFields is a list of field names (e.g. "Fields") to 6180 // unconditionally include in API requests. By default, fields with 6181 // empty values are omitted from API requests. However, any non-pointer, 6182 // non-interface field appearing in ForceSendFields will be sent to the 6183 // server regardless of whether the field is empty or not. This may be 6184 // used to include empty fields in Patch requests. 6185 ForceSendFields []string `json:"-"` 6186 6187 // NullFields is a list of field names (e.g. "Fields") to include in API 6188 // requests with the JSON null value. By default, fields with empty 6189 // values are omitted from API requests. However, any field with an 6190 // empty value appearing in NullFields will be sent to the server as 6191 // null. It is an error if a field in this list has a non-empty value. 6192 // This may be used to include null fields in Patch requests. 6193 NullFields []string `json:"-"` 6194} 6195 6196func (s *StandardSqlStructType) MarshalJSON() ([]byte, error) { 6197 type NoMethod StandardSqlStructType 6198 raw := NoMethod(*s) 6199 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6200} 6201 6202type Streamingbuffer struct { 6203 // EstimatedBytes: [Output-only] A lower-bound estimate of the number of 6204 // bytes currently in the streaming buffer. 6205 EstimatedBytes uint64 `json:"estimatedBytes,omitempty,string"` 6206 6207 // EstimatedRows: [Output-only] A lower-bound estimate of the number of 6208 // rows currently in the streaming buffer. 6209 EstimatedRows uint64 `json:"estimatedRows,omitempty,string"` 6210 6211 // OldestEntryTime: [Output-only] Contains the timestamp of the oldest 6212 // entry in the streaming buffer, in milliseconds since the epoch, if 6213 // the streaming buffer is available. 6214 OldestEntryTime uint64 `json:"oldestEntryTime,omitempty,string"` 6215 6216 // ForceSendFields is a list of field names (e.g. "EstimatedBytes") to 6217 // unconditionally include in API requests. By default, fields with 6218 // empty values are omitted from API requests. However, any non-pointer, 6219 // non-interface field appearing in ForceSendFields will be sent to the 6220 // server regardless of whether the field is empty or not. This may be 6221 // used to include empty fields in Patch requests. 6222 ForceSendFields []string `json:"-"` 6223 6224 // NullFields is a list of field names (e.g. "EstimatedBytes") to 6225 // include in API requests with the JSON null value. By default, fields 6226 // with empty values are omitted from API requests. However, any field 6227 // with an empty value appearing in NullFields will be sent to the 6228 // server as null. It is an error if a field in this list has a 6229 // non-empty value. This may be used to include null fields in Patch 6230 // requests. 6231 NullFields []string `json:"-"` 6232} 6233 6234func (s *Streamingbuffer) MarshalJSON() ([]byte, error) { 6235 type NoMethod Streamingbuffer 6236 raw := NoMethod(*s) 6237 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6238} 6239 6240type Table struct { 6241 // Clustering: [Beta] Clustering specification for the table. Must be 6242 // specified with partitioning, data in the table will be first 6243 // partitioned and subsequently clustered. 6244 Clustering *Clustering `json:"clustering,omitempty"` 6245 6246 // CreationTime: [Output-only] The time when this table was created, in 6247 // milliseconds since the epoch. 6248 CreationTime int64 `json:"creationTime,omitempty,string"` 6249 6250 // Description: [Optional] A user-friendly description of this table. 6251 Description string `json:"description,omitempty"` 6252 6253 // EncryptionConfiguration: Custom encryption configuration (e.g., Cloud 6254 // KMS keys). 6255 EncryptionConfiguration *EncryptionConfiguration `json:"encryptionConfiguration,omitempty"` 6256 6257 // Etag: [Output-only] A hash of the table metadata. Used to ensure 6258 // there were no concurrent modifications to the resource when 6259 // attempting an update. Not guaranteed to change when the table 6260 // contents or the fields numRows, numBytes, numLongTermBytes or 6261 // lastModifiedTime change. 6262 Etag string `json:"etag,omitempty"` 6263 6264 // ExpirationTime: [Optional] The time when this table expires, in 6265 // milliseconds since the epoch. If not present, the table will persist 6266 // indefinitely. Expired tables will be deleted and their storage 6267 // reclaimed. The defaultTableExpirationMs property of the encapsulating 6268 // dataset can be used to set a default expirationTime on newly created 6269 // tables. 6270 ExpirationTime int64 `json:"expirationTime,omitempty,string"` 6271 6272 // ExternalDataConfiguration: [Optional] Describes the data format, 6273 // location, and other properties of a table stored outside of BigQuery. 6274 // By defining these properties, the data source can then be queried as 6275 // if it were a standard BigQuery table. 6276 ExternalDataConfiguration *ExternalDataConfiguration `json:"externalDataConfiguration,omitempty"` 6277 6278 // FriendlyName: [Optional] A descriptive name for this table. 6279 FriendlyName string `json:"friendlyName,omitempty"` 6280 6281 // Id: [Output-only] An opaque ID uniquely identifying the table. 6282 Id string `json:"id,omitempty"` 6283 6284 // Kind: [Output-only] The type of the resource. 6285 Kind string `json:"kind,omitempty"` 6286 6287 // Labels: The labels associated with this table. You can use these to 6288 // organize and group your tables. Label keys and values can be no 6289 // longer than 63 characters, can only contain lowercase letters, 6290 // numeric characters, underscores and dashes. International characters 6291 // are allowed. Label values are optional. Label keys must start with a 6292 // letter and each label in the list must have a different key. 6293 Labels map[string]string `json:"labels,omitempty"` 6294 6295 // LastModifiedTime: [Output-only] The time when this table was last 6296 // modified, in milliseconds since the epoch. 6297 LastModifiedTime uint64 `json:"lastModifiedTime,omitempty,string"` 6298 6299 // Location: [Output-only] The geographic location where the table 6300 // resides. This value is inherited from the dataset. 6301 Location string `json:"location,omitempty"` 6302 6303 // MaterializedView: [Optional] Materialized view definition. 6304 MaterializedView *MaterializedViewDefinition `json:"materializedView,omitempty"` 6305 6306 // Model: [Output-only, Beta] Present iff this table represents a ML 6307 // model. Describes the training information for the model, and it is 6308 // required to run 'PREDICT' queries. 6309 Model *ModelDefinition `json:"model,omitempty"` 6310 6311 // NumBytes: [Output-only] The size of this table in bytes, excluding 6312 // any data in the streaming buffer. 6313 NumBytes int64 `json:"numBytes,omitempty,string"` 6314 6315 // NumLongTermBytes: [Output-only] The number of bytes in the table that 6316 // are considered "long-term storage". 6317 NumLongTermBytes int64 `json:"numLongTermBytes,omitempty,string"` 6318 6319 // NumPhysicalBytes: [Output-only] [TrustedTester] The physical size of 6320 // this table in bytes, excluding any data in the streaming buffer. This 6321 // includes compression and storage used for time travel. 6322 NumPhysicalBytes int64 `json:"numPhysicalBytes,omitempty,string"` 6323 6324 // NumRows: [Output-only] The number of rows of data in this table, 6325 // excluding any data in the streaming buffer. 6326 NumRows uint64 `json:"numRows,omitempty,string"` 6327 6328 // RangePartitioning: [TrustedTester] Range partitioning specification 6329 // for this table. Only one of timePartitioning and rangePartitioning 6330 // should be specified. 6331 RangePartitioning *RangePartitioning `json:"rangePartitioning,omitempty"` 6332 6333 // RequirePartitionFilter: [Optional] If set to true, queries over this 6334 // table require a partition filter that can be used for partition 6335 // elimination to be specified. 6336 RequirePartitionFilter bool `json:"requirePartitionFilter,omitempty"` 6337 6338 // Schema: [Optional] Describes the schema of this table. 6339 Schema *TableSchema `json:"schema,omitempty"` 6340 6341 // SelfLink: [Output-only] A URL that can be used to access this 6342 // resource again. 6343 SelfLink string `json:"selfLink,omitempty"` 6344 6345 // StreamingBuffer: [Output-only] Contains information regarding this 6346 // table's streaming buffer, if one is present. This field will be 6347 // absent if the table is not being streamed to or if there is no data 6348 // in the streaming buffer. 6349 StreamingBuffer *Streamingbuffer `json:"streamingBuffer,omitempty"` 6350 6351 // TableReference: [Required] Reference describing the ID of this table. 6352 TableReference *TableReference `json:"tableReference,omitempty"` 6353 6354 // TimePartitioning: Time-based partitioning specification for this 6355 // table. Only one of timePartitioning and rangePartitioning should be 6356 // specified. 6357 TimePartitioning *TimePartitioning `json:"timePartitioning,omitempty"` 6358 6359 // Type: [Output-only] Describes the table type. The following values 6360 // are supported: TABLE: A normal BigQuery table. VIEW: A virtual table 6361 // defined by a SQL query. [TrustedTester] MATERIALIZED_VIEW: SQL query 6362 // whose result is persisted. EXTERNAL: A table that references data 6363 // stored in an external storage system, such as Google Cloud Storage. 6364 // The default value is TABLE. 6365 Type string `json:"type,omitempty"` 6366 6367 // View: [Optional] The view definition. 6368 View *ViewDefinition `json:"view,omitempty"` 6369 6370 // ServerResponse contains the HTTP response code and headers from the 6371 // server. 6372 googleapi.ServerResponse `json:"-"` 6373 6374 // ForceSendFields is a list of field names (e.g. "Clustering") to 6375 // unconditionally include in API requests. By default, fields with 6376 // empty values are omitted from API requests. However, any non-pointer, 6377 // non-interface field appearing in ForceSendFields will be sent to the 6378 // server regardless of whether the field is empty or not. This may be 6379 // used to include empty fields in Patch requests. 6380 ForceSendFields []string `json:"-"` 6381 6382 // NullFields is a list of field names (e.g. "Clustering") to include in 6383 // API requests with the JSON null value. By default, fields with empty 6384 // values are omitted from API requests. However, any field with an 6385 // empty value appearing in NullFields will be sent to the server as 6386 // null. It is an error if a field in this list has a non-empty value. 6387 // This may be used to include null fields in Patch requests. 6388 NullFields []string `json:"-"` 6389} 6390 6391func (s *Table) MarshalJSON() ([]byte, error) { 6392 type NoMethod Table 6393 raw := NoMethod(*s) 6394 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6395} 6396 6397type TableCell struct { 6398 V interface{} `json:"v,omitempty"` 6399 6400 // ForceSendFields is a list of field names (e.g. "V") to 6401 // unconditionally include in API requests. By default, fields with 6402 // empty values are omitted from API requests. However, any non-pointer, 6403 // non-interface field appearing in ForceSendFields will be sent to the 6404 // server regardless of whether the field is empty or not. This may be 6405 // used to include empty fields in Patch requests. 6406 ForceSendFields []string `json:"-"` 6407 6408 // NullFields is a list of field names (e.g. "V") to include in API 6409 // requests with the JSON null value. By default, fields with empty 6410 // values are omitted from API requests. However, any field with an 6411 // empty value appearing in NullFields will be sent to the server as 6412 // null. It is an error if a field in this list has a non-empty value. 6413 // This may be used to include null fields in Patch requests. 6414 NullFields []string `json:"-"` 6415} 6416 6417func (s *TableCell) MarshalJSON() ([]byte, error) { 6418 type NoMethod TableCell 6419 raw := NoMethod(*s) 6420 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6421} 6422 6423type TableDataInsertAllRequest struct { 6424 // IgnoreUnknownValues: [Optional] Accept rows that contain values that 6425 // do not match the schema. The unknown values are ignored. Default is 6426 // false, which treats unknown values as errors. 6427 IgnoreUnknownValues bool `json:"ignoreUnknownValues,omitempty"` 6428 6429 // Kind: The resource type of the response. 6430 Kind string `json:"kind,omitempty"` 6431 6432 // Rows: The rows to insert. 6433 Rows []*TableDataInsertAllRequestRows `json:"rows,omitempty"` 6434 6435 // SkipInvalidRows: [Optional] Insert all valid rows of a request, even 6436 // if invalid rows exist. The default value is false, which causes the 6437 // entire request to fail if any invalid rows exist. 6438 SkipInvalidRows bool `json:"skipInvalidRows,omitempty"` 6439 6440 // TemplateSuffix: If specified, treats the destination table as a base 6441 // template, and inserts the rows into an instance table named 6442 // "{destination}{templateSuffix}". BigQuery will manage creation of the 6443 // instance table, using the schema of the base template table. See 6444 // https://cloud.google.com/bigquery/streaming-data-into-bigquery#template-tables for considerations when working with templates 6445 // tables. 6446 TemplateSuffix string `json:"templateSuffix,omitempty"` 6447 6448 // ForceSendFields is a list of field names (e.g. "IgnoreUnknownValues") 6449 // to unconditionally include in API requests. By default, fields with 6450 // empty values are omitted from API requests. However, any non-pointer, 6451 // non-interface field appearing in ForceSendFields will be sent to the 6452 // server regardless of whether the field is empty or not. This may be 6453 // used to include empty fields in Patch requests. 6454 ForceSendFields []string `json:"-"` 6455 6456 // NullFields is a list of field names (e.g. "IgnoreUnknownValues") to 6457 // include in API requests with the JSON null value. By default, fields 6458 // with empty values are omitted from API requests. However, any field 6459 // with an empty value appearing in NullFields will be sent to the 6460 // server as null. It is an error if a field in this list has a 6461 // non-empty value. This may be used to include null fields in Patch 6462 // requests. 6463 NullFields []string `json:"-"` 6464} 6465 6466func (s *TableDataInsertAllRequest) MarshalJSON() ([]byte, error) { 6467 type NoMethod TableDataInsertAllRequest 6468 raw := NoMethod(*s) 6469 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6470} 6471 6472type TableDataInsertAllRequestRows struct { 6473 // InsertId: [Optional] A unique ID for each row. BigQuery uses this 6474 // property to detect duplicate insertion requests on a best-effort 6475 // basis. 6476 InsertId string `json:"insertId,omitempty"` 6477 6478 // Json: [Required] A JSON object that contains a row of data. The 6479 // object's properties and values must match the destination table's 6480 // schema. 6481 Json map[string]JsonValue `json:"json,omitempty"` 6482 6483 // ForceSendFields is a list of field names (e.g. "InsertId") to 6484 // unconditionally include in API requests. By default, fields with 6485 // empty values are omitted from API requests. However, any non-pointer, 6486 // non-interface field appearing in ForceSendFields will be sent to the 6487 // server regardless of whether the field is empty or not. This may be 6488 // used to include empty fields in Patch requests. 6489 ForceSendFields []string `json:"-"` 6490 6491 // NullFields is a list of field names (e.g. "InsertId") to include in 6492 // API requests with the JSON null value. By default, fields with empty 6493 // values are omitted from API requests. However, any field with an 6494 // empty value appearing in NullFields will be sent to the server as 6495 // null. It is an error if a field in this list has a non-empty value. 6496 // This may be used to include null fields in Patch requests. 6497 NullFields []string `json:"-"` 6498} 6499 6500func (s *TableDataInsertAllRequestRows) MarshalJSON() ([]byte, error) { 6501 type NoMethod TableDataInsertAllRequestRows 6502 raw := NoMethod(*s) 6503 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6504} 6505 6506type TableDataInsertAllResponse struct { 6507 // InsertErrors: An array of errors for rows that were not inserted. 6508 InsertErrors []*TableDataInsertAllResponseInsertErrors `json:"insertErrors,omitempty"` 6509 6510 // Kind: The resource type of the response. 6511 Kind string `json:"kind,omitempty"` 6512 6513 // ServerResponse contains the HTTP response code and headers from the 6514 // server. 6515 googleapi.ServerResponse `json:"-"` 6516 6517 // ForceSendFields is a list of field names (e.g. "InsertErrors") to 6518 // unconditionally include in API requests. By default, fields with 6519 // empty values are omitted from API requests. However, any non-pointer, 6520 // non-interface field appearing in ForceSendFields will be sent to the 6521 // server regardless of whether the field is empty or not. This may be 6522 // used to include empty fields in Patch requests. 6523 ForceSendFields []string `json:"-"` 6524 6525 // NullFields is a list of field names (e.g. "InsertErrors") to include 6526 // in API requests with the JSON null value. By default, fields with 6527 // empty values are omitted from API requests. However, any field with 6528 // an empty value appearing in NullFields will be sent to the server as 6529 // null. It is an error if a field in this list has a non-empty value. 6530 // This may be used to include null fields in Patch requests. 6531 NullFields []string `json:"-"` 6532} 6533 6534func (s *TableDataInsertAllResponse) MarshalJSON() ([]byte, error) { 6535 type NoMethod TableDataInsertAllResponse 6536 raw := NoMethod(*s) 6537 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6538} 6539 6540type TableDataInsertAllResponseInsertErrors struct { 6541 // Errors: Error information for the row indicated by the index 6542 // property. 6543 Errors []*ErrorProto `json:"errors,omitempty"` 6544 6545 // Index: The index of the row that error applies to. 6546 Index int64 `json:"index,omitempty"` 6547 6548 // ForceSendFields is a list of field names (e.g. "Errors") to 6549 // unconditionally include in API requests. By default, fields with 6550 // empty values are omitted from API requests. However, any non-pointer, 6551 // non-interface field appearing in ForceSendFields will be sent to the 6552 // server regardless of whether the field is empty or not. This may be 6553 // used to include empty fields in Patch requests. 6554 ForceSendFields []string `json:"-"` 6555 6556 // NullFields is a list of field names (e.g. "Errors") to include in API 6557 // requests with the JSON null value. By default, fields with empty 6558 // values are omitted from API requests. However, any field with an 6559 // empty value appearing in NullFields will be sent to the server as 6560 // null. It is an error if a field in this list has a non-empty value. 6561 // This may be used to include null fields in Patch requests. 6562 NullFields []string `json:"-"` 6563} 6564 6565func (s *TableDataInsertAllResponseInsertErrors) MarshalJSON() ([]byte, error) { 6566 type NoMethod TableDataInsertAllResponseInsertErrors 6567 raw := NoMethod(*s) 6568 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6569} 6570 6571type TableDataList struct { 6572 // Etag: A hash of this page of results. 6573 Etag string `json:"etag,omitempty"` 6574 6575 // Kind: The resource type of the response. 6576 Kind string `json:"kind,omitempty"` 6577 6578 // PageToken: A token used for paging results. Providing this token 6579 // instead of the startIndex parameter can help you retrieve stable 6580 // results when an underlying table is changing. 6581 PageToken string `json:"pageToken,omitempty"` 6582 6583 // Rows: Rows of results. 6584 Rows []*TableRow `json:"rows,omitempty"` 6585 6586 // TotalRows: The total number of rows in the complete table. 6587 TotalRows int64 `json:"totalRows,omitempty,string"` 6588 6589 // ServerResponse contains the HTTP response code and headers from the 6590 // server. 6591 googleapi.ServerResponse `json:"-"` 6592 6593 // ForceSendFields is a list of field names (e.g. "Etag") to 6594 // unconditionally include in API requests. By default, fields with 6595 // empty values are omitted from API requests. However, any non-pointer, 6596 // non-interface field appearing in ForceSendFields will be sent to the 6597 // server regardless of whether the field is empty or not. This may be 6598 // used to include empty fields in Patch requests. 6599 ForceSendFields []string `json:"-"` 6600 6601 // NullFields is a list of field names (e.g. "Etag") to include in API 6602 // requests with the JSON null value. By default, fields with empty 6603 // values are omitted from API requests. However, any field with an 6604 // empty value appearing in NullFields will be sent to the server as 6605 // null. It is an error if a field in this list has a non-empty value. 6606 // This may be used to include null fields in Patch requests. 6607 NullFields []string `json:"-"` 6608} 6609 6610func (s *TableDataList) MarshalJSON() ([]byte, error) { 6611 type NoMethod TableDataList 6612 raw := NoMethod(*s) 6613 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6614} 6615 6616type TableFieldSchema struct { 6617 // Categories: [Optional] The categories attached to this field, used 6618 // for field-level access control. 6619 Categories *TableFieldSchemaCategories `json:"categories,omitempty"` 6620 6621 // Description: [Optional] The field description. The maximum length is 6622 // 1,024 characters. 6623 Description string `json:"description,omitempty"` 6624 6625 // Fields: [Optional] Describes the nested schema fields if the type 6626 // property is set to RECORD. 6627 Fields []*TableFieldSchema `json:"fields,omitempty"` 6628 6629 // Mode: [Optional] The field mode. Possible values include NULLABLE, 6630 // REQUIRED and REPEATED. The default value is NULLABLE. 6631 Mode string `json:"mode,omitempty"` 6632 6633 // Name: [Required] The field name. The name must contain only letters 6634 // (a-z, A-Z), numbers (0-9), or underscores (_), and must start with a 6635 // letter or underscore. The maximum length is 128 characters. 6636 Name string `json:"name,omitempty"` 6637 6638 PolicyTags *TableFieldSchemaPolicyTags `json:"policyTags,omitempty"` 6639 6640 // Type: [Required] The field data type. Possible values include STRING, 6641 // BYTES, INTEGER, INT64 (same as INTEGER), FLOAT, FLOAT64 (same as 6642 // FLOAT), BOOLEAN, BOOL (same as BOOLEAN), TIMESTAMP, DATE, TIME, 6643 // DATETIME, RECORD (where RECORD indicates that the field contains a 6644 // nested schema) or STRUCT (same as RECORD). 6645 Type string `json:"type,omitempty"` 6646 6647 // ForceSendFields is a list of field names (e.g. "Categories") to 6648 // unconditionally include in API requests. By default, fields with 6649 // empty values are omitted from API requests. However, any non-pointer, 6650 // non-interface field appearing in ForceSendFields will be sent to the 6651 // server regardless of whether the field is empty or not. This may be 6652 // used to include empty fields in Patch requests. 6653 ForceSendFields []string `json:"-"` 6654 6655 // NullFields is a list of field names (e.g. "Categories") to include in 6656 // API requests with the JSON null value. By default, fields with empty 6657 // values are omitted from API requests. However, any field with an 6658 // empty value appearing in NullFields will be sent to the server as 6659 // null. It is an error if a field in this list has a non-empty value. 6660 // This may be used to include null fields in Patch requests. 6661 NullFields []string `json:"-"` 6662} 6663 6664func (s *TableFieldSchema) MarshalJSON() ([]byte, error) { 6665 type NoMethod TableFieldSchema 6666 raw := NoMethod(*s) 6667 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6668} 6669 6670// TableFieldSchemaCategories: [Optional] The categories attached to 6671// this field, used for field-level access control. 6672type TableFieldSchemaCategories struct { 6673 // Names: A list of category resource names. For example, 6674 // "projects/1/taxonomies/2/categories/3". At most 5 categories are 6675 // allowed. 6676 Names []string `json:"names,omitempty"` 6677 6678 // ForceSendFields is a list of field names (e.g. "Names") to 6679 // unconditionally include in API requests. By default, fields with 6680 // empty values are omitted from API requests. However, any non-pointer, 6681 // non-interface field appearing in ForceSendFields will be sent to the 6682 // server regardless of whether the field is empty or not. This may be 6683 // used to include empty fields in Patch requests. 6684 ForceSendFields []string `json:"-"` 6685 6686 // NullFields is a list of field names (e.g. "Names") to include in API 6687 // requests with the JSON null value. By default, fields with empty 6688 // values are omitted from API requests. However, any field with an 6689 // empty value appearing in NullFields will be sent to the server as 6690 // null. It is an error if a field in this list has a non-empty value. 6691 // This may be used to include null fields in Patch requests. 6692 NullFields []string `json:"-"` 6693} 6694 6695func (s *TableFieldSchemaCategories) MarshalJSON() ([]byte, error) { 6696 type NoMethod TableFieldSchemaCategories 6697 raw := NoMethod(*s) 6698 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6699} 6700 6701type TableFieldSchemaPolicyTags struct { 6702 // Names: A list of category resource names. For example, 6703 // "projects/1/location/eu/taxonomies/2/policyTags/3". At most 1 policy 6704 // tag is allowed. 6705 Names []string `json:"names,omitempty"` 6706 6707 // ForceSendFields is a list of field names (e.g. "Names") to 6708 // unconditionally include in API requests. By default, fields with 6709 // empty values are omitted from API requests. However, any non-pointer, 6710 // non-interface field appearing in ForceSendFields will be sent to the 6711 // server regardless of whether the field is empty or not. This may be 6712 // used to include empty fields in Patch requests. 6713 ForceSendFields []string `json:"-"` 6714 6715 // NullFields is a list of field names (e.g. "Names") to include in API 6716 // requests with the JSON null value. By default, fields with empty 6717 // values are omitted from API requests. However, any field with an 6718 // empty value appearing in NullFields will be sent to the server as 6719 // null. It is an error if a field in this list has a non-empty value. 6720 // This may be used to include null fields in Patch requests. 6721 NullFields []string `json:"-"` 6722} 6723 6724func (s *TableFieldSchemaPolicyTags) MarshalJSON() ([]byte, error) { 6725 type NoMethod TableFieldSchemaPolicyTags 6726 raw := NoMethod(*s) 6727 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6728} 6729 6730type TableList struct { 6731 // Etag: A hash of this page of results. 6732 Etag string `json:"etag,omitempty"` 6733 6734 // Kind: The type of list. 6735 Kind string `json:"kind,omitempty"` 6736 6737 // NextPageToken: A token to request the next page of results. 6738 NextPageToken string `json:"nextPageToken,omitempty"` 6739 6740 // Tables: Tables in the requested dataset. 6741 Tables []*TableListTables `json:"tables,omitempty"` 6742 6743 // TotalItems: The total number of tables in the dataset. 6744 TotalItems int64 `json:"totalItems,omitempty"` 6745 6746 // ServerResponse contains the HTTP response code and headers from the 6747 // server. 6748 googleapi.ServerResponse `json:"-"` 6749 6750 // ForceSendFields is a list of field names (e.g. "Etag") to 6751 // unconditionally include in API requests. By default, fields with 6752 // empty values are omitted from API requests. However, any non-pointer, 6753 // non-interface field appearing in ForceSendFields will be sent to the 6754 // server regardless of whether the field is empty or not. This may be 6755 // used to include empty fields in Patch requests. 6756 ForceSendFields []string `json:"-"` 6757 6758 // NullFields is a list of field names (e.g. "Etag") to include in API 6759 // requests with the JSON null value. By default, fields with empty 6760 // values are omitted from API requests. However, any field with an 6761 // empty value appearing in NullFields will be sent to the server as 6762 // null. It is an error if a field in this list has a non-empty value. 6763 // This may be used to include null fields in Patch requests. 6764 NullFields []string `json:"-"` 6765} 6766 6767func (s *TableList) MarshalJSON() ([]byte, error) { 6768 type NoMethod TableList 6769 raw := NoMethod(*s) 6770 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6771} 6772 6773type TableListTables struct { 6774 // Clustering: [Beta] Clustering specification for this table, if 6775 // configured. 6776 Clustering *Clustering `json:"clustering,omitempty"` 6777 6778 // CreationTime: The time when this table was created, in milliseconds 6779 // since the epoch. 6780 CreationTime int64 `json:"creationTime,omitempty,string"` 6781 6782 // ExpirationTime: [Optional] The time when this table expires, in 6783 // milliseconds since the epoch. If not present, the table will persist 6784 // indefinitely. Expired tables will be deleted and their storage 6785 // reclaimed. 6786 ExpirationTime int64 `json:"expirationTime,omitempty,string"` 6787 6788 // FriendlyName: The user-friendly name for this table. 6789 FriendlyName string `json:"friendlyName,omitempty"` 6790 6791 // Id: An opaque ID of the table 6792 Id string `json:"id,omitempty"` 6793 6794 // Kind: The resource type. 6795 Kind string `json:"kind,omitempty"` 6796 6797 // Labels: The labels associated with this table. You can use these to 6798 // organize and group your tables. 6799 Labels map[string]string `json:"labels,omitempty"` 6800 6801 // RangePartitioning: The range partitioning specification for this 6802 // table, if configured. 6803 RangePartitioning *RangePartitioning `json:"rangePartitioning,omitempty"` 6804 6805 // TableReference: A reference uniquely identifying the table. 6806 TableReference *TableReference `json:"tableReference,omitempty"` 6807 6808 // TimePartitioning: The time-based partitioning specification for this 6809 // table, if configured. 6810 TimePartitioning *TimePartitioning `json:"timePartitioning,omitempty"` 6811 6812 // Type: The type of table. Possible values are: TABLE, VIEW. 6813 Type string `json:"type,omitempty"` 6814 6815 // View: Additional details for a view. 6816 View *TableListTablesView `json:"view,omitempty"` 6817 6818 // ForceSendFields is a list of field names (e.g. "Clustering") to 6819 // unconditionally include in API requests. By default, fields with 6820 // empty values are omitted from API requests. However, any non-pointer, 6821 // non-interface field appearing in ForceSendFields will be sent to the 6822 // server regardless of whether the field is empty or not. This may be 6823 // used to include empty fields in Patch requests. 6824 ForceSendFields []string `json:"-"` 6825 6826 // NullFields is a list of field names (e.g. "Clustering") to include in 6827 // API requests with the JSON null value. By default, fields with empty 6828 // values are omitted from API requests. However, any field with an 6829 // empty value appearing in NullFields will be sent to the server as 6830 // null. It is an error if a field in this list has a non-empty value. 6831 // This may be used to include null fields in Patch requests. 6832 NullFields []string `json:"-"` 6833} 6834 6835func (s *TableListTables) MarshalJSON() ([]byte, error) { 6836 type NoMethod TableListTables 6837 raw := NoMethod(*s) 6838 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6839} 6840 6841// TableListTablesView: Additional details for a view. 6842type TableListTablesView struct { 6843 // UseLegacySql: True if view is defined in legacy SQL dialect, false if 6844 // in standard SQL. 6845 UseLegacySql bool `json:"useLegacySql,omitempty"` 6846 6847 // ForceSendFields is a list of field names (e.g. "UseLegacySql") to 6848 // unconditionally include in API requests. By default, fields with 6849 // empty values are omitted from API requests. However, any non-pointer, 6850 // non-interface field appearing in ForceSendFields will be sent to the 6851 // server regardless of whether the field is empty or not. This may be 6852 // used to include empty fields in Patch requests. 6853 ForceSendFields []string `json:"-"` 6854 6855 // NullFields is a list of field names (e.g. "UseLegacySql") to include 6856 // in API requests with the JSON null value. By default, fields with 6857 // empty values are omitted from API requests. However, any field with 6858 // an empty value appearing in NullFields will be sent to the server as 6859 // null. It is an error if a field in this list has a non-empty value. 6860 // This may be used to include null fields in Patch requests. 6861 NullFields []string `json:"-"` 6862} 6863 6864func (s *TableListTablesView) MarshalJSON() ([]byte, error) { 6865 type NoMethod TableListTablesView 6866 raw := NoMethod(*s) 6867 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6868} 6869 6870type TableReference struct { 6871 // DatasetId: [Required] The ID of the dataset containing this table. 6872 DatasetId string `json:"datasetId,omitempty"` 6873 6874 // ProjectId: [Required] The ID of the project containing this table. 6875 ProjectId string `json:"projectId,omitempty"` 6876 6877 // TableId: [Required] The ID of the table. The ID must contain only 6878 // letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum 6879 // length is 1,024 characters. 6880 TableId string `json:"tableId,omitempty"` 6881 6882 // ForceSendFields is a list of field names (e.g. "DatasetId") to 6883 // unconditionally include in API requests. By default, fields with 6884 // empty values are omitted from API requests. However, any non-pointer, 6885 // non-interface field appearing in ForceSendFields will be sent to the 6886 // server regardless of whether the field is empty or not. This may be 6887 // used to include empty fields in Patch requests. 6888 ForceSendFields []string `json:"-"` 6889 6890 // NullFields is a list of field names (e.g. "DatasetId") to include in 6891 // API requests with the JSON null value. By default, fields with empty 6892 // values are omitted from API requests. However, any field with an 6893 // empty value appearing in NullFields will be sent to the server as 6894 // null. It is an error if a field in this list has a non-empty value. 6895 // This may be used to include null fields in Patch requests. 6896 NullFields []string `json:"-"` 6897} 6898 6899func (s *TableReference) MarshalJSON() ([]byte, error) { 6900 type NoMethod TableReference 6901 raw := NoMethod(*s) 6902 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6903} 6904 6905type TableRow struct { 6906 // F: Represents a single row in the result set, consisting of one or 6907 // more fields. 6908 F []*TableCell `json:"f,omitempty"` 6909 6910 // ForceSendFields is a list of field names (e.g. "F") to 6911 // unconditionally include in API requests. By default, fields with 6912 // empty values are omitted from API requests. However, any non-pointer, 6913 // non-interface field appearing in ForceSendFields will be sent to the 6914 // server regardless of whether the field is empty or not. This may be 6915 // used to include empty fields in Patch requests. 6916 ForceSendFields []string `json:"-"` 6917 6918 // NullFields is a list of field names (e.g. "F") to include in API 6919 // requests with the JSON null value. By default, fields with empty 6920 // values are omitted from API requests. However, any field with an 6921 // empty value appearing in NullFields will be sent to the server as 6922 // null. It is an error if a field in this list has a non-empty value. 6923 // This may be used to include null fields in Patch requests. 6924 NullFields []string `json:"-"` 6925} 6926 6927func (s *TableRow) MarshalJSON() ([]byte, error) { 6928 type NoMethod TableRow 6929 raw := NoMethod(*s) 6930 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6931} 6932 6933type TableSchema struct { 6934 // Fields: Describes the fields in a table. 6935 Fields []*TableFieldSchema `json:"fields,omitempty"` 6936 6937 // ForceSendFields is a list of field names (e.g. "Fields") to 6938 // unconditionally include in API requests. By default, fields with 6939 // empty values are omitted from API requests. However, any non-pointer, 6940 // non-interface field appearing in ForceSendFields will be sent to the 6941 // server regardless of whether the field is empty or not. This may be 6942 // used to include empty fields in Patch requests. 6943 ForceSendFields []string `json:"-"` 6944 6945 // NullFields is a list of field names (e.g. "Fields") to include in API 6946 // requests with the JSON null value. By default, fields with empty 6947 // values are omitted from API requests. However, any field with an 6948 // empty value appearing in NullFields will be sent to the server as 6949 // null. It is an error if a field in this list has a non-empty value. 6950 // This may be used to include null fields in Patch requests. 6951 NullFields []string `json:"-"` 6952} 6953 6954func (s *TableSchema) MarshalJSON() ([]byte, error) { 6955 type NoMethod TableSchema 6956 raw := NoMethod(*s) 6957 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6958} 6959 6960// TestIamPermissionsRequest: Request message for `TestIamPermissions` 6961// method. 6962type TestIamPermissionsRequest struct { 6963 // Permissions: The set of permissions to check for the `resource`. 6964 // Permissions with 6965 // wildcards (such as '*' or 'storage.*') are not allowed. For 6966 // more 6967 // information see 6968 // [IAM 6969 // Overview](https://cloud.google.com/iam/docs/overview#permissions). 6970 Permissions []string `json:"permissions,omitempty"` 6971 6972 // ForceSendFields is a list of field names (e.g. "Permissions") to 6973 // unconditionally include in API requests. By default, fields with 6974 // empty values are omitted from API requests. However, any non-pointer, 6975 // non-interface field appearing in ForceSendFields will be sent to the 6976 // server regardless of whether the field is empty or not. This may be 6977 // used to include empty fields in Patch requests. 6978 ForceSendFields []string `json:"-"` 6979 6980 // NullFields is a list of field names (e.g. "Permissions") to include 6981 // in API requests with the JSON null value. By default, fields with 6982 // empty values are omitted from API requests. However, any field with 6983 // an empty value appearing in NullFields will be sent to the server as 6984 // null. It is an error if a field in this list has a non-empty value. 6985 // This may be used to include null fields in Patch requests. 6986 NullFields []string `json:"-"` 6987} 6988 6989func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) { 6990 type NoMethod TestIamPermissionsRequest 6991 raw := NoMethod(*s) 6992 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6993} 6994 6995// TestIamPermissionsResponse: Response message for `TestIamPermissions` 6996// method. 6997type TestIamPermissionsResponse struct { 6998 // Permissions: A subset of `TestPermissionsRequest.permissions` that 6999 // the caller is 7000 // allowed. 7001 Permissions []string `json:"permissions,omitempty"` 7002 7003 // ServerResponse contains the HTTP response code and headers from the 7004 // server. 7005 googleapi.ServerResponse `json:"-"` 7006 7007 // ForceSendFields is a list of field names (e.g. "Permissions") to 7008 // unconditionally include in API requests. By default, fields with 7009 // empty values are omitted from API requests. However, any non-pointer, 7010 // non-interface field appearing in ForceSendFields will be sent to the 7011 // server regardless of whether the field is empty or not. This may be 7012 // used to include empty fields in Patch requests. 7013 ForceSendFields []string `json:"-"` 7014 7015 // NullFields is a list of field names (e.g. "Permissions") to include 7016 // in API requests with the JSON null value. By default, fields with 7017 // empty values are omitted from API requests. However, any field with 7018 // an empty value appearing in NullFields will be sent to the server as 7019 // null. It is an error if a field in this list has a non-empty value. 7020 // This may be used to include null fields in Patch requests. 7021 NullFields []string `json:"-"` 7022} 7023 7024func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) { 7025 type NoMethod TestIamPermissionsResponse 7026 raw := NoMethod(*s) 7027 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7028} 7029 7030type TimePartitioning struct { 7031 // ExpirationMs: [Optional] Number of milliseconds for which to keep the 7032 // storage for partitions in the table. The storage in a partition will 7033 // have an expiration time of its partition time plus this value. 7034 ExpirationMs int64 `json:"expirationMs,omitempty,string"` 7035 7036 // Field: [Beta] [Optional] If not set, the table is partitioned by 7037 // pseudo column, referenced via either '_PARTITIONTIME' as TIMESTAMP 7038 // type, or '_PARTITIONDATE' as DATE type. If field is specified, the 7039 // table is instead partitioned by this field. The field must be a 7040 // top-level TIMESTAMP or DATE field. Its mode must be NULLABLE or 7041 // REQUIRED. 7042 Field string `json:"field,omitempty"` 7043 7044 RequirePartitionFilter bool `json:"requirePartitionFilter,omitempty"` 7045 7046 // Type: [Required] The only type supported is DAY, which will generate 7047 // one partition per day. 7048 Type string `json:"type,omitempty"` 7049 7050 // ForceSendFields is a list of field names (e.g. "ExpirationMs") to 7051 // unconditionally include in API requests. By default, fields with 7052 // empty values are omitted from API requests. However, any non-pointer, 7053 // non-interface field appearing in ForceSendFields will be sent to the 7054 // server regardless of whether the field is empty or not. This may be 7055 // used to include empty fields in Patch requests. 7056 ForceSendFields []string `json:"-"` 7057 7058 // NullFields is a list of field names (e.g. "ExpirationMs") to include 7059 // in API requests with the JSON null value. By default, fields with 7060 // empty values are omitted from API requests. However, any field with 7061 // an empty value appearing in NullFields will be sent to the server as 7062 // null. It is an error if a field in this list has a non-empty value. 7063 // This may be used to include null fields in Patch requests. 7064 NullFields []string `json:"-"` 7065} 7066 7067func (s *TimePartitioning) MarshalJSON() ([]byte, error) { 7068 type NoMethod TimePartitioning 7069 raw := NoMethod(*s) 7070 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7071} 7072 7073type TrainingOptions struct { 7074 // BatchSize: Batch size for dnn models. 7075 BatchSize int64 `json:"batchSize,omitempty,string"` 7076 7077 // DataSplitColumn: The column to split data with. This column won't be 7078 // used as a 7079 // feature. 7080 // 1. When data_split_method is CUSTOM, the corresponding column 7081 // should 7082 // be boolean. The rows with true value tag are eval data, and the 7083 // false 7084 // are training data. 7085 // 2. When data_split_method is SEQ, the first 7086 // DATA_SPLIT_EVAL_FRACTION 7087 // rows (from smallest to largest) in the corresponding column are 7088 // used 7089 // as training data, and the rest are eval data. It respects the 7090 // order 7091 // in Orderable data 7092 // types: 7093 // https://cloud.google.com/bigquery/docs/reference/standard-sql/d 7094 // ata-types#data-type-properties 7095 DataSplitColumn string `json:"dataSplitColumn,omitempty"` 7096 7097 // DataSplitEvalFraction: The fraction of evaluation data over the whole 7098 // input data. The rest 7099 // of data will be used as training data. The format should be 7100 // double. 7101 // Accurate to two decimal places. 7102 // Default value is 0.2. 7103 DataSplitEvalFraction float64 `json:"dataSplitEvalFraction,omitempty"` 7104 7105 // DataSplitMethod: The data split type for training and evaluation, 7106 // e.g. RANDOM. 7107 // 7108 // Possible values: 7109 // "DATA_SPLIT_METHOD_UNSPECIFIED" 7110 // "RANDOM" - Splits data randomly. 7111 // "CUSTOM" - Splits data with the user provided tags. 7112 // "SEQUENTIAL" - Splits data sequentially. 7113 // "NO_SPLIT" - Data split will be skipped. 7114 // "AUTO_SPLIT" - Splits data automatically: Uses NO_SPLIT if the data 7115 // size is small. 7116 // Otherwise uses RANDOM. 7117 DataSplitMethod string `json:"dataSplitMethod,omitempty"` 7118 7119 // DistanceType: Distance type for clustering models. 7120 // 7121 // Possible values: 7122 // "DISTANCE_TYPE_UNSPECIFIED" 7123 // "EUCLIDEAN" - Eculidean distance. 7124 // "COSINE" - Cosine distance. 7125 DistanceType string `json:"distanceType,omitempty"` 7126 7127 // Dropout: Dropout probability for dnn models. 7128 Dropout float64 `json:"dropout,omitempty"` 7129 7130 // EarlyStop: Whether to stop early when the loss doesn't improve 7131 // significantly 7132 // any more (compared to min_relative_progress). Used only for 7133 // iterative 7134 // training algorithms. 7135 EarlyStop bool `json:"earlyStop,omitempty"` 7136 7137 // FeedbackType: Feedback type that specifies which algorithm to run for 7138 // matrix 7139 // factorization. 7140 // 7141 // Possible values: 7142 // "FEEDBACK_TYPE_UNSPECIFIED" 7143 // "IMPLICIT" - Use weighted-als for implicit feedback problems. 7144 // "EXPLICIT" - Use nonweighted-als for explicit feedback problems. 7145 FeedbackType string `json:"feedbackType,omitempty"` 7146 7147 // HiddenUnits: Hidden units for dnn models. 7148 HiddenUnits googleapi.Int64s `json:"hiddenUnits,omitempty"` 7149 7150 // InitialLearnRate: Specifies the initial learning rate for the line 7151 // search learn rate 7152 // strategy. 7153 InitialLearnRate float64 `json:"initialLearnRate,omitempty"` 7154 7155 // InputLabelColumns: Name of input label columns in training data. 7156 InputLabelColumns []string `json:"inputLabelColumns,omitempty"` 7157 7158 // ItemColumn: Item column specified for matrix factorization models. 7159 ItemColumn string `json:"itemColumn,omitempty"` 7160 7161 // KmeansInitializationColumn: The column used to provide the initial 7162 // centroids for kmeans algorithm 7163 // when kmeans_initialization_method is CUSTOM. 7164 KmeansInitializationColumn string `json:"kmeansInitializationColumn,omitempty"` 7165 7166 // KmeansInitializationMethod: The method used to initialize the 7167 // centroids for kmeans algorithm. 7168 // 7169 // Possible values: 7170 // "KMEANS_INITIALIZATION_METHOD_UNSPECIFIED" 7171 // "RANDOM" - Initializes the centroids randomly. 7172 // "CUSTOM" - Initializes the centroids using data specified 7173 // in 7174 // kmeans_initialization_column. 7175 // "KMEANS_PLUS_PLUS" - Initializes with kmeans++. 7176 KmeansInitializationMethod string `json:"kmeansInitializationMethod,omitempty"` 7177 7178 // L1Regularization: L1 regularization coefficient. 7179 L1Regularization float64 `json:"l1Regularization,omitempty"` 7180 7181 // L2Regularization: L2 regularization coefficient. 7182 L2Regularization float64 `json:"l2Regularization,omitempty"` 7183 7184 // LabelClassWeights: Weights associated with each label class, for 7185 // rebalancing the 7186 // training data. Only applicable for classification models. 7187 LabelClassWeights map[string]float64 `json:"labelClassWeights,omitempty"` 7188 7189 // LearnRate: Learning rate in training. Used only for iterative 7190 // training algorithms. 7191 LearnRate float64 `json:"learnRate,omitempty"` 7192 7193 // LearnRateStrategy: The strategy to determine learn rate for the 7194 // current iteration. 7195 // 7196 // Possible values: 7197 // "LEARN_RATE_STRATEGY_UNSPECIFIED" 7198 // "LINE_SEARCH" - Use line search to determine learning rate. 7199 // "CONSTANT" - Use a constant learning rate. 7200 LearnRateStrategy string `json:"learnRateStrategy,omitempty"` 7201 7202 // LossType: Type of loss function used during training run. 7203 // 7204 // Possible values: 7205 // "LOSS_TYPE_UNSPECIFIED" 7206 // "MEAN_SQUARED_LOSS" - Mean squared loss, used for linear 7207 // regression. 7208 // "MEAN_LOG_LOSS" - Mean log loss, used for logistic regression. 7209 LossType string `json:"lossType,omitempty"` 7210 7211 // MaxIterations: The maximum number of iterations in training. Used 7212 // only for iterative 7213 // training algorithms. 7214 MaxIterations int64 `json:"maxIterations,omitempty,string"` 7215 7216 // MaxTreeDepth: Maximum depth of a tree for boosted tree models. 7217 MaxTreeDepth int64 `json:"maxTreeDepth,omitempty,string"` 7218 7219 // MinRelativeProgress: When early_stop is true, stops training when 7220 // accuracy improvement is 7221 // less than 'min_relative_progress'. Used only for iterative 7222 // training 7223 // algorithms. 7224 MinRelativeProgress float64 `json:"minRelativeProgress,omitempty"` 7225 7226 // MinSplitLoss: Minimum split loss for boosted tree models. 7227 MinSplitLoss float64 `json:"minSplitLoss,omitempty"` 7228 7229 // ModelUri: [Beta] Google Cloud Storage URI from which the model was 7230 // imported. Only 7231 // applicable for imported models. 7232 ModelUri string `json:"modelUri,omitempty"` 7233 7234 // NumClusters: Number of clusters for clustering models. 7235 NumClusters int64 `json:"numClusters,omitempty,string"` 7236 7237 // NumFactors: Num factors specified for matrix factorization models. 7238 NumFactors int64 `json:"numFactors,omitempty,string"` 7239 7240 // OptimizationStrategy: Optimization strategy for training linear 7241 // regression models. 7242 // 7243 // Possible values: 7244 // "OPTIMIZATION_STRATEGY_UNSPECIFIED" 7245 // "BATCH_GRADIENT_DESCENT" - Uses an iterative batch gradient descent 7246 // algorithm. 7247 // "NORMAL_EQUATION" - Uses a normal equation to solve linear 7248 // regression problem. 7249 OptimizationStrategy string `json:"optimizationStrategy,omitempty"` 7250 7251 // PreserveInputStructs: Whether to preserve the input structs in output 7252 // feature names. 7253 // Suppose there is a struct A with field b. 7254 // When false (default), the output feature name is A_b. 7255 // When true, the output feature name is A.b. 7256 PreserveInputStructs bool `json:"preserveInputStructs,omitempty"` 7257 7258 // Subsample: Subsample fraction of the training data to grow tree to 7259 // prevent 7260 // overfitting for boosted tree models. 7261 Subsample float64 `json:"subsample,omitempty"` 7262 7263 // UserColumn: User column specified for matrix factorization models. 7264 UserColumn string `json:"userColumn,omitempty"` 7265 7266 // WalsAlpha: Hyperparameter for matrix factoration when implicit 7267 // feedback type is 7268 // specified. 7269 WalsAlpha float64 `json:"walsAlpha,omitempty"` 7270 7271 // WarmStart: Whether to train a model from the last checkpoint. 7272 WarmStart bool `json:"warmStart,omitempty"` 7273 7274 // ForceSendFields is a list of field names (e.g. "BatchSize") to 7275 // unconditionally include in API requests. By default, fields with 7276 // empty values are omitted from API requests. However, any non-pointer, 7277 // non-interface field appearing in ForceSendFields will be sent to the 7278 // server regardless of whether the field is empty or not. This may be 7279 // used to include empty fields in Patch requests. 7280 ForceSendFields []string `json:"-"` 7281 7282 // NullFields is a list of field names (e.g. "BatchSize") to include in 7283 // API requests with the JSON null value. By default, fields with empty 7284 // values are omitted from API requests. However, any field with an 7285 // empty value appearing in NullFields will be sent to the server as 7286 // null. It is an error if a field in this list has a non-empty value. 7287 // This may be used to include null fields in Patch requests. 7288 NullFields []string `json:"-"` 7289} 7290 7291func (s *TrainingOptions) MarshalJSON() ([]byte, error) { 7292 type NoMethod TrainingOptions 7293 raw := NoMethod(*s) 7294 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7295} 7296 7297func (s *TrainingOptions) UnmarshalJSON(data []byte) error { 7298 type NoMethod TrainingOptions 7299 var s1 struct { 7300 DataSplitEvalFraction gensupport.JSONFloat64 `json:"dataSplitEvalFraction"` 7301 Dropout gensupport.JSONFloat64 `json:"dropout"` 7302 InitialLearnRate gensupport.JSONFloat64 `json:"initialLearnRate"` 7303 L1Regularization gensupport.JSONFloat64 `json:"l1Regularization"` 7304 L2Regularization gensupport.JSONFloat64 `json:"l2Regularization"` 7305 LearnRate gensupport.JSONFloat64 `json:"learnRate"` 7306 MinRelativeProgress gensupport.JSONFloat64 `json:"minRelativeProgress"` 7307 MinSplitLoss gensupport.JSONFloat64 `json:"minSplitLoss"` 7308 Subsample gensupport.JSONFloat64 `json:"subsample"` 7309 WalsAlpha gensupport.JSONFloat64 `json:"walsAlpha"` 7310 *NoMethod 7311 } 7312 s1.NoMethod = (*NoMethod)(s) 7313 if err := json.Unmarshal(data, &s1); err != nil { 7314 return err 7315 } 7316 s.DataSplitEvalFraction = float64(s1.DataSplitEvalFraction) 7317 s.Dropout = float64(s1.Dropout) 7318 s.InitialLearnRate = float64(s1.InitialLearnRate) 7319 s.L1Regularization = float64(s1.L1Regularization) 7320 s.L2Regularization = float64(s1.L2Regularization) 7321 s.LearnRate = float64(s1.LearnRate) 7322 s.MinRelativeProgress = float64(s1.MinRelativeProgress) 7323 s.MinSplitLoss = float64(s1.MinSplitLoss) 7324 s.Subsample = float64(s1.Subsample) 7325 s.WalsAlpha = float64(s1.WalsAlpha) 7326 return nil 7327} 7328 7329// TrainingRun: Information about a single training query run for the 7330// model. 7331type TrainingRun struct { 7332 // DataSplitResult: Data split result of the training run. Only set when 7333 // the input data is 7334 // actually split. 7335 DataSplitResult *DataSplitResult `json:"dataSplitResult,omitempty"` 7336 7337 // EvaluationMetrics: The evaluation metrics over training/eval data 7338 // that were computed at the 7339 // end of training. 7340 EvaluationMetrics *EvaluationMetrics `json:"evaluationMetrics,omitempty"` 7341 7342 // Results: Output of each iteration run, results.size() <= 7343 // max_iterations. 7344 Results []*IterationResult `json:"results,omitempty"` 7345 7346 // StartTime: The start time of this training run. 7347 StartTime string `json:"startTime,omitempty"` 7348 7349 // TrainingOptions: Options that were used for this training run, 7350 // includes 7351 // user specified and default options that were used. 7352 TrainingOptions *TrainingOptions `json:"trainingOptions,omitempty"` 7353 7354 // ForceSendFields is a list of field names (e.g. "DataSplitResult") to 7355 // unconditionally include in API requests. By default, fields with 7356 // empty values are omitted from API requests. However, any non-pointer, 7357 // non-interface field appearing in ForceSendFields will be sent to the 7358 // server regardless of whether the field is empty or not. This may be 7359 // used to include empty fields in Patch requests. 7360 ForceSendFields []string `json:"-"` 7361 7362 // NullFields is a list of field names (e.g. "DataSplitResult") to 7363 // include in API requests with the JSON null value. By default, fields 7364 // with empty values are omitted from API requests. However, any field 7365 // with an empty value appearing in NullFields will be sent to the 7366 // server as null. It is an error if a field in this list has a 7367 // non-empty value. This may be used to include null fields in Patch 7368 // requests. 7369 NullFields []string `json:"-"` 7370} 7371 7372func (s *TrainingRun) MarshalJSON() ([]byte, error) { 7373 type NoMethod TrainingRun 7374 raw := NoMethod(*s) 7375 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7376} 7377 7378// UserDefinedFunctionResource: This is used for defining User Defined 7379// Function (UDF) resources only when using legacy SQL. Users of 7380// Standard SQL should leverage either DDL (e.g. CREATE [TEMPORARY] 7381// FUNCTION ... ) or the Routines API to define UDF resources. For 7382// additional information on migrating, see: 7383// https://cloud.google.com/bigquery/docs/reference/standard-sql/migrating-from-legacy-sql#differences_in_user-defined_javascript_functions 7384type UserDefinedFunctionResource struct { 7385 // InlineCode: [Pick one] An inline resource that contains code for a 7386 // user-defined function (UDF). Providing a inline code resource is 7387 // equivalent to providing a URI for a file containing the same code. 7388 InlineCode string `json:"inlineCode,omitempty"` 7389 7390 // ResourceUri: [Pick one] A code resource to load from a Google Cloud 7391 // Storage URI (gs://bucket/path). 7392 ResourceUri string `json:"resourceUri,omitempty"` 7393 7394 // ForceSendFields is a list of field names (e.g. "InlineCode") to 7395 // unconditionally include in API requests. By default, fields with 7396 // empty values are omitted from API requests. However, any non-pointer, 7397 // non-interface field appearing in ForceSendFields will be sent to the 7398 // server regardless of whether the field is empty or not. This may be 7399 // used to include empty fields in Patch requests. 7400 ForceSendFields []string `json:"-"` 7401 7402 // NullFields is a list of field names (e.g. "InlineCode") to include in 7403 // API requests with the JSON null value. By default, fields with empty 7404 // values are omitted from API requests. However, any field with an 7405 // empty value appearing in NullFields will be sent to the server as 7406 // null. It is an error if a field in this list has a non-empty value. 7407 // This may be used to include null fields in Patch requests. 7408 NullFields []string `json:"-"` 7409} 7410 7411func (s *UserDefinedFunctionResource) MarshalJSON() ([]byte, error) { 7412 type NoMethod UserDefinedFunctionResource 7413 raw := NoMethod(*s) 7414 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7415} 7416 7417type ViewDefinition struct { 7418 // Query: [Required] A query that BigQuery executes when the view is 7419 // referenced. 7420 Query string `json:"query,omitempty"` 7421 7422 // UseLegacySql: Specifies whether to use BigQuery's legacy SQL for this 7423 // view. The default value is true. If set to false, the view will use 7424 // BigQuery's standard SQL: 7425 // https://cloud.google.com/bigquery/sql-reference/ Queries and views 7426 // that reference this view must use the same flag value. 7427 UseLegacySql bool `json:"useLegacySql,omitempty"` 7428 7429 // UserDefinedFunctionResources: Describes user-defined function 7430 // resources used in the query. 7431 UserDefinedFunctionResources []*UserDefinedFunctionResource `json:"userDefinedFunctionResources,omitempty"` 7432 7433 // ForceSendFields is a list of field names (e.g. "Query") to 7434 // unconditionally include in API requests. By default, fields with 7435 // empty values are omitted from API requests. However, any non-pointer, 7436 // non-interface field appearing in ForceSendFields will be sent to the 7437 // server regardless of whether the field is empty or not. This may be 7438 // used to include empty fields in Patch requests. 7439 ForceSendFields []string `json:"-"` 7440 7441 // NullFields is a list of field names (e.g. "Query") to include in API 7442 // requests with the JSON null value. By default, fields with empty 7443 // values are omitted from API requests. However, any field with an 7444 // empty value appearing in NullFields will be sent to the server as 7445 // null. It is an error if a field in this list has a non-empty value. 7446 // This may be used to include null fields in Patch requests. 7447 NullFields []string `json:"-"` 7448} 7449 7450func (s *ViewDefinition) MarshalJSON() ([]byte, error) { 7451 type NoMethod ViewDefinition 7452 raw := NoMethod(*s) 7453 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 7454} 7455 7456// method id "bigquery.datasets.delete": 7457 7458type DatasetsDeleteCall struct { 7459 s *Service 7460 projectId string 7461 datasetId string 7462 urlParams_ gensupport.URLParams 7463 ctx_ context.Context 7464 header_ http.Header 7465} 7466 7467// Delete: Deletes the dataset specified by the datasetId value. Before 7468// you can delete a dataset, you must delete all its tables, either 7469// manually or by specifying deleteContents. Immediately after deletion, 7470// you can create another dataset with the same name. 7471func (r *DatasetsService) Delete(projectId string, datasetId string) *DatasetsDeleteCall { 7472 c := &DatasetsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7473 c.projectId = projectId 7474 c.datasetId = datasetId 7475 return c 7476} 7477 7478// DeleteContents sets the optional parameter "deleteContents": If True, 7479// delete all the tables in the dataset. If False and the dataset 7480// contains tables, the request will fail. Default is False 7481func (c *DatasetsDeleteCall) DeleteContents(deleteContents bool) *DatasetsDeleteCall { 7482 c.urlParams_.Set("deleteContents", fmt.Sprint(deleteContents)) 7483 return c 7484} 7485 7486// Fields allows partial responses to be retrieved. See 7487// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7488// for more information. 7489func (c *DatasetsDeleteCall) Fields(s ...googleapi.Field) *DatasetsDeleteCall { 7490 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7491 return c 7492} 7493 7494// Context sets the context to be used in this call's Do method. Any 7495// pending HTTP request will be aborted if the provided context is 7496// canceled. 7497func (c *DatasetsDeleteCall) Context(ctx context.Context) *DatasetsDeleteCall { 7498 c.ctx_ = ctx 7499 return c 7500} 7501 7502// Header returns an http.Header that can be modified by the caller to 7503// add HTTP headers to the request. 7504func (c *DatasetsDeleteCall) Header() http.Header { 7505 if c.header_ == nil { 7506 c.header_ = make(http.Header) 7507 } 7508 return c.header_ 7509} 7510 7511func (c *DatasetsDeleteCall) doRequest(alt string) (*http.Response, error) { 7512 reqHeaders := make(http.Header) 7513 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 7514 for k, v := range c.header_ { 7515 reqHeaders[k] = v 7516 } 7517 reqHeaders.Set("User-Agent", c.s.userAgent()) 7518 var body io.Reader = nil 7519 c.urlParams_.Set("alt", alt) 7520 c.urlParams_.Set("prettyPrint", "false") 7521 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets/{datasetId}") 7522 urls += "?" + c.urlParams_.Encode() 7523 req, err := http.NewRequest("DELETE", urls, body) 7524 if err != nil { 7525 return nil, err 7526 } 7527 req.Header = reqHeaders 7528 googleapi.Expand(req.URL, map[string]string{ 7529 "projectId": c.projectId, 7530 "datasetId": c.datasetId, 7531 }) 7532 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7533} 7534 7535// Do executes the "bigquery.datasets.delete" call. 7536func (c *DatasetsDeleteCall) Do(opts ...googleapi.CallOption) error { 7537 gensupport.SetOptions(c.urlParams_, opts...) 7538 res, err := c.doRequest("json") 7539 if err != nil { 7540 return err 7541 } 7542 defer googleapi.CloseBody(res) 7543 if err := googleapi.CheckResponse(res); err != nil { 7544 return err 7545 } 7546 return nil 7547 // { 7548 // "description": "Deletes the dataset specified by the datasetId value. Before you can delete a dataset, you must delete all its tables, either manually or by specifying deleteContents. Immediately after deletion, you can create another dataset with the same name.", 7549 // "httpMethod": "DELETE", 7550 // "id": "bigquery.datasets.delete", 7551 // "parameterOrder": [ 7552 // "projectId", 7553 // "datasetId" 7554 // ], 7555 // "parameters": { 7556 // "datasetId": { 7557 // "description": "Dataset ID of dataset being deleted", 7558 // "location": "path", 7559 // "required": true, 7560 // "type": "string" 7561 // }, 7562 // "deleteContents": { 7563 // "description": "If True, delete all the tables in the dataset. If False and the dataset contains tables, the request will fail. Default is False", 7564 // "location": "query", 7565 // "type": "boolean" 7566 // }, 7567 // "projectId": { 7568 // "description": "Project ID of the dataset being deleted", 7569 // "location": "path", 7570 // "required": true, 7571 // "type": "string" 7572 // } 7573 // }, 7574 // "path": "projects/{projectId}/datasets/{datasetId}", 7575 // "scopes": [ 7576 // "https://www.googleapis.com/auth/bigquery", 7577 // "https://www.googleapis.com/auth/cloud-platform" 7578 // ] 7579 // } 7580 7581} 7582 7583// method id "bigquery.datasets.get": 7584 7585type DatasetsGetCall struct { 7586 s *Service 7587 projectId string 7588 datasetId string 7589 urlParams_ gensupport.URLParams 7590 ifNoneMatch_ string 7591 ctx_ context.Context 7592 header_ http.Header 7593} 7594 7595// Get: Returns the dataset specified by datasetID. 7596func (r *DatasetsService) Get(projectId string, datasetId string) *DatasetsGetCall { 7597 c := &DatasetsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7598 c.projectId = projectId 7599 c.datasetId = datasetId 7600 return c 7601} 7602 7603// Fields allows partial responses to be retrieved. See 7604// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7605// for more information. 7606func (c *DatasetsGetCall) Fields(s ...googleapi.Field) *DatasetsGetCall { 7607 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7608 return c 7609} 7610 7611// IfNoneMatch sets the optional parameter which makes the operation 7612// fail if the object's ETag matches the given value. This is useful for 7613// getting updates only after the object has changed since the last 7614// request. Use googleapi.IsNotModified to check whether the response 7615// error from Do is the result of In-None-Match. 7616func (c *DatasetsGetCall) IfNoneMatch(entityTag string) *DatasetsGetCall { 7617 c.ifNoneMatch_ = entityTag 7618 return c 7619} 7620 7621// Context sets the context to be used in this call's Do method. Any 7622// pending HTTP request will be aborted if the provided context is 7623// canceled. 7624func (c *DatasetsGetCall) Context(ctx context.Context) *DatasetsGetCall { 7625 c.ctx_ = ctx 7626 return c 7627} 7628 7629// Header returns an http.Header that can be modified by the caller to 7630// add HTTP headers to the request. 7631func (c *DatasetsGetCall) Header() http.Header { 7632 if c.header_ == nil { 7633 c.header_ = make(http.Header) 7634 } 7635 return c.header_ 7636} 7637 7638func (c *DatasetsGetCall) doRequest(alt string) (*http.Response, error) { 7639 reqHeaders := make(http.Header) 7640 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 7641 for k, v := range c.header_ { 7642 reqHeaders[k] = v 7643 } 7644 reqHeaders.Set("User-Agent", c.s.userAgent()) 7645 if c.ifNoneMatch_ != "" { 7646 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7647 } 7648 var body io.Reader = nil 7649 c.urlParams_.Set("alt", alt) 7650 c.urlParams_.Set("prettyPrint", "false") 7651 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets/{datasetId}") 7652 urls += "?" + c.urlParams_.Encode() 7653 req, err := http.NewRequest("GET", urls, body) 7654 if err != nil { 7655 return nil, err 7656 } 7657 req.Header = reqHeaders 7658 googleapi.Expand(req.URL, map[string]string{ 7659 "projectId": c.projectId, 7660 "datasetId": c.datasetId, 7661 }) 7662 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7663} 7664 7665// Do executes the "bigquery.datasets.get" call. 7666// Exactly one of *Dataset or error will be non-nil. Any non-2xx status 7667// code is an error. Response headers are in either 7668// *Dataset.ServerResponse.Header or (if a response was returned at all) 7669// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 7670// check whether the returned error was because http.StatusNotModified 7671// was returned. 7672func (c *DatasetsGetCall) Do(opts ...googleapi.CallOption) (*Dataset, error) { 7673 gensupport.SetOptions(c.urlParams_, opts...) 7674 res, err := c.doRequest("json") 7675 if res != nil && res.StatusCode == http.StatusNotModified { 7676 if res.Body != nil { 7677 res.Body.Close() 7678 } 7679 return nil, &googleapi.Error{ 7680 Code: res.StatusCode, 7681 Header: res.Header, 7682 } 7683 } 7684 if err != nil { 7685 return nil, err 7686 } 7687 defer googleapi.CloseBody(res) 7688 if err := googleapi.CheckResponse(res); err != nil { 7689 return nil, err 7690 } 7691 ret := &Dataset{ 7692 ServerResponse: googleapi.ServerResponse{ 7693 Header: res.Header, 7694 HTTPStatusCode: res.StatusCode, 7695 }, 7696 } 7697 target := &ret 7698 if err := gensupport.DecodeResponse(target, res); err != nil { 7699 return nil, err 7700 } 7701 return ret, nil 7702 // { 7703 // "description": "Returns the dataset specified by datasetID.", 7704 // "httpMethod": "GET", 7705 // "id": "bigquery.datasets.get", 7706 // "parameterOrder": [ 7707 // "projectId", 7708 // "datasetId" 7709 // ], 7710 // "parameters": { 7711 // "datasetId": { 7712 // "description": "Dataset ID of the requested dataset", 7713 // "location": "path", 7714 // "required": true, 7715 // "type": "string" 7716 // }, 7717 // "projectId": { 7718 // "description": "Project ID of the requested dataset", 7719 // "location": "path", 7720 // "required": true, 7721 // "type": "string" 7722 // } 7723 // }, 7724 // "path": "projects/{projectId}/datasets/{datasetId}", 7725 // "response": { 7726 // "$ref": "Dataset" 7727 // }, 7728 // "scopes": [ 7729 // "https://www.googleapis.com/auth/bigquery", 7730 // "https://www.googleapis.com/auth/bigquery.readonly", 7731 // "https://www.googleapis.com/auth/cloud-platform", 7732 // "https://www.googleapis.com/auth/cloud-platform.read-only" 7733 // ] 7734 // } 7735 7736} 7737 7738// method id "bigquery.datasets.insert": 7739 7740type DatasetsInsertCall struct { 7741 s *Service 7742 projectId string 7743 dataset *Dataset 7744 urlParams_ gensupport.URLParams 7745 ctx_ context.Context 7746 header_ http.Header 7747} 7748 7749// Insert: Creates a new empty dataset. 7750func (r *DatasetsService) Insert(projectId string, dataset *Dataset) *DatasetsInsertCall { 7751 c := &DatasetsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7752 c.projectId = projectId 7753 c.dataset = dataset 7754 return c 7755} 7756 7757// Fields allows partial responses to be retrieved. See 7758// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7759// for more information. 7760func (c *DatasetsInsertCall) Fields(s ...googleapi.Field) *DatasetsInsertCall { 7761 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7762 return c 7763} 7764 7765// Context sets the context to be used in this call's Do method. Any 7766// pending HTTP request will be aborted if the provided context is 7767// canceled. 7768func (c *DatasetsInsertCall) Context(ctx context.Context) *DatasetsInsertCall { 7769 c.ctx_ = ctx 7770 return c 7771} 7772 7773// Header returns an http.Header that can be modified by the caller to 7774// add HTTP headers to the request. 7775func (c *DatasetsInsertCall) Header() http.Header { 7776 if c.header_ == nil { 7777 c.header_ = make(http.Header) 7778 } 7779 return c.header_ 7780} 7781 7782func (c *DatasetsInsertCall) doRequest(alt string) (*http.Response, error) { 7783 reqHeaders := make(http.Header) 7784 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 7785 for k, v := range c.header_ { 7786 reqHeaders[k] = v 7787 } 7788 reqHeaders.Set("User-Agent", c.s.userAgent()) 7789 var body io.Reader = nil 7790 body, err := googleapi.WithoutDataWrapper.JSONReader(c.dataset) 7791 if err != nil { 7792 return nil, err 7793 } 7794 reqHeaders.Set("Content-Type", "application/json") 7795 c.urlParams_.Set("alt", alt) 7796 c.urlParams_.Set("prettyPrint", "false") 7797 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets") 7798 urls += "?" + c.urlParams_.Encode() 7799 req, err := http.NewRequest("POST", urls, body) 7800 if err != nil { 7801 return nil, err 7802 } 7803 req.Header = reqHeaders 7804 googleapi.Expand(req.URL, map[string]string{ 7805 "projectId": c.projectId, 7806 }) 7807 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7808} 7809 7810// Do executes the "bigquery.datasets.insert" call. 7811// Exactly one of *Dataset or error will be non-nil. Any non-2xx status 7812// code is an error. Response headers are in either 7813// *Dataset.ServerResponse.Header or (if a response was returned at all) 7814// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 7815// check whether the returned error was because http.StatusNotModified 7816// was returned. 7817func (c *DatasetsInsertCall) Do(opts ...googleapi.CallOption) (*Dataset, error) { 7818 gensupport.SetOptions(c.urlParams_, opts...) 7819 res, err := c.doRequest("json") 7820 if res != nil && res.StatusCode == http.StatusNotModified { 7821 if res.Body != nil { 7822 res.Body.Close() 7823 } 7824 return nil, &googleapi.Error{ 7825 Code: res.StatusCode, 7826 Header: res.Header, 7827 } 7828 } 7829 if err != nil { 7830 return nil, err 7831 } 7832 defer googleapi.CloseBody(res) 7833 if err := googleapi.CheckResponse(res); err != nil { 7834 return nil, err 7835 } 7836 ret := &Dataset{ 7837 ServerResponse: googleapi.ServerResponse{ 7838 Header: res.Header, 7839 HTTPStatusCode: res.StatusCode, 7840 }, 7841 } 7842 target := &ret 7843 if err := gensupport.DecodeResponse(target, res); err != nil { 7844 return nil, err 7845 } 7846 return ret, nil 7847 // { 7848 // "description": "Creates a new empty dataset.", 7849 // "httpMethod": "POST", 7850 // "id": "bigquery.datasets.insert", 7851 // "parameterOrder": [ 7852 // "projectId" 7853 // ], 7854 // "parameters": { 7855 // "projectId": { 7856 // "description": "Project ID of the new dataset", 7857 // "location": "path", 7858 // "required": true, 7859 // "type": "string" 7860 // } 7861 // }, 7862 // "path": "projects/{projectId}/datasets", 7863 // "request": { 7864 // "$ref": "Dataset" 7865 // }, 7866 // "response": { 7867 // "$ref": "Dataset" 7868 // }, 7869 // "scopes": [ 7870 // "https://www.googleapis.com/auth/bigquery", 7871 // "https://www.googleapis.com/auth/cloud-platform" 7872 // ] 7873 // } 7874 7875} 7876 7877// method id "bigquery.datasets.list": 7878 7879type DatasetsListCall struct { 7880 s *Service 7881 projectId string 7882 urlParams_ gensupport.URLParams 7883 ifNoneMatch_ string 7884 ctx_ context.Context 7885 header_ http.Header 7886} 7887 7888// List: Lists all datasets in the specified project to which you have 7889// been granted the READER dataset role. 7890func (r *DatasetsService) List(projectId string) *DatasetsListCall { 7891 c := &DatasetsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7892 c.projectId = projectId 7893 return c 7894} 7895 7896// All sets the optional parameter "all": Whether to list all datasets, 7897// including hidden ones 7898func (c *DatasetsListCall) All(all bool) *DatasetsListCall { 7899 c.urlParams_.Set("all", fmt.Sprint(all)) 7900 return c 7901} 7902 7903// Filter sets the optional parameter "filter": An expression for 7904// filtering the results of the request by label. The syntax is 7905// "labels.<name>[:<value>]". Multiple filters can be ANDed together by 7906// connecting with a space. Example: "labels.department:receiving 7907// labels.active". See Filtering datasets using labels for details. 7908func (c *DatasetsListCall) Filter(filter string) *DatasetsListCall { 7909 c.urlParams_.Set("filter", filter) 7910 return c 7911} 7912 7913// MaxResults sets the optional parameter "maxResults": The maximum 7914// number of results to return 7915func (c *DatasetsListCall) MaxResults(maxResults int64) *DatasetsListCall { 7916 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 7917 return c 7918} 7919 7920// PageToken sets the optional parameter "pageToken": Page token, 7921// returned by a previous call, to request the next page of results 7922func (c *DatasetsListCall) PageToken(pageToken string) *DatasetsListCall { 7923 c.urlParams_.Set("pageToken", pageToken) 7924 return c 7925} 7926 7927// Fields allows partial responses to be retrieved. See 7928// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7929// for more information. 7930func (c *DatasetsListCall) Fields(s ...googleapi.Field) *DatasetsListCall { 7931 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7932 return c 7933} 7934 7935// IfNoneMatch sets the optional parameter which makes the operation 7936// fail if the object's ETag matches the given value. This is useful for 7937// getting updates only after the object has changed since the last 7938// request. Use googleapi.IsNotModified to check whether the response 7939// error from Do is the result of In-None-Match. 7940func (c *DatasetsListCall) IfNoneMatch(entityTag string) *DatasetsListCall { 7941 c.ifNoneMatch_ = entityTag 7942 return c 7943} 7944 7945// Context sets the context to be used in this call's Do method. Any 7946// pending HTTP request will be aborted if the provided context is 7947// canceled. 7948func (c *DatasetsListCall) Context(ctx context.Context) *DatasetsListCall { 7949 c.ctx_ = ctx 7950 return c 7951} 7952 7953// Header returns an http.Header that can be modified by the caller to 7954// add HTTP headers to the request. 7955func (c *DatasetsListCall) Header() http.Header { 7956 if c.header_ == nil { 7957 c.header_ = make(http.Header) 7958 } 7959 return c.header_ 7960} 7961 7962func (c *DatasetsListCall) doRequest(alt string) (*http.Response, error) { 7963 reqHeaders := make(http.Header) 7964 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 7965 for k, v := range c.header_ { 7966 reqHeaders[k] = v 7967 } 7968 reqHeaders.Set("User-Agent", c.s.userAgent()) 7969 if c.ifNoneMatch_ != "" { 7970 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7971 } 7972 var body io.Reader = nil 7973 c.urlParams_.Set("alt", alt) 7974 c.urlParams_.Set("prettyPrint", "false") 7975 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets") 7976 urls += "?" + c.urlParams_.Encode() 7977 req, err := http.NewRequest("GET", urls, body) 7978 if err != nil { 7979 return nil, err 7980 } 7981 req.Header = reqHeaders 7982 googleapi.Expand(req.URL, map[string]string{ 7983 "projectId": c.projectId, 7984 }) 7985 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7986} 7987 7988// Do executes the "bigquery.datasets.list" call. 7989// Exactly one of *DatasetList or error will be non-nil. Any non-2xx 7990// status code is an error. Response headers are in either 7991// *DatasetList.ServerResponse.Header or (if a response was returned at 7992// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7993// to check whether the returned error was because 7994// http.StatusNotModified was returned. 7995func (c *DatasetsListCall) Do(opts ...googleapi.CallOption) (*DatasetList, error) { 7996 gensupport.SetOptions(c.urlParams_, opts...) 7997 res, err := c.doRequest("json") 7998 if res != nil && res.StatusCode == http.StatusNotModified { 7999 if res.Body != nil { 8000 res.Body.Close() 8001 } 8002 return nil, &googleapi.Error{ 8003 Code: res.StatusCode, 8004 Header: res.Header, 8005 } 8006 } 8007 if err != nil { 8008 return nil, err 8009 } 8010 defer googleapi.CloseBody(res) 8011 if err := googleapi.CheckResponse(res); err != nil { 8012 return nil, err 8013 } 8014 ret := &DatasetList{ 8015 ServerResponse: googleapi.ServerResponse{ 8016 Header: res.Header, 8017 HTTPStatusCode: res.StatusCode, 8018 }, 8019 } 8020 target := &ret 8021 if err := gensupport.DecodeResponse(target, res); err != nil { 8022 return nil, err 8023 } 8024 return ret, nil 8025 // { 8026 // "description": "Lists all datasets in the specified project to which you have been granted the READER dataset role.", 8027 // "httpMethod": "GET", 8028 // "id": "bigquery.datasets.list", 8029 // "parameterOrder": [ 8030 // "projectId" 8031 // ], 8032 // "parameters": { 8033 // "all": { 8034 // "description": "Whether to list all datasets, including hidden ones", 8035 // "location": "query", 8036 // "type": "boolean" 8037 // }, 8038 // "filter": { 8039 // "description": "An expression for filtering the results of the request by label. The syntax is \"labels.\u003cname\u003e[:\u003cvalue\u003e]\". Multiple filters can be ANDed together by connecting with a space. Example: \"labels.department:receiving labels.active\". See Filtering datasets using labels for details.", 8040 // "location": "query", 8041 // "type": "string" 8042 // }, 8043 // "maxResults": { 8044 // "description": "The maximum number of results to return", 8045 // "format": "uint32", 8046 // "location": "query", 8047 // "type": "integer" 8048 // }, 8049 // "pageToken": { 8050 // "description": "Page token, returned by a previous call, to request the next page of results", 8051 // "location": "query", 8052 // "type": "string" 8053 // }, 8054 // "projectId": { 8055 // "description": "Project ID of the datasets to be listed", 8056 // "location": "path", 8057 // "required": true, 8058 // "type": "string" 8059 // } 8060 // }, 8061 // "path": "projects/{projectId}/datasets", 8062 // "response": { 8063 // "$ref": "DatasetList" 8064 // }, 8065 // "scopes": [ 8066 // "https://www.googleapis.com/auth/bigquery", 8067 // "https://www.googleapis.com/auth/bigquery.readonly", 8068 // "https://www.googleapis.com/auth/cloud-platform", 8069 // "https://www.googleapis.com/auth/cloud-platform.read-only" 8070 // ] 8071 // } 8072 8073} 8074 8075// Pages invokes f for each page of results. 8076// A non-nil error returned from f will halt the iteration. 8077// The provided context supersedes any context provided to the Context method. 8078func (c *DatasetsListCall) Pages(ctx context.Context, f func(*DatasetList) error) error { 8079 c.ctx_ = ctx 8080 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 8081 for { 8082 x, err := c.Do() 8083 if err != nil { 8084 return err 8085 } 8086 if err := f(x); err != nil { 8087 return err 8088 } 8089 if x.NextPageToken == "" { 8090 return nil 8091 } 8092 c.PageToken(x.NextPageToken) 8093 } 8094} 8095 8096// method id "bigquery.datasets.patch": 8097 8098type DatasetsPatchCall struct { 8099 s *Service 8100 projectId string 8101 datasetId string 8102 dataset *Dataset 8103 urlParams_ gensupport.URLParams 8104 ctx_ context.Context 8105 header_ http.Header 8106} 8107 8108// Patch: Updates information in an existing dataset. The update method 8109// replaces the entire dataset resource, whereas the patch method only 8110// replaces fields that are provided in the submitted dataset resource. 8111// This method supports patch semantics. 8112func (r *DatasetsService) Patch(projectId string, datasetId string, dataset *Dataset) *DatasetsPatchCall { 8113 c := &DatasetsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8114 c.projectId = projectId 8115 c.datasetId = datasetId 8116 c.dataset = dataset 8117 return c 8118} 8119 8120// Fields allows partial responses to be retrieved. See 8121// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8122// for more information. 8123func (c *DatasetsPatchCall) Fields(s ...googleapi.Field) *DatasetsPatchCall { 8124 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8125 return c 8126} 8127 8128// Context sets the context to be used in this call's Do method. Any 8129// pending HTTP request will be aborted if the provided context is 8130// canceled. 8131func (c *DatasetsPatchCall) Context(ctx context.Context) *DatasetsPatchCall { 8132 c.ctx_ = ctx 8133 return c 8134} 8135 8136// Header returns an http.Header that can be modified by the caller to 8137// add HTTP headers to the request. 8138func (c *DatasetsPatchCall) Header() http.Header { 8139 if c.header_ == nil { 8140 c.header_ = make(http.Header) 8141 } 8142 return c.header_ 8143} 8144 8145func (c *DatasetsPatchCall) doRequest(alt string) (*http.Response, error) { 8146 reqHeaders := make(http.Header) 8147 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 8148 for k, v := range c.header_ { 8149 reqHeaders[k] = v 8150 } 8151 reqHeaders.Set("User-Agent", c.s.userAgent()) 8152 var body io.Reader = nil 8153 body, err := googleapi.WithoutDataWrapper.JSONReader(c.dataset) 8154 if err != nil { 8155 return nil, err 8156 } 8157 reqHeaders.Set("Content-Type", "application/json") 8158 c.urlParams_.Set("alt", alt) 8159 c.urlParams_.Set("prettyPrint", "false") 8160 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets/{datasetId}") 8161 urls += "?" + c.urlParams_.Encode() 8162 req, err := http.NewRequest("PATCH", urls, body) 8163 if err != nil { 8164 return nil, err 8165 } 8166 req.Header = reqHeaders 8167 googleapi.Expand(req.URL, map[string]string{ 8168 "projectId": c.projectId, 8169 "datasetId": c.datasetId, 8170 }) 8171 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8172} 8173 8174// Do executes the "bigquery.datasets.patch" call. 8175// Exactly one of *Dataset or error will be non-nil. Any non-2xx status 8176// code is an error. Response headers are in either 8177// *Dataset.ServerResponse.Header or (if a response was returned at all) 8178// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8179// check whether the returned error was because http.StatusNotModified 8180// was returned. 8181func (c *DatasetsPatchCall) Do(opts ...googleapi.CallOption) (*Dataset, error) { 8182 gensupport.SetOptions(c.urlParams_, opts...) 8183 res, err := c.doRequest("json") 8184 if res != nil && res.StatusCode == http.StatusNotModified { 8185 if res.Body != nil { 8186 res.Body.Close() 8187 } 8188 return nil, &googleapi.Error{ 8189 Code: res.StatusCode, 8190 Header: res.Header, 8191 } 8192 } 8193 if err != nil { 8194 return nil, err 8195 } 8196 defer googleapi.CloseBody(res) 8197 if err := googleapi.CheckResponse(res); err != nil { 8198 return nil, err 8199 } 8200 ret := &Dataset{ 8201 ServerResponse: googleapi.ServerResponse{ 8202 Header: res.Header, 8203 HTTPStatusCode: res.StatusCode, 8204 }, 8205 } 8206 target := &ret 8207 if err := gensupport.DecodeResponse(target, res); err != nil { 8208 return nil, err 8209 } 8210 return ret, nil 8211 // { 8212 // "description": "Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that are provided in the submitted dataset resource. This method supports patch semantics.", 8213 // "httpMethod": "PATCH", 8214 // "id": "bigquery.datasets.patch", 8215 // "parameterOrder": [ 8216 // "projectId", 8217 // "datasetId" 8218 // ], 8219 // "parameters": { 8220 // "datasetId": { 8221 // "description": "Dataset ID of the dataset being updated", 8222 // "location": "path", 8223 // "required": true, 8224 // "type": "string" 8225 // }, 8226 // "projectId": { 8227 // "description": "Project ID of the dataset being updated", 8228 // "location": "path", 8229 // "required": true, 8230 // "type": "string" 8231 // } 8232 // }, 8233 // "path": "projects/{projectId}/datasets/{datasetId}", 8234 // "request": { 8235 // "$ref": "Dataset" 8236 // }, 8237 // "response": { 8238 // "$ref": "Dataset" 8239 // }, 8240 // "scopes": [ 8241 // "https://www.googleapis.com/auth/bigquery", 8242 // "https://www.googleapis.com/auth/cloud-platform" 8243 // ] 8244 // } 8245 8246} 8247 8248// method id "bigquery.datasets.update": 8249 8250type DatasetsUpdateCall struct { 8251 s *Service 8252 projectId string 8253 datasetId string 8254 dataset *Dataset 8255 urlParams_ gensupport.URLParams 8256 ctx_ context.Context 8257 header_ http.Header 8258} 8259 8260// Update: Updates information in an existing dataset. The update method 8261// replaces the entire dataset resource, whereas the patch method only 8262// replaces fields that are provided in the submitted dataset resource. 8263func (r *DatasetsService) Update(projectId string, datasetId string, dataset *Dataset) *DatasetsUpdateCall { 8264 c := &DatasetsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8265 c.projectId = projectId 8266 c.datasetId = datasetId 8267 c.dataset = dataset 8268 return c 8269} 8270 8271// Fields allows partial responses to be retrieved. See 8272// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8273// for more information. 8274func (c *DatasetsUpdateCall) Fields(s ...googleapi.Field) *DatasetsUpdateCall { 8275 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8276 return c 8277} 8278 8279// Context sets the context to be used in this call's Do method. Any 8280// pending HTTP request will be aborted if the provided context is 8281// canceled. 8282func (c *DatasetsUpdateCall) Context(ctx context.Context) *DatasetsUpdateCall { 8283 c.ctx_ = ctx 8284 return c 8285} 8286 8287// Header returns an http.Header that can be modified by the caller to 8288// add HTTP headers to the request. 8289func (c *DatasetsUpdateCall) Header() http.Header { 8290 if c.header_ == nil { 8291 c.header_ = make(http.Header) 8292 } 8293 return c.header_ 8294} 8295 8296func (c *DatasetsUpdateCall) doRequest(alt string) (*http.Response, error) { 8297 reqHeaders := make(http.Header) 8298 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 8299 for k, v := range c.header_ { 8300 reqHeaders[k] = v 8301 } 8302 reqHeaders.Set("User-Agent", c.s.userAgent()) 8303 var body io.Reader = nil 8304 body, err := googleapi.WithoutDataWrapper.JSONReader(c.dataset) 8305 if err != nil { 8306 return nil, err 8307 } 8308 reqHeaders.Set("Content-Type", "application/json") 8309 c.urlParams_.Set("alt", alt) 8310 c.urlParams_.Set("prettyPrint", "false") 8311 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets/{datasetId}") 8312 urls += "?" + c.urlParams_.Encode() 8313 req, err := http.NewRequest("PUT", urls, body) 8314 if err != nil { 8315 return nil, err 8316 } 8317 req.Header = reqHeaders 8318 googleapi.Expand(req.URL, map[string]string{ 8319 "projectId": c.projectId, 8320 "datasetId": c.datasetId, 8321 }) 8322 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8323} 8324 8325// Do executes the "bigquery.datasets.update" call. 8326// Exactly one of *Dataset or error will be non-nil. Any non-2xx status 8327// code is an error. Response headers are in either 8328// *Dataset.ServerResponse.Header or (if a response was returned at all) 8329// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8330// check whether the returned error was because http.StatusNotModified 8331// was returned. 8332func (c *DatasetsUpdateCall) Do(opts ...googleapi.CallOption) (*Dataset, error) { 8333 gensupport.SetOptions(c.urlParams_, opts...) 8334 res, err := c.doRequest("json") 8335 if res != nil && res.StatusCode == http.StatusNotModified { 8336 if res.Body != nil { 8337 res.Body.Close() 8338 } 8339 return nil, &googleapi.Error{ 8340 Code: res.StatusCode, 8341 Header: res.Header, 8342 } 8343 } 8344 if err != nil { 8345 return nil, err 8346 } 8347 defer googleapi.CloseBody(res) 8348 if err := googleapi.CheckResponse(res); err != nil { 8349 return nil, err 8350 } 8351 ret := &Dataset{ 8352 ServerResponse: googleapi.ServerResponse{ 8353 Header: res.Header, 8354 HTTPStatusCode: res.StatusCode, 8355 }, 8356 } 8357 target := &ret 8358 if err := gensupport.DecodeResponse(target, res); err != nil { 8359 return nil, err 8360 } 8361 return ret, nil 8362 // { 8363 // "description": "Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that are provided in the submitted dataset resource.", 8364 // "httpMethod": "PUT", 8365 // "id": "bigquery.datasets.update", 8366 // "parameterOrder": [ 8367 // "projectId", 8368 // "datasetId" 8369 // ], 8370 // "parameters": { 8371 // "datasetId": { 8372 // "description": "Dataset ID of the dataset being updated", 8373 // "location": "path", 8374 // "required": true, 8375 // "type": "string" 8376 // }, 8377 // "projectId": { 8378 // "description": "Project ID of the dataset being updated", 8379 // "location": "path", 8380 // "required": true, 8381 // "type": "string" 8382 // } 8383 // }, 8384 // "path": "projects/{projectId}/datasets/{datasetId}", 8385 // "request": { 8386 // "$ref": "Dataset" 8387 // }, 8388 // "response": { 8389 // "$ref": "Dataset" 8390 // }, 8391 // "scopes": [ 8392 // "https://www.googleapis.com/auth/bigquery", 8393 // "https://www.googleapis.com/auth/cloud-platform" 8394 // ] 8395 // } 8396 8397} 8398 8399// method id "bigquery.jobs.cancel": 8400 8401type JobsCancelCall struct { 8402 s *Service 8403 projectId string 8404 jobId string 8405 urlParams_ gensupport.URLParams 8406 ctx_ context.Context 8407 header_ http.Header 8408} 8409 8410// Cancel: Requests that a job be cancelled. This call will return 8411// immediately, and the client will need to poll for the job status to 8412// see if the cancel completed successfully. Cancelled jobs may still 8413// incur costs. 8414func (r *JobsService) Cancel(projectId string, jobId string) *JobsCancelCall { 8415 c := &JobsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8416 c.projectId = projectId 8417 c.jobId = jobId 8418 return c 8419} 8420 8421// Location sets the optional parameter "location": The geographic 8422// location of the job. Required except for US and EU. See details at 8423// https://cloud.google.com/bigquery/docs/locations#specifying_your_location. 8424func (c *JobsCancelCall) Location(location string) *JobsCancelCall { 8425 c.urlParams_.Set("location", location) 8426 return c 8427} 8428 8429// Fields allows partial responses to be retrieved. See 8430// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8431// for more information. 8432func (c *JobsCancelCall) Fields(s ...googleapi.Field) *JobsCancelCall { 8433 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8434 return c 8435} 8436 8437// Context sets the context to be used in this call's Do method. Any 8438// pending HTTP request will be aborted if the provided context is 8439// canceled. 8440func (c *JobsCancelCall) Context(ctx context.Context) *JobsCancelCall { 8441 c.ctx_ = ctx 8442 return c 8443} 8444 8445// Header returns an http.Header that can be modified by the caller to 8446// add HTTP headers to the request. 8447func (c *JobsCancelCall) Header() http.Header { 8448 if c.header_ == nil { 8449 c.header_ = make(http.Header) 8450 } 8451 return c.header_ 8452} 8453 8454func (c *JobsCancelCall) doRequest(alt string) (*http.Response, error) { 8455 reqHeaders := make(http.Header) 8456 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 8457 for k, v := range c.header_ { 8458 reqHeaders[k] = v 8459 } 8460 reqHeaders.Set("User-Agent", c.s.userAgent()) 8461 var body io.Reader = nil 8462 c.urlParams_.Set("alt", alt) 8463 c.urlParams_.Set("prettyPrint", "false") 8464 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/jobs/{jobId}/cancel") 8465 urls += "?" + c.urlParams_.Encode() 8466 req, err := http.NewRequest("POST", urls, body) 8467 if err != nil { 8468 return nil, err 8469 } 8470 req.Header = reqHeaders 8471 googleapi.Expand(req.URL, map[string]string{ 8472 "projectId": c.projectId, 8473 "jobId": c.jobId, 8474 }) 8475 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8476} 8477 8478// Do executes the "bigquery.jobs.cancel" call. 8479// Exactly one of *JobCancelResponse or error will be non-nil. Any 8480// non-2xx status code is an error. Response headers are in either 8481// *JobCancelResponse.ServerResponse.Header or (if a response was 8482// returned at all) in error.(*googleapi.Error).Header. Use 8483// googleapi.IsNotModified to check whether the returned error was 8484// because http.StatusNotModified was returned. 8485func (c *JobsCancelCall) Do(opts ...googleapi.CallOption) (*JobCancelResponse, error) { 8486 gensupport.SetOptions(c.urlParams_, opts...) 8487 res, err := c.doRequest("json") 8488 if res != nil && res.StatusCode == http.StatusNotModified { 8489 if res.Body != nil { 8490 res.Body.Close() 8491 } 8492 return nil, &googleapi.Error{ 8493 Code: res.StatusCode, 8494 Header: res.Header, 8495 } 8496 } 8497 if err != nil { 8498 return nil, err 8499 } 8500 defer googleapi.CloseBody(res) 8501 if err := googleapi.CheckResponse(res); err != nil { 8502 return nil, err 8503 } 8504 ret := &JobCancelResponse{ 8505 ServerResponse: googleapi.ServerResponse{ 8506 Header: res.Header, 8507 HTTPStatusCode: res.StatusCode, 8508 }, 8509 } 8510 target := &ret 8511 if err := gensupport.DecodeResponse(target, res); err != nil { 8512 return nil, err 8513 } 8514 return ret, nil 8515 // { 8516 // "description": "Requests that a job be cancelled. This call will return immediately, and the client will need to poll for the job status to see if the cancel completed successfully. Cancelled jobs may still incur costs.", 8517 // "httpMethod": "POST", 8518 // "id": "bigquery.jobs.cancel", 8519 // "parameterOrder": [ 8520 // "projectId", 8521 // "jobId" 8522 // ], 8523 // "parameters": { 8524 // "jobId": { 8525 // "description": "[Required] Job ID of the job to cancel", 8526 // "location": "path", 8527 // "required": true, 8528 // "type": "string" 8529 // }, 8530 // "location": { 8531 // "description": "The geographic location of the job. Required except for US and EU. See details at https://cloud.google.com/bigquery/docs/locations#specifying_your_location.", 8532 // "location": "query", 8533 // "type": "string" 8534 // }, 8535 // "projectId": { 8536 // "description": "[Required] Project ID of the job to cancel", 8537 // "location": "path", 8538 // "required": true, 8539 // "type": "string" 8540 // } 8541 // }, 8542 // "path": "projects/{projectId}/jobs/{jobId}/cancel", 8543 // "response": { 8544 // "$ref": "JobCancelResponse" 8545 // }, 8546 // "scopes": [ 8547 // "https://www.googleapis.com/auth/bigquery", 8548 // "https://www.googleapis.com/auth/cloud-platform" 8549 // ] 8550 // } 8551 8552} 8553 8554// method id "bigquery.jobs.get": 8555 8556type JobsGetCall struct { 8557 s *Service 8558 projectId string 8559 jobId string 8560 urlParams_ gensupport.URLParams 8561 ifNoneMatch_ string 8562 ctx_ context.Context 8563 header_ http.Header 8564} 8565 8566// Get: Returns information about a specific job. Job information is 8567// available for a six month period after creation. Requires that you're 8568// the person who ran the job, or have the Is Owner project role. 8569func (r *JobsService) Get(projectId string, jobId string) *JobsGetCall { 8570 c := &JobsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8571 c.projectId = projectId 8572 c.jobId = jobId 8573 return c 8574} 8575 8576// Location sets the optional parameter "location": The geographic 8577// location of the job. Required except for US and EU. See details at 8578// https://cloud.google.com/bigquery/docs/locations#specifying_your_location. 8579func (c *JobsGetCall) Location(location string) *JobsGetCall { 8580 c.urlParams_.Set("location", location) 8581 return c 8582} 8583 8584// Fields allows partial responses to be retrieved. See 8585// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8586// for more information. 8587func (c *JobsGetCall) Fields(s ...googleapi.Field) *JobsGetCall { 8588 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8589 return c 8590} 8591 8592// IfNoneMatch sets the optional parameter which makes the operation 8593// fail if the object's ETag matches the given value. This is useful for 8594// getting updates only after the object has changed since the last 8595// request. Use googleapi.IsNotModified to check whether the response 8596// error from Do is the result of In-None-Match. 8597func (c *JobsGetCall) IfNoneMatch(entityTag string) *JobsGetCall { 8598 c.ifNoneMatch_ = entityTag 8599 return c 8600} 8601 8602// Context sets the context to be used in this call's Do method. Any 8603// pending HTTP request will be aborted if the provided context is 8604// canceled. 8605func (c *JobsGetCall) Context(ctx context.Context) *JobsGetCall { 8606 c.ctx_ = ctx 8607 return c 8608} 8609 8610// Header returns an http.Header that can be modified by the caller to 8611// add HTTP headers to the request. 8612func (c *JobsGetCall) Header() http.Header { 8613 if c.header_ == nil { 8614 c.header_ = make(http.Header) 8615 } 8616 return c.header_ 8617} 8618 8619func (c *JobsGetCall) doRequest(alt string) (*http.Response, error) { 8620 reqHeaders := make(http.Header) 8621 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 8622 for k, v := range c.header_ { 8623 reqHeaders[k] = v 8624 } 8625 reqHeaders.Set("User-Agent", c.s.userAgent()) 8626 if c.ifNoneMatch_ != "" { 8627 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8628 } 8629 var body io.Reader = nil 8630 c.urlParams_.Set("alt", alt) 8631 c.urlParams_.Set("prettyPrint", "false") 8632 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/jobs/{jobId}") 8633 urls += "?" + c.urlParams_.Encode() 8634 req, err := http.NewRequest("GET", urls, body) 8635 if err != nil { 8636 return nil, err 8637 } 8638 req.Header = reqHeaders 8639 googleapi.Expand(req.URL, map[string]string{ 8640 "projectId": c.projectId, 8641 "jobId": c.jobId, 8642 }) 8643 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8644} 8645 8646// Do executes the "bigquery.jobs.get" call. 8647// Exactly one of *Job or error will be non-nil. Any non-2xx status code 8648// is an error. Response headers are in either 8649// *Job.ServerResponse.Header or (if a response was returned at all) in 8650// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 8651// whether the returned error was because http.StatusNotModified was 8652// returned. 8653func (c *JobsGetCall) Do(opts ...googleapi.CallOption) (*Job, error) { 8654 gensupport.SetOptions(c.urlParams_, opts...) 8655 res, err := c.doRequest("json") 8656 if res != nil && res.StatusCode == http.StatusNotModified { 8657 if res.Body != nil { 8658 res.Body.Close() 8659 } 8660 return nil, &googleapi.Error{ 8661 Code: res.StatusCode, 8662 Header: res.Header, 8663 } 8664 } 8665 if err != nil { 8666 return nil, err 8667 } 8668 defer googleapi.CloseBody(res) 8669 if err := googleapi.CheckResponse(res); err != nil { 8670 return nil, err 8671 } 8672 ret := &Job{ 8673 ServerResponse: googleapi.ServerResponse{ 8674 Header: res.Header, 8675 HTTPStatusCode: res.StatusCode, 8676 }, 8677 } 8678 target := &ret 8679 if err := gensupport.DecodeResponse(target, res); err != nil { 8680 return nil, err 8681 } 8682 return ret, nil 8683 // { 8684 // "description": "Returns information about a specific job. Job information is available for a six month period after creation. Requires that you're the person who ran the job, or have the Is Owner project role.", 8685 // "httpMethod": "GET", 8686 // "id": "bigquery.jobs.get", 8687 // "parameterOrder": [ 8688 // "projectId", 8689 // "jobId" 8690 // ], 8691 // "parameters": { 8692 // "jobId": { 8693 // "description": "[Required] Job ID of the requested job", 8694 // "location": "path", 8695 // "required": true, 8696 // "type": "string" 8697 // }, 8698 // "location": { 8699 // "description": "The geographic location of the job. Required except for US and EU. See details at https://cloud.google.com/bigquery/docs/locations#specifying_your_location.", 8700 // "location": "query", 8701 // "type": "string" 8702 // }, 8703 // "projectId": { 8704 // "description": "[Required] Project ID of the requested job", 8705 // "location": "path", 8706 // "required": true, 8707 // "type": "string" 8708 // } 8709 // }, 8710 // "path": "projects/{projectId}/jobs/{jobId}", 8711 // "response": { 8712 // "$ref": "Job" 8713 // }, 8714 // "scopes": [ 8715 // "https://www.googleapis.com/auth/bigquery", 8716 // "https://www.googleapis.com/auth/bigquery.readonly", 8717 // "https://www.googleapis.com/auth/cloud-platform", 8718 // "https://www.googleapis.com/auth/cloud-platform.read-only" 8719 // ] 8720 // } 8721 8722} 8723 8724// method id "bigquery.jobs.getQueryResults": 8725 8726type JobsGetQueryResultsCall struct { 8727 s *Service 8728 projectId string 8729 jobId string 8730 urlParams_ gensupport.URLParams 8731 ifNoneMatch_ string 8732 ctx_ context.Context 8733 header_ http.Header 8734} 8735 8736// GetQueryResults: Retrieves the results of a query job. 8737func (r *JobsService) GetQueryResults(projectId string, jobId string) *JobsGetQueryResultsCall { 8738 c := &JobsGetQueryResultsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8739 c.projectId = projectId 8740 c.jobId = jobId 8741 return c 8742} 8743 8744// Location sets the optional parameter "location": The geographic 8745// location where the job should run. Required except for US and EU. See 8746// details at 8747// https://cloud.google.com/bigquery/docs/locations#specifying_your_location. 8748func (c *JobsGetQueryResultsCall) Location(location string) *JobsGetQueryResultsCall { 8749 c.urlParams_.Set("location", location) 8750 return c 8751} 8752 8753// MaxResults sets the optional parameter "maxResults": Maximum number 8754// of results to read 8755func (c *JobsGetQueryResultsCall) MaxResults(maxResults int64) *JobsGetQueryResultsCall { 8756 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 8757 return c 8758} 8759 8760// PageToken sets the optional parameter "pageToken": Page token, 8761// returned by a previous call, to request the next page of results 8762func (c *JobsGetQueryResultsCall) PageToken(pageToken string) *JobsGetQueryResultsCall { 8763 c.urlParams_.Set("pageToken", pageToken) 8764 return c 8765} 8766 8767// StartIndex sets the optional parameter "startIndex": Zero-based index 8768// of the starting row 8769func (c *JobsGetQueryResultsCall) StartIndex(startIndex uint64) *JobsGetQueryResultsCall { 8770 c.urlParams_.Set("startIndex", fmt.Sprint(startIndex)) 8771 return c 8772} 8773 8774// TimeoutMs sets the optional parameter "timeoutMs": How long to wait 8775// for the query to complete, in milliseconds, before returning. Default 8776// is 10 seconds. If the timeout passes before the job completes, the 8777// 'jobComplete' field in the response will be false 8778func (c *JobsGetQueryResultsCall) TimeoutMs(timeoutMs int64) *JobsGetQueryResultsCall { 8779 c.urlParams_.Set("timeoutMs", fmt.Sprint(timeoutMs)) 8780 return c 8781} 8782 8783// Fields allows partial responses to be retrieved. See 8784// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8785// for more information. 8786func (c *JobsGetQueryResultsCall) Fields(s ...googleapi.Field) *JobsGetQueryResultsCall { 8787 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8788 return c 8789} 8790 8791// IfNoneMatch sets the optional parameter which makes the operation 8792// fail if the object's ETag matches the given value. This is useful for 8793// getting updates only after the object has changed since the last 8794// request. Use googleapi.IsNotModified to check whether the response 8795// error from Do is the result of In-None-Match. 8796func (c *JobsGetQueryResultsCall) IfNoneMatch(entityTag string) *JobsGetQueryResultsCall { 8797 c.ifNoneMatch_ = entityTag 8798 return c 8799} 8800 8801// Context sets the context to be used in this call's Do method. Any 8802// pending HTTP request will be aborted if the provided context is 8803// canceled. 8804func (c *JobsGetQueryResultsCall) Context(ctx context.Context) *JobsGetQueryResultsCall { 8805 c.ctx_ = ctx 8806 return c 8807} 8808 8809// Header returns an http.Header that can be modified by the caller to 8810// add HTTP headers to the request. 8811func (c *JobsGetQueryResultsCall) Header() http.Header { 8812 if c.header_ == nil { 8813 c.header_ = make(http.Header) 8814 } 8815 return c.header_ 8816} 8817 8818func (c *JobsGetQueryResultsCall) doRequest(alt string) (*http.Response, error) { 8819 reqHeaders := make(http.Header) 8820 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 8821 for k, v := range c.header_ { 8822 reqHeaders[k] = v 8823 } 8824 reqHeaders.Set("User-Agent", c.s.userAgent()) 8825 if c.ifNoneMatch_ != "" { 8826 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8827 } 8828 var body io.Reader = nil 8829 c.urlParams_.Set("alt", alt) 8830 c.urlParams_.Set("prettyPrint", "false") 8831 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/queries/{jobId}") 8832 urls += "?" + c.urlParams_.Encode() 8833 req, err := http.NewRequest("GET", urls, body) 8834 if err != nil { 8835 return nil, err 8836 } 8837 req.Header = reqHeaders 8838 googleapi.Expand(req.URL, map[string]string{ 8839 "projectId": c.projectId, 8840 "jobId": c.jobId, 8841 }) 8842 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8843} 8844 8845// Do executes the "bigquery.jobs.getQueryResults" call. 8846// Exactly one of *GetQueryResultsResponse or error will be non-nil. Any 8847// non-2xx status code is an error. Response headers are in either 8848// *GetQueryResultsResponse.ServerResponse.Header or (if a response was 8849// returned at all) in error.(*googleapi.Error).Header. Use 8850// googleapi.IsNotModified to check whether the returned error was 8851// because http.StatusNotModified was returned. 8852func (c *JobsGetQueryResultsCall) Do(opts ...googleapi.CallOption) (*GetQueryResultsResponse, error) { 8853 gensupport.SetOptions(c.urlParams_, opts...) 8854 res, err := c.doRequest("json") 8855 if res != nil && res.StatusCode == http.StatusNotModified { 8856 if res.Body != nil { 8857 res.Body.Close() 8858 } 8859 return nil, &googleapi.Error{ 8860 Code: res.StatusCode, 8861 Header: res.Header, 8862 } 8863 } 8864 if err != nil { 8865 return nil, err 8866 } 8867 defer googleapi.CloseBody(res) 8868 if err := googleapi.CheckResponse(res); err != nil { 8869 return nil, err 8870 } 8871 ret := &GetQueryResultsResponse{ 8872 ServerResponse: googleapi.ServerResponse{ 8873 Header: res.Header, 8874 HTTPStatusCode: res.StatusCode, 8875 }, 8876 } 8877 target := &ret 8878 if err := gensupport.DecodeResponse(target, res); err != nil { 8879 return nil, err 8880 } 8881 return ret, nil 8882 // { 8883 // "description": "Retrieves the results of a query job.", 8884 // "httpMethod": "GET", 8885 // "id": "bigquery.jobs.getQueryResults", 8886 // "parameterOrder": [ 8887 // "projectId", 8888 // "jobId" 8889 // ], 8890 // "parameters": { 8891 // "jobId": { 8892 // "description": "[Required] Job ID of the query job", 8893 // "location": "path", 8894 // "required": true, 8895 // "type": "string" 8896 // }, 8897 // "location": { 8898 // "description": "The geographic location where the job should run. Required except for US and EU. See details at https://cloud.google.com/bigquery/docs/locations#specifying_your_location.", 8899 // "location": "query", 8900 // "type": "string" 8901 // }, 8902 // "maxResults": { 8903 // "description": "Maximum number of results to read", 8904 // "format": "uint32", 8905 // "location": "query", 8906 // "type": "integer" 8907 // }, 8908 // "pageToken": { 8909 // "description": "Page token, returned by a previous call, to request the next page of results", 8910 // "location": "query", 8911 // "type": "string" 8912 // }, 8913 // "projectId": { 8914 // "description": "[Required] Project ID of the query job", 8915 // "location": "path", 8916 // "required": true, 8917 // "type": "string" 8918 // }, 8919 // "startIndex": { 8920 // "description": "Zero-based index of the starting row", 8921 // "format": "uint64", 8922 // "location": "query", 8923 // "type": "string" 8924 // }, 8925 // "timeoutMs": { 8926 // "description": "How long to wait for the query to complete, in milliseconds, before returning. Default is 10 seconds. If the timeout passes before the job completes, the 'jobComplete' field in the response will be false", 8927 // "format": "uint32", 8928 // "location": "query", 8929 // "type": "integer" 8930 // } 8931 // }, 8932 // "path": "projects/{projectId}/queries/{jobId}", 8933 // "response": { 8934 // "$ref": "GetQueryResultsResponse" 8935 // }, 8936 // "scopes": [ 8937 // "https://www.googleapis.com/auth/bigquery", 8938 // "https://www.googleapis.com/auth/bigquery.readonly", 8939 // "https://www.googleapis.com/auth/cloud-platform", 8940 // "https://www.googleapis.com/auth/cloud-platform.read-only" 8941 // ] 8942 // } 8943 8944} 8945 8946// Pages invokes f for each page of results. 8947// A non-nil error returned from f will halt the iteration. 8948// The provided context supersedes any context provided to the Context method. 8949func (c *JobsGetQueryResultsCall) Pages(ctx context.Context, f func(*GetQueryResultsResponse) error) error { 8950 c.ctx_ = ctx 8951 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 8952 for { 8953 x, err := c.Do() 8954 if err != nil { 8955 return err 8956 } 8957 if err := f(x); err != nil { 8958 return err 8959 } 8960 if x.PageToken == "" { 8961 return nil 8962 } 8963 c.PageToken(x.PageToken) 8964 } 8965} 8966 8967// method id "bigquery.jobs.insert": 8968 8969type JobsInsertCall struct { 8970 s *Service 8971 projectId string 8972 job *Job 8973 urlParams_ gensupport.URLParams 8974 mediaInfo_ *gensupport.MediaInfo 8975 ctx_ context.Context 8976 header_ http.Header 8977} 8978 8979// Insert: Starts a new asynchronous job. Requires the Can View project 8980// role. 8981func (r *JobsService) Insert(projectId string, job *Job) *JobsInsertCall { 8982 c := &JobsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8983 c.projectId = projectId 8984 c.job = job 8985 return c 8986} 8987 8988// Media specifies the media to upload in one or more chunks. The chunk 8989// size may be controlled by supplying a MediaOption generated by 8990// googleapi.ChunkSize. The chunk size defaults to 8991// googleapi.DefaultUploadChunkSize.The Content-Type header used in the 8992// upload request will be determined by sniffing the contents of r, 8993// unless a MediaOption generated by googleapi.ContentType is 8994// supplied. 8995// At most one of Media and ResumableMedia may be set. 8996func (c *JobsInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *JobsInsertCall { 8997 c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) 8998 return c 8999} 9000 9001// ResumableMedia specifies the media to upload in chunks and can be 9002// canceled with ctx. 9003// 9004// Deprecated: use Media instead. 9005// 9006// At most one of Media and ResumableMedia may be set. mediaType 9007// identifies the MIME media type of the upload, such as "image/png". If 9008// mediaType is "", it will be auto-detected. The provided ctx will 9009// supersede any context previously provided to the Context method. 9010func (c *JobsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *JobsInsertCall { 9011 c.ctx_ = ctx 9012 c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) 9013 return c 9014} 9015 9016// ProgressUpdater provides a callback function that will be called 9017// after every chunk. It should be a low-latency function in order to 9018// not slow down the upload operation. This should only be called when 9019// using ResumableMedia (as opposed to Media). 9020func (c *JobsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *JobsInsertCall { 9021 c.mediaInfo_.SetProgressUpdater(pu) 9022 return c 9023} 9024 9025// Fields allows partial responses to be retrieved. See 9026// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9027// for more information. 9028func (c *JobsInsertCall) Fields(s ...googleapi.Field) *JobsInsertCall { 9029 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9030 return c 9031} 9032 9033// Context sets the context to be used in this call's Do method. Any 9034// pending HTTP request will be aborted if the provided context is 9035// canceled. 9036// This context will supersede any context previously provided to the 9037// ResumableMedia method. 9038func (c *JobsInsertCall) Context(ctx context.Context) *JobsInsertCall { 9039 c.ctx_ = ctx 9040 return c 9041} 9042 9043// Header returns an http.Header that can be modified by the caller to 9044// add HTTP headers to the request. 9045func (c *JobsInsertCall) Header() http.Header { 9046 if c.header_ == nil { 9047 c.header_ = make(http.Header) 9048 } 9049 return c.header_ 9050} 9051 9052func (c *JobsInsertCall) doRequest(alt string) (*http.Response, error) { 9053 reqHeaders := make(http.Header) 9054 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 9055 for k, v := range c.header_ { 9056 reqHeaders[k] = v 9057 } 9058 reqHeaders.Set("User-Agent", c.s.userAgent()) 9059 var body io.Reader = nil 9060 body, err := googleapi.WithoutDataWrapper.JSONReader(c.job) 9061 if err != nil { 9062 return nil, err 9063 } 9064 reqHeaders.Set("Content-Type", "application/json") 9065 c.urlParams_.Set("alt", alt) 9066 c.urlParams_.Set("prettyPrint", "false") 9067 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/jobs") 9068 if c.mediaInfo_ != nil { 9069 urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/bigquery/v2/projects/{projectId}/jobs") 9070 c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) 9071 } 9072 if body == nil { 9073 body = new(bytes.Buffer) 9074 reqHeaders.Set("Content-Type", "application/json") 9075 } 9076 body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) 9077 defer cleanup() 9078 urls += "?" + c.urlParams_.Encode() 9079 req, err := http.NewRequest("POST", urls, body) 9080 if err != nil { 9081 return nil, err 9082 } 9083 req.Header = reqHeaders 9084 req.GetBody = getBody 9085 googleapi.Expand(req.URL, map[string]string{ 9086 "projectId": c.projectId, 9087 }) 9088 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9089} 9090 9091// Do executes the "bigquery.jobs.insert" call. 9092// Exactly one of *Job or error will be non-nil. Any non-2xx status code 9093// is an error. Response headers are in either 9094// *Job.ServerResponse.Header or (if a response was returned at all) in 9095// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 9096// whether the returned error was because http.StatusNotModified was 9097// returned. 9098func (c *JobsInsertCall) Do(opts ...googleapi.CallOption) (*Job, error) { 9099 gensupport.SetOptions(c.urlParams_, opts...) 9100 res, err := c.doRequest("json") 9101 if res != nil && res.StatusCode == http.StatusNotModified { 9102 if res.Body != nil { 9103 res.Body.Close() 9104 } 9105 return nil, &googleapi.Error{ 9106 Code: res.StatusCode, 9107 Header: res.Header, 9108 } 9109 } 9110 if err != nil { 9111 return nil, err 9112 } 9113 defer googleapi.CloseBody(res) 9114 if err := googleapi.CheckResponse(res); err != nil { 9115 return nil, err 9116 } 9117 rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) 9118 if rx != nil { 9119 rx.Client = c.s.client 9120 rx.UserAgent = c.s.userAgent() 9121 ctx := c.ctx_ 9122 if ctx == nil { 9123 ctx = context.TODO() 9124 } 9125 res, err = rx.Upload(ctx) 9126 if err != nil { 9127 return nil, err 9128 } 9129 defer res.Body.Close() 9130 if err := googleapi.CheckResponse(res); err != nil { 9131 return nil, err 9132 } 9133 } 9134 ret := &Job{ 9135 ServerResponse: googleapi.ServerResponse{ 9136 Header: res.Header, 9137 HTTPStatusCode: res.StatusCode, 9138 }, 9139 } 9140 target := &ret 9141 if err := gensupport.DecodeResponse(target, res); err != nil { 9142 return nil, err 9143 } 9144 return ret, nil 9145 // { 9146 // "description": "Starts a new asynchronous job. Requires the Can View project role.", 9147 // "httpMethod": "POST", 9148 // "id": "bigquery.jobs.insert", 9149 // "mediaUpload": { 9150 // "accept": [ 9151 // "*/*" 9152 // ], 9153 // "protocols": { 9154 // "resumable": { 9155 // "multipart": true, 9156 // "path": "/resumable/upload/bigquery/v2/projects/{projectId}/jobs" 9157 // }, 9158 // "simple": { 9159 // "multipart": true, 9160 // "path": "/upload/bigquery/v2/projects/{projectId}/jobs" 9161 // } 9162 // } 9163 // }, 9164 // "parameterOrder": [ 9165 // "projectId" 9166 // ], 9167 // "parameters": { 9168 // "projectId": { 9169 // "description": "Project ID of the project that will be billed for the job", 9170 // "location": "path", 9171 // "required": true, 9172 // "type": "string" 9173 // } 9174 // }, 9175 // "path": "projects/{projectId}/jobs", 9176 // "request": { 9177 // "$ref": "Job" 9178 // }, 9179 // "response": { 9180 // "$ref": "Job" 9181 // }, 9182 // "scopes": [ 9183 // "https://www.googleapis.com/auth/bigquery", 9184 // "https://www.googleapis.com/auth/cloud-platform", 9185 // "https://www.googleapis.com/auth/devstorage.full_control", 9186 // "https://www.googleapis.com/auth/devstorage.read_only", 9187 // "https://www.googleapis.com/auth/devstorage.read_write" 9188 // ], 9189 // "supportsMediaUpload": true 9190 // } 9191 9192} 9193 9194// method id "bigquery.jobs.list": 9195 9196type JobsListCall struct { 9197 s *Service 9198 projectId string 9199 urlParams_ gensupport.URLParams 9200 ifNoneMatch_ string 9201 ctx_ context.Context 9202 header_ http.Header 9203} 9204 9205// List: Lists all jobs that you started in the specified project. Job 9206// information is available for a six month period after creation. The 9207// job list is sorted in reverse chronological order, by job creation 9208// time. Requires the Can View project role, or the Is Owner project 9209// role if you set the allUsers property. 9210func (r *JobsService) List(projectId string) *JobsListCall { 9211 c := &JobsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9212 c.projectId = projectId 9213 return c 9214} 9215 9216// AllUsers sets the optional parameter "allUsers": Whether to display 9217// jobs owned by all users in the project. Default false 9218func (c *JobsListCall) AllUsers(allUsers bool) *JobsListCall { 9219 c.urlParams_.Set("allUsers", fmt.Sprint(allUsers)) 9220 return c 9221} 9222 9223// MaxCreationTime sets the optional parameter "maxCreationTime": Max 9224// value for job creation time, in milliseconds since the POSIX epoch. 9225// If set, only jobs created before or at this timestamp are returned 9226func (c *JobsListCall) MaxCreationTime(maxCreationTime uint64) *JobsListCall { 9227 c.urlParams_.Set("maxCreationTime", fmt.Sprint(maxCreationTime)) 9228 return c 9229} 9230 9231// MaxResults sets the optional parameter "maxResults": Maximum number 9232// of results to return 9233func (c *JobsListCall) MaxResults(maxResults int64) *JobsListCall { 9234 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 9235 return c 9236} 9237 9238// MinCreationTime sets the optional parameter "minCreationTime": Min 9239// value for job creation time, in milliseconds since the POSIX epoch. 9240// If set, only jobs created after or at this timestamp are returned 9241func (c *JobsListCall) MinCreationTime(minCreationTime uint64) *JobsListCall { 9242 c.urlParams_.Set("minCreationTime", fmt.Sprint(minCreationTime)) 9243 return c 9244} 9245 9246// PageToken sets the optional parameter "pageToken": Page token, 9247// returned by a previous call, to request the next page of results 9248func (c *JobsListCall) PageToken(pageToken string) *JobsListCall { 9249 c.urlParams_.Set("pageToken", pageToken) 9250 return c 9251} 9252 9253// ParentJobId sets the optional parameter "parentJobId": If set, 9254// retrieves only jobs whose parent is this job. Otherwise, retrieves 9255// only jobs which have no parent 9256func (c *JobsListCall) ParentJobId(parentJobId string) *JobsListCall { 9257 c.urlParams_.Set("parentJobId", parentJobId) 9258 return c 9259} 9260 9261// Projection sets the optional parameter "projection": Restrict 9262// information returned to a set of selected fields 9263// 9264// Possible values: 9265// "full" - Includes all job data 9266// "minimal" - Does not include the job configuration 9267func (c *JobsListCall) Projection(projection string) *JobsListCall { 9268 c.urlParams_.Set("projection", projection) 9269 return c 9270} 9271 9272// StateFilter sets the optional parameter "stateFilter": Filter for job 9273// state 9274// 9275// Possible values: 9276// "done" - Finished jobs 9277// "pending" - Pending jobs 9278// "running" - Running jobs 9279func (c *JobsListCall) StateFilter(stateFilter ...string) *JobsListCall { 9280 c.urlParams_.SetMulti("stateFilter", append([]string{}, stateFilter...)) 9281 return c 9282} 9283 9284// Fields allows partial responses to be retrieved. See 9285// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9286// for more information. 9287func (c *JobsListCall) Fields(s ...googleapi.Field) *JobsListCall { 9288 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9289 return c 9290} 9291 9292// IfNoneMatch sets the optional parameter which makes the operation 9293// fail if the object's ETag matches the given value. This is useful for 9294// getting updates only after the object has changed since the last 9295// request. Use googleapi.IsNotModified to check whether the response 9296// error from Do is the result of In-None-Match. 9297func (c *JobsListCall) IfNoneMatch(entityTag string) *JobsListCall { 9298 c.ifNoneMatch_ = entityTag 9299 return c 9300} 9301 9302// Context sets the context to be used in this call's Do method. Any 9303// pending HTTP request will be aborted if the provided context is 9304// canceled. 9305func (c *JobsListCall) Context(ctx context.Context) *JobsListCall { 9306 c.ctx_ = ctx 9307 return c 9308} 9309 9310// Header returns an http.Header that can be modified by the caller to 9311// add HTTP headers to the request. 9312func (c *JobsListCall) Header() http.Header { 9313 if c.header_ == nil { 9314 c.header_ = make(http.Header) 9315 } 9316 return c.header_ 9317} 9318 9319func (c *JobsListCall) doRequest(alt string) (*http.Response, error) { 9320 reqHeaders := make(http.Header) 9321 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 9322 for k, v := range c.header_ { 9323 reqHeaders[k] = v 9324 } 9325 reqHeaders.Set("User-Agent", c.s.userAgent()) 9326 if c.ifNoneMatch_ != "" { 9327 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9328 } 9329 var body io.Reader = nil 9330 c.urlParams_.Set("alt", alt) 9331 c.urlParams_.Set("prettyPrint", "false") 9332 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/jobs") 9333 urls += "?" + c.urlParams_.Encode() 9334 req, err := http.NewRequest("GET", urls, body) 9335 if err != nil { 9336 return nil, err 9337 } 9338 req.Header = reqHeaders 9339 googleapi.Expand(req.URL, map[string]string{ 9340 "projectId": c.projectId, 9341 }) 9342 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9343} 9344 9345// Do executes the "bigquery.jobs.list" call. 9346// Exactly one of *JobList or error will be non-nil. Any non-2xx status 9347// code is an error. Response headers are in either 9348// *JobList.ServerResponse.Header or (if a response was returned at all) 9349// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 9350// check whether the returned error was because http.StatusNotModified 9351// was returned. 9352func (c *JobsListCall) Do(opts ...googleapi.CallOption) (*JobList, error) { 9353 gensupport.SetOptions(c.urlParams_, opts...) 9354 res, err := c.doRequest("json") 9355 if res != nil && res.StatusCode == http.StatusNotModified { 9356 if res.Body != nil { 9357 res.Body.Close() 9358 } 9359 return nil, &googleapi.Error{ 9360 Code: res.StatusCode, 9361 Header: res.Header, 9362 } 9363 } 9364 if err != nil { 9365 return nil, err 9366 } 9367 defer googleapi.CloseBody(res) 9368 if err := googleapi.CheckResponse(res); err != nil { 9369 return nil, err 9370 } 9371 ret := &JobList{ 9372 ServerResponse: googleapi.ServerResponse{ 9373 Header: res.Header, 9374 HTTPStatusCode: res.StatusCode, 9375 }, 9376 } 9377 target := &ret 9378 if err := gensupport.DecodeResponse(target, res); err != nil { 9379 return nil, err 9380 } 9381 return ret, nil 9382 // { 9383 // "description": "Lists all jobs that you started in the specified project. Job information is available for a six month period after creation. The job list is sorted in reverse chronological order, by job creation time. Requires the Can View project role, or the Is Owner project role if you set the allUsers property.", 9384 // "httpMethod": "GET", 9385 // "id": "bigquery.jobs.list", 9386 // "parameterOrder": [ 9387 // "projectId" 9388 // ], 9389 // "parameters": { 9390 // "allUsers": { 9391 // "description": "Whether to display jobs owned by all users in the project. Default false", 9392 // "location": "query", 9393 // "type": "boolean" 9394 // }, 9395 // "maxCreationTime": { 9396 // "description": "Max value for job creation time, in milliseconds since the POSIX epoch. If set, only jobs created before or at this timestamp are returned", 9397 // "format": "uint64", 9398 // "location": "query", 9399 // "type": "string" 9400 // }, 9401 // "maxResults": { 9402 // "description": "Maximum number of results to return", 9403 // "format": "uint32", 9404 // "location": "query", 9405 // "type": "integer" 9406 // }, 9407 // "minCreationTime": { 9408 // "description": "Min value for job creation time, in milliseconds since the POSIX epoch. If set, only jobs created after or at this timestamp are returned", 9409 // "format": "uint64", 9410 // "location": "query", 9411 // "type": "string" 9412 // }, 9413 // "pageToken": { 9414 // "description": "Page token, returned by a previous call, to request the next page of results", 9415 // "location": "query", 9416 // "type": "string" 9417 // }, 9418 // "parentJobId": { 9419 // "description": "If set, retrieves only jobs whose parent is this job. Otherwise, retrieves only jobs which have no parent", 9420 // "location": "query", 9421 // "type": "string" 9422 // }, 9423 // "projectId": { 9424 // "description": "Project ID of the jobs to list", 9425 // "location": "path", 9426 // "required": true, 9427 // "type": "string" 9428 // }, 9429 // "projection": { 9430 // "description": "Restrict information returned to a set of selected fields", 9431 // "enum": [ 9432 // "full", 9433 // "minimal" 9434 // ], 9435 // "enumDescriptions": [ 9436 // "Includes all job data", 9437 // "Does not include the job configuration" 9438 // ], 9439 // "location": "query", 9440 // "type": "string" 9441 // }, 9442 // "stateFilter": { 9443 // "description": "Filter for job state", 9444 // "enum": [ 9445 // "done", 9446 // "pending", 9447 // "running" 9448 // ], 9449 // "enumDescriptions": [ 9450 // "Finished jobs", 9451 // "Pending jobs", 9452 // "Running jobs" 9453 // ], 9454 // "location": "query", 9455 // "repeated": true, 9456 // "type": "string" 9457 // } 9458 // }, 9459 // "path": "projects/{projectId}/jobs", 9460 // "response": { 9461 // "$ref": "JobList" 9462 // }, 9463 // "scopes": [ 9464 // "https://www.googleapis.com/auth/bigquery", 9465 // "https://www.googleapis.com/auth/bigquery.readonly", 9466 // "https://www.googleapis.com/auth/cloud-platform", 9467 // "https://www.googleapis.com/auth/cloud-platform.read-only" 9468 // ] 9469 // } 9470 9471} 9472 9473// Pages invokes f for each page of results. 9474// A non-nil error returned from f will halt the iteration. 9475// The provided context supersedes any context provided to the Context method. 9476func (c *JobsListCall) Pages(ctx context.Context, f func(*JobList) error) error { 9477 c.ctx_ = ctx 9478 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 9479 for { 9480 x, err := c.Do() 9481 if err != nil { 9482 return err 9483 } 9484 if err := f(x); err != nil { 9485 return err 9486 } 9487 if x.NextPageToken == "" { 9488 return nil 9489 } 9490 c.PageToken(x.NextPageToken) 9491 } 9492} 9493 9494// method id "bigquery.jobs.query": 9495 9496type JobsQueryCall struct { 9497 s *Service 9498 projectId string 9499 queryrequest *QueryRequest 9500 urlParams_ gensupport.URLParams 9501 ctx_ context.Context 9502 header_ http.Header 9503} 9504 9505// Query: Runs a BigQuery SQL query synchronously and returns query 9506// results if the query completes within a specified timeout. 9507func (r *JobsService) Query(projectId string, queryrequest *QueryRequest) *JobsQueryCall { 9508 c := &JobsQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9509 c.projectId = projectId 9510 c.queryrequest = queryrequest 9511 return c 9512} 9513 9514// Fields allows partial responses to be retrieved. See 9515// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9516// for more information. 9517func (c *JobsQueryCall) Fields(s ...googleapi.Field) *JobsQueryCall { 9518 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9519 return c 9520} 9521 9522// Context sets the context to be used in this call's Do method. Any 9523// pending HTTP request will be aborted if the provided context is 9524// canceled. 9525func (c *JobsQueryCall) Context(ctx context.Context) *JobsQueryCall { 9526 c.ctx_ = ctx 9527 return c 9528} 9529 9530// Header returns an http.Header that can be modified by the caller to 9531// add HTTP headers to the request. 9532func (c *JobsQueryCall) Header() http.Header { 9533 if c.header_ == nil { 9534 c.header_ = make(http.Header) 9535 } 9536 return c.header_ 9537} 9538 9539func (c *JobsQueryCall) doRequest(alt string) (*http.Response, error) { 9540 reqHeaders := make(http.Header) 9541 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 9542 for k, v := range c.header_ { 9543 reqHeaders[k] = v 9544 } 9545 reqHeaders.Set("User-Agent", c.s.userAgent()) 9546 var body io.Reader = nil 9547 body, err := googleapi.WithoutDataWrapper.JSONReader(c.queryrequest) 9548 if err != nil { 9549 return nil, err 9550 } 9551 reqHeaders.Set("Content-Type", "application/json") 9552 c.urlParams_.Set("alt", alt) 9553 c.urlParams_.Set("prettyPrint", "false") 9554 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/queries") 9555 urls += "?" + c.urlParams_.Encode() 9556 req, err := http.NewRequest("POST", urls, body) 9557 if err != nil { 9558 return nil, err 9559 } 9560 req.Header = reqHeaders 9561 googleapi.Expand(req.URL, map[string]string{ 9562 "projectId": c.projectId, 9563 }) 9564 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9565} 9566 9567// Do executes the "bigquery.jobs.query" call. 9568// Exactly one of *QueryResponse or error will be non-nil. Any non-2xx 9569// status code is an error. Response headers are in either 9570// *QueryResponse.ServerResponse.Header or (if a response was returned 9571// at all) in error.(*googleapi.Error).Header. Use 9572// googleapi.IsNotModified to check whether the returned error was 9573// because http.StatusNotModified was returned. 9574func (c *JobsQueryCall) Do(opts ...googleapi.CallOption) (*QueryResponse, error) { 9575 gensupport.SetOptions(c.urlParams_, opts...) 9576 res, err := c.doRequest("json") 9577 if res != nil && res.StatusCode == http.StatusNotModified { 9578 if res.Body != nil { 9579 res.Body.Close() 9580 } 9581 return nil, &googleapi.Error{ 9582 Code: res.StatusCode, 9583 Header: res.Header, 9584 } 9585 } 9586 if err != nil { 9587 return nil, err 9588 } 9589 defer googleapi.CloseBody(res) 9590 if err := googleapi.CheckResponse(res); err != nil { 9591 return nil, err 9592 } 9593 ret := &QueryResponse{ 9594 ServerResponse: googleapi.ServerResponse{ 9595 Header: res.Header, 9596 HTTPStatusCode: res.StatusCode, 9597 }, 9598 } 9599 target := &ret 9600 if err := gensupport.DecodeResponse(target, res); err != nil { 9601 return nil, err 9602 } 9603 return ret, nil 9604 // { 9605 // "description": "Runs a BigQuery SQL query synchronously and returns query results if the query completes within a specified timeout.", 9606 // "httpMethod": "POST", 9607 // "id": "bigquery.jobs.query", 9608 // "parameterOrder": [ 9609 // "projectId" 9610 // ], 9611 // "parameters": { 9612 // "projectId": { 9613 // "description": "Project ID of the project billed for the query", 9614 // "location": "path", 9615 // "required": true, 9616 // "type": "string" 9617 // } 9618 // }, 9619 // "path": "projects/{projectId}/queries", 9620 // "request": { 9621 // "$ref": "QueryRequest" 9622 // }, 9623 // "response": { 9624 // "$ref": "QueryResponse" 9625 // }, 9626 // "scopes": [ 9627 // "https://www.googleapis.com/auth/bigquery", 9628 // "https://www.googleapis.com/auth/bigquery.readonly", 9629 // "https://www.googleapis.com/auth/cloud-platform", 9630 // "https://www.googleapis.com/auth/cloud-platform.read-only" 9631 // ] 9632 // } 9633 9634} 9635 9636// method id "bigquery.models.delete": 9637 9638type ModelsDeleteCall struct { 9639 s *Service 9640 projectId string 9641 datasetId string 9642 modelId string 9643 urlParams_ gensupport.URLParams 9644 ctx_ context.Context 9645 header_ http.Header 9646} 9647 9648// Delete: Deletes the model specified by modelId from the dataset. 9649func (r *ModelsService) Delete(projectId string, datasetId string, modelId string) *ModelsDeleteCall { 9650 c := &ModelsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9651 c.projectId = projectId 9652 c.datasetId = datasetId 9653 c.modelId = modelId 9654 return c 9655} 9656 9657// Fields allows partial responses to be retrieved. See 9658// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9659// for more information. 9660func (c *ModelsDeleteCall) Fields(s ...googleapi.Field) *ModelsDeleteCall { 9661 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9662 return c 9663} 9664 9665// Context sets the context to be used in this call's Do method. Any 9666// pending HTTP request will be aborted if the provided context is 9667// canceled. 9668func (c *ModelsDeleteCall) Context(ctx context.Context) *ModelsDeleteCall { 9669 c.ctx_ = ctx 9670 return c 9671} 9672 9673// Header returns an http.Header that can be modified by the caller to 9674// add HTTP headers to the request. 9675func (c *ModelsDeleteCall) Header() http.Header { 9676 if c.header_ == nil { 9677 c.header_ = make(http.Header) 9678 } 9679 return c.header_ 9680} 9681 9682func (c *ModelsDeleteCall) doRequest(alt string) (*http.Response, error) { 9683 reqHeaders := make(http.Header) 9684 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 9685 for k, v := range c.header_ { 9686 reqHeaders[k] = v 9687 } 9688 reqHeaders.Set("User-Agent", c.s.userAgent()) 9689 var body io.Reader = nil 9690 c.urlParams_.Set("alt", alt) 9691 c.urlParams_.Set("prettyPrint", "false") 9692 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{+projectId}/datasets/{+datasetId}/models/{+modelId}") 9693 urls += "?" + c.urlParams_.Encode() 9694 req, err := http.NewRequest("DELETE", urls, body) 9695 if err != nil { 9696 return nil, err 9697 } 9698 req.Header = reqHeaders 9699 googleapi.Expand(req.URL, map[string]string{ 9700 "projectId": c.projectId, 9701 "datasetId": c.datasetId, 9702 "modelId": c.modelId, 9703 }) 9704 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9705} 9706 9707// Do executes the "bigquery.models.delete" call. 9708func (c *ModelsDeleteCall) Do(opts ...googleapi.CallOption) error { 9709 gensupport.SetOptions(c.urlParams_, opts...) 9710 res, err := c.doRequest("json") 9711 if err != nil { 9712 return err 9713 } 9714 defer googleapi.CloseBody(res) 9715 if err := googleapi.CheckResponse(res); err != nil { 9716 return err 9717 } 9718 return nil 9719 // { 9720 // "description": "Deletes the model specified by modelId from the dataset.", 9721 // "flatPath": "projects/{projectsId}/datasets/{datasetsId}/models/{modelsId}", 9722 // "httpMethod": "DELETE", 9723 // "id": "bigquery.models.delete", 9724 // "parameterOrder": [ 9725 // "projectId", 9726 // "datasetId", 9727 // "modelId" 9728 // ], 9729 // "parameters": { 9730 // "datasetId": { 9731 // "description": "Required. Dataset ID of the model to delete.", 9732 // "location": "path", 9733 // "pattern": "^[^/]+$", 9734 // "required": true, 9735 // "type": "string" 9736 // }, 9737 // "modelId": { 9738 // "description": "Required. Model ID of the model to delete.", 9739 // "location": "path", 9740 // "pattern": "^[^/]+$", 9741 // "required": true, 9742 // "type": "string" 9743 // }, 9744 // "projectId": { 9745 // "description": "Required. Project ID of the model to delete.", 9746 // "location": "path", 9747 // "pattern": "^[^/]+$", 9748 // "required": true, 9749 // "type": "string" 9750 // } 9751 // }, 9752 // "path": "projects/{+projectId}/datasets/{+datasetId}/models/{+modelId}", 9753 // "scopes": [ 9754 // "https://www.googleapis.com/auth/bigquery", 9755 // "https://www.googleapis.com/auth/cloud-platform" 9756 // ] 9757 // } 9758 9759} 9760 9761// method id "bigquery.models.get": 9762 9763type ModelsGetCall struct { 9764 s *Service 9765 projectId string 9766 datasetId string 9767 modelId string 9768 urlParams_ gensupport.URLParams 9769 ifNoneMatch_ string 9770 ctx_ context.Context 9771 header_ http.Header 9772} 9773 9774// Get: Gets the specified model resource by model ID. 9775func (r *ModelsService) Get(projectId string, datasetId string, modelId string) *ModelsGetCall { 9776 c := &ModelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9777 c.projectId = projectId 9778 c.datasetId = datasetId 9779 c.modelId = modelId 9780 return c 9781} 9782 9783// Fields allows partial responses to be retrieved. See 9784// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9785// for more information. 9786func (c *ModelsGetCall) Fields(s ...googleapi.Field) *ModelsGetCall { 9787 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9788 return c 9789} 9790 9791// IfNoneMatch sets the optional parameter which makes the operation 9792// fail if the object's ETag matches the given value. This is useful for 9793// getting updates only after the object has changed since the last 9794// request. Use googleapi.IsNotModified to check whether the response 9795// error from Do is the result of In-None-Match. 9796func (c *ModelsGetCall) IfNoneMatch(entityTag string) *ModelsGetCall { 9797 c.ifNoneMatch_ = entityTag 9798 return c 9799} 9800 9801// Context sets the context to be used in this call's Do method. Any 9802// pending HTTP request will be aborted if the provided context is 9803// canceled. 9804func (c *ModelsGetCall) Context(ctx context.Context) *ModelsGetCall { 9805 c.ctx_ = ctx 9806 return c 9807} 9808 9809// Header returns an http.Header that can be modified by the caller to 9810// add HTTP headers to the request. 9811func (c *ModelsGetCall) Header() http.Header { 9812 if c.header_ == nil { 9813 c.header_ = make(http.Header) 9814 } 9815 return c.header_ 9816} 9817 9818func (c *ModelsGetCall) doRequest(alt string) (*http.Response, error) { 9819 reqHeaders := make(http.Header) 9820 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 9821 for k, v := range c.header_ { 9822 reqHeaders[k] = v 9823 } 9824 reqHeaders.Set("User-Agent", c.s.userAgent()) 9825 if c.ifNoneMatch_ != "" { 9826 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9827 } 9828 var body io.Reader = nil 9829 c.urlParams_.Set("alt", alt) 9830 c.urlParams_.Set("prettyPrint", "false") 9831 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{+projectId}/datasets/{+datasetId}/models/{+modelId}") 9832 urls += "?" + c.urlParams_.Encode() 9833 req, err := http.NewRequest("GET", urls, body) 9834 if err != nil { 9835 return nil, err 9836 } 9837 req.Header = reqHeaders 9838 googleapi.Expand(req.URL, map[string]string{ 9839 "projectId": c.projectId, 9840 "datasetId": c.datasetId, 9841 "modelId": c.modelId, 9842 }) 9843 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9844} 9845 9846// Do executes the "bigquery.models.get" call. 9847// Exactly one of *Model or error will be non-nil. Any non-2xx status 9848// code is an error. Response headers are in either 9849// *Model.ServerResponse.Header or (if a response was returned at all) 9850// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 9851// check whether the returned error was because http.StatusNotModified 9852// was returned. 9853func (c *ModelsGetCall) Do(opts ...googleapi.CallOption) (*Model, error) { 9854 gensupport.SetOptions(c.urlParams_, opts...) 9855 res, err := c.doRequest("json") 9856 if res != nil && res.StatusCode == http.StatusNotModified { 9857 if res.Body != nil { 9858 res.Body.Close() 9859 } 9860 return nil, &googleapi.Error{ 9861 Code: res.StatusCode, 9862 Header: res.Header, 9863 } 9864 } 9865 if err != nil { 9866 return nil, err 9867 } 9868 defer googleapi.CloseBody(res) 9869 if err := googleapi.CheckResponse(res); err != nil { 9870 return nil, err 9871 } 9872 ret := &Model{ 9873 ServerResponse: googleapi.ServerResponse{ 9874 Header: res.Header, 9875 HTTPStatusCode: res.StatusCode, 9876 }, 9877 } 9878 target := &ret 9879 if err := gensupport.DecodeResponse(target, res); err != nil { 9880 return nil, err 9881 } 9882 return ret, nil 9883 // { 9884 // "description": "Gets the specified model resource by model ID.", 9885 // "flatPath": "projects/{projectsId}/datasets/{datasetsId}/models/{modelsId}", 9886 // "httpMethod": "GET", 9887 // "id": "bigquery.models.get", 9888 // "parameterOrder": [ 9889 // "projectId", 9890 // "datasetId", 9891 // "modelId" 9892 // ], 9893 // "parameters": { 9894 // "datasetId": { 9895 // "description": "Required. Dataset ID of the requested model.", 9896 // "location": "path", 9897 // "pattern": "^[^/]+$", 9898 // "required": true, 9899 // "type": "string" 9900 // }, 9901 // "modelId": { 9902 // "description": "Required. Model ID of the requested model.", 9903 // "location": "path", 9904 // "pattern": "^[^/]+$", 9905 // "required": true, 9906 // "type": "string" 9907 // }, 9908 // "projectId": { 9909 // "description": "Required. Project ID of the requested model.", 9910 // "location": "path", 9911 // "pattern": "^[^/]+$", 9912 // "required": true, 9913 // "type": "string" 9914 // } 9915 // }, 9916 // "path": "projects/{+projectId}/datasets/{+datasetId}/models/{+modelId}", 9917 // "response": { 9918 // "$ref": "Model" 9919 // }, 9920 // "scopes": [ 9921 // "https://www.googleapis.com/auth/bigquery", 9922 // "https://www.googleapis.com/auth/bigquery.readonly", 9923 // "https://www.googleapis.com/auth/cloud-platform", 9924 // "https://www.googleapis.com/auth/cloud-platform.read-only" 9925 // ] 9926 // } 9927 9928} 9929 9930// method id "bigquery.models.list": 9931 9932type ModelsListCall struct { 9933 s *Service 9934 projectId string 9935 datasetId string 9936 urlParams_ gensupport.URLParams 9937 ifNoneMatch_ string 9938 ctx_ context.Context 9939 header_ http.Header 9940} 9941 9942// List: Lists all models in the specified dataset. Requires the READER 9943// dataset 9944// role. 9945func (r *ModelsService) List(projectId string, datasetId string) *ModelsListCall { 9946 c := &ModelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9947 c.projectId = projectId 9948 c.datasetId = datasetId 9949 return c 9950} 9951 9952// MaxResults sets the optional parameter "maxResults": The maximum 9953// number of results to return in a single response page. 9954// Leverage the page tokens to iterate through the entire collection. 9955func (c *ModelsListCall) MaxResults(maxResults int64) *ModelsListCall { 9956 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 9957 return c 9958} 9959 9960// PageToken sets the optional parameter "pageToken": Page token, 9961// returned by a previous call to request the next page of 9962// results 9963func (c *ModelsListCall) PageToken(pageToken string) *ModelsListCall { 9964 c.urlParams_.Set("pageToken", pageToken) 9965 return c 9966} 9967 9968// Fields allows partial responses to be retrieved. See 9969// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9970// for more information. 9971func (c *ModelsListCall) Fields(s ...googleapi.Field) *ModelsListCall { 9972 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9973 return c 9974} 9975 9976// IfNoneMatch sets the optional parameter which makes the operation 9977// fail if the object's ETag matches the given value. This is useful for 9978// getting updates only after the object has changed since the last 9979// request. Use googleapi.IsNotModified to check whether the response 9980// error from Do is the result of In-None-Match. 9981func (c *ModelsListCall) IfNoneMatch(entityTag string) *ModelsListCall { 9982 c.ifNoneMatch_ = entityTag 9983 return c 9984} 9985 9986// Context sets the context to be used in this call's Do method. Any 9987// pending HTTP request will be aborted if the provided context is 9988// canceled. 9989func (c *ModelsListCall) Context(ctx context.Context) *ModelsListCall { 9990 c.ctx_ = ctx 9991 return c 9992} 9993 9994// Header returns an http.Header that can be modified by the caller to 9995// add HTTP headers to the request. 9996func (c *ModelsListCall) Header() http.Header { 9997 if c.header_ == nil { 9998 c.header_ = make(http.Header) 9999 } 10000 return c.header_ 10001} 10002 10003func (c *ModelsListCall) doRequest(alt string) (*http.Response, error) { 10004 reqHeaders := make(http.Header) 10005 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 10006 for k, v := range c.header_ { 10007 reqHeaders[k] = v 10008 } 10009 reqHeaders.Set("User-Agent", c.s.userAgent()) 10010 if c.ifNoneMatch_ != "" { 10011 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10012 } 10013 var body io.Reader = nil 10014 c.urlParams_.Set("alt", alt) 10015 c.urlParams_.Set("prettyPrint", "false") 10016 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{+projectId}/datasets/{+datasetId}/models") 10017 urls += "?" + c.urlParams_.Encode() 10018 req, err := http.NewRequest("GET", urls, body) 10019 if err != nil { 10020 return nil, err 10021 } 10022 req.Header = reqHeaders 10023 googleapi.Expand(req.URL, map[string]string{ 10024 "projectId": c.projectId, 10025 "datasetId": c.datasetId, 10026 }) 10027 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10028} 10029 10030// Do executes the "bigquery.models.list" call. 10031// Exactly one of *ListModelsResponse or error will be non-nil. Any 10032// non-2xx status code is an error. Response headers are in either 10033// *ListModelsResponse.ServerResponse.Header or (if a response was 10034// returned at all) in error.(*googleapi.Error).Header. Use 10035// googleapi.IsNotModified to check whether the returned error was 10036// because http.StatusNotModified was returned. 10037func (c *ModelsListCall) Do(opts ...googleapi.CallOption) (*ListModelsResponse, error) { 10038 gensupport.SetOptions(c.urlParams_, opts...) 10039 res, err := c.doRequest("json") 10040 if res != nil && res.StatusCode == http.StatusNotModified { 10041 if res.Body != nil { 10042 res.Body.Close() 10043 } 10044 return nil, &googleapi.Error{ 10045 Code: res.StatusCode, 10046 Header: res.Header, 10047 } 10048 } 10049 if err != nil { 10050 return nil, err 10051 } 10052 defer googleapi.CloseBody(res) 10053 if err := googleapi.CheckResponse(res); err != nil { 10054 return nil, err 10055 } 10056 ret := &ListModelsResponse{ 10057 ServerResponse: googleapi.ServerResponse{ 10058 Header: res.Header, 10059 HTTPStatusCode: res.StatusCode, 10060 }, 10061 } 10062 target := &ret 10063 if err := gensupport.DecodeResponse(target, res); err != nil { 10064 return nil, err 10065 } 10066 return ret, nil 10067 // { 10068 // "description": "Lists all models in the specified dataset. Requires the READER dataset\nrole.", 10069 // "flatPath": "projects/{projectsId}/datasets/{datasetsId}/models", 10070 // "httpMethod": "GET", 10071 // "id": "bigquery.models.list", 10072 // "parameterOrder": [ 10073 // "projectId", 10074 // "datasetId" 10075 // ], 10076 // "parameters": { 10077 // "datasetId": { 10078 // "description": "Required. Dataset ID of the models to list.", 10079 // "location": "path", 10080 // "pattern": "^[^/]+$", 10081 // "required": true, 10082 // "type": "string" 10083 // }, 10084 // "maxResults": { 10085 // "description": "The maximum number of results to return in a single response page.\nLeverage the page tokens to iterate through the entire collection.", 10086 // "format": "uint32", 10087 // "location": "query", 10088 // "type": "integer" 10089 // }, 10090 // "pageToken": { 10091 // "description": "Page token, returned by a previous call to request the next page of\nresults", 10092 // "location": "query", 10093 // "type": "string" 10094 // }, 10095 // "projectId": { 10096 // "description": "Required. Project ID of the models to list.", 10097 // "location": "path", 10098 // "pattern": "^[^/]+$", 10099 // "required": true, 10100 // "type": "string" 10101 // } 10102 // }, 10103 // "path": "projects/{+projectId}/datasets/{+datasetId}/models", 10104 // "response": { 10105 // "$ref": "ListModelsResponse" 10106 // }, 10107 // "scopes": [ 10108 // "https://www.googleapis.com/auth/bigquery", 10109 // "https://www.googleapis.com/auth/bigquery.readonly", 10110 // "https://www.googleapis.com/auth/cloud-platform", 10111 // "https://www.googleapis.com/auth/cloud-platform.read-only" 10112 // ] 10113 // } 10114 10115} 10116 10117// Pages invokes f for each page of results. 10118// A non-nil error returned from f will halt the iteration. 10119// The provided context supersedes any context provided to the Context method. 10120func (c *ModelsListCall) Pages(ctx context.Context, f func(*ListModelsResponse) error) error { 10121 c.ctx_ = ctx 10122 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 10123 for { 10124 x, err := c.Do() 10125 if err != nil { 10126 return err 10127 } 10128 if err := f(x); err != nil { 10129 return err 10130 } 10131 if x.NextPageToken == "" { 10132 return nil 10133 } 10134 c.PageToken(x.NextPageToken) 10135 } 10136} 10137 10138// method id "bigquery.models.patch": 10139 10140type ModelsPatchCall struct { 10141 s *Service 10142 projectId string 10143 datasetId string 10144 modelId string 10145 model *Model 10146 urlParams_ gensupport.URLParams 10147 ctx_ context.Context 10148 header_ http.Header 10149} 10150 10151// Patch: Patch specific fields in the specified model. 10152func (r *ModelsService) Patch(projectId string, datasetId string, modelId string, model *Model) *ModelsPatchCall { 10153 c := &ModelsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10154 c.projectId = projectId 10155 c.datasetId = datasetId 10156 c.modelId = modelId 10157 c.model = model 10158 return c 10159} 10160 10161// Fields allows partial responses to be retrieved. See 10162// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10163// for more information. 10164func (c *ModelsPatchCall) Fields(s ...googleapi.Field) *ModelsPatchCall { 10165 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10166 return c 10167} 10168 10169// Context sets the context to be used in this call's Do method. Any 10170// pending HTTP request will be aborted if the provided context is 10171// canceled. 10172func (c *ModelsPatchCall) Context(ctx context.Context) *ModelsPatchCall { 10173 c.ctx_ = ctx 10174 return c 10175} 10176 10177// Header returns an http.Header that can be modified by the caller to 10178// add HTTP headers to the request. 10179func (c *ModelsPatchCall) Header() http.Header { 10180 if c.header_ == nil { 10181 c.header_ = make(http.Header) 10182 } 10183 return c.header_ 10184} 10185 10186func (c *ModelsPatchCall) doRequest(alt string) (*http.Response, error) { 10187 reqHeaders := make(http.Header) 10188 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 10189 for k, v := range c.header_ { 10190 reqHeaders[k] = v 10191 } 10192 reqHeaders.Set("User-Agent", c.s.userAgent()) 10193 var body io.Reader = nil 10194 body, err := googleapi.WithoutDataWrapper.JSONReader(c.model) 10195 if err != nil { 10196 return nil, err 10197 } 10198 reqHeaders.Set("Content-Type", "application/json") 10199 c.urlParams_.Set("alt", alt) 10200 c.urlParams_.Set("prettyPrint", "false") 10201 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{+projectId}/datasets/{+datasetId}/models/{+modelId}") 10202 urls += "?" + c.urlParams_.Encode() 10203 req, err := http.NewRequest("PATCH", urls, body) 10204 if err != nil { 10205 return nil, err 10206 } 10207 req.Header = reqHeaders 10208 googleapi.Expand(req.URL, map[string]string{ 10209 "projectId": c.projectId, 10210 "datasetId": c.datasetId, 10211 "modelId": c.modelId, 10212 }) 10213 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10214} 10215 10216// Do executes the "bigquery.models.patch" call. 10217// Exactly one of *Model or error will be non-nil. Any non-2xx status 10218// code is an error. Response headers are in either 10219// *Model.ServerResponse.Header or (if a response was returned at all) 10220// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10221// check whether the returned error was because http.StatusNotModified 10222// was returned. 10223func (c *ModelsPatchCall) Do(opts ...googleapi.CallOption) (*Model, error) { 10224 gensupport.SetOptions(c.urlParams_, opts...) 10225 res, err := c.doRequest("json") 10226 if res != nil && res.StatusCode == http.StatusNotModified { 10227 if res.Body != nil { 10228 res.Body.Close() 10229 } 10230 return nil, &googleapi.Error{ 10231 Code: res.StatusCode, 10232 Header: res.Header, 10233 } 10234 } 10235 if err != nil { 10236 return nil, err 10237 } 10238 defer googleapi.CloseBody(res) 10239 if err := googleapi.CheckResponse(res); err != nil { 10240 return nil, err 10241 } 10242 ret := &Model{ 10243 ServerResponse: googleapi.ServerResponse{ 10244 Header: res.Header, 10245 HTTPStatusCode: res.StatusCode, 10246 }, 10247 } 10248 target := &ret 10249 if err := gensupport.DecodeResponse(target, res); err != nil { 10250 return nil, err 10251 } 10252 return ret, nil 10253 // { 10254 // "description": "Patch specific fields in the specified model.", 10255 // "flatPath": "projects/{projectsId}/datasets/{datasetsId}/models/{modelsId}", 10256 // "httpMethod": "PATCH", 10257 // "id": "bigquery.models.patch", 10258 // "parameterOrder": [ 10259 // "projectId", 10260 // "datasetId", 10261 // "modelId" 10262 // ], 10263 // "parameters": { 10264 // "datasetId": { 10265 // "description": "Required. Dataset ID of the model to patch.", 10266 // "location": "path", 10267 // "pattern": "^[^/]+$", 10268 // "required": true, 10269 // "type": "string" 10270 // }, 10271 // "modelId": { 10272 // "description": "Required. Model ID of the model to patch.", 10273 // "location": "path", 10274 // "pattern": "^[^/]+$", 10275 // "required": true, 10276 // "type": "string" 10277 // }, 10278 // "projectId": { 10279 // "description": "Required. Project ID of the model to patch.", 10280 // "location": "path", 10281 // "pattern": "^[^/]+$", 10282 // "required": true, 10283 // "type": "string" 10284 // } 10285 // }, 10286 // "path": "projects/{+projectId}/datasets/{+datasetId}/models/{+modelId}", 10287 // "request": { 10288 // "$ref": "Model" 10289 // }, 10290 // "response": { 10291 // "$ref": "Model" 10292 // }, 10293 // "scopes": [ 10294 // "https://www.googleapis.com/auth/bigquery", 10295 // "https://www.googleapis.com/auth/cloud-platform" 10296 // ] 10297 // } 10298 10299} 10300 10301// method id "bigquery.projects.getServiceAccount": 10302 10303type ProjectsGetServiceAccountCall struct { 10304 s *Service 10305 projectId string 10306 urlParams_ gensupport.URLParams 10307 ifNoneMatch_ string 10308 ctx_ context.Context 10309 header_ http.Header 10310} 10311 10312// GetServiceAccount: Returns the email address of the service account 10313// for your project used for interactions with Google Cloud KMS. 10314func (r *ProjectsService) GetServiceAccount(projectId string) *ProjectsGetServiceAccountCall { 10315 c := &ProjectsGetServiceAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10316 c.projectId = projectId 10317 return c 10318} 10319 10320// Fields allows partial responses to be retrieved. See 10321// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10322// for more information. 10323func (c *ProjectsGetServiceAccountCall) Fields(s ...googleapi.Field) *ProjectsGetServiceAccountCall { 10324 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10325 return c 10326} 10327 10328// IfNoneMatch sets the optional parameter which makes the operation 10329// fail if the object's ETag matches the given value. This is useful for 10330// getting updates only after the object has changed since the last 10331// request. Use googleapi.IsNotModified to check whether the response 10332// error from Do is the result of In-None-Match. 10333func (c *ProjectsGetServiceAccountCall) IfNoneMatch(entityTag string) *ProjectsGetServiceAccountCall { 10334 c.ifNoneMatch_ = entityTag 10335 return c 10336} 10337 10338// Context sets the context to be used in this call's Do method. Any 10339// pending HTTP request will be aborted if the provided context is 10340// canceled. 10341func (c *ProjectsGetServiceAccountCall) Context(ctx context.Context) *ProjectsGetServiceAccountCall { 10342 c.ctx_ = ctx 10343 return c 10344} 10345 10346// Header returns an http.Header that can be modified by the caller to 10347// add HTTP headers to the request. 10348func (c *ProjectsGetServiceAccountCall) Header() http.Header { 10349 if c.header_ == nil { 10350 c.header_ = make(http.Header) 10351 } 10352 return c.header_ 10353} 10354 10355func (c *ProjectsGetServiceAccountCall) doRequest(alt string) (*http.Response, error) { 10356 reqHeaders := make(http.Header) 10357 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 10358 for k, v := range c.header_ { 10359 reqHeaders[k] = v 10360 } 10361 reqHeaders.Set("User-Agent", c.s.userAgent()) 10362 if c.ifNoneMatch_ != "" { 10363 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10364 } 10365 var body io.Reader = nil 10366 c.urlParams_.Set("alt", alt) 10367 c.urlParams_.Set("prettyPrint", "false") 10368 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/serviceAccount") 10369 urls += "?" + c.urlParams_.Encode() 10370 req, err := http.NewRequest("GET", urls, body) 10371 if err != nil { 10372 return nil, err 10373 } 10374 req.Header = reqHeaders 10375 googleapi.Expand(req.URL, map[string]string{ 10376 "projectId": c.projectId, 10377 }) 10378 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10379} 10380 10381// Do executes the "bigquery.projects.getServiceAccount" call. 10382// Exactly one of *GetServiceAccountResponse or error will be non-nil. 10383// Any non-2xx status code is an error. Response headers are in either 10384// *GetServiceAccountResponse.ServerResponse.Header or (if a response 10385// was returned at all) in error.(*googleapi.Error).Header. Use 10386// googleapi.IsNotModified to check whether the returned error was 10387// because http.StatusNotModified was returned. 10388func (c *ProjectsGetServiceAccountCall) Do(opts ...googleapi.CallOption) (*GetServiceAccountResponse, error) { 10389 gensupport.SetOptions(c.urlParams_, opts...) 10390 res, err := c.doRequest("json") 10391 if res != nil && res.StatusCode == http.StatusNotModified { 10392 if res.Body != nil { 10393 res.Body.Close() 10394 } 10395 return nil, &googleapi.Error{ 10396 Code: res.StatusCode, 10397 Header: res.Header, 10398 } 10399 } 10400 if err != nil { 10401 return nil, err 10402 } 10403 defer googleapi.CloseBody(res) 10404 if err := googleapi.CheckResponse(res); err != nil { 10405 return nil, err 10406 } 10407 ret := &GetServiceAccountResponse{ 10408 ServerResponse: googleapi.ServerResponse{ 10409 Header: res.Header, 10410 HTTPStatusCode: res.StatusCode, 10411 }, 10412 } 10413 target := &ret 10414 if err := gensupport.DecodeResponse(target, res); err != nil { 10415 return nil, err 10416 } 10417 return ret, nil 10418 // { 10419 // "description": "Returns the email address of the service account for your project used for interactions with Google Cloud KMS.", 10420 // "httpMethod": "GET", 10421 // "id": "bigquery.projects.getServiceAccount", 10422 // "parameterOrder": [ 10423 // "projectId" 10424 // ], 10425 // "parameters": { 10426 // "projectId": { 10427 // "description": "Project ID for which the service account is requested.", 10428 // "location": "path", 10429 // "required": true, 10430 // "type": "string" 10431 // } 10432 // }, 10433 // "path": "projects/{projectId}/serviceAccount", 10434 // "response": { 10435 // "$ref": "GetServiceAccountResponse" 10436 // }, 10437 // "scopes": [ 10438 // "https://www.googleapis.com/auth/bigquery", 10439 // "https://www.googleapis.com/auth/bigquery.readonly", 10440 // "https://www.googleapis.com/auth/cloud-platform", 10441 // "https://www.googleapis.com/auth/cloud-platform.read-only" 10442 // ] 10443 // } 10444 10445} 10446 10447// method id "bigquery.projects.list": 10448 10449type ProjectsListCall struct { 10450 s *Service 10451 urlParams_ gensupport.URLParams 10452 ifNoneMatch_ string 10453 ctx_ context.Context 10454 header_ http.Header 10455} 10456 10457// List: Lists all projects to which you have been granted any project 10458// role. 10459func (r *ProjectsService) List() *ProjectsListCall { 10460 c := &ProjectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10461 return c 10462} 10463 10464// MaxResults sets the optional parameter "maxResults": Maximum number 10465// of results to return 10466func (c *ProjectsListCall) MaxResults(maxResults int64) *ProjectsListCall { 10467 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 10468 return c 10469} 10470 10471// PageToken sets the optional parameter "pageToken": Page token, 10472// returned by a previous call, to request the next page of results 10473func (c *ProjectsListCall) PageToken(pageToken string) *ProjectsListCall { 10474 c.urlParams_.Set("pageToken", pageToken) 10475 return c 10476} 10477 10478// Fields allows partial responses to be retrieved. See 10479// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10480// for more information. 10481func (c *ProjectsListCall) Fields(s ...googleapi.Field) *ProjectsListCall { 10482 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10483 return c 10484} 10485 10486// IfNoneMatch sets the optional parameter which makes the operation 10487// fail if the object's ETag matches the given value. This is useful for 10488// getting updates only after the object has changed since the last 10489// request. Use googleapi.IsNotModified to check whether the response 10490// error from Do is the result of In-None-Match. 10491func (c *ProjectsListCall) IfNoneMatch(entityTag string) *ProjectsListCall { 10492 c.ifNoneMatch_ = entityTag 10493 return c 10494} 10495 10496// Context sets the context to be used in this call's Do method. Any 10497// pending HTTP request will be aborted if the provided context is 10498// canceled. 10499func (c *ProjectsListCall) Context(ctx context.Context) *ProjectsListCall { 10500 c.ctx_ = ctx 10501 return c 10502} 10503 10504// Header returns an http.Header that can be modified by the caller to 10505// add HTTP headers to the request. 10506func (c *ProjectsListCall) Header() http.Header { 10507 if c.header_ == nil { 10508 c.header_ = make(http.Header) 10509 } 10510 return c.header_ 10511} 10512 10513func (c *ProjectsListCall) doRequest(alt string) (*http.Response, error) { 10514 reqHeaders := make(http.Header) 10515 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 10516 for k, v := range c.header_ { 10517 reqHeaders[k] = v 10518 } 10519 reqHeaders.Set("User-Agent", c.s.userAgent()) 10520 if c.ifNoneMatch_ != "" { 10521 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10522 } 10523 var body io.Reader = nil 10524 c.urlParams_.Set("alt", alt) 10525 c.urlParams_.Set("prettyPrint", "false") 10526 urls := googleapi.ResolveRelative(c.s.BasePath, "projects") 10527 urls += "?" + c.urlParams_.Encode() 10528 req, err := http.NewRequest("GET", urls, body) 10529 if err != nil { 10530 return nil, err 10531 } 10532 req.Header = reqHeaders 10533 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10534} 10535 10536// Do executes the "bigquery.projects.list" call. 10537// Exactly one of *ProjectList or error will be non-nil. Any non-2xx 10538// status code is an error. Response headers are in either 10539// *ProjectList.ServerResponse.Header or (if a response was returned at 10540// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10541// to check whether the returned error was because 10542// http.StatusNotModified was returned. 10543func (c *ProjectsListCall) Do(opts ...googleapi.CallOption) (*ProjectList, error) { 10544 gensupport.SetOptions(c.urlParams_, opts...) 10545 res, err := c.doRequest("json") 10546 if res != nil && res.StatusCode == http.StatusNotModified { 10547 if res.Body != nil { 10548 res.Body.Close() 10549 } 10550 return nil, &googleapi.Error{ 10551 Code: res.StatusCode, 10552 Header: res.Header, 10553 } 10554 } 10555 if err != nil { 10556 return nil, err 10557 } 10558 defer googleapi.CloseBody(res) 10559 if err := googleapi.CheckResponse(res); err != nil { 10560 return nil, err 10561 } 10562 ret := &ProjectList{ 10563 ServerResponse: googleapi.ServerResponse{ 10564 Header: res.Header, 10565 HTTPStatusCode: res.StatusCode, 10566 }, 10567 } 10568 target := &ret 10569 if err := gensupport.DecodeResponse(target, res); err != nil { 10570 return nil, err 10571 } 10572 return ret, nil 10573 // { 10574 // "description": "Lists all projects to which you have been granted any project role.", 10575 // "httpMethod": "GET", 10576 // "id": "bigquery.projects.list", 10577 // "parameters": { 10578 // "maxResults": { 10579 // "description": "Maximum number of results to return", 10580 // "format": "uint32", 10581 // "location": "query", 10582 // "type": "integer" 10583 // }, 10584 // "pageToken": { 10585 // "description": "Page token, returned by a previous call, to request the next page of results", 10586 // "location": "query", 10587 // "type": "string" 10588 // } 10589 // }, 10590 // "path": "projects", 10591 // "response": { 10592 // "$ref": "ProjectList" 10593 // }, 10594 // "scopes": [ 10595 // "https://www.googleapis.com/auth/bigquery", 10596 // "https://www.googleapis.com/auth/bigquery.readonly", 10597 // "https://www.googleapis.com/auth/cloud-platform", 10598 // "https://www.googleapis.com/auth/cloud-platform.read-only" 10599 // ] 10600 // } 10601 10602} 10603 10604// Pages invokes f for each page of results. 10605// A non-nil error returned from f will halt the iteration. 10606// The provided context supersedes any context provided to the Context method. 10607func (c *ProjectsListCall) Pages(ctx context.Context, f func(*ProjectList) error) error { 10608 c.ctx_ = ctx 10609 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 10610 for { 10611 x, err := c.Do() 10612 if err != nil { 10613 return err 10614 } 10615 if err := f(x); err != nil { 10616 return err 10617 } 10618 if x.NextPageToken == "" { 10619 return nil 10620 } 10621 c.PageToken(x.NextPageToken) 10622 } 10623} 10624 10625// method id "bigquery.routines.delete": 10626 10627type RoutinesDeleteCall struct { 10628 s *Service 10629 projectId string 10630 datasetId string 10631 routineId string 10632 urlParams_ gensupport.URLParams 10633 ctx_ context.Context 10634 header_ http.Header 10635} 10636 10637// Delete: Deletes the routine specified by routineId from the dataset. 10638func (r *RoutinesService) Delete(projectId string, datasetId string, routineId string) *RoutinesDeleteCall { 10639 c := &RoutinesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10640 c.projectId = projectId 10641 c.datasetId = datasetId 10642 c.routineId = routineId 10643 return c 10644} 10645 10646// Fields allows partial responses to be retrieved. See 10647// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10648// for more information. 10649func (c *RoutinesDeleteCall) Fields(s ...googleapi.Field) *RoutinesDeleteCall { 10650 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10651 return c 10652} 10653 10654// Context sets the context to be used in this call's Do method. Any 10655// pending HTTP request will be aborted if the provided context is 10656// canceled. 10657func (c *RoutinesDeleteCall) Context(ctx context.Context) *RoutinesDeleteCall { 10658 c.ctx_ = ctx 10659 return c 10660} 10661 10662// Header returns an http.Header that can be modified by the caller to 10663// add HTTP headers to the request. 10664func (c *RoutinesDeleteCall) Header() http.Header { 10665 if c.header_ == nil { 10666 c.header_ = make(http.Header) 10667 } 10668 return c.header_ 10669} 10670 10671func (c *RoutinesDeleteCall) doRequest(alt string) (*http.Response, error) { 10672 reqHeaders := make(http.Header) 10673 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 10674 for k, v := range c.header_ { 10675 reqHeaders[k] = v 10676 } 10677 reqHeaders.Set("User-Agent", c.s.userAgent()) 10678 var body io.Reader = nil 10679 c.urlParams_.Set("alt", alt) 10680 c.urlParams_.Set("prettyPrint", "false") 10681 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{+projectId}/datasets/{+datasetId}/routines/{+routineId}") 10682 urls += "?" + c.urlParams_.Encode() 10683 req, err := http.NewRequest("DELETE", urls, body) 10684 if err != nil { 10685 return nil, err 10686 } 10687 req.Header = reqHeaders 10688 googleapi.Expand(req.URL, map[string]string{ 10689 "projectId": c.projectId, 10690 "datasetId": c.datasetId, 10691 "routineId": c.routineId, 10692 }) 10693 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10694} 10695 10696// Do executes the "bigquery.routines.delete" call. 10697func (c *RoutinesDeleteCall) Do(opts ...googleapi.CallOption) error { 10698 gensupport.SetOptions(c.urlParams_, opts...) 10699 res, err := c.doRequest("json") 10700 if err != nil { 10701 return err 10702 } 10703 defer googleapi.CloseBody(res) 10704 if err := googleapi.CheckResponse(res); err != nil { 10705 return err 10706 } 10707 return nil 10708 // { 10709 // "description": "Deletes the routine specified by routineId from the dataset.", 10710 // "flatPath": "projects/{projectsId}/datasets/{datasetsId}/routines/{routinesId}", 10711 // "httpMethod": "DELETE", 10712 // "id": "bigquery.routines.delete", 10713 // "parameterOrder": [ 10714 // "projectId", 10715 // "datasetId", 10716 // "routineId" 10717 // ], 10718 // "parameters": { 10719 // "datasetId": { 10720 // "description": "Required. Dataset ID of the routine to delete", 10721 // "location": "path", 10722 // "pattern": "^[^/]+$", 10723 // "required": true, 10724 // "type": "string" 10725 // }, 10726 // "projectId": { 10727 // "description": "Required. Project ID of the routine to delete", 10728 // "location": "path", 10729 // "pattern": "^[^/]+$", 10730 // "required": true, 10731 // "type": "string" 10732 // }, 10733 // "routineId": { 10734 // "description": "Required. Routine ID of the routine to delete", 10735 // "location": "path", 10736 // "pattern": "^[^/]+$", 10737 // "required": true, 10738 // "type": "string" 10739 // } 10740 // }, 10741 // "path": "projects/{+projectId}/datasets/{+datasetId}/routines/{+routineId}", 10742 // "scopes": [ 10743 // "https://www.googleapis.com/auth/bigquery", 10744 // "https://www.googleapis.com/auth/cloud-platform" 10745 // ] 10746 // } 10747 10748} 10749 10750// method id "bigquery.routines.get": 10751 10752type RoutinesGetCall struct { 10753 s *Service 10754 projectId string 10755 datasetId string 10756 routineId string 10757 urlParams_ gensupport.URLParams 10758 ifNoneMatch_ string 10759 ctx_ context.Context 10760 header_ http.Header 10761} 10762 10763// Get: Gets the specified routine resource by routine ID. 10764func (r *RoutinesService) Get(projectId string, datasetId string, routineId string) *RoutinesGetCall { 10765 c := &RoutinesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10766 c.projectId = projectId 10767 c.datasetId = datasetId 10768 c.routineId = routineId 10769 return c 10770} 10771 10772// ReadMask sets the optional parameter "readMask": If set, only the 10773// Routine fields in the field mask are returned in the 10774// response. If unset, all Routine fields are returned. 10775func (c *RoutinesGetCall) ReadMask(readMask string) *RoutinesGetCall { 10776 c.urlParams_.Set("readMask", readMask) 10777 return c 10778} 10779 10780// Fields allows partial responses to be retrieved. See 10781// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10782// for more information. 10783func (c *RoutinesGetCall) Fields(s ...googleapi.Field) *RoutinesGetCall { 10784 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10785 return c 10786} 10787 10788// IfNoneMatch sets the optional parameter which makes the operation 10789// fail if the object's ETag matches the given value. This is useful for 10790// getting updates only after the object has changed since the last 10791// request. Use googleapi.IsNotModified to check whether the response 10792// error from Do is the result of In-None-Match. 10793func (c *RoutinesGetCall) IfNoneMatch(entityTag string) *RoutinesGetCall { 10794 c.ifNoneMatch_ = entityTag 10795 return c 10796} 10797 10798// Context sets the context to be used in this call's Do method. Any 10799// pending HTTP request will be aborted if the provided context is 10800// canceled. 10801func (c *RoutinesGetCall) Context(ctx context.Context) *RoutinesGetCall { 10802 c.ctx_ = ctx 10803 return c 10804} 10805 10806// Header returns an http.Header that can be modified by the caller to 10807// add HTTP headers to the request. 10808func (c *RoutinesGetCall) Header() http.Header { 10809 if c.header_ == nil { 10810 c.header_ = make(http.Header) 10811 } 10812 return c.header_ 10813} 10814 10815func (c *RoutinesGetCall) doRequest(alt string) (*http.Response, error) { 10816 reqHeaders := make(http.Header) 10817 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 10818 for k, v := range c.header_ { 10819 reqHeaders[k] = v 10820 } 10821 reqHeaders.Set("User-Agent", c.s.userAgent()) 10822 if c.ifNoneMatch_ != "" { 10823 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10824 } 10825 var body io.Reader = nil 10826 c.urlParams_.Set("alt", alt) 10827 c.urlParams_.Set("prettyPrint", "false") 10828 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{+projectId}/datasets/{+datasetId}/routines/{+routineId}") 10829 urls += "?" + c.urlParams_.Encode() 10830 req, err := http.NewRequest("GET", urls, body) 10831 if err != nil { 10832 return nil, err 10833 } 10834 req.Header = reqHeaders 10835 googleapi.Expand(req.URL, map[string]string{ 10836 "projectId": c.projectId, 10837 "datasetId": c.datasetId, 10838 "routineId": c.routineId, 10839 }) 10840 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10841} 10842 10843// Do executes the "bigquery.routines.get" call. 10844// Exactly one of *Routine or error will be non-nil. Any non-2xx status 10845// code is an error. Response headers are in either 10846// *Routine.ServerResponse.Header or (if a response was returned at all) 10847// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10848// check whether the returned error was because http.StatusNotModified 10849// was returned. 10850func (c *RoutinesGetCall) Do(opts ...googleapi.CallOption) (*Routine, error) { 10851 gensupport.SetOptions(c.urlParams_, opts...) 10852 res, err := c.doRequest("json") 10853 if res != nil && res.StatusCode == http.StatusNotModified { 10854 if res.Body != nil { 10855 res.Body.Close() 10856 } 10857 return nil, &googleapi.Error{ 10858 Code: res.StatusCode, 10859 Header: res.Header, 10860 } 10861 } 10862 if err != nil { 10863 return nil, err 10864 } 10865 defer googleapi.CloseBody(res) 10866 if err := googleapi.CheckResponse(res); err != nil { 10867 return nil, err 10868 } 10869 ret := &Routine{ 10870 ServerResponse: googleapi.ServerResponse{ 10871 Header: res.Header, 10872 HTTPStatusCode: res.StatusCode, 10873 }, 10874 } 10875 target := &ret 10876 if err := gensupport.DecodeResponse(target, res); err != nil { 10877 return nil, err 10878 } 10879 return ret, nil 10880 // { 10881 // "description": "Gets the specified routine resource by routine ID.", 10882 // "flatPath": "projects/{projectsId}/datasets/{datasetsId}/routines/{routinesId}", 10883 // "httpMethod": "GET", 10884 // "id": "bigquery.routines.get", 10885 // "parameterOrder": [ 10886 // "projectId", 10887 // "datasetId", 10888 // "routineId" 10889 // ], 10890 // "parameters": { 10891 // "datasetId": { 10892 // "description": "Required. Dataset ID of the requested routine", 10893 // "location": "path", 10894 // "pattern": "^[^/]+$", 10895 // "required": true, 10896 // "type": "string" 10897 // }, 10898 // "projectId": { 10899 // "description": "Required. Project ID of the requested routine", 10900 // "location": "path", 10901 // "pattern": "^[^/]+$", 10902 // "required": true, 10903 // "type": "string" 10904 // }, 10905 // "readMask": { 10906 // "description": "If set, only the Routine fields in the field mask are returned in the\nresponse. If unset, all Routine fields are returned.", 10907 // "format": "google-fieldmask", 10908 // "location": "query", 10909 // "type": "string" 10910 // }, 10911 // "routineId": { 10912 // "description": "Required. Routine ID of the requested routine", 10913 // "location": "path", 10914 // "pattern": "^[^/]+$", 10915 // "required": true, 10916 // "type": "string" 10917 // } 10918 // }, 10919 // "path": "projects/{+projectId}/datasets/{+datasetId}/routines/{+routineId}", 10920 // "response": { 10921 // "$ref": "Routine" 10922 // }, 10923 // "scopes": [ 10924 // "https://www.googleapis.com/auth/bigquery", 10925 // "https://www.googleapis.com/auth/bigquery.readonly", 10926 // "https://www.googleapis.com/auth/cloud-platform", 10927 // "https://www.googleapis.com/auth/cloud-platform.read-only" 10928 // ] 10929 // } 10930 10931} 10932 10933// method id "bigquery.routines.insert": 10934 10935type RoutinesInsertCall struct { 10936 s *Service 10937 projectId string 10938 datasetId string 10939 routine *Routine 10940 urlParams_ gensupport.URLParams 10941 ctx_ context.Context 10942 header_ http.Header 10943} 10944 10945// Insert: Creates a new routine in the dataset. 10946func (r *RoutinesService) Insert(projectId string, datasetId string, routine *Routine) *RoutinesInsertCall { 10947 c := &RoutinesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10948 c.projectId = projectId 10949 c.datasetId = datasetId 10950 c.routine = routine 10951 return c 10952} 10953 10954// Fields allows partial responses to be retrieved. See 10955// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10956// for more information. 10957func (c *RoutinesInsertCall) Fields(s ...googleapi.Field) *RoutinesInsertCall { 10958 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10959 return c 10960} 10961 10962// Context sets the context to be used in this call's Do method. Any 10963// pending HTTP request will be aborted if the provided context is 10964// canceled. 10965func (c *RoutinesInsertCall) Context(ctx context.Context) *RoutinesInsertCall { 10966 c.ctx_ = ctx 10967 return c 10968} 10969 10970// Header returns an http.Header that can be modified by the caller to 10971// add HTTP headers to the request. 10972func (c *RoutinesInsertCall) Header() http.Header { 10973 if c.header_ == nil { 10974 c.header_ = make(http.Header) 10975 } 10976 return c.header_ 10977} 10978 10979func (c *RoutinesInsertCall) doRequest(alt string) (*http.Response, error) { 10980 reqHeaders := make(http.Header) 10981 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 10982 for k, v := range c.header_ { 10983 reqHeaders[k] = v 10984 } 10985 reqHeaders.Set("User-Agent", c.s.userAgent()) 10986 var body io.Reader = nil 10987 body, err := googleapi.WithoutDataWrapper.JSONReader(c.routine) 10988 if err != nil { 10989 return nil, err 10990 } 10991 reqHeaders.Set("Content-Type", "application/json") 10992 c.urlParams_.Set("alt", alt) 10993 c.urlParams_.Set("prettyPrint", "false") 10994 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{+projectId}/datasets/{+datasetId}/routines") 10995 urls += "?" + c.urlParams_.Encode() 10996 req, err := http.NewRequest("POST", urls, body) 10997 if err != nil { 10998 return nil, err 10999 } 11000 req.Header = reqHeaders 11001 googleapi.Expand(req.URL, map[string]string{ 11002 "projectId": c.projectId, 11003 "datasetId": c.datasetId, 11004 }) 11005 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11006} 11007 11008// Do executes the "bigquery.routines.insert" call. 11009// Exactly one of *Routine or error will be non-nil. Any non-2xx status 11010// code is an error. Response headers are in either 11011// *Routine.ServerResponse.Header or (if a response was returned at all) 11012// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 11013// check whether the returned error was because http.StatusNotModified 11014// was returned. 11015func (c *RoutinesInsertCall) Do(opts ...googleapi.CallOption) (*Routine, error) { 11016 gensupport.SetOptions(c.urlParams_, opts...) 11017 res, err := c.doRequest("json") 11018 if res != nil && res.StatusCode == http.StatusNotModified { 11019 if res.Body != nil { 11020 res.Body.Close() 11021 } 11022 return nil, &googleapi.Error{ 11023 Code: res.StatusCode, 11024 Header: res.Header, 11025 } 11026 } 11027 if err != nil { 11028 return nil, err 11029 } 11030 defer googleapi.CloseBody(res) 11031 if err := googleapi.CheckResponse(res); err != nil { 11032 return nil, err 11033 } 11034 ret := &Routine{ 11035 ServerResponse: googleapi.ServerResponse{ 11036 Header: res.Header, 11037 HTTPStatusCode: res.StatusCode, 11038 }, 11039 } 11040 target := &ret 11041 if err := gensupport.DecodeResponse(target, res); err != nil { 11042 return nil, err 11043 } 11044 return ret, nil 11045 // { 11046 // "description": "Creates a new routine in the dataset.", 11047 // "flatPath": "projects/{projectsId}/datasets/{datasetsId}/routines", 11048 // "httpMethod": "POST", 11049 // "id": "bigquery.routines.insert", 11050 // "parameterOrder": [ 11051 // "projectId", 11052 // "datasetId" 11053 // ], 11054 // "parameters": { 11055 // "datasetId": { 11056 // "description": "Required. Dataset ID of the new routine", 11057 // "location": "path", 11058 // "pattern": "^[^/]+$", 11059 // "required": true, 11060 // "type": "string" 11061 // }, 11062 // "projectId": { 11063 // "description": "Required. Project ID of the new routine", 11064 // "location": "path", 11065 // "pattern": "^[^/]+$", 11066 // "required": true, 11067 // "type": "string" 11068 // } 11069 // }, 11070 // "path": "projects/{+projectId}/datasets/{+datasetId}/routines", 11071 // "request": { 11072 // "$ref": "Routine" 11073 // }, 11074 // "response": { 11075 // "$ref": "Routine" 11076 // }, 11077 // "scopes": [ 11078 // "https://www.googleapis.com/auth/bigquery", 11079 // "https://www.googleapis.com/auth/cloud-platform" 11080 // ] 11081 // } 11082 11083} 11084 11085// method id "bigquery.routines.list": 11086 11087type RoutinesListCall struct { 11088 s *Service 11089 projectId string 11090 datasetId string 11091 urlParams_ gensupport.URLParams 11092 ifNoneMatch_ string 11093 ctx_ context.Context 11094 header_ http.Header 11095} 11096 11097// List: Lists all routines in the specified dataset. Requires the 11098// READER dataset 11099// role. 11100func (r *RoutinesService) List(projectId string, datasetId string) *RoutinesListCall { 11101 c := &RoutinesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11102 c.projectId = projectId 11103 c.datasetId = datasetId 11104 return c 11105} 11106 11107// Filter sets the optional parameter "filter": If set, then only the 11108// Routines matching this filter are returned. 11109// The current supported form is either "routine_type:<RoutineType>" 11110// or 11111// "routineType:<RoutineType>", where <RoutineType> is a RoutineType 11112// enum. 11113// Example: "routineType:SCALAR_FUNCTION". 11114func (c *RoutinesListCall) Filter(filter string) *RoutinesListCall { 11115 c.urlParams_.Set("filter", filter) 11116 return c 11117} 11118 11119// MaxResults sets the optional parameter "maxResults": The maximum 11120// number of results to return in a single response page. 11121// Leverage the page tokens to iterate through the entire collection. 11122func (c *RoutinesListCall) MaxResults(maxResults int64) *RoutinesListCall { 11123 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 11124 return c 11125} 11126 11127// PageToken sets the optional parameter "pageToken": Page token, 11128// returned by a previous call, to request the next page of 11129// results 11130func (c *RoutinesListCall) PageToken(pageToken string) *RoutinesListCall { 11131 c.urlParams_.Set("pageToken", pageToken) 11132 return c 11133} 11134 11135// ReadMask sets the optional parameter "readMask": If set, then only 11136// the Routine fields in the field mask, as well as 11137// project_id, dataset_id and routine_id, are returned in the 11138// response. 11139// If unset, then the following Routine fields are returned: 11140// etag, project_id, dataset_id, routine_id, routine_type, 11141// creation_time, 11142// last_modified_time, and language. 11143func (c *RoutinesListCall) ReadMask(readMask string) *RoutinesListCall { 11144 c.urlParams_.Set("readMask", readMask) 11145 return c 11146} 11147 11148// Fields allows partial responses to be retrieved. See 11149// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11150// for more information. 11151func (c *RoutinesListCall) Fields(s ...googleapi.Field) *RoutinesListCall { 11152 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11153 return c 11154} 11155 11156// IfNoneMatch sets the optional parameter which makes the operation 11157// fail if the object's ETag matches the given value. This is useful for 11158// getting updates only after the object has changed since the last 11159// request. Use googleapi.IsNotModified to check whether the response 11160// error from Do is the result of In-None-Match. 11161func (c *RoutinesListCall) IfNoneMatch(entityTag string) *RoutinesListCall { 11162 c.ifNoneMatch_ = entityTag 11163 return c 11164} 11165 11166// Context sets the context to be used in this call's Do method. Any 11167// pending HTTP request will be aborted if the provided context is 11168// canceled. 11169func (c *RoutinesListCall) Context(ctx context.Context) *RoutinesListCall { 11170 c.ctx_ = ctx 11171 return c 11172} 11173 11174// Header returns an http.Header that can be modified by the caller to 11175// add HTTP headers to the request. 11176func (c *RoutinesListCall) Header() http.Header { 11177 if c.header_ == nil { 11178 c.header_ = make(http.Header) 11179 } 11180 return c.header_ 11181} 11182 11183func (c *RoutinesListCall) doRequest(alt string) (*http.Response, error) { 11184 reqHeaders := make(http.Header) 11185 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 11186 for k, v := range c.header_ { 11187 reqHeaders[k] = v 11188 } 11189 reqHeaders.Set("User-Agent", c.s.userAgent()) 11190 if c.ifNoneMatch_ != "" { 11191 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11192 } 11193 var body io.Reader = nil 11194 c.urlParams_.Set("alt", alt) 11195 c.urlParams_.Set("prettyPrint", "false") 11196 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{+projectId}/datasets/{+datasetId}/routines") 11197 urls += "?" + c.urlParams_.Encode() 11198 req, err := http.NewRequest("GET", urls, body) 11199 if err != nil { 11200 return nil, err 11201 } 11202 req.Header = reqHeaders 11203 googleapi.Expand(req.URL, map[string]string{ 11204 "projectId": c.projectId, 11205 "datasetId": c.datasetId, 11206 }) 11207 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11208} 11209 11210// Do executes the "bigquery.routines.list" call. 11211// Exactly one of *ListRoutinesResponse or error will be non-nil. Any 11212// non-2xx status code is an error. Response headers are in either 11213// *ListRoutinesResponse.ServerResponse.Header or (if a response was 11214// returned at all) in error.(*googleapi.Error).Header. Use 11215// googleapi.IsNotModified to check whether the returned error was 11216// because http.StatusNotModified was returned. 11217func (c *RoutinesListCall) Do(opts ...googleapi.CallOption) (*ListRoutinesResponse, error) { 11218 gensupport.SetOptions(c.urlParams_, opts...) 11219 res, err := c.doRequest("json") 11220 if res != nil && res.StatusCode == http.StatusNotModified { 11221 if res.Body != nil { 11222 res.Body.Close() 11223 } 11224 return nil, &googleapi.Error{ 11225 Code: res.StatusCode, 11226 Header: res.Header, 11227 } 11228 } 11229 if err != nil { 11230 return nil, err 11231 } 11232 defer googleapi.CloseBody(res) 11233 if err := googleapi.CheckResponse(res); err != nil { 11234 return nil, err 11235 } 11236 ret := &ListRoutinesResponse{ 11237 ServerResponse: googleapi.ServerResponse{ 11238 Header: res.Header, 11239 HTTPStatusCode: res.StatusCode, 11240 }, 11241 } 11242 target := &ret 11243 if err := gensupport.DecodeResponse(target, res); err != nil { 11244 return nil, err 11245 } 11246 return ret, nil 11247 // { 11248 // "description": "Lists all routines in the specified dataset. Requires the READER dataset\nrole.", 11249 // "flatPath": "projects/{projectsId}/datasets/{datasetsId}/routines", 11250 // "httpMethod": "GET", 11251 // "id": "bigquery.routines.list", 11252 // "parameterOrder": [ 11253 // "projectId", 11254 // "datasetId" 11255 // ], 11256 // "parameters": { 11257 // "datasetId": { 11258 // "description": "Required. Dataset ID of the routines to list", 11259 // "location": "path", 11260 // "pattern": "^[^/]+$", 11261 // "required": true, 11262 // "type": "string" 11263 // }, 11264 // "filter": { 11265 // "description": "If set, then only the Routines matching this filter are returned.\nThe current supported form is either \"routine_type:\u003cRoutineType\u003e\" or\n\"routineType:\u003cRoutineType\u003e\", where \u003cRoutineType\u003e is a RoutineType enum.\nExample: \"routineType:SCALAR_FUNCTION\".", 11266 // "location": "query", 11267 // "type": "string" 11268 // }, 11269 // "maxResults": { 11270 // "description": "The maximum number of results to return in a single response page.\nLeverage the page tokens to iterate through the entire collection.", 11271 // "format": "uint32", 11272 // "location": "query", 11273 // "type": "integer" 11274 // }, 11275 // "pageToken": { 11276 // "description": "Page token, returned by a previous call, to request the next page of\nresults", 11277 // "location": "query", 11278 // "type": "string" 11279 // }, 11280 // "projectId": { 11281 // "description": "Required. Project ID of the routines to list", 11282 // "location": "path", 11283 // "pattern": "^[^/]+$", 11284 // "required": true, 11285 // "type": "string" 11286 // }, 11287 // "readMask": { 11288 // "description": "If set, then only the Routine fields in the field mask, as well as\nproject_id, dataset_id and routine_id, are returned in the response.\nIf unset, then the following Routine fields are returned:\netag, project_id, dataset_id, routine_id, routine_type, creation_time,\nlast_modified_time, and language.", 11289 // "format": "google-fieldmask", 11290 // "location": "query", 11291 // "type": "string" 11292 // } 11293 // }, 11294 // "path": "projects/{+projectId}/datasets/{+datasetId}/routines", 11295 // "response": { 11296 // "$ref": "ListRoutinesResponse" 11297 // }, 11298 // "scopes": [ 11299 // "https://www.googleapis.com/auth/bigquery", 11300 // "https://www.googleapis.com/auth/bigquery.readonly", 11301 // "https://www.googleapis.com/auth/cloud-platform", 11302 // "https://www.googleapis.com/auth/cloud-platform.read-only" 11303 // ] 11304 // } 11305 11306} 11307 11308// Pages invokes f for each page of results. 11309// A non-nil error returned from f will halt the iteration. 11310// The provided context supersedes any context provided to the Context method. 11311func (c *RoutinesListCall) Pages(ctx context.Context, f func(*ListRoutinesResponse) error) error { 11312 c.ctx_ = ctx 11313 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 11314 for { 11315 x, err := c.Do() 11316 if err != nil { 11317 return err 11318 } 11319 if err := f(x); err != nil { 11320 return err 11321 } 11322 if x.NextPageToken == "" { 11323 return nil 11324 } 11325 c.PageToken(x.NextPageToken) 11326 } 11327} 11328 11329// method id "bigquery.routines.update": 11330 11331type RoutinesUpdateCall struct { 11332 s *Service 11333 projectId string 11334 datasetId string 11335 routineId string 11336 routine *Routine 11337 urlParams_ gensupport.URLParams 11338 ctx_ context.Context 11339 header_ http.Header 11340} 11341 11342// Update: Updates information in an existing routine. The update method 11343// replaces the 11344// entire Routine resource. 11345func (r *RoutinesService) Update(projectId string, datasetId string, routineId string, routine *Routine) *RoutinesUpdateCall { 11346 c := &RoutinesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11347 c.projectId = projectId 11348 c.datasetId = datasetId 11349 c.routineId = routineId 11350 c.routine = routine 11351 return c 11352} 11353 11354// Fields allows partial responses to be retrieved. See 11355// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11356// for more information. 11357func (c *RoutinesUpdateCall) Fields(s ...googleapi.Field) *RoutinesUpdateCall { 11358 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11359 return c 11360} 11361 11362// Context sets the context to be used in this call's Do method. Any 11363// pending HTTP request will be aborted if the provided context is 11364// canceled. 11365func (c *RoutinesUpdateCall) Context(ctx context.Context) *RoutinesUpdateCall { 11366 c.ctx_ = ctx 11367 return c 11368} 11369 11370// Header returns an http.Header that can be modified by the caller to 11371// add HTTP headers to the request. 11372func (c *RoutinesUpdateCall) Header() http.Header { 11373 if c.header_ == nil { 11374 c.header_ = make(http.Header) 11375 } 11376 return c.header_ 11377} 11378 11379func (c *RoutinesUpdateCall) doRequest(alt string) (*http.Response, error) { 11380 reqHeaders := make(http.Header) 11381 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 11382 for k, v := range c.header_ { 11383 reqHeaders[k] = v 11384 } 11385 reqHeaders.Set("User-Agent", c.s.userAgent()) 11386 var body io.Reader = nil 11387 body, err := googleapi.WithoutDataWrapper.JSONReader(c.routine) 11388 if err != nil { 11389 return nil, err 11390 } 11391 reqHeaders.Set("Content-Type", "application/json") 11392 c.urlParams_.Set("alt", alt) 11393 c.urlParams_.Set("prettyPrint", "false") 11394 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{+projectId}/datasets/{+datasetId}/routines/{+routineId}") 11395 urls += "?" + c.urlParams_.Encode() 11396 req, err := http.NewRequest("PUT", urls, body) 11397 if err != nil { 11398 return nil, err 11399 } 11400 req.Header = reqHeaders 11401 googleapi.Expand(req.URL, map[string]string{ 11402 "projectId": c.projectId, 11403 "datasetId": c.datasetId, 11404 "routineId": c.routineId, 11405 }) 11406 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11407} 11408 11409// Do executes the "bigquery.routines.update" call. 11410// Exactly one of *Routine or error will be non-nil. Any non-2xx status 11411// code is an error. Response headers are in either 11412// *Routine.ServerResponse.Header or (if a response was returned at all) 11413// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 11414// check whether the returned error was because http.StatusNotModified 11415// was returned. 11416func (c *RoutinesUpdateCall) Do(opts ...googleapi.CallOption) (*Routine, error) { 11417 gensupport.SetOptions(c.urlParams_, opts...) 11418 res, err := c.doRequest("json") 11419 if res != nil && res.StatusCode == http.StatusNotModified { 11420 if res.Body != nil { 11421 res.Body.Close() 11422 } 11423 return nil, &googleapi.Error{ 11424 Code: res.StatusCode, 11425 Header: res.Header, 11426 } 11427 } 11428 if err != nil { 11429 return nil, err 11430 } 11431 defer googleapi.CloseBody(res) 11432 if err := googleapi.CheckResponse(res); err != nil { 11433 return nil, err 11434 } 11435 ret := &Routine{ 11436 ServerResponse: googleapi.ServerResponse{ 11437 Header: res.Header, 11438 HTTPStatusCode: res.StatusCode, 11439 }, 11440 } 11441 target := &ret 11442 if err := gensupport.DecodeResponse(target, res); err != nil { 11443 return nil, err 11444 } 11445 return ret, nil 11446 // { 11447 // "description": "Updates information in an existing routine. The update method replaces the\nentire Routine resource.", 11448 // "flatPath": "projects/{projectsId}/datasets/{datasetsId}/routines/{routinesId}", 11449 // "httpMethod": "PUT", 11450 // "id": "bigquery.routines.update", 11451 // "parameterOrder": [ 11452 // "projectId", 11453 // "datasetId", 11454 // "routineId" 11455 // ], 11456 // "parameters": { 11457 // "datasetId": { 11458 // "description": "Required. Dataset ID of the routine to update", 11459 // "location": "path", 11460 // "pattern": "^[^/]+$", 11461 // "required": true, 11462 // "type": "string" 11463 // }, 11464 // "projectId": { 11465 // "description": "Required. Project ID of the routine to update", 11466 // "location": "path", 11467 // "pattern": "^[^/]+$", 11468 // "required": true, 11469 // "type": "string" 11470 // }, 11471 // "routineId": { 11472 // "description": "Required. Routine ID of the routine to update", 11473 // "location": "path", 11474 // "pattern": "^[^/]+$", 11475 // "required": true, 11476 // "type": "string" 11477 // } 11478 // }, 11479 // "path": "projects/{+projectId}/datasets/{+datasetId}/routines/{+routineId}", 11480 // "request": { 11481 // "$ref": "Routine" 11482 // }, 11483 // "response": { 11484 // "$ref": "Routine" 11485 // }, 11486 // "scopes": [ 11487 // "https://www.googleapis.com/auth/bigquery", 11488 // "https://www.googleapis.com/auth/cloud-platform" 11489 // ] 11490 // } 11491 11492} 11493 11494// method id "bigquery.tabledata.insertAll": 11495 11496type TabledataInsertAllCall struct { 11497 s *Service 11498 projectId string 11499 datasetId string 11500 tableId string 11501 tabledatainsertallrequest *TableDataInsertAllRequest 11502 urlParams_ gensupport.URLParams 11503 ctx_ context.Context 11504 header_ http.Header 11505} 11506 11507// InsertAll: Streams data into BigQuery one record at a time without 11508// needing to run a load job. Requires the WRITER dataset role. 11509func (r *TabledataService) InsertAll(projectId string, datasetId string, tableId string, tabledatainsertallrequest *TableDataInsertAllRequest) *TabledataInsertAllCall { 11510 c := &TabledataInsertAllCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11511 c.projectId = projectId 11512 c.datasetId = datasetId 11513 c.tableId = tableId 11514 c.tabledatainsertallrequest = tabledatainsertallrequest 11515 return c 11516} 11517 11518// Fields allows partial responses to be retrieved. See 11519// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11520// for more information. 11521func (c *TabledataInsertAllCall) Fields(s ...googleapi.Field) *TabledataInsertAllCall { 11522 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11523 return c 11524} 11525 11526// Context sets the context to be used in this call's Do method. Any 11527// pending HTTP request will be aborted if the provided context is 11528// canceled. 11529func (c *TabledataInsertAllCall) Context(ctx context.Context) *TabledataInsertAllCall { 11530 c.ctx_ = ctx 11531 return c 11532} 11533 11534// Header returns an http.Header that can be modified by the caller to 11535// add HTTP headers to the request. 11536func (c *TabledataInsertAllCall) Header() http.Header { 11537 if c.header_ == nil { 11538 c.header_ = make(http.Header) 11539 } 11540 return c.header_ 11541} 11542 11543func (c *TabledataInsertAllCall) doRequest(alt string) (*http.Response, error) { 11544 reqHeaders := make(http.Header) 11545 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 11546 for k, v := range c.header_ { 11547 reqHeaders[k] = v 11548 } 11549 reqHeaders.Set("User-Agent", c.s.userAgent()) 11550 var body io.Reader = nil 11551 body, err := googleapi.WithoutDataWrapper.JSONReader(c.tabledatainsertallrequest) 11552 if err != nil { 11553 return nil, err 11554 } 11555 reqHeaders.Set("Content-Type", "application/json") 11556 c.urlParams_.Set("alt", alt) 11557 c.urlParams_.Set("prettyPrint", "false") 11558 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets/{datasetId}/tables/{tableId}/insertAll") 11559 urls += "?" + c.urlParams_.Encode() 11560 req, err := http.NewRequest("POST", urls, body) 11561 if err != nil { 11562 return nil, err 11563 } 11564 req.Header = reqHeaders 11565 googleapi.Expand(req.URL, map[string]string{ 11566 "projectId": c.projectId, 11567 "datasetId": c.datasetId, 11568 "tableId": c.tableId, 11569 }) 11570 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11571} 11572 11573// Do executes the "bigquery.tabledata.insertAll" call. 11574// Exactly one of *TableDataInsertAllResponse or error will be non-nil. 11575// Any non-2xx status code is an error. Response headers are in either 11576// *TableDataInsertAllResponse.ServerResponse.Header or (if a response 11577// was returned at all) in error.(*googleapi.Error).Header. Use 11578// googleapi.IsNotModified to check whether the returned error was 11579// because http.StatusNotModified was returned. 11580func (c *TabledataInsertAllCall) Do(opts ...googleapi.CallOption) (*TableDataInsertAllResponse, error) { 11581 gensupport.SetOptions(c.urlParams_, opts...) 11582 res, err := c.doRequest("json") 11583 if res != nil && res.StatusCode == http.StatusNotModified { 11584 if res.Body != nil { 11585 res.Body.Close() 11586 } 11587 return nil, &googleapi.Error{ 11588 Code: res.StatusCode, 11589 Header: res.Header, 11590 } 11591 } 11592 if err != nil { 11593 return nil, err 11594 } 11595 defer googleapi.CloseBody(res) 11596 if err := googleapi.CheckResponse(res); err != nil { 11597 return nil, err 11598 } 11599 ret := &TableDataInsertAllResponse{ 11600 ServerResponse: googleapi.ServerResponse{ 11601 Header: res.Header, 11602 HTTPStatusCode: res.StatusCode, 11603 }, 11604 } 11605 target := &ret 11606 if err := gensupport.DecodeResponse(target, res); err != nil { 11607 return nil, err 11608 } 11609 return ret, nil 11610 // { 11611 // "description": "Streams data into BigQuery one record at a time without needing to run a load job. Requires the WRITER dataset role.", 11612 // "httpMethod": "POST", 11613 // "id": "bigquery.tabledata.insertAll", 11614 // "parameterOrder": [ 11615 // "projectId", 11616 // "datasetId", 11617 // "tableId" 11618 // ], 11619 // "parameters": { 11620 // "datasetId": { 11621 // "description": "Dataset ID of the destination table.", 11622 // "location": "path", 11623 // "required": true, 11624 // "type": "string" 11625 // }, 11626 // "projectId": { 11627 // "description": "Project ID of the destination table.", 11628 // "location": "path", 11629 // "required": true, 11630 // "type": "string" 11631 // }, 11632 // "tableId": { 11633 // "description": "Table ID of the destination table.", 11634 // "location": "path", 11635 // "required": true, 11636 // "type": "string" 11637 // } 11638 // }, 11639 // "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}/insertAll", 11640 // "request": { 11641 // "$ref": "TableDataInsertAllRequest" 11642 // }, 11643 // "response": { 11644 // "$ref": "TableDataInsertAllResponse" 11645 // }, 11646 // "scopes": [ 11647 // "https://www.googleapis.com/auth/bigquery", 11648 // "https://www.googleapis.com/auth/bigquery.insertdata", 11649 // "https://www.googleapis.com/auth/cloud-platform" 11650 // ] 11651 // } 11652 11653} 11654 11655// method id "bigquery.tabledata.list": 11656 11657type TabledataListCall struct { 11658 s *Service 11659 projectId string 11660 datasetId string 11661 tableId string 11662 urlParams_ gensupport.URLParams 11663 ifNoneMatch_ string 11664 ctx_ context.Context 11665 header_ http.Header 11666} 11667 11668// List: Retrieves table data from a specified set of rows. Requires the 11669// READER dataset role. 11670func (r *TabledataService) List(projectId string, datasetId string, tableId string) *TabledataListCall { 11671 c := &TabledataListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11672 c.projectId = projectId 11673 c.datasetId = datasetId 11674 c.tableId = tableId 11675 return c 11676} 11677 11678// MaxResults sets the optional parameter "maxResults": Maximum number 11679// of results to return 11680func (c *TabledataListCall) MaxResults(maxResults int64) *TabledataListCall { 11681 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 11682 return c 11683} 11684 11685// PageToken sets the optional parameter "pageToken": Page token, 11686// returned by a previous call, identifying the result set 11687func (c *TabledataListCall) PageToken(pageToken string) *TabledataListCall { 11688 c.urlParams_.Set("pageToken", pageToken) 11689 return c 11690} 11691 11692// SelectedFields sets the optional parameter "selectedFields": List of 11693// fields to return (comma-separated). If unspecified, all fields are 11694// returned 11695func (c *TabledataListCall) SelectedFields(selectedFields string) *TabledataListCall { 11696 c.urlParams_.Set("selectedFields", selectedFields) 11697 return c 11698} 11699 11700// StartIndex sets the optional parameter "startIndex": Zero-based index 11701// of the starting row to read 11702func (c *TabledataListCall) StartIndex(startIndex uint64) *TabledataListCall { 11703 c.urlParams_.Set("startIndex", fmt.Sprint(startIndex)) 11704 return c 11705} 11706 11707// Fields allows partial responses to be retrieved. See 11708// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11709// for more information. 11710func (c *TabledataListCall) Fields(s ...googleapi.Field) *TabledataListCall { 11711 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11712 return c 11713} 11714 11715// IfNoneMatch sets the optional parameter which makes the operation 11716// fail if the object's ETag matches the given value. This is useful for 11717// getting updates only after the object has changed since the last 11718// request. Use googleapi.IsNotModified to check whether the response 11719// error from Do is the result of In-None-Match. 11720func (c *TabledataListCall) IfNoneMatch(entityTag string) *TabledataListCall { 11721 c.ifNoneMatch_ = entityTag 11722 return c 11723} 11724 11725// Context sets the context to be used in this call's Do method. Any 11726// pending HTTP request will be aborted if the provided context is 11727// canceled. 11728func (c *TabledataListCall) Context(ctx context.Context) *TabledataListCall { 11729 c.ctx_ = ctx 11730 return c 11731} 11732 11733// Header returns an http.Header that can be modified by the caller to 11734// add HTTP headers to the request. 11735func (c *TabledataListCall) Header() http.Header { 11736 if c.header_ == nil { 11737 c.header_ = make(http.Header) 11738 } 11739 return c.header_ 11740} 11741 11742func (c *TabledataListCall) doRequest(alt string) (*http.Response, error) { 11743 reqHeaders := make(http.Header) 11744 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 11745 for k, v := range c.header_ { 11746 reqHeaders[k] = v 11747 } 11748 reqHeaders.Set("User-Agent", c.s.userAgent()) 11749 if c.ifNoneMatch_ != "" { 11750 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11751 } 11752 var body io.Reader = nil 11753 c.urlParams_.Set("alt", alt) 11754 c.urlParams_.Set("prettyPrint", "false") 11755 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets/{datasetId}/tables/{tableId}/data") 11756 urls += "?" + c.urlParams_.Encode() 11757 req, err := http.NewRequest("GET", urls, body) 11758 if err != nil { 11759 return nil, err 11760 } 11761 req.Header = reqHeaders 11762 googleapi.Expand(req.URL, map[string]string{ 11763 "projectId": c.projectId, 11764 "datasetId": c.datasetId, 11765 "tableId": c.tableId, 11766 }) 11767 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11768} 11769 11770// Do executes the "bigquery.tabledata.list" call. 11771// Exactly one of *TableDataList or error will be non-nil. Any non-2xx 11772// status code is an error. Response headers are in either 11773// *TableDataList.ServerResponse.Header or (if a response was returned 11774// at all) in error.(*googleapi.Error).Header. Use 11775// googleapi.IsNotModified to check whether the returned error was 11776// because http.StatusNotModified was returned. 11777func (c *TabledataListCall) Do(opts ...googleapi.CallOption) (*TableDataList, error) { 11778 gensupport.SetOptions(c.urlParams_, opts...) 11779 res, err := c.doRequest("json") 11780 if res != nil && res.StatusCode == http.StatusNotModified { 11781 if res.Body != nil { 11782 res.Body.Close() 11783 } 11784 return nil, &googleapi.Error{ 11785 Code: res.StatusCode, 11786 Header: res.Header, 11787 } 11788 } 11789 if err != nil { 11790 return nil, err 11791 } 11792 defer googleapi.CloseBody(res) 11793 if err := googleapi.CheckResponse(res); err != nil { 11794 return nil, err 11795 } 11796 ret := &TableDataList{ 11797 ServerResponse: googleapi.ServerResponse{ 11798 Header: res.Header, 11799 HTTPStatusCode: res.StatusCode, 11800 }, 11801 } 11802 target := &ret 11803 if err := gensupport.DecodeResponse(target, res); err != nil { 11804 return nil, err 11805 } 11806 return ret, nil 11807 // { 11808 // "description": "Retrieves table data from a specified set of rows. Requires the READER dataset role.", 11809 // "httpMethod": "GET", 11810 // "id": "bigquery.tabledata.list", 11811 // "parameterOrder": [ 11812 // "projectId", 11813 // "datasetId", 11814 // "tableId" 11815 // ], 11816 // "parameters": { 11817 // "datasetId": { 11818 // "description": "Dataset ID of the table to read", 11819 // "location": "path", 11820 // "required": true, 11821 // "type": "string" 11822 // }, 11823 // "maxResults": { 11824 // "description": "Maximum number of results to return", 11825 // "format": "uint32", 11826 // "location": "query", 11827 // "type": "integer" 11828 // }, 11829 // "pageToken": { 11830 // "description": "Page token, returned by a previous call, identifying the result set", 11831 // "location": "query", 11832 // "type": "string" 11833 // }, 11834 // "projectId": { 11835 // "description": "Project ID of the table to read", 11836 // "location": "path", 11837 // "required": true, 11838 // "type": "string" 11839 // }, 11840 // "selectedFields": { 11841 // "description": "List of fields to return (comma-separated). If unspecified, all fields are returned", 11842 // "location": "query", 11843 // "type": "string" 11844 // }, 11845 // "startIndex": { 11846 // "description": "Zero-based index of the starting row to read", 11847 // "format": "uint64", 11848 // "location": "query", 11849 // "type": "string" 11850 // }, 11851 // "tableId": { 11852 // "description": "Table ID of the table to read", 11853 // "location": "path", 11854 // "required": true, 11855 // "type": "string" 11856 // } 11857 // }, 11858 // "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}/data", 11859 // "response": { 11860 // "$ref": "TableDataList" 11861 // }, 11862 // "scopes": [ 11863 // "https://www.googleapis.com/auth/bigquery", 11864 // "https://www.googleapis.com/auth/bigquery.readonly", 11865 // "https://www.googleapis.com/auth/cloud-platform", 11866 // "https://www.googleapis.com/auth/cloud-platform.read-only" 11867 // ] 11868 // } 11869 11870} 11871 11872// Pages invokes f for each page of results. 11873// A non-nil error returned from f will halt the iteration. 11874// The provided context supersedes any context provided to the Context method. 11875func (c *TabledataListCall) Pages(ctx context.Context, f func(*TableDataList) error) error { 11876 c.ctx_ = ctx 11877 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 11878 for { 11879 x, err := c.Do() 11880 if err != nil { 11881 return err 11882 } 11883 if err := f(x); err != nil { 11884 return err 11885 } 11886 if x.PageToken == "" { 11887 return nil 11888 } 11889 c.PageToken(x.PageToken) 11890 } 11891} 11892 11893// method id "bigquery.tables.delete": 11894 11895type TablesDeleteCall struct { 11896 s *Service 11897 projectId string 11898 datasetId string 11899 tableId string 11900 urlParams_ gensupport.URLParams 11901 ctx_ context.Context 11902 header_ http.Header 11903} 11904 11905// Delete: Deletes the table specified by tableId from the dataset. If 11906// the table contains data, all the data will be deleted. 11907func (r *TablesService) Delete(projectId string, datasetId string, tableId string) *TablesDeleteCall { 11908 c := &TablesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11909 c.projectId = projectId 11910 c.datasetId = datasetId 11911 c.tableId = tableId 11912 return c 11913} 11914 11915// Fields allows partial responses to be retrieved. See 11916// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11917// for more information. 11918func (c *TablesDeleteCall) Fields(s ...googleapi.Field) *TablesDeleteCall { 11919 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11920 return c 11921} 11922 11923// Context sets the context to be used in this call's Do method. Any 11924// pending HTTP request will be aborted if the provided context is 11925// canceled. 11926func (c *TablesDeleteCall) Context(ctx context.Context) *TablesDeleteCall { 11927 c.ctx_ = ctx 11928 return c 11929} 11930 11931// Header returns an http.Header that can be modified by the caller to 11932// add HTTP headers to the request. 11933func (c *TablesDeleteCall) Header() http.Header { 11934 if c.header_ == nil { 11935 c.header_ = make(http.Header) 11936 } 11937 return c.header_ 11938} 11939 11940func (c *TablesDeleteCall) doRequest(alt string) (*http.Response, error) { 11941 reqHeaders := make(http.Header) 11942 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 11943 for k, v := range c.header_ { 11944 reqHeaders[k] = v 11945 } 11946 reqHeaders.Set("User-Agent", c.s.userAgent()) 11947 var body io.Reader = nil 11948 c.urlParams_.Set("alt", alt) 11949 c.urlParams_.Set("prettyPrint", "false") 11950 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets/{datasetId}/tables/{tableId}") 11951 urls += "?" + c.urlParams_.Encode() 11952 req, err := http.NewRequest("DELETE", urls, body) 11953 if err != nil { 11954 return nil, err 11955 } 11956 req.Header = reqHeaders 11957 googleapi.Expand(req.URL, map[string]string{ 11958 "projectId": c.projectId, 11959 "datasetId": c.datasetId, 11960 "tableId": c.tableId, 11961 }) 11962 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11963} 11964 11965// Do executes the "bigquery.tables.delete" call. 11966func (c *TablesDeleteCall) Do(opts ...googleapi.CallOption) error { 11967 gensupport.SetOptions(c.urlParams_, opts...) 11968 res, err := c.doRequest("json") 11969 if err != nil { 11970 return err 11971 } 11972 defer googleapi.CloseBody(res) 11973 if err := googleapi.CheckResponse(res); err != nil { 11974 return err 11975 } 11976 return nil 11977 // { 11978 // "description": "Deletes the table specified by tableId from the dataset. If the table contains data, all the data will be deleted.", 11979 // "httpMethod": "DELETE", 11980 // "id": "bigquery.tables.delete", 11981 // "parameterOrder": [ 11982 // "projectId", 11983 // "datasetId", 11984 // "tableId" 11985 // ], 11986 // "parameters": { 11987 // "datasetId": { 11988 // "description": "Dataset ID of the table to delete", 11989 // "location": "path", 11990 // "required": true, 11991 // "type": "string" 11992 // }, 11993 // "projectId": { 11994 // "description": "Project ID of the table to delete", 11995 // "location": "path", 11996 // "required": true, 11997 // "type": "string" 11998 // }, 11999 // "tableId": { 12000 // "description": "Table ID of the table to delete", 12001 // "location": "path", 12002 // "required": true, 12003 // "type": "string" 12004 // } 12005 // }, 12006 // "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}", 12007 // "scopes": [ 12008 // "https://www.googleapis.com/auth/bigquery", 12009 // "https://www.googleapis.com/auth/cloud-platform" 12010 // ] 12011 // } 12012 12013} 12014 12015// method id "bigquery.tables.get": 12016 12017type TablesGetCall struct { 12018 s *Service 12019 projectId string 12020 datasetId string 12021 tableId string 12022 urlParams_ gensupport.URLParams 12023 ifNoneMatch_ string 12024 ctx_ context.Context 12025 header_ http.Header 12026} 12027 12028// Get: Gets the specified table resource by table ID. This method does 12029// not return the data in the table, it only returns the table resource, 12030// which describes the structure of this table. 12031func (r *TablesService) Get(projectId string, datasetId string, tableId string) *TablesGetCall { 12032 c := &TablesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12033 c.projectId = projectId 12034 c.datasetId = datasetId 12035 c.tableId = tableId 12036 return c 12037} 12038 12039// SelectedFields sets the optional parameter "selectedFields": List of 12040// fields to return (comma-separated). If unspecified, all fields are 12041// returned 12042func (c *TablesGetCall) SelectedFields(selectedFields string) *TablesGetCall { 12043 c.urlParams_.Set("selectedFields", selectedFields) 12044 return c 12045} 12046 12047// Fields allows partial responses to be retrieved. See 12048// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12049// for more information. 12050func (c *TablesGetCall) Fields(s ...googleapi.Field) *TablesGetCall { 12051 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12052 return c 12053} 12054 12055// IfNoneMatch sets the optional parameter which makes the operation 12056// fail if the object's ETag matches the given value. This is useful for 12057// getting updates only after the object has changed since the last 12058// request. Use googleapi.IsNotModified to check whether the response 12059// error from Do is the result of In-None-Match. 12060func (c *TablesGetCall) IfNoneMatch(entityTag string) *TablesGetCall { 12061 c.ifNoneMatch_ = entityTag 12062 return c 12063} 12064 12065// Context sets the context to be used in this call's Do method. Any 12066// pending HTTP request will be aborted if the provided context is 12067// canceled. 12068func (c *TablesGetCall) Context(ctx context.Context) *TablesGetCall { 12069 c.ctx_ = ctx 12070 return c 12071} 12072 12073// Header returns an http.Header that can be modified by the caller to 12074// add HTTP headers to the request. 12075func (c *TablesGetCall) Header() http.Header { 12076 if c.header_ == nil { 12077 c.header_ = make(http.Header) 12078 } 12079 return c.header_ 12080} 12081 12082func (c *TablesGetCall) doRequest(alt string) (*http.Response, error) { 12083 reqHeaders := make(http.Header) 12084 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 12085 for k, v := range c.header_ { 12086 reqHeaders[k] = v 12087 } 12088 reqHeaders.Set("User-Agent", c.s.userAgent()) 12089 if c.ifNoneMatch_ != "" { 12090 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12091 } 12092 var body io.Reader = nil 12093 c.urlParams_.Set("alt", alt) 12094 c.urlParams_.Set("prettyPrint", "false") 12095 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets/{datasetId}/tables/{tableId}") 12096 urls += "?" + c.urlParams_.Encode() 12097 req, err := http.NewRequest("GET", urls, body) 12098 if err != nil { 12099 return nil, err 12100 } 12101 req.Header = reqHeaders 12102 googleapi.Expand(req.URL, map[string]string{ 12103 "projectId": c.projectId, 12104 "datasetId": c.datasetId, 12105 "tableId": c.tableId, 12106 }) 12107 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12108} 12109 12110// Do executes the "bigquery.tables.get" call. 12111// Exactly one of *Table or error will be non-nil. Any non-2xx status 12112// code is an error. Response headers are in either 12113// *Table.ServerResponse.Header or (if a response was returned at all) 12114// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 12115// check whether the returned error was because http.StatusNotModified 12116// was returned. 12117func (c *TablesGetCall) Do(opts ...googleapi.CallOption) (*Table, error) { 12118 gensupport.SetOptions(c.urlParams_, opts...) 12119 res, err := c.doRequest("json") 12120 if res != nil && res.StatusCode == http.StatusNotModified { 12121 if res.Body != nil { 12122 res.Body.Close() 12123 } 12124 return nil, &googleapi.Error{ 12125 Code: res.StatusCode, 12126 Header: res.Header, 12127 } 12128 } 12129 if err != nil { 12130 return nil, err 12131 } 12132 defer googleapi.CloseBody(res) 12133 if err := googleapi.CheckResponse(res); err != nil { 12134 return nil, err 12135 } 12136 ret := &Table{ 12137 ServerResponse: googleapi.ServerResponse{ 12138 Header: res.Header, 12139 HTTPStatusCode: res.StatusCode, 12140 }, 12141 } 12142 target := &ret 12143 if err := gensupport.DecodeResponse(target, res); err != nil { 12144 return nil, err 12145 } 12146 return ret, nil 12147 // { 12148 // "description": "Gets the specified table resource by table ID. This method does not return the data in the table, it only returns the table resource, which describes the structure of this table.", 12149 // "httpMethod": "GET", 12150 // "id": "bigquery.tables.get", 12151 // "parameterOrder": [ 12152 // "projectId", 12153 // "datasetId", 12154 // "tableId" 12155 // ], 12156 // "parameters": { 12157 // "datasetId": { 12158 // "description": "Dataset ID of the requested table", 12159 // "location": "path", 12160 // "required": true, 12161 // "type": "string" 12162 // }, 12163 // "projectId": { 12164 // "description": "Project ID of the requested table", 12165 // "location": "path", 12166 // "required": true, 12167 // "type": "string" 12168 // }, 12169 // "selectedFields": { 12170 // "description": "List of fields to return (comma-separated). If unspecified, all fields are returned", 12171 // "location": "query", 12172 // "type": "string" 12173 // }, 12174 // "tableId": { 12175 // "description": "Table ID of the requested table", 12176 // "location": "path", 12177 // "required": true, 12178 // "type": "string" 12179 // } 12180 // }, 12181 // "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}", 12182 // "response": { 12183 // "$ref": "Table" 12184 // }, 12185 // "scopes": [ 12186 // "https://www.googleapis.com/auth/bigquery", 12187 // "https://www.googleapis.com/auth/bigquery.readonly", 12188 // "https://www.googleapis.com/auth/cloud-platform", 12189 // "https://www.googleapis.com/auth/cloud-platform.read-only" 12190 // ] 12191 // } 12192 12193} 12194 12195// method id "bigquery.tables.getIamPolicy": 12196 12197type TablesGetIamPolicyCall struct { 12198 s *Service 12199 resource string 12200 getiampolicyrequest *GetIamPolicyRequest 12201 urlParams_ gensupport.URLParams 12202 ctx_ context.Context 12203 header_ http.Header 12204} 12205 12206// GetIamPolicy: Gets the access control policy for a resource. 12207// Returns an empty policy if the resource exists and does not have a 12208// policy 12209// set. 12210func (r *TablesService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *TablesGetIamPolicyCall { 12211 c := &TablesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12212 c.resource = resource 12213 c.getiampolicyrequest = getiampolicyrequest 12214 return c 12215} 12216 12217// Fields allows partial responses to be retrieved. See 12218// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12219// for more information. 12220func (c *TablesGetIamPolicyCall) Fields(s ...googleapi.Field) *TablesGetIamPolicyCall { 12221 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12222 return c 12223} 12224 12225// Context sets the context to be used in this call's Do method. Any 12226// pending HTTP request will be aborted if the provided context is 12227// canceled. 12228func (c *TablesGetIamPolicyCall) Context(ctx context.Context) *TablesGetIamPolicyCall { 12229 c.ctx_ = ctx 12230 return c 12231} 12232 12233// Header returns an http.Header that can be modified by the caller to 12234// add HTTP headers to the request. 12235func (c *TablesGetIamPolicyCall) Header() http.Header { 12236 if c.header_ == nil { 12237 c.header_ = make(http.Header) 12238 } 12239 return c.header_ 12240} 12241 12242func (c *TablesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 12243 reqHeaders := make(http.Header) 12244 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 12245 for k, v := range c.header_ { 12246 reqHeaders[k] = v 12247 } 12248 reqHeaders.Set("User-Agent", c.s.userAgent()) 12249 var body io.Reader = nil 12250 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) 12251 if err != nil { 12252 return nil, err 12253 } 12254 reqHeaders.Set("Content-Type", "application/json") 12255 c.urlParams_.Set("alt", alt) 12256 c.urlParams_.Set("prettyPrint", "false") 12257 urls := googleapi.ResolveRelative(c.s.BasePath, "{+resource}:getIamPolicy") 12258 urls += "?" + c.urlParams_.Encode() 12259 req, err := http.NewRequest("POST", urls, body) 12260 if err != nil { 12261 return nil, err 12262 } 12263 req.Header = reqHeaders 12264 googleapi.Expand(req.URL, map[string]string{ 12265 "resource": c.resource, 12266 }) 12267 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12268} 12269 12270// Do executes the "bigquery.tables.getIamPolicy" call. 12271// Exactly one of *Policy or error will be non-nil. Any non-2xx status 12272// code is an error. Response headers are in either 12273// *Policy.ServerResponse.Header or (if a response was returned at all) 12274// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 12275// check whether the returned error was because http.StatusNotModified 12276// was returned. 12277func (c *TablesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 12278 gensupport.SetOptions(c.urlParams_, opts...) 12279 res, err := c.doRequest("json") 12280 if res != nil && res.StatusCode == http.StatusNotModified { 12281 if res.Body != nil { 12282 res.Body.Close() 12283 } 12284 return nil, &googleapi.Error{ 12285 Code: res.StatusCode, 12286 Header: res.Header, 12287 } 12288 } 12289 if err != nil { 12290 return nil, err 12291 } 12292 defer googleapi.CloseBody(res) 12293 if err := googleapi.CheckResponse(res); err != nil { 12294 return nil, err 12295 } 12296 ret := &Policy{ 12297 ServerResponse: googleapi.ServerResponse{ 12298 Header: res.Header, 12299 HTTPStatusCode: res.StatusCode, 12300 }, 12301 } 12302 target := &ret 12303 if err := gensupport.DecodeResponse(target, res); err != nil { 12304 return nil, err 12305 } 12306 return ret, nil 12307 // { 12308 // "description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset.", 12309 // "flatPath": "projects/{projectsId}/datasets/{datasetsId}/tables/{tablesId}:getIamPolicy", 12310 // "httpMethod": "POST", 12311 // "id": "bigquery.tables.getIamPolicy", 12312 // "parameterOrder": [ 12313 // "resource" 12314 // ], 12315 // "parameters": { 12316 // "resource": { 12317 // "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.", 12318 // "location": "path", 12319 // "pattern": "^projects/[^/]+/datasets/[^/]+/tables/[^/]+$", 12320 // "required": true, 12321 // "type": "string" 12322 // } 12323 // }, 12324 // "path": "{+resource}:getIamPolicy", 12325 // "request": { 12326 // "$ref": "GetIamPolicyRequest" 12327 // }, 12328 // "response": { 12329 // "$ref": "Policy" 12330 // }, 12331 // "scopes": [ 12332 // "https://www.googleapis.com/auth/bigquery", 12333 // "https://www.googleapis.com/auth/bigquery.readonly", 12334 // "https://www.googleapis.com/auth/cloud-platform", 12335 // "https://www.googleapis.com/auth/cloud-platform.read-only" 12336 // ] 12337 // } 12338 12339} 12340 12341// method id "bigquery.tables.insert": 12342 12343type TablesInsertCall struct { 12344 s *Service 12345 projectId string 12346 datasetId string 12347 table *Table 12348 urlParams_ gensupport.URLParams 12349 ctx_ context.Context 12350 header_ http.Header 12351} 12352 12353// Insert: Creates a new, empty table in the dataset. 12354func (r *TablesService) Insert(projectId string, datasetId string, table *Table) *TablesInsertCall { 12355 c := &TablesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12356 c.projectId = projectId 12357 c.datasetId = datasetId 12358 c.table = table 12359 return c 12360} 12361 12362// Fields allows partial responses to be retrieved. See 12363// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12364// for more information. 12365func (c *TablesInsertCall) Fields(s ...googleapi.Field) *TablesInsertCall { 12366 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12367 return c 12368} 12369 12370// Context sets the context to be used in this call's Do method. Any 12371// pending HTTP request will be aborted if the provided context is 12372// canceled. 12373func (c *TablesInsertCall) Context(ctx context.Context) *TablesInsertCall { 12374 c.ctx_ = ctx 12375 return c 12376} 12377 12378// Header returns an http.Header that can be modified by the caller to 12379// add HTTP headers to the request. 12380func (c *TablesInsertCall) Header() http.Header { 12381 if c.header_ == nil { 12382 c.header_ = make(http.Header) 12383 } 12384 return c.header_ 12385} 12386 12387func (c *TablesInsertCall) doRequest(alt string) (*http.Response, error) { 12388 reqHeaders := make(http.Header) 12389 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 12390 for k, v := range c.header_ { 12391 reqHeaders[k] = v 12392 } 12393 reqHeaders.Set("User-Agent", c.s.userAgent()) 12394 var body io.Reader = nil 12395 body, err := googleapi.WithoutDataWrapper.JSONReader(c.table) 12396 if err != nil { 12397 return nil, err 12398 } 12399 reqHeaders.Set("Content-Type", "application/json") 12400 c.urlParams_.Set("alt", alt) 12401 c.urlParams_.Set("prettyPrint", "false") 12402 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets/{datasetId}/tables") 12403 urls += "?" + c.urlParams_.Encode() 12404 req, err := http.NewRequest("POST", urls, body) 12405 if err != nil { 12406 return nil, err 12407 } 12408 req.Header = reqHeaders 12409 googleapi.Expand(req.URL, map[string]string{ 12410 "projectId": c.projectId, 12411 "datasetId": c.datasetId, 12412 }) 12413 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12414} 12415 12416// Do executes the "bigquery.tables.insert" call. 12417// Exactly one of *Table or error will be non-nil. Any non-2xx status 12418// code is an error. Response headers are in either 12419// *Table.ServerResponse.Header or (if a response was returned at all) 12420// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 12421// check whether the returned error was because http.StatusNotModified 12422// was returned. 12423func (c *TablesInsertCall) Do(opts ...googleapi.CallOption) (*Table, error) { 12424 gensupport.SetOptions(c.urlParams_, opts...) 12425 res, err := c.doRequest("json") 12426 if res != nil && res.StatusCode == http.StatusNotModified { 12427 if res.Body != nil { 12428 res.Body.Close() 12429 } 12430 return nil, &googleapi.Error{ 12431 Code: res.StatusCode, 12432 Header: res.Header, 12433 } 12434 } 12435 if err != nil { 12436 return nil, err 12437 } 12438 defer googleapi.CloseBody(res) 12439 if err := googleapi.CheckResponse(res); err != nil { 12440 return nil, err 12441 } 12442 ret := &Table{ 12443 ServerResponse: googleapi.ServerResponse{ 12444 Header: res.Header, 12445 HTTPStatusCode: res.StatusCode, 12446 }, 12447 } 12448 target := &ret 12449 if err := gensupport.DecodeResponse(target, res); err != nil { 12450 return nil, err 12451 } 12452 return ret, nil 12453 // { 12454 // "description": "Creates a new, empty table in the dataset.", 12455 // "httpMethod": "POST", 12456 // "id": "bigquery.tables.insert", 12457 // "parameterOrder": [ 12458 // "projectId", 12459 // "datasetId" 12460 // ], 12461 // "parameters": { 12462 // "datasetId": { 12463 // "description": "Dataset ID of the new table", 12464 // "location": "path", 12465 // "required": true, 12466 // "type": "string" 12467 // }, 12468 // "projectId": { 12469 // "description": "Project ID of the new table", 12470 // "location": "path", 12471 // "required": true, 12472 // "type": "string" 12473 // } 12474 // }, 12475 // "path": "projects/{projectId}/datasets/{datasetId}/tables", 12476 // "request": { 12477 // "$ref": "Table" 12478 // }, 12479 // "response": { 12480 // "$ref": "Table" 12481 // }, 12482 // "scopes": [ 12483 // "https://www.googleapis.com/auth/bigquery", 12484 // "https://www.googleapis.com/auth/cloud-platform" 12485 // ] 12486 // } 12487 12488} 12489 12490// method id "bigquery.tables.list": 12491 12492type TablesListCall struct { 12493 s *Service 12494 projectId string 12495 datasetId string 12496 urlParams_ gensupport.URLParams 12497 ifNoneMatch_ string 12498 ctx_ context.Context 12499 header_ http.Header 12500} 12501 12502// List: Lists all tables in the specified dataset. Requires the READER 12503// dataset role. 12504func (r *TablesService) List(projectId string, datasetId string) *TablesListCall { 12505 c := &TablesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12506 c.projectId = projectId 12507 c.datasetId = datasetId 12508 return c 12509} 12510 12511// MaxResults sets the optional parameter "maxResults": Maximum number 12512// of results to return 12513func (c *TablesListCall) MaxResults(maxResults int64) *TablesListCall { 12514 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 12515 return c 12516} 12517 12518// PageToken sets the optional parameter "pageToken": Page token, 12519// returned by a previous call, to request the next page of results 12520func (c *TablesListCall) PageToken(pageToken string) *TablesListCall { 12521 c.urlParams_.Set("pageToken", pageToken) 12522 return c 12523} 12524 12525// Fields allows partial responses to be retrieved. See 12526// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12527// for more information. 12528func (c *TablesListCall) Fields(s ...googleapi.Field) *TablesListCall { 12529 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12530 return c 12531} 12532 12533// IfNoneMatch sets the optional parameter which makes the operation 12534// fail if the object's ETag matches the given value. This is useful for 12535// getting updates only after the object has changed since the last 12536// request. Use googleapi.IsNotModified to check whether the response 12537// error from Do is the result of In-None-Match. 12538func (c *TablesListCall) IfNoneMatch(entityTag string) *TablesListCall { 12539 c.ifNoneMatch_ = entityTag 12540 return c 12541} 12542 12543// Context sets the context to be used in this call's Do method. Any 12544// pending HTTP request will be aborted if the provided context is 12545// canceled. 12546func (c *TablesListCall) Context(ctx context.Context) *TablesListCall { 12547 c.ctx_ = ctx 12548 return c 12549} 12550 12551// Header returns an http.Header that can be modified by the caller to 12552// add HTTP headers to the request. 12553func (c *TablesListCall) Header() http.Header { 12554 if c.header_ == nil { 12555 c.header_ = make(http.Header) 12556 } 12557 return c.header_ 12558} 12559 12560func (c *TablesListCall) doRequest(alt string) (*http.Response, error) { 12561 reqHeaders := make(http.Header) 12562 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 12563 for k, v := range c.header_ { 12564 reqHeaders[k] = v 12565 } 12566 reqHeaders.Set("User-Agent", c.s.userAgent()) 12567 if c.ifNoneMatch_ != "" { 12568 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12569 } 12570 var body io.Reader = nil 12571 c.urlParams_.Set("alt", alt) 12572 c.urlParams_.Set("prettyPrint", "false") 12573 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets/{datasetId}/tables") 12574 urls += "?" + c.urlParams_.Encode() 12575 req, err := http.NewRequest("GET", urls, body) 12576 if err != nil { 12577 return nil, err 12578 } 12579 req.Header = reqHeaders 12580 googleapi.Expand(req.URL, map[string]string{ 12581 "projectId": c.projectId, 12582 "datasetId": c.datasetId, 12583 }) 12584 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12585} 12586 12587// Do executes the "bigquery.tables.list" call. 12588// Exactly one of *TableList or error will be non-nil. Any non-2xx 12589// status code is an error. Response headers are in either 12590// *TableList.ServerResponse.Header or (if a response was returned at 12591// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 12592// to check whether the returned error was because 12593// http.StatusNotModified was returned. 12594func (c *TablesListCall) Do(opts ...googleapi.CallOption) (*TableList, error) { 12595 gensupport.SetOptions(c.urlParams_, opts...) 12596 res, err := c.doRequest("json") 12597 if res != nil && res.StatusCode == http.StatusNotModified { 12598 if res.Body != nil { 12599 res.Body.Close() 12600 } 12601 return nil, &googleapi.Error{ 12602 Code: res.StatusCode, 12603 Header: res.Header, 12604 } 12605 } 12606 if err != nil { 12607 return nil, err 12608 } 12609 defer googleapi.CloseBody(res) 12610 if err := googleapi.CheckResponse(res); err != nil { 12611 return nil, err 12612 } 12613 ret := &TableList{ 12614 ServerResponse: googleapi.ServerResponse{ 12615 Header: res.Header, 12616 HTTPStatusCode: res.StatusCode, 12617 }, 12618 } 12619 target := &ret 12620 if err := gensupport.DecodeResponse(target, res); err != nil { 12621 return nil, err 12622 } 12623 return ret, nil 12624 // { 12625 // "description": "Lists all tables in the specified dataset. Requires the READER dataset role.", 12626 // "httpMethod": "GET", 12627 // "id": "bigquery.tables.list", 12628 // "parameterOrder": [ 12629 // "projectId", 12630 // "datasetId" 12631 // ], 12632 // "parameters": { 12633 // "datasetId": { 12634 // "description": "Dataset ID of the tables to list", 12635 // "location": "path", 12636 // "required": true, 12637 // "type": "string" 12638 // }, 12639 // "maxResults": { 12640 // "description": "Maximum number of results to return", 12641 // "format": "uint32", 12642 // "location": "query", 12643 // "type": "integer" 12644 // }, 12645 // "pageToken": { 12646 // "description": "Page token, returned by a previous call, to request the next page of results", 12647 // "location": "query", 12648 // "type": "string" 12649 // }, 12650 // "projectId": { 12651 // "description": "Project ID of the tables to list", 12652 // "location": "path", 12653 // "required": true, 12654 // "type": "string" 12655 // } 12656 // }, 12657 // "path": "projects/{projectId}/datasets/{datasetId}/tables", 12658 // "response": { 12659 // "$ref": "TableList" 12660 // }, 12661 // "scopes": [ 12662 // "https://www.googleapis.com/auth/bigquery", 12663 // "https://www.googleapis.com/auth/bigquery.readonly", 12664 // "https://www.googleapis.com/auth/cloud-platform", 12665 // "https://www.googleapis.com/auth/cloud-platform.read-only" 12666 // ] 12667 // } 12668 12669} 12670 12671// Pages invokes f for each page of results. 12672// A non-nil error returned from f will halt the iteration. 12673// The provided context supersedes any context provided to the Context method. 12674func (c *TablesListCall) Pages(ctx context.Context, f func(*TableList) error) error { 12675 c.ctx_ = ctx 12676 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 12677 for { 12678 x, err := c.Do() 12679 if err != nil { 12680 return err 12681 } 12682 if err := f(x); err != nil { 12683 return err 12684 } 12685 if x.NextPageToken == "" { 12686 return nil 12687 } 12688 c.PageToken(x.NextPageToken) 12689 } 12690} 12691 12692// method id "bigquery.tables.patch": 12693 12694type TablesPatchCall struct { 12695 s *Service 12696 projectId string 12697 datasetId string 12698 tableId string 12699 table *Table 12700 urlParams_ gensupport.URLParams 12701 ctx_ context.Context 12702 header_ http.Header 12703} 12704 12705// Patch: Updates information in an existing table. The update method 12706// replaces the entire table resource, whereas the patch method only 12707// replaces fields that are provided in the submitted table resource. 12708// This method supports patch semantics. 12709func (r *TablesService) Patch(projectId string, datasetId string, tableId string, table *Table) *TablesPatchCall { 12710 c := &TablesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12711 c.projectId = projectId 12712 c.datasetId = datasetId 12713 c.tableId = tableId 12714 c.table = table 12715 return c 12716} 12717 12718// Fields allows partial responses to be retrieved. See 12719// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12720// for more information. 12721func (c *TablesPatchCall) Fields(s ...googleapi.Field) *TablesPatchCall { 12722 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12723 return c 12724} 12725 12726// Context sets the context to be used in this call's Do method. Any 12727// pending HTTP request will be aborted if the provided context is 12728// canceled. 12729func (c *TablesPatchCall) Context(ctx context.Context) *TablesPatchCall { 12730 c.ctx_ = ctx 12731 return c 12732} 12733 12734// Header returns an http.Header that can be modified by the caller to 12735// add HTTP headers to the request. 12736func (c *TablesPatchCall) Header() http.Header { 12737 if c.header_ == nil { 12738 c.header_ = make(http.Header) 12739 } 12740 return c.header_ 12741} 12742 12743func (c *TablesPatchCall) doRequest(alt string) (*http.Response, error) { 12744 reqHeaders := make(http.Header) 12745 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 12746 for k, v := range c.header_ { 12747 reqHeaders[k] = v 12748 } 12749 reqHeaders.Set("User-Agent", c.s.userAgent()) 12750 var body io.Reader = nil 12751 body, err := googleapi.WithoutDataWrapper.JSONReader(c.table) 12752 if err != nil { 12753 return nil, err 12754 } 12755 reqHeaders.Set("Content-Type", "application/json") 12756 c.urlParams_.Set("alt", alt) 12757 c.urlParams_.Set("prettyPrint", "false") 12758 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets/{datasetId}/tables/{tableId}") 12759 urls += "?" + c.urlParams_.Encode() 12760 req, err := http.NewRequest("PATCH", urls, body) 12761 if err != nil { 12762 return nil, err 12763 } 12764 req.Header = reqHeaders 12765 googleapi.Expand(req.URL, map[string]string{ 12766 "projectId": c.projectId, 12767 "datasetId": c.datasetId, 12768 "tableId": c.tableId, 12769 }) 12770 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12771} 12772 12773// Do executes the "bigquery.tables.patch" call. 12774// Exactly one of *Table or error will be non-nil. Any non-2xx status 12775// code is an error. Response headers are in either 12776// *Table.ServerResponse.Header or (if a response was returned at all) 12777// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 12778// check whether the returned error was because http.StatusNotModified 12779// was returned. 12780func (c *TablesPatchCall) Do(opts ...googleapi.CallOption) (*Table, error) { 12781 gensupport.SetOptions(c.urlParams_, opts...) 12782 res, err := c.doRequest("json") 12783 if res != nil && res.StatusCode == http.StatusNotModified { 12784 if res.Body != nil { 12785 res.Body.Close() 12786 } 12787 return nil, &googleapi.Error{ 12788 Code: res.StatusCode, 12789 Header: res.Header, 12790 } 12791 } 12792 if err != nil { 12793 return nil, err 12794 } 12795 defer googleapi.CloseBody(res) 12796 if err := googleapi.CheckResponse(res); err != nil { 12797 return nil, err 12798 } 12799 ret := &Table{ 12800 ServerResponse: googleapi.ServerResponse{ 12801 Header: res.Header, 12802 HTTPStatusCode: res.StatusCode, 12803 }, 12804 } 12805 target := &ret 12806 if err := gensupport.DecodeResponse(target, res); err != nil { 12807 return nil, err 12808 } 12809 return ret, nil 12810 // { 12811 // "description": "Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource. This method supports patch semantics.", 12812 // "httpMethod": "PATCH", 12813 // "id": "bigquery.tables.patch", 12814 // "parameterOrder": [ 12815 // "projectId", 12816 // "datasetId", 12817 // "tableId" 12818 // ], 12819 // "parameters": { 12820 // "datasetId": { 12821 // "description": "Dataset ID of the table to update", 12822 // "location": "path", 12823 // "required": true, 12824 // "type": "string" 12825 // }, 12826 // "projectId": { 12827 // "description": "Project ID of the table to update", 12828 // "location": "path", 12829 // "required": true, 12830 // "type": "string" 12831 // }, 12832 // "tableId": { 12833 // "description": "Table ID of the table to update", 12834 // "location": "path", 12835 // "required": true, 12836 // "type": "string" 12837 // } 12838 // }, 12839 // "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}", 12840 // "request": { 12841 // "$ref": "Table" 12842 // }, 12843 // "response": { 12844 // "$ref": "Table" 12845 // }, 12846 // "scopes": [ 12847 // "https://www.googleapis.com/auth/bigquery", 12848 // "https://www.googleapis.com/auth/cloud-platform" 12849 // ] 12850 // } 12851 12852} 12853 12854// method id "bigquery.tables.setIamPolicy": 12855 12856type TablesSetIamPolicyCall struct { 12857 s *Service 12858 resource string 12859 setiampolicyrequest *SetIamPolicyRequest 12860 urlParams_ gensupport.URLParams 12861 ctx_ context.Context 12862 header_ http.Header 12863} 12864 12865// SetIamPolicy: Sets the access control policy on the specified 12866// resource. Replaces any 12867// existing policy. 12868// 12869// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` 12870// errors. 12871func (r *TablesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *TablesSetIamPolicyCall { 12872 c := &TablesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12873 c.resource = resource 12874 c.setiampolicyrequest = setiampolicyrequest 12875 return c 12876} 12877 12878// Fields allows partial responses to be retrieved. See 12879// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12880// for more information. 12881func (c *TablesSetIamPolicyCall) Fields(s ...googleapi.Field) *TablesSetIamPolicyCall { 12882 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12883 return c 12884} 12885 12886// Context sets the context to be used in this call's Do method. Any 12887// pending HTTP request will be aborted if the provided context is 12888// canceled. 12889func (c *TablesSetIamPolicyCall) Context(ctx context.Context) *TablesSetIamPolicyCall { 12890 c.ctx_ = ctx 12891 return c 12892} 12893 12894// Header returns an http.Header that can be modified by the caller to 12895// add HTTP headers to the request. 12896func (c *TablesSetIamPolicyCall) Header() http.Header { 12897 if c.header_ == nil { 12898 c.header_ = make(http.Header) 12899 } 12900 return c.header_ 12901} 12902 12903func (c *TablesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 12904 reqHeaders := make(http.Header) 12905 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 12906 for k, v := range c.header_ { 12907 reqHeaders[k] = v 12908 } 12909 reqHeaders.Set("User-Agent", c.s.userAgent()) 12910 var body io.Reader = nil 12911 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 12912 if err != nil { 12913 return nil, err 12914 } 12915 reqHeaders.Set("Content-Type", "application/json") 12916 c.urlParams_.Set("alt", alt) 12917 c.urlParams_.Set("prettyPrint", "false") 12918 urls := googleapi.ResolveRelative(c.s.BasePath, "{+resource}:setIamPolicy") 12919 urls += "?" + c.urlParams_.Encode() 12920 req, err := http.NewRequest("POST", urls, body) 12921 if err != nil { 12922 return nil, err 12923 } 12924 req.Header = reqHeaders 12925 googleapi.Expand(req.URL, map[string]string{ 12926 "resource": c.resource, 12927 }) 12928 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12929} 12930 12931// Do executes the "bigquery.tables.setIamPolicy" call. 12932// Exactly one of *Policy or error will be non-nil. Any non-2xx status 12933// code is an error. Response headers are in either 12934// *Policy.ServerResponse.Header or (if a response was returned at all) 12935// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 12936// check whether the returned error was because http.StatusNotModified 12937// was returned. 12938func (c *TablesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 12939 gensupport.SetOptions(c.urlParams_, opts...) 12940 res, err := c.doRequest("json") 12941 if res != nil && res.StatusCode == http.StatusNotModified { 12942 if res.Body != nil { 12943 res.Body.Close() 12944 } 12945 return nil, &googleapi.Error{ 12946 Code: res.StatusCode, 12947 Header: res.Header, 12948 } 12949 } 12950 if err != nil { 12951 return nil, err 12952 } 12953 defer googleapi.CloseBody(res) 12954 if err := googleapi.CheckResponse(res); err != nil { 12955 return nil, err 12956 } 12957 ret := &Policy{ 12958 ServerResponse: googleapi.ServerResponse{ 12959 Header: res.Header, 12960 HTTPStatusCode: res.StatusCode, 12961 }, 12962 } 12963 target := &ret 12964 if err := gensupport.DecodeResponse(target, res); err != nil { 12965 return nil, err 12966 } 12967 return ret, nil 12968 // { 12969 // "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.\n\nCan return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.", 12970 // "flatPath": "projects/{projectsId}/datasets/{datasetsId}/tables/{tablesId}:setIamPolicy", 12971 // "httpMethod": "POST", 12972 // "id": "bigquery.tables.setIamPolicy", 12973 // "parameterOrder": [ 12974 // "resource" 12975 // ], 12976 // "parameters": { 12977 // "resource": { 12978 // "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.", 12979 // "location": "path", 12980 // "pattern": "^projects/[^/]+/datasets/[^/]+/tables/[^/]+$", 12981 // "required": true, 12982 // "type": "string" 12983 // } 12984 // }, 12985 // "path": "{+resource}:setIamPolicy", 12986 // "request": { 12987 // "$ref": "SetIamPolicyRequest" 12988 // }, 12989 // "response": { 12990 // "$ref": "Policy" 12991 // }, 12992 // "scopes": [ 12993 // "https://www.googleapis.com/auth/bigquery", 12994 // "https://www.googleapis.com/auth/cloud-platform" 12995 // ] 12996 // } 12997 12998} 12999 13000// method id "bigquery.tables.testIamPermissions": 13001 13002type TablesTestIamPermissionsCall struct { 13003 s *Service 13004 resource string 13005 testiampermissionsrequest *TestIamPermissionsRequest 13006 urlParams_ gensupport.URLParams 13007 ctx_ context.Context 13008 header_ http.Header 13009} 13010 13011// TestIamPermissions: Returns permissions that a caller has on the 13012// specified resource. 13013// If the resource does not exist, this will return an empty set 13014// of 13015// permissions, not a `NOT_FOUND` error. 13016// 13017// Note: This operation is designed to be used for building 13018// permission-aware 13019// UIs and command-line tools, not for authorization checking. This 13020// operation 13021// may "fail open" without warning. 13022func (r *TablesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *TablesTestIamPermissionsCall { 13023 c := &TablesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13024 c.resource = resource 13025 c.testiampermissionsrequest = testiampermissionsrequest 13026 return c 13027} 13028 13029// Fields allows partial responses to be retrieved. See 13030// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13031// for more information. 13032func (c *TablesTestIamPermissionsCall) Fields(s ...googleapi.Field) *TablesTestIamPermissionsCall { 13033 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13034 return c 13035} 13036 13037// Context sets the context to be used in this call's Do method. Any 13038// pending HTTP request will be aborted if the provided context is 13039// canceled. 13040func (c *TablesTestIamPermissionsCall) Context(ctx context.Context) *TablesTestIamPermissionsCall { 13041 c.ctx_ = ctx 13042 return c 13043} 13044 13045// Header returns an http.Header that can be modified by the caller to 13046// add HTTP headers to the request. 13047func (c *TablesTestIamPermissionsCall) Header() http.Header { 13048 if c.header_ == nil { 13049 c.header_ = make(http.Header) 13050 } 13051 return c.header_ 13052} 13053 13054func (c *TablesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 13055 reqHeaders := make(http.Header) 13056 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 13057 for k, v := range c.header_ { 13058 reqHeaders[k] = v 13059 } 13060 reqHeaders.Set("User-Agent", c.s.userAgent()) 13061 var body io.Reader = nil 13062 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 13063 if err != nil { 13064 return nil, err 13065 } 13066 reqHeaders.Set("Content-Type", "application/json") 13067 c.urlParams_.Set("alt", alt) 13068 c.urlParams_.Set("prettyPrint", "false") 13069 urls := googleapi.ResolveRelative(c.s.BasePath, "{+resource}:testIamPermissions") 13070 urls += "?" + c.urlParams_.Encode() 13071 req, err := http.NewRequest("POST", urls, body) 13072 if err != nil { 13073 return nil, err 13074 } 13075 req.Header = reqHeaders 13076 googleapi.Expand(req.URL, map[string]string{ 13077 "resource": c.resource, 13078 }) 13079 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13080} 13081 13082// Do executes the "bigquery.tables.testIamPermissions" call. 13083// Exactly one of *TestIamPermissionsResponse or error will be non-nil. 13084// Any non-2xx status code is an error. Response headers are in either 13085// *TestIamPermissionsResponse.ServerResponse.Header or (if a response 13086// was returned at all) in error.(*googleapi.Error).Header. Use 13087// googleapi.IsNotModified to check whether the returned error was 13088// because http.StatusNotModified was returned. 13089func (c *TablesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 13090 gensupport.SetOptions(c.urlParams_, opts...) 13091 res, err := c.doRequest("json") 13092 if res != nil && res.StatusCode == http.StatusNotModified { 13093 if res.Body != nil { 13094 res.Body.Close() 13095 } 13096 return nil, &googleapi.Error{ 13097 Code: res.StatusCode, 13098 Header: res.Header, 13099 } 13100 } 13101 if err != nil { 13102 return nil, err 13103 } 13104 defer googleapi.CloseBody(res) 13105 if err := googleapi.CheckResponse(res); err != nil { 13106 return nil, err 13107 } 13108 ret := &TestIamPermissionsResponse{ 13109 ServerResponse: googleapi.ServerResponse{ 13110 Header: res.Header, 13111 HTTPStatusCode: res.StatusCode, 13112 }, 13113 } 13114 target := &ret 13115 if err := gensupport.DecodeResponse(target, res); err != nil { 13116 return nil, err 13117 } 13118 return ret, nil 13119 // { 13120 // "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a `NOT_FOUND` error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.", 13121 // "flatPath": "projects/{projectsId}/datasets/{datasetsId}/tables/{tablesId}:testIamPermissions", 13122 // "httpMethod": "POST", 13123 // "id": "bigquery.tables.testIamPermissions", 13124 // "parameterOrder": [ 13125 // "resource" 13126 // ], 13127 // "parameters": { 13128 // "resource": { 13129 // "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.", 13130 // "location": "path", 13131 // "pattern": "^projects/[^/]+/datasets/[^/]+/tables/[^/]+$", 13132 // "required": true, 13133 // "type": "string" 13134 // } 13135 // }, 13136 // "path": "{+resource}:testIamPermissions", 13137 // "request": { 13138 // "$ref": "TestIamPermissionsRequest" 13139 // }, 13140 // "response": { 13141 // "$ref": "TestIamPermissionsResponse" 13142 // }, 13143 // "scopes": [ 13144 // "https://www.googleapis.com/auth/bigquery", 13145 // "https://www.googleapis.com/auth/bigquery.readonly", 13146 // "https://www.googleapis.com/auth/cloud-platform", 13147 // "https://www.googleapis.com/auth/cloud-platform.read-only" 13148 // ] 13149 // } 13150 13151} 13152 13153// method id "bigquery.tables.update": 13154 13155type TablesUpdateCall struct { 13156 s *Service 13157 projectId string 13158 datasetId string 13159 tableId string 13160 table *Table 13161 urlParams_ gensupport.URLParams 13162 ctx_ context.Context 13163 header_ http.Header 13164} 13165 13166// Update: Updates information in an existing table. The update method 13167// replaces the entire table resource, whereas the patch method only 13168// replaces fields that are provided in the submitted table resource. 13169func (r *TablesService) Update(projectId string, datasetId string, tableId string, table *Table) *TablesUpdateCall { 13170 c := &TablesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13171 c.projectId = projectId 13172 c.datasetId = datasetId 13173 c.tableId = tableId 13174 c.table = table 13175 return c 13176} 13177 13178// Fields allows partial responses to be retrieved. See 13179// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13180// for more information. 13181func (c *TablesUpdateCall) Fields(s ...googleapi.Field) *TablesUpdateCall { 13182 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13183 return c 13184} 13185 13186// Context sets the context to be used in this call's Do method. Any 13187// pending HTTP request will be aborted if the provided context is 13188// canceled. 13189func (c *TablesUpdateCall) Context(ctx context.Context) *TablesUpdateCall { 13190 c.ctx_ = ctx 13191 return c 13192} 13193 13194// Header returns an http.Header that can be modified by the caller to 13195// add HTTP headers to the request. 13196func (c *TablesUpdateCall) Header() http.Header { 13197 if c.header_ == nil { 13198 c.header_ = make(http.Header) 13199 } 13200 return c.header_ 13201} 13202 13203func (c *TablesUpdateCall) doRequest(alt string) (*http.Response, error) { 13204 reqHeaders := make(http.Header) 13205 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 13206 for k, v := range c.header_ { 13207 reqHeaders[k] = v 13208 } 13209 reqHeaders.Set("User-Agent", c.s.userAgent()) 13210 var body io.Reader = nil 13211 body, err := googleapi.WithoutDataWrapper.JSONReader(c.table) 13212 if err != nil { 13213 return nil, err 13214 } 13215 reqHeaders.Set("Content-Type", "application/json") 13216 c.urlParams_.Set("alt", alt) 13217 c.urlParams_.Set("prettyPrint", "false") 13218 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets/{datasetId}/tables/{tableId}") 13219 urls += "?" + c.urlParams_.Encode() 13220 req, err := http.NewRequest("PUT", urls, body) 13221 if err != nil { 13222 return nil, err 13223 } 13224 req.Header = reqHeaders 13225 googleapi.Expand(req.URL, map[string]string{ 13226 "projectId": c.projectId, 13227 "datasetId": c.datasetId, 13228 "tableId": c.tableId, 13229 }) 13230 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13231} 13232 13233// Do executes the "bigquery.tables.update" call. 13234// Exactly one of *Table or error will be non-nil. Any non-2xx status 13235// code is an error. Response headers are in either 13236// *Table.ServerResponse.Header or (if a response was returned at all) 13237// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 13238// check whether the returned error was because http.StatusNotModified 13239// was returned. 13240func (c *TablesUpdateCall) Do(opts ...googleapi.CallOption) (*Table, error) { 13241 gensupport.SetOptions(c.urlParams_, opts...) 13242 res, err := c.doRequest("json") 13243 if res != nil && res.StatusCode == http.StatusNotModified { 13244 if res.Body != nil { 13245 res.Body.Close() 13246 } 13247 return nil, &googleapi.Error{ 13248 Code: res.StatusCode, 13249 Header: res.Header, 13250 } 13251 } 13252 if err != nil { 13253 return nil, err 13254 } 13255 defer googleapi.CloseBody(res) 13256 if err := googleapi.CheckResponse(res); err != nil { 13257 return nil, err 13258 } 13259 ret := &Table{ 13260 ServerResponse: googleapi.ServerResponse{ 13261 Header: res.Header, 13262 HTTPStatusCode: res.StatusCode, 13263 }, 13264 } 13265 target := &ret 13266 if err := gensupport.DecodeResponse(target, res); err != nil { 13267 return nil, err 13268 } 13269 return ret, nil 13270 // { 13271 // "description": "Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource.", 13272 // "httpMethod": "PUT", 13273 // "id": "bigquery.tables.update", 13274 // "parameterOrder": [ 13275 // "projectId", 13276 // "datasetId", 13277 // "tableId" 13278 // ], 13279 // "parameters": { 13280 // "datasetId": { 13281 // "description": "Dataset ID of the table to update", 13282 // "location": "path", 13283 // "required": true, 13284 // "type": "string" 13285 // }, 13286 // "projectId": { 13287 // "description": "Project ID of the table to update", 13288 // "location": "path", 13289 // "required": true, 13290 // "type": "string" 13291 // }, 13292 // "tableId": { 13293 // "description": "Table ID of the table to update", 13294 // "location": "path", 13295 // "required": true, 13296 // "type": "string" 13297 // } 13298 // }, 13299 // "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}", 13300 // "request": { 13301 // "$ref": "Table" 13302 // }, 13303 // "response": { 13304 // "$ref": "Table" 13305 // }, 13306 // "scopes": [ 13307 // "https://www.googleapis.com/auth/bigquery", 13308 // "https://www.googleapis.com/auth/cloud-platform" 13309 // ] 13310 // } 13311 13312} 13313