Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 

6231 lignes
223 KiB

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