Debian Codegraph @

networkservices/v1beta1/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/v1beta1"
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/v1beta1"
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:v1beta1"
93 const apiName = "networkservices"
94 const apiVersion = "v1beta1"
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.AgentGateways = NewProjectsLocationsAgentGatewaysService(s)
172 rs.AuthzExtensions = NewProjectsLocationsAuthzExtensionsService(s)
173 rs.EndpointPolicies = NewProjectsLocationsEndpointPoliciesService(s)
174 rs.Gateways = NewProjectsLocationsGatewaysService(s)
175 rs.GrpcRoutes = NewProjectsLocationsGrpcRoutesService(s)
176 rs.HttpRoutes = NewProjectsLocationsHttpRoutesService(s)
177 rs.LbEdgeExtensions = NewProjectsLocationsLbEdgeExtensionsService(s)
178 rs.LbRouteExtensions = NewProjectsLocationsLbRouteExtensionsService(s)
179 rs.LbTcpExtensions = NewProjectsLocationsLbTcpExtensionsService(s)
180 rs.LbTrafficExtensions = NewProjectsLocationsLbTrafficExtensionsService(s)
181 rs.Meshes = NewProjectsLocationsMeshesService(s)
182 rs.Operations = NewProjectsLocationsOperationsService(s)
183 rs.ServiceBindings = NewProjectsLocationsServiceBindingsService(s)
184 rs.ServiceLbPolicies = NewProjectsLocationsServiceLbPoliciesService(s)
185 rs.TcpRoutes = NewProjectsLocationsTcpRoutesService(s)
186 rs.TlsRoutes = NewProjectsLocationsTlsRoutesService(s)
187 rs.WasmPlugins = NewProjectsLocationsWasmPluginsService(s)
188 return rs
189 }
190
191 type ProjectsLocationsService struct {
192 s *Service
193
194 AgentGateways *ProjectsLocationsAgentGatewaysService
195
196 AuthzExtensions *ProjectsLocationsAuthzExtensionsService
197
198 EndpointPolicies *ProjectsLocationsEndpointPoliciesService
199
200 Gateways *ProjectsLocationsGatewaysService
201
202 GrpcRoutes *ProjectsLocationsGrpcRoutesService
203
204 HttpRoutes *ProjectsLocationsHttpRoutesService
205
206 LbEdgeExtensions *ProjectsLocationsLbEdgeExtensionsService
207
208 LbRouteExtensions *ProjectsLocationsLbRouteExtensionsService
209
210 LbTcpExtensions *ProjectsLocationsLbTcpExtensionsService
211
212 LbTrafficExtensions *ProjectsLocationsLbTrafficExtensionsService
213
214 Meshes *ProjectsLocationsMeshesService
215
216 Operations *ProjectsLocationsOperationsService
217
218 ServiceBindings *ProjectsLocationsServiceBindingsService
219
220 ServiceLbPolicies *ProjectsLocationsServiceLbPoliciesService
221
222 TcpRoutes *ProjectsLocationsTcpRoutesService
223
224 TlsRoutes *ProjectsLocationsTlsRoutesService
225
226 WasmPlugins *ProjectsLocationsWasmPluginsService
227 }
228
229 func NewProjectsLocationsAgentGatewaysService(s *Service) *ProjectsLocationsAgentGatewaysService {
230 rs := &ProjectsLocationsAgentGatewaysService{s: s}
231 return rs
232 }
233
234 type ProjectsLocationsAgentGatewaysService struct {
235 s *Service
236 }
237
238 func NewProjectsLocationsAuthzExtensionsService(s *Service) *ProjectsLocationsAuthzExtensionsService {
239 rs := &ProjectsLocationsAuthzExtensionsService{s: s}
240 return rs
241 }
242
243 type ProjectsLocationsAuthzExtensionsService struct {
244 s *Service
245 }
246
247 func NewProjectsLocationsEndpointPoliciesService(s *Service) *ProjectsLocationsEndpointPoliciesService {
248 rs := &ProjectsLocationsEndpointPoliciesService{s: s}
249 return rs
250 }
251
252 type ProjectsLocationsEndpointPoliciesService struct {
253 s *Service
254 }
255
256 func NewProjectsLocationsGatewaysService(s *Service) *ProjectsLocationsGatewaysService {
257 rs := &ProjectsLocationsGatewaysService{s: s}
258 rs.RouteViews = NewProjectsLocationsGatewaysRouteViewsService(s)
259 return rs
260 }
261
262 type ProjectsLocationsGatewaysService struct {
263 s *Service
264
265 RouteViews *ProjectsLocationsGatewaysRouteViewsService
266 }
267
268 func NewProjectsLocationsGatewaysRouteViewsService(s *Service) *ProjectsLocationsGatewaysRouteViewsService {
269 rs := &ProjectsLocationsGatewaysRouteViewsService{s: s}
270 return rs
271 }
272
273 type ProjectsLocationsGatewaysRouteViewsService struct {
274 s *Service
275 }
276
277 func NewProjectsLocationsGrpcRoutesService(s *Service) *ProjectsLocationsGrpcRoutesService {
278 rs := &ProjectsLocationsGrpcRoutesService{s: s}
279 return rs
280 }
281
282 type ProjectsLocationsGrpcRoutesService struct {
283 s *Service
284 }
285
286 func NewProjectsLocationsHttpRoutesService(s *Service) *ProjectsLocationsHttpRoutesService {
287 rs := &ProjectsLocationsHttpRoutesService{s: s}
288 return rs
289 }
290
291 type ProjectsLocationsHttpRoutesService struct {
292 s *Service
293 }
294
295 func NewProjectsLocationsLbEdgeExtensionsService(s *Service) *ProjectsLocationsLbEdgeExtensionsService {
296 rs := &ProjectsLocationsLbEdgeExtensionsService{s: s}
297 return rs
298 }
299
300 type ProjectsLocationsLbEdgeExtensionsService struct {
301 s *Service
302 }
303
304 func NewProjectsLocationsLbRouteExtensionsService(s *Service) *ProjectsLocationsLbRouteExtensionsService {
305 rs := &ProjectsLocationsLbRouteExtensionsService{s: s}
306 return rs
307 }
308
309 type ProjectsLocationsLbRouteExtensionsService struct {
310 s *Service
311 }
312
313 func NewProjectsLocationsLbTcpExtensionsService(s *Service) *ProjectsLocationsLbTcpExtensionsService {
314 rs := &ProjectsLocationsLbTcpExtensionsService{s: s}
315 return rs
316 }
317
318 type ProjectsLocationsLbTcpExtensionsService struct {
319 s *Service
320 }
321
322 func NewProjectsLocationsLbTrafficExtensionsService(s *Service) *ProjectsLocationsLbTrafficExtensionsService {
323 rs := &ProjectsLocationsLbTrafficExtensionsService{s: s}
324 return rs
325 }
326
327 type ProjectsLocationsLbTrafficExtensionsService struct {
328 s *Service
329 }
330
331 func NewProjectsLocationsMeshesService(s *Service) *ProjectsLocationsMeshesService {
332 rs := &ProjectsLocationsMeshesService{s: s}
333 rs.RouteViews = NewProjectsLocationsMeshesRouteViewsService(s)
334 return rs
335 }
336
337 type ProjectsLocationsMeshesService struct {
338 s *Service
339
340 RouteViews *ProjectsLocationsMeshesRouteViewsService
341 }
342
343 func NewProjectsLocationsMeshesRouteViewsService(s *Service) *ProjectsLocationsMeshesRouteViewsService {
344 rs := &ProjectsLocationsMeshesRouteViewsService{s: s}
345 return rs
346 }
347
348 type ProjectsLocationsMeshesRouteViewsService struct {
349 s *Service
350 }
351
352 func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
353 rs := &ProjectsLocationsOperationsService{s: s}
354 return rs
355 }
356
357 type ProjectsLocationsOperationsService struct {
358 s *Service
359 }
360
361 func NewProjectsLocationsServiceBindingsService(s *Service) *ProjectsLocationsServiceBindingsService {
362 rs := &ProjectsLocationsServiceBindingsService{s: s}
363 return rs
364 }
365
366 type ProjectsLocationsServiceBindingsService struct {
367 s *Service
368 }
369
370 func NewProjectsLocationsServiceLbPoliciesService(s *Service) *ProjectsLocationsServiceLbPoliciesService {
371 rs := &ProjectsLocationsServiceLbPoliciesService{s: s}
372 return rs
373 }
374
375 type ProjectsLocationsServiceLbPoliciesService struct {
376 s *Service
377 }
378
379 func NewProjectsLocationsTcpRoutesService(s *Service) *ProjectsLocationsTcpRoutesService {
380 rs := &ProjectsLocationsTcpRoutesService{s: s}
381 return rs
382 }
383
384 type ProjectsLocationsTcpRoutesService struct {
385 s *Service
386 }
387
388 func NewProjectsLocationsTlsRoutesService(s *Service) *ProjectsLocationsTlsRoutesService {
389 rs := &ProjectsLocationsTlsRoutesService{s: s}
390 return rs
391 }
392
393 type ProjectsLocationsTlsRoutesService struct {
394 s *Service
395 }
396
397 func NewProjectsLocationsWasmPluginsService(s *Service) *ProjectsLocationsWasmPluginsService {
398 rs := &ProjectsLocationsWasmPluginsService{s: s}
399 rs.Versions = NewProjectsLocationsWasmPluginsVersionsService(s)
400 return rs
401 }
402
403 type ProjectsLocationsWasmPluginsService struct {
404 s *Service
405
406 Versions *ProjectsLocationsWasmPluginsVersionsService
407 }
408
409 func NewProjectsLocationsWasmPluginsVersionsService(s *Service) *ProjectsLocationsWasmPluginsVersionsService {
410 rs := &ProjectsLocationsWasmPluginsVersionsService{s: s}
411 return rs
412 }
413
414 type ProjectsLocationsWasmPluginsVersionsService struct {
415 s *Service
416 }
417
418 // AgentGateway: AgentGateway represents the agent gateway resource.
419 type AgentGateway struct {
420 // AgentGatewayCard: Output only. Field for populated AgentGateway card.
421 AgentGatewayCard *AgentGatewayAgentGatewayOutputCard `json:"agentGatewayCard,omitempty"`
422 // CreateTime: Output only. The timestamp when the resource was created.
423 CreateTime string `json:"createTime,omitempty"`
424 // Description: Optional. A free-text description of the resource. Max length
425 // 1024 characters.
426 Description string `json:"description,omitempty"`
427 // Etag: Optional. Etag of the resource. If this is provided, it must match the
428 // server's etag. If the provided etag does not match the server's etag, the
429 // request will fail with a 409 ABORTED error.
430 Etag string `json:"etag,omitempty"`
431 // GoogleManaged: Optional. Proxy is orchestrated and managed by GoogleCloud in
432 // a tenant project.
433 GoogleManaged *AgentGatewayGoogleManaged `json:"googleManaged,omitempty"`
434 // Labels: Optional. Set of label tags associated with the AgentGateway
435 // resource.
436 Labels map[string]string `json:"labels,omitempty"`
437 // Name: Identifier. Name of the AgentGateway resource. It matches pattern
438 // `projects/*/locations/*/agentGateways/`.
439 Name string `json:"name,omitempty"`
440 // NetworkConfig: Optional. Network configuration for the AgentGateway.
441 NetworkConfig *AgentGatewayNetworkConfig `json:"networkConfig,omitempty"`
442 // Protocols: Required. List of protocols supported by an Agent Gateway
443 //
444 // Possible values:
445 // "PROTOCOL_UNSPECIFIED" - Unspecified protocol.
446 // "MCP" - Message Control Plane protocol.
447 Protocols []string `json:"protocols,omitempty"`
448 // Registries: Optional. A list of Agent registries containing the agents, MCP
449 // servers and tools governed by the Agent Gateway. Note: Currently limited to
450 // project-scoped registries Must be of format
451 // `//agentregistry.googleapis.com/projects/{project}/locations/{location}/
452 Registries []string `json:"registries,omitempty"`
453 // SelfManaged: Optional. Attach to existing Application Load Balancers or
454 // Secure Web Proxies.
455 SelfManaged *AgentGatewaySelfManaged `json:"selfManaged,omitempty"`
456 // UpdateTime: Output only. The timestamp when the resource was updated.
457 UpdateTime string `json:"updateTime,omitempty"`
458
459 // ServerResponse contains the HTTP response code and headers from the server.
460 googleapi.ServerResponse `json:"-"`
461 // ForceSendFields is a list of field names (e.g. "AgentGatewayCard") to
462 // unconditionally include in API requests. By default, fields with empty or
463 // default values are omitted from API requests. See
464 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
465 // details.
466 ForceSendFields []string `json:"-"`
467 // NullFields is a list of field names (e.g. "AgentGatewayCard") to include in
468 // API requests with the JSON null value. By default, fields with empty values
469 // are omitted from API requests. See
470 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
471 NullFields []string `json:"-"`
472 }
473
474 func (s AgentGateway) MarshalJSON() ([]byte, error) {
475 type NoMethod AgentGateway
476 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
477 }
478
479 // AgentGatewayAgentGatewayOutputCard: AgentGatewayOutputCard contains
480 // informational output-only fields
481 type AgentGatewayAgentGatewayOutputCard struct {
482 // MtlsEndpoint: Output only. mTLS Endpoint associated with this AgentGateway
483 MtlsEndpoint string `json:"mtlsEndpoint,omitempty"`
484 // RootCertificates: Output only. Root Certificates for Agents to validate this
485 // AgentGateway
486 RootCertificates []string `json:"rootCertificates,omitempty"`
487 // ServiceExtensionsServiceAccount: Output only. Service Account used by
488 // Service Extensions to operate.
489 ServiceExtensionsServiceAccount string `json:"serviceExtensionsServiceAccount,omitempty"`
490 // ForceSendFields is a list of field names (e.g. "MtlsEndpoint") to
491 // unconditionally include in API requests. By default, fields with empty or
492 // default values are omitted from API requests. See
493 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
494 // details.
495 ForceSendFields []string `json:"-"`
496 // NullFields is a list of field names (e.g. "MtlsEndpoint") to include in API
497 // requests with the JSON null value. By default, fields with empty values are
498 // omitted from API requests. See
499 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
500 NullFields []string `json:"-"`
501 }
502
503 func (s AgentGatewayAgentGatewayOutputCard) MarshalJSON() ([]byte, error) {
504 type NoMethod AgentGatewayAgentGatewayOutputCard
505 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
506 }
507
508 // AgentGatewayGoogleManaged: Configuration for Google Managed deployment mode.
509 // Proxy is orchestrated and managed by GoogleCloud in a tenant project.
510 type AgentGatewayGoogleManaged struct {
511 // GovernedAccessPath: Optional. Operating Mode of Agent Gateway.
512 //
513 // Possible values:
514 // "GOVERNED_ACCESS_PATH_UNSPECIFIED" - Governed access path is not
515 // specified.
516 // "AGENT_TO_ANYWHERE" - Govern agent conections to destinations.
517 // "CLIENT_TO_AGENT" - Protect connection to Agent or Tool.
518 GovernedAccessPath string `json:"governedAccessPath,omitempty"`
519 // ForceSendFields is a list of field names (e.g. "GovernedAccessPath") to
520 // unconditionally include in API requests. By default, fields with empty or
521 // default values are omitted from API requests. See
522 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
523 // details.
524 ForceSendFields []string `json:"-"`
525 // NullFields is a list of field names (e.g. "GovernedAccessPath") to include
526 // in API requests with the JSON null value. By default, fields with empty
527 // values are omitted from API requests. See
528 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
529 NullFields []string `json:"-"`
530 }
531
532 func (s AgentGatewayGoogleManaged) MarshalJSON() ([]byte, error) {
533 type NoMethod AgentGatewayGoogleManaged
534 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
535 }
536
537 // AgentGatewayNetworkConfig: NetworkConfig contains network configurations for
538 // the AgentGateway.
539 type AgentGatewayNetworkConfig struct {
540 // DnsPeeringConfig: Optional. Optional DNS peering configuration for
541 // connectivity to your private VPC network.
542 DnsPeeringConfig *AgentGatewayNetworkConfigDnsPeeringConfig `json:"dnsPeeringConfig,omitempty"`
543 // Egress: Optional. Optional PSC-Interface network attachment for connectivity
544 // to your private VPCs network.
545 Egress *AgentGatewayNetworkConfigEgress `json:"egress,omitempty"`
546 // ForceSendFields is a list of field names (e.g. "DnsPeeringConfig") to
547 // unconditionally include in API requests. By default, fields with empty or
548 // default values are omitted from API requests. See
549 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
550 // details.
551 ForceSendFields []string `json:"-"`
552 // NullFields is a list of field names (e.g. "DnsPeeringConfig") to include in
553 // API requests with the JSON null value. By default, fields with empty values
554 // are omitted from API requests. See
555 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
556 NullFields []string `json:"-"`
557 }
558
559 func (s AgentGatewayNetworkConfig) MarshalJSON() ([]byte, error) {
560 type NoMethod AgentGatewayNetworkConfig
561 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
562 }
563
564 // AgentGatewayNetworkConfigDnsPeeringConfig: DNS peering config for the user
565 // VPC network.
566 type AgentGatewayNetworkConfigDnsPeeringConfig struct {
567 // Domains: Required. Domain names for which DNS queries should be forwarded to
568 // the target network.
569 Domains []string `json:"domains,omitempty"`
570 // TargetNetwork: Required. Target network in 'target project' to which DNS
571 // queries should be forwarded to. Must be in format of
572 // `projects/{project}/global/networks/{network}`.
573 TargetNetwork string `json:"targetNetwork,omitempty"`
574 // TargetProject: Required. Target project ID to which DNS queries should be
575 // forwarded to. This can be the same project that contains the AgentGateway or
576 // a different project.
577 TargetProject string `json:"targetProject,omitempty"`
578 // ForceSendFields is a list of field names (e.g. "Domains") to unconditionally
579 // include in API requests. By default, fields with empty or default values are
580 // omitted from API requests. See
581 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
582 // details.
583 ForceSendFields []string `json:"-"`
584 // NullFields is a list of field names (e.g. "Domains") to include in API
585 // requests with the JSON null value. By default, fields with empty values are
586 // omitted from API requests. See
587 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
588 NullFields []string `json:"-"`
589 }
590
591 func (s AgentGatewayNetworkConfigDnsPeeringConfig) MarshalJSON() ([]byte, error) {
592 type NoMethod AgentGatewayNetworkConfigDnsPeeringConfig
593 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
594 }
595
596 // AgentGatewayNetworkConfigEgress: Configuration for Egress
597 type AgentGatewayNetworkConfigEgress struct {
598 // NetworkAttachment: Optional. The URI of the Network Attachment resource.
599 NetworkAttachment string `json:"networkAttachment,omitempty"`
600 // ForceSendFields is a list of field names (e.g. "NetworkAttachment") to
601 // unconditionally include in API requests. By default, fields with empty or
602 // default values are omitted from API requests. See
603 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
604 // details.
605 ForceSendFields []string `json:"-"`
606 // NullFields is a list of field names (e.g. "NetworkAttachment") to include in
607 // API requests with the JSON null value. By default, fields with empty values
608 // are omitted from API requests. See
609 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
610 NullFields []string `json:"-"`
611 }
612
613 func (s AgentGatewayNetworkConfigEgress) MarshalJSON() ([]byte, error) {
614 type NoMethod AgentGatewayNetworkConfigEgress
615 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
616 }
617
618 // AgentGatewaySelfManaged: Configuration for Self Managed deployment mode.
619 // Attach to existing Application Load Balancers or Secure Web Proxies.
620 type AgentGatewaySelfManaged struct {
621 // ResourceUri: Optional. A supported Google Cloud networking proxy in the
622 // Project and Location
623 ResourceUri string `json:"resourceUri,omitempty"`
624 // ForceSendFields is a list of field names (e.g. "ResourceUri") to
625 // unconditionally include in API requests. By default, fields with empty or
626 // default values are omitted from API requests. See
627 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
628 // details.
629 ForceSendFields []string `json:"-"`
630 // NullFields is a list of field names (e.g. "ResourceUri") to include in API
631 // requests with the JSON null value. By default, fields with empty values are
632 // omitted from API requests. See
633 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
634 NullFields []string `json:"-"`
635 }
636
637 func (s AgentGatewaySelfManaged) MarshalJSON() ([]byte, error) {
638 type NoMethod AgentGatewaySelfManaged
639 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
640 }
641
642 // AuthzExtension: `AuthzExtension` is a resource that allows traffic
643 // forwarding to a callout backend service to make an authorization decision.
644 type AuthzExtension struct {
645 // Authority: Optional. The `:authority` header in the gRPC request sent from
646 // Envoy to the extension service. It is required when the `service` field
647 // points to a backend service or a wasm plugin.
648 Authority string `json:"authority,omitempty"`
649 // CreateTime: Output only. The timestamp when the resource was created.
650 CreateTime string `json:"createTime,omitempty"`
651 // Description: Optional. A human-readable description of the resource.
652 Description string `json:"description,omitempty"`
653 // FailOpen: Optional. Determines how the proxy behaves if the call to the
654 // extension fails or times out. When set to `TRUE`, request or response
655 // processing continues without error. Any subsequent extensions in the
656 // extension chain are also executed. When set to `FALSE` or the default
657 // setting of `FALSE` is used, one of the following happens: * If response
658 // headers have not been delivered to the downstream client, a generic 500
659 // error is returned to the client. The error response can be tailored by
660 // configuring a custom error response in the load balancer. * If response
661 // headers have been delivered, then the HTTP stream to the downstream client
662 // is reset.
663 FailOpen bool `json:"failOpen,omitempty"`
664 // ForwardAttributes: Optional. List of the Envoy attributes to forward to the
665 // extension server. The attributes provided here are included as part of the
666 // `ProcessingRequest.attributes` field (of type `map`), where the keys are the
667 // attribute names. Refer to the documentation
668 // (https://cloud.google.com/service-extensions/docs/cel-matcher-language-reference#attributes)
669 // for the names of attributes that can be forwarded. If omitted, no attributes
670 // are sent. Each element is a string indicating the attribute name.
671 ForwardAttributes []string `json:"forwardAttributes,omitempty"`
672 // ForwardHeaders: Optional. List of the HTTP headers to forward to the
673 // extension (from the client). If omitted, all headers are sent. Each element
674 // is a string indicating the header name.
675 ForwardHeaders []string `json:"forwardHeaders,omitempty"`
676 // Labels: Optional. Set of labels associated with the `AuthzExtension`
677 // resource. The format must comply with the requirements for labels
678 // (/compute/docs/labeling-resources#requirements) for Google Cloud resources.
679 Labels map[string]string `json:"labels,omitempty"`
680 // LoadBalancingScheme: Optional. All backend services and forwarding rules
681 // referenced by this extension must share the same load balancing scheme.
682 // Supported values: `INTERNAL_MANAGED`, `EXTERNAL_MANAGED`. Can be omitted for
683 // AuthzExtensions that do not reference a backend service. For more
684 // information, refer to Backend services overview
685 // (https://cloud.google.com/load-balancing/docs/backend-service).
686 //
687 // Possible values:
688 // "LOAD_BALANCING_SCHEME_UNSPECIFIED" - Default value. Do not use.
689 // "INTERNAL_MANAGED" - Signifies that this is used for Internal HTTP(S) Load
690 // Balancing.
691 // "EXTERNAL_MANAGED" - Signifies that this is used for External Managed
692 // HTTP(S) Load Balancing.
693 LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"`
694 // Metadata: Optional. The metadata provided here is included as part of the
695 // `metadata_context` (of type `google.protobuf.Struct`) in the
696 // `ProcessingRequest` message sent to the extension server. The metadata is
697 // available under the namespace `com.google.authz_extension.`. The following
698 // variables are supported in the metadata Struct: `{forwarding_rule_id}` -
699 // substituted with the forwarding rule's fully qualified resource name.
700 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
701 // Name: Required. Identifier. Name of the `AuthzExtension` resource in the
702 // following format:
703 // `projects/{project}/locations/{location}/authzExtensions/{authz_extension}`.
704 Name string `json:"name,omitempty"`
705 // Service: Required. The reference to the service that runs the extension. To
706 // configure a callout extension, `service` must be a fully-qualified reference
707 // to a backend service
708 // (https://cloud.google.com/compute/docs/reference/rest/v1/backendServices) in
709 // the format:
710 // `https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/ba
711 // ckendServices/{backendService}` or
712 // `https://www.googleapis.com/compute/v1/projects/{project}/global/backendServi
713 // ces/{backendService}`.
714 Service string `json:"service,omitempty"`
715 // Timeout: Required. Specifies the timeout for each individual message on the
716 // stream. The timeout must be between 10-10000 milliseconds.
717 Timeout string `json:"timeout,omitempty"`
718 // UpdateTime: Output only. The timestamp when the resource was updated.
719 UpdateTime string `json:"updateTime,omitempty"`
720 // WireFormat: Optional. The format of communication supported by the callout
721 // extension. This field is supported only for regional `AuthzExtension`
722 // resources. If not specified, the default value `EXT_PROC_GRPC` is used.
723 // Global `AuthzExtension` resources use the `EXT_PROC_GRPC` wire format.
724 //
725 // Possible values:
726 // "WIRE_FORMAT_UNSPECIFIED" - Not specified.
727 // "EXT_PROC_GRPC" - The extension service uses ext_proc gRPC API over a gRPC
728 // stream. This is the default value if the wire format is not specified. The
729 // backend service for the extension must use HTTP2 or H2C as the protocol. All
730 // `supported_events` for a client request are sent as part of the same gRPC
731 // stream.
732 // "EXT_AUTHZ_GRPC" - The extension service uses Envoy's `ext_authz` gRPC
733 // API. The backend service for the extension must use HTTP2 or H2C as the
734 // protocol. `EXT_AUTHZ_GRPC` is only supported for regional `AuthzExtension`
735 // resources.
736 WireFormat string `json:"wireFormat,omitempty"`
737
738 // ServerResponse contains the HTTP response code and headers from the server.
739 googleapi.ServerResponse `json:"-"`
740 // ForceSendFields is a list of field names (e.g. "Authority") 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. "Authority") to include in API
747 // requests with the JSON null value. By default, fields with empty values are
748 // 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 AuthzExtension) MarshalJSON() ([]byte, error) {
754 type NoMethod AuthzExtension
755 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
756 }
757
758 // CancelOperationRequest: The request message for Operations.CancelOperation.
759 type CancelOperationRequest struct {
760 }
761
762 // Empty: A generic empty message that you can re-use to avoid defining
763 // duplicated empty messages in your APIs. A typical example is to use it as
764 // the request or the response type of an API method. For instance: service Foo
765 // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
766 type Empty struct {
767 // ServerResponse contains the HTTP response code and headers from the server.
768 googleapi.ServerResponse `json:"-"`
769 }
770
771 // EndpointMatcher: A definition of a matcher that selects endpoints to which
772 // the policies should be applied.
773 type EndpointMatcher struct {
774 // MetadataLabelMatcher: The matcher is based on node metadata presented by xDS
775 // clients.
776 MetadataLabelMatcher *MetadataLabelMatcher `json:"metadataLabelMatcher,omitempty"`
777 // ForceSendFields is a list of field names (e.g. "MetadataLabelMatcher") to
778 // unconditionally include in API requests. By default, fields with empty or
779 // default values are omitted from API requests. See
780 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
781 // details.
782 ForceSendFields []string `json:"-"`
783 // NullFields is a list of field names (e.g. "MetadataLabelMatcher") to include
784 // in API requests with the JSON null value. By default, fields with empty
785 // values are omitted from API requests. See
786 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
787 NullFields []string `json:"-"`
788 }
789
790 func (s EndpointMatcher) MarshalJSON() ([]byte, error) {
791 type NoMethod EndpointMatcher
792 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
793 }
794
795 // EndpointPolicy: EndpointPolicy is a resource that helps apply desired
796 // configuration on the endpoints that match specific criteria. For example,
797 // this resource can be used to apply "authentication config" an all endpoints
798 // that serve on port 8080.
799 type EndpointPolicy struct {
800 // AuthorizationPolicy: Optional. This field specifies the URL of
801 // AuthorizationPolicy resource that applies authorization policies to the
802 // inbound traffic at the matched endpoints. Refer to Authorization. If this
803 // field is not specified, authorization is disabled(no authz checks) for this
804 // endpoint.
805 AuthorizationPolicy string `json:"authorizationPolicy,omitempty"`
806 // ClientTlsPolicy: Optional. A URL referring to a ClientTlsPolicy resource.
807 // ClientTlsPolicy can be set to specify the authentication for traffic from
808 // the proxy to the actual endpoints. More specifically, it is applied to the
809 // outgoing traffic from the proxy to the endpoint. This is typically used for
810 // sidecar model where the proxy identifies itself as endpoint to the control
811 // plane, with the connection between sidecar and endpoint requiring
812 // authentication. If this field is not set, authentication is disabled(open).
813 // Applicable only when EndpointPolicyType is SIDECAR_PROXY.
814 ClientTlsPolicy string `json:"clientTlsPolicy,omitempty"`
815 // CreateTime: Output only. The timestamp when the resource was created.
816 CreateTime string `json:"createTime,omitempty"`
817 // Description: Optional. A free-text description of the resource. Max length
818 // 1024 characters.
819 Description string `json:"description,omitempty"`
820 // EndpointMatcher: Required. A matcher that selects endpoints to which the
821 // policies should be applied.
822 EndpointMatcher *EndpointMatcher `json:"endpointMatcher,omitempty"`
823 // Labels: Optional. Set of label tags associated with the EndpointPolicy
824 // resource.
825 Labels map[string]string `json:"labels,omitempty"`
826 // Name: Identifier. Name of the EndpointPolicy resource. It matches pattern
827 // `projects/{project}/locations/*/endpointPolicies/{endpoint_policy}`.
828 Name string `json:"name,omitempty"`
829 // SecurityPolicy: Optional. A URL referring to a SecurityPolicy resource.
830 // SecurityPolicy is used to enforce rate limiting policy on the inbound
831 // traffic at the identified backends. If this field is not set, rate limiting
832 // is disabled for this endpoint.
833 SecurityPolicy string `json:"securityPolicy,omitempty"`
834 // ServerTlsPolicy: Optional. A URL referring to ServerTlsPolicy resource.
835 // ServerTlsPolicy is used to determine the authentication policy to be applied
836 // to terminate the inbound traffic at the identified backends. If this field
837 // is not set, authentication is disabled(open) for this endpoint.
838 ServerTlsPolicy string `json:"serverTlsPolicy,omitempty"`
839 // TrafficPortSelector: Optional. Port selector for the (matched) endpoints. If
840 // no port selector is provided, the matched config is applied to all ports.
841 TrafficPortSelector *TrafficPortSelector `json:"trafficPortSelector,omitempty"`
842 // Type: Required. The type of endpoint policy. This is primarily used to
843 // validate the configuration.
844 //
845 // Possible values:
846 // "ENDPOINT_POLICY_TYPE_UNSPECIFIED" - Default value. Must not be used.
847 // "SIDECAR_PROXY" - Represents a proxy deployed as a sidecar.
848 // "GRPC_SERVER" - Represents a proxyless gRPC backend.
849 Type string `json:"type,omitempty"`
850 // UpdateTime: Output only. The timestamp when the resource was updated.
851 UpdateTime string `json:"updateTime,omitempty"`
852
853 // ServerResponse contains the HTTP response code and headers from the server.
854 googleapi.ServerResponse `json:"-"`
855 // ForceSendFields is a list of field names (e.g. "AuthorizationPolicy") to
856 // unconditionally include in API requests. By default, fields with empty or
857 // default values are omitted from API requests. See
858 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
859 // details.
860 ForceSendFields []string `json:"-"`
861 // NullFields is a list of field names (e.g. "AuthorizationPolicy") to include
862 // in API requests with the JSON null value. By default, fields with empty
863 // values are omitted from API requests. See
864 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
865 NullFields []string `json:"-"`
866 }
867
868 func (s EndpointPolicy) MarshalJSON() ([]byte, error) {
869 type NoMethod EndpointPolicy
870 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
871 }
872
873 // ExtensionChain: A single extension chain wrapper that contains the match
874 // conditions and extensions to execute.
875 type ExtensionChain struct {
876 // Extensions: Required. A set of extensions to execute for the matching
877 // request. At least one extension is required. Up to 3 extensions can be
878 // defined for each extension chain for `LbTrafficExtension` resource.
879 // `LbRouteExtension` and `LbEdgeExtension` chains are limited to 1 extension
880 // per extension chain.
881 Extensions []*ExtensionChainExtension `json:"extensions,omitempty"`
882 // MatchCondition: Required. Conditions under which this chain is invoked for a
883 // request.
884 MatchCondition *ExtensionChainMatchCondition `json:"matchCondition,omitempty"`
885 // Name: Required. The name for this extension chain. The name is logged as
886 // part of the HTTP request logs. The name must conform with RFC-1034, is
887 // restricted to lower-cased letters, numbers and hyphens, and can have a
888 // maximum length of 63 characters. Additionally, the first character must be a
889 // letter and the last a letter or a number.
890 Name string `json:"name,omitempty"`
891 // ForceSendFields is a list of field names (e.g. "Extensions") to
892 // unconditionally include in API requests. By default, fields with empty or
893 // default values are omitted from API requests. See
894 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
895 // details.
896 ForceSendFields []string `json:"-"`
897 // NullFields is a list of field names (e.g. "Extensions") to include in API
898 // requests with the JSON null value. By default, fields with empty values are
899 // omitted from API requests. See
900 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
901 NullFields []string `json:"-"`
902 }
903
904 func (s ExtensionChain) MarshalJSON() ([]byte, error) {
905 type NoMethod ExtensionChain
906 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
907 }
908
909 // ExtensionChainExtension: A single extension in the chain to execute for the
910 // matching request.
911 type ExtensionChainExtension struct {
912 // AllowDynamicForwarding: Optional. When set to `TRUE`, the response from an
913 // extension service is allowed to set the
914 // `com.google.envoy.dynamic_forwarding` namespace in the dynamic metadata.
915 // This field is not supported for plugin extensions or AuthzExtensions.
916 // Setting it results in a validation error.
917 AllowDynamicForwarding bool `json:"allowDynamicForwarding,omitempty"`
918 // Authority: Optional. The `:authority` header in the gRPC request sent from
919 // Envoy to the extension service. Required for Callout extensions. This field
920 // is not supported for plugin extensions. Setting it results in a validation
921 // error.
922 Authority string `json:"authority,omitempty"`
923 // FailOpen: Optional. Determines how the proxy behaves if the call to the
924 // extension fails or times out. When set to `TRUE`, request or response
925 // processing continues without error. Any subsequent extensions in the
926 // extension chain are also executed. When set to `FALSE` or the default
927 // setting of `FALSE` is used, one of the following happens: * If response
928 // headers have not been delivered to the downstream client, a generic 500
929 // error is returned to the client. The error response can be tailored by
930 // configuring a custom error response in the load balancer. * If response
931 // headers have been delivered, then the HTTP stream to the downstream client
932 // is reset.
933 FailOpen bool `json:"failOpen,omitempty"`
934 // ForwardAttributes: Optional. List of the Envoy attributes to forward to the
935 // extension server. The attributes provided here are included as part of the
936 // `ProcessingRequest.attributes` field (of type `map`), where the keys are the
937 // attribute names. Refer to the documentation
938 // (https://cloud.google.com/service-extensions/docs/cel-matcher-language-reference#attributes)
939 // for the names of attributes that can be forwarded. If omitted, no attributes
940 // are sent. Each element is a string indicating the attribute name.
941 ForwardAttributes []string `json:"forwardAttributes,omitempty"`
942 // ForwardHeaders: Optional. List of the HTTP headers to forward to the
943 // extension (from the client or backend). If omitted, all headers are sent.
944 // Each element is a string indicating the header name.
945 ForwardHeaders []string `json:"forwardHeaders,omitempty"`
946 // Metadata: Optional. The metadata provided here is included as part of the
947 // `metadata_context` (of type `google.protobuf.Struct`) in the
948 // `ProcessingRequest` message sent to the extension server. For
949 // `AuthzExtension` resources, the metadata is available under the namespace
950 // `com.google.authz_extension.`. For other types of extensions, the metadata
951 // is available under the namespace `com.google....`. For example:
952 // `com.google.lb_traffic_extension.lbtrafficextension1.chain1.ext1`. The
953 // following variables are supported in the metadata: `{forwarding_rule_id}` -
954 // substituted with the forwarding rule's fully qualified resource name. This
955 // field must not be set for plugin extensions. Setting it results in a
956 // validation error. You can set metadata at either the resource level or the
957 // extension level. The extension level metadata is recommended because you can
958 // pass a different set of metadata through each extension to the backend. This
959 // field is subject to following limitations: * The total size of the metadata
960 // must be less than 1KiB. * The total number of keys in the metadata must be
961 // less than 16. * The length of each key must be less than 64 characters. *
962 // The length of each value must be less than 1024 characters. * All values
963 // must be strings.
964 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
965 // Name: Optional. The name for this extension. The name is logged as part of
966 // the HTTP request logs. The name must conform with RFC-1034, is restricted to
967 // lower-cased letters, numbers and hyphens, and can have a maximum length of
968 // 63 characters. Additionally, the first character must be a letter and the
969 // last a letter or a number. This field is required except for AuthzExtension.
970 Name string `json:"name,omitempty"`
971 // ObservabilityMode: Optional. When set to `true`, the calls to the extension
972 // backend are performed asynchronously, without pausing the processing of the
973 // ongoing request. In this mode, only `STREAMED` (default) body processing is
974 // supported. Responses, if any, are ignored. Supported by regional
975 // `LbTrafficExtension` and `LbRouteExtension` resources.
976 ObservabilityMode bool `json:"observabilityMode,omitempty"`
977 // RequestBodySendMode: Optional. Configures the send mode for request body
978 // processing. The field can only be set if `supported_events` includes
979 // `REQUEST_BODY`. If `supported_events` includes `REQUEST_BODY`, but
980 // `request_body_send_mode` is unset, the default value `STREAMED` is used.
981 // When this field is set to `FULL_DUPLEX_STREAMED`, `supported_events` must
982 // include both `REQUEST_BODY` and `REQUEST_TRAILERS`. This field can be set
983 // only for `LbTrafficExtension` and `LbRouteExtension` resources, and only
984 // when the `service` field of the extension points to a `BackendService`. Only
985 // `FULL_DUPLEX_STREAMED` mode is supported for `LbRouteExtension` resources.
986 //
987 // Possible values:
988 // "BODY_SEND_MODE_UNSPECIFIED" - Default value. Do not use.
989 // "BODY_SEND_MODE_STREAMED" - Calls to the extension are executed in the
990 // streamed mode. Subsequent chunks will be sent only after the previous chunks
991 // have been processed. The content of the body chunks is sent one way to the
992 // extension. Extension may send modified chunks back. This is the default
993 // value if the processing mode is not specified.
994 // "BODY_SEND_MODE_FULL_DUPLEX_STREAMED" - Calls are executed in the full
995 // duplex mode. Subsequent chunks will be sent for processing without waiting
996 // for the response for the previous chunk or for the response for
997 // `REQUEST_HEADERS` event. Extension can freely modify or chunk the body
998 // contents. If the extension doesn't send the body contents back, the next
999 // extension in the chain or the upstream will receive an empty body.
1000 RequestBodySendMode string `json:"requestBodySendMode,omitempty"`
1001 // ResponseBodySendMode: Optional. Configures the send mode for response
1002 // processing. If unspecified, the default value `STREAMED` is used. The field
1003 // can only be set if `supported_events` includes `RESPONSE_BODY`. If
1004 // `supported_events` includes `RESPONSE_BODY`, but `response_body_send_mode`
1005 // is unset, the default value `STREAMED` is used. When this field is set to
1006 // `FULL_DUPLEX_STREAMED`, `supported_events` must include both `RESPONSE_BODY`
1007 // and `RESPONSE_TRAILERS`. This field can be set only for `LbTrafficExtension`
1008 // resources, and only when the `service` field of the extension points to a
1009 // `BackendService`.
1010 //
1011 // Possible values:
1012 // "BODY_SEND_MODE_UNSPECIFIED" - Default value. Do not use.
1013 // "BODY_SEND_MODE_STREAMED" - Calls to the extension are executed in the
1014 // streamed mode. Subsequent chunks will be sent only after the previous chunks
1015 // have been processed. The content of the body chunks is sent one way to the
1016 // extension. Extension may send modified chunks back. This is the default
1017 // value if the processing mode is not specified.
1018 // "BODY_SEND_MODE_FULL_DUPLEX_STREAMED" - Calls are executed in the full
1019 // duplex mode. Subsequent chunks will be sent for processing without waiting
1020 // for the response for the previous chunk or for the response for
1021 // `REQUEST_HEADERS` event. Extension can freely modify or chunk the body
1022 // contents. If the extension doesn't send the body contents back, the next
1023 // extension in the chain or the upstream will receive an empty body.
1024 ResponseBodySendMode string `json:"responseBodySendMode,omitempty"`
1025 // Service: Required. The reference to the service that runs the extension. To
1026 // configure a callout extension, `service` must be a fully-qualified reference
1027 // to a backend service
1028 // (https://cloud.google.com/compute/docs/reference/rest/v1/backendServices) in
1029 // the format:
1030 // `https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/ba
1031 // ckendServices/{backendService}` or
1032 // `https://www.googleapis.com/compute/v1/projects/{project}/global/backendServi
1033 // ces/{backendService}`. To configure a plugin extension, `service` must be a
1034 // reference to a `WasmPlugin` resource
1035 // (https://cloud.google.com/service-extensions/docs/reference/rest/v1beta1/projects.locations.wasmPlugins)
1036 // in the format:
1037 // `projects/{project}/locations/{location}/wasmPlugins/{plugin}` or
1038 // `//networkservices.googleapis.com/projects/{project}/locations/{location}/was
1039 // mPlugins/{wasmPlugin}`. Plugin extensions are currently supported for the
1040 // `LbTrafficExtension`, the `LbRouteExtension`, and the `LbEdgeExtension`
1041 // resources.
1042 Service string `json:"service,omitempty"`
1043 // SupportedEvents: Optional. A set of events during request or response
1044 // processing for which this extension is called. For the `LbTrafficExtension`
1045 // resource, this field is required. For the `LbRouteExtension` resource, this
1046 // field is optional. If unspecified, `REQUEST_HEADERS` event is assumed as
1047 // supported. For the `LbEdgeExtension` resource, this field is required and
1048 // must only contain `REQUEST_HEADERS` event. For the `AuthzExtension`
1049 // resource, this field is optional. `REQUEST_HEADERS` is the only supported
1050 // event. If unspecified, `REQUEST_HEADERS` event is assumed as supported.
1051 //
1052 // Possible values:
1053 // "EVENT_TYPE_UNSPECIFIED" - Unspecified value. Do not use.
1054 // "REQUEST_HEADERS" - If included in `supported_events`, the extension is
1055 // called when the HTTP request headers arrive.
1056 // "REQUEST_BODY" - If included in `supported_events`, the extension is
1057 // called when the HTTP request body arrives.
1058 // "RESPONSE_HEADERS" - If included in `supported_events`, the extension is
1059 // called when the HTTP response headers arrive.
1060 // "RESPONSE_BODY" - If included in `supported_events`, the extension is
1061 // called when the HTTP response body arrives.
1062 // "REQUEST_TRAILERS" - If included in `supported_events`, the extension is
1063 // called when the HTTP request trailers arrives.
1064 // "RESPONSE_TRAILERS" - If included in `supported_events`, the extension is
1065 // called when the HTTP response trailers arrives.
1066 SupportedEvents []string `json:"supportedEvents,omitempty"`
1067 // Timeout: Optional. Specifies the timeout for each individual message on the
1068 // stream. The timeout must be between `10`-`10000` milliseconds. Required for
1069 // callout extensions. This field is not supported for plugin extensions.
1070 // Setting it results in a validation error.
1071 Timeout string `json:"timeout,omitempty"`
1072 // ForceSendFields is a list of field names (e.g. "AllowDynamicForwarding") to
1073 // unconditionally include in API requests. By default, fields with empty or
1074 // default values are omitted from API requests. See
1075 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1076 // details.
1077 ForceSendFields []string `json:"-"`
1078 // NullFields is a list of field names (e.g. "AllowDynamicForwarding") to
1079 // include in API requests with the JSON null value. By default, fields with
1080 // empty values are omitted from API requests. See
1081 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1082 NullFields []string `json:"-"`
1083 }
1084
1085 func (s ExtensionChainExtension) MarshalJSON() ([]byte, error) {
1086 type NoMethod ExtensionChainExtension
1087 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1088 }
1089
1090 // ExtensionChainMatchCondition: Conditions under which this chain is invoked
1091 // for a request.
1092 type ExtensionChainMatchCondition struct {
1093 // CelExpression: Required. A Common Expression Language (CEL) expression that
1094 // is used to match requests for which the extension chain is executed. For
1095 // more information, see CEL matcher language reference
1096 // (https://cloud.google.com/service-extensions/docs/cel-matcher-language-reference).
1097 CelExpression string `json:"celExpression,omitempty"`
1098 // ForceSendFields is a list of field names (e.g. "CelExpression") to
1099 // unconditionally include in API requests. By default, fields with empty or
1100 // default values are omitted from API requests. See
1101 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1102 // details.
1103 ForceSendFields []string `json:"-"`
1104 // NullFields is a list of field names (e.g. "CelExpression") to include in API
1105 // requests with the JSON null value. By default, fields with empty values are
1106 // omitted from API requests. See
1107 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1108 NullFields []string `json:"-"`
1109 }
1110
1111 func (s ExtensionChainMatchCondition) MarshalJSON() ([]byte, error) {
1112 type NoMethod ExtensionChainMatchCondition
1113 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1114 }
1115
1116 // Gateway: Gateway represents the configuration for a proxy, typically a load
1117 // balancer. It captures the ip:port over which the services are exposed by the
1118 // proxy, along with any policy configurations. Routes have reference to to
1119 // Gateways to dictate how requests should be routed by this Gateway.
1120 type Gateway struct {
1121 // Addresses: Optional. Zero or one IPv4 or IPv6 address on which the Gateway
1122 // will receive the traffic. When no address is provided, an IP from the
1123 // subnetwork is allocated This field only applies to gateways of type
1124 // 'SECURE_WEB_GATEWAY'. Gateways of type 'OPEN_MESH' listen on 0.0.0.0 for
1125 // IPv4 and :: for IPv6.
1126 Addresses []string `json:"addresses,omitempty"`
1127 // AllPorts: Optional. If true, the Gateway will listen on all ports. This is
1128 // mutually exclusive with the `ports` field. This field only applies to
1129 // gateways of type 'SECURE_WEB_GATEWAY'.
1130 AllPorts bool `json:"allPorts,omitempty"`
1131 // AllowGlobalAccess: Optional. If true, the gateway will allow traffic from
1132 // clients outside of the region where the gateway is located. This field is
1133 // configurable only for gateways of type SECURE_WEB_GATEWAY.
1134 AllowGlobalAccess bool `json:"allowGlobalAccess,omitempty"`
1135 // CertificateUrls: Optional. A fully-qualified Certificates URL reference. The
1136 // proxy presents a Certificate (selected based on SNI) when establishing a TLS
1137 // connection. This feature only applies to gateways of type
1138 // 'SECURE_WEB_GATEWAY'.
1139 CertificateUrls []string `json:"certificateUrls,omitempty"`
1140 // CreateTime: Output only. The timestamp when the resource was created.
1141 CreateTime string `json:"createTime,omitempty"`
1142 // Description: Optional. A free-text description of the resource. Max length
1143 // 1024 characters.
1144 Description string `json:"description,omitempty"`
1145 // EnvoyHeaders: Optional. Determines if envoy will insert internal debug
1146 // headers into upstream requests. Other Envoy headers may still be injected.
1147 // By default, envoy will not insert any debug headers.
1148 //
1149 // Possible values:
1150 // "ENVOY_HEADERS_UNSPECIFIED" - Defaults to NONE.
1151 // "NONE" - Suppress envoy debug headers.
1152 // "DEBUG_HEADERS" - Envoy will insert default internal debug headers into
1153 // upstream requests: x-envoy-attempt-count, x-envoy-is-timeout-retry,
1154 // x-envoy-expected-rq-timeout-ms, x-envoy-original-path,
1155 // x-envoy-upstream-stream-duration-ms
1156 EnvoyHeaders string `json:"envoyHeaders,omitempty"`
1157 // GatewaySecurityPolicy: Optional. A fully-qualified GatewaySecurityPolicy URL
1158 // reference. Defines how a server should apply security policy to inbound (VM
1159 // to Proxy) initiated connections. For example:
1160 // `projects/*/locations/*/gatewaySecurityPolicies/swg-policy`. This policy is
1161 // specific to gateways of type 'SECURE_WEB_GATEWAY'.
1162 GatewaySecurityPolicy string `json:"gatewaySecurityPolicy,omitempty"`
1163 // IpVersion: Optional. The IP Version that will be used by this gateway. Valid
1164 // options are IPV4 or IPV6. Default is IPV4.
1165 //
1166 // Possible values:
1167 // "IP_VERSION_UNSPECIFIED" - The type when IP version is not specified.
1168 // Defaults to IPV4.
1169 // "IPV4" - The type for IP version 4.
1170 // "IPV6" - The type for IP version 6.
1171 IpVersion string `json:"ipVersion,omitempty"`
1172 // Labels: Optional. Set of label tags associated with the Gateway resource.
1173 Labels map[string]string `json:"labels,omitempty"`
1174 // Name: Identifier. Name of the Gateway resource. It matches pattern
1175 // `projects/*/locations/*/gateways/`.
1176 Name string `json:"name,omitempty"`
1177 // Network: Optional. The relative resource name identifying the VPC network
1178 // that is using this configuration. For example:
1179 // `projects/*/global/networks/network-1`. Currently, this field is specific to
1180 // gateways of type 'SECURE_WEB_GATEWAY'.
1181 Network string `json:"network,omitempty"`
1182 // Ports: Required. One or more port numbers (1-65535), on which the Gateway
1183 // will receive traffic. The proxy binds to the specified ports. Gateways of
1184 // type 'SECURE_WEB_GATEWAY' are limited to 5 ports. Gateways of type
1185 // 'OPEN_MESH' listen on 0.0.0.0 for IPv4 and :: for IPv6 and support multiple
1186 // ports.
1187 Ports []int64 `json:"ports,omitempty"`
1188 // RoutingMode: Optional. The routing mode of the Gateway. This field is
1189 // configurable only for gateways of type SECURE_WEB_GATEWAY. This field is
1190 // required for gateways of type SECURE_WEB_GATEWAY.
1191 //
1192 // Possible values:
1193 // "EXPLICIT_ROUTING_MODE" - The routing mode is explicit; clients are
1194 // configured to send traffic through the gateway. This is the default routing
1195 // mode.
1196 // "NEXT_HOP_ROUTING_MODE" - The routing mode is next-hop. Clients are
1197 // unaware of the gateway, and a route (advanced route or other route type) can
1198 // be configured to direct traffic from client to gateway. The gateway then
1199 // acts as a next-hop to the destination.
1200 RoutingMode string `json:"routingMode,omitempty"`
1201 // Scope: Optional. Scope determines how configuration across multiple Gateway
1202 // instances are merged. The configuration for multiple Gateway instances with
1203 // the same scope will be merged as presented as a single configuration to the
1204 // proxy/load balancer. Max length 64 characters. Scope should start with a
1205 // letter and can only have letters, numbers, hyphens.
1206 Scope string `json:"scope,omitempty"`
1207 // SelfLink: Output only. Server-defined URL of this resource
1208 SelfLink string `json:"selfLink,omitempty"`
1209 // ServerTlsPolicy: Optional. A fully-qualified ServerTLSPolicy URL reference.
1210 // Specifies how TLS traffic is terminated. If empty, TLS termination is
1211 // disabled.
1212 ServerTlsPolicy string `json:"serverTlsPolicy,omitempty"`
1213 // Subnetwork: Optional. The relative resource name identifying the subnetwork
1214 // in which this SWG is allocated. For example:
1215 // `projects/*/regions/us-central1/subnetworks/network-1` Currently, this field
1216 // is specific to gateways of type 'SECURE_WEB_GATEWAY".
1217 Subnetwork string `json:"subnetwork,omitempty"`
1218 // Type: Immutable. The type of the customer managed gateway. This field is
1219 // required. If unspecified, an error is returned.
1220 //
1221 // Possible values:
1222 // "TYPE_UNSPECIFIED" - The type of the customer managed gateway is
1223 // unspecified.
1224 // "OPEN_MESH" - The type of the customer managed gateway is TrafficDirector
1225 // Open Mesh.
1226 // "SECURE_WEB_GATEWAY" - The type of the customer managed gateway is
1227 // SecureWebGateway (SWG).
1228 Type string `json:"type,omitempty"`
1229 // UpdateTime: Output only. The timestamp when the resource was updated.
1230 UpdateTime string `json:"updateTime,omitempty"`
1231
1232 // ServerResponse contains the HTTP response code and headers from the server.
1233 googleapi.ServerResponse `json:"-"`
1234 // ForceSendFields is a list of field names (e.g. "Addresses") to
1235 // unconditionally include in API requests. By default, fields with empty or
1236 // default values are omitted from API requests. See
1237 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1238 // details.
1239 ForceSendFields []string `json:"-"`
1240 // NullFields is a list of field names (e.g. "Addresses") to include in API
1241 // requests with the JSON null value. By default, fields with empty values are
1242 // omitted from API requests. See
1243 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1244 NullFields []string `json:"-"`
1245 }
1246
1247 func (s Gateway) MarshalJSON() ([]byte, error) {
1248 type NoMethod Gateway
1249 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1250 }
1251
1252 // GatewayRouteView: GatewayRouteView defines view-only resource for Routes to
1253 // a Gateway
1254 type GatewayRouteView struct {
1255 // Name: Output only. Identifier. Full path name of the GatewayRouteView
1256 // resource. Format:
1257 // projects/{project_number}/locations/{location}/gateways/{gateway}/routeViews/
1258 // {route_view}
1259 Name string `json:"name,omitempty"`
1260 // RouteId: Output only. The resource id for the route.
1261 RouteId string `json:"routeId,omitempty"`
1262 // RouteLocation: Output only. Location where the route exists.
1263 RouteLocation string `json:"routeLocation,omitempty"`
1264 // RouteProjectNumber: Output only. Project number where the route exists.
1265 RouteProjectNumber int64 `json:"routeProjectNumber,omitempty,string"`
1266 // RouteType: Output only. Type of the route: HttpRoute,GrpcRoute,TcpRoute, or
1267 // TlsRoute
1268 RouteType string `json:"routeType,omitempty"`
1269
1270 // ServerResponse contains the HTTP response code and headers from the server.
1271 googleapi.ServerResponse `json:"-"`
1272 // ForceSendFields is a list of field names (e.g. "Name") to unconditionally
1273 // include in API requests. By default, fields with empty or default values are
1274 // omitted from API requests. See
1275 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1276 // details.
1277 ForceSendFields []string `json:"-"`
1278 // NullFields is a list of field names (e.g. "Name") to include in API requests
1279 // with the JSON null value. By default, fields with empty values are omitted
1280 // from API requests. See
1281 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1282 NullFields []string `json:"-"`
1283 }
1284
1285 func (s GatewayRouteView) MarshalJSON() ([]byte, error) {
1286 type NoMethod GatewayRouteView
1287 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1288 }
1289
1290 // GrpcRoute: GrpcRoute is the resource defining how gRPC traffic routed by a
1291 // Mesh or Gateway resource is routed.
1292 type GrpcRoute struct {
1293 // CreateTime: Output only. The timestamp when the resource was created.
1294 CreateTime string `json:"createTime,omitempty"`
1295 // Description: Optional. A free-text description of the resource. Max length
1296 // 1024 characters.
1297 Description string `json:"description,omitempty"`
1298 // Gateways: Optional. Gateways defines a list of gateways this GrpcRoute is
1299 // attached to, as one of the routing rules to route the requests served by the
1300 // gateway. Each gateway reference should match the pattern:
1301 // `projects/*/locations/*/gateways/`
1302 Gateways []string `json:"gateways,omitempty"`
1303 // Hostnames: Required. Service hostnames with an optional port for which this
1304 // route describes traffic. Format: [:] Hostname is the fully qualified domain
1305 // name of a network host. This matches the RFC 1123 definition of a hostname
1306 // with 2 notable exceptions: - IPs are not allowed. - A hostname may be
1307 // prefixed with a wildcard label (`*.`). The wildcard label must appear by
1308 // itself as the first label. Hostname can be "precise" which is a domain name
1309 // without the terminating dot of a network host (e.g. `foo.example.com`) or
1310 // "wildcard", which is a domain name prefixed with a single wildcard label
1311 // (e.g. `*.example.com`). Note that as per RFC1035 and RFC1123, a label must
1312 // consist of lower case alphanumeric characters or '-', and must start and end
1313 // with an alphanumeric character. No other punctuation is allowed. The routes
1314 // associated with a Mesh or Gateway must have unique hostnames. If you attempt
1315 // to attach multiple routes with conflicting hostnames, the configuration will
1316 // be rejected. For example, while it is acceptable for routes for the
1317 // hostnames `*.foo.bar.com` and `*.bar.com` to be associated with the same
1318 // route, it is not possible to associate two routes both with `*.bar.com` or
1319 // both with `bar.com`. If a port is specified, then gRPC clients must use the
1320 // channel URI with the port to match this rule (i.e. "xds:///service:123"),
1321 // otherwise they must supply the URI without a port (i.e. "xds:///service").
1322 Hostnames []string `json:"hostnames,omitempty"`
1323 // Labels: Optional. Set of label tags associated with the GrpcRoute resource.
1324 Labels map[string]string `json:"labels,omitempty"`
1325 // Meshes: Optional. Meshes defines a list of meshes this GrpcRoute is attached
1326 // to, as one of the routing rules to route the requests served by the mesh.
1327 // Each mesh reference should match the pattern:
1328 // `projects/*/locations/*/meshes/`
1329 Meshes []string `json:"meshes,omitempty"`
1330 // Name: Identifier. Name of the GrpcRoute resource. It matches pattern
1331 // `projects/*/locations/*/grpcRoutes/`
1332 Name string `json:"name,omitempty"`
1333 // Rules: Required. A list of detailed rules defining how to route traffic.
1334 // Within a single GrpcRoute, the GrpcRoute.RouteAction associated with the
1335 // first matching GrpcRoute.RouteRule will be executed. At least one rule must
1336 // be supplied.
1337 Rules []*GrpcRouteRouteRule `json:"rules,omitempty"`
1338 // SelfLink: Output only. Server-defined URL of this resource
1339 SelfLink string `json:"selfLink,omitempty"`
1340 // UpdateTime: Output only. The timestamp when the resource was updated.
1341 UpdateTime string `json:"updateTime,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. "CreateTime") to
1346 // unconditionally include in API requests. By default, fields with empty or
1347 // default values are 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. "CreateTime") to include in API
1352 // requests with the JSON null value. By default, fields with empty values are
1353 // omitted 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 GrpcRoute) MarshalJSON() ([]byte, error) {
1359 type NoMethod GrpcRoute
1360 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1361 }
1362
1363 // GrpcRouteDestination: The destination to which traffic will be routed.
1364 type GrpcRouteDestination struct {
1365 // ServiceName: Required. The URL of a destination service to which to route
1366 // traffic. Must refer to either a BackendService or ServiceDirectoryService.
1367 ServiceName string `json:"serviceName,omitempty"`
1368 // Weight: Optional. Specifies the proportion of requests forwarded to the
1369 // backend referenced by the serviceName field. This is computed as: -
1370 // weight/Sum(weights in this destination list). For non-zero values, there may
1371 // be some epsilon from the exact proportion defined here depending on the
1372 // precision an implementation supports. If only one serviceName is specified
1373 // and it has a weight greater than 0, 100% of the traffic is forwarded to that
1374 // backend. If weights are specified for any one service name, they need to be
1375 // specified for all of them. If weights are unspecified for all services,
1376 // then, traffic is distributed in equal proportions to all of them.
1377 Weight int64 `json:"weight,omitempty"`
1378 // ForceSendFields is a list of field names (e.g. "ServiceName") to
1379 // unconditionally include in API requests. By default, fields with empty or
1380 // default values are omitted from API requests. See
1381 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1382 // details.
1383 ForceSendFields []string `json:"-"`
1384 // NullFields is a list of field names (e.g. "ServiceName") to include in API
1385 // requests with the JSON null value. By default, fields with empty values are
1386 // omitted from API requests. See
1387 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1388 NullFields []string `json:"-"`
1389 }
1390
1391 func (s GrpcRouteDestination) MarshalJSON() ([]byte, error) {
1392 type NoMethod GrpcRouteDestination
1393 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1394 }
1395
1396 // GrpcRouteFaultInjectionPolicy: The specification for fault injection
1397 // introduced into traffic to test the resiliency of clients to destination
1398 // service failure. As part of fault injection, when clients send requests to a
1399 // destination, delays can be introduced on a percentage of requests before
1400 // sending those requests to the destination service. Similarly requests from
1401 // clients can be aborted by for a percentage of requests.
1402 type GrpcRouteFaultInjectionPolicy struct {
1403 // Abort: The specification for aborting to client requests.
1404 Abort *GrpcRouteFaultInjectionPolicyAbort `json:"abort,omitempty"`
1405 // Delay: The specification for injecting delay to client requests.
1406 Delay *GrpcRouteFaultInjectionPolicyDelay `json:"delay,omitempty"`
1407 // ForceSendFields is a list of field names (e.g. "Abort") to unconditionally
1408 // include in API requests. By default, fields with empty or default values are
1409 // omitted from API requests. See
1410 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1411 // details.
1412 ForceSendFields []string `json:"-"`
1413 // NullFields is a list of field names (e.g. "Abort") to include in API
1414 // requests with the JSON null value. By default, fields with empty values are
1415 // omitted from API requests. See
1416 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1417 NullFields []string `json:"-"`
1418 }
1419
1420 func (s GrpcRouteFaultInjectionPolicy) MarshalJSON() ([]byte, error) {
1421 type NoMethod GrpcRouteFaultInjectionPolicy
1422 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1423 }
1424
1425 // GrpcRouteFaultInjectionPolicyAbort: Specification of how client requests are
1426 // aborted as part of fault injection before being sent to a destination.
1427 type GrpcRouteFaultInjectionPolicyAbort struct {
1428 // HttpStatus: The HTTP status code used to abort the request. The value must
1429 // be between 200 and 599 inclusive.
1430 HttpStatus int64 `json:"httpStatus,omitempty"`
1431 // Percentage: The percentage of traffic which will be aborted. The value must
1432 // be between [0, 100]
1433 Percentage int64 `json:"percentage,omitempty"`
1434 // ForceSendFields is a list of field names (e.g. "HttpStatus") to
1435 // unconditionally include in API requests. By default, fields with empty or
1436 // default values are omitted from API requests. See
1437 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1438 // details.
1439 ForceSendFields []string `json:"-"`
1440 // NullFields is a list of field names (e.g. "HttpStatus") to include in API
1441 // requests with the JSON null value. By default, fields with empty values are
1442 // omitted from API requests. See
1443 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1444 NullFields []string `json:"-"`
1445 }
1446
1447 func (s GrpcRouteFaultInjectionPolicyAbort) MarshalJSON() ([]byte, error) {
1448 type NoMethod GrpcRouteFaultInjectionPolicyAbort
1449 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1450 }
1451
1452 // GrpcRouteFaultInjectionPolicyDelay: Specification of how client requests are
1453 // delayed as part of fault injection before being sent to a destination.
1454 type GrpcRouteFaultInjectionPolicyDelay struct {
1455 // FixedDelay: Specify a fixed delay before forwarding the request.
1456 FixedDelay string `json:"fixedDelay,omitempty"`
1457 // Percentage: The percentage of traffic on which delay will be injected. The
1458 // value must be between [0, 100]
1459 Percentage int64 `json:"percentage,omitempty"`
1460 // ForceSendFields is a list of field names (e.g. "FixedDelay") to
1461 // unconditionally include in API requests. By default, fields with empty or
1462 // default values are omitted from API requests. See
1463 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1464 // details.
1465 ForceSendFields []string `json:"-"`
1466 // NullFields is a list of field names (e.g. "FixedDelay") to include in API
1467 // requests with the JSON null value. By default, fields with empty values are
1468 // omitted from API requests. See
1469 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1470 NullFields []string `json:"-"`
1471 }
1472
1473 func (s GrpcRouteFaultInjectionPolicyDelay) MarshalJSON() ([]byte, error) {
1474 type NoMethod GrpcRouteFaultInjectionPolicyDelay
1475 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1476 }
1477
1478 // GrpcRouteHeaderMatch: A match against a collection of headers.
1479 type GrpcRouteHeaderMatch struct {
1480 // Key: Required. The key of the header.
1481 Key string `json:"key,omitempty"`
1482 // Type: Optional. Specifies how to match against the value of the header. If
1483 // not specified, a default value of EXACT is used.
1484 //
1485 // Possible values:
1486 // "TYPE_UNSPECIFIED" - Unspecified.
1487 // "EXACT" - Will only match the exact value provided.
1488 // "REGULAR_EXPRESSION" - Will match paths conforming to the prefix specified
1489 // by value. RE2 syntax is supported.
1490 Type string `json:"type,omitempty"`
1491 // Value: Required. The value of the header.
1492 Value string `json:"value,omitempty"`
1493 // ForceSendFields is a list of field names (e.g. "Key") to unconditionally
1494 // include in API requests. By default, fields with empty or default values are
1495 // omitted from API requests. See
1496 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1497 // details.
1498 ForceSendFields []string `json:"-"`
1499 // NullFields is a list of field names (e.g. "Key") to include in API requests
1500 // with the JSON null value. By default, fields with empty values are omitted
1501 // from API requests. See
1502 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1503 NullFields []string `json:"-"`
1504 }
1505
1506 func (s GrpcRouteHeaderMatch) MarshalJSON() ([]byte, error) {
1507 type NoMethod GrpcRouteHeaderMatch
1508 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1509 }
1510
1511 // GrpcRouteMethodMatch: Specifies a match against a method.
1512 type GrpcRouteMethodMatch struct {
1513 // CaseSensitive: Optional. Specifies that matches are case sensitive. The
1514 // default value is true. case_sensitive must not be used with a type of
1515 // REGULAR_EXPRESSION.
1516 CaseSensitive bool `json:"caseSensitive,omitempty"`
1517 // GrpcMethod: Required. Name of the method to match against. If unspecified,
1518 // will match all methods.
1519 GrpcMethod string `json:"grpcMethod,omitempty"`
1520 // GrpcService: Required. Name of the service to match against. If unspecified,
1521 // will match all services.
1522 GrpcService string `json:"grpcService,omitempty"`
1523 // Type: Optional. Specifies how to match against the name. If not specified, a
1524 // default value of "EXACT" is used.
1525 //
1526 // Possible values:
1527 // "TYPE_UNSPECIFIED" - Unspecified.
1528 // "EXACT" - Will only match the exact name provided.
1529 // "REGULAR_EXPRESSION" - Will interpret grpc_method and grpc_service as
1530 // regexes. RE2 syntax is supported.
1531 Type string `json:"type,omitempty"`
1532 // ForceSendFields is a list of field names (e.g. "CaseSensitive") to
1533 // unconditionally include in API requests. By default, fields with empty or
1534 // default values are omitted from API requests. See
1535 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1536 // details.
1537 ForceSendFields []string `json:"-"`
1538 // NullFields is a list of field names (e.g. "CaseSensitive") to include in API
1539 // requests with the JSON null value. By default, fields with empty values are
1540 // omitted from API requests. See
1541 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1542 NullFields []string `json:"-"`
1543 }
1544
1545 func (s GrpcRouteMethodMatch) MarshalJSON() ([]byte, error) {
1546 type NoMethod GrpcRouteMethodMatch
1547 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1548 }
1549
1550 // GrpcRouteRetryPolicy: The specifications for retries. Specifies one or more
1551 // conditions for which this retry rule applies. Valid values are:
1552 type GrpcRouteRetryPolicy struct {
1553 // NumRetries: Specifies the allowed number of retries. This number must be >
1554 // 0. If not specified, default to 1.
1555 NumRetries int64 `json:"numRetries,omitempty"`
1556 // RetryConditions: - connect-failure: Router will retry on failures connecting
1557 // to Backend Services, for example due to connection timeouts. -
1558 // refused-stream: Router will retry if the backend service resets the stream
1559 // with a REFUSED_STREAM error code. This reset type indicates that it is safe
1560 // to retry. - cancelled: Router will retry if the gRPC status code in the
1561 // response header is set to cancelled - deadline-exceeded: Router will retry
1562 // if the gRPC status code in the response header is set to deadline-exceeded -
1563 // resource-exhausted: Router will retry if the gRPC status code in the
1564 // response header is set to resource-exhausted - unavailable: Router will
1565 // retry if the gRPC status code in the response header is set to unavailable
1566 RetryConditions []string `json:"retryConditions,omitempty"`
1567 // ForceSendFields is a list of field names (e.g. "NumRetries") to
1568 // unconditionally include in API requests. By default, fields with empty or
1569 // default values are omitted from API requests. See
1570 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1571 // details.
1572 ForceSendFields []string `json:"-"`
1573 // NullFields is a list of field names (e.g. "NumRetries") to include in API
1574 // requests with the JSON null value. By default, fields with empty values are
1575 // omitted from API requests. See
1576 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1577 NullFields []string `json:"-"`
1578 }
1579
1580 func (s GrpcRouteRetryPolicy) MarshalJSON() ([]byte, error) {
1581 type NoMethod GrpcRouteRetryPolicy
1582 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1583 }
1584
1585 // GrpcRouteRouteAction: Specifies how to route matched traffic.
1586 type GrpcRouteRouteAction struct {
1587 // Destinations: Optional. The destination services to which traffic should be
1588 // forwarded. If multiple destinations are specified, traffic will be split
1589 // between Backend Service(s) according to the weight field of these
1590 // destinations.
1591 Destinations []*GrpcRouteDestination `json:"destinations,omitempty"`
1592 // FaultInjectionPolicy: Optional. The specification for fault injection
1593 // introduced into traffic to test the resiliency of clients to destination
1594 // service failure. As part of fault injection, when clients send requests to a
1595 // destination, delays can be introduced on a percentage of requests before
1596 // sending those requests to the destination service. Similarly requests from
1597 // clients can be aborted by for a percentage of requests. timeout and
1598 // retry_policy will be ignored by clients that are configured with a
1599 // fault_injection_policy
1600 FaultInjectionPolicy *GrpcRouteFaultInjectionPolicy `json:"faultInjectionPolicy,omitempty"`
1601 // IdleTimeout: Optional. Specifies the idle timeout for the selected route.
1602 // The idle timeout is defined as the period in which there are no bytes sent
1603 // or received on either the upstream or downstream connection. If not set, the
1604 // default idle timeout is 1 hour. If set to 0s, the timeout will be disabled.
1605 IdleTimeout string `json:"idleTimeout,omitempty"`
1606 // RetryPolicy: Optional. Specifies the retry policy associated with this
1607 // route.
1608 RetryPolicy *GrpcRouteRetryPolicy `json:"retryPolicy,omitempty"`
1609 // StatefulSessionAffinity: Optional. Specifies cookie-based stateful session
1610 // affinity.
1611 StatefulSessionAffinity *GrpcRouteStatefulSessionAffinityPolicy `json:"statefulSessionAffinity,omitempty"`
1612 // Timeout: Optional. Specifies the timeout for selected route. Timeout is
1613 // computed from the time the request has been fully processed (i.e. end of
1614 // stream) up until the response has been completely processed. Timeout
1615 // includes all retries.
1616 Timeout string `json:"timeout,omitempty"`
1617 // ForceSendFields is a list of field names (e.g. "Destinations") to
1618 // unconditionally include in API requests. By default, fields with empty or
1619 // default values are omitted from API requests. See
1620 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1621 // details.
1622 ForceSendFields []string `json:"-"`
1623 // NullFields is a list of field names (e.g. "Destinations") to include in API
1624 // requests with the JSON null value. By default, fields with empty values are
1625 // omitted from API requests. See
1626 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1627 NullFields []string `json:"-"`
1628 }
1629
1630 func (s GrpcRouteRouteAction) MarshalJSON() ([]byte, error) {
1631 type NoMethod GrpcRouteRouteAction
1632 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1633 }
1634
1635 // GrpcRouteRouteMatch: Criteria for matching traffic. A RouteMatch will be
1636 // considered to match when all supplied fields match.
1637 type GrpcRouteRouteMatch struct {
1638 // Headers: Optional. Specifies a collection of headers to match.
1639 Headers []*GrpcRouteHeaderMatch `json:"headers,omitempty"`
1640 // Method: Optional. A gRPC method to match against. If this field is empty or
1641 // omitted, will match all methods.
1642 Method *GrpcRouteMethodMatch `json:"method,omitempty"`
1643 // ForceSendFields is a list of field names (e.g. "Headers") to unconditionally
1644 // include in API requests. By default, fields with empty or default values are
1645 // omitted from API requests. See
1646 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1647 // details.
1648 ForceSendFields []string `json:"-"`
1649 // NullFields is a list of field names (e.g. "Headers") to include in API
1650 // requests with the JSON null value. By default, fields with empty values are
1651 // omitted from API requests. See
1652 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1653 NullFields []string `json:"-"`
1654 }
1655
1656 func (s GrpcRouteRouteMatch) MarshalJSON() ([]byte, error) {
1657 type NoMethod GrpcRouteRouteMatch
1658 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1659 }
1660
1661 // GrpcRouteRouteRule: Describes how to route traffic.
1662 type GrpcRouteRouteRule struct {
1663 // Action: Required. A detailed rule defining how to route traffic. This field
1664 // is required.
1665 Action *GrpcRouteRouteAction `json:"action,omitempty"`
1666 // Matches: Optional. Matches define conditions used for matching the rule
1667 // against incoming gRPC requests. Each match is independent, i.e. this rule
1668 // will be matched if ANY one of the matches is satisfied. If no matches field
1669 // is specified, this rule will unconditionally match traffic.
1670 Matches []*GrpcRouteRouteMatch `json:"matches,omitempty"`
1671 // ForceSendFields is a list of field names (e.g. "Action") to unconditionally
1672 // include in API requests. By default, fields with empty or default values are
1673 // omitted from API requests. See
1674 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1675 // details.
1676 ForceSendFields []string `json:"-"`
1677 // NullFields is a list of field names (e.g. "Action") to include in API
1678 // requests with the JSON null value. By default, fields with empty values are
1679 // omitted from API requests. See
1680 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1681 NullFields []string `json:"-"`
1682 }
1683
1684 func (s GrpcRouteRouteRule) MarshalJSON() ([]byte, error) {
1685 type NoMethod GrpcRouteRouteRule
1686 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1687 }
1688
1689 // GrpcRouteStatefulSessionAffinityPolicy: The specification for cookie-based
1690 // stateful session affinity where the date plane supplies a “session
1691 // cookie” with the name "GSSA" which encodes a specific destination host and
1692 // each request containing that cookie will be directed to that host as long as
1693 // the destination host remains up and healthy. The gRPC proxyless mesh library
1694 // or sidecar proxy will manage the session cookie but the client application
1695 // code is responsible for copying the cookie from each RPC in the session to
1696 // the next.
1697 type GrpcRouteStatefulSessionAffinityPolicy struct {
1698 // CookieTtl: Required. The cookie TTL value for the Set-Cookie header
1699 // generated by the data plane. The lifetime of the cookie may be set to a
1700 // value from 0 to 86400 seconds (24 hours) inclusive. Set this to 0s to use a
1701 // session cookie and disable cookie expiration.
1702 CookieTtl string `json:"cookieTtl,omitempty"`
1703 // ForceSendFields is a list of field names (e.g. "CookieTtl") to
1704 // unconditionally include in API requests. By default, fields with empty or
1705 // default values are omitted from API requests. See
1706 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1707 // details.
1708 ForceSendFields []string `json:"-"`
1709 // NullFields is a list of field names (e.g. "CookieTtl") to include in API
1710 // requests with the JSON null value. By default, fields with empty values are
1711 // omitted from API requests. See
1712 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1713 NullFields []string `json:"-"`
1714 }
1715
1716 func (s GrpcRouteStatefulSessionAffinityPolicy) MarshalJSON() ([]byte, error) {
1717 type NoMethod GrpcRouteStatefulSessionAffinityPolicy
1718 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1719 }
1720
1721 // HttpRoute: HttpRoute is the resource defining how HTTP traffic should be
1722 // routed by a Mesh or Gateway resource.
1723 type HttpRoute struct {
1724 // CreateTime: Output only. The timestamp when the resource was created.
1725 CreateTime string `json:"createTime,omitempty"`
1726 // Description: Optional. A free-text description of the resource. Max length
1727 // 1024 characters.
1728 Description string `json:"description,omitempty"`
1729 // Gateways: Optional. Gateways defines a list of gateways this HttpRoute is
1730 // attached to, as one of the routing rules to route the requests served by the
1731 // gateway. Each gateway reference should match the pattern:
1732 // `projects/*/locations/*/gateways/`
1733 Gateways []string `json:"gateways,omitempty"`
1734 // Hostnames: Required. Hostnames define a set of hosts that should match
1735 // against the HTTP host header to select a HttpRoute to process the request.
1736 // Hostname is the fully qualified domain name of a network host, as defined by
1737 // RFC 1123 with the exception that: - IPs are not allowed. - A hostname may be
1738 // prefixed with a wildcard label (`*.`). The wildcard label must appear by
1739 // itself as the first label. Hostname can be "precise" which is a domain name
1740 // without the terminating dot of a network host (e.g. `foo.example.com`) or
1741 // "wildcard", which is a domain name prefixed with a single wildcard label
1742 // (e.g. `*.example.com`). Note that as per RFC1035 and RFC1123, a label must
1743 // consist of lower case alphanumeric characters or '-', and must start and end
1744 // with an alphanumeric character. No other punctuation is allowed. The routes
1745 // associated with a Mesh or Gateways must have unique hostnames. If you
1746 // attempt to attach multiple routes with conflicting hostnames, the
1747 // configuration will be rejected. For example, while it is acceptable for
1748 // routes for the hostnames `*.foo.bar.com` and `*.bar.com` to be associated
1749 // with the same Mesh (or Gateways under the same scope), it is not possible to
1750 // associate two routes both with `*.bar.com` or both with `bar.com`.
1751 Hostnames []string `json:"hostnames,omitempty"`
1752 // Labels: Optional. Set of label tags associated with the HttpRoute resource.
1753 Labels map[string]string `json:"labels,omitempty"`
1754 // Meshes: Optional. Meshes defines a list of meshes this HttpRoute is attached
1755 // to, as one of the routing rules to route the requests served by the mesh.
1756 // Each mesh reference should match the pattern:
1757 // `projects/*/locations/*/meshes/` The attached Mesh should be of a type
1758 // SIDECAR
1759 Meshes []string `json:"meshes,omitempty"`
1760 // Name: Identifier. Name of the HttpRoute resource. It matches pattern
1761 // `projects/*/locations/*/httpRoutes/http_route_name>`.
1762 Name string `json:"name,omitempty"`
1763 // Rules: Required. Rules that define how traffic is routed and handled. Rules
1764 // will be matched sequentially based on the RouteMatch specified for the rule.
1765 Rules []*HttpRouteRouteRule `json:"rules,omitempty"`
1766 // SelfLink: Output only. Server-defined URL of this resource
1767 SelfLink string `json:"selfLink,omitempty"`
1768 // UpdateTime: Output only. The timestamp when the resource was updated.
1769 UpdateTime string `json:"updateTime,omitempty"`
1770
1771 // ServerResponse contains the HTTP response code and headers from the server.
1772 googleapi.ServerResponse `json:"-"`
1773 // ForceSendFields is a list of field names (e.g. "CreateTime") to
1774 // unconditionally include in API requests. By default, fields with empty or
1775 // default values are omitted from API requests. See
1776 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1777 // details.
1778 ForceSendFields []string `json:"-"`
1779 // NullFields is a list of field names (e.g. "CreateTime") to include in API
1780 // requests with the JSON null value. By default, fields with empty values are
1781 // omitted from API requests. See
1782 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1783 NullFields []string `json:"-"`
1784 }
1785
1786 func (s HttpRoute) MarshalJSON() ([]byte, error) {
1787 type NoMethod HttpRoute
1788 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1789 }
1790
1791 // HttpRouteCorsPolicy: The Specification for allowing client side cross-origin
1792 // requests.
1793 type HttpRouteCorsPolicy struct {
1794 // AllowCredentials: In response to a preflight request, setting this to true
1795 // indicates that the actual request can include user credentials. This
1796 // translates to the Access-Control-Allow-Credentials header. Default value is
1797 // false.
1798 AllowCredentials bool `json:"allowCredentials,omitempty"`
1799 // AllowHeaders: Specifies the content for Access-Control-Allow-Headers header.
1800 AllowHeaders []string `json:"allowHeaders,omitempty"`
1801 // AllowMethods: Specifies the content for Access-Control-Allow-Methods header.
1802 AllowMethods []string `json:"allowMethods,omitempty"`
1803 // AllowOriginRegexes: Specifies the regular expression patterns that match
1804 // allowed origins. For regular expression grammar, please see
1805 // https://github.com/google/re2/wiki/Syntax.
1806 AllowOriginRegexes []string `json:"allowOriginRegexes,omitempty"`
1807 // AllowOrigins: Specifies the list of origins that will be allowed to do CORS
1808 // requests. An origin is allowed if it matches either an item in allow_origins
1809 // or an item in allow_origin_regexes.
1810 AllowOrigins []string `json:"allowOrigins,omitempty"`
1811 // Disabled: If true, the CORS policy is disabled. The default value is false,
1812 // which indicates that the CORS policy is in effect.
1813 Disabled bool `json:"disabled,omitempty"`
1814 // ExposeHeaders: Specifies the content for Access-Control-Expose-Headers
1815 // header.
1816 ExposeHeaders []string `json:"exposeHeaders,omitempty"`
1817 // MaxAge: Specifies how long result of a preflight request can be cached in
1818 // seconds. This translates to the Access-Control-Max-Age header.
1819 MaxAge string `json:"maxAge,omitempty"`
1820 // ForceSendFields is a list of field names (e.g. "AllowCredentials") to
1821 // unconditionally include in API requests. By default, fields with empty or
1822 // default values are omitted from API requests. See
1823 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1824 // details.
1825 ForceSendFields []string `json:"-"`
1826 // NullFields is a list of field names (e.g. "AllowCredentials") to include in
1827 // API requests with the JSON null value. By default, fields with empty values
1828 // are omitted from API requests. See
1829 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1830 NullFields []string `json:"-"`
1831 }
1832
1833 func (s HttpRouteCorsPolicy) MarshalJSON() ([]byte, error) {
1834 type NoMethod HttpRouteCorsPolicy
1835 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1836 }
1837
1838 // HttpRouteDestination: Specifications of a destination to which the request
1839 // should be routed to.
1840 type HttpRouteDestination struct {
1841 // RequestHeaderModifier: Optional. The specification for modifying the headers
1842 // of a matching request prior to delivery of the request to the destination.
1843 // If HeaderModifiers are set on both the Destination and the RouteAction, they
1844 // will be merged. Conflicts between the two will not be resolved on the
1845 // configuration.
1846 RequestHeaderModifier *HttpRouteHeaderModifier `json:"requestHeaderModifier,omitempty"`
1847 // ResponseHeaderModifier: Optional. The specification for modifying the
1848 // headers of a response prior to sending the response back to the client. If
1849 // HeaderModifiers are set on both the Destination and the RouteAction, they
1850 // will be merged. Conflicts between the two will not be resolved on the
1851 // configuration.
1852 ResponseHeaderModifier *HttpRouteHeaderModifier `json:"responseHeaderModifier,omitempty"`
1853 // ServiceName: The URL of a BackendService to route traffic to.
1854 ServiceName string `json:"serviceName,omitempty"`
1855 // Weight: Specifies the proportion of requests forwarded to the backend
1856 // referenced by the serviceName field. This is computed as: -
1857 // weight/Sum(weights in this destination list). For non-zero values, there may
1858 // be some epsilon from the exact proportion defined here depending on the
1859 // precision an implementation supports. If only one serviceName is specified
1860 // and it has a weight greater than 0, 100% of the traffic is forwarded to that
1861 // backend. If weights are specified for any one service name, they need to be
1862 // specified for all of them. If weights are unspecified for all services,
1863 // then, traffic is distributed in equal proportions to all of them.
1864 Weight int64 `json:"weight,omitempty"`
1865 // ForceSendFields is a list of field names (e.g. "RequestHeaderModifier") to
1866 // unconditionally include in API requests. By default, fields with empty or
1867 // default values are omitted from API requests. See
1868 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1869 // details.
1870 ForceSendFields []string `json:"-"`
1871 // NullFields is a list of field names (e.g. "RequestHeaderModifier") to
1872 // include in API requests with the JSON null value. By default, fields with
1873 // empty values are omitted from API requests. See
1874 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1875 NullFields []string `json:"-"`
1876 }
1877
1878 func (s HttpRouteDestination) MarshalJSON() ([]byte, error) {
1879 type NoMethod HttpRouteDestination
1880 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1881 }
1882
1883 // HttpRouteFaultInjectionPolicy: The specification for fault injection
1884 // introduced into traffic to test the resiliency of clients to destination
1885 // service failure. As part of fault injection, when clients send requests to a
1886 // destination, delays can be introduced by client proxy on a percentage of
1887 // requests before sending those requests to the destination service. Similarly
1888 // requests can be aborted by client proxy for a percentage of requests.
1889 type HttpRouteFaultInjectionPolicy struct {
1890 // Abort: The specification for aborting to client requests.
1891 Abort *HttpRouteFaultInjectionPolicyAbort `json:"abort,omitempty"`
1892 // Delay: The specification for injecting delay to client requests.
1893 Delay *HttpRouteFaultInjectionPolicyDelay `json:"delay,omitempty"`
1894 // ForceSendFields is a list of field names (e.g. "Abort") to unconditionally
1895 // include in API requests. By default, fields with empty or default values are
1896 // omitted from API requests. See
1897 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1898 // details.
1899 ForceSendFields []string `json:"-"`
1900 // NullFields is a list of field names (e.g. "Abort") to include in API
1901 // requests with the JSON null value. By default, fields with empty values are
1902 // omitted from API requests. See
1903 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1904 NullFields []string `json:"-"`
1905 }
1906
1907 func (s HttpRouteFaultInjectionPolicy) MarshalJSON() ([]byte, error) {
1908 type NoMethod HttpRouteFaultInjectionPolicy
1909 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1910 }
1911
1912 // HttpRouteFaultInjectionPolicyAbort: Specification of how client requests are
1913 // aborted as part of fault injection before being sent to a destination.
1914 type HttpRouteFaultInjectionPolicyAbort struct {
1915 // HttpStatus: The HTTP status code used to abort the request. The value must
1916 // be between 200 and 599 inclusive.
1917 HttpStatus int64 `json:"httpStatus,omitempty"`
1918 // Percentage: The percentage of traffic which will be aborted. The value must
1919 // be between [0, 100]
1920 Percentage int64 `json:"percentage,omitempty"`
1921 // ForceSendFields is a list of field names (e.g. "HttpStatus") to
1922 // unconditionally include in API requests. By default, fields with empty or
1923 // default values are omitted from API requests. See
1924 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1925 // details.
1926 ForceSendFields []string `json:"-"`
1927 // NullFields is a list of field names (e.g. "HttpStatus") to include in API
1928 // requests with the JSON null value. By default, fields with empty values are
1929 // omitted from API requests. See
1930 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1931 NullFields []string `json:"-"`
1932 }
1933
1934 func (s HttpRouteFaultInjectionPolicyAbort) MarshalJSON() ([]byte, error) {
1935 type NoMethod HttpRouteFaultInjectionPolicyAbort
1936 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1937 }
1938
1939 // HttpRouteFaultInjectionPolicyDelay: Specification of how client requests are
1940 // delayed as part of fault injection before being sent to a destination.
1941 type HttpRouteFaultInjectionPolicyDelay struct {
1942 // FixedDelay: Specify a fixed delay before forwarding the request.
1943 FixedDelay string `json:"fixedDelay,omitempty"`
1944 // Percentage: The percentage of traffic on which delay will be injected. The
1945 // value must be between [0, 100]
1946 Percentage int64 `json:"percentage,omitempty"`
1947 // ForceSendFields is a list of field names (e.g. "FixedDelay") to
1948 // unconditionally include in API requests. By default, fields with empty or
1949 // default values are omitted from API requests. See
1950 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1951 // details.
1952 ForceSendFields []string `json:"-"`
1953 // NullFields is a list of field names (e.g. "FixedDelay") to include in API
1954 // requests with the JSON null value. By default, fields with empty values are
1955 // omitted from API requests. See
1956 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1957 NullFields []string `json:"-"`
1958 }
1959
1960 func (s HttpRouteFaultInjectionPolicyDelay) MarshalJSON() ([]byte, error) {
1961 type NoMethod HttpRouteFaultInjectionPolicyDelay
1962 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1963 }
1964
1965 // HttpRouteHeaderMatch: Specifies how to select a route rule based on HTTP
1966 // request headers.
1967 type HttpRouteHeaderMatch struct {
1968 // ExactMatch: The value of the header should match exactly the content of
1969 // exact_match.
1970 ExactMatch string `json:"exactMatch,omitempty"`
1971 // Header: The name of the HTTP header to match against.
1972 Header string `json:"header,omitempty"`
1973 // InvertMatch: If specified, the match result will be inverted before
1974 // checking. Default value is set to false.
1975 InvertMatch bool `json:"invertMatch,omitempty"`
1976 // PrefixMatch: The value of the header must start with the contents of
1977 // prefix_match.
1978 PrefixMatch string `json:"prefixMatch,omitempty"`
1979 // PresentMatch: A header with header_name must exist. The match takes place
1980 // whether or not the header has a value.
1981 PresentMatch bool `json:"presentMatch,omitempty"`
1982 // RangeMatch: If specified, the rule will match if the request header value is
1983 // within the range.
1984 RangeMatch *HttpRouteHeaderMatchIntegerRange `json:"rangeMatch,omitempty"`
1985 // RegexMatch: The value of the header must match the regular expression
1986 // specified in regex_match. For regular expression grammar, please see:
1987 // https://github.com/google/re2/wiki/Syntax
1988 RegexMatch string `json:"regexMatch,omitempty"`
1989 // SuffixMatch: The value of the header must end with the contents of
1990 // suffix_match.
1991 SuffixMatch string `json:"suffixMatch,omitempty"`
1992 // ForceSendFields is a list of field names (e.g. "ExactMatch") to
1993 // unconditionally include in API requests. By default, fields with empty or
1994 // default values are omitted from API requests. See
1995 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1996 // details.
1997 ForceSendFields []string `json:"-"`
1998 // NullFields is a list of field names (e.g. "ExactMatch") to include in API
1999 // requests with the JSON null value. By default, fields with empty values are
2000 // omitted from API requests. See
2001 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2002 NullFields []string `json:"-"`
2003 }
2004
2005 func (s HttpRouteHeaderMatch) MarshalJSON() ([]byte, error) {
2006 type NoMethod HttpRouteHeaderMatch
2007 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2008 }
2009
2010 // HttpRouteHeaderMatchIntegerRange: Represents an integer value range.
2011 type HttpRouteHeaderMatchIntegerRange struct {
2012 // End: End of the range (exclusive)
2013 End int64 `json:"end,omitempty"`
2014 // Start: Start of the range (inclusive)
2015 Start int64 `json:"start,omitempty"`
2016 // ForceSendFields is a list of field names (e.g. "End") to unconditionally
2017 // include in API requests. By default, fields with empty or default values are
2018 // omitted from API requests. See
2019 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2020 // details.
2021 ForceSendFields []string `json:"-"`
2022 // NullFields is a list of field names (e.g. "End") to include in API requests
2023 // with the JSON null value. By default, fields with empty values are omitted
2024 // from API requests. See
2025 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2026 NullFields []string `json:"-"`
2027 }
2028
2029 func (s HttpRouteHeaderMatchIntegerRange) MarshalJSON() ([]byte, error) {
2030 type NoMethod HttpRouteHeaderMatchIntegerRange
2031 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2032 }
2033
2034 // HttpRouteHeaderModifier: The specification for modifying HTTP header in HTTP
2035 // request and HTTP response.
2036 type HttpRouteHeaderModifier struct {
2037 // Add: Add the headers with given map where key is the name of the header,
2038 // value is the value of the header.
2039 Add map[string]string `json:"add,omitempty"`
2040 // Remove: Remove headers (matching by header names) specified in the list.
2041 Remove []string `json:"remove,omitempty"`
2042 // Set: Completely overwrite/replace the headers with given map where key is
2043 // the name of the header, value is the value of the header.
2044 Set map[string]string `json:"set,omitempty"`
2045 // ForceSendFields is a list of field names (e.g. "Add") to unconditionally
2046 // include in API requests. By default, fields with empty or default values are
2047 // omitted from API requests. See
2048 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2049 // details.
2050 ForceSendFields []string `json:"-"`
2051 // NullFields is a list of field names (e.g. "Add") to include in API requests
2052 // with the JSON null value. By default, fields with empty values are omitted
2053 // from API requests. See
2054 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2055 NullFields []string `json:"-"`
2056 }
2057
2058 func (s HttpRouteHeaderModifier) MarshalJSON() ([]byte, error) {
2059 type NoMethod HttpRouteHeaderModifier
2060 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2061 }
2062
2063 // HttpRouteHttpDirectResponse: Static HTTP response object to be returned.
2064 type HttpRouteHttpDirectResponse struct {
2065 // BytesBody: Optional. Response body as bytes. Maximum body size is 4096B.
2066 BytesBody string `json:"bytesBody,omitempty"`
2067 // Status: Required. Status to return as part of HTTP Response. Must be a
2068 // positive integer.
2069 Status int64 `json:"status,omitempty"`
2070 // StringBody: Optional. Response body as a string. Maximum body length is 1024
2071 // characters.
2072 StringBody string `json:"stringBody,omitempty"`
2073 // ForceSendFields is a list of field names (e.g. "BytesBody") to
2074 // unconditionally include in API requests. By default, fields with empty or
2075 // default values are omitted from API requests. See
2076 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2077 // details.
2078 ForceSendFields []string `json:"-"`
2079 // NullFields is a list of field names (e.g. "BytesBody") to include in API
2080 // requests with the JSON null value. By default, fields with empty values are
2081 // omitted from API requests. See
2082 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2083 NullFields []string `json:"-"`
2084 }
2085
2086 func (s HttpRouteHttpDirectResponse) MarshalJSON() ([]byte, error) {
2087 type NoMethod HttpRouteHttpDirectResponse
2088 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2089 }
2090
2091 // HttpRouteQueryParameterMatch: Specifications to match a query parameter in
2092 // the request.
2093 type HttpRouteQueryParameterMatch struct {
2094 // ExactMatch: The value of the query parameter must exactly match the contents
2095 // of exact_match. Only one of exact_match, regex_match, or present_match must
2096 // be set.
2097 ExactMatch string `json:"exactMatch,omitempty"`
2098 // PresentMatch: Specifies that the QueryParameterMatcher matches if request
2099 // contains query parameter, irrespective of whether the parameter has a value
2100 // or not. Only one of exact_match, regex_match, or present_match must be set.
2101 PresentMatch bool `json:"presentMatch,omitempty"`
2102 // QueryParameter: The name of the query parameter to match.
2103 QueryParameter string `json:"queryParameter,omitempty"`
2104 // RegexMatch: The value of the query parameter must match the regular
2105 // expression specified by regex_match. For regular expression grammar, please
2106 // see https://github.com/google/re2/wiki/Syntax Only one of exact_match,
2107 // regex_match, or present_match must be set.
2108 RegexMatch string `json:"regexMatch,omitempty"`
2109 // ForceSendFields is a list of field names (e.g. "ExactMatch") to
2110 // unconditionally include in API requests. By default, fields with empty or
2111 // default values are omitted from API requests. See
2112 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2113 // details.
2114 ForceSendFields []string `json:"-"`
2115 // NullFields is a list of field names (e.g. "ExactMatch") to include in API
2116 // requests with the JSON null value. By default, fields with empty values are
2117 // omitted from API requests. See
2118 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2119 NullFields []string `json:"-"`
2120 }
2121
2122 func (s HttpRouteQueryParameterMatch) MarshalJSON() ([]byte, error) {
2123 type NoMethod HttpRouteQueryParameterMatch
2124 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2125 }
2126
2127 // HttpRouteRedirect: The specification for redirecting traffic.
2128 type HttpRouteRedirect struct {
2129 // HostRedirect: The host that will be used in the redirect response instead of
2130 // the one that was supplied in the request.
2131 HostRedirect string `json:"hostRedirect,omitempty"`
2132 // HttpsRedirect: If set to true, the URL scheme in the redirected request is
2133 // set to https. If set to false, the URL scheme of the redirected request will
2134 // remain the same as that of the request. The default is set to false.
2135 HttpsRedirect bool `json:"httpsRedirect,omitempty"`
2136 // PathRedirect: The path that will be used in the redirect response instead of
2137 // the one that was supplied in the request. path_redirect can not be supplied
2138 // together with prefix_redirect. Supply one alone or neither. If neither is
2139 // supplied, the path of the original request will be used for the redirect.
2140 PathRedirect string `json:"pathRedirect,omitempty"`
2141 // PortRedirect: The port that will be used in the redirected request instead
2142 // of the one that was supplied in the request.
2143 PortRedirect int64 `json:"portRedirect,omitempty"`
2144 // PrefixRewrite: Indicates that during redirection, the matched prefix (or
2145 // path) should be swapped with this value. This option allows URLs be
2146 // dynamically created based on the request.
2147 PrefixRewrite string `json:"prefixRewrite,omitempty"`
2148 // ResponseCode: The HTTP Status code to use for the redirect.
2149 //
2150 // Possible values:
2151 // "RESPONSE_CODE_UNSPECIFIED" - Default value
2152 // "MOVED_PERMANENTLY_DEFAULT" - Corresponds to 301.
2153 // "FOUND" - Corresponds to 302.
2154 // "SEE_OTHER" - Corresponds to 303.
2155 // "TEMPORARY_REDIRECT" - Corresponds to 307. In this case, the request
2156 // method will be retained.
2157 // "PERMANENT_REDIRECT" - Corresponds to 308. In this case, the request
2158 // method will be retained.
2159 ResponseCode string `json:"responseCode,omitempty"`
2160 // StripQuery: if set to true, any accompanying query portion of the original
2161 // URL is removed prior to redirecting the request. If set to false, the query
2162 // portion of the original URL is retained. The default is set to false.
2163 StripQuery bool `json:"stripQuery,omitempty"`
2164 // ForceSendFields is a list of field names (e.g. "HostRedirect") to
2165 // unconditionally include in API requests. By default, fields with empty or
2166 // default values are omitted from API requests. See
2167 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2168 // details.
2169 ForceSendFields []string `json:"-"`
2170 // NullFields is a list of field names (e.g. "HostRedirect") to include in API
2171 // requests with the JSON null value. By default, fields with empty values are
2172 // omitted from API requests. See
2173 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2174 NullFields []string `json:"-"`
2175 }
2176
2177 func (s HttpRouteRedirect) MarshalJSON() ([]byte, error) {
2178 type NoMethod HttpRouteRedirect
2179 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2180 }
2181
2182 // HttpRouteRequestMirrorPolicy: Specifies the policy on how requests are
2183 // shadowed to a separate mirrored destination service. The proxy does not wait
2184 // for responses from the shadow service. Prior to sending traffic to the
2185 // shadow service, the host/authority header is suffixed with -shadow.
2186 // Mirroring is currently not supported for Cloud Run destinations.
2187 type HttpRouteRequestMirrorPolicy struct {
2188 // Destination: The destination the requests will be mirrored to. The weight of
2189 // the destination will be ignored.
2190 Destination *HttpRouteDestination `json:"destination,omitempty"`
2191 // MirrorPercent: Optional. The percentage of requests to get mirrored to the
2192 // desired destination.
2193 MirrorPercent float64 `json:"mirrorPercent,omitempty"`
2194 // ForceSendFields is a list of field names (e.g. "Destination") to
2195 // unconditionally include in API requests. By default, fields with empty or
2196 // default values are omitted from API requests. See
2197 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2198 // details.
2199 ForceSendFields []string `json:"-"`
2200 // NullFields is a list of field names (e.g. "Destination") to include in API
2201 // requests with the JSON null value. By default, fields with empty values are
2202 // omitted from API requests. See
2203 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2204 NullFields []string `json:"-"`
2205 }
2206
2207 func (s HttpRouteRequestMirrorPolicy) MarshalJSON() ([]byte, error) {
2208 type NoMethod HttpRouteRequestMirrorPolicy
2209 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2210 }
2211
2212 func (s *HttpRouteRequestMirrorPolicy) UnmarshalJSON(data []byte) error {
2213 type NoMethod HttpRouteRequestMirrorPolicy
2214 var s1 struct {
2215 MirrorPercent gensupport.JSONFloat64 `json:"mirrorPercent"`
2216 *NoMethod
2217 }
2218 s1.NoMethod = (*NoMethod)(s)
2219 if err := json.Unmarshal(data, &s1); err != nil {
2220 return err
2221 }
2222 s.MirrorPercent = float64(s1.MirrorPercent)
2223 return nil
2224 }
2225
2226 // HttpRouteRetryPolicy: The specifications for retries.
2227 type HttpRouteRetryPolicy struct {
2228 // NumRetries: Specifies the allowed number of retries. This number must be >
2229 // 0. If not specified, default to 1.
2230 NumRetries int64 `json:"numRetries,omitempty"`
2231 // PerTryTimeout: Specifies a non-zero timeout per retry attempt.
2232 PerTryTimeout string `json:"perTryTimeout,omitempty"`
2233 // RetryConditions: Specifies one or more conditions when this retry policy
2234 // applies. Valid values are: 5xx: Proxy will attempt a retry if the
2235 // destination service responds with any 5xx response code, of if the
2236 // destination service does not respond at all, example: disconnect, reset,
2237 // read timeout, connection failure and refused streams. gateway-error: Similar
2238 // to 5xx, but only applies to response codes 502, 503, 504. reset: Proxy will
2239 // attempt a retry if the destination service does not respond at all
2240 // (disconnect/reset/read timeout) connect-failure: Proxy will retry on
2241 // failures connecting to destination for example due to connection timeouts.
2242 // retriable-4xx: Proxy will retry fro retriable 4xx response codes. Currently
2243 // the only retriable error supported is 409. refused-stream: Proxy will retry
2244 // if the destination resets the stream with a REFUSED_STREAM error code. This
2245 // reset type indicates that it is safe to retry.
2246 RetryConditions []string `json:"retryConditions,omitempty"`
2247 // ForceSendFields is a list of field names (e.g. "NumRetries") to
2248 // unconditionally include in API requests. By default, fields with empty or
2249 // default values are omitted from API requests. See
2250 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2251 // details.
2252 ForceSendFields []string `json:"-"`
2253 // NullFields is a list of field names (e.g. "NumRetries") to include in API
2254 // requests with the JSON null value. By default, fields with empty values are
2255 // omitted from API requests. See
2256 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2257 NullFields []string `json:"-"`
2258 }
2259
2260 func (s HttpRouteRetryPolicy) MarshalJSON() ([]byte, error) {
2261 type NoMethod HttpRouteRetryPolicy
2262 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2263 }
2264
2265 // HttpRouteRouteAction: The specifications for routing traffic and applying
2266 // associated policies.
2267 type HttpRouteRouteAction struct {
2268 // CorsPolicy: The specification for allowing client side cross-origin
2269 // requests.
2270 CorsPolicy *HttpRouteCorsPolicy `json:"corsPolicy,omitempty"`
2271 // Destinations: The destination to which traffic should be forwarded.
2272 Destinations []*HttpRouteDestination `json:"destinations,omitempty"`
2273 // DirectResponse: Optional. Static HTTP Response object to be returned
2274 // regardless of the request.
2275 DirectResponse *HttpRouteHttpDirectResponse `json:"directResponse,omitempty"`
2276 // FaultInjectionPolicy: The specification for fault injection introduced into
2277 // traffic to test the resiliency of clients to backend service failure. As
2278 // part of fault injection, when clients send requests to a backend service,
2279 // delays can be introduced on a percentage of requests before sending those
2280 // requests to the backend service. Similarly requests from clients can be
2281 // aborted for a percentage of requests. timeout and retry_policy will be
2282 // ignored by clients that are configured with a fault_injection_policy
2283 FaultInjectionPolicy *HttpRouteFaultInjectionPolicy `json:"faultInjectionPolicy,omitempty"`
2284 // IdleTimeout: Optional. Specifies the idle timeout for the selected route.
2285 // The idle timeout is defined as the period in which there are no bytes sent
2286 // or received on either the upstream or downstream connection. If not set, the
2287 // default idle timeout is 1 hour. If set to 0s, the timeout will be disabled.
2288 IdleTimeout string `json:"idleTimeout,omitempty"`
2289 // Redirect: If set, the request is directed as configured by this field.
2290 Redirect *HttpRouteRedirect `json:"redirect,omitempty"`
2291 // RequestHeaderModifier: The specification for modifying the headers of a
2292 // matching request prior to delivery of the request to the destination. If
2293 // HeaderModifiers are set on both the Destination and the RouteAction, they
2294 // will be merged. Conflicts between the two will not be resolved on the
2295 // configuration.
2296 RequestHeaderModifier *HttpRouteHeaderModifier `json:"requestHeaderModifier,omitempty"`
2297 // RequestMirrorPolicy: Specifies the policy on how requests intended for the
2298 // routes destination are shadowed to a separate mirrored destination. Proxy
2299 // will not wait for the shadow destination to respond before returning the
2300 // response. Prior to sending traffic to the shadow service, the host/authority
2301 // header is suffixed with -shadow.
2302 RequestMirrorPolicy *HttpRouteRequestMirrorPolicy `json:"requestMirrorPolicy,omitempty"`
2303 // ResponseHeaderModifier: The specification for modifying the headers of a
2304 // response prior to sending the response back to the client. If
2305 // HeaderModifiers are set on both the Destination and the RouteAction, they
2306 // will be merged. Conflicts between the two will not be resolved on the
2307 // configuration.
2308 ResponseHeaderModifier *HttpRouteHeaderModifier `json:"responseHeaderModifier,omitempty"`
2309 // RetryPolicy: Specifies the retry policy associated with this route.
2310 RetryPolicy *HttpRouteRetryPolicy `json:"retryPolicy,omitempty"`
2311 // StatefulSessionAffinity: Optional. Specifies cookie-based stateful session
2312 // affinity.
2313 StatefulSessionAffinity *HttpRouteStatefulSessionAffinityPolicy `json:"statefulSessionAffinity,omitempty"`
2314 // Timeout: Specifies the timeout for selected route. Timeout is computed from
2315 // the time the request has been fully processed (i.e. end of stream) up until
2316 // the response has been completely processed. Timeout includes all retries.
2317 Timeout string `json:"timeout,omitempty"`
2318 // UrlRewrite: The specification for rewrite URL before forwarding requests to
2319 // the destination.
2320 UrlRewrite *HttpRouteURLRewrite `json:"urlRewrite,omitempty"`
2321 // ForceSendFields is a list of field names (e.g. "CorsPolicy") to
2322 // unconditionally include in API requests. By default, fields with empty or
2323 // default values are omitted from API requests. See
2324 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2325 // details.
2326 ForceSendFields []string `json:"-"`
2327 // NullFields is a list of field names (e.g. "CorsPolicy") to include in API
2328 // requests with the JSON null value. By default, fields with empty values are
2329 // omitted from API requests. See
2330 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2331 NullFields []string `json:"-"`
2332 }
2333
2334 func (s HttpRouteRouteAction) MarshalJSON() ([]byte, error) {
2335 type NoMethod HttpRouteRouteAction
2336 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2337 }
2338
2339 // HttpRouteRouteMatch: RouteMatch defines specifications used to match
2340 // requests. If multiple match types are set, this RouteMatch will match if ALL
2341 // type of matches are matched.
2342 type HttpRouteRouteMatch struct {
2343 // FullPathMatch: The HTTP request path value should exactly match this value.
2344 // Only one of full_path_match, prefix_match, or regex_match should be used.
2345 FullPathMatch string `json:"fullPathMatch,omitempty"`
2346 // Headers: Specifies a list of HTTP request headers to match against. ALL of
2347 // the supplied headers must be matched.
2348 Headers []*HttpRouteHeaderMatch `json:"headers,omitempty"`
2349 // IgnoreCase: Specifies if prefix_match and full_path_match matches are case
2350 // sensitive. The default value is false.
2351 IgnoreCase bool `json:"ignoreCase,omitempty"`
2352 // PrefixMatch: The HTTP request path value must begin with specified
2353 // prefix_match. prefix_match must begin with a /. Only one of full_path_match,
2354 // prefix_match, or regex_match should be used.
2355 PrefixMatch string `json:"prefixMatch,omitempty"`
2356 // QueryParameters: Specifies a list of query parameters to match against. ALL
2357 // of the query parameters must be matched.
2358 QueryParameters []*HttpRouteQueryParameterMatch `json:"queryParameters,omitempty"`
2359 // RegexMatch: The HTTP request path value must satisfy the regular expression
2360 // specified by regex_match after removing any query parameters and anchor
2361 // supplied with the original URL. For regular expression grammar, please see
2362 // https://github.com/google/re2/wiki/Syntax Only one of full_path_match,
2363 // prefix_match, or regex_match should be used.
2364 RegexMatch string `json:"regexMatch,omitempty"`
2365 // ForceSendFields is a list of field names (e.g. "FullPathMatch") to
2366 // unconditionally include in API requests. By default, fields with empty or
2367 // default values are omitted from API requests. See
2368 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2369 // details.
2370 ForceSendFields []string `json:"-"`
2371 // NullFields is a list of field names (e.g. "FullPathMatch") to include in API
2372 // requests with the JSON null value. By default, fields with empty values are
2373 // omitted from API requests. See
2374 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2375 NullFields []string `json:"-"`
2376 }
2377
2378 func (s HttpRouteRouteMatch) MarshalJSON() ([]byte, error) {
2379 type NoMethod HttpRouteRouteMatch
2380 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2381 }
2382
2383 // HttpRouteRouteRule: Specifies how to match traffic and how to route traffic
2384 // when traffic is matched.
2385 type HttpRouteRouteRule struct {
2386 // Action: The detailed rule defining how to route matched traffic.
2387 Action *HttpRouteRouteAction `json:"action,omitempty"`
2388 // Matches: A list of matches define conditions used for matching the rule
2389 // against incoming HTTP requests. Each match is independent, i.e. this rule
2390 // will be matched if ANY one of the matches is satisfied. If no matches field
2391 // is specified, this rule will unconditionally match traffic. If a default
2392 // rule is desired to be configured, add a rule with no matches specified to
2393 // the end of the rules list.
2394 Matches []*HttpRouteRouteMatch `json:"matches,omitempty"`
2395 // ForceSendFields is a list of field names (e.g. "Action") to unconditionally
2396 // include in API requests. By default, fields with empty or default values are
2397 // omitted from API requests. See
2398 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2399 // details.
2400 ForceSendFields []string `json:"-"`
2401 // NullFields is a list of field names (e.g. "Action") to include in API
2402 // requests with the JSON null value. By default, fields with empty values are
2403 // omitted from API requests. See
2404 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2405 NullFields []string `json:"-"`
2406 }
2407
2408 func (s HttpRouteRouteRule) MarshalJSON() ([]byte, error) {
2409 type NoMethod HttpRouteRouteRule
2410 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2411 }
2412
2413 // HttpRouteStatefulSessionAffinityPolicy: The specification for cookie-based
2414 // stateful session affinity where the date plane supplies a “session
2415 // cookie” with the name "GSSA" which encodes a specific destination host and
2416 // each request containing that cookie will be directed to that host as long as
2417 // the destination host remains up and healthy. The gRPC proxyless mesh library
2418 // or sidecar proxy will manage the session cookie but the client application
2419 // code is responsible for copying the cookie from each RPC in the session to
2420 // the next.
2421 type HttpRouteStatefulSessionAffinityPolicy struct {
2422 // CookieTtl: Required. The cookie TTL value for the Set-Cookie header
2423 // generated by the data plane. The lifetime of the cookie may be set to a
2424 // value from 0 to 86400 seconds (24 hours) inclusive. Set this to 0s to use a
2425 // session cookie and disable cookie expiration.
2426 CookieTtl string `json:"cookieTtl,omitempty"`
2427 // ForceSendFields is a list of field names (e.g. "CookieTtl") to
2428 // unconditionally include in API requests. By default, fields with empty or
2429 // default values are omitted from API requests. See
2430 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2431 // details.
2432 ForceSendFields []string `json:"-"`
2433 // NullFields is a list of field names (e.g. "CookieTtl") to include in API
2434 // requests with the JSON null value. By default, fields with empty values are
2435 // omitted from API requests. See
2436 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2437 NullFields []string `json:"-"`
2438 }
2439
2440 func (s HttpRouteStatefulSessionAffinityPolicy) MarshalJSON() ([]byte, error) {
2441 type NoMethod HttpRouteStatefulSessionAffinityPolicy
2442 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2443 }
2444
2445 // HttpRouteURLRewrite: The specification for modifying the URL of the request,
2446 // prior to forwarding the request to the destination.
2447 type HttpRouteURLRewrite struct {
2448 // HostRewrite: Prior to forwarding the request to the selected destination,
2449 // the requests host header is replaced by this value.
2450 HostRewrite string `json:"hostRewrite,omitempty"`
2451 // PathPrefixRewrite: Prior to forwarding the request to the selected
2452 // destination, the matching portion of the requests path is replaced by this
2453 // value.
2454 PathPrefixRewrite string `json:"pathPrefixRewrite,omitempty"`
2455 // ForceSendFields is a list of field names (e.g. "HostRewrite") to
2456 // unconditionally include in API requests. By default, fields with empty or
2457 // default values are omitted from API requests. See
2458 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2459 // details.
2460 ForceSendFields []string `json:"-"`
2461 // NullFields is a list of field names (e.g. "HostRewrite") to include in API
2462 // requests with the JSON null value. By default, fields with empty values are
2463 // omitted from API requests. See
2464 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2465 NullFields []string `json:"-"`
2466 }
2467
2468 func (s HttpRouteURLRewrite) MarshalJSON() ([]byte, error) {
2469 type NoMethod HttpRouteURLRewrite
2470 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2471 }
2472
2473 // LbEdgeExtension: `LbEdgeExtension` is a resource that lets the extension
2474 // service influence the selection of backend services and Cloud CDN cache keys
2475 // by modifying request headers.
2476 type LbEdgeExtension struct {
2477 // CreateTime: Output only. The timestamp when the resource was created.
2478 CreateTime string `json:"createTime,omitempty"`
2479 // Description: Optional. A human-readable description of the resource.
2480 Description string `json:"description,omitempty"`
2481 // ExtensionChains: Required. A set of ordered extension chains that contain
2482 // the match conditions and extensions to execute. Match conditions for each
2483 // extension chain are evaluated in sequence for a given request. The first
2484 // extension chain that has a condition that matches the request is executed.
2485 // Any subsequent extension chains do not execute. Limited to 5 extension
2486 // chains per resource.
2487 ExtensionChains []*ExtensionChain `json:"extensionChains,omitempty"`
2488 // ForwardingRules: Required. A list of references to the forwarding rules to
2489 // which this service extension is attached. At least one forwarding rule is
2490 // required. Only one `LbEdgeExtension` resource can be associated with a
2491 // forwarding rule.
2492 ForwardingRules []string `json:"forwardingRules,omitempty"`
2493 // Labels: Optional. Set of labels associated with the `LbEdgeExtension`
2494 // resource. The format must comply with the requirements for labels
2495 // (https://cloud.google.com/compute/docs/labeling-resources#requirements) for
2496 // Google Cloud resources.
2497 Labels map[string]string `json:"labels,omitempty"`
2498 // LoadBalancingScheme: Required. All forwarding rules referenced by this
2499 // extension must share the same load balancing scheme. Supported values:
2500 // `EXTERNAL_MANAGED`.
2501 //
2502 // Possible values:
2503 // "LOAD_BALANCING_SCHEME_UNSPECIFIED" - Default value. Do not use.
2504 // "INTERNAL_MANAGED" - Signifies that this is used for Internal HTTP(S) Load
2505 // Balancing.
2506 // "EXTERNAL_MANAGED" - Signifies that this is used for External Managed
2507 // HTTP(S) Load Balancing.
2508 LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"`
2509 // Name: Required. Identifier. Name of the `LbEdgeExtension` resource in the
2510 // following format:
2511 // `projects/{project}/locations/{location}/lbEdgeExtensions/{lb_edge_extension}
2512 // `.
2513 Name string `json:"name,omitempty"`
2514 // UpdateTime: Output only. The timestamp when the resource was updated.
2515 UpdateTime string `json:"updateTime,omitempty"`
2516
2517 // ServerResponse contains the HTTP response code and headers from the server.
2518 googleapi.ServerResponse `json:"-"`
2519 // ForceSendFields is a list of field names (e.g. "CreateTime") to
2520 // unconditionally include in API requests. By default, fields with empty or
2521 // default values are omitted from API requests. See
2522 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2523 // details.
2524 ForceSendFields []string `json:"-"`
2525 // NullFields is a list of field names (e.g. "CreateTime") to include in API
2526 // requests with the JSON null value. By default, fields with empty values are
2527 // omitted from API requests. See
2528 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2529 NullFields []string `json:"-"`
2530 }
2531
2532 func (s LbEdgeExtension) MarshalJSON() ([]byte, error) {
2533 type NoMethod LbEdgeExtension
2534 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2535 }
2536
2537 // LbRouteExtension: `LbRouteExtension` is a resource that lets you control
2538 // where traffic is routed to for a given request.
2539 type LbRouteExtension struct {
2540 // CreateTime: Output only. The timestamp when the resource was created.
2541 CreateTime string `json:"createTime,omitempty"`
2542 // Description: Optional. A human-readable description of the resource.
2543 Description string `json:"description,omitempty"`
2544 // ExtensionChains: Required. A set of ordered extension chains that contain
2545 // the match conditions and extensions to execute. Match conditions for each
2546 // extension chain are evaluated in sequence for a given request. The first
2547 // extension chain that has a condition that matches the request is executed.
2548 // Any subsequent extension chains do not execute. Limited to 5 extension
2549 // chains per resource.
2550 ExtensionChains []*ExtensionChain `json:"extensionChains,omitempty"`
2551 // ForwardingRules: Required. A list of references to the forwarding rules to
2552 // which this service extension is attached. At least one forwarding rule is
2553 // required. Only one `LbRouteExtension` resource can be associated with a
2554 // forwarding rule.
2555 ForwardingRules []string `json:"forwardingRules,omitempty"`
2556 // Labels: Optional. Set of labels associated with the `LbRouteExtension`
2557 // resource. The format must comply with the requirements for labels
2558 // (https://cloud.google.com/compute/docs/labeling-resources#requirements) for
2559 // Google Cloud resources.
2560 Labels map[string]string `json:"labels,omitempty"`
2561 // LoadBalancingScheme: Required. All backend services and forwarding rules
2562 // referenced by this extension must share the same load balancing scheme.
2563 // Supported values: `INTERNAL_MANAGED`, `EXTERNAL_MANAGED`. For more
2564 // information, refer to Backend services overview
2565 // (https://cloud.google.com/load-balancing/docs/backend-service).
2566 //
2567 // Possible values:
2568 // "LOAD_BALANCING_SCHEME_UNSPECIFIED" - Default value. Do not use.
2569 // "INTERNAL_MANAGED" - Signifies that this is used for Internal HTTP(S) Load
2570 // Balancing.
2571 // "EXTERNAL_MANAGED" - Signifies that this is used for External Managed
2572 // HTTP(S) Load Balancing.
2573 LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"`
2574 // Metadata: Optional. The metadata provided here is included as part of the
2575 // `metadata_context` (of type `google.protobuf.Struct`) in the
2576 // `ProcessingRequest` message sent to the extension server. The metadata
2577 // applies to all extensions in all extensions chains in this resource. The
2578 // metadata is available under the key `com.google.lb_route_extension.`. The
2579 // following variables are supported in the metadata: `{forwarding_rule_id}` -
2580 // substituted with the forwarding rule's fully qualified resource name. This
2581 // field must not be set if at least one of the extension chains contains
2582 // plugin extensions. Setting it results in a validation error. You can set
2583 // metadata at either the resource level or the extension level. The extension
2584 // level metadata is recommended because you can pass a different set of
2585 // metadata through each extension to the backend.
2586 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
2587 // Name: Required. Identifier. Name of the `LbRouteExtension` resource in the
2588 // following format:
2589 // `projects/{project}/locations/{location}/lbRouteExtensions/{lb_route_extensio
2590 // n}`.
2591 Name string `json:"name,omitempty"`
2592 // UpdateTime: Output only. The timestamp when the resource was updated.
2593 UpdateTime string `json:"updateTime,omitempty"`
2594
2595 // ServerResponse contains the HTTP response code and headers from the server.
2596 googleapi.ServerResponse `json:"-"`
2597 // ForceSendFields is a list of field names (e.g. "CreateTime") to
2598 // unconditionally include in API requests. By default, fields with empty or
2599 // default values are omitted from API requests. See
2600 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2601 // details.
2602 ForceSendFields []string `json:"-"`
2603 // NullFields is a list of field names (e.g. "CreateTime") to include in API
2604 // requests with the JSON null value. By default, fields with empty values are
2605 // omitted from API requests. See
2606 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2607 NullFields []string `json:"-"`
2608 }
2609
2610 func (s LbRouteExtension) MarshalJSON() ([]byte, error) {
2611 type NoMethod LbRouteExtension
2612 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2613 }
2614
2615 // LbTcpExtension: `LbTcpExtension` is a resource that allows traffic
2616 // forwarding to different backend services to make allow/deny decisions on TCP
2617 // connections for all L7 Load Balancers within a network. Currently only
2618 // internal load-balancers are supported.
2619 type LbTcpExtension struct {
2620 // CreateTime: Output only. The timestamp when the resource was created.
2621 CreateTime string `json:"createTime,omitempty"`
2622 // Description: Optional. A human-readable description of the resource.
2623 Description string `json:"description,omitempty"`
2624 // ExtensionChains: Required. A set of ordered extension chains that contain
2625 // the match conditions and extensions to execute. Match conditions for each
2626 // extension chain are evaluated in sequence for a given request. The first
2627 // extension chain that has a condition that matches the request is executed.
2628 // Any subsequent extension chains do not execute. Limited to 5 extension
2629 // chains per resource.
2630 ExtensionChains []*ExtensionChain `json:"extensionChains,omitempty"`
2631 // Labels: Optional. Set of labels associated with the `LbTcpExtension`
2632 // resource. The format must comply with the requirements for labels
2633 // (/compute/docs/labeling-resources#requirements) for Google Cloud resources.
2634 Labels map[string]string `json:"labels,omitempty"`
2635 // LoadBalancingScheme: Required. All backend services and forwarding rules
2636 // referenced by this extension must share the same load balancing scheme.
2637 // Supported values: `INTERNAL_MANAGED`. For more information, refer to Backend
2638 // services overview
2639 // (https://cloud.google.com/load-balancing/docs/backend-service).
2640 //
2641 // Possible values:
2642 // "LOAD_BALANCING_SCHEME_UNSPECIFIED" - Default value. Do not use.
2643 // "INTERNAL_MANAGED" - Signifies that this is used for Internal HTTP(S) Load
2644 // Balancing.
2645 // "EXTERNAL_MANAGED" - Signifies that this is used for External Managed
2646 // HTTP(S) Load Balancing.
2647 LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"`
2648 // Name: Required. Identifier. Name of the `LbTcpExtension` resource in the
2649 // following format:
2650 // `projects/{project}/locations/{location}/LbTcpExtension/{lb_tcp_extension}`
2651 Name string `json:"name,omitempty"`
2652 // Networks: Optional. If set, this `LbTcpExtension` resource applies to all
2653 // `ForwardingRule` resources in these VPC networks. Values should be relative
2654 // resource names identifying VPC networks, for example
2655 // `projects/*/global/networks/network-1`. Currently limited to 1 network per
2656 // resource. Limited to 1 network per resource.
2657 Networks []string `json:"networks,omitempty"`
2658 // UpdateTime: Output only. The timestamp when the resource was updated.
2659 UpdateTime string `json:"updateTime,omitempty"`
2660
2661 // ServerResponse contains the HTTP response code and headers from the server.
2662 googleapi.ServerResponse `json:"-"`
2663 // ForceSendFields is a list of field names (e.g. "CreateTime") to
2664 // unconditionally include in API requests. By default, fields with empty or
2665 // default values are omitted from API requests. See
2666 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2667 // details.
2668 ForceSendFields []string `json:"-"`
2669 // NullFields is a list of field names (e.g. "CreateTime") to include in API
2670 // requests with the JSON null value. By default, fields with empty values are
2671 // omitted from API requests. See
2672 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2673 NullFields []string `json:"-"`
2674 }
2675
2676 func (s LbTcpExtension) MarshalJSON() ([]byte, error) {
2677 type NoMethod LbTcpExtension
2678 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2679 }
2680
2681 // LbTrafficExtension: `LbTrafficExtension` is a resource that lets the
2682 // extension service modify the headers and payloads of both requests and
2683 // responses without impacting the choice of backend services or any other
2684 // security policies associated with the backend service.
2685 type LbTrafficExtension struct {
2686 // CreateTime: Output only. The timestamp when the resource was created.
2687 CreateTime string `json:"createTime,omitempty"`
2688 // Description: Optional. A human-readable description of the resource.
2689 Description string `json:"description,omitempty"`
2690 // ExtensionChains: Required. A set of ordered extension chains that contain
2691 // the match conditions and extensions to execute. Match conditions for each
2692 // extension chain are evaluated in sequence for a given request. The first
2693 // extension chain that has a condition that matches the request is executed.
2694 // Any subsequent extension chains do not execute. Limited to 5 extension
2695 // chains per resource.
2696 ExtensionChains []*ExtensionChain `json:"extensionChains,omitempty"`
2697 // ForwardingRules: Optional. A list of references to the forwarding rules to
2698 // which this service extension is attached. At least one forwarding rule is
2699 // required. Only one `LbTrafficExtension` resource can be associated with a
2700 // forwarding rule.
2701 ForwardingRules []string `json:"forwardingRules,omitempty"`
2702 // Labels: Optional. Set of labels associated with the `LbTrafficExtension`
2703 // resource. The format must comply with the requirements for labels
2704 // (https://cloud.google.com/compute/docs/labeling-resources#requirements) for
2705 // Google Cloud resources.
2706 Labels map[string]string `json:"labels,omitempty"`
2707 // LoadBalancingScheme: Required. All backend services and forwarding rules
2708 // referenced by this extension must share the same load balancing scheme.
2709 // Supported values: `INTERNAL_MANAGED` and `EXTERNAL_MANAGED`. For more
2710 // information, refer to Backend services overview
2711 // (https://cloud.google.com/load-balancing/docs/backend-service).
2712 //
2713 // Possible values:
2714 // "LOAD_BALANCING_SCHEME_UNSPECIFIED" - Default value. Do not use.
2715 // "INTERNAL_MANAGED" - Signifies that this is used for Internal HTTP(S) Load
2716 // Balancing.
2717 // "EXTERNAL_MANAGED" - Signifies that this is used for External Managed
2718 // HTTP(S) Load Balancing.
2719 LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"`
2720 // Metadata: Optional. The metadata provided here is included as part of the
2721 // `metadata_context` (of type `google.protobuf.Struct`) in the
2722 // `ProcessingRequest` message sent to the extension server. The metadata
2723 // applies to all extensions in all extensions chains in this resource. The
2724 // metadata is available under the key `com.google.lb_traffic_extension.`. The
2725 // following variables are supported in the metadata: `{forwarding_rule_id}` -
2726 // substituted with the forwarding rule's fully qualified resource name. This
2727 // field must not be set if at least one of the extension chains contains
2728 // plugin extensions. Setting it results in a validation error. You can set
2729 // metadata at either the resource level or the extension level. The extension
2730 // level metadata is recommended because you can pass a different set of
2731 // metadata through each extension to the backend.
2732 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
2733 // Name: Required. Identifier. Name of the `LbTrafficExtension` resource in the
2734 // following format:
2735 // `projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_exte
2736 // nsion}`.
2737 Name string `json:"name,omitempty"`
2738 // UpdateTime: Output only. The timestamp when the resource was updated.
2739 UpdateTime string `json:"updateTime,omitempty"`
2740
2741 // ServerResponse contains the HTTP response code and headers from the server.
2742 googleapi.ServerResponse `json:"-"`
2743 // ForceSendFields is a list of field names (e.g. "CreateTime") to
2744 // unconditionally include in API requests. By default, fields with empty or
2745 // default values are omitted from API requests. See
2746 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2747 // details.
2748 ForceSendFields []string `json:"-"`
2749 // NullFields is a list of field names (e.g. "CreateTime") to include in API
2750 // requests with the JSON null value. By default, fields with empty values are
2751 // omitted from API requests. See
2752 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2753 NullFields []string `json:"-"`
2754 }
2755
2756 func (s LbTrafficExtension) MarshalJSON() ([]byte, error) {
2757 type NoMethod LbTrafficExtension
2758 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2759 }
2760
2761 // ListAgentGatewaysResponse: Response returned by the ListAgentGateways
2762 // method.
2763 type ListAgentGatewaysResponse struct {
2764 // AgentGateways: List of AgentGateway resources.
2765 AgentGateways []*AgentGateway `json:"agentGateways,omitempty"`
2766 // NextPageToken: If there might be more results than those appearing in this
2767 // response, then `next_page_token` is included. To get the next set of
2768 // results, call this method again using the value of `next_page_token` as
2769 // `page_token`.
2770 NextPageToken string `json:"nextPageToken,omitempty"`
2771 // Unreachable: Unreachable resources. Populated when the request attempts to
2772 // list all resources across all supported locations, while some locations are
2773 // temporarily unavailable.
2774 Unreachable []string `json:"unreachable,omitempty"`
2775
2776 // ServerResponse contains the HTTP response code and headers from the server.
2777 googleapi.ServerResponse `json:"-"`
2778 // ForceSendFields is a list of field names (e.g. "AgentGateways") to
2779 // unconditionally include in API requests. By default, fields with empty or
2780 // default values are omitted from API requests. See
2781 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2782 // details.
2783 ForceSendFields []string `json:"-"`
2784 // NullFields is a list of field names (e.g. "AgentGateways") to include in API
2785 // requests with the JSON null value. By default, fields with empty values are
2786 // omitted from API requests. See
2787 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2788 NullFields []string `json:"-"`
2789 }
2790
2791 func (s ListAgentGatewaysResponse) MarshalJSON() ([]byte, error) {
2792 type NoMethod ListAgentGatewaysResponse
2793 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2794 }
2795
2796 // ListAuthzExtensionsResponse: Message for response to listing
2797 // `AuthzExtension` resources.
2798 type ListAuthzExtensionsResponse struct {
2799 // AuthzExtensions: The list of `AuthzExtension` resources.
2800 AuthzExtensions []*AuthzExtension `json:"authzExtensions,omitempty"`
2801 // NextPageToken: A token identifying a page of results that the server
2802 // returns.
2803 NextPageToken string `json:"nextPageToken,omitempty"`
2804 // Unreachable: Locations that could not be reached.
2805 Unreachable []string `json:"unreachable,omitempty"`
2806
2807 // ServerResponse contains the HTTP response code and headers from the server.
2808 googleapi.ServerResponse `json:"-"`
2809 // ForceSendFields is a list of field names (e.g. "AuthzExtensions") to
2810 // unconditionally include in API requests. By default, fields with empty or
2811 // default values are omitted from API requests. See
2812 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2813 // details.
2814 ForceSendFields []string `json:"-"`
2815 // NullFields is a list of field names (e.g. "AuthzExtensions") to include in
2816 // API requests with the JSON null value. By default, fields with empty values
2817 // are omitted from API requests. See
2818 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2819 NullFields []string `json:"-"`
2820 }
2821
2822 func (s ListAuthzExtensionsResponse) MarshalJSON() ([]byte, error) {
2823 type NoMethod ListAuthzExtensionsResponse
2824 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2825 }
2826
2827 // ListEndpointPoliciesResponse: Response returned by the ListEndpointPolicies
2828 // method.
2829 type ListEndpointPoliciesResponse struct {
2830 // EndpointPolicies: List of EndpointPolicy resources.
2831 EndpointPolicies []*EndpointPolicy `json:"endpointPolicies,omitempty"`
2832 // NextPageToken: If there might be more results than those appearing in this
2833 // response, then `next_page_token` is included. To get the next set of
2834 // results, call this method again using the value of `next_page_token` as
2835 // `page_token`.
2836 NextPageToken string `json:"nextPageToken,omitempty"`
2837 // Unreachable: Unreachable resources. Populated when the request opts into
2838 // return_partial_success and reading across collections e.g. when attempting
2839 // to list all resources across all supported locations.
2840 Unreachable []string `json:"unreachable,omitempty"`
2841
2842 // ServerResponse contains the HTTP response code and headers from the server.
2843 googleapi.ServerResponse `json:"-"`
2844 // ForceSendFields is a list of field names (e.g. "EndpointPolicies") to
2845 // unconditionally include in API requests. By default, fields with empty or
2846 // default values are omitted from API requests. See
2847 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2848 // details.
2849 ForceSendFields []string `json:"-"`
2850 // NullFields is a list of field names (e.g. "EndpointPolicies") to include in
2851 // API requests with the JSON null value. By default, fields with empty values
2852 // are omitted from API requests. See
2853 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2854 NullFields []string `json:"-"`
2855 }
2856
2857 func (s ListEndpointPoliciesResponse) MarshalJSON() ([]byte, error) {
2858 type NoMethod ListEndpointPoliciesResponse
2859 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2860 }
2861
2862 // ListGatewayRouteViewsResponse: Response returned by the
2863 // ListGatewayRouteViews method.
2864 type ListGatewayRouteViewsResponse struct {
2865 // GatewayRouteViews: List of GatewayRouteView resources.
2866 GatewayRouteViews []*GatewayRouteView `json:"gatewayRouteViews,omitempty"`
2867 // NextPageToken: A token, which can be sent as `page_token` to retrieve the
2868 // next page. If this field is omitted, there are no subsequent pages.
2869 NextPageToken string `json:"nextPageToken,omitempty"`
2870 // Unreachable: Unreachable resources. Populated when the request attempts to
2871 // list all resources across all supported locations, while some locations are
2872 // temporarily unavailable.
2873 Unreachable []string `json:"unreachable,omitempty"`
2874
2875 // ServerResponse contains the HTTP response code and headers from the server.
2876 googleapi.ServerResponse `json:"-"`
2877 // ForceSendFields is a list of field names (e.g. "GatewayRouteViews") to
2878 // unconditionally include in API requests. By default, fields with empty or
2879 // default values are omitted from API requests. See
2880 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2881 // details.
2882 ForceSendFields []string `json:"-"`
2883 // NullFields is a list of field names (e.g. "GatewayRouteViews") to include in
2884 // API requests with the JSON null value. By default, fields with empty values
2885 // are omitted from API requests. See
2886 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2887 NullFields []string `json:"-"`
2888 }
2889
2890 func (s ListGatewayRouteViewsResponse) MarshalJSON() ([]byte, error) {
2891 type NoMethod ListGatewayRouteViewsResponse
2892 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2893 }
2894
2895 // ListGatewaysResponse: Response returned by the ListGateways method.
2896 type ListGatewaysResponse struct {
2897 // Gateways: List of Gateway resources.
2898 Gateways []*Gateway `json:"gateways,omitempty"`
2899 // NextPageToken: If there might be more results than those appearing in this
2900 // response, then `next_page_token` is included. To get the next set of
2901 // results, call this method again using the value of `next_page_token` as
2902 // `page_token`.
2903 NextPageToken string `json:"nextPageToken,omitempty"`
2904 // Unreachable: Locations that could not be reached.
2905 Unreachable []string `json:"unreachable,omitempty"`
2906
2907 // ServerResponse contains the HTTP response code and headers from the server.
2908 googleapi.ServerResponse `json:"-"`
2909 // ForceSendFields is a list of field names (e.g. "Gateways") to
2910 // unconditionally include in API requests. By default, fields with empty or
2911 // default values are omitted from API requests. See
2912 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2913 // details.
2914 ForceSendFields []string `json:"-"`
2915 // NullFields is a list of field names (e.g. "Gateways") to include in API
2916 // requests with the JSON null value. By default, fields with empty values are
2917 // omitted from API requests. See
2918 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2919 NullFields []string `json:"-"`
2920 }
2921
2922 func (s ListGatewaysResponse) MarshalJSON() ([]byte, error) {
2923 type NoMethod ListGatewaysResponse
2924 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2925 }
2926
2927 // ListGrpcRoutesResponse: Response returned by the ListGrpcRoutes method.
2928 type ListGrpcRoutesResponse struct {
2929 // GrpcRoutes: List of GrpcRoute resources.
2930 GrpcRoutes []*GrpcRoute `json:"grpcRoutes,omitempty"`
2931 // NextPageToken: If there might be more results than those appearing in this
2932 // response, then `next_page_token` is included. To get the next set of
2933 // results, call this method again using the value of `next_page_token` as
2934 // `page_token`.
2935 NextPageToken string `json:"nextPageToken,omitempty"`
2936 // Unreachable: Unreachable resources. Populated when the request opts into
2937 // return_partial_success and reading across collections e.g. when attempting
2938 // to list all resources across all supported locations.
2939 Unreachable []string `json:"unreachable,omitempty"`
2940
2941 // ServerResponse contains the HTTP response code and headers from the server.
2942 googleapi.ServerResponse `json:"-"`
2943 // ForceSendFields is a list of field names (e.g. "GrpcRoutes") to
2944 // unconditionally include in API requests. By default, fields with empty or
2945 // default values are omitted from API requests. See
2946 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2947 // details.
2948 ForceSendFields []string `json:"-"`
2949 // NullFields is a list of field names (e.g. "GrpcRoutes") to include in API
2950 // requests with the JSON null value. By default, fields with empty values are
2951 // omitted from API requests. See
2952 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2953 NullFields []string `json:"-"`
2954 }
2955
2956 func (s ListGrpcRoutesResponse) MarshalJSON() ([]byte, error) {
2957 type NoMethod ListGrpcRoutesResponse
2958 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2959 }
2960
2961 // ListHttpRoutesResponse: Response returned by the ListHttpRoutes method.
2962 type ListHttpRoutesResponse struct {
2963 // HttpRoutes: List of HttpRoute resources.
2964 HttpRoutes []*HttpRoute `json:"httpRoutes,omitempty"`
2965 // NextPageToken: If there might be more results than those appearing in this
2966 // response, then `next_page_token` is included. To get the next set of
2967 // results, call this method again using the value of `next_page_token` as
2968 // `page_token`.
2969 NextPageToken string `json:"nextPageToken,omitempty"`
2970 // Unreachable: Unreachable resources. Populated when the request opts into
2971 // return_partial_success and reading across collections e.g. when attempting
2972 // to list all resources across all supported locations.
2973 Unreachable []string `json:"unreachable,omitempty"`
2974
2975 // ServerResponse contains the HTTP response code and headers from the server.
2976 googleapi.ServerResponse `json:"-"`
2977 // ForceSendFields is a list of field names (e.g. "HttpRoutes") to
2978 // unconditionally include in API requests. By default, fields with empty or
2979 // default values are omitted from API requests. See
2980 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2981 // details.
2982 ForceSendFields []string `json:"-"`
2983 // NullFields is a list of field names (e.g. "HttpRoutes") to include in API
2984 // requests with the JSON null value. By default, fields with empty values are
2985 // omitted from API requests. See
2986 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2987 NullFields []string `json:"-"`
2988 }
2989
2990 func (s ListHttpRoutesResponse) MarshalJSON() ([]byte, error) {
2991 type NoMethod ListHttpRoutesResponse
2992 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2993 }
2994
2995 // ListLbEdgeExtensionsResponse: Message for response to listing
2996 // `LbEdgeExtension` resources.
2997 type ListLbEdgeExtensionsResponse struct {
2998 // LbEdgeExtensions: The list of `LbEdgeExtension` resources.
2999 LbEdgeExtensions []*LbEdgeExtension `json:"lbEdgeExtensions,omitempty"`
3000 // NextPageToken: A token identifying a page of results that the server
3001 // returns.
3002 NextPageToken string `json:"nextPageToken,omitempty"`
3003 // Unreachable: Locations that could not be reached.
3004 Unreachable []string `json:"unreachable,omitempty"`
3005
3006 // ServerResponse contains the HTTP response code and headers from the server.
3007 googleapi.ServerResponse `json:"-"`
3008 // ForceSendFields is a list of field names (e.g. "LbEdgeExtensions") to
3009 // unconditionally include in API requests. By default, fields with empty or
3010 // default values are omitted from API requests. See
3011 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3012 // details.
3013 ForceSendFields []string `json:"-"`
3014 // NullFields is a list of field names (e.g. "LbEdgeExtensions") to include in
3015 // API requests with the JSON null value. By default, fields with empty values
3016 // are omitted from API requests. See
3017 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3018 NullFields []string `json:"-"`
3019 }
3020
3021 func (s ListLbEdgeExtensionsResponse) MarshalJSON() ([]byte, error) {
3022 type NoMethod ListLbEdgeExtensionsResponse
3023 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3024 }
3025
3026 // ListLbRouteExtensionsResponse: Message for response to listing
3027 // `LbRouteExtension` resources.
3028 type ListLbRouteExtensionsResponse struct {
3029 // LbRouteExtensions: The list of `LbRouteExtension` resources.
3030 LbRouteExtensions []*LbRouteExtension `json:"lbRouteExtensions,omitempty"`
3031 // NextPageToken: A token identifying a page of results that the server
3032 // returns.
3033 NextPageToken string `json:"nextPageToken,omitempty"`
3034 // Unreachable: Locations that could not be reached.
3035 Unreachable []string `json:"unreachable,omitempty"`
3036
3037 // ServerResponse contains the HTTP response code and headers from the server.
3038 googleapi.ServerResponse `json:"-"`
3039 // ForceSendFields is a list of field names (e.g. "LbRouteExtensions") to
3040 // unconditionally include in API requests. By default, fields with empty or
3041 // default values are omitted from API requests. See
3042 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3043 // details.
3044 ForceSendFields []string `json:"-"`
3045 // NullFields is a list of field names (e.g. "LbRouteExtensions") to include in
3046 // API requests with the JSON null value. By default, fields with empty values
3047 // are omitted from API requests. See
3048 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3049 NullFields []string `json:"-"`
3050 }
3051
3052 func (s ListLbRouteExtensionsResponse) MarshalJSON() ([]byte, error) {
3053 type NoMethod ListLbRouteExtensionsResponse
3054 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3055 }
3056
3057 // ListLbTcpExtensionsResponse: Message for response to listing
3058 // `LbTcpExtension` resources.
3059 type ListLbTcpExtensionsResponse struct {
3060 // LbTcpExtensions: The list of `LbTcpExtension` resources.
3061 LbTcpExtensions []*LbTcpExtension `json:"lbTcpExtensions,omitempty"`
3062 // NextPageToken: A token identifying a page of results that the server
3063 // returns.
3064 NextPageToken string `json:"nextPageToken,omitempty"`
3065 // Unreachable: Locations that could not be reached.
3066 Unreachable []string `json:"unreachable,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. "LbTcpExtensions") 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. "LbTcpExtensions") to include in
3077 // API requests with the JSON null value. By default, fields with empty values
3078 // are 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 ListLbTcpExtensionsResponse) MarshalJSON() ([]byte, error) {
3084 type NoMethod ListLbTcpExtensionsResponse
3085 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3086 }
3087
3088 // ListLbTrafficExtensionsResponse: Message for response to listing
3089 // `LbTrafficExtension` resources.
3090 type ListLbTrafficExtensionsResponse struct {
3091 // LbTrafficExtensions: The list of `LbTrafficExtension` resources.
3092 LbTrafficExtensions []*LbTrafficExtension `json:"lbTrafficExtensions,omitempty"`
3093 // NextPageToken: A token identifying a page of results that the server
3094 // returns.
3095 NextPageToken string `json:"nextPageToken,omitempty"`
3096 // Unreachable: Locations that could not be reached.
3097 Unreachable []string `json:"unreachable,omitempty"`
3098
3099 // ServerResponse contains the HTTP response code and headers from the server.
3100 googleapi.ServerResponse `json:"-"`
3101 // ForceSendFields is a list of field names (e.g. "LbTrafficExtensions") to
3102 // unconditionally include in API requests. By default, fields with empty or
3103 // default values are omitted from API requests. See
3104 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3105 // details.
3106 ForceSendFields []string `json:"-"`
3107 // NullFields is a list of field names (e.g. "LbTrafficExtensions") to include
3108 // in API requests with the JSON null value. By default, fields with empty
3109 // values are omitted from API requests. See
3110 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3111 NullFields []string `json:"-"`
3112 }
3113
3114 func (s ListLbTrafficExtensionsResponse) MarshalJSON() ([]byte, error) {
3115 type NoMethod ListLbTrafficExtensionsResponse
3116 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3117 }
3118
3119 // ListLocationsResponse: The response message for Locations.ListLocations.
3120 type ListLocationsResponse struct {
3121 // Locations: A list of locations that matches the specified filter in the
3122 // request.
3123 Locations []*Location `json:"locations,omitempty"`
3124 // NextPageToken: The standard List next-page token.
3125 NextPageToken string `json:"nextPageToken,omitempty"`
3126
3127 // ServerResponse contains the HTTP response code and headers from the server.
3128 googleapi.ServerResponse `json:"-"`
3129 // ForceSendFields is a list of field names (e.g. "Locations") to
3130 // unconditionally include in API requests. By default, fields with empty or
3131 // default values are omitted from API requests. See
3132 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3133 // details.
3134 ForceSendFields []string `json:"-"`
3135 // NullFields is a list of field names (e.g. "Locations") to include in API
3136 // requests with the JSON null value. By default, fields with empty values are
3137 // omitted from API requests. See
3138 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3139 NullFields []string `json:"-"`
3140 }
3141
3142 func (s ListLocationsResponse) MarshalJSON() ([]byte, error) {
3143 type NoMethod ListLocationsResponse
3144 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3145 }
3146
3147 // ListMeshRouteViewsResponse: Response returned by the ListMeshRouteViews
3148 // method.
3149 type ListMeshRouteViewsResponse struct {
3150 // MeshRouteViews: List of MeshRouteView resources.
3151 MeshRouteViews []*MeshRouteView `json:"meshRouteViews,omitempty"`
3152 // NextPageToken: A token, which can be sent as `page_token` to retrieve the
3153 // next page. If this field is omitted, there are no subsequent pages.
3154 NextPageToken string `json:"nextPageToken,omitempty"`
3155 // Unreachable: Unreachable resources. Populated when the request attempts to
3156 // list all resources across all supported locations, while some locations are
3157 // temporarily unavailable.
3158 Unreachable []string `json:"unreachable,omitempty"`
3159
3160 // ServerResponse contains the HTTP response code and headers from the server.
3161 googleapi.ServerResponse `json:"-"`
3162 // ForceSendFields is a list of field names (e.g. "MeshRouteViews") to
3163 // unconditionally include in API requests. By default, fields with empty or
3164 // default values are omitted from API requests. See
3165 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3166 // details.
3167 ForceSendFields []string `json:"-"`
3168 // NullFields is a list of field names (e.g. "MeshRouteViews") to include in
3169 // API requests with the JSON null value. By default, fields with empty values
3170 // are omitted from API requests. See
3171 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3172 NullFields []string `json:"-"`
3173 }
3174
3175 func (s ListMeshRouteViewsResponse) MarshalJSON() ([]byte, error) {
3176 type NoMethod ListMeshRouteViewsResponse
3177 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3178 }
3179
3180 // ListMeshesResponse: Response returned by the ListMeshes method.
3181 type ListMeshesResponse struct {
3182 // Meshes: List of Mesh resources.
3183 Meshes []*Mesh `json:"meshes,omitempty"`
3184 // NextPageToken: If there might be more results than those appearing in this
3185 // response, then `next_page_token` is included. To get the next set of
3186 // results, call this method again using the value of `next_page_token` as
3187 // `page_token`.
3188 NextPageToken string `json:"nextPageToken,omitempty"`
3189 // Unreachable: Unreachable resources. Populated when the request opts into
3190 // `return_partial_success` and reading across collections e.g. when attempting
3191 // to list all resources across all supported locations.
3192 Unreachable []string `json:"unreachable,omitempty"`
3193
3194 // ServerResponse contains the HTTP response code and headers from the server.
3195 googleapi.ServerResponse `json:"-"`
3196 // ForceSendFields is a list of field names (e.g. "Meshes") to unconditionally
3197 // include in API requests. By default, fields with empty or default values are
3198 // omitted from API requests. See
3199 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3200 // details.
3201 ForceSendFields []string `json:"-"`
3202 // NullFields is a list of field names (e.g. "Meshes") to include in API
3203 // requests with the JSON null value. By default, fields with empty values are
3204 // omitted from API requests. See
3205 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3206 NullFields []string `json:"-"`
3207 }
3208
3209 func (s ListMeshesResponse) MarshalJSON() ([]byte, error) {
3210 type NoMethod ListMeshesResponse
3211 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3212 }
3213
3214 // ListOperationsResponse: The response message for Operations.ListOperations.
3215 type ListOperationsResponse struct {
3216 // NextPageToken: The standard List next-page token.
3217 NextPageToken string `json:"nextPageToken,omitempty"`
3218 // Operations: A list of operations that matches the specified filter in the
3219 // request.
3220 Operations []*Operation `json:"operations,omitempty"`
3221 // Unreachable: Unordered list. Unreachable resources. Populated when the
3222 // request sets `ListOperationsRequest.return_partial_success` and reads across
3223 // collections. For example, when attempting to list all resources across all
3224 // supported locations.
3225 Unreachable []string `json:"unreachable,omitempty"`
3226
3227 // ServerResponse contains the HTTP response code and headers from the server.
3228 googleapi.ServerResponse `json:"-"`
3229 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
3230 // unconditionally include in API requests. By default, fields with empty or
3231 // default values are omitted from API requests. See
3232 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3233 // details.
3234 ForceSendFields []string `json:"-"`
3235 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
3236 // requests with the JSON null value. By default, fields with empty values are
3237 // omitted from API requests. See
3238 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3239 NullFields []string `json:"-"`
3240 }
3241
3242 func (s ListOperationsResponse) MarshalJSON() ([]byte, error) {
3243 type NoMethod ListOperationsResponse
3244 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3245 }
3246
3247 // ListServiceBindingsResponse: Response returned by the ListServiceBindings
3248 // method.
3249 type ListServiceBindingsResponse struct {
3250 // NextPageToken: If there might be more results than those appearing in this
3251 // response, then `next_page_token` is included. To get the next set of
3252 // results, call this method again using the value of `next_page_token` as
3253 // `page_token`.
3254 NextPageToken string `json:"nextPageToken,omitempty"`
3255 // ServiceBindings: List of ServiceBinding resources.
3256 ServiceBindings []*ServiceBinding `json:"serviceBindings,omitempty"`
3257 // Unreachable: Unreachable resources. Populated when the request attempts to
3258 // list all resources across all supported locations, while some locations are
3259 // temporarily unavailable.
3260 Unreachable []string `json:"unreachable,omitempty"`
3261
3262 // ServerResponse contains the HTTP response code and headers from the server.
3263 googleapi.ServerResponse `json:"-"`
3264 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
3265 // unconditionally include in API requests. By default, fields with empty or
3266 // default values are omitted from API requests. See
3267 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3268 // details.
3269 ForceSendFields []string `json:"-"`
3270 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
3271 // requests with the JSON null value. By default, fields with empty values are
3272 // omitted from API requests. See
3273 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3274 NullFields []string `json:"-"`
3275 }
3276
3277 func (s ListServiceBindingsResponse) MarshalJSON() ([]byte, error) {
3278 type NoMethod ListServiceBindingsResponse
3279 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3280 }
3281
3282 // ListServiceLbPoliciesResponse: Response returned by the
3283 // ListServiceLbPolicies method.
3284 type ListServiceLbPoliciesResponse struct {
3285 // NextPageToken: If there might be more results than those appearing in this
3286 // response, then `next_page_token` is included. To get the next set of
3287 // results, call this method again using the value of `next_page_token` as
3288 // `page_token`.
3289 NextPageToken string `json:"nextPageToken,omitempty"`
3290 // ServiceLbPolicies: List of ServiceLbPolicy resources.
3291 ServiceLbPolicies []*ServiceLbPolicy `json:"serviceLbPolicies,omitempty"`
3292 // Unreachable: Unreachable resources. Populated when the request attempts to
3293 // list all resources across all supported locations, while some locations are
3294 // temporarily unavailable.
3295 Unreachable []string `json:"unreachable,omitempty"`
3296
3297 // ServerResponse contains the HTTP response code and headers from the server.
3298 googleapi.ServerResponse `json:"-"`
3299 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
3300 // unconditionally include in API requests. By default, fields with empty or
3301 // default values are omitted from API requests. See
3302 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3303 // details.
3304 ForceSendFields []string `json:"-"`
3305 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
3306 // requests with the JSON null value. By default, fields with empty values are
3307 // omitted from API requests. See
3308 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3309 NullFields []string `json:"-"`
3310 }
3311
3312 func (s ListServiceLbPoliciesResponse) MarshalJSON() ([]byte, error) {
3313 type NoMethod ListServiceLbPoliciesResponse
3314 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3315 }
3316
3317 // ListTcpRoutesResponse: Response returned by the ListTcpRoutes method.
3318 type ListTcpRoutesResponse struct {
3319 // NextPageToken: If there might be more results than those appearing in this
3320 // response, then `next_page_token` is included. To get the next set of
3321 // results, call this method again using the value of `next_page_token` as
3322 // `page_token`.
3323 NextPageToken string `json:"nextPageToken,omitempty"`
3324 // TcpRoutes: List of TcpRoute resources.
3325 TcpRoutes []*TcpRoute `json:"tcpRoutes,omitempty"`
3326 // Unreachable: Unreachable resources. Populated when the request opts into
3327 // return_partial_success and reading across collections e.g. when attempting
3328 // to list all resources across all supported locations.
3329 Unreachable []string `json:"unreachable,omitempty"`
3330
3331 // ServerResponse contains the HTTP response code and headers from the server.
3332 googleapi.ServerResponse `json:"-"`
3333 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
3334 // unconditionally include in API requests. By default, fields with empty or
3335 // default values are omitted from API requests. See
3336 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3337 // details.
3338 ForceSendFields []string `json:"-"`
3339 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
3340 // requests with the JSON null value. By default, fields with empty values are
3341 // omitted from API requests. See
3342 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3343 NullFields []string `json:"-"`
3344 }
3345
3346 func (s ListTcpRoutesResponse) MarshalJSON() ([]byte, error) {
3347 type NoMethod ListTcpRoutesResponse
3348 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3349 }
3350
3351 // ListTlsRoutesResponse: Response returned by the ListTlsRoutes method.
3352 type ListTlsRoutesResponse struct {
3353 // NextPageToken: If there might be more results than those appearing in this
3354 // response, then `next_page_token` is included. To get the next set of
3355 // results, call this method again using the value of `next_page_token` as
3356 // `page_token`.
3357 NextPageToken string `json:"nextPageToken,omitempty"`
3358 // TlsRoutes: List of TlsRoute resources.
3359 TlsRoutes []*TlsRoute `json:"tlsRoutes,omitempty"`
3360 // Unreachable: Unreachable resources. Populated when the request opts into
3361 // return_partial_success and reading across collections e.g. when attempting
3362 // to list all resources across all supported locations.
3363 Unreachable []string `json:"unreachable,omitempty"`
3364
3365 // ServerResponse contains the HTTP response code and headers from the server.
3366 googleapi.ServerResponse `json:"-"`
3367 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
3368 // unconditionally include in API requests. By default, fields with empty or
3369 // default values are omitted from API requests. See
3370 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3371 // details.
3372 ForceSendFields []string `json:"-"`
3373 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
3374 // requests with the JSON null value. By default, fields with empty values are
3375 // omitted from API requests. See
3376 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3377 NullFields []string `json:"-"`
3378 }
3379
3380 func (s ListTlsRoutesResponse) MarshalJSON() ([]byte, error) {
3381 type NoMethod ListTlsRoutesResponse
3382 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3383 }
3384
3385 // ListWasmPluginVersionsResponse: Response returned by the
3386 // `ListWasmPluginVersions` method.
3387 type ListWasmPluginVersionsResponse struct {
3388 // NextPageToken: If there might be more results than those appearing in this
3389 // response, then `next_page_token` is included. To get the next set of
3390 // results, call this method again using the value of `next_page_token` as
3391 // `page_token`.
3392 NextPageToken string `json:"nextPageToken,omitempty"`
3393 // Unreachable: Unreachable resources. Populated when the request attempts to
3394 // list all resources across all supported locations, while some locations are
3395 // temporarily unavailable.
3396 Unreachable []string `json:"unreachable,omitempty"`
3397 // WasmPluginVersions: List of `WasmPluginVersion` resources.
3398 WasmPluginVersions []*WasmPluginVersion `json:"wasmPluginVersions,omitempty"`
3399
3400 // ServerResponse contains the HTTP response code and headers from the server.
3401 googleapi.ServerResponse `json:"-"`
3402 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
3403 // unconditionally include in API requests. By default, fields with empty or
3404 // default values are omitted from API requests. See
3405 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3406 // details.
3407 ForceSendFields []string `json:"-"`
3408 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
3409 // requests with the JSON null value. By default, fields with empty values are
3410 // omitted from API requests. See
3411 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3412 NullFields []string `json:"-"`
3413 }
3414
3415 func (s ListWasmPluginVersionsResponse) MarshalJSON() ([]byte, error) {
3416 type NoMethod ListWasmPluginVersionsResponse
3417 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3418 }
3419
3420 // ListWasmPluginsResponse: Response returned by the `ListWasmPlugins` method.
3421 type ListWasmPluginsResponse struct {
3422 // NextPageToken: If there might be more results than those appearing in this
3423 // response, then `next_page_token` is included. To get the next set of
3424 // results, call this method again using the value of `next_page_token` as
3425 // `page_token`.
3426 NextPageToken string `json:"nextPageToken,omitempty"`
3427 // Unreachable: Unreachable resources. Populated when the request attempts to
3428 // list all resources across all supported locations, while some locations are
3429 // temporarily unavailable.
3430 Unreachable []string `json:"unreachable,omitempty"`
3431 // WasmPlugins: List of `WasmPlugin` resources.
3432 WasmPlugins []*WasmPlugin `json:"wasmPlugins,omitempty"`
3433
3434 // ServerResponse contains the HTTP response code and headers from the server.
3435 googleapi.ServerResponse `json:"-"`
3436 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
3437 // unconditionally include in API requests. By default, fields with empty or
3438 // default values are omitted from API requests. See
3439 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3440 // details.
3441 ForceSendFields []string `json:"-"`
3442 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
3443 // requests with the JSON null value. By default, fields with empty values are
3444 // omitted from API requests. See
3445 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3446 NullFields []string `json:"-"`
3447 }
3448
3449 func (s ListWasmPluginsResponse) MarshalJSON() ([]byte, error) {
3450 type NoMethod ListWasmPluginsResponse
3451 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3452 }
3453
3454 // Location: A resource that represents a Google Cloud location.
3455 type Location struct {
3456 // DisplayName: The friendly name for this location, typically a nearby city
3457 // name. For example, "Tokyo".
3458 DisplayName string `json:"displayName,omitempty"`
3459 // Labels: Cross-service attributes for the location. For example
3460 // {"cloud.googleapis.com/region": "us-east1"}
3461 Labels map[string]string `json:"labels,omitempty"`
3462 // LocationId: The canonical id for this location. For example: "us-east1".
3463 LocationId string `json:"locationId,omitempty"`
3464 // Metadata: Service-specific metadata. For example the available capacity at
3465 // the given location.
3466 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
3467 // Name: Resource name for the location, which may vary between
3468 // implementations. For example:
3469 // "projects/example-project/locations/us-east1"
3470 Name string `json:"name,omitempty"`
3471
3472 // ServerResponse contains the HTTP response code and headers from the server.
3473 googleapi.ServerResponse `json:"-"`
3474 // ForceSendFields is a list of field names (e.g. "DisplayName") to
3475 // unconditionally include in API requests. By default, fields with empty or
3476 // default values are omitted from API requests. See
3477 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3478 // details.
3479 ForceSendFields []string `json:"-"`
3480 // NullFields is a list of field names (e.g. "DisplayName") to include in API
3481 // requests with the JSON null value. By default, fields with empty values are
3482 // omitted from API requests. See
3483 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3484 NullFields []string `json:"-"`
3485 }
3486
3487 func (s Location) MarshalJSON() ([]byte, error) {
3488 type NoMethod Location
3489 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3490 }
3491
3492 // LoggingConfig: The configuration for Platform Telemetry logging for Eventarc
3493 // Advanced resources.
3494 type LoggingConfig struct {
3495 // LogSeverity: Optional. The minimum severity of logs that will be sent to
3496 // Stackdriver/Platform Telemetry. Logs at severitiy ≥ this value will be
3497 // sent, unless it is NONE.
3498 //
3499 // Possible values:
3500 // "LOG_SEVERITY_UNSPECIFIED" - Log severity is not specified. This value is
3501 // treated the same as NONE, but is used to distinguish between no update and
3502 // update to NONE in update_masks.
3503 // "NONE" - Default value at resource creation, presence of this value must
3504 // be treated as no logging/disable logging.
3505 // "DEBUG" - Debug or trace level logging.
3506 // "INFO" - Routine information, such as ongoing status or performance.
3507 // "NOTICE" - Normal but significant events, such as start up, shut down, or
3508 // a configuration change.
3509 // "WARNING" - Warning events might cause problems.
3510 // "ERROR" - Error events are likely to cause problems.
3511 // "CRITICAL" - Critical events cause more severe problems or outages.
3512 // "ALERT" - A person must take action immediately.
3513 // "EMERGENCY" - One or more systems are unusable.
3514 LogSeverity string `json:"logSeverity,omitempty"`
3515 // ForceSendFields is a list of field names (e.g. "LogSeverity") to
3516 // unconditionally include in API requests. By default, fields with empty or
3517 // default values are omitted from API requests. See
3518 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3519 // details.
3520 ForceSendFields []string `json:"-"`
3521 // NullFields is a list of field names (e.g. "LogSeverity") to include in API
3522 // requests with the JSON null value. By default, fields with empty values are
3523 // omitted from API requests. See
3524 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3525 NullFields []string `json:"-"`
3526 }
3527
3528 func (s LoggingConfig) MarshalJSON() ([]byte, error) {
3529 type NoMethod LoggingConfig
3530 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3531 }
3532
3533 // Mesh: Mesh represents a logical configuration grouping for workload to
3534 // workload communication within a service mesh. Routes that point to mesh
3535 // dictate how requests are routed within this logical mesh boundary.
3536 type Mesh struct {
3537 // CreateTime: Output only. The timestamp when the resource was created.
3538 CreateTime string `json:"createTime,omitempty"`
3539 // Description: Optional. A free-text description of the resource. Max length
3540 // 1024 characters.
3541 Description string `json:"description,omitempty"`
3542 // EnvoyHeaders: Optional. Determines if envoy will insert internal debug
3543 // headers into upstream requests. Other Envoy headers may still be injected.
3544 // By default, envoy will not insert any debug headers.
3545 //
3546 // Possible values:
3547 // "ENVOY_HEADERS_UNSPECIFIED" - Defaults to NONE.
3548 // "NONE" - Suppress envoy debug headers.
3549 // "DEBUG_HEADERS" - Envoy will insert default internal debug headers into
3550 // upstream requests: x-envoy-attempt-count, x-envoy-is-timeout-retry,
3551 // x-envoy-expected-rq-timeout-ms, x-envoy-original-path,
3552 // x-envoy-upstream-stream-duration-ms
3553 EnvoyHeaders string `json:"envoyHeaders,omitempty"`
3554 // InterceptionPort: Optional. If set to a valid TCP port (1-65535), instructs
3555 // the SIDECAR proxy to listen on the specified port of localhost (127.0.0.1)
3556 // address. The SIDECAR proxy will expect all traffic to be redirected to this
3557 // port regardless of its actual ip:port destination. If unset, a port '15001'
3558 // is used as the interception port. This is applicable only for sidecar proxy
3559 // deployments.
3560 InterceptionPort int64 `json:"interceptionPort,omitempty"`
3561 // Labels: Optional. Set of label tags associated with the Mesh resource.
3562 Labels map[string]string `json:"labels,omitempty"`
3563 // Name: Identifier. Name of the Mesh resource. It matches pattern
3564 // `projects/*/locations/*/meshes/`.
3565 Name string `json:"name,omitempty"`
3566 // SelfLink: Output only. Server-defined URL of this resource
3567 SelfLink string `json:"selfLink,omitempty"`
3568 // UpdateTime: Output only. The timestamp when the resource was updated.
3569 UpdateTime string `json:"updateTime,omitempty"`
3570
3571 // ServerResponse contains the HTTP response code and headers from the server.
3572 googleapi.ServerResponse `json:"-"`
3573 // ForceSendFields is a list of field names (e.g. "CreateTime") to
3574 // unconditionally include in API requests. By default, fields with empty or
3575 // default values are omitted from API requests. See
3576 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3577 // details.
3578 ForceSendFields []string `json:"-"`
3579 // NullFields is a list of field names (e.g. "CreateTime") to include in API
3580 // requests with the JSON null value. By default, fields with empty values are
3581 // omitted from API requests. See
3582 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3583 NullFields []string `json:"-"`
3584 }
3585
3586 func (s Mesh) MarshalJSON() ([]byte, error) {
3587 type NoMethod Mesh
3588 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3589 }
3590
3591 // MeshRouteView: MeshRouteView defines view-only resource for Routes to a Mesh
3592 type MeshRouteView struct {
3593 // Name: Output only. Identifier. Full path name of the MeshRouteView resource.
3594 // Format:
3595 // projects/{project_number}/locations/{location}/meshes/{mesh}/routeViews/{rout
3596 // e_view}
3597 Name string `json:"name,omitempty"`
3598 // RouteId: Output only. The resource id for the route.
3599 RouteId string `json:"routeId,omitempty"`
3600 // RouteLocation: Output only. Location where the route exists.
3601 RouteLocation string `json:"routeLocation,omitempty"`
3602 // RouteProjectNumber: Output only. Project number where the route exists.
3603 RouteProjectNumber int64 `json:"routeProjectNumber,omitempty,string"`
3604 // RouteType: Output only. Type of the route: HttpRoute,GrpcRoute,TcpRoute, or
3605 // TlsRoute
3606 RouteType string `json:"routeType,omitempty"`
3607
3608 // ServerResponse contains the HTTP response code and headers from the server.
3609 googleapi.ServerResponse `json:"-"`
3610 // ForceSendFields is a list of field names (e.g. "Name") to unconditionally
3611 // include in API requests. By default, fields with empty or default values are
3612 // omitted from API requests. See
3613 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3614 // details.
3615 ForceSendFields []string `json:"-"`
3616 // NullFields is a list of field names (e.g. "Name") to include in API requests
3617 // with the JSON null value. By default, fields with empty values are omitted
3618 // from API requests. See
3619 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3620 NullFields []string `json:"-"`
3621 }
3622
3623 func (s MeshRouteView) MarshalJSON() ([]byte, error) {
3624 type NoMethod MeshRouteView
3625 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3626 }
3627
3628 // MetadataLabelMatcher: The matcher that is based on node metadata presented
3629 // by xDS clients.
3630 type MetadataLabelMatcher struct {
3631 // MetadataLabelMatchCriteria: Specifies how matching should be done. Supported
3632 // values are: MATCH_ANY: At least one of the Labels specified in the matcher
3633 // should match the metadata presented by xDS client. MATCH_ALL: The metadata
3634 // presented by the xDS client should contain all of the labels specified here.
3635 // The selection is determined based on the best match. For example, suppose
3636 // there are three EndpointPolicy resources P1, P2 and P3 and if P1 has a the
3637 // matcher as MATCH_ANY , P2 has MATCH_ALL , and P3 has MATCH_ALL . If a client
3638 // with label connects, the config from P1 will be selected. If a client with
3639 // label connects, the config from P2 will be selected. If a client with label
3640 // connects, the config from P3 will be selected. If there is more than one
3641 // best match, (for example, if a config P4 with selector exists and if a
3642 // client with label connects), pick up the one with older creation time.
3643 //
3644 // Possible values:
3645 // "METADATA_LABEL_MATCH_CRITERIA_UNSPECIFIED" - Default value. Should not be
3646 // used.
3647 // "MATCH_ANY" - At least one of the Labels specified in the matcher should
3648 // match the metadata presented by xDS client.
3649 // "MATCH_ALL" - The metadata presented by the xDS client should contain all
3650 // of the labels specified here.
3651 MetadataLabelMatchCriteria string `json:"metadataLabelMatchCriteria,omitempty"`
3652 // MetadataLabels: The list of label value pairs that must match labels in the
3653 // provided metadata based on filterMatchCriteria This list can have at most 64
3654 // entries. The list can be empty if the match criteria is MATCH_ANY, to
3655 // specify a wildcard match (i.e this matches any client).
3656 MetadataLabels []*MetadataLabels `json:"metadataLabels,omitempty"`
3657 // ForceSendFields is a list of field names (e.g. "MetadataLabelMatchCriteria")
3658 // to unconditionally include in API requests. By default, fields with empty or
3659 // default values are omitted from API requests. See
3660 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3661 // details.
3662 ForceSendFields []string `json:"-"`
3663 // NullFields is a list of field names (e.g. "MetadataLabelMatchCriteria") to
3664 // include in API requests with the JSON null value. By default, fields with
3665 // empty values are omitted from API requests. See
3666 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3667 NullFields []string `json:"-"`
3668 }
3669
3670 func (s MetadataLabelMatcher) MarshalJSON() ([]byte, error) {
3671 type NoMethod MetadataLabelMatcher
3672 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3673 }
3674
3675 // MetadataLabels: Defines a name-pair value for a single label.
3676 type MetadataLabels struct {
3677 // LabelName: Required. Label name presented as key in xDS Node Metadata.
3678 LabelName string `json:"labelName,omitempty"`
3679 // LabelValue: Required. Label value presented as value corresponding to the
3680 // above key, in xDS Node Metadata.
3681 LabelValue string `json:"labelValue,omitempty"`
3682 // ForceSendFields is a list of field names (e.g. "LabelName") to
3683 // unconditionally include in API requests. By default, fields with empty or
3684 // default values are omitted from API requests. See
3685 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3686 // details.
3687 ForceSendFields []string `json:"-"`
3688 // NullFields is a list of field names (e.g. "LabelName") to include in API
3689 // requests with the JSON null value. By default, fields with empty values are
3690 // omitted from API requests. See
3691 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3692 NullFields []string `json:"-"`
3693 }
3694
3695 func (s MetadataLabels) MarshalJSON() ([]byte, error) {
3696 type NoMethod MetadataLabels
3697 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3698 }
3699
3700 // Operation: This resource represents a long-running operation that is the
3701 // result of a network API call.
3702 type Operation struct {
3703 // Done: If the value is `false`, it means the operation is still in progress.
3704 // If `true`, the operation is completed, and either `error` or `response` is
3705 // available.
3706 Done bool `json:"done,omitempty"`
3707 // Error: The error result of the operation in case of failure or cancellation.
3708 Error *Status `json:"error,omitempty"`
3709 // Metadata: Service-specific metadata associated with the operation. It
3710 // typically contains progress information and common metadata such as create
3711 // time. Some services might not provide such metadata. Any method that returns
3712 // a long-running operation should document the metadata type, if any.
3713 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
3714 // Name: The server-assigned name, which is only unique within the same service
3715 // that originally returns it. If you use the default HTTP mapping, the `name`
3716 // should be a resource name ending with `operations/{unique_id}`.
3717 Name string `json:"name,omitempty"`
3718 // Response: The normal, successful response of the operation. If the original
3719 // method returns no data on success, such as `Delete`, the response is
3720 // `google.protobuf.Empty`. If the original method is standard
3721 // `Get`/`Create`/`Update`, the response should be the resource. For other
3722 // methods, the response should have the type `XxxResponse`, where `Xxx` is the
3723 // original method name. For example, if the original method name is
3724 // `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
3725 Response googleapi.RawMessage `json:"response,omitempty"`
3726
3727 // ServerResponse contains the HTTP response code and headers from the server.
3728 googleapi.ServerResponse `json:"-"`
3729 // ForceSendFields is a list of field names (e.g. "Done") to unconditionally
3730 // include in API requests. By default, fields with empty or default values are
3731 // omitted from API requests. See
3732 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3733 // details.
3734 ForceSendFields []string `json:"-"`
3735 // NullFields is a list of field names (e.g. "Done") to include in API requests
3736 // with the JSON null value. By default, fields with empty values are omitted
3737 // from API requests. See
3738 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3739 NullFields []string `json:"-"`
3740 }
3741
3742 func (s Operation) MarshalJSON() ([]byte, error) {
3743 type NoMethod Operation
3744 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3745 }
3746
3747 // OperationMetadata: Represents the metadata of the long-running operation.
3748 type OperationMetadata struct {
3749 // ApiVersion: Output only. API version used to start the operation.
3750 ApiVersion string `json:"apiVersion,omitempty"`
3751 // CreateTime: Output only. The time the operation was created.
3752 CreateTime string `json:"createTime,omitempty"`
3753 // EndTime: Output only. The time the operation finished running.
3754 EndTime string `json:"endTime,omitempty"`
3755 // RequestedCancellation: Output only. Identifies whether the user has
3756 // requested cancellation of the operation. Operations that have successfully
3757 // been cancelled have Operation.error value with a google.rpc.Status.code of
3758 // 1, corresponding to `Code.CANCELLED`.
3759 RequestedCancellation bool `json:"requestedCancellation,omitempty"`
3760 // StatusMessage: Output only. Human-readable status of the operation, if any.
3761 StatusMessage string `json:"statusMessage,omitempty"`
3762 // Target: Output only. Server-defined resource path for the target of the
3763 // operation.
3764 Target string `json:"target,omitempty"`
3765 // Verb: Output only. Name of the verb executed by the operation.
3766 Verb string `json:"verb,omitempty"`
3767 // ForceSendFields is a list of field names (e.g. "ApiVersion") to
3768 // unconditionally include in API requests. By default, fields with empty or
3769 // default values are omitted from API requests. See
3770 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3771 // details.
3772 ForceSendFields []string `json:"-"`
3773 // NullFields is a list of field names (e.g. "ApiVersion") to include in API
3774 // requests with the JSON null value. By default, fields with empty values are
3775 // omitted from API requests. See
3776 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3777 NullFields []string `json:"-"`
3778 }
3779
3780 func (s OperationMetadata) MarshalJSON() ([]byte, error) {
3781 type NoMethod OperationMetadata
3782 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3783 }
3784
3785 type RetryFilterPerRouteConfig struct {
3786 // CryptoKeyName: The name of the crypto key to use for encrypting event data.
3787 CryptoKeyName string `json:"cryptoKeyName,omitempty"`
3788 // ForceSendFields is a list of field names (e.g. "CryptoKeyName") to
3789 // unconditionally include in API requests. By default, fields with empty or
3790 // default values are omitted from API requests. See
3791 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3792 // details.
3793 ForceSendFields []string `json:"-"`
3794 // NullFields is a list of field names (e.g. "CryptoKeyName") to include in API
3795 // requests with the JSON null value. By default, fields with empty values are
3796 // omitted from API requests. See
3797 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3798 NullFields []string `json:"-"`
3799 }
3800
3801 func (s RetryFilterPerRouteConfig) MarshalJSON() ([]byte, error) {
3802 type NoMethod RetryFilterPerRouteConfig
3803 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3804 }
3805
3806 // ServiceBinding: ServiceBinding can be used to: - Bind a Service Directory
3807 // Service to be used in a BackendService resource. This feature will be
3808 // deprecated soon. - Bind a Private Service Connect producer service to be
3809 // used in consumer Cloud Service Mesh or Application Load Balancers. - Bind a
3810 // Cloud Run service to be used in consumer Cloud Service Mesh or Application
3811 // Load Balancers.
3812 type ServiceBinding struct {
3813 // CreateTime: Output only. The timestamp when the resource was created.
3814 CreateTime string `json:"createTime,omitempty"`
3815 // Description: Optional. A free-text description of the resource. Max length
3816 // 1024 characters.
3817 Description string `json:"description,omitempty"`
3818 // Labels: Optional. Set of label tags associated with the ServiceBinding
3819 // resource.
3820 Labels map[string]string `json:"labels,omitempty"`
3821 // Name: Identifier. Name of the ServiceBinding resource. It matches pattern
3822 // `projects/*/locations/*/serviceBindings/`.
3823 Name string `json:"name,omitempty"`
3824 // Service: Optional. The full Service Directory Service name of the format
3825 // `projects/*/locations/*/namespaces/*/services/*`. This field is for Service
3826 // Directory integration which will be deprecated soon.
3827 Service string `json:"service,omitempty"`
3828 // ServiceId: Output only. The unique identifier of the Service Directory
3829 // Service against which the ServiceBinding resource is validated. This is
3830 // populated when the Service Binding resource is used in another resource
3831 // (like Backend Service). This is of the UUID4 format. This field is for
3832 // Service Directory integration which will be deprecated soon.
3833 ServiceId string `json:"serviceId,omitempty"`
3834 // UpdateTime: Output only. The timestamp when the resource was updated.
3835 UpdateTime string `json:"updateTime,omitempty"`
3836
3837 // ServerResponse contains the HTTP response code and headers from the server.
3838 googleapi.ServerResponse `json:"-"`
3839 // ForceSendFields is a list of field names (e.g. "CreateTime") to
3840 // unconditionally include in API requests. By default, fields with empty or
3841 // default values are omitted from API requests. See
3842 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3843 // details.
3844 ForceSendFields []string `json:"-"`
3845 // NullFields is a list of field names (e.g. "CreateTime") to include in API
3846 // requests with the JSON null value. By default, fields with empty values are
3847 // omitted from API requests. See
3848 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3849 NullFields []string `json:"-"`
3850 }
3851
3852 func (s ServiceBinding) MarshalJSON() ([]byte, error) {
3853 type NoMethod ServiceBinding
3854 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3855 }
3856
3857 // ServiceLbPolicy: ServiceLbPolicy holds global load balancing and traffic
3858 // distribution configuration that can be applied to a BackendService.
3859 type ServiceLbPolicy struct {
3860 // AutoCapacityDrain: Optional. Configuration to automatically move traffic
3861 // away for unhealthy IG/NEG for the associated Backend Service.
3862 AutoCapacityDrain *ServiceLbPolicyAutoCapacityDrain `json:"autoCapacityDrain,omitempty"`
3863 // CreateTime: Output only. The timestamp when this resource was created.
3864 CreateTime string `json:"createTime,omitempty"`
3865 // Description: Optional. A free-text description of the resource. Max length
3866 // 1024 characters.
3867 Description string `json:"description,omitempty"`
3868 // FailoverConfig: Optional. Configuration related to health based failover.
3869 FailoverConfig *ServiceLbPolicyFailoverConfig `json:"failoverConfig,omitempty"`
3870 // IsolationConfig: Optional. Configuration to provide isolation support for
3871 // the associated Backend Service.
3872 IsolationConfig *ServiceLbPolicyIsolationConfig `json:"isolationConfig,omitempty"`
3873 // Labels: Optional. Set of label tags associated with the ServiceLbPolicy
3874 // resource.
3875 Labels map[string]string `json:"labels,omitempty"`
3876 // LoadBalancingAlgorithm: Optional. The type of load balancing algorithm to be
3877 // used. The default behavior is WATERFALL_BY_REGION.
3878 //
3879 // Possible values:
3880 // "LOAD_BALANCING_ALGORITHM_UNSPECIFIED" - The type of the loadbalancing
3881 // algorithm is unspecified.
3882 // "SPRAY_TO_WORLD" - Balance traffic across all backends across the world
3883 // proportionally based on capacity.
3884 // "SPRAY_TO_REGION" - Direct traffic to the nearest region with endpoints
3885 // and capacity before spilling over to other regions and spread the traffic
3886 // from each client to all the MIGs/NEGs in a region.
3887 // "WATERFALL_BY_REGION" - Direct traffic to the nearest region with
3888 // endpoints and capacity before spilling over to other regions. All MIGs/NEGs
3889 // within a region are evenly loaded but each client might not spread the
3890 // traffic to all the MIGs/NEGs in the region.
3891 // "WATERFALL_BY_ZONE" - Attempt to keep traffic in a single zone closest to
3892 // the client, before spilling over to other zones.
3893 LoadBalancingAlgorithm string `json:"loadBalancingAlgorithm,omitempty"`
3894 // Name: Identifier. Name of the ServiceLbPolicy resource. It matches pattern
3895 // `projects/{project}/locations/{location}/serviceLbPolicies/{service_lb_policy
3896 // _name}`.
3897 Name string `json:"name,omitempty"`
3898 // UpdateTime: Output only. The timestamp when this resource was last updated.
3899 UpdateTime string `json:"updateTime,omitempty"`
3900
3901 // ServerResponse contains the HTTP response code and headers from the server.
3902 googleapi.ServerResponse `json:"-"`
3903 // ForceSendFields is a list of field names (e.g. "AutoCapacityDrain") to
3904 // unconditionally include in API requests. By default, fields with empty or
3905 // default values are omitted from API requests. See
3906 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3907 // details.
3908 ForceSendFields []string `json:"-"`
3909 // NullFields is a list of field names (e.g. "AutoCapacityDrain") to include in
3910 // API requests with the JSON null value. By default, fields with empty values
3911 // are omitted from API requests. See
3912 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3913 NullFields []string `json:"-"`
3914 }
3915
3916 func (s ServiceLbPolicy) MarshalJSON() ([]byte, error) {
3917 type NoMethod ServiceLbPolicy
3918 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3919 }
3920
3921 // ServiceLbPolicyAutoCapacityDrain: Option to specify if an unhealthy IG/NEG
3922 // should be considered for global load balancing and traffic routing.
3923 type ServiceLbPolicyAutoCapacityDrain struct {
3924 // Enable: Optional. If set to 'True', an unhealthy IG/NEG will be set as
3925 // drained. - An IG/NEG is considered unhealthy if less than 25% of the
3926 // instances/endpoints in the IG/NEG are healthy. - This option will never
3927 // result in draining more than 50% of the configured IGs/NEGs for the Backend
3928 // Service.
3929 Enable bool `json:"enable,omitempty"`
3930 // ForceSendFields is a list of field names (e.g. "Enable") to unconditionally
3931 // include in API requests. By default, fields with empty or default values are
3932 // omitted from API requests. See
3933 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3934 // details.
3935 ForceSendFields []string `json:"-"`
3936 // NullFields is a list of field names (e.g. "Enable") to include in API
3937 // requests with the JSON null value. By default, fields with empty values are
3938 // omitted from API requests. See
3939 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3940 NullFields []string `json:"-"`
3941 }
3942
3943 func (s ServiceLbPolicyAutoCapacityDrain) MarshalJSON() ([]byte, error) {
3944 type NoMethod ServiceLbPolicyAutoCapacityDrain
3945 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3946 }
3947
3948 // ServiceLbPolicyFailoverConfig: Option to specify health based failover
3949 // behavior. This is not related to Network load balancer FailoverPolicy.
3950 type ServiceLbPolicyFailoverConfig struct {
3951 // FailoverHealthThreshold: Optional. The percentage threshold that a load
3952 // balancer will begin to send traffic to failover backends. If the percentage
3953 // of endpoints in a MIG/NEG is smaller than this value, traffic would be sent
3954 // to failover backends if possible. This field should be set to a value
3955 // between 1 and 99. The default value is 50 for Global external HTTP(S) load
3956 // balancer (classic) and Proxyless service mesh, and 70 for others.
3957 FailoverHealthThreshold int64 `json:"failoverHealthThreshold,omitempty"`
3958 // ForceSendFields is a list of field names (e.g. "FailoverHealthThreshold") 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. "FailoverHealthThreshold") to
3965 // include in API requests with the JSON null value. By default, fields with
3966 // empty 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 ServiceLbPolicyFailoverConfig) MarshalJSON() ([]byte, error) {
3972 type NoMethod ServiceLbPolicyFailoverConfig
3973 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3974 }
3975
3976 // ServiceLbPolicyIsolationConfig: Configuration to provide isolation support
3977 // for the associated Backend Service.
3978 type ServiceLbPolicyIsolationConfig struct {
3979 // IsolationGranularity: Optional. The isolation granularity of the load
3980 // balancer.
3981 //
3982 // Possible values:
3983 // "ISOLATION_GRANULARITY_UNSPECIFIED" - No isolation is configured for the
3984 // backend service. Traffic can overflow based on the load balancing algorithm.
3985 // "REGION" - Traffic for this service will be isolated at the cloud region
3986 // level.
3987 IsolationGranularity string `json:"isolationGranularity,omitempty"`
3988 // IsolationMode: Optional. The isolation mode of the load balancer.
3989 //
3990 // Possible values:
3991 // "ISOLATION_MODE_UNSPECIFIED" - No isolation mode is configured for the
3992 // backend service.
3993 // "NEAREST" - Traffic will be sent to the nearest region.
3994 // "STRICT" - Traffic will fail if no serving backends are available in the
3995 // same region as the load balancer.
3996 IsolationMode string `json:"isolationMode,omitempty"`
3997 // ForceSendFields is a list of field names (e.g. "IsolationGranularity") to
3998 // unconditionally include in API requests. By default, fields with empty or
3999 // default values are omitted from API requests. See
4000 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4001 // details.
4002 ForceSendFields []string `json:"-"`
4003 // NullFields is a list of field names (e.g. "IsolationGranularity") to include
4004 // in API requests with the JSON null value. By default, fields with empty
4005 // values are omitted from API requests. See
4006 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4007 NullFields []string `json:"-"`
4008 }
4009
4010 func (s ServiceLbPolicyIsolationConfig) MarshalJSON() ([]byte, error) {
4011 type NoMethod ServiceLbPolicyIsolationConfig
4012 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4013 }
4014
4015 // Status: The `Status` type defines a logical error model that is suitable for
4016 // different programming environments, including REST APIs and RPC APIs. It is
4017 // used by gRPC (https://github.com/grpc). Each `Status` message contains three
4018 // pieces of data: error code, error message, and error details. You can find
4019 // out more about this error model and how to work with it in the API Design
4020 // Guide (https://cloud.google.com/apis/design/errors).
4021 type Status struct {
4022 // Code: The status code, which should be an enum value of google.rpc.Code.
4023 Code int64 `json:"code,omitempty"`
4024 // Details: A list of messages that carry the error details. There is a common
4025 // set of message types for APIs to use.
4026 Details []googleapi.RawMessage `json:"details,omitempty"`
4027 // Message: A developer-facing error message, which should be in English. Any
4028 // user-facing error message should be localized and sent in the
4029 // google.rpc.Status.details field, or localized by the client.
4030 Message string `json:"message,omitempty"`
4031 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally
4032 // include in API requests. By default, fields with empty or default values are
4033 // omitted from API requests. See
4034 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4035 // details.
4036 ForceSendFields []string `json:"-"`
4037 // NullFields is a list of field names (e.g. "Code") to include in API requests
4038 // with the JSON null value. By default, fields with empty values are omitted
4039 // from API requests. See
4040 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4041 NullFields []string `json:"-"`
4042 }
4043
4044 func (s Status) MarshalJSON() ([]byte, error) {
4045 type NoMethod Status
4046 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4047 }
4048
4049 // TcpRoute: TcpRoute is the resource defining how TCP traffic should be routed
4050 // by a Mesh/Gateway resource.
4051 type TcpRoute struct {
4052 // CreateTime: Output only. The timestamp when the resource was created.
4053 CreateTime string `json:"createTime,omitempty"`
4054 // Description: Optional. A free-text description of the resource. Max length
4055 // 1024 characters.
4056 Description string `json:"description,omitempty"`
4057 // Gateways: Optional. Gateways defines a list of gateways this TcpRoute is
4058 // attached to, as one of the routing rules to route the requests served by the
4059 // gateway. Each gateway reference should match the pattern:
4060 // `projects/*/locations/*/gateways/`
4061 Gateways []string `json:"gateways,omitempty"`
4062 // Labels: Optional. Set of label tags associated with the TcpRoute resource.
4063 Labels map[string]string `json:"labels,omitempty"`
4064 // Meshes: Optional. Meshes defines a list of meshes this TcpRoute is attached
4065 // to, as one of the routing rules to route the requests served by the mesh.
4066 // Each mesh reference should match the pattern:
4067 // `projects/*/locations/*/meshes/` The attached Mesh should be of a type
4068 // SIDECAR
4069 Meshes []string `json:"meshes,omitempty"`
4070 // Name: Identifier. Name of the TcpRoute resource. It matches pattern
4071 // `projects/*/locations/*/tcpRoutes/tcp_route_name>`.
4072 Name string `json:"name,omitempty"`
4073 // Rules: Required. Rules that define how traffic is routed and handled. At
4074 // least one RouteRule must be supplied. If there are multiple rules then the
4075 // action taken will be the first rule to match.
4076 Rules []*TcpRouteRouteRule `json:"rules,omitempty"`
4077 // SelfLink: Output only. Server-defined URL of this resource
4078 SelfLink string `json:"selfLink,omitempty"`
4079 // UpdateTime: Output only. The timestamp when the resource was updated.
4080 UpdateTime string `json:"updateTime,omitempty"`
4081
4082 // ServerResponse contains the HTTP response code and headers from the server.
4083 googleapi.ServerResponse `json:"-"`
4084 // ForceSendFields is a list of field names (e.g. "CreateTime") to
4085 // unconditionally include in API requests. By default, fields with empty or
4086 // default values are omitted from API requests. See
4087 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4088 // details.
4089 ForceSendFields []string `json:"-"`
4090 // NullFields is a list of field names (e.g. "CreateTime") to include in API
4091 // requests with the JSON null value. By default, fields with empty values are
4092 // omitted from API requests. See
4093 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4094 NullFields []string `json:"-"`
4095 }
4096
4097 func (s TcpRoute) MarshalJSON() ([]byte, error) {
4098 type NoMethod TcpRoute
4099 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4100 }
4101
4102 // TcpRouteRouteAction: The specifications for routing traffic and applying
4103 // associated policies.
4104 type TcpRouteRouteAction struct {
4105 // Destinations: Optional. The destination services to which traffic should be
4106 // forwarded. At least one destination service is required. Only one of route
4107 // destination or original destination can be set.
4108 Destinations []*TcpRouteRouteDestination `json:"destinations,omitempty"`
4109 // IdleTimeout: Optional. Specifies the idle timeout for the selected route.
4110 // The idle timeout is defined as the period in which there are no bytes sent
4111 // or received on either the upstream or downstream connection. If not set, the
4112 // default idle timeout is 30 seconds. If set to 0s, the timeout will be
4113 // disabled.
4114 IdleTimeout string `json:"idleTimeout,omitempty"`
4115 // OriginalDestination: Optional. If true, Router will use the destination IP
4116 // and port of the original connection as the destination of the request.
4117 // Default is false. Only one of route destinations or original destination can
4118 // be set.
4119 OriginalDestination bool `json:"originalDestination,omitempty"`
4120 // ForceSendFields is a list of field names (e.g. "Destinations") to
4121 // unconditionally include in API requests. By default, fields with empty or
4122 // default values are omitted from API requests. See
4123 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4124 // details.
4125 ForceSendFields []string `json:"-"`
4126 // NullFields is a list of field names (e.g. "Destinations") to include in API
4127 // requests with the JSON null value. By default, fields with empty values are
4128 // omitted from API requests. See
4129 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4130 NullFields []string `json:"-"`
4131 }
4132
4133 func (s TcpRouteRouteAction) MarshalJSON() ([]byte, error) {
4134 type NoMethod TcpRouteRouteAction
4135 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4136 }
4137
4138 // TcpRouteRouteDestination: Describe the destination for traffic to be routed
4139 // to.
4140 type TcpRouteRouteDestination struct {
4141 // ServiceName: Required. The URL of a BackendService to route traffic to.
4142 ServiceName string `json:"serviceName,omitempty"`
4143 // Weight: Optional. Specifies the proportion of requests forwarded to the
4144 // backend referenced by the serviceName field. This is computed as: -
4145 // weight/Sum(weights in this destination list). For non-zero values, there may
4146 // be some epsilon from the exact proportion defined here depending on the
4147 // precision an implementation supports. If only one serviceName is specified
4148 // and it has a weight greater than 0, 100% of the traffic is forwarded to that
4149 // backend. If weights are specified for any one service name, they need to be
4150 // specified for all of them. If weights are unspecified for all services,
4151 // then, traffic is distributed in equal proportions to all of them.
4152 Weight int64 `json:"weight,omitempty"`
4153 // ForceSendFields is a list of field names (e.g. "ServiceName") to
4154 // unconditionally include in API requests. By default, fields with empty or
4155 // default values are omitted from API requests. See
4156 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4157 // details.
4158 ForceSendFields []string `json:"-"`
4159 // NullFields is a list of field names (e.g. "ServiceName") to include in API
4160 // requests with the JSON null value. By default, fields with empty values are
4161 // omitted from API requests. See
4162 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4163 NullFields []string `json:"-"`
4164 }
4165
4166 func (s TcpRouteRouteDestination) MarshalJSON() ([]byte, error) {
4167 type NoMethod TcpRouteRouteDestination
4168 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4169 }
4170
4171 // TcpRouteRouteMatch: RouteMatch defines the predicate used to match requests
4172 // to a given action. Multiple match types are "OR"ed for evaluation. If no
4173 // routeMatch field is specified, this rule will unconditionally match traffic.
4174 type TcpRouteRouteMatch struct {
4175 // Address: Required. Must be specified in the CIDR range format. A CIDR range
4176 // consists of an IP Address and a prefix length to construct the subnet mask.
4177 // By default, the prefix length is 32 (i.e. matches a single IP address). Only
4178 // IPV4 addresses are supported. Examples: "10.0.0.1" - matches against this
4179 // exact IP address. "10.0.0.0/8" - matches against any IP address within the
4180 // 10.0.0.0 subnet and 255.255.255.0 mask. "0.0.0.0/0" - matches against any IP
4181 // address'.
4182 Address string `json:"address,omitempty"`
4183 // Port: Required. Specifies the destination port to match against.
4184 Port string `json:"port,omitempty"`
4185 // ForceSendFields is a list of field names (e.g. "Address") to unconditionally
4186 // include in API requests. By default, fields with empty or default values are
4187 // omitted from API requests. See
4188 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4189 // details.
4190 ForceSendFields []string `json:"-"`
4191 // NullFields is a list of field names (e.g. "Address") to include in API
4192 // requests with the JSON null value. By default, fields with empty values are
4193 // omitted from API requests. See
4194 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4195 NullFields []string `json:"-"`
4196 }
4197
4198 func (s TcpRouteRouteMatch) MarshalJSON() ([]byte, error) {
4199 type NoMethod TcpRouteRouteMatch
4200 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4201 }
4202
4203 // TcpRouteRouteRule: Specifies how to match traffic and how to route traffic
4204 // when traffic is matched.
4205 type TcpRouteRouteRule struct {
4206 // Action: Required. The detailed rule defining how to route matched traffic.
4207 Action *TcpRouteRouteAction `json:"action,omitempty"`
4208 // Matches: Optional. RouteMatch defines the predicate used to match requests
4209 // to a given action. Multiple match types are "OR"ed for evaluation. If no
4210 // routeMatch field is specified, this rule will unconditionally match traffic.
4211 Matches []*TcpRouteRouteMatch `json:"matches,omitempty"`
4212 // ForceSendFields is a list of field names (e.g. "Action") to unconditionally
4213 // include in API requests. By default, fields with empty or default values are
4214 // omitted from API requests. See
4215 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4216 // details.
4217 ForceSendFields []string `json:"-"`
4218 // NullFields is a list of field names (e.g. "Action") to include in API
4219 // requests with the JSON null value. By default, fields with empty values are
4220 // omitted from API requests. See
4221 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4222 NullFields []string `json:"-"`
4223 }
4224
4225 func (s TcpRouteRouteRule) MarshalJSON() ([]byte, error) {
4226 type NoMethod TcpRouteRouteRule
4227 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4228 }
4229
4230 // TlsRoute: TlsRoute defines how traffic should be routed based on SNI and
4231 // other matching L3 attributes.
4232 type TlsRoute struct {
4233 // CreateTime: Output only. The timestamp when the resource was created.
4234 CreateTime string `json:"createTime,omitempty"`
4235 // Description: Optional. A free-text description of the resource. Max length
4236 // 1024 characters.
4237 Description string `json:"description,omitempty"`
4238 // Gateways: Optional. Gateways defines a list of gateways this TlsRoute is
4239 // attached to, as one of the routing rules to route the requests served by the
4240 // gateway. Each gateway reference should match the pattern:
4241 // `projects/*/locations/*/gateways/`
4242 Gateways []string `json:"gateways,omitempty"`
4243 // Labels: Optional. Set of label tags associated with the TlsRoute resource.
4244 Labels map[string]string `json:"labels,omitempty"`
4245 // Meshes: Optional. Meshes defines a list of meshes this TlsRoute is attached
4246 // to, as one of the routing rules to route the requests served by the mesh.
4247 // Each mesh reference should match the pattern:
4248 // `projects/*/locations/*/meshes/` The attached Mesh should be of a type
4249 // SIDECAR
4250 Meshes []string `json:"meshes,omitempty"`
4251 // Name: Identifier. Name of the TlsRoute resource. It matches pattern
4252 // `projects/*/locations/*/tlsRoutes/tls_route_name>`.
4253 Name string `json:"name,omitempty"`
4254 // Rules: Required. Rules that define how traffic is routed and handled. At
4255 // least one RouteRule must be supplied. If there are multiple rules then the
4256 // action taken will be the first rule to match.
4257 Rules []*TlsRouteRouteRule `json:"rules,omitempty"`
4258 // SelfLink: Output only. Server-defined URL of this resource
4259 SelfLink string `json:"selfLink,omitempty"`
4260 // TargetProxies: Optional. TargetProxies defines a list of TargetTcpProxies
4261 // this TlsRoute is attached to, as one of the routing rules to route the
4262 // requests served by the TargetTcpProxy. Each TargetTcpProxy reference should
4263 // match the pattern: `projects/*/locations/*/targetTcpProxies/`
4264 TargetProxies []string `json:"targetProxies,omitempty"`
4265 // UpdateTime: Output only. The timestamp when the resource was updated.
4266 UpdateTime string `json:"updateTime,omitempty"`
4267
4268 // ServerResponse contains the HTTP response code and headers from the server.
4269 googleapi.ServerResponse `json:"-"`
4270 // ForceSendFields is a list of field names (e.g. "CreateTime") to
4271 // unconditionally include in API requests. By default, fields with empty or
4272 // default values are omitted from API requests. See
4273 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4274 // details.
4275 ForceSendFields []string `json:"-"`
4276 // NullFields is a list of field names (e.g. "CreateTime") to include in API
4277 // requests with the JSON null value. By default, fields with empty values are
4278 // omitted from API requests. See
4279 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4280 NullFields []string `json:"-"`
4281 }
4282
4283 func (s TlsRoute) MarshalJSON() ([]byte, error) {
4284 type NoMethod TlsRoute
4285 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4286 }
4287
4288 // TlsRouteRouteAction: The specifications for routing traffic and applying
4289 // associated policies.
4290 type TlsRouteRouteAction struct {
4291 // Destinations: Required. The destination services to which traffic should be
4292 // forwarded. At least one destination service is required.
4293 Destinations []*TlsRouteRouteDestination `json:"destinations,omitempty"`
4294 // IdleTimeout: Optional. Specifies the idle timeout for the selected route.
4295 // The idle timeout is defined as the period in which there are no bytes sent
4296 // or received on either the upstream or downstream connection. If not set, the
4297 // default idle timeout is 1 hour. If set to 0s, the timeout will be disabled.
4298 IdleTimeout string `json:"idleTimeout,omitempty"`
4299 // ForceSendFields is a list of field names (e.g. "Destinations") to
4300 // unconditionally include in API requests. By default, fields with empty or
4301 // default values are omitted from API requests. See
4302 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4303 // details.
4304 ForceSendFields []string `json:"-"`
4305 // NullFields is a list of field names (e.g. "Destinations") to include in API
4306 // requests with the JSON null value. By default, fields with empty values are
4307 // omitted from API requests. See
4308 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4309 NullFields []string `json:"-"`
4310 }
4311
4312 func (s TlsRouteRouteAction) MarshalJSON() ([]byte, error) {
4313 type NoMethod TlsRouteRouteAction
4314 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4315 }
4316
4317 // TlsRouteRouteDestination: Describe the destination for traffic to be routed
4318 // to.
4319 type TlsRouteRouteDestination struct {
4320 // ServiceName: Required. The URL of a BackendService to route traffic to.
4321 ServiceName string `json:"serviceName,omitempty"`
4322 // Weight: Optional. Specifies the proportion of requests forwarded to the
4323 // backend referenced by the service_name field. This is computed as: -
4324 // weight/Sum(weights in destinations) Weights in all destinations does not
4325 // need to sum up to 100.
4326 Weight int64 `json:"weight,omitempty"`
4327 // ForceSendFields is a list of field names (e.g. "ServiceName") to
4328 // unconditionally include in API requests. By default, fields with empty or
4329 // default values are omitted from API requests. See
4330 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4331 // details.
4332 ForceSendFields []string `json:"-"`
4333 // NullFields is a list of field names (e.g. "ServiceName") to include in API
4334 // requests with the JSON null value. By default, fields with empty values are
4335 // omitted from API requests. See
4336 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4337 NullFields []string `json:"-"`
4338 }
4339
4340 func (s TlsRouteRouteDestination) MarshalJSON() ([]byte, error) {
4341 type NoMethod TlsRouteRouteDestination
4342 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4343 }
4344
4345 // TlsRouteRouteMatch: RouteMatch defines the predicate used to match requests
4346 // to a given action. Multiple match types are "AND"ed for evaluation.
4347 type TlsRouteRouteMatch struct {
4348 // Alpn: Optional. ALPN (Application-Layer Protocol Negotiation) to match
4349 // against. Examples: "http/1.1", "h2". At least one of sni_host and alpn is
4350 // required. Up to 5 alpns across all matches can be set.
4351 Alpn []string `json:"alpn,omitempty"`
4352 // SniHost: Optional. SNI (server name indicator) to match against. SNI will be
4353 // matched against all wildcard domains, i.e. `www.example.com` will be first
4354 // matched against `www.example.com`, then `*.example.com`, then `*.com.`
4355 // Partial wildcards are not supported, and values like *w.example.com are
4356 // invalid. At least one of sni_host and alpn is required. Up to 100 sni hosts
4357 // across all matches can be set.
4358 SniHost []string `json:"sniHost,omitempty"`
4359 // ForceSendFields is a list of field names (e.g. "Alpn") to unconditionally
4360 // include in API requests. By default, fields with empty or default values are
4361 // omitted from API requests. See
4362 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4363 // details.
4364 ForceSendFields []string `json:"-"`
4365 // NullFields is a list of field names (e.g. "Alpn") to include in API requests
4366 // with the JSON null value. By default, fields with empty values are omitted
4367 // from API requests. See
4368 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4369 NullFields []string `json:"-"`
4370 }
4371
4372 func (s TlsRouteRouteMatch) MarshalJSON() ([]byte, error) {
4373 type NoMethod TlsRouteRouteMatch
4374 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4375 }
4376
4377 // TlsRouteRouteRule: Specifies how to match traffic and how to route traffic
4378 // when traffic is matched.
4379 type TlsRouteRouteRule struct {
4380 // Action: Required. The detailed rule defining how to route matched traffic.
4381 Action *TlsRouteRouteAction `json:"action,omitempty"`
4382 // Matches: Required. RouteMatch defines the predicate used to match requests
4383 // to a given action. Multiple match types are "OR"ed for evaluation. Atleast
4384 // one RouteMatch must be supplied.
4385 Matches []*TlsRouteRouteMatch `json:"matches,omitempty"`
4386 // ForceSendFields is a list of field names (e.g. "Action") to unconditionally
4387 // include in API requests. By default, fields with empty or default values are
4388 // omitted from API requests. See
4389 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4390 // details.
4391 ForceSendFields []string `json:"-"`
4392 // NullFields is a list of field names (e.g. "Action") to include in API
4393 // requests with the JSON null value. By default, fields with empty values are
4394 // omitted from API requests. See
4395 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4396 NullFields []string `json:"-"`
4397 }
4398
4399 func (s TlsRouteRouteRule) MarshalJSON() ([]byte, error) {
4400 type NoMethod TlsRouteRouteRule
4401 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4402 }
4403
4404 // TrafficPortSelector: Specification of a port-based selector.
4405 type TrafficPortSelector struct {
4406 // Ports: Optional. A list of ports. Can be port numbers or port range
4407 // (example, [80-90] specifies all ports from 80 to 90, including 80 and 90) or
4408 // named ports or * to specify all ports. If the list is empty, all ports are
4409 // selected.
4410 Ports []string `json:"ports,omitempty"`
4411 // ForceSendFields is a list of field names (e.g. "Ports") to unconditionally
4412 // include in API requests. By default, fields with empty or default values are
4413 // omitted from API requests. See
4414 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4415 // details.
4416 ForceSendFields []string `json:"-"`
4417 // NullFields is a list of field names (e.g. "Ports") to include in API
4418 // requests with the JSON null value. By default, fields with empty values are
4419 // omitted from API requests. See
4420 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4421 NullFields []string `json:"-"`
4422 }
4423
4424 func (s TrafficPortSelector) MarshalJSON() ([]byte, error) {
4425 type NoMethod TrafficPortSelector
4426 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4427 }
4428
4429 // WasmPlugin: `WasmPlugin` is a resource representing a service executing a
4430 // customer-provided Wasm module.
4431 type WasmPlugin struct {
4432 // CreateTime: Output only. The timestamp when the resource was created.
4433 CreateTime string `json:"createTime,omitempty"`
4434 // Description: Optional. A human-readable description of the resource.
4435 Description string `json:"description,omitempty"`
4436 // KmsKeyName: Optional. The name of the customer managed Cloud KMS key to be
4437 // used to encrypt the `WasmPlugin` image (provided by image_uri) and
4438 // configuration (provided by plugin_config_data or plugin_config_uri) that are
4439 // stored by the `Service Extensions` product at rest. Format:
4440 // "projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}"
4441 // By default, Google Cloud automatically encrypts all data at rest using
4442 // Google-owned and Google-managed encryption keys. If you need ownership and
4443 // control of the keys that protect your data at rest, you can specify a
4444 // customer-managed encryption key (CMEK) to encrypt your `WasmPlugin` data.
4445 // For more information, see Using customer-managed encryption keys
4446 // (https://cloud.google.com/kms/docs/cmek).
4447 KmsKeyName string `json:"kmsKeyName,omitempty"`
4448 // KmsKeyVersion: Output only. The name of the specific CryptoKeyVersion used
4449 // to encrypt the `WasmPlugin` data, if the kms_key_name field is set. Format:
4450 // "projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}/
4451 // cryptoKeyVersions/{version}" This is a read-only field. `WasmPlugin` data is
4452 // automatically encrypted using the most recent `CryptoKeyVersion` of the
4453 // `CryptoKey` provided in the `kms_key_name` field. See Cloud KMS resources
4454 // (https://cloud.google.com/kms/docs/resource-hierarchy) for more information.
4455 KmsKeyVersion string `json:"kmsKeyVersion,omitempty"`
4456 // Labels: Optional. Set of labels associated with the `WasmPlugin` resource.
4457 // The format must comply with the following requirements
4458 // (/compute/docs/labeling-resources#requirements).
4459 Labels map[string]string `json:"labels,omitempty"`
4460 // LogConfig: Optional. Specifies the logging options for the activity
4461 // performed by this plugin. If logging is enabled, plugin logs are exported to
4462 // Cloud Logging. Note that the settings relate to the logs generated by using
4463 // logging statements in your Wasm code.
4464 LogConfig *WasmPluginLogConfig `json:"logConfig,omitempty"`
4465 // MainVersionId: Optional. The ID of the `WasmPluginVersion` resource that is
4466 // the currently serving one. The version referred to must be a child of this
4467 // `WasmPlugin` resource.
4468 MainVersionId string `json:"mainVersionId,omitempty"`
4469 // Name: Identifier. Name of the `WasmPlugin` resource in the following format:
4470 // `projects/{project}/locations/{location}/wasmPlugins/{wasm_plugin}`.
4471 Name string `json:"name,omitempty"`
4472 // UpdateTime: Output only. The timestamp when the resource was updated.
4473 UpdateTime string `json:"updateTime,omitempty"`
4474 // UsedBy: Output only. List of all extensions
4475 // (https://cloud.google.com/service-extensions/docs/overview) that use this
4476 // `WasmPlugin` resource.
4477 UsedBy []*WasmPluginUsedBy `json:"usedBy,omitempty"`
4478 // Versions: Optional. All versions of this `WasmPlugin` resource in the
4479 // key-value format. The key is the resource ID, and the value is the
4480 // `VersionDetails` object. Lets you create or update a `WasmPlugin` resource
4481 // and its versions in a single request. When the `main_version_id` field is
4482 // not empty, it must point to one of the `VersionDetails` objects in the map.
4483 // If provided in a `PATCH` request, the new versions replace the previous set.
4484 // Any version omitted from the `versions` field is removed. Because the
4485 // `WasmPluginVersion` resource is immutable, if a `WasmPluginVersion` resource
4486 // with the same name already exists and differs, the request fails. Note: In a
4487 // `GET` request, this field is populated only if the field
4488 // `GetWasmPluginRequest.view` is set to `WASM_PLUGIN_VIEW_FULL`.
4489 Versions map[string]WasmPluginVersionDetails `json:"versions,omitempty"`
4490
4491 // ServerResponse contains the HTTP response code and headers from the server.
4492 googleapi.ServerResponse `json:"-"`
4493 // ForceSendFields is a list of field names (e.g. "CreateTime") to
4494 // unconditionally include in API requests. By default, fields with empty or
4495 // default values are omitted from API requests. See
4496 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4497 // details.
4498 ForceSendFields []string `json:"-"`
4499 // NullFields is a list of field names (e.g. "CreateTime") to include in API
4500 // requests with the JSON null value. By default, fields with empty values are
4501 // omitted from API requests. See
4502 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4503 NullFields []string `json:"-"`
4504 }
4505
4506 func (s WasmPlugin) MarshalJSON() ([]byte, error) {
4507 type NoMethod WasmPlugin
4508 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4509 }
4510
4511 // WasmPluginLogConfig: Specifies the logging options for the activity
4512 // performed by this plugin. If logging is enabled, plugin logs are exported to
4513 // Cloud Logging.
4514 type WasmPluginLogConfig struct {
4515 // Enable: Optional. Specifies whether to enable logging for activity by this
4516 // plugin. Defaults to `false`.
4517 Enable bool `json:"enable,omitempty"`
4518 // MinLogLevel: Non-empty default. Specifies the lowest level of the plugin
4519 // logs that are exported to Cloud Logging. This setting relates to the logs
4520 // generated by using logging statements in your Wasm code. This field is can
4521 // be set only if logging is enabled for the plugin. If the field is not
4522 // provided when logging is enabled, it is set to `INFO` by default.
4523 //
4524 // Possible values:
4525 // "LOG_LEVEL_UNSPECIFIED" - Unspecified value. Defaults to `LogLevel.INFO`.
4526 // "TRACE" - Report logs with TRACE level and above.
4527 // "DEBUG" - Report logs with DEBUG level and above.
4528 // "INFO" - Report logs with INFO level and above.
4529 // "WARN" - Report logs with WARN level and above.
4530 // "ERROR" - Report logs with ERROR level and above.
4531 // "CRITICAL" - Report logs with CRITICAL level only.
4532 MinLogLevel string `json:"minLogLevel,omitempty"`
4533 // SampleRate: Non-empty default. Configures the sampling rate of activity
4534 // logs, where `1.0` means all logged activity is reported and `0.0` means no
4535 // activity is reported. A floating point value between `0.0` and `1.0`
4536 // indicates that a percentage of log messages is stored. The default value
4537 // when logging is enabled is `1.0`. The value of the field must be between `0`
4538 // and `1` (inclusive). This field can be specified only if logging is enabled
4539 // for this plugin.
4540 SampleRate float64 `json:"sampleRate,omitempty"`
4541 // ForceSendFields is a list of field names (e.g. "Enable") to unconditionally
4542 // include in API requests. By default, fields with empty or default values are
4543 // omitted from API requests. See
4544 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4545 // details.
4546 ForceSendFields []string `json:"-"`
4547 // NullFields is a list of field names (e.g. "Enable") to include in API
4548 // requests with the JSON null value. By default, fields with empty values are
4549 // omitted from API requests. See
4550 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4551 NullFields []string `json:"-"`
4552 }
4553
4554 func (s WasmPluginLogConfig) MarshalJSON() ([]byte, error) {
4555 type NoMethod WasmPluginLogConfig
4556 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4557 }
4558
4559 func (s *WasmPluginLogConfig) UnmarshalJSON(data []byte) error {
4560 type NoMethod WasmPluginLogConfig
4561 var s1 struct {
4562 SampleRate gensupport.JSONFloat64 `json:"sampleRate"`
4563 *NoMethod
4564 }
4565 s1.NoMethod = (*NoMethod)(s)
4566 if err := json.Unmarshal(data, &s1); err != nil {
4567 return err
4568 }
4569 s.SampleRate = float64(s1.SampleRate)
4570 return nil
4571 }
4572
4573 // WasmPluginUsedBy: Defines a resource that uses the `WasmPlugin` resource.
4574 type WasmPluginUsedBy struct {
4575 // Name: Output only. Full name of the resource
4576 // https://google.aip.dev/122#full-resource-names, for example
4577 // `//networkservices.googleapis.com/projects/{project}/locations/{location}/lbR
4578 // outeExtensions/{extension}`
4579 Name string `json:"name,omitempty"`
4580 // ForceSendFields is a list of field names (e.g. "Name") to unconditionally
4581 // include in API requests. By default, fields with empty or default values are
4582 // omitted from API requests. See
4583 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4584 // details.
4585 ForceSendFields []string `json:"-"`
4586 // NullFields is a list of field names (e.g. "Name") to include in API requests
4587 // with the JSON null value. By default, fields with empty values are omitted
4588 // from API requests. See
4589 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4590 NullFields []string `json:"-"`
4591 }
4592
4593 func (s WasmPluginUsedBy) MarshalJSON() ([]byte, error) {
4594 type NoMethod WasmPluginUsedBy
4595 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4596 }
4597
4598 // WasmPluginVersion: A single immutable version of a `WasmPlugin` resource.
4599 // Defines the Wasm module used and optionally its runtime config.
4600 type WasmPluginVersion struct {
4601 // CreateTime: Output only. The timestamp when the resource was created.
4602 CreateTime string `json:"createTime,omitempty"`
4603 // Description: Optional. A human-readable description of the resource.
4604 Description string `json:"description,omitempty"`
4605 // ImageDigest: Output only. This field holds the digest (usually checksum)
4606 // value for the plugin image. The value is calculated based on the `image_uri`
4607 // field. If the `image_uri` field refers to a container image, the digest
4608 // value is obtained from the container image. If the `image_uri` field refers
4609 // to a generic artifact, the digest value is calculated based on the contents
4610 // of the file.
4611 ImageDigest string `json:"imageDigest,omitempty"`
4612 // ImageUri: Optional. URI of the image containing the Wasm module, stored in
4613 // Artifact Registry. The URI can refer to one of the following repository
4614 // formats: * Container images: the `image_uri` must point to a container that
4615 // contains a single file with the name `plugin.wasm`. When a new
4616 // `WasmPluginVersion` resource is created, the digest of the image is saved in
4617 // the `image_digest` field. When pulling a container image from Artifact
4618 // Registry, the digest value is used instead of an image tag. * Generic
4619 // artifacts: the `image_uri` must be in this format:
4620 // `projects/{project}/locations/{location}/repositories/{repository}/
4621 // genericArtifacts/{package}:{version}`. The specified package and version
4622 // must contain a file with the name `plugin.wasm`. When a new
4623 // `WasmPluginVersion` resource is created, the checksum of the contents of the
4624 // file is saved in the `image_digest` field.
4625 ImageUri string `json:"imageUri,omitempty"`
4626 // Labels: Optional. Set of labels associated with the `WasmPluginVersion`
4627 // resource.
4628 Labels map[string]string `json:"labels,omitempty"`
4629 // Name: Identifier. Name of the `WasmPluginVersion` resource in the following
4630 // format: `projects/{project}/locations/{location}/wasmPlugins/{wasm_plugin}/
4631 // versions/{wasm_plugin_version}`.
4632 Name string `json:"name,omitempty"`
4633 // PluginConfigData: Configuration for the plugin. The configuration is
4634 // provided to the plugin at runtime through the `ON_CONFIGURE` callback. When
4635 // a new `WasmPluginVersion` resource is created, the digest of the contents is
4636 // saved in the `plugin_config_digest` field.
4637 PluginConfigData string `json:"pluginConfigData,omitempty"`
4638 // PluginConfigDigest: Output only. This field holds the digest (usually
4639 // checksum) value for the plugin configuration. The value is calculated based
4640 // on the contents of `plugin_config_data` field or the image defined by the
4641 // `plugin_config_uri` field.
4642 PluginConfigDigest string `json:"pluginConfigDigest,omitempty"`
4643 // PluginConfigUri: URI of the plugin configuration stored in the Artifact
4644 // Registry. The configuration is provided to the plugin at runtime through the
4645 // `ON_CONFIGURE` callback. The URI can refer to one of the following
4646 // repository formats: * Container images: the `plugin_config_uri` must point
4647 // to a container that contains a single file with the name `plugin.config`.
4648 // When a new `WasmPluginVersion` resource is created, the digest of the image
4649 // is saved in the `plugin_config_digest` field. When pulling a container image
4650 // from Artifact Registry, the digest value is used instead of an image tag. *
4651 // Generic artifacts: the `plugin_config_uri` must be in this format:
4652 // `projects/{project}/locations/{location}/repositories/{repository}/
4653 // genericArtifacts/{package}:{version}`. The specified package and version
4654 // must contain a file with the name `plugin.config`. When a new
4655 // `WasmPluginVersion` resource is created, the checksum of the contents of the
4656 // file is saved in the `plugin_config_digest` field.
4657 PluginConfigUri string `json:"pluginConfigUri,omitempty"`
4658 // UpdateTime: Output only. The timestamp when the resource was updated.
4659 UpdateTime string `json:"updateTime,omitempty"`
4660
4661 // ServerResponse contains the HTTP response code and headers from the server.
4662 googleapi.ServerResponse `json:"-"`
4663 // ForceSendFields is a list of field names (e.g. "CreateTime") to
4664 // unconditionally include in API requests. By default, fields with empty or
4665 // default values are omitted from API requests. See
4666 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4667 // details.
4668 ForceSendFields []string `json:"-"`
4669 // NullFields is a list of field names (e.g. "CreateTime") to include in API
4670 // requests with the JSON null value. By default, fields with empty values are
4671 // omitted from API requests. See
4672 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4673 NullFields []string `json:"-"`
4674 }
4675
4676 func (s WasmPluginVersion) MarshalJSON() ([]byte, error) {
4677 type NoMethod WasmPluginVersion
4678 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4679 }
4680
4681 // WasmPluginVersionDetails: Details of a `WasmPluginVersion` resource to be
4682 // inlined in the `WasmPlugin` resource.
4683 type WasmPluginVersionDetails struct {
4684 // CreateTime: Output only. The timestamp when the resource was created.
4685 CreateTime string `json:"createTime,omitempty"`
4686 // Description: Optional. A human-readable description of the resource.
4687 Description string `json:"description,omitempty"`
4688 // ImageDigest: Output only. This field holds the digest (usually checksum)
4689 // value for the plugin image. The value is calculated based on the `image_uri`
4690 // field. If the `image_uri` field refers to a container image, the digest
4691 // value is obtained from the container image. If the `image_uri` field refers
4692 // to a generic artifact, the digest value is calculated based on the contents
4693 // of the file.
4694 ImageDigest string `json:"imageDigest,omitempty"`
4695 // ImageUri: Optional. URI of the image containing the Wasm module, stored in
4696 // Artifact Registry. The URI can refer to one of the following repository
4697 // formats: * Container images: the `image_uri` must point to a container that
4698 // contains a single file with the name `plugin.wasm`. When a new
4699 // `WasmPluginVersion` resource is created, the digest of the image is saved in
4700 // the `image_digest` field. When pulling a container image from Artifact
4701 // Registry, the digest value is used instead of an image tag. * Generic
4702 // artifacts: the `image_uri` must be in this format:
4703 // `projects/{project}/locations/{location}/repositories/{repository}/
4704 // genericArtifacts/{package}:{version}`. The specified package and version
4705 // must contain a file with the name `plugin.wasm`. When a new
4706 // `WasmPluginVersion` resource is created, the checksum of the contents of the
4707 // file is saved in the `image_digest` field.
4708 ImageUri string `json:"imageUri,omitempty"`
4709 // Labels: Optional. Set of labels associated with the `WasmPluginVersion`
4710 // resource.
4711 Labels map[string]string `json:"labels,omitempty"`
4712 // PluginConfigData: Configuration for the plugin. The configuration is
4713 // provided to the plugin at runtime through the `ON_CONFIGURE` callback. When
4714 // a new `WasmPluginVersion` version is created, the digest of the contents is
4715 // saved in the `plugin_config_digest` field.
4716 PluginConfigData string `json:"pluginConfigData,omitempty"`
4717 // PluginConfigDigest: Output only. This field holds the digest (usually
4718 // checksum) value for the plugin configuration. The value is calculated based
4719 // on the contents of `plugin_config_data` field or the image defined by the
4720 // `plugin_config_uri` field.
4721 PluginConfigDigest string `json:"pluginConfigDigest,omitempty"`
4722 // PluginConfigUri: URI of the plugin configuration stored in the Artifact
4723 // Registry. The configuration is provided to the plugin at runtime through the
4724 // `ON_CONFIGURE` callback. The URI can refer to one of the following
4725 // repository formats: * Container images: the `plugin_config_uri` must point
4726 // to a container that contains a single file with the name `plugin.config`.
4727 // When a new `WasmPluginVersion` resource is created, the digest of the image
4728 // is saved in the `plugin_config_digest` field. When pulling a container image
4729 // from Artifact Registry, the digest value is used instead of an image tag. *
4730 // Generic artifacts: the `plugin_config_uri` must be in this format:
4731 // `projects/{project}/locations/{location}/repositories/{repository}/
4732 // genericArtifacts/{package}:{version}`. The specified package and version
4733 // must contain a file with the name `plugin.config`. When a new
4734 // `WasmPluginVersion` resource is created, the checksum of the contents of the
4735 // file is saved in the `plugin_config_digest` field.
4736 PluginConfigUri string `json:"pluginConfigUri,omitempty"`
4737 // UpdateTime: Output only. The timestamp when the resource was updated.
4738 UpdateTime string `json:"updateTime,omitempty"`
4739 // ForceSendFields is a list of field names (e.g. "CreateTime") to
4740 // unconditionally include in API requests. By default, fields with empty or
4741 // default values are omitted from API requests. See
4742 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4743 // details.
4744 ForceSendFields []string `json:"-"`
4745 // NullFields is a list of field names (e.g. "CreateTime") to include in API
4746 // requests with the JSON null value. By default, fields with empty values are
4747 // omitted from API requests. See
4748 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4749 NullFields []string `json:"-"`
4750 }
4751
4752 func (s WasmPluginVersionDetails) MarshalJSON() ([]byte, error) {
4753 type NoMethod WasmPluginVersionDetails
4754 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4755 }
4756
4757 type ProjectsLocationsGetCall struct {
4758 s *Service
4759 name string
4760 urlParams_ gensupport.URLParams
4761 ifNoneMatch_ string
4762 ctx_ context.Context
4763 header_ http.Header
4764 }
4765
4766 // Get: Gets information about a location.
4767 //
4768 // - name: Resource name for the location.
4769 func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
4770 c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4771 c.name = name
4772 return c
4773 }
4774
4775 // Fields allows partial responses to be retrieved. See
4776 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4777 // details.
4778 func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
4779 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4780 return c
4781 }
4782
4783 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4784 // object's ETag matches the given value. This is useful for getting updates
4785 // only after the object has changed since the last request.
4786 func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
4787 c.ifNoneMatch_ = entityTag
4788 return c
4789 }
4790
4791 // Context sets the context to be used in this call's Do method.
4792 func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
4793 c.ctx_ = ctx
4794 return c
4795 }
4796
4797 // Header returns a http.Header that can be modified by the caller to add
4798 // headers to the request.
4799 func (c *ProjectsLocationsGetCall) Header() http.Header {
4800 if c.header_ == nil {
4801 c.header_ = make(http.Header)
4802 }
4803 return c.header_
4804 }
4805
4806 func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
4807 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4808 if c.ifNoneMatch_ != "" {
4809 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4810 }
4811 c.urlParams_.Set("alt", alt)
4812 c.urlParams_.Set("prettyPrint", "false")
4813 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
4814 urls += "?" + c.urlParams_.Encode()
4815 req, err := http.NewRequest("GET", urls, nil)
4816 if err != nil {
4817 return nil, err
4818 }
4819 req.Header = reqHeaders
4820 googleapi.Expand(req.URL, map[string]string{
4821 "name": c.name,
4822 })
4823 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.get", "request", internallog.HTTPRequest(req, nil))
4824 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4825 }
4826
4827 // Do executes the "networkservices.projects.locations.get" call.
4828 // Any non-2xx status code is an error. Response headers are in either
4829 // *Location.ServerResponse.Header or (if a response was returned at all) in
4830 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4831 // whether the returned error was because http.StatusNotModified was returned.
4832 func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
4833 gensupport.SetOptions(c.urlParams_, opts...)
4834 res, err := c.doRequest("json")
4835 if res != nil && res.StatusCode == http.StatusNotModified {
4836 if res.Body != nil {
4837 res.Body.Close()
4838 }
4839 return nil, gensupport.WrapError(&googleapi.Error{
4840 Code: res.StatusCode,
4841 Header: res.Header,
4842 })
4843 }
4844 if err != nil {
4845 return nil, err
4846 }
4847 defer googleapi.CloseBody(res)
4848 if err := googleapi.CheckResponse(res); err != nil {
4849 return nil, gensupport.WrapError(err)
4850 }
4851 ret := &Location{
4852 ServerResponse: googleapi.ServerResponse{
4853 Header: res.Header,
4854 HTTPStatusCode: res.StatusCode,
4855 },
4856 }
4857 target := &ret
4858 b, err := gensupport.DecodeResponseBytes(target, res)
4859 if err != nil {
4860 return nil, err
4861 }
4862 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.get", "response", internallog.HTTPResponse(res, b))
4863 return ret, nil
4864 }
4865
4866 type ProjectsLocationsListCall struct {
4867 s *Service
4868 name string
4869 urlParams_ gensupport.URLParams
4870 ifNoneMatch_ string
4871 ctx_ context.Context
4872 header_ http.Header
4873 }
4874
4875 // List: Lists information about the supported locations for this service. This
4876 // method lists locations based on the resource scope provided in the
4877 // [ListLocationsRequest.name] field: * **Global locations**: If `name` is
4878 // empty, the method lists the public locations available to all projects. *
4879 // **Project-specific locations**: If `name` follows the format
4880 // `projects/{project}`, the method lists locations visible to that specific
4881 // project. This includes public, private, or other project-specific locations
4882 // enabled for the project. For gRPC and client library implementations, the
4883 // resource name is passed as the `name` field. For direct service calls, the
4884 // resource name is incorporated into the request path based on the specific
4885 // service implementation and version.
4886 //
4887 // - name: The resource that owns the locations collection, if applicable.
4888 func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
4889 c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4890 c.name = name
4891 return c
4892 }
4893
4894 // ExtraLocationTypes sets the optional parameter "extraLocationTypes": Do not
4895 // use this field. It is unsupported and is ignored unless explicitly
4896 // documented otherwise. This is primarily for internal usage.
4897 func (c *ProjectsLocationsListCall) ExtraLocationTypes(extraLocationTypes ...string) *ProjectsLocationsListCall {
4898 c.urlParams_.SetMulti("extraLocationTypes", append([]string{}, extraLocationTypes...))
4899 return c
4900 }
4901
4902 // Filter sets the optional parameter "filter": A filter to narrow down results
4903 // to a preferred subset. The filtering language accepts strings like
4904 // "displayName=tokyo", and is documented in more detail in AIP-160
4905 // (https://google.aip.dev/160).
4906 func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
4907 c.urlParams_.Set("filter", filter)
4908 return c
4909 }
4910
4911 // PageSize sets the optional parameter "pageSize": The maximum number of
4912 // results to return. If not set, the service selects a default.
4913 func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
4914 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4915 return c
4916 }
4917
4918 // PageToken sets the optional parameter "pageToken": A page token received
4919 // from the `next_page_token` field in the response. Send that page token to
4920 // receive the subsequent page.
4921 func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
4922 c.urlParams_.Set("pageToken", pageToken)
4923 return c
4924 }
4925
4926 // Fields allows partial responses to be retrieved. See
4927 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4928 // details.
4929 func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
4930 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4931 return c
4932 }
4933
4934 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4935 // object's ETag matches the given value. This is useful for getting updates
4936 // only after the object has changed since the last request.
4937 func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
4938 c.ifNoneMatch_ = entityTag
4939 return c
4940 }
4941
4942 // Context sets the context to be used in this call's Do method.
4943 func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
4944 c.ctx_ = ctx
4945 return c
4946 }
4947
4948 // Header returns a http.Header that can be modified by the caller to add
4949 // headers to the request.
4950 func (c *ProjectsLocationsListCall) Header() http.Header {
4951 if c.header_ == nil {
4952 c.header_ = make(http.Header)
4953 }
4954 return c.header_
4955 }
4956
4957 func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
4958 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4959 if c.ifNoneMatch_ != "" {
4960 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4961 }
4962 c.urlParams_.Set("alt", alt)
4963 c.urlParams_.Set("prettyPrint", "false")
4964 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations")
4965 urls += "?" + c.urlParams_.Encode()
4966 req, err := http.NewRequest("GET", urls, nil)
4967 if err != nil {
4968 return nil, err
4969 }
4970 req.Header = reqHeaders
4971 googleapi.Expand(req.URL, map[string]string{
4972 "name": c.name,
4973 })
4974 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.list", "request", internallog.HTTPRequest(req, nil))
4975 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4976 }
4977
4978 // Do executes the "networkservices.projects.locations.list" call.
4979 // Any non-2xx status code is an error. Response headers are in either
4980 // *ListLocationsResponse.ServerResponse.Header or (if a response was returned
4981 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4982 // check whether the returned error was because http.StatusNotModified was
4983 // returned.
4984 func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
4985 gensupport.SetOptions(c.urlParams_, opts...)
4986 res, err := c.doRequest("json")
4987 if res != nil && res.StatusCode == http.StatusNotModified {
4988 if res.Body != nil {
4989 res.Body.Close()
4990 }
4991 return nil, gensupport.WrapError(&googleapi.Error{
4992 Code: res.StatusCode,
4993 Header: res.Header,
4994 })
4995 }
4996 if err != nil {
4997 return nil, err
4998 }
4999 defer googleapi.CloseBody(res)
5000 if err := googleapi.CheckResponse(res); err != nil {
5001 return nil, gensupport.WrapError(err)
5002 }
5003 ret := &ListLocationsResponse{
5004 ServerResponse: googleapi.ServerResponse{
5005 Header: res.Header,
5006 HTTPStatusCode: res.StatusCode,
5007 },
5008 }
5009 target := &ret
5010 b, err := gensupport.DecodeResponseBytes(target, res)
5011 if err != nil {
5012 return nil, err
5013 }
5014 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.list", "response", internallog.HTTPResponse(res, b))
5015 return ret, nil
5016 }
5017
5018 // Pages invokes f for each page of results.
5019 // A non-nil error returned from f will halt the iteration.
5020 // The provided context supersedes any context provided to the Context method.
5021 func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
5022 c.ctx_ = ctx
5023 defer c.PageToken(c.urlParams_.Get("pageToken"))
5024 for {
5025 x, err := c.Do()
5026 if err != nil {
5027 return err
5028 }
5029 if err := f(x); err != nil {
5030 return err
5031 }
5032 if x.NextPageToken == "" {
5033 return nil
5034 }
5035 c.PageToken(x.NextPageToken)
5036 }
5037 }
5038
5039 type ProjectsLocationsAgentGatewaysCreateCall struct {
5040 s *Service
5041 parent string
5042 agentgateway *AgentGateway
5043 urlParams_ gensupport.URLParams
5044 ctx_ context.Context
5045 header_ http.Header
5046 }
5047
5048 // Create: Creates a new AgentGateway in a given project and location.
5049 //
5050 // - parent: The parent resource of the AgentGateway. Must be in the format
5051 // `projects/*/locations/*`.
5052 func (r *ProjectsLocationsAgentGatewaysService) Create(parent string, agentgateway *AgentGateway) *ProjectsLocationsAgentGatewaysCreateCall {
5053 c := &ProjectsLocationsAgentGatewaysCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5054 c.parent = parent
5055 c.agentgateway = agentgateway
5056 return c
5057 }
5058
5059 // AgentGatewayId sets the optional parameter "agentGatewayId": Required. Short
5060 // name of the AgentGateway resource to be created.
5061 func (c *ProjectsLocationsAgentGatewaysCreateCall) AgentGatewayId(agentGatewayId string) *ProjectsLocationsAgentGatewaysCreateCall {
5062 c.urlParams_.Set("agentGatewayId", agentGatewayId)
5063 return c
5064 }
5065
5066 // Fields allows partial responses to be retrieved. See
5067 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5068 // details.
5069 func (c *ProjectsLocationsAgentGatewaysCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsAgentGatewaysCreateCall {
5070 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5071 return c
5072 }
5073
5074 // Context sets the context to be used in this call's Do method.
5075 func (c *ProjectsLocationsAgentGatewaysCreateCall) Context(ctx context.Context) *ProjectsLocationsAgentGatewaysCreateCall {
5076 c.ctx_ = ctx
5077 return c
5078 }
5079
5080 // Header returns a http.Header that can be modified by the caller to add
5081 // headers to the request.
5082 func (c *ProjectsLocationsAgentGatewaysCreateCall) Header() http.Header {
5083 if c.header_ == nil {
5084 c.header_ = make(http.Header)
5085 }
5086 return c.header_
5087 }
5088
5089 func (c *ProjectsLocationsAgentGatewaysCreateCall) doRequest(alt string) (*http.Response, error) {
5090 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5091 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.agentgateway)
5092 if err != nil {
5093 return nil, err
5094 }
5095 c.urlParams_.Set("alt", alt)
5096 c.urlParams_.Set("prettyPrint", "false")
5097 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/agentGateways")
5098 urls += "?" + c.urlParams_.Encode()
5099 req, err := http.NewRequest("POST", urls, body)
5100 if err != nil {
5101 return nil, err
5102 }
5103 req.Header = reqHeaders
5104 googleapi.Expand(req.URL, map[string]string{
5105 "parent": c.parent,
5106 })
5107 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.agentGateways.create", "request", internallog.HTTPRequest(req, body.Bytes()))
5108 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5109 }
5110
5111 // Do executes the "networkservices.projects.locations.agentGateways.create" call.
5112 // Any non-2xx status code is an error. Response headers are in either
5113 // *Operation.ServerResponse.Header or (if a response was returned at all) in
5114 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5115 // whether the returned error was because http.StatusNotModified was returned.
5116 func (c *ProjectsLocationsAgentGatewaysCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
5117 gensupport.SetOptions(c.urlParams_, opts...)
5118 res, err := c.doRequest("json")
5119 if res != nil && res.StatusCode == http.StatusNotModified {
5120 if res.Body != nil {
5121 res.Body.Close()
5122 }
5123 return nil, gensupport.WrapError(&googleapi.Error{
5124 Code: res.StatusCode,
5125 Header: res.Header,
5126 })
5127 }
5128 if err != nil {
5129 return nil, err
5130 }
5131 defer googleapi.CloseBody(res)
5132 if err := googleapi.CheckResponse(res); err != nil {
5133 return nil, gensupport.WrapError(err)
5134 }
5135 ret := &Operation{
5136 ServerResponse: googleapi.ServerResponse{
5137 Header: res.Header,
5138 HTTPStatusCode: res.StatusCode,
5139 },
5140 }
5141 target := &ret
5142 b, err := gensupport.DecodeResponseBytes(target, res)
5143 if err != nil {
5144 return nil, err
5145 }
5146 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.agentGateways.create", "response", internallog.HTTPResponse(res, b))
5147 return ret, nil
5148 }
5149
5150 type ProjectsLocationsAgentGatewaysDeleteCall struct {
5151 s *Service
5152 name string
5153 urlParams_ gensupport.URLParams
5154 ctx_ context.Context
5155 header_ http.Header
5156 }
5157
5158 // Delete: Deletes a single AgentGateway.
5159 //
5160 // - name: A name of the AgentGateway to delete. Must be in the format
5161 // `projects/*/locations/*/agentGateways/*`.
5162 func (r *ProjectsLocationsAgentGatewaysService) Delete(name string) *ProjectsLocationsAgentGatewaysDeleteCall {
5163 c := &ProjectsLocationsAgentGatewaysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5164 c.name = name
5165 return c
5166 }
5167
5168 // Etag sets the optional parameter "etag": The etag of the AgentGateway to
5169 // delete.
5170 func (c *ProjectsLocationsAgentGatewaysDeleteCall) Etag(etag string) *ProjectsLocationsAgentGatewaysDeleteCall {
5171 c.urlParams_.Set("etag", etag)
5172 return c
5173 }
5174
5175 // Fields allows partial responses to be retrieved. See
5176 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5177 // details.
5178 func (c *ProjectsLocationsAgentGatewaysDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsAgentGatewaysDeleteCall {
5179 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5180 return c
5181 }
5182
5183 // Context sets the context to be used in this call's Do method.
5184 func (c *ProjectsLocationsAgentGatewaysDeleteCall) Context(ctx context.Context) *ProjectsLocationsAgentGatewaysDeleteCall {
5185 c.ctx_ = ctx
5186 return c
5187 }
5188
5189 // Header returns a http.Header that can be modified by the caller to add
5190 // headers to the request.
5191 func (c *ProjectsLocationsAgentGatewaysDeleteCall) Header() http.Header {
5192 if c.header_ == nil {
5193 c.header_ = make(http.Header)
5194 }
5195 return c.header_
5196 }
5197
5198 func (c *ProjectsLocationsAgentGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) {
5199 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5200 c.urlParams_.Set("alt", alt)
5201 c.urlParams_.Set("prettyPrint", "false")
5202 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
5203 urls += "?" + c.urlParams_.Encode()
5204 req, err := http.NewRequest("DELETE", urls, nil)
5205 if err != nil {
5206 return nil, err
5207 }
5208 req.Header = reqHeaders
5209 googleapi.Expand(req.URL, map[string]string{
5210 "name": c.name,
5211 })
5212 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.agentGateways.delete", "request", internallog.HTTPRequest(req, nil))
5213 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5214 }
5215
5216 // Do executes the "networkservices.projects.locations.agentGateways.delete" call.
5217 // Any non-2xx status code is an error. Response headers are in either
5218 // *Operation.ServerResponse.Header or (if a response was returned at all) in
5219 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5220 // whether the returned error was because http.StatusNotModified was returned.
5221 func (c *ProjectsLocationsAgentGatewaysDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
5222 gensupport.SetOptions(c.urlParams_, opts...)
5223 res, err := c.doRequest("json")
5224 if res != nil && res.StatusCode == http.StatusNotModified {
5225 if res.Body != nil {
5226 res.Body.Close()
5227 }
5228 return nil, gensupport.WrapError(&googleapi.Error{
5229 Code: res.StatusCode,
5230 Header: res.Header,
5231 })
5232 }
5233 if err != nil {
5234 return nil, err
5235 }
5236 defer googleapi.CloseBody(res)
5237 if err := googleapi.CheckResponse(res); err != nil {
5238 return nil, gensupport.WrapError(err)
5239 }
5240 ret := &Operation{
5241 ServerResponse: googleapi.ServerResponse{
5242 Header: res.Header,
5243 HTTPStatusCode: res.StatusCode,
5244 },
5245 }
5246 target := &ret
5247 b, err := gensupport.DecodeResponseBytes(target, res)
5248 if err != nil {
5249 return nil, err
5250 }
5251 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.agentGateways.delete", "response", internallog.HTTPResponse(res, b))
5252 return ret, nil
5253 }
5254
5255 type ProjectsLocationsAgentGatewaysGetCall struct {
5256 s *Service
5257 name string
5258 urlParams_ gensupport.URLParams
5259 ifNoneMatch_ string
5260 ctx_ context.Context
5261 header_ http.Header
5262 }
5263
5264 // Get: Gets details of a single AgentGateway.
5265 //
5266 // - name: A name of the AgentGateway to get. Must be in the format
5267 // `projects/*/locations/*/agentGateways/*`.
5268 func (r *ProjectsLocationsAgentGatewaysService) Get(name string) *ProjectsLocationsAgentGatewaysGetCall {
5269 c := &ProjectsLocationsAgentGatewaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5270 c.name = name
5271 return c
5272 }
5273
5274 // Fields allows partial responses to be retrieved. See
5275 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5276 // details.
5277 func (c *ProjectsLocationsAgentGatewaysGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsAgentGatewaysGetCall {
5278 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5279 return c
5280 }
5281
5282 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5283 // object's ETag matches the given value. This is useful for getting updates
5284 // only after the object has changed since the last request.
5285 func (c *ProjectsLocationsAgentGatewaysGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsAgentGatewaysGetCall {
5286 c.ifNoneMatch_ = entityTag
5287 return c
5288 }
5289
5290 // Context sets the context to be used in this call's Do method.
5291 func (c *ProjectsLocationsAgentGatewaysGetCall) Context(ctx context.Context) *ProjectsLocationsAgentGatewaysGetCall {
5292 c.ctx_ = ctx
5293 return c
5294 }
5295
5296 // Header returns a http.Header that can be modified by the caller to add
5297 // headers to the request.
5298 func (c *ProjectsLocationsAgentGatewaysGetCall) Header() http.Header {
5299 if c.header_ == nil {
5300 c.header_ = make(http.Header)
5301 }
5302 return c.header_
5303 }
5304
5305 func (c *ProjectsLocationsAgentGatewaysGetCall) doRequest(alt string) (*http.Response, error) {
5306 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5307 if c.ifNoneMatch_ != "" {
5308 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5309 }
5310 c.urlParams_.Set("alt", alt)
5311 c.urlParams_.Set("prettyPrint", "false")
5312 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
5313 urls += "?" + c.urlParams_.Encode()
5314 req, err := http.NewRequest("GET", urls, nil)
5315 if err != nil {
5316 return nil, err
5317 }
5318 req.Header = reqHeaders
5319 googleapi.Expand(req.URL, map[string]string{
5320 "name": c.name,
5321 })
5322 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.agentGateways.get", "request", internallog.HTTPRequest(req, nil))
5323 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5324 }
5325
5326 // Do executes the "networkservices.projects.locations.agentGateways.get" call.
5327 // Any non-2xx status code is an error. Response headers are in either
5328 // *AgentGateway.ServerResponse.Header or (if a response was returned at all)
5329 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5330 // whether the returned error was because http.StatusNotModified was returned.
5331 func (c *ProjectsLocationsAgentGatewaysGetCall) Do(opts ...googleapi.CallOption) (*AgentGateway, error) {
5332 gensupport.SetOptions(c.urlParams_, opts...)
5333 res, err := c.doRequest("json")
5334 if res != nil && res.StatusCode == http.StatusNotModified {
5335 if res.Body != nil {
5336 res.Body.Close()
5337 }
5338 return nil, gensupport.WrapError(&googleapi.Error{
5339 Code: res.StatusCode,
5340 Header: res.Header,
5341 })
5342 }
5343 if err != nil {
5344 return nil, err
5345 }
5346 defer googleapi.CloseBody(res)
5347 if err := googleapi.CheckResponse(res); err != nil {
5348 return nil, gensupport.WrapError(err)
5349 }
5350 ret := &AgentGateway{
5351 ServerResponse: googleapi.ServerResponse{
5352 Header: res.Header,
5353 HTTPStatusCode: res.StatusCode,
5354 },
5355 }
5356 target := &ret
5357 b, err := gensupport.DecodeResponseBytes(target, res)
5358 if err != nil {
5359 return nil, err
5360 }
5361 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.agentGateways.get", "response", internallog.HTTPResponse(res, b))
5362 return ret, nil
5363 }
5364
5365 type ProjectsLocationsAgentGatewaysListCall struct {
5366 s *Service
5367 parent string
5368 urlParams_ gensupport.URLParams
5369 ifNoneMatch_ string
5370 ctx_ context.Context
5371 header_ http.Header
5372 }
5373
5374 // List: Lists AgentGateways in a given project and location.
5375 //
5376 // - parent: The project and location from which the AgentGateways should be
5377 // listed, specified in the format `projects/*/locations/*`.
5378 func (r *ProjectsLocationsAgentGatewaysService) List(parent string) *ProjectsLocationsAgentGatewaysListCall {
5379 c := &ProjectsLocationsAgentGatewaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5380 c.parent = parent
5381 return c
5382 }
5383
5384 // PageSize sets the optional parameter "pageSize": Maximum number of
5385 // AgentGateways to return per call.
5386 func (c *ProjectsLocationsAgentGatewaysListCall) PageSize(pageSize int64) *ProjectsLocationsAgentGatewaysListCall {
5387 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
5388 return c
5389 }
5390
5391 // PageToken sets the optional parameter "pageToken": The value returned by the
5392 // last `ListAgentGatewaysResponse` Indicates that this is a continuation of a
5393 // prior `ListAgentGateways` call, and that the system should return the next
5394 // page of data.
5395 func (c *ProjectsLocationsAgentGatewaysListCall) PageToken(pageToken string) *ProjectsLocationsAgentGatewaysListCall {
5396 c.urlParams_.Set("pageToken", pageToken)
5397 return c
5398 }
5399
5400 // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": If
5401 // true, allow partial responses for multi-regional Aggregated List requests.
5402 // Otherwise if one of the locations is down or unreachable, the Aggregated
5403 // List request will fail.
5404 func (c *ProjectsLocationsAgentGatewaysListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ProjectsLocationsAgentGatewaysListCall {
5405 c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
5406 return c
5407 }
5408
5409 // Fields allows partial responses to be retrieved. See
5410 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5411 // details.
5412 func (c *ProjectsLocationsAgentGatewaysListCall) Fields(s ...googleapi.Field) *ProjectsLocationsAgentGatewaysListCall {
5413 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5414 return c
5415 }
5416
5417 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5418 // object's ETag matches the given value. This is useful for getting updates
5419 // only after the object has changed since the last request.
5420 func (c *ProjectsLocationsAgentGatewaysListCall) IfNoneMatch(entityTag string) *ProjectsLocationsAgentGatewaysListCall {
5421 c.ifNoneMatch_ = entityTag
5422 return c
5423 }
5424
5425 // Context sets the context to be used in this call's Do method.
5426 func (c *ProjectsLocationsAgentGatewaysListCall) Context(ctx context.Context) *ProjectsLocationsAgentGatewaysListCall {
5427 c.ctx_ = ctx
5428 return c
5429 }
5430
5431 // Header returns a http.Header that can be modified by the caller to add
5432 // headers to the request.
5433 func (c *ProjectsLocationsAgentGatewaysListCall) Header() http.Header {
5434 if c.header_ == nil {
5435 c.header_ = make(http.Header)
5436 }
5437 return c.header_
5438 }
5439
5440 func (c *ProjectsLocationsAgentGatewaysListCall) doRequest(alt string) (*http.Response, error) {
5441 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5442 if c.ifNoneMatch_ != "" {
5443 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5444 }
5445 c.urlParams_.Set("alt", alt)
5446 c.urlParams_.Set("prettyPrint", "false")
5447 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/agentGateways")
5448 urls += "?" + c.urlParams_.Encode()
5449 req, err := http.NewRequest("GET", urls, nil)
5450 if err != nil {
5451 return nil, err
5452 }
5453 req.Header = reqHeaders
5454 googleapi.Expand(req.URL, map[string]string{
5455 "parent": c.parent,
5456 })
5457 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.agentGateways.list", "request", internallog.HTTPRequest(req, nil))
5458 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5459 }
5460
5461 // Do executes the "networkservices.projects.locations.agentGateways.list" call.
5462 // Any non-2xx status code is an error. Response headers are in either
5463 // *ListAgentGatewaysResponse.ServerResponse.Header or (if a response was
5464 // returned at all) in error.(*googleapi.Error).Header. Use
5465 // googleapi.IsNotModified to check whether the returned error was because
5466 // http.StatusNotModified was returned.
5467 func (c *ProjectsLocationsAgentGatewaysListCall) Do(opts ...googleapi.CallOption) (*ListAgentGatewaysResponse, error) {
5468 gensupport.SetOptions(c.urlParams_, opts...)
5469 res, err := c.doRequest("json")
5470 if res != nil && res.StatusCode == http.StatusNotModified {
5471 if res.Body != nil {
5472 res.Body.Close()
5473 }
5474 return nil, gensupport.WrapError(&googleapi.Error{
5475 Code: res.StatusCode,
5476 Header: res.Header,
5477 })
5478 }
5479 if err != nil {
5480 return nil, err
5481 }
5482 defer googleapi.CloseBody(res)
5483 if err := googleapi.CheckResponse(res); err != nil {
5484 return nil, gensupport.WrapError(err)
5485 }
5486 ret := &ListAgentGatewaysResponse{
5487 ServerResponse: googleapi.ServerResponse{
5488 Header: res.Header,
5489 HTTPStatusCode: res.StatusCode,
5490 },
5491 }
5492 target := &ret
5493 b, err := gensupport.DecodeResponseBytes(target, res)
5494 if err != nil {
5495 return nil, err
5496 }
5497 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.agentGateways.list", "response", internallog.HTTPResponse(res, b))
5498 return ret, nil
5499 }
5500
5501 // Pages invokes f for each page of results.
5502 // A non-nil error returned from f will halt the iteration.
5503 // The provided context supersedes any context provided to the Context method.
5504 func (c *ProjectsLocationsAgentGatewaysListCall) Pages(ctx context.Context, f func(*ListAgentGatewaysResponse) error) error {
5505 c.ctx_ = ctx
5506 defer c.PageToken(c.urlParams_.Get("pageToken"))
5507 for {
5508 x, err := c.Do()
5509 if err != nil {
5510 return err
5511 }
5512 if err := f(x); err != nil {
5513 return err
5514 }
5515 if x.NextPageToken == "" {
5516 return nil
5517 }
5518 c.PageToken(x.NextPageToken)
5519 }
5520 }
5521
5522 type ProjectsLocationsAgentGatewaysPatchCall struct {
5523 s *Service
5524 name string
5525 agentgateway *AgentGateway
5526 urlParams_ gensupport.URLParams
5527 ctx_ context.Context
5528 header_ http.Header
5529 }
5530
5531 // Patch: Updates the parameters of a single AgentGateway.
5532 //
5533 // - name: Identifier. Name of the AgentGateway resource. It matches pattern
5534 // `projects/*/locations/*/agentGateways/`.
5535 func (r *ProjectsLocationsAgentGatewaysService) Patch(name string, agentgateway *AgentGateway) *ProjectsLocationsAgentGatewaysPatchCall {
5536 c := &ProjectsLocationsAgentGatewaysPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5537 c.name = name
5538 c.agentgateway = agentgateway
5539 return c
5540 }
5541
5542 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
5543 // specify the fields to be overwritten in the AgentGateway resource by the
5544 // update. The fields specified in the update_mask are relative to the
5545 // resource, not the full request. A field will be overwritten if it is in the
5546 // mask. If the user does not provide a mask then all fields will be
5547 // overwritten.
5548 func (c *ProjectsLocationsAgentGatewaysPatchCall) UpdateMask(updateMask string) *ProjectsLocationsAgentGatewaysPatchCall {
5549 c.urlParams_.Set("updateMask", updateMask)
5550 return c
5551 }
5552
5553 // Fields allows partial responses to be retrieved. See
5554 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5555 // details.
5556 func (c *ProjectsLocationsAgentGatewaysPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsAgentGatewaysPatchCall {
5557 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5558 return c
5559 }
5560
5561 // Context sets the context to be used in this call's Do method.
5562 func (c *ProjectsLocationsAgentGatewaysPatchCall) Context(ctx context.Context) *ProjectsLocationsAgentGatewaysPatchCall {
5563 c.ctx_ = ctx
5564 return c
5565 }
5566
5567 // Header returns a http.Header that can be modified by the caller to add
5568 // headers to the request.
5569 func (c *ProjectsLocationsAgentGatewaysPatchCall) Header() http.Header {
5570 if c.header_ == nil {
5571 c.header_ = make(http.Header)
5572 }
5573 return c.header_
5574 }
5575
5576 func (c *ProjectsLocationsAgentGatewaysPatchCall) doRequest(alt string) (*http.Response, error) {
5577 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5578 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.agentgateway)
5579 if err != nil {
5580 return nil, err
5581 }
5582 c.urlParams_.Set("alt", alt)
5583 c.urlParams_.Set("prettyPrint", "false")
5584 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
5585 urls += "?" + c.urlParams_.Encode()
5586 req, err := http.NewRequest("PATCH", urls, body)
5587 if err != nil {
5588 return nil, err
5589 }
5590 req.Header = reqHeaders
5591 googleapi.Expand(req.URL, map[string]string{
5592 "name": c.name,
5593 })
5594 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.agentGateways.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
5595 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5596 }
5597
5598 // Do executes the "networkservices.projects.locations.agentGateways.patch" call.
5599 // Any non-2xx status code is an error. Response headers are in either
5600 // *Operation.ServerResponse.Header or (if a response was returned at all) in
5601 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5602 // whether the returned error was because http.StatusNotModified was returned.
5603 func (c *ProjectsLocationsAgentGatewaysPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
5604 gensupport.SetOptions(c.urlParams_, opts...)
5605 res, err := c.doRequest("json")
5606 if res != nil && res.StatusCode == http.StatusNotModified {
5607 if res.Body != nil {
5608 res.Body.Close()
5609 }
5610 return nil, gensupport.WrapError(&googleapi.Error{
5611 Code: res.StatusCode,
5612 Header: res.Header,
5613 })
5614 }
5615 if err != nil {
5616 return nil, err
5617 }
5618 defer googleapi.CloseBody(res)
5619 if err := googleapi.CheckResponse(res); err != nil {
5620 return nil, gensupport.WrapError(err)
5621 }
5622 ret := &Operation{
5623 ServerResponse: googleapi.ServerResponse{
5624 Header: res.Header,
5625 HTTPStatusCode: res.StatusCode,
5626 },
5627 }
5628 target := &ret
5629 b, err := gensupport.DecodeResponseBytes(target, res)
5630 if err != nil {
5631 return nil, err
5632 }
5633 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.agentGateways.patch", "response", internallog.HTTPResponse(res, b))
5634 return ret, nil
5635 }
5636
5637 type ProjectsLocationsAuthzExtensionsCreateCall struct {
5638 s *Service
5639 parent string
5640 authzextension *AuthzExtension
5641 urlParams_ gensupport.URLParams
5642 ctx_ context.Context
5643 header_ http.Header
5644 }
5645
5646 // Create: Creates a new `AuthzExtension` resource in a given project and
5647 // location.
5648 //
5649 // - parent: The parent resource of the `AuthzExtension` resource. Must be in
5650 // the format `projects/{project}/locations/{location}`.
5651 func (r *ProjectsLocationsAuthzExtensionsService) Create(parent string, authzextension *AuthzExtension) *ProjectsLocationsAuthzExtensionsCreateCall {
5652 c := &ProjectsLocationsAuthzExtensionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5653 c.parent = parent
5654 c.authzextension = authzextension
5655 return c
5656 }
5657
5658 // AuthzExtensionId sets the optional parameter "authzExtensionId": Required.
5659 // User-provided ID of the `AuthzExtension` resource to be created.
5660 func (c *ProjectsLocationsAuthzExtensionsCreateCall) AuthzExtensionId(authzExtensionId string) *ProjectsLocationsAuthzExtensionsCreateCall {
5661 c.urlParams_.Set("authzExtensionId", authzExtensionId)
5662 return c
5663 }
5664
5665 // RequestId sets the optional parameter "requestId": An optional request ID to
5666 // identify requests. Specify a unique request ID so that if you must retry
5667 // your request, the server can ignore the request if it has already been
5668 // completed. The server guarantees that for 60 minutes since the first
5669 // request. For example, consider a situation where you make an initial request
5670 // and the request times out. If you make the request again with the same
5671 // request ID, the server ignores the second request This prevents clients from
5672 // accidentally creating duplicate commitments. The request ID must be a valid
5673 // UUID with the exception that zero UUID is not supported
5674 // (00000000-0000-0000-0000-000000000000).
5675 func (c *ProjectsLocationsAuthzExtensionsCreateCall) RequestId(requestId string) *ProjectsLocationsAuthzExtensionsCreateCall {
5676 c.urlParams_.Set("requestId", requestId)
5677 return c
5678 }
5679
5680 // Fields allows partial responses to be retrieved. See
5681 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5682 // details.
5683 func (c *ProjectsLocationsAuthzExtensionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsAuthzExtensionsCreateCall {
5684 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5685 return c
5686 }
5687
5688 // Context sets the context to be used in this call's Do method.
5689 func (c *ProjectsLocationsAuthzExtensionsCreateCall) Context(ctx context.Context) *ProjectsLocationsAuthzExtensionsCreateCall {
5690 c.ctx_ = ctx
5691 return c
5692 }
5693
5694 // Header returns a http.Header that can be modified by the caller to add
5695 // headers to the request.
5696 func (c *ProjectsLocationsAuthzExtensionsCreateCall) Header() http.Header {
5697 if c.header_ == nil {
5698 c.header_ = make(http.Header)
5699 }
5700 return c.header_
5701 }
5702
5703 func (c *ProjectsLocationsAuthzExtensionsCreateCall) doRequest(alt string) (*http.Response, error) {
5704 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5705 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.authzextension)
5706 if err != nil {
5707 return nil, err
5708 }
5709 c.urlParams_.Set("alt", alt)
5710 c.urlParams_.Set("prettyPrint", "false")
5711 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/authzExtensions")
5712 urls += "?" + c.urlParams_.Encode()
5713 req, err := http.NewRequest("POST", urls, body)
5714 if err != nil {
5715 return nil, err
5716 }
5717 req.Header = reqHeaders
5718 googleapi.Expand(req.URL, map[string]string{
5719 "parent": c.parent,
5720 })
5721 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.authzExtensions.create", "request", internallog.HTTPRequest(req, body.Bytes()))
5722 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5723 }
5724
5725 // Do executes the "networkservices.projects.locations.authzExtensions.create" call.
5726 // Any non-2xx status code is an error. Response headers are in either
5727 // *Operation.ServerResponse.Header or (if a response was returned at all) in
5728 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5729 // whether the returned error was because http.StatusNotModified was returned.
5730 func (c *ProjectsLocationsAuthzExtensionsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
5731 gensupport.SetOptions(c.urlParams_, opts...)
5732 res, err := c.doRequest("json")
5733 if res != nil && res.StatusCode == http.StatusNotModified {
5734 if res.Body != nil {
5735 res.Body.Close()
5736 }
5737 return nil, gensupport.WrapError(&googleapi.Error{
5738 Code: res.StatusCode,
5739 Header: res.Header,
5740 })
5741 }
5742 if err != nil {
5743 return nil, err
5744 }
5745 defer googleapi.CloseBody(res)
5746 if err := googleapi.CheckResponse(res); err != nil {
5747 return nil, gensupport.WrapError(err)
5748 }
5749 ret := &Operation{
5750 ServerResponse: googleapi.ServerResponse{
5751 Header: res.Header,
5752 HTTPStatusCode: res.StatusCode,
5753 },
5754 }
5755 target := &ret
5756 b, err := gensupport.DecodeResponseBytes(target, res)
5757 if err != nil {
5758 return nil, err
5759 }
5760 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.authzExtensions.create", "response", internallog.HTTPResponse(res, b))
5761 return ret, nil
5762 }
5763
5764 type ProjectsLocationsAuthzExtensionsDeleteCall struct {
5765 s *Service
5766 name string
5767 urlParams_ gensupport.URLParams
5768 ctx_ context.Context
5769 header_ http.Header
5770 }
5771
5772 // Delete: Deletes the specified `AuthzExtension` resource.
5773 //
5774 // - name: The name of the `AuthzExtension` resource to delete. Must be in the
5775 // format
5776 // `projects/{project}/locations/{location}/authzExtensions/{authz_extension}`
5777 // .
5778 func (r *ProjectsLocationsAuthzExtensionsService) Delete(name string) *ProjectsLocationsAuthzExtensionsDeleteCall {
5779 c := &ProjectsLocationsAuthzExtensionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5780 c.name = name
5781 return c
5782 }
5783
5784 // RequestId sets the optional parameter "requestId": An optional request ID to
5785 // identify requests. Specify a unique request ID so that if you must retry
5786 // your request, the server can ignore the request if it has already been
5787 // completed. The server guarantees that for 60 minutes after the first
5788 // request. For example, consider a situation where you make an initial request
5789 // and the request times out. If you make the request again with the same
5790 // request ID, the server ignores the second request This prevents clients from
5791 // accidentally creating duplicate commitments. The request ID must be a valid
5792 // UUID with the exception that zero UUID is not supported
5793 // (00000000-0000-0000-0000-000000000000).
5794 func (c *ProjectsLocationsAuthzExtensionsDeleteCall) RequestId(requestId string) *ProjectsLocationsAuthzExtensionsDeleteCall {
5795 c.urlParams_.Set("requestId", requestId)
5796 return c
5797 }
5798
5799 // Fields allows partial responses to be retrieved. See
5800 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5801 // details.
5802 func (c *ProjectsLocationsAuthzExtensionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsAuthzExtensionsDeleteCall {
5803 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5804 return c
5805 }
5806
5807 // Context sets the context to be used in this call's Do method.
5808 func (c *ProjectsLocationsAuthzExtensionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsAuthzExtensionsDeleteCall {
5809 c.ctx_ = ctx
5810 return c
5811 }
5812
5813 // Header returns a http.Header that can be modified by the caller to add
5814 // headers to the request.
5815 func (c *ProjectsLocationsAuthzExtensionsDeleteCall) Header() http.Header {
5816 if c.header_ == nil {
5817 c.header_ = make(http.Header)
5818 }
5819 return c.header_
5820 }
5821
5822 func (c *ProjectsLocationsAuthzExtensionsDeleteCall) doRequest(alt string) (*http.Response, error) {
5823 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5824 c.urlParams_.Set("alt", alt)
5825 c.urlParams_.Set("prettyPrint", "false")
5826 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
5827 urls += "?" + c.urlParams_.Encode()
5828 req, err := http.NewRequest("DELETE", urls, nil)
5829 if err != nil {
5830 return nil, err
5831 }
5832 req.Header = reqHeaders
5833 googleapi.Expand(req.URL, map[string]string{
5834 "name": c.name,
5835 })
5836 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.authzExtensions.delete", "request", internallog.HTTPRequest(req, nil))
5837 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5838 }
5839
5840 // Do executes the "networkservices.projects.locations.authzExtensions.delete" call.
5841 // Any non-2xx status code is an error. Response headers are in either
5842 // *Operation.ServerResponse.Header or (if a response was returned at all) in
5843 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5844 // whether the returned error was because http.StatusNotModified was returned.
5845 func (c *ProjectsLocationsAuthzExtensionsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
5846 gensupport.SetOptions(c.urlParams_, opts...)
5847 res, err := c.doRequest("json")
5848 if res != nil && res.StatusCode == http.StatusNotModified {
5849 if res.Body != nil {
5850 res.Body.Close()
5851 }
5852 return nil, gensupport.WrapError(&googleapi.Error{
5853 Code: res.StatusCode,
5854 Header: res.Header,
5855 })
5856 }
5857 if err != nil {
5858 return nil, err
5859 }
5860 defer googleapi.CloseBody(res)
5861 if err := googleapi.CheckResponse(res); err != nil {
5862 return nil, gensupport.WrapError(err)
5863 }
5864 ret := &Operation{
5865 ServerResponse: googleapi.ServerResponse{
5866 Header: res.Header,
5867 HTTPStatusCode: res.StatusCode,
5868 },
5869 }
5870 target := &ret
5871 b, err := gensupport.DecodeResponseBytes(target, res)
5872 if err != nil {
5873 return nil, err
5874 }
5875 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.authzExtensions.delete", "response", internallog.HTTPResponse(res, b))
5876 return ret, nil
5877 }
5878
5879 type ProjectsLocationsAuthzExtensionsGetCall struct {
5880 s *Service
5881 name string
5882 urlParams_ gensupport.URLParams
5883 ifNoneMatch_ string
5884 ctx_ context.Context
5885 header_ http.Header
5886 }
5887
5888 // Get: Gets details of the specified `AuthzExtension` resource.
5889 //
5890 // - name: A name of the `AuthzExtension` resource to get. Must be in the
5891 // format
5892 // `projects/{project}/locations/{location}/authzExtensions/{authz_extension}`
5893 // .
5894 func (r *ProjectsLocationsAuthzExtensionsService) Get(name string) *ProjectsLocationsAuthzExtensionsGetCall {
5895 c := &ProjectsLocationsAuthzExtensionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5896 c.name = name
5897 return c
5898 }
5899
5900 // Fields allows partial responses to be retrieved. See
5901 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5902 // details.
5903 func (c *ProjectsLocationsAuthzExtensionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsAuthzExtensionsGetCall {
5904 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5905 return c
5906 }
5907
5908 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5909 // object's ETag matches the given value. This is useful for getting updates
5910 // only after the object has changed since the last request.
5911 func (c *ProjectsLocationsAuthzExtensionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsAuthzExtensionsGetCall {
5912 c.ifNoneMatch_ = entityTag
5913 return c
5914 }
5915
5916 // Context sets the context to be used in this call's Do method.
5917 func (c *ProjectsLocationsAuthzExtensionsGetCall) Context(ctx context.Context) *ProjectsLocationsAuthzExtensionsGetCall {
5918 c.ctx_ = ctx
5919 return c
5920 }
5921
5922 // Header returns a http.Header that can be modified by the caller to add
5923 // headers to the request.
5924 func (c *ProjectsLocationsAuthzExtensionsGetCall) Header() http.Header {
5925 if c.header_ == nil {
5926 c.header_ = make(http.Header)
5927 }
5928 return c.header_
5929 }
5930
5931 func (c *ProjectsLocationsAuthzExtensionsGetCall) doRequest(alt string) (*http.Response, error) {
5932 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5933 if c.ifNoneMatch_ != "" {
5934 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5935 }
5936 c.urlParams_.Set("alt", alt)
5937 c.urlParams_.Set("prettyPrint", "false")
5938 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
5939 urls += "?" + c.urlParams_.Encode()
5940 req, err := http.NewRequest("GET", urls, nil)
5941 if err != nil {
5942 return nil, err
5943 }
5944 req.Header = reqHeaders
5945 googleapi.Expand(req.URL, map[string]string{
5946 "name": c.name,
5947 })
5948 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.authzExtensions.get", "request", internallog.HTTPRequest(req, nil))
5949 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5950 }
5951
5952 // Do executes the "networkservices.projects.locations.authzExtensions.get" call.
5953 // Any non-2xx status code is an error. Response headers are in either
5954 // *AuthzExtension.ServerResponse.Header or (if a response was returned at all)
5955 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5956 // whether the returned error was because http.StatusNotModified was returned.
5957 func (c *ProjectsLocationsAuthzExtensionsGetCall) Do(opts ...googleapi.CallOption) (*AuthzExtension, error) {
5958 gensupport.SetOptions(c.urlParams_, opts...)
5959 res, err := c.doRequest("json")
5960 if res != nil && res.StatusCode == http.StatusNotModified {
5961 if res.Body != nil {
5962 res.Body.Close()
5963 }
5964 return nil, gensupport.WrapError(&googleapi.Error{
5965 Code: res.StatusCode,
5966 Header: res.Header,
5967 })
5968 }
5969 if err != nil {
5970 return nil, err
5971 }
5972 defer googleapi.CloseBody(res)
5973 if err := googleapi.CheckResponse(res); err != nil {
5974 return nil, gensupport.WrapError(err)
5975 }
5976 ret := &AuthzExtension{
5977 ServerResponse: googleapi.ServerResponse{
5978 Header: res.Header,
5979 HTTPStatusCode: res.StatusCode,
5980 },
5981 }
5982 target := &ret
5983 b, err := gensupport.DecodeResponseBytes(target, res)
5984 if err != nil {
5985 return nil, err
5986 }
5987 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.authzExtensions.get", "response", internallog.HTTPResponse(res, b))
5988 return ret, nil
5989 }
5990
5991 type ProjectsLocationsAuthzExtensionsListCall struct {
5992 s *Service
5993 parent string
5994 urlParams_ gensupport.URLParams
5995 ifNoneMatch_ string
5996 ctx_ context.Context
5997 header_ http.Header
5998 }
5999
6000 // List: Lists `AuthzExtension` resources in a given project and location.
6001 //
6002 // - parent: The project and location from which the `AuthzExtension` resources
6003 // are listed. These values are specified in the following format:
6004 // `projects/{project}/locations/{location}`.
6005 func (r *ProjectsLocationsAuthzExtensionsService) List(parent string) *ProjectsLocationsAuthzExtensionsListCall {
6006 c := &ProjectsLocationsAuthzExtensionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6007 c.parent = parent
6008 return c
6009 }
6010
6011 // Filter sets the optional parameter "filter": Filtering results.
6012 func (c *ProjectsLocationsAuthzExtensionsListCall) Filter(filter string) *ProjectsLocationsAuthzExtensionsListCall {
6013 c.urlParams_.Set("filter", filter)
6014 return c
6015 }
6016
6017 // OrderBy sets the optional parameter "orderBy": Hint about how to order the
6018 // results.
6019 func (c *ProjectsLocationsAuthzExtensionsListCall) OrderBy(orderBy string) *ProjectsLocationsAuthzExtensionsListCall {
6020 c.urlParams_.Set("orderBy", orderBy)
6021 return c
6022 }
6023
6024 // PageSize sets the optional parameter "pageSize": Requested page size. The
6025 // server might return fewer items than requested. If unspecified, the server
6026 // picks an appropriate default.
6027 func (c *ProjectsLocationsAuthzExtensionsListCall) PageSize(pageSize int64) *ProjectsLocationsAuthzExtensionsListCall {
6028 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
6029 return c
6030 }
6031
6032 // PageToken sets the optional parameter "pageToken": A token identifying a
6033 // page of results that the server returns.
6034 func (c *ProjectsLocationsAuthzExtensionsListCall) PageToken(pageToken string) *ProjectsLocationsAuthzExtensionsListCall {
6035 c.urlParams_.Set("pageToken", pageToken)
6036 return c
6037 }
6038
6039 // Fields allows partial responses to be retrieved. See
6040 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6041 // details.
6042 func (c *ProjectsLocationsAuthzExtensionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsAuthzExtensionsListCall {
6043 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6044 return c
6045 }
6046
6047 // IfNoneMatch sets an optional parameter which makes the operation fail if the
6048 // object's ETag matches the given value. This is useful for getting updates
6049 // only after the object has changed since the last request.
6050 func (c *ProjectsLocationsAuthzExtensionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsAuthzExtensionsListCall {
6051 c.ifNoneMatch_ = entityTag
6052 return c
6053 }
6054
6055 // Context sets the context to be used in this call's Do method.
6056 func (c *ProjectsLocationsAuthzExtensionsListCall) Context(ctx context.Context) *ProjectsLocationsAuthzExtensionsListCall {
6057 c.ctx_ = ctx
6058 return c
6059 }
6060
6061 // Header returns a http.Header that can be modified by the caller to add
6062 // headers to the request.
6063 func (c *ProjectsLocationsAuthzExtensionsListCall) Header() http.Header {
6064 if c.header_ == nil {
6065 c.header_ = make(http.Header)
6066 }
6067 return c.header_
6068 }
6069
6070 func (c *ProjectsLocationsAuthzExtensionsListCall) doRequest(alt string) (*http.Response, error) {
6071 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6072 if c.ifNoneMatch_ != "" {
6073 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6074 }
6075 c.urlParams_.Set("alt", alt)
6076 c.urlParams_.Set("prettyPrint", "false")
6077 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/authzExtensions")
6078 urls += "?" + c.urlParams_.Encode()
6079 req, err := http.NewRequest("GET", urls, nil)
6080 if err != nil {
6081 return nil, err
6082 }
6083 req.Header = reqHeaders
6084 googleapi.Expand(req.URL, map[string]string{
6085 "parent": c.parent,
6086 })
6087 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.authzExtensions.list", "request", internallog.HTTPRequest(req, nil))
6088 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6089 }
6090
6091 // Do executes the "networkservices.projects.locations.authzExtensions.list" call.
6092 // Any non-2xx status code is an error. Response headers are in either
6093 // *ListAuthzExtensionsResponse.ServerResponse.Header or (if a response was
6094 // returned at all) in error.(*googleapi.Error).Header. Use
6095 // googleapi.IsNotModified to check whether the returned error was because
6096 // http.StatusNotModified was returned.
6097 func (c *ProjectsLocationsAuthzExtensionsListCall) Do(opts ...googleapi.CallOption) (*ListAuthzExtensionsResponse, error) {
6098 gensupport.SetOptions(c.urlParams_, opts...)
6099 res, err := c.doRequest("json")
6100 if res != nil && res.StatusCode == http.StatusNotModified {
6101 if res.Body != nil {
6102 res.Body.Close()
6103 }
6104 return nil, gensupport.WrapError(&googleapi.Error{
6105 Code: res.StatusCode,
6106 Header: res.Header,
6107 })
6108 }
6109 if err != nil {
6110 return nil, err
6111 }
6112 defer googleapi.CloseBody(res)
6113 if err := googleapi.CheckResponse(res); err != nil {
6114 return nil, gensupport.WrapError(err)
6115 }
6116 ret := &ListAuthzExtensionsResponse{
6117 ServerResponse: googleapi.ServerResponse{
6118 Header: res.Header,
6119 HTTPStatusCode: res.StatusCode,
6120 },
6121 }
6122 target := &ret
6123 b, err := gensupport.DecodeResponseBytes(target, res)
6124 if err != nil {
6125 return nil, err
6126 }
6127 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.authzExtensions.list", "response", internallog.HTTPResponse(res, b))
6128 return ret, nil
6129 }
6130
6131 // Pages invokes f for each page of results.
6132 // A non-nil error returned from f will halt the iteration.
6133 // The provided context supersedes any context provided to the Context method.
6134 func (c *ProjectsLocationsAuthzExtensionsListCall) Pages(ctx context.Context, f func(*ListAuthzExtensionsResponse) error) error {
6135 c.ctx_ = ctx
6136 defer c.PageToken(c.urlParams_.Get("pageToken"))
6137 for {
6138 x, err := c.Do()
6139 if err != nil {
6140 return err
6141 }
6142 if err := f(x); err != nil {
6143 return err
6144 }
6145 if x.NextPageToken == "" {
6146 return nil
6147 }
6148 c.PageToken(x.NextPageToken)
6149 }
6150 }
6151
6152 type ProjectsLocationsAuthzExtensionsPatchCall struct {
6153 s *Service
6154 name string
6155 authzextension *AuthzExtension
6156 urlParams_ gensupport.URLParams
6157 ctx_ context.Context
6158 header_ http.Header
6159 }
6160
6161 // Patch: Updates the parameters of the specified `AuthzExtension` resource.
6162 //
6163 // - name: Identifier. Name of the `AuthzExtension` resource in the following
6164 // format:
6165 // `projects/{project}/locations/{location}/authzExtensions/{authz_extension}`
6166 // .
6167 func (r *ProjectsLocationsAuthzExtensionsService) Patch(name string, authzextension *AuthzExtension) *ProjectsLocationsAuthzExtensionsPatchCall {
6168 c := &ProjectsLocationsAuthzExtensionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6169 c.name = name
6170 c.authzextension = authzextension
6171 return c
6172 }
6173
6174 // RequestId sets the optional parameter "requestId": An optional request ID to
6175 // identify requests. Specify a unique request ID so that if you must retry
6176 // your request, the server can ignore the request if it has already been
6177 // completed. The server guarantees that for 60 minutes since the first
6178 // request. For example, consider a situation where you make an initial request
6179 // and the request times out. If you make the request again with the same
6180 // request ID, the server ignores the second request This prevents clients from
6181 // accidentally creating duplicate commitments. The request ID must be a valid
6182 // UUID with the exception that zero UUID is not supported
6183 // (00000000-0000-0000-0000-000000000000).
6184 func (c *ProjectsLocationsAuthzExtensionsPatchCall) RequestId(requestId string) *ProjectsLocationsAuthzExtensionsPatchCall {
6185 c.urlParams_.Set("requestId", requestId)
6186 return c
6187 }
6188
6189 // UpdateMask sets the optional parameter "updateMask": Required. Used to
6190 // specify the fields to be overwritten in the `AuthzExtension` resource by the
6191 // update. The fields specified in the `update_mask` are relative to the
6192 // resource, not the full request. A field is overwritten if it is in the mask.
6193 // If the user does not specify a mask, then all fields are overwritten.
6194 func (c *ProjectsLocationsAuthzExtensionsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsAuthzExtensionsPatchCall {
6195 c.urlParams_.Set("updateMask", updateMask)
6196 return c
6197 }
6198
6199 // Fields allows partial responses to be retrieved. See
6200 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6201 // details.
6202 func (c *ProjectsLocationsAuthzExtensionsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsAuthzExtensionsPatchCall {
6203 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6204 return c
6205 }
6206
6207 // Context sets the context to be used in this call's Do method.
6208 func (c *ProjectsLocationsAuthzExtensionsPatchCall) Context(ctx context.Context) *ProjectsLocationsAuthzExtensionsPatchCall {
6209 c.ctx_ = ctx
6210 return c
6211 }
6212
6213 // Header returns a http.Header that can be modified by the caller to add
6214 // headers to the request.
6215 func (c *ProjectsLocationsAuthzExtensionsPatchCall) Header() http.Header {
6216 if c.header_ == nil {
6217 c.header_ = make(http.Header)
6218 }
6219 return c.header_
6220 }
6221
6222 func (c *ProjectsLocationsAuthzExtensionsPatchCall) doRequest(alt string) (*http.Response, error) {
6223 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6224 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.authzextension)
6225 if err != nil {
6226 return nil, err
6227 }
6228 c.urlParams_.Set("alt", alt)
6229 c.urlParams_.Set("prettyPrint", "false")
6230 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
6231 urls += "?" + c.urlParams_.Encode()
6232 req, err := http.NewRequest("PATCH", urls, body)
6233 if err != nil {
6234 return nil, err
6235 }
6236 req.Header = reqHeaders
6237 googleapi.Expand(req.URL, map[string]string{
6238 "name": c.name,
6239 })
6240 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.authzExtensions.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
6241 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6242 }
6243
6244 // Do executes the "networkservices.projects.locations.authzExtensions.patch" call.
6245 // Any non-2xx status code is an error. Response headers are in either
6246 // *Operation.ServerResponse.Header or (if a response was returned at all) in
6247 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6248 // whether the returned error was because http.StatusNotModified was returned.
6249 func (c *ProjectsLocationsAuthzExtensionsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
6250 gensupport.SetOptions(c.urlParams_, opts...)
6251 res, err := c.doRequest("json")
6252 if res != nil && res.StatusCode == http.StatusNotModified {
6253 if res.Body != nil {
6254 res.Body.Close()
6255 }
6256 return nil, gensupport.WrapError(&googleapi.Error{
6257 Code: res.StatusCode,
6258 Header: res.Header,
6259 })
6260 }
6261 if err != nil {
6262 return nil, err
6263 }
6264 defer googleapi.CloseBody(res)
6265 if err := googleapi.CheckResponse(res); err != nil {
6266 return nil, gensupport.WrapError(err)
6267 }
6268 ret := &Operation{
6269 ServerResponse: googleapi.ServerResponse{
6270 Header: res.Header,
6271 HTTPStatusCode: res.StatusCode,
6272 },
6273 }
6274 target := &ret
6275 b, err := gensupport.DecodeResponseBytes(target, res)
6276 if err != nil {
6277 return nil, err
6278 }
6279 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.authzExtensions.patch", "response", internallog.HTTPResponse(res, b))
6280 return ret, nil
6281 }
6282
6283 type ProjectsLocationsEndpointPoliciesCreateCall struct {
6284 s *Service
6285 parent string
6286 endpointpolicy *EndpointPolicy
6287 urlParams_ gensupport.URLParams
6288 ctx_ context.Context
6289 header_ http.Header
6290 }
6291
6292 // Create: Creates a new EndpointPolicy in a given project and location.
6293 //
6294 // - parent: The parent resource of the EndpointPolicy. Must be in the format
6295 // `projects/*/locations/*`.
6296 func (r *ProjectsLocationsEndpointPoliciesService) Create(parent string, endpointpolicy *EndpointPolicy) *ProjectsLocationsEndpointPoliciesCreateCall {
6297 c := &ProjectsLocationsEndpointPoliciesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6298 c.parent = parent
6299 c.endpointpolicy = endpointpolicy
6300 return c
6301 }
6302
6303 // EndpointPolicyId sets the optional parameter "endpointPolicyId": Required.
6304 // Short name of the EndpointPolicy resource to be created. E.g. "CustomECS".
6305 func (c *ProjectsLocationsEndpointPoliciesCreateCall) EndpointPolicyId(endpointPolicyId string) *ProjectsLocationsEndpointPoliciesCreateCall {
6306 c.urlParams_.Set("endpointPolicyId", endpointPolicyId)
6307 return c
6308 }
6309
6310 // Fields allows partial responses to be retrieved. See
6311 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6312 // details.
6313 func (c *ProjectsLocationsEndpointPoliciesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsEndpointPoliciesCreateCall {
6314 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6315 return c
6316 }
6317
6318 // Context sets the context to be used in this call's Do method.
6319 func (c *ProjectsLocationsEndpointPoliciesCreateCall) Context(ctx context.Context) *ProjectsLocationsEndpointPoliciesCreateCall {
6320 c.ctx_ = ctx
6321 return c
6322 }
6323
6324 // Header returns a http.Header that can be modified by the caller to add
6325 // headers to the request.
6326 func (c *ProjectsLocationsEndpointPoliciesCreateCall) Header() http.Header {
6327 if c.header_ == nil {
6328 c.header_ = make(http.Header)
6329 }
6330 return c.header_
6331 }
6332
6333 func (c *ProjectsLocationsEndpointPoliciesCreateCall) doRequest(alt string) (*http.Response, error) {
6334 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6335 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.endpointpolicy)
6336 if err != nil {
6337 return nil, err
6338 }
6339 c.urlParams_.Set("alt", alt)
6340 c.urlParams_.Set("prettyPrint", "false")
6341 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/endpointPolicies")
6342 urls += "?" + c.urlParams_.Encode()
6343 req, err := http.NewRequest("POST", urls, body)
6344 if err != nil {
6345 return nil, err
6346 }
6347 req.Header = reqHeaders
6348 googleapi.Expand(req.URL, map[string]string{
6349 "parent": c.parent,
6350 })
6351 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.endpointPolicies.create", "request", internallog.HTTPRequest(req, body.Bytes()))
6352 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6353 }
6354
6355 // Do executes the "networkservices.projects.locations.endpointPolicies.create" call.
6356 // Any non-2xx status code is an error. Response headers are in either
6357 // *Operation.ServerResponse.Header or (if a response was returned at all) in
6358 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6359 // whether the returned error was because http.StatusNotModified was returned.
6360 func (c *ProjectsLocationsEndpointPoliciesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
6361 gensupport.SetOptions(c.urlParams_, opts...)
6362 res, err := c.doRequest("json")
6363 if res != nil && res.StatusCode == http.StatusNotModified {
6364 if res.Body != nil {
6365 res.Body.Close()
6366 }
6367 return nil, gensupport.WrapError(&googleapi.Error{
6368 Code: res.StatusCode,
6369 Header: res.Header,
6370 })
6371 }
6372 if err != nil {
6373 return nil, err
6374 }
6375 defer googleapi.CloseBody(res)
6376 if err := googleapi.CheckResponse(res); err != nil {
6377 return nil, gensupport.WrapError(err)
6378 }
6379 ret := &Operation{
6380 ServerResponse: googleapi.ServerResponse{
6381 Header: res.Header,
6382 HTTPStatusCode: res.StatusCode,
6383 },
6384 }
6385 target := &ret
6386 b, err := gensupport.DecodeResponseBytes(target, res)
6387 if err != nil {
6388 return nil, err
6389 }
6390 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.endpointPolicies.create", "response", internallog.HTTPResponse(res, b))
6391 return ret, nil
6392 }
6393
6394 type ProjectsLocationsEndpointPoliciesDeleteCall struct {
6395 s *Service
6396 name string
6397 urlParams_ gensupport.URLParams
6398 ctx_ context.Context
6399 header_ http.Header
6400 }
6401
6402 // Delete: Deletes a single EndpointPolicy.
6403 //
6404 // - name: A name of the EndpointPolicy to delete. Must be in the format
6405 // `projects/*/locations/*/endpointPolicies/*`.
6406 func (r *ProjectsLocationsEndpointPoliciesService) Delete(name string) *ProjectsLocationsEndpointPoliciesDeleteCall {
6407 c := &ProjectsLocationsEndpointPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6408 c.name = name
6409 return c
6410 }
6411
6412 // Fields allows partial responses to be retrieved. See
6413 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6414 // details.
6415 func (c *ProjectsLocationsEndpointPoliciesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsEndpointPoliciesDeleteCall {
6416 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6417 return c
6418 }
6419
6420 // Context sets the context to be used in this call's Do method.
6421 func (c *ProjectsLocationsEndpointPoliciesDeleteCall) Context(ctx context.Context) *ProjectsLocationsEndpointPoliciesDeleteCall {
6422 c.ctx_ = ctx
6423 return c
6424 }
6425
6426 // Header returns a http.Header that can be modified by the caller to add
6427 // headers to the request.
6428 func (c *ProjectsLocationsEndpointPoliciesDeleteCall) Header() http.Header {
6429 if c.header_ == nil {
6430 c.header_ = make(http.Header)
6431 }
6432 return c.header_
6433 }
6434
6435 func (c *ProjectsLocationsEndpointPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
6436 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6437 c.urlParams_.Set("alt", alt)
6438 c.urlParams_.Set("prettyPrint", "false")
6439 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
6440 urls += "?" + c.urlParams_.Encode()
6441 req, err := http.NewRequest("DELETE", urls, nil)
6442 if err != nil {
6443 return nil, err
6444 }
6445 req.Header = reqHeaders
6446 googleapi.Expand(req.URL, map[string]string{
6447 "name": c.name,
6448 })
6449 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.endpointPolicies.delete", "request", internallog.HTTPRequest(req, nil))
6450 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6451 }
6452
6453 // Do executes the "networkservices.projects.locations.endpointPolicies.delete" call.
6454 // Any non-2xx status code is an error. Response headers are in either
6455 // *Operation.ServerResponse.Header or (if a response was returned at all) in
6456 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6457 // whether the returned error was because http.StatusNotModified was returned.
6458 func (c *ProjectsLocationsEndpointPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
6459 gensupport.SetOptions(c.urlParams_, opts...)
6460 res, err := c.doRequest("json")
6461 if res != nil && res.StatusCode == http.StatusNotModified {
6462 if res.Body != nil {
6463 res.Body.Close()
6464 }
6465 return nil, gensupport.WrapError(&googleapi.Error{
6466 Code: res.StatusCode,
6467 Header: res.Header,
6468 })
6469 }
6470 if err != nil {
6471 return nil, err
6472 }
6473 defer googleapi.CloseBody(res)
6474 if err := googleapi.CheckResponse(res); err != nil {
6475 return nil, gensupport.WrapError(err)
6476 }
6477 ret := &Operation{
6478 ServerResponse: googleapi.ServerResponse{
6479 Header: res.Header,
6480 HTTPStatusCode: res.StatusCode,
6481 },
6482 }
6483 target := &ret
6484 b, err := gensupport.DecodeResponseBytes(target, res)
6485 if err != nil {
6486 return nil, err
6487 }
6488 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.endpointPolicies.delete", "response", internallog.HTTPResponse(res, b))
6489 return ret, nil
6490 }
6491
6492 type ProjectsLocationsEndpointPoliciesGetCall struct {
6493 s *Service
6494 name string
6495 urlParams_ gensupport.URLParams
6496 ifNoneMatch_ string
6497 ctx_ context.Context
6498 header_ http.Header
6499 }
6500
6501 // Get: Gets details of a single EndpointPolicy.
6502 //
6503 // - name: A name of the EndpointPolicy to get. Must be in the format
6504 // `projects/*/locations/*/endpointPolicies/*`.
6505 func (r *ProjectsLocationsEndpointPoliciesService) Get(name string) *ProjectsLocationsEndpointPoliciesGetCall {
6506 c := &ProjectsLocationsEndpointPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6507 c.name = name
6508 return c
6509 }
6510
6511 // Fields allows partial responses to be retrieved. See
6512 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6513 // details.
6514 func (c *ProjectsLocationsEndpointPoliciesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsEndpointPoliciesGetCall {
6515 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6516 return c
6517 }
6518
6519 // IfNoneMatch sets an optional parameter which makes the operation fail if the
6520 // object's ETag matches the given value. This is useful for getting updates
6521 // only after the object has changed since the last request.
6522 func (c *ProjectsLocationsEndpointPoliciesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsEndpointPoliciesGetCall {
6523 c.ifNoneMatch_ = entityTag
6524 return c
6525 }
6526
6527 // Context sets the context to be used in this call's Do method.
6528 func (c *ProjectsLocationsEndpointPoliciesGetCall) Context(ctx context.Context) *ProjectsLocationsEndpointPoliciesGetCall {
6529 c.ctx_ = ctx
6530 return c
6531 }
6532
6533 // Header returns a http.Header that can be modified by the caller to add
6534 // headers to the request.
6535 func (c *ProjectsLocationsEndpointPoliciesGetCall) Header() http.Header {
6536 if c.header_ == nil {
6537 c.header_ = make(http.Header)
6538 }
6539 return c.header_
6540 }
6541
6542 func (c *ProjectsLocationsEndpointPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
6543 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6544 if c.ifNoneMatch_ != "" {
6545 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6546 }
6547 c.urlParams_.Set("alt", alt)
6548 c.urlParams_.Set("prettyPrint", "false")
6549 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
6550 urls += "?" + c.urlParams_.Encode()
6551 req, err := http.NewRequest("GET", urls, nil)
6552 if err != nil {
6553 return nil, err
6554 }
6555 req.Header = reqHeaders
6556 googleapi.Expand(req.URL, map[string]string{
6557 "name": c.name,
6558 })
6559 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.endpointPolicies.get", "request", internallog.HTTPRequest(req, nil))
6560 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6561 }
6562
6563 // Do executes the "networkservices.projects.locations.endpointPolicies.get" call.
6564 // Any non-2xx status code is an error. Response headers are in either
6565 // *EndpointPolicy.ServerResponse.Header or (if a response was returned at all)
6566 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6567 // whether the returned error was because http.StatusNotModified was returned.
6568 func (c *ProjectsLocationsEndpointPoliciesGetCall) Do(opts ...googleapi.CallOption) (*EndpointPolicy, error) {
6569 gensupport.SetOptions(c.urlParams_, opts...)
6570 res, err := c.doRequest("json")
6571 if res != nil && res.StatusCode == http.StatusNotModified {
6572 if res.Body != nil {
6573 res.Body.Close()
6574 }
6575 return nil, gensupport.WrapError(&googleapi.Error{
6576 Code: res.StatusCode,
6577 Header: res.Header,
6578 })
6579 }
6580 if err != nil {
6581 return nil, err
6582 }
6583 defer googleapi.CloseBody(res)
6584 if err := googleapi.CheckResponse(res); err != nil {
6585 return nil, gensupport.WrapError(err)
6586 }
6587 ret := &EndpointPolicy{
6588 ServerResponse: googleapi.ServerResponse{
6589 Header: res.Header,
6590 HTTPStatusCode: res.StatusCode,
6591 },
6592 }
6593 target := &ret
6594 b, err := gensupport.DecodeResponseBytes(target, res)
6595 if err != nil {
6596 return nil, err
6597 }
6598 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.endpointPolicies.get", "response", internallog.HTTPResponse(res, b))
6599 return ret, nil
6600 }
6601
6602 type ProjectsLocationsEndpointPoliciesListCall struct {
6603 s *Service
6604 parent string
6605 urlParams_ gensupport.URLParams
6606 ifNoneMatch_ string
6607 ctx_ context.Context
6608 header_ http.Header
6609 }
6610
6611 // List: Lists EndpointPolicies in a given project and location.
6612 //
6613 // - parent: The project and location from which the EndpointPolicies should be
6614 // listed, specified in the format `projects/*/locations/*`.
6615 func (r *ProjectsLocationsEndpointPoliciesService) List(parent string) *ProjectsLocationsEndpointPoliciesListCall {
6616 c := &ProjectsLocationsEndpointPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6617 c.parent = parent
6618 return c
6619 }
6620
6621 // PageSize sets the optional parameter "pageSize": Maximum number of
6622 // EndpointPolicies to return per call.
6623 func (c *ProjectsLocationsEndpointPoliciesListCall) PageSize(pageSize int64) *ProjectsLocationsEndpointPoliciesListCall {
6624 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
6625 return c
6626 }
6627
6628 // PageToken sets the optional parameter "pageToken": The value returned by the
6629 // last `ListEndpointPoliciesResponse` Indicates that this is a continuation of
6630 // a prior `ListEndpointPolicies` call, and that the system should return the
6631 // next page of data.
6632 func (c *ProjectsLocationsEndpointPoliciesListCall) PageToken(pageToken string) *ProjectsLocationsEndpointPoliciesListCall {
6633 c.urlParams_.Set("pageToken", pageToken)
6634 return c
6635 }
6636
6637 // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": If
6638 // true, allow partial responses for multi-regional Aggregated List requests.
6639 // Otherwise if one of the locations is down or unreachable, the Aggregated
6640 // List request will fail.
6641 func (c *ProjectsLocationsEndpointPoliciesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ProjectsLocationsEndpointPoliciesListCall {
6642 c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
6643 return c
6644 }
6645
6646 // Fields allows partial responses to be retrieved. See
6647 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6648 // details.
6649 func (c *ProjectsLocationsEndpointPoliciesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsEndpointPoliciesListCall {
6650 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6651 return c
6652 }
6653
6654 // IfNoneMatch sets an optional parameter which makes the operation fail if the
6655 // object's ETag matches the given value. This is useful for getting updates
6656 // only after the object has changed since the last request.
6657 func (c *ProjectsLocationsEndpointPoliciesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsEndpointPoliciesListCall {
6658 c.ifNoneMatch_ = entityTag
6659 return c
6660 }
6661
6662 // Context sets the context to be used in this call's Do method.
6663 func (c *ProjectsLocationsEndpointPoliciesListCall) Context(ctx context.Context) *ProjectsLocationsEndpointPoliciesListCall {
6664 c.ctx_ = ctx
6665 return c
6666 }
6667
6668 // Header returns a http.Header that can be modified by the caller to add
6669 // headers to the request.
6670 func (c *ProjectsLocationsEndpointPoliciesListCall) Header() http.Header {
6671 if c.header_ == nil {
6672 c.header_ = make(http.Header)
6673 }
6674 return c.header_
6675 }
6676
6677 func (c *ProjectsLocationsEndpointPoliciesListCall) doRequest(alt string) (*http.Response, error) {
6678 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6679 if c.ifNoneMatch_ != "" {
6680 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6681 }
6682 c.urlParams_.Set("alt", alt)
6683 c.urlParams_.Set("prettyPrint", "false")
6684 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/endpointPolicies")
6685 urls += "?" + c.urlParams_.Encode()
6686 req, err := http.NewRequest("GET", urls, nil)
6687 if err != nil {
6688 return nil, err
6689 }
6690 req.Header = reqHeaders
6691 googleapi.Expand(req.URL, map[string]string{
6692 "parent": c.parent,
6693 })
6694 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.endpointPolicies.list", "request", internallog.HTTPRequest(req, nil))
6695 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6696 }
6697
6698 // Do executes the "networkservices.projects.locations.endpointPolicies.list" call.
6699 // Any non-2xx status code is an error. Response headers are in either
6700 // *ListEndpointPoliciesResponse.ServerResponse.Header or (if a response was
6701 // returned at all) in error.(*googleapi.Error).Header. Use
6702 // googleapi.IsNotModified to check whether the returned error was because
6703 // http.StatusNotModified was returned.
6704 func (c *ProjectsLocationsEndpointPoliciesListCall) Do(opts ...googleapi.CallOption) (*ListEndpointPoliciesResponse, error) {
6705 gensupport.SetOptions(c.urlParams_, opts...)
6706 res, err := c.doRequest("json")
6707 if res != nil && res.StatusCode == http.StatusNotModified {
6708 if res.Body != nil {
6709 res.Body.Close()
6710 }
6711 return nil, gensupport.WrapError(&googleapi.Error{
6712 Code: res.StatusCode,
6713 Header: res.Header,
6714 })
6715 }
6716 if err != nil {
6717 return nil, err
6718 }
6719 defer googleapi.CloseBody(res)
6720 if err := googleapi.CheckResponse(res); err != nil {
6721 return nil, gensupport.WrapError(err)
6722 }
6723 ret := &ListEndpointPoliciesResponse{
6724 ServerResponse: googleapi.ServerResponse{
6725 Header: res.Header,
6726 HTTPStatusCode: res.StatusCode,
6727 },
6728 }
6729 target := &ret
6730 b, err := gensupport.DecodeResponseBytes(target, res)
6731 if err != nil {
6732 return nil, err
6733 }
6734 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.endpointPolicies.list", "response", internallog.HTTPResponse(res, b))
6735 return ret, nil
6736 }
6737
6738 // Pages invokes f for each page of results.
6739 // A non-nil error returned from f will halt the iteration.
6740 // The provided context supersedes any context provided to the Context method.
6741 func (c *ProjectsLocationsEndpointPoliciesListCall) Pages(ctx context.Context, f func(*ListEndpointPoliciesResponse) error) error {
6742 c.ctx_ = ctx
6743 defer c.PageToken(c.urlParams_.Get("pageToken"))
6744 for {
6745 x, err := c.Do()
6746 if err != nil {
6747 return err
6748 }
6749 if err := f(x); err != nil {
6750 return err
6751 }
6752 if x.NextPageToken == "" {
6753 return nil
6754 }
6755 c.PageToken(x.NextPageToken)
6756 }
6757 }
6758
6759 type ProjectsLocationsEndpointPoliciesPatchCall struct {
6760 s *Service
6761 name string
6762 endpointpolicy *EndpointPolicy
6763 urlParams_ gensupport.URLParams
6764 ctx_ context.Context
6765 header_ http.Header
6766 }
6767
6768 // Patch: Updates the parameters of a single EndpointPolicy.
6769 //
6770 // - name: Identifier. Name of the EndpointPolicy resource. It matches pattern
6771 // `projects/{project}/locations/*/endpointPolicies/{endpoint_policy}`.
6772 func (r *ProjectsLocationsEndpointPoliciesService) Patch(name string, endpointpolicy *EndpointPolicy) *ProjectsLocationsEndpointPoliciesPatchCall {
6773 c := &ProjectsLocationsEndpointPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6774 c.name = name
6775 c.endpointpolicy = endpointpolicy
6776 return c
6777 }
6778
6779 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
6780 // specify the fields to be overwritten in the EndpointPolicy resource by the
6781 // update. The fields specified in the update_mask are relative to the
6782 // resource, not the full request. A field will be overwritten if it is in the
6783 // mask. If the user does not provide a mask then all fields will be
6784 // overwritten.
6785 func (c *ProjectsLocationsEndpointPoliciesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsEndpointPoliciesPatchCall {
6786 c.urlParams_.Set("updateMask", updateMask)
6787 return c
6788 }
6789
6790 // Fields allows partial responses to be retrieved. See
6791 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6792 // details.
6793 func (c *ProjectsLocationsEndpointPoliciesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsEndpointPoliciesPatchCall {
6794 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6795 return c
6796 }
6797
6798 // Context sets the context to be used in this call's Do method.
6799 func (c *ProjectsLocationsEndpointPoliciesPatchCall) Context(ctx context.Context) *ProjectsLocationsEndpointPoliciesPatchCall {
6800 c.ctx_ = ctx
6801 return c
6802 }
6803
6804 // Header returns a http.Header that can be modified by the caller to add
6805 // headers to the request.
6806 func (c *ProjectsLocationsEndpointPoliciesPatchCall) Header() http.Header {
6807 if c.header_ == nil {
6808 c.header_ = make(http.Header)
6809 }
6810 return c.header_
6811 }
6812
6813 func (c *ProjectsLocationsEndpointPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
6814 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6815 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.endpointpolicy)
6816 if err != nil {
6817 return nil, err
6818 }
6819 c.urlParams_.Set("alt", alt)
6820 c.urlParams_.Set("prettyPrint", "false")
6821 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
6822 urls += "?" + c.urlParams_.Encode()
6823 req, err := http.NewRequest("PATCH", urls, body)
6824 if err != nil {
6825 return nil, err
6826 }
6827 req.Header = reqHeaders
6828 googleapi.Expand(req.URL, map[string]string{
6829 "name": c.name,
6830 })
6831 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.endpointPolicies.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
6832 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6833 }
6834
6835 // Do executes the "networkservices.projects.locations.endpointPolicies.patch" call.
6836 // Any non-2xx status code is an error. Response headers are in either
6837 // *Operation.ServerResponse.Header or (if a response was returned at all) in
6838 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6839 // whether the returned error was because http.StatusNotModified was returned.
6840 func (c *ProjectsLocationsEndpointPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
6841 gensupport.SetOptions(c.urlParams_, opts...)
6842 res, err := c.doRequest("json")
6843 if res != nil && res.StatusCode == http.StatusNotModified {
6844 if res.Body != nil {
6845 res.Body.Close()
6846 }
6847 return nil, gensupport.WrapError(&googleapi.Error{
6848 Code: res.StatusCode,
6849 Header: res.Header,
6850 })
6851 }
6852 if err != nil {
6853 return nil, err
6854 }
6855 defer googleapi.CloseBody(res)
6856 if err := googleapi.CheckResponse(res); err != nil {
6857 return nil, gensupport.WrapError(err)
6858 }
6859 ret := &Operation{
6860 ServerResponse: googleapi.ServerResponse{
6861 Header: res.Header,
6862 HTTPStatusCode: res.StatusCode,
6863 },
6864 }
6865 target := &ret
6866 b, err := gensupport.DecodeResponseBytes(target, res)
6867 if err != nil {
6868 return nil, err
6869 }
6870 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.endpointPolicies.patch", "response", internallog.HTTPResponse(res, b))
6871 return ret, nil
6872 }
6873
6874 type ProjectsLocationsGatewaysCreateCall struct {
6875 s *Service
6876 parent string
6877 gateway *Gateway
6878 urlParams_ gensupport.URLParams
6879 ctx_ context.Context
6880 header_ http.Header
6881 }
6882
6883 // Create: Creates a new Gateway in a given project and location.
6884 //
6885 // - parent: The parent resource of the Gateway. Must be in the format
6886 // `projects/*/locations/*`.
6887 func (r *ProjectsLocationsGatewaysService) Create(parent string, gateway *Gateway) *ProjectsLocationsGatewaysCreateCall {
6888 c := &ProjectsLocationsGatewaysCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6889 c.parent = parent
6890 c.gateway = gateway
6891 return c
6892 }
6893
6894 // GatewayId sets the optional parameter "gatewayId": Required. Short name of
6895 // the Gateway resource to be created.
6896 func (c *ProjectsLocationsGatewaysCreateCall) GatewayId(gatewayId string) *ProjectsLocationsGatewaysCreateCall {
6897 c.urlParams_.Set("gatewayId", gatewayId)
6898 return c
6899 }
6900
6901 // Fields allows partial responses to be retrieved. See
6902 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6903 // details.
6904 func (c *ProjectsLocationsGatewaysCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsGatewaysCreateCall {
6905 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6906 return c
6907 }
6908
6909 // Context sets the context to be used in this call's Do method.
6910 func (c *ProjectsLocationsGatewaysCreateCall) Context(ctx context.Context) *ProjectsLocationsGatewaysCreateCall {
6911 c.ctx_ = ctx
6912 return c
6913 }
6914
6915 // Header returns a http.Header that can be modified by the caller to add
6916 // headers to the request.
6917 func (c *ProjectsLocationsGatewaysCreateCall) Header() http.Header {
6918 if c.header_ == nil {
6919 c.header_ = make(http.Header)
6920 }
6921 return c.header_
6922 }
6923
6924 func (c *ProjectsLocationsGatewaysCreateCall) doRequest(alt string) (*http.Response, error) {
6925 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6926 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.gateway)
6927 if err != nil {
6928 return nil, err
6929 }
6930 c.urlParams_.Set("alt", alt)
6931 c.urlParams_.Set("prettyPrint", "false")
6932 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/gateways")
6933 urls += "?" + c.urlParams_.Encode()
6934 req, err := http.NewRequest("POST", urls, body)
6935 if err != nil {
6936 return nil, err
6937 }
6938 req.Header = reqHeaders
6939 googleapi.Expand(req.URL, map[string]string{
6940 "parent": c.parent,
6941 })
6942 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.create", "request", internallog.HTTPRequest(req, body.Bytes()))
6943 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6944 }
6945
6946 // Do executes the "networkservices.projects.locations.gateways.create" call.
6947 // Any non-2xx status code is an error. Response headers are in either
6948 // *Operation.ServerResponse.Header or (if a response was returned at all) in
6949 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6950 // whether the returned error was because http.StatusNotModified was returned.
6951 func (c *ProjectsLocationsGatewaysCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
6952 gensupport.SetOptions(c.urlParams_, opts...)
6953 res, err := c.doRequest("json")
6954 if res != nil && res.StatusCode == http.StatusNotModified {
6955 if res.Body != nil {
6956 res.Body.Close()
6957 }
6958 return nil, gensupport.WrapError(&googleapi.Error{
6959 Code: res.StatusCode,
6960 Header: res.Header,
6961 })
6962 }
6963 if err != nil {
6964 return nil, err
6965 }
6966 defer googleapi.CloseBody(res)
6967 if err := googleapi.CheckResponse(res); err != nil {
6968 return nil, gensupport.WrapError(err)
6969 }
6970 ret := &Operation{
6971 ServerResponse: googleapi.ServerResponse{
6972 Header: res.Header,
6973 HTTPStatusCode: res.StatusCode,
6974 },
6975 }
6976 target := &ret
6977 b, err := gensupport.DecodeResponseBytes(target, res)
6978 if err != nil {
6979 return nil, err
6980 }
6981 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.create", "response", internallog.HTTPResponse(res, b))
6982 return ret, nil
6983 }
6984
6985 type ProjectsLocationsGatewaysDeleteCall struct {
6986 s *Service
6987 name string
6988 urlParams_ gensupport.URLParams
6989 ctx_ context.Context
6990 header_ http.Header
6991 }
6992
6993 // Delete: Deletes a single Gateway.
6994 //
6995 // - name: A name of the Gateway to delete. Must be in the format
6996 // `projects/*/locations/*/gateways/*`.
6997 func (r *ProjectsLocationsGatewaysService) Delete(name string) *ProjectsLocationsGatewaysDeleteCall {
6998 c := &ProjectsLocationsGatewaysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6999 c.name = name
7000 return c
7001 }
7002
7003 // Fields allows partial responses to be retrieved. See
7004 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7005 // details.
7006 func (c *ProjectsLocationsGatewaysDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsGatewaysDeleteCall {
7007 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7008 return c
7009 }
7010
7011 // Context sets the context to be used in this call's Do method.
7012 func (c *ProjectsLocationsGatewaysDeleteCall) Context(ctx context.Context) *ProjectsLocationsGatewaysDeleteCall {
7013 c.ctx_ = ctx
7014 return c
7015 }
7016
7017 // Header returns a http.Header that can be modified by the caller to add
7018 // headers to the request.
7019 func (c *ProjectsLocationsGatewaysDeleteCall) Header() http.Header {
7020 if c.header_ == nil {
7021 c.header_ = make(http.Header)
7022 }
7023 return c.header_
7024 }
7025
7026 func (c *ProjectsLocationsGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) {
7027 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7028 c.urlParams_.Set("alt", alt)
7029 c.urlParams_.Set("prettyPrint", "false")
7030 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
7031 urls += "?" + c.urlParams_.Encode()
7032 req, err := http.NewRequest("DELETE", urls, nil)
7033 if err != nil {
7034 return nil, err
7035 }
7036 req.Header = reqHeaders
7037 googleapi.Expand(req.URL, map[string]string{
7038 "name": c.name,
7039 })
7040 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.delete", "request", internallog.HTTPRequest(req, nil))
7041 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7042 }
7043
7044 // Do executes the "networkservices.projects.locations.gateways.delete" call.
7045 // Any non-2xx status code is an error. Response headers are in either
7046 // *Operation.ServerResponse.Header or (if a response was returned at all) in
7047 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7048 // whether the returned error was because http.StatusNotModified was returned.
7049 func (c *ProjectsLocationsGatewaysDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
7050 gensupport.SetOptions(c.urlParams_, opts...)
7051 res, err := c.doRequest("json")
7052 if res != nil && res.StatusCode == http.StatusNotModified {
7053 if res.Body != nil {
7054 res.Body.Close()
7055 }
7056 return nil, gensupport.WrapError(&googleapi.Error{
7057 Code: res.StatusCode,
7058 Header: res.Header,
7059 })
7060 }
7061 if err != nil {
7062 return nil, err
7063 }
7064 defer googleapi.CloseBody(res)
7065 if err := googleapi.CheckResponse(res); err != nil {
7066 return nil, gensupport.WrapError(err)
7067 }
7068 ret := &Operation{
7069 ServerResponse: googleapi.ServerResponse{
7070 Header: res.Header,
7071 HTTPStatusCode: res.StatusCode,
7072 },
7073 }
7074 target := &ret
7075 b, err := gensupport.DecodeResponseBytes(target, res)
7076 if err != nil {
7077 return nil, err
7078 }
7079 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.delete", "response", internallog.HTTPResponse(res, b))
7080 return ret, nil
7081 }
7082
7083 type ProjectsLocationsGatewaysGetCall struct {
7084 s *Service
7085 name string
7086 urlParams_ gensupport.URLParams
7087 ifNoneMatch_ string
7088 ctx_ context.Context
7089 header_ http.Header
7090 }
7091
7092 // Get: Gets details of a single Gateway.
7093 //
7094 // - name: A name of the Gateway to get. Must be in the format
7095 // `projects/*/locations/*/gateways/*`.
7096 func (r *ProjectsLocationsGatewaysService) Get(name string) *ProjectsLocationsGatewaysGetCall {
7097 c := &ProjectsLocationsGatewaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7098 c.name = name
7099 return c
7100 }
7101
7102 // Fields allows partial responses to be retrieved. See
7103 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7104 // details.
7105 func (c *ProjectsLocationsGatewaysGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGatewaysGetCall {
7106 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7107 return c
7108 }
7109
7110 // IfNoneMatch sets an optional parameter which makes the operation fail if the
7111 // object's ETag matches the given value. This is useful for getting updates
7112 // only after the object has changed since the last request.
7113 func (c *ProjectsLocationsGatewaysGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGatewaysGetCall {
7114 c.ifNoneMatch_ = entityTag
7115 return c
7116 }
7117
7118 // Context sets the context to be used in this call's Do method.
7119 func (c *ProjectsLocationsGatewaysGetCall) Context(ctx context.Context) *ProjectsLocationsGatewaysGetCall {
7120 c.ctx_ = ctx
7121 return c
7122 }
7123
7124 // Header returns a http.Header that can be modified by the caller to add
7125 // headers to the request.
7126 func (c *ProjectsLocationsGatewaysGetCall) Header() http.Header {
7127 if c.header_ == nil {
7128 c.header_ = make(http.Header)
7129 }
7130 return c.header_
7131 }
7132
7133 func (c *ProjectsLocationsGatewaysGetCall) doRequest(alt string) (*http.Response, error) {
7134 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7135 if c.ifNoneMatch_ != "" {
7136 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7137 }
7138 c.urlParams_.Set("alt", alt)
7139 c.urlParams_.Set("prettyPrint", "false")
7140 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
7141 urls += "?" + c.urlParams_.Encode()
7142 req, err := http.NewRequest("GET", urls, nil)
7143 if err != nil {
7144 return nil, err
7145 }
7146 req.Header = reqHeaders
7147 googleapi.Expand(req.URL, map[string]string{
7148 "name": c.name,
7149 })
7150 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.get", "request", internallog.HTTPRequest(req, nil))
7151 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7152 }
7153
7154 // Do executes the "networkservices.projects.locations.gateways.get" call.
7155 // Any non-2xx status code is an error. Response headers are in either
7156 // *Gateway.ServerResponse.Header or (if a response was returned at all) in
7157 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7158 // whether the returned error was because http.StatusNotModified was returned.
7159 func (c *ProjectsLocationsGatewaysGetCall) Do(opts ...googleapi.CallOption) (*Gateway, error) {
7160 gensupport.SetOptions(c.urlParams_, opts...)
7161 res, err := c.doRequest("json")
7162 if res != nil && res.StatusCode == http.StatusNotModified {
7163 if res.Body != nil {
7164 res.Body.Close()
7165 }
7166 return nil, gensupport.WrapError(&googleapi.Error{
7167 Code: res.StatusCode,
7168 Header: res.Header,
7169 })
7170 }
7171 if err != nil {
7172 return nil, err
7173 }
7174 defer googleapi.CloseBody(res)
7175 if err := googleapi.CheckResponse(res); err != nil {
7176 return nil, gensupport.WrapError(err)
7177 }
7178 ret := &Gateway{
7179 ServerResponse: googleapi.ServerResponse{
7180 Header: res.Header,
7181 HTTPStatusCode: res.StatusCode,
7182 },
7183 }
7184 target := &ret
7185 b, err := gensupport.DecodeResponseBytes(target, res)
7186 if err != nil {
7187 return nil, err
7188 }
7189 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.get", "response", internallog.HTTPResponse(res, b))
7190 return ret, nil
7191 }
7192
7193 type ProjectsLocationsGatewaysListCall struct {
7194 s *Service
7195 parent string
7196 urlParams_ gensupport.URLParams
7197 ifNoneMatch_ string
7198 ctx_ context.Context
7199 header_ http.Header
7200 }
7201
7202 // List: Lists Gateways in a given project and location.
7203 //
7204 // - parent: The project and location from which the Gateways should be listed,
7205 // specified in the format `projects/*/locations/*`.
7206 func (r *ProjectsLocationsGatewaysService) List(parent string) *ProjectsLocationsGatewaysListCall {
7207 c := &ProjectsLocationsGatewaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7208 c.parent = parent
7209 return c
7210 }
7211
7212 // PageSize sets the optional parameter "pageSize": Maximum number of Gateways
7213 // to return per call.
7214 func (c *ProjectsLocationsGatewaysListCall) PageSize(pageSize int64) *ProjectsLocationsGatewaysListCall {
7215 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
7216 return c
7217 }
7218
7219 // PageToken sets the optional parameter "pageToken": The value returned by the
7220 // last `ListGatewaysResponse` Indicates that this is a continuation of a prior
7221 // `ListGateways` call, and that the system should return the next page of
7222 // data.
7223 func (c *ProjectsLocationsGatewaysListCall) PageToken(pageToken string) *ProjectsLocationsGatewaysListCall {
7224 c.urlParams_.Set("pageToken", pageToken)
7225 return c
7226 }
7227
7228 // Fields allows partial responses to be retrieved. See
7229 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7230 // details.
7231 func (c *ProjectsLocationsGatewaysListCall) Fields(s ...googleapi.Field) *ProjectsLocationsGatewaysListCall {
7232 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7233 return c
7234 }
7235
7236 // IfNoneMatch sets an optional parameter which makes the operation fail if the
7237 // object's ETag matches the given value. This is useful for getting updates
7238 // only after the object has changed since the last request.
7239 func (c *ProjectsLocationsGatewaysListCall) IfNoneMatch(entityTag string) *ProjectsLocationsGatewaysListCall {
7240 c.ifNoneMatch_ = entityTag
7241 return c
7242 }
7243
7244 // Context sets the context to be used in this call's Do method.
7245 func (c *ProjectsLocationsGatewaysListCall) Context(ctx context.Context) *ProjectsLocationsGatewaysListCall {
7246 c.ctx_ = ctx
7247 return c
7248 }
7249
7250 // Header returns a http.Header that can be modified by the caller to add
7251 // headers to the request.
7252 func (c *ProjectsLocationsGatewaysListCall) Header() http.Header {
7253 if c.header_ == nil {
7254 c.header_ = make(http.Header)
7255 }
7256 return c.header_
7257 }
7258
7259 func (c *ProjectsLocationsGatewaysListCall) doRequest(alt string) (*http.Response, error) {
7260 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7261 if c.ifNoneMatch_ != "" {
7262 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7263 }
7264 c.urlParams_.Set("alt", alt)
7265 c.urlParams_.Set("prettyPrint", "false")
7266 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/gateways")
7267 urls += "?" + c.urlParams_.Encode()
7268 req, err := http.NewRequest("GET", urls, nil)
7269 if err != nil {
7270 return nil, err
7271 }
7272 req.Header = reqHeaders
7273 googleapi.Expand(req.URL, map[string]string{
7274 "parent": c.parent,
7275 })
7276 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.list", "request", internallog.HTTPRequest(req, nil))
7277 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7278 }
7279
7280 // Do executes the "networkservices.projects.locations.gateways.list" call.
7281 // Any non-2xx status code is an error. Response headers are in either
7282 // *ListGatewaysResponse.ServerResponse.Header or (if a response was returned
7283 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
7284 // check whether the returned error was because http.StatusNotModified was
7285 // returned.
7286 func (c *ProjectsLocationsGatewaysListCall) Do(opts ...googleapi.CallOption) (*ListGatewaysResponse, error) {
7287 gensupport.SetOptions(c.urlParams_, opts...)
7288 res, err := c.doRequest("json")
7289 if res != nil && res.StatusCode == http.StatusNotModified {
7290 if res.Body != nil {
7291 res.Body.Close()
7292 }
7293 return nil, gensupport.WrapError(&googleapi.Error{
7294 Code: res.StatusCode,
7295 Header: res.Header,
7296 })
7297 }
7298 if err != nil {
7299 return nil, err
7300 }
7301 defer googleapi.CloseBody(res)
7302 if err := googleapi.CheckResponse(res); err != nil {
7303 return nil, gensupport.WrapError(err)
7304 }
7305 ret := &ListGatewaysResponse{
7306 ServerResponse: googleapi.ServerResponse{
7307 Header: res.Header,
7308 HTTPStatusCode: res.StatusCode,
7309 },
7310 }
7311 target := &ret
7312 b, err := gensupport.DecodeResponseBytes(target, res)
7313 if err != nil {
7314 return nil, err
7315 }
7316 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.list", "response", internallog.HTTPResponse(res, b))
7317 return ret, nil
7318 }
7319
7320 // Pages invokes f for each page of results.
7321 // A non-nil error returned from f will halt the iteration.
7322 // The provided context supersedes any context provided to the Context method.
7323 func (c *ProjectsLocationsGatewaysListCall) Pages(ctx context.Context, f func(*ListGatewaysResponse) error) error {
7324 c.ctx_ = ctx
7325 defer c.PageToken(c.urlParams_.Get("pageToken"))
7326 for {
7327 x, err := c.Do()
7328 if err != nil {
7329 return err
7330 }
7331 if err := f(x); err != nil {
7332 return err
7333 }
7334 if x.NextPageToken == "" {
7335 return nil
7336 }
7337 c.PageToken(x.NextPageToken)
7338 }
7339 }
7340
7341 type ProjectsLocationsGatewaysPatchCall struct {
7342 s *Service
7343 name string
7344 gateway *Gateway
7345 urlParams_ gensupport.URLParams
7346 ctx_ context.Context
7347 header_ http.Header
7348 }
7349
7350 // Patch: Updates the parameters of a single Gateway.
7351 //
7352 // - name: Identifier. Name of the Gateway resource. It matches pattern
7353 // `projects/*/locations/*/gateways/`.
7354 func (r *ProjectsLocationsGatewaysService) Patch(name string, gateway *Gateway) *ProjectsLocationsGatewaysPatchCall {
7355 c := &ProjectsLocationsGatewaysPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7356 c.name = name
7357 c.gateway = gateway
7358 return c
7359 }
7360
7361 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
7362 // specify the fields to be overwritten in the Gateway resource by the update.
7363 // The fields specified in the update_mask are relative to the resource, not
7364 // the full request. A field will be overwritten if it is in the mask. If the
7365 // user does not provide a mask then all fields will be overwritten.
7366 func (c *ProjectsLocationsGatewaysPatchCall) UpdateMask(updateMask string) *ProjectsLocationsGatewaysPatchCall {
7367 c.urlParams_.Set("updateMask", updateMask)
7368 return c
7369 }
7370
7371 // Fields allows partial responses to be retrieved. See
7372 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7373 // details.
7374 func (c *ProjectsLocationsGatewaysPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsGatewaysPatchCall {
7375 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7376 return c
7377 }
7378
7379 // Context sets the context to be used in this call's Do method.
7380 func (c *ProjectsLocationsGatewaysPatchCall) Context(ctx context.Context) *ProjectsLocationsGatewaysPatchCall {
7381 c.ctx_ = ctx
7382 return c
7383 }
7384
7385 // Header returns a http.Header that can be modified by the caller to add
7386 // headers to the request.
7387 func (c *ProjectsLocationsGatewaysPatchCall) Header() http.Header {
7388 if c.header_ == nil {
7389 c.header_ = make(http.Header)
7390 }
7391 return c.header_
7392 }
7393
7394 func (c *ProjectsLocationsGatewaysPatchCall) doRequest(alt string) (*http.Response, error) {
7395 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7396 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.gateway)
7397 if err != nil {
7398 return nil, err
7399 }
7400 c.urlParams_.Set("alt", alt)
7401 c.urlParams_.Set("prettyPrint", "false")
7402 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
7403 urls += "?" + c.urlParams_.Encode()
7404 req, err := http.NewRequest("PATCH", urls, body)
7405 if err != nil {
7406 return nil, err
7407 }
7408 req.Header = reqHeaders
7409 googleapi.Expand(req.URL, map[string]string{
7410 "name": c.name,
7411 })
7412 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
7413 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7414 }
7415
7416 // Do executes the "networkservices.projects.locations.gateways.patch" call.
7417 // Any non-2xx status code is an error. Response headers are in either
7418 // *Operation.ServerResponse.Header or (if a response was returned at all) in
7419 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7420 // whether the returned error was because http.StatusNotModified was returned.
7421 func (c *ProjectsLocationsGatewaysPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
7422 gensupport.SetOptions(c.urlParams_, opts...)
7423 res, err := c.doRequest("json")
7424 if res != nil && res.StatusCode == http.StatusNotModified {
7425 if res.Body != nil {
7426 res.Body.Close()
7427 }
7428 return nil, gensupport.WrapError(&googleapi.Error{
7429 Code: res.StatusCode,
7430 Header: res.Header,
7431 })
7432 }
7433 if err != nil {
7434 return nil, err
7435 }
7436 defer googleapi.CloseBody(res)
7437 if err := googleapi.CheckResponse(res); err != nil {
7438 return nil, gensupport.WrapError(err)
7439 }
7440 ret := &Operation{
7441 ServerResponse: googleapi.ServerResponse{
7442 Header: res.Header,
7443 HTTPStatusCode: res.StatusCode,
7444 },
7445 }
7446 target := &ret
7447 b, err := gensupport.DecodeResponseBytes(target, res)
7448 if err != nil {
7449 return nil, err
7450 }
7451 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.patch", "response", internallog.HTTPResponse(res, b))
7452 return ret, nil
7453 }
7454
7455 type ProjectsLocationsGatewaysRouteViewsGetCall struct {
7456 s *Service
7457 name string
7458 urlParams_ gensupport.URLParams
7459 ifNoneMatch_ string
7460 ctx_ context.Context
7461 header_ http.Header
7462 }
7463
7464 // Get: Get a single RouteView of a Gateway.
7465 //
7466 // - name: Name of the GatewayRouteView resource. Formats:
7467 // projects/{project_number}/locations/{location}/gateways/{gateway}/routeView
7468 // s/{route_view}.
7469 func (r *ProjectsLocationsGatewaysRouteViewsService) Get(name string) *ProjectsLocationsGatewaysRouteViewsGetCall {
7470 c := &ProjectsLocationsGatewaysRouteViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7471 c.name = name
7472 return c
7473 }
7474
7475 // Fields allows partial responses to be retrieved. See
7476 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7477 // details.
7478 func (c *ProjectsLocationsGatewaysRouteViewsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGatewaysRouteViewsGetCall {
7479 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7480 return c
7481 }
7482
7483 // IfNoneMatch sets an optional parameter which makes the operation fail if the
7484 // object's ETag matches the given value. This is useful for getting updates
7485 // only after the object has changed since the last request.
7486 func (c *ProjectsLocationsGatewaysRouteViewsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGatewaysRouteViewsGetCall {
7487 c.ifNoneMatch_ = entityTag
7488 return c
7489 }
7490
7491 // Context sets the context to be used in this call's Do method.
7492 func (c *ProjectsLocationsGatewaysRouteViewsGetCall) Context(ctx context.Context) *ProjectsLocationsGatewaysRouteViewsGetCall {
7493 c.ctx_ = ctx
7494 return c
7495 }
7496
7497 // Header returns a http.Header that can be modified by the caller to add
7498 // headers to the request.
7499 func (c *ProjectsLocationsGatewaysRouteViewsGetCall) Header() http.Header {
7500 if c.header_ == nil {
7501 c.header_ = make(http.Header)
7502 }
7503 return c.header_
7504 }
7505
7506 func (c *ProjectsLocationsGatewaysRouteViewsGetCall) doRequest(alt string) (*http.Response, error) {
7507 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7508 if c.ifNoneMatch_ != "" {
7509 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7510 }
7511 c.urlParams_.Set("alt", alt)
7512 c.urlParams_.Set("prettyPrint", "false")
7513 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
7514 urls += "?" + c.urlParams_.Encode()
7515 req, err := http.NewRequest("GET", urls, nil)
7516 if err != nil {
7517 return nil, err
7518 }
7519 req.Header = reqHeaders
7520 googleapi.Expand(req.URL, map[string]string{
7521 "name": c.name,
7522 })
7523 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.routeViews.get", "request", internallog.HTTPRequest(req, nil))
7524 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7525 }
7526
7527 // Do executes the "networkservices.projects.locations.gateways.routeViews.get" call.
7528 // Any non-2xx status code is an error. Response headers are in either
7529 // *GatewayRouteView.ServerResponse.Header or (if a response was returned at
7530 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
7531 // check whether the returned error was because http.StatusNotModified was
7532 // returned.
7533 func (c *ProjectsLocationsGatewaysRouteViewsGetCall) Do(opts ...googleapi.CallOption) (*GatewayRouteView, error) {
7534 gensupport.SetOptions(c.urlParams_, opts...)
7535 res, err := c.doRequest("json")
7536 if res != nil && res.StatusCode == http.StatusNotModified {
7537 if res.Body != nil {
7538 res.Body.Close()
7539 }
7540 return nil, gensupport.WrapError(&googleapi.Error{
7541 Code: res.StatusCode,
7542 Header: res.Header,
7543 })
7544 }
7545 if err != nil {
7546 return nil, err
7547 }
7548 defer googleapi.CloseBody(res)
7549 if err := googleapi.CheckResponse(res); err != nil {
7550 return nil, gensupport.WrapError(err)
7551 }
7552 ret := &GatewayRouteView{
7553 ServerResponse: googleapi.ServerResponse{
7554 Header: res.Header,
7555 HTTPStatusCode: res.StatusCode,
7556 },
7557 }
7558 target := &ret
7559 b, err := gensupport.DecodeResponseBytes(target, res)
7560 if err != nil {
7561 return nil, err
7562 }
7563 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.routeViews.get", "response", internallog.HTTPResponse(res, b))
7564 return ret, nil
7565 }
7566
7567 type ProjectsLocationsGatewaysRouteViewsListCall struct {
7568 s *Service
7569 parent string
7570 urlParams_ gensupport.URLParams
7571 ifNoneMatch_ string
7572 ctx_ context.Context
7573 header_ http.Header
7574 }
7575
7576 // List: Lists RouteViews
7577 //
7578 // - parent: The Gateway to which a Route is associated. Formats:
7579 // projects/{project_number}/locations/{location}/gateways/{gateway}.
7580 func (r *ProjectsLocationsGatewaysRouteViewsService) List(parent string) *ProjectsLocationsGatewaysRouteViewsListCall {
7581 c := &ProjectsLocationsGatewaysRouteViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7582 c.parent = parent
7583 return c
7584 }
7585
7586 // PageSize sets the optional parameter "pageSize": Maximum number of
7587 // GatewayRouteViews to return per call.
7588 func (c *ProjectsLocationsGatewaysRouteViewsListCall) PageSize(pageSize int64) *ProjectsLocationsGatewaysRouteViewsListCall {
7589 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
7590 return c
7591 }
7592
7593 // PageToken sets the optional parameter "pageToken": The value returned by the
7594 // last `ListGatewayRouteViewsResponse` Indicates that this is a continuation
7595 // of a prior `ListGatewayRouteViews` call, and that the system should return
7596 // the next page of data.
7597 func (c *ProjectsLocationsGatewaysRouteViewsListCall) PageToken(pageToken string) *ProjectsLocationsGatewaysRouteViewsListCall {
7598 c.urlParams_.Set("pageToken", pageToken)
7599 return c
7600 }
7601
7602 // Fields allows partial responses to be retrieved. See
7603 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7604 // details.
7605 func (c *ProjectsLocationsGatewaysRouteViewsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsGatewaysRouteViewsListCall {
7606 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7607 return c
7608 }
7609
7610 // IfNoneMatch sets an optional parameter which makes the operation fail if the
7611 // object's ETag matches the given value. This is useful for getting updates
7612 // only after the object has changed since the last request.
7613 func (c *ProjectsLocationsGatewaysRouteViewsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsGatewaysRouteViewsListCall {
7614 c.ifNoneMatch_ = entityTag
7615 return c
7616 }
7617
7618 // Context sets the context to be used in this call's Do method.
7619 func (c *ProjectsLocationsGatewaysRouteViewsListCall) Context(ctx context.Context) *ProjectsLocationsGatewaysRouteViewsListCall {
7620 c.ctx_ = ctx
7621 return c
7622 }
7623
7624 // Header returns a http.Header that can be modified by the caller to add
7625 // headers to the request.
7626 func (c *ProjectsLocationsGatewaysRouteViewsListCall) Header() http.Header {
7627 if c.header_ == nil {
7628 c.header_ = make(http.Header)
7629 }
7630 return c.header_
7631 }
7632
7633 func (c *ProjectsLocationsGatewaysRouteViewsListCall) doRequest(alt string) (*http.Response, error) {
7634 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7635 if c.ifNoneMatch_ != "" {
7636 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7637 }
7638 c.urlParams_.Set("alt", alt)
7639 c.urlParams_.Set("prettyPrint", "false")
7640 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/routeViews")
7641 urls += "?" + c.urlParams_.Encode()
7642 req, err := http.NewRequest("GET", urls, nil)
7643 if err != nil {
7644 return nil, err
7645 }
7646 req.Header = reqHeaders
7647 googleapi.Expand(req.URL, map[string]string{
7648 "parent": c.parent,
7649 })
7650 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.routeViews.list", "request", internallog.HTTPRequest(req, nil))
7651 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7652 }
7653
7654 // Do executes the "networkservices.projects.locations.gateways.routeViews.list" call.
7655 // Any non-2xx status code is an error. Response headers are in either
7656 // *ListGatewayRouteViewsResponse.ServerResponse.Header or (if a response was
7657 // returned at all) in error.(*googleapi.Error).Header. Use
7658 // googleapi.IsNotModified to check whether the returned error was because
7659 // http.StatusNotModified was returned.
7660 func (c *ProjectsLocationsGatewaysRouteViewsListCall) Do(opts ...googleapi.CallOption) (*ListGatewayRouteViewsResponse, error) {
7661 gensupport.SetOptions(c.urlParams_, opts...)
7662 res, err := c.doRequest("json")
7663 if res != nil && res.StatusCode == http.StatusNotModified {
7664 if res.Body != nil {
7665 res.Body.Close()
7666 }
7667 return nil, gensupport.WrapError(&googleapi.Error{
7668 Code: res.StatusCode,
7669 Header: res.Header,
7670 })
7671 }
7672 if err != nil {
7673 return nil, err
7674 }
7675 defer googleapi.CloseBody(res)
7676 if err := googleapi.CheckResponse(res); err != nil {
7677 return nil, gensupport.WrapError(err)
7678 }
7679 ret := &ListGatewayRouteViewsResponse{
7680 ServerResponse: googleapi.ServerResponse{
7681 Header: res.Header,
7682 HTTPStatusCode: res.StatusCode,
7683 },
7684 }
7685 target := &ret
7686 b, err := gensupport.DecodeResponseBytes(target, res)
7687 if err != nil {
7688 return nil, err
7689 }
7690 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.gateways.routeViews.list", "response", internallog.HTTPResponse(res, b))
7691 return ret, nil
7692 }
7693
7694 // Pages invokes f for each page of results.
7695 // A non-nil error returned from f will halt the iteration.
7696 // The provided context supersedes any context provided to the Context method.
7697 func (c *ProjectsLocationsGatewaysRouteViewsListCall) Pages(ctx context.Context, f func(*ListGatewayRouteViewsResponse) error) error {
7698 c.ctx_ = ctx
7699 defer c.PageToken(c.urlParams_.Get("pageToken"))
7700 for {
7701 x, err := c.Do()
7702 if err != nil {
7703 return err
7704 }
7705 if err := f(x); err != nil {
7706 return err
7707 }
7708 if x.NextPageToken == "" {
7709 return nil
7710 }
7711 c.PageToken(x.NextPageToken)
7712 }
7713 }
7714
7715 type ProjectsLocationsGrpcRoutesCreateCall struct {
7716 s *Service
7717 parent string
7718 grpcroute *GrpcRoute
7719 urlParams_ gensupport.URLParams
7720 ctx_ context.Context
7721 header_ http.Header
7722 }
7723
7724 // Create: Creates a new GrpcRoute in a given project and location.
7725 //
7726 // - parent: The parent resource of the GrpcRoute. Must be in the format
7727 // `projects/*/locations/*`.
7728 func (r *ProjectsLocationsGrpcRoutesService) Create(parent string, grpcroute *GrpcRoute) *ProjectsLocationsGrpcRoutesCreateCall {
7729 c := &ProjectsLocationsGrpcRoutesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7730 c.parent = parent
7731 c.grpcroute = grpcroute
7732 return c
7733 }
7734
7735 // GrpcRouteId sets the optional parameter "grpcRouteId": Required. Short name
7736 // of the GrpcRoute resource to be created.
7737 func (c *ProjectsLocationsGrpcRoutesCreateCall) GrpcRouteId(grpcRouteId string) *ProjectsLocationsGrpcRoutesCreateCall {
7738 c.urlParams_.Set("grpcRouteId", grpcRouteId)
7739 return c
7740 }
7741
7742 // Fields allows partial responses to be retrieved. See
7743 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7744 // details.
7745 func (c *ProjectsLocationsGrpcRoutesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsGrpcRoutesCreateCall {
7746 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7747 return c
7748 }
7749
7750 // Context sets the context to be used in this call's Do method.
7751 func (c *ProjectsLocationsGrpcRoutesCreateCall) Context(ctx context.Context) *ProjectsLocationsGrpcRoutesCreateCall {
7752 c.ctx_ = ctx
7753 return c
7754 }
7755
7756 // Header returns a http.Header that can be modified by the caller to add
7757 // headers to the request.
7758 func (c *ProjectsLocationsGrpcRoutesCreateCall) Header() http.Header {
7759 if c.header_ == nil {
7760 c.header_ = make(http.Header)
7761 }
7762 return c.header_
7763 }
7764
7765 func (c *ProjectsLocationsGrpcRoutesCreateCall) doRequest(alt string) (*http.Response, error) {
7766 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7767 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.grpcroute)
7768 if err != nil {
7769 return nil, err
7770 }
7771 c.urlParams_.Set("alt", alt)
7772 c.urlParams_.Set("prettyPrint", "false")
7773 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/grpcRoutes")
7774 urls += "?" + c.urlParams_.Encode()
7775 req, err := http.NewRequest("POST", urls, body)
7776 if err != nil {
7777 return nil, err
7778 }
7779 req.Header = reqHeaders
7780 googleapi.Expand(req.URL, map[string]string{
7781 "parent": c.parent,
7782 })
7783 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.grpcRoutes.create", "request", internallog.HTTPRequest(req, body.Bytes()))
7784 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7785 }
7786
7787 // Do executes the "networkservices.projects.locations.grpcRoutes.create" call.
7788 // Any non-2xx status code is an error. Response headers are in either
7789 // *Operation.ServerResponse.Header or (if a response was returned at all) in
7790 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7791 // whether the returned error was because http.StatusNotModified was returned.
7792 func (c *ProjectsLocationsGrpcRoutesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
7793 gensupport.SetOptions(c.urlParams_, opts...)
7794 res, err := c.doRequest("json")
7795 if res != nil && res.StatusCode == http.StatusNotModified {
7796 if res.Body != nil {
7797 res.Body.Close()
7798 }
7799 return nil, gensupport.WrapError(&googleapi.Error{
7800 Code: res.StatusCode,
7801 Header: res.Header,
7802 })
7803 }
7804 if err != nil {
7805 return nil, err
7806 }
7807 defer googleapi.CloseBody(res)
7808 if err := googleapi.CheckResponse(res); err != nil {
7809 return nil, gensupport.WrapError(err)
7810 }
7811 ret := &Operation{
7812 ServerResponse: googleapi.ServerResponse{
7813 Header: res.Header,
7814 HTTPStatusCode: res.StatusCode,
7815 },
7816 }
7817 target := &ret
7818 b, err := gensupport.DecodeResponseBytes(target, res)
7819 if err != nil {
7820 return nil, err
7821 }
7822 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.grpcRoutes.create", "response", internallog.HTTPResponse(res, b))
7823 return ret, nil
7824 }
7825
7826 type ProjectsLocationsGrpcRoutesDeleteCall struct {
7827 s *Service
7828 name string
7829 urlParams_ gensupport.URLParams
7830 ctx_ context.Context
7831 header_ http.Header
7832 }
7833
7834 // Delete: Deletes a single GrpcRoute.
7835 //
7836 // - name: A name of the GrpcRoute to delete. Must be in the format
7837 // `projects/*/locations/*/grpcRoutes/*`.
7838 func (r *ProjectsLocationsGrpcRoutesService) Delete(name string) *ProjectsLocationsGrpcRoutesDeleteCall {
7839 c := &ProjectsLocationsGrpcRoutesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7840 c.name = name
7841 return c
7842 }
7843
7844 // Fields allows partial responses to be retrieved. See
7845 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7846 // details.
7847 func (c *ProjectsLocationsGrpcRoutesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsGrpcRoutesDeleteCall {
7848 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7849 return c
7850 }
7851
7852 // Context sets the context to be used in this call's Do method.
7853 func (c *ProjectsLocationsGrpcRoutesDeleteCall) Context(ctx context.Context) *ProjectsLocationsGrpcRoutesDeleteCall {
7854 c.ctx_ = ctx
7855 return c
7856 }
7857
7858 // Header returns a http.Header that can be modified by the caller to add
7859 // headers to the request.
7860 func (c *ProjectsLocationsGrpcRoutesDeleteCall) Header() http.Header {
7861 if c.header_ == nil {
7862 c.header_ = make(http.Header)
7863 }
7864 return c.header_
7865 }
7866
7867 func (c *ProjectsLocationsGrpcRoutesDeleteCall) doRequest(alt string) (*http.Response, error) {
7868 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7869 c.urlParams_.Set("alt", alt)
7870 c.urlParams_.Set("prettyPrint", "false")
7871 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
7872 urls += "?" + c.urlParams_.Encode()
7873 req, err := http.NewRequest("DELETE", urls, nil)
7874 if err != nil {
7875 return nil, err
7876 }
7877 req.Header = reqHeaders
7878 googleapi.Expand(req.URL, map[string]string{
7879 "name": c.name,
7880 })
7881 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.grpcRoutes.delete", "request", internallog.HTTPRequest(req, nil))
7882 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7883 }
7884
7885 // Do executes the "networkservices.projects.locations.grpcRoutes.delete" call.
7886 // Any non-2xx status code is an error. Response headers are in either
7887 // *Operation.ServerResponse.Header or (if a response was returned at all) in
7888 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7889 // whether the returned error was because http.StatusNotModified was returned.
7890 func (c *ProjectsLocationsGrpcRoutesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
7891 gensupport.SetOptions(c.urlParams_, opts...)
7892 res, err := c.doRequest("json")
7893 if res != nil && res.StatusCode == http.StatusNotModified {
7894 if res.Body != nil {
7895 res.Body.Close()
7896 }
7897 return nil, gensupport.WrapError(&googleapi.Error{
7898 Code: res.StatusCode,
7899 Header: res.Header,
7900 })
7901 }
7902 if err != nil {
7903 return nil, err
7904 }
7905 defer googleapi.CloseBody(res)
7906 if err := googleapi.CheckResponse(res); err != nil {
7907 return nil, gensupport.WrapError(err)
7908 }
7909 ret := &Operation{
7910 ServerResponse: googleapi.ServerResponse{
7911 Header: res.Header,
7912 HTTPStatusCode: res.StatusCode,
7913 },
7914 }
7915 target := &ret
7916 b, err := gensupport.DecodeResponseBytes(target, res)
7917 if err != nil {
7918 return nil, err
7919 }
7920 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.grpcRoutes.delete", "response", internallog.HTTPResponse(res, b))
7921 return ret, nil
7922 }
7923
7924 type ProjectsLocationsGrpcRoutesGetCall struct {
7925 s *Service
7926 name string
7927 urlParams_ gensupport.URLParams
7928 ifNoneMatch_ string
7929 ctx_ context.Context
7930 header_ http.Header
7931 }
7932
7933 // Get: Gets details of a single GrpcRoute.
7934 //
7935 // - name: A name of the GrpcRoute to get. Must be in the format
7936 // `projects/*/locations/*/grpcRoutes/*`.
7937 func (r *ProjectsLocationsGrpcRoutesService) Get(name string) *ProjectsLocationsGrpcRoutesGetCall {
7938 c := &ProjectsLocationsGrpcRoutesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7939 c.name = name
7940 return c
7941 }
7942
7943 // Fields allows partial responses to be retrieved. See
7944 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7945 // details.
7946 func (c *ProjectsLocationsGrpcRoutesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGrpcRoutesGetCall {
7947 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7948 return c
7949 }
7950
7951 // IfNoneMatch sets an optional parameter which makes the operation fail if the
7952 // object's ETag matches the given value. This is useful for getting updates
7953 // only after the object has changed since the last request.
7954 func (c *ProjectsLocationsGrpcRoutesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGrpcRoutesGetCall {
7955 c.ifNoneMatch_ = entityTag
7956 return c
7957 }
7958
7959 // Context sets the context to be used in this call's Do method.
7960 func (c *ProjectsLocationsGrpcRoutesGetCall) Context(ctx context.Context) *ProjectsLocationsGrpcRoutesGetCall {
7961 c.ctx_ = ctx
7962 return c
7963 }
7964
7965 // Header returns a http.Header that can be modified by the caller to add
7966 // headers to the request.
7967 func (c *ProjectsLocationsGrpcRoutesGetCall) Header() http.Header {
7968 if c.header_ == nil {
7969 c.header_ = make(http.Header)
7970 }
7971 return c.header_
7972 }
7973
7974 func (c *ProjectsLocationsGrpcRoutesGetCall) doRequest(alt string) (*http.Response, error) {
7975 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7976 if c.ifNoneMatch_ != "" {
7977 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7978 }
7979 c.urlParams_.Set("alt", alt)
7980 c.urlParams_.Set("prettyPrint", "false")
7981 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
7982 urls += "?" + c.urlParams_.Encode()
7983 req, err := http.NewRequest("GET", urls, nil)
7984 if err != nil {
7985 return nil, err
7986 }
7987 req.Header = reqHeaders
7988 googleapi.Expand(req.URL, map[string]string{
7989 "name": c.name,
7990 })
7991 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.grpcRoutes.get", "request", internallog.HTTPRequest(req, nil))
7992 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7993 }
7994
7995 // Do executes the "networkservices.projects.locations.grpcRoutes.get" call.
7996 // Any non-2xx status code is an error. Response headers are in either
7997 // *GrpcRoute.ServerResponse.Header or (if a response was returned at all) in
7998 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7999 // whether the returned error was because http.StatusNotModified was returned.
8000 func (c *ProjectsLocationsGrpcRoutesGetCall) Do(opts ...googleapi.CallOption) (*GrpcRoute, error) {
8001 gensupport.SetOptions(c.urlParams_, opts...)
8002 res, err := c.doRequest("json")
8003 if res != nil && res.StatusCode == http.StatusNotModified {
8004 if res.Body != nil {
8005 res.Body.Close()
8006 }
8007 return nil, gensupport.WrapError(&googleapi.Error{
8008 Code: res.StatusCode,
8009 Header: res.Header,
8010 })
8011 }
8012 if err != nil {
8013 return nil, err
8014 }
8015 defer googleapi.CloseBody(res)
8016 if err := googleapi.CheckResponse(res); err != nil {
8017 return nil, gensupport.WrapError(err)
8018 }
8019 ret := &GrpcRoute{
8020 ServerResponse: googleapi.ServerResponse{
8021 Header: res.Header,
8022 HTTPStatusCode: res.StatusCode,
8023 },
8024 }
8025 target := &ret
8026 b, err := gensupport.DecodeResponseBytes(target, res)
8027 if err != nil {
8028 return nil, err
8029 }
8030 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.grpcRoutes.get", "response", internallog.HTTPResponse(res, b))
8031 return ret, nil
8032 }
8033
8034 type ProjectsLocationsGrpcRoutesListCall struct {
8035 s *Service
8036 parent string
8037 urlParams_ gensupport.URLParams
8038 ifNoneMatch_ string
8039 ctx_ context.Context
8040 header_ http.Header
8041 }
8042
8043 // List: Lists GrpcRoutes in a given project and location.
8044 //
8045 // - parent: The project and location from which the GrpcRoutes should be
8046 // listed, specified in the format `projects/*/locations/*`.
8047 func (r *ProjectsLocationsGrpcRoutesService) List(parent string) *ProjectsLocationsGrpcRoutesListCall {
8048 c := &ProjectsLocationsGrpcRoutesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8049 c.parent = parent
8050 return c
8051 }
8052
8053 // PageSize sets the optional parameter "pageSize": Maximum number of
8054 // GrpcRoutes to return per call.
8055 func (c *ProjectsLocationsGrpcRoutesListCall) PageSize(pageSize int64) *ProjectsLocationsGrpcRoutesListCall {
8056 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
8057 return c
8058 }
8059
8060 // PageToken sets the optional parameter "pageToken": The value returned by the
8061 // last `ListGrpcRoutesResponse` Indicates that this is a continuation of a
8062 // prior `ListGrpcRoutes` call, and that the system should return the next page
8063 // of data.
8064 func (c *ProjectsLocationsGrpcRoutesListCall) PageToken(pageToken string) *ProjectsLocationsGrpcRoutesListCall {
8065 c.urlParams_.Set("pageToken", pageToken)
8066 return c
8067 }
8068
8069 // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": If
8070 // true, allow partial responses for multi-regional Aggregated List requests.
8071 // Otherwise if one of the locations is down or unreachable, the Aggregated
8072 // List request will fail.
8073 func (c *ProjectsLocationsGrpcRoutesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ProjectsLocationsGrpcRoutesListCall {
8074 c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
8075 return c
8076 }
8077
8078 // Fields allows partial responses to be retrieved. See
8079 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8080 // details.
8081 func (c *ProjectsLocationsGrpcRoutesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsGrpcRoutesListCall {
8082 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8083 return c
8084 }
8085
8086 // IfNoneMatch sets an optional parameter which makes the operation fail if the
8087 // object's ETag matches the given value. This is useful for getting updates
8088 // only after the object has changed since the last request.
8089 func (c *ProjectsLocationsGrpcRoutesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsGrpcRoutesListCall {
8090 c.ifNoneMatch_ = entityTag
8091 return c
8092 }
8093
8094 // Context sets the context to be used in this call's Do method.
8095 func (c *ProjectsLocationsGrpcRoutesListCall) Context(ctx context.Context) *ProjectsLocationsGrpcRoutesListCall {
8096 c.ctx_ = ctx
8097 return c
8098 }
8099
8100 // Header returns a http.Header that can be modified by the caller to add
8101 // headers to the request.
8102 func (c *ProjectsLocationsGrpcRoutesListCall) Header() http.Header {
8103 if c.header_ == nil {
8104 c.header_ = make(http.Header)
8105 }
8106 return c.header_
8107 }
8108
8109 func (c *ProjectsLocationsGrpcRoutesListCall) doRequest(alt string) (*http.Response, error) {
8110 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8111 if c.ifNoneMatch_ != "" {
8112 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8113 }
8114 c.urlParams_.Set("alt", alt)
8115 c.urlParams_.Set("prettyPrint", "false")
8116 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/grpcRoutes")
8117 urls += "?" + c.urlParams_.Encode()
8118 req, err := http.NewRequest("GET", urls, nil)
8119 if err != nil {
8120 return nil, err
8121 }
8122 req.Header = reqHeaders
8123 googleapi.Expand(req.URL, map[string]string{
8124 "parent": c.parent,
8125 })
8126 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.grpcRoutes.list", "request", internallog.HTTPRequest(req, nil))
8127 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8128 }
8129
8130 // Do executes the "networkservices.projects.locations.grpcRoutes.list" call.
8131 // Any non-2xx status code is an error. Response headers are in either
8132 // *ListGrpcRoutesResponse.ServerResponse.Header or (if a response was returned
8133 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
8134 // check whether the returned error was because http.StatusNotModified was
8135 // returned.
8136 func (c *ProjectsLocationsGrpcRoutesListCall) Do(opts ...googleapi.CallOption) (*ListGrpcRoutesResponse, error) {
8137 gensupport.SetOptions(c.urlParams_, opts...)
8138 res, err := c.doRequest("json")
8139 if res != nil && res.StatusCode == http.StatusNotModified {
8140 if res.Body != nil {
8141 res.Body.Close()
8142 }
8143 return nil, gensupport.WrapError(&googleapi.Error{
8144 Code: res.StatusCode,
8145 Header: res.Header,
8146 })
8147 }
8148 if err != nil {
8149 return nil, err
8150 }
8151 defer googleapi.CloseBody(res)
8152 if err := googleapi.CheckResponse(res); err != nil {
8153 return nil, gensupport.WrapError(err)
8154 }
8155 ret := &ListGrpcRoutesResponse{
8156 ServerResponse: googleapi.ServerResponse{
8157 Header: res.Header,
8158 HTTPStatusCode: res.StatusCode,
8159 },
8160 }
8161 target := &ret
8162 b, err := gensupport.DecodeResponseBytes(target, res)
8163 if err != nil {
8164 return nil, err
8165 }
8166 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.grpcRoutes.list", "response", internallog.HTTPResponse(res, b))
8167 return ret, nil
8168 }
8169
8170 // Pages invokes f for each page of results.
8171 // A non-nil error returned from f will halt the iteration.
8172 // The provided context supersedes any context provided to the Context method.
8173 func (c *ProjectsLocationsGrpcRoutesListCall) Pages(ctx context.Context, f func(*ListGrpcRoutesResponse) error) error {
8174 c.ctx_ = ctx
8175 defer c.PageToken(c.urlParams_.Get("pageToken"))
8176 for {
8177 x, err := c.Do()
8178 if err != nil {
8179 return err
8180 }
8181 if err := f(x); err != nil {
8182 return err
8183 }
8184 if x.NextPageToken == "" {
8185 return nil
8186 }
8187 c.PageToken(x.NextPageToken)
8188 }
8189 }
8190
8191 type ProjectsLocationsGrpcRoutesPatchCall struct {
8192 s *Service
8193 name string
8194 grpcroute *GrpcRoute
8195 urlParams_ gensupport.URLParams
8196 ctx_ context.Context
8197 header_ http.Header
8198 }
8199
8200 // Patch: Updates the parameters of a single GrpcRoute.
8201 //
8202 // - name: Identifier. Name of the GrpcRoute resource. It matches pattern
8203 // `projects/*/locations/*/grpcRoutes/`.
8204 func (r *ProjectsLocationsGrpcRoutesService) Patch(name string, grpcroute *GrpcRoute) *ProjectsLocationsGrpcRoutesPatchCall {
8205 c := &ProjectsLocationsGrpcRoutesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8206 c.name = name
8207 c.grpcroute = grpcroute
8208 return c
8209 }
8210
8211 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
8212 // specify the fields to be overwritten in the GrpcRoute resource by the
8213 // update. The fields specified in the update_mask are relative to the
8214 // resource, not the full request. A field will be overwritten if it is in the
8215 // mask. If the user does not provide a mask then all fields will be
8216 // overwritten.
8217 func (c *ProjectsLocationsGrpcRoutesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsGrpcRoutesPatchCall {
8218 c.urlParams_.Set("updateMask", updateMask)
8219 return c
8220 }
8221
8222 // Fields allows partial responses to be retrieved. See
8223 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8224 // details.
8225 func (c *ProjectsLocationsGrpcRoutesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsGrpcRoutesPatchCall {
8226 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8227 return c
8228 }
8229
8230 // Context sets the context to be used in this call's Do method.
8231 func (c *ProjectsLocationsGrpcRoutesPatchCall) Context(ctx context.Context) *ProjectsLocationsGrpcRoutesPatchCall {
8232 c.ctx_ = ctx
8233 return c
8234 }
8235
8236 // Header returns a http.Header that can be modified by the caller to add
8237 // headers to the request.
8238 func (c *ProjectsLocationsGrpcRoutesPatchCall) Header() http.Header {
8239 if c.header_ == nil {
8240 c.header_ = make(http.Header)
8241 }
8242 return c.header_
8243 }
8244
8245 func (c *ProjectsLocationsGrpcRoutesPatchCall) doRequest(alt string) (*http.Response, error) {
8246 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8247 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.grpcroute)
8248 if err != nil {
8249 return nil, err
8250 }
8251 c.urlParams_.Set("alt", alt)
8252 c.urlParams_.Set("prettyPrint", "false")
8253 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
8254 urls += "?" + c.urlParams_.Encode()
8255 req, err := http.NewRequest("PATCH", urls, body)
8256 if err != nil {
8257 return nil, err
8258 }
8259 req.Header = reqHeaders
8260 googleapi.Expand(req.URL, map[string]string{
8261 "name": c.name,
8262 })
8263 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.grpcRoutes.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
8264 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8265 }
8266
8267 // Do executes the "networkservices.projects.locations.grpcRoutes.patch" call.
8268 // Any non-2xx status code is an error. Response headers are in either
8269 // *Operation.ServerResponse.Header or (if a response was returned at all) in
8270 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
8271 // whether the returned error was because http.StatusNotModified was returned.
8272 func (c *ProjectsLocationsGrpcRoutesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
8273 gensupport.SetOptions(c.urlParams_, opts...)
8274 res, err := c.doRequest("json")
8275 if res != nil && res.StatusCode == http.StatusNotModified {
8276 if res.Body != nil {
8277 res.Body.Close()
8278 }
8279 return nil, gensupport.WrapError(&googleapi.Error{
8280 Code: res.StatusCode,
8281 Header: res.Header,
8282 })
8283 }
8284 if err != nil {
8285 return nil, err
8286 }
8287 defer googleapi.CloseBody(res)
8288 if err := googleapi.CheckResponse(res); err != nil {
8289 return nil, gensupport.WrapError(err)
8290 }
8291 ret := &Operation{
8292 ServerResponse: googleapi.ServerResponse{
8293 Header: res.Header,
8294 HTTPStatusCode: res.StatusCode,
8295 },
8296 }
8297 target := &ret
8298 b, err := gensupport.DecodeResponseBytes(target, res)
8299 if err != nil {
8300 return nil, err
8301 }
8302 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.grpcRoutes.patch", "response", internallog.HTTPResponse(res, b))
8303 return ret, nil
8304 }
8305
8306 type ProjectsLocationsHttpRoutesCreateCall struct {
8307 s *Service
8308 parent string
8309 httproute *HttpRoute
8310 urlParams_ gensupport.URLParams
8311 ctx_ context.Context
8312 header_ http.Header
8313 }
8314
8315 // Create: Creates a new HttpRoute in a given project and location.
8316 //
8317 // - parent: The parent resource of the HttpRoute. Must be in the format
8318 // `projects/*/locations/*`.
8319 func (r *ProjectsLocationsHttpRoutesService) Create(parent string, httproute *HttpRoute) *ProjectsLocationsHttpRoutesCreateCall {
8320 c := &ProjectsLocationsHttpRoutesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8321 c.parent = parent
8322 c.httproute = httproute
8323 return c
8324 }
8325
8326 // HttpRouteId sets the optional parameter "httpRouteId": Required. Short name
8327 // of the HttpRoute resource to be created.
8328 func (c *ProjectsLocationsHttpRoutesCreateCall) HttpRouteId(httpRouteId string) *ProjectsLocationsHttpRoutesCreateCall {
8329 c.urlParams_.Set("httpRouteId", httpRouteId)
8330 return c
8331 }
8332
8333 // Fields allows partial responses to be retrieved. See
8334 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8335 // details.
8336 func (c *ProjectsLocationsHttpRoutesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsHttpRoutesCreateCall {
8337 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8338 return c
8339 }
8340
8341 // Context sets the context to be used in this call's Do method.
8342 func (c *ProjectsLocationsHttpRoutesCreateCall) Context(ctx context.Context) *ProjectsLocationsHttpRoutesCreateCall {
8343 c.ctx_ = ctx
8344 return c
8345 }
8346
8347 // Header returns a http.Header that can be modified by the caller to add
8348 // headers to the request.
8349 func (c *ProjectsLocationsHttpRoutesCreateCall) Header() http.Header {
8350 if c.header_ == nil {
8351 c.header_ = make(http.Header)
8352 }
8353 return c.header_
8354 }
8355
8356 func (c *ProjectsLocationsHttpRoutesCreateCall) doRequest(alt string) (*http.Response, error) {
8357 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8358 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.httproute)
8359 if err != nil {
8360 return nil, err
8361 }
8362 c.urlParams_.Set("alt", alt)
8363 c.urlParams_.Set("prettyPrint", "false")
8364 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/httpRoutes")
8365 urls += "?" + c.urlParams_.Encode()
8366 req, err := http.NewRequest("POST", urls, body)
8367 if err != nil {
8368 return nil, err
8369 }
8370 req.Header = reqHeaders
8371 googleapi.Expand(req.URL, map[string]string{
8372 "parent": c.parent,
8373 })
8374 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.httpRoutes.create", "request", internallog.HTTPRequest(req, body.Bytes()))
8375 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8376 }
8377
8378 // Do executes the "networkservices.projects.locations.httpRoutes.create" call.
8379 // Any non-2xx status code is an error. Response headers are in either
8380 // *Operation.ServerResponse.Header or (if a response was returned at all) in
8381 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
8382 // whether the returned error was because http.StatusNotModified was returned.
8383 func (c *ProjectsLocationsHttpRoutesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
8384 gensupport.SetOptions(c.urlParams_, opts...)
8385 res, err := c.doRequest("json")
8386 if res != nil && res.StatusCode == http.StatusNotModified {
8387 if res.Body != nil {
8388 res.Body.Close()
8389 }
8390 return nil, gensupport.WrapError(&googleapi.Error{
8391 Code: res.StatusCode,
8392 Header: res.Header,
8393 })
8394 }
8395 if err != nil {
8396 return nil, err
8397 }
8398 defer googleapi.CloseBody(res)
8399 if err := googleapi.CheckResponse(res); err != nil {
8400 return nil, gensupport.WrapError(err)
8401 }
8402 ret := &Operation{
8403 ServerResponse: googleapi.ServerResponse{
8404 Header: res.Header,
8405 HTTPStatusCode: res.StatusCode,
8406 },
8407 }
8408 target := &ret
8409 b, err := gensupport.DecodeResponseBytes(target, res)
8410 if err != nil {
8411 return nil, err
8412 }
8413 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.httpRoutes.create", "response", internallog.HTTPResponse(res, b))
8414 return ret, nil
8415 }
8416
8417 type ProjectsLocationsHttpRoutesDeleteCall struct {
8418 s *Service
8419 name string
8420 urlParams_ gensupport.URLParams
8421 ctx_ context.Context
8422 header_ http.Header
8423 }
8424
8425 // Delete: Deletes a single HttpRoute.
8426 //
8427 // - name: A name of the HttpRoute to delete. Must be in the format
8428 // `projects/*/locations/*/httpRoutes/*`.
8429 func (r *ProjectsLocationsHttpRoutesService) Delete(name string) *ProjectsLocationsHttpRoutesDeleteCall {
8430 c := &ProjectsLocationsHttpRoutesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8431 c.name = name
8432 return c
8433 }
8434
8435 // Fields allows partial responses to be retrieved. See
8436 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8437 // details.
8438 func (c *ProjectsLocationsHttpRoutesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsHttpRoutesDeleteCall {
8439 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8440 return c
8441 }
8442
8443 // Context sets the context to be used in this call's Do method.
8444 func (c *ProjectsLocationsHttpRoutesDeleteCall) Context(ctx context.Context) *ProjectsLocationsHttpRoutesDeleteCall {
8445 c.ctx_ = ctx
8446 return c
8447 }
8448
8449 // Header returns a http.Header that can be modified by the caller to add
8450 // headers to the request.
8451 func (c *ProjectsLocationsHttpRoutesDeleteCall) Header() http.Header {
8452 if c.header_ == nil {
8453 c.header_ = make(http.Header)
8454 }
8455 return c.header_
8456 }
8457
8458 func (c *ProjectsLocationsHttpRoutesDeleteCall) doRequest(alt string) (*http.Response, error) {
8459 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8460 c.urlParams_.Set("alt", alt)
8461 c.urlParams_.Set("prettyPrint", "false")
8462 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
8463 urls += "?" + c.urlParams_.Encode()
8464 req, err := http.NewRequest("DELETE", urls, nil)
8465 if err != nil {
8466 return nil, err
8467 }
8468 req.Header = reqHeaders
8469 googleapi.Expand(req.URL, map[string]string{
8470 "name": c.name,
8471 })
8472 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.httpRoutes.delete", "request", internallog.HTTPRequest(req, nil))
8473 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8474 }
8475
8476 // Do executes the "networkservices.projects.locations.httpRoutes.delete" call.
8477 // Any non-2xx status code is an error. Response headers are in either
8478 // *Operation.ServerResponse.Header or (if a response was returned at all) in
8479 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
8480 // whether the returned error was because http.StatusNotModified was returned.
8481 func (c *ProjectsLocationsHttpRoutesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
8482 gensupport.SetOptions(c.urlParams_, opts...)
8483 res, err := c.doRequest("json")
8484 if res != nil && res.StatusCode == http.StatusNotModified {
8485 if res.Body != nil {
8486 res.Body.Close()
8487 }
8488 return nil, gensupport.WrapError(&googleapi.Error{
8489 Code: res.StatusCode,
8490 Header: res.Header,
8491 })
8492 }
8493 if err != nil {
8494 return nil, err
8495 }
8496 defer googleapi.CloseBody(res)
8497 if err := googleapi.CheckResponse(res); err != nil {
8498 return nil, gensupport.WrapError(err)
8499 }
8500 ret := &Operation{
8501 ServerResponse: googleapi.ServerResponse{
8502 Header: res.Header,
8503 HTTPStatusCode: res.StatusCode,
8504 },
8505 }
8506 target := &ret
8507 b, err := gensupport.DecodeResponseBytes(target, res)
8508 if err != nil {
8509 return nil, err
8510 }
8511 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.httpRoutes.delete", "response", internallog.HTTPResponse(res, b))
8512 return ret, nil
8513 }
8514
8515 type ProjectsLocationsHttpRoutesGetCall struct {
8516 s *Service
8517 name string
8518 urlParams_ gensupport.URLParams
8519 ifNoneMatch_ string
8520 ctx_ context.Context
8521 header_ http.Header
8522 }
8523
8524 // Get: Gets details of a single HttpRoute.
8525 //
8526 // - name: A name of the HttpRoute to get. Must be in the format
8527 // `projects/*/locations/*/httpRoutes/*`.
8528 func (r *ProjectsLocationsHttpRoutesService) Get(name string) *ProjectsLocationsHttpRoutesGetCall {
8529 c := &ProjectsLocationsHttpRoutesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8530 c.name = name
8531 return c
8532 }
8533
8534 // Fields allows partial responses to be retrieved. See
8535 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8536 // details.
8537 func (c *ProjectsLocationsHttpRoutesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsHttpRoutesGetCall {
8538 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8539 return c
8540 }
8541
8542 // IfNoneMatch sets an optional parameter which makes the operation fail if the
8543 // object's ETag matches the given value. This is useful for getting updates
8544 // only after the object has changed since the last request.
8545 func (c *ProjectsLocationsHttpRoutesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsHttpRoutesGetCall {
8546 c.ifNoneMatch_ = entityTag
8547 return c
8548 }
8549
8550 // Context sets the context to be used in this call's Do method.
8551 func (c *ProjectsLocationsHttpRoutesGetCall) Context(ctx context.Context) *ProjectsLocationsHttpRoutesGetCall {
8552 c.ctx_ = ctx
8553 return c
8554 }
8555
8556 // Header returns a http.Header that can be modified by the caller to add
8557 // headers to the request.
8558 func (c *ProjectsLocationsHttpRoutesGetCall) Header() http.Header {
8559 if c.header_ == nil {
8560 c.header_ = make(http.Header)
8561 }
8562 return c.header_
8563 }
8564
8565 func (c *ProjectsLocationsHttpRoutesGetCall) doRequest(alt string) (*http.Response, error) {
8566 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8567 if c.ifNoneMatch_ != "" {
8568 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8569 }
8570 c.urlParams_.Set("alt", alt)
8571 c.urlParams_.Set("prettyPrint", "false")
8572 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
8573 urls += "?" + c.urlParams_.Encode()
8574 req, err := http.NewRequest("GET", urls, nil)
8575 if err != nil {
8576 return nil, err
8577 }
8578 req.Header = reqHeaders
8579 googleapi.Expand(req.URL, map[string]string{
8580 "name": c.name,
8581 })
8582 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.httpRoutes.get", "request", internallog.HTTPRequest(req, nil))
8583 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8584 }
8585
8586 // Do executes the "networkservices.projects.locations.httpRoutes.get" call.
8587 // Any non-2xx status code is an error. Response headers are in either
8588 // *HttpRoute.ServerResponse.Header or (if a response was returned at all) in
8589 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
8590 // whether the returned error was because http.StatusNotModified was returned.
8591 func (c *ProjectsLocationsHttpRoutesGetCall) Do(opts ...googleapi.CallOption) (*HttpRoute, error) {
8592 gensupport.SetOptions(c.urlParams_, opts...)
8593 res, err := c.doRequest("json")
8594 if res != nil && res.StatusCode == http.StatusNotModified {
8595 if res.Body != nil {
8596 res.Body.Close()
8597 }
8598 return nil, gensupport.WrapError(&googleapi.Error{
8599 Code: res.StatusCode,
8600 Header: res.Header,
8601 })
8602 }
8603 if err != nil {
8604 return nil, err
8605 }
8606 defer googleapi.CloseBody(res)
8607 if err := googleapi.CheckResponse(res); err != nil {
8608 return nil, gensupport.WrapError(err)
8609 }
8610 ret := &HttpRoute{
8611 ServerResponse: googleapi.ServerResponse{
8612 Header: res.Header,
8613 HTTPStatusCode: res.StatusCode,
8614 },
8615 }
8616 target := &ret
8617 b, err := gensupport.DecodeResponseBytes(target, res)
8618 if err != nil {
8619 return nil, err
8620 }
8621 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.httpRoutes.get", "response", internallog.HTTPResponse(res, b))
8622 return ret, nil
8623 }
8624
8625 type ProjectsLocationsHttpRoutesListCall struct {
8626 s *Service
8627 parent string
8628 urlParams_ gensupport.URLParams
8629 ifNoneMatch_ string
8630 ctx_ context.Context
8631 header_ http.Header
8632 }
8633
8634 // List: Lists HttpRoute in a given project and location.
8635 //
8636 // - parent: The project and location from which the HttpRoutes should be
8637 // listed, specified in the format `projects/*/locations/*`.
8638 func (r *ProjectsLocationsHttpRoutesService) List(parent string) *ProjectsLocationsHttpRoutesListCall {
8639 c := &ProjectsLocationsHttpRoutesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8640 c.parent = parent
8641 return c
8642 }
8643
8644 // PageSize sets the optional parameter "pageSize": Maximum number of
8645 // HttpRoutes to return per call.
8646 func (c *ProjectsLocationsHttpRoutesListCall) PageSize(pageSize int64) *ProjectsLocationsHttpRoutesListCall {
8647 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
8648 return c
8649 }
8650
8651 // PageToken sets the optional parameter "pageToken": The value returned by the
8652 // last `ListHttpRoutesResponse` Indicates that this is a continuation of a
8653 // prior `ListHttpRoutes` call, and that the system should return the next page
8654 // of data.
8655 func (c *ProjectsLocationsHttpRoutesListCall) PageToken(pageToken string) *ProjectsLocationsHttpRoutesListCall {
8656 c.urlParams_.Set("pageToken", pageToken)
8657 return c
8658 }
8659
8660 // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": If
8661 // true, allow partial responses for multi-regional Aggregated List requests.
8662 // Otherwise if one of the locations is down or unreachable, the Aggregated
8663 // List request will fail.
8664 func (c *ProjectsLocationsHttpRoutesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ProjectsLocationsHttpRoutesListCall {
8665 c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
8666 return c
8667 }
8668
8669 // Fields allows partial responses to be retrieved. See
8670 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8671 // details.
8672 func (c *ProjectsLocationsHttpRoutesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsHttpRoutesListCall {
8673 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8674 return c
8675 }
8676
8677 // IfNoneMatch sets an optional parameter which makes the operation fail if the
8678 // object's ETag matches the given value. This is useful for getting updates
8679 // only after the object has changed since the last request.
8680 func (c *ProjectsLocationsHttpRoutesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsHttpRoutesListCall {
8681 c.ifNoneMatch_ = entityTag
8682 return c
8683 }
8684
8685 // Context sets the context to be used in this call's Do method.
8686 func (c *ProjectsLocationsHttpRoutesListCall) Context(ctx context.Context) *ProjectsLocationsHttpRoutesListCall {
8687 c.ctx_ = ctx
8688 return c
8689 }
8690
8691 // Header returns a http.Header that can be modified by the caller to add
8692 // headers to the request.
8693 func (c *ProjectsLocationsHttpRoutesListCall) Header() http.Header {
8694 if c.header_ == nil {
8695 c.header_ = make(http.Header)
8696 }
8697 return c.header_
8698 }
8699
8700 func (c *ProjectsLocationsHttpRoutesListCall) doRequest(alt string) (*http.Response, error) {
8701 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8702 if c.ifNoneMatch_ != "" {
8703 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8704 }
8705 c.urlParams_.Set("alt", alt)
8706 c.urlParams_.Set("prettyPrint", "false")
8707 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/httpRoutes")
8708 urls += "?" + c.urlParams_.Encode()
8709 req, err := http.NewRequest("GET", urls, nil)
8710 if err != nil {
8711 return nil, err
8712 }
8713 req.Header = reqHeaders
8714 googleapi.Expand(req.URL, map[string]string{
8715 "parent": c.parent,
8716 })
8717 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.httpRoutes.list", "request", internallog.HTTPRequest(req, nil))
8718 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8719 }
8720
8721 // Do executes the "networkservices.projects.locations.httpRoutes.list" call.
8722 // Any non-2xx status code is an error. Response headers are in either
8723 // *ListHttpRoutesResponse.ServerResponse.Header or (if a response was returned
8724 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
8725 // check whether the returned error was because http.StatusNotModified was
8726 // returned.
8727 func (c *ProjectsLocationsHttpRoutesListCall) Do(opts ...googleapi.CallOption) (*ListHttpRoutesResponse, error) {
8728 gensupport.SetOptions(c.urlParams_, opts...)
8729 res, err := c.doRequest("json")
8730 if res != nil && res.StatusCode == http.StatusNotModified {
8731 if res.Body != nil {
8732 res.Body.Close()
8733 }
8734 return nil, gensupport.WrapError(&googleapi.Error{
8735 Code: res.StatusCode,
8736 Header: res.Header,
8737 })
8738 }
8739 if err != nil {
8740 return nil, err
8741 }
8742 defer googleapi.CloseBody(res)
8743 if err := googleapi.CheckResponse(res); err != nil {
8744 return nil, gensupport.WrapError(err)
8745 }
8746 ret := &ListHttpRoutesResponse{
8747 ServerResponse: googleapi.ServerResponse{
8748 Header: res.Header,
8749 HTTPStatusCode: res.StatusCode,
8750 },
8751 }
8752 target := &ret
8753 b, err := gensupport.DecodeResponseBytes(target, res)
8754 if err != nil {
8755 return nil, err
8756 }
8757 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.httpRoutes.list", "response", internallog.HTTPResponse(res, b))
8758 return ret, nil
8759 }
8760
8761 // Pages invokes f for each page of results.
8762 // A non-nil error returned from f will halt the iteration.
8763 // The provided context supersedes any context provided to the Context method.
8764 func (c *ProjectsLocationsHttpRoutesListCall) Pages(ctx context.Context, f func(*ListHttpRoutesResponse) error) error {
8765 c.ctx_ = ctx
8766 defer c.PageToken(c.urlParams_.Get("pageToken"))
8767 for {
8768 x, err := c.Do()
8769 if err != nil {
8770 return err
8771 }
8772 if err := f(x); err != nil {
8773 return err
8774 }
8775 if x.NextPageToken == "" {
8776 return nil
8777 }
8778 c.PageToken(x.NextPageToken)
8779 }
8780 }
8781
8782 type ProjectsLocationsHttpRoutesPatchCall struct {
8783 s *Service
8784 name string
8785 httproute *HttpRoute
8786 urlParams_ gensupport.URLParams
8787 ctx_ context.Context
8788 header_ http.Header
8789 }
8790
8791 // Patch: Updates the parameters of a single HttpRoute.
8792 //
8793 // - name: Identifier. Name of the HttpRoute resource. It matches pattern
8794 // `projects/*/locations/*/httpRoutes/http_route_name>`.
8795 func (r *ProjectsLocationsHttpRoutesService) Patch(name string, httproute *HttpRoute) *ProjectsLocationsHttpRoutesPatchCall {
8796 c := &ProjectsLocationsHttpRoutesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8797 c.name = name
8798 c.httproute = httproute
8799 return c
8800 }
8801
8802 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
8803 // specify the fields to be overwritten in the HttpRoute resource by the
8804 // update. The fields specified in the update_mask are relative to the
8805 // resource, not the full request. A field will be overwritten if it is in the
8806 // mask. If the user does not provide a mask then all fields will be
8807 // overwritten.
8808 func (c *ProjectsLocationsHttpRoutesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsHttpRoutesPatchCall {
8809 c.urlParams_.Set("updateMask", updateMask)
8810 return c
8811 }
8812
8813 // Fields allows partial responses to be retrieved. See
8814 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8815 // details.
8816 func (c *ProjectsLocationsHttpRoutesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsHttpRoutesPatchCall {
8817 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8818 return c
8819 }
8820
8821 // Context sets the context to be used in this call's Do method.
8822 func (c *ProjectsLocationsHttpRoutesPatchCall) Context(ctx context.Context) *ProjectsLocationsHttpRoutesPatchCall {
8823 c.ctx_ = ctx
8824 return c
8825 }
8826
8827 // Header returns a http.Header that can be modified by the caller to add
8828 // headers to the request.
8829 func (c *ProjectsLocationsHttpRoutesPatchCall) Header() http.Header {
8830 if c.header_ == nil {
8831 c.header_ = make(http.Header)
8832 }
8833 return c.header_
8834 }
8835
8836 func (c *ProjectsLocationsHttpRoutesPatchCall) doRequest(alt string) (*http.Response, error) {
8837 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8838 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.httproute)
8839 if err != nil {
8840 return nil, err
8841 }
8842 c.urlParams_.Set("alt", alt)
8843 c.urlParams_.Set("prettyPrint", "false")
8844 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
8845 urls += "?" + c.urlParams_.Encode()
8846 req, err := http.NewRequest("PATCH", urls, body)
8847 if err != nil {
8848 return nil, err
8849 }
8850 req.Header = reqHeaders
8851 googleapi.Expand(req.URL, map[string]string{
8852 "name": c.name,
8853 })
8854 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.httpRoutes.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
8855 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8856 }
8857
8858 // Do executes the "networkservices.projects.locations.httpRoutes.patch" call.
8859 // Any non-2xx status code is an error. Response headers are in either
8860 // *Operation.ServerResponse.Header or (if a response was returned at all) in
8861 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
8862 // whether the returned error was because http.StatusNotModified was returned.
8863 func (c *ProjectsLocationsHttpRoutesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
8864 gensupport.SetOptions(c.urlParams_, opts...)
8865 res, err := c.doRequest("json")
8866 if res != nil && res.StatusCode == http.StatusNotModified {
8867 if res.Body != nil {
8868 res.Body.Close()
8869 }
8870 return nil, gensupport.WrapError(&googleapi.Error{
8871 Code: res.StatusCode,
8872 Header: res.Header,
8873 })
8874 }
8875 if err != nil {
8876 return nil, err
8877 }
8878 defer googleapi.CloseBody(res)
8879 if err := googleapi.CheckResponse(res); err != nil {
8880 return nil, gensupport.WrapError(err)
8881 }
8882 ret := &Operation{
8883 ServerResponse: googleapi.ServerResponse{
8884 Header: res.Header,
8885 HTTPStatusCode: res.StatusCode,
8886 },
8887 }
8888 target := &ret
8889 b, err := gensupport.DecodeResponseBytes(target, res)
8890 if err != nil {
8891 return nil, err
8892 }
8893 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.httpRoutes.patch", "response", internallog.HTTPResponse(res, b))
8894 return ret, nil
8895 }
8896
8897 type ProjectsLocationsLbEdgeExtensionsCreateCall struct {
8898 s *Service
8899 parent string
8900 lbedgeextension *LbEdgeExtension
8901 urlParams_ gensupport.URLParams
8902 ctx_ context.Context
8903 header_ http.Header
8904 }
8905
8906 // Create: Creates a new `LbEdgeExtension` resource in a given project and
8907 // location.
8908 //
8909 // - parent: The parent resource of the `LbEdgeExtension` resource. Must be in
8910 // the format `projects/{project}/locations/{location}`.
8911 func (r *ProjectsLocationsLbEdgeExtensionsService) Create(parent string, lbedgeextension *LbEdgeExtension) *ProjectsLocationsLbEdgeExtensionsCreateCall {
8912 c := &ProjectsLocationsLbEdgeExtensionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8913 c.parent = parent
8914 c.lbedgeextension = lbedgeextension
8915 return c
8916 }
8917
8918 // LbEdgeExtensionId sets the optional parameter "lbEdgeExtensionId": Required.
8919 // User-provided ID of the `LbEdgeExtension` resource to be created.
8920 func (c *ProjectsLocationsLbEdgeExtensionsCreateCall) LbEdgeExtensionId(lbEdgeExtensionId string) *ProjectsLocationsLbEdgeExtensionsCreateCall {
8921 c.urlParams_.Set("lbEdgeExtensionId", lbEdgeExtensionId)
8922 return c
8923 }
8924
8925 // RequestId sets the optional parameter "requestId": An optional request ID to
8926 // identify requests. Specify a unique request ID so that if you must retry
8927 // your request, the server can ignore the request if it has already been
8928 // completed. The server guarantees that for 60 minutes since the first
8929 // request. For example, consider a situation where you make an initial request
8930 // and the request times out. If you make the request again with the same
8931 // request ID, the server ignores the second request This prevents clients from
8932 // accidentally creating duplicate commitments. The request ID must be a valid
8933 // UUID with the exception that zero UUID is not supported
8934 // (00000000-0000-0000-0000-000000000000).
8935 func (c *ProjectsLocationsLbEdgeExtensionsCreateCall) RequestId(requestId string) *ProjectsLocationsLbEdgeExtensionsCreateCall {
8936 c.urlParams_.Set("requestId", requestId)
8937 return c
8938 }
8939
8940 // Fields allows partial responses to be retrieved. See
8941 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8942 // details.
8943 func (c *ProjectsLocationsLbEdgeExtensionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbEdgeExtensionsCreateCall {
8944 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8945 return c
8946 }
8947
8948 // Context sets the context to be used in this call's Do method.
8949 func (c *ProjectsLocationsLbEdgeExtensionsCreateCall) Context(ctx context.Context) *ProjectsLocationsLbEdgeExtensionsCreateCall {
8950 c.ctx_ = ctx
8951 return c
8952 }
8953
8954 // Header returns a http.Header that can be modified by the caller to add
8955 // headers to the request.
8956 func (c *ProjectsLocationsLbEdgeExtensionsCreateCall) Header() http.Header {
8957 if c.header_ == nil {
8958 c.header_ = make(http.Header)
8959 }
8960 return c.header_
8961 }
8962
8963 func (c *ProjectsLocationsLbEdgeExtensionsCreateCall) doRequest(alt string) (*http.Response, error) {
8964 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8965 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lbedgeextension)
8966 if err != nil {
8967 return nil, err
8968 }
8969 c.urlParams_.Set("alt", alt)
8970 c.urlParams_.Set("prettyPrint", "false")
8971 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/lbEdgeExtensions")
8972 urls += "?" + c.urlParams_.Encode()
8973 req, err := http.NewRequest("POST", urls, body)
8974 if err != nil {
8975 return nil, err
8976 }
8977 req.Header = reqHeaders
8978 googleapi.Expand(req.URL, map[string]string{
8979 "parent": c.parent,
8980 })
8981 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbEdgeExtensions.create", "request", internallog.HTTPRequest(req, body.Bytes()))
8982 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8983 }
8984
8985 // Do executes the "networkservices.projects.locations.lbEdgeExtensions.create" call.
8986 // Any non-2xx status code is an error. Response headers are in either
8987 // *Operation.ServerResponse.Header or (if a response was returned at all) in
8988 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
8989 // whether the returned error was because http.StatusNotModified was returned.
8990 func (c *ProjectsLocationsLbEdgeExtensionsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
8991 gensupport.SetOptions(c.urlParams_, opts...)
8992 res, err := c.doRequest("json")
8993 if res != nil && res.StatusCode == http.StatusNotModified {
8994 if res.Body != nil {
8995 res.Body.Close()
8996 }
8997 return nil, gensupport.WrapError(&googleapi.Error{
8998 Code: res.StatusCode,
8999 Header: res.Header,
9000 })
9001 }
9002 if err != nil {
9003 return nil, err
9004 }
9005 defer googleapi.CloseBody(res)
9006 if err := googleapi.CheckResponse(res); err != nil {
9007 return nil, gensupport.WrapError(err)
9008 }
9009 ret := &Operation{
9010 ServerResponse: googleapi.ServerResponse{
9011 Header: res.Header,
9012 HTTPStatusCode: res.StatusCode,
9013 },
9014 }
9015 target := &ret
9016 b, err := gensupport.DecodeResponseBytes(target, res)
9017 if err != nil {
9018 return nil, err
9019 }
9020 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbEdgeExtensions.create", "response", internallog.HTTPResponse(res, b))
9021 return ret, nil
9022 }
9023
9024 type ProjectsLocationsLbEdgeExtensionsDeleteCall struct {
9025 s *Service
9026 name string
9027 urlParams_ gensupport.URLParams
9028 ctx_ context.Context
9029 header_ http.Header
9030 }
9031
9032 // Delete: Deletes the specified `LbEdgeExtension` resource.
9033 //
9034 // - name: The name of the `LbEdgeExtension` resource to delete. Must be in the
9035 // format
9036 // `projects/{project}/locations/{location}/lbEdgeExtensions/{lb_edge_extensio
9037 // n}`.
9038 func (r *ProjectsLocationsLbEdgeExtensionsService) Delete(name string) *ProjectsLocationsLbEdgeExtensionsDeleteCall {
9039 c := &ProjectsLocationsLbEdgeExtensionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9040 c.name = name
9041 return c
9042 }
9043
9044 // RequestId sets the optional parameter "requestId": An optional request ID to
9045 // identify requests. Specify a unique request ID so that if you must retry
9046 // your request, the server can ignore the request if it has already been
9047 // completed. The server guarantees that for 60 minutes after the first
9048 // request. For example, consider a situation where you make an initial request
9049 // and the request times out. If you make the request again with the same
9050 // request ID, the server ignores the second request This prevents clients from
9051 // accidentally creating duplicate commitments. The request ID must be a valid
9052 // UUID with the exception that zero UUID is not supported
9053 // (00000000-0000-0000-0000-000000000000).
9054 func (c *ProjectsLocationsLbEdgeExtensionsDeleteCall) RequestId(requestId string) *ProjectsLocationsLbEdgeExtensionsDeleteCall {
9055 c.urlParams_.Set("requestId", requestId)
9056 return c
9057 }
9058
9059 // Fields allows partial responses to be retrieved. See
9060 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9061 // details.
9062 func (c *ProjectsLocationsLbEdgeExtensionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbEdgeExtensionsDeleteCall {
9063 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9064 return c
9065 }
9066
9067 // Context sets the context to be used in this call's Do method.
9068 func (c *ProjectsLocationsLbEdgeExtensionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsLbEdgeExtensionsDeleteCall {
9069 c.ctx_ = ctx
9070 return c
9071 }
9072
9073 // Header returns a http.Header that can be modified by the caller to add
9074 // headers to the request.
9075 func (c *ProjectsLocationsLbEdgeExtensionsDeleteCall) Header() http.Header {
9076 if c.header_ == nil {
9077 c.header_ = make(http.Header)
9078 }
9079 return c.header_
9080 }
9081
9082 func (c *ProjectsLocationsLbEdgeExtensionsDeleteCall) doRequest(alt string) (*http.Response, error) {
9083 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9084 c.urlParams_.Set("alt", alt)
9085 c.urlParams_.Set("prettyPrint", "false")
9086 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
9087 urls += "?" + c.urlParams_.Encode()
9088 req, err := http.NewRequest("DELETE", urls, nil)
9089 if err != nil {
9090 return nil, err
9091 }
9092 req.Header = reqHeaders
9093 googleapi.Expand(req.URL, map[string]string{
9094 "name": c.name,
9095 })
9096 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbEdgeExtensions.delete", "request", internallog.HTTPRequest(req, nil))
9097 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9098 }
9099
9100 // Do executes the "networkservices.projects.locations.lbEdgeExtensions.delete" call.
9101 // Any non-2xx status code is an error. Response headers are in either
9102 // *Operation.ServerResponse.Header or (if a response was returned at all) in
9103 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
9104 // whether the returned error was because http.StatusNotModified was returned.
9105 func (c *ProjectsLocationsLbEdgeExtensionsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
9106 gensupport.SetOptions(c.urlParams_, opts...)
9107 res, err := c.doRequest("json")
9108 if res != nil && res.StatusCode == http.StatusNotModified {
9109 if res.Body != nil {
9110 res.Body.Close()
9111 }
9112 return nil, gensupport.WrapError(&googleapi.Error{
9113 Code: res.StatusCode,
9114 Header: res.Header,
9115 })
9116 }
9117 if err != nil {
9118 return nil, err
9119 }
9120 defer googleapi.CloseBody(res)
9121 if err := googleapi.CheckResponse(res); err != nil {
9122 return nil, gensupport.WrapError(err)
9123 }
9124 ret := &Operation{
9125 ServerResponse: googleapi.ServerResponse{
9126 Header: res.Header,
9127 HTTPStatusCode: res.StatusCode,
9128 },
9129 }
9130 target := &ret
9131 b, err := gensupport.DecodeResponseBytes(target, res)
9132 if err != nil {
9133 return nil, err
9134 }
9135 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbEdgeExtensions.delete", "response", internallog.HTTPResponse(res, b))
9136 return ret, nil
9137 }
9138
9139 type ProjectsLocationsLbEdgeExtensionsGetCall struct {
9140 s *Service
9141 name string
9142 urlParams_ gensupport.URLParams
9143 ifNoneMatch_ string
9144 ctx_ context.Context
9145 header_ http.Header
9146 }
9147
9148 // Get: Gets details of the specified `LbEdgeExtension` resource.
9149 //
9150 // - name: A name of the `LbEdgeExtension` resource to get. Must be in the
9151 // format
9152 // `projects/{project}/locations/{location}/lbEdgeExtensions/{lb_edge_extensio
9153 // n}`.
9154 func (r *ProjectsLocationsLbEdgeExtensionsService) Get(name string) *ProjectsLocationsLbEdgeExtensionsGetCall {
9155 c := &ProjectsLocationsLbEdgeExtensionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9156 c.name = name
9157 return c
9158 }
9159
9160 // Fields allows partial responses to be retrieved. See
9161 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9162 // details.
9163 func (c *ProjectsLocationsLbEdgeExtensionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbEdgeExtensionsGetCall {
9164 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9165 return c
9166 }
9167
9168 // IfNoneMatch sets an optional parameter which makes the operation fail if the
9169 // object's ETag matches the given value. This is useful for getting updates
9170 // only after the object has changed since the last request.
9171 func (c *ProjectsLocationsLbEdgeExtensionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsLbEdgeExtensionsGetCall {
9172 c.ifNoneMatch_ = entityTag
9173 return c
9174 }
9175
9176 // Context sets the context to be used in this call's Do method.
9177 func (c *ProjectsLocationsLbEdgeExtensionsGetCall) Context(ctx context.Context) *ProjectsLocationsLbEdgeExtensionsGetCall {
9178 c.ctx_ = ctx
9179 return c
9180 }
9181
9182 // Header returns a http.Header that can be modified by the caller to add
9183 // headers to the request.
9184 func (c *ProjectsLocationsLbEdgeExtensionsGetCall) Header() http.Header {
9185 if c.header_ == nil {
9186 c.header_ = make(http.Header)
9187 }
9188 return c.header_
9189 }
9190
9191 func (c *ProjectsLocationsLbEdgeExtensionsGetCall) doRequest(alt string) (*http.Response, error) {
9192 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9193 if c.ifNoneMatch_ != "" {
9194 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9195 }
9196 c.urlParams_.Set("alt", alt)
9197 c.urlParams_.Set("prettyPrint", "false")
9198 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
9199 urls += "?" + c.urlParams_.Encode()
9200 req, err := http.NewRequest("GET", urls, nil)
9201 if err != nil {
9202 return nil, err
9203 }
9204 req.Header = reqHeaders
9205 googleapi.Expand(req.URL, map[string]string{
9206 "name": c.name,
9207 })
9208 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbEdgeExtensions.get", "request", internallog.HTTPRequest(req, nil))
9209 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9210 }
9211
9212 // Do executes the "networkservices.projects.locations.lbEdgeExtensions.get" call.
9213 // Any non-2xx status code is an error. Response headers are in either
9214 // *LbEdgeExtension.ServerResponse.Header or (if a response was returned at
9215 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
9216 // check whether the returned error was because http.StatusNotModified was
9217 // returned.
9218 func (c *ProjectsLocationsLbEdgeExtensionsGetCall) Do(opts ...googleapi.CallOption) (*LbEdgeExtension, error) {
9219 gensupport.SetOptions(c.urlParams_, opts...)
9220 res, err := c.doRequest("json")
9221 if res != nil && res.StatusCode == http.StatusNotModified {
9222 if res.Body != nil {
9223 res.Body.Close()
9224 }
9225 return nil, gensupport.WrapError(&googleapi.Error{
9226 Code: res.StatusCode,
9227 Header: res.Header,
9228 })
9229 }
9230 if err != nil {
9231 return nil, err
9232 }
9233 defer googleapi.CloseBody(res)
9234 if err := googleapi.CheckResponse(res); err != nil {
9235 return nil, gensupport.WrapError(err)
9236 }
9237 ret := &LbEdgeExtension{
9238 ServerResponse: googleapi.ServerResponse{
9239 Header: res.Header,
9240 HTTPStatusCode: res.StatusCode,
9241 },
9242 }
9243 target := &ret
9244 b, err := gensupport.DecodeResponseBytes(target, res)
9245 if err != nil {
9246 return nil, err
9247 }
9248 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbEdgeExtensions.get", "response", internallog.HTTPResponse(res, b))
9249 return ret, nil
9250 }
9251
9252 type ProjectsLocationsLbEdgeExtensionsListCall struct {
9253 s *Service
9254 parent string
9255 urlParams_ gensupport.URLParams
9256 ifNoneMatch_ string
9257 ctx_ context.Context
9258 header_ http.Header
9259 }
9260
9261 // List: Lists `LbEdgeExtension` resources in a given project and location.
9262 //
9263 // - parent: The project and location from which the `LbEdgeExtension`
9264 // resources are listed. These values are specified in the following format:
9265 // `projects/{project}/locations/{location}`.
9266 func (r *ProjectsLocationsLbEdgeExtensionsService) List(parent string) *ProjectsLocationsLbEdgeExtensionsListCall {
9267 c := &ProjectsLocationsLbEdgeExtensionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9268 c.parent = parent
9269 return c
9270 }
9271
9272 // Filter sets the optional parameter "filter": Filtering results.
9273 func (c *ProjectsLocationsLbEdgeExtensionsListCall) Filter(filter string) *ProjectsLocationsLbEdgeExtensionsListCall {
9274 c.urlParams_.Set("filter", filter)
9275 return c
9276 }
9277
9278 // OrderBy sets the optional parameter "orderBy": Hint about how to order the
9279 // results.
9280 func (c *ProjectsLocationsLbEdgeExtensionsListCall) OrderBy(orderBy string) *ProjectsLocationsLbEdgeExtensionsListCall {
9281 c.urlParams_.Set("orderBy", orderBy)
9282 return c
9283 }
9284
9285 // PageSize sets the optional parameter "pageSize": Requested page size. The
9286 // server might return fewer items than requested. If unspecified, the server
9287 // picks an appropriate default.
9288 func (c *ProjectsLocationsLbEdgeExtensionsListCall) PageSize(pageSize int64) *ProjectsLocationsLbEdgeExtensionsListCall {
9289 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
9290 return c
9291 }
9292
9293 // PageToken sets the optional parameter "pageToken": A token identifying a
9294 // page of results that the server returns.
9295 func (c *ProjectsLocationsLbEdgeExtensionsListCall) PageToken(pageToken string) *ProjectsLocationsLbEdgeExtensionsListCall {
9296 c.urlParams_.Set("pageToken", pageToken)
9297 return c
9298 }
9299
9300 // Fields allows partial responses to be retrieved. See
9301 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9302 // details.
9303 func (c *ProjectsLocationsLbEdgeExtensionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbEdgeExtensionsListCall {
9304 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9305 return c
9306 }
9307
9308 // IfNoneMatch sets an optional parameter which makes the operation fail if the
9309 // object's ETag matches the given value. This is useful for getting updates
9310 // only after the object has changed since the last request.
9311 func (c *ProjectsLocationsLbEdgeExtensionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsLbEdgeExtensionsListCall {
9312 c.ifNoneMatch_ = entityTag
9313 return c
9314 }
9315
9316 // Context sets the context to be used in this call's Do method.
9317 func (c *ProjectsLocationsLbEdgeExtensionsListCall) Context(ctx context.Context) *ProjectsLocationsLbEdgeExtensionsListCall {
9318 c.ctx_ = ctx
9319 return c
9320 }
9321
9322 // Header returns a http.Header that can be modified by the caller to add
9323 // headers to the request.
9324 func (c *ProjectsLocationsLbEdgeExtensionsListCall) Header() http.Header {
9325 if c.header_ == nil {
9326 c.header_ = make(http.Header)
9327 }
9328 return c.header_
9329 }
9330
9331 func (c *ProjectsLocationsLbEdgeExtensionsListCall) doRequest(alt string) (*http.Response, error) {
9332 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9333 if c.ifNoneMatch_ != "" {
9334 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9335 }
9336 c.urlParams_.Set("alt", alt)
9337 c.urlParams_.Set("prettyPrint", "false")
9338 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/lbEdgeExtensions")
9339 urls += "?" + c.urlParams_.Encode()
9340 req, err := http.NewRequest("GET", urls, nil)
9341 if err != nil {
9342 return nil, err
9343 }
9344 req.Header = reqHeaders
9345 googleapi.Expand(req.URL, map[string]string{
9346 "parent": c.parent,
9347 })
9348 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbEdgeExtensions.list", "request", internallog.HTTPRequest(req, nil))
9349 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9350 }
9351
9352 // Do executes the "networkservices.projects.locations.lbEdgeExtensions.list" call.
9353 // Any non-2xx status code is an error. Response headers are in either
9354 // *ListLbEdgeExtensionsResponse.ServerResponse.Header or (if a response was
9355 // returned at all) in error.(*googleapi.Error).Header. Use
9356 // googleapi.IsNotModified to check whether the returned error was because
9357 // http.StatusNotModified was returned.
9358 func (c *ProjectsLocationsLbEdgeExtensionsListCall) Do(opts ...googleapi.CallOption) (*ListLbEdgeExtensionsResponse, error) {
9359 gensupport.SetOptions(c.urlParams_, opts...)
9360 res, err := c.doRequest("json")
9361 if res != nil && res.StatusCode == http.StatusNotModified {
9362 if res.Body != nil {
9363 res.Body.Close()
9364 }
9365 return nil, gensupport.WrapError(&googleapi.Error{
9366 Code: res.StatusCode,
9367 Header: res.Header,
9368 })
9369 }
9370 if err != nil {
9371 return nil, err
9372 }
9373 defer googleapi.CloseBody(res)
9374 if err := googleapi.CheckResponse(res); err != nil {
9375 return nil, gensupport.WrapError(err)
9376 }
9377 ret := &ListLbEdgeExtensionsResponse{
9378 ServerResponse: googleapi.ServerResponse{
9379 Header: res.Header,
9380 HTTPStatusCode: res.StatusCode,
9381 },
9382 }
9383 target := &ret
9384 b, err := gensupport.DecodeResponseBytes(target, res)
9385 if err != nil {
9386 return nil, err
9387 }
9388 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbEdgeExtensions.list", "response", internallog.HTTPResponse(res, b))
9389 return ret, nil
9390 }
9391
9392 // Pages invokes f for each page of results.
9393 // A non-nil error returned from f will halt the iteration.
9394 // The provided context supersedes any context provided to the Context method.
9395 func (c *ProjectsLocationsLbEdgeExtensionsListCall) Pages(ctx context.Context, f func(*ListLbEdgeExtensionsResponse) error) error {
9396 c.ctx_ = ctx
9397 defer c.PageToken(c.urlParams_.Get("pageToken"))
9398 for {
9399 x, err := c.Do()
9400 if err != nil {
9401 return err
9402 }
9403 if err := f(x); err != nil {
9404 return err
9405 }
9406 if x.NextPageToken == "" {
9407 return nil
9408 }
9409 c.PageToken(x.NextPageToken)
9410 }
9411 }
9412
9413 type ProjectsLocationsLbEdgeExtensionsPatchCall struct {
9414 s *Service
9415 name string
9416 lbedgeextension *LbEdgeExtension
9417 urlParams_ gensupport.URLParams
9418 ctx_ context.Context
9419 header_ http.Header
9420 }
9421
9422 // Patch: Updates the parameters of the specified `LbEdgeExtension` resource.
9423 //
9424 // - name: Identifier. Name of the `LbEdgeExtension` resource in the following
9425 // format:
9426 // `projects/{project}/locations/{location}/lbEdgeExtensions/{lb_edge_extensio
9427 // n}`.
9428 func (r *ProjectsLocationsLbEdgeExtensionsService) Patch(name string, lbedgeextension *LbEdgeExtension) *ProjectsLocationsLbEdgeExtensionsPatchCall {
9429 c := &ProjectsLocationsLbEdgeExtensionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9430 c.name = name
9431 c.lbedgeextension = lbedgeextension
9432 return c
9433 }
9434
9435 // RequestId sets the optional parameter "requestId": An optional request ID to
9436 // identify requests. Specify a unique request ID so that if you must retry
9437 // your request, the server can ignore the request if it has already been
9438 // completed. The server guarantees that for 60 minutes since the first
9439 // request. For example, consider a situation where you make an initial request
9440 // and the request times out. If you make the request again with the same
9441 // request ID, the server ignores the second request This prevents clients from
9442 // accidentally creating duplicate commitments. The request ID must be a valid
9443 // UUID with the exception that zero UUID is not supported
9444 // (00000000-0000-0000-0000-000000000000).
9445 func (c *ProjectsLocationsLbEdgeExtensionsPatchCall) RequestId(requestId string) *ProjectsLocationsLbEdgeExtensionsPatchCall {
9446 c.urlParams_.Set("requestId", requestId)
9447 return c
9448 }
9449
9450 // UpdateMask sets the optional parameter "updateMask": Used to specify the
9451 // fields to be overwritten in the `LbEdgeExtension` resource by the update.
9452 // The fields specified in the `update_mask` are relative to the resource, not
9453 // the full request. A field is overwritten if it is in the mask. If the user
9454 // does not specify a mask, then all fields are overwritten.
9455 func (c *ProjectsLocationsLbEdgeExtensionsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsLbEdgeExtensionsPatchCall {
9456 c.urlParams_.Set("updateMask", updateMask)
9457 return c
9458 }
9459
9460 // Fields allows partial responses to be retrieved. See
9461 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9462 // details.
9463 func (c *ProjectsLocationsLbEdgeExtensionsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbEdgeExtensionsPatchCall {
9464 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9465 return c
9466 }
9467
9468 // Context sets the context to be used in this call's Do method.
9469 func (c *ProjectsLocationsLbEdgeExtensionsPatchCall) Context(ctx context.Context) *ProjectsLocationsLbEdgeExtensionsPatchCall {
9470 c.ctx_ = ctx
9471 return c
9472 }
9473
9474 // Header returns a http.Header that can be modified by the caller to add
9475 // headers to the request.
9476 func (c *ProjectsLocationsLbEdgeExtensionsPatchCall) Header() http.Header {
9477 if c.header_ == nil {
9478 c.header_ = make(http.Header)
9479 }
9480 return c.header_
9481 }
9482
9483 func (c *ProjectsLocationsLbEdgeExtensionsPatchCall) doRequest(alt string) (*http.Response, error) {
9484 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9485 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lbedgeextension)
9486 if err != nil {
9487 return nil, err
9488 }
9489 c.urlParams_.Set("alt", alt)
9490 c.urlParams_.Set("prettyPrint", "false")
9491 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
9492 urls += "?" + c.urlParams_.Encode()
9493 req, err := http.NewRequest("PATCH", urls, body)
9494 if err != nil {
9495 return nil, err
9496 }
9497 req.Header = reqHeaders
9498 googleapi.Expand(req.URL, map[string]string{
9499 "name": c.name,
9500 })
9501 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbEdgeExtensions.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
9502 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9503 }
9504
9505 // Do executes the "networkservices.projects.locations.lbEdgeExtensions.patch" call.
9506 // Any non-2xx status code is an error. Response headers are in either
9507 // *Operation.ServerResponse.Header or (if a response was returned at all) in
9508 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
9509 // whether the returned error was because http.StatusNotModified was returned.
9510 func (c *ProjectsLocationsLbEdgeExtensionsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
9511 gensupport.SetOptions(c.urlParams_, opts...)
9512 res, err := c.doRequest("json")
9513 if res != nil && res.StatusCode == http.StatusNotModified {
9514 if res.Body != nil {
9515 res.Body.Close()
9516 }
9517 return nil, gensupport.WrapError(&googleapi.Error{
9518 Code: res.StatusCode,
9519 Header: res.Header,
9520 })
9521 }
9522 if err != nil {
9523 return nil, err
9524 }
9525 defer googleapi.CloseBody(res)
9526 if err := googleapi.CheckResponse(res); err != nil {
9527 return nil, gensupport.WrapError(err)
9528 }
9529 ret := &Operation{
9530 ServerResponse: googleapi.ServerResponse{
9531 Header: res.Header,
9532 HTTPStatusCode: res.StatusCode,
9533 },
9534 }
9535 target := &ret
9536 b, err := gensupport.DecodeResponseBytes(target, res)
9537 if err != nil {
9538 return nil, err
9539 }
9540 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbEdgeExtensions.patch", "response", internallog.HTTPResponse(res, b))
9541 return ret, nil
9542 }
9543
9544 type ProjectsLocationsLbRouteExtensionsCreateCall struct {
9545 s *Service
9546 parent string
9547 lbrouteextension *LbRouteExtension
9548 urlParams_ gensupport.URLParams
9549 ctx_ context.Context
9550 header_ http.Header
9551 }
9552
9553 // Create: Creates a new `LbRouteExtension` resource in a given project and
9554 // location.
9555 //
9556 // - parent: The parent resource of the `LbRouteExtension` resource. Must be in
9557 // the format `projects/{project}/locations/{location}`.
9558 func (r *ProjectsLocationsLbRouteExtensionsService) Create(parent string, lbrouteextension *LbRouteExtension) *ProjectsLocationsLbRouteExtensionsCreateCall {
9559 c := &ProjectsLocationsLbRouteExtensionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9560 c.parent = parent
9561 c.lbrouteextension = lbrouteextension
9562 return c
9563 }
9564
9565 // LbRouteExtensionId sets the optional parameter "lbRouteExtensionId":
9566 // Required. User-provided ID of the `LbRouteExtension` resource to be created.
9567 func (c *ProjectsLocationsLbRouteExtensionsCreateCall) LbRouteExtensionId(lbRouteExtensionId string) *ProjectsLocationsLbRouteExtensionsCreateCall {
9568 c.urlParams_.Set("lbRouteExtensionId", lbRouteExtensionId)
9569 return c
9570 }
9571
9572 // RequestId sets the optional parameter "requestId": An optional request ID to
9573 // identify requests. Specify a unique request ID so that if you must retry
9574 // your request, the server can ignore the request if it has already been
9575 // completed. The server guarantees that for 60 minutes since the first
9576 // request. For example, consider a situation where you make an initial request
9577 // and the request times out. If you make the request again with the same
9578 // request ID, the server ignores the second request This prevents clients from
9579 // accidentally creating duplicate commitments. The request ID must be a valid
9580 // UUID with the exception that zero UUID is not supported
9581 // (00000000-0000-0000-0000-000000000000).
9582 func (c *ProjectsLocationsLbRouteExtensionsCreateCall) RequestId(requestId string) *ProjectsLocationsLbRouteExtensionsCreateCall {
9583 c.urlParams_.Set("requestId", requestId)
9584 return c
9585 }
9586
9587 // Fields allows partial responses to be retrieved. See
9588 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9589 // details.
9590 func (c *ProjectsLocationsLbRouteExtensionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbRouteExtensionsCreateCall {
9591 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9592 return c
9593 }
9594
9595 // Context sets the context to be used in this call's Do method.
9596 func (c *ProjectsLocationsLbRouteExtensionsCreateCall) Context(ctx context.Context) *ProjectsLocationsLbRouteExtensionsCreateCall {
9597 c.ctx_ = ctx
9598 return c
9599 }
9600
9601 // Header returns a http.Header that can be modified by the caller to add
9602 // headers to the request.
9603 func (c *ProjectsLocationsLbRouteExtensionsCreateCall) Header() http.Header {
9604 if c.header_ == nil {
9605 c.header_ = make(http.Header)
9606 }
9607 return c.header_
9608 }
9609
9610 func (c *ProjectsLocationsLbRouteExtensionsCreateCall) doRequest(alt string) (*http.Response, error) {
9611 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9612 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lbrouteextension)
9613 if err != nil {
9614 return nil, err
9615 }
9616 c.urlParams_.Set("alt", alt)
9617 c.urlParams_.Set("prettyPrint", "false")
9618 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/lbRouteExtensions")
9619 urls += "?" + c.urlParams_.Encode()
9620 req, err := http.NewRequest("POST", urls, body)
9621 if err != nil {
9622 return nil, err
9623 }
9624 req.Header = reqHeaders
9625 googleapi.Expand(req.URL, map[string]string{
9626 "parent": c.parent,
9627 })
9628 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbRouteExtensions.create", "request", internallog.HTTPRequest(req, body.Bytes()))
9629 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9630 }
9631
9632 // Do executes the "networkservices.projects.locations.lbRouteExtensions.create" call.
9633 // Any non-2xx status code is an error. Response headers are in either
9634 // *Operation.ServerResponse.Header or (if a response was returned at all) in
9635 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
9636 // whether the returned error was because http.StatusNotModified was returned.
9637 func (c *ProjectsLocationsLbRouteExtensionsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
9638 gensupport.SetOptions(c.urlParams_, opts...)
9639 res, err := c.doRequest("json")
9640 if res != nil && res.StatusCode == http.StatusNotModified {
9641 if res.Body != nil {
9642 res.Body.Close()
9643 }
9644 return nil, gensupport.WrapError(&googleapi.Error{
9645 Code: res.StatusCode,
9646 Header: res.Header,
9647 })
9648 }
9649 if err != nil {
9650 return nil, err
9651 }
9652 defer googleapi.CloseBody(res)
9653 if err := googleapi.CheckResponse(res); err != nil {
9654 return nil, gensupport.WrapError(err)
9655 }
9656 ret := &Operation{
9657 ServerResponse: googleapi.ServerResponse{
9658 Header: res.Header,
9659 HTTPStatusCode: res.StatusCode,
9660 },
9661 }
9662 target := &ret
9663 b, err := gensupport.DecodeResponseBytes(target, res)
9664 if err != nil {
9665 return nil, err
9666 }
9667 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbRouteExtensions.create", "response", internallog.HTTPResponse(res, b))
9668 return ret, nil
9669 }
9670
9671 type ProjectsLocationsLbRouteExtensionsDeleteCall struct {
9672 s *Service
9673 name string
9674 urlParams_ gensupport.URLParams
9675 ctx_ context.Context
9676 header_ http.Header
9677 }
9678
9679 // Delete: Deletes the specified `LbRouteExtension` resource.
9680 //
9681 // - name: The name of the `LbRouteExtension` resource to delete. Must be in
9682 // the format
9683 // `projects/{project}/locations/{location}/lbRouteExtensions/{lb_route_extens
9684 // ion}`.
9685 func (r *ProjectsLocationsLbRouteExtensionsService) Delete(name string) *ProjectsLocationsLbRouteExtensionsDeleteCall {
9686 c := &ProjectsLocationsLbRouteExtensionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9687 c.name = name
9688 return c
9689 }
9690
9691 // RequestId sets the optional parameter "requestId": An optional request ID to
9692 // identify requests. Specify a unique request ID so that if you must retry
9693 // your request, the server can ignore the request if it has already been
9694 // completed. The server guarantees that for 60 minutes after the first
9695 // request. For example, consider a situation where you make an initial request
9696 // and the request times out. If you make the request again with the same
9697 // request ID, the server ignores the second request This prevents clients from
9698 // accidentally creating duplicate commitments. The request ID must be a valid
9699 // UUID with the exception that zero UUID is not supported
9700 // (00000000-0000-0000-0000-000000000000).
9701 func (c *ProjectsLocationsLbRouteExtensionsDeleteCall) RequestId(requestId string) *ProjectsLocationsLbRouteExtensionsDeleteCall {
9702 c.urlParams_.Set("requestId", requestId)
9703 return c
9704 }
9705
9706 // Fields allows partial responses to be retrieved. See
9707 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9708 // details.
9709 func (c *ProjectsLocationsLbRouteExtensionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbRouteExtensionsDeleteCall {
9710 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9711 return c
9712 }
9713
9714 // Context sets the context to be used in this call's Do method.
9715 func (c *ProjectsLocationsLbRouteExtensionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsLbRouteExtensionsDeleteCall {
9716 c.ctx_ = ctx
9717 return c
9718 }
9719
9720 // Header returns a http.Header that can be modified by the caller to add
9721 // headers to the request.
9722 func (c *ProjectsLocationsLbRouteExtensionsDeleteCall) Header() http.Header {
9723 if c.header_ == nil {
9724 c.header_ = make(http.Header)
9725 }
9726 return c.header_
9727 }
9728
9729 func (c *ProjectsLocationsLbRouteExtensionsDeleteCall) doRequest(alt string) (*http.Response, error) {
9730 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9731 c.urlParams_.Set("alt", alt)
9732 c.urlParams_.Set("prettyPrint", "false")
9733 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
9734 urls += "?" + c.urlParams_.Encode()
9735 req, err := http.NewRequest("DELETE", urls, nil)
9736 if err != nil {
9737 return nil, err
9738 }
9739 req.Header = reqHeaders
9740 googleapi.Expand(req.URL, map[string]string{
9741 "name": c.name,
9742 })
9743 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbRouteExtensions.delete", "request", internallog.HTTPRequest(req, nil))
9744 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9745 }
9746
9747 // Do executes the "networkservices.projects.locations.lbRouteExtensions.delete" call.
9748 // Any non-2xx status code is an error. Response headers are in either
9749 // *Operation.ServerResponse.Header or (if a response was returned at all) in
9750 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
9751 // whether the returned error was because http.StatusNotModified was returned.
9752 func (c *ProjectsLocationsLbRouteExtensionsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
9753 gensupport.SetOptions(c.urlParams_, opts...)
9754 res, err := c.doRequest("json")
9755 if res != nil && res.StatusCode == http.StatusNotModified {
9756 if res.Body != nil {
9757 res.Body.Close()
9758 }
9759 return nil, gensupport.WrapError(&googleapi.Error{
9760 Code: res.StatusCode,
9761 Header: res.Header,
9762 })
9763 }
9764 if err != nil {
9765 return nil, err
9766 }
9767 defer googleapi.CloseBody(res)
9768 if err := googleapi.CheckResponse(res); err != nil {
9769 return nil, gensupport.WrapError(err)
9770 }
9771 ret := &Operation{
9772 ServerResponse: googleapi.ServerResponse{
9773 Header: res.Header,
9774 HTTPStatusCode: res.StatusCode,
9775 },
9776 }
9777 target := &ret
9778 b, err := gensupport.DecodeResponseBytes(target, res)
9779 if err != nil {
9780 return nil, err
9781 }
9782 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbRouteExtensions.delete", "response", internallog.HTTPResponse(res, b))
9783 return ret, nil
9784 }
9785
9786 type ProjectsLocationsLbRouteExtensionsGetCall struct {
9787 s *Service
9788 name string
9789 urlParams_ gensupport.URLParams
9790 ifNoneMatch_ string
9791 ctx_ context.Context
9792 header_ http.Header
9793 }
9794
9795 // Get: Gets details of the specified `LbRouteExtension` resource.
9796 //
9797 // - name: A name of the `LbRouteExtension` resource to get. Must be in the
9798 // format
9799 // `projects/{project}/locations/{location}/lbRouteExtensions/{lb_route_extens
9800 // ion}`.
9801 func (r *ProjectsLocationsLbRouteExtensionsService) Get(name string) *ProjectsLocationsLbRouteExtensionsGetCall {
9802 c := &ProjectsLocationsLbRouteExtensionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9803 c.name = name
9804 return c
9805 }
9806
9807 // Fields allows partial responses to be retrieved. See
9808 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9809 // details.
9810 func (c *ProjectsLocationsLbRouteExtensionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbRouteExtensionsGetCall {
9811 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9812 return c
9813 }
9814
9815 // IfNoneMatch sets an optional parameter which makes the operation fail if the
9816 // object's ETag matches the given value. This is useful for getting updates
9817 // only after the object has changed since the last request.
9818 func (c *ProjectsLocationsLbRouteExtensionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsLbRouteExtensionsGetCall {
9819 c.ifNoneMatch_ = entityTag
9820 return c
9821 }
9822
9823 // Context sets the context to be used in this call's Do method.
9824 func (c *ProjectsLocationsLbRouteExtensionsGetCall) Context(ctx context.Context) *ProjectsLocationsLbRouteExtensionsGetCall {
9825 c.ctx_ = ctx
9826 return c
9827 }
9828
9829 // Header returns a http.Header that can be modified by the caller to add
9830 // headers to the request.
9831 func (c *ProjectsLocationsLbRouteExtensionsGetCall) Header() http.Header {
9832 if c.header_ == nil {
9833 c.header_ = make(http.Header)
9834 }
9835 return c.header_
9836 }
9837
9838 func (c *ProjectsLocationsLbRouteExtensionsGetCall) doRequest(alt string) (*http.Response, error) {
9839 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9840 if c.ifNoneMatch_ != "" {
9841 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9842 }
9843 c.urlParams_.Set("alt", alt)
9844 c.urlParams_.Set("prettyPrint", "false")
9845 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
9846 urls += "?" + c.urlParams_.Encode()
9847 req, err := http.NewRequest("GET", urls, nil)
9848 if err != nil {
9849 return nil, err
9850 }
9851 req.Header = reqHeaders
9852 googleapi.Expand(req.URL, map[string]string{
9853 "name": c.name,
9854 })
9855 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbRouteExtensions.get", "request", internallog.HTTPRequest(req, nil))
9856 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9857 }
9858
9859 // Do executes the "networkservices.projects.locations.lbRouteExtensions.get" call.
9860 // Any non-2xx status code is an error. Response headers are in either
9861 // *LbRouteExtension.ServerResponse.Header or (if a response was returned at
9862 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
9863 // check whether the returned error was because http.StatusNotModified was
9864 // returned.
9865 func (c *ProjectsLocationsLbRouteExtensionsGetCall) Do(opts ...googleapi.CallOption) (*LbRouteExtension, error) {
9866 gensupport.SetOptions(c.urlParams_, opts...)
9867 res, err := c.doRequest("json")
9868 if res != nil && res.StatusCode == http.StatusNotModified {
9869 if res.Body != nil {
9870 res.Body.Close()
9871 }
9872 return nil, gensupport.WrapError(&googleapi.Error{
9873 Code: res.StatusCode,
9874 Header: res.Header,
9875 })
9876 }
9877 if err != nil {
9878 return nil, err
9879 }
9880 defer googleapi.CloseBody(res)
9881 if err := googleapi.CheckResponse(res); err != nil {
9882 return nil, gensupport.WrapError(err)
9883 }
9884 ret := &LbRouteExtension{
9885 ServerResponse: googleapi.ServerResponse{
9886 Header: res.Header,
9887 HTTPStatusCode: res.StatusCode,
9888 },
9889 }
9890 target := &ret
9891 b, err := gensupport.DecodeResponseBytes(target, res)
9892 if err != nil {
9893 return nil, err
9894 }
9895 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbRouteExtensions.get", "response", internallog.HTTPResponse(res, b))
9896 return ret, nil
9897 }
9898
9899 type ProjectsLocationsLbRouteExtensionsListCall struct {
9900 s *Service
9901 parent string
9902 urlParams_ gensupport.URLParams
9903 ifNoneMatch_ string
9904 ctx_ context.Context
9905 header_ http.Header
9906 }
9907
9908 // List: Lists `LbRouteExtension` resources in a given project and location.
9909 //
9910 // - parent: The project and location from which the `LbRouteExtension`
9911 // resources are listed. These values are specified in the following format:
9912 // `projects/{project}/locations/{location}`.
9913 func (r *ProjectsLocationsLbRouteExtensionsService) List(parent string) *ProjectsLocationsLbRouteExtensionsListCall {
9914 c := &ProjectsLocationsLbRouteExtensionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9915 c.parent = parent
9916 return c
9917 }
9918
9919 // Filter sets the optional parameter "filter": Filtering results.
9920 func (c *ProjectsLocationsLbRouteExtensionsListCall) Filter(filter string) *ProjectsLocationsLbRouteExtensionsListCall {
9921 c.urlParams_.Set("filter", filter)
9922 return c
9923 }
9924
9925 // OrderBy sets the optional parameter "orderBy": Hint about how to order the
9926 // results.
9927 func (c *ProjectsLocationsLbRouteExtensionsListCall) OrderBy(orderBy string) *ProjectsLocationsLbRouteExtensionsListCall {
9928 c.urlParams_.Set("orderBy", orderBy)
9929 return c
9930 }
9931
9932 // PageSize sets the optional parameter "pageSize": Requested page size. The
9933 // server might return fewer items than requested. If unspecified, the server
9934 // picks an appropriate default.
9935 func (c *ProjectsLocationsLbRouteExtensionsListCall) PageSize(pageSize int64) *ProjectsLocationsLbRouteExtensionsListCall {
9936 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
9937 return c
9938 }
9939
9940 // PageToken sets the optional parameter "pageToken": A token identifying a
9941 // page of results that the server returns.
9942 func (c *ProjectsLocationsLbRouteExtensionsListCall) PageToken(pageToken string) *ProjectsLocationsLbRouteExtensionsListCall {
9943 c.urlParams_.Set("pageToken", pageToken)
9944 return c
9945 }
9946
9947 // Fields allows partial responses to be retrieved. See
9948 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9949 // details.
9950 func (c *ProjectsLocationsLbRouteExtensionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbRouteExtensionsListCall {
9951 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9952 return c
9953 }
9954
9955 // IfNoneMatch sets an optional parameter which makes the operation fail if the
9956 // object's ETag matches the given value. This is useful for getting updates
9957 // only after the object has changed since the last request.
9958 func (c *ProjectsLocationsLbRouteExtensionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsLbRouteExtensionsListCall {
9959 c.ifNoneMatch_ = entityTag
9960 return c
9961 }
9962
9963 // Context sets the context to be used in this call's Do method.
9964 func (c *ProjectsLocationsLbRouteExtensionsListCall) Context(ctx context.Context) *ProjectsLocationsLbRouteExtensionsListCall {
9965 c.ctx_ = ctx
9966 return c
9967 }
9968
9969 // Header returns a http.Header that can be modified by the caller to add
9970 // headers to the request.
9971 func (c *ProjectsLocationsLbRouteExtensionsListCall) Header() http.Header {
9972 if c.header_ == nil {
9973 c.header_ = make(http.Header)
9974 }
9975 return c.header_
9976 }
9977
9978 func (c *ProjectsLocationsLbRouteExtensionsListCall) doRequest(alt string) (*http.Response, error) {
9979 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9980 if c.ifNoneMatch_ != "" {
9981 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9982 }
9983 c.urlParams_.Set("alt", alt)
9984 c.urlParams_.Set("prettyPrint", "false")
9985 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/lbRouteExtensions")
9986 urls += "?" + c.urlParams_.Encode()
9987 req, err := http.NewRequest("GET", urls, nil)
9988 if err != nil {
9989 return nil, err
9990 }
9991 req.Header = reqHeaders
9992 googleapi.Expand(req.URL, map[string]string{
9993 "parent": c.parent,
9994 })
9995 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbRouteExtensions.list", "request", internallog.HTTPRequest(req, nil))
9996 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9997 }
9998
9999 // Do executes the "networkservices.projects.locations.lbRouteExtensions.list" call.
10000 // Any non-2xx status code is an error. Response headers are in either
10001 // *ListLbRouteExtensionsResponse.ServerResponse.Header or (if a response was
10002 // returned at all) in error.(*googleapi.Error).Header. Use
10003 // googleapi.IsNotModified to check whether the returned error was because
10004 // http.StatusNotModified was returned.
10005 func (c *ProjectsLocationsLbRouteExtensionsListCall) Do(opts ...googleapi.CallOption) (*ListLbRouteExtensionsResponse, error) {
10006 gensupport.SetOptions(c.urlParams_, opts...)
10007 res, err := c.doRequest("json")
10008 if res != nil && res.StatusCode == http.StatusNotModified {
10009 if res.Body != nil {
10010 res.Body.Close()
10011 }
10012 return nil, gensupport.WrapError(&googleapi.Error{
10013 Code: res.StatusCode,
10014 Header: res.Header,
10015 })
10016 }
10017 if err != nil {
10018 return nil, err
10019 }
10020 defer googleapi.CloseBody(res)
10021 if err := googleapi.CheckResponse(res); err != nil {
10022 return nil, gensupport.WrapError(err)
10023 }
10024 ret := &ListLbRouteExtensionsResponse{
10025 ServerResponse: googleapi.ServerResponse{
10026 Header: res.Header,
10027 HTTPStatusCode: res.StatusCode,
10028 },
10029 }
10030 target := &ret
10031 b, err := gensupport.DecodeResponseBytes(target, res)
10032 if err != nil {
10033 return nil, err
10034 }
10035 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbRouteExtensions.list", "response", internallog.HTTPResponse(res, b))
10036 return ret, nil
10037 }
10038
10039 // Pages invokes f for each page of results.
10040 // A non-nil error returned from f will halt the iteration.
10041 // The provided context supersedes any context provided to the Context method.
10042 func (c *ProjectsLocationsLbRouteExtensionsListCall) Pages(ctx context.Context, f func(*ListLbRouteExtensionsResponse) error) error {
10043 c.ctx_ = ctx
10044 defer c.PageToken(c.urlParams_.Get("pageToken"))
10045 for {
10046 x, err := c.Do()
10047 if err != nil {
10048 return err
10049 }
10050 if err := f(x); err != nil {
10051 return err
10052 }
10053 if x.NextPageToken == "" {
10054 return nil
10055 }
10056 c.PageToken(x.NextPageToken)
10057 }
10058 }
10059
10060 type ProjectsLocationsLbRouteExtensionsPatchCall struct {
10061 s *Service
10062 name string
10063 lbrouteextension *LbRouteExtension
10064 urlParams_ gensupport.URLParams
10065 ctx_ context.Context
10066 header_ http.Header
10067 }
10068
10069 // Patch: Updates the parameters of the specified `LbRouteExtension` resource.
10070 //
10071 // - name: Identifier. Name of the `LbRouteExtension` resource in the following
10072 // format:
10073 // `projects/{project}/locations/{location}/lbRouteExtensions/{lb_route_extens
10074 // ion}`.
10075 func (r *ProjectsLocationsLbRouteExtensionsService) Patch(name string, lbrouteextension *LbRouteExtension) *ProjectsLocationsLbRouteExtensionsPatchCall {
10076 c := &ProjectsLocationsLbRouteExtensionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10077 c.name = name
10078 c.lbrouteextension = lbrouteextension
10079 return c
10080 }
10081
10082 // RequestId sets the optional parameter "requestId": An optional request ID to
10083 // identify requests. Specify a unique request ID so that if you must retry
10084 // your request, the server can ignore the request if it has already been
10085 // completed. The server guarantees that for 60 minutes since the first
10086 // request. For example, consider a situation where you make an initial request
10087 // and the request times out. If you make the request again with the same
10088 // request ID, the server ignores the second request This prevents clients from
10089 // accidentally creating duplicate commitments. The request ID must be a valid
10090 // UUID with the exception that zero UUID is not supported
10091 // (00000000-0000-0000-0000-000000000000).
10092 func (c *ProjectsLocationsLbRouteExtensionsPatchCall) RequestId(requestId string) *ProjectsLocationsLbRouteExtensionsPatchCall {
10093 c.urlParams_.Set("requestId", requestId)
10094 return c
10095 }
10096
10097 // UpdateMask sets the optional parameter "updateMask": Used to specify the
10098 // fields to be overwritten in the `LbRouteExtension` resource by the update.
10099 // The fields specified in the `update_mask` are relative to the resource, not
10100 // the full request. A field is overwritten if it is in the mask. If the user
10101 // does not specify a mask, then all fields are overwritten.
10102 func (c *ProjectsLocationsLbRouteExtensionsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsLbRouteExtensionsPatchCall {
10103 c.urlParams_.Set("updateMask", updateMask)
10104 return c
10105 }
10106
10107 // Fields allows partial responses to be retrieved. See
10108 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10109 // details.
10110 func (c *ProjectsLocationsLbRouteExtensionsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbRouteExtensionsPatchCall {
10111 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10112 return c
10113 }
10114
10115 // Context sets the context to be used in this call's Do method.
10116 func (c *ProjectsLocationsLbRouteExtensionsPatchCall) Context(ctx context.Context) *ProjectsLocationsLbRouteExtensionsPatchCall {
10117 c.ctx_ = ctx
10118 return c
10119 }
10120
10121 // Header returns a http.Header that can be modified by the caller to add
10122 // headers to the request.
10123 func (c *ProjectsLocationsLbRouteExtensionsPatchCall) Header() http.Header {
10124 if c.header_ == nil {
10125 c.header_ = make(http.Header)
10126 }
10127 return c.header_
10128 }
10129
10130 func (c *ProjectsLocationsLbRouteExtensionsPatchCall) doRequest(alt string) (*http.Response, error) {
10131 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
10132 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lbrouteextension)
10133 if err != nil {
10134 return nil, err
10135 }
10136 c.urlParams_.Set("alt", alt)
10137 c.urlParams_.Set("prettyPrint", "false")
10138 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
10139 urls += "?" + c.urlParams_.Encode()
10140 req, err := http.NewRequest("PATCH", urls, body)
10141 if err != nil {
10142 return nil, err
10143 }
10144 req.Header = reqHeaders
10145 googleapi.Expand(req.URL, map[string]string{
10146 "name": c.name,
10147 })
10148 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbRouteExtensions.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
10149 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10150 }
10151
10152 // Do executes the "networkservices.projects.locations.lbRouteExtensions.patch" call.
10153 // Any non-2xx status code is an error. Response headers are in either
10154 // *Operation.ServerResponse.Header or (if a response was returned at all) in
10155 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
10156 // whether the returned error was because http.StatusNotModified was returned.
10157 func (c *ProjectsLocationsLbRouteExtensionsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
10158 gensupport.SetOptions(c.urlParams_, opts...)
10159 res, err := c.doRequest("json")
10160 if res != nil && res.StatusCode == http.StatusNotModified {
10161 if res.Body != nil {
10162 res.Body.Close()
10163 }
10164 return nil, gensupport.WrapError(&googleapi.Error{
10165 Code: res.StatusCode,
10166 Header: res.Header,
10167 })
10168 }
10169 if err != nil {
10170 return nil, err
10171 }
10172 defer googleapi.CloseBody(res)
10173 if err := googleapi.CheckResponse(res); err != nil {
10174 return nil, gensupport.WrapError(err)
10175 }
10176 ret := &Operation{
10177 ServerResponse: googleapi.ServerResponse{
10178 Header: res.Header,
10179 HTTPStatusCode: res.StatusCode,
10180 },
10181 }
10182 target := &ret
10183 b, err := gensupport.DecodeResponseBytes(target, res)
10184 if err != nil {
10185 return nil, err
10186 }
10187 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbRouteExtensions.patch", "response", internallog.HTTPResponse(res, b))
10188 return ret, nil
10189 }
10190
10191 type ProjectsLocationsLbTcpExtensionsCreateCall struct {
10192 s *Service
10193 parent string
10194 lbtcpextension *LbTcpExtension
10195 urlParams_ gensupport.URLParams
10196 ctx_ context.Context
10197 header_ http.Header
10198 }
10199
10200 // Create: Creates a new `LbTcpExtension` resource in a given project and
10201 // location.
10202 //
10203 // - parent: The parent resource of the `LbTcpExtension` resource. Must be in
10204 // the format `projects/{project}/locations/{location}`.
10205 func (r *ProjectsLocationsLbTcpExtensionsService) Create(parent string, lbtcpextension *LbTcpExtension) *ProjectsLocationsLbTcpExtensionsCreateCall {
10206 c := &ProjectsLocationsLbTcpExtensionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10207 c.parent = parent
10208 c.lbtcpextension = lbtcpextension
10209 return c
10210 }
10211
10212 // LbTcpExtensionId sets the optional parameter "lbTcpExtensionId": Required.
10213 // User-provided ID of the `LbTcpExtension` resource to be created.
10214 func (c *ProjectsLocationsLbTcpExtensionsCreateCall) LbTcpExtensionId(lbTcpExtensionId string) *ProjectsLocationsLbTcpExtensionsCreateCall {
10215 c.urlParams_.Set("lbTcpExtensionId", lbTcpExtensionId)
10216 return c
10217 }
10218
10219 // RequestId sets the optional parameter "requestId": An optional request ID to
10220 // identify requests. Specify a unique request ID so that if you must retry
10221 // your request, the server can ignore the request if it has already been
10222 // completed. The server guarantees that for at least 60 minutes since the
10223 // first request. For example, consider a situation where you make an initial
10224 // request and the request times out. If you make the request again with the
10225 // same request ID, the server can check if original operation with the same
10226 // request ID was received, and if so, ignores the second request. This
10227 // prevents clients from accidentally creating duplicate commitments. The
10228 // request ID must be a valid UUID with the exception that zero UUID is not
10229 // supported (00000000-0000-0000-0000-000000000000).
10230 func (c *ProjectsLocationsLbTcpExtensionsCreateCall) RequestId(requestId string) *ProjectsLocationsLbTcpExtensionsCreateCall {
10231 c.urlParams_.Set("requestId", requestId)
10232 return c
10233 }
10234
10235 // Fields allows partial responses to be retrieved. See
10236 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10237 // details.
10238 func (c *ProjectsLocationsLbTcpExtensionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbTcpExtensionsCreateCall {
10239 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10240 return c
10241 }
10242
10243 // Context sets the context to be used in this call's Do method.
10244 func (c *ProjectsLocationsLbTcpExtensionsCreateCall) Context(ctx context.Context) *ProjectsLocationsLbTcpExtensionsCreateCall {
10245 c.ctx_ = ctx
10246 return c
10247 }
10248
10249 // Header returns a http.Header that can be modified by the caller to add
10250 // headers to the request.
10251 func (c *ProjectsLocationsLbTcpExtensionsCreateCall) Header() http.Header {
10252 if c.header_ == nil {
10253 c.header_ = make(http.Header)
10254 }
10255 return c.header_
10256 }
10257
10258 func (c *ProjectsLocationsLbTcpExtensionsCreateCall) doRequest(alt string) (*http.Response, error) {
10259 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
10260 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lbtcpextension)
10261 if err != nil {
10262 return nil, err
10263 }
10264 c.urlParams_.Set("alt", alt)
10265 c.urlParams_.Set("prettyPrint", "false")
10266 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/lbTcpExtensions")
10267 urls += "?" + c.urlParams_.Encode()
10268 req, err := http.NewRequest("POST", urls, body)
10269 if err != nil {
10270 return nil, err
10271 }
10272 req.Header = reqHeaders
10273 googleapi.Expand(req.URL, map[string]string{
10274 "parent": c.parent,
10275 })
10276 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTcpExtensions.create", "request", internallog.HTTPRequest(req, body.Bytes()))
10277 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10278 }
10279
10280 // Do executes the "networkservices.projects.locations.lbTcpExtensions.create" call.
10281 // Any non-2xx status code is an error. Response headers are in either
10282 // *Operation.ServerResponse.Header or (if a response was returned at all) in
10283 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
10284 // whether the returned error was because http.StatusNotModified was returned.
10285 func (c *ProjectsLocationsLbTcpExtensionsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
10286 gensupport.SetOptions(c.urlParams_, opts...)
10287 res, err := c.doRequest("json")
10288 if res != nil && res.StatusCode == http.StatusNotModified {
10289 if res.Body != nil {
10290 res.Body.Close()
10291 }
10292 return nil, gensupport.WrapError(&googleapi.Error{
10293 Code: res.StatusCode,
10294 Header: res.Header,
10295 })
10296 }
10297 if err != nil {
10298 return nil, err
10299 }
10300 defer googleapi.CloseBody(res)
10301 if err := googleapi.CheckResponse(res); err != nil {
10302 return nil, gensupport.WrapError(err)
10303 }
10304 ret := &Operation{
10305 ServerResponse: googleapi.ServerResponse{
10306 Header: res.Header,
10307 HTTPStatusCode: res.StatusCode,
10308 },
10309 }
10310 target := &ret
10311 b, err := gensupport.DecodeResponseBytes(target, res)
10312 if err != nil {
10313 return nil, err
10314 }
10315 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTcpExtensions.create", "response", internallog.HTTPResponse(res, b))
10316 return ret, nil
10317 }
10318
10319 type ProjectsLocationsLbTcpExtensionsDeleteCall struct {
10320 s *Service
10321 name string
10322 urlParams_ gensupport.URLParams
10323 ctx_ context.Context
10324 header_ http.Header
10325 }
10326
10327 // Delete: Deletes the specified `LbTcpExtension` resource.
10328 //
10329 // - name: The name of the `LbTcpExtension` resource to delete. Must be in the
10330 // format
10331 // `projects/{project}/locations/{location}/LbTcpExtensions/{lb_tcp_extension}
10332 // `.
10333 func (r *ProjectsLocationsLbTcpExtensionsService) Delete(name string) *ProjectsLocationsLbTcpExtensionsDeleteCall {
10334 c := &ProjectsLocationsLbTcpExtensionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10335 c.name = name
10336 return c
10337 }
10338
10339 // RequestId sets the optional parameter "requestId": An optional request ID to
10340 // identify requests. Specify a unique request ID so that if you must retry
10341 // your request, the server can ignore the request if it has already been
10342 // completed. The server guarantees that for at least 60 minutes after the
10343 // first request. For example, consider a situation where you make an initial
10344 // request and the request times out. If you make the request again with the
10345 // same request ID, the server can check if original operation with the same
10346 // request ID was received, and if so, ignores the second request. This
10347 // prevents clients from accidentally creating duplicate commitments. The
10348 // request ID must be a valid UUID with the exception that zero UUID is not
10349 // supported (00000000-0000-0000-0000-000000000000).
10350 func (c *ProjectsLocationsLbTcpExtensionsDeleteCall) RequestId(requestId string) *ProjectsLocationsLbTcpExtensionsDeleteCall {
10351 c.urlParams_.Set("requestId", requestId)
10352 return c
10353 }
10354
10355 // Fields allows partial responses to be retrieved. See
10356 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10357 // details.
10358 func (c *ProjectsLocationsLbTcpExtensionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbTcpExtensionsDeleteCall {
10359 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10360 return c
10361 }
10362
10363 // Context sets the context to be used in this call's Do method.
10364 func (c *ProjectsLocationsLbTcpExtensionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsLbTcpExtensionsDeleteCall {
10365 c.ctx_ = ctx
10366 return c
10367 }
10368
10369 // Header returns a http.Header that can be modified by the caller to add
10370 // headers to the request.
10371 func (c *ProjectsLocationsLbTcpExtensionsDeleteCall) Header() http.Header {
10372 if c.header_ == nil {
10373 c.header_ = make(http.Header)
10374 }
10375 return c.header_
10376 }
10377
10378 func (c *ProjectsLocationsLbTcpExtensionsDeleteCall) doRequest(alt string) (*http.Response, error) {
10379 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
10380 c.urlParams_.Set("alt", alt)
10381 c.urlParams_.Set("prettyPrint", "false")
10382 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
10383 urls += "?" + c.urlParams_.Encode()
10384 req, err := http.NewRequest("DELETE", urls, nil)
10385 if err != nil {
10386 return nil, err
10387 }
10388 req.Header = reqHeaders
10389 googleapi.Expand(req.URL, map[string]string{
10390 "name": c.name,
10391 })
10392 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTcpExtensions.delete", "request", internallog.HTTPRequest(req, nil))
10393 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10394 }
10395
10396 // Do executes the "networkservices.projects.locations.lbTcpExtensions.delete" call.
10397 // Any non-2xx status code is an error. Response headers are in either
10398 // *Operation.ServerResponse.Header or (if a response was returned at all) in
10399 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
10400 // whether the returned error was because http.StatusNotModified was returned.
10401 func (c *ProjectsLocationsLbTcpExtensionsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
10402 gensupport.SetOptions(c.urlParams_, opts...)
10403 res, err := c.doRequest("json")
10404 if res != nil && res.StatusCode == http.StatusNotModified {
10405 if res.Body != nil {
10406 res.Body.Close()
10407 }
10408 return nil, gensupport.WrapError(&googleapi.Error{
10409 Code: res.StatusCode,
10410 Header: res.Header,
10411 })
10412 }
10413 if err != nil {
10414 return nil, err
10415 }
10416 defer googleapi.CloseBody(res)
10417 if err := googleapi.CheckResponse(res); err != nil {
10418 return nil, gensupport.WrapError(err)
10419 }
10420 ret := &Operation{
10421 ServerResponse: googleapi.ServerResponse{
10422 Header: res.Header,
10423 HTTPStatusCode: res.StatusCode,
10424 },
10425 }
10426 target := &ret
10427 b, err := gensupport.DecodeResponseBytes(target, res)
10428 if err != nil {
10429 return nil, err
10430 }
10431 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTcpExtensions.delete", "response", internallog.HTTPResponse(res, b))
10432 return ret, nil
10433 }
10434
10435 type ProjectsLocationsLbTcpExtensionsGetCall struct {
10436 s *Service
10437 name string
10438 urlParams_ gensupport.URLParams
10439 ifNoneMatch_ string
10440 ctx_ context.Context
10441 header_ http.Header
10442 }
10443
10444 // Get: Gets details of the specified `LbTcpExtension` resource.
10445 //
10446 // - name: A name of the `LbTcpExtension` resource to get. Must be in the
10447 // format
10448 // `projects/{project}/locations/{location}/LbTcpExtensions/{lb_tcp_extension}
10449 // `.
10450 func (r *ProjectsLocationsLbTcpExtensionsService) Get(name string) *ProjectsLocationsLbTcpExtensionsGetCall {
10451 c := &ProjectsLocationsLbTcpExtensionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10452 c.name = name
10453 return c
10454 }
10455
10456 // Fields allows partial responses to be retrieved. See
10457 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10458 // details.
10459 func (c *ProjectsLocationsLbTcpExtensionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbTcpExtensionsGetCall {
10460 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10461 return c
10462 }
10463
10464 // IfNoneMatch sets an optional parameter which makes the operation fail if the
10465 // object's ETag matches the given value. This is useful for getting updates
10466 // only after the object has changed since the last request.
10467 func (c *ProjectsLocationsLbTcpExtensionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsLbTcpExtensionsGetCall {
10468 c.ifNoneMatch_ = entityTag
10469 return c
10470 }
10471
10472 // Context sets the context to be used in this call's Do method.
10473 func (c *ProjectsLocationsLbTcpExtensionsGetCall) Context(ctx context.Context) *ProjectsLocationsLbTcpExtensionsGetCall {
10474 c.ctx_ = ctx
10475 return c
10476 }
10477
10478 // Header returns a http.Header that can be modified by the caller to add
10479 // headers to the request.
10480 func (c *ProjectsLocationsLbTcpExtensionsGetCall) Header() http.Header {
10481 if c.header_ == nil {
10482 c.header_ = make(http.Header)
10483 }
10484 return c.header_
10485 }
10486
10487 func (c *ProjectsLocationsLbTcpExtensionsGetCall) doRequest(alt string) (*http.Response, error) {
10488 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
10489 if c.ifNoneMatch_ != "" {
10490 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10491 }
10492 c.urlParams_.Set("alt", alt)
10493 c.urlParams_.Set("prettyPrint", "false")
10494 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
10495 urls += "?" + c.urlParams_.Encode()
10496 req, err := http.NewRequest("GET", urls, nil)
10497 if err != nil {
10498 return nil, err
10499 }
10500 req.Header = reqHeaders
10501 googleapi.Expand(req.URL, map[string]string{
10502 "name": c.name,
10503 })
10504 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTcpExtensions.get", "request", internallog.HTTPRequest(req, nil))
10505 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10506 }
10507
10508 // Do executes the "networkservices.projects.locations.lbTcpExtensions.get" call.
10509 // Any non-2xx status code is an error. Response headers are in either
10510 // *LbTcpExtension.ServerResponse.Header or (if a response was returned at all)
10511 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
10512 // whether the returned error was because http.StatusNotModified was returned.
10513 func (c *ProjectsLocationsLbTcpExtensionsGetCall) Do(opts ...googleapi.CallOption) (*LbTcpExtension, error) {
10514 gensupport.SetOptions(c.urlParams_, opts...)
10515 res, err := c.doRequest("json")
10516 if res != nil && res.StatusCode == http.StatusNotModified {
10517 if res.Body != nil {
10518 res.Body.Close()
10519 }
10520 return nil, gensupport.WrapError(&googleapi.Error{
10521 Code: res.StatusCode,
10522 Header: res.Header,
10523 })
10524 }
10525 if err != nil {
10526 return nil, err
10527 }
10528 defer googleapi.CloseBody(res)
10529 if err := googleapi.CheckResponse(res); err != nil {
10530 return nil, gensupport.WrapError(err)
10531 }
10532 ret := &LbTcpExtension{
10533 ServerResponse: googleapi.ServerResponse{
10534 Header: res.Header,
10535 HTTPStatusCode: res.StatusCode,
10536 },
10537 }
10538 target := &ret
10539 b, err := gensupport.DecodeResponseBytes(target, res)
10540 if err != nil {
10541 return nil, err
10542 }
10543 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTcpExtensions.get", "response", internallog.HTTPResponse(res, b))
10544 return ret, nil
10545 }
10546
10547 type ProjectsLocationsLbTcpExtensionsListCall struct {
10548 s *Service
10549 parent string
10550 urlParams_ gensupport.URLParams
10551 ifNoneMatch_ string
10552 ctx_ context.Context
10553 header_ http.Header
10554 }
10555
10556 // List: Lists `LbTcpExtension` resources in a given project and location.
10557 //
10558 // - parent: The project and location from which the `LbTcpExtension` resources
10559 // are listed, specified in the following format:
10560 // `projects/{project}/locations/{location}`.
10561 func (r *ProjectsLocationsLbTcpExtensionsService) List(parent string) *ProjectsLocationsLbTcpExtensionsListCall {
10562 c := &ProjectsLocationsLbTcpExtensionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10563 c.parent = parent
10564 return c
10565 }
10566
10567 // Filter sets the optional parameter "filter": Filtering results.
10568 func (c *ProjectsLocationsLbTcpExtensionsListCall) Filter(filter string) *ProjectsLocationsLbTcpExtensionsListCall {
10569 c.urlParams_.Set("filter", filter)
10570 return c
10571 }
10572
10573 // OrderBy sets the optional parameter "orderBy": Hint for how to order the
10574 // results.
10575 func (c *ProjectsLocationsLbTcpExtensionsListCall) OrderBy(orderBy string) *ProjectsLocationsLbTcpExtensionsListCall {
10576 c.urlParams_.Set("orderBy", orderBy)
10577 return c
10578 }
10579
10580 // PageSize sets the optional parameter "pageSize": Requested page size. The
10581 // server might return fewer items than requested. If unspecified, the server
10582 // picks an appropriate default.
10583 func (c *ProjectsLocationsLbTcpExtensionsListCall) PageSize(pageSize int64) *ProjectsLocationsLbTcpExtensionsListCall {
10584 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
10585 return c
10586 }
10587
10588 // PageToken sets the optional parameter "pageToken": A token identifying a
10589 // page of results that the server returns.
10590 func (c *ProjectsLocationsLbTcpExtensionsListCall) PageToken(pageToken string) *ProjectsLocationsLbTcpExtensionsListCall {
10591 c.urlParams_.Set("pageToken", pageToken)
10592 return c
10593 }
10594
10595 // Fields allows partial responses to be retrieved. See
10596 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10597 // details.
10598 func (c *ProjectsLocationsLbTcpExtensionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbTcpExtensionsListCall {
10599 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10600 return c
10601 }
10602
10603 // IfNoneMatch sets an optional parameter which makes the operation fail if the
10604 // object's ETag matches the given value. This is useful for getting updates
10605 // only after the object has changed since the last request.
10606 func (c *ProjectsLocationsLbTcpExtensionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsLbTcpExtensionsListCall {
10607 c.ifNoneMatch_ = entityTag
10608 return c
10609 }
10610
10611 // Context sets the context to be used in this call's Do method.
10612 func (c *ProjectsLocationsLbTcpExtensionsListCall) Context(ctx context.Context) *ProjectsLocationsLbTcpExtensionsListCall {
10613 c.ctx_ = ctx
10614 return c
10615 }
10616
10617 // Header returns a http.Header that can be modified by the caller to add
10618 // headers to the request.
10619 func (c *ProjectsLocationsLbTcpExtensionsListCall) Header() http.Header {
10620 if c.header_ == nil {
10621 c.header_ = make(http.Header)
10622 }
10623 return c.header_
10624 }
10625
10626 func (c *ProjectsLocationsLbTcpExtensionsListCall) doRequest(alt string) (*http.Response, error) {
10627 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
10628 if c.ifNoneMatch_ != "" {
10629 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10630 }
10631 c.urlParams_.Set("alt", alt)
10632 c.urlParams_.Set("prettyPrint", "false")
10633 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/lbTcpExtensions")
10634 urls += "?" + c.urlParams_.Encode()
10635 req, err := http.NewRequest("GET", urls, nil)
10636 if err != nil {
10637 return nil, err
10638 }
10639 req.Header = reqHeaders
10640 googleapi.Expand(req.URL, map[string]string{
10641 "parent": c.parent,
10642 })
10643 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTcpExtensions.list", "request", internallog.HTTPRequest(req, nil))
10644 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10645 }
10646
10647 // Do executes the "networkservices.projects.locations.lbTcpExtensions.list" call.
10648 // Any non-2xx status code is an error. Response headers are in either
10649 // *ListLbTcpExtensionsResponse.ServerResponse.Header or (if a response was
10650 // returned at all) in error.(*googleapi.Error).Header. Use
10651 // googleapi.IsNotModified to check whether the returned error was because
10652 // http.StatusNotModified was returned.
10653 func (c *ProjectsLocationsLbTcpExtensionsListCall) Do(opts ...googleapi.CallOption) (*ListLbTcpExtensionsResponse, error) {
10654 gensupport.SetOptions(c.urlParams_, opts...)
10655 res, err := c.doRequest("json")
10656 if res != nil && res.StatusCode == http.StatusNotModified {
10657 if res.Body != nil {
10658 res.Body.Close()
10659 }
10660 return nil, gensupport.WrapError(&googleapi.Error{
10661 Code: res.StatusCode,
10662 Header: res.Header,
10663 })
10664 }
10665 if err != nil {
10666 return nil, err
10667 }
10668 defer googleapi.CloseBody(res)
10669 if err := googleapi.CheckResponse(res); err != nil {
10670 return nil, gensupport.WrapError(err)
10671 }
10672 ret := &ListLbTcpExtensionsResponse{
10673 ServerResponse: googleapi.ServerResponse{
10674 Header: res.Header,
10675 HTTPStatusCode: res.StatusCode,
10676 },
10677 }
10678 target := &ret
10679 b, err := gensupport.DecodeResponseBytes(target, res)
10680 if err != nil {
10681 return nil, err
10682 }
10683 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTcpExtensions.list", "response", internallog.HTTPResponse(res, b))
10684 return ret, nil
10685 }
10686
10687 // Pages invokes f for each page of results.
10688 // A non-nil error returned from f will halt the iteration.
10689 // The provided context supersedes any context provided to the Context method.
10690 func (c *ProjectsLocationsLbTcpExtensionsListCall) Pages(ctx context.Context, f func(*ListLbTcpExtensionsResponse) error) error {
10691 c.ctx_ = ctx
10692 defer c.PageToken(c.urlParams_.Get("pageToken"))
10693 for {
10694 x, err := c.Do()
10695 if err != nil {
10696 return err
10697 }
10698 if err := f(x); err != nil {
10699 return err
10700 }
10701 if x.NextPageToken == "" {
10702 return nil
10703 }
10704 c.PageToken(x.NextPageToken)
10705 }
10706 }
10707
10708 type ProjectsLocationsLbTcpExtensionsPatchCall struct {
10709 s *Service
10710 name string
10711 lbtcpextension *LbTcpExtension
10712 urlParams_ gensupport.URLParams
10713 ctx_ context.Context
10714 header_ http.Header
10715 }
10716
10717 // Patch: Updates the parameters of the specified `LbTcpExtension` resource.
10718 //
10719 // - name: Identifier. Name of the `LbTcpExtension` resource in the following
10720 // format:
10721 // `projects/{project}/locations/{location}/LbTcpExtension/{lb_tcp_extension}`.
10722 func (r *ProjectsLocationsLbTcpExtensionsService) Patch(name string, lbtcpextension *LbTcpExtension) *ProjectsLocationsLbTcpExtensionsPatchCall {
10723 c := &ProjectsLocationsLbTcpExtensionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10724 c.name = name
10725 c.lbtcpextension = lbtcpextension
10726 return c
10727 }
10728
10729 // RequestId sets the optional parameter "requestId": An optional request ID to
10730 // identify requests. Specify a unique request ID so that if you must retry
10731 // your request, the server can ignore the request if it has already been
10732 // completed. The server guarantees that for at least 60 minutes since the
10733 // first request. For example, consider a situation where you make an initial
10734 // request and the request times out. If you make the request again with the
10735 // same request ID, the server can check if original operation with the same
10736 // request ID was received, and if so, ignores the second request. This
10737 // prevents clients from accidentally creating duplicate commitments. The
10738 // request ID must be a valid UUID with the exception that zero UUID is not
10739 // supported (00000000-0000-0000-0000-000000000000).
10740 func (c *ProjectsLocationsLbTcpExtensionsPatchCall) RequestId(requestId string) *ProjectsLocationsLbTcpExtensionsPatchCall {
10741 c.urlParams_.Set("requestId", requestId)
10742 return c
10743 }
10744
10745 // UpdateMask sets the optional parameter "updateMask": Used to specify the
10746 // fields to be overwritten in the `LbTcpExtension` resource by the update. The
10747 // fields specified in the update_mask are relative to the resource, not the
10748 // full request. A field is overwritten if it is in the mask. If the user does
10749 // not specify a mask, then all fields are overwritten.
10750 func (c *ProjectsLocationsLbTcpExtensionsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsLbTcpExtensionsPatchCall {
10751 c.urlParams_.Set("updateMask", updateMask)
10752 return c
10753 }
10754
10755 // Fields allows partial responses to be retrieved. See
10756 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10757 // details.
10758 func (c *ProjectsLocationsLbTcpExtensionsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbTcpExtensionsPatchCall {
10759 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10760 return c
10761 }
10762
10763 // Context sets the context to be used in this call's Do method.
10764 func (c *ProjectsLocationsLbTcpExtensionsPatchCall) Context(ctx context.Context) *ProjectsLocationsLbTcpExtensionsPatchCall {
10765 c.ctx_ = ctx
10766 return c
10767 }
10768
10769 // Header returns a http.Header that can be modified by the caller to add
10770 // headers to the request.
10771 func (c *ProjectsLocationsLbTcpExtensionsPatchCall) Header() http.Header {
10772 if c.header_ == nil {
10773 c.header_ = make(http.Header)
10774 }
10775 return c.header_
10776 }
10777
10778 func (c *ProjectsLocationsLbTcpExtensionsPatchCall) doRequest(alt string) (*http.Response, error) {
10779 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
10780 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lbtcpextension)
10781 if err != nil {
10782 return nil, err
10783 }
10784 c.urlParams_.Set("alt", alt)
10785 c.urlParams_.Set("prettyPrint", "false")
10786 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
10787 urls += "?" + c.urlParams_.Encode()
10788 req, err := http.NewRequest("PATCH", urls, body)
10789 if err != nil {
10790 return nil, err
10791 }
10792 req.Header = reqHeaders
10793 googleapi.Expand(req.URL, map[string]string{
10794 "name": c.name,
10795 })
10796 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTcpExtensions.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
10797 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10798 }
10799
10800 // Do executes the "networkservices.projects.locations.lbTcpExtensions.patch" call.
10801 // Any non-2xx status code is an error. Response headers are in either
10802 // *Operation.ServerResponse.Header or (if a response was returned at all) in
10803 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
10804 // whether the returned error was because http.StatusNotModified was returned.
10805 func (c *ProjectsLocationsLbTcpExtensionsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
10806 gensupport.SetOptions(c.urlParams_, opts...)
10807 res, err := c.doRequest("json")
10808 if res != nil && res.StatusCode == http.StatusNotModified {
10809 if res.Body != nil {
10810 res.Body.Close()
10811 }
10812 return nil, gensupport.WrapError(&googleapi.Error{
10813 Code: res.StatusCode,
10814 Header: res.Header,
10815 })
10816 }
10817 if err != nil {
10818 return nil, err
10819 }
10820 defer googleapi.CloseBody(res)
10821 if err := googleapi.CheckResponse(res); err != nil {
10822 return nil, gensupport.WrapError(err)
10823 }
10824 ret := &Operation{
10825 ServerResponse: googleapi.ServerResponse{
10826 Header: res.Header,
10827 HTTPStatusCode: res.StatusCode,
10828 },
10829 }
10830 target := &ret
10831 b, err := gensupport.DecodeResponseBytes(target, res)
10832 if err != nil {
10833 return nil, err
10834 }
10835 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTcpExtensions.patch", "response", internallog.HTTPResponse(res, b))
10836 return ret, nil
10837 }
10838
10839 type ProjectsLocationsLbTrafficExtensionsCreateCall struct {
10840 s *Service
10841 parent string
10842 lbtrafficextension *LbTrafficExtension
10843 urlParams_ gensupport.URLParams
10844 ctx_ context.Context
10845 header_ http.Header
10846 }
10847
10848 // Create: Creates a new `LbTrafficExtension` resource in a given project and
10849 // location.
10850 //
10851 // - parent: The parent resource of the `LbTrafficExtension` resource. Must be
10852 // in the format `projects/{project}/locations/{location}`.
10853 func (r *ProjectsLocationsLbTrafficExtensionsService) Create(parent string, lbtrafficextension *LbTrafficExtension) *ProjectsLocationsLbTrafficExtensionsCreateCall {
10854 c := &ProjectsLocationsLbTrafficExtensionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10855 c.parent = parent
10856 c.lbtrafficextension = lbtrafficextension
10857 return c
10858 }
10859
10860 // LbTrafficExtensionId sets the optional parameter "lbTrafficExtensionId":
10861 // Required. User-provided ID of the `LbTrafficExtension` resource to be
10862 // created.
10863 func (c *ProjectsLocationsLbTrafficExtensionsCreateCall) LbTrafficExtensionId(lbTrafficExtensionId string) *ProjectsLocationsLbTrafficExtensionsCreateCall {
10864 c.urlParams_.Set("lbTrafficExtensionId", lbTrafficExtensionId)
10865 return c
10866 }
10867
10868 // RequestId sets the optional parameter "requestId": An optional request ID to
10869 // identify requests. Specify a unique request ID so that if you must retry
10870 // your request, the server can ignore the request if it has already been
10871 // completed. The server guarantees that for 60 minutes since the first
10872 // request. For example, consider a situation where you make an initial request
10873 // and the request times out. If you make the request again with the same
10874 // request ID, the server ignores the second request This prevents clients from
10875 // accidentally creating duplicate commitments. The request ID must be a valid
10876 // UUID with the exception that zero UUID is not supported
10877 // (00000000-0000-0000-0000-000000000000).
10878 func (c *ProjectsLocationsLbTrafficExtensionsCreateCall) RequestId(requestId string) *ProjectsLocationsLbTrafficExtensionsCreateCall {
10879 c.urlParams_.Set("requestId", requestId)
10880 return c
10881 }
10882
10883 // Fields allows partial responses to be retrieved. See
10884 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10885 // details.
10886 func (c *ProjectsLocationsLbTrafficExtensionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbTrafficExtensionsCreateCall {
10887 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10888 return c
10889 }
10890
10891 // Context sets the context to be used in this call's Do method.
10892 func (c *ProjectsLocationsLbTrafficExtensionsCreateCall) Context(ctx context.Context) *ProjectsLocationsLbTrafficExtensionsCreateCall {
10893 c.ctx_ = ctx
10894 return c
10895 }
10896
10897 // Header returns a http.Header that can be modified by the caller to add
10898 // headers to the request.
10899 func (c *ProjectsLocationsLbTrafficExtensionsCreateCall) Header() http.Header {
10900 if c.header_ == nil {
10901 c.header_ = make(http.Header)
10902 }
10903 return c.header_
10904 }
10905
10906 func (c *ProjectsLocationsLbTrafficExtensionsCreateCall) doRequest(alt string) (*http.Response, error) {
10907 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
10908 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lbtrafficextension)
10909 if err != nil {
10910 return nil, err
10911 }
10912 c.urlParams_.Set("alt", alt)
10913 c.urlParams_.Set("prettyPrint", "false")
10914 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/lbTrafficExtensions")
10915 urls += "?" + c.urlParams_.Encode()
10916 req, err := http.NewRequest("POST", urls, body)
10917 if err != nil {
10918 return nil, err
10919 }
10920 req.Header = reqHeaders
10921 googleapi.Expand(req.URL, map[string]string{
10922 "parent": c.parent,
10923 })
10924 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTrafficExtensions.create", "request", internallog.HTTPRequest(req, body.Bytes()))
10925 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10926 }
10927
10928 // Do executes the "networkservices.projects.locations.lbTrafficExtensions.create" call.
10929 // Any non-2xx status code is an error. Response headers are in either
10930 // *Operation.ServerResponse.Header or (if a response was returned at all) in
10931 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
10932 // whether the returned error was because http.StatusNotModified was returned.
10933 func (c *ProjectsLocationsLbTrafficExtensionsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
10934 gensupport.SetOptions(c.urlParams_, opts...)
10935 res, err := c.doRequest("json")
10936 if res != nil && res.StatusCode == http.StatusNotModified {
10937 if res.Body != nil {
10938 res.Body.Close()
10939 }
10940 return nil, gensupport.WrapError(&googleapi.Error{
10941 Code: res.StatusCode,
10942 Header: res.Header,
10943 })
10944 }
10945 if err != nil {
10946 return nil, err
10947 }
10948 defer googleapi.CloseBody(res)
10949 if err := googleapi.CheckResponse(res); err != nil {
10950 return nil, gensupport.WrapError(err)
10951 }
10952 ret := &Operation{
10953 ServerResponse: googleapi.ServerResponse{
10954 Header: res.Header,
10955 HTTPStatusCode: res.StatusCode,
10956 },
10957 }
10958 target := &ret
10959 b, err := gensupport.DecodeResponseBytes(target, res)
10960 if err != nil {
10961 return nil, err
10962 }
10963 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTrafficExtensions.create", "response", internallog.HTTPResponse(res, b))
10964 return ret, nil
10965 }
10966
10967 type ProjectsLocationsLbTrafficExtensionsDeleteCall struct {
10968 s *Service
10969 name string
10970 urlParams_ gensupport.URLParams
10971 ctx_ context.Context
10972 header_ http.Header
10973 }
10974
10975 // Delete: Deletes the specified `LbTrafficExtension` resource.
10976 //
10977 // - name: The name of the `LbTrafficExtension` resource to delete. Must be in
10978 // the format
10979 // `projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_ex
10980 // tension}`.
10981 func (r *ProjectsLocationsLbTrafficExtensionsService) Delete(name string) *ProjectsLocationsLbTrafficExtensionsDeleteCall {
10982 c := &ProjectsLocationsLbTrafficExtensionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10983 c.name = name
10984 return c
10985 }
10986
10987 // RequestId sets the optional parameter "requestId": An optional request ID to
10988 // identify requests. Specify a unique request ID so that if you must retry
10989 // your request, the server can ignore the request if it has already been
10990 // completed. The server guarantees that for 60 minutes after the first
10991 // request. For example, consider a situation where you make an initial request
10992 // and the request times out. If you make the request again with the same
10993 // request ID, the server ignores the second request This prevents clients from
10994 // accidentally creating duplicate commitments. The request ID must be a valid
10995 // UUID with the exception that zero UUID is not supported
10996 // (00000000-0000-0000-0000-000000000000).
10997 func (c *ProjectsLocationsLbTrafficExtensionsDeleteCall) RequestId(requestId string) *ProjectsLocationsLbTrafficExtensionsDeleteCall {
10998 c.urlParams_.Set("requestId", requestId)
10999 return c
11000 }
11001
11002 // Fields allows partial responses to be retrieved. See
11003 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11004 // details.
11005 func (c *ProjectsLocationsLbTrafficExtensionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbTrafficExtensionsDeleteCall {
11006 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11007 return c
11008 }
11009
11010 // Context sets the context to be used in this call's Do method.
11011 func (c *ProjectsLocationsLbTrafficExtensionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsLbTrafficExtensionsDeleteCall {
11012 c.ctx_ = ctx
11013 return c
11014 }
11015
11016 // Header returns a http.Header that can be modified by the caller to add
11017 // headers to the request.
11018 func (c *ProjectsLocationsLbTrafficExtensionsDeleteCall) Header() http.Header {
11019 if c.header_ == nil {
11020 c.header_ = make(http.Header)
11021 }
11022 return c.header_
11023 }
11024
11025 func (c *ProjectsLocationsLbTrafficExtensionsDeleteCall) doRequest(alt string) (*http.Response, error) {
11026 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
11027 c.urlParams_.Set("alt", alt)
11028 c.urlParams_.Set("prettyPrint", "false")
11029 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
11030 urls += "?" + c.urlParams_.Encode()
11031 req, err := http.NewRequest("DELETE", urls, nil)
11032 if err != nil {
11033 return nil, err
11034 }
11035 req.Header = reqHeaders
11036 googleapi.Expand(req.URL, map[string]string{
11037 "name": c.name,
11038 })
11039 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTrafficExtensions.delete", "request", internallog.HTTPRequest(req, nil))
11040 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11041 }
11042
11043 // Do executes the "networkservices.projects.locations.lbTrafficExtensions.delete" call.
11044 // Any non-2xx status code is an error. Response headers are in either
11045 // *Operation.ServerResponse.Header or (if a response was returned at all) in
11046 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
11047 // whether the returned error was because http.StatusNotModified was returned.
11048 func (c *ProjectsLocationsLbTrafficExtensionsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
11049 gensupport.SetOptions(c.urlParams_, opts...)
11050 res, err := c.doRequest("json")
11051 if res != nil && res.StatusCode == http.StatusNotModified {
11052 if res.Body != nil {
11053 res.Body.Close()
11054 }
11055 return nil, gensupport.WrapError(&googleapi.Error{
11056 Code: res.StatusCode,
11057 Header: res.Header,
11058 })
11059 }
11060 if err != nil {
11061 return nil, err
11062 }
11063 defer googleapi.CloseBody(res)
11064 if err := googleapi.CheckResponse(res); err != nil {
11065 return nil, gensupport.WrapError(err)
11066 }
11067 ret := &Operation{
11068 ServerResponse: googleapi.ServerResponse{
11069 Header: res.Header,
11070 HTTPStatusCode: res.StatusCode,
11071 },
11072 }
11073 target := &ret
11074 b, err := gensupport.DecodeResponseBytes(target, res)
11075 if err != nil {
11076 return nil, err
11077 }
11078 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTrafficExtensions.delete", "response", internallog.HTTPResponse(res, b))
11079 return ret, nil
11080 }
11081
11082 type ProjectsLocationsLbTrafficExtensionsGetCall struct {
11083 s *Service
11084 name string
11085 urlParams_ gensupport.URLParams
11086 ifNoneMatch_ string
11087 ctx_ context.Context
11088 header_ http.Header
11089 }
11090
11091 // Get: Gets details of the specified `LbTrafficExtension` resource.
11092 //
11093 // - name: A name of the `LbTrafficExtension` resource to get. Must be in the
11094 // format
11095 // `projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_ex
11096 // tension}`.
11097 func (r *ProjectsLocationsLbTrafficExtensionsService) Get(name string) *ProjectsLocationsLbTrafficExtensionsGetCall {
11098 c := &ProjectsLocationsLbTrafficExtensionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11099 c.name = name
11100 return c
11101 }
11102
11103 // Fields allows partial responses to be retrieved. See
11104 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11105 // details.
11106 func (c *ProjectsLocationsLbTrafficExtensionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbTrafficExtensionsGetCall {
11107 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11108 return c
11109 }
11110
11111 // IfNoneMatch sets an optional parameter which makes the operation fail if the
11112 // object's ETag matches the given value. This is useful for getting updates
11113 // only after the object has changed since the last request.
11114 func (c *ProjectsLocationsLbTrafficExtensionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsLbTrafficExtensionsGetCall {
11115 c.ifNoneMatch_ = entityTag
11116 return c
11117 }
11118
11119 // Context sets the context to be used in this call's Do method.
11120 func (c *ProjectsLocationsLbTrafficExtensionsGetCall) Context(ctx context.Context) *ProjectsLocationsLbTrafficExtensionsGetCall {
11121 c.ctx_ = ctx
11122 return c
11123 }
11124
11125 // Header returns a http.Header that can be modified by the caller to add
11126 // headers to the request.
11127 func (c *ProjectsLocationsLbTrafficExtensionsGetCall) Header() http.Header {
11128 if c.header_ == nil {
11129 c.header_ = make(http.Header)
11130 }
11131 return c.header_
11132 }
11133
11134 func (c *ProjectsLocationsLbTrafficExtensionsGetCall) doRequest(alt string) (*http.Response, error) {
11135 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
11136 if c.ifNoneMatch_ != "" {
11137 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11138 }
11139 c.urlParams_.Set("alt", alt)
11140 c.urlParams_.Set("prettyPrint", "false")
11141 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
11142 urls += "?" + c.urlParams_.Encode()
11143 req, err := http.NewRequest("GET", urls, nil)
11144 if err != nil {
11145 return nil, err
11146 }
11147 req.Header = reqHeaders
11148 googleapi.Expand(req.URL, map[string]string{
11149 "name": c.name,
11150 })
11151 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTrafficExtensions.get", "request", internallog.HTTPRequest(req, nil))
11152 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11153 }
11154
11155 // Do executes the "networkservices.projects.locations.lbTrafficExtensions.get" call.
11156 // Any non-2xx status code is an error. Response headers are in either
11157 // *LbTrafficExtension.ServerResponse.Header or (if a response was returned at
11158 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
11159 // check whether the returned error was because http.StatusNotModified was
11160 // returned.
11161 func (c *ProjectsLocationsLbTrafficExtensionsGetCall) Do(opts ...googleapi.CallOption) (*LbTrafficExtension, error) {
11162 gensupport.SetOptions(c.urlParams_, opts...)
11163 res, err := c.doRequest("json")
11164 if res != nil && res.StatusCode == http.StatusNotModified {
11165 if res.Body != nil {
11166 res.Body.Close()
11167 }
11168 return nil, gensupport.WrapError(&googleapi.Error{
11169 Code: res.StatusCode,
11170 Header: res.Header,
11171 })
11172 }
11173 if err != nil {
11174 return nil, err
11175 }
11176 defer googleapi.CloseBody(res)
11177 if err := googleapi.CheckResponse(res); err != nil {
11178 return nil, gensupport.WrapError(err)
11179 }
11180 ret := &LbTrafficExtension{
11181 ServerResponse: googleapi.ServerResponse{
11182 Header: res.Header,
11183 HTTPStatusCode: res.StatusCode,
11184 },
11185 }
11186 target := &ret
11187 b, err := gensupport.DecodeResponseBytes(target, res)
11188 if err != nil {
11189 return nil, err
11190 }
11191 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTrafficExtensions.get", "response", internallog.HTTPResponse(res, b))
11192 return ret, nil
11193 }
11194
11195 type ProjectsLocationsLbTrafficExtensionsListCall struct {
11196 s *Service
11197 parent string
11198 urlParams_ gensupport.URLParams
11199 ifNoneMatch_ string
11200 ctx_ context.Context
11201 header_ http.Header
11202 }
11203
11204 // List: Lists `LbTrafficExtension` resources in a given project and location.
11205 //
11206 // - parent: The project and location from which the `LbTrafficExtension`
11207 // resources are listed. These values are specified in the following format:
11208 // `projects/{project}/locations/{location}`.
11209 func (r *ProjectsLocationsLbTrafficExtensionsService) List(parent string) *ProjectsLocationsLbTrafficExtensionsListCall {
11210 c := &ProjectsLocationsLbTrafficExtensionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11211 c.parent = parent
11212 return c
11213 }
11214
11215 // Filter sets the optional parameter "filter": Filtering results.
11216 func (c *ProjectsLocationsLbTrafficExtensionsListCall) Filter(filter string) *ProjectsLocationsLbTrafficExtensionsListCall {
11217 c.urlParams_.Set("filter", filter)
11218 return c
11219 }
11220
11221 // OrderBy sets the optional parameter "orderBy": Hint about how to order the
11222 // results.
11223 func (c *ProjectsLocationsLbTrafficExtensionsListCall) OrderBy(orderBy string) *ProjectsLocationsLbTrafficExtensionsListCall {
11224 c.urlParams_.Set("orderBy", orderBy)
11225 return c
11226 }
11227
11228 // PageSize sets the optional parameter "pageSize": Requested page size. The
11229 // server might return fewer items than requested. If unspecified, the server
11230 // picks an appropriate default.
11231 func (c *ProjectsLocationsLbTrafficExtensionsListCall) PageSize(pageSize int64) *ProjectsLocationsLbTrafficExtensionsListCall {
11232 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
11233 return c
11234 }
11235
11236 // PageToken sets the optional parameter "pageToken": A token identifying a
11237 // page of results that the server returns.
11238 func (c *ProjectsLocationsLbTrafficExtensionsListCall) PageToken(pageToken string) *ProjectsLocationsLbTrafficExtensionsListCall {
11239 c.urlParams_.Set("pageToken", pageToken)
11240 return c
11241 }
11242
11243 // Fields allows partial responses to be retrieved. See
11244 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11245 // details.
11246 func (c *ProjectsLocationsLbTrafficExtensionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbTrafficExtensionsListCall {
11247 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11248 return c
11249 }
11250
11251 // IfNoneMatch sets an optional parameter which makes the operation fail if the
11252 // object's ETag matches the given value. This is useful for getting updates
11253 // only after the object has changed since the last request.
11254 func (c *ProjectsLocationsLbTrafficExtensionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsLbTrafficExtensionsListCall {
11255 c.ifNoneMatch_ = entityTag
11256 return c
11257 }
11258
11259 // Context sets the context to be used in this call's Do method.
11260 func (c *ProjectsLocationsLbTrafficExtensionsListCall) Context(ctx context.Context) *ProjectsLocationsLbTrafficExtensionsListCall {
11261 c.ctx_ = ctx
11262 return c
11263 }
11264
11265 // Header returns a http.Header that can be modified by the caller to add
11266 // headers to the request.
11267 func (c *ProjectsLocationsLbTrafficExtensionsListCall) Header() http.Header {
11268 if c.header_ == nil {
11269 c.header_ = make(http.Header)
11270 }
11271 return c.header_
11272 }
11273
11274 func (c *ProjectsLocationsLbTrafficExtensionsListCall) doRequest(alt string) (*http.Response, error) {
11275 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
11276 if c.ifNoneMatch_ != "" {
11277 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11278 }
11279 c.urlParams_.Set("alt", alt)
11280 c.urlParams_.Set("prettyPrint", "false")
11281 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/lbTrafficExtensions")
11282 urls += "?" + c.urlParams_.Encode()
11283 req, err := http.NewRequest("GET", urls, nil)
11284 if err != nil {
11285 return nil, err
11286 }
11287 req.Header = reqHeaders
11288 googleapi.Expand(req.URL, map[string]string{
11289 "parent": c.parent,
11290 })
11291 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTrafficExtensions.list", "request", internallog.HTTPRequest(req, nil))
11292 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11293 }
11294
11295 // Do executes the "networkservices.projects.locations.lbTrafficExtensions.list" call.
11296 // Any non-2xx status code is an error. Response headers are in either
11297 // *ListLbTrafficExtensionsResponse.ServerResponse.Header or (if a response was
11298 // returned at all) in error.(*googleapi.Error).Header. Use
11299 // googleapi.IsNotModified to check whether the returned error was because
11300 // http.StatusNotModified was returned.
11301 func (c *ProjectsLocationsLbTrafficExtensionsListCall) Do(opts ...googleapi.CallOption) (*ListLbTrafficExtensionsResponse, error) {
11302 gensupport.SetOptions(c.urlParams_, opts...)
11303 res, err := c.doRequest("json")
11304 if res != nil && res.StatusCode == http.StatusNotModified {
11305 if res.Body != nil {
11306 res.Body.Close()
11307 }
11308 return nil, gensupport.WrapError(&googleapi.Error{
11309 Code: res.StatusCode,
11310 Header: res.Header,
11311 })
11312 }
11313 if err != nil {
11314 return nil, err
11315 }
11316 defer googleapi.CloseBody(res)
11317 if err := googleapi.CheckResponse(res); err != nil {
11318 return nil, gensupport.WrapError(err)
11319 }
11320 ret := &ListLbTrafficExtensionsResponse{
11321 ServerResponse: googleapi.ServerResponse{
11322 Header: res.Header,
11323 HTTPStatusCode: res.StatusCode,
11324 },
11325 }
11326 target := &ret
11327 b, err := gensupport.DecodeResponseBytes(target, res)
11328 if err != nil {
11329 return nil, err
11330 }
11331 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTrafficExtensions.list", "response", internallog.HTTPResponse(res, b))
11332 return ret, nil
11333 }
11334
11335 // Pages invokes f for each page of results.
11336 // A non-nil error returned from f will halt the iteration.
11337 // The provided context supersedes any context provided to the Context method.
11338 func (c *ProjectsLocationsLbTrafficExtensionsListCall) Pages(ctx context.Context, f func(*ListLbTrafficExtensionsResponse) error) error {
11339 c.ctx_ = ctx
11340 defer c.PageToken(c.urlParams_.Get("pageToken"))
11341 for {
11342 x, err := c.Do()
11343 if err != nil {
11344 return err
11345 }
11346 if err := f(x); err != nil {
11347 return err
11348 }
11349 if x.NextPageToken == "" {
11350 return nil
11351 }
11352 c.PageToken(x.NextPageToken)
11353 }
11354 }
11355
11356 type ProjectsLocationsLbTrafficExtensionsPatchCall struct {
11357 s *Service
11358 name string
11359 lbtrafficextension *LbTrafficExtension
11360 urlParams_ gensupport.URLParams
11361 ctx_ context.Context
11362 header_ http.Header
11363 }
11364
11365 // Patch: Updates the parameters of the specified `LbTrafficExtension`
11366 // resource.
11367 //
11368 // - name: Identifier. Name of the `LbTrafficExtension` resource in the
11369 // following format:
11370 // `projects/{project}/locations/{location}/lbTrafficExtensions/{lb_traffic_ex
11371 // tension}`.
11372 func (r *ProjectsLocationsLbTrafficExtensionsService) Patch(name string, lbtrafficextension *LbTrafficExtension) *ProjectsLocationsLbTrafficExtensionsPatchCall {
11373 c := &ProjectsLocationsLbTrafficExtensionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11374 c.name = name
11375 c.lbtrafficextension = lbtrafficextension
11376 return c
11377 }
11378
11379 // RequestId sets the optional parameter "requestId": An optional request ID to
11380 // identify requests. Specify a unique request ID so that if you must retry
11381 // your request, the server can ignore the request if it has already been
11382 // completed. The server guarantees that for 60 minutes since the first
11383 // request. For example, consider a situation where you make an initial request
11384 // and the request times out. If you make the request again with the same
11385 // request ID, the server ignores the second request This prevents clients from
11386 // accidentally creating duplicate commitments. The request ID must be a valid
11387 // UUID with the exception that zero UUID is not supported
11388 // (00000000-0000-0000-0000-000000000000).
11389 func (c *ProjectsLocationsLbTrafficExtensionsPatchCall) RequestId(requestId string) *ProjectsLocationsLbTrafficExtensionsPatchCall {
11390 c.urlParams_.Set("requestId", requestId)
11391 return c
11392 }
11393
11394 // UpdateMask sets the optional parameter "updateMask": Used to specify the
11395 // fields to be overwritten in the `LbTrafficExtension` resource by the update.
11396 // The fields specified in the `update_mask` are relative to the resource, not
11397 // the full request. A field is overwritten if it is in the mask. If the user
11398 // does not specify a mask, then all fields are overwritten.
11399 func (c *ProjectsLocationsLbTrafficExtensionsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsLbTrafficExtensionsPatchCall {
11400 c.urlParams_.Set("updateMask", updateMask)
11401 return c
11402 }
11403
11404 // Fields allows partial responses to be retrieved. See
11405 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11406 // details.
11407 func (c *ProjectsLocationsLbTrafficExtensionsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsLbTrafficExtensionsPatchCall {
11408 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11409 return c
11410 }
11411
11412 // Context sets the context to be used in this call's Do method.
11413 func (c *ProjectsLocationsLbTrafficExtensionsPatchCall) Context(ctx context.Context) *ProjectsLocationsLbTrafficExtensionsPatchCall {
11414 c.ctx_ = ctx
11415 return c
11416 }
11417
11418 // Header returns a http.Header that can be modified by the caller to add
11419 // headers to the request.
11420 func (c *ProjectsLocationsLbTrafficExtensionsPatchCall) Header() http.Header {
11421 if c.header_ == nil {
11422 c.header_ = make(http.Header)
11423 }
11424 return c.header_
11425 }
11426
11427 func (c *ProjectsLocationsLbTrafficExtensionsPatchCall) doRequest(alt string) (*http.Response, error) {
11428 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
11429 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.lbtrafficextension)
11430 if err != nil {
11431 return nil, err
11432 }
11433 c.urlParams_.Set("alt", alt)
11434 c.urlParams_.Set("prettyPrint", "false")
11435 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
11436 urls += "?" + c.urlParams_.Encode()
11437 req, err := http.NewRequest("PATCH", urls, body)
11438 if err != nil {
11439 return nil, err
11440 }
11441 req.Header = reqHeaders
11442 googleapi.Expand(req.URL, map[string]string{
11443 "name": c.name,
11444 })
11445 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTrafficExtensions.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
11446 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11447 }
11448
11449 // Do executes the "networkservices.projects.locations.lbTrafficExtensions.patch" call.
11450 // Any non-2xx status code is an error. Response headers are in either
11451 // *Operation.ServerResponse.Header or (if a response was returned at all) in
11452 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
11453 // whether the returned error was because http.StatusNotModified was returned.
11454 func (c *ProjectsLocationsLbTrafficExtensionsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
11455 gensupport.SetOptions(c.urlParams_, opts...)
11456 res, err := c.doRequest("json")
11457 if res != nil && res.StatusCode == http.StatusNotModified {
11458 if res.Body != nil {
11459 res.Body.Close()
11460 }
11461 return nil, gensupport.WrapError(&googleapi.Error{
11462 Code: res.StatusCode,
11463 Header: res.Header,
11464 })
11465 }
11466 if err != nil {
11467 return nil, err
11468 }
11469 defer googleapi.CloseBody(res)
11470 if err := googleapi.CheckResponse(res); err != nil {
11471 return nil, gensupport.WrapError(err)
11472 }
11473 ret := &Operation{
11474 ServerResponse: googleapi.ServerResponse{
11475 Header: res.Header,
11476 HTTPStatusCode: res.StatusCode,
11477 },
11478 }
11479 target := &ret
11480 b, err := gensupport.DecodeResponseBytes(target, res)
11481 if err != nil {
11482 return nil, err
11483 }
11484 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.lbTrafficExtensions.patch", "response", internallog.HTTPResponse(res, b))
11485 return ret, nil
11486 }
11487
11488 type ProjectsLocationsMeshesCreateCall struct {
11489 s *Service
11490 parent string
11491 mesh *Mesh
11492 urlParams_ gensupport.URLParams
11493 ctx_ context.Context
11494 header_ http.Header
11495 }
11496
11497 // Create: Creates a new Mesh in a given project and location.
11498 //
11499 // - parent: The parent resource of the Mesh. Must be in the format
11500 // `projects/*/locations/*`.
11501 func (r *ProjectsLocationsMeshesService) Create(parent string, mesh *Mesh) *ProjectsLocationsMeshesCreateCall {
11502 c := &ProjectsLocationsMeshesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11503 c.parent = parent
11504 c.mesh = mesh
11505 return c
11506 }
11507
11508 // MeshId sets the optional parameter "meshId": Required. Short name of the
11509 // Mesh resource to be created.
11510 func (c *ProjectsLocationsMeshesCreateCall) MeshId(meshId string) *ProjectsLocationsMeshesCreateCall {
11511 c.urlParams_.Set("meshId", meshId)
11512 return c
11513 }
11514
11515 // Fields allows partial responses to be retrieved. See
11516 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11517 // details.
11518 func (c *ProjectsLocationsMeshesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsMeshesCreateCall {
11519 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11520 return c
11521 }
11522
11523 // Context sets the context to be used in this call's Do method.
11524 func (c *ProjectsLocationsMeshesCreateCall) Context(ctx context.Context) *ProjectsLocationsMeshesCreateCall {
11525 c.ctx_ = ctx
11526 return c
11527 }
11528
11529 // Header returns a http.Header that can be modified by the caller to add
11530 // headers to the request.
11531 func (c *ProjectsLocationsMeshesCreateCall) Header() http.Header {
11532 if c.header_ == nil {
11533 c.header_ = make(http.Header)
11534 }
11535 return c.header_
11536 }
11537
11538 func (c *ProjectsLocationsMeshesCreateCall) doRequest(alt string) (*http.Response, error) {
11539 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
11540 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.mesh)
11541 if err != nil {
11542 return nil, err
11543 }
11544 c.urlParams_.Set("alt", alt)
11545 c.urlParams_.Set("prettyPrint", "false")
11546 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/meshes")
11547 urls += "?" + c.urlParams_.Encode()
11548 req, err := http.NewRequest("POST", urls, body)
11549 if err != nil {
11550 return nil, err
11551 }
11552 req.Header = reqHeaders
11553 googleapi.Expand(req.URL, map[string]string{
11554 "parent": c.parent,
11555 })
11556 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.create", "request", internallog.HTTPRequest(req, body.Bytes()))
11557 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11558 }
11559
11560 // Do executes the "networkservices.projects.locations.meshes.create" call.
11561 // Any non-2xx status code is an error. Response headers are in either
11562 // *Operation.ServerResponse.Header or (if a response was returned at all) in
11563 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
11564 // whether the returned error was because http.StatusNotModified was returned.
11565 func (c *ProjectsLocationsMeshesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
11566 gensupport.SetOptions(c.urlParams_, opts...)
11567 res, err := c.doRequest("json")
11568 if res != nil && res.StatusCode == http.StatusNotModified {
11569 if res.Body != nil {
11570 res.Body.Close()
11571 }
11572 return nil, gensupport.WrapError(&googleapi.Error{
11573 Code: res.StatusCode,
11574 Header: res.Header,
11575 })
11576 }
11577 if err != nil {
11578 return nil, err
11579 }
11580 defer googleapi.CloseBody(res)
11581 if err := googleapi.CheckResponse(res); err != nil {
11582 return nil, gensupport.WrapError(err)
11583 }
11584 ret := &Operation{
11585 ServerResponse: googleapi.ServerResponse{
11586 Header: res.Header,
11587 HTTPStatusCode: res.StatusCode,
11588 },
11589 }
11590 target := &ret
11591 b, err := gensupport.DecodeResponseBytes(target, res)
11592 if err != nil {
11593 return nil, err
11594 }
11595 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.create", "response", internallog.HTTPResponse(res, b))
11596 return ret, nil
11597 }
11598
11599 type ProjectsLocationsMeshesDeleteCall struct {
11600 s *Service
11601 name string
11602 urlParams_ gensupport.URLParams
11603 ctx_ context.Context
11604 header_ http.Header
11605 }
11606
11607 // Delete: Deletes a single Mesh.
11608 //
11609 // - name: A name of the Mesh to delete. Must be in the format
11610 // `projects/*/locations/*/meshes/*`.
11611 func (r *ProjectsLocationsMeshesService) Delete(name string) *ProjectsLocationsMeshesDeleteCall {
11612 c := &ProjectsLocationsMeshesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11613 c.name = name
11614 return c
11615 }
11616
11617 // Fields allows partial responses to be retrieved. See
11618 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11619 // details.
11620 func (c *ProjectsLocationsMeshesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsMeshesDeleteCall {
11621 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11622 return c
11623 }
11624
11625 // Context sets the context to be used in this call's Do method.
11626 func (c *ProjectsLocationsMeshesDeleteCall) Context(ctx context.Context) *ProjectsLocationsMeshesDeleteCall {
11627 c.ctx_ = ctx
11628 return c
11629 }
11630
11631 // Header returns a http.Header that can be modified by the caller to add
11632 // headers to the request.
11633 func (c *ProjectsLocationsMeshesDeleteCall) Header() http.Header {
11634 if c.header_ == nil {
11635 c.header_ = make(http.Header)
11636 }
11637 return c.header_
11638 }
11639
11640 func (c *ProjectsLocationsMeshesDeleteCall) doRequest(alt string) (*http.Response, error) {
11641 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
11642 c.urlParams_.Set("alt", alt)
11643 c.urlParams_.Set("prettyPrint", "false")
11644 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
11645 urls += "?" + c.urlParams_.Encode()
11646 req, err := http.NewRequest("DELETE", urls, nil)
11647 if err != nil {
11648 return nil, err
11649 }
11650 req.Header = reqHeaders
11651 googleapi.Expand(req.URL, map[string]string{
11652 "name": c.name,
11653 })
11654 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.delete", "request", internallog.HTTPRequest(req, nil))
11655 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11656 }
11657
11658 // Do executes the "networkservices.projects.locations.meshes.delete" call.
11659 // Any non-2xx status code is an error. Response headers are in either
11660 // *Operation.ServerResponse.Header or (if a response was returned at all) in
11661 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
11662 // whether the returned error was because http.StatusNotModified was returned.
11663 func (c *ProjectsLocationsMeshesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
11664 gensupport.SetOptions(c.urlParams_, opts...)
11665 res, err := c.doRequest("json")
11666 if res != nil && res.StatusCode == http.StatusNotModified {
11667 if res.Body != nil {
11668 res.Body.Close()
11669 }
11670 return nil, gensupport.WrapError(&googleapi.Error{
11671 Code: res.StatusCode,
11672 Header: res.Header,
11673 })
11674 }
11675 if err != nil {
11676 return nil, err
11677 }
11678 defer googleapi.CloseBody(res)
11679 if err := googleapi.CheckResponse(res); err != nil {
11680 return nil, gensupport.WrapError(err)
11681 }
11682 ret := &Operation{
11683 ServerResponse: googleapi.ServerResponse{
11684 Header: res.Header,
11685 HTTPStatusCode: res.StatusCode,
11686 },
11687 }
11688 target := &ret
11689 b, err := gensupport.DecodeResponseBytes(target, res)
11690 if err != nil {
11691 return nil, err
11692 }
11693 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.delete", "response", internallog.HTTPResponse(res, b))
11694 return ret, nil
11695 }
11696
11697 type ProjectsLocationsMeshesGetCall struct {
11698 s *Service
11699 name string
11700 urlParams_ gensupport.URLParams
11701 ifNoneMatch_ string
11702 ctx_ context.Context
11703 header_ http.Header
11704 }
11705
11706 // Get: Gets details of a single Mesh.
11707 //
11708 // - name: A name of the Mesh to get. Must be in the format
11709 // `projects/*/locations/*/meshes/*`.
11710 func (r *ProjectsLocationsMeshesService) Get(name string) *ProjectsLocationsMeshesGetCall {
11711 c := &ProjectsLocationsMeshesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11712 c.name = name
11713 return c
11714 }
11715
11716 // Fields allows partial responses to be retrieved. See
11717 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11718 // details.
11719 func (c *ProjectsLocationsMeshesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsMeshesGetCall {
11720 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11721 return c
11722 }
11723
11724 // IfNoneMatch sets an optional parameter which makes the operation fail if the
11725 // object's ETag matches the given value. This is useful for getting updates
11726 // only after the object has changed since the last request.
11727 func (c *ProjectsLocationsMeshesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsMeshesGetCall {
11728 c.ifNoneMatch_ = entityTag
11729 return c
11730 }
11731
11732 // Context sets the context to be used in this call's Do method.
11733 func (c *ProjectsLocationsMeshesGetCall) Context(ctx context.Context) *ProjectsLocationsMeshesGetCall {
11734 c.ctx_ = ctx
11735 return c
11736 }
11737
11738 // Header returns a http.Header that can be modified by the caller to add
11739 // headers to the request.
11740 func (c *ProjectsLocationsMeshesGetCall) Header() http.Header {
11741 if c.header_ == nil {
11742 c.header_ = make(http.Header)
11743 }
11744 return c.header_
11745 }
11746
11747 func (c *ProjectsLocationsMeshesGetCall) doRequest(alt string) (*http.Response, error) {
11748 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
11749 if c.ifNoneMatch_ != "" {
11750 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11751 }
11752 c.urlParams_.Set("alt", alt)
11753 c.urlParams_.Set("prettyPrint", "false")
11754 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
11755 urls += "?" + c.urlParams_.Encode()
11756 req, err := http.NewRequest("GET", urls, nil)
11757 if err != nil {
11758 return nil, err
11759 }
11760 req.Header = reqHeaders
11761 googleapi.Expand(req.URL, map[string]string{
11762 "name": c.name,
11763 })
11764 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.get", "request", internallog.HTTPRequest(req, nil))
11765 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11766 }
11767
11768 // Do executes the "networkservices.projects.locations.meshes.get" call.
11769 // Any non-2xx status code is an error. Response headers are in either
11770 // *Mesh.ServerResponse.Header or (if a response was returned at all) in
11771 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
11772 // whether the returned error was because http.StatusNotModified was returned.
11773 func (c *ProjectsLocationsMeshesGetCall) Do(opts ...googleapi.CallOption) (*Mesh, error) {
11774 gensupport.SetOptions(c.urlParams_, opts...)
11775 res, err := c.doRequest("json")
11776 if res != nil && res.StatusCode == http.StatusNotModified {
11777 if res.Body != nil {
11778 res.Body.Close()
11779 }
11780 return nil, gensupport.WrapError(&googleapi.Error{
11781 Code: res.StatusCode,
11782 Header: res.Header,
11783 })
11784 }
11785 if err != nil {
11786 return nil, err
11787 }
11788 defer googleapi.CloseBody(res)
11789 if err := googleapi.CheckResponse(res); err != nil {
11790 return nil, gensupport.WrapError(err)
11791 }
11792 ret := &Mesh{
11793 ServerResponse: googleapi.ServerResponse{
11794 Header: res.Header,
11795 HTTPStatusCode: res.StatusCode,
11796 },
11797 }
11798 target := &ret
11799 b, err := gensupport.DecodeResponseBytes(target, res)
11800 if err != nil {
11801 return nil, err
11802 }
11803 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.get", "response", internallog.HTTPResponse(res, b))
11804 return ret, nil
11805 }
11806
11807 type ProjectsLocationsMeshesListCall struct {
11808 s *Service
11809 parent string
11810 urlParams_ gensupport.URLParams
11811 ifNoneMatch_ string
11812 ctx_ context.Context
11813 header_ http.Header
11814 }
11815
11816 // List: Lists Meshes in a given project and location.
11817 //
11818 // - parent: The project and location from which the Meshes should be listed,
11819 // specified in the format `projects/*/locations/*`.
11820 func (r *ProjectsLocationsMeshesService) List(parent string) *ProjectsLocationsMeshesListCall {
11821 c := &ProjectsLocationsMeshesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11822 c.parent = parent
11823 return c
11824 }
11825
11826 // PageSize sets the optional parameter "pageSize": Maximum number of Meshes to
11827 // return per call.
11828 func (c *ProjectsLocationsMeshesListCall) PageSize(pageSize int64) *ProjectsLocationsMeshesListCall {
11829 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
11830 return c
11831 }
11832
11833 // PageToken sets the optional parameter "pageToken": The value returned by the
11834 // last `ListMeshesResponse` Indicates that this is a continuation of a prior
11835 // `ListMeshes` call, and that the system should return the next page of data.
11836 func (c *ProjectsLocationsMeshesListCall) PageToken(pageToken string) *ProjectsLocationsMeshesListCall {
11837 c.urlParams_.Set("pageToken", pageToken)
11838 return c
11839 }
11840
11841 // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": If
11842 // true, allow partial responses for multi-regional Aggregated List requests.
11843 // Otherwise if one of the locations is down or unreachable, the Aggregated
11844 // List request will fail.
11845 func (c *ProjectsLocationsMeshesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ProjectsLocationsMeshesListCall {
11846 c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
11847 return c
11848 }
11849
11850 // Fields allows partial responses to be retrieved. See
11851 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11852 // details.
11853 func (c *ProjectsLocationsMeshesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsMeshesListCall {
11854 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11855 return c
11856 }
11857
11858 // IfNoneMatch sets an optional parameter which makes the operation fail if the
11859 // object's ETag matches the given value. This is useful for getting updates
11860 // only after the object has changed since the last request.
11861 func (c *ProjectsLocationsMeshesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsMeshesListCall {
11862 c.ifNoneMatch_ = entityTag
11863 return c
11864 }
11865
11866 // Context sets the context to be used in this call's Do method.
11867 func (c *ProjectsLocationsMeshesListCall) Context(ctx context.Context) *ProjectsLocationsMeshesListCall {
11868 c.ctx_ = ctx
11869 return c
11870 }
11871
11872 // Header returns a http.Header that can be modified by the caller to add
11873 // headers to the request.
11874 func (c *ProjectsLocationsMeshesListCall) Header() http.Header {
11875 if c.header_ == nil {
11876 c.header_ = make(http.Header)
11877 }
11878 return c.header_
11879 }
11880
11881 func (c *ProjectsLocationsMeshesListCall) doRequest(alt string) (*http.Response, error) {
11882 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
11883 if c.ifNoneMatch_ != "" {
11884 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11885 }
11886 c.urlParams_.Set("alt", alt)
11887 c.urlParams_.Set("prettyPrint", "false")
11888 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/meshes")
11889 urls += "?" + c.urlParams_.Encode()
11890 req, err := http.NewRequest("GET", urls, nil)
11891 if err != nil {
11892 return nil, err
11893 }
11894 req.Header = reqHeaders
11895 googleapi.Expand(req.URL, map[string]string{
11896 "parent": c.parent,
11897 })
11898 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.list", "request", internallog.HTTPRequest(req, nil))
11899 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11900 }
11901
11902 // Do executes the "networkservices.projects.locations.meshes.list" call.
11903 // Any non-2xx status code is an error. Response headers are in either
11904 // *ListMeshesResponse.ServerResponse.Header or (if a response was returned at
11905 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
11906 // check whether the returned error was because http.StatusNotModified was
11907 // returned.
11908 func (c *ProjectsLocationsMeshesListCall) Do(opts ...googleapi.CallOption) (*ListMeshesResponse, error) {
11909 gensupport.SetOptions(c.urlParams_, opts...)
11910 res, err := c.doRequest("json")
11911 if res != nil && res.StatusCode == http.StatusNotModified {
11912 if res.Body != nil {
11913 res.Body.Close()
11914 }
11915 return nil, gensupport.WrapError(&googleapi.Error{
11916 Code: res.StatusCode,
11917 Header: res.Header,
11918 })
11919 }
11920 if err != nil {
11921 return nil, err
11922 }
11923 defer googleapi.CloseBody(res)
11924 if err := googleapi.CheckResponse(res); err != nil {
11925 return nil, gensupport.WrapError(err)
11926 }
11927 ret := &ListMeshesResponse{
11928 ServerResponse: googleapi.ServerResponse{
11929 Header: res.Header,
11930 HTTPStatusCode: res.StatusCode,
11931 },
11932 }
11933 target := &ret
11934 b, err := gensupport.DecodeResponseBytes(target, res)
11935 if err != nil {
11936 return nil, err
11937 }
11938 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.list", "response", internallog.HTTPResponse(res, b))
11939 return ret, nil
11940 }
11941
11942 // Pages invokes f for each page of results.
11943 // A non-nil error returned from f will halt the iteration.
11944 // The provided context supersedes any context provided to the Context method.
11945 func (c *ProjectsLocationsMeshesListCall) Pages(ctx context.Context, f func(*ListMeshesResponse) error) error {
11946 c.ctx_ = ctx
11947 defer c.PageToken(c.urlParams_.Get("pageToken"))
11948 for {
11949 x, err := c.Do()
11950 if err != nil {
11951 return err
11952 }
11953 if err := f(x); err != nil {
11954 return err
11955 }
11956 if x.NextPageToken == "" {
11957 return nil
11958 }
11959 c.PageToken(x.NextPageToken)
11960 }
11961 }
11962
11963 type ProjectsLocationsMeshesPatchCall struct {
11964 s *Service
11965 name string
11966 mesh *Mesh
11967 urlParams_ gensupport.URLParams
11968 ctx_ context.Context
11969 header_ http.Header
11970 }
11971
11972 // Patch: Updates the parameters of a single Mesh.
11973 //
11974 // - name: Identifier. Name of the Mesh resource. It matches pattern
11975 // `projects/*/locations/*/meshes/`.
11976 func (r *ProjectsLocationsMeshesService) Patch(name string, mesh *Mesh) *ProjectsLocationsMeshesPatchCall {
11977 c := &ProjectsLocationsMeshesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11978 c.name = name
11979 c.mesh = mesh
11980 return c
11981 }
11982
11983 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
11984 // specify the fields to be overwritten in the Mesh resource by the update. The
11985 // fields specified in the update_mask are relative to the resource, not the
11986 // full request. A field will be overwritten if it is in the mask. If the user
11987 // does not provide a mask then all fields will be overwritten.
11988 func (c *ProjectsLocationsMeshesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsMeshesPatchCall {
11989 c.urlParams_.Set("updateMask", updateMask)
11990 return c
11991 }
11992
11993 // Fields allows partial responses to be retrieved. See
11994 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11995 // details.
11996 func (c *ProjectsLocationsMeshesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsMeshesPatchCall {
11997 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11998 return c
11999 }
12000
12001 // Context sets the context to be used in this call's Do method.
12002 func (c *ProjectsLocationsMeshesPatchCall) Context(ctx context.Context) *ProjectsLocationsMeshesPatchCall {
12003 c.ctx_ = ctx
12004 return c
12005 }
12006
12007 // Header returns a http.Header that can be modified by the caller to add
12008 // headers to the request.
12009 func (c *ProjectsLocationsMeshesPatchCall) Header() http.Header {
12010 if c.header_ == nil {
12011 c.header_ = make(http.Header)
12012 }
12013 return c.header_
12014 }
12015
12016 func (c *ProjectsLocationsMeshesPatchCall) doRequest(alt string) (*http.Response, error) {
12017 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
12018 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.mesh)
12019 if err != nil {
12020 return nil, err
12021 }
12022 c.urlParams_.Set("alt", alt)
12023 c.urlParams_.Set("prettyPrint", "false")
12024 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
12025 urls += "?" + c.urlParams_.Encode()
12026 req, err := http.NewRequest("PATCH", urls, body)
12027 if err != nil {
12028 return nil, err
12029 }
12030 req.Header = reqHeaders
12031 googleapi.Expand(req.URL, map[string]string{
12032 "name": c.name,
12033 })
12034 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
12035 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12036 }
12037
12038 // Do executes the "networkservices.projects.locations.meshes.patch" call.
12039 // Any non-2xx status code is an error. Response headers are in either
12040 // *Operation.ServerResponse.Header or (if a response was returned at all) in
12041 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
12042 // whether the returned error was because http.StatusNotModified was returned.
12043 func (c *ProjectsLocationsMeshesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
12044 gensupport.SetOptions(c.urlParams_, opts...)
12045 res, err := c.doRequest("json")
12046 if res != nil && res.StatusCode == http.StatusNotModified {
12047 if res.Body != nil {
12048 res.Body.Close()
12049 }
12050 return nil, gensupport.WrapError(&googleapi.Error{
12051 Code: res.StatusCode,
12052 Header: res.Header,
12053 })
12054 }
12055 if err != nil {
12056 return nil, err
12057 }
12058 defer googleapi.CloseBody(res)
12059 if err := googleapi.CheckResponse(res); err != nil {
12060 return nil, gensupport.WrapError(err)
12061 }
12062 ret := &Operation{
12063 ServerResponse: googleapi.ServerResponse{
12064 Header: res.Header,
12065 HTTPStatusCode: res.StatusCode,
12066 },
12067 }
12068 target := &ret
12069 b, err := gensupport.DecodeResponseBytes(target, res)
12070 if err != nil {
12071 return nil, err
12072 }
12073 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.patch", "response", internallog.HTTPResponse(res, b))
12074 return ret, nil
12075 }
12076
12077 type ProjectsLocationsMeshesRouteViewsGetCall struct {
12078 s *Service
12079 name string
12080 urlParams_ gensupport.URLParams
12081 ifNoneMatch_ string
12082 ctx_ context.Context
12083 header_ http.Header
12084 }
12085
12086 // Get: Get a single RouteView of a Mesh.
12087 //
12088 // - name: Name of the MeshRouteView resource. Format:
12089 // projects/{project_number}/locations/{location}/meshes/{mesh}/routeViews/{ro
12090 // ute_view}.
12091 func (r *ProjectsLocationsMeshesRouteViewsService) Get(name string) *ProjectsLocationsMeshesRouteViewsGetCall {
12092 c := &ProjectsLocationsMeshesRouteViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12093 c.name = name
12094 return c
12095 }
12096
12097 // Fields allows partial responses to be retrieved. See
12098 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
12099 // details.
12100 func (c *ProjectsLocationsMeshesRouteViewsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsMeshesRouteViewsGetCall {
12101 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12102 return c
12103 }
12104
12105 // IfNoneMatch sets an optional parameter which makes the operation fail if the
12106 // object's ETag matches the given value. This is useful for getting updates
12107 // only after the object has changed since the last request.
12108 func (c *ProjectsLocationsMeshesRouteViewsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsMeshesRouteViewsGetCall {
12109 c.ifNoneMatch_ = entityTag
12110 return c
12111 }
12112
12113 // Context sets the context to be used in this call's Do method.
12114 func (c *ProjectsLocationsMeshesRouteViewsGetCall) Context(ctx context.Context) *ProjectsLocationsMeshesRouteViewsGetCall {
12115 c.ctx_ = ctx
12116 return c
12117 }
12118
12119 // Header returns a http.Header that can be modified by the caller to add
12120 // headers to the request.
12121 func (c *ProjectsLocationsMeshesRouteViewsGetCall) Header() http.Header {
12122 if c.header_ == nil {
12123 c.header_ = make(http.Header)
12124 }
12125 return c.header_
12126 }
12127
12128 func (c *ProjectsLocationsMeshesRouteViewsGetCall) doRequest(alt string) (*http.Response, error) {
12129 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
12130 if c.ifNoneMatch_ != "" {
12131 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12132 }
12133 c.urlParams_.Set("alt", alt)
12134 c.urlParams_.Set("prettyPrint", "false")
12135 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
12136 urls += "?" + c.urlParams_.Encode()
12137 req, err := http.NewRequest("GET", urls, nil)
12138 if err != nil {
12139 return nil, err
12140 }
12141 req.Header = reqHeaders
12142 googleapi.Expand(req.URL, map[string]string{
12143 "name": c.name,
12144 })
12145 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.routeViews.get", "request", internallog.HTTPRequest(req, nil))
12146 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12147 }
12148
12149 // Do executes the "networkservices.projects.locations.meshes.routeViews.get" call.
12150 // Any non-2xx status code is an error. Response headers are in either
12151 // *MeshRouteView.ServerResponse.Header or (if a response was returned at all)
12152 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
12153 // whether the returned error was because http.StatusNotModified was returned.
12154 func (c *ProjectsLocationsMeshesRouteViewsGetCall) Do(opts ...googleapi.CallOption) (*MeshRouteView, error) {
12155 gensupport.SetOptions(c.urlParams_, opts...)
12156 res, err := c.doRequest("json")
12157 if res != nil && res.StatusCode == http.StatusNotModified {
12158 if res.Body != nil {
12159 res.Body.Close()
12160 }
12161 return nil, gensupport.WrapError(&googleapi.Error{
12162 Code: res.StatusCode,
12163 Header: res.Header,
12164 })
12165 }
12166 if err != nil {
12167 return nil, err
12168 }
12169 defer googleapi.CloseBody(res)
12170 if err := googleapi.CheckResponse(res); err != nil {
12171 return nil, gensupport.WrapError(err)
12172 }
12173 ret := &MeshRouteView{
12174 ServerResponse: googleapi.ServerResponse{
12175 Header: res.Header,
12176 HTTPStatusCode: res.StatusCode,
12177 },
12178 }
12179 target := &ret
12180 b, err := gensupport.DecodeResponseBytes(target, res)
12181 if err != nil {
12182 return nil, err
12183 }
12184 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.routeViews.get", "response", internallog.HTTPResponse(res, b))
12185 return ret, nil
12186 }
12187
12188 type ProjectsLocationsMeshesRouteViewsListCall struct {
12189 s *Service
12190 parent string
12191 urlParams_ gensupport.URLParams
12192 ifNoneMatch_ string
12193 ctx_ context.Context
12194 header_ http.Header
12195 }
12196
12197 // List: Lists RouteViews
12198 //
12199 // - parent: The Mesh to which a Route is associated. Format:
12200 // projects/{project_number}/locations/{location}/meshes/{mesh}.
12201 func (r *ProjectsLocationsMeshesRouteViewsService) List(parent string) *ProjectsLocationsMeshesRouteViewsListCall {
12202 c := &ProjectsLocationsMeshesRouteViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12203 c.parent = parent
12204 return c
12205 }
12206
12207 // PageSize sets the optional parameter "pageSize": Maximum number of
12208 // MeshRouteViews to return per call.
12209 func (c *ProjectsLocationsMeshesRouteViewsListCall) PageSize(pageSize int64) *ProjectsLocationsMeshesRouteViewsListCall {
12210 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
12211 return c
12212 }
12213
12214 // PageToken sets the optional parameter "pageToken": The value returned by the
12215 // last `ListMeshRouteViewsResponse` Indicates that this is a continuation of a
12216 // prior `ListMeshRouteViews` call, and that the system should return the next
12217 // page of data.
12218 func (c *ProjectsLocationsMeshesRouteViewsListCall) PageToken(pageToken string) *ProjectsLocationsMeshesRouteViewsListCall {
12219 c.urlParams_.Set("pageToken", pageToken)
12220 return c
12221 }
12222
12223 // Fields allows partial responses to be retrieved. See
12224 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
12225 // details.
12226 func (c *ProjectsLocationsMeshesRouteViewsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsMeshesRouteViewsListCall {
12227 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12228 return c
12229 }
12230
12231 // IfNoneMatch sets an optional parameter which makes the operation fail if the
12232 // object's ETag matches the given value. This is useful for getting updates
12233 // only after the object has changed since the last request.
12234 func (c *ProjectsLocationsMeshesRouteViewsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsMeshesRouteViewsListCall {
12235 c.ifNoneMatch_ = entityTag
12236 return c
12237 }
12238
12239 // Context sets the context to be used in this call's Do method.
12240 func (c *ProjectsLocationsMeshesRouteViewsListCall) Context(ctx context.Context) *ProjectsLocationsMeshesRouteViewsListCall {
12241 c.ctx_ = ctx
12242 return c
12243 }
12244
12245 // Header returns a http.Header that can be modified by the caller to add
12246 // headers to the request.
12247 func (c *ProjectsLocationsMeshesRouteViewsListCall) Header() http.Header {
12248 if c.header_ == nil {
12249 c.header_ = make(http.Header)
12250 }
12251 return c.header_
12252 }
12253
12254 func (c *ProjectsLocationsMeshesRouteViewsListCall) doRequest(alt string) (*http.Response, error) {
12255 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
12256 if c.ifNoneMatch_ != "" {
12257 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12258 }
12259 c.urlParams_.Set("alt", alt)
12260 c.urlParams_.Set("prettyPrint", "false")
12261 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/routeViews")
12262 urls += "?" + c.urlParams_.Encode()
12263 req, err := http.NewRequest("GET", urls, nil)
12264 if err != nil {
12265 return nil, err
12266 }
12267 req.Header = reqHeaders
12268 googleapi.Expand(req.URL, map[string]string{
12269 "parent": c.parent,
12270 })
12271 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.routeViews.list", "request", internallog.HTTPRequest(req, nil))
12272 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12273 }
12274
12275 // Do executes the "networkservices.projects.locations.meshes.routeViews.list" call.
12276 // Any non-2xx status code is an error. Response headers are in either
12277 // *ListMeshRouteViewsResponse.ServerResponse.Header or (if a response was
12278 // returned at all) in error.(*googleapi.Error).Header. Use
12279 // googleapi.IsNotModified to check whether the returned error was because
12280 // http.StatusNotModified was returned.
12281 func (c *ProjectsLocationsMeshesRouteViewsListCall) Do(opts ...googleapi.CallOption) (*ListMeshRouteViewsResponse, error) {
12282 gensupport.SetOptions(c.urlParams_, opts...)
12283 res, err := c.doRequest("json")
12284 if res != nil && res.StatusCode == http.StatusNotModified {
12285 if res.Body != nil {
12286 res.Body.Close()
12287 }
12288 return nil, gensupport.WrapError(&googleapi.Error{
12289 Code: res.StatusCode,
12290 Header: res.Header,
12291 })
12292 }
12293 if err != nil {
12294 return nil, err
12295 }
12296 defer googleapi.CloseBody(res)
12297 if err := googleapi.CheckResponse(res); err != nil {
12298 return nil, gensupport.WrapError(err)
12299 }
12300 ret := &ListMeshRouteViewsResponse{
12301 ServerResponse: googleapi.ServerResponse{
12302 Header: res.Header,
12303 HTTPStatusCode: res.StatusCode,
12304 },
12305 }
12306 target := &ret
12307 b, err := gensupport.DecodeResponseBytes(target, res)
12308 if err != nil {
12309 return nil, err
12310 }
12311 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.meshes.routeViews.list", "response", internallog.HTTPResponse(res, b))
12312 return ret, nil
12313 }
12314
12315 // Pages invokes f for each page of results.
12316 // A non-nil error returned from f will halt the iteration.
12317 // The provided context supersedes any context provided to the Context method.
12318 func (c *ProjectsLocationsMeshesRouteViewsListCall) Pages(ctx context.Context, f func(*ListMeshRouteViewsResponse) error) error {
12319 c.ctx_ = ctx
12320 defer c.PageToken(c.urlParams_.Get("pageToken"))
12321 for {
12322 x, err := c.Do()
12323 if err != nil {
12324 return err
12325 }
12326 if err := f(x); err != nil {
12327 return err
12328 }
12329 if x.NextPageToken == "" {
12330 return nil
12331 }
12332 c.PageToken(x.NextPageToken)
12333 }
12334 }
12335
12336 type ProjectsLocationsOperationsCancelCall struct {
12337 s *Service
12338 name string
12339 canceloperationrequest *CancelOperationRequest
12340 urlParams_ gensupport.URLParams
12341 ctx_ context.Context
12342 header_ http.Header
12343 }
12344
12345 // Cancel: Starts asynchronous cancellation on a long-running operation. The
12346 // server makes a best effort to cancel the operation, but success is not
12347 // guaranteed. If the server doesn't support this method, it returns
12348 // `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or
12349 // other methods to check whether the cancellation succeeded or whether the
12350 // operation completed despite cancellation. On successful cancellation, the
12351 // operation is not deleted; instead, it becomes an operation with an
12352 // Operation.error value with a google.rpc.Status.code of `1`, corresponding to
12353 // `Code.CANCELLED`.
12354 //
12355 // - name: The name of the operation resource to be cancelled.
12356 func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall {
12357 c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12358 c.name = name
12359 c.canceloperationrequest = canceloperationrequest
12360 return c
12361 }
12362
12363 // Fields allows partial responses to be retrieved. See
12364 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
12365 // details.
12366 func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall {
12367 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12368 return c
12369 }
12370
12371 // Context sets the context to be used in this call's Do method.
12372 func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall {
12373 c.ctx_ = ctx
12374 return c
12375 }
12376
12377 // Header returns a http.Header that can be modified by the caller to add
12378 // headers to the request.
12379 func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header {
12380 if c.header_ == nil {
12381 c.header_ = make(http.Header)
12382 }
12383 return c.header_
12384 }
12385
12386 func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
12387 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
12388 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest)
12389 if err != nil {
12390 return nil, err
12391 }
12392 c.urlParams_.Set("alt", alt)
12393 c.urlParams_.Set("prettyPrint", "false")
12394 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel")
12395 urls += "?" + c.urlParams_.Encode()
12396 req, err := http.NewRequest("POST", urls, body)
12397 if err != nil {
12398 return nil, err
12399 }
12400 req.Header = reqHeaders
12401 googleapi.Expand(req.URL, map[string]string{
12402 "name": c.name,
12403 })
12404 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.operations.cancel", "request", internallog.HTTPRequest(req, body.Bytes()))
12405 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12406 }
12407
12408 // Do executes the "networkservices.projects.locations.operations.cancel" call.
12409 // Any non-2xx status code is an error. Response headers are in either
12410 // *Empty.ServerResponse.Header or (if a response was returned at all) in
12411 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
12412 // whether the returned error was because http.StatusNotModified was returned.
12413 func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
12414 gensupport.SetOptions(c.urlParams_, opts...)
12415 res, err := c.doRequest("json")
12416 if res != nil && res.StatusCode == http.StatusNotModified {
12417 if res.Body != nil {
12418 res.Body.Close()
12419 }
12420 return nil, gensupport.WrapError(&googleapi.Error{
12421 Code: res.StatusCode,
12422 Header: res.Header,
12423 })
12424 }
12425 if err != nil {
12426 return nil, err
12427 }
12428 defer googleapi.CloseBody(res)
12429 if err := googleapi.CheckResponse(res); err != nil {
12430 return nil, gensupport.WrapError(err)
12431 }
12432 ret := &Empty{
12433 ServerResponse: googleapi.ServerResponse{
12434 Header: res.Header,
12435 HTTPStatusCode: res.StatusCode,
12436 },
12437 }
12438 target := &ret
12439 b, err := gensupport.DecodeResponseBytes(target, res)
12440 if err != nil {
12441 return nil, err
12442 }
12443 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.operations.cancel", "response", internallog.HTTPResponse(res, b))
12444 return ret, nil
12445 }
12446
12447 type ProjectsLocationsOperationsDeleteCall struct {
12448 s *Service
12449 name string
12450 urlParams_ gensupport.URLParams
12451 ctx_ context.Context
12452 header_ http.Header
12453 }
12454
12455 // Delete: Deletes a long-running operation. This method indicates that the
12456 // client is no longer interested in the operation result. It does not cancel
12457 // the operation. If the server doesn't support this method, it returns
12458 // `google.rpc.Code.UNIMPLEMENTED`.
12459 //
12460 // - name: The name of the operation resource to be deleted.
12461 func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall {
12462 c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12463 c.name = name
12464 return c
12465 }
12466
12467 // Fields allows partial responses to be retrieved. See
12468 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
12469 // details.
12470 func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall {
12471 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12472 return c
12473 }
12474
12475 // Context sets the context to be used in this call's Do method.
12476 func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall {
12477 c.ctx_ = ctx
12478 return c
12479 }
12480
12481 // Header returns a http.Header that can be modified by the caller to add
12482 // headers to the request.
12483 func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header {
12484 if c.header_ == nil {
12485 c.header_ = make(http.Header)
12486 }
12487 return c.header_
12488 }
12489
12490 func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
12491 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
12492 c.urlParams_.Set("alt", alt)
12493 c.urlParams_.Set("prettyPrint", "false")
12494 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
12495 urls += "?" + c.urlParams_.Encode()
12496 req, err := http.NewRequest("DELETE", urls, nil)
12497 if err != nil {
12498 return nil, err
12499 }
12500 req.Header = reqHeaders
12501 googleapi.Expand(req.URL, map[string]string{
12502 "name": c.name,
12503 })
12504 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.operations.delete", "request", internallog.HTTPRequest(req, nil))
12505 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12506 }
12507
12508 // Do executes the "networkservices.projects.locations.operations.delete" call.
12509 // Any non-2xx status code is an error. Response headers are in either
12510 // *Empty.ServerResponse.Header or (if a response was returned at all) in
12511 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
12512 // whether the returned error was because http.StatusNotModified was returned.
12513 func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
12514 gensupport.SetOptions(c.urlParams_, opts...)
12515 res, err := c.doRequest("json")
12516 if res != nil && res.StatusCode == http.StatusNotModified {
12517 if res.Body != nil {
12518 res.Body.Close()
12519 }
12520 return nil, gensupport.WrapError(&googleapi.Error{
12521 Code: res.StatusCode,
12522 Header: res.Header,
12523 })
12524 }
12525 if err != nil {
12526 return nil, err
12527 }
12528 defer googleapi.CloseBody(res)
12529 if err := googleapi.CheckResponse(res); err != nil {
12530 return nil, gensupport.WrapError(err)
12531 }
12532 ret := &Empty{
12533 ServerResponse: googleapi.ServerResponse{
12534 Header: res.Header,
12535 HTTPStatusCode: res.StatusCode,
12536 },
12537 }
12538 target := &ret
12539 b, err := gensupport.DecodeResponseBytes(target, res)
12540 if err != nil {
12541 return nil, err
12542 }
12543 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.operations.delete", "response", internallog.HTTPResponse(res, b))
12544 return ret, nil
12545 }
12546
12547 type ProjectsLocationsOperationsGetCall struct {
12548 s *Service
12549 name string
12550 urlParams_ gensupport.URLParams
12551 ifNoneMatch_ string
12552 ctx_ context.Context
12553 header_ http.Header
12554 }
12555
12556 // Get: Gets the latest state of a long-running operation. Clients can use this
12557 // method to poll the operation result at intervals as recommended by the API
12558 // service.
12559 //
12560 // - name: The name of the operation resource.
12561 func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
12562 c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12563 c.name = name
12564 return c
12565 }
12566
12567 // Fields allows partial responses to be retrieved. See
12568 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
12569 // details.
12570 func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
12571 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12572 return c
12573 }
12574
12575 // IfNoneMatch sets an optional parameter which makes the operation fail if the
12576 // object's ETag matches the given value. This is useful for getting updates
12577 // only after the object has changed since the last request.
12578 func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
12579 c.ifNoneMatch_ = entityTag
12580 return c
12581 }
12582
12583 // Context sets the context to be used in this call's Do method.
12584 func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
12585 c.ctx_ = ctx
12586 return c
12587 }
12588
12589 // Header returns a http.Header that can be modified by the caller to add
12590 // headers to the request.
12591 func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
12592 if c.header_ == nil {
12593 c.header_ = make(http.Header)
12594 }
12595 return c.header_
12596 }
12597
12598 func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
12599 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
12600 if c.ifNoneMatch_ != "" {
12601 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12602 }
12603 c.urlParams_.Set("alt", alt)
12604 c.urlParams_.Set("prettyPrint", "false")
12605 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
12606 urls += "?" + c.urlParams_.Encode()
12607 req, err := http.NewRequest("GET", urls, nil)
12608 if err != nil {
12609 return nil, err
12610 }
12611 req.Header = reqHeaders
12612 googleapi.Expand(req.URL, map[string]string{
12613 "name": c.name,
12614 })
12615 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.operations.get", "request", internallog.HTTPRequest(req, nil))
12616 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12617 }
12618
12619 // Do executes the "networkservices.projects.locations.operations.get" call.
12620 // Any non-2xx status code is an error. Response headers are in either
12621 // *Operation.ServerResponse.Header or (if a response was returned at all) in
12622 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
12623 // whether the returned error was because http.StatusNotModified was returned.
12624 func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
12625 gensupport.SetOptions(c.urlParams_, opts...)
12626 res, err := c.doRequest("json")
12627 if res != nil && res.StatusCode == http.StatusNotModified {
12628 if res.Body != nil {
12629 res.Body.Close()
12630 }
12631 return nil, gensupport.WrapError(&googleapi.Error{
12632 Code: res.StatusCode,
12633 Header: res.Header,
12634 })
12635 }
12636 if err != nil {
12637 return nil, err
12638 }
12639 defer googleapi.CloseBody(res)
12640 if err := googleapi.CheckResponse(res); err != nil {
12641 return nil, gensupport.WrapError(err)
12642 }
12643 ret := &Operation{
12644 ServerResponse: googleapi.ServerResponse{
12645 Header: res.Header,
12646 HTTPStatusCode: res.StatusCode,
12647 },
12648 }
12649 target := &ret
12650 b, err := gensupport.DecodeResponseBytes(target, res)
12651 if err != nil {
12652 return nil, err
12653 }
12654 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.operations.get", "response", internallog.HTTPResponse(res, b))
12655 return ret, nil
12656 }
12657
12658 type ProjectsLocationsOperationsListCall struct {
12659 s *Service
12660 name string
12661 urlParams_ gensupport.URLParams
12662 ifNoneMatch_ string
12663 ctx_ context.Context
12664 header_ http.Header
12665 }
12666
12667 // List: Lists operations that match the specified filter in the request. If
12668 // the server doesn't support this method, it returns `UNIMPLEMENTED`.
12669 //
12670 // - name: The name of the operation's parent resource.
12671 func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall {
12672 c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12673 c.name = name
12674 return c
12675 }
12676
12677 // Filter sets the optional parameter "filter": The standard list filter.
12678 func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall {
12679 c.urlParams_.Set("filter", filter)
12680 return c
12681 }
12682
12683 // PageSize sets the optional parameter "pageSize": The standard list page
12684 // size.
12685 func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall {
12686 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
12687 return c
12688 }
12689
12690 // PageToken sets the optional parameter "pageToken": The standard list page
12691 // token.
12692 func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall {
12693 c.urlParams_.Set("pageToken", pageToken)
12694 return c
12695 }
12696
12697 // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
12698 // When set to `true`, operations that are reachable are returned as normal,
12699 // and those that are unreachable are returned in the
12700 // ListOperationsResponse.unreachable field. This can only be `true` when
12701 // reading across collections. For example, when `parent` is set to
12702 // "projects/example/locations/-". This field is not supported by default and
12703 // will result in an `UNIMPLEMENTED` error if set unless explicitly documented
12704 // otherwise in service or product specific documentation.
12705 func (c *ProjectsLocationsOperationsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ProjectsLocationsOperationsListCall {
12706 c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
12707 return c
12708 }
12709
12710 // Fields allows partial responses to be retrieved. See
12711 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
12712 // details.
12713 func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
12714 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12715 return c
12716 }
12717
12718 // IfNoneMatch sets an optional parameter which makes the operation fail if the
12719 // object's ETag matches the given value. This is useful for getting updates
12720 // only after the object has changed since the last request.
12721 func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
12722 c.ifNoneMatch_ = entityTag
12723 return c
12724 }
12725
12726 // Context sets the context to be used in this call's Do method.
12727 func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
12728 c.ctx_ = ctx
12729 return c
12730 }
12731
12732 // Header returns a http.Header that can be modified by the caller to add
12733 // headers to the request.
12734 func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
12735 if c.header_ == nil {
12736 c.header_ = make(http.Header)
12737 }
12738 return c.header_
12739 }
12740
12741 func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
12742 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
12743 if c.ifNoneMatch_ != "" {
12744 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12745 }
12746 c.urlParams_.Set("alt", alt)
12747 c.urlParams_.Set("prettyPrint", "false")
12748 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations")
12749 urls += "?" + c.urlParams_.Encode()
12750 req, err := http.NewRequest("GET", urls, nil)
12751 if err != nil {
12752 return nil, err
12753 }
12754 req.Header = reqHeaders
12755 googleapi.Expand(req.URL, map[string]string{
12756 "name": c.name,
12757 })
12758 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.operations.list", "request", internallog.HTTPRequest(req, nil))
12759 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12760 }
12761
12762 // Do executes the "networkservices.projects.locations.operations.list" call.
12763 // Any non-2xx status code is an error. Response headers are in either
12764 // *ListOperationsResponse.ServerResponse.Header or (if a response was returned
12765 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
12766 // check whether the returned error was because http.StatusNotModified was
12767 // returned.
12768 func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
12769 gensupport.SetOptions(c.urlParams_, opts...)
12770 res, err := c.doRequest("json")
12771 if res != nil && res.StatusCode == http.StatusNotModified {
12772 if res.Body != nil {
12773 res.Body.Close()
12774 }
12775 return nil, gensupport.WrapError(&googleapi.Error{
12776 Code: res.StatusCode,
12777 Header: res.Header,
12778 })
12779 }
12780 if err != nil {
12781 return nil, err
12782 }
12783 defer googleapi.CloseBody(res)
12784 if err := googleapi.CheckResponse(res); err != nil {
12785 return nil, gensupport.WrapError(err)
12786 }
12787 ret := &ListOperationsResponse{
12788 ServerResponse: googleapi.ServerResponse{
12789 Header: res.Header,
12790 HTTPStatusCode: res.StatusCode,
12791 },
12792 }
12793 target := &ret
12794 b, err := gensupport.DecodeResponseBytes(target, res)
12795 if err != nil {
12796 return nil, err
12797 }
12798 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.operations.list", "response", internallog.HTTPResponse(res, b))
12799 return ret, nil
12800 }
12801
12802 // Pages invokes f for each page of results.
12803 // A non-nil error returned from f will halt the iteration.
12804 // The provided context supersedes any context provided to the Context method.
12805 func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
12806 c.ctx_ = ctx
12807 defer c.PageToken(c.urlParams_.Get("pageToken"))
12808 for {
12809 x, err := c.Do()
12810 if err != nil {
12811 return err
12812 }
12813 if err := f(x); err != nil {
12814 return err
12815 }
12816 if x.NextPageToken == "" {
12817 return nil
12818 }
12819 c.PageToken(x.NextPageToken)
12820 }
12821 }
12822
12823 type ProjectsLocationsServiceBindingsCreateCall struct {
12824 s *Service
12825 parent string
12826 servicebinding *ServiceBinding
12827 urlParams_ gensupport.URLParams
12828 ctx_ context.Context
12829 header_ http.Header
12830 }
12831
12832 // Create: Creates a new ServiceBinding in a given project and location.
12833 //
12834 // - parent: The parent resource of the ServiceBinding. Must be in the format
12835 // `projects/*/locations/*`.
12836 func (r *ProjectsLocationsServiceBindingsService) Create(parent string, servicebinding *ServiceBinding) *ProjectsLocationsServiceBindingsCreateCall {
12837 c := &ProjectsLocationsServiceBindingsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12838 c.parent = parent
12839 c.servicebinding = servicebinding
12840 return c
12841 }
12842
12843 // ServiceBindingId sets the optional parameter "serviceBindingId": Required.
12844 // Short name of the ServiceBinding resource to be created.
12845 func (c *ProjectsLocationsServiceBindingsCreateCall) ServiceBindingId(serviceBindingId string) *ProjectsLocationsServiceBindingsCreateCall {
12846 c.urlParams_.Set("serviceBindingId", serviceBindingId)
12847 return c
12848 }
12849
12850 // Fields allows partial responses to be retrieved. See
12851 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
12852 // details.
12853 func (c *ProjectsLocationsServiceBindingsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsServiceBindingsCreateCall {
12854 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12855 return c
12856 }
12857
12858 // Context sets the context to be used in this call's Do method.
12859 func (c *ProjectsLocationsServiceBindingsCreateCall) Context(ctx context.Context) *ProjectsLocationsServiceBindingsCreateCall {
12860 c.ctx_ = ctx
12861 return c
12862 }
12863
12864 // Header returns a http.Header that can be modified by the caller to add
12865 // headers to the request.
12866 func (c *ProjectsLocationsServiceBindingsCreateCall) Header() http.Header {
12867 if c.header_ == nil {
12868 c.header_ = make(http.Header)
12869 }
12870 return c.header_
12871 }
12872
12873 func (c *ProjectsLocationsServiceBindingsCreateCall) doRequest(alt string) (*http.Response, error) {
12874 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
12875 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.servicebinding)
12876 if err != nil {
12877 return nil, err
12878 }
12879 c.urlParams_.Set("alt", alt)
12880 c.urlParams_.Set("prettyPrint", "false")
12881 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/serviceBindings")
12882 urls += "?" + c.urlParams_.Encode()
12883 req, err := http.NewRequest("POST", urls, body)
12884 if err != nil {
12885 return nil, err
12886 }
12887 req.Header = reqHeaders
12888 googleapi.Expand(req.URL, map[string]string{
12889 "parent": c.parent,
12890 })
12891 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceBindings.create", "request", internallog.HTTPRequest(req, body.Bytes()))
12892 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12893 }
12894
12895 // Do executes the "networkservices.projects.locations.serviceBindings.create" call.
12896 // Any non-2xx status code is an error. Response headers are in either
12897 // *Operation.ServerResponse.Header or (if a response was returned at all) in
12898 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
12899 // whether the returned error was because http.StatusNotModified was returned.
12900 func (c *ProjectsLocationsServiceBindingsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
12901 gensupport.SetOptions(c.urlParams_, opts...)
12902 res, err := c.doRequest("json")
12903 if res != nil && res.StatusCode == http.StatusNotModified {
12904 if res.Body != nil {
12905 res.Body.Close()
12906 }
12907 return nil, gensupport.WrapError(&googleapi.Error{
12908 Code: res.StatusCode,
12909 Header: res.Header,
12910 })
12911 }
12912 if err != nil {
12913 return nil, err
12914 }
12915 defer googleapi.CloseBody(res)
12916 if err := googleapi.CheckResponse(res); err != nil {
12917 return nil, gensupport.WrapError(err)
12918 }
12919 ret := &Operation{
12920 ServerResponse: googleapi.ServerResponse{
12921 Header: res.Header,
12922 HTTPStatusCode: res.StatusCode,
12923 },
12924 }
12925 target := &ret
12926 b, err := gensupport.DecodeResponseBytes(target, res)
12927 if err != nil {
12928 return nil, err
12929 }
12930 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceBindings.create", "response", internallog.HTTPResponse(res, b))
12931 return ret, nil
12932 }
12933
12934 type ProjectsLocationsServiceBindingsDeleteCall struct {
12935 s *Service
12936 name string
12937 urlParams_ gensupport.URLParams
12938 ctx_ context.Context
12939 header_ http.Header
12940 }
12941
12942 // Delete: Deletes a single ServiceBinding.
12943 //
12944 // - name: A name of the ServiceBinding to delete. Must be in the format
12945 // `projects/*/locations/*/serviceBindings/*`.
12946 func (r *ProjectsLocationsServiceBindingsService) Delete(name string) *ProjectsLocationsServiceBindingsDeleteCall {
12947 c := &ProjectsLocationsServiceBindingsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12948 c.name = name
12949 return c
12950 }
12951
12952 // Fields allows partial responses to be retrieved. See
12953 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
12954 // details.
12955 func (c *ProjectsLocationsServiceBindingsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsServiceBindingsDeleteCall {
12956 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12957 return c
12958 }
12959
12960 // Context sets the context to be used in this call's Do method.
12961 func (c *ProjectsLocationsServiceBindingsDeleteCall) Context(ctx context.Context) *ProjectsLocationsServiceBindingsDeleteCall {
12962 c.ctx_ = ctx
12963 return c
12964 }
12965
12966 // Header returns a http.Header that can be modified by the caller to add
12967 // headers to the request.
12968 func (c *ProjectsLocationsServiceBindingsDeleteCall) Header() http.Header {
12969 if c.header_ == nil {
12970 c.header_ = make(http.Header)
12971 }
12972 return c.header_
12973 }
12974
12975 func (c *ProjectsLocationsServiceBindingsDeleteCall) doRequest(alt string) (*http.Response, error) {
12976 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
12977 c.urlParams_.Set("alt", alt)
12978 c.urlParams_.Set("prettyPrint", "false")
12979 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
12980 urls += "?" + c.urlParams_.Encode()
12981 req, err := http.NewRequest("DELETE", urls, nil)
12982 if err != nil {
12983 return nil, err
12984 }
12985 req.Header = reqHeaders
12986 googleapi.Expand(req.URL, map[string]string{
12987 "name": c.name,
12988 })
12989 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceBindings.delete", "request", internallog.HTTPRequest(req, nil))
12990 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12991 }
12992
12993 // Do executes the "networkservices.projects.locations.serviceBindings.delete" call.
12994 // Any non-2xx status code is an error. Response headers are in either
12995 // *Operation.ServerResponse.Header or (if a response was returned at all) in
12996 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
12997 // whether the returned error was because http.StatusNotModified was returned.
12998 func (c *ProjectsLocationsServiceBindingsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
12999 gensupport.SetOptions(c.urlParams_, opts...)
13000 res, err := c.doRequest("json")
13001 if res != nil && res.StatusCode == http.StatusNotModified {
13002 if res.Body != nil {
13003 res.Body.Close()
13004 }
13005 return nil, gensupport.WrapError(&googleapi.Error{
13006 Code: res.StatusCode,
13007 Header: res.Header,
13008 })
13009 }
13010 if err != nil {
13011 return nil, err
13012 }
13013 defer googleapi.CloseBody(res)
13014 if err := googleapi.CheckResponse(res); err != nil {
13015 return nil, gensupport.WrapError(err)
13016 }
13017 ret := &Operation{
13018 ServerResponse: googleapi.ServerResponse{
13019 Header: res.Header,
13020 HTTPStatusCode: res.StatusCode,
13021 },
13022 }
13023 target := &ret
13024 b, err := gensupport.DecodeResponseBytes(target, res)
13025 if err != nil {
13026 return nil, err
13027 }
13028 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceBindings.delete", "response", internallog.HTTPResponse(res, b))
13029 return ret, nil
13030 }
13031
13032 type ProjectsLocationsServiceBindingsGetCall struct {
13033 s *Service
13034 name string
13035 urlParams_ gensupport.URLParams
13036 ifNoneMatch_ string
13037 ctx_ context.Context
13038 header_ http.Header
13039 }
13040
13041 // Get: Gets details of a single ServiceBinding.
13042 //
13043 // - name: A name of the ServiceBinding to get. Must be in the format
13044 // `projects/*/locations/*/serviceBindings/*`.
13045 func (r *ProjectsLocationsServiceBindingsService) Get(name string) *ProjectsLocationsServiceBindingsGetCall {
13046 c := &ProjectsLocationsServiceBindingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13047 c.name = name
13048 return c
13049 }
13050
13051 // Fields allows partial responses to be retrieved. See
13052 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
13053 // details.
13054 func (c *ProjectsLocationsServiceBindingsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsServiceBindingsGetCall {
13055 c.urlParams_.Set("fields", googleapi.CombineFields(s))
13056 return c
13057 }
13058
13059 // IfNoneMatch sets an optional parameter which makes the operation fail if the
13060 // object's ETag matches the given value. This is useful for getting updates
13061 // only after the object has changed since the last request.
13062 func (c *ProjectsLocationsServiceBindingsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsServiceBindingsGetCall {
13063 c.ifNoneMatch_ = entityTag
13064 return c
13065 }
13066
13067 // Context sets the context to be used in this call's Do method.
13068 func (c *ProjectsLocationsServiceBindingsGetCall) Context(ctx context.Context) *ProjectsLocationsServiceBindingsGetCall {
13069 c.ctx_ = ctx
13070 return c
13071 }
13072
13073 // Header returns a http.Header that can be modified by the caller to add
13074 // headers to the request.
13075 func (c *ProjectsLocationsServiceBindingsGetCall) Header() http.Header {
13076 if c.header_ == nil {
13077 c.header_ = make(http.Header)
13078 }
13079 return c.header_
13080 }
13081
13082 func (c *ProjectsLocationsServiceBindingsGetCall) doRequest(alt string) (*http.Response, error) {
13083 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
13084 if c.ifNoneMatch_ != "" {
13085 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
13086 }
13087 c.urlParams_.Set("alt", alt)
13088 c.urlParams_.Set("prettyPrint", "false")
13089 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
13090 urls += "?" + c.urlParams_.Encode()
13091 req, err := http.NewRequest("GET", urls, nil)
13092 if err != nil {
13093 return nil, err
13094 }
13095 req.Header = reqHeaders
13096 googleapi.Expand(req.URL, map[string]string{
13097 "name": c.name,
13098 })
13099 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceBindings.get", "request", internallog.HTTPRequest(req, nil))
13100 return gensupport.SendRequest(c.ctx_, c.s.client, req)
13101 }
13102
13103 // Do executes the "networkservices.projects.locations.serviceBindings.get" call.
13104 // Any non-2xx status code is an error. Response headers are in either
13105 // *ServiceBinding.ServerResponse.Header or (if a response was returned at all)
13106 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
13107 // whether the returned error was because http.StatusNotModified was returned.
13108 func (c *ProjectsLocationsServiceBindingsGetCall) Do(opts ...googleapi.CallOption) (*ServiceBinding, error) {
13109 gensupport.SetOptions(c.urlParams_, opts...)
13110 res, err := c.doRequest("json")
13111 if res != nil && res.StatusCode == http.StatusNotModified {
13112 if res.Body != nil {
13113 res.Body.Close()
13114 }
13115 return nil, gensupport.WrapError(&googleapi.Error{
13116 Code: res.StatusCode,
13117 Header: res.Header,
13118 })
13119 }
13120 if err != nil {
13121 return nil, err
13122 }
13123 defer googleapi.CloseBody(res)
13124 if err := googleapi.CheckResponse(res); err != nil {
13125 return nil, gensupport.WrapError(err)
13126 }
13127 ret := &ServiceBinding{
13128 ServerResponse: googleapi.ServerResponse{
13129 Header: res.Header,
13130 HTTPStatusCode: res.StatusCode,
13131 },
13132 }
13133 target := &ret
13134 b, err := gensupport.DecodeResponseBytes(target, res)
13135 if err != nil {
13136 return nil, err
13137 }
13138 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceBindings.get", "response", internallog.HTTPResponse(res, b))
13139 return ret, nil
13140 }
13141
13142 type ProjectsLocationsServiceBindingsListCall struct {
13143 s *Service
13144 parent string
13145 urlParams_ gensupport.URLParams
13146 ifNoneMatch_ string
13147 ctx_ context.Context
13148 header_ http.Header
13149 }
13150
13151 // List: Lists ServiceBinding in a given project and location.
13152 //
13153 // - parent: The project and location from which the ServiceBindings should be
13154 // listed, specified in the format `projects/*/locations/*`.
13155 func (r *ProjectsLocationsServiceBindingsService) List(parent string) *ProjectsLocationsServiceBindingsListCall {
13156 c := &ProjectsLocationsServiceBindingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13157 c.parent = parent
13158 return c
13159 }
13160
13161 // PageSize sets the optional parameter "pageSize": Maximum number of
13162 // ServiceBindings to return per call.
13163 func (c *ProjectsLocationsServiceBindingsListCall) PageSize(pageSize int64) *ProjectsLocationsServiceBindingsListCall {
13164 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
13165 return c
13166 }
13167
13168 // PageToken sets the optional parameter "pageToken": The value returned by the
13169 // last `ListServiceBindingsResponse` Indicates that this is a continuation of
13170 // a prior `ListRouters` call, and that the system should return the next page
13171 // of data.
13172 func (c *ProjectsLocationsServiceBindingsListCall) PageToken(pageToken string) *ProjectsLocationsServiceBindingsListCall {
13173 c.urlParams_.Set("pageToken", pageToken)
13174 return c
13175 }
13176
13177 // Fields allows partial responses to be retrieved. See
13178 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
13179 // details.
13180 func (c *ProjectsLocationsServiceBindingsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsServiceBindingsListCall {
13181 c.urlParams_.Set("fields", googleapi.CombineFields(s))
13182 return c
13183 }
13184
13185 // IfNoneMatch sets an optional parameter which makes the operation fail if the
13186 // object's ETag matches the given value. This is useful for getting updates
13187 // only after the object has changed since the last request.
13188 func (c *ProjectsLocationsServiceBindingsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsServiceBindingsListCall {
13189 c.ifNoneMatch_ = entityTag
13190 return c
13191 }
13192
13193 // Context sets the context to be used in this call's Do method.
13194 func (c *ProjectsLocationsServiceBindingsListCall) Context(ctx context.Context) *ProjectsLocationsServiceBindingsListCall {
13195 c.ctx_ = ctx
13196 return c
13197 }
13198
13199 // Header returns a http.Header that can be modified by the caller to add
13200 // headers to the request.
13201 func (c *ProjectsLocationsServiceBindingsListCall) Header() http.Header {
13202 if c.header_ == nil {
13203 c.header_ = make(http.Header)
13204 }
13205 return c.header_
13206 }
13207
13208 func (c *ProjectsLocationsServiceBindingsListCall) doRequest(alt string) (*http.Response, error) {
13209 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
13210 if c.ifNoneMatch_ != "" {
13211 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
13212 }
13213 c.urlParams_.Set("alt", alt)
13214 c.urlParams_.Set("prettyPrint", "false")
13215 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/serviceBindings")
13216 urls += "?" + c.urlParams_.Encode()
13217 req, err := http.NewRequest("GET", urls, nil)
13218 if err != nil {
13219 return nil, err
13220 }
13221 req.Header = reqHeaders
13222 googleapi.Expand(req.URL, map[string]string{
13223 "parent": c.parent,
13224 })
13225 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceBindings.list", "request", internallog.HTTPRequest(req, nil))
13226 return gensupport.SendRequest(c.ctx_, c.s.client, req)
13227 }
13228
13229 // Do executes the "networkservices.projects.locations.serviceBindings.list" call.
13230 // Any non-2xx status code is an error. Response headers are in either
13231 // *ListServiceBindingsResponse.ServerResponse.Header or (if a response was
13232 // returned at all) in error.(*googleapi.Error).Header. Use
13233 // googleapi.IsNotModified to check whether the returned error was because
13234 // http.StatusNotModified was returned.
13235 func (c *ProjectsLocationsServiceBindingsListCall) Do(opts ...googleapi.CallOption) (*ListServiceBindingsResponse, error) {
13236 gensupport.SetOptions(c.urlParams_, opts...)
13237 res, err := c.doRequest("json")
13238 if res != nil && res.StatusCode == http.StatusNotModified {
13239 if res.Body != nil {
13240 res.Body.Close()
13241 }
13242 return nil, gensupport.WrapError(&googleapi.Error{
13243 Code: res.StatusCode,
13244 Header: res.Header,
13245 })
13246 }
13247 if err != nil {
13248 return nil, err
13249 }
13250 defer googleapi.CloseBody(res)
13251 if err := googleapi.CheckResponse(res); err != nil {
13252 return nil, gensupport.WrapError(err)
13253 }
13254 ret := &ListServiceBindingsResponse{
13255 ServerResponse: googleapi.ServerResponse{
13256 Header: res.Header,
13257 HTTPStatusCode: res.StatusCode,
13258 },
13259 }
13260 target := &ret
13261 b, err := gensupport.DecodeResponseBytes(target, res)
13262 if err != nil {
13263 return nil, err
13264 }
13265 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceBindings.list", "response", internallog.HTTPResponse(res, b))
13266 return ret, nil
13267 }
13268
13269 // Pages invokes f for each page of results.
13270 // A non-nil error returned from f will halt the iteration.
13271 // The provided context supersedes any context provided to the Context method.
13272 func (c *ProjectsLocationsServiceBindingsListCall) Pages(ctx context.Context, f func(*ListServiceBindingsResponse) error) error {
13273 c.ctx_ = ctx
13274 defer c.PageToken(c.urlParams_.Get("pageToken"))
13275 for {
13276 x, err := c.Do()
13277 if err != nil {
13278 return err
13279 }
13280 if err := f(x); err != nil {
13281 return err
13282 }
13283 if x.NextPageToken == "" {
13284 return nil
13285 }
13286 c.PageToken(x.NextPageToken)
13287 }
13288 }
13289
13290 type ProjectsLocationsServiceBindingsPatchCall struct {
13291 s *Service
13292 name string
13293 servicebinding *ServiceBinding
13294 urlParams_ gensupport.URLParams
13295 ctx_ context.Context
13296 header_ http.Header
13297 }
13298
13299 // Patch: Updates the parameters of a single ServiceBinding.
13300 //
13301 // - name: Identifier. Name of the ServiceBinding resource. It matches pattern
13302 // `projects/*/locations/*/serviceBindings/`.
13303 func (r *ProjectsLocationsServiceBindingsService) Patch(name string, servicebinding *ServiceBinding) *ProjectsLocationsServiceBindingsPatchCall {
13304 c := &ProjectsLocationsServiceBindingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13305 c.name = name
13306 c.servicebinding = servicebinding
13307 return c
13308 }
13309
13310 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
13311 // specify the fields to be overwritten in the ServiceBinding resource by the
13312 // update. The fields specified in the update_mask are relative to the
13313 // resource, not the full request. A field will be overwritten if it is in the
13314 // mask. If the user does not provide a mask then all fields will be
13315 // overwritten.
13316 func (c *ProjectsLocationsServiceBindingsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsServiceBindingsPatchCall {
13317 c.urlParams_.Set("updateMask", updateMask)
13318 return c
13319 }
13320
13321 // Fields allows partial responses to be retrieved. See
13322 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
13323 // details.
13324 func (c *ProjectsLocationsServiceBindingsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsServiceBindingsPatchCall {
13325 c.urlParams_.Set("fields", googleapi.CombineFields(s))
13326 return c
13327 }
13328
13329 // Context sets the context to be used in this call's Do method.
13330 func (c *ProjectsLocationsServiceBindingsPatchCall) Context(ctx context.Context) *ProjectsLocationsServiceBindingsPatchCall {
13331 c.ctx_ = ctx
13332 return c
13333 }
13334
13335 // Header returns a http.Header that can be modified by the caller to add
13336 // headers to the request.
13337 func (c *ProjectsLocationsServiceBindingsPatchCall) Header() http.Header {
13338 if c.header_ == nil {
13339 c.header_ = make(http.Header)
13340 }
13341 return c.header_
13342 }
13343
13344 func (c *ProjectsLocationsServiceBindingsPatchCall) doRequest(alt string) (*http.Response, error) {
13345 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
13346 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.servicebinding)
13347 if err != nil {
13348 return nil, err
13349 }
13350 c.urlParams_.Set("alt", alt)
13351 c.urlParams_.Set("prettyPrint", "false")
13352 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
13353 urls += "?" + c.urlParams_.Encode()
13354 req, err := http.NewRequest("PATCH", urls, body)
13355 if err != nil {
13356 return nil, err
13357 }
13358 req.Header = reqHeaders
13359 googleapi.Expand(req.URL, map[string]string{
13360 "name": c.name,
13361 })
13362 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceBindings.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
13363 return gensupport.SendRequest(c.ctx_, c.s.client, req)
13364 }
13365
13366 // Do executes the "networkservices.projects.locations.serviceBindings.patch" call.
13367 // Any non-2xx status code is an error. Response headers are in either
13368 // *Operation.ServerResponse.Header or (if a response was returned at all) in
13369 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
13370 // whether the returned error was because http.StatusNotModified was returned.
13371 func (c *ProjectsLocationsServiceBindingsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
13372 gensupport.SetOptions(c.urlParams_, opts...)
13373 res, err := c.doRequest("json")
13374 if res != nil && res.StatusCode == http.StatusNotModified {
13375 if res.Body != nil {
13376 res.Body.Close()
13377 }
13378 return nil, gensupport.WrapError(&googleapi.Error{
13379 Code: res.StatusCode,
13380 Header: res.Header,
13381 })
13382 }
13383 if err != nil {
13384 return nil, err
13385 }
13386 defer googleapi.CloseBody(res)
13387 if err := googleapi.CheckResponse(res); err != nil {
13388 return nil, gensupport.WrapError(err)
13389 }
13390 ret := &Operation{
13391 ServerResponse: googleapi.ServerResponse{
13392 Header: res.Header,
13393 HTTPStatusCode: res.StatusCode,
13394 },
13395 }
13396 target := &ret
13397 b, err := gensupport.DecodeResponseBytes(target, res)
13398 if err != nil {
13399 return nil, err
13400 }
13401 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceBindings.patch", "response", internallog.HTTPResponse(res, b))
13402 return ret, nil
13403 }
13404
13405 type ProjectsLocationsServiceLbPoliciesCreateCall struct {
13406 s *Service
13407 parent string
13408 servicelbpolicy *ServiceLbPolicy
13409 urlParams_ gensupport.URLParams
13410 ctx_ context.Context
13411 header_ http.Header
13412 }
13413
13414 // Create: Creates a new ServiceLbPolicy in a given project and location.
13415 //
13416 // - parent: The parent resource of the ServiceLbPolicy. Must be in the format
13417 // `projects/{project}/locations/{location}`.
13418 func (r *ProjectsLocationsServiceLbPoliciesService) Create(parent string, servicelbpolicy *ServiceLbPolicy) *ProjectsLocationsServiceLbPoliciesCreateCall {
13419 c := &ProjectsLocationsServiceLbPoliciesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13420 c.parent = parent
13421 c.servicelbpolicy = servicelbpolicy
13422 return c
13423 }
13424
13425 // ServiceLbPolicyId sets the optional parameter "serviceLbPolicyId": Required.
13426 // Short name of the ServiceLbPolicy resource to be created. E.g. for resource
13427 // name
13428 // `projects/{project}/locations/{location}/serviceLbPolicies/{service_lb_policy
13429 // _name}`. the id is value of {service_lb_policy_name}
13430 func (c *ProjectsLocationsServiceLbPoliciesCreateCall) ServiceLbPolicyId(serviceLbPolicyId string) *ProjectsLocationsServiceLbPoliciesCreateCall {
13431 c.urlParams_.Set("serviceLbPolicyId", serviceLbPolicyId)
13432 return c
13433 }
13434
13435 // Fields allows partial responses to be retrieved. See
13436 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
13437 // details.
13438 func (c *ProjectsLocationsServiceLbPoliciesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsServiceLbPoliciesCreateCall {
13439 c.urlParams_.Set("fields", googleapi.CombineFields(s))
13440 return c
13441 }
13442
13443 // Context sets the context to be used in this call's Do method.
13444 func (c *ProjectsLocationsServiceLbPoliciesCreateCall) Context(ctx context.Context) *ProjectsLocationsServiceLbPoliciesCreateCall {
13445 c.ctx_ = ctx
13446 return c
13447 }
13448
13449 // Header returns a http.Header that can be modified by the caller to add
13450 // headers to the request.
13451 func (c *ProjectsLocationsServiceLbPoliciesCreateCall) Header() http.Header {
13452 if c.header_ == nil {
13453 c.header_ = make(http.Header)
13454 }
13455 return c.header_
13456 }
13457
13458 func (c *ProjectsLocationsServiceLbPoliciesCreateCall) doRequest(alt string) (*http.Response, error) {
13459 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
13460 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.servicelbpolicy)
13461 if err != nil {
13462 return nil, err
13463 }
13464 c.urlParams_.Set("alt", alt)
13465 c.urlParams_.Set("prettyPrint", "false")
13466 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/serviceLbPolicies")
13467 urls += "?" + c.urlParams_.Encode()
13468 req, err := http.NewRequest("POST", urls, body)
13469 if err != nil {
13470 return nil, err
13471 }
13472 req.Header = reqHeaders
13473 googleapi.Expand(req.URL, map[string]string{
13474 "parent": c.parent,
13475 })
13476 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceLbPolicies.create", "request", internallog.HTTPRequest(req, body.Bytes()))
13477 return gensupport.SendRequest(c.ctx_, c.s.client, req)
13478 }
13479
13480 // Do executes the "networkservices.projects.locations.serviceLbPolicies.create" call.
13481 // Any non-2xx status code is an error. Response headers are in either
13482 // *Operation.ServerResponse.Header or (if a response was returned at all) in
13483 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
13484 // whether the returned error was because http.StatusNotModified was returned.
13485 func (c *ProjectsLocationsServiceLbPoliciesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
13486 gensupport.SetOptions(c.urlParams_, opts...)
13487 res, err := c.doRequest("json")
13488 if res != nil && res.StatusCode == http.StatusNotModified {
13489 if res.Body != nil {
13490 res.Body.Close()
13491 }
13492 return nil, gensupport.WrapError(&googleapi.Error{
13493 Code: res.StatusCode,
13494 Header: res.Header,
13495 })
13496 }
13497 if err != nil {
13498 return nil, err
13499 }
13500 defer googleapi.CloseBody(res)
13501 if err := googleapi.CheckResponse(res); err != nil {
13502 return nil, gensupport.WrapError(err)
13503 }
13504 ret := &Operation{
13505 ServerResponse: googleapi.ServerResponse{
13506 Header: res.Header,
13507 HTTPStatusCode: res.StatusCode,
13508 },
13509 }
13510 target := &ret
13511 b, err := gensupport.DecodeResponseBytes(target, res)
13512 if err != nil {
13513 return nil, err
13514 }
13515 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceLbPolicies.create", "response", internallog.HTTPResponse(res, b))
13516 return ret, nil
13517 }
13518
13519 type ProjectsLocationsServiceLbPoliciesDeleteCall struct {
13520 s *Service
13521 name string
13522 urlParams_ gensupport.URLParams
13523 ctx_ context.Context
13524 header_ http.Header
13525 }
13526
13527 // Delete: Deletes a single ServiceLbPolicy.
13528 //
13529 // - name: A name of the ServiceLbPolicy to delete. Must be in the format
13530 // `projects/{project}/locations/{location}/serviceLbPolicies/*`.
13531 func (r *ProjectsLocationsServiceLbPoliciesService) Delete(name string) *ProjectsLocationsServiceLbPoliciesDeleteCall {
13532 c := &ProjectsLocationsServiceLbPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13533 c.name = name
13534 return c
13535 }
13536
13537 // Fields allows partial responses to be retrieved. See
13538 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
13539 // details.
13540 func (c *ProjectsLocationsServiceLbPoliciesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsServiceLbPoliciesDeleteCall {
13541 c.urlParams_.Set("fields", googleapi.CombineFields(s))
13542 return c
13543 }
13544
13545 // Context sets the context to be used in this call's Do method.
13546 func (c *ProjectsLocationsServiceLbPoliciesDeleteCall) Context(ctx context.Context) *ProjectsLocationsServiceLbPoliciesDeleteCall {
13547 c.ctx_ = ctx
13548 return c
13549 }
13550
13551 // Header returns a http.Header that can be modified by the caller to add
13552 // headers to the request.
13553 func (c *ProjectsLocationsServiceLbPoliciesDeleteCall) Header() http.Header {
13554 if c.header_ == nil {
13555 c.header_ = make(http.Header)
13556 }
13557 return c.header_
13558 }
13559
13560 func (c *ProjectsLocationsServiceLbPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
13561 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
13562 c.urlParams_.Set("alt", alt)
13563 c.urlParams_.Set("prettyPrint", "false")
13564 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
13565 urls += "?" + c.urlParams_.Encode()
13566 req, err := http.NewRequest("DELETE", urls, nil)
13567 if err != nil {
13568 return nil, err
13569 }
13570 req.Header = reqHeaders
13571 googleapi.Expand(req.URL, map[string]string{
13572 "name": c.name,
13573 })
13574 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceLbPolicies.delete", "request", internallog.HTTPRequest(req, nil))
13575 return gensupport.SendRequest(c.ctx_, c.s.client, req)
13576 }
13577
13578 // Do executes the "networkservices.projects.locations.serviceLbPolicies.delete" call.
13579 // Any non-2xx status code is an error. Response headers are in either
13580 // *Operation.ServerResponse.Header or (if a response was returned at all) in
13581 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
13582 // whether the returned error was because http.StatusNotModified was returned.
13583 func (c *ProjectsLocationsServiceLbPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
13584 gensupport.SetOptions(c.urlParams_, opts...)
13585 res, err := c.doRequest("json")
13586 if res != nil && res.StatusCode == http.StatusNotModified {
13587 if res.Body != nil {
13588 res.Body.Close()
13589 }
13590 return nil, gensupport.WrapError(&googleapi.Error{
13591 Code: res.StatusCode,
13592 Header: res.Header,
13593 })
13594 }
13595 if err != nil {
13596 return nil, err
13597 }
13598 defer googleapi.CloseBody(res)
13599 if err := googleapi.CheckResponse(res); err != nil {
13600 return nil, gensupport.WrapError(err)
13601 }
13602 ret := &Operation{
13603 ServerResponse: googleapi.ServerResponse{
13604 Header: res.Header,
13605 HTTPStatusCode: res.StatusCode,
13606 },
13607 }
13608 target := &ret
13609 b, err := gensupport.DecodeResponseBytes(target, res)
13610 if err != nil {
13611 return nil, err
13612 }
13613 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceLbPolicies.delete", "response", internallog.HTTPResponse(res, b))
13614 return ret, nil
13615 }
13616
13617 type ProjectsLocationsServiceLbPoliciesGetCall struct {
13618 s *Service
13619 name string
13620 urlParams_ gensupport.URLParams
13621 ifNoneMatch_ string
13622 ctx_ context.Context
13623 header_ http.Header
13624 }
13625
13626 // Get: Gets details of a single ServiceLbPolicy.
13627 //
13628 // - name: A name of the ServiceLbPolicy to get. Must be in the format
13629 // `projects/{project}/locations/{location}/serviceLbPolicies/*`.
13630 func (r *ProjectsLocationsServiceLbPoliciesService) Get(name string) *ProjectsLocationsServiceLbPoliciesGetCall {
13631 c := &ProjectsLocationsServiceLbPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13632 c.name = name
13633 return c
13634 }
13635
13636 // Fields allows partial responses to be retrieved. See
13637 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
13638 // details.
13639 func (c *ProjectsLocationsServiceLbPoliciesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsServiceLbPoliciesGetCall {
13640 c.urlParams_.Set("fields", googleapi.CombineFields(s))
13641 return c
13642 }
13643
13644 // IfNoneMatch sets an optional parameter which makes the operation fail if the
13645 // object's ETag matches the given value. This is useful for getting updates
13646 // only after the object has changed since the last request.
13647 func (c *ProjectsLocationsServiceLbPoliciesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsServiceLbPoliciesGetCall {
13648 c.ifNoneMatch_ = entityTag
13649 return c
13650 }
13651
13652 // Context sets the context to be used in this call's Do method.
13653 func (c *ProjectsLocationsServiceLbPoliciesGetCall) Context(ctx context.Context) *ProjectsLocationsServiceLbPoliciesGetCall {
13654 c.ctx_ = ctx
13655 return c
13656 }
13657
13658 // Header returns a http.Header that can be modified by the caller to add
13659 // headers to the request.
13660 func (c *ProjectsLocationsServiceLbPoliciesGetCall) Header() http.Header {
13661 if c.header_ == nil {
13662 c.header_ = make(http.Header)
13663 }
13664 return c.header_
13665 }
13666
13667 func (c *ProjectsLocationsServiceLbPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
13668 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
13669 if c.ifNoneMatch_ != "" {
13670 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
13671 }
13672 c.urlParams_.Set("alt", alt)
13673 c.urlParams_.Set("prettyPrint", "false")
13674 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
13675 urls += "?" + c.urlParams_.Encode()
13676 req, err := http.NewRequest("GET", urls, nil)
13677 if err != nil {
13678 return nil, err
13679 }
13680 req.Header = reqHeaders
13681 googleapi.Expand(req.URL, map[string]string{
13682 "name": c.name,
13683 })
13684 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceLbPolicies.get", "request", internallog.HTTPRequest(req, nil))
13685 return gensupport.SendRequest(c.ctx_, c.s.client, req)
13686 }
13687
13688 // Do executes the "networkservices.projects.locations.serviceLbPolicies.get" call.
13689 // Any non-2xx status code is an error. Response headers are in either
13690 // *ServiceLbPolicy.ServerResponse.Header or (if a response was returned at
13691 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
13692 // check whether the returned error was because http.StatusNotModified was
13693 // returned.
13694 func (c *ProjectsLocationsServiceLbPoliciesGetCall) Do(opts ...googleapi.CallOption) (*ServiceLbPolicy, error) {
13695 gensupport.SetOptions(c.urlParams_, opts...)
13696 res, err := c.doRequest("json")
13697 if res != nil && res.StatusCode == http.StatusNotModified {
13698 if res.Body != nil {
13699 res.Body.Close()
13700 }
13701 return nil, gensupport.WrapError(&googleapi.Error{
13702 Code: res.StatusCode,
13703 Header: res.Header,
13704 })
13705 }
13706 if err != nil {
13707 return nil, err
13708 }
13709 defer googleapi.CloseBody(res)
13710 if err := googleapi.CheckResponse(res); err != nil {
13711 return nil, gensupport.WrapError(err)
13712 }
13713 ret := &ServiceLbPolicy{
13714 ServerResponse: googleapi.ServerResponse{
13715 Header: res.Header,
13716 HTTPStatusCode: res.StatusCode,
13717 },
13718 }
13719 target := &ret
13720 b, err := gensupport.DecodeResponseBytes(target, res)
13721 if err != nil {
13722 return nil, err
13723 }
13724 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceLbPolicies.get", "response", internallog.HTTPResponse(res, b))
13725 return ret, nil
13726 }
13727
13728 type ProjectsLocationsServiceLbPoliciesListCall struct {
13729 s *Service
13730 parent string
13731 urlParams_ gensupport.URLParams
13732 ifNoneMatch_ string
13733 ctx_ context.Context
13734 header_ http.Header
13735 }
13736
13737 // List: Lists ServiceLbPolicies in a given project and location.
13738 //
13739 // - parent: The project and location from which the ServiceLbPolicies should
13740 // be listed, specified in the format
13741 // `projects/{project}/locations/{location}`.
13742 func (r *ProjectsLocationsServiceLbPoliciesService) List(parent string) *ProjectsLocationsServiceLbPoliciesListCall {
13743 c := &ProjectsLocationsServiceLbPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13744 c.parent = parent
13745 return c
13746 }
13747
13748 // PageSize sets the optional parameter "pageSize": Maximum number of
13749 // ServiceLbPolicies to return per call.
13750 func (c *ProjectsLocationsServiceLbPoliciesListCall) PageSize(pageSize int64) *ProjectsLocationsServiceLbPoliciesListCall {
13751 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
13752 return c
13753 }
13754
13755 // PageToken sets the optional parameter "pageToken": The value returned by the
13756 // last `ListServiceLbPoliciesResponse` Indicates that this is a continuation
13757 // of a prior `ListRouters` call, and that the system should return the next
13758 // page of data.
13759 func (c *ProjectsLocationsServiceLbPoliciesListCall) PageToken(pageToken string) *ProjectsLocationsServiceLbPoliciesListCall {
13760 c.urlParams_.Set("pageToken", pageToken)
13761 return c
13762 }
13763
13764 // Fields allows partial responses to be retrieved. See
13765 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
13766 // details.
13767 func (c *ProjectsLocationsServiceLbPoliciesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsServiceLbPoliciesListCall {
13768 c.urlParams_.Set("fields", googleapi.CombineFields(s))
13769 return c
13770 }
13771
13772 // IfNoneMatch sets an optional parameter which makes the operation fail if the
13773 // object's ETag matches the given value. This is useful for getting updates
13774 // only after the object has changed since the last request.
13775 func (c *ProjectsLocationsServiceLbPoliciesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsServiceLbPoliciesListCall {
13776 c.ifNoneMatch_ = entityTag
13777 return c
13778 }
13779
13780 // Context sets the context to be used in this call's Do method.
13781 func (c *ProjectsLocationsServiceLbPoliciesListCall) Context(ctx context.Context) *ProjectsLocationsServiceLbPoliciesListCall {
13782 c.ctx_ = ctx
13783 return c
13784 }
13785
13786 // Header returns a http.Header that can be modified by the caller to add
13787 // headers to the request.
13788 func (c *ProjectsLocationsServiceLbPoliciesListCall) Header() http.Header {
13789 if c.header_ == nil {
13790 c.header_ = make(http.Header)
13791 }
13792 return c.header_
13793 }
13794
13795 func (c *ProjectsLocationsServiceLbPoliciesListCall) doRequest(alt string) (*http.Response, error) {
13796 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
13797 if c.ifNoneMatch_ != "" {
13798 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
13799 }
13800 c.urlParams_.Set("alt", alt)
13801 c.urlParams_.Set("prettyPrint", "false")
13802 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/serviceLbPolicies")
13803 urls += "?" + c.urlParams_.Encode()
13804 req, err := http.NewRequest("GET", urls, nil)
13805 if err != nil {
13806 return nil, err
13807 }
13808 req.Header = reqHeaders
13809 googleapi.Expand(req.URL, map[string]string{
13810 "parent": c.parent,
13811 })
13812 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceLbPolicies.list", "request", internallog.HTTPRequest(req, nil))
13813 return gensupport.SendRequest(c.ctx_, c.s.client, req)
13814 }
13815
13816 // Do executes the "networkservices.projects.locations.serviceLbPolicies.list" call.
13817 // Any non-2xx status code is an error. Response headers are in either
13818 // *ListServiceLbPoliciesResponse.ServerResponse.Header or (if a response was
13819 // returned at all) in error.(*googleapi.Error).Header. Use
13820 // googleapi.IsNotModified to check whether the returned error was because
13821 // http.StatusNotModified was returned.
13822 func (c *ProjectsLocationsServiceLbPoliciesListCall) Do(opts ...googleapi.CallOption) (*ListServiceLbPoliciesResponse, error) {
13823 gensupport.SetOptions(c.urlParams_, opts...)
13824 res, err := c.doRequest("json")
13825 if res != nil && res.StatusCode == http.StatusNotModified {
13826 if res.Body != nil {
13827 res.Body.Close()
13828 }
13829 return nil, gensupport.WrapError(&googleapi.Error{
13830 Code: res.StatusCode,
13831 Header: res.Header,
13832 })
13833 }
13834 if err != nil {
13835 return nil, err
13836 }
13837 defer googleapi.CloseBody(res)
13838 if err := googleapi.CheckResponse(res); err != nil {
13839 return nil, gensupport.WrapError(err)
13840 }
13841 ret := &ListServiceLbPoliciesResponse{
13842 ServerResponse: googleapi.ServerResponse{
13843 Header: res.Header,
13844 HTTPStatusCode: res.StatusCode,
13845 },
13846 }
13847 target := &ret
13848 b, err := gensupport.DecodeResponseBytes(target, res)
13849 if err != nil {
13850 return nil, err
13851 }
13852 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceLbPolicies.list", "response", internallog.HTTPResponse(res, b))
13853 return ret, nil
13854 }
13855
13856 // Pages invokes f for each page of results.
13857 // A non-nil error returned from f will halt the iteration.
13858 // The provided context supersedes any context provided to the Context method.
13859 func (c *ProjectsLocationsServiceLbPoliciesListCall) Pages(ctx context.Context, f func(*ListServiceLbPoliciesResponse) error) error {
13860 c.ctx_ = ctx
13861 defer c.PageToken(c.urlParams_.Get("pageToken"))
13862 for {
13863 x, err := c.Do()
13864 if err != nil {
13865 return err
13866 }
13867 if err := f(x); err != nil {
13868 return err
13869 }
13870 if x.NextPageToken == "" {
13871 return nil
13872 }
13873 c.PageToken(x.NextPageToken)
13874 }
13875 }
13876
13877 type ProjectsLocationsServiceLbPoliciesPatchCall struct {
13878 s *Service
13879 name string
13880 servicelbpolicy *ServiceLbPolicy
13881 urlParams_ gensupport.URLParams
13882 ctx_ context.Context
13883 header_ http.Header
13884 }
13885
13886 // Patch: Updates the parameters of a single ServiceLbPolicy.
13887 //
13888 // - name: Identifier. Name of the ServiceLbPolicy resource. It matches pattern
13889 // `projects/{project}/locations/{location}/serviceLbPolicies/{service_lb_poli
13890 // cy_name}`.
13891 func (r *ProjectsLocationsServiceLbPoliciesService) Patch(name string, servicelbpolicy *ServiceLbPolicy) *ProjectsLocationsServiceLbPoliciesPatchCall {
13892 c := &ProjectsLocationsServiceLbPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13893 c.name = name
13894 c.servicelbpolicy = servicelbpolicy
13895 return c
13896 }
13897
13898 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
13899 // specify the fields to be overwritten in the ServiceLbPolicy resource by the
13900 // update. The fields specified in the update_mask are relative to the
13901 // resource, not the full request. A field will be overwritten if it is in the
13902 // mask. If the user does not provide a mask then all fields will be
13903 // overwritten.
13904 func (c *ProjectsLocationsServiceLbPoliciesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsServiceLbPoliciesPatchCall {
13905 c.urlParams_.Set("updateMask", updateMask)
13906 return c
13907 }
13908
13909 // Fields allows partial responses to be retrieved. See
13910 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
13911 // details.
13912 func (c *ProjectsLocationsServiceLbPoliciesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsServiceLbPoliciesPatchCall {
13913 c.urlParams_.Set("fields", googleapi.CombineFields(s))
13914 return c
13915 }
13916
13917 // Context sets the context to be used in this call's Do method.
13918 func (c *ProjectsLocationsServiceLbPoliciesPatchCall) Context(ctx context.Context) *ProjectsLocationsServiceLbPoliciesPatchCall {
13919 c.ctx_ = ctx
13920 return c
13921 }
13922
13923 // Header returns a http.Header that can be modified by the caller to add
13924 // headers to the request.
13925 func (c *ProjectsLocationsServiceLbPoliciesPatchCall) Header() http.Header {
13926 if c.header_ == nil {
13927 c.header_ = make(http.Header)
13928 }
13929 return c.header_
13930 }
13931
13932 func (c *ProjectsLocationsServiceLbPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
13933 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
13934 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.servicelbpolicy)
13935 if err != nil {
13936 return nil, err
13937 }
13938 c.urlParams_.Set("alt", alt)
13939 c.urlParams_.Set("prettyPrint", "false")
13940 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
13941 urls += "?" + c.urlParams_.Encode()
13942 req, err := http.NewRequest("PATCH", urls, body)
13943 if err != nil {
13944 return nil, err
13945 }
13946 req.Header = reqHeaders
13947 googleapi.Expand(req.URL, map[string]string{
13948 "name": c.name,
13949 })
13950 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceLbPolicies.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
13951 return gensupport.SendRequest(c.ctx_, c.s.client, req)
13952 }
13953
13954 // Do executes the "networkservices.projects.locations.serviceLbPolicies.patch" call.
13955 // Any non-2xx status code is an error. Response headers are in either
13956 // *Operation.ServerResponse.Header or (if a response was returned at all) in
13957 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
13958 // whether the returned error was because http.StatusNotModified was returned.
13959 func (c *ProjectsLocationsServiceLbPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
13960 gensupport.SetOptions(c.urlParams_, opts...)
13961 res, err := c.doRequest("json")
13962 if res != nil && res.StatusCode == http.StatusNotModified {
13963 if res.Body != nil {
13964 res.Body.Close()
13965 }
13966 return nil, gensupport.WrapError(&googleapi.Error{
13967 Code: res.StatusCode,
13968 Header: res.Header,
13969 })
13970 }
13971 if err != nil {
13972 return nil, err
13973 }
13974 defer googleapi.CloseBody(res)
13975 if err := googleapi.CheckResponse(res); err != nil {
13976 return nil, gensupport.WrapError(err)
13977 }
13978 ret := &Operation{
13979 ServerResponse: googleapi.ServerResponse{
13980 Header: res.Header,
13981 HTTPStatusCode: res.StatusCode,
13982 },
13983 }
13984 target := &ret
13985 b, err := gensupport.DecodeResponseBytes(target, res)
13986 if err != nil {
13987 return nil, err
13988 }
13989 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.serviceLbPolicies.patch", "response", internallog.HTTPResponse(res, b))
13990 return ret, nil
13991 }
13992
13993 type ProjectsLocationsTcpRoutesCreateCall struct {
13994 s *Service
13995 parent string
13996 tcproute *TcpRoute
13997 urlParams_ gensupport.URLParams
13998 ctx_ context.Context
13999 header_ http.Header
14000 }
14001
14002 // Create: Creates a new TcpRoute in a given project and location.
14003 //
14004 // - parent: The parent resource of the TcpRoute. Must be in the format
14005 // `projects/*/locations/*`.
14006 func (r *ProjectsLocationsTcpRoutesService) Create(parent string, tcproute *TcpRoute) *ProjectsLocationsTcpRoutesCreateCall {
14007 c := &ProjectsLocationsTcpRoutesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14008 c.parent = parent
14009 c.tcproute = tcproute
14010 return c
14011 }
14012
14013 // TcpRouteId sets the optional parameter "tcpRouteId": Required. Short name of
14014 // the TcpRoute resource to be created.
14015 func (c *ProjectsLocationsTcpRoutesCreateCall) TcpRouteId(tcpRouteId string) *ProjectsLocationsTcpRoutesCreateCall {
14016 c.urlParams_.Set("tcpRouteId", tcpRouteId)
14017 return c
14018 }
14019
14020 // Fields allows partial responses to be retrieved. See
14021 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
14022 // details.
14023 func (c *ProjectsLocationsTcpRoutesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsTcpRoutesCreateCall {
14024 c.urlParams_.Set("fields", googleapi.CombineFields(s))
14025 return c
14026 }
14027
14028 // Context sets the context to be used in this call's Do method.
14029 func (c *ProjectsLocationsTcpRoutesCreateCall) Context(ctx context.Context) *ProjectsLocationsTcpRoutesCreateCall {
14030 c.ctx_ = ctx
14031 return c
14032 }
14033
14034 // Header returns a http.Header that can be modified by the caller to add
14035 // headers to the request.
14036 func (c *ProjectsLocationsTcpRoutesCreateCall) Header() http.Header {
14037 if c.header_ == nil {
14038 c.header_ = make(http.Header)
14039 }
14040 return c.header_
14041 }
14042
14043 func (c *ProjectsLocationsTcpRoutesCreateCall) doRequest(alt string) (*http.Response, error) {
14044 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
14045 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tcproute)
14046 if err != nil {
14047 return nil, err
14048 }
14049 c.urlParams_.Set("alt", alt)
14050 c.urlParams_.Set("prettyPrint", "false")
14051 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/tcpRoutes")
14052 urls += "?" + c.urlParams_.Encode()
14053 req, err := http.NewRequest("POST", urls, body)
14054 if err != nil {
14055 return nil, err
14056 }
14057 req.Header = reqHeaders
14058 googleapi.Expand(req.URL, map[string]string{
14059 "parent": c.parent,
14060 })
14061 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tcpRoutes.create", "request", internallog.HTTPRequest(req, body.Bytes()))
14062 return gensupport.SendRequest(c.ctx_, c.s.client, req)
14063 }
14064
14065 // Do executes the "networkservices.projects.locations.tcpRoutes.create" call.
14066 // Any non-2xx status code is an error. Response headers are in either
14067 // *Operation.ServerResponse.Header or (if a response was returned at all) in
14068 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
14069 // whether the returned error was because http.StatusNotModified was returned.
14070 func (c *ProjectsLocationsTcpRoutesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
14071 gensupport.SetOptions(c.urlParams_, opts...)
14072 res, err := c.doRequest("json")
14073 if res != nil && res.StatusCode == http.StatusNotModified {
14074 if res.Body != nil {
14075 res.Body.Close()
14076 }
14077 return nil, gensupport.WrapError(&googleapi.Error{
14078 Code: res.StatusCode,
14079 Header: res.Header,
14080 })
14081 }
14082 if err != nil {
14083 return nil, err
14084 }
14085 defer googleapi.CloseBody(res)
14086 if err := googleapi.CheckResponse(res); err != nil {
14087 return nil, gensupport.WrapError(err)
14088 }
14089 ret := &Operation{
14090 ServerResponse: googleapi.ServerResponse{
14091 Header: res.Header,
14092 HTTPStatusCode: res.StatusCode,
14093 },
14094 }
14095 target := &ret
14096 b, err := gensupport.DecodeResponseBytes(target, res)
14097 if err != nil {
14098 return nil, err
14099 }
14100 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tcpRoutes.create", "response", internallog.HTTPResponse(res, b))
14101 return ret, nil
14102 }
14103
14104 type ProjectsLocationsTcpRoutesDeleteCall struct {
14105 s *Service
14106 name string
14107 urlParams_ gensupport.URLParams
14108 ctx_ context.Context
14109 header_ http.Header
14110 }
14111
14112 // Delete: Deletes a single TcpRoute.
14113 //
14114 // - name: A name of the TcpRoute to delete. Must be in the format
14115 // `projects/*/locations/*/tcpRoutes/*`.
14116 func (r *ProjectsLocationsTcpRoutesService) Delete(name string) *ProjectsLocationsTcpRoutesDeleteCall {
14117 c := &ProjectsLocationsTcpRoutesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14118 c.name = name
14119 return c
14120 }
14121
14122 // Fields allows partial responses to be retrieved. See
14123 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
14124 // details.
14125 func (c *ProjectsLocationsTcpRoutesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsTcpRoutesDeleteCall {
14126 c.urlParams_.Set("fields", googleapi.CombineFields(s))
14127 return c
14128 }
14129
14130 // Context sets the context to be used in this call's Do method.
14131 func (c *ProjectsLocationsTcpRoutesDeleteCall) Context(ctx context.Context) *ProjectsLocationsTcpRoutesDeleteCall {
14132 c.ctx_ = ctx
14133 return c
14134 }
14135
14136 // Header returns a http.Header that can be modified by the caller to add
14137 // headers to the request.
14138 func (c *ProjectsLocationsTcpRoutesDeleteCall) Header() http.Header {
14139 if c.header_ == nil {
14140 c.header_ = make(http.Header)
14141 }
14142 return c.header_
14143 }
14144
14145 func (c *ProjectsLocationsTcpRoutesDeleteCall) doRequest(alt string) (*http.Response, error) {
14146 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
14147 c.urlParams_.Set("alt", alt)
14148 c.urlParams_.Set("prettyPrint", "false")
14149 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
14150 urls += "?" + c.urlParams_.Encode()
14151 req, err := http.NewRequest("DELETE", urls, nil)
14152 if err != nil {
14153 return nil, err
14154 }
14155 req.Header = reqHeaders
14156 googleapi.Expand(req.URL, map[string]string{
14157 "name": c.name,
14158 })
14159 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tcpRoutes.delete", "request", internallog.HTTPRequest(req, nil))
14160 return gensupport.SendRequest(c.ctx_, c.s.client, req)
14161 }
14162
14163 // Do executes the "networkservices.projects.locations.tcpRoutes.delete" call.
14164 // Any non-2xx status code is an error. Response headers are in either
14165 // *Operation.ServerResponse.Header or (if a response was returned at all) in
14166 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
14167 // whether the returned error was because http.StatusNotModified was returned.
14168 func (c *ProjectsLocationsTcpRoutesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
14169 gensupport.SetOptions(c.urlParams_, opts...)
14170 res, err := c.doRequest("json")
14171 if res != nil && res.StatusCode == http.StatusNotModified {
14172 if res.Body != nil {
14173 res.Body.Close()
14174 }
14175 return nil, gensupport.WrapError(&googleapi.Error{
14176 Code: res.StatusCode,
14177 Header: res.Header,
14178 })
14179 }
14180 if err != nil {
14181 return nil, err
14182 }
14183 defer googleapi.CloseBody(res)
14184 if err := googleapi.CheckResponse(res); err != nil {
14185 return nil, gensupport.WrapError(err)
14186 }
14187 ret := &Operation{
14188 ServerResponse: googleapi.ServerResponse{
14189 Header: res.Header,
14190 HTTPStatusCode: res.StatusCode,
14191 },
14192 }
14193 target := &ret
14194 b, err := gensupport.DecodeResponseBytes(target, res)
14195 if err != nil {
14196 return nil, err
14197 }
14198 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tcpRoutes.delete", "response", internallog.HTTPResponse(res, b))
14199 return ret, nil
14200 }
14201
14202 type ProjectsLocationsTcpRoutesGetCall struct {
14203 s *Service
14204 name string
14205 urlParams_ gensupport.URLParams
14206 ifNoneMatch_ string
14207 ctx_ context.Context
14208 header_ http.Header
14209 }
14210
14211 // Get: Gets details of a single TcpRoute.
14212 //
14213 // - name: A name of the TcpRoute to get. Must be in the format
14214 // `projects/*/locations/*/tcpRoutes/*`.
14215 func (r *ProjectsLocationsTcpRoutesService) Get(name string) *ProjectsLocationsTcpRoutesGetCall {
14216 c := &ProjectsLocationsTcpRoutesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14217 c.name = name
14218 return c
14219 }
14220
14221 // Fields allows partial responses to be retrieved. See
14222 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
14223 // details.
14224 func (c *ProjectsLocationsTcpRoutesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsTcpRoutesGetCall {
14225 c.urlParams_.Set("fields", googleapi.CombineFields(s))
14226 return c
14227 }
14228
14229 // IfNoneMatch sets an optional parameter which makes the operation fail if the
14230 // object's ETag matches the given value. This is useful for getting updates
14231 // only after the object has changed since the last request.
14232 func (c *ProjectsLocationsTcpRoutesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsTcpRoutesGetCall {
14233 c.ifNoneMatch_ = entityTag
14234 return c
14235 }
14236
14237 // Context sets the context to be used in this call's Do method.
14238 func (c *ProjectsLocationsTcpRoutesGetCall) Context(ctx context.Context) *ProjectsLocationsTcpRoutesGetCall {
14239 c.ctx_ = ctx
14240 return c
14241 }
14242
14243 // Header returns a http.Header that can be modified by the caller to add
14244 // headers to the request.
14245 func (c *ProjectsLocationsTcpRoutesGetCall) Header() http.Header {
14246 if c.header_ == nil {
14247 c.header_ = make(http.Header)
14248 }
14249 return c.header_
14250 }
14251
14252 func (c *ProjectsLocationsTcpRoutesGetCall) doRequest(alt string) (*http.Response, error) {
14253 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
14254 if c.ifNoneMatch_ != "" {
14255 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
14256 }
14257 c.urlParams_.Set("alt", alt)
14258 c.urlParams_.Set("prettyPrint", "false")
14259 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
14260 urls += "?" + c.urlParams_.Encode()
14261 req, err := http.NewRequest("GET", urls, nil)
14262 if err != nil {
14263 return nil, err
14264 }
14265 req.Header = reqHeaders
14266 googleapi.Expand(req.URL, map[string]string{
14267 "name": c.name,
14268 })
14269 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tcpRoutes.get", "request", internallog.HTTPRequest(req, nil))
14270 return gensupport.SendRequest(c.ctx_, c.s.client, req)
14271 }
14272
14273 // Do executes the "networkservices.projects.locations.tcpRoutes.get" call.
14274 // Any non-2xx status code is an error. Response headers are in either
14275 // *TcpRoute.ServerResponse.Header or (if a response was returned at all) in
14276 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
14277 // whether the returned error was because http.StatusNotModified was returned.
14278 func (c *ProjectsLocationsTcpRoutesGetCall) Do(opts ...googleapi.CallOption) (*TcpRoute, error) {
14279 gensupport.SetOptions(c.urlParams_, opts...)
14280 res, err := c.doRequest("json")
14281 if res != nil && res.StatusCode == http.StatusNotModified {
14282 if res.Body != nil {
14283 res.Body.Close()
14284 }
14285 return nil, gensupport.WrapError(&googleapi.Error{
14286 Code: res.StatusCode,
14287 Header: res.Header,
14288 })
14289 }
14290 if err != nil {
14291 return nil, err
14292 }
14293 defer googleapi.CloseBody(res)
14294 if err := googleapi.CheckResponse(res); err != nil {
14295 return nil, gensupport.WrapError(err)
14296 }
14297 ret := &TcpRoute{
14298 ServerResponse: googleapi.ServerResponse{
14299 Header: res.Header,
14300 HTTPStatusCode: res.StatusCode,
14301 },
14302 }
14303 target := &ret
14304 b, err := gensupport.DecodeResponseBytes(target, res)
14305 if err != nil {
14306 return nil, err
14307 }
14308 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tcpRoutes.get", "response", internallog.HTTPResponse(res, b))
14309 return ret, nil
14310 }
14311
14312 type ProjectsLocationsTcpRoutesListCall struct {
14313 s *Service
14314 parent string
14315 urlParams_ gensupport.URLParams
14316 ifNoneMatch_ string
14317 ctx_ context.Context
14318 header_ http.Header
14319 }
14320
14321 // List: Lists TcpRoute in a given project and location.
14322 //
14323 // - parent: The project and location from which the TcpRoutes should be
14324 // listed, specified in the format `projects/*/locations/*`.
14325 func (r *ProjectsLocationsTcpRoutesService) List(parent string) *ProjectsLocationsTcpRoutesListCall {
14326 c := &ProjectsLocationsTcpRoutesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14327 c.parent = parent
14328 return c
14329 }
14330
14331 // PageSize sets the optional parameter "pageSize": Maximum number of TcpRoutes
14332 // to return per call.
14333 func (c *ProjectsLocationsTcpRoutesListCall) PageSize(pageSize int64) *ProjectsLocationsTcpRoutesListCall {
14334 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
14335 return c
14336 }
14337
14338 // PageToken sets the optional parameter "pageToken": The value returned by the
14339 // last `ListTcpRoutesResponse` Indicates that this is a continuation of a
14340 // prior `ListTcpRoutes` call, and that the system should return the next page
14341 // of data.
14342 func (c *ProjectsLocationsTcpRoutesListCall) PageToken(pageToken string) *ProjectsLocationsTcpRoutesListCall {
14343 c.urlParams_.Set("pageToken", pageToken)
14344 return c
14345 }
14346
14347 // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": If
14348 // true, allow partial responses for multi-regional Aggregated List requests.
14349 // Otherwise if one of the locations is down or unreachable, the Aggregated
14350 // List request will fail.
14351 func (c *ProjectsLocationsTcpRoutesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ProjectsLocationsTcpRoutesListCall {
14352 c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
14353 return c
14354 }
14355
14356 // Fields allows partial responses to be retrieved. See
14357 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
14358 // details.
14359 func (c *ProjectsLocationsTcpRoutesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsTcpRoutesListCall {
14360 c.urlParams_.Set("fields", googleapi.CombineFields(s))
14361 return c
14362 }
14363
14364 // IfNoneMatch sets an optional parameter which makes the operation fail if the
14365 // object's ETag matches the given value. This is useful for getting updates
14366 // only after the object has changed since the last request.
14367 func (c *ProjectsLocationsTcpRoutesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsTcpRoutesListCall {
14368 c.ifNoneMatch_ = entityTag
14369 return c
14370 }
14371
14372 // Context sets the context to be used in this call's Do method.
14373 func (c *ProjectsLocationsTcpRoutesListCall) Context(ctx context.Context) *ProjectsLocationsTcpRoutesListCall {
14374 c.ctx_ = ctx
14375 return c
14376 }
14377
14378 // Header returns a http.Header that can be modified by the caller to add
14379 // headers to the request.
14380 func (c *ProjectsLocationsTcpRoutesListCall) Header() http.Header {
14381 if c.header_ == nil {
14382 c.header_ = make(http.Header)
14383 }
14384 return c.header_
14385 }
14386
14387 func (c *ProjectsLocationsTcpRoutesListCall) doRequest(alt string) (*http.Response, error) {
14388 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
14389 if c.ifNoneMatch_ != "" {
14390 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
14391 }
14392 c.urlParams_.Set("alt", alt)
14393 c.urlParams_.Set("prettyPrint", "false")
14394 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/tcpRoutes")
14395 urls += "?" + c.urlParams_.Encode()
14396 req, err := http.NewRequest("GET", urls, nil)
14397 if err != nil {
14398 return nil, err
14399 }
14400 req.Header = reqHeaders
14401 googleapi.Expand(req.URL, map[string]string{
14402 "parent": c.parent,
14403 })
14404 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tcpRoutes.list", "request", internallog.HTTPRequest(req, nil))
14405 return gensupport.SendRequest(c.ctx_, c.s.client, req)
14406 }
14407
14408 // Do executes the "networkservices.projects.locations.tcpRoutes.list" call.
14409 // Any non-2xx status code is an error. Response headers are in either
14410 // *ListTcpRoutesResponse.ServerResponse.Header or (if a response was returned
14411 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
14412 // check whether the returned error was because http.StatusNotModified was
14413 // returned.
14414 func (c *ProjectsLocationsTcpRoutesListCall) Do(opts ...googleapi.CallOption) (*ListTcpRoutesResponse, error) {
14415 gensupport.SetOptions(c.urlParams_, opts...)
14416 res, err := c.doRequest("json")
14417 if res != nil && res.StatusCode == http.StatusNotModified {
14418 if res.Body != nil {
14419 res.Body.Close()
14420 }
14421 return nil, gensupport.WrapError(&googleapi.Error{
14422 Code: res.StatusCode,
14423 Header: res.Header,
14424 })
14425 }
14426 if err != nil {
14427 return nil, err
14428 }
14429 defer googleapi.CloseBody(res)
14430 if err := googleapi.CheckResponse(res); err != nil {
14431 return nil, gensupport.WrapError(err)
14432 }
14433 ret := &ListTcpRoutesResponse{
14434 ServerResponse: googleapi.ServerResponse{
14435 Header: res.Header,
14436 HTTPStatusCode: res.StatusCode,
14437 },
14438 }
14439 target := &ret
14440 b, err := gensupport.DecodeResponseBytes(target, res)
14441 if err != nil {
14442 return nil, err
14443 }
14444 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tcpRoutes.list", "response", internallog.HTTPResponse(res, b))
14445 return ret, nil
14446 }
14447
14448 // Pages invokes f for each page of results.
14449 // A non-nil error returned from f will halt the iteration.
14450 // The provided context supersedes any context provided to the Context method.
14451 func (c *ProjectsLocationsTcpRoutesListCall) Pages(ctx context.Context, f func(*ListTcpRoutesResponse) error) error {
14452 c.ctx_ = ctx
14453 defer c.PageToken(c.urlParams_.Get("pageToken"))
14454 for {
14455 x, err := c.Do()
14456 if err != nil {
14457 return err
14458 }
14459 if err := f(x); err != nil {
14460 return err
14461 }
14462 if x.NextPageToken == "" {
14463 return nil
14464 }
14465 c.PageToken(x.NextPageToken)
14466 }
14467 }
14468
14469 type ProjectsLocationsTcpRoutesPatchCall struct {
14470 s *Service
14471 name string
14472 tcproute *TcpRoute
14473 urlParams_ gensupport.URLParams
14474 ctx_ context.Context
14475 header_ http.Header
14476 }
14477
14478 // Patch: Updates the parameters of a single TcpRoute.
14479 //
14480 // - name: Identifier. Name of the TcpRoute resource. It matches pattern
14481 // `projects/*/locations/*/tcpRoutes/tcp_route_name>`.
14482 func (r *ProjectsLocationsTcpRoutesService) Patch(name string, tcproute *TcpRoute) *ProjectsLocationsTcpRoutesPatchCall {
14483 c := &ProjectsLocationsTcpRoutesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14484 c.name = name
14485 c.tcproute = tcproute
14486 return c
14487 }
14488
14489 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
14490 // specify the fields to be overwritten in the TcpRoute resource by the update.
14491 // The fields specified in the update_mask are relative to the resource, not
14492 // the full request. A field will be overwritten if it is in the mask. If the
14493 // user does not provide a mask then all fields will be overwritten.
14494 func (c *ProjectsLocationsTcpRoutesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsTcpRoutesPatchCall {
14495 c.urlParams_.Set("updateMask", updateMask)
14496 return c
14497 }
14498
14499 // Fields allows partial responses to be retrieved. See
14500 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
14501 // details.
14502 func (c *ProjectsLocationsTcpRoutesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsTcpRoutesPatchCall {
14503 c.urlParams_.Set("fields", googleapi.CombineFields(s))
14504 return c
14505 }
14506
14507 // Context sets the context to be used in this call's Do method.
14508 func (c *ProjectsLocationsTcpRoutesPatchCall) Context(ctx context.Context) *ProjectsLocationsTcpRoutesPatchCall {
14509 c.ctx_ = ctx
14510 return c
14511 }
14512
14513 // Header returns a http.Header that can be modified by the caller to add
14514 // headers to the request.
14515 func (c *ProjectsLocationsTcpRoutesPatchCall) Header() http.Header {
14516 if c.header_ == nil {
14517 c.header_ = make(http.Header)
14518 }
14519 return c.header_
14520 }
14521
14522 func (c *ProjectsLocationsTcpRoutesPatchCall) doRequest(alt string) (*http.Response, error) {
14523 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
14524 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tcproute)
14525 if err != nil {
14526 return nil, err
14527 }
14528 c.urlParams_.Set("alt", alt)
14529 c.urlParams_.Set("prettyPrint", "false")
14530 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
14531 urls += "?" + c.urlParams_.Encode()
14532 req, err := http.NewRequest("PATCH", urls, body)
14533 if err != nil {
14534 return nil, err
14535 }
14536 req.Header = reqHeaders
14537 googleapi.Expand(req.URL, map[string]string{
14538 "name": c.name,
14539 })
14540 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tcpRoutes.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
14541 return gensupport.SendRequest(c.ctx_, c.s.client, req)
14542 }
14543
14544 // Do executes the "networkservices.projects.locations.tcpRoutes.patch" call.
14545 // Any non-2xx status code is an error. Response headers are in either
14546 // *Operation.ServerResponse.Header or (if a response was returned at all) in
14547 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
14548 // whether the returned error was because http.StatusNotModified was returned.
14549 func (c *ProjectsLocationsTcpRoutesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
14550 gensupport.SetOptions(c.urlParams_, opts...)
14551 res, err := c.doRequest("json")
14552 if res != nil && res.StatusCode == http.StatusNotModified {
14553 if res.Body != nil {
14554 res.Body.Close()
14555 }
14556 return nil, gensupport.WrapError(&googleapi.Error{
14557 Code: res.StatusCode,
14558 Header: res.Header,
14559 })
14560 }
14561 if err != nil {
14562 return nil, err
14563 }
14564 defer googleapi.CloseBody(res)
14565 if err := googleapi.CheckResponse(res); err != nil {
14566 return nil, gensupport.WrapError(err)
14567 }
14568 ret := &Operation{
14569 ServerResponse: googleapi.ServerResponse{
14570 Header: res.Header,
14571 HTTPStatusCode: res.StatusCode,
14572 },
14573 }
14574 target := &ret
14575 b, err := gensupport.DecodeResponseBytes(target, res)
14576 if err != nil {
14577 return nil, err
14578 }
14579 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tcpRoutes.patch", "response", internallog.HTTPResponse(res, b))
14580 return ret, nil
14581 }
14582
14583 type ProjectsLocationsTlsRoutesCreateCall struct {
14584 s *Service
14585 parent string
14586 tlsroute *TlsRoute
14587 urlParams_ gensupport.URLParams
14588 ctx_ context.Context
14589 header_ http.Header
14590 }
14591
14592 // Create: Creates a new TlsRoute in a given project and location.
14593 //
14594 // - parent: The parent resource of the TlsRoute. Must be in the format
14595 // `projects/*/locations/*`.
14596 func (r *ProjectsLocationsTlsRoutesService) Create(parent string, tlsroute *TlsRoute) *ProjectsLocationsTlsRoutesCreateCall {
14597 c := &ProjectsLocationsTlsRoutesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14598 c.parent = parent
14599 c.tlsroute = tlsroute
14600 return c
14601 }
14602
14603 // TlsRouteId sets the optional parameter "tlsRouteId": Required. Short name of
14604 // the TlsRoute resource to be created.
14605 func (c *ProjectsLocationsTlsRoutesCreateCall) TlsRouteId(tlsRouteId string) *ProjectsLocationsTlsRoutesCreateCall {
14606 c.urlParams_.Set("tlsRouteId", tlsRouteId)
14607 return c
14608 }
14609
14610 // Fields allows partial responses to be retrieved. See
14611 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
14612 // details.
14613 func (c *ProjectsLocationsTlsRoutesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsTlsRoutesCreateCall {
14614 c.urlParams_.Set("fields", googleapi.CombineFields(s))
14615 return c
14616 }
14617
14618 // Context sets the context to be used in this call's Do method.
14619 func (c *ProjectsLocationsTlsRoutesCreateCall) Context(ctx context.Context) *ProjectsLocationsTlsRoutesCreateCall {
14620 c.ctx_ = ctx
14621 return c
14622 }
14623
14624 // Header returns a http.Header that can be modified by the caller to add
14625 // headers to the request.
14626 func (c *ProjectsLocationsTlsRoutesCreateCall) Header() http.Header {
14627 if c.header_ == nil {
14628 c.header_ = make(http.Header)
14629 }
14630 return c.header_
14631 }
14632
14633 func (c *ProjectsLocationsTlsRoutesCreateCall) doRequest(alt string) (*http.Response, error) {
14634 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
14635 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tlsroute)
14636 if err != nil {
14637 return nil, err
14638 }
14639 c.urlParams_.Set("alt", alt)
14640 c.urlParams_.Set("prettyPrint", "false")
14641 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/tlsRoutes")
14642 urls += "?" + c.urlParams_.Encode()
14643 req, err := http.NewRequest("POST", urls, body)
14644 if err != nil {
14645 return nil, err
14646 }
14647 req.Header = reqHeaders
14648 googleapi.Expand(req.URL, map[string]string{
14649 "parent": c.parent,
14650 })
14651 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tlsRoutes.create", "request", internallog.HTTPRequest(req, body.Bytes()))
14652 return gensupport.SendRequest(c.ctx_, c.s.client, req)
14653 }
14654
14655 // Do executes the "networkservices.projects.locations.tlsRoutes.create" call.
14656 // Any non-2xx status code is an error. Response headers are in either
14657 // *Operation.ServerResponse.Header or (if a response was returned at all) in
14658 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
14659 // whether the returned error was because http.StatusNotModified was returned.
14660 func (c *ProjectsLocationsTlsRoutesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
14661 gensupport.SetOptions(c.urlParams_, opts...)
14662 res, err := c.doRequest("json")
14663 if res != nil && res.StatusCode == http.StatusNotModified {
14664 if res.Body != nil {
14665 res.Body.Close()
14666 }
14667 return nil, gensupport.WrapError(&googleapi.Error{
14668 Code: res.StatusCode,
14669 Header: res.Header,
14670 })
14671 }
14672 if err != nil {
14673 return nil, err
14674 }
14675 defer googleapi.CloseBody(res)
14676 if err := googleapi.CheckResponse(res); err != nil {
14677 return nil, gensupport.WrapError(err)
14678 }
14679 ret := &Operation{
14680 ServerResponse: googleapi.ServerResponse{
14681 Header: res.Header,
14682 HTTPStatusCode: res.StatusCode,
14683 },
14684 }
14685 target := &ret
14686 b, err := gensupport.DecodeResponseBytes(target, res)
14687 if err != nil {
14688 return nil, err
14689 }
14690 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tlsRoutes.create", "response", internallog.HTTPResponse(res, b))
14691 return ret, nil
14692 }
14693
14694 type ProjectsLocationsTlsRoutesDeleteCall struct {
14695 s *Service
14696 name string
14697 urlParams_ gensupport.URLParams
14698 ctx_ context.Context
14699 header_ http.Header
14700 }
14701
14702 // Delete: Deletes a single TlsRoute.
14703 //
14704 // - name: A name of the TlsRoute to delete. Must be in the format
14705 // `projects/*/locations/*/tlsRoutes/*`.
14706 func (r *ProjectsLocationsTlsRoutesService) Delete(name string) *ProjectsLocationsTlsRoutesDeleteCall {
14707 c := &ProjectsLocationsTlsRoutesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14708 c.name = name
14709 return c
14710 }
14711
14712 // Fields allows partial responses to be retrieved. See
14713 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
14714 // details.
14715 func (c *ProjectsLocationsTlsRoutesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsTlsRoutesDeleteCall {
14716 c.urlParams_.Set("fields", googleapi.CombineFields(s))
14717 return c
14718 }
14719
14720 // Context sets the context to be used in this call's Do method.
14721 func (c *ProjectsLocationsTlsRoutesDeleteCall) Context(ctx context.Context) *ProjectsLocationsTlsRoutesDeleteCall {
14722 c.ctx_ = ctx
14723 return c
14724 }
14725
14726 // Header returns a http.Header that can be modified by the caller to add
14727 // headers to the request.
14728 func (c *ProjectsLocationsTlsRoutesDeleteCall) Header() http.Header {
14729 if c.header_ == nil {
14730 c.header_ = make(http.Header)
14731 }
14732 return c.header_
14733 }
14734
14735 func (c *ProjectsLocationsTlsRoutesDeleteCall) doRequest(alt string) (*http.Response, error) {
14736 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
14737 c.urlParams_.Set("alt", alt)
14738 c.urlParams_.Set("prettyPrint", "false")
14739 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
14740 urls += "?" + c.urlParams_.Encode()
14741 req, err := http.NewRequest("DELETE", urls, nil)
14742 if err != nil {
14743 return nil, err
14744 }
14745 req.Header = reqHeaders
14746 googleapi.Expand(req.URL, map[string]string{
14747 "name": c.name,
14748 })
14749 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tlsRoutes.delete", "request", internallog.HTTPRequest(req, nil))
14750 return gensupport.SendRequest(c.ctx_, c.s.client, req)
14751 }
14752
14753 // Do executes the "networkservices.projects.locations.tlsRoutes.delete" call.
14754 // Any non-2xx status code is an error. Response headers are in either
14755 // *Operation.ServerResponse.Header or (if a response was returned at all) in
14756 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
14757 // whether the returned error was because http.StatusNotModified was returned.
14758 func (c *ProjectsLocationsTlsRoutesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
14759 gensupport.SetOptions(c.urlParams_, opts...)
14760 res, err := c.doRequest("json")
14761 if res != nil && res.StatusCode == http.StatusNotModified {
14762 if res.Body != nil {
14763 res.Body.Close()
14764 }
14765 return nil, gensupport.WrapError(&googleapi.Error{
14766 Code: res.StatusCode,
14767 Header: res.Header,
14768 })
14769 }
14770 if err != nil {
14771 return nil, err
14772 }
14773 defer googleapi.CloseBody(res)
14774 if err := googleapi.CheckResponse(res); err != nil {
14775 return nil, gensupport.WrapError(err)
14776 }
14777 ret := &Operation{
14778 ServerResponse: googleapi.ServerResponse{
14779 Header: res.Header,
14780 HTTPStatusCode: res.StatusCode,
14781 },
14782 }
14783 target := &ret
14784 b, err := gensupport.DecodeResponseBytes(target, res)
14785 if err != nil {
14786 return nil, err
14787 }
14788 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tlsRoutes.delete", "response", internallog.HTTPResponse(res, b))
14789 return ret, nil
14790 }
14791
14792 type ProjectsLocationsTlsRoutesGetCall struct {
14793 s *Service
14794 name string
14795 urlParams_ gensupport.URLParams
14796 ifNoneMatch_ string
14797 ctx_ context.Context
14798 header_ http.Header
14799 }
14800
14801 // Get: Gets details of a single TlsRoute.
14802 //
14803 // - name: A name of the TlsRoute to get. Must be in the format
14804 // `projects/*/locations/*/tlsRoutes/*`.
14805 func (r *ProjectsLocationsTlsRoutesService) Get(name string) *ProjectsLocationsTlsRoutesGetCall {
14806 c := &ProjectsLocationsTlsRoutesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14807 c.name = name
14808 return c
14809 }
14810
14811 // Fields allows partial responses to be retrieved. See
14812 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
14813 // details.
14814 func (c *ProjectsLocationsTlsRoutesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsTlsRoutesGetCall {
14815 c.urlParams_.Set("fields", googleapi.CombineFields(s))
14816 return c
14817 }
14818
14819 // IfNoneMatch sets an optional parameter which makes the operation fail if the
14820 // object's ETag matches the given value. This is useful for getting updates
14821 // only after the object has changed since the last request.
14822 func (c *ProjectsLocationsTlsRoutesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsTlsRoutesGetCall {
14823 c.ifNoneMatch_ = entityTag
14824 return c
14825 }
14826
14827 // Context sets the context to be used in this call's Do method.
14828 func (c *ProjectsLocationsTlsRoutesGetCall) Context(ctx context.Context) *ProjectsLocationsTlsRoutesGetCall {
14829 c.ctx_ = ctx
14830 return c
14831 }
14832
14833 // Header returns a http.Header that can be modified by the caller to add
14834 // headers to the request.
14835 func (c *ProjectsLocationsTlsRoutesGetCall) Header() http.Header {
14836 if c.header_ == nil {
14837 c.header_ = make(http.Header)
14838 }
14839 return c.header_
14840 }
14841
14842 func (c *ProjectsLocationsTlsRoutesGetCall) doRequest(alt string) (*http.Response, error) {
14843 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
14844 if c.ifNoneMatch_ != "" {
14845 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
14846 }
14847 c.urlParams_.Set("alt", alt)
14848 c.urlParams_.Set("prettyPrint", "false")
14849 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
14850 urls += "?" + c.urlParams_.Encode()
14851 req, err := http.NewRequest("GET", urls, nil)
14852 if err != nil {
14853 return nil, err
14854 }
14855 req.Header = reqHeaders
14856 googleapi.Expand(req.URL, map[string]string{
14857 "name": c.name,
14858 })
14859 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tlsRoutes.get", "request", internallog.HTTPRequest(req, nil))
14860 return gensupport.SendRequest(c.ctx_, c.s.client, req)
14861 }
14862
14863 // Do executes the "networkservices.projects.locations.tlsRoutes.get" call.
14864 // Any non-2xx status code is an error. Response headers are in either
14865 // *TlsRoute.ServerResponse.Header or (if a response was returned at all) in
14866 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
14867 // whether the returned error was because http.StatusNotModified was returned.
14868 func (c *ProjectsLocationsTlsRoutesGetCall) Do(opts ...googleapi.CallOption) (*TlsRoute, error) {
14869 gensupport.SetOptions(c.urlParams_, opts...)
14870 res, err := c.doRequest("json")
14871 if res != nil && res.StatusCode == http.StatusNotModified {
14872 if res.Body != nil {
14873 res.Body.Close()
14874 }
14875 return nil, gensupport.WrapError(&googleapi.Error{
14876 Code: res.StatusCode,
14877 Header: res.Header,
14878 })
14879 }
14880 if err != nil {
14881 return nil, err
14882 }
14883 defer googleapi.CloseBody(res)
14884 if err := googleapi.CheckResponse(res); err != nil {
14885 return nil, gensupport.WrapError(err)
14886 }
14887 ret := &TlsRoute{
14888 ServerResponse: googleapi.ServerResponse{
14889 Header: res.Header,
14890 HTTPStatusCode: res.StatusCode,
14891 },
14892 }
14893 target := &ret
14894 b, err := gensupport.DecodeResponseBytes(target, res)
14895 if err != nil {
14896 return nil, err
14897 }
14898 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tlsRoutes.get", "response", internallog.HTTPResponse(res, b))
14899 return ret, nil
14900 }
14901
14902 type ProjectsLocationsTlsRoutesListCall struct {
14903 s *Service
14904 parent string
14905 urlParams_ gensupport.URLParams
14906 ifNoneMatch_ string
14907 ctx_ context.Context
14908 header_ http.Header
14909 }
14910
14911 // List: Lists TlsRoute in a given project and location.
14912 //
14913 // - parent: The project and location from which the TlsRoutes should be
14914 // listed, specified in the format `projects/*/locations/*`.
14915 func (r *ProjectsLocationsTlsRoutesService) List(parent string) *ProjectsLocationsTlsRoutesListCall {
14916 c := &ProjectsLocationsTlsRoutesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14917 c.parent = parent
14918 return c
14919 }
14920
14921 // PageSize sets the optional parameter "pageSize": Maximum number of TlsRoutes
14922 // to return per call.
14923 func (c *ProjectsLocationsTlsRoutesListCall) PageSize(pageSize int64) *ProjectsLocationsTlsRoutesListCall {
14924 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
14925 return c
14926 }
14927
14928 // PageToken sets the optional parameter "pageToken": The value returned by the
14929 // last `ListTlsRoutesResponse` Indicates that this is a continuation of a
14930 // prior `ListTlsRoutes` call, and that the system should return the next page
14931 // of data.
14932 func (c *ProjectsLocationsTlsRoutesListCall) PageToken(pageToken string) *ProjectsLocationsTlsRoutesListCall {
14933 c.urlParams_.Set("pageToken", pageToken)
14934 return c
14935 }
14936
14937 // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": If
14938 // true, allow partial responses for multi-regional Aggregated List requests.
14939 // Otherwise if one of the locations is down or unreachable, the Aggregated
14940 // List request will fail.
14941 func (c *ProjectsLocationsTlsRoutesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ProjectsLocationsTlsRoutesListCall {
14942 c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
14943 return c
14944 }
14945
14946 // Fields allows partial responses to be retrieved. See
14947 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
14948 // details.
14949 func (c *ProjectsLocationsTlsRoutesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsTlsRoutesListCall {
14950 c.urlParams_.Set("fields", googleapi.CombineFields(s))
14951 return c
14952 }
14953
14954 // IfNoneMatch sets an optional parameter which makes the operation fail if the
14955 // object's ETag matches the given value. This is useful for getting updates
14956 // only after the object has changed since the last request.
14957 func (c *ProjectsLocationsTlsRoutesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsTlsRoutesListCall {
14958 c.ifNoneMatch_ = entityTag
14959 return c
14960 }
14961
14962 // Context sets the context to be used in this call's Do method.
14963 func (c *ProjectsLocationsTlsRoutesListCall) Context(ctx context.Context) *ProjectsLocationsTlsRoutesListCall {
14964 c.ctx_ = ctx
14965 return c
14966 }
14967
14968 // Header returns a http.Header that can be modified by the caller to add
14969 // headers to the request.
14970 func (c *ProjectsLocationsTlsRoutesListCall) Header() http.Header {
14971 if c.header_ == nil {
14972 c.header_ = make(http.Header)
14973 }
14974 return c.header_
14975 }
14976
14977 func (c *ProjectsLocationsTlsRoutesListCall) doRequest(alt string) (*http.Response, error) {
14978 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
14979 if c.ifNoneMatch_ != "" {
14980 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
14981 }
14982 c.urlParams_.Set("alt", alt)
14983 c.urlParams_.Set("prettyPrint", "false")
14984 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/tlsRoutes")
14985 urls += "?" + c.urlParams_.Encode()
14986 req, err := http.NewRequest("GET", urls, nil)
14987 if err != nil {
14988 return nil, err
14989 }
14990 req.Header = reqHeaders
14991 googleapi.Expand(req.URL, map[string]string{
14992 "parent": c.parent,
14993 })
14994 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tlsRoutes.list", "request", internallog.HTTPRequest(req, nil))
14995 return gensupport.SendRequest(c.ctx_, c.s.client, req)
14996 }
14997
14998 // Do executes the "networkservices.projects.locations.tlsRoutes.list" call.
14999 // Any non-2xx status code is an error. Response headers are in either
15000 // *ListTlsRoutesResponse.ServerResponse.Header or (if a response was returned
15001 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
15002 // check whether the returned error was because http.StatusNotModified was
15003 // returned.
15004 func (c *ProjectsLocationsTlsRoutesListCall) Do(opts ...googleapi.CallOption) (*ListTlsRoutesResponse, error) {
15005 gensupport.SetOptions(c.urlParams_, opts...)
15006 res, err := c.doRequest("json")
15007 if res != nil && res.StatusCode == http.StatusNotModified {
15008 if res.Body != nil {
15009 res.Body.Close()
15010 }
15011 return nil, gensupport.WrapError(&googleapi.Error{
15012 Code: res.StatusCode,
15013 Header: res.Header,
15014 })
15015 }
15016 if err != nil {
15017 return nil, err
15018 }
15019 defer googleapi.CloseBody(res)
15020 if err := googleapi.CheckResponse(res); err != nil {
15021 return nil, gensupport.WrapError(err)
15022 }
15023 ret := &ListTlsRoutesResponse{
15024 ServerResponse: googleapi.ServerResponse{
15025 Header: res.Header,
15026 HTTPStatusCode: res.StatusCode,
15027 },
15028 }
15029 target := &ret
15030 b, err := gensupport.DecodeResponseBytes(target, res)
15031 if err != nil {
15032 return nil, err
15033 }
15034 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tlsRoutes.list", "response", internallog.HTTPResponse(res, b))
15035 return ret, nil
15036 }
15037
15038 // Pages invokes f for each page of results.
15039 // A non-nil error returned from f will halt the iteration.
15040 // The provided context supersedes any context provided to the Context method.
15041 func (c *ProjectsLocationsTlsRoutesListCall) Pages(ctx context.Context, f func(*ListTlsRoutesResponse) error) error {
15042 c.ctx_ = ctx
15043 defer c.PageToken(c.urlParams_.Get("pageToken"))
15044 for {
15045 x, err := c.Do()
15046 if err != nil {
15047 return err
15048 }
15049 if err := f(x); err != nil {
15050 return err
15051 }
15052 if x.NextPageToken == "" {
15053 return nil
15054 }
15055 c.PageToken(x.NextPageToken)
15056 }
15057 }
15058
15059 type ProjectsLocationsTlsRoutesPatchCall struct {
15060 s *Service
15061 name string
15062 tlsroute *TlsRoute
15063 urlParams_ gensupport.URLParams
15064 ctx_ context.Context
15065 header_ http.Header
15066 }
15067
15068 // Patch: Updates the parameters of a single TlsRoute.
15069 //
15070 // - name: Identifier. Name of the TlsRoute resource. It matches pattern
15071 // `projects/*/locations/*/tlsRoutes/tls_route_name>`.
15072 func (r *ProjectsLocationsTlsRoutesService) Patch(name string, tlsroute *TlsRoute) *ProjectsLocationsTlsRoutesPatchCall {
15073 c := &ProjectsLocationsTlsRoutesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15074 c.name = name
15075 c.tlsroute = tlsroute
15076 return c
15077 }
15078
15079 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
15080 // specify the fields to be overwritten in the TlsRoute resource by the update.
15081 // The fields specified in the update_mask are relative to the resource, not
15082 // the full request. A field will be overwritten if it is in the mask. If the
15083 // user does not provide a mask then all fields will be overwritten.
15084 func (c *ProjectsLocationsTlsRoutesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsTlsRoutesPatchCall {
15085 c.urlParams_.Set("updateMask", updateMask)
15086 return c
15087 }
15088
15089 // Fields allows partial responses to be retrieved. See
15090 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
15091 // details.
15092 func (c *ProjectsLocationsTlsRoutesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsTlsRoutesPatchCall {
15093 c.urlParams_.Set("fields", googleapi.CombineFields(s))
15094 return c
15095 }
15096
15097 // Context sets the context to be used in this call's Do method.
15098 func (c *ProjectsLocationsTlsRoutesPatchCall) Context(ctx context.Context) *ProjectsLocationsTlsRoutesPatchCall {
15099 c.ctx_ = ctx
15100 return c
15101 }
15102
15103 // Header returns a http.Header that can be modified by the caller to add
15104 // headers to the request.
15105 func (c *ProjectsLocationsTlsRoutesPatchCall) Header() http.Header {
15106 if c.header_ == nil {
15107 c.header_ = make(http.Header)
15108 }
15109 return c.header_
15110 }
15111
15112 func (c *ProjectsLocationsTlsRoutesPatchCall) doRequest(alt string) (*http.Response, error) {
15113 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
15114 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tlsroute)
15115 if err != nil {
15116 return nil, err
15117 }
15118 c.urlParams_.Set("alt", alt)
15119 c.urlParams_.Set("prettyPrint", "false")
15120 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
15121 urls += "?" + c.urlParams_.Encode()
15122 req, err := http.NewRequest("PATCH", urls, body)
15123 if err != nil {
15124 return nil, err
15125 }
15126 req.Header = reqHeaders
15127 googleapi.Expand(req.URL, map[string]string{
15128 "name": c.name,
15129 })
15130 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tlsRoutes.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
15131 return gensupport.SendRequest(c.ctx_, c.s.client, req)
15132 }
15133
15134 // Do executes the "networkservices.projects.locations.tlsRoutes.patch" call.
15135 // Any non-2xx status code is an error. Response headers are in either
15136 // *Operation.ServerResponse.Header or (if a response was returned at all) in
15137 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
15138 // whether the returned error was because http.StatusNotModified was returned.
15139 func (c *ProjectsLocationsTlsRoutesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
15140 gensupport.SetOptions(c.urlParams_, opts...)
15141 res, err := c.doRequest("json")
15142 if res != nil && res.StatusCode == http.StatusNotModified {
15143 if res.Body != nil {
15144 res.Body.Close()
15145 }
15146 return nil, gensupport.WrapError(&googleapi.Error{
15147 Code: res.StatusCode,
15148 Header: res.Header,
15149 })
15150 }
15151 if err != nil {
15152 return nil, err
15153 }
15154 defer googleapi.CloseBody(res)
15155 if err := googleapi.CheckResponse(res); err != nil {
15156 return nil, gensupport.WrapError(err)
15157 }
15158 ret := &Operation{
15159 ServerResponse: googleapi.ServerResponse{
15160 Header: res.Header,
15161 HTTPStatusCode: res.StatusCode,
15162 },
15163 }
15164 target := &ret
15165 b, err := gensupport.DecodeResponseBytes(target, res)
15166 if err != nil {
15167 return nil, err
15168 }
15169 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.tlsRoutes.patch", "response", internallog.HTTPResponse(res, b))
15170 return ret, nil
15171 }
15172
15173 type ProjectsLocationsWasmPluginsCreateCall struct {
15174 s *Service
15175 parent string
15176 wasmplugin *WasmPlugin
15177 urlParams_ gensupport.URLParams
15178 ctx_ context.Context
15179 header_ http.Header
15180 }
15181
15182 // Create: Creates a new `WasmPlugin` resource in a given project and location.
15183 //
15184 // - parent: The parent resource of the `WasmPlugin` resource. Must be in the
15185 // format `projects/{project}/locations/global`.
15186 func (r *ProjectsLocationsWasmPluginsService) Create(parent string, wasmplugin *WasmPlugin) *ProjectsLocationsWasmPluginsCreateCall {
15187 c := &ProjectsLocationsWasmPluginsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15188 c.parent = parent
15189 c.wasmplugin = wasmplugin
15190 return c
15191 }
15192
15193 // WasmPluginId sets the optional parameter "wasmPluginId": Required.
15194 // User-provided ID of the `WasmPlugin` resource to be created.
15195 func (c *ProjectsLocationsWasmPluginsCreateCall) WasmPluginId(wasmPluginId string) *ProjectsLocationsWasmPluginsCreateCall {
15196 c.urlParams_.Set("wasmPluginId", wasmPluginId)
15197 return c
15198 }
15199
15200 // Fields allows partial responses to be retrieved. See
15201 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
15202 // details.
15203 func (c *ProjectsLocationsWasmPluginsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsWasmPluginsCreateCall {
15204 c.urlParams_.Set("fields", googleapi.CombineFields(s))
15205 return c
15206 }
15207
15208 // Context sets the context to be used in this call's Do method.
15209 func (c *ProjectsLocationsWasmPluginsCreateCall) Context(ctx context.Context) *ProjectsLocationsWasmPluginsCreateCall {
15210 c.ctx_ = ctx
15211 return c
15212 }
15213
15214 // Header returns a http.Header that can be modified by the caller to add
15215 // headers to the request.
15216 func (c *ProjectsLocationsWasmPluginsCreateCall) Header() http.Header {
15217 if c.header_ == nil {
15218 c.header_ = make(http.Header)
15219 }
15220 return c.header_
15221 }
15222
15223 func (c *ProjectsLocationsWasmPluginsCreateCall) doRequest(alt string) (*http.Response, error) {
15224 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
15225 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.wasmplugin)
15226 if err != nil {
15227 return nil, err
15228 }
15229 c.urlParams_.Set("alt", alt)
15230 c.urlParams_.Set("prettyPrint", "false")
15231 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/wasmPlugins")
15232 urls += "?" + c.urlParams_.Encode()
15233 req, err := http.NewRequest("POST", urls, body)
15234 if err != nil {
15235 return nil, err
15236 }
15237 req.Header = reqHeaders
15238 googleapi.Expand(req.URL, map[string]string{
15239 "parent": c.parent,
15240 })
15241 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.create", "request", internallog.HTTPRequest(req, body.Bytes()))
15242 return gensupport.SendRequest(c.ctx_, c.s.client, req)
15243 }
15244
15245 // Do executes the "networkservices.projects.locations.wasmPlugins.create" call.
15246 // Any non-2xx status code is an error. Response headers are in either
15247 // *Operation.ServerResponse.Header or (if a response was returned at all) in
15248 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
15249 // whether the returned error was because http.StatusNotModified was returned.
15250 func (c *ProjectsLocationsWasmPluginsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
15251 gensupport.SetOptions(c.urlParams_, opts...)
15252 res, err := c.doRequest("json")
15253 if res != nil && res.StatusCode == http.StatusNotModified {
15254 if res.Body != nil {
15255 res.Body.Close()
15256 }
15257 return nil, gensupport.WrapError(&googleapi.Error{
15258 Code: res.StatusCode,
15259 Header: res.Header,
15260 })
15261 }
15262 if err != nil {
15263 return nil, err
15264 }
15265 defer googleapi.CloseBody(res)
15266 if err := googleapi.CheckResponse(res); err != nil {
15267 return nil, gensupport.WrapError(err)
15268 }
15269 ret := &Operation{
15270 ServerResponse: googleapi.ServerResponse{
15271 Header: res.Header,
15272 HTTPStatusCode: res.StatusCode,
15273 },
15274 }
15275 target := &ret
15276 b, err := gensupport.DecodeResponseBytes(target, res)
15277 if err != nil {
15278 return nil, err
15279 }
15280 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.create", "response", internallog.HTTPResponse(res, b))
15281 return ret, nil
15282 }
15283
15284 type ProjectsLocationsWasmPluginsDeleteCall struct {
15285 s *Service
15286 name string
15287 urlParams_ gensupport.URLParams
15288 ctx_ context.Context
15289 header_ http.Header
15290 }
15291
15292 // Delete: Deletes the specified `WasmPlugin` resource.
15293 //
15294 // - name: A name of the `WasmPlugin` resource to delete. Must be in the format
15295 // `projects/{project}/locations/global/wasmPlugins/{wasm_plugin}`.
15296 func (r *ProjectsLocationsWasmPluginsService) Delete(name string) *ProjectsLocationsWasmPluginsDeleteCall {
15297 c := &ProjectsLocationsWasmPluginsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15298 c.name = name
15299 return c
15300 }
15301
15302 // Fields allows partial responses to be retrieved. See
15303 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
15304 // details.
15305 func (c *ProjectsLocationsWasmPluginsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsWasmPluginsDeleteCall {
15306 c.urlParams_.Set("fields", googleapi.CombineFields(s))
15307 return c
15308 }
15309
15310 // Context sets the context to be used in this call's Do method.
15311 func (c *ProjectsLocationsWasmPluginsDeleteCall) Context(ctx context.Context) *ProjectsLocationsWasmPluginsDeleteCall {
15312 c.ctx_ = ctx
15313 return c
15314 }
15315
15316 // Header returns a http.Header that can be modified by the caller to add
15317 // headers to the request.
15318 func (c *ProjectsLocationsWasmPluginsDeleteCall) Header() http.Header {
15319 if c.header_ == nil {
15320 c.header_ = make(http.Header)
15321 }
15322 return c.header_
15323 }
15324
15325 func (c *ProjectsLocationsWasmPluginsDeleteCall) doRequest(alt string) (*http.Response, error) {
15326 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
15327 c.urlParams_.Set("alt", alt)
15328 c.urlParams_.Set("prettyPrint", "false")
15329 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
15330 urls += "?" + c.urlParams_.Encode()
15331 req, err := http.NewRequest("DELETE", urls, nil)
15332 if err != nil {
15333 return nil, err
15334 }
15335 req.Header = reqHeaders
15336 googleapi.Expand(req.URL, map[string]string{
15337 "name": c.name,
15338 })
15339 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.delete", "request", internallog.HTTPRequest(req, nil))
15340 return gensupport.SendRequest(c.ctx_, c.s.client, req)
15341 }
15342
15343 // Do executes the "networkservices.projects.locations.wasmPlugins.delete" call.
15344 // Any non-2xx status code is an error. Response headers are in either
15345 // *Operation.ServerResponse.Header or (if a response was returned at all) in
15346 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
15347 // whether the returned error was because http.StatusNotModified was returned.
15348 func (c *ProjectsLocationsWasmPluginsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
15349 gensupport.SetOptions(c.urlParams_, opts...)
15350 res, err := c.doRequest("json")
15351 if res != nil && res.StatusCode == http.StatusNotModified {
15352 if res.Body != nil {
15353 res.Body.Close()
15354 }
15355 return nil, gensupport.WrapError(&googleapi.Error{
15356 Code: res.StatusCode,
15357 Header: res.Header,
15358 })
15359 }
15360 if err != nil {
15361 return nil, err
15362 }
15363 defer googleapi.CloseBody(res)
15364 if err := googleapi.CheckResponse(res); err != nil {
15365 return nil, gensupport.WrapError(err)
15366 }
15367 ret := &Operation{
15368 ServerResponse: googleapi.ServerResponse{
15369 Header: res.Header,
15370 HTTPStatusCode: res.StatusCode,
15371 },
15372 }
15373 target := &ret
15374 b, err := gensupport.DecodeResponseBytes(target, res)
15375 if err != nil {
15376 return nil, err
15377 }
15378 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.delete", "response", internallog.HTTPResponse(res, b))
15379 return ret, nil
15380 }
15381
15382 type ProjectsLocationsWasmPluginsGetCall struct {
15383 s *Service
15384 name string
15385 urlParams_ gensupport.URLParams
15386 ifNoneMatch_ string
15387 ctx_ context.Context
15388 header_ http.Header
15389 }
15390
15391 // Get: Gets details of the specified `WasmPlugin` resource.
15392 //
15393 // - name: A name of the `WasmPlugin` resource to get. Must be in the format
15394 // `projects/{project}/locations/global/wasmPlugins/{wasm_plugin}`.
15395 func (r *ProjectsLocationsWasmPluginsService) Get(name string) *ProjectsLocationsWasmPluginsGetCall {
15396 c := &ProjectsLocationsWasmPluginsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15397 c.name = name
15398 return c
15399 }
15400
15401 // View sets the optional parameter "view": Determines how much data must be
15402 // returned in the response. See AIP-157 (https://google.aip.dev/157).
15403 //
15404 // Possible values:
15405 //
15406 // "WASM_PLUGIN_VIEW_UNSPECIFIED" - Unspecified value. Do not use.
15407 // "WASM_PLUGIN_VIEW_BASIC" - If specified in the `GET` request for a
15408 //
15409 // `WasmPlugin` resource, the server's response includes just the `WasmPlugin`
15410 // resource.
15411 //
15412 // "WASM_PLUGIN_VIEW_FULL" - If specified in the `GET` request for a
15413 //
15414 // `WasmPlugin` resource, the server's response includes the `WasmPlugin`
15415 // resource with all its versions.
15416 func (c *ProjectsLocationsWasmPluginsGetCall) View(view string) *ProjectsLocationsWasmPluginsGetCall {
15417 c.urlParams_.Set("view", view)
15418 return c
15419 }
15420
15421 // Fields allows partial responses to be retrieved. See
15422 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
15423 // details.
15424 func (c *ProjectsLocationsWasmPluginsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsWasmPluginsGetCall {
15425 c.urlParams_.Set("fields", googleapi.CombineFields(s))
15426 return c
15427 }
15428
15429 // IfNoneMatch sets an optional parameter which makes the operation fail if the
15430 // object's ETag matches the given value. This is useful for getting updates
15431 // only after the object has changed since the last request.
15432 func (c *ProjectsLocationsWasmPluginsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsWasmPluginsGetCall {
15433 c.ifNoneMatch_ = entityTag
15434 return c
15435 }
15436
15437 // Context sets the context to be used in this call's Do method.
15438 func (c *ProjectsLocationsWasmPluginsGetCall) Context(ctx context.Context) *ProjectsLocationsWasmPluginsGetCall {
15439 c.ctx_ = ctx
15440 return c
15441 }
15442
15443 // Header returns a http.Header that can be modified by the caller to add
15444 // headers to the request.
15445 func (c *ProjectsLocationsWasmPluginsGetCall) Header() http.Header {
15446 if c.header_ == nil {
15447 c.header_ = make(http.Header)
15448 }
15449 return c.header_
15450 }
15451
15452 func (c *ProjectsLocationsWasmPluginsGetCall) doRequest(alt string) (*http.Response, error) {
15453 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
15454 if c.ifNoneMatch_ != "" {
15455 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
15456 }
15457 c.urlParams_.Set("alt", alt)
15458 c.urlParams_.Set("prettyPrint", "false")
15459 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
15460 urls += "?" + c.urlParams_.Encode()
15461 req, err := http.NewRequest("GET", urls, nil)
15462 if err != nil {
15463 return nil, err
15464 }
15465 req.Header = reqHeaders
15466 googleapi.Expand(req.URL, map[string]string{
15467 "name": c.name,
15468 })
15469 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.get", "request", internallog.HTTPRequest(req, nil))
15470 return gensupport.SendRequest(c.ctx_, c.s.client, req)
15471 }
15472
15473 // Do executes the "networkservices.projects.locations.wasmPlugins.get" call.
15474 // Any non-2xx status code is an error. Response headers are in either
15475 // *WasmPlugin.ServerResponse.Header or (if a response was returned at all) in
15476 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
15477 // whether the returned error was because http.StatusNotModified was returned.
15478 func (c *ProjectsLocationsWasmPluginsGetCall) Do(opts ...googleapi.CallOption) (*WasmPlugin, error) {
15479 gensupport.SetOptions(c.urlParams_, opts...)
15480 res, err := c.doRequest("json")
15481 if res != nil && res.StatusCode == http.StatusNotModified {
15482 if res.Body != nil {
15483 res.Body.Close()
15484 }
15485 return nil, gensupport.WrapError(&googleapi.Error{
15486 Code: res.StatusCode,
15487 Header: res.Header,
15488 })
15489 }
15490 if err != nil {
15491 return nil, err
15492 }
15493 defer googleapi.CloseBody(res)
15494 if err := googleapi.CheckResponse(res); err != nil {
15495 return nil, gensupport.WrapError(err)
15496 }
15497 ret := &WasmPlugin{
15498 ServerResponse: googleapi.ServerResponse{
15499 Header: res.Header,
15500 HTTPStatusCode: res.StatusCode,
15501 },
15502 }
15503 target := &ret
15504 b, err := gensupport.DecodeResponseBytes(target, res)
15505 if err != nil {
15506 return nil, err
15507 }
15508 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.get", "response", internallog.HTTPResponse(res, b))
15509 return ret, nil
15510 }
15511
15512 type ProjectsLocationsWasmPluginsListCall struct {
15513 s *Service
15514 parent string
15515 urlParams_ gensupport.URLParams
15516 ifNoneMatch_ string
15517 ctx_ context.Context
15518 header_ http.Header
15519 }
15520
15521 // List: Lists `WasmPlugin` resources in a given project and location.
15522 //
15523 // - parent: The project and location from which the `WasmPlugin` resources are
15524 // listed, specified in the following format:
15525 // `projects/{project}/locations/global`.
15526 func (r *ProjectsLocationsWasmPluginsService) List(parent string) *ProjectsLocationsWasmPluginsListCall {
15527 c := &ProjectsLocationsWasmPluginsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15528 c.parent = parent
15529 return c
15530 }
15531
15532 // PageSize sets the optional parameter "pageSize": Maximum number of
15533 // `WasmPlugin` resources to return per call. If not specified, at most 50
15534 // `WasmPlugin` resources are returned. The maximum value is 1000; values above
15535 // 1000 are coerced to 1000.
15536 func (c *ProjectsLocationsWasmPluginsListCall) PageSize(pageSize int64) *ProjectsLocationsWasmPluginsListCall {
15537 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
15538 return c
15539 }
15540
15541 // PageToken sets the optional parameter "pageToken": The value returned by the
15542 // last `ListWasmPluginsResponse` call. Indicates that this is a continuation
15543 // of a prior `ListWasmPlugins` call, and that the next page of data is to be
15544 // returned.
15545 func (c *ProjectsLocationsWasmPluginsListCall) PageToken(pageToken string) *ProjectsLocationsWasmPluginsListCall {
15546 c.urlParams_.Set("pageToken", pageToken)
15547 return c
15548 }
15549
15550 // Fields allows partial responses to be retrieved. See
15551 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
15552 // details.
15553 func (c *ProjectsLocationsWasmPluginsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsWasmPluginsListCall {
15554 c.urlParams_.Set("fields", googleapi.CombineFields(s))
15555 return c
15556 }
15557
15558 // IfNoneMatch sets an optional parameter which makes the operation fail if the
15559 // object's ETag matches the given value. This is useful for getting updates
15560 // only after the object has changed since the last request.
15561 func (c *ProjectsLocationsWasmPluginsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsWasmPluginsListCall {
15562 c.ifNoneMatch_ = entityTag
15563 return c
15564 }
15565
15566 // Context sets the context to be used in this call's Do method.
15567 func (c *ProjectsLocationsWasmPluginsListCall) Context(ctx context.Context) *ProjectsLocationsWasmPluginsListCall {
15568 c.ctx_ = ctx
15569 return c
15570 }
15571
15572 // Header returns a http.Header that can be modified by the caller to add
15573 // headers to the request.
15574 func (c *ProjectsLocationsWasmPluginsListCall) Header() http.Header {
15575 if c.header_ == nil {
15576 c.header_ = make(http.Header)
15577 }
15578 return c.header_
15579 }
15580
15581 func (c *ProjectsLocationsWasmPluginsListCall) doRequest(alt string) (*http.Response, error) {
15582 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
15583 if c.ifNoneMatch_ != "" {
15584 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
15585 }
15586 c.urlParams_.Set("alt", alt)
15587 c.urlParams_.Set("prettyPrint", "false")
15588 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/wasmPlugins")
15589 urls += "?" + c.urlParams_.Encode()
15590 req, err := http.NewRequest("GET", urls, nil)
15591 if err != nil {
15592 return nil, err
15593 }
15594 req.Header = reqHeaders
15595 googleapi.Expand(req.URL, map[string]string{
15596 "parent": c.parent,
15597 })
15598 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.list", "request", internallog.HTTPRequest(req, nil))
15599 return gensupport.SendRequest(c.ctx_, c.s.client, req)
15600 }
15601
15602 // Do executes the "networkservices.projects.locations.wasmPlugins.list" call.
15603 // Any non-2xx status code is an error. Response headers are in either
15604 // *ListWasmPluginsResponse.ServerResponse.Header or (if a response was
15605 // returned at all) in error.(*googleapi.Error).Header. Use
15606 // googleapi.IsNotModified to check whether the returned error was because
15607 // http.StatusNotModified was returned.
15608 func (c *ProjectsLocationsWasmPluginsListCall) Do(opts ...googleapi.CallOption) (*ListWasmPluginsResponse, error) {
15609 gensupport.SetOptions(c.urlParams_, opts...)
15610 res, err := c.doRequest("json")
15611 if res != nil && res.StatusCode == http.StatusNotModified {
15612 if res.Body != nil {
15613 res.Body.Close()
15614 }
15615 return nil, gensupport.WrapError(&googleapi.Error{
15616 Code: res.StatusCode,
15617 Header: res.Header,
15618 })
15619 }
15620 if err != nil {
15621 return nil, err
15622 }
15623 defer googleapi.CloseBody(res)
15624 if err := googleapi.CheckResponse(res); err != nil {
15625 return nil, gensupport.WrapError(err)
15626 }
15627 ret := &ListWasmPluginsResponse{
15628 ServerResponse: googleapi.ServerResponse{
15629 Header: res.Header,
15630 HTTPStatusCode: res.StatusCode,
15631 },
15632 }
15633 target := &ret
15634 b, err := gensupport.DecodeResponseBytes(target, res)
15635 if err != nil {
15636 return nil, err
15637 }
15638 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.list", "response", internallog.HTTPResponse(res, b))
15639 return ret, nil
15640 }
15641
15642 // Pages invokes f for each page of results.
15643 // A non-nil error returned from f will halt the iteration.
15644 // The provided context supersedes any context provided to the Context method.
15645 func (c *ProjectsLocationsWasmPluginsListCall) Pages(ctx context.Context, f func(*ListWasmPluginsResponse) error) error {
15646 c.ctx_ = ctx
15647 defer c.PageToken(c.urlParams_.Get("pageToken"))
15648 for {
15649 x, err := c.Do()
15650 if err != nil {
15651 return err
15652 }
15653 if err := f(x); err != nil {
15654 return err
15655 }
15656 if x.NextPageToken == "" {
15657 return nil
15658 }
15659 c.PageToken(x.NextPageToken)
15660 }
15661 }
15662
15663 type ProjectsLocationsWasmPluginsPatchCall struct {
15664 s *Service
15665 name string
15666 wasmplugin *WasmPlugin
15667 urlParams_ gensupport.URLParams
15668 ctx_ context.Context
15669 header_ http.Header
15670 }
15671
15672 // Patch: Updates the parameters of the specified `WasmPlugin` resource.
15673 //
15674 // - name: Identifier. Name of the `WasmPlugin` resource in the following
15675 // format:
15676 // `projects/{project}/locations/{location}/wasmPlugins/{wasm_plugin}`.
15677 func (r *ProjectsLocationsWasmPluginsService) Patch(name string, wasmplugin *WasmPlugin) *ProjectsLocationsWasmPluginsPatchCall {
15678 c := &ProjectsLocationsWasmPluginsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15679 c.name = name
15680 c.wasmplugin = wasmplugin
15681 return c
15682 }
15683
15684 // UpdateMask sets the optional parameter "updateMask": Used to specify the
15685 // fields to be overwritten in the `WasmPlugin` resource by the update. The
15686 // fields specified in the `update_mask` field are relative to the resource,
15687 // not the full request. An omitted `update_mask` field is treated as an
15688 // implied `update_mask` field equivalent to all fields that are populated
15689 // (that have a non-empty value). The `update_mask` field supports a special
15690 // value `*`, which means that each field in the given `WasmPlugin` resource
15691 // (including the empty ones) replaces the current value.
15692 func (c *ProjectsLocationsWasmPluginsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsWasmPluginsPatchCall {
15693 c.urlParams_.Set("updateMask", updateMask)
15694 return c
15695 }
15696
15697 // Fields allows partial responses to be retrieved. See
15698 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
15699 // details.
15700 func (c *ProjectsLocationsWasmPluginsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsWasmPluginsPatchCall {
15701 c.urlParams_.Set("fields", googleapi.CombineFields(s))
15702 return c
15703 }
15704
15705 // Context sets the context to be used in this call's Do method.
15706 func (c *ProjectsLocationsWasmPluginsPatchCall) Context(ctx context.Context) *ProjectsLocationsWasmPluginsPatchCall {
15707 c.ctx_ = ctx
15708 return c
15709 }
15710
15711 // Header returns a http.Header that can be modified by the caller to add
15712 // headers to the request.
15713 func (c *ProjectsLocationsWasmPluginsPatchCall) Header() http.Header {
15714 if c.header_ == nil {
15715 c.header_ = make(http.Header)
15716 }
15717 return c.header_
15718 }
15719
15720 func (c *ProjectsLocationsWasmPluginsPatchCall) doRequest(alt string) (*http.Response, error) {
15721 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
15722 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.wasmplugin)
15723 if err != nil {
15724 return nil, err
15725 }
15726 c.urlParams_.Set("alt", alt)
15727 c.urlParams_.Set("prettyPrint", "false")
15728 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
15729 urls += "?" + c.urlParams_.Encode()
15730 req, err := http.NewRequest("PATCH", urls, body)
15731 if err != nil {
15732 return nil, err
15733 }
15734 req.Header = reqHeaders
15735 googleapi.Expand(req.URL, map[string]string{
15736 "name": c.name,
15737 })
15738 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
15739 return gensupport.SendRequest(c.ctx_, c.s.client, req)
15740 }
15741
15742 // Do executes the "networkservices.projects.locations.wasmPlugins.patch" call.
15743 // Any non-2xx status code is an error. Response headers are in either
15744 // *Operation.ServerResponse.Header or (if a response was returned at all) in
15745 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
15746 // whether the returned error was because http.StatusNotModified was returned.
15747 func (c *ProjectsLocationsWasmPluginsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
15748 gensupport.SetOptions(c.urlParams_, opts...)
15749 res, err := c.doRequest("json")
15750 if res != nil && res.StatusCode == http.StatusNotModified {
15751 if res.Body != nil {
15752 res.Body.Close()
15753 }
15754 return nil, gensupport.WrapError(&googleapi.Error{
15755 Code: res.StatusCode,
15756 Header: res.Header,
15757 })
15758 }
15759 if err != nil {
15760 return nil, err
15761 }
15762 defer googleapi.CloseBody(res)
15763 if err := googleapi.CheckResponse(res); err != nil {
15764 return nil, gensupport.WrapError(err)
15765 }
15766 ret := &Operation{
15767 ServerResponse: googleapi.ServerResponse{
15768 Header: res.Header,
15769 HTTPStatusCode: res.StatusCode,
15770 },
15771 }
15772 target := &ret
15773 b, err := gensupport.DecodeResponseBytes(target, res)
15774 if err != nil {
15775 return nil, err
15776 }
15777 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.patch", "response", internallog.HTTPResponse(res, b))
15778 return ret, nil
15779 }
15780
15781 type ProjectsLocationsWasmPluginsVersionsCreateCall struct {
15782 s *Service
15783 parent string
15784 wasmpluginversion *WasmPluginVersion
15785 urlParams_ gensupport.URLParams
15786 ctx_ context.Context
15787 header_ http.Header
15788 }
15789
15790 // Create: Creates a new `WasmPluginVersion` resource in a given project and
15791 // location.
15792 //
15793 // - parent: The parent resource of the `WasmPluginVersion` resource. Must be
15794 // in the format
15795 // `projects/{project}/locations/global/wasmPlugins/{wasm_plugin}`.
15796 func (r *ProjectsLocationsWasmPluginsVersionsService) Create(parent string, wasmpluginversion *WasmPluginVersion) *ProjectsLocationsWasmPluginsVersionsCreateCall {
15797 c := &ProjectsLocationsWasmPluginsVersionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15798 c.parent = parent
15799 c.wasmpluginversion = wasmpluginversion
15800 return c
15801 }
15802
15803 // WasmPluginVersionId sets the optional parameter "wasmPluginVersionId":
15804 // Required. User-provided ID of the `WasmPluginVersion` resource to be
15805 // created.
15806 func (c *ProjectsLocationsWasmPluginsVersionsCreateCall) WasmPluginVersionId(wasmPluginVersionId string) *ProjectsLocationsWasmPluginsVersionsCreateCall {
15807 c.urlParams_.Set("wasmPluginVersionId", wasmPluginVersionId)
15808 return c
15809 }
15810
15811 // Fields allows partial responses to be retrieved. See
15812 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
15813 // details.
15814 func (c *ProjectsLocationsWasmPluginsVersionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsWasmPluginsVersionsCreateCall {
15815 c.urlParams_.Set("fields", googleapi.CombineFields(s))
15816 return c
15817 }
15818
15819 // Context sets the context to be used in this call's Do method.
15820 func (c *ProjectsLocationsWasmPluginsVersionsCreateCall) Context(ctx context.Context) *ProjectsLocationsWasmPluginsVersionsCreateCall {
15821 c.ctx_ = ctx
15822 return c
15823 }
15824
15825 // Header returns a http.Header that can be modified by the caller to add
15826 // headers to the request.
15827 func (c *ProjectsLocationsWasmPluginsVersionsCreateCall) Header() http.Header {
15828 if c.header_ == nil {
15829 c.header_ = make(http.Header)
15830 }
15831 return c.header_
15832 }
15833
15834 func (c *ProjectsLocationsWasmPluginsVersionsCreateCall) doRequest(alt string) (*http.Response, error) {
15835 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
15836 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.wasmpluginversion)
15837 if err != nil {
15838 return nil, err
15839 }
15840 c.urlParams_.Set("alt", alt)
15841 c.urlParams_.Set("prettyPrint", "false")
15842 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/versions")
15843 urls += "?" + c.urlParams_.Encode()
15844 req, err := http.NewRequest("POST", urls, body)
15845 if err != nil {
15846 return nil, err
15847 }
15848 req.Header = reqHeaders
15849 googleapi.Expand(req.URL, map[string]string{
15850 "parent": c.parent,
15851 })
15852 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.versions.create", "request", internallog.HTTPRequest(req, body.Bytes()))
15853 return gensupport.SendRequest(c.ctx_, c.s.client, req)
15854 }
15855
15856 // Do executes the "networkservices.projects.locations.wasmPlugins.versions.create" call.
15857 // Any non-2xx status code is an error. Response headers are in either
15858 // *Operation.ServerResponse.Header or (if a response was returned at all) in
15859 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
15860 // whether the returned error was because http.StatusNotModified was returned.
15861 func (c *ProjectsLocationsWasmPluginsVersionsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
15862 gensupport.SetOptions(c.urlParams_, opts...)
15863 res, err := c.doRequest("json")
15864 if res != nil && res.StatusCode == http.StatusNotModified {
15865 if res.Body != nil {
15866 res.Body.Close()
15867 }
15868 return nil, gensupport.WrapError(&googleapi.Error{
15869 Code: res.StatusCode,
15870 Header: res.Header,
15871 })
15872 }
15873 if err != nil {
15874 return nil, err
15875 }
15876 defer googleapi.CloseBody(res)
15877 if err := googleapi.CheckResponse(res); err != nil {
15878 return nil, gensupport.WrapError(err)
15879 }
15880 ret := &Operation{
15881 ServerResponse: googleapi.ServerResponse{
15882 Header: res.Header,
15883 HTTPStatusCode: res.StatusCode,
15884 },
15885 }
15886 target := &ret
15887 b, err := gensupport.DecodeResponseBytes(target, res)
15888 if err != nil {
15889 return nil, err
15890 }
15891 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.versions.create", "response", internallog.HTTPResponse(res, b))
15892 return ret, nil
15893 }
15894
15895 type ProjectsLocationsWasmPluginsVersionsDeleteCall struct {
15896 s *Service
15897 name string
15898 urlParams_ gensupport.URLParams
15899 ctx_ context.Context
15900 header_ http.Header
15901 }
15902
15903 // Delete: Deletes the specified `WasmPluginVersion` resource.
15904 //
15905 // - name: A name of the `WasmPluginVersion` resource to delete. Must be in the
15906 // format
15907 // `projects/{project}/locations/global/wasmPlugins/{wasm_plugin}/versions/{wa
15908 // sm_plugin_version}`.
15909 func (r *ProjectsLocationsWasmPluginsVersionsService) Delete(name string) *ProjectsLocationsWasmPluginsVersionsDeleteCall {
15910 c := &ProjectsLocationsWasmPluginsVersionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15911 c.name = name
15912 return c
15913 }
15914
15915 // Fields allows partial responses to be retrieved. See
15916 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
15917 // details.
15918 func (c *ProjectsLocationsWasmPluginsVersionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsWasmPluginsVersionsDeleteCall {
15919 c.urlParams_.Set("fields", googleapi.CombineFields(s))
15920 return c
15921 }
15922
15923 // Context sets the context to be used in this call's Do method.
15924 func (c *ProjectsLocationsWasmPluginsVersionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsWasmPluginsVersionsDeleteCall {
15925 c.ctx_ = ctx
15926 return c
15927 }
15928
15929 // Header returns a http.Header that can be modified by the caller to add
15930 // headers to the request.
15931 func (c *ProjectsLocationsWasmPluginsVersionsDeleteCall) Header() http.Header {
15932 if c.header_ == nil {
15933 c.header_ = make(http.Header)
15934 }
15935 return c.header_
15936 }
15937
15938 func (c *ProjectsLocationsWasmPluginsVersionsDeleteCall) doRequest(alt string) (*http.Response, error) {
15939 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
15940 c.urlParams_.Set("alt", alt)
15941 c.urlParams_.Set("prettyPrint", "false")
15942 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
15943 urls += "?" + c.urlParams_.Encode()
15944 req, err := http.NewRequest("DELETE", urls, nil)
15945 if err != nil {
15946 return nil, err
15947 }
15948 req.Header = reqHeaders
15949 googleapi.Expand(req.URL, map[string]string{
15950 "name": c.name,
15951 })
15952 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.versions.delete", "request", internallog.HTTPRequest(req, nil))
15953 return gensupport.SendRequest(c.ctx_, c.s.client, req)
15954 }
15955
15956 // Do executes the "networkservices.projects.locations.wasmPlugins.versions.delete" call.
15957 // Any non-2xx status code is an error. Response headers are in either
15958 // *Operation.ServerResponse.Header or (if a response was returned at all) in
15959 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
15960 // whether the returned error was because http.StatusNotModified was returned.
15961 func (c *ProjectsLocationsWasmPluginsVersionsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
15962 gensupport.SetOptions(c.urlParams_, opts...)
15963 res, err := c.doRequest("json")
15964 if res != nil && res.StatusCode == http.StatusNotModified {
15965 if res.Body != nil {
15966 res.Body.Close()
15967 }
15968 return nil, gensupport.WrapError(&googleapi.Error{
15969 Code: res.StatusCode,
15970 Header: res.Header,
15971 })
15972 }
15973 if err != nil {
15974 return nil, err
15975 }
15976 defer googleapi.CloseBody(res)
15977 if err := googleapi.CheckResponse(res); err != nil {
15978 return nil, gensupport.WrapError(err)
15979 }
15980 ret := &Operation{
15981 ServerResponse: googleapi.ServerResponse{
15982 Header: res.Header,
15983 HTTPStatusCode: res.StatusCode,
15984 },
15985 }
15986 target := &ret
15987 b, err := gensupport.DecodeResponseBytes(target, res)
15988 if err != nil {
15989 return nil, err
15990 }
15991 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.versions.delete", "response", internallog.HTTPResponse(res, b))
15992 return ret, nil
15993 }
15994
15995 type ProjectsLocationsWasmPluginsVersionsGetCall struct {
15996 s *Service
15997 name string
15998 urlParams_ gensupport.URLParams
15999 ifNoneMatch_ string
16000 ctx_ context.Context
16001 header_ http.Header
16002 }
16003
16004 // Get: Gets details of the specified `WasmPluginVersion` resource.
16005 //
16006 // - name: A name of the `WasmPluginVersion` resource to get. Must be in the
16007 // format
16008 // `projects/{project}/locations/global/wasmPlugins/{wasm_plugin}/versions/{wa
16009 // sm_plugin_version}`.
16010 func (r *ProjectsLocationsWasmPluginsVersionsService) Get(name string) *ProjectsLocationsWasmPluginsVersionsGetCall {
16011 c := &ProjectsLocationsWasmPluginsVersionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
16012 c.name = name
16013 return c
16014 }
16015
16016 // Fields allows partial responses to be retrieved. See
16017 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
16018 // details.
16019 func (c *ProjectsLocationsWasmPluginsVersionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsWasmPluginsVersionsGetCall {
16020 c.urlParams_.Set("fields", googleapi.CombineFields(s))
16021 return c
16022 }
16023
16024 // IfNoneMatch sets an optional parameter which makes the operation fail if the
16025 // object's ETag matches the given value. This is useful for getting updates
16026 // only after the object has changed since the last request.
16027 func (c *ProjectsLocationsWasmPluginsVersionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsWasmPluginsVersionsGetCall {
16028 c.ifNoneMatch_ = entityTag
16029 return c
16030 }
16031
16032 // Context sets the context to be used in this call's Do method.
16033 func (c *ProjectsLocationsWasmPluginsVersionsGetCall) Context(ctx context.Context) *ProjectsLocationsWasmPluginsVersionsGetCall {
16034 c.ctx_ = ctx
16035 return c
16036 }
16037
16038 // Header returns a http.Header that can be modified by the caller to add
16039 // headers to the request.
16040 func (c *ProjectsLocationsWasmPluginsVersionsGetCall) Header() http.Header {
16041 if c.header_ == nil {
16042 c.header_ = make(http.Header)
16043 }
16044 return c.header_
16045 }
16046
16047 func (c *ProjectsLocationsWasmPluginsVersionsGetCall) doRequest(alt string) (*http.Response, error) {
16048 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
16049 if c.ifNoneMatch_ != "" {
16050 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
16051 }
16052 c.urlParams_.Set("alt", alt)
16053 c.urlParams_.Set("prettyPrint", "false")
16054 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
16055 urls += "?" + c.urlParams_.Encode()
16056 req, err := http.NewRequest("GET", urls, nil)
16057 if err != nil {
16058 return nil, err
16059 }
16060 req.Header = reqHeaders
16061 googleapi.Expand(req.URL, map[string]string{
16062 "name": c.name,
16063 })
16064 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.versions.get", "request", internallog.HTTPRequest(req, nil))
16065 return gensupport.SendRequest(c.ctx_, c.s.client, req)
16066 }
16067
16068 // Do executes the "networkservices.projects.locations.wasmPlugins.versions.get" call.
16069 // Any non-2xx status code is an error. Response headers are in either
16070 // *WasmPluginVersion.ServerResponse.Header or (if a response was returned at
16071 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
16072 // check whether the returned error was because http.StatusNotModified was
16073 // returned.
16074 func (c *ProjectsLocationsWasmPluginsVersionsGetCall) Do(opts ...googleapi.CallOption) (*WasmPluginVersion, error) {
16075 gensupport.SetOptions(c.urlParams_, opts...)
16076 res, err := c.doRequest("json")
16077 if res != nil && res.StatusCode == http.StatusNotModified {
16078 if res.Body != nil {
16079 res.Body.Close()
16080 }
16081 return nil, gensupport.WrapError(&googleapi.Error{
16082 Code: res.StatusCode,
16083 Header: res.Header,
16084 })
16085 }
16086 if err != nil {
16087 return nil, err
16088 }
16089 defer googleapi.CloseBody(res)
16090 if err := googleapi.CheckResponse(res); err != nil {
16091 return nil, gensupport.WrapError(err)
16092 }
16093 ret := &WasmPluginVersion{
16094 ServerResponse: googleapi.ServerResponse{
16095 Header: res.Header,
16096 HTTPStatusCode: res.StatusCode,
16097 },
16098 }
16099 target := &ret
16100 b, err := gensupport.DecodeResponseBytes(target, res)
16101 if err != nil {
16102 return nil, err
16103 }
16104 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.versions.get", "response", internallog.HTTPResponse(res, b))
16105 return ret, nil
16106 }
16107
16108 type ProjectsLocationsWasmPluginsVersionsListCall struct {
16109 s *Service
16110 parent string
16111 urlParams_ gensupport.URLParams
16112 ifNoneMatch_ string
16113 ctx_ context.Context
16114 header_ http.Header
16115 }
16116
16117 // List: Lists `WasmPluginVersion` resources in a given project and location.
16118 //
16119 // - parent: The `WasmPlugin` resource whose `WasmPluginVersion`s are listed,
16120 // specified in the following format:
16121 // `projects/{project}/locations/global/wasmPlugins/{wasm_plugin}`.
16122 func (r *ProjectsLocationsWasmPluginsVersionsService) List(parent string) *ProjectsLocationsWasmPluginsVersionsListCall {
16123 c := &ProjectsLocationsWasmPluginsVersionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
16124 c.parent = parent
16125 return c
16126 }
16127
16128 // PageSize sets the optional parameter "pageSize": Maximum number of
16129 // `WasmPluginVersion` resources to return per call. If not specified, at most
16130 // 50 `WasmPluginVersion` resources are returned. The maximum value is 1000;
16131 // values above 1000 are coerced to 1000.
16132 func (c *ProjectsLocationsWasmPluginsVersionsListCall) PageSize(pageSize int64) *ProjectsLocationsWasmPluginsVersionsListCall {
16133 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
16134 return c
16135 }
16136
16137 // PageToken sets the optional parameter "pageToken": The value returned by the
16138 // last `ListWasmPluginVersionsResponse` call. Indicates that this is a
16139 // continuation of a prior `ListWasmPluginVersions` call, and that the next
16140 // page of data is to be returned.
16141 func (c *ProjectsLocationsWasmPluginsVersionsListCall) PageToken(pageToken string) *ProjectsLocationsWasmPluginsVersionsListCall {
16142 c.urlParams_.Set("pageToken", pageToken)
16143 return c
16144 }
16145
16146 // Fields allows partial responses to be retrieved. See
16147 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
16148 // details.
16149 func (c *ProjectsLocationsWasmPluginsVersionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsWasmPluginsVersionsListCall {
16150 c.urlParams_.Set("fields", googleapi.CombineFields(s))
16151 return c
16152 }
16153
16154 // IfNoneMatch sets an optional parameter which makes the operation fail if the
16155 // object's ETag matches the given value. This is useful for getting updates
16156 // only after the object has changed since the last request.
16157 func (c *ProjectsLocationsWasmPluginsVersionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsWasmPluginsVersionsListCall {
16158 c.ifNoneMatch_ = entityTag
16159 return c
16160 }
16161
16162 // Context sets the context to be used in this call's Do method.
16163 func (c *ProjectsLocationsWasmPluginsVersionsListCall) Context(ctx context.Context) *ProjectsLocationsWasmPluginsVersionsListCall {
16164 c.ctx_ = ctx
16165 return c
16166 }
16167
16168 // Header returns a http.Header that can be modified by the caller to add
16169 // headers to the request.
16170 func (c *ProjectsLocationsWasmPluginsVersionsListCall) Header() http.Header {
16171 if c.header_ == nil {
16172 c.header_ = make(http.Header)
16173 }
16174 return c.header_
16175 }
16176
16177 func (c *ProjectsLocationsWasmPluginsVersionsListCall) doRequest(alt string) (*http.Response, error) {
16178 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
16179 if c.ifNoneMatch_ != "" {
16180 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
16181 }
16182 c.urlParams_.Set("alt", alt)
16183 c.urlParams_.Set("prettyPrint", "false")
16184 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/versions")
16185 urls += "?" + c.urlParams_.Encode()
16186 req, err := http.NewRequest("GET", urls, nil)
16187 if err != nil {
16188 return nil, err
16189 }
16190 req.Header = reqHeaders
16191 googleapi.Expand(req.URL, map[string]string{
16192 "parent": c.parent,
16193 })
16194 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.versions.list", "request", internallog.HTTPRequest(req, nil))
16195 return gensupport.SendRequest(c.ctx_, c.s.client, req)
16196 }
16197
16198 // Do executes the "networkservices.projects.locations.wasmPlugins.versions.list" call.
16199 // Any non-2xx status code is an error. Response headers are in either
16200 // *ListWasmPluginVersionsResponse.ServerResponse.Header or (if a response was
16201 // returned at all) in error.(*googleapi.Error).Header. Use
16202 // googleapi.IsNotModified to check whether the returned error was because
16203 // http.StatusNotModified was returned.
16204 func (c *ProjectsLocationsWasmPluginsVersionsListCall) Do(opts ...googleapi.CallOption) (*ListWasmPluginVersionsResponse, error) {
16205 gensupport.SetOptions(c.urlParams_, opts...)
16206 res, err := c.doRequest("json")
16207 if res != nil && res.StatusCode == http.StatusNotModified {
16208 if res.Body != nil {
16209 res.Body.Close()
16210 }
16211 return nil, gensupport.WrapError(&googleapi.Error{
16212 Code: res.StatusCode,
16213 Header: res.Header,
16214 })
16215 }
16216 if err != nil {
16217 return nil, err
16218 }
16219 defer googleapi.CloseBody(res)
16220 if err := googleapi.CheckResponse(res); err != nil {
16221 return nil, gensupport.WrapError(err)
16222 }
16223 ret := &ListWasmPluginVersionsResponse{
16224 ServerResponse: googleapi.ServerResponse{
16225 Header: res.Header,
16226 HTTPStatusCode: res.StatusCode,
16227 },
16228 }
16229 target := &ret
16230 b, err := gensupport.DecodeResponseBytes(target, res)
16231 if err != nil {
16232 return nil, err
16233 }
16234 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "networkservices.projects.locations.wasmPlugins.versions.list", "response", internallog.HTTPResponse(res, b))
16235 return ret, nil
16236 }
16237
16238 // Pages invokes f for each page of results.
16239 // A non-nil error returned from f will halt the iteration.
16240 // The provided context supersedes any context provided to the Context method.
16241 func (c *ProjectsLocationsWasmPluginsVersionsListCall) Pages(ctx context.Context, f func(*ListWasmPluginVersionsResponse) error) error {
16242 c.ctx_ = ctx
16243 defer c.PageToken(c.urlParams_.Get("pageToken"))
16244 for {
16245 x, err := c.Do()
16246 if err != nil {
16247 return err
16248 }
16249 if err := f(x); err != nil {
16250 return err
16251 }
16252 if x.NextPageToken == "" {
16253 return nil
16254 }
16255 c.PageToken(x.NextPageToken)
16256 }
16257 }