blob: 0168f60552b00ff43df44d59cb989becda83054b [file] [log] [blame]
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package tables_test
import (
"context"
tables "cloud.google.com/go/area120/tables/apiv1alpha1"
"google.golang.org/api/iterator"
tablespb "google.golang.org/genproto/googleapis/area120/tables/v1alpha1"
)
func ExampleNewClient() {
ctx := context.Background()
c, err := tables.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use client.
_ = c
}
func ExampleClient_GetTable() {
// 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 ExampleClient_ListTables() {
// 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 ExampleClient_GetRow() {
// 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 ExampleClient_ListRows() {
// 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 ExampleClient_CreateRow() {
// 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 ExampleClient_BatchCreateRows() {
// 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 ExampleClient_UpdateRow() {
// 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
}
func ExampleClient_BatchUpdateRows() {
// 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 ExampleClient_DeleteRow() {
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.
}
}