Debian Codegraph @

networkservices/v1/networkservices-gen.go

raw symbols SCIP
1 // Copyright 2026 Google LLC.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 // Code generated file. DO NOT EDIT.
6
7 // Package networkservices provides access to the Network Services API.
8 //
9 // For product documentation, see: https://cloud.google.com/networking
10 //
11 // # Library status
12 //
13 // These client libraries are officially supported by Google. However, this
14 // library is considered complete and is in maintenance mode. This means
15 // that we will address critical bugs and security issues but will not add
16 // any new features.
17 //
18 // When possible, we recommend using our newer
19 // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
20 // that are still actively being worked and iterated on.
21 //
22 // # Creating a client
23 //
24 // Usage example:
25 //
26 // import "google.golang.org/api/networkservices/v1"
27 // ...
28 // ctx := context.Background()
29 // networkservicesService, err := networkservices.NewService(ctx)
30 //
31 // In this example, Google Application Default Credentials are used for
32 // authentication. For information on how to create and obtain Application
33 // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
34 //
35 // # Other authentication options
36 //
37 // To use an API key for authentication (note: some APIs do not support API
38 // keys), use [google.golang.org/api/option.WithAPIKey]:
39 //
40 // networkservicesService, err := networkservices.NewService(ctx, option.WithAPIKey("AIza..."))
41 //
42 // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
43 // flow, use [google.golang.org/api/option.WithTokenSource]:
44 //
45 // config := &oauth2.Config{...}
46 // // ...
47 // token, err := config.Exchange(ctx, ...)
48 // networkservicesService, err := networkservices.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
49 //
50 // See [google.golang.org/api/option.ClientOption] for details on options.
51 package networkservices // import "google.golang.org/api/networkservices/v1"
52
53 import (
54 "bytes"
55 "context"
56 "encoding/json"
57 "errors"
58 "fmt"
59 "io"
60 "log/slog"
61 "net/http"
62 "net/url"
63 "strconv"
64 "strings"
65
66 "github.com/googleapis/gax-go/v2/internallog"
67 googleapi "google.golang.org/api/googleapi"
68 internal "google.golang.org/api/internal"
69 gensupport "google.golang.org/api/internal/gensupport"
70 option "google.golang.org/api/option"
71 internaloption "google.golang.org/api/option/internaloption"
72 htransport "google.golang.org/api/transport/http"
73 )
74
75 // Always reference these packages, just in case the auto-generated code
76 // below doesn't.
77 var _ = bytes.NewBuffer
78 var _ = strconv.Itoa
79 var _ = fmt.Sprintf
80 var _ = json.NewDecoder
81 var _ = io.Copy
82 var _ = url.Parse
83 var _ = gensupport.MarshalJSON
84 var _ = googleapi.Version
85 var _ = errors.New
86 var _ = strings.Replace
87 var _ = context.Canceled
88 var _ = internaloption.WithDefaultEndpoint
89 var _ = internal.Version
90 var _ = internallog.New
91
92 const apiId = "networkservices:v1"
93 const apiName = "networkservices"
94 const apiVersion = "v1"
95 const basePath = "https://networkservices.googleapis.com/"
96 const basePathTemplate = "https://networkservices.UNIVERSE_DOMAIN/"
97 const mtlsBasePath = "https://networkservices.mtls.googleapis.com/"
98
99 // OAuth2 scopes used by this API.
100 const (
101 // See, edit, configure, and delete your Google Cloud data and see the email
102 // address for your Google Account.
103 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
104 )
105
106 // NewService creates a new Service.
107 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
108 scopesOption := internaloption.WithDefaultScopes(
109 "https://www.googleapis.com/auth/cloud-platform",
110 )
111 // NOTE: prepend, so we don't override user-specified scopes.
112 opts = append([]option.ClientOption{scopesOption}, opts...)
113 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
114 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
115 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
116 opts = append(opts, internaloption.EnableNewAuthLibrary())
117 client, endpoint, err := htransport.NewClient(ctx, opts...)
118 if err != nil {
119 return nil, err
120 }
121 s := &Service{client: client, BasePath: basePath, logger: internaloption.GetLogger(opts)}
122 s.Projects = NewProjectsService(s)
123 if endpoint != "" {
124 s.BasePath = endpoint
125 }
126 return s, nil
127 }
128
129 // New creates a new Service. It uses the provided http.Client for requests.
130 //
131 // Deprecated: please use NewService instead.
132 // To provide a custom HTTP client, use option.WithHTTPClient.
133 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
134 func New(client *http.Client) (*Service, error) {
135 if client == nil {
136 return nil, errors.New("client is nil")
137 }
138 return NewService(context.TODO(), option.WithHTTPClient(client))
139 }
140
141 type Service struct {
142 client *http.Client
143 logger *slog.Logger
144 BasePath string // API endpoint base URL
145 UserAgent string // optional additional User-Agent fragment
146
147 Projects *ProjectsService
148 }
149
150 func (s *Service) userAgent() string {
151 if s.UserAgent == "" {
152 return googleapi.UserAgent
153 }
154 return googleapi.UserAgent + " " + s.UserAgent
155 }
156
157 func NewProjectsService(s *Service) *ProjectsService {
158 rs := &ProjectsService{s: s}
159 rs.Locations = NewProjectsLocationsService(s)
160 return rs
161 }
162
163 type ProjectsService struct {
164 s *Service
165
166 Locations *ProjectsLocationsService
167 }
168
169 func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
170 rs := &ProjectsLocationsService{s: s}
171 rs.AuthzExtensions = NewProjectsLocationsAuthzExtensionsService(s)
172 rs.EdgeCacheKeysets = NewProjectsLocationsEdgeCacheKeysetsService(s)
173 rs.EdgeCacheOrigins = NewProjectsLocationsEdgeCacheOriginsService(s)
174 rs.EdgeCacheServices = NewProjectsLocationsEdgeCacheServicesService(s)
175 rs.EndpointPolicies = NewProjectsLocationsEndpointPoliciesService(s)
176 rs.Gateways = NewProjectsLocationsGatewaysService(s)
177 rs.GrpcRoutes = NewProjectsLocationsGrpcRoutesService(s)
178 rs.HttpRoutes = NewProjectsLocationsHttpRoutesService(s)
179 rs.LbEdgeExtensions = NewProjectsLocationsLbEdgeExtensionsService(s)
180 rs.LbRouteExtensions = NewProjectsLocationsLbRouteExtensionsService(s)
181 rs.LbTrafficExtensions = NewProjectsLocationsLbTrafficExtensionsService(s)
182 rs.Meshes = NewProjectsLocationsMeshesService(s)
183 rs.Operations = NewProjectsLocationsOperationsService(s)
184 rs.ServiceBindings = NewProjectsLocationsServiceBindingsService(s)
185 rs.ServiceLbPolicies = NewProjectsLocationsServiceLbPoliciesService(s)
186 rs.TcpRoutes = NewProjectsLocationsTcpRoutesService(s)
187 rs.TlsRoutes = NewProjectsLocationsTlsRoutesService(s)
188 rs.WasmPlugins = NewProjectsLocationsWasmPluginsService(s)
189 return rs
190 }
191
192 type ProjectsLocationsService struct {
193 s *Service
194
195 AuthzExtensions *ProjectsLocationsAuthzExtensionsService
196
197 EdgeCacheKeysets *ProjectsLocationsEdgeCacheKeysetsService
198
199 EdgeCacheOrigins *ProjectsLocationsEdgeCacheOriginsService
200
201 EdgeCacheServices *ProjectsLocationsEdgeCacheServicesService
202
203 EndpointPolicies *ProjectsLocationsEndpointPoliciesService
204
205 Gateways *ProjectsLocationsGatewaysService
206
207 GrpcRoutes *ProjectsLocationsGrpcRoutesService
208
209 HttpRoutes *ProjectsLocationsHttpRoutesService
210
211 LbEdgeExtensions *ProjectsLocationsLbEdgeExtensionsService
212
213 LbRouteExtensions *ProjectsLocationsLbRouteExtensionsService
214
215 LbTrafficExtensions *ProjectsLocationsLbTrafficExtensionsService
216
217 Meshes *ProjectsLocationsMeshesService
218
219 Operations *ProjectsLocationsOperationsService
220
221 ServiceBindings *ProjectsLocationsServiceBindingsService
222
223 ServiceLbPolicies *ProjectsLocationsServiceLbPoliciesService
224
225 TcpRoutes *ProjectsLocationsTcpRoutesService
226
227 TlsRoutes *ProjectsLocationsTlsRoutesService
228
229 WasmPlugins *ProjectsLocationsWasmPluginsService
230 }
231
232 func NewProjectsLocationsAuthzExtensionsService(s *Service) *ProjectsLocationsAuthzExtensionsService {
233 rs := &ProjectsLocationsAuthzExtensionsService{s: s}
234 return rs
235 }
236
237 type ProjectsLocationsAuthzExtensionsService struct {
238 s *Service
239 }
240
241 func NewProjectsLocationsEdgeCacheKeysetsService(s *Service) *ProjectsLocationsEdgeCacheKeysetsService {
242 rs := &ProjectsLocationsEdgeCacheKeysetsService{s: s}
243 return rs
244 }
245
246 type ProjectsLocationsEdgeCacheKeysetsService struct {
247 s *Service
248 }
249
250 func NewProjectsLocationsEdgeCacheOriginsService(s *Service) *ProjectsLocationsEdgeCacheOriginsService {
251 rs := &ProjectsLocationsEdgeCacheOriginsService{s: s}
252 return rs
253 }
254
255 type ProjectsLocationsEdgeCacheOriginsService struct {
256 s *Service
257 }
258
259 func NewProjectsLocationsEdgeCacheServicesService(s *Service) *ProjectsLocationsEdgeCacheServicesService {
260 rs := &ProjectsLocationsEdgeCacheServicesService{s: s}
261 return rs
262 }
263
264 type ProjectsLocationsEdgeCacheServicesService struct {
265 s *Service
266 }
267
268 func NewProjectsLocationsEndpointPoliciesService(s *Service) *ProjectsLocationsEndpointPoliciesService {
269 rs := &ProjectsLocationsEndpointPoliciesService{s: s}
270 return rs
271 }
272
273 type ProjectsLocationsEndpointPoliciesService struct {
274 s *Service
275 }
276
277 func NewProjectsLocationsGatewaysService(s *Service) *ProjectsLocationsGatewaysService {
278 rs := &ProjectsLocationsGatewaysService{s: s}
279 rs.RouteViews = NewProjectsLocationsGatewaysRouteViewsService(s)
280 return rs
281 }
282
283 type ProjectsLocationsGatewaysService struct {
284 s *Service
285
286 RouteViews *ProjectsLocationsGatewaysRouteViewsService
287 }
288
289 func NewProjectsLocationsGatewaysRouteViewsService(s *Service) *ProjectsLocationsGatewaysRouteViewsService {
290 rs := &ProjectsLocationsGatewaysRouteViewsService{s: s}
291 return rs
292 }
293
294 type ProjectsLocationsGatewaysRouteViewsService struct {
295 s *Service
296 }
297
298 func NewProjectsLocationsGrpcRoutesService(s *Service) *ProjectsLocationsGrpcRoutesService {
299 rs := &ProjectsLocationsGrpcRoutesService{s: s}
300 return rs
301 }
302
303 type ProjectsLocationsGrpcRoutesService struct {
304 s *Service
305 }
306
307 func NewProjectsLocationsHttpRoutesService(s *Service) *ProjectsLocationsHttpRoutesService {
308 rs := &ProjectsLocationsHttpRoutesService{s: s}
309 return rs
310 }
311
312 type ProjectsLocationsHttpRoutesService struct {
313 s *Service
314 }
315
316 func NewProjectsLocationsLbEdgeExtensionsService(s *Service) *ProjectsLocationsLbEdgeExtensionsService {
317 rs := &ProjectsLocationsLbEdgeExtensionsService{s: s}
318 return rs
319 }
320
321 type ProjectsLocationsLbEdgeExtensionsService struct {
322 s *Service
323 }
324
325 func NewProjectsLocationsLbRouteExtensionsService(s *Service) *ProjectsLocationsLbRouteExtensionsService {
326 rs := &ProjectsLocationsLbRouteExtensionsService{s: s}
327 return rs
328 }
329
330 type ProjectsLocationsLbRouteExtensionsService struct {
331 s *Service
332 }
333
334 func NewProjectsLocationsLbTrafficExtensionsService(s *Service) *ProjectsLocationsLbTrafficExtensionsService {
335 rs := &ProjectsLocationsLbTrafficExtensionsService{s: s}
336 return rs
337 }
338
339 type ProjectsLocationsLbTrafficExtensionsService struct {
340 s *Service
341 }
342
343 func NewProjectsLocationsMeshesService(s *Service) *ProjectsLocationsMeshesService {
344 rs := &ProjectsLocationsMeshesService{s: s}
345 rs.RouteViews = NewProjectsLocationsMeshesRouteViewsService(s)
346 return rs
347 }
348
349 type ProjectsLocationsMeshesService struct {
350 s *Service
351
352 RouteViews *ProjectsLocationsMeshesRouteViewsService
353 }
354
355 func NewProjectsLocationsMeshesRouteViewsService(s *Service) *ProjectsLocationsMeshesRouteViewsService {
356 rs := &ProjectsLocationsMeshesRouteViewsService{s: s}
357 return rs
358 }
359
360 type ProjectsLocationsMeshesRouteViewsService struct {
361 s *Service
362 }
363
364 func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
365 rs := &ProjectsLocationsOperationsService{s: s}
366 return rs
367 }
368
369 type ProjectsLocationsOperationsService struct {
370 s *Service
371 }
372
373 func NewProjectsLocationsServiceBindingsService(s *Service) *ProjectsLocationsServiceBindingsService {
374 rs := &ProjectsLocationsServiceBindingsService{s: s}
375 return rs
376 }
377
378 type ProjectsLocationsServiceBindingsService struct {
379 s *Service
380 }
381
382 func NewProjectsLocationsServiceLbPoliciesService(s *Service) *ProjectsLocationsServiceLbPoliciesService {
383 rs := &ProjectsLocationsServiceLbPoliciesService{s: s}
384 return rs
385 }
386
387 type ProjectsLocationsServiceLbPoliciesService struct {
388 s *Service
389 }
390
391 func NewProjectsLocationsTcpRoutesService(s *Service) *ProjectsLocationsTcpRoutesService {
392 rs := &ProjectsLocationsTcpRoutesService{s: s}
393 return rs
394 }
395
396 type ProjectsLocationsTcpRoutesService struct {
397 s *Service
398 }
399
400 func NewProjectsLocationsTlsRoutesService(s *Service) *ProjectsLocationsTlsRoutesService {
401 rs := &ProjectsLocationsTlsRoutesService{s: s}
402 return rs
403 }
404
405 type ProjectsLocationsTlsRoutesService struct {
406 s *Service
407 }
408
409 func NewProjectsLocationsWasmPluginsService(s *Service) *ProjectsLocationsWasmPluginsService {
410 rs := &ProjectsLocationsWasmPluginsService{s: s}
411 rs.Versions = NewProjectsLocationsWasmPluginsVersionsService(s)
412 return rs
413 }
414
415 type ProjectsLocationsWasmPluginsService struct {
416 s *Service
417
418 Versions *ProjectsLocationsWasmPluginsVersionsService
419 }
420
421 func NewProjectsLocationsWasmPluginsVersionsService(s *Service) *ProjectsLocationsWasmPluginsVersionsService {
422 rs := &ProjectsLocationsWasmPluginsVersionsService{s: s}
423 return rs
424 }
425
426 type ProjectsLocationsWasmPluginsVersionsService struct {
427 s *Service
428 }
429
430 // AuditConfig: Specifies the audit configuration for a service. The
431 // configuration determines which permission types are logged, and what
432 // identities, if any, are exempted from logging. An AuditConfig must have one
433 // or more AuditLogConfigs. If there are AuditConfigs for both `allServices`
434 // and a specific service, the union of the two AuditConfigs is used for that
435 // service: the log_types specified in each AuditConfig are enabled, and the
436 // exempted_members in each AuditLogConfig are exempted. Example Policy with
437 // multiple AuditConfigs: { "audit_configs": [ { "service": "allServices",
438 // "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [
439 // "user:[email protected]" ] }, { "log_type": "DATA_WRITE" }, { "log_type":
440 // "ADMIN_READ" } ] }, { "service": "sampleservice.googleapis.com",
441 // "audit_log_configs": [ { "log_type": "DATA_READ" }, { "log_type":
442 // "DATA_WRITE", "exempted_members": [ "user:[email protected]" ] } ] } ] } For
443 // sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ
444 // logging. It also exempts `[email protected]` from DATA_READ logging, and
445 // `[email protected]` from DATA_WRITE logging.
446 type AuditConfig struct {
447 // AuditLogConfigs: The configuration for logging of each type of permission.
448 AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
449 // Service: Specifies a service that will be enabled for audit logging. For
450 // example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices`
451 // is a special value that covers all services.
452 Service string `json:"service,omitempty"`
453 // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to
454 // unconditionally include in API requests. By default, fields with empty or
455 // default values are omitted from API requests. See
456 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
457 // details.
458 ForceSendFields []string `json:"-"`
459 // NullFields is a list of field names (e.g. "AuditLogConfigs") to include in
460 // API requests with the JSON null value. By default, fields with empty values
461 // are omitted from API requests. See
462 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
463 NullFields []string `json:"-"`
464 }
465
466 func (s AuditConfig) MarshalJSON() ([]byte, error) {
467 type NoMethod AuditConfig
468 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
469 }
470
471 // AuditLogConfig: Provides the configuration for logging a type of
472 // permissions. Example: { "audit_log_configs": [ { "log_type": "DATA_READ",
473 // "exempted_members": [ "user:[email protected]" ] }, { "log_type":
474 // "DATA_WRITE" } ] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while
475 // exempting [email protected] from DATA_READ logging.
476 type AuditLogConfig struct {
477 // ExemptedMembers: Specifies the identities that do not cause logging for this
478 // type of permission. Follows the same format of Binding.members.
479 ExemptedMembers []string `json:"exemptedMembers,omitempty"`
480 // LogType: The log type that this config enables.
481 //
482 // Possible values:
483 // "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this.
484 // "ADMIN_READ" - Admin reads. Example: CloudIAM getIamPolicy
485 // "DATA_WRITE" - Data writes. Example: CloudSQL Users create
486 // "DATA_READ" - Data reads. Example: CloudSQL Users list
487 LogType string `json:"logType,omitempty"`
488 // ForceSendFields is a list of field names (e.g. "ExemptedMembers") to
489 // unconditionally include in API requests. By default, fields with empty or
490 // default values are omitted from API requests. See
491 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
492 // details.
493 ForceSendFields []string `json:"-"`
494 // NullFields is a list of field names (e.g. "ExemptedMembers") to include in
495 // API requests with the JSON null value. By default, fields with empty values
496 // are omitted from API requests. See
497 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
498 NullFields []string `json:"-"`
499 }
500
501 func (s AuditLogConfig) MarshalJSON() ([]byte, error) {
502 type NoMethod AuditLogConfig
503 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
504 }
505
506 // AuthzExtension: `AuthzExtension` is a resource that allows traffic
507 // forwarding to a callout backend service to make an authorization decision.
508 type AuthzExtension struct {
509 // Authority: Optional. The `:authority` header in the gRPC request sent from
510 // Envoy to the extension service. It is required when the `service` field
511 // points to a backend service or a wasm plugin.
512 Authority string `json:"authority,omitempty"`
513 // CreateTime: Output only. The timestamp when the resource was created.
514 CreateTime string `json:"createTime,omitempty"`
515 // Description: Optional. A human-readable description of the resource.
516 Description string `json:"description,omitempty"`
517 // FailOpen: Optional. Determines how the proxy behaves if the call to the
518 // extension fails or times out. When set to `TRUE`, request or response
519 // processing continues without error. Any subsequent extensions in the
520 // extension chain are also executed. When set to `FALSE` or the default
521 // setting of `FALSE` is used, one of the following happens: * If response
522 // headers have not been delivered to the downstream client, a generic 500
523 // error is returned to the client. The error response can be tailored by
524 // configuring a custom error response in the load balancer. * If response
525 // headers have been delivered, then the HTTP stream to the downstream client
526 // is reset.
527 FailOpen bool `json:"failOpen,omitempty"`
528 // ForwardAttributes: Optional. List of the Envoy attributes to forward to the
529 // extension server. The attributes provided here are included as part of the
530 // `ProcessingRequest.attributes` field (of type `map`), where the keys are the
531 // attribute names. Refer to the documentation
532 // (https://cloud.google.com/service-extensions/docs/cel-matcher-language-reference#attributes)
533 // for the names of attributes that can be forwarded. If omitted, no attributes
534 // are sent. Each element is a string indicating the attribute name.
535 ForwardAttributes []string `json:"forwardAttributes,omitempty"`
536 // ForwardHeaders: Optional. List of the HTTP headers to forward to the
537 // extension (from the client). If omitted, all headers are sent. Each element
538 // is a string indicating the header name.
539 ForwardHeaders []string `json:"forwardHeaders,omitempty"`
540 // Labels: Optional. Set of labels associated with the `AuthzExtension`
541 // resource. The format must comply with the requirements for labels
542 // (/compute/docs/labeling-resources#requirements) for Google Cloud resources.
543 Labels map[string]string `json:"labels,omitempty"`
544 // LoadBalancingScheme: Optional. All backend services and forwarding rules
545 // referenced by this extension must share the same load balancing scheme.
546 // Supported values: `INTERNAL_MANAGED`, `EXTERNAL_MANAGED`. Can be omitted for
547 // AuthzExtensions that do not reference a backend service. For more
548 // information, refer to Backend services overview
549 // (https://cloud.google.com/load-balancing/docs/backend-service).
550 //
551 // Possible values:
552 // "LOAD_BALANCING_SCHEME_UNSPECIFIED" - Default value. Do not use.
553 // "INTERNAL_MANAGED" - Signifies that this is used for Internal HTTP(S) Load
554 // Balancing.
555 // "EXTERNAL_MANAGED" - Signifies that this is used for External Managed
556 // HTTP(S) Load Balancing.
557 LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"`
558 // Metadata: Optional. The metadata provided here is included as part of the
559 // `metadata_context` (of type `google.protobuf.Struct`) in the
560 // `ProcessingRequest` message sent to the extension server. The metadata is
561 // available under the namespace `com.google.authz_extension.`. The following
562 // variables are supported in the metadata Struct: `{forwarding_rule_id}` -
563 // substituted with the forwarding rule's fully qualified resource name.
564 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
565 // Name: Required. Identifier. Name of the `AuthzExtension` resource in the
566 // following format:
567 // `projects/{project}/locations/{location}/authzExtensions/{authz_extension}`.
568 Name string `json:"name,omitempty"`
569 // Service: Required. The reference to the service that runs the extension. To
570 // configure a callout extension, `service` must be a fully-qualified reference
571 // to a backend service
572 // (https://cloud.google.com/compute/docs/reference/rest/v1/backendServices) in
573 // the format:
574 // `https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/ba
575 // ckendServices/{backendService}` or
576 // `https://www.googleapis.com/compute/v1/projects/{project}/global/backendServi
577 // ces/{backendService}`.
578 Service string `json:"service,omitempty"`
579 // Timeout: Required. Specifies the timeout for each individual message on the
580 // stream. The timeout must be between 10-10000 milliseconds.
581 Timeout string `json:"timeout,omitempty"`
582 // UpdateTime: Output only. The timestamp when the resource was updated.
583 UpdateTime string `json:"updateTime,omitempty"`
584 // WireFormat: Optional. The format of communication supported by the callout
585 // extension. This field is supported only for regional `AuthzExtension`
586 // resources. If not specified, the default value `EXT_PROC_GRPC` is used.
587 // Global `AuthzExtension` resources use the `EXT_PROC_GRPC` wire format.
588 //
589 // Possible values:
590 // "WIRE_FORMAT_UNSPECIFIED" - Not specified.
591 // "EXT_PROC_GRPC" - The extension service uses ext_proc gRPC API over a gRPC
592 // stream. This is the default value if the wire format is not specified. The
593 // backend service for the extension must use HTTP2 or H2C as the protocol. All
594 // `supported_events` for a client request are sent as part of the same gRPC
595 // stream.
596 // "EXT_AUTHZ_GRPC" - The extension service uses Envoy's `ext_authz` gRPC
597 // API. The backend service for the extension must use HTTP2 or H2C as the
598 // protocol. `EXT_AUTHZ_GRPC` is only supported for regional `AuthzExtension`
599 // resources.
600 WireFormat string `json:"wireFormat,omitempty"`
601
602 // ServerResponse contains the HTTP response code and headers from the server.
603 googleapi.ServerResponse `json:"-"`
604 // ForceSendFields is a list of field names (e.g. "Authority") to
605 // unconditionally include in API requests. By default, fields with empty or
606 // default values are omitted from API requests. See
607 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
608 // details.
609 ForceSendFields []string `json:"-"`
610 // NullFields is a list of field names (e.g. "Authority") to include in API
611 // requests with the JSON null value. By default, fields with empty values are
612 // omitted from API requests. See
613 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
614 NullFields []string `json:"-"`
615 }
616
617 func (s AuthzExtension) MarshalJSON() ([]byte, error) {
618 type NoMethod AuthzExtension
619 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
620 }
621
622 // Binding: Associates `members`, or principals, with a `role`.
623 type Binding struct {
624 // Condition: The condition that is associated with this binding. If the
625 // condition evaluates to `true`, then this binding applies to the current
626 // request. If the condition evaluates to `false`, then this binding does not
627 // apply to the current request. However, a different role binding might grant
628 // the same role to one or more of the principals in this binding. To learn
629 // which resources support conditions in their IAM policies, see the IAM
630 // documentation
631 // (https://cloud.google.com/iam/help/conditions/resource-policies).
632 Condition *Expr `json:"condition,omitempty"`
633 // Members: Specifies the principals requesting access for a Google Cloud
634 // resource. `members` can have the following values: * `allUsers`: A special
635 // identifier that represents anyone who is on the internet; with or without a
636 // Google account. * `allAuthenticatedUsers`: A special identifier that
637 // represents anyone who is authenticated with a Google account or a service
638 // account. Does not include identities that come from external identity
639 // providers (IdPs) through identity federation. * `user:{emailid}`: An email
640 // address that represents a specific Google account. For example,
641 // `[email protected]` . * `serviceAccount:{emailid}`: An email address that
642 // represents a Google service account. For example,
643 // `[email protected]`. *
644 // `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An
645 // identifier for a Kubernetes service account
646 // (https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts).
647 // For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. *
648 // `group:{emailid}`: An email address that represents a Google group. For
649 // example, `[email protected]`. * `domain:{domain}`: The G Suite domain
650 // (primary) that represents all the users of that domain. For example,
651 // `google.com` or `example.com`. *
652 // `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/sub
653 // ject/{subject_attribute_value}`: A single identity in a workforce identity
654 // pool. *
655 // `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
656 // group/{group_id}`: All workforce identities in a group. *
657 // `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
658 // attribute.{attribute_name}/{attribute_value}`: All workforce identities with
659 // a specific attribute value. *
660 // `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
661 // *`: All identities in a workforce identity pool. *
662 // `principal://iam.googleapis.com/projects/{project_number}/locations/global/wo
663 // rkloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: A single
664 // identity in a workload identity pool. *
665 // `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
666 // /workloadIdentityPools/{pool_id}/group/{group_id}`: A workload identity pool
667 // group. *
668 // `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
669 // /workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}
670 // `: All identities in a workload identity pool with a certain attribute. *
671 // `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
672 // /workloadIdentityPools/{pool_id}/*`: All identities in a workload identity
673 // pool. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus
674 // unique identifier) representing a user that has been recently deleted. For
675 // example, `[email protected]?uid=123456789012345678901`. If the user is
676 // recovered, this value reverts to `user:{emailid}` and the recovered user
677 // retains the role in the binding. *
678 // `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
679 // unique identifier) representing a service account that has been recently
680 // deleted. For example,
681 // `[email protected]?uid=123456789012345678901`. If the
682 // service account is undeleted, this value reverts to
683 // `serviceAccount:{emailid}` and the undeleted service account retains the
684 // role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email
685 // address (plus unique identifier) representing a Google group that has been
686 // recently deleted. For example,
687 // `[email protected]?uid=123456789012345678901`. If the group is recovered,
688 // this value reverts to `group:{emailid}` and the recovered group retains the
689 // role in the binding. *
690 // `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool
691 // _id}/subject/{subject_attribute_value}`: Deleted single identity in a
692 // workforce identity pool. For example,
693 // `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-po
694 // ol-id/subject/my-subject-attribute-value`.
695 Members []string `json:"members,omitempty"`
696 // Role: Role that is assigned to the list of `members`, or principals. For
697 // example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview
698 // of the IAM roles and permissions, see the IAM documentation
699 // (https://cloud.google.com/iam/docs/roles-overview). For a list of the
700 // available pre-defined roles, see here
701 // (https://cloud.google.com/iam/docs/understanding-roles).
702 Role string `json:"role,omitempty"`
703 // ForceSendFields is a list of field names (e.g. "Condition") to
704 // unconditionally include in API requests. By default, fields with empty or
705 // default values are omitted from API requests. See
706 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
707 // details.
708 ForceSendFields []string `json:"-"`
709 // NullFields is a list of field names (e.g. "Condition") to include in API
710 // requests with the JSON null value. By default, fields with empty values are
711 // omitted from API requests. See
712 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
713 NullFields []string `json:"-"`
714 }
715
716 func (s Binding) MarshalJSON() ([]byte, error) {
717 type NoMethod Binding
718 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
719 }
720
721 // CancelOperationRequest: The request message for Operations.CancelOperation.
722 type CancelOperationRequest struct {
723 }
724
725 // Empty: A generic empty message that you can re-use to avoid defining
726 // duplicated empty messages in your APIs. A typical example is to use it as
727 // the request or the response type of an API method. For instance: service Foo
728 // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
729 type Empty struct {
730 // ServerResponse contains the HTTP response code and headers from the server.
731 googleapi.ServerResponse `json:"-"`
732 }
733
734 // EndpointMatcher: A definition of a matcher that selects endpoints to which
735 // the policies should be applied.
736 type EndpointMatcher struct {
737 // MetadataLabelMatcher: The matcher is based on node metadata presented by xDS
738 // clients.
739 MetadataLabelMatcher *EndpointMatcherMetadataLabelMatcher `json:"metadataLabelMatcher,omitempty"`
740 // ForceSendFields is a list of field names (e.g. "MetadataLabelMatcher") to
741 // unconditionally include in API requests. By default, fields with empty or
742 // default values are omitted from API requests. See
743 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
744 // details.
745 ForceSendFields []string `json:"-"`
746 // NullFields is a list of field names (e.g. "MetadataLabelMatcher") to include
747 // in API requests with the JSON null value. By default, fields with empty
748 // values are omitted from API requests. See
749 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
750 NullFields []string `json:"-"`
751 }
752
753 func (s EndpointMatcher) MarshalJSON() ([]byte, error) {
754 type NoMethod EndpointMatcher
755 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
756 }
757
758 // EndpointMatcherMetadataLabelMatcher: The matcher that is based on node
759 // metadata presented by xDS clients.
760 type EndpointMatcherMetadataLabelMatcher struct {
761 // MetadataLabelMatchCriteria: Specifies how matching should be done. Supported
762 // values are: MATCH_ANY: At least one of the Labels specified in the matcher
763 // should match the metadata presented by xDS client. MATCH_ALL: The metadata
764 // presented by the xDS client should contain all of the labels specified here.
765 // The selection is determined based on the best match. For example, suppose
766 // there are three EndpointPolicy resources P1, P2 and P3 and if P1 has a the
767 // matcher as MATCH_ANY , P2 has MATCH_ALL , and P3 has MATCH_ALL . If a client
768 // with label connects, the config from P1 will be selected. If a client with
769 // label connects, the config from P2 will be selected. If a client with label
770 // connects, the config from P3 will be selected. If there is more than one
771 // best match, (for example, if a config P4 with selector exists and if a
772 // client with label connects), pick up the one with older creation time.
773 //
774 // Possible values:
775 // "METADATA_LABEL_MATCH_CRITERIA_UNSPECIFIED" - Default value. Should not be
776 // used.
777 // "MATCH_ANY" - At least one of the Labels specified in the matcher should
778 // match the metadata presented by xDS client.
779 // "MATCH_ALL" - The metadata presented by the xDS client should contain all
780 // of the labels specified here.
781 MetadataLabelMatchCriteria string `json:"metadataLabelMatchCriteria,omitempty"`
782 // MetadataLabels: The list of label value pairs that must match labels in the
783 // provided metadata based on filterMatchCriteria This list can have at most 64
784 // entries. The list can be empty if the match criteria is MATCH_ANY, to
785 // specify a wildcard match (i.e this matches any client).
786 MetadataLabels []*EndpointMatcherMetadataLabelMatcherMetadataLabels `json:"metadataLabels,omitempty"`
787 // ForceSendFields is a list of field names (e.g. "MetadataLabelMatchCriteria")
788 // to unconditionally include in API requests. By default, fields with empty or
789 // default values are omitted from API requests. See
790 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
791 // details.
792 ForceSendFields []string `json:"-"`
793 // NullFields is a list of field names (e.g. "MetadataLabelMatchCriteria") to
794 // include in API requests with the JSON null value. By default, fields with
795 // empty values are omitted from API requests. See
796 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
797 NullFields []string `json:"-"`
798 }
799
800 func (s EndpointMatcherMetadataLabelMatcher) MarshalJSON() ([]byte, error) {
801 type NoMethod EndpointMatcherMetadataLabelMatcher
802 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
803 }
804
805 // EndpointMatcherMetadataLabelMatcherMetadataLabels: Defines a name-pair value
806 // for a single label.
807 type EndpointMatcherMetadataLabelMatcherMetadataLabels struct {
808 // LabelName: Required. Label name presented as key in xDS Node Metadata.
809 LabelName string `json:"labelName,omitempty"`
810 // LabelValue: Required. Label value presented as value corresponding to the
811 // above key, in xDS Node Metadata.
812 LabelValue string `json:"labelValue,omitempty"`
813 // ForceSendFields is a list of field names (e.g. "LabelName") to
814 // unconditionally include in API requests. By default, fields with empty or
815 // default values are omitted from API requests. See
816 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
817 // details.
818 ForceSendFields []string `json:"-"`
819 // NullFields is a list of field names (e.g. "LabelName") to include in API
820 // requests with the JSON null value. By default, fields with empty values are
821 // omitted from API requests. See
822 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
823 NullFields []string `json:"-"`
824 }
825
826 func (s EndpointMatcherMetadataLabelMatcherMetadataLabels) MarshalJSON() ([]byte, error) {
827 type NoMethod EndpointMatcherMetadataLabelMatcherMetadataLabels
828 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
829 }
830
831 // EndpointPolicy: EndpointPolicy is a resource that helps apply desired
832 // configuration on the endpoints that match specific criteria. For example,
833 // this resource can be used to apply "authentication config" an all endpoints
834 // that serve on port 8080.
835 type EndpointPolicy struct {
836 // AuthorizationPolicy: Optional. This field specifies the URL of
837 // AuthorizationPolicy resource that applies authorization policies to the
838 // inbound traffic at the matched endpoints. Refer to Authorization. If this
839 // field is not specified, authorization is disabled(no authz checks) for this
840 // endpoint.
841 AuthorizationPolicy string `json:"authorizationPolicy,omitempty"`
842 // ClientTlsPolicy: Optional. A URL referring to a ClientTlsPolicy resource.
843 // ClientTlsPolicy can be set to specify the authentication for traffic from
844 // the proxy to the actual endpoints. More specifically, it is applied to the
845 // outgoing traffic from the proxy to the endpoint. This is typically used for
846 // sidecar model where the proxy identifies itself as endpoint to the control
847 // plane, with the connection between sidecar and endpoint requiring
848 // authentication. If this field is not set, authentication is disabled(open).
849 // Applicable only when EndpointPolicyType is SIDECAR_PROXY.
850 ClientTlsPolicy string `json:"clientTlsPolicy,omitempty"`
851 // CreateTime: Output only. The timestamp when the resource was created.
852 CreateTime string `json:"createTime,omitempty"`
853 // Description: Optional. A free-text description of the resource. Max length
854 // 1024 characters.
855 Description string `json:"description,omitempty"`
856 // EndpointMatcher: Required. A matcher that selects endpoints to which the
857 // policies should be applied.
858 EndpointMatcher *EndpointMatcher `json:"endpointMatcher,omitempty"`
859 // Labels: Optional. Set of label tags associated with the EndpointPolicy
860 // resource.
861 Labels map[string]string `json:"labels,omitempty"`
862 // Name: Identifier. Name of the EndpointPolicy resource. It matches pattern
863 // `projects/{project}/locations/*/endpointPolicies/{endpoint_policy}`.
864 Name string `json:"name,omitempty"`
865 // ServerTlsPolicy: Optional. A URL referring to ServerTlsPolicy resource.
866 // ServerTlsPolicy is used to determine the authentication policy to be applied
867 // to terminate the inbound traffic at the identified backends. If this field
868 // is not set, authentication is disabled(open) for this endpoint.
869 ServerTlsPolicy string `json:"serverTlsPolicy,omitempty"`
870 // TrafficPortSelector: Optional. Port selector for the (matched) endpoints. If
871 // no port selector is provided, the matched config is applied to all ports.
872 TrafficPortSelector *TrafficPortSelector `json:"trafficPortSelector,omitempty"`
873 // Type: Required. The type of endpoint policy. This is primarily used to
874 // validate the configuration.
875 //
876 // Possible values:
877 // "ENDPOINT_POLICY_TYPE_UNSPECIFIED" - Default value. Must not be used.
878 // "SIDECAR_PROXY" - Represents a proxy deployed as a sidecar.
879 // "GRPC_SERVER" - Represents a proxyless gRPC backend.
880 Type string `json:"type,omitempty"`
881 // UpdateTime: Output only. The timestamp when the resource was updated.
882 UpdateTime string `json:"updateTime,omitempty"`
883
884 // ServerResponse contains the HTTP response code and headers from the server.
885 googleapi.ServerResponse `json:"-"`
886 // ForceSendFields is a list of field names (e.g. "AuthorizationPolicy") to
887 // unconditionally include in API requests. By default, fields with empty or
888 // default values are omitted from API requests. See
889 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
890 // details.
891 ForceSendFields []string `json:"-"`
892 // NullFields is a list of field names (e.g. "AuthorizationPolicy") to include
893 // in API requests with the JSON null value. By default, fields with empty
894 // values are omitted from API requests. See
895 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
896 NullFields []string `json:"-"`
897 }
898
899 func (s EndpointPolicy) MarshalJSON() ([]byte, error) {
900 type NoMethod EndpointPolicy
901 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
902 }
903
904 // Expr: Represents a textual expression in the Common Expression Language
905 // (CEL) syntax. CEL is a C-like expression language. The syntax and semantics
906 // of CEL are documented at https://github.com/google/cel-spec. Example
907 // (Comparison): title: "Summary size limit" description: "Determines if a
908 // summary is less than 100 chars" expression: "document.summary.size() < 100"
909 // Example (Equality): title: "Requestor is owner" description: "Determines if
910 // requestor is the document owner" expression: "document.owner ==
911 // request.auth.claims.email" Example (Logic): title: "Public documents"
912 // description: "Determine whether the document should be publicly visible"
913 // expression: "document.type != 'private' && document.type != 'internal'"
914 // Example (Data Manipulation): title: "Notification string" description:
915 // "Create a notification string with a timestamp." expression: "'New message
916 // received at ' + string(document.create_time)" The exact variables and
917 // functions that may be referenced within an expression are determined by the
918 // service that evaluates it. See the service documentation for additional
919 // information.
920 type Expr struct {
921 // Description: Optional. Description of the expression. This is a longer text
922 // which describes the expression, e.g. when hovered over it in a UI.
923 Description string `json:"description,omitempty"`
924 // Expression: Textual representation of an expression in Common Expression
925 // Language syntax.
926 Expression string `json:"expression,omitempty"`
927 // Location: Optional. String indicating the location of the expression for
928 // error reporting, e.g. a file name and a position in the file.
929 Location string `json:"location,omitempty"`
930 // Title: Optional. Title for the expression, i.e. a short string describing
931 // its purpose. This can be used e.g. in UIs which allow to enter the
932 // expression.
933 Title string `json:"title,omitempty"`
934 // ForceSendFields is a list of field names (e.g. "Description") to
935 // unconditionally include in API requests. By default, fields with empty or
936 // default values are omitted from API requests. See
937 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
938 // details.
939 ForceSendFields []string `json:"-"`
940 // NullFields is a list of field names (e.g. "Description") to include in API
941 // requests with the JSON null value. By default, fields with empty values are
942 // omitted from API requests. See
943 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
944 NullFields []string `json:"-"`
945 }
946
947 func (s Expr) MarshalJSON() ([]byte, error) {
948 type NoMethod Expr
949 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
950 }
951
952 // ExtensionChain: A single extension chain wrapper that contains the match
953 // conditions and extensions to execute.
954 type ExtensionChain struct {
955 // Extensions: Required. A set of extensions to execute for the matching
956 // request. At least one extension is required. Up to 3 extensions can be
957 // defined for each extension chain for `LbTrafficExtension` resource.
958 // `LbRouteExtension` and `LbEdgeExtension` chains are limited to 1 extension
959 // per extension chain.
960 Extensions []*ExtensionChainExtension `json:"extensions,omitempty"`
961 // MatchCondition: Required. Conditions under which this chain is invoked for a
962 // request.
963 MatchCondition *ExtensionChainMatchCondition `json:"matchCondition,omitempty"`
964 // Name: Required. The name for this extension chain. The name is logged as
965 // part of the HTTP request logs. The name must conform with RFC-1034, is
966 // restricted to lower-cased letters, numbers and hyphens, and can have a
967 // maximum length of 63 characters. Additionally, the first character must be a
968 // letter and the last a letter or a number.
969 Name string `json:"name,omitempty"`
970 // ForceSendFields is a list of field names (e.g. "Extensions") to
971 // unconditionally include in API requests. By default, fields with empty or
972 // default values are omitted from API requests. See
973 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
974 // details.
975 ForceSendFields []string `json:"-"`
976 // NullFields is a list of field names (e.g. "Extensions") to include in API
977 // requests with the JSON null value. By default, fields with empty values are
978 // omitted from API requests. See
979 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
980 NullFields []string `json:"-"`
981 }
982
983 func (s ExtensionChain) MarshalJSON() ([]byte, error) {
984 type NoMethod ExtensionChain
985 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
986 }
987
988 // ExtensionChainExtension: A single extension in the chain to execute for the
989 // matching request.
990 type ExtensionChainExtension struct {
991 // Authority: Optional. The `:authority` header in the gRPC request sent from
992 // Envoy to the extension service. Required for Callout extensions. This field
993 // is not supported for plugin extensions. Setting it results in a validation
994 // error.
995 Authority string `json:"authority,omitempty"`
996 // FailOpen: Optional. Determines how the proxy behaves if the call to the
997 // extension fails or times out. When set to `TRUE`, request or response
998 // processing continues without error. Any subsequent extensions in the
999 // extension chain are also executed. When set to `FALSE` or the default
1000 // setting of `FALSE` is used, one of the following happens: * If response
1001 // headers have not been delivered to the downstream client, a generic 500
1002 // error is returned to the client. The error response can be tailored by
1003 // configuring a custom error response in the load balancer. * If response
1004 // headers have been delivered, then the HTTP stream to the downstream client
1005 // is reset.
1006 FailOpen bool `json:"failOpen,omitempty"`
1007 // ForwardAttributes: Optional. List of the Envoy attributes to forward to the
1008 // extension server. The attributes provided here are included as part of the
1009 // `ProcessingRequest.attributes` field (of type `map`), where the keys are the
1010 // attribute names. Refer to the documentation
1011 // (https://cloud.google.com/service-extensions/docs/cel-matcher-language-reference#attributes)
1012 // for the names of attributes that can be forwarded. If omitted, no attributes
1013 // are sent. Each element is a string indicating the attribute name.
1014 ForwardAttributes []string `json:"forwardAttributes,omitempty"`
1015 // ForwardHeaders: Optional. List of the HTTP headers to forward to the
1016 // extension (from the client or backend). If omitted, all headers are sent.
1017 // Each element is a string indicating the header name.
1018 ForwardHeaders []string `json:"forwardHeaders,omitempty"`
1019 // Metadata: Optional. The metadata provided here is included as part of the
1020 // `metadata_context` (of type `google.protobuf.Struct`) in the
1021 // `ProcessingRequest` message sent to the extension server. For
1022 // `AuthzExtension` resources, the metadata is available under the namespace
1023 // `com.google.authz_extension.`. For other types of extensions, the metadata
1024 // is available under the namespace `com.google....`. For example:
1025 // `com.google.lb_traffic_extension.lbtrafficextension1.chain1.ext1`. The
1026 // following variables are supported in the metadata: `{forwarding_rule_id}` -
1027 // substituted with the forwarding rule's fully qualified resource name. This
1028 // field must not be set for plugin extensions. Setting it results in a
1029 // validation error. You can set metadata at either the resource level or the
1030 // extension level. The extension level metadata is recommended because you can
1031 // pass a different set of metadata through each extension to the backend. This
1032 // field is subject to following limitations: * The total size of the metadata
1033 // must be less than 1KiB. * The total number of keys in the metadata must be
1034 // less than 16. * The length of each key must be less than 64 characters. *
1035 // The length of each value must be less than 1024 characters. * All values
1036 // must be strings.
1037 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
1038 // Name: Optional. The name for this extension. The name is logged as part of
1039 // the HTTP request logs. The name must conform with RFC-1034, is restricted to
1040 // lower-cased letters, numbers and hyphens, and can have a maximum length of
1041 // 63 characters. Additionally, the first character must be a letter and the
1042 // last a letter or a number. This field is required except for AuthzExtension.
1043 Name string `json:"name,omitempty"`
1044 // ObservabilityMode: Optional. When set to `true`, the calls to the extension
1045 // backend are performed asynchronously, without pausing the processing of the
1046 // ongoing request. In this mode, only `STREAMED` (default) body processing is
1047 // supported. Responses, if any, are ignored. Supported by regional
1048 // `LbTrafficExtension` and `LbRouteExtension` resources.
1049 ObservabilityMode bool `json:"observabilityMode,omitempty"`
1050 // RequestBodySendMode: Optional. Configures the send mode for request body
1051 // processing. The field can only be set if `supported_events` includes
1052 // `REQUEST_BODY`. If `supported_events` includes `REQUEST_BODY`, but
1053 // `request_body_send_mode` is unset, the default value `STREAMED` is used.
1054 // When this field is set to `FULL_DUPLEX_STREAMED`, `supported_events` must
1055 // include both `REQUEST_BODY` and `REQUEST_TRAILERS`. This field can be set
1056 // only for `LbTrafficExtension` and `LbRouteExtension` resources, and only
1057 // when the `service` field of the extension points to a `BackendService`. Only
1058 // `FULL_DUPLEX_STREAMED` mode is supported for `LbRouteExtension` resources.
1059 //
1060 // Possible values:
1061 // "BODY_SEND_MODE_UNSPECIFIED" - Default value. Do not use.
1062 // "BODY_SEND_MODE_STREAMED" - Calls to the extension are executed in the
1063 // streamed mode. Subsequent chunks will be sent only after the previous chunks
1064 // have been processed. The content of the body chunks is sent one way to the
1065 // extension. Extension may send modified chunks back. This is the default
1066 // value if the processing mode is not specified.
1067 // "BODY_SEND_MODE_FULL_DUPLEX_STREAMED" - Calls are executed in the full
1068 // duplex mode. Subsequent chunks will be sent for processing without waiting
1069 // for the response for the previous chunk or for the response for
1070 // `REQUEST_HEADERS` event. Extension can freely modify or chunk the body
1071 // contents. If the extension doesn't send the body contents back, the next
1072 // extension in the chain or the upstream will receive an empty body.
1073 RequestBodySendMode string `json:"requestBodySendMode,omitempty"`
1074 // ResponseBodySendMode: Optional. Configures the send mode for response
1075 // processing. If unspecified, the default value `STREAMED` is used. The field
1076 // can only be set if `supported_events` includes `RESPONSE_BODY`. If
1077 // `supported_events` includes `RESPONSE_BODY`, but `response_body_send_mode`
1078 // is unset, the default value `STREAMED` is used. When this field is set to
1079 // `FULL_DUPLEX_STREAMED`, `supported_events` must include both `RESPONSE_BODY`
1080 // and `RESPONSE_TRAILERS`. This field can be set only for `LbTrafficExtension`
1081 // resources, and only when the `service` field of the extension points to a
1082 // `BackendService`.
1083 //
1084 // Possible values:
1085 // "BODY_SEND_MODE_UNSPECIFIED" - Default value. Do not use.
1086 // "BODY_SEND_MODE_STREAMED" - Calls to the extension are executed in the
1087 // streamed mode. Subsequent chunks will be sent only after the previous chunks
1088 // have been processed. The content of the body chunks is sent one way to the
1089 // extension. Extension may send modified chunks back. This is the default
1090 // value if the processing mode is not specified.
1091 // "BODY_SEND_MODE_FULL_DUPLEX_STREAMED" - Calls are executed in the full
1092 // duplex mode. Subsequent chunks will be sent for processing without waiting
1093 // for the response for the previous chunk or for the response for
1094 // `REQUEST_HEADERS` event. Extension can freely modify or chunk the body
1095 // contents. If the extension doesn't send the body contents back, the next
1096 // extension in the chain or the upstream will receive an empty body.
1097 ResponseBodySendMode string `json:"responseBodySendMode,omitempty"`
1098 // Service: Required. The reference to the service that runs the extension. To
1099 // configure a callout extension, `service` must be a fully-qualified reference
1100 // to a backend service
1101 // (https://cloud.google.com/compute/docs/reference/rest/v1/backendServices) in
1102 // the format:
1103 // `https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/ba
1104 // ckendServices/{backendService}` or
1105 // `https://www.googleapis.com/compute/v1/projects/{project}/global/backendServi
1106 // ces/{backendService}`. To configure a plugin extension, `service` must be a
1107 // reference to a `WasmPlugin` resource
1108 // (https://cloud.google.com/service-extensions/docs/reference/rest/v1beta1/projects.locations.wasmPlugins)
1109 // in the format:
1110 // `projects/{project}/locations/{location}/wasmPlugins/{plugin}` or
1111 // `//networkservices.googleapis.com/projects/{project}/locations/{location}/was
1112 // mPlugins/{wasmPlugin}`. Plugin extensions are currently supported for the
1113 // `LbTrafficExtension`, the `LbRouteExtension`, and the `LbEdgeExtension`
1114 // resources.
1115 Service string `json:"service,omitempty"`
1116 // SupportedEvents: Optional. A set of events during request or response
1117 // processing for which this extension is called. For the `LbTrafficExtension`
1118 // resource, this field is required. For the `LbRouteExtension` resource, this
1119 // field is optional. If unspecified, `REQUEST_HEADERS` event is assumed as
1120 // supported. For the `LbEdgeExtension` resource, this field is required and
1121 // must only contain `REQUEST_HEADERS` event. For the `AuthzExtension`
1122 // resource, this field is optional. `REQUEST_HEADERS` is the only supported
1123 // event. If unspecified, `REQUEST_HEADERS` event is assumed as supported.
1124 //
1125 // Possible values:
1126 // "EVENT_TYPE_UNSPECIFIED" - Unspecified value. Do not use.
1127 // "REQUEST_HEADERS" - If included in `supported_events`, the extension is
1128 // called when the HTTP request headers arrive.
1129 // "REQUEST_BODY" - If included in `supported_events`, the extension is
1130 // called when the HTTP request body arrives.
1131 // "RESPONSE_HEADERS" - If included in `supported_events`, the extension is
1132 // called when the HTTP response headers arrive.
1133 // "RESPONSE_BODY" - If included in `supported_events`, the extension is
1134 // called when the HTTP response body arrives.
1135 // "REQUEST_TRAILERS" - If included in `supported_events`, the extension is
1136 // called when the HTTP request trailers arrives.
1137 // "RESPONSE_TRAILERS" - If included in `supported_events`, the extension is
1138 // called when the HTTP response trailers arrives.
1139 SupportedEvents []string `json:"supportedEvents,omitempty"`
1140 // Timeout: Optional. Specifies the timeout for each individual message on the
1141 // stream. The timeout must be between `10`-`10000` milliseconds. Required for
1142 // callout extensions. This field is not supported for plugin extensions.
1143 // Setting it results in a validation error.
1144 Timeout string `json:"timeout,omitempty"`
1145 // ForceSendFields is a list of field names (e.g. "Authority") to
1146 // unconditionally include in API requests. By default, fields with empty or
1147 // default values are omitted from API requests. See
1148 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1149 // details.
1150 ForceSendFields []string `json:"-"`
1151 // NullFields is a list of field names (e.g. "Authority") to include in API
1152 // requests with the JSON null value. By default, fields with empty values are
1153 // omitted from API requests. See
1154 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1155 NullFields []string `json:"-"`
1156 }
1157
1158 func (s ExtensionChainExtension) MarshalJSON() ([]byte, error) {
1159 type NoMethod ExtensionChainExtension
1160 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1161 }
1162
1163 // ExtensionChainMatchCondition: Conditions under which this chain is invoked
1164 // for a request.
1165 type ExtensionChainMatchCondition struct {
1166 // CelExpression: Required. A Common Expression Language (CEL) expression that
1167 // is used to match requests for which the extension chain is executed. For
1168 // more information, see CEL matcher language reference
1169 // (https://cloud.google.com/service-extensions/docs/cel-matcher-language-reference).
1170 CelExpression string `json:"celExpression,omitempty"`
1171 // ForceSendFields is a list of field names (e.g. "CelExpression") to
1172 // unconditionally include in API requests. By default, fields with empty or
1173 // default values are omitted from API requests. See
1174 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1175 // details.
1176 ForceSendFields []string `json:"-"`
1177 // NullFields is a list of field names (e.g. "CelExpression") to include in API
1178 // requests with the JSON null value. By default, fields with empty values are
1179 // omitted from API requests. See
1180 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1181 NullFields []string `json:"-"`
1182 }
1183
1184 func (s ExtensionChainMatchCondition) MarshalJSON() ([]byte, error) {
1185 type NoMethod ExtensionChainMatchCondition
1186 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1187 }
1188
1189 // Gateway: Gateway represents the configuration for a proxy, typically a load
1190 // balancer. It captures the ip:port over which the services are exposed by the
1191 // proxy, along with any policy configurations. Routes have reference to to
1192 // Gateways to dictate how requests should be routed by this Gateway.
1193 type Gateway struct {
1194 // Addresses: Optional. Zero or one IPv4 or IPv6 address on which the Gateway
1195 // will receive the traffic. When no address is provided, an IP from the
1196 // subnetwork is allocated This field only applies to gateways of type
1197 // 'SECURE_WEB_GATEWAY'. Gateways of type 'OPEN_MESH' listen on 0.0.0.0 for
1198 // IPv4 and :: for IPv6.
1199 Addresses []string `json:"addresses,omitempty"`
1200 // AllPorts: Optional. If true, the Gateway will listen on all ports. This is
1201 // mutually exclusive with the `ports` field. This field only applies to
1202 // gateways of type 'SECURE_WEB_GATEWAY'.
1203 AllPorts bool `json:"allPorts,omitempty"`
1204 // AllowGlobalAccess: Optional. If true, the gateway will allow traffic from
1205 // clients outside of the region where the gateway is located. This field is
1206 // configurable only for gateways of type SECURE_WEB_GATEWAY.
1207 AllowGlobalAccess bool `json:"allowGlobalAccess,omitempty"`
1208 // CertificateUrls: Optional. A fully-qualified Certificates URL reference. The
1209 // proxy presents a Certificate (selected based on SNI) when establishing a TLS
1210 // connection. This feature only applies to gateways of type
1211 // 'SECURE_WEB_GATEWAY'.
1212 CertificateUrls []string `json:"certificateUrls,omitempty"`
1213 // CreateTime: Output only. The timestamp when the resource was created.
1214 CreateTime string `json:"createTime,omitempty"`
1215 // Description: Optional. A free-text description of the resource. Max length
1216 // 1024 characters.
1217 Description string `json:"description,omitempty"`
1218 // EnvoyHeaders: Optional. Determines if envoy will insert internal debug
1219 // headers into upstream requests. Other Envoy headers may still be injected.
1220 // By default, envoy will not insert any debug headers.
1221 //
1222 // Possible values:
1223 // "ENVOY_HEADERS_UNSPECIFIED" - Defaults to NONE.
1224 // "NONE" - Suppress envoy debug headers.
1225 // "DEBUG_HEADERS" - Envoy will insert default internal debug headers into
1226 // upstream requests: x-envoy-attempt-count, x-envoy-is-timeout-retry,
1227 // x-envoy-expected-rq-timeout-ms, x-envoy-original-path,
1228 // x-envoy-upstream-stream-duration-ms
1229 EnvoyHeaders string `json:"envoyHeaders,omitempty"`
1230 // GatewaySecurityPolicy: Optional. A fully-qualified GatewaySecurityPolicy URL
1231 // reference. Defines how a server should apply security policy to inbound (VM
1232 // to Proxy) initiated connections. For example:
1233 // `projects/*/locations/*/gatewaySecurityPolicies/swg-policy`. This policy is
1234 // specific to gateways of type 'SECURE_WEB_GATEWAY'.
1235 GatewaySecurityPolicy string `json:"gatewaySecurityPolicy,omitempty"`
1236 // IpVersion: Optional. The IP Version that will be used by this gateway. Valid
1237 // options are IPV4 or IPV6. Default is IPV4.
1238 //
1239 // Possible values:
1240 // "IP_VERSION_UNSPECIFIED" - The type when IP version is not specified.
1241 // Defaults to IPV4.
1242 // "IPV4" - The type for IP version 4.
1243 // "IPV6" - The type for IP version 6.
1244 IpVersion string `json:"ipVersion,omitempty"`
1245 // Labels: Optional. Set of label tags associated with the Gateway resource.
1246 Labels map[string]string `json:"labels,omitempty"`
1247 // Name: Identifier. Name of the Gateway resource. It matches pattern
1248 // `projects/*/locations/*/gateways/`.
1249 Name string `json:"name,omitempty"`
1250 // Network: Optional. The relative resource name identifying the VPC network
1251 // that is using this configuration. For example:
1252 // `projects/*/global/networks/network-1`. Currently, this field is specific to
1253 // gateways of type 'SECURE_WEB_GATEWAY'.
1254 Network string `json:"network,omitempty"`
1255 // Ports: Required. One or more port numbers (1-65535), on which the Gateway
1256 // will receive traffic. The proxy binds to the specified ports. Gateways of
1257 // type 'SECURE_WEB_GATEWAY' are limited to 5 ports. Gateways of type
1258 // 'OPEN_MESH' listen on 0.0.0.0 for IPv4 and :: for IPv6 and support multiple
1259 // ports.
1260 Ports []int64 `json:"ports,omitempty"`
1261 // RoutingMode: Optional. The routing mode of the Gateway. This field is
1262 // configurable only for gateways of type SECURE_WEB_GATEWAY. This field is
1263 // required for gateways of type SECURE_WEB_GATEWAY.
1264 //
1265 // Possible values:
1266 // "EXPLICIT_ROUTING_MODE" - The routing mode is explicit; clients are
1267 // configured to send traffic through the gateway. This is the default routing
1268 // mode.
1269 // "NEXT_HOP_ROUTING_MODE" - The routing mode is next-hop. Clients are
1270 // unaware of the gateway, and a route (advanced route or other route type) can
1271 // be configured to direct traffic from client to gateway. The gateway then
1272 // acts as a next-hop to the destination.
1273 RoutingMode string `json:"routingMode,omitempty"`
1274 // Scope: Optional. Scope determines how configuration across multiple Gateway
1275 // instances are merged. The configuration for multiple Gateway instances with
1276 // the same scope will be merged as presented as a single configuration to the
1277 // proxy/load balancer. Max length 64 characters. Scope should start with a
1278 // letter and can only have letters, numbers, hyphens.
1279 Scope string `json:"scope,omitempty"`
1280 // SelfLink: Output only. Server-defined URL of this resource
1281 SelfLink string `json:"selfLink,omitempty"`
1282 // ServerTlsPolicy: Optional. A fully-qualified ServerTLSPolicy URL reference.
1283 // Specifies how TLS traffic is terminated. If empty, TLS termination is
1284 // disabled.
1285 ServerTlsPolicy string `json:"serverTlsPolicy,omitempty"`
1286 // Subnetwork: Optional. The relative resource name identifying the subnetwork
1287 // in which this SWG is allocated. For example:
1288 // `projects/*/regions/us-central1/subnetworks/network-1` Currently, this field
1289 // is specific to gateways of type 'SECURE_WEB_GATEWAY".
1290 Subnetwork string `json:"subnetwork,omitempty"`
1291 // Type: Immutable. The type of the customer managed gateway. This field is
1292 // required. If unspecified, an error is returned.
1293 //
1294 // Possible values:
1295 // "TYPE_UNSPECIFIED" - The type of the customer managed gateway is
1296 // unspecified.
1297 // "OPEN_MESH" - The type of the customer managed gateway is TrafficDirector
1298 // Open Mesh.
1299 // "SECURE_WEB_GATEWAY" - The type of the customer managed gateway is
1300 // SecureWebGateway (SWG).
1301 Type string `json:"type,omitempty"`
1302 // UpdateTime: Output only. The timestamp when the resource was updated.
1303 UpdateTime string `json:"updateTime,omitempty"`
1304
1305 // ServerResponse contains the HTTP response code and headers from the server.
1306 googleapi.ServerResponse `json:"-"`
1307 // ForceSendFields is a list of field names (e.g. "Addresses") to
1308 // unconditionally include in API requests. By default, fields with empty or
1309 // default values are omitted from API requests. See
1310 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1311 // details.
1312 ForceSendFields []string `json:"-"`
1313 // NullFields is a list of field names (e.g. "Addresses") to include in API
1314 // requests with the JSON null value. By default, fields with empty values are
1315 // omitted from API requests. See
1316 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1317 NullFields []string `json:"-"`
1318 }
1319
1320 func (s Gateway) MarshalJSON() ([]byte, error) {
1321 type NoMethod Gateway
1322 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1323 }
1324
1325 // GatewayRouteView: GatewayRouteView defines view-only resource for Routes to
1326 // a Gateway
1327 type GatewayRouteView struct {
1328 // Name: Output only. Identifier. Full path name of the GatewayRouteView
1329 // resource. Format:
1330 // projects/{project_number}/locations/{location}/gateways/{gateway}/routeViews/
1331 // {route_view}
1332 Name string `json:"name,omitempty"`
1333 // RouteId: Output only. The resource id for the route.
1334 RouteId string `json:"routeId,omitempty"`
1335 // RouteLocation: Output only. Location where the route exists.
1336 RouteLocation string `json:"routeLocation,omitempty"`
1337 // RouteProjectNumber: Output only. Project number where the route exists.
1338 RouteProjectNumber int64 `json:"routeProjectNumber,omitempty,string"`
1339 // RouteType: Output only. Type of the route: HttpRoute,GrpcRoute,TcpRoute, or
1340 // TlsRoute
1341 RouteType string `json:"routeType,omitempty"`
1342
1343 // ServerResponse contains the HTTP response code and headers from the server.
1344 googleapi.ServerResponse `json:"-"`
1345 // ForceSendFields is a list of field names (e.g. "Name") to unconditionally
1346 // include in API requests. By default, fields with empty or default values are
1347 // omitted from API requests. See
1348 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1349 // details.
1350 ForceSendFields []string `json:"-"`
1351 // NullFields is a list of field names (e.g. "Name") to include in API requests
1352 // with the JSON null value. By default, fields with empty values are omitted
1353 // from API requests. See
1354 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1355 NullFields []string `json:"-"`
1356 }
1357
1358 func (s GatewayRouteView) MarshalJSON() ([]byte, error) {
1359 type NoMethod GatewayRouteView
1360 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1361 }
1362
1363 // GrpcRoute: GrpcRoute is the resource defining how gRPC traffic routed by a
1364 // Mesh or Gateway resource is routed.
1365 type GrpcRoute struct {
1366 // CreateTime: Output only. The timestamp when the resource was created.
1367 CreateTime string `json:"createTime,omitempty"`
1368 // Description: Optional. A free-text description of the resource. Max length
1369 // 1024 characters.
1370 Description string `json:"description,omitempty"`
1371 // Gateways: Optional. Gateways defines a list of gateways this GrpcRoute is
1372 // attached to, as one of the routing rules to route the requests served by the
1373 // gateway. Each gateway reference should match the pattern:
1374 // `projects/*/locations/*/gateways/`
1375 Gateways []string `json:"gateways,omitempty"`
1376 // Hostnames: Required. Service hostnames with an optional port for which this
1377 // route describes traffic. Format: [:] Hostname is the fully qualified domain
1378 // name of a network host. This matches the RFC 1123 definition of a hostname
1379 // with 2 notable exceptions: - IPs are not allowed. - A hostname may be
1380 // prefixed with a wildcard label (`*.`). The wildcard label must appear by
1381 // itself as the first label. Hostname can be "precise" which is a domain name
1382 // without the terminating dot of a network host (e.g. `foo.example.com`) or
1383 // "wildcard", which is a domain name prefixed with a single wildcard label
1384 // (e.g. `*.example.com`). Note that as per RFC1035 and RFC1123, a label must
1385 // consist of lower case alphanumeric characters or '-', and must start and end
1386 // with an alphanumeric character. No other punctuation is allowed. The routes
1387 // associated with a Mesh or Gateway must have unique hostnames. If you attempt
1388 // to attach multiple routes with conflicting hostnames, the configuration will
1389 // be rejected. For example, while it is acceptable for routes for the
1390 // hostnames `*.foo.bar.com` and `*.bar.com` to be associated with the same
1391 // route, it is not possible to associate two routes both with `*.bar.com` or
1392 // both with `bar.com`. If a port is specified, then gRPC clients must use the
1393 // channel URI with the port to match this rule (i.e. "xds:///service:123"),
1394 // otherwise they must supply the URI without a port (i.e. "xds:///service").
1395 Hostnames []string `json:"hostnames,omitempty"`
1396 // Labels: Optional. Set of label tags associated with the GrpcRoute resource.
1397 Labels map[string]string `json:"labels,omitempty"`
1398 // Meshes: Optional. Meshes defines a list of meshes this GrpcRoute is attached
1399 // to, as one of the routing rules to route the requests served by the mesh.
1400 // Each mesh reference should match the pattern:
1401 // `projects/*/locations/*/meshes/`
1402 Meshes []string `json:"meshes,omitempty"`
1403 // Name: Identifier. Name of the GrpcRoute resource. It matches pattern
1404 // `projects/*/locations/*/grpcRoutes/`
1405 Name string `json:"name,omitempty"`
1406 // Rules: Required. A list of detailed rules defining how to route traffic.
1407 // Within a single GrpcRoute, the GrpcRoute.RouteAction associated with the
1408 // first matching GrpcRoute.RouteRule will be executed. At least one rule must
1409 // be supplied.
1410 Rules []*GrpcRouteRouteRule `json:"rules,omitempty"`
1411 // SelfLink: Output only. Server-defined URL of this resource
1412 SelfLink string `json:"selfLink,omitempty"`
1413 // UpdateTime: Output only. The timestamp when the resource was updated.
1414 UpdateTime string `json:"updateTime,omitempty"`
1415
1416 // ServerResponse contains the HTTP response code and headers from the server.
1417 googleapi.ServerResponse `json:"-"`
1418 // ForceSendFields is a list of field names (e.g. "CreateTime") to
1419 // unconditionally include in API requests. By default, fields with empty or
1420 // default values are omitted from API requests. See
1421 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1422 // details.
1423 ForceSendFields []string `json:"-"`
1424 // NullFields is a list of field names (e.g. "CreateTime") to include in API
1425 // requests with the JSON null value. By default, fields with empty values are
1426 // omitted from API requests. See
1427 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1428 NullFields []string `json:"-"`
1429 }
1430
1431 func (s GrpcRoute) MarshalJSON() ([]byte, error) {
1432 type NoMethod GrpcRoute
1433 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1434 }
1435
1436 // GrpcRouteDestination: The destination to which traffic will be routed.
1437 type GrpcRouteDestination struct {
1438 // ServiceName: Required. The URL of a destination service to which to route
1439 // traffic. Must refer to either a BackendService or ServiceDirectoryService.
1440 ServiceName string `json:"serviceName,omitempty"`
1441 // Weight: Optional. Specifies the proportion of requests forwarded to the
1442 // backend referenced by the serviceName field. This is computed as: -
1443 // weight/Sum(weights in this destination list). For non-zero values, there may
1444 // be some epsilon from the exact proportion defined here depending on the
1445 // precision an implementation supports. If only one serviceName is specified
1446 // and it has a weight greater than 0, 100% of the traffic is forwarded to that
1447 // backend. If weights are specified for any one service name, they need to be
1448 // specified for all of them. If weights are unspecified for all services,
1449 // then, traffic is distributed in equal proportions to all of them.
1450 Weight int64 `json:"weight,omitempty"`
1451 // ForceSendFields is a list of field names (e.g. "ServiceName") to
1452 // unconditionally include in API requests. By default, fields with empty or
1453 // default values are omitted from API requests. See
1454 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1455 // details.
1456 ForceSendFields []string `json:"-"`
1457 // NullFields is a list of field names (e.g. "ServiceName") to include in API
1458 // requests with the JSON null value. By default, fields with empty values are
1459 // omitted from API requests. See
1460 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1461 NullFields []string `json:"-"`
1462 }
1463
1464 func (s GrpcRouteDestination) MarshalJSON() ([]byte, error) {
1465 type NoMethod GrpcRouteDestination
1466 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1467 }
1468
1469 // GrpcRouteFaultInjectionPolicy: The specification for fault injection
1470 // introduced into traffic to test the resiliency of clients to destination
1471 // service failure. As part of fault injection, when clients send requests to a
1472 // destination, delays can be introduced on a percentage of requests before
1473 // sending those requests to the destination service. Similarly requests from
1474 // clients can be aborted by for a percentage of requests.
1475 type GrpcRouteFaultInjectionPolicy struct {
1476 // Abort: The specification for aborting to client requests.
1477 Abort *GrpcRouteFaultInjectionPolicyAbort `json:"abort,omitempty"`
1478 // Delay: The specification for injecting delay to client requests.
1479 Delay *GrpcRouteFaultInjectionPolicyDelay `json:"delay,omitempty"`
1480 // ForceSendFields is a list of field names (e.g. "Abort") to unconditionally
1481 // include in API requests. By default, fields with empty or default values are
1482 // omitted from API requests. See
1483 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1484 // details.
1485 ForceSendFields []string `json:"-"`
1486 // NullFields is a list of field names (e.g. "Abort") to include in API
1487 // requests with the JSON null value. By default, fields with empty values are
1488 // omitted from API requests. See
1489 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1490 NullFields []string `json:"-"`
1491 }
1492
1493 func (s GrpcRouteFaultInjectionPolicy) MarshalJSON() ([]byte, error) {
1494 type NoMethod GrpcRouteFaultInjectionPolicy
1495 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1496 }
1497
1498 // GrpcRouteFaultInjectionPolicyAbort: Specification of how client requests are
1499 // aborted as part of fault injection before being sent to a destination.
1500 type GrpcRouteFaultInjectionPolicyAbort struct {
1501 // HttpStatus: The HTTP status code used to abort the request. The value must
1502 // be between 200 and 599 inclusive.
1503 HttpStatus int64 `json:"httpStatus,omitempty"`
1504 // Percentage: The percentage of traffic which will be aborted. The value must
1505 // be between [0, 100]
1506 Percentage int64 `json:"percentage,omitempty"`
1507 // ForceSendFields is a list of field names (e.g. "HttpStatus") to
1508 // unconditionally include in API requests. By default, fields with empty or
1509 // default values are omitted from API requests. See
1510 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1511 // details.
1512 ForceSendFields []string `json:"-"`
1513 // NullFields is a list of field names (e.g. "HttpStatus") to include in API
1514 // requests with the JSON null value. By default, fields with empty values are
1515 // omitted from API requests. See
1516 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1517 NullFields []string `json:"-"`
1518 }
1519
1520 func (s GrpcRouteFaultInjectionPolicyAbort) MarshalJSON() ([]byte, error) {
1521 type NoMethod GrpcRouteFaultInjectionPolicyAbort
1522 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1523 }
1524
1525 // GrpcRouteFaultInjectionPolicyDelay: Specification of how client requests are
1526 // delayed as part of fault injection before being sent to a destination.
1527 type GrpcRouteFaultInjectionPolicyDelay struct {
1528 // FixedDelay: Specify a fixed delay before forwarding the request.
1529 FixedDelay string `json:"fixedDelay,omitempty"`
1530 // Percentage: The percentage of traffic on which delay will be injected. The
1531 // value must be between [0, 100]
1532 Percentage int64 `json:"percentage,omitempty"`
1533 // ForceSendFields is a list of field names (e.g. "FixedDelay") to
1534 // unconditionally include in API requests. By default, fields with empty or
1535 // default values are omitted from API requests. See
1536 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1537 // details.
1538 ForceSendFields []string `json:"-"`
1539 // NullFields is a list of field names (e.g. "FixedDelay") to include in API
1540 // requests with the JSON null value. By default, fields with empty values are
1541 // omitted from API requests. See
1542 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1543 NullFields []string `json:"-"`
1544 }
1545
1546 func (s GrpcRouteFaultInjectionPolicyDelay) MarshalJSON() ([]byte, error) {
1547 type NoMethod GrpcRouteFaultInjectionPolicyDelay
1548 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1549 }
1550
1551 // GrpcRouteHeaderMatch: A match against a collection of headers.
1552 type GrpcRouteHeaderMatch struct {
1553 // Key: Required. The key of the header.
1554 Key string `json:"key,omitempty"`
1555 // Type: Optional. Specifies how to match against the value of the header. If
1556 // not specified, a default value of EXACT is used.
1557 //
1558 // Possible values:
1559 // "TYPE_UNSPECIFIED" - Unspecified.
1560 // "EXACT" - Will only match the exact value provided.
1561 // "REGULAR_EXPRESSION" - Will match paths conforming to the prefix specified
1562 // by value. RE2 syntax is supported.
1563 Type string `json:"type,omitempty"`
1564 // Value: Required. The value of the header.
1565 Value string `json:"value,omitempty"`
1566 // ForceSendFields is a list of field names (e.g. "Key") to unconditionally
1567 // include in API requests. By default, fields with empty or default values are
1568 // omitted from API requests. See
1569 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1570 // details.
1571 ForceSendFields []string `json:"-"`
1572 // NullFields is a list of field names (e.g. "Key") to include in API requests
1573 // with the JSON null value. By default, fields with empty values are omitted
1574 // from API requests. See
1575 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1576 NullFields []string `json:"-"`
1577 }
1578
1579 func (s GrpcRouteHeaderMatch) MarshalJSON() ([]byte, error) {
1580 type NoMethod GrpcRouteHeaderMatch
1581 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1582 }
1583
1584 // GrpcRouteMethodMatch: Specifies a match against a method.
1585 type GrpcRouteMethodMatch struct {
1586 // CaseSensitive: Optional. Specifies that matches are case sensitive. The
1587 // default value is true. case_sensitive must not be used with a type of
1588 // REGULAR_EXPRESSION.
1589 CaseSensitive bool `json:"caseSensitive,omitempty"`
1590 // GrpcMethod: Required. Name of the method to match against. If unspecified,
1591 // will match all methods.
1592 GrpcMethod string `json:"grpcMethod,omitempty"`
1593 // GrpcService: Required. Name of the service to match against. If unspecified,
1594 // will match all services.
1595 GrpcService string `json:"grpcService,omitempty"`
1596 // Type: Optional. Specifies how to match against the name. If not specified, a
1597 // default value of "EXACT" is used.
1598 //
1599 // Possible values:
1600 // "TYPE_UNSPECIFIED" - Unspecified.
1601 // "EXACT" - Will only match the exact name provided.
1602 // "REGULAR_EXPRESSION" - Will interpret grpc_method and grpc_service as
1603 // regexes. RE2 syntax is supported.
1604 Type string `json:"type,omitempty"`
1605 // ForceSendFields is a list of field names (e.g. "CaseSensitive") to
1606 // unconditionally include in API requests. By default, fields with empty or
1607 // default values are omitted from API requests. See
1608 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1609 // details.
1610 ForceSendFields []string `json:"-"`
1611 // NullFields is a list of field names (e.g. "CaseSensitive") to include in API
1612 // requests with the JSON null value. By default, fields with empty values are
1613 // omitted from API requests. See
1614 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1615 NullFields []string `json:"-"`
1616 }
1617
1618 func (s GrpcRouteMethodMatch) MarshalJSON() ([]byte, error) {
1619 type NoMethod GrpcRouteMethodMatch
1620 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1621 }
1622
1623 // GrpcRouteRetryPolicy: The specifications for retries. Specifies one or more
1624 // conditions for which this retry rule applies. Valid values are:
1625 type GrpcRouteRetryPolicy struct {
1626 // NumRetries: Specifies the allowed number of retries. This number must be >
1627 // 0. If not specified, default to 1.
1628 NumRetries int64 `json:"numRetries,omitempty"`
1629 // RetryConditions: - connect-failure: Router will retry on failures connecting
1630 // to Backend Services, for example due to connection timeouts. -
1631 // refused-stream: Router will retry if the backend service resets the stream
1632 // with a REFUSED_STREAM error code. This reset type indicates that it is safe
1633 // to retry. - cancelled: Router will retry if the gRPC status code in the
1634 // response header is set to cancelled - deadline-exceeded: Router will retry
1635 // if the gRPC status code in the response header is set to deadline-exceeded -
1636 // resource-exhausted: Router will retry if the gRPC status code in the
1637 // response header is set to resource-exhausted - unavailable: Router will
1638 // retry if the gRPC status code in the response header is set to unavailable
1639 RetryConditions []string `json:"retryConditions,omitempty"`
1640 // ForceSendFields is a list of field names (e.g. "NumRetries") to
1641 // unconditionally include in API requests. By default, fields with empty or
1642 // default values are omitted from API requests. See
1643 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1644 // details.
1645 ForceSendFields []string `json:"-"`
1646 // NullFields is a list of field names (e.g. "NumRetries") to include in API
1647 // requests with the JSON null value. By default, fields with empty values are
1648 // omitted from API requests. See
1649 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1650 NullFields []string `json:"-"`
1651 }
1652
1653 func (s GrpcRouteRetryPolicy) MarshalJSON() ([]byte, error) {
1654 type NoMethod GrpcRouteRetryPolicy
1655 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1656 }
1657
1658 // GrpcRouteRouteAction: Specifies how to route matched traffic.
1659 type GrpcRouteRouteAction struct {
1660 // Destinations: Optional. The destination services to which traffic should be
1661 // forwarded. If multiple destinations are specified, traffic will be split
1662 // between Backend Service(s) according to the weight field of these
1663 // destinations.
1664 Destinations []*GrpcRouteDestination `json:"destinations,omitempty"`
1665 // FaultInjectionPolicy: Optional. The specification for fault injection
1666 // introduced into traffic to test the resiliency of clients to destination
1667 // service failure. As part of fault injection, when clients send requests to a
1668 // destination, delays can be introduced on a percentage of requests before
1669 // sending those requests to the destination service. Similarly requests from
1670 // clients can be aborted by for a percentage of requests. timeout and
1671 // retry_policy will be ignored by clients that are configured with a
1672 // fault_injection_policy
1673 FaultInjectionPolicy *GrpcRouteFaultInjectionPolicy `json:"faultInjectionPolicy,omitempty"`
1674 // IdleTimeout: Optional. Specifies the idle timeout for the selected route.
1675 // The idle timeout is defined as the period in which there are no bytes sent
1676 // or received on either the upstream or downstream connection. If not set, the
1677 // default idle timeout is 1 hour. If set to 0s, the timeout will be disabled.
1678 IdleTimeout string `json:"idleTimeout,omitempty"`
1679 // RetryPolicy: Optional. Specifies the retry policy associated with this
1680 // route.
1681 RetryPolicy *GrpcRouteRetryPolicy `json:"retryPolicy,omitempty"`
1682 // StatefulSessionAffinity: Optional. Specifies cookie-based stateful session
1683 // affinity.
1684 StatefulSessionAffinity *GrpcRouteStatefulSessionAffinityPolicy `json:"statefulSessionAffinity,omitempty"`
1685 // Timeout: Optional. Specifies the timeout for selected route. Timeout is
1686 // computed from the time the request has been fully processed (i.e. end of
1687 // stream) up until the response has been completely processed. Timeout
1688 // includes all retries.
1689 Timeout string `json:"timeout,omitempty"`
1690 // ForceSendFields is a list of field names (e.g. "Destinations") to
1691 // unconditionally include in API requests. By default, fields with empty or
1692 // default values are omitted from API requests. See
1693 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1694 // details.
1695 ForceSendFields []string `json:"-"`
1696 // NullFields is a list of field names (e.g. "Destinations") to include in API
1697 // requests with the JSON null value. By default, fields with empty values are
1698 // omitted from API requests. See
1699 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1700 NullFields []string `json:"-"`
1701 }
1702
1703 func (s GrpcRouteRouteAction) MarshalJSON() ([]byte, error) {
1704 type NoMethod GrpcRouteRouteAction
1705 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1706 }
1707
1708 // GrpcRouteRouteMatch: Criteria for matching traffic. A RouteMatch will be
1709 // considered to match when all supplied fields match.
1710 type GrpcRouteRouteMatch struct {
1711 // Headers: Optional. Specifies a collection of headers to match.
1712 Headers []*GrpcRouteHeaderMatch `json:"headers,omitempty"`
1713 // Method: Optional. A gRPC method to match against. If this field is empty or
1714 // omitted, will match all methods.
1715 Method *GrpcRouteMethodMatch `json:"method,omitempty"`
1716 // ForceSendFields is a list of field names (e.g. "Headers") to unconditionally
1717 // include in API requests. By default, fields with empty or default values are
1718 // omitted from API requests. See
1719 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1720 // details.
1721 ForceSendFields []string `json:"-"`
1722 // NullFields is a list of field names (e.g. "Headers") to include in API
1723 // requests with the JSON null value. By default, fields with empty values are
1724 // omitted from API requests. See
1725 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1726 NullFields []string `json:"-"`
1727 }
1728
1729 func (s GrpcRouteRouteMatch) MarshalJSON() ([]byte, error) {
1730 type NoMethod GrpcRouteRouteMatch
1731 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1732 }
1733
1734 // GrpcRouteRouteRule: Describes how to route traffic.
1735 type GrpcRouteRouteRule struct {
1736 // Action: Required. A detailed rule defining how to route traffic. This field
1737 // is required.
1738 Action *GrpcRouteRouteAction `json:"action,omitempty"`
1739 // Matches: Optional. Matches define conditions used for matching the rule
1740 // against incoming gRPC requests. Each match is independent, i.e. this rule
1741 // will be matched if ANY one of the matches is satisfied. If no matches field
1742 // is specified, this rule will unconditionally match traffic.
1743 Matches []*GrpcRouteRouteMatch `json:"matches,omitempty"`
1744 // ForceSendFields is a list of field names (e.g. "Action") to unconditionally
1745 // include in API requests. By default, fields with empty or default values are
1746 // omitted from API requests. See
1747 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1748 // details.
1749 ForceSendFields []string `json:"-"`
1750 // NullFields is a list of field names (e.g. "Action") to include in API
1751 // requests with the JSON null value. By default, fields with empty values are
1752 // omitted from API requests. See
1753 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1754 NullFields []string `json:"-"`
1755 }
1756
1757 func (s GrpcRouteRouteRule) MarshalJSON() ([]byte, error) {
1758 type NoMethod GrpcRouteRouteRule
1759 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1760 }
1761
1762 // GrpcRouteStatefulSessionAffinityPolicy: The specification for cookie-based
1763 // stateful session affinity where the date plane supplies a “session
1764 // cookie” with the name "GSSA" which encodes a specific destination host and
1765 // each request containing that cookie will be directed to that host as long as
1766 // the destination host remains up and healthy. The gRPC proxyless mesh library
1767 // or sidecar proxy will manage the session cookie but the client application
1768 // code is responsible for copying the cookie from each RPC in the session to
1769 // the next.
1770 type GrpcRouteStatefulSessionAffinityPolicy struct {
1771 // CookieTtl: Required. The cookie TTL value for the Set-Cookie header
1772 // generated by the data plane. The lifetime of the cookie may be set to a
1773 // value from 0 to 86400 seconds (24 hours) inclusive. Set this to 0s to use a
1774 // session cookie and disable cookie expiration.
1775 CookieTtl string `json:"cookieTtl,omitempty"`
1776 // ForceSendFields is a list of field names (e.g. "CookieTtl") to
1777 // unconditionally include in API requests. By default, fields with empty or
1778 // default values are omitted from API requests. See
1779 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1780 // details.
1781 ForceSendFields []string `json:"-"`
1782 // NullFields is a list of field names (e.g. "CookieTtl") to include in API
1783 // requests with the JSON null value. By default, fields with empty values are
1784 // omitted from API requests. See
1785 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1786 NullFields []string `json:"-"`
1787 }
1788
1789 func (s GrpcRouteStatefulSessionAffinityPolicy) MarshalJSON() ([]byte, error) {
1790 type NoMethod GrpcRouteStatefulSessionAffinityPolicy
1791 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1792 }
1793
1794 // HttpRoute: HttpRoute is the resource defining how HTTP traffic should be
1795 // routed by a Mesh or Gateway resource.
1796 type HttpRoute struct {
1797 // CreateTime: Output only. The timestamp when the resource was created.
1798 CreateTime string `json:"createTime,omitempty"`
1799 // Description: Optional. A free-text description of the resource. Max length
1800 // 1024 characters.
1801 Description string `json:"description,omitempty"`
1802 // Gateways: Optional. Gateways defines a list of gateways this HttpRoute is
1803 // attached to, as one of the routing rules to route the requests served by the
1804 // gateway. Each gateway reference should match the pattern:
1805 // `projects/*/locations/*/gateways/`
1806 Gateways []string `json:"gateways,omitempty"`
1807 // Hostnames: Required. Hostnames define a set of hosts that should match
1808 // against the HTTP host header to select a HttpRoute to process the request.
1809 // Hostname is the fully qualified domain name of a network host, as defined by
1810 // RFC 1123 with the exception that: - IPs are not allowed. - A hostname may be
1811 // prefixed with a wildcard label (`*.`). The wildcard label must appear by
1812 // itself as the first label. Hostname can be "precise" which is a domain name
1813 // without the terminating dot of a network host (e.g. `foo.example.com`) or
1814 // "wildcard", which is a domain name prefixed with a single wildcard label
1815 // (e.g. `*.example.com`). Note that as per RFC1035 and RFC1123, a label must
1816 // consist of lower case alphanumeric characters or '-', and must start and end
1817 // with an alphanumeric character. No other punctuation is allowed. The routes
1818 // associated with a Mesh or Gateways must have unique hostnames. If you
1819 // attempt to attach multiple routes with conflicting hostnames, the
1820 // configuration will be rejected. For example, while it is acceptable for
1821 // routes for the hostnames `*.foo.bar.com` and `*.bar.com` to be associated
1822 // with the same Mesh (or Gateways under the same scope), it is not possible to
1823 // associate two routes both with `*.bar.com` or both with `bar.com`.
1824 Hostnames []string `json:"hostnames,omitempty"`
1825 // Labels: Optional. Set of label tags associated with the HttpRoute resource.
1826 Labels map[string]string `json:"labels,omitempty"`
1827 // Meshes: Optional. Meshes defines a list of meshes this HttpRoute is attached
1828 // to, as one of the routing rules to route the requests served by the mesh.
1829 // Each mesh reference should match the pattern:
1830 // `projects/*/locations/*/meshes/` The attached Mesh should be of a type
1831 // SIDECAR
1832 Meshes []string `json:"meshes,omitempty"`
1833 // Name: Identifier. Name of the HttpRoute resource. It matches pattern
1834 // `projects/*/locations/*/httpRoutes/http_route_name>`.
1835 Name string `json:"name,omitempty"`
1836 // Rules: Required. Rules that define how traffic is routed and handled. Rules
1837 // will be matched sequentially based on the RouteMatch specified for the rule.
1838 Rules []*HttpRouteRouteRule `json:"rules,omitempty"`
1839 // SelfLink: Output only. Server-defined URL of this resource
1840 SelfLink string `json:"selfLink,omitempty"`
1841 // UpdateTime: Output only. The timestamp when the resource was updated.
1842 UpdateTime string `json:"updateTime,omitempty"`
1843
1844 // ServerResponse contains the HTTP response code and headers from the server.
1845 googleapi.ServerResponse `json:"-"`
1846 // ForceSendFields is a list of field names (e.g. "CreateTime") to
1847 // unconditionally include in API requests. By default, fields with empty or
1848 // default values are omitted from API requests. See
1849 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1850 // details.
1851 ForceSendFields []string `json:"-"`
1852 // NullFields is a list of field names (e.g. "CreateTime") to include in API
1853 // requests with the JSON null value. By default, fields with empty values are
1854 // omitted from API requests. See
1855 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1856 NullFields []string `json:"-"`
1857 }
1858
1859 func (s HttpRoute) MarshalJSON() ([]byte, error) {
1860 type NoMethod HttpRoute
1861 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1862 }
1863
1864 // HttpRouteCorsPolicy: The Specification for allowing client side cross-origin
1865 // requests.
1866 type HttpRouteCorsPolicy struct {
1867 // AllowCredentials: In response to a preflight request, setting this to true
1868 // indicates that the actual request can include user credentials. This
1869 // translates to the Access-Control-Allow-Credentials header. Default value is
1870 // false.
1871 AllowCredentials bool `json:"allowCredentials,omitempty"`
1872 // AllowHeaders: Specifies the content for Access-Control-Allow-Headers header.
1873 AllowHeaders []string `json:"allowHeaders,omitempty"`
1874 // AllowMethods: Specifies the content for Access-Control-Allow-Methods header.
1875 AllowMethods []string `json:"allowMethods,omitempty"`
1876 // AllowOriginRegexes: Specifies the regular expression patterns that match
1877 // allowed origins. For regular expression grammar, please see
1878 // https://github.com/google/re2/wiki/Syntax.
1879 AllowOriginRegexes []string `json:"allowOriginRegexes,omitempty"`
1880 // AllowOrigins: Specifies the list of origins that will be allowed to do CORS
1881 // requests. An origin is allowed if it matches either an item in allow_origins
1882 // or an item in allow_origin_regexes.
1883 AllowOrigins []string `json:"allowOrigins,omitempty"`
1884 // Disabled: If true, the CORS policy is disabled. The default value is false,
1885 // which indicates that the CORS policy is in effect.
1886 Disabled bool `json:"disabled,omitempty"`
1887 // ExposeHeaders: Specifies the content for Access-Control-Expose-Headers
1888 // header.
1889 ExposeHeaders []string `json:"exposeHeaders,omitempty"`
1890 // MaxAge: Specifies how long result of a preflight request can be cached in
1891 // seconds. This translates to the Access-Control-Max-Age header.
1892 MaxAge string `json:"maxAge,omitempty"`
1893 // ForceSendFields is a list of field names (e.g. "AllowCredentials") to
1894 // unconditionally include in API requests. By default, fields with empty or
1895 // default values are omitted from API requests. See
1896 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1897 // details.
1898 ForceSendFields []string `json:"-"`
1899 // NullFields is a list of field names (e.g. "AllowCredentials") to include in
1900 // API requests with the JSON null value. By default, fields with empty values
1901 // are omitted from API requests. See
1902 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1903 NullFields []string `json:"-"`
1904 }
1905
1906 func (s HttpRouteCorsPolicy) MarshalJSON() ([]byte, error) {
1907 type NoMethod HttpRouteCorsPolicy
1908 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1909 }
1910
1911 // HttpRouteDestination: Specifications of a destination to which the request
1912 // should be routed to.
1913 type HttpRouteDestination struct {
1914 // RequestHeaderModifier: Optional. The specification for modifying the headers
1915 // of a matching request prior to delivery of the request to the destination.
1916 // If HeaderModifiers are set on both the Destination and the RouteAction, they
1917 // will be merged. Conflicts between the two will not be resolved on the
1918 // configuration.
1919 RequestHeaderModifier *HttpRouteHeaderModifier `json:"requestHeaderModifier,omitempty"`
1920 // ResponseHeaderModifier: Optional. The specification for modifying the
1921 // headers of a response prior to sending the response back to the client. If
1922 // HeaderModifiers are set on both the Destination and the RouteAction, they
1923 // will be merged. Conflicts between the two will not be resolved on the
1924 // configuration.
1925 ResponseHeaderModifier *HttpRouteHeaderModifier `json:"responseHeaderModifier,omitempty"`
1926 // ServiceName: The URL of a BackendService to route traffic to.
1927 ServiceName string `json:"serviceName,omitempty"`
1928 // Weight: Specifies the proportion of requests forwarded to the backend
1929 // referenced by the serviceName field. This is computed as: -
1930 // weight/Sum(weights in this destination list). For non-zero values, there may
1931 // be some epsilon from the exact proportion defined here depending on the
1932 // precision an implementation supports. If only one serviceName is specified
1933 // and it has a weight greater than 0, 100% of the traffic is forwarded to that
1934 // backend. If weights are specified for any one service name, they need to be
1935 // specified for all of them. If weights are unspecified for all services,
1936 // then, traffic is distributed in equal proportions to all of them.
1937 Weight int64 `json:"weight,omitempty"`
1938 // ForceSendFields is a list of field names (e.g. "RequestHeaderModifier") to
1939 // unconditionally include in API requests. By default, fields with empty or
1940 // default values are omitted from API requests. See
1941 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1942 // details.
1943 ForceSendFields []string `json:"-"`
1944 // NullFields is a list of field names (e.g. "RequestHeaderModifier") to
1945 // include in API requests with the JSON null value. By default, fields with
1946 // empty values are omitted from API requests. See
1947 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1948 NullFields []string `json:"-"`
1949 }
1950
1951 func (s HttpRouteDestination) MarshalJSON() ([]byte, error) {
1952 type NoMethod HttpRouteDestination
1953 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1954 }
1955
1956 // HttpRouteFaultInjectionPolicy: The specification for fault injection
1957 // introduced into traffic to test the resiliency of clients to destination
1958 // service failure. As part of fault injection, when clients send requests to a
1959 // destination, delays can be introduced by client proxy on a percentage of
1960 // requests before sending those requests to the destination service. Similarly
1961 // requests can be aborted by client proxy for a percentage of requests.
1962 type HttpRouteFaultInjectionPolicy struct {
1963 // Abort: The specification for aborting to client requests.
1964 Abort *HttpRouteFaultInjectionPolicyAbort `json:"abort,omitempty"`
1965 // Delay: The specification for injecting delay to client requests.
1966 Delay *HttpRouteFaultInjectionPolicyDelay `json:"delay,omitempty"`
1967 // ForceSendFields is a list of field names (e.g. "Abort") to unconditionally
1968 // include in API requests. By default, fields with empty or default values are
1969 // omitted from API requests. See
1970 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1971 // details.
1972 ForceSendFields []string `json:"-"`
1973 // NullFields is a list of field names (e.g. "Abort") to include in API
1974 // requests with the JSON null value. By default, fields with empty values are
1975 // omitted from API requests. See
1976 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1977 NullFields []string `json:"-"`
1978 }
1979
1980 func (s HttpRouteFaultInjectionPolicy) MarshalJSON() ([]byte, error) {
1981 type NoMethod HttpRouteFaultInjectionPolicy
1982 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1983 }
1984
1985 // HttpRouteFaultInjectionPolicyAbort: Specification of how client requests are
1986 // aborted as part of fault injection before being sent to a destination.
1987 type HttpRouteFaultInjectionPolicyAbort struct {
1988 // HttpStatus: The HTTP status code used to abort the request. The value must
1989 // be between 200 and 599 inclusive.
1990 HttpStatus int64 `json:"httpStatus,omitempty"`
1991 // Percentage: The percentage of traffic which will be aborted. The value must
1992 // be between [0, 100]
1993 Percentage int64 `json:"percentage,omitempty"`
1994 // ForceSendFields is a list of field names (e.g. "HttpStatus") to
1995 // unconditionally include in API requests. By default, fields with empty or
1996 // default values are omitted from API requests. See
1997 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1998 // details.
1999 ForceSendFields []string `json:"-"`
2000 // NullFields is a list of field names (e.g. "HttpStatus") to include in API
2001 // requests with the JSON null value. By default, fields with empty values are
2002 // omitted from API requests. See
2003 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2004 NullFields []string `json:"-"`
2005 }
2006
2007 func (s HttpRouteFaultInjectionPolicyAbort) MarshalJSON() ([]byte, error) {
2008 type NoMethod HttpRouteFaultInjectionPolicyAbort
2009 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2010 }
2011
2012 // HttpRouteFaultInjectionPolicyDelay: Specification of how client requests are
2013 // delayed as part of fault injection before being sent to a destination.
2014 type HttpRouteFaultInjectionPolicyDelay struct {
2015 // FixedDelay: Specify a fixed delay before forwarding the request.
2016 FixedDelay string `json:"fixedDelay,omitempty"`
2017 // Percentage: The percentage of traffic on which delay will be injected. The
2018 // value must be between [0, 100]
2019 Percentage int64 `json:"percentage,omitempty"`
2020 // ForceSendFields is a list of field names (e.g. "FixedDelay") to
2021 // unconditionally include in API requests. By default, fields with empty or
2022 // default values are omitted from API requests. See
2023 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2024 // details.
2025 ForceSendFields []string `json:"-"`
2026 // NullFields is a list of field names (e.g. "FixedDelay") to include in API
2027 // requests with the JSON null value. By default, fields with empty values are
2028 // omitted from API requests. See
2029 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2030 NullFields []string `json:"-"`
2031 }
2032
2033 func (s HttpRouteFaultInjectionPolicyDelay) MarshalJSON() ([]byte, error) {
2034 type NoMethod HttpRouteFaultInjectionPolicyDelay
2035 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2036 }
2037
2038 // HttpRouteHeaderMatch: Specifies how to select a route rule based on HTTP
2039 // request headers.
2040 type HttpRouteHeaderMatch struct {
2041 // ExactMatch: The value of the header should match exactly the content of
2042 // exact_match.
2043 ExactMatch string `json:"exactMatch,omitempty"`
2044 // Header: The name of the HTTP header to match against.
2045 Header string `json:"header,omitempty"`
2046 // InvertMatch: If specified, the match result will be inverted before
2047 // checking. Default value is set to false.
2048 InvertMatch bool `json:"invertMatch,omitempty"`
2049 // PrefixMatch: The value of the header must start with the contents of
2050 // prefix_match.
2051 PrefixMatch string `json:"prefixMatch,omitempty"`
2052 // PresentMatch: A header with header_name must exist. The match takes place
2053 // whether or not the header has a value.
2054 PresentMatch bool `json:"presentMatch,omitempty"`
2055 // RangeMatch: If specified, the rule will match if the request header value is
2056 // within the range.
2057 RangeMatch *HttpRouteHeaderMatchIntegerRange `json:"rangeMatch,omitempty"`
2058 // RegexMatch: The value of the header must match the regular expression
2059 // specified in regex_match. For regular expression grammar, please see:
2060 // https://github.com/google/re2/wiki/Syntax
2061 RegexMatch string `json:"regexMatch,omitempty"`
2062 // SuffixMatch: The value of the header must end with the contents of
2063 // suffix_match.
2064 SuffixMatch string `json:"suffixMatch,omitempty"`
2065 // ForceSendFields is a list of field names (e.g. "ExactMatch") to
2066 // unconditionally include in API requests. By default, fields with empty or
2067 // default values are omitted from API requests. See
2068 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2069 // details.
2070 ForceSendFields []string `json:"-"`
2071 // NullFields is a list of field names (e.g. "ExactMatch") to include in API
2072 // requests with the JSON null value. By default, fields with empty values are
2073 // omitted from API requests. See
2074 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2075 NullFields []string `json:"-"`
2076 }
2077
2078 func (s HttpRouteHeaderMatch) MarshalJSON() ([]byte, error) {
2079 type NoMethod HttpRouteHeaderMatch
2080 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2081 }
2082
2083 // HttpRouteHeaderMatchIntegerRange: Represents an integer value range.
2084 type HttpRouteHeaderMatchIntegerRange struct {
2085 // End: End of the range (exclusive)
2086 End int64 `json:"end,omitempty"`
2087 // Start: Start of the range (inclusive)
2088 Start int64 `json:"start,omitempty"`
2089 // ForceSendFields is a list of field names (e.g. "End") to unconditionally
2090 // include in API requests. By default, fields with empty or default values are
2091 // omitted from API requests. See
2092 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2093 // details.
2094 ForceSendFields []string `json:"-"`
2095 // NullFields is a list of field names (e.g. "End") to include in API requests
2096 // with the JSON null value. By default, fields with empty values are omitted
2097 // from API requests. See
2098 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2099 NullFields []string `json:"-"`
2100 }
2101
2102 func (s HttpRouteHeaderMatchIntegerRange) MarshalJSON() ([]byte, error) {
2103 type NoMethod HttpRouteHeaderMatchIntegerRange
2104 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2105 }
2106
2107 // HttpRouteHeaderModifier: The specification for modifying HTTP header in HTTP
2108 // request and HTTP response.
2109 type HttpRouteHeaderModifier struct {
2110 // Add: Add the headers with given map where key is the name of the header,
2111 // value is the value of the header.
2112 Add map[string]string `json:"add,omitempty"`
2113 // Remove: Remove headers (matching by header names) specified in the list.
2114 Remove []string `json:"remove,omitempty"`
2115 // Set: Completely overwrite/replace the headers with given map where key is
2116 // the name of the header, value is the value of the header.
2117 Set map[string]string `json:"set,omitempty"`
2118 // ForceSendFields is a list of field names (e.g. "Add") to unconditionally
2119 // include in API requests. By default, fields with empty or default values are
2120 // omitted from API requests. See
2121 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2122 // details.
2123 ForceSendFields []string `json:"-"`
2124 // NullFields is a list of field names (e.g. "Add") to include in API requests
2125 // with the JSON null value. By default, fields with empty values are omitted
2126 // from API requests. See
2127 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2128 NullFields []string `json:"-"`
2129 }
2130
2131 func (s HttpRouteHeaderModifier) MarshalJSON() ([]byte, error) {
2132 type NoMethod HttpRouteHeaderModifier
2133 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2134 }
2135
2136 // HttpRouteHttpDirectResponse: Static HTTP response object to be returned.
2137 type HttpRouteHttpDirectResponse struct {
2138 // BytesBody: Optional. Response body as bytes. Maximum body size is 4096B.
2139 BytesBody string `json:"bytesBody,omitempty"`
2140 // Status: Required. Status to return as part of HTTP Response. Must be a
2141 // positive integer.
2142 Status int64 `json:"status,omitempty"`
2143 // StringBody: Optional. Response body as a string. Maximum body length is 1024
2144 // characters.
2145 StringBody string `json:"stringBody,omitempty"`
2146 // ForceSendFields is a list of field names (e.g. "BytesBody") to
2147 // unconditionally include in API requests. By default, fields with empty or
2148 // default values are omitted from API requests. See
2149 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2150 // details.
2151 ForceSendFields []string `json:"-"`
2152 // NullFields is a list of field names (e.g. "BytesBody") to include in API
2153 // requests with the JSON null value. By default, fields with empty values are
2154 // omitted from API requests. See
2155 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2156 NullFields []string `json:"-"`
2157 }
2158
2159 func (s HttpRouteHttpDirectResponse) MarshalJSON() ([]byte, error) {
2160 type NoMethod HttpRouteHttpDirectResponse
2161 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2162 }
2163
2164 // HttpRouteQueryParameterMatch: Specifications to match a query parameter in
2165 // the request.
2166 type HttpRouteQueryParameterMatch struct {
2167 // ExactMatch: The value of the query parameter must exactly match the contents
2168 // of exact_match. Only one of exact_match, regex_match, or present_match must
2169 // be set.
2170 ExactMatch string `json:"exactMatch,omitempty"`
2171 // PresentMatch: Specifies that the QueryParameterMatcher matches if request
2172 // contains query parameter, irrespective of whether the parameter has a value
2173 // or not. Only one of exact_match, regex_match, or present_match must be set.
2174 PresentMatch bool `json:"presentMatch,omitempty"`
2175 // QueryParameter: The name of the query parameter to match.
2176 QueryParameter string `json:"queryParameter,omitempty"`
2177 // RegexMatch: The value of the query parameter must match the regular
2178 // expression specified by regex_match. For regular expression grammar, please
2179 // see https://github.com/google/re2/wiki/Syntax Only one of exact_match,
2180 // regex_match, or present_match must be set.
2181 RegexMatch string `json:"regexMatch,omitempty"`
2182 // ForceSendFields is a list of field names (e.g. "ExactMatch") to
2183 // unconditionally include in API requests. By default, fields with empty or
2184 // default values are omitted from API requests. See
2185 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2186 // details.
2187 ForceSendFields []string `json:"-"`
2188 // NullFields is a list of field names (e.g. "ExactMatch") to include in API
2189 // requests with the JSON null value. By default, fields with empty values are
2190 // omitted from API requests. See
2191 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2192 NullFields []string `json:"-"`
2193 }
2194
2195 func (s HttpRouteQueryParameterMatch) MarshalJSON() ([]byte, error) {
2196 type NoMethod HttpRouteQueryParameterMatch
2197 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2198 }
2199
2200 // HttpRouteRedirect: The specification for redirecting traffic.
2201 type HttpRouteRedirect struct {
2202 // HostRedirect: The host that will be used in the redirect response instead of
2203 // the one that was supplied in the request.
2204 HostRedirect string `json:"hostRedirect,omitempty"`
2205 // HttpsRedirect: If set to true, the URL scheme in the redirected request is
2206 // set to https. If set to false, the URL scheme of the redirected request will
2207 // remain the same as that of the request. The default is set to false.
2208 HttpsRedirect bool `json:"httpsRedirect,omitempty"`
2209 // PathRedirect: The path that will be used in the redirect response instead of
2210 // the one that was supplied in the request. path_redirect can not be supplied
2211 // together with prefix_redirect. Supply one alone or neither. If neither is
2212 // supplied, the path of the original request will be used for the redirect.
2213 PathRedirect string `json:"pathRedirect,omitempty"`
2214 // PortRedirect: The port that will be used in the redirected request instead
2215 // of the one that was supplied in the request.
2216 PortRedirect int64 `json:"portRedirect,omitempty"`
2217 // PrefixRewrite: Indicates that during redirection, the matched prefix (or
2218 // path) should be swapped with this value. This option allows URLs be
2219 // dynamically created based on the request.
2220 PrefixRewrite string `json:"prefixRewrite,omitempty"`
2221 // ResponseCode: The HTTP Status code to use for the redirect.
2222 //
2223 // Possible values:
2224 // "RESPONSE_CODE_UNSPECIFIED" - Default value
2225 // "MOVED_PERMANENTLY_DEFAULT" - Corresponds to 301.
2226 // "FOUND" - Corresponds to 302.
2227 // "SEE_OTHER" - Corresponds to 303.
2228 // "TEMPORARY_REDIRECT" - Corresponds to 307. In this case, the request
2229 // method will be retained.
2230 // "PERMANENT_REDIRECT" - Corresponds to 308. In this case, the request
2231 // method will be retained.
2232 ResponseCode string `json:"responseCode,omitempty"`
2233 // StripQuery: if set to true, any accompanying query portion of the original
2234 // URL is removed prior to redirecting the request. If set to false, the query
2235 // portion of the original URL is retained. The default is set to false.
2236 StripQuery bool `json:"stripQuery,omitempty"`
2237 // ForceSendFields is a list of field names (e.g. "HostRedirect") to
2238 // unconditionally include in API requests. By default, fields with empty or
2239 // default values are omitted from API requests. See
2240 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2241 // details.
2242 ForceSendFields []string `json:"-"`
2243 // NullFields is a list of field names (e.g. "HostRedirect") to include in API
2244 // requests with the JSON null value. By default, fields with empty values are
2245 // omitted from API requests. See
2246 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2247 NullFields []string `json:"-"`
2248 }
2249
2250 func (s HttpRouteRedirect) MarshalJSON() ([]byte, error) {
2251 type NoMethod HttpRouteRedirect
2252 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2253 }
2254
2255 // HttpRouteRequestMirrorPolicy: Specifies the policy on how requests are
2256 // shadowed to a separate mirrored destination service. The proxy does not wait
2257 // for responses from the shadow service. Prior to sending traffic to the
2258 // shadow service, the host/authority header is suffixed with -shadow.
2259 // Mirroring is currently not supported for Cloud Run destinations.
2260 type HttpRouteRequestMirrorPolicy struct {
2261 // Destination: The destination the requests will be mirrored to. The weight of
2262 // the destination will be ignored.
2263 Destination *HttpRouteDestination `json:"destination,omitempty"`
2264 // MirrorPercent: Optional. The percentage of requests to get mirrored to the
2265 // desired destination.
2266 MirrorPercent float64 `json:"mirrorPercent,omitempty"`
2267 // ForceSendFields is a list of field names (e.g. "Destination") to
2268 // unconditionally include in API requests. By default, fields with empty or
2269 // default values are omitted from API requests. See
2270 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2271 // details.
2272 ForceSendFields []string `json:"-"`
2273 // NullFields is a list of field names (e.g. "Destination") to include in API
2274 // requests with the JSON null value. By default, fields with empty values are
2275 // omitted from API requests. See
2276 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2277 NullFields []string `json:"-"`
2278 }
2279
2280 func (s HttpRouteRequestMirrorPolicy) MarshalJSON() ([]byte, error) {
2281 type NoMethod HttpRouteRequestMirrorPolicy
2282 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2283 }
2284
2285 func (s *HttpRouteRequestMirrorPolicy) UnmarshalJSON(data []byte) error {
2286 type NoMethod HttpRouteRequestMirrorPolicy
2287 var s1 struct {
2288 MirrorPercent gensupport.JSONFloat64 `json:"mirrorPercent"`
2289 *NoMethod
2290 }
2291 s1.NoMethod = (*NoMethod)(s)
2292 if err := json.Unmarshal(data, &s1); err != nil {
2293 return err
2294 }
2295 s.MirrorPercent = float64(s1.MirrorPercent)
2296 return nil
2297 }
2298
2299 // HttpRouteRetryPolicy: The specifications for retries.
2300 type HttpRouteRetryPolicy struct {
2301 // NumRetries: Specifies the allowed number of retries. This number must be >
2302 // 0. If not specified, default to 1.
2303 NumRetries int64 `json:"numRetries,omitempty"`
2304 // PerTryTimeout: Specifies a non-zero timeout per retry attempt.
2305 PerTryTimeout string `json:"perTryTimeout,omitempty"`
2306 // RetryConditions: Specifies one or more conditions when this retry policy
2307 // applies. Valid values are: 5xx: Proxy will attempt a retry if the
2308 // destination service responds with any 5xx response code, of if the
2309 // destination service does not respond at all, example: disconnect, reset,
2310 // read timeout, connection failure and refused streams. gateway-error: Similar
2311 // to 5xx, but only applies to response codes 502, 503, 504. reset: Proxy will
2312 // attempt a retry if the destination service does not respond at all
2313 // (disconnect/reset/read timeout) connect-failure: Proxy will retry on
2314 // failures connecting to destination for example due to connection timeouts.
2315 // retriable-4xx: Proxy will retry fro retriable 4xx response codes. Currently
2316 // the only retriable error supported is 409. refused-stream: Proxy will retry
2317 // if the destination resets the stream with a REFUSED_STREAM error code. This
2318 // reset type indicates that it is safe to retry.
2319 RetryConditions []string `json:"retryConditions,omitempty"`
2320 // ForceSendFields is a list of field names (e.g. "NumRetries") to
2321 // unconditionally include in API requests. By default, fields with empty or
2322 // default values are omitted from API requests. See
2323 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2324 // details.
2325 ForceSendFields []string `json:"-"`
2326 // NullFields is a list of field names (e.g. "NumRetries") to include in API
2327 // requests with the JSON null value. By default, fields with empty values are
2328 // omitted from API requests. See
2329 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2330 NullFields []string `json:"-"`
2331 }
2332
2333 func (s HttpRouteRetryPolicy) MarshalJSON() ([]byte, error) {
2334 type NoMethod HttpRouteRetryPolicy
2335 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2336 }
2337
2338 // HttpRouteRouteAction: The specifications for routing traffic and applying
2339 // associated policies.
2340 type HttpRouteRouteAction struct {
2341 // CorsPolicy: The specification for allowing client side cross-origin
2342 // requests.
2343 CorsPolicy *HttpRouteCorsPolicy `json:"corsPolicy,omitempty"`
2344 // Destinations: The destination to which traffic should be forwarded.
2345 Destinations []*HttpRouteDestination `json:"destinations,omitempty"`
2346 // DirectResponse: Optional. Static HTTP Response object to be returned
2347 // regardless of the request.
2348 DirectResponse *HttpRouteHttpDirectResponse `json:"directResponse,omitempty"`
2349 // FaultInjectionPolicy: The specification for fault injection introduced into
2350 // traffic to test the resiliency of clients to backend service failure. As
2351 // part of fault injection, when clients send requests to a backend service,
2352 // delays can be introduced on a percentage of requests before sending those
2353 // requests to the backend service. Similarly requests from clients can be
2354 // aborted for a percentage of requests. timeout and retry_policy will be
2355 // ignored by clients that are configured with a fault_injection_policy
2356 FaultInjectionPolicy *HttpRouteFaultInjectionPolicy `json:"faultInjectionPolicy,omitempty"`
2357 // IdleTimeout: Optional. Specifies the idle timeout for the selected route.
2358 // The idle timeout is defined as the period in which there are no bytes sent
2359 // or received on either the upstream or downstream connection. If not set, the
2360 // default idle timeout is 1 hour. If set to 0s, the timeout will be disabled.
2361 IdleTimeout string `json:"idleTimeout,omitempty"`
2362 // Redirect: If set, the request is directed as configured by this field.
2363 Redirect *HttpRouteRedirect `json:"redirect,omitempty"`
2364 // RequestHeaderModifier: The specification for modifying the headers of a
2365 // matching request prior to delivery of the request to the destination. If
2366 // HeaderModifiers are set on both the Destination and the RouteAction, they
2367 // will be merged. Conflicts between the two will not be resolved on the
2368 // configuration.
2369 RequestHeaderModifier *HttpRouteHeaderModifier `json:"requestHeaderModifier,omitempty"`
2370 // RequestMirrorPolicy: Specifies the policy on how requests intended for the
2371 // routes destination are shadowed to a separate mirrored destination. Proxy
2372 // will not wait for the shadow destination to respond before returning the
2373 // response. Prior to sending traffic to the shadow service, the host/authority
2374 // header is suffixed with -shadow.
2375 RequestMirrorPolicy *HttpRouteRequestMirrorPolicy `json:"requestMirrorPolicy,omitempty"`
2376 // ResponseHeaderModifier: The specification for modifying the headers of a
2377 // response prior to sending the response back to the client. If
2378 // HeaderModifiers are set on both the Destination and the RouteAction, they
2379 // will be merged. Conflicts between the two will not be resolved on the
2380 // configuration.
2381 ResponseHeaderModifier *HttpRouteHeaderModifier `json:"responseHeaderModifier,omitempty"`
2382 // RetryPolicy: Specifies the retry policy associated with this route.
2383 RetryPolicy *HttpRouteRetryPolicy `json:"retryPolicy,omitempty"`
2384 // StatefulSessionAffinity: Optional. Specifies cookie-based stateful session
2385 // affinity.
2386 StatefulSessionAffinity *HttpRouteStatefulSessionAffinityPolicy `json:"statefulSessionAffinity,omitempty"`
2387 // Timeout: Specifies the timeout for selected route. Timeout is computed from
2388 // the time the request has been fully processed (i.e. end of stream) up until
2389 // the response has been completely processed. Timeout includes all retries.
2390 Timeout string `json:"timeout,omitempty"`
2391 // UrlRewrite: The specification for rewrite URL before forwarding requests to
2392 // the destination.
2393 UrlRewrite *HttpRouteURLRewrite `json:"urlRewrite,omitempty"`
2394 // ForceSendFields is a list of field names (e.g. "CorsPolicy") to
2395 // unconditionally include in API requests. By default, fields with empty or
2396 // default values are omitted from API requests. See
2397 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2398 // details.
2399 ForceSendFields []string `json:"-"`
2400 // NullFields is a list of field names (e.g. "CorsPolicy") to include in API
2401 // requests with the JSON null value. By default, fields with empty values are
2402 // omitted from API requests. See
2403 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2404 NullFields []string `json:"-"`
2405 }
2406
2407 func (s HttpRouteRouteAction) MarshalJSON() ([]byte, error) {
2408 type NoMethod HttpRouteRouteAction
2409 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2410 }
2411
2412 // HttpRouteRouteMatch: RouteMatch defines specifications used to match
2413 // requests. If multiple match types are set, this RouteMatch will match if ALL
2414 // type of matches are matched.
2415 type HttpRouteRouteMatch struct {
2416 // FullPathMatch: The HTTP request path value should exactly match this value.
2417 // Only one of full_path_match, prefix_match, or regex_match should be used.
2418 FullPathMatch string `json:"fullPathMatch,omitempty"`
2419 // Headers: Specifies a list of HTTP request headers to match against. ALL of
2420 // the supplied headers must be matched.
2421 Headers []*HttpRouteHeaderMatch `json:"headers,omitempty"`
2422 // IgnoreCase: Specifies if prefix_match and full_path_match matches are case
2423 // sensitive. The default value is false.
2424 IgnoreCase bool `json:"ignoreCase,omitempty"`
2425 // PrefixMatch: The HTTP request path value must begin with specified
2426 // prefix_match. prefix_match must begin with a /. Only one of full_path_match,
2427 // prefix_match, or regex_match should be used.
2428 PrefixMatch string `json:"prefixMatch,omitempty"`
2429 // QueryParameters: Specifies a list of query parameters to match against. ALL
2430 // of the query parameters must be matched.
2431 QueryParameters []*HttpRouteQueryParameterMatch `json:"queryParameters,omitempty"`
2432 // RegexMatch: The HTTP request path value must satisfy the regular expression
2433 // specified by regex_match after removing any query parameters and anchor
2434 // supplied with the original URL. For regular expression grammar, please see
2435 // https://github.com/google/re2/wiki/Syntax Only one of full_path_match,
2436 // prefix_match, or regex_match should be used.
2437 RegexMatch string `json:"regexMatch,omitempty"`
2438 // ForceSendFields is a list of field names (e.g. "FullPathMatch") to
2439 // unconditionally include in API requests. By default, fields with empty or
2440 // default values are omitted from API requests. See
2441 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2442 // details.
2443 ForceSendFields []string `json:"-"`
2444 // NullFields is a list of field names (e.g. "FullPathMatch") to include in API
2445 // requests with the JSON null value. By default, fields with empty values are
2446 // omitted from API requests. See
2447 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2448 NullFields []string `json:"-"`
2449 }
2450
2451 func (s HttpRouteRouteMatch) MarshalJSON() ([]byte, error) {
2452 type NoMethod HttpRouteRouteMatch
2453 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2454 }
2455
2456 // HttpRouteRouteRule: Specifies how to match traffic and how to route traffic
2457 // when traffic is matched.
2458 type HttpRouteRouteRule struct {
2459 // Action: The detailed rule defining how to route matched traffic.
2460 Action *HttpRouteRouteAction `json:"action,omitempty"`
2461 // Matches: A list of matches define conditions used for matching the rule
2462 // against incoming HTTP requests. Each match is independent, i.e. this rule
2463 // will be matched if ANY one of the matches is satisfied. If no matches field
2464 // is specified, this rule will unconditionally match traffic. If a default
2465 // rule is desired to be configured, add a rule with no matches specified to
2466 // the end of the rules list.
2467 Matches []*HttpRouteRouteMatch `json:"matches,omitempty"`
2468 // ForceSendFields is a list of field names (e.g. "Action") to unconditionally
2469 // include in API requests. By default, fields with empty or default values are
2470 // omitted from API requests. See
2471 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2472 // details.
2473 ForceSendFields []string `json:"-"`
2474 // NullFields is a list of field names (e.g. "Action") to include in API
2475 // requests with the JSON null value. By default, fields with empty values are
2476 // omitted from API requests. See
2477 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2478 NullFields []string `json:"-"`
2479 }
2480
2481 func (s HttpRouteRouteRule) MarshalJSON() ([]byte, error) {
2482 type NoMethod HttpRouteRouteRule
2483 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2484 }
2485
2486 // HttpRouteStatefulSessionAffinityPolicy: The specification for cookie-based
2487 // stateful session affinity where the date plane supplies a “session
2488 // cookie” with the name "GSSA" which encodes a specific destination host and
2489 // each request containing that cookie will be directed to that host as long as
2490 // the destination host remains up and healthy. The gRPC proxyless mesh library
2491 // or sidecar proxy will manage the session cookie but the client application
2492 // code is responsible for copying the cookie from each RPC in the session to
2493 // the next.
2494 type HttpRouteStatefulSessionAffinityPolicy struct {
2495 // CookieTtl: Required. The cookie TTL value for the Set-Cookie header
2496 // generated by the data plane. The lifetime of the cookie may be set to a
2497 // value from 0 to 86400 seconds (24 hours) inclusive. Set this to 0s to use a
2498 // session cookie and disable cookie expiration.
2499 CookieTtl string `json:"cookieTtl,omitempty"`
2500 // ForceSendFields is a list of field names (e.g. "CookieTtl") to
2501 // unconditionally include in API requests. By default, fields with empty or
2502 // default values are omitted from API requests. See
2503 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2504 // details.
2505 ForceSendFields []string `json:"-"`
2506 // NullFields is a list of field names (e.g. "CookieTtl") to include in API
2507 // requests with the JSON null value. By default, fields with empty values are
2508 // omitted from API requests. See
2509 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2510 NullFields []string `json:"-"`
2511 }
2512
2513 func (s HttpRouteStatefulSessionAffinityPolicy) MarshalJSON() ([]byte, error) {
2514 type NoMethod HttpRouteStatefulSessionAffinityPolicy
2515 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2516 }
2517
2518 // HttpRouteURLRewrite: The specification for modifying the URL of the request,
2519 // prior to forwarding the request to the destination.
2520 type HttpRouteURLRewrite struct {
2521 // HostRewrite: Prior to forwarding the request to the selected destination,
2522 // the requests host header is replaced by this value.
2523 HostRewrite string `json:"hostRewrite,omitempty"`
2524 // PathPrefixRewrite: Prior to forwarding the request to the selected
2525 // destination, the matching portion of the requests path is replaced by this
2526 // value.
2527 PathPrefixRewrite string `json:"pathPrefixRewrite,omitempty"`
2528 // ForceSendFields is a list of field names (e.g. "HostRewrite") to
2529 // unconditionally include in API requests. By default, fields with empty or
2530 // default values are omitted from API requests. See
2531 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2532 // details.
2533 ForceSendFields []string `json:"-"`
2534 // NullFields is a list of field names (e.g. "HostRewrite") to include in API
2535 // requests with the JSON null value. By default, fields with empty values are
2536 // omitted from API requests. See
2537 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2538 NullFields []string `json:"-"`
2539 }
2540
2541 func (s HttpRouteURLRewrite) MarshalJSON() ([]byte, error) {
2542 type NoMethod HttpRouteURLRewrite
2543 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2544 }
2545
2546 // LbEdgeExtension: `LbEdgeExtension` is a resource that lets the extension
2547 // service influence the selection of backend services and Cloud CDN cache keys
2548 // by modifying request headers.
2549 type LbEdgeExtension struct {
2550 // CreateTime: Output only. The timestamp when the resource was created.
2551 CreateTime string `json:"createTime,omitempty"`
2552 // Description: Optional. A human-readable description of the resource.
2553 Description string `json:"description,omitempty"`
2554 // ExtensionChains: Required. A set of ordered extension chains that contain
2555 // the match conditions and extensions to execute. Match conditions for each
2556 // extension chain are evaluated in sequence for a given request. The first
2557 // extension chain that has a condition that matches the request is executed.
2558 // Any subsequent extension chains do not execute. Limited to 5 extension
2559 // chains per resource.
2560 ExtensionChains []*ExtensionChain `json:"extensionChains,omitempty"`
2561 // ForwardingRules: Required. A list of references to the forwarding rules to
2562 // which this service extension is attached. At least one forwarding rule is
2563 // required. Only one `LbEdgeExtension` resource can be associated with a
2564 // forwarding rule.
2565 ForwardingRules []string `json:"forwardingRules,omitempty"`
2566 // Labels: Optional. Set of labels associated with the `LbEdgeExtension`
2567 // resource. The format must comply with the requirements for labels
2568 // (https://cloud.google.com/compute/docs/labeling-resources#requirements) for
2569 // Google Cloud resources.
2570 Labels map[string]string `json:"labels,omitempty"`
2571 // LoadBalancingScheme: Required. All forwarding rules referenced by this
2572 // extension must share the same load balancing scheme. Supported values:
2573 // `EXTERNAL_MANAGED`.
2574 //
2575 // Possible values:
2576 // "LOAD_BALANCING_SCHEME_UNSPECIFIED" - Default value. Do not use.
2577 // "INTERNAL_MANAGED" - Signifies that this is used for Internal HTTP(S) Load
2578 // Balancing.
2579 // "EXTERNAL_MANAGED" - Signifies that this is used for External Managed
2580 // HTTP(S) Load Balancing.
2581 LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"`
2582 // Name: Required. Identifier. Name of the `LbEdgeExtension` resource in the
2583 // following format:
2584 // `projects/{project}/locations/{location}/lbEdgeExtensions/{lb_edge_extension}
2585 // `.
2586 Name string `json:"name,omitempty"`
2587 // UpdateTime: Output only. The timestamp when the resource was updated.
2588 UpdateTime string `json:"updateTime,omitempty"`
2589
2590 // ServerResponse contains the HTTP response code and headers from the server.
2591 googleapi.ServerResponse `json:"-"`
2592 // ForceSendFields is a list of field names (e.g. "CreateTime") to
2593 // unconditionally include in API requests. By default, fields with empty or
2594 // default values are omitted from API requests. See
2595 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2596 // details.
2597 ForceSendFields []string `json:"-"`
2598 // NullFields is a list of field names (e.g. "CreateTime") to include in API
2599 // requests with the JSON null value. By default, fields with empty values are
2600 // omitted from API requests. See
2601 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2602 NullFields []string `json:"-"`
2603 }
2604
2605 func (s LbEdgeExtension) MarshalJSON() ([]byte, error) {
2606 type NoMethod LbEdgeExtension
2607 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2608 }
2609
2610 // LbRouteExtension: `LbRouteExtension` is a resource that lets you control
2611 // where traffic is routed to for a given request.
2612 type LbRouteExtension struct {
2613 // CreateTime: Output only. The timestamp when the resource was created.
2614 CreateTime string `json:"createTime,omitempty"`
2615 // Description: Optional. A human-readable description of the resource.
2616 Description string `json:"description,omitempty"`
2617 // ExtensionChains: Required. A set of ordered extension chains that contain
2618 // the match conditions and extensions to execute. Match conditions for each
2619 // extension chain are evaluated in sequence for a given request. The first
2620 // extension chain that has a condition that matches the request is executed.
2621 // Any subsequent extension chains do not execute. Limited to 5 extension
2622 // chains per resource.
2623 ExtensionChains []*ExtensionChain `json:"extensionChains,omitempty"`
2624 // ForwardingRules: Required. A list of references to the forwarding rules to
2625 // which this service extension is attached. At least one forwarding rule is
2626 // required. Only one `LbRouteExtension` resource can be associated with a
2627 // forwarding rule.
2628 ForwardingRules []string `json:"forwardingRules,omitempty"`
2629 // Labels: Optional. Set of labels associated with the `LbRouteExtension`
2630 // resource. The format must comply with the requirements for labels
2631 // (https://cloud.google.com/compute/docs/labeling-resources#requirements) for
2632 // Google Cloud resources.
2633 Labels map[string]string `json:"labels,omitempty"`
2634 // LoadBalancingScheme: Required. All backend services and forwarding rules
2635 // referenced by this extension must share the same load balancing scheme.
2636 // Supported values: `INTERNAL_MANAGED`, `EXTERNAL_MANAGED`. For more
2637 // information, refer to Backend services overview
2638 // (https://cloud.google.com/load-balancing/docs/backend-service).
2639 //
2640 // Possible values:
2641 // "LOAD_BALANCING_SCHEME_UNSPECIFIED" - Default value. Do not use.
2642 // "INTERNAL_MANAGED" - Signifies that this is used for Internal HTTP(S) Load
2643 // Balancing.
2644 // "EXTERNAL_MANAGED" - Signifies that this is used for External Managed
2645 // HTTP(S) Load Balancing.
2646 LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"`
2647 // Metadata: Optional. The metadata provided here is included as part of the
2648 // `metadata_context` (of type `google.protobuf.Struct`) in the
2649 // `ProcessingRequest` message sent to the extension server. The metadata
2650 // applies to all extensions in all extensions chains in this resource. The
2651 // metadata is available under the key `com.google.lb_route_extension.`. The
2652 // following variables are supported in the metadata: `{forwarding_rule_id}` -
2653 // substituted with the forwarding rule's fully qualified resource name. This
2654 // field must not be set if at least one of the extension chains contains
2655 // plugin extensions. Setting it results in a validation error. You can set
2656 // metadata at either the resource level or the extension level. The extension
2657 // level metadata is recommended because you can pass a different set of
2658 // metadata through each extension to the backend.
2659 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
2660 // Name: Required. Identifier. Name of the `LbRouteExtension` resource in the
2661 // following format:
2662 // `projects/{project}/locations/{location}/lbRouteExtensions/{lb_route_extensio
2663 // n}`.
2664 Name string `json:"name,omitempty"`
2665 // UpdateTime: Output only. The timestamp when the resource was updated.
2666 UpdateTime string `json:"updateTime,omitempty"`
2667
2668 // ServerResponse contains the HTTP response code and headers from the server.
2669 googleapi.ServerResponse `json:"-"`
2670 // ForceSendFields is a list of field names (e.g. "CreateTime") to
2671 // unconditionally include in API requests. By default, fields with empty or
2672 // default values are omitted from API requests. See
2673 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2674 // details.
2675 ForceSendFields []string `json:"-"`
2676 // NullFields is a list of field names (e.g. "CreateTime") to include in API
2677 // requests with the JSON null value. By default, fields with empty values are
2678 // omitted from API requests. See
2679 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2680 NullFields []string `json:"-"`
2681 }
2682
2683 func (s LbRouteExtension) MarshalJSON() ([]byte, error) {
2684 type NoMethod LbRouteExtension
2685 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2686 }
2687
2688 // LbTrafficExtension: `LbTrafficExtension` is a resource that lets the
2689 // extension service modify the headers and payloads of both requests and
2690 // responses without impacting the choice of backend services or any other
2691 // security policies associated with the backend service.
2692 type LbTrafficExtension struct {
2693 // CreateTime: Output only. The timestamp when the resource was created.
2694 CreateTime string `json:"createTime,omitempty"`
2695 // Description: Optional. A human-readable description of the resource.
2696 Description string `json:"description,omitempty"`
2697 // ExtensionChains: Required. A set of ordered extension chains that contain
2698 // the match conditions and extensions to execute. Match conditions for each
2699 // extension chain are evaluated in sequence for a given request. The first
2700 // extension chain that has a condition that matches the request is executed.
2701 // Any subsequent extension chains do not execute. Limited to 5 extension
2702 // chains per resource.
2703 ExtensionChains []*ExtensionChain `json:"extensionChains,omitempty"`
2704 // ForwardingRules: Optional. A list of references to the forwarding rules to
2705 // which this service extension is attached. At least one forwarding rule is
2706 // required. Only one `LbTrafficExtension` resource can be associated with a
2707 // forwarding rule.
2708 ForwardingRules []string `json:"forwardingRules,omitempty"`
2709 // Labels: Optional. Set of labels associated with the `LbTrafficExtension`
2710 // resource. The format must comply with the requirements for labels
2711 // (https://cloud.google.com/compute/docs/labeling-resources#requirements) for
2712 // Google Cloud resources.
2713 Labels map[string]string `json:"labels,omitempty"`
2714 // LoadBalancingScheme: Required. All backend services and forwarding rules
2715 // referenced by this extension must share the same load balancing scheme.
2716 // Supported values: `INTERNAL_MANAGED` and `EXTERNAL_MANAGED`. For more
2717 // information, refer to Backend services overview
2718 // (https://cloud.google.com/load-balancing/docs/backend-service).
2719 //
2720 // Possible values:
2721 // "LOAD_BALANCING_SCHEME_UNSPECIFIED" - Default value. Do not use.
2722 // "INTERNAL_MANAGED" - Signifies that this is used for Internal HTTP(S) Load
2723 // Balancing.
2724 // "EXTERNAL_MANAGED" - Signifies that this is used for External Managed
2725 // HTTP(S) Load Balancing.
2726 LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"`
2727 // Metadata: Optional. The metadata provided here is included as part of the
2728 // `metadata_context` (of type `google.protobuf.Struct`) in the
2729 // `ProcessingRequest` message sent to the extension server. The metadata
2730 // applies to all extensions in all extensions chains in this resource. The
2731 // metadata is available under the key `com.google.lb_traffic_extension.`. The
2732 // following variables are supported in the metadata: `{forwarding_rule_id}` -
2733 // substituted with the forwarding rule's fully qualified resource name. This
2734 // field must not be set if at least one of the extension chains contains
2735 // plugin extensions. Setting it results in a validation error. You can set
2736 // metadata at either the resource level or the extension level. The extension
2737 // level metadata is recommended because you can pass a different set of
2738 // metadata through each extension to the backend.
2739 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
2740 // Name: Required. Identifier. Name of the `LbTrafficExtension` resource in the
2741 // following format:
2742 // `projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_exte
2743 // nsion}`.
2744 Name string `json:"name,omitempty"`
2745 // UpdateTime: Output only. The timestamp when the resource was updated.
2746 UpdateTime string `json:"updateTime,omitempty"`
2747
2748 // ServerResponse contains the HTTP response code and headers from the server.
2749 googleapi.ServerResponse `json:"-"`
2750 // ForceSendFields is a list of field names (e.g. "CreateTime") to
2751 // unconditionally include in API requests. By default, fields with empty or
2752 // default values are omitted from API requests. See
2753 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2754 // details.
2755 ForceSendFields []string `json:"-"`
2756 // NullFields is a list of field names (e.g. "CreateTime") to include in API
2757 // requests with the JSON null value. By default, fields with empty values are
2758 // omitted from API requests. See
2759 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2760 NullFields []string `json:"-"`
2761 }
2762
2763 func (s LbTrafficExtension) MarshalJSON() ([]byte, error) {
2764 type NoMethod LbTrafficExtension
2765 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2766 }
2767
2768 // ListAuthzExtensionsResponse: Message for response to listing
2769 // `AuthzExtension` resources.
2770 type ListAuthzExtensionsResponse struct {
2771 // AuthzExtensions: The list of `AuthzExtension` resources.
2772 AuthzExtensions []*AuthzExtension `json:"authzExtensions,omitempty"`
2773 // NextPageToken: A token identifying a page of results that the server
2774 // returns.
2775 NextPageToken string `json:"nextPageToken,omitempty"`
2776 // Unreachable: Locations that could not be reached.
2777 Unreachable []string `json:"unreachable,omitempty"`
2778
2779 // ServerResponse contains the HTTP response code and headers from the server.
2780 googleapi.ServerResponse `json:"-"`
2781 // ForceSendFields is a list of field names (e.g. "AuthzExtensions") to
2782 // unconditionally include in API requests. By default, fields with empty or
2783 // default values are omitted from API requests. See
2784 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2785 // details.
2786 ForceSendFields []string `json:"-"`
2787 // NullFields is a list of field names (e.g. "AuthzExtensions") to include in
2788 // API requests with the JSON null value. By default, fields with empty values
2789 // are omitted from API requests. See
2790 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2791 NullFields []string `json:"-"`
2792 }
2793
2794 func (s ListAuthzExtensionsResponse) MarshalJSON() ([]byte, error) {
2795 type NoMethod ListAuthzExtensionsResponse
2796 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2797 }
2798
2799 // ListEndpointPoliciesResponse: Response returned by the ListEndpointPolicies
2800 // method.
2801 type ListEndpointPoliciesResponse struct {
2802 // EndpointPolicies: List of EndpointPolicy resources.
2803 EndpointPolicies []*EndpointPolicy `json:"endpointPolicies,omitempty"`
2804 // NextPageToken: If there might be more results than those appearing in this
2805 // response, then `next_page_token` is included. To get the next set of
2806 // results, call this method again using the value of `next_page_token` as
2807 // `page_token`.
2808 NextPageToken string `json:"nextPageToken,omitempty"`
2809 // Unreachable: Unreachable resources. Populated when the request opts into
2810 // return_partial_success and reading across collections e.g. when attempting
2811 // to list all resources across all supported locations.
2812 Unreachable []string `json:"unreachable,omitempty"`
2813
2814 // ServerResponse contains the HTTP response code and headers from the server.
2815 googleapi.ServerResponse `json:"-"`
2816 // ForceSendFields is a list of field names (e.g. "EndpointPolicies") to
2817 // unconditionally include in API requests. By default, fields with empty or
2818 // default values are omitted from API requests. See
2819 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2820 // details.
2821 ForceSendFields []string `json:"-"`
2822 // NullFields is a list of field names (e.g. "EndpointPolicies") to include in
2823 // API requests with the JSON null value. By default, fields with empty values
2824 // are omitted from API requests. See
2825 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2826 NullFields []string `json:"-"`
2827 }
2828
2829 func (s ListEndpointPoliciesResponse) MarshalJSON() ([]byte, error) {
2830 type NoMethod ListEndpointPoliciesResponse
2831 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2832 }
2833
2834 // ListGatewayRouteViewsResponse: Response returned by the
2835 // ListGatewayRouteViews method.
2836 type ListGatewayRouteViewsResponse struct {
2837 // GatewayRouteViews: List of GatewayRouteView resources.
2838 GatewayRouteViews []*GatewayRouteView `json:"gatewayRouteViews,omitempty"`
2839 // NextPageToken: A token, which can be sent as `page_token` to retrieve the
2840 // next page. If this field is omitted, there are no subsequent pages.
2841 NextPageToken string `json:"nextPageToken,omitempty"`
2842 // Unreachable: Unreachable resources. Populated when the request attempts to
2843 // list all resources across all supported locations, while some locations are
2844 // temporarily unavailable.
2845 Unreachable []string `json:"unreachable,omitempty"`
2846
2847 // ServerResponse contains the HTTP response code and headers from the server.
2848 googleapi.ServerResponse `json:"-"`
2849 // ForceSendFields is a list of field names (e.g. "GatewayRouteViews") to
2850 // unconditionally include in API requests. By default, fields with empty or
2851 // default values are omitted from API requests. See
2852 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2853 // details.
2854 ForceSendFields []string `json:"-"`
2855 // NullFields is a list of field names (e.g. "GatewayRouteViews") to include in
2856 // API requests with the JSON null value. By default, fields with empty values
2857 // are omitted from API requests. See
2858 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2859 NullFields []string `json:"-"`
2860 }
2861
2862 func (s ListGatewayRouteViewsResponse) MarshalJSON() ([]byte, error) {
2863 type NoMethod ListGatewayRouteViewsResponse
2864 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2865 }
2866
2867 // ListGatewaysResponse: Response returned by the ListGateways method.
2868 type ListGatewaysResponse struct {
2869 // Gateways: List of Gateway resources.
2870 Gateways []*Gateway `json:"gateways,omitempty"`
2871 // NextPageToken: If there might be more results than those appearing in this
2872 // response, then `next_page_token` is included. To get the next set of
2873 // results, call this method again using the value of `next_page_token` as
2874 // `page_token`.
2875 NextPageToken string `json:"nextPageToken,omitempty"`
2876 // Unreachable: Locations that could not be reached.
2877 Unreachable []string `json:"unreachable,omitempty"`
2878
2879 // ServerResponse contains the HTTP response code and headers from the server.
2880 googleapi.ServerResponse `json:"-"`
2881 // ForceSendFields is a list of field names (e.g. "Gateways") to
2882 // unconditionally include in API requests. By default, fields with empty or
2883 // default values are omitted from API requests. See
2884 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2885 // details.
2886 ForceSendFields []string `json:"-"`
2887 // NullFields is a list of field names (e.g. "Gateways") to include in API
2888 // requests with the JSON null value. By default, fields with empty values are
2889 // omitted from API requests. See
2890 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2891 NullFields []string `json:"-"`
2892 }
2893
2894 func (s ListGatewaysResponse) MarshalJSON() ([]byte, error) {
2895 type NoMethod ListGatewaysResponse
2896 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2897 }
2898
2899 // ListGrpcRoutesResponse: Response returned by the ListGrpcRoutes method.
2900 type ListGrpcRoutesResponse struct {
2901 // GrpcRoutes: List of GrpcRoute resources.
2902 GrpcRoutes []*GrpcRoute `json:"grpcRoutes,omitempty"`
2903 // NextPageToken: If there might be more results than those appearing in this
2904 // response, then `next_page_token` is included. To get the next set of
2905 // results, call this method again using the value of `next_page_token` as
2906 // `page_token`.
2907 NextPageToken string `json:"nextPageToken,omitempty"`
2908 // Unreachable: Unreachable resources. Populated when the request opts into
2909 // return_partial_success and reading across collections e.g. when attempting
2910 // to list all resources across all supported locations.
2911 Unreachable []string `json:"unreachable,omitempty"`
2912
2913 // ServerResponse contains the HTTP response code and headers from the server.
2914 googleapi.ServerResponse `json:"-"`
2915 // ForceSendFields is a list of field names (e.g. "GrpcRoutes") to
2916 // unconditionally include in API requests. By default, fields with empty or
2917 // default values are omitted from API requests. See
2918 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2919 // details.
2920 ForceSendFields []string `json:"-"`
2921 // NullFields is a list of field names (e.g. "GrpcRoutes") to include in API
2922 // requests with the JSON null value. By default, fields with empty values are
2923 // omitted from API requests. See
2924 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2925 NullFields []string `json:"-"`
2926 }
2927
2928 func (s ListGrpcRoutesResponse) MarshalJSON() ([]byte, error) {
2929 type NoMethod ListGrpcRoutesResponse
2930 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2931 }
2932
2933 // ListHttpRoutesResponse: Response returned by the ListHttpRoutes method.
2934 type ListHttpRoutesResponse struct {
2935 // HttpRoutes: List of HttpRoute resources.
2936 HttpRoutes []*HttpRoute `json:"httpRoutes,omitempty"`
2937 // NextPageToken: If there might be more results than those appearing in this
2938 // response, then `next_page_token` is included. To get the next set of
2939 // results, call this method again using the value of `next_page_token` as
2940 // `page_token`.
2941 NextPageToken string `json:"nextPageToken,omitempty"`
2942 // Unreachable: Unreachable resources. Populated when the request opts into
2943 // return_partial_success and reading across collections e.g. when attempting
2944 // to list all resources across all supported locations.
2945 Unreachable []string `json:"unreachable,omitempty"`
2946
2947 // ServerResponse contains the HTTP response code and headers from the server.
2948 googleapi.ServerResponse `json:"-"`
2949 // ForceSendFields is a list of field names (e.g. "HttpRoutes") to
2950 // unconditionally include in API requests. By default, fields with empty or
2951 // default values are omitted from API requests. See
2952 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2953 // details.
2954 ForceSendFields []string `json:"-"`
2955 // NullFields is a list of field names (e.g. "HttpRoutes") to include in API
2956 // requests with the JSON null value. By default, fields with empty values are
2957 // omitted from API requests. See
2958 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2959 NullFields []string `json:"-"`
2960 }
2961
2962 func (s ListHttpRoutesResponse) MarshalJSON() ([]byte, error) {
2963 type NoMethod ListHttpRoutesResponse
2964 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2965 }
2966
2967 // ListLbEdgeExtensionsResponse: Message for response to listing
2968 // `LbEdgeExtension` resources.
2969 type ListLbEdgeExtensionsResponse struct {
2970 // LbEdgeExtensions: The list of `LbEdgeExtension` resources.
2971 LbEdgeExtensions []*LbEdgeExtension `json:"lbEdgeExtensions,omitempty"`
2972 // NextPageToken: A token identifying a page of results that the server
2973 // returns.
2974 NextPageToken string `json:"nextPageToken,omitempty"`
2975 // Unreachable: Locations that could not be reached.
2976 Unreachable []string `json:"unreachable,omitempty"`
2977
2978 // ServerResponse contains the HTTP response code and headers from the server.
2979 googleapi.ServerResponse `json:"-"`
2980 // ForceSendFields is a list of field names (e.g. "LbEdgeExtensions") to
2981 // unconditionally include in API requests. By default, fields with empty or
2982 // default values are omitted from API requests. See
2983 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2984 // details.
2985 ForceSendFields []string `json:"-"`
2986 // NullFields is a list of field names (e.g. "LbEdgeExtensions") to include in
2987 // API requests with the JSON null value. By default, fields with empty values
2988 // are omitted from API requests. See
2989 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2990 NullFields []string `json:"-"`
2991 }
2992
2993 func (s ListLbEdgeExtensionsResponse) MarshalJSON() ([]byte, error) {
2994 type NoMethod ListLbEdgeExtensionsResponse
2995 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2996 }
2997
2998 // ListLbRouteExtensionsResponse: Message for response to listing
2999 // `LbRouteExtension` resources.
3000 type ListLbRouteExtensionsResponse struct {
3001 // LbRouteExtensions: The list of `LbRouteExtension` resources.
3002 LbRouteExtensions []*LbRouteExtension `json:"lbRouteExtensions,omitempty"`
3003 // NextPageToken: A token identifying a page of results that the server
3004 // returns.
3005 NextPageToken string `json:"nextPageToken,omitempty"`
3006 // Unreachable: Locations that could not be reached.
3007 Unreachable []string `json:"unreachable,omitempty"`
3008
3009 // ServerResponse contains the HTTP response code and headers from the server.
3010 googleapi.ServerResponse `json:"-"`
3011 // ForceSendFields is a list of field names (e.g. "LbRouteExtensions") to
3012 // unconditionally include in API requests. By default, fields with empty or
3013 // default values are omitted from API requests. See
3014 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3015 // details.
3016 ForceSendFields []string `json:"-"`
3017 // NullFields is a list of field names (e.g. "LbRouteExtensions") to include in
3018 // API requests with the JSON null value. By default, fields with empty values
3019 // are omitted from API requests. See
3020 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3021 NullFields []string `json:"-"`
3022 }
3023
3024 func (s ListLbRouteExtensionsResponse) MarshalJSON() ([]byte, error) {
3025 type NoMethod ListLbRouteExtensionsResponse
3026 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3027 }
3028
3029 // ListLbTrafficExtensionsResponse: Message for response to listing
3030 // `LbTrafficExtension` resources.
3031 type ListLbTrafficExtensionsResponse struct {
3032 // LbTrafficExtensions: The list of `LbTrafficExtension` resources.
3033 LbTrafficExtensions []*LbTrafficExtension `json:"lbTrafficExtensions,omitempty"`
3034 // NextPageToken: A token identifying a page of results that the server
3035 // returns.
3036 NextPageToken string `json:"nextPageToken,omitempty"`
3037 // Unreachable: Locations that could not be reached.
3038 Unreachable []string `json:"unreachable,omitempty"`
3039
3040 // ServerResponse contains the HTTP response code and headers from the server.
3041 googleapi.ServerResponse `json:"-"`
3042 // ForceSendFields is a list of field names (e.g. "LbTrafficExtensions") to
3043 // unconditionally include in API requests. By default, fields with empty or
3044 // default values are omitted from API requests. See
3045 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3046 // details.
3047 ForceSendFields []string `json:"-"`
3048 // NullFields is a list of field names (e.g. "LbTrafficExtensions") to include
3049 // in API requests with the JSON null value. By default, fields with empty
3050 // values are omitted from API requests. See
3051 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3052 NullFields []string `json:"-"`
3053 }
3054
3055 func (s ListLbTrafficExtensionsResponse) MarshalJSON() ([]byte, error) {
3056 type NoMethod ListLbTrafficExtensionsResponse
3057 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3058 }
3059
3060 // ListLocationsResponse: The response message for Locations.ListLocations.
3061 type ListLocationsResponse struct {
3062 // Locations: A list of locations that matches the specified filter in the
3063 // request.
3064 Locations []*Location `json:"locations,omitempty"`
3065 // NextPageToken: The standard List next-page token.
3066 NextPageToken string `json:"nextPageToken,omitempty"`
3067
3068 // ServerResponse contains the HTTP response code and headers from the server.
3069 googleapi.ServerResponse `json:"-"`
3070 // ForceSendFields is a list of field names (e.g. "Locations") to
3071 // unconditionally include in API requests. By default, fields with empty or
3072 // default values are omitted from API requests. See
3073 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3074 // details.
3075 ForceSendFields []string `json:"-"`
3076 // NullFields is a list of field names (e.g. "Locations") to include in API
3077 // requests with the JSON null value. By default, fields with empty values are
3078 // omitted from API requests. See
3079 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3080 NullFields []string `json:"-"`
3081 }
3082
3083 func (s ListLocationsResponse) MarshalJSON() ([]byte, error) {
3084 type NoMethod ListLocationsResponse
3085 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3086 }
3087
3088 // ListMeshRouteViewsResponse: Response returned by the ListMeshRouteViews
3089 // method.
3090 type ListMeshRouteViewsResponse struct {
3091 // MeshRouteViews: List of MeshRouteView resources.
3092 MeshRouteViews []*MeshRouteView `json:"meshRouteViews,omitempty"`
3093 // NextPageToken: A token, which can be sent as `page_token` to retrieve the
3094 // next page. If this field is omitted, there are no subsequent pages.
3095 NextPageToken string `json:"nextPageToken,omitempty"`
3096 // Unreachable: Unreachable resources. Populated when the request attempts to
3097 // list all resources across all supported locations, while some locations are
3098 // temporarily unavailable.
3099 Unreachable []string `json:"unreachable,omitempty"`
3100
3101 // ServerResponse contains the HTTP response code and headers from the server.
3102 googleapi.ServerResponse `json:"-"`
3103 // ForceSendFields is a list of field names (e.g. "MeshRouteViews") to
3104 // unconditionally include in API requests. By default, fields with empty or
3105 // default values are omitted from API requests. See
3106 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3107 // details.
3108 ForceSendFields []string `json:"-"`
3109 // NullFields is a list of field names (e.g. "MeshRouteViews") to include in
3110 // API requests with the JSON null value. By default, fields with empty values
3111 // are omitted from API requests. See
3112 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3113 NullFields []string `json:"-"`
3114 }
3115
3116 func (s ListMeshRouteViewsResponse) MarshalJSON() ([]byte, error) {
3117 type NoMethod ListMeshRouteViewsResponse
3118 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3119 }
3120
3121 // ListMeshesResponse: Response returned by the ListMeshes method.
3122 type ListMeshesResponse struct {
3123 // Meshes: List of Mesh resources.
3124 Meshes []*Mesh `json:"meshes,omitempty"`
3125 // NextPageToken: If there might be more results than those appearing in this
3126 // response, then `next_page_token` is included. To get the next set of
3127 // results, call this method again using the value of `next_page_token` as
3128 // `page_token`.
3129 NextPageToken string `json:"nextPageToken,omitempty"`
3130 // Unreachable: Unreachable resources. Populated when the request opts into
3131 // `return_partial_success` and reading across collections e.g. when attempting
3132 // to list all resources across all supported locations.
3133 Unreachable []string `json:"unreachable,omitempty"`
3134
3135 // ServerResponse contains the HTTP response code and headers from the server.
3136 googleapi.ServerResponse `json:"-"`
3137 // ForceSendFields is a list of field names (e.g. "Meshes") to unconditionally
3138 // include in API requests. By default, fields with empty or default values are
3139 // omitted from API requests. See
3140 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3141 // details.
3142 ForceSendFields []string `json:"-"`
3143 // NullFields is a list of field names (e.g. "Meshes") to include in API
3144 // requests with the JSON null value. By default, fields with empty values are
3145 // omitted from API requests. See
3146 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3147 NullFields []string `json:"-"`
3148 }
3149
3150 func (s ListMeshesResponse) MarshalJSON() ([]byte, error) {
3151 type NoMethod ListMeshesResponse
3152 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3153 }
3154
3155 // ListOperationsResponse: The response message for Operations.ListOperations.
3156 type ListOperationsResponse struct {
3157 // NextPageToken: The standard List next-page token.
3158 NextPageToken string `json:"nextPageToken,omitempty"`
3159 // Operations: A list of operations that matches the specified filter in the
3160 // request.
3161 Operations []*Operation `json:"operations,omitempty"`
3162 // Unreachable: Unordered list. Unreachable resources. Populated when the
3163 // request sets `ListOperationsRequest.return_partial_success` and reads across
3164 // collections. For example, when attempting to list all resources across all
3165 // supported locations.
3166 Unreachable []string `json:"unreachable,omitempty"`
3167
3168 // ServerResponse contains the HTTP response code and headers from the server.
3169 googleapi.ServerResponse `json:"-"`
3170 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
3171 // unconditionally include in API requests. By default, fields with empty or
3172 // default values are omitted from API requests. See
3173 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3174 // details.
3175 ForceSendFields []string `json:"-"`
3176 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
3177 // requests with the JSON null value. By default, fields with empty values are
3178 // omitted from API requests. See
3179 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3180 NullFields []string `json:"-"`
3181 }
3182
3183 func (s ListOperationsResponse) MarshalJSON() ([]byte, error) {
3184 type NoMethod ListOperationsResponse
3185 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3186 }
3187
3188 // ListServiceBindingsResponse: Response returned by the ListServiceBindings
3189 // method.
3190 type ListServiceBindingsResponse struct {
3191 // NextPageToken: If there might be more results than those appearing in this
3192 // response, then `next_page_token` is included. To get the next set of
3193 // results, call this method again using the value of `next_page_token` as
3194 // `page_token`.
3195 NextPageToken string `json:"nextPageToken,omitempty"`
3196 // ServiceBindings: List of ServiceBinding resources.
3197 ServiceBindings []*ServiceBinding `json:"serviceBindings,omitempty"`
3198 // Unreachable: Unreachable resources. Populated when the request attempts to
3199 // list all resources across all supported locations, while some locations are
3200 // temporarily unavailable.
3201 Unreachable []string `json:"unreachable,omitempty"`
3202
3203 // ServerResponse contains the HTTP response code and headers from the server.
3204 googleapi.ServerResponse `json:"-"`
3205 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
3206 // unconditionally include in API requests. By default, fields with empty or
3207 // default values are omitted from API requests. See
3208 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3209 // details.
3210 ForceSendFields []string `json:"-"`
3211 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
3212 // requests with the JSON null value. By default, fields with empty values are
3213 // omitted from API requests. See
3214 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3215 NullFields []string `json:"-"`
3216 }
3217
3218 func (s ListServiceBindingsResponse) MarshalJSON() ([]byte, error) {
3219 type NoMethod ListServiceBindingsResponse
3220 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3221 }
3222
3223 // ListServiceLbPoliciesResponse: Response returned by the
3224 // ListServiceLbPolicies method.
3225 type ListServiceLbPoliciesResponse struct {
3226 // NextPageToken: If there might be more results than those appearing in this
3227 // response, then `next_page_token` is included. To get the next set of
3228 // results, call this method again using the value of `next_page_token` as
3229 // `page_token`.
3230 NextPageToken string `json:"nextPageToken,omitempty"`
3231 // ServiceLbPolicies: List of ServiceLbPolicy resources.
3232 ServiceLbPolicies []*ServiceLbPolicy `json:"serviceLbPolicies,omitempty"`
3233 // Unreachable: Unreachable resources. Populated when the request attempts to
3234 // list all resources across all supported locations, while some locations are
3235 // temporarily unavailable.
3236 Unreachable []string `json:"unreachable,omitempty"`
3237
3238 // ServerResponse contains the HTTP response code and headers from the server.
3239 googleapi.ServerResponse `json:"-"`
3240 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
3241 // unconditionally include in API requests. By default, fields with empty or
3242 // default values are omitted from API requests. See
3243 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3244 // details.
3245 ForceSendFields []string `json:"-"`
3246 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
3247 // requests with the JSON null value. By default, fields with empty values are
3248 // omitted from API requests. See
3249 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3250 NullFields []string `json:"-"`
3251 }
3252
3253 func (s ListServiceLbPoliciesResponse) MarshalJSON() ([]byte, error) {
3254 type NoMethod ListServiceLbPoliciesResponse
3255 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3256 }
3257
3258 // ListTcpRoutesResponse: Response returned by the ListTcpRoutes method.
3259 type ListTcpRoutesResponse struct {
3260 // NextPageToken: If there might be more results than those appearing in this
3261 // response, then `next_page_token` is included. To get the next set of
3262 // results, call this method again using the value of `next_page_token` as
3263 // `page_token`.
3264 NextPageToken string `json:"nextPageToken,omitempty"`
3265 // TcpRoutes: List of TcpRoute resources.
3266 TcpRoutes []*TcpRoute `json:"tcpRoutes,omitempty"`
3267 // Unreachable: Unreachable resources. Populated when the request opts into
3268 // return_partial_success and reading across collections e.g. when attempting
3269 // to list all resources across all supported locations.
3270 Unreachable []string `json:"unreachable,omitempty"`
3271
3272 // ServerResponse contains the HTTP response code and headers from the server.
3273 googleapi.ServerResponse `json:"-"`
3274 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
3275 // unconditionally include in API requests. By default, fields with empty or
3276 // default values are omitted from API requests. See
3277 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3278 // details.
3279 ForceSendFields []string `json:"-"`
3280 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
3281 // requests with the JSON null value. By default, fields with empty values are
3282 // omitted from API requests. See
3283 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3284 NullFields []string `json:"-"`
3285 }
3286
3287 func (s ListTcpRoutesResponse) MarshalJSON() ([]byte, error) {
3288 type NoMethod ListTcpRoutesResponse
3289 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3290 }
3291
3292 // ListTlsRoutesResponse: Response returned by the ListTlsRoutes method.
3293 type ListTlsRoutesResponse struct {
3294 // NextPageToken: If there might be more results than those appearing in this
3295 // response, then `next_page_token` is included. To get the next set of
3296 // results, call this method again using the value of `next_page_token` as
3297 // `page_token`.
3298 NextPageToken string `json:"nextPageToken,omitempty"`
3299 // TlsRoutes: List of TlsRoute resources.
3300 TlsRoutes []*TlsRoute `json:"tlsRoutes,omitempty"`
3301 // Unreachable: Unreachable resources. Populated when the request opts into
3302 // return_partial_success and reading across collections e.g. when attempting
3303 // to list all resources across all supported locations.
3304 Unreachable []string `json:"unreachable,omitempty"`
3305
3306 // ServerResponse contains the HTTP response code and headers from the server.
3307 googleapi.ServerResponse `json:"-"`
3308 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
3309 // unconditionally include in API requests. By default, fields with empty or
3310 // default values are omitted from API requests. See
3311 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3312 // details.
3313 ForceSendFields []string `json:"-"`
3314 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
3315 // requests with the JSON null value. By default, fields with empty values are
3316 // omitted from API requests. See
3317 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3318 NullFields []string `json:"-"`
3319 }
3320
3321 func (s ListTlsRoutesResponse) MarshalJSON() ([]byte, error) {
3322 type NoMethod ListTlsRoutesResponse
3323 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3324 }
3325
3326 // ListWasmPluginVersionsResponse: Response returned by the
3327 // `ListWasmPluginVersions` method.
3328 type ListWasmPluginVersionsResponse struct {
3329 // NextPageToken: If there might be more results than those appearing in this
3330 // response, then `next_page_token` is included. To get the next set of
3331 // results, call this method again using the value of `next_page_token` as
3332 // `page_token`.
3333 NextPageToken string `json:"nextPageToken,omitempty"`
3334 // Unreachable: Unreachable resources. Populated when the request attempts to
3335 // list all resources across all supported locations, while some locations are
3336 // temporarily unavailable.
3337 Unreachable []string `json:"unreachable,omitempty"`
3338 // WasmPluginVersions: List of `WasmPluginVersion` resources.
3339 WasmPluginVersions []*WasmPluginVersion `json:"wasmPluginVersions,omitempty"`
3340
3341 // ServerResponse contains the HTTP response code and headers from the server.
3342 googleapi.ServerResponse `json:"-"`
3343 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
3344 // unconditionally include in API requests. By default, fields with empty or
3345 // default values are omitted from API requests. See
3346 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3347 // details.
3348 ForceSendFields []string `json:"-"`
3349 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
3350 // requests with the JSON null value. By default, fields with empty values are
3351 // omitted from API requests. See
3352 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3353 NullFields []string `json:"-"`
3354 }
3355
3356 func (s ListWasmPluginVersionsResponse) MarshalJSON() ([]byte, error) {
3357 type NoMethod ListWasmPluginVersionsResponse
3358 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3359 }
3360
3361 // ListWasmPluginsResponse: Response returned by the `ListWasmPlugins` method.
3362 type ListWasmPluginsResponse struct {
3363 // NextPageToken: If there might be more results than those appearing in this
3364 // response, then `next_page_token` is included. To get the next set of
3365 // results, call this method again using the value of `next_page_token` as
3366 // `page_token`.
3367 NextPageToken string `json:"nextPageToken,omitempty"`
3368 // Unreachable: Unreachable resources. Populated when the request attempts to
3369 // list all resources across all supported locations, while some locations are
3370 // temporarily unavailable.
3371 Unreachable []string `json:"unreachable,omitempty"`
3372 // WasmPlugins: List of `WasmPlugin` resources.
3373 WasmPlugins []*WasmPlugin `json:"wasmPlugins,omitempty"`
3374
3375 // ServerResponse contains the HTTP response code and headers from the server.
3376 googleapi.ServerResponse `json:"-"`
3377 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
3378 // unconditionally include in API requests. By default, fields with empty or
3379 // default values are omitted from API requests. See
3380 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3381 // details.
3382 ForceSendFields []string `json:"-"`
3383 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
3384 // requests with the JSON null value. By default, fields with empty values are
3385 // omitted from API requests. See
3386 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3387 NullFields []string `json:"-"`
3388 }
3389
3390 func (s ListWasmPluginsResponse) MarshalJSON() ([]byte, error) {
3391 type NoMethod ListWasmPluginsResponse
3392 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3393 }
3394
3395 // Location: A resource that represents a Google Cloud location.
3396 type Location struct {
3397 // DisplayName: The friendly name for this location, typically a nearby city
3398 // name. For example, "Tokyo".
3399 DisplayName string `json:"displayName,omitempty"`
3400 // Labels: Cross-service attributes for the location. For example
3401 // {"cloud.googleapis.com/region": "us-east1"}
3402 Labels map[string]string `json:"labels,omitempty"`
3403 // LocationId: The canonical id for this location. For example: "us-east1".
3404 LocationId string `json:"locationId,omitempty"`
3405 // Metadata: Service-specific metadata. For example the available capacity at
3406 // the given location.
3407 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
3408 // Name: Resource name for the location, which may vary between
3409 // implementations. For example:
3410 // "projects/example-project/locations/us-east1"
3411 Name string `json:"name,omitempty"`
3412
3413 // ServerResponse contains the HTTP response code and headers from the server.
3414 googleapi.ServerResponse `json:"-"`
3415 // ForceSendFields is a list of field names (e.g. "DisplayName") to
3416 // unconditionally include in API requests. By default, fields with empty or
3417 // default values are omitted from API requests. See
3418 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3419 // details.
3420 ForceSendFields []string `json:"-"`
3421 // NullFields is a list of field names (e.g. "DisplayName") to include in API
3422 // requests with the JSON null value. By default, fields with empty values are
3423 // omitted from API requests. See
3424 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3425 NullFields []string `json:"-"`
3426 }
3427
3428 func (s Location) MarshalJSON() ([]byte, error) {
3429 type NoMethod Location
3430 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3431 }
3432
3433 // LoggingConfig: The configuration for Platform Telemetry logging for Eventarc
3434 // Advanced resources.
3435 type LoggingConfig struct {
3436 // LogSeverity: Optional. The minimum severity of logs that will be sent to
3437 // Stackdriver/Platform Telemetry. Logs at severitiy ≥ this value will be
3438 // sent, unless it is NONE.
3439 //
3440 // Possible values:
3441 // "LOG_SEVERITY_UNSPECIFIED" - Log severity is not specified. This value is
3442 // treated the same as NONE, but is used to distinguish between no update and
3443 // update to NONE in update_masks.
3444 // "NONE" - Default value at resource creation, presence of this value must
3445 // be treated as no logging/disable logging.
3446 // "DEBUG" - Debug or trace level logging.
3447 // "INFO" - Routine information, such as ongoing status or performance.
3448 // "NOTICE" - Normal but significant events, such as start up, shut down, or
3449 // a configuration change.
3450 // "WARNING" - Warning events might cause problems.
3451 // "ERROR" - Error events are likely to cause problems.
3452 // "CRITICAL" - Critical events cause more severe problems or outages.
3453 // "ALERT" - A person must take action immediately.
3454 // "EMERGENCY" - One or more systems are unusable.
3455 LogSeverity string `json:"logSeverity,omitempty"`
3456 // ForceSendFields is a list of field names (e.g. "LogSeverity") to
3457 // unconditionally include in API requests. By default, fields with empty or
3458 // default values are omitted from API requests. See
3459 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3460 // details.
3461 ForceSendFields []string `json:"-"`
3462 // NullFields is a list of field names (e.g. "LogSeverity") to include in API
3463 // requests with the JSON null value. By default, fields with empty values are
3464 // omitted from API requests. See
3465 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3466 NullFields []string `json:"-"`
3467 }
3468
3469 func (s LoggingConfig) MarshalJSON() ([]byte, error) {
3470 type NoMethod LoggingConfig
3471 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3472 }
3473
3474 // Mesh: Mesh represents a logical configuration grouping for workload to
3475 // workload communication within a service mesh. Routes that point to mesh
3476 // dictate how requests are routed within this logical mesh boundary.
3477 type Mesh struct {
3478 // CreateTime: Output only. The timestamp when the resource was created.
3479 CreateTime string `json:"createTime,omitempty"`
3480 // Description: Optional. A free-text description of the resource. Max length
3481 // 1024 characters.
3482 Description string `json:"description,omitempty"`
3483 // EnvoyHeaders: Optional. Determines if envoy will insert internal debug
3484 // headers into upstream requests. Other Envoy headers may still be injected.
3485 // By default, envoy will not insert any debug headers.
3486 //
3487 // Possible values:
3488 // "ENVOY_HEADERS_UNSPECIFIED" - Defaults to NONE.
3489 // "NONE" - Suppress envoy debug headers.
3490 // "DEBUG_HEADERS" - Envoy will insert default internal debug headers into
3491 // upstream requests: x-envoy-attempt-count, x-envoy-is-timeout-retry,
3492 // x-envoy-expected-rq-timeout-ms, x-envoy-original-path,
3493 // x-envoy-upstream-stream-duration-ms
3494 EnvoyHeaders string `json:"envoyHeaders,omitempty"`
3495 // InterceptionPort: Optional. If set to a valid TCP port (1-65535), instructs
3496 // the SIDECAR proxy to listen on the specified port of localhost (127.0.0.1)
3497 // address. The SIDECAR proxy will expect all traffic to be redirected to this
3498 // port regardless of its actual ip:port destination. If unset, a port '15001'
3499 // is used as the interception port. This is applicable only for sidecar proxy
3500 // deployments.
3501 InterceptionPort int64 `json:"interceptionPort,omitempty"`
3502 // Labels: Optional. Set of label tags associated with the Mesh resource.
3503 Labels map[string]string `json:"labels,omitempty"`
3504 // Name: Identifier. Name of the Mesh resource. It matches pattern
3505 // `projects/*/locations/*/meshes/`.
3506 Name string `json:"name,omitempty"`
3507 // SelfLink: Output only. Server-defined URL of this resource
3508 SelfLink string `json:"selfLink,omitempty"`
3509 // UpdateTime: Output only. The timestamp when the resource was updated.
3510 UpdateTime string `json:"updateTime,omitempty"`
3511
3512 // ServerResponse contains the HTTP response code and headers from the server.
3513 googleapi.ServerResponse `json:"-"`
3514 // ForceSendFields is a list of field names (e.g. "CreateTime") to
3515 // unconditionally include in API requests. By default, fields with empty or
3516 // default values are omitted from API requests. See
3517 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3518 // details.
3519 ForceSendFields []string `json:"-"`
3520 // NullFields is a list of field names (e.g. "CreateTime") to include in API
3521 // requests with the JSON null value. By default, fields with empty values are
3522 // omitted from API requests. See
3523 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3524 NullFields []string `json:"-"`
3525 }
3526
3527 func (s Mesh) MarshalJSON() ([]byte, error) {
3528 type NoMethod Mesh
3529 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3530 }
3531
3532 // MeshRouteView: MeshRouteView defines view-only resource for Routes to a Mesh
3533 type MeshRouteView struct {
3534 // Name: Output only. Identifier. Full path name of the MeshRouteView resource.
3535 // Format:
3536 // projects/{project_number}/locations/{location}/meshes/{mesh}/routeViews/{rout
3537 // e_view}
3538 Name string `json:"name,omitempty"`
3539 // RouteId: Output only. The resource id for the route.
3540 RouteId string `json:"routeId,omitempty"`
3541 // RouteLocation: Output only. Location where the route exists.
3542 RouteLocation string `json:"routeLocation,omitempty"`
3543 // RouteProjectNumber: Output only. Project number where the route exists.
3544 RouteProjectNumber int64 `json:"routeProjectNumber,omitempty,string"`
3545 // RouteType: Output only. Type of the route: HttpRoute,GrpcRoute,TcpRoute, or
3546 // TlsRoute
3547 RouteType string `json:"routeType,omitempty"`
3548
3549 // ServerResponse contains the HTTP response code and headers from the server.
3550 googleapi.ServerResponse `json:"-"`
3551 // ForceSendFields is a list of field names (e.g. "Name") to unconditionally
3552 // include in API requests. By default, fields with empty or default values are
3553 // omitted from API requests. See
3554 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3555 // details.
3556 ForceSendFields []string `json:"-"`
3557 // NullFields is a list of field names (e.g. "Name") to include in API requests
3558 // with the JSON null value. By default, fields with empty values are omitted
3559 // from API requests. See
3560 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3561 NullFields []string `json:"-"`
3562 }
3563
3564 func (s MeshRouteView) MarshalJSON() ([]byte, error) {
3565 type NoMethod MeshRouteView
3566 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3567 }
3568
3569 // Operation: This resource represents a long-running operation that is the
3570 // result of a network API call.
3571 type Operation struct {
3572 // Done: If the value is `false`, it means the operation is still in progress.
3573 // If `true`, the operation is completed, and either `error` or `response` is
3574 // available.
3575 Done bool `json:"done,omitempty"`
3576 // Error: The error result of the operation in case of failure or cancellation.
3577 Error *Status `json:"error,omitempty"`
3578 // Metadata: Service-specific metadata associated with the operation. It
3579 // typically contains progress information and common metadata such as create
3580 // time. Some services might not provide such metadata. Any method that returns
3581 // a long-running operation should document the metadata type, if any.
3582 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
3583 // Name: The server-assigned name, which is only unique within the same service
3584 // that originally returns it. If you use the default HTTP mapping, the `name`
3585 // should be a resource name ending with `operations/{unique_id}`.
3586 Name string `json:"name,omitempty"`
3587 // Response: The normal, successful response of the operation. If the original
3588 // method returns no data on success, such as `Delete`, the response is
3589 // `google.protobuf.Empty`. If the original method is standard
3590 // `Get`/`Create`/`Update`, the response should be the resource. For other
3591 // methods, the response should have the type `XxxResponse`, where `Xxx` is the
3592 // original method name. For example, if the original method name is
3593 // `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
3594 Response googleapi.RawMessage `json:"response,omitempty"`
3595
3596 // ServerResponse contains the HTTP response code and headers from the server.
3597 googleapi.ServerResponse `json:"-"`
3598 // ForceSendFields is a list of field names (e.g. "Done") to unconditionally
3599 // include in API requests. By default, fields with empty or default values are
3600 // omitted from API requests. See
3601 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3602 // details.
3603 ForceSendFields []string `json:"-"`
3604 // NullFields is a list of field names (e.g. "Done") to include in API requests
3605 // with the JSON null value. By default, fields with empty values are omitted
3606 // from API requests. See
3607 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3608 NullFields []string `json:"-"`
3609 }
3610
3611 func (s Operation) MarshalJSON() ([]byte, error) {
3612 type NoMethod Operation
3613 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3614 }
3615
3616 // OperationMetadata: Represents the metadata of the long-running operation.
3617 type OperationMetadata struct {
3618 // ApiVersion: Output only. API version used to start the operation.
3619 ApiVersion string `json:"apiVersion,omitempty"`
3620 // CreateTime: Output only. The time the operation was created.
3621 CreateTime string `json:"createTime,omitempty"`
3622 // EndTime: Output only. The time the operation finished running.
3623 EndTime string `json:"endTime,omitempty"`
3624 // RequestedCancellation: Output only. Identifies whether the user has
3625 // requested cancellation of the operation. Operations that have successfully
3626 // been cancelled have Operation.error value with a google.rpc.Status.code of
3627 // 1, corresponding to `Code.CANCELLED`.
3628 RequestedCancellation bool `json:"requestedCancellation,omitempty"`
3629 // StatusMessage: Output only. Human-readable status of the operation, if any.
3630 StatusMessage string `json:"statusMessage,omitempty"`
3631 // Target: Output only. Server-defined resource path for the target of the
3632 // operation.
3633 Target string `json:"target,omitempty"`
3634 // Verb: Output only. Name of the verb executed by the operation.
3635 Verb string `json:"verb,omitempty"`
3636 // ForceSendFields is a list of field names (e.g. "ApiVersion") to
3637 // unconditionally include in API requests. By default, fields with empty or
3638 // default values are omitted from API requests. See
3639 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3640 // details.
3641 ForceSendFields []string `json:"-"`
3642 // NullFields is a list of field names (e.g. "ApiVersion") to include in API
3643 // requests with the JSON null value. By default, fields with empty values are
3644 // omitted from API requests. See
3645 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3646 NullFields []string `json:"-"`
3647 }
3648
3649 func (s OperationMetadata) MarshalJSON() ([]byte, error) {
3650 type NoMethod OperationMetadata
3651 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3652 }
3653
3654 // Policy: An Identity and Access Management (IAM) policy, which specifies
3655 // access controls for Google Cloud resources. A `Policy` is a collection of
3656 // `bindings`. A `binding` binds one or more `members`, or principals, to a
3657 // single `role`. Principals can be user accounts, service accounts, Google
3658 // groups, and domains (such as G Suite). A `role` is a named list of
3659 // permissions; each `role` can be an IAM predefined role or a user-created
3660 // custom role. For some types of Google Cloud resources, a `binding` can also
3661 // specify a `condition`, which is a logical expression that allows access to a
3662 // resource only if the expression evaluates to `true`. A condition can add
3663 // constraints based on attributes of the request, the resource, or both. To
3664 // learn which resources support conditions in their IAM policies, see the IAM
3665 // documentation
3666 // (https://cloud.google.com/iam/help/conditions/resource-policies). **JSON
3667 // example:** ``` { "bindings": [ { "role":
3668 // "roles/resourcemanager.organizationAdmin", "members": [
3669 // "user:[email protected]", "group:[email protected]", "domain:google.com",
3670 // "serviceAccount:[email protected]" ] }, { "role":
3671 // "roles/resourcemanager.organizationViewer", "members": [
3672 // "user:[email protected]" ], "condition": { "title": "expirable access",
3673 // "description": "Does not grant access after Sep 2020", "expression":
3674 // "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag":
3675 // "BwWWja0YfJA=", "version": 3 } ``` **YAML example:** ``` bindings: -
3676 // members: - user:[email protected] - group:[email protected] -
3677 // domain:google.com - serviceAccount:[email protected]
3678 // role: roles/resourcemanager.organizationAdmin - members: -
3679 // user:[email protected] role: roles/resourcemanager.organizationViewer
3680 // condition: title: expirable access description: Does not grant access after
3681 // Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z')
3682 // etag: BwWWja0YfJA= version: 3 ``` For a description of IAM and its features,
3683 // see the IAM documentation (https://cloud.google.com/iam/docs/).
3684 type Policy struct {
3685 // AuditConfigs: Specifies cloud audit logging configuration for this policy.
3686 AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
3687 // Bindings: Associates a list of `members`, or principals, with a `role`.
3688 // Optionally, may specify a `condition` that determines how and when the
3689 // `bindings` are applied. Each of the `bindings` must contain at least one
3690 // principal. The `bindings` in a `Policy` can refer to up to 1,500 principals;
3691 // up to 250 of these principals can be Google groups. Each occurrence of a
3692 // principal counts towards these limits. For example, if the `bindings` grant
3693 // 50 different roles to `user:[email protected]`, and not to any other
3694 // principal, then you can add another 1,450 principals to the `bindings` in
3695 // the `Policy`.
3696 Bindings []*Binding `json:"bindings,omitempty"`
3697 // Etag: `etag` is used for optimistic concurrency control as a way to help
3698 // prevent simultaneous updates of a policy from overwriting each other. It is
3699 // strongly suggested that systems make use of the `etag` in the
3700 // read-modify-write cycle to perform policy updates in order to avoid race
3701 // conditions: An `etag` is returned in the response to `getIamPolicy`, and
3702 // systems are expected to put that etag in the request to `setIamPolicy` to
3703 // ensure that their change will be applied to the same version of the policy.
3704 // **Important:** If you use IAM Conditions, you must include the `etag` field
3705 // whenever you call `setIamPolicy`. If you omit this field, then IAM allows
3706 // you to overwrite a version `3` policy with a version `1` policy, and all of
3707 // the conditions in the version `3` policy are lost.
3708 Etag string `json:"etag,omitempty"`
3709 // Version: Specifies the format of the policy. Valid values are `0`, `1`, and
3710 // `3`. Requests that specify an invalid value are rejected. Any operation that
3711 // affects conditional role bindings must specify version `3`. This requirement
3712 // applies to the following operations: * Getting a policy that includes a
3713 // conditional role binding * Adding a conditional role binding to a policy *
3714 // Changing a conditional role binding in a policy * Removing any role binding,
3715 // with or without a condition, from a policy that includes conditions
3716 // **Important:** If you use IAM Conditions, you must include the `etag` field
3717 // whenever you call `setIamPolicy`. If you omit this field, then IAM allows
3718 // you to overwrite a version `3` policy with a version `1` policy, and all of
3719 // the conditions in the version `3` policy are lost. If a policy does not
3720 // include any conditions, operations on that policy may specify any valid
3721 // version or leave the field unset. To learn which resources support
3722 // conditions in their IAM policies, see the IAM documentation
3723 // (https://cloud.google.com/iam/help/conditions/resource-policies).
3724 Version int64 `json:"version,omitempty"`
3725
3726 // ServerResponse contains the HTTP response code and headers from the server.
3727 googleapi.ServerResponse `json:"-"`
3728 // ForceSendFields is a list of field names (e.g. "AuditConfigs") to
3729 // unconditionally include in API requests. By default, fields with empty or
3730 // default values are omitted from API requests. See
3731 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3732 // details.
3733 ForceSendFields []string `json:"-"`
3734 // NullFields is a list of field names (e.g. "AuditConfigs") to include in API
3735 // requests with the JSON null value. By default, fields with empty values are
3736 // omitted from API requests. See
3737 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3738 NullFields []string `json:"-"`
3739 }
3740
3741 func (s Policy) MarshalJSON() ([]byte, error) {
3742 type NoMethod Policy
3743 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3744 }
3745
3746 type RetryFilterPerRouteConfig struct {
3747 // CryptoKeyName: The name of the crypto key to use for encrypting event data.
3748 CryptoKeyName string `json:"cryptoKeyName,omitempty"`
3749 // ForceSendFields is a list of field names (e.g. "CryptoKeyName") to
3750 // unconditionally include in API requests. By default, fields with empty or
3751 // default values are omitted from API requests. See
3752 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3753 // details.
3754 ForceSendFields []string `json:"-"`
3755 // NullFields is a list of field names (e.g. "CryptoKeyName") to include in API
3756 // requests with the JSON null value. By default, fields with empty values are
3757 // omitted from API requests. See
3758 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3759 NullFields []string `json:"-"`
3760 }
3761
3762 func (s RetryFilterPerRouteConfig) MarshalJSON() ([]byte, error) {
3763 type NoMethod RetryFilterPerRouteConfig
3764 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3765 }
3766
3767 // ServiceBinding: ServiceBinding can be used to: - Bind a Service Directory
3768 // Service to be used in a BackendService resource. This feature will be
3769 // deprecated soon. - Bind a Private Service Connect producer service to be
3770 // used in consumer Cloud Service Mesh or Application Load Balancers. - Bind a
3771 // Cloud Run service to be used in consumer Cloud Service Mesh or Application
3772 // Load Balancers.
3773 type ServiceBinding struct {
3774 // CreateTime: Output only. The timestamp when the resource was created.
3775 CreateTime string `json:"createTime,omitempty"`
3776 // Description: Optional. A free-text description of the resource. Max length
3777 // 1024 characters.
3778 Description string `json:"description,omitempty"`
3779 // Labels: Optional. Set of label tags associated with the ServiceBinding
3780 // resource.
3781 Labels map[string]string `json:"labels,omitempty"`
3782 // Name: Identifier. Name of the ServiceBinding resource. It matches pattern
3783 // `projects/*/locations/*/serviceBindings/`.
3784 Name string `json:"name,omitempty"`
3785 // Service: Optional. The full Service Directory Service name of the format
3786 // `projects/*/locations/*/namespaces/*/services/*`. This field is for Service
3787 // Directory integration which will be deprecated soon.
3788 Service string `json:"service,omitempty"`
3789 // ServiceId: Output only. The unique identifier of the Service Directory
3790 // Service against which the ServiceBinding resource is validated. This is
3791 // populated when the Service Binding resource is used in another resource
3792 // (like Backend Service). This is of the UUID4 format. This field is for
3793 // Service Directory integration which will be deprecated soon.
3794 ServiceId string `json:"serviceId,omitempty"`
3795 // UpdateTime: Output only. The timestamp when the resource was updated.
3796 UpdateTime string `json:"updateTime,omitempty"`
3797
3798 // ServerResponse contains the HTTP response code and headers from the server.
3799 googleapi.ServerResponse `json:"-"`
3800 // ForceSendFields is a list of field names (e.g. "CreateTime") to
3801 // unconditionally include in API requests. By default, fields with empty or
3802 // default values are omitted from API requests. See
3803 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3804 // details.
3805 ForceSendFields []string `json:"-"`
3806 // NullFields is a list of field names (e.g. "CreateTime") to include in API
3807 // requests with the JSON null value. By default, fields with empty values are
3808 // omitted from API requests. See
3809 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3810 NullFields []string `json:"-"`
3811 }
3812
3813 func (s ServiceBinding) MarshalJSON() ([]byte, error) {
3814 type NoMethod ServiceBinding
3815 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3816 }
3817
3818 // ServiceLbPolicy: ServiceLbPolicy holds global load balancing and traffic
3819 // distribution configuration that can be applied to a BackendService.
3820 type ServiceLbPolicy struct {
3821 // AutoCapacityDrain: Optional. Configuration to automatically move traffic
3822 // away for unhealthy IG/NEG for the associated Backend Service.
3823 AutoCapacityDrain *ServiceLbPolicyAutoCapacityDrain `json:"autoCapacityDrain,omitempty"`
3824 // CreateTime: Output only. The timestamp when this resource was created.
3825 CreateTime string `json:"createTime,omitempty"`
3826 // Description: Optional. A free-text description of the resource. Max length
3827 // 1024 characters.
3828 Description string `json:"description,omitempty"`
3829 // FailoverConfig: Optional. Configuration related to health based failover.
3830 FailoverConfig *ServiceLbPolicyFailoverConfig `json:"failoverConfig,omitempty"`
3831 // IsolationConfig: Optional. Configuration to provide isolation support for
3832 // the associated Backend Service.
3833 IsolationConfig *ServiceLbPolicyIsolationConfig `json:"isolationConfig,omitempty"`
3834 // Labels: Optional. Set of label tags associated with the ServiceLbPolicy
3835 // resource.
3836 Labels map[string]string `json:"labels,omitempty"`
3837 // LoadBalancingAlgorithm: Optional. The type of load balancing algorithm to be
3838 // used. The default behavior is WATERFALL_BY_REGION.
3839 //
3840 // Possible values:
3841 // "LOAD_BALANCING_ALGORITHM_UNSPECIFIED" - The type of the loadbalancing
3842 // algorithm is unspecified.
3843 // "SPRAY_TO_WORLD" - Balance traffic across all backends across the world
3844 // proportionally based on capacity.
3845 // "SPRAY_TO_REGION" - Direct traffic to the nearest region with endpoints
3846 // and capacity before spilling over to other regions and spread the traffic
3847 // from each client to all the MIGs/NEGs in a region.
3848 // "WATERFALL_BY_REGION" - Direct traffic to the nearest region with
3849 // endpoints and capacity before spilling over to other regions. All MIGs/NEGs
3850 // within a region are evenly loaded but each client might not spread the
3851 // traffic to all the MIGs/NEGs in the region.
3852 // "WATERFALL_BY_ZONE" - Attempt to keep traffic in a single zone closest to
3853 // the client, before spilling over to other zones.
3854 LoadBalancingAlgorithm string `json:"loadBalancingAlgorithm,omitempty"`
3855 // Name: Identifier. Name of the ServiceLbPolicy resource. It matches pattern
3856 // `projects/{project}/locations/{location}/serviceLbPolicies/{service_lb_policy
3857 // _name}`.
3858 Name string `json:"name,omitempty"`
3859 // UpdateTime: Output only. The timestamp when this resource was last updated.
3860 UpdateTime string `json:"updateTime,omitempty"`
3861
3862 // ServerResponse contains the HTTP response code and headers from the server.
3863 googleapi.ServerResponse `json:"-"`
3864 // ForceSendFields is a list of field names (e.g. "AutoCapacityDrain") to
3865 // unconditionally include in API requests. By default, fields with empty or
3866 // default values are omitted from API requests. See
3867 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3868 // details.
3869 ForceSendFields []string `json:"-"`
3870 // NullFields is a list of field names (e.g. "AutoCapacityDrain") to include in
3871 // API requests with the JSON null value. By default, fields with empty values
3872 // are omitted from API requests. See
3873 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3874 NullFields []string `json:"-"`
3875 }
3876
3877 func (s ServiceLbPolicy) MarshalJSON() ([]byte, error) {
3878 type NoMethod ServiceLbPolicy
3879 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3880 }
3881
3882 // ServiceLbPolicyAutoCapacityDrain: Option to specify if an unhealthy IG/NEG
3883 // should be considered for global load balancing and traffic routing.
3884 type ServiceLbPolicyAutoCapacityDrain struct {
3885 // Enable: Optional. If set to 'True', an unhealthy IG/NEG will be set as
3886 // drained. - An IG/NEG is considered unhealthy if less than 25% of the
3887 // instances/endpoints in the IG/NEG are healthy. - This option will never
3888 // result in draining more than 50% of the configured IGs/NEGs for the Backend
3889 // Service.
3890 Enable bool `json:"enable,omitempty"`
3891 // ForceSendFields is a list of field names (e.g. "Enable") to unconditionally
3892 // include in API requests. By default, fields with empty or default values are
3893 // omitted from API requests. See
3894 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3895 // details.
3896 ForceSendFields []string `json:"-"`
3897 // NullFields is a list of field names (e.g. "Enable") to include in API
3898 // requests with the JSON null value. By default, fields with empty values are
3899 // omitted from API requests. See
3900 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3901 NullFields []string `json:"-"`
3902 }
3903
3904 func (s ServiceLbPolicyAutoCapacityDrain) MarshalJSON() ([]byte, error) {
3905 type NoMethod ServiceLbPolicyAutoCapacityDrain
3906 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3907 }
3908
3909 // ServiceLbPolicyFailoverConfig: Option to specify health based failover
3910 // behavior. This is not related to Network load balancer FailoverPolicy.
3911 type ServiceLbPolicyFailoverConfig struct {
3912 // FailoverHealthThreshold: Optional. The percentage threshold that a load
3913 // balancer will begin to send traffic to failover backends. If the percentage
3914 // of endpoints in a MIG/NEG is smaller than this value, traffic would be sent
3915 // to failover backends if possible. This field should be set to a value
3916 // between 1 and 99. The default value is 50 for Global external HTTP(S) load
3917 // balancer (classic) and Proxyless service mesh, and 70 for others.
3918 FailoverHealthThreshold int64 `json:"failoverHealthThreshold,omitempty"`
3919 // ForceSendFields is a list of field names (e.g. "FailoverHealthThreshold") to
3920 // unconditionally include in API requests. By default, fields with empty or
3921 // default values are omitted from API requests. See
3922 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3923 // details.
3924 ForceSendFields []string `json:"-"`
3925 // NullFields is a list of field names (e.g. "FailoverHealthThreshold") to
3926 // include in API requests with the JSON null value. By default, fields with
3927 // empty values are omitted from API requests. See
3928 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3929 NullFields []string `json:"-"`
3930 }
3931
3932 func (s ServiceLbPolicyFailoverConfig) MarshalJSON() ([]byte, error) {
3933 type NoMethod ServiceLbPolicyFailoverConfig
3934 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3935 }
3936
3937 // ServiceLbPolicyIsolationConfig: Configuration to provide isolation support
3938 // for the associated Backend Service.
3939 type ServiceLbPolicyIsolationConfig struct {
3940 // IsolationGranularity: Optional. The isolation granularity of the load
3941 // balancer.
3942 //
3943 // Possible values:
3944 // "ISOLATION_GRANULARITY_UNSPECIFIED" - No isolation is configured for the
3945 // backend service. Traffic can overflow based on the load balancing algorithm.
3946 // "REGION" - Traffic for this service will be isolated at the cloud region
3947 // level.
3948 IsolationGranularity string `json:"isolationGranularity,omitempty"`
3949 // IsolationMode: Optional. The isolation mode of the load balancer.
3950 //
3951 // Possible values:
3952 // "ISOLATION_MODE_UNSPECIFIED" - No isolation mode is configured for the
3953 // backend service.
3954 // "NEAREST" - Traffic will be sent to the nearest region.
3955 // "STRICT" - Traffic will fail if no serving backends are available in the
3956 // same region as the load balancer.
3957 IsolationMode string `json:"isolationMode,omitempty"`
3958 // ForceSendFields is a list of field names (e.g. "IsolationGranularity") to
3959 // unconditionally include in API requests. By default, fields with empty or
3960 // default values are omitted from API requests. See
3961 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3962 // details.
3963 ForceSendFields []string `json:"-"`
3964 // NullFields is a list of field names (e.g. "IsolationGranularity") to include
3965 // in API requests with the JSON null value. By default, fields with empty
3966 // values are omitted from API requests. See
3967 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3968 NullFields []string `json:"-"`
3969 }
3970
3971 func (s ServiceLbPolicyIsolationConfig) MarshalJSON() ([]byte, error) {
3972 type NoMethod ServiceLbPolicyIsolationConfig
3973 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3974 }
3975
3976 // SetIamPolicyRequest: Request message for `SetIamPolicy` method.
3977 type SetIamPolicyRequest struct {
3978 // Policy: REQUIRED: The complete policy to be applied to the `resource`. The
3979 // size of the policy is limited to a few 10s of KB. An empty policy is a valid
3980 // policy but certain Google Cloud services (such as Projects) might reject
3981 // them.
3982 Policy *Policy `json:"policy,omitempty"`
3983 // UpdateMask: OPTIONAL: A FieldMask specifying which fields of the policy to
3984 // modify. Only the fields in the mask will be modified. If no mask is
3985 // provided, the following default mask is used: `paths: "bindings, etag"
3986 UpdateMask string `json:"updateMask,omitempty"`
3987 // ForceSendFields is a list of field names (e.g. "Policy") to unconditionally
3988 // include in API requests. By default, fields with empty or default values are
3989 // omitted from API requests. See
3990 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3991 // details.
3992 ForceSendFields []string `json:"-"`
3993 // NullFields is a list of field names (e.g. "Policy") to include in API
3994 // requests with the JSON null value. By default, fields with empty values are
3995 // omitted from API requests. See
3996 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3997 NullFields []string `json:"-"`
3998 }
3999
4000 func (s SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
4001 type NoMethod SetIamPolicyRequest
4002 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4003 }
4004
4005 // Status: The `Status` type defines a logical error model that is suitable for
4006 // different programming environments, including REST APIs and RPC APIs. It is
4007 // used by gRPC (https://github.com/grpc). Each `Status` message contains three
4008 // pieces of data: error code, error message, and error details. You can find
4009 // out more about this error model and how to work with it in the API Design
4010 // Guide (https://cloud.google.com/apis/design/errors).
4011 type Status struct {
4012 // Code: The status code, which should be an enum value of google.rpc.Code.
4013 Code int64 `json:"code,omitempty"`
4014 // Details: A list of messages that carry the error details. There is a common
4015 // set of message types for APIs to use.
4016 Details []googleapi.RawMessage `json:"details,omitempty"`
4017 // Message: A developer-facing error message, which should be in English. Any
4018 // user-facing error message should be localized and sent in the
4019 // google.rpc.Status.details field, or localized by the client.
4020 Message string `json:"message,omitempty"`
4021 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally
4022 // include in API requests. By default, fields with empty or default values are
4023 // omitted from API requests. See
4024 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4025 // details.
4026 ForceSendFields []string `json:"-"`
4027 // NullFields is a list of field names (e.g. "Code") to include in API requests
4028 // with the JSON null value. By default, fields with empty values are omitted
4029 // from API requests. See
4030 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4031 NullFields []string `json:"-"`
4032 }
4033
4034 func (s Status) MarshalJSON() ([]byte, error) {
4035 type NoMethod Status
4036 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4037 }
4038
4039 // TcpRoute: TcpRoute is the resource defining how TCP traffic should be routed
4040 // by a Mesh/Gateway resource.
4041 type TcpRoute struct {
4042 // CreateTime: Output only. The timestamp when the resource was created.
4043 CreateTime string `json:"createTime,omitempty"`
4044 // Description: Optional. A free-text description of the resource. Max length
4045 // 1024 characters.
4046 Description string `json:"description,omitempty"`
4047 // Gateways: Optional. Gateways defines a list of gateways this TcpRoute is
4048 // attached to, as one of the routing rules to route the requests served by the
4049 // gateway. Each gateway reference should match the pattern:
4050 // `projects/*/locations/*/gateways/`
4051 Gateways []string `json:"gateways,omitempty"`
4052 // Labels: Optional. Set of label tags associated with the TcpRoute resource.
4053 Labels map[string]string `json:"labels,omitempty"`
4054 // Meshes: Optional. Meshes defines a list of meshes this TcpRoute is attached
4055 // to, as one of the routing rules to route the requests served by the mesh.
4056 // Each mesh reference should match the pattern:
4057 // `projects/*/locations/*/meshes/` The attached Mesh should be of a type
4058 // SIDECAR
4059 Meshes []string `json:"meshes,omitempty"`
4060 // Name: Identifier. Name of the TcpRoute resource. It matches pattern
4061 // `projects/*/locations/*/tcpRoutes/tcp_route_name>`.
4062 Name string `json:"name,omitempty"`
4063 // Rules: Required. Rules that define how traffic is routed and handled. At
4064 // least one RouteRule must be supplied. If there are multiple rules then the
4065 // action taken will be the first rule to match.
4066 Rules []*TcpRouteRouteRule `json:"rules,omitempty"`
4067 // SelfLink: Output only. Server-defined URL of this resource
4068 SelfLink string `json:"selfLink,omitempty"`
4069 // UpdateTime: Output only. The timestamp when the resource was updated.
4070 UpdateTime string `json:"updateTime,omitempty"`
4071
4072 // ServerResponse contains the HTTP response code and headers from the server.
4073 googleapi.ServerResponse `json:"-"`
4074 // ForceSendFields is a list of field names (e.g. "CreateTime") to
4075 // unconditionally include in API requests. By default, fields with empty or
4076 // default values are omitted from API requests. See
4077 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4078 // details.
4079 ForceSendFields []string `json:"-"`
4080 // NullFields is a list of field names (e.g. "CreateTime") to include in API
4081 // requests with the JSON null value. By default, fields with empty values are
4082 // omitted from API requests. See
4083 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4084 NullFields []string `json:"-"`
4085 }
4086
4087 func (s TcpRoute) MarshalJSON() ([]byte, error) {
4088 type NoMethod TcpRoute
4089 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4090 }
4091
4092 // TcpRouteRouteAction: The specifications for routing traffic and applying
4093 // associated policies.
4094 type TcpRouteRouteAction struct {
4095 // Destinations: Optional. The destination services to which traffic should be
4096 // forwarded. At least one destination service is required. Only one of route
4097 // destination or original destination can be set.
4098 Destinations []*TcpRouteRouteDestination `json:"destinations,omitempty"`
4099 // IdleTimeout: Optional. Specifies the idle timeout for the selected route.
4100 // The idle timeout is defined as the period in which there are no bytes sent
4101 // or received on either the upstream or downstream connection. If not set, the
4102 // default idle timeout is 30 seconds. If set to 0s, the timeout will be
4103 // disabled.
4104 IdleTimeout string `json:"idleTimeout,omitempty"`
4105 // OriginalDestination: Optional. If true, Router will use the destination IP
4106 // and port of the original connection as the destination of the request.
4107 // Default is false. Only one of route destinations or original destination can
4108 // be set.
4109 OriginalDestination bool `json:"originalDestination,omitempty"`
4110 // ForceSendFields is a list of field names (e.g. "Destinations") to
4111 // unconditionally include in API requests. By default, fields with empty or
4112 // default values are omitted from API requests. See
4113 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4114 // details.
4115 ForceSendFields []string `json:"-"`
4116 // NullFields is a list of field names (e.g. "Destinations") to include in API
4117 // requests with the JSON null value. By default, fields with empty values are
4118 // omitted from API requests. See
4119 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4120 NullFields []string `json:"-"`
4121 }
4122
4123 func (s TcpRouteRouteAction) MarshalJSON() ([]byte, error) {
4124 type NoMethod TcpRouteRouteAction
4125 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4126 }
4127
4128 // TcpRouteRouteDestination: Describe the destination for traffic to be routed
4129 // to.
4130 type TcpRouteRouteDestination struct {
4131 // ServiceName: Required. The URL of a BackendService to route traffic to.
4132 ServiceName string `json:"serviceName,omitempty"`
4133 // Weight: Optional. Specifies the proportion of requests forwarded to the
4134 // backend referenced by the serviceName field. This is computed as: -
4135 // weight/Sum(weights in this destination list). For non-zero values, there may
4136 // be some epsilon from the exact proportion defined here depending on the
4137 // precision an implementation supports. If only one serviceName is specified
4138 // and it has a weight greater than 0, 100% of the traffic is forwarded to that
4139 // backend. If weights are specified for any one service name, they need to be
4140 // specified for all of them. If weights are unspecified for all services,
4141 // then, traffic is distributed in equal proportions to all of them.
4142 Weight int64 `json:"weight,omitempty"`
4143 // ForceSendFields is a list of field names (e.g. "ServiceName") to
4144 // unconditionally include in API requests. By default, fields with empty or
4145 // default values are omitted from API requests. See
4146 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4147 // details.
4148 ForceSendFields []string `json:"-"`
4149 // NullFields is a list of field names (e.g. "ServiceName") to include in API
4150 // requests with the JSON null value. By default, fields with empty values are
4151 // omitted from API requests. See
4152 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4153 NullFields []string `json:"-"`
4154 }
4155
4156 func (s TcpRouteRouteDestination) MarshalJSON() ([]byte, error) {
4157 type NoMethod TcpRouteRouteDestination
4158 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4159 }
4160
4161 // TcpRouteRouteMatch: RouteMatch defines the predicate used to match requests
4162 // to a given action. Multiple match types are "OR"ed for evaluation. If no
4163 // routeMatch field is specified, this rule will unconditionally match traffic.
4164 type TcpRouteRouteMatch struct {
4165 // Address: Required. Must be specified in the CIDR range format. A CIDR range
4166 // consists of an IP Address and a prefix length to construct the subnet mask.
4167 // By default, the prefix length is 32 (i.e. matches a single IP address). Only
4168 // IPV4 addresses are supported. Examples: "10.0.0.1" - matches against this
4169 // exact IP address. "10.0.0.0/8" - matches against any IP address within the
4170 // 10.0.0.0 subnet and 255.255.255.0 mask. "0.0.0.0/0" - matches against any IP
4171 // address'.
4172 Address string `json:"address,omitempty"`
4173 // Port: Required. Specifies the destination port to match against.
4174 Port string `json:"port,omitempty"`
4175 // ForceSendFields is a list of field names (e.g. "Address") to unconditionally
4176 // include in API requests. By default, fields with empty or default values are
4177 // omitted from API requests. See
4178 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4179 // details.
4180 ForceSendFields []string `json:"-"`
4181 // NullFields is a list of field names (e.g. "Address") to include in API
4182 // requests with the JSON null value. By default, fields with empty values are
4183 // omitted from API requests. See
4184 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4185 NullFields []string `json:"-"`
4186 }
4187
4188 func (s TcpRouteRouteMatch) MarshalJSON() ([]byte, error) {
4189 type NoMethod TcpRouteRouteMatch
4190 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4191 }
4192
4193 // TcpRouteRouteRule: Specifies how to match traffic and how to route traffic
4194 // when traffic is matched.
4195 type TcpRouteRouteRule struct {
4196 // Action: Required. The detailed rule defining how to route matched traffic.
4197 Action *TcpRouteRouteAction `json:"action,omitempty"`
4198 // Matches: Optional. RouteMatch defines the predicate used to match requests
4199 // to a given action. Multiple match types are "OR"ed for evaluation. If no
4200 // routeMatch field is specified, this rule will unconditionally match traffic.
4201 Matches []*TcpRouteRouteMatch `json:"matches,omitempty"`
4202 // ForceSendFields is a list of field names (e.g. "Action") to unconditionally
4203 // include in API requests. By default, fields with empty or default values are
4204 // omitted from API requests. See
4205 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4206 // details.
4207 ForceSendFields []string `json:"-"`
4208 // NullFields is a list of field names (e.g. "Action") to include in API
4209 // requests with the JSON null value. By default, fields with empty values are
4210 // omitted from API requests. See
4211 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4212 NullFields []string `json:"-"`
4213 }
4214
4215 func (s TcpRouteRouteRule) MarshalJSON() ([]byte, error) {
4216 type NoMethod TcpRouteRouteRule
4217 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4218 }
4219
4220 // TestIamPermissionsRequest: Request message for `TestIamPermissions` method.
4221 type TestIamPermissionsRequest struct {
4222 // Permissions: The set of permissions to check for the `resource`. Permissions
4223 // with wildcards (such as `*` or `storage.*`) are not allowed. For more
4224 // information see IAM Overview
4225 // (https://cloud.google.com/iam/docs/overview#permissions).
4226 Permissions []string `json:"permissions,omitempty"`
4227 // ForceSendFields is a list of field names (e.g. "Permissions") to
4228 // unconditionally include in API requests. By default, fields with empty or
4229 // default values are omitted from API requests. See
4230 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4231 // details.
4232 ForceSendFields []string `json:"-"`
4233 // NullFields is a list of field names (e.g. "Permissions") to include in API
4234 // requests with the JSON null value. By default, fields with empty values are
4235 // omitted from API requests. See
4236 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4237 NullFields []string `json:"-"`
4238 }
4239
4240 func (s TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
4241 type NoMethod TestIamPermissionsRequest
4242 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4243 }
4244
4245 // TestIamPermissionsResponse: Response message for `TestIamPermissions`
4246 // method.
4247 type TestIamPermissionsResponse struct {
4248 // Permissions: A subset of `TestPermissionsRequest.permissions` that the
4249 // caller is allowed.
4250 Permissions []string `json:"permissions,omitempty"`
4251
4252 // ServerResponse contains the HTTP response code and headers from the server.
4253 googleapi.ServerResponse `json:"-"`
4254 // ForceSendFields is a list of field names (e.g. "Permissions") to
4255 // unconditionally include in API requests. By default, fields with empty or
4256 // default values are omitted from API requests. See
4257 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4258 // details.
4259 ForceSendFields []string `json:"-"`
4260 // NullFields is a list of field names (e.g. "Permissions") to include in API
4261 // requests with the JSON null value. By default, fields with empty values are
4262 // omitted from API requests. See
4263 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4264 NullFields []string `json:"-"`
4265 }
4266
4267 func (s TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
4268 type NoMethod TestIamPermissionsResponse
4269 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4270 }
4271
4272 // TlsRoute: TlsRoute defines how traffic should be routed based on SNI and
4273 // other matching L3 attributes.
4274 type TlsRoute struct {
4275 // CreateTime: Output only. The timestamp when the resource was created.
4276 CreateTime string `json:"createTime,omitempty"`
4277 // Description: Optional. A free-text description of the resource. Max length
4278 // 1024 characters.
4279 Description string `json:"description,omitempty"`
4280 // Gateways: Optional. Gateways defines a list of gateways this TlsRoute is
4281 // attached to, as one of the routing rules to route the requests served by the
4282 // gateway. Each gateway reference should match the pattern:
4283 // `projects/*/locations/*/gateways/`
4284 Gateways []string `json:"gateways,omitempty"`
4285 // Labels: Optional. Set of label tags associated with the TlsRoute resource.
4286 Labels map[string]string `json:"labels,omitempty"`
4287 // Meshes: Optional. Meshes defines a list of meshes this TlsRoute is attached
4288 // to, as one of the routing rules to route the requests served by the mesh.
4289 // Each mesh reference should match the pattern:
4290 // `projects/*/locations/*/meshes/` The attached Mesh should be of a type
4291 // SIDECAR
4292 Meshes []string `json:"meshes,omitempty"`
4293 // Name: Identifier. Name of the TlsRoute resource. It matches pattern
4294 // `projects/*/locations/*/tlsRoutes/tls_route_name>`.
4295 Name string `json:"name,omitempty"`
4296 // Rules: Required. Rules that define how traffic is routed and handled. At
4297 // least one RouteRule must be supplied. If there are multiple rules then the
4298 // action taken will be the first rule to match.
4299 Rules []*TlsRouteRouteRule `json:"rules,omitempty"`
4300 // SelfLink: Output only. Server-defined URL of this resource
4301 SelfLink string `json:"selfLink,omitempty"`
4302 // TargetProxies: Optional. TargetProxies defines a list of TargetTcpProxies
4303 // this TlsRoute is attached to, as one of the routing rules to route the
4304 // requests served by the TargetTcpProxy. Each TargetTcpProxy reference should
4305 // match the pattern: `projects/*/locations/*/targetTcpProxies/`
4306 TargetProxies []string `json:"targetProxies,omitempty"`
4307 // UpdateTime: Output only. The timestamp when the resource was updated.
4308 UpdateTime string `json:"updateTime,omitempty"`
4309
4310 // ServerResponse contains the HTTP response code and headers from the server.
4311 googleapi.ServerResponse `json:"-"`
4312 // ForceSendFields is a list of field names (e.g. "CreateTime") to
4313 // unconditionally include in API requests. By default, fields with empty or
4314 // default values are omitted from API requests. See
4315 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4316 // details.
4317 ForceSendFields []string `json:"-"`
4318 // NullFields is a list of field names (e.g. "CreateTime") to include in API
4319 // requests with the JSON null value. By default, fields with empty values are
4320 // omitted from API requests. See
4321 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4322 NullFields []string `json:"-"`
4323 }
4324
4325 func (s TlsRoute) MarshalJSON() ([]byte, error) {
4326 type NoMethod TlsRoute
4327 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4328 }
4329
4330 // TlsRouteRouteAction: The specifications for routing traffic and applying
4331 // associated policies.
4332 type TlsRouteRouteAction struct {
4333 // Destinations: Required. The destination services to which traffic should be
4334 // forwarded. At least one destination service is required.
4335 Destinations []*TlsRouteRouteDestination `json:"destinations,omitempty"`
4336 // IdleTimeout: Optional. Specifies the idle timeout for the selected route.
4337 // The idle timeout is defined as the period in which there are no bytes sent
4338 // or received on either the upstream or downstream connection. If not set, the
4339 // default idle timeout is 1 hour. If set to 0s, the timeout will be disabled.
4340 IdleTimeout string `json:"idleTimeout,omitempty"`
4341 // ForceSendFields is a list of field names (e.g. "Destinations") to
4342 // unconditionally include in API requests. By default, fields with empty or
4343 // default values are omitted from API requests. See
4344 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4345 // details.
4346 ForceSendFields []string `json:"-"`
4347 // NullFields is a list of field names (e.g. "Destinations") to include in API
4348 // requests with the JSON null value. By default, fields with empty values are
4349 // omitted from API requests. See
4350 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4351 NullFields []string `json:"-"`
4352 }
4353
4354 func (s TlsRouteRouteAction) MarshalJSON() ([]byte, error) {
4355 type NoMethod TlsRouteRouteAction
4356 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4357 }
4358
4359 // TlsRouteRouteDestination: Describe the destination for traffic to be routed
4360 // to.
4361 type TlsRouteRouteDestination struct {
4362 // ServiceName: Required. The URL of a BackendService to route traffic to.
4363 ServiceName string `json:"serviceName,omitempty"`
4364 // Weight: Optional. Specifies the proportion of requests forwarded to the
4365 // backend referenced by the service_name field. This is computed as: -
4366 // weight/Sum(weights in destinations) Weights in all destinations does not
4367 // need to sum up to 100.
4368 Weight int64 `json:"weight,omitempty"`
4369 // ForceSendFields is a list of field names (e.g. "ServiceName") to
4370 // unconditionally include in API requests. By default, fields with empty or
4371 // default values are omitted from API requests. See
4372 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4373 // details.
4374 ForceSendFields []string `json:"-"`
4375 // NullFields is a list of field names (e.g. "ServiceName") to include in API
4376 // requests with the JSON null value. By default, fields with empty values are
4377 // omitted from API requests. See
4378 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4379 NullFields []string `json:"-"`
4380 }
4381
4382 func (s TlsRouteRouteDestination) MarshalJSON() ([]byte, error) {
4383 type NoMethod TlsRouteRouteDestination
4384 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4385 }
4386
4387 // TlsRouteRouteMatch: RouteMatch defines the predicate used to match requests
4388 // to a given action. Multiple match types are "AND"ed for evaluation.
4389 type TlsRouteRouteMatch struct {
4390 // Alpn: Optional. ALPN (Application-Layer Protocol Negotiation) to match
4391 // against. Examples: "http/1.1", "h2". At least one of sni_host and alpn is
4392 // required. Up to 5 alpns across all matches can be set.
4393 Alpn []string `json:"alpn,omitempty"`
4394 // SniHost: Optional. SNI (server name indicator) to match against. SNI will be
4395 // matched against all wildcard domains, i.e. `www.example.com` will be first
4396 // matched against `www.example.com`, then `*.example.com`, then `*.com.`
4397 // Partial wildcards are not supported, and values like *w.example.com are
4398 // invalid. At least one of sni_host and alpn is required. Up to 100 sni hosts
4399 // across all matches can be set.
4400 SniHost []string `json:"sniHost,omitempty"`
4401 // ForceSendFields is a list of field names (e.g. "Alpn") to unconditionally
4402 // include in API requests. By default, fields with empty or default values are
4403 // omitted from API requests. See
4404 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4405 // details.
4406 ForceSendFields []string `json:"-"`
4407 // NullFields is a list of field names (e.g. "Alpn") to include in API requests
4408 // with the JSON null value. By default, fields with empty values are omitted
4409 // from API requests. See
4410 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4411 NullFields []string `json:"-"`
4412 }
4413
4414 func (s TlsRouteRouteMatch) MarshalJSON() ([]byte, error) {
4415 type NoMethod TlsRouteRouteMatch
4416 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4417 }
4418
4419 // TlsRouteRouteRule: Specifies how to match traffic and how to route traffic
4420 // when traffic is matched.
4421 type TlsRouteRouteRule struct {
4422 // Action: Required. The detailed rule defining how to route matched traffic.
4423 Action *TlsRouteRouteAction `json:"action,omitempty"`
4424 // Matches: Required. RouteMatch defines the predicate used to match requests
4425 // to a given action. Multiple match types are "OR"ed for evaluation. Atleast
4426 // one RouteMatch must be supplied.
4427 Matches []*TlsRouteRouteMatch `json:"matches,omitempty"`
4428 // ForceSendFields is a list of field names (e.g. "Action") to unconditionally
4429 // include in API requests. By default, fields with empty or default values are
4430 // omitted from API requests. See
4431 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4432 // details.
4433 ForceSendFields []string `json:"-"`
4434 // NullFields is a list of field names (e.g. "Action") to include in API
4435 // requests with the JSON null value. By default, fields with empty values are
4436 // omitted from API requests. See
4437 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4438 NullFields []string `json:"-"`
4439 }
4440
4441 func (s TlsRouteRouteRule) MarshalJSON() ([]byte, error) {
4442 type NoMethod TlsRouteRouteRule
4443 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4444 }
4445
4446 // TrafficPortSelector: Specification of a port-based selector.
4447 type TrafficPortSelector struct {
4448 // Ports: Optional. A list of ports. Can be port numbers or port range
4449 // (example, [80-90] specifies all ports from 80 to 90, including 80 and 90) or
4450 // named ports or * to specify all ports. If the list is empty, all ports are
4451 // selected.
4452 Ports []string `json:"ports,omitempty"`
4453 // ForceSendFields is a list of field names (e.g. "Ports") to unconditionally
4454 // include in API requests. By default, fields with empty or default values are
4455 // omitted from API requests. See
4456 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4457 // details.
4458 ForceSendFields []string `json:"-"`
4459 // NullFields is a list of field names (e.g. "Ports") to include in API
4460 // requests with the JSON null value. By default, fields with empty values are
4461 // omitted from API requests. See
4462 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4463 NullFields []string `json:"-"`
4464 }
4465
4466 func (s TrafficPortSelector) MarshalJSON() ([]byte, error) {
4467 type NoMethod TrafficPortSelector
4468 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4469 }
4470
4471 // WasmPlugin: `WasmPlugin` is a resource representing a service executing a
4472 // customer-provided Wasm module.
4473 type WasmPlugin struct {
4474 // CreateTime: Output only. The timestamp when the resource was created.
4475 CreateTime string `json:"createTime,omitempty"`
4476 // Description: Optional. A human-readable description of the resource.
4477 Description string `json:"description,omitempty"`
4478 // Labels: Optional. Set of labels associated with the `WasmPlugin` resource.
4479 // The format must comply with the following requirements
4480 // (/compute/docs/labeling-resources#requirements).
4481 Labels map[string]string `json:"labels,omitempty"`
4482 // LogConfig: Optional. Specifies the logging options for the activity
4483 // performed by this plugin. If logging is enabled, plugin logs are exported to
4484 // Cloud Logging. Note that the settings relate to the logs generated by using
4485 // logging statements in your Wasm code.
4486 LogConfig *WasmPluginLogConfig `json:"logConfig,omitempty"`
4487 // MainVersionId: Optional. The ID of the `WasmPluginVersion` resource that is
4488 // the currently serving one. The version referred to must be a child of this
4489 // `WasmPlugin` resource.
4490 MainVersionId string `json:"mainVersionId,omitempty"`
4491 // Name: Identifier. Name of the `WasmPlugin` resource in the following format:
4492 // `projects/{project}/locations/{location}/wasmPlugins/{wasm_plugin}`.
4493 Name string `json:"name,omitempty"`
4494 // UpdateTime: Output only. The timestamp when the resource was updated.
4495 UpdateTime string `json:"updateTime,omitempty"`
4496 // UsedBy: Output only. List of all extensions
4497 // (https://cloud.google.com/service-extensions/docs/overview) that use this
4498 // `WasmPlugin` resource.
4499 UsedBy []*WasmPluginUsedBy `json:"usedBy,omitempty"`
4500 // Versions: Optional. All versions of this `WasmPlugin` resource in the
4501 // key-value format. The key is the resource ID, and the value is the
4502 // `VersionDetails` object. Lets you create or update a `WasmPlugin` resource
4503 // and its versions in a single request. When the `main_version_id` field is
4504 // not empty, it must point to one of the `VersionDetails` objects in the map.
4505 // If provided in a `PATCH` request, the new versions replace the previous set.
4506 // Any version omitted from the `versions` field is removed. Because the
4507 // `WasmPluginVersion` resource is immutable, if a `WasmPluginVersion` resource
4508 // with the same name already exists and differs, the request fails. Note: In a
4509 // `GET` request, this field is populated only if the field
4510 // `GetWasmPluginRequest.view` is set to `WASM_PLUGIN_VIEW_FULL`.
4511 Versions map[string]WasmPluginVersionDetails `json:"versions,omitempty"`
4512
4513 // ServerResponse contains the HTTP response code and headers from the server.
4514 googleapi.ServerResponse `json:"-"`
4515 // ForceSendFields is a list of field names (e.g. "CreateTime") to
4516 // unconditionally include in API requests. By default, fields with empty or
4517 // default values are omitted from API requests. See
4518 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4519 // details.
4520 ForceSendFields []string `json:"-"`
4521 // NullFields is a list of field names (e.g. "CreateTime") to include in API
4522 // requests with the JSON null value. By default, fields with empty values are
4523 // omitted from API requests. See
4524 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4525 NullFields []string `json:"-"`
4526 }
4527
4528 func (s WasmPlugin) MarshalJSON() ([]byte, error) {
4529 type NoMethod WasmPlugin
4530 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4531 }
4532
4533 // WasmPluginLogConfig: Specifies the logging options for the activity
4534 // performed by this plugin. If logging is enabled, plugin logs are exported to
4535 // Cloud Logging.
4536 type WasmPluginLogConfig struct {
4537 // Enable: Optional. Specifies whether to enable logging for activity by this
4538 // plugin. Defaults to `false`.
4539 Enable bool `json:"enable,omitempty"`
4540 // MinLogLevel: Non-empty default. Specifies the lowest level of the plugin
4541 // logs that are exported to Cloud Logging. This setting relates to the logs
4542 // generated by using logging statements in your Wasm code. This field is can
4543 // be set only if logging is enabled for the plugin. If the field is not
4544 // provided when logging is enabled, it is set to `INFO` by default.
4545 //
4546 // Possible values:
4547 // "LOG_LEVEL_UNSPECIFIED" - Unspecified value. Defaults to `LogLevel.INFO`.
4548 // "TRACE" - Report logs with TRACE level and above.
4549 // "DEBUG" - Report logs with DEBUG level and above.
4550 // "INFO" - Report logs with INFO level and above.
4551 // "WARN" - Report logs with WARN level and above.
4552 // "ERROR" - Report logs with ERROR level and above.
4553 // "CRITICAL" - Report logs with CRITICAL level only.
4554 MinLogLevel string `json:"minLogLevel,omitempty"`
4555 // SampleRate: Non-empty default. Configures the sampling rate of activity
4556 // logs, where `1.0` means all logged activity is reported and `0.0` means no
4557 // activity is reported. A floating point value between `0.0` and `1.0`
4558 // indicates that a percentage of log messages is stored. The default value
4559 // when logging is enabled is `1.0`. The value of the field must be between `0`
4560 // and `1` (inclusive). This field can be specified only if logging is enabled
4561 // for this plugin.
4562 SampleRate float64 `json:"sampleRate,omitempty"`
4563 // ForceSendFields is a list of field names (e.g. "Enable") to unconditionally
4564 // include in API requests. By default, fields with empty or default values are
4565 // omitted from API requests. See
4566 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4567 // details.
4568 ForceSendFields []string `json:"-"`
4569 // NullFields is a list of field names (e.g. "Enable") to include in API
4570 // requests with the JSON null value. By default, fields with empty values are
4571 // omitted from API requests. See
4572 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4573 NullFields []string `json:"-"`
4574 }
4575
4576 func (s WasmPluginLogConfig) MarshalJSON() ([]byte, error) {
4577 type NoMethod WasmPluginLogConfig
4578 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4579 }
4580
4581 func (s *WasmPluginLogConfig) UnmarshalJSON(data []byte) error {
4582 type NoMethod WasmPluginLogConfig
4583 var s1 struct {
4584 SampleRate gensupport.JSONFloat64 `json:"sampleRate"`
4585 *NoMethod
4586 }
4587 s1.NoMethod = (*NoMethod)(s)
4588 if err := json.Unmarshal(data, &s1); err != nil {
4589 return err
4590 }
4591 s.SampleRate = float64(s1.SampleRate)
4592 return nil
4593 }
4594
4595 // WasmPluginUsedBy: Defines a resource that uses the `WasmPlugin` resource.
4596 type WasmPluginUsedBy struct {
4597 // Name: Output only. Full name of the resource
4598 // https://google.aip.dev/122#full-resource-names, for example
4599 // `//networkservices.googleapis.com/projects/{project}/locations/{location}/lbR
4600 // outeExtensions/{extension}`
4601 Name string `json:"name,omitempty"`
4602 // ForceSendFields is a list of field names (e.g. "Name") to unconditionally
4603 // include in API requests. By default, fields with empty or default values are
4604 // omitted from API requests. See
4605 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4606 // details.
4607 ForceSendFields []string `json:"-"`
4608 // NullFields is a list of field names (e.g. "Name") to include in API requests
4609 // with the JSON null value. By default, fields with empty values are omitted
4610 // from API requests. See
4611 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4612 NullFields []string `json:"-"`
4613 }
4614
4615 func (s WasmPluginUsedBy) MarshalJSON() ([]byte, error) {
4616 type NoMethod WasmPluginUsedBy
4617 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4618 }
4619
4620 // WasmPluginVersion: A single immutable version of a `WasmPlugin` resource.
4621 // Defines the Wasm module used and optionally its runtime config.
4622 type WasmPluginVersion struct {
4623 // CreateTime: Output only. The timestamp when the resource was created.
4624 CreateTime string `json:"createTime,omitempty"`
4625 // Description: Optional. A human-readable description of the resource.
4626 Description string `json:"description,omitempty"`
4627 // ImageDigest: Output only. This field holds the digest (usually checksum)
4628 // value for the plugin image. The value is calculated based on the `image_uri`
4629 // field. If the `image_uri` field refers to a container image, the digest
4630 // value is obtained from the container image. If the `image_uri` field refers
4631 // to a generic artifact, the digest value is calculated based on the contents
4632 // of the file.
4633 ImageDigest string `json:"imageDigest,omitempty"`
4634 // ImageUri: Optional. URI of the image containing the Wasm module, stored in
4635 // Artifact Registry. The URI can refer to one of the following repository
4636 // formats: * Container images: the `image_uri` must point to a container that
4637 // contains a single file with the name `plugin.wasm`. When a new
4638 // `WasmPluginVersion` resource is created, the digest of the image is saved in
4639 // the `image_digest` field. When pulling a container image from Artifact
4640 // Registry, the digest value is used instead of an image tag. * Generic
4641 // artifacts: the `image_uri` must be in this format:
4642 // `projects/{project}/locations/{location}/repositories/{repository}/
4643 // genericArtifacts/{package}:{version}`. The specified package and version
4644 // must contain a file with the name `plugin.wasm`. When a new
4645 // `WasmPluginVersion` resource is created, the checksum of the contents of the
4646 // file is saved in the `image_digest` field.
4647 ImageUri string `json:"imageUri,omitempty"`
4648 // Labels: Optional. Set of labels associated with the `WasmPluginVersion`
4649 // resource.
4650 Labels map[string]string `json:"labels,omitempty"`
4651 // Name: Identifier. Name of the `WasmPluginVersion` resource in the following
4652 // format: `projects/{project}/locations/{location}/wasmPlugins/{wasm_plugin}/
4653 // versions/{wasm_plugin_version}`.
4654 Name string `json:"name,omitempty"`
4655 // PluginConfigData: Configuration for the plugin. The configuration is
4656 // provided to the plugin at runtime through the `ON_CONFIGURE` callback. When
4657 // a new `WasmPluginVersion` resource is created, the digest of the contents is
4658 // saved in the `plugin_config_digest` field.
4659 PluginConfigData string `json:"pluginConfigData,omitempty"`
4660 // PluginConfigDigest: Output only. This field holds the digest (usually
4661 // checksum) value for the plugin configuration. The value is calculated based
4662 // on the contents of `plugin_config_data` field or the image defined by the
4663 // `plugin_config_uri` field.
4664 PluginConfigDigest string `json:"pluginConfigDigest,omitempty"`
4665 // PluginConfigUri: URI of the plugin configuration stored in the Artifact
4666 // Registry. The configuration is provided to the plugin at runtime through the
4667 // `ON_CONFIGURE` callback. The URI can refer to one of the following
4668 // repository formats: * Container images: the `plugin_config_uri` must point
4669 // to a container that contains a single file with the name `plugin.config`.
4670 // When a new `WasmPluginVersion` resource is created, the digest of the image
4671 // is saved in the `plugin_config_digest` field. When pulling a container image
4672 // from Artifact Registry, the digest value is used instead of an image tag. *
4673 // Generic artifacts: the `plugin_config_uri` must be in this format:
4674 // `projects/{project}/locations/{location}/repositories/{repository}/
4675 // genericArtifacts/{package}:{version}`. The specified package and version
4676 // must contain a file with the name `plugin.config`. When a new
4677 // `WasmPluginVersion` resource is created, the checksum of the contents of the
4678 // file is saved in the `plugin_config_digest` field.
4679 PluginConfigUri string `json:"pluginConfigUri,omitempty"`
4680 // UpdateTime: Output only. The timestamp when the resource was updated.
4681 UpdateTime string `json:"updateTime,omitempty"`
4682
4683 // ServerResponse contains the HTTP response code and headers from the server.
4684 googleapi.ServerResponse `json:"-"`
4685 // ForceSendFields is a list of field names (e.g. "CreateTime") to
4686 // unconditionally include in API requests. By default, fields with empty or
4687 // default values are omitted from API requests. See
4688 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4689 // details.
4690 ForceSendFields []string `json:"-"`
4691 // NullFields is a list of field names (e.g. "CreateTime") to include in API
4692 // requests with the JSON null value. By default, fields with empty values are
4693 // omitted from API requests. See
4694 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4695 NullFields []string `json:"-"`
4696 }
4697
4698 func (s WasmPluginVersion) MarshalJSON() ([]byte, error) {
4699 type NoMethod WasmPluginVersion
4700 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4701 }
4702
4703 // WasmPluginVersionDetails: Details of a `WasmPluginVersion` resource to be
4704 // inlined in the `WasmPlugin` resource.
4705 type WasmPluginVersionDetails struct {
4706 // CreateTime: Output only. The timestamp when the resource was created.
4707 CreateTime string `json:"createTime,omitempty"`
4708 // Description: Optional. A human-readable description of the resource.
4709 Description string `json:"description,omitempty"`
4710 // ImageDigest: Output only. This field holds the digest (usually checksum)
4711 // value for the plugin image. The value is calculated based on the `image_uri`
4712 // field. If the `image_uri` field refers to a container image, the digest
4713 // value is obtained from the container image. If the `image_uri` field refers
4714 // to a generic artifact, the digest value is calculated based on the contents
4715 // of the file.
4716 ImageDigest string `json:"imageDigest,omitempty"`
4717 // ImageUri: Optional. URI of the image containing the Wasm module, stored in
4718 // Artifact Registry. The URI can refer to one of the following repository
4719 // formats: * Container images: the `image_uri` must point to a container that
4720 // contains a single file with the name `plugin.wasm`. When a new
4721 // `WasmPluginVersion` resource is created, the digest of the image is saved in
4722 // the `image_digest` field. When pulling a container image from Artifact
4723 // Registry, the digest value is used instead of an image tag. * Generic
4724 // artifacts: the `image_uri` must be in this format:
4725 // `projects/{project}/locations/{location}/repositories/{repository}/
4726 // genericArtifacts/{package}:{version}`. The specified package and version
4727 // must contain a file with the name `plugin.wasm`. When a new
4728 // `WasmPluginVersion` resource is created, the checksum of the contents of the
4729 // file is saved in the `image_digest` field.
4730 ImageUri string `json:"imageUri,omitempty"`
4731 // Labels: Optional. Set of labels associated with the `WasmPluginVersion`
4732 // resource.
4733 Labels map[string]string `json:"labels,omitempty"`
4734 // PluginConfigData: Configuration for the plugin. The configuration is
4735 // provided to the plugin at runtime through the `ON_CONFIGURE` callback. When
4736 // a new `WasmPluginVersion` version is created, the digest of the contents is
4737 // saved in the `plugin_config_digest` field.
4738 PluginConfigData string `json:"pluginConfigData,omitempty"`
4739 // PluginConfigDigest: Output only. This field holds the digest (usually
4740 // checksum) value for the plugin configuration. The value is calculated based
4741 // on the contents of `plugin_config_data` field or the image defined by the
4742 // `plugin_config_uri` field.
4743 PluginConfigDigest string `json:"pluginConfigDigest,omitempty"`
4744 // PluginConfigUri: URI of the plugin configuration stored in the Artifact
4745 // Registry. The configuration is provided to the plugin at runtime through the
4746 // `ON_CONFIGURE` callback. The URI can refer to one of the following
4747 // repository formats: * Container images: the `plugin_config_uri` must point
4748 // to a container that contains a single file with the name `plugin.config`.
4749 // When a new `WasmPluginVersion` resource is created, the digest of the image
4750 // is saved in the `plugin_config_digest` field. When pulling a container image
4751 // from Artifact Registry, the digest value is used instead of an image tag. *
4752 // Generic artifacts: the `plugin_config_uri` must be in this format:
4753 // `projects/{project}/locations/{location}/repositories/{repository}/
4754 // genericArtifacts/{package}:{version}`. The specified package and version
4755 // must contain a file with the name `plugin.config`. When a new
4756 // `WasmPluginVersion` resource is created, the checksum of the contents of the
4757 // file is saved in the `plugin_config_digest` field.
4758 PluginConfigUri string `json:"pluginConfigUri,omitempty"`
4759 // UpdateTime: Output only. The timestamp when the resource was updated.
4760 UpdateTime string `json:"updateTime,omitempty"`
4761 // ForceSendFields is a list of field names (e.g. "CreateTime") to
4762 // unconditionally include in API requests. By default, fields with empty or
4763 // default values are omitted from API requests. See
4764 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4765 // details.
4766 ForceSendFields []string `json:"-"`
4767 // NullFields is a list of field names (e.g. "CreateTime") to include in API
4768 // requests with the JSON null value. By default, fields with empty values are
4769 // omitted from API requests. See
4770 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4771 NullFields []string `json:"-"`
4772 }
4773
4774 func (s WasmPluginVersionDetails) MarshalJSON() ([]byte, error) {
4775 type NoMethod WasmPluginVersionDetails
4776 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4777 }
4778
4779 type ProjectsLocationsGetCall struct {
4780 s *Service
4781 name string
4782 urlParams_ gensupport.URLParams
4783 ifNoneMatch_ string
4784 ctx_ context.Context
4785 header_ http.Header
4786 }
4787
4788 // Get: Gets information about a location.
4789 //
4790 // - name: Resource name for the location.
4791 func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
4792 c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4793 c.name = name
4794 return c
4795 }
4796
4797 // Fields allows partial responses to be retrieved. See
4798 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4799 // details.
4800 func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
4801 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4802 return c
4803 }
4804
4805 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4806 // object's ETag matches the given value. This is useful for getting updates
4807 // only after the object has changed since the last request.
4808 func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
4809 c.ifNoneMatch_ = entityTag
4810 return c
4811 }
4812
4813 // Context sets the context to be used in this call's Do method.
4814 func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
4815 c.ctx_ = ctx
4816 return c
4817 }
4818
4819 // Header returns a http.Header that can be modified by the caller to add
4820 // headers to the request.
4821 func (c *ProjectsLocationsGetCall) Header() http.Header {
4822 if c.header_ == nil {
4823 c.header_ = make(http.Header)
4824 }
4825 return c.header_
4826 }
4827
4828 func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
4829 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4830 if c.ifNoneMatch_ != "" {
4831 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4832 }
4833 c.urlParams_.Set("alt", alt)
4834 c.urlParams_.Set("prettyPrint", "false")
4835 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
4836 urls += "?" + c.urlParams_.Encode()
4837 req, err := http.NewRequest("GET", urls, nil)
4838 if err != nil {
4839 return nil, err
4840 }
4841 req.Header = reqHeaders
4842 googleapi.Expand(req.URL, map[string]string{
4843 "name": c.name,
4844 })
4845 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.get", "request", internallog.HTTPRequest(req, nil))
4846 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4847 }
4848
4849 // Do executes the "networkservices.projects.locations.get" call.
4850 // Any non-2xx status code is an error. Response headers are in either
4851 // *Location.ServerResponse.Header or (if a response was returned at all) in
4852 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4853 // whether the returned error was because http.StatusNotModified was returned.
4854 func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
4855 gensupport.SetOptions(c.urlParams_, opts...)
4856 res, err := c.doRequest("json")
4857 if res != nil && res.StatusCode == http.StatusNotModified {
4858 if res.Body != nil {
4859 res.Body.Close()
4860 }
4861 return nil, gensupport.WrapError(&googleapi.Error{
4862 Code: res.StatusCode,
4863 Header: res.Header,
4864 })
4865 }
4866 if err != nil {
4867 return nil, err
4868 }
4869 defer googleapi.CloseBody(res)
4870 if err := googleapi.CheckResponse(res); err != nil {
4871 return nil, gensupport.WrapError(err)
4872 }
4873 ret := &Location{
4874 ServerResponse: googleapi.ServerResponse{
4875 Header: res.Header,
4876 HTTPStatusCode: res.StatusCode,
4877 },
4878 }
4879 target := &ret
4880 b, err := gensupport.DecodeResponseBytes(target, res)
4881 if err != nil {
4882 return nil, err
4883 }
4884 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.get", "response", internallog.HTTPResponse(res, b))
4885 return ret, nil
4886 }
4887
4888 type ProjectsLocationsListCall struct {
4889 s *Service
4890 name string
4891 urlParams_ gensupport.URLParams
4892 ifNoneMatch_ string
4893 ctx_ context.Context
4894 header_ http.Header
4895 }
4896
4897 // List: Lists information about the supported locations for this service. This
4898 // method lists locations based on the resource scope provided in the
4899 // [ListLocationsRequest.name] field: * **Global locations**: If `name` is
4900 // empty, the method lists the public locations available to all projects. *
4901 // **Project-specific locations**: If `name` follows the format
4902 // `projects/{project}`, the method lists locations visible to that specific
4903 // project. This includes public, private, or other project-specific locations
4904 // enabled for the project. For gRPC and client library implementations, the
4905 // resource name is passed as the `name` field. For direct service calls, the
4906 // resource name is incorporated into the request path based on the specific
4907 // service implementation and version.
4908 //
4909 // - name: The resource that owns the locations collection, if applicable.
4910 func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
4911 c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4912 c.name = name
4913 return c
4914 }
4915
4916 // ExtraLocationTypes sets the optional parameter "extraLocationTypes": Do not
4917 // use this field. It is unsupported and is ignored unless explicitly
4918 // documented otherwise. This is primarily for internal usage.
4919 func (c *ProjectsLocationsListCall) ExtraLocationTypes(extraLocationTypes ...string) *ProjectsLocationsListCall {
4920 c.urlParams_.SetMulti("extraLocationTypes", append([]string{}, extraLocationTypes...))
4921 return c
4922 }
4923
4924 // Filter sets the optional parameter "filter": A filter to narrow down results
4925 // to a preferred subset. The filtering language accepts strings like
4926 // "displayName=tokyo", and is documented in more detail in AIP-160
4927 // (https://google.aip.dev/160).
4928 func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
4929 c.urlParams_.Set("filter", filter)
4930 return c
4931 }
4932
4933 // PageSize sets the optional parameter "pageSize": The maximum number of
4934 // results to return. If not set, the service selects a default.
4935 func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
4936 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4937 return c
4938 }
4939
4940 // PageToken sets the optional parameter "pageToken": A page token received
4941 // from the `next_page_token` field in the response. Send that page token to
4942 // receive the subsequent page.
4943 func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
4944 c.urlParams_.Set("pageToken", pageToken)
4945 return c
4946 }
4947
4948 // Fields allows partial responses to be retrieved. See
4949 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4950 // details.
4951 func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
4952 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4953 return c
4954 }
4955
4956 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4957 // object's ETag matches the given value. This is useful for getting updates
4958 // only after the object has changed since the last request.
4959 func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
4960 c.ifNoneMatch_ = entityTag
4961 return c
4962 }
4963
4964 // Context sets the context to be used in this call's Do method.
4965 func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
4966 c.ctx_ = ctx
4967 return c
4968 }
4969
4970 // Header returns a http.Header that can be modified by the caller to add
4971 // headers to the request.
4972 func (c *ProjectsLocationsListCall) Header() http.Header {
4973 if c.header_ == nil {
4974 c.header_ = make(http.Header)
4975 }
4976 return c.header_
4977 }
4978
4979 func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
4980 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4981 if c.ifNoneMatch_ != "" {
4982 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4983 }
4984 c.urlParams_.Set("alt", alt)
4985 c.urlParams_.Set("prettyPrint", "false")
4986 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations")
4987 urls += "?" + c.urlParams_.Encode()
4988 req, err := http.NewRequest("GET", urls, nil)
4989 if err != nil {
4990 return nil, err
4991 }
4992 req.Header = reqHeaders
4993 googleapi.Expand(req.URL, map[string]string{
4994 "name": c.name,
4995 })
4996 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.list", "request", internallog.HTTPRequest(req, nil))
4997 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4998 }
4999
5000 // Do executes the "networkservices.projects.locations.list" call.
5001 // Any non-2xx status code is an error. Response headers are in either
5002 // *ListLocationsResponse.ServerResponse.Header or (if a response was returned
5003 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
5004 // check whether the returned error was because http.StatusNotModified was
5005 // returned.
5006 func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
5007 gensupport.SetOptions(c.urlParams_, opts...)
5008 res, err := c.doRequest("json")
5009 if res != nil && res.StatusCode == http.StatusNotModified {
5010 if res.Body != nil {
5011 res.Body.Close()
5012 }
5013 return nil, gensupport.WrapError(&googleapi.Error{
5014 Code: res.StatusCode,
5015 Header: res.Header,
5016 })
5017 }
5018 if err != nil {
5019 return nil, err
5020 }
5021 defer googleapi.CloseBody(res)
5022 if err := googleapi.CheckResponse(res); err != nil {
5023 return nil, gensupport.WrapError(err)
5024 }
5025 ret := &ListLocationsResponse{
5026 ServerResponse: googleapi.ServerResponse{
5027 Header: res.Header,
5028 HTTPStatusCode: res.StatusCode,
5029 },
5030 }
5031 target := &ret
5032 b, err := gensupport.DecodeResponseBytes(target, res)
5033 if err != nil {
5034 return nil, err
5035 }
5036 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.list", "response", internallog.HTTPResponse(res, b))
5037 return ret, nil
5038 }
5039
5040 // Pages invokes f for each page of results.
5041 // A non-nil error returned from f will halt the iteration.
5042 // The provided context supersedes any context provided to the Context method.
5043 func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
5044 c.ctx_ = ctx
5045 defer c.PageToken(c.urlParams_.Get("pageToken"))
5046 for {
5047 x, err := c.Do()
5048 if err != nil {
5049 return err
5050 }
5051 if err := f(x); err != nil {
5052 return err
5053 }
5054 if x.NextPageToken == "" {
5055 return nil
5056 }
5057 c.PageToken(x.NextPageToken)
5058 }
5059 }
5060
5061 type ProjectsLocationsAuthzExtensionsCreateCall struct {
5062 s *Service
5063 parent string
5064 authzextension *AuthzExtension
5065 urlParams_ gensupport.URLParams
5066 ctx_ context.Context
5067 header_ http.Header
5068 }
5069
5070 // Create: Creates a new `AuthzExtension` resource in a given project and
5071 // location.
5072 //
5073 // - parent: The parent resource of the `AuthzExtension` resource. Must be in
5074 // the format `projects/{project}/locations/{location}`.
5075 func (r *ProjectsLocationsAuthzExtensionsService) Create(parent string, authzextension *AuthzExtension) *ProjectsLocationsAuthzExtensionsCreateCall {
5076 c := &ProjectsLocationsAuthzExtensionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5077 c.parent = parent
5078 c.authzextension = authzextension
5079 return c
5080 }
5081
5082 // AuthzExtensionId sets the optional parameter "authzExtensionId": Required.
5083 // User-provided ID of the `AuthzExtension` resource to be created.
5084 func (c *ProjectsLocationsAuthzExtensionsCreateCall) AuthzExtensionId(authzExtensionId string) *ProjectsLocationsAuthzExtensionsCreateCall {
5085 c.urlParams_.Set("authzExtensionId", authzExtensionId)
5086 return c
5087 }
5088
5089 // RequestId sets the optional parameter "requestId": An optional request ID to
5090 // identify requests. Specify a unique request ID so that if you must retry
5091 // your request, the server can ignore the request if it has already been
5092 // completed. The server guarantees that for 60 minutes since the first
5093 // request. For example, consider a situation where you make an initial request
5094 // and the request times out. If you make the request again with the same
5095 // request ID, the server ignores the second request This prevents clients from
5096 // accidentally creating duplicate commitments. The request ID must be a valid
5097 // UUID with the exception that zero UUID is not supported
5098 // (00000000-0000-0000-0000-000000000000).
5099 func (c *ProjectsLocationsAuthzExtensionsCreateCall) RequestId(requestId string) *ProjectsLocationsAuthzExtensionsCreateCall {
5100 c.urlParams_.Set("requestId", requestId)
5101 return c
5102 }
5103
5104 // Fields allows partial responses to be retrieved. See
5105 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5106 // details.
5107 func (c *ProjectsLocationsAuthzExtensionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsAuthzExtensionsCreateCall {
5108 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5109 return c
5110 }
5111
5112 // Context sets the context to be used in this call's Do method.
5113 func (c *ProjectsLocationsAuthzExtensionsCreateCall) Context(ctx context.Context) *ProjectsLocationsAuthzExtensionsCreateCall {
5114 c.ctx_ = ctx
5115 return c
5116 }
5117
5118 // Header returns a http.Header that can be modified by the caller to add
5119 // headers to the request.
5120 func (c *ProjectsLocationsAuthzExtensionsCreateCall) Header() http.Header {
5121 if c.header_ == nil {
5122 c.header_ = make(http.Header)
5123 }
5124 return c.header_
5125 }
5126
5127 func (c *ProjectsLocationsAuthzExtensionsCreateCall) doRequest(alt string) (*http.Response, error) {
5128 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5129 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.authzextension)
5130 if err != nil {
5131 return nil, err
5132 }
5133 c.urlParams_.Set("alt", alt)
5134 c.urlParams_.Set("prettyPrint", "false")
5135 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/authzExtensions")
5136 urls += "?" + c.urlParams_.Encode()
5137 req, err := http.NewRequest("POST", urls, body)
5138 if err != nil {
5139 return nil, err
5140 }
5141 req.Header = reqHeaders
5142 googleapi.Expand(req.URL, map[string]string{
5143 "parent": c.parent,
5144 })
5145 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.authzExtensions.create", "request", internallog.HTTPRequest(req, body.Bytes()))
5146 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5147 }
5148
5149 // Do executes the "networkservices.projects.locations.authzExtensions.create" call.
5150 // Any non-2xx status code is an error. Response headers are in either
5151 // *Operation.ServerResponse.Header or (if a response was returned at all) in
5152 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5153 // whether the returned error was because http.StatusNotModified was returned.
5154 func (c *ProjectsLocationsAuthzExtensionsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
5155 gensupport.SetOptions(c.urlParams_, opts...)
5156 res, err := c.doRequest("json")
5157 if res != nil && res.StatusCode == http.StatusNotModified {
5158 if res.Body != nil {
5159 res.Body.Close()
5160 }
5161 return nil, gensupport.WrapError(&googleapi.Error{
5162 Code: res.StatusCode,
5163 Header: res.Header,
5164 })
5165 }
5166 if err != nil {
5167 return nil, err
5168 }
5169 defer googleapi.CloseBody(res)
5170 if err := googleapi.CheckResponse(res); err != nil {
5171 return nil, gensupport.WrapError(err)
5172 }
5173 ret := &Operation{
5174 ServerResponse: googleapi.ServerResponse{
5175 Header: res.Header,
5176 HTTPStatusCode: res.StatusCode,
5177 },
5178 }
5179 target := &ret
5180 b, err := gensupport.DecodeResponseBytes(target, res)
5181 if err != nil {
5182 return nil, err
5183 }
5184 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.authzExtensions.create", "response", internallog.HTTPResponse(res, b))
5185 return ret, nil
5186 }
5187
5188 type ProjectsLocationsAuthzExtensionsDeleteCall struct {
5189 s *Service
5190 name string
5191 urlParams_ gensupport.URLParams
5192 ctx_ context.Context
5193 header_ http.Header
5194 }
5195
5196 // Delete: Deletes the specified `AuthzExtension` resource.
5197 //
5198 // - name: The name of the `AuthzExtension` resource to delete. Must be in the
5199 // format
5200 // `projects/{project}/locations/{location}/authzExtensions/{authz_extension}`
5201 // .
5202 func (r *ProjectsLocationsAuthzExtensionsService) Delete(name string) *ProjectsLocationsAuthzExtensionsDeleteCall {
5203 c := &ProjectsLocationsAuthzExtensionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5204 c.name = name
5205 return c
5206 }
5207
5208 // RequestId sets the optional parameter "requestId": An optional request ID to
5209 // identify requests. Specify a unique request ID so that if you must retry
5210 // your request, the server can ignore the request if it has already been
5211 // completed. The server guarantees that for 60 minutes after the first
5212 // request. For example, consider a situation where you make an initial request
5213 // and the request times out. If you make the request again with the same
5214 // request ID, the server ignores the second request This prevents clients from
5215 // accidentally creating duplicate commitments. The request ID must be a valid
5216 // UUID with the exception that zero UUID is not supported
5217 // (00000000-0000-0000-0000-000000000000).
5218 func (c *ProjectsLocationsAuthzExtensionsDeleteCall) RequestId(requestId string) *ProjectsLocationsAuthzExtensionsDeleteCall {
5219 c.urlParams_.Set("requestId", requestId)
5220 return c
5221 }
5222
5223 // Fields allows partial responses to be retrieved. See
5224 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5225 // details.
5226 func (c *ProjectsLocationsAuthzExtensionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsAuthzExtensionsDeleteCall {
5227 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5228 return c
5229 }
5230
5231 // Context sets the context to be used in this call's Do method.
5232 func (c *ProjectsLocationsAuthzExtensionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsAuthzExtensionsDeleteCall {
5233 c.ctx_ = ctx
5234 return c
5235 }
5236
5237 // Header returns a http.Header that can be modified by the caller to add
5238 // headers to the request.
5239 func (c *ProjectsLocationsAuthzExtensionsDeleteCall) Header() http.Header {
5240 if c.header_ == nil {
5241 c.header_ = make(http.Header)
5242 }
5243 return c.header_
5244 }
5245
5246 func (c *ProjectsLocationsAuthzExtensionsDeleteCall) doRequest(alt string) (*http.Response, error) {
5247 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5248 c.urlParams_.Set("alt", alt)
5249 c.urlParams_.Set("prettyPrint", "false")
5250 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
5251 urls += "?" + c.urlParams_.Encode()
5252 req, err := http.NewRequest("DELETE", urls, nil)
5253 if err != nil {
5254 return nil, err
5255 }
5256 req.Header = reqHeaders
5257 googleapi.Expand(req.URL, map[string]string{
5258 "name": c.name,
5259 })
5260 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.authzExtensions.delete", "request", internallog.HTTPRequest(req, nil))
5261 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5262 }
5263
5264 // Do executes the "networkservices.projects.locations.authzExtensions.delete" call.
5265 // Any non-2xx status code is an error. Response headers are in either
5266 // *Operation.ServerResponse.Header or (if a response was returned at all) in
5267 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5268 // whether the returned error was because http.StatusNotModified was returned.
5269 func (c *ProjectsLocationsAuthzExtensionsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
5270 gensupport.SetOptions(c.urlParams_, opts...)
5271 res, err := c.doRequest("json")
5272 if res != nil && res.StatusCode == http.StatusNotModified {
5273 if res.Body != nil {
5274 res.Body.Close()
5275 }
5276 return nil, gensupport.WrapError(&googleapi.Error{
5277 Code: res.StatusCode,
5278 Header: res.Header,
5279 })
5280 }
5281 if err != nil {
5282 return nil, err
5283 }
5284 defer googleapi.CloseBody(res)
5285 if err := googleapi.CheckResponse(res); err != nil {
5286 return nil, gensupport.WrapError(err)
5287 }
5288 ret := &Operation{
5289 ServerResponse: googleapi.ServerResponse{
5290 Header: res.Header,
5291 HTTPStatusCode: res.StatusCode,
5292 },
5293 }
5294 target := &ret
5295 b, err := gensupport.DecodeResponseBytes(target, res)
5296 if err != nil {
5297 return nil, err
5298 }
5299 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.authzExtensions.delete", "response", internallog.HTTPResponse(res, b))
5300 return ret, nil
5301 }
5302
5303 type ProjectsLocationsAuthzExtensionsGetCall struct {
5304 s *Service
5305 name string
5306 urlParams_ gensupport.URLParams
5307 ifNoneMatch_ string
5308 ctx_ context.Context
5309 header_ http.Header
5310 }
5311
5312 // Get: Gets details of the specified `AuthzExtension` resource.
5313 //
5314 // - name: A name of the `AuthzExtension` resource to get. Must be in the
5315 // format
5316 // `projects/{project}/locations/{location}/authzExtensions/{authz_extension}`
5317 // .
5318 func (r *ProjectsLocationsAuthzExtensionsService) Get(name string) *ProjectsLocationsAuthzExtensionsGetCall {
5319 c := &ProjectsLocationsAuthzExtensionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5320 c.name = name
5321 return c
5322 }
5323
5324 // Fields allows partial responses to be retrieved. See
5325 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5326 // details.
5327 func (c *ProjectsLocationsAuthzExtensionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsAuthzExtensionsGetCall {
5328 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5329 return c
5330 }
5331
5332 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5333 // object's ETag matches the given value. This is useful for getting updates
5334 // only after the object has changed since the last request.
5335 func (c *ProjectsLocationsAuthzExtensionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsAuthzExtensionsGetCall {
5336 c.ifNoneMatch_ = entityTag
5337 return c
5338 }
5339
5340 // Context sets the context to be used in this call's Do method.
5341 func (c *ProjectsLocationsAuthzExtensionsGetCall) Context(ctx context.Context) *ProjectsLocationsAuthzExtensionsGetCall {
5342 c.ctx_ = ctx
5343 return c
5344 }
5345
5346 // Header returns a http.Header that can be modified by the caller to add
5347 // headers to the request.
5348 func (c *ProjectsLocationsAuthzExtensionsGetCall) Header() http.Header {
5349 if c.header_ == nil {
5350 c.header_ = make(http.Header)
5351 }
5352 return c.header_
5353 }
5354
5355 func (c *ProjectsLocationsAuthzExtensionsGetCall) doRequest(alt string) (*http.Response, error) {
5356 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5357 if c.ifNoneMatch_ != "" {
5358 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5359 }
5360 c.urlParams_.Set("alt", alt)
5361 c.urlParams_.Set("prettyPrint", "false")
5362 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
5363 urls += "?" + c.urlParams_.Encode()
5364 req, err := http.NewRequest("GET", urls, nil)
5365 if err != nil {
5366 return nil, err
5367 }
5368 req.Header = reqHeaders
5369 googleapi.Expand(req.URL, map[string]string{
5370 "name": c.name,
5371 })
5372 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.authzExtensions.get", "request", internallog.HTTPRequest(req, nil))
5373 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5374 }
5375
5376 // Do executes the "networkservices.projects.locations.authzExtensions.get" call.
5377 // Any non-2xx status code is an error. Response headers are in either
5378 // *AuthzExtension.ServerResponse.Header or (if a response was returned at all)
5379 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5380 // whether the returned error was because http.StatusNotModified was returned.
5381 func (c *ProjectsLocationsAuthzExtensionsGetCall) Do(opts ...googleapi.CallOption) (*AuthzExtension, error) {
5382 gensupport.SetOptions(c.urlParams_, opts...)
5383 res, err := c.doRequest("json")
5384 if res != nil && res.StatusCode == http.StatusNotModified {
5385 if res.Body != nil {
5386 res.Body.Close()
5387 }
5388 return nil, gensupport.WrapError(&googleapi.Error{
5389 Code: res.StatusCode,
5390 Header: res.Header,
5391 })
5392 }
5393 if err != nil {
5394 return nil, err
5395 }
5396 defer googleapi.CloseBody(res)
5397 if err := googleapi.CheckResponse(res); err != nil {
5398 return nil, gensupport.WrapError(err)
5399 }
5400 ret := &AuthzExtension{
5401 ServerResponse: googleapi.ServerResponse{
5402 Header: res.Header,
5403 HTTPStatusCode: res.StatusCode,
5404 },
5405 }
5406 target := &ret
5407 b, err := gensupport.DecodeResponseBytes(target, res)
5408 if err != nil {
5409 return nil, err
5410 }
5411 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.authzExtensions.get", "response", internallog.HTTPResponse(res, b))
5412 return ret, nil
5413 }
5414
5415 type ProjectsLocationsAuthzExtensionsListCall struct {
5416 s *Service
5417 parent string
5418 urlParams_ gensupport.URLParams
5419 ifNoneMatch_ string
5420 ctx_ context.Context
5421 header_ http.Header
5422 }
5423
5424 // List: Lists `AuthzExtension` resources in a given project and location.
5425 //
5426 // - parent: The project and location from which the `AuthzExtension` resources
5427 // are listed. These values are specified in the following format:
5428 // `projects/{project}/locations/{location}`.
5429 func (r *ProjectsLocationsAuthzExtensionsService) List(parent string) *ProjectsLocationsAuthzExtensionsListCall {
5430 c := &ProjectsLocationsAuthzExtensionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5431 c.parent = parent
5432 return c
5433 }
5434
5435 // Filter sets the optional parameter "filter": Filtering results.
5436 func (c *ProjectsLocationsAuthzExtensionsListCall) Filter(filter string) *ProjectsLocationsAuthzExtensionsListCall {
5437 c.urlParams_.Set("filter", filter)
5438 return c
5439 }
5440
5441 // OrderBy sets the optional parameter "orderBy": Hint about how to order the
5442 // results.
5443 func (c *ProjectsLocationsAuthzExtensionsListCall) OrderBy(orderBy string) *ProjectsLocationsAuthzExtensionsListCall {
5444 c.urlParams_.Set("orderBy", orderBy)
5445 return c
5446 }
5447
5448 // PageSize sets the optional parameter "pageSize": Requested page size. The
5449 // server might return fewer items than requested. If unspecified, the server
5450 // picks an appropriate default.
5451 func (c *ProjectsLocationsAuthzExtensionsListCall) PageSize(pageSize int64) *ProjectsLocationsAuthzExtensionsListCall {
5452 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
5453 return c
5454 }
5455
5456 // PageToken sets the optional parameter "pageToken": A token identifying a
5457 // page of results that the server returns.
5458 func (c *ProjectsLocationsAuthzExtensionsListCall) PageToken(pageToken string) *ProjectsLocationsAuthzExtensionsListCall {
5459 c.urlParams_.Set("pageToken", pageToken)
5460 return c
5461 }
5462
5463 // Fields allows partial responses to be retrieved. See
5464 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5465 // details.
5466 func (c *ProjectsLocationsAuthzExtensionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsAuthzExtensionsListCall {
5467 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5468 return c
5469 }
5470
5471 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5472 // object's ETag matches the given value. This is useful for getting updates
5473 // only after the object has changed since the last request.
5474 func (c *ProjectsLocationsAuthzExtensionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsAuthzExtensionsListCall {
5475 c.ifNoneMatch_ = entityTag
5476 return c
5477 }
5478
5479 // Context sets the context to be used in this call's Do method.
5480 func (c *ProjectsLocationsAuthzExtensionsListCall) Context(ctx context.Context) *ProjectsLocationsAuthzExtensionsListCall {
5481 c.ctx_ = ctx
5482 return c
5483 }
5484
5485 // Header returns a http.Header that can be modified by the caller to add
5486 // headers to the request.
5487 func (c *ProjectsLocationsAuthzExtensionsListCall) Header() http.Header {
5488 if c.header_ == nil {
5489 c.header_ = make(http.Header)
5490 }
5491 return c.header_
5492 }
5493
5494 func (c *ProjectsLocationsAuthzExtensionsListCall) doRequest(alt string) (*http.Response, error) {
5495 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5496 if c.ifNoneMatch_ != "" {
5497 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5498 }
5499 c.urlParams_.Set("alt", alt)
5500 c.urlParams_.Set("prettyPrint", "false")
5501 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/authzExtensions")
5502 urls += "?" + c.urlParams_.Encode()
5503 req, err := http.NewRequest("GET", urls, nil)
5504 if err != nil {
5505 return nil, err
5506 }
5507 req.Header = reqHeaders
5508 googleapi.Expand(req.URL, map[string]string{
5509 "parent": c.parent,
5510 })
5511 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.authzExtensions.list", "request", internallog.HTTPRequest(req, nil))
5512 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5513 }
5514
5515 // Do executes the "networkservices.projects.locations.authzExtensions.list" call.
5516 // Any non-2xx status code is an error. Response headers are in either
5517 // *ListAuthzExtensionsResponse.ServerResponse.Header or (if a response was
5518 // returned at all) in error.(*googleapi.Error).Header. Use
5519 // googleapi.IsNotModified to check whether the returned error was because
5520 // http.StatusNotModified was returned.
5521 func (c *ProjectsLocationsAuthzExtensionsListCall) Do(opts ...googleapi.CallOption) (*ListAuthzExtensionsResponse, error) {
5522 gensupport.SetOptions(c.urlParams_, opts...)
5523 res, err := c.doRequest("json")
5524 if res != nil && res.StatusCode == http.StatusNotModified {
5525 if res.Body != nil {
5526 res.Body.Close()
5527 }
5528 return nil, gensupport.WrapError(&googleapi.Error{
5529 Code: res.StatusCode,
5530 Header: res.Header,
5531 })
5532 }
5533 if err != nil {
5534 return nil, err
5535 }
5536 defer googleapi.CloseBody(res)
5537 if err := googleapi.CheckResponse(res); err != nil {
5538 return nil, gensupport.WrapError(err)
5539 }
5540 ret := &ListAuthzExtensionsResponse{
5541 ServerResponse: googleapi.ServerResponse{
5542 Header: res.Header,
5543 HTTPStatusCode: res.StatusCode,
5544 },
5545 }
5546 target := &ret
5547 b, err := gensupport.DecodeResponseBytes(target, res)
5548 if err != nil {
5549 return nil, err
5550 }
5551 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.authzExtensions.list", "response", internallog.HTTPResponse(res, b))
5552 return ret, nil
5553 }
5554
5555 // Pages invokes f for each page of results.
5556 // A non-nil error returned from f will halt the iteration.
5557 // The provided context supersedes any context provided to the Context method.
5558 func (c *ProjectsLocationsAuthzExtensionsListCall) Pages(ctx context.Context, f func(*ListAuthzExtensionsResponse) error) error {
5559 c.ctx_ = ctx
5560 defer c.PageToken(c.urlParams_.Get("pageToken"))
5561 for {
5562 x, err := c.Do()
5563 if err != nil {
5564 return err
5565 }
5566 if err := f(x); err != nil {
5567 return err
5568 }
5569 if x.NextPageToken == "" {
5570 return nil
5571 }
5572 c.PageToken(x.NextPageToken)
5573 }
5574 }
5575
5576 type ProjectsLocationsAuthzExtensionsPatchCall struct {
5577 s *Service
5578 name string
5579 authzextension *AuthzExtension
5580 urlParams_ gensupport.URLParams
5581 ctx_ context.Context
5582 header_ http.Header
5583 }
5584
5585 // Patch: Updates the parameters of the specified `AuthzExtension` resource.
5586 //
5587 // - name: Identifier. Name of the `AuthzExtension` resource in the following
5588 // format:
5589 // `projects/{project}/locations/{location}/authzExtensions/{authz_extension}`
5590 // .
5591 func (r *ProjectsLocationsAuthzExtensionsService) Patch(name string, authzextension *AuthzExtension) *ProjectsLocationsAuthzExtensionsPatchCall {
5592 c := &ProjectsLocationsAuthzExtensionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5593 c.name = name
5594 c.authzextension = authzextension
5595 return c
5596 }
5597
5598 // RequestId sets the optional parameter "requestId": An optional request ID to
5599 // identify requests. Specify a unique request ID so that if you must retry
5600 // your request, the server can ignore the request if it has already been
5601 // completed. The server guarantees that for 60 minutes since the first
5602 // request. For example, consider a situation where you make an initial request
5603 // and the request times out. If you make the request again with the same
5604 // request ID, the server ignores the second request This prevents clients from
5605 // accidentally creating duplicate commitments. The request ID must be a valid
5606 // UUID with the exception that zero UUID is not supported
5607 // (00000000-0000-0000-0000-000000000000).
5608 func (c *ProjectsLocationsAuthzExtensionsPatchCall) RequestId(requestId string) *ProjectsLocationsAuthzExtensionsPatchCall {
5609 c.urlParams_.Set("requestId", requestId)
5610 return c
5611 }
5612
5613 // UpdateMask sets the optional parameter "updateMask": Required. Used to
5614 // specify the fields to be overwritten in the `AuthzExtension` resource by the
5615 // update. The fields specified in the `update_mask` are relative to the
5616 // resource, not the full request. A field is overwritten if it is in the mask.
5617 // If the user does not specify a mask, then all fields are overwritten.
5618 func (c *ProjectsLocationsAuthzExtensionsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsAuthzExtensionsPatchCall {
5619 c.urlParams_.Set("updateMask", updateMask)
5620 return c
5621 }
5622
5623 // Fields allows partial responses to be retrieved. See
5624 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5625 // details.
5626 func (c *ProjectsLocationsAuthzExtensionsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsAuthzExtensionsPatchCall {
5627 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5628 return c
5629 }
5630
5631 // Context sets the context to be used in this call's Do method.
5632 func (c *ProjectsLocationsAuthzExtensionsPatchCall) Context(ctx context.Context) *ProjectsLocationsAuthzExtensionsPatchCall {
5633 c.ctx_ = ctx
5634 return c
5635 }
5636
5637 // Header returns a http.Header that can be modified by the caller to add
5638 // headers to the request.
5639 func (c *ProjectsLocationsAuthzExtensionsPatchCall) Header() http.Header {
5640 if c.header_ == nil {
5641 c.header_ = make(http.Header)
5642 }
5643 return c.header_
5644 }
5645
5646 func (c *ProjectsLocationsAuthzExtensionsPatchCall) doRequest(alt string) (*http.Response, error) {
5647 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5648 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.authzextension)
5649 if err != nil {
5650 return nil, err
5651 }
5652 c.urlParams_.Set("alt", alt)
5653 c.urlParams_.Set("prettyPrint", "false")
5654 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
5655 urls += "?" + c.urlParams_.Encode()
5656 req, err := http.NewRequest("PATCH", urls, body)
5657 if err != nil {
5658 return nil, err
5659 }
5660 req.Header = reqHeaders
5661 googleapi.Expand(req.URL, map[string]string{
5662 "name": c.name,
5663 })
5664 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.authzExtensions.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
5665 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5666 }
5667
5668 // Do executes the "networkservices.projects.locations.authzExtensions.patch" call.
5669 // Any non-2xx status code is an error. Response headers are in either
5670 // *Operation.ServerResponse.Header or (if a response was returned at all) in
5671 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5672 // whether the returned error was because http.StatusNotModified was returned.
5673 func (c *ProjectsLocationsAuthzExtensionsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
5674 gensupport.SetOptions(c.urlParams_, opts...)
5675 res, err := c.doRequest("json")
5676 if res != nil && res.StatusCode == http.StatusNotModified {
5677 if res.Body != nil {
5678 res.Body.Close()
5679 }
5680 return nil, gensupport.WrapError(&googleapi.Error{
5681 Code: res.StatusCode,
5682 Header: res.Header,
5683 })
5684 }
5685 if err != nil {
5686 return nil, err
5687 }
5688 defer googleapi.CloseBody(res)
5689 if err := googleapi.CheckResponse(res); err != nil {
5690 return nil, gensupport.WrapError(err)
5691 }
5692 ret := &Operation{
5693 ServerResponse: googleapi.ServerResponse{
5694 Header: res.Header,
5695 HTTPStatusCode: res.StatusCode,
5696 },
5697 }
5698 target := &ret
5699 b, err := gensupport.DecodeResponseBytes(target, res)
5700 if err != nil {
5701 return nil, err
5702 }
5703 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.authzExtensions.patch", "response", internallog.HTTPResponse(res, b))
5704 return ret, nil
5705 }
5706
5707 type ProjectsLocationsEdgeCacheKeysetsGetIamPolicyCall struct {
5708 s *Service
5709 resource string
5710 urlParams_ gensupport.URLParams
5711 ifNoneMatch_ string
5712 ctx_ context.Context
5713 header_ http.Header
5714 }
5715
5716 // GetIamPolicy: Gets the access control policy for a resource. Returns an
5717 // empty policy if the resource exists and does not have a policy set.
5718 //
5719 // - resource: REQUIRED: The resource for which the policy is being requested.
5720 // See Resource names (https://cloud.google.com/apis/design/resource_names)
5721 // for the appropriate value for this field.
5722 func (r *ProjectsLocationsEdgeCacheKeysetsService) GetIamPolicy(resource string) *ProjectsLocationsEdgeCacheKeysetsGetIamPolicyCall {
5723 c := &ProjectsLocationsEdgeCacheKeysetsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5724 c.resource = resource
5725 return c
5726 }
5727
5728 // OptionsRequestedPolicyVersion sets the optional parameter
5729 // "options.requestedPolicyVersion": The maximum policy version that will be
5730 // used to format the policy. Valid values are 0, 1, and 3. Requests specifying
5731 // an invalid value will be rejected. Requests for policies with any
5732 // conditional role bindings must specify version 3. Policies with no
5733 // conditional role bindings may specify any valid value or leave the field
5734 // unset. The policy in the response might use the policy version that you
5735 // specified, or it might use a lower policy version. For example, if you
5736 // specify version 3, but the policy has no conditional role bindings, the
5737 // response uses version 1. To learn which resources support conditions in
5738 // their IAM policies, see the IAM documentation
5739 // (https://cloud.google.com/iam/help/conditions/resource-policies).
5740 func (c *ProjectsLocationsEdgeCacheKeysetsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsEdgeCacheKeysetsGetIamPolicyCall {
5741 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
5742 return c
5743 }
5744
5745 // Fields allows partial responses to be retrieved. See
5746 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5747 // details.
5748 func (c *ProjectsLocationsEdgeCacheKeysetsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsEdgeCacheKeysetsGetIamPolicyCall {
5749 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5750 return c
5751 }
5752
5753 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5754 // object's ETag matches the given value. This is useful for getting updates
5755 // only after the object has changed since the last request.
5756 func (c *ProjectsLocationsEdgeCacheKeysetsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsEdgeCacheKeysetsGetIamPolicyCall {
5757 c.ifNoneMatch_ = entityTag
5758 return c
5759 }
5760
5761 // Context sets the context to be used in this call's Do method.
5762 func (c *ProjectsLocationsEdgeCacheKeysetsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsEdgeCacheKeysetsGetIamPolicyCall {
5763 c.ctx_ = ctx
5764 return c
5765 }
5766
5767 // Header returns a http.Header that can be modified by the caller to add
5768 // headers to the request.
5769 func (c *ProjectsLocationsEdgeCacheKeysetsGetIamPolicyCall) Header() http.Header {
5770 if c.header_ == nil {
5771 c.header_ = make(http.Header)
5772 }
5773 return c.header_
5774 }
5775
5776 func (c *ProjectsLocationsEdgeCacheKeysetsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
5777 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5778 if c.ifNoneMatch_ != "" {
5779 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5780 }
5781 c.urlParams_.Set("alt", alt)
5782 c.urlParams_.Set("prettyPrint", "false")
5783 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
5784 urls += "?" + c.urlParams_.Encode()
5785 req, err := http.NewRequest("GET", urls, nil)
5786 if err != nil {
5787 return nil, err
5788 }
5789 req.Header = reqHeaders
5790 googleapi.Expand(req.URL, map[string]string{
5791 "resource": c.resource,
5792 })
5793 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.edgeCacheKeysets.getIamPolicy", "request", internallog.HTTPRequest(req, nil))
5794 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5795 }
5796
5797 // Do executes the "networkservices.projects.locations.edgeCacheKeysets.getIamPolicy" call.
5798 // Any non-2xx status code is an error. Response headers are in either
5799 // *Policy.ServerResponse.Header or (if a response was returned at all) in
5800 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5801 // whether the returned error was because http.StatusNotModified was returned.
5802 func (c *ProjectsLocationsEdgeCacheKeysetsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
5803 gensupport.SetOptions(c.urlParams_, opts...)
5804 res, err := c.doRequest("json")
5805 if res != nil && res.StatusCode == http.StatusNotModified {
5806 if res.Body != nil {
5807 res.Body.Close()
5808 }
5809 return nil, gensupport.WrapError(&googleapi.Error{
5810 Code: res.StatusCode,
5811 Header: res.Header,
5812 })
5813 }
5814 if err != nil {
5815 return nil, err
5816 }
5817 defer googleapi.CloseBody(res)
5818 if err := googleapi.CheckResponse(res); err != nil {
5819 return nil, gensupport.WrapError(err)
5820 }
5821 ret := &Policy{
5822 ServerResponse: googleapi.ServerResponse{
5823 Header: res.Header,
5824 HTTPStatusCode: res.StatusCode,
5825 },
5826 }
5827 target := &ret
5828 b, err := gensupport.DecodeResponseBytes(target, res)
5829 if err != nil {
5830 return nil, err
5831 }
5832 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.edgeCacheKeysets.getIamPolicy", "response", internallog.HTTPResponse(res, b))
5833 return ret, nil
5834 }
5835
5836 type ProjectsLocationsEdgeCacheKeysetsSetIamPolicyCall struct {
5837 s *Service
5838 resource string
5839 setiampolicyrequest *SetIamPolicyRequest
5840 urlParams_ gensupport.URLParams
5841 ctx_ context.Context
5842 header_ http.Header
5843 }
5844
5845 // SetIamPolicy: Sets the access control policy on the specified resource.
5846 // Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
5847 // and `PERMISSION_DENIED` errors.
5848 //
5849 // - resource: REQUIRED: The resource for which the policy is being specified.
5850 // See Resource names (https://cloud.google.com/apis/design/resource_names)
5851 // for the appropriate value for this field.
5852 func (r *ProjectsLocationsEdgeCacheKeysetsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsEdgeCacheKeysetsSetIamPolicyCall {
5853 c := &ProjectsLocationsEdgeCacheKeysetsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5854 c.resource = resource
5855 c.setiampolicyrequest = setiampolicyrequest
5856 return c
5857 }
5858
5859 // Fields allows partial responses to be retrieved. See
5860 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5861 // details.
5862 func (c *ProjectsLocationsEdgeCacheKeysetsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsEdgeCacheKeysetsSetIamPolicyCall {
5863 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5864 return c
5865 }
5866
5867 // Context sets the context to be used in this call's Do method.
5868 func (c *ProjectsLocationsEdgeCacheKeysetsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsEdgeCacheKeysetsSetIamPolicyCall {
5869 c.ctx_ = ctx
5870 return c
5871 }
5872
5873 // Header returns a http.Header that can be modified by the caller to add
5874 // headers to the request.
5875 func (c *ProjectsLocationsEdgeCacheKeysetsSetIamPolicyCall) Header() http.Header {
5876 if c.header_ == nil {
5877 c.header_ = make(http.Header)
5878 }
5879 return c.header_
5880 }
5881
5882 func (c *ProjectsLocationsEdgeCacheKeysetsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
5883 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5884 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest)
5885 if err != nil {
5886 return nil, err
5887 }
5888 c.urlParams_.Set("alt", alt)
5889 c.urlParams_.Set("prettyPrint", "false")
5890 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
5891 urls += "?" + c.urlParams_.Encode()
5892 req, err := http.NewRequest("POST", urls, body)
5893 if err != nil {
5894 return nil, err
5895 }
5896 req.Header = reqHeaders
5897 googleapi.Expand(req.URL, map[string]string{
5898 "resource": c.resource,
5899 })
5900 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.edgeCacheKeysets.setIamPolicy", "request", internallog.HTTPRequest(req, body.Bytes()))
5901 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5902 }
5903
5904 // Do executes the "networkservices.projects.locations.edgeCacheKeysets.setIamPolicy" call.
5905 // Any non-2xx status code is an error. Response headers are in either
5906 // *Policy.ServerResponse.Header or (if a response was returned at all) in
5907 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5908 // whether the returned error was because http.StatusNotModified was returned.
5909 func (c *ProjectsLocationsEdgeCacheKeysetsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
5910 gensupport.SetOptions(c.urlParams_, opts...)
5911 res, err := c.doRequest("json")
5912 if res != nil && res.StatusCode == http.StatusNotModified {
5913 if res.Body != nil {
5914 res.Body.Close()
5915 }
5916 return nil, gensupport.WrapError(&googleapi.Error{
5917 Code: res.StatusCode,
5918 Header: res.Header,
5919 })
5920 }
5921 if err != nil {
5922 return nil, err
5923 }
5924 defer googleapi.CloseBody(res)
5925 if err := googleapi.CheckResponse(res); err != nil {
5926 return nil, gensupport.WrapError(err)
5927 }
5928 ret := &Policy{
5929 ServerResponse: googleapi.ServerResponse{
5930 Header: res.Header,
5931 HTTPStatusCode: res.StatusCode,
5932 },
5933 }
5934 target := &ret
5935 b, err := gensupport.DecodeResponseBytes(target, res)
5936 if err != nil {
5937 return nil, err
5938 }
5939 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.edgeCacheKeysets.setIamPolicy", "response", internallog.HTTPResponse(res, b))
5940 return ret, nil
5941 }
5942
5943 type ProjectsLocationsEdgeCacheKeysetsTestIamPermissionsCall struct {
5944 s *Service
5945 resource string
5946 testiampermissionsrequest *TestIamPermissionsRequest
5947 urlParams_ gensupport.URLParams
5948 ctx_ context.Context
5949 header_ http.Header
5950 }
5951
5952 // TestIamPermissions: Returns permissions that a caller has on the specified
5953 // resource. If the resource does not exist, this will return an empty set of
5954 // permissions, not a `NOT_FOUND` error. Note: This operation is designed to be
5955 // used for building permission-aware UIs and command-line tools, not for
5956 // authorization checking. This operation may "fail open" without warning.
5957 //
5958 // - resource: REQUIRED: The resource for which the policy detail is being
5959 // requested. See Resource names
5960 // (https://cloud.google.com/apis/design/resource_names) for the appropriate
5961 // value for this field.
5962 func (r *ProjectsLocationsEdgeCacheKeysetsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsEdgeCacheKeysetsTestIamPermissionsCall {
5963 c := &ProjectsLocationsEdgeCacheKeysetsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5964 c.resource = resource
5965 c.testiampermissionsrequest = testiampermissionsrequest
5966 return c
5967 }
5968
5969 // Fields allows partial responses to be retrieved. See
5970 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5971 // details.
5972 func (c *ProjectsLocationsEdgeCacheKeysetsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsEdgeCacheKeysetsTestIamPermissionsCall {
5973 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5974 return c
5975 }
5976
5977 // Context sets the context to be used in this call's Do method.
5978 func (c *ProjectsLocationsEdgeCacheKeysetsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsEdgeCacheKeysetsTestIamPermissionsCall {
5979 c.ctx_ = ctx
5980 return c
5981 }
5982
5983 // Header returns a http.Header that can be modified by the caller to add
5984 // headers to the request.
5985 func (c *ProjectsLocationsEdgeCacheKeysetsTestIamPermissionsCall) Header() http.Header {
5986 if c.header_ == nil {
5987 c.header_ = make(http.Header)
5988 }
5989 return c.header_
5990 }
5991
5992 func (c *ProjectsLocationsEdgeCacheKeysetsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
5993 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5994 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest)
5995 if err != nil {
5996 return nil, err
5997 }
5998 c.urlParams_.Set("alt", alt)
5999 c.urlParams_.Set("prettyPrint", "false")
6000 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
6001 urls += "?" + c.urlParams_.Encode()
6002 req, err := http.NewRequest("POST", urls, body)
6003 if err != nil {
6004 return nil, err
6005 }
6006 req.Header = reqHeaders
6007 googleapi.Expand(req.URL, map[string]string{
6008 "resource": c.resource,
6009 })
6010 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.edgeCacheKeysets.testIamPermissions", "request", internallog.HTTPRequest(req, body.Bytes()))
6011 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6012 }
6013
6014 // Do executes the "networkservices.projects.locations.edgeCacheKeysets.testIamPermissions" call.
6015 // Any non-2xx status code is an error. Response headers are in either
6016 // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
6017 // returned at all) in error.(*googleapi.Error).Header. Use
6018 // googleapi.IsNotModified to check whether the returned error was because
6019 // http.StatusNotModified was returned.
6020 func (c *ProjectsLocationsEdgeCacheKeysetsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
6021 gensupport.SetOptions(c.urlParams_, opts...)
6022 res, err := c.doRequest("json")
6023 if res != nil && res.StatusCode == http.StatusNotModified {
6024 if res.Body != nil {
6025 res.Body.Close()
6026 }
6027 return nil, gensupport.WrapError(&googleapi.Error{
6028 Code: res.StatusCode,
6029 Header: res.Header,
6030 })
6031 }
6032 if err != nil {
6033 return nil, err
6034 }
6035 defer googleapi.CloseBody(res)
6036 if err := googleapi.CheckResponse(res); err != nil {
6037 return nil, gensupport.WrapError(err)
6038 }
6039 ret := &TestIamPermissionsResponse{
6040 ServerResponse: googleapi.ServerResponse{
6041 Header: res.Header,
6042 HTTPStatusCode: res.StatusCode,
6043 },
6044 }
6045 target := &ret
6046 b, err := gensupport.DecodeResponseBytes(target, res)
6047 if err != nil {
6048 return nil, err
6049 }
6050 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.edgeCacheKeysets.testIamPermissions", "response", internallog.HTTPResponse(res, b))
6051 return ret, nil
6052 }
6053
6054 type ProjectsLocationsEdgeCacheOriginsGetIamPolicyCall struct {
6055 s *Service
6056 resource string
6057 urlParams_ gensupport.URLParams
6058 ifNoneMatch_ string
6059 ctx_ context.Context
6060 header_ http.Header
6061 }
6062
6063 // GetIamPolicy: Gets the access control policy for a resource. Returns an
6064 // empty policy if the resource exists and does not have a policy set.
6065 //
6066 // - resource: REQUIRED: The resource for which the policy is being requested.
6067 // See Resource names (https://cloud.google.com/apis/design/resource_names)
6068 // for the appropriate value for this field.
6069 func (r *ProjectsLocationsEdgeCacheOriginsService) GetIamPolicy(resource string) *ProjectsLocationsEdgeCacheOriginsGetIamPolicyCall {
6070 c := &ProjectsLocationsEdgeCacheOriginsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6071 c.resource = resource
6072 return c
6073 }
6074
6075 // OptionsRequestedPolicyVersion sets the optional parameter
6076 // "options.requestedPolicyVersion": The maximum policy version that will be
6077 // used to format the policy. Valid values are 0, 1, and 3. Requests specifying
6078 // an invalid value will be rejected. Requests for policies with any
6079 // conditional role bindings must specify version 3. Policies with no
6080 // conditional role bindings may specify any valid value or leave the field
6081 // unset. The policy in the response might use the policy version that you
6082 // specified, or it might use a lower policy version. For example, if you
6083 // specify version 3, but the policy has no conditional role bindings, the
6084 // response uses version 1. To learn which resources support conditions in
6085 // their IAM policies, see the IAM documentation
6086 // (https://cloud.google.com/iam/help/conditions/resource-policies).
6087 func (c *ProjectsLocationsEdgeCacheOriginsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsEdgeCacheOriginsGetIamPolicyCall {
6088 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
6089 return c
6090 }
6091
6092 // Fields allows partial responses to be retrieved. See
6093 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6094 // details.
6095 func (c *ProjectsLocationsEdgeCacheOriginsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsEdgeCacheOriginsGetIamPolicyCall {
6096 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6097 return c
6098 }
6099
6100 // IfNoneMatch sets an optional parameter which makes the operation fail if the
6101 // object's ETag matches the given value. This is useful for getting updates
6102 // only after the object has changed since the last request.
6103 func (c *ProjectsLocationsEdgeCacheOriginsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsEdgeCacheOriginsGetIamPolicyCall {
6104 c.ifNoneMatch_ = entityTag
6105 return c
6106 }
6107
6108 // Context sets the context to be used in this call's Do method.
6109 func (c *ProjectsLocationsEdgeCacheOriginsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsEdgeCacheOriginsGetIamPolicyCall {
6110 c.ctx_ = ctx
6111 return c
6112 }
6113
6114 // Header returns a http.Header that can be modified by the caller to add
6115 // headers to the request.
6116 func (c *ProjectsLocationsEdgeCacheOriginsGetIamPolicyCall) Header() http.Header {
6117 if c.header_ == nil {
6118 c.header_ = make(http.Header)
6119 }
6120 return c.header_
6121 }
6122
6123 func (c *ProjectsLocationsEdgeCacheOriginsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
6124 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6125 if c.ifNoneMatch_ != "" {
6126 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6127 }
6128 c.urlParams_.Set("alt", alt)
6129 c.urlParams_.Set("prettyPrint", "false")
6130 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
6131 urls += "?" + c.urlParams_.Encode()
6132 req, err := http.NewRequest("GET", urls, nil)
6133 if err != nil {
6134 return nil, err
6135 }
6136 req.Header = reqHeaders
6137 googleapi.Expand(req.URL, map[string]string{
6138 "resource": c.resource,
6139 })
6140 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.edgeCacheOrigins.getIamPolicy", "request", internallog.HTTPRequest(req, nil))
6141 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6142 }
6143
6144 // Do executes the "networkservices.projects.locations.edgeCacheOrigins.getIamPolicy" call.
6145 // Any non-2xx status code is an error. Response headers are in either
6146 // *Policy.ServerResponse.Header or (if a response was returned at all) in
6147 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6148 // whether the returned error was because http.StatusNotModified was returned.
6149 func (c *ProjectsLocationsEdgeCacheOriginsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
6150 gensupport.SetOptions(c.urlParams_, opts...)
6151 res, err := c.doRequest("json")
6152 if res != nil && res.StatusCode == http.StatusNotModified {
6153 if res.Body != nil {
6154 res.Body.Close()
6155 }
6156 return nil, gensupport.WrapError(&googleapi.Error{
6157 Code: res.StatusCode,
6158 Header: res.Header,
6159 })
6160 }
6161 if err != nil {
6162 return nil, err
6163 }
6164 defer googleapi.CloseBody(res)
6165 if err := googleapi.CheckResponse(res); err != nil {
6166 return nil, gensupport.WrapError(err)
6167 }
6168 ret := &Policy{
6169 ServerResponse: googleapi.ServerResponse{
6170 Header: res.Header,
6171 HTTPStatusCode: res.StatusCode,
6172 },
6173 }
6174 target := &ret
6175 b, err := gensupport.DecodeResponseBytes(target, res)
6176 if err != nil {
6177 return nil, err
6178 }
6179 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.edgeCacheOrigins.getIamPolicy", "response", internallog.HTTPResponse(res, b))
6180 return ret, nil
6181 }
6182
6183 type ProjectsLocationsEdgeCacheOriginsSetIamPolicyCall struct {
6184 s *Service
6185 resource string
6186 setiampolicyrequest *SetIamPolicyRequest
6187 urlParams_ gensupport.URLParams
6188 ctx_ context.Context
6189 header_ http.Header
6190 }
6191
6192 // SetIamPolicy: Sets the access control policy on the specified resource.
6193 // Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
6194 // and `PERMISSION_DENIED` errors.
6195 //
6196 // - resource: REQUIRED: The resource for which the policy is being specified.
6197 // See Resource names (https://cloud.google.com/apis/design/resource_names)
6198 // for the appropriate value for this field.
6199 func (r *ProjectsLocationsEdgeCacheOriginsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsEdgeCacheOriginsSetIamPolicyCall {
6200 c := &ProjectsLocationsEdgeCacheOriginsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6201 c.resource = resource
6202 c.setiampolicyrequest = setiampolicyrequest
6203 return c
6204 }
6205
6206 // Fields allows partial responses to be retrieved. See
6207 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6208 // details.
6209 func (c *ProjectsLocationsEdgeCacheOriginsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsEdgeCacheOriginsSetIamPolicyCall {
6210 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6211 return c
6212 }
6213
6214 // Context sets the context to be used in this call's Do method.
6215 func (c *ProjectsLocationsEdgeCacheOriginsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsEdgeCacheOriginsSetIamPolicyCall {
6216 c.ctx_ = ctx
6217 return c
6218 }
6219
6220 // Header returns a http.Header that can be modified by the caller to add
6221 // headers to the request.
6222 func (c *ProjectsLocationsEdgeCacheOriginsSetIamPolicyCall) Header() http.Header {
6223 if c.header_ == nil {
6224 c.header_ = make(http.Header)
6225 }
6226 return c.header_
6227 }
6228
6229 func (c *ProjectsLocationsEdgeCacheOriginsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
6230 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6231 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest)
6232 if err != nil {
6233 return nil, err
6234 }
6235 c.urlParams_.Set("alt", alt)
6236 c.urlParams_.Set("prettyPrint", "false")
6237 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
6238 urls += "?" + c.urlParams_.Encode()
6239 req, err := http.NewRequest("POST", urls, body)
6240 if err != nil {
6241 return nil, err
6242 }
6243 req.Header = reqHeaders
6244 googleapi.Expand(req.URL, map[string]string{
6245 "resource": c.resource,
6246 })
6247 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.edgeCacheOrigins.setIamPolicy", "request", internallog.HTTPRequest(req, body.Bytes()))
6248 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6249 }
6250
6251 // Do executes the "networkservices.projects.locations.edgeCacheOrigins.setIamPolicy" call.
6252 // Any non-2xx status code is an error. Response headers are in either
6253 // *Policy.ServerResponse.Header or (if a response was returned at all) in
6254 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6255 // whether the returned error was because http.StatusNotModified was returned.
6256 func (c *ProjectsLocationsEdgeCacheOriginsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
6257 gensupport.SetOptions(c.urlParams_, opts...)
6258 res, err := c.doRequest("json")
6259 if res != nil && res.StatusCode == http.StatusNotModified {
6260 if res.Body != nil {
6261 res.Body.Close()
6262 }
6263 return nil, gensupport.WrapError(&googleapi.Error{
6264 Code: res.StatusCode,
6265 Header: res.Header,
6266 })
6267 }
6268 if err != nil {
6269 return nil, err
6270 }
6271 defer googleapi.CloseBody(res)
6272 if err := googleapi.CheckResponse(res); err != nil {
6273 return nil, gensupport.WrapError(err)
6274 }
6275 ret := &Policy{
6276 ServerResponse: googleapi.ServerResponse{
6277 Header: res.Header,
6278 HTTPStatusCode: res.StatusCode,
6279 },
6280 }
6281 target := &ret
6282 b, err := gensupport.DecodeResponseBytes(target, res)
6283 if err != nil {
6284 return nil, err
6285 }
6286 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.edgeCacheOrigins.setIamPolicy", "response", internallog.HTTPResponse(res, b))
6287 return ret, nil
6288 }
6289
6290 type ProjectsLocationsEdgeCacheOriginsTestIamPermissionsCall struct {
6291 s *Service
6292 resource string
6293 testiampermissionsrequest *TestIamPermissionsRequest
6294 urlParams_ gensupport.URLParams
6295 ctx_ context.Context
6296 header_ http.Header
6297 }
6298
6299 // TestIamPermissions: Returns permissions that a caller has on the specified
6300 // resource. If the resource does not exist, this will return an empty set of
6301 // permissions, not a `NOT_FOUND` error. Note: This operation is designed to be
6302 // used for building permission-aware UIs and command-line tools, not for
6303 // authorization checking. This operation may "fail open" without warning.
6304 //
6305 // - resource: REQUIRED: The resource for which the policy detail is being
6306 // requested. See Resource names
6307 // (https://cloud.google.com/apis/design/resource_names) for the appropriate
6308 // value for this field.
6309 func (r *ProjectsLocationsEdgeCacheOriginsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsEdgeCacheOriginsTestIamPermissionsCall {
6310 c := &ProjectsLocationsEdgeCacheOriginsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6311 c.resource = resource
6312 c.testiampermissionsrequest = testiampermissionsrequest
6313 return c
6314 }
6315
6316 // Fields allows partial responses to be retrieved. See
6317 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6318 // details.
6319 func (c *ProjectsLocationsEdgeCacheOriginsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsEdgeCacheOriginsTestIamPermissionsCall {
6320 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6321 return c
6322 }
6323
6324 // Context sets the context to be used in this call's Do method.
6325 func (c *ProjectsLocationsEdgeCacheOriginsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsEdgeCacheOriginsTestIamPermissionsCall {
6326 c.ctx_ = ctx
6327 return c
6328 }
6329
6330 // Header returns a http.Header that can be modified by the caller to add
6331 // headers to the request.
6332 func (c *ProjectsLocationsEdgeCacheOriginsTestIamPermissionsCall) Header() http.Header {
6333 if c.header_ == nil {
6334 c.header_ = make(http.Header)
6335 }
6336 return c.header_
6337 }
6338
6339 func (c *ProjectsLocationsEdgeCacheOriginsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
6340 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6341 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest)
6342 if err != nil {
6343 return nil, err
6344 }
6345 c.urlParams_.Set("alt", alt)
6346 c.urlParams_.Set("prettyPrint", "false")
6347 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
6348 urls += "?" + c.urlParams_.Encode()
6349 req, err := http.NewRequest("POST", urls, body)
6350 if err != nil {
6351 return nil, err
6352 }
6353 req.Header = reqHeaders
6354 googleapi.Expand(req.URL, map[string]string{
6355 "resource": c.resource,
6356 })
6357 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.edgeCacheOrigins.testIamPermissions", "request", internallog.HTTPRequest(req, body.Bytes()))
6358 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6359 }
6360
6361 // Do executes the "networkservices.projects.locations.edgeCacheOrigins.testIamPermissions" call.
6362 // Any non-2xx status code is an error. Response headers are in either
6363 // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
6364 // returned at all) in error.(*googleapi.Error).Header. Use
6365 // googleapi.IsNotModified to check whether the returned error was because
6366 // http.StatusNotModified was returned.
6367 func (c *ProjectsLocationsEdgeCacheOriginsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
6368 gensupport.SetOptions(c.urlParams_, opts...)
6369 res, err := c.doRequest("json")
6370 if res != nil && res.StatusCode == http.StatusNotModified {
6371 if res.Body != nil {
6372 res.Body.Close()
6373 }
6374 return nil, gensupport.WrapError(&googleapi.Error{
6375 Code: res.StatusCode,
6376 Header: res.Header,
6377 })
6378 }
6379 if err != nil {
6380 return nil, err
6381 }
6382 defer googleapi.CloseBody(res)
6383 if err := googleapi.CheckResponse(res); err != nil {
6384 return nil, gensupport.WrapError(err)
6385 }
6386 ret := &TestIamPermissionsResponse{
6387 ServerResponse: googleapi.ServerResponse{
6388 Header: res.Header,
6389 HTTPStatusCode: res.StatusCode,
6390 },
6391 }
6392 target := &ret
6393 b, err := gensupport.DecodeResponseBytes(target, res)
6394 if err != nil {
6395 return nil, err
6396 }
6397 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.edgeCacheOrigins.testIamPermissions", "response", internallog.HTTPResponse(res, b))
6398 return ret, nil
6399 }
6400
6401 type ProjectsLocationsEdgeCacheServicesGetIamPolicyCall struct {
6402 s *Service
6403 resource string
6404 urlParams_ gensupport.URLParams
6405 ifNoneMatch_ string
6406 ctx_ context.Context
6407 header_ http.Header
6408 }
6409
6410 // GetIamPolicy: Gets the access control policy for a resource. Returns an
6411 // empty policy if the resource exists and does not have a policy set.
6412 //
6413 // - resource: REQUIRED: The resource for which the policy is being requested.
6414 // See Resource names (https://cloud.google.com/apis/design/resource_names)
6415 // for the appropriate value for this field.
6416 func (r *ProjectsLocationsEdgeCacheServicesService) GetIamPolicy(resource string) *ProjectsLocationsEdgeCacheServicesGetIamPolicyCall {
6417 c := &ProjectsLocationsEdgeCacheServicesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6418 c.resource = resource
6419 return c
6420 }
6421
6422 // OptionsRequestedPolicyVersion sets the optional parameter
6423 // "options.requestedPolicyVersion": The maximum policy version that will be
6424 // used to format the policy. Valid values are 0, 1, and 3. Requests specifying
6425 // an invalid value will be rejected. Requests for policies with any
6426 // conditional role bindings must specify version 3. Policies with no
6427 // conditional role bindings may specify any valid value or leave the field
6428 // unset. The policy in the response might use the policy version that you
6429 // specified, or it might use a lower policy version. For example, if you
6430 // specify version 3, but the policy has no conditional role bindings, the
6431 // response uses version 1. To learn which resources support conditions in
6432 // their IAM policies, see the IAM documentation
6433 // (https://cloud.google.com/iam/help/conditions/resource-policies).
6434 func (c *ProjectsLocationsEdgeCacheServicesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsEdgeCacheServicesGetIamPolicyCall {
6435 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
6436 return c
6437 }
6438
6439 // Fields allows partial responses to be retrieved. See
6440 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6441 // details.
6442 func (c *ProjectsLocationsEdgeCacheServicesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsEdgeCacheServicesGetIamPolicyCall {
6443 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6444 return c
6445 }
6446
6447 // IfNoneMatch sets an optional parameter which makes the operation fail if the
6448 // object's ETag matches the given value. This is useful for getting updates
6449 // only after the object has changed since the last request.
6450 func (c *ProjectsLocationsEdgeCacheServicesGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsEdgeCacheServicesGetIamPolicyCall {
6451 c.ifNoneMatch_ = entityTag
6452 return c
6453 }
6454
6455 // Context sets the context to be used in this call's Do method.
6456 func (c *ProjectsLocationsEdgeCacheServicesGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsEdgeCacheServicesGetIamPolicyCall {
6457 c.ctx_ = ctx
6458 return c
6459 }
6460
6461 // Header returns a http.Header that can be modified by the caller to add
6462 // headers to the request.
6463 func (c *ProjectsLocationsEdgeCacheServicesGetIamPolicyCall) Header() http.Header {
6464 if c.header_ == nil {
6465 c.header_ = make(http.Header)
6466 }
6467 return c.header_
6468 }
6469
6470 func (c *ProjectsLocationsEdgeCacheServicesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
6471 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6472 if c.ifNoneMatch_ != "" {
6473 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6474 }
6475 c.urlParams_.Set("alt", alt)
6476 c.urlParams_.Set("prettyPrint", "false")
6477 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
6478 urls += "?" + c.urlParams_.Encode()
6479 req, err := http.NewRequest("GET", urls, nil)
6480 if err != nil {
6481 return nil, err
6482 }
6483 req.Header = reqHeaders
6484 googleapi.Expand(req.URL, map[string]string{
6485 "resource": c.resource,
6486 })
6487 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.edgeCacheServices.getIamPolicy", "request", internallog.HTTPRequest(req, nil))
6488 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6489 }
6490
6491 // Do executes the "networkservices.projects.locations.edgeCacheServices.getIamPolicy" call.
6492 // Any non-2xx status code is an error. Response headers are in either
6493 // *Policy.ServerResponse.Header or (if a response was returned at all) in
6494 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6495 // whether the returned error was because http.StatusNotModified was returned.
6496 func (c *ProjectsLocationsEdgeCacheServicesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
6497 gensupport.SetOptions(c.urlParams_, opts...)
6498 res, err := c.doRequest("json")
6499 if res != nil && res.StatusCode == http.StatusNotModified {
6500 if res.Body != nil {
6501 res.Body.Close()
6502 }
6503 return nil, gensupport.WrapError(&googleapi.Error{
6504 Code: res.StatusCode,
6505 Header: res.Header,
6506 })
6507 }
6508 if err != nil {
6509 return nil, err
6510 }
6511 defer googleapi.CloseBody(res)
6512 if err := googleapi.CheckResponse(res); err != nil {
6513 return nil, gensupport.WrapError(err)
6514 }
6515 ret := &Policy{
6516 ServerResponse: googleapi.ServerResponse{
6517 Header: res.Header,
6518 HTTPStatusCode: res.StatusCode,
6519 },
6520 }
6521 target := &ret
6522 b, err := gensupport.DecodeResponseBytes(target, res)
6523 if err != nil {
6524 return nil, err
6525 }
6526 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.edgeCacheServices.getIamPolicy", "response", internallog.HTTPResponse(res, b))
6527 return ret, nil
6528 }
6529
6530 type ProjectsLocationsEdgeCacheServicesSetIamPolicyCall struct {
6531 s *Service
6532 resource string
6533 setiampolicyrequest *SetIamPolicyRequest
6534 urlParams_ gensupport.URLParams
6535 ctx_ context.Context
6536 header_ http.Header
6537 }
6538
6539 // SetIamPolicy: Sets the access control policy on the specified resource.
6540 // Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
6541 // and `PERMISSION_DENIED` errors.
6542 //
6543 // - resource: REQUIRED: The resource for which the policy is being specified.
6544 // See Resource names (https://cloud.google.com/apis/design/resource_names)
6545 // for the appropriate value for this field.
6546 func (r *ProjectsLocationsEdgeCacheServicesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsEdgeCacheServicesSetIamPolicyCall {
6547 c := &ProjectsLocationsEdgeCacheServicesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6548 c.resource = resource
6549 c.setiampolicyrequest = setiampolicyrequest
6550 return c
6551 }
6552
6553 // Fields allows partial responses to be retrieved. See
6554 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6555 // details.
6556 func (c *ProjectsLocationsEdgeCacheServicesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsEdgeCacheServicesSetIamPolicyCall {
6557 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6558 return c
6559 }
6560
6561 // Context sets the context to be used in this call's Do method.
6562 func (c *ProjectsLocationsEdgeCacheServicesSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsEdgeCacheServicesSetIamPolicyCall {
6563 c.ctx_ = ctx
6564 return c
6565 }
6566
6567 // Header returns a http.Header that can be modified by the caller to add
6568 // headers to the request.
6569 func (c *ProjectsLocationsEdgeCacheServicesSetIamPolicyCall) Header() http.Header {
6570 if c.header_ == nil {
6571 c.header_ = make(http.Header)
6572 }
6573 return c.header_
6574 }
6575
6576 func (c *ProjectsLocationsEdgeCacheServicesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
6577 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6578 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest)
6579 if err != nil {
6580 return nil, err
6581 }
6582 c.urlParams_.Set("alt", alt)
6583 c.urlParams_.Set("prettyPrint", "false")
6584 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
6585 urls += "?" + c.urlParams_.Encode()
6586 req, err := http.NewRequest("POST", urls, body)
6587 if err != nil {
6588 return nil, err
6589 }
6590 req.Header = reqHeaders
6591 googleapi.Expand(req.URL, map[string]string{
6592 "resource": c.resource,
6593 })
6594 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.edgeCacheServices.setIamPolicy", "request", internallog.HTTPRequest(req, body.Bytes()))
6595 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6596 }
6597
6598 // Do executes the "networkservices.projects.locations.edgeCacheServices.setIamPolicy" call.
6599 // Any non-2xx status code is an error. Response headers are in either
6600 // *Policy.ServerResponse.Header or (if a response was returned at all) in
6601 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6602 // whether the returned error was because http.StatusNotModified was returned.
6603 func (c *ProjectsLocationsEdgeCacheServicesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
6604 gensupport.SetOptions(c.urlParams_, opts...)
6605 res, err := c.doRequest("json")
6606 if res != nil && res.StatusCode == http.StatusNotModified {
6607 if res.Body != nil {
6608 res.Body.Close()
6609 }
6610 return nil, gensupport.WrapError(&googleapi.Error{
6611 Code: res.StatusCode,
6612 Header: res.Header,
6613 })
6614 }
6615 if err != nil {
6616 return nil, err
6617 }
6618 defer googleapi.CloseBody(res)
6619 if err := googleapi.CheckResponse(res); err != nil {
6620 return nil, gensupport.WrapError(err)
6621 }
6622 ret := &Policy{
6623 ServerResponse: googleapi.ServerResponse{
6624 Header: res.Header,
6625 HTTPStatusCode: res.StatusCode,
6626 },
6627 }
6628 target := &ret
6629 b, err := gensupport.DecodeResponseBytes(target, res)
6630 if err != nil {
6631 return nil, err
6632 }
6633 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.edgeCacheServices.setIamPolicy", "response", internallog.HTTPResponse(res, b))
6634 return ret, nil
6635 }
6636
6637 type ProjectsLocationsEdgeCacheServicesTestIamPermissionsCall struct {
6638 s *Service
6639 resource string
6640 testiampermissionsrequest *TestIamPermissionsRequest
6641 urlParams_ gensupport.URLParams
6642 ctx_ context.Context
6643 header_ http.Header
6644 }
6645
6646 // TestIamPermissions: Returns permissions that a caller has on the specified
6647 // resource. If the resource does not exist, this will return an empty set of
6648 // permissions, not a `NOT_FOUND` error. Note: This operation is designed to be
6649 // used for building permission-aware UIs and command-line tools, not for
6650 // authorization checking. This operation may "fail open" without warning.
6651 //
6652 // - resource: REQUIRED: The resource for which the policy detail is being
6653 // requested. See Resource names
6654 // (https://cloud.google.com/apis/design/resource_names) for the appropriate
6655 // value for this field.
6656 func (r *ProjectsLocationsEdgeCacheServicesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsEdgeCacheServicesTestIamPermissionsCall {
6657 c := &ProjectsLocationsEdgeCacheServicesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6658 c.resource = resource
6659 c.testiampermissionsrequest = testiampermissionsrequest
6660 return c
6661 }
6662
6663 // Fields allows partial responses to be retrieved. See
6664 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6665 // details.
6666 func (c *ProjectsLocationsEdgeCacheServicesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsEdgeCacheServicesTestIamPermissionsCall {
6667 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6668 return c
6669 }
6670
6671 // Context sets the context to be used in this call's Do method.
6672 func (c *ProjectsLocationsEdgeCacheServicesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsEdgeCacheServicesTestIamPermissionsCall {
6673 c.ctx_ = ctx
6674 return c
6675 }
6676
6677 // Header returns a http.Header that can be modified by the caller to add
6678 // headers to the request.
6679 func (c *ProjectsLocationsEdgeCacheServicesTestIamPermissionsCall) Header() http.Header {
6680 if c.header_ == nil {
6681 c.header_ = make(http.Header)
6682 }
6683 return c.header_
6684 }
6685
6686 func (c *ProjectsLocationsEdgeCacheServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
6687 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6688 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest)
6689 if err != nil {
6690 return nil, err
6691 }
6692 c.urlParams_.Set("alt", alt)
6693 c.urlParams_.Set("prettyPrint", "false")
6694 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
6695 urls += "?" + c.urlParams_.Encode()
6696 req, err := http.NewRequest("POST", urls, body)
6697 if err != nil {
6698 return nil, err
6699 }
6700 req.Header = reqHeaders
6701 googleapi.Expand(req.URL, map[string]string{
6702 "resource": c.resource,
6703 })
6704 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.edgeCacheServices.testIamPermissions", "request", internallog.HTTPRequest(req, body.Bytes()))
6705 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6706 }
6707
6708 // Do executes the "networkservices.projects.locations.edgeCacheServices.testIamPermissions" call.
6709 // Any non-2xx status code is an error. Response headers are in either
6710 // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
6711 // returned at all) in error.(*googleapi.Error).Header. Use
6712 // googleapi.IsNotModified to check whether the returned error was because
6713 // http.StatusNotModified was returned.
6714 func (c *ProjectsLocationsEdgeCacheServicesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
6715 gensupport.SetOptions(c.urlParams_, opts...)
6716 res, err := c.doRequest("json")
6717 if res != nil && res.StatusCode == http.StatusNotModified {
6718 if res.Body != nil {
6719 res.Body.Close()
6720 }
6721 return nil, gensupport.WrapError(&googleapi.Error{
6722 Code: res.StatusCode,
6723 Header: res.Header,
6724 })
6725 }
6726 if err != nil {
6727 return nil, err
6728 }
6729 defer googleapi.CloseBody(res)
6730 if err := googleapi.CheckResponse(res); err != nil {
6731 return nil, gensupport.WrapError(err)
6732 }
6733 ret := &TestIamPermissionsResponse{
6734 ServerResponse: googleapi.ServerResponse{
6735 Header: res.Header,
6736 HTTPStatusCode: res.StatusCode,
6737 },
6738 }
6739 target := &ret
6740 b, err := gensupport.DecodeResponseBytes(target, res)
6741 if err != nil {
6742 return nil, err
6743 }
6744 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.edgeCacheServices.testIamPermissions", "response", internallog.HTTPResponse(res, b))
6745 return ret, nil
6746 }
6747
6748 type ProjectsLocationsEndpointPoliciesCreateCall struct {
6749 s *Service
6750 parent string
6751 endpointpolicy *EndpointPolicy
6752 urlParams_ gensupport.URLParams
6753 ctx_ context.Context
6754 header_ http.Header
6755 }
6756
6757 // Create: Creates a new EndpointPolicy in a given project and location.
6758 //
6759 // - parent: The parent resource of the EndpointPolicy. Must be in the format
6760 // `projects/*/locations/*`.
6761 func (r *ProjectsLocationsEndpointPoliciesService) Create(parent string, endpointpolicy *EndpointPolicy) *ProjectsLocationsEndpointPoliciesCreateCall {
6762 c := &ProjectsLocationsEndpointPoliciesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6763 c.parent = parent
6764 c.endpointpolicy = endpointpolicy
6765 return c
6766 }
6767
6768 // EndpointPolicyId sets the optional parameter "endpointPolicyId": Required.
6769 // Short name of the EndpointPolicy resource to be created. E.g. "CustomECS".
6770 func (c *ProjectsLocationsEndpointPoliciesCreateCall) EndpointPolicyId(endpointPolicyId string) *ProjectsLocationsEndpointPoliciesCreateCall {
6771 c.urlParams_.Set("endpointPolicyId", endpointPolicyId)
6772 return c
6773 }
6774
6775 // Fields allows partial responses to be retrieved. See
6776 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6777 // details.
6778 func (c *ProjectsLocationsEndpointPoliciesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsEndpointPoliciesCreateCall {
6779 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6780 return c
6781 }
6782
6783 // Context sets the context to be used in this call's Do method.
6784 func (c *ProjectsLocationsEndpointPoliciesCreateCall) Context(ctx context.Context) *ProjectsLocationsEndpointPoliciesCreateCall {
6785 c.ctx_ = ctx
6786 return c
6787 }
6788
6789 // Header returns a http.Header that can be modified by the caller to add
6790 // headers to the request.
6791 func (c *ProjectsLocationsEndpointPoliciesCreateCall) Header() http.Header {
6792 if c.header_ == nil {
6793 c.header_ = make(http.Header)
6794 }
6795 return c.header_
6796 }
6797
6798 func (c *ProjectsLocationsEndpointPoliciesCreateCall) doRequest(alt string) (*http.Response, error) {
6799 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6800 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.endpointpolicy)
6801 if err != nil {
6802 return nil, err
6803 }
6804 c.urlParams_.Set("alt", alt)
6805 c.urlParams_.Set("prettyPrint", "false")
6806 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/endpointPolicies")
6807 urls += "?" + c.urlParams_.Encode()
6808 req, err := http.NewRequest("POST", urls, body)
6809 if err != nil {
6810 return nil, err
6811 }
6812 req.Header = reqHeaders
6813 googleapi.Expand(req.URL, map[string]string{
6814 "parent": c.parent,
6815 })
6816 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.endpointPolicies.create", "request", internallog.HTTPRequest(req, body.Bytes()))
6817 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6818 }
6819
6820 // Do executes the "networkservices.projects.locations.endpointPolicies.create" call.
6821 // Any non-2xx status code is an error. Response headers are in either
6822 // *Operation.ServerResponse.Header or (if a response was returned at all) in
6823 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6824 // whether the returned error was because http.StatusNotModified was returned.
6825 func (c *ProjectsLocationsEndpointPoliciesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
6826 gensupport.SetOptions(c.urlParams_, opts...)
6827 res, err := c.doRequest("json")
6828 if res != nil && res.StatusCode == http.StatusNotModified {
6829 if res.Body != nil {
6830 res.Body.Close()
6831 }
6832 return nil, gensupport.WrapError(&googleapi.Error{
6833 Code: res.StatusCode,
6834 Header: res.Header,
6835 })
6836 }
6837 if err != nil {
6838 return nil, err
6839 }
6840 defer googleapi.CloseBody(res)
6841 if err := googleapi.CheckResponse(res); err != nil {
6842 return nil, gensupport.WrapError(err)
6843 }
6844 ret := &Operation{
6845 ServerResponse: googleapi.ServerResponse{
6846 Header: res.Header,
6847 HTTPStatusCode: res.StatusCode,
6848 },
6849 }
6850 target := &ret
6851 b, err := gensupport.DecodeResponseBytes(target, res)
6852 if err != nil {
6853 return nil, err
6854 }
6855 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.endpointPolicies.create", "response", internallog.HTTPResponse(res, b))
6856 return ret, nil
6857 }
6858
6859 type ProjectsLocationsEndpointPoliciesDeleteCall struct {
6860 s *Service
6861 name string
6862 urlParams_ gensupport.URLParams
6863 ctx_ context.Context
6864 header_ http.Header
6865 }
6866
6867 // Delete: Deletes a single EndpointPolicy.
6868 //
6869 // - name: A name of the EndpointPolicy to delete. Must be in the format
6870 // `projects/*/locations/*/endpointPolicies/*`.
6871 func (r *ProjectsLocationsEndpointPoliciesService) Delete(name string) *ProjectsLocationsEndpointPoliciesDeleteCall {
6872 c := &ProjectsLocationsEndpointPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6873 c.name = name
6874 return c
6875 }
6876
6877 // Fields allows partial responses to be retrieved. See
6878 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6879 // details.
6880 func (c *ProjectsLocationsEndpointPoliciesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsEndpointPoliciesDeleteCall {
6881 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6882 return c
6883 }
6884
6885 // Context sets the context to be used in this call's Do method.
6886 func (c *ProjectsLocationsEndpointPoliciesDeleteCall) Context(ctx context.Context) *ProjectsLocationsEndpointPoliciesDeleteCall {
6887 c.ctx_ = ctx
6888 return c
6889 }
6890
6891 // Header returns a http.Header that can be modified by the caller to add
6892 // headers to the request.
6893 func (c *ProjectsLocationsEndpointPoliciesDeleteCall) Header() http.Header {
6894 if c.header_ == nil {
6895 c.header_ = make(http.Header)
6896 }
6897 return c.header_
6898 }
6899
6900 func (c *ProjectsLocationsEndpointPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
6901 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6902 c.urlParams_.Set("alt", alt)
6903 c.urlParams_.Set("prettyPrint", "false")
6904 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
6905 urls += "?" + c.urlParams_.Encode()
6906 req, err := http.NewRequest("DELETE", urls, nil)
6907 if err != nil {
6908 return nil, err
6909 }
6910 req.Header = reqHeaders
6911 googleapi.Expand(req.URL, map[string]string{
6912 "name": c.name,
6913 })
6914 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.endpointPolicies.delete", "request", internallog.HTTPRequest(req, nil))
6915 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6916 }
6917
6918 // Do executes the "networkservices.projects.locations.endpointPolicies.delete" call.
6919 // Any non-2xx status code is an error. Response headers are in either
6920 // *Operation.ServerResponse.Header or (if a response was returned at all) in
6921 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6922 // whether the returned error was because http.StatusNotModified was returned.
6923 func (c *ProjectsLocationsEndpointPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
6924 gensupport.SetOptions(c.urlParams_, opts...)
6925 res, err := c.doRequest("json")
6926 if res != nil && res.StatusCode == http.StatusNotModified {
6927 if res.Body != nil {
6928 res.Body.Close()
6929 }
6930 return nil, gensupport.WrapError(&googleapi.Error{
6931 Code: res.StatusCode,
6932 Header: res.Header,
6933 })
6934 }
6935 if err != nil {
6936 return nil, err
6937 }
6938 defer googleapi.CloseBody(res)
6939 if err := googleapi.CheckResponse(res); err != nil {
6940 return nil, gensupport.WrapError(err)
6941 }
6942 ret := &Operation{
6943 ServerResponse: googleapi.ServerResponse{
6944 Header: res.Header,
6945 HTTPStatusCode: res.StatusCode,
6946 },
6947 }
6948 target := &ret
6949 b, err := gensupport.DecodeResponseBytes(target, res)
6950 if err != nil {
6951 return nil, err
6952 }
6953 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.endpointPolicies.delete", "response", internallog.HTTPResponse(res, b))
6954 return ret, nil
6955 }
6956
6957 type ProjectsLocationsEndpointPoliciesGetCall struct {
6958 s *Service
6959 name string
6960 urlParams_ gensupport.URLParams
6961 ifNoneMatch_ string
6962 ctx_ context.Context
6963 header_ http.Header
6964 }
6965
6966 // Get: Gets details of a single EndpointPolicy.
6967 //
6968 // - name: A name of the EndpointPolicy to get. Must be in the format
6969 // `projects/*/locations/*/endpointPolicies/*`.
6970 func (r *ProjectsLocationsEndpointPoliciesService) Get(name string) *ProjectsLocationsEndpointPoliciesGetCall {
6971 c := &ProjectsLocationsEndpointPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6972 c.name = name
6973 return c
6974 }
6975
6976 // Fields allows partial responses to be retrieved. See
6977 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6978 // details.
6979 func (c *ProjectsLocationsEndpointPoliciesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsEndpointPoliciesGetCall {
6980 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6981 return c
6982 }
6983
6984 // IfNoneMatch sets an optional parameter which makes the operation fail if the
6985 // object's ETag matches the given value. This is useful for getting updates
6986 // only after the object has changed since the last request.
6987 func (c *ProjectsLocationsEndpointPoliciesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsEndpointPoliciesGetCall {
6988 c.ifNoneMatch_ = entityTag
6989 return c
6990 }
6991
6992 // Context sets the context to be used in this call's Do method.
6993 func (c *ProjectsLocationsEndpointPoliciesGetCall) Context(ctx context.Context) *ProjectsLocationsEndpointPoliciesGetCall {
6994 c.ctx_ = ctx
6995 return c
6996 }
6997
6998 // Header returns a http.Header that can be modified by the caller to add
6999 // headers to the request.
7000 func (c *ProjectsLocationsEndpointPoliciesGetCall) Header() http.Header {
7001 if c.header_ == nil {
7002 c.header_ = make(http.Header)
7003 }
7004 return c.header_
7005 }
7006
7007 func (c *ProjectsLocationsEndpointPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
7008 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7009 if c.ifNoneMatch_ != "" {
7010 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7011 }
7012 c.urlParams_.Set("alt", alt)
7013 c.urlParams_.Set("prettyPrint", "false")
7014 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
7015 urls += "?" + c.urlParams_.Encode()
7016 req, err := http.NewRequest("GET", urls, nil)
7017 if err != nil {
7018 return nil, err
7019 }
7020 req.Header = reqHeaders
7021 googleapi.Expand(req.URL, map[string]string{
7022 "name": c.name,
7023 })
7024 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.endpointPolicies.get", "request", internallog.HTTPRequest(req, nil))
7025 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7026 }
7027
7028 // Do executes the "networkservices.projects.locations.endpointPolicies.get" call.
7029 // Any non-2xx status code is an error. Response headers are in either
7030 // *EndpointPolicy.ServerResponse.Header or (if a response was returned at all)
7031 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7032 // whether the returned error was because http.StatusNotModified was returned.
7033 func (c *ProjectsLocationsEndpointPoliciesGetCall) Do(opts ...googleapi.CallOption) (*EndpointPolicy, error) {
7034 gensupport.SetOptions(c.urlParams_, opts...)
7035 res, err := c.doRequest("json")
7036 if res != nil && res.StatusCode == http.StatusNotModified {
7037 if res.Body != nil {
7038 res.Body.Close()
7039 }
7040 return nil, gensupport.WrapError(&googleapi.Error{
7041 Code: res.StatusCode,
7042 Header: res.Header,
7043 })
7044 }
7045 if err != nil {
7046 return nil, err
7047 }
7048 defer googleapi.CloseBody(res)
7049 if err := googleapi.CheckResponse(res); err != nil {
7050 return nil, gensupport.WrapError(err)
7051 }
7052 ret := &EndpointPolicy{
7053 ServerResponse: googleapi.ServerResponse{
7054 Header: res.Header,
7055 HTTPStatusCode: res.StatusCode,
7056 },
7057 }
7058 target := &ret
7059 b, err := gensupport.DecodeResponseBytes(target, res)
7060 if err != nil {
7061 return nil, err
7062 }
7063 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.endpointPolicies.get", "response", internallog.HTTPResponse(res, b))
7064 return ret, nil
7065 }
7066
7067 type ProjectsLocationsEndpointPoliciesListCall struct {
7068 s *Service
7069 parent string
7070 urlParams_ gensupport.URLParams
7071 ifNoneMatch_ string
7072 ctx_ context.Context
7073 header_ http.Header
7074 }
7075
7076 // List: Lists EndpointPolicies in a given project and location.
7077 //
7078 // - parent: The project and location from which the EndpointPolicies should be
7079 // listed, specified in the format `projects/*/locations/*`.
7080 func (r *ProjectsLocationsEndpointPoliciesService) List(parent string) *ProjectsLocationsEndpointPoliciesListCall {
7081 c := &ProjectsLocationsEndpointPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7082 c.parent = parent
7083 return c
7084 }
7085
7086 // PageSize sets the optional parameter "pageSize": Maximum number of
7087 // EndpointPolicies to return per call.
7088 func (c *ProjectsLocationsEndpointPoliciesListCall) PageSize(pageSize int64) *ProjectsLocationsEndpointPoliciesListCall {
7089 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
7090 return c
7091 }
7092
7093 // PageToken sets the optional parameter "pageToken": The value returned by the
7094 // last `ListEndpointPoliciesResponse` Indicates that this is a continuation of
7095 // a prior `ListEndpointPolicies` call, and that the system should return the
7096 // next page of data.
7097 func (c *ProjectsLocationsEndpointPoliciesListCall) PageToken(pageToken string) *ProjectsLocationsEndpointPoliciesListCall {
7098 c.urlParams_.Set("pageToken", pageToken)
7099 return c
7100 }
7101
7102 // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": If
7103 // true, allow partial responses for multi-regional Aggregated List requests.
7104 // Otherwise if one of the locations is down or unreachable, the Aggregated
7105 // List request will fail.
7106 func (c *ProjectsLocationsEndpointPoliciesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ProjectsLocationsEndpointPoliciesListCall {
7107 c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
7108 return c
7109 }
7110
7111 // Fields allows partial responses to be retrieved. See
7112 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7113 // details.
7114 func (c *ProjectsLocationsEndpointPoliciesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsEndpointPoliciesListCall {
7115 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7116 return c
7117 }
7118
7119 // IfNoneMatch sets an optional parameter which makes the operation fail if the
7120 // object's ETag matches the given value. This is useful for getting updates
7121 // only after the object has changed since the last request.
7122 func (c *ProjectsLocationsEndpointPoliciesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsEndpointPoliciesListCall {
7123 c.ifNoneMatch_ = entityTag
7124 return c
7125 }
7126
7127 // Context sets the context to be used in this call's Do method.
7128 func (c *ProjectsLocationsEndpointPoliciesListCall) Context(ctx context.Context) *ProjectsLocationsEndpointPoliciesListCall {
7129 c.ctx_ = ctx
7130 return c
7131 }
7132
7133 // Header returns a http.Header that can be modified by the caller to add
7134 // headers to the request.
7135 func (c *ProjectsLocationsEndpointPoliciesListCall) Header() http.Header {
7136 if c.header_ == nil {
7137 c.header_ = make(http.Header)
7138 }
7139 return c.header_
7140 }
7141
7142 func (c *ProjectsLocationsEndpointPoliciesListCall) doRequest(alt string) (*http.Response, error) {
7143 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7144 if c.ifNoneMatch_ != "" {
7145 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7146 }
7147 c.urlParams_.Set("alt", alt)
7148 c.urlParams_.Set("prettyPrint", "false")
7149 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/endpointPolicies")
7150 urls += "?" + c.urlParams_.Encode()
7151 req, err := http.NewRequest("GET", urls, nil)
7152 if err != nil {
7153 return nil, err
7154 }
7155 req.Header = reqHeaders
7156 googleapi.Expand(req.URL, map[string]string{
7157 "parent": c.parent,
7158 })
7159 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.endpointPolicies.list", "request", internallog.HTTPRequest(req, nil))
7160 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7161 }
7162
7163 // Do executes the "networkservices.projects.locations.endpointPolicies.list" call.
7164 // Any non-2xx status code is an error. Response headers are in either
7165 // *ListEndpointPoliciesResponse.ServerResponse.Header or (if a response was
7166 // returned at all) in error.(*googleapi.Error).Header. Use
7167 // googleapi.IsNotModified to check whether the returned error was because
7168 // http.StatusNotModified was returned.
7169 func (c *ProjectsLocationsEndpointPoliciesListCall) Do(opts ...googleapi.CallOption) (*ListEndpointPoliciesResponse, error) {
7170 gensupport.SetOptions(c.urlParams_, opts...)
7171 res, err := c.doRequest("json")
7172 if res != nil && res.StatusCode == http.StatusNotModified {
7173 if res.Body != nil {
7174 res.Body.Close()
7175 }
7176 return nil, gensupport.WrapError(&googleapi.Error{
7177 Code: res.StatusCode,
7178 Header: res.Header,
7179 })
7180 }
7181 if err != nil {
7182 return nil, err
7183 }
7184 defer googleapi.CloseBody(res)
7185 if err := googleapi.CheckResponse(res); err != nil {
7186 return nil, gensupport.WrapError(err)
7187 }
7188 ret := &ListEndpointPoliciesResponse{
7189 ServerResponse: googleapi.ServerResponse{
7190 Header: res.Header,
7191 HTTPStatusCode: res.StatusCode,
7192 },
7193 }
7194 target := &ret
7195 b, err := gensupport.DecodeResponseBytes(target, res)
7196 if err != nil {
7197 return nil, err
7198 }
7199 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.endpointPolicies.list", "response", internallog.HTTPResponse(res, b))
7200 return ret, nil
7201 }
7202
7203 // Pages invokes f for each page of results.
7204 // A non-nil error returned from f will halt the iteration.
7205 // The provided context supersedes any context provided to the Context method.
7206 func (c *ProjectsLocationsEndpointPoliciesListCall) Pages(ctx context.Context, f func(*ListEndpointPoliciesResponse) error) error {
7207 c.ctx_ = ctx
7208 defer c.PageToken(c.urlParams_.Get("pageToken"))
7209 for {
7210 x, err := c.Do()
7211 if err != nil {
7212 return err
7213 }
7214 if err := f(x); err != nil {
7215 return err
7216 }
7217 if x.NextPageToken == "" {
7218 return nil
7219 }
7220 c.PageToken(x.NextPageToken)
7221 }
7222 }
7223
7224 type ProjectsLocationsEndpointPoliciesPatchCall struct {
7225 s *Service
7226 name string
7227 endpointpolicy *EndpointPolicy
7228 urlParams_ gensupport.URLParams
7229 ctx_ context.Context
7230 header_ http.Header
7231 }
7232
7233 // Patch: Updates the parameters of a single EndpointPolicy.
7234 //
7235 // - name: Identifier. Name of the EndpointPolicy resource. It matches pattern
7236 // `projects/{project}/locations/*/endpointPolicies/{endpoint_policy}`.
7237 func (r *ProjectsLocationsEndpointPoliciesService) Patch(name string, endpointpolicy *EndpointPolicy) *ProjectsLocationsEndpointPoliciesPatchCall {
7238 c := &ProjectsLocationsEndpointPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7239 c.name = name
7240 c.endpointpolicy = endpointpolicy
7241 return c
7242 }
7243
7244 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
7245 // specify the fields to be overwritten in the EndpointPolicy resource by the
7246 // update. The fields specified in the update_mask are relative to the
7247 // resource, not the full request. A field will be overwritten if it is in the
7248 // mask. If the user does not provide a mask then all fields will be
7249 // overwritten.
7250 func (c *ProjectsLocationsEndpointPoliciesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsEndpointPoliciesPatchCall {
7251 c.urlParams_.Set("updateMask", updateMask)
7252 return c
7253 }
7254
7255 // Fields allows partial responses to be retrieved. See
7256 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7257 // details.
7258 func (c *ProjectsLocationsEndpointPoliciesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsEndpointPoliciesPatchCall {
7259 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7260 return c
7261 }
7262
7263 // Context sets the context to be used in this call's Do method.
7264 func (c *ProjectsLocationsEndpointPoliciesPatchCall) Context(ctx context.Context) *ProjectsLocationsEndpointPoliciesPatchCall {
7265 c.ctx_ = ctx
7266 return c
7267 }
7268
7269 // Header returns a http.Header that can be modified by the caller to add
7270 // headers to the request.
7271 func (c *ProjectsLocationsEndpointPoliciesPatchCall) Header() http.Header {
7272 if c.header_ == nil {
7273 c.header_ = make(http.Header)
7274 }
7275 return c.header_
7276 }
7277
7278 func (c *ProjectsLocationsEndpointPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
7279 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7280 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.endpointpolicy)
7281 if err != nil {
7282 return nil, err
7283 }
7284 c.urlParams_.Set("alt", alt)
7285 c.urlParams_.Set("prettyPrint", "false")
7286 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
7287 urls += "?" + c.urlParams_.Encode()
7288 req, err := http.NewRequest("PATCH", urls, body)
7289 if err != nil {
7290 return nil, err
7291 }
7292 req.Header = reqHeaders
7293 googleapi.Expand(req.URL, map[string]string{
7294 "name": c.name,
7295 })
7296 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.endpointPolicies.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
7297 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7298 }
7299
7300 // Do executes the "networkservices.projects.locations.endpointPolicies.patch" call.
7301 // Any non-2xx status code is an error. Response headers are in either
7302 // *Operation.ServerResponse.Header or (if a response was returned at all) in
7303 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7304 // whether the returned error was because http.StatusNotModified was returned.
7305 func (c *ProjectsLocationsEndpointPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
7306 gensupport.SetOptions(c.urlParams_, opts...)
7307 res, err := c.doRequest("json")
7308 if res != nil && res.StatusCode == http.StatusNotModified {
7309 if res.Body != nil {
7310 res.Body.Close()
7311 }
7312 return nil, gensupport.WrapError(&googleapi.Error{
7313 Code: res.StatusCode,
7314 Header: res.Header,
7315 })
7316 }
7317 if err != nil {
7318 return nil, err
7319 }
7320 defer googleapi.CloseBody(res)
7321 if err := googleapi.CheckResponse(res); err != nil {
7322 return nil, gensupport.WrapError(err)
7323 }
7324 ret := &Operation{
7325 ServerResponse: googleapi.ServerResponse{
7326 Header: res.Header,
7327 HTTPStatusCode: res.StatusCode,
7328 },
7329 }
7330 target := &ret
7331 b, err := gensupport.DecodeResponseBytes(target, res)
7332 if err != nil {
7333 return nil, err
7334 }
7335 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.endpointPolicies.patch", "response", internallog.HTTPResponse(res, b))
7336 return ret, nil
7337 }
7338
7339 type ProjectsLocationsGatewaysCreateCall struct {
7340 s *Service
7341 parent string
7342 gateway *Gateway
7343 urlParams_ gensupport.URLParams
7344 ctx_ context.Context
7345 header_ http.Header
7346 }
7347
7348 // Create: Creates a new Gateway in a given project and location.
7349 //
7350 // - parent: The parent resource of the Gateway. Must be in the format
7351 // `projects/*/locations/*`.
7352 func (r *ProjectsLocationsGatewaysService) Create(parent string, gateway *Gateway) *ProjectsLocationsGatewaysCreateCall {
7353 c := &ProjectsLocationsGatewaysCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7354 c.parent = parent
7355 c.gateway = gateway
7356 return c
7357 }
7358
7359 // GatewayId sets the optional parameter "gatewayId": Required. Short name of
7360 // the Gateway resource to be created.
7361 func (c *ProjectsLocationsGatewaysCreateCall) GatewayId(gatewayId string) *ProjectsLocationsGatewaysCreateCall {
7362 c.urlParams_.Set("gatewayId", gatewayId)
7363 return c
7364 }
7365
7366 // Fields allows partial responses to be retrieved. See
7367 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7368 // details.
7369 func (c *ProjectsLocationsGatewaysCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsGatewaysCreateCall {
7370 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7371 return c
7372 }
7373
7374 // Context sets the context to be used in this call's Do method.
7375 func (c *ProjectsLocationsGatewaysCreateCall) Context(ctx context.Context) *ProjectsLocationsGatewaysCreateCall {
7376 c.ctx_ = ctx
7377 return c
7378 }
7379
7380 // Header returns a http.Header that can be modified by the caller to add
7381 // headers to the request.
7382 func (c *ProjectsLocationsGatewaysCreateCall) Header() http.Header {
7383 if c.header_ == nil {
7384 c.header_ = make(http.Header)
7385 }
7386 return c.header_
7387 }
7388
7389 func (c *ProjectsLocationsGatewaysCreateCall) doRequest(alt string) (*http.Response, error) {
7390 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7391 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.gateway)
7392 if err != nil {
7393 return nil, err
7394 }
7395 c.urlParams_.Set("alt", alt)
7396 c.urlParams_.Set("prettyPrint", "false")
7397 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/gateways")
7398 urls += "?" + c.urlParams_.Encode()
7399 req, err := http.NewRequest("POST", urls, body)
7400 if err != nil {
7401 return nil, err
7402 }
7403 req.Header = reqHeaders
7404 googleapi.Expand(req.URL, map[string]string{
7405 "parent": c.parent,
7406 })
7407 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.create", "request", internallog.HTTPRequest(req, body.Bytes()))
7408 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7409 }
7410
7411 // Do executes the "networkservices.projects.locations.gateways.create" call.
7412 // Any non-2xx status code is an error. Response headers are in either
7413 // *Operation.ServerResponse.Header or (if a response was returned at all) in
7414 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7415 // whether the returned error was because http.StatusNotModified was returned.
7416 func (c *ProjectsLocationsGatewaysCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
7417 gensupport.SetOptions(c.urlParams_, opts...)
7418 res, err := c.doRequest("json")
7419 if res != nil && res.StatusCode == http.StatusNotModified {
7420 if res.Body != nil {
7421 res.Body.Close()
7422 }
7423 return nil, gensupport.WrapError(&googleapi.Error{
7424 Code: res.StatusCode,
7425 Header: res.Header,
7426 })
7427 }
7428 if err != nil {
7429 return nil, err
7430 }
7431 defer googleapi.CloseBody(res)
7432 if err := googleapi.CheckResponse(res); err != nil {
7433 return nil, gensupport.WrapError(err)
7434 }
7435 ret := &Operation{
7436 ServerResponse: googleapi.ServerResponse{
7437 Header: res.Header,
7438 HTTPStatusCode: res.StatusCode,
7439 },
7440 }
7441 target := &ret
7442 b, err := gensupport.DecodeResponseBytes(target, res)
7443 if err != nil {
7444 return nil, err
7445 }
7446 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.create", "response", internallog.HTTPResponse(res, b))
7447 return ret, nil
7448 }
7449
7450 type ProjectsLocationsGatewaysDeleteCall struct {
7451 s *Service
7452 name string
7453 urlParams_ gensupport.URLParams
7454 ctx_ context.Context
7455 header_ http.Header
7456 }
7457
7458 // Delete: Deletes a single Gateway.
7459 //
7460 // - name: A name of the Gateway to delete. Must be in the format
7461 // `projects/*/locations/*/gateways/*`.
7462 func (r *ProjectsLocationsGatewaysService) Delete(name string) *ProjectsLocationsGatewaysDeleteCall {
7463 c := &ProjectsLocationsGatewaysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7464 c.name = name
7465 return c
7466 }
7467
7468 // Fields allows partial responses to be retrieved. See
7469 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7470 // details.
7471 func (c *ProjectsLocationsGatewaysDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsGatewaysDeleteCall {
7472 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7473 return c
7474 }
7475
7476 // Context sets the context to be used in this call's Do method.
7477 func (c *ProjectsLocationsGatewaysDeleteCall) Context(ctx context.Context) *ProjectsLocationsGatewaysDeleteCall {
7478 c.ctx_ = ctx
7479 return c
7480 }
7481
7482 // Header returns a http.Header that can be modified by the caller to add
7483 // headers to the request.
7484 func (c *ProjectsLocationsGatewaysDeleteCall) Header() http.Header {
7485 if c.header_ == nil {
7486 c.header_ = make(http.Header)
7487 }
7488 return c.header_
7489 }
7490
7491 func (c *ProjectsLocationsGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) {
7492 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7493 c.urlParams_.Set("alt", alt)
7494 c.urlParams_.Set("prettyPrint", "false")
7495 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
7496 urls += "?" + c.urlParams_.Encode()
7497 req, err := http.NewRequest("DELETE", urls, nil)
7498 if err != nil {
7499 return nil, err
7500 }
7501 req.Header = reqHeaders
7502 googleapi.Expand(req.URL, map[string]string{
7503 "name": c.name,
7504 })
7505 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.delete", "request", internallog.HTTPRequest(req, nil))
7506 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7507 }
7508
7509 // Do executes the "networkservices.projects.locations.gateways.delete" call.
7510 // Any non-2xx status code is an error. Response headers are in either
7511 // *Operation.ServerResponse.Header or (if a response was returned at all) in
7512 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7513 // whether the returned error was because http.StatusNotModified was returned.
7514 func (c *ProjectsLocationsGatewaysDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
7515 gensupport.SetOptions(c.urlParams_, opts...)
7516 res, err := c.doRequest("json")
7517 if res != nil && res.StatusCode == http.StatusNotModified {
7518 if res.Body != nil {
7519 res.Body.Close()
7520 }
7521 return nil, gensupport.WrapError(&googleapi.Error{
7522 Code: res.StatusCode,
7523 Header: res.Header,
7524 })
7525 }
7526 if err != nil {
7527 return nil, err
7528 }
7529 defer googleapi.CloseBody(res)
7530 if err := googleapi.CheckResponse(res); err != nil {
7531 return nil, gensupport.WrapError(err)
7532 }
7533 ret := &Operation{
7534 ServerResponse: googleapi.ServerResponse{
7535 Header: res.Header,
7536 HTTPStatusCode: res.StatusCode,
7537 },
7538 }
7539 target := &ret
7540 b, err := gensupport.DecodeResponseBytes(target, res)
7541 if err != nil {
7542 return nil, err
7543 }
7544 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.delete", "response", internallog.HTTPResponse(res, b))
7545 return ret, nil
7546 }
7547
7548 type ProjectsLocationsGatewaysGetCall struct {
7549 s *Service
7550 name string
7551 urlParams_ gensupport.URLParams
7552 ifNoneMatch_ string
7553 ctx_ context.Context
7554 header_ http.Header
7555 }
7556
7557 // Get: Gets details of a single Gateway.
7558 //
7559 // - name: A name of the Gateway to get. Must be in the format
7560 // `projects/*/locations/*/gateways/*`.
7561 func (r *ProjectsLocationsGatewaysService) Get(name string) *ProjectsLocationsGatewaysGetCall {
7562 c := &ProjectsLocationsGatewaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7563 c.name = name
7564 return c
7565 }
7566
7567 // Fields allows partial responses to be retrieved. See
7568 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7569 // details.
7570 func (c *ProjectsLocationsGatewaysGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGatewaysGetCall {
7571 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7572 return c
7573 }
7574
7575 // IfNoneMatch sets an optional parameter which makes the operation fail if the
7576 // object's ETag matches the given value. This is useful for getting updates
7577 // only after the object has changed since the last request.
7578 func (c *ProjectsLocationsGatewaysGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGatewaysGetCall {
7579 c.ifNoneMatch_ = entityTag
7580 return c
7581 }
7582
7583 // Context sets the context to be used in this call's Do method.
7584 func (c *ProjectsLocationsGatewaysGetCall) Context(ctx context.Context) *ProjectsLocationsGatewaysGetCall {
7585 c.ctx_ = ctx
7586 return c
7587 }
7588
7589 // Header returns a http.Header that can be modified by the caller to add
7590 // headers to the request.
7591 func (c *ProjectsLocationsGatewaysGetCall) Header() http.Header {
7592 if c.header_ == nil {
7593 c.header_ = make(http.Header)
7594 }
7595 return c.header_
7596 }
7597
7598 func (c *ProjectsLocationsGatewaysGetCall) doRequest(alt string) (*http.Response, error) {
7599 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7600 if c.ifNoneMatch_ != "" {
7601 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7602 }
7603 c.urlParams_.Set("alt", alt)
7604 c.urlParams_.Set("prettyPrint", "false")
7605 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
7606 urls += "?" + c.urlParams_.Encode()
7607 req, err := http.NewRequest("GET", urls, nil)
7608 if err != nil {
7609 return nil, err
7610 }
7611 req.Header = reqHeaders
7612 googleapi.Expand(req.URL, map[string]string{
7613 "name": c.name,
7614 })
7615 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.get", "request", internallog.HTTPRequest(req, nil))
7616 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7617 }
7618
7619 // Do executes the "networkservices.projects.locations.gateways.get" call.
7620 // Any non-2xx status code is an error. Response headers are in either
7621 // *Gateway.ServerResponse.Header or (if a response was returned at all) in
7622 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7623 // whether the returned error was because http.StatusNotModified was returned.
7624 func (c *ProjectsLocationsGatewaysGetCall) Do(opts ...googleapi.CallOption) (*Gateway, error) {
7625 gensupport.SetOptions(c.urlParams_, opts...)
7626 res, err := c.doRequest("json")
7627 if res != nil && res.StatusCode == http.StatusNotModified {
7628 if res.Body != nil {
7629 res.Body.Close()
7630 }
7631 return nil, gensupport.WrapError(&googleapi.Error{
7632 Code: res.StatusCode,
7633 Header: res.Header,
7634 })
7635 }
7636 if err != nil {
7637 return nil, err
7638 }
7639 defer googleapi.CloseBody(res)
7640 if err := googleapi.CheckResponse(res); err != nil {
7641 return nil, gensupport.WrapError(err)
7642 }
7643 ret := &Gateway{
7644 ServerResponse: googleapi.ServerResponse{
7645 Header: res.Header,
7646 HTTPStatusCode: res.StatusCode,
7647 },
7648 }
7649 target := &ret
7650 b, err := gensupport.DecodeResponseBytes(target, res)
7651 if err != nil {
7652 return nil, err
7653 }
7654 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.get", "response", internallog.HTTPResponse(res, b))
7655 return ret, nil
7656 }
7657
7658 type ProjectsLocationsGatewaysListCall struct {
7659 s *Service
7660 parent string
7661 urlParams_ gensupport.URLParams
7662 ifNoneMatch_ string
7663 ctx_ context.Context
7664 header_ http.Header
7665 }
7666
7667 // List: Lists Gateways in a given project and location.
7668 //
7669 // - parent: The project and location from which the Gateways should be listed,
7670 // specified in the format `projects/*/locations/*`.
7671 func (r *ProjectsLocationsGatewaysService) List(parent string) *ProjectsLocationsGatewaysListCall {
7672 c := &ProjectsLocationsGatewaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7673 c.parent = parent
7674 return c
7675 }
7676
7677 // PageSize sets the optional parameter "pageSize": Maximum number of Gateways
7678 // to return per call.
7679 func (c *ProjectsLocationsGatewaysListCall) PageSize(pageSize int64) *ProjectsLocationsGatewaysListCall {
7680 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
7681 return c
7682 }
7683
7684 // PageToken sets the optional parameter "pageToken": The value returned by the
7685 // last `ListGatewaysResponse` Indicates that this is a continuation of a prior
7686 // `ListGateways` call, and that the system should return the next page of
7687 // data.
7688 func (c *ProjectsLocationsGatewaysListCall) PageToken(pageToken string) *ProjectsLocationsGatewaysListCall {
7689 c.urlParams_.Set("pageToken", pageToken)
7690 return c
7691 }
7692
7693 // Fields allows partial responses to be retrieved. See
7694 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7695 // details.
7696 func (c *ProjectsLocationsGatewaysListCall) Fields(s ...googleapi.Field) *ProjectsLocationsGatewaysListCall {
7697 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7698 return c
7699 }
7700
7701 // IfNoneMatch sets an optional parameter which makes the operation fail if the
7702 // object's ETag matches the given value. This is useful for getting updates
7703 // only after the object has changed since the last request.
7704 func (c *ProjectsLocationsGatewaysListCall) IfNoneMatch(entityTag string) *ProjectsLocationsGatewaysListCall {
7705 c.ifNoneMatch_ = entityTag
7706 return c
7707 }
7708
7709 // Context sets the context to be used in this call's Do method.
7710 func (c *ProjectsLocationsGatewaysListCall) Context(ctx context.Context) *ProjectsLocationsGatewaysListCall {
7711 c.ctx_ = ctx
7712 return c
7713 }
7714
7715 // Header returns a http.Header that can be modified by the caller to add
7716 // headers to the request.
7717 func (c *ProjectsLocationsGatewaysListCall) Header() http.Header {
7718 if c.header_ == nil {
7719 c.header_ = make(http.Header)
7720 }
7721 return c.header_
7722 }
7723
7724 func (c *ProjectsLocationsGatewaysListCall) doRequest(alt string) (*http.Response, error) {
7725 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7726 if c.ifNoneMatch_ != "" {
7727 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7728 }
7729 c.urlParams_.Set("alt", alt)
7730 c.urlParams_.Set("prettyPrint", "false")
7731 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/gateways")
7732 urls += "?" + c.urlParams_.Encode()
7733 req, err := http.NewRequest("GET", urls, nil)
7734 if err != nil {
7735 return nil, err
7736 }
7737 req.Header = reqHeaders
7738 googleapi.Expand(req.URL, map[string]string{
7739 "parent": c.parent,
7740 })
7741 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.list", "request", internallog.HTTPRequest(req, nil))
7742 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7743 }
7744
7745 // Do executes the "networkservices.projects.locations.gateways.list" call.
7746 // Any non-2xx status code is an error. Response headers are in either
7747 // *ListGatewaysResponse.ServerResponse.Header or (if a response was returned
7748 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
7749 // check whether the returned error was because http.StatusNotModified was
7750 // returned.
7751 func (c *ProjectsLocationsGatewaysListCall) Do(opts ...googleapi.CallOption) (*ListGatewaysResponse, error) {
7752 gensupport.SetOptions(c.urlParams_, opts...)
7753 res, err := c.doRequest("json")
7754 if res != nil && res.StatusCode == http.StatusNotModified {
7755 if res.Body != nil {
7756 res.Body.Close()
7757 }
7758 return nil, gensupport.WrapError(&googleapi.Error{
7759 Code: res.StatusCode,
7760 Header: res.Header,
7761 })
7762 }
7763 if err != nil {
7764 return nil, err
7765 }
7766 defer googleapi.CloseBody(res)
7767 if err := googleapi.CheckResponse(res); err != nil {
7768 return nil, gensupport.WrapError(err)
7769 }
7770 ret := &ListGatewaysResponse{
7771 ServerResponse: googleapi.ServerResponse{
7772 Header: res.Header,
7773 HTTPStatusCode: res.StatusCode,
7774 },
7775 }
7776 target := &ret
7777 b, err := gensupport.DecodeResponseBytes(target, res)
7778 if err != nil {
7779 return nil, err
7780 }
7781 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.list", "response", internallog.HTTPResponse(res, b))
7782 return ret, nil
7783 }
7784
7785 // Pages invokes f for each page of results.
7786 // A non-nil error returned from f will halt the iteration.
7787 // The provided context supersedes any context provided to the Context method.
7788 func (c *ProjectsLocationsGatewaysListCall) Pages(ctx context.Context, f func(*ListGatewaysResponse) error) error {
7789 c.ctx_ = ctx
7790 defer c.PageToken(c.urlParams_.Get("pageToken"))
7791 for {
7792 x, err := c.Do()
7793 if err != nil {
7794 return err
7795 }
7796 if err := f(x); err != nil {
7797 return err
7798 }
7799 if x.NextPageToken == "" {
7800 return nil
7801 }
7802 c.PageToken(x.NextPageToken)
7803 }
7804 }
7805
7806 type ProjectsLocationsGatewaysPatchCall struct {
7807 s *Service
7808 name string
7809 gateway *Gateway
7810 urlParams_ gensupport.URLParams
7811 ctx_ context.Context
7812 header_ http.Header
7813 }
7814
7815 // Patch: Updates the parameters of a single Gateway.
7816 //
7817 // - name: Identifier. Name of the Gateway resource. It matches pattern
7818 // `projects/*/locations/*/gateways/`.
7819 func (r *ProjectsLocationsGatewaysService) Patch(name string, gateway *Gateway) *ProjectsLocationsGatewaysPatchCall {
7820 c := &ProjectsLocationsGatewaysPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7821 c.name = name
7822 c.gateway = gateway
7823 return c
7824 }
7825
7826 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
7827 // specify the fields to be overwritten in the Gateway resource by the update.
7828 // The fields specified in the update_mask are relative to the resource, not
7829 // the full request. A field will be overwritten if it is in the mask. If the
7830 // user does not provide a mask then all fields will be overwritten.
7831 func (c *ProjectsLocationsGatewaysPatchCall) UpdateMask(updateMask string) *ProjectsLocationsGatewaysPatchCall {
7832 c.urlParams_.Set("updateMask", updateMask)
7833 return c
7834 }
7835
7836 // Fields allows partial responses to be retrieved. See
7837 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7838 // details.
7839 func (c *ProjectsLocationsGatewaysPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsGatewaysPatchCall {
7840 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7841 return c
7842 }
7843
7844 // Context sets the context to be used in this call's Do method.
7845 func (c *ProjectsLocationsGatewaysPatchCall) Context(ctx context.Context) *ProjectsLocationsGatewaysPatchCall {
7846 c.ctx_ = ctx
7847 return c
7848 }
7849
7850 // Header returns a http.Header that can be modified by the caller to add
7851 // headers to the request.
7852 func (c *ProjectsLocationsGatewaysPatchCall) Header() http.Header {
7853 if c.header_ == nil {
7854 c.header_ = make(http.Header)
7855 }
7856 return c.header_
7857 }
7858
7859 func (c *ProjectsLocationsGatewaysPatchCall) doRequest(alt string) (*http.Response, error) {
7860 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7861 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.gateway)
7862 if err != nil {
7863 return nil, err
7864 }
7865 c.urlParams_.Set("alt", alt)
7866 c.urlParams_.Set("prettyPrint", "false")
7867 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
7868 urls += "?" + c.urlParams_.Encode()
7869 req, err := http.NewRequest("PATCH", urls, body)
7870 if err != nil {
7871 return nil, err
7872 }
7873 req.Header = reqHeaders
7874 googleapi.Expand(req.URL, map[string]string{
7875 "name": c.name,
7876 })
7877 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
7878 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7879 }
7880
7881 // Do executes the "networkservices.projects.locations.gateways.patch" call.
7882 // Any non-2xx status code is an error. Response headers are in either
7883 // *Operation.ServerResponse.Header or (if a response was returned at all) in
7884 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7885 // whether the returned error was because http.StatusNotModified was returned.
7886 func (c *ProjectsLocationsGatewaysPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
7887 gensupport.SetOptions(c.urlParams_, opts...)
7888 res, err := c.doRequest("json")
7889 if res != nil && res.StatusCode == http.StatusNotModified {
7890 if res.Body != nil {
7891 res.Body.Close()
7892 }
7893 return nil, gensupport.WrapError(&googleapi.Error{
7894 Code: res.StatusCode,
7895 Header: res.Header,
7896 })
7897 }
7898 if err != nil {
7899 return nil, err
7900 }
7901 defer googleapi.CloseBody(res)
7902 if err := googleapi.CheckResponse(res); err != nil {
7903 return nil, gensupport.WrapError(err)
7904 }
7905 ret := &Operation{
7906 ServerResponse: googleapi.ServerResponse{
7907 Header: res.Header,
7908 HTTPStatusCode: res.StatusCode,
7909 },
7910 }
7911 target := &ret
7912 b, err := gensupport.DecodeResponseBytes(target, res)
7913 if err != nil {
7914 return nil, err
7915 }
7916 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.patch", "response", internallog.HTTPResponse(res, b))
7917 return ret, nil
7918 }
7919
7920 type ProjectsLocationsGatewaysRouteViewsGetCall struct {
7921 s *Service
7922 name string
7923 urlParams_ gensupport.URLParams
7924 ifNoneMatch_ string
7925 ctx_ context.Context
7926 header_ http.Header
7927 }
7928
7929 // Get: Get a single RouteView of a Gateway.
7930 //
7931 // - name: Name of the GatewayRouteView resource. Formats:
7932 // projects/{project_number}/locations/{location}/gateways/{gateway}/routeView
7933 // s/{route_view}.
7934 func (r *ProjectsLocationsGatewaysRouteViewsService) Get(name string) *ProjectsLocationsGatewaysRouteViewsGetCall {
7935 c := &ProjectsLocationsGatewaysRouteViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7936 c.name = name
7937 return c
7938 }
7939
7940 // Fields allows partial responses to be retrieved. See
7941 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7942 // details.
7943 func (c *ProjectsLocationsGatewaysRouteViewsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGatewaysRouteViewsGetCall {
7944 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7945 return c
7946 }
7947
7948 // IfNoneMatch sets an optional parameter which makes the operation fail if the
7949 // object's ETag matches the given value. This is useful for getting updates
7950 // only after the object has changed since the last request.
7951 func (c *ProjectsLocationsGatewaysRouteViewsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGatewaysRouteViewsGetCall {
7952 c.ifNoneMatch_ = entityTag
7953 return c
7954 }
7955
7956 // Context sets the context to be used in this call's Do method.
7957 func (c *ProjectsLocationsGatewaysRouteViewsGetCall) Context(ctx context.Context) *ProjectsLocationsGatewaysRouteViewsGetCall {
7958 c.ctx_ = ctx
7959 return c
7960 }
7961
7962 // Header returns a http.Header that can be modified by the caller to add
7963 // headers to the request.
7964 func (c *ProjectsLocationsGatewaysRouteViewsGetCall) Header() http.Header {
7965 if c.header_ == nil {
7966 c.header_ = make(http.Header)
7967 }
7968 return c.header_
7969 }
7970
7971 func (c *ProjectsLocationsGatewaysRouteViewsGetCall) doRequest(alt string) (*http.Response, error) {
7972 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7973 if c.ifNoneMatch_ != "" {
7974 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7975 }
7976 c.urlParams_.Set("alt", alt)
7977 c.urlParams_.Set("prettyPrint", "false")
7978 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
7979 urls += "?" + c.urlParams_.Encode()
7980 req, err := http.NewRequest("GET", urls, nil)
7981 if err != nil {
7982 return nil, err
7983 }
7984 req.Header = reqHeaders
7985 googleapi.Expand(req.URL, map[string]string{
7986 "name": c.name,
7987 })
7988 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.routeViews.get", "request", internallog.HTTPRequest(req, nil))
7989 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7990 }
7991
7992 // Do executes the "networkservices.projects.locations.gateways.routeViews.get" call.
7993 // Any non-2xx status code is an error. Response headers are in either
7994 // *GatewayRouteView.ServerResponse.Header or (if a response was returned at
7995 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
7996 // check whether the returned error was because http.StatusNotModified was
7997 // returned.
7998 func (c *ProjectsLocationsGatewaysRouteViewsGetCall) Do(opts ...googleapi.CallOption) (*GatewayRouteView, error) {
7999 gensupport.SetOptions(c.urlParams_, opts...)
8000 res, err := c.doRequest("json")
8001 if res != nil && res.StatusCode == http.StatusNotModified {
8002 if res.Body != nil {
8003 res.Body.Close()
8004 }
8005 return nil, gensupport.WrapError(&googleapi.Error{
8006 Code: res.StatusCode,
8007 Header: res.Header,
8008 })
8009 }
8010 if err != nil {
8011 return nil, err
8012 }
8013 defer googleapi.CloseBody(res)
8014 if err := googleapi.CheckResponse(res); err != nil {
8015 return nil, gensupport.WrapError(err)
8016 }
8017 ret := &GatewayRouteView{
8018 ServerResponse: googleapi.ServerResponse{
8019 Header: res.Header,
8020 HTTPStatusCode: res.StatusCode,
8021 },
8022 }
8023 target := &ret
8024 b, err := gensupport.DecodeResponseBytes(target, res)
8025 if err != nil {
8026 return nil, err
8027 }
8028 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.routeViews.get", "response", internallog.HTTPResponse(res, b))
8029 return ret, nil
8030 }
8031
8032 type ProjectsLocationsGatewaysRouteViewsListCall struct {
8033 s *Service
8034 parent string
8035 urlParams_ gensupport.URLParams
8036 ifNoneMatch_ string
8037 ctx_ context.Context
8038 header_ http.Header
8039 }
8040
8041 // List: Lists RouteViews
8042 //
8043 // - parent: The Gateway to which a Route is associated. Formats:
8044 // projects/{project_number}/locations/{location}/gateways/{gateway}.
8045 func (r *ProjectsLocationsGatewaysRouteViewsService) List(parent string) *ProjectsLocationsGatewaysRouteViewsListCall {
8046 c := &ProjectsLocationsGatewaysRouteViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8047 c.parent = parent
8048 return c
8049 }
8050
8051 // PageSize sets the optional parameter "pageSize": Maximum number of
8052 // GatewayRouteViews to return per call.
8053 func (c *ProjectsLocationsGatewaysRouteViewsListCall) PageSize(pageSize int64) *ProjectsLocationsGatewaysRouteViewsListCall {
8054 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
8055 return c
8056 }
8057
8058 // PageToken sets the optional parameter "pageToken": The value returned by the
8059 // last `ListGatewayRouteViewsResponse` Indicates that this is a continuation
8060 // of a prior `ListGatewayRouteViews` call, and that the system should return
8061 // the next page of data.
8062 func (c *ProjectsLocationsGatewaysRouteViewsListCall) PageToken(pageToken string) *ProjectsLocationsGatewaysRouteViewsListCall {
8063 c.urlParams_.Set("pageToken", pageToken)
8064 return c
8065 }
8066
8067 // Fields allows partial responses to be retrieved. See
8068 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8069 // details.
8070 func (c *ProjectsLocationsGatewaysRouteViewsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsGatewaysRouteViewsListCall {
8071 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8072 return c
8073 }
8074
8075 // IfNoneMatch sets an optional parameter which makes the operation fail if the
8076 // object's ETag matches the given value. This is useful for getting updates
8077 // only after the object has changed since the last request.
8078 func (c *ProjectsLocationsGatewaysRouteViewsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsGatewaysRouteViewsListCall {
8079 c.ifNoneMatch_ = entityTag
8080 return c
8081 }
8082
8083 // Context sets the context to be used in this call's Do method.
8084 func (c *ProjectsLocationsGatewaysRouteViewsListCall) Context(ctx context.Context) *ProjectsLocationsGatewaysRouteViewsListCall {
8085 c.ctx_ = ctx
8086 return c
8087 }
8088
8089 // Header returns a http.Header that can be modified by the caller to add
8090 // headers to the request.
8091 func (c *ProjectsLocationsGatewaysRouteViewsListCall) Header() http.Header {
8092 if c.header_ == nil {
8093 c.header_ = make(http.Header)
8094 }
8095 return c.header_
8096 }
8097
8098 func (c *ProjectsLocationsGatewaysRouteViewsListCall) doRequest(alt string) (*http.Response, error) {
8099 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8100 if c.ifNoneMatch_ != "" {
8101 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8102 }
8103 c.urlParams_.Set("alt", alt)
8104 c.urlParams_.Set("prettyPrint", "false")
8105 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/routeViews")
8106 urls += "?" + c.urlParams_.Encode()
8107 req, err := http.NewRequest("GET", urls, nil)
8108 if err != nil {
8109 return nil, err
8110 }
8111 req.Header = reqHeaders
8112 googleapi.Expand(req.URL, map[string]string{
8113 "parent": c.parent,
8114 })
8115 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.routeViews.list", "request", internallog.HTTPRequest(req, nil))
8116 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8117 }
8118
8119 // Do executes the "networkservices.projects.locations.gateways.routeViews.list" call.
8120 // Any non-2xx status code is an error. Response headers are in either
8121 // *ListGatewayRouteViewsResponse.ServerResponse.Header or (if a response was
8122 // returned at all) in error.(*googleapi.Error).Header. Use
8123 // googleapi.IsNotModified to check whether the returned error was because
8124 // http.StatusNotModified was returned.
8125 func (c *ProjectsLocationsGatewaysRouteViewsListCall) Do(opts ...googleapi.CallOption) (*ListGatewayRouteViewsResponse, error) {
8126 gensupport.SetOptions(c.urlParams_, opts...)
8127 res, err := c.doRequest("json")
8128 if res != nil && res.StatusCode == http.StatusNotModified {
8129 if res.Body != nil {
8130 res.Body.Close()
8131 }
8132 return nil, gensupport.WrapError(&googleapi.Error{
8133 Code: res.StatusCode,
8134 Header: res.Header,
8135 })
8136 }
8137 if err != nil {
8138 return nil, err
8139 }
8140 defer googleapi.CloseBody(res)
8141 if err := googleapi.CheckResponse(res); err != nil {
8142 return nil, gensupport.WrapError(err)
8143 }
8144 ret := &ListGatewayRouteViewsResponse{
8145 ServerResponse: googleapi.ServerResponse{
8146 Header: res.Header,
8147 HTTPStatusCode: res.StatusCode,
8148 },
8149 }
8150 target := &ret
8151 b, err := gensupport.DecodeResponseBytes(target, res)
8152 if err != nil {
8153 return nil, err
8154 }
8155 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.routeViews.list", "response", internallog.HTTPResponse(res, b))
8156 return ret, nil
8157 }
8158
8159 // Pages invokes f for each page of results.
8160 // A non-nil error returned from f will halt the iteration.
8161 // The provided context supersedes any context provided to the Context method.
8162 func (c *ProjectsLocationsGatewaysRouteViewsListCall) Pages(ctx context.Context, f func(*ListGatewayRouteViewsResponse) error) error {
8163 c.ctx_ = ctx
8164 defer c.PageToken(c.urlParams_.Get("pageToken"))
8165 for {
8166 x, err := c.Do()
8167 if err != nil {
8168 return err
8169 }
8170 if err := f(x); err != nil {
8171 return err
8172 }
8173 if x.NextPageToken == "" {
8174 return nil
8175 }
8176 c.PageToken(x.NextPageToken)
8177 }
8178 }
8179
8180 type ProjectsLocationsGrpcRoutesCreateCall struct {
8181 s *Service
8182 parent string
8183 grpcroute *GrpcRoute
8184 urlParams_ gensupport.URLParams
8185 ctx_ context.Context
8186 header_ http.Header
8187 }
8188
8189 // Create: Creates a new GrpcRoute in a given project and location.
8190 //
8191 // - parent: The parent resource of the GrpcRoute. Must be in the format
8192 // `projects/*/locations/*`.
8193 func (r *ProjectsLocationsGrpcRoutesService) Create(parent string, grpcroute *GrpcRoute) *ProjectsLocationsGrpcRoutesCreateCall {
8194 c := &ProjectsLocationsGrpcRoutesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8195 c.parent = parent
8196 c.grpcroute = grpcroute
8197 return c
8198 }
8199
8200 // GrpcRouteId sets the optional parameter "grpcRouteId": Required. Short name
8201 // of the GrpcRoute resource to be created.
8202 func (c *ProjectsLocationsGrpcRoutesCreateCall) GrpcRouteId(grpcRouteId string) *ProjectsLocationsGrpcRoutesCreateCall {
8203 c.urlParams_.Set("grpcRouteId", grpcRouteId)
8204 return c
8205 }
8206
8207 // Fields allows partial responses to be retrieved. See
8208 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8209 // details.
8210 func (c *ProjectsLocationsGrpcRoutesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsGrpcRoutesCreateCall {
8211 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8212 return c
8213 }
8214
8215 // Context sets the context to be used in this call's Do method.
8216 func (c *ProjectsLocationsGrpcRoutesCreateCall) Context(ctx context.Context) *ProjectsLocationsGrpcRoutesCreateCall {
8217 c.ctx_ = ctx
8218 return c
8219 }
8220
8221 // Header returns a http.Header that can be modified by the caller to add
8222 // headers to the request.
8223 func (c *ProjectsLocationsGrpcRoutesCreateCall) Header() http.Header {
8224 if c.header_ == nil {
8225 c.header_ = make(http.Header)
8226 }
8227 return c.header_
8228 }
8229
8230 func (c *ProjectsLocationsGrpcRoutesCreateCall) doRequest(alt string) (*http.Response, error) {
8231 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8232 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.grpcroute)
8233 if err != nil {
8234 return nil, err
8235 }
8236 c.urlParams_.Set("alt", alt)
8237 c.urlParams_.Set("prettyPrint", "false")
8238 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/grpcRoutes")
8239 urls += "?" + c.urlParams_.Encode()
8240 req, err := http.NewRequest("POST", urls, body)
8241 if err != nil {
8242 return nil, err
8243 }
8244 req.Header = reqHeaders
8245 googleapi.Expand(req.URL, map[string]string{
8246 "parent": c.parent,
8247 })
8248 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.grpcRoutes.create", "request", internallog.HTTPRequest(req, body.Bytes()))
8249 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8250 }
8251
8252 // Do executes the "networkservices.projects.locations.grpcRoutes.create" call.
8253 // Any non-2xx status code is an error. Response headers are in either
8254 // *Operation.ServerResponse.Header or (if a response was returned at all) in
8255 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
8256 // whether the returned error was because http.StatusNotModified was returned.
8257 func (c *ProjectsLocationsGrpcRoutesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
8258 gensupport.SetOptions(c.urlParams_, opts...)
8259 res, err := c.doRequest("json")
8260 if res != nil && res.StatusCode == http.StatusNotModified {
8261 if res.Body != nil {
8262 res.Body.Close()
8263 }
8264 return nil, gensupport.WrapError(&googleapi.Error{
8265 Code: res.StatusCode,
8266 Header: res.Header,
8267 })
8268 }
8269 if err != nil {
8270 return nil, err
8271 }
8272 defer googleapi.CloseBody(res)
8273 if err := googleapi.CheckResponse(res); err != nil {
8274 return nil, gensupport.WrapError(err)
8275 }
8276 ret := &Operation{
8277 ServerResponse: googleapi.ServerResponse{
8278 Header: res.Header,
8279 HTTPStatusCode: res.StatusCode,
8280 },
8281 }
8282 target := &ret
8283 b, err := gensupport.DecodeResponseBytes(target, res)
8284 if err != nil {
8285 return nil, err
8286 }
8287 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.grpcRoutes.create", "response", internallog.HTTPResponse(res, b))
8288 return ret, nil
8289 }
8290
8291 type ProjectsLocationsGrpcRoutesDeleteCall struct {
8292 s *Service
8293 name string
8294 urlParams_ gensupport.URLParams
8295 ctx_ context.Context
8296 header_ http.Header
8297 }
8298
8299 // Delete: Deletes a single GrpcRoute.
8300 //
8301 // - name: A name of the GrpcRoute to delete. Must be in the format
8302 // `projects/*/locations/*/grpcRoutes/*`.
8303 func (r *ProjectsLocationsGrpcRoutesService) Delete(name string) *ProjectsLocationsGrpcRoutesDeleteCall {
8304 c := &ProjectsLocationsGrpcRoutesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8305 c.name = name
8306 return c
8307 }
8308
8309 // Fields allows partial responses to be retrieved. See
8310 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8311 // details.
8312 func (c *ProjectsLocationsGrpcRoutesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsGrpcRoutesDeleteCall {
8313 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8314 return c
8315 }
8316
8317 // Context sets the context to be used in this call's Do method.
8318 func (c *ProjectsLocationsGrpcRoutesDeleteCall) Context(ctx context.Context) *ProjectsLocationsGrpcRoutesDeleteCall {
8319 c.ctx_ = ctx
8320 return c
8321 }
8322
8323 // Header returns a http.Header that can be modified by the caller to add
8324 // headers to the request.
8325 func (c *ProjectsLocationsGrpcRoutesDeleteCall) Header() http.Header {
8326 if c.header_ == nil {
8327 c.header_ = make(http.Header)
8328 }
8329 return c.header_
8330 }
8331
8332 func (c *ProjectsLocationsGrpcRoutesDeleteCall) doRequest(alt string) (*http.Response, error) {
8333 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8334 c.urlParams_.Set("alt", alt)
8335 c.urlParams_.Set("prettyPrint", "false")
8336 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
8337 urls += "?" + c.urlParams_.Encode()
8338 req, err := http.NewRequest("DELETE", urls, nil)
8339 if err != nil {
8340 return nil, err
8341 }
8342 req.Header = reqHeaders
8343 googleapi.Expand(req.URL, map[string]string{
8344 "name": c.name,
8345 })
8346 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.grpcRoutes.delete", "request", internallog.HTTPRequest(req, nil))
8347 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8348 }
8349
8350 // Do executes the "networkservices.projects.locations.grpcRoutes.delete" call.
8351 // Any non-2xx status code is an error. Response headers are in either
8352 // *Operation.ServerResponse.Header or (if a response was returned at all) in
8353 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
8354 // whether the returned error was because http.StatusNotModified was returned.
8355 func (c *ProjectsLocationsGrpcRoutesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
8356 gensupport.SetOptions(c.urlParams_, opts...)
8357 res, err := c.doRequest("json")
8358 if res != nil && res.StatusCode == http.StatusNotModified {
8359 if res.Body != nil {
8360 res.Body.Close()
8361 }
8362 return nil, gensupport.WrapError(&googleapi.Error{
8363 Code: res.StatusCode,
8364 Header: res.Header,
8365 })
8366 }
8367 if err != nil {
8368 return nil, err
8369 }
8370 defer googleapi.CloseBody(res)
8371 if err := googleapi.CheckResponse(res); err != nil {
8372 return nil, gensupport.WrapError(err)
8373 }
8374 ret := &Operation{
8375 ServerResponse: googleapi.ServerResponse{
8376 Header: res.Header,
8377 HTTPStatusCode: res.StatusCode,
8378 },
8379 }
8380 target := &ret
8381 b, err := gensupport.DecodeResponseBytes(target, res)
8382 if err != nil {
8383 return nil, err
8384 }
8385 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.grpcRoutes.delete", "response", internallog.HTTPResponse(res, b))
8386 return ret, nil
8387 }
8388
8389 type ProjectsLocationsGrpcRoutesGetCall struct {
8390 s *Service
8391 name string
8392 urlParams_ gensupport.URLParams
8393 ifNoneMatch_ string
8394 ctx_ context.Context
8395 header_ http.Header
8396 }
8397
8398 // Get: Gets details of a single GrpcRoute.
8399 //
8400 // - name: A name of the GrpcRoute to get. Must be in the format
8401 // `projects/*/locations/*/grpcRoutes/*`.
8402 func (r *ProjectsLocationsGrpcRoutesService) Get(name string) *ProjectsLocationsGrpcRoutesGetCall {
8403 c := &ProjectsLocationsGrpcRoutesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8404 c.name = name
8405 return c
8406 }
8407
8408 // Fields allows partial responses to be retrieved. See
8409 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8410 // details.
8411 func (c *ProjectsLocationsGrpcRoutesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGrpcRoutesGetCall {
8412 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8413 return c
8414 }
8415
8416 // IfNoneMatch sets an optional parameter which makes the operation fail if the
8417 // object's ETag matches the given value. This is useful for getting updates
8418 // only after the object has changed since the last request.
8419 func (c *ProjectsLocationsGrpcRoutesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGrpcRoutesGetCall {
8420 c.ifNoneMatch_ = entityTag
8421 return c
8422 }
8423
8424 // Context sets the context to be used in this call's Do method.
8425 func (c *ProjectsLocationsGrpcRoutesGetCall) Context(ctx context.Context) *ProjectsLocationsGrpcRoutesGetCall {
8426 c.ctx_ = ctx
8427 return c
8428 }
8429
8430 // Header returns a http.Header that can be modified by the caller to add
8431 // headers to the request.
8432 func (c *ProjectsLocationsGrpcRoutesGetCall) Header() http.Header {
8433 if c.header_ == nil {
8434 c.header_ = make(http.Header)
8435 }
8436 return c.header_
8437 }
8438
8439 func (c *ProjectsLocationsGrpcRoutesGetCall) doRequest(alt string) (*http.Response, error) {
8440 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8441 if c.ifNoneMatch_ != "" {
8442 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8443 }
8444 c.urlParams_.Set("alt", alt)
8445 c.urlParams_.Set("prettyPrint", "false")
8446 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
8447 urls += "?" + c.urlParams_.Encode()
8448 req, err := http.NewRequest("GET", urls, nil)
8449 if err != nil {
8450 return nil, err
8451 }
8452 req.Header = reqHeaders
8453 googleapi.Expand(req.URL, map[string]string{
8454 "name": c.name,
8455 })
8456 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.grpcRoutes.get", "request", internallog.HTTPRequest(req, nil))
8457 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8458 }
8459
8460 // Do executes the "networkservices.projects.locations.grpcRoutes.get" call.
8461 // Any non-2xx status code is an error. Response headers are in either
8462 // *GrpcRoute.ServerResponse.Header or (if a response was returned at all) in
8463 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
8464 // whether the returned error was because http.StatusNotModified was returned.
8465 func (c *ProjectsLocationsGrpcRoutesGetCall) Do(opts ...googleapi.CallOption) (*GrpcRoute, error) {
8466 gensupport.SetOptions(c.urlParams_, opts...)
8467 res, err := c.doRequest("json")
8468 if res != nil && res.StatusCode == http.StatusNotModified {
8469 if res.Body != nil {
8470 res.Body.Close()
8471 }
8472 return nil, gensupport.WrapError(&googleapi.Error{
8473 Code: res.StatusCode,
8474 Header: res.Header,
8475 })
8476 }
8477 if err != nil {
8478 return nil, err
8479 }
8480 defer googleapi.CloseBody(res)
8481 if err := googleapi.CheckResponse(res); err != nil {
8482 return nil, gensupport.WrapError(err)
8483 }
8484 ret := &GrpcRoute{
8485 ServerResponse: googleapi.ServerResponse{
8486 Header: res.Header,
8487 HTTPStatusCode: res.StatusCode,
8488 },
8489 }
8490 target := &ret
8491 b, err := gensupport.DecodeResponseBytes(target, res)
8492 if err != nil {
8493 return nil, err
8494 }
8495 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.grpcRoutes.get", "response", internallog.HTTPResponse(res, b))
8496 return ret, nil
8497 }
8498
8499 type ProjectsLocationsGrpcRoutesListCall struct {
8500 s *Service
8501 parent string
8502 urlParams_ gensupport.URLParams
8503 ifNoneMatch_ string
8504 ctx_ context.Context
8505 header_ http.Header
8506 }
8507
8508 // List: Lists GrpcRoutes in a given project and location.
8509 //
8510 // - parent: The project and location from which the GrpcRoutes should be
8511 // listed, specified in the format `projects/*/locations/*`.
8512 func (r *ProjectsLocationsGrpcRoutesService) List(parent string) *ProjectsLocationsGrpcRoutesListCall {
8513 c := &ProjectsLocationsGrpcRoutesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8514 c.parent = parent
8515 return c
8516 }
8517
8518 // PageSize sets the optional parameter "pageSize": Maximum number of
8519 // GrpcRoutes to return per call.
8520 func (c *ProjectsLocationsGrpcRoutesListCall) PageSize(pageSize int64) *ProjectsLocationsGrpcRoutesListCall {
8521 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
8522 return c
8523 }
8524
8525 // PageToken sets the optional parameter "pageToken": The value returned by the
8526 // last `ListGrpcRoutesResponse` Indicates that this is a continuation of a
8527 // prior `ListGrpcRoutes` call, and that the system should return the next page
8528 // of data.
8529 func (c *ProjectsLocationsGrpcRoutesListCall) PageToken(pageToken string) *ProjectsLocationsGrpcRoutesListCall {
8530 c.urlParams_.Set("pageToken", pageToken)
8531 return c
8532 }
8533
8534 // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": If
8535 // true, allow partial responses for multi-regional Aggregated List requests.
8536 // Otherwise if one of the locations is down or unreachable, the Aggregated
8537 // List request will fail.
8538 func (c *ProjectsLocationsGrpcRoutesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ProjectsLocationsGrpcRoutesListCall {
8539 c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
8540 return c
8541 }
8542
8543 // Fields allows partial responses to be retrieved. See
8544 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8545 // details.
8546 func (c *ProjectsLocationsGrpcRoutesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsGrpcRoutesListCall {
8547 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8548 return c
8549 }
8550
8551 // IfNoneMatch sets an optional parameter which makes the operation fail if the
8552 // object's ETag matches the given value. This is useful for getting updates
8553 // only after the object has changed since the last request.
8554 func (c *ProjectsLocationsGrpcRoutesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsGrpcRoutesListCall {
8555 c.ifNoneMatch_ = entityTag
8556 return c
8557 }
8558
8559 // Context sets the context to be used in this call's Do method.
8560 func (c *ProjectsLocationsGrpcRoutesListCall) Context(ctx context.Context) *ProjectsLocationsGrpcRoutesListCall {
8561 c.ctx_ = ctx
8562 return c
8563 }
8564
8565 // Header returns a http.Header that can be modified by the caller to add
8566 // headers to the request.
8567 func (c *ProjectsLocationsGrpcRoutesListCall) Header() http.Header {
8568 if c.header_ == nil {
8569 c.header_ = make(http.Header)
8570 }
8571 return c.header_
8572 }
8573
8574 func (c *ProjectsLocationsGrpcRoutesListCall) doRequest(alt string) (*http.Response, error) {
8575 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8576 if c.ifNoneMatch_ != "" {
8577 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8578 }
8579 c.urlParams_.Set("alt", alt)
8580 c.urlParams_.Set("prettyPrint", "false")
8581 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/grpcRoutes")
8582 urls += "?" + c.urlParams_.Encode()
8583 req, err := http.NewRequest("GET", urls, nil)
8584 if err != nil {
8585 return nil, err
8586 }
8587 req.Header = reqHeaders
8588 googleapi.Expand(req.URL, map[string]string{
8589 "parent": c.parent,
8590 })
8591 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.grpcRoutes.list", "request", internallog.HTTPRequest(req, nil))
8592 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8593 }
8594
8595 // Do executes the "networkservices.projects.locations.grpcRoutes.list" call.
8596 // Any non-2xx status code is an error. Response headers are in either
8597 // *ListGrpcRoutesResponse.ServerResponse.Header or (if a response was returned
8598 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
8599 // check whether the returned error was because http.StatusNotModified was
8600 // returned.
8601 func (c *ProjectsLocationsGrpcRoutesListCall) Do(opts ...googleapi.CallOption) (*ListGrpcRoutesResponse, error) {
8602 gensupport.SetOptions(c.urlParams_, opts...)
8603 res, err := c.doRequest("json")
8604 if res != nil && res.StatusCode == http.StatusNotModified {
8605 if res.Body != nil {
8606 res.Body.Close()
8607 }
8608 return nil, gensupport.WrapError(&googleapi.Error{
8609 Code: res.StatusCode,
8610 Header: res.Header,
8611 })
8612 }
8613 if err != nil {
8614 return nil, err
8615 }
8616 defer googleapi.CloseBody(res)
8617 if err := googleapi.CheckResponse(res); err != nil {
8618 return nil, gensupport.WrapError(err)
8619 }
8620 ret := &ListGrpcRoutesResponse{
8621 ServerResponse: googleapi.ServerResponse{
8622 Header: res.Header,
8623 HTTPStatusCode: res.StatusCode,
8624 },
8625 }
8626 target := &ret
8627 b, err := gensupport.DecodeResponseBytes(target, res)
8628 if err != nil {
8629 return nil, err
8630 }
8631 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.grpcRoutes.list", "response", internallog.HTTPResponse(res, b))
8632 return ret, nil
8633 }
8634
8635 // Pages invokes f for each page of results.
8636 // A non-nil error returned from f will halt the iteration.
8637 // The provided context supersedes any context provided to the Context method.
8638 func (c *ProjectsLocationsGrpcRoutesListCall) Pages(ctx context.Context, f func(*ListGrpcRoutesResponse) error) error {
8639 c.ctx_ = ctx
8640 defer c.PageToken(c.urlParams_.Get("pageToken"))
8641 for {
8642 x, err := c.Do()
8643 if err != nil {
8644 return err
8645 }
8646 if err := f(x); err != nil {
8647 return err
8648 }
8649 if x.NextPageToken == "" {
8650 return nil
8651 }
8652 c.PageToken(x.NextPageToken)
8653 }
8654 }
8655
8656 type ProjectsLocationsGrpcRoutesPatchCall struct {
8657 s *Service
8658 name string
8659 grpcroute *GrpcRoute
8660 urlParams_ gensupport.URLParams
8661 ctx_ context.Context
8662 header_ http.Header
8663 }
8664
8665 // Patch: Updates the parameters of a single GrpcRoute.
8666 //
8667 // - name: Identifier. Name of the GrpcRoute resource. It matches pattern
8668 // `projects/*/locations/*/grpcRoutes/`.
8669 func (r *ProjectsLocationsGrpcRoutesService) Patch(name string, grpcroute *GrpcRoute) *ProjectsLocationsGrpcRoutesPatchCall {
8670 c := &ProjectsLocationsGrpcRoutesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8671 c.name = name
8672 c.grpcroute = grpcroute
8673 return c
8674 }
8675
8676 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
8677 // specify the fields to be overwritten in the GrpcRoute resource by the
8678 // update. The fields specified in the update_mask are relative to the
8679 // resource, not the full request. A field will be overwritten if it is in the
8680 // mask. If the user does not provide a mask then all fields will be
8681 // overwritten.
8682 func (c *ProjectsLocationsGrpcRoutesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsGrpcRoutesPatchCall {
8683 c.urlParams_.Set("updateMask", updateMask)
8684 return c
8685 }
8686
8687 // Fields allows partial responses to be retrieved. See
8688 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8689 // details.
8690 func (c *ProjectsLocationsGrpcRoutesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsGrpcRoutesPatchCall {
8691 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8692 return c
8693 }
8694
8695 // Context sets the context to be used in this call's Do method.
8696 func (c *ProjectsLocationsGrpcRoutesPatchCall) Context(ctx context.Context) *ProjectsLocationsGrpcRoutesPatchCall {
8697 c.ctx_ = ctx
8698 return c
8699 }
8700
8701 // Header returns a http.Header that can be modified by the caller to add
8702 // headers to the request.
8703 func (c *ProjectsLocationsGrpcRoutesPatchCall) Header() http.Header {
8704 if c.header_ == nil {
8705 c.header_ = make(http.Header)
8706 }
8707 return c.header_
8708 }
8709
8710 func (c *ProjectsLocationsGrpcRoutesPatchCall) doRequest(alt string) (*http.Response, error) {
8711 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8712 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.grpcroute)
8713 if err != nil {
8714 return nil, err
8715 }
8716 c.urlParams_.Set("alt", alt)
8717 c.urlParams_.Set("prettyPrint", "false")
8718 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
8719 urls += "?" + c.urlParams_.Encode()
8720 req, err := http.NewRequest("PATCH", urls, body)
8721 if err != nil {
8722 return nil, err
8723 }
8724 req.Header = reqHeaders
8725 googleapi.Expand(req.URL, map[string]string{
8726 "name": c.name,
8727 })
8728 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.grpcRoutes.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
8729 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8730 }
8731
8732 // Do executes the "networkservices.projects.locations.grpcRoutes.patch" call.
8733 // Any non-2xx status code is an error. Response headers are in either
8734 // *Operation.ServerResponse.Header or (if a response was returned at all) in
8735 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
8736 // whether the returned error was because http.StatusNotModified was returned.
8737 func (c *ProjectsLocationsGrpcRoutesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
8738 gensupport.SetOptions(c.urlParams_, opts...)
8739 res, err := c.doRequest("json")
8740 if res != nil && res.StatusCode == http.StatusNotModified {
8741 if res.Body != nil {
8742 res.Body.Close()
8743 }
8744 return nil, gensupport.WrapError(&googleapi.Error{
8745 Code: res.StatusCode,
8746 Header: res.Header,
8747 })
8748 }
8749 if err != nil {
8750 return nil, err
8751 }
8752 defer googleapi.CloseBody(res)
8753 if err := googleapi.CheckResponse(res); err != nil {
8754 return nil, gensupport.WrapError(err)
8755 }
8756 ret := &Operation{
8757 ServerResponse: googleapi.ServerResponse{
8758 Header: res.Header,
8759 HTTPStatusCode: res.StatusCode,
8760 },
8761 }
8762 target := &ret
8763 b, err := gensupport.DecodeResponseBytes(target, res)
8764 if err != nil {
8765 return nil, err
8766 }
8767 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.grpcRoutes.patch", "response", internallog.HTTPResponse(res, b))
8768 return ret, nil
8769 }
8770
8771 type ProjectsLocationsHttpRoutesCreateCall struct {
8772 s *Service
8773 parent string
8774 httproute *HttpRoute
8775 urlParams_ gensupport.URLParams
8776 ctx_ context.Context
8777 header_ http.Header
8778 }
8779
8780 // Create: Creates a new HttpRoute in a given project and location.
8781 //
8782 // - parent: The parent resource of the HttpRoute. Must be in the format
8783 // `projects/*/locations/*`.
8784 func (r *ProjectsLocationsHttpRoutesService) Create(parent string, httproute *HttpRoute) *ProjectsLocationsHttpRoutesCreateCall {
8785 c := &ProjectsLocationsHttpRoutesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8786 c.parent = parent
8787 c.httproute = httproute
8788 return c
8789 }
8790
8791 // HttpRouteId sets the optional parameter "httpRouteId": Required. Short name
8792 // of the HttpRoute resource to be created.
8793 func (c *ProjectsLocationsHttpRoutesCreateCall) HttpRouteId(httpRouteId string) *ProjectsLocationsHttpRoutesCreateCall {
8794 c.urlParams_.Set("httpRouteId", httpRouteId)
8795 return c
8796 }
8797
8798 // Fields allows partial responses to be retrieved. See
8799 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8800 // details.
8801 func (c *ProjectsLocationsHttpRoutesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsHttpRoutesCreateCall {
8802 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8803 return c
8804 }
8805
8806 // Context sets the context to be used in this call's Do method.
8807 func (c *ProjectsLocationsHttpRoutesCreateCall) Context(ctx context.Context) *ProjectsLocationsHttpRoutesCreateCall {
8808 c.ctx_ = ctx
8809 return c
8810 }
8811
8812 // Header returns a http.Header that can be modified by the caller to add
8813 // headers to the request.
8814 func (c *ProjectsLocationsHttpRoutesCreateCall) Header() http.Header {
8815 if c.header_ == nil {
8816 c.header_ = make(http.Header)
8817 }
8818 return c.header_
8819 }
8820
8821 func (c *ProjectsLocationsHttpRoutesCreateCall) doRequest(alt string) (*http.Response, error) {
8822 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8823 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.httproute)
8824 if err != nil {
8825 return nil, err
8826 }
8827 c.urlParams_.Set("alt", alt)
8828 c.urlParams_.Set("prettyPrint", "false")
8829 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/httpRoutes")
8830 urls += "?" + c.urlParams_.Encode()
8831 req, err := http.NewRequest("POST", urls, body)
8832 if err != nil {
8833 return nil, err
8834 }
8835 req.Header = reqHeaders
8836 googleapi.Expand(req.URL, map[string]string{
8837 "parent": c.parent,
8838 })
8839 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.httpRoutes.create", "request", internallog.HTTPRequest(req, body.Bytes()))
8840 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8841 }
8842
8843 // Do executes the "networkservices.projects.locations.httpRoutes.create" call.
8844 // Any non-2xx status code is an error. Response headers are in either
8845 // *Operation.ServerResponse.Header or (if a response was returned at all) in
8846 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
8847 // whether the returned error was because http.StatusNotModified was returned.
8848 func (c *ProjectsLocationsHttpRoutesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
8849 gensupport.SetOptions(c.urlParams_, opts...)
8850 res, err := c.doRequest("json")
8851 if res != nil && res.StatusCode == http.StatusNotModified {
8852 if res.Body != nil {
8853 res.Body.Close()
8854 }
8855 return nil, gensupport.WrapError(&googleapi.Error{
8856 Code: res.StatusCode,
8857 Header: res.Header,
8858 })
8859 }
8860 if err != nil {
8861 return nil, err
8862 }
8863 defer googleapi.CloseBody(res)
8864 if err := googleapi.CheckResponse(res); err != nil {
8865 return nil, gensupport.WrapError(err)
8866 }
8867 ret := &Operation{
8868 ServerResponse: googleapi.ServerResponse{
8869 Header: res.Header,
8870 HTTPStatusCode: res.StatusCode,
8871 },
8872 }
8873 target := &ret
8874 b, err := gensupport.DecodeResponseBytes(target, res)
8875 if err != nil {
8876 return nil, err
8877 }
8878 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.httpRoutes.create", "response", internallog.HTTPResponse(res, b))
8879 return ret, nil
8880 }
8881
8882 type ProjectsLocationsHttpRoutesDeleteCall struct {
8883 s *Service
8884 name string
8885 urlParams_ gensupport.URLParams
8886 ctx_ context.Context
8887 header_ http.Header
8888 }
8889
8890 // Delete: Deletes a single HttpRoute.
8891 //
8892 // - name: A name of the HttpRoute to delete. Must be in the format
8893 // `projects/*/locations/*/httpRoutes/*`.
8894 func (r *ProjectsLocationsHttpRoutesService) Delete(name string) *ProjectsLocationsHttpRoutesDeleteCall {
8895 c := &ProjectsLocationsHttpRoutesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8896 c.name = name
8897 return c
8898 }
8899
8900 // Fields allows partial responses to be retrieved. See
8901 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8902 // details.
8903 func (c *ProjectsLocationsHttpRoutesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsHttpRoutesDeleteCall {
8904 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8905 return c
8906 }
8907
8908 // Context sets the context to be used in this call's Do method.
8909 func (c *ProjectsLocationsHttpRoutesDeleteCall) Context(ctx context.Context) *ProjectsLocationsHttpRoutesDeleteCall {
8910 c.ctx_ = ctx
8911 return c
8912 }
8913
8914 // Header returns a http.Header that can be modified by the caller to add
8915 // headers to the request.
8916 func (c *ProjectsLocationsHttpRoutesDeleteCall) Header() http.Header {
8917 if c.header_ == nil {
8918 c.header_ = make(http.Header)
8919 }
8920 return c.header_
8921 }
8922
8923 func (c *ProjectsLocationsHttpRoutesDeleteCall) doRequest(alt string) (*http.Response, error) {
8924 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8925 c.urlParams_.Set("alt", alt)
8926 c.urlParams_.Set("prettyPrint", "false")
8927 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
8928 urls += "?" + c.urlParams_.Encode()
8929 req, err := http.NewRequest("DELETE", urls, nil)
8930 if err != nil {
8931 return nil, err
8932 }
8933 req.Header = reqHeaders
8934 googleapi.Expand(req.URL, map[string]string{
8935 "name": c.name,
8936 })
8937 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.httpRoutes.delete", "request", internallog.HTTPRequest(req, nil))
8938 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8939 }
8940
8941 // Do executes the "networkservices.projects.locations.httpRoutes.delete" call.
8942 // Any non-2xx status code is an error. Response headers are in either
8943 // *Operation.ServerResponse.Header or (if a response was returned at all) in
8944 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
8945 // whether the returned error was because http.StatusNotModified was returned.
8946 func (c *ProjectsLocationsHttpRoutesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
8947 gensupport.SetOptions(c.urlParams_, opts...)
8948 res, err := c.doRequest("json")
8949 if res != nil && res.StatusCode == http.StatusNotModified {
8950 if res.Body != nil {
8951 res.Body.Close()
8952 }
8953 return nil, gensupport.WrapError(&googleapi.Error{
8954 Code: res.StatusCode,
8955 Header: res.Header,
8956 })
8957 }
8958 if err != nil {
8959 return nil, err
8960 }
8961 defer googleapi.CloseBody(res)
8962 if err := googleapi.CheckResponse(res); err != nil {
8963 return nil, gensupport.WrapError(err)
8964 }
8965 ret := &Operation{
8966 ServerResponse: googleapi.ServerResponse{
8967 Header: res.Header,
8968 HTTPStatusCode: res.StatusCode,
8969 },
8970 }
8971 target := &ret
8972 b, err := gensupport.DecodeResponseBytes(target, res)
8973 if err != nil {
8974 return nil, err
8975 }
8976 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.httpRoutes.delete", "response", internallog.HTTPResponse(res, b))
8977 return ret, nil
8978 }
8979
8980 type ProjectsLocationsHttpRoutesGetCall struct {
8981 s *Service
8982 name string
8983 urlParams_ gensupport.URLParams
8984 ifNoneMatch_ string
8985 ctx_ context.Context
8986 header_ http.Header
8987 }
8988
8989 // Get: Gets details of a single HttpRoute.
8990 //
8991 // - name: A name of the HttpRoute to get. Must be in the format
8992 // `projects/*/locations/*/httpRoutes/*`.
8993 func (r *ProjectsLocationsHttpRoutesService) Get(name string) *ProjectsLocationsHttpRoutesGetCall {
8994 c := &ProjectsLocationsHttpRoutesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8995 c.name = name
8996 return c
8997 }
8998
8999 // Fields allows partial responses to be retrieved. See
9000 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9001 // details.
9002 func (c *ProjectsLocationsHttpRoutesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsHttpRoutesGetCall {
9003 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9004 return c
9005 }
9006
9007 // IfNoneMatch sets an optional parameter which makes the operation fail if the
9008 // object's ETag matches the given value. This is useful for getting updates
9009 // only after the object has changed since the last request.
9010 func (c *ProjectsLocationsHttpRoutesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsHttpRoutesGetCall {
9011 c.ifNoneMatch_ = entityTag
9012 return c
9013 }
9014
9015 // Context sets the context to be used in this call's Do method.
9016 func (c *ProjectsLocationsHttpRoutesGetCall) Context(ctx context.Context) *ProjectsLocationsHttpRoutesGetCall {
9017 c.ctx_ = ctx
9018 return c
9019 }
9020
9021 // Header returns a http.Header that can be modified by the caller to add
9022 // headers to the request.
9023 func (c *ProjectsLocationsHttpRoutesGetCall) Header() http.Header {
9024 if c.header_ == nil {
9025 c.header_ = make(http.Header)
9026 }
9027 return c.header_
9028 }
9029
9030 func (c *ProjectsLocationsHttpRoutesGetCall) doRequest(alt string) (*http.Response, error) {
9031 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9032 if c.ifNoneMatch_ != "" {
9033 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9034 }
9035 c.urlParams_.Set("alt", alt)
9036 c.urlParams_.Set("prettyPrint", "false")
9037 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
9038 urls += "?" + c.urlParams_.Encode()
9039 req, err := http.NewRequest("GET", urls, nil)
9040 if err != nil {
9041 return nil, err
9042 }
9043 req.Header = reqHeaders
9044 googleapi.Expand(req.URL, map[string]string{
9045 "name": c.name,
9046 })
9047 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.httpRoutes.get", "request", internallog.HTTPRequest(req, nil))
9048 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9049 }
9050
9051 // Do executes the "networkservices.projects.locations.httpRoutes.get" call.
9052 // Any non-2xx status code is an error. Response headers are in either
9053 // *HttpRoute.ServerResponse.Header or (if a response was returned at all) in
9054 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
9055 // whether the returned error was because http.StatusNotModified was returned.
9056 func (c *ProjectsLocationsHttpRoutesGetCall) Do(opts ...googleapi.CallOption) (*HttpRoute, error) {
9057 gensupport.SetOptions(c.urlParams_, opts...)
9058 res, err := c.doRequest("json")
9059 if res != nil && res.StatusCode == http.StatusNotModified {
9060 if res.Body != nil {
9061 res.Body.Close()
9062 }
9063 return nil, gensupport.WrapError(&googleapi.Error{
9064 Code: res.StatusCode,
9065 Header: res.Header,
9066 })
9067 }
9068 if err != nil {
9069 return nil, err
9070 }
9071 defer googleapi.CloseBody(res)
9072 if err := googleapi.CheckResponse(res); err != nil {
9073 return nil, gensupport.WrapError(err)
9074 }
9075 ret := &HttpRoute{
9076 ServerResponse: googleapi.ServerResponse{
9077 Header: res.Header,
9078 HTTPStatusCode: res.StatusCode,
9079 },
9080 }
9081 target := &ret
9082 b, err := gensupport.DecodeResponseBytes(target, res)
9083 if err != nil {
9084 return nil, err
9085 }
9086 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.httpRoutes.get", "response", internallog.HTTPResponse(res, b))
9087 return ret, nil
9088 }
9089
9090 type ProjectsLocationsHttpRoutesListCall struct {
9091 s *Service
9092 parent string
9093 urlParams_ gensupport.URLParams
9094 ifNoneMatch_ string
9095 ctx_ context.Context
9096 header_ http.Header
9097 }
9098
9099 // List: Lists HttpRoute in a given project and location.
9100 //
9101 // - parent: The project and location from which the HttpRoutes should be
9102 // listed, specified in the format `projects/*/locations/*`.
9103 func (r *ProjectsLocationsHttpRoutesService) List(parent string) *ProjectsLocationsHttpRoutesListCall {
9104 c := &ProjectsLocationsHttpRoutesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9105 c.parent = parent
9106 return c
9107 }
9108
9109 // PageSize sets the optional parameter "pageSize": Maximum number of
9110 // HttpRoutes to return per call.
9111 func (c *ProjectsLocationsHttpRoutesListCall) PageSize(pageSize int64) *ProjectsLocationsHttpRoutesListCall {
9112 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
9113 return c
9114 }
9115
9116 // PageToken sets the optional parameter "pageToken": The value returned by the
9117 // last `ListHttpRoutesResponse` Indicates that this is a continuation of a
9118 // prior `ListHttpRoutes` call, and that the system should return the next page
9119 // of data.
9120 func (c *ProjectsLocationsHttpRoutesListCall) PageToken(pageToken string) *ProjectsLocationsHttpRoutesListCall {
9121 c.urlParams_.Set("pageToken", pageToken)
9122 return c
9123 }
9124
9125 // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": If
9126 // true, allow partial responses for multi-regional Aggregated List requests.
9127 // Otherwise if one of the locations is down or unreachable, the Aggregated
9128 // List request will fail.
9129 func (c *ProjectsLocationsHttpRoutesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ProjectsLocationsHttpRoutesListCall {
9130 c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
9131 return c
9132 }
9133
9134 // Fields allows partial responses to be retrieved. See
9135 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9136 // details.
9137 func (c *ProjectsLocationsHttpRoutesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsHttpRoutesListCall {
9138 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9139 return c
9140 }
9141
9142 // IfNoneMatch sets an optional parameter which makes the operation fail if the
9143 // object's ETag matches the given value. This is useful for getting updates
9144 // only after the object has changed since the last request.
9145 func (c *ProjectsLocationsHttpRoutesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsHttpRoutesListCall {
9146 c.ifNoneMatch_ = entityTag
9147 return c
9148 }
9149
9150 // Context sets the context to be used in this call's Do method.
9151 func (c *ProjectsLocationsHttpRoutesListCall) Context(ctx context.Context) *ProjectsLocationsHttpRoutesListCall {
9152 c.ctx_ = ctx
9153 return c
9154 }
9155
9156 // Header returns a http.Header that can be modified by the caller to add
9157 // headers to the request.
9158 func (c *ProjectsLocationsHttpRoutesListCall) Header() http.Header {
9159 if c.header_ == nil {
9160 c.header_ = make(http.Header)
9161 }
9162 return c.header_
9163 }
9164
9165 func (c *ProjectsLocationsHttpRoutesListCall) doRequest(alt string) (*http.Response, error) {
9166 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9167 if c.ifNoneMatch_ != "" {
9168 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9169 }
9170 c.urlParams_.Set("alt", alt)
9171 c.urlParams_.Set("prettyPrint", "false")
9172 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/httpRoutes")
9173 urls += "?" + c.urlParams_.Encode()
9174 req, err := http.NewRequest("GET", urls, nil)
9175 if err != nil {
9176 return nil, err
9177 }
9178 req.Header = reqHeaders
9179 googleapi.Expand(req.URL, map[string]string{
9180 "parent": c.parent,
9181 })
9182 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.httpRoutes.list", "request", internallog.HTTPRequest(req, nil))
9183 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9184 }
9185
9186 // Do executes the "networkservices.projects.locations.httpRoutes.list" call.
9187 // Any non-2xx status code is an error. Response headers are in either
9188 // *ListHttpRoutesResponse.ServerResponse.Header or (if a response was returned
9189 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
9190 // check whether the returned error was because http.StatusNotModified was
9191 // returned.
9192 func (c *ProjectsLocationsHttpRoutesListCall) Do(opts ...googleapi.CallOption) (*ListHttpRoutesResponse, error) {
9193 gensupport.SetOptions(c.urlParams_, opts...)
9194 res, err := c.doRequest("json")
9195 if res != nil && res.StatusCode == http.StatusNotModified {
9196 if res.Body != nil {
9197 res.Body.Close()
9198 }
9199 return nil, gensupport.WrapError(&googleapi.Error{
9200 Code: res.StatusCode,
9201 Header: res.Header,
9202 })
9203 }
9204 if err != nil {
9205 return nil, err
9206 }
9207 defer googleapi.CloseBody(res)
9208 if err := googleapi.CheckResponse(res); err != nil {
9209 return nil, gensupport.WrapError(err)
9210 }
9211 ret := &ListHttpRoutesResponse{
9212 ServerResponse: googleapi.ServerResponse{
9213 Header: res.Header,
9214 HTTPStatusCode: res.StatusCode,
9215 },
9216 }
9217 target := &ret
9218 b, err := gensupport.DecodeResponseBytes(target, res)
9219 if err != nil {
9220 return nil, err
9221 }
9222 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.httpRoutes.list", "response", internallog.HTTPResponse(res, b))
9223 return ret, nil
9224 }
9225
9226 // Pages invokes f for each page of results.
9227 // A non-nil error returned from f will halt the iteration.
9228 // The provided context supersedes any context provided to the Context method.
9229 func (c *ProjectsLocationsHttpRoutesListCall) Pages(ctx context.Context, f func(*ListHttpRoutesResponse) error) error {
9230 c.ctx_ = ctx
9231 defer c.PageToken(c.urlParams_.Get("pageToken"))
9232 for {
9233 x, err := c.Do()
9234 if err != nil {
9235 return err
9236 }
9237 if err := f(x); err != nil {
9238 return err
9239 }
9240 if x.NextPageToken == "" {
9241 return nil
9242 }
9243 c.PageToken(x.NextPageToken)
9244 }
9245 }
9246
9247 type ProjectsLocationsHttpRoutesPatchCall struct {
9248 s *Service
9249 name string
9250 httproute *HttpRoute
9251 urlParams_ gensupport.URLParams
9252 ctx_ context.Context
9253 header_ http.Header
9254 }
9255
9256 // Patch: Updates the parameters of a single HttpRoute.
9257 //
9258 // - name: Identifier. Name of the HttpRoute resource. It matches pattern
9259 // `projects/*/locations/*/httpRoutes/http_route_name>`.
9260 func (r *ProjectsLocationsHttpRoutesService) Patch(name string, httproute *HttpRoute) *ProjectsLocationsHttpRoutesPatchCall {
9261 c := &ProjectsLocationsHttpRoutesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9262 c.name = name
9263 c.httproute = httproute
9264 return c
9265 }
9266
9267 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
9268 // specify the fields to be overwritten in the HttpRoute resource by the
9269 // update. The fields specified in the update_mask are relative to the
9270 // resource, not the full request. A field will be overwritten if it is in the
9271 // mask. If the user does not provide a mask then all fields will be
9272 // overwritten.
9273 func (c *ProjectsLocationsHttpRoutesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsHttpRoutesPatchCall {
9274 c.urlParams_.Set("updateMask", updateMask)
9275 return c
9276 }
9277
9278 // Fields allows partial responses to be retrieved. See
9279 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9280 // details.
9281 func (c *ProjectsLocationsHttpRoutesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsHttpRoutesPatchCall {
9282 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9283 return c
9284 }
9285
9286 // Context sets the context to be used in this call's Do method.
9287 func (c *ProjectsLocationsHttpRoutesPatchCall) Context(ctx context.Context) *ProjectsLocationsHttpRoutesPatchCall {
9288 c.ctx_ = ctx
9289 return c
9290 }
9291
9292 // Header returns a http.Header that can be modified by the caller to add
9293 // headers to the request.
9294 func (c *ProjectsLocationsHttpRoutesPatchCall) Header() http.Header {
9295 if c.header_ == nil {
9296 c.header_ = make(http.Header)
9297 }
9298 return c.header_
9299 }
9300
9301 func (c *ProjectsLocationsHttpRoutesPatchCall) doRequest(alt string) (*http.Response, error) {
9302 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9303 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.httproute)
9304 if err != nil {
9305 return nil, err
9306 }
9307 c.urlParams_.Set("alt", alt)
9308 c.urlParams_.Set("prettyPrint", "false")
9309 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
9310 urls += "?" + c.urlParams_.Encode()
9311 req, err := http.NewRequest("PATCH", urls, body)
9312 if err != nil {
9313 return nil, err
9314 }
9315 req.Header = reqHeaders
9316 googleapi.Expand(req.URL, map[string]string{
9317 "name": c.name,
9318 })
9319 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.httpRoutes.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
9320 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9321 }
9322
9323 // Do executes the "networkservices.projects.locations.httpRoutes.patch" call.
9324 // Any non-2xx status code is an error. Response headers are in either
9325 // *Operation.ServerResponse.Header or (if a response was returned at all) in
9326 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
9327 // whether the returned error was because http.StatusNotModified was returned.
9328 func (c *ProjectsLocationsHttpRoutesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
9329 gensupport.SetOptions(c.urlParams_, opts...)
9330 res, err := c.doRequest("json")
9331 if res != nil && res.StatusCode == http.StatusNotModified {
9332 if res.Body != nil {
9333 res.Body.Close()
9334 }
9335 return nil, gensupport.WrapError(&googleapi.Error{
9336 Code: res.StatusCode,
9337 Header: res.Header,
9338 })
9339 }
9340 if err != nil {
9341 return nil, err
9342 }
9343 defer googleapi.CloseBody(res)
9344 if err := googleapi.CheckResponse(res); err != nil {
9345 return nil, gensupport.WrapError(err)
9346 }
9347 ret := &Operation{
9348 ServerResponse: googleapi.ServerResponse{
9349 Header: res.Header,
9350 HTTPStatusCode: res.StatusCode,
9351 },
9352 }
9353 target := &ret
9354 b, err := gensupport.DecodeResponseBytes(target, res)
9355 if err != nil {
9356 return nil, err
9357 }
9358 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.httpRoutes.patch", "response", internallog.HTTPResponse(res, b))
9359 return ret, nil
9360 }
9361
9362 type ProjectsLocationsLbEdgeExtensionsCreateCall struct {
9363 s *Service
9364 parent string
9365 lbedgeextension *LbEdgeExtension
9366 urlParams_ gensupport.URLParams
9367 ctx_ context.Context
9368 header_ http.Header
9369 }
9370
9371 // Create: Creates a new `LbEdgeExtension` resource in a given project and
9372 // location.
9373 //
9374 // - parent: The parent resource of the `LbEdgeExtension` resource. Must be in
9375 // the format `projects/{project}/locations/{location}`.
9376 func (r *ProjectsLocationsLbEdgeExtensionsService) Create(parent string, lbedgeextension *LbEdgeExtension) *ProjectsLocationsLbEdgeExtensionsCreateCall {
9377 c := &ProjectsLocationsLbEdgeExtensionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9378 c.parent = parent
9379 c.lbedgeextension = lbedgeextension
9380 return c
9381 }
9382
9383 // LbEdgeExtensionId sets the optional parameter "lbEdgeExtensionId": Required.
9384 // User-provided ID of the `LbEdgeExtension` resource to be created.
9385 func (c *ProjectsLocationsLbEdgeExtensionsCreateCall) LbEdgeExtensionId(lbEdgeExtensionId string) *ProjectsLocationsLbEdgeExtensionsCreateCall {
9386 c.urlParams_.Set("lbEdgeExtensionId", lbEdgeExtensionId)
9387 return c
9388 }
9389
9390 // RequestId sets the optional parameter "requestId": An optional request ID to
9391 // identify requests. Specify a unique request ID so that if you must retry
9392 // your request, the server can ignore the request if it has already been
9393 // completed. The server guarantees that for 60 minutes since the first
9394 // request. For example, consider a situation where you make an initial request
9395 // and the request times out. If you make the request again with the same
9396 // request ID, the server ignores the second request This prevents clients from
9397 // accidentally creating duplicate commitments. The request ID must be a valid
9398 // UUID with the exception that zero UUID is not supported
9399 // (00000000-0000-0000-0000-000000000000).
9400 func (c *ProjectsLocationsLbEdgeExtensionsCreateCall) RequestId(requestId string) *ProjectsLocationsLbEdgeExtensionsCreateCall {
9401 c.urlParams_.Set("requestId", requestId)
9402 return c
9403 }
9404
9405 // Fields allows partial responses to be retrieved. See
9406 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9407 // details.
9408 func (c *ProjectsLocationsLbEdgeExtensionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbEdgeExtensionsCreateCall {
9409 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9410 return c
9411 }
9412
9413 // Context sets the context to be used in this call's Do method.
9414 func (c *ProjectsLocationsLbEdgeExtensionsCreateCall) Context(ctx context.Context) *ProjectsLocationsLbEdgeExtensionsCreateCall {
9415 c.ctx_ = ctx
9416 return c
9417 }
9418
9419 // Header returns a http.Header that can be modified by the caller to add
9420 // headers to the request.
9421 func (c *ProjectsLocationsLbEdgeExtensionsCreateCall) Header() http.Header {
9422 if c.header_ == nil {
9423 c.header_ = make(http.Header)
9424 }
9425 return c.header_
9426 }
9427
9428 func (c *ProjectsLocationsLbEdgeExtensionsCreateCall) doRequest(alt string) (*http.Response, error) {
9429 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9430 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lbedgeextension)
9431 if err != nil {
9432 return nil, err
9433 }
9434 c.urlParams_.Set("alt", alt)
9435 c.urlParams_.Set("prettyPrint", "false")
9436 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/lbEdgeExtensions")
9437 urls += "?" + c.urlParams_.Encode()
9438 req, err := http.NewRequest("POST", urls, body)
9439 if err != nil {
9440 return nil, err
9441 }
9442 req.Header = reqHeaders
9443 googleapi.Expand(req.URL, map[string]string{
9444 "parent": c.parent,
9445 })
9446 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbEdgeExtensions.create", "request", internallog.HTTPRequest(req, body.Bytes()))
9447 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9448 }
9449
9450 // Do executes the "networkservices.projects.locations.lbEdgeExtensions.create" call.
9451 // Any non-2xx status code is an error. Response headers are in either
9452 // *Operation.ServerResponse.Header or (if a response was returned at all) in
9453 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
9454 // whether the returned error was because http.StatusNotModified was returned.
9455 func (c *ProjectsLocationsLbEdgeExtensionsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
9456 gensupport.SetOptions(c.urlParams_, opts...)
9457 res, err := c.doRequest("json")
9458 if res != nil && res.StatusCode == http.StatusNotModified {
9459 if res.Body != nil {
9460 res.Body.Close()
9461 }
9462 return nil, gensupport.WrapError(&googleapi.Error{
9463 Code: res.StatusCode,
9464 Header: res.Header,
9465 })
9466 }
9467 if err != nil {
9468 return nil, err
9469 }
9470 defer googleapi.CloseBody(res)
9471 if err := googleapi.CheckResponse(res); err != nil {
9472 return nil, gensupport.WrapError(err)
9473 }
9474 ret := &Operation{
9475 ServerResponse: googleapi.ServerResponse{
9476 Header: res.Header,
9477 HTTPStatusCode: res.StatusCode,
9478 },
9479 }
9480 target := &ret
9481 b, err := gensupport.DecodeResponseBytes(target, res)
9482 if err != nil {
9483 return nil, err
9484 }
9485 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbEdgeExtensions.create", "response", internallog.HTTPResponse(res, b))
9486 return ret, nil
9487 }
9488
9489 type ProjectsLocationsLbEdgeExtensionsDeleteCall struct {
9490 s *Service
9491 name string
9492 urlParams_ gensupport.URLParams
9493 ctx_ context.Context
9494 header_ http.Header
9495 }
9496
9497 // Delete: Deletes the specified `LbEdgeExtension` resource.
9498 //
9499 // - name: The name of the `LbEdgeExtension` resource to delete. Must be in the
9500 // format
9501 // `projects/{project}/locations/{location}/lbEdgeExtensions/{lb_edge_extensio
9502 // n}`.
9503 func (r *ProjectsLocationsLbEdgeExtensionsService) Delete(name string) *ProjectsLocationsLbEdgeExtensionsDeleteCall {
9504 c := &ProjectsLocationsLbEdgeExtensionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9505 c.name = name
9506 return c
9507 }
9508
9509 // RequestId sets the optional parameter "requestId": An optional request ID to
9510 // identify requests. Specify a unique request ID so that if you must retry
9511 // your request, the server can ignore the request if it has already been
9512 // completed. The server guarantees that for 60 minutes after the first
9513 // request. For example, consider a situation where you make an initial request
9514 // and the request times out. If you make the request again with the same
9515 // request ID, the server ignores the second request This prevents clients from
9516 // accidentally creating duplicate commitments. The request ID must be a valid
9517 // UUID with the exception that zero UUID is not supported
9518 // (00000000-0000-0000-0000-000000000000).
9519 func (c *ProjectsLocationsLbEdgeExtensionsDeleteCall) RequestId(requestId string) *ProjectsLocationsLbEdgeExtensionsDeleteCall {
9520 c.urlParams_.Set("requestId", requestId)
9521 return c
9522 }
9523
9524 // Fields allows partial responses to be retrieved. See
9525 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9526 // details.
9527 func (c *ProjectsLocationsLbEdgeExtensionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbEdgeExtensionsDeleteCall {
9528 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9529 return c
9530 }
9531
9532 // Context sets the context to be used in this call's Do method.
9533 func (c *ProjectsLocationsLbEdgeExtensionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsLbEdgeExtensionsDeleteCall {
9534 c.ctx_ = ctx
9535 return c
9536 }
9537
9538 // Header returns a http.Header that can be modified by the caller to add
9539 // headers to the request.
9540 func (c *ProjectsLocationsLbEdgeExtensionsDeleteCall) Header() http.Header {
9541 if c.header_ == nil {
9542 c.header_ = make(http.Header)
9543 }
9544 return c.header_
9545 }
9546
9547 func (c *ProjectsLocationsLbEdgeExtensionsDeleteCall) doRequest(alt string) (*http.Response, error) {
9548 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9549 c.urlParams_.Set("alt", alt)
9550 c.urlParams_.Set("prettyPrint", "false")
9551 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
9552 urls += "?" + c.urlParams_.Encode()
9553 req, err := http.NewRequest("DELETE", urls, nil)
9554 if err != nil {
9555 return nil, err
9556 }
9557 req.Header = reqHeaders
9558 googleapi.Expand(req.URL, map[string]string{
9559 "name": c.name,
9560 })
9561 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbEdgeExtensions.delete", "request", internallog.HTTPRequest(req, nil))
9562 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9563 }
9564
9565 // Do executes the "networkservices.projects.locations.lbEdgeExtensions.delete" call.
9566 // Any non-2xx status code is an error. Response headers are in either
9567 // *Operation.ServerResponse.Header or (if a response was returned at all) in
9568 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
9569 // whether the returned error was because http.StatusNotModified was returned.
9570 func (c *ProjectsLocationsLbEdgeExtensionsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
9571 gensupport.SetOptions(c.urlParams_, opts...)
9572 res, err := c.doRequest("json")
9573 if res != nil && res.StatusCode == http.StatusNotModified {
9574 if res.Body != nil {
9575 res.Body.Close()
9576 }
9577 return nil, gensupport.WrapError(&googleapi.Error{
9578 Code: res.StatusCode,
9579 Header: res.Header,
9580 })
9581 }
9582 if err != nil {
9583 return nil, err
9584 }
9585 defer googleapi.CloseBody(res)
9586 if err := googleapi.CheckResponse(res); err != nil {
9587 return nil, gensupport.WrapError(err)
9588 }
9589 ret := &Operation{
9590 ServerResponse: googleapi.ServerResponse{
9591 Header: res.Header,
9592 HTTPStatusCode: res.StatusCode,
9593 },
9594 }
9595 target := &ret
9596 b, err := gensupport.DecodeResponseBytes(target, res)
9597 if err != nil {
9598 return nil, err
9599 }
9600 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbEdgeExtensions.delete", "response", internallog.HTTPResponse(res, b))
9601 return ret, nil
9602 }
9603
9604 type ProjectsLocationsLbEdgeExtensionsGetCall struct {
9605 s *Service
9606 name string
9607 urlParams_ gensupport.URLParams
9608 ifNoneMatch_ string
9609 ctx_ context.Context
9610 header_ http.Header
9611 }
9612
9613 // Get: Gets details of the specified `LbEdgeExtension` resource.
9614 //
9615 // - name: A name of the `LbEdgeExtension` resource to get. Must be in the
9616 // format
9617 // `projects/{project}/locations/{location}/lbEdgeExtensions/{lb_edge_extensio
9618 // n}`.
9619 func (r *ProjectsLocationsLbEdgeExtensionsService) Get(name string) *ProjectsLocationsLbEdgeExtensionsGetCall {
9620 c := &ProjectsLocationsLbEdgeExtensionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9621 c.name = name
9622 return c
9623 }
9624
9625 // Fields allows partial responses to be retrieved. See
9626 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9627 // details.
9628 func (c *ProjectsLocationsLbEdgeExtensionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbEdgeExtensionsGetCall {
9629 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9630 return c
9631 }
9632
9633 // IfNoneMatch sets an optional parameter which makes the operation fail if the
9634 // object's ETag matches the given value. This is useful for getting updates
9635 // only after the object has changed since the last request.
9636 func (c *ProjectsLocationsLbEdgeExtensionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsLbEdgeExtensionsGetCall {
9637 c.ifNoneMatch_ = entityTag
9638 return c
9639 }
9640
9641 // Context sets the context to be used in this call's Do method.
9642 func (c *ProjectsLocationsLbEdgeExtensionsGetCall) Context(ctx context.Context) *ProjectsLocationsLbEdgeExtensionsGetCall {
9643 c.ctx_ = ctx
9644 return c
9645 }
9646
9647 // Header returns a http.Header that can be modified by the caller to add
9648 // headers to the request.
9649 func (c *ProjectsLocationsLbEdgeExtensionsGetCall) Header() http.Header {
9650 if c.header_ == nil {
9651 c.header_ = make(http.Header)
9652 }
9653 return c.header_
9654 }
9655
9656 func (c *ProjectsLocationsLbEdgeExtensionsGetCall) doRequest(alt string) (*http.Response, error) {
9657 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9658 if c.ifNoneMatch_ != "" {
9659 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9660 }
9661 c.urlParams_.Set("alt", alt)
9662 c.urlParams_.Set("prettyPrint", "false")
9663 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
9664 urls += "?" + c.urlParams_.Encode()
9665 req, err := http.NewRequest("GET", urls, nil)
9666 if err != nil {
9667 return nil, err
9668 }
9669 req.Header = reqHeaders
9670 googleapi.Expand(req.URL, map[string]string{
9671 "name": c.name,
9672 })
9673 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbEdgeExtensions.get", "request", internallog.HTTPRequest(req, nil))
9674 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9675 }
9676
9677 // Do executes the "networkservices.projects.locations.lbEdgeExtensions.get" call.
9678 // Any non-2xx status code is an error. Response headers are in either
9679 // *LbEdgeExtension.ServerResponse.Header or (if a response was returned at
9680 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
9681 // check whether the returned error was because http.StatusNotModified was
9682 // returned.
9683 func (c *ProjectsLocationsLbEdgeExtensionsGetCall) Do(opts ...googleapi.CallOption) (*LbEdgeExtension, error) {
9684 gensupport.SetOptions(c.urlParams_, opts...)
9685 res, err := c.doRequest("json")
9686 if res != nil && res.StatusCode == http.StatusNotModified {
9687 if res.Body != nil {
9688 res.Body.Close()
9689 }
9690 return nil, gensupport.WrapError(&googleapi.Error{
9691 Code: res.StatusCode,
9692 Header: res.Header,
9693 })
9694 }
9695 if err != nil {
9696 return nil, err
9697 }
9698 defer googleapi.CloseBody(res)
9699 if err := googleapi.CheckResponse(res); err != nil {
9700 return nil, gensupport.WrapError(err)
9701 }
9702 ret := &LbEdgeExtension{
9703 ServerResponse: googleapi.ServerResponse{
9704 Header: res.Header,
9705 HTTPStatusCode: res.StatusCode,
9706 },
9707 }
9708 target := &ret
9709 b, err := gensupport.DecodeResponseBytes(target, res)
9710 if err != nil {
9711 return nil, err
9712 }
9713 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbEdgeExtensions.get", "response", internallog.HTTPResponse(res, b))
9714 return ret, nil
9715 }
9716
9717 type ProjectsLocationsLbEdgeExtensionsListCall struct {
9718 s *Service
9719 parent string
9720 urlParams_ gensupport.URLParams
9721 ifNoneMatch_ string
9722 ctx_ context.Context
9723 header_ http.Header
9724 }
9725
9726 // List: Lists `LbEdgeExtension` resources in a given project and location.
9727 //
9728 // - parent: The project and location from which the `LbEdgeExtension`
9729 // resources are listed. These values are specified in the following format:
9730 // `projects/{project}/locations/{location}`.
9731 func (r *ProjectsLocationsLbEdgeExtensionsService) List(parent string) *ProjectsLocationsLbEdgeExtensionsListCall {
9732 c := &ProjectsLocationsLbEdgeExtensionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9733 c.parent = parent
9734 return c
9735 }
9736
9737 // Filter sets the optional parameter "filter": Filtering results.
9738 func (c *ProjectsLocationsLbEdgeExtensionsListCall) Filter(filter string) *ProjectsLocationsLbEdgeExtensionsListCall {
9739 c.urlParams_.Set("filter", filter)
9740 return c
9741 }
9742
9743 // OrderBy sets the optional parameter "orderBy": Hint about how to order the
9744 // results.
9745 func (c *ProjectsLocationsLbEdgeExtensionsListCall) OrderBy(orderBy string) *ProjectsLocationsLbEdgeExtensionsListCall {
9746 c.urlParams_.Set("orderBy", orderBy)
9747 return c
9748 }
9749
9750 // PageSize sets the optional parameter "pageSize": Requested page size. The
9751 // server might return fewer items than requested. If unspecified, the server
9752 // picks an appropriate default.
9753 func (c *ProjectsLocationsLbEdgeExtensionsListCall) PageSize(pageSize int64) *ProjectsLocationsLbEdgeExtensionsListCall {
9754 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
9755 return c
9756 }
9757
9758 // PageToken sets the optional parameter "pageToken": A token identifying a
9759 // page of results that the server returns.
9760 func (c *ProjectsLocationsLbEdgeExtensionsListCall) PageToken(pageToken string) *ProjectsLocationsLbEdgeExtensionsListCall {
9761 c.urlParams_.Set("pageToken", pageToken)
9762 return c
9763 }
9764
9765 // Fields allows partial responses to be retrieved. See
9766 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9767 // details.
9768 func (c *ProjectsLocationsLbEdgeExtensionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbEdgeExtensionsListCall {
9769 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9770 return c
9771 }
9772
9773 // IfNoneMatch sets an optional parameter which makes the operation fail if the
9774 // object's ETag matches the given value. This is useful for getting updates
9775 // only after the object has changed since the last request.
9776 func (c *ProjectsLocationsLbEdgeExtensionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsLbEdgeExtensionsListCall {
9777 c.ifNoneMatch_ = entityTag
9778 return c
9779 }
9780
9781 // Context sets the context to be used in this call's Do method.
9782 func (c *ProjectsLocationsLbEdgeExtensionsListCall) Context(ctx context.Context) *ProjectsLocationsLbEdgeExtensionsListCall {
9783 c.ctx_ = ctx
9784 return c
9785 }
9786
9787 // Header returns a http.Header that can be modified by the caller to add
9788 // headers to the request.
9789 func (c *ProjectsLocationsLbEdgeExtensionsListCall) Header() http.Header {
9790 if c.header_ == nil {
9791 c.header_ = make(http.Header)
9792 }
9793 return c.header_
9794 }
9795
9796 func (c *ProjectsLocationsLbEdgeExtensionsListCall) doRequest(alt string) (*http.Response, error) {
9797 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9798 if c.ifNoneMatch_ != "" {
9799 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9800 }
9801 c.urlParams_.Set("alt", alt)
9802 c.urlParams_.Set("prettyPrint", "false")
9803 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/lbEdgeExtensions")
9804 urls += "?" + c.urlParams_.Encode()
9805 req, err := http.NewRequest("GET", urls, nil)
9806 if err != nil {
9807 return nil, err
9808 }
9809 req.Header = reqHeaders
9810 googleapi.Expand(req.URL, map[string]string{
9811 "parent": c.parent,
9812 })
9813 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbEdgeExtensions.list", "request", internallog.HTTPRequest(req, nil))
9814 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9815 }
9816
9817 // Do executes the "networkservices.projects.locations.lbEdgeExtensions.list" call.
9818 // Any non-2xx status code is an error. Response headers are in either
9819 // *ListLbEdgeExtensionsResponse.ServerResponse.Header or (if a response was
9820 // returned at all) in error.(*googleapi.Error).Header. Use
9821 // googleapi.IsNotModified to check whether the returned error was because
9822 // http.StatusNotModified was returned.
9823 func (c *ProjectsLocationsLbEdgeExtensionsListCall) Do(opts ...googleapi.CallOption) (*ListLbEdgeExtensionsResponse, error) {
9824 gensupport.SetOptions(c.urlParams_, opts...)
9825 res, err := c.doRequest("json")
9826 if res != nil && res.StatusCode == http.StatusNotModified {
9827 if res.Body != nil {
9828 res.Body.Close()
9829 }
9830 return nil, gensupport.WrapError(&googleapi.Error{
9831 Code: res.StatusCode,
9832 Header: res.Header,
9833 })
9834 }
9835 if err != nil {
9836 return nil, err
9837 }
9838 defer googleapi.CloseBody(res)
9839 if err := googleapi.CheckResponse(res); err != nil {
9840 return nil, gensupport.WrapError(err)
9841 }
9842 ret := &ListLbEdgeExtensionsResponse{
9843 ServerResponse: googleapi.ServerResponse{
9844 Header: res.Header,
9845 HTTPStatusCode: res.StatusCode,
9846 },
9847 }
9848 target := &ret
9849 b, err := gensupport.DecodeResponseBytes(target, res)
9850 if err != nil {
9851 return nil, err
9852 }
9853 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbEdgeExtensions.list", "response", internallog.HTTPResponse(res, b))
9854 return ret, nil
9855 }
9856
9857 // Pages invokes f for each page of results.
9858 // A non-nil error returned from f will halt the iteration.
9859 // The provided context supersedes any context provided to the Context method.
9860 func (c *ProjectsLocationsLbEdgeExtensionsListCall) Pages(ctx context.Context, f func(*ListLbEdgeExtensionsResponse) error) error {
9861 c.ctx_ = ctx
9862 defer c.PageToken(c.urlParams_.Get("pageToken"))
9863 for {
9864 x, err := c.Do()
9865 if err != nil {
9866 return err
9867 }
9868 if err := f(x); err != nil {
9869 return err
9870 }
9871 if x.NextPageToken == "" {
9872 return nil
9873 }
9874 c.PageToken(x.NextPageToken)
9875 }
9876 }
9877
9878 type ProjectsLocationsLbEdgeExtensionsPatchCall struct {
9879 s *Service
9880 name string
9881 lbedgeextension *LbEdgeExtension
9882 urlParams_ gensupport.URLParams
9883 ctx_ context.Context
9884 header_ http.Header
9885 }
9886
9887 // Patch: Updates the parameters of the specified `LbEdgeExtension` resource.
9888 //
9889 // - name: Identifier. Name of the `LbEdgeExtension` resource in the following
9890 // format:
9891 // `projects/{project}/locations/{location}/lbEdgeExtensions/{lb_edge_extensio
9892 // n}`.
9893 func (r *ProjectsLocationsLbEdgeExtensionsService) Patch(name string, lbedgeextension *LbEdgeExtension) *ProjectsLocationsLbEdgeExtensionsPatchCall {
9894 c := &ProjectsLocationsLbEdgeExtensionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9895 c.name = name
9896 c.lbedgeextension = lbedgeextension
9897 return c
9898 }
9899
9900 // RequestId sets the optional parameter "requestId": An optional request ID to
9901 // identify requests. Specify a unique request ID so that if you must retry
9902 // your request, the server can ignore the request if it has already been
9903 // completed. The server guarantees that for 60 minutes since the first
9904 // request. For example, consider a situation where you make an initial request
9905 // and the request times out. If you make the request again with the same
9906 // request ID, the server ignores the second request This prevents clients from
9907 // accidentally creating duplicate commitments. The request ID must be a valid
9908 // UUID with the exception that zero UUID is not supported
9909 // (00000000-0000-0000-0000-000000000000).
9910 func (c *ProjectsLocationsLbEdgeExtensionsPatchCall) RequestId(requestId string) *ProjectsLocationsLbEdgeExtensionsPatchCall {
9911 c.urlParams_.Set("requestId", requestId)
9912 return c
9913 }
9914
9915 // UpdateMask sets the optional parameter "updateMask": Used to specify the
9916 // fields to be overwritten in the `LbEdgeExtension` resource by the update.
9917 // The fields specified in the `update_mask` are relative to the resource, not
9918 // the full request. A field is overwritten if it is in the mask. If the user
9919 // does not specify a mask, then all fields are overwritten.
9920 func (c *ProjectsLocationsLbEdgeExtensionsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsLbEdgeExtensionsPatchCall {
9921 c.urlParams_.Set("updateMask", updateMask)
9922 return c
9923 }
9924
9925 // Fields allows partial responses to be retrieved. See
9926 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9927 // details.
9928 func (c *ProjectsLocationsLbEdgeExtensionsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbEdgeExtensionsPatchCall {
9929 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9930 return c
9931 }
9932
9933 // Context sets the context to be used in this call's Do method.
9934 func (c *ProjectsLocationsLbEdgeExtensionsPatchCall) Context(ctx context.Context) *ProjectsLocationsLbEdgeExtensionsPatchCall {
9935 c.ctx_ = ctx
9936 return c
9937 }
9938
9939 // Header returns a http.Header that can be modified by the caller to add
9940 // headers to the request.
9941 func (c *ProjectsLocationsLbEdgeExtensionsPatchCall) Header() http.Header {
9942 if c.header_ == nil {
9943 c.header_ = make(http.Header)
9944 }
9945 return c.header_
9946 }
9947
9948 func (c *ProjectsLocationsLbEdgeExtensionsPatchCall) doRequest(alt string) (*http.Response, error) {
9949 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9950 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lbedgeextension)
9951 if err != nil {
9952 return nil, err
9953 }
9954 c.urlParams_.Set("alt", alt)
9955 c.urlParams_.Set("prettyPrint", "false")
9956 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
9957 urls += "?" + c.urlParams_.Encode()
9958 req, err := http.NewRequest("PATCH", urls, body)
9959 if err != nil {
9960 return nil, err
9961 }
9962 req.Header = reqHeaders
9963 googleapi.Expand(req.URL, map[string]string{
9964 "name": c.name,
9965 })
9966 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbEdgeExtensions.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
9967 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9968 }
9969
9970 // Do executes the "networkservices.projects.locations.lbEdgeExtensions.patch" call.
9971 // Any non-2xx status code is an error. Response headers are in either
9972 // *Operation.ServerResponse.Header or (if a response was returned at all) in
9973 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
9974 // whether the returned error was because http.StatusNotModified was returned.
9975 func (c *ProjectsLocationsLbEdgeExtensionsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
9976 gensupport.SetOptions(c.urlParams_, opts...)
9977 res, err := c.doRequest("json")
9978 if res != nil && res.StatusCode == http.StatusNotModified {
9979 if res.Body != nil {
9980 res.Body.Close()
9981 }
9982 return nil, gensupport.WrapError(&googleapi.Error{
9983 Code: res.StatusCode,
9984 Header: res.Header,
9985 })
9986 }
9987 if err != nil {
9988 return nil, err
9989 }
9990 defer googleapi.CloseBody(res)
9991 if err := googleapi.CheckResponse(res); err != nil {
9992 return nil, gensupport.WrapError(err)
9993 }
9994 ret := &Operation{
9995 ServerResponse: googleapi.ServerResponse{
9996 Header: res.Header,
9997 HTTPStatusCode: res.StatusCode,
9998 },
9999 }
10000 target := &ret
10001 b, err := gensupport.DecodeResponseBytes(target, res)
10002 if err != nil {
10003 return nil, err
10004 }
10005 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbEdgeExtensions.patch", "response", internallog.HTTPResponse(res, b))
10006 return ret, nil
10007 }
10008
10009 type ProjectsLocationsLbRouteExtensionsCreateCall struct {
10010 s *Service
10011 parent string
10012 lbrouteextension *LbRouteExtension
10013 urlParams_ gensupport.URLParams
10014 ctx_ context.Context
10015 header_ http.Header
10016 }
10017
10018 // Create: Creates a new `LbRouteExtension` resource in a given project and
10019 // location.
10020 //
10021 // - parent: The parent resource of the `LbRouteExtension` resource. Must be in
10022 // the format `projects/{project}/locations/{location}`.
10023 func (r *ProjectsLocationsLbRouteExtensionsService) Create(parent string, lbrouteextension *LbRouteExtension) *ProjectsLocationsLbRouteExtensionsCreateCall {
10024 c := &ProjectsLocationsLbRouteExtensionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10025 c.parent = parent
10026 c.lbrouteextension = lbrouteextension
10027 return c
10028 }
10029
10030 // LbRouteExtensionId sets the optional parameter "lbRouteExtensionId":
10031 // Required. User-provided ID of the `LbRouteExtension` resource to be created.
10032 func (c *ProjectsLocationsLbRouteExtensionsCreateCall) LbRouteExtensionId(lbRouteExtensionId string) *ProjectsLocationsLbRouteExtensionsCreateCall {
10033 c.urlParams_.Set("lbRouteExtensionId", lbRouteExtensionId)
10034 return c
10035 }
10036
10037 // RequestId sets the optional parameter "requestId": An optional request ID to
10038 // identify requests. Specify a unique request ID so that if you must retry
10039 // your request, the server can ignore the request if it has already been
10040 // completed. The server guarantees that for 60 minutes since the first
10041 // request. For example, consider a situation where you make an initial request
10042 // and the request times out. If you make the request again with the same
10043 // request ID, the server ignores the second request This prevents clients from
10044 // accidentally creating duplicate commitments. The request ID must be a valid
10045 // UUID with the exception that zero UUID is not supported
10046 // (00000000-0000-0000-0000-000000000000).
10047 func (c *ProjectsLocationsLbRouteExtensionsCreateCall) RequestId(requestId string) *ProjectsLocationsLbRouteExtensionsCreateCall {
10048 c.urlParams_.Set("requestId", requestId)
10049 return c
10050 }
10051
10052 // Fields allows partial responses to be retrieved. See
10053 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10054 // details.
10055 func (c *ProjectsLocationsLbRouteExtensionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbRouteExtensionsCreateCall {
10056 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10057 return c
10058 }
10059
10060 // Context sets the context to be used in this call's Do method.
10061 func (c *ProjectsLocationsLbRouteExtensionsCreateCall) Context(ctx context.Context) *ProjectsLocationsLbRouteExtensionsCreateCall {
10062 c.ctx_ = ctx
10063 return c
10064 }
10065
10066 // Header returns a http.Header that can be modified by the caller to add
10067 // headers to the request.
10068 func (c *ProjectsLocationsLbRouteExtensionsCreateCall) Header() http.Header {
10069 if c.header_ == nil {
10070 c.header_ = make(http.Header)
10071 }
10072 return c.header_
10073 }
10074
10075 func (c *ProjectsLocationsLbRouteExtensionsCreateCall) doRequest(alt string) (*http.Response, error) {
10076 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
10077 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lbrouteextension)
10078 if err != nil {
10079 return nil, err
10080 }
10081 c.urlParams_.Set("alt", alt)
10082 c.urlParams_.Set("prettyPrint", "false")
10083 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/lbRouteExtensions")
10084 urls += "?" + c.urlParams_.Encode()
10085 req, err := http.NewRequest("POST", urls, body)
10086 if err != nil {
10087 return nil, err
10088 }
10089 req.Header = reqHeaders
10090 googleapi.Expand(req.URL, map[string]string{
10091 "parent": c.parent,
10092 })
10093 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbRouteExtensions.create", "request", internallog.HTTPRequest(req, body.Bytes()))
10094 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10095 }
10096
10097 // Do executes the "networkservices.projects.locations.lbRouteExtensions.create" call.
10098 // Any non-2xx status code is an error. Response headers are in either
10099 // *Operation.ServerResponse.Header or (if a response was returned at all) in
10100 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
10101 // whether the returned error was because http.StatusNotModified was returned.
10102 func (c *ProjectsLocationsLbRouteExtensionsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
10103 gensupport.SetOptions(c.urlParams_, opts...)
10104 res, err := c.doRequest("json")
10105 if res != nil && res.StatusCode == http.StatusNotModified {
10106 if res.Body != nil {
10107 res.Body.Close()
10108 }
10109 return nil, gensupport.WrapError(&googleapi.Error{
10110 Code: res.StatusCode,
10111 Header: res.Header,
10112 })
10113 }
10114 if err != nil {
10115 return nil, err
10116 }
10117 defer googleapi.CloseBody(res)
10118 if err := googleapi.CheckResponse(res); err != nil {
10119 return nil, gensupport.WrapError(err)
10120 }
10121 ret := &Operation{
10122 ServerResponse: googleapi.ServerResponse{
10123 Header: res.Header,
10124 HTTPStatusCode: res.StatusCode,
10125 },
10126 }
10127 target := &ret
10128 b, err := gensupport.DecodeResponseBytes(target, res)
10129 if err != nil {
10130 return nil, err
10131 }
10132 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbRouteExtensions.create", "response", internallog.HTTPResponse(res, b))
10133 return ret, nil
10134 }
10135
10136 type ProjectsLocationsLbRouteExtensionsDeleteCall struct {
10137 s *Service
10138 name string
10139 urlParams_ gensupport.URLParams
10140 ctx_ context.Context
10141 header_ http.Header
10142 }
10143
10144 // Delete: Deletes the specified `LbRouteExtension` resource.
10145 //
10146 // - name: The name of the `LbRouteExtension` resource to delete. Must be in
10147 // the format
10148 // `projects/{project}/locations/{location}/lbRouteExtensions/{lb_route_extens
10149 // ion}`.
10150 func (r *ProjectsLocationsLbRouteExtensionsService) Delete(name string) *ProjectsLocationsLbRouteExtensionsDeleteCall {
10151 c := &ProjectsLocationsLbRouteExtensionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10152 c.name = name
10153 return c
10154 }
10155
10156 // RequestId sets the optional parameter "requestId": An optional request ID to
10157 // identify requests. Specify a unique request ID so that if you must retry
10158 // your request, the server can ignore the request if it has already been
10159 // completed. The server guarantees that for 60 minutes after the first
10160 // request. For example, consider a situation where you make an initial request
10161 // and the request times out. If you make the request again with the same
10162 // request ID, the server ignores the second request This prevents clients from
10163 // accidentally creating duplicate commitments. The request ID must be a valid
10164 // UUID with the exception that zero UUID is not supported
10165 // (00000000-0000-0000-0000-000000000000).
10166 func (c *ProjectsLocationsLbRouteExtensionsDeleteCall) RequestId(requestId string) *ProjectsLocationsLbRouteExtensionsDeleteCall {
10167 c.urlParams_.Set("requestId", requestId)
10168 return c
10169 }
10170
10171 // Fields allows partial responses to be retrieved. See
10172 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10173 // details.
10174 func (c *ProjectsLocationsLbRouteExtensionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbRouteExtensionsDeleteCall {
10175 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10176 return c
10177 }
10178
10179 // Context sets the context to be used in this call's Do method.
10180 func (c *ProjectsLocationsLbRouteExtensionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsLbRouteExtensionsDeleteCall {
10181 c.ctx_ = ctx
10182 return c
10183 }
10184
10185 // Header returns a http.Header that can be modified by the caller to add
10186 // headers to the request.
10187 func (c *ProjectsLocationsLbRouteExtensionsDeleteCall) Header() http.Header {
10188 if c.header_ == nil {
10189 c.header_ = make(http.Header)
10190 }
10191 return c.header_
10192 }
10193
10194 func (c *ProjectsLocationsLbRouteExtensionsDeleteCall) doRequest(alt string) (*http.Response, error) {
10195 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
10196 c.urlParams_.Set("alt", alt)
10197 c.urlParams_.Set("prettyPrint", "false")
10198 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
10199 urls += "?" + c.urlParams_.Encode()
10200 req, err := http.NewRequest("DELETE", urls, nil)
10201 if err != nil {
10202 return nil, err
10203 }
10204 req.Header = reqHeaders
10205 googleapi.Expand(req.URL, map[string]string{
10206 "name": c.name,
10207 })
10208 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbRouteExtensions.delete", "request", internallog.HTTPRequest(req, nil))
10209 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10210 }
10211
10212 // Do executes the "networkservices.projects.locations.lbRouteExtensions.delete" call.
10213 // Any non-2xx status code is an error. Response headers are in either
10214 // *Operation.ServerResponse.Header or (if a response was returned at all) in
10215 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
10216 // whether the returned error was because http.StatusNotModified was returned.
10217 func (c *ProjectsLocationsLbRouteExtensionsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
10218 gensupport.SetOptions(c.urlParams_, opts...)
10219 res, err := c.doRequest("json")
10220 if res != nil && res.StatusCode == http.StatusNotModified {
10221 if res.Body != nil {
10222 res.Body.Close()
10223 }
10224 return nil, gensupport.WrapError(&googleapi.Error{
10225 Code: res.StatusCode,
10226 Header: res.Header,
10227 })
10228 }
10229 if err != nil {
10230 return nil, err
10231 }
10232 defer googleapi.CloseBody(res)
10233 if err := googleapi.CheckResponse(res); err != nil {
10234 return nil, gensupport.WrapError(err)
10235 }
10236 ret := &Operation{
10237 ServerResponse: googleapi.ServerResponse{
10238 Header: res.Header,
10239 HTTPStatusCode: res.StatusCode,
10240 },
10241 }
10242 target := &ret
10243 b, err := gensupport.DecodeResponseBytes(target, res)
10244 if err != nil {
10245 return nil, err
10246 }
10247 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbRouteExtensions.delete", "response", internallog.HTTPResponse(res, b))
10248 return ret, nil
10249 }
10250
10251 type ProjectsLocationsLbRouteExtensionsGetCall struct {
10252 s *Service
10253 name string
10254 urlParams_ gensupport.URLParams
10255 ifNoneMatch_ string
10256 ctx_ context.Context
10257 header_ http.Header
10258 }
10259
10260 // Get: Gets details of the specified `LbRouteExtension` resource.
10261 //
10262 // - name: A name of the `LbRouteExtension` resource to get. Must be in the
10263 // format
10264 // `projects/{project}/locations/{location}/lbRouteExtensions/{lb_route_extens
10265 // ion}`.
10266 func (r *ProjectsLocationsLbRouteExtensionsService) Get(name string) *ProjectsLocationsLbRouteExtensionsGetCall {
10267 c := &ProjectsLocationsLbRouteExtensionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10268 c.name = name
10269 return c
10270 }
10271
10272 // Fields allows partial responses to be retrieved. See
10273 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10274 // details.
10275 func (c *ProjectsLocationsLbRouteExtensionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbRouteExtensionsGetCall {
10276 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10277 return c
10278 }
10279
10280 // IfNoneMatch sets an optional parameter which makes the operation fail if the
10281 // object's ETag matches the given value. This is useful for getting updates
10282 // only after the object has changed since the last request.
10283 func (c *ProjectsLocationsLbRouteExtensionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsLbRouteExtensionsGetCall {
10284 c.ifNoneMatch_ = entityTag
10285 return c
10286 }
10287
10288 // Context sets the context to be used in this call's Do method.
10289 func (c *ProjectsLocationsLbRouteExtensionsGetCall) Context(ctx context.Context) *ProjectsLocationsLbRouteExtensionsGetCall {
10290 c.ctx_ = ctx
10291 return c
10292 }
10293
10294 // Header returns a http.Header that can be modified by the caller to add
10295 // headers to the request.
10296 func (c *ProjectsLocationsLbRouteExtensionsGetCall) Header() http.Header {
10297 if c.header_ == nil {
10298 c.header_ = make(http.Header)
10299 }
10300 return c.header_
10301 }
10302
10303 func (c *ProjectsLocationsLbRouteExtensionsGetCall) doRequest(alt string) (*http.Response, error) {
10304 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
10305 if c.ifNoneMatch_ != "" {
10306 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10307 }
10308 c.urlParams_.Set("alt", alt)
10309 c.urlParams_.Set("prettyPrint", "false")
10310 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
10311 urls += "?" + c.urlParams_.Encode()
10312 req, err := http.NewRequest("GET", urls, nil)
10313 if err != nil {
10314 return nil, err
10315 }
10316 req.Header = reqHeaders
10317 googleapi.Expand(req.URL, map[string]string{
10318 "name": c.name,
10319 })
10320 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbRouteExtensions.get", "request", internallog.HTTPRequest(req, nil))
10321 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10322 }
10323
10324 // Do executes the "networkservices.projects.locations.lbRouteExtensions.get" call.
10325 // Any non-2xx status code is an error. Response headers are in either
10326 // *LbRouteExtension.ServerResponse.Header or (if a response was returned at
10327 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
10328 // check whether the returned error was because http.StatusNotModified was
10329 // returned.
10330 func (c *ProjectsLocationsLbRouteExtensionsGetCall) Do(opts ...googleapi.CallOption) (*LbRouteExtension, error) {
10331 gensupport.SetOptions(c.urlParams_, opts...)
10332 res, err := c.doRequest("json")
10333 if res != nil && res.StatusCode == http.StatusNotModified {
10334 if res.Body != nil {
10335 res.Body.Close()
10336 }
10337 return nil, gensupport.WrapError(&googleapi.Error{
10338 Code: res.StatusCode,
10339 Header: res.Header,
10340 })
10341 }
10342 if err != nil {
10343 return nil, err
10344 }
10345 defer googleapi.CloseBody(res)
10346 if err := googleapi.CheckResponse(res); err != nil {
10347 return nil, gensupport.WrapError(err)
10348 }
10349 ret := &LbRouteExtension{
10350 ServerResponse: googleapi.ServerResponse{
10351 Header: res.Header,
10352 HTTPStatusCode: res.StatusCode,
10353 },
10354 }
10355 target := &ret
10356 b, err := gensupport.DecodeResponseBytes(target, res)
10357 if err != nil {
10358 return nil, err
10359 }
10360 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbRouteExtensions.get", "response", internallog.HTTPResponse(res, b))
10361 return ret, nil
10362 }
10363
10364 type ProjectsLocationsLbRouteExtensionsListCall struct {
10365 s *Service
10366 parent string
10367 urlParams_ gensupport.URLParams
10368 ifNoneMatch_ string
10369 ctx_ context.Context
10370 header_ http.Header
10371 }
10372
10373 // List: Lists `LbRouteExtension` resources in a given project and location.
10374 //
10375 // - parent: The project and location from which the `LbRouteExtension`
10376 // resources are listed. These values are specified in the following format:
10377 // `projects/{project}/locations/{location}`.
10378 func (r *ProjectsLocationsLbRouteExtensionsService) List(parent string) *ProjectsLocationsLbRouteExtensionsListCall {
10379 c := &ProjectsLocationsLbRouteExtensionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10380 c.parent = parent
10381 return c
10382 }
10383
10384 // Filter sets the optional parameter "filter": Filtering results.
10385 func (c *ProjectsLocationsLbRouteExtensionsListCall) Filter(filter string) *ProjectsLocationsLbRouteExtensionsListCall {
10386 c.urlParams_.Set("filter", filter)
10387 return c
10388 }
10389
10390 // OrderBy sets the optional parameter "orderBy": Hint about how to order the
10391 // results.
10392 func (c *ProjectsLocationsLbRouteExtensionsListCall) OrderBy(orderBy string) *ProjectsLocationsLbRouteExtensionsListCall {
10393 c.urlParams_.Set("orderBy", orderBy)
10394 return c
10395 }
10396
10397 // PageSize sets the optional parameter "pageSize": Requested page size. The
10398 // server might return fewer items than requested. If unspecified, the server
10399 // picks an appropriate default.
10400 func (c *ProjectsLocationsLbRouteExtensionsListCall) PageSize(pageSize int64) *ProjectsLocationsLbRouteExtensionsListCall {
10401 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
10402 return c
10403 }
10404
10405 // PageToken sets the optional parameter "pageToken": A token identifying a
10406 // page of results that the server returns.
10407 func (c *ProjectsLocationsLbRouteExtensionsListCall) PageToken(pageToken string) *ProjectsLocationsLbRouteExtensionsListCall {
10408 c.urlParams_.Set("pageToken", pageToken)
10409 return c
10410 }
10411
10412 // Fields allows partial responses to be retrieved. See
10413 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10414 // details.
10415 func (c *ProjectsLocationsLbRouteExtensionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbRouteExtensionsListCall {
10416 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10417 return c
10418 }
10419
10420 // IfNoneMatch sets an optional parameter which makes the operation fail if the
10421 // object's ETag matches the given value. This is useful for getting updates
10422 // only after the object has changed since the last request.
10423 func (c *ProjectsLocationsLbRouteExtensionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsLbRouteExtensionsListCall {
10424 c.ifNoneMatch_ = entityTag
10425 return c
10426 }
10427
10428 // Context sets the context to be used in this call's Do method.
10429 func (c *ProjectsLocationsLbRouteExtensionsListCall) Context(ctx context.Context) *ProjectsLocationsLbRouteExtensionsListCall {
10430 c.ctx_ = ctx
10431 return c
10432 }
10433
10434 // Header returns a http.Header that can be modified by the caller to add
10435 // headers to the request.
10436 func (c *ProjectsLocationsLbRouteExtensionsListCall) Header() http.Header {
10437 if c.header_ == nil {
10438 c.header_ = make(http.Header)
10439 }
10440 return c.header_
10441 }
10442
10443 func (c *ProjectsLocationsLbRouteExtensionsListCall) doRequest(alt string) (*http.Response, error) {
10444 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
10445 if c.ifNoneMatch_ != "" {
10446 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10447 }
10448 c.urlParams_.Set("alt", alt)
10449 c.urlParams_.Set("prettyPrint", "false")
10450 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/lbRouteExtensions")
10451 urls += "?" + c.urlParams_.Encode()
10452 req, err := http.NewRequest("GET", urls, nil)
10453 if err != nil {
10454 return nil, err
10455 }
10456 req.Header = reqHeaders
10457 googleapi.Expand(req.URL, map[string]string{
10458 "parent": c.parent,
10459 })
10460 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbRouteExtensions.list", "request", internallog.HTTPRequest(req, nil))
10461 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10462 }
10463
10464 // Do executes the "networkservices.projects.locations.lbRouteExtensions.list" call.
10465 // Any non-2xx status code is an error. Response headers are in either
10466 // *ListLbRouteExtensionsResponse.ServerResponse.Header or (if a response was
10467 // returned at all) in error.(*googleapi.Error).Header. Use
10468 // googleapi.IsNotModified to check whether the returned error was because
10469 // http.StatusNotModified was returned.
10470 func (c *ProjectsLocationsLbRouteExtensionsListCall) Do(opts ...googleapi.CallOption) (*ListLbRouteExtensionsResponse, error) {
10471 gensupport.SetOptions(c.urlParams_, opts...)
10472 res, err := c.doRequest("json")
10473 if res != nil && res.StatusCode == http.StatusNotModified {
10474 if res.Body != nil {
10475 res.Body.Close()
10476 }
10477 return nil, gensupport.WrapError(&googleapi.Error{
10478 Code: res.StatusCode,
10479 Header: res.Header,
10480 })
10481 }
10482 if err != nil {
10483 return nil, err
10484 }
10485 defer googleapi.CloseBody(res)
10486 if err := googleapi.CheckResponse(res); err != nil {
10487 return nil, gensupport.WrapError(err)
10488 }
10489 ret := &ListLbRouteExtensionsResponse{
10490 ServerResponse: googleapi.ServerResponse{
10491 Header: res.Header,
10492 HTTPStatusCode: res.StatusCode,
10493 },
10494 }
10495 target := &ret
10496 b, err := gensupport.DecodeResponseBytes(target, res)
10497 if err != nil {
10498 return nil, err
10499 }
10500 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbRouteExtensions.list", "response", internallog.HTTPResponse(res, b))
10501 return ret, nil
10502 }
10503
10504 // Pages invokes f for each page of results.
10505 // A non-nil error returned from f will halt the iteration.
10506 // The provided context supersedes any context provided to the Context method.
10507 func (c *ProjectsLocationsLbRouteExtensionsListCall) Pages(ctx context.Context, f func(*ListLbRouteExtensionsResponse) error) error {
10508 c.ctx_ = ctx
10509 defer c.PageToken(c.urlParams_.Get("pageToken"))
10510 for {
10511 x, err := c.Do()
10512 if err != nil {
10513 return err
10514 }
10515 if err := f(x); err != nil {
10516 return err
10517 }
10518 if x.NextPageToken == "" {
10519 return nil
10520 }
10521 c.PageToken(x.NextPageToken)
10522 }
10523 }
10524
10525 type ProjectsLocationsLbRouteExtensionsPatchCall struct {
10526 s *Service
10527 name string
10528 lbrouteextension *LbRouteExtension
10529 urlParams_ gensupport.URLParams
10530 ctx_ context.Context
10531 header_ http.Header
10532 }
10533
10534 // Patch: Updates the parameters of the specified `LbRouteExtension` resource.
10535 //
10536 // - name: Identifier. Name of the `LbRouteExtension` resource in the following
10537 // format:
10538 // `projects/{project}/locations/{location}/lbRouteExtensions/{lb_route_extens
10539 // ion}`.
10540 func (r *ProjectsLocationsLbRouteExtensionsService) Patch(name string, lbrouteextension *LbRouteExtension) *ProjectsLocationsLbRouteExtensionsPatchCall {
10541 c := &ProjectsLocationsLbRouteExtensionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10542 c.name = name
10543 c.lbrouteextension = lbrouteextension
10544 return c
10545 }
10546
10547 // RequestId sets the optional parameter "requestId": An optional request ID to
10548 // identify requests. Specify a unique request ID so that if you must retry
10549 // your request, the server can ignore the request if it has already been
10550 // completed. The server guarantees that for 60 minutes since the first
10551 // request. For example, consider a situation where you make an initial request
10552 // and the request times out. If you make the request again with the same
10553 // request ID, the server ignores the second request This prevents clients from
10554 // accidentally creating duplicate commitments. The request ID must be a valid
10555 // UUID with the exception that zero UUID is not supported
10556 // (00000000-0000-0000-0000-000000000000).
10557 func (c *ProjectsLocationsLbRouteExtensionsPatchCall) RequestId(requestId string) *ProjectsLocationsLbRouteExtensionsPatchCall {
10558 c.urlParams_.Set("requestId", requestId)
10559 return c
10560 }
10561
10562 // UpdateMask sets the optional parameter "updateMask": Used to specify the
10563 // fields to be overwritten in the `LbRouteExtension` resource by the update.
10564 // The fields specified in the `update_mask` are relative to the resource, not
10565 // the full request. A field is overwritten if it is in the mask. If the user
10566 // does not specify a mask, then all fields are overwritten.
10567 func (c *ProjectsLocationsLbRouteExtensionsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsLbRouteExtensionsPatchCall {
10568 c.urlParams_.Set("updateMask", updateMask)
10569 return c
10570 }
10571
10572 // Fields allows partial responses to be retrieved. See
10573 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10574 // details.
10575 func (c *ProjectsLocationsLbRouteExtensionsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbRouteExtensionsPatchCall {
10576 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10577 return c
10578 }
10579
10580 // Context sets the context to be used in this call's Do method.
10581 func (c *ProjectsLocationsLbRouteExtensionsPatchCall) Context(ctx context.Context) *ProjectsLocationsLbRouteExtensionsPatchCall {
10582 c.ctx_ = ctx
10583 return c
10584 }
10585
10586 // Header returns a http.Header that can be modified by the caller to add
10587 // headers to the request.
10588 func (c *ProjectsLocationsLbRouteExtensionsPatchCall) Header() http.Header {
10589 if c.header_ == nil {
10590 c.header_ = make(http.Header)
10591 }
10592 return c.header_
10593 }
10594
10595 func (c *ProjectsLocationsLbRouteExtensionsPatchCall) doRequest(alt string) (*http.Response, error) {
10596 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
10597 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lbrouteextension)
10598 if err != nil {
10599 return nil, err
10600 }
10601 c.urlParams_.Set("alt", alt)
10602 c.urlParams_.Set("prettyPrint", "false")
10603 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
10604 urls += "?" + c.urlParams_.Encode()
10605 req, err := http.NewRequest("PATCH", urls, body)
10606 if err != nil {
10607 return nil, err
10608 }
10609 req.Header = reqHeaders
10610 googleapi.Expand(req.URL, map[string]string{
10611 "name": c.name,
10612 })
10613 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbRouteExtensions.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
10614 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10615 }
10616
10617 // Do executes the "networkservices.projects.locations.lbRouteExtensions.patch" call.
10618 // Any non-2xx status code is an error. Response headers are in either
10619 // *Operation.ServerResponse.Header or (if a response was returned at all) in
10620 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
10621 // whether the returned error was because http.StatusNotModified was returned.
10622 func (c *ProjectsLocationsLbRouteExtensionsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
10623 gensupport.SetOptions(c.urlParams_, opts...)
10624 res, err := c.doRequest("json")
10625 if res != nil && res.StatusCode == http.StatusNotModified {
10626 if res.Body != nil {
10627 res.Body.Close()
10628 }
10629 return nil, gensupport.WrapError(&googleapi.Error{
10630 Code: res.StatusCode,
10631 Header: res.Header,
10632 })
10633 }
10634 if err != nil {
10635 return nil, err
10636 }
10637 defer googleapi.CloseBody(res)
10638 if err := googleapi.CheckResponse(res); err != nil {
10639 return nil, gensupport.WrapError(err)
10640 }
10641 ret := &Operation{
10642 ServerResponse: googleapi.ServerResponse{
10643 Header: res.Header,
10644 HTTPStatusCode: res.StatusCode,
10645 },
10646 }
10647 target := &ret
10648 b, err := gensupport.DecodeResponseBytes(target, res)
10649 if err != nil {
10650 return nil, err
10651 }
10652 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbRouteExtensions.patch", "response", internallog.HTTPResponse(res, b))
10653 return ret, nil
10654 }
10655
10656 type ProjectsLocationsLbTrafficExtensionsCreateCall struct {
10657 s *Service
10658 parent string
10659 lbtrafficextension *LbTrafficExtension
10660 urlParams_ gensupport.URLParams
10661 ctx_ context.Context
10662 header_ http.Header
10663 }
10664
10665 // Create: Creates a new `LbTrafficExtension` resource in a given project and
10666 // location.
10667 //
10668 // - parent: The parent resource of the `LbTrafficExtension` resource. Must be
10669 // in the format `projects/{project}/locations/{location}`.
10670 func (r *ProjectsLocationsLbTrafficExtensionsService) Create(parent string, lbtrafficextension *LbTrafficExtension) *ProjectsLocationsLbTrafficExtensionsCreateCall {
10671 c := &ProjectsLocationsLbTrafficExtensionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10672 c.parent = parent
10673 c.lbtrafficextension = lbtrafficextension
10674 return c
10675 }
10676
10677 // LbTrafficExtensionId sets the optional parameter "lbTrafficExtensionId":
10678 // Required. User-provided ID of the `LbTrafficExtension` resource to be
10679 // created.
10680 func (c *ProjectsLocationsLbTrafficExtensionsCreateCall) LbTrafficExtensionId(lbTrafficExtensionId string) *ProjectsLocationsLbTrafficExtensionsCreateCall {
10681 c.urlParams_.Set("lbTrafficExtensionId", lbTrafficExtensionId)
10682 return c
10683 }
10684
10685 // RequestId sets the optional parameter "requestId": An optional request ID to
10686 // identify requests. Specify a unique request ID so that if you must retry
10687 // your request, the server can ignore the request if it has already been
10688 // completed. The server guarantees that for 60 minutes since the first
10689 // request. For example, consider a situation where you make an initial request
10690 // and the request times out. If you make the request again with the same
10691 // request ID, the server ignores the second request This prevents clients from
10692 // accidentally creating duplicate commitments. The request ID must be a valid
10693 // UUID with the exception that zero UUID is not supported
10694 // (00000000-0000-0000-0000-000000000000).
10695 func (c *ProjectsLocationsLbTrafficExtensionsCreateCall) RequestId(requestId string) *ProjectsLocationsLbTrafficExtensionsCreateCall {
10696 c.urlParams_.Set("requestId", requestId)
10697 return c
10698 }
10699
10700 // Fields allows partial responses to be retrieved. See
10701 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10702 // details.
10703 func (c *ProjectsLocationsLbTrafficExtensionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbTrafficExtensionsCreateCall {
10704 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10705 return c
10706 }
10707
10708 // Context sets the context to be used in this call's Do method.
10709 func (c *ProjectsLocationsLbTrafficExtensionsCreateCall) Context(ctx context.Context) *ProjectsLocationsLbTrafficExtensionsCreateCall {
10710 c.ctx_ = ctx
10711 return c
10712 }
10713
10714 // Header returns a http.Header that can be modified by the caller to add
10715 // headers to the request.
10716 func (c *ProjectsLocationsLbTrafficExtensionsCreateCall) Header() http.Header {
10717 if c.header_ == nil {
10718 c.header_ = make(http.Header)
10719 }
10720 return c.header_
10721 }
10722
10723 func (c *ProjectsLocationsLbTrafficExtensionsCreateCall) doRequest(alt string) (*http.Response, error) {
10724 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
10725 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lbtrafficextension)
10726 if err != nil {
10727 return nil, err
10728 }
10729 c.urlParams_.Set("alt", alt)
10730 c.urlParams_.Set("prettyPrint", "false")
10731 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/lbTrafficExtensions")
10732 urls += "?" + c.urlParams_.Encode()
10733 req, err := http.NewRequest("POST", urls, body)
10734 if err != nil {
10735 return nil, err
10736 }
10737 req.Header = reqHeaders
10738 googleapi.Expand(req.URL, map[string]string{
10739 "parent": c.parent,
10740 })
10741 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTrafficExtensions.create", "request", internallog.HTTPRequest(req, body.Bytes()))
10742 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10743 }
10744
10745 // Do executes the "networkservices.projects.locations.lbTrafficExtensions.create" call.
10746 // Any non-2xx status code is an error. Response headers are in either
10747 // *Operation.ServerResponse.Header or (if a response was returned at all) in
10748 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
10749 // whether the returned error was because http.StatusNotModified was returned.
10750 func (c *ProjectsLocationsLbTrafficExtensionsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
10751 gensupport.SetOptions(c.urlParams_, opts...)
10752 res, err := c.doRequest("json")
10753 if res != nil && res.StatusCode == http.StatusNotModified {
10754 if res.Body != nil {
10755 res.Body.Close()
10756 }
10757 return nil, gensupport.WrapError(&googleapi.Error{
10758 Code: res.StatusCode,
10759 Header: res.Header,
10760 })
10761 }
10762 if err != nil {
10763 return nil, err
10764 }
10765 defer googleapi.CloseBody(res)
10766 if err := googleapi.CheckResponse(res); err != nil {
10767 return nil, gensupport.WrapError(err)
10768 }
10769 ret := &Operation{
10770 ServerResponse: googleapi.ServerResponse{
10771 Header: res.Header,
10772 HTTPStatusCode: res.StatusCode,
10773 },
10774 }
10775 target := &ret
10776 b, err := gensupport.DecodeResponseBytes(target, res)
10777 if err != nil {
10778 return nil, err
10779 }
10780 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTrafficExtensions.create", "response", internallog.HTTPResponse(res, b))
10781 return ret, nil
10782 }
10783
10784 type ProjectsLocationsLbTrafficExtensionsDeleteCall struct {
10785 s *Service
10786 name string
10787 urlParams_ gensupport.URLParams
10788 ctx_ context.Context
10789 header_ http.Header
10790 }
10791
10792 // Delete: Deletes the specified `LbTrafficExtension` resource.
10793 //
10794 // - name: The name of the `LbTrafficExtension` resource to delete. Must be in
10795 // the format
10796 // `projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_ex
10797 // tension}`.
10798 func (r *ProjectsLocationsLbTrafficExtensionsService) Delete(name string) *ProjectsLocationsLbTrafficExtensionsDeleteCall {
10799 c := &ProjectsLocationsLbTrafficExtensionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10800 c.name = name
10801 return c
10802 }
10803
10804 // RequestId sets the optional parameter "requestId": An optional request ID to
10805 // identify requests. Specify a unique request ID so that if you must retry
10806 // your request, the server can ignore the request if it has already been
10807 // completed. The server guarantees that for 60 minutes after the first
10808 // request. For example, consider a situation where you make an initial request
10809 // and the request times out. If you make the request again with the same
10810 // request ID, the server ignores the second request This prevents clients from
10811 // accidentally creating duplicate commitments. The request ID must be a valid
10812 // UUID with the exception that zero UUID is not supported
10813 // (00000000-0000-0000-0000-000000000000).
10814 func (c *ProjectsLocationsLbTrafficExtensionsDeleteCall) RequestId(requestId string) *ProjectsLocationsLbTrafficExtensionsDeleteCall {
10815 c.urlParams_.Set("requestId", requestId)
10816 return c
10817 }
10818
10819 // Fields allows partial responses to be retrieved. See
10820 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10821 // details.
10822 func (c *ProjectsLocationsLbTrafficExtensionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbTrafficExtensionsDeleteCall {
10823 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10824 return c
10825 }
10826
10827 // Context sets the context to be used in this call's Do method.
10828 func (c *ProjectsLocationsLbTrafficExtensionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsLbTrafficExtensionsDeleteCall {
10829 c.ctx_ = ctx
10830 return c
10831 }
10832
10833 // Header returns a http.Header that can be modified by the caller to add
10834 // headers to the request.
10835 func (c *ProjectsLocationsLbTrafficExtensionsDeleteCall) Header() http.Header {
10836 if c.header_ == nil {
10837 c.header_ = make(http.Header)
10838 }
10839 return c.header_
10840 }
10841
10842 func (c *ProjectsLocationsLbTrafficExtensionsDeleteCall) doRequest(alt string) (*http.Response, error) {
10843 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
10844 c.urlParams_.Set("alt", alt)
10845 c.urlParams_.Set("prettyPrint", "false")
10846 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
10847 urls += "?" + c.urlParams_.Encode()
10848 req, err := http.NewRequest("DELETE", urls, nil)
10849 if err != nil {
10850 return nil, err
10851 }
10852 req.Header = reqHeaders
10853 googleapi.Expand(req.URL, map[string]string{
10854 "name": c.name,
10855 })
10856 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTrafficExtensions.delete", "request", internallog.HTTPRequest(req, nil))
10857 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10858 }
10859
10860 // Do executes the "networkservices.projects.locations.lbTrafficExtensions.delete" call.
10861 // Any non-2xx status code is an error. Response headers are in either
10862 // *Operation.ServerResponse.Header or (if a response was returned at all) in
10863 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
10864 // whether the returned error was because http.StatusNotModified was returned.
10865 func (c *ProjectsLocationsLbTrafficExtensionsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
10866 gensupport.SetOptions(c.urlParams_, opts...)
10867 res, err := c.doRequest("json")
10868 if res != nil && res.StatusCode == http.StatusNotModified {
10869 if res.Body != nil {
10870 res.Body.Close()
10871 }
10872 return nil, gensupport.WrapError(&googleapi.Error{
10873 Code: res.StatusCode,
10874 Header: res.Header,
10875 })
10876 }
10877 if err != nil {
10878 return nil, err
10879 }
10880 defer googleapi.CloseBody(res)
10881 if err := googleapi.CheckResponse(res); err != nil {
10882 return nil, gensupport.WrapError(err)
10883 }
10884 ret := &Operation{
10885 ServerResponse: googleapi.ServerResponse{
10886 Header: res.Header,
10887 HTTPStatusCode: res.StatusCode,
10888 },
10889 }
10890 target := &ret
10891 b, err := gensupport.DecodeResponseBytes(target, res)
10892 if err != nil {
10893 return nil, err
10894 }
10895 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTrafficExtensions.delete", "response", internallog.HTTPResponse(res, b))
10896 return ret, nil
10897 }
10898
10899 type ProjectsLocationsLbTrafficExtensionsGetCall struct {
10900 s *Service
10901 name string
10902 urlParams_ gensupport.URLParams
10903 ifNoneMatch_ string
10904 ctx_ context.Context
10905 header_ http.Header
10906 }
10907
10908 // Get: Gets details of the specified `LbTrafficExtension` resource.
10909 //
10910 // - name: A name of the `LbTrafficExtension` resource to get. Must be in the
10911 // format
10912 // `projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_ex
10913 // tension}`.
10914 func (r *ProjectsLocationsLbTrafficExtensionsService) Get(name string) *ProjectsLocationsLbTrafficExtensionsGetCall {
10915 c := &ProjectsLocationsLbTrafficExtensionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10916 c.name = name
10917 return c
10918 }
10919
10920 // Fields allows partial responses to be retrieved. See
10921 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10922 // details.
10923 func (c *ProjectsLocationsLbTrafficExtensionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbTrafficExtensionsGetCall {
10924 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10925 return c
10926 }
10927
10928 // IfNoneMatch sets an optional parameter which makes the operation fail if the
10929 // object's ETag matches the given value. This is useful for getting updates
10930 // only after the object has changed since the last request.
10931 func (c *ProjectsLocationsLbTrafficExtensionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsLbTrafficExtensionsGetCall {
10932 c.ifNoneMatch_ = entityTag
10933 return c
10934 }
10935
10936 // Context sets the context to be used in this call's Do method.
10937 func (c *ProjectsLocationsLbTrafficExtensionsGetCall) Context(ctx context.Context) *ProjectsLocationsLbTrafficExtensionsGetCall {
10938 c.ctx_ = ctx
10939 return c
10940 }
10941
10942 // Header returns a http.Header that can be modified by the caller to add
10943 // headers to the request.
10944 func (c *ProjectsLocationsLbTrafficExtensionsGetCall) Header() http.Header {
10945 if c.header_ == nil {
10946 c.header_ = make(http.Header)
10947 }
10948 return c.header_
10949 }
10950
10951 func (c *ProjectsLocationsLbTrafficExtensionsGetCall) doRequest(alt string) (*http.Response, error) {
10952 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
10953 if c.ifNoneMatch_ != "" {
10954 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10955 }
10956 c.urlParams_.Set("alt", alt)
10957 c.urlParams_.Set("prettyPrint", "false")
10958 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
10959 urls += "?" + c.urlParams_.Encode()
10960 req, err := http.NewRequest("GET", urls, nil)
10961 if err != nil {
10962 return nil, err
10963 }
10964 req.Header = reqHeaders
10965 googleapi.Expand(req.URL, map[string]string{
10966 "name": c.name,
10967 })
10968 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTrafficExtensions.get", "request", internallog.HTTPRequest(req, nil))
10969 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10970 }
10971
10972 // Do executes the "networkservices.projects.locations.lbTrafficExtensions.get" call.
10973 // Any non-2xx status code is an error. Response headers are in either
10974 // *LbTrafficExtension.ServerResponse.Header or (if a response was returned at
10975 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
10976 // check whether the returned error was because http.StatusNotModified was
10977 // returned.
10978 func (c *ProjectsLocationsLbTrafficExtensionsGetCall) Do(opts ...googleapi.CallOption) (*LbTrafficExtension, error) {
10979 gensupport.SetOptions(c.urlParams_, opts...)
10980 res, err := c.doRequest("json")
10981 if res != nil && res.StatusCode == http.StatusNotModified {
10982 if res.Body != nil {
10983 res.Body.Close()
10984 }
10985 return nil, gensupport.WrapError(&googleapi.Error{
10986 Code: res.StatusCode,
10987 Header: res.Header,
10988 })
10989 }
10990 if err != nil {
10991 return nil, err
10992 }
10993 defer googleapi.CloseBody(res)
10994 if err := googleapi.CheckResponse(res); err != nil {
10995 return nil, gensupport.WrapError(err)
10996 }
10997 ret := &LbTrafficExtension{
10998 ServerResponse: googleapi.ServerResponse{
10999 Header: res.Header,
11000 HTTPStatusCode: res.StatusCode,
11001 },
11002 }
11003 target := &ret
11004 b, err := gensupport.DecodeResponseBytes(target, res)
11005 if err != nil {
11006 return nil, err
11007 }
11008 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTrafficExtensions.get", "response", internallog.HTTPResponse(res, b))
11009 return ret, nil
11010 }
11011
11012 type ProjectsLocationsLbTrafficExtensionsListCall struct {
11013 s *Service
11014 parent string
11015 urlParams_ gensupport.URLParams
11016 ifNoneMatch_ string
11017 ctx_ context.Context
11018 header_ http.Header
11019 }
11020
11021 // List: Lists `LbTrafficExtension` resources in a given project and location.
11022 //
11023 // - parent: The project and location from which the `LbTrafficExtension`
11024 // resources are listed. These values are specified in the following format:
11025 // `projects/{project}/locations/{location}`.
11026 func (r *ProjectsLocationsLbTrafficExtensionsService) List(parent string) *ProjectsLocationsLbTrafficExtensionsListCall {
11027 c := &ProjectsLocationsLbTrafficExtensionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11028 c.parent = parent
11029 return c
11030 }
11031
11032 // Filter sets the optional parameter "filter": Filtering results.
11033 func (c *ProjectsLocationsLbTrafficExtensionsListCall) Filter(filter string) *ProjectsLocationsLbTrafficExtensionsListCall {
11034 c.urlParams_.Set("filter", filter)
11035 return c
11036 }
11037
11038 // OrderBy sets the optional parameter "orderBy": Hint about how to order the
11039 // results.
11040 func (c *ProjectsLocationsLbTrafficExtensionsListCall) OrderBy(orderBy string) *ProjectsLocationsLbTrafficExtensionsListCall {
11041 c.urlParams_.Set("orderBy", orderBy)
11042 return c
11043 }
11044
11045 // PageSize sets the optional parameter "pageSize": Requested page size. The
11046 // server might return fewer items than requested. If unspecified, the server
11047 // picks an appropriate default.
11048 func (c *ProjectsLocationsLbTrafficExtensionsListCall) PageSize(pageSize int64) *ProjectsLocationsLbTrafficExtensionsListCall {
11049 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
11050 return c
11051 }
11052
11053 // PageToken sets the optional parameter "pageToken": A token identifying a
11054 // page of results that the server returns.
11055 func (c *ProjectsLocationsLbTrafficExtensionsListCall) PageToken(pageToken string) *ProjectsLocationsLbTrafficExtensionsListCall {
11056 c.urlParams_.Set("pageToken", pageToken)
11057 return c
11058 }
11059
11060 // Fields allows partial responses to be retrieved. See
11061 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11062 // details.
11063 func (c *ProjectsLocationsLbTrafficExtensionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbTrafficExtensionsListCall {
11064 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11065 return c
11066 }
11067
11068 // IfNoneMatch sets an optional parameter which makes the operation fail if the
11069 // object's ETag matches the given value. This is useful for getting updates
11070 // only after the object has changed since the last request.
11071 func (c *ProjectsLocationsLbTrafficExtensionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsLbTrafficExtensionsListCall {
11072 c.ifNoneMatch_ = entityTag
11073 return c
11074 }
11075
11076 // Context sets the context to be used in this call's Do method.
11077 func (c *ProjectsLocationsLbTrafficExtensionsListCall) Context(ctx context.Context) *ProjectsLocationsLbTrafficExtensionsListCall {
11078 c.ctx_ = ctx
11079 return c
11080 }
11081
11082 // Header returns a http.Header that can be modified by the caller to add
11083 // headers to the request.
11084 func (c *ProjectsLocationsLbTrafficExtensionsListCall) Header() http.Header {
11085 if c.header_ == nil {
11086 c.header_ = make(http.Header)
11087 }
11088 return c.header_
11089 }
11090
11091 func (c *ProjectsLocationsLbTrafficExtensionsListCall) doRequest(alt string) (*http.Response, error) {
11092 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
11093 if c.ifNoneMatch_ != "" {
11094 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11095 }
11096 c.urlParams_.Set("alt", alt)
11097 c.urlParams_.Set("prettyPrint", "false")
11098 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/lbTrafficExtensions")
11099 urls += "?" + c.urlParams_.Encode()
11100 req, err := http.NewRequest("GET", urls, nil)
11101 if err != nil {
11102 return nil, err
11103 }
11104 req.Header = reqHeaders
11105 googleapi.Expand(req.URL, map[string]string{
11106 "parent": c.parent,
11107 })
11108 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTrafficExtensions.list", "request", internallog.HTTPRequest(req, nil))
11109 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11110 }
11111
11112 // Do executes the "networkservices.projects.locations.lbTrafficExtensions.list" call.
11113 // Any non-2xx status code is an error. Response headers are in either
11114 // *ListLbTrafficExtensionsResponse.ServerResponse.Header or (if a response was
11115 // returned at all) in error.(*googleapi.Error).Header. Use
11116 // googleapi.IsNotModified to check whether the returned error was because
11117 // http.StatusNotModified was returned.
11118 func (c *ProjectsLocationsLbTrafficExtensionsListCall) Do(opts ...googleapi.CallOption) (*ListLbTrafficExtensionsResponse, error) {
11119 gensupport.SetOptions(c.urlParams_, opts...)
11120 res, err := c.doRequest("json")
11121 if res != nil && res.StatusCode == http.StatusNotModified {
11122 if res.Body != nil {
11123 res.Body.Close()
11124 }
11125 return nil, gensupport.WrapError(&googleapi.Error{
11126 Code: res.StatusCode,
11127 Header: res.Header,
11128 })
11129 }
11130 if err != nil {
11131 return nil, err
11132 }
11133 defer googleapi.CloseBody(res)
11134 if err := googleapi.CheckResponse(res); err != nil {
11135 return nil, gensupport.WrapError(err)
11136 }
11137 ret := &ListLbTrafficExtensionsResponse{
11138 ServerResponse: googleapi.ServerResponse{
11139 Header: res.Header,
11140 HTTPStatusCode: res.StatusCode,
11141 },
11142 }
11143 target := &ret
11144 b, err := gensupport.DecodeResponseBytes(target, res)
11145 if err != nil {
11146 return nil, err
11147 }
11148 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTrafficExtensions.list", "response", internallog.HTTPResponse(res, b))
11149 return ret, nil
11150 }
11151
11152 // Pages invokes f for each page of results.
11153 // A non-nil error returned from f will halt the iteration.
11154 // The provided context supersedes any context provided to the Context method.
11155 func (c *ProjectsLocationsLbTrafficExtensionsListCall) Pages(ctx context.Context, f func(*ListLbTrafficExtensionsResponse) error) error {
11156 c.ctx_ = ctx
11157 defer c.PageToken(c.urlParams_.Get("pageToken"))
11158 for {
11159 x, err := c.Do()
11160 if err != nil {
11161 return err
11162 }
11163 if err := f(x); err != nil {
11164 return err
11165 }
11166 if x.NextPageToken == "" {
11167 return nil
11168 }
11169 c.PageToken(x.NextPageToken)
11170 }
11171 }
11172
11173 type ProjectsLocationsLbTrafficExtensionsPatchCall struct {
11174 s *Service
11175 name string
11176 lbtrafficextension *LbTrafficExtension
11177 urlParams_ gensupport.URLParams
11178 ctx_ context.Context
11179 header_ http.Header
11180 }
11181
11182 // Patch: Updates the parameters of the specified `LbTrafficExtension`
11183 // resource.
11184 //
11185 // - name: Identifier. Name of the `LbTrafficExtension` resource in the
11186 // following format:
11187 // `projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_ex
11188 // tension}`.
11189 func (r *ProjectsLocationsLbTrafficExtensionsService) Patch(name string, lbtrafficextension *LbTrafficExtension) *ProjectsLocationsLbTrafficExtensionsPatchCall {
11190 c := &ProjectsLocationsLbTrafficExtensionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11191 c.name = name
11192 c.lbtrafficextension = lbtrafficextension
11193 return c
11194 }
11195
11196 // RequestId sets the optional parameter "requestId": An optional request ID to
11197 // identify requests. Specify a unique request ID so that if you must retry
11198 // your request, the server can ignore the request if it has already been
11199 // completed. The server guarantees that for 60 minutes since the first
11200 // request. For example, consider a situation where you make an initial request
11201 // and the request times out. If you make the request again with the same
11202 // request ID, the server ignores the second request This prevents clients from
11203 // accidentally creating duplicate commitments. The request ID must be a valid
11204 // UUID with the exception that zero UUID is not supported
11205 // (00000000-0000-0000-0000-000000000000).
11206 func (c *ProjectsLocationsLbTrafficExtensionsPatchCall) RequestId(requestId string) *ProjectsLocationsLbTrafficExtensionsPatchCall {
11207 c.urlParams_.Set("requestId", requestId)
11208 return c
11209 }
11210
11211 // UpdateMask sets the optional parameter "updateMask": Used to specify the
11212 // fields to be overwritten in the `LbTrafficExtension` resource by the update.
11213 // The fields specified in the `update_mask` are relative to the resource, not
11214 // the full request. A field is overwritten if it is in the mask. If the user
11215 // does not specify a mask, then all fields are overwritten.
11216 func (c *ProjectsLocationsLbTrafficExtensionsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsLbTrafficExtensionsPatchCall {
11217 c.urlParams_.Set("updateMask", updateMask)
11218 return c
11219 }
11220
11221 // Fields allows partial responses to be retrieved. See
11222 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11223 // details.
11224 func (c *ProjectsLocationsLbTrafficExtensionsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbTrafficExtensionsPatchCall {
11225 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11226 return c
11227 }
11228
11229 // Context sets the context to be used in this call's Do method.
11230 func (c *ProjectsLocationsLbTrafficExtensionsPatchCall) Context(ctx context.Context) *ProjectsLocationsLbTrafficExtensionsPatchCall {
11231 c.ctx_ = ctx
11232 return c
11233 }
11234
11235 // Header returns a http.Header that can be modified by the caller to add
11236 // headers to the request.
11237 func (c *ProjectsLocationsLbTrafficExtensionsPatchCall) Header() http.Header {
11238 if c.header_ == nil {
11239 c.header_ = make(http.Header)
11240 }
11241 return c.header_
11242 }
11243
11244 func (c *ProjectsLocationsLbTrafficExtensionsPatchCall) doRequest(alt string) (*http.Response, error) {
11245 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
11246 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lbtrafficextension)
11247 if err != nil {
11248 return nil, err
11249 }
11250 c.urlParams_.Set("alt", alt)
11251 c.urlParams_.Set("prettyPrint", "false")
11252 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
11253 urls += "?" + c.urlParams_.Encode()
11254 req, err := http.NewRequest("PATCH", urls, body)
11255 if err != nil {
11256 return nil, err
11257 }
11258 req.Header = reqHeaders
11259 googleapi.Expand(req.URL, map[string]string{
11260 "name": c.name,
11261 })
11262 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTrafficExtensions.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
11263 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11264 }
11265
11266 // Do executes the "networkservices.projects.locations.lbTrafficExtensions.patch" call.
11267 // Any non-2xx status code is an error. Response headers are in either
11268 // *Operation.ServerResponse.Header or (if a response was returned at all) in
11269 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
11270 // whether the returned error was because http.StatusNotModified was returned.
11271 func (c *ProjectsLocationsLbTrafficExtensionsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
11272 gensupport.SetOptions(c.urlParams_, opts...)
11273 res, err := c.doRequest("json")
11274 if res != nil && res.StatusCode == http.StatusNotModified {
11275 if res.Body != nil {
11276 res.Body.Close()
11277 }
11278 return nil, gensupport.WrapError(&googleapi.Error{
11279 Code: res.StatusCode,
11280 Header: res.Header,
11281 })
11282 }
11283 if err != nil {
11284 return nil, err
11285 }
11286 defer googleapi.CloseBody(res)
11287 if err := googleapi.CheckResponse(res); err != nil {
11288 return nil, gensupport.WrapError(err)
11289 }
11290 ret := &Operation{
11291 ServerResponse: googleapi.ServerResponse{
11292 Header: res.Header,
11293 HTTPStatusCode: res.StatusCode,
11294 },
11295 }
11296 target := &ret
11297 b, err := gensupport.DecodeResponseBytes(target, res)
11298 if err != nil {
11299 return nil, err
11300 }
11301 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTrafficExtensions.patch", "response", internallog.HTTPResponse(res, b))
11302 return ret, nil
11303 }
11304
11305 type ProjectsLocationsMeshesCreateCall struct {
11306 s *Service
11307 parent string
11308 mesh *Mesh
11309 urlParams_ gensupport.URLParams
11310 ctx_ context.Context
11311 header_ http.Header
11312 }
11313
11314 // Create: Creates a new Mesh in a given project and location.
11315 //
11316 // - parent: The parent resource of the Mesh. Must be in the format
11317 // `projects/*/locations/*`.
11318 func (r *ProjectsLocationsMeshesService) Create(parent string, mesh *Mesh) *ProjectsLocationsMeshesCreateCall {
11319 c := &ProjectsLocationsMeshesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11320 c.parent = parent
11321 c.mesh = mesh
11322 return c
11323 }
11324
11325 // MeshId sets the optional parameter "meshId": Required. Short name of the
11326 // Mesh resource to be created.
11327 func (c *ProjectsLocationsMeshesCreateCall) MeshId(meshId string) *ProjectsLocationsMeshesCreateCall {
11328 c.urlParams_.Set("meshId", meshId)
11329 return c
11330 }
11331
11332 // Fields allows partial responses to be retrieved. See
11333 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11334 // details.
11335 func (c *ProjectsLocationsMeshesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsMeshesCreateCall {
11336 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11337 return c
11338 }
11339
11340 // Context sets the context to be used in this call's Do method.
11341 func (c *ProjectsLocationsMeshesCreateCall) Context(ctx context.Context) *ProjectsLocationsMeshesCreateCall {
11342 c.ctx_ = ctx
11343 return c
11344 }
11345
11346 // Header returns a http.Header that can be modified by the caller to add
11347 // headers to the request.
11348 func (c *ProjectsLocationsMeshesCreateCall) Header() http.Header {
11349 if c.header_ == nil {
11350 c.header_ = make(http.Header)
11351 }
11352 return c.header_
11353 }
11354
11355 func (c *ProjectsLocationsMeshesCreateCall) doRequest(alt string) (*http.Response, error) {
11356 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
11357 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.mesh)
11358 if err != nil {
11359 return nil, err
11360 }
11361 c.urlParams_.Set("alt", alt)
11362 c.urlParams_.Set("prettyPrint", "false")
11363 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/meshes")
11364 urls += "?" + c.urlParams_.Encode()
11365 req, err := http.NewRequest("POST", urls, body)
11366 if err != nil {
11367 return nil, err
11368 }
11369 req.Header = reqHeaders
11370 googleapi.Expand(req.URL, map[string]string{
11371 "parent": c.parent,
11372 })
11373 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.create", "request", internallog.HTTPRequest(req, body.Bytes()))
11374 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11375 }
11376
11377 // Do executes the "networkservices.projects.locations.meshes.create" call.
11378 // Any non-2xx status code is an error. Response headers are in either
11379 // *Operation.ServerResponse.Header or (if a response was returned at all) in
11380 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
11381 // whether the returned error was because http.StatusNotModified was returned.
11382 func (c *ProjectsLocationsMeshesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
11383 gensupport.SetOptions(c.urlParams_, opts...)
11384 res, err := c.doRequest("json")
11385 if res != nil && res.StatusCode == http.StatusNotModified {
11386 if res.Body != nil {
11387 res.Body.Close()
11388 }
11389 return nil, gensupport.WrapError(&googleapi.Error{
11390 Code: res.StatusCode,
11391 Header: res.Header,
11392 })
11393 }
11394 if err != nil {
11395 return nil, err
11396 }
11397 defer googleapi.CloseBody(res)
11398 if err := googleapi.CheckResponse(res); err != nil {
11399 return nil, gensupport.WrapError(err)
11400 }
11401 ret := &Operation{
11402 ServerResponse: googleapi.ServerResponse{
11403 Header: res.Header,
11404 HTTPStatusCode: res.StatusCode,
11405 },
11406 }
11407 target := &ret
11408 b, err := gensupport.DecodeResponseBytes(target, res)
11409 if err != nil {
11410 return nil, err
11411 }
11412 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.create", "response", internallog.HTTPResponse(res, b))
11413 return ret, nil
11414 }
11415
11416 type ProjectsLocationsMeshesDeleteCall struct {
11417 s *Service
11418 name string
11419 urlParams_ gensupport.URLParams
11420 ctx_ context.Context
11421 header_ http.Header
11422 }
11423
11424 // Delete: Deletes a single Mesh.
11425 //
11426 // - name: A name of the Mesh to delete. Must be in the format
11427 // `projects/*/locations/*/meshes/*`.
11428 func (r *ProjectsLocationsMeshesService) Delete(name string) *ProjectsLocationsMeshesDeleteCall {
11429 c := &ProjectsLocationsMeshesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11430 c.name = name
11431 return c
11432 }
11433
11434 // Fields allows partial responses to be retrieved. See
11435 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11436 // details.
11437 func (c *ProjectsLocationsMeshesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsMeshesDeleteCall {
11438 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11439 return c
11440 }
11441
11442 // Context sets the context to be used in this call's Do method.
11443 func (c *ProjectsLocationsMeshesDeleteCall) Context(ctx context.Context) *ProjectsLocationsMeshesDeleteCall {
11444 c.ctx_ = ctx
11445 return c
11446 }
11447
11448 // Header returns a http.Header that can be modified by the caller to add
11449 // headers to the request.
11450 func (c *ProjectsLocationsMeshesDeleteCall) Header() http.Header {
11451 if c.header_ == nil {
11452 c.header_ = make(http.Header)
11453 }
11454 return c.header_
11455 }
11456
11457 func (c *ProjectsLocationsMeshesDeleteCall) doRequest(alt string) (*http.Response, error) {
11458 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
11459 c.urlParams_.Set("alt", alt)
11460 c.urlParams_.Set("prettyPrint", "false")
11461 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
11462 urls += "?" + c.urlParams_.Encode()
11463 req, err := http.NewRequest("DELETE", urls, nil)
11464 if err != nil {
11465 return nil, err
11466 }
11467 req.Header = reqHeaders
11468 googleapi.Expand(req.URL, map[string]string{
11469 "name": c.name,
11470 })
11471 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.delete", "request", internallog.HTTPRequest(req, nil))
11472 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11473 }
11474
11475 // Do executes the "networkservices.projects.locations.meshes.delete" call.
11476 // Any non-2xx status code is an error. Response headers are in either
11477 // *Operation.ServerResponse.Header or (if a response was returned at all) in
11478 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
11479 // whether the returned error was because http.StatusNotModified was returned.
11480 func (c *ProjectsLocationsMeshesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
11481 gensupport.SetOptions(c.urlParams_, opts...)
11482 res, err := c.doRequest("json")
11483 if res != nil && res.StatusCode == http.StatusNotModified {
11484 if res.Body != nil {
11485 res.Body.Close()
11486 }
11487 return nil, gensupport.WrapError(&googleapi.Error{
11488 Code: res.StatusCode,
11489 Header: res.Header,
11490 })
11491 }
11492 if err != nil {
11493 return nil, err
11494 }
11495 defer googleapi.CloseBody(res)
11496 if err := googleapi.CheckResponse(res); err != nil {
11497 return nil, gensupport.WrapError(err)
11498 }
11499 ret := &Operation{
11500 ServerResponse: googleapi.ServerResponse{
11501 Header: res.Header,
11502 HTTPStatusCode: res.StatusCode,
11503 },
11504 }
11505 target := &ret
11506 b, err := gensupport.DecodeResponseBytes(target, res)
11507 if err != nil {
11508 return nil, err
11509 }
11510 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.delete", "response", internallog.HTTPResponse(res, b))
11511 return ret, nil
11512 }
11513
11514 type ProjectsLocationsMeshesGetCall struct {
11515 s *Service
11516 name string
11517 urlParams_ gensupport.URLParams
11518 ifNoneMatch_ string
11519 ctx_ context.Context
11520 header_ http.Header
11521 }
11522
11523 // Get: Gets details of a single Mesh.
11524 //
11525 // - name: A name of the Mesh to get. Must be in the format
11526 // `projects/*/locations/*/meshes/*`.
11527 func (r *ProjectsLocationsMeshesService) Get(name string) *ProjectsLocationsMeshesGetCall {
11528 c := &ProjectsLocationsMeshesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11529 c.name = name
11530 return c
11531 }
11532
11533 // Fields allows partial responses to be retrieved. See
11534 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11535 // details.
11536 func (c *ProjectsLocationsMeshesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsMeshesGetCall {
11537 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11538 return c
11539 }
11540
11541 // IfNoneMatch sets an optional parameter which makes the operation fail if the
11542 // object's ETag matches the given value. This is useful for getting updates
11543 // only after the object has changed since the last request.
11544 func (c *ProjectsLocationsMeshesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsMeshesGetCall {
11545 c.ifNoneMatch_ = entityTag
11546 return c
11547 }
11548
11549 // Context sets the context to be used in this call's Do method.
11550 func (c *ProjectsLocationsMeshesGetCall) Context(ctx context.Context) *ProjectsLocationsMeshesGetCall {
11551 c.ctx_ = ctx
11552 return c
11553 }
11554
11555 // Header returns a http.Header that can be modified by the caller to add
11556 // headers to the request.
11557 func (c *ProjectsLocationsMeshesGetCall) Header() http.Header {
11558 if c.header_ == nil {
11559 c.header_ = make(http.Header)
11560 }
11561 return c.header_
11562 }
11563
11564 func (c *ProjectsLocationsMeshesGetCall) doRequest(alt string) (*http.Response, error) {
11565 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
11566 if c.ifNoneMatch_ != "" {
11567 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11568 }
11569 c.urlParams_.Set("alt", alt)
11570 c.urlParams_.Set("prettyPrint", "false")
11571 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
11572 urls += "?" + c.urlParams_.Encode()
11573 req, err := http.NewRequest("GET", urls, nil)
11574 if err != nil {
11575 return nil, err
11576 }
11577 req.Header = reqHeaders
11578 googleapi.Expand(req.URL, map[string]string{
11579 "name": c.name,
11580 })
11581 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.get", "request", internallog.HTTPRequest(req, nil))
11582 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11583 }
11584
11585 // Do executes the "networkservices.projects.locations.meshes.get" call.
11586 // Any non-2xx status code is an error. Response headers are in either
11587 // *Mesh.ServerResponse.Header or (if a response was returned at all) in
11588 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
11589 // whether the returned error was because http.StatusNotModified was returned.
11590 func (c *ProjectsLocationsMeshesGetCall) Do(opts ...googleapi.CallOption) (*Mesh, error) {
11591 gensupport.SetOptions(c.urlParams_, opts...)
11592 res, err := c.doRequest("json")
11593 if res != nil && res.StatusCode == http.StatusNotModified {
11594 if res.Body != nil {
11595 res.Body.Close()
11596 }
11597 return nil, gensupport.WrapError(&googleapi.Error{
11598 Code: res.StatusCode,
11599 Header: res.Header,
11600 })
11601 }
11602 if err != nil {
11603 return nil, err
11604 }
11605 defer googleapi.CloseBody(res)
11606 if err := googleapi.CheckResponse(res); err != nil {
11607 return nil, gensupport.WrapError(err)
11608 }
11609 ret := &Mesh{
11610 ServerResponse: googleapi.ServerResponse{
11611 Header: res.Header,
11612 HTTPStatusCode: res.StatusCode,
11613 },
11614 }
11615 target := &ret
11616 b, err := gensupport.DecodeResponseBytes(target, res)
11617 if err != nil {
11618 return nil, err
11619 }
11620 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.get", "response", internallog.HTTPResponse(res, b))
11621 return ret, nil
11622 }
11623
11624 type ProjectsLocationsMeshesListCall struct {
11625 s *Service
11626 parent string
11627 urlParams_ gensupport.URLParams
11628 ifNoneMatch_ string
11629 ctx_ context.Context
11630 header_ http.Header
11631 }
11632
11633 // List: Lists Meshes in a given project and location.
11634 //
11635 // - parent: The project and location from which the Meshes should be listed,
11636 // specified in the format `projects/*/locations/*`.
11637 func (r *ProjectsLocationsMeshesService) List(parent string) *ProjectsLocationsMeshesListCall {
11638 c := &ProjectsLocationsMeshesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11639 c.parent = parent
11640 return c
11641 }
11642
11643 // PageSize sets the optional parameter "pageSize": Maximum number of Meshes to
11644 // return per call.
11645 func (c *ProjectsLocationsMeshesListCall) PageSize(pageSize int64) *ProjectsLocationsMeshesListCall {
11646 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
11647 return c
11648 }
11649
11650 // PageToken sets the optional parameter "pageToken": The value returned by the
11651 // last `ListMeshesResponse` Indicates that this is a continuation of a prior
11652 // `ListMeshes` call, and that the system should return the next page of data.
11653 func (c *ProjectsLocationsMeshesListCall) PageToken(pageToken string) *ProjectsLocationsMeshesListCall {
11654 c.urlParams_.Set("pageToken", pageToken)
11655 return c
11656 }
11657
11658 // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": If
11659 // true, allow partial responses for multi-regional Aggregated List requests.
11660 // Otherwise if one of the locations is down or unreachable, the Aggregated
11661 // List request will fail.
11662 func (c *ProjectsLocationsMeshesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ProjectsLocationsMeshesListCall {
11663 c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
11664 return c
11665 }
11666
11667 // Fields allows partial responses to be retrieved. See
11668 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11669 // details.
11670 func (c *ProjectsLocationsMeshesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsMeshesListCall {
11671 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11672 return c
11673 }
11674
11675 // IfNoneMatch sets an optional parameter which makes the operation fail if the
11676 // object's ETag matches the given value. This is useful for getting updates
11677 // only after the object has changed since the last request.
11678 func (c *ProjectsLocationsMeshesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsMeshesListCall {
11679 c.ifNoneMatch_ = entityTag
11680 return c
11681 }
11682
11683 // Context sets the context to be used in this call's Do method.
11684 func (c *ProjectsLocationsMeshesListCall) Context(ctx context.Context) *ProjectsLocationsMeshesListCall {
11685 c.ctx_ = ctx
11686 return c
11687 }
11688
11689 // Header returns a http.Header that can be modified by the caller to add
11690 // headers to the request.
11691 func (c *ProjectsLocationsMeshesListCall) Header() http.Header {
11692 if c.header_ == nil {
11693 c.header_ = make(http.Header)
11694 }
11695 return c.header_
11696 }
11697
11698 func (c *ProjectsLocationsMeshesListCall) doRequest(alt string) (*http.Response, error) {
11699 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
11700 if c.ifNoneMatch_ != "" {
11701 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11702 }
11703 c.urlParams_.Set("alt", alt)
11704 c.urlParams_.Set("prettyPrint", "false")
11705 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/meshes")
11706 urls += "?" + c.urlParams_.Encode()
11707 req, err := http.NewRequest("GET", urls, nil)
11708 if err != nil {
11709 return nil, err
11710 }
11711 req.Header = reqHeaders
11712 googleapi.Expand(req.URL, map[string]string{
11713 "parent": c.parent,
11714 })
11715 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.list", "request", internallog.HTTPRequest(req, nil))
11716 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11717 }
11718
11719 // Do executes the "networkservices.projects.locations.meshes.list" call.
11720 // Any non-2xx status code is an error. Response headers are in either
11721 // *ListMeshesResponse.ServerResponse.Header or (if a response was returned at
11722 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
11723 // check whether the returned error was because http.StatusNotModified was
11724 // returned.
11725 func (c *ProjectsLocationsMeshesListCall) Do(opts ...googleapi.CallOption) (*ListMeshesResponse, error) {
11726 gensupport.SetOptions(c.urlParams_, opts...)
11727 res, err := c.doRequest("json")
11728 if res != nil && res.StatusCode == http.StatusNotModified {
11729 if res.Body != nil {
11730 res.Body.Close()
11731 }
11732 return nil, gensupport.WrapError(&googleapi.Error{
11733 Code: res.StatusCode,
11734 Header: res.Header,
11735 })
11736 }
11737 if err != nil {
11738 return nil, err
11739 }
11740 defer googleapi.CloseBody(res)
11741 if err := googleapi.CheckResponse(res); err != nil {
11742 return nil, gensupport.WrapError(err)
11743 }
11744 ret := &ListMeshesResponse{
11745 ServerResponse: googleapi.ServerResponse{
11746 Header: res.Header,
11747 HTTPStatusCode: res.StatusCode,
11748 },
11749 }
11750 target := &ret
11751 b, err := gensupport.DecodeResponseBytes(target, res)
11752 if err != nil {
11753 return nil, err
11754 }
11755 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.list", "response", internallog.HTTPResponse(res, b))
11756 return ret, nil
11757 }
11758
11759 // Pages invokes f for each page of results.
11760 // A non-nil error returned from f will halt the iteration.
11761 // The provided context supersedes any context provided to the Context method.
11762 func (c *ProjectsLocationsMeshesListCall) Pages(ctx context.Context, f func(*ListMeshesResponse) error) error {
11763 c.ctx_ = ctx
11764 defer c.PageToken(c.urlParams_.Get("pageToken"))
11765 for {
11766 x, err := c.Do()
11767 if err != nil {
11768 return err
11769 }
11770 if err := f(x); err != nil {
11771 return err
11772 }
11773 if x.NextPageToken == "" {
11774 return nil
11775 }
11776 c.PageToken(x.NextPageToken)
11777 }
11778 }
11779
11780 type ProjectsLocationsMeshesPatchCall struct {
11781 s *Service
11782 name string
11783 mesh *Mesh
11784 urlParams_ gensupport.URLParams
11785 ctx_ context.Context
11786 header_ http.Header
11787 }
11788
11789 // Patch: Updates the parameters of a single Mesh.
11790 //
11791 // - name: Identifier. Name of the Mesh resource. It matches pattern
11792 // `projects/*/locations/*/meshes/`.
11793 func (r *ProjectsLocationsMeshesService) Patch(name string, mesh *Mesh) *ProjectsLocationsMeshesPatchCall {
11794 c := &ProjectsLocationsMeshesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11795 c.name = name
11796 c.mesh = mesh
11797 return c
11798 }
11799
11800 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
11801 // specify the fields to be overwritten in the Mesh resource by the update. The
11802 // fields specified in the update_mask are relative to the resource, not the
11803 // full request. A field will be overwritten if it is in the mask. If the user
11804 // does not provide a mask then all fields will be overwritten.
11805 func (c *ProjectsLocationsMeshesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsMeshesPatchCall {
11806 c.urlParams_.Set("updateMask", updateMask)
11807 return c
11808 }
11809
11810 // Fields allows partial responses to be retrieved. See
11811 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11812 // details.
11813 func (c *ProjectsLocationsMeshesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsMeshesPatchCall {
11814 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11815 return c
11816 }
11817
11818 // Context sets the context to be used in this call's Do method.
11819 func (c *ProjectsLocationsMeshesPatchCall) Context(ctx context.Context) *ProjectsLocationsMeshesPatchCall {
11820 c.ctx_ = ctx
11821 return c
11822 }
11823
11824 // Header returns a http.Header that can be modified by the caller to add
11825 // headers to the request.
11826 func (c *ProjectsLocationsMeshesPatchCall) Header() http.Header {
11827 if c.header_ == nil {
11828 c.header_ = make(http.Header)
11829 }
11830 return c.header_
11831 }
11832
11833 func (c *ProjectsLocationsMeshesPatchCall) doRequest(alt string) (*http.Response, error) {
11834 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
11835 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.mesh)
11836 if err != nil {
11837 return nil, err
11838 }
11839 c.urlParams_.Set("alt", alt)
11840 c.urlParams_.Set("prettyPrint", "false")
11841 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
11842 urls += "?" + c.urlParams_.Encode()
11843 req, err := http.NewRequest("PATCH", urls, body)
11844 if err != nil {
11845 return nil, err
11846 }
11847 req.Header = reqHeaders
11848 googleapi.Expand(req.URL, map[string]string{
11849 "name": c.name,
11850 })
11851 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
11852 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11853 }
11854
11855 // Do executes the "networkservices.projects.locations.meshes.patch" call.
11856 // Any non-2xx status code is an error. Response headers are in either
11857 // *Operation.ServerResponse.Header or (if a response was returned at all) in
11858 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
11859 // whether the returned error was because http.StatusNotModified was returned.
11860 func (c *ProjectsLocationsMeshesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
11861 gensupport.SetOptions(c.urlParams_, opts...)
11862 res, err := c.doRequest("json")
11863 if res != nil && res.StatusCode == http.StatusNotModified {
11864 if res.Body != nil {
11865 res.Body.Close()
11866 }
11867 return nil, gensupport.WrapError(&googleapi.Error{
11868 Code: res.StatusCode,
11869 Header: res.Header,
11870 })
11871 }
11872 if err != nil {
11873 return nil, err
11874 }
11875 defer googleapi.CloseBody(res)
11876 if err := googleapi.CheckResponse(res); err != nil {
11877 return nil, gensupport.WrapError(err)
11878 }
11879 ret := &Operation{
11880 ServerResponse: googleapi.ServerResponse{
11881 Header: res.Header,
11882 HTTPStatusCode: res.StatusCode,
11883 },
11884 }
11885 target := &ret
11886 b, err := gensupport.DecodeResponseBytes(target, res)
11887 if err != nil {
11888 return nil, err
11889 }
11890 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.patch", "response", internallog.HTTPResponse(res, b))
11891 return ret, nil
11892 }
11893
11894 type ProjectsLocationsMeshesRouteViewsGetCall struct {
11895 s *Service
11896 name string
11897 urlParams_ gensupport.URLParams
11898 ifNoneMatch_ string
11899 ctx_ context.Context
11900 header_ http.Header
11901 }
11902
11903 // Get: Get a single RouteView of a Mesh.
11904 //
11905 // - name: Name of the MeshRouteView resource. Format:
11906 // projects/{project_number}/locations/{location}/meshes/{mesh}/routeViews/{ro
11907 // ute_view}.
11908 func (r *ProjectsLocationsMeshesRouteViewsService) Get(name string) *ProjectsLocationsMeshesRouteViewsGetCall {
11909 c := &ProjectsLocationsMeshesRouteViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11910 c.name = name
11911 return c
11912 }
11913
11914 // Fields allows partial responses to be retrieved. See
11915 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11916 // details.
11917 func (c *ProjectsLocationsMeshesRouteViewsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsMeshesRouteViewsGetCall {
11918 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11919 return c
11920 }
11921
11922 // IfNoneMatch sets an optional parameter which makes the operation fail if the
11923 // object's ETag matches the given value. This is useful for getting updates
11924 // only after the object has changed since the last request.
11925 func (c *ProjectsLocationsMeshesRouteViewsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsMeshesRouteViewsGetCall {
11926 c.ifNoneMatch_ = entityTag
11927 return c
11928 }
11929
11930 // Context sets the context to be used in this call's Do method.
11931 func (c *ProjectsLocationsMeshesRouteViewsGetCall) Context(ctx context.Context) *ProjectsLocationsMeshesRouteViewsGetCall {
11932 c.ctx_ = ctx
11933 return c
11934 }
11935
11936 // Header returns a http.Header that can be modified by the caller to add
11937 // headers to the request.
11938 func (c *ProjectsLocationsMeshesRouteViewsGetCall) Header() http.Header {
11939 if c.header_ == nil {
11940 c.header_ = make(http.Header)
11941 }
11942 return c.header_
11943 }
11944
11945 func (c *ProjectsLocationsMeshesRouteViewsGetCall) doRequest(alt string) (*http.Response, error) {
11946 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
11947 if c.ifNoneMatch_ != "" {
11948 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11949 }
11950 c.urlParams_.Set("alt", alt)
11951 c.urlParams_.Set("prettyPrint", "false")
11952 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
11953 urls += "?" + c.urlParams_.Encode()
11954 req, err := http.NewRequest("GET", urls, nil)
11955 if err != nil {
11956 return nil, err
11957 }
11958 req.Header = reqHeaders
11959 googleapi.Expand(req.URL, map[string]string{
11960 "name": c.name,
11961 })
11962 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.routeViews.get", "request", internallog.HTTPRequest(req, nil))
11963 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11964 }
11965
11966 // Do executes the "networkservices.projects.locations.meshes.routeViews.get" call.
11967 // Any non-2xx status code is an error. Response headers are in either
11968 // *MeshRouteView.ServerResponse.Header or (if a response was returned at all)
11969 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
11970 // whether the returned error was because http.StatusNotModified was returned.
11971 func (c *ProjectsLocationsMeshesRouteViewsGetCall) Do(opts ...googleapi.CallOption) (*MeshRouteView, error) {
11972 gensupport.SetOptions(c.urlParams_, opts...)
11973 res, err := c.doRequest("json")
11974 if res != nil && res.StatusCode == http.StatusNotModified {
11975 if res.Body != nil {
11976 res.Body.Close()
11977 }
11978 return nil, gensupport.WrapError(&googleapi.Error{
11979 Code: res.StatusCode,
11980 Header: res.Header,
11981 })
11982 }
11983 if err != nil {
11984 return nil, err
11985 }
11986 defer googleapi.CloseBody(res)
11987 if err := googleapi.CheckResponse(res); err != nil {
11988 return nil, gensupport.WrapError(err)
11989 }
11990 ret := &MeshRouteView{
11991 ServerResponse: googleapi.ServerResponse{
11992 Header: res.Header,
11993 HTTPStatusCode: res.StatusCode,
11994 },
11995 }
11996 target := &ret
11997 b, err := gensupport.DecodeResponseBytes(target, res)
11998 if err != nil {
11999 return nil, err
12000 }
12001 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.routeViews.get", "response", internallog.HTTPResponse(res, b))
12002 return ret, nil
12003 }
12004
12005 type ProjectsLocationsMeshesRouteViewsListCall struct {
12006 s *Service
12007 parent string
12008 urlParams_ gensupport.URLParams
12009 ifNoneMatch_ string
12010 ctx_ context.Context
12011 header_ http.Header
12012 }
12013
12014 // List: Lists RouteViews
12015 //
12016 // - parent: The Mesh to which a Route is associated. Format:
12017 // projects/{project_number}/locations/{location}/meshes/{mesh}.
12018 func (r *ProjectsLocationsMeshesRouteViewsService) List(parent string) *ProjectsLocationsMeshesRouteViewsListCall {
12019 c := &ProjectsLocationsMeshesRouteViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12020 c.parent = parent
12021 return c
12022 }
12023
12024 // PageSize sets the optional parameter "pageSize": Maximum number of
12025 // MeshRouteViews to return per call.
12026 func (c *ProjectsLocationsMeshesRouteViewsListCall) PageSize(pageSize int64) *ProjectsLocationsMeshesRouteViewsListCall {
12027 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
12028 return c
12029 }
12030
12031 // PageToken sets the optional parameter "pageToken": The value returned by the
12032 // last `ListMeshRouteViewsResponse` Indicates that this is a continuation of a
12033 // prior `ListMeshRouteViews` call, and that the system should return the next
12034 // page of data.
12035 func (c *ProjectsLocationsMeshesRouteViewsListCall) PageToken(pageToken string) *ProjectsLocationsMeshesRouteViewsListCall {
12036 c.urlParams_.Set("pageToken", pageToken)
12037 return c
12038 }
12039
12040 // Fields allows partial responses to be retrieved. See
12041 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
12042 // details.
12043 func (c *ProjectsLocationsMeshesRouteViewsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsMeshesRouteViewsListCall {
12044 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12045 return c
12046 }
12047
12048 // IfNoneMatch sets an optional parameter which makes the operation fail if the
12049 // object's ETag matches the given value. This is useful for getting updates
12050 // only after the object has changed since the last request.
12051 func (c *ProjectsLocationsMeshesRouteViewsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsMeshesRouteViewsListCall {
12052 c.ifNoneMatch_ = entityTag
12053 return c
12054 }
12055
12056 // Context sets the context to be used in this call's Do method.
12057 func (c *ProjectsLocationsMeshesRouteViewsListCall) Context(ctx context.Context) *ProjectsLocationsMeshesRouteViewsListCall {
12058 c.ctx_ = ctx
12059 return c
12060 }
12061
12062 // Header returns a http.Header that can be modified by the caller to add
12063 // headers to the request.
12064 func (c *ProjectsLocationsMeshesRouteViewsListCall) Header() http.Header {
12065 if c.header_ == nil {
12066 c.header_ = make(http.Header)
12067 }
12068 return c.header_
12069 }
12070
12071 func (c *ProjectsLocationsMeshesRouteViewsListCall) doRequest(alt string) (*http.Response, error) {
12072 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
12073 if c.ifNoneMatch_ != "" {
12074 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12075 }
12076 c.urlParams_.Set("alt", alt)
12077 c.urlParams_.Set("prettyPrint", "false")
12078 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/routeViews")
12079 urls += "?" + c.urlParams_.Encode()
12080 req, err := http.NewRequest("GET", urls, nil)
12081 if err != nil {
12082 return nil, err
12083 }
12084 req.Header = reqHeaders
12085 googleapi.Expand(req.URL, map[string]string{
12086 "parent": c.parent,
12087 })
12088 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.routeViews.list", "request", internallog.HTTPRequest(req, nil))
12089 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12090 }
12091
12092 // Do executes the "networkservices.projects.locations.meshes.routeViews.list" call.
12093 // Any non-2xx status code is an error. Response headers are in either
12094 // *ListMeshRouteViewsResponse.ServerResponse.Header or (if a response was
12095 // returned at all) in error.(*googleapi.Error).Header. Use
12096 // googleapi.IsNotModified to check whether the returned error was because
12097 // http.StatusNotModified was returned.
12098 func (c *ProjectsLocationsMeshesRouteViewsListCall) Do(opts ...googleapi.CallOption) (*ListMeshRouteViewsResponse, error) {
12099 gensupport.SetOptions(c.urlParams_, opts...)
12100 res, err := c.doRequest("json")
12101 if res != nil && res.StatusCode == http.StatusNotModified {
12102 if res.Body != nil {
12103 res.Body.Close()
12104 }
12105 return nil, gensupport.WrapError(&googleapi.Error{
12106 Code: res.StatusCode,
12107 Header: res.Header,
12108 })
12109 }
12110 if err != nil {
12111 return nil, err
12112 }
12113 defer googleapi.CloseBody(res)
12114 if err := googleapi.CheckResponse(res); err != nil {
12115 return nil, gensupport.WrapError(err)
12116 }
12117 ret := &ListMeshRouteViewsResponse{
12118 ServerResponse: googleapi.ServerResponse{
12119 Header: res.Header,
12120 HTTPStatusCode: res.StatusCode,
12121 },
12122 }
12123 target := &ret
12124 b, err := gensupport.DecodeResponseBytes(target, res)
12125 if err != nil {
12126 return nil, err
12127 }
12128 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.routeViews.list", "response", internallog.HTTPResponse(res, b))
12129 return ret, nil
12130 }
12131
12132 // Pages invokes f for each page of results.
12133 // A non-nil error returned from f will halt the iteration.
12134 // The provided context supersedes any context provided to the Context method.
12135 func (c *ProjectsLocationsMeshesRouteViewsListCall) Pages(ctx context.Context, f func(*ListMeshRouteViewsResponse) error) error {
12136 c.ctx_ = ctx
12137 defer c.PageToken(c.urlParams_.Get("pageToken"))
12138 for {
12139 x, err := c.Do()
12140 if err != nil {
12141 return err
12142 }
12143 if err := f(x); err != nil {
12144 return err
12145 }
12146 if x.NextPageToken == "" {
12147 return nil
12148 }
12149 c.PageToken(x.NextPageToken)
12150 }
12151 }
12152
12153 type ProjectsLocationsOperationsCancelCall struct {
12154 s *Service
12155 name string
12156 canceloperationrequest *CancelOperationRequest
12157 urlParams_ gensupport.URLParams
12158 ctx_ context.Context
12159 header_ http.Header
12160 }
12161
12162 // Cancel: Starts asynchronous cancellation on a long-running operation. The
12163 // server makes a best effort to cancel the operation, but success is not
12164 // guaranteed. If the server doesn't support this method, it returns
12165 // `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or
12166 // other methods to check whether the cancellation succeeded or whether the
12167 // operation completed despite cancellation. On successful cancellation, the
12168 // operation is not deleted; instead, it becomes an operation with an
12169 // Operation.error value with a google.rpc.Status.code of `1`, corresponding to
12170 // `Code.CANCELLED`.
12171 //
12172 // - name: The name of the operation resource to be cancelled.
12173 func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall {
12174 c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12175 c.name = name
12176 c.canceloperationrequest = canceloperationrequest
12177 return c
12178 }
12179
12180 // Fields allows partial responses to be retrieved. See
12181 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
12182 // details.
12183 func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall {
12184 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12185 return c
12186 }
12187
12188 // Context sets the context to be used in this call's Do method.
12189 func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall {
12190 c.ctx_ = ctx
12191 return c
12192 }
12193
12194 // Header returns a http.Header that can be modified by the caller to add
12195 // headers to the request.
12196 func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header {
12197 if c.header_ == nil {
12198 c.header_ = make(http.Header)
12199 }
12200 return c.header_
12201 }
12202
12203 func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
12204 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
12205 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest)
12206 if err != nil {
12207 return nil, err
12208 }
12209 c.urlParams_.Set("alt", alt)
12210 c.urlParams_.Set("prettyPrint", "false")
12211 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel")
12212 urls += "?" + c.urlParams_.Encode()
12213 req, err := http.NewRequest("POST", urls, body)
12214 if err != nil {
12215 return nil, err
12216 }
12217 req.Header = reqHeaders
12218 googleapi.Expand(req.URL, map[string]string{
12219 "name": c.name,
12220 })
12221 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.operations.cancel", "request", internallog.HTTPRequest(req, body.Bytes()))
12222 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12223 }
12224
12225 // Do executes the "networkservices.projects.locations.operations.cancel" call.
12226 // Any non-2xx status code is an error. Response headers are in either
12227 // *Empty.ServerResponse.Header or (if a response was returned at all) in
12228 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
12229 // whether the returned error was because http.StatusNotModified was returned.
12230 func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
12231 gensupport.SetOptions(c.urlParams_, opts...)
12232 res, err := c.doRequest("json")
12233 if res != nil && res.StatusCode == http.StatusNotModified {
12234 if res.Body != nil {
12235 res.Body.Close()
12236 }
12237 return nil, gensupport.WrapError(&googleapi.Error{
12238 Code: res.StatusCode,
12239 Header: res.Header,
12240 })
12241 }
12242 if err != nil {
12243 return nil, err
12244 }
12245 defer googleapi.CloseBody(res)
12246 if err := googleapi.CheckResponse(res); err != nil {
12247 return nil, gensupport.WrapError(err)
12248 }
12249 ret := &Empty{
12250 ServerResponse: googleapi.ServerResponse{
12251 Header: res.Header,
12252 HTTPStatusCode: res.StatusCode,
12253 },
12254 }
12255 target := &ret
12256 b, err := gensupport.DecodeResponseBytes(target, res)
12257 if err != nil {
12258 return nil, err
12259 }
12260 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.operations.cancel", "response", internallog.HTTPResponse(res, b))
12261 return ret, nil
12262 }
12263
12264 type ProjectsLocationsOperationsDeleteCall struct {
12265 s *Service
12266 name string
12267 urlParams_ gensupport.URLParams
12268 ctx_ context.Context
12269 header_ http.Header
12270 }
12271
12272 // Delete: Deletes a long-running operation. This method indicates that the
12273 // client is no longer interested in the operation result. It does not cancel
12274 // the operation. If the server doesn't support this method, it returns
12275 // `google.rpc.Code.UNIMPLEMENTED`.
12276 //
12277 // - name: The name of the operation resource to be deleted.
12278 func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall {
12279 c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12280 c.name = name
12281 return c
12282 }
12283
12284 // Fields allows partial responses to be retrieved. See
12285 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
12286 // details.
12287 func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall {
12288 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12289 return c
12290 }
12291
12292 // Context sets the context to be used in this call's Do method.
12293 func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall {
12294 c.ctx_ = ctx
12295 return c
12296 }
12297
12298 // Header returns a http.Header that can be modified by the caller to add
12299 // headers to the request.
12300 func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header {
12301 if c.header_ == nil {
12302 c.header_ = make(http.Header)
12303 }
12304 return c.header_
12305 }
12306
12307 func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
12308 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
12309 c.urlParams_.Set("alt", alt)
12310 c.urlParams_.Set("prettyPrint", "false")
12311 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
12312 urls += "?" + c.urlParams_.Encode()
12313 req, err := http.NewRequest("DELETE", urls, nil)
12314 if err != nil {
12315 return nil, err
12316 }
12317 req.Header = reqHeaders
12318 googleapi.Expand(req.URL, map[string]string{
12319 "name": c.name,
12320 })
12321 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.operations.delete", "request", internallog.HTTPRequest(req, nil))
12322 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12323 }
12324
12325 // Do executes the "networkservices.projects.locations.operations.delete" call.
12326 // Any non-2xx status code is an error. Response headers are in either
12327 // *Empty.ServerResponse.Header or (if a response was returned at all) in
12328 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
12329 // whether the returned error was because http.StatusNotModified was returned.
12330 func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
12331 gensupport.SetOptions(c.urlParams_, opts...)
12332 res, err := c.doRequest("json")
12333 if res != nil && res.StatusCode == http.StatusNotModified {
12334 if res.Body != nil {
12335 res.Body.Close()
12336 }
12337 return nil, gensupport.WrapError(&googleapi.Error{
12338 Code: res.StatusCode,
12339 Header: res.Header,
12340 })
12341 }
12342 if err != nil {
12343 return nil, err
12344 }
12345 defer googleapi.CloseBody(res)
12346 if err := googleapi.CheckResponse(res); err != nil {
12347 return nil, gensupport.WrapError(err)
12348 }
12349 ret := &Empty{
12350 ServerResponse: googleapi.ServerResponse{
12351 Header: res.Header,
12352 HTTPStatusCode: res.StatusCode,
12353 },
12354 }
12355 target := &ret
12356 b, err := gensupport.DecodeResponseBytes(target, res)
12357 if err != nil {
12358 return nil, err
12359 }
12360 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.operations.delete", "response", internallog.HTTPResponse(res, b))
12361 return ret, nil
12362 }
12363
12364 type ProjectsLocationsOperationsGetCall struct {
12365 s *Service
12366 name string
12367 urlParams_ gensupport.URLParams
12368 ifNoneMatch_ string
12369 ctx_ context.Context
12370 header_ http.Header
12371 }
12372
12373 // Get: Gets the latest state of a long-running operation. Clients can use this
12374 // method to poll the operation result at intervals as recommended by the API
12375 // service.
12376 //
12377 // - name: The name of the operation resource.
12378 func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
12379 c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12380 c.name = name
12381 return c
12382 }
12383
12384 // Fields allows partial responses to be retrieved. See
12385 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
12386 // details.
12387 func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
12388 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12389 return c
12390 }
12391
12392 // IfNoneMatch sets an optional parameter which makes the operation fail if the
12393 // object's ETag matches the given value. This is useful for getting updates
12394 // only after the object has changed since the last request.
12395 func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
12396 c.ifNoneMatch_ = entityTag
12397 return c
12398 }
12399
12400 // Context sets the context to be used in this call's Do method.
12401 func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
12402 c.ctx_ = ctx
12403 return c
12404 }
12405
12406 // Header returns a http.Header that can be modified by the caller to add
12407 // headers to the request.
12408 func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
12409 if c.header_ == nil {
12410 c.header_ = make(http.Header)
12411 }
12412 return c.header_
12413 }
12414
12415 func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
12416 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
12417 if c.ifNoneMatch_ != "" {
12418 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12419 }
12420 c.urlParams_.Set("alt", alt)
12421 c.urlParams_.Set("prettyPrint", "false")
12422 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
12423 urls += "?" + c.urlParams_.Encode()
12424 req, err := http.NewRequest("GET", urls, nil)
12425 if err != nil {
12426 return nil, err
12427 }
12428 req.Header = reqHeaders
12429 googleapi.Expand(req.URL, map[string]string{
12430 "name": c.name,
12431 })
12432 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.operations.get", "request", internallog.HTTPRequest(req, nil))
12433 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12434 }
12435
12436 // Do executes the "networkservices.projects.locations.operations.get" call.
12437 // Any non-2xx status code is an error. Response headers are in either
12438 // *Operation.ServerResponse.Header or (if a response was returned at all) in
12439 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
12440 // whether the returned error was because http.StatusNotModified was returned.
12441 func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
12442 gensupport.SetOptions(c.urlParams_, opts...)
12443 res, err := c.doRequest("json")
12444 if res != nil && res.StatusCode == http.StatusNotModified {
12445 if res.Body != nil {
12446 res.Body.Close()
12447 }
12448 return nil, gensupport.WrapError(&googleapi.Error{
12449 Code: res.StatusCode,
12450 Header: res.Header,
12451 })
12452 }
12453 if err != nil {
12454 return nil, err
12455 }
12456 defer googleapi.CloseBody(res)
12457 if err := googleapi.CheckResponse(res); err != nil {
12458 return nil, gensupport.WrapError(err)
12459 }
12460 ret := &Operation{
12461 ServerResponse: googleapi.ServerResponse{
12462 Header: res.Header,
12463 HTTPStatusCode: res.StatusCode,
12464 },
12465 }
12466 target := &ret
12467 b, err := gensupport.DecodeResponseBytes(target, res)
12468 if err != nil {
12469 return nil, err
12470 }
12471 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.operations.get", "response", internallog.HTTPResponse(res, b))
12472 return ret, nil
12473 }
12474
12475 type ProjectsLocationsOperationsListCall struct {
12476 s *Service
12477 name string
12478 urlParams_ gensupport.URLParams
12479 ifNoneMatch_ string
12480 ctx_ context.Context
12481 header_ http.Header
12482 }
12483
12484 // List: Lists operations that match the specified filter in the request. If
12485 // the server doesn't support this method, it returns `UNIMPLEMENTED`.
12486 //
12487 // - name: The name of the operation's parent resource.
12488 func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall {
12489 c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12490 c.name = name
12491 return c
12492 }
12493
12494 // Filter sets the optional parameter "filter": The standard list filter.
12495 func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall {
12496 c.urlParams_.Set("filter", filter)
12497 return c
12498 }
12499
12500 // PageSize sets the optional parameter "pageSize": The standard list page
12501 // size.
12502 func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall {
12503 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
12504 return c
12505 }
12506
12507 // PageToken sets the optional parameter "pageToken": The standard list page
12508 // token.
12509 func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall {
12510 c.urlParams_.Set("pageToken", pageToken)
12511 return c
12512 }
12513
12514 // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
12515 // When set to `true`, operations that are reachable are returned as normal,
12516 // and those that are unreachable are returned in the
12517 // ListOperationsResponse.unreachable field. This can only be `true` when
12518 // reading across collections. For example, when `parent` is set to
12519 // "projects/example/locations/-". This field is not supported by default and
12520 // will result in an `UNIMPLEMENTED` error if set unless explicitly documented
12521 // otherwise in service or product specific documentation.
12522 func (c *ProjectsLocationsOperationsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ProjectsLocationsOperationsListCall {
12523 c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
12524 return c
12525 }
12526
12527 // Fields allows partial responses to be retrieved. See
12528 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
12529 // details.
12530 func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
12531 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12532 return c
12533 }
12534
12535 // IfNoneMatch sets an optional parameter which makes the operation fail if the
12536 // object's ETag matches the given value. This is useful for getting updates
12537 // only after the object has changed since the last request.
12538 func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
12539 c.ifNoneMatch_ = entityTag
12540 return c
12541 }
12542
12543 // Context sets the context to be used in this call's Do method.
12544 func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
12545 c.ctx_ = ctx
12546 return c
12547 }
12548
12549 // Header returns a http.Header that can be modified by the caller to add
12550 // headers to the request.
12551 func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
12552 if c.header_ == nil {
12553 c.header_ = make(http.Header)
12554 }
12555 return c.header_
12556 }
12557
12558 func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
12559 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
12560 if c.ifNoneMatch_ != "" {
12561 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12562 }
12563 c.urlParams_.Set("alt", alt)
12564 c.urlParams_.Set("prettyPrint", "false")
12565 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations")
12566 urls += "?" + c.urlParams_.Encode()
12567 req, err := http.NewRequest("GET", urls, nil)
12568 if err != nil {
12569 return nil, err
12570 }
12571 req.Header = reqHeaders
12572 googleapi.Expand(req.URL, map[string]string{
12573 "name": c.name,
12574 })
12575 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.operations.list", "request", internallog.HTTPRequest(req, nil))
12576 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12577 }
12578
12579 // Do executes the "networkservices.projects.locations.operations.list" call.
12580 // Any non-2xx status code is an error. Response headers are in either
12581 // *ListOperationsResponse.ServerResponse.Header or (if a response was returned
12582 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
12583 // check whether the returned error was because http.StatusNotModified was
12584 // returned.
12585 func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
12586 gensupport.SetOptions(c.urlParams_, opts...)
12587 res, err := c.doRequest("json")
12588 if res != nil && res.StatusCode == http.StatusNotModified {
12589 if res.Body != nil {
12590 res.Body.Close()
12591 }
12592 return nil, gensupport.WrapError(&googleapi.Error{
12593 Code: res.StatusCode,
12594 Header: res.Header,
12595 })
12596 }
12597 if err != nil {
12598 return nil, err
12599 }
12600 defer googleapi.CloseBody(res)
12601 if err := googleapi.CheckResponse(res); err != nil {
12602 return nil, gensupport.WrapError(err)
12603 }
12604 ret := &ListOperationsResponse{
12605 ServerResponse: googleapi.ServerResponse{
12606 Header: res.Header,
12607 HTTPStatusCode: res.StatusCode,
12608 },
12609 }
12610 target := &ret
12611 b, err := gensupport.DecodeResponseBytes(target, res)
12612 if err != nil {
12613 return nil, err
12614 }
12615 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.operations.list", "response", internallog.HTTPResponse(res, b))
12616 return ret, nil
12617 }
12618
12619 // Pages invokes f for each page of results.
12620 // A non-nil error returned from f will halt the iteration.
12621 // The provided context supersedes any context provided to the Context method.
12622 func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
12623 c.ctx_ = ctx
12624 defer c.PageToken(c.urlParams_.Get("pageToken"))
12625 for {
12626 x, err := c.Do()
12627 if err != nil {
12628 return err
12629 }
12630 if err := f(x); err != nil {
12631 return err
12632 }
12633 if x.NextPageToken == "" {
12634 return nil
12635 }
12636 c.PageToken(x.NextPageToken)
12637 }
12638 }
12639
12640 type ProjectsLocationsServiceBindingsCreateCall struct {
12641 s *Service
12642 parent string
12643 servicebinding *ServiceBinding
12644 urlParams_ gensupport.URLParams
12645 ctx_ context.Context
12646 header_ http.Header
12647 }
12648
12649 // Create: Creates a new ServiceBinding in a given project and location.
12650 //
12651 // - parent: The parent resource of the ServiceBinding. Must be in the format
12652 // `projects/*/locations/*`.
12653 func (r *ProjectsLocationsServiceBindingsService) Create(parent string, servicebinding *ServiceBinding) *ProjectsLocationsServiceBindingsCreateCall {
12654 c := &ProjectsLocationsServiceBindingsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12655 c.parent = parent
12656 c.servicebinding = servicebinding
12657 return c
12658 }
12659
12660 // ServiceBindingId sets the optional parameter "serviceBindingId": Required.
12661 // Short name of the ServiceBinding resource to be created.
12662 func (c *ProjectsLocationsServiceBindingsCreateCall) ServiceBindingId(serviceBindingId string) *ProjectsLocationsServiceBindingsCreateCall {
12663 c.urlParams_.Set("serviceBindingId", serviceBindingId)
12664 return c
12665 }
12666
12667 // Fields allows partial responses to be retrieved. See
12668 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
12669 // details.
12670 func (c *ProjectsLocationsServiceBindingsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsServiceBindingsCreateCall {
12671 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12672 return c
12673 }
12674
12675 // Context sets the context to be used in this call's Do method.
12676 func (c *ProjectsLocationsServiceBindingsCreateCall) Context(ctx context.Context) *ProjectsLocationsServiceBindingsCreateCall {
12677 c.ctx_ = ctx
12678 return c
12679 }
12680
12681 // Header returns a http.Header that can be modified by the caller to add
12682 // headers to the request.
12683 func (c *ProjectsLocationsServiceBindingsCreateCall) Header() http.Header {
12684 if c.header_ == nil {
12685 c.header_ = make(http.Header)
12686 }
12687 return c.header_
12688 }
12689
12690 func (c *ProjectsLocationsServiceBindingsCreateCall) doRequest(alt string) (*http.Response, error) {
12691 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
12692 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.servicebinding)
12693 if err != nil {
12694 return nil, err
12695 }
12696 c.urlParams_.Set("alt", alt)
12697 c.urlParams_.Set("prettyPrint", "false")
12698 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/serviceBindings")
12699 urls += "?" + c.urlParams_.Encode()
12700 req, err := http.NewRequest("POST", urls, body)
12701 if err != nil {
12702 return nil, err
12703 }
12704 req.Header = reqHeaders
12705 googleapi.Expand(req.URL, map[string]string{
12706 "parent": c.parent,
12707 })
12708 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceBindings.create", "request", internallog.HTTPRequest(req, body.Bytes()))
12709 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12710 }
12711
12712 // Do executes the "networkservices.projects.locations.serviceBindings.create" call.
12713 // Any non-2xx status code is an error. Response headers are in either
12714 // *Operation.ServerResponse.Header or (if a response was returned at all) in
12715 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
12716 // whether the returned error was because http.StatusNotModified was returned.
12717 func (c *ProjectsLocationsServiceBindingsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
12718 gensupport.SetOptions(c.urlParams_, opts...)
12719 res, err := c.doRequest("json")
12720 if res != nil && res.StatusCode == http.StatusNotModified {
12721 if res.Body != nil {
12722 res.Body.Close()
12723 }
12724 return nil, gensupport.WrapError(&googleapi.Error{
12725 Code: res.StatusCode,
12726 Header: res.Header,
12727 })
12728 }
12729 if err != nil {
12730 return nil, err
12731 }
12732 defer googleapi.CloseBody(res)
12733 if err := googleapi.CheckResponse(res); err != nil {
12734 return nil, gensupport.WrapError(err)
12735 }
12736 ret := &Operation{
12737 ServerResponse: googleapi.ServerResponse{
12738 Header: res.Header,
12739 HTTPStatusCode: res.StatusCode,
12740 },
12741 }
12742 target := &ret
12743 b, err := gensupport.DecodeResponseBytes(target, res)
12744 if err != nil {
12745 return nil, err
12746 }
12747 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceBindings.create", "response", internallog.HTTPResponse(res, b))
12748 return ret, nil
12749 }
12750
12751 type ProjectsLocationsServiceBindingsDeleteCall struct {
12752 s *Service
12753 name string
12754 urlParams_ gensupport.URLParams
12755 ctx_ context.Context
12756 header_ http.Header
12757 }
12758
12759 // Delete: Deletes a single ServiceBinding.
12760 //
12761 // - name: A name of the ServiceBinding to delete. Must be in the format
12762 // `projects/*/locations/*/serviceBindings/*`.
12763 func (r *ProjectsLocationsServiceBindingsService) Delete(name string) *ProjectsLocationsServiceBindingsDeleteCall {
12764 c := &ProjectsLocationsServiceBindingsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12765 c.name = name
12766 return c
12767 }
12768
12769 // Fields allows partial responses to be retrieved. See
12770 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
12771 // details.
12772 func (c *ProjectsLocationsServiceBindingsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsServiceBindingsDeleteCall {
12773 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12774 return c
12775 }
12776
12777 // Context sets the context to be used in this call's Do method.
12778 func (c *ProjectsLocationsServiceBindingsDeleteCall) Context(ctx context.Context) *ProjectsLocationsServiceBindingsDeleteCall {
12779 c.ctx_ = ctx
12780 return c
12781 }
12782
12783 // Header returns a http.Header that can be modified by the caller to add
12784 // headers to the request.
12785 func (c *ProjectsLocationsServiceBindingsDeleteCall) Header() http.Header {
12786 if c.header_ == nil {
12787 c.header_ = make(http.Header)
12788 }
12789 return c.header_
12790 }
12791
12792 func (c *ProjectsLocationsServiceBindingsDeleteCall) doRequest(alt string) (*http.Response, error) {
12793 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
12794 c.urlParams_.Set("alt", alt)
12795 c.urlParams_.Set("prettyPrint", "false")
12796 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
12797 urls += "?" + c.urlParams_.Encode()
12798 req, err := http.NewRequest("DELETE", urls, nil)
12799 if err != nil {
12800 return nil, err
12801 }
12802 req.Header = reqHeaders
12803 googleapi.Expand(req.URL, map[string]string{
12804 "name": c.name,
12805 })
12806 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceBindings.delete", "request", internallog.HTTPRequest(req, nil))
12807 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12808 }
12809
12810 // Do executes the "networkservices.projects.locations.serviceBindings.delete" call.
12811 // Any non-2xx status code is an error. Response headers are in either
12812 // *Operation.ServerResponse.Header or (if a response was returned at all) in
12813 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
12814 // whether the returned error was because http.StatusNotModified was returned.
12815 func (c *ProjectsLocationsServiceBindingsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
12816 gensupport.SetOptions(c.urlParams_, opts...)
12817 res, err := c.doRequest("json")
12818 if res != nil && res.StatusCode == http.StatusNotModified {
12819 if res.Body != nil {
12820 res.Body.Close()
12821 }
12822 return nil, gensupport.WrapError(&googleapi.Error{
12823 Code: res.StatusCode,
12824 Header: res.Header,
12825 })
12826 }
12827 if err != nil {
12828 return nil, err
12829 }
12830 defer googleapi.CloseBody(res)
12831 if err := googleapi.CheckResponse(res); err != nil {
12832 return nil, gensupport.WrapError(err)
12833 }
12834 ret := &Operation{
12835 ServerResponse: googleapi.ServerResponse{
12836 Header: res.Header,
12837 HTTPStatusCode: res.StatusCode,
12838 },
12839 }
12840 target := &ret
12841 b, err := gensupport.DecodeResponseBytes(target, res)
12842 if err != nil {
12843 return nil, err
12844 }
12845 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceBindings.delete", "response", internallog.HTTPResponse(res, b))
12846 return ret, nil
12847 }
12848
12849 type ProjectsLocationsServiceBindingsGetCall struct {
12850 s *Service
12851 name string
12852 urlParams_ gensupport.URLParams
12853 ifNoneMatch_ string
12854 ctx_ context.Context
12855 header_ http.Header
12856 }
12857
12858 // Get: Gets details of a single ServiceBinding.
12859 //
12860 // - name: A name of the ServiceBinding to get. Must be in the format
12861 // `projects/*/locations/*/serviceBindings/*`.
12862 func (r *ProjectsLocationsServiceBindingsService) Get(name string) *ProjectsLocationsServiceBindingsGetCall {
12863 c := &ProjectsLocationsServiceBindingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12864 c.name = name
12865 return c
12866 }
12867
12868 // Fields allows partial responses to be retrieved. See
12869 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
12870 // details.
12871 func (c *ProjectsLocationsServiceBindingsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsServiceBindingsGetCall {
12872 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12873 return c
12874 }
12875
12876 // IfNoneMatch sets an optional parameter which makes the operation fail if the
12877 // object's ETag matches the given value. This is useful for getting updates
12878 // only after the object has changed since the last request.
12879 func (c *ProjectsLocationsServiceBindingsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsServiceBindingsGetCall {
12880 c.ifNoneMatch_ = entityTag
12881 return c
12882 }
12883
12884 // Context sets the context to be used in this call's Do method.
12885 func (c *ProjectsLocationsServiceBindingsGetCall) Context(ctx context.Context) *ProjectsLocationsServiceBindingsGetCall {
12886 c.ctx_ = ctx
12887 return c
12888 }
12889
12890 // Header returns a http.Header that can be modified by the caller to add
12891 // headers to the request.
12892 func (c *ProjectsLocationsServiceBindingsGetCall) Header() http.Header {
12893 if c.header_ == nil {
12894 c.header_ = make(http.Header)
12895 }
12896 return c.header_
12897 }
12898
12899 func (c *ProjectsLocationsServiceBindingsGetCall) doRequest(alt string) (*http.Response, error) {
12900 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
12901 if c.ifNoneMatch_ != "" {
12902 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12903 }
12904 c.urlParams_.Set("alt", alt)
12905 c.urlParams_.Set("prettyPrint", "false")
12906 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
12907 urls += "?" + c.urlParams_.Encode()
12908 req, err := http.NewRequest("GET", urls, nil)
12909 if err != nil {
12910 return nil, err
12911 }
12912 req.Header = reqHeaders
12913 googleapi.Expand(req.URL, map[string]string{
12914 "name": c.name,
12915 })
12916 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceBindings.get", "request", internallog.HTTPRequest(req, nil))
12917 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12918 }
12919
12920 // Do executes the "networkservices.projects.locations.serviceBindings.get" call.
12921 // Any non-2xx status code is an error. Response headers are in either
12922 // *ServiceBinding.ServerResponse.Header or (if a response was returned at all)
12923 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
12924 // whether the returned error was because http.StatusNotModified was returned.
12925 func (c *ProjectsLocationsServiceBindingsGetCall) Do(opts ...googleapi.CallOption) (*ServiceBinding, error) {
12926 gensupport.SetOptions(c.urlParams_, opts...)
12927 res, err := c.doRequest("json")
12928 if res != nil && res.StatusCode == http.StatusNotModified {
12929 if res.Body != nil {
12930 res.Body.Close()
12931 }
12932 return nil, gensupport.WrapError(&googleapi.Error{
12933 Code: res.StatusCode,
12934 Header: res.Header,
12935 })
12936 }
12937 if err != nil {
12938 return nil, err
12939 }
12940 defer googleapi.CloseBody(res)
12941 if err := googleapi.CheckResponse(res); err != nil {
12942 return nil, gensupport.WrapError(err)
12943 }
12944 ret := &ServiceBinding{
12945 ServerResponse: googleapi.ServerResponse{
12946 Header: res.Header,
12947 HTTPStatusCode: res.StatusCode,
12948 },
12949 }
12950 target := &ret
12951 b, err := gensupport.DecodeResponseBytes(target, res)
12952 if err != nil {
12953 return nil, err
12954 }
12955 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceBindings.get", "response", internallog.HTTPResponse(res, b))
12956 return ret, nil
12957 }
12958
12959 type ProjectsLocationsServiceBindingsListCall struct {
12960 s *Service
12961 parent string
12962 urlParams_ gensupport.URLParams
12963 ifNoneMatch_ string
12964 ctx_ context.Context
12965 header_ http.Header
12966 }
12967
12968 // List: Lists ServiceBinding in a given project and location.
12969 //
12970 // - parent: The project and location from which the ServiceBindings should be
12971 // listed, specified in the format `projects/*/locations/*`.
12972 func (r *ProjectsLocationsServiceBindingsService) List(parent string) *ProjectsLocationsServiceBindingsListCall {
12973 c := &ProjectsLocationsServiceBindingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12974 c.parent = parent
12975 return c
12976 }
12977
12978 // PageSize sets the optional parameter "pageSize": Maximum number of
12979 // ServiceBindings to return per call.
12980 func (c *ProjectsLocationsServiceBindingsListCall) PageSize(pageSize int64) *ProjectsLocationsServiceBindingsListCall {
12981 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
12982 return c
12983 }
12984
12985 // PageToken sets the optional parameter "pageToken": The value returned by the
12986 // last `ListServiceBindingsResponse` Indicates that this is a continuation of
12987 // a prior `ListRouters` call, and that the system should return the next page
12988 // of data.
12989 func (c *ProjectsLocationsServiceBindingsListCall) PageToken(pageToken string) *ProjectsLocationsServiceBindingsListCall {
12990 c.urlParams_.Set("pageToken", pageToken)
12991 return c
12992 }
12993
12994 // Fields allows partial responses to be retrieved. See
12995 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
12996 // details.
12997 func (c *ProjectsLocationsServiceBindingsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsServiceBindingsListCall {
12998 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12999 return c
13000 }
13001
13002 // IfNoneMatch sets an optional parameter which makes the operation fail if the
13003 // object's ETag matches the given value. This is useful for getting updates
13004 // only after the object has changed since the last request.
13005 func (c *ProjectsLocationsServiceBindingsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsServiceBindingsListCall {
13006 c.ifNoneMatch_ = entityTag
13007 return c
13008 }
13009
13010 // Context sets the context to be used in this call's Do method.
13011 func (c *ProjectsLocationsServiceBindingsListCall) Context(ctx context.Context) *ProjectsLocationsServiceBindingsListCall {
13012 c.ctx_ = ctx
13013 return c
13014 }
13015
13016 // Header returns a http.Header that can be modified by the caller to add
13017 // headers to the request.
13018 func (c *ProjectsLocationsServiceBindingsListCall) Header() http.Header {
13019 if c.header_ == nil {
13020 c.header_ = make(http.Header)
13021 }
13022 return c.header_
13023 }
13024
13025 func (c *ProjectsLocationsServiceBindingsListCall) doRequest(alt string) (*http.Response, error) {
13026 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
13027 if c.ifNoneMatch_ != "" {
13028 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
13029 }
13030 c.urlParams_.Set("alt", alt)
13031 c.urlParams_.Set("prettyPrint", "false")
13032 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/serviceBindings")
13033 urls += "?" + c.urlParams_.Encode()
13034 req, err := http.NewRequest("GET", urls, nil)
13035 if err != nil {
13036 return nil, err
13037 }
13038 req.Header = reqHeaders
13039 googleapi.Expand(req.URL, map[string]string{
13040 "parent": c.parent,
13041 })
13042 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceBindings.list", "request", internallog.HTTPRequest(req, nil))
13043 return gensupport.SendRequest(c.ctx_, c.s.client, req)
13044 }
13045
13046 // Do executes the "networkservices.projects.locations.serviceBindings.list" call.
13047 // Any non-2xx status code is an error. Response headers are in either
13048 // *ListServiceBindingsResponse.ServerResponse.Header or (if a response was
13049 // returned at all) in error.(*googleapi.Error).Header. Use
13050 // googleapi.IsNotModified to check whether the returned error was because
13051 // http.StatusNotModified was returned.
13052 func (c *ProjectsLocationsServiceBindingsListCall) Do(opts ...googleapi.CallOption) (*ListServiceBindingsResponse, error) {
13053 gensupport.SetOptions(c.urlParams_, opts...)
13054 res, err := c.doRequest("json")
13055 if res != nil && res.StatusCode == http.StatusNotModified {
13056 if res.Body != nil {
13057 res.Body.Close()
13058 }
13059 return nil, gensupport.WrapError(&googleapi.Error{
13060 Code: res.StatusCode,
13061 Header: res.Header,
13062 })
13063 }
13064 if err != nil {
13065 return nil, err
13066 }
13067 defer googleapi.CloseBody(res)
13068 if err := googleapi.CheckResponse(res); err != nil {
13069 return nil, gensupport.WrapError(err)
13070 }
13071 ret := &ListServiceBindingsResponse{
13072 ServerResponse: googleapi.ServerResponse{
13073 Header: res.Header,
13074 HTTPStatusCode: res.StatusCode,
13075 },
13076 }
13077 target := &ret
13078 b, err := gensupport.DecodeResponseBytes(target, res)
13079 if err != nil {
13080 return nil, err
13081 }
13082 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceBindings.list", "response", internallog.HTTPResponse(res, b))
13083 return ret, nil
13084 }
13085
13086 // Pages invokes f for each page of results.
13087 // A non-nil error returned from f will halt the iteration.
13088 // The provided context supersedes any context provided to the Context method.
13089 func (c *ProjectsLocationsServiceBindingsListCall) Pages(ctx context.Context, f func(*ListServiceBindingsResponse) error) error {
13090 c.ctx_ = ctx
13091 defer c.PageToken(c.urlParams_.Get("pageToken"))
13092 for {
13093 x, err := c.Do()
13094 if err != nil {
13095 return err
13096 }
13097 if err := f(x); err != nil {
13098 return err
13099 }
13100 if x.NextPageToken == "" {
13101 return nil
13102 }
13103 c.PageToken(x.NextPageToken)
13104 }
13105 }
13106
13107 type ProjectsLocationsServiceBindingsPatchCall struct {
13108 s *Service
13109 name string
13110 servicebinding *ServiceBinding
13111 urlParams_ gensupport.URLParams
13112 ctx_ context.Context
13113 header_ http.Header
13114 }
13115
13116 // Patch: Updates the parameters of a single ServiceBinding.
13117 //
13118 // - name: Identifier. Name of the ServiceBinding resource. It matches pattern
13119 // `projects/*/locations/*/serviceBindings/`.
13120 func (r *ProjectsLocationsServiceBindingsService) Patch(name string, servicebinding *ServiceBinding) *ProjectsLocationsServiceBindingsPatchCall {
13121 c := &ProjectsLocationsServiceBindingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13122 c.name = name
13123 c.servicebinding = servicebinding
13124 return c
13125 }
13126
13127 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
13128 // specify the fields to be overwritten in the ServiceBinding resource by the
13129 // update. The fields specified in the update_mask are relative to the
13130 // resource, not the full request. A field will be overwritten if it is in the
13131 // mask. If the user does not provide a mask then all fields will be
13132 // overwritten.
13133 func (c *ProjectsLocationsServiceBindingsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsServiceBindingsPatchCall {
13134 c.urlParams_.Set("updateMask", updateMask)
13135 return c
13136 }
13137
13138 // Fields allows partial responses to be retrieved. See
13139 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
13140 // details.
13141 func (c *ProjectsLocationsServiceBindingsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsServiceBindingsPatchCall {
13142 c.urlParams_.Set("fields", googleapi.CombineFields(s))
13143 return c
13144 }
13145
13146 // Context sets the context to be used in this call's Do method.
13147 func (c *ProjectsLocationsServiceBindingsPatchCall) Context(ctx context.Context) *ProjectsLocationsServiceBindingsPatchCall {
13148 c.ctx_ = ctx
13149 return c
13150 }
13151
13152 // Header returns a http.Header that can be modified by the caller to add
13153 // headers to the request.
13154 func (c *ProjectsLocationsServiceBindingsPatchCall) Header() http.Header {
13155 if c.header_ == nil {
13156 c.header_ = make(http.Header)
13157 }
13158 return c.header_
13159 }
13160
13161 func (c *ProjectsLocationsServiceBindingsPatchCall) doRequest(alt string) (*http.Response, error) {
13162 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
13163 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.servicebinding)
13164 if err != nil {
13165 return nil, err
13166 }
13167 c.urlParams_.Set("alt", alt)
13168 c.urlParams_.Set("prettyPrint", "false")
13169 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
13170 urls += "?" + c.urlParams_.Encode()
13171 req, err := http.NewRequest("PATCH", urls, body)
13172 if err != nil {
13173 return nil, err
13174 }
13175 req.Header = reqHeaders
13176 googleapi.Expand(req.URL, map[string]string{
13177 "name": c.name,
13178 })
13179 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceBindings.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
13180 return gensupport.SendRequest(c.ctx_, c.s.client, req)
13181 }
13182
13183 // Do executes the "networkservices.projects.locations.serviceBindings.patch" call.
13184 // Any non-2xx status code is an error. Response headers are in either
13185 // *Operation.ServerResponse.Header or (if a response was returned at all) in
13186 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
13187 // whether the returned error was because http.StatusNotModified was returned.
13188 func (c *ProjectsLocationsServiceBindingsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
13189 gensupport.SetOptions(c.urlParams_, opts...)
13190 res, err := c.doRequest("json")
13191 if res != nil && res.StatusCode == http.StatusNotModified {
13192 if res.Body != nil {
13193 res.Body.Close()
13194 }
13195 return nil, gensupport.WrapError(&googleapi.Error{
13196 Code: res.StatusCode,
13197 Header: res.Header,
13198 })
13199 }
13200 if err != nil {
13201 return nil, err
13202 }
13203 defer googleapi.CloseBody(res)
13204 if err := googleapi.CheckResponse(res); err != nil {
13205 return nil, gensupport.WrapError(err)
13206 }
13207 ret := &Operation{
13208 ServerResponse: googleapi.ServerResponse{
13209 Header: res.Header,
13210 HTTPStatusCode: res.StatusCode,
13211 },
13212 }
13213 target := &ret
13214 b, err := gensupport.DecodeResponseBytes(target, res)
13215 if err != nil {
13216 return nil, err
13217 }
13218 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceBindings.patch", "response", internallog.HTTPResponse(res, b))
13219 return ret, nil
13220 }
13221
13222 type ProjectsLocationsServiceLbPoliciesCreateCall struct {
13223 s *Service
13224 parent string
13225 servicelbpolicy *ServiceLbPolicy
13226 urlParams_ gensupport.URLParams
13227 ctx_ context.Context
13228 header_ http.Header
13229 }
13230
13231 // Create: Creates a new ServiceLbPolicy in a given project and location.
13232 //
13233 // - parent: The parent resource of the ServiceLbPolicy. Must be in the format
13234 // `projects/{project}/locations/{location}`.
13235 func (r *ProjectsLocationsServiceLbPoliciesService) Create(parent string, servicelbpolicy *ServiceLbPolicy) *ProjectsLocationsServiceLbPoliciesCreateCall {
13236 c := &ProjectsLocationsServiceLbPoliciesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13237 c.parent = parent
13238 c.servicelbpolicy = servicelbpolicy
13239 return c
13240 }
13241
13242 // ServiceLbPolicyId sets the optional parameter "serviceLbPolicyId": Required.
13243 // Short name of the ServiceLbPolicy resource to be created. E.g. for resource
13244 // name
13245 // `projects/{project}/locations/{location}/serviceLbPolicies/{service_lb_policy
13246 // _name}`. the id is value of {service_lb_policy_name}
13247 func (c *ProjectsLocationsServiceLbPoliciesCreateCall) ServiceLbPolicyId(serviceLbPolicyId string) *ProjectsLocationsServiceLbPoliciesCreateCall {
13248 c.urlParams_.Set("serviceLbPolicyId", serviceLbPolicyId)
13249 return c
13250 }
13251
13252 // Fields allows partial responses to be retrieved. See
13253 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
13254 // details.
13255 func (c *ProjectsLocationsServiceLbPoliciesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsServiceLbPoliciesCreateCall {
13256 c.urlParams_.Set("fields", googleapi.CombineFields(s))
13257 return c
13258 }
13259
13260 // Context sets the context to be used in this call's Do method.
13261 func (c *ProjectsLocationsServiceLbPoliciesCreateCall) Context(ctx context.Context) *ProjectsLocationsServiceLbPoliciesCreateCall {
13262 c.ctx_ = ctx
13263 return c
13264 }
13265
13266 // Header returns a http.Header that can be modified by the caller to add
13267 // headers to the request.
13268 func (c *ProjectsLocationsServiceLbPoliciesCreateCall) Header() http.Header {
13269 if c.header_ == nil {
13270 c.header_ = make(http.Header)
13271 }
13272 return c.header_
13273 }
13274
13275 func (c *ProjectsLocationsServiceLbPoliciesCreateCall) doRequest(alt string) (*http.Response, error) {
13276 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
13277 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.servicelbpolicy)
13278 if err != nil {
13279 return nil, err
13280 }
13281 c.urlParams_.Set("alt", alt)
13282 c.urlParams_.Set("prettyPrint", "false")
13283 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/serviceLbPolicies")
13284 urls += "?" + c.urlParams_.Encode()
13285 req, err := http.NewRequest("POST", urls, body)
13286 if err != nil {
13287 return nil, err
13288 }
13289 req.Header = reqHeaders
13290 googleapi.Expand(req.URL, map[string]string{
13291 "parent": c.parent,
13292 })
13293 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceLbPolicies.create", "request", internallog.HTTPRequest(req, body.Bytes()))
13294 return gensupport.SendRequest(c.ctx_, c.s.client, req)
13295 }
13296
13297 // Do executes the "networkservices.projects.locations.serviceLbPolicies.create" call.
13298 // Any non-2xx status code is an error. Response headers are in either
13299 // *Operation.ServerResponse.Header or (if a response was returned at all) in
13300 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
13301 // whether the returned error was because http.StatusNotModified was returned.
13302 func (c *ProjectsLocationsServiceLbPoliciesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
13303 gensupport.SetOptions(c.urlParams_, opts...)
13304 res, err := c.doRequest("json")
13305 if res != nil && res.StatusCode == http.StatusNotModified {
13306 if res.Body != nil {
13307 res.Body.Close()
13308 }
13309 return nil, gensupport.WrapError(&googleapi.Error{
13310 Code: res.StatusCode,
13311 Header: res.Header,
13312 })
13313 }
13314 if err != nil {
13315 return nil, err
13316 }
13317 defer googleapi.CloseBody(res)
13318 if err := googleapi.CheckResponse(res); err != nil {
13319 return nil, gensupport.WrapError(err)
13320 }
13321 ret := &Operation{
13322 ServerResponse: googleapi.ServerResponse{
13323 Header: res.Header,
13324 HTTPStatusCode: res.StatusCode,
13325 },
13326 }
13327 target := &ret
13328 b, err := gensupport.DecodeResponseBytes(target, res)
13329 if err != nil {
13330 return nil, err
13331 }
13332 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceLbPolicies.create", "response", internallog.HTTPResponse(res, b))
13333 return ret, nil
13334 }
13335
13336 type ProjectsLocationsServiceLbPoliciesDeleteCall struct {
13337 s *Service
13338 name string
13339 urlParams_ gensupport.URLParams
13340 ctx_ context.Context
13341 header_ http.Header
13342 }
13343
13344 // Delete: Deletes a single ServiceLbPolicy.
13345 //
13346 // - name: A name of the ServiceLbPolicy to delete. Must be in the format
13347 // `projects/{project}/locations/{location}/serviceLbPolicies/*`.
13348 func (r *ProjectsLocationsServiceLbPoliciesService) Delete(name string) *ProjectsLocationsServiceLbPoliciesDeleteCall {
13349 c := &ProjectsLocationsServiceLbPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13350 c.name = name
13351 return c
13352 }
13353
13354 // Fields allows partial responses to be retrieved. See
13355 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
13356 // details.
13357 func (c *ProjectsLocationsServiceLbPoliciesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsServiceLbPoliciesDeleteCall {
13358 c.urlParams_.Set("fields", googleapi.CombineFields(s))
13359 return c
13360 }
13361
13362 // Context sets the context to be used in this call's Do method.
13363 func (c *ProjectsLocationsServiceLbPoliciesDeleteCall) Context(ctx context.Context) *ProjectsLocationsServiceLbPoliciesDeleteCall {
13364 c.ctx_ = ctx
13365 return c
13366 }
13367
13368 // Header returns a http.Header that can be modified by the caller to add
13369 // headers to the request.
13370 func (c *ProjectsLocationsServiceLbPoliciesDeleteCall) Header() http.Header {
13371 if c.header_ == nil {
13372 c.header_ = make(http.Header)
13373 }
13374 return c.header_
13375 }
13376
13377 func (c *ProjectsLocationsServiceLbPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
13378 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
13379 c.urlParams_.Set("alt", alt)
13380 c.urlParams_.Set("prettyPrint", "false")
13381 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
13382 urls += "?" + c.urlParams_.Encode()
13383 req, err := http.NewRequest("DELETE", urls, nil)
13384 if err != nil {
13385 return nil, err
13386 }
13387 req.Header = reqHeaders
13388 googleapi.Expand(req.URL, map[string]string{
13389 "name": c.name,
13390 })
13391 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceLbPolicies.delete", "request", internallog.HTTPRequest(req, nil))
13392 return gensupport.SendRequest(c.ctx_, c.s.client, req)
13393 }
13394
13395 // Do executes the "networkservices.projects.locations.serviceLbPolicies.delete" call.
13396 // Any non-2xx status code is an error. Response headers are in either
13397 // *Operation.ServerResponse.Header or (if a response was returned at all) in
13398 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
13399 // whether the returned error was because http.StatusNotModified was returned.
13400 func (c *ProjectsLocationsServiceLbPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
13401 gensupport.SetOptions(c.urlParams_, opts...)
13402 res, err := c.doRequest("json")
13403 if res != nil && res.StatusCode == http.StatusNotModified {
13404 if res.Body != nil {
13405 res.Body.Close()
13406 }
13407 return nil, gensupport.WrapError(&googleapi.Error{
13408 Code: res.StatusCode,
13409 Header: res.Header,
13410 })
13411 }
13412 if err != nil {
13413 return nil, err
13414 }
13415 defer googleapi.CloseBody(res)
13416 if err := googleapi.CheckResponse(res); err != nil {
13417 return nil, gensupport.WrapError(err)
13418 }
13419 ret := &Operation{
13420 ServerResponse: googleapi.ServerResponse{
13421 Header: res.Header,
13422 HTTPStatusCode: res.StatusCode,
13423 },
13424 }
13425 target := &ret
13426 b, err := gensupport.DecodeResponseBytes(target, res)
13427 if err != nil {
13428 return nil, err
13429 }
13430 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceLbPolicies.delete", "response", internallog.HTTPResponse(res, b))
13431 return ret, nil
13432 }
13433
13434 type ProjectsLocationsServiceLbPoliciesGetCall struct {
13435 s *Service
13436 name string
13437 urlParams_ gensupport.URLParams
13438 ifNoneMatch_ string
13439 ctx_ context.Context
13440 header_ http.Header
13441 }
13442
13443 // Get: Gets details of a single ServiceLbPolicy.
13444 //
13445 // - name: A name of the ServiceLbPolicy to get. Must be in the format
13446 // `projects/{project}/locations/{location}/serviceLbPolicies/*`.
13447 func (r *ProjectsLocationsServiceLbPoliciesService) Get(name string) *ProjectsLocationsServiceLbPoliciesGetCall {
13448 c := &ProjectsLocationsServiceLbPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13449 c.name = name
13450 return c
13451 }
13452
13453 // Fields allows partial responses to be retrieved. See
13454 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
13455 // details.
13456 func (c *ProjectsLocationsServiceLbPoliciesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsServiceLbPoliciesGetCall {
13457 c.urlParams_.Set("fields", googleapi.CombineFields(s))
13458 return c
13459 }
13460
13461 // IfNoneMatch sets an optional parameter which makes the operation fail if the
13462 // object's ETag matches the given value. This is useful for getting updates
13463 // only after the object has changed since the last request.
13464 func (c *ProjectsLocationsServiceLbPoliciesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsServiceLbPoliciesGetCall {
13465 c.ifNoneMatch_ = entityTag
13466 return c
13467 }
13468
13469 // Context sets the context to be used in this call's Do method.
13470 func (c *ProjectsLocationsServiceLbPoliciesGetCall) Context(ctx context.Context) *ProjectsLocationsServiceLbPoliciesGetCall {
13471 c.ctx_ = ctx
13472 return c
13473 }
13474
13475 // Header returns a http.Header that can be modified by the caller to add
13476 // headers to the request.
13477 func (c *ProjectsLocationsServiceLbPoliciesGetCall) Header() http.Header {
13478 if c.header_ == nil {
13479 c.header_ = make(http.Header)
13480 }
13481 return c.header_
13482 }
13483
13484 func (c *ProjectsLocationsServiceLbPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
13485 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
13486 if c.ifNoneMatch_ != "" {
13487 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
13488 }
13489 c.urlParams_.Set("alt", alt)
13490 c.urlParams_.Set("prettyPrint", "false")
13491 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
13492 urls += "?" + c.urlParams_.Encode()
13493 req, err := http.NewRequest("GET", urls, nil)
13494 if err != nil {
13495 return nil, err
13496 }
13497 req.Header = reqHeaders
13498 googleapi.Expand(req.URL, map[string]string{
13499 "name": c.name,
13500 })
13501 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceLbPolicies.get", "request", internallog.HTTPRequest(req, nil))
13502 return gensupport.SendRequest(c.ctx_, c.s.client, req)
13503 }
13504
13505 // Do executes the "networkservices.projects.locations.serviceLbPolicies.get" call.
13506 // Any non-2xx status code is an error. Response headers are in either
13507 // *ServiceLbPolicy.ServerResponse.Header or (if a response was returned at
13508 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
13509 // check whether the returned error was because http.StatusNotModified was
13510 // returned.
13511 func (c *ProjectsLocationsServiceLbPoliciesGetCall) Do(opts ...googleapi.CallOption) (*ServiceLbPolicy, error) {
13512 gensupport.SetOptions(c.urlParams_, opts...)
13513 res, err := c.doRequest("json")
13514 if res != nil && res.StatusCode == http.StatusNotModified {
13515 if res.Body != nil {
13516 res.Body.Close()
13517 }
13518 return nil, gensupport.WrapError(&googleapi.Error{
13519 Code: res.StatusCode,
13520 Header: res.Header,
13521 })
13522 }
13523 if err != nil {
13524 return nil, err
13525 }
13526 defer googleapi.CloseBody(res)
13527 if err := googleapi.CheckResponse(res); err != nil {
13528 return nil, gensupport.WrapError(err)
13529 }
13530 ret := &ServiceLbPolicy{
13531 ServerResponse: googleapi.ServerResponse{
13532 Header: res.Header,
13533 HTTPStatusCode: res.StatusCode,
13534 },
13535 }
13536 target := &ret
13537 b, err := gensupport.DecodeResponseBytes(target, res)
13538 if err != nil {
13539 return nil, err
13540 }
13541 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceLbPolicies.get", "response", internallog.HTTPResponse(res, b))
13542 return ret, nil
13543 }
13544
13545 type ProjectsLocationsServiceLbPoliciesListCall struct {
13546 s *Service
13547 parent string
13548 urlParams_ gensupport.URLParams
13549 ifNoneMatch_ string
13550 ctx_ context.Context
13551 header_ http.Header
13552 }
13553
13554 // List: Lists ServiceLbPolicies in a given project and location.
13555 //
13556 // - parent: The project and location from which the ServiceLbPolicies should
13557 // be listed, specified in the format
13558 // `projects/{project}/locations/{location}`.
13559 func (r *ProjectsLocationsServiceLbPoliciesService) List(parent string) *ProjectsLocationsServiceLbPoliciesListCall {
13560 c := &ProjectsLocationsServiceLbPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13561 c.parent = parent
13562 return c
13563 }
13564
13565 // PageSize sets the optional parameter "pageSize": Maximum number of
13566 // ServiceLbPolicies to return per call.
13567 func (c *ProjectsLocationsServiceLbPoliciesListCall) PageSize(pageSize int64) *ProjectsLocationsServiceLbPoliciesListCall {
13568 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
13569 return c
13570 }
13571
13572 // PageToken sets the optional parameter "pageToken": The value returned by the
13573 // last `ListServiceLbPoliciesResponse` Indicates that this is a continuation
13574 // of a prior `ListRouters` call, and that the system should return the next
13575 // page of data.
13576 func (c *ProjectsLocationsServiceLbPoliciesListCall) PageToken(pageToken string) *ProjectsLocationsServiceLbPoliciesListCall {
13577 c.urlParams_.Set("pageToken", pageToken)
13578 return c
13579 }
13580
13581 // Fields allows partial responses to be retrieved. See
13582 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
13583 // details.
13584 func (c *ProjectsLocationsServiceLbPoliciesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsServiceLbPoliciesListCall {
13585 c.urlParams_.Set("fields", googleapi.CombineFields(s))
13586 return c
13587 }
13588
13589 // IfNoneMatch sets an optional parameter which makes the operation fail if the
13590 // object's ETag matches the given value. This is useful for getting updates
13591 // only after the object has changed since the last request.
13592 func (c *ProjectsLocationsServiceLbPoliciesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsServiceLbPoliciesListCall {
13593 c.ifNoneMatch_ = entityTag
13594 return c
13595 }
13596
13597 // Context sets the context to be used in this call's Do method.
13598 func (c *ProjectsLocationsServiceLbPoliciesListCall) Context(ctx context.Context) *ProjectsLocationsServiceLbPoliciesListCall {
13599 c.ctx_ = ctx
13600 return c
13601 }
13602
13603 // Header returns a http.Header that can be modified by the caller to add
13604 // headers to the request.
13605 func (c *ProjectsLocationsServiceLbPoliciesListCall) Header() http.Header {
13606 if c.header_ == nil {
13607 c.header_ = make(http.Header)
13608 }
13609 return c.header_
13610 }
13611
13612 func (c *ProjectsLocationsServiceLbPoliciesListCall) doRequest(alt string) (*http.Response, error) {
13613 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
13614 if c.ifNoneMatch_ != "" {
13615 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
13616 }
13617 c.urlParams_.Set("alt", alt)
13618 c.urlParams_.Set("prettyPrint", "false")
13619 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/serviceLbPolicies")
13620 urls += "?" + c.urlParams_.Encode()
13621 req, err := http.NewRequest("GET", urls, nil)
13622 if err != nil {
13623 return nil, err
13624 }
13625 req.Header = reqHeaders
13626 googleapi.Expand(req.URL, map[string]string{
13627 "parent": c.parent,
13628 })
13629 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceLbPolicies.list", "request", internallog.HTTPRequest(req, nil))
13630 return gensupport.SendRequest(c.ctx_, c.s.client, req)
13631 }
13632
13633 // Do executes the "networkservices.projects.locations.serviceLbPolicies.list" call.
13634 // Any non-2xx status code is an error. Response headers are in either
13635 // *ListServiceLbPoliciesResponse.ServerResponse.Header or (if a response was
13636 // returned at all) in error.(*googleapi.Error).Header. Use
13637 // googleapi.IsNotModified to check whether the returned error was because
13638 // http.StatusNotModified was returned.
13639 func (c *ProjectsLocationsServiceLbPoliciesListCall) Do(opts ...googleapi.CallOption) (*ListServiceLbPoliciesResponse, error) {
13640 gensupport.SetOptions(c.urlParams_, opts...)
13641 res, err := c.doRequest("json")
13642 if res != nil && res.StatusCode == http.StatusNotModified {
13643 if res.Body != nil {
13644 res.Body.Close()
13645 }
13646 return nil, gensupport.WrapError(&googleapi.Error{
13647 Code: res.StatusCode,
13648 Header: res.Header,
13649 })
13650 }
13651 if err != nil {
13652 return nil, err
13653 }
13654 defer googleapi.CloseBody(res)
13655 if err := googleapi.CheckResponse(res); err != nil {
13656 return nil, gensupport.WrapError(err)
13657 }
13658 ret := &ListServiceLbPoliciesResponse{
13659 ServerResponse: googleapi.ServerResponse{
13660 Header: res.Header,
13661 HTTPStatusCode: res.StatusCode,
13662 },
13663 }
13664 target := &ret
13665 b, err := gensupport.DecodeResponseBytes(target, res)
13666 if err != nil {
13667 return nil, err
13668 }
13669 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceLbPolicies.list", "response", internallog.HTTPResponse(res, b))
13670 return ret, nil
13671 }
13672
13673 // Pages invokes f for each page of results.
13674 // A non-nil error returned from f will halt the iteration.
13675 // The provided context supersedes any context provided to the Context method.
13676 func (c *ProjectsLocationsServiceLbPoliciesListCall) Pages(ctx context.Context, f func(*ListServiceLbPoliciesResponse) error) error {
13677 c.ctx_ = ctx
13678 defer c.PageToken(c.urlParams_.Get("pageToken"))
13679 for {
13680 x, err := c.Do()
13681 if err != nil {
13682 return err
13683 }
13684 if err := f(x); err != nil {
13685 return err
13686 }
13687 if x.NextPageToken == "" {
13688 return nil
13689 }
13690 c.PageToken(x.NextPageToken)
13691 }
13692 }
13693
13694 type ProjectsLocationsServiceLbPoliciesPatchCall struct {
13695 s *Service
13696 name string
13697 servicelbpolicy *ServiceLbPolicy
13698 urlParams_ gensupport.URLParams
13699 ctx_ context.Context
13700 header_ http.Header
13701 }
13702
13703 // Patch: Updates the parameters of a single ServiceLbPolicy.
13704 //
13705 // - name: Identifier. Name of the ServiceLbPolicy resource. It matches pattern
13706 // `projects/{project}/locations/{location}/serviceLbPolicies/{service_lb_poli
13707 // cy_name}`.
13708 func (r *ProjectsLocationsServiceLbPoliciesService) Patch(name string, servicelbpolicy *ServiceLbPolicy) *ProjectsLocationsServiceLbPoliciesPatchCall {
13709 c := &ProjectsLocationsServiceLbPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13710 c.name = name
13711 c.servicelbpolicy = servicelbpolicy
13712 return c
13713 }
13714
13715 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
13716 // specify the fields to be overwritten in the ServiceLbPolicy resource by the
13717 // update. The fields specified in the update_mask are relative to the
13718 // resource, not the full request. A field will be overwritten if it is in the
13719 // mask. If the user does not provide a mask then all fields will be
13720 // overwritten.
13721 func (c *ProjectsLocationsServiceLbPoliciesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsServiceLbPoliciesPatchCall {
13722 c.urlParams_.Set("updateMask", updateMask)
13723 return c
13724 }
13725
13726 // Fields allows partial responses to be retrieved. See
13727 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
13728 // details.
13729 func (c *ProjectsLocationsServiceLbPoliciesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsServiceLbPoliciesPatchCall {
13730 c.urlParams_.Set("fields", googleapi.CombineFields(s))
13731 return c
13732 }
13733
13734 // Context sets the context to be used in this call's Do method.
13735 func (c *ProjectsLocationsServiceLbPoliciesPatchCall) Context(ctx context.Context) *ProjectsLocationsServiceLbPoliciesPatchCall {
13736 c.ctx_ = ctx
13737 return c
13738 }
13739
13740 // Header returns a http.Header that can be modified by the caller to add
13741 // headers to the request.
13742 func (c *ProjectsLocationsServiceLbPoliciesPatchCall) Header() http.Header {
13743 if c.header_ == nil {
13744 c.header_ = make(http.Header)
13745 }
13746 return c.header_
13747 }
13748
13749 func (c *ProjectsLocationsServiceLbPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
13750 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
13751 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.servicelbpolicy)
13752 if err != nil {
13753 return nil, err
13754 }
13755 c.urlParams_.Set("alt", alt)
13756 c.urlParams_.Set("prettyPrint", "false")
13757 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
13758 urls += "?" + c.urlParams_.Encode()
13759 req, err := http.NewRequest("PATCH", urls, body)
13760 if err != nil {
13761 return nil, err
13762 }
13763 req.Header = reqHeaders
13764 googleapi.Expand(req.URL, map[string]string{
13765 "name": c.name,
13766 })
13767 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceLbPolicies.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
13768 return gensupport.SendRequest(c.ctx_, c.s.client, req)
13769 }
13770
13771 // Do executes the "networkservices.projects.locations.serviceLbPolicies.patch" call.
13772 // Any non-2xx status code is an error. Response headers are in either
13773 // *Operation.ServerResponse.Header or (if a response was returned at all) in
13774 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
13775 // whether the returned error was because http.StatusNotModified was returned.
13776 func (c *ProjectsLocationsServiceLbPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
13777 gensupport.SetOptions(c.urlParams_, opts...)
13778 res, err := c.doRequest("json")
13779 if res != nil && res.StatusCode == http.StatusNotModified {
13780 if res.Body != nil {
13781 res.Body.Close()
13782 }
13783 return nil, gensupport.WrapError(&googleapi.Error{
13784 Code: res.StatusCode,
13785 Header: res.Header,
13786 })
13787 }
13788 if err != nil {
13789 return nil, err
13790 }
13791 defer googleapi.CloseBody(res)
13792 if err := googleapi.CheckResponse(res); err != nil {
13793 return nil, gensupport.WrapError(err)
13794 }
13795 ret := &Operation{
13796 ServerResponse: googleapi.ServerResponse{
13797 Header: res.Header,
13798 HTTPStatusCode: res.StatusCode,
13799 },
13800 }
13801 target := &ret
13802 b, err := gensupport.DecodeResponseBytes(target, res)
13803 if err != nil {
13804 return nil, err
13805 }
13806 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceLbPolicies.patch", "response", internallog.HTTPResponse(res, b))
13807 return ret, nil
13808 }
13809
13810 type ProjectsLocationsTcpRoutesCreateCall struct {
13811 s *Service
13812 parent string
13813 tcproute *TcpRoute
13814 urlParams_ gensupport.URLParams
13815 ctx_ context.Context
13816 header_ http.Header
13817 }
13818
13819 // Create: Creates a new TcpRoute in a given project and location.
13820 //
13821 // - parent: The parent resource of the TcpRoute. Must be in the format
13822 // `projects/*/locations/*`.
13823 func (r *ProjectsLocationsTcpRoutesService) Create(parent string, tcproute *TcpRoute) *ProjectsLocationsTcpRoutesCreateCall {
13824 c := &ProjectsLocationsTcpRoutesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13825 c.parent = parent
13826 c.tcproute = tcproute
13827 return c
13828 }
13829
13830 // TcpRouteId sets the optional parameter "tcpRouteId": Required. Short name of
13831 // the TcpRoute resource to be created.
13832 func (c *ProjectsLocationsTcpRoutesCreateCall) TcpRouteId(tcpRouteId string) *ProjectsLocationsTcpRoutesCreateCall {
13833 c.urlParams_.Set("tcpRouteId", tcpRouteId)
13834 return c
13835 }
13836
13837 // Fields allows partial responses to be retrieved. See
13838 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
13839 // details.
13840 func (c *ProjectsLocationsTcpRoutesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsTcpRoutesCreateCall {
13841 c.urlParams_.Set("fields", googleapi.CombineFields(s))
13842 return c
13843 }
13844
13845 // Context sets the context to be used in this call's Do method.
13846 func (c *ProjectsLocationsTcpRoutesCreateCall) Context(ctx context.Context) *ProjectsLocationsTcpRoutesCreateCall {
13847 c.ctx_ = ctx
13848 return c
13849 }
13850
13851 // Header returns a http.Header that can be modified by the caller to add
13852 // headers to the request.
13853 func (c *ProjectsLocationsTcpRoutesCreateCall) Header() http.Header {
13854 if c.header_ == nil {
13855 c.header_ = make(http.Header)
13856 }
13857 return c.header_
13858 }
13859
13860 func (c *ProjectsLocationsTcpRoutesCreateCall) doRequest(alt string) (*http.Response, error) {
13861 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
13862 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tcproute)
13863 if err != nil {
13864 return nil, err
13865 }
13866 c.urlParams_.Set("alt", alt)
13867 c.urlParams_.Set("prettyPrint", "false")
13868 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/tcpRoutes")
13869 urls += "?" + c.urlParams_.Encode()
13870 req, err := http.NewRequest("POST", urls, body)
13871 if err != nil {
13872 return nil, err
13873 }
13874 req.Header = reqHeaders
13875 googleapi.Expand(req.URL, map[string]string{
13876 "parent": c.parent,
13877 })
13878 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tcpRoutes.create", "request", internallog.HTTPRequest(req, body.Bytes()))
13879 return gensupport.SendRequest(c.ctx_, c.s.client, req)
13880 }
13881
13882 // Do executes the "networkservices.projects.locations.tcpRoutes.create" call.
13883 // Any non-2xx status code is an error. Response headers are in either
13884 // *Operation.ServerResponse.Header or (if a response was returned at all) in
13885 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
13886 // whether the returned error was because http.StatusNotModified was returned.
13887 func (c *ProjectsLocationsTcpRoutesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
13888 gensupport.SetOptions(c.urlParams_, opts...)
13889 res, err := c.doRequest("json")
13890 if res != nil && res.StatusCode == http.StatusNotModified {
13891 if res.Body != nil {
13892 res.Body.Close()
13893 }
13894 return nil, gensupport.WrapError(&googleapi.Error{
13895 Code: res.StatusCode,
13896 Header: res.Header,
13897 })
13898 }
13899 if err != nil {
13900 return nil, err
13901 }
13902 defer googleapi.CloseBody(res)
13903 if err := googleapi.CheckResponse(res); err != nil {
13904 return nil, gensupport.WrapError(err)
13905 }
13906 ret := &Operation{
13907 ServerResponse: googleapi.ServerResponse{
13908 Header: res.Header,
13909 HTTPStatusCode: res.StatusCode,
13910 },
13911 }
13912 target := &ret
13913 b, err := gensupport.DecodeResponseBytes(target, res)
13914 if err != nil {
13915 return nil, err
13916 }
13917 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tcpRoutes.create", "response", internallog.HTTPResponse(res, b))
13918 return ret, nil
13919 }
13920
13921 type ProjectsLocationsTcpRoutesDeleteCall struct {
13922 s *Service
13923 name string
13924 urlParams_ gensupport.URLParams
13925 ctx_ context.Context
13926 header_ http.Header
13927 }
13928
13929 // Delete: Deletes a single TcpRoute.
13930 //
13931 // - name: A name of the TcpRoute to delete. Must be in the format
13932 // `projects/*/locations/*/tcpRoutes/*`.
13933 func (r *ProjectsLocationsTcpRoutesService) Delete(name string) *ProjectsLocationsTcpRoutesDeleteCall {
13934 c := &ProjectsLocationsTcpRoutesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13935 c.name = name
13936 return c
13937 }
13938
13939 // Fields allows partial responses to be retrieved. See
13940 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
13941 // details.
13942 func (c *ProjectsLocationsTcpRoutesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsTcpRoutesDeleteCall {
13943 c.urlParams_.Set("fields", googleapi.CombineFields(s))
13944 return c
13945 }
13946
13947 // Context sets the context to be used in this call's Do method.
13948 func (c *ProjectsLocationsTcpRoutesDeleteCall) Context(ctx context.Context) *ProjectsLocationsTcpRoutesDeleteCall {
13949 c.ctx_ = ctx
13950 return c
13951 }
13952
13953 // Header returns a http.Header that can be modified by the caller to add
13954 // headers to the request.
13955 func (c *ProjectsLocationsTcpRoutesDeleteCall) Header() http.Header {
13956 if c.header_ == nil {
13957 c.header_ = make(http.Header)
13958 }
13959 return c.header_
13960 }
13961
13962 func (c *ProjectsLocationsTcpRoutesDeleteCall) doRequest(alt string) (*http.Response, error) {
13963 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
13964 c.urlParams_.Set("alt", alt)
13965 c.urlParams_.Set("prettyPrint", "false")
13966 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
13967 urls += "?" + c.urlParams_.Encode()
13968 req, err := http.NewRequest("DELETE", urls, nil)
13969 if err != nil {
13970 return nil, err
13971 }
13972 req.Header = reqHeaders
13973 googleapi.Expand(req.URL, map[string]string{
13974 "name": c.name,
13975 })
13976 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tcpRoutes.delete", "request", internallog.HTTPRequest(req, nil))
13977 return gensupport.SendRequest(c.ctx_, c.s.client, req)
13978 }
13979
13980 // Do executes the "networkservices.projects.locations.tcpRoutes.delete" call.
13981 // Any non-2xx status code is an error. Response headers are in either
13982 // *Operation.ServerResponse.Header or (if a response was returned at all) in
13983 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
13984 // whether the returned error was because http.StatusNotModified was returned.
13985 func (c *ProjectsLocationsTcpRoutesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
13986 gensupport.SetOptions(c.urlParams_, opts...)
13987 res, err := c.doRequest("json")
13988 if res != nil && res.StatusCode == http.StatusNotModified {
13989 if res.Body != nil {
13990 res.Body.Close()
13991 }
13992 return nil, gensupport.WrapError(&googleapi.Error{
13993 Code: res.StatusCode,
13994 Header: res.Header,
13995 })
13996 }
13997 if err != nil {
13998 return nil, err
13999 }
14000 defer googleapi.CloseBody(res)
14001 if err := googleapi.CheckResponse(res); err != nil {
14002 return nil, gensupport.WrapError(err)
14003 }
14004 ret := &Operation{
14005 ServerResponse: googleapi.ServerResponse{
14006 Header: res.Header,
14007 HTTPStatusCode: res.StatusCode,
14008 },
14009 }
14010 target := &ret
14011 b, err := gensupport.DecodeResponseBytes(target, res)
14012 if err != nil {
14013 return nil, err
14014 }
14015 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tcpRoutes.delete", "response", internallog.HTTPResponse(res, b))
14016 return ret, nil
14017 }
14018
14019 type ProjectsLocationsTcpRoutesGetCall struct {
14020 s *Service
14021 name string
14022 urlParams_ gensupport.URLParams
14023 ifNoneMatch_ string
14024 ctx_ context.Context
14025 header_ http.Header
14026 }
14027
14028 // Get: Gets details of a single TcpRoute.
14029 //
14030 // - name: A name of the TcpRoute to get. Must be in the format
14031 // `projects/*/locations/*/tcpRoutes/*`.
14032 func (r *ProjectsLocationsTcpRoutesService) Get(name string) *ProjectsLocationsTcpRoutesGetCall {
14033 c := &ProjectsLocationsTcpRoutesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14034 c.name = name
14035 return c
14036 }
14037
14038 // Fields allows partial responses to be retrieved. See
14039 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
14040 // details.
14041 func (c *ProjectsLocationsTcpRoutesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsTcpRoutesGetCall {
14042 c.urlParams_.Set("fields", googleapi.CombineFields(s))
14043 return c
14044 }
14045
14046 // IfNoneMatch sets an optional parameter which makes the operation fail if the
14047 // object's ETag matches the given value. This is useful for getting updates
14048 // only after the object has changed since the last request.
14049 func (c *ProjectsLocationsTcpRoutesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsTcpRoutesGetCall {
14050 c.ifNoneMatch_ = entityTag
14051 return c
14052 }
14053
14054 // Context sets the context to be used in this call's Do method.
14055 func (c *ProjectsLocationsTcpRoutesGetCall) Context(ctx context.Context) *ProjectsLocationsTcpRoutesGetCall {
14056 c.ctx_ = ctx
14057 return c
14058 }
14059
14060 // Header returns a http.Header that can be modified by the caller to add
14061 // headers to the request.
14062 func (c *ProjectsLocationsTcpRoutesGetCall) Header() http.Header {
14063 if c.header_ == nil {
14064 c.header_ = make(http.Header)
14065 }
14066 return c.header_
14067 }
14068
14069 func (c *ProjectsLocationsTcpRoutesGetCall) doRequest(alt string) (*http.Response, error) {
14070 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
14071 if c.ifNoneMatch_ != "" {
14072 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
14073 }
14074 c.urlParams_.Set("alt", alt)
14075 c.urlParams_.Set("prettyPrint", "false")
14076 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
14077 urls += "?" + c.urlParams_.Encode()
14078 req, err := http.NewRequest("GET", urls, nil)
14079 if err != nil {
14080 return nil, err
14081 }
14082 req.Header = reqHeaders
14083 googleapi.Expand(req.URL, map[string]string{
14084 "name": c.name,
14085 })
14086 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tcpRoutes.get", "request", internallog.HTTPRequest(req, nil))
14087 return gensupport.SendRequest(c.ctx_, c.s.client, req)
14088 }
14089
14090 // Do executes the "networkservices.projects.locations.tcpRoutes.get" call.
14091 // Any non-2xx status code is an error. Response headers are in either
14092 // *TcpRoute.ServerResponse.Header or (if a response was returned at all) in
14093 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
14094 // whether the returned error was because http.StatusNotModified was returned.
14095 func (c *ProjectsLocationsTcpRoutesGetCall) Do(opts ...googleapi.CallOption) (*TcpRoute, error) {
14096 gensupport.SetOptions(c.urlParams_, opts...)
14097 res, err := c.doRequest("json")
14098 if res != nil && res.StatusCode == http.StatusNotModified {
14099 if res.Body != nil {
14100 res.Body.Close()
14101 }
14102 return nil, gensupport.WrapError(&googleapi.Error{
14103 Code: res.StatusCode,
14104 Header: res.Header,
14105 })
14106 }
14107 if err != nil {
14108 return nil, err
14109 }
14110 defer googleapi.CloseBody(res)
14111 if err := googleapi.CheckResponse(res); err != nil {
14112 return nil, gensupport.WrapError(err)
14113 }
14114 ret := &TcpRoute{
14115 ServerResponse: googleapi.ServerResponse{
14116 Header: res.Header,
14117 HTTPStatusCode: res.StatusCode,
14118 },
14119 }
14120 target := &ret
14121 b, err := gensupport.DecodeResponseBytes(target, res)
14122 if err != nil {
14123 return nil, err
14124 }
14125 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tcpRoutes.get", "response", internallog.HTTPResponse(res, b))
14126 return ret, nil
14127 }
14128
14129 type ProjectsLocationsTcpRoutesListCall struct {
14130 s *Service
14131 parent string
14132 urlParams_ gensupport.URLParams
14133 ifNoneMatch_ string
14134 ctx_ context.Context
14135 header_ http.Header
14136 }
14137
14138 // List: Lists TcpRoute in a given project and location.
14139 //
14140 // - parent: The project and location from which the TcpRoutes should be
14141 // listed, specified in the format `projects/*/locations/*`.
14142 func (r *ProjectsLocationsTcpRoutesService) List(parent string) *ProjectsLocationsTcpRoutesListCall {
14143 c := &ProjectsLocationsTcpRoutesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14144 c.parent = parent
14145 return c
14146 }
14147
14148 // PageSize sets the optional parameter "pageSize": Maximum number of TcpRoutes
14149 // to return per call.
14150 func (c *ProjectsLocationsTcpRoutesListCall) PageSize(pageSize int64) *ProjectsLocationsTcpRoutesListCall {
14151 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
14152 return c
14153 }
14154
14155 // PageToken sets the optional parameter "pageToken": The value returned by the
14156 // last `ListTcpRoutesResponse` Indicates that this is a continuation of a
14157 // prior `ListTcpRoutes` call, and that the system should return the next page
14158 // of data.
14159 func (c *ProjectsLocationsTcpRoutesListCall) PageToken(pageToken string) *ProjectsLocationsTcpRoutesListCall {
14160 c.urlParams_.Set("pageToken", pageToken)
14161 return c
14162 }
14163
14164 // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": If
14165 // true, allow partial responses for multi-regional Aggregated List requests.
14166 // Otherwise if one of the locations is down or unreachable, the Aggregated
14167 // List request will fail.
14168 func (c *ProjectsLocationsTcpRoutesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ProjectsLocationsTcpRoutesListCall {
14169 c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
14170 return c
14171 }
14172
14173 // Fields allows partial responses to be retrieved. See
14174 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
14175 // details.
14176 func (c *ProjectsLocationsTcpRoutesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsTcpRoutesListCall {
14177 c.urlParams_.Set("fields", googleapi.CombineFields(s))
14178 return c
14179 }
14180
14181 // IfNoneMatch sets an optional parameter which makes the operation fail if the
14182 // object's ETag matches the given value. This is useful for getting updates
14183 // only after the object has changed since the last request.
14184 func (c *ProjectsLocationsTcpRoutesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsTcpRoutesListCall {
14185 c.ifNoneMatch_ = entityTag
14186 return c
14187 }
14188
14189 // Context sets the context to be used in this call's Do method.
14190 func (c *ProjectsLocationsTcpRoutesListCall) Context(ctx context.Context) *ProjectsLocationsTcpRoutesListCall {
14191 c.ctx_ = ctx
14192 return c
14193 }
14194
14195 // Header returns a http.Header that can be modified by the caller to add
14196 // headers to the request.
14197 func (c *ProjectsLocationsTcpRoutesListCall) Header() http.Header {
14198 if c.header_ == nil {
14199 c.header_ = make(http.Header)
14200 }
14201 return c.header_
14202 }
14203
14204 func (c *ProjectsLocationsTcpRoutesListCall) doRequest(alt string) (*http.Response, error) {
14205 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
14206 if c.ifNoneMatch_ != "" {
14207 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
14208 }
14209 c.urlParams_.Set("alt", alt)
14210 c.urlParams_.Set("prettyPrint", "false")
14211 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/tcpRoutes")
14212 urls += "?" + c.urlParams_.Encode()
14213 req, err := http.NewRequest("GET", urls, nil)
14214 if err != nil {
14215 return nil, err
14216 }
14217 req.Header = reqHeaders
14218 googleapi.Expand(req.URL, map[string]string{
14219 "parent": c.parent,
14220 })
14221 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tcpRoutes.list", "request", internallog.HTTPRequest(req, nil))
14222 return gensupport.SendRequest(c.ctx_, c.s.client, req)
14223 }
14224
14225 // Do executes the "networkservices.projects.locations.tcpRoutes.list" call.
14226 // Any non-2xx status code is an error. Response headers are in either
14227 // *ListTcpRoutesResponse.ServerResponse.Header or (if a response was returned
14228 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
14229 // check whether the returned error was because http.StatusNotModified was
14230 // returned.
14231 func (c *ProjectsLocationsTcpRoutesListCall) Do(opts ...googleapi.CallOption) (*ListTcpRoutesResponse, error) {
14232 gensupport.SetOptions(c.urlParams_, opts...)
14233 res, err := c.doRequest("json")
14234 if res != nil && res.StatusCode == http.StatusNotModified {
14235 if res.Body != nil {
14236 res.Body.Close()
14237 }
14238 return nil, gensupport.WrapError(&googleapi.Error{
14239 Code: res.StatusCode,
14240 Header: res.Header,
14241 })
14242 }
14243 if err != nil {
14244 return nil, err
14245 }
14246 defer googleapi.CloseBody(res)
14247 if err := googleapi.CheckResponse(res); err != nil {
14248 return nil, gensupport.WrapError(err)
14249 }
14250 ret := &ListTcpRoutesResponse{
14251 ServerResponse: googleapi.ServerResponse{
14252 Header: res.Header,
14253 HTTPStatusCode: res.StatusCode,
14254 },
14255 }
14256 target := &ret
14257 b, err := gensupport.DecodeResponseBytes(target, res)
14258 if err != nil {
14259 return nil, err
14260 }
14261 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tcpRoutes.list", "response", internallog.HTTPResponse(res, b))
14262 return ret, nil
14263 }
14264
14265 // Pages invokes f for each page of results.
14266 // A non-nil error returned from f will halt the iteration.
14267 // The provided context supersedes any context provided to the Context method.
14268 func (c *ProjectsLocationsTcpRoutesListCall) Pages(ctx context.Context, f func(*ListTcpRoutesResponse) error) error {
14269 c.ctx_ = ctx
14270 defer c.PageToken(c.urlParams_.Get("pageToken"))
14271 for {
14272 x, err := c.Do()
14273 if err != nil {
14274 return err
14275 }
14276 if err := f(x); err != nil {
14277 return err
14278 }
14279 if x.NextPageToken == "" {
14280 return nil
14281 }
14282 c.PageToken(x.NextPageToken)
14283 }
14284 }
14285
14286 type ProjectsLocationsTcpRoutesPatchCall struct {
14287 s *Service
14288 name string
14289 tcproute *TcpRoute
14290 urlParams_ gensupport.URLParams
14291 ctx_ context.Context
14292 header_ http.Header
14293 }
14294
14295 // Patch: Updates the parameters of a single TcpRoute.
14296 //
14297 // - name: Identifier. Name of the TcpRoute resource. It matches pattern
14298 // `projects/*/locations/*/tcpRoutes/tcp_route_name>`.
14299 func (r *ProjectsLocationsTcpRoutesService) Patch(name string, tcproute *TcpRoute) *ProjectsLocationsTcpRoutesPatchCall {
14300 c := &ProjectsLocationsTcpRoutesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14301 c.name = name
14302 c.tcproute = tcproute
14303 return c
14304 }
14305
14306 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
14307 // specify the fields to be overwritten in the TcpRoute resource by the update.
14308 // The fields specified in the update_mask are relative to the resource, not
14309 // the full request. A field will be overwritten if it is in the mask. If the
14310 // user does not provide a mask then all fields will be overwritten.
14311 func (c *ProjectsLocationsTcpRoutesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsTcpRoutesPatchCall {
14312 c.urlParams_.Set("updateMask", updateMask)
14313 return c
14314 }
14315
14316 // Fields allows partial responses to be retrieved. See
14317 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
14318 // details.
14319 func (c *ProjectsLocationsTcpRoutesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsTcpRoutesPatchCall {
14320 c.urlParams_.Set("fields", googleapi.CombineFields(s))
14321 return c
14322 }
14323
14324 // Context sets the context to be used in this call's Do method.
14325 func (c *ProjectsLocationsTcpRoutesPatchCall) Context(ctx context.Context) *ProjectsLocationsTcpRoutesPatchCall {
14326 c.ctx_ = ctx
14327 return c
14328 }
14329
14330 // Header returns a http.Header that can be modified by the caller to add
14331 // headers to the request.
14332 func (c *ProjectsLocationsTcpRoutesPatchCall) Header() http.Header {
14333 if c.header_ == nil {
14334 c.header_ = make(http.Header)
14335 }
14336 return c.header_
14337 }
14338
14339 func (c *ProjectsLocationsTcpRoutesPatchCall) doRequest(alt string) (*http.Response, error) {
14340 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
14341 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tcproute)
14342 if err != nil {
14343 return nil, err
14344 }
14345 c.urlParams_.Set("alt", alt)
14346 c.urlParams_.Set("prettyPrint", "false")
14347 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
14348 urls += "?" + c.urlParams_.Encode()
14349 req, err := http.NewRequest("PATCH", urls, body)
14350 if err != nil {
14351 return nil, err
14352 }
14353 req.Header = reqHeaders
14354 googleapi.Expand(req.URL, map[string]string{
14355 "name": c.name,
14356 })
14357 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tcpRoutes.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
14358 return gensupport.SendRequest(c.ctx_, c.s.client, req)
14359 }
14360
14361 // Do executes the "networkservices.projects.locations.tcpRoutes.patch" call.
14362 // Any non-2xx status code is an error. Response headers are in either
14363 // *Operation.ServerResponse.Header or (if a response was returned at all) in
14364 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
14365 // whether the returned error was because http.StatusNotModified was returned.
14366 func (c *ProjectsLocationsTcpRoutesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
14367 gensupport.SetOptions(c.urlParams_, opts...)
14368 res, err := c.doRequest("json")
14369 if res != nil && res.StatusCode == http.StatusNotModified {
14370 if res.Body != nil {
14371 res.Body.Close()
14372 }
14373 return nil, gensupport.WrapError(&googleapi.Error{
14374 Code: res.StatusCode,
14375 Header: res.Header,
14376 })
14377 }
14378 if err != nil {
14379 return nil, err
14380 }
14381 defer googleapi.CloseBody(res)
14382 if err := googleapi.CheckResponse(res); err != nil {
14383 return nil, gensupport.WrapError(err)
14384 }
14385 ret := &Operation{
14386 ServerResponse: googleapi.ServerResponse{
14387 Header: res.Header,
14388 HTTPStatusCode: res.StatusCode,
14389 },
14390 }
14391 target := &ret
14392 b, err := gensupport.DecodeResponseBytes(target, res)
14393 if err != nil {
14394 return nil, err
14395 }
14396 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tcpRoutes.patch", "response", internallog.HTTPResponse(res, b))
14397 return ret, nil
14398 }
14399
14400 type ProjectsLocationsTlsRoutesCreateCall struct {
14401 s *Service
14402 parent string
14403 tlsroute *TlsRoute
14404 urlParams_ gensupport.URLParams
14405 ctx_ context.Context
14406 header_ http.Header
14407 }
14408
14409 // Create: Creates a new TlsRoute in a given project and location.
14410 //
14411 // - parent: The parent resource of the TlsRoute. Must be in the format
14412 // `projects/*/locations/*`.
14413 func (r *ProjectsLocationsTlsRoutesService) Create(parent string, tlsroute *TlsRoute) *ProjectsLocationsTlsRoutesCreateCall {
14414 c := &ProjectsLocationsTlsRoutesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14415 c.parent = parent
14416 c.tlsroute = tlsroute
14417 return c
14418 }
14419
14420 // TlsRouteId sets the optional parameter "tlsRouteId": Required. Short name of
14421 // the TlsRoute resource to be created.
14422 func (c *ProjectsLocationsTlsRoutesCreateCall) TlsRouteId(tlsRouteId string) *ProjectsLocationsTlsRoutesCreateCall {
14423 c.urlParams_.Set("tlsRouteId", tlsRouteId)
14424 return c
14425 }
14426
14427 // Fields allows partial responses to be retrieved. See
14428 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
14429 // details.
14430 func (c *ProjectsLocationsTlsRoutesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsTlsRoutesCreateCall {
14431 c.urlParams_.Set("fields", googleapi.CombineFields(s))
14432 return c
14433 }
14434
14435 // Context sets the context to be used in this call's Do method.
14436 func (c *ProjectsLocationsTlsRoutesCreateCall) Context(ctx context.Context) *ProjectsLocationsTlsRoutesCreateCall {
14437 c.ctx_ = ctx
14438 return c
14439 }
14440
14441 // Header returns a http.Header that can be modified by the caller to add
14442 // headers to the request.
14443 func (c *ProjectsLocationsTlsRoutesCreateCall) Header() http.Header {
14444 if c.header_ == nil {
14445 c.header_ = make(http.Header)
14446 }
14447 return c.header_
14448 }
14449
14450 func (c *ProjectsLocationsTlsRoutesCreateCall) doRequest(alt string) (*http.Response, error) {
14451 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
14452 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tlsroute)
14453 if err != nil {
14454 return nil, err
14455 }
14456 c.urlParams_.Set("alt", alt)
14457 c.urlParams_.Set("prettyPrint", "false")
14458 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/tlsRoutes")
14459 urls += "?" + c.urlParams_.Encode()
14460 req, err := http.NewRequest("POST", urls, body)
14461 if err != nil {
14462 return nil, err
14463 }
14464 req.Header = reqHeaders
14465 googleapi.Expand(req.URL, map[string]string{
14466 "parent": c.parent,
14467 })
14468 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tlsRoutes.create", "request", internallog.HTTPRequest(req, body.Bytes()))
14469 return gensupport.SendRequest(c.ctx_, c.s.client, req)
14470 }
14471
14472 // Do executes the "networkservices.projects.locations.tlsRoutes.create" call.
14473 // Any non-2xx status code is an error. Response headers are in either
14474 // *Operation.ServerResponse.Header or (if a response was returned at all) in
14475 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
14476 // whether the returned error was because http.StatusNotModified was returned.
14477 func (c *ProjectsLocationsTlsRoutesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
14478 gensupport.SetOptions(c.urlParams_, opts...)
14479 res, err := c.doRequest("json")
14480 if res != nil && res.StatusCode == http.StatusNotModified {
14481 if res.Body != nil {
14482 res.Body.Close()
14483 }
14484 return nil, gensupport.WrapError(&googleapi.Error{
14485 Code: res.StatusCode,
14486 Header: res.Header,
14487 })
14488 }
14489 if err != nil {
14490 return nil, err
14491 }
14492 defer googleapi.CloseBody(res)
14493 if err := googleapi.CheckResponse(res); err != nil {
14494 return nil, gensupport.WrapError(err)
14495 }
14496 ret := &Operation{
14497 ServerResponse: googleapi.ServerResponse{
14498 Header: res.Header,
14499 HTTPStatusCode: res.StatusCode,
14500 },
14501 }
14502 target := &ret
14503 b, err := gensupport.DecodeResponseBytes(target, res)
14504 if err != nil {
14505 return nil, err
14506 }
14507 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tlsRoutes.create", "response", internallog.HTTPResponse(res, b))
14508 return ret, nil
14509 }
14510
14511 type ProjectsLocationsTlsRoutesDeleteCall struct {
14512 s *Service
14513 name string
14514 urlParams_ gensupport.URLParams
14515 ctx_ context.Context
14516 header_ http.Header
14517 }
14518
14519 // Delete: Deletes a single TlsRoute.
14520 //
14521 // - name: A name of the TlsRoute to delete. Must be in the format
14522 // `projects/*/locations/*/tlsRoutes/*`.
14523 func (r *ProjectsLocationsTlsRoutesService) Delete(name string) *ProjectsLocationsTlsRoutesDeleteCall {
14524 c := &ProjectsLocationsTlsRoutesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14525 c.name = name
14526 return c
14527 }
14528
14529 // Fields allows partial responses to be retrieved. See
14530 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
14531 // details.
14532 func (c *ProjectsLocationsTlsRoutesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsTlsRoutesDeleteCall {
14533 c.urlParams_.Set("fields", googleapi.CombineFields(s))
14534 return c
14535 }
14536
14537 // Context sets the context to be used in this call's Do method.
14538 func (c *ProjectsLocationsTlsRoutesDeleteCall) Context(ctx context.Context) *ProjectsLocationsTlsRoutesDeleteCall {
14539 c.ctx_ = ctx
14540 return c
14541 }
14542
14543 // Header returns a http.Header that can be modified by the caller to add
14544 // headers to the request.
14545 func (c *ProjectsLocationsTlsRoutesDeleteCall) Header() http.Header {
14546 if c.header_ == nil {
14547 c.header_ = make(http.Header)
14548 }
14549 return c.header_
14550 }
14551
14552 func (c *ProjectsLocationsTlsRoutesDeleteCall) doRequest(alt string) (*http.Response, error) {
14553 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
14554 c.urlParams_.Set("alt", alt)
14555 c.urlParams_.Set("prettyPrint", "false")
14556 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
14557 urls += "?" + c.urlParams_.Encode()
14558 req, err := http.NewRequest("DELETE", urls, nil)
14559 if err != nil {
14560 return nil, err
14561 }
14562 req.Header = reqHeaders
14563 googleapi.Expand(req.URL, map[string]string{
14564 "name": c.name,
14565 })
14566 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tlsRoutes.delete", "request", internallog.HTTPRequest(req, nil))
14567 return gensupport.SendRequest(c.ctx_, c.s.client, req)
14568 }
14569
14570 // Do executes the "networkservices.projects.locations.tlsRoutes.delete" call.
14571 // Any non-2xx status code is an error. Response headers are in either
14572 // *Operation.ServerResponse.Header or (if a response was returned at all) in
14573 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
14574 // whether the returned error was because http.StatusNotModified was returned.
14575 func (c *ProjectsLocationsTlsRoutesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
14576 gensupport.SetOptions(c.urlParams_, opts...)
14577 res, err := c.doRequest("json")
14578 if res != nil && res.StatusCode == http.StatusNotModified {
14579 if res.Body != nil {
14580 res.Body.Close()
14581 }
14582 return nil, gensupport.WrapError(&googleapi.Error{
14583 Code: res.StatusCode,
14584 Header: res.Header,
14585 })
14586 }
14587 if err != nil {
14588 return nil, err
14589 }
14590 defer googleapi.CloseBody(res)
14591 if err := googleapi.CheckResponse(res); err != nil {
14592 return nil, gensupport.WrapError(err)
14593 }
14594 ret := &Operation{
14595 ServerResponse: googleapi.ServerResponse{
14596 Header: res.Header,
14597 HTTPStatusCode: res.StatusCode,
14598 },
14599 }
14600 target := &ret
14601 b, err := gensupport.DecodeResponseBytes(target, res)
14602 if err != nil {
14603 return nil, err
14604 }
14605 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tlsRoutes.delete", "response", internallog.HTTPResponse(res, b))
14606 return ret, nil
14607 }
14608
14609 type ProjectsLocationsTlsRoutesGetCall struct {
14610 s *Service
14611 name string
14612 urlParams_ gensupport.URLParams
14613 ifNoneMatch_ string
14614 ctx_ context.Context
14615 header_ http.Header
14616 }
14617
14618 // Get: Gets details of a single TlsRoute.
14619 //
14620 // - name: A name of the TlsRoute to get. Must be in the format
14621 // `projects/*/locations/*/tlsRoutes/*`.
14622 func (r *ProjectsLocationsTlsRoutesService) Get(name string) *ProjectsLocationsTlsRoutesGetCall {
14623 c := &ProjectsLocationsTlsRoutesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14624 c.name = name
14625 return c
14626 }
14627
14628 // Fields allows partial responses to be retrieved. See
14629 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
14630 // details.
14631 func (c *ProjectsLocationsTlsRoutesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsTlsRoutesGetCall {
14632 c.urlParams_.Set("fields", googleapi.CombineFields(s))
14633 return c
14634 }
14635
14636 // IfNoneMatch sets an optional parameter which makes the operation fail if the
14637 // object's ETag matches the given value. This is useful for getting updates
14638 // only after the object has changed since the last request.
14639 func (c *ProjectsLocationsTlsRoutesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsTlsRoutesGetCall {
14640 c.ifNoneMatch_ = entityTag
14641 return c
14642 }
14643
14644 // Context sets the context to be used in this call's Do method.
14645 func (c *ProjectsLocationsTlsRoutesGetCall) Context(ctx context.Context) *ProjectsLocationsTlsRoutesGetCall {
14646 c.ctx_ = ctx
14647 return c
14648 }
14649
14650 // Header returns a http.Header that can be modified by the caller to add
14651 // headers to the request.
14652 func (c *ProjectsLocationsTlsRoutesGetCall) Header() http.Header {
14653 if c.header_ == nil {
14654 c.header_ = make(http.Header)
14655 }
14656 return c.header_
14657 }
14658
14659 func (c *ProjectsLocationsTlsRoutesGetCall) doRequest(alt string) (*http.Response, error) {
14660 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
14661 if c.ifNoneMatch_ != "" {
14662 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
14663 }
14664 c.urlParams_.Set("alt", alt)
14665 c.urlParams_.Set("prettyPrint", "false")
14666 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
14667 urls += "?" + c.urlParams_.Encode()
14668 req, err := http.NewRequest("GET", urls, nil)
14669 if err != nil {
14670 return nil, err
14671 }
14672 req.Header = reqHeaders
14673 googleapi.Expand(req.URL, map[string]string{
14674 "name": c.name,
14675 })
14676 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tlsRoutes.get", "request", internallog.HTTPRequest(req, nil))
14677 return gensupport.SendRequest(c.ctx_, c.s.client, req)
14678 }
14679
14680 // Do executes the "networkservices.projects.locations.tlsRoutes.get" call.
14681 // Any non-2xx status code is an error. Response headers are in either
14682 // *TlsRoute.ServerResponse.Header or (if a response was returned at all) in
14683 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
14684 // whether the returned error was because http.StatusNotModified was returned.
14685 func (c *ProjectsLocationsTlsRoutesGetCall) Do(opts ...googleapi.CallOption) (*TlsRoute, error) {
14686 gensupport.SetOptions(c.urlParams_, opts...)
14687 res, err := c.doRequest("json")
14688 if res != nil && res.StatusCode == http.StatusNotModified {
14689 if res.Body != nil {
14690 res.Body.Close()
14691 }
14692 return nil, gensupport.WrapError(&googleapi.Error{
14693 Code: res.StatusCode,
14694 Header: res.Header,
14695 })
14696 }
14697 if err != nil {
14698 return nil, err
14699 }
14700 defer googleapi.CloseBody(res)
14701 if err := googleapi.CheckResponse(res); err != nil {
14702 return nil, gensupport.WrapError(err)
14703 }
14704 ret := &TlsRoute{
14705 ServerResponse: googleapi.ServerResponse{
14706 Header: res.Header,
14707 HTTPStatusCode: res.StatusCode,
14708 },
14709 }
14710 target := &ret
14711 b, err := gensupport.DecodeResponseBytes(target, res)
14712 if err != nil {
14713 return nil, err
14714 }
14715 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tlsRoutes.get", "response", internallog.HTTPResponse(res, b))
14716 return ret, nil
14717 }
14718
14719 type ProjectsLocationsTlsRoutesListCall struct {
14720 s *Service
14721 parent string
14722 urlParams_ gensupport.URLParams
14723 ifNoneMatch_ string
14724 ctx_ context.Context
14725 header_ http.Header
14726 }
14727
14728 // List: Lists TlsRoute in a given project and location.
14729 //
14730 // - parent: The project and location from which the TlsRoutes should be
14731 // listed, specified in the format `projects/*/locations/*`.
14732 func (r *ProjectsLocationsTlsRoutesService) List(parent string) *ProjectsLocationsTlsRoutesListCall {
14733 c := &ProjectsLocationsTlsRoutesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14734 c.parent = parent
14735 return c
14736 }
14737
14738 // PageSize sets the optional parameter "pageSize": Maximum number of TlsRoutes
14739 // to return per call.
14740 func (c *ProjectsLocationsTlsRoutesListCall) PageSize(pageSize int64) *ProjectsLocationsTlsRoutesListCall {
14741 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
14742 return c
14743 }
14744
14745 // PageToken sets the optional parameter "pageToken": The value returned by the
14746 // last `ListTlsRoutesResponse` Indicates that this is a continuation of a
14747 // prior `ListTlsRoutes` call, and that the system should return the next page
14748 // of data.
14749 func (c *ProjectsLocationsTlsRoutesListCall) PageToken(pageToken string) *ProjectsLocationsTlsRoutesListCall {
14750 c.urlParams_.Set("pageToken", pageToken)
14751 return c
14752 }
14753
14754 // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": If
14755 // true, allow partial responses for multi-regional Aggregated List requests.
14756 // Otherwise if one of the locations is down or unreachable, the Aggregated
14757 // List request will fail.
14758 func (c *ProjectsLocationsTlsRoutesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ProjectsLocationsTlsRoutesListCall {
14759 c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
14760 return c
14761 }
14762
14763 // Fields allows partial responses to be retrieved. See
14764 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
14765 // details.
14766 func (c *ProjectsLocationsTlsRoutesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsTlsRoutesListCall {
14767 c.urlParams_.Set("fields", googleapi.CombineFields(s))
14768 return c
14769 }
14770
14771 // IfNoneMatch sets an optional parameter which makes the operation fail if the
14772 // object's ETag matches the given value. This is useful for getting updates
14773 // only after the object has changed since the last request.
14774 func (c *ProjectsLocationsTlsRoutesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsTlsRoutesListCall {
14775 c.ifNoneMatch_ = entityTag
14776 return c
14777 }
14778
14779 // Context sets the context to be used in this call's Do method.
14780 func (c *ProjectsLocationsTlsRoutesListCall) Context(ctx context.Context) *ProjectsLocationsTlsRoutesListCall {
14781 c.ctx_ = ctx
14782 return c
14783 }
14784
14785 // Header returns a http.Header that can be modified by the caller to add
14786 // headers to the request.
14787 func (c *ProjectsLocationsTlsRoutesListCall) Header() http.Header {
14788 if c.header_ == nil {
14789 c.header_ = make(http.Header)
14790 }
14791 return c.header_
14792 }
14793
14794 func (c *ProjectsLocationsTlsRoutesListCall) doRequest(alt string) (*http.Response, error) {
14795 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
14796 if c.ifNoneMatch_ != "" {
14797 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
14798 }
14799 c.urlParams_.Set("alt", alt)
14800 c.urlParams_.Set("prettyPrint", "false")
14801 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/tlsRoutes")
14802 urls += "?" + c.urlParams_.Encode()
14803 req, err := http.NewRequest("GET", urls, nil)
14804 if err != nil {
14805 return nil, err
14806 }
14807 req.Header = reqHeaders
14808 googleapi.Expand(req.URL, map[string]string{
14809 "parent": c.parent,
14810 })
14811 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tlsRoutes.list", "request", internallog.HTTPRequest(req, nil))
14812 return gensupport.SendRequest(c.ctx_, c.s.client, req)
14813 }
14814
14815 // Do executes the "networkservices.projects.locations.tlsRoutes.list" call.
14816 // Any non-2xx status code is an error. Response headers are in either
14817 // *ListTlsRoutesResponse.ServerResponse.Header or (if a response was returned
14818 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
14819 // check whether the returned error was because http.StatusNotModified was
14820 // returned.
14821 func (c *ProjectsLocationsTlsRoutesListCall) Do(opts ...googleapi.CallOption) (*ListTlsRoutesResponse, error) {
14822 gensupport.SetOptions(c.urlParams_, opts...)
14823 res, err := c.doRequest("json")
14824 if res != nil && res.StatusCode == http.StatusNotModified {
14825 if res.Body != nil {
14826 res.Body.Close()
14827 }
14828 return nil, gensupport.WrapError(&googleapi.Error{
14829 Code: res.StatusCode,
14830 Header: res.Header,
14831 })
14832 }
14833 if err != nil {
14834 return nil, err
14835 }
14836 defer googleapi.CloseBody(res)
14837 if err := googleapi.CheckResponse(res); err != nil {
14838 return nil, gensupport.WrapError(err)
14839 }
14840 ret := &ListTlsRoutesResponse{
14841 ServerResponse: googleapi.ServerResponse{
14842 Header: res.Header,
14843 HTTPStatusCode: res.StatusCode,
14844 },
14845 }
14846 target := &ret
14847 b, err := gensupport.DecodeResponseBytes(target, res)
14848 if err != nil {
14849 return nil, err
14850 }
14851 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tlsRoutes.list", "response", internallog.HTTPResponse(res, b))
14852 return ret, nil
14853 }
14854
14855 // Pages invokes f for each page of results.
14856 // A non-nil error returned from f will halt the iteration.
14857 // The provided context supersedes any context provided to the Context method.
14858 func (c *ProjectsLocationsTlsRoutesListCall) Pages(ctx context.Context, f func(*ListTlsRoutesResponse) error) error {
14859 c.ctx_ = ctx
14860 defer c.PageToken(c.urlParams_.Get("pageToken"))
14861 for {
14862 x, err := c.Do()
14863 if err != nil {
14864 return err
14865 }
14866 if err := f(x); err != nil {
14867 return err
14868 }
14869 if x.NextPageToken == "" {
14870 return nil
14871 }
14872 c.PageToken(x.NextPageToken)
14873 }
14874 }
14875
14876 type ProjectsLocationsTlsRoutesPatchCall struct {
14877 s *Service
14878 name string
14879 tlsroute *TlsRoute
14880 urlParams_ gensupport.URLParams
14881 ctx_ context.Context
14882 header_ http.Header
14883 }
14884
14885 // Patch: Updates the parameters of a single TlsRoute.
14886 //
14887 // - name: Identifier. Name of the TlsRoute resource. It matches pattern
14888 // `projects/*/locations/*/tlsRoutes/tls_route_name>`.
14889 func (r *ProjectsLocationsTlsRoutesService) Patch(name string, tlsroute *TlsRoute) *ProjectsLocationsTlsRoutesPatchCall {
14890 c := &ProjectsLocationsTlsRoutesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14891 c.name = name
14892 c.tlsroute = tlsroute
14893 return c
14894 }
14895
14896 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
14897 // specify the fields to be overwritten in the TlsRoute resource by the update.
14898 // The fields specified in the update_mask are relative to the resource, not
14899 // the full request. A field will be overwritten if it is in the mask. If the
14900 // user does not provide a mask then all fields will be overwritten.
14901 func (c *ProjectsLocationsTlsRoutesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsTlsRoutesPatchCall {
14902 c.urlParams_.Set("updateMask", updateMask)
14903 return c
14904 }
14905
14906 // Fields allows partial responses to be retrieved. See
14907 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
14908 // details.
14909 func (c *ProjectsLocationsTlsRoutesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsTlsRoutesPatchCall {
14910 c.urlParams_.Set("fields", googleapi.CombineFields(s))
14911 return c
14912 }
14913
14914 // Context sets the context to be used in this call's Do method.
14915 func (c *ProjectsLocationsTlsRoutesPatchCall) Context(ctx context.Context) *ProjectsLocationsTlsRoutesPatchCall {
14916 c.ctx_ = ctx
14917 return c
14918 }
14919
14920 // Header returns a http.Header that can be modified by the caller to add
14921 // headers to the request.
14922 func (c *ProjectsLocationsTlsRoutesPatchCall) Header() http.Header {
14923 if c.header_ == nil {
14924 c.header_ = make(http.Header)
14925 }
14926 return c.header_
14927 }
14928
14929 func (c *ProjectsLocationsTlsRoutesPatchCall) doRequest(alt string) (*http.Response, error) {
14930 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
14931 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tlsroute)
14932 if err != nil {
14933 return nil, err
14934 }
14935 c.urlParams_.Set("alt", alt)
14936 c.urlParams_.Set("prettyPrint", "false")
14937 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
14938 urls += "?" + c.urlParams_.Encode()
14939 req, err := http.NewRequest("PATCH", urls, body)
14940 if err != nil {
14941 return nil, err
14942 }
14943 req.Header = reqHeaders
14944 googleapi.Expand(req.URL, map[string]string{
14945 "name": c.name,
14946 })
14947 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tlsRoutes.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
14948 return gensupport.SendRequest(c.ctx_, c.s.client, req)
14949 }
14950
14951 // Do executes the "networkservices.projects.locations.tlsRoutes.patch" call.
14952 // Any non-2xx status code is an error. Response headers are in either
14953 // *Operation.ServerResponse.Header or (if a response was returned at all) in
14954 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
14955 // whether the returned error was because http.StatusNotModified was returned.
14956 func (c *ProjectsLocationsTlsRoutesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
14957 gensupport.SetOptions(c.urlParams_, opts...)
14958 res, err := c.doRequest("json")
14959 if res != nil && res.StatusCode == http.StatusNotModified {
14960 if res.Body != nil {
14961 res.Body.Close()
14962 }
14963 return nil, gensupport.WrapError(&googleapi.Error{
14964 Code: res.StatusCode,
14965 Header: res.Header,
14966 })
14967 }
14968 if err != nil {
14969 return nil, err
14970 }
14971 defer googleapi.CloseBody(res)
14972 if err := googleapi.CheckResponse(res); err != nil {
14973 return nil, gensupport.WrapError(err)
14974 }
14975 ret := &Operation{
14976 ServerResponse: googleapi.ServerResponse{
14977 Header: res.Header,
14978 HTTPStatusCode: res.StatusCode,
14979 },
14980 }
14981 target := &ret
14982 b, err := gensupport.DecodeResponseBytes(target, res)
14983 if err != nil {
14984 return nil, err
14985 }
14986 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tlsRoutes.patch", "response", internallog.HTTPResponse(res, b))
14987 return ret, nil
14988 }
14989
14990 type ProjectsLocationsWasmPluginsCreateCall struct {
14991 s *Service
14992 parent string
14993 wasmplugin *WasmPlugin
14994 urlParams_ gensupport.URLParams
14995 ctx_ context.Context
14996 header_ http.Header
14997 }
14998
14999 // Create: Creates a new `WasmPlugin` resource in a given project and location.
15000 //
15001 // - parent: The parent resource of the `WasmPlugin` resource. Must be in the
15002 // format `projects/{project}/locations/global`.
15003 func (r *ProjectsLocationsWasmPluginsService) Create(parent string, wasmplugin *WasmPlugin) *ProjectsLocationsWasmPluginsCreateCall {
15004 c := &ProjectsLocationsWasmPluginsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15005 c.parent = parent
15006 c.wasmplugin = wasmplugin
15007 return c
15008 }
15009
15010 // WasmPluginId sets the optional parameter "wasmPluginId": Required.
15011 // User-provided ID of the `WasmPlugin` resource to be created.
15012 func (c *ProjectsLocationsWasmPluginsCreateCall) WasmPluginId(wasmPluginId string) *ProjectsLocationsWasmPluginsCreateCall {
15013 c.urlParams_.Set("wasmPluginId", wasmPluginId)
15014 return c
15015 }
15016
15017 // Fields allows partial responses to be retrieved. See
15018 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
15019 // details.
15020 func (c *ProjectsLocationsWasmPluginsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsWasmPluginsCreateCall {
15021 c.urlParams_.Set("fields", googleapi.CombineFields(s))
15022 return c
15023 }
15024
15025 // Context sets the context to be used in this call's Do method.
15026 func (c *ProjectsLocationsWasmPluginsCreateCall) Context(ctx context.Context) *ProjectsLocationsWasmPluginsCreateCall {
15027 c.ctx_ = ctx
15028 return c
15029 }
15030
15031 // Header returns a http.Header that can be modified by the caller to add
15032 // headers to the request.
15033 func (c *ProjectsLocationsWasmPluginsCreateCall) Header() http.Header {
15034 if c.header_ == nil {
15035 c.header_ = make(http.Header)
15036 }
15037 return c.header_
15038 }
15039
15040 func (c *ProjectsLocationsWasmPluginsCreateCall) doRequest(alt string) (*http.Response, error) {
15041 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
15042 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.wasmplugin)
15043 if err != nil {
15044 return nil, err
15045 }
15046 c.urlParams_.Set("alt", alt)
15047 c.urlParams_.Set("prettyPrint", "false")
15048 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/wasmPlugins")
15049 urls += "?" + c.urlParams_.Encode()
15050 req, err := http.NewRequest("POST", urls, body)
15051 if err != nil {
15052 return nil, err
15053 }
15054 req.Header = reqHeaders
15055 googleapi.Expand(req.URL, map[string]string{
15056 "parent": c.parent,
15057 })
15058 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.create", "request", internallog.HTTPRequest(req, body.Bytes()))
15059 return gensupport.SendRequest(c.ctx_, c.s.client, req)
15060 }
15061
15062 // Do executes the "networkservices.projects.locations.wasmPlugins.create" call.
15063 // Any non-2xx status code is an error. Response headers are in either
15064 // *Operation.ServerResponse.Header or (if a response was returned at all) in
15065 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
15066 // whether the returned error was because http.StatusNotModified was returned.
15067 func (c *ProjectsLocationsWasmPluginsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
15068 gensupport.SetOptions(c.urlParams_, opts...)
15069 res, err := c.doRequest("json")
15070 if res != nil && res.StatusCode == http.StatusNotModified {
15071 if res.Body != nil {
15072 res.Body.Close()
15073 }
15074 return nil, gensupport.WrapError(&googleapi.Error{
15075 Code: res.StatusCode,
15076 Header: res.Header,
15077 })
15078 }
15079 if err != nil {
15080 return nil, err
15081 }
15082 defer googleapi.CloseBody(res)
15083 if err := googleapi.CheckResponse(res); err != nil {
15084 return nil, gensupport.WrapError(err)
15085 }
15086 ret := &Operation{
15087 ServerResponse: googleapi.ServerResponse{
15088 Header: res.Header,
15089 HTTPStatusCode: res.StatusCode,
15090 },
15091 }
15092 target := &ret
15093 b, err := gensupport.DecodeResponseBytes(target, res)
15094 if err != nil {
15095 return nil, err
15096 }
15097 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.create", "response", internallog.HTTPResponse(res, b))
15098 return ret, nil
15099 }
15100
15101 type ProjectsLocationsWasmPluginsDeleteCall struct {
15102 s *Service
15103 name string
15104 urlParams_ gensupport.URLParams
15105 ctx_ context.Context
15106 header_ http.Header
15107 }
15108
15109 // Delete: Deletes the specified `WasmPlugin` resource.
15110 //
15111 // - name: A name of the `WasmPlugin` resource to delete. Must be in the format
15112 // `projects/{project}/locations/global/wasmPlugins/{wasm_plugin}`.
15113 func (r *ProjectsLocationsWasmPluginsService) Delete(name string) *ProjectsLocationsWasmPluginsDeleteCall {
15114 c := &ProjectsLocationsWasmPluginsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15115 c.name = name
15116 return c
15117 }
15118
15119 // Fields allows partial responses to be retrieved. See
15120 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
15121 // details.
15122 func (c *ProjectsLocationsWasmPluginsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsWasmPluginsDeleteCall {
15123 c.urlParams_.Set("fields", googleapi.CombineFields(s))
15124 return c
15125 }
15126
15127 // Context sets the context to be used in this call's Do method.
15128 func (c *ProjectsLocationsWasmPluginsDeleteCall) Context(ctx context.Context) *ProjectsLocationsWasmPluginsDeleteCall {
15129 c.ctx_ = ctx
15130 return c
15131 }
15132
15133 // Header returns a http.Header that can be modified by the caller to add
15134 // headers to the request.
15135 func (c *ProjectsLocationsWasmPluginsDeleteCall) Header() http.Header {
15136 if c.header_ == nil {
15137 c.header_ = make(http.Header)
15138 }
15139 return c.header_
15140 }
15141
15142 func (c *ProjectsLocationsWasmPluginsDeleteCall) doRequest(alt string) (*http.Response, error) {
15143 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
15144 c.urlParams_.Set("alt", alt)
15145 c.urlParams_.Set("prettyPrint", "false")
15146 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
15147 urls += "?" + c.urlParams_.Encode()
15148 req, err := http.NewRequest("DELETE", urls, nil)
15149 if err != nil {
15150 return nil, err
15151 }
15152 req.Header = reqHeaders
15153 googleapi.Expand(req.URL, map[string]string{
15154 "name": c.name,
15155 })
15156 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.delete", "request", internallog.HTTPRequest(req, nil))
15157 return gensupport.SendRequest(c.ctx_, c.s.client, req)
15158 }
15159
15160 // Do executes the "networkservices.projects.locations.wasmPlugins.delete" call.
15161 // Any non-2xx status code is an error. Response headers are in either
15162 // *Operation.ServerResponse.Header or (if a response was returned at all) in
15163 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
15164 // whether the returned error was because http.StatusNotModified was returned.
15165 func (c *ProjectsLocationsWasmPluginsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
15166 gensupport.SetOptions(c.urlParams_, opts...)
15167 res, err := c.doRequest("json")
15168 if res != nil && res.StatusCode == http.StatusNotModified {
15169 if res.Body != nil {
15170 res.Body.Close()
15171 }
15172 return nil, gensupport.WrapError(&googleapi.Error{
15173 Code: res.StatusCode,
15174 Header: res.Header,
15175 })
15176 }
15177 if err != nil {
15178 return nil, err
15179 }
15180 defer googleapi.CloseBody(res)
15181 if err := googleapi.CheckResponse(res); err != nil {
15182 return nil, gensupport.WrapError(err)
15183 }
15184 ret := &Operation{
15185 ServerResponse: googleapi.ServerResponse{
15186 Header: res.Header,
15187 HTTPStatusCode: res.StatusCode,
15188 },
15189 }
15190 target := &ret
15191 b, err := gensupport.DecodeResponseBytes(target, res)
15192 if err != nil {
15193 return nil, err
15194 }
15195 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.delete", "response", internallog.HTTPResponse(res, b))
15196 return ret, nil
15197 }
15198
15199 type ProjectsLocationsWasmPluginsGetCall struct {
15200 s *Service
15201 name string
15202 urlParams_ gensupport.URLParams
15203 ifNoneMatch_ string
15204 ctx_ context.Context
15205 header_ http.Header
15206 }
15207
15208 // Get: Gets details of the specified `WasmPlugin` resource.
15209 //
15210 // - name: A name of the `WasmPlugin` resource to get. Must be in the format
15211 // `projects/{project}/locations/global/wasmPlugins/{wasm_plugin}`.
15212 func (r *ProjectsLocationsWasmPluginsService) Get(name string) *ProjectsLocationsWasmPluginsGetCall {
15213 c := &ProjectsLocationsWasmPluginsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15214 c.name = name
15215 return c
15216 }
15217
15218 // View sets the optional parameter "view": Determines how much data must be
15219 // returned in the response. See AIP-157 (https://google.aip.dev/157).
15220 //
15221 // Possible values:
15222 //
15223 // "WASM_PLUGIN_VIEW_UNSPECIFIED" - Unspecified value. Do not use.
15224 // "WASM_PLUGIN_VIEW_BASIC" - If specified in the `GET` request for a
15225 //
15226 // `WasmPlugin` resource, the server's response includes just the `WasmPlugin`
15227 // resource.
15228 //
15229 // "WASM_PLUGIN_VIEW_FULL" - If specified in the `GET` request for a
15230 //
15231 // `WasmPlugin` resource, the server's response includes the `WasmPlugin`
15232 // resource with all its versions.
15233 func (c *ProjectsLocationsWasmPluginsGetCall) View(view string) *ProjectsLocationsWasmPluginsGetCall {
15234 c.urlParams_.Set("view", view)
15235 return c
15236 }
15237
15238 // Fields allows partial responses to be retrieved. See
15239 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
15240 // details.
15241 func (c *ProjectsLocationsWasmPluginsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsWasmPluginsGetCall {
15242 c.urlParams_.Set("fields", googleapi.CombineFields(s))
15243 return c
15244 }
15245
15246 // IfNoneMatch sets an optional parameter which makes the operation fail if the
15247 // object's ETag matches the given value. This is useful for getting updates
15248 // only after the object has changed since the last request.
15249 func (c *ProjectsLocationsWasmPluginsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsWasmPluginsGetCall {
15250 c.ifNoneMatch_ = entityTag
15251 return c
15252 }
15253
15254 // Context sets the context to be used in this call's Do method.
15255 func (c *ProjectsLocationsWasmPluginsGetCall) Context(ctx context.Context) *ProjectsLocationsWasmPluginsGetCall {
15256 c.ctx_ = ctx
15257 return c
15258 }
15259
15260 // Header returns a http.Header that can be modified by the caller to add
15261 // headers to the request.
15262 func (c *ProjectsLocationsWasmPluginsGetCall) Header() http.Header {
15263 if c.header_ == nil {
15264 c.header_ = make(http.Header)
15265 }
15266 return c.header_
15267 }
15268
15269 func (c *ProjectsLocationsWasmPluginsGetCall) doRequest(alt string) (*http.Response, error) {
15270 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
15271 if c.ifNoneMatch_ != "" {
15272 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
15273 }
15274 c.urlParams_.Set("alt", alt)
15275 c.urlParams_.Set("prettyPrint", "false")
15276 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
15277 urls += "?" + c.urlParams_.Encode()
15278 req, err := http.NewRequest("GET", urls, nil)
15279 if err != nil {
15280 return nil, err
15281 }
15282 req.Header = reqHeaders
15283 googleapi.Expand(req.URL, map[string]string{
15284 "name": c.name,
15285 })
15286 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.get", "request", internallog.HTTPRequest(req, nil))
15287 return gensupport.SendRequest(c.ctx_, c.s.client, req)
15288 }
15289
15290 // Do executes the "networkservices.projects.locations.wasmPlugins.get" call.
15291 // Any non-2xx status code is an error. Response headers are in either
15292 // *WasmPlugin.ServerResponse.Header or (if a response was returned at all) in
15293 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
15294 // whether the returned error was because http.StatusNotModified was returned.
15295 func (c *ProjectsLocationsWasmPluginsGetCall) Do(opts ...googleapi.CallOption) (*WasmPlugin, error) {
15296 gensupport.SetOptions(c.urlParams_, opts...)
15297 res, err := c.doRequest("json")
15298 if res != nil && res.StatusCode == http.StatusNotModified {
15299 if res.Body != nil {
15300 res.Body.Close()
15301 }
15302 return nil, gensupport.WrapError(&googleapi.Error{
15303 Code: res.StatusCode,
15304 Header: res.Header,
15305 })
15306 }
15307 if err != nil {
15308 return nil, err
15309 }
15310 defer googleapi.CloseBody(res)
15311 if err := googleapi.CheckResponse(res); err != nil {
15312 return nil, gensupport.WrapError(err)
15313 }
15314 ret := &WasmPlugin{
15315 ServerResponse: googleapi.ServerResponse{
15316 Header: res.Header,
15317 HTTPStatusCode: res.StatusCode,
15318 },
15319 }
15320 target := &ret
15321 b, err := gensupport.DecodeResponseBytes(target, res)
15322 if err != nil {
15323 return nil, err
15324 }
15325 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.get", "response", internallog.HTTPResponse(res, b))
15326 return ret, nil
15327 }
15328
15329 type ProjectsLocationsWasmPluginsListCall struct {
15330 s *Service
15331 parent string
15332 urlParams_ gensupport.URLParams
15333 ifNoneMatch_ string
15334 ctx_ context.Context
15335 header_ http.Header
15336 }
15337
15338 // List: Lists `WasmPlugin` resources in a given project and location.
15339 //
15340 // - parent: The project and location from which the `WasmPlugin` resources are
15341 // listed, specified in the following format:
15342 // `projects/{project}/locations/global`.
15343 func (r *ProjectsLocationsWasmPluginsService) List(parent string) *ProjectsLocationsWasmPluginsListCall {
15344 c := &ProjectsLocationsWasmPluginsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15345 c.parent = parent
15346 return c
15347 }
15348
15349 // PageSize sets the optional parameter "pageSize": Maximum number of
15350 // `WasmPlugin` resources to return per call. If not specified, at most 50
15351 // `WasmPlugin` resources are returned. The maximum value is 1000; values above
15352 // 1000 are coerced to 1000.
15353 func (c *ProjectsLocationsWasmPluginsListCall) PageSize(pageSize int64) *ProjectsLocationsWasmPluginsListCall {
15354 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
15355 return c
15356 }
15357
15358 // PageToken sets the optional parameter "pageToken": The value returned by the
15359 // last `ListWasmPluginsResponse` call. Indicates that this is a continuation
15360 // of a prior `ListWasmPlugins` call, and that the next page of data is to be
15361 // returned.
15362 func (c *ProjectsLocationsWasmPluginsListCall) PageToken(pageToken string) *ProjectsLocationsWasmPluginsListCall {
15363 c.urlParams_.Set("pageToken", pageToken)
15364 return c
15365 }
15366
15367 // Fields allows partial responses to be retrieved. See
15368 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
15369 // details.
15370 func (c *ProjectsLocationsWasmPluginsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsWasmPluginsListCall {
15371 c.urlParams_.Set("fields", googleapi.CombineFields(s))
15372 return c
15373 }
15374
15375 // IfNoneMatch sets an optional parameter which makes the operation fail if the
15376 // object's ETag matches the given value. This is useful for getting updates
15377 // only after the object has changed since the last request.
15378 func (c *ProjectsLocationsWasmPluginsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsWasmPluginsListCall {
15379 c.ifNoneMatch_ = entityTag
15380 return c
15381 }
15382
15383 // Context sets the context to be used in this call's Do method.
15384 func (c *ProjectsLocationsWasmPluginsListCall) Context(ctx context.Context) *ProjectsLocationsWasmPluginsListCall {
15385 c.ctx_ = ctx
15386 return c
15387 }
15388
15389 // Header returns a http.Header that can be modified by the caller to add
15390 // headers to the request.
15391 func (c *ProjectsLocationsWasmPluginsListCall) Header() http.Header {
15392 if c.header_ == nil {
15393 c.header_ = make(http.Header)
15394 }
15395 return c.header_
15396 }
15397
15398 func (c *ProjectsLocationsWasmPluginsListCall) doRequest(alt string) (*http.Response, error) {
15399 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
15400 if c.ifNoneMatch_ != "" {
15401 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
15402 }
15403 c.urlParams_.Set("alt", alt)
15404 c.urlParams_.Set("prettyPrint", "false")
15405 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/wasmPlugins")
15406 urls += "?" + c.urlParams_.Encode()
15407 req, err := http.NewRequest("GET", urls, nil)
15408 if err != nil {
15409 return nil, err
15410 }
15411 req.Header = reqHeaders
15412 googleapi.Expand(req.URL, map[string]string{
15413 "parent": c.parent,
15414 })
15415 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.list", "request", internallog.HTTPRequest(req, nil))
15416 return gensupport.SendRequest(c.ctx_, c.s.client, req)
15417 }
15418
15419 // Do executes the "networkservices.projects.locations.wasmPlugins.list" call.
15420 // Any non-2xx status code is an error. Response headers are in either
15421 // *ListWasmPluginsResponse.ServerResponse.Header or (if a response was
15422 // returned at all) in error.(*googleapi.Error).Header. Use
15423 // googleapi.IsNotModified to check whether the returned error was because
15424 // http.StatusNotModified was returned.
15425 func (c *ProjectsLocationsWasmPluginsListCall) Do(opts ...googleapi.CallOption) (*ListWasmPluginsResponse, error) {
15426 gensupport.SetOptions(c.urlParams_, opts...)
15427 res, err := c.doRequest("json")
15428 if res != nil && res.StatusCode == http.StatusNotModified {
15429 if res.Body != nil {
15430 res.Body.Close()
15431 }
15432 return nil, gensupport.WrapError(&googleapi.Error{
15433 Code: res.StatusCode,
15434 Header: res.Header,
15435 })
15436 }
15437 if err != nil {
15438 return nil, err
15439 }
15440 defer googleapi.CloseBody(res)
15441 if err := googleapi.CheckResponse(res); err != nil {
15442 return nil, gensupport.WrapError(err)
15443 }
15444 ret := &ListWasmPluginsResponse{
15445 ServerResponse: googleapi.ServerResponse{
15446 Header: res.Header,
15447 HTTPStatusCode: res.StatusCode,
15448 },
15449 }
15450 target := &ret
15451 b, err := gensupport.DecodeResponseBytes(target, res)
15452 if err != nil {
15453 return nil, err
15454 }
15455 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.list", "response", internallog.HTTPResponse(res, b))
15456 return ret, nil
15457 }
15458
15459 // Pages invokes f for each page of results.
15460 // A non-nil error returned from f will halt the iteration.
15461 // The provided context supersedes any context provided to the Context method.
15462 func (c *ProjectsLocationsWasmPluginsListCall) Pages(ctx context.Context, f func(*ListWasmPluginsResponse) error) error {
15463 c.ctx_ = ctx
15464 defer c.PageToken(c.urlParams_.Get("pageToken"))
15465 for {
15466 x, err := c.Do()
15467 if err != nil {
15468 return err
15469 }
15470 if err := f(x); err != nil {
15471 return err
15472 }
15473 if x.NextPageToken == "" {
15474 return nil
15475 }
15476 c.PageToken(x.NextPageToken)
15477 }
15478 }
15479
15480 type ProjectsLocationsWasmPluginsPatchCall struct {
15481 s *Service
15482 name string
15483 wasmplugin *WasmPlugin
15484 urlParams_ gensupport.URLParams
15485 ctx_ context.Context
15486 header_ http.Header
15487 }
15488
15489 // Patch: Updates the parameters of the specified `WasmPlugin` resource.
15490 //
15491 // - name: Identifier. Name of the `WasmPlugin` resource in the following
15492 // format:
15493 // `projects/{project}/locations/{location}/wasmPlugins/{wasm_plugin}`.
15494 func (r *ProjectsLocationsWasmPluginsService) Patch(name string, wasmplugin *WasmPlugin) *ProjectsLocationsWasmPluginsPatchCall {
15495 c := &ProjectsLocationsWasmPluginsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15496 c.name = name
15497 c.wasmplugin = wasmplugin
15498 return c
15499 }
15500
15501 // UpdateMask sets the optional parameter "updateMask": Used to specify the
15502 // fields to be overwritten in the `WasmPlugin` resource by the update. The
15503 // fields specified in the `update_mask` field are relative to the resource,
15504 // not the full request. An omitted `update_mask` field is treated as an
15505 // implied `update_mask` field equivalent to all fields that are populated
15506 // (that have a non-empty value). The `update_mask` field supports a special
15507 // value `*`, which means that each field in the given `WasmPlugin` resource
15508 // (including the empty ones) replaces the current value.
15509 func (c *ProjectsLocationsWasmPluginsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsWasmPluginsPatchCall {
15510 c.urlParams_.Set("updateMask", updateMask)
15511 return c
15512 }
15513
15514 // Fields allows partial responses to be retrieved. See
15515 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
15516 // details.
15517 func (c *ProjectsLocationsWasmPluginsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsWasmPluginsPatchCall {
15518 c.urlParams_.Set("fields", googleapi.CombineFields(s))
15519 return c
15520 }
15521
15522 // Context sets the context to be used in this call's Do method.
15523 func (c *ProjectsLocationsWasmPluginsPatchCall) Context(ctx context.Context) *ProjectsLocationsWasmPluginsPatchCall {
15524 c.ctx_ = ctx
15525 return c
15526 }
15527
15528 // Header returns a http.Header that can be modified by the caller to add
15529 // headers to the request.
15530 func (c *ProjectsLocationsWasmPluginsPatchCall) Header() http.Header {
15531 if c.header_ == nil {
15532 c.header_ = make(http.Header)
15533 }
15534 return c.header_
15535 }
15536
15537 func (c *ProjectsLocationsWasmPluginsPatchCall) doRequest(alt string) (*http.Response, error) {
15538 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
15539 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.wasmplugin)
15540 if err != nil {
15541 return nil, err
15542 }
15543 c.urlParams_.Set("alt", alt)
15544 c.urlParams_.Set("prettyPrint", "false")
15545 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
15546 urls += "?" + c.urlParams_.Encode()
15547 req, err := http.NewRequest("PATCH", urls, body)
15548 if err != nil {
15549 return nil, err
15550 }
15551 req.Header = reqHeaders
15552 googleapi.Expand(req.URL, map[string]string{
15553 "name": c.name,
15554 })
15555 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
15556 return gensupport.SendRequest(c.ctx_, c.s.client, req)
15557 }
15558
15559 // Do executes the "networkservices.projects.locations.wasmPlugins.patch" call.
15560 // Any non-2xx status code is an error. Response headers are in either
15561 // *Operation.ServerResponse.Header or (if a response was returned at all) in
15562 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
15563 // whether the returned error was because http.StatusNotModified was returned.
15564 func (c *ProjectsLocationsWasmPluginsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
15565 gensupport.SetOptions(c.urlParams_, opts...)
15566 res, err := c.doRequest("json")
15567 if res != nil && res.StatusCode == http.StatusNotModified {
15568 if res.Body != nil {
15569 res.Body.Close()
15570 }
15571 return nil, gensupport.WrapError(&googleapi.Error{
15572 Code: res.StatusCode,
15573 Header: res.Header,
15574 })
15575 }
15576 if err != nil {
15577 return nil, err
15578 }
15579 defer googleapi.CloseBody(res)
15580 if err := googleapi.CheckResponse(res); err != nil {
15581 return nil, gensupport.WrapError(err)
15582 }
15583 ret := &Operation{
15584 ServerResponse: googleapi.ServerResponse{
15585 Header: res.Header,
15586 HTTPStatusCode: res.StatusCode,
15587 },
15588 }
15589 target := &ret
15590 b, err := gensupport.DecodeResponseBytes(target, res)
15591 if err != nil {
15592 return nil, err
15593 }
15594 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.patch", "response", internallog.HTTPResponse(res, b))
15595 return ret, nil
15596 }
15597
15598 type ProjectsLocationsWasmPluginsVersionsCreateCall struct {
15599 s *Service
15600 parent string
15601 wasmpluginversion *WasmPluginVersion
15602 urlParams_ gensupport.URLParams
15603 ctx_ context.Context
15604 header_ http.Header
15605 }
15606
15607 // Create: Creates a new `WasmPluginVersion` resource in a given project and
15608 // location.
15609 //
15610 // - parent: The parent resource of the `WasmPluginVersion` resource. Must be
15611 // in the format
15612 // `projects/{project}/locations/global/wasmPlugins/{wasm_plugin}`.
15613 func (r *ProjectsLocationsWasmPluginsVersionsService) Create(parent string, wasmpluginversion *WasmPluginVersion) *ProjectsLocationsWasmPluginsVersionsCreateCall {
15614 c := &ProjectsLocationsWasmPluginsVersionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15615 c.parent = parent
15616 c.wasmpluginversion = wasmpluginversion
15617 return c
15618 }
15619
15620 // WasmPluginVersionId sets the optional parameter "wasmPluginVersionId":
15621 // Required. User-provided ID of the `WasmPluginVersion` resource to be
15622 // created.
15623 func (c *ProjectsLocationsWasmPluginsVersionsCreateCall) WasmPluginVersionId(wasmPluginVersionId string) *ProjectsLocationsWasmPluginsVersionsCreateCall {
15624 c.urlParams_.Set("wasmPluginVersionId", wasmPluginVersionId)
15625 return c
15626 }
15627
15628 // Fields allows partial responses to be retrieved. See
15629 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
15630 // details.
15631 func (c *ProjectsLocationsWasmPluginsVersionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsWasmPluginsVersionsCreateCall {
15632 c.urlParams_.Set("fields", googleapi.CombineFields(s))
15633 return c
15634 }
15635
15636 // Context sets the context to be used in this call's Do method.
15637 func (c *ProjectsLocationsWasmPluginsVersionsCreateCall) Context(ctx context.Context) *ProjectsLocationsWasmPluginsVersionsCreateCall {
15638 c.ctx_ = ctx
15639 return c
15640 }
15641
15642 // Header returns a http.Header that can be modified by the caller to add
15643 // headers to the request.
15644 func (c *ProjectsLocationsWasmPluginsVersionsCreateCall) Header() http.Header {
15645 if c.header_ == nil {
15646 c.header_ = make(http.Header)
15647 }
15648 return c.header_
15649 }
15650
15651 func (c *ProjectsLocationsWasmPluginsVersionsCreateCall) doRequest(alt string) (*http.Response, error) {
15652 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
15653 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.wasmpluginversion)
15654 if err != nil {
15655 return nil, err
15656 }
15657 c.urlParams_.Set("alt", alt)
15658 c.urlParams_.Set("prettyPrint", "false")
15659 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/versions")
15660 urls += "?" + c.urlParams_.Encode()
15661 req, err := http.NewRequest("POST", urls, body)
15662 if err != nil {
15663 return nil, err
15664 }
15665 req.Header = reqHeaders
15666 googleapi.Expand(req.URL, map[string]string{
15667 "parent": c.parent,
15668 })
15669 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.versions.create", "request", internallog.HTTPRequest(req, body.Bytes()))
15670 return gensupport.SendRequest(c.ctx_, c.s.client, req)
15671 }
15672
15673 // Do executes the "networkservices.projects.locations.wasmPlugins.versions.create" call.
15674 // Any non-2xx status code is an error. Response headers are in either
15675 // *Operation.ServerResponse.Header or (if a response was returned at all) in
15676 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
15677 // whether the returned error was because http.StatusNotModified was returned.
15678 func (c *ProjectsLocationsWasmPluginsVersionsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
15679 gensupport.SetOptions(c.urlParams_, opts...)
15680 res, err := c.doRequest("json")
15681 if res != nil && res.StatusCode == http.StatusNotModified {
15682 if res.Body != nil {
15683 res.Body.Close()
15684 }
15685 return nil, gensupport.WrapError(&googleapi.Error{
15686 Code: res.StatusCode,
15687 Header: res.Header,
15688 })
15689 }
15690 if err != nil {
15691 return nil, err
15692 }
15693 defer googleapi.CloseBody(res)
15694 if err := googleapi.CheckResponse(res); err != nil {
15695 return nil, gensupport.WrapError(err)
15696 }
15697 ret := &Operation{
15698 ServerResponse: googleapi.ServerResponse{
15699 Header: res.Header,
15700 HTTPStatusCode: res.StatusCode,
15701 },
15702 }
15703 target := &ret
15704 b, err := gensupport.DecodeResponseBytes(target, res)
15705 if err != nil {
15706 return nil, err
15707 }
15708 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.versions.create", "response", internallog.HTTPResponse(res, b))
15709 return ret, nil
15710 }
15711
15712 type ProjectsLocationsWasmPluginsVersionsDeleteCall struct {
15713 s *Service
15714 name string
15715 urlParams_ gensupport.URLParams
15716 ctx_ context.Context
15717 header_ http.Header
15718 }
15719
15720 // Delete: Deletes the specified `WasmPluginVersion` resource.
15721 //
15722 // - name: A name of the `WasmPluginVersion` resource to delete. Must be in the
15723 // format
15724 // `projects/{project}/locations/global/wasmPlugins/{wasm_plugin}/versions/{wa
15725 // sm_plugin_version}`.
15726 func (r *ProjectsLocationsWasmPluginsVersionsService) Delete(name string) *ProjectsLocationsWasmPluginsVersionsDeleteCall {
15727 c := &ProjectsLocationsWasmPluginsVersionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15728 c.name = name
15729 return c
15730 }
15731
15732 // Fields allows partial responses to be retrieved. See
15733 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
15734 // details.
15735 func (c *ProjectsLocationsWasmPluginsVersionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsWasmPluginsVersionsDeleteCall {
15736 c.urlParams_.Set("fields", googleapi.CombineFields(s))
15737 return c
15738 }
15739
15740 // Context sets the context to be used in this call's Do method.
15741 func (c *ProjectsLocationsWasmPluginsVersionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsWasmPluginsVersionsDeleteCall {
15742 c.ctx_ = ctx
15743 return c
15744 }
15745
15746 // Header returns a http.Header that can be modified by the caller to add
15747 // headers to the request.
15748 func (c *ProjectsLocationsWasmPluginsVersionsDeleteCall) Header() http.Header {
15749 if c.header_ == nil {
15750 c.header_ = make(http.Header)
15751 }
15752 return c.header_
15753 }
15754
15755 func (c *ProjectsLocationsWasmPluginsVersionsDeleteCall) doRequest(alt string) (*http.Response, error) {
15756 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
15757 c.urlParams_.Set("alt", alt)
15758 c.urlParams_.Set("prettyPrint", "false")
15759 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
15760 urls += "?" + c.urlParams_.Encode()
15761 req, err := http.NewRequest("DELETE", urls, nil)
15762 if err != nil {
15763 return nil, err
15764 }
15765 req.Header = reqHeaders
15766 googleapi.Expand(req.URL, map[string]string{
15767 "name": c.name,
15768 })
15769 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.versions.delete", "request", internallog.HTTPRequest(req, nil))
15770 return gensupport.SendRequest(c.ctx_, c.s.client, req)
15771 }
15772
15773 // Do executes the "networkservices.projects.locations.wasmPlugins.versions.delete" call.
15774 // Any non-2xx status code is an error. Response headers are in either
15775 // *Operation.ServerResponse.Header or (if a response was returned at all) in
15776 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
15777 // whether the returned error was because http.StatusNotModified was returned.
15778 func (c *ProjectsLocationsWasmPluginsVersionsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
15779 gensupport.SetOptions(c.urlParams_, opts...)
15780 res, err := c.doRequest("json")
15781 if res != nil && res.StatusCode == http.StatusNotModified {
15782 if res.Body != nil {
15783 res.Body.Close()
15784 }
15785 return nil, gensupport.WrapError(&googleapi.Error{
15786 Code: res.StatusCode,
15787 Header: res.Header,
15788 })
15789 }
15790 if err != nil {
15791 return nil, err
15792 }
15793 defer googleapi.CloseBody(res)
15794 if err := googleapi.CheckResponse(res); err != nil {
15795 return nil, gensupport.WrapError(err)
15796 }
15797 ret := &Operation{
15798 ServerResponse: googleapi.ServerResponse{
15799 Header: res.Header,
15800 HTTPStatusCode: res.StatusCode,
15801 },
15802 }
15803 target := &ret
15804 b, err := gensupport.DecodeResponseBytes(target, res)
15805 if err != nil {
15806 return nil, err
15807 }
15808 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.versions.delete", "response", internallog.HTTPResponse(res, b))
15809 return ret, nil
15810 }
15811
15812 type ProjectsLocationsWasmPluginsVersionsGetCall struct {
15813 s *Service
15814 name string
15815 urlParams_ gensupport.URLParams
15816 ifNoneMatch_ string
15817 ctx_ context.Context
15818 header_ http.Header
15819 }
15820
15821 // Get: Gets details of the specified `WasmPluginVersion` resource.
15822 //
15823 // - name: A name of the `WasmPluginVersion` resource to get. Must be in the
15824 // format
15825 // `projects/{project}/locations/global/wasmPlugins/{wasm_plugin}/versions/{wa
15826 // sm_plugin_version}`.
15827 func (r *ProjectsLocationsWasmPluginsVersionsService) Get(name string) *ProjectsLocationsWasmPluginsVersionsGetCall {
15828 c := &ProjectsLocationsWasmPluginsVersionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15829 c.name = name
15830 return c
15831 }
15832
15833 // Fields allows partial responses to be retrieved. See
15834 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
15835 // details.
15836 func (c *ProjectsLocationsWasmPluginsVersionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsWasmPluginsVersionsGetCall {
15837 c.urlParams_.Set("fields", googleapi.CombineFields(s))
15838 return c
15839 }
15840
15841 // IfNoneMatch sets an optional parameter which makes the operation fail if the
15842 // object's ETag matches the given value. This is useful for getting updates
15843 // only after the object has changed since the last request.
15844 func (c *ProjectsLocationsWasmPluginsVersionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsWasmPluginsVersionsGetCall {
15845 c.ifNoneMatch_ = entityTag
15846 return c
15847 }
15848
15849 // Context sets the context to be used in this call's Do method.
15850 func (c *ProjectsLocationsWasmPluginsVersionsGetCall) Context(ctx context.Context) *ProjectsLocationsWasmPluginsVersionsGetCall {
15851 c.ctx_ = ctx
15852 return c
15853 }
15854
15855 // Header returns a http.Header that can be modified by the caller to add
15856 // headers to the request.
15857 func (c *ProjectsLocationsWasmPluginsVersionsGetCall) Header() http.Header {
15858 if c.header_ == nil {
15859 c.header_ = make(http.Header)
15860 }
15861 return c.header_
15862 }
15863
15864 func (c *ProjectsLocationsWasmPluginsVersionsGetCall) doRequest(alt string) (*http.Response, error) {
15865 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
15866 if c.ifNoneMatch_ != "" {
15867 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
15868 }
15869 c.urlParams_.Set("alt", alt)
15870 c.urlParams_.Set("prettyPrint", "false")
15871 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
15872 urls += "?" + c.urlParams_.Encode()
15873 req, err := http.NewRequest("GET", urls, nil)
15874 if err != nil {
15875 return nil, err
15876 }
15877 req.Header = reqHeaders
15878 googleapi.Expand(req.URL, map[string]string{
15879 "name": c.name,
15880 })
15881 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.versions.get", "request", internallog.HTTPRequest(req, nil))
15882 return gensupport.SendRequest(c.ctx_, c.s.client, req)
15883 }
15884
15885 // Do executes the "networkservices.projects.locations.wasmPlugins.versions.get" call.
15886 // Any non-2xx status code is an error. Response headers are in either
15887 // *WasmPluginVersion.ServerResponse.Header or (if a response was returned at
15888 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
15889 // check whether the returned error was because http.StatusNotModified was
15890 // returned.
15891 func (c *ProjectsLocationsWasmPluginsVersionsGetCall) Do(opts ...googleapi.CallOption) (*WasmPluginVersion, error) {
15892 gensupport.SetOptions(c.urlParams_, opts...)
15893 res, err := c.doRequest("json")
15894 if res != nil && res.StatusCode == http.StatusNotModified {
15895 if res.Body != nil {
15896 res.Body.Close()
15897 }
15898 return nil, gensupport.WrapError(&googleapi.Error{
15899 Code: res.StatusCode,
15900 Header: res.Header,
15901 })
15902 }
15903 if err != nil {
15904 return nil, err
15905 }
15906 defer googleapi.CloseBody(res)
15907 if err := googleapi.CheckResponse(res); err != nil {
15908 return nil, gensupport.WrapError(err)
15909 }
15910 ret := &WasmPluginVersion{
15911 ServerResponse: googleapi.ServerResponse{
15912 Header: res.Header,
15913 HTTPStatusCode: res.StatusCode,
15914 },
15915 }
15916 target := &ret
15917 b, err := gensupport.DecodeResponseBytes(target, res)
15918 if err != nil {
15919 return nil, err
15920 }
15921 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.versions.get", "response", internallog.HTTPResponse(res, b))
15922 return ret, nil
15923 }
15924
15925 type ProjectsLocationsWasmPluginsVersionsListCall struct {
15926 s *Service
15927 parent string
15928 urlParams_ gensupport.URLParams
15929 ifNoneMatch_ string
15930 ctx_ context.Context
15931 header_ http.Header
15932 }
15933
15934 // List: Lists `WasmPluginVersion` resources in a given project and location.
15935 //
15936 // - parent: The `WasmPlugin` resource whose `WasmPluginVersion`s are listed,
15937 // specified in the following format:
15938 // `projects/{project}/locations/global/wasmPlugins/{wasm_plugin}`.
15939 func (r *ProjectsLocationsWasmPluginsVersionsService) List(parent string) *ProjectsLocationsWasmPluginsVersionsListCall {
15940 c := &ProjectsLocationsWasmPluginsVersionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15941 c.parent = parent
15942 return c
15943 }
15944
15945 // PageSize sets the optional parameter "pageSize": Maximum number of
15946 // `WasmPluginVersion` resources to return per call. If not specified, at most
15947 // 50 `WasmPluginVersion` resources are returned. The maximum value is 1000;
15948 // values above 1000 are coerced to 1000.
15949 func (c *ProjectsLocationsWasmPluginsVersionsListCall) PageSize(pageSize int64) *ProjectsLocationsWasmPluginsVersionsListCall {
15950 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
15951 return c
15952 }
15953
15954 // PageToken sets the optional parameter "pageToken": The value returned by the
15955 // last `ListWasmPluginVersionsResponse` call. Indicates that this is a
15956 // continuation of a prior `ListWasmPluginVersions` call, and that the next
15957 // page of data is to be returned.
15958 func (c *ProjectsLocationsWasmPluginsVersionsListCall) PageToken(pageToken string) *ProjectsLocationsWasmPluginsVersionsListCall {
15959 c.urlParams_.Set("pageToken", pageToken)
15960 return c
15961 }
15962
15963 // Fields allows partial responses to be retrieved. See
15964 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
15965 // details.
15966 func (c *ProjectsLocationsWasmPluginsVersionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsWasmPluginsVersionsListCall {
15967 c.urlParams_.Set("fields", googleapi.CombineFields(s))
15968 return c
15969 }
15970
15971 // IfNoneMatch sets an optional parameter which makes the operation fail if the
15972 // object's ETag matches the given value. This is useful for getting updates
15973 // only after the object has changed since the last request.
15974 func (c *ProjectsLocationsWasmPluginsVersionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsWasmPluginsVersionsListCall {
15975 c.ifNoneMatch_ = entityTag
15976 return c
15977 }
15978
15979 // Context sets the context to be used in this call's Do method.
15980 func (c *ProjectsLocationsWasmPluginsVersionsListCall) Context(ctx context.Context) *ProjectsLocationsWasmPluginsVersionsListCall {
15981 c.ctx_ = ctx
15982 return c
15983 }
15984
15985 // Header returns a http.Header that can be modified by the caller to add
15986 // headers to the request.
15987 func (c *ProjectsLocationsWasmPluginsVersionsListCall) Header() http.Header {
15988 if c.header_ == nil {
15989 c.header_ = make(http.Header)
15990 }
15991 return c.header_
15992 }
15993
15994 func (c *ProjectsLocationsWasmPluginsVersionsListCall) doRequest(alt string) (*http.Response, error) {
15995 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
15996 if c.ifNoneMatch_ != "" {
15997 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
15998 }
15999 c.urlParams_.Set("alt", alt)
16000 c.urlParams_.Set("prettyPrint", "false")
16001 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/versions")
16002 urls += "?" + c.urlParams_.Encode()
16003 req, err := http.NewRequest("GET", urls, nil)
16004 if err != nil {
16005 return nil, err
16006 }
16007 req.Header = reqHeaders
16008 googleapi.Expand(req.URL, map[string]string{
16009 "parent": c.parent,
16010 })
16011 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.versions.list", "request", internallog.HTTPRequest(req, nil))
16012 return gensupport.SendRequest(c.ctx_, c.s.client, req)
16013 }
16014
16015 // Do executes the "networkservices.projects.locations.wasmPlugins.versions.list" call.
16016 // Any non-2xx status code is an error. Response headers are in either
16017 // *ListWasmPluginVersionsResponse.ServerResponse.Header or (if a response was
16018 // returned at all) in error.(*googleapi.Error).Header. Use
16019 // googleapi.IsNotModified to check whether the returned error was because
16020 // http.StatusNotModified was returned.
16021 func (c *ProjectsLocationsWasmPluginsVersionsListCall) Do(opts ...googleapi.CallOption) (*ListWasmPluginVersionsResponse, error) {
16022 gensupport.SetOptions(c.urlParams_, opts...)
16023 res, err := c.doRequest("json")
16024 if res != nil && res.StatusCode == http.StatusNotModified {
16025 if res.Body != nil {
16026 res.Body.Close()
16027 }
16028 return nil, gensupport.WrapError(&googleapi.Error{
16029 Code: res.StatusCode,
16030 Header: res.Header,
16031 })
16032 }
16033 if err != nil {
16034 return nil, err
16035 }
16036 defer googleapi.CloseBody(res)
16037 if err := googleapi.CheckResponse(res); err != nil {
16038 return nil, gensupport.WrapError(err)
16039 }
16040 ret := &ListWasmPluginVersionsResponse{
16041 ServerResponse: googleapi.ServerResponse{
16042 Header: res.Header,
16043 HTTPStatusCode: res.StatusCode,
16044 },
16045 }
16046 target := &ret
16047 b, err := gensupport.DecodeResponseBytes(target, res)
16048 if err != nil {
16049 return nil, err
16050 }
16051 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.versions.list", "response", internallog.HTTPResponse(res, b))
16052 return ret, nil
16053 }
16054
16055 // Pages invokes f for each page of results.
16056 // A non-nil error returned from f will halt the iteration.
16057 // The provided context supersedes any context provided to the Context method.
16058 func (c *ProjectsLocationsWasmPluginsVersionsListCall) Pages(ctx context.Context, f func(*ListWasmPluginVersionsResponse) error) error {
16059 c.ctx_ = ctx
16060 defer c.PageToken(c.urlParams_.Get("pageToken"))
16061 for {
16062 x, err := c.Do()
16063 if err != nil {
16064 return err
16065 }
16066 if err := f(x); err != nil {
16067 return err
16068 }
16069 if x.NextPageToken == "" {
16070 return nil
16071 }
16072 c.PageToken(x.NextPageToken)
16073 }
16074 }