Debian Codegraph @

contactcenterinsights/apiv1/contact_center_insights_client.go

raw symbols SCIP
1 // Copyright 2025 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
17 package contactcenterinsights
18
19 import (
20 "bytes"
21 "context"
22 "fmt"
23 "log/slog"
24 "math"
25 "net/http"
26 "net/url"
27 "time"
28
29 contactcenterinsightspb "cloud.google.com/go/contactcenterinsights/apiv1/contactcenterinsightspb"
30 "cloud.google.com/go/longrunning"
31 lroauto "cloud.google.com/go/longrunning/autogen"
32 longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
33 gax "github.com/googleapis/gax-go/v2"
34 "google.golang.org/api/iterator"
35 "google.golang.org/api/option"
36 "google.golang.org/api/option/internaloption"
37 gtransport "google.golang.org/api/transport/grpc"
38 httptransport "google.golang.org/api/transport/http"
39 "google.golang.org/grpc"
40 "google.golang.org/grpc/codes"
41 "google.golang.org/protobuf/encoding/protojson"
42 "google.golang.org/protobuf/proto"
43 )
44
45 var newClientHook clientHook
46
47 // CallOptions contains the retry settings for each method of Client.
48 type CallOptions struct {
49 CreateConversation []gax.CallOption
50 UploadConversation []gax.CallOption
51 UpdateConversation []gax.CallOption
52 GetConversation []gax.CallOption
53 ListConversations []gax.CallOption
54 DeleteConversation []gax.CallOption
55 CreateAnalysis []gax.CallOption
56 GetAnalysis []gax.CallOption
57 ListAnalyses []gax.CallOption
58 DeleteAnalysis []gax.CallOption
59 BulkAnalyzeConversations []gax.CallOption
60 BulkDeleteConversations []gax.CallOption
61 IngestConversations []gax.CallOption
62 ExportInsightsData []gax.CallOption
63 CreateIssueModel []gax.CallOption
64 UpdateIssueModel []gax.CallOption
65 GetIssueModel []gax.CallOption
66 ListIssueModels []gax.CallOption
67 DeleteIssueModel []gax.CallOption
68 DeployIssueModel []gax.CallOption
69 UndeployIssueModel []gax.CallOption
70 ExportIssueModel []gax.CallOption
71 ImportIssueModel []gax.CallOption
72 GetIssue []gax.CallOption
73 ListIssues []gax.CallOption
74 UpdateIssue []gax.CallOption
75 DeleteIssue []gax.CallOption
76 CalculateIssueModelStats []gax.CallOption
77 CreatePhraseMatcher []gax.CallOption
78 GetPhraseMatcher []gax.CallOption
79 ListPhraseMatchers []gax.CallOption
80 DeletePhraseMatcher []gax.CallOption
81 UpdatePhraseMatcher []gax.CallOption
82 CalculateStats []gax.CallOption
83 GetSettings []gax.CallOption
84 UpdateSettings []gax.CallOption
85 CreateAnalysisRule []gax.CallOption
86 GetAnalysisRule []gax.CallOption
87 ListAnalysisRules []gax.CallOption
88 UpdateAnalysisRule []gax.CallOption
89 DeleteAnalysisRule []gax.CallOption
90 GetEncryptionSpec []gax.CallOption
91 InitializeEncryptionSpec []gax.CallOption
92 CreateView []gax.CallOption
93 GetView []gax.CallOption
94 ListViews []gax.CallOption
95 UpdateView []gax.CallOption
96 DeleteView []gax.CallOption
97 QueryMetrics []gax.CallOption
98 CreateQaQuestion []gax.CallOption
99 GetQaQuestion []gax.CallOption
100 UpdateQaQuestion []gax.CallOption
101 DeleteQaQuestion []gax.CallOption
102 ListQaQuestions []gax.CallOption
103 CreateQaScorecard []gax.CallOption
104 GetQaScorecard []gax.CallOption
105 UpdateQaScorecard []gax.CallOption
106 DeleteQaScorecard []gax.CallOption
107 ListQaScorecards []gax.CallOption
108 CreateQaScorecardRevision []gax.CallOption
109 GetQaScorecardRevision []gax.CallOption
110 TuneQaScorecardRevision []gax.CallOption
111 DeployQaScorecardRevision []gax.CallOption
112 UndeployQaScorecardRevision []gax.CallOption
113 DeleteQaScorecardRevision []gax.CallOption
114 ListQaScorecardRevisions []gax.CallOption
115 CreateFeedbackLabel []gax.CallOption
116 ListFeedbackLabels []gax.CallOption
117 GetFeedbackLabel []gax.CallOption
118 UpdateFeedbackLabel []gax.CallOption
119 DeleteFeedbackLabel []gax.CallOption
120 ListAllFeedbackLabels []gax.CallOption
121 BulkUploadFeedbackLabels []gax.CallOption
122 BulkDownloadFeedbackLabels []gax.CallOption
123 CancelOperation []gax.CallOption
124 GetOperation []gax.CallOption
125 ListOperations []gax.CallOption
126 }
127
128 func defaultGRPCClientOptions() []option.ClientOption {
129 return []option.ClientOption{
130 internaloption.WithDefaultEndpoint("contactcenterinsights.googleapis.com:443"),
131 internaloption.WithDefaultEndpointTemplate("contactcenterinsights.UNIVERSE_DOMAIN:443"),
132 internaloption.WithDefaultMTLSEndpoint("contactcenterinsights.mtls.googleapis.com:443"),
133 internaloption.WithDefaultUniverseDomain("googleapis.com"),
134 internaloption.WithDefaultAudience("https://contactcenterinsights.googleapis.com/"),
135 internaloption.WithDefaultScopes(DefaultAuthScopes()...),
136 internaloption.EnableJwtWithScope(),
137 internaloption.EnableNewAuthLibrary(),
138 option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
139 grpc.MaxCallRecvMsgSize(math.MaxInt32))),
140 }
141 }
142
143 func defaultCallOptions() *CallOptions {
144 return &CallOptions{
145 CreateConversation: []gax.CallOption{
146 gax.WithTimeout(60000 * time.Millisecond),
147 gax.WithRetry(func() gax.Retryer {
148 return gax.OnCodes([]codes.Code{
149 codes.Unavailable,
150 }, gax.Backoff{
151 Initial: 1000 * time.Millisecond,
152 Max: 10000 * time.Millisecond,
153 Multiplier: 1.30,
154 })
155 }),
156 },
157 UploadConversation: []gax.CallOption{
158 gax.WithTimeout(60000 * time.Millisecond),
159 gax.WithRetry(func() gax.Retryer {
160 return gax.OnCodes([]codes.Code{
161 codes.Unavailable,
162 }, gax.Backoff{
163 Initial: 1000 * time.Millisecond,
164 Max: 10000 * time.Millisecond,
165 Multiplier: 1.30,
166 })
167 }),
168 },
169 UpdateConversation: []gax.CallOption{
170 gax.WithTimeout(60000 * time.Millisecond),
171 gax.WithRetry(func() gax.Retryer {
172 return gax.OnCodes([]codes.Code{
173 codes.Unavailable,
174 }, gax.Backoff{
175 Initial: 1000 * time.Millisecond,
176 Max: 10000 * time.Millisecond,
177 Multiplier: 1.30,
178 })
179 }),
180 },
181 GetConversation: []gax.CallOption{
182 gax.WithTimeout(60000 * time.Millisecond),
183 gax.WithRetry(func() gax.Retryer {
184 return gax.OnCodes([]codes.Code{
185 codes.Unavailable,
186 }, gax.Backoff{
187 Initial: 1000 * time.Millisecond,
188 Max: 10000 * time.Millisecond,
189 Multiplier: 1.30,
190 })
191 }),
192 },
193 ListConversations: []gax.CallOption{
194 gax.WithTimeout(60000 * time.Millisecond),
195 gax.WithRetry(func() gax.Retryer {
196 return gax.OnCodes([]codes.Code{
197 codes.Unavailable,
198 }, gax.Backoff{
199 Initial: 1000 * time.Millisecond,
200 Max: 10000 * time.Millisecond,
201 Multiplier: 1.30,
202 })
203 }),
204 },
205 DeleteConversation: []gax.CallOption{
206 gax.WithTimeout(60000 * time.Millisecond),
207 gax.WithRetry(func() gax.Retryer {
208 return gax.OnCodes([]codes.Code{
209 codes.Unavailable,
210 }, gax.Backoff{
211 Initial: 1000 * time.Millisecond,
212 Max: 10000 * time.Millisecond,
213 Multiplier: 1.30,
214 })
215 }),
216 },
217 CreateAnalysis: []gax.CallOption{
218 gax.WithTimeout(60000 * time.Millisecond),
219 gax.WithRetry(func() gax.Retryer {
220 return gax.OnCodes([]codes.Code{
221 codes.Unavailable,
222 }, gax.Backoff{
223 Initial: 1000 * time.Millisecond,
224 Max: 10000 * time.Millisecond,
225 Multiplier: 1.30,
226 })
227 }),
228 },
229 GetAnalysis: []gax.CallOption{
230 gax.WithTimeout(60000 * time.Millisecond),
231 gax.WithRetry(func() gax.Retryer {
232 return gax.OnCodes([]codes.Code{
233 codes.Unavailable,
234 }, gax.Backoff{
235 Initial: 1000 * time.Millisecond,
236 Max: 10000 * time.Millisecond,
237 Multiplier: 1.30,
238 })
239 }),
240 },
241 ListAnalyses: []gax.CallOption{
242 gax.WithTimeout(60000 * time.Millisecond),
243 gax.WithRetry(func() gax.Retryer {
244 return gax.OnCodes([]codes.Code{
245 codes.Unavailable,
246 }, gax.Backoff{
247 Initial: 1000 * time.Millisecond,
248 Max: 10000 * time.Millisecond,
249 Multiplier: 1.30,
250 })
251 }),
252 },
253 DeleteAnalysis: []gax.CallOption{
254 gax.WithTimeout(60000 * time.Millisecond),
255 gax.WithRetry(func() gax.Retryer {
256 return gax.OnCodes([]codes.Code{
257 codes.Unavailable,
258 }, gax.Backoff{
259 Initial: 1000 * time.Millisecond,
260 Max: 10000 * time.Millisecond,
261 Multiplier: 1.30,
262 })
263 }),
264 },
265 BulkAnalyzeConversations: []gax.CallOption{
266 gax.WithTimeout(60000 * time.Millisecond),
267 gax.WithRetry(func() gax.Retryer {
268 return gax.OnCodes([]codes.Code{
269 codes.Unavailable,
270 }, gax.Backoff{
271 Initial: 1000 * time.Millisecond,
272 Max: 10000 * time.Millisecond,
273 Multiplier: 1.30,
274 })
275 }),
276 },
277 BulkDeleteConversations: []gax.CallOption{
278 gax.WithTimeout(60000 * time.Millisecond),
279 gax.WithRetry(func() gax.Retryer {
280 return gax.OnCodes([]codes.Code{
281 codes.Unavailable,
282 }, gax.Backoff{
283 Initial: 1000 * time.Millisecond,
284 Max: 10000 * time.Millisecond,
285 Multiplier: 1.30,
286 })
287 }),
288 },
289 IngestConversations: []gax.CallOption{
290 gax.WithTimeout(60000 * time.Millisecond),
291 gax.WithRetry(func() gax.Retryer {
292 return gax.OnCodes([]codes.Code{
293 codes.Unavailable,
294 }, gax.Backoff{
295 Initial: 1000 * time.Millisecond,
296 Max: 10000 * time.Millisecond,
297 Multiplier: 1.30,
298 })
299 }),
300 },
301 ExportInsightsData: []gax.CallOption{
302 gax.WithTimeout(60000 * time.Millisecond),
303 gax.WithRetry(func() gax.Retryer {
304 return gax.OnCodes([]codes.Code{
305 codes.Unavailable,
306 }, gax.Backoff{
307 Initial: 1000 * time.Millisecond,
308 Max: 10000 * time.Millisecond,
309 Multiplier: 1.30,
310 })
311 }),
312 },
313 CreateIssueModel: []gax.CallOption{
314 gax.WithTimeout(60000 * time.Millisecond),
315 gax.WithRetry(func() gax.Retryer {
316 return gax.OnCodes([]codes.Code{
317 codes.Unavailable,
318 }, gax.Backoff{
319 Initial: 1000 * time.Millisecond,
320 Max: 10000 * time.Millisecond,
321 Multiplier: 1.30,
322 })
323 }),
324 },
325 UpdateIssueModel: []gax.CallOption{
326 gax.WithTimeout(60000 * time.Millisecond),
327 gax.WithRetry(func() gax.Retryer {
328 return gax.OnCodes([]codes.Code{
329 codes.Unavailable,
330 }, gax.Backoff{
331 Initial: 1000 * time.Millisecond,
332 Max: 10000 * time.Millisecond,
333 Multiplier: 1.30,
334 })
335 }),
336 },
337 GetIssueModel: []gax.CallOption{
338 gax.WithTimeout(60000 * time.Millisecond),
339 gax.WithRetry(func() gax.Retryer {
340 return gax.OnCodes([]codes.Code{
341 codes.Unavailable,
342 }, gax.Backoff{
343 Initial: 1000 * time.Millisecond,
344 Max: 10000 * time.Millisecond,
345 Multiplier: 1.30,
346 })
347 }),
348 },
349 ListIssueModels: []gax.CallOption{
350 gax.WithTimeout(60000 * time.Millisecond),
351 gax.WithRetry(func() gax.Retryer {
352 return gax.OnCodes([]codes.Code{
353 codes.Unavailable,
354 }, gax.Backoff{
355 Initial: 1000 * time.Millisecond,
356 Max: 10000 * time.Millisecond,
357 Multiplier: 1.30,
358 })
359 }),
360 },
361 DeleteIssueModel: []gax.CallOption{
362 gax.WithTimeout(60000 * time.Millisecond),
363 gax.WithRetry(func() gax.Retryer {
364 return gax.OnCodes([]codes.Code{
365 codes.Unavailable,
366 }, gax.Backoff{
367 Initial: 1000 * time.Millisecond,
368 Max: 10000 * time.Millisecond,
369 Multiplier: 1.30,
370 })
371 }),
372 },
373 DeployIssueModel: []gax.CallOption{
374 gax.WithTimeout(60000 * time.Millisecond),
375 gax.WithRetry(func() gax.Retryer {
376 return gax.OnCodes([]codes.Code{
377 codes.Unavailable,
378 }, gax.Backoff{
379 Initial: 1000 * time.Millisecond,
380 Max: 10000 * time.Millisecond,
381 Multiplier: 1.30,
382 })
383 }),
384 },
385 UndeployIssueModel: []gax.CallOption{
386 gax.WithTimeout(60000 * time.Millisecond),
387 gax.WithRetry(func() gax.Retryer {
388 return gax.OnCodes([]codes.Code{
389 codes.Unavailable,
390 }, gax.Backoff{
391 Initial: 1000 * time.Millisecond,
392 Max: 10000 * time.Millisecond,
393 Multiplier: 1.30,
394 })
395 }),
396 },
397 ExportIssueModel: []gax.CallOption{
398 gax.WithTimeout(60000 * time.Millisecond),
399 gax.WithRetry(func() gax.Retryer {
400 return gax.OnCodes([]codes.Code{
401 codes.Unavailable,
402 }, gax.Backoff{
403 Initial: 1000 * time.Millisecond,
404 Max: 10000 * time.Millisecond,
405 Multiplier: 1.30,
406 })
407 }),
408 },
409 ImportIssueModel: []gax.CallOption{
410 gax.WithTimeout(60000 * time.Millisecond),
411 gax.WithRetry(func() gax.Retryer {
412 return gax.OnCodes([]codes.Code{
413 codes.Unavailable,
414 }, gax.Backoff{
415 Initial: 1000 * time.Millisecond,
416 Max: 10000 * time.Millisecond,
417 Multiplier: 1.30,
418 })
419 }),
420 },
421 GetIssue: []gax.CallOption{
422 gax.WithTimeout(60000 * time.Millisecond),
423 gax.WithRetry(func() gax.Retryer {
424 return gax.OnCodes([]codes.Code{
425 codes.Unavailable,
426 }, gax.Backoff{
427 Initial: 1000 * time.Millisecond,
428 Max: 10000 * time.Millisecond,
429 Multiplier: 1.30,
430 })
431 }),
432 },
433 ListIssues: []gax.CallOption{
434 gax.WithTimeout(60000 * time.Millisecond),
435 gax.WithRetry(func() gax.Retryer {
436 return gax.OnCodes([]codes.Code{
437 codes.Unavailable,
438 }, gax.Backoff{
439 Initial: 1000 * time.Millisecond,
440 Max: 10000 * time.Millisecond,
441 Multiplier: 1.30,
442 })
443 }),
444 },
445 UpdateIssue: []gax.CallOption{
446 gax.WithTimeout(60000 * time.Millisecond),
447 gax.WithRetry(func() gax.Retryer {
448 return gax.OnCodes([]codes.Code{
449 codes.Unavailable,
450 }, gax.Backoff{
451 Initial: 1000 * time.Millisecond,
452 Max: 10000 * time.Millisecond,
453 Multiplier: 1.30,
454 })
455 }),
456 },
457 DeleteIssue: []gax.CallOption{
458 gax.WithTimeout(60000 * time.Millisecond),
459 gax.WithRetry(func() gax.Retryer {
460 return gax.OnCodes([]codes.Code{
461 codes.Unavailable,
462 }, gax.Backoff{
463 Initial: 1000 * time.Millisecond,
464 Max: 10000 * time.Millisecond,
465 Multiplier: 1.30,
466 })
467 }),
468 },
469 CalculateIssueModelStats: []gax.CallOption{
470 gax.WithTimeout(60000 * time.Millisecond),
471 gax.WithRetry(func() gax.Retryer {
472 return gax.OnCodes([]codes.Code{
473 codes.Unavailable,
474 }, gax.Backoff{
475 Initial: 1000 * time.Millisecond,
476 Max: 10000 * time.Millisecond,
477 Multiplier: 1.30,
478 })
479 }),
480 },
481 CreatePhraseMatcher: []gax.CallOption{
482 gax.WithTimeout(60000 * time.Millisecond),
483 gax.WithRetry(func() gax.Retryer {
484 return gax.OnCodes([]codes.Code{
485 codes.Unavailable,
486 }, gax.Backoff{
487 Initial: 1000 * time.Millisecond,
488 Max: 10000 * time.Millisecond,
489 Multiplier: 1.30,
490 })
491 }),
492 },
493 GetPhraseMatcher: []gax.CallOption{
494 gax.WithTimeout(60000 * time.Millisecond),
495 gax.WithRetry(func() gax.Retryer {
496 return gax.OnCodes([]codes.Code{
497 codes.Unavailable,
498 }, gax.Backoff{
499 Initial: 1000 * time.Millisecond,
500 Max: 10000 * time.Millisecond,
501 Multiplier: 1.30,
502 })
503 }),
504 },
505 ListPhraseMatchers: []gax.CallOption{
506 gax.WithTimeout(60000 * time.Millisecond),
507 gax.WithRetry(func() gax.Retryer {
508 return gax.OnCodes([]codes.Code{
509 codes.Unavailable,
510 }, gax.Backoff{
511 Initial: 1000 * time.Millisecond,
512 Max: 10000 * time.Millisecond,
513 Multiplier: 1.30,
514 })
515 }),
516 },
517 DeletePhraseMatcher: []gax.CallOption{
518 gax.WithTimeout(60000 * time.Millisecond),
519 gax.WithRetry(func() gax.Retryer {
520 return gax.OnCodes([]codes.Code{
521 codes.Unavailable,
522 }, gax.Backoff{
523 Initial: 1000 * time.Millisecond,
524 Max: 10000 * time.Millisecond,
525 Multiplier: 1.30,
526 })
527 }),
528 },
529 UpdatePhraseMatcher: []gax.CallOption{
530 gax.WithTimeout(60000 * time.Millisecond),
531 gax.WithRetry(func() gax.Retryer {
532 return gax.OnCodes([]codes.Code{
533 codes.Unavailable,
534 }, gax.Backoff{
535 Initial: 1000 * time.Millisecond,
536 Max: 10000 * time.Millisecond,
537 Multiplier: 1.30,
538 })
539 }),
540 },
541 CalculateStats: []gax.CallOption{
542 gax.WithTimeout(60000 * time.Millisecond),
543 gax.WithRetry(func() gax.Retryer {
544 return gax.OnCodes([]codes.Code{
545 codes.Unavailable,
546 }, gax.Backoff{
547 Initial: 1000 * time.Millisecond,
548 Max: 10000 * time.Millisecond,
549 Multiplier: 1.30,
550 })
551 }),
552 },
553 GetSettings: []gax.CallOption{
554 gax.WithTimeout(60000 * time.Millisecond),
555 gax.WithRetry(func() gax.Retryer {
556 return gax.OnCodes([]codes.Code{
557 codes.Unavailable,
558 }, gax.Backoff{
559 Initial: 1000 * time.Millisecond,
560 Max: 10000 * time.Millisecond,
561 Multiplier: 1.30,
562 })
563 }),
564 },
565 UpdateSettings: []gax.CallOption{
566 gax.WithTimeout(60000 * time.Millisecond),
567 gax.WithRetry(func() gax.Retryer {
568 return gax.OnCodes([]codes.Code{
569 codes.Unavailable,
570 }, gax.Backoff{
571 Initial: 1000 * time.Millisecond,
572 Max: 10000 * time.Millisecond,
573 Multiplier: 1.30,
574 })
575 }),
576 },
577 CreateAnalysisRule: []gax.CallOption{
578 gax.WithTimeout(60000 * time.Millisecond),
579 gax.WithRetry(func() gax.Retryer {
580 return gax.OnCodes([]codes.Code{
581 codes.Unavailable,
582 }, gax.Backoff{
583 Initial: 1000 * time.Millisecond,
584 Max: 10000 * time.Millisecond,
585 Multiplier: 1.30,
586 })
587 }),
588 },
589 GetAnalysisRule: []gax.CallOption{
590 gax.WithTimeout(60000 * time.Millisecond),
591 gax.WithRetry(func() gax.Retryer {
592 return gax.OnCodes([]codes.Code{
593 codes.Unavailable,
594 }, gax.Backoff{
595 Initial: 1000 * time.Millisecond,
596 Max: 10000 * time.Millisecond,
597 Multiplier: 1.30,
598 })
599 }),
600 },
601 ListAnalysisRules: []gax.CallOption{
602 gax.WithTimeout(60000 * time.Millisecond),
603 gax.WithRetry(func() gax.Retryer {
604 return gax.OnCodes([]codes.Code{
605 codes.Unavailable,
606 }, gax.Backoff{
607 Initial: 1000 * time.Millisecond,
608 Max: 10000 * time.Millisecond,
609 Multiplier: 1.30,
610 })
611 }),
612 },
613 UpdateAnalysisRule: []gax.CallOption{
614 gax.WithTimeout(60000 * time.Millisecond),
615 gax.WithRetry(func() gax.Retryer {
616 return gax.OnCodes([]codes.Code{
617 codes.Unavailable,
618 }, gax.Backoff{
619 Initial: 1000 * time.Millisecond,
620 Max: 10000 * time.Millisecond,
621 Multiplier: 1.30,
622 })
623 }),
624 },
625 DeleteAnalysisRule: []gax.CallOption{
626 gax.WithTimeout(60000 * time.Millisecond),
627 gax.WithRetry(func() gax.Retryer {
628 return gax.OnCodes([]codes.Code{
629 codes.Unavailable,
630 }, gax.Backoff{
631 Initial: 1000 * time.Millisecond,
632 Max: 10000 * time.Millisecond,
633 Multiplier: 1.30,
634 })
635 }),
636 },
637 GetEncryptionSpec: []gax.CallOption{
638 gax.WithTimeout(60000 * time.Millisecond),
639 gax.WithRetry(func() gax.Retryer {
640 return gax.OnCodes([]codes.Code{
641 codes.Unavailable,
642 }, gax.Backoff{
643 Initial: 1000 * time.Millisecond,
644 Max: 10000 * time.Millisecond,
645 Multiplier: 1.30,
646 })
647 }),
648 },
649 InitializeEncryptionSpec: []gax.CallOption{
650 gax.WithTimeout(60000 * time.Millisecond),
651 gax.WithRetry(func() gax.Retryer {
652 return gax.OnCodes([]codes.Code{
653 codes.Unavailable,
654 }, gax.Backoff{
655 Initial: 1000 * time.Millisecond,
656 Max: 10000 * time.Millisecond,
657 Multiplier: 1.30,
658 })
659 }),
660 },
661 CreateView: []gax.CallOption{
662 gax.WithTimeout(60000 * time.Millisecond),
663 gax.WithRetry(func() gax.Retryer {
664 return gax.OnCodes([]codes.Code{
665 codes.Unavailable,
666 }, gax.Backoff{
667 Initial: 1000 * time.Millisecond,
668 Max: 10000 * time.Millisecond,
669 Multiplier: 1.30,
670 })
671 }),
672 },
673 GetView: []gax.CallOption{
674 gax.WithTimeout(60000 * time.Millisecond),
675 gax.WithRetry(func() gax.Retryer {
676 return gax.OnCodes([]codes.Code{
677 codes.Unavailable,
678 }, gax.Backoff{
679 Initial: 1000 * time.Millisecond,
680 Max: 10000 * time.Millisecond,
681 Multiplier: 1.30,
682 })
683 }),
684 },
685 ListViews: []gax.CallOption{
686 gax.WithTimeout(60000 * time.Millisecond),
687 gax.WithRetry(func() gax.Retryer {
688 return gax.OnCodes([]codes.Code{
689 codes.Unavailable,
690 }, gax.Backoff{
691 Initial: 1000 * time.Millisecond,
692 Max: 10000 * time.Millisecond,
693 Multiplier: 1.30,
694 })
695 }),
696 },
697 UpdateView: []gax.CallOption{
698 gax.WithTimeout(60000 * time.Millisecond),
699 gax.WithRetry(func() gax.Retryer {
700 return gax.OnCodes([]codes.Code{
701 codes.Unavailable,
702 }, gax.Backoff{
703 Initial: 1000 * time.Millisecond,
704 Max: 10000 * time.Millisecond,
705 Multiplier: 1.30,
706 })
707 }),
708 },
709 DeleteView: []gax.CallOption{
710 gax.WithTimeout(60000 * time.Millisecond),
711 gax.WithRetry(func() gax.Retryer {
712 return gax.OnCodes([]codes.Code{
713 codes.Unavailable,
714 }, gax.Backoff{
715 Initial: 1000 * time.Millisecond,
716 Max: 10000 * time.Millisecond,
717 Multiplier: 1.30,
718 })
719 }),
720 },
721 QueryMetrics: []gax.CallOption{
722 gax.WithTimeout(60000 * time.Millisecond),
723 gax.WithRetry(func() gax.Retryer {
724 return gax.OnCodes([]codes.Code{
725 codes.Unavailable,
726 }, gax.Backoff{
727 Initial: 1000 * time.Millisecond,
728 Max: 10000 * time.Millisecond,
729 Multiplier: 1.30,
730 })
731 }),
732 },
733 CreateQaQuestion: []gax.CallOption{
734 gax.WithTimeout(60000 * time.Millisecond),
735 gax.WithRetry(func() gax.Retryer {
736 return gax.OnCodes([]codes.Code{
737 codes.Unavailable,
738 }, gax.Backoff{
739 Initial: 1000 * time.Millisecond,
740 Max: 10000 * time.Millisecond,
741 Multiplier: 1.30,
742 })
743 }),
744 },
745 GetQaQuestion: []gax.CallOption{
746 gax.WithTimeout(60000 * time.Millisecond),
747 gax.WithRetry(func() gax.Retryer {
748 return gax.OnCodes([]codes.Code{
749 codes.Unavailable,
750 }, gax.Backoff{
751 Initial: 1000 * time.Millisecond,
752 Max: 10000 * time.Millisecond,
753 Multiplier: 1.30,
754 })
755 }),
756 },
757 UpdateQaQuestion: []gax.CallOption{
758 gax.WithTimeout(60000 * time.Millisecond),
759 gax.WithRetry(func() gax.Retryer {
760 return gax.OnCodes([]codes.Code{
761 codes.Unavailable,
762 }, gax.Backoff{
763 Initial: 1000 * time.Millisecond,
764 Max: 10000 * time.Millisecond,
765 Multiplier: 1.30,
766 })
767 }),
768 },
769 DeleteQaQuestion: []gax.CallOption{
770 gax.WithTimeout(60000 * time.Millisecond),
771 gax.WithRetry(func() gax.Retryer {
772 return gax.OnCodes([]codes.Code{
773 codes.Unavailable,
774 }, gax.Backoff{
775 Initial: 1000 * time.Millisecond,
776 Max: 10000 * time.Millisecond,
777 Multiplier: 1.30,
778 })
779 }),
780 },
781 ListQaQuestions: []gax.CallOption{
782 gax.WithTimeout(60000 * time.Millisecond),
783 gax.WithRetry(func() gax.Retryer {
784 return gax.OnCodes([]codes.Code{
785 codes.Unavailable,
786 }, gax.Backoff{
787 Initial: 1000 * time.Millisecond,
788 Max: 10000 * time.Millisecond,
789 Multiplier: 1.30,
790 })
791 }),
792 },
793 CreateQaScorecard: []gax.CallOption{
794 gax.WithTimeout(60000 * time.Millisecond),
795 gax.WithRetry(func() gax.Retryer {
796 return gax.OnCodes([]codes.Code{
797 codes.Unavailable,
798 }, gax.Backoff{
799 Initial: 1000 * time.Millisecond,
800 Max: 10000 * time.Millisecond,
801 Multiplier: 1.30,
802 })
803 }),
804 },
805 GetQaScorecard: []gax.CallOption{
806 gax.WithTimeout(60000 * time.Millisecond),
807 gax.WithRetry(func() gax.Retryer {
808 return gax.OnCodes([]codes.Code{
809 codes.Unavailable,
810 }, gax.Backoff{
811 Initial: 1000 * time.Millisecond,
812 Max: 10000 * time.Millisecond,
813 Multiplier: 1.30,
814 })
815 }),
816 },
817 UpdateQaScorecard: []gax.CallOption{
818 gax.WithTimeout(60000 * time.Millisecond),
819 gax.WithRetry(func() gax.Retryer {
820 return gax.OnCodes([]codes.Code{
821 codes.Unavailable,
822 }, gax.Backoff{
823 Initial: 1000 * time.Millisecond,
824 Max: 10000 * time.Millisecond,
825 Multiplier: 1.30,
826 })
827 }),
828 },
829 DeleteQaScorecard: []gax.CallOption{
830 gax.WithTimeout(60000 * time.Millisecond),
831 gax.WithRetry(func() gax.Retryer {
832 return gax.OnCodes([]codes.Code{
833 codes.Unavailable,
834 }, gax.Backoff{
835 Initial: 1000 * time.Millisecond,
836 Max: 10000 * time.Millisecond,
837 Multiplier: 1.30,
838 })
839 }),
840 },
841 ListQaScorecards: []gax.CallOption{
842 gax.WithTimeout(60000 * time.Millisecond),
843 gax.WithRetry(func() gax.Retryer {
844 return gax.OnCodes([]codes.Code{
845 codes.Unavailable,
846 }, gax.Backoff{
847 Initial: 1000 * time.Millisecond,
848 Max: 10000 * time.Millisecond,
849 Multiplier: 1.30,
850 })
851 }),
852 },
853 CreateQaScorecardRevision: []gax.CallOption{
854 gax.WithTimeout(60000 * time.Millisecond),
855 gax.WithRetry(func() gax.Retryer {
856 return gax.OnCodes([]codes.Code{
857 codes.Unavailable,
858 }, gax.Backoff{
859 Initial: 1000 * time.Millisecond,
860 Max: 10000 * time.Millisecond,
861 Multiplier: 1.30,
862 })
863 }),
864 },
865 GetQaScorecardRevision: []gax.CallOption{
866 gax.WithTimeout(60000 * time.Millisecond),
867 gax.WithRetry(func() gax.Retryer {
868 return gax.OnCodes([]codes.Code{
869 codes.Unavailable,
870 }, gax.Backoff{
871 Initial: 1000 * time.Millisecond,
872 Max: 10000 * time.Millisecond,
873 Multiplier: 1.30,
874 })
875 }),
876 },
877 TuneQaScorecardRevision: []gax.CallOption{
878 gax.WithTimeout(60000 * time.Millisecond),
879 gax.WithRetry(func() gax.Retryer {
880 return gax.OnCodes([]codes.Code{
881 codes.Unavailable,
882 }, gax.Backoff{
883 Initial: 1000 * time.Millisecond,
884 Max: 10000 * time.Millisecond,
885 Multiplier: 1.30,
886 })
887 }),
888 },
889 DeployQaScorecardRevision: []gax.CallOption{
890 gax.WithTimeout(60000 * time.Millisecond),
891 gax.WithRetry(func() gax.Retryer {
892 return gax.OnCodes([]codes.Code{
893 codes.Unavailable,
894 }, gax.Backoff{
895 Initial: 1000 * time.Millisecond,
896 Max: 10000 * time.Millisecond,
897 Multiplier: 1.30,
898 })
899 }),
900 },
901 UndeployQaScorecardRevision: []gax.CallOption{
902 gax.WithTimeout(60000 * time.Millisecond),
903 gax.WithRetry(func() gax.Retryer {
904 return gax.OnCodes([]codes.Code{
905 codes.Unavailable,
906 }, gax.Backoff{
907 Initial: 1000 * time.Millisecond,
908 Max: 10000 * time.Millisecond,
909 Multiplier: 1.30,
910 })
911 }),
912 },
913 DeleteQaScorecardRevision: []gax.CallOption{
914 gax.WithTimeout(60000 * time.Millisecond),
915 gax.WithRetry(func() gax.Retryer {
916 return gax.OnCodes([]codes.Code{
917 codes.Unavailable,
918 }, gax.Backoff{
919 Initial: 1000 * time.Millisecond,
920 Max: 10000 * time.Millisecond,
921 Multiplier: 1.30,
922 })
923 }),
924 },
925 ListQaScorecardRevisions: []gax.CallOption{
926 gax.WithTimeout(60000 * time.Millisecond),
927 gax.WithRetry(func() gax.Retryer {
928 return gax.OnCodes([]codes.Code{
929 codes.Unavailable,
930 }, gax.Backoff{
931 Initial: 1000 * time.Millisecond,
932 Max: 10000 * time.Millisecond,
933 Multiplier: 1.30,
934 })
935 }),
936 },
937 CreateFeedbackLabel: []gax.CallOption{
938 gax.WithTimeout(60000 * time.Millisecond),
939 gax.WithRetry(func() gax.Retryer {
940 return gax.OnCodes([]codes.Code{
941 codes.Unavailable,
942 }, gax.Backoff{
943 Initial: 1000 * time.Millisecond,
944 Max: 10000 * time.Millisecond,
945 Multiplier: 1.30,
946 })
947 }),
948 },
949 ListFeedbackLabels: []gax.CallOption{
950 gax.WithTimeout(60000 * time.Millisecond),
951 gax.WithRetry(func() gax.Retryer {
952 return gax.OnCodes([]codes.Code{
953 codes.Unavailable,
954 }, gax.Backoff{
955 Initial: 1000 * time.Millisecond,
956 Max: 10000 * time.Millisecond,
957 Multiplier: 1.30,
958 })
959 }),
960 },
961 GetFeedbackLabel: []gax.CallOption{
962 gax.WithTimeout(60000 * time.Millisecond),
963 gax.WithRetry(func() gax.Retryer {
964 return gax.OnCodes([]codes.Code{
965 codes.Unavailable,
966 }, gax.Backoff{
967 Initial: 1000 * time.Millisecond,
968 Max: 10000 * time.Millisecond,
969 Multiplier: 1.30,
970 })
971 }),
972 },
973 UpdateFeedbackLabel: []gax.CallOption{
974 gax.WithTimeout(60000 * time.Millisecond),
975 gax.WithRetry(func() gax.Retryer {
976 return gax.OnCodes([]codes.Code{
977 codes.Unavailable,
978 }, gax.Backoff{
979 Initial: 1000 * time.Millisecond,
980 Max: 10000 * time.Millisecond,
981 Multiplier: 1.30,
982 })
983 }),
984 },
985 DeleteFeedbackLabel: []gax.CallOption{
986 gax.WithTimeout(60000 * time.Millisecond),
987 gax.WithRetry(func() gax.Retryer {
988 return gax.OnCodes([]codes.Code{
989 codes.Unavailable,
990 }, gax.Backoff{
991 Initial: 1000 * time.Millisecond,
992 Max: 10000 * time.Millisecond,
993 Multiplier: 1.30,
994 })
995 }),
996 },
997 ListAllFeedbackLabels: []gax.CallOption{
998 gax.WithTimeout(60000 * time.Millisecond),
999 gax.WithRetry(func() gax.Retryer {
1000 return gax.OnCodes([]codes.Code{
1001 codes.Unavailable,
1002 }, gax.Backoff{
1003 Initial: 1000 * time.Millisecond,
1004 Max: 10000 * time.Millisecond,
1005 Multiplier: 1.30,
1006 })
1007 }),
1008 },
1009 BulkUploadFeedbackLabels: []gax.CallOption{
1010 gax.WithTimeout(60000 * time.Millisecond),
1011 gax.WithRetry(func() gax.Retryer {
1012 return gax.OnCodes([]codes.Code{
1013 codes.Unavailable,
1014 }, gax.Backoff{
1015 Initial: 1000 * time.Millisecond,
1016 Max: 10000 * time.Millisecond,
1017 Multiplier: 1.30,
1018 })
1019 }),
1020 },
1021 BulkDownloadFeedbackLabels: []gax.CallOption{
1022 gax.WithTimeout(60000 * time.Millisecond),
1023 gax.WithRetry(func() gax.Retryer {
1024 return gax.OnCodes([]codes.Code{
1025 codes.Unavailable,
1026 }, gax.Backoff{
1027 Initial: 1000 * time.Millisecond,
1028 Max: 10000 * time.Millisecond,
1029 Multiplier: 1.30,
1030 })
1031 }),
1032 },
1033 CancelOperation: []gax.CallOption{
1034 gax.WithTimeout(60000 * time.Millisecond),
1035 gax.WithRetry(func() gax.Retryer {
1036 return gax.OnCodes([]codes.Code{
1037 codes.Unavailable,
1038 }, gax.Backoff{
1039 Initial: 1000 * time.Millisecond,
1040 Max: 10000 * time.Millisecond,
1041 Multiplier: 1.30,
1042 })
1043 }),
1044 },
1045 GetOperation: []gax.CallOption{
1046 gax.WithTimeout(60000 * time.Millisecond),
1047 gax.WithRetry(func() gax.Retryer {
1048 return gax.OnCodes([]codes.Code{
1049 codes.Unavailable,
1050 }, gax.Backoff{
1051 Initial: 1000 * time.Millisecond,
1052 Max: 10000 * time.Millisecond,
1053 Multiplier: 1.30,
1054 })
1055 }),
1056 },
1057 ListOperations: []gax.CallOption{
1058 gax.WithTimeout(60000 * time.Millisecond),
1059 gax.WithRetry(func() gax.Retryer {
1060 return gax.OnCodes([]codes.Code{
1061 codes.Unavailable,
1062 }, gax.Backoff{
1063 Initial: 1000 * time.Millisecond,
1064 Max: 10000 * time.Millisecond,
1065 Multiplier: 1.30,
1066 })
1067 }),
1068 },
1069 }
1070 }
1071
1072 func defaultRESTCallOptions() *CallOptions {
1073 return &CallOptions{
1074 CreateConversation: []gax.CallOption{
1075 gax.WithTimeout(60000 * time.Millisecond),
1076 gax.WithRetry(func() gax.Retryer {
1077 return gax.OnHTTPCodes(gax.Backoff{
1078 Initial: 1000 * time.Millisecond,
1079 Max: 10000 * time.Millisecond,
1080 Multiplier: 1.30,
1081 },
1082 http.StatusServiceUnavailable)
1083 }),
1084 },
1085 UploadConversation: []gax.CallOption{
1086 gax.WithTimeout(60000 * time.Millisecond),
1087 gax.WithRetry(func() gax.Retryer {
1088 return gax.OnHTTPCodes(gax.Backoff{
1089 Initial: 1000 * time.Millisecond,
1090 Max: 10000 * time.Millisecond,
1091 Multiplier: 1.30,
1092 },
1093 http.StatusServiceUnavailable)
1094 }),
1095 },
1096 UpdateConversation: []gax.CallOption{
1097 gax.WithTimeout(60000 * time.Millisecond),
1098 gax.WithRetry(func() gax.Retryer {
1099 return gax.OnHTTPCodes(gax.Backoff{
1100 Initial: 1000 * time.Millisecond,
1101 Max: 10000 * time.Millisecond,
1102 Multiplier: 1.30,
1103 },
1104 http.StatusServiceUnavailable)
1105 }),
1106 },
1107 GetConversation: []gax.CallOption{
1108 gax.WithTimeout(60000 * time.Millisecond),
1109 gax.WithRetry(func() gax.Retryer {
1110 return gax.OnHTTPCodes(gax.Backoff{
1111 Initial: 1000 * time.Millisecond,
1112 Max: 10000 * time.Millisecond,
1113 Multiplier: 1.30,
1114 },
1115 http.StatusServiceUnavailable)
1116 }),
1117 },
1118 ListConversations: []gax.CallOption{
1119 gax.WithTimeout(60000 * time.Millisecond),
1120 gax.WithRetry(func() gax.Retryer {
1121 return gax.OnHTTPCodes(gax.Backoff{
1122 Initial: 1000 * time.Millisecond,
1123 Max: 10000 * time.Millisecond,
1124 Multiplier: 1.30,
1125 },
1126 http.StatusServiceUnavailable)
1127 }),
1128 },
1129 DeleteConversation: []gax.CallOption{
1130 gax.WithTimeout(60000 * time.Millisecond),
1131 gax.WithRetry(func() gax.Retryer {
1132 return gax.OnHTTPCodes(gax.Backoff{
1133 Initial: 1000 * time.Millisecond,
1134 Max: 10000 * time.Millisecond,
1135 Multiplier: 1.30,
1136 },
1137 http.StatusServiceUnavailable)
1138 }),
1139 },
1140 CreateAnalysis: []gax.CallOption{
1141 gax.WithTimeout(60000 * time.Millisecond),
1142 gax.WithRetry(func() gax.Retryer {
1143 return gax.OnHTTPCodes(gax.Backoff{
1144 Initial: 1000 * time.Millisecond,
1145 Max: 10000 * time.Millisecond,
1146 Multiplier: 1.30,
1147 },
1148 http.StatusServiceUnavailable)
1149 }),
1150 },
1151 GetAnalysis: []gax.CallOption{
1152 gax.WithTimeout(60000 * time.Millisecond),
1153 gax.WithRetry(func() gax.Retryer {
1154 return gax.OnHTTPCodes(gax.Backoff{
1155 Initial: 1000 * time.Millisecond,
1156 Max: 10000 * time.Millisecond,
1157 Multiplier: 1.30,
1158 },
1159 http.StatusServiceUnavailable)
1160 }),
1161 },
1162 ListAnalyses: []gax.CallOption{
1163 gax.WithTimeout(60000 * time.Millisecond),
1164 gax.WithRetry(func() gax.Retryer {
1165 return gax.OnHTTPCodes(gax.Backoff{
1166 Initial: 1000 * time.Millisecond,
1167 Max: 10000 * time.Millisecond,
1168 Multiplier: 1.30,
1169 },
1170 http.StatusServiceUnavailable)
1171 }),
1172 },
1173 DeleteAnalysis: []gax.CallOption{
1174 gax.WithTimeout(60000 * time.Millisecond),
1175 gax.WithRetry(func() gax.Retryer {
1176 return gax.OnHTTPCodes(gax.Backoff{
1177 Initial: 1000 * time.Millisecond,
1178 Max: 10000 * time.Millisecond,
1179 Multiplier: 1.30,
1180 },
1181 http.StatusServiceUnavailable)
1182 }),
1183 },
1184 BulkAnalyzeConversations: []gax.CallOption{
1185 gax.WithTimeout(60000 * time.Millisecond),
1186 gax.WithRetry(func() gax.Retryer {
1187 return gax.OnHTTPCodes(gax.Backoff{
1188 Initial: 1000 * time.Millisecond,
1189 Max: 10000 * time.Millisecond,
1190 Multiplier: 1.30,
1191 },
1192 http.StatusServiceUnavailable)
1193 }),
1194 },
1195 BulkDeleteConversations: []gax.CallOption{
1196 gax.WithTimeout(60000 * time.Millisecond),
1197 gax.WithRetry(func() gax.Retryer {
1198 return gax.OnHTTPCodes(gax.Backoff{
1199 Initial: 1000 * time.Millisecond,
1200 Max: 10000 * time.Millisecond,
1201 Multiplier: 1.30,
1202 },
1203 http.StatusServiceUnavailable)
1204 }),
1205 },
1206 IngestConversations: []gax.CallOption{
1207 gax.WithTimeout(60000 * time.Millisecond),
1208 gax.WithRetry(func() gax.Retryer {
1209 return gax.OnHTTPCodes(gax.Backoff{
1210 Initial: 1000 * time.Millisecond,
1211 Max: 10000 * time.Millisecond,
1212 Multiplier: 1.30,
1213 },
1214 http.StatusServiceUnavailable)
1215 }),
1216 },
1217 ExportInsightsData: []gax.CallOption{
1218 gax.WithTimeout(60000 * time.Millisecond),
1219 gax.WithRetry(func() gax.Retryer {
1220 return gax.OnHTTPCodes(gax.Backoff{
1221 Initial: 1000 * time.Millisecond,
1222 Max: 10000 * time.Millisecond,
1223 Multiplier: 1.30,
1224 },
1225 http.StatusServiceUnavailable)
1226 }),
1227 },
1228 CreateIssueModel: []gax.CallOption{
1229 gax.WithTimeout(60000 * time.Millisecond),
1230 gax.WithRetry(func() gax.Retryer {
1231 return gax.OnHTTPCodes(gax.Backoff{
1232 Initial: 1000 * time.Millisecond,
1233 Max: 10000 * time.Millisecond,
1234 Multiplier: 1.30,
1235 },
1236 http.StatusServiceUnavailable)
1237 }),
1238 },
1239 UpdateIssueModel: []gax.CallOption{
1240 gax.WithTimeout(60000 * time.Millisecond),
1241 gax.WithRetry(func() gax.Retryer {
1242 return gax.OnHTTPCodes(gax.Backoff{
1243 Initial: 1000 * time.Millisecond,
1244 Max: 10000 * time.Millisecond,
1245 Multiplier: 1.30,
1246 },
1247 http.StatusServiceUnavailable)
1248 }),
1249 },
1250 GetIssueModel: []gax.CallOption{
1251 gax.WithTimeout(60000 * time.Millisecond),
1252 gax.WithRetry(func() gax.Retryer {
1253 return gax.OnHTTPCodes(gax.Backoff{
1254 Initial: 1000 * time.Millisecond,
1255 Max: 10000 * time.Millisecond,
1256 Multiplier: 1.30,
1257 },
1258 http.StatusServiceUnavailable)
1259 }),
1260 },
1261 ListIssueModels: []gax.CallOption{
1262 gax.WithTimeout(60000 * time.Millisecond),
1263 gax.WithRetry(func() gax.Retryer {
1264 return gax.OnHTTPCodes(gax.Backoff{
1265 Initial: 1000 * time.Millisecond,
1266 Max: 10000 * time.Millisecond,
1267 Multiplier: 1.30,
1268 },
1269 http.StatusServiceUnavailable)
1270 }),
1271 },
1272 DeleteIssueModel: []gax.CallOption{
1273 gax.WithTimeout(60000 * time.Millisecond),
1274 gax.WithRetry(func() gax.Retryer {
1275 return gax.OnHTTPCodes(gax.Backoff{
1276 Initial: 1000 * time.Millisecond,
1277 Max: 10000 * time.Millisecond,
1278 Multiplier: 1.30,
1279 },
1280 http.StatusServiceUnavailable)
1281 }),
1282 },
1283 DeployIssueModel: []gax.CallOption{
1284 gax.WithTimeout(60000 * time.Millisecond),
1285 gax.WithRetry(func() gax.Retryer {
1286 return gax.OnHTTPCodes(gax.Backoff{
1287 Initial: 1000 * time.Millisecond,
1288 Max: 10000 * time.Millisecond,
1289 Multiplier: 1.30,
1290 },
1291 http.StatusServiceUnavailable)
1292 }),
1293 },
1294 UndeployIssueModel: []gax.CallOption{
1295 gax.WithTimeout(60000 * time.Millisecond),
1296 gax.WithRetry(func() gax.Retryer {
1297 return gax.OnHTTPCodes(gax.Backoff{
1298 Initial: 1000 * time.Millisecond,
1299 Max: 10000 * time.Millisecond,
1300 Multiplier: 1.30,
1301 },
1302 http.StatusServiceUnavailable)
1303 }),
1304 },
1305 ExportIssueModel: []gax.CallOption{
1306 gax.WithTimeout(60000 * time.Millisecond),
1307 gax.WithRetry(func() gax.Retryer {
1308 return gax.OnHTTPCodes(gax.Backoff{
1309 Initial: 1000 * time.Millisecond,
1310 Max: 10000 * time.Millisecond,
1311 Multiplier: 1.30,
1312 },
1313 http.StatusServiceUnavailable)
1314 }),
1315 },
1316 ImportIssueModel: []gax.CallOption{
1317 gax.WithTimeout(60000 * time.Millisecond),
1318 gax.WithRetry(func() gax.Retryer {
1319 return gax.OnHTTPCodes(gax.Backoff{
1320 Initial: 1000 * time.Millisecond,
1321 Max: 10000 * time.Millisecond,
1322 Multiplier: 1.30,
1323 },
1324 http.StatusServiceUnavailable)
1325 }),
1326 },
1327 GetIssue: []gax.CallOption{
1328 gax.WithTimeout(60000 * time.Millisecond),
1329 gax.WithRetry(func() gax.Retryer {
1330 return gax.OnHTTPCodes(gax.Backoff{
1331 Initial: 1000 * time.Millisecond,
1332 Max: 10000 * time.Millisecond,
1333 Multiplier: 1.30,
1334 },
1335 http.StatusServiceUnavailable)
1336 }),
1337 },
1338 ListIssues: []gax.CallOption{
1339 gax.WithTimeout(60000 * time.Millisecond),
1340 gax.WithRetry(func() gax.Retryer {
1341 return gax.OnHTTPCodes(gax.Backoff{
1342 Initial: 1000 * time.Millisecond,
1343 Max: 10000 * time.Millisecond,
1344 Multiplier: 1.30,
1345 },
1346 http.StatusServiceUnavailable)
1347 }),
1348 },
1349 UpdateIssue: []gax.CallOption{
1350 gax.WithTimeout(60000 * time.Millisecond),
1351 gax.WithRetry(func() gax.Retryer {
1352 return gax.OnHTTPCodes(gax.Backoff{
1353 Initial: 1000 * time.Millisecond,
1354 Max: 10000 * time.Millisecond,
1355 Multiplier: 1.30,
1356 },
1357 http.StatusServiceUnavailable)
1358 }),
1359 },
1360 DeleteIssue: []gax.CallOption{
1361 gax.WithTimeout(60000 * time.Millisecond),
1362 gax.WithRetry(func() gax.Retryer {
1363 return gax.OnHTTPCodes(gax.Backoff{
1364 Initial: 1000 * time.Millisecond,
1365 Max: 10000 * time.Millisecond,
1366 Multiplier: 1.30,
1367 },
1368 http.StatusServiceUnavailable)
1369 }),
1370 },
1371 CalculateIssueModelStats: []gax.CallOption{
1372 gax.WithTimeout(60000 * time.Millisecond),
1373 gax.WithRetry(func() gax.Retryer {
1374 return gax.OnHTTPCodes(gax.Backoff{
1375 Initial: 1000 * time.Millisecond,
1376 Max: 10000 * time.Millisecond,
1377 Multiplier: 1.30,
1378 },
1379 http.StatusServiceUnavailable)
1380 }),
1381 },
1382 CreatePhraseMatcher: []gax.CallOption{
1383 gax.WithTimeout(60000 * time.Millisecond),
1384 gax.WithRetry(func() gax.Retryer {
1385 return gax.OnHTTPCodes(gax.Backoff{
1386 Initial: 1000 * time.Millisecond,
1387 Max: 10000 * time.Millisecond,
1388 Multiplier: 1.30,
1389 },
1390 http.StatusServiceUnavailable)
1391 }),
1392 },
1393 GetPhraseMatcher: []gax.CallOption{
1394 gax.WithTimeout(60000 * time.Millisecond),
1395 gax.WithRetry(func() gax.Retryer {
1396 return gax.OnHTTPCodes(gax.Backoff{
1397 Initial: 1000 * time.Millisecond,
1398 Max: 10000 * time.Millisecond,
1399 Multiplier: 1.30,
1400 },
1401 http.StatusServiceUnavailable)
1402 }),
1403 },
1404 ListPhraseMatchers: []gax.CallOption{
1405 gax.WithTimeout(60000 * time.Millisecond),
1406 gax.WithRetry(func() gax.Retryer {
1407 return gax.OnHTTPCodes(gax.Backoff{
1408 Initial: 1000 * time.Millisecond,
1409 Max: 10000 * time.Millisecond,
1410 Multiplier: 1.30,
1411 },
1412 http.StatusServiceUnavailable)
1413 }),
1414 },
1415 DeletePhraseMatcher: []gax.CallOption{
1416 gax.WithTimeout(60000 * time.Millisecond),
1417 gax.WithRetry(func() gax.Retryer {
1418 return gax.OnHTTPCodes(gax.Backoff{
1419 Initial: 1000 * time.Millisecond,
1420 Max: 10000 * time.Millisecond,
1421 Multiplier: 1.30,
1422 },
1423 http.StatusServiceUnavailable)
1424 }),
1425 },
1426 UpdatePhraseMatcher: []gax.CallOption{
1427 gax.WithTimeout(60000 * time.Millisecond),
1428 gax.WithRetry(func() gax.Retryer {
1429 return gax.OnHTTPCodes(gax.Backoff{
1430 Initial: 1000 * time.Millisecond,
1431 Max: 10000 * time.Millisecond,
1432 Multiplier: 1.30,
1433 },
1434 http.StatusServiceUnavailable)
1435 }),
1436 },
1437 CalculateStats: []gax.CallOption{
1438 gax.WithTimeout(60000 * time.Millisecond),
1439 gax.WithRetry(func() gax.Retryer {
1440 return gax.OnHTTPCodes(gax.Backoff{
1441 Initial: 1000 * time.Millisecond,
1442 Max: 10000 * time.Millisecond,
1443 Multiplier: 1.30,
1444 },
1445 http.StatusServiceUnavailable)
1446 }),
1447 },
1448 GetSettings: []gax.CallOption{
1449 gax.WithTimeout(60000 * time.Millisecond),
1450 gax.WithRetry(func() gax.Retryer {
1451 return gax.OnHTTPCodes(gax.Backoff{
1452 Initial: 1000 * time.Millisecond,
1453 Max: 10000 * time.Millisecond,
1454 Multiplier: 1.30,
1455 },
1456 http.StatusServiceUnavailable)
1457 }),
1458 },
1459 UpdateSettings: []gax.CallOption{
1460 gax.WithTimeout(60000 * time.Millisecond),
1461 gax.WithRetry(func() gax.Retryer {
1462 return gax.OnHTTPCodes(gax.Backoff{
1463 Initial: 1000 * time.Millisecond,
1464 Max: 10000 * time.Millisecond,
1465 Multiplier: 1.30,
1466 },
1467 http.StatusServiceUnavailable)
1468 }),
1469 },
1470 CreateAnalysisRule: []gax.CallOption{
1471 gax.WithTimeout(60000 * time.Millisecond),
1472 gax.WithRetry(func() gax.Retryer {
1473 return gax.OnHTTPCodes(gax.Backoff{
1474 Initial: 1000 * time.Millisecond,
1475 Max: 10000 * time.Millisecond,
1476 Multiplier: 1.30,
1477 },
1478 http.StatusServiceUnavailable)
1479 }),
1480 },
1481 GetAnalysisRule: []gax.CallOption{
1482 gax.WithTimeout(60000 * time.Millisecond),
1483 gax.WithRetry(func() gax.Retryer {
1484 return gax.OnHTTPCodes(gax.Backoff{
1485 Initial: 1000 * time.Millisecond,
1486 Max: 10000 * time.Millisecond,
1487 Multiplier: 1.30,
1488 },
1489 http.StatusServiceUnavailable)
1490 }),
1491 },
1492 ListAnalysisRules: []gax.CallOption{
1493 gax.WithTimeout(60000 * time.Millisecond),
1494 gax.WithRetry(func() gax.Retryer {
1495 return gax.OnHTTPCodes(gax.Backoff{
1496 Initial: 1000 * time.Millisecond,
1497 Max: 10000 * time.Millisecond,
1498 Multiplier: 1.30,
1499 },
1500 http.StatusServiceUnavailable)
1501 }),
1502 },
1503 UpdateAnalysisRule: []gax.CallOption{
1504 gax.WithTimeout(60000 * time.Millisecond),
1505 gax.WithRetry(func() gax.Retryer {
1506 return gax.OnHTTPCodes(gax.Backoff{
1507 Initial: 1000 * time.Millisecond,
1508 Max: 10000 * time.Millisecond,
1509 Multiplier: 1.30,
1510 },
1511 http.StatusServiceUnavailable)
1512 }),
1513 },
1514 DeleteAnalysisRule: []gax.CallOption{
1515 gax.WithTimeout(60000 * time.Millisecond),
1516 gax.WithRetry(func() gax.Retryer {
1517 return gax.OnHTTPCodes(gax.Backoff{
1518 Initial: 1000 * time.Millisecond,
1519 Max: 10000 * time.Millisecond,
1520 Multiplier: 1.30,
1521 },
1522 http.StatusServiceUnavailable)
1523 }),
1524 },
1525 GetEncryptionSpec: []gax.CallOption{
1526 gax.WithTimeout(60000 * time.Millisecond),
1527 gax.WithRetry(func() gax.Retryer {
1528 return gax.OnHTTPCodes(gax.Backoff{
1529 Initial: 1000 * time.Millisecond,
1530 Max: 10000 * time.Millisecond,
1531 Multiplier: 1.30,
1532 },
1533 http.StatusServiceUnavailable)
1534 }),
1535 },
1536 InitializeEncryptionSpec: []gax.CallOption{
1537 gax.WithTimeout(60000 * time.Millisecond),
1538 gax.WithRetry(func() gax.Retryer {
1539 return gax.OnHTTPCodes(gax.Backoff{
1540 Initial: 1000 * time.Millisecond,
1541 Max: 10000 * time.Millisecond,
1542 Multiplier: 1.30,
1543 },
1544 http.StatusServiceUnavailable)
1545 }),
1546 },
1547 CreateView: []gax.CallOption{
1548 gax.WithTimeout(60000 * time.Millisecond),
1549 gax.WithRetry(func() gax.Retryer {
1550 return gax.OnHTTPCodes(gax.Backoff{
1551 Initial: 1000 * time.Millisecond,
1552 Max: 10000 * time.Millisecond,
1553 Multiplier: 1.30,
1554 },
1555 http.StatusServiceUnavailable)
1556 }),
1557 },
1558 GetView: []gax.CallOption{
1559 gax.WithTimeout(60000 * time.Millisecond),
1560 gax.WithRetry(func() gax.Retryer {
1561 return gax.OnHTTPCodes(gax.Backoff{
1562 Initial: 1000 * time.Millisecond,
1563 Max: 10000 * time.Millisecond,
1564 Multiplier: 1.30,
1565 },
1566 http.StatusServiceUnavailable)
1567 }),
1568 },
1569 ListViews: []gax.CallOption{
1570 gax.WithTimeout(60000 * time.Millisecond),
1571 gax.WithRetry(func() gax.Retryer {
1572 return gax.OnHTTPCodes(gax.Backoff{
1573 Initial: 1000 * time.Millisecond,
1574 Max: 10000 * time.Millisecond,
1575 Multiplier: 1.30,
1576 },
1577 http.StatusServiceUnavailable)
1578 }),
1579 },
1580 UpdateView: []gax.CallOption{
1581 gax.WithTimeout(60000 * time.Millisecond),
1582 gax.WithRetry(func() gax.Retryer {
1583 return gax.OnHTTPCodes(gax.Backoff{
1584 Initial: 1000 * time.Millisecond,
1585 Max: 10000 * time.Millisecond,
1586 Multiplier: 1.30,
1587 },
1588 http.StatusServiceUnavailable)
1589 }),
1590 },
1591 DeleteView: []gax.CallOption{
1592 gax.WithTimeout(60000 * time.Millisecond),
1593 gax.WithRetry(func() gax.Retryer {
1594 return gax.OnHTTPCodes(gax.Backoff{
1595 Initial: 1000 * time.Millisecond,
1596 Max: 10000 * time.Millisecond,
1597 Multiplier: 1.30,
1598 },
1599 http.StatusServiceUnavailable)
1600 }),
1601 },
1602 QueryMetrics: []gax.CallOption{
1603 gax.WithTimeout(60000 * time.Millisecond),
1604 gax.WithRetry(func() gax.Retryer {
1605 return gax.OnHTTPCodes(gax.Backoff{
1606 Initial: 1000 * time.Millisecond,
1607 Max: 10000 * time.Millisecond,
1608 Multiplier: 1.30,
1609 },
1610 http.StatusServiceUnavailable)
1611 }),
1612 },
1613 CreateQaQuestion: []gax.CallOption{
1614 gax.WithTimeout(60000 * time.Millisecond),
1615 gax.WithRetry(func() gax.Retryer {
1616 return gax.OnHTTPCodes(gax.Backoff{
1617 Initial: 1000 * time.Millisecond,
1618 Max: 10000 * time.Millisecond,
1619 Multiplier: 1.30,
1620 },
1621 http.StatusServiceUnavailable)
1622 }),
1623 },
1624 GetQaQuestion: []gax.CallOption{
1625 gax.WithTimeout(60000 * time.Millisecond),
1626 gax.WithRetry(func() gax.Retryer {
1627 return gax.OnHTTPCodes(gax.Backoff{
1628 Initial: 1000 * time.Millisecond,
1629 Max: 10000 * time.Millisecond,
1630 Multiplier: 1.30,
1631 },
1632 http.StatusServiceUnavailable)
1633 }),
1634 },
1635 UpdateQaQuestion: []gax.CallOption{
1636 gax.WithTimeout(60000 * time.Millisecond),
1637 gax.WithRetry(func() gax.Retryer {
1638 return gax.OnHTTPCodes(gax.Backoff{
1639 Initial: 1000 * time.Millisecond,
1640 Max: 10000 * time.Millisecond,
1641 Multiplier: 1.30,
1642 },
1643 http.StatusServiceUnavailable)
1644 }),
1645 },
1646 DeleteQaQuestion: []gax.CallOption{
1647 gax.WithTimeout(60000 * time.Millisecond),
1648 gax.WithRetry(func() gax.Retryer {
1649 return gax.OnHTTPCodes(gax.Backoff{
1650 Initial: 1000 * time.Millisecond,
1651 Max: 10000 * time.Millisecond,
1652 Multiplier: 1.30,
1653 },
1654 http.StatusServiceUnavailable)
1655 }),
1656 },
1657 ListQaQuestions: []gax.CallOption{
1658 gax.WithTimeout(60000 * time.Millisecond),
1659 gax.WithRetry(func() gax.Retryer {
1660 return gax.OnHTTPCodes(gax.Backoff{
1661 Initial: 1000 * time.Millisecond,
1662 Max: 10000 * time.Millisecond,
1663 Multiplier: 1.30,
1664 },
1665 http.StatusServiceUnavailable)
1666 }),
1667 },
1668 CreateQaScorecard: []gax.CallOption{
1669 gax.WithTimeout(60000 * time.Millisecond),
1670 gax.WithRetry(func() gax.Retryer {
1671 return gax.OnHTTPCodes(gax.Backoff{
1672 Initial: 1000 * time.Millisecond,
1673 Max: 10000 * time.Millisecond,
1674 Multiplier: 1.30,
1675 },
1676 http.StatusServiceUnavailable)
1677 }),
1678 },
1679 GetQaScorecard: []gax.CallOption{
1680 gax.WithTimeout(60000 * time.Millisecond),
1681 gax.WithRetry(func() gax.Retryer {
1682 return gax.OnHTTPCodes(gax.Backoff{
1683 Initial: 1000 * time.Millisecond,
1684 Max: 10000 * time.Millisecond,
1685 Multiplier: 1.30,
1686 },
1687 http.StatusServiceUnavailable)
1688 }),
1689 },
1690 UpdateQaScorecard: []gax.CallOption{
1691 gax.WithTimeout(60000 * time.Millisecond),
1692 gax.WithRetry(func() gax.Retryer {
1693 return gax.OnHTTPCodes(gax.Backoff{
1694 Initial: 1000 * time.Millisecond,
1695 Max: 10000 * time.Millisecond,
1696 Multiplier: 1.30,
1697 },
1698 http.StatusServiceUnavailable)
1699 }),
1700 },
1701 DeleteQaScorecard: []gax.CallOption{
1702 gax.WithTimeout(60000 * time.Millisecond),
1703 gax.WithRetry(func() gax.Retryer {
1704 return gax.OnHTTPCodes(gax.Backoff{
1705 Initial: 1000 * time.Millisecond,
1706 Max: 10000 * time.Millisecond,
1707 Multiplier: 1.30,
1708 },
1709 http.StatusServiceUnavailable)
1710 }),
1711 },
1712 ListQaScorecards: []gax.CallOption{
1713 gax.WithTimeout(60000 * time.Millisecond),
1714 gax.WithRetry(func() gax.Retryer {
1715 return gax.OnHTTPCodes(gax.Backoff{
1716 Initial: 1000 * time.Millisecond,
1717 Max: 10000 * time.Millisecond,
1718 Multiplier: 1.30,
1719 },
1720 http.StatusServiceUnavailable)
1721 }),
1722 },
1723 CreateQaScorecardRevision: []gax.CallOption{
1724 gax.WithTimeout(60000 * time.Millisecond),
1725 gax.WithRetry(func() gax.Retryer {
1726 return gax.OnHTTPCodes(gax.Backoff{
1727 Initial: 1000 * time.Millisecond,
1728 Max: 10000 * time.Millisecond,
1729 Multiplier: 1.30,
1730 },
1731 http.StatusServiceUnavailable)
1732 }),
1733 },
1734 GetQaScorecardRevision: []gax.CallOption{
1735 gax.WithTimeout(60000 * time.Millisecond),
1736 gax.WithRetry(func() gax.Retryer {
1737 return gax.OnHTTPCodes(gax.Backoff{
1738 Initial: 1000 * time.Millisecond,
1739 Max: 10000 * time.Millisecond,
1740 Multiplier: 1.30,
1741 },
1742 http.StatusServiceUnavailable)
1743 }),
1744 },
1745 TuneQaScorecardRevision: []gax.CallOption{
1746 gax.WithTimeout(60000 * time.Millisecond),
1747 gax.WithRetry(func() gax.Retryer {
1748 return gax.OnHTTPCodes(gax.Backoff{
1749 Initial: 1000 * time.Millisecond,
1750 Max: 10000 * time.Millisecond,
1751 Multiplier: 1.30,
1752 },
1753 http.StatusServiceUnavailable)
1754 }),
1755 },
1756 DeployQaScorecardRevision: []gax.CallOption{
1757 gax.WithTimeout(60000 * time.Millisecond),
1758 gax.WithRetry(func() gax.Retryer {
1759 return gax.OnHTTPCodes(gax.Backoff{
1760 Initial: 1000 * time.Millisecond,
1761 Max: 10000 * time.Millisecond,
1762 Multiplier: 1.30,
1763 },
1764 http.StatusServiceUnavailable)
1765 }),
1766 },
1767 UndeployQaScorecardRevision: []gax.CallOption{
1768 gax.WithTimeout(60000 * time.Millisecond),
1769 gax.WithRetry(func() gax.Retryer {
1770 return gax.OnHTTPCodes(gax.Backoff{
1771 Initial: 1000 * time.Millisecond,
1772 Max: 10000 * time.Millisecond,
1773 Multiplier: 1.30,
1774 },
1775 http.StatusServiceUnavailable)
1776 }),
1777 },
1778 DeleteQaScorecardRevision: []gax.CallOption{
1779 gax.WithTimeout(60000 * time.Millisecond),
1780 gax.WithRetry(func() gax.Retryer {
1781 return gax.OnHTTPCodes(gax.Backoff{
1782 Initial: 1000 * time.Millisecond,
1783 Max: 10000 * time.Millisecond,
1784 Multiplier: 1.30,
1785 },
1786 http.StatusServiceUnavailable)
1787 }),
1788 },
1789 ListQaScorecardRevisions: []gax.CallOption{
1790 gax.WithTimeout(60000 * time.Millisecond),
1791 gax.WithRetry(func() gax.Retryer {
1792 return gax.OnHTTPCodes(gax.Backoff{
1793 Initial: 1000 * time.Millisecond,
1794 Max: 10000 * time.Millisecond,
1795 Multiplier: 1.30,
1796 },
1797 http.StatusServiceUnavailable)
1798 }),
1799 },
1800 CreateFeedbackLabel: []gax.CallOption{
1801 gax.WithTimeout(60000 * time.Millisecond),
1802 gax.WithRetry(func() gax.Retryer {
1803 return gax.OnHTTPCodes(gax.Backoff{
1804 Initial: 1000 * time.Millisecond,
1805 Max: 10000 * time.Millisecond,
1806 Multiplier: 1.30,
1807 },
1808 http.StatusServiceUnavailable)
1809 }),
1810 },
1811 ListFeedbackLabels: []gax.CallOption{
1812 gax.WithTimeout(60000 * time.Millisecond),
1813 gax.WithRetry(func() gax.Retryer {
1814 return gax.OnHTTPCodes(gax.Backoff{
1815 Initial: 1000 * time.Millisecond,
1816 Max: 10000 * time.Millisecond,
1817 Multiplier: 1.30,
1818 },
1819 http.StatusServiceUnavailable)
1820 }),
1821 },
1822 GetFeedbackLabel: []gax.CallOption{
1823 gax.WithTimeout(60000 * time.Millisecond),
1824 gax.WithRetry(func() gax.Retryer {
1825 return gax.OnHTTPCodes(gax.Backoff{
1826 Initial: 1000 * time.Millisecond,
1827 Max: 10000 * time.Millisecond,
1828 Multiplier: 1.30,
1829 },
1830 http.StatusServiceUnavailable)
1831 }),
1832 },
1833 UpdateFeedbackLabel: []gax.CallOption{
1834 gax.WithTimeout(60000 * time.Millisecond),
1835 gax.WithRetry(func() gax.Retryer {
1836 return gax.OnHTTPCodes(gax.Backoff{
1837 Initial: 1000 * time.Millisecond,
1838 Max: 10000 * time.Millisecond,
1839 Multiplier: 1.30,
1840 },
1841 http.StatusServiceUnavailable)
1842 }),
1843 },
1844 DeleteFeedbackLabel: []gax.CallOption{
1845 gax.WithTimeout(60000 * time.Millisecond),
1846 gax.WithRetry(func() gax.Retryer {
1847 return gax.OnHTTPCodes(gax.Backoff{
1848 Initial: 1000 * time.Millisecond,
1849 Max: 10000 * time.Millisecond,
1850 Multiplier: 1.30,
1851 },
1852 http.StatusServiceUnavailable)
1853 }),
1854 },
1855 ListAllFeedbackLabels: []gax.CallOption{
1856 gax.WithTimeout(60000 * time.Millisecond),
1857 gax.WithRetry(func() gax.Retryer {
1858 return gax.OnHTTPCodes(gax.Backoff{
1859 Initial: 1000 * time.Millisecond,
1860 Max: 10000 * time.Millisecond,
1861 Multiplier: 1.30,
1862 },
1863 http.StatusServiceUnavailable)
1864 }),
1865 },
1866 BulkUploadFeedbackLabels: []gax.CallOption{
1867 gax.WithTimeout(60000 * time.Millisecond),
1868 gax.WithRetry(func() gax.Retryer {
1869 return gax.OnHTTPCodes(gax.Backoff{
1870 Initial: 1000 * time.Millisecond,
1871 Max: 10000 * time.Millisecond,
1872 Multiplier: 1.30,
1873 },
1874 http.StatusServiceUnavailable)
1875 }),
1876 },
1877 BulkDownloadFeedbackLabels: []gax.CallOption{
1878 gax.WithTimeout(60000 * time.Millisecond),
1879 gax.WithRetry(func() gax.Retryer {
1880 return gax.OnHTTPCodes(gax.Backoff{
1881 Initial: 1000 * time.Millisecond,
1882 Max: 10000 * time.Millisecond,
1883 Multiplier: 1.30,
1884 },
1885 http.StatusServiceUnavailable)
1886 }),
1887 },
1888 CancelOperation: []gax.CallOption{
1889 gax.WithTimeout(60000 * time.Millisecond),
1890 gax.WithRetry(func() gax.Retryer {
1891 return gax.OnHTTPCodes(gax.Backoff{
1892 Initial: 1000 * time.Millisecond,
1893 Max: 10000 * time.Millisecond,
1894 Multiplier: 1.30,
1895 },
1896 http.StatusServiceUnavailable)
1897 }),
1898 },
1899 GetOperation: []gax.CallOption{
1900 gax.WithTimeout(60000 * time.Millisecond),
1901 gax.WithRetry(func() gax.Retryer {
1902 return gax.OnHTTPCodes(gax.Backoff{
1903 Initial: 1000 * time.Millisecond,
1904 Max: 10000 * time.Millisecond,
1905 Multiplier: 1.30,
1906 },
1907 http.StatusServiceUnavailable)
1908 }),
1909 },
1910 ListOperations: []gax.CallOption{
1911 gax.WithTimeout(60000 * time.Millisecond),
1912 gax.WithRetry(func() gax.Retryer {
1913 return gax.OnHTTPCodes(gax.Backoff{
1914 Initial: 1000 * time.Millisecond,
1915 Max: 10000 * time.Millisecond,
1916 Multiplier: 1.30,
1917 },
1918 http.StatusServiceUnavailable)
1919 }),
1920 },
1921 }
1922 }
1923
1924 // internalClient is an interface that defines the methods available from Contact Center AI Insights API.
1925 type internalClient interface {
1926 Close() error
1927 setGoogleClientInfo(...string)
1928 Connection() *grpc.ClientConn
1929 CreateConversation(context.Context, *contactcenterinsightspb.CreateConversationRequest, ...gax.CallOption) (*contactcenterinsightspb.Conversation, error)
1930 UploadConversation(context.Context, *contactcenterinsightspb.UploadConversationRequest, ...gax.CallOption) (*UploadConversationOperation, error)
1931 UploadConversationOperation(name string) *UploadConversationOperation
1932 UpdateConversation(context.Context, *contactcenterinsightspb.UpdateConversationRequest, ...gax.CallOption) (*contactcenterinsightspb.Conversation, error)
1933 GetConversation(context.Context, *contactcenterinsightspb.GetConversationRequest, ...gax.CallOption) (*contactcenterinsightspb.Conversation, error)
1934 ListConversations(context.Context, *contactcenterinsightspb.ListConversationsRequest, ...gax.CallOption) *ConversationIterator
1935 DeleteConversation(context.Context, *contactcenterinsightspb.DeleteConversationRequest, ...gax.CallOption) error
1936 CreateAnalysis(context.Context, *contactcenterinsightspb.CreateAnalysisRequest, ...gax.CallOption) (*CreateAnalysisOperation, error)
1937 CreateAnalysisOperation(name string) *CreateAnalysisOperation
1938 GetAnalysis(context.Context, *contactcenterinsightspb.GetAnalysisRequest, ...gax.CallOption) (*contactcenterinsightspb.Analysis, error)
1939 ListAnalyses(context.Context, *contactcenterinsightspb.ListAnalysesRequest, ...gax.CallOption) *AnalysisIterator
1940 DeleteAnalysis(context.Context, *contactcenterinsightspb.DeleteAnalysisRequest, ...gax.CallOption) error
1941 BulkAnalyzeConversations(context.Context, *contactcenterinsightspb.BulkAnalyzeConversationsRequest, ...gax.CallOption) (*BulkAnalyzeConversationsOperation, error)
1942 BulkAnalyzeConversationsOperation(name string) *BulkAnalyzeConversationsOperation
1943 BulkDeleteConversations(context.Context, *contactcenterinsightspb.BulkDeleteConversationsRequest, ...gax.CallOption) (*BulkDeleteConversationsOperation, error)
1944 BulkDeleteConversationsOperation(name string) *BulkDeleteConversationsOperation
1945 IngestConversations(context.Context, *contactcenterinsightspb.IngestConversationsRequest, ...gax.CallOption) (*IngestConversationsOperation, error)
1946 IngestConversationsOperation(name string) *IngestConversationsOperation
1947 ExportInsightsData(context.Context, *contactcenterinsightspb.ExportInsightsDataRequest, ...gax.CallOption) (*ExportInsightsDataOperation, error)
1948 ExportInsightsDataOperation(name string) *ExportInsightsDataOperation
1949 CreateIssueModel(context.Context, *contactcenterinsightspb.CreateIssueModelRequest, ...gax.CallOption) (*CreateIssueModelOperation, error)
1950 CreateIssueModelOperation(name string) *CreateIssueModelOperation
1951 UpdateIssueModel(context.Context, *contactcenterinsightspb.UpdateIssueModelRequest, ...gax.CallOption) (*contactcenterinsightspb.IssueModel, error)
1952 GetIssueModel(context.Context, *contactcenterinsightspb.GetIssueModelRequest, ...gax.CallOption) (*contactcenterinsightspb.IssueModel, error)
1953 ListIssueModels(context.Context, *contactcenterinsightspb.ListIssueModelsRequest, ...gax.CallOption) (*contactcenterinsightspb.ListIssueModelsResponse, error)
1954 DeleteIssueModel(context.Context, *contactcenterinsightspb.DeleteIssueModelRequest, ...gax.CallOption) (*DeleteIssueModelOperation, error)
1955 DeleteIssueModelOperation(name string) *DeleteIssueModelOperation
1956 DeployIssueModel(context.Context, *contactcenterinsightspb.DeployIssueModelRequest, ...gax.CallOption) (*DeployIssueModelOperation, error)
1957 DeployIssueModelOperation(name string) *DeployIssueModelOperation
1958 UndeployIssueModel(context.Context, *contactcenterinsightspb.UndeployIssueModelRequest, ...gax.CallOption) (*UndeployIssueModelOperation, error)
1959 UndeployIssueModelOperation(name string) *UndeployIssueModelOperation
1960 ExportIssueModel(context.Context, *contactcenterinsightspb.ExportIssueModelRequest, ...gax.CallOption) (*ExportIssueModelOperation, error)
1961 ExportIssueModelOperation(name string) *ExportIssueModelOperation
1962 ImportIssueModel(context.Context, *contactcenterinsightspb.ImportIssueModelRequest, ...gax.CallOption) (*ImportIssueModelOperation, error)
1963 ImportIssueModelOperation(name string) *ImportIssueModelOperation
1964 GetIssue(context.Context, *contactcenterinsightspb.GetIssueRequest, ...gax.CallOption) (*contactcenterinsightspb.Issue, error)
1965 ListIssues(context.Context, *contactcenterinsightspb.ListIssuesRequest, ...gax.CallOption) (*contactcenterinsightspb.ListIssuesResponse, error)
1966 UpdateIssue(context.Context, *contactcenterinsightspb.UpdateIssueRequest, ...gax.CallOption) (*contactcenterinsightspb.Issue, error)
1967 DeleteIssue(context.Context, *contactcenterinsightspb.DeleteIssueRequest, ...gax.CallOption) error
1968 CalculateIssueModelStats(context.Context, *contactcenterinsightspb.CalculateIssueModelStatsRequest, ...gax.CallOption) (*contactcenterinsightspb.CalculateIssueModelStatsResponse, error)
1969 CreatePhraseMatcher(context.Context, *contactcenterinsightspb.CreatePhraseMatcherRequest, ...gax.CallOption) (*contactcenterinsightspb.PhraseMatcher, error)
1970 GetPhraseMatcher(context.Context, *contactcenterinsightspb.GetPhraseMatcherRequest, ...gax.CallOption) (*contactcenterinsightspb.PhraseMatcher, error)
1971 ListPhraseMatchers(context.Context, *contactcenterinsightspb.ListPhraseMatchersRequest, ...gax.CallOption) *PhraseMatcherIterator
1972 DeletePhraseMatcher(context.Context, *contactcenterinsightspb.DeletePhraseMatcherRequest, ...gax.CallOption) error
1973 UpdatePhraseMatcher(context.Context, *contactcenterinsightspb.UpdatePhraseMatcherRequest, ...gax.CallOption) (*contactcenterinsightspb.PhraseMatcher, error)
1974 CalculateStats(context.Context, *contactcenterinsightspb.CalculateStatsRequest, ...gax.CallOption) (*contactcenterinsightspb.CalculateStatsResponse, error)
1975 GetSettings(context.Context, *contactcenterinsightspb.GetSettingsRequest, ...gax.CallOption) (*contactcenterinsightspb.Settings, error)
1976 UpdateSettings(context.Context, *contactcenterinsightspb.UpdateSettingsRequest, ...gax.CallOption) (*contactcenterinsightspb.Settings, error)
1977 CreateAnalysisRule(context.Context, *contactcenterinsightspb.CreateAnalysisRuleRequest, ...gax.CallOption) (*contactcenterinsightspb.AnalysisRule, error)
1978 GetAnalysisRule(context.Context, *contactcenterinsightspb.GetAnalysisRuleRequest, ...gax.CallOption) (*contactcenterinsightspb.AnalysisRule, error)
1979 ListAnalysisRules(context.Context, *contactcenterinsightspb.ListAnalysisRulesRequest, ...gax.CallOption) *AnalysisRuleIterator
1980 UpdateAnalysisRule(context.Context, *contactcenterinsightspb.UpdateAnalysisRuleRequest, ...gax.CallOption) (*contactcenterinsightspb.AnalysisRule, error)
1981 DeleteAnalysisRule(context.Context, *contactcenterinsightspb.DeleteAnalysisRuleRequest, ...gax.CallOption) error
1982 GetEncryptionSpec(context.Context, *contactcenterinsightspb.GetEncryptionSpecRequest, ...gax.CallOption) (*contactcenterinsightspb.EncryptionSpec, error)
1983 InitializeEncryptionSpec(context.Context, *contactcenterinsightspb.InitializeEncryptionSpecRequest, ...gax.CallOption) (*InitializeEncryptionSpecOperation, error)
1984 InitializeEncryptionSpecOperation(name string) *InitializeEncryptionSpecOperation
1985 CreateView(context.Context, *contactcenterinsightspb.CreateViewRequest, ...gax.CallOption) (*contactcenterinsightspb.View, error)
1986 GetView(context.Context, *contactcenterinsightspb.GetViewRequest, ...gax.CallOption) (*contactcenterinsightspb.View, error)
1987 ListViews(context.Context, *contactcenterinsightspb.ListViewsRequest, ...gax.CallOption) *ViewIterator
1988 UpdateView(context.Context, *contactcenterinsightspb.UpdateViewRequest, ...gax.CallOption) (*contactcenterinsightspb.View, error)
1989 DeleteView(context.Context, *contactcenterinsightspb.DeleteViewRequest, ...gax.CallOption) error
1990 QueryMetrics(context.Context, *contactcenterinsightspb.QueryMetricsRequest, ...gax.CallOption) (*QueryMetricsOperation, error)
1991 QueryMetricsOperation(name string) *QueryMetricsOperation
1992 CreateQaQuestion(context.Context, *contactcenterinsightspb.CreateQaQuestionRequest, ...gax.CallOption) (*contactcenterinsightspb.QaQuestion, error)
1993 GetQaQuestion(context.Context, *contactcenterinsightspb.GetQaQuestionRequest, ...gax.CallOption) (*contactcenterinsightspb.QaQuestion, error)
1994 UpdateQaQuestion(context.Context, *contactcenterinsightspb.UpdateQaQuestionRequest, ...gax.CallOption) (*contactcenterinsightspb.QaQuestion, error)
1995 DeleteQaQuestion(context.Context, *contactcenterinsightspb.DeleteQaQuestionRequest, ...gax.CallOption) error
1996 ListQaQuestions(context.Context, *contactcenterinsightspb.ListQaQuestionsRequest, ...gax.CallOption) *QaQuestionIterator
1997 CreateQaScorecard(context.Context, *contactcenterinsightspb.CreateQaScorecardRequest, ...gax.CallOption) (*contactcenterinsightspb.QaScorecard, error)
1998 GetQaScorecard(context.Context, *contactcenterinsightspb.GetQaScorecardRequest, ...gax.CallOption) (*contactcenterinsightspb.QaScorecard, error)
1999 UpdateQaScorecard(context.Context, *contactcenterinsightspb.UpdateQaScorecardRequest, ...gax.CallOption) (*contactcenterinsightspb.QaScorecard, error)
2000 DeleteQaScorecard(context.Context, *contactcenterinsightspb.DeleteQaScorecardRequest, ...gax.CallOption) error
2001 ListQaScorecards(context.Context, *contactcenterinsightspb.ListQaScorecardsRequest, ...gax.CallOption) *QaScorecardIterator
2002 CreateQaScorecardRevision(context.Context, *contactcenterinsightspb.CreateQaScorecardRevisionRequest, ...gax.CallOption) (*contactcenterinsightspb.QaScorecardRevision, error)
2003 GetQaScorecardRevision(context.Context, *contactcenterinsightspb.GetQaScorecardRevisionRequest, ...gax.CallOption) (*contactcenterinsightspb.QaScorecardRevision, error)
2004 TuneQaScorecardRevision(context.Context, *contactcenterinsightspb.TuneQaScorecardRevisionRequest, ...gax.CallOption) (*TuneQaScorecardRevisionOperation, error)
2005 TuneQaScorecardRevisionOperation(name string) *TuneQaScorecardRevisionOperation
2006 DeployQaScorecardRevision(context.Context, *contactcenterinsightspb.DeployQaScorecardRevisionRequest, ...gax.CallOption) (*contactcenterinsightspb.QaScorecardRevision, error)
2007 UndeployQaScorecardRevision(context.Context, *contactcenterinsightspb.UndeployQaScorecardRevisionRequest, ...gax.CallOption) (*contactcenterinsightspb.QaScorecardRevision, error)
2008 DeleteQaScorecardRevision(context.Context, *contactcenterinsightspb.DeleteQaScorecardRevisionRequest, ...gax.CallOption) error
2009 ListQaScorecardRevisions(context.Context, *contactcenterinsightspb.ListQaScorecardRevisionsRequest, ...gax.CallOption) *QaScorecardRevisionIterator
2010 CreateFeedbackLabel(context.Context, *contactcenterinsightspb.CreateFeedbackLabelRequest, ...gax.CallOption) (*contactcenterinsightspb.FeedbackLabel, error)
2011 ListFeedbackLabels(context.Context, *contactcenterinsightspb.ListFeedbackLabelsRequest, ...gax.CallOption) *FeedbackLabelIterator
2012 GetFeedbackLabel(context.Context, *contactcenterinsightspb.GetFeedbackLabelRequest, ...gax.CallOption) (*contactcenterinsightspb.FeedbackLabel, error)
2013 UpdateFeedbackLabel(context.Context, *contactcenterinsightspb.UpdateFeedbackLabelRequest, ...gax.CallOption) (*contactcenterinsightspb.FeedbackLabel, error)
2014 DeleteFeedbackLabel(context.Context, *contactcenterinsightspb.DeleteFeedbackLabelRequest, ...gax.CallOption) error
2015 ListAllFeedbackLabels(context.Context, *contactcenterinsightspb.ListAllFeedbackLabelsRequest, ...gax.CallOption) *FeedbackLabelIterator
2016 BulkUploadFeedbackLabels(context.Context, *contactcenterinsightspb.BulkUploadFeedbackLabelsRequest, ...gax.CallOption) (*BulkUploadFeedbackLabelsOperation, error)
2017 BulkUploadFeedbackLabelsOperation(name string) *BulkUploadFeedbackLabelsOperation
2018 BulkDownloadFeedbackLabels(context.Context, *contactcenterinsightspb.BulkDownloadFeedbackLabelsRequest, ...gax.CallOption) (*BulkDownloadFeedbackLabelsOperation, error)
2019 BulkDownloadFeedbackLabelsOperation(name string) *BulkDownloadFeedbackLabelsOperation
2020 CancelOperation(context.Context, *longrunningpb.CancelOperationRequest, ...gax.CallOption) error
2021 GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error)
2022 ListOperations(context.Context, *longrunningpb.ListOperationsRequest, ...gax.CallOption) *OperationIterator
2023 }
2024
2025 // Client is a client for interacting with Contact Center AI Insights API.
2026 // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
2027 //
2028 // An API that lets users analyze and explore their business conversation data.
2029 type Client struct {
2030 // The internal transport-dependent client.
2031 internalClient internalClient
2032
2033 // The call options for this service.
2034 CallOptions *CallOptions
2035
2036 // LROClient is used internally to handle long-running operations.
2037 // It is exposed so that its CallOptions can be modified if required.
2038 // Users should not Close this client.
2039 LROClient *lroauto.OperationsClient
2040 }
2041
2042 // Wrapper methods routed to the internal client.
2043
2044 // Close closes the connection to the API service. The user should invoke this when
2045 // the client is no longer required.
2046 func (c *Client) Close() error {
2047 return c.internalClient.Close()
2048 }
2049
2050 // setGoogleClientInfo sets the name and version of the application in
2051 // the `x-goog-api-client` header passed on each request. Intended for
2052 // use by Google-written clients.
2053 func (c *Client) setGoogleClientInfo(keyval ...string) {
2054 c.internalClient.setGoogleClientInfo(keyval...)
2055 }
2056
2057 // Connection returns a connection to the API service.
2058 //
2059 // Deprecated: Connections are now pooled so this method does not always
2060 // return the same resource.
2061 func (c *Client) Connection() *grpc.ClientConn {
2062 return c.internalClient.Connection()
2063 }
2064
2065 // CreateConversation creates a conversation.
2066 // Note that this method does not support audio transcription or redaction.
2067 // Use conversations.upload instead.
2068 func (c *Client) CreateConversation(ctx context.Context, req *contactcenterinsightspb.CreateConversationRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Conversation, error) {
2069 return c.internalClient.CreateConversation(ctx, req, opts...)
2070 }
2071
2072 // UploadConversation create a long-running conversation upload operation. This method differs
2073 // from CreateConversation by allowing audio transcription and optional DLP
2074 // redaction.
2075 func (c *Client) UploadConversation(ctx context.Context, req *contactcenterinsightspb.UploadConversationRequest, opts ...gax.CallOption) (*UploadConversationOperation, error) {
2076 return c.internalClient.UploadConversation(ctx, req, opts...)
2077 }
2078
2079 // UploadConversationOperation returns a new UploadConversationOperation from a given name.
2080 // The name must be that of a previously created UploadConversationOperation, possibly from a different process.
2081 func (c *Client) UploadConversationOperation(name string) *UploadConversationOperation {
2082 return c.internalClient.UploadConversationOperation(name)
2083 }
2084
2085 // UpdateConversation updates a conversation.
2086 func (c *Client) UpdateConversation(ctx context.Context, req *contactcenterinsightspb.UpdateConversationRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Conversation, error) {
2087 return c.internalClient.UpdateConversation(ctx, req, opts...)
2088 }
2089
2090 // GetConversation gets a conversation.
2091 func (c *Client) GetConversation(ctx context.Context, req *contactcenterinsightspb.GetConversationRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Conversation, error) {
2092 return c.internalClient.GetConversation(ctx, req, opts...)
2093 }
2094
2095 // ListConversations lists conversations.
2096 func (c *Client) ListConversations(ctx context.Context, req *contactcenterinsightspb.ListConversationsRequest, opts ...gax.CallOption) *ConversationIterator {
2097 return c.internalClient.ListConversations(ctx, req, opts...)
2098 }
2099
2100 // DeleteConversation deletes a conversation.
2101 func (c *Client) DeleteConversation(ctx context.Context, req *contactcenterinsightspb.DeleteConversationRequest, opts ...gax.CallOption) error {
2102 return c.internalClient.DeleteConversation(ctx, req, opts...)
2103 }
2104
2105 // CreateAnalysis creates an analysis. The long running operation is done when the analysis
2106 // has completed.
2107 func (c *Client) CreateAnalysis(ctx context.Context, req *contactcenterinsightspb.CreateAnalysisRequest, opts ...gax.CallOption) (*CreateAnalysisOperation, error) {
2108 return c.internalClient.CreateAnalysis(ctx, req, opts...)
2109 }
2110
2111 // CreateAnalysisOperation returns a new CreateAnalysisOperation from a given name.
2112 // The name must be that of a previously created CreateAnalysisOperation, possibly from a different process.
2113 func (c *Client) CreateAnalysisOperation(name string) *CreateAnalysisOperation {
2114 return c.internalClient.CreateAnalysisOperation(name)
2115 }
2116
2117 // GetAnalysis gets an analysis.
2118 func (c *Client) GetAnalysis(ctx context.Context, req *contactcenterinsightspb.GetAnalysisRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Analysis, error) {
2119 return c.internalClient.GetAnalysis(ctx, req, opts...)
2120 }
2121
2122 // ListAnalyses lists analyses.
2123 func (c *Client) ListAnalyses(ctx context.Context, req *contactcenterinsightspb.ListAnalysesRequest, opts ...gax.CallOption) *AnalysisIterator {
2124 return c.internalClient.ListAnalyses(ctx, req, opts...)
2125 }
2126
2127 // DeleteAnalysis deletes an analysis.
2128 func (c *Client) DeleteAnalysis(ctx context.Context, req *contactcenterinsightspb.DeleteAnalysisRequest, opts ...gax.CallOption) error {
2129 return c.internalClient.DeleteAnalysis(ctx, req, opts...)
2130 }
2131
2132 // BulkAnalyzeConversations analyzes multiple conversations in a single request.
2133 func (c *Client) BulkAnalyzeConversations(ctx context.Context, req *contactcenterinsightspb.BulkAnalyzeConversationsRequest, opts ...gax.CallOption) (*BulkAnalyzeConversationsOperation, error) {
2134 return c.internalClient.BulkAnalyzeConversations(ctx, req, opts...)
2135 }
2136
2137 // BulkAnalyzeConversationsOperation returns a new BulkAnalyzeConversationsOperation from a given name.
2138 // The name must be that of a previously created BulkAnalyzeConversationsOperation, possibly from a different process.
2139 func (c *Client) BulkAnalyzeConversationsOperation(name string) *BulkAnalyzeConversationsOperation {
2140 return c.internalClient.BulkAnalyzeConversationsOperation(name)
2141 }
2142
2143 // BulkDeleteConversations deletes multiple conversations in a single request.
2144 func (c *Client) BulkDeleteConversations(ctx context.Context, req *contactcenterinsightspb.BulkDeleteConversationsRequest, opts ...gax.CallOption) (*BulkDeleteConversationsOperation, error) {
2145 return c.internalClient.BulkDeleteConversations(ctx, req, opts...)
2146 }
2147
2148 // BulkDeleteConversationsOperation returns a new BulkDeleteConversationsOperation from a given name.
2149 // The name must be that of a previously created BulkDeleteConversationsOperation, possibly from a different process.
2150 func (c *Client) BulkDeleteConversationsOperation(name string) *BulkDeleteConversationsOperation {
2151 return c.internalClient.BulkDeleteConversationsOperation(name)
2152 }
2153
2154 // IngestConversations imports conversations and processes them according to the user’s
2155 // configuration.
2156 func (c *Client) IngestConversations(ctx context.Context, req *contactcenterinsightspb.IngestConversationsRequest, opts ...gax.CallOption) (*IngestConversationsOperation, error) {
2157 return c.internalClient.IngestConversations(ctx, req, opts...)
2158 }
2159
2160 // IngestConversationsOperation returns a new IngestConversationsOperation from a given name.
2161 // The name must be that of a previously created IngestConversationsOperation, possibly from a different process.
2162 func (c *Client) IngestConversationsOperation(name string) *IngestConversationsOperation {
2163 return c.internalClient.IngestConversationsOperation(name)
2164 }
2165
2166 // ExportInsightsData export insights data to a destination defined in the request body.
2167 func (c *Client) ExportInsightsData(ctx context.Context, req *contactcenterinsightspb.ExportInsightsDataRequest, opts ...gax.CallOption) (*ExportInsightsDataOperation, error) {
2168 return c.internalClient.ExportInsightsData(ctx, req, opts...)
2169 }
2170
2171 // ExportInsightsDataOperation returns a new ExportInsightsDataOperation from a given name.
2172 // The name must be that of a previously created ExportInsightsDataOperation, possibly from a different process.
2173 func (c *Client) ExportInsightsDataOperation(name string) *ExportInsightsDataOperation {
2174 return c.internalClient.ExportInsightsDataOperation(name)
2175 }
2176
2177 // CreateIssueModel creates an issue model.
2178 func (c *Client) CreateIssueModel(ctx context.Context, req *contactcenterinsightspb.CreateIssueModelRequest, opts ...gax.CallOption) (*CreateIssueModelOperation, error) {
2179 return c.internalClient.CreateIssueModel(ctx, req, opts...)
2180 }
2181
2182 // CreateIssueModelOperation returns a new CreateIssueModelOperation from a given name.
2183 // The name must be that of a previously created CreateIssueModelOperation, possibly from a different process.
2184 func (c *Client) CreateIssueModelOperation(name string) *CreateIssueModelOperation {
2185 return c.internalClient.CreateIssueModelOperation(name)
2186 }
2187
2188 // UpdateIssueModel updates an issue model.
2189 func (c *Client) UpdateIssueModel(ctx context.Context, req *contactcenterinsightspb.UpdateIssueModelRequest, opts ...gax.CallOption) (*contactcenterinsightspb.IssueModel, error) {
2190 return c.internalClient.UpdateIssueModel(ctx, req, opts...)
2191 }
2192
2193 // GetIssueModel gets an issue model.
2194 func (c *Client) GetIssueModel(ctx context.Context, req *contactcenterinsightspb.GetIssueModelRequest, opts ...gax.CallOption) (*contactcenterinsightspb.IssueModel, error) {
2195 return c.internalClient.GetIssueModel(ctx, req, opts...)
2196 }
2197
2198 // ListIssueModels lists issue models.
2199 func (c *Client) ListIssueModels(ctx context.Context, req *contactcenterinsightspb.ListIssueModelsRequest, opts ...gax.CallOption) (*contactcenterinsightspb.ListIssueModelsResponse, error) {
2200 return c.internalClient.ListIssueModels(ctx, req, opts...)
2201 }
2202
2203 // DeleteIssueModel deletes an issue model.
2204 func (c *Client) DeleteIssueModel(ctx context.Context, req *contactcenterinsightspb.DeleteIssueModelRequest, opts ...gax.CallOption) (*DeleteIssueModelOperation, error) {
2205 return c.internalClient.DeleteIssueModel(ctx, req, opts...)
2206 }
2207
2208 // DeleteIssueModelOperation returns a new DeleteIssueModelOperation from a given name.
2209 // The name must be that of a previously created DeleteIssueModelOperation, possibly from a different process.
2210 func (c *Client) DeleteIssueModelOperation(name string) *DeleteIssueModelOperation {
2211 return c.internalClient.DeleteIssueModelOperation(name)
2212 }
2213
2214 // DeployIssueModel deploys an issue model. Returns an error if a model is already deployed.
2215 // An issue model can only be used in analysis after it has been deployed.
2216 func (c *Client) DeployIssueModel(ctx context.Context, req *contactcenterinsightspb.DeployIssueModelRequest, opts ...gax.CallOption) (*DeployIssueModelOperation, error) {
2217 return c.internalClient.DeployIssueModel(ctx, req, opts...)
2218 }
2219
2220 // DeployIssueModelOperation returns a new DeployIssueModelOperation from a given name.
2221 // The name must be that of a previously created DeployIssueModelOperation, possibly from a different process.
2222 func (c *Client) DeployIssueModelOperation(name string) *DeployIssueModelOperation {
2223 return c.internalClient.DeployIssueModelOperation(name)
2224 }
2225
2226 // UndeployIssueModel undeploys an issue model.
2227 // An issue model can not be used in analysis after it has been undeployed.
2228 func (c *Client) UndeployIssueModel(ctx context.Context, req *contactcenterinsightspb.UndeployIssueModelRequest, opts ...gax.CallOption) (*UndeployIssueModelOperation, error) {
2229 return c.internalClient.UndeployIssueModel(ctx, req, opts...)
2230 }
2231
2232 // UndeployIssueModelOperation returns a new UndeployIssueModelOperation from a given name.
2233 // The name must be that of a previously created UndeployIssueModelOperation, possibly from a different process.
2234 func (c *Client) UndeployIssueModelOperation(name string) *UndeployIssueModelOperation {
2235 return c.internalClient.UndeployIssueModelOperation(name)
2236 }
2237
2238 // ExportIssueModel exports an issue model to the provided destination.
2239 func (c *Client) ExportIssueModel(ctx context.Context, req *contactcenterinsightspb.ExportIssueModelRequest, opts ...gax.CallOption) (*ExportIssueModelOperation, error) {
2240 return c.internalClient.ExportIssueModel(ctx, req, opts...)
2241 }
2242
2243 // ExportIssueModelOperation returns a new ExportIssueModelOperation from a given name.
2244 // The name must be that of a previously created ExportIssueModelOperation, possibly from a different process.
2245 func (c *Client) ExportIssueModelOperation(name string) *ExportIssueModelOperation {
2246 return c.internalClient.ExportIssueModelOperation(name)
2247 }
2248
2249 // ImportIssueModel imports an issue model from a Cloud Storage bucket.
2250 func (c *Client) ImportIssueModel(ctx context.Context, req *contactcenterinsightspb.ImportIssueModelRequest, opts ...gax.CallOption) (*ImportIssueModelOperation, error) {
2251 return c.internalClient.ImportIssueModel(ctx, req, opts...)
2252 }
2253
2254 // ImportIssueModelOperation returns a new ImportIssueModelOperation from a given name.
2255 // The name must be that of a previously created ImportIssueModelOperation, possibly from a different process.
2256 func (c *Client) ImportIssueModelOperation(name string) *ImportIssueModelOperation {
2257 return c.internalClient.ImportIssueModelOperation(name)
2258 }
2259
2260 // GetIssue gets an issue.
2261 func (c *Client) GetIssue(ctx context.Context, req *contactcenterinsightspb.GetIssueRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Issue, error) {
2262 return c.internalClient.GetIssue(ctx, req, opts...)
2263 }
2264
2265 // ListIssues lists issues.
2266 func (c *Client) ListIssues(ctx context.Context, req *contactcenterinsightspb.ListIssuesRequest, opts ...gax.CallOption) (*contactcenterinsightspb.ListIssuesResponse, error) {
2267 return c.internalClient.ListIssues(ctx, req, opts...)
2268 }
2269
2270 // UpdateIssue updates an issue.
2271 func (c *Client) UpdateIssue(ctx context.Context, req *contactcenterinsightspb.UpdateIssueRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Issue, error) {
2272 return c.internalClient.UpdateIssue(ctx, req, opts...)
2273 }
2274
2275 // DeleteIssue deletes an issue.
2276 func (c *Client) DeleteIssue(ctx context.Context, req *contactcenterinsightspb.DeleteIssueRequest, opts ...gax.CallOption) error {
2277 return c.internalClient.DeleteIssue(ctx, req, opts...)
2278 }
2279
2280 // CalculateIssueModelStats gets an issue model’s statistics.
2281 func (c *Client) CalculateIssueModelStats(ctx context.Context, req *contactcenterinsightspb.CalculateIssueModelStatsRequest, opts ...gax.CallOption) (*contactcenterinsightspb.CalculateIssueModelStatsResponse, error) {
2282 return c.internalClient.CalculateIssueModelStats(ctx, req, opts...)
2283 }
2284
2285 // CreatePhraseMatcher creates a phrase matcher.
2286 func (c *Client) CreatePhraseMatcher(ctx context.Context, req *contactcenterinsightspb.CreatePhraseMatcherRequest, opts ...gax.CallOption) (*contactcenterinsightspb.PhraseMatcher, error) {
2287 return c.internalClient.CreatePhraseMatcher(ctx, req, opts...)
2288 }
2289
2290 // GetPhraseMatcher gets a phrase matcher.
2291 func (c *Client) GetPhraseMatcher(ctx context.Context, req *contactcenterinsightspb.GetPhraseMatcherRequest, opts ...gax.CallOption) (*contactcenterinsightspb.PhraseMatcher, error) {
2292 return c.internalClient.GetPhraseMatcher(ctx, req, opts...)
2293 }
2294
2295 // ListPhraseMatchers lists phrase matchers.
2296 func (c *Client) ListPhraseMatchers(ctx context.Context, req *contactcenterinsightspb.ListPhraseMatchersRequest, opts ...gax.CallOption) *PhraseMatcherIterator {
2297 return c.internalClient.ListPhraseMatchers(ctx, req, opts...)
2298 }
2299
2300 // DeletePhraseMatcher deletes a phrase matcher.
2301 func (c *Client) DeletePhraseMatcher(ctx context.Context, req *contactcenterinsightspb.DeletePhraseMatcherRequest, opts ...gax.CallOption) error {
2302 return c.internalClient.DeletePhraseMatcher(ctx, req, opts...)
2303 }
2304
2305 // UpdatePhraseMatcher updates a phrase matcher.
2306 func (c *Client) UpdatePhraseMatcher(ctx context.Context, req *contactcenterinsightspb.UpdatePhraseMatcherRequest, opts ...gax.CallOption) (*contactcenterinsightspb.PhraseMatcher, error) {
2307 return c.internalClient.UpdatePhraseMatcher(ctx, req, opts...)
2308 }
2309
2310 // CalculateStats gets conversation statistics.
2311 func (c *Client) CalculateStats(ctx context.Context, req *contactcenterinsightspb.CalculateStatsRequest, opts ...gax.CallOption) (*contactcenterinsightspb.CalculateStatsResponse, error) {
2312 return c.internalClient.CalculateStats(ctx, req, opts...)
2313 }
2314
2315 // GetSettings gets project-level settings.
2316 func (c *Client) GetSettings(ctx context.Context, req *contactcenterinsightspb.GetSettingsRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Settings, error) {
2317 return c.internalClient.GetSettings(ctx, req, opts...)
2318 }
2319
2320 // UpdateSettings updates project-level settings.
2321 func (c *Client) UpdateSettings(ctx context.Context, req *contactcenterinsightspb.UpdateSettingsRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Settings, error) {
2322 return c.internalClient.UpdateSettings(ctx, req, opts...)
2323 }
2324
2325 // CreateAnalysisRule creates a analysis rule.
2326 func (c *Client) CreateAnalysisRule(ctx context.Context, req *contactcenterinsightspb.CreateAnalysisRuleRequest, opts ...gax.CallOption) (*contactcenterinsightspb.AnalysisRule, error) {
2327 return c.internalClient.CreateAnalysisRule(ctx, req, opts...)
2328 }
2329
2330 // GetAnalysisRule get a analysis rule.
2331 func (c *Client) GetAnalysisRule(ctx context.Context, req *contactcenterinsightspb.GetAnalysisRuleRequest, opts ...gax.CallOption) (*contactcenterinsightspb.AnalysisRule, error) {
2332 return c.internalClient.GetAnalysisRule(ctx, req, opts...)
2333 }
2334
2335 // ListAnalysisRules lists analysis rules.
2336 func (c *Client) ListAnalysisRules(ctx context.Context, req *contactcenterinsightspb.ListAnalysisRulesRequest, opts ...gax.CallOption) *AnalysisRuleIterator {
2337 return c.internalClient.ListAnalysisRules(ctx, req, opts...)
2338 }
2339
2340 // UpdateAnalysisRule updates a analysis rule.
2341 func (c *Client) UpdateAnalysisRule(ctx context.Context, req *contactcenterinsightspb.UpdateAnalysisRuleRequest, opts ...gax.CallOption) (*contactcenterinsightspb.AnalysisRule, error) {
2342 return c.internalClient.UpdateAnalysisRule(ctx, req, opts...)
2343 }
2344
2345 // DeleteAnalysisRule deletes a analysis rule.
2346 func (c *Client) DeleteAnalysisRule(ctx context.Context, req *contactcenterinsightspb.DeleteAnalysisRuleRequest, opts ...gax.CallOption) error {
2347 return c.internalClient.DeleteAnalysisRule(ctx, req, opts...)
2348 }
2349
2350 // GetEncryptionSpec gets location-level encryption key specification.
2351 func (c *Client) GetEncryptionSpec(ctx context.Context, req *contactcenterinsightspb.GetEncryptionSpecRequest, opts ...gax.CallOption) (*contactcenterinsightspb.EncryptionSpec, error) {
2352 return c.internalClient.GetEncryptionSpec(ctx, req, opts...)
2353 }
2354
2355 // InitializeEncryptionSpec initializes a location-level encryption key specification. An error will
2356 // result if the location has resources already created before the
2357 // initialization. After the encryption specification is initialized at a
2358 // location, it is immutable and all newly created resources under the
2359 // location will be encrypted with the existing specification.
2360 func (c *Client) InitializeEncryptionSpec(ctx context.Context, req *contactcenterinsightspb.InitializeEncryptionSpecRequest, opts ...gax.CallOption) (*InitializeEncryptionSpecOperation, error) {
2361 return c.internalClient.InitializeEncryptionSpec(ctx, req, opts...)
2362 }
2363
2364 // InitializeEncryptionSpecOperation returns a new InitializeEncryptionSpecOperation from a given name.
2365 // The name must be that of a previously created InitializeEncryptionSpecOperation, possibly from a different process.
2366 func (c *Client) InitializeEncryptionSpecOperation(name string) *InitializeEncryptionSpecOperation {
2367 return c.internalClient.InitializeEncryptionSpecOperation(name)
2368 }
2369
2370 // CreateView creates a view.
2371 func (c *Client) CreateView(ctx context.Context, req *contactcenterinsightspb.CreateViewRequest, opts ...gax.CallOption) (*contactcenterinsightspb.View, error) {
2372 return c.internalClient.CreateView(ctx, req, opts...)
2373 }
2374
2375 // GetView gets a view.
2376 func (c *Client) GetView(ctx context.Context, req *contactcenterinsightspb.GetViewRequest, opts ...gax.CallOption) (*contactcenterinsightspb.View, error) {
2377 return c.internalClient.GetView(ctx, req, opts...)
2378 }
2379
2380 // ListViews lists views.
2381 func (c *Client) ListViews(ctx context.Context, req *contactcenterinsightspb.ListViewsRequest, opts ...gax.CallOption) *ViewIterator {
2382 return c.internalClient.ListViews(ctx, req, opts...)
2383 }
2384
2385 // UpdateView updates a view.
2386 func (c *Client) UpdateView(ctx context.Context, req *contactcenterinsightspb.UpdateViewRequest, opts ...gax.CallOption) (*contactcenterinsightspb.View, error) {
2387 return c.internalClient.UpdateView(ctx, req, opts...)
2388 }
2389
2390 // DeleteView deletes a view.
2391 func (c *Client) DeleteView(ctx context.Context, req *contactcenterinsightspb.DeleteViewRequest, opts ...gax.CallOption) error {
2392 return c.internalClient.DeleteView(ctx, req, opts...)
2393 }
2394
2395 // QueryMetrics query metrics.
2396 func (c *Client) QueryMetrics(ctx context.Context, req *contactcenterinsightspb.QueryMetricsRequest, opts ...gax.CallOption) (*QueryMetricsOperation, error) {
2397 return c.internalClient.QueryMetrics(ctx, req, opts...)
2398 }
2399
2400 // QueryMetricsOperation returns a new QueryMetricsOperation from a given name.
2401 // The name must be that of a previously created QueryMetricsOperation, possibly from a different process.
2402 func (c *Client) QueryMetricsOperation(name string) *QueryMetricsOperation {
2403 return c.internalClient.QueryMetricsOperation(name)
2404 }
2405
2406 // CreateQaQuestion create a QaQuestion.
2407 func (c *Client) CreateQaQuestion(ctx context.Context, req *contactcenterinsightspb.CreateQaQuestionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaQuestion, error) {
2408 return c.internalClient.CreateQaQuestion(ctx, req, opts...)
2409 }
2410
2411 // GetQaQuestion gets a QaQuestion.
2412 func (c *Client) GetQaQuestion(ctx context.Context, req *contactcenterinsightspb.GetQaQuestionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaQuestion, error) {
2413 return c.internalClient.GetQaQuestion(ctx, req, opts...)
2414 }
2415
2416 // UpdateQaQuestion updates a QaQuestion.
2417 func (c *Client) UpdateQaQuestion(ctx context.Context, req *contactcenterinsightspb.UpdateQaQuestionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaQuestion, error) {
2418 return c.internalClient.UpdateQaQuestion(ctx, req, opts...)
2419 }
2420
2421 // DeleteQaQuestion deletes a QaQuestion.
2422 func (c *Client) DeleteQaQuestion(ctx context.Context, req *contactcenterinsightspb.DeleteQaQuestionRequest, opts ...gax.CallOption) error {
2423 return c.internalClient.DeleteQaQuestion(ctx, req, opts...)
2424 }
2425
2426 // ListQaQuestions lists QaQuestions.
2427 func (c *Client) ListQaQuestions(ctx context.Context, req *contactcenterinsightspb.ListQaQuestionsRequest, opts ...gax.CallOption) *QaQuestionIterator {
2428 return c.internalClient.ListQaQuestions(ctx, req, opts...)
2429 }
2430
2431 // CreateQaScorecard create a QaScorecard.
2432 func (c *Client) CreateQaScorecard(ctx context.Context, req *contactcenterinsightspb.CreateQaScorecardRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecard, error) {
2433 return c.internalClient.CreateQaScorecard(ctx, req, opts...)
2434 }
2435
2436 // GetQaScorecard gets a QaScorecard.
2437 func (c *Client) GetQaScorecard(ctx context.Context, req *contactcenterinsightspb.GetQaScorecardRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecard, error) {
2438 return c.internalClient.GetQaScorecard(ctx, req, opts...)
2439 }
2440
2441 // UpdateQaScorecard updates a QaScorecard.
2442 func (c *Client) UpdateQaScorecard(ctx context.Context, req *contactcenterinsightspb.UpdateQaScorecardRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecard, error) {
2443 return c.internalClient.UpdateQaScorecard(ctx, req, opts...)
2444 }
2445
2446 // DeleteQaScorecard deletes a QaScorecard.
2447 func (c *Client) DeleteQaScorecard(ctx context.Context, req *contactcenterinsightspb.DeleteQaScorecardRequest, opts ...gax.CallOption) error {
2448 return c.internalClient.DeleteQaScorecard(ctx, req, opts...)
2449 }
2450
2451 // ListQaScorecards lists QaScorecards.
2452 func (c *Client) ListQaScorecards(ctx context.Context, req *contactcenterinsightspb.ListQaScorecardsRequest, opts ...gax.CallOption) *QaScorecardIterator {
2453 return c.internalClient.ListQaScorecards(ctx, req, opts...)
2454 }
2455
2456 // CreateQaScorecardRevision creates a QaScorecardRevision.
2457 func (c *Client) CreateQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.CreateQaScorecardRevisionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecardRevision, error) {
2458 return c.internalClient.CreateQaScorecardRevision(ctx, req, opts...)
2459 }
2460
2461 // GetQaScorecardRevision gets a QaScorecardRevision.
2462 func (c *Client) GetQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.GetQaScorecardRevisionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecardRevision, error) {
2463 return c.internalClient.GetQaScorecardRevision(ctx, req, opts...)
2464 }
2465
2466 // TuneQaScorecardRevision fine tune one or more QaModels.
2467 func (c *Client) TuneQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.TuneQaScorecardRevisionRequest, opts ...gax.CallOption) (*TuneQaScorecardRevisionOperation, error) {
2468 return c.internalClient.TuneQaScorecardRevision(ctx, req, opts...)
2469 }
2470
2471 // TuneQaScorecardRevisionOperation returns a new TuneQaScorecardRevisionOperation from a given name.
2472 // The name must be that of a previously created TuneQaScorecardRevisionOperation, possibly from a different process.
2473 func (c *Client) TuneQaScorecardRevisionOperation(name string) *TuneQaScorecardRevisionOperation {
2474 return c.internalClient.TuneQaScorecardRevisionOperation(name)
2475 }
2476
2477 // DeployQaScorecardRevision deploy a QaScorecardRevision.
2478 func (c *Client) DeployQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.DeployQaScorecardRevisionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecardRevision, error) {
2479 return c.internalClient.DeployQaScorecardRevision(ctx, req, opts...)
2480 }
2481
2482 // UndeployQaScorecardRevision undeploy a QaScorecardRevision.
2483 func (c *Client) UndeployQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.UndeployQaScorecardRevisionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecardRevision, error) {
2484 return c.internalClient.UndeployQaScorecardRevision(ctx, req, opts...)
2485 }
2486
2487 // DeleteQaScorecardRevision deletes a QaScorecardRevision.
2488 func (c *Client) DeleteQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.DeleteQaScorecardRevisionRequest, opts ...gax.CallOption) error {
2489 return c.internalClient.DeleteQaScorecardRevision(ctx, req, opts...)
2490 }
2491
2492 // ListQaScorecardRevisions lists all revisions under the parent QaScorecard.
2493 func (c *Client) ListQaScorecardRevisions(ctx context.Context, req *contactcenterinsightspb.ListQaScorecardRevisionsRequest, opts ...gax.CallOption) *QaScorecardRevisionIterator {
2494 return c.internalClient.ListQaScorecardRevisions(ctx, req, opts...)
2495 }
2496
2497 // CreateFeedbackLabel create feedback label.
2498 func (c *Client) CreateFeedbackLabel(ctx context.Context, req *contactcenterinsightspb.CreateFeedbackLabelRequest, opts ...gax.CallOption) (*contactcenterinsightspb.FeedbackLabel, error) {
2499 return c.internalClient.CreateFeedbackLabel(ctx, req, opts...)
2500 }
2501
2502 // ListFeedbackLabels list feedback labels.
2503 func (c *Client) ListFeedbackLabels(ctx context.Context, req *contactcenterinsightspb.ListFeedbackLabelsRequest, opts ...gax.CallOption) *FeedbackLabelIterator {
2504 return c.internalClient.ListFeedbackLabels(ctx, req, opts...)
2505 }
2506
2507 // GetFeedbackLabel get feedback label.
2508 func (c *Client) GetFeedbackLabel(ctx context.Context, req *contactcenterinsightspb.GetFeedbackLabelRequest, opts ...gax.CallOption) (*contactcenterinsightspb.FeedbackLabel, error) {
2509 return c.internalClient.GetFeedbackLabel(ctx, req, opts...)
2510 }
2511
2512 // UpdateFeedbackLabel update feedback label.
2513 func (c *Client) UpdateFeedbackLabel(ctx context.Context, req *contactcenterinsightspb.UpdateFeedbackLabelRequest, opts ...gax.CallOption) (*contactcenterinsightspb.FeedbackLabel, error) {
2514 return c.internalClient.UpdateFeedbackLabel(ctx, req, opts...)
2515 }
2516
2517 // DeleteFeedbackLabel delete feedback label.
2518 func (c *Client) DeleteFeedbackLabel(ctx context.Context, req *contactcenterinsightspb.DeleteFeedbackLabelRequest, opts ...gax.CallOption) error {
2519 return c.internalClient.DeleteFeedbackLabel(ctx, req, opts...)
2520 }
2521
2522 // ListAllFeedbackLabels list all feedback labels by project number.
2523 func (c *Client) ListAllFeedbackLabels(ctx context.Context, req *contactcenterinsightspb.ListAllFeedbackLabelsRequest, opts ...gax.CallOption) *FeedbackLabelIterator {
2524 return c.internalClient.ListAllFeedbackLabels(ctx, req, opts...)
2525 }
2526
2527 // BulkUploadFeedbackLabels upload feedback labels in bulk.
2528 func (c *Client) BulkUploadFeedbackLabels(ctx context.Context, req *contactcenterinsightspb.BulkUploadFeedbackLabelsRequest, opts ...gax.CallOption) (*BulkUploadFeedbackLabelsOperation, error) {
2529 return c.internalClient.BulkUploadFeedbackLabels(ctx, req, opts...)
2530 }
2531
2532 // BulkUploadFeedbackLabelsOperation returns a new BulkUploadFeedbackLabelsOperation from a given name.
2533 // The name must be that of a previously created BulkUploadFeedbackLabelsOperation, possibly from a different process.
2534 func (c *Client) BulkUploadFeedbackLabelsOperation(name string) *BulkUploadFeedbackLabelsOperation {
2535 return c.internalClient.BulkUploadFeedbackLabelsOperation(name)
2536 }
2537
2538 // BulkDownloadFeedbackLabels download feedback labels in bulk.
2539 func (c *Client) BulkDownloadFeedbackLabels(ctx context.Context, req *contactcenterinsightspb.BulkDownloadFeedbackLabelsRequest, opts ...gax.CallOption) (*BulkDownloadFeedbackLabelsOperation, error) {
2540 return c.internalClient.BulkDownloadFeedbackLabels(ctx, req, opts...)
2541 }
2542
2543 // BulkDownloadFeedbackLabelsOperation returns a new BulkDownloadFeedbackLabelsOperation from a given name.
2544 // The name must be that of a previously created BulkDownloadFeedbackLabelsOperation, possibly from a different process.
2545 func (c *Client) BulkDownloadFeedbackLabelsOperation(name string) *BulkDownloadFeedbackLabelsOperation {
2546 return c.internalClient.BulkDownloadFeedbackLabelsOperation(name)
2547 }
2548
2549 // CancelOperation is a utility method from google.longrunning.Operations.
2550 func (c *Client) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error {
2551 return c.internalClient.CancelOperation(ctx, req, opts...)
2552 }
2553
2554 // GetOperation is a utility method from google.longrunning.Operations.
2555 func (c *Client) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) {
2556 return c.internalClient.GetOperation(ctx, req, opts...)
2557 }
2558
2559 // ListOperations is a utility method from google.longrunning.Operations.
2560 func (c *Client) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator {
2561 return c.internalClient.ListOperations(ctx, req, opts...)
2562 }
2563
2564 // gRPCClient is a client for interacting with Contact Center AI Insights API over gRPC transport.
2565 //
2566 // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
2567 type gRPCClient struct {
2568 // Connection pool of gRPC connections to the service.
2569 connPool gtransport.ConnPool
2570
2571 // Points back to the CallOptions field of the containing Client
2572 CallOptions **CallOptions
2573
2574 // The gRPC API client.
2575 client contactcenterinsightspb.ContactCenterInsightsClient
2576
2577 // LROClient is used internally to handle long-running operations.
2578 // It is exposed so that its CallOptions can be modified if required.
2579 // Users should not Close this client.
2580 LROClient **lroauto.OperationsClient
2581
2582 operationsClient longrunningpb.OperationsClient
2583
2584 // The x-goog-* metadata to be sent with each request.
2585 xGoogHeaders []string
2586
2587 logger *slog.Logger
2588 }
2589
2590 // NewClient creates a new contact center insights client based on gRPC.
2591 // The returned client must be Closed when it is done being used to clean up its underlying connections.
2592 //
2593 // An API that lets users analyze and explore their business conversation data.
2594 func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) {
2595 clientOpts := defaultGRPCClientOptions()
2596 if newClientHook != nil {
2597 hookOpts, err := newClientHook(ctx, clientHookParams{})
2598 if err != nil {
2599 return nil, err
2600 }
2601 clientOpts = append(clientOpts, hookOpts...)
2602 }
2603
2604 connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...)
2605 if err != nil {
2606 return nil, err
2607 }
2608 client := Client{CallOptions: defaultCallOptions()}
2609
2610 c := &gRPCClient{
2611 connPool: connPool,
2612 client: contactcenterinsightspb.NewContactCenterInsightsClient(connPool),
2613 CallOptions: &client.CallOptions,
2614 logger: internaloption.GetLogger(opts),
2615 operationsClient: longrunningpb.NewOperationsClient(connPool),
2616 }
2617 c.setGoogleClientInfo()
2618
2619 client.internalClient = c
2620
2621 client.LROClient, err = lroauto.NewOperationsClient(ctx, gtransport.WithConnPool(connPool))
2622 if err != nil {
2623 // This error "should not happen", since we are just reusing old connection pool
2624 // and never actually need to dial.
2625 // If this does happen, we could leak connp. However, we cannot close conn:
2626 // If the user invoked the constructor with option.WithGRPCConn,
2627 // we would close a connection that's still in use.
2628 // TODO: investigate error conditions.
2629 return nil, err
2630 }
2631 c.LROClient = &client.LROClient
2632 return &client, nil
2633 }
2634
2635 // Connection returns a connection to the API service.
2636 //
2637 // Deprecated: Connections are now pooled so this method does not always
2638 // return the same resource.
2639 func (c *gRPCClient) Connection() *grpc.ClientConn {
2640 return c.connPool.Conn()
2641 }
2642
2643 // setGoogleClientInfo sets the name and version of the application in
2644 // the `x-goog-api-client` header passed on each request. Intended for
2645 // use by Google-written clients.
2646 func (c *gRPCClient) setGoogleClientInfo(keyval ...string) {
2647 kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
2648 kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version, "pb", protoVersion)
2649 c.xGoogHeaders = []string{
2650 "x-goog-api-client", gax.XGoogHeader(kv...),
2651 }
2652 }
2653
2654 // Close closes the connection to the API service. The user should invoke this when
2655 // the client is no longer required.
2656 func (c *gRPCClient) Close() error {
2657 return c.connPool.Close()
2658 }
2659
2660 // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
2661 type restClient struct {
2662 // The http endpoint to connect to.
2663 endpoint string
2664
2665 // The http client.
2666 httpClient *http.Client
2667
2668 // LROClient is used internally to handle long-running operations.
2669 // It is exposed so that its CallOptions can be modified if required.
2670 // Users should not Close this client.
2671 LROClient **lroauto.OperationsClient
2672
2673 // The x-goog-* headers to be sent with each request.
2674 xGoogHeaders []string
2675
2676 // Points back to the CallOptions field of the containing Client
2677 CallOptions **CallOptions
2678
2679 logger *slog.Logger
2680 }
2681
2682 // NewRESTClient creates a new contact center insights rest client.
2683 //
2684 // An API that lets users analyze and explore their business conversation data.
2685 func NewRESTClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) {
2686 clientOpts := append(defaultRESTClientOptions(), opts...)
2687 httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...)
2688 if err != nil {
2689 return nil, err
2690 }
2691
2692 callOpts := defaultRESTCallOptions()
2693 c := &restClient{
2694 endpoint: endpoint,
2695 httpClient: httpClient,
2696 CallOptions: &callOpts,
2697 logger: internaloption.GetLogger(opts),
2698 }
2699 c.setGoogleClientInfo()
2700
2701 lroOpts := []option.ClientOption{
2702 option.WithHTTPClient(httpClient),
2703 option.WithEndpoint(endpoint),
2704 }
2705 opClient, err := lroauto.NewOperationsRESTClient(ctx, lroOpts...)
2706 if err != nil {
2707 return nil, err
2708 }
2709 c.LROClient = &opClient
2710
2711 return &Client{internalClient: c, CallOptions: callOpts}, nil
2712 }
2713
2714 func defaultRESTClientOptions() []option.ClientOption {
2715 return []option.ClientOption{
2716 internaloption.WithDefaultEndpoint("https://contactcenterinsights.googleapis.com"),
2717 internaloption.WithDefaultEndpointTemplate("https://contactcenterinsights.UNIVERSE_DOMAIN"),
2718 internaloption.WithDefaultMTLSEndpoint("https://contactcenterinsights.mtls.googleapis.com"),
2719 internaloption.WithDefaultUniverseDomain("googleapis.com"),
2720 internaloption.WithDefaultAudience("https://contactcenterinsights.googleapis.com/"),
2721 internaloption.WithDefaultScopes(DefaultAuthScopes()...),
2722 internaloption.EnableNewAuthLibrary(),
2723 }
2724 }
2725
2726 // setGoogleClientInfo sets the name and version of the application in
2727 // the `x-goog-api-client` header passed on each request. Intended for
2728 // use by Google-written clients.
2729 func (c *restClient) setGoogleClientInfo(keyval ...string) {
2730 kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
2731 kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN", "pb", protoVersion)
2732 c.xGoogHeaders = []string{
2733 "x-goog-api-client", gax.XGoogHeader(kv...),
2734 }
2735 }
2736
2737 // Close closes the connection to the API service. The user should invoke this when
2738 // the client is no longer required.
2739 func (c *restClient) Close() error {
2740 // Replace httpClient with nil to force cleanup.
2741 c.httpClient = nil
2742 return nil
2743 }
2744
2745 // Connection returns a connection to the API service.
2746 //
2747 // Deprecated: This method always returns nil.
2748 func (c *restClient) Connection() *grpc.ClientConn {
2749 return nil
2750 }
2751 func (c *gRPCClient) CreateConversation(ctx context.Context, req *contactcenterinsightspb.CreateConversationRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Conversation, error) {
2752 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
2753
2754 hds = append(c.xGoogHeaders, hds...)
2755 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2756 opts = append((*c.CallOptions).CreateConversation[0:len((*c.CallOptions).CreateConversation):len((*c.CallOptions).CreateConversation)], opts...)
2757 var resp *contactcenterinsightspb.Conversation
2758 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2759 var err error
2760 resp, err = executeRPC(ctx, c.client.CreateConversation, req, settings.GRPC, c.logger, "CreateConversation")
2761 return err
2762 }, opts...)
2763 if err != nil {
2764 return nil, err
2765 }
2766 return resp, nil
2767 }
2768
2769 func (c *gRPCClient) UploadConversation(ctx context.Context, req *contactcenterinsightspb.UploadConversationRequest, opts ...gax.CallOption) (*UploadConversationOperation, error) {
2770 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
2771
2772 hds = append(c.xGoogHeaders, hds...)
2773 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2774 opts = append((*c.CallOptions).UploadConversation[0:len((*c.CallOptions).UploadConversation):len((*c.CallOptions).UploadConversation)], opts...)
2775 var resp *longrunningpb.Operation
2776 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2777 var err error
2778 resp, err = executeRPC(ctx, c.client.UploadConversation, req, settings.GRPC, c.logger, "UploadConversation")
2779 return err
2780 }, opts...)
2781 if err != nil {
2782 return nil, err
2783 }
2784 return &UploadConversationOperation{
2785 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
2786 }, nil
2787 }
2788
2789 func (c *gRPCClient) UpdateConversation(ctx context.Context, req *contactcenterinsightspb.UpdateConversationRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Conversation, error) {
2790 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "conversation.name", url.QueryEscape(req.GetConversation().GetName()))}
2791
2792 hds = append(c.xGoogHeaders, hds...)
2793 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2794 opts = append((*c.CallOptions).UpdateConversation[0:len((*c.CallOptions).UpdateConversation):len((*c.CallOptions).UpdateConversation)], opts...)
2795 var resp *contactcenterinsightspb.Conversation
2796 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2797 var err error
2798 resp, err = executeRPC(ctx, c.client.UpdateConversation, req, settings.GRPC, c.logger, "UpdateConversation")
2799 return err
2800 }, opts...)
2801 if err != nil {
2802 return nil, err
2803 }
2804 return resp, nil
2805 }
2806
2807 func (c *gRPCClient) GetConversation(ctx context.Context, req *contactcenterinsightspb.GetConversationRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Conversation, error) {
2808 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2809
2810 hds = append(c.xGoogHeaders, hds...)
2811 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2812 opts = append((*c.CallOptions).GetConversation[0:len((*c.CallOptions).GetConversation):len((*c.CallOptions).GetConversation)], opts...)
2813 var resp *contactcenterinsightspb.Conversation
2814 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2815 var err error
2816 resp, err = executeRPC(ctx, c.client.GetConversation, req, settings.GRPC, c.logger, "GetConversation")
2817 return err
2818 }, opts...)
2819 if err != nil {
2820 return nil, err
2821 }
2822 return resp, nil
2823 }
2824
2825 func (c *gRPCClient) ListConversations(ctx context.Context, req *contactcenterinsightspb.ListConversationsRequest, opts ...gax.CallOption) *ConversationIterator {
2826 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
2827
2828 hds = append(c.xGoogHeaders, hds...)
2829 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2830 opts = append((*c.CallOptions).ListConversations[0:len((*c.CallOptions).ListConversations):len((*c.CallOptions).ListConversations)], opts...)
2831 it := &ConversationIterator{}
2832 req = proto.Clone(req).(*contactcenterinsightspb.ListConversationsRequest)
2833 it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.Conversation, string, error) {
2834 resp := &contactcenterinsightspb.ListConversationsResponse{}
2835 if pageToken != "" {
2836 req.PageToken = pageToken
2837 }
2838 if pageSize > math.MaxInt32 {
2839 req.PageSize = math.MaxInt32
2840 } else if pageSize != 0 {
2841 req.PageSize = int32(pageSize)
2842 }
2843 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2844 var err error
2845 resp, err = executeRPC(ctx, c.client.ListConversations, req, settings.GRPC, c.logger, "ListConversations")
2846 return err
2847 }, opts...)
2848 if err != nil {
2849 return nil, "", err
2850 }
2851
2852 it.Response = resp
2853 return resp.GetConversations(), resp.GetNextPageToken(), nil
2854 }
2855 fetch := func(pageSize int, pageToken string) (string, error) {
2856 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
2857 if err != nil {
2858 return "", err
2859 }
2860 it.items = append(it.items, items...)
2861 return nextPageToken, nil
2862 }
2863
2864 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
2865 it.pageInfo.MaxSize = int(req.GetPageSize())
2866 it.pageInfo.Token = req.GetPageToken()
2867
2868 return it
2869 }
2870
2871 func (c *gRPCClient) DeleteConversation(ctx context.Context, req *contactcenterinsightspb.DeleteConversationRequest, opts ...gax.CallOption) error {
2872 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2873
2874 hds = append(c.xGoogHeaders, hds...)
2875 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2876 opts = append((*c.CallOptions).DeleteConversation[0:len((*c.CallOptions).DeleteConversation):len((*c.CallOptions).DeleteConversation)], opts...)
2877 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2878 var err error
2879 _, err = executeRPC(ctx, c.client.DeleteConversation, req, settings.GRPC, c.logger, "DeleteConversation")
2880 return err
2881 }, opts...)
2882 return err
2883 }
2884
2885 func (c *gRPCClient) CreateAnalysis(ctx context.Context, req *contactcenterinsightspb.CreateAnalysisRequest, opts ...gax.CallOption) (*CreateAnalysisOperation, error) {
2886 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
2887
2888 hds = append(c.xGoogHeaders, hds...)
2889 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2890 opts = append((*c.CallOptions).CreateAnalysis[0:len((*c.CallOptions).CreateAnalysis):len((*c.CallOptions).CreateAnalysis)], opts...)
2891 var resp *longrunningpb.Operation
2892 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2893 var err error
2894 resp, err = executeRPC(ctx, c.client.CreateAnalysis, req, settings.GRPC, c.logger, "CreateAnalysis")
2895 return err
2896 }, opts...)
2897 if err != nil {
2898 return nil, err
2899 }
2900 return &CreateAnalysisOperation{
2901 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
2902 }, nil
2903 }
2904
2905 func (c *gRPCClient) GetAnalysis(ctx context.Context, req *contactcenterinsightspb.GetAnalysisRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Analysis, error) {
2906 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2907
2908 hds = append(c.xGoogHeaders, hds...)
2909 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2910 opts = append((*c.CallOptions).GetAnalysis[0:len((*c.CallOptions).GetAnalysis):len((*c.CallOptions).GetAnalysis)], opts...)
2911 var resp *contactcenterinsightspb.Analysis
2912 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2913 var err error
2914 resp, err = executeRPC(ctx, c.client.GetAnalysis, req, settings.GRPC, c.logger, "GetAnalysis")
2915 return err
2916 }, opts...)
2917 if err != nil {
2918 return nil, err
2919 }
2920 return resp, nil
2921 }
2922
2923 func (c *gRPCClient) ListAnalyses(ctx context.Context, req *contactcenterinsightspb.ListAnalysesRequest, opts ...gax.CallOption) *AnalysisIterator {
2924 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
2925
2926 hds = append(c.xGoogHeaders, hds...)
2927 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2928 opts = append((*c.CallOptions).ListAnalyses[0:len((*c.CallOptions).ListAnalyses):len((*c.CallOptions).ListAnalyses)], opts...)
2929 it := &AnalysisIterator{}
2930 req = proto.Clone(req).(*contactcenterinsightspb.ListAnalysesRequest)
2931 it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.Analysis, string, error) {
2932 resp := &contactcenterinsightspb.ListAnalysesResponse{}
2933 if pageToken != "" {
2934 req.PageToken = pageToken
2935 }
2936 if pageSize > math.MaxInt32 {
2937 req.PageSize = math.MaxInt32
2938 } else if pageSize != 0 {
2939 req.PageSize = int32(pageSize)
2940 }
2941 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2942 var err error
2943 resp, err = executeRPC(ctx, c.client.ListAnalyses, req, settings.GRPC, c.logger, "ListAnalyses")
2944 return err
2945 }, opts...)
2946 if err != nil {
2947 return nil, "", err
2948 }
2949
2950 it.Response = resp
2951 return resp.GetAnalyses(), resp.GetNextPageToken(), nil
2952 }
2953 fetch := func(pageSize int, pageToken string) (string, error) {
2954 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
2955 if err != nil {
2956 return "", err
2957 }
2958 it.items = append(it.items, items...)
2959 return nextPageToken, nil
2960 }
2961
2962 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
2963 it.pageInfo.MaxSize = int(req.GetPageSize())
2964 it.pageInfo.Token = req.GetPageToken()
2965
2966 return it
2967 }
2968
2969 func (c *gRPCClient) DeleteAnalysis(ctx context.Context, req *contactcenterinsightspb.DeleteAnalysisRequest, opts ...gax.CallOption) error {
2970 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2971
2972 hds = append(c.xGoogHeaders, hds...)
2973 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2974 opts = append((*c.CallOptions).DeleteAnalysis[0:len((*c.CallOptions).DeleteAnalysis):len((*c.CallOptions).DeleteAnalysis)], opts...)
2975 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2976 var err error
2977 _, err = executeRPC(ctx, c.client.DeleteAnalysis, req, settings.GRPC, c.logger, "DeleteAnalysis")
2978 return err
2979 }, opts...)
2980 return err
2981 }
2982
2983 func (c *gRPCClient) BulkAnalyzeConversations(ctx context.Context, req *contactcenterinsightspb.BulkAnalyzeConversationsRequest, opts ...gax.CallOption) (*BulkAnalyzeConversationsOperation, error) {
2984 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
2985
2986 hds = append(c.xGoogHeaders, hds...)
2987 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2988 opts = append((*c.CallOptions).BulkAnalyzeConversations[0:len((*c.CallOptions).BulkAnalyzeConversations):len((*c.CallOptions).BulkAnalyzeConversations)], opts...)
2989 var resp *longrunningpb.Operation
2990 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2991 var err error
2992 resp, err = executeRPC(ctx, c.client.BulkAnalyzeConversations, req, settings.GRPC, c.logger, "BulkAnalyzeConversations")
2993 return err
2994 }, opts...)
2995 if err != nil {
2996 return nil, err
2997 }
2998 return &BulkAnalyzeConversationsOperation{
2999 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
3000 }, nil
3001 }
3002
3003 func (c *gRPCClient) BulkDeleteConversations(ctx context.Context, req *contactcenterinsightspb.BulkDeleteConversationsRequest, opts ...gax.CallOption) (*BulkDeleteConversationsOperation, error) {
3004 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
3005
3006 hds = append(c.xGoogHeaders, hds...)
3007 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3008 opts = append((*c.CallOptions).BulkDeleteConversations[0:len((*c.CallOptions).BulkDeleteConversations):len((*c.CallOptions).BulkDeleteConversations)], opts...)
3009 var resp *longrunningpb.Operation
3010 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3011 var err error
3012 resp, err = executeRPC(ctx, c.client.BulkDeleteConversations, req, settings.GRPC, c.logger, "BulkDeleteConversations")
3013 return err
3014 }, opts...)
3015 if err != nil {
3016 return nil, err
3017 }
3018 return &BulkDeleteConversationsOperation{
3019 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
3020 }, nil
3021 }
3022
3023 func (c *gRPCClient) IngestConversations(ctx context.Context, req *contactcenterinsightspb.IngestConversationsRequest, opts ...gax.CallOption) (*IngestConversationsOperation, error) {
3024 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
3025
3026 hds = append(c.xGoogHeaders, hds...)
3027 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3028 opts = append((*c.CallOptions).IngestConversations[0:len((*c.CallOptions).IngestConversations):len((*c.CallOptions).IngestConversations)], opts...)
3029 var resp *longrunningpb.Operation
3030 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3031 var err error
3032 resp, err = executeRPC(ctx, c.client.IngestConversations, req, settings.GRPC, c.logger, "IngestConversations")
3033 return err
3034 }, opts...)
3035 if err != nil {
3036 return nil, err
3037 }
3038 return &IngestConversationsOperation{
3039 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
3040 }, nil
3041 }
3042
3043 func (c *gRPCClient) ExportInsightsData(ctx context.Context, req *contactcenterinsightspb.ExportInsightsDataRequest, opts ...gax.CallOption) (*ExportInsightsDataOperation, error) {
3044 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
3045
3046 hds = append(c.xGoogHeaders, hds...)
3047 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3048 opts = append((*c.CallOptions).ExportInsightsData[0:len((*c.CallOptions).ExportInsightsData):len((*c.CallOptions).ExportInsightsData)], opts...)
3049 var resp *longrunningpb.Operation
3050 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3051 var err error
3052 resp, err = executeRPC(ctx, c.client.ExportInsightsData, req, settings.GRPC, c.logger, "ExportInsightsData")
3053 return err
3054 }, opts...)
3055 if err != nil {
3056 return nil, err
3057 }
3058 return &ExportInsightsDataOperation{
3059 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
3060 }, nil
3061 }
3062
3063 func (c *gRPCClient) CreateIssueModel(ctx context.Context, req *contactcenterinsightspb.CreateIssueModelRequest, opts ...gax.CallOption) (*CreateIssueModelOperation, error) {
3064 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
3065
3066 hds = append(c.xGoogHeaders, hds...)
3067 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3068 opts = append((*c.CallOptions).CreateIssueModel[0:len((*c.CallOptions).CreateIssueModel):len((*c.CallOptions).CreateIssueModel)], opts...)
3069 var resp *longrunningpb.Operation
3070 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3071 var err error
3072 resp, err = executeRPC(ctx, c.client.CreateIssueModel, req, settings.GRPC, c.logger, "CreateIssueModel")
3073 return err
3074 }, opts...)
3075 if err != nil {
3076 return nil, err
3077 }
3078 return &CreateIssueModelOperation{
3079 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
3080 }, nil
3081 }
3082
3083 func (c *gRPCClient) UpdateIssueModel(ctx context.Context, req *contactcenterinsightspb.UpdateIssueModelRequest, opts ...gax.CallOption) (*contactcenterinsightspb.IssueModel, error) {
3084 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "issue_model.name", url.QueryEscape(req.GetIssueModel().GetName()))}
3085
3086 hds = append(c.xGoogHeaders, hds...)
3087 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3088 opts = append((*c.CallOptions).UpdateIssueModel[0:len((*c.CallOptions).UpdateIssueModel):len((*c.CallOptions).UpdateIssueModel)], opts...)
3089 var resp *contactcenterinsightspb.IssueModel
3090 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3091 var err error
3092 resp, err = executeRPC(ctx, c.client.UpdateIssueModel, req, settings.GRPC, c.logger, "UpdateIssueModel")
3093 return err
3094 }, opts...)
3095 if err != nil {
3096 return nil, err
3097 }
3098 return resp, nil
3099 }
3100
3101 func (c *gRPCClient) GetIssueModel(ctx context.Context, req *contactcenterinsightspb.GetIssueModelRequest, opts ...gax.CallOption) (*contactcenterinsightspb.IssueModel, error) {
3102 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3103
3104 hds = append(c.xGoogHeaders, hds...)
3105 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3106 opts = append((*c.CallOptions).GetIssueModel[0:len((*c.CallOptions).GetIssueModel):len((*c.CallOptions).GetIssueModel)], opts...)
3107 var resp *contactcenterinsightspb.IssueModel
3108 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3109 var err error
3110 resp, err = executeRPC(ctx, c.client.GetIssueModel, req, settings.GRPC, c.logger, "GetIssueModel")
3111 return err
3112 }, opts...)
3113 if err != nil {
3114 return nil, err
3115 }
3116 return resp, nil
3117 }
3118
3119 func (c *gRPCClient) ListIssueModels(ctx context.Context, req *contactcenterinsightspb.ListIssueModelsRequest, opts ...gax.CallOption) (*contactcenterinsightspb.ListIssueModelsResponse, error) {
3120 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
3121
3122 hds = append(c.xGoogHeaders, hds...)
3123 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3124 opts = append((*c.CallOptions).ListIssueModels[0:len((*c.CallOptions).ListIssueModels):len((*c.CallOptions).ListIssueModels)], opts...)
3125 var resp *contactcenterinsightspb.ListIssueModelsResponse
3126 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3127 var err error
3128 resp, err = executeRPC(ctx, c.client.ListIssueModels, req, settings.GRPC, c.logger, "ListIssueModels")
3129 return err
3130 }, opts...)
3131 if err != nil {
3132 return nil, err
3133 }
3134 return resp, nil
3135 }
3136
3137 func (c *gRPCClient) DeleteIssueModel(ctx context.Context, req *contactcenterinsightspb.DeleteIssueModelRequest, opts ...gax.CallOption) (*DeleteIssueModelOperation, error) {
3138 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3139
3140 hds = append(c.xGoogHeaders, hds...)
3141 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3142 opts = append((*c.CallOptions).DeleteIssueModel[0:len((*c.CallOptions).DeleteIssueModel):len((*c.CallOptions).DeleteIssueModel)], opts...)
3143 var resp *longrunningpb.Operation
3144 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3145 var err error
3146 resp, err = executeRPC(ctx, c.client.DeleteIssueModel, req, settings.GRPC, c.logger, "DeleteIssueModel")
3147 return err
3148 }, opts...)
3149 if err != nil {
3150 return nil, err
3151 }
3152 return &DeleteIssueModelOperation{
3153 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
3154 }, nil
3155 }
3156
3157 func (c *gRPCClient) DeployIssueModel(ctx context.Context, req *contactcenterinsightspb.DeployIssueModelRequest, opts ...gax.CallOption) (*DeployIssueModelOperation, error) {
3158 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3159
3160 hds = append(c.xGoogHeaders, hds...)
3161 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3162 opts = append((*c.CallOptions).DeployIssueModel[0:len((*c.CallOptions).DeployIssueModel):len((*c.CallOptions).DeployIssueModel)], opts...)
3163 var resp *longrunningpb.Operation
3164 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3165 var err error
3166 resp, err = executeRPC(ctx, c.client.DeployIssueModel, req, settings.GRPC, c.logger, "DeployIssueModel")
3167 return err
3168 }, opts...)
3169 if err != nil {
3170 return nil, err
3171 }
3172 return &DeployIssueModelOperation{
3173 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
3174 }, nil
3175 }
3176
3177 func (c *gRPCClient) UndeployIssueModel(ctx context.Context, req *contactcenterinsightspb.UndeployIssueModelRequest, opts ...gax.CallOption) (*UndeployIssueModelOperation, error) {
3178 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3179
3180 hds = append(c.xGoogHeaders, hds...)
3181 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3182 opts = append((*c.CallOptions).UndeployIssueModel[0:len((*c.CallOptions).UndeployIssueModel):len((*c.CallOptions).UndeployIssueModel)], opts...)
3183 var resp *longrunningpb.Operation
3184 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3185 var err error
3186 resp, err = executeRPC(ctx, c.client.UndeployIssueModel, req, settings.GRPC, c.logger, "UndeployIssueModel")
3187 return err
3188 }, opts...)
3189 if err != nil {
3190 return nil, err
3191 }
3192 return &UndeployIssueModelOperation{
3193 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
3194 }, nil
3195 }
3196
3197 func (c *gRPCClient) ExportIssueModel(ctx context.Context, req *contactcenterinsightspb.ExportIssueModelRequest, opts ...gax.CallOption) (*ExportIssueModelOperation, error) {
3198 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3199
3200 hds = append(c.xGoogHeaders, hds...)
3201 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3202 opts = append((*c.CallOptions).ExportIssueModel[0:len((*c.CallOptions).ExportIssueModel):len((*c.CallOptions).ExportIssueModel)], opts...)
3203 var resp *longrunningpb.Operation
3204 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3205 var err error
3206 resp, err = executeRPC(ctx, c.client.ExportIssueModel, req, settings.GRPC, c.logger, "ExportIssueModel")
3207 return err
3208 }, opts...)
3209 if err != nil {
3210 return nil, err
3211 }
3212 return &ExportIssueModelOperation{
3213 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
3214 }, nil
3215 }
3216
3217 func (c *gRPCClient) ImportIssueModel(ctx context.Context, req *contactcenterinsightspb.ImportIssueModelRequest, opts ...gax.CallOption) (*ImportIssueModelOperation, error) {
3218 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
3219
3220 hds = append(c.xGoogHeaders, hds...)
3221 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3222 opts = append((*c.CallOptions).ImportIssueModel[0:len((*c.CallOptions).ImportIssueModel):len((*c.CallOptions).ImportIssueModel)], opts...)
3223 var resp *longrunningpb.Operation
3224 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3225 var err error
3226 resp, err = executeRPC(ctx, c.client.ImportIssueModel, req, settings.GRPC, c.logger, "ImportIssueModel")
3227 return err
3228 }, opts...)
3229 if err != nil {
3230 return nil, err
3231 }
3232 return &ImportIssueModelOperation{
3233 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
3234 }, nil
3235 }
3236
3237 func (c *gRPCClient) GetIssue(ctx context.Context, req *contactcenterinsightspb.GetIssueRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Issue, error) {
3238 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3239
3240 hds = append(c.xGoogHeaders, hds...)
3241 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3242 opts = append((*c.CallOptions).GetIssue[0:len((*c.CallOptions).GetIssue):len((*c.CallOptions).GetIssue)], opts...)
3243 var resp *contactcenterinsightspb.Issue
3244 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3245 var err error
3246 resp, err = executeRPC(ctx, c.client.GetIssue, req, settings.GRPC, c.logger, "GetIssue")
3247 return err
3248 }, opts...)
3249 if err != nil {
3250 return nil, err
3251 }
3252 return resp, nil
3253 }
3254
3255 func (c *gRPCClient) ListIssues(ctx context.Context, req *contactcenterinsightspb.ListIssuesRequest, opts ...gax.CallOption) (*contactcenterinsightspb.ListIssuesResponse, error) {
3256 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
3257
3258 hds = append(c.xGoogHeaders, hds...)
3259 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3260 opts = append((*c.CallOptions).ListIssues[0:len((*c.CallOptions).ListIssues):len((*c.CallOptions).ListIssues)], opts...)
3261 var resp *contactcenterinsightspb.ListIssuesResponse
3262 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3263 var err error
3264 resp, err = executeRPC(ctx, c.client.ListIssues, req, settings.GRPC, c.logger, "ListIssues")
3265 return err
3266 }, opts...)
3267 if err != nil {
3268 return nil, err
3269 }
3270 return resp, nil
3271 }
3272
3273 func (c *gRPCClient) UpdateIssue(ctx context.Context, req *contactcenterinsightspb.UpdateIssueRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Issue, error) {
3274 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "issue.name", url.QueryEscape(req.GetIssue().GetName()))}
3275
3276 hds = append(c.xGoogHeaders, hds...)
3277 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3278 opts = append((*c.CallOptions).UpdateIssue[0:len((*c.CallOptions).UpdateIssue):len((*c.CallOptions).UpdateIssue)], opts...)
3279 var resp *contactcenterinsightspb.Issue
3280 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3281 var err error
3282 resp, err = executeRPC(ctx, c.client.UpdateIssue, req, settings.GRPC, c.logger, "UpdateIssue")
3283 return err
3284 }, opts...)
3285 if err != nil {
3286 return nil, err
3287 }
3288 return resp, nil
3289 }
3290
3291 func (c *gRPCClient) DeleteIssue(ctx context.Context, req *contactcenterinsightspb.DeleteIssueRequest, opts ...gax.CallOption) error {
3292 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3293
3294 hds = append(c.xGoogHeaders, hds...)
3295 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3296 opts = append((*c.CallOptions).DeleteIssue[0:len((*c.CallOptions).DeleteIssue):len((*c.CallOptions).DeleteIssue)], opts...)
3297 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3298 var err error
3299 _, err = executeRPC(ctx, c.client.DeleteIssue, req, settings.GRPC, c.logger, "DeleteIssue")
3300 return err
3301 }, opts...)
3302 return err
3303 }
3304
3305 func (c *gRPCClient) CalculateIssueModelStats(ctx context.Context, req *contactcenterinsightspb.CalculateIssueModelStatsRequest, opts ...gax.CallOption) (*contactcenterinsightspb.CalculateIssueModelStatsResponse, error) {
3306 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "issue_model", url.QueryEscape(req.GetIssueModel()))}
3307
3308 hds = append(c.xGoogHeaders, hds...)
3309 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3310 opts = append((*c.CallOptions).CalculateIssueModelStats[0:len((*c.CallOptions).CalculateIssueModelStats):len((*c.CallOptions).CalculateIssueModelStats)], opts...)
3311 var resp *contactcenterinsightspb.CalculateIssueModelStatsResponse
3312 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3313 var err error
3314 resp, err = executeRPC(ctx, c.client.CalculateIssueModelStats, req, settings.GRPC, c.logger, "CalculateIssueModelStats")
3315 return err
3316 }, opts...)
3317 if err != nil {
3318 return nil, err
3319 }
3320 return resp, nil
3321 }
3322
3323 func (c *gRPCClient) CreatePhraseMatcher(ctx context.Context, req *contactcenterinsightspb.CreatePhraseMatcherRequest, opts ...gax.CallOption) (*contactcenterinsightspb.PhraseMatcher, error) {
3324 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
3325
3326 hds = append(c.xGoogHeaders, hds...)
3327 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3328 opts = append((*c.CallOptions).CreatePhraseMatcher[0:len((*c.CallOptions).CreatePhraseMatcher):len((*c.CallOptions).CreatePhraseMatcher)], opts...)
3329 var resp *contactcenterinsightspb.PhraseMatcher
3330 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3331 var err error
3332 resp, err = executeRPC(ctx, c.client.CreatePhraseMatcher, req, settings.GRPC, c.logger, "CreatePhraseMatcher")
3333 return err
3334 }, opts...)
3335 if err != nil {
3336 return nil, err
3337 }
3338 return resp, nil
3339 }
3340
3341 func (c *gRPCClient) GetPhraseMatcher(ctx context.Context, req *contactcenterinsightspb.GetPhraseMatcherRequest, opts ...gax.CallOption) (*contactcenterinsightspb.PhraseMatcher, error) {
3342 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3343
3344 hds = append(c.xGoogHeaders, hds...)
3345 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3346 opts = append((*c.CallOptions).GetPhraseMatcher[0:len((*c.CallOptions).GetPhraseMatcher):len((*c.CallOptions).GetPhraseMatcher)], opts...)
3347 var resp *contactcenterinsightspb.PhraseMatcher
3348 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3349 var err error
3350 resp, err = executeRPC(ctx, c.client.GetPhraseMatcher, req, settings.GRPC, c.logger, "GetPhraseMatcher")
3351 return err
3352 }, opts...)
3353 if err != nil {
3354 return nil, err
3355 }
3356 return resp, nil
3357 }
3358
3359 func (c *gRPCClient) ListPhraseMatchers(ctx context.Context, req *contactcenterinsightspb.ListPhraseMatchersRequest, opts ...gax.CallOption) *PhraseMatcherIterator {
3360 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
3361
3362 hds = append(c.xGoogHeaders, hds...)
3363 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3364 opts = append((*c.CallOptions).ListPhraseMatchers[0:len((*c.CallOptions).ListPhraseMatchers):len((*c.CallOptions).ListPhraseMatchers)], opts...)
3365 it := &PhraseMatcherIterator{}
3366 req = proto.Clone(req).(*contactcenterinsightspb.ListPhraseMatchersRequest)
3367 it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.PhraseMatcher, string, error) {
3368 resp := &contactcenterinsightspb.ListPhraseMatchersResponse{}
3369 if pageToken != "" {
3370 req.PageToken = pageToken
3371 }
3372 if pageSize > math.MaxInt32 {
3373 req.PageSize = math.MaxInt32
3374 } else if pageSize != 0 {
3375 req.PageSize = int32(pageSize)
3376 }
3377 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3378 var err error
3379 resp, err = executeRPC(ctx, c.client.ListPhraseMatchers, req, settings.GRPC, c.logger, "ListPhraseMatchers")
3380 return err
3381 }, opts...)
3382 if err != nil {
3383 return nil, "", err
3384 }
3385
3386 it.Response = resp
3387 return resp.GetPhraseMatchers(), resp.GetNextPageToken(), nil
3388 }
3389 fetch := func(pageSize int, pageToken string) (string, error) {
3390 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
3391 if err != nil {
3392 return "", err
3393 }
3394 it.items = append(it.items, items...)
3395 return nextPageToken, nil
3396 }
3397
3398 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
3399 it.pageInfo.MaxSize = int(req.GetPageSize())
3400 it.pageInfo.Token = req.GetPageToken()
3401
3402 return it
3403 }
3404
3405 func (c *gRPCClient) DeletePhraseMatcher(ctx context.Context, req *contactcenterinsightspb.DeletePhraseMatcherRequest, opts ...gax.CallOption) error {
3406 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3407
3408 hds = append(c.xGoogHeaders, hds...)
3409 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3410 opts = append((*c.CallOptions).DeletePhraseMatcher[0:len((*c.CallOptions).DeletePhraseMatcher):len((*c.CallOptions).DeletePhraseMatcher)], opts...)
3411 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3412 var err error
3413 _, err = executeRPC(ctx, c.client.DeletePhraseMatcher, req, settings.GRPC, c.logger, "DeletePhraseMatcher")
3414 return err
3415 }, opts...)
3416 return err
3417 }
3418
3419 func (c *gRPCClient) UpdatePhraseMatcher(ctx context.Context, req *contactcenterinsightspb.UpdatePhraseMatcherRequest, opts ...gax.CallOption) (*contactcenterinsightspb.PhraseMatcher, error) {
3420 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "phrase_matcher.name", url.QueryEscape(req.GetPhraseMatcher().GetName()))}
3421
3422 hds = append(c.xGoogHeaders, hds...)
3423 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3424 opts = append((*c.CallOptions).UpdatePhraseMatcher[0:len((*c.CallOptions).UpdatePhraseMatcher):len((*c.CallOptions).UpdatePhraseMatcher)], opts...)
3425 var resp *contactcenterinsightspb.PhraseMatcher
3426 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3427 var err error
3428 resp, err = executeRPC(ctx, c.client.UpdatePhraseMatcher, req, settings.GRPC, c.logger, "UpdatePhraseMatcher")
3429 return err
3430 }, opts...)
3431 if err != nil {
3432 return nil, err
3433 }
3434 return resp, nil
3435 }
3436
3437 func (c *gRPCClient) CalculateStats(ctx context.Context, req *contactcenterinsightspb.CalculateStatsRequest, opts ...gax.CallOption) (*contactcenterinsightspb.CalculateStatsResponse, error) {
3438 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "location", url.QueryEscape(req.GetLocation()))}
3439
3440 hds = append(c.xGoogHeaders, hds...)
3441 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3442 opts = append((*c.CallOptions).CalculateStats[0:len((*c.CallOptions).CalculateStats):len((*c.CallOptions).CalculateStats)], opts...)
3443 var resp *contactcenterinsightspb.CalculateStatsResponse
3444 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3445 var err error
3446 resp, err = executeRPC(ctx, c.client.CalculateStats, req, settings.GRPC, c.logger, "CalculateStats")
3447 return err
3448 }, opts...)
3449 if err != nil {
3450 return nil, err
3451 }
3452 return resp, nil
3453 }
3454
3455 func (c *gRPCClient) GetSettings(ctx context.Context, req *contactcenterinsightspb.GetSettingsRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Settings, error) {
3456 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3457
3458 hds = append(c.xGoogHeaders, hds...)
3459 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3460 opts = append((*c.CallOptions).GetSettings[0:len((*c.CallOptions).GetSettings):len((*c.CallOptions).GetSettings)], opts...)
3461 var resp *contactcenterinsightspb.Settings
3462 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3463 var err error
3464 resp, err = executeRPC(ctx, c.client.GetSettings, req, settings.GRPC, c.logger, "GetSettings")
3465 return err
3466 }, opts...)
3467 if err != nil {
3468 return nil, err
3469 }
3470 return resp, nil
3471 }
3472
3473 func (c *gRPCClient) UpdateSettings(ctx context.Context, req *contactcenterinsightspb.UpdateSettingsRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Settings, error) {
3474 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "settings.name", url.QueryEscape(req.GetSettings().GetName()))}
3475
3476 hds = append(c.xGoogHeaders, hds...)
3477 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3478 opts = append((*c.CallOptions).UpdateSettings[0:len((*c.CallOptions).UpdateSettings):len((*c.CallOptions).UpdateSettings)], opts...)
3479 var resp *contactcenterinsightspb.Settings
3480 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3481 var err error
3482 resp, err = executeRPC(ctx, c.client.UpdateSettings, req, settings.GRPC, c.logger, "UpdateSettings")
3483 return err
3484 }, opts...)
3485 if err != nil {
3486 return nil, err
3487 }
3488 return resp, nil
3489 }
3490
3491 func (c *gRPCClient) CreateAnalysisRule(ctx context.Context, req *contactcenterinsightspb.CreateAnalysisRuleRequest, opts ...gax.CallOption) (*contactcenterinsightspb.AnalysisRule, error) {
3492 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
3493
3494 hds = append(c.xGoogHeaders, hds...)
3495 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3496 opts = append((*c.CallOptions).CreateAnalysisRule[0:len((*c.CallOptions).CreateAnalysisRule):len((*c.CallOptions).CreateAnalysisRule)], opts...)
3497 var resp *contactcenterinsightspb.AnalysisRule
3498 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3499 var err error
3500 resp, err = executeRPC(ctx, c.client.CreateAnalysisRule, req, settings.GRPC, c.logger, "CreateAnalysisRule")
3501 return err
3502 }, opts...)
3503 if err != nil {
3504 return nil, err
3505 }
3506 return resp, nil
3507 }
3508
3509 func (c *gRPCClient) GetAnalysisRule(ctx context.Context, req *contactcenterinsightspb.GetAnalysisRuleRequest, opts ...gax.CallOption) (*contactcenterinsightspb.AnalysisRule, error) {
3510 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3511
3512 hds = append(c.xGoogHeaders, hds...)
3513 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3514 opts = append((*c.CallOptions).GetAnalysisRule[0:len((*c.CallOptions).GetAnalysisRule):len((*c.CallOptions).GetAnalysisRule)], opts...)
3515 var resp *contactcenterinsightspb.AnalysisRule
3516 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3517 var err error
3518 resp, err = executeRPC(ctx, c.client.GetAnalysisRule, req, settings.GRPC, c.logger, "GetAnalysisRule")
3519 return err
3520 }, opts...)
3521 if err != nil {
3522 return nil, err
3523 }
3524 return resp, nil
3525 }
3526
3527 func (c *gRPCClient) ListAnalysisRules(ctx context.Context, req *contactcenterinsightspb.ListAnalysisRulesRequest, opts ...gax.CallOption) *AnalysisRuleIterator {
3528 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
3529
3530 hds = append(c.xGoogHeaders, hds...)
3531 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3532 opts = append((*c.CallOptions).ListAnalysisRules[0:len((*c.CallOptions).ListAnalysisRules):len((*c.CallOptions).ListAnalysisRules)], opts...)
3533 it := &AnalysisRuleIterator{}
3534 req = proto.Clone(req).(*contactcenterinsightspb.ListAnalysisRulesRequest)
3535 it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.AnalysisRule, string, error) {
3536 resp := &contactcenterinsightspb.ListAnalysisRulesResponse{}
3537 if pageToken != "" {
3538 req.PageToken = pageToken
3539 }
3540 if pageSize > math.MaxInt32 {
3541 req.PageSize = math.MaxInt32
3542 } else if pageSize != 0 {
3543 req.PageSize = int32(pageSize)
3544 }
3545 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3546 var err error
3547 resp, err = executeRPC(ctx, c.client.ListAnalysisRules, req, settings.GRPC, c.logger, "ListAnalysisRules")
3548 return err
3549 }, opts...)
3550 if err != nil {
3551 return nil, "", err
3552 }
3553
3554 it.Response = resp
3555 return resp.GetAnalysisRules(), resp.GetNextPageToken(), nil
3556 }
3557 fetch := func(pageSize int, pageToken string) (string, error) {
3558 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
3559 if err != nil {
3560 return "", err
3561 }
3562 it.items = append(it.items, items...)
3563 return nextPageToken, nil
3564 }
3565
3566 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
3567 it.pageInfo.MaxSize = int(req.GetPageSize())
3568 it.pageInfo.Token = req.GetPageToken()
3569
3570 return it
3571 }
3572
3573 func (c *gRPCClient) UpdateAnalysisRule(ctx context.Context, req *contactcenterinsightspb.UpdateAnalysisRuleRequest, opts ...gax.CallOption) (*contactcenterinsightspb.AnalysisRule, error) {
3574 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "analysis_rule.name", url.QueryEscape(req.GetAnalysisRule().GetName()))}
3575
3576 hds = append(c.xGoogHeaders, hds...)
3577 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3578 opts = append((*c.CallOptions).UpdateAnalysisRule[0:len((*c.CallOptions).UpdateAnalysisRule):len((*c.CallOptions).UpdateAnalysisRule)], opts...)
3579 var resp *contactcenterinsightspb.AnalysisRule
3580 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3581 var err error
3582 resp, err = executeRPC(ctx, c.client.UpdateAnalysisRule, req, settings.GRPC, c.logger, "UpdateAnalysisRule")
3583 return err
3584 }, opts...)
3585 if err != nil {
3586 return nil, err
3587 }
3588 return resp, nil
3589 }
3590
3591 func (c *gRPCClient) DeleteAnalysisRule(ctx context.Context, req *contactcenterinsightspb.DeleteAnalysisRuleRequest, opts ...gax.CallOption) error {
3592 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3593
3594 hds = append(c.xGoogHeaders, hds...)
3595 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3596 opts = append((*c.CallOptions).DeleteAnalysisRule[0:len((*c.CallOptions).DeleteAnalysisRule):len((*c.CallOptions).DeleteAnalysisRule)], opts...)
3597 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3598 var err error
3599 _, err = executeRPC(ctx, c.client.DeleteAnalysisRule, req, settings.GRPC, c.logger, "DeleteAnalysisRule")
3600 return err
3601 }, opts...)
3602 return err
3603 }
3604
3605 func (c *gRPCClient) GetEncryptionSpec(ctx context.Context, req *contactcenterinsightspb.GetEncryptionSpecRequest, opts ...gax.CallOption) (*contactcenterinsightspb.EncryptionSpec, error) {
3606 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3607
3608 hds = append(c.xGoogHeaders, hds...)
3609 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3610 opts = append((*c.CallOptions).GetEncryptionSpec[0:len((*c.CallOptions).GetEncryptionSpec):len((*c.CallOptions).GetEncryptionSpec)], opts...)
3611 var resp *contactcenterinsightspb.EncryptionSpec
3612 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3613 var err error
3614 resp, err = executeRPC(ctx, c.client.GetEncryptionSpec, req, settings.GRPC, c.logger, "GetEncryptionSpec")
3615 return err
3616 }, opts...)
3617 if err != nil {
3618 return nil, err
3619 }
3620 return resp, nil
3621 }
3622
3623 func (c *gRPCClient) InitializeEncryptionSpec(ctx context.Context, req *contactcenterinsightspb.InitializeEncryptionSpecRequest, opts ...gax.CallOption) (*InitializeEncryptionSpecOperation, error) {
3624 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "encryption_spec.name", url.QueryEscape(req.GetEncryptionSpec().GetName()))}
3625
3626 hds = append(c.xGoogHeaders, hds...)
3627 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3628 opts = append((*c.CallOptions).InitializeEncryptionSpec[0:len((*c.CallOptions).InitializeEncryptionSpec):len((*c.CallOptions).InitializeEncryptionSpec)], opts...)
3629 var resp *longrunningpb.Operation
3630 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3631 var err error
3632 resp, err = executeRPC(ctx, c.client.InitializeEncryptionSpec, req, settings.GRPC, c.logger, "InitializeEncryptionSpec")
3633 return err
3634 }, opts...)
3635 if err != nil {
3636 return nil, err
3637 }
3638 return &InitializeEncryptionSpecOperation{
3639 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
3640 }, nil
3641 }
3642
3643 func (c *gRPCClient) CreateView(ctx context.Context, req *contactcenterinsightspb.CreateViewRequest, opts ...gax.CallOption) (*contactcenterinsightspb.View, error) {
3644 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
3645
3646 hds = append(c.xGoogHeaders, hds...)
3647 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3648 opts = append((*c.CallOptions).CreateView[0:len((*c.CallOptions).CreateView):len((*c.CallOptions).CreateView)], opts...)
3649 var resp *contactcenterinsightspb.View
3650 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3651 var err error
3652 resp, err = executeRPC(ctx, c.client.CreateView, req, settings.GRPC, c.logger, "CreateView")
3653 return err
3654 }, opts...)
3655 if err != nil {
3656 return nil, err
3657 }
3658 return resp, nil
3659 }
3660
3661 func (c *gRPCClient) GetView(ctx context.Context, req *contactcenterinsightspb.GetViewRequest, opts ...gax.CallOption) (*contactcenterinsightspb.View, error) {
3662 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3663
3664 hds = append(c.xGoogHeaders, hds...)
3665 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3666 opts = append((*c.CallOptions).GetView[0:len((*c.CallOptions).GetView):len((*c.CallOptions).GetView)], opts...)
3667 var resp *contactcenterinsightspb.View
3668 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3669 var err error
3670 resp, err = executeRPC(ctx, c.client.GetView, req, settings.GRPC, c.logger, "GetView")
3671 return err
3672 }, opts...)
3673 if err != nil {
3674 return nil, err
3675 }
3676 return resp, nil
3677 }
3678
3679 func (c *gRPCClient) ListViews(ctx context.Context, req *contactcenterinsightspb.ListViewsRequest, opts ...gax.CallOption) *ViewIterator {
3680 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
3681
3682 hds = append(c.xGoogHeaders, hds...)
3683 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3684 opts = append((*c.CallOptions).ListViews[0:len((*c.CallOptions).ListViews):len((*c.CallOptions).ListViews)], opts...)
3685 it := &ViewIterator{}
3686 req = proto.Clone(req).(*contactcenterinsightspb.ListViewsRequest)
3687 it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.View, string, error) {
3688 resp := &contactcenterinsightspb.ListViewsResponse{}
3689 if pageToken != "" {
3690 req.PageToken = pageToken
3691 }
3692 if pageSize > math.MaxInt32 {
3693 req.PageSize = math.MaxInt32
3694 } else if pageSize != 0 {
3695 req.PageSize = int32(pageSize)
3696 }
3697 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3698 var err error
3699 resp, err = executeRPC(ctx, c.client.ListViews, req, settings.GRPC, c.logger, "ListViews")
3700 return err
3701 }, opts...)
3702 if err != nil {
3703 return nil, "", err
3704 }
3705
3706 it.Response = resp
3707 return resp.GetViews(), resp.GetNextPageToken(), nil
3708 }
3709 fetch := func(pageSize int, pageToken string) (string, error) {
3710 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
3711 if err != nil {
3712 return "", err
3713 }
3714 it.items = append(it.items, items...)
3715 return nextPageToken, nil
3716 }
3717
3718 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
3719 it.pageInfo.MaxSize = int(req.GetPageSize())
3720 it.pageInfo.Token = req.GetPageToken()
3721
3722 return it
3723 }
3724
3725 func (c *gRPCClient) UpdateView(ctx context.Context, req *contactcenterinsightspb.UpdateViewRequest, opts ...gax.CallOption) (*contactcenterinsightspb.View, error) {
3726 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "view.name", url.QueryEscape(req.GetView().GetName()))}
3727
3728 hds = append(c.xGoogHeaders, hds...)
3729 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3730 opts = append((*c.CallOptions).UpdateView[0:len((*c.CallOptions).UpdateView):len((*c.CallOptions).UpdateView)], opts...)
3731 var resp *contactcenterinsightspb.View
3732 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3733 var err error
3734 resp, err = executeRPC(ctx, c.client.UpdateView, req, settings.GRPC, c.logger, "UpdateView")
3735 return err
3736 }, opts...)
3737 if err != nil {
3738 return nil, err
3739 }
3740 return resp, nil
3741 }
3742
3743 func (c *gRPCClient) DeleteView(ctx context.Context, req *contactcenterinsightspb.DeleteViewRequest, opts ...gax.CallOption) error {
3744 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3745
3746 hds = append(c.xGoogHeaders, hds...)
3747 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3748 opts = append((*c.CallOptions).DeleteView[0:len((*c.CallOptions).DeleteView):len((*c.CallOptions).DeleteView)], opts...)
3749 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3750 var err error
3751 _, err = executeRPC(ctx, c.client.DeleteView, req, settings.GRPC, c.logger, "DeleteView")
3752 return err
3753 }, opts...)
3754 return err
3755 }
3756
3757 func (c *gRPCClient) QueryMetrics(ctx context.Context, req *contactcenterinsightspb.QueryMetricsRequest, opts ...gax.CallOption) (*QueryMetricsOperation, error) {
3758 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "location", url.QueryEscape(req.GetLocation()))}
3759
3760 hds = append(c.xGoogHeaders, hds...)
3761 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3762 opts = append((*c.CallOptions).QueryMetrics[0:len((*c.CallOptions).QueryMetrics):len((*c.CallOptions).QueryMetrics)], opts...)
3763 var resp *longrunningpb.Operation
3764 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3765 var err error
3766 resp, err = executeRPC(ctx, c.client.QueryMetrics, req, settings.GRPC, c.logger, "QueryMetrics")
3767 return err
3768 }, opts...)
3769 if err != nil {
3770 return nil, err
3771 }
3772 return &QueryMetricsOperation{
3773 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
3774 }, nil
3775 }
3776
3777 func (c *gRPCClient) CreateQaQuestion(ctx context.Context, req *contactcenterinsightspb.CreateQaQuestionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaQuestion, error) {
3778 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
3779
3780 hds = append(c.xGoogHeaders, hds...)
3781 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3782 opts = append((*c.CallOptions).CreateQaQuestion[0:len((*c.CallOptions).CreateQaQuestion):len((*c.CallOptions).CreateQaQuestion)], opts...)
3783 var resp *contactcenterinsightspb.QaQuestion
3784 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3785 var err error
3786 resp, err = executeRPC(ctx, c.client.CreateQaQuestion, req, settings.GRPC, c.logger, "CreateQaQuestion")
3787 return err
3788 }, opts...)
3789 if err != nil {
3790 return nil, err
3791 }
3792 return resp, nil
3793 }
3794
3795 func (c *gRPCClient) GetQaQuestion(ctx context.Context, req *contactcenterinsightspb.GetQaQuestionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaQuestion, error) {
3796 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3797
3798 hds = append(c.xGoogHeaders, hds...)
3799 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3800 opts = append((*c.CallOptions).GetQaQuestion[0:len((*c.CallOptions).GetQaQuestion):len((*c.CallOptions).GetQaQuestion)], opts...)
3801 var resp *contactcenterinsightspb.QaQuestion
3802 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3803 var err error
3804 resp, err = executeRPC(ctx, c.client.GetQaQuestion, req, settings.GRPC, c.logger, "GetQaQuestion")
3805 return err
3806 }, opts...)
3807 if err != nil {
3808 return nil, err
3809 }
3810 return resp, nil
3811 }
3812
3813 func (c *gRPCClient) UpdateQaQuestion(ctx context.Context, req *contactcenterinsightspb.UpdateQaQuestionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaQuestion, error) {
3814 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "qa_question.name", url.QueryEscape(req.GetQaQuestion().GetName()))}
3815
3816 hds = append(c.xGoogHeaders, hds...)
3817 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3818 opts = append((*c.CallOptions).UpdateQaQuestion[0:len((*c.CallOptions).UpdateQaQuestion):len((*c.CallOptions).UpdateQaQuestion)], opts...)
3819 var resp *contactcenterinsightspb.QaQuestion
3820 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3821 var err error
3822 resp, err = executeRPC(ctx, c.client.UpdateQaQuestion, req, settings.GRPC, c.logger, "UpdateQaQuestion")
3823 return err
3824 }, opts...)
3825 if err != nil {
3826 return nil, err
3827 }
3828 return resp, nil
3829 }
3830
3831 func (c *gRPCClient) DeleteQaQuestion(ctx context.Context, req *contactcenterinsightspb.DeleteQaQuestionRequest, opts ...gax.CallOption) error {
3832 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3833
3834 hds = append(c.xGoogHeaders, hds...)
3835 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3836 opts = append((*c.CallOptions).DeleteQaQuestion[0:len((*c.CallOptions).DeleteQaQuestion):len((*c.CallOptions).DeleteQaQuestion)], opts...)
3837 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3838 var err error
3839 _, err = executeRPC(ctx, c.client.DeleteQaQuestion, req, settings.GRPC, c.logger, "DeleteQaQuestion")
3840 return err
3841 }, opts...)
3842 return err
3843 }
3844
3845 func (c *gRPCClient) ListQaQuestions(ctx context.Context, req *contactcenterinsightspb.ListQaQuestionsRequest, opts ...gax.CallOption) *QaQuestionIterator {
3846 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
3847
3848 hds = append(c.xGoogHeaders, hds...)
3849 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3850 opts = append((*c.CallOptions).ListQaQuestions[0:len((*c.CallOptions).ListQaQuestions):len((*c.CallOptions).ListQaQuestions)], opts...)
3851 it := &QaQuestionIterator{}
3852 req = proto.Clone(req).(*contactcenterinsightspb.ListQaQuestionsRequest)
3853 it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.QaQuestion, string, error) {
3854 resp := &contactcenterinsightspb.ListQaQuestionsResponse{}
3855 if pageToken != "" {
3856 req.PageToken = pageToken
3857 }
3858 if pageSize > math.MaxInt32 {
3859 req.PageSize = math.MaxInt32
3860 } else if pageSize != 0 {
3861 req.PageSize = int32(pageSize)
3862 }
3863 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3864 var err error
3865 resp, err = executeRPC(ctx, c.client.ListQaQuestions, req, settings.GRPC, c.logger, "ListQaQuestions")
3866 return err
3867 }, opts...)
3868 if err != nil {
3869 return nil, "", err
3870 }
3871
3872 it.Response = resp
3873 return resp.GetQaQuestions(), resp.GetNextPageToken(), nil
3874 }
3875 fetch := func(pageSize int, pageToken string) (string, error) {
3876 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
3877 if err != nil {
3878 return "", err
3879 }
3880 it.items = append(it.items, items...)
3881 return nextPageToken, nil
3882 }
3883
3884 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
3885 it.pageInfo.MaxSize = int(req.GetPageSize())
3886 it.pageInfo.Token = req.GetPageToken()
3887
3888 return it
3889 }
3890
3891 func (c *gRPCClient) CreateQaScorecard(ctx context.Context, req *contactcenterinsightspb.CreateQaScorecardRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecard, error) {
3892 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
3893
3894 hds = append(c.xGoogHeaders, hds...)
3895 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3896 opts = append((*c.CallOptions).CreateQaScorecard[0:len((*c.CallOptions).CreateQaScorecard):len((*c.CallOptions).CreateQaScorecard)], opts...)
3897 var resp *contactcenterinsightspb.QaScorecard
3898 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3899 var err error
3900 resp, err = executeRPC(ctx, c.client.CreateQaScorecard, req, settings.GRPC, c.logger, "CreateQaScorecard")
3901 return err
3902 }, opts...)
3903 if err != nil {
3904 return nil, err
3905 }
3906 return resp, nil
3907 }
3908
3909 func (c *gRPCClient) GetQaScorecard(ctx context.Context, req *contactcenterinsightspb.GetQaScorecardRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecard, error) {
3910 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3911
3912 hds = append(c.xGoogHeaders, hds...)
3913 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3914 opts = append((*c.CallOptions).GetQaScorecard[0:len((*c.CallOptions).GetQaScorecard):len((*c.CallOptions).GetQaScorecard)], opts...)
3915 var resp *contactcenterinsightspb.QaScorecard
3916 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3917 var err error
3918 resp, err = executeRPC(ctx, c.client.GetQaScorecard, req, settings.GRPC, c.logger, "GetQaScorecard")
3919 return err
3920 }, opts...)
3921 if err != nil {
3922 return nil, err
3923 }
3924 return resp, nil
3925 }
3926
3927 func (c *gRPCClient) UpdateQaScorecard(ctx context.Context, req *contactcenterinsightspb.UpdateQaScorecardRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecard, error) {
3928 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "qa_scorecard.name", url.QueryEscape(req.GetQaScorecard().GetName()))}
3929
3930 hds = append(c.xGoogHeaders, hds...)
3931 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3932 opts = append((*c.CallOptions).UpdateQaScorecard[0:len((*c.CallOptions).UpdateQaScorecard):len((*c.CallOptions).UpdateQaScorecard)], opts...)
3933 var resp *contactcenterinsightspb.QaScorecard
3934 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3935 var err error
3936 resp, err = executeRPC(ctx, c.client.UpdateQaScorecard, req, settings.GRPC, c.logger, "UpdateQaScorecard")
3937 return err
3938 }, opts...)
3939 if err != nil {
3940 return nil, err
3941 }
3942 return resp, nil
3943 }
3944
3945 func (c *gRPCClient) DeleteQaScorecard(ctx context.Context, req *contactcenterinsightspb.DeleteQaScorecardRequest, opts ...gax.CallOption) error {
3946 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3947
3948 hds = append(c.xGoogHeaders, hds...)
3949 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3950 opts = append((*c.CallOptions).DeleteQaScorecard[0:len((*c.CallOptions).DeleteQaScorecard):len((*c.CallOptions).DeleteQaScorecard)], opts...)
3951 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3952 var err error
3953 _, err = executeRPC(ctx, c.client.DeleteQaScorecard, req, settings.GRPC, c.logger, "DeleteQaScorecard")
3954 return err
3955 }, opts...)
3956 return err
3957 }
3958
3959 func (c *gRPCClient) ListQaScorecards(ctx context.Context, req *contactcenterinsightspb.ListQaScorecardsRequest, opts ...gax.CallOption) *QaScorecardIterator {
3960 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
3961
3962 hds = append(c.xGoogHeaders, hds...)
3963 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
3964 opts = append((*c.CallOptions).ListQaScorecards[0:len((*c.CallOptions).ListQaScorecards):len((*c.CallOptions).ListQaScorecards)], opts...)
3965 it := &QaScorecardIterator{}
3966 req = proto.Clone(req).(*contactcenterinsightspb.ListQaScorecardsRequest)
3967 it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.QaScorecard, string, error) {
3968 resp := &contactcenterinsightspb.ListQaScorecardsResponse{}
3969 if pageToken != "" {
3970 req.PageToken = pageToken
3971 }
3972 if pageSize > math.MaxInt32 {
3973 req.PageSize = math.MaxInt32
3974 } else if pageSize != 0 {
3975 req.PageSize = int32(pageSize)
3976 }
3977 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3978 var err error
3979 resp, err = executeRPC(ctx, c.client.ListQaScorecards, req, settings.GRPC, c.logger, "ListQaScorecards")
3980 return err
3981 }, opts...)
3982 if err != nil {
3983 return nil, "", err
3984 }
3985
3986 it.Response = resp
3987 return resp.GetQaScorecards(), resp.GetNextPageToken(), nil
3988 }
3989 fetch := func(pageSize int, pageToken string) (string, error) {
3990 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
3991 if err != nil {
3992 return "", err
3993 }
3994 it.items = append(it.items, items...)
3995 return nextPageToken, nil
3996 }
3997
3998 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
3999 it.pageInfo.MaxSize = int(req.GetPageSize())
4000 it.pageInfo.Token = req.GetPageToken()
4001
4002 return it
4003 }
4004
4005 func (c *gRPCClient) CreateQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.CreateQaScorecardRevisionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecardRevision, error) {
4006 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
4007
4008 hds = append(c.xGoogHeaders, hds...)
4009 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
4010 opts = append((*c.CallOptions).CreateQaScorecardRevision[0:len((*c.CallOptions).CreateQaScorecardRevision):len((*c.CallOptions).CreateQaScorecardRevision)], opts...)
4011 var resp *contactcenterinsightspb.QaScorecardRevision
4012 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4013 var err error
4014 resp, err = executeRPC(ctx, c.client.CreateQaScorecardRevision, req, settings.GRPC, c.logger, "CreateQaScorecardRevision")
4015 return err
4016 }, opts...)
4017 if err != nil {
4018 return nil, err
4019 }
4020 return resp, nil
4021 }
4022
4023 func (c *gRPCClient) GetQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.GetQaScorecardRevisionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecardRevision, error) {
4024 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
4025
4026 hds = append(c.xGoogHeaders, hds...)
4027 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
4028 opts = append((*c.CallOptions).GetQaScorecardRevision[0:len((*c.CallOptions).GetQaScorecardRevision):len((*c.CallOptions).GetQaScorecardRevision)], opts...)
4029 var resp *contactcenterinsightspb.QaScorecardRevision
4030 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4031 var err error
4032 resp, err = executeRPC(ctx, c.client.GetQaScorecardRevision, req, settings.GRPC, c.logger, "GetQaScorecardRevision")
4033 return err
4034 }, opts...)
4035 if err != nil {
4036 return nil, err
4037 }
4038 return resp, nil
4039 }
4040
4041 func (c *gRPCClient) TuneQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.TuneQaScorecardRevisionRequest, opts ...gax.CallOption) (*TuneQaScorecardRevisionOperation, error) {
4042 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
4043
4044 hds = append(c.xGoogHeaders, hds...)
4045 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
4046 opts = append((*c.CallOptions).TuneQaScorecardRevision[0:len((*c.CallOptions).TuneQaScorecardRevision):len((*c.CallOptions).TuneQaScorecardRevision)], opts...)
4047 var resp *longrunningpb.Operation
4048 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4049 var err error
4050 resp, err = executeRPC(ctx, c.client.TuneQaScorecardRevision, req, settings.GRPC, c.logger, "TuneQaScorecardRevision")
4051 return err
4052 }, opts...)
4053 if err != nil {
4054 return nil, err
4055 }
4056 return &TuneQaScorecardRevisionOperation{
4057 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
4058 }, nil
4059 }
4060
4061 func (c *gRPCClient) DeployQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.DeployQaScorecardRevisionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecardRevision, error) {
4062 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
4063
4064 hds = append(c.xGoogHeaders, hds...)
4065 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
4066 opts = append((*c.CallOptions).DeployQaScorecardRevision[0:len((*c.CallOptions).DeployQaScorecardRevision):len((*c.CallOptions).DeployQaScorecardRevision)], opts...)
4067 var resp *contactcenterinsightspb.QaScorecardRevision
4068 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4069 var err error
4070 resp, err = executeRPC(ctx, c.client.DeployQaScorecardRevision, req, settings.GRPC, c.logger, "DeployQaScorecardRevision")
4071 return err
4072 }, opts...)
4073 if err != nil {
4074 return nil, err
4075 }
4076 return resp, nil
4077 }
4078
4079 func (c *gRPCClient) UndeployQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.UndeployQaScorecardRevisionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecardRevision, error) {
4080 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
4081
4082 hds = append(c.xGoogHeaders, hds...)
4083 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
4084 opts = append((*c.CallOptions).UndeployQaScorecardRevision[0:len((*c.CallOptions).UndeployQaScorecardRevision):len((*c.CallOptions).UndeployQaScorecardRevision)], opts...)
4085 var resp *contactcenterinsightspb.QaScorecardRevision
4086 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4087 var err error
4088 resp, err = executeRPC(ctx, c.client.UndeployQaScorecardRevision, req, settings.GRPC, c.logger, "UndeployQaScorecardRevision")
4089 return err
4090 }, opts...)
4091 if err != nil {
4092 return nil, err
4093 }
4094 return resp, nil
4095 }
4096
4097 func (c *gRPCClient) DeleteQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.DeleteQaScorecardRevisionRequest, opts ...gax.CallOption) error {
4098 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
4099
4100 hds = append(c.xGoogHeaders, hds...)
4101 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
4102 opts = append((*c.CallOptions).DeleteQaScorecardRevision[0:len((*c.CallOptions).DeleteQaScorecardRevision):len((*c.CallOptions).DeleteQaScorecardRevision)], opts...)
4103 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4104 var err error
4105 _, err = executeRPC(ctx, c.client.DeleteQaScorecardRevision, req, settings.GRPC, c.logger, "DeleteQaScorecardRevision")
4106 return err
4107 }, opts...)
4108 return err
4109 }
4110
4111 func (c *gRPCClient) ListQaScorecardRevisions(ctx context.Context, req *contactcenterinsightspb.ListQaScorecardRevisionsRequest, opts ...gax.CallOption) *QaScorecardRevisionIterator {
4112 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
4113
4114 hds = append(c.xGoogHeaders, hds...)
4115 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
4116 opts = append((*c.CallOptions).ListQaScorecardRevisions[0:len((*c.CallOptions).ListQaScorecardRevisions):len((*c.CallOptions).ListQaScorecardRevisions)], opts...)
4117 it := &QaScorecardRevisionIterator{}
4118 req = proto.Clone(req).(*contactcenterinsightspb.ListQaScorecardRevisionsRequest)
4119 it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.QaScorecardRevision, string, error) {
4120 resp := &contactcenterinsightspb.ListQaScorecardRevisionsResponse{}
4121 if pageToken != "" {
4122 req.PageToken = pageToken
4123 }
4124 if pageSize > math.MaxInt32 {
4125 req.PageSize = math.MaxInt32
4126 } else if pageSize != 0 {
4127 req.PageSize = int32(pageSize)
4128 }
4129 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4130 var err error
4131 resp, err = executeRPC(ctx, c.client.ListQaScorecardRevisions, req, settings.GRPC, c.logger, "ListQaScorecardRevisions")
4132 return err
4133 }, opts...)
4134 if err != nil {
4135 return nil, "", err
4136 }
4137
4138 it.Response = resp
4139 return resp.GetQaScorecardRevisions(), resp.GetNextPageToken(), nil
4140 }
4141 fetch := func(pageSize int, pageToken string) (string, error) {
4142 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
4143 if err != nil {
4144 return "", err
4145 }
4146 it.items = append(it.items, items...)
4147 return nextPageToken, nil
4148 }
4149
4150 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
4151 it.pageInfo.MaxSize = int(req.GetPageSize())
4152 it.pageInfo.Token = req.GetPageToken()
4153
4154 return it
4155 }
4156
4157 func (c *gRPCClient) CreateFeedbackLabel(ctx context.Context, req *contactcenterinsightspb.CreateFeedbackLabelRequest, opts ...gax.CallOption) (*contactcenterinsightspb.FeedbackLabel, error) {
4158 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
4159
4160 hds = append(c.xGoogHeaders, hds...)
4161 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
4162 opts = append((*c.CallOptions).CreateFeedbackLabel[0:len((*c.CallOptions).CreateFeedbackLabel):len((*c.CallOptions).CreateFeedbackLabel)], opts...)
4163 var resp *contactcenterinsightspb.FeedbackLabel
4164 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4165 var err error
4166 resp, err = executeRPC(ctx, c.client.CreateFeedbackLabel, req, settings.GRPC, c.logger, "CreateFeedbackLabel")
4167 return err
4168 }, opts...)
4169 if err != nil {
4170 return nil, err
4171 }
4172 return resp, nil
4173 }
4174
4175 func (c *gRPCClient) ListFeedbackLabels(ctx context.Context, req *contactcenterinsightspb.ListFeedbackLabelsRequest, opts ...gax.CallOption) *FeedbackLabelIterator {
4176 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
4177
4178 hds = append(c.xGoogHeaders, hds...)
4179 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
4180 opts = append((*c.CallOptions).ListFeedbackLabels[0:len((*c.CallOptions).ListFeedbackLabels):len((*c.CallOptions).ListFeedbackLabels)], opts...)
4181 it := &FeedbackLabelIterator{}
4182 req = proto.Clone(req).(*contactcenterinsightspb.ListFeedbackLabelsRequest)
4183 it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.FeedbackLabel, string, error) {
4184 resp := &contactcenterinsightspb.ListFeedbackLabelsResponse{}
4185 if pageToken != "" {
4186 req.PageToken = pageToken
4187 }
4188 if pageSize > math.MaxInt32 {
4189 req.PageSize = math.MaxInt32
4190 } else if pageSize != 0 {
4191 req.PageSize = int32(pageSize)
4192 }
4193 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4194 var err error
4195 resp, err = executeRPC(ctx, c.client.ListFeedbackLabels, req, settings.GRPC, c.logger, "ListFeedbackLabels")
4196 return err
4197 }, opts...)
4198 if err != nil {
4199 return nil, "", err
4200 }
4201
4202 it.Response = resp
4203 return resp.GetFeedbackLabels(), resp.GetNextPageToken(), nil
4204 }
4205 fetch := func(pageSize int, pageToken string) (string, error) {
4206 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
4207 if err != nil {
4208 return "", err
4209 }
4210 it.items = append(it.items, items...)
4211 return nextPageToken, nil
4212 }
4213
4214 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
4215 it.pageInfo.MaxSize = int(req.GetPageSize())
4216 it.pageInfo.Token = req.GetPageToken()
4217
4218 return it
4219 }
4220
4221 func (c *gRPCClient) GetFeedbackLabel(ctx context.Context, req *contactcenterinsightspb.GetFeedbackLabelRequest, opts ...gax.CallOption) (*contactcenterinsightspb.FeedbackLabel, error) {
4222 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
4223
4224 hds = append(c.xGoogHeaders, hds...)
4225 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
4226 opts = append((*c.CallOptions).GetFeedbackLabel[0:len((*c.CallOptions).GetFeedbackLabel):len((*c.CallOptions).GetFeedbackLabel)], opts...)
4227 var resp *contactcenterinsightspb.FeedbackLabel
4228 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4229 var err error
4230 resp, err = executeRPC(ctx, c.client.GetFeedbackLabel, req, settings.GRPC, c.logger, "GetFeedbackLabel")
4231 return err
4232 }, opts...)
4233 if err != nil {
4234 return nil, err
4235 }
4236 return resp, nil
4237 }
4238
4239 func (c *gRPCClient) UpdateFeedbackLabel(ctx context.Context, req *contactcenterinsightspb.UpdateFeedbackLabelRequest, opts ...gax.CallOption) (*contactcenterinsightspb.FeedbackLabel, error) {
4240 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "feedback_label.name", url.QueryEscape(req.GetFeedbackLabel().GetName()))}
4241
4242 hds = append(c.xGoogHeaders, hds...)
4243 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
4244 opts = append((*c.CallOptions).UpdateFeedbackLabel[0:len((*c.CallOptions).UpdateFeedbackLabel):len((*c.CallOptions).UpdateFeedbackLabel)], opts...)
4245 var resp *contactcenterinsightspb.FeedbackLabel
4246 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4247 var err error
4248 resp, err = executeRPC(ctx, c.client.UpdateFeedbackLabel, req, settings.GRPC, c.logger, "UpdateFeedbackLabel")
4249 return err
4250 }, opts...)
4251 if err != nil {
4252 return nil, err
4253 }
4254 return resp, nil
4255 }
4256
4257 func (c *gRPCClient) DeleteFeedbackLabel(ctx context.Context, req *contactcenterinsightspb.DeleteFeedbackLabelRequest, opts ...gax.CallOption) error {
4258 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
4259
4260 hds = append(c.xGoogHeaders, hds...)
4261 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
4262 opts = append((*c.CallOptions).DeleteFeedbackLabel[0:len((*c.CallOptions).DeleteFeedbackLabel):len((*c.CallOptions).DeleteFeedbackLabel)], opts...)
4263 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4264 var err error
4265 _, err = executeRPC(ctx, c.client.DeleteFeedbackLabel, req, settings.GRPC, c.logger, "DeleteFeedbackLabel")
4266 return err
4267 }, opts...)
4268 return err
4269 }
4270
4271 func (c *gRPCClient) ListAllFeedbackLabels(ctx context.Context, req *contactcenterinsightspb.ListAllFeedbackLabelsRequest, opts ...gax.CallOption) *FeedbackLabelIterator {
4272 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
4273
4274 hds = append(c.xGoogHeaders, hds...)
4275 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
4276 opts = append((*c.CallOptions).ListAllFeedbackLabels[0:len((*c.CallOptions).ListAllFeedbackLabels):len((*c.CallOptions).ListAllFeedbackLabels)], opts...)
4277 it := &FeedbackLabelIterator{}
4278 req = proto.Clone(req).(*contactcenterinsightspb.ListAllFeedbackLabelsRequest)
4279 it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.FeedbackLabel, string, error) {
4280 resp := &contactcenterinsightspb.ListAllFeedbackLabelsResponse{}
4281 if pageToken != "" {
4282 req.PageToken = pageToken
4283 }
4284 if pageSize > math.MaxInt32 {
4285 req.PageSize = math.MaxInt32
4286 } else if pageSize != 0 {
4287 req.PageSize = int32(pageSize)
4288 }
4289 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4290 var err error
4291 resp, err = executeRPC(ctx, c.client.ListAllFeedbackLabels, req, settings.GRPC, c.logger, "ListAllFeedbackLabels")
4292 return err
4293 }, opts...)
4294 if err != nil {
4295 return nil, "", err
4296 }
4297
4298 it.Response = resp
4299 return resp.GetFeedbackLabels(), resp.GetNextPageToken(), nil
4300 }
4301 fetch := func(pageSize int, pageToken string) (string, error) {
4302 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
4303 if err != nil {
4304 return "", err
4305 }
4306 it.items = append(it.items, items...)
4307 return nextPageToken, nil
4308 }
4309
4310 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
4311 it.pageInfo.MaxSize = int(req.GetPageSize())
4312 it.pageInfo.Token = req.GetPageToken()
4313
4314 return it
4315 }
4316
4317 func (c *gRPCClient) BulkUploadFeedbackLabels(ctx context.Context, req *contactcenterinsightspb.BulkUploadFeedbackLabelsRequest, opts ...gax.CallOption) (*BulkUploadFeedbackLabelsOperation, error) {
4318 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
4319
4320 hds = append(c.xGoogHeaders, hds...)
4321 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
4322 opts = append((*c.CallOptions).BulkUploadFeedbackLabels[0:len((*c.CallOptions).BulkUploadFeedbackLabels):len((*c.CallOptions).BulkUploadFeedbackLabels)], opts...)
4323 var resp *longrunningpb.Operation
4324 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4325 var err error
4326 resp, err = executeRPC(ctx, c.client.BulkUploadFeedbackLabels, req, settings.GRPC, c.logger, "BulkUploadFeedbackLabels")
4327 return err
4328 }, opts...)
4329 if err != nil {
4330 return nil, err
4331 }
4332 return &BulkUploadFeedbackLabelsOperation{
4333 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
4334 }, nil
4335 }
4336
4337 func (c *gRPCClient) BulkDownloadFeedbackLabels(ctx context.Context, req *contactcenterinsightspb.BulkDownloadFeedbackLabelsRequest, opts ...gax.CallOption) (*BulkDownloadFeedbackLabelsOperation, error) {
4338 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
4339
4340 hds = append(c.xGoogHeaders, hds...)
4341 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
4342 opts = append((*c.CallOptions).BulkDownloadFeedbackLabels[0:len((*c.CallOptions).BulkDownloadFeedbackLabels):len((*c.CallOptions).BulkDownloadFeedbackLabels)], opts...)
4343 var resp *longrunningpb.Operation
4344 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4345 var err error
4346 resp, err = executeRPC(ctx, c.client.BulkDownloadFeedbackLabels, req, settings.GRPC, c.logger, "BulkDownloadFeedbackLabels")
4347 return err
4348 }, opts...)
4349 if err != nil {
4350 return nil, err
4351 }
4352 return &BulkDownloadFeedbackLabelsOperation{
4353 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
4354 }, nil
4355 }
4356
4357 func (c *gRPCClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error {
4358 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
4359
4360 hds = append(c.xGoogHeaders, hds...)
4361 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
4362 opts = append((*c.CallOptions).CancelOperation[0:len((*c.CallOptions).CancelOperation):len((*c.CallOptions).CancelOperation)], opts...)
4363 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4364 var err error
4365 _, err = executeRPC(ctx, c.operationsClient.CancelOperation, req, settings.GRPC, c.logger, "CancelOperation")
4366 return err
4367 }, opts...)
4368 return err
4369 }
4370
4371 func (c *gRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) {
4372 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
4373
4374 hds = append(c.xGoogHeaders, hds...)
4375 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
4376 opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...)
4377 var resp *longrunningpb.Operation
4378 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4379 var err error
4380 resp, err = executeRPC(ctx, c.operationsClient.GetOperation, req, settings.GRPC, c.logger, "GetOperation")
4381 return err
4382 }, opts...)
4383 if err != nil {
4384 return nil, err
4385 }
4386 return resp, nil
4387 }
4388
4389 func (c *gRPCClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator {
4390 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
4391
4392 hds = append(c.xGoogHeaders, hds...)
4393 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
4394 opts = append((*c.CallOptions).ListOperations[0:len((*c.CallOptions).ListOperations):len((*c.CallOptions).ListOperations)], opts...)
4395 it := &OperationIterator{}
4396 req = proto.Clone(req).(*longrunningpb.ListOperationsRequest)
4397 it.InternalFetch = func(pageSize int, pageToken string) ([]*longrunningpb.Operation, string, error) {
4398 resp := &longrunningpb.ListOperationsResponse{}
4399 if pageToken != "" {
4400 req.PageToken = pageToken
4401 }
4402 if pageSize > math.MaxInt32 {
4403 req.PageSize = math.MaxInt32
4404 } else if pageSize != 0 {
4405 req.PageSize = int32(pageSize)
4406 }
4407 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4408 var err error
4409 resp, err = executeRPC(ctx, c.operationsClient.ListOperations, req, settings.GRPC, c.logger, "ListOperations")
4410 return err
4411 }, opts...)
4412 if err != nil {
4413 return nil, "", err
4414 }
4415
4416 it.Response = resp
4417 return resp.GetOperations(), resp.GetNextPageToken(), nil
4418 }
4419 fetch := func(pageSize int, pageToken string) (string, error) {
4420 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
4421 if err != nil {
4422 return "", err
4423 }
4424 it.items = append(it.items, items...)
4425 return nextPageToken, nil
4426 }
4427
4428 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
4429 it.pageInfo.MaxSize = int(req.GetPageSize())
4430 it.pageInfo.Token = req.GetPageToken()
4431
4432 return it
4433 }
4434
4435 // CreateConversation creates a conversation.
4436 // Note that this method does not support audio transcription or redaction.
4437 // Use conversations.upload instead.
4438 func (c *restClient) CreateConversation(ctx context.Context, req *contactcenterinsightspb.CreateConversationRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Conversation, error) {
4439 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
4440 body := req.GetConversation()
4441 jsonReq, err := m.Marshal(body)
4442 if err != nil {
4443 return nil, err
4444 }
4445
4446 baseUrl, err := url.Parse(c.endpoint)
4447 if err != nil {
4448 return nil, err
4449 }
4450 baseUrl.Path += fmt.Sprintf("/v1/%v/conversations", req.GetParent())
4451
4452 params := url.Values{}
4453 params.Add("$alt", "json;enum-encoding=int")
4454 if req.GetConversationId() != "" {
4455 params.Add("conversationId", fmt.Sprintf("%v", req.GetConversationId()))
4456 }
4457
4458 baseUrl.RawQuery = params.Encode()
4459
4460 // Build HTTP headers from client and context metadata.
4461 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
4462
4463 hds = append(c.xGoogHeaders, hds...)
4464 hds = append(hds, "Content-Type", "application/json")
4465 headers := gax.BuildHeaders(ctx, hds...)
4466 opts = append((*c.CallOptions).CreateConversation[0:len((*c.CallOptions).CreateConversation):len((*c.CallOptions).CreateConversation)], opts...)
4467 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
4468 resp := &contactcenterinsightspb.Conversation{}
4469 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4470 if settings.Path != "" {
4471 baseUrl.Path = settings.Path
4472 }
4473 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
4474 if err != nil {
4475 return err
4476 }
4477 httpReq = httpReq.WithContext(ctx)
4478 httpReq.Header = headers
4479
4480 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreateConversation")
4481 if err != nil {
4482 return err
4483 }
4484
4485 if err := unm.Unmarshal(buf, resp); err != nil {
4486 return err
4487 }
4488
4489 return nil
4490 }, opts...)
4491 if e != nil {
4492 return nil, e
4493 }
4494 return resp, nil
4495 }
4496
4497 // UploadConversation create a long-running conversation upload operation. This method differs
4498 // from CreateConversation by allowing audio transcription and optional DLP
4499 // redaction.
4500 func (c *restClient) UploadConversation(ctx context.Context, req *contactcenterinsightspb.UploadConversationRequest, opts ...gax.CallOption) (*UploadConversationOperation, error) {
4501 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
4502 jsonReq, err := m.Marshal(req)
4503 if err != nil {
4504 return nil, err
4505 }
4506
4507 baseUrl, err := url.Parse(c.endpoint)
4508 if err != nil {
4509 return nil, err
4510 }
4511 baseUrl.Path += fmt.Sprintf("/v1/%v/conversations:upload", req.GetParent())
4512
4513 params := url.Values{}
4514 params.Add("$alt", "json;enum-encoding=int")
4515
4516 baseUrl.RawQuery = params.Encode()
4517
4518 // Build HTTP headers from client and context metadata.
4519 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
4520
4521 hds = append(c.xGoogHeaders, hds...)
4522 hds = append(hds, "Content-Type", "application/json")
4523 headers := gax.BuildHeaders(ctx, hds...)
4524 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
4525 resp := &longrunningpb.Operation{}
4526 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4527 if settings.Path != "" {
4528 baseUrl.Path = settings.Path
4529 }
4530 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
4531 if err != nil {
4532 return err
4533 }
4534 httpReq = httpReq.WithContext(ctx)
4535 httpReq.Header = headers
4536
4537 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UploadConversation")
4538 if err != nil {
4539 return err
4540 }
4541 if err := unm.Unmarshal(buf, resp); err != nil {
4542 return err
4543 }
4544
4545 return nil
4546 }, opts...)
4547 if e != nil {
4548 return nil, e
4549 }
4550
4551 override := fmt.Sprintf("/v1/%s", resp.GetName())
4552 return &UploadConversationOperation{
4553 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
4554 pollPath: override,
4555 }, nil
4556 }
4557
4558 // UpdateConversation updates a conversation.
4559 func (c *restClient) UpdateConversation(ctx context.Context, req *contactcenterinsightspb.UpdateConversationRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Conversation, error) {
4560 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
4561 body := req.GetConversation()
4562 jsonReq, err := m.Marshal(body)
4563 if err != nil {
4564 return nil, err
4565 }
4566
4567 baseUrl, err := url.Parse(c.endpoint)
4568 if err != nil {
4569 return nil, err
4570 }
4571 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetConversation().GetName())
4572
4573 params := url.Values{}
4574 params.Add("$alt", "json;enum-encoding=int")
4575 if req.GetUpdateMask() != nil {
4576 field, err := protojson.Marshal(req.GetUpdateMask())
4577 if err != nil {
4578 return nil, err
4579 }
4580 params.Add("updateMask", string(field[1:len(field)-1]))
4581 }
4582
4583 baseUrl.RawQuery = params.Encode()
4584
4585 // Build HTTP headers from client and context metadata.
4586 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "conversation.name", url.QueryEscape(req.GetConversation().GetName()))}
4587
4588 hds = append(c.xGoogHeaders, hds...)
4589 hds = append(hds, "Content-Type", "application/json")
4590 headers := gax.BuildHeaders(ctx, hds...)
4591 opts = append((*c.CallOptions).UpdateConversation[0:len((*c.CallOptions).UpdateConversation):len((*c.CallOptions).UpdateConversation)], opts...)
4592 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
4593 resp := &contactcenterinsightspb.Conversation{}
4594 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4595 if settings.Path != "" {
4596 baseUrl.Path = settings.Path
4597 }
4598 httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq))
4599 if err != nil {
4600 return err
4601 }
4602 httpReq = httpReq.WithContext(ctx)
4603 httpReq.Header = headers
4604
4605 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UpdateConversation")
4606 if err != nil {
4607 return err
4608 }
4609
4610 if err := unm.Unmarshal(buf, resp); err != nil {
4611 return err
4612 }
4613
4614 return nil
4615 }, opts...)
4616 if e != nil {
4617 return nil, e
4618 }
4619 return resp, nil
4620 }
4621
4622 // GetConversation gets a conversation.
4623 func (c *restClient) GetConversation(ctx context.Context, req *contactcenterinsightspb.GetConversationRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Conversation, error) {
4624 baseUrl, err := url.Parse(c.endpoint)
4625 if err != nil {
4626 return nil, err
4627 }
4628 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
4629
4630 params := url.Values{}
4631 params.Add("$alt", "json;enum-encoding=int")
4632 if req.GetView() != 0 {
4633 params.Add("view", fmt.Sprintf("%v", req.GetView()))
4634 }
4635
4636 baseUrl.RawQuery = params.Encode()
4637
4638 // Build HTTP headers from client and context metadata.
4639 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
4640
4641 hds = append(c.xGoogHeaders, hds...)
4642 hds = append(hds, "Content-Type", "application/json")
4643 headers := gax.BuildHeaders(ctx, hds...)
4644 opts = append((*c.CallOptions).GetConversation[0:len((*c.CallOptions).GetConversation):len((*c.CallOptions).GetConversation)], opts...)
4645 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
4646 resp := &contactcenterinsightspb.Conversation{}
4647 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4648 if settings.Path != "" {
4649 baseUrl.Path = settings.Path
4650 }
4651 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
4652 if err != nil {
4653 return err
4654 }
4655 httpReq = httpReq.WithContext(ctx)
4656 httpReq.Header = headers
4657
4658 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetConversation")
4659 if err != nil {
4660 return err
4661 }
4662
4663 if err := unm.Unmarshal(buf, resp); err != nil {
4664 return err
4665 }
4666
4667 return nil
4668 }, opts...)
4669 if e != nil {
4670 return nil, e
4671 }
4672 return resp, nil
4673 }
4674
4675 // ListConversations lists conversations.
4676 func (c *restClient) ListConversations(ctx context.Context, req *contactcenterinsightspb.ListConversationsRequest, opts ...gax.CallOption) *ConversationIterator {
4677 it := &ConversationIterator{}
4678 req = proto.Clone(req).(*contactcenterinsightspb.ListConversationsRequest)
4679 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
4680 it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.Conversation, string, error) {
4681 resp := &contactcenterinsightspb.ListConversationsResponse{}
4682 if pageToken != "" {
4683 req.PageToken = pageToken
4684 }
4685 if pageSize > math.MaxInt32 {
4686 req.PageSize = math.MaxInt32
4687 } else if pageSize != 0 {
4688 req.PageSize = int32(pageSize)
4689 }
4690 baseUrl, err := url.Parse(c.endpoint)
4691 if err != nil {
4692 return nil, "", err
4693 }
4694 baseUrl.Path += fmt.Sprintf("/v1/%v/conversations", req.GetParent())
4695
4696 params := url.Values{}
4697 params.Add("$alt", "json;enum-encoding=int")
4698 if req.GetFilter() != "" {
4699 params.Add("filter", fmt.Sprintf("%v", req.GetFilter()))
4700 }
4701 if req.GetOrderBy() != "" {
4702 params.Add("orderBy", fmt.Sprintf("%v", req.GetOrderBy()))
4703 }
4704 if req.GetPageSize() != 0 {
4705 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
4706 }
4707 if req.GetPageToken() != "" {
4708 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
4709 }
4710 if req.GetView() != 0 {
4711 params.Add("view", fmt.Sprintf("%v", req.GetView()))
4712 }
4713
4714 baseUrl.RawQuery = params.Encode()
4715
4716 // Build HTTP headers from client and context metadata.
4717 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
4718 headers := gax.BuildHeaders(ctx, hds...)
4719 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4720 if settings.Path != "" {
4721 baseUrl.Path = settings.Path
4722 }
4723 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
4724 if err != nil {
4725 return err
4726 }
4727 httpReq.Header = headers
4728
4729 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListConversations")
4730 if err != nil {
4731 return err
4732 }
4733 if err := unm.Unmarshal(buf, resp); err != nil {
4734 return err
4735 }
4736
4737 return nil
4738 }, opts...)
4739 if e != nil {
4740 return nil, "", e
4741 }
4742 it.Response = resp
4743 return resp.GetConversations(), resp.GetNextPageToken(), nil
4744 }
4745
4746 fetch := func(pageSize int, pageToken string) (string, error) {
4747 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
4748 if err != nil {
4749 return "", err
4750 }
4751 it.items = append(it.items, items...)
4752 return nextPageToken, nil
4753 }
4754
4755 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
4756 it.pageInfo.MaxSize = int(req.GetPageSize())
4757 it.pageInfo.Token = req.GetPageToken()
4758
4759 return it
4760 }
4761
4762 // DeleteConversation deletes a conversation.
4763 func (c *restClient) DeleteConversation(ctx context.Context, req *contactcenterinsightspb.DeleteConversationRequest, opts ...gax.CallOption) error {
4764 baseUrl, err := url.Parse(c.endpoint)
4765 if err != nil {
4766 return err
4767 }
4768 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
4769
4770 params := url.Values{}
4771 params.Add("$alt", "json;enum-encoding=int")
4772 if req.GetForce() {
4773 params.Add("force", fmt.Sprintf("%v", req.GetForce()))
4774 }
4775
4776 baseUrl.RawQuery = params.Encode()
4777
4778 // Build HTTP headers from client and context metadata.
4779 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
4780
4781 hds = append(c.xGoogHeaders, hds...)
4782 hds = append(hds, "Content-Type", "application/json")
4783 headers := gax.BuildHeaders(ctx, hds...)
4784 return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4785 if settings.Path != "" {
4786 baseUrl.Path = settings.Path
4787 }
4788 httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil)
4789 if err != nil {
4790 return err
4791 }
4792 httpReq = httpReq.WithContext(ctx)
4793 httpReq.Header = headers
4794
4795 _, err = executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteConversation")
4796 return err
4797 }, opts...)
4798 }
4799
4800 // CreateAnalysis creates an analysis. The long running operation is done when the analysis
4801 // has completed.
4802 func (c *restClient) CreateAnalysis(ctx context.Context, req *contactcenterinsightspb.CreateAnalysisRequest, opts ...gax.CallOption) (*CreateAnalysisOperation, error) {
4803 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
4804 body := req.GetAnalysis()
4805 jsonReq, err := m.Marshal(body)
4806 if err != nil {
4807 return nil, err
4808 }
4809
4810 baseUrl, err := url.Parse(c.endpoint)
4811 if err != nil {
4812 return nil, err
4813 }
4814 baseUrl.Path += fmt.Sprintf("/v1/%v/analyses", req.GetParent())
4815
4816 params := url.Values{}
4817 params.Add("$alt", "json;enum-encoding=int")
4818
4819 baseUrl.RawQuery = params.Encode()
4820
4821 // Build HTTP headers from client and context metadata.
4822 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
4823
4824 hds = append(c.xGoogHeaders, hds...)
4825 hds = append(hds, "Content-Type", "application/json")
4826 headers := gax.BuildHeaders(ctx, hds...)
4827 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
4828 resp := &longrunningpb.Operation{}
4829 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4830 if settings.Path != "" {
4831 baseUrl.Path = settings.Path
4832 }
4833 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
4834 if err != nil {
4835 return err
4836 }
4837 httpReq = httpReq.WithContext(ctx)
4838 httpReq.Header = headers
4839
4840 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreateAnalysis")
4841 if err != nil {
4842 return err
4843 }
4844 if err := unm.Unmarshal(buf, resp); err != nil {
4845 return err
4846 }
4847
4848 return nil
4849 }, opts...)
4850 if e != nil {
4851 return nil, e
4852 }
4853
4854 override := fmt.Sprintf("/v1/%s", resp.GetName())
4855 return &CreateAnalysisOperation{
4856 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
4857 pollPath: override,
4858 }, nil
4859 }
4860
4861 // GetAnalysis gets an analysis.
4862 func (c *restClient) GetAnalysis(ctx context.Context, req *contactcenterinsightspb.GetAnalysisRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Analysis, error) {
4863 baseUrl, err := url.Parse(c.endpoint)
4864 if err != nil {
4865 return nil, err
4866 }
4867 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
4868
4869 params := url.Values{}
4870 params.Add("$alt", "json;enum-encoding=int")
4871
4872 baseUrl.RawQuery = params.Encode()
4873
4874 // Build HTTP headers from client and context metadata.
4875 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
4876
4877 hds = append(c.xGoogHeaders, hds...)
4878 hds = append(hds, "Content-Type", "application/json")
4879 headers := gax.BuildHeaders(ctx, hds...)
4880 opts = append((*c.CallOptions).GetAnalysis[0:len((*c.CallOptions).GetAnalysis):len((*c.CallOptions).GetAnalysis)], opts...)
4881 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
4882 resp := &contactcenterinsightspb.Analysis{}
4883 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4884 if settings.Path != "" {
4885 baseUrl.Path = settings.Path
4886 }
4887 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
4888 if err != nil {
4889 return err
4890 }
4891 httpReq = httpReq.WithContext(ctx)
4892 httpReq.Header = headers
4893
4894 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetAnalysis")
4895 if err != nil {
4896 return err
4897 }
4898
4899 if err := unm.Unmarshal(buf, resp); err != nil {
4900 return err
4901 }
4902
4903 return nil
4904 }, opts...)
4905 if e != nil {
4906 return nil, e
4907 }
4908 return resp, nil
4909 }
4910
4911 // ListAnalyses lists analyses.
4912 func (c *restClient) ListAnalyses(ctx context.Context, req *contactcenterinsightspb.ListAnalysesRequest, opts ...gax.CallOption) *AnalysisIterator {
4913 it := &AnalysisIterator{}
4914 req = proto.Clone(req).(*contactcenterinsightspb.ListAnalysesRequest)
4915 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
4916 it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.Analysis, string, error) {
4917 resp := &contactcenterinsightspb.ListAnalysesResponse{}
4918 if pageToken != "" {
4919 req.PageToken = pageToken
4920 }
4921 if pageSize > math.MaxInt32 {
4922 req.PageSize = math.MaxInt32
4923 } else if pageSize != 0 {
4924 req.PageSize = int32(pageSize)
4925 }
4926 baseUrl, err := url.Parse(c.endpoint)
4927 if err != nil {
4928 return nil, "", err
4929 }
4930 baseUrl.Path += fmt.Sprintf("/v1/%v/analyses", req.GetParent())
4931
4932 params := url.Values{}
4933 params.Add("$alt", "json;enum-encoding=int")
4934 if req.GetFilter() != "" {
4935 params.Add("filter", fmt.Sprintf("%v", req.GetFilter()))
4936 }
4937 if req.GetPageSize() != 0 {
4938 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
4939 }
4940 if req.GetPageToken() != "" {
4941 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
4942 }
4943
4944 baseUrl.RawQuery = params.Encode()
4945
4946 // Build HTTP headers from client and context metadata.
4947 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
4948 headers := gax.BuildHeaders(ctx, hds...)
4949 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4950 if settings.Path != "" {
4951 baseUrl.Path = settings.Path
4952 }
4953 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
4954 if err != nil {
4955 return err
4956 }
4957 httpReq.Header = headers
4958
4959 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListAnalyses")
4960 if err != nil {
4961 return err
4962 }
4963 if err := unm.Unmarshal(buf, resp); err != nil {
4964 return err
4965 }
4966
4967 return nil
4968 }, opts...)
4969 if e != nil {
4970 return nil, "", e
4971 }
4972 it.Response = resp
4973 return resp.GetAnalyses(), resp.GetNextPageToken(), nil
4974 }
4975
4976 fetch := func(pageSize int, pageToken string) (string, error) {
4977 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
4978 if err != nil {
4979 return "", err
4980 }
4981 it.items = append(it.items, items...)
4982 return nextPageToken, nil
4983 }
4984
4985 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
4986 it.pageInfo.MaxSize = int(req.GetPageSize())
4987 it.pageInfo.Token = req.GetPageToken()
4988
4989 return it
4990 }
4991
4992 // DeleteAnalysis deletes an analysis.
4993 func (c *restClient) DeleteAnalysis(ctx context.Context, req *contactcenterinsightspb.DeleteAnalysisRequest, opts ...gax.CallOption) error {
4994 baseUrl, err := url.Parse(c.endpoint)
4995 if err != nil {
4996 return err
4997 }
4998 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
4999
5000 params := url.Values{}
5001 params.Add("$alt", "json;enum-encoding=int")
5002
5003 baseUrl.RawQuery = params.Encode()
5004
5005 // Build HTTP headers from client and context metadata.
5006 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
5007
5008 hds = append(c.xGoogHeaders, hds...)
5009 hds = append(hds, "Content-Type", "application/json")
5010 headers := gax.BuildHeaders(ctx, hds...)
5011 return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
5012 if settings.Path != "" {
5013 baseUrl.Path = settings.Path
5014 }
5015 httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil)
5016 if err != nil {
5017 return err
5018 }
5019 httpReq = httpReq.WithContext(ctx)
5020 httpReq.Header = headers
5021
5022 _, err = executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteAnalysis")
5023 return err
5024 }, opts...)
5025 }
5026
5027 // BulkAnalyzeConversations analyzes multiple conversations in a single request.
5028 func (c *restClient) BulkAnalyzeConversations(ctx context.Context, req *contactcenterinsightspb.BulkAnalyzeConversationsRequest, opts ...gax.CallOption) (*BulkAnalyzeConversationsOperation, error) {
5029 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
5030 jsonReq, err := m.Marshal(req)
5031 if err != nil {
5032 return nil, err
5033 }
5034
5035 baseUrl, err := url.Parse(c.endpoint)
5036 if err != nil {
5037 return nil, err
5038 }
5039 baseUrl.Path += fmt.Sprintf("/v1/%v/conversations:bulkAnalyze", req.GetParent())
5040
5041 params := url.Values{}
5042 params.Add("$alt", "json;enum-encoding=int")
5043
5044 baseUrl.RawQuery = params.Encode()
5045
5046 // Build HTTP headers from client and context metadata.
5047 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
5048
5049 hds = append(c.xGoogHeaders, hds...)
5050 hds = append(hds, "Content-Type", "application/json")
5051 headers := gax.BuildHeaders(ctx, hds...)
5052 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
5053 resp := &longrunningpb.Operation{}
5054 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
5055 if settings.Path != "" {
5056 baseUrl.Path = settings.Path
5057 }
5058 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
5059 if err != nil {
5060 return err
5061 }
5062 httpReq = httpReq.WithContext(ctx)
5063 httpReq.Header = headers
5064
5065 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "BulkAnalyzeConversations")
5066 if err != nil {
5067 return err
5068 }
5069 if err := unm.Unmarshal(buf, resp); err != nil {
5070 return err
5071 }
5072
5073 return nil
5074 }, opts...)
5075 if e != nil {
5076 return nil, e
5077 }
5078
5079 override := fmt.Sprintf("/v1/%s", resp.GetName())
5080 return &BulkAnalyzeConversationsOperation{
5081 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
5082 pollPath: override,
5083 }, nil
5084 }
5085
5086 // BulkDeleteConversations deletes multiple conversations in a single request.
5087 func (c *restClient) BulkDeleteConversations(ctx context.Context, req *contactcenterinsightspb.BulkDeleteConversationsRequest, opts ...gax.CallOption) (*BulkDeleteConversationsOperation, error) {
5088 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
5089 jsonReq, err := m.Marshal(req)
5090 if err != nil {
5091 return nil, err
5092 }
5093
5094 baseUrl, err := url.Parse(c.endpoint)
5095 if err != nil {
5096 return nil, err
5097 }
5098 baseUrl.Path += fmt.Sprintf("/v1/%v/conversations:bulkDelete", req.GetParent())
5099
5100 params := url.Values{}
5101 params.Add("$alt", "json;enum-encoding=int")
5102
5103 baseUrl.RawQuery = params.Encode()
5104
5105 // Build HTTP headers from client and context metadata.
5106 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
5107
5108 hds = append(c.xGoogHeaders, hds...)
5109 hds = append(hds, "Content-Type", "application/json")
5110 headers := gax.BuildHeaders(ctx, hds...)
5111 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
5112 resp := &longrunningpb.Operation{}
5113 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
5114 if settings.Path != "" {
5115 baseUrl.Path = settings.Path
5116 }
5117 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
5118 if err != nil {
5119 return err
5120 }
5121 httpReq = httpReq.WithContext(ctx)
5122 httpReq.Header = headers
5123
5124 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "BulkDeleteConversations")
5125 if err != nil {
5126 return err
5127 }
5128 if err := unm.Unmarshal(buf, resp); err != nil {
5129 return err
5130 }
5131
5132 return nil
5133 }, opts...)
5134 if e != nil {
5135 return nil, e
5136 }
5137
5138 override := fmt.Sprintf("/v1/%s", resp.GetName())
5139 return &BulkDeleteConversationsOperation{
5140 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
5141 pollPath: override,
5142 }, nil
5143 }
5144
5145 // IngestConversations imports conversations and processes them according to the user’s
5146 // configuration.
5147 func (c *restClient) IngestConversations(ctx context.Context, req *contactcenterinsightspb.IngestConversationsRequest, opts ...gax.CallOption) (*IngestConversationsOperation, error) {
5148 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
5149 jsonReq, err := m.Marshal(req)
5150 if err != nil {
5151 return nil, err
5152 }
5153
5154 baseUrl, err := url.Parse(c.endpoint)
5155 if err != nil {
5156 return nil, err
5157 }
5158 baseUrl.Path += fmt.Sprintf("/v1/%v/conversations:ingest", req.GetParent())
5159
5160 params := url.Values{}
5161 params.Add("$alt", "json;enum-encoding=int")
5162
5163 baseUrl.RawQuery = params.Encode()
5164
5165 // Build HTTP headers from client and context metadata.
5166 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
5167
5168 hds = append(c.xGoogHeaders, hds...)
5169 hds = append(hds, "Content-Type", "application/json")
5170 headers := gax.BuildHeaders(ctx, hds...)
5171 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
5172 resp := &longrunningpb.Operation{}
5173 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
5174 if settings.Path != "" {
5175 baseUrl.Path = settings.Path
5176 }
5177 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
5178 if err != nil {
5179 return err
5180 }
5181 httpReq = httpReq.WithContext(ctx)
5182 httpReq.Header = headers
5183
5184 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "IngestConversations")
5185 if err != nil {
5186 return err
5187 }
5188 if err := unm.Unmarshal(buf, resp); err != nil {
5189 return err
5190 }
5191
5192 return nil
5193 }, opts...)
5194 if e != nil {
5195 return nil, e
5196 }
5197
5198 override := fmt.Sprintf("/v1/%s", resp.GetName())
5199 return &IngestConversationsOperation{
5200 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
5201 pollPath: override,
5202 }, nil
5203 }
5204
5205 // ExportInsightsData export insights data to a destination defined in the request body.
5206 func (c *restClient) ExportInsightsData(ctx context.Context, req *contactcenterinsightspb.ExportInsightsDataRequest, opts ...gax.CallOption) (*ExportInsightsDataOperation, error) {
5207 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
5208 jsonReq, err := m.Marshal(req)
5209 if err != nil {
5210 return nil, err
5211 }
5212
5213 baseUrl, err := url.Parse(c.endpoint)
5214 if err != nil {
5215 return nil, err
5216 }
5217 baseUrl.Path += fmt.Sprintf("/v1/%v/insightsdata:export", req.GetParent())
5218
5219 params := url.Values{}
5220 params.Add("$alt", "json;enum-encoding=int")
5221
5222 baseUrl.RawQuery = params.Encode()
5223
5224 // Build HTTP headers from client and context metadata.
5225 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
5226
5227 hds = append(c.xGoogHeaders, hds...)
5228 hds = append(hds, "Content-Type", "application/json")
5229 headers := gax.BuildHeaders(ctx, hds...)
5230 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
5231 resp := &longrunningpb.Operation{}
5232 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
5233 if settings.Path != "" {
5234 baseUrl.Path = settings.Path
5235 }
5236 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
5237 if err != nil {
5238 return err
5239 }
5240 httpReq = httpReq.WithContext(ctx)
5241 httpReq.Header = headers
5242
5243 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "ExportInsightsData")
5244 if err != nil {
5245 return err
5246 }
5247 if err := unm.Unmarshal(buf, resp); err != nil {
5248 return err
5249 }
5250
5251 return nil
5252 }, opts...)
5253 if e != nil {
5254 return nil, e
5255 }
5256
5257 override := fmt.Sprintf("/v1/%s", resp.GetName())
5258 return &ExportInsightsDataOperation{
5259 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
5260 pollPath: override,
5261 }, nil
5262 }
5263
5264 // CreateIssueModel creates an issue model.
5265 func (c *restClient) CreateIssueModel(ctx context.Context, req *contactcenterinsightspb.CreateIssueModelRequest, opts ...gax.CallOption) (*CreateIssueModelOperation, error) {
5266 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
5267 body := req.GetIssueModel()
5268 jsonReq, err := m.Marshal(body)
5269 if err != nil {
5270 return nil, err
5271 }
5272
5273 baseUrl, err := url.Parse(c.endpoint)
5274 if err != nil {
5275 return nil, err
5276 }
5277 baseUrl.Path += fmt.Sprintf("/v1/%v/issueModels", req.GetParent())
5278
5279 params := url.Values{}
5280 params.Add("$alt", "json;enum-encoding=int")
5281
5282 baseUrl.RawQuery = params.Encode()
5283
5284 // Build HTTP headers from client and context metadata.
5285 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
5286
5287 hds = append(c.xGoogHeaders, hds...)
5288 hds = append(hds, "Content-Type", "application/json")
5289 headers := gax.BuildHeaders(ctx, hds...)
5290 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
5291 resp := &longrunningpb.Operation{}
5292 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
5293 if settings.Path != "" {
5294 baseUrl.Path = settings.Path
5295 }
5296 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
5297 if err != nil {
5298 return err
5299 }
5300 httpReq = httpReq.WithContext(ctx)
5301 httpReq.Header = headers
5302
5303 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreateIssueModel")
5304 if err != nil {
5305 return err
5306 }
5307 if err := unm.Unmarshal(buf, resp); err != nil {
5308 return err
5309 }
5310
5311 return nil
5312 }, opts...)
5313 if e != nil {
5314 return nil, e
5315 }
5316
5317 override := fmt.Sprintf("/v1/%s", resp.GetName())
5318 return &CreateIssueModelOperation{
5319 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
5320 pollPath: override,
5321 }, nil
5322 }
5323
5324 // UpdateIssueModel updates an issue model.
5325 func (c *restClient) UpdateIssueModel(ctx context.Context, req *contactcenterinsightspb.UpdateIssueModelRequest, opts ...gax.CallOption) (*contactcenterinsightspb.IssueModel, error) {
5326 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
5327 body := req.GetIssueModel()
5328 jsonReq, err := m.Marshal(body)
5329 if err != nil {
5330 return nil, err
5331 }
5332
5333 baseUrl, err := url.Parse(c.endpoint)
5334 if err != nil {
5335 return nil, err
5336 }
5337 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetIssueModel().GetName())
5338
5339 params := url.Values{}
5340 params.Add("$alt", "json;enum-encoding=int")
5341 if req.GetUpdateMask() != nil {
5342 field, err := protojson.Marshal(req.GetUpdateMask())
5343 if err != nil {
5344 return nil, err
5345 }
5346 params.Add("updateMask", string(field[1:len(field)-1]))
5347 }
5348
5349 baseUrl.RawQuery = params.Encode()
5350
5351 // Build HTTP headers from client and context metadata.
5352 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "issue_model.name", url.QueryEscape(req.GetIssueModel().GetName()))}
5353
5354 hds = append(c.xGoogHeaders, hds...)
5355 hds = append(hds, "Content-Type", "application/json")
5356 headers := gax.BuildHeaders(ctx, hds...)
5357 opts = append((*c.CallOptions).UpdateIssueModel[0:len((*c.CallOptions).UpdateIssueModel):len((*c.CallOptions).UpdateIssueModel)], opts...)
5358 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
5359 resp := &contactcenterinsightspb.IssueModel{}
5360 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
5361 if settings.Path != "" {
5362 baseUrl.Path = settings.Path
5363 }
5364 httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq))
5365 if err != nil {
5366 return err
5367 }
5368 httpReq = httpReq.WithContext(ctx)
5369 httpReq.Header = headers
5370
5371 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UpdateIssueModel")
5372 if err != nil {
5373 return err
5374 }
5375
5376 if err := unm.Unmarshal(buf, resp); err != nil {
5377 return err
5378 }
5379
5380 return nil
5381 }, opts...)
5382 if e != nil {
5383 return nil, e
5384 }
5385 return resp, nil
5386 }
5387
5388 // GetIssueModel gets an issue model.
5389 func (c *restClient) GetIssueModel(ctx context.Context, req *contactcenterinsightspb.GetIssueModelRequest, opts ...gax.CallOption) (*contactcenterinsightspb.IssueModel, error) {
5390 baseUrl, err := url.Parse(c.endpoint)
5391 if err != nil {
5392 return nil, err
5393 }
5394 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
5395
5396 params := url.Values{}
5397 params.Add("$alt", "json;enum-encoding=int")
5398
5399 baseUrl.RawQuery = params.Encode()
5400
5401 // Build HTTP headers from client and context metadata.
5402 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
5403
5404 hds = append(c.xGoogHeaders, hds...)
5405 hds = append(hds, "Content-Type", "application/json")
5406 headers := gax.BuildHeaders(ctx, hds...)
5407 opts = append((*c.CallOptions).GetIssueModel[0:len((*c.CallOptions).GetIssueModel):len((*c.CallOptions).GetIssueModel)], opts...)
5408 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
5409 resp := &contactcenterinsightspb.IssueModel{}
5410 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
5411 if settings.Path != "" {
5412 baseUrl.Path = settings.Path
5413 }
5414 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
5415 if err != nil {
5416 return err
5417 }
5418 httpReq = httpReq.WithContext(ctx)
5419 httpReq.Header = headers
5420
5421 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetIssueModel")
5422 if err != nil {
5423 return err
5424 }
5425
5426 if err := unm.Unmarshal(buf, resp); err != nil {
5427 return err
5428 }
5429
5430 return nil
5431 }, opts...)
5432 if e != nil {
5433 return nil, e
5434 }
5435 return resp, nil
5436 }
5437
5438 // ListIssueModels lists issue models.
5439 func (c *restClient) ListIssueModels(ctx context.Context, req *contactcenterinsightspb.ListIssueModelsRequest, opts ...gax.CallOption) (*contactcenterinsightspb.ListIssueModelsResponse, error) {
5440 baseUrl, err := url.Parse(c.endpoint)
5441 if err != nil {
5442 return nil, err
5443 }
5444 baseUrl.Path += fmt.Sprintf("/v1/%v/issueModels", req.GetParent())
5445
5446 params := url.Values{}
5447 params.Add("$alt", "json;enum-encoding=int")
5448
5449 baseUrl.RawQuery = params.Encode()
5450
5451 // Build HTTP headers from client and context metadata.
5452 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
5453
5454 hds = append(c.xGoogHeaders, hds...)
5455 hds = append(hds, "Content-Type", "application/json")
5456 headers := gax.BuildHeaders(ctx, hds...)
5457 opts = append((*c.CallOptions).ListIssueModels[0:len((*c.CallOptions).ListIssueModels):len((*c.CallOptions).ListIssueModels)], opts...)
5458 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
5459 resp := &contactcenterinsightspb.ListIssueModelsResponse{}
5460 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
5461 if settings.Path != "" {
5462 baseUrl.Path = settings.Path
5463 }
5464 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
5465 if err != nil {
5466 return err
5467 }
5468 httpReq = httpReq.WithContext(ctx)
5469 httpReq.Header = headers
5470
5471 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListIssueModels")
5472 if err != nil {
5473 return err
5474 }
5475
5476 if err := unm.Unmarshal(buf, resp); err != nil {
5477 return err
5478 }
5479
5480 return nil
5481 }, opts...)
5482 if e != nil {
5483 return nil, e
5484 }
5485 return resp, nil
5486 }
5487
5488 // DeleteIssueModel deletes an issue model.
5489 func (c *restClient) DeleteIssueModel(ctx context.Context, req *contactcenterinsightspb.DeleteIssueModelRequest, opts ...gax.CallOption) (*DeleteIssueModelOperation, error) {
5490 baseUrl, err := url.Parse(c.endpoint)
5491 if err != nil {
5492 return nil, err
5493 }
5494 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
5495
5496 params := url.Values{}
5497 params.Add("$alt", "json;enum-encoding=int")
5498
5499 baseUrl.RawQuery = params.Encode()
5500
5501 // Build HTTP headers from client and context metadata.
5502 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
5503
5504 hds = append(c.xGoogHeaders, hds...)
5505 hds = append(hds, "Content-Type", "application/json")
5506 headers := gax.BuildHeaders(ctx, hds...)
5507 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
5508 resp := &longrunningpb.Operation{}
5509 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
5510 if settings.Path != "" {
5511 baseUrl.Path = settings.Path
5512 }
5513 httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil)
5514 if err != nil {
5515 return err
5516 }
5517 httpReq = httpReq.WithContext(ctx)
5518 httpReq.Header = headers
5519
5520 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteIssueModel")
5521 if err != nil {
5522 return err
5523 }
5524 if err := unm.Unmarshal(buf, resp); err != nil {
5525 return err
5526 }
5527
5528 return nil
5529 }, opts...)
5530 if e != nil {
5531 return nil, e
5532 }
5533
5534 override := fmt.Sprintf("/v1/%s", resp.GetName())
5535 return &DeleteIssueModelOperation{
5536 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
5537 pollPath: override,
5538 }, nil
5539 }
5540
5541 // DeployIssueModel deploys an issue model. Returns an error if a model is already deployed.
5542 // An issue model can only be used in analysis after it has been deployed.
5543 func (c *restClient) DeployIssueModel(ctx context.Context, req *contactcenterinsightspb.DeployIssueModelRequest, opts ...gax.CallOption) (*DeployIssueModelOperation, error) {
5544 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
5545 jsonReq, err := m.Marshal(req)
5546 if err != nil {
5547 return nil, err
5548 }
5549
5550 baseUrl, err := url.Parse(c.endpoint)
5551 if err != nil {
5552 return nil, err
5553 }
5554 baseUrl.Path += fmt.Sprintf("/v1/%v:deploy", req.GetName())
5555
5556 params := url.Values{}
5557 params.Add("$alt", "json;enum-encoding=int")
5558
5559 baseUrl.RawQuery = params.Encode()
5560
5561 // Build HTTP headers from client and context metadata.
5562 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
5563
5564 hds = append(c.xGoogHeaders, hds...)
5565 hds = append(hds, "Content-Type", "application/json")
5566 headers := gax.BuildHeaders(ctx, hds...)
5567 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
5568 resp := &longrunningpb.Operation{}
5569 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
5570 if settings.Path != "" {
5571 baseUrl.Path = settings.Path
5572 }
5573 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
5574 if err != nil {
5575 return err
5576 }
5577 httpReq = httpReq.WithContext(ctx)
5578 httpReq.Header = headers
5579
5580 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "DeployIssueModel")
5581 if err != nil {
5582 return err
5583 }
5584 if err := unm.Unmarshal(buf, resp); err != nil {
5585 return err
5586 }
5587
5588 return nil
5589 }, opts...)
5590 if e != nil {
5591 return nil, e
5592 }
5593
5594 override := fmt.Sprintf("/v1/%s", resp.GetName())
5595 return &DeployIssueModelOperation{
5596 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
5597 pollPath: override,
5598 }, nil
5599 }
5600
5601 // UndeployIssueModel undeploys an issue model.
5602 // An issue model can not be used in analysis after it has been undeployed.
5603 func (c *restClient) UndeployIssueModel(ctx context.Context, req *contactcenterinsightspb.UndeployIssueModelRequest, opts ...gax.CallOption) (*UndeployIssueModelOperation, error) {
5604 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
5605 jsonReq, err := m.Marshal(req)
5606 if err != nil {
5607 return nil, err
5608 }
5609
5610 baseUrl, err := url.Parse(c.endpoint)
5611 if err != nil {
5612 return nil, err
5613 }
5614 baseUrl.Path += fmt.Sprintf("/v1/%v:undeploy", req.GetName())
5615
5616 params := url.Values{}
5617 params.Add("$alt", "json;enum-encoding=int")
5618
5619 baseUrl.RawQuery = params.Encode()
5620
5621 // Build HTTP headers from client and context metadata.
5622 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
5623
5624 hds = append(c.xGoogHeaders, hds...)
5625 hds = append(hds, "Content-Type", "application/json")
5626 headers := gax.BuildHeaders(ctx, hds...)
5627 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
5628 resp := &longrunningpb.Operation{}
5629 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
5630 if settings.Path != "" {
5631 baseUrl.Path = settings.Path
5632 }
5633 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
5634 if err != nil {
5635 return err
5636 }
5637 httpReq = httpReq.WithContext(ctx)
5638 httpReq.Header = headers
5639
5640 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UndeployIssueModel")
5641 if err != nil {
5642 return err
5643 }
5644 if err := unm.Unmarshal(buf, resp); err != nil {
5645 return err
5646 }
5647
5648 return nil
5649 }, opts...)
5650 if e != nil {
5651 return nil, e
5652 }
5653
5654 override := fmt.Sprintf("/v1/%s", resp.GetName())
5655 return &UndeployIssueModelOperation{
5656 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
5657 pollPath: override,
5658 }, nil
5659 }
5660
5661 // ExportIssueModel exports an issue model to the provided destination.
5662 func (c *restClient) ExportIssueModel(ctx context.Context, req *contactcenterinsightspb.ExportIssueModelRequest, opts ...gax.CallOption) (*ExportIssueModelOperation, error) {
5663 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
5664 jsonReq, err := m.Marshal(req)
5665 if err != nil {
5666 return nil, err
5667 }
5668
5669 baseUrl, err := url.Parse(c.endpoint)
5670 if err != nil {
5671 return nil, err
5672 }
5673 baseUrl.Path += fmt.Sprintf("/v1/%v:export", req.GetName())
5674
5675 params := url.Values{}
5676 params.Add("$alt", "json;enum-encoding=int")
5677
5678 baseUrl.RawQuery = params.Encode()
5679
5680 // Build HTTP headers from client and context metadata.
5681 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
5682
5683 hds = append(c.xGoogHeaders, hds...)
5684 hds = append(hds, "Content-Type", "application/json")
5685 headers := gax.BuildHeaders(ctx, hds...)
5686 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
5687 resp := &longrunningpb.Operation{}
5688 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
5689 if settings.Path != "" {
5690 baseUrl.Path = settings.Path
5691 }
5692 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
5693 if err != nil {
5694 return err
5695 }
5696 httpReq = httpReq.WithContext(ctx)
5697 httpReq.Header = headers
5698
5699 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "ExportIssueModel")
5700 if err != nil {
5701 return err
5702 }
5703 if err := unm.Unmarshal(buf, resp); err != nil {
5704 return err
5705 }
5706
5707 return nil
5708 }, opts...)
5709 if e != nil {
5710 return nil, e
5711 }
5712
5713 override := fmt.Sprintf("/v1/%s", resp.GetName())
5714 return &ExportIssueModelOperation{
5715 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
5716 pollPath: override,
5717 }, nil
5718 }
5719
5720 // ImportIssueModel imports an issue model from a Cloud Storage bucket.
5721 func (c *restClient) ImportIssueModel(ctx context.Context, req *contactcenterinsightspb.ImportIssueModelRequest, opts ...gax.CallOption) (*ImportIssueModelOperation, error) {
5722 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
5723 jsonReq, err := m.Marshal(req)
5724 if err != nil {
5725 return nil, err
5726 }
5727
5728 baseUrl, err := url.Parse(c.endpoint)
5729 if err != nil {
5730 return nil, err
5731 }
5732 baseUrl.Path += fmt.Sprintf("/v1/%v/issueModels:import", req.GetParent())
5733
5734 params := url.Values{}
5735 params.Add("$alt", "json;enum-encoding=int")
5736
5737 baseUrl.RawQuery = params.Encode()
5738
5739 // Build HTTP headers from client and context metadata.
5740 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
5741
5742 hds = append(c.xGoogHeaders, hds...)
5743 hds = append(hds, "Content-Type", "application/json")
5744 headers := gax.BuildHeaders(ctx, hds...)
5745 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
5746 resp := &longrunningpb.Operation{}
5747 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
5748 if settings.Path != "" {
5749 baseUrl.Path = settings.Path
5750 }
5751 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
5752 if err != nil {
5753 return err
5754 }
5755 httpReq = httpReq.WithContext(ctx)
5756 httpReq.Header = headers
5757
5758 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "ImportIssueModel")
5759 if err != nil {
5760 return err
5761 }
5762 if err := unm.Unmarshal(buf, resp); err != nil {
5763 return err
5764 }
5765
5766 return nil
5767 }, opts...)
5768 if e != nil {
5769 return nil, e
5770 }
5771
5772 override := fmt.Sprintf("/v1/%s", resp.GetName())
5773 return &ImportIssueModelOperation{
5774 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
5775 pollPath: override,
5776 }, nil
5777 }
5778
5779 // GetIssue gets an issue.
5780 func (c *restClient) GetIssue(ctx context.Context, req *contactcenterinsightspb.GetIssueRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Issue, error) {
5781 baseUrl, err := url.Parse(c.endpoint)
5782 if err != nil {
5783 return nil, err
5784 }
5785 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
5786
5787 params := url.Values{}
5788 params.Add("$alt", "json;enum-encoding=int")
5789
5790 baseUrl.RawQuery = params.Encode()
5791
5792 // Build HTTP headers from client and context metadata.
5793 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
5794
5795 hds = append(c.xGoogHeaders, hds...)
5796 hds = append(hds, "Content-Type", "application/json")
5797 headers := gax.BuildHeaders(ctx, hds...)
5798 opts = append((*c.CallOptions).GetIssue[0:len((*c.CallOptions).GetIssue):len((*c.CallOptions).GetIssue)], opts...)
5799 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
5800 resp := &contactcenterinsightspb.Issue{}
5801 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
5802 if settings.Path != "" {
5803 baseUrl.Path = settings.Path
5804 }
5805 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
5806 if err != nil {
5807 return err
5808 }
5809 httpReq = httpReq.WithContext(ctx)
5810 httpReq.Header = headers
5811
5812 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetIssue")
5813 if err != nil {
5814 return err
5815 }
5816
5817 if err := unm.Unmarshal(buf, resp); err != nil {
5818 return err
5819 }
5820
5821 return nil
5822 }, opts...)
5823 if e != nil {
5824 return nil, e
5825 }
5826 return resp, nil
5827 }
5828
5829 // ListIssues lists issues.
5830 func (c *restClient) ListIssues(ctx context.Context, req *contactcenterinsightspb.ListIssuesRequest, opts ...gax.CallOption) (*contactcenterinsightspb.ListIssuesResponse, error) {
5831 baseUrl, err := url.Parse(c.endpoint)
5832 if err != nil {
5833 return nil, err
5834 }
5835 baseUrl.Path += fmt.Sprintf("/v1/%v/issues", req.GetParent())
5836
5837 params := url.Values{}
5838 params.Add("$alt", "json;enum-encoding=int")
5839
5840 baseUrl.RawQuery = params.Encode()
5841
5842 // Build HTTP headers from client and context metadata.
5843 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
5844
5845 hds = append(c.xGoogHeaders, hds...)
5846 hds = append(hds, "Content-Type", "application/json")
5847 headers := gax.BuildHeaders(ctx, hds...)
5848 opts = append((*c.CallOptions).ListIssues[0:len((*c.CallOptions).ListIssues):len((*c.CallOptions).ListIssues)], opts...)
5849 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
5850 resp := &contactcenterinsightspb.ListIssuesResponse{}
5851 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
5852 if settings.Path != "" {
5853 baseUrl.Path = settings.Path
5854 }
5855 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
5856 if err != nil {
5857 return err
5858 }
5859 httpReq = httpReq.WithContext(ctx)
5860 httpReq.Header = headers
5861
5862 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListIssues")
5863 if err != nil {
5864 return err
5865 }
5866
5867 if err := unm.Unmarshal(buf, resp); err != nil {
5868 return err
5869 }
5870
5871 return nil
5872 }, opts...)
5873 if e != nil {
5874 return nil, e
5875 }
5876 return resp, nil
5877 }
5878
5879 // UpdateIssue updates an issue.
5880 func (c *restClient) UpdateIssue(ctx context.Context, req *contactcenterinsightspb.UpdateIssueRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Issue, error) {
5881 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
5882 body := req.GetIssue()
5883 jsonReq, err := m.Marshal(body)
5884 if err != nil {
5885 return nil, err
5886 }
5887
5888 baseUrl, err := url.Parse(c.endpoint)
5889 if err != nil {
5890 return nil, err
5891 }
5892 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetIssue().GetName())
5893
5894 params := url.Values{}
5895 params.Add("$alt", "json;enum-encoding=int")
5896 if req.GetUpdateMask() != nil {
5897 field, err := protojson.Marshal(req.GetUpdateMask())
5898 if err != nil {
5899 return nil, err
5900 }
5901 params.Add("updateMask", string(field[1:len(field)-1]))
5902 }
5903
5904 baseUrl.RawQuery = params.Encode()
5905
5906 // Build HTTP headers from client and context metadata.
5907 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "issue.name", url.QueryEscape(req.GetIssue().GetName()))}
5908
5909 hds = append(c.xGoogHeaders, hds...)
5910 hds = append(hds, "Content-Type", "application/json")
5911 headers := gax.BuildHeaders(ctx, hds...)
5912 opts = append((*c.CallOptions).UpdateIssue[0:len((*c.CallOptions).UpdateIssue):len((*c.CallOptions).UpdateIssue)], opts...)
5913 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
5914 resp := &contactcenterinsightspb.Issue{}
5915 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
5916 if settings.Path != "" {
5917 baseUrl.Path = settings.Path
5918 }
5919 httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq))
5920 if err != nil {
5921 return err
5922 }
5923 httpReq = httpReq.WithContext(ctx)
5924 httpReq.Header = headers
5925
5926 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UpdateIssue")
5927 if err != nil {
5928 return err
5929 }
5930
5931 if err := unm.Unmarshal(buf, resp); err != nil {
5932 return err
5933 }
5934
5935 return nil
5936 }, opts...)
5937 if e != nil {
5938 return nil, e
5939 }
5940 return resp, nil
5941 }
5942
5943 // DeleteIssue deletes an issue.
5944 func (c *restClient) DeleteIssue(ctx context.Context, req *contactcenterinsightspb.DeleteIssueRequest, opts ...gax.CallOption) error {
5945 baseUrl, err := url.Parse(c.endpoint)
5946 if err != nil {
5947 return err
5948 }
5949 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
5950
5951 params := url.Values{}
5952 params.Add("$alt", "json;enum-encoding=int")
5953
5954 baseUrl.RawQuery = params.Encode()
5955
5956 // Build HTTP headers from client and context metadata.
5957 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
5958
5959 hds = append(c.xGoogHeaders, hds...)
5960 hds = append(hds, "Content-Type", "application/json")
5961 headers := gax.BuildHeaders(ctx, hds...)
5962 return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
5963 if settings.Path != "" {
5964 baseUrl.Path = settings.Path
5965 }
5966 httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil)
5967 if err != nil {
5968 return err
5969 }
5970 httpReq = httpReq.WithContext(ctx)
5971 httpReq.Header = headers
5972
5973 _, err = executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteIssue")
5974 return err
5975 }, opts...)
5976 }
5977
5978 // CalculateIssueModelStats gets an issue model’s statistics.
5979 func (c *restClient) CalculateIssueModelStats(ctx context.Context, req *contactcenterinsightspb.CalculateIssueModelStatsRequest, opts ...gax.CallOption) (*contactcenterinsightspb.CalculateIssueModelStatsResponse, error) {
5980 baseUrl, err := url.Parse(c.endpoint)
5981 if err != nil {
5982 return nil, err
5983 }
5984 baseUrl.Path += fmt.Sprintf("/v1/%v:calculateIssueModelStats", req.GetIssueModel())
5985
5986 params := url.Values{}
5987 params.Add("$alt", "json;enum-encoding=int")
5988
5989 baseUrl.RawQuery = params.Encode()
5990
5991 // Build HTTP headers from client and context metadata.
5992 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "issue_model", url.QueryEscape(req.GetIssueModel()))}
5993
5994 hds = append(c.xGoogHeaders, hds...)
5995 hds = append(hds, "Content-Type", "application/json")
5996 headers := gax.BuildHeaders(ctx, hds...)
5997 opts = append((*c.CallOptions).CalculateIssueModelStats[0:len((*c.CallOptions).CalculateIssueModelStats):len((*c.CallOptions).CalculateIssueModelStats)], opts...)
5998 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
5999 resp := &contactcenterinsightspb.CalculateIssueModelStatsResponse{}
6000 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
6001 if settings.Path != "" {
6002 baseUrl.Path = settings.Path
6003 }
6004 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
6005 if err != nil {
6006 return err
6007 }
6008 httpReq = httpReq.WithContext(ctx)
6009 httpReq.Header = headers
6010
6011 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "CalculateIssueModelStats")
6012 if err != nil {
6013 return err
6014 }
6015
6016 if err := unm.Unmarshal(buf, resp); err != nil {
6017 return err
6018 }
6019
6020 return nil
6021 }, opts...)
6022 if e != nil {
6023 return nil, e
6024 }
6025 return resp, nil
6026 }
6027
6028 // CreatePhraseMatcher creates a phrase matcher.
6029 func (c *restClient) CreatePhraseMatcher(ctx context.Context, req *contactcenterinsightspb.CreatePhraseMatcherRequest, opts ...gax.CallOption) (*contactcenterinsightspb.PhraseMatcher, error) {
6030 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
6031 body := req.GetPhraseMatcher()
6032 jsonReq, err := m.Marshal(body)
6033 if err != nil {
6034 return nil, err
6035 }
6036
6037 baseUrl, err := url.Parse(c.endpoint)
6038 if err != nil {
6039 return nil, err
6040 }
6041 baseUrl.Path += fmt.Sprintf("/v1/%v/phraseMatchers", req.GetParent())
6042
6043 params := url.Values{}
6044 params.Add("$alt", "json;enum-encoding=int")
6045
6046 baseUrl.RawQuery = params.Encode()
6047
6048 // Build HTTP headers from client and context metadata.
6049 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
6050
6051 hds = append(c.xGoogHeaders, hds...)
6052 hds = append(hds, "Content-Type", "application/json")
6053 headers := gax.BuildHeaders(ctx, hds...)
6054 opts = append((*c.CallOptions).CreatePhraseMatcher[0:len((*c.CallOptions).CreatePhraseMatcher):len((*c.CallOptions).CreatePhraseMatcher)], opts...)
6055 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
6056 resp := &contactcenterinsightspb.PhraseMatcher{}
6057 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
6058 if settings.Path != "" {
6059 baseUrl.Path = settings.Path
6060 }
6061 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
6062 if err != nil {
6063 return err
6064 }
6065 httpReq = httpReq.WithContext(ctx)
6066 httpReq.Header = headers
6067
6068 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreatePhraseMatcher")
6069 if err != nil {
6070 return err
6071 }
6072
6073 if err := unm.Unmarshal(buf, resp); err != nil {
6074 return err
6075 }
6076
6077 return nil
6078 }, opts...)
6079 if e != nil {
6080 return nil, e
6081 }
6082 return resp, nil
6083 }
6084
6085 // GetPhraseMatcher gets a phrase matcher.
6086 func (c *restClient) GetPhraseMatcher(ctx context.Context, req *contactcenterinsightspb.GetPhraseMatcherRequest, opts ...gax.CallOption) (*contactcenterinsightspb.PhraseMatcher, error) {
6087 baseUrl, err := url.Parse(c.endpoint)
6088 if err != nil {
6089 return nil, err
6090 }
6091 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
6092
6093 params := url.Values{}
6094 params.Add("$alt", "json;enum-encoding=int")
6095
6096 baseUrl.RawQuery = params.Encode()
6097
6098 // Build HTTP headers from client and context metadata.
6099 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
6100
6101 hds = append(c.xGoogHeaders, hds...)
6102 hds = append(hds, "Content-Type", "application/json")
6103 headers := gax.BuildHeaders(ctx, hds...)
6104 opts = append((*c.CallOptions).GetPhraseMatcher[0:len((*c.CallOptions).GetPhraseMatcher):len((*c.CallOptions).GetPhraseMatcher)], opts...)
6105 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
6106 resp := &contactcenterinsightspb.PhraseMatcher{}
6107 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
6108 if settings.Path != "" {
6109 baseUrl.Path = settings.Path
6110 }
6111 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
6112 if err != nil {
6113 return err
6114 }
6115 httpReq = httpReq.WithContext(ctx)
6116 httpReq.Header = headers
6117
6118 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetPhraseMatcher")
6119 if err != nil {
6120 return err
6121 }
6122
6123 if err := unm.Unmarshal(buf, resp); err != nil {
6124 return err
6125 }
6126
6127 return nil
6128 }, opts...)
6129 if e != nil {
6130 return nil, e
6131 }
6132 return resp, nil
6133 }
6134
6135 // ListPhraseMatchers lists phrase matchers.
6136 func (c *restClient) ListPhraseMatchers(ctx context.Context, req *contactcenterinsightspb.ListPhraseMatchersRequest, opts ...gax.CallOption) *PhraseMatcherIterator {
6137 it := &PhraseMatcherIterator{}
6138 req = proto.Clone(req).(*contactcenterinsightspb.ListPhraseMatchersRequest)
6139 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
6140 it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.PhraseMatcher, string, error) {
6141 resp := &contactcenterinsightspb.ListPhraseMatchersResponse{}
6142 if pageToken != "" {
6143 req.PageToken = pageToken
6144 }
6145 if pageSize > math.MaxInt32 {
6146 req.PageSize = math.MaxInt32
6147 } else if pageSize != 0 {
6148 req.PageSize = int32(pageSize)
6149 }
6150 baseUrl, err := url.Parse(c.endpoint)
6151 if err != nil {
6152 return nil, "", err
6153 }
6154 baseUrl.Path += fmt.Sprintf("/v1/%v/phraseMatchers", req.GetParent())
6155
6156 params := url.Values{}
6157 params.Add("$alt", "json;enum-encoding=int")
6158 if req.GetFilter() != "" {
6159 params.Add("filter", fmt.Sprintf("%v", req.GetFilter()))
6160 }
6161 if req.GetPageSize() != 0 {
6162 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
6163 }
6164 if req.GetPageToken() != "" {
6165 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
6166 }
6167
6168 baseUrl.RawQuery = params.Encode()
6169
6170 // Build HTTP headers from client and context metadata.
6171 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
6172 headers := gax.BuildHeaders(ctx, hds...)
6173 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
6174 if settings.Path != "" {
6175 baseUrl.Path = settings.Path
6176 }
6177 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
6178 if err != nil {
6179 return err
6180 }
6181 httpReq.Header = headers
6182
6183 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListPhraseMatchers")
6184 if err != nil {
6185 return err
6186 }
6187 if err := unm.Unmarshal(buf, resp); err != nil {
6188 return err
6189 }
6190
6191 return nil
6192 }, opts...)
6193 if e != nil {
6194 return nil, "", e
6195 }
6196 it.Response = resp
6197 return resp.GetPhraseMatchers(), resp.GetNextPageToken(), nil
6198 }
6199
6200 fetch := func(pageSize int, pageToken string) (string, error) {
6201 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
6202 if err != nil {
6203 return "", err
6204 }
6205 it.items = append(it.items, items...)
6206 return nextPageToken, nil
6207 }
6208
6209 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
6210 it.pageInfo.MaxSize = int(req.GetPageSize())
6211 it.pageInfo.Token = req.GetPageToken()
6212
6213 return it
6214 }
6215
6216 // DeletePhraseMatcher deletes a phrase matcher.
6217 func (c *restClient) DeletePhraseMatcher(ctx context.Context, req *contactcenterinsightspb.DeletePhraseMatcherRequest, opts ...gax.CallOption) error {
6218 baseUrl, err := url.Parse(c.endpoint)
6219 if err != nil {
6220 return err
6221 }
6222 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
6223
6224 params := url.Values{}
6225 params.Add("$alt", "json;enum-encoding=int")
6226
6227 baseUrl.RawQuery = params.Encode()
6228
6229 // Build HTTP headers from client and context metadata.
6230 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
6231
6232 hds = append(c.xGoogHeaders, hds...)
6233 hds = append(hds, "Content-Type", "application/json")
6234 headers := gax.BuildHeaders(ctx, hds...)
6235 return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
6236 if settings.Path != "" {
6237 baseUrl.Path = settings.Path
6238 }
6239 httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil)
6240 if err != nil {
6241 return err
6242 }
6243 httpReq = httpReq.WithContext(ctx)
6244 httpReq.Header = headers
6245
6246 _, err = executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeletePhraseMatcher")
6247 return err
6248 }, opts...)
6249 }
6250
6251 // UpdatePhraseMatcher updates a phrase matcher.
6252 func (c *restClient) UpdatePhraseMatcher(ctx context.Context, req *contactcenterinsightspb.UpdatePhraseMatcherRequest, opts ...gax.CallOption) (*contactcenterinsightspb.PhraseMatcher, error) {
6253 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
6254 body := req.GetPhraseMatcher()
6255 jsonReq, err := m.Marshal(body)
6256 if err != nil {
6257 return nil, err
6258 }
6259
6260 baseUrl, err := url.Parse(c.endpoint)
6261 if err != nil {
6262 return nil, err
6263 }
6264 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetPhraseMatcher().GetName())
6265
6266 params := url.Values{}
6267 params.Add("$alt", "json;enum-encoding=int")
6268 if req.GetUpdateMask() != nil {
6269 field, err := protojson.Marshal(req.GetUpdateMask())
6270 if err != nil {
6271 return nil, err
6272 }
6273 params.Add("updateMask", string(field[1:len(field)-1]))
6274 }
6275
6276 baseUrl.RawQuery = params.Encode()
6277
6278 // Build HTTP headers from client and context metadata.
6279 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "phrase_matcher.name", url.QueryEscape(req.GetPhraseMatcher().GetName()))}
6280
6281 hds = append(c.xGoogHeaders, hds...)
6282 hds = append(hds, "Content-Type", "application/json")
6283 headers := gax.BuildHeaders(ctx, hds...)
6284 opts = append((*c.CallOptions).UpdatePhraseMatcher[0:len((*c.CallOptions).UpdatePhraseMatcher):len((*c.CallOptions).UpdatePhraseMatcher)], opts...)
6285 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
6286 resp := &contactcenterinsightspb.PhraseMatcher{}
6287 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
6288 if settings.Path != "" {
6289 baseUrl.Path = settings.Path
6290 }
6291 httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq))
6292 if err != nil {
6293 return err
6294 }
6295 httpReq = httpReq.WithContext(ctx)
6296 httpReq.Header = headers
6297
6298 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UpdatePhraseMatcher")
6299 if err != nil {
6300 return err
6301 }
6302
6303 if err := unm.Unmarshal(buf, resp); err != nil {
6304 return err
6305 }
6306
6307 return nil
6308 }, opts...)
6309 if e != nil {
6310 return nil, e
6311 }
6312 return resp, nil
6313 }
6314
6315 // CalculateStats gets conversation statistics.
6316 func (c *restClient) CalculateStats(ctx context.Context, req *contactcenterinsightspb.CalculateStatsRequest, opts ...gax.CallOption) (*contactcenterinsightspb.CalculateStatsResponse, error) {
6317 baseUrl, err := url.Parse(c.endpoint)
6318 if err != nil {
6319 return nil, err
6320 }
6321 baseUrl.Path += fmt.Sprintf("/v1/%v/conversations:calculateStats", req.GetLocation())
6322
6323 params := url.Values{}
6324 params.Add("$alt", "json;enum-encoding=int")
6325 if req.GetFilter() != "" {
6326 params.Add("filter", fmt.Sprintf("%v", req.GetFilter()))
6327 }
6328
6329 baseUrl.RawQuery = params.Encode()
6330
6331 // Build HTTP headers from client and context metadata.
6332 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "location", url.QueryEscape(req.GetLocation()))}
6333
6334 hds = append(c.xGoogHeaders, hds...)
6335 hds = append(hds, "Content-Type", "application/json")
6336 headers := gax.BuildHeaders(ctx, hds...)
6337 opts = append((*c.CallOptions).CalculateStats[0:len((*c.CallOptions).CalculateStats):len((*c.CallOptions).CalculateStats)], opts...)
6338 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
6339 resp := &contactcenterinsightspb.CalculateStatsResponse{}
6340 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
6341 if settings.Path != "" {
6342 baseUrl.Path = settings.Path
6343 }
6344 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
6345 if err != nil {
6346 return err
6347 }
6348 httpReq = httpReq.WithContext(ctx)
6349 httpReq.Header = headers
6350
6351 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "CalculateStats")
6352 if err != nil {
6353 return err
6354 }
6355
6356 if err := unm.Unmarshal(buf, resp); err != nil {
6357 return err
6358 }
6359
6360 return nil
6361 }, opts...)
6362 if e != nil {
6363 return nil, e
6364 }
6365 return resp, nil
6366 }
6367
6368 // GetSettings gets project-level settings.
6369 func (c *restClient) GetSettings(ctx context.Context, req *contactcenterinsightspb.GetSettingsRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Settings, error) {
6370 baseUrl, err := url.Parse(c.endpoint)
6371 if err != nil {
6372 return nil, err
6373 }
6374 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
6375
6376 params := url.Values{}
6377 params.Add("$alt", "json;enum-encoding=int")
6378
6379 baseUrl.RawQuery = params.Encode()
6380
6381 // Build HTTP headers from client and context metadata.
6382 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
6383
6384 hds = append(c.xGoogHeaders, hds...)
6385 hds = append(hds, "Content-Type", "application/json")
6386 headers := gax.BuildHeaders(ctx, hds...)
6387 opts = append((*c.CallOptions).GetSettings[0:len((*c.CallOptions).GetSettings):len((*c.CallOptions).GetSettings)], opts...)
6388 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
6389 resp := &contactcenterinsightspb.Settings{}
6390 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
6391 if settings.Path != "" {
6392 baseUrl.Path = settings.Path
6393 }
6394 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
6395 if err != nil {
6396 return err
6397 }
6398 httpReq = httpReq.WithContext(ctx)
6399 httpReq.Header = headers
6400
6401 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetSettings")
6402 if err != nil {
6403 return err
6404 }
6405
6406 if err := unm.Unmarshal(buf, resp); err != nil {
6407 return err
6408 }
6409
6410 return nil
6411 }, opts...)
6412 if e != nil {
6413 return nil, e
6414 }
6415 return resp, nil
6416 }
6417
6418 // UpdateSettings updates project-level settings.
6419 func (c *restClient) UpdateSettings(ctx context.Context, req *contactcenterinsightspb.UpdateSettingsRequest, opts ...gax.CallOption) (*contactcenterinsightspb.Settings, error) {
6420 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
6421 body := req.GetSettings()
6422 jsonReq, err := m.Marshal(body)
6423 if err != nil {
6424 return nil, err
6425 }
6426
6427 baseUrl, err := url.Parse(c.endpoint)
6428 if err != nil {
6429 return nil, err
6430 }
6431 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetSettings().GetName())
6432
6433 params := url.Values{}
6434 params.Add("$alt", "json;enum-encoding=int")
6435 if req.GetUpdateMask() != nil {
6436 field, err := protojson.Marshal(req.GetUpdateMask())
6437 if err != nil {
6438 return nil, err
6439 }
6440 params.Add("updateMask", string(field[1:len(field)-1]))
6441 }
6442
6443 baseUrl.RawQuery = params.Encode()
6444
6445 // Build HTTP headers from client and context metadata.
6446 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "settings.name", url.QueryEscape(req.GetSettings().GetName()))}
6447
6448 hds = append(c.xGoogHeaders, hds...)
6449 hds = append(hds, "Content-Type", "application/json")
6450 headers := gax.BuildHeaders(ctx, hds...)
6451 opts = append((*c.CallOptions).UpdateSettings[0:len((*c.CallOptions).UpdateSettings):len((*c.CallOptions).UpdateSettings)], opts...)
6452 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
6453 resp := &contactcenterinsightspb.Settings{}
6454 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
6455 if settings.Path != "" {
6456 baseUrl.Path = settings.Path
6457 }
6458 httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq))
6459 if err != nil {
6460 return err
6461 }
6462 httpReq = httpReq.WithContext(ctx)
6463 httpReq.Header = headers
6464
6465 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UpdateSettings")
6466 if err != nil {
6467 return err
6468 }
6469
6470 if err := unm.Unmarshal(buf, resp); err != nil {
6471 return err
6472 }
6473
6474 return nil
6475 }, opts...)
6476 if e != nil {
6477 return nil, e
6478 }
6479 return resp, nil
6480 }
6481
6482 // CreateAnalysisRule creates a analysis rule.
6483 func (c *restClient) CreateAnalysisRule(ctx context.Context, req *contactcenterinsightspb.CreateAnalysisRuleRequest, opts ...gax.CallOption) (*contactcenterinsightspb.AnalysisRule, error) {
6484 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
6485 body := req.GetAnalysisRule()
6486 jsonReq, err := m.Marshal(body)
6487 if err != nil {
6488 return nil, err
6489 }
6490
6491 baseUrl, err := url.Parse(c.endpoint)
6492 if err != nil {
6493 return nil, err
6494 }
6495 baseUrl.Path += fmt.Sprintf("/v1/%v/analysisRules", req.GetParent())
6496
6497 params := url.Values{}
6498 params.Add("$alt", "json;enum-encoding=int")
6499
6500 baseUrl.RawQuery = params.Encode()
6501
6502 // Build HTTP headers from client and context metadata.
6503 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
6504
6505 hds = append(c.xGoogHeaders, hds...)
6506 hds = append(hds, "Content-Type", "application/json")
6507 headers := gax.BuildHeaders(ctx, hds...)
6508 opts = append((*c.CallOptions).CreateAnalysisRule[0:len((*c.CallOptions).CreateAnalysisRule):len((*c.CallOptions).CreateAnalysisRule)], opts...)
6509 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
6510 resp := &contactcenterinsightspb.AnalysisRule{}
6511 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
6512 if settings.Path != "" {
6513 baseUrl.Path = settings.Path
6514 }
6515 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
6516 if err != nil {
6517 return err
6518 }
6519 httpReq = httpReq.WithContext(ctx)
6520 httpReq.Header = headers
6521
6522 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreateAnalysisRule")
6523 if err != nil {
6524 return err
6525 }
6526
6527 if err := unm.Unmarshal(buf, resp); err != nil {
6528 return err
6529 }
6530
6531 return nil
6532 }, opts...)
6533 if e != nil {
6534 return nil, e
6535 }
6536 return resp, nil
6537 }
6538
6539 // GetAnalysisRule get a analysis rule.
6540 func (c *restClient) GetAnalysisRule(ctx context.Context, req *contactcenterinsightspb.GetAnalysisRuleRequest, opts ...gax.CallOption) (*contactcenterinsightspb.AnalysisRule, error) {
6541 baseUrl, err := url.Parse(c.endpoint)
6542 if err != nil {
6543 return nil, err
6544 }
6545 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
6546
6547 params := url.Values{}
6548 params.Add("$alt", "json;enum-encoding=int")
6549
6550 baseUrl.RawQuery = params.Encode()
6551
6552 // Build HTTP headers from client and context metadata.
6553 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
6554
6555 hds = append(c.xGoogHeaders, hds...)
6556 hds = append(hds, "Content-Type", "application/json")
6557 headers := gax.BuildHeaders(ctx, hds...)
6558 opts = append((*c.CallOptions).GetAnalysisRule[0:len((*c.CallOptions).GetAnalysisRule):len((*c.CallOptions).GetAnalysisRule)], opts...)
6559 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
6560 resp := &contactcenterinsightspb.AnalysisRule{}
6561 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
6562 if settings.Path != "" {
6563 baseUrl.Path = settings.Path
6564 }
6565 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
6566 if err != nil {
6567 return err
6568 }
6569 httpReq = httpReq.WithContext(ctx)
6570 httpReq.Header = headers
6571
6572 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetAnalysisRule")
6573 if err != nil {
6574 return err
6575 }
6576
6577 if err := unm.Unmarshal(buf, resp); err != nil {
6578 return err
6579 }
6580
6581 return nil
6582 }, opts...)
6583 if e != nil {
6584 return nil, e
6585 }
6586 return resp, nil
6587 }
6588
6589 // ListAnalysisRules lists analysis rules.
6590 func (c *restClient) ListAnalysisRules(ctx context.Context, req *contactcenterinsightspb.ListAnalysisRulesRequest, opts ...gax.CallOption) *AnalysisRuleIterator {
6591 it := &AnalysisRuleIterator{}
6592 req = proto.Clone(req).(*contactcenterinsightspb.ListAnalysisRulesRequest)
6593 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
6594 it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.AnalysisRule, string, error) {
6595 resp := &contactcenterinsightspb.ListAnalysisRulesResponse{}
6596 if pageToken != "" {
6597 req.PageToken = pageToken
6598 }
6599 if pageSize > math.MaxInt32 {
6600 req.PageSize = math.MaxInt32
6601 } else if pageSize != 0 {
6602 req.PageSize = int32(pageSize)
6603 }
6604 baseUrl, err := url.Parse(c.endpoint)
6605 if err != nil {
6606 return nil, "", err
6607 }
6608 baseUrl.Path += fmt.Sprintf("/v1/%v/analysisRules", req.GetParent())
6609
6610 params := url.Values{}
6611 params.Add("$alt", "json;enum-encoding=int")
6612 if req.GetPageSize() != 0 {
6613 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
6614 }
6615 if req.GetPageToken() != "" {
6616 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
6617 }
6618
6619 baseUrl.RawQuery = params.Encode()
6620
6621 // Build HTTP headers from client and context metadata.
6622 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
6623 headers := gax.BuildHeaders(ctx, hds...)
6624 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
6625 if settings.Path != "" {
6626 baseUrl.Path = settings.Path
6627 }
6628 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
6629 if err != nil {
6630 return err
6631 }
6632 httpReq.Header = headers
6633
6634 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListAnalysisRules")
6635 if err != nil {
6636 return err
6637 }
6638 if err := unm.Unmarshal(buf, resp); err != nil {
6639 return err
6640 }
6641
6642 return nil
6643 }, opts...)
6644 if e != nil {
6645 return nil, "", e
6646 }
6647 it.Response = resp
6648 return resp.GetAnalysisRules(), resp.GetNextPageToken(), nil
6649 }
6650
6651 fetch := func(pageSize int, pageToken string) (string, error) {
6652 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
6653 if err != nil {
6654 return "", err
6655 }
6656 it.items = append(it.items, items...)
6657 return nextPageToken, nil
6658 }
6659
6660 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
6661 it.pageInfo.MaxSize = int(req.GetPageSize())
6662 it.pageInfo.Token = req.GetPageToken()
6663
6664 return it
6665 }
6666
6667 // UpdateAnalysisRule updates a analysis rule.
6668 func (c *restClient) UpdateAnalysisRule(ctx context.Context, req *contactcenterinsightspb.UpdateAnalysisRuleRequest, opts ...gax.CallOption) (*contactcenterinsightspb.AnalysisRule, error) {
6669 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
6670 body := req.GetAnalysisRule()
6671 jsonReq, err := m.Marshal(body)
6672 if err != nil {
6673 return nil, err
6674 }
6675
6676 baseUrl, err := url.Parse(c.endpoint)
6677 if err != nil {
6678 return nil, err
6679 }
6680 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetAnalysisRule().GetName())
6681
6682 params := url.Values{}
6683 params.Add("$alt", "json;enum-encoding=int")
6684 if req.GetUpdateMask() != nil {
6685 field, err := protojson.Marshal(req.GetUpdateMask())
6686 if err != nil {
6687 return nil, err
6688 }
6689 params.Add("updateMask", string(field[1:len(field)-1]))
6690 }
6691
6692 baseUrl.RawQuery = params.Encode()
6693
6694 // Build HTTP headers from client and context metadata.
6695 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "analysis_rule.name", url.QueryEscape(req.GetAnalysisRule().GetName()))}
6696
6697 hds = append(c.xGoogHeaders, hds...)
6698 hds = append(hds, "Content-Type", "application/json")
6699 headers := gax.BuildHeaders(ctx, hds...)
6700 opts = append((*c.CallOptions).UpdateAnalysisRule[0:len((*c.CallOptions).UpdateAnalysisRule):len((*c.CallOptions).UpdateAnalysisRule)], opts...)
6701 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
6702 resp := &contactcenterinsightspb.AnalysisRule{}
6703 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
6704 if settings.Path != "" {
6705 baseUrl.Path = settings.Path
6706 }
6707 httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq))
6708 if err != nil {
6709 return err
6710 }
6711 httpReq = httpReq.WithContext(ctx)
6712 httpReq.Header = headers
6713
6714 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UpdateAnalysisRule")
6715 if err != nil {
6716 return err
6717 }
6718
6719 if err := unm.Unmarshal(buf, resp); err != nil {
6720 return err
6721 }
6722
6723 return nil
6724 }, opts...)
6725 if e != nil {
6726 return nil, e
6727 }
6728 return resp, nil
6729 }
6730
6731 // DeleteAnalysisRule deletes a analysis rule.
6732 func (c *restClient) DeleteAnalysisRule(ctx context.Context, req *contactcenterinsightspb.DeleteAnalysisRuleRequest, opts ...gax.CallOption) error {
6733 baseUrl, err := url.Parse(c.endpoint)
6734 if err != nil {
6735 return err
6736 }
6737 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
6738
6739 params := url.Values{}
6740 params.Add("$alt", "json;enum-encoding=int")
6741
6742 baseUrl.RawQuery = params.Encode()
6743
6744 // Build HTTP headers from client and context metadata.
6745 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
6746
6747 hds = append(c.xGoogHeaders, hds...)
6748 hds = append(hds, "Content-Type", "application/json")
6749 headers := gax.BuildHeaders(ctx, hds...)
6750 return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
6751 if settings.Path != "" {
6752 baseUrl.Path = settings.Path
6753 }
6754 httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil)
6755 if err != nil {
6756 return err
6757 }
6758 httpReq = httpReq.WithContext(ctx)
6759 httpReq.Header = headers
6760
6761 _, err = executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteAnalysisRule")
6762 return err
6763 }, opts...)
6764 }
6765
6766 // GetEncryptionSpec gets location-level encryption key specification.
6767 func (c *restClient) GetEncryptionSpec(ctx context.Context, req *contactcenterinsightspb.GetEncryptionSpecRequest, opts ...gax.CallOption) (*contactcenterinsightspb.EncryptionSpec, error) {
6768 baseUrl, err := url.Parse(c.endpoint)
6769 if err != nil {
6770 return nil, err
6771 }
6772 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
6773
6774 params := url.Values{}
6775 params.Add("$alt", "json;enum-encoding=int")
6776
6777 baseUrl.RawQuery = params.Encode()
6778
6779 // Build HTTP headers from client and context metadata.
6780 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
6781
6782 hds = append(c.xGoogHeaders, hds...)
6783 hds = append(hds, "Content-Type", "application/json")
6784 headers := gax.BuildHeaders(ctx, hds...)
6785 opts = append((*c.CallOptions).GetEncryptionSpec[0:len((*c.CallOptions).GetEncryptionSpec):len((*c.CallOptions).GetEncryptionSpec)], opts...)
6786 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
6787 resp := &contactcenterinsightspb.EncryptionSpec{}
6788 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
6789 if settings.Path != "" {
6790 baseUrl.Path = settings.Path
6791 }
6792 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
6793 if err != nil {
6794 return err
6795 }
6796 httpReq = httpReq.WithContext(ctx)
6797 httpReq.Header = headers
6798
6799 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetEncryptionSpec")
6800 if err != nil {
6801 return err
6802 }
6803
6804 if err := unm.Unmarshal(buf, resp); err != nil {
6805 return err
6806 }
6807
6808 return nil
6809 }, opts...)
6810 if e != nil {
6811 return nil, e
6812 }
6813 return resp, nil
6814 }
6815
6816 // InitializeEncryptionSpec initializes a location-level encryption key specification. An error will
6817 // result if the location has resources already created before the
6818 // initialization. After the encryption specification is initialized at a
6819 // location, it is immutable and all newly created resources under the
6820 // location will be encrypted with the existing specification.
6821 func (c *restClient) InitializeEncryptionSpec(ctx context.Context, req *contactcenterinsightspb.InitializeEncryptionSpecRequest, opts ...gax.CallOption) (*InitializeEncryptionSpecOperation, error) {
6822 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
6823 jsonReq, err := m.Marshal(req)
6824 if err != nil {
6825 return nil, err
6826 }
6827
6828 baseUrl, err := url.Parse(c.endpoint)
6829 if err != nil {
6830 return nil, err
6831 }
6832 baseUrl.Path += fmt.Sprintf("/v1/%v:initialize", req.GetEncryptionSpec().GetName())
6833
6834 params := url.Values{}
6835 params.Add("$alt", "json;enum-encoding=int")
6836
6837 baseUrl.RawQuery = params.Encode()
6838
6839 // Build HTTP headers from client and context metadata.
6840 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "encryption_spec.name", url.QueryEscape(req.GetEncryptionSpec().GetName()))}
6841
6842 hds = append(c.xGoogHeaders, hds...)
6843 hds = append(hds, "Content-Type", "application/json")
6844 headers := gax.BuildHeaders(ctx, hds...)
6845 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
6846 resp := &longrunningpb.Operation{}
6847 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
6848 if settings.Path != "" {
6849 baseUrl.Path = settings.Path
6850 }
6851 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
6852 if err != nil {
6853 return err
6854 }
6855 httpReq = httpReq.WithContext(ctx)
6856 httpReq.Header = headers
6857
6858 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "InitializeEncryptionSpec")
6859 if err != nil {
6860 return err
6861 }
6862 if err := unm.Unmarshal(buf, resp); err != nil {
6863 return err
6864 }
6865
6866 return nil
6867 }, opts...)
6868 if e != nil {
6869 return nil, e
6870 }
6871
6872 override := fmt.Sprintf("/v1/%s", resp.GetName())
6873 return &InitializeEncryptionSpecOperation{
6874 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
6875 pollPath: override,
6876 }, nil
6877 }
6878
6879 // CreateView creates a view.
6880 func (c *restClient) CreateView(ctx context.Context, req *contactcenterinsightspb.CreateViewRequest, opts ...gax.CallOption) (*contactcenterinsightspb.View, error) {
6881 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
6882 body := req.GetView()
6883 jsonReq, err := m.Marshal(body)
6884 if err != nil {
6885 return nil, err
6886 }
6887
6888 baseUrl, err := url.Parse(c.endpoint)
6889 if err != nil {
6890 return nil, err
6891 }
6892 baseUrl.Path += fmt.Sprintf("/v1/%v/views", req.GetParent())
6893
6894 params := url.Values{}
6895 params.Add("$alt", "json;enum-encoding=int")
6896
6897 baseUrl.RawQuery = params.Encode()
6898
6899 // Build HTTP headers from client and context metadata.
6900 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
6901
6902 hds = append(c.xGoogHeaders, hds...)
6903 hds = append(hds, "Content-Type", "application/json")
6904 headers := gax.BuildHeaders(ctx, hds...)
6905 opts = append((*c.CallOptions).CreateView[0:len((*c.CallOptions).CreateView):len((*c.CallOptions).CreateView)], opts...)
6906 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
6907 resp := &contactcenterinsightspb.View{}
6908 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
6909 if settings.Path != "" {
6910 baseUrl.Path = settings.Path
6911 }
6912 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
6913 if err != nil {
6914 return err
6915 }
6916 httpReq = httpReq.WithContext(ctx)
6917 httpReq.Header = headers
6918
6919 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreateView")
6920 if err != nil {
6921 return err
6922 }
6923
6924 if err := unm.Unmarshal(buf, resp); err != nil {
6925 return err
6926 }
6927
6928 return nil
6929 }, opts...)
6930 if e != nil {
6931 return nil, e
6932 }
6933 return resp, nil
6934 }
6935
6936 // GetView gets a view.
6937 func (c *restClient) GetView(ctx context.Context, req *contactcenterinsightspb.GetViewRequest, opts ...gax.CallOption) (*contactcenterinsightspb.View, error) {
6938 baseUrl, err := url.Parse(c.endpoint)
6939 if err != nil {
6940 return nil, err
6941 }
6942 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
6943
6944 params := url.Values{}
6945 params.Add("$alt", "json;enum-encoding=int")
6946
6947 baseUrl.RawQuery = params.Encode()
6948
6949 // Build HTTP headers from client and context metadata.
6950 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
6951
6952 hds = append(c.xGoogHeaders, hds...)
6953 hds = append(hds, "Content-Type", "application/json")
6954 headers := gax.BuildHeaders(ctx, hds...)
6955 opts = append((*c.CallOptions).GetView[0:len((*c.CallOptions).GetView):len((*c.CallOptions).GetView)], opts...)
6956 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
6957 resp := &contactcenterinsightspb.View{}
6958 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
6959 if settings.Path != "" {
6960 baseUrl.Path = settings.Path
6961 }
6962 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
6963 if err != nil {
6964 return err
6965 }
6966 httpReq = httpReq.WithContext(ctx)
6967 httpReq.Header = headers
6968
6969 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetView")
6970 if err != nil {
6971 return err
6972 }
6973
6974 if err := unm.Unmarshal(buf, resp); err != nil {
6975 return err
6976 }
6977
6978 return nil
6979 }, opts...)
6980 if e != nil {
6981 return nil, e
6982 }
6983 return resp, nil
6984 }
6985
6986 // ListViews lists views.
6987 func (c *restClient) ListViews(ctx context.Context, req *contactcenterinsightspb.ListViewsRequest, opts ...gax.CallOption) *ViewIterator {
6988 it := &ViewIterator{}
6989 req = proto.Clone(req).(*contactcenterinsightspb.ListViewsRequest)
6990 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
6991 it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.View, string, error) {
6992 resp := &contactcenterinsightspb.ListViewsResponse{}
6993 if pageToken != "" {
6994 req.PageToken = pageToken
6995 }
6996 if pageSize > math.MaxInt32 {
6997 req.PageSize = math.MaxInt32
6998 } else if pageSize != 0 {
6999 req.PageSize = int32(pageSize)
7000 }
7001 baseUrl, err := url.Parse(c.endpoint)
7002 if err != nil {
7003 return nil, "", err
7004 }
7005 baseUrl.Path += fmt.Sprintf("/v1/%v/views", req.GetParent())
7006
7007 params := url.Values{}
7008 params.Add("$alt", "json;enum-encoding=int")
7009 if req.GetPageSize() != 0 {
7010 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
7011 }
7012 if req.GetPageToken() != "" {
7013 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
7014 }
7015
7016 baseUrl.RawQuery = params.Encode()
7017
7018 // Build HTTP headers from client and context metadata.
7019 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
7020 headers := gax.BuildHeaders(ctx, hds...)
7021 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
7022 if settings.Path != "" {
7023 baseUrl.Path = settings.Path
7024 }
7025 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
7026 if err != nil {
7027 return err
7028 }
7029 httpReq.Header = headers
7030
7031 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListViews")
7032 if err != nil {
7033 return err
7034 }
7035 if err := unm.Unmarshal(buf, resp); err != nil {
7036 return err
7037 }
7038
7039 return nil
7040 }, opts...)
7041 if e != nil {
7042 return nil, "", e
7043 }
7044 it.Response = resp
7045 return resp.GetViews(), resp.GetNextPageToken(), nil
7046 }
7047
7048 fetch := func(pageSize int, pageToken string) (string, error) {
7049 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
7050 if err != nil {
7051 return "", err
7052 }
7053 it.items = append(it.items, items...)
7054 return nextPageToken, nil
7055 }
7056
7057 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
7058 it.pageInfo.MaxSize = int(req.GetPageSize())
7059 it.pageInfo.Token = req.GetPageToken()
7060
7061 return it
7062 }
7063
7064 // UpdateView updates a view.
7065 func (c *restClient) UpdateView(ctx context.Context, req *contactcenterinsightspb.UpdateViewRequest, opts ...gax.CallOption) (*contactcenterinsightspb.View, error) {
7066 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
7067 body := req.GetView()
7068 jsonReq, err := m.Marshal(body)
7069 if err != nil {
7070 return nil, err
7071 }
7072
7073 baseUrl, err := url.Parse(c.endpoint)
7074 if err != nil {
7075 return nil, err
7076 }
7077 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetView().GetName())
7078
7079 params := url.Values{}
7080 params.Add("$alt", "json;enum-encoding=int")
7081 if req.GetUpdateMask() != nil {
7082 field, err := protojson.Marshal(req.GetUpdateMask())
7083 if err != nil {
7084 return nil, err
7085 }
7086 params.Add("updateMask", string(field[1:len(field)-1]))
7087 }
7088
7089 baseUrl.RawQuery = params.Encode()
7090
7091 // Build HTTP headers from client and context metadata.
7092 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "view.name", url.QueryEscape(req.GetView().GetName()))}
7093
7094 hds = append(c.xGoogHeaders, hds...)
7095 hds = append(hds, "Content-Type", "application/json")
7096 headers := gax.BuildHeaders(ctx, hds...)
7097 opts = append((*c.CallOptions).UpdateView[0:len((*c.CallOptions).UpdateView):len((*c.CallOptions).UpdateView)], opts...)
7098 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
7099 resp := &contactcenterinsightspb.View{}
7100 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
7101 if settings.Path != "" {
7102 baseUrl.Path = settings.Path
7103 }
7104 httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq))
7105 if err != nil {
7106 return err
7107 }
7108 httpReq = httpReq.WithContext(ctx)
7109 httpReq.Header = headers
7110
7111 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UpdateView")
7112 if err != nil {
7113 return err
7114 }
7115
7116 if err := unm.Unmarshal(buf, resp); err != nil {
7117 return err
7118 }
7119
7120 return nil
7121 }, opts...)
7122 if e != nil {
7123 return nil, e
7124 }
7125 return resp, nil
7126 }
7127
7128 // DeleteView deletes a view.
7129 func (c *restClient) DeleteView(ctx context.Context, req *contactcenterinsightspb.DeleteViewRequest, opts ...gax.CallOption) error {
7130 baseUrl, err := url.Parse(c.endpoint)
7131 if err != nil {
7132 return err
7133 }
7134 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
7135
7136 params := url.Values{}
7137 params.Add("$alt", "json;enum-encoding=int")
7138
7139 baseUrl.RawQuery = params.Encode()
7140
7141 // Build HTTP headers from client and context metadata.
7142 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
7143
7144 hds = append(c.xGoogHeaders, hds...)
7145 hds = append(hds, "Content-Type", "application/json")
7146 headers := gax.BuildHeaders(ctx, hds...)
7147 return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
7148 if settings.Path != "" {
7149 baseUrl.Path = settings.Path
7150 }
7151 httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil)
7152 if err != nil {
7153 return err
7154 }
7155 httpReq = httpReq.WithContext(ctx)
7156 httpReq.Header = headers
7157
7158 _, err = executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteView")
7159 return err
7160 }, opts...)
7161 }
7162
7163 // QueryMetrics query metrics.
7164 func (c *restClient) QueryMetrics(ctx context.Context, req *contactcenterinsightspb.QueryMetricsRequest, opts ...gax.CallOption) (*QueryMetricsOperation, error) {
7165 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
7166 jsonReq, err := m.Marshal(req)
7167 if err != nil {
7168 return nil, err
7169 }
7170
7171 baseUrl, err := url.Parse(c.endpoint)
7172 if err != nil {
7173 return nil, err
7174 }
7175 baseUrl.Path += fmt.Sprintf("/v1/%v:queryMetrics", req.GetLocation())
7176
7177 params := url.Values{}
7178 params.Add("$alt", "json;enum-encoding=int")
7179
7180 baseUrl.RawQuery = params.Encode()
7181
7182 // Build HTTP headers from client and context metadata.
7183 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "location", url.QueryEscape(req.GetLocation()))}
7184
7185 hds = append(c.xGoogHeaders, hds...)
7186 hds = append(hds, "Content-Type", "application/json")
7187 headers := gax.BuildHeaders(ctx, hds...)
7188 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
7189 resp := &longrunningpb.Operation{}
7190 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
7191 if settings.Path != "" {
7192 baseUrl.Path = settings.Path
7193 }
7194 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
7195 if err != nil {
7196 return err
7197 }
7198 httpReq = httpReq.WithContext(ctx)
7199 httpReq.Header = headers
7200
7201 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "QueryMetrics")
7202 if err != nil {
7203 return err
7204 }
7205 if err := unm.Unmarshal(buf, resp); err != nil {
7206 return err
7207 }
7208
7209 return nil
7210 }, opts...)
7211 if e != nil {
7212 return nil, e
7213 }
7214
7215 override := fmt.Sprintf("/v1/%s", resp.GetName())
7216 return &QueryMetricsOperation{
7217 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
7218 pollPath: override,
7219 }, nil
7220 }
7221
7222 // CreateQaQuestion create a QaQuestion.
7223 func (c *restClient) CreateQaQuestion(ctx context.Context, req *contactcenterinsightspb.CreateQaQuestionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaQuestion, error) {
7224 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
7225 body := req.GetQaQuestion()
7226 jsonReq, err := m.Marshal(body)
7227 if err != nil {
7228 return nil, err
7229 }
7230
7231 baseUrl, err := url.Parse(c.endpoint)
7232 if err != nil {
7233 return nil, err
7234 }
7235 baseUrl.Path += fmt.Sprintf("/v1/%v/qaQuestions", req.GetParent())
7236
7237 params := url.Values{}
7238 params.Add("$alt", "json;enum-encoding=int")
7239 if req.GetQaQuestionId() != "" {
7240 params.Add("qaQuestionId", fmt.Sprintf("%v", req.GetQaQuestionId()))
7241 }
7242
7243 baseUrl.RawQuery = params.Encode()
7244
7245 // Build HTTP headers from client and context metadata.
7246 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
7247
7248 hds = append(c.xGoogHeaders, hds...)
7249 hds = append(hds, "Content-Type", "application/json")
7250 headers := gax.BuildHeaders(ctx, hds...)
7251 opts = append((*c.CallOptions).CreateQaQuestion[0:len((*c.CallOptions).CreateQaQuestion):len((*c.CallOptions).CreateQaQuestion)], opts...)
7252 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
7253 resp := &contactcenterinsightspb.QaQuestion{}
7254 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
7255 if settings.Path != "" {
7256 baseUrl.Path = settings.Path
7257 }
7258 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
7259 if err != nil {
7260 return err
7261 }
7262 httpReq = httpReq.WithContext(ctx)
7263 httpReq.Header = headers
7264
7265 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreateQaQuestion")
7266 if err != nil {
7267 return err
7268 }
7269
7270 if err := unm.Unmarshal(buf, resp); err != nil {
7271 return err
7272 }
7273
7274 return nil
7275 }, opts...)
7276 if e != nil {
7277 return nil, e
7278 }
7279 return resp, nil
7280 }
7281
7282 // GetQaQuestion gets a QaQuestion.
7283 func (c *restClient) GetQaQuestion(ctx context.Context, req *contactcenterinsightspb.GetQaQuestionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaQuestion, error) {
7284 baseUrl, err := url.Parse(c.endpoint)
7285 if err != nil {
7286 return nil, err
7287 }
7288 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
7289
7290 params := url.Values{}
7291 params.Add("$alt", "json;enum-encoding=int")
7292
7293 baseUrl.RawQuery = params.Encode()
7294
7295 // Build HTTP headers from client and context metadata.
7296 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
7297
7298 hds = append(c.xGoogHeaders, hds...)
7299 hds = append(hds, "Content-Type", "application/json")
7300 headers := gax.BuildHeaders(ctx, hds...)
7301 opts = append((*c.CallOptions).GetQaQuestion[0:len((*c.CallOptions).GetQaQuestion):len((*c.CallOptions).GetQaQuestion)], opts...)
7302 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
7303 resp := &contactcenterinsightspb.QaQuestion{}
7304 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
7305 if settings.Path != "" {
7306 baseUrl.Path = settings.Path
7307 }
7308 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
7309 if err != nil {
7310 return err
7311 }
7312 httpReq = httpReq.WithContext(ctx)
7313 httpReq.Header = headers
7314
7315 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetQaQuestion")
7316 if err != nil {
7317 return err
7318 }
7319
7320 if err := unm.Unmarshal(buf, resp); err != nil {
7321 return err
7322 }
7323
7324 return nil
7325 }, opts...)
7326 if e != nil {
7327 return nil, e
7328 }
7329 return resp, nil
7330 }
7331
7332 // UpdateQaQuestion updates a QaQuestion.
7333 func (c *restClient) UpdateQaQuestion(ctx context.Context, req *contactcenterinsightspb.UpdateQaQuestionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaQuestion, error) {
7334 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
7335 body := req.GetQaQuestion()
7336 jsonReq, err := m.Marshal(body)
7337 if err != nil {
7338 return nil, err
7339 }
7340
7341 baseUrl, err := url.Parse(c.endpoint)
7342 if err != nil {
7343 return nil, err
7344 }
7345 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetQaQuestion().GetName())
7346
7347 params := url.Values{}
7348 params.Add("$alt", "json;enum-encoding=int")
7349 if req.GetUpdateMask() != nil {
7350 field, err := protojson.Marshal(req.GetUpdateMask())
7351 if err != nil {
7352 return nil, err
7353 }
7354 params.Add("updateMask", string(field[1:len(field)-1]))
7355 }
7356
7357 baseUrl.RawQuery = params.Encode()
7358
7359 // Build HTTP headers from client and context metadata.
7360 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "qa_question.name", url.QueryEscape(req.GetQaQuestion().GetName()))}
7361
7362 hds = append(c.xGoogHeaders, hds...)
7363 hds = append(hds, "Content-Type", "application/json")
7364 headers := gax.BuildHeaders(ctx, hds...)
7365 opts = append((*c.CallOptions).UpdateQaQuestion[0:len((*c.CallOptions).UpdateQaQuestion):len((*c.CallOptions).UpdateQaQuestion)], opts...)
7366 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
7367 resp := &contactcenterinsightspb.QaQuestion{}
7368 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
7369 if settings.Path != "" {
7370 baseUrl.Path = settings.Path
7371 }
7372 httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq))
7373 if err != nil {
7374 return err
7375 }
7376 httpReq = httpReq.WithContext(ctx)
7377 httpReq.Header = headers
7378
7379 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UpdateQaQuestion")
7380 if err != nil {
7381 return err
7382 }
7383
7384 if err := unm.Unmarshal(buf, resp); err != nil {
7385 return err
7386 }
7387
7388 return nil
7389 }, opts...)
7390 if e != nil {
7391 return nil, e
7392 }
7393 return resp, nil
7394 }
7395
7396 // DeleteQaQuestion deletes a QaQuestion.
7397 func (c *restClient) DeleteQaQuestion(ctx context.Context, req *contactcenterinsightspb.DeleteQaQuestionRequest, opts ...gax.CallOption) error {
7398 baseUrl, err := url.Parse(c.endpoint)
7399 if err != nil {
7400 return err
7401 }
7402 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
7403
7404 params := url.Values{}
7405 params.Add("$alt", "json;enum-encoding=int")
7406
7407 baseUrl.RawQuery = params.Encode()
7408
7409 // Build HTTP headers from client and context metadata.
7410 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
7411
7412 hds = append(c.xGoogHeaders, hds...)
7413 hds = append(hds, "Content-Type", "application/json")
7414 headers := gax.BuildHeaders(ctx, hds...)
7415 return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
7416 if settings.Path != "" {
7417 baseUrl.Path = settings.Path
7418 }
7419 httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil)
7420 if err != nil {
7421 return err
7422 }
7423 httpReq = httpReq.WithContext(ctx)
7424 httpReq.Header = headers
7425
7426 _, err = executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteQaQuestion")
7427 return err
7428 }, opts...)
7429 }
7430
7431 // ListQaQuestions lists QaQuestions.
7432 func (c *restClient) ListQaQuestions(ctx context.Context, req *contactcenterinsightspb.ListQaQuestionsRequest, opts ...gax.CallOption) *QaQuestionIterator {
7433 it := &QaQuestionIterator{}
7434 req = proto.Clone(req).(*contactcenterinsightspb.ListQaQuestionsRequest)
7435 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
7436 it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.QaQuestion, string, error) {
7437 resp := &contactcenterinsightspb.ListQaQuestionsResponse{}
7438 if pageToken != "" {
7439 req.PageToken = pageToken
7440 }
7441 if pageSize > math.MaxInt32 {
7442 req.PageSize = math.MaxInt32
7443 } else if pageSize != 0 {
7444 req.PageSize = int32(pageSize)
7445 }
7446 baseUrl, err := url.Parse(c.endpoint)
7447 if err != nil {
7448 return nil, "", err
7449 }
7450 baseUrl.Path += fmt.Sprintf("/v1/%v/qaQuestions", req.GetParent())
7451
7452 params := url.Values{}
7453 params.Add("$alt", "json;enum-encoding=int")
7454 if req.GetPageSize() != 0 {
7455 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
7456 }
7457 if req.GetPageToken() != "" {
7458 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
7459 }
7460
7461 baseUrl.RawQuery = params.Encode()
7462
7463 // Build HTTP headers from client and context metadata.
7464 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
7465 headers := gax.BuildHeaders(ctx, hds...)
7466 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
7467 if settings.Path != "" {
7468 baseUrl.Path = settings.Path
7469 }
7470 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
7471 if err != nil {
7472 return err
7473 }
7474 httpReq.Header = headers
7475
7476 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListQaQuestions")
7477 if err != nil {
7478 return err
7479 }
7480 if err := unm.Unmarshal(buf, resp); err != nil {
7481 return err
7482 }
7483
7484 return nil
7485 }, opts...)
7486 if e != nil {
7487 return nil, "", e
7488 }
7489 it.Response = resp
7490 return resp.GetQaQuestions(), resp.GetNextPageToken(), nil
7491 }
7492
7493 fetch := func(pageSize int, pageToken string) (string, error) {
7494 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
7495 if err != nil {
7496 return "", err
7497 }
7498 it.items = append(it.items, items...)
7499 return nextPageToken, nil
7500 }
7501
7502 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
7503 it.pageInfo.MaxSize = int(req.GetPageSize())
7504 it.pageInfo.Token = req.GetPageToken()
7505
7506 return it
7507 }
7508
7509 // CreateQaScorecard create a QaScorecard.
7510 func (c *restClient) CreateQaScorecard(ctx context.Context, req *contactcenterinsightspb.CreateQaScorecardRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecard, error) {
7511 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
7512 body := req.GetQaScorecard()
7513 jsonReq, err := m.Marshal(body)
7514 if err != nil {
7515 return nil, err
7516 }
7517
7518 baseUrl, err := url.Parse(c.endpoint)
7519 if err != nil {
7520 return nil, err
7521 }
7522 baseUrl.Path += fmt.Sprintf("/v1/%v/qaScorecards", req.GetParent())
7523
7524 params := url.Values{}
7525 params.Add("$alt", "json;enum-encoding=int")
7526 if req.GetQaScorecardId() != "" {
7527 params.Add("qaScorecardId", fmt.Sprintf("%v", req.GetQaScorecardId()))
7528 }
7529
7530 baseUrl.RawQuery = params.Encode()
7531
7532 // Build HTTP headers from client and context metadata.
7533 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
7534
7535 hds = append(c.xGoogHeaders, hds...)
7536 hds = append(hds, "Content-Type", "application/json")
7537 headers := gax.BuildHeaders(ctx, hds...)
7538 opts = append((*c.CallOptions).CreateQaScorecard[0:len((*c.CallOptions).CreateQaScorecard):len((*c.CallOptions).CreateQaScorecard)], opts...)
7539 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
7540 resp := &contactcenterinsightspb.QaScorecard{}
7541 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
7542 if settings.Path != "" {
7543 baseUrl.Path = settings.Path
7544 }
7545 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
7546 if err != nil {
7547 return err
7548 }
7549 httpReq = httpReq.WithContext(ctx)
7550 httpReq.Header = headers
7551
7552 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreateQaScorecard")
7553 if err != nil {
7554 return err
7555 }
7556
7557 if err := unm.Unmarshal(buf, resp); err != nil {
7558 return err
7559 }
7560
7561 return nil
7562 }, opts...)
7563 if e != nil {
7564 return nil, e
7565 }
7566 return resp, nil
7567 }
7568
7569 // GetQaScorecard gets a QaScorecard.
7570 func (c *restClient) GetQaScorecard(ctx context.Context, req *contactcenterinsightspb.GetQaScorecardRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecard, error) {
7571 baseUrl, err := url.Parse(c.endpoint)
7572 if err != nil {
7573 return nil, err
7574 }
7575 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
7576
7577 params := url.Values{}
7578 params.Add("$alt", "json;enum-encoding=int")
7579
7580 baseUrl.RawQuery = params.Encode()
7581
7582 // Build HTTP headers from client and context metadata.
7583 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
7584
7585 hds = append(c.xGoogHeaders, hds...)
7586 hds = append(hds, "Content-Type", "application/json")
7587 headers := gax.BuildHeaders(ctx, hds...)
7588 opts = append((*c.CallOptions).GetQaScorecard[0:len((*c.CallOptions).GetQaScorecard):len((*c.CallOptions).GetQaScorecard)], opts...)
7589 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
7590 resp := &contactcenterinsightspb.QaScorecard{}
7591 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
7592 if settings.Path != "" {
7593 baseUrl.Path = settings.Path
7594 }
7595 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
7596 if err != nil {
7597 return err
7598 }
7599 httpReq = httpReq.WithContext(ctx)
7600 httpReq.Header = headers
7601
7602 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetQaScorecard")
7603 if err != nil {
7604 return err
7605 }
7606
7607 if err := unm.Unmarshal(buf, resp); err != nil {
7608 return err
7609 }
7610
7611 return nil
7612 }, opts...)
7613 if e != nil {
7614 return nil, e
7615 }
7616 return resp, nil
7617 }
7618
7619 // UpdateQaScorecard updates a QaScorecard.
7620 func (c *restClient) UpdateQaScorecard(ctx context.Context, req *contactcenterinsightspb.UpdateQaScorecardRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecard, error) {
7621 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
7622 body := req.GetQaScorecard()
7623 jsonReq, err := m.Marshal(body)
7624 if err != nil {
7625 return nil, err
7626 }
7627
7628 baseUrl, err := url.Parse(c.endpoint)
7629 if err != nil {
7630 return nil, err
7631 }
7632 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetQaScorecard().GetName())
7633
7634 params := url.Values{}
7635 params.Add("$alt", "json;enum-encoding=int")
7636 if req.GetUpdateMask() != nil {
7637 field, err := protojson.Marshal(req.GetUpdateMask())
7638 if err != nil {
7639 return nil, err
7640 }
7641 params.Add("updateMask", string(field[1:len(field)-1]))
7642 }
7643
7644 baseUrl.RawQuery = params.Encode()
7645
7646 // Build HTTP headers from client and context metadata.
7647 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "qa_scorecard.name", url.QueryEscape(req.GetQaScorecard().GetName()))}
7648
7649 hds = append(c.xGoogHeaders, hds...)
7650 hds = append(hds, "Content-Type", "application/json")
7651 headers := gax.BuildHeaders(ctx, hds...)
7652 opts = append((*c.CallOptions).UpdateQaScorecard[0:len((*c.CallOptions).UpdateQaScorecard):len((*c.CallOptions).UpdateQaScorecard)], opts...)
7653 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
7654 resp := &contactcenterinsightspb.QaScorecard{}
7655 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
7656 if settings.Path != "" {
7657 baseUrl.Path = settings.Path
7658 }
7659 httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq))
7660 if err != nil {
7661 return err
7662 }
7663 httpReq = httpReq.WithContext(ctx)
7664 httpReq.Header = headers
7665
7666 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UpdateQaScorecard")
7667 if err != nil {
7668 return err
7669 }
7670
7671 if err := unm.Unmarshal(buf, resp); err != nil {
7672 return err
7673 }
7674
7675 return nil
7676 }, opts...)
7677 if e != nil {
7678 return nil, e
7679 }
7680 return resp, nil
7681 }
7682
7683 // DeleteQaScorecard deletes a QaScorecard.
7684 func (c *restClient) DeleteQaScorecard(ctx context.Context, req *contactcenterinsightspb.DeleteQaScorecardRequest, opts ...gax.CallOption) error {
7685 baseUrl, err := url.Parse(c.endpoint)
7686 if err != nil {
7687 return err
7688 }
7689 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
7690
7691 params := url.Values{}
7692 params.Add("$alt", "json;enum-encoding=int")
7693 if req.GetForce() {
7694 params.Add("force", fmt.Sprintf("%v", req.GetForce()))
7695 }
7696
7697 baseUrl.RawQuery = params.Encode()
7698
7699 // Build HTTP headers from client and context metadata.
7700 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
7701
7702 hds = append(c.xGoogHeaders, hds...)
7703 hds = append(hds, "Content-Type", "application/json")
7704 headers := gax.BuildHeaders(ctx, hds...)
7705 return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
7706 if settings.Path != "" {
7707 baseUrl.Path = settings.Path
7708 }
7709 httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil)
7710 if err != nil {
7711 return err
7712 }
7713 httpReq = httpReq.WithContext(ctx)
7714 httpReq.Header = headers
7715
7716 _, err = executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteQaScorecard")
7717 return err
7718 }, opts...)
7719 }
7720
7721 // ListQaScorecards lists QaScorecards.
7722 func (c *restClient) ListQaScorecards(ctx context.Context, req *contactcenterinsightspb.ListQaScorecardsRequest, opts ...gax.CallOption) *QaScorecardIterator {
7723 it := &QaScorecardIterator{}
7724 req = proto.Clone(req).(*contactcenterinsightspb.ListQaScorecardsRequest)
7725 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
7726 it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.QaScorecard, string, error) {
7727 resp := &contactcenterinsightspb.ListQaScorecardsResponse{}
7728 if pageToken != "" {
7729 req.PageToken = pageToken
7730 }
7731 if pageSize > math.MaxInt32 {
7732 req.PageSize = math.MaxInt32
7733 } else if pageSize != 0 {
7734 req.PageSize = int32(pageSize)
7735 }
7736 baseUrl, err := url.Parse(c.endpoint)
7737 if err != nil {
7738 return nil, "", err
7739 }
7740 baseUrl.Path += fmt.Sprintf("/v1/%v/qaScorecards", req.GetParent())
7741
7742 params := url.Values{}
7743 params.Add("$alt", "json;enum-encoding=int")
7744 if req.GetPageSize() != 0 {
7745 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
7746 }
7747 if req.GetPageToken() != "" {
7748 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
7749 }
7750
7751 baseUrl.RawQuery = params.Encode()
7752
7753 // Build HTTP headers from client and context metadata.
7754 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
7755 headers := gax.BuildHeaders(ctx, hds...)
7756 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
7757 if settings.Path != "" {
7758 baseUrl.Path = settings.Path
7759 }
7760 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
7761 if err != nil {
7762 return err
7763 }
7764 httpReq.Header = headers
7765
7766 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListQaScorecards")
7767 if err != nil {
7768 return err
7769 }
7770 if err := unm.Unmarshal(buf, resp); err != nil {
7771 return err
7772 }
7773
7774 return nil
7775 }, opts...)
7776 if e != nil {
7777 return nil, "", e
7778 }
7779 it.Response = resp
7780 return resp.GetQaScorecards(), resp.GetNextPageToken(), nil
7781 }
7782
7783 fetch := func(pageSize int, pageToken string) (string, error) {
7784 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
7785 if err != nil {
7786 return "", err
7787 }
7788 it.items = append(it.items, items...)
7789 return nextPageToken, nil
7790 }
7791
7792 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
7793 it.pageInfo.MaxSize = int(req.GetPageSize())
7794 it.pageInfo.Token = req.GetPageToken()
7795
7796 return it
7797 }
7798
7799 // CreateQaScorecardRevision creates a QaScorecardRevision.
7800 func (c *restClient) CreateQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.CreateQaScorecardRevisionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecardRevision, error) {
7801 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
7802 body := req.GetQaScorecardRevision()
7803 jsonReq, err := m.Marshal(body)
7804 if err != nil {
7805 return nil, err
7806 }
7807
7808 baseUrl, err := url.Parse(c.endpoint)
7809 if err != nil {
7810 return nil, err
7811 }
7812 baseUrl.Path += fmt.Sprintf("/v1/%v/revisions", req.GetParent())
7813
7814 params := url.Values{}
7815 params.Add("$alt", "json;enum-encoding=int")
7816 if req.GetQaScorecardRevisionId() != "" {
7817 params.Add("qaScorecardRevisionId", fmt.Sprintf("%v", req.GetQaScorecardRevisionId()))
7818 }
7819
7820 baseUrl.RawQuery = params.Encode()
7821
7822 // Build HTTP headers from client and context metadata.
7823 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
7824
7825 hds = append(c.xGoogHeaders, hds...)
7826 hds = append(hds, "Content-Type", "application/json")
7827 headers := gax.BuildHeaders(ctx, hds...)
7828 opts = append((*c.CallOptions).CreateQaScorecardRevision[0:len((*c.CallOptions).CreateQaScorecardRevision):len((*c.CallOptions).CreateQaScorecardRevision)], opts...)
7829 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
7830 resp := &contactcenterinsightspb.QaScorecardRevision{}
7831 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
7832 if settings.Path != "" {
7833 baseUrl.Path = settings.Path
7834 }
7835 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
7836 if err != nil {
7837 return err
7838 }
7839 httpReq = httpReq.WithContext(ctx)
7840 httpReq.Header = headers
7841
7842 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreateQaScorecardRevision")
7843 if err != nil {
7844 return err
7845 }
7846
7847 if err := unm.Unmarshal(buf, resp); err != nil {
7848 return err
7849 }
7850
7851 return nil
7852 }, opts...)
7853 if e != nil {
7854 return nil, e
7855 }
7856 return resp, nil
7857 }
7858
7859 // GetQaScorecardRevision gets a QaScorecardRevision.
7860 func (c *restClient) GetQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.GetQaScorecardRevisionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecardRevision, error) {
7861 baseUrl, err := url.Parse(c.endpoint)
7862 if err != nil {
7863 return nil, err
7864 }
7865 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
7866
7867 params := url.Values{}
7868 params.Add("$alt", "json;enum-encoding=int")
7869
7870 baseUrl.RawQuery = params.Encode()
7871
7872 // Build HTTP headers from client and context metadata.
7873 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
7874
7875 hds = append(c.xGoogHeaders, hds...)
7876 hds = append(hds, "Content-Type", "application/json")
7877 headers := gax.BuildHeaders(ctx, hds...)
7878 opts = append((*c.CallOptions).GetQaScorecardRevision[0:len((*c.CallOptions).GetQaScorecardRevision):len((*c.CallOptions).GetQaScorecardRevision)], opts...)
7879 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
7880 resp := &contactcenterinsightspb.QaScorecardRevision{}
7881 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
7882 if settings.Path != "" {
7883 baseUrl.Path = settings.Path
7884 }
7885 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
7886 if err != nil {
7887 return err
7888 }
7889 httpReq = httpReq.WithContext(ctx)
7890 httpReq.Header = headers
7891
7892 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetQaScorecardRevision")
7893 if err != nil {
7894 return err
7895 }
7896
7897 if err := unm.Unmarshal(buf, resp); err != nil {
7898 return err
7899 }
7900
7901 return nil
7902 }, opts...)
7903 if e != nil {
7904 return nil, e
7905 }
7906 return resp, nil
7907 }
7908
7909 // TuneQaScorecardRevision fine tune one or more QaModels.
7910 func (c *restClient) TuneQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.TuneQaScorecardRevisionRequest, opts ...gax.CallOption) (*TuneQaScorecardRevisionOperation, error) {
7911 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
7912 jsonReq, err := m.Marshal(req)
7913 if err != nil {
7914 return nil, err
7915 }
7916
7917 baseUrl, err := url.Parse(c.endpoint)
7918 if err != nil {
7919 return nil, err
7920 }
7921 baseUrl.Path += fmt.Sprintf("/v1/%v:tuneQaScorecardRevision", req.GetParent())
7922
7923 params := url.Values{}
7924 params.Add("$alt", "json;enum-encoding=int")
7925
7926 baseUrl.RawQuery = params.Encode()
7927
7928 // Build HTTP headers from client and context metadata.
7929 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
7930
7931 hds = append(c.xGoogHeaders, hds...)
7932 hds = append(hds, "Content-Type", "application/json")
7933 headers := gax.BuildHeaders(ctx, hds...)
7934 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
7935 resp := &longrunningpb.Operation{}
7936 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
7937 if settings.Path != "" {
7938 baseUrl.Path = settings.Path
7939 }
7940 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
7941 if err != nil {
7942 return err
7943 }
7944 httpReq = httpReq.WithContext(ctx)
7945 httpReq.Header = headers
7946
7947 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "TuneQaScorecardRevision")
7948 if err != nil {
7949 return err
7950 }
7951 if err := unm.Unmarshal(buf, resp); err != nil {
7952 return err
7953 }
7954
7955 return nil
7956 }, opts...)
7957 if e != nil {
7958 return nil, e
7959 }
7960
7961 override := fmt.Sprintf("/v1/%s", resp.GetName())
7962 return &TuneQaScorecardRevisionOperation{
7963 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
7964 pollPath: override,
7965 }, nil
7966 }
7967
7968 // DeployQaScorecardRevision deploy a QaScorecardRevision.
7969 func (c *restClient) DeployQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.DeployQaScorecardRevisionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecardRevision, error) {
7970 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
7971 jsonReq, err := m.Marshal(req)
7972 if err != nil {
7973 return nil, err
7974 }
7975
7976 baseUrl, err := url.Parse(c.endpoint)
7977 if err != nil {
7978 return nil, err
7979 }
7980 baseUrl.Path += fmt.Sprintf("/v1/%v:deploy", req.GetName())
7981
7982 params := url.Values{}
7983 params.Add("$alt", "json;enum-encoding=int")
7984
7985 baseUrl.RawQuery = params.Encode()
7986
7987 // Build HTTP headers from client and context metadata.
7988 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
7989
7990 hds = append(c.xGoogHeaders, hds...)
7991 hds = append(hds, "Content-Type", "application/json")
7992 headers := gax.BuildHeaders(ctx, hds...)
7993 opts = append((*c.CallOptions).DeployQaScorecardRevision[0:len((*c.CallOptions).DeployQaScorecardRevision):len((*c.CallOptions).DeployQaScorecardRevision)], opts...)
7994 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
7995 resp := &contactcenterinsightspb.QaScorecardRevision{}
7996 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
7997 if settings.Path != "" {
7998 baseUrl.Path = settings.Path
7999 }
8000 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
8001 if err != nil {
8002 return err
8003 }
8004 httpReq = httpReq.WithContext(ctx)
8005 httpReq.Header = headers
8006
8007 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "DeployQaScorecardRevision")
8008 if err != nil {
8009 return err
8010 }
8011
8012 if err := unm.Unmarshal(buf, resp); err != nil {
8013 return err
8014 }
8015
8016 return nil
8017 }, opts...)
8018 if e != nil {
8019 return nil, e
8020 }
8021 return resp, nil
8022 }
8023
8024 // UndeployQaScorecardRevision undeploy a QaScorecardRevision.
8025 func (c *restClient) UndeployQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.UndeployQaScorecardRevisionRequest, opts ...gax.CallOption) (*contactcenterinsightspb.QaScorecardRevision, error) {
8026 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
8027 jsonReq, err := m.Marshal(req)
8028 if err != nil {
8029 return nil, err
8030 }
8031
8032 baseUrl, err := url.Parse(c.endpoint)
8033 if err != nil {
8034 return nil, err
8035 }
8036 baseUrl.Path += fmt.Sprintf("/v1/%v:undeploy", req.GetName())
8037
8038 params := url.Values{}
8039 params.Add("$alt", "json;enum-encoding=int")
8040
8041 baseUrl.RawQuery = params.Encode()
8042
8043 // Build HTTP headers from client and context metadata.
8044 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
8045
8046 hds = append(c.xGoogHeaders, hds...)
8047 hds = append(hds, "Content-Type", "application/json")
8048 headers := gax.BuildHeaders(ctx, hds...)
8049 opts = append((*c.CallOptions).UndeployQaScorecardRevision[0:len((*c.CallOptions).UndeployQaScorecardRevision):len((*c.CallOptions).UndeployQaScorecardRevision)], opts...)
8050 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
8051 resp := &contactcenterinsightspb.QaScorecardRevision{}
8052 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
8053 if settings.Path != "" {
8054 baseUrl.Path = settings.Path
8055 }
8056 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
8057 if err != nil {
8058 return err
8059 }
8060 httpReq = httpReq.WithContext(ctx)
8061 httpReq.Header = headers
8062
8063 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UndeployQaScorecardRevision")
8064 if err != nil {
8065 return err
8066 }
8067
8068 if err := unm.Unmarshal(buf, resp); err != nil {
8069 return err
8070 }
8071
8072 return nil
8073 }, opts...)
8074 if e != nil {
8075 return nil, e
8076 }
8077 return resp, nil
8078 }
8079
8080 // DeleteQaScorecardRevision deletes a QaScorecardRevision.
8081 func (c *restClient) DeleteQaScorecardRevision(ctx context.Context, req *contactcenterinsightspb.DeleteQaScorecardRevisionRequest, opts ...gax.CallOption) error {
8082 baseUrl, err := url.Parse(c.endpoint)
8083 if err != nil {
8084 return err
8085 }
8086 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
8087
8088 params := url.Values{}
8089 params.Add("$alt", "json;enum-encoding=int")
8090 if req.GetForce() {
8091 params.Add("force", fmt.Sprintf("%v", req.GetForce()))
8092 }
8093
8094 baseUrl.RawQuery = params.Encode()
8095
8096 // Build HTTP headers from client and context metadata.
8097 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
8098
8099 hds = append(c.xGoogHeaders, hds...)
8100 hds = append(hds, "Content-Type", "application/json")
8101 headers := gax.BuildHeaders(ctx, hds...)
8102 return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
8103 if settings.Path != "" {
8104 baseUrl.Path = settings.Path
8105 }
8106 httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil)
8107 if err != nil {
8108 return err
8109 }
8110 httpReq = httpReq.WithContext(ctx)
8111 httpReq.Header = headers
8112
8113 _, err = executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteQaScorecardRevision")
8114 return err
8115 }, opts...)
8116 }
8117
8118 // ListQaScorecardRevisions lists all revisions under the parent QaScorecard.
8119 func (c *restClient) ListQaScorecardRevisions(ctx context.Context, req *contactcenterinsightspb.ListQaScorecardRevisionsRequest, opts ...gax.CallOption) *QaScorecardRevisionIterator {
8120 it := &QaScorecardRevisionIterator{}
8121 req = proto.Clone(req).(*contactcenterinsightspb.ListQaScorecardRevisionsRequest)
8122 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
8123 it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.QaScorecardRevision, string, error) {
8124 resp := &contactcenterinsightspb.ListQaScorecardRevisionsResponse{}
8125 if pageToken != "" {
8126 req.PageToken = pageToken
8127 }
8128 if pageSize > math.MaxInt32 {
8129 req.PageSize = math.MaxInt32
8130 } else if pageSize != 0 {
8131 req.PageSize = int32(pageSize)
8132 }
8133 baseUrl, err := url.Parse(c.endpoint)
8134 if err != nil {
8135 return nil, "", err
8136 }
8137 baseUrl.Path += fmt.Sprintf("/v1/%v/revisions", req.GetParent())
8138
8139 params := url.Values{}
8140 params.Add("$alt", "json;enum-encoding=int")
8141 if req.GetFilter() != "" {
8142 params.Add("filter", fmt.Sprintf("%v", req.GetFilter()))
8143 }
8144 if req.GetPageSize() != 0 {
8145 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
8146 }
8147 if req.GetPageToken() != "" {
8148 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
8149 }
8150
8151 baseUrl.RawQuery = params.Encode()
8152
8153 // Build HTTP headers from client and context metadata.
8154 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
8155 headers := gax.BuildHeaders(ctx, hds...)
8156 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
8157 if settings.Path != "" {
8158 baseUrl.Path = settings.Path
8159 }
8160 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
8161 if err != nil {
8162 return err
8163 }
8164 httpReq.Header = headers
8165
8166 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListQaScorecardRevisions")
8167 if err != nil {
8168 return err
8169 }
8170 if err := unm.Unmarshal(buf, resp); err != nil {
8171 return err
8172 }
8173
8174 return nil
8175 }, opts...)
8176 if e != nil {
8177 return nil, "", e
8178 }
8179 it.Response = resp
8180 return resp.GetQaScorecardRevisions(), resp.GetNextPageToken(), nil
8181 }
8182
8183 fetch := func(pageSize int, pageToken string) (string, error) {
8184 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
8185 if err != nil {
8186 return "", err
8187 }
8188 it.items = append(it.items, items...)
8189 return nextPageToken, nil
8190 }
8191
8192 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
8193 it.pageInfo.MaxSize = int(req.GetPageSize())
8194 it.pageInfo.Token = req.GetPageToken()
8195
8196 return it
8197 }
8198
8199 // CreateFeedbackLabel create feedback label.
8200 func (c *restClient) CreateFeedbackLabel(ctx context.Context, req *contactcenterinsightspb.CreateFeedbackLabelRequest, opts ...gax.CallOption) (*contactcenterinsightspb.FeedbackLabel, error) {
8201 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
8202 body := req.GetFeedbackLabel()
8203 jsonReq, err := m.Marshal(body)
8204 if err != nil {
8205 return nil, err
8206 }
8207
8208 baseUrl, err := url.Parse(c.endpoint)
8209 if err != nil {
8210 return nil, err
8211 }
8212 baseUrl.Path += fmt.Sprintf("/v1/%v/feedbackLabels", req.GetParent())
8213
8214 params := url.Values{}
8215 params.Add("$alt", "json;enum-encoding=int")
8216 if req.GetFeedbackLabelId() != "" {
8217 params.Add("feedbackLabelId", fmt.Sprintf("%v", req.GetFeedbackLabelId()))
8218 }
8219
8220 baseUrl.RawQuery = params.Encode()
8221
8222 // Build HTTP headers from client and context metadata.
8223 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
8224
8225 hds = append(c.xGoogHeaders, hds...)
8226 hds = append(hds, "Content-Type", "application/json")
8227 headers := gax.BuildHeaders(ctx, hds...)
8228 opts = append((*c.CallOptions).CreateFeedbackLabel[0:len((*c.CallOptions).CreateFeedbackLabel):len((*c.CallOptions).CreateFeedbackLabel)], opts...)
8229 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
8230 resp := &contactcenterinsightspb.FeedbackLabel{}
8231 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
8232 if settings.Path != "" {
8233 baseUrl.Path = settings.Path
8234 }
8235 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
8236 if err != nil {
8237 return err
8238 }
8239 httpReq = httpReq.WithContext(ctx)
8240 httpReq.Header = headers
8241
8242 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreateFeedbackLabel")
8243 if err != nil {
8244 return err
8245 }
8246
8247 if err := unm.Unmarshal(buf, resp); err != nil {
8248 return err
8249 }
8250
8251 return nil
8252 }, opts...)
8253 if e != nil {
8254 return nil, e
8255 }
8256 return resp, nil
8257 }
8258
8259 // ListFeedbackLabels list feedback labels.
8260 func (c *restClient) ListFeedbackLabels(ctx context.Context, req *contactcenterinsightspb.ListFeedbackLabelsRequest, opts ...gax.CallOption) *FeedbackLabelIterator {
8261 it := &FeedbackLabelIterator{}
8262 req = proto.Clone(req).(*contactcenterinsightspb.ListFeedbackLabelsRequest)
8263 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
8264 it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.FeedbackLabel, string, error) {
8265 resp := &contactcenterinsightspb.ListFeedbackLabelsResponse{}
8266 if pageToken != "" {
8267 req.PageToken = pageToken
8268 }
8269 if pageSize > math.MaxInt32 {
8270 req.PageSize = math.MaxInt32
8271 } else if pageSize != 0 {
8272 req.PageSize = int32(pageSize)
8273 }
8274 baseUrl, err := url.Parse(c.endpoint)
8275 if err != nil {
8276 return nil, "", err
8277 }
8278 baseUrl.Path += fmt.Sprintf("/v1/%v/feedbackLabels", req.GetParent())
8279
8280 params := url.Values{}
8281 params.Add("$alt", "json;enum-encoding=int")
8282 if req.GetFilter() != "" {
8283 params.Add("filter", fmt.Sprintf("%v", req.GetFilter()))
8284 }
8285 if req.GetPageSize() != 0 {
8286 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
8287 }
8288 if req.GetPageToken() != "" {
8289 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
8290 }
8291
8292 baseUrl.RawQuery = params.Encode()
8293
8294 // Build HTTP headers from client and context metadata.
8295 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
8296 headers := gax.BuildHeaders(ctx, hds...)
8297 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
8298 if settings.Path != "" {
8299 baseUrl.Path = settings.Path
8300 }
8301 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
8302 if err != nil {
8303 return err
8304 }
8305 httpReq.Header = headers
8306
8307 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListFeedbackLabels")
8308 if err != nil {
8309 return err
8310 }
8311 if err := unm.Unmarshal(buf, resp); err != nil {
8312 return err
8313 }
8314
8315 return nil
8316 }, opts...)
8317 if e != nil {
8318 return nil, "", e
8319 }
8320 it.Response = resp
8321 return resp.GetFeedbackLabels(), resp.GetNextPageToken(), nil
8322 }
8323
8324 fetch := func(pageSize int, pageToken string) (string, error) {
8325 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
8326 if err != nil {
8327 return "", err
8328 }
8329 it.items = append(it.items, items...)
8330 return nextPageToken, nil
8331 }
8332
8333 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
8334 it.pageInfo.MaxSize = int(req.GetPageSize())
8335 it.pageInfo.Token = req.GetPageToken()
8336
8337 return it
8338 }
8339
8340 // GetFeedbackLabel get feedback label.
8341 func (c *restClient) GetFeedbackLabel(ctx context.Context, req *contactcenterinsightspb.GetFeedbackLabelRequest, opts ...gax.CallOption) (*contactcenterinsightspb.FeedbackLabel, error) {
8342 baseUrl, err := url.Parse(c.endpoint)
8343 if err != nil {
8344 return nil, err
8345 }
8346 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
8347
8348 params := url.Values{}
8349 params.Add("$alt", "json;enum-encoding=int")
8350
8351 baseUrl.RawQuery = params.Encode()
8352
8353 // Build HTTP headers from client and context metadata.
8354 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
8355
8356 hds = append(c.xGoogHeaders, hds...)
8357 hds = append(hds, "Content-Type", "application/json")
8358 headers := gax.BuildHeaders(ctx, hds...)
8359 opts = append((*c.CallOptions).GetFeedbackLabel[0:len((*c.CallOptions).GetFeedbackLabel):len((*c.CallOptions).GetFeedbackLabel)], opts...)
8360 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
8361 resp := &contactcenterinsightspb.FeedbackLabel{}
8362 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
8363 if settings.Path != "" {
8364 baseUrl.Path = settings.Path
8365 }
8366 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
8367 if err != nil {
8368 return err
8369 }
8370 httpReq = httpReq.WithContext(ctx)
8371 httpReq.Header = headers
8372
8373 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetFeedbackLabel")
8374 if err != nil {
8375 return err
8376 }
8377
8378 if err := unm.Unmarshal(buf, resp); err != nil {
8379 return err
8380 }
8381
8382 return nil
8383 }, opts...)
8384 if e != nil {
8385 return nil, e
8386 }
8387 return resp, nil
8388 }
8389
8390 // UpdateFeedbackLabel update feedback label.
8391 func (c *restClient) UpdateFeedbackLabel(ctx context.Context, req *contactcenterinsightspb.UpdateFeedbackLabelRequest, opts ...gax.CallOption) (*contactcenterinsightspb.FeedbackLabel, error) {
8392 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
8393 body := req.GetFeedbackLabel()
8394 jsonReq, err := m.Marshal(body)
8395 if err != nil {
8396 return nil, err
8397 }
8398
8399 baseUrl, err := url.Parse(c.endpoint)
8400 if err != nil {
8401 return nil, err
8402 }
8403 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetFeedbackLabel().GetName())
8404
8405 params := url.Values{}
8406 params.Add("$alt", "json;enum-encoding=int")
8407 if req.GetUpdateMask() != nil {
8408 field, err := protojson.Marshal(req.GetUpdateMask())
8409 if err != nil {
8410 return nil, err
8411 }
8412 params.Add("updateMask", string(field[1:len(field)-1]))
8413 }
8414
8415 baseUrl.RawQuery = params.Encode()
8416
8417 // Build HTTP headers from client and context metadata.
8418 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "feedback_label.name", url.QueryEscape(req.GetFeedbackLabel().GetName()))}
8419
8420 hds = append(c.xGoogHeaders, hds...)
8421 hds = append(hds, "Content-Type", "application/json")
8422 headers := gax.BuildHeaders(ctx, hds...)
8423 opts = append((*c.CallOptions).UpdateFeedbackLabel[0:len((*c.CallOptions).UpdateFeedbackLabel):len((*c.CallOptions).UpdateFeedbackLabel)], opts...)
8424 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
8425 resp := &contactcenterinsightspb.FeedbackLabel{}
8426 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
8427 if settings.Path != "" {
8428 baseUrl.Path = settings.Path
8429 }
8430 httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq))
8431 if err != nil {
8432 return err
8433 }
8434 httpReq = httpReq.WithContext(ctx)
8435 httpReq.Header = headers
8436
8437 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UpdateFeedbackLabel")
8438 if err != nil {
8439 return err
8440 }
8441
8442 if err := unm.Unmarshal(buf, resp); err != nil {
8443 return err
8444 }
8445
8446 return nil
8447 }, opts...)
8448 if e != nil {
8449 return nil, e
8450 }
8451 return resp, nil
8452 }
8453
8454 // DeleteFeedbackLabel delete feedback label.
8455 func (c *restClient) DeleteFeedbackLabel(ctx context.Context, req *contactcenterinsightspb.DeleteFeedbackLabelRequest, opts ...gax.CallOption) error {
8456 baseUrl, err := url.Parse(c.endpoint)
8457 if err != nil {
8458 return err
8459 }
8460 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
8461
8462 params := url.Values{}
8463 params.Add("$alt", "json;enum-encoding=int")
8464
8465 baseUrl.RawQuery = params.Encode()
8466
8467 // Build HTTP headers from client and context metadata.
8468 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
8469
8470 hds = append(c.xGoogHeaders, hds...)
8471 hds = append(hds, "Content-Type", "application/json")
8472 headers := gax.BuildHeaders(ctx, hds...)
8473 return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
8474 if settings.Path != "" {
8475 baseUrl.Path = settings.Path
8476 }
8477 httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil)
8478 if err != nil {
8479 return err
8480 }
8481 httpReq = httpReq.WithContext(ctx)
8482 httpReq.Header = headers
8483
8484 _, err = executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteFeedbackLabel")
8485 return err
8486 }, opts...)
8487 }
8488
8489 // ListAllFeedbackLabels list all feedback labels by project number.
8490 func (c *restClient) ListAllFeedbackLabels(ctx context.Context, req *contactcenterinsightspb.ListAllFeedbackLabelsRequest, opts ...gax.CallOption) *FeedbackLabelIterator {
8491 it := &FeedbackLabelIterator{}
8492 req = proto.Clone(req).(*contactcenterinsightspb.ListAllFeedbackLabelsRequest)
8493 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
8494 it.InternalFetch = func(pageSize int, pageToken string) ([]*contactcenterinsightspb.FeedbackLabel, string, error) {
8495 resp := &contactcenterinsightspb.ListAllFeedbackLabelsResponse{}
8496 if pageToken != "" {
8497 req.PageToken = pageToken
8498 }
8499 if pageSize > math.MaxInt32 {
8500 req.PageSize = math.MaxInt32
8501 } else if pageSize != 0 {
8502 req.PageSize = int32(pageSize)
8503 }
8504 baseUrl, err := url.Parse(c.endpoint)
8505 if err != nil {
8506 return nil, "", err
8507 }
8508 baseUrl.Path += fmt.Sprintf("/v1/%v:listAllFeedbackLabels", req.GetParent())
8509
8510 params := url.Values{}
8511 params.Add("$alt", "json;enum-encoding=int")
8512 if req.GetFilter() != "" {
8513 params.Add("filter", fmt.Sprintf("%v", req.GetFilter()))
8514 }
8515 if req.GetPageSize() != 0 {
8516 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
8517 }
8518 if req.GetPageToken() != "" {
8519 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
8520 }
8521
8522 baseUrl.RawQuery = params.Encode()
8523
8524 // Build HTTP headers from client and context metadata.
8525 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
8526 headers := gax.BuildHeaders(ctx, hds...)
8527 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
8528 if settings.Path != "" {
8529 baseUrl.Path = settings.Path
8530 }
8531 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
8532 if err != nil {
8533 return err
8534 }
8535 httpReq.Header = headers
8536
8537 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListAllFeedbackLabels")
8538 if err != nil {
8539 return err
8540 }
8541 if err := unm.Unmarshal(buf, resp); err != nil {
8542 return err
8543 }
8544
8545 return nil
8546 }, opts...)
8547 if e != nil {
8548 return nil, "", e
8549 }
8550 it.Response = resp
8551 return resp.GetFeedbackLabels(), resp.GetNextPageToken(), nil
8552 }
8553
8554 fetch := func(pageSize int, pageToken string) (string, error) {
8555 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
8556 if err != nil {
8557 return "", err
8558 }
8559 it.items = append(it.items, items...)
8560 return nextPageToken, nil
8561 }
8562
8563 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
8564 it.pageInfo.MaxSize = int(req.GetPageSize())
8565 it.pageInfo.Token = req.GetPageToken()
8566
8567 return it
8568 }
8569
8570 // BulkUploadFeedbackLabels upload feedback labels in bulk.
8571 func (c *restClient) BulkUploadFeedbackLabels(ctx context.Context, req *contactcenterinsightspb.BulkUploadFeedbackLabelsRequest, opts ...gax.CallOption) (*BulkUploadFeedbackLabelsOperation, error) {
8572 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
8573 jsonReq, err := m.Marshal(req)
8574 if err != nil {
8575 return nil, err
8576 }
8577
8578 baseUrl, err := url.Parse(c.endpoint)
8579 if err != nil {
8580 return nil, err
8581 }
8582 baseUrl.Path += fmt.Sprintf("/v1/%v:bulkUploadFeedbackLabels", req.GetParent())
8583
8584 params := url.Values{}
8585 params.Add("$alt", "json;enum-encoding=int")
8586
8587 baseUrl.RawQuery = params.Encode()
8588
8589 // Build HTTP headers from client and context metadata.
8590 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
8591
8592 hds = append(c.xGoogHeaders, hds...)
8593 hds = append(hds, "Content-Type", "application/json")
8594 headers := gax.BuildHeaders(ctx, hds...)
8595 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
8596 resp := &longrunningpb.Operation{}
8597 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
8598 if settings.Path != "" {
8599 baseUrl.Path = settings.Path
8600 }
8601 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
8602 if err != nil {
8603 return err
8604 }
8605 httpReq = httpReq.WithContext(ctx)
8606 httpReq.Header = headers
8607
8608 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "BulkUploadFeedbackLabels")
8609 if err != nil {
8610 return err
8611 }
8612 if err := unm.Unmarshal(buf, resp); err != nil {
8613 return err
8614 }
8615
8616 return nil
8617 }, opts...)
8618 if e != nil {
8619 return nil, e
8620 }
8621
8622 override := fmt.Sprintf("/v1/%s", resp.GetName())
8623 return &BulkUploadFeedbackLabelsOperation{
8624 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
8625 pollPath: override,
8626 }, nil
8627 }
8628
8629 // BulkDownloadFeedbackLabels download feedback labels in bulk.
8630 func (c *restClient) BulkDownloadFeedbackLabels(ctx context.Context, req *contactcenterinsightspb.BulkDownloadFeedbackLabelsRequest, opts ...gax.CallOption) (*BulkDownloadFeedbackLabelsOperation, error) {
8631 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
8632 jsonReq, err := m.Marshal(req)
8633 if err != nil {
8634 return nil, err
8635 }
8636
8637 baseUrl, err := url.Parse(c.endpoint)
8638 if err != nil {
8639 return nil, err
8640 }
8641 baseUrl.Path += fmt.Sprintf("/v1/%v:bulkDownloadFeedbackLabels", req.GetParent())
8642
8643 params := url.Values{}
8644 params.Add("$alt", "json;enum-encoding=int")
8645
8646 baseUrl.RawQuery = params.Encode()
8647
8648 // Build HTTP headers from client and context metadata.
8649 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
8650
8651 hds = append(c.xGoogHeaders, hds...)
8652 hds = append(hds, "Content-Type", "application/json")
8653 headers := gax.BuildHeaders(ctx, hds...)
8654 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
8655 resp := &longrunningpb.Operation{}
8656 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
8657 if settings.Path != "" {
8658 baseUrl.Path = settings.Path
8659 }
8660 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
8661 if err != nil {
8662 return err
8663 }
8664 httpReq = httpReq.WithContext(ctx)
8665 httpReq.Header = headers
8666
8667 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "BulkDownloadFeedbackLabels")
8668 if err != nil {
8669 return err
8670 }
8671 if err := unm.Unmarshal(buf, resp); err != nil {
8672 return err
8673 }
8674
8675 return nil
8676 }, opts...)
8677 if e != nil {
8678 return nil, e
8679 }
8680
8681 override := fmt.Sprintf("/v1/%s", resp.GetName())
8682 return &BulkDownloadFeedbackLabelsOperation{
8683 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
8684 pollPath: override,
8685 }, nil
8686 }
8687
8688 // CancelOperation is a utility method from google.longrunning.Operations.
8689 func (c *restClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error {
8690 baseUrl, err := url.Parse(c.endpoint)
8691 if err != nil {
8692 return err
8693 }
8694 baseUrl.Path += fmt.Sprintf("/v1/%v:cancel", req.GetName())
8695
8696 params := url.Values{}
8697 params.Add("$alt", "json;enum-encoding=int")
8698
8699 baseUrl.RawQuery = params.Encode()
8700
8701 // Build HTTP headers from client and context metadata.
8702 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
8703
8704 hds = append(c.xGoogHeaders, hds...)
8705 hds = append(hds, "Content-Type", "application/json")
8706 headers := gax.BuildHeaders(ctx, hds...)
8707 return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
8708 if settings.Path != "" {
8709 baseUrl.Path = settings.Path
8710 }
8711 httpReq, err := http.NewRequest("POST", baseUrl.String(), nil)
8712 if err != nil {
8713 return err
8714 }
8715 httpReq = httpReq.WithContext(ctx)
8716 httpReq.Header = headers
8717
8718 _, err = executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "CancelOperation")
8719 return err
8720 }, opts...)
8721 }
8722
8723 // GetOperation is a utility method from google.longrunning.Operations.
8724 func (c *restClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) {
8725 baseUrl, err := url.Parse(c.endpoint)
8726 if err != nil {
8727 return nil, err
8728 }
8729 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
8730
8731 params := url.Values{}
8732 params.Add("$alt", "json;enum-encoding=int")
8733
8734 baseUrl.RawQuery = params.Encode()
8735
8736 // Build HTTP headers from client and context metadata.
8737 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
8738
8739 hds = append(c.xGoogHeaders, hds...)
8740 hds = append(hds, "Content-Type", "application/json")
8741 headers := gax.BuildHeaders(ctx, hds...)
8742 opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...)
8743 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
8744 resp := &longrunningpb.Operation{}
8745 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
8746 if settings.Path != "" {
8747 baseUrl.Path = settings.Path
8748 }
8749 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
8750 if err != nil {
8751 return err
8752 }
8753 httpReq = httpReq.WithContext(ctx)
8754 httpReq.Header = headers
8755
8756 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetOperation")
8757 if err != nil {
8758 return err
8759 }
8760
8761 if err := unm.Unmarshal(buf, resp); err != nil {
8762 return err
8763 }
8764
8765 return nil
8766 }, opts...)
8767 if e != nil {
8768 return nil, e
8769 }
8770 return resp, nil
8771 }
8772
8773 // ListOperations is a utility method from google.longrunning.Operations.
8774 func (c *restClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator {
8775 it := &OperationIterator{}
8776 req = proto.Clone(req).(*longrunningpb.ListOperationsRequest)
8777 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
8778 it.InternalFetch = func(pageSize int, pageToken string) ([]*longrunningpb.Operation, string, error) {
8779 resp := &longrunningpb.ListOperationsResponse{}
8780 if pageToken != "" {
8781 req.PageToken = pageToken
8782 }
8783 if pageSize > math.MaxInt32 {
8784 req.PageSize = math.MaxInt32
8785 } else if pageSize != 0 {
8786 req.PageSize = int32(pageSize)
8787 }
8788 baseUrl, err := url.Parse(c.endpoint)
8789 if err != nil {
8790 return nil, "", err
8791 }
8792 baseUrl.Path += fmt.Sprintf("/v1/%v/operations", req.GetName())
8793
8794 params := url.Values{}
8795 params.Add("$alt", "json;enum-encoding=int")
8796 if req.GetFilter() != "" {
8797 params.Add("filter", fmt.Sprintf("%v", req.GetFilter()))
8798 }
8799 if req.GetPageSize() != 0 {
8800 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
8801 }
8802 if req.GetPageToken() != "" {
8803 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
8804 }
8805
8806 baseUrl.RawQuery = params.Encode()
8807
8808 // Build HTTP headers from client and context metadata.
8809 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
8810 headers := gax.BuildHeaders(ctx, hds...)
8811 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
8812 if settings.Path != "" {
8813 baseUrl.Path = settings.Path
8814 }
8815 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
8816 if err != nil {
8817 return err
8818 }
8819 httpReq.Header = headers
8820
8821 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListOperations")
8822 if err != nil {
8823 return err
8824 }
8825 if err := unm.Unmarshal(buf, resp); err != nil {
8826 return err
8827 }
8828
8829 return nil
8830 }, opts...)
8831 if e != nil {
8832 return nil, "", e
8833 }
8834 it.Response = resp
8835 return resp.GetOperations(), resp.GetNextPageToken(), nil
8836 }
8837
8838 fetch := func(pageSize int, pageToken string) (string, error) {
8839 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
8840 if err != nil {
8841 return "", err
8842 }
8843 it.items = append(it.items, items...)
8844 return nextPageToken, nil
8845 }
8846
8847 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
8848 it.pageInfo.MaxSize = int(req.GetPageSize())
8849 it.pageInfo.Token = req.GetPageToken()
8850
8851 return it
8852 }
8853
8854 // BulkAnalyzeConversationsOperation returns a new BulkAnalyzeConversationsOperation from a given name.
8855 // The name must be that of a previously created BulkAnalyzeConversationsOperation, possibly from a different process.
8856 func (c *gRPCClient) BulkAnalyzeConversationsOperation(name string) *BulkAnalyzeConversationsOperation {
8857 return &BulkAnalyzeConversationsOperation{
8858 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
8859 }
8860 }
8861
8862 // BulkAnalyzeConversationsOperation returns a new BulkAnalyzeConversationsOperation from a given name.
8863 // The name must be that of a previously created BulkAnalyzeConversationsOperation, possibly from a different process.
8864 func (c *restClient) BulkAnalyzeConversationsOperation(name string) *BulkAnalyzeConversationsOperation {
8865 override := fmt.Sprintf("/v1/%s", name)
8866 return &BulkAnalyzeConversationsOperation{
8867 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
8868 pollPath: override,
8869 }
8870 }
8871
8872 // BulkDeleteConversationsOperation returns a new BulkDeleteConversationsOperation from a given name.
8873 // The name must be that of a previously created BulkDeleteConversationsOperation, possibly from a different process.
8874 func (c *gRPCClient) BulkDeleteConversationsOperation(name string) *BulkDeleteConversationsOperation {
8875 return &BulkDeleteConversationsOperation{
8876 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
8877 }
8878 }
8879
8880 // BulkDeleteConversationsOperation returns a new BulkDeleteConversationsOperation from a given name.
8881 // The name must be that of a previously created BulkDeleteConversationsOperation, possibly from a different process.
8882 func (c *restClient) BulkDeleteConversationsOperation(name string) *BulkDeleteConversationsOperation {
8883 override := fmt.Sprintf("/v1/%s", name)
8884 return &BulkDeleteConversationsOperation{
8885 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
8886 pollPath: override,
8887 }
8888 }
8889
8890 // BulkDownloadFeedbackLabelsOperation returns a new BulkDownloadFeedbackLabelsOperation from a given name.
8891 // The name must be that of a previously created BulkDownloadFeedbackLabelsOperation, possibly from a different process.
8892 func (c *gRPCClient) BulkDownloadFeedbackLabelsOperation(name string) *BulkDownloadFeedbackLabelsOperation {
8893 return &BulkDownloadFeedbackLabelsOperation{
8894 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
8895 }
8896 }
8897
8898 // BulkDownloadFeedbackLabelsOperation returns a new BulkDownloadFeedbackLabelsOperation from a given name.
8899 // The name must be that of a previously created BulkDownloadFeedbackLabelsOperation, possibly from a different process.
8900 func (c *restClient) BulkDownloadFeedbackLabelsOperation(name string) *BulkDownloadFeedbackLabelsOperation {
8901 override := fmt.Sprintf("/v1/%s", name)
8902 return &BulkDownloadFeedbackLabelsOperation{
8903 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
8904 pollPath: override,
8905 }
8906 }
8907
8908 // BulkUploadFeedbackLabelsOperation returns a new BulkUploadFeedbackLabelsOperation from a given name.
8909 // The name must be that of a previously created BulkUploadFeedbackLabelsOperation, possibly from a different process.
8910 func (c *gRPCClient) BulkUploadFeedbackLabelsOperation(name string) *BulkUploadFeedbackLabelsOperation {
8911 return &BulkUploadFeedbackLabelsOperation{
8912 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
8913 }
8914 }
8915
8916 // BulkUploadFeedbackLabelsOperation returns a new BulkUploadFeedbackLabelsOperation from a given name.
8917 // The name must be that of a previously created BulkUploadFeedbackLabelsOperation, possibly from a different process.
8918 func (c *restClient) BulkUploadFeedbackLabelsOperation(name string) *BulkUploadFeedbackLabelsOperation {
8919 override := fmt.Sprintf("/v1/%s", name)
8920 return &BulkUploadFeedbackLabelsOperation{
8921 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
8922 pollPath: override,
8923 }
8924 }
8925
8926 // CreateAnalysisOperation returns a new CreateAnalysisOperation from a given name.
8927 // The name must be that of a previously created CreateAnalysisOperation, possibly from a different process.
8928 func (c *gRPCClient) CreateAnalysisOperation(name string) *CreateAnalysisOperation {
8929 return &CreateAnalysisOperation{
8930 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
8931 }
8932 }
8933
8934 // CreateAnalysisOperation returns a new CreateAnalysisOperation from a given name.
8935 // The name must be that of a previously created CreateAnalysisOperation, possibly from a different process.
8936 func (c *restClient) CreateAnalysisOperation(name string) *CreateAnalysisOperation {
8937 override := fmt.Sprintf("/v1/%s", name)
8938 return &CreateAnalysisOperation{
8939 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
8940 pollPath: override,
8941 }
8942 }
8943
8944 // CreateIssueModelOperation returns a new CreateIssueModelOperation from a given name.
8945 // The name must be that of a previously created CreateIssueModelOperation, possibly from a different process.
8946 func (c *gRPCClient) CreateIssueModelOperation(name string) *CreateIssueModelOperation {
8947 return &CreateIssueModelOperation{
8948 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
8949 }
8950 }
8951
8952 // CreateIssueModelOperation returns a new CreateIssueModelOperation from a given name.
8953 // The name must be that of a previously created CreateIssueModelOperation, possibly from a different process.
8954 func (c *restClient) CreateIssueModelOperation(name string) *CreateIssueModelOperation {
8955 override := fmt.Sprintf("/v1/%s", name)
8956 return &CreateIssueModelOperation{
8957 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
8958 pollPath: override,
8959 }
8960 }
8961
8962 // DeleteIssueModelOperation returns a new DeleteIssueModelOperation from a given name.
8963 // The name must be that of a previously created DeleteIssueModelOperation, possibly from a different process.
8964 func (c *gRPCClient) DeleteIssueModelOperation(name string) *DeleteIssueModelOperation {
8965 return &DeleteIssueModelOperation{
8966 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
8967 }
8968 }
8969
8970 // DeleteIssueModelOperation returns a new DeleteIssueModelOperation from a given name.
8971 // The name must be that of a previously created DeleteIssueModelOperation, possibly from a different process.
8972 func (c *restClient) DeleteIssueModelOperation(name string) *DeleteIssueModelOperation {
8973 override := fmt.Sprintf("/v1/%s", name)
8974 return &DeleteIssueModelOperation{
8975 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
8976 pollPath: override,
8977 }
8978 }
8979
8980 // DeployIssueModelOperation returns a new DeployIssueModelOperation from a given name.
8981 // The name must be that of a previously created DeployIssueModelOperation, possibly from a different process.
8982 func (c *gRPCClient) DeployIssueModelOperation(name string) *DeployIssueModelOperation {
8983 return &DeployIssueModelOperation{
8984 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
8985 }
8986 }
8987
8988 // DeployIssueModelOperation returns a new DeployIssueModelOperation from a given name.
8989 // The name must be that of a previously created DeployIssueModelOperation, possibly from a different process.
8990 func (c *restClient) DeployIssueModelOperation(name string) *DeployIssueModelOperation {
8991 override := fmt.Sprintf("/v1/%s", name)
8992 return &DeployIssueModelOperation{
8993 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
8994 pollPath: override,
8995 }
8996 }
8997
8998 // ExportInsightsDataOperation returns a new ExportInsightsDataOperation from a given name.
8999 // The name must be that of a previously created ExportInsightsDataOperation, possibly from a different process.
9000 func (c *gRPCClient) ExportInsightsDataOperation(name string) *ExportInsightsDataOperation {
9001 return &ExportInsightsDataOperation{
9002 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
9003 }
9004 }
9005
9006 // ExportInsightsDataOperation returns a new ExportInsightsDataOperation from a given name.
9007 // The name must be that of a previously created ExportInsightsDataOperation, possibly from a different process.
9008 func (c *restClient) ExportInsightsDataOperation(name string) *ExportInsightsDataOperation {
9009 override := fmt.Sprintf("/v1/%s", name)
9010 return &ExportInsightsDataOperation{
9011 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
9012 pollPath: override,
9013 }
9014 }
9015
9016 // ExportIssueModelOperation returns a new ExportIssueModelOperation from a given name.
9017 // The name must be that of a previously created ExportIssueModelOperation, possibly from a different process.
9018 func (c *gRPCClient) ExportIssueModelOperation(name string) *ExportIssueModelOperation {
9019 return &ExportIssueModelOperation{
9020 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
9021 }
9022 }
9023
9024 // ExportIssueModelOperation returns a new ExportIssueModelOperation from a given name.
9025 // The name must be that of a previously created ExportIssueModelOperation, possibly from a different process.
9026 func (c *restClient) ExportIssueModelOperation(name string) *ExportIssueModelOperation {
9027 override := fmt.Sprintf("/v1/%s", name)
9028 return &ExportIssueModelOperation{
9029 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
9030 pollPath: override,
9031 }
9032 }
9033
9034 // ImportIssueModelOperation returns a new ImportIssueModelOperation from a given name.
9035 // The name must be that of a previously created ImportIssueModelOperation, possibly from a different process.
9036 func (c *gRPCClient) ImportIssueModelOperation(name string) *ImportIssueModelOperation {
9037 return &ImportIssueModelOperation{
9038 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
9039 }
9040 }
9041
9042 // ImportIssueModelOperation returns a new ImportIssueModelOperation from a given name.
9043 // The name must be that of a previously created ImportIssueModelOperation, possibly from a different process.
9044 func (c *restClient) ImportIssueModelOperation(name string) *ImportIssueModelOperation {
9045 override := fmt.Sprintf("/v1/%s", name)
9046 return &ImportIssueModelOperation{
9047 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
9048 pollPath: override,
9049 }
9050 }
9051
9052 // IngestConversationsOperation returns a new IngestConversationsOperation from a given name.
9053 // The name must be that of a previously created IngestConversationsOperation, possibly from a different process.
9054 func (c *gRPCClient) IngestConversationsOperation(name string) *IngestConversationsOperation {
9055 return &IngestConversationsOperation{
9056 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
9057 }
9058 }
9059
9060 // IngestConversationsOperation returns a new IngestConversationsOperation from a given name.
9061 // The name must be that of a previously created IngestConversationsOperation, possibly from a different process.
9062 func (c *restClient) IngestConversationsOperation(name string) *IngestConversationsOperation {
9063 override := fmt.Sprintf("/v1/%s", name)
9064 return &IngestConversationsOperation{
9065 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
9066 pollPath: override,
9067 }
9068 }
9069
9070 // InitializeEncryptionSpecOperation returns a new InitializeEncryptionSpecOperation from a given name.
9071 // The name must be that of a previously created InitializeEncryptionSpecOperation, possibly from a different process.
9072 func (c *gRPCClient) InitializeEncryptionSpecOperation(name string) *InitializeEncryptionSpecOperation {
9073 return &InitializeEncryptionSpecOperation{
9074 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
9075 }
9076 }
9077
9078 // InitializeEncryptionSpecOperation returns a new InitializeEncryptionSpecOperation from a given name.
9079 // The name must be that of a previously created InitializeEncryptionSpecOperation, possibly from a different process.
9080 func (c *restClient) InitializeEncryptionSpecOperation(name string) *InitializeEncryptionSpecOperation {
9081 override := fmt.Sprintf("/v1/%s", name)
9082 return &InitializeEncryptionSpecOperation{
9083 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
9084 pollPath: override,
9085 }
9086 }
9087
9088 // QueryMetricsOperation returns a new QueryMetricsOperation from a given name.
9089 // The name must be that of a previously created QueryMetricsOperation, possibly from a different process.
9090 func (c *gRPCClient) QueryMetricsOperation(name string) *QueryMetricsOperation {
9091 return &QueryMetricsOperation{
9092 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
9093 }
9094 }
9095
9096 // QueryMetricsOperation returns a new QueryMetricsOperation from a given name.
9097 // The name must be that of a previously created QueryMetricsOperation, possibly from a different process.
9098 func (c *restClient) QueryMetricsOperation(name string) *QueryMetricsOperation {
9099 override := fmt.Sprintf("/v1/%s", name)
9100 return &QueryMetricsOperation{
9101 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
9102 pollPath: override,
9103 }
9104 }
9105
9106 // TuneQaScorecardRevisionOperation returns a new TuneQaScorecardRevisionOperation from a given name.
9107 // The name must be that of a previously created TuneQaScorecardRevisionOperation, possibly from a different process.
9108 func (c *gRPCClient) TuneQaScorecardRevisionOperation(name string) *TuneQaScorecardRevisionOperation {
9109 return &TuneQaScorecardRevisionOperation{
9110 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
9111 }
9112 }
9113
9114 // TuneQaScorecardRevisionOperation returns a new TuneQaScorecardRevisionOperation from a given name.
9115 // The name must be that of a previously created TuneQaScorecardRevisionOperation, possibly from a different process.
9116 func (c *restClient) TuneQaScorecardRevisionOperation(name string) *TuneQaScorecardRevisionOperation {
9117 override := fmt.Sprintf("/v1/%s", name)
9118 return &TuneQaScorecardRevisionOperation{
9119 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
9120 pollPath: override,
9121 }
9122 }
9123
9124 // UndeployIssueModelOperation returns a new UndeployIssueModelOperation from a given name.
9125 // The name must be that of a previously created UndeployIssueModelOperation, possibly from a different process.
9126 func (c *gRPCClient) UndeployIssueModelOperation(name string) *UndeployIssueModelOperation {
9127 return &UndeployIssueModelOperation{
9128 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
9129 }
9130 }
9131
9132 // UndeployIssueModelOperation returns a new UndeployIssueModelOperation from a given name.
9133 // The name must be that of a previously created UndeployIssueModelOperation, possibly from a different process.
9134 func (c *restClient) UndeployIssueModelOperation(name string) *UndeployIssueModelOperation {
9135 override := fmt.Sprintf("/v1/%s", name)
9136 return &UndeployIssueModelOperation{
9137 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
9138 pollPath: override,
9139 }
9140 }
9141
9142 // UploadConversationOperation returns a new UploadConversationOperation from a given name.
9143 // The name must be that of a previously created UploadConversationOperation, possibly from a different process.
9144 func (c *gRPCClient) UploadConversationOperation(name string) *UploadConversationOperation {
9145 return &UploadConversationOperation{
9146 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
9147 }
9148 }
9149
9150 // UploadConversationOperation returns a new UploadConversationOperation from a given name.
9151 // The name must be that of a previously created UploadConversationOperation, possibly from a different process.
9152 func (c *restClient) UploadConversationOperation(name string) *UploadConversationOperation {
9153 override := fmt.Sprintf("/v1/%s", name)
9154 return &UploadConversationOperation{
9155 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
9156 pollPath: override,
9157 }
9158 }