Documentation ¶
Overview ¶
Package datatransfer is an auto-generated package for the BigQuery Data Transfer API.
NOTE: This package is in alpha. It is not stable, and is likely to change.
Transfers data from partner SaaS applications to Google BigQuery on a scheduled, managed basis.
Index ¶
- func DataSourcePath(project, dataSource string) string
- func DefaultAuthScopes() []string
- func LocationDataSourcePath(project, location, dataSource string) string
- func LocationPath(project, location string) string
- func LocationRunPath(project, location, transferConfig, run string) string
- func LocationTransferConfigPath(project, location, transferConfig string) string
- func ProjectPath(project string) string
- func RunPath(project, transferConfig, run string) string
- func TransferConfigPath(project, transferConfig string) string
- type CallOptions
- type Client
- func (c *Client) CheckValidCreds(ctx context.Context, req *datatransferpb.CheckValidCredsRequest, ...) (*datatransferpb.CheckValidCredsResponse, error)
- func (c *Client) Close() error
- func (c *Client) Connection() *grpc.ClientConn
- func (c *Client) CreateTransferConfig(ctx context.Context, req *datatransferpb.CreateTransferConfigRequest, ...) (*datatransferpb.TransferConfig, error)
- func (c *Client) DeleteTransferConfig(ctx context.Context, req *datatransferpb.DeleteTransferConfigRequest, ...) error
- func (c *Client) DeleteTransferRun(ctx context.Context, req *datatransferpb.DeleteTransferRunRequest, ...) error
- func (c *Client) GetDataSource(ctx context.Context, req *datatransferpb.GetDataSourceRequest, ...) (*datatransferpb.DataSource, error)
- func (c *Client) GetTransferConfig(ctx context.Context, req *datatransferpb.GetTransferConfigRequest, ...) (*datatransferpb.TransferConfig, error)
- func (c *Client) GetTransferRun(ctx context.Context, req *datatransferpb.GetTransferRunRequest, ...) (*datatransferpb.TransferRun, error)
- func (c *Client) ListDataSources(ctx context.Context, req *datatransferpb.ListDataSourcesRequest, ...) *DataSourceIterator
- func (c *Client) ListTransferConfigs(ctx context.Context, req *datatransferpb.ListTransferConfigsRequest, ...) *TransferConfigIterator
- func (c *Client) ListTransferLogs(ctx context.Context, req *datatransferpb.ListTransferLogsRequest, ...) *TransferMessageIterator
- func (c *Client) ListTransferRuns(ctx context.Context, req *datatransferpb.ListTransferRunsRequest, ...) *TransferRunIterator
- func (c *Client) ScheduleTransferRuns(ctx context.Context, req *datatransferpb.ScheduleTransferRunsRequest, ...) (*datatransferpb.ScheduleTransferRunsResponse, error)
- func (c *Client) UpdateTransferConfig(ctx context.Context, req *datatransferpb.UpdateTransferConfigRequest, ...) (*datatransferpb.TransferConfig, error)
- type DataSourceIterator
- type TransferConfigIterator
- type TransferMessageIterator
- type TransferRunIterator
Examples ¶
- Client.CheckValidCreds
- Client.CreateTransferConfig
- Client.DeleteTransferConfig
- Client.DeleteTransferRun
- Client.GetDataSource
- Client.GetTransferConfig
- Client.GetTransferRun
- Client.ListDataSources
- Client.ListTransferConfigs
- Client.ListTransferLogs
- Client.ListTransferRuns
- Client.ScheduleTransferRuns
- Client.UpdateTransferConfig
- NewClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DataSourcePath ¶
DataSourcePath returns the path for the data source resource.
func DefaultAuthScopes ¶
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
func LocationDataSourcePath ¶
LocationDataSourcePath returns the path for the location data source resource.
func LocationPath ¶
LocationPath returns the path for the location resource.
func LocationRunPath ¶
LocationRunPath returns the path for the location run resource.
func LocationTransferConfigPath ¶
LocationTransferConfigPath returns the path for the location transfer config resource.
func ProjectPath ¶
ProjectPath returns the path for the project resource.
func TransferConfigPath ¶
TransferConfigPath returns the path for the transfer config resource.
Types ¶
type CallOptions ¶
type CallOptions struct { GetDataSource []gax.CallOption ListDataSources []gax.CallOption CreateTransferConfig []gax.CallOption UpdateTransferConfig []gax.CallOption DeleteTransferConfig []gax.CallOption GetTransferConfig []gax.CallOption ListTransferConfigs []gax.CallOption ScheduleTransferRuns []gax.CallOption GetTransferRun []gax.CallOption DeleteTransferRun []gax.CallOption ListTransferRuns []gax.CallOption ListTransferLogs []gax.CallOption CheckValidCreds []gax.CallOption }
CallOptions contains the retry settings for each method of Client.
type Client ¶
type Client struct { // The call options for this service. CallOptions *CallOptions // contains filtered or unexported fields }
Client is a client for interacting with BigQuery Data Transfer API.
func NewClient ¶
NewClient creates a new data transfer service client.
The Google BigQuery Data Transfer Service API enables BigQuery users to configure the transfer of their data from other Google Products into BigQuery. This service contains methods that are end user exposed. It backs up the frontend.
Example ¶
ctx := context.Background() c, err := datatransfer.NewClient(ctx) if err != nil { // TODO: Handle error. } // TODO: Use client. _ = c
Output:
func (*Client) CheckValidCreds ¶
func (c *Client) CheckValidCreds(ctx context.Context, req *datatransferpb.CheckValidCredsRequest, opts ...gax.CallOption) (*datatransferpb.CheckValidCredsResponse, error)
CheckValidCreds returns true if valid credentials exist for the given data source and requesting user. Some data sources doesn't support service account, so we need to talk to them on behalf of the end user. This API just checks whether we have OAuth token for the particular user, which is a pre-requisite before user can create a transfer config.
Example ¶
ctx := context.Background() c, err := datatransfer.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datatransferpb.CheckValidCredsRequest{ // TODO: Fill request struct fields. } resp, err := c.CheckValidCreds(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Output:
func (*Client) Close ¶
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*Client) Connection ¶
func (c *Client) Connection() *grpc.ClientConn
Connection returns the client's connection to the API service.
func (*Client) CreateTransferConfig ¶
func (c *Client) CreateTransferConfig(ctx context.Context, req *datatransferpb.CreateTransferConfigRequest, opts ...gax.CallOption) (*datatransferpb.TransferConfig, error)
CreateTransferConfig creates a new data transfer configuration.
Example ¶
ctx := context.Background() c, err := datatransfer.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datatransferpb.CreateTransferConfigRequest{ // TODO: Fill request struct fields. } resp, err := c.CreateTransferConfig(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Output:
func (*Client) DeleteTransferConfig ¶
func (c *Client) DeleteTransferConfig(ctx context.Context, req *datatransferpb.DeleteTransferConfigRequest, opts ...gax.CallOption) error
DeleteTransferConfig deletes a data transfer configuration, including any associated transfer runs and logs.
Example ¶
ctx := context.Background() c, err := datatransfer.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datatransferpb.DeleteTransferConfigRequest{ // TODO: Fill request struct fields. } err = c.DeleteTransferConfig(ctx, req) if err != nil { // TODO: Handle error. }
Output:
func (*Client) DeleteTransferRun ¶
func (c *Client) DeleteTransferRun(ctx context.Context, req *datatransferpb.DeleteTransferRunRequest, opts ...gax.CallOption) error
DeleteTransferRun deletes the specified transfer run.
Example ¶
ctx := context.Background() c, err := datatransfer.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datatransferpb.DeleteTransferRunRequest{ // TODO: Fill request struct fields. } err = c.DeleteTransferRun(ctx, req) if err != nil { // TODO: Handle error. }
Output:
func (*Client) GetDataSource ¶
func (c *Client) GetDataSource(ctx context.Context, req *datatransferpb.GetDataSourceRequest, opts ...gax.CallOption) (*datatransferpb.DataSource, error)
GetDataSource retrieves a supported data source and returns its settings, which can be used for UI rendering.
Example ¶
ctx := context.Background() c, err := datatransfer.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datatransferpb.GetDataSourceRequest{ // TODO: Fill request struct fields. } resp, err := c.GetDataSource(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Output:
func (*Client) GetTransferConfig ¶
func (c *Client) GetTransferConfig(ctx context.Context, req *datatransferpb.GetTransferConfigRequest, opts ...gax.CallOption) (*datatransferpb.TransferConfig, error)
GetTransferConfig returns information about a data transfer config.
Example ¶
ctx := context.Background() c, err := datatransfer.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datatransferpb.GetTransferConfigRequest{ // TODO: Fill request struct fields. } resp, err := c.GetTransferConfig(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Output:
func (*Client) GetTransferRun ¶
func (c *Client) GetTransferRun(ctx context.Context, req *datatransferpb.GetTransferRunRequest, opts ...gax.CallOption) (*datatransferpb.TransferRun, error)
GetTransferRun returns information about the particular transfer run.
Example ¶
ctx := context.Background() c, err := datatransfer.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datatransferpb.GetTransferRunRequest{ // TODO: Fill request struct fields. } resp, err := c.GetTransferRun(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Output:
func (*Client) ListDataSources ¶
func (c *Client) ListDataSources(ctx context.Context, req *datatransferpb.ListDataSourcesRequest, opts ...gax.CallOption) *DataSourceIterator
ListDataSources lists supported data sources and returns their settings, which can be used for UI rendering.
Example ¶
ctx := context.Background() c, err := datatransfer.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datatransferpb.ListDataSourcesRequest{ // TODO: Fill request struct fields. } it := c.ListDataSources(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) ListTransferConfigs ¶
func (c *Client) ListTransferConfigs(ctx context.Context, req *datatransferpb.ListTransferConfigsRequest, opts ...gax.CallOption) *TransferConfigIterator
ListTransferConfigs returns information about all data transfers in the project.
Example ¶
ctx := context.Background() c, err := datatransfer.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datatransferpb.ListTransferConfigsRequest{ // TODO: Fill request struct fields. } it := c.ListTransferConfigs(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) ListTransferLogs ¶
func (c *Client) ListTransferLogs(ctx context.Context, req *datatransferpb.ListTransferLogsRequest, opts ...gax.CallOption) *TransferMessageIterator
ListTransferLogs returns user facing log messages for the data transfer run.
Example ¶
ctx := context.Background() c, err := datatransfer.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datatransferpb.ListTransferLogsRequest{ // TODO: Fill request struct fields. } it := c.ListTransferLogs(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) ListTransferRuns ¶
func (c *Client) ListTransferRuns(ctx context.Context, req *datatransferpb.ListTransferRunsRequest, opts ...gax.CallOption) *TransferRunIterator
ListTransferRuns returns information about running and completed jobs.
Example ¶
ctx := context.Background() c, err := datatransfer.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datatransferpb.ListTransferRunsRequest{ // TODO: Fill request struct fields. } it := c.ListTransferRuns(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) ScheduleTransferRuns ¶
func (c *Client) ScheduleTransferRuns(ctx context.Context, req *datatransferpb.ScheduleTransferRunsRequest, opts ...gax.CallOption) (*datatransferpb.ScheduleTransferRunsResponse, error)
ScheduleTransferRuns creates transfer runs for a time range [range_start_time, range_end_time]. For each date - or whatever granularity the data source supports - in the range, one transfer run is created. Note that runs are created per UTC time in the time range.
Example ¶
ctx := context.Background() c, err := datatransfer.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datatransferpb.ScheduleTransferRunsRequest{ // TODO: Fill request struct fields. } resp, err := c.ScheduleTransferRuns(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Output:
func (*Client) UpdateTransferConfig ¶
func (c *Client) UpdateTransferConfig(ctx context.Context, req *datatransferpb.UpdateTransferConfigRequest, opts ...gax.CallOption) (*datatransferpb.TransferConfig, error)
UpdateTransferConfig updates a data transfer configuration. All fields must be set, even if they are not updated.
Example ¶
ctx := context.Background() c, err := datatransfer.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datatransferpb.UpdateTransferConfigRequest{ // TODO: Fill request struct fields. } resp, err := c.UpdateTransferConfig(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Output:
type DataSourceIterator ¶
type DataSourceIterator struct { // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*datatransferpb.DataSource, nextPageToken string, err error) // contains filtered or unexported fields }
DataSourceIterator manages a stream of *datatransferpb.DataSource.
func (*DataSourceIterator) Next ¶
func (it *DataSourceIterator) Next() (*datatransferpb.DataSource, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*DataSourceIterator) PageInfo ¶
func (it *DataSourceIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type TransferConfigIterator ¶
type TransferConfigIterator struct { // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*datatransferpb.TransferConfig, nextPageToken string, err error) // contains filtered or unexported fields }
TransferConfigIterator manages a stream of *datatransferpb.TransferConfig.
func (*TransferConfigIterator) Next ¶
func (it *TransferConfigIterator) Next() (*datatransferpb.TransferConfig, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*TransferConfigIterator) PageInfo ¶
func (it *TransferConfigIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type TransferMessageIterator ¶
type TransferMessageIterator struct { // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*datatransferpb.TransferMessage, nextPageToken string, err error) // contains filtered or unexported fields }
TransferMessageIterator manages a stream of *datatransferpb.TransferMessage.
func (*TransferMessageIterator) Next ¶
func (it *TransferMessageIterator) Next() (*datatransferpb.TransferMessage, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*TransferMessageIterator) PageInfo ¶
func (it *TransferMessageIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type TransferRunIterator ¶
type TransferRunIterator struct { // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*datatransferpb.TransferRun, nextPageToken string, err error) // contains filtered or unexported fields }
TransferRunIterator manages a stream of *datatransferpb.TransferRun.
func (*TransferRunIterator) Next ¶
func (it *TransferRunIterator) Next() (*datatransferpb.TransferRun, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*TransferRunIterator) PageInfo ¶
func (it *TransferRunIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.