blob: a48393c2431cc74753d73d74910bf4fc9bb70b82 [file] [log] [blame]
// Copyright 2022 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 notebooks_test
import (
"context"
notebooks "cloud.google.com/go/notebooks/apiv1"
"google.golang.org/api/iterator"
notebookspb "google.golang.org/genproto/googleapis/cloud/notebooks/v1"
)
func ExampleNewManagedNotebookClient() {
ctx := context.Background()
c, err := notebooks.NewManagedNotebookClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func ExampleManagedNotebookClient_ListRuntimes() {
ctx := context.Background()
c, err := notebooks.NewManagedNotebookClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &notebookspb.ListRuntimesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/notebooks/v1#ListRuntimesRequest.
}
it := c.ListRuntimes(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func ExampleManagedNotebookClient_GetRuntime() {
ctx := context.Background()
c, err := notebooks.NewManagedNotebookClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &notebookspb.GetRuntimeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/notebooks/v1#GetRuntimeRequest.
}
resp, err := c.GetRuntime(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleManagedNotebookClient_CreateRuntime() {
ctx := context.Background()
c, err := notebooks.NewManagedNotebookClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &notebookspb.CreateRuntimeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/notebooks/v1#CreateRuntimeRequest.
}
op, err := c.CreateRuntime(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleManagedNotebookClient_DeleteRuntime() {
ctx := context.Background()
c, err := notebooks.NewManagedNotebookClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &notebookspb.DeleteRuntimeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/notebooks/v1#DeleteRuntimeRequest.
}
op, err := c.DeleteRuntime(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func ExampleManagedNotebookClient_StartRuntime() {
ctx := context.Background()
c, err := notebooks.NewManagedNotebookClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &notebookspb.StartRuntimeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/notebooks/v1#StartRuntimeRequest.
}
op, err := c.StartRuntime(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleManagedNotebookClient_StopRuntime() {
ctx := context.Background()
c, err := notebooks.NewManagedNotebookClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &notebookspb.StopRuntimeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/notebooks/v1#StopRuntimeRequest.
}
op, err := c.StopRuntime(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleManagedNotebookClient_SwitchRuntime() {
ctx := context.Background()
c, err := notebooks.NewManagedNotebookClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &notebookspb.SwitchRuntimeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/notebooks/v1#SwitchRuntimeRequest.
}
op, err := c.SwitchRuntime(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleManagedNotebookClient_ResetRuntime() {
ctx := context.Background()
c, err := notebooks.NewManagedNotebookClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &notebookspb.ResetRuntimeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/notebooks/v1#ResetRuntimeRequest.
}
op, err := c.ResetRuntime(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleManagedNotebookClient_ReportRuntimeEvent() {
ctx := context.Background()
c, err := notebooks.NewManagedNotebookClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &notebookspb.ReportRuntimeEventRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/notebooks/v1#ReportRuntimeEventRequest.
}
op, err := c.ReportRuntimeEvent(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleManagedNotebookClient_RefreshRuntimeTokenInternal() {
ctx := context.Background()
c, err := notebooks.NewManagedNotebookClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &notebookspb.RefreshRuntimeTokenInternalRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/notebooks/v1#RefreshRuntimeTokenInternalRequest.
}
resp, err := c.RefreshRuntimeTokenInternal(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}