Debian Codegraph @

certificatemanager/apiv1/certificate_manager_client.go

raw
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 certificatemanager
18
19 import (
20 "bytes"
21 "context"
22 "fmt"
23 "log/slog"
24 "math"
25 "net/http"
26 "net/url"
27 "time"
28
29 certificatemanagerpb "cloud.google.com/go/certificatemanager/apiv1/certificatemanagerpb"
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 locationpb "google.golang.org/genproto/googleapis/cloud/location"
40 "google.golang.org/grpc"
41 "google.golang.org/grpc/codes"
42 "google.golang.org/protobuf/encoding/protojson"
43 "google.golang.org/protobuf/proto"
44 )
45
46 var newClientHook clientHook
47
48 // CallOptions contains the retry settings for each method of Client.
49 type CallOptions struct {
50 ListCertificates []gax.CallOption
51 GetCertificate []gax.CallOption
52 CreateCertificate []gax.CallOption
53 UpdateCertificate []gax.CallOption
54 DeleteCertificate []gax.CallOption
55 ListCertificateMaps []gax.CallOption
56 GetCertificateMap []gax.CallOption
57 CreateCertificateMap []gax.CallOption
58 UpdateCertificateMap []gax.CallOption
59 DeleteCertificateMap []gax.CallOption
60 ListCertificateMapEntries []gax.CallOption
61 GetCertificateMapEntry []gax.CallOption
62 CreateCertificateMapEntry []gax.CallOption
63 UpdateCertificateMapEntry []gax.CallOption
64 DeleteCertificateMapEntry []gax.CallOption
65 ListDnsAuthorizations []gax.CallOption
66 GetDnsAuthorization []gax.CallOption
67 CreateDnsAuthorization []gax.CallOption
68 UpdateDnsAuthorization []gax.CallOption
69 DeleteDnsAuthorization []gax.CallOption
70 ListCertificateIssuanceConfigs []gax.CallOption
71 GetCertificateIssuanceConfig []gax.CallOption
72 CreateCertificateIssuanceConfig []gax.CallOption
73 DeleteCertificateIssuanceConfig []gax.CallOption
74 ListTrustConfigs []gax.CallOption
75 GetTrustConfig []gax.CallOption
76 CreateTrustConfig []gax.CallOption
77 UpdateTrustConfig []gax.CallOption
78 DeleteTrustConfig []gax.CallOption
79 GetLocation []gax.CallOption
80 ListLocations []gax.CallOption
81 CancelOperation []gax.CallOption
82 DeleteOperation []gax.CallOption
83 GetOperation []gax.CallOption
84 ListOperations []gax.CallOption
85 }
86
87 func defaultGRPCClientOptions() []option.ClientOption {
88 return []option.ClientOption{
89 internaloption.WithDefaultEndpoint("certificatemanager.googleapis.com:443"),
90 internaloption.WithDefaultEndpointTemplate("certificatemanager.UNIVERSE_DOMAIN:443"),
91 internaloption.WithDefaultMTLSEndpoint("certificatemanager.mtls.googleapis.com:443"),
92 internaloption.WithDefaultUniverseDomain("googleapis.com"),
93 internaloption.WithDefaultAudience("https://certificatemanager.googleapis.com/"),
94 internaloption.WithDefaultScopes(DefaultAuthScopes()...),
95 internaloption.EnableJwtWithScope(),
96 internaloption.EnableNewAuthLibrary(),
97 option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
98 grpc.MaxCallRecvMsgSize(math.MaxInt32))),
99 }
100 }
101
102 func defaultCallOptions() *CallOptions {
103 return &CallOptions{
104 ListCertificates: []gax.CallOption{
105 gax.WithTimeout(60000 * time.Millisecond),
106 gax.WithRetry(func() gax.Retryer {
107 return gax.OnCodes([]codes.Code{
108 codes.Unavailable,
109 }, gax.Backoff{
110 Initial: 1000 * time.Millisecond,
111 Max: 10000 * time.Millisecond,
112 Multiplier: 1.30,
113 })
114 }),
115 },
116 GetCertificate: []gax.CallOption{
117 gax.WithTimeout(60000 * time.Millisecond),
118 gax.WithRetry(func() gax.Retryer {
119 return gax.OnCodes([]codes.Code{
120 codes.Unavailable,
121 }, gax.Backoff{
122 Initial: 1000 * time.Millisecond,
123 Max: 10000 * time.Millisecond,
124 Multiplier: 1.30,
125 })
126 }),
127 },
128 CreateCertificate: []gax.CallOption{
129 gax.WithTimeout(60000 * time.Millisecond),
130 gax.WithRetry(func() gax.Retryer {
131 return gax.OnCodes([]codes.Code{
132 codes.Unavailable,
133 }, gax.Backoff{
134 Initial: 1000 * time.Millisecond,
135 Max: 10000 * time.Millisecond,
136 Multiplier: 1.30,
137 })
138 }),
139 },
140 UpdateCertificate: []gax.CallOption{
141 gax.WithTimeout(60000 * time.Millisecond),
142 gax.WithRetry(func() gax.Retryer {
143 return gax.OnCodes([]codes.Code{
144 codes.Unavailable,
145 }, gax.Backoff{
146 Initial: 1000 * time.Millisecond,
147 Max: 10000 * time.Millisecond,
148 Multiplier: 1.30,
149 })
150 }),
151 },
152 DeleteCertificate: []gax.CallOption{
153 gax.WithTimeout(60000 * time.Millisecond),
154 gax.WithRetry(func() gax.Retryer {
155 return gax.OnCodes([]codes.Code{
156 codes.Unavailable,
157 }, gax.Backoff{
158 Initial: 1000 * time.Millisecond,
159 Max: 10000 * time.Millisecond,
160 Multiplier: 1.30,
161 })
162 }),
163 },
164 ListCertificateMaps: []gax.CallOption{
165 gax.WithTimeout(60000 * time.Millisecond),
166 gax.WithRetry(func() gax.Retryer {
167 return gax.OnCodes([]codes.Code{
168 codes.Unavailable,
169 }, gax.Backoff{
170 Initial: 1000 * time.Millisecond,
171 Max: 10000 * time.Millisecond,
172 Multiplier: 1.30,
173 })
174 }),
175 },
176 GetCertificateMap: []gax.CallOption{
177 gax.WithTimeout(60000 * time.Millisecond),
178 gax.WithRetry(func() gax.Retryer {
179 return gax.OnCodes([]codes.Code{
180 codes.Unavailable,
181 }, gax.Backoff{
182 Initial: 1000 * time.Millisecond,
183 Max: 10000 * time.Millisecond,
184 Multiplier: 1.30,
185 })
186 }),
187 },
188 CreateCertificateMap: []gax.CallOption{
189 gax.WithTimeout(60000 * time.Millisecond),
190 gax.WithRetry(func() gax.Retryer {
191 return gax.OnCodes([]codes.Code{
192 codes.Unavailable,
193 }, gax.Backoff{
194 Initial: 1000 * time.Millisecond,
195 Max: 10000 * time.Millisecond,
196 Multiplier: 1.30,
197 })
198 }),
199 },
200 UpdateCertificateMap: []gax.CallOption{
201 gax.WithTimeout(60000 * time.Millisecond),
202 gax.WithRetry(func() gax.Retryer {
203 return gax.OnCodes([]codes.Code{
204 codes.Unavailable,
205 }, gax.Backoff{
206 Initial: 1000 * time.Millisecond,
207 Max: 10000 * time.Millisecond,
208 Multiplier: 1.30,
209 })
210 }),
211 },
212 DeleteCertificateMap: []gax.CallOption{
213 gax.WithTimeout(60000 * time.Millisecond),
214 gax.WithRetry(func() gax.Retryer {
215 return gax.OnCodes([]codes.Code{
216 codes.Unavailable,
217 }, gax.Backoff{
218 Initial: 1000 * time.Millisecond,
219 Max: 10000 * time.Millisecond,
220 Multiplier: 1.30,
221 })
222 }),
223 },
224 ListCertificateMapEntries: []gax.CallOption{
225 gax.WithTimeout(60000 * time.Millisecond),
226 gax.WithRetry(func() gax.Retryer {
227 return gax.OnCodes([]codes.Code{
228 codes.Unavailable,
229 }, gax.Backoff{
230 Initial: 1000 * time.Millisecond,
231 Max: 10000 * time.Millisecond,
232 Multiplier: 1.30,
233 })
234 }),
235 },
236 GetCertificateMapEntry: []gax.CallOption{
237 gax.WithTimeout(60000 * time.Millisecond),
238 gax.WithRetry(func() gax.Retryer {
239 return gax.OnCodes([]codes.Code{
240 codes.Unavailable,
241 }, gax.Backoff{
242 Initial: 1000 * time.Millisecond,
243 Max: 10000 * time.Millisecond,
244 Multiplier: 1.30,
245 })
246 }),
247 },
248 CreateCertificateMapEntry: []gax.CallOption{
249 gax.WithTimeout(60000 * time.Millisecond),
250 gax.WithRetry(func() gax.Retryer {
251 return gax.OnCodes([]codes.Code{
252 codes.Unavailable,
253 }, gax.Backoff{
254 Initial: 1000 * time.Millisecond,
255 Max: 10000 * time.Millisecond,
256 Multiplier: 1.30,
257 })
258 }),
259 },
260 UpdateCertificateMapEntry: []gax.CallOption{
261 gax.WithTimeout(60000 * time.Millisecond),
262 gax.WithRetry(func() gax.Retryer {
263 return gax.OnCodes([]codes.Code{
264 codes.Unavailable,
265 }, gax.Backoff{
266 Initial: 1000 * time.Millisecond,
267 Max: 10000 * time.Millisecond,
268 Multiplier: 1.30,
269 })
270 }),
271 },
272 DeleteCertificateMapEntry: []gax.CallOption{
273 gax.WithTimeout(60000 * time.Millisecond),
274 gax.WithRetry(func() gax.Retryer {
275 return gax.OnCodes([]codes.Code{
276 codes.Unavailable,
277 }, gax.Backoff{
278 Initial: 1000 * time.Millisecond,
279 Max: 10000 * time.Millisecond,
280 Multiplier: 1.30,
281 })
282 }),
283 },
284 ListDnsAuthorizations: []gax.CallOption{
285 gax.WithTimeout(60000 * time.Millisecond),
286 gax.WithRetry(func() gax.Retryer {
287 return gax.OnCodes([]codes.Code{
288 codes.Unavailable,
289 }, gax.Backoff{
290 Initial: 1000 * time.Millisecond,
291 Max: 10000 * time.Millisecond,
292 Multiplier: 1.30,
293 })
294 }),
295 },
296 GetDnsAuthorization: []gax.CallOption{
297 gax.WithTimeout(60000 * time.Millisecond),
298 gax.WithRetry(func() gax.Retryer {
299 return gax.OnCodes([]codes.Code{
300 codes.Unavailable,
301 }, gax.Backoff{
302 Initial: 1000 * time.Millisecond,
303 Max: 10000 * time.Millisecond,
304 Multiplier: 1.30,
305 })
306 }),
307 },
308 CreateDnsAuthorization: []gax.CallOption{
309 gax.WithTimeout(60000 * time.Millisecond),
310 gax.WithRetry(func() gax.Retryer {
311 return gax.OnCodes([]codes.Code{
312 codes.Unavailable,
313 }, gax.Backoff{
314 Initial: 1000 * time.Millisecond,
315 Max: 10000 * time.Millisecond,
316 Multiplier: 1.30,
317 })
318 }),
319 },
320 UpdateDnsAuthorization: []gax.CallOption{
321 gax.WithTimeout(60000 * time.Millisecond),
322 gax.WithRetry(func() gax.Retryer {
323 return gax.OnCodes([]codes.Code{
324 codes.Unavailable,
325 }, gax.Backoff{
326 Initial: 1000 * time.Millisecond,
327 Max: 10000 * time.Millisecond,
328 Multiplier: 1.30,
329 })
330 }),
331 },
332 DeleteDnsAuthorization: []gax.CallOption{
333 gax.WithTimeout(60000 * time.Millisecond),
334 gax.WithRetry(func() gax.Retryer {
335 return gax.OnCodes([]codes.Code{
336 codes.Unavailable,
337 }, gax.Backoff{
338 Initial: 1000 * time.Millisecond,
339 Max: 10000 * time.Millisecond,
340 Multiplier: 1.30,
341 })
342 }),
343 },
344 ListCertificateIssuanceConfigs: []gax.CallOption{
345 gax.WithTimeout(60000 * time.Millisecond),
346 gax.WithRetry(func() gax.Retryer {
347 return gax.OnCodes([]codes.Code{
348 codes.Unavailable,
349 }, gax.Backoff{
350 Initial: 1000 * time.Millisecond,
351 Max: 10000 * time.Millisecond,
352 Multiplier: 1.30,
353 })
354 }),
355 },
356 GetCertificateIssuanceConfig: []gax.CallOption{
357 gax.WithTimeout(60000 * time.Millisecond),
358 gax.WithRetry(func() gax.Retryer {
359 return gax.OnCodes([]codes.Code{
360 codes.Unavailable,
361 }, gax.Backoff{
362 Initial: 1000 * time.Millisecond,
363 Max: 10000 * time.Millisecond,
364 Multiplier: 1.30,
365 })
366 }),
367 },
368 CreateCertificateIssuanceConfig: []gax.CallOption{
369 gax.WithTimeout(60000 * time.Millisecond),
370 gax.WithRetry(func() gax.Retryer {
371 return gax.OnCodes([]codes.Code{
372 codes.Unavailable,
373 }, gax.Backoff{
374 Initial: 1000 * time.Millisecond,
375 Max: 10000 * time.Millisecond,
376 Multiplier: 1.30,
377 })
378 }),
379 },
380 DeleteCertificateIssuanceConfig: []gax.CallOption{
381 gax.WithTimeout(60000 * time.Millisecond),
382 gax.WithRetry(func() gax.Retryer {
383 return gax.OnCodes([]codes.Code{
384 codes.Unavailable,
385 }, gax.Backoff{
386 Initial: 1000 * time.Millisecond,
387 Max: 10000 * time.Millisecond,
388 Multiplier: 1.30,
389 })
390 }),
391 },
392 ListTrustConfigs: []gax.CallOption{},
393 GetTrustConfig: []gax.CallOption{},
394 CreateTrustConfig: []gax.CallOption{},
395 UpdateTrustConfig: []gax.CallOption{},
396 DeleteTrustConfig: []gax.CallOption{},
397 GetLocation: []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 ListLocations: []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 CancelOperation: []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 DeleteOperation: []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 GetOperation: []gax.CallOption{
446 gax.WithTimeout(5000 * time.Millisecond),
447 gax.WithRetry(func() gax.Retryer {
448 return gax.OnCodes([]codes.Code{
449 codes.Unavailable,
450 }, gax.Backoff{
451 Initial: 200 * time.Millisecond,
452 Max: 3000 * time.Millisecond,
453 Multiplier: 1.30,
454 })
455 }),
456 },
457 ListOperations: []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 }
470 }
471
472 func defaultRESTCallOptions() *CallOptions {
473 return &CallOptions{
474 ListCertificates: []gax.CallOption{
475 gax.WithTimeout(60000 * time.Millisecond),
476 gax.WithRetry(func() gax.Retryer {
477 return gax.OnHTTPCodes(gax.Backoff{
478 Initial: 1000 * time.Millisecond,
479 Max: 10000 * time.Millisecond,
480 Multiplier: 1.30,
481 },
482 http.StatusServiceUnavailable)
483 }),
484 },
485 GetCertificate: []gax.CallOption{
486 gax.WithTimeout(60000 * time.Millisecond),
487 gax.WithRetry(func() gax.Retryer {
488 return gax.OnHTTPCodes(gax.Backoff{
489 Initial: 1000 * time.Millisecond,
490 Max: 10000 * time.Millisecond,
491 Multiplier: 1.30,
492 },
493 http.StatusServiceUnavailable)
494 }),
495 },
496 CreateCertificate: []gax.CallOption{
497 gax.WithTimeout(60000 * time.Millisecond),
498 gax.WithRetry(func() gax.Retryer {
499 return gax.OnHTTPCodes(gax.Backoff{
500 Initial: 1000 * time.Millisecond,
501 Max: 10000 * time.Millisecond,
502 Multiplier: 1.30,
503 },
504 http.StatusServiceUnavailable)
505 }),
506 },
507 UpdateCertificate: []gax.CallOption{
508 gax.WithTimeout(60000 * time.Millisecond),
509 gax.WithRetry(func() gax.Retryer {
510 return gax.OnHTTPCodes(gax.Backoff{
511 Initial: 1000 * time.Millisecond,
512 Max: 10000 * time.Millisecond,
513 Multiplier: 1.30,
514 },
515 http.StatusServiceUnavailable)
516 }),
517 },
518 DeleteCertificate: []gax.CallOption{
519 gax.WithTimeout(60000 * time.Millisecond),
520 gax.WithRetry(func() gax.Retryer {
521 return gax.OnHTTPCodes(gax.Backoff{
522 Initial: 1000 * time.Millisecond,
523 Max: 10000 * time.Millisecond,
524 Multiplier: 1.30,
525 },
526 http.StatusServiceUnavailable)
527 }),
528 },
529 ListCertificateMaps: []gax.CallOption{
530 gax.WithTimeout(60000 * time.Millisecond),
531 gax.WithRetry(func() gax.Retryer {
532 return gax.OnHTTPCodes(gax.Backoff{
533 Initial: 1000 * time.Millisecond,
534 Max: 10000 * time.Millisecond,
535 Multiplier: 1.30,
536 },
537 http.StatusServiceUnavailable)
538 }),
539 },
540 GetCertificateMap: []gax.CallOption{
541 gax.WithTimeout(60000 * time.Millisecond),
542 gax.WithRetry(func() gax.Retryer {
543 return gax.OnHTTPCodes(gax.Backoff{
544 Initial: 1000 * time.Millisecond,
545 Max: 10000 * time.Millisecond,
546 Multiplier: 1.30,
547 },
548 http.StatusServiceUnavailable)
549 }),
550 },
551 CreateCertificateMap: []gax.CallOption{
552 gax.WithTimeout(60000 * time.Millisecond),
553 gax.WithRetry(func() gax.Retryer {
554 return gax.OnHTTPCodes(gax.Backoff{
555 Initial: 1000 * time.Millisecond,
556 Max: 10000 * time.Millisecond,
557 Multiplier: 1.30,
558 },
559 http.StatusServiceUnavailable)
560 }),
561 },
562 UpdateCertificateMap: []gax.CallOption{
563 gax.WithTimeout(60000 * time.Millisecond),
564 gax.WithRetry(func() gax.Retryer {
565 return gax.OnHTTPCodes(gax.Backoff{
566 Initial: 1000 * time.Millisecond,
567 Max: 10000 * time.Millisecond,
568 Multiplier: 1.30,
569 },
570 http.StatusServiceUnavailable)
571 }),
572 },
573 DeleteCertificateMap: []gax.CallOption{
574 gax.WithTimeout(60000 * time.Millisecond),
575 gax.WithRetry(func() gax.Retryer {
576 return gax.OnHTTPCodes(gax.Backoff{
577 Initial: 1000 * time.Millisecond,
578 Max: 10000 * time.Millisecond,
579 Multiplier: 1.30,
580 },
581 http.StatusServiceUnavailable)
582 }),
583 },
584 ListCertificateMapEntries: []gax.CallOption{
585 gax.WithTimeout(60000 * time.Millisecond),
586 gax.WithRetry(func() gax.Retryer {
587 return gax.OnHTTPCodes(gax.Backoff{
588 Initial: 1000 * time.Millisecond,
589 Max: 10000 * time.Millisecond,
590 Multiplier: 1.30,
591 },
592 http.StatusServiceUnavailable)
593 }),
594 },
595 GetCertificateMapEntry: []gax.CallOption{
596 gax.WithTimeout(60000 * time.Millisecond),
597 gax.WithRetry(func() gax.Retryer {
598 return gax.OnHTTPCodes(gax.Backoff{
599 Initial: 1000 * time.Millisecond,
600 Max: 10000 * time.Millisecond,
601 Multiplier: 1.30,
602 },
603 http.StatusServiceUnavailable)
604 }),
605 },
606 CreateCertificateMapEntry: []gax.CallOption{
607 gax.WithTimeout(60000 * time.Millisecond),
608 gax.WithRetry(func() gax.Retryer {
609 return gax.OnHTTPCodes(gax.Backoff{
610 Initial: 1000 * time.Millisecond,
611 Max: 10000 * time.Millisecond,
612 Multiplier: 1.30,
613 },
614 http.StatusServiceUnavailable)
615 }),
616 },
617 UpdateCertificateMapEntry: []gax.CallOption{
618 gax.WithTimeout(60000 * time.Millisecond),
619 gax.WithRetry(func() gax.Retryer {
620 return gax.OnHTTPCodes(gax.Backoff{
621 Initial: 1000 * time.Millisecond,
622 Max: 10000 * time.Millisecond,
623 Multiplier: 1.30,
624 },
625 http.StatusServiceUnavailable)
626 }),
627 },
628 DeleteCertificateMapEntry: []gax.CallOption{
629 gax.WithTimeout(60000 * time.Millisecond),
630 gax.WithRetry(func() gax.Retryer {
631 return gax.OnHTTPCodes(gax.Backoff{
632 Initial: 1000 * time.Millisecond,
633 Max: 10000 * time.Millisecond,
634 Multiplier: 1.30,
635 },
636 http.StatusServiceUnavailable)
637 }),
638 },
639 ListDnsAuthorizations: []gax.CallOption{
640 gax.WithTimeout(60000 * time.Millisecond),
641 gax.WithRetry(func() gax.Retryer {
642 return gax.OnHTTPCodes(gax.Backoff{
643 Initial: 1000 * time.Millisecond,
644 Max: 10000 * time.Millisecond,
645 Multiplier: 1.30,
646 },
647 http.StatusServiceUnavailable)
648 }),
649 },
650 GetDnsAuthorization: []gax.CallOption{
651 gax.WithTimeout(60000 * time.Millisecond),
652 gax.WithRetry(func() gax.Retryer {
653 return gax.OnHTTPCodes(gax.Backoff{
654 Initial: 1000 * time.Millisecond,
655 Max: 10000 * time.Millisecond,
656 Multiplier: 1.30,
657 },
658 http.StatusServiceUnavailable)
659 }),
660 },
661 CreateDnsAuthorization: []gax.CallOption{
662 gax.WithTimeout(60000 * time.Millisecond),
663 gax.WithRetry(func() gax.Retryer {
664 return gax.OnHTTPCodes(gax.Backoff{
665 Initial: 1000 * time.Millisecond,
666 Max: 10000 * time.Millisecond,
667 Multiplier: 1.30,
668 },
669 http.StatusServiceUnavailable)
670 }),
671 },
672 UpdateDnsAuthorization: []gax.CallOption{
673 gax.WithTimeout(60000 * time.Millisecond),
674 gax.WithRetry(func() gax.Retryer {
675 return gax.OnHTTPCodes(gax.Backoff{
676 Initial: 1000 * time.Millisecond,
677 Max: 10000 * time.Millisecond,
678 Multiplier: 1.30,
679 },
680 http.StatusServiceUnavailable)
681 }),
682 },
683 DeleteDnsAuthorization: []gax.CallOption{
684 gax.WithTimeout(60000 * time.Millisecond),
685 gax.WithRetry(func() gax.Retryer {
686 return gax.OnHTTPCodes(gax.Backoff{
687 Initial: 1000 * time.Millisecond,
688 Max: 10000 * time.Millisecond,
689 Multiplier: 1.30,
690 },
691 http.StatusServiceUnavailable)
692 }),
693 },
694 ListCertificateIssuanceConfigs: []gax.CallOption{
695 gax.WithTimeout(60000 * time.Millisecond),
696 gax.WithRetry(func() gax.Retryer {
697 return gax.OnHTTPCodes(gax.Backoff{
698 Initial: 1000 * time.Millisecond,
699 Max: 10000 * time.Millisecond,
700 Multiplier: 1.30,
701 },
702 http.StatusServiceUnavailable)
703 }),
704 },
705 GetCertificateIssuanceConfig: []gax.CallOption{
706 gax.WithTimeout(60000 * time.Millisecond),
707 gax.WithRetry(func() gax.Retryer {
708 return gax.OnHTTPCodes(gax.Backoff{
709 Initial: 1000 * time.Millisecond,
710 Max: 10000 * time.Millisecond,
711 Multiplier: 1.30,
712 },
713 http.StatusServiceUnavailable)
714 }),
715 },
716 CreateCertificateIssuanceConfig: []gax.CallOption{
717 gax.WithTimeout(60000 * time.Millisecond),
718 gax.WithRetry(func() gax.Retryer {
719 return gax.OnHTTPCodes(gax.Backoff{
720 Initial: 1000 * time.Millisecond,
721 Max: 10000 * time.Millisecond,
722 Multiplier: 1.30,
723 },
724 http.StatusServiceUnavailable)
725 }),
726 },
727 DeleteCertificateIssuanceConfig: []gax.CallOption{
728 gax.WithTimeout(60000 * time.Millisecond),
729 gax.WithRetry(func() gax.Retryer {
730 return gax.OnHTTPCodes(gax.Backoff{
731 Initial: 1000 * time.Millisecond,
732 Max: 10000 * time.Millisecond,
733 Multiplier: 1.30,
734 },
735 http.StatusServiceUnavailable)
736 }),
737 },
738 ListTrustConfigs: []gax.CallOption{},
739 GetTrustConfig: []gax.CallOption{},
740 CreateTrustConfig: []gax.CallOption{},
741 UpdateTrustConfig: []gax.CallOption{},
742 DeleteTrustConfig: []gax.CallOption{},
743 GetLocation: []gax.CallOption{
744 gax.WithTimeout(60000 * time.Millisecond),
745 gax.WithRetry(func() gax.Retryer {
746 return gax.OnHTTPCodes(gax.Backoff{
747 Initial: 1000 * time.Millisecond,
748 Max: 10000 * time.Millisecond,
749 Multiplier: 1.30,
750 },
751 http.StatusServiceUnavailable)
752 }),
753 },
754 ListLocations: []gax.CallOption{
755 gax.WithTimeout(60000 * time.Millisecond),
756 gax.WithRetry(func() gax.Retryer {
757 return gax.OnHTTPCodes(gax.Backoff{
758 Initial: 1000 * time.Millisecond,
759 Max: 10000 * time.Millisecond,
760 Multiplier: 1.30,
761 },
762 http.StatusServiceUnavailable)
763 }),
764 },
765 CancelOperation: []gax.CallOption{
766 gax.WithTimeout(60000 * time.Millisecond),
767 gax.WithRetry(func() gax.Retryer {
768 return gax.OnHTTPCodes(gax.Backoff{
769 Initial: 1000 * time.Millisecond,
770 Max: 10000 * time.Millisecond,
771 Multiplier: 1.30,
772 },
773 http.StatusServiceUnavailable)
774 }),
775 },
776 DeleteOperation: []gax.CallOption{
777 gax.WithTimeout(60000 * time.Millisecond),
778 gax.WithRetry(func() gax.Retryer {
779 return gax.OnHTTPCodes(gax.Backoff{
780 Initial: 1000 * time.Millisecond,
781 Max: 10000 * time.Millisecond,
782 Multiplier: 1.30,
783 },
784 http.StatusServiceUnavailable)
785 }),
786 },
787 GetOperation: []gax.CallOption{
788 gax.WithTimeout(5000 * time.Millisecond),
789 gax.WithRetry(func() gax.Retryer {
790 return gax.OnHTTPCodes(gax.Backoff{
791 Initial: 200 * time.Millisecond,
792 Max: 3000 * time.Millisecond,
793 Multiplier: 1.30,
794 },
795 http.StatusServiceUnavailable)
796 }),
797 },
798 ListOperations: []gax.CallOption{
799 gax.WithTimeout(60000 * time.Millisecond),
800 gax.WithRetry(func() gax.Retryer {
801 return gax.OnHTTPCodes(gax.Backoff{
802 Initial: 1000 * time.Millisecond,
803 Max: 10000 * time.Millisecond,
804 Multiplier: 1.30,
805 },
806 http.StatusServiceUnavailable)
807 }),
808 },
809 }
810 }
811
812 // internalClient is an interface that defines the methods available from Certificate Manager API.
813 type internalClient interface {
814 Close() error
815 setGoogleClientInfo(...string)
816 Connection() *grpc.ClientConn
817 ListCertificates(context.Context, *certificatemanagerpb.ListCertificatesRequest, ...gax.CallOption) *CertificateIterator
818 GetCertificate(context.Context, *certificatemanagerpb.GetCertificateRequest, ...gax.CallOption) (*certificatemanagerpb.Certificate, error)
819 CreateCertificate(context.Context, *certificatemanagerpb.CreateCertificateRequest, ...gax.CallOption) (*CreateCertificateOperation, error)
820 CreateCertificateOperation(name string) *CreateCertificateOperation
821 UpdateCertificate(context.Context, *certificatemanagerpb.UpdateCertificateRequest, ...gax.CallOption) (*UpdateCertificateOperation, error)
822 UpdateCertificateOperation(name string) *UpdateCertificateOperation
823 DeleteCertificate(context.Context, *certificatemanagerpb.DeleteCertificateRequest, ...gax.CallOption) (*DeleteCertificateOperation, error)
824 DeleteCertificateOperation(name string) *DeleteCertificateOperation
825 ListCertificateMaps(context.Context, *certificatemanagerpb.ListCertificateMapsRequest, ...gax.CallOption) *CertificateMapIterator
826 GetCertificateMap(context.Context, *certificatemanagerpb.GetCertificateMapRequest, ...gax.CallOption) (*certificatemanagerpb.CertificateMap, error)
827 CreateCertificateMap(context.Context, *certificatemanagerpb.CreateCertificateMapRequest, ...gax.CallOption) (*CreateCertificateMapOperation, error)
828 CreateCertificateMapOperation(name string) *CreateCertificateMapOperation
829 UpdateCertificateMap(context.Context, *certificatemanagerpb.UpdateCertificateMapRequest, ...gax.CallOption) (*UpdateCertificateMapOperation, error)
830 UpdateCertificateMapOperation(name string) *UpdateCertificateMapOperation
831 DeleteCertificateMap(context.Context, *certificatemanagerpb.DeleteCertificateMapRequest, ...gax.CallOption) (*DeleteCertificateMapOperation, error)
832 DeleteCertificateMapOperation(name string) *DeleteCertificateMapOperation
833 ListCertificateMapEntries(context.Context, *certificatemanagerpb.ListCertificateMapEntriesRequest, ...gax.CallOption) *CertificateMapEntryIterator
834 GetCertificateMapEntry(context.Context, *certificatemanagerpb.GetCertificateMapEntryRequest, ...gax.CallOption) (*certificatemanagerpb.CertificateMapEntry, error)
835 CreateCertificateMapEntry(context.Context, *certificatemanagerpb.CreateCertificateMapEntryRequest, ...gax.CallOption) (*CreateCertificateMapEntryOperation, error)
836 CreateCertificateMapEntryOperation(name string) *CreateCertificateMapEntryOperation
837 UpdateCertificateMapEntry(context.Context, *certificatemanagerpb.UpdateCertificateMapEntryRequest, ...gax.CallOption) (*UpdateCertificateMapEntryOperation, error)
838 UpdateCertificateMapEntryOperation(name string) *UpdateCertificateMapEntryOperation
839 DeleteCertificateMapEntry(context.Context, *certificatemanagerpb.DeleteCertificateMapEntryRequest, ...gax.CallOption) (*DeleteCertificateMapEntryOperation, error)
840 DeleteCertificateMapEntryOperation(name string) *DeleteCertificateMapEntryOperation
841 ListDnsAuthorizations(context.Context, *certificatemanagerpb.ListDnsAuthorizationsRequest, ...gax.CallOption) *DnsAuthorizationIterator
842 GetDnsAuthorization(context.Context, *certificatemanagerpb.GetDnsAuthorizationRequest, ...gax.CallOption) (*certificatemanagerpb.DnsAuthorization, error)
843 CreateDnsAuthorization(context.Context, *certificatemanagerpb.CreateDnsAuthorizationRequest, ...gax.CallOption) (*CreateDnsAuthorizationOperation, error)
844 CreateDnsAuthorizationOperation(name string) *CreateDnsAuthorizationOperation
845 UpdateDnsAuthorization(context.Context, *certificatemanagerpb.UpdateDnsAuthorizationRequest, ...gax.CallOption) (*UpdateDnsAuthorizationOperation, error)
846 UpdateDnsAuthorizationOperation(name string) *UpdateDnsAuthorizationOperation
847 DeleteDnsAuthorization(context.Context, *certificatemanagerpb.DeleteDnsAuthorizationRequest, ...gax.CallOption) (*DeleteDnsAuthorizationOperation, error)
848 DeleteDnsAuthorizationOperation(name string) *DeleteDnsAuthorizationOperation
849 ListCertificateIssuanceConfigs(context.Context, *certificatemanagerpb.ListCertificateIssuanceConfigsRequest, ...gax.CallOption) *CertificateIssuanceConfigIterator
850 GetCertificateIssuanceConfig(context.Context, *certificatemanagerpb.GetCertificateIssuanceConfigRequest, ...gax.CallOption) (*certificatemanagerpb.CertificateIssuanceConfig, error)
851 CreateCertificateIssuanceConfig(context.Context, *certificatemanagerpb.CreateCertificateIssuanceConfigRequest, ...gax.CallOption) (*CreateCertificateIssuanceConfigOperation, error)
852 CreateCertificateIssuanceConfigOperation(name string) *CreateCertificateIssuanceConfigOperation
853 DeleteCertificateIssuanceConfig(context.Context, *certificatemanagerpb.DeleteCertificateIssuanceConfigRequest, ...gax.CallOption) (*DeleteCertificateIssuanceConfigOperation, error)
854 DeleteCertificateIssuanceConfigOperation(name string) *DeleteCertificateIssuanceConfigOperation
855 ListTrustConfigs(context.Context, *certificatemanagerpb.ListTrustConfigsRequest, ...gax.CallOption) *TrustConfigIterator
856 GetTrustConfig(context.Context, *certificatemanagerpb.GetTrustConfigRequest, ...gax.CallOption) (*certificatemanagerpb.TrustConfig, error)
857 CreateTrustConfig(context.Context, *certificatemanagerpb.CreateTrustConfigRequest, ...gax.CallOption) (*CreateTrustConfigOperation, error)
858 CreateTrustConfigOperation(name string) *CreateTrustConfigOperation
859 UpdateTrustConfig(context.Context, *certificatemanagerpb.UpdateTrustConfigRequest, ...gax.CallOption) (*UpdateTrustConfigOperation, error)
860 UpdateTrustConfigOperation(name string) *UpdateTrustConfigOperation
861 DeleteTrustConfig(context.Context, *certificatemanagerpb.DeleteTrustConfigRequest, ...gax.CallOption) (*DeleteTrustConfigOperation, error)
862 DeleteTrustConfigOperation(name string) *DeleteTrustConfigOperation
863 GetLocation(context.Context, *locationpb.GetLocationRequest, ...gax.CallOption) (*locationpb.Location, error)
864 ListLocations(context.Context, *locationpb.ListLocationsRequest, ...gax.CallOption) *LocationIterator
865 CancelOperation(context.Context, *longrunningpb.CancelOperationRequest, ...gax.CallOption) error
866 DeleteOperation(context.Context, *longrunningpb.DeleteOperationRequest, ...gax.CallOption) error
867 GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error)
868 ListOperations(context.Context, *longrunningpb.ListOperationsRequest, ...gax.CallOption) *OperationIterator
869 }
870
871 // Client is a client for interacting with Certificate Manager API.
872 // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
873 //
874 // # API Overview
875 //
876 // Certificates Manager API allows customers to see and manage all their TLS
877 // certificates.
878 //
879 // Certificates Manager API service provides methods to manage certificates,
880 // group them into collections, and create serving configuration that can be
881 // easily applied to other Cloud resources e.g. Target Proxies.
882 //
883 // # Data Model
884 //
885 // The Certificates Manager service exposes the following resources:
886 //
887 // Certificate that describes a single TLS certificate.
888 //
889 // CertificateMap that describes a collection of certificates that can be
890 // attached to a target resource.
891 //
892 // CertificateMapEntry that describes a single configuration entry that
893 // consists of a SNI and a group of certificates. It’s a subresource of
894 // CertificateMap.
895 //
896 // Certificate, CertificateMap and CertificateMapEntry IDs
897 // have to fully match the regexp [a-z0-9-]{1,63}. In other words,
898 //
899 // only lower case letters, digits, and hyphen are allowed
900 //
901 // length of the resource ID has to be in [1,63] range.
902 //
903 // Provides methods to manage Cloud Certificate Manager entities.
904 type Client struct {
905 // The internal transport-dependent client.
906 internalClient internalClient
907
908 // The call options for this service.
909 CallOptions *CallOptions
910
911 // LROClient is used internally to handle long-running operations.
912 // It is exposed so that its CallOptions can be modified if required.
913 // Users should not Close this client.
914 LROClient *lroauto.OperationsClient
915 }
916
917 // Wrapper methods routed to the internal client.
918
919 // Close closes the connection to the API service. The user should invoke this when
920 // the client is no longer required.
921 func (c *Client) Close() error {
922 return c.internalClient.Close()
923 }
924
925 // setGoogleClientInfo sets the name and version of the application in
926 // the `x-goog-api-client` header passed on each request. Intended for
927 // use by Google-written clients.
928 func (c *Client) setGoogleClientInfo(keyval ...string) {
929 c.internalClient.setGoogleClientInfo(keyval...)
930 }
931
932 // Connection returns a connection to the API service.
933 //
934 // Deprecated: Connections are now pooled so this method does not always
935 // return the same resource.
936 func (c *Client) Connection() *grpc.ClientConn {
937 return c.internalClient.Connection()
938 }
939
940 // ListCertificates lists Certificates in a given project and location.
941 func (c *Client) ListCertificates(ctx context.Context, req *certificatemanagerpb.ListCertificatesRequest, opts ...gax.CallOption) *CertificateIterator {
942 return c.internalClient.ListCertificates(ctx, req, opts...)
943 }
944
945 // GetCertificate gets details of a single Certificate.
946 func (c *Client) GetCertificate(ctx context.Context, req *certificatemanagerpb.GetCertificateRequest, opts ...gax.CallOption) (*certificatemanagerpb.Certificate, error) {
947 return c.internalClient.GetCertificate(ctx, req, opts...)
948 }
949
950 // CreateCertificate creates a new Certificate in a given project and location.
951 func (c *Client) CreateCertificate(ctx context.Context, req *certificatemanagerpb.CreateCertificateRequest, opts ...gax.CallOption) (*CreateCertificateOperation, error) {
952 return c.internalClient.CreateCertificate(ctx, req, opts...)
953 }
954
955 // CreateCertificateOperation returns a new CreateCertificateOperation from a given name.
956 // The name must be that of a previously created CreateCertificateOperation, possibly from a different process.
957 func (c *Client) CreateCertificateOperation(name string) *CreateCertificateOperation {
958 return c.internalClient.CreateCertificateOperation(name)
959 }
960
961 // UpdateCertificate updates a Certificate.
962 func (c *Client) UpdateCertificate(ctx context.Context, req *certificatemanagerpb.UpdateCertificateRequest, opts ...gax.CallOption) (*UpdateCertificateOperation, error) {
963 return c.internalClient.UpdateCertificate(ctx, req, opts...)
964 }
965
966 // UpdateCertificateOperation returns a new UpdateCertificateOperation from a given name.
967 // The name must be that of a previously created UpdateCertificateOperation, possibly from a different process.
968 func (c *Client) UpdateCertificateOperation(name string) *UpdateCertificateOperation {
969 return c.internalClient.UpdateCertificateOperation(name)
970 }
971
972 // DeleteCertificate deletes a single Certificate.
973 func (c *Client) DeleteCertificate(ctx context.Context, req *certificatemanagerpb.DeleteCertificateRequest, opts ...gax.CallOption) (*DeleteCertificateOperation, error) {
974 return c.internalClient.DeleteCertificate(ctx, req, opts...)
975 }
976
977 // DeleteCertificateOperation returns a new DeleteCertificateOperation from a given name.
978 // The name must be that of a previously created DeleteCertificateOperation, possibly from a different process.
979 func (c *Client) DeleteCertificateOperation(name string) *DeleteCertificateOperation {
980 return c.internalClient.DeleteCertificateOperation(name)
981 }
982
983 // ListCertificateMaps lists CertificateMaps in a given project and location.
984 func (c *Client) ListCertificateMaps(ctx context.Context, req *certificatemanagerpb.ListCertificateMapsRequest, opts ...gax.CallOption) *CertificateMapIterator {
985 return c.internalClient.ListCertificateMaps(ctx, req, opts...)
986 }
987
988 // GetCertificateMap gets details of a single CertificateMap.
989 func (c *Client) GetCertificateMap(ctx context.Context, req *certificatemanagerpb.GetCertificateMapRequest, opts ...gax.CallOption) (*certificatemanagerpb.CertificateMap, error) {
990 return c.internalClient.GetCertificateMap(ctx, req, opts...)
991 }
992
993 // CreateCertificateMap creates a new CertificateMap in a given project and location.
994 func (c *Client) CreateCertificateMap(ctx context.Context, req *certificatemanagerpb.CreateCertificateMapRequest, opts ...gax.CallOption) (*CreateCertificateMapOperation, error) {
995 return c.internalClient.CreateCertificateMap(ctx, req, opts...)
996 }
997
998 // CreateCertificateMapOperation returns a new CreateCertificateMapOperation from a given name.
999 // The name must be that of a previously created CreateCertificateMapOperation, possibly from a different process.
1000 func (c *Client) CreateCertificateMapOperation(name string) *CreateCertificateMapOperation {
1001 return c.internalClient.CreateCertificateMapOperation(name)
1002 }
1003
1004 // UpdateCertificateMap updates a CertificateMap.
1005 func (c *Client) UpdateCertificateMap(ctx context.Context, req *certificatemanagerpb.UpdateCertificateMapRequest, opts ...gax.CallOption) (*UpdateCertificateMapOperation, error) {
1006 return c.internalClient.UpdateCertificateMap(ctx, req, opts...)
1007 }
1008
1009 // UpdateCertificateMapOperation returns a new UpdateCertificateMapOperation from a given name.
1010 // The name must be that of a previously created UpdateCertificateMapOperation, possibly from a different process.
1011 func (c *Client) UpdateCertificateMapOperation(name string) *UpdateCertificateMapOperation {
1012 return c.internalClient.UpdateCertificateMapOperation(name)
1013 }
1014
1015 // DeleteCertificateMap deletes a single CertificateMap. A Certificate Map can’t be deleted
1016 // if it contains Certificate Map Entries. Remove all the entries from
1017 // the map before calling this method.
1018 func (c *Client) DeleteCertificateMap(ctx context.Context, req *certificatemanagerpb.DeleteCertificateMapRequest, opts ...gax.CallOption) (*DeleteCertificateMapOperation, error) {
1019 return c.internalClient.DeleteCertificateMap(ctx, req, opts...)
1020 }
1021
1022 // DeleteCertificateMapOperation returns a new DeleteCertificateMapOperation from a given name.
1023 // The name must be that of a previously created DeleteCertificateMapOperation, possibly from a different process.
1024 func (c *Client) DeleteCertificateMapOperation(name string) *DeleteCertificateMapOperation {
1025 return c.internalClient.DeleteCertificateMapOperation(name)
1026 }
1027
1028 // ListCertificateMapEntries lists CertificateMapEntries in a given project and location.
1029 func (c *Client) ListCertificateMapEntries(ctx context.Context, req *certificatemanagerpb.ListCertificateMapEntriesRequest, opts ...gax.CallOption) *CertificateMapEntryIterator {
1030 return c.internalClient.ListCertificateMapEntries(ctx, req, opts...)
1031 }
1032
1033 // GetCertificateMapEntry gets details of a single CertificateMapEntry.
1034 func (c *Client) GetCertificateMapEntry(ctx context.Context, req *certificatemanagerpb.GetCertificateMapEntryRequest, opts ...gax.CallOption) (*certificatemanagerpb.CertificateMapEntry, error) {
1035 return c.internalClient.GetCertificateMapEntry(ctx, req, opts...)
1036 }
1037
1038 // CreateCertificateMapEntry creates a new CertificateMapEntry in a given project and location.
1039 func (c *Client) CreateCertificateMapEntry(ctx context.Context, req *certificatemanagerpb.CreateCertificateMapEntryRequest, opts ...gax.CallOption) (*CreateCertificateMapEntryOperation, error) {
1040 return c.internalClient.CreateCertificateMapEntry(ctx, req, opts...)
1041 }
1042
1043 // CreateCertificateMapEntryOperation returns a new CreateCertificateMapEntryOperation from a given name.
1044 // The name must be that of a previously created CreateCertificateMapEntryOperation, possibly from a different process.
1045 func (c *Client) CreateCertificateMapEntryOperation(name string) *CreateCertificateMapEntryOperation {
1046 return c.internalClient.CreateCertificateMapEntryOperation(name)
1047 }
1048
1049 // UpdateCertificateMapEntry updates a CertificateMapEntry.
1050 func (c *Client) UpdateCertificateMapEntry(ctx context.Context, req *certificatemanagerpb.UpdateCertificateMapEntryRequest, opts ...gax.CallOption) (*UpdateCertificateMapEntryOperation, error) {
1051 return c.internalClient.UpdateCertificateMapEntry(ctx, req, opts...)
1052 }
1053
1054 // UpdateCertificateMapEntryOperation returns a new UpdateCertificateMapEntryOperation from a given name.
1055 // The name must be that of a previously created UpdateCertificateMapEntryOperation, possibly from a different process.
1056 func (c *Client) UpdateCertificateMapEntryOperation(name string) *UpdateCertificateMapEntryOperation {
1057 return c.internalClient.UpdateCertificateMapEntryOperation(name)
1058 }
1059
1060 // DeleteCertificateMapEntry deletes a single CertificateMapEntry.
1061 func (c *Client) DeleteCertificateMapEntry(ctx context.Context, req *certificatemanagerpb.DeleteCertificateMapEntryRequest, opts ...gax.CallOption) (*DeleteCertificateMapEntryOperation, error) {
1062 return c.internalClient.DeleteCertificateMapEntry(ctx, req, opts...)
1063 }
1064
1065 // DeleteCertificateMapEntryOperation returns a new DeleteCertificateMapEntryOperation from a given name.
1066 // The name must be that of a previously created DeleteCertificateMapEntryOperation, possibly from a different process.
1067 func (c *Client) DeleteCertificateMapEntryOperation(name string) *DeleteCertificateMapEntryOperation {
1068 return c.internalClient.DeleteCertificateMapEntryOperation(name)
1069 }
1070
1071 // ListDnsAuthorizations lists DnsAuthorizations in a given project and location.
1072 func (c *Client) ListDnsAuthorizations(ctx context.Context, req *certificatemanagerpb.ListDnsAuthorizationsRequest, opts ...gax.CallOption) *DnsAuthorizationIterator {
1073 return c.internalClient.ListDnsAuthorizations(ctx, req, opts...)
1074 }
1075
1076 // GetDnsAuthorization gets details of a single DnsAuthorization.
1077 func (c *Client) GetDnsAuthorization(ctx context.Context, req *certificatemanagerpb.GetDnsAuthorizationRequest, opts ...gax.CallOption) (*certificatemanagerpb.DnsAuthorization, error) {
1078 return c.internalClient.GetDnsAuthorization(ctx, req, opts...)
1079 }
1080
1081 // CreateDnsAuthorization creates a new DnsAuthorization in a given project and location.
1082 func (c *Client) CreateDnsAuthorization(ctx context.Context, req *certificatemanagerpb.CreateDnsAuthorizationRequest, opts ...gax.CallOption) (*CreateDnsAuthorizationOperation, error) {
1083 return c.internalClient.CreateDnsAuthorization(ctx, req, opts...)
1084 }
1085
1086 // CreateDnsAuthorizationOperation returns a new CreateDnsAuthorizationOperation from a given name.
1087 // The name must be that of a previously created CreateDnsAuthorizationOperation, possibly from a different process.
1088 func (c *Client) CreateDnsAuthorizationOperation(name string) *CreateDnsAuthorizationOperation {
1089 return c.internalClient.CreateDnsAuthorizationOperation(name)
1090 }
1091
1092 // UpdateDnsAuthorization updates a DnsAuthorization.
1093 func (c *Client) UpdateDnsAuthorization(ctx context.Context, req *certificatemanagerpb.UpdateDnsAuthorizationRequest, opts ...gax.CallOption) (*UpdateDnsAuthorizationOperation, error) {
1094 return c.internalClient.UpdateDnsAuthorization(ctx, req, opts...)
1095 }
1096
1097 // UpdateDnsAuthorizationOperation returns a new UpdateDnsAuthorizationOperation from a given name.
1098 // The name must be that of a previously created UpdateDnsAuthorizationOperation, possibly from a different process.
1099 func (c *Client) UpdateDnsAuthorizationOperation(name string) *UpdateDnsAuthorizationOperation {
1100 return c.internalClient.UpdateDnsAuthorizationOperation(name)
1101 }
1102
1103 // DeleteDnsAuthorization deletes a single DnsAuthorization.
1104 func (c *Client) DeleteDnsAuthorization(ctx context.Context, req *certificatemanagerpb.DeleteDnsAuthorizationRequest, opts ...gax.CallOption) (*DeleteDnsAuthorizationOperation, error) {
1105 return c.internalClient.DeleteDnsAuthorization(ctx, req, opts...)
1106 }
1107
1108 // DeleteDnsAuthorizationOperation returns a new DeleteDnsAuthorizationOperation from a given name.
1109 // The name must be that of a previously created DeleteDnsAuthorizationOperation, possibly from a different process.
1110 func (c *Client) DeleteDnsAuthorizationOperation(name string) *DeleteDnsAuthorizationOperation {
1111 return c.internalClient.DeleteDnsAuthorizationOperation(name)
1112 }
1113
1114 // ListCertificateIssuanceConfigs lists CertificateIssuanceConfigs in a given project and location.
1115 func (c *Client) ListCertificateIssuanceConfigs(ctx context.Context, req *certificatemanagerpb.ListCertificateIssuanceConfigsRequest, opts ...gax.CallOption) *CertificateIssuanceConfigIterator {
1116 return c.internalClient.ListCertificateIssuanceConfigs(ctx, req, opts...)
1117 }
1118
1119 // GetCertificateIssuanceConfig gets details of a single CertificateIssuanceConfig.
1120 func (c *Client) GetCertificateIssuanceConfig(ctx context.Context, req *certificatemanagerpb.GetCertificateIssuanceConfigRequest, opts ...gax.CallOption) (*certificatemanagerpb.CertificateIssuanceConfig, error) {
1121 return c.internalClient.GetCertificateIssuanceConfig(ctx, req, opts...)
1122 }
1123
1124 // CreateCertificateIssuanceConfig creates a new CertificateIssuanceConfig in a given project and location.
1125 func (c *Client) CreateCertificateIssuanceConfig(ctx context.Context, req *certificatemanagerpb.CreateCertificateIssuanceConfigRequest, opts ...gax.CallOption) (*CreateCertificateIssuanceConfigOperation, error) {
1126 return c.internalClient.CreateCertificateIssuanceConfig(ctx, req, opts...)
1127 }
1128
1129 // CreateCertificateIssuanceConfigOperation returns a new CreateCertificateIssuanceConfigOperation from a given name.
1130 // The name must be that of a previously created CreateCertificateIssuanceConfigOperation, possibly from a different process.
1131 func (c *Client) CreateCertificateIssuanceConfigOperation(name string) *CreateCertificateIssuanceConfigOperation {
1132 return c.internalClient.CreateCertificateIssuanceConfigOperation(name)
1133 }
1134
1135 // DeleteCertificateIssuanceConfig deletes a single CertificateIssuanceConfig.
1136 func (c *Client) DeleteCertificateIssuanceConfig(ctx context.Context, req *certificatemanagerpb.DeleteCertificateIssuanceConfigRequest, opts ...gax.CallOption) (*DeleteCertificateIssuanceConfigOperation, error) {
1137 return c.internalClient.DeleteCertificateIssuanceConfig(ctx, req, opts...)
1138 }
1139
1140 // DeleteCertificateIssuanceConfigOperation returns a new DeleteCertificateIssuanceConfigOperation from a given name.
1141 // The name must be that of a previously created DeleteCertificateIssuanceConfigOperation, possibly from a different process.
1142 func (c *Client) DeleteCertificateIssuanceConfigOperation(name string) *DeleteCertificateIssuanceConfigOperation {
1143 return c.internalClient.DeleteCertificateIssuanceConfigOperation(name)
1144 }
1145
1146 // ListTrustConfigs lists TrustConfigs in a given project and location.
1147 func (c *Client) ListTrustConfigs(ctx context.Context, req *certificatemanagerpb.ListTrustConfigsRequest, opts ...gax.CallOption) *TrustConfigIterator {
1148 return c.internalClient.ListTrustConfigs(ctx, req, opts...)
1149 }
1150
1151 // GetTrustConfig gets details of a single TrustConfig.
1152 func (c *Client) GetTrustConfig(ctx context.Context, req *certificatemanagerpb.GetTrustConfigRequest, opts ...gax.CallOption) (*certificatemanagerpb.TrustConfig, error) {
1153 return c.internalClient.GetTrustConfig(ctx, req, opts...)
1154 }
1155
1156 // CreateTrustConfig creates a new TrustConfig in a given project and location.
1157 func (c *Client) CreateTrustConfig(ctx context.Context, req *certificatemanagerpb.CreateTrustConfigRequest, opts ...gax.CallOption) (*CreateTrustConfigOperation, error) {
1158 return c.internalClient.CreateTrustConfig(ctx, req, opts...)
1159 }
1160
1161 // CreateTrustConfigOperation returns a new CreateTrustConfigOperation from a given name.
1162 // The name must be that of a previously created CreateTrustConfigOperation, possibly from a different process.
1163 func (c *Client) CreateTrustConfigOperation(name string) *CreateTrustConfigOperation {
1164 return c.internalClient.CreateTrustConfigOperation(name)
1165 }
1166
1167 // UpdateTrustConfig updates a TrustConfig.
1168 func (c *Client) UpdateTrustConfig(ctx context.Context, req *certificatemanagerpb.UpdateTrustConfigRequest, opts ...gax.CallOption) (*UpdateTrustConfigOperation, error) {
1169 return c.internalClient.UpdateTrustConfig(ctx, req, opts...)
1170 }
1171
1172 // UpdateTrustConfigOperation returns a new UpdateTrustConfigOperation from a given name.
1173 // The name must be that of a previously created UpdateTrustConfigOperation, possibly from a different process.
1174 func (c *Client) UpdateTrustConfigOperation(name string) *UpdateTrustConfigOperation {
1175 return c.internalClient.UpdateTrustConfigOperation(name)
1176 }
1177
1178 // DeleteTrustConfig deletes a single TrustConfig.
1179 func (c *Client) DeleteTrustConfig(ctx context.Context, req *certificatemanagerpb.DeleteTrustConfigRequest, opts ...gax.CallOption) (*DeleteTrustConfigOperation, error) {
1180 return c.internalClient.DeleteTrustConfig(ctx, req, opts...)
1181 }
1182
1183 // DeleteTrustConfigOperation returns a new DeleteTrustConfigOperation from a given name.
1184 // The name must be that of a previously created DeleteTrustConfigOperation, possibly from a different process.
1185 func (c *Client) DeleteTrustConfigOperation(name string) *DeleteTrustConfigOperation {
1186 return c.internalClient.DeleteTrustConfigOperation(name)
1187 }
1188
1189 // GetLocation gets information about a location.
1190 func (c *Client) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error) {
1191 return c.internalClient.GetLocation(ctx, req, opts...)
1192 }
1193
1194 // ListLocations lists information about the supported locations for this service.
1195 func (c *Client) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator {
1196 return c.internalClient.ListLocations(ctx, req, opts...)
1197 }
1198
1199 // CancelOperation is a utility method from google.longrunning.Operations.
1200 func (c *Client) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error {
1201 return c.internalClient.CancelOperation(ctx, req, opts...)
1202 }
1203
1204 // DeleteOperation is a utility method from google.longrunning.Operations.
1205 func (c *Client) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error {
1206 return c.internalClient.DeleteOperation(ctx, req, opts...)
1207 }
1208
1209 // GetOperation is a utility method from google.longrunning.Operations.
1210 func (c *Client) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) {
1211 return c.internalClient.GetOperation(ctx, req, opts...)
1212 }
1213
1214 // ListOperations is a utility method from google.longrunning.Operations.
1215 func (c *Client) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator {
1216 return c.internalClient.ListOperations(ctx, req, opts...)
1217 }
1218
1219 // gRPCClient is a client for interacting with Certificate Manager API over gRPC transport.
1220 //
1221 // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
1222 type gRPCClient struct {
1223 // Connection pool of gRPC connections to the service.
1224 connPool gtransport.ConnPool
1225
1226 // Points back to the CallOptions field of the containing Client
1227 CallOptions **CallOptions
1228
1229 // The gRPC API client.
1230 client certificatemanagerpb.CertificateManagerClient
1231
1232 // LROClient is used internally to handle long-running operations.
1233 // It is exposed so that its CallOptions can be modified if required.
1234 // Users should not Close this client.
1235 LROClient **lroauto.OperationsClient
1236
1237 operationsClient longrunningpb.OperationsClient
1238
1239 locationsClient locationpb.LocationsClient
1240
1241 // The x-goog-* metadata to be sent with each request.
1242 xGoogHeaders []string
1243
1244 logger *slog.Logger
1245 }
1246
1247 // NewClient creates a new certificate manager client based on gRPC.
1248 // The returned client must be Closed when it is done being used to clean up its underlying connections.
1249 //
1250 // # API Overview
1251 //
1252 // Certificates Manager API allows customers to see and manage all their TLS
1253 // certificates.
1254 //
1255 // Certificates Manager API service provides methods to manage certificates,
1256 // group them into collections, and create serving configuration that can be
1257 // easily applied to other Cloud resources e.g. Target Proxies.
1258 //
1259 // # Data Model
1260 //
1261 // The Certificates Manager service exposes the following resources:
1262 //
1263 // Certificate that describes a single TLS certificate.
1264 //
1265 // CertificateMap that describes a collection of certificates that can be
1266 // attached to a target resource.
1267 //
1268 // CertificateMapEntry that describes a single configuration entry that
1269 // consists of a SNI and a group of certificates. It’s a subresource of
1270 // CertificateMap.
1271 //
1272 // Certificate, CertificateMap and CertificateMapEntry IDs
1273 // have to fully match the regexp [a-z0-9-]{1,63}. In other words,
1274 //
1275 // only lower case letters, digits, and hyphen are allowed
1276 //
1277 // length of the resource ID has to be in [1,63] range.
1278 //
1279 // Provides methods to manage Cloud Certificate Manager entities.
1280 func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) {
1281 clientOpts := defaultGRPCClientOptions()
1282 if newClientHook != nil {
1283 hookOpts, err := newClientHook(ctx, clientHookParams{})
1284 if err != nil {
1285 return nil, err
1286 }
1287 clientOpts = append(clientOpts, hookOpts...)
1288 }
1289
1290 connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...)
1291 if err != nil {
1292 return nil, err
1293 }
1294 client := Client{CallOptions: defaultCallOptions()}
1295
1296 c := &gRPCClient{
1297 connPool: connPool,
1298 client: certificatemanagerpb.NewCertificateManagerClient(connPool),
1299 CallOptions: &client.CallOptions,
1300 logger: internaloption.GetLogger(opts),
1301 operationsClient: longrunningpb.NewOperationsClient(connPool),
1302 locationsClient: locationpb.NewLocationsClient(connPool),
1303 }
1304 c.setGoogleClientInfo()
1305
1306 client.internalClient = c
1307
1308 client.LROClient, err = lroauto.NewOperationsClient(ctx, gtransport.WithConnPool(connPool))
1309 if err != nil {
1310 // This error "should not happen", since we are just reusing old connection pool
1311 // and never actually need to dial.
1312 // If this does happen, we could leak connp. However, we cannot close conn:
1313 // If the user invoked the constructor with option.WithGRPCConn,
1314 // we would close a connection that's still in use.
1315 // TODO: investigate error conditions.
1316 return nil, err
1317 }
1318 c.LROClient = &client.LROClient
1319 return &client, nil
1320 }
1321
1322 // Connection returns a connection to the API service.
1323 //
1324 // Deprecated: Connections are now pooled so this method does not always
1325 // return the same resource.
1326 func (c *gRPCClient) Connection() *grpc.ClientConn {
1327 return c.connPool.Conn()
1328 }
1329
1330 // setGoogleClientInfo sets the name and version of the application in
1331 // the `x-goog-api-client` header passed on each request. Intended for
1332 // use by Google-written clients.
1333 func (c *gRPCClient) setGoogleClientInfo(keyval ...string) {
1334 kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
1335 kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version, "pb", protoVersion)
1336 c.xGoogHeaders = []string{
1337 "x-goog-api-client", gax.XGoogHeader(kv...),
1338 }
1339 }
1340
1341 // Close closes the connection to the API service. The user should invoke this when
1342 // the client is no longer required.
1343 func (c *gRPCClient) Close() error {
1344 return c.connPool.Close()
1345 }
1346
1347 // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
1348 type restClient struct {
1349 // The http endpoint to connect to.
1350 endpoint string
1351
1352 // The http client.
1353 httpClient *http.Client
1354
1355 // LROClient is used internally to handle long-running operations.
1356 // It is exposed so that its CallOptions can be modified if required.
1357 // Users should not Close this client.
1358 LROClient **lroauto.OperationsClient
1359
1360 // The x-goog-* headers to be sent with each request.
1361 xGoogHeaders []string
1362
1363 // Points back to the CallOptions field of the containing Client
1364 CallOptions **CallOptions
1365
1366 logger *slog.Logger
1367 }
1368
1369 // NewRESTClient creates a new certificate manager rest client.
1370 //
1371 // # API Overview
1372 //
1373 // Certificates Manager API allows customers to see and manage all their TLS
1374 // certificates.
1375 //
1376 // Certificates Manager API service provides methods to manage certificates,
1377 // group them into collections, and create serving configuration that can be
1378 // easily applied to other Cloud resources e.g. Target Proxies.
1379 //
1380 // # Data Model
1381 //
1382 // The Certificates Manager service exposes the following resources:
1383 //
1384 // Certificate that describes a single TLS certificate.
1385 //
1386 // CertificateMap that describes a collection of certificates that can be
1387 // attached to a target resource.
1388 //
1389 // CertificateMapEntry that describes a single configuration entry that
1390 // consists of a SNI and a group of certificates. It’s a subresource of
1391 // CertificateMap.
1392 //
1393 // Certificate, CertificateMap and CertificateMapEntry IDs
1394 // have to fully match the regexp [a-z0-9-]{1,63}. In other words,
1395 //
1396 // only lower case letters, digits, and hyphen are allowed
1397 //
1398 // length of the resource ID has to be in [1,63] range.
1399 //
1400 // Provides methods to manage Cloud Certificate Manager entities.
1401 func NewRESTClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) {
1402 clientOpts := append(defaultRESTClientOptions(), opts...)
1403 httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...)
1404 if err != nil {
1405 return nil, err
1406 }
1407
1408 callOpts := defaultRESTCallOptions()
1409 c := &restClient{
1410 endpoint: endpoint,
1411 httpClient: httpClient,
1412 CallOptions: &callOpts,
1413 logger: internaloption.GetLogger(opts),
1414 }
1415 c.setGoogleClientInfo()
1416
1417 lroOpts := []option.ClientOption{
1418 option.WithHTTPClient(httpClient),
1419 option.WithEndpoint(endpoint),
1420 }
1421 opClient, err := lroauto.NewOperationsRESTClient(ctx, lroOpts...)
1422 if err != nil {
1423 return nil, err
1424 }
1425 c.LROClient = &opClient
1426
1427 return &Client{internalClient: c, CallOptions: callOpts}, nil
1428 }
1429
1430 func defaultRESTClientOptions() []option.ClientOption {
1431 return []option.ClientOption{
1432 internaloption.WithDefaultEndpoint("https://certificatemanager.googleapis.com"),
1433 internaloption.WithDefaultEndpointTemplate("https://certificatemanager.UNIVERSE_DOMAIN"),
1434 internaloption.WithDefaultMTLSEndpoint("https://certificatemanager.mtls.googleapis.com"),
1435 internaloption.WithDefaultUniverseDomain("googleapis.com"),
1436 internaloption.WithDefaultAudience("https://certificatemanager.googleapis.com/"),
1437 internaloption.WithDefaultScopes(DefaultAuthScopes()...),
1438 internaloption.EnableNewAuthLibrary(),
1439 }
1440 }
1441
1442 // setGoogleClientInfo sets the name and version of the application in
1443 // the `x-goog-api-client` header passed on each request. Intended for
1444 // use by Google-written clients.
1445 func (c *restClient) setGoogleClientInfo(keyval ...string) {
1446 kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
1447 kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN", "pb", protoVersion)
1448 c.xGoogHeaders = []string{
1449 "x-goog-api-client", gax.XGoogHeader(kv...),
1450 }
1451 }
1452
1453 // Close closes the connection to the API service. The user should invoke this when
1454 // the client is no longer required.
1455 func (c *restClient) Close() error {
1456 // Replace httpClient with nil to force cleanup.
1457 c.httpClient = nil
1458 return nil
1459 }
1460
1461 // Connection returns a connection to the API service.
1462 //
1463 // Deprecated: This method always returns nil.
1464 func (c *restClient) Connection() *grpc.ClientConn {
1465 return nil
1466 }
1467 func (c *gRPCClient) ListCertificates(ctx context.Context, req *certificatemanagerpb.ListCertificatesRequest, opts ...gax.CallOption) *CertificateIterator {
1468 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
1469
1470 hds = append(c.xGoogHeaders, hds...)
1471 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1472 opts = append((*c.CallOptions).ListCertificates[0:len((*c.CallOptions).ListCertificates):len((*c.CallOptions).ListCertificates)], opts...)
1473 it := &CertificateIterator{}
1474 req = proto.Clone(req).(*certificatemanagerpb.ListCertificatesRequest)
1475 it.InternalFetch = func(pageSize int, pageToken string) ([]*certificatemanagerpb.Certificate, string, error) {
1476 resp := &certificatemanagerpb.ListCertificatesResponse{}
1477 if pageToken != "" {
1478 req.PageToken = pageToken
1479 }
1480 if pageSize > math.MaxInt32 {
1481 req.PageSize = math.MaxInt32
1482 } else if pageSize != 0 {
1483 req.PageSize = int32(pageSize)
1484 }
1485 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1486 var err error
1487 resp, err = executeRPC(ctx, c.client.ListCertificates, req, settings.GRPC, c.logger, "ListCertificates")
1488 return err
1489 }, opts...)
1490 if err != nil {
1491 return nil, "", err
1492 }
1493
1494 it.Response = resp
1495 return resp.GetCertificates(), resp.GetNextPageToken(), nil
1496 }
1497 fetch := func(pageSize int, pageToken string) (string, error) {
1498 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
1499 if err != nil {
1500 return "", err
1501 }
1502 it.items = append(it.items, items...)
1503 return nextPageToken, nil
1504 }
1505
1506 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
1507 it.pageInfo.MaxSize = int(req.GetPageSize())
1508 it.pageInfo.Token = req.GetPageToken()
1509
1510 return it
1511 }
1512
1513 func (c *gRPCClient) GetCertificate(ctx context.Context, req *certificatemanagerpb.GetCertificateRequest, opts ...gax.CallOption) (*certificatemanagerpb.Certificate, error) {
1514 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1515
1516 hds = append(c.xGoogHeaders, hds...)
1517 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1518 opts = append((*c.CallOptions).GetCertificate[0:len((*c.CallOptions).GetCertificate):len((*c.CallOptions).GetCertificate)], opts...)
1519 var resp *certificatemanagerpb.Certificate
1520 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1521 var err error
1522 resp, err = executeRPC(ctx, c.client.GetCertificate, req, settings.GRPC, c.logger, "GetCertificate")
1523 return err
1524 }, opts...)
1525 if err != nil {
1526 return nil, err
1527 }
1528 return resp, nil
1529 }
1530
1531 func (c *gRPCClient) CreateCertificate(ctx context.Context, req *certificatemanagerpb.CreateCertificateRequest, opts ...gax.CallOption) (*CreateCertificateOperation, error) {
1532 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
1533
1534 hds = append(c.xGoogHeaders, hds...)
1535 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1536 opts = append((*c.CallOptions).CreateCertificate[0:len((*c.CallOptions).CreateCertificate):len((*c.CallOptions).CreateCertificate)], opts...)
1537 var resp *longrunningpb.Operation
1538 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1539 var err error
1540 resp, err = executeRPC(ctx, c.client.CreateCertificate, req, settings.GRPC, c.logger, "CreateCertificate")
1541 return err
1542 }, opts...)
1543 if err != nil {
1544 return nil, err
1545 }
1546 return &CreateCertificateOperation{
1547 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1548 }, nil
1549 }
1550
1551 func (c *gRPCClient) UpdateCertificate(ctx context.Context, req *certificatemanagerpb.UpdateCertificateRequest, opts ...gax.CallOption) (*UpdateCertificateOperation, error) {
1552 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "certificate.name", url.QueryEscape(req.GetCertificate().GetName()))}
1553
1554 hds = append(c.xGoogHeaders, hds...)
1555 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1556 opts = append((*c.CallOptions).UpdateCertificate[0:len((*c.CallOptions).UpdateCertificate):len((*c.CallOptions).UpdateCertificate)], opts...)
1557 var resp *longrunningpb.Operation
1558 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1559 var err error
1560 resp, err = executeRPC(ctx, c.client.UpdateCertificate, req, settings.GRPC, c.logger, "UpdateCertificate")
1561 return err
1562 }, opts...)
1563 if err != nil {
1564 return nil, err
1565 }
1566 return &UpdateCertificateOperation{
1567 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1568 }, nil
1569 }
1570
1571 func (c *gRPCClient) DeleteCertificate(ctx context.Context, req *certificatemanagerpb.DeleteCertificateRequest, opts ...gax.CallOption) (*DeleteCertificateOperation, error) {
1572 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1573
1574 hds = append(c.xGoogHeaders, hds...)
1575 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1576 opts = append((*c.CallOptions).DeleteCertificate[0:len((*c.CallOptions).DeleteCertificate):len((*c.CallOptions).DeleteCertificate)], opts...)
1577 var resp *longrunningpb.Operation
1578 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1579 var err error
1580 resp, err = executeRPC(ctx, c.client.DeleteCertificate, req, settings.GRPC, c.logger, "DeleteCertificate")
1581 return err
1582 }, opts...)
1583 if err != nil {
1584 return nil, err
1585 }
1586 return &DeleteCertificateOperation{
1587 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1588 }, nil
1589 }
1590
1591 func (c *gRPCClient) ListCertificateMaps(ctx context.Context, req *certificatemanagerpb.ListCertificateMapsRequest, opts ...gax.CallOption) *CertificateMapIterator {
1592 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
1593
1594 hds = append(c.xGoogHeaders, hds...)
1595 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1596 opts = append((*c.CallOptions).ListCertificateMaps[0:len((*c.CallOptions).ListCertificateMaps):len((*c.CallOptions).ListCertificateMaps)], opts...)
1597 it := &CertificateMapIterator{}
1598 req = proto.Clone(req).(*certificatemanagerpb.ListCertificateMapsRequest)
1599 it.InternalFetch = func(pageSize int, pageToken string) ([]*certificatemanagerpb.CertificateMap, string, error) {
1600 resp := &certificatemanagerpb.ListCertificateMapsResponse{}
1601 if pageToken != "" {
1602 req.PageToken = pageToken
1603 }
1604 if pageSize > math.MaxInt32 {
1605 req.PageSize = math.MaxInt32
1606 } else if pageSize != 0 {
1607 req.PageSize = int32(pageSize)
1608 }
1609 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1610 var err error
1611 resp, err = executeRPC(ctx, c.client.ListCertificateMaps, req, settings.GRPC, c.logger, "ListCertificateMaps")
1612 return err
1613 }, opts...)
1614 if err != nil {
1615 return nil, "", err
1616 }
1617
1618 it.Response = resp
1619 return resp.GetCertificateMaps(), resp.GetNextPageToken(), nil
1620 }
1621 fetch := func(pageSize int, pageToken string) (string, error) {
1622 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
1623 if err != nil {
1624 return "", err
1625 }
1626 it.items = append(it.items, items...)
1627 return nextPageToken, nil
1628 }
1629
1630 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
1631 it.pageInfo.MaxSize = int(req.GetPageSize())
1632 it.pageInfo.Token = req.GetPageToken()
1633
1634 return it
1635 }
1636
1637 func (c *gRPCClient) GetCertificateMap(ctx context.Context, req *certificatemanagerpb.GetCertificateMapRequest, opts ...gax.CallOption) (*certificatemanagerpb.CertificateMap, error) {
1638 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1639
1640 hds = append(c.xGoogHeaders, hds...)
1641 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1642 opts = append((*c.CallOptions).GetCertificateMap[0:len((*c.CallOptions).GetCertificateMap):len((*c.CallOptions).GetCertificateMap)], opts...)
1643 var resp *certificatemanagerpb.CertificateMap
1644 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1645 var err error
1646 resp, err = executeRPC(ctx, c.client.GetCertificateMap, req, settings.GRPC, c.logger, "GetCertificateMap")
1647 return err
1648 }, opts...)
1649 if err != nil {
1650 return nil, err
1651 }
1652 return resp, nil
1653 }
1654
1655 func (c *gRPCClient) CreateCertificateMap(ctx context.Context, req *certificatemanagerpb.CreateCertificateMapRequest, opts ...gax.CallOption) (*CreateCertificateMapOperation, error) {
1656 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
1657
1658 hds = append(c.xGoogHeaders, hds...)
1659 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1660 opts = append((*c.CallOptions).CreateCertificateMap[0:len((*c.CallOptions).CreateCertificateMap):len((*c.CallOptions).CreateCertificateMap)], opts...)
1661 var resp *longrunningpb.Operation
1662 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1663 var err error
1664 resp, err = executeRPC(ctx, c.client.CreateCertificateMap, req, settings.GRPC, c.logger, "CreateCertificateMap")
1665 return err
1666 }, opts...)
1667 if err != nil {
1668 return nil, err
1669 }
1670 return &CreateCertificateMapOperation{
1671 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1672 }, nil
1673 }
1674
1675 func (c *gRPCClient) UpdateCertificateMap(ctx context.Context, req *certificatemanagerpb.UpdateCertificateMapRequest, opts ...gax.CallOption) (*UpdateCertificateMapOperation, error) {
1676 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "certificate_map.name", url.QueryEscape(req.GetCertificateMap().GetName()))}
1677
1678 hds = append(c.xGoogHeaders, hds...)
1679 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1680 opts = append((*c.CallOptions).UpdateCertificateMap[0:len((*c.CallOptions).UpdateCertificateMap):len((*c.CallOptions).UpdateCertificateMap)], opts...)
1681 var resp *longrunningpb.Operation
1682 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1683 var err error
1684 resp, err = executeRPC(ctx, c.client.UpdateCertificateMap, req, settings.GRPC, c.logger, "UpdateCertificateMap")
1685 return err
1686 }, opts...)
1687 if err != nil {
1688 return nil, err
1689 }
1690 return &UpdateCertificateMapOperation{
1691 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1692 }, nil
1693 }
1694
1695 func (c *gRPCClient) DeleteCertificateMap(ctx context.Context, req *certificatemanagerpb.DeleteCertificateMapRequest, opts ...gax.CallOption) (*DeleteCertificateMapOperation, error) {
1696 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1697
1698 hds = append(c.xGoogHeaders, hds...)
1699 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1700 opts = append((*c.CallOptions).DeleteCertificateMap[0:len((*c.CallOptions).DeleteCertificateMap):len((*c.CallOptions).DeleteCertificateMap)], opts...)
1701 var resp *longrunningpb.Operation
1702 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1703 var err error
1704 resp, err = executeRPC(ctx, c.client.DeleteCertificateMap, req, settings.GRPC, c.logger, "DeleteCertificateMap")
1705 return err
1706 }, opts...)
1707 if err != nil {
1708 return nil, err
1709 }
1710 return &DeleteCertificateMapOperation{
1711 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1712 }, nil
1713 }
1714
1715 func (c *gRPCClient) ListCertificateMapEntries(ctx context.Context, req *certificatemanagerpb.ListCertificateMapEntriesRequest, opts ...gax.CallOption) *CertificateMapEntryIterator {
1716 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
1717
1718 hds = append(c.xGoogHeaders, hds...)
1719 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1720 opts = append((*c.CallOptions).ListCertificateMapEntries[0:len((*c.CallOptions).ListCertificateMapEntries):len((*c.CallOptions).ListCertificateMapEntries)], opts...)
1721 it := &CertificateMapEntryIterator{}
1722 req = proto.Clone(req).(*certificatemanagerpb.ListCertificateMapEntriesRequest)
1723 it.InternalFetch = func(pageSize int, pageToken string) ([]*certificatemanagerpb.CertificateMapEntry, string, error) {
1724 resp := &certificatemanagerpb.ListCertificateMapEntriesResponse{}
1725 if pageToken != "" {
1726 req.PageToken = pageToken
1727 }
1728 if pageSize > math.MaxInt32 {
1729 req.PageSize = math.MaxInt32
1730 } else if pageSize != 0 {
1731 req.PageSize = int32(pageSize)
1732 }
1733 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1734 var err error
1735 resp, err = executeRPC(ctx, c.client.ListCertificateMapEntries, req, settings.GRPC, c.logger, "ListCertificateMapEntries")
1736 return err
1737 }, opts...)
1738 if err != nil {
1739 return nil, "", err
1740 }
1741
1742 it.Response = resp
1743 return resp.GetCertificateMapEntries(), resp.GetNextPageToken(), nil
1744 }
1745 fetch := func(pageSize int, pageToken string) (string, error) {
1746 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
1747 if err != nil {
1748 return "", err
1749 }
1750 it.items = append(it.items, items...)
1751 return nextPageToken, nil
1752 }
1753
1754 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
1755 it.pageInfo.MaxSize = int(req.GetPageSize())
1756 it.pageInfo.Token = req.GetPageToken()
1757
1758 return it
1759 }
1760
1761 func (c *gRPCClient) GetCertificateMapEntry(ctx context.Context, req *certificatemanagerpb.GetCertificateMapEntryRequest, opts ...gax.CallOption) (*certificatemanagerpb.CertificateMapEntry, error) {
1762 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1763
1764 hds = append(c.xGoogHeaders, hds...)
1765 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1766 opts = append((*c.CallOptions).GetCertificateMapEntry[0:len((*c.CallOptions).GetCertificateMapEntry):len((*c.CallOptions).GetCertificateMapEntry)], opts...)
1767 var resp *certificatemanagerpb.CertificateMapEntry
1768 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1769 var err error
1770 resp, err = executeRPC(ctx, c.client.GetCertificateMapEntry, req, settings.GRPC, c.logger, "GetCertificateMapEntry")
1771 return err
1772 }, opts...)
1773 if err != nil {
1774 return nil, err
1775 }
1776 return resp, nil
1777 }
1778
1779 func (c *gRPCClient) CreateCertificateMapEntry(ctx context.Context, req *certificatemanagerpb.CreateCertificateMapEntryRequest, opts ...gax.CallOption) (*CreateCertificateMapEntryOperation, error) {
1780 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
1781
1782 hds = append(c.xGoogHeaders, hds...)
1783 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1784 opts = append((*c.CallOptions).CreateCertificateMapEntry[0:len((*c.CallOptions).CreateCertificateMapEntry):len((*c.CallOptions).CreateCertificateMapEntry)], opts...)
1785 var resp *longrunningpb.Operation
1786 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1787 var err error
1788 resp, err = executeRPC(ctx, c.client.CreateCertificateMapEntry, req, settings.GRPC, c.logger, "CreateCertificateMapEntry")
1789 return err
1790 }, opts...)
1791 if err != nil {
1792 return nil, err
1793 }
1794 return &CreateCertificateMapEntryOperation{
1795 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1796 }, nil
1797 }
1798
1799 func (c *gRPCClient) UpdateCertificateMapEntry(ctx context.Context, req *certificatemanagerpb.UpdateCertificateMapEntryRequest, opts ...gax.CallOption) (*UpdateCertificateMapEntryOperation, error) {
1800 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "certificate_map_entry.name", url.QueryEscape(req.GetCertificateMapEntry().GetName()))}
1801
1802 hds = append(c.xGoogHeaders, hds...)
1803 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1804 opts = append((*c.CallOptions).UpdateCertificateMapEntry[0:len((*c.CallOptions).UpdateCertificateMapEntry):len((*c.CallOptions).UpdateCertificateMapEntry)], opts...)
1805 var resp *longrunningpb.Operation
1806 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1807 var err error
1808 resp, err = executeRPC(ctx, c.client.UpdateCertificateMapEntry, req, settings.GRPC, c.logger, "UpdateCertificateMapEntry")
1809 return err
1810 }, opts...)
1811 if err != nil {
1812 return nil, err
1813 }
1814 return &UpdateCertificateMapEntryOperation{
1815 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1816 }, nil
1817 }
1818
1819 func (c *gRPCClient) DeleteCertificateMapEntry(ctx context.Context, req *certificatemanagerpb.DeleteCertificateMapEntryRequest, opts ...gax.CallOption) (*DeleteCertificateMapEntryOperation, error) {
1820 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1821
1822 hds = append(c.xGoogHeaders, hds...)
1823 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1824 opts = append((*c.CallOptions).DeleteCertificateMapEntry[0:len((*c.CallOptions).DeleteCertificateMapEntry):len((*c.CallOptions).DeleteCertificateMapEntry)], opts...)
1825 var resp *longrunningpb.Operation
1826 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1827 var err error
1828 resp, err = executeRPC(ctx, c.client.DeleteCertificateMapEntry, req, settings.GRPC, c.logger, "DeleteCertificateMapEntry")
1829 return err
1830 }, opts...)
1831 if err != nil {
1832 return nil, err
1833 }
1834 return &DeleteCertificateMapEntryOperation{
1835 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1836 }, nil
1837 }
1838
1839 func (c *gRPCClient) ListDnsAuthorizations(ctx context.Context, req *certificatemanagerpb.ListDnsAuthorizationsRequest, opts ...gax.CallOption) *DnsAuthorizationIterator {
1840 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
1841
1842 hds = append(c.xGoogHeaders, hds...)
1843 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1844 opts = append((*c.CallOptions).ListDnsAuthorizations[0:len((*c.CallOptions).ListDnsAuthorizations):len((*c.CallOptions).ListDnsAuthorizations)], opts...)
1845 it := &DnsAuthorizationIterator{}
1846 req = proto.Clone(req).(*certificatemanagerpb.ListDnsAuthorizationsRequest)
1847 it.InternalFetch = func(pageSize int, pageToken string) ([]*certificatemanagerpb.DnsAuthorization, string, error) {
1848 resp := &certificatemanagerpb.ListDnsAuthorizationsResponse{}
1849 if pageToken != "" {
1850 req.PageToken = pageToken
1851 }
1852 if pageSize > math.MaxInt32 {
1853 req.PageSize = math.MaxInt32
1854 } else if pageSize != 0 {
1855 req.PageSize = int32(pageSize)
1856 }
1857 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1858 var err error
1859 resp, err = executeRPC(ctx, c.client.ListDnsAuthorizations, req, settings.GRPC, c.logger, "ListDnsAuthorizations")
1860 return err
1861 }, opts...)
1862 if err != nil {
1863 return nil, "", err
1864 }
1865
1866 it.Response = resp
1867 return resp.GetDnsAuthorizations(), resp.GetNextPageToken(), nil
1868 }
1869 fetch := func(pageSize int, pageToken string) (string, error) {
1870 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
1871 if err != nil {
1872 return "", err
1873 }
1874 it.items = append(it.items, items...)
1875 return nextPageToken, nil
1876 }
1877
1878 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
1879 it.pageInfo.MaxSize = int(req.GetPageSize())
1880 it.pageInfo.Token = req.GetPageToken()
1881
1882 return it
1883 }
1884
1885 func (c *gRPCClient) GetDnsAuthorization(ctx context.Context, req *certificatemanagerpb.GetDnsAuthorizationRequest, opts ...gax.CallOption) (*certificatemanagerpb.DnsAuthorization, error) {
1886 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1887
1888 hds = append(c.xGoogHeaders, hds...)
1889 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1890 opts = append((*c.CallOptions).GetDnsAuthorization[0:len((*c.CallOptions).GetDnsAuthorization):len((*c.CallOptions).GetDnsAuthorization)], opts...)
1891 var resp *certificatemanagerpb.DnsAuthorization
1892 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1893 var err error
1894 resp, err = executeRPC(ctx, c.client.GetDnsAuthorization, req, settings.GRPC, c.logger, "GetDnsAuthorization")
1895 return err
1896 }, opts...)
1897 if err != nil {
1898 return nil, err
1899 }
1900 return resp, nil
1901 }
1902
1903 func (c *gRPCClient) CreateDnsAuthorization(ctx context.Context, req *certificatemanagerpb.CreateDnsAuthorizationRequest, opts ...gax.CallOption) (*CreateDnsAuthorizationOperation, error) {
1904 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
1905
1906 hds = append(c.xGoogHeaders, hds...)
1907 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1908 opts = append((*c.CallOptions).CreateDnsAuthorization[0:len((*c.CallOptions).CreateDnsAuthorization):len((*c.CallOptions).CreateDnsAuthorization)], opts...)
1909 var resp *longrunningpb.Operation
1910 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1911 var err error
1912 resp, err = executeRPC(ctx, c.client.CreateDnsAuthorization, req, settings.GRPC, c.logger, "CreateDnsAuthorization")
1913 return err
1914 }, opts...)
1915 if err != nil {
1916 return nil, err
1917 }
1918 return &CreateDnsAuthorizationOperation{
1919 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1920 }, nil
1921 }
1922
1923 func (c *gRPCClient) UpdateDnsAuthorization(ctx context.Context, req *certificatemanagerpb.UpdateDnsAuthorizationRequest, opts ...gax.CallOption) (*UpdateDnsAuthorizationOperation, error) {
1924 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "dns_authorization.name", url.QueryEscape(req.GetDnsAuthorization().GetName()))}
1925
1926 hds = append(c.xGoogHeaders, hds...)
1927 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1928 opts = append((*c.CallOptions).UpdateDnsAuthorization[0:len((*c.CallOptions).UpdateDnsAuthorization):len((*c.CallOptions).UpdateDnsAuthorization)], opts...)
1929 var resp *longrunningpb.Operation
1930 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1931 var err error
1932 resp, err = executeRPC(ctx, c.client.UpdateDnsAuthorization, req, settings.GRPC, c.logger, "UpdateDnsAuthorization")
1933 return err
1934 }, opts...)
1935 if err != nil {
1936 return nil, err
1937 }
1938 return &UpdateDnsAuthorizationOperation{
1939 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1940 }, nil
1941 }
1942
1943 func (c *gRPCClient) DeleteDnsAuthorization(ctx context.Context, req *certificatemanagerpb.DeleteDnsAuthorizationRequest, opts ...gax.CallOption) (*DeleteDnsAuthorizationOperation, error) {
1944 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1945
1946 hds = append(c.xGoogHeaders, hds...)
1947 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1948 opts = append((*c.CallOptions).DeleteDnsAuthorization[0:len((*c.CallOptions).DeleteDnsAuthorization):len((*c.CallOptions).DeleteDnsAuthorization)], opts...)
1949 var resp *longrunningpb.Operation
1950 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1951 var err error
1952 resp, err = executeRPC(ctx, c.client.DeleteDnsAuthorization, req, settings.GRPC, c.logger, "DeleteDnsAuthorization")
1953 return err
1954 }, opts...)
1955 if err != nil {
1956 return nil, err
1957 }
1958 return &DeleteDnsAuthorizationOperation{
1959 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1960 }, nil
1961 }
1962
1963 func (c *gRPCClient) ListCertificateIssuanceConfigs(ctx context.Context, req *certificatemanagerpb.ListCertificateIssuanceConfigsRequest, opts ...gax.CallOption) *CertificateIssuanceConfigIterator {
1964 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
1965
1966 hds = append(c.xGoogHeaders, hds...)
1967 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1968 opts = append((*c.CallOptions).ListCertificateIssuanceConfigs[0:len((*c.CallOptions).ListCertificateIssuanceConfigs):len((*c.CallOptions).ListCertificateIssuanceConfigs)], opts...)
1969 it := &CertificateIssuanceConfigIterator{}
1970 req = proto.Clone(req).(*certificatemanagerpb.ListCertificateIssuanceConfigsRequest)
1971 it.InternalFetch = func(pageSize int, pageToken string) ([]*certificatemanagerpb.CertificateIssuanceConfig, string, error) {
1972 resp := &certificatemanagerpb.ListCertificateIssuanceConfigsResponse{}
1973 if pageToken != "" {
1974 req.PageToken = pageToken
1975 }
1976 if pageSize > math.MaxInt32 {
1977 req.PageSize = math.MaxInt32
1978 } else if pageSize != 0 {
1979 req.PageSize = int32(pageSize)
1980 }
1981 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1982 var err error
1983 resp, err = executeRPC(ctx, c.client.ListCertificateIssuanceConfigs, req, settings.GRPC, c.logger, "ListCertificateIssuanceConfigs")
1984 return err
1985 }, opts...)
1986 if err != nil {
1987 return nil, "", err
1988 }
1989
1990 it.Response = resp
1991 return resp.GetCertificateIssuanceConfigs(), resp.GetNextPageToken(), nil
1992 }
1993 fetch := func(pageSize int, pageToken string) (string, error) {
1994 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
1995 if err != nil {
1996 return "", err
1997 }
1998 it.items = append(it.items, items...)
1999 return nextPageToken, nil
2000 }
2001
2002 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
2003 it.pageInfo.MaxSize = int(req.GetPageSize())
2004 it.pageInfo.Token = req.GetPageToken()
2005
2006 return it
2007 }
2008
2009 func (c *gRPCClient) GetCertificateIssuanceConfig(ctx context.Context, req *certificatemanagerpb.GetCertificateIssuanceConfigRequest, opts ...gax.CallOption) (*certificatemanagerpb.CertificateIssuanceConfig, error) {
2010 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2011
2012 hds = append(c.xGoogHeaders, hds...)
2013 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2014 opts = append((*c.CallOptions).GetCertificateIssuanceConfig[0:len((*c.CallOptions).GetCertificateIssuanceConfig):len((*c.CallOptions).GetCertificateIssuanceConfig)], opts...)
2015 var resp *certificatemanagerpb.CertificateIssuanceConfig
2016 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2017 var err error
2018 resp, err = executeRPC(ctx, c.client.GetCertificateIssuanceConfig, req, settings.GRPC, c.logger, "GetCertificateIssuanceConfig")
2019 return err
2020 }, opts...)
2021 if err != nil {
2022 return nil, err
2023 }
2024 return resp, nil
2025 }
2026
2027 func (c *gRPCClient) CreateCertificateIssuanceConfig(ctx context.Context, req *certificatemanagerpb.CreateCertificateIssuanceConfigRequest, opts ...gax.CallOption) (*CreateCertificateIssuanceConfigOperation, error) {
2028 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
2029
2030 hds = append(c.xGoogHeaders, hds...)
2031 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2032 opts = append((*c.CallOptions).CreateCertificateIssuanceConfig[0:len((*c.CallOptions).CreateCertificateIssuanceConfig):len((*c.CallOptions).CreateCertificateIssuanceConfig)], opts...)
2033 var resp *longrunningpb.Operation
2034 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2035 var err error
2036 resp, err = executeRPC(ctx, c.client.CreateCertificateIssuanceConfig, req, settings.GRPC, c.logger, "CreateCertificateIssuanceConfig")
2037 return err
2038 }, opts...)
2039 if err != nil {
2040 return nil, err
2041 }
2042 return &CreateCertificateIssuanceConfigOperation{
2043 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
2044 }, nil
2045 }
2046
2047 func (c *gRPCClient) DeleteCertificateIssuanceConfig(ctx context.Context, req *certificatemanagerpb.DeleteCertificateIssuanceConfigRequest, opts ...gax.CallOption) (*DeleteCertificateIssuanceConfigOperation, error) {
2048 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2049
2050 hds = append(c.xGoogHeaders, hds...)
2051 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2052 opts = append((*c.CallOptions).DeleteCertificateIssuanceConfig[0:len((*c.CallOptions).DeleteCertificateIssuanceConfig):len((*c.CallOptions).DeleteCertificateIssuanceConfig)], opts...)
2053 var resp *longrunningpb.Operation
2054 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2055 var err error
2056 resp, err = executeRPC(ctx, c.client.DeleteCertificateIssuanceConfig, req, settings.GRPC, c.logger, "DeleteCertificateIssuanceConfig")
2057 return err
2058 }, opts...)
2059 if err != nil {
2060 return nil, err
2061 }
2062 return &DeleteCertificateIssuanceConfigOperation{
2063 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
2064 }, nil
2065 }
2066
2067 func (c *gRPCClient) ListTrustConfigs(ctx context.Context, req *certificatemanagerpb.ListTrustConfigsRequest, opts ...gax.CallOption) *TrustConfigIterator {
2068 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
2069
2070 hds = append(c.xGoogHeaders, hds...)
2071 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2072 opts = append((*c.CallOptions).ListTrustConfigs[0:len((*c.CallOptions).ListTrustConfigs):len((*c.CallOptions).ListTrustConfigs)], opts...)
2073 it := &TrustConfigIterator{}
2074 req = proto.Clone(req).(*certificatemanagerpb.ListTrustConfigsRequest)
2075 it.InternalFetch = func(pageSize int, pageToken string) ([]*certificatemanagerpb.TrustConfig, string, error) {
2076 resp := &certificatemanagerpb.ListTrustConfigsResponse{}
2077 if pageToken != "" {
2078 req.PageToken = pageToken
2079 }
2080 if pageSize > math.MaxInt32 {
2081 req.PageSize = math.MaxInt32
2082 } else if pageSize != 0 {
2083 req.PageSize = int32(pageSize)
2084 }
2085 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2086 var err error
2087 resp, err = executeRPC(ctx, c.client.ListTrustConfigs, req, settings.GRPC, c.logger, "ListTrustConfigs")
2088 return err
2089 }, opts...)
2090 if err != nil {
2091 return nil, "", err
2092 }
2093
2094 it.Response = resp
2095 return resp.GetTrustConfigs(), resp.GetNextPageToken(), nil
2096 }
2097 fetch := func(pageSize int, pageToken string) (string, error) {
2098 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
2099 if err != nil {
2100 return "", err
2101 }
2102 it.items = append(it.items, items...)
2103 return nextPageToken, nil
2104 }
2105
2106 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
2107 it.pageInfo.MaxSize = int(req.GetPageSize())
2108 it.pageInfo.Token = req.GetPageToken()
2109
2110 return it
2111 }
2112
2113 func (c *gRPCClient) GetTrustConfig(ctx context.Context, req *certificatemanagerpb.GetTrustConfigRequest, opts ...gax.CallOption) (*certificatemanagerpb.TrustConfig, error) {
2114 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2115
2116 hds = append(c.xGoogHeaders, hds...)
2117 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2118 opts = append((*c.CallOptions).GetTrustConfig[0:len((*c.CallOptions).GetTrustConfig):len((*c.CallOptions).GetTrustConfig)], opts...)
2119 var resp *certificatemanagerpb.TrustConfig
2120 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2121 var err error
2122 resp, err = executeRPC(ctx, c.client.GetTrustConfig, req, settings.GRPC, c.logger, "GetTrustConfig")
2123 return err
2124 }, opts...)
2125 if err != nil {
2126 return nil, err
2127 }
2128 return resp, nil
2129 }
2130
2131 func (c *gRPCClient) CreateTrustConfig(ctx context.Context, req *certificatemanagerpb.CreateTrustConfigRequest, opts ...gax.CallOption) (*CreateTrustConfigOperation, error) {
2132 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
2133
2134 hds = append(c.xGoogHeaders, hds...)
2135 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2136 opts = append((*c.CallOptions).CreateTrustConfig[0:len((*c.CallOptions).CreateTrustConfig):len((*c.CallOptions).CreateTrustConfig)], opts...)
2137 var resp *longrunningpb.Operation
2138 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2139 var err error
2140 resp, err = executeRPC(ctx, c.client.CreateTrustConfig, req, settings.GRPC, c.logger, "CreateTrustConfig")
2141 return err
2142 }, opts...)
2143 if err != nil {
2144 return nil, err
2145 }
2146 return &CreateTrustConfigOperation{
2147 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
2148 }, nil
2149 }
2150
2151 func (c *gRPCClient) UpdateTrustConfig(ctx context.Context, req *certificatemanagerpb.UpdateTrustConfigRequest, opts ...gax.CallOption) (*UpdateTrustConfigOperation, error) {
2152 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "trust_config.name", url.QueryEscape(req.GetTrustConfig().GetName()))}
2153
2154 hds = append(c.xGoogHeaders, hds...)
2155 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2156 opts = append((*c.CallOptions).UpdateTrustConfig[0:len((*c.CallOptions).UpdateTrustConfig):len((*c.CallOptions).UpdateTrustConfig)], opts...)
2157 var resp *longrunningpb.Operation
2158 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2159 var err error
2160 resp, err = executeRPC(ctx, c.client.UpdateTrustConfig, req, settings.GRPC, c.logger, "UpdateTrustConfig")
2161 return err
2162 }, opts...)
2163 if err != nil {
2164 return nil, err
2165 }
2166 return &UpdateTrustConfigOperation{
2167 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
2168 }, nil
2169 }
2170
2171 func (c *gRPCClient) DeleteTrustConfig(ctx context.Context, req *certificatemanagerpb.DeleteTrustConfigRequest, opts ...gax.CallOption) (*DeleteTrustConfigOperation, error) {
2172 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2173
2174 hds = append(c.xGoogHeaders, hds...)
2175 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2176 opts = append((*c.CallOptions).DeleteTrustConfig[0:len((*c.CallOptions).DeleteTrustConfig):len((*c.CallOptions).DeleteTrustConfig)], opts...)
2177 var resp *longrunningpb.Operation
2178 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2179 var err error
2180 resp, err = executeRPC(ctx, c.client.DeleteTrustConfig, req, settings.GRPC, c.logger, "DeleteTrustConfig")
2181 return err
2182 }, opts...)
2183 if err != nil {
2184 return nil, err
2185 }
2186 return &DeleteTrustConfigOperation{
2187 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
2188 }, nil
2189 }
2190
2191 func (c *gRPCClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error) {
2192 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2193
2194 hds = append(c.xGoogHeaders, hds...)
2195 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2196 opts = append((*c.CallOptions).GetLocation[0:len((*c.CallOptions).GetLocation):len((*c.CallOptions).GetLocation)], opts...)
2197 var resp *locationpb.Location
2198 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2199 var err error
2200 resp, err = executeRPC(ctx, c.locationsClient.GetLocation, req, settings.GRPC, c.logger, "GetLocation")
2201 return err
2202 }, opts...)
2203 if err != nil {
2204 return nil, err
2205 }
2206 return resp, nil
2207 }
2208
2209 func (c *gRPCClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator {
2210 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2211
2212 hds = append(c.xGoogHeaders, hds...)
2213 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2214 opts = append((*c.CallOptions).ListLocations[0:len((*c.CallOptions).ListLocations):len((*c.CallOptions).ListLocations)], opts...)
2215 it := &LocationIterator{}
2216 req = proto.Clone(req).(*locationpb.ListLocationsRequest)
2217 it.InternalFetch = func(pageSize int, pageToken string) ([]*locationpb.Location, string, error) {
2218 resp := &locationpb.ListLocationsResponse{}
2219 if pageToken != "" {
2220 req.PageToken = pageToken
2221 }
2222 if pageSize > math.MaxInt32 {
2223 req.PageSize = math.MaxInt32
2224 } else if pageSize != 0 {
2225 req.PageSize = int32(pageSize)
2226 }
2227 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2228 var err error
2229 resp, err = executeRPC(ctx, c.locationsClient.ListLocations, req, settings.GRPC, c.logger, "ListLocations")
2230 return err
2231 }, opts...)
2232 if err != nil {
2233 return nil, "", err
2234 }
2235
2236 it.Response = resp
2237 return resp.GetLocations(), resp.GetNextPageToken(), nil
2238 }
2239 fetch := func(pageSize int, pageToken string) (string, error) {
2240 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
2241 if err != nil {
2242 return "", err
2243 }
2244 it.items = append(it.items, items...)
2245 return nextPageToken, nil
2246 }
2247
2248 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
2249 it.pageInfo.MaxSize = int(req.GetPageSize())
2250 it.pageInfo.Token = req.GetPageToken()
2251
2252 return it
2253 }
2254
2255 func (c *gRPCClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error {
2256 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2257
2258 hds = append(c.xGoogHeaders, hds...)
2259 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2260 opts = append((*c.CallOptions).CancelOperation[0:len((*c.CallOptions).CancelOperation):len((*c.CallOptions).CancelOperation)], opts...)
2261 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2262 var err error
2263 _, err = executeRPC(ctx, c.operationsClient.CancelOperation, req, settings.GRPC, c.logger, "CancelOperation")
2264 return err
2265 }, opts...)
2266 return err
2267 }
2268
2269 func (c *gRPCClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error {
2270 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2271
2272 hds = append(c.xGoogHeaders, hds...)
2273 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2274 opts = append((*c.CallOptions).DeleteOperation[0:len((*c.CallOptions).DeleteOperation):len((*c.CallOptions).DeleteOperation)], opts...)
2275 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2276 var err error
2277 _, err = executeRPC(ctx, c.operationsClient.DeleteOperation, req, settings.GRPC, c.logger, "DeleteOperation")
2278 return err
2279 }, opts...)
2280 return err
2281 }
2282
2283 func (c *gRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) {
2284 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2285
2286 hds = append(c.xGoogHeaders, hds...)
2287 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2288 opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...)
2289 var resp *longrunningpb.Operation
2290 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2291 var err error
2292 resp, err = executeRPC(ctx, c.operationsClient.GetOperation, req, settings.GRPC, c.logger, "GetOperation")
2293 return err
2294 }, opts...)
2295 if err != nil {
2296 return nil, err
2297 }
2298 return resp, nil
2299 }
2300
2301 func (c *gRPCClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator {
2302 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2303
2304 hds = append(c.xGoogHeaders, hds...)
2305 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2306 opts = append((*c.CallOptions).ListOperations[0:len((*c.CallOptions).ListOperations):len((*c.CallOptions).ListOperations)], opts...)
2307 it := &OperationIterator{}
2308 req = proto.Clone(req).(*longrunningpb.ListOperationsRequest)
2309 it.InternalFetch = func(pageSize int, pageToken string) ([]*longrunningpb.Operation, string, error) {
2310 resp := &longrunningpb.ListOperationsResponse{}
2311 if pageToken != "" {
2312 req.PageToken = pageToken
2313 }
2314 if pageSize > math.MaxInt32 {
2315 req.PageSize = math.MaxInt32
2316 } else if pageSize != 0 {
2317 req.PageSize = int32(pageSize)
2318 }
2319 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2320 var err error
2321 resp, err = executeRPC(ctx, c.operationsClient.ListOperations, req, settings.GRPC, c.logger, "ListOperations")
2322 return err
2323 }, opts...)
2324 if err != nil {
2325 return nil, "", err
2326 }
2327
2328 it.Response = resp
2329 return resp.GetOperations(), resp.GetNextPageToken(), nil
2330 }
2331 fetch := func(pageSize int, pageToken string) (string, error) {
2332 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
2333 if err != nil {
2334 return "", err
2335 }
2336 it.items = append(it.items, items...)
2337 return nextPageToken, nil
2338 }
2339
2340 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
2341 it.pageInfo.MaxSize = int(req.GetPageSize())
2342 it.pageInfo.Token = req.GetPageToken()
2343
2344 return it
2345 }
2346
2347 // ListCertificates lists Certificates in a given project and location.
2348 func (c *restClient) ListCertificates(ctx context.Context, req *certificatemanagerpb.ListCertificatesRequest, opts ...gax.CallOption) *CertificateIterator {
2349 it := &CertificateIterator{}
2350 req = proto.Clone(req).(*certificatemanagerpb.ListCertificatesRequest)
2351 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
2352 it.InternalFetch = func(pageSize int, pageToken string) ([]*certificatemanagerpb.Certificate, string, error) {
2353 resp := &certificatemanagerpb.ListCertificatesResponse{}
2354 if pageToken != "" {
2355 req.PageToken = pageToken
2356 }
2357 if pageSize > math.MaxInt32 {
2358 req.PageSize = math.MaxInt32
2359 } else if pageSize != 0 {
2360 req.PageSize = int32(pageSize)
2361 }
2362 baseUrl, err := url.Parse(c.endpoint)
2363 if err != nil {
2364 return nil, "", err
2365 }
2366 baseUrl.Path += fmt.Sprintf("/v1/%v/certificates", req.GetParent())
2367
2368 params := url.Values{}
2369 params.Add("$alt", "json;enum-encoding=int")
2370 if req.GetFilter() != "" {
2371 params.Add("filter", fmt.Sprintf("%v", req.GetFilter()))
2372 }
2373 if req.GetOrderBy() != "" {
2374 params.Add("orderBy", fmt.Sprintf("%v", req.GetOrderBy()))
2375 }
2376 if req.GetPageSize() != 0 {
2377 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
2378 }
2379 if req.GetPageToken() != "" {
2380 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
2381 }
2382
2383 baseUrl.RawQuery = params.Encode()
2384
2385 // Build HTTP headers from client and context metadata.
2386 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
2387 headers := gax.BuildHeaders(ctx, hds...)
2388 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2389 if settings.Path != "" {
2390 baseUrl.Path = settings.Path
2391 }
2392 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
2393 if err != nil {
2394 return err
2395 }
2396 httpReq.Header = headers
2397
2398 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListCertificates")
2399 if err != nil {
2400 return err
2401 }
2402 if err := unm.Unmarshal(buf, resp); err != nil {
2403 return err
2404 }
2405
2406 return nil
2407 }, opts...)
2408 if e != nil {
2409 return nil, "", e
2410 }
2411 it.Response = resp
2412 return resp.GetCertificates(), resp.GetNextPageToken(), nil
2413 }
2414
2415 fetch := func(pageSize int, pageToken string) (string, error) {
2416 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
2417 if err != nil {
2418 return "", err
2419 }
2420 it.items = append(it.items, items...)
2421 return nextPageToken, nil
2422 }
2423
2424 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
2425 it.pageInfo.MaxSize = int(req.GetPageSize())
2426 it.pageInfo.Token = req.GetPageToken()
2427
2428 return it
2429 }
2430
2431 // GetCertificate gets details of a single Certificate.
2432 func (c *restClient) GetCertificate(ctx context.Context, req *certificatemanagerpb.GetCertificateRequest, opts ...gax.CallOption) (*certificatemanagerpb.Certificate, error) {
2433 baseUrl, err := url.Parse(c.endpoint)
2434 if err != nil {
2435 return nil, err
2436 }
2437 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
2438
2439 params := url.Values{}
2440 params.Add("$alt", "json;enum-encoding=int")
2441
2442 baseUrl.RawQuery = params.Encode()
2443
2444 // Build HTTP headers from client and context metadata.
2445 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2446
2447 hds = append(c.xGoogHeaders, hds...)
2448 hds = append(hds, "Content-Type", "application/json")
2449 headers := gax.BuildHeaders(ctx, hds...)
2450 opts = append((*c.CallOptions).GetCertificate[0:len((*c.CallOptions).GetCertificate):len((*c.CallOptions).GetCertificate)], opts...)
2451 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
2452 resp := &certificatemanagerpb.Certificate{}
2453 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2454 if settings.Path != "" {
2455 baseUrl.Path = settings.Path
2456 }
2457 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
2458 if err != nil {
2459 return err
2460 }
2461 httpReq = httpReq.WithContext(ctx)
2462 httpReq.Header = headers
2463
2464 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetCertificate")
2465 if err != nil {
2466 return err
2467 }
2468
2469 if err := unm.Unmarshal(buf, resp); err != nil {
2470 return err
2471 }
2472
2473 return nil
2474 }, opts...)
2475 if e != nil {
2476 return nil, e
2477 }
2478 return resp, nil
2479 }
2480
2481 // CreateCertificate creates a new Certificate in a given project and location.
2482 func (c *restClient) CreateCertificate(ctx context.Context, req *certificatemanagerpb.CreateCertificateRequest, opts ...gax.CallOption) (*CreateCertificateOperation, error) {
2483 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
2484 body := req.GetCertificate()
2485 jsonReq, err := m.Marshal(body)
2486 if err != nil {
2487 return nil, err
2488 }
2489
2490 baseUrl, err := url.Parse(c.endpoint)
2491 if err != nil {
2492 return nil, err
2493 }
2494 baseUrl.Path += fmt.Sprintf("/v1/%v/certificates", req.GetParent())
2495
2496 params := url.Values{}
2497 params.Add("$alt", "json;enum-encoding=int")
2498 params.Add("certificateId", fmt.Sprintf("%v", req.GetCertificateId()))
2499
2500 baseUrl.RawQuery = params.Encode()
2501
2502 // Build HTTP headers from client and context metadata.
2503 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
2504
2505 hds = append(c.xGoogHeaders, hds...)
2506 hds = append(hds, "Content-Type", "application/json")
2507 headers := gax.BuildHeaders(ctx, hds...)
2508 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
2509 resp := &longrunningpb.Operation{}
2510 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2511 if settings.Path != "" {
2512 baseUrl.Path = settings.Path
2513 }
2514 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
2515 if err != nil {
2516 return err
2517 }
2518 httpReq = httpReq.WithContext(ctx)
2519 httpReq.Header = headers
2520
2521 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreateCertificate")
2522 if err != nil {
2523 return err
2524 }
2525 if err := unm.Unmarshal(buf, resp); err != nil {
2526 return err
2527 }
2528
2529 return nil
2530 }, opts...)
2531 if e != nil {
2532 return nil, e
2533 }
2534
2535 override := fmt.Sprintf("/v1/%s", resp.GetName())
2536 return &CreateCertificateOperation{
2537 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
2538 pollPath: override,
2539 }, nil
2540 }
2541
2542 // UpdateCertificate updates a Certificate.
2543 func (c *restClient) UpdateCertificate(ctx context.Context, req *certificatemanagerpb.UpdateCertificateRequest, opts ...gax.CallOption) (*UpdateCertificateOperation, error) {
2544 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
2545 body := req.GetCertificate()
2546 jsonReq, err := m.Marshal(body)
2547 if err != nil {
2548 return nil, err
2549 }
2550
2551 baseUrl, err := url.Parse(c.endpoint)
2552 if err != nil {
2553 return nil, err
2554 }
2555 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetCertificate().GetName())
2556
2557 params := url.Values{}
2558 params.Add("$alt", "json;enum-encoding=int")
2559 if req.GetUpdateMask() != nil {
2560 field, err := protojson.Marshal(req.GetUpdateMask())
2561 if err != nil {
2562 return nil, err
2563 }
2564 params.Add("updateMask", string(field[1:len(field)-1]))
2565 }
2566
2567 baseUrl.RawQuery = params.Encode()
2568
2569 // Build HTTP headers from client and context metadata.
2570 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "certificate.name", url.QueryEscape(req.GetCertificate().GetName()))}
2571
2572 hds = append(c.xGoogHeaders, hds...)
2573 hds = append(hds, "Content-Type", "application/json")
2574 headers := gax.BuildHeaders(ctx, hds...)
2575 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
2576 resp := &longrunningpb.Operation{}
2577 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2578 if settings.Path != "" {
2579 baseUrl.Path = settings.Path
2580 }
2581 httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq))
2582 if err != nil {
2583 return err
2584 }
2585 httpReq = httpReq.WithContext(ctx)
2586 httpReq.Header = headers
2587
2588 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UpdateCertificate")
2589 if err != nil {
2590 return err
2591 }
2592 if err := unm.Unmarshal(buf, resp); err != nil {
2593 return err
2594 }
2595
2596 return nil
2597 }, opts...)
2598 if e != nil {
2599 return nil, e
2600 }
2601
2602 override := fmt.Sprintf("/v1/%s", resp.GetName())
2603 return &UpdateCertificateOperation{
2604 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
2605 pollPath: override,
2606 }, nil
2607 }
2608
2609 // DeleteCertificate deletes a single Certificate.
2610 func (c *restClient) DeleteCertificate(ctx context.Context, req *certificatemanagerpb.DeleteCertificateRequest, opts ...gax.CallOption) (*DeleteCertificateOperation, error) {
2611 baseUrl, err := url.Parse(c.endpoint)
2612 if err != nil {
2613 return nil, err
2614 }
2615 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
2616
2617 params := url.Values{}
2618 params.Add("$alt", "json;enum-encoding=int")
2619
2620 baseUrl.RawQuery = params.Encode()
2621
2622 // Build HTTP headers from client and context metadata.
2623 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2624
2625 hds = append(c.xGoogHeaders, hds...)
2626 hds = append(hds, "Content-Type", "application/json")
2627 headers := gax.BuildHeaders(ctx, hds...)
2628 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
2629 resp := &longrunningpb.Operation{}
2630 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2631 if settings.Path != "" {
2632 baseUrl.Path = settings.Path
2633 }
2634 httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil)
2635 if err != nil {
2636 return err
2637 }
2638 httpReq = httpReq.WithContext(ctx)
2639 httpReq.Header = headers
2640
2641 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteCertificate")
2642 if err != nil {
2643 return err
2644 }
2645 if err := unm.Unmarshal(buf, resp); err != nil {
2646 return err
2647 }
2648
2649 return nil
2650 }, opts...)
2651 if e != nil {
2652 return nil, e
2653 }
2654
2655 override := fmt.Sprintf("/v1/%s", resp.GetName())
2656 return &DeleteCertificateOperation{
2657 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
2658 pollPath: override,
2659 }, nil
2660 }
2661
2662 // ListCertificateMaps lists CertificateMaps in a given project and location.
2663 func (c *restClient) ListCertificateMaps(ctx context.Context, req *certificatemanagerpb.ListCertificateMapsRequest, opts ...gax.CallOption) *CertificateMapIterator {
2664 it := &CertificateMapIterator{}
2665 req = proto.Clone(req).(*certificatemanagerpb.ListCertificateMapsRequest)
2666 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
2667 it.InternalFetch = func(pageSize int, pageToken string) ([]*certificatemanagerpb.CertificateMap, string, error) {
2668 resp := &certificatemanagerpb.ListCertificateMapsResponse{}
2669 if pageToken != "" {
2670 req.PageToken = pageToken
2671 }
2672 if pageSize > math.MaxInt32 {
2673 req.PageSize = math.MaxInt32
2674 } else if pageSize != 0 {
2675 req.PageSize = int32(pageSize)
2676 }
2677 baseUrl, err := url.Parse(c.endpoint)
2678 if err != nil {
2679 return nil, "", err
2680 }
2681 baseUrl.Path += fmt.Sprintf("/v1/%v/certificateMaps", req.GetParent())
2682
2683 params := url.Values{}
2684 params.Add("$alt", "json;enum-encoding=int")
2685 if req.GetFilter() != "" {
2686 params.Add("filter", fmt.Sprintf("%v", req.GetFilter()))
2687 }
2688 if req.GetOrderBy() != "" {
2689 params.Add("orderBy", fmt.Sprintf("%v", req.GetOrderBy()))
2690 }
2691 if req.GetPageSize() != 0 {
2692 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
2693 }
2694 if req.GetPageToken() != "" {
2695 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
2696 }
2697
2698 baseUrl.RawQuery = params.Encode()
2699
2700 // Build HTTP headers from client and context metadata.
2701 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
2702 headers := gax.BuildHeaders(ctx, hds...)
2703 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2704 if settings.Path != "" {
2705 baseUrl.Path = settings.Path
2706 }
2707 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
2708 if err != nil {
2709 return err
2710 }
2711 httpReq.Header = headers
2712
2713 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListCertificateMaps")
2714 if err != nil {
2715 return err
2716 }
2717 if err := unm.Unmarshal(buf, resp); err != nil {
2718 return err
2719 }
2720
2721 return nil
2722 }, opts...)
2723 if e != nil {
2724 return nil, "", e
2725 }
2726 it.Response = resp
2727 return resp.GetCertificateMaps(), resp.GetNextPageToken(), nil
2728 }
2729
2730 fetch := func(pageSize int, pageToken string) (string, error) {
2731 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
2732 if err != nil {
2733 return "", err
2734 }
2735 it.items = append(it.items, items...)
2736 return nextPageToken, nil
2737 }
2738
2739 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
2740 it.pageInfo.MaxSize = int(req.GetPageSize())
2741 it.pageInfo.Token = req.GetPageToken()
2742
2743 return it
2744 }
2745
2746 // GetCertificateMap gets details of a single CertificateMap.
2747 func (c *restClient) GetCertificateMap(ctx context.Context, req *certificatemanagerpb.GetCertificateMapRequest, opts ...gax.CallOption) (*certificatemanagerpb.CertificateMap, error) {
2748 baseUrl, err := url.Parse(c.endpoint)
2749 if err != nil {
2750 return nil, err
2751 }
2752 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
2753
2754 params := url.Values{}
2755 params.Add("$alt", "json;enum-encoding=int")
2756
2757 baseUrl.RawQuery = params.Encode()
2758
2759 // Build HTTP headers from client and context metadata.
2760 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2761
2762 hds = append(c.xGoogHeaders, hds...)
2763 hds = append(hds, "Content-Type", "application/json")
2764 headers := gax.BuildHeaders(ctx, hds...)
2765 opts = append((*c.CallOptions).GetCertificateMap[0:len((*c.CallOptions).GetCertificateMap):len((*c.CallOptions).GetCertificateMap)], opts...)
2766 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
2767 resp := &certificatemanagerpb.CertificateMap{}
2768 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2769 if settings.Path != "" {
2770 baseUrl.Path = settings.Path
2771 }
2772 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
2773 if err != nil {
2774 return err
2775 }
2776 httpReq = httpReq.WithContext(ctx)
2777 httpReq.Header = headers
2778
2779 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetCertificateMap")
2780 if err != nil {
2781 return err
2782 }
2783
2784 if err := unm.Unmarshal(buf, resp); err != nil {
2785 return err
2786 }
2787
2788 return nil
2789 }, opts...)
2790 if e != nil {
2791 return nil, e
2792 }
2793 return resp, nil
2794 }
2795
2796 // CreateCertificateMap creates a new CertificateMap in a given project and location.
2797 func (c *restClient) CreateCertificateMap(ctx context.Context, req *certificatemanagerpb.CreateCertificateMapRequest, opts ...gax.CallOption) (*CreateCertificateMapOperation, error) {
2798 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
2799 body := req.GetCertificateMap()
2800 jsonReq, err := m.Marshal(body)
2801 if err != nil {
2802 return nil, err
2803 }
2804
2805 baseUrl, err := url.Parse(c.endpoint)
2806 if err != nil {
2807 return nil, err
2808 }
2809 baseUrl.Path += fmt.Sprintf("/v1/%v/certificateMaps", req.GetParent())
2810
2811 params := url.Values{}
2812 params.Add("$alt", "json;enum-encoding=int")
2813 params.Add("certificateMapId", fmt.Sprintf("%v", req.GetCertificateMapId()))
2814
2815 baseUrl.RawQuery = params.Encode()
2816
2817 // Build HTTP headers from client and context metadata.
2818 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
2819
2820 hds = append(c.xGoogHeaders, hds...)
2821 hds = append(hds, "Content-Type", "application/json")
2822 headers := gax.BuildHeaders(ctx, hds...)
2823 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
2824 resp := &longrunningpb.Operation{}
2825 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2826 if settings.Path != "" {
2827 baseUrl.Path = settings.Path
2828 }
2829 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
2830 if err != nil {
2831 return err
2832 }
2833 httpReq = httpReq.WithContext(ctx)
2834 httpReq.Header = headers
2835
2836 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreateCertificateMap")
2837 if err != nil {
2838 return err
2839 }
2840 if err := unm.Unmarshal(buf, resp); err != nil {
2841 return err
2842 }
2843
2844 return nil
2845 }, opts...)
2846 if e != nil {
2847 return nil, e
2848 }
2849
2850 override := fmt.Sprintf("/v1/%s", resp.GetName())
2851 return &CreateCertificateMapOperation{
2852 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
2853 pollPath: override,
2854 }, nil
2855 }
2856
2857 // UpdateCertificateMap updates a CertificateMap.
2858 func (c *restClient) UpdateCertificateMap(ctx context.Context, req *certificatemanagerpb.UpdateCertificateMapRequest, opts ...gax.CallOption) (*UpdateCertificateMapOperation, error) {
2859 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
2860 body := req.GetCertificateMap()
2861 jsonReq, err := m.Marshal(body)
2862 if err != nil {
2863 return nil, err
2864 }
2865
2866 baseUrl, err := url.Parse(c.endpoint)
2867 if err != nil {
2868 return nil, err
2869 }
2870 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetCertificateMap().GetName())
2871
2872 params := url.Values{}
2873 params.Add("$alt", "json;enum-encoding=int")
2874 if req.GetUpdateMask() != nil {
2875 field, err := protojson.Marshal(req.GetUpdateMask())
2876 if err != nil {
2877 return nil, err
2878 }
2879 params.Add("updateMask", string(field[1:len(field)-1]))
2880 }
2881
2882 baseUrl.RawQuery = params.Encode()
2883
2884 // Build HTTP headers from client and context metadata.
2885 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "certificate_map.name", url.QueryEscape(req.GetCertificateMap().GetName()))}
2886
2887 hds = append(c.xGoogHeaders, hds...)
2888 hds = append(hds, "Content-Type", "application/json")
2889 headers := gax.BuildHeaders(ctx, hds...)
2890 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
2891 resp := &longrunningpb.Operation{}
2892 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2893 if settings.Path != "" {
2894 baseUrl.Path = settings.Path
2895 }
2896 httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq))
2897 if err != nil {
2898 return err
2899 }
2900 httpReq = httpReq.WithContext(ctx)
2901 httpReq.Header = headers
2902
2903 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UpdateCertificateMap")
2904 if err != nil {
2905 return err
2906 }
2907 if err := unm.Unmarshal(buf, resp); err != nil {
2908 return err
2909 }
2910
2911 return nil
2912 }, opts...)
2913 if e != nil {
2914 return nil, e
2915 }
2916
2917 override := fmt.Sprintf("/v1/%s", resp.GetName())
2918 return &UpdateCertificateMapOperation{
2919 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
2920 pollPath: override,
2921 }, nil
2922 }
2923
2924 // DeleteCertificateMap deletes a single CertificateMap. A Certificate Map can’t be deleted
2925 // if it contains Certificate Map Entries. Remove all the entries from
2926 // the map before calling this method.
2927 func (c *restClient) DeleteCertificateMap(ctx context.Context, req *certificatemanagerpb.DeleteCertificateMapRequest, opts ...gax.CallOption) (*DeleteCertificateMapOperation, error) {
2928 baseUrl, err := url.Parse(c.endpoint)
2929 if err != nil {
2930 return nil, err
2931 }
2932 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
2933
2934 params := url.Values{}
2935 params.Add("$alt", "json;enum-encoding=int")
2936
2937 baseUrl.RawQuery = params.Encode()
2938
2939 // Build HTTP headers from client and context metadata.
2940 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2941
2942 hds = append(c.xGoogHeaders, hds...)
2943 hds = append(hds, "Content-Type", "application/json")
2944 headers := gax.BuildHeaders(ctx, hds...)
2945 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
2946 resp := &longrunningpb.Operation{}
2947 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2948 if settings.Path != "" {
2949 baseUrl.Path = settings.Path
2950 }
2951 httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil)
2952 if err != nil {
2953 return err
2954 }
2955 httpReq = httpReq.WithContext(ctx)
2956 httpReq.Header = headers
2957
2958 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteCertificateMap")
2959 if err != nil {
2960 return err
2961 }
2962 if err := unm.Unmarshal(buf, resp); err != nil {
2963 return err
2964 }
2965
2966 return nil
2967 }, opts...)
2968 if e != nil {
2969 return nil, e
2970 }
2971
2972 override := fmt.Sprintf("/v1/%s", resp.GetName())
2973 return &DeleteCertificateMapOperation{
2974 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
2975 pollPath: override,
2976 }, nil
2977 }
2978
2979 // ListCertificateMapEntries lists CertificateMapEntries in a given project and location.
2980 func (c *restClient) ListCertificateMapEntries(ctx context.Context, req *certificatemanagerpb.ListCertificateMapEntriesRequest, opts ...gax.CallOption) *CertificateMapEntryIterator {
2981 it := &CertificateMapEntryIterator{}
2982 req = proto.Clone(req).(*certificatemanagerpb.ListCertificateMapEntriesRequest)
2983 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
2984 it.InternalFetch = func(pageSize int, pageToken string) ([]*certificatemanagerpb.CertificateMapEntry, string, error) {
2985 resp := &certificatemanagerpb.ListCertificateMapEntriesResponse{}
2986 if pageToken != "" {
2987 req.PageToken = pageToken
2988 }
2989 if pageSize > math.MaxInt32 {
2990 req.PageSize = math.MaxInt32
2991 } else if pageSize != 0 {
2992 req.PageSize = int32(pageSize)
2993 }
2994 baseUrl, err := url.Parse(c.endpoint)
2995 if err != nil {
2996 return nil, "", err
2997 }
2998 baseUrl.Path += fmt.Sprintf("/v1/%v/certificateMapEntries", req.GetParent())
2999
3000 params := url.Values{}
3001 params.Add("$alt", "json;enum-encoding=int")
3002 if req.GetFilter() != "" {
3003 params.Add("filter", fmt.Sprintf("%v", req.GetFilter()))
3004 }
3005 if req.GetOrderBy() != "" {
3006 params.Add("orderBy", fmt.Sprintf("%v", req.GetOrderBy()))
3007 }
3008 if req.GetPageSize() != 0 {
3009 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
3010 }
3011 if req.GetPageToken() != "" {
3012 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
3013 }
3014
3015 baseUrl.RawQuery = params.Encode()
3016
3017 // Build HTTP headers from client and context metadata.
3018 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
3019 headers := gax.BuildHeaders(ctx, hds...)
3020 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3021 if settings.Path != "" {
3022 baseUrl.Path = settings.Path
3023 }
3024 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
3025 if err != nil {
3026 return err
3027 }
3028 httpReq.Header = headers
3029
3030 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListCertificateMapEntries")
3031 if err != nil {
3032 return err
3033 }
3034 if err := unm.Unmarshal(buf, resp); err != nil {
3035 return err
3036 }
3037
3038 return nil
3039 }, opts...)
3040 if e != nil {
3041 return nil, "", e
3042 }
3043 it.Response = resp
3044 return resp.GetCertificateMapEntries(), resp.GetNextPageToken(), nil
3045 }
3046
3047 fetch := func(pageSize int, pageToken string) (string, error) {
3048 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
3049 if err != nil {
3050 return "", err
3051 }
3052 it.items = append(it.items, items...)
3053 return nextPageToken, nil
3054 }
3055
3056 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
3057 it.pageInfo.MaxSize = int(req.GetPageSize())
3058 it.pageInfo.Token = req.GetPageToken()
3059
3060 return it
3061 }
3062
3063 // GetCertificateMapEntry gets details of a single CertificateMapEntry.
3064 func (c *restClient) GetCertificateMapEntry(ctx context.Context, req *certificatemanagerpb.GetCertificateMapEntryRequest, opts ...gax.CallOption) (*certificatemanagerpb.CertificateMapEntry, error) {
3065 baseUrl, err := url.Parse(c.endpoint)
3066 if err != nil {
3067 return nil, err
3068 }
3069 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
3070
3071 params := url.Values{}
3072 params.Add("$alt", "json;enum-encoding=int")
3073
3074 baseUrl.RawQuery = params.Encode()
3075
3076 // Build HTTP headers from client and context metadata.
3077 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3078
3079 hds = append(c.xGoogHeaders, hds...)
3080 hds = append(hds, "Content-Type", "application/json")
3081 headers := gax.BuildHeaders(ctx, hds...)
3082 opts = append((*c.CallOptions).GetCertificateMapEntry[0:len((*c.CallOptions).GetCertificateMapEntry):len((*c.CallOptions).GetCertificateMapEntry)], opts...)
3083 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3084 resp := &certificatemanagerpb.CertificateMapEntry{}
3085 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3086 if settings.Path != "" {
3087 baseUrl.Path = settings.Path
3088 }
3089 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
3090 if err != nil {
3091 return err
3092 }
3093 httpReq = httpReq.WithContext(ctx)
3094 httpReq.Header = headers
3095
3096 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetCertificateMapEntry")
3097 if err != nil {
3098 return err
3099 }
3100
3101 if err := unm.Unmarshal(buf, resp); err != nil {
3102 return err
3103 }
3104
3105 return nil
3106 }, opts...)
3107 if e != nil {
3108 return nil, e
3109 }
3110 return resp, nil
3111 }
3112
3113 // CreateCertificateMapEntry creates a new CertificateMapEntry in a given project and location.
3114 func (c *restClient) CreateCertificateMapEntry(ctx context.Context, req *certificatemanagerpb.CreateCertificateMapEntryRequest, opts ...gax.CallOption) (*CreateCertificateMapEntryOperation, error) {
3115 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
3116 body := req.GetCertificateMapEntry()
3117 jsonReq, err := m.Marshal(body)
3118 if err != nil {
3119 return nil, err
3120 }
3121
3122 baseUrl, err := url.Parse(c.endpoint)
3123 if err != nil {
3124 return nil, err
3125 }
3126 baseUrl.Path += fmt.Sprintf("/v1/%v/certificateMapEntries", req.GetParent())
3127
3128 params := url.Values{}
3129 params.Add("$alt", "json;enum-encoding=int")
3130 params.Add("certificateMapEntryId", fmt.Sprintf("%v", req.GetCertificateMapEntryId()))
3131
3132 baseUrl.RawQuery = params.Encode()
3133
3134 // Build HTTP headers from client and context metadata.
3135 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
3136
3137 hds = append(c.xGoogHeaders, hds...)
3138 hds = append(hds, "Content-Type", "application/json")
3139 headers := gax.BuildHeaders(ctx, hds...)
3140 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3141 resp := &longrunningpb.Operation{}
3142 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3143 if settings.Path != "" {
3144 baseUrl.Path = settings.Path
3145 }
3146 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
3147 if err != nil {
3148 return err
3149 }
3150 httpReq = httpReq.WithContext(ctx)
3151 httpReq.Header = headers
3152
3153 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreateCertificateMapEntry")
3154 if err != nil {
3155 return err
3156 }
3157 if err := unm.Unmarshal(buf, resp); err != nil {
3158 return err
3159 }
3160
3161 return nil
3162 }, opts...)
3163 if e != nil {
3164 return nil, e
3165 }
3166
3167 override := fmt.Sprintf("/v1/%s", resp.GetName())
3168 return &CreateCertificateMapEntryOperation{
3169 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
3170 pollPath: override,
3171 }, nil
3172 }
3173
3174 // UpdateCertificateMapEntry updates a CertificateMapEntry.
3175 func (c *restClient) UpdateCertificateMapEntry(ctx context.Context, req *certificatemanagerpb.UpdateCertificateMapEntryRequest, opts ...gax.CallOption) (*UpdateCertificateMapEntryOperation, error) {
3176 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
3177 body := req.GetCertificateMapEntry()
3178 jsonReq, err := m.Marshal(body)
3179 if err != nil {
3180 return nil, err
3181 }
3182
3183 baseUrl, err := url.Parse(c.endpoint)
3184 if err != nil {
3185 return nil, err
3186 }
3187 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetCertificateMapEntry().GetName())
3188
3189 params := url.Values{}
3190 params.Add("$alt", "json;enum-encoding=int")
3191 if req.GetUpdateMask() != nil {
3192 field, err := protojson.Marshal(req.GetUpdateMask())
3193 if err != nil {
3194 return nil, err
3195 }
3196 params.Add("updateMask", string(field[1:len(field)-1]))
3197 }
3198
3199 baseUrl.RawQuery = params.Encode()
3200
3201 // Build HTTP headers from client and context metadata.
3202 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "certificate_map_entry.name", url.QueryEscape(req.GetCertificateMapEntry().GetName()))}
3203
3204 hds = append(c.xGoogHeaders, hds...)
3205 hds = append(hds, "Content-Type", "application/json")
3206 headers := gax.BuildHeaders(ctx, hds...)
3207 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3208 resp := &longrunningpb.Operation{}
3209 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3210 if settings.Path != "" {
3211 baseUrl.Path = settings.Path
3212 }
3213 httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq))
3214 if err != nil {
3215 return err
3216 }
3217 httpReq = httpReq.WithContext(ctx)
3218 httpReq.Header = headers
3219
3220 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UpdateCertificateMapEntry")
3221 if err != nil {
3222 return err
3223 }
3224 if err := unm.Unmarshal(buf, resp); err != nil {
3225 return err
3226 }
3227
3228 return nil
3229 }, opts...)
3230 if e != nil {
3231 return nil, e
3232 }
3233
3234 override := fmt.Sprintf("/v1/%s", resp.GetName())
3235 return &UpdateCertificateMapEntryOperation{
3236 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
3237 pollPath: override,
3238 }, nil
3239 }
3240
3241 // DeleteCertificateMapEntry deletes a single CertificateMapEntry.
3242 func (c *restClient) DeleteCertificateMapEntry(ctx context.Context, req *certificatemanagerpb.DeleteCertificateMapEntryRequest, opts ...gax.CallOption) (*DeleteCertificateMapEntryOperation, error) {
3243 baseUrl, err := url.Parse(c.endpoint)
3244 if err != nil {
3245 return nil, err
3246 }
3247 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
3248
3249 params := url.Values{}
3250 params.Add("$alt", "json;enum-encoding=int")
3251
3252 baseUrl.RawQuery = params.Encode()
3253
3254 // Build HTTP headers from client and context metadata.
3255 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3256
3257 hds = append(c.xGoogHeaders, hds...)
3258 hds = append(hds, "Content-Type", "application/json")
3259 headers := gax.BuildHeaders(ctx, hds...)
3260 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3261 resp := &longrunningpb.Operation{}
3262 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3263 if settings.Path != "" {
3264 baseUrl.Path = settings.Path
3265 }
3266 httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil)
3267 if err != nil {
3268 return err
3269 }
3270 httpReq = httpReq.WithContext(ctx)
3271 httpReq.Header = headers
3272
3273 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteCertificateMapEntry")
3274 if err != nil {
3275 return err
3276 }
3277 if err := unm.Unmarshal(buf, resp); err != nil {
3278 return err
3279 }
3280
3281 return nil
3282 }, opts...)
3283 if e != nil {
3284 return nil, e
3285 }
3286
3287 override := fmt.Sprintf("/v1/%s", resp.GetName())
3288 return &DeleteCertificateMapEntryOperation{
3289 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
3290 pollPath: override,
3291 }, nil
3292 }
3293
3294 // ListDnsAuthorizations lists DnsAuthorizations in a given project and location.
3295 func (c *restClient) ListDnsAuthorizations(ctx context.Context, req *certificatemanagerpb.ListDnsAuthorizationsRequest, opts ...gax.CallOption) *DnsAuthorizationIterator {
3296 it := &DnsAuthorizationIterator{}
3297 req = proto.Clone(req).(*certificatemanagerpb.ListDnsAuthorizationsRequest)
3298 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3299 it.InternalFetch = func(pageSize int, pageToken string) ([]*certificatemanagerpb.DnsAuthorization, string, error) {
3300 resp := &certificatemanagerpb.ListDnsAuthorizationsResponse{}
3301 if pageToken != "" {
3302 req.PageToken = pageToken
3303 }
3304 if pageSize > math.MaxInt32 {
3305 req.PageSize = math.MaxInt32
3306 } else if pageSize != 0 {
3307 req.PageSize = int32(pageSize)
3308 }
3309 baseUrl, err := url.Parse(c.endpoint)
3310 if err != nil {
3311 return nil, "", err
3312 }
3313 baseUrl.Path += fmt.Sprintf("/v1/%v/dnsAuthorizations", req.GetParent())
3314
3315 params := url.Values{}
3316 params.Add("$alt", "json;enum-encoding=int")
3317 if req.GetFilter() != "" {
3318 params.Add("filter", fmt.Sprintf("%v", req.GetFilter()))
3319 }
3320 if req.GetOrderBy() != "" {
3321 params.Add("orderBy", fmt.Sprintf("%v", req.GetOrderBy()))
3322 }
3323 if req.GetPageSize() != 0 {
3324 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
3325 }
3326 if req.GetPageToken() != "" {
3327 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
3328 }
3329
3330 baseUrl.RawQuery = params.Encode()
3331
3332 // Build HTTP headers from client and context metadata.
3333 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
3334 headers := gax.BuildHeaders(ctx, hds...)
3335 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3336 if settings.Path != "" {
3337 baseUrl.Path = settings.Path
3338 }
3339 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
3340 if err != nil {
3341 return err
3342 }
3343 httpReq.Header = headers
3344
3345 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListDnsAuthorizations")
3346 if err != nil {
3347 return err
3348 }
3349 if err := unm.Unmarshal(buf, resp); err != nil {
3350 return err
3351 }
3352
3353 return nil
3354 }, opts...)
3355 if e != nil {
3356 return nil, "", e
3357 }
3358 it.Response = resp
3359 return resp.GetDnsAuthorizations(), resp.GetNextPageToken(), nil
3360 }
3361
3362 fetch := func(pageSize int, pageToken string) (string, error) {
3363 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
3364 if err != nil {
3365 return "", err
3366 }
3367 it.items = append(it.items, items...)
3368 return nextPageToken, nil
3369 }
3370
3371 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
3372 it.pageInfo.MaxSize = int(req.GetPageSize())
3373 it.pageInfo.Token = req.GetPageToken()
3374
3375 return it
3376 }
3377
3378 // GetDnsAuthorization gets details of a single DnsAuthorization.
3379 func (c *restClient) GetDnsAuthorization(ctx context.Context, req *certificatemanagerpb.GetDnsAuthorizationRequest, opts ...gax.CallOption) (*certificatemanagerpb.DnsAuthorization, error) {
3380 baseUrl, err := url.Parse(c.endpoint)
3381 if err != nil {
3382 return nil, err
3383 }
3384 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
3385
3386 params := url.Values{}
3387 params.Add("$alt", "json;enum-encoding=int")
3388
3389 baseUrl.RawQuery = params.Encode()
3390
3391 // Build HTTP headers from client and context metadata.
3392 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3393
3394 hds = append(c.xGoogHeaders, hds...)
3395 hds = append(hds, "Content-Type", "application/json")
3396 headers := gax.BuildHeaders(ctx, hds...)
3397 opts = append((*c.CallOptions).GetDnsAuthorization[0:len((*c.CallOptions).GetDnsAuthorization):len((*c.CallOptions).GetDnsAuthorization)], opts...)
3398 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3399 resp := &certificatemanagerpb.DnsAuthorization{}
3400 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3401 if settings.Path != "" {
3402 baseUrl.Path = settings.Path
3403 }
3404 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
3405 if err != nil {
3406 return err
3407 }
3408 httpReq = httpReq.WithContext(ctx)
3409 httpReq.Header = headers
3410
3411 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetDnsAuthorization")
3412 if err != nil {
3413 return err
3414 }
3415
3416 if err := unm.Unmarshal(buf, resp); err != nil {
3417 return err
3418 }
3419
3420 return nil
3421 }, opts...)
3422 if e != nil {
3423 return nil, e
3424 }
3425 return resp, nil
3426 }
3427
3428 // CreateDnsAuthorization creates a new DnsAuthorization in a given project and location.
3429 func (c *restClient) CreateDnsAuthorization(ctx context.Context, req *certificatemanagerpb.CreateDnsAuthorizationRequest, opts ...gax.CallOption) (*CreateDnsAuthorizationOperation, error) {
3430 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
3431 body := req.GetDnsAuthorization()
3432 jsonReq, err := m.Marshal(body)
3433 if err != nil {
3434 return nil, err
3435 }
3436
3437 baseUrl, err := url.Parse(c.endpoint)
3438 if err != nil {
3439 return nil, err
3440 }
3441 baseUrl.Path += fmt.Sprintf("/v1/%v/dnsAuthorizations", req.GetParent())
3442
3443 params := url.Values{}
3444 params.Add("$alt", "json;enum-encoding=int")
3445 params.Add("dnsAuthorizationId", fmt.Sprintf("%v", req.GetDnsAuthorizationId()))
3446
3447 baseUrl.RawQuery = params.Encode()
3448
3449 // Build HTTP headers from client and context metadata.
3450 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
3451
3452 hds = append(c.xGoogHeaders, hds...)
3453 hds = append(hds, "Content-Type", "application/json")
3454 headers := gax.BuildHeaders(ctx, hds...)
3455 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3456 resp := &longrunningpb.Operation{}
3457 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3458 if settings.Path != "" {
3459 baseUrl.Path = settings.Path
3460 }
3461 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
3462 if err != nil {
3463 return err
3464 }
3465 httpReq = httpReq.WithContext(ctx)
3466 httpReq.Header = headers
3467
3468 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreateDnsAuthorization")
3469 if err != nil {
3470 return err
3471 }
3472 if err := unm.Unmarshal(buf, resp); err != nil {
3473 return err
3474 }
3475
3476 return nil
3477 }, opts...)
3478 if e != nil {
3479 return nil, e
3480 }
3481
3482 override := fmt.Sprintf("/v1/%s", resp.GetName())
3483 return &CreateDnsAuthorizationOperation{
3484 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
3485 pollPath: override,
3486 }, nil
3487 }
3488
3489 // UpdateDnsAuthorization updates a DnsAuthorization.
3490 func (c *restClient) UpdateDnsAuthorization(ctx context.Context, req *certificatemanagerpb.UpdateDnsAuthorizationRequest, opts ...gax.CallOption) (*UpdateDnsAuthorizationOperation, error) {
3491 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
3492 body := req.GetDnsAuthorization()
3493 jsonReq, err := m.Marshal(body)
3494 if err != nil {
3495 return nil, err
3496 }
3497
3498 baseUrl, err := url.Parse(c.endpoint)
3499 if err != nil {
3500 return nil, err
3501 }
3502 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetDnsAuthorization().GetName())
3503
3504 params := url.Values{}
3505 params.Add("$alt", "json;enum-encoding=int")
3506 if req.GetUpdateMask() != nil {
3507 field, err := protojson.Marshal(req.GetUpdateMask())
3508 if err != nil {
3509 return nil, err
3510 }
3511 params.Add("updateMask", string(field[1:len(field)-1]))
3512 }
3513
3514 baseUrl.RawQuery = params.Encode()
3515
3516 // Build HTTP headers from client and context metadata.
3517 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "dns_authorization.name", url.QueryEscape(req.GetDnsAuthorization().GetName()))}
3518
3519 hds = append(c.xGoogHeaders, hds...)
3520 hds = append(hds, "Content-Type", "application/json")
3521 headers := gax.BuildHeaders(ctx, hds...)
3522 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3523 resp := &longrunningpb.Operation{}
3524 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3525 if settings.Path != "" {
3526 baseUrl.Path = settings.Path
3527 }
3528 httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq))
3529 if err != nil {
3530 return err
3531 }
3532 httpReq = httpReq.WithContext(ctx)
3533 httpReq.Header = headers
3534
3535 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UpdateDnsAuthorization")
3536 if err != nil {
3537 return err
3538 }
3539 if err := unm.Unmarshal(buf, resp); err != nil {
3540 return err
3541 }
3542
3543 return nil
3544 }, opts...)
3545 if e != nil {
3546 return nil, e
3547 }
3548
3549 override := fmt.Sprintf("/v1/%s", resp.GetName())
3550 return &UpdateDnsAuthorizationOperation{
3551 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
3552 pollPath: override,
3553 }, nil
3554 }
3555
3556 // DeleteDnsAuthorization deletes a single DnsAuthorization.
3557 func (c *restClient) DeleteDnsAuthorization(ctx context.Context, req *certificatemanagerpb.DeleteDnsAuthorizationRequest, opts ...gax.CallOption) (*DeleteDnsAuthorizationOperation, error) {
3558 baseUrl, err := url.Parse(c.endpoint)
3559 if err != nil {
3560 return nil, err
3561 }
3562 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
3563
3564 params := url.Values{}
3565 params.Add("$alt", "json;enum-encoding=int")
3566
3567 baseUrl.RawQuery = params.Encode()
3568
3569 // Build HTTP headers from client and context metadata.
3570 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3571
3572 hds = append(c.xGoogHeaders, hds...)
3573 hds = append(hds, "Content-Type", "application/json")
3574 headers := gax.BuildHeaders(ctx, hds...)
3575 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3576 resp := &longrunningpb.Operation{}
3577 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3578 if settings.Path != "" {
3579 baseUrl.Path = settings.Path
3580 }
3581 httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil)
3582 if err != nil {
3583 return err
3584 }
3585 httpReq = httpReq.WithContext(ctx)
3586 httpReq.Header = headers
3587
3588 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteDnsAuthorization")
3589 if err != nil {
3590 return err
3591 }
3592 if err := unm.Unmarshal(buf, resp); err != nil {
3593 return err
3594 }
3595
3596 return nil
3597 }, opts...)
3598 if e != nil {
3599 return nil, e
3600 }
3601
3602 override := fmt.Sprintf("/v1/%s", resp.GetName())
3603 return &DeleteDnsAuthorizationOperation{
3604 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
3605 pollPath: override,
3606 }, nil
3607 }
3608
3609 // ListCertificateIssuanceConfigs lists CertificateIssuanceConfigs in a given project and location.
3610 func (c *restClient) ListCertificateIssuanceConfigs(ctx context.Context, req *certificatemanagerpb.ListCertificateIssuanceConfigsRequest, opts ...gax.CallOption) *CertificateIssuanceConfigIterator {
3611 it := &CertificateIssuanceConfigIterator{}
3612 req = proto.Clone(req).(*certificatemanagerpb.ListCertificateIssuanceConfigsRequest)
3613 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3614 it.InternalFetch = func(pageSize int, pageToken string) ([]*certificatemanagerpb.CertificateIssuanceConfig, string, error) {
3615 resp := &certificatemanagerpb.ListCertificateIssuanceConfigsResponse{}
3616 if pageToken != "" {
3617 req.PageToken = pageToken
3618 }
3619 if pageSize > math.MaxInt32 {
3620 req.PageSize = math.MaxInt32
3621 } else if pageSize != 0 {
3622 req.PageSize = int32(pageSize)
3623 }
3624 baseUrl, err := url.Parse(c.endpoint)
3625 if err != nil {
3626 return nil, "", err
3627 }
3628 baseUrl.Path += fmt.Sprintf("/v1/%v/certificateIssuanceConfigs", req.GetParent())
3629
3630 params := url.Values{}
3631 params.Add("$alt", "json;enum-encoding=int")
3632 if req.GetFilter() != "" {
3633 params.Add("filter", fmt.Sprintf("%v", req.GetFilter()))
3634 }
3635 if req.GetOrderBy() != "" {
3636 params.Add("orderBy", fmt.Sprintf("%v", req.GetOrderBy()))
3637 }
3638 if req.GetPageSize() != 0 {
3639 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
3640 }
3641 if req.GetPageToken() != "" {
3642 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
3643 }
3644
3645 baseUrl.RawQuery = params.Encode()
3646
3647 // Build HTTP headers from client and context metadata.
3648 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
3649 headers := gax.BuildHeaders(ctx, hds...)
3650 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3651 if settings.Path != "" {
3652 baseUrl.Path = settings.Path
3653 }
3654 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
3655 if err != nil {
3656 return err
3657 }
3658 httpReq.Header = headers
3659
3660 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListCertificateIssuanceConfigs")
3661 if err != nil {
3662 return err
3663 }
3664 if err := unm.Unmarshal(buf, resp); err != nil {
3665 return err
3666 }
3667
3668 return nil
3669 }, opts...)
3670 if e != nil {
3671 return nil, "", e
3672 }
3673 it.Response = resp
3674 return resp.GetCertificateIssuanceConfigs(), resp.GetNextPageToken(), nil
3675 }
3676
3677 fetch := func(pageSize int, pageToken string) (string, error) {
3678 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
3679 if err != nil {
3680 return "", err
3681 }
3682 it.items = append(it.items, items...)
3683 return nextPageToken, nil
3684 }
3685
3686 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
3687 it.pageInfo.MaxSize = int(req.GetPageSize())
3688 it.pageInfo.Token = req.GetPageToken()
3689
3690 return it
3691 }
3692
3693 // GetCertificateIssuanceConfig gets details of a single CertificateIssuanceConfig.
3694 func (c *restClient) GetCertificateIssuanceConfig(ctx context.Context, req *certificatemanagerpb.GetCertificateIssuanceConfigRequest, opts ...gax.CallOption) (*certificatemanagerpb.CertificateIssuanceConfig, error) {
3695 baseUrl, err := url.Parse(c.endpoint)
3696 if err != nil {
3697 return nil, err
3698 }
3699 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
3700
3701 params := url.Values{}
3702 params.Add("$alt", "json;enum-encoding=int")
3703
3704 baseUrl.RawQuery = params.Encode()
3705
3706 // Build HTTP headers from client and context metadata.
3707 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3708
3709 hds = append(c.xGoogHeaders, hds...)
3710 hds = append(hds, "Content-Type", "application/json")
3711 headers := gax.BuildHeaders(ctx, hds...)
3712 opts = append((*c.CallOptions).GetCertificateIssuanceConfig[0:len((*c.CallOptions).GetCertificateIssuanceConfig):len((*c.CallOptions).GetCertificateIssuanceConfig)], opts...)
3713 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3714 resp := &certificatemanagerpb.CertificateIssuanceConfig{}
3715 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3716 if settings.Path != "" {
3717 baseUrl.Path = settings.Path
3718 }
3719 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
3720 if err != nil {
3721 return err
3722 }
3723 httpReq = httpReq.WithContext(ctx)
3724 httpReq.Header = headers
3725
3726 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetCertificateIssuanceConfig")
3727 if err != nil {
3728 return err
3729 }
3730
3731 if err := unm.Unmarshal(buf, resp); err != nil {
3732 return err
3733 }
3734
3735 return nil
3736 }, opts...)
3737 if e != nil {
3738 return nil, e
3739 }
3740 return resp, nil
3741 }
3742
3743 // CreateCertificateIssuanceConfig creates a new CertificateIssuanceConfig in a given project and location.
3744 func (c *restClient) CreateCertificateIssuanceConfig(ctx context.Context, req *certificatemanagerpb.CreateCertificateIssuanceConfigRequest, opts ...gax.CallOption) (*CreateCertificateIssuanceConfigOperation, error) {
3745 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
3746 body := req.GetCertificateIssuanceConfig()
3747 jsonReq, err := m.Marshal(body)
3748 if err != nil {
3749 return nil, err
3750 }
3751
3752 baseUrl, err := url.Parse(c.endpoint)
3753 if err != nil {
3754 return nil, err
3755 }
3756 baseUrl.Path += fmt.Sprintf("/v1/%v/certificateIssuanceConfigs", req.GetParent())
3757
3758 params := url.Values{}
3759 params.Add("$alt", "json;enum-encoding=int")
3760 params.Add("certificateIssuanceConfigId", fmt.Sprintf("%v", req.GetCertificateIssuanceConfigId()))
3761
3762 baseUrl.RawQuery = params.Encode()
3763
3764 // Build HTTP headers from client and context metadata.
3765 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
3766
3767 hds = append(c.xGoogHeaders, hds...)
3768 hds = append(hds, "Content-Type", "application/json")
3769 headers := gax.BuildHeaders(ctx, hds...)
3770 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3771 resp := &longrunningpb.Operation{}
3772 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3773 if settings.Path != "" {
3774 baseUrl.Path = settings.Path
3775 }
3776 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
3777 if err != nil {
3778 return err
3779 }
3780 httpReq = httpReq.WithContext(ctx)
3781 httpReq.Header = headers
3782
3783 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreateCertificateIssuanceConfig")
3784 if err != nil {
3785 return err
3786 }
3787 if err := unm.Unmarshal(buf, resp); err != nil {
3788 return err
3789 }
3790
3791 return nil
3792 }, opts...)
3793 if e != nil {
3794 return nil, e
3795 }
3796
3797 override := fmt.Sprintf("/v1/%s", resp.GetName())
3798 return &CreateCertificateIssuanceConfigOperation{
3799 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
3800 pollPath: override,
3801 }, nil
3802 }
3803
3804 // DeleteCertificateIssuanceConfig deletes a single CertificateIssuanceConfig.
3805 func (c *restClient) DeleteCertificateIssuanceConfig(ctx context.Context, req *certificatemanagerpb.DeleteCertificateIssuanceConfigRequest, opts ...gax.CallOption) (*DeleteCertificateIssuanceConfigOperation, error) {
3806 baseUrl, err := url.Parse(c.endpoint)
3807 if err != nil {
3808 return nil, err
3809 }
3810 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
3811
3812 params := url.Values{}
3813 params.Add("$alt", "json;enum-encoding=int")
3814
3815 baseUrl.RawQuery = params.Encode()
3816
3817 // Build HTTP headers from client and context metadata.
3818 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3819
3820 hds = append(c.xGoogHeaders, hds...)
3821 hds = append(hds, "Content-Type", "application/json")
3822 headers := gax.BuildHeaders(ctx, hds...)
3823 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3824 resp := &longrunningpb.Operation{}
3825 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3826 if settings.Path != "" {
3827 baseUrl.Path = settings.Path
3828 }
3829 httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil)
3830 if err != nil {
3831 return err
3832 }
3833 httpReq = httpReq.WithContext(ctx)
3834 httpReq.Header = headers
3835
3836 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteCertificateIssuanceConfig")
3837 if err != nil {
3838 return err
3839 }
3840 if err := unm.Unmarshal(buf, resp); err != nil {
3841 return err
3842 }
3843
3844 return nil
3845 }, opts...)
3846 if e != nil {
3847 return nil, e
3848 }
3849
3850 override := fmt.Sprintf("/v1/%s", resp.GetName())
3851 return &DeleteCertificateIssuanceConfigOperation{
3852 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
3853 pollPath: override,
3854 }, nil
3855 }
3856
3857 // ListTrustConfigs lists TrustConfigs in a given project and location.
3858 func (c *restClient) ListTrustConfigs(ctx context.Context, req *certificatemanagerpb.ListTrustConfigsRequest, opts ...gax.CallOption) *TrustConfigIterator {
3859 it := &TrustConfigIterator{}
3860 req = proto.Clone(req).(*certificatemanagerpb.ListTrustConfigsRequest)
3861 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3862 it.InternalFetch = func(pageSize int, pageToken string) ([]*certificatemanagerpb.TrustConfig, string, error) {
3863 resp := &certificatemanagerpb.ListTrustConfigsResponse{}
3864 if pageToken != "" {
3865 req.PageToken = pageToken
3866 }
3867 if pageSize > math.MaxInt32 {
3868 req.PageSize = math.MaxInt32
3869 } else if pageSize != 0 {
3870 req.PageSize = int32(pageSize)
3871 }
3872 baseUrl, err := url.Parse(c.endpoint)
3873 if err != nil {
3874 return nil, "", err
3875 }
3876 baseUrl.Path += fmt.Sprintf("/v1/%v/trustConfigs", req.GetParent())
3877
3878 params := url.Values{}
3879 params.Add("$alt", "json;enum-encoding=int")
3880 if req.GetFilter() != "" {
3881 params.Add("filter", fmt.Sprintf("%v", req.GetFilter()))
3882 }
3883 if req.GetOrderBy() != "" {
3884 params.Add("orderBy", fmt.Sprintf("%v", req.GetOrderBy()))
3885 }
3886 if req.GetPageSize() != 0 {
3887 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
3888 }
3889 if req.GetPageToken() != "" {
3890 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
3891 }
3892
3893 baseUrl.RawQuery = params.Encode()
3894
3895 // Build HTTP headers from client and context metadata.
3896 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
3897 headers := gax.BuildHeaders(ctx, hds...)
3898 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3899 if settings.Path != "" {
3900 baseUrl.Path = settings.Path
3901 }
3902 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
3903 if err != nil {
3904 return err
3905 }
3906 httpReq.Header = headers
3907
3908 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListTrustConfigs")
3909 if err != nil {
3910 return err
3911 }
3912 if err := unm.Unmarshal(buf, resp); err != nil {
3913 return err
3914 }
3915
3916 return nil
3917 }, opts...)
3918 if e != nil {
3919 return nil, "", e
3920 }
3921 it.Response = resp
3922 return resp.GetTrustConfigs(), resp.GetNextPageToken(), nil
3923 }
3924
3925 fetch := func(pageSize int, pageToken string) (string, error) {
3926 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
3927 if err != nil {
3928 return "", err
3929 }
3930 it.items = append(it.items, items...)
3931 return nextPageToken, nil
3932 }
3933
3934 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
3935 it.pageInfo.MaxSize = int(req.GetPageSize())
3936 it.pageInfo.Token = req.GetPageToken()
3937
3938 return it
3939 }
3940
3941 // GetTrustConfig gets details of a single TrustConfig.
3942 func (c *restClient) GetTrustConfig(ctx context.Context, req *certificatemanagerpb.GetTrustConfigRequest, opts ...gax.CallOption) (*certificatemanagerpb.TrustConfig, error) {
3943 baseUrl, err := url.Parse(c.endpoint)
3944 if err != nil {
3945 return nil, err
3946 }
3947 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
3948
3949 params := url.Values{}
3950 params.Add("$alt", "json;enum-encoding=int")
3951
3952 baseUrl.RawQuery = params.Encode()
3953
3954 // Build HTTP headers from client and context metadata.
3955 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3956
3957 hds = append(c.xGoogHeaders, hds...)
3958 hds = append(hds, "Content-Type", "application/json")
3959 headers := gax.BuildHeaders(ctx, hds...)
3960 opts = append((*c.CallOptions).GetTrustConfig[0:len((*c.CallOptions).GetTrustConfig):len((*c.CallOptions).GetTrustConfig)], opts...)
3961 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3962 resp := &certificatemanagerpb.TrustConfig{}
3963 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3964 if settings.Path != "" {
3965 baseUrl.Path = settings.Path
3966 }
3967 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
3968 if err != nil {
3969 return err
3970 }
3971 httpReq = httpReq.WithContext(ctx)
3972 httpReq.Header = headers
3973
3974 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetTrustConfig")
3975 if err != nil {
3976 return err
3977 }
3978
3979 if err := unm.Unmarshal(buf, resp); err != nil {
3980 return err
3981 }
3982
3983 return nil
3984 }, opts...)
3985 if e != nil {
3986 return nil, e
3987 }
3988 return resp, nil
3989 }
3990
3991 // CreateTrustConfig creates a new TrustConfig in a given project and location.
3992 func (c *restClient) CreateTrustConfig(ctx context.Context, req *certificatemanagerpb.CreateTrustConfigRequest, opts ...gax.CallOption) (*CreateTrustConfigOperation, error) {
3993 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
3994 body := req.GetTrustConfig()
3995 jsonReq, err := m.Marshal(body)
3996 if err != nil {
3997 return nil, err
3998 }
3999
4000 baseUrl, err := url.Parse(c.endpoint)
4001 if err != nil {
4002 return nil, err
4003 }
4004 baseUrl.Path += fmt.Sprintf("/v1/%v/trustConfigs", req.GetParent())
4005
4006 params := url.Values{}
4007 params.Add("$alt", "json;enum-encoding=int")
4008 params.Add("trustConfigId", fmt.Sprintf("%v", req.GetTrustConfigId()))
4009
4010 baseUrl.RawQuery = params.Encode()
4011
4012 // Build HTTP headers from client and context metadata.
4013 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
4014
4015 hds = append(c.xGoogHeaders, hds...)
4016 hds = append(hds, "Content-Type", "application/json")
4017 headers := gax.BuildHeaders(ctx, hds...)
4018 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
4019 resp := &longrunningpb.Operation{}
4020 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4021 if settings.Path != "" {
4022 baseUrl.Path = settings.Path
4023 }
4024 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
4025 if err != nil {
4026 return err
4027 }
4028 httpReq = httpReq.WithContext(ctx)
4029 httpReq.Header = headers
4030
4031 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreateTrustConfig")
4032 if err != nil {
4033 return err
4034 }
4035 if err := unm.Unmarshal(buf, resp); err != nil {
4036 return err
4037 }
4038
4039 return nil
4040 }, opts...)
4041 if e != nil {
4042 return nil, e
4043 }
4044
4045 override := fmt.Sprintf("/v1/%s", resp.GetName())
4046 return &CreateTrustConfigOperation{
4047 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
4048 pollPath: override,
4049 }, nil
4050 }
4051
4052 // UpdateTrustConfig updates a TrustConfig.
4053 func (c *restClient) UpdateTrustConfig(ctx context.Context, req *certificatemanagerpb.UpdateTrustConfigRequest, opts ...gax.CallOption) (*UpdateTrustConfigOperation, error) {
4054 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
4055 body := req.GetTrustConfig()
4056 jsonReq, err := m.Marshal(body)
4057 if err != nil {
4058 return nil, err
4059 }
4060
4061 baseUrl, err := url.Parse(c.endpoint)
4062 if err != nil {
4063 return nil, err
4064 }
4065 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetTrustConfig().GetName())
4066
4067 params := url.Values{}
4068 params.Add("$alt", "json;enum-encoding=int")
4069 if req.GetUpdateMask() != nil {
4070 field, err := protojson.Marshal(req.GetUpdateMask())
4071 if err != nil {
4072 return nil, err
4073 }
4074 params.Add("updateMask", string(field[1:len(field)-1]))
4075 }
4076
4077 baseUrl.RawQuery = params.Encode()
4078
4079 // Build HTTP headers from client and context metadata.
4080 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "trust_config.name", url.QueryEscape(req.GetTrustConfig().GetName()))}
4081
4082 hds = append(c.xGoogHeaders, hds...)
4083 hds = append(hds, "Content-Type", "application/json")
4084 headers := gax.BuildHeaders(ctx, hds...)
4085 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
4086 resp := &longrunningpb.Operation{}
4087 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4088 if settings.Path != "" {
4089 baseUrl.Path = settings.Path
4090 }
4091 httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq))
4092 if err != nil {
4093 return err
4094 }
4095 httpReq = httpReq.WithContext(ctx)
4096 httpReq.Header = headers
4097
4098 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UpdateTrustConfig")
4099 if err != nil {
4100 return err
4101 }
4102 if err := unm.Unmarshal(buf, resp); err != nil {
4103 return err
4104 }
4105
4106 return nil
4107 }, opts...)
4108 if e != nil {
4109 return nil, e
4110 }
4111
4112 override := fmt.Sprintf("/v1/%s", resp.GetName())
4113 return &UpdateTrustConfigOperation{
4114 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
4115 pollPath: override,
4116 }, nil
4117 }
4118
4119 // DeleteTrustConfig deletes a single TrustConfig.
4120 func (c *restClient) DeleteTrustConfig(ctx context.Context, req *certificatemanagerpb.DeleteTrustConfigRequest, opts ...gax.CallOption) (*DeleteTrustConfigOperation, error) {
4121 baseUrl, err := url.Parse(c.endpoint)
4122 if err != nil {
4123 return nil, err
4124 }
4125 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
4126
4127 params := url.Values{}
4128 params.Add("$alt", "json;enum-encoding=int")
4129 if req.GetEtag() != "" {
4130 params.Add("etag", fmt.Sprintf("%v", req.GetEtag()))
4131 }
4132
4133 baseUrl.RawQuery = params.Encode()
4134
4135 // Build HTTP headers from client and context metadata.
4136 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
4137
4138 hds = append(c.xGoogHeaders, hds...)
4139 hds = append(hds, "Content-Type", "application/json")
4140 headers := gax.BuildHeaders(ctx, hds...)
4141 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
4142 resp := &longrunningpb.Operation{}
4143 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4144 if settings.Path != "" {
4145 baseUrl.Path = settings.Path
4146 }
4147 httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil)
4148 if err != nil {
4149 return err
4150 }
4151 httpReq = httpReq.WithContext(ctx)
4152 httpReq.Header = headers
4153
4154 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteTrustConfig")
4155 if err != nil {
4156 return err
4157 }
4158 if err := unm.Unmarshal(buf, resp); err != nil {
4159 return err
4160 }
4161
4162 return nil
4163 }, opts...)
4164 if e != nil {
4165 return nil, e
4166 }
4167
4168 override := fmt.Sprintf("/v1/%s", resp.GetName())
4169 return &DeleteTrustConfigOperation{
4170 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
4171 pollPath: override,
4172 }, nil
4173 }
4174
4175 // GetLocation gets information about a location.
4176 func (c *restClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error) {
4177 baseUrl, err := url.Parse(c.endpoint)
4178 if err != nil {
4179 return nil, err
4180 }
4181 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
4182
4183 params := url.Values{}
4184 params.Add("$alt", "json;enum-encoding=int")
4185
4186 baseUrl.RawQuery = params.Encode()
4187
4188 // Build HTTP headers from client and context metadata.
4189 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
4190
4191 hds = append(c.xGoogHeaders, hds...)
4192 hds = append(hds, "Content-Type", "application/json")
4193 headers := gax.BuildHeaders(ctx, hds...)
4194 opts = append((*c.CallOptions).GetLocation[0:len((*c.CallOptions).GetLocation):len((*c.CallOptions).GetLocation)], opts...)
4195 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
4196 resp := &locationpb.Location{}
4197 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4198 if settings.Path != "" {
4199 baseUrl.Path = settings.Path
4200 }
4201 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
4202 if err != nil {
4203 return err
4204 }
4205 httpReq = httpReq.WithContext(ctx)
4206 httpReq.Header = headers
4207
4208 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetLocation")
4209 if err != nil {
4210 return err
4211 }
4212
4213 if err := unm.Unmarshal(buf, resp); err != nil {
4214 return err
4215 }
4216
4217 return nil
4218 }, opts...)
4219 if e != nil {
4220 return nil, e
4221 }
4222 return resp, nil
4223 }
4224
4225 // ListLocations lists information about the supported locations for this service.
4226 func (c *restClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator {
4227 it := &LocationIterator{}
4228 req = proto.Clone(req).(*locationpb.ListLocationsRequest)
4229 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
4230 it.InternalFetch = func(pageSize int, pageToken string) ([]*locationpb.Location, string, error) {
4231 resp := &locationpb.ListLocationsResponse{}
4232 if pageToken != "" {
4233 req.PageToken = pageToken
4234 }
4235 if pageSize > math.MaxInt32 {
4236 req.PageSize = math.MaxInt32
4237 } else if pageSize != 0 {
4238 req.PageSize = int32(pageSize)
4239 }
4240 baseUrl, err := url.Parse(c.endpoint)
4241 if err != nil {
4242 return nil, "", err
4243 }
4244 baseUrl.Path += fmt.Sprintf("/v1/%v/locations", req.GetName())
4245
4246 params := url.Values{}
4247 params.Add("$alt", "json;enum-encoding=int")
4248 if req.GetFilter() != "" {
4249 params.Add("filter", fmt.Sprintf("%v", req.GetFilter()))
4250 }
4251 if req.GetPageSize() != 0 {
4252 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
4253 }
4254 if req.GetPageToken() != "" {
4255 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
4256 }
4257
4258 baseUrl.RawQuery = params.Encode()
4259
4260 // Build HTTP headers from client and context metadata.
4261 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
4262 headers := gax.BuildHeaders(ctx, hds...)
4263 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4264 if settings.Path != "" {
4265 baseUrl.Path = settings.Path
4266 }
4267 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
4268 if err != nil {
4269 return err
4270 }
4271 httpReq.Header = headers
4272
4273 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListLocations")
4274 if err != nil {
4275 return err
4276 }
4277 if err := unm.Unmarshal(buf, resp); err != nil {
4278 return err
4279 }
4280
4281 return nil
4282 }, opts...)
4283 if e != nil {
4284 return nil, "", e
4285 }
4286 it.Response = resp
4287 return resp.GetLocations(), resp.GetNextPageToken(), nil
4288 }
4289
4290 fetch := func(pageSize int, pageToken string) (string, error) {
4291 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
4292 if err != nil {
4293 return "", err
4294 }
4295 it.items = append(it.items, items...)
4296 return nextPageToken, nil
4297 }
4298
4299 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
4300 it.pageInfo.MaxSize = int(req.GetPageSize())
4301 it.pageInfo.Token = req.GetPageToken()
4302
4303 return it
4304 }
4305
4306 // CancelOperation is a utility method from google.longrunning.Operations.
4307 func (c *restClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error {
4308 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
4309 jsonReq, err := m.Marshal(req)
4310 if err != nil {
4311 return err
4312 }
4313
4314 baseUrl, err := url.Parse(c.endpoint)
4315 if err != nil {
4316 return err
4317 }
4318 baseUrl.Path += fmt.Sprintf("/v1/%v:cancel", req.GetName())
4319
4320 params := url.Values{}
4321 params.Add("$alt", "json;enum-encoding=int")
4322
4323 baseUrl.RawQuery = params.Encode()
4324
4325 // Build HTTP headers from client and context metadata.
4326 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
4327
4328 hds = append(c.xGoogHeaders, hds...)
4329 hds = append(hds, "Content-Type", "application/json")
4330 headers := gax.BuildHeaders(ctx, hds...)
4331 return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4332 if settings.Path != "" {
4333 baseUrl.Path = settings.Path
4334 }
4335 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
4336 if err != nil {
4337 return err
4338 }
4339 httpReq = httpReq.WithContext(ctx)
4340 httpReq.Header = headers
4341
4342 _, err = executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CancelOperation")
4343 return err
4344 }, opts...)
4345 }
4346
4347 // DeleteOperation is a utility method from google.longrunning.Operations.
4348 func (c *restClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error {
4349 baseUrl, err := url.Parse(c.endpoint)
4350 if err != nil {
4351 return err
4352 }
4353 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
4354
4355 params := url.Values{}
4356 params.Add("$alt", "json;enum-encoding=int")
4357
4358 baseUrl.RawQuery = params.Encode()
4359
4360 // Build HTTP headers from client and context metadata.
4361 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
4362
4363 hds = append(c.xGoogHeaders, hds...)
4364 hds = append(hds, "Content-Type", "application/json")
4365 headers := gax.BuildHeaders(ctx, hds...)
4366 return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4367 if settings.Path != "" {
4368 baseUrl.Path = settings.Path
4369 }
4370 httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil)
4371 if err != nil {
4372 return err
4373 }
4374 httpReq = httpReq.WithContext(ctx)
4375 httpReq.Header = headers
4376
4377 _, err = executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteOperation")
4378 return err
4379 }, opts...)
4380 }
4381
4382 // GetOperation is a utility method from google.longrunning.Operations.
4383 func (c *restClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) {
4384 baseUrl, err := url.Parse(c.endpoint)
4385 if err != nil {
4386 return nil, err
4387 }
4388 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
4389
4390 params := url.Values{}
4391 params.Add("$alt", "json;enum-encoding=int")
4392
4393 baseUrl.RawQuery = params.Encode()
4394
4395 // Build HTTP headers from client and context metadata.
4396 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
4397
4398 hds = append(c.xGoogHeaders, hds...)
4399 hds = append(hds, "Content-Type", "application/json")
4400 headers := gax.BuildHeaders(ctx, hds...)
4401 opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...)
4402 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
4403 resp := &longrunningpb.Operation{}
4404 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4405 if settings.Path != "" {
4406 baseUrl.Path = settings.Path
4407 }
4408 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
4409 if err != nil {
4410 return err
4411 }
4412 httpReq = httpReq.WithContext(ctx)
4413 httpReq.Header = headers
4414
4415 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetOperation")
4416 if err != nil {
4417 return err
4418 }
4419
4420 if err := unm.Unmarshal(buf, resp); err != nil {
4421 return err
4422 }
4423
4424 return nil
4425 }, opts...)
4426 if e != nil {
4427 return nil, e
4428 }
4429 return resp, nil
4430 }
4431
4432 // ListOperations is a utility method from google.longrunning.Operations.
4433 func (c *restClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator {
4434 it := &OperationIterator{}
4435 req = proto.Clone(req).(*longrunningpb.ListOperationsRequest)
4436 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
4437 it.InternalFetch = func(pageSize int, pageToken string) ([]*longrunningpb.Operation, string, error) {
4438 resp := &longrunningpb.ListOperationsResponse{}
4439 if pageToken != "" {
4440 req.PageToken = pageToken
4441 }
4442 if pageSize > math.MaxInt32 {
4443 req.PageSize = math.MaxInt32
4444 } else if pageSize != 0 {
4445 req.PageSize = int32(pageSize)
4446 }
4447 baseUrl, err := url.Parse(c.endpoint)
4448 if err != nil {
4449 return nil, "", err
4450 }
4451 baseUrl.Path += fmt.Sprintf("/v1/%v/operations", req.GetName())
4452
4453 params := url.Values{}
4454 params.Add("$alt", "json;enum-encoding=int")
4455 if req.GetFilter() != "" {
4456 params.Add("filter", fmt.Sprintf("%v", req.GetFilter()))
4457 }
4458 if req.GetPageSize() != 0 {
4459 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
4460 }
4461 if req.GetPageToken() != "" {
4462 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
4463 }
4464
4465 baseUrl.RawQuery = params.Encode()
4466
4467 // Build HTTP headers from client and context metadata.
4468 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
4469 headers := gax.BuildHeaders(ctx, hds...)
4470 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4471 if settings.Path != "" {
4472 baseUrl.Path = settings.Path
4473 }
4474 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
4475 if err != nil {
4476 return err
4477 }
4478 httpReq.Header = headers
4479
4480 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListOperations")
4481 if err != nil {
4482 return err
4483 }
4484 if err := unm.Unmarshal(buf, resp); err != nil {
4485 return err
4486 }
4487
4488 return nil
4489 }, opts...)
4490 if e != nil {
4491 return nil, "", e
4492 }
4493 it.Response = resp
4494 return resp.GetOperations(), resp.GetNextPageToken(), nil
4495 }
4496
4497 fetch := func(pageSize int, pageToken string) (string, error) {
4498 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
4499 if err != nil {
4500 return "", err
4501 }
4502 it.items = append(it.items, items...)
4503 return nextPageToken, nil
4504 }
4505
4506 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
4507 it.pageInfo.MaxSize = int(req.GetPageSize())
4508 it.pageInfo.Token = req.GetPageToken()
4509
4510 return it
4511 }
4512
4513 // CreateCertificateOperation returns a new CreateCertificateOperation from a given name.
4514 // The name must be that of a previously created CreateCertificateOperation, possibly from a different process.
4515 func (c *gRPCClient) CreateCertificateOperation(name string) *CreateCertificateOperation {
4516 return &CreateCertificateOperation{
4517 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4518 }
4519 }
4520
4521 // CreateCertificateOperation returns a new CreateCertificateOperation from a given name.
4522 // The name must be that of a previously created CreateCertificateOperation, possibly from a different process.
4523 func (c *restClient) CreateCertificateOperation(name string) *CreateCertificateOperation {
4524 override := fmt.Sprintf("/v1/%s", name)
4525 return &CreateCertificateOperation{
4526 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4527 pollPath: override,
4528 }
4529 }
4530
4531 // CreateCertificateIssuanceConfigOperation returns a new CreateCertificateIssuanceConfigOperation from a given name.
4532 // The name must be that of a previously created CreateCertificateIssuanceConfigOperation, possibly from a different process.
4533 func (c *gRPCClient) CreateCertificateIssuanceConfigOperation(name string) *CreateCertificateIssuanceConfigOperation {
4534 return &CreateCertificateIssuanceConfigOperation{
4535 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4536 }
4537 }
4538
4539 // CreateCertificateIssuanceConfigOperation returns a new CreateCertificateIssuanceConfigOperation from a given name.
4540 // The name must be that of a previously created CreateCertificateIssuanceConfigOperation, possibly from a different process.
4541 func (c *restClient) CreateCertificateIssuanceConfigOperation(name string) *CreateCertificateIssuanceConfigOperation {
4542 override := fmt.Sprintf("/v1/%s", name)
4543 return &CreateCertificateIssuanceConfigOperation{
4544 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4545 pollPath: override,
4546 }
4547 }
4548
4549 // CreateCertificateMapOperation returns a new CreateCertificateMapOperation from a given name.
4550 // The name must be that of a previously created CreateCertificateMapOperation, possibly from a different process.
4551 func (c *gRPCClient) CreateCertificateMapOperation(name string) *CreateCertificateMapOperation {
4552 return &CreateCertificateMapOperation{
4553 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4554 }
4555 }
4556
4557 // CreateCertificateMapOperation returns a new CreateCertificateMapOperation from a given name.
4558 // The name must be that of a previously created CreateCertificateMapOperation, possibly from a different process.
4559 func (c *restClient) CreateCertificateMapOperation(name string) *CreateCertificateMapOperation {
4560 override := fmt.Sprintf("/v1/%s", name)
4561 return &CreateCertificateMapOperation{
4562 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4563 pollPath: override,
4564 }
4565 }
4566
4567 // CreateCertificateMapEntryOperation returns a new CreateCertificateMapEntryOperation from a given name.
4568 // The name must be that of a previously created CreateCertificateMapEntryOperation, possibly from a different process.
4569 func (c *gRPCClient) CreateCertificateMapEntryOperation(name string) *CreateCertificateMapEntryOperation {
4570 return &CreateCertificateMapEntryOperation{
4571 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4572 }
4573 }
4574
4575 // CreateCertificateMapEntryOperation returns a new CreateCertificateMapEntryOperation from a given name.
4576 // The name must be that of a previously created CreateCertificateMapEntryOperation, possibly from a different process.
4577 func (c *restClient) CreateCertificateMapEntryOperation(name string) *CreateCertificateMapEntryOperation {
4578 override := fmt.Sprintf("/v1/%s", name)
4579 return &CreateCertificateMapEntryOperation{
4580 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4581 pollPath: override,
4582 }
4583 }
4584
4585 // CreateDnsAuthorizationOperation returns a new CreateDnsAuthorizationOperation from a given name.
4586 // The name must be that of a previously created CreateDnsAuthorizationOperation, possibly from a different process.
4587 func (c *gRPCClient) CreateDnsAuthorizationOperation(name string) *CreateDnsAuthorizationOperation {
4588 return &CreateDnsAuthorizationOperation{
4589 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4590 }
4591 }
4592
4593 // CreateDnsAuthorizationOperation returns a new CreateDnsAuthorizationOperation from a given name.
4594 // The name must be that of a previously created CreateDnsAuthorizationOperation, possibly from a different process.
4595 func (c *restClient) CreateDnsAuthorizationOperation(name string) *CreateDnsAuthorizationOperation {
4596 override := fmt.Sprintf("/v1/%s", name)
4597 return &CreateDnsAuthorizationOperation{
4598 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4599 pollPath: override,
4600 }
4601 }
4602
4603 // CreateTrustConfigOperation returns a new CreateTrustConfigOperation from a given name.
4604 // The name must be that of a previously created CreateTrustConfigOperation, possibly from a different process.
4605 func (c *gRPCClient) CreateTrustConfigOperation(name string) *CreateTrustConfigOperation {
4606 return &CreateTrustConfigOperation{
4607 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4608 }
4609 }
4610
4611 // CreateTrustConfigOperation returns a new CreateTrustConfigOperation from a given name.
4612 // The name must be that of a previously created CreateTrustConfigOperation, possibly from a different process.
4613 func (c *restClient) CreateTrustConfigOperation(name string) *CreateTrustConfigOperation {
4614 override := fmt.Sprintf("/v1/%s", name)
4615 return &CreateTrustConfigOperation{
4616 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4617 pollPath: override,
4618 }
4619 }
4620
4621 // DeleteCertificateOperation returns a new DeleteCertificateOperation from a given name.
4622 // The name must be that of a previously created DeleteCertificateOperation, possibly from a different process.
4623 func (c *gRPCClient) DeleteCertificateOperation(name string) *DeleteCertificateOperation {
4624 return &DeleteCertificateOperation{
4625 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4626 }
4627 }
4628
4629 // DeleteCertificateOperation returns a new DeleteCertificateOperation from a given name.
4630 // The name must be that of a previously created DeleteCertificateOperation, possibly from a different process.
4631 func (c *restClient) DeleteCertificateOperation(name string) *DeleteCertificateOperation {
4632 override := fmt.Sprintf("/v1/%s", name)
4633 return &DeleteCertificateOperation{
4634 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4635 pollPath: override,
4636 }
4637 }
4638
4639 // DeleteCertificateIssuanceConfigOperation returns a new DeleteCertificateIssuanceConfigOperation from a given name.
4640 // The name must be that of a previously created DeleteCertificateIssuanceConfigOperation, possibly from a different process.
4641 func (c *gRPCClient) DeleteCertificateIssuanceConfigOperation(name string) *DeleteCertificateIssuanceConfigOperation {
4642 return &DeleteCertificateIssuanceConfigOperation{
4643 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4644 }
4645 }
4646
4647 // DeleteCertificateIssuanceConfigOperation returns a new DeleteCertificateIssuanceConfigOperation from a given name.
4648 // The name must be that of a previously created DeleteCertificateIssuanceConfigOperation, possibly from a different process.
4649 func (c *restClient) DeleteCertificateIssuanceConfigOperation(name string) *DeleteCertificateIssuanceConfigOperation {
4650 override := fmt.Sprintf("/v1/%s", name)
4651 return &DeleteCertificateIssuanceConfigOperation{
4652 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4653 pollPath: override,
4654 }
4655 }
4656
4657 // DeleteCertificateMapOperation returns a new DeleteCertificateMapOperation from a given name.
4658 // The name must be that of a previously created DeleteCertificateMapOperation, possibly from a different process.
4659 func (c *gRPCClient) DeleteCertificateMapOperation(name string) *DeleteCertificateMapOperation {
4660 return &DeleteCertificateMapOperation{
4661 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4662 }
4663 }
4664
4665 // DeleteCertificateMapOperation returns a new DeleteCertificateMapOperation from a given name.
4666 // The name must be that of a previously created DeleteCertificateMapOperation, possibly from a different process.
4667 func (c *restClient) DeleteCertificateMapOperation(name string) *DeleteCertificateMapOperation {
4668 override := fmt.Sprintf("/v1/%s", name)
4669 return &DeleteCertificateMapOperation{
4670 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4671 pollPath: override,
4672 }
4673 }
4674
4675 // DeleteCertificateMapEntryOperation returns a new DeleteCertificateMapEntryOperation from a given name.
4676 // The name must be that of a previously created DeleteCertificateMapEntryOperation, possibly from a different process.
4677 func (c *gRPCClient) DeleteCertificateMapEntryOperation(name string) *DeleteCertificateMapEntryOperation {
4678 return &DeleteCertificateMapEntryOperation{
4679 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4680 }
4681 }
4682
4683 // DeleteCertificateMapEntryOperation returns a new DeleteCertificateMapEntryOperation from a given name.
4684 // The name must be that of a previously created DeleteCertificateMapEntryOperation, possibly from a different process.
4685 func (c *restClient) DeleteCertificateMapEntryOperation(name string) *DeleteCertificateMapEntryOperation {
4686 override := fmt.Sprintf("/v1/%s", name)
4687 return &DeleteCertificateMapEntryOperation{
4688 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4689 pollPath: override,
4690 }
4691 }
4692
4693 // DeleteDnsAuthorizationOperation returns a new DeleteDnsAuthorizationOperation from a given name.
4694 // The name must be that of a previously created DeleteDnsAuthorizationOperation, possibly from a different process.
4695 func (c *gRPCClient) DeleteDnsAuthorizationOperation(name string) *DeleteDnsAuthorizationOperation {
4696 return &DeleteDnsAuthorizationOperation{
4697 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4698 }
4699 }
4700
4701 // DeleteDnsAuthorizationOperation returns a new DeleteDnsAuthorizationOperation from a given name.
4702 // The name must be that of a previously created DeleteDnsAuthorizationOperation, possibly from a different process.
4703 func (c *restClient) DeleteDnsAuthorizationOperation(name string) *DeleteDnsAuthorizationOperation {
4704 override := fmt.Sprintf("/v1/%s", name)
4705 return &DeleteDnsAuthorizationOperation{
4706 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4707 pollPath: override,
4708 }
4709 }
4710
4711 // DeleteTrustConfigOperation returns a new DeleteTrustConfigOperation from a given name.
4712 // The name must be that of a previously created DeleteTrustConfigOperation, possibly from a different process.
4713 func (c *gRPCClient) DeleteTrustConfigOperation(name string) *DeleteTrustConfigOperation {
4714 return &DeleteTrustConfigOperation{
4715 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4716 }
4717 }
4718
4719 // DeleteTrustConfigOperation returns a new DeleteTrustConfigOperation from a given name.
4720 // The name must be that of a previously created DeleteTrustConfigOperation, possibly from a different process.
4721 func (c *restClient) DeleteTrustConfigOperation(name string) *DeleteTrustConfigOperation {
4722 override := fmt.Sprintf("/v1/%s", name)
4723 return &DeleteTrustConfigOperation{
4724 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4725 pollPath: override,
4726 }
4727 }
4728
4729 // UpdateCertificateOperation returns a new UpdateCertificateOperation from a given name.
4730 // The name must be that of a previously created UpdateCertificateOperation, possibly from a different process.
4731 func (c *gRPCClient) UpdateCertificateOperation(name string) *UpdateCertificateOperation {
4732 return &UpdateCertificateOperation{
4733 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4734 }
4735 }
4736
4737 // UpdateCertificateOperation returns a new UpdateCertificateOperation from a given name.
4738 // The name must be that of a previously created UpdateCertificateOperation, possibly from a different process.
4739 func (c *restClient) UpdateCertificateOperation(name string) *UpdateCertificateOperation {
4740 override := fmt.Sprintf("/v1/%s", name)
4741 return &UpdateCertificateOperation{
4742 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4743 pollPath: override,
4744 }
4745 }
4746
4747 // UpdateCertificateMapOperation returns a new UpdateCertificateMapOperation from a given name.
4748 // The name must be that of a previously created UpdateCertificateMapOperation, possibly from a different process.
4749 func (c *gRPCClient) UpdateCertificateMapOperation(name string) *UpdateCertificateMapOperation {
4750 return &UpdateCertificateMapOperation{
4751 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4752 }
4753 }
4754
4755 // UpdateCertificateMapOperation returns a new UpdateCertificateMapOperation from a given name.
4756 // The name must be that of a previously created UpdateCertificateMapOperation, possibly from a different process.
4757 func (c *restClient) UpdateCertificateMapOperation(name string) *UpdateCertificateMapOperation {
4758 override := fmt.Sprintf("/v1/%s", name)
4759 return &UpdateCertificateMapOperation{
4760 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4761 pollPath: override,
4762 }
4763 }
4764
4765 // UpdateCertificateMapEntryOperation returns a new UpdateCertificateMapEntryOperation from a given name.
4766 // The name must be that of a previously created UpdateCertificateMapEntryOperation, possibly from a different process.
4767 func (c *gRPCClient) UpdateCertificateMapEntryOperation(name string) *UpdateCertificateMapEntryOperation {
4768 return &UpdateCertificateMapEntryOperation{
4769 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4770 }
4771 }
4772
4773 // UpdateCertificateMapEntryOperation returns a new UpdateCertificateMapEntryOperation from a given name.
4774 // The name must be that of a previously created UpdateCertificateMapEntryOperation, possibly from a different process.
4775 func (c *restClient) UpdateCertificateMapEntryOperation(name string) *UpdateCertificateMapEntryOperation {
4776 override := fmt.Sprintf("/v1/%s", name)
4777 return &UpdateCertificateMapEntryOperation{
4778 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4779 pollPath: override,
4780 }
4781 }
4782
4783 // UpdateDnsAuthorizationOperation returns a new UpdateDnsAuthorizationOperation from a given name.
4784 // The name must be that of a previously created UpdateDnsAuthorizationOperation, possibly from a different process.
4785 func (c *gRPCClient) UpdateDnsAuthorizationOperation(name string) *UpdateDnsAuthorizationOperation {
4786 return &UpdateDnsAuthorizationOperation{
4787 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4788 }
4789 }
4790
4791 // UpdateDnsAuthorizationOperation returns a new UpdateDnsAuthorizationOperation from a given name.
4792 // The name must be that of a previously created UpdateDnsAuthorizationOperation, possibly from a different process.
4793 func (c *restClient) UpdateDnsAuthorizationOperation(name string) *UpdateDnsAuthorizationOperation {
4794 override := fmt.Sprintf("/v1/%s", name)
4795 return &UpdateDnsAuthorizationOperation{
4796 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4797 pollPath: override,
4798 }
4799 }
4800
4801 // UpdateTrustConfigOperation returns a new UpdateTrustConfigOperation from a given name.
4802 // The name must be that of a previously created UpdateTrustConfigOperation, possibly from a different process.
4803 func (c *gRPCClient) UpdateTrustConfigOperation(name string) *UpdateTrustConfigOperation {
4804 return &UpdateTrustConfigOperation{
4805 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4806 }
4807 }
4808
4809 // UpdateTrustConfigOperation returns a new UpdateTrustConfigOperation from a given name.
4810 // The name must be that of a previously created UpdateTrustConfigOperation, possibly from a different process.
4811 func (c *restClient) UpdateTrustConfigOperation(name string) *UpdateTrustConfigOperation {
4812 override := fmt.Sprintf("/v1/%s", name)
4813 return &UpdateTrustConfigOperation{
4814 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4815 pollPath: override,
4816 }
4817 }