1// Copyright 2021 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// https://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15// Code generated by protoc-gen-go_gapic. DO NOT EDIT. 16 17package dataflow_test 18 19import ( 20 "context" 21 22 dataflow "cloud.google.com/go/dataflow/apiv1beta3" 23 "google.golang.org/api/iterator" 24 dataflowpb "google.golang.org/genproto/googleapis/dataflow/v1beta3" 25) 26 27func ExampleNewJobsV1Beta3Client() { 28 ctx := context.Background() 29 c, err := dataflow.NewJobsV1Beta3Client(ctx) 30 if err != nil { 31 // TODO: Handle error. 32 } 33 defer c.Close() 34 35 // TODO: Use client. 36 _ = c 37} 38 39func ExampleJobsV1Beta3Client_CreateJob() { 40 ctx := context.Background() 41 c, err := dataflow.NewJobsV1Beta3Client(ctx) 42 if err != nil { 43 // TODO: Handle error. 44 } 45 defer c.Close() 46 47 req := &dataflowpb.CreateJobRequest{ 48 // TODO: Fill request struct fields. 49 // See https://pkg.go.dev/google.golang.org/genproto/googleapis/dataflow/v1beta3#CreateJobRequest. 50 } 51 resp, err := c.CreateJob(ctx, req) 52 if err != nil { 53 // TODO: Handle error. 54 } 55 // TODO: Use resp. 56 _ = resp 57} 58 59func ExampleJobsV1Beta3Client_GetJob() { 60 ctx := context.Background() 61 c, err := dataflow.NewJobsV1Beta3Client(ctx) 62 if err != nil { 63 // TODO: Handle error. 64 } 65 defer c.Close() 66 67 req := &dataflowpb.GetJobRequest{ 68 // TODO: Fill request struct fields. 69 // See https://pkg.go.dev/google.golang.org/genproto/googleapis/dataflow/v1beta3#GetJobRequest. 70 } 71 resp, err := c.GetJob(ctx, req) 72 if err != nil { 73 // TODO: Handle error. 74 } 75 // TODO: Use resp. 76 _ = resp 77} 78 79func ExampleJobsV1Beta3Client_UpdateJob() { 80 ctx := context.Background() 81 c, err := dataflow.NewJobsV1Beta3Client(ctx) 82 if err != nil { 83 // TODO: Handle error. 84 } 85 defer c.Close() 86 87 req := &dataflowpb.UpdateJobRequest{ 88 // TODO: Fill request struct fields. 89 // See https://pkg.go.dev/google.golang.org/genproto/googleapis/dataflow/v1beta3#UpdateJobRequest. 90 } 91 resp, err := c.UpdateJob(ctx, req) 92 if err != nil { 93 // TODO: Handle error. 94 } 95 // TODO: Use resp. 96 _ = resp 97} 98 99func ExampleJobsV1Beta3Client_ListJobs() { 100 ctx := context.Background() 101 c, err := dataflow.NewJobsV1Beta3Client(ctx) 102 if err != nil { 103 // TODO: Handle error. 104 } 105 defer c.Close() 106 107 req := &dataflowpb.ListJobsRequest{ 108 // TODO: Fill request struct fields. 109 // See https://pkg.go.dev/google.golang.org/genproto/googleapis/dataflow/v1beta3#ListJobsRequest. 110 } 111 it := c.ListJobs(ctx, req) 112 for { 113 resp, err := it.Next() 114 if err == iterator.Done { 115 break 116 } 117 if err != nil { 118 // TODO: Handle error. 119 } 120 // TODO: Use resp. 121 _ = resp 122 } 123} 124 125func ExampleJobsV1Beta3Client_AggregatedListJobs() { 126 ctx := context.Background() 127 c, err := dataflow.NewJobsV1Beta3Client(ctx) 128 if err != nil { 129 // TODO: Handle error. 130 } 131 defer c.Close() 132 133 req := &dataflowpb.ListJobsRequest{ 134 // TODO: Fill request struct fields. 135 // See https://pkg.go.dev/google.golang.org/genproto/googleapis/dataflow/v1beta3#ListJobsRequest. 136 } 137 it := c.AggregatedListJobs(ctx, req) 138 for { 139 resp, err := it.Next() 140 if err == iterator.Done { 141 break 142 } 143 if err != nil { 144 // TODO: Handle error. 145 } 146 // TODO: Use resp. 147 _ = resp 148 } 149} 150 151func ExampleJobsV1Beta3Client_CheckActiveJobs() { 152 ctx := context.Background() 153 c, err := dataflow.NewJobsV1Beta3Client(ctx) 154 if err != nil { 155 // TODO: Handle error. 156 } 157 defer c.Close() 158 159 req := &dataflowpb.CheckActiveJobsRequest{ 160 // TODO: Fill request struct fields. 161 // See https://pkg.go.dev/google.golang.org/genproto/googleapis/dataflow/v1beta3#CheckActiveJobsRequest. 162 } 163 resp, err := c.CheckActiveJobs(ctx, req) 164 if err != nil { 165 // TODO: Handle error. 166 } 167 // TODO: Use resp. 168 _ = resp 169} 170 171func ExampleJobsV1Beta3Client_SnapshotJob() { 172 ctx := context.Background() 173 c, err := dataflow.NewJobsV1Beta3Client(ctx) 174 if err != nil { 175 // TODO: Handle error. 176 } 177 defer c.Close() 178 179 req := &dataflowpb.SnapshotJobRequest{ 180 // TODO: Fill request struct fields. 181 // See https://pkg.go.dev/google.golang.org/genproto/googleapis/dataflow/v1beta3#SnapshotJobRequest. 182 } 183 resp, err := c.SnapshotJob(ctx, req) 184 if err != nil { 185 // TODO: Handle error. 186 } 187 // TODO: Use resp. 188 _ = resp 189} 190