Debian Codegraph @

binaryauthorization/apiv1beta1/binauthz_management_service_v1_beta1_client.go

raw symbols SCIP
1 // Copyright 2025 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // https://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 // Code generated by protoc-gen-go_gapic. DO NOT EDIT.
16
17 package binaryauthorization
18
19 import (
20 "bytes"
21 "context"
22 "fmt"
23 "log/slog"
24 "math"
25 "net/http"
26 "net/url"
27 "time"
28
29 binaryauthorizationpb "cloud.google.com/go/binaryauthorization/apiv1beta1/binaryauthorizationpb"
30 gax "github.com/googleapis/gax-go/v2"
31 "google.golang.org/api/iterator"
32 "google.golang.org/api/option"
33 "google.golang.org/api/option/internaloption"
34 gtransport "google.golang.org/api/transport/grpc"
35 httptransport "google.golang.org/api/transport/http"
36 "google.golang.org/grpc"
37 "google.golang.org/grpc/codes"
38 "google.golang.org/protobuf/encoding/protojson"
39 "google.golang.org/protobuf/proto"
40 )
41
42 var newBinauthzManagementServiceV1Beta1ClientHook clientHook
43
44 // BinauthzManagementServiceV1Beta1CallOptions contains the retry settings for each method of BinauthzManagementServiceV1Beta1Client.
45 type BinauthzManagementServiceV1Beta1CallOptions struct {
46 GetPolicy []gax.CallOption
47 UpdatePolicy []gax.CallOption
48 CreateAttestor []gax.CallOption
49 GetAttestor []gax.CallOption
50 UpdateAttestor []gax.CallOption
51 ListAttestors []gax.CallOption
52 DeleteAttestor []gax.CallOption
53 }
54
55 func defaultBinauthzManagementServiceV1Beta1GRPCClientOptions() []option.ClientOption {
56 return []option.ClientOption{
57 internaloption.WithDefaultEndpoint("binaryauthorization.googleapis.com:443"),
58 internaloption.WithDefaultEndpointTemplate("binaryauthorization.UNIVERSE_DOMAIN:443"),
59 internaloption.WithDefaultMTLSEndpoint("binaryauthorization.mtls.googleapis.com:443"),
60 internaloption.WithDefaultUniverseDomain("googleapis.com"),
61 internaloption.WithDefaultAudience("https://binaryauthorization.googleapis.com/"),
62 internaloption.WithDefaultScopes(DefaultAuthScopes()...),
63 internaloption.EnableJwtWithScope(),
64 internaloption.EnableNewAuthLibrary(),
65 option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
66 grpc.MaxCallRecvMsgSize(math.MaxInt32))),
67 }
68 }
69
70 func defaultBinauthzManagementServiceV1Beta1CallOptions() *BinauthzManagementServiceV1Beta1CallOptions {
71 return &BinauthzManagementServiceV1Beta1CallOptions{
72 GetPolicy: []gax.CallOption{
73 gax.WithTimeout(600000 * time.Millisecond),
74 gax.WithRetry(func() gax.Retryer {
75 return gax.OnCodes([]codes.Code{
76 codes.DeadlineExceeded,
77 codes.Unavailable,
78 }, gax.Backoff{
79 Initial: 100 * time.Millisecond,
80 Max: 60000 * time.Millisecond,
81 Multiplier: 1.30,
82 })
83 }),
84 },
85 UpdatePolicy: []gax.CallOption{
86 gax.WithTimeout(600000 * time.Millisecond),
87 gax.WithRetry(func() gax.Retryer {
88 return gax.OnCodes([]codes.Code{
89 codes.DeadlineExceeded,
90 codes.Unavailable,
91 }, gax.Backoff{
92 Initial: 100 * time.Millisecond,
93 Max: 60000 * time.Millisecond,
94 Multiplier: 1.30,
95 })
96 }),
97 },
98 CreateAttestor: []gax.CallOption{
99 gax.WithTimeout(600000 * time.Millisecond),
100 },
101 GetAttestor: []gax.CallOption{
102 gax.WithTimeout(600000 * time.Millisecond),
103 gax.WithRetry(func() gax.Retryer {
104 return gax.OnCodes([]codes.Code{
105 codes.DeadlineExceeded,
106 codes.Unavailable,
107 }, gax.Backoff{
108 Initial: 100 * time.Millisecond,
109 Max: 60000 * time.Millisecond,
110 Multiplier: 1.30,
111 })
112 }),
113 },
114 UpdateAttestor: []gax.CallOption{
115 gax.WithTimeout(600000 * time.Millisecond),
116 gax.WithRetry(func() gax.Retryer {
117 return gax.OnCodes([]codes.Code{
118 codes.DeadlineExceeded,
119 codes.Unavailable,
120 }, gax.Backoff{
121 Initial: 100 * time.Millisecond,
122 Max: 60000 * time.Millisecond,
123 Multiplier: 1.30,
124 })
125 }),
126 },
127 ListAttestors: []gax.CallOption{
128 gax.WithTimeout(600000 * time.Millisecond),
129 gax.WithRetry(func() gax.Retryer {
130 return gax.OnCodes([]codes.Code{
131 codes.DeadlineExceeded,
132 codes.Unavailable,
133 }, gax.Backoff{
134 Initial: 100 * time.Millisecond,
135 Max: 60000 * time.Millisecond,
136 Multiplier: 1.30,
137 })
138 }),
139 },
140 DeleteAttestor: []gax.CallOption{
141 gax.WithTimeout(600000 * time.Millisecond),
142 gax.WithRetry(func() gax.Retryer {
143 return gax.OnCodes([]codes.Code{
144 codes.DeadlineExceeded,
145 codes.Unavailable,
146 }, gax.Backoff{
147 Initial: 100 * time.Millisecond,
148 Max: 60000 * time.Millisecond,
149 Multiplier: 1.30,
150 })
151 }),
152 },
153 }
154 }
155
156 func defaultBinauthzManagementServiceV1Beta1RESTCallOptions() *BinauthzManagementServiceV1Beta1CallOptions {
157 return &BinauthzManagementServiceV1Beta1CallOptions{
158 GetPolicy: []gax.CallOption{
159 gax.WithTimeout(600000 * time.Millisecond),
160 gax.WithRetry(func() gax.Retryer {
161 return gax.OnHTTPCodes(gax.Backoff{
162 Initial: 100 * time.Millisecond,
163 Max: 60000 * time.Millisecond,
164 Multiplier: 1.30,
165 },
166 http.StatusGatewayTimeout,
167 http.StatusServiceUnavailable)
168 }),
169 },
170 UpdatePolicy: []gax.CallOption{
171 gax.WithTimeout(600000 * time.Millisecond),
172 gax.WithRetry(func() gax.Retryer {
173 return gax.OnHTTPCodes(gax.Backoff{
174 Initial: 100 * time.Millisecond,
175 Max: 60000 * time.Millisecond,
176 Multiplier: 1.30,
177 },
178 http.StatusGatewayTimeout,
179 http.StatusServiceUnavailable)
180 }),
181 },
182 CreateAttestor: []gax.CallOption{
183 gax.WithTimeout(600000 * time.Millisecond),
184 },
185 GetAttestor: []gax.CallOption{
186 gax.WithTimeout(600000 * time.Millisecond),
187 gax.WithRetry(func() gax.Retryer {
188 return gax.OnHTTPCodes(gax.Backoff{
189 Initial: 100 * time.Millisecond,
190 Max: 60000 * time.Millisecond,
191 Multiplier: 1.30,
192 },
193 http.StatusGatewayTimeout,
194 http.StatusServiceUnavailable)
195 }),
196 },
197 UpdateAttestor: []gax.CallOption{
198 gax.WithTimeout(600000 * time.Millisecond),
199 gax.WithRetry(func() gax.Retryer {
200 return gax.OnHTTPCodes(gax.Backoff{
201 Initial: 100 * time.Millisecond,
202 Max: 60000 * time.Millisecond,
203 Multiplier: 1.30,
204 },
205 http.StatusGatewayTimeout,
206 http.StatusServiceUnavailable)
207 }),
208 },
209 ListAttestors: []gax.CallOption{
210 gax.WithTimeout(600000 * time.Millisecond),
211 gax.WithRetry(func() gax.Retryer {
212 return gax.OnHTTPCodes(gax.Backoff{
213 Initial: 100 * time.Millisecond,
214 Max: 60000 * time.Millisecond,
215 Multiplier: 1.30,
216 },
217 http.StatusGatewayTimeout,
218 http.StatusServiceUnavailable)
219 }),
220 },
221 DeleteAttestor: []gax.CallOption{
222 gax.WithTimeout(600000 * time.Millisecond),
223 gax.WithRetry(func() gax.Retryer {
224 return gax.OnHTTPCodes(gax.Backoff{
225 Initial: 100 * time.Millisecond,
226 Max: 60000 * time.Millisecond,
227 Multiplier: 1.30,
228 },
229 http.StatusGatewayTimeout,
230 http.StatusServiceUnavailable)
231 }),
232 },
233 }
234 }
235
236 // internalBinauthzManagementServiceV1Beta1Client is an interface that defines the methods available from Binary Authorization API.
237 type internalBinauthzManagementServiceV1Beta1Client interface {
238 Close() error
239 setGoogleClientInfo(...string)
240 Connection() *grpc.ClientConn
241 GetPolicy(context.Context, *binaryauthorizationpb.GetPolicyRequest, ...gax.CallOption) (*binaryauthorizationpb.Policy, error)
242 UpdatePolicy(context.Context, *binaryauthorizationpb.UpdatePolicyRequest, ...gax.CallOption) (*binaryauthorizationpb.Policy, error)
243 CreateAttestor(context.Context, *binaryauthorizationpb.CreateAttestorRequest, ...gax.CallOption) (*binaryauthorizationpb.Attestor, error)
244 GetAttestor(context.Context, *binaryauthorizationpb.GetAttestorRequest, ...gax.CallOption) (*binaryauthorizationpb.Attestor, error)
245 UpdateAttestor(context.Context, *binaryauthorizationpb.UpdateAttestorRequest, ...gax.CallOption) (*binaryauthorizationpb.Attestor, error)
246 ListAttestors(context.Context, *binaryauthorizationpb.ListAttestorsRequest, ...gax.CallOption) *AttestorIterator
247 DeleteAttestor(context.Context, *binaryauthorizationpb.DeleteAttestorRequest, ...gax.CallOption) error
248 }
249
250 // BinauthzManagementServiceV1Beta1Client is a client for interacting with Binary Authorization API.
251 // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
252 //
253 // Google Cloud Management Service for Binary Authorization admission policies
254 // and attestation authorities.
255 //
256 // This API implements a REST model with the following objects:
257 //
258 // Policy
259 //
260 // Attestor
261 type BinauthzManagementServiceV1Beta1Client struct {
262 // The internal transport-dependent client.
263 internalClient internalBinauthzManagementServiceV1Beta1Client
264
265 // The call options for this service.
266 CallOptions *BinauthzManagementServiceV1Beta1CallOptions
267 }
268
269 // Wrapper methods routed to the internal client.
270
271 // Close closes the connection to the API service. The user should invoke this when
272 // the client is no longer required.
273 func (c *BinauthzManagementServiceV1Beta1Client) Close() error {
274 return c.internalClient.Close()
275 }
276
277 // setGoogleClientInfo sets the name and version of the application in
278 // the `x-goog-api-client` header passed on each request. Intended for
279 // use by Google-written clients.
280 func (c *BinauthzManagementServiceV1Beta1Client) setGoogleClientInfo(keyval ...string) {
281 c.internalClient.setGoogleClientInfo(keyval...)
282 }
283
284 // Connection returns a connection to the API service.
285 //
286 // Deprecated: Connections are now pooled so this method does not always
287 // return the same resource.
288 func (c *BinauthzManagementServiceV1Beta1Client) Connection() *grpc.ClientConn {
289 return c.internalClient.Connection()
290 }
291
292 // GetPolicy a policy specifies the attestors that must attest to
293 // a container image, before the project is allowed to deploy that
294 // image. There is at most one policy per project. All image admission
295 // requests are permitted if a project has no policy.
296 //
297 // Gets the policy for this project. Returns a default
298 // policy if the project does not have one.
299 func (c *BinauthzManagementServiceV1Beta1Client) GetPolicy(ctx context.Context, req *binaryauthorizationpb.GetPolicyRequest, opts ...gax.CallOption) (*binaryauthorizationpb.Policy, error) {
300 return c.internalClient.GetPolicy(ctx, req, opts...)
301 }
302
303 // UpdatePolicy creates or updates a project’s policy, and returns a copy of the
304 // new policy. A policy is always updated as a whole, to avoid race
305 // conditions with concurrent policy enforcement (or management!)
306 // requests. Returns NOT_FOUND if the project does not exist, INVALID_ARGUMENT
307 // if the request is malformed.
308 func (c *BinauthzManagementServiceV1Beta1Client) UpdatePolicy(ctx context.Context, req *binaryauthorizationpb.UpdatePolicyRequest, opts ...gax.CallOption) (*binaryauthorizationpb.Policy, error) {
309 return c.internalClient.UpdatePolicy(ctx, req, opts...)
310 }
311
312 // CreateAttestor creates an attestor, and returns a copy of the new
313 // attestor. Returns NOT_FOUND if the project does not exist,
314 // INVALID_ARGUMENT if the request is malformed, ALREADY_EXISTS if the
315 // attestor already exists.
316 func (c *BinauthzManagementServiceV1Beta1Client) CreateAttestor(ctx context.Context, req *binaryauthorizationpb.CreateAttestorRequest, opts ...gax.CallOption) (*binaryauthorizationpb.Attestor, error) {
317 return c.internalClient.CreateAttestor(ctx, req, opts...)
318 }
319
320 // GetAttestor gets an attestor.
321 // Returns NOT_FOUND if the attestor does not exist.
322 func (c *BinauthzManagementServiceV1Beta1Client) GetAttestor(ctx context.Context, req *binaryauthorizationpb.GetAttestorRequest, opts ...gax.CallOption) (*binaryauthorizationpb.Attestor, error) {
323 return c.internalClient.GetAttestor(ctx, req, opts...)
324 }
325
326 // UpdateAttestor updates an attestor.
327 // Returns NOT_FOUND if the attestor does not exist.
328 func (c *BinauthzManagementServiceV1Beta1Client) UpdateAttestor(ctx context.Context, req *binaryauthorizationpb.UpdateAttestorRequest, opts ...gax.CallOption) (*binaryauthorizationpb.Attestor, error) {
329 return c.internalClient.UpdateAttestor(ctx, req, opts...)
330 }
331
332 // ListAttestors lists attestors.
333 // Returns INVALID_ARGUMENT if the project does not exist.
334 func (c *BinauthzManagementServiceV1Beta1Client) ListAttestors(ctx context.Context, req *binaryauthorizationpb.ListAttestorsRequest, opts ...gax.CallOption) *AttestorIterator {
335 return c.internalClient.ListAttestors(ctx, req, opts...)
336 }
337
338 // DeleteAttestor deletes an attestor. Returns NOT_FOUND if the
339 // attestor does not exist.
340 func (c *BinauthzManagementServiceV1Beta1Client) DeleteAttestor(ctx context.Context, req *binaryauthorizationpb.DeleteAttestorRequest, opts ...gax.CallOption) error {
341 return c.internalClient.DeleteAttestor(ctx, req, opts...)
342 }
343
344 // binauthzManagementServiceV1Beta1GRPCClient is a client for interacting with Binary Authorization API over gRPC transport.
345 //
346 // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
347 type binauthzManagementServiceV1Beta1GRPCClient struct {
348 // Connection pool of gRPC connections to the service.
349 connPool gtransport.ConnPool
350
351 // Points back to the CallOptions field of the containing BinauthzManagementServiceV1Beta1Client
352 CallOptions **BinauthzManagementServiceV1Beta1CallOptions
353
354 // The gRPC API client.
355 binauthzManagementServiceV1Beta1Client binaryauthorizationpb.BinauthzManagementServiceV1Beta1Client
356
357 // The x-goog-* metadata to be sent with each request.
358 xGoogHeaders []string
359
360 logger *slog.Logger
361 }
362
363 // NewBinauthzManagementServiceV1Beta1Client creates a new binauthz management service v1 beta1 client based on gRPC.
364 // The returned client must be Closed when it is done being used to clean up its underlying connections.
365 //
366 // Google Cloud Management Service for Binary Authorization admission policies
367 // and attestation authorities.
368 //
369 // This API implements a REST model with the following objects:
370 //
371 // Policy
372 //
373 // Attestor
374 func NewBinauthzManagementServiceV1Beta1Client(ctx context.Context, opts ...option.ClientOption) (*BinauthzManagementServiceV1Beta1Client, error) {
375 clientOpts := defaultBinauthzManagementServiceV1Beta1GRPCClientOptions()
376 if newBinauthzManagementServiceV1Beta1ClientHook != nil {
377 hookOpts, err := newBinauthzManagementServiceV1Beta1ClientHook(ctx, clientHookParams{})
378 if err != nil {
379 return nil, err
380 }
381 clientOpts = append(clientOpts, hookOpts...)
382 }
383
384 connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...)
385 if err != nil {
386 return nil, err
387 }
388 client := BinauthzManagementServiceV1Beta1Client{CallOptions: defaultBinauthzManagementServiceV1Beta1CallOptions()}
389
390 c := &binauthzManagementServiceV1Beta1GRPCClient{
391 connPool: connPool,
392 binauthzManagementServiceV1Beta1Client: binaryauthorizationpb.NewBinauthzManagementServiceV1Beta1Client(connPool),
393 CallOptions: &client.CallOptions,
394 logger: internaloption.GetLogger(opts),
395 }
396 c.setGoogleClientInfo()
397
398 client.internalClient = c
399
400 return &client, nil
401 }
402
403 // Connection returns a connection to the API service.
404 //
405 // Deprecated: Connections are now pooled so this method does not always
406 // return the same resource.
407 func (c *binauthzManagementServiceV1Beta1GRPCClient) Connection() *grpc.ClientConn {
408 return c.connPool.Conn()
409 }
410
411 // setGoogleClientInfo sets the name and version of the application in
412 // the `x-goog-api-client` header passed on each request. Intended for
413 // use by Google-written clients.
414 func (c *binauthzManagementServiceV1Beta1GRPCClient) setGoogleClientInfo(keyval ...string) {
415 kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
416 kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version, "pb", protoVersion)
417 c.xGoogHeaders = []string{
418 "x-goog-api-client", gax.XGoogHeader(kv...),
419 }
420 }
421
422 // Close closes the connection to the API service. The user should invoke this when
423 // the client is no longer required.
424 func (c *binauthzManagementServiceV1Beta1GRPCClient) Close() error {
425 return c.connPool.Close()
426 }
427
428 // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
429 type binauthzManagementServiceV1Beta1RESTClient struct {
430 // The http endpoint to connect to.
431 endpoint string
432
433 // The http client.
434 httpClient *http.Client
435
436 // The x-goog-* headers to be sent with each request.
437 xGoogHeaders []string
438
439 // Points back to the CallOptions field of the containing BinauthzManagementServiceV1Beta1Client
440 CallOptions **BinauthzManagementServiceV1Beta1CallOptions
441
442 logger *slog.Logger
443 }
444
445 // NewBinauthzManagementServiceV1Beta1RESTClient creates a new binauthz management service v1 beta1 rest client.
446 //
447 // Google Cloud Management Service for Binary Authorization admission policies
448 // and attestation authorities.
449 //
450 // This API implements a REST model with the following objects:
451 //
452 // Policy
453 //
454 // Attestor
455 func NewBinauthzManagementServiceV1Beta1RESTClient(ctx context.Context, opts ...option.ClientOption) (*BinauthzManagementServiceV1Beta1Client, error) {
456 clientOpts := append(defaultBinauthzManagementServiceV1Beta1RESTClientOptions(), opts...)
457 httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...)
458 if err != nil {
459 return nil, err
460 }
461
462 callOpts := defaultBinauthzManagementServiceV1Beta1RESTCallOptions()
463 c := &binauthzManagementServiceV1Beta1RESTClient{
464 endpoint: endpoint,
465 httpClient: httpClient,
466 CallOptions: &callOpts,
467 logger: internaloption.GetLogger(opts),
468 }
469 c.setGoogleClientInfo()
470
471 return &BinauthzManagementServiceV1Beta1Client{internalClient: c, CallOptions: callOpts}, nil
472 }
473
474 func defaultBinauthzManagementServiceV1Beta1RESTClientOptions() []option.ClientOption {
475 return []option.ClientOption{
476 internaloption.WithDefaultEndpoint("https://binaryauthorization.googleapis.com"),
477 internaloption.WithDefaultEndpointTemplate("https://binaryauthorization.UNIVERSE_DOMAIN"),
478 internaloption.WithDefaultMTLSEndpoint("https://binaryauthorization.mtls.googleapis.com"),
479 internaloption.WithDefaultUniverseDomain("googleapis.com"),
480 internaloption.WithDefaultAudience("https://binaryauthorization.googleapis.com/"),
481 internaloption.WithDefaultScopes(DefaultAuthScopes()...),
482 internaloption.EnableNewAuthLibrary(),
483 }
484 }
485
486 // setGoogleClientInfo sets the name and version of the application in
487 // the `x-goog-api-client` header passed on each request. Intended for
488 // use by Google-written clients.
489 func (c *binauthzManagementServiceV1Beta1RESTClient) setGoogleClientInfo(keyval ...string) {
490 kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
491 kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN", "pb", protoVersion)
492 c.xGoogHeaders = []string{
493 "x-goog-api-client", gax.XGoogHeader(kv...),
494 }
495 }
496
497 // Close closes the connection to the API service. The user should invoke this when
498 // the client is no longer required.
499 func (c *binauthzManagementServiceV1Beta1RESTClient) Close() error {
500 // Replace httpClient with nil to force cleanup.
501 c.httpClient = nil
502 return nil
503 }
504
505 // Connection returns a connection to the API service.
506 //
507 // Deprecated: This method always returns nil.
508 func (c *binauthzManagementServiceV1Beta1RESTClient) Connection() *grpc.ClientConn {
509 return nil
510 }
511 func (c *binauthzManagementServiceV1Beta1GRPCClient) GetPolicy(ctx context.Context, req *binaryauthorizationpb.GetPolicyRequest, opts ...gax.CallOption) (*binaryauthorizationpb.Policy, error) {
512 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
513
514 hds = append(c.xGoogHeaders, hds...)
515 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
516 opts = append((*c.CallOptions).GetPolicy[0:len((*c.CallOptions).GetPolicy):len((*c.CallOptions).GetPolicy)], opts...)
517 var resp *binaryauthorizationpb.Policy
518 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
519 var err error
520 resp, err = executeRPC(ctx, c.binauthzManagementServiceV1Beta1Client.GetPolicy, req, settings.GRPC, c.logger, "GetPolicy")
521 return err
522 }, opts...)
523 if err != nil {
524 return nil, err
525 }
526 return resp, nil
527 }
528
529 func (c *binauthzManagementServiceV1Beta1GRPCClient) UpdatePolicy(ctx context.Context, req *binaryauthorizationpb.UpdatePolicyRequest, opts ...gax.CallOption) (*binaryauthorizationpb.Policy, error) {
530 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "policy.name", url.QueryEscape(req.GetPolicy().GetName()))}
531
532 hds = append(c.xGoogHeaders, hds...)
533 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
534 opts = append((*c.CallOptions).UpdatePolicy[0:len((*c.CallOptions).UpdatePolicy):len((*c.CallOptions).UpdatePolicy)], opts...)
535 var resp *binaryauthorizationpb.Policy
536 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
537 var err error
538 resp, err = executeRPC(ctx, c.binauthzManagementServiceV1Beta1Client.UpdatePolicy, req, settings.GRPC, c.logger, "UpdatePolicy")
539 return err
540 }, opts...)
541 if err != nil {
542 return nil, err
543 }
544 return resp, nil
545 }
546
547 func (c *binauthzManagementServiceV1Beta1GRPCClient) CreateAttestor(ctx context.Context, req *binaryauthorizationpb.CreateAttestorRequest, opts ...gax.CallOption) (*binaryauthorizationpb.Attestor, error) {
548 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
549
550 hds = append(c.xGoogHeaders, hds...)
551 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
552 opts = append((*c.CallOptions).CreateAttestor[0:len((*c.CallOptions).CreateAttestor):len((*c.CallOptions).CreateAttestor)], opts...)
553 var resp *binaryauthorizationpb.Attestor
554 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
555 var err error
556 resp, err = executeRPC(ctx, c.binauthzManagementServiceV1Beta1Client.CreateAttestor, req, settings.GRPC, c.logger, "CreateAttestor")
557 return err
558 }, opts...)
559 if err != nil {
560 return nil, err
561 }
562 return resp, nil
563 }
564
565 func (c *binauthzManagementServiceV1Beta1GRPCClient) GetAttestor(ctx context.Context, req *binaryauthorizationpb.GetAttestorRequest, opts ...gax.CallOption) (*binaryauthorizationpb.Attestor, error) {
566 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
567
568 hds = append(c.xGoogHeaders, hds...)
569 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
570 opts = append((*c.CallOptions).GetAttestor[0:len((*c.CallOptions).GetAttestor):len((*c.CallOptions).GetAttestor)], opts...)
571 var resp *binaryauthorizationpb.Attestor
572 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
573 var err error
574 resp, err = executeRPC(ctx, c.binauthzManagementServiceV1Beta1Client.GetAttestor, req, settings.GRPC, c.logger, "GetAttestor")
575 return err
576 }, opts...)
577 if err != nil {
578 return nil, err
579 }
580 return resp, nil
581 }
582
583 func (c *binauthzManagementServiceV1Beta1GRPCClient) UpdateAttestor(ctx context.Context, req *binaryauthorizationpb.UpdateAttestorRequest, opts ...gax.CallOption) (*binaryauthorizationpb.Attestor, error) {
584 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "attestor.name", url.QueryEscape(req.GetAttestor().GetName()))}
585
586 hds = append(c.xGoogHeaders, hds...)
587 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
588 opts = append((*c.CallOptions).UpdateAttestor[0:len((*c.CallOptions).UpdateAttestor):len((*c.CallOptions).UpdateAttestor)], opts...)
589 var resp *binaryauthorizationpb.Attestor
590 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
591 var err error
592 resp, err = executeRPC(ctx, c.binauthzManagementServiceV1Beta1Client.UpdateAttestor, req, settings.GRPC, c.logger, "UpdateAttestor")
593 return err
594 }, opts...)
595 if err != nil {
596 return nil, err
597 }
598 return resp, nil
599 }
600
601 func (c *binauthzManagementServiceV1Beta1GRPCClient) ListAttestors(ctx context.Context, req *binaryauthorizationpb.ListAttestorsRequest, opts ...gax.CallOption) *AttestorIterator {
602 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
603
604 hds = append(c.xGoogHeaders, hds...)
605 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
606 opts = append((*c.CallOptions).ListAttestors[0:len((*c.CallOptions).ListAttestors):len((*c.CallOptions).ListAttestors)], opts...)
607 it := &AttestorIterator{}
608 req = proto.Clone(req).(*binaryauthorizationpb.ListAttestorsRequest)
609 it.InternalFetch = func(pageSize int, pageToken string) ([]*binaryauthorizationpb.Attestor, string, error) {
610 resp := &binaryauthorizationpb.ListAttestorsResponse{}
611 if pageToken != "" {
612 req.PageToken = pageToken
613 }
614 if pageSize > math.MaxInt32 {
615 req.PageSize = math.MaxInt32
616 } else if pageSize != 0 {
617 req.PageSize = int32(pageSize)
618 }
619 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
620 var err error
621 resp, err = executeRPC(ctx, c.binauthzManagementServiceV1Beta1Client.ListAttestors, req, settings.GRPC, c.logger, "ListAttestors")
622 return err
623 }, opts...)
624 if err != nil {
625 return nil, "", err
626 }
627
628 it.Response = resp
629 return resp.GetAttestors(), resp.GetNextPageToken(), nil
630 }
631 fetch := func(pageSize int, pageToken string) (string, error) {
632 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
633 if err != nil {
634 return "", err
635 }
636 it.items = append(it.items, items...)
637 return nextPageToken, nil
638 }
639
640 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
641 it.pageInfo.MaxSize = int(req.GetPageSize())
642 it.pageInfo.Token = req.GetPageToken()
643
644 return it
645 }
646
647 func (c *binauthzManagementServiceV1Beta1GRPCClient) DeleteAttestor(ctx context.Context, req *binaryauthorizationpb.DeleteAttestorRequest, opts ...gax.CallOption) error {
648 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
649
650 hds = append(c.xGoogHeaders, hds...)
651 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
652 opts = append((*c.CallOptions).DeleteAttestor[0:len((*c.CallOptions).DeleteAttestor):len((*c.CallOptions).DeleteAttestor)], opts...)
653 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
654 var err error
655 _, err = executeRPC(ctx, c.binauthzManagementServiceV1Beta1Client.DeleteAttestor, req, settings.GRPC, c.logger, "DeleteAttestor")
656 return err
657 }, opts...)
658 return err
659 }
660
661 // GetPolicy a policy specifies the attestors that must attest to
662 // a container image, before the project is allowed to deploy that
663 // image. There is at most one policy per project. All image admission
664 // requests are permitted if a project has no policy.
665 //
666 // Gets the policy for this project. Returns a default
667 // policy if the project does not have one.
668 func (c *binauthzManagementServiceV1Beta1RESTClient) GetPolicy(ctx context.Context, req *binaryauthorizationpb.GetPolicyRequest, opts ...gax.CallOption) (*binaryauthorizationpb.Policy, error) {
669 baseUrl, err := url.Parse(c.endpoint)
670 if err != nil {
671 return nil, err
672 }
673 baseUrl.Path += fmt.Sprintf("/v1beta1/%v", req.GetName())
674
675 params := url.Values{}
676 params.Add("$alt", "json;enum-encoding=int")
677
678 baseUrl.RawQuery = params.Encode()
679
680 // Build HTTP headers from client and context metadata.
681 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
682
683 hds = append(c.xGoogHeaders, hds...)
684 hds = append(hds, "Content-Type", "application/json")
685 headers := gax.BuildHeaders(ctx, hds...)
686 opts = append((*c.CallOptions).GetPolicy[0:len((*c.CallOptions).GetPolicy):len((*c.CallOptions).GetPolicy)], opts...)
687 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
688 resp := &binaryauthorizationpb.Policy{}
689 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
690 if settings.Path != "" {
691 baseUrl.Path = settings.Path
692 }
693 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
694 if err != nil {
695 return err
696 }
697 httpReq = httpReq.WithContext(ctx)
698 httpReq.Header = headers
699
700 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetPolicy")
701 if err != nil {
702 return err
703 }
704
705 if err := unm.Unmarshal(buf, resp); err != nil {
706 return err
707 }
708
709 return nil
710 }, opts...)
711 if e != nil {
712 return nil, e
713 }
714 return resp, nil
715 }
716
717 // UpdatePolicy creates or updates a project’s policy, and returns a copy of the
718 // new policy. A policy is always updated as a whole, to avoid race
719 // conditions with concurrent policy enforcement (or management!)
720 // requests. Returns NOT_FOUND if the project does not exist, INVALID_ARGUMENT
721 // if the request is malformed.
722 func (c *binauthzManagementServiceV1Beta1RESTClient) UpdatePolicy(ctx context.Context, req *binaryauthorizationpb.UpdatePolicyRequest, opts ...gax.CallOption) (*binaryauthorizationpb.Policy, error) {
723 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
724 body := req.GetPolicy()
725 jsonReq, err := m.Marshal(body)
726 if err != nil {
727 return nil, err
728 }
729
730 baseUrl, err := url.Parse(c.endpoint)
731 if err != nil {
732 return nil, err
733 }
734 baseUrl.Path += fmt.Sprintf("/v1beta1/%v", req.GetPolicy().GetName())
735
736 params := url.Values{}
737 params.Add("$alt", "json;enum-encoding=int")
738
739 baseUrl.RawQuery = params.Encode()
740
741 // Build HTTP headers from client and context metadata.
742 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "policy.name", url.QueryEscape(req.GetPolicy().GetName()))}
743
744 hds = append(c.xGoogHeaders, hds...)
745 hds = append(hds, "Content-Type", "application/json")
746 headers := gax.BuildHeaders(ctx, hds...)
747 opts = append((*c.CallOptions).UpdatePolicy[0:len((*c.CallOptions).UpdatePolicy):len((*c.CallOptions).UpdatePolicy)], opts...)
748 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
749 resp := &binaryauthorizationpb.Policy{}
750 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
751 if settings.Path != "" {
752 baseUrl.Path = settings.Path
753 }
754 httpReq, err := http.NewRequest("PUT", baseUrl.String(), bytes.NewReader(jsonReq))
755 if err != nil {
756 return err
757 }
758 httpReq = httpReq.WithContext(ctx)
759 httpReq.Header = headers
760
761 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UpdatePolicy")
762 if err != nil {
763 return err
764 }
765
766 if err := unm.Unmarshal(buf, resp); err != nil {
767 return err
768 }
769
770 return nil
771 }, opts...)
772 if e != nil {
773 return nil, e
774 }
775 return resp, nil
776 }
777
778 // CreateAttestor creates an attestor, and returns a copy of the new
779 // attestor. Returns NOT_FOUND if the project does not exist,
780 // INVALID_ARGUMENT if the request is malformed, ALREADY_EXISTS if the
781 // attestor already exists.
782 func (c *binauthzManagementServiceV1Beta1RESTClient) CreateAttestor(ctx context.Context, req *binaryauthorizationpb.CreateAttestorRequest, opts ...gax.CallOption) (*binaryauthorizationpb.Attestor, error) {
783 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
784 body := req.GetAttestor()
785 jsonReq, err := m.Marshal(body)
786 if err != nil {
787 return nil, err
788 }
789
790 baseUrl, err := url.Parse(c.endpoint)
791 if err != nil {
792 return nil, err
793 }
794 baseUrl.Path += fmt.Sprintf("/v1beta1/%v/attestors", req.GetParent())
795
796 params := url.Values{}
797 params.Add("$alt", "json;enum-encoding=int")
798 params.Add("attestorId", fmt.Sprintf("%v", req.GetAttestorId()))
799
800 baseUrl.RawQuery = params.Encode()
801
802 // Build HTTP headers from client and context metadata.
803 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
804
805 hds = append(c.xGoogHeaders, hds...)
806 hds = append(hds, "Content-Type", "application/json")
807 headers := gax.BuildHeaders(ctx, hds...)
808 opts = append((*c.CallOptions).CreateAttestor[0:len((*c.CallOptions).CreateAttestor):len((*c.CallOptions).CreateAttestor)], opts...)
809 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
810 resp := &binaryauthorizationpb.Attestor{}
811 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
812 if settings.Path != "" {
813 baseUrl.Path = settings.Path
814 }
815 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
816 if err != nil {
817 return err
818 }
819 httpReq = httpReq.WithContext(ctx)
820 httpReq.Header = headers
821
822 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreateAttestor")
823 if err != nil {
824 return err
825 }
826
827 if err := unm.Unmarshal(buf, resp); err != nil {
828 return err
829 }
830
831 return nil
832 }, opts...)
833 if e != nil {
834 return nil, e
835 }
836 return resp, nil
837 }
838
839 // GetAttestor gets an attestor.
840 // Returns NOT_FOUND if the attestor does not exist.
841 func (c *binauthzManagementServiceV1Beta1RESTClient) GetAttestor(ctx context.Context, req *binaryauthorizationpb.GetAttestorRequest, opts ...gax.CallOption) (*binaryauthorizationpb.Attestor, error) {
842 baseUrl, err := url.Parse(c.endpoint)
843 if err != nil {
844 return nil, err
845 }
846 baseUrl.Path += fmt.Sprintf("/v1beta1/%v", req.GetName())
847
848 params := url.Values{}
849 params.Add("$alt", "json;enum-encoding=int")
850
851 baseUrl.RawQuery = params.Encode()
852
853 // Build HTTP headers from client and context metadata.
854 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
855
856 hds = append(c.xGoogHeaders, hds...)
857 hds = append(hds, "Content-Type", "application/json")
858 headers := gax.BuildHeaders(ctx, hds...)
859 opts = append((*c.CallOptions).GetAttestor[0:len((*c.CallOptions).GetAttestor):len((*c.CallOptions).GetAttestor)], opts...)
860 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
861 resp := &binaryauthorizationpb.Attestor{}
862 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
863 if settings.Path != "" {
864 baseUrl.Path = settings.Path
865 }
866 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
867 if err != nil {
868 return err
869 }
870 httpReq = httpReq.WithContext(ctx)
871 httpReq.Header = headers
872
873 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetAttestor")
874 if err != nil {
875 return err
876 }
877
878 if err := unm.Unmarshal(buf, resp); err != nil {
879 return err
880 }
881
882 return nil
883 }, opts...)
884 if e != nil {
885 return nil, e
886 }
887 return resp, nil
888 }
889
890 // UpdateAttestor updates an attestor.
891 // Returns NOT_FOUND if the attestor does not exist.
892 func (c *binauthzManagementServiceV1Beta1RESTClient) UpdateAttestor(ctx context.Context, req *binaryauthorizationpb.UpdateAttestorRequest, opts ...gax.CallOption) (*binaryauthorizationpb.Attestor, error) {
893 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
894 body := req.GetAttestor()
895 jsonReq, err := m.Marshal(body)
896 if err != nil {
897 return nil, err
898 }
899
900 baseUrl, err := url.Parse(c.endpoint)
901 if err != nil {
902 return nil, err
903 }
904 baseUrl.Path += fmt.Sprintf("/v1beta1/%v", req.GetAttestor().GetName())
905
906 params := url.Values{}
907 params.Add("$alt", "json;enum-encoding=int")
908
909 baseUrl.RawQuery = params.Encode()
910
911 // Build HTTP headers from client and context metadata.
912 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "attestor.name", url.QueryEscape(req.GetAttestor().GetName()))}
913
914 hds = append(c.xGoogHeaders, hds...)
915 hds = append(hds, "Content-Type", "application/json")
916 headers := gax.BuildHeaders(ctx, hds...)
917 opts = append((*c.CallOptions).UpdateAttestor[0:len((*c.CallOptions).UpdateAttestor):len((*c.CallOptions).UpdateAttestor)], opts...)
918 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
919 resp := &binaryauthorizationpb.Attestor{}
920 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
921 if settings.Path != "" {
922 baseUrl.Path = settings.Path
923 }
924 httpReq, err := http.NewRequest("PUT", baseUrl.String(), bytes.NewReader(jsonReq))
925 if err != nil {
926 return err
927 }
928 httpReq = httpReq.WithContext(ctx)
929 httpReq.Header = headers
930
931 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "UpdateAttestor")
932 if err != nil {
933 return err
934 }
935
936 if err := unm.Unmarshal(buf, resp); err != nil {
937 return err
938 }
939
940 return nil
941 }, opts...)
942 if e != nil {
943 return nil, e
944 }
945 return resp, nil
946 }
947
948 // ListAttestors lists attestors.
949 // Returns INVALID_ARGUMENT if the project does not exist.
950 func (c *binauthzManagementServiceV1Beta1RESTClient) ListAttestors(ctx context.Context, req *binaryauthorizationpb.ListAttestorsRequest, opts ...gax.CallOption) *AttestorIterator {
951 it := &AttestorIterator{}
952 req = proto.Clone(req).(*binaryauthorizationpb.ListAttestorsRequest)
953 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
954 it.InternalFetch = func(pageSize int, pageToken string) ([]*binaryauthorizationpb.Attestor, string, error) {
955 resp := &binaryauthorizationpb.ListAttestorsResponse{}
956 if pageToken != "" {
957 req.PageToken = pageToken
958 }
959 if pageSize > math.MaxInt32 {
960 req.PageSize = math.MaxInt32
961 } else if pageSize != 0 {
962 req.PageSize = int32(pageSize)
963 }
964 baseUrl, err := url.Parse(c.endpoint)
965 if err != nil {
966 return nil, "", err
967 }
968 baseUrl.Path += fmt.Sprintf("/v1beta1/%v/attestors", req.GetParent())
969
970 params := url.Values{}
971 params.Add("$alt", "json;enum-encoding=int")
972 if req.GetPageSize() != 0 {
973 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
974 }
975 if req.GetPageToken() != "" {
976 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
977 }
978
979 baseUrl.RawQuery = params.Encode()
980
981 // Build HTTP headers from client and context metadata.
982 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
983 headers := gax.BuildHeaders(ctx, hds...)
984 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
985 if settings.Path != "" {
986 baseUrl.Path = settings.Path
987 }
988 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
989 if err != nil {
990 return err
991 }
992 httpReq.Header = headers
993
994 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListAttestors")
995 if err != nil {
996 return err
997 }
998 if err := unm.Unmarshal(buf, resp); err != nil {
999 return err
1000 }
1001
1002 return nil
1003 }, opts...)
1004 if e != nil {
1005 return nil, "", e
1006 }
1007 it.Response = resp
1008 return resp.GetAttestors(), resp.GetNextPageToken(), nil
1009 }
1010
1011 fetch := func(pageSize int, pageToken string) (string, error) {
1012 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
1013 if err != nil {
1014 return "", err
1015 }
1016 it.items = append(it.items, items...)
1017 return nextPageToken, nil
1018 }
1019
1020 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
1021 it.pageInfo.MaxSize = int(req.GetPageSize())
1022 it.pageInfo.Token = req.GetPageToken()
1023
1024 return it
1025 }
1026
1027 // DeleteAttestor deletes an attestor. Returns NOT_FOUND if the
1028 // attestor does not exist.
1029 func (c *binauthzManagementServiceV1Beta1RESTClient) DeleteAttestor(ctx context.Context, req *binaryauthorizationpb.DeleteAttestorRequest, opts ...gax.CallOption) error {
1030 baseUrl, err := url.Parse(c.endpoint)
1031 if err != nil {
1032 return err
1033 }
1034 baseUrl.Path += fmt.Sprintf("/v1beta1/%v", req.GetName())
1035
1036 params := url.Values{}
1037 params.Add("$alt", "json;enum-encoding=int")
1038
1039 baseUrl.RawQuery = params.Encode()
1040
1041 // Build HTTP headers from client and context metadata.
1042 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1043
1044 hds = append(c.xGoogHeaders, hds...)
1045 hds = append(hds, "Content-Type", "application/json")
1046 headers := gax.BuildHeaders(ctx, hds...)
1047 return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1048 if settings.Path != "" {
1049 baseUrl.Path = settings.Path
1050 }
1051 httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil)
1052 if err != nil {
1053 return err
1054 }
1055 httpReq = httpReq.WithContext(ctx)
1056 httpReq.Header = headers
1057
1058 _, err = executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteAttestor")
1059 return err
1060 }, opts...)
1061 }