blob: c2fdcb2e2ad1cf3b88f64ac1226c2f17937711bb [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 datastream_test
import (
"context"
datastream "cloud.google.com/go/datastream/apiv1alpha1"
"google.golang.org/api/iterator"
datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1alpha1"
)
func ExampleNewClient() {
ctx := context.Background()
c, err := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func ExampleClient_ListConnectionProfiles() {
ctx := context.Background()
c, err := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.ListConnectionProfilesRequest{
// TODO: Fill request struct fields.
}
it := c.ListConnectionProfiles(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func ExampleClient_GetConnectionProfile() {
ctx := context.Background()
c, err := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.GetConnectionProfileRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetConnectionProfile(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleClient_CreateConnectionProfile() {
ctx := context.Background()
c, err := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.CreateConnectionProfileRequest{
// TODO: Fill request struct fields.
}
op, err := c.CreateConnectionProfile(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleClient_UpdateConnectionProfile() {
ctx := context.Background()
c, err := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.UpdateConnectionProfileRequest{
// TODO: Fill request struct fields.
}
op, err := c.UpdateConnectionProfile(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleClient_DeleteConnectionProfile() {
ctx := context.Background()
c, err := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.DeleteConnectionProfileRequest{
// TODO: Fill request struct fields.
}
op, err := c.DeleteConnectionProfile(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func ExampleClient_DiscoverConnectionProfile() {
ctx := context.Background()
c, err := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.DiscoverConnectionProfileRequest{
// TODO: Fill request struct fields.
}
resp, err := c.DiscoverConnectionProfile(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleClient_ListStreams() {
ctx := context.Background()
c, err := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.ListStreamsRequest{
// TODO: Fill request struct fields.
}
it := c.ListStreams(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func ExampleClient_GetStream() {
ctx := context.Background()
c, err := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.GetStreamRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetStream(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleClient_CreateStream() {
ctx := context.Background()
c, err := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.CreateStreamRequest{
// TODO: Fill request struct fields.
}
op, err := c.CreateStream(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleClient_UpdateStream() {
ctx := context.Background()
c, err := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.UpdateStreamRequest{
// TODO: Fill request struct fields.
}
op, err := c.UpdateStream(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleClient_DeleteStream() {
ctx := context.Background()
c, err := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.DeleteStreamRequest{
// TODO: Fill request struct fields.
}
op, err := c.DeleteStream(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func ExampleClient_FetchErrors() {
ctx := context.Background()
c, err := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.FetchErrorsRequest{
// TODO: Fill request struct fields.
}
op, err := c.FetchErrors(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleClient_FetchStaticIps() {
ctx := context.Background()
c, err := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.FetchStaticIpsRequest{
// TODO: Fill request struct fields.
}
it := c.FetchStaticIps(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func ExampleClient_CreatePrivateConnection() {
ctx := context.Background()
c, err := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.CreatePrivateConnectionRequest{
// TODO: Fill request struct fields.
}
op, err := c.CreatePrivateConnection(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleClient_GetPrivateConnection() {
ctx := context.Background()
c, err := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.GetPrivateConnectionRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetPrivateConnection(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleClient_ListPrivateConnections() {
ctx := context.Background()
c, err := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.ListPrivateConnectionsRequest{
// TODO: Fill request struct fields.
}
it := c.ListPrivateConnections(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func ExampleClient_DeletePrivateConnection() {
ctx := context.Background()
c, err := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.DeletePrivateConnectionRequest{
// TODO: Fill request struct fields.
}
op, err := c.DeletePrivateConnection(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func ExampleClient_CreateRoute() {
ctx := context.Background()
c, err := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.CreateRouteRequest{
// TODO: Fill request struct fields.
}
op, err := c.CreateRoute(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleClient_GetRoute() {
ctx := context.Background()
c, err := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.GetRouteRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetRoute(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleClient_ListRoutes() {
ctx := context.Background()
c, err := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.ListRoutesRequest{
// TODO: Fill request struct fields.
}
it := c.ListRoutes(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func ExampleClient_DeleteRoute() {
ctx := context.Background()
c, err := datastream.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datastreampb.DeleteRouteRequest{
// TODO: Fill request struct fields.
}
op, err := c.DeleteRoute(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}