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 transcoder_test 18 19import ( 20 "context" 21 22 transcoder "cloud.google.com/go/video/transcoder/apiv1" 23 "google.golang.org/api/iterator" 24 transcoderpb "google.golang.org/genproto/googleapis/cloud/video/transcoder/v1" 25) 26 27func ExampleNewClient() { 28 ctx := context.Background() 29 c, err := transcoder.NewClient(ctx) 30 if err != nil { 31 // TODO: Handle error. 32 } 33 defer c.Close() 34 35 // TODO: Use client. 36 _ = c 37} 38 39func ExampleClient_CreateJob() { 40 ctx := context.Background() 41 c, err := transcoder.NewClient(ctx) 42 if err != nil { 43 // TODO: Handle error. 44 } 45 defer c.Close() 46 47 req := &transcoderpb.CreateJobRequest{ 48 // TODO: Fill request struct fields. 49 // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/video/transcoder/v1#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 ExampleClient_ListJobs() { 60 ctx := context.Background() 61 c, err := transcoder.NewClient(ctx) 62 if err != nil { 63 // TODO: Handle error. 64 } 65 defer c.Close() 66 67 req := &transcoderpb.ListJobsRequest{ 68 // TODO: Fill request struct fields. 69 // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/video/transcoder/v1#ListJobsRequest. 70 } 71 it := c.ListJobs(ctx, req) 72 for { 73 resp, err := it.Next() 74 if err == iterator.Done { 75 break 76 } 77 if err != nil { 78 // TODO: Handle error. 79 } 80 // TODO: Use resp. 81 _ = resp 82 } 83} 84 85func ExampleClient_GetJob() { 86 ctx := context.Background() 87 c, err := transcoder.NewClient(ctx) 88 if err != nil { 89 // TODO: Handle error. 90 } 91 defer c.Close() 92 93 req := &transcoderpb.GetJobRequest{ 94 // TODO: Fill request struct fields. 95 // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/video/transcoder/v1#GetJobRequest. 96 } 97 resp, err := c.GetJob(ctx, req) 98 if err != nil { 99 // TODO: Handle error. 100 } 101 // TODO: Use resp. 102 _ = resp 103} 104 105func ExampleClient_DeleteJob() { 106 ctx := context.Background() 107 c, err := transcoder.NewClient(ctx) 108 if err != nil { 109 // TODO: Handle error. 110 } 111 defer c.Close() 112 113 req := &transcoderpb.DeleteJobRequest{ 114 // TODO: Fill request struct fields. 115 // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/video/transcoder/v1#DeleteJobRequest. 116 } 117 err = c.DeleteJob(ctx, req) 118 if err != nil { 119 // TODO: Handle error. 120 } 121} 122 123func ExampleClient_CreateJobTemplate() { 124 ctx := context.Background() 125 c, err := transcoder.NewClient(ctx) 126 if err != nil { 127 // TODO: Handle error. 128 } 129 defer c.Close() 130 131 req := &transcoderpb.CreateJobTemplateRequest{ 132 // TODO: Fill request struct fields. 133 // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/video/transcoder/v1#CreateJobTemplateRequest. 134 } 135 resp, err := c.CreateJobTemplate(ctx, req) 136 if err != nil { 137 // TODO: Handle error. 138 } 139 // TODO: Use resp. 140 _ = resp 141} 142 143func ExampleClient_ListJobTemplates() { 144 ctx := context.Background() 145 c, err := transcoder.NewClient(ctx) 146 if err != nil { 147 // TODO: Handle error. 148 } 149 defer c.Close() 150 151 req := &transcoderpb.ListJobTemplatesRequest{ 152 // TODO: Fill request struct fields. 153 // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/video/transcoder/v1#ListJobTemplatesRequest. 154 } 155 it := c.ListJobTemplates(ctx, req) 156 for { 157 resp, err := it.Next() 158 if err == iterator.Done { 159 break 160 } 161 if err != nil { 162 // TODO: Handle error. 163 } 164 // TODO: Use resp. 165 _ = resp 166 } 167} 168 169func ExampleClient_GetJobTemplate() { 170 ctx := context.Background() 171 c, err := transcoder.NewClient(ctx) 172 if err != nil { 173 // TODO: Handle error. 174 } 175 defer c.Close() 176 177 req := &transcoderpb.GetJobTemplateRequest{ 178 // TODO: Fill request struct fields. 179 // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/video/transcoder/v1#GetJobTemplateRequest. 180 } 181 resp, err := c.GetJobTemplate(ctx, req) 182 if err != nil { 183 // TODO: Handle error. 184 } 185 // TODO: Use resp. 186 _ = resp 187} 188 189func ExampleClient_DeleteJobTemplate() { 190 ctx := context.Background() 191 c, err := transcoder.NewClient(ctx) 192 if err != nil { 193 // TODO: Handle error. 194 } 195 defer c.Close() 196 197 req := &transcoderpb.DeleteJobTemplateRequest{ 198 // TODO: Fill request struct fields. 199 // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/video/transcoder/v1#DeleteJobTemplateRequest. 200 } 201 err = c.DeleteJobTemplate(ctx, req) 202 if err != nil { 203 // TODO: Handle error. 204 } 205} 206