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 } 50 resp, err := c.CreateJob(ctx, req) 51 if err != nil { 52 // TODO: Handle error. 53 } 54 // TODO: Use resp. 55 _ = resp 56} 57 58func ExampleClient_ListJobs() { 59 ctx := context.Background() 60 c, err := transcoder.NewClient(ctx) 61 if err != nil { 62 // TODO: Handle error. 63 } 64 defer c.Close() 65 66 req := &transcoderpb.ListJobsRequest{ 67 // TODO: Fill request struct fields. 68 } 69 it := c.ListJobs(ctx, req) 70 for { 71 resp, err := it.Next() 72 if err == iterator.Done { 73 break 74 } 75 if err != nil { 76 // TODO: Handle error. 77 } 78 // TODO: Use resp. 79 _ = resp 80 } 81} 82 83func ExampleClient_GetJob() { 84 ctx := context.Background() 85 c, err := transcoder.NewClient(ctx) 86 if err != nil { 87 // TODO: Handle error. 88 } 89 defer c.Close() 90 91 req := &transcoderpb.GetJobRequest{ 92 // TODO: Fill request struct fields. 93 } 94 resp, err := c.GetJob(ctx, req) 95 if err != nil { 96 // TODO: Handle error. 97 } 98 // TODO: Use resp. 99 _ = resp 100} 101 102func ExampleClient_DeleteJob() { 103 ctx := context.Background() 104 c, err := transcoder.NewClient(ctx) 105 if err != nil { 106 // TODO: Handle error. 107 } 108 defer c.Close() 109 110 req := &transcoderpb.DeleteJobRequest{ 111 // TODO: Fill request struct fields. 112 } 113 err = c.DeleteJob(ctx, req) 114 if err != nil { 115 // TODO: Handle error. 116 } 117} 118 119func ExampleClient_CreateJobTemplate() { 120 ctx := context.Background() 121 c, err := transcoder.NewClient(ctx) 122 if err != nil { 123 // TODO: Handle error. 124 } 125 defer c.Close() 126 127 req := &transcoderpb.CreateJobTemplateRequest{ 128 // TODO: Fill request struct fields. 129 } 130 resp, err := c.CreateJobTemplate(ctx, req) 131 if err != nil { 132 // TODO: Handle error. 133 } 134 // TODO: Use resp. 135 _ = resp 136} 137 138func ExampleClient_ListJobTemplates() { 139 ctx := context.Background() 140 c, err := transcoder.NewClient(ctx) 141 if err != nil { 142 // TODO: Handle error. 143 } 144 defer c.Close() 145 146 req := &transcoderpb.ListJobTemplatesRequest{ 147 // TODO: Fill request struct fields. 148 } 149 it := c.ListJobTemplates(ctx, req) 150 for { 151 resp, err := it.Next() 152 if err == iterator.Done { 153 break 154 } 155 if err != nil { 156 // TODO: Handle error. 157 } 158 // TODO: Use resp. 159 _ = resp 160 } 161} 162 163func ExampleClient_GetJobTemplate() { 164 ctx := context.Background() 165 c, err := transcoder.NewClient(ctx) 166 if err != nil { 167 // TODO: Handle error. 168 } 169 defer c.Close() 170 171 req := &transcoderpb.GetJobTemplateRequest{ 172 // TODO: Fill request struct fields. 173 } 174 resp, err := c.GetJobTemplate(ctx, req) 175 if err != nil { 176 // TODO: Handle error. 177 } 178 // TODO: Use resp. 179 _ = resp 180} 181 182func ExampleClient_DeleteJobTemplate() { 183 ctx := context.Background() 184 c, err := transcoder.NewClient(ctx) 185 if err != nil { 186 // TODO: Handle error. 187 } 188 defer c.Close() 189 190 req := &transcoderpb.DeleteJobTemplateRequest{ 191 // TODO: Fill request struct fields. 192 } 193 err = c.DeleteJobTemplate(ctx, req) 194 if err != nil { 195 // TODO: Handle error. 196 } 197} 198