Package dataform is an auto-generated package for the Dataform API.
Service to develop, version control, and operationalize SQL pipelines in BigQuery.
NOTE: This package is in beta. It is not stable, and may be subject to changes.
General documentation
For information that is relevant for all client libraries please reference https://pkg.go.dev/cloud.google.com/go#pkg-overview. Some information on this page includes:
- Authentication and Authorization
- Timeouts and Cancellation
- Testing against Client Libraries
- Debugging Client Libraries
- Inspecting errors
Example usage
To get started with this package, create a client.
// go get cloud.google.com/go/dataform/apiv1@latest ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := dataform.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close()
The client will use your default application credentials. Clients should be reused instead of created as needed. The methods of Client are safe for concurrent use by multiple goroutines. The returned client must be Closed when it is done being used.
Using the Client
The following is an example of making an API call with the newly created client, mentioned above.
req := &dataformpb.CancelWorkflowInvocationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1/dataformpb#CancelWorkflowInvocationRequest. } resp, err := c.CancelWorkflowInvocation(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Use of Context
The ctx passed to NewClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.
To close the open connection, use the Close() method.
Functions
func DefaultAuthScopes
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
CallOptions
type CallOptions struct {
ListRepositories []gax.CallOption
GetRepository []gax.CallOption
CreateRepository []gax.CallOption
UpdateRepository []gax.CallOption
DeleteRepository []gax.CallOption
CommitRepositoryChanges []gax.CallOption
ReadRepositoryFile []gax.CallOption
QueryRepositoryDirectoryContents []gax.CallOption
FetchRepositoryHistory []gax.CallOption
ComputeRepositoryAccessTokenStatus []gax.CallOption
FetchRemoteBranches []gax.CallOption
ListWorkspaces []gax.CallOption
GetWorkspace []gax.CallOption
CreateWorkspace []gax.CallOption
DeleteWorkspace []gax.CallOption
InstallNpmPackages []gax.CallOption
PullGitCommits []gax.CallOption
PushGitCommits []gax.CallOption
FetchFileGitStatuses []gax.CallOption
FetchGitAheadBehind []gax.CallOption
CommitWorkspaceChanges []gax.CallOption
ResetWorkspaceChanges []gax.CallOption
FetchFileDiff []gax.CallOption
QueryDirectoryContents []gax.CallOption
SearchFiles []gax.CallOption
MakeDirectory []gax.CallOption
RemoveDirectory []gax.CallOption
MoveDirectory []gax.CallOption
ReadFile []gax.CallOption
RemoveFile []gax.CallOption
MoveFile []gax.CallOption
WriteFile []gax.CallOption
ListReleaseConfigs []gax.CallOption
GetReleaseConfig []gax.CallOption
CreateReleaseConfig []gax.CallOption
UpdateReleaseConfig []gax.CallOption
DeleteReleaseConfig []gax.CallOption
ListCompilationResults []gax.CallOption
GetCompilationResult []gax.CallOption
CreateCompilationResult []gax.CallOption
QueryCompilationResultActions []gax.CallOption
ListWorkflowConfigs []gax.CallOption
GetWorkflowConfig []gax.CallOption
CreateWorkflowConfig []gax.CallOption
UpdateWorkflowConfig []gax.CallOption
DeleteWorkflowConfig []gax.CallOption
ListWorkflowInvocations []gax.CallOption
GetWorkflowInvocation []gax.CallOption
CreateWorkflowInvocation []gax.CallOption
DeleteWorkflowInvocation []gax.CallOption
CancelWorkflowInvocation []gax.CallOption
QueryWorkflowInvocationActions []gax.CallOption
GetConfig []gax.CallOption
UpdateConfig []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
GetIamPolicy []gax.CallOption
SetIamPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
}
CallOptions contains the retry settings for each method of Client.
Client
type Client struct {
// The call options for this service.
CallOptions *CallOptions
// contains filtered or unexported fields
}
Client is a client for interacting with Dataform API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Dataform is a service to develop, create, document, test, and update curated tables in BigQuery.
func NewClient
NewClient creates a new dataform client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Dataform is a service to develop, create, document, test, and update curated tables in BigQuery.
Example
package main
import (
"context"
dataform "cloud.google.com/go/dataform/apiv1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := dataform.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewRESTClient
NewRESTClient creates a new dataform rest client.
Dataform is a service to develop, create, document, test, and update curated tables in BigQuery.
Example
package main
import (
"context"
dataform "cloud.google.com/go/dataform/apiv1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := dataform.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*Client) CancelWorkflowInvocation
func (c *Client) CancelWorkflowInvocation(ctx context.Context, req *dataformpb.CancelWorkflowInvocationRequest, opts ...gax.CallOption) (*dataformpb.CancelWorkflowInvocationResponse, error)
CancelWorkflowInvocation requests cancellation of a running WorkflowInvocation.
Example
package main
import (
"context"
dataform "cloud.google.com/go/dataform/apiv1"
dataformpb "cloud.google.com/go/dataform/apiv1/dataformpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := dataform.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dataformpb.CancelWorkflowInvocationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1/dataformpb#CancelWorkflowInvocationRequest.
}
resp, err := c.CancelWorkflowInvocation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
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) CommitRepositoryChanges
func (c *Client) CommitRepositoryChanges(ctx context.Context, req *dataformpb.CommitRepositoryChangesRequest, opts ...gax.CallOption) (*dataformpb.CommitRepositoryChangesResponse, error)
CommitRepositoryChanges applies a Git commit to a Repository. The Repository must not have a value for git_remote_settings.url.
Example
package main
import (
"context"
dataform "cloud.google.com/go/dataform/apiv1"
dataformpb "cloud.google.com/go/dataform/apiv1/dataformpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := dataform.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dataformpb.CommitRepositoryChangesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1/dataformpb#CommitRepositoryChangesRequest.
}
resp, err := c.CommitRepositoryChanges(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) CommitWorkspaceChanges
func (c *Client) CommitWorkspaceChanges(ctx context.Context, req *dataformpb.CommitWorkspaceChangesRequest, opts ...gax.CallOption) (*dataformpb.CommitWorkspaceChangesResponse, error)
CommitWorkspaceChanges applies a Git commit for uncommitted files in a Workspace.
Example
package main
import (
"context"
dataform "cloud.google.com/go/dataform/apiv1"
dataformpb "cloud.google.com/go/dataform/apiv1/dataformpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := dataform.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dataformpb.CommitWorkspaceChangesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1/dataformpb#CommitWorkspaceChangesRequest.
}
resp, err := c.CommitWorkspaceChanges(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) ComputeRepositoryAccessTokenStatus
func (c *Client) ComputeRepositoryAccessTokenStatus(ctx context.Context, req *dataformpb.ComputeRepositoryAccessTokenStatusRequest, opts ...gax.CallOption) (*dataformpb.ComputeRepositoryAccessTokenStatusResponse, error)
ComputeRepositoryAccessTokenStatus computes a Repository’s Git access token status.
Example
package main
import (
"context"
dataform "cloud.google.com/go/dataform/apiv1"
dataformpb "cloud.google.com/go/dataform/apiv1/dataformpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := dataform.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dataformpb.ComputeRepositoryAccessTokenStatusRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1/dataformpb#ComputeRepositoryAccessTokenStatusRequest.
}
resp, err := c.ComputeRepositoryAccessTokenStatus(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) Connection (deprecated)
func (c *Client) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*Client) CreateCompilationResult
func (c *Client) CreateCompilationResult(ctx context.Context, req *dataformpb.CreateCompilationResultRequest, opts ...gax.CallOption) (*dataformpb.CompilationResult, error)
CreateCompilationResult creates a new CompilationResult in a given project and location.
Example
package main
import (
"context"
dataform "cloud.google.com/go/dataform/apiv1"
dataformpb "cloud.google.com/go/dataform/apiv1/dataformpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := dataform.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dataformpb.CreateCompilationResultRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1/dataformpb#CreateCompilationResultRequest.
}
resp, err := c.CreateCompilationResult(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) CreateReleaseConfig
func (c *Client) CreateReleaseConfig(ctx context.Context, req *dataformpb.CreateReleaseConfigRequest, opts ...gax.CallOption) (*dataformpb.ReleaseConfig, error)
CreateReleaseConfig creates a new ReleaseConfig in a given Repository.
Example
package main
import (
"context"
dataform "cloud.google.com/go/dataform/apiv1"
dataformpb "cloud.google.com/go/dataform/apiv1/dataformpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := dataform.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dataformpb.CreateReleaseConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1/dataformpb#CreateReleaseConfigRequest.
}
resp, err := c.CreateReleaseConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) CreateRepository
func (c *Client) CreateRepository(ctx context.Context, req *dataformpb.CreateRepositoryRequest, opts ...gax.CallOption) (*dataformpb.Repository, error)
CreateRepository creates a new Repository in a given project and location.
Example
package main
import (
"context"
dataform "cloud.google.com/go/dataform/apiv1"
dataformpb "cloud.google.com/go/dataform/apiv1/dataformpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := dataform.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dataformpb.CreateRepositoryRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1/dataformpb#CreateRepositoryRequest.
}
resp, err := c.CreateRepository(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) CreateWorkflowConfig
func (c *Client) CreateWorkflowConfig(ctx context.Context, req *dataformpb.CreateWorkflowConfigRequest, opts ...gax.CallOption) (*dataformpb.WorkflowConfig, error)
CreateWorkflowConfig creates a new WorkflowConfig in a given Repository.
Example
package main
import (
"context"
dataform "cloud.google.com/go/dataform/apiv1"
dataformpb "cloud.google.com/go/dataform/apiv1/dataformpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := dataform.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dataformpb.CreateWorkflowConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1/dataformpb#CreateWorkflowConfigRequest.
}
resp, err := c.CreateWorkflowConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) CreateWorkflowInvocation
func (c *Client) CreateWorkflowInvocation(ctx context.Context, req *dataformpb.CreateWorkflowInvocationRequest, opts ...gax.CallOption) (*dataformpb.WorkflowInvocation, error)
CreateWorkflowInvocation creates a new WorkflowInvocation in a given Repository.
Example
package main
import (
"context"
dataform "cloud.google.com/go/dataform/apiv1"
dataformpb "cloud.google.com/go/dataform/apiv1/dataformpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := dataform.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dataformpb.CreateWorkflowInvocationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1/dataformpb#CreateWorkflowInvocationRequest.
}
resp, err := c.CreateWorkflowInvocation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) CreateWorkspace
func (c *Client) CreateWorkspace(ctx context.Context, req *dataformpb.CreateWorkspaceRequest, opts ...gax.CallOption) (*dataformpb.Workspace, error)
CreateWorkspace creates a new Workspace in a given Repository.
Example
package main
import (
"context"
dataform "cloud.google.com/go/dataform/apiv1"
dataformpb "cloud.google.com/go/dataform/apiv1/dataformpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := dataform.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dataformpb.CreateWorkspaceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1/dataformpb#CreateWorkspaceRequest.
}
resp, err := c.CreateWorkspace(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) DeleteReleaseConfig
func (c *Client) DeleteReleaseConfig(ctx context.Context, req *dataformpb.DeleteReleaseConfigRequest, opts ...gax.CallOption) error
DeleteReleaseConfig deletes a single ReleaseConfig.
Example
package main
import (
"context"
dataform "cloud.google.com/go/dataform/apiv1"
dataformpb "cloud.google.com/go/dataform/apiv1/dataformpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := dataform.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dataformpb.DeleteReleaseConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1/dataformpb#DeleteReleaseConfigRequest.
}
err = c.DeleteReleaseConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*Client) DeleteRepository
func (c *Client) DeleteRepository(ctx context.Context, req *dataformpb.DeleteRepositoryRequest, opts ...gax.CallOption) error
DeleteRepository deletes a single Repository.
Example
package main
import (
"context"
dataform "cloud.google.com/go/dataform/apiv1"
dataformpb "cloud.google.com/go/dataform/apiv1/dataformpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := dataform.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dataformpb.DeleteRepositoryRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1/dataformpb#DeleteRepositoryRequest.
}
err = c.DeleteRepository(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*Client) DeleteWorkflowConfig
func (c *Client) DeleteWorkflowConfig(ctx context.Context, req *dataformpb.DeleteWorkflowConfigRequest, opts ...gax.CallOption) error
DeleteWorkflowConfig deletes a single WorkflowConfig.
Example
package main
import (
"context"
dataform "cloud.google.com/go/dataform/apiv1"
dataformpb "cloud.google.com/go/dataform/apiv1/dataformpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := dataform.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dataformpb.DeleteWorkflowConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1/dataformpb#DeleteWorkflowConfigRequest.
}
err = c.DeleteWorkflowConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*Client) DeleteWorkflowInvocation
func (c *Client) DeleteWorkflowInvocation(ctx context.Context, req *dataformpb.DeleteWorkflowInvocationRequest, opts ...gax.CallOption)