blob: 4c29ab8be3684f8ede3a31811cedbd3af849c84d [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 clouddms_test
import (
"context"
clouddms "cloud.google.com/go/clouddms/apiv1"
"google.golang.org/api/iterator"
clouddmspb "google.golang.org/genproto/googleapis/cloud/clouddms/v1"
)
func ExampleNewDataMigrationClient() {
ctx := context.Background()
c, err := clouddms.NewDataMigrationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func ExampleDataMigrationClient_ListMigrationJobs() {
ctx := context.Background()
c, err := clouddms.NewDataMigrationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &clouddmspb.ListMigrationJobsRequest{
// TODO: Fill request struct fields.
}
it := c.ListMigrationJobs(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func ExampleDataMigrationClient_GetMigrationJob() {
ctx := context.Background()
c, err := clouddms.NewDataMigrationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &clouddmspb.GetMigrationJobRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetMigrationJob(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleDataMigrationClient_CreateMigrationJob() {
ctx := context.Background()
c, err := clouddms.NewDataMigrationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &clouddmspb.CreateMigrationJobRequest{
// TODO: Fill request struct fields.
}
op, err := c.CreateMigrationJob(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleDataMigrationClient_UpdateMigrationJob() {
ctx := context.Background()
c, err := clouddms.NewDataMigrationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &clouddmspb.UpdateMigrationJobRequest{
// TODO: Fill request struct fields.
}
op, err := c.UpdateMigrationJob(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleDataMigrationClient_DeleteMigrationJob() {
ctx := context.Background()
c, err := clouddms.NewDataMigrationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &clouddmspb.DeleteMigrationJobRequest{
// TODO: Fill request struct fields.
}
op, err := c.DeleteMigrationJob(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func ExampleDataMigrationClient_StartMigrationJob() {
ctx := context.Background()
c, err := clouddms.NewDataMigrationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &clouddmspb.StartMigrationJobRequest{
// TODO: Fill request struct fields.
}
op, err := c.StartMigrationJob(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleDataMigrationClient_StopMigrationJob() {
ctx := context.Background()
c, err := clouddms.NewDataMigrationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &clouddmspb.StopMigrationJobRequest{
// TODO: Fill request struct fields.
}
op, err := c.StopMigrationJob(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleDataMigrationClient_ResumeMigrationJob() {
ctx := context.Background()
c, err := clouddms.NewDataMigrationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &clouddmspb.ResumeMigrationJobRequest{
// TODO: Fill request struct fields.
}
op, err := c.ResumeMigrationJob(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleDataMigrationClient_PromoteMigrationJob() {
ctx := context.Background()
c, err := clouddms.NewDataMigrationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &clouddmspb.PromoteMigrationJobRequest{
// TODO: Fill request struct fields.
}
op, err := c.PromoteMigrationJob(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleDataMigrationClient_VerifyMigrationJob() {
ctx := context.Background()
c, err := clouddms.NewDataMigrationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &clouddmspb.VerifyMigrationJobRequest{
// TODO: Fill request struct fields.
}
op, err := c.VerifyMigrationJob(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleDataMigrationClient_RestartMigrationJob() {
ctx := context.Background()
c, err := clouddms.NewDataMigrationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &clouddmspb.RestartMigrationJobRequest{
// TODO: Fill request struct fields.
}
op, err := c.RestartMigrationJob(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleDataMigrationClient_GenerateSshScript() {
ctx := context.Background()
c, err := clouddms.NewDataMigrationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &clouddmspb.GenerateSshScriptRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GenerateSshScript(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleDataMigrationClient_ListConnectionProfiles() {
ctx := context.Background()
c, err := clouddms.NewDataMigrationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &clouddmspb.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 ExampleDataMigrationClient_GetConnectionProfile() {
ctx := context.Background()
c, err := clouddms.NewDataMigrationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &clouddmspb.GetConnectionProfileRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetConnectionProfile(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleDataMigrationClient_CreateConnectionProfile() {
ctx := context.Background()
c, err := clouddms.NewDataMigrationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &clouddmspb.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 ExampleDataMigrationClient_UpdateConnectionProfile() {
ctx := context.Background()
c, err := clouddms.NewDataMigrationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &clouddmspb.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 ExampleDataMigrationClient_DeleteConnectionProfile() {
ctx := context.Background()
c, err := clouddms.NewDataMigrationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &clouddmspb.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.
}
}