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