Package cloud.google.com/go/area120/tables/apiv1alpha1

Stay organized with collections Save and categorize content based on your preferences.

Package tables is an auto-generated package for the Area120 Tables API.

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.

For information about setting deadlines, reusing contexts, and more please visit pkg.go.dev/cloud.google.com/go.

Functions

func DefaultAuthScopes

func DefaultAuthScopes() []string

DefaultAuthScopes reports the default set of authentication scopes to use with this package.

CallOptions

type CallOptions struct {
	GetTable        []gax.CallOption
	ListTables      []gax.CallOption
	GetWorkspace    []gax.CallOption
	ListWorkspaces  []gax.CallOption
	GetRow          []gax.CallOption
	ListRows        []gax.CallOption
	CreateRow       []gax.CallOption
	BatchCreateRows []gax.CallOption
	UpdateRow       []gax.CallOption
	BatchUpdateRows []gax.CallOption
	DeleteRow       []gax.CallOption
	BatchDeleteRows []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 Area120 Tables API.

Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

func NewClient

func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error)

NewClient creates a new tables service client.

The Tables Service provides an API for reading and updating tables. It defines the following resource model:

The API has a collection of [Table][google.area120.tables.v1alpha1.Table] resources, named tables/*

Each Table has a collection of [Row][google.area120.tables.v1alpha1.Row] resources, named tables//rows/

The API has a collection of [Workspace][google.area120.tables.v1alpha1.Workspace] resources, named workspaces/*.

Examples
package main

import (
	tables "cloud.google.com/go/area120/tables/apiv1alpha1"
	"context"
)

func main() {
	ctx := context.Background()
	c, err := tables.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use client.
	_ = c
}

func (*Client) BatchCreateRows

BatchCreateRows creates multiple rows.

Examples
package main

import (
	tables "cloud.google.com/go/area120/tables/apiv1alpha1"
	"context"
	tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1"
)

func main() {
	// import tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1"

	ctx := context.Background()
	c, err := tables.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &tablespb.BatchCreateRowsRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.BatchCreateRows(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) BatchDeleteRows

func (c *Client) BatchDeleteRows(ctx context.Context, req *tablespb.BatchDeleteRowsRequest, opts ...gax.CallOption) error

BatchDeleteRows deletes multiple rows.

Examples
package main

import (
	tables "cloud.google.com/go/area120/tables/apiv1alpha1"
	"context"
	tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1"
)

func main() {
	ctx := context.Background()
	c, err := tables.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &tablespb.BatchDeleteRowsRequest{
		// TODO: Fill request struct fields.
	}
	err = c.BatchDeleteRows(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}

func (*Client) BatchUpdateRows

BatchUpdateRows updates multiple rows.

Examples
package main

import (
	tables "cloud.google.com/go/area120/tables/apiv1alpha1"
	"context"
	tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1"
)

func main() {
	// import tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1"

	ctx := context.Background()
	c, err := tables.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &tablespb.BatchUpdateRowsRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.BatchUpdateRows(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) Close

func (c *Client) Close() error

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 a connection to the API service.

Deprecated.

func (*Client) CreateRow

func (c *Client) CreateRow(ctx context.Context, req *tablespb.CreateRowRequest, opts ...gax.CallOption) (*tablespb.Row, error)

CreateRow creates a row.

Examples
package main

import (
	tables "cloud.google.com/go/area120/tables/apiv1alpha1"
	"context"
	tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1"
)

func main() {
	// import tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1"

	ctx := context.Background()
	c, err := tables.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &tablespb.CreateRowRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.CreateRow(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) DeleteRow

func (c *Client) DeleteRow(ctx context.Context, req *tablespb.DeleteRowRequest, opts ...gax.CallOption) error

DeleteRow deletes a row.

Examples
package main

import (
	tables "cloud.google.com/go/area120/tables/apiv1alpha1"
	"context"
	tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1"
)

func main() {
	ctx := context.Background()
	c, err := tables.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &tablespb.DeleteRowRequest{
		// TODO: Fill request struct fields.
	}
	err = c.DeleteRow(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}

func (*Client) GetRow

func (c *Client) GetRow(ctx context.Context, req *tablespb.GetRowRequest, opts ...gax.CallOption) (*tablespb.Row, error)

GetRow gets a row. Returns NOT_FOUND if the row does not exist in the table.

Examples
package main

import (
	tables "cloud.google.com/go/area120/tables/apiv1alpha1"
	"context"
	tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1"
)

func main() {
	// import tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1"

	ctx := context.Background()
	c, err := tables.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &tablespb.GetRowRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.GetRow(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) GetTable

func (c *Client) GetTable(ctx context.Context, req *tablespb.GetTableRequest, opts ...gax.CallOption) (*tablespb.Table, error)

GetTable gets a table. Returns NOT_FOUND if the table does not exist.

Examples
package main

import (
	tables "cloud.google.com/go/area120/tables/apiv1alpha1"
	"context"
	tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1"
)

func main() {
	// import tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1"

	ctx := context.Background()
	c, err := tables.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &tablespb.GetTableRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.GetTable(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) GetWorkspace

func (c *Client) GetWorkspace(ctx context.Context, req *tablespb.GetWorkspaceRequest, opts ...gax.CallOption) (*tablespb.Workspace, error)

GetWorkspace gets a workspace. Returns NOT_FOUND if the workspace does not exist.

Examples
package main

import (
	tables "cloud.google.com/go/area120/tables/apiv1alpha1"
	"context"
	tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1"
)

func main() {
	// import tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1"

	ctx := context.Background()
	c, err := tables.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &tablespb.GetWorkspaceRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.GetWorkspace(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) ListRows

func (c *Client) ListRows(ctx context.Context, req *tablespb.ListRowsRequest, opts ...gax.CallOption) *RowIterator

ListRows lists rows in a table. Returns NOT_FOUND if the table does not exist.

Examples
package main

import (
	tables "cloud.google.com/go/area120/tables/apiv1alpha1"
	"context"
	"google.golang.org/api/iterator"
	tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1"
)

func main() {
	// import tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1"
	// import "google.golang.org/api/iterator"

	ctx := context.Background()
	c, err := tables.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &tablespb.ListRowsRequest{
		// TODO: Fill request struct fields.
	}
	it := c.ListRows(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*Client) ListTables

func (c *Client) ListTables(ctx context.Context, req *tablespb.ListTablesRequest, opts ...gax.CallOption) *TableIterator

ListTables lists tables for the user.

Examples
package main

import (
	tables "cloud.google.com/go/area120/tables/apiv1alpha1"
	"context"
	"google.golang.org/api/iterator"
	tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1"
)

func main() {
	// import tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1"
	// import "google.golang.org/api/iterator"

	ctx := context.Background()
	c, err := tables.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &tablespb.ListTablesRequest{
		// TODO: Fill request struct fields.
	}
	it := c.ListTables(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*Client) ListWorkspaces

func (c *Client) ListWorkspaces(ctx context.Context, req *tablespb.ListWorkspacesRequest, opts ...gax.CallOption) *WorkspaceIterator

ListWorkspaces lists workspaces for the user.

Examples
package main

import (
	tables "cloud.google.com/go/area120/tables/apiv1alpha1"
	"context"
	"google.golang.org/api/iterator"
	tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1"
)

func main() {
	// import tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1"
	// import "google.golang.org/api/iterator"

	ctx := context.Background()
	c, err := tables.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &tablespb.ListWorkspacesRequest{
		// TODO: Fill request struct fields.
	}
	it := c.ListWorkspaces(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*Client) UpdateRow

func (c *Client) UpdateRow(ctx context.Context, req *tablespb.UpdateRowRequest, opts ...gax.CallOption) (*tablespb.Row, error)

UpdateRow updates a row.

Examples
package main

import (
	tables "cloud.google.com/go/area120/tables/apiv1alpha1"
	"context"
	tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1"
)

func main() {
	// import tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1"

	ctx := context.Background()
	c, err := tables.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &tablespb.UpdateRowRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.UpdateRow(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

RowIterator

type RowIterator struct {

	// Response is the raw response for the current page.
	// It must be cast to the RPC response type.
	// Calling Next() or InternalFetch() updates this value.
	Response interface{}

	// 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 []*tablespb.Row, nextPageToken string, err error)
	// contains filtered or unexported fields
}

RowIterator manages a stream of *tablespb.Row.

func (*RowIterator) Next

func (it *RowIterator) Next() (*tablespb.Row, 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 (*RowIterator) PageInfo

func (it *RowIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

TableIterator

type TableIterator struct {

	// Response is the raw response for the current page.
	// It must be cast to the RPC response type.
	// Calling Next() or InternalFetch() updates this value.
	Response interface{}

	// 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 []*tablespb.Table, nextPageToken string, err error)
	// contains filtered or unexported fields
}

TableIterator manages a stream of *tablespb.Table.

func (*TableIterator) Next

func (it *TableIterator) Next() (*tablespb.Table, 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 (*TableIterator) PageInfo

func (it *TableIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

WorkspaceIterator

type WorkspaceIterator struct {

	// Response is the raw response for the current page.
	// It must be cast to the RPC response type.
	// Calling Next() or InternalFetch() updates this value.
	Response interface{}

	// 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 []*tablespb.Workspace, nextPageToken string, err error)
	// contains filtered or unexported fields
}

WorkspaceIterator manages a stream of *tablespb.Workspace.

func (*WorkspaceIterator) Next

func (it *WorkspaceIterator) Next() (*tablespb.Workspace, 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 (*WorkspaceIterator) PageInfo

func (it *WorkspaceIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.