You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

5926 line
212 KiB

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